diff -ruN 6171/article.php 75/article.php
--- 6171/article.php	2004-03-03 12:23:42.000000000 -0600
+++ 75/article.php	2005-06-26 20:45:02.000000000 -0500
@@ -1,41 +1,41 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/article.php
-|
-|	Steve Dunstan 2001-2002
-|	http://jalist.com
-|	stevedunstan@jalist.com
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-
-	Heavily updated by McFly
-
-+---------------------------------------------------------------+
-*/
-// This file is now depracated and remains in core for backward compatibilty reasons.
-
-require_once("class2.php");
-
-$tmp = explode(".", e_QUERY);
-$action = $tmp[0];
-$sub_action = $tmp[1];
-$id = $tmp[2];
-
-
-if($sub_action == 255){	// content page
-	header("location:".e_BASE."content.php?content.".$action);
-	exit;
-}
-
-if($action == 0){	// content page
-	header("location:".e_BASE."content.php?article");
-	exit;
-}else{
-	header("location:".e_BASE."content.php?review");
-	exit;
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/article.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/06/27 01:45:02 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+// This file is now depracated and remains in core for backward compatibilty reasons.
+	
+$tmp = explode(".", $_SERVER['QUERY_STRING']);
+$action = $tmp[0];
+$sub_action = $tmp[1];
+$id = $tmp[2];
+	
+if ($sub_action == 255) {
+	// content page
+	header("Location: content.php?content.{$action}");
+	exit;
+}
+	
+if ($action == 0) {
+	// content page
+	header("Location: content.php?article");
+	exit;
+} else {
+	header("Location: content.php?review");
+	exit;
+}
+	
 ?>
\ No newline at end of file
diff -ruN 6171/backend.php 75/backend.php
--- 6171/backend.php	2004-04-25 23:37:34.000000000 -0500
+++ 75/backend.php	2005-06-26 20:45:02.000000000 -0500
@@ -1,110 +1,105 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/backend.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-
-	$pubdate = strftime("%a, %d %b %Y %I:%M:00 GMT", time());
-	$rss = "<?xml version=\"1.0\"?>
-<rss version=\"2.0\">
-<channel>
-  <title>".SITENAME."</title> 
-  <link>".SITEURL."</link> 
-  <description>".SITEDESCRIPTION."</description> 
-  <language>en-gb</language> 
-  <copyright>".SITEDISCLAIMER."</copyright> 
-  <managingEditor>".SITEADMIN."</managingEditor> 
-  <webMaster>".SITEADMINEMAIL."</webMaster> 
-  <pubDate>$pubdate</pubDate>
-  <lastBuildDate>$pubdate</lastBuildDate>
-  <docs>http://backend.userland.com/rss</docs>
-  <skipDays><day></day></skipDays>
-  <skipHours><hour></hour></skipHours>
-  <generator>e107 website system (http://e107.org)</generator>
-  <ttl>60<ttl>
-
-  <image>
-    <title>".SITENAME."</title> 
-    <url>".SITEBUTTON."</url> 
-    <link>".SITEURL."</link>
-    <width>88</width> 
-    <height>31</height> 
-    <description>".SITETAG."</description>
-  </image>
-   
-  <textInput>
-    <title>Search</title>
-    <description>Search ".SITENAME."</description>
-    <name>query</name>
-    <link>".SITEURL."search.php</link>
-  </textInput>
-  ";
-
-	$sql2 = new db;
-
-	$sql -> db_Select("news", "*", "news_class=0 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ORDER BY news_datestamp DESC LIMIT 0, 10");
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-
-		$sql2 -> db_Select("news_category", "*",  "category_id='$news_category' ");
-		$row = $sql -> db_Fetch(); extract($row);
-		
-		$sql2 -> db_Select("user", "user_name", "user_id='".$news_author."' ");
-		$row = $sql -> db_Fetch(); extract($row);
-
-
-		$tmp = explode(" ", $news_body);
-		unset($nb);
-		for($a=0; $a<=100; $a++){
-			$nb .= $tmp[$a]." ";
-		}
-  		$nb = htmlspecialchars($nb);
-		$wlog .= $news_title."\n".SITEURL."/comment.php?comment.news.".$news_id."\n\n";
-
-		$itemdate = strftime("%a, %d %b %Y %I:%M:00 GMT", $news_datestamp);
-
-
-
-   
-  $rss .= "<item>
-    <title>$news_title</title> 
-    <link>http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</link> 
-    <description>$nb</description>
-    <category domain=\"".SITEURL."\">$category_name</category>
-    <comments>http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</comments>
-    <author>$user_name</author>
-    <pubDate>$itemdate</pubDate>
-    <guid isPermaLink=\"true\">http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</guid>
-  </item>
-  ";
-   
-	}
-
-   
-	$rss .= "</channel>
-</rss>";
-
-
-	echo $rss;
-
-
-
-
-
-
-
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/backend.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/06/27 01:45:02 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+	
+$pubdate = strftime("%a, %d %b %Y %I:%M:00 GMT", time());
+$rss = "<?xml version=\"1.0\"?>
+	<rss version=\"2.0\">
+	<channel>
+	<title>".SITENAME."</title>
+	<link>".SITEURL."</link>
+	<description>".SITEDESCRIPTION."</description>
+	<language>en-gb</language>
+	<copyright>".SITEDISCLAIMER."</copyright>
+	<managingEditor>".SITEADMIN."</managingEditor>
+	<webMaster>".SITEADMINEMAIL."</webMaster>
+	<pubDate>{$pubdate}</pubDate>
+	<lastBuildDate>{$pubdate}</lastBuildDate>
+	<docs>http://backend.userland.com/rss</docs>
+	<skipDays><day></day></skipDays>
+	<skipHours><hour></hour></skipHours>
+	<generator>e107 website system (http://e107.org)</generator>
+	<ttl>60<ttl>
+	 
+	<image>
+	<title>".SITENAME."</title>
+	<url>".SITEBUTTON."</url>
+	<link>".SITEURL."</link>
+	<width>88</width>
+	<height>31</height>
+	<description>".SITETAG."</description>
+	</image>
+	 
+	<textInput>
+	<title>Search</title>
+	<description>Search ".SITENAME."</description>
+	<name>query</name>
+	<link>".SITEURL."search.php</link>
+	</textInput>
+	";
+	
+$sql2 = new db;
+$sql->db_Select("news", "*", "news_class=0 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ORDER BY news_datestamp DESC LIMIT 0, 10");
+while ($row = $sql->db_Fetch()) {
+	extract($row);
+	 
+	$sql2->db_Select("news_category", "*", "category_id='{$news_category}'");
+	$row = $sql->db_Fetch();
+	 extract($row);
+	 
+	$sql2->db_Select("user", "user_name", "user_id='{$news_author}' ");
+	$row = $sql->db_Fetch();
+	 extract($row);
+	 
+	 
+	$tmp = explode(" ", $news_body);
+	unset($nb);
+	for($a = 0; $a <= 100; $a++) {
+		$nb .= $tmp[$a]." ";
+	}
+	$nb = htmlspecialchars($nb);
+	$wlog .= $news_title."\n".SITEURL."/comment.php?comment.news.".$news_id."\n\n";
+	 
+	$itemdate = strftime("%a, %d %b %Y %I:%M:00 GMT", $news_datestamp);
+	 
+	 
+	 
+	 
+	$rss .= "<item>
+		<title>$news_title</title>
+		<link>http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</link>
+		<description>$nb</description>
+		<category domain=\"".SITEURL."\">$category_name</category>
+		<comments>http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</comments>
+		<author>$user_name</author>
+		<pubDate>$itemdate</pubDate>
+		<guid isPermaLink=\"true\">http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</guid>
+		</item>
+		";
+	 
+}
+	
+	
+$rss .= "</channel>
+	</rss>";
+	
+	
+echo $rss;	
+	
 ?>
\ No newline at end of file
diff -ruN 6171/banner.php 75/banner.php
--- 6171/banner.php	2004-05-11 15:10:38.000000000 -0500
+++ 75/banner.php	2005-12-24 16:53:38.000000000 -0600
@@ -1,128 +1,125 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /banner.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-if(e_QUERY){
-        $sql -> db_Select("banner", "*", "banner_id='".e_QUERY."' ");
-        $row = $sql -> db_Fetch(); extract($row);
-        $ip = getip();
-        $newip = (preg_match("/".$ip."\^/", $banner_ip) ? $banner_ip : $banner_ip.$ip."^");
-        $sql -> db_Update("banner", "banner_clicks=banner_clicks+1, banner_ip='$newip' WHERE banner_id='".e_QUERY."' ");
-        header("location: ".$banner_clickurl);
-        exit;
-}
-
-require_once(HEADERF);
-
-if(IsSet($_POST['clientsubmit'])){
-
-        if(!$sql -> db_Select("banner", "*", "banner_clientlogin='".$_POST['clientlogin']."' AND banner_clientpassword='".$_POST['clientpassword']."' ")){
-                $ns -> tablerender("Error", "<br /><div style='text-align:center'>".LAN_20."</div><br />");
-                require_once(FOOTERF);
-                exit;
-        }
-
-        $row = $sql -> db_Fetch(); extract($row);
-
-        $banner_total = $sql -> db_Select("banner", "*", "banner_clientname='$banner_clientname' ");
-
-        $text = "<table class='fborder' style='width:98%'>
-        <tr><td colspan='7' style='text-align:center' class='fcaption'>".LAN_21."</td></tr>
-        <tr>
-        <td class='forumheader' style='text-align:center'><span class='smallblacktext'>".LAN_22."</span></td>
-        <td class='forumheader' style='text-align:center'><span class='smallblacktext'>".LAN_23."</span></td>
-        <td class='forumheader' style='text-align:center'><span class='smallblacktext'>".LAN_24."</span></td>
-        <td class='forumheader' style='text-align:center'><span class='smallblacktext'>".LAN_25."</span></td>
-        <td class='forumheader' style='text-align:center'><span class='smallblacktext'>".LAN_26."</span></td>
-        <td class='forumheader' style='text-align:center'><span class='smallblacktext'>".LAN_27."</span></td>
-        <td class='forumheader' style='text-align:center'><span class='smallblacktext'>".LAN_28."</span></td>
-        </tr>";
-
-        if(!$banner_total){
-                $text .= "<tr>
-                <td colspan='7' class='forumheader2' style='text-align:center'>".LAN_29."</td>";
-        }else{
-                while($row = $sql-> db_Fetch()){
-                        extract($row);
-
-                        $clickpercentage = ($banner_clicks && $banner_impressions ? round(($banner_clicks / $banner_impressions) * 100)."%" : "-");
-                        $impressions_left = ($banner_impurchased ? $banner_impurchased - $banner_impressions : LAN_30);
-                        $impressions_purchased = ($banner_impurchased ? $banner_impurchased : LAN_30);
-
-                        $start_date = ($banner_startdate ? strftime("%d %B %Y", $banner_startdate) : LAN_31);
-                        $end_date = ($banner_enddate ? strftime("%d %B %Y", $banner_enddate) : LAN_31);
-
-                        $text.="<tr>
-                        <td class='forumheader3' style='text-align:center'>".$banner_clientname."</td>
-                        <td class='forumheader3' style='text-align:center'>".$banner_id."</td>
-                        <td class='forumheader3' style='text-align:center'>".$banner_clicks."</td>
-                        <td class='forumheader3' style='text-align:center'>".$clickpercentage."</td>
-                        <td class='forumheader3' style='text-align:center'>".$banner_impressions."</td>
-                        <td class='forumheader3' style='text-align:center'>".$impressions_purchased."</td>
-                        <td class='forumheader3' style='text-align:center'>".$impressions_left."</td>
-                        </tr>
-                        <td colspan='7' class='forumheader3' style='text-align:center'>
-
-                        ".LAN_36. ($banner_active ? LAN_32 : "<b>".LAN_33."</b>")." |
-
-                        ".LAN_36. $start_date.", ".LAN_34.": ".$end_date."</td></tr>";
-
-                        if($banner_ip){
-                                $tmp = explode("^", $banner_ip);
-                                $text .= "<tr><td class='forumheader3'>
-                                ".LAN_35.": ".(count($tmp)-1)."</td>
-                                <td colspan='6' class='forumheader3'>";
-                                for($a=0; $a<=(count($tmp)-2); $a++){
-                                        $text .= $tmp[$a]."<br />";
-                                }
-                        }
-
-
-                        $text .= "</td>
-                        <tr><td colspan='8'>&nbsp;</td></tr>";
-                }
-        }
-
-        $text .= "</table>";
-
-        echo $text;
-
-        require_once(FOOTERF);
-        exit;
-}
-
-$text = "<div style='align:center'>\n
-<form method='post' action='".e_SELF."'>\n
-<table style='width:40%'>
-<tr>
-<td style='width:15%' class='defaulttext'>".LAN_16."</td>
-<td><input class='tbox' type='text' name='clientlogin' size='30' value='$id' maxlength='20' />\n</td>
-</tr>
-<tr>
-<td style='width:15%' class='defaulttext'>".LAN_17."</td>
-<td><input class='tbox' type='password' name='clientpassword' size='30' value='' maxlength='20' />\n</td>
-</tr>
-<tr>
-<td style='width:15%'></td>
-<td>
-<input class='button' type='submit' name='clientsubmit' value='".LAN_18."' />
-</td>
-</tr>
-</table></form></div>";
-$ns -> tablerender(LAN_19, $text);
-require_once(FOOTERF);
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/banner.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2005/12/24 22:53:38 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+	
+if (e_QUERY) {
+	$query_string = intval(e_QUERY);
+	$sql->db_Select("banner", "*", "banner_id = '{$query_string}' ");
+	$row = $sql->db_Fetch();
+	$ip = $e107->getip();
+	$newip = (strpos($row['banner_ip'], "{$ip}^") !== FALSE) ? $row['banner_ip'] : "{$row['banner_ip']}{$ip}^";
+	$sql->db_Update("banner", "banner_clicks = banner_clicks + 1, `banner_ip` = '{$newip}' WHERE `banner_id` = '{$query_string}'");
+	header("Location: {$row['banner_clickurl']}");
+	exit;
+}
+	
+require_once(HEADERF);
+	
+if (isset($_POST['clientsubmit'])) {
+	
+	$clean_login = $tp -> toDB($_POST['clientlogin']);
+	$clean_password = $tp -> toDB($_POST['clientpassword']);
+	
+	if (!$sql->db_Select("banner", "*", "`banner_clientlogin` = '{$clean_login}' AND `banner_clientpassword` = '{$clean_password}'")) {
+		$ns->tablerender(LAN_38, "<br /><div style='text-align:center'>".LAN_20."</div><br />");
+		require_once(FOOTERF);
+		exit;
+	}
+	 
+	$row = $sql->db_Fetch();
+	$banner_total = $sql->db_Select("banner", "*", "`banner_clientname` = '{$row['banner_clientname']}'");
+	 
+	if (!$banner_total) {
+		$ns->tablerender(LAN_38, "<br /><div style='text-align:center'>".LAN_29."</div><br />");
+		require_once(FOOTERF);
+		exit;
+	} else {
+		while ($row = $sql->db_Fetch()) {
+			 
+			$start_date = ($row['banner_startdate'] ? strftime("%d %B %Y", $row['banner_startdate']) : LAN_31);
+			$end_date = ($row['banner_enddate'] ? strftime("%d %B %Y", $row['banner_enddate']) : LAN_31);
+			 
+			$BANNER_TABLE_CLICKPERCENTAGE = ($row['banner_clicks'] && $row['banner_impressions'] ? round(($row['banner_clicks'] / $row['banner_impressions']) * 100)."%" : "-");
+			$BANNER_TABLE_IMPRESSIONS_LEFT = ($row['banner_impurchased'] ? $row['banner_impurchased'] - $row['banner_impressions'] : LAN_30);
+			$BANNER_TABLE_IMPRESSIONS_PURCHASED = ($row['banner_impurchased'] ? $row['banner_impurchased'] : LAN_30);
+			$BANNER_TABLE_CLIENTNAME = $row['banner_clientname'];
+			$BANNER_TABLE_BANNER_ID = $row['banner_id'];
+			$BANNER_TABLE_BANNER_CLICKS = $row['banner_clicks'];
+			$BANNER_TABLE_BANNER_IMPRESSIONS = $row['banner_impressions'];
+			$BANNER_TABLE_ACTIVE = LAN_36.($row['banner_active'] != "255" ? LAN_32 : "<b>".LAN_33."</b>");
+			$BANNER_TABLE_STARTDATE = LAN_37." ".$start_date;
+			$BANNER_TABLE_ENDDATE = LAN_34." ".$end_date;
+			
+			if ($row['banner_ip']) {
+				$tmp = explode("^", $row['banner_ip']);
+				$BANNER_TABLE_IP_LAN = LAN_35.": ".(count($tmp)-1);
+				for($a = 0; $a <= (count($tmp)-2); $a++) {
+					$BANNER_TABLE_IP .= $tmp[$a]."<br />";
+				}
+			}
+			 
+			if (!$BANNER_TABLE) {
+				if (file_exists(THEME."banner_template.php")) {
+					require_once(THEME."banner_template.php");
+				} else {
+					require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
+				}
+			}
+			$textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE);
+		}
+	}
+	 
+	if (!$BANNER_TABLE) {
+		if (file_exists(THEME."banner_template.php")) {
+			require_once(THEME."banner_template.php");
+		} else {
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
+		}
+	}
+	$textstart = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE_START);
+	$textend = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_TABLE_END);
+	$text = $textstart.$textstring.$textend;
+	 
+	echo $text;
+	 
+	require_once(FOOTERF);
+	exit;
+}
+	
+	
+$BANNER_LOGIN_TABLE_LOGIN = $rs->form_text("clientlogin", 30, $id, 20, "tbox");
+$BANNER_LOGIN_TABLE_PASSW = $rs->form_password("clientpassword", 30, "", 20, "tbox");
+$BANNER_LOGIN_TABLE_SUBMIT = $rs->form_button("submit", "clientsubmit", LAN_18);
+	
+if (!$BANNER_LOGIN_TABLE) {
+	if (file_exists(THEME."banner_template.php")) {
+		require_once(THEME."banner_template.php");
+	} else {
+		require_once(e_BASE.$THEMES_DIRECTORY."templates/banner_template.php");
+	}
+}
+$text = preg_replace("/\{(.*?)\}/e", '$\1', $BANNER_LOGIN_TABLE);
+$ns->tablerender(LAN_19, $text);
+	
+	
+require_once(FOOTERF);
+	
 ?>
\ No newline at end of file
diff -ruN 6171/chat.php 75/chat.php
--- 6171/chat.php	2004-03-03 13:41:12.000000000 -0600
+++ 75/chat.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,65 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/chat.php
-|
-|	Steve Dunstan 2001-2002
-|	http://jalist.com
-|	stevedunstan@jalist.com
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-require_once(HEADERF);
-
-
-$sql -> db_Select("menus", "*", "menu_name='chatbox_menu'");
-$row = $sql -> db_Fetch(); extract($row);
-if(!check_class($menu_class)){
-	$ns -> tablerender(LAN_14, "<div style='text-align:center'>".LAN_15."</div>");
-	require_once(FOOTERF);
-	exit;
-}
-
-if(strstr(e_QUERY, "fs")){
-	$cgtm = str_replace(".fs", "", e_QUERY);
-	$fs = TRUE;
-	unset($tmp);
-}
-
-if(e_QUERY ? $from = e_QUERY : $from = 0);
-
-if(!$view){ $view = 30; }
-
-$chat_total = $sql -> db_Count("chatbox");
-$text = "<br /><table style='width:100%'><tr><td>";
-
-if($fs){
-	$sql -> db_Select("chatbox", "*", "cb_id='$cgtm'");
-}else{
-	$sql -> db_Select("chatbox", "*", "ORDER BY cb_datestamp DESC LIMIT $from, ".$view, $mode="no_where");
-}
-$obj2 = new convert;
-$aj = new textparse;
-while($row = $sql-> db_Fetch()){
-	$datestamp = $obj2->convert_date($row['cb_datestamp'], "long");
-	$cb_nick = eregi_replace("[0-9]+\.", "", $row['cb_nick']);
-	$cb_message = ($row['cb_blocked']  ? LAN_16 : $aj -> tpa($row['cb_message']));
-	if(!eregi("<a href|<img|&#", $cb_message)){
-		$cb_message = preg_replace("/([^\s]{100})/", "$1\n", $cb_message);
-	}
-	$text .= "\n<div class='spacer'>".($flag ? "<div class='forumheader3'>" : "<div class='forumheader4'>")."
-<img src='".THEME."images/bullet2.gif' alt='bullet' /> \n<b>".$cb_nick."</b> ".LAN_13." ".$datestamp."<br /><div class='defaulttext'><i>".$cb_message."</i></div>\n</div></div>\n";
-	$flag = (!$flag ? TRUE : FALSE);
-}
-$text .= "</td></tr></table>";
-$ns -> tablerender(LAN_11, $text);
-if(!$fs){
-	require_once(e_HANDLER."np_class.php");
-	$ix = new nextprev("chat.php", $from, 30, $chat_total, LAN_12);
-}
-require_once(FOOTERF);
-?>
\ No newline at end of file
diff -ruN 6171/class2.php 75/class2.php
--- 6171/class2.php	2005-05-12 23:21:48.000000000 -0500
+++ 75/class2.php	2006-05-15 08:32:20.000000000 -0500
@@ -1,1149 +1,1367 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/class2.php,v $
-|     $Revision: 1.94 $
-|     $Date: 2004/09/03 15:40:55 $
-|     $Author: mcfly_e107 $
-+----------------------------------------------------------------------------+
-*/
-
-//unset any globals created by register_globals being turned ON
-while (list($global) = each($GLOBALS)){
-        if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|GLOBALS|HTTP.*|_REQUEST)$/', $global)){
-                unset($$global);
-        }
-}
-unset($global);
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-//ob_start ("ob_gzhandler")
-ob_start ();
-$timing_start = explode(' ', microtime());
-error_reporting(E_ERROR | E_WARNING | E_PARSE);
-
-if(!$mySQLserver){
-        @include("e107_config.php");
-        $a=0; $p="";
-        while(!$mySQLserver && $a<5){
-                $a++;
-                $p.="../";
-                @include($p."e107_config.php");
-        }
-        if(!defined("e_HTTP")){ header("Location:install.php"); exit; }
-}
-// e107_config.php upgrade - paths should have been in there from the beginning !
-if(!$ADMIN_DIRECTORY && !$DOWNLOADS_DIRECTORY){
-echo "<div style='text-align:center; font: 12px Verdana, Tahoma'><b>To complete the upgrade, copy the following text into your e107_config.php file: </b><br /><br />";
-echo chr(36)."ADMIN_DIRECTORY = \"e107_admin/\";<br />
-".chr(36)."FILES_DIRECTORY = \"e107_files/\";<br />
-".chr(36)."IMAGES_DIRECTORY = \"e107_images/\"; <br />
-".chr(36)."THEMES_DIRECTORY = \"e107_themes/\"; <br />
-".chr(36)."PLUGINS_DIRECTORY = \"e107_plugins/\"; <br />
-".chr(36)."HANDLERS_DIRECTORY = \"e107_handlers/\"; <br />
-".chr(36)."LANGUAGES_DIRECTORY = \"e107_languages/\"; <br />
-".chr(36)."HELP_DIRECTORY = \"e107_docs/help/\";  <br />
-".chr(36)."DOWNLOADS_DIRECTORY =  \"e107_files/downloads/\";\n";
-echo "</div>";
-exit;
-}
-// =====================
-
-$link_prefix="";
-$url_prefix=substr($_SERVER['PHP_SELF'],strlen(e_HTTP),strrpos($_SERVER['PHP_SELF'],"/")+1-strlen(e_HTTP));
-$tmp=explode("?",$url_prefix);
-$num_levels=substr_count($tmp[0],"/");
-for($i=1;$i<=$num_levels;$i++){
-        $link_prefix.="../";
-}
-
-if(strstr($_SERVER['QUERY_STRING'], "'") || strstr($_SERVER['QUERY_STRING'], ";") ){ die("Access denied."); }
-$inArray = array("'", ";", "/**/", "/UNION/", "/SELECT/", "AS");
-foreach($inArray as $res)
-{
-	if(strstr($_SERVER['QUERY_STRING'], $res))
-	{
-		die("Access denied.");
-	}
-}
-
-
-if(preg_match("/\[(.*?)\].*?/i", $_SERVER['QUERY_STRING'], $matches)){
-define("e_MENU", $matches[1]);
-        define("e_QUERY", str_replace($matches[0], "", eregi_replace("&|/?PHPSESSID.*", "", $_SERVER['QUERY_STRING'])));
-}else{
-        define("e_QUERY", eregi_replace("&|/?PHPSESSID.*", "", $_SERVER['QUERY_STRING']));
-}
-if(strstr(e_MENU, "debug")){ error_reporting(E_ALL); }
-$_SERVER['QUERY_STRING'] = e_QUERY;
-define('e_BASE',$link_prefix);
-define("e_ADMIN", e_BASE.$ADMIN_DIRECTORY);
-define("e_IMAGE", e_BASE.$IMAGES_DIRECTORY);
-define("e_THEME", e_BASE.$THEMES_DIRECTORY);
-define("e_PLUGIN", (defined("CORE_PATH") ? e_BASE.SUBDIR_SITE."/".$PLUGINS_DIRECTORY : e_BASE.$PLUGINS_DIRECTORY));
-define("e_FILE", e_BASE.$FILES_DIRECTORY);
-define("e_HANDLER", e_BASE.$HANDLERS_DIRECTORY);
-define("e_LANGUAGEDIR", e_BASE.$LANGUAGES_DIRECTORY);
-define("e_DOCS", e_BASE.$HELP_DIRECTORY);
-define("e_DOCROOT",$_SERVER['DOCUMENT_ROOT']."/");
-define("e_UC_PUBLIC", 0);
-define("e_UC_READONLY", 251);
-define("e_UC_GUEST", 252);
-define("e_UC_MEMBER", 253);
-define("e_UC_ADMIN", 254);
-define("e_UC_NOBODY", 255);
-define("ADMINDIR", $ADMIN_DIRECTORY);
-
-if(!@include(e_HANDLER."errorhandler_class.php")){
-        echo "<div style='text-align:center; font: 12px Verdana, Tahoma'>Path error</div>";
-        exit;
-}
-set_error_handler("error_handler");
-if(!$mySQLuser){ header("location:install.php"); exit; }
-define("MPREFIX", $mySQLprefix);
-
-@require_once(e_HANDLER."message_handler.php");
-@require_once(e_HANDLER."mysql_class.php");
-
-$sql = new db;
-$sql -> db_SetErrorReporting(FALSE);
-$merror = $sql -> db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
-
-if($merror == "e1"){ message_handler("CRITICAL_ERROR", 6,  ": generic, ", "class2.php"); exit;
-}else if($merror == "e2"){ message_handler("CRITICAL_ERROR", 7,  ": generic, ", "class2.php"); exit;}
-
-// New parser code #########
-$parsethis=array();
-if($sql -> db_Select("parser", "parser_pluginname,parser_regexp", "")){
-        while($row = $sql -> db_Fetch('nostrip')){
-                $parsethis[$row['parser_regexp']]=$row['parser_pluginname'];
-        }
-}
-// End parser code #########
-
-$sql -> db_Select("core", "*", "e107_name='pref' ");
-$row = $sql -> db_Fetch();
-
-$tmp = stripslashes($row['e107_value']);
-$pref=unserialize($tmp);
-foreach($pref as $key => $prefvalue){
-        $pref[$key] = textparse::formtparev($prefvalue);
-}
-if(!is_array($pref)){
-        $pref=unserialize($row['e107_value']);
-        if(!is_array($pref)){
-                ($sql -> db_Select("core", "*", "e107_name='pref' ") ? message_handler("CRITICAL_ERROR", 1,  __LINE__, __FILE__) : message_handler("CRITICAL_ERROR", 2,  __LINE__, __FILE__));
-                if($sql -> db_Select("core", "*", "e107_name='pref_backup' ")){
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $tmp = addslashes(serialize($e107_value ));
-                        $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='pref' ");
-                        message_handler("CRITICAL_ERROR", 3,  __LINE__, __FILE__);
-                }else{
-                message_handler("CRITICAL_ERROR", 4,  __LINE__, __FILE__);
-                exit;
-        }
-}
-}
-
-if(!$pref['cookie_name']){ $pref['cookie_name'] = "e107cookie"; }
-//if($pref['user_tracking'] == "session"){ @require_once(e_HANDLER."session_handler.php"); }        // if your server session handling is misconfigured uncomment this line and comment the next to use custom session handler
-if($pref['user_tracking'] == "session"){ session_start(); }
-
-define("e_SELF", ($pref['ssl_enabled'] ? "https://".$_SERVER['HTTP_HOST'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME']) : "http://".$_SERVER['HTTP_HOST'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME'])));
-
-$sql -> db_Select("core", "*", "e107_name='menu_pref' ");
-$row = $sql -> db_Fetch();
-$tmp = stripslashes($row['e107_value']);
-$menu_pref=unserialize($tmp);
-
-$page = substr(strrchr($_SERVER['PHP_SELF'], "/"), 1);
-define("e_PAGE", $page);
-
-if($pref['frontpage'] && $pref['frontpage_type'] == "splash"){
-        $ip = getip();
-        if(!$sql -> db_Count("online", "(*)", "WHERE online_ip='{$ip}' ")){
-                online();
-                if(is_numeric($pref['frontpage'])){
-                        header("location:".e_BASE."article.php?".$pref['frontpage'].".255");
-                        exit;
-                } else if(eregi("http", $pref['frontpage'])) {
-                        header("location: ".$pref['frontpage']);
-                        exit;
-                } else {
-                        header("location: ".e_BASE.$pref['frontpage'].".php");
-                        exit;
-                }
-        }
-}
-
-if($pref['cachestatus']){
-        require_once(e_HANDLER."cache_handler.php");
-        $e107cache = new ecache;
-}
-
-function retrieve_cache($query){
-        global $e107cache;
-        if(!is_object($e107cache)){return FALSE;}
-   return $e107cache -> retrieve($query);
-}
-
-function set_cache($query, $text){
-        global $e107cache;
-        if(!is_object($e107cache)){return FALSE;}
-        $e107cache -> set($query,$text);
-}
-
-function clear_cache($query){
-        global $e107cache;
-        if(!is_object($e107cache)){return FALSE;}
-        return $e107cache -> clear($query);
-}
-
-if($pref['del_unv']){
-        $threshold = (time() - ($pref['del_unv']*60));
-        $sql -> db_Delete("user", "user_ban = 2 AND user_join<'$threshold' ");
-}
-if($pref['modules']){
-        $mods = explode(",",$pref['modules']);
-        foreach($mods as $mod){
-                if(file_exists(e_PLUGIN."{$mod}/module.php")){
-                        @require_once(e_PLUGIN."{$mod}/module.php");
-                }
-        }
-}
-
-//###########  Module redifinable functions ###############
-if(!function_exists('checkvalidtheme')){
-        function checkvalidtheme($theme_check){
-                // arg1 = theme to check
-                global $ADMIN_DIRECTORY;
-                if(@fopen(e_THEME.$theme_check."/theme.php", r)){
-                        define("THEME", e_THEME.$theme_check."/");
-                }else {
-                        @require_once(e_HANDLER."debug_handler.php");
-                        @require_once(e_HANDLER."textparse/basic.php");
-                        $etp = new e107_basicparse;
-                        $e107tmp_theme = search_validtheme();
-                        define("THEME", e_THEME.$e107tmp_theme."/");
-                        if(ADMIN && !strstr(e_SELF, $ADMIN_DIRECTORY)){echo '<script>alert("'.$etp->unentity(CORE_LAN1).'")</script>';}
-                }
-        }
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-if(!class_exists('convert')){
-        class convert{
-                function convert_date($datestamp, $mode="long"){
-                        /*
-                        # Date convert
-                        # - parameter #1:                string $datestamp, unix stamp
-                        # - parameter #2:                string $mode, date format, default long
-                        # - return                                parsed text
-                        # - scope                                        public
-                        */
-                        global $pref;
-
-                        $datestamp += (TIMEOFFSET*3600);
-                        if($mode == "long"){
-                                return strftime($pref['longdate'], $datestamp);
-                        }else if($mode == "short"){
-                                return strftime($pref['shortdate'], $datestamp);
-                        }else {
-                                return strftime($pref['forumdate'], $datestamp);
-                        }
-                }
-        }
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-if(!class_exists('e107_table')){
-        class e107table{
-                function tablerender($caption, $text, $mode="default", $return=FALSE){
-                        /*
-                        # Render style table
-                        # - parameter #1:                string $caption, caption text
-                        # - parameter #2:                string $text, body text
-                        # - return                                null
-                        # - scope                                        public
-                        */
-                        if(function_exists("theme_tablerender")){
-                                $result = call_user_func("theme_tablerender",$caption,$text,$mode,$return);
-                                if($result == "return"){return;}
-                                extract($result);
-                        }
-                        if($return){
-                                ob_end_flush();
-                                ob_start();
-                                tablestyle($caption, $text, $mode);
-                                $ret = ob_get_contents();
-                                ob_end_clean();
-                                return($ret);
-                        }else {
-                                tablestyle($caption, $text, $mode);
-                        }
-                }
-        }
-}
-//#############################################################
-
-init_session();
-online();
-
-$fp = ($pref['frontpage'] ? $pref['frontpage'].".php" : "news.php index.php");
-define("e_SIGNUP", (file_exists(e_BASE."customsignup.php") ? e_BASE."customsignup.php" : e_BASE."signup.php"));
-define("e_LOGIN", (file_exists(e_BASE."customlogin.php") ? e_BASE."customlogin.php" : e_BASE."login.php"));
-
-if($pref['membersonly_enabled'] && !USER && e_PAGE != e_SIGNUP && e_PAGE != "index.php" && e_PAGE != "fpw.php" && e_PAGE != e_LOGIN && !strstr(e_PAGE, "admin") && e_PAGE != 'membersonly.php'){
-        header("location: ".e_BASE."membersonly.php");
-        exit;
-}
-
-$sql -> db_Delete("tmp", "tmp_time < '".(time()-300)."' AND tmp_ip!='data' AND tmp_ip!='adminlog' AND tmp_ip!='submitted_link' AND tmp_ip!='reported_post' AND tmp_ip!='var_store' ");
-
-define("SITENAME", $pref['sitename']);
-define("SITEURL", (substr($pref['siteurl'], -1) == "/" ? $pref['siteurl'] : $pref['siteurl']."/"));
-define("SITEBUTTON", $pref['sitebutton']);
-define("SITETAG", $pref['sitetag']);
-define("SITEDESCRIPTION", $pref['sitedescription']);
-define("SITEADMIN", $pref['siteadmin']);
-define("SITEADMINEMAIL", $pref['siteadminemail']);
-
-$search = array("&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "");
-$replace =  array("\"", "'", "\\", '\"', "\'", "&#169;");
-define("SITEDISCLAIMER", str_replace($search, $replace, $pref['sitedisclaimer']));
-
-$language = ($pref['sitelanguage'] ? $pref['sitelanguage'] : "English");
-
-define("e_LAN", $language);
-define("e_LANGUAGE", (!USERLAN || !defined("USERLAN") ? $language : USERLAN));
-
-@include(e_LANGUAGEDIR.e_LANGUAGE."/".e_LANGUAGE.".php");
-
-if($pref['maintainance_flag'] && ADMIN == FALSE && !eregi("admin", e_SELF)){
-        @include(e_LANGUAGEDIR.e_LANGUAGE."/lan_sitedown.php");
-        @include(e_LANGUAGEDIR."English/lan_sitedown.php");
-        @require_once(e_BASE."sitedown.php"); exit;
-}
-
-if(defined("CORE_PATH") && ($page == "index.php" || !$page)){ $page = "news.php"; }
-
-if(strstr(e_SELF, $ADMIN_DIRECTORY) || strstr(e_SELF, "admin.php")){
-        @include(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_".e_PAGE);
-        @include(e_LANGUAGEDIR."English/admin/lan_".e_PAGE);
-}else{
-        @include(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE);
-        @include(e_LANGUAGEDIR."English/lan_".e_PAGE);
-}
-
-if(IsSet($_POST['userlogin'])){
-        @require_once(e_HANDLER."login.php");
-        $usr = new userlogin($_POST['username'], $_POST['userpass'], $_POST['autologin']);
-}
-
-if(e_QUERY == "logout"){
-        $ip = getip();
-        $udata = (USER === TRUE) ? USERID.".".USERNAME : "0";
-        $sql -> db_Update("online", "online_user_id = '0', online_pagecount=online_pagecount+1 WHERE online_user_id = '{$udata}' LIMIT 1");
-        if($pref['user_tracking'] == "session"){ session_destroy(); $_SESSION[$pref['cookie_name']] = ""; }
-        cookie($pref['cookie_name'], "", (time()-2592000));
-        echo "<script type='text/javascript'>document.location.href='".e_BASE."index.php'</script>\n";
-        exit;
-}
-ban();
-
-define("TIMEOFFSET", $pref['time_offset']);
-//define("FLOODTIME", $pref['flood_time']);
-//define("FLOODHITS", $pref['flood_hits']);
-
-if((strstr(e_SELF, $ADMIN_DIRECTORY) || strstr(e_SELF, "admin") ) && $pref['admintheme'] && !$_POST['sitetheme']){
-        if(strstr(e_SELF, "menus.php")){
-                        checkvalidtheme($pref['sitetheme']);
-        } else if(strstr(e_SELF, "newspost.php")){
-                        define("MAINTHEME", e_THEME.$pref['sitetheme']."/");
-                        checkvalidtheme($pref['admintheme']);
-        } else {
-                        checkvalidtheme($pref['admintheme']);
-        }
-} else {
-         if(USERTHEME != FALSE && USERTHEME != "USERTHEME"){
-                        checkvalidtheme(USERTHEME);
-                } else {
-                        checkvalidtheme($pref['sitetheme']);
-                }
-}
-@require_once(THEME."theme.php");
-
-if($pref['anon_post'] ? define("ANON", TRUE) : define("ANON", FALSE));
-if(Empty($pref['newsposts']) ? define("ITEMVIEW", 15) : define("ITEMVIEW", $pref['newsposts']));
-
-if($pref['$antiflood1']==1){  define('FLOODPROTECT', TRUE); define('FLOODTIMEOUT', $pref['antiflood_timeout']); }
-
-define ("HEADERF", e_THEME."templates/header".$layout.".php");
-define ("FOOTERF", e_THEME."templates/footer".$layout.".php");
-if(!file_exists(HEADERF)){message_handler("CRITICAL_ERROR", "Unable to find file: ".HEADERF,  __LINE__-2, __FILE__);}
-if(!file_exists(FOOTERF)){message_handler("CRITICAL_ERROR", "Unable to find file: ".FOOTERF,  __LINE__-2, __FILE__);}
-
-define("LOGINMESSAGE", "");
-$ns = new e107table;
-
-define("OPEN_BASEDIR", (ini_get('open_basedir') ? TRUE : FALSE));
-define("SAFE_MODE", (ini_get('safe_mode') ? TRUE : FALSE));
-define("MAGIC_QUOTES_GPC", (ini_get('magic_quotes_gpc') ? TRUE : FALSE));
-define("FILE_UPLOADS", (ini_get('file_uploads') ? TRUE : FALSE));
-define("INIT", TRUE);
-
-define("e_ADMIN", $e_BASE.$ADMIN_DIRECTORY);
-//define("e_REFERER_SELF",($_SERVER["HTTP_REFERER"] == e_SELF));
-$tmp = explode("?", $_SERVER['HTTP_REFERER']);
-define("e_REFERER_SELF",($tmp[0] == e_SELF)); 
-
-
-
-//@require_once(e_HANDLER."IPB_int.php");
-//@require_once(e_HANDLER."debug_handler.php");
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function e107_parse($text,$referrer){
-        preg_match_all("#{CODE=(.*?)}#",$text,$matches,PREG_SET_ORDER);
-        for ($i=0; $i< count($matches); $i++) {
-                $p = explode(".",$matches[$i][1]);
-                $parse_func = "parse_".$p[1];
-                if(!function_exists($parse_func)){
-                        $parse_file = ('CORE' == $p[0]) ?  e_HANDLER."parse/" : e_PLUGIN.$p[0]."/parse/";
-                        $parse_file .= "parse_{$p[1]}.php";
-                        if(file_exists($parse_file)){
-                                @require_once($parse_file);
-                        }
-                }
-                if(function_exists($parse_func)){
-                        $newtext = call_user_func($parse_func,$matches[$i],$referrer);
-                } else {
-                        $newtext = "";
-                }
-                $text = str_replace($matches[$i][0],$newtext,$text);
-        }
-
-        global $parsethis;
-        if($parsethis){
-                @require_once(e_HANDLER.'parser_functions.php');
-                foreach($parsethis as $parser_regexp => $parser_name){
-                        preg_match_all($parser_regexp,$text,$matches,PREG_SET_ORDER);
-                        for ($i=0; $i< count($matches); $i++) {
-                                if($parser_name != "e107_core" && file_exists(e_PLUGIN.$parser_name.'/parser.php')){
-                                        @require_once(e_PLUGIN.$parser_name.'/parser.php');
-                                }
-                                if(function_exists($parser_name.'_parse')) {
-                                        $newtext=call_user_func($parser_name.'_parse',$matches[$i],$referrer);
-                                        $text = str_replace($matches[$i][0],$newtext,$text);
-                                }
-                        }
-                }
-                $text = preg_replace("#{{.*?}}#","",$text);
-        }
-        return $text;
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-class textparse{
-
-        var $emotes;
-        var $searcha;
-        var $searchb;
-        var $replace;
-        var $profan;
-
-        function textparse(){
-                // constructor
-                global $pref;
-                                $pref['profanity_words'] = preg_replace("#(,$)#", "", $pref['profanity_words']);
-                if($pref['profanity_filter']){
-                        $this->profan = str_replace(",", "|", $pref['profanity_words']);
-                }
-
-                if($pref['smiley_activate']){
-                        $sql = new db;
-                        $sql -> db_Select("core", "*", "e107_name='emote'");
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $this->emotes = unserialize($e107_value);
-
-                        $c=0;
-                        while(list($code, $name) = each($this->emotes[$c])){
-                                $this->searcha[$c] = " ".$code;
-                                $this->searchb[$c] = "\n".$code;
-                                $this->replace[$c] = " <img src='".e_IMAGE."emoticons/$name' alt='' style='vertical-align:middle; border:0' /> ";
-                                $c++;
-                        }
-                }
-        }
-
-        function editparse($text, $mode="off"){
-                /*
-                # Edit parse
-                # - parameter #1:                string $text, text to parse
-                # - parameter #2:                string $mode, on=links not parsed, default=off
-                # - return                                parsed text
-                # - scope                                        public
-                */
-                //                $text = stripslashes($text);
-                $search = array();
-                $replace = array();
-                $search[0] = "/\<div class=\"indent\"\>\<i\>'.CORE_LAN2.' (.*?)\<\/i\>\<br \/\>\"(.*?)\"\<\/div\>/si";
-                $replace[0] = '[quote=\1]\2[/quote]';
-                $search[1] = "/\<div class=\"indent\"\>\<i\>'.CORE_LAN2.' (.*?)\<\/i\> ...\<br \/\>\"(.*?)\"\<\/div\>/si";
-                $replace[1] = '[quote=\1]\2[/quote]';
-                $search[2] = "/\<div class=\"indent\"\>(.*?)\<\/div\>/si";
-                $replace[2] = '[blockquote]\1[/blockquote]';
-                $search[3] = "/\<b>(.*?)\<\/b\>/si";
-                $replace[3] = '[b]\1[/b]';
-                $search[4] = "/\<i>(.*?)\<\/i\>/si";
-                $replace[4] = '[i]\1[/i]';
-                $search[5] = "/\<u>(.*?)\<\/u\>/si";
-                $replace[5] = '[u]\1[/u]';
-                $search[6] = "/\<img alt=\"\" src=\"(.*?)\" \/>/si";
-                $replace[6] = '[img]\1[/img]';
-                $search[7] =  "/\<div style=\"text-align:center\"\>(.*?)\<\/div\>/si";
-                $replace[7] = '[center]\1[/center]';
-                $search[8] =  "/\<div style=\"text-align:left\"\>(.*?)\<\/div\>/si";
-                $replace[8] = '[left]\1[/left]';
-                $search[9] =  "/\<div style=\"text-align:right\"\>(.*?)\<\/div\>/si";
-                $replace[9] = '[right]\1[/right]';
-                $search[10] = "/\<code>(.*?)\<\/code\>/si";
-                $replace[10] = '[code]\1[/code]';
-                if($mode == "off"){
-                        $search[11] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
-                        $replace[11] = '[link=\\1]\\2[/link]';
-                }
-                $search[12] = "#\[edited\](.*?)\[/edited\]#si";
-                $replace[12] = '';
-                $text = preg_replace($search, $replace, $text);
-                return $text;
-        }
-
-
-        function tpj($text, $strip=FALSE){
-                                                        $text = preg_replace_callback("/&#([0-9]{1,3});/",create_function('$matches','return chr($matches[1]);'),$text);
-                        $search[0] = "#script#si";
-                        $replace[0] = 'scri<i></i>pt';
-                        $search[1] = "#document#si";
-                        $replace[1] = 'docu<i></i>ment';
-                        $search[2] = "#expression#si";
-                        $replace[2] = 'expres<i></i>sion';
-                        $search[3] = "#onmouseover#si";
-                        $replace[3] = 'onmouse<i></i>over';
-                        $search[4] = "#onclick#si";
-                        $replace[4] = 'on<i></i>click';
-                        $search[5] = "#onmousedown#si";
-                        $replace[5] = 'onmouse<i></i>down';
-                        $search[6] = "#onmouseup#si";
-                        $replace[6] = 'onmouse<i></i>up';
-                        $search[7] = "#ondblclick#si";
-                        $replace[7] = 'on<i></i>dblclick';
-                        $search[8] = "#onmouseout#si";
-                        $replace[8] = 'onmouse<i></i>out';
-                        $search[9] = "#onmousemove#si";
-                        $replace[9] = 'onmouse<i></i>move';
-                        $search[10] = "#onload#si";
-                        $replace[10] = 'on<i></i>load';
-                        $search[11] = "#background: *?url#si";
-                        $replace[11] = 'background<i></i>:url';
-                                                                $search[12] = "#(meta )#si";
-                                                                $replace[12] = '\1<i></i>';
-
-                        if($strip){
-                                $text = strip_tags($text);
-                        }
-         $text = preg_replace($search, $replace, $text);
-         return $text;
-        }
-
-        function tpa($text, $mode="off", $referrer="", $highlight_search=FALSE, $poster_id=""){
-                /*
-                # Post parse
-                # - parameter #1:                string $text, text to parse
-                # - parameter #2:                string $mode, on=line breaks not replaced, default off
-                # - return                                        parsed text
-                # - scope                                        public
-                */
-                global $pref;
-                global $referrer;
-                global $poster_userid;
-                $poster_userid=$poster_id;
-                $text = " ".$text;
-                if($pref['profanity_filter'] && $this->profan){
-                        $text = eregi_replace($this->profan, $pref['profanity_replace'], $text);
-                }
-                if($pref['smiley_activate']){
-                        $text = str_replace($this->searcha, $this->replace, $text);
-                        $text = str_replace($this->searchb, $this->replace, $text);
-                }
-                $text = str_replace("$", "&#36;", $text);
-                                $text = code($text, "notdef");
-            if($mode != "nobreak"){ $text = nl2br($text); }
-                                $text = preg_replace("/\n/i", " ", $text);
-                                $text = str_replace("<br />", " <br />" , $text);
-                                $text = e107_parse($text,$referrer);
-                                $text = $this -> bbcode($text, $mode, $referrer);
-                                if($mode != "on"){
-                                        $text = $this -> wrap($text, $mode, $referrer, $highlight_search);
-                                }
-                                if(MAGIC_QUOTES_GPC){ $text = stripslashes($text); }
-                                $search = array("&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&lt;span", "&lt;/span");
-                                $replace =  array("\"", "'", "\\", '\"', "\'", "<span", "</span");
-                                $text = str_replace($search, $replace, $text);
-                                $text = str_replace("<br /><br />", "<br />", $text);
-                                $text = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $text);
-                                $text = substr($text, 1);
-                                $text = html($text);
-                                return $text;
-                }
-
-                function wrap($text, $mode, $referrer, $highlight_search=FALSE){
-                        global $pref;
-                        $wrapcount = 100;
-                        $message_array = explode(" ", $text);
-                        for($i=0; $i<=(count($message_array)-1); $i++){
-                                if(strlen($message_array[$i]) > $wrapcount){
-                                        if(substr($message_array[$i], 0, 7) == "http://"){
-                                                if(substr($message_array[$i], -1) == "."){
-                                                        $message_array[$i] = substr_replace($message_array[$i], "", -1);
-                                        }
-                                                $url = str_replace("http://", "", $message_array[$i]);
-                                                $url = explode("/", $url);
-                                                $url = $url[0];
-                                                $message_array[$i] = "<a href='".$message_array[$i]."' rel='external'>[".$url."]</a>";
-                                        }else{
-                                        if(!stristr($message_array[$i], "[link") && !stristr($message_array[$i], "[url") && !stristr($message_array[$i], "href=") && !stristr($message_array[$i], "src=") && !stristr($message_array[$i], "action=") && !stristr($message_array[$i], "onclick=") && !stristr($message_array[$i], "url(") && !stristr($message_array[$i], "[img") && !stristr($message_array[$i], "value=") && !stristr($message_array[$i], "pluginspage=") && !stristr($message_array[$i], "codebase=")){
-                                                        $message_array[$i] = preg_replace("/([^\s]{".$wrapcount."})/", "$1<br />", $message_array[$i]);
-                                                }
-                                        }
-                                }else{
-                                                                        if(!stristr($message_array[$i], "[link") && !stristr($message_array[$i], "[url") && !stristr($message_array[$i], "href=") && !stristr($message_array[$i], "src=") && !stristr($message_array[$i], "action=") && !stristr($message_array[$i], "onclick=") && !stristr($message_array[$i], "[img") && !stristr($message_array[$i], "value=") && !stristr($message_array[$i], "pluginspage=") && !stristr($message_array[$i], "codebase=")){
-                                                                                if($referrer != "admin" && !stristr($message_array[$i], "http://")){
-                                                                                        $message_array[$i] = $this -> tpj($message_array[$i]);
-                                                                                }
-                                                                                $search = "#([\t\r\n ])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i";
-                                        $replace = ($pref['links_new_window'] ? '\1<a href="http://\2.\3" rel="external";">\2.\3</a>' : '\1<a href="http://\2.\3" >\2.\3</a>');
-                                        $message_array[$i] = preg_replace($search, $replace, $message_array[$i]);
-                                        $search = "#([a-z0-9]+?){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?([^).,]))#i";
-                                        $replace = ($pref['links_new_window'] ? '<a href="\1://\2" rel="external";">\1://\2</a>' : '<a href="\1://\2">\1://\2</a>');
-                                        $message_array[$i] = preg_replace($search, $replace, $message_array[$i]);
-                                        if($highlight_search && !stristr($message_array[$i], "http://")){
-                                                                                        $tmp = explode(" ", $_POST['search_query']);
-                                             foreach($tmp as $key){
-                                                                                                 if(eregi($key, $message_array[$i])){
-                                                                                                        $message_array[$i] = eregi_replace($key, "<span class='searchhighlight'>$key</span>", $message_array[$i]);
-                                                 }
-                                             }
-                                          }
-                                      }
-                                  }
-                        }
-                        $text = implode(" ",$message_array);
-                        return $text;
-                }
-                function bbcode($text, $mode="off", $referrer="") {
-                global $pref;
-                $text = " " . $text;
-                if (! (strpos($text, "[") && strpos($text, "]")) ){
-                                        $text = substr($text, 1);
-                                        return $text;
-                                }
-                                        $text = preg_replace_callback("#\[img\](.*?)\[/img\]#si", array($this,"img_parse"),$text);
-                $search[0] = "#\[link\]([a-z]+?://){1}(.*?)\[/link\]#si";
-                $replace[0] = ($pref['links_new_window'] ? '<a href="\1\2" rel="external">\1\2</a>' : '<a href="\1\2">\1\2</a>');
-                $search[1] = "#\[link\](.*?)\[/link\]#si";
-                $replace[1] = ($pref['links_new_window'] ? '<a href="http://\1" rel="external">\1</a>' : '<a href="http://\1">\1</a>');
-                $search[2] = "#\[link=([a-z]+?://){1}(.*?)\](.*?)\[/link\]#si";
-                $replace[2] = ($pref['links_new_window'] ? '<a href="\1\2" rel="external">\3</a>' : '<a href="\1\2">\3</a>');
-                $search[3] = "#\[link=(.*?)\](.*?)\[/link\]#si";
-                $replace[3] = ($pref['links_new_window'] ? '<a href="\1" rel="external">\2</a>' : '<a href="\1">\2</a>');
-                $search[4] = "#\[email\](.*?)\[/email\]#si";
-                $replace[4] = '<a href="mailto:\1">\1</a>';
-                $search[5] = "#\[email=(.*?){1}(.*?)\](.*?)\[/email\]#si";
-                $replace[5] = '<a href="mailto:\1\2">\3</a>';
-                $search[6] = "#\[url\]([a-z]+?://){1}(.*?)\[/url\]#si";
-                $replace[6] = ($pref['links_new_window'] ? '<a href="\1\2" rel="external">\1\2</a>' : '<a href="\1\2">\1\2</a>');
-                $search[7] = "#\[url\](.*?)\[/url\]#si";
-                $replace[7] = ($pref['links_new_window'] ? '<a href="http://\1"> rel="external"\1</a>' : '<a href="http://\1">\1</a>');
-                $search[8] = "#\[url=([a-z]+?://){1}(.*?)\](.*?)\[/url\]#si";
-                $replace[8] = ($pref['links_new_window'] ? '<a href="\1\2" rel="external">\3</a>' : '<a href="\1\2">\3</a>');
-                                $search[9] = "#\[quote\](.*?)\[/quote\]#si";
-                                $replace[9] = '<i>"\1"</i>';
-            $search[10] = "#\[b\](.*?)\[/b\]#si";
-            $replace[10] = '<b>\1</b>';
-            $search[11] = "#\[i\](.*?)\[/i\]#si";
-            $replace[11] = '<i>\1</i>';
-            $search[12] = "#\[u\](.*?)\[/u\]#si";
-            $replace[12] = '<u>\1</u>';
-                                $search[14] = "#\[center\](.*?)\[/center\]#si";
-                                $replace[14] = '<div style=\'text-align:center\'>\1</div>';
-                                $search[15] = "#\[left\](.*?)\[/left\]#si";
-                                $replace[15] = '<div style=\'text-align:left\'>\1</div>';
-                                $search[16] = "#\[right\](.*?)\[/right\]#si";
-                                $replace[16] = '<div style=\'text-align:right\'>\1</div>';
-                                $search[17] = "#\[blockquote\]#si";
-                                $replace[17] = '<div class=\'indent\'>';
-                                $search[18] = "#\[/blockquote\]#si";
-                                $replace[18] = '</div>';
-                                $search[19] = "/\[color=(.*?)\](.*?)\[\/color\]/si";
-                                $replace[19] = '<span style=\'color:\1\'>\2</span>';
-                                $search[20] = "/\[size=([1-2]?[0-9])\](.*?)\[\/size\]/si";
-                                $replace[20] = '<span style=\'font-size:\1px\'>\2</span>';
-                                $search[21] = "#\[edited\](.*?)\[/edited\]#si";
-                                $replace[21] = '<span class=\'smallblacktext\'>[ \1 ]</span>';
-                                $search[22] = "#\[br\]#si";
-                                $replace[22] = '<br />';
-            if($pref['forum_attach'] && FILE_UPLOADS || $referrer == "admin"){
-                                        $search[23] = "#\[file=(.*?)\](.*?)\[/file\]#si";
-                                        $replace[23] = '<a href="\1"><img src="'.e_IMAGE.'generic/attach1.png" alt="" style="border:0; vertical-align:middle" /> \2</a>';
-                                }else{
-                                        $search[23] = "#\[file=(.*?)\](.*?)\[/file\]#si";
-                                        $replace[23] = '[ '.CORE_LAN3.' ]';
-                                }
-
-                $search[24] = "/\[quote=(.*?)\](.*?)/si";
-                $replace[24] = '<div class=\'indent\'>'.CORE_LAN2.' ...<br />';
-                $search[25] = "/\[\/quote\]/si";
-                $replace[25] = '</div>';
-                                $text = preg_replace($search, $replace, $text);
-                                return $text;
-                                }
-
-                function img_parse($matches)
-                {
-                        global $poster_userid,$pref;
-                        if(preg_match("#\.php\?.*#",$matches[1]))
-                        {
-                                return "";
-                        }
-                        if(!$poster_userid){
-                                return "<img src='{$matches[1]}' alt='' style='vertical-align:middle; border:0' />";
-                        }
-                        else
-                        {
-                                if($pref['image_post'])
-                                {
-                                        if(!function_exists('e107_userGetuserclass'))
-                                        {
-                                                require_once(e_HANDLER.'user_func.php');
-                                        }
-                                        if(check_class($pref['image_post_class'],e107_userGetuserclass($poster_userid)))
-                                        {
-                                                return "<img src='{$matches[1]}' alt='' style='vertical-align:middle; border:0' />";
-                                        }
-                                }
-                                if($pref['image_post_disabled_method'])
-                                {
-                                        return '[ image disabled ]';
-                                }
-                                else
-                                {
-                                        return "Image: $matches[1]";
-                                }
-                        }
-                }
-        function formtpa($text, $mode="admin"){
-                global $sql, $pref;
-
-                if($mode != "admin" && !ADMIN){
-
-                        for($r=0; $r<=strlen($text); $r++){
-                                $chars[$text[$r]] = 1;
-                        }
-                        $ch = array_count_values($chars);
-                        if((strlen($text) > 50 && $ch[1] < 10) || (strlen($text) > 10 && $ch[1] < 3) || (strlen($text) > 100 && $ch[1] < 20)){
-                                echo "<script type='text/javascript'>document.location.href='index.php'</script>\n";
-                                exit;
-                        }
-                        $text = code($text);
-                        if(!$pref['html_post']){ $text = str_replace("<", "&lt;", $text); str_replace(">", "&gt;", $text); }
-                        $text = str_replace("<script", "&lt;script", $text);
-                        $text = str_replace("<iframe", "&lt;iframe", $text);
-                        /*
-                        if(($pref['image_post_class'] == 253 && !USER) || ($pref['image_post_class'] == 254 && !ADMIN)){
-                        $text = preg_replace("#\[img\](.*?)\[/img\]#si", '&nbsp;', $text);
-                        }else if(!check_class($pref['image_post_class'])){
-                        $text = preg_replace("#\[img\](.*?)\[/img\]#si", '&nbsp;', $text);
-                        }
-                        */
-
-                }else if(ADMIN && !strstr(e_PAGE, "newspost.php") && !strstr(e_PAGE, "article.php") && !strstr(e_PAGE, "review.php")){
-                        $text = preg_replace("#\[img\](.*?)\[/img\]#si", '<img src=\'\1\' alt=\'\' style=\'vertical-align:middle; border:0\' />', $text);
-                }
-
-                if(MAGIC_QUOTES_GPC){ $text = stripslashes($text); }
-                $search = array("\"", "'", "\\", '\"', "\'", "$");
-                $replace = array("&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&#036;");
-                $text = str_replace($search, $replace, $text);
-                return $text;
-        }
-
-        function formtparev($text){
-                $search = array("&quot;", "&#39;", "&#92;", "&quot;", "&#39;");
-                $replace = array("\"", "'", "\\", '\"', "\'");
-                $text = str_replace($search, $replace, $text);
-                return $text;
-        }
-
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function check_email($var){
-        return (preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $var)) ? $var : FALSE;
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function check_class($var, $userclass=USERCLASS, $debug=FALSE){
-        if(preg_match ("/^([0-9]+)$/", $var)){
-                if($var == e_UC_MEMBER && USER==TRUE){return TRUE;}
-                if($var == e_UC_GUEST && USER==FALSE){return TRUE;}
-                if($var == e_UC_PUBLIC){return TRUE;}
-                if($var == e_UC_NOBODY) {return FALSE;}
-                if($var == e_UC_ADMIN && ADMIN) {return TRUE;}
-                if($var == e_UC_READONLY){return TRUE;}
-        }
-        if($debug){ echo "USERCLASS: ".$userclass.", \$var = $var : "; }
-        if(!defined("USERCLASS") || $userclass == ""){
-                if($debug){ echo "FALSE<br />"; }
-                return FALSE;
-        }
-        // user has classes set - continue
-        if(preg_match ("/^([0-9]+)$/", $var)){
-                $tmp = explode(".", $userclass);
-                if(is_numeric(array_search($var,$tmp))){
-                        if($debug){ echo "TRUE<br />"; }
-                        return TRUE;
-                }
-        } else {
-                // var is name of class ...
-                $sql = new db;
-                if($sql -> db_Select("userclass_classes", "*", "userclass_name='$var' ")){
-                        $row = $sql -> db_Fetch();
-                        $tmp = explode(".", $userclass);
-                        if(is_numeric(array_search($row['userclass_id'],$tmp))){
-                                if($debug){ echo "TRUE<br />"; }
-                                return TRUE;
-                        }
-                }
-        }
-        if($debug){  echo "NOTNUM! FALSE<br />"; }
-        return FALSE;
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function getperms($arg, $ap = ADMINPERMS){
-        global $PLUGINS_DIRECTORY;
-        if($ap == "0"){return TRUE;}
-        if($ap == ""){return FALSE;}
-        $ap = ".".$ap;
-        if($arg == "P" && preg_match("#(.*?)/".$PLUGINS_DIRECTORY."(.*?)/(.*?)#",e_SELF,$matches) ){
-                $psql = new db;
-                if($psql -> db_Select("plugin","plugin_id","plugin_path = '".$matches[2]."' ")){
-                        $row = $psql -> db_Fetch();
-                        $arg = "P".$row[0];
-                }
-        }
-        if(preg_match("#\.".$arg."\.#", $ap)){
-                return TRUE;
-        } else {
-                return FALSE;
-        }
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-function save_prefs($table = "core", $uid=USERID){
-        global $pref, $user_pref;
-        $sql = new db;
-        if($table == "core"){
-                foreach($pref as $key => $prefvalue){
-                        $pref[$key] = textparse::formtpa($prefvalue);
-                }
-                $tmp = addslashes(serialize($pref));
-                $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='pref'");
-        } else {
-                foreach($user_pref as $key => $prefvalue){
-                        $user_pref[$key] = textparse::formtpa($prefvalue);
-                }
-                $tmp = addslashes(serialize($user_pref));
-                $sql -> db_Update("user", "user_prefs='$tmp' WHERE user_id=$uid");
-                return $tmp;
-        }
-}
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function online(){
-        $page = (strstr(e_SELF, "forum_")) ? e_SELF.".".e_QUERY : e_SELF;
-        $page = (strstr(e_SELF, "comment")) ? e_SELF.".".e_QUERY : $page;
-        $page = (strstr(e_SELF, "content")) ? e_SELF.".".e_QUERY : $page;
-        $online_timeout = 300;
-        $online_warncount = 90;
-        $online_bancount = 100;
-        global $sql, $pref;
-        global $listuserson;
-        $ip = getip();
-        $udata = (USER === TRUE) ? USERID.".".USERNAME : "0";
-
-        if(USER){
-                // Find record that matches IP or visitor, or matches user info
-                if($sql -> db_Select("online","*","(online_ip='{$ip}' AND online_user_id = '0') OR online_user_id = '{$udata}'")){
-                        $row = $sql -> db_Fetch();
-                        extract($row);
-                        if($online_user_id == $udata) {  //Matching user record
-                                if($online_timestamp < (time() - $online_timeout)){  //It has been at least 'timeout' seconds since this user has connected
-                                        //Update user record with timestamp, current IP, current page and set pagecount to 1
-                                        $query = "online_timestamp='".time()."', online_ip='{$ip}', online_location='$page', online_pagecount=1 WHERE online_user_id='{$online_user_id}' LIMIT 1";
-                                } else {
-                                        if(!ADMIN){$online_pagecount++;}
-                                        //Update user record with current IP, current page and increment pagecount
-                                        $query = "online_ip='{$ip}', online_location='$page', online_pagecount={$online_pagecount} WHERE online_user_id='{$online_user_id}' LIMIT 1";
-                                }
-                        } else {  //Found matching visitor record (ip only) for this user
-                                if($online_timestamp < (time() - $online_timeout)){  //It has been at least 'timeout' seconds since this user has connected
-                                        //Update record with timestamp, current IP, current page and set pagecount to 1
-                                        $query = "online_timestamp='".time()."', online_user_id='{$udata}', online_location='$page', online_pagecount=1 WHERE online_ip='{$ip}' AND online_user_id='0' LIMIT 1";
-                                } else {
-                                        if(!ADMIN){$online_pagecount++;}
-                                        //Update record with current IP, current page and increment pagecount
-                                        $query = "online_user_id='{$udata}', online_location='$page', online_pagecount={$online_pagecount} WHERE online_ip='{$ip}' AND online_user_id='0' LIMIT 1";
-                                }
-                        }
-                        $sql -> db_Update("online", $query);
-                } else {
-                        $sql -> db_Insert("online", " '".time()."', 'null', '".$udata."', '".$ip."', '".$page."', 1");
-                }
-        } else {  //Current page request is from a visitor
-                if($sql -> db_Select("online","*","online_ip='{$ip}' AND online_user_id = '0'")){
-                        $row = $sql -> db_Fetch();
-                        extract($row);
-                        if($online_timestamp < (time() - $online_timeout)){  //It has been at least 'timeout' seconds since this ip has connected
-                                //Update record with timestamp, current page, and set pagecount to 1
-                                $query = "online_timestamp='".time()."', online_location='$page', online_pagecount=1 WHERE online_ip='{$ip}' AND online_user_id='0' LIMIT 1";
-                        } else {
-                                //Update record with current page and increment pagecount
-                                $online_pagecount++;
-                             //   echo "here {$online_pagecount}";
-                                $query = "online_location='$page', online_pagecount={$online_pagecount} WHERE online_ip='{$ip}' AND online_user_id='0' LIMIT 1";
-                        }
-                        $sql -> db_Update("online", $query);
-                } else {
-                        $sql -> db_Insert("online", " '".time()."', 'null', '0', '{$ip}', '{$page}', 1");
-                }
-        }
-
-        if(ADMIN || $pref['autoban']!=1){$online_pagecount=1;}
-        if($online_pagecount > $online_bancount && $online_ip !="127.0.0.1"){
-                $sql -> db_Insert("banlist", "'$ip', '0', 'Hit count exceeded ($online_pagecount requests within allotted time)' ");
-                exit;
-        }
-        if($online_pagecount >= $online_warncount && $online_ip !="127.0.0.1"){
-                echo "<div style='text-align:center; font: 11px verdana, tahoma, arial, helvetica, sans-serif;'><b>Warning!</b><br /><br />The flood protection on this site has been activated and you are warned that if you carry on requesting pages you could be banned.<br /></div>";
-                exit;
-        }
-
-        $sql -> db_Delete("online", "online_timestamp<".(time() - $online_timeout));
-        $total_online = $sql -> db_Count("online");
-        if($members_online = $sql -> db_Select("online", "*", "online_user_id != '0' ")){
-                $listuserson = array();
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        list($oid,$oname) = explode(".",$online_user_id,2);
-                        $member_list .= "<a href='".e_BASE."user.php?id.$oid'>$oname</a> ";
-                        $listuserson[$online_user_id] = $online_location;
-                }
-        }
-        define("TOTAL_ONLINE", $total_online);
-        define("MEMBERS_ONLINE", $members_online);
-        define("GUESTS_ONLINE", $total_online - $members_online);
-        define("ON_PAGE", $sql -> db_Count("online", "(*)", "WHERE online_location='$page' "));
-        define("MEMBER_LIST", $member_list);
-}
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function cachevars($id, $var){
-        global $cachevar;
-        $cachevar[$id] = $var;
-}
-function getcachedvars($id){
-        global $cachevar;
-        return ($cachevar[$id] ? $cachevar[$id] : FALSE);
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function getip(){
-        /*
-        # Get IP address
-        #
-        # - parameters                none
-        # - return                                valid IP address
-        # - scope                                        public
-        */
-        if(getenv('HTTP_X_FORWARDED_FOR')){
-                $ip = $_SERVER['REMOTE_ADDR'];
-                if(preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip3)){
-                        $ip2 = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10..*/', '/^224..*/', '/^240..*/');
-                        $ip = preg_replace($ip2, $ip, $ip3[1]);
-                }
-        }else{
-                $ip = $_SERVER['REMOTE_ADDR'];
-        }
-        if($ip == ""){ $ip = "x.x.x.x"; }
-        return $ip;
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-class floodprotect{
-        function flood($table, $orderfield){
-                /*
-                # Test for possible flood
-                #
-                # - parameter #1                string $table, table being affected
-                # - parameter #2                string $orderfield, date entry in respective table
-                # - return                                boolean
-                # - scope                                        public
-                */
-                $sql = new db;
-                if(FLOODPROTECT == TRUE){
-                        $sql -> db_Select($table, "*", "ORDER BY ".$orderfield." DESC LIMIT 1", "no_where");
-                        $row = $sql -> db_Fetch();
-                        return ($row[$orderfield] > (time() - FLOODTIMEOUT) ? FALSE : TRUE);
-                } else {
-                        return TRUE;
-                }
-        }
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function init_session(){
-        /*
-        # Validate user
-        #
-        # - parameters                none
-        # - return                                boolean
-        # - scope                                public
-        */
-        global $sql, $pref, $user_pref, $sql;
-
-        if(!$_COOKIE[$pref['cookie_name']] && !$_SESSION[$pref['cookie_name']]){
-                define("USER", FALSE); define("USERTHEME", FALSE); define("ADMIN", FALSE);define("GUEST", TRUE);
-        } else {
-                list($uid, $upw) = ($_COOKIE[$pref['cookie_name']] ? explode(".", $_COOKIE[$pref['cookie_name']]) : explode(".", $_SESSION[$pref['cookie_name']]));
-                if(empty($uid) || empty($upw)){         // corrupt cookie?
-                        cookie($pref['cookie_name'], "", (time()-2592000));
-                        $_SESSION[$pref['cookie_name']] = "";
-                        session_destroy();
-                        define("ADMIN", FALSE); define("USER", FALSE); define("USERCLASS",""); define("LOGINMESSAGE", "Corrupted cookie detected - logged out.<br /><br />");
-                        return(FALSE);
-                }
-                if($sql -> db_Select("user", "*", "user_id='$uid' AND md5(user_password)='$upw'")){
-                        $result = $sql -> db_Fetch(); extract($result);
-                        define("USERID", $user_id);
-                        define("USERNAME", $user_name);
-                        define("USERURL", $user_website);
-                        define("USEREMAIL", $user_email);
-                        define("USER", TRUE);
-                        define("USERCLASS", $user_class);
-                        define("USERREALM", $user_realm);
-                                                                define("USERVIEWED", $user_viewed);
-                                                                define("USERIMAGE", $user_image);
-                                                                define("USERSESS", $user_sess);
-                        if($user_currentvisit + 3600 < time()){
-                                $user_lastvisit = $user_currentvisit;
-                                $user_currentvisit = time();
-                                $sql -> db_Update("user", "user_visits=user_visits+1, user_lastvisit='$user_lastvisit', user_currentvisit='$user_currentvisit', user_viewed='' WHERE user_name='".USERNAME."' ");
-                        }
-                                                                define("USERLV", $user_lastvisit);
-                        if($user_ban == 1){ exit; }
-                        $user_pref = unserialize($user_prefs);
-                                    foreach($pref as $key => $prefvalue){
-                                                                        $pref[$key] = textparse::formtparev($prefvalue);
-                                                                }
-                        if(IsSet($_POST['settheme'])){
-                                $user_pref['sitetheme'] = ($pref['sitetheme'] == $_POST['sitetheme'] ? "" : $_POST['sitetheme']);
-                                save_prefs($user);
-                        }
-                        if(IsSet($_POST['setlanguage'])){
-                                $user_pref['sitelanguage'] = ($pref['sitelanguage'] == $_POST['sitelanguage'] ? "" : $_POST['sitelanguage']);
-                                save_prefs($user);
-                        }
-
-                        define("USERTHEME", ($user_pref['sitetheme'] && file_exists(e_THEME.$user_pref['sitetheme']."/theme.php") ? $user_pref['sitetheme'] : FALSE));
-                        global $ADMIN_DIRECTORY,$PLUGINS_DIRECTORY;
-                        define("USERLAN", ($user_pref['sitelanguage'] && (strpos(e_SELF,$PLUGINS_DIRECTORY)!==FALSE||(strpos(e_SELF,$ADMIN_DIRECTORY)===FALSE && file_exists(e_LANGUAGEDIR.$user_pref['sitelanguage']."/lan_".e_PAGE))||(strpos(e_SELF,$ADMIN_DIRECTORY)!==FALSE && file_exists(e_LANGUAGEDIR.$user_pref['sitelanguage']."/admin/lan_".e_PAGE))) ? $user_pref['sitelanguage'] : FALSE));
-
-                        if($user_admin){
-                                define("ADMIN", TRUE); define("ADMINID", $user_id); define("ADMINNAME", $user_name); define("ADMINPERMS", $user_perms); define("ADMINEMAIL", $user_email); define("ADMINPWCHANGE", $user_pwchange);
-                        } else {
-                                define("ADMIN", FALSE);
-                        }
-                } else {
-                        define("USER", FALSE); define("USERTHEME", FALSE); define("ADMIN", FALSE);
-                        define("CORRUPT_COOKIE",TRUE); define("USERCLASS","");
-                }
-        }
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function ban(){
-        $sql = new db;
-        $ip = getip();
-        $wildcard = substr($ip, 0, strrpos($ip, ".")).".*";
-        if($sql -> db_Select("banlist", "*", "banlist_ip='".$_SERVER['REMOTE_ADDR']."' OR banlist_ip='".USEREMAIL."' OR banlist_ip='$ip' OR banlist_ip='$wildcard'")){
-                // enter a message here if you want some text displayed to banned users ...
-                exit;
-        }
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function cookie($name, $value, $expire, $path="/", $domain="", $secure=0){
-        setcookie($name, $value, $expire, $path, $domain, $secure);
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function html($string){
-        global $pref, $aj;
-        $match_count = preg_match_all("#\[html\](.*?)\[/html\]#si", $string, $result);
-        for ($a = 0; $a < $match_count; $a++){
-                if($pref['smiley_activate']){
-                        if(!is_object($aj)){$aj = new textparse;}
-                     $after_replace = str_replace($aj->replace, $aj->searcha, $result[1][$a]);
-                } else {
-                        $after_replace= $result[1][$a];
-                }
-                $after_replace = str_replace("<br />", "\n", $after_replace);
-                $after_replace=nl2br($after_replace);
-                $string = str_replace("[html]".$result[1][$a]."[/html]", $after_replace, $string);
-        }
-        return $string;
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function code($string, $mode="default"){
-        global $pref, $aj;
-        $search = array("&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&lt;span", "&lt;/span");
-        $replace =  array("\"", "'", "\\", '\"', "\'", "<span", "</span");
-        $string = str_replace($search, $replace, $string);
-        $match_count = preg_match_all("#(\[code[=]*(.*?)\])(.*?)\[/code\]#si", $string, $result);
-        for ($a = 0; $a < $match_count; $a++){
-                if($pref['smiley_activate']){
-                        if(!is_object($aj)){$aj = new textparse;}
-                            $after_replace = str_replace($aj->replace, $aj->searcha, $result[3][$a]);
-                } else {
-                        $after_replace= $result[3][$a];
-                }
-                if(strpos($result[2][$a],'highlight')){
-                        $after_replace = str_replace("&#036;","$",$after_replace);
-                        $after_replace=highlight_string($after_replace,TRUE);
-                        $after_replace=str_replace("<br />","",$after_replace);
-                        $class='indent';
-                } else {
-                        $after_replace = str_replace("&#036;","$",$after_replace);
-                        $after_replace=htmlentities($after_replace);
-                        $class = (strlen(trim($result[2][$a]))) ? $result[2][$a] : 'indent';
-                }
-                $string = str_replace($result[1][$a].$result[3][$a]."[/code]", "<div class='{$class}'>".$after_replace."</div>", $string);
-        }
-        return $string;
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|    	Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/class2.php,v $
+|     $Revision: 1.281 $
+|     $Date: 2006/05/15 13:32:20 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+// Find out if register globals is enabled and destroy them if so
+
+while (@ob_end_clean());  // destroy all ouput buffering
+ob_start();             // start our own.
+
+$register_globals = true;
+if(function_exists('ini_get')) {
+	$register_globals = ini_get('register_globals');
+}
+
+// Destroy! (if we need to)
+if($register_globals == true){
+	while (list($global) = each($GLOBALS)) {
+		if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|GLOBALS|HTTP.*|_REQUEST|retrieve_prefs|eplug_admin)$/', $global)) {
+			unset($$global);
+		}
+	}
+	unset($global);
+}
+
+if(isset($retrieve_prefs) && is_array($retrieve_prefs)) {
+	foreach ($retrieve_prefs as $key => $pref_name) {
+		 $retrieve_prefs[$key] = preg_replace("/\W/", '', $pref_name);
+	}
+} else {
+	unset($retrieve_prefs);
+}
+
+// setup error handling first of all.
+$error_handler = new error_handler();
+set_error_handler(array(&$error_handler, "handle_error"));
+
+// Honest global beginning point for processing time
+$eTimingStart = microtime();
+$start_ob_level = ob_get_level();
+
+define("e107_INIT", TRUE);
+
+// setup some php options
+ini_set('magic_quotes_runtime',     0);
+ini_set('magic_quotes_sybase',      0);
+ini_set('arg_separator.output',     '&amp;');
+ini_set('session.use_only_cookies', 1);
+ini_set('session.use_trans_sid',    0);
+
+//  Ensure thet '.' is the first part of the include path
+$inc_path = explode(PATH_SEPARATOR, ini_get('include_path'));
+if($inc_path[0] != ".") {
+	array_unshift($inc_path, ".");
+	$inc_path = implode(PATH_SEPARATOR, $inc_path);
+	ini_set("include_path", $inc_path);
+}
+unset($inc_path);
+
+// Grab e107_config, get directory paths, and create the $e107 object
+@include_once(realpath(dirname(__FILE__).'/e107_config.php'));
+if(!isset($ADMIN_DIRECTORY)){
+	// e107_config.php is either empty, not valid or doesn't exist so redirect to installer..
+	header("Location: install.php");
+}
+
+// clever stuff that figures out where the paths are on the fly.. no more need fo hard-coded e_HTTP :)
+e107_require_once(realpath(dirname(__FILE__).'/'.$HANDLERS_DIRECTORY).'/e107_class.php');
+$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY');
+$e107 = new e107($e107_paths, realpath(dirname(__FILE__)));
+
+$inArray = array("'", ";", "/**/", "/UNION/", "/SELECT/", "AS ");
+if (strpos($_SERVER['PHP_SELF'], "trackback") === false) {
+	foreach($inArray as $res) {
+		if(stristr($_SERVER['QUERY_STRING'], $res)) {
+			die("Access denied.");
+		}
+	}
+}
+
+if (preg_match("#\[(.*?)](.*)#", $_SERVER['QUERY_STRING'], $matches)) {
+	define("e_MENU", $matches[1]);
+	define("e_QUERY", $matches[2]);
+	parse_str(e_MENU, $_emenu);
+	if(isset($_emenu['lan']))
+	{
+		$_GET['elan'] = $_emenu['lan'];
+	}
+} else {
+	define("e_MENU", "");
+	define("e_QUERY", $_SERVER['QUERY_STRING']);
+}
+$e_QUERY = e_QUERY;
+
+define("e_TBQS", $_SERVER['QUERY_STRING']);
+$_SERVER['QUERY_STRING'] = e_QUERY;
+
+define("e_UC_PUBLIC", 0);
+define("e_UC_READONLY", 251);
+define("e_UC_GUEST", 252);
+define("e_UC_MEMBER", 253);
+define("e_UC_ADMIN", 254);
+define("e_UC_NOBODY", 255);
+define("ADMINDIR", $ADMIN_DIRECTORY);
+
+// All debug objects and constants are defined in the debug handler
+if (strpos(e_MENU, 'debug') !== FALSE || isset($_COOKIE['e107_debug_level'])) {
+	require_once(e_HANDLER.'debug_handler.php');
+	$db_debug = new e107_db_debug;
+} else {
+	define('E107_DEBUG_LEVEL',0);
+}
+
+if(isset($db_debug) && is_object($db_debug)) {
+	$db_debug->Mark_Time('Start: Init ErrHandler');
+}
+
+// e107_config.php upgrade check
+if (!$ADMIN_DIRECTORY && !$DOWNLOADS_DIRECTORY) {
+	message_handler("CRITICAL_ERROR", 8, ": generic, ", "e107_config.php");
+	exit;
+}
+
+@require_once(e_HANDLER.'traffic_class.php');
+$eTraffic=new e107_traffic; // We start traffic counting ASAP
+$eTraffic->Calibrate($eTraffic);
+
+define("MPREFIX", $mySQLprefix);
+
+e107_require_once(e_HANDLER."mysql_class.php");
+e107_require_once(e_HANDLER.'e_parse_class.php');
+
+$tp = new e_parse;
+
+$sql =& new db;
+$sql2 =& new db;
+
+$sql->db_SetErrorReporting(FALSE);
+
+$sql->db_Mark_Time('Start: SQL Connect');
+$merror=$sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
+$sql->db_Mark_Time('Start: Prefs, misc tables');
+
+require_once(e_HANDLER.'admin_log_class.php');
+$admin_log = new e_admin_log();
+
+if ($merror == "e1") {
+	message_handler("CRITICAL_ERROR", 6, ": generic, ", "class2.php");
+	exit;
+}
+else if ($merror == "e2") {
+	message_handler("CRITICAL_ERROR", 7, ": generic, ", "class2.php");
+	exit;
+}
+
+/* New compatabilty mode.
+At a later date add a check to load e107 compat mode by $pref
+PHP Compatabilty should *always* be on. */
+e107_require_once(e_HANDLER."php_compatibility_handler.php");
+e107_require_once(e_HANDLER."e107_Compat_handler.php");
+$aj = new textparse; // required for backwards compatibility with 0.6 plugins.
+
+e107_require_once(e_HANDLER."pref_class.php");
+$sysprefs = new prefs;
+
+// Extract core prefs from the database
+e107_require_once(e_HANDLER.'cache_handler.php');
+e107_require_once(e_HANDLER.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+
+$sql->db_Mark_Time('Start: Extracting Core Prefs');
+$PrefCache = ecache::retrieve('SitePrefs', 24 * 60, true);
+if(!$PrefCache){
+	// No cache of the prefs array, going for the db copy..
+	$retrieve_prefs[] = 'SitePrefs';
+	$sysprefs->ExtractPrefs($retrieve_prefs, TRUE);
+	$PrefData = $sysprefs->get('SitePrefs');
+	$pref = $eArrayStorage->ReadArray($PrefData);
+	if(!$pref){
+		$admin_log->log_event("Core Prefs Error", "Core is attempting to restore prefs from automatic backup.", E_LOG_WARNING);
+		// Try for the automatic backup..
+		$PrefData = $sysprefs->get('SitePrefs_Backup');
+		$pref = $eArrayStorage->ReadArray($PrefData);
+		if(!$pref){
+			// No auto backup, try for the 'old' prefs system.
+			$PrefData = $sysprefs->get('pref');
+			$pref = unserialize($PrefData);
+			if(!is_array($pref)){
+				message_handler("CRITICAL_ERROR", 3, __LINE__, __FILE__);
+				// No old system, so point in the direction of resetcore :(
+				message_handler("CRITICAL_ERROR", 4, __LINE__, __FILE__);
+				$admin_log->log_event("Core Prefs Error", "Core could not restore from automatic backup. Execution halted.", E_LOG_FATAL);
+				exit;
+			} else {
+				// old prefs found, remove old system, and update core with new system
+				$PrefOutput = $eArrayStorage->WriteArray($pref);
+				if(!$sql->db_Update('core', "e107_value='{$PrefOutput}' WHERE e107_name='SitePrefs'")){
+					$sql->db_Insert('core', "'SitePrefs', '{$PrefOutput}'");
+				}
+				if(!$sql->db_Update('core', "e107_value='{$PrefOutput}' WHERE e107_name='SitePrefs_Backup'")){
+					$sql->db_Insert('core', "'SitePrefs_Backup', '{$PrefOutput}'");
+				}
+				$sql->db_Delete('core', "`e107_name` = 'pref'");
+			}
+		} else {
+			message_handler("CRITICAL_ERROR", 3, __LINE__, __FILE__);
+			// auto backup found, use backup to restore the core
+			if(!$sql->db_Update('core', "`e107_value` = '".addslashes($PrefData)."' WHERE `e107_name` = 'SitePrefs'")){
+				$sql->db_Insert('core', "'SitePrefs', '".addslashes($PrefData)."'");
+			}
+		}
+	}
+	// write pref cache array
+	$PrefCache = $eArrayStorage->WriteArray($pref, false);
+	// store the prefs in cache if cache is enabled
+	ecache::set('SitePrefs', $PrefCache);
+} else {
+	// cache of core prefs was found, so grab all the useful core rows we need
+	$sysprefs->DefaultIgnoreRows .= '|SitePrefs';
+	$sysprefs->prefVals['core']['SitePrefs'] = $PrefCache;
+	if(isset($retrieve_prefs))
+	{
+		$sysprefs->ExtractPrefs($retrieve_prefs, TRUE);
+	}
+	$pref = $eArrayStorage->ReadArray($PrefCache);
+}
+
+$e107->set_base_path();
+
+// extract menu prefs
+$menu_pref = unserialize(stripslashes($sysprefs->get('menu_pref')));
+
+$sql->db_Mark_Time('(Extracting Core Prefs Done)');
+
+define("SITEURLBASE", ($pref['ssl_enabled'] == '1' ? "https://" : "http://").$_SERVER['HTTP_HOST']);
+define("SITEURL", SITEURLBASE.e_HTTP);
+
+// if a cookie name pref isn't set, make one :)
+if (!$pref['cookie_name']) {
+	$pref['cookie_name'] = "e107cookie";
+}
+
+// start a session if session based login is enabled
+if ($pref['user_tracking'] == "session") {
+	session_start();
+}
+
+define("e_SELF", ($pref['ssl_enabled'] == '1' ? "https://".$_SERVER['HTTP_HOST'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME']) : "http://".$_SERVER['HTTP_HOST'].($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME'])));
+
+
+// if the option to force users to use a particular url for the site is enabled, redirect users there
+if($pref['redirectsiteurl'] && $pref['siteurl']) {
+	$siteurl = SITEURLBASE."/";
+	if (strpos($pref['siteurl'], $siteurl) === FALSE && strpos(e_SELF, ADMINDIR) === FALSE) {
+		$location = str_replace($siteurl, $pref['siteurl'], e_SELF).(e_QUERY ? "?".e_QUERY : "");
+		header("Location: {$location}", true, 301); // send 301 header, not 302
+		exit();
+	}
+}
+
+$page = substr(strrchr($_SERVER['PHP_SELF'], "/"), 1);
+define("e_PAGE", $page);
+
+// sort out the users language selection
+if (isset($_POST['setlanguage']) || isset($_GET['elan'])) {
+	if($_GET['elan']){  // query support, for language selection splash pages. etc
+	$_POST['sitelanguage'] = $_GET['elan'];
+	}
+	$sql->mySQLlanguage = $_POST['sitelanguage'];
+	if ($pref['user_tracking'] == "session") {
+		$_SESSION['e107language_'.$pref['cookie_name']] = $_POST['sitelanguage'];
+	} else {
+		setcookie('e107language_'.$pref['cookie_name'], $_POST['sitelanguage'], time() + 86400, "/");
+		$_COOKIE['e107language_'.$pref['cookie_name']] = $_POST['sitelanguage'];
+		if (strpos(e_SELF, ADMINDIR) === FALSE) {
+			$locat = (!$_GET['elan'] && e_QUERY) ? e_SELF."?".e_QUERY : e_SELF;
+			header("Location:".$locat);
+		}
+	}
+}
+
+$user_language='';
+// Multi-language options.
+if (isset($pref['multilanguage']) && $pref['multilanguage']) {
+
+	if ($pref['user_tracking'] == "session") {
+		$user_language=(array_key_exists('e107language_'.$pref['cookie_name'], $_SESSION) ? $_SESSION['e107language_'.$pref['cookie_name']] : "");
+		$sql->mySQLlanguage=($user_language) ? $user_language : "";
+	} else {
+		$user_language=$_COOKIE['e107language_'.$pref['cookie_name']];
+		$sql->mySQLlanguage=($user_language) ? $user_language : "";
+	}
+
+
+}
+
+// Get Language List for rights checking.
+if(!$tmplan = getcachedvars("language-list")){
+	$handle=opendir(e_LANGUAGEDIR);
+	while ($file = readdir($handle)) {
+		if (is_dir(e_LANGUAGEDIR.$file) && $file !="." && $file !=".." && $file !="CVS") {
+				$lanlist[] = $file;
+		}
+	}
+	closedir($handle);
+	$tmplan = implode(",",$lanlist);
+	cachevars("language-list", $tmplan);
+}
+
+define("e_LANLIST",(isset($tmplan) ? $tmplan : ""));
+
+
+$sql->db_Mark_Time('(Start: Pref/multilang done)');
+
+$language=(isset($_COOKIE['e107language_'.$pref['cookie_name']]) ? $_COOKIE['e107language_'.$pref['cookie_name']] : ($pref['sitelanguage'] ? $pref['sitelanguage'] : "English"));
+define("e_LAN", $language);
+define("USERLAN", ($user_language && (strpos(e_SELF, $PLUGINS_DIRECTORY) !== FALSE || (strpos(e_SELF, $ADMIN_DIRECTORY) === FALSE && file_exists(e_LANGUAGEDIR.$user_language."/lan_".e_PAGE)) || (strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE && file_exists(e_LANGUAGEDIR.$user_language."/admin/lan_".e_PAGE)) || file_exists(dirname($_SERVER['SCRIPT_FILENAME'])."/languages/".$user_language."/lan_".e_PAGE)    || (    (strpos(e_SELF, $ADMIN_DIRECTORY) == FALSE) && (strpos(e_SELF, $PLUGINS_DIRECTORY) == FALSE) && file_exists(e_LANGUAGEDIR.$user_language."/".$user_language.".php")  )   ) ? $user_language : FALSE));
+define("e_LANGUAGE", (!USERLAN || !defined("USERLAN") ? $language : USERLAN));
+
+e107_include(e_LANGUAGEDIR.e_LANGUAGE."/".e_LANGUAGE.".php");
+e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/".e_LANGUAGE."_custom.php");
+
+define("MAGIC_QUOTES_GPC", (ini_get('magic_quotes_gpc') ? TRUE : FALSE));
+
+// online user tracking class
+$e_online = new e_online();
+
+// cache class
+$e107cache = new ecache;
+
+
+
+if (isset($pref['del_unv']) && $pref['del_unv'] && $pref['user_reg_veri'] != 2) {
+	$threshold=(time() - ($pref['del_unv'] * 60));
+	$sql->db_Delete("user", "user_ban = 2 AND user_join < '{$threshold}' ");
+}
+
+e107_require_once(e_HANDLER."override_class.php");
+$override=new override;
+
+e107_require_once(e_HANDLER."event_class.php");
+$e_event=new e107_event;
+
+if (isset($pref['notify']) && $pref['notify'] == true) {
+	e107_require_once(e_HANDLER.'notify_class.php');
+}
+
+$sql -> db_Mark_Time('Start: Init session');
+init_session();
+
+if (isset($pref['modules']) && $pref['modules']) {
+	$mods=explode(",", $pref['modules']);
+	foreach ($mods as $mod) {
+		if (is_readable(e_PLUGIN."{$mod}/module.php")) {
+			require_once(e_PLUGIN."{$mod}/module.php");
+		}
+	}
+}
+
+//###########  Module redefinable functions ###############
+if (!function_exists('checkvalidtheme')) {
+	function checkvalidtheme($theme_check) {
+		// arg1 = theme to check
+		global $ADMIN_DIRECTORY, $tp, $e107;
+
+		if (strpos(e_QUERY, "themepreview") !== FALSE) {
+			list($action, $id) = explode('.', e_QUERY);
+			require_once(e_HANDLER."theme_handler.php");
+			$themeArray = themeHandler :: getThemes("id");
+			define("PREVIEWTHEME", e_THEME.$themeArray[$id]."/");
+			define("PREVIEWTHEMENAME", $themeArray[$id]);
+			define("THEME", e_THEME.$themeArray[$id]."/");
+			define("THEME_ABS", e_THEME_ABS.$themeArray[$id]."/");
+			return;
+		}
+		if (@fopen(e_THEME.$theme_check."/theme.php", "r")) {
+			define("THEME", e_THEME.$theme_check."/");
+			define("THEME_ABS", e_THEME_ABS.$theme_check."/");
+			$e107->site_theme = $theme_check;
+		} else {
+			function search_validtheme() {
+				global $e107;
+				$th=substr(e_THEME, 0, -1);
+				$handle=opendir($th);
+				while ($file = readdir($handle)) {
+					if (is_dir(e_THEME.$file) && is_readable(e_THEME.$file.'/theme.php')) {
+						closedir($handle);
+						$e107->site_theme = $file;
+						return $file;
+					}
+				}
+				closedir($handle);
+			}
+			$e107tmp_theme = search_validtheme();
+			define("THEME", e_THEME.$e107tmp_theme."/");
+			define("THEME_ABS", e_THEME_ABS.$e107tmp_theme."/");
+			if (ADMIN && strpos(e_SELF, $ADMIN_DIRECTORY) === FALSE) {
+				echo '<script>alert("'.$tp->toJS(CORE_LAN1).'")</script>';
+			}
+		}
+		$themes_dir = $e107->e107_dirs["THEMES_DIRECTORY"];
+		$e107->http_theme_dir = "{$e107->server_path}{$themes_dir}{$e107->site_theme}/";
+	}
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+if (!class_exists('e107_table')) {
+	class e107table {
+		function tablerender($caption, $text, $mode = "default", $return = false) {
+			/*
+			# Render style table
+			# - parameter #1:                string $caption, caption text
+			# - parameter #2:                string $text, body text
+			# - return                                null
+			# - scope                                        public
+			*/
+			global $override;
+
+			if ($override_tablerender = $override->override_check('tablerender')) {
+				$result=call_user_func($override_tablerender, $caption, $text, $mode, $return);
+
+				if ($result == "return") {
+					return;
+				}
+				extract($result);
+			}
+
+			if ($return) {
+				ob_start();
+				tablestyle($caption, $text, $mode);
+				$ret=ob_get_contents();
+				ob_end_clean();
+				return $ret;
+			} else {
+				tablestyle($caption, $text, $mode);
+			}
+		}
+	}
+}
+//#############################################################
+
+$ns=new e107table;
+
+$e107->ban();
+
+if($pref['force_userupdate'] && USER) {
+	if(force_userupdate()) {
+		header("Location: ".e_BASE."usersettings.php?update");
+	}
+}
+
+$sql->db_Mark_Time('Start: Signup/splash/admin');
+
+define("e_SIGNUP", e_BASE.(file_exists(e_BASE."customsignup.php") ? "customsignup.php" : "signup.php"));
+define("e_LOGIN", e_BASE.(file_exists(e_BASE."customlogin.php") ? "customlogin.php" : "login.php"));
+
+if ($pref['membersonly_enabled'] && !USER && e_PAGE != e_SIGNUP && e_PAGE != "index.php" && e_PAGE != "fpw.php" && e_PAGE != e_LOGIN && strpos(e_PAGE, "admin") === FALSE && e_PAGE != 'membersonly.php' && e_PAGE != 'sitedown.php') {
+	header("Location: ".e_HTTP."membersonly.php");
+	exit;
+}
+
+$sql->db_Delete("tmp", "tmp_time < '".(time() - 300)."' AND tmp_ip!='data' AND tmp_ip!='submitted_link'");
+
+// for multi-language these definitions needs to come after the language loaded.
+define("SITENAME", trim($tp->toHTML($pref['sitename'], "", "emotes_off defs no_make_clickable")));
+define("SITEBUTTON", $pref['sitebutton']);
+define("SITETAG", $tp->toHTML($pref['sitetag'], FALSE, "emotes_off defs"));
+define("SITEDESCRIPTION", $tp->toHTML($pref['sitedescription'], "", "emotes_off defs"));
+define("SITEADMIN", $pref['siteadmin']);
+define("SITEADMINEMAIL", $pref['siteadminemail']);
+define("SITEDISCLAIMER", $tp->toHTML($pref['sitedisclaimer'], "", "emotes_off defs"));
+define("SITECONTACTINFO", $tp->toHTML($pref['sitecontactinfo'], TRUE, "emotes_off defs"));
+
+
+if ($pref['maintainance_flag'] && ADMIN == FALSE && strpos(e_SELF, "admin.php") === FALSE && strpos(e_SELF, "sitedown.php") === FALSE) {
+	header("Location: ".SITEURL."sitedown.php");
+	exit;
+}
+
+$sql->db_Mark_Time('(Start: Login/logout/ban/tz)');
+
+if (isset($_POST['userlogin']) || isset($_POST['userlogin_x'])) {
+	e107_require_once(e_HANDLER."login.php");
+	$usr = new userlogin($_POST['username'], $_POST['userpass'], $_POST['autologin']);
+}
+
+if (e_QUERY == 'logout') {
+	$ip = $e107->getip();
+	$udata=(USER === TRUE) ? USERID.".".USERNAME : "0";
+	$sql->db_Update("online", "online_user_id = '0', online_pagecount=online_pagecount+1 WHERE online_user_id = '{$udata}' LIMIT 1");
+
+	if ($pref['user_tracking'] == "session") {
+		session_destroy();
+		$_SESSION[$pref['cookie_name']]="";
+	}
+
+	cookie($pref['cookie_name'], "", (time() - 2592000));
+	$e_event->trigger("logout");
+	echo "<script type='text/javascript'>document.location.href = '".SITEURL."index.php'</script>\n";
+	exit;
+}
+
+
+/*
+* Calculate time zone offset, based on session cookie set in e107.js.
+* (Buyer beware: this may be wrong for the first pageview in a session,
+* which is while the user is logged out, so not a problem...)
+*
+* Time offset is SECONDS. Seconds is much better than hours as a base,
+* as some places have 30 and 45 minute time zones.
+* It matches user clock time, instead of only time zones.
+* Add the offset to MySQL/server time to get user time.
+* Subtract the offset from user time to get server time.
+*
+*/
+
+$e_deltaTime=0;
+
+if (isset($_COOKIE['e107_tdOffset'])) {
+	// Actual seconds of delay. See e107.js and footer_default.php
+	$e_deltaTime = $_COOKIE['e107_tdOffset'];
+}
+
+if (isset($_COOKIE['e107_tzOffset'])) {
+	// Relative client-to-server time zone offset in seconds.
+	$e_deltaTime += (-($_COOKIE['e107_tzOffset'] * 60 + date("Z")));
+}
+
+define("TIMEOFFSET", $e_deltaTime);
+
+$sql->db_Mark_Time('Start: Get menus');
+
+$menu_data = $e107cache->retrieve("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE));
+$menu_data = $eArrayStorage->ReadArray($menu_data);
+if(!is_array($menu_data)) {
+	if ($sql->db_Select('menus', '*', "menu_location > 0 AND menu_class IN (".USERCLASS_LIST.") ORDER BY menu_order")) {
+		while ($row = $sql->db_Fetch()) {
+			$eMenuList[$row['menu_location']][]=$row;
+			$eMenuActive[]=$row['menu_name'];
+		}
+	}
+	$menu_data['menu_list'] = $eMenuList;
+	$menu_data['menu_active'] = $eMenuActive;
+	$menu_data = $eArrayStorage->WriteArray($menu_data, false);
+	$e107cache->set("menus_".USERCLASS_LIST."_".md5(e_LANGUAGE), $menu_data);
+	unset($menu_data);
+} else {
+	$eMenuList = $menu_data['menu_list'];
+	$eMenuActive = $menu_data['menu_active'];
+	unset($menu_data);
+}
+
+$sql->db_Mark_Time('(Start: Find/Load Theme)');
+
+if(!defined("THEME")){
+	if ((strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || strpos(e_SELF, "admin") !== FALSE || (isset($eplug_admin) && $eplug_admin == TRUE)) && $pref['admintheme']) {
+
+		if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') !== FALSE) {
+			checkvalidtheme($pref['sitetheme']);
+		} else if (strpos(e_SELF, "newspost.php") !== FALSE) {
+			define("MAINTHEME", e_THEME.$pref['sitetheme']."/");
+			checkvalidtheme($pref['admintheme']);
+		}
+		else {
+			checkvalidtheme($pref['admintheme']);
+		}
+	} else {
+		if (USERTHEME !== FALSE && USERTHEME != "USERTHEME") {
+			checkvalidtheme(USERTHEME);
+		} else {
+			checkvalidtheme($pref['sitetheme']);
+		}
+	}
+}
+
+if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE && (strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || strpos(e_SELF, "admin") !== FALSE || (isset($eplug_admin) && $eplug_admin == TRUE))) {
+	if (file_exists(THEME.'admin_theme.php')) {
+		require_once(THEME.'admin_theme.php');
+	} else {
+		require_once(THEME."theme.php");
+	}
+} else {
+	require_once(THEME."theme.php");
+}
+
+if (strpos(e_SELF, $ADMIN_DIRECTORY) !== FALSE || strpos(e_SELF, "admin.php") !== FALSE) {
+	e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_".e_PAGE);
+	e107_include_once(e_LANGUAGEDIR."English/admin/lan_".e_PAGE);
+} else if (strpos(e_SELF, $PLUGINS_DIRECTORY) === FALSE) {
+	e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_".e_PAGE);
+	e107_include_once(e_LANGUAGEDIR."English/lan_".e_PAGE);
+}
+
+if(!defined("IMODE")) define("IMODE", "lite");
+
+if ($pref['anon_post'] ? define("ANON", TRUE) : define("ANON", FALSE));
+
+if (Empty($pref['newsposts']) ? define("ITEMVIEW", 15) : define("ITEMVIEW", $pref['newsposts']));
+
+if ($pref['antiflood1'] == 1) {
+	define('FLOODPROTECT', TRUE);
+	define('FLOODTIMEOUT', $pref['antiflood_timeout']);
+}
+
+$layout = isset($layout) ? $layout : '_default';
+define("HEADERF", e_THEME."templates/header{$layout}.php");
+define("FOOTERF", e_THEME."templates/footer{$layout}.php");
+
+if (!file_exists(HEADERF)) {
+	message_handler("CRITICAL_ERROR", "Unable to find file: ".HEADERF, __LINE__ - 2, __FILE__);
+}
+
+if (!file_exists(FOOTERF)) {
+	message_handler("CRITICAL_ERROR", "Unable to find file: ".FOOTERF, __LINE__ - 2, __FILE__);
+}
+
+define("LOGINMESSAGE", "");
+define("OPEN_BASEDIR", (ini_get('open_basedir') ? TRUE : FALSE));
+define("SAFE_MODE", (ini_get('safe_mode') ? TRUE : FALSE));
+define("FILE_UPLOADS", (ini_get('file_uploads') ? TRUE : FALSE));
+define("INIT", TRUE);
+if(isset($_SERVER['HTTP_REFERER'])) {
+	$tmp = explode("?", $_SERVER['HTTP_REFERER']);
+	define("e_REFERER_SELF",($tmp[0] == e_SELF));
+} else {
+	define('e_REFERER_SELF', FALSE);
+}
+
+if (!class_exists('convert'))
+{
+	require_once(e_HANDLER."date_handler.php");
+}
+
+//@require_once(e_HANDLER."IPB_int.php");
+//@require_once(e_HANDLER."debug_handler.php");
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+function js_location($qry){
+	echo "<script type='text/javascript'>document.location.href='{$qry}'</script>\n"; exit;
+}
+
+function check_email($email) {
+	return preg_match("/^([_a-zA-Z0-9-+]+)(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,6})$/" , $email) ? $email : FALSE;
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+function check_class($var, $userclass = USERCLASS, $peer = FALSE, $debug = FALSE)
+{
+	global $tp;
+	if($var == e_LANGUAGE){
+		return TRUE;
+	}
+
+	if (!$var || $var == "")
+	{
+		return TRUE;
+	}
+
+	if(strpos($var, ",") !== FALSE)
+	{
+		$lans = explode(",",e_LANLIST);
+		$varList = explode(",", $var);
+		rsort($varList); // check the language first.(ie. numbers come last)
+		foreach($varList as $v)
+		{
+			if (in_array($v,$lans) && strpos($v, e_LANGUAGE) === FALSE) {
+				return FALSE;
+			}
+
+			if(check_class($v, $userclass, $debug))	{
+				return TRUE;
+			}
+		}
+		return FALSE;
+	}
+
+	if (preg_match("/^([0-9]+)$/", $var) && !$peer)
+	{
+		if ($var == e_UC_MEMBER && USER == TRUE)
+		{
+			return TRUE;
+		}
+
+		if ($var == e_UC_GUEST && USER == FALSE) {
+			return TRUE;
+		}
+
+		if ($var == e_UC_PUBLIC) {
+			return TRUE;
+		}
+
+		if ($var == e_UC_NOBODY) {
+			return FALSE;
+		}
+
+		if ($var == e_UC_ADMIN && ADMIN) {
+			return TRUE;
+		}
+		if ($var == e_UC_READONLY) {
+			return TRUE;
+		}
+	}
+
+	if ($debug) {
+		echo "USERCLASS: ".$userclass.", \$var = $var : ";
+	}
+
+	if (!defined("USERCLASS") || $userclass == "") {
+		if ($debug) {
+			echo "FALSE<br />";
+		}
+		return FALSE;
+	}
+
+	// user has classes set - continue
+	if (preg_match("/^([0-9]+)$/", $var)) {
+		$tmp=explode(',', $userclass);
+		if (is_numeric(array_search($var, $tmp))) {
+			if ($debug) {
+				echo "TRUE<br />";
+			}
+			return TRUE;
+		}
+	} else {
+		// var is name of class ...
+		$sql=new db;
+		if ($sql->db_Select("userclass_classes", "*", "userclass_name='".$tp -> toDB($var)."' ")) {
+			$row=$sql->db_Fetch();
+			$tmp=explode(',', $userclass);
+			if (is_numeric(array_search($row['userclass_id'], $tmp))) {
+				if ($debug) {
+					echo "TRUE<br />";
+				}
+				return TRUE;
+			}
+		}
+	}
+
+	if ($debug) {
+		echo "NOTNUM! FALSE<br />";
+	}
+
+	return FALSE;
+}
+
+function getperms($arg, $ap = ADMINPERMS) {
+	global $PLUGINS_DIRECTORY;
+	if ($ap == "0") {
+		return TRUE;
+	}
+	if ($ap == "") {
+		return FALSE;
+	}
+	$ap='.'.$ap;
+	if ($arg == 'P' && preg_match("#(.*?)/".$PLUGINS_DIRECTORY."(.*?)/(.*?)#", e_SELF, $matches)) {
+		$psql=new db;
+		if ($psql->db_Select('plugin', 'plugin_id', "plugin_path = '".$matches[2]."' ")) {
+			$row=$psql->db_Fetch();
+			$arg='P'.$row[0];
+		}
+	}
+	if (strpos($ap, ".".$arg.".") !== FALSE) {
+		return TRUE;
+	} else {
+		return FALSE;
+	}
+}
+
+/**
+ * Get the user data from user and user_extended tables
+ *
+ * @return array
+ */
+function get_user_data($uid, $extra = "")
+{
+	global $pref, $sql;
+	$uid = intval($uid);
+	$var = array();
+	if($uid == 0) { return $var; }
+	if($ret = getcachedvars("userdata_{$uid}"))
+	{
+		return $ret;
+	}
+
+	$qry = "
+	SELECT u.*, ue.* FROM #user AS u
+	LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id
+	WHERE u.user_id='{$uid}' {$extra}
+	";
+	if (!$sql->db_Select_gen($qry))
+	{
+		$qry = "SELECT * FROM #user AS u WHERE u.user_id='{$uid}' {$extra}";
+		if(!$sql->db_Select_gen($qry))
+		{
+			return FALSE;
+		}
+	}
+
+	$var = $sql->db_Fetch();
+	$extended_struct = getcachedvars("extended_struct");
+	if(!$extended_struct)
+	{
+		unset($extended_struct);
+		$qry = "SHOW COLUMNS FROM #user_extended ";
+		if($sql->db_Select_gen($qry))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				if($row['Default'] != "")
+				{
+					$extended_struct[] = $row;
+				}
+			}
+			if(isset($extended_struct))
+			{
+				cachevars("extended_struct", $extended_struct);
+			}
+		}
+	}
+
+	if(isset($extended_struct))
+	{
+		foreach($extended_struct as $row)
+		{
+			if($row['Default'] != "" && ($var[$row['Field']] == NULL || $var[$row['Field']] == "" ))
+			{
+				$var[$row['Field']] = $row['Default'];
+			}
+		}
+	}
+	cachevars("userdata_{$uid}", $var);
+	return $var;
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+
+function save_prefs($table = 'core', $uid = USERID, $row_val = '') {
+	global $pref, $user_pref, $tp, $PrefCache, $sql, $eArrayStorage;
+	if ($table == 'core') {
+		if ($row_val == '') {
+			// Save old version as a backup
+			if(!$sql->db_Update('core', "e107_value='".addslashes($PrefCache)."' WHERE e107_name='SitePrefs_Backup'")){
+				$sql->db_Insert('core', "'SitePrefs', '".addslashes($PrefCache)."'");
+			}
+
+			// traverse the pref array, with toDB on everything
+			$_pref = $tp -> toDB($pref, true, true);
+			// Create the data to be stored
+			$PrefCache1 = $eArrayStorage->WriteArray($_pref);
+			if(!$sql->db_Update('core', "e107_value='{$PrefCache1}' WHERE e107_name = 'SitePrefs'")){
+				$sql->db_Insert('core', "'SitePrefs', '{$PrefCache1}'");
+			}
+			ecache::clear('SitePrefs');
+		}
+	} else {
+
+		$_user_pref = $tp -> toDB($user_pref);
+
+		$tmp=addslashes(serialize($_user_pref));
+		$sql->db_Update("user", "user_prefs='$tmp' WHERE user_id=".intval($uid));
+		return $tmp;
+	}
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+
+class e_online {
+	function online($online_tracking = false, $flood_control = false) {
+		if($online_tracking == true || $flood_control == true) {
+			global $online_timeout, $online_warncount, $online_bancount;
+			if(!isset($online_timeout)) {
+				$online_timeout = 300;
+			}
+			if(!isset($online_warncount)) {
+				$online_warncount = 90;
+			}
+			if(!isset($online_bancount)) {
+				$online_bancount = 100;
+			}
+			global $sql, $pref, $e107, $listuserson, $e_event, $tp;
+			$page = (strpos(e_SELF, "forum_") !== FALSE) ? e_SELF.".".e_QUERY : e_SELF;
+			$page = (strpos(e_SELF, "comment") !== FALSE) ? e_SELF.".".e_QUERY : $page;
+			$page = (strpos(e_SELF, "content") !== FALSE) ? e_SELF.".".e_QUERY : $page;
+			$page = $tp -> toDB($page, true);
+
+			$ip = $e107->getip();
+			$udata = (USER === true ? USERID.".".USERNAME : "0");
+
+			if (USER) {
+				// Find record that matches IP or visitor, or matches user info
+				if ($sql->db_Select("online", "*", "(`online_ip` = '{$ip}' AND `online_user_id` = '0') OR `online_user_id` = '{$udata}'")) {
+					$row = $sql->db_Fetch();
+
+					if ($row['online_user_id'] == $udata) {
+						//Matching user record
+						if ($row['online_timestamp'] < (time() - $online_timeout)) {
+							//It has been at least 'timeout' seconds since this user has connected
+							//Update user record with timestamp, current IP, current page and set pagecount to 1
+							$query = "online_timestamp='".time()."', online_ip='{$ip}', online_location='{$page}', online_pagecount=1 WHERE online_user_id='{$row['online_user_id']}' LIMIT 1";
+						} else {
+							if (!ADMIN) {
+								$row['online_pagecount'] ++;
+							}
+							// Update user record with current IP, current page and increment pagecount
+							$query = "online_ip='{$ip}', `online_location` = '{$page}', `online_pagecount` = '".intval($row['online_pagecount'])."' WHERE `online_user_id` = '{$row['online_user_id']}' LIMIT 1";
+						}
+					} else {
+						//Found matching visitor record (ip only) for this user
+						if ($row['online_timestamp'] < (time() - $online_timeout)) {
+							// It has been at least 'timeout' seconds since this user has connected
+							// Update record with timestamp, current IP, current page and set pagecount to 1
+							$query = "`online_timestamp` = '".time()."', `online_user_id` = '{$udata}', `online_location` = '{$page}', `online_pagecount` = 1 WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1";
+						} else {
+							if (!ADMIN) {
+								$row['online_pagecount'] ++;
+							}
+							//Update record with current IP, current page and increment pagecount
+							$query = "`online_user_id` = '{$udata}', `online_location` = '{$page}', `online_pagecount` = ".intval($row['online_pagecount'])." WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1";
+						}
+					}
+					$sql->db_Update("online", $query);
+				} else {
+					$sql->db_Insert("online", " '".time()."', '0', '{$udata}', '{$ip}', '{$page}', 1");
+				}
+			} else {
+				//Current page request is from a visitor
+				if ($sql->db_Select("online", "*", "`online_ip` = '{$ip}' AND `online_user_id` = '0'")) {
+					$row = $sql->db_Fetch();
+
+					if ($row['online_timestamp'] < (time() - $online_timeout)) //It has been at least 'timeout' seconds since this ip has connected
+					{
+						//Update record with timestamp, current page, and set pagecount to 1
+						$query = "`online_timestamp` = '".time()."', `online_location` = '{$page}', `online_pagecount` = 1 WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1";
+					} else {
+						//Update record with current page and increment pagecount
+						$row['online_pagecount'] ++;
+						//   echo "here {$online_pagecount}";
+						$query="`online_location` = '{$page}', `online_pagecount` = {$row['online_pagecount']} WHERE `online_ip` = '{$ip}' AND `online_user_id` = '0' LIMIT 1";
+					}
+					$sql->db_Update("online", $query);
+				} else {
+					$sql->db_Insert("online", " '".time()."', 'null', '0', '{$ip}', '{$page}', 1");
+				}
+			}
+
+			if (ADMIN || $pref['autoban'] != 1) {
+				$row['online_pagecount'] = 1;
+			}
+			if ($row['online_pagecount'] > $online_bancount && $row['online_ip'] != "127.0.0.1") {
+				$sql->db_Insert("banlist", "'{$ip}', '0', 'Hit count exceeded ({$row['online_pagecount']} requests within allotted time)' ");
+				$e_event->trigger("flood", $ip);
+				exit;
+			}
+			if ($row['online_pagecount'] >= $online_warncount && $row['online_ip'] != "127.0.0.1") {
+				echo "<div style='text-align:center; font: 11px verdana, tahoma, arial, helvetica, sans-serif;'><b>Warning!</b><br /><br />The flood protection on this site has been activated and you are warned that if you carry on requesting pages you could be banned.<br /></div>";
+				exit;
+			}
+
+			$sql->db_Delete("online", "`online_timestamp` < ".(time() - $online_timeout));
+
+			global $members_online, $total_online, $member_list, $listuserson;
+			$total_online = $sql->db_Count("online");
+			if ($members_online = $sql->db_Select("online", "*", "online_user_id != '0' ")) {
+				$member_list = '';
+				$listuserson = array();
+				while ($row = $sql->db_Fetch()) {
+					$vals = explode(".", $row['online_user_id'], 2);
+					$member_list .= "<a href='".e_BASE."user.php?id.{$vals[0]}'>{$vals[1]}</a> ";
+					$listuserson[$row['online_user_id']] = $row['online_location'];
+				}
+			}
+			define("TOTAL_ONLINE", $total_online);
+			define("MEMBERS_ONLINE", $members_online);
+			define("GUESTS_ONLINE", $total_online - $members_online);
+			define("ON_PAGE", $sql->db_Count("online", "(*)", "WHERE `online_location` = '{$page}' "));
+			define("MEMBER_LIST", $member_list);
+		} else {
+			define("e_TRACKING_DISABLED", true);
+			define("TOTAL_ONLINE", "");
+			define("MEMBERS_ONLINE", "");
+			define("GUESTS_ONLINE", "");
+			define("ON_PAGE", "");
+			define("MEMBER_LIST", ""); //
+		}
+	}
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+function cachevars($id, $var) {
+	global $cachevar;
+	$cachevar[$id]=$var;
+}
+
+function getcachedvars($id) {
+	global $cachevar;
+	return (isset($cachevar[$id]) ? $cachevar[$id] : false);
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+class floodprotect {
+	function flood($table, $orderfield) {
+		/*
+		# Test for possible flood
+		#
+		# - parameter #1                string $table, table being affected
+		# - parameter #2                string $orderfield, date entry in respective table
+		# - return                                boolean
+		# - scope                                        public
+		*/
+		$sql=new db;
+
+		if (FLOODPROTECT == TRUE) {
+			$sql->db_Select($table, "*", "ORDER BY ".$orderfield." DESC LIMIT 1", "no_where");
+			$row=$sql->db_Fetch();
+			return ($row[$orderfield] > (time() - FLOODTIMEOUT) ? FALSE : TRUE);
+		} else {
+			return TRUE;
+		}
+	}
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+function init_session() {
+	/*
+	# Validate user
+	#
+	# - parameters none
+	# - return boolean
+	# - scope public
+	*/
+	global $sql, $pref, $user_pref, $tp, $currentUser, $e107;
+
+	define('USERIP', $e107->getip());
+	if (!isset($_COOKIE[$pref['cookie_name']]) && !isset($_SESSION[$pref['cookie_name']])) {
+		define("USER", FALSE);
+		define("USERTHEME", FALSE);
+		define("ADMIN", FALSE);
+		define("GUEST", TRUE);
+		define('USERCLASS', '');
+		define('USEREMAIL', '');
+	} else {
+		list($uid, $upw)=(isset($_COOKIE[$pref['cookie_name']]) && $_COOKIE[$pref['cookie_name']] ? explode(".", $_COOKIE[$pref['cookie_name']]) : explode(".", $_SESSION[$pref['cookie_name']]));
+
+		if (empty($uid) || empty($upw)) {
+			cookie($pref['cookie_name'], "", (time() - 2592000));
+			$_SESSION[$pref['cookie_name']] = "";
+			session_destroy();
+			define("ADMIN", FALSE);
+			define("USER", FALSE);
+			define("USERCLASS", "");
+			define("LOGINMESSAGE", "Corrupted cookie detected - logged out.<br /><br />");
+			return (FALSE);
+		}
+
+		$result = get_user_data($uid);
+		if(is_array($result) && md5($result['user_password']) == $upw)
+		{
+
+			define("USERID", $result['user_id']);
+			define("USERNAME", $result['user_name']);
+			define("USERURL", (isset($result['user_homepage']) ? $result['user_homepage'] : false));
+			define("USEREMAIL", $result['user_email']);
+			define("USER", TRUE);
+			define("USERCLASS", $result['user_class']);
+			define("USERREALM", $result['user_realm']);
+			define("USERVIEWED", $result['user_viewed']);
+			define("USERIMAGE", $result['user_image']);
+			define("USERSESS", $result['user_sess']);
+
+			$update_ip = ($result['user_ip'] != USERIP ? ", user_ip = '".USERIP."'" : "");
+
+			if($result['user_currentvisit'] + 3600 < time() || !$result['user_lastvisit'])
+			{
+				$result['user_lastvisit'] = $result['user_currentvisit'];
+				$result['user_currentvisit'] = time();
+				$sql->db_Update("user", "user_visits = user_visits + 1, user_lastvisit = '{$result['user_lastvisit']}', user_currentvisit = '{$result['user_currentvisit']}', user_viewed = ''{$update_ip} WHERE user_id='".USERID."' ");
+			}
+			else
+			{
+				$result['user_currentvisit'] = time();
+				$sql->db_Update("user", "user_currentvisit = '{$result['user_currentvisit']}'{$update_ip} WHERE user_id='".USERID."' ");
+			}
+
+			$currentUser = $result;
+			$currentUser['user_realname'] = $result['user_login']; // Used by force_userupdate
+			define("USERLV", $result['user_lastvisit']);
+
+			if ($result['user_ban'] == 1) { exit; }
+
+			$user_pref = unserialize($result['user_prefs']);
+
+			if (isset($_POST['settheme'])) {
+				$user_pref['sitetheme'] = ($pref['sitetheme'] == $_POST['sitetheme'] ? "" : $_POST['sitetheme']);
+				save_prefs("user");
+			}
+
+			define("USERTHEME", ($user_pref['sitetheme'] && file_exists(e_THEME.$user_pref['sitetheme']."/theme.php") ? $user_pref['sitetheme'] : FALSE));
+			global $ADMIN_DIRECTORY, $PLUGINS_DIRECTORY;
+			if ($result['user_admin']) {
+				define("ADMIN", TRUE);
+				define("ADMINID", $result['user_id']);
+				define("ADMINNAME", $result['user_name']);
+				define("ADMINPERMS", $result['user_perms']);
+				define("ADMINEMAIL", $result['user_email']);
+				define("ADMINPWCHANGE", $result['user_pwchange']);
+			} else {
+				define("ADMIN", FALSE);
+			}
+		} else {
+			define("USER", FALSE);
+			define("USERTHEME", FALSE);
+			define("ADMIN", FALSE);
+			define("CORRUPT_COOKIE", TRUE);
+			define("USERCLASS", "");
+		}
+	}
+
+	define('USERCLASS_LIST', class_list());
+	define('e_CLASS_REGEXP', "(^|,)(".str_replace(",", "|", USERCLASS_LIST).")(,|$)");
+}
+
+$sql->db_Mark_Time('Start: Go online');
+if(isset($pref['track_online']) && $pref['track_online']) {
+	$e_online->online($pref['track_online'], $pref['flood_protect']);
+}
+
+function cookie($name, $value, $expire, $path = "/", $domain = "", $secure = 0) {
+	setcookie($name, $value, $expire, $path, $domain, $secure);
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+function message_handler($mode, $message, $line = 0, $file = "") {
+	e107_require_once(e_HANDLER."message_handler.php");
+	show_emessage($mode, $message, $line, $file);
+}
+
+// -----------------------------------------------------------------------------
+function table_exists($check) {
+	if (!$GLOBALS['mySQLtablelist']) {
+		$tablist=mysql_list_tables($GLOBALS['mySQLdefaultdb']);
+		while (list($temp) = mysql_fetch_array($tablist)) {
+			$GLOBALS['mySQLtablelist'][] = $temp;
+		}
+	}
+
+	$mltable=MPREFIX.strtolower($check);
+
+	foreach ($GLOBALS['mySQLtablelist'] as $lang) {
+		if (strpos($lang, $mltable) !== FALSE) {
+			return TRUE;
+		}
+	}
+}
+
+function class_list($uid = '') {
+	$clist=array();
+
+	if ($uid == '')
+	{
+		if (USER === TRUE)
+		{
+			if(USERCLASS)
+			{
+				$clist=explode(',', USERCLASS);
+			}
+			$clist[]=e_UC_MEMBER;
+			if (ADMIN === TRUE) {
+				$clist[] = e_UC_ADMIN;
+			}
+		} else {
+			$clist[] = e_UC_GUEST;
+		}
+		$clist[]=e_UC_READONLY;
+		$clist[]=e_UC_PUBLIC;
+		return implode(',', $clist);
+	}
+}
+
+// ---------------------------------------------------------------------------
+function e107_include($fname) {
+	global $e107_debug;
+	$ret = ($e107_debug ? include($fname) : @include($fname));
+	return $ret;
+}
+
+function e107_include_once($fname) {
+	global $e107_debug;
+	if(is_readable($fname)){
+		$ret = (!$e107_debug)? @include_once($fname) : include_once($fname);
+	}
+	return (isset($ret)) ? $ret : "";
+}
+
+function e107_require_once($fname) {
+	global $e107_debug;
+	$ret = ($e107_debug ? require_once($fname) : @require_once($fname));
+	return $ret;
+}
+
+function e107_require($fname) {
+	global $e107_debug;
+	$ret = ($e107_debug ? require($fname) : @require($fname));
+	return $ret;
+}
+
+function include_lan($path, $force = false) {
+	if (!is_readable($path)) {
+		$path = str_replace(e_LANGUAGE, 'English', $path);
+	}
+	$ret = ($force) ? include($path) : include_once($path);
+	return (isset($ret)) ? $ret : "";
+}
+
+if(!function_exists("print_a")) {
+	function print_a($var, $return = false) {
+		if(!$return){
+			echo '<pre>'.print_r($var, true).'</pre>';
+			return true;
+		} else {
+			return '<pre>'.print_r($var, true).'</pre>';
+		}
+	}
+}
+
+function force_userupdate() {
+
+	global $sql,$pref,$currentUser;
+
+	if (e_PAGE == "usersettings.php" || strpos(e_SELF, ADMINDIR) == TRUE)
+	{
+		return FALSE;
+	}
+
+    $signup_option_names = array("realname", "signature", "image", "timezone", "class");
+
+	foreach($signup_option_names as $key => $value)
+	{
+		if ($pref['signup_option_'.$value] == 2 && !$currentUser['user_'.$value])
+		{
+			return TRUE;
+		}
+    }
+
+	if($sql -> db_Select("user_extended_struct", "user_extended_struct_name", "user_extended_struct_required = '1'"))
+	{
+		while($row = $sql -> db_Fetch())
+		{
+			$user_extended_struct_name = "user_{$row['user_extended_struct_name']}";
+
+			if(!$currentUser[$user_extended_struct_name])
+			{
+				return TRUE;
+			}
+		}
+	}
+
+	return FALSE;
+}
+
+class error_handler {
+
+	var $errors;
+	var $debug = false;
+
+	function error_handler() {
+		if ((isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'debug=') !== FALSE) || isset($_COOKIE['e107_debug_level'])) {
+			$this->debug = true;
+			error_reporting(E_ALL);
+		} else {
+			error_reporting(E_ERROR | E_PARSE);
+		}
+	}
+
+	function handle_error($type, $message, $file, $line, $context) {
+		switch($type) {
+			case E_NOTICE:
+			if ($this->debug == true) {
+				$error['short'] = "Notice: {$message}, Line {$line} of {$file}<br />\n";
+				$trace = debug_backtrace();
+				$backtrace[0] = (isset($trace[1]) ? $trace[1] : "");
+				$backtrace[1] = (isset($trace[2]) ? $trace[2] : "");
+				$error['trace'] = $backtrace;
+				$this->errors[] = $error;
+			}
+			break;
+			case E_WARNING:
+			if ($this->debug == true) {
+				$error['short'] = "Warning: {$message}, Line {$line} of {$file}<br />\n";
+				$trace = debug_backtrace();
+				$backtrace[0] = (isset($trace[1]) ? $trace[1] : "");
+				$backtrace[1] = (isset($trace[2]) ? $trace[2] : "");
+				$error['trace'] = $backtrace;
+				$this->errors[] = $error;
+			}
+			break;
+			case E_USER_ERROR:
+			if ($this->debug == true) {
+				$error['short'] = "Internal Error Message: {$message}, Line {$line} of {$file}<br />\n";
+				$trace = debug_backtrace();
+				$backtrace[0] = (isset($trace[1]) ? $trace[1] : "");
+				$backtrace[1] = (isset($trace[2]) ? $trace[2] : "");
+				$error['trace'] = $backtrace;
+				$this->errors[] = $error;
+			}
+			default:
+			return true;
+			break;
+		}
+	}
+
+	function return_errors() {
+		$index = 0; $colours[0] = "#C1C1C1"; $colours[1] = "#B6B6B6";
+		$ret = "<table class='fborder'>\n";
+		foreach ($this->errors as $key => $value) {
+			$ret .= "\t<tr>\n\t\t<td class='forumheader3' >{$value['short']}</td><td><input class='button' type ='button' style='cursor: hand; cursor: pointer;' size='30' value='Back Trace' onclick=\"expandit('bt_{$key}')\" /></t>\n\t</tr>\n";
+			$ret .= "\t<tr>\n<td style='display: none;' colspan='2' id='bt_{$key}'>".print_a($value['trace'], true)."</td></tr>\n";
+			if($index == 0) { $index = 1; } else { $index = 0; }
+		}
+		$ret .= "</table>";
+		return $ret;
+	}
+
+	function trigger_error($information, $level) {
+		trigger_error($information);
+	}
+}
+
+/**
+ * Strips slashes from a var if magic_quotes_gqc is enabled
+ *
+ * @param mixed $data
+ * @return mixed
+ */
+function strip_if_magic($data) {
+	if (MAGIC_QUOTES_GPC == true) {
+		return array_stripslashes($data);
+	} else {
+		return $data;
+	}
+}
+
+/**
+ * Strips slashes from a string or an array
+ *
+ * @param mixed $value
+ * @return mixed
+ */
+function array_stripslashes($data) {
+	return is_array($data) ? array_map('array_stripslashes', $data) : stripslashes($data);
+}
+
+$sql->db_Mark_Time('(After class2)');
+
 ?>
\ No newline at end of file
diff -ruN 6171/comment.php 75/comment.php
--- 6171/comment.php	2004-06-06 02:51:30.000000000 -0500
+++ 75/comment.php	2006-01-09 06:43:02.000000000 -0600
@@ -1,240 +1,334 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system|
-|	/class.php|
-||
-|	Steve Dunstan 2001-2002|
-|	http://jalist.com|
-|	stevedunstan@jalist.com|
-||
-|	Released under the terms and conditions of the|
-|	GNU General Public License (http://gnu.org).|
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-require_once(e_HANDLER."news_class.php");
-require_once(e_HANDLER."comment_class.php");
-
-if(!e_QUERY){
-	header("location:".e_BASE."index.php");
-	exit;
-}
-$qs = explode(".", e_QUERY);
-$action = $qs[0];
-$table = $qs[1];
-$id = $qs[2];
-$nid = $qs[3];
-$xid = $qs[4];
-$cobj = new comment;
-$aj = new textparse;
-
-if(IsSet($_POST['commentsubmit'])){
-	if(!$sql -> db_Select("news", "news_allow_comments", "news_id='$id' ") && $table == "news"){
-		header("location:".e_BASE."index.php");
-		exit;
-	} else {
-		$row = $sql -> db_Fetch();
-		if(!$row[0] && (ANON===TRUE || USER===TRUE)){
-			if(!$pid){ $pid = 0; }
-			$cobj -> enter_comment($_POST['author_name'], $_POST['comment'], $table, $id, $pid, $_POST['subject']);
-			if($table == "news"){
-				clear_cache("news");
-			} else {
-				clear_cache("comment.php?$table.$id");
-			}
-		}
-	}
-}
-if(IsSet($_POST['replysubmit'])){
-	if($table == "news" && !$sql -> db_Select("news", "news_allow_comments", "news_id='$nid' ")){
-		header("location:".e_BASE."index.php");
-		exit;
-	} else {
-		$row = $sql -> db_Fetch();
-		if(!$row[0] && (ANON===TRUE || USER===TRUE)){
-			$pid = $_POST[pid];
-			$cobj -> enter_comment($_POST['author_name'], $_POST['comment'], $table, $nid, $pid, $_POST['subject']);
-			clear_cache("comment.php?$table.$id");
-		}
-		$plugin_redir = FALSE;
-		$handle=opendir(e_PLUGIN);
-		while(false !== ($file = readdir($handle))){
-			if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)){
-				$plugin_handle=opendir(e_PLUGIN.$file."/");
-				while(false !== ($file2 = readdir($plugin_handle))){
-					if($file2 == "e_comment.php"){
-						require_once(e_PLUGIN.$file."/".$file2);
-						if($table == $e_plug_table){
-							$plugin_redir = TRUE;
-							break 2;
-						}
-					}
-				}
-			}
-		}
-		if($plugin_redir){
-			header("location:".$reply_location."");
-			exit;
-		} elseif ($table == "news" || $table == "poll"){
-			header("location:".e_BASE."comment.php?comment.".$table.".".$nid."");
-			exit;
-		}elseif($table == "bugtrack"){
-			header("location:".e_PLUGIN."bugtracker/bugtracker.php?show.".$nid."");
-			exit;
-		}elseif($table == "faq"){
-			header("location:".e_PLUGIN."faq/faq.php?cat.".$xid.".".$nid."");
-			exit;
-		} elseif ($table == "content"){
-			header("location:".e_BASE."content.php?".$_POST['content_type'].".".$nid."");
-			exit;
-		} elseif ($table == "download"){
-			header("location:".e_BASE."download.php?view.".$nid."");
-			exit;
-		}
-	}
-}
-if($action == "reply"){
-	if(!$pref['nested_comments']){
-		header("location:".e_BASE."comment.php?comment.".$table.".".$nid."");
-		exit;
-	}
-	$query = "comment_id='$id' LIMIT 0,1";
-	if($sql -> db_Select("comments", "comment_subject", "comment_id='$id'")){
-		list($comments['comment_subject']) = $sql -> db_Fetch();
-		$subject = $aj -> formtpa($comments['comment_subject']);
-	}
-	if($subject == ""){
-		if($table == "news"){
-			if(!$sql -> db_Select("news", "news_title", "news_id='$nid' ")){
-				header("location:".e_BASE."index.php");
-				exit;
-			} else {
-				list($news['news_title']) = $sql -> db_Fetch();
-				$subject = $news['news_title'];
-				$title = LAN_100;
-			}
-		} elseif ($table == "poll"){
-			if(!$sql -> db_Select("poll", "poll_title", "poll_id='$nid' ")){
-				header("location:".e_BASE."index.php");
-				exit;
-			} else {
-				list($poll['poll_title']) = $sql -> db_Fetch();
-				$subject = $poll['poll_title'];
-				$title = LAN_101;
-			}
-		} elseif ($table == "content"){
-			$sql -> db_Select("content", "content_heading", "content_id='$nid'");
-			$subject = $content['content_heading'];
-		} elseif ($table == "bugtracker"){
-			$sql -> db_Select("bugtrack", "bugtrack_summary", "bugtrack_id='$nid'");
-			$subject = $content['content_heading'];
-		}
-	}
-	if($table == "content"){
-		$sql -> db_Select("content", "content_type", "content_id='$nid'");
-		list($content['content_type']) = $sql -> db_Fetch();
-		if($content['content_type'] == "0"){
-			$content_type = "article";
-			$title = LAN_103;
-		} elseif ($content['content_type'] == "3"){
-			$content_type = "review";
-			$title = LAN_104;
-		} elseif ($content['content_type'] == "1"){
-			$content_type = "content";
-			$title = LAN_105;
-		}
-	}
-
-	define(e_PAGETITLE,  $title." / ".LAN_99." / ".LAN_102.$subject."");
-	require_once(HEADERF);
-}else{
-
-
-if($cache = retrieve_cache("comment.php?$table.$id")){
-	require_once(HEADERF);
-	echo $cache;
-	require_once(FOOTERF);
-	exit;
-} else {
-	if($table == "news"){
-		if(!$sql -> db_Select("news", "*", "news_id='$id' ")){
-			header("location:".e_BASE."index.php");
-			exit;
-		} else {
-			list($news['news_id'], $news['news_title'], $news['data'], $news['news_extended'], $news['news_datestamp'], $news['admin_id'], $news_category, $news['news_allow_comments'],  $news['news_start'], $news['news_end'], $news['news_class']) = $sql -> db_Fetch();
-			if($news['news_allow_comments']){
-				header("location:".e_BASE."index.php");
-				exit;
-			}
-			if(!check_class($news['news_class'])){
-				header("location:".e_BASE."index.php");
-				exit;
-			} else {
-				$subject = $aj -> formtpa($news['news_title']);
-				define(e_PAGETITLE,  LAN_100." / ".LAN_99." / ".$subject."");
-				require_once(HEADERF);
-				ob_end_flush();
-				ob_start();
-				$sql -> db_Select("user", "user_name", "user_id='".$news['admin_id']."' ");
-				list($news['admin_name']) = $sql -> db_Fetch();
-				$sql -> db_Select("news_category", "*",  "category_id='$news_category' ");
-				list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql-> db_Fetch();
-				$news['comment_total'] = $sql -> db_Count("comments", "(*)",  "WHERE comment_item_id='".$news['news_id']."' AND comment_type='0' ");
-				$ix = new news;
-				$ix -> render_newsitem($news, "default");
-				$field = $news['news_id'];
-				$comtype = 0;
-			}
-		}
-	} else if($table == "poll") {
-		if(!$sql -> db_Select("poll", "*", "poll_id='$id' ")){
-			header("location:".e_BASE."index.php");
-			exit;
-		} else {
-			$row = $sql -> db_Fetch();
-			extract($row);
-			if($poll_comment == 0){header("location:".e_BASE."index.php");}
-			$subject = $poll_title;
-			define(e_PAGETITLE,  LAN_101." / ".LAN_99." / ".$subject."");
-			require_once(HEADERF);
-			require_once(e_PLUGIN."poll_menu/poll_menu.php");
-			$field = $poll_id;
-			$comtype = 4;
-		}
-	}
-	require_once(HEADERF);
-	$query = ($pref['nested_comments'] ? "comment_item_id='$field' AND comment_type='$comtype' AND comment_pid='0' ORDER BY comment_datestamp" : "comment_item_id='$field' AND comment_type='$comtype'  ORDER BY comment_datestamp");
-}
-}
-
-$comment_total = $sql -> db_Select("comments", "*",  "".$query."");
-if($comment_total){
-	$width = 0;
-	while($row = $sql -> db_Fetch()){
-		if($pref['nested_comments']){
-			$text = $cobj -> render_comment($row, $table, $action, $id, $width, $subject);
-			$ns -> tablerender(LAN_5, $text);
-		} else {
-			$text .= $cobj -> render_comment($row, $table, $action, $id, $width, $subject);
-		}
-	}
-	if(!$pref['nested_comments']){$ns -> tablerender(LAN_5, $text);	}
-}
-
-
-if(ADMIN && getperms("B")){
-	if(!strstr(e_QUERY, ".")){ $ct = "news."; }
-	echo "<div style='text-align:right'><a href='".e_ADMIN."modcomment.php?".$table.".".$id."'>".LAN_314."</a></div><br />";
-}
-
-$cobj -> form_comment($action, $table, $id, $subject, $content_type);
-
-if(!strstr(e_QUERY, "poll")){
-	$cache = ob_get_contents();
-	set_cache("comment.php?{$table}.{$field}",$cache);
-}
-
-
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/comment.php,v $
+|     $Revision: 1.47 $
+|     $Date: 2006/01/09 12:43:02 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+require_once(e_HANDLER."news_class.php");
+require_once(e_HANDLER."comment_class.php");
+
+if (!e_QUERY) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+
+$cobj =& new comment;
+
+$temp_query = explode(".", e_QUERY);
+$action = $temp_query[0];
+$table = $temp_query[1];
+$id = (isset($temp_query[2]) ? intval($temp_query[2]) : "");
+$nid = (isset($temp_query[3]) ? intval($temp_query[3]) : "");
+$xid = (isset($temp_query[4]) ? intval($temp_query[4]) : "");
+unset($temp_query);
+
+if (isset($_POST['commentsubmit']) || isset($_POST['editsubmit'])) {
+	if(!ANON && !USER)
+	{
+		header("location: ".e_BASE."index.php");
+		exit;
+	}
+	
+	if($table == "poll") {
+		if (!$sql->db_Select("polls", "poll_title", "`poll_id` = {$id} AND `poll_comment` = 1")) {
+			header("location: ".e_BASE."index.php");
+			exit;
+		}
+	} else if($table == "news") {
+		if (!$sql->db_Select("news", "news_allow_comments", "`news_id` = {$id} AND `news_allow_comments` = 0")) {
+			header("location: ".e_BASE."index.php");
+			exit;
+		}
+	}
+
+	$pid = (isset($_POST['pid']) ? $_POST['pid'] : 0);
+	$pid = intval($pid);
+
+	$editpid = intval((isset($_POST['editpid']) ? $_POST['editpid'] : false));
+
+	$clean_authorname = $_POST['author_name'];
+	$clean_comment = $_POST['comment'];
+	$clean_subject = $_POST['subject'];
+
+	$cobj->enter_comment($clean_authorname, $clean_comment, $table, $id, $pid, $clean_subject);
+	if ($table == "news") {
+		$e107cache->clear("news");
+	} else {
+		$e107cache->clear("comment.php?{$table}.{$id}");
+	}
+
+	if($editpid) {
+		$redir = preg_replace("#\.edit.*#si", "", e_QUERY);
+		header("Location: ".e_SELF."?{$redir}");
+		exit;
+	}
+}
+
+if (isset($_POST['replysubmit']))
+{
+
+	if ($table == "news" && !$sql->db_Select("news", "news_allow_comments", "news_id='{$nid}' ")) {
+		header("location:".e_BASE."index.php");
+		exit;
+	} else {
+		$row = $sql->db_Fetch();
+		if (!$row['news_id']) {
+			$pid = (isset($_POST['pid']) ? $_POST['pid'] : 0);
+			$pid = intval($pid);
+
+			$clean_authorname = $_POST['author_name'];
+			$clean_comment = $_POST['comment'];
+			$clean_subject = $_POST['subject'];
+
+			$cobj->enter_comment($clean_authorname, $clean_comment, $table, $nid, $pid, $clean_subject);
+			$e107cache->clear("comment.php?{$table}.{$id}");
+		}
+		$plugin_redir = false;
+		$handle = opendir(e_PLUGIN);
+		while (false !== ($file = readdir($handle))) {
+			if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)) {
+				$plugin_handle = opendir(e_PLUGIN.$file."/");
+				while (false !== ($file2 = readdir($plugin_handle))) {
+					if ($file2 == "e_comment.php") {
+						require_once(e_PLUGIN.$file."/".$file2);
+						if ($table == $e_plug_table) {
+							$plugin_redir = TRUE;
+							break 2;
+						}
+					}
+				}
+			}
+		}
+
+		if ($plugin_redir)
+		{
+			echo "<script type='text/javascript'>document.location.href='{$reply_location}'</script>\n";
+			exit;
+		} elseif ($table == "news" || $table == "poll")
+		{
+			echo "<script type='text/javascript'>document.location.href='".e_BASE."comment.php?comment.{$table}.{$nid}'</script>\n";
+			exit;
+		} elseif($table == "bugtrack")
+		{
+			echo "<script type='text/javascript'>document.location.href='".e_PLUGIN."bugtracker/bugtracker.php?show.{$nid}'</script>\n";
+			exit;
+		} elseif($table == "faq")
+		{
+			echo "<script type='text/javascript'>document.location.href='".e_PLUGIN."faq/faq.php?cat.{$xid}.{$nid}'</script>\n";
+			exit;
+		} elseif ($table == "content")
+		{
+			echo "<script type='text/javascript'>document.location.href='".e_BASE."content.php?{$_POST['content_type']}.{$nid}'</script>\n";
+			exit;
+		} elseif ($table == "download")
+		{
+			echo "<script type='text/javascript'>document.location.href='".e_BASE."download.php?view.{$nid}'</script>\n";
+			exit;
+		} elseif ($table == "page")
+		{
+			echo "<script type='text/javascript'>document.location.href='".e_BASE."page.php?{$nid}'</script>\n";
+			exit;
+		}
+	}
+}
+
+if ($action == "reply") {
+	if (!$pref['nested_comments']) {
+		header("Location: ".e_BASE."comment.php?comment.{$table}.{$nid}");
+		exit;
+	}
+	$query = "`comment_id` = '{$id}' LIMIT 0,1";
+	if ($sql->db_Select("comments", "comment_subject", "`comment_id` = '{$id}'")) {
+		list($comments['comment_subject']) = $sql->db_Fetch();
+		$not_parsed_subject = $comments['comment_subject'];
+		$subject = $tp->toHTML($comments['comment_subject']);
+
+	}
+	if ($subject == "") {
+		if ($table == "news") {
+			if (!$sql->db_Select("news", "news_title", "news_id='{$nid}' ")) {
+				header("location: ".e_BASE."index.php");
+				exit;
+			} else {
+				list($news['news_title']) = $sql->db_Fetch();
+				$subject = $news['news_title'];
+				$title = LAN_100;
+			}
+		} elseif ($table == "poll") {
+			if (!$sql->db_Select("polls", "poll_title", "poll_id='{$nid}' ")) {
+				header("location:".e_BASE."index.php");
+				exit;
+			} else {
+				list($poll['poll_title']) = $sql->db_Fetch();
+				$subject = $poll['poll_title'];
+				$title = LAN_101;
+			}
+		} elseif ($table == "content") {
+			$sql->db_Select("content", "content_heading", "content_id='{$nid}'");
+			$subject = $content['content_heading'];
+		} elseif ($table == "bugtracker") {
+			$sql->db_Select("bugtrack", "bugtrack_summary", "bugtrack_id='{$nid}'");
+			$subject = $content['content_heading'];
+		}
+	}
+	if ($table == "content") {
+		$sql->db_Select("content", "content_type", "content_id='{$nid}'");
+		list($content['content_type']) = $sql->db_Fetch();
+		if ($content['content_type'] == "0") {
+			$content_type = "article";
+			$title = LAN_103;
+		} elseif ($content['content_type'] == "3") {
+			$content_type = "review";
+			$title = LAN_104;
+		} elseif ($content['content_type'] == "1") {
+			$content_type = "content";
+			$title = LAN_105;
+		}
+	}
+
+	define('e_PAGETITLE', $title." / ".LAN_99." / ".LAN_102.$subject."");
+	require_once(HEADERF);
+} else {
+
+
+	if ($cache = $e107cache->retrieve("comment.php?{$table}.{$id}")) {
+		require_once(HEADERF);
+		echo $cache;
+		require_once(FOOTERF);
+		exit;
+	} else {
+		if ($table == "news") {
+			/*
+			changes by jalist 19/01/05:
+			updated db query removed one call
+			*/
+
+			if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled']) {
+				$query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+				LEFT JOIN #user AS u ON n.news_author = u.user_id
+				LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id 
+				LEFT JOIN #trackback AS tb ON tb.trackback_pid  = n.news_id 
+				WHERE n.news_class IN (".USERCLASS_LIST.") 
+				AND n.news_id={$id} 
+				AND n.news_allow_comments=0
+				GROUP by n.news_id";
+			} else {
+				$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+				LEFT JOIN #user AS u ON n.news_author = u.user_id
+				LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id 
+				WHERE n.news_class IN (".USERCLASS_LIST.") 
+				AND n.news_id={$id} 
+				AND n.news_allow_comments=0";
+			}
+
+			if (!$sql->db_Select_gen($query)) {
+				header("location:".e_BASE."index.php");
+				exit;
+			} else {
+				$news = $sql->db_Fetch();
+				$subject = $tp->toForm($news['news_title']);
+				define("e_PAGETITLE", LAN_100." / ".LAN_99." / {$subject}");
+				require_once(HEADERF);
+				ob_start();
+				$ix = new news;
+				$ix->render_newsitem($news, "default");
+				$field = $news['news_id'];
+				$comtype = 0;
+			}
+		}
+		else if($table == "poll") {
+			if (!$sql->db_Select("polls", "*", "poll_id='{$id}'")) {
+				header("location:".e_BASE."index.php");
+				exit;
+			} else {
+				$row = $sql->db_Fetch();
+				$comments_poll = $row['poll_comment'];
+				$subject = $row['poll_title'];
+				define("e_PAGETITLE", LAN_101." / ".LAN_99." / ".$subject."");
+				require_once(HEADERF);
+				require(e_PLUGIN."poll/poll_menu.php");
+				$field = $row['poll_id'];
+				$comtype = 4;
+
+				if(!$comments_poll)
+				{
+					require_once(FOOTERF);
+					exit;
+				}
+			}
+		}
+		require_once(HEADERF);
+	}
+}
+
+if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news"){
+	echo "<span class='smalltext'><b>".$pref['trackbackString']."</b> ".$e107->http_path.e_PLUGIN."trackback/trackback.php?pid={$id}</span>";
+}
+$field = ($field ? $field : ($id ? $id : ""));
+$width = (isset($width) && $width ? $width : "");
+$cobj->compose_comment($table, $action, $field, $width, $subject, $rate=FALSE);
+
+if (!strstr(e_QUERY, "poll")) {
+	$cache = ob_get_contents();
+	$e107cache->set("comment.php?{$table}.{$field}", $cache);
+}
+ob_end_flush(); // dump the buffer we started
+
+
+if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled'] && $table == "news"){
+	if($sql->db_Select("trackback", "*", "trackback_pid={$id}"))
+	{
+		$tbArray = $sql -> db_getList();
+
+		if (file_exists(THEME."trackback_template.php")) {
+			require_once(THEME."trackback_template.php");
+		} else {
+			require_once(e_THEME."templates/trackback_template.php");
+		}
+
+		$text = "";
+
+		foreach($tbArray as $trackback)
+		{
+			extract($trackback);
+			$TITLE = $trackback_title;
+			$EXCERPT = $trackback_excerpt;
+			$BLOGNAME = "<a href='{$trackback_url}' rel='external'>{$trackback_blogname}</a>";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TRACKBACK);
+		}
+
+		if($TRACKBACK_RENDER_METHOD)
+		{
+			$ns->tablerender("<a name='track'></a>".LAN_315, $text);
+		}
+		else
+		{
+			echo "<a name='track'></a>".$text;
+		}
+	}
+	else
+	{
+		echo "<a name='track'></a>".LAN_316;
+	}
+	if (ADMIN && getperms("B")) {
+		echo "<div style='text-align:right'><a href='".e_PLUGIN."trackback/modtrackback.php?".$id."'>".LAN_317."</a></div><br />";
+	}
+}
+
+
+require_once(FOOTERF);
+
 ?>
\ No newline at end of file
diff -ruN 6171/contact.php 75/contact.php
--- 6171/contact.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/contact.php	2006-05-01 18:58:46.000000000 -0500
@@ -0,0 +1,108 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/contact.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/05/01 23:58:46 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+require_once(HEADERF);
+
+if(!isset($pref['contact_emailcopy']) || !$pref['contact_emailcopy'])
+{
+	$CONTACT_EMAIL_COPY = " ";
+}
+
+if (!$CONTACT_FORM) {
+	if (file_exists(THEME."contact_template.php")) {
+		require_once(THEME."contact_template.php");
+	} else {
+		require_once(e_THEME."templates/contact_template.php");
+	}
+}
+
+if(isset($_POST['send-contactus'])){
+
+	$error = "";
+
+	$sender_name = $tp->post_toHTML($_POST['author_name']);
+	$sender = check_email($_POST['email_send']);
+	$subject = $tp->post_toHTML($_POST['subject']);
+	$body = $tp->post_toHTML($_POST['body']);
+
+// Check message body.
+	if(strlen($_POST['body']) < 15)
+	{
+		$error .= LANCONTACT_12."\\n";
+    }
+
+// Check subject line.
+	if(strlen($_POST['subject']) < 2)
+	{
+		$error .= LANCONTACT_13."\\n";
+    }
+
+
+// Check email address on remote server (if enabled).
+	if ($pref['signup_remote_emailcheck'] && $error == "")
+	{
+		require_once(e_HANDLER."mail_validation_class.php");
+		list($adminuser,$adminhost) = split ("@", SITEADMINEMAIL);
+		$validator = new email_validation_class;
+		$validator->localuser= $adminuser;
+		$validator->localhost= $adminhost;
+		$validator->timeout=3;
+		//	$validator->debug=1;
+		//	$validator->html_debug=1;
+		if($validator->ValidateEmailBox($sender) != 1)
+		{
+			$error .= LANCONTACT_11."\\n";
+		}
+
+	}
+
+// No errors - so proceed to email the admin and the user (if selected).
+    if(!$error)
+	{
+		$body .= "\n\nIP:\t".USERIP."\n";
+		$body .= "User:\t#".USERID." ".USERNAME."\n";
+
+    	require_once(e_HANDLER."mail.php");
+ 		$message =  (sendemail(SITEADMINEMAIL,"[".SITENAME."] ".$subject, $body,ADMIN,$sender,$sender_name)) ? LANCONTACT_09 : LANCONTACT_10;
+    	if(isset($pref['contact_emailcopy']) && $pref['contact_emailcopy'] && $_POST['email_copy'] == 1){
+			sendemail($sender,"[".SITENAME."] ".$subject, $body,ADMIN,$sender,$sender_name);
+    	}
+    	$ns -> tablerender('', $message);
+		require_once(FOOTERF);
+		exit;
+    } else {
+		require_once(e_HANDLER."message_handler.php");
+		message_handler("ALERT", $error);
+	}
+
+}
+
+if(SITECONTACTINFO && $CONTACT_INFO){
+	$text = $tp->toHTML($CONTACT_INFO,"","parse_sc");
+	$ns -> tablerender(LANCONTACT_01, $text);
+}
+
+$text = $CONTACT_FORM;
+
+if(trim($text) != ""){
+	$ns -> tablerender(LANCONTACT_02, $text);
+}
+require_once(FOOTERF);
+exit;
+?>
\ No newline at end of file
diff -ruN 6171/content.php 75/content.php
--- 6171/content.php	2005-05-12 23:24:35.000000000 -0500
+++ 75/content.php	2005-12-24 16:53:38.000000000 -0600
@@ -1,1004 +1,73 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/review.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-if(e_QUERY){
-	$tmp = explode(".", e_QUERY);
-	$action = $tmp[0];
-	$sub_action = $tmp[1];
-	$id = $tmp[2];
-	unset($tmp);
-}else{	
-	require_once(HEADERF);
-	$text = "<a href='".e_SELF."?article'>".LAN_59." ".LAN_57."</a>\n<br />\n<a href='".e_SELF."?review'>".LAN_59." ".LAN_58."</a>";
-	$ns -> tablerender(LAN_60, $text);
-	require_once(FOOTERF);
-	exit;
-}
-$query="";
-if($action == "content"){
-	$sub_action=intval($sub_action);
-	$query = "content_id='".$sub_action."' ";
-	$page = LAN_60." /";
-	}
-if($action == "article"){
-	if(is_numeric($sub_action)){
-		$query = "content_id='".$sub_action."' ";
-		$page = LAN_1." /";
-	}elseif($sub_action == "cat" ){
-		if($id == "0"){
-			$page = LAN_57." / ".LAN_61;
-		}else{
-			$query = "content_id='".$id."' ";
-			$page = LAN_1." / ".LAN_3." /";
-		}
-	}else{		
-		$page = LAN_50;
-	}
-}
-if($action == "review"){
-	if(is_numeric($sub_action)){
-		$page = LAN_2." /";
-		$query = "content_id='".$sub_action."' ";
-	}elseif($sub_action == "cat"){
-		$page = LAN_2." / ".LAN_3." /";
-		$query = "content_id='".$id."' ";
-	}else{		
-		$page = LAN_35;
-	}
-}
-if($query){
-//	echo $query; exit;
-if($sql -> db_Select("content", "*", $query)){ 
-	$row = $sql -> db_Fetch(); extract($row);
-	define("e_PAGETITLE", $page." ".$content_heading);
-	}
-}else{
-	define("e_PAGETITLE", $page);
-}
-
-$highlight_search = FALSE;
-if(IsSet($_POST['highlight_search'])){
-	$highlight_search = TRUE;
-}
-require_once(HEADERF);
-
-
-require_once(e_HANDLER."emailprint_class.php");
-$ep = new emailprint;
-/*
-$ep = "<div style='text-align:right'>
-<a href='email.php?article.".$sub_action."'><img src='".e_IMAGE."generic/friend.gif' style='border:0' alt='email to someone' /></a>
-<a href='print.php?content.".$sub_action."'><img src='".e_IMAGE."generic/printer.gif' style='border:0' alt='printer friendly' /></a>
-</div>";
-*/
-
-
-require_once(e_HANDLER."comment_class.php");
-$cobj = new comment;
-require_once(e_HANDLER."rate_class.php");
-$rater = new rater;
-if(IsSet($_POST['commentsubmit'])){
-	$tmp = explode(".", e_QUERY);
-
-	if(!$sql -> db_Select("content", "content_comment", "content_id='$sub_action' ")){
-		header("location:".e_BASE."index.php");
-		exit;
-	}else{
-		$row = $sql -> db_Fetch();
-		if($row[0] && (ANON===TRUE || USER===TRUE)){
-			$cobj -> enter_comment($_POST['author_name'], $_POST['comment'], "content", $sub_action, $pid, $_POST['subject']);
-			clear_cache("comment.content.{$sub_action}");
-		}
-	}
-}
-// content page -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-if($action == "content"){
-
-	if(!$sql -> db_Select("content", "*", "content_id=$sub_action AND content_type=1")){
-		header("location: ".e_BASE."index.php");
-		exit;
-	}
-	$row = $sql -> db_Fetch(); extract($row);
-
-	if(!check_class($content_class)){
-		$ns->tablerender(LAN_52, "<div style='text-align:center'>".LAN_54."</div>");
-		require_once(FOOTERF);
-		exit;
-	}
-
-
-	if($cache = retrieve_cache("content.$sub_action")){
-		echo $aj -> formtparev($cache);
-	}else{
-		ob_start();		
-
-		$search = array("{e_BASE}", "{e_ADMIN}", "{e_IMAGE}", "{e_THEME}", "{THEME}", "{e_PLUGIN}", "{e_FILE}", "{e_HANDLER}", "{e_LANGUAGEDIR}", "{e_DOCS}", "{e_DOCROOT}");
-		$replace = array(e_BASE, e_ADMIN, e_IMAGE, e_THEME, THEME, e_PLUGIN, e_FILE, e_HANDLER, e_LANGUAGEDIR, e_DOCS, e_DOCROOT);
-		$content_content = str_replace($search, $replace, $content_content);
-
-		$textemailprint = $ep -> render_emailprint("content",$sub_action);
-		if(strstr($content_content, "{EMAILPRINT}")){
-			$content_content = str_replace("{EMAILPRINT}", $textemailprint, $content_content);
-			$epflag = TRUE;
-		}elseif($content_pe_icon){
-			$content_content = $content_content."<br /><br />".$textemailprint;
-		}
-		$text = ($content_parent ? $aj -> tpa($content_content, "nobreak", "admin", $highlight_search) : $aj -> tpa($content_content, "off", "admin", $highlight_search));
-		
-		if($info = preg_split("#\[section=(.*?)\]#",$text,-1,PREG_SPLIT_DELIM_CAPTURE))
-		{
-			for($sec=0; $sec < count($info); $sec+=2 )
-			{
-				if($sec == 0)
-				{
-					$caption = $aj -> tpa($content_subheading, "off", "admin");
-				} else 
-				{
-					$caption = $aj -> tpa($info[$sec-1], "off", "admin");
-				}
-				$ns -> tablerender($caption, $info[$sec]);
-			}
-		} else 
-		{
-			$caption = $aj -> tpa($content_subheading, "off", "admin");
-			$ns -> tablerender($caption, $text);
-		}
-		
-		if($pref['cachestatus']){
-			$cache = $aj -> formtpa(ob_get_contents(), "admin");
-			set_cache("content.$sub_action", $cache);
-		}
-	}
-
-	if($content_comment){
-		if($cache = retrieve_cache("comment.content.$sub_action")){
-			echo $aj -> formtparev($cache);
-		}else{
-			ob_start();
-			unset($text);
-					if($comment_total = $sql -> db_Select("comments", "*",  "comment_item_id='$sub_action' AND comment_type='1' AND comment_pid='0' ORDER BY comment_datestamp")){
-					$width = 0;
-					while($row = $sql -> db_Fetch()){
-					if($pref['nested_comments']){
-						$text = $cobj -> render_comment($row, "content" , "comment", $sub_action, $width, $content_heading);			
-						$ns -> tablerender(LAN_5, $text);	
-						}else{
-							$text .= $cobj -> render_comment($row, "content" , "comment", $sub_action, $width, $content_heading);	
-						}
-				}
-				if(!$pref['nested_comments']){$ns -> tablerender(LAN_5, $text);	}
-				if($pref['cachestatus']){
-					$cache = $aj -> formtpa(ob_get_contents(), "admin");
-					set_cache("comment.content.$sub_action", $cache);
-				}
-			}
-		}
-		if(ADMIN && getperms("B") && $comment_total){
-			echo "<div style='text-align:right'><a href='".e_ADMIN."modcomment.php?content.$sub_action'>".LAN_29."</a></div><br />";
-		}
-		$cobj -> form_comment("comment", "content", $sub_action, $content_heading);
-	}
-}
-	
-
-// ##### Review List -----------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if($action == "review"){
-
-	if(is_numeric($sub_action)){
-		$cachestr = ($id ? "review.item.$sub_action.$id" : "review.item.$sub_action");
-		if($cache = retrieve_cache($cachestr)){
-			echo $aj -> formtparev($cache);
-		}else{
-			ob_start();
-			if($sql -> db_Select("content", "*", "content_id=$sub_action")){	
-				$row = $sql -> db_Fetch(); extract($row);
-
-				if(!check_class($content_class)){
-					$ns -> tablerender(LAN_52, "<div style='text-align:center'>".LAN_53."</div>");
-					require_once(FOOTERF);
-					exit;
-				}
-				
-				$sql2 = new db;
-				$gen = new convert; 
-				$sql2 -> db_Select("content", "content_id, content_summary", "content_id=$content_parent");
-				list($content_id_, $content_summary_) = $sql2-> db_Fetch();
-				$datestamp = ereg_replace(" -.*", "", $gen->convert_date($content_datestamp, "long"));
-				$sql2 -> db_Select("user", "*", "user_id=$content_author");
-				$row = $sql2 -> db_Fetch(); extract($row);
-				if(is_numeric($content_author)){
-					$sql2 -> db_Select("user", "*", "user_id=$content_author");
-					$row = $sql2 -> db_Fetch(); extract($row);
-				}else{
-					$tmp = explode("^", $content_author);
-					$user_name = $tmp[0];
-					$user_email = $tmp[1];
-				}
-
-				$text .= ($content_summary_ ? "<a href='".e_SELF."?review.cat.$content_id_'><img src='".e_IMAGE."link_icons/".$content_summary_."' alt='' style='float:left; border:0' /></a>" : "")."
-				<span class='mediumtext'><b>$content_heading</b></span>
-				<br />
-				<span class='smalltext'>".LAN_43."$user_name".LAN_44."$datestamp</span>
-				<br /><br />
-				$content_summary
-				<br /><br />";
-			
-				$search = array("{e_BASE}", "{e_ADMIN}", "{e_IMAGE}", "{e_THEME}", "{e_PLUGIN}", "{e_FILE}", "{e_HANDLER}", "{e_LANGUAGEDIR}", "{e_DOCS}", "{e_DOCROOT}");
-				$replace = array(e_BASE, e_ADMIN, e_IMAGE, e_THEME, e_PLUGIN, e_FILE, e_HANDLER, e_LANGUAGEDIR, e_DOCS, e_DOCROOT);
-				$content_content = str_replace($search, $replace, $content_content);
-
-				$content_content = $aj -> tpa($content_content, "off", "admin", $highlight_search);
-				$reviewpages = explode("[newpage]",$content_content);
-				$totalpages = count($reviewpages);
-				if(strstr($content_content, "{EMAILPRINT}") || $content_pe_icon){
-					$content_content = str_replace("{EMAILPRINT}", $textemailprint, $content_content);
-					$epflag = TRUE;
-				}
-
-				if($totalpages > 1){
-					$text .=  $reviewpages[(!$id ? 0 : $id)]."<br /><br />";
-					if($id != 0){ $text .= "<a href='content.php?review.$sub_action.".($id-1)."'>".LAN_25." <<</a> "; }
-					for($c=1; $c<= $totalpages; $c++){
-						$text .= ($c == ($id+1) ? "<span style='text-decoration: underline;'>$c</span>&nbsp;&nbsp;" : "<a href='content.php?review.$sub_action.".($c-1)."'>$c</a>&nbsp;&nbsp;");
-					}
-					if(($id+1) != $totalpages){ $text .= "<a href='content.php?review.$sub_action.".($id+1)."'>>> ".LAN_26."</a> "; }
-					if($epflag){ $text .= $textemailprint; }
-					$content_heading .= ", ".LAN_63." ".($id+1);
-					$cachestr = ($id ? "review.item.$sub_action.$id" : "review.item.$sub_action");
-
-				}else{
-					$text .= $content_content."\n<br />\n";
-					if($epflag){ $text .= $textemailprint; }
-					$cachestr = "review.item.$sub_action";
-					$comflag = TRUE;
-				}
-				$text .= "<br /><br />
-				".LAN_42.": 
-				<table style='width:".($content_review_score*2)."px'>
-				<tr class='border'>
-				<td class='caption' style='width:100%; text-align:right'>$content_review_score%</td>
-				</tr>
-				</table>\n";
-			}
-			$text .= "<div style='text-align:right'><a href='".e_SELF."?review.cat.$content_id_'>>> ".LAN_27."</a><br />
-			<a href='".e_SELF."?review'><< ".LAN_28."</a></div>";
-			$ns -> tablerender($caption, $text);
-			if($pref['cachestatus']){
-				$cache = $aj -> formtpa(ob_get_contents(), "admin");
-				set_cache("review.item.$sub_action", $cache);
-			}
-		}
-
-		if($sql -> db_Select("content", "*", "content_id=$sub_action")){	
-			$row = $sql -> db_Fetch(); extract($row);
-		}
-
-		if($content_comment){
-			if($cache = retrieve_cache("comment.content.$sub_action")){
-				echo $aj -> formtparev($cache);
-			}else{
-				ob_start();
-				unset($text);
-			if($comment_total = $sql -> db_Select("comments", "*",  "comment_item_id='$sub_action' AND comment_type='1' AND comment_pid='0' ORDER BY comment_datestamp")){
-					$width = 0;
-					while($row = $sql -> db_Fetch()){
-					if($pref['nested_comments']){
-						$text = $cobj -> render_comment($row, "content" , "comment", $sub_action, $width, $content_heading);		
-						$ns -> tablerender(LAN_5, $text);	
-						}else{
-							$text .= $cobj -> render_comment($row, "content" , "comment", $sub_action, $width, $content_heading);	
-						}
-				}
-				 if(!$pref['nested_comments']){$ns -> tablerender(LAN_5, $text);	}
-					if($pref['cachestatus']){
-						$cache = $aj -> formtpa(ob_get_contents(), "admin");
-						set_cache("comment.content.$sub_action", $cache);
-					}
-				}
-			}
-			if(ADMIN && getperms("B")){
-				echo "<div style='text-align:right'><a href='".e_ADMIN."modcomment.php?content.$sub_action'>".LAN_29."</a></div><br />";
-			}
-		$cobj -> form_comment("comment", "content", $sub_action, $content_heading);
-		}
-		require_once(FOOTERF);
-		exit;
-	}
-
-	if($sub_action == "cat"){
-
-		if($id){
-			$query = "content_parent=$id AND content_type=3 ORDER BY content_datestamp DESC LIMIT 0,10";
-		}else{
-			$query = "content_parent=0 AND content_type=3 ORDER BY content_datestamp DESC LIMIT 0,10";
-		}
-
-		if($cache = retrieve_cache("review.cat.$id")){
-			echo $aj -> formtparev($cache);
-		}else{
-			ob_start();
-			if($sql -> db_Select("content", "*", "content_id=$id") || !$id){
-				$row = $sql -> db_Fetch(); extract($row);
-				$category = $content_heading;
-				if($sql -> db_Select("content", "*", $query)){
-					$text = "<br />";
-					$icon = $content_summary;
-					$cat_id = $content_id;
-					$sql2 = new db;
-					$gen = new convert; 
-					$text .= "<table style='width:95%'>\n";
-					while($row = $sql -> db_Fetch()){
-						extract($row);
-						if(check_class($content_class)){
-							if(is_numeric($content_author)){
-								$sql2 -> db_Select("user", "*", "user_id=$content_author");
-								$row = $sql2 -> db_Fetch(); extract($row);
-							}else{
-								$tmp = explode("^", $content_author);
-								$user_name = $tmp[0];
-								$user_email = $tmp[1];
-							}
-							$datestamp = ereg_replace(" -.*", "", $gen->convert_date($content_datestamp, "long"));
-							$text .= "<tr><td style='width:5%; text-align:center; vertical-align:top'>".($icon ? "<img src='".e_IMAGE."link_icons/".$icon."' alt='' />" : "&nbsp;")."</td>
-							<td style='width:95%'>
-							<b><span class='mediumtext'><a href='".e_SELF."?review.$content_id'>$content_heading</a></span></b>
-							<br />
-							<span class='smalltext'>".LAN_43."$user_name".LAN_44."$datestamp</span>
-							<br />
-							$content_summary
-							<br />
-							<table style='width:".($content_review_score*2)."px'>
-							<tr  class='border'>
-							<td class='caption' style='width:100%; text-align:right'>$content_review_score%</td>
-							</tr>
-							</table>\n<br />\n</td></tr>\n";
-						}
-					}
-				}else{
-					$text .= "<table><tr><td>".LAN_45."</td></tr>";
-				}
-				$text .= "</table><div style='text-align:right'><a href='".e_SELF."?review'><< ".LAN_30."</a></div>";
-				$ns -> tablerender(LAN_32.": ".$category, $text);
-
-				if($pref['cachestatus']){
-					$cache = $aj -> formtpa(ob_get_contents(), "admin");
-					 set_cache("review.cat.$id", $cache);
-				}
-
-
-
-				unset($text);
-				if($sql -> db_Select("content", "content_id, content_heading, content_datestamp ", "content_parent=$id AND content_type=3 ORDER BY content_datestamp DESC LIMIT 10,200")){
-					while($row = $sql -> db_Fetch()){
-						extract($row);
-						if(!is_object($gen)){ $gen = new convert; }
-						$datestamp = ereg_replace(" -.*", "", $gen->convert_date($content_datestamp, "long"));
-						$text .= "<img src='".e_IMAGE."generic/hme.png' alt='' style='vertical-align:middle' /> <a href='".e_SELF."?review.$content_id'>$content_heading</a> ($datestamp)<br />";
-					}
-					$ns -> tablerender(LAN_46.": ".$category, $text);
-				}
-
-
-
-			}
-		}
-
-		unset($text);
-		if($sql -> db_Select("content", "content_id, content_heading, content_datestamp ", "content_subheading REGEXP('^-$id-') AND content_type=3 ORDER BY content_datestamp DESC LIMIT 10,200")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				$datestamp = ereg_replace(" -.*", "", $gen->convert_date($content_datestamp, "long"));
-				$text .= "<img src='".e_IMAGE."generic/hme.png' alt='' style='vertical-align:middle' /> <a href='".e_SELF."?review.$content_id'>$content_heading</a> ($datestamp)<br />";
-			}
-			$ns -> tablerender(LAN_62.": ".$category, $text);
-		}
-		require_once(FOOTERF);
-		exit;
-	}
-
-
-
-	if($cache = retrieve_cache("review.main")){
-		echo $aj -> formtparev($cache);
-	}else{
-		ob_start();
-		if($sql -> db_Select("content", "*", "content_type=3 ORDER BY content_datestamp DESC LIMIT 0,10")){
-			$text = "<br />";
-			$sql2 = new db;
-			$gen = new convert; 
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				if(check_class($content_class)){
-					$summary = $content_summary;
-					$rev_id = $content_id;
-					$category = $content_parent;
-
-					if(is_numeric($content_author)){
-						$sql2 -> db_Select("user", "*", "user_id=$content_author");
-						$row = $sql2 -> db_Fetch(); extract($row);
-					}else{
-						$tmp = explode("^", $content_author);
-						$user_name = $tmp[0];
-						$user_email = $tmp[1];
-					}
-
-					$sql2 -> db_Select("content", "content_id, content_summary", "content_id=$category");
-					$row = $sql2 -> db_Fetch(); extract($row);
-					$datestamp = ereg_replace(" -.*", "", $gen->convert_date($content_datestamp, "long"));
-
-					$text .= (file_exists(e_IMAGE."link_icons/$content_summary") ? "<a href='".e_SELF."?review.cat.$content_id'><img src='".e_IMAGE."link_icons/".$content_summary."' alt='' style='float:left; border:0' /></a>" : "&nbsp;")."
-					<b><span class='mediumtext'><a href='".e_SELF."?review.$rev_id'>$content_heading</a></span></b>
-					<br />
-					<span class='smalltext'>".LAN_43."<b>$user_name</b>".LAN_44."$datestamp</span>
-					<br />
-					$summary
-					<br />
-					<table style='width:".($content_review_score*2)."px'>
-					<tr  class='border'>
-					<td class='caption' style='width:100%; text-align:right'>$content_review_score%</td>
-					</tr>
-					</table>\n<br />\n";
-				}
-			}
-		}else{
-			$ns -> tablerender(LAN_32, LAN_55);
-			require_once(FOOTERF);
-			exit;
-		}
-		$ns -> tablerender(LAN_32, $text);
-
-		if($sql -> db_Select("content", "*", "content_type=10")){
-			$text = "<div style='text-align:center'>
-			<table class='fborder' style='width:95%'>\n";
-
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				$total = $sql2 -> db_Select("content", "content_class", "content_parent=$content_id AND content_type=3");
-				if($total){
-					while($row2 = $sql2 -> db_Fetch()){
-						extract($row2);
-						if(!check_class($content_class)){
-							$total = $total - 1;
-						}
-					}
-				}
-				$text .= "<tr>
-				<td class='forumheader3' style='width:10%; text-align:center' rowspan='2'>
-				".($content_summary ? "<a href='".e_SELF."?review.cat.$content_id'><img src='".e_IMAGE."link_icons/".$content_summary."' alt='' style='vertical-align:middle; border:0' /></a>" : "&nbsp;")."
-				</td>
-				<td class='forumheader' style='width:90%'><b><a href='".e_SELF."?review.cat.$content_id'>$content_heading</a></b></td>
-				</tr>
-				<tr>
-				<td class='forumheader3'>$content_subheading  <span class='smalltext'>( $total ".($total==1 ? LAN_34 : LAN_33)." )</span></td>
-				</tr>\n";
-			}
-			$total = $sql2 -> db_Select("content", "*", "content_type=3 AND content_parent=0");
-				if($total){
-					while($row2 = $sql2 -> db_Fetch()){
-						extract($row2);
-						if(!check_class($content_class)){
-							$total = $total - 1;
-						}
-					}
-				}
-				$text .= "<tr>
-				<td class='forumheader3' style='width:10%; text-align:center' rowspan='2'>
-				&nbsp;
-				</td>
-				<td class='forumheader' style='width:90%'><b><a href='".e_SELF."?review.cat.0'>".LAN_61."</a></b></td>
-				</tr>
-				<tr>
-				<td class='forumheader3'><span class='smalltext'>( $total ".($total == 1 ? LAN_34 : LAN_33)." )</span></td>
-				</tr>\n";
-			$text .= "</table>\n</div>\n";
-			$ns -> tablerender(LAN_35, $text);
-
-			if($pref['cachestatus']){
-				$cache = $aj -> formtpa(ob_get_contents(), "admin");
-				 set_cache("review.main", $cache);
-			}
-		}
-	}
-}
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-// ##### Article List -----------------------------------------------------------------------------------------------------------------------------------------------------------
-if($action == "article"){
-	unset($text);
-	if(is_numeric($sub_action)){
-		$cachestr = ($id ? "article.item.$sub_action.$id" : "article.item.$sub_action");
-		if($cache = retrieve_cache($cachestr)){
-			echo $aj -> formtparev($cache);
-		}else{
-			ob_start();
-			if(!$CONTENT_ARTICLE_TABLE){
-				if(file_exists(THEME."content_template.php")){
-          require_once(THEME."content_template.php");
-        }
-  			else{
-          require_once(e_BASE.$THEMES_DIRECTORY."templates/content_template.php");
-        }
-			}
-			if($sql -> db_Select("content", "*", "content_id=$sub_action")){	
-				$row = $sql -> db_Fetch(); extract($row);
-				
-				if(!check_class($content_class)){
-					$ns -> tablerender(LAN_52, "<div style='text-align:center'>".LAN_51."</div>");
-					require_once(FOOTERF);
-					exit;
-				}
-				$caption = $content_heading;
-			}
-
-			$content_article_table_string .= parse_content_article_table($row);
-			$content_article_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ARTICLE_TABLE_START);
-			$content_article_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ARTICLE_TABLE_END);
-			$text .= $content_article_table_start."".$content_article_table_string."".$content_article_table_end;
-			
-			$ns -> tablerender($caption, $text);
-
-			if($pref['cachestatus']){
-				$cache = $aj -> formtpa(ob_get_contents(), "admin");
-				set_cache($cachestr, $cache);
-			}
-		}
-
-		if($sql -> db_Select("content", "*", "content_id=$sub_action")){	
-			$row = $sql -> db_Fetch(); extract($row);
-		}
-		
-		$totalpages = substr_count($content_content, "[newpage]");
-		$comflag = ($totalpages == $id ? TRUE : FALSE);
-
-		// article content rating table
-		$content_article_rating_table_string .= parse_content_article_rating_table($row);
-		$content_article_rating_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ARTICLE_RATING_TABLE_START);
-		$content_article_rating_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ARTICLE_RATING_TABLE_END);
-		unset($text);
-		$text .= $content_article_rating_table_start."".$content_article_rating_table_string."".$content_article_rating_table_end;
-		$ns -> tablerender(LAN_42, $text);
-	
-		if($content_comment && $comflag){
-			if($cache = retrieve_cache("comment.content.$sub_action")){
-				echo $aj -> formtparev($cache);
-			}else{
-				ob_start();
-				unset($text);
-				if($comment_total = $sql -> db_Select("comments", "*",  "comment_item_id='$sub_action' AND comment_type='1' AND comment_pid='0' ORDER BY comment_datestamp")){
-					$width = 0;
-					while($row = $sql -> db_Fetch()){
-					if($pref['nested_comments']){
-						$text = $cobj -> render_comment($row, "content" , "comment", $sub_action, $width, $content_heading);		
-						$ns -> tablerender(LAN_5, $text);	
-						}else{
-							$text .= $cobj -> render_comment($row, "content" , "comment", $sub_action, $width, $content_heading);	
-						}
-				}
-				 if(!$pref['nested_comments']){$ns -> tablerender(LAN_5, $text);	}
-						if($pref['cachestatus']){
-						$cache = $aj -> formtpa(ob_get_contents(), "admin");
-						set_cache("comment.content.$sub_action", $cache);
-							}
-						}
-					}
-			if(ADMIN && getperms("B")){
-				echo "<div style='text-align:right'><a href='".e_ADMIN."modcomment.php?content.$sub_action'>".LAN_29."</a></div><br />";
-			}
-		$cobj -> form_comment("comment", "content", $sub_action, $content_heading);
-		}
-
-		require_once(FOOTERF);
-		exit;
-	}
-
-	if($sub_action == "cat"){
-
-		if($id){
-			$query = "content_parent=$id AND content_type=0 ORDER BY content_datestamp DESC LIMIT 0,10";
-		}else{
-			$query = "content_parent=0 AND content_type=0 ORDER BY content_datestamp DESC LIMIT 0,10";
-		}
-
-		// ##### category -------------------------------------------------------------------------
-		if($cache = retrieve_cache("article.cat.$id")){
-			echo $aj -> formtparev($cache);
-		}else{
-			ob_start();
-			if(!$CONTENT_RECENT_TABLE){
-				if(file_exists(THEME."content_template.php")){
-          require_once(THEME."content_template.php");
-        }
-  			else{
-          require_once(e_BASE.$THEMES_DIRECTORY."templates/content_template.php");
-        }
-			}
-			$sql = new db; $sql2 = new db;
-			if($sql -> db_Select("content", "*", "content_id=$id") || !$id){
-				$row = $sql -> db_Fetch(); extract($row);
-				$caption = LAN_47.": ".$content_heading;
-
-				if($sql -> db_Select("content", "*", $query)){
-					$sql2 = new db;
-					$gen = new convert;
-
-					$summary = $content_summary;
-					$rev_id = $content_id;
-					$category = $content_parent;
-					
-					while($row = $sql -> db_Fetch()){
-						extract($row);
-						if(check_class($content_class)){
-							$content_recent_table_string .= parse_content_recent_table($row);
-						}
-					}
-					$content_recent_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_RECENT_TABLE_START);
-					$content_recent_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_RECENT_TABLE_END);
-
-					$text .= $content_recent_table_start."".$content_recent_table_string."".$content_recent_table_end;
-
-				}else{
-					$text .= "<tr><td>".LAN_45."</td></tr>";
-				}
-				$ns -> tablerender($caption, $text);
-				if($pref['cachestatus']){
-					$cache = $aj -> formtpa(ob_get_contents(), "admin");
-					 set_cache("article.cat.$id", $cache);
-				}
-			}
-		}
-		// ##### ----------------------------------------------------------------------------------
-
-		// ##### archive --------------------------------------------------------------------------
-		unset($text);
-		if(!$CONTENT_ARCHIVE_TABLE){
-			if(file_exists(THEME."content_template.php")){
-        require_once(THEME."content_template.php");
-      }
-			else{
-        require_once(e_BASE.$THEMES_DIRECTORY."templates/content_template.php");
-      }
-		}
-		if($sql -> db_Select("content", "content_id, content_heading, content_datestamp ", "content_parent=$id AND content_type=0 ORDER BY content_datestamp DESC LIMIT 10,200")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				if(!is_object($gen)){ $gen = new convert; }
-				if(check_class($content_class)){
-					$content_archive_table_string .= parse_content_archive_table($row);
-				}
-			}
-			$sql2 = new db;
-			$sql2 -> db_Select("content", "content_heading", "content_id=$id");
-			while(list($content_heading) = $sql2 -> db_Fetch()){
-				$category = $content_heading;
-			}
-			$content_archive_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ARCHIVE_TABLE_START);
-			$content_archive_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ARCHIVE_TABLE_END);
-
-			$text .= $content_archive_table_start."".$content_archive_table_string."".$content_archive_table_end;
-			$ns -> tablerender(LAN_46.": ".$category, $text);
-		}
-		// ##### ----------------------------------------------------------------------------------
-		require_once(FOOTERF);
-		exit;
-	}
-
-	if($cache = retrieve_cache("article.main")){
-		echo $aj -> formtparev($cache);
-	}else{
-		ob_start();
-
-		// ##### recent articles ------------------------------------------------------------------
-		if(!$CONTENT_RECENT_TABLE){
-			if(file_exists(THEME."content_template.php")){
-        require_once(THEME."content_template.php");
-      }
-			else{
-        require_once(e_BASE.$THEMES_DIRECTORY."templates/content_template.php");
-      }
-		}
-		$sql = new db; $sql2 = new db;
-		if($sql -> db_Select("content", "*", "content_type=0 ORDER BY content_datestamp DESC LIMIT 0,10")){
-			$gen = new convert;
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				if(check_class($content_class)){
-					$content_recent_table_string .= parse_content_recent_table($row);
-				}
-			}
-			$content_recent_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_RECENT_TABLE_START);
-			$content_recent_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_RECENT_TABLE_END);
-
-			$text .= $content_recent_table_start."".$content_recent_table_string."".$content_recent_table_end;
-		}else{
-			$text .= "<tr><td>".LAN_45."</td></tr>";
-		}
-		// ##### ----------------------------------------------------------------------------------
-		$ns -> tablerender(LAN_47, $text);
-
-		// ##### category table -------------------------------------------------------------------
-		if(!$CONTENT_CATEGORY_TABLE){
-			if(file_exists(THEME."content_template.php")){
-        require_once(THEME."content_template.php");
-      }
-			else{
-        require_once(e_BASE.$THEMES_DIRECTORY."templates/content_template.php");
-      }
-		}
-
-		if($sql -> db_Select("content", "*", "content_type=6")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				$total = $sql2 -> db_Select("content", "content_class", "content_parent=$content_id AND content_type=0");
-				if($total){
-					while($row2 = $sql2 -> db_Fetch()){
-						extract($row2);
-						if(!check_class($content_class)){
-							$total = $total - 1;
-						}
-					}
-					$content_category_table_string .= parse_content_category_table($row, $total);
-				}
-			}
-
-			// uncategorized
-			$untotal = $sql2 -> db_Select("content", "*", "content_type=0 AND content_parent=0");
-			if($untotal){
-				while($row2 = $sql2 -> db_Fetch()){
-					extract($row2);
-					if(!check_class($content_class)){
-						$untotal = $untotal - 1;
-					}
-				}
-				$content_category_table_string .= parse_content_category_table($row, $untotal);
-			}
-
-			$content_category_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CATEGORY_TABLE_START);
-			$content_category_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CATEGORY_TABLE_END);
-
-			$text2 .= $content_category_table_start."".$content_category_table_string."".$content_category_table_end;
-			// ##### ----------------------------------------------------------------------------------
-			$ns -> tablerender(LAN_50, $text2);
-
-			if($pref['cachestatus']){
-				$cache = $aj -> formtpa(ob_get_contents(), "admin");
-				 set_cache("article.main", $cache);
-			}
-		}
-	}
-}
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-function parse_content_article_table($row){
-		global $CONTENT_ARTICLE_TABLE, $rater, $aj, $ep, $id;
-		extract($row);
-
-		$search = array("{e_BASE}", "{e_ADMIN}", "{e_IMAGE}", "{e_THEME}", "{e_PLUGIN}", "{e_FILE}", "{e_HANDLER}", "{e_LANGUAGEDIR}", "{e_DOCS}", "{e_DOCROOT}");
-		$replace = array(e_BASE, e_ADMIN, e_IMAGE, e_THEME, e_PLUGIN, e_FILE, e_HANDLER, e_LANGUAGEDIR, e_DOCS, e_DOCROOT);
-		$content_content = str_replace($search, $replace, $content_content);
-
-		$category = $content_parent;
- 		$sub_action = $content_id;
-
-		$sql = new db; $sql2 = new db;
-		$gen = new convert;
-
-		$textemailprint = $ep -> render_emailprint("content",$sub_action);
-		$category = $content_parent;
-
-		if(is_numeric($content_author)){
-			$sql2 -> db_Select("user", "*", "user_id=$content_author");
-			$row = $sql2 -> db_Fetch(); extract($row);
-		}else{
-			$tmp = explode("^", $content_author);
-			$user_name = $tmp[0];
-			$user_email = $tmp[1];
-		}
-		$CONTENT_ARTICLE_AUTHOR = ($user_name != "" ? "<a href='mailto:$user_email'>$user_name</a>" : "");
-			$datestamp = ereg_replace(" -.*", "", $gen->convert_date($content_datestamp, "long"));
-		$CONTENT_ARTICLE_DATESTAMP = ($datestamp != "" ? $datestamp : "");
-
-		$sql2 -> db_Select("content", "content_id, content_summary", "content_id=$category");
-		list($content_id_, $content_summary_) = $sql2-> db_Fetch();
-
-		$CONTENT_ARTICLE_CAT_ICON = ($content_summary_ ? "<a href='".e_SELF."?article.cat.$content_id_'><img src='".e_IMAGE."link_icons/".$content_summary_."' alt='' style='float:left; border:0' /></a>" : "");
-
-		$CONTENT_ARTICLE_SUBHEADING = ($content_subheading != "" ? $content_subheading : "");
-		$CONTENT_ARTICLE_SUMMARY = ($content_summary != "" ? $content_summary : "");
-		$CONTENT_ARTICLE_HEADING = $content_heading;
-
-		$content_content = $aj -> tpa($content_content, "off", "admin", $highlight_search);
-		$articlepages = explode("[newpage]",$content_content);
-		$totalpages = count($articlepages);
-		if(strstr($content_content, "{EMAILPRINT}") || $content_pe_icon){
-			$content_content = str_replace("{EMAILPRINT}", $textemailprint, $content_content);
-			$epflag = TRUE;
-		}
-
-		$CONTENT_ARTICLE_PAGES = "";
-		if($totalpages > 1){
-			$CONTENT_ARTICLE_PAGES .=  $articlepages[(!$id ? 0 : $id)]."<br /><br />";
- 			if($id != 0){ $CONTENT_ARTICLE_PAGES .= "<a href='content.php?article.$sub_action.".($id-1)."'>".LAN_25." &lt;&lt;</a> "; }
-			for($c=1; $c<= $totalpages; $c++){
-				$CONTENT_ARTICLE_PAGES .= ($c == ($id+1) ? "<span style='text-decoration: underline;'>$c</span>&nbsp;&nbsp;" : "<a href='content.php?article.$sub_action.".($c-1)."'>$c</a>&nbsp;&nbsp;");
-			}
- 			if(($id+1) != $totalpages){ $CONTENT_ARTICLE_PAGES .= "<a href='content.php?article.$sub_action.".($id+1)."'>&gt;&gt; ".LAN_26."</a> "; }
-			if($epflag){
-				$CONTENT_ARTICLE_EMAILPRINT = $textemailprint;
-			}
-			$CONTENT_ARTICLE_HEADING .= ", ".LAN_63." ".($id+1);
-			$cachestr = ($id ? "article.item.$sub_action.$id" : "article.item.$sub_action");
-
-		}else{
-			$CONTENT_ARTICLE_CONTENT = $content_content;
-			if($epflag){
-				$CONTENT_ARTICLE_EMAILPRINT = $textemailprint;
-			}
-			$cachestr = "article.item.$sub_action";
-			$comflag = TRUE;
-		}
-
-		$CONTENT_ARTICLE_LINK_CAT = "<a href='".e_SELF."?article.cat.$content_id_'>>> ".LAN_36."</a>";
-		$CONTENT_ARTICLE_LINK_MAIN = "<a href='".e_SELF."?article'><< ".LAN_37."</a>";
-
-					
-		return(preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ARTICLE_TABLE));
-}
-
-
-function parse_content_article_rating_table($row){
-		global $CONTENT_ARTICLE_RATING_TABLE, $rater, $comflag, $sub_action;
-		extract($row);
-
-			if($comflag){
-				unset($text);
-				if($ratearray = $rater -> getrating("article", $sub_action)){
-					$CONTENT_ARTICLE_RATING .= LAN_64;
-					for($c=1; $c<= $ratearray[1]; $c++){
-						$CONTENT_ARTICLE_RATING .= "<img src='".e_IMAGE."rate/box.png' alt='' style='vertical-align:middle' />";
-					}
-
-					if($ratearray[1] < 10){
-						for($c=9; $c>=$ratearray[1]; $c--){
-							$CONTENT_ARTICLE_RATING .= "<img src='".e_IMAGE."rate/empty.png' alt='' style='vertical-align:middle' />";
-						}
-					}
-					$CONTENT_ARTICLE_RATING .= "<img src='".e_IMAGE."rate/boxend.png' alt='' style='vertical-align:middle' />";
-
-					if($ratearray[2] == ""){ $ratearray[2] = 0; }
-					$CONTENT_ARTICLE_RATING .= "&nbsp;".$ratearray[1].".".$ratearray[2]." - ".$ratearray[0]."&nbsp;";
-					$CONTENT_ARTICLE_RATING .= ($ratearray[0] == 1 ? LAN_38 : LAN_39);
-				}else{
-					$CONTENT_ARTICLE_RATING .= LAN_65;
-				}
-
-				if(!$rater -> checkrated("article", $sub_action) && USER){
-					$CONTENT_ARTICLE_RATING .= "<br />\n<div class='smalltext' style='text-align:right'>".
-					$rater -> rateselect("&nbsp;&nbsp;&nbsp;&nbsp; ".LAN_40, "article", $sub_action)."</div>";
-				}else if(USER){
-					$CONTENT_ARTICLE_RATING .= " - ".LAN_41;
-				}
-			}
-
-		return(preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ARTICLE_RATING_TABLE));
-}
-
-
-function parse_content_recent_table($row){
-		global $CONTENT_RECENT_TABLE, $rater, $aj;
-		extract($row);
-
-		$summary = $content_summary;
-		$rev_id = $content_id;
-		$category = $content_parent;
-
-		$sql = new db; $sql2 = new db;
-		$gen = new convert;
-
-		$sql2 -> db_Select("content", "content_id, content_summary", "content_id=$category");
-		$row = $sql2 -> db_Fetch(); extract($row);
-
-		// author
-		if(is_numeric($content_author)){
-			$sql2 -> db_Select("user", "*", "user_id=$content_author");
-			$row = $sql2 -> db_Fetch(); extract($row);
-		}else{
-			$tmp = explode("^", $content_author);
-			$user_name = $tmp[0];
-			$user_email = $tmp[1];
-		}
-
-		$cat_icon = $content_summary;
-	
-		$CONTENT_RECENT_SUBHEADING = ($content_subheading != "" ? $content_subheading."<br />" : "");
-		$CONTENT_RECENT_SUMMARY = ($summary != "" ? $summary."<br />" : "");
-		$CONTENT_RECENT_AUTHOR = ($user_name != "" ? $user_name : "");
-		$datestamp = ereg_replace(" -.*", "", $gen->convert_date($content_datestamp, "long"));
-		$CONTENT_RECENT_DATE = ($datestamp != "" ? $datestamp : "");
-		$CONTENT_RECENT_ICON = ($cat_icon && $content_parent ? "<a href='".e_SELF."?article.cat.$content_id'><img src='".e_IMAGE."link_icons/".$cat_icon."' alt='' style='border:0' /></a>" : "&nbsp;");
-		
-		$CONTENT_RECENT_HEADING = "<a href='".e_BASE."content.php?article.$rev_id'>".$content_heading."</a>";
-
-		// ------------ BEGIN RATING SYSTEM ------------------------------------------
-		$CONTENT_RECENT_RATING .= "<span class='smalltext' style='width:280px; text-align:left;'>";
-
-		if($ratearray = $rater -> getrating("article", $rev_id)){
-			for($c=1; $c<= $ratearray[1]; $c++){
-				$CONTENT_RECENT_RATING .= "<img src='".e_IMAGE."rate/box.png' alt='' style='vertical-align:middle' />";
-			}
-
-			if($ratearray[1] < 10){
-				for($c=9; $c>=$ratearray[1]; $c--){
-					$CONTENT_RECENT_RATING .= "<img src='".e_IMAGE."rate/empty.png' alt='' style='vertical-align:middle' />";
-				}
-			}
-			$CONTENT_RECENT_RATING .= "<img src='".e_IMAGE."rate/boxend.png' alt='' style='vertical-align:middle' />";
-
-			if($ratearray[2] == ""){ $ratearray[2] = 0; }
-			$CONTENT_RECENT_RATING .= "&nbsp;".$ratearray[1].".".$ratearray[2]." - ".$ratearray[0]."&nbsp;";
-			$CONTENT_RECENT_RATING .= ($ratearray[0] == 1 ? LAN_38 : LAN_39);
-		}else{
-			$CONTENT_RECENT_RATING .= "".LAN_65."";
-		}
-
-		if(!$rater -> checkrated("article", $rev_id) && USER){
-			$CONTENT_RECENT_RATING .= "</span><span class='smalltext' style='width:240px; text-align:right;'>".
-			$rater -> rateselect("&nbsp;&nbsp;&nbsp;&nbsp; ".LAN_40, "article", $rev_id)."";
-		}else if(USER){
-			$CONTENT_RECENT_RATING .= " - ".LAN_41;
-		}
-		
-		$CONTENT_RECENT_RATING .= "</span><br />";
-		// ---------------------------------------------------------------------------
-					
-		return(preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_RECENT_TABLE));
-}
-
-
-
-
-function parse_content_category_table($row, $total){
-		global $CONTENT_CATEGORY_TABLE;
-		extract($row);
-
-		if($content_type==0 && $content_parent==0){
-			$CONTENT_CATEGORY_HEADING = "<a href='".e_SELF."?article.cat.0'>".LAN_61."</a>";
-		}else{
-			$CONTENT_CATEGORY_HEADING = "<a href='".e_SELF."?article.cat.$content_id'>".$content_heading."</a>";
-		}
-		$CONTENT_CATEGORY_ICON = ($content_summary ? "<a href='".e_SELF."?article.cat.$content_id'><img src='".e_IMAGE."link_icons/".$content_summary."' alt='' style='vertical-align:middle; border:0' /></a>" : "&nbsp;");
-		$CONTENT_CATEGORY_SUBHEADING = $content_subheading;
-		$CONTENT_CATEGORY_NUMBER = "".$total." ".($total==1 ? LAN_49 : LAN_48)."";
-
-		return(preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CATEGORY_TABLE));
-}
-
-function parse_content_archive_table($row){
-		global $gen, $CONTENT_ARCHIVE_TABLE;
-		extract($row);
-
-		$CONTENT_ARCHIVE_DATESTAMP = ereg_replace(" -.*", "", $gen->convert_date($content_datestamp, "long"));
-		$CONTENT_ARCHIVE_ICON = "<img src='".e_IMAGE."generic/hme.png' alt='' style='vertical-align:middle' />";
-		$CONTENT_ARCHIVE_HEADING = "<a href='".e_SELF."?article.$content_id'>$content_heading</a>";
-
-		return(preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_ARCHIVE_TABLE));
-}
-
-
-require_once(FOOTERF);
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/content.php,v $
+|     $Revision: 1.19 $
+|     $Date: 2005/12/24 22:53:38 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+require_once("class2.php");
+
+//##### REDIRECTION MANAGEMENT -----------------------------------------------------------------------------
+if($content_install = $sql -> db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){
+	//require_once($plugindir."handlers/content_class.php");
+	//$aa = new content;
+	
+	$tmp = explode(".", e_QUERY);
+	if($tmp[0]){
+		//get type_id from the row with heading content, article or review
+		//this will only work if the three main parents are not renamed !
+		if(!$sql -> db_Select("pcontent", "content_id", "content_heading='".$tp -> toDB($tmp[0])."'")){
+			header("location:".e_PLUGIN."content/content.php");
+		}else{
+			$row = $sql -> db_Fetch();
+		}
+	}
+	if ($tmp[0] == "content") {
+		if (is_numeric($tmp[1])) {						//content view
+			
+			$tmp[1] = intval($tmp[1]);
+			header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]);
+
+		}else{											//content recent page
+			header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']);
+		}
+
+	}elseif ($tmp[0] == "article" || $tmp[0] == "review") {
+
+		if (is_numeric($tmp[1])) {						//item view
+			$tmp[1] = intval($tmp[1]);
+			header("location:".e_PLUGIN."content/content.php?content.".$tmp[1]);
+		
+		}elseif($tmp[1] == "cat" ) {					//category page
+			
+			if(!$tmp[2] || $tmp[2] == "0") {			//all categories
+				//$mainparent = $aa -> getMainParent($tmp[2]);
+				//header("location:".e_PLUGIN."content/content.php?cat.list.".$mainparent."");
+				header("location:".e_PLUGIN."content/content.php");
+			
+			}else{										//view category
+				header("location:".e_PLUGIN."content/content.php?cat.".$tmp[2]);
+			}
+		
+		} else {										//recent page
+			header("location:".e_PLUGIN."content/content.php?recent.".$row['content_id']);
+		}
+	}else{												//redirect to new content main page
+		header("location:".e_PLUGIN."content/content.php");
+	}
+}
+//##### END REDIRECTION MANAGEMENT -------------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/download.php 75/download.php
--- 6171/download.php	2004-09-01 21:42:24.000000000 -0500
+++ 75/download.php	2006-05-14 19:30:31.000000000 -0500
@@ -1,439 +1,797 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /e107.php
-|
-|        Steve Dunstan 2001-2002
-|        http://jalist.com
-|        stevedunstan@jalist.com
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-require_once(e_HANDLER."comment_class.php");
-unset($text);
-$agreetext = $pref['agree_text'];
-$cobj = new comment;
-
-if(!e_QUERY){
-	require_once(HEADERF);
-	// no qs - render categories ...
-
-	if(!$DOWNLOAD_CAT_PARENT_TABLE){
-		if(file_exists(THEME."download_template.php")){
-      require_once(THEME."download_template.php");
-    }
-		else{
-      require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
-    }
-	}
-
-	$sql = new db; $sql2 = new db;
-	if(!$sql -> db_Select("download_category", "*", "download_category_parent='0' ")){
-			$ns -> tablerender(LAN_dl_18, "<div style='text-align:center'>".LAN_dl_2."</div>");
-			require_once(FOOTERF);
-			exit;
-	}else{
-		while($row = $sql -> db_Fetch()){
-		extract($row);
-
-			$download_cat_table_string .= parse_download_cat_parent_table($row);
-			
-			if(!$categories = $sql2 -> db_Select("download_category", "*", "download_category_parent='".$download_category_id."' ")){
-					$text .= "<div class='forumheader3' style='text-align:center'>".LAN_dl_3."</div>";
-			}else{
-				while($row = $sql2 -> db_Fetch()){
-				extract($row);
-					$download_cat_table_string .= parse_download_cat_child_table($row);
-				}
-			}
-		
-		}
-	}
-
-	$download_cat_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_START);
-
-	$DOWNLOAD_CAT_NEWDOWNLOAD_TEXT = "<img src='".e_IMAGE."generic/new.png' alt='' style='vertical-align:middle' /> ".LAN_dl_36;
-	$DOWNLOAD_CAT_SEARCH = "
-	<form method='post' action='".e_BASE."search.php'>
-	<p>
-	<input class='tbox' type='text' name='searchquery' size='30' value='' maxlength='50' />
-	<input class='button' type='submit' name='searchsubmit' value='".LAN_dl_41."' />
-	<input type='hidden' name='searchtype' value='9' />
-	</p>
-	</form>";
-
-	$download_cat_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_END);
-	$text .= $download_cat_table_start.$download_cat_table_string.$download_cat_table_end;
-
-	$ns -> tablerender(LAN_dl_18.$type, $text);
-	require_once(FOOTERF);
-	exit;
-}
-
-
-$tmp = explode(".", e_QUERY);
-if(is_numeric($tmp[0])){
-        $from = intval($tmp[0]);
-        $action = preg_replace("#\W#","",$tmp[1]);
-        $id = intval($tmp[2]);
-        $view = intval($tmp[3]);
-        $order = intval($tmp[4]);
-        $sort = preg_replace("#\W#","",$tmp[5]);
-}else{
-        $action = preg_replace("#\W#","",$tmp[0]);
-        $id = intval($tmp[1]);
-}
-
-if(IsSet($_POST['commentsubmit'])){
-        if(!$sql -> db_Select("download", "download_comment", "download_id='$id' ")){
-                header("location:".e_BASE."index.php");
-                exit;
-        }else{
-                $row = $sql -> db_Fetch();
-                if($row[0] && (ANON===TRUE || USER===TRUE)){
-                        $cobj -> enter_comment($_POST['author_name'], $_POST['comment'], "download", $id, $pid, $_POST['subject']);
-                        clear_cache("comment.download.{$sub_action}");
-                }
-        }
-}
-
-if($action == "list"){
-
-        if(IsSet($_POST['view'])){
-                extract($_POST);
-        }
-
-        if(!$from) {$from=0;}
-        if(!$order) {$order = ($pref['download_order'] ? $pref['download_order'] : "download_datestamp");}
-        if(!$sort) {$sort = ($pref['download_sort'] ? $pref['download_sort'] : "DESC");}
-        if(!$view) {$view = ($pref['download_view'] ? $pref['download_view'] : "10");}
-
-        $total_downloads = $sql -> db_Select("download", "*", "download_category='".$id."' AND download_active='1'");
-        if(!$total_downloads){ require_once(HEADERF);require_once(FOOTERF); exit; }
-
-		$sql = new db;
-        $sql -> db_Select("download_category", "*", "download_category_id='".$id."'");
-        $row = $sql -> db_Fetch(); extract($row);
-        $core_total = $sql -> db_Count("download WHERE download_category='".$id."' AND download_active=1");
-        $type = $download_category_name." [ ".$download_category_description." ]";
-        define("e_PAGETITLE", PAGE_NAME." / ".$download_category_name);
-
-        require_once(HEADERF);
-
-		if(!$DOWNLOAD_LIST_TABLE){
-		  if(file_exists(THEME."download_template.php")){
-        require_once(THEME."download_template.php");
-      }
-			else{
-        require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
-      }
-		}
-
-        $gen = new convert;
-        require_once(e_HANDLER."rate_class.php");
-        $rater = new rater;
-        $sql = new db; $sql2 = new db;
-
-        $filetotal = $sql -> db_Select("download", "*", "download_category='".$id."' AND download_active='1' ORDER BY $order $sort LIMIT $from, $view");
-        $ft = ($filetotal < $view ? $filetotal : $view);
-        while($row = $sql -> db_Fetch()){
-        extract($row);
-			$download_list_table_string .= parse_download_list_table($row);
-			$tdownloads += $download_requested;
-        }
-		
-		$DOWNLOAD_LIST_TOTAL_AMOUNT = $tdownloads." ".LAN_dl_16;
-		$DOWNLOAD_LIST_TOTAL_FILES = $ft." ".LAN_dl_17;
-
-		$download_list_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_LIST_TABLE_START);
-		$download_list_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_LIST_TABLE_END);
-		$text .= $download_list_table_start.$download_list_table_string.$download_list_table_end;
-		$ns -> tablerender($type, $text);
-
-        echo "<div style='text-align:center;margin-left:auto;margin-right:auto'><div class='nextprev' style='width:200px; cursor:hand; pointer:hand; margin-left:auto; margin-right:auto'><a href='".e_SELF."' style='text-decoration:none'>".LAN_dl_9."</a></div></div>";
-
-        require_once(e_HANDLER."np_class.php");
-        $ix = new nextprev("download.php", $from, $view, $total_downloads, "Downloads", "list.".$id.".".$view.".".$order.".".$sort);
-        require_once(FOOTERF);
-        exit;
-}
-
-
-// options -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if($action == "view"){
-
-        require_once(e_HANDLER."rate_class.php");
-        $gen = new convert;
-        $rater = new rater;
-        $aj = new textparse;
-        $sql2 = new db;
-                $highlight_search = FALSE;
-                if(IsSet($_POST['highlight_search'])){
-                        $highlight_search = TRUE;
-                }
-
-		
-		$sql = new db;
-        if(!$sql -> db_Select("download", "*", "download_id = {$id} AND download_active = 1")){
-                require_once(HEADERF);require_once(FOOTERF);
-                exit;
-        }
-
-        $row = $sql -> db_Fetch(); extract($row);
-        $subject = $download_name;
-        $sql2 -> db_Select("download_category", "*", "download_category_id='".$download_category."' ");
-        $row = $sql2 -> db_Fetch(); extract($row);
-        $type = $download_category_name." [ ".$download_category_description." ]";
-        define("e_PAGETITLE", PAGE_NAME." / ".$download_category_name." / ".$download_name);
-
-        require_once(HEADERF);
-
-		$DOWNLOAD_VIEW_NAME = $download_name;
-		$DOWNLOAD_VIEW_AUTHOR_LAN = LAN_dl_24;
-		$DOWNLOAD_VIEW_AUTHOR = ($download_author ? $download_author : "&nbsp;");
-
-		if($download_author_email){
-			$DOWNLOAD_VIEW_AUTHOREMAIL_LAN = LAN_dl_30;
-			$DOWNLOAD_VIEW_AUTHOREMAIL = str_replace("@", ".at.", $download_author_email);
-		}
-
-		if($download_author_website){
-			$DOWNLOAD_VIEW_AUTHORWEBSITE_LAN = LAN_dl_31;
-			$DOWNLOAD_VIEW_AUTHORWEBSITE = $download_author_website;
-		}
-
-		$DOWNLOAD_VIEW_DESCRIPTION_LAN = LAN_dl_7;
-		$DOWNLOAD_VIEW_DESCRIPTION = $aj -> tpa(($download_description ? $download_description : "&nbsp;"), "public", "off", $highlight_search);
-
-		if($download_thumb){
-			$DOWNLOAD_VIEW_IMAGE_LAN = LAN_dl_11;
-			$DOWNLOAD_VIEW_IMAGE = ($download_image ? "<a href='".e_FILE."downloadimages/".$download_image."'><img src='".e_FILE."downloadthumbs/".$download_thumb."' alt='' style='border:0' /></a>" : "<img src='".e_FILE."downloadthumbs/".$download_thumb."' alt='' />");
-		}else if($download_image){
-			$DOWNLOAD_VIEW_IMAGE_LAN = LAN_dl_11;
-			$DOWNLOAD_VIEW_IMAGE = "<a href='".e_BASE."request.php?download.".$download_id."'>".LAN_dl_40."</a>";
-		}
-
-		if($pref['agree_flag'] == 1){
-			$dnld_link = "<a href='request.php?".$download_id."' onclick= \"return confirm('$agreetext');\">";
-		}else{
-			$dnld_link = "<a href='request.php?".$download_id."'>";
-		}
-
-		$DOWNLOAD_VIEW_FILESIZE_LAN = LAN_dl_10;
-		$DOWNLOAD_VIEW_FILESIZE = parsesize($download_filesize);
-		$DOWNLOAD_VIEW_REQUESTED_LAN = LAN_dl_18;
-		$DOWNLOAD_VIEW_REQUESTED = $download_requested;
-		$DOWNLOAD_VIEW_LINK_LAN = LAN_dl_32;
-		$DOWNLOAD_VIEW_LINK = $dnld_link." <img src='".e_IMAGE."generic/download.png' alt='' style='border:0' /></a>";
-		$DOWNLOAD_VIEW_RATING_LAN = LAN_dl_12;
-		$DOWNLOAD_VIEW_RATING = "
-		<table style='width:100%'>
-		<tr>
-		<td style='width:50%'>";
-
-		if($ratearray = $rater -> getrating("download", $download_id)){
-			for($c=1; $c<= $ratearray[1]; $c++){
-				$DOWNLOAD_VIEW_RATING .= "<img src='".e_IMAGE."rate/star.png' alt=''>";
-			}
-			if($ratearray[2]){
-				$DOWNLOAD_VIEW_RATING .= "<img src='".e_IMAGE."rate/".$ratearray[2].".png'  alt=''>";
-			}
-			if($ratearray[2] == ""){ $ratearray[2] = 0; }
-			$DOWNLOAD_VIEW_RATING .= "&nbsp;".$ratearray[1].".".$ratearray[2]." - ".$ratearray[0]."&nbsp;";
-			$DOWNLOAD_VIEW_RATING .= ($ratearray[0] == 1 ? LAN_dl_43 : LAN_dl_44);
-		}else{
-			$DOWNLOAD_VIEW_RATING .= LAN_dl_13;
-		}
-		$DOWNLOAD_VIEW_RATING .= "</td><td style='width:50%; text-align:right'>";
-
-		if(!$rater -> checkrated("download", $download_id) && USER){
-			$DOWNLOAD_VIEW_RATING .= $rater -> rateselect("&nbsp;&nbsp;&nbsp;&nbsp; <b>".LAN_dl_14, "download", $download_id)."</b>";
-		}else if(!USER){
-			$DOWNLOAD_VIEW_RATING .= "&nbsp;";
-		}else{
-			$DOWNLOAD_VIEW_RATING .= LAN_dl_15;
-		}
-		$DOWNLOAD_VIEW_RATING .= "</td></tr></table>";
-    
-    if(!$DOWNLOAD_VIEW_TABLE){
-			if(file_exists(THEME."download_template.php")){
-        require_once(THEME."download_template.php");
-      }
-			else{
-        require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
-      }
-		}
-		$download_view_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_VIEW_TABLE_START);
-		$download_view_table_string = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_VIEW_TABLE);
-		$download_view_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_VIEW_TABLE_END);
-		$text .= $download_view_table_start.$download_view_table_string.$download_view_table_end;
-
-		$dl_id = $download_id;
-		if($sql -> db_Select("download", "*", "download_category='$download_category_id' AND download_id < $dl_id AND download_active = 1 ORDER BY download_datestamp DESC")){
-			$row = $sql -> db_Fetch(); extract($row);
-			$prev = "<div class='nextprev'><a href='".e_SELF."?view.$download_id'>&lt;&lt; ".LAN_dl_33." [$download_name]</a></div>\n";
-		}else{
-			$prev = "&nbsp;";
-		}
-        if($sql -> db_Select("download", "*", "download_category='$download_category_id' AND download_id > $dl_id AND download_active = 1 ORDER BY download_datestamp ASC")){
-			$row = $sql -> db_Fetch(); extract($row);
-			$next = "<div class='nextprev'><a href='".e_SELF."?view.$download_id'>[$download_name] ".LAN_dl_34." &gt;&gt;</a></div>\n";
-		}else{
-			$next = "&nbsp;";
-		}
-
-		if($prev || $next){
-			$text .= "
-			<table style='width:100%'>
-			<tr>
-			<td style='width:40%'>$prev</td>
-			<td style='width:20%'><div class='nextprev'><a href='".e_SELF."?list.$download_category'>".LAN_dl_35."</a></div></td>
-			<td style='width:40%'>$next</td>
-			</tr>
-			</table>
-			";
-		}
-		$ns -> tablerender($type, $text);
-
-
-		unset($text);
-		if($download_comment){
-			$query = ($pref['nested_comments'] ? "comment_item_id='$id' AND comment_type='2' AND comment_pid='0' ORDER BY comment_datestamp" : "comment_item_id='$id' AND comment_type='2' ORDER BY comment_datestamp");
-			$comment_total = $sql -> db_Select("comments", "*",  "".$query."");
-			if($comment_total){
-				$width = 0;
-				while($row = $sql -> db_Fetch()){
-					if($pref['nested_comments']){
-						$text = $cobj -> render_comment($row, "download", "comment", $id, $width, $subject);
-						$ns -> tablerender(LAN_5, $text);
-					}else{
-						$text .= $cobj -> render_comment($row, "download", "comment", $id, $width, $subject);
-					}
-				}
-				if(!$pref['nested_comments']){ $ns -> tablerender(LAN_5, $text); }
-			}
-			$cobj -> form_comment("comment", "download", $id, $subject, $content_type);
-		}
-
-		require_once(FOOTERF);
-		}
-
-//$ns -> tablerender(LAN_dl_18, LAN_dl_2);
-//require_once(FOOTERF);
-
-function parsesize($size){
-        $kb = 1024;
-        $mb = 1024 * $kb;
-        $gb = 1024 * $mb;
-        $tb = 1024 * $gb;
-        if($size < $kb) {
-                return $size." b";
-        }else if($size < $mb) {
-                return round($size/$kb,2)." kb";
-        }else if($size < $gb) {
-                return round($size/$mb,2)." mb";
-        }else if($size < $tb) {
-                return round($size/$gb,2)." gb";
-        }else {
-                return round($size/$tb,2)." tb";
-        }
-}
-
-function parse_download_cat_parent_table($row){
-		global $DOWNLOAD_CAT_PARENT_TABLE;
-		extract($row);
-		
-		if(check_class($download_category_class)){
-				$parent_status == "open";
-				$DOWNLOAD_CAT_MAIN_ICON .= ($download_category_icon ? "<img src='".e_IMAGE."download_icons/".$download_category_icon."' alt='' style='float-left' />" : "&nbsp;");
-				$DOWNLOAD_CAT_MAIN_NAME .= $download_category_name;
-		}else{
-				$parent_status == "closed";
-		}
-		return(preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_PARENT_TABLE));
-}
-
-function parse_download_cat_child_table($row){
-		global $DOWNLOAD_CAT_CHILD_TABLE, $sql;
-		extract($row);
-
-		$sql2 = new db; $sql3 = new db; $sql4 = new db; $sql5 = new db;
-
-		$total_filesize=0; $total_downloadcount=0;
-		if($filecount = $sql3 -> db_Select("download", "*", "download_category='".$download_category_id."' AND download_active='1'")){
-			while($row = $sql3 -> db_Fetch()){
-			extract($row);
-				$total_filesize += $download_filesize;
-				$total_downloadcount += $download_requested;
-			}
-			$total_filesize = parsesize($total_filesize);
-		}
-		$new = (USER && $sql3 -> db_Count("download", "(*)", "WHERE download_category='".$download_category_id."' AND download_datestamp>".USERLV) ? "<img src='".e_IMAGE."generic/new.png' alt='' style='vertical-align:middle' />" : "");
-
-		if(check_class($download_category_class)){
-			$DOWNLOAD_CAT_SUB_ICON = ($download_category_icon ? "<img src='".e_IMAGE."download_icons/".$download_category_icon."' alt='' style='float-left' />" : "&nbsp;");
-			$DOWNLOAD_CAT_SUB_NEW_ICON = $new;
-			$DOWNLOAD_CAT_SUB_NAME = ($filecount ? "<a href='".e_SELF."?list.".$download_category_id."'>".$download_category_name."</a>" : $download_category_name);
-			$DOWNLOAD_CAT_SUB_DESCRIPTION = $download_category_description;
-			$DOWNLOAD_CAT_SUB_COUNT = $filecount;
-			$DOWNLOAD_CAT_SUB_SIZE = $total_filesize;
-			$DOWNLOAD_CAT_SUB_DOWNLOADED = $total_downloadcount;
-
-			// check for subsub cats ...
-			if($sql5 -> db_Select("download_category", "*", "download_category_parent='".$download_category_id."'")){
-				$DOWNLOAD_CAT_SUBSUB_LAN = LAN_dl_42;
-				while($row = $sql5 -> db_Fetch()){
-				extract($row);
-					$new = (USER && $sql4 -> db_Count("download", "(*)", "WHERE download_category='".$download_category_id."' AND download_datestamp>".USERLV) ? "<img src='".e_IMAGE."generic/new.png' alt='' style='vertical-align:middle' />" : "");
-					if($sql4 -> db_Select("download", "*", "download_category='".$download_category_id."' ")){
-						$DOWNLOAD_CAT_SUBSUB_NAME .= "<a href='".e_SELF."?list.".$download_category_id."'>".$download_category_name."</a> ";
-					}else{
-						$DOWNLOAD_CAT_SUBSUB_NAME .= " ".$new.$download_category_name." ";
-					}
-				}
-			}
-		}
-		return(preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_CHILD_TABLE));
-}
-
-
-
-
-function parse_download_list_table($row){
-		global $DOWNLOAD_LIST_TABLE, $rater, $pref, $gen, $agreetext;
-		extract($row);
-
-		$gen = new convert;
-		$rater = new rater;
-
-		$DOWNLOAD_LIST_NEWICON = (USER && $download_datestamp>USERLV ? "<img src='".e_IMAGE."generic/new.png' alt='' style='vertical-align:middle' />" : "");
-
-		$DOWNLOAD_LIST_DATESTAMP = $gen->convert_date($download_datestamp, "short");
-		$DOWNLOAD_LIST_FILESIZE = parsesize($download_filesize);
-		$ratearray = $rater -> getrating("download", $download_id);
-		if(!$ratearray[0]){
-			$DOWNLOAD_LIST_RATING = LAN_dl_13;
-		}else{
-			$DOWNLOAD_LIST_RATING = ($ratearray[2] ? $ratearray[1].".".$ratearray[2]."/".$ratearray[0] : $ratearray[1]."/".$ratearray[0]);
-		}
-
-		if($pref['agree_flag'] == 1){
-			$DOWNLOAD_LIST_LINK = "<a href='request.php?".$download_id."' onclick= \"return confirm('".$agreetext."');\">";
-		}else{
-			$DOWNLOAD_LIST_LINK = "<a href='request.php?".$download_id."'>";
-		}
-
-		$DOWNLOAD_LIST_NAME = "<a href='".e_SELF."?view.".$download_id."'>".$download_name."</a>";
-		$DOWNLOAD_LIST_AUTHOR = $download_author;
-		$DOWNLOAD_LIST_REQUESTED = $download_requested;
-		$DOWNLOAD_LIST_ICON = "<img src='".e_IMAGE."generic/download.png' alt='' style='border:0' />";
-
-		return(preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_LIST_TABLE));
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/download.php,v $
+|     $Revision: 1.62 $
+|     $Date: 2006/05/15 00:30:31 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+require_once(e_HANDLER."comment_class.php");
+require_once(e_FILE."shortcode/batch/download_shortcodes.php");
+unset($text);
+$agreetext = $tp->toJS($pref['agree_text']);
+$cobj = new comment;
+global $tp;
+
+/* define images */
+define("IMAGE_DOWNLOAD", (file_exists(THEME."generic/download.png") ? THEME."generic/download.png" : e_IMAGE."generic/".IMODE."/download.png"));
+define("IMAGE_NEW", (file_exists(THEME."generic/new.png") ? THEME."generic/new.png" : e_IMAGE."generic/".IMODE."/new.png"));
+
+/* define image style */
+
+if (!e_QUERY || $_GET['elan'])
+{
+	require_once(HEADERF);
+	// no qs - render categories ...
+
+	if (!$DOWNLOAD_CAT_PARENT_TABLE)
+	{
+		if (is_readable(THEME."templates/download_template.php"))
+		{
+			require_once(THEME."templates/download_template.php");
+		}
+		elseif (is_readable(THEME."download_template.php"))
+		{
+			require_once(THEME."download_template.php");
+		}
+		else
+		{
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
+		}
+	}
+    if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:1px solid blue");}
+
+	$qry = "
+	SELECT dc.*, SUM(d.download_filesize) AS d_size,
+	COUNT(d.download_id) AS d_count,
+	MAX(d.download_datestamp) as d_last,
+	SUM(d.download_requested) as d_requests,
+	COUNT(d2.download_id) AS d_subcount,
+	SUM(d2.download_filesize) AS d_subsize,
+	SUM(d2.download_requested) as d_subrequests
+	FROM #download_category AS dc
+	LEFT JOIN #download AS d ON dc.download_category_id = d.download_category AND d.download_active > 0 AND d.download_visible IN (".USERCLASS_LIST.")
+	LEFT JOIN #download_category as dc2 ON dc2.download_category_parent=dc.download_category_id
+	LEFT JOIN #download AS d2 ON dc2.download_category_id = d2.download_category AND d2.download_active > 0 AND d2.download_visible IN (".USERCLASS_LIST.")
+	WHERE dc.download_category_class IN (".USERCLASS_LIST.")
+	GROUP by dc.download_category_id ORDER by dc.download_category_order
+	";
+	if (!$sql->db_Select_gen($qry))
+	{
+		$ns->tablerender(LAN_dl_18, "<div style='text-align:center'>".LAN_dl_2."</div>");
+		require_once(FOOTERF);
+		exit;
+	}
+	else
+	{
+		while($row = $sql->db_Fetch())
+		{
+			$catList[$row['download_category_parent']][] = $row;
+		}
+		foreach($catList[0] as $row)
+		{
+
+			$download_cat_table_string .= parse_download_cat_parent_table($row);
+			foreach($catList[$row['download_category_id']] as $crow)
+			{
+				$download_cat_table_string .= parse_download_cat_child_table($crow, $catList[$crow['download_category_id']]);
+			}
+		}
+	}
+
+	$download_cat_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_START);
+
+	$DOWNLOAD_CAT_NEWDOWNLOAD_TEXT = "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' /> ".LAN_dl_36;
+	$DOWNLOAD_CAT_SEARCH = "
+		<form method='get' action='".e_BASE."search.php'>
+		<p>
+		<input class='tbox' type='text' name='q' size='30' value='' maxlength='50' />
+		<input class='button' type='submit' name='s' value='".LAN_dl_41."' />
+		<input type='hidden' name='r' value='0' />
+		</p>
+		</form>";
+
+	$download_cat_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_END);
+	$text .= $download_cat_table_start.$download_cat_table_string.$download_cat_table_end;
+
+	if($DOWNLOAD_CAT_TABLE_RENDERPLAIN) {
+		echo $text;
+	} else {
+		$ns->tablerender(LAN_dl_18.$type, $text);
+	}
+	require_once(FOOTERF);
+	exit;
+}
+
+
+$tmp = explode(".", e_QUERY);
+if (is_numeric($tmp[0])) {
+	$from = intval($tmp[0]);
+	$action = preg_replace("#\W#", "", $tp -> toDB($tmp[1]));
+	$id = intval($tmp[2]);
+	$view = intval($tmp[3]);
+	$order = preg_replace("#\W#", "", $tp -> toDB($tmp[4]));
+	$sort = preg_replace("#\W#", "", $tp -> toDB($tmp[5]));
+} else {
+	$action = preg_replace("#\W#", "", $tp -> toDB($tmp[0]));
+	$id = intval($tmp[1]);
+}
+
+if (isset($_POST['commentsubmit']))
+{
+	if (!$sql->db_Select("download", "download_comment", "download_id = '{$id}' "))
+	{
+		header("location:".e_BASE."index.php");
+		exit;
+	}
+	else
+	{
+		$row = $sql->db_Fetch();
+		if ($row['download_comment'] && (ANON === TRUE || USER === TRUE))
+		{
+			$clean_authorname = $_POST['author_name'];
+			$clean_comment = $_POST['comment'];
+			$clean_subject = $_POST['subject'];
+
+			$cobj->enter_comment($clean_authorname, $clean_comment, "download", $id, $pid, $clean_subject);
+			$e107cache->clear("comment.download.{$sub_action}");
+		}
+	}
+}
+
+//  -------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+if ($action == "list") {
+
+	if (isset($_POST['view'])) {
+		extract($_POST);
+	}
+
+	if (!$from) {
+		$from = 0;
+	}
+	if (!$order) {
+		$order = ($pref['download_order'] ? $pref['download_order'] : "download_datestamp");
+	}
+	if (!$sort) {
+		$sort = ($pref['download_sort'] ? $pref['download_sort'] : "DESC");
+	}
+	if (!$view) {
+		$view = ($pref['download_view'] ? $pref['download_view'] : "10");
+	}
+
+	$total_downloads = $sql->db_Count("download", "(*)", "WHERE download_category = '{$id}' AND download_active > 0 AND download_visible REGEXP '".e_CLASS_REGEXP."'");
+
+	/*
+	if (!$total_downloads) {
+		require_once(HEADERF);
+		require_once(FOOTERF);
+		exit;
+	}
+	*/
+
+	/* SHOW SUBCATS ... */
+
+	if($sql -> db_Select("download_category", "download_category_id", "download_category_parent='{$id}' "))
+	{
+		/* there are subcats - display them ... */
+		$qry = "
+		SELECT dc.*, dc2.download_category_name AS parent_name, dc2.download_category_icon as parent_icon, SUM(d.download_filesize) AS d_size,
+		COUNT(d.download_id) AS d_count,
+		MAX(d.download_datestamp) as d_last,
+		SUM(d.download_requested) as d_requests
+		FROM #download_category AS dc
+		LEFT JOIN #download AS d ON dc.download_category_id = d.download_category AND d.download_active > 0 AND d.download_visible IN (".USERCLASS_LIST.")
+		LEFT JOIN #download_category as dc2 ON dc2.download_category_id='{$id}'
+		WHERE dc.download_category_class IN (".USERCLASS_LIST.") AND dc.download_category_parent='{$id}'
+		GROUP by dc.download_category_id ORDER by dc.download_category_order
+		";
+		$sql->db_Select_gen($qry);
+		$scArray = $sql -> db_getList();
+		if (!$DOWNLOAD_CAT_PARENT_TABLE) {
+			if (file_exists(THEME."download_template.php"))	{
+				require_once(THEME."download_template.php");
+			} else {
+				require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
+			}
+		}
+		if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:1px solid blue");}
+		foreach($scArray as $row)	{
+			$download_cat_table_string .= parse_download_cat_child_table($row, FALSE);
+		}
+		require_once(HEADERF);
+		if(strstr($row['parent_icon'], chr(1)))	{
+			list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $row['parent_icon']);
+		}
+		$DOWNLOAD_CAT_MAIN_ICON = ($download_category_icon ? "<img src='".e_IMAGE."icons/".$download_category_icon."' alt='' style='float-left' />" : "&nbsp;");
+		$DOWNLOAD_CAT_MAIN_NAME = $tp->toHTML($row['parent_name']);
+		$download_cat_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_START);
+		$DOWNLOAD_CAT_NEWDOWNLOAD_TEXT = "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' /> ".LAN_dl_36;
+		$download_cat_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_TABLE_END);
+		$text = $download_cat_table_start.$download_cat_table_string.$download_cat_table_end;
+		if($DOWNLOAD_CAT_TABLE_RENDERPLAIN) {
+			echo $text;
+		} else {
+			$ns->tablerender(LAN_dl_18.$type, $text);
+		}
+		require_once(FOOTERF);
+		exit;
+	}
+
+	$sql->db_Select("download_category", "*", "download_category_id='{$id}'");
+	$row = $sql->db_Fetch();
+	extract($row);
+
+	$core_total = $sql->db_Count("download WHERE download_category='{$id}' AND download_active > 0 AND download_visible IN (".USERCLASS_LIST.")");
+	$type = $download_category_name;
+
+	$type .= ($download_category_description) ? " [ ".$download_category_description." ]" : "";
+	define("e_PAGETITLE", PAGE_NAME." / ".$download_category_name);
+
+	require_once(HEADERF);
+	if (!check_class($download_category_class)) {
+		$ns->tablerender(LAN_dl_18, "<div style='text-align:center'>".LAN_dl_3."</div>");
+		require_once(FOOTERF);
+		exit;
+	}
+
+	if(strstr($download_category_icon, chr(1)))
+	{
+		list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $download_category_icon);
+	}
+	$DOWNLOAD_CATEGORY_ICON = ($download_category_icon ? "<img src='".e_IMAGE."icons/".$download_category_icon."' alt='' style='float-left' />" : "&nbsp;");
+
+	$DOWNLOAD_CATEGORY = $tp->toHTML($download_category_name);
+	$DOWNLOAD_CATEGORY_DESCRIPTION = $tp -> toHTML($download_category_description, TRUE);
+
+	if (!$DOWNLOAD_LIST_TABLE) {
+		if (file_exists(THEME."download_template.php")) {
+			require_once(THEME."download_template.php");
+		} else {
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
+		}
+	}
+    if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:1px solid blue");}
+
+	$gen = new convert;
+	require_once(e_HANDLER."rate_class.php");
+	$rater = new rater;
+	$sql = new db;
+	 $sql2 = new db;
+
+	$filetotal = $sql->db_Select("download", "*", "download_category='{$id}' AND download_active > 0 AND download_visible IN (".USERCLASS_LIST.") ORDER BY {$order} {$sort} LIMIT {$from}, {$view}");
+	$ft = ($filetotal < $view ? $filetotal : $view);
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		$download_list_table_string .= parse_download_list_table($row);
+		$tdownloads += $download_requested;
+	}
+
+	$DOWNLOAD_LIST_TOTAL_AMOUNT = $tdownloads." ".LAN_dl_16;
+	$DOWNLOAD_LIST_TOTAL_FILES = $ft." ".LAN_dl_17;
+
+	$download_list_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_LIST_TABLE_START);
+	$download_list_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_LIST_TABLE_END);
+	$text .= $download_list_table_start.$download_list_table_string.$download_list_table_end;
+
+
+	if($DOWNLOAD_LIST_TABLE_RENDERPLAIN) {
+		echo $text;
+	} else {
+		$ns->tablerender($type, $text);
+	}
+
+
+	echo "<div style='text-align:center;margin-left:auto;margin-right:auto'><a href='".e_SELF."'>".LAN_dl_9."</a><br /><br />";
+	$parms = $total_downloads.",".$view.",".$from.",".e_SELF."?[FROM].list.{$id}.{$view}.{$order}.{$sort}.";
+	echo ($total_downloads > $view) ? "<div class='nextprev'>&nbsp;".$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>" : "";
+    echo "</div>";
+
+	require_once(FOOTERF);
+	exit;
+}
+
+
+//  -------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+if ($action == "view") {
+
+	require_once(e_HANDLER."rate_class.php");
+	$gen = new convert;
+	$rater = new rater;
+	$sql2 = new db;
+	$highlight_search = FALSE;
+	if (isset($_POST['highlight_search'])) {
+		$highlight_search = TRUE;
+	}
+
+	$sql = new db;
+	if (!$sql->db_Select("download", "*", "download_id = {$id} AND download_active > 0 AND download_visible IN (".USERCLASS_LIST.")")) {
+		require_once(HEADERF);
+		require_once(FOOTERF);
+		exit;
+	}
+
+    if (!$DOWNLOAD_VIEW_TABLE) {
+		if (file_exists(THEME."download_template.php")) {
+			require_once(THEME."download_template.php");
+		} else {
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
+		}
+	}
+    if(!defined("DL_IMAGESTYLE")){ define("DL_IMAGESTYLE","border:0px");}
+
+	$gen = new convert;
+	$row = $sql->db_Fetch();
+	extract($row);
+	$comments_enabled = $row['download_comment'];
+	$subject = $download_name;
+	$sql2->db_Select("download_category", "*", "download_category_id='".intval($download_category)."' ");
+	$row = $sql2->db_Fetch();
+	extract($row);
+	$type = $download_category_name;
+	$type .= ($download_category_description) ? " [ ".$download_category_description." ]" : "";
+	define("e_PAGETITLE", PAGE_NAME." / ".$download_category_name." / ".$download_name);
+
+	require_once(HEADERF);
+	if (!check_class($download_category_class)) {
+		$ns->tablerender(LAN_dl_18, "<div style='text-align:center'>".LAN_dl_3."</div>");
+		require_once(FOOTERF);
+		exit;
+	}
+
+    $DOWNLOAD_ADMIN_EDIT = (ADMIN && getperms('6')) ? "<a href='".e_ADMIN."download.php?create.edit.$download_id' title='edit'><img src='".e_IMAGE."generic/lite/edit.png' alt='' style='padding:0px;border:0px' /></a>" : "";
+
+
+	$DOWNLOAD_REPORT_LINK = "<a href='".e_SELF."?report.{$download_id}'>".LAN_dl_45."</a>";
+	$DOWNLOAD_CATEGORY = $download_category_name;
+	$DOWNLOAD_CATEGORY_DESCRIPTION = $tp -> toHTML($download_category_description, TRUE);
+
+	$DOWNLOAD_VIEW_NAME = $download_name;
+
+	$DOWNLOAD_VIEW_NAME_LINKED = "<a href='".e_BASE."request.php?".$download_id."' title='".LAN_dl_46."'>{$download_name}</a>";
+
+	$DOWNLOAD_VIEW_AUTHOR_LAN = LAN_dl_24;
+	$DOWNLOAD_VIEW_AUTHOR = ($download_author ? $download_author : "&nbsp;");
+
+	if ($download_author_email) {
+		$DOWNLOAD_VIEW_AUTHOREMAIL_LAN = LAN_dl_30;
+		$DOWNLOAD_VIEW_AUTHOREMAIL = $tp -> toHTML($download_author_email, TRUE);
+	}
+
+	if ($download_author_website) {
+		$DOWNLOAD_VIEW_AUTHORWEBSITE_LAN = LAN_dl_31;
+		$DOWNLOAD_VIEW_AUTHORWEBSITE = $tp -> toHTML($download_author_website, TRUE);
+	}
+
+	$DOWNLOAD_VIEW_DESCRIPTION_LAN = LAN_dl_7;
+	$DOWNLOAD_VIEW_DESCRIPTION = $tp->toHTML(($download_description ? $download_description : "&nbsp;"), TRUE);
+
+	$DOWNLOAD_VIEW_DATE_LAN = LAN_dl_22;
+	$DOWNLOAD_VIEW_DATE_SHORT = $gen->convert_date($download_datestamp, "short");
+	$DOWNLOAD_VIEW_DATE_LONG = $gen->convert_date($download_datestamp, "long");
+
+	$DOWNLOAD_VIEW_IMAGE_LAN = LAN_dl_11;
+
+
+	if ($download_thumb) {
+		$DOWNLOAD_VIEW_IMAGE = ($download_image ? "<a href='".e_BASE."request.php?download.".$download_id."'><img src='".e_FILE."downloadthumbs/".$download_thumb."' alt='' style='".DL_IMAGESTYLE."' /></a>" : "<img src='".e_FILE."downloadthumbs/".$download_thumb."' alt='' style='".DL_IMAGESTYLE."' />");
+	}
+	else if($download_image) {
+		$DOWNLOAD_VIEW_IMAGE = "<a href='".e_BASE."request.php?download.".$download_id."'>".LAN_dl_40."</a>";
+	}
+	else
+	{
+		$DOWNLOAD_VIEW_IMAGE = LAN_dl_75;
+	}
+
+	$DOWNLOAD_VIEW_IMAGEFULL = ($download_image) ? "<img src='".e_FILE."downloadimages/{$download_image}' alt='' style='".DL_IMAGESTYLE."' />" : "";
+
+	if ($pref['agree_flag'] == 1) {
+		$dnld_link = "<a href='request.php?{$download_id}' onclick= \"return confirm('{$agreetext}');\">";
+	} else {
+		$dnld_link = "<a href='request.php?{$download_id}'>";
+	}
+    $DOWNLOAD_VIEW_ID = $download_id;
+	$DOWNLOAD_VIEW_FILESIZE_LAN = LAN_dl_10;
+	$DOWNLOAD_VIEW_FILESIZE = parsesize($download_filesize);
+	$DOWNLOAD_VIEW_REQUESTED_LAN = LAN_dl_18;
+	$DOWNLOAD_VIEW_REQUESTED = $download_requested;
+	$DOWNLOAD_VIEW_LINK_LAN = LAN_dl_32;
+
+	if($download_mirror)
+	{
+		if($download_mirror_type)
+		{
+			$DOWNLOAD_VIEW_LINK = "<a href='".e_SELF."?mirror.{$download_id}'>".LAN_dl_66."</a>";
+		}
+		else
+		{
+			$DOWNLOAD_VIEW_LINK = $dnld_link." <img src='".IMAGE_DOWNLOAD."' alt='' style='border:0' /></a>";
+		}
+	}
+	else
+	{
+		$DOWNLOAD_VIEW_LINK = $dnld_link." <img src='".IMAGE_DOWNLOAD."' alt='' style='border:0' /></a>";
+	}
+
+
+	$DOWNLOAD_VIEW_RATING_LAN = LAN_dl_12;
+	$DOWNLOAD_VIEW_RATING = "
+		<table style='width:100%'>
+		<tr>
+		<td style='width:50%'>";
+
+	if ($ratearray = $rater->getrating("download", $download_id)) {
+		for($c = 1; $c <= $ratearray[1]; $c++) {
+			$DOWNLOAD_VIEW_RATING .= "<img src='".e_IMAGE."rate/".IMODE."/star.png' alt=''>";
+		}
+		if ($ratearray[2]) {
+			$DOWNLOAD_VIEW_RATING .= "<img src='".e_IMAGE."rate/".IMODE."/".$ratearray[2].".png'  alt=''>";
+		}
+		if ($ratearray[2] == "") {
+			$ratearray[2] = 0;
+		}
+		$DOWNLOAD_VIEW_RATING .= "&nbsp;".$ratearray[1].".".$ratearray[2]." - ".$ratearray[0]."&nbsp;";
+		$DOWNLOAD_VIEW_RATING .= ($ratearray[0] == 1 ? LAN_dl_43 : LAN_dl_44);
+	} else {
+		$DOWNLOAD_VIEW_RATING .= LAN_dl_13;
+	}
+	$DOWNLOAD_VIEW_RATING .= "</td><td style='width:50%; text-align:right'>";
+
+	if (!$rater->checkrated("download", $download_id) && USER) {
+		$DOWNLOAD_VIEW_RATING .= $rater->rateselect("&nbsp;&nbsp;&nbsp;&nbsp; <b>".LAN_dl_14, "download", $download_id)."</b>";
+	}
+	else if(!USER) {
+		$DOWNLOAD_VIEW_RATING .= "&nbsp;";
+	} else {
+		$DOWNLOAD_VIEW_RATING .= LAN_dl_15;
+	}
+	$DOWNLOAD_VIEW_RATING .= "</td></tr></table>";
+
+	$download_view_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_VIEW_TABLE_START);
+	$download_view_table_string = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_VIEW_TABLE);
+	$download_view_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_VIEW_TABLE_END);
+	$text .= $download_view_table_start.$download_view_table_string.$download_view_table_end;
+
+	$dl_id = intval($download_id);
+	if ($sql->db_Select("download", "*", "download_category='".intval($download_category_id)."' AND download_id < {$dl_id} AND download_active > 0 && download_visible IN (".USERCLASS_LIST.") ORDER BY download_datestamp DESC")) {
+		$row = $sql->db_Fetch();
+		 extract($row);
+		$prev = "<a href='".e_SELF."?view.{$download_id}'>&lt;&lt; ".LAN_dl_33." [{$download_name}]</a>\n";
+	} else {
+		$prev = "&nbsp;";
+	}
+	if ($sql->db_Select("download", "*", "download_category='".intval($download_category_id)."' AND download_id > {$dl_id} AND download_active > 0 && download_visible IN (".USERCLASS_LIST.") ORDER BY download_datestamp ASC")) {
+		$row = $sql->db_Fetch();
+		 extract($row);
+		$next = "<a href='".e_SELF."?view.{$download_id}'>[{$download_name}] ".LAN_dl_34." &gt;&gt;</a>\n";
+	} else {
+		$next = "&nbsp;";
+	}
+
+	if ($prev || $next) {
+		$text .= "
+		<div style='text-align:center'>
+			<table style='width:95%'>
+			<tr>
+			<td style='width:40%;'>{$prev}</td>
+			<td style='width:20%; text-align: center;'><a href='".e_SELF."?list.{$download_category}'>".LAN_dl_35."</a></td>
+			<td style='width:40%; text-align: right;'>{$next}</td>
+			</tr>
+			</table>
+			</div>
+			";
+	}
+
+	if($DOWNLOAD_VIEW_TABLE_RENDERPLAIN) {
+		echo $text;
+	} else {
+		$ns->tablerender($type, $text);
+	}
+	unset($text);
+	if ($comments_enabled) {
+		$cobj->compose_comment("download", "comment", $id, $width, $subject, $showrate=FALSE);
+	}
+
+	require_once(FOOTERF);
+}
+
+if ($action == "report") {
+	if (!$sql->db_Select("download", "*", "download_id = {$id} AND download_active > 0")) {
+		require_once(HEADERF);
+		require_once(FOOTERF);
+		exit;
+	}
+
+	$row = $sql -> db_Fetch();
+	extract($row);
+
+	if (isset($_POST['report_download'])) {
+		$report_add = $tp -> toDB($_POST['report_add']);
+		$download_name = $tp -> toDB($download_name);
+		$user = USER ? USERNAME : LAN_dl_52;
+
+		if ($pref['download_email']) {
+			require_once(e_HANDLER."mail.php");
+			$subject = LAN_dl_60." ".SITENAME;
+			$report = LAN_dl_58." ".SITENAME.":\n".(substr(SITEURL, -1) == "/" ? SITEURL : SITEURL."/")."download.php?view.".$download_id."\n
+			".LAN_dl_59." ".$user."\n".$report_add;
+			sendemail(SITEADMINEMAIL, $subject, $report);
+		}
+
+		$sql->db_Insert('generic', "0, 'Broken Download', ".time().",'".USERID."', '{$download_name}', {$id}, '{$report_add}'");
+
+		define("e_PAGETITLE", PAGE_NAME." / ".LAN_dl_47);
+		require_once(HEADERF);
+
+		$text = LAN_dl_48."<br /><br /><a href='".e_BASE."download.php?view.".$download_id."'>".LAN_dl_49."</a";
+		$ns->tablerender(LAN_dl_50, $text);
+
+	} else {
+		define("e_PAGETITLE", PAGE_NAME." / ".LAN_dl_51." ".$download_name);
+		require_once(HEADERF);
+
+		$text = "<form action='".e_SELF."?report.{$download_id}' method='post'>
+		<table style='width:100%'>
+			<tr>
+			<td  style='width:50%' >
+			".LAN_dl_32.": ".$download_name."<br />
+			<a href='".e_SELF."?view.{$download_id}'>
+			<span class='smalltext'>".LAN_dl_53."</span>
+			</a>
+			</td>
+			<td style='text-align:center;width:50%'>
+			</td>
+			</tr>
+			<tr>
+			<td>".LAN_dl_54."<br />".LAN_dl_55."
+			</td>
+			<td style='text-align:center;'>
+			<textarea cols='40' rows='10' class='tbox' name='report_add'></textarea>
+			</td>
+			</tr>
+			<tr>
+			<td colspan='2' style='text-align:center;'><br />
+			<input class='button' type='submit' name='report_download' value='".LAN_dl_56."' />
+			</td>
+			</tr>
+			</table>";
+		$ns->tablerender(LAN_dl_50, $text);
+	}
+	require_once(FOOTERF);
+	exit;
+}
+
+if($action == "mirror")
+{
+	require_once(HEADERF);
+
+	if (!$DOWNLOAD_MIRROR_START) {
+		if (file_exists(THEME."download_template.php")) {
+			require_once(THEME."download_template.php");
+		} else {
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/download_template.php");
+		}
+	}
+
+	$sql -> db_Select("download_mirror");
+	$mirrorList = $sql -> db_getList("ALL", 0, 200, "mirror_id");
+
+	if($sql -> db_Select("download", "*", "download_id = {$id}"))
+	{
+		$row = $sql->db_Fetch();
+
+		extract($row);
+		$array = explode(chr(1), $download_mirror);
+
+		$c = (count($array)-1);
+		for ($i=1; $i<$c; $i++) {
+			$d = mt_rand(0, $i);
+			$tmp = $array[$i];
+			$array[$i] = $array[$d];
+			$array[$d] = $tmp;
+		}
+
+		$download_mirror = "";
+		foreach($array as $mirrorstring)
+		{
+			if($mirrorstring)
+			{
+				$download_mirror .= parse_download_mirror_table($row, $mirrorstring, $mirrorList);
+			}
+		}
+
+		$DOWNLOAD_MIRROR_HOST_LAN = LAN_dl_68;
+		$DOWNLOAD_MIRROR_GET_LAN = LAN_dl_32;
+		$DOWNLOAD_MIRROR_LOCATION_LAN = LAN_dl_70;
+		$DOWNLOAD_MIRROR_DESCRIPTION_LAN = LAN_dl_71;
+		$DOWNLOAD_MIRROR_REQUEST = LAN_dl_72."'".$download_name."'";
+
+		$download_mirror_start = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_MIRROR_START);
+		$download_mirror_end = preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_MIRROR_END);
+
+		$text = $download_mirror_start.$download_mirror.$download_mirror_end;
+
+		if($DOWNLOAD_MIRROR_RENDERPLAIN) {
+			echo $text;
+		} else {
+			$ns->tablerender(LAN_dl_67, $text);
+		}
+
+		require_once(FOOTERF);
+	}
+}
+
+function parse_download_mirror_table($row, $mirrorstring, $mirrorList)
+{
+
+	global $DOWNLOAD_MIRROR;
+	list($mirrorHost_id, $mirrorHost_url, $mirrorRequests) = explode(",", $mirrorstring);
+
+	extract($mirrorList[$mirrorHost_id]);
+
+	$DOWNLOAD_MIRROR_NAME = "<a href='{$mirror_url}' rel='external'>{$mirror_name}</a>";
+	$DOWNLOAD_MIRROR_IMAGE = ($mirror_image ? "<a href='{$mirror_url}' rel='external'><img src='".e_FILE."downloadimages/".$mirror_image."' alt='' style='border:0' /></a>" : "");
+	$DOWNLOAD_MIRROR_LOCATION = ($mirror_location ? $mirror_location : "");
+	$DOWNLOAD_MIRROR_DESCRIPTION = ($mirror_description ? $mirror_description : "");
+
+	$DOWNLOAD_MIRROR_FILESIZE = parsesize($row['download_filesize']);
+	$DOWNLOAD_MIRROR_LINK = "<a href='".e_BASE."request.php?mirror.{$row['download_id']}.{$mirrorHost_id}' title='".LAN_dl_32."'><img src='".IMAGE_DOWNLOAD."' alt='' style='border:0' /></a>";
+
+	$DOWNLOAD_MIRROR_REQUESTS = (ADMIN ? LAN_dl_73.$mirrorRequests : "");
+	$DOWNLOAD_TOTAL_MIRROR_REQUESTS = (ADMIN ? LAN_dl_74.$mirror_count : "");
+
+	return(preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_MIRROR));
+}
+
+function parsesize($size) {
+	$kb = 1024;
+	$mb = 1024 * $kb;
+	$gb = 1024 * $mb;
+	$tb = 1024 * $gb;
+	if(!$size)
+	{
+		return '0';
+	}
+	if ($size < $kb) {
+		return $size." b";
+	}
+	else if($size < $mb) {
+		return round($size/$kb, 2)." kb";
+	}
+	else if($size < $gb) {
+		return round($size/$mb, 2)." mb";
+	}
+	else if($size < $tb) {
+		return round($size/$gb, 2)." gb";
+	} else {
+		return round($size/$tb, 2)." tb";
+	}
+}
+
+function parse_download_cat_parent_table($row) {
+	global $tp,$current_row,$DOWNLOAD_CAT_PARENT_TABLE;
+	extract($row);
+	$current_row = ($current_row) ? 0 : 1;  // Alternating CSS for each row.(backwards compatible)
+
+
+	$template = ($current_row == 1) ? $DOWNLOAD_CAT_PARENT_TABLE : str_replace("forumheader3","forumheader3 forumheader3_alt",$DOWNLOAD_CAT_PARENT_TABLE);
+
+	if (check_class($download_category_class)) {
+		$parent_status == "open";
+		if(strstr($download_category_icon, chr(1)))
+		{
+			list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $download_category_icon);
+		}
+		$DOWNLOAD_CAT_MAIN_ICON .= ($download_category_icon ? "<img src='".e_IMAGE."icons/".$download_category_icon."' alt='' style='float-left' />" : "&nbsp;");
+		$DOWNLOAD_CAT_MAIN_NAME .= $tp->toHTML($download_category_name);
+	} else {
+		$parent_status == "closed";
+	}
+	return(preg_replace("/\{(.*?)\}/e", '$\1', $template));
+}
+
+function parse_download_cat_child_table($row, $subList)
+{
+
+	global $tp,$current_row, $DOWNLOAD_CAT_CHILD_TABLE, $DOWNLOAD_CAT_SUBSUB_TABLE;
+
+	$current_row = ($current_row) ? 0 : 1;  // Alternating CSS for each row.(backwards compatible)
+	$template = ($current_row == 1) ? $DOWNLOAD_CAT_CHILD_TABLE : str_replace("forumheader3","forumheader3 forumheader3_alt",$DOWNLOAD_CAT_CHILD_TABLE);
+
+
+	if(USER && $row['d_last'] > USERLV){
+		$new = "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' />";
+	}else{
+		$new = "";
+	}
+
+	list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $row['download_category_icon']);
+	if (!$download_category_icon_empty)
+	{
+		$download_category_icon_empty = $download_category_icon;
+	}
+
+	if(!$row['d_count'] && !$row['d_subcount'])
+	{
+		$download_icon = "<img src='".e_IMAGE."icons/{$download_category_icon_empty}' alt='' style='float-left' />";
+	}
+	else
+	{
+		$download_icon = "<img src='".e_IMAGE."icons/{$download_category_icon}' alt='' style='float-left' />";
+	}
+
+	$DOWNLOAD_CAT_SUB_ICON = ($row['download_category_icon'] ? $download_icon : "&nbsp;");
+	$DOWNLOAD_CAT_SUB_NEW_ICON = $new;
+	$DOWNLOAD_CAT_SUB_NAME = ($row['d_count'] ? "<a href='".e_SELF."?list.".$row['download_category_id']."'>".$tp->toHTML($row['download_category_name'])."</a>" : $tp->toHTML($row['download_category_name']));
+	$DOWNLOAD_CAT_SUB_NAME_LINKED = "<a href='".e_SELF."?list.".$row['download_category_id']."'>".$tp->toHTML($row['download_category_name'])."</a>";
+	$DOWNLOAD_CAT_SUB_DESCRIPTION = $tp->toHTML($row['download_category_description']);
+	$DOWNLOAD_CAT_SUB_COUNT = ($row['d_subcount'] ? $row['d_subcount'] : $row['d_count']);
+	$DOWNLOAD_CAT_SUB_SIZE = parsesize(($row['d_subsize'] ? $row['d_subsize'] : $row['d_size']));
+	$DOWNLOAD_CAT_SUB_DOWNLOADED = intval(($row['d_subrequests'] ? $row['d_subrequests'] : $row['d_requests']));
+	$DOWNLOAD_CAT_SUBSUB = "";
+	// check for subsub cats ...
+	if($subList != FALSE)
+	{
+		foreach($subList as $subrow){
+
+
+			list($sub_download_category_icon, $sub_download_category_icon_empty) = explode(chr(1), $subrow['download_category_icon']);
+			if (!$sub_download_category_icon_empty)
+			{
+				$sub_download_category_icon_empty = $sub_download_category_icon;
+			}
+
+			if(!$row['d_count'] && !$row['d_subcount'])
+			{
+				$sub_download_icon = "<img src='".e_IMAGE."icons/{$sub_download_category_icon_empty}' alt='' style='float-left' />";
+			}
+			else
+			{
+				$sub_download_icon = "<img src='".e_IMAGE."icons/{$sub_download_category_icon}' alt='' style='float-left' />";
+			}
+
+			$DOWNLOAD_CAT_SUBSUB_ICON = ($subrow['download_category_icon'] ? "$sub_download_icon" : "&nbsp;");
+			$DOWNLOAD_CAT_SUBSUB_DESCRIPTION = $tp->toHTML($subrow['download_category_description']);
+			$DOWNLOAD_CAT_SUBSUB_COUNT = intval($subrow['d_count']);
+			$DOWNLOAD_CAT_SUBSUB_SIZE = parsesize($subrow['d_size']);
+			$DOWNLOAD_CAT_SUBSUB_DOWNLOADED = intval($subrow['d_requests']);
+
+			if(USER && $subrow['d_last'] > USERLV)	{
+				$new = "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' />";
+			}else {
+				$new = "";
+			}
+			$DOWNLOAD_CAT_SUBSUB_NEW_ICON = $new;
+			$DOWNLOAD_CAT_SUBSUB_NAME = $new.($subrow['d_count'] ? "<a href='".e_SELF."?list.".$subrow['download_category_id']."'>".$tp->toHTML($subrow['download_category_name'])."</a>" : $tp->toHTML($subrow['download_category_name']));
+			$DOWNLOAD_CAT_SUBSUB .= preg_replace("/\{(.*?)\}/e", '$\1', $DOWNLOAD_CAT_SUBSUB_TABLE);
+		}
+	}
+
+	return(preg_replace("/\{(.*?)\}/e", '$\1', $template));
+}
+
+
+function parse_download_list_table($row) {
+	global $download_shortcodes,$tp,$current_row,$DOWNLOAD_LIST_TABLE, $rater, $pref, $gen, $agreetext;
+
+	$current_row = ($current_row) ? 0 : 1;  // Alternating CSS for each row.(backwards compatible)
+	$template = ($current_row == 1) ? $DOWNLOAD_LIST_TABLE : str_replace("forumheader3","forumheader3 forumheader3_alt",$DOWNLOAD_LIST_TABLE);
+
+	return $tp->parseTemplate($template,TRUE,$download_shortcodes);
+
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_6171_readme.txt 75/e107_6171_readme.txt
--- 6171/e107_6171_readme.txt	2005-05-13 06:54:17.000000000 -0500
+++ 75/e107_6171_readme.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1,12 +0,0 @@
-5/13/2005
-
-This is security and small bugfix release for e107 version 0.617.  I would like to thank bkwon for the great fixes in his snippet library over at e107faq.org.
-
-* Fixed Security issues posted on e107.org
-* Fixed bugs using fixes posted on e107faq.org
-	* Emoticons now work in PM plugin
-	* Links marked as admin only no longer show for members
-	* Upload language phrases now present
-	* Printer and Email icons now work with articles
-	* BBcode buttons on signature (during signup) now work
-	* New article categories no longer counted as new articles
diff -ruN 6171/e107_admin/ad_links.php 75/e107_admin/ad_links.php
--- 6171/e107_admin/ad_links.php	2004-07-12 06:34:34.000000000 -0500
+++ 75/e107_admin/ad_links.php	2006-02-16 15:51:39.000000000 -0600
@@ -1,45 +1,465 @@
-<?php
-
-// Info about attributes
-/*
-attribute 1 = link
-attribute 2 = title
-attribute 3 = description
-attribute 4 = perms
-attribute 5 = category
-*/
-
-$array_functions = array(
-        0 => array(e_ADMIN."administrator.php", ADLAN_8, ADLAN_9, "3", 2),
-        1 => array(e_ADMIN."updateadmin.php", ADLAN_10, ADLAN_11, "", 2),
-        2 => array(e_ADMIN."article.php", ADLAN_14, ADLAN_15, "J", 3),
-        3 => array(e_ADMIN."banlist.php", ADLAN_34, ADLAN_35, "4", 2),
-        4 => array(e_ADMIN."banner.php", ADLAN_54, ADLAN_55, "D", 6),
-        5 => array(e_ADMIN."cache.php", ADLAN_74, ADLAN_75, "0", 1),
-        6 => array(e_ADMIN."chatbox.php", ADLAN_56, ADLAN_57, "C", 4),
-        7 => array(e_ADMIN."content.php", ADLAN_16, ADLAN_17, "L", 3),
-        8 => array(e_ADMIN."custommenu.php", ADLAN_42, ADLAN_43, "2", 6),
-        9 => array(e_ADMIN."db.php",ADLAN_44, ADLAN_45,"0", 1),
-        10 => array(e_ADMIN."download.php", ADLAN_24, ADLAN_25, "R", 5),
-        11 => array(e_ADMIN."emoticon.php", ADLAN_58, ADLAN_59, "F", 6),
-        12 => array(e_ADMIN."filemanager.php", ADLAN_30, ADLAN_31, "6", 5),
-        13 => array(e_ADMIN."forum.php", ADLAN_12, ADLAN_13, "5", 4),
-        14 => array(e_ADMIN."frontpage.php", ADLAN_60, ADLAN_61, "G", 1),
-        15 => array(e_ADMIN."image.php", ADLAN_105, ADLAN_106, "5", 6),
-        16 => array(e_ADMIN."links.php", ADLAN_20, ADLAN_21, "I", 3),
-        17 => array(e_ADMIN."wmessage.php", ADLAN_28, ADLAN_29, "M", 3),
-        18 => array(e_ADMIN."log.php", ADLAN_64, ADLAN_65, "S", 1),
-        19 => array(e_ADMIN."ugflag.php", ADLAN_40, ADLAN_41, "9", 1),
-        20 => array(e_ADMIN."menus.php", ADLAN_6, ADLAN_7, "2", 1),
-        21 => array(e_ADMIN."meta.php", ADLAN_66, ADLAN_67, "T", 1),
-        22 => array(e_ADMIN."newspost.php", ADLAN_0, ADLAN_1, "H", 3),
-        23 => array(e_ADMIN."newsfeed.php", ADLAN_62, ADLAN_63, "E", 6),
-        24 => array(e_ADMIN."phpinfo.php", ADLAN_68, ADLAN_69, "0", 6),
-        25 => array(e_ADMIN."poll.php", ADLAN_70, ADLAN_71, "U", 6),
-        26 => array(e_ADMIN."prefs.php", ADLAN_4, ADLAN_5, "1", 1),
-        27 => array(e_ADMIN."upload.php", ADLAN_72, ADLAN_73, "V", 5),
-        28 => array(e_ADMIN."review.php", ADLAN_18, ADLAN_19, "K", 3),
-        29 => array(e_ADMIN."users.php", ADLAN_36, ADLAN_37, "4", 2),
-        30 => array(e_ADMIN."userclass2.php", ADLAN_38, ADLAN_39, "4", 2)
-);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/ad_links.php,v $
+|     $Revision: 1.36 $
+|     $Date: 2006/02/16 21:51:39 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if (file_exists(THEME.'admin_images/admin_images.php')) {
+	e107_require_once(THEME.'admin_images/admin_images.php');
+}
+
+// Small Category Images
+if (!defined('E_16_CAT_SETT')) {
+	define('E_16_CAT_SETT', e_IMAGE.'admin_images/cat_settings_16.png');
+}
+if (!defined('E_16_CAT_USER')) {
+	define('E_16_CAT_USER', e_IMAGE.'admin_images/cat_users_16.png');
+}
+if (!defined('E_16_CAT_CONT')) {
+	define('E_16_CAT_CONT', e_IMAGE.'admin_images/cat_content_16.png');
+}
+if (!defined('E_16_CAT_FILE')) {
+	define('E_16_CAT_FILE', e_IMAGE.'admin_images/cat_files_16.png');
+}
+if (!defined('E_16_CAT_TOOL')) {
+	define('E_16_CAT_TOOL', e_IMAGE.'admin_images/cat_tools_16.png');
+}
+if (!defined('E_16_CAT_PLUG')) {
+	define('E_16_CAT_PLUG', e_IMAGE.'admin_images/cat_plugins_16.png');
+}
+
+// Large Category Images
+if (!defined('E_32_CAT_SETT')) {
+	define('E_32_CAT_SETT', "<img src='".e_IMAGE."admin_images/cat_settings_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_CAT_USER')) {
+	define('E_32_CAT_USER', "<img src='".e_IMAGE."admin_images/cat_users_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_CAT_CONT')) {
+	define('E_32_CAT_CONT', "<img src='".e_IMAGE."admin_images/cat_content_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_CAT_FILE')) {
+	define('E_32_CAT_FILE', "<img src='".e_IMAGE."admin_images/cat_files_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_CAT_TOOL')) {
+	define('E_32_CAT_TOOL', "<img src='".e_IMAGE."admin_images/cat_tools_32.png' alt='' style='border:0px; width:32px; height:32px' />");
+}
+if (!defined('E_32_CAT_PLUG')) {
+	define('E_32_CAT_PLUG', "<img src='".e_IMAGE."admin_images/cat_plugins_32.png' alt='' style='border:0px; width:32px; height:32px' />");
+}
+
+// Small Nav Images
+if (!defined('E_16_NAV_MAIN')) {
+	define('E_16_NAV_MAIN', e_IMAGE.'admin_images/main_16.png');
+}
+if (!defined('E_16_NAV_DOCS')) {
+	define('E_16_NAV_DOCS', e_IMAGE.'admin_images/docs_16.png');
+}
+if (!defined('E_16_NAV_LEAV')) {
+	define('E_16_NAV_LEAV', e_IMAGE.'admin_images/leave_16.png');
+}
+if (!defined('E_16_NAV_LGOT')) {
+	define('E_16_NAV_LGOT', e_IMAGE.'admin_images/logout_16.png');
+}
+if (!defined('E_16_NAV_ARROW')) {
+	define('E_16_NAV_ARROW', e_IMAGE.'admin_images/arrow_16.png');
+}
+if (!defined('E_16_NAV_ARROW_OVER')) {
+	define('E_16_NAV_ARROW_OVER', e_IMAGE.'admin_images/arrow_over_16.png');
+}
+
+// Large Nav Images
+if (!defined('E_32_NAV_MAIN')) {
+	define('E_32_NAV_MAIN', "<img src='".e_IMAGE."'admin_images/main_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_NAV_DOCS')) {
+	define('E_32_NAV_DOCS', "<img src='".e_IMAGE."'admin_images/docs_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_NAV_LEAV')) {
+	define('E_32_NAV_LEAV', "<img src='".e_IMAGE."'admin_images/leave_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_NAV_LGOT')) {
+	define('E_32_NAV_LGOT', "<img src='".e_IMAGE."'admin_images/logout_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_NAV_ARROW')) {
+	define('E_32_NAV_ARROW', "<img src='".e_IMAGE."'admin_images/arrow_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_NAV_ARROW_OVER')) {
+	define('E_32_NAV_ARROW_OVER', "<img src='".e_IMAGE."'admin_images/arrow_over_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+
+// Small Admin Main Link Images
+if (!defined('E_16_ADMIN')) {
+	define('E_16_ADMIN', "<img src='".e_IMAGE."admin_images/admins_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_ADPASS')) {
+	define('E_16_ADPASS', "<img src='".e_IMAGE."admin_images/adminpass_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_BANLIST')) {
+	define('E_16_BANLIST', "<img src='".e_IMAGE."admin_images/banlist_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_BANNER')) {
+	define('E_16_BANNER', "<img src='".e_IMAGE."admin_images/banners_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_CACHE')) {
+	define('E_16_CACHE', "<img src='".e_IMAGE."admin_images/cache_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_CREDITS')) {
+	define('E_16_CREDITS', "<img src='".e_IMAGE."admin_images/credits_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_CUST')) {
+	define('E_16_CUST', "<img src='".e_IMAGE."admin_images/custom_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_DATAB')) {
+	define('E_16_DATAB', "<img src='".e_IMAGE."admin_images/database_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_DOWNL')) {
+	define('E_16_DOWNL', "<img src='".e_IMAGE."admin_images/downloads_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_EMOTE')) {
+	define('E_16_EMOTE', "<img src='".e_IMAGE."admin_images/emoticons_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_FILE')) {
+	define('E_16_FILE', "<img src='".e_IMAGE."admin_images/filemanager_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_FORUM')) {
+	define('E_16_FORUM', "<img src='".e_IMAGE."admin_images/forums_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_FRONT')) {
+	define('E_16_FRONT', "<img src='".e_IMAGE."admin_images/frontpage_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_IMAGES')) {
+	define('E_16_IMAGES', "<img src='".e_IMAGE."admin_images/images_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_INSPECT')) {
+	define('E_16_INSPECT', "<img src='".e_IMAGE."admin_images/fileinspector_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_LINKS')) {
+	define('E_16_LINKS', "<img src='".e_IMAGE."admin_images/links_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_WELCOME')) {
+	define('E_16_WELCOME', "<img src='".e_IMAGE."admin_images/welcome_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_MAIL')) {
+	define('E_16_MAIL', "<img src='".e_IMAGE."admin_images/mail_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_MAINTAIN')) {
+	define('E_16_MAINTAIN', "<img src='".e_IMAGE."admin_images/maintain_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_MENUS')) {
+	define('E_16_MENUS', "<img src='".e_IMAGE."admin_images/menus_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_META')) {
+	define('E_16_META', "<img src='".e_IMAGE."admin_images/meta_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_NEWS')) {
+	define('E_16_NEWS', "<img src='".e_IMAGE."admin_images/news_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_NEWSFEED')) {
+	define('E_16_NEWSFEED', "<img src='".e_IMAGE."admin_images/newsfeeds_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_NOTIFY')) {
+	define('E_16_NOTIFY', "<img src='".e_IMAGE."admin_images/notify_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_PHP')) {
+	define('E_16_PHP', "<img src='".e_IMAGE."admin_images/phpinfo_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_POLLS')) {
+	define('E_16_POLLS', "<img src='".e_IMAGE."admin_images/polls_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_PREFS')) {
+	define('E_16_PREFS', "<img src='".e_IMAGE."admin_images/prefs_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_SEARCH')) {
+	define('E_16_SEARCH', "<img src='".e_IMAGE."admin_images/search_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_UPLOADS')) {
+	define('E_16_UPLOADS', "<img src='".e_IMAGE."admin_images/uploads_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_USER')) {
+	define('E_16_USER', "<img src='".e_IMAGE."admin_images/users_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_USER_EXTENDED')) {
+	define('E_16_USER_EXTENDED', "<img src='".e_IMAGE."admin_images/extended_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_USERCLASS')) {
+	define('E_16_USERCLASS', "<img src='".e_IMAGE."admin_images/userclass_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_LANGUAGE')) {
+	define('E_16_LANGUAGE', "<img src='".e_IMAGE."admin_images/language_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+
+// Small Admin Other Link Images
+if (!defined('E_16_PLUGIN')) {
+	define('E_16_PLUGIN', "<img src='".e_IMAGE."admin_images/plugins_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_PLUGMANAGER')) {
+	define('E_16_PLUGMANAGER', "<img src='".e_IMAGE."admin_images/plugmanager_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_DOCS')) {
+	define('E_16_DOCS', "<img src='".e_IMAGE."admin_images/docs_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_THEMEMANAGER')) {
+	define('E_16_THEMEMANAGER', "<img src='".e_IMAGE."admin_images/themes_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+
+// Small Admin Other Images
+if (!defined('E_16_COMMENT')) {
+	define('E_16_COMMENT', "<img src='".e_IMAGE."admin_images/comments_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+if (!defined('E_16_ADMINLOG')) {
+	define('E_16_ADMINLOG', "<img src='".e_IMAGE."admin_images/adminlogs_16.png' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />");
+}
+
+// Large Admin Main Link Images
+if (!defined('E_32_ADMIN')) {
+	define('E_32_ADMIN', "<img src='".e_IMAGE."admin_images/admins_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_ADPASS')) {
+	define('E_32_ADPASS', "<img src='".e_IMAGE."admin_images/adminpass_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_BANLIST')) {
+	define('E_32_BANLIST', "<img src='".e_IMAGE."admin_images/banlist_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_BANNER')) {
+	define('E_32_BANNER', "<img src='".e_IMAGE."admin_images/banners_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_CACHE')) {
+	define('E_32_CACHE', "<img src='".e_IMAGE."admin_images/cache_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_CREDITS')) {
+	define('E_32_CREDITS', "<img src='".e_IMAGE."admin_images/credits_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_CUST')) {
+	define('E_32_CUST', "<img src='".e_IMAGE."admin_images/custom_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_DATAB')) {
+	define('E_32_DATAB', "<img src='".e_IMAGE."admin_images/database_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_DOWNL')) {
+	define('E_32_DOWNL', "<img src='".e_IMAGE."admin_images/downloads_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_EMOTE')) {
+	define('E_32_EMOTE', "<img src='".e_IMAGE."admin_images/emoticons_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_FILE')) {
+	define('E_32_FILE', "<img src='".e_IMAGE."admin_images/filemanager_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_FORUM')) {
+	define('E_32_FORUM', "<img src='".e_IMAGE."admin_images/forums_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_FRONT')) {
+	define('E_32_FRONT', "<img src='".e_IMAGE."admin_images/frontpage_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_IMAGES')) {
+	define('E_32_IMAGES', "<img src='".e_IMAGE."admin_images/images_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_INSPECT')) {
+	define('E_32_INSPECT', "<img src='".e_IMAGE."admin_images/fileinspector_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_LINKS')) {
+	define('E_32_LINKS', "<img src='".e_IMAGE."admin_images/links_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_WELCOME')) {
+	define('E_32_WELCOME', "<img src='".e_IMAGE."admin_images/welcome_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_MAIL')) {
+	define('E_32_MAIL', "<img src='".e_IMAGE."admin_images/mail_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_MAINTAIN')) {
+	define('E_32_MAINTAIN', "<img src='".e_IMAGE."admin_images/maintain_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_MENUS')) {
+	define('E_32_MENUS', "<img src='".e_IMAGE."admin_images/menus_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_META')) {
+	define('E_32_META', "<img src='".e_IMAGE."admin_images/meta_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_NEWS')) {
+	define('E_32_NEWS', "<img src='".e_IMAGE."admin_images/news_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_NEWSFEED')) {
+	define('E_32_NEWSFEED', "<img src='".e_IMAGE."admin_images/newsfeeds_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_NOTIFY')) {
+	define('E_32_NOTIFY', "<img src='".e_IMAGE."admin_images/notify_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_PHP')) {
+	define('E_32_PHP', "<img src='".e_IMAGE."admin_images/phpinfo_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_POLLS')) {
+	define('E_32_POLLS', "<img src='".e_IMAGE."admin_images/polls_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_PREFS')) {
+	define('E_32_PREFS', "<img src='".e_IMAGE."admin_images/prefs_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_SEARCH')) {
+	define('E_32_SEARCH', "<img src='".e_IMAGE."admin_images/search_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_UPLOADS')) {
+	define('E_32_UPLOADS', "<img src='".e_IMAGE."admin_images/uploads_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_USER')) {
+	define('E_32_USER', "<img src='".e_IMAGE."admin_images/users_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_USER_EXTENDED')) {
+	define('E_32_USER_EXTENDED', "<img src='".e_IMAGE."admin_images/extended_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_USERCLASS')) {
+	define('E_32_USERCLASS', "<img src='".e_IMAGE."admin_images/userclass_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_LANGUAGE')) {
+	define('E_32_LANGUAGE', "<img src='".e_IMAGE."admin_images/language_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+
+// Large Admin Other Link Images
+if (!defined('E_32_PLUGIN')) {
+	define('E_32_PLUGIN', "<img src='".e_IMAGE."admin_images/plugins_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_PLUGMANAGER')) {
+	define('E_32_PLUGMANAGER', "<img src='".e_IMAGE."admin_images/plugmanager_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_DOCS')) {
+	define('E_32_DOCS', "<img src='".e_IMAGE."admin_images/docs_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_MAIN')) {
+	define('E_32_MAIN', "<img src='".e_IMAGE."admin_images/main_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+
+if (!defined('E_32_THEMEMANAGER')) {
+	define('E_32_THEMEMANAGER', "<img src='".e_IMAGE."admin_images/themes_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+
+// Large Admin Other Images
+if (!defined('E_32_COMMENT')) {
+	define('E_32_COMMENT', "<img src='".e_IMAGE."admin_images/comments_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_ADMINLOG')) {
+	define('E_32_ADMINLOG', "<img src='".e_IMAGE."admin_images/adminlogs_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+if (!defined('E_32_LOGOUT')) {
+	define('E_32_LOGOUT', "<img src='".e_IMAGE."admin_images/logout_32.png' alt='' style='border:0px; width: 32px; height: 32px' />");
+}
+
+$e_icon_array = array(
+	'main' => E_32_MAIN,
+	'admin' => E_32_ADMIN,
+	'admin_pass' => E_32_ADPASS,
+	'banlist' => E_32_BANLIST,
+	'banner' => E_32_BANNER,
+	'cache' => E_32_CACHE,
+	'credits' => E_32_CREDITS,
+	'custom' => E_32_CUST,
+	'database' => E_32_DATAB,
+	'docs' => E_32_DOCS,
+	'download' => E_32_DOWNL,
+	'emoticon' => E_32_EMOTE,
+	'filemanage' => E_32_FILE,
+	'fileinspector' => E_32_INSPECT,
+	'frontpage' => E_32_FRONT,
+	'image' => E_32_IMAGES,
+	'language' => E_32_LANGUAGE,
+	'links' => E_32_LINKS,
+	'mail' => E_32_MAIL,
+	'menus' => E_32_MENUS,
+	'meta' => E_32_META,
+	'newsfeed' => E_32_NEWSFEED,
+	'news' => E_32_NEWS,
+	'notify' => E_32_NOTIFY,
+	'phpinfo' => E_32_PHP,
+	'plug_manage' => E_32_PLUGMANAGER,
+	'poll' => E_32_POLLS,
+	'prefs' => E_32_PREFS,
+	'search' => E_32_SEARCH,
+	'theme_manage' => E_32_THEMEMANAGER,
+	'maintain' => E_32_MAINTAIN,
+	'upload' => E_32_UPLOADS,
+	'userclass' => E_32_USERCLASS,
+	'user_extended' => E_32_USER_EXTENDED,
+	'users' => E_32_USER,
+	'wmessage' => E_32_WELCOME );
+
+$admin_cat['title'][1] = ADLAN_CL_1;
+$admin_cat['id'][1] = 'setMenu';
+$admin_cat['img'][1] = E_16_CAT_SETT;
+$admin_cat['lrg_img'][1] = E_32_CAT_SETT;
+
+$admin_cat['title'][2] = ADLAN_CL_2;
+$admin_cat['id'][2] = 'userMenu';
+$admin_cat['img'][2] = E_16_CAT_USER;
+$admin_cat['lrg_img'][2] = E_32_CAT_USER;
+
+$admin_cat['title'][3] = ADLAN_CL_3;
+$admin_cat['id'][3] = 'contMenu';
+$admin_cat['img'][3] = E_16_CAT_CONT;
+$admin_cat['lrg_img'][3] = E_32_CAT_CONT;
+
+$admin_cat['title'][4] = ADLAN_CL_6;
+$admin_cat['id'][4] = 'toolMenu';
+$admin_cat['img'][4] = E_16_CAT_TOOL;
+$admin_cat['lrg_img'][4] = E_32_CAT_TOOL;
+
+$admin_cat['title'][5] = ADLAN_CL_7;
+$admin_cat['id'][5] = 'plugMenu';
+$admin_cat['img'][5] = E_16_CAT_PLUG;
+$admin_cat['lrg_img'][5] = E_32_CAT_PLUG;
+
+// Info about attributes
+/*
+attribute 1 = link
+attribute 2 = title
+attribute 3 = description
+attribute 4 = perms
+attribute 5 = category
+attribute 6 = 16 x 16 image
+attribute 7 = 32 x 32 image
+*/
+
+$array_functions = array(
+	0 => array(e_ADMIN."administrator.php", ADLAN_8, ADLAN_9, "3", 2, E_16_ADMIN, E_32_ADMIN),
+	1 => array(e_ADMIN."updateadmin.php", ADLAN_10, ADLAN_11, "", 2, E_16_ADPASS, E_32_ADPASS),
+	2 => array(e_ADMIN."banlist.php", ADLAN_34, ADLAN_35, "4", 2, E_16_BANLIST, E_32_BANLIST),
+	3 => array(e_ADMIN."banner.php", ADLAN_54, ADLAN_55, "D", 3, E_16_BANNER, E_32_BANNER),
+	4 => array(e_ADMIN."cache.php", ADLAN_74, ADLAN_75, "C", 1, E_16_CACHE, E_32_CACHE),
+	5 => array(e_ADMIN."cpage.php", ADLAN_42, ADLAN_43, "5", 3, E_16_CUST, E_32_CUST),
+	6 => array(e_ADMIN."db.php", ADLAN_44, ADLAN_45, "0", 4, E_16_DATAB, E_32_DATAB),
+	7 => array(e_ADMIN."download.php", ADLAN_24, ADLAN_25, "R", 3, E_16_DOWNL, E_32_DOWNL),
+	8 => array(e_ADMIN."emoticon.php", ADLAN_58, ADLAN_59, "F", 1, E_16_EMOTE, E_32_EMOTE),
+	9 => array(e_ADMIN."filemanager.php", ADLAN_30, ADLAN_31, "6", 4, E_16_FILE, E_32_FILE),
+	10 => array(e_ADMIN."frontpage.php", ADLAN_60, ADLAN_61, "G", 1, E_16_FRONT, E_32_FRONT),
+	11 => array(e_ADMIN."image.php", ADLAN_105, ADLAN_106, "5", 1, E_16_IMAGES, E_32_IMAGES),
+	12 => array(e_ADMIN."links.php", ADLAN_138, ADLAN_139, "I", 1, E_16_LINKS, E_32_LINKS),
+	13 => array(e_ADMIN."wmessage.php", ADLAN_28, ADLAN_29, "M", 3, E_16_WELCOME, E_32_WELCOME),
+	14 => array(e_ADMIN."ugflag.php", ADLAN_40, ADLAN_41, "9", 4, E_16_MAINTAIN, E_32_MAINTAIN),
+	15 => array(e_ADMIN."menus.php", ADLAN_6, ADLAN_7, "2", 3, E_16_MENUS, E_32_MENUS),
+	16 => array(e_ADMIN."meta.php", ADLAN_66, ADLAN_67, "T", 1, E_16_META, E_32_META),
+	17 => array(e_ADMIN."newspost.php", ADLAN_0, ADLAN_1, "H", 3, E_16_NEWS, E_32_NEWS),
+	18 => array(e_ADMIN."phpinfo.php", ADLAN_68, ADLAN_69, "0", 4, E_16_PHP, E_32_PHP),
+	19 => array(e_ADMIN."prefs.php", ADLAN_4, ADLAN_5, "1", 1, E_16_PREFS, E_32_PREFS),
+	20 => array(e_ADMIN."search.php", ADLAN_142, ADLAN_143, "X", 1, E_16_SEARCH, E_32_SEARCH),
+	21 => array(e_ADMIN."theme.php", ADLAN_140, ADLAN_141, "1", 4, E_16_THEMEMANAGER, E_32_THEMEMANAGER),
+	22 => array(e_ADMIN."upload.php", ADLAN_72, ADLAN_73, "V", 3, E_16_UPLOADS, E_32_UPLOADS),
+	23 => array(e_ADMIN."users.php", ADLAN_36, ADLAN_37, "4", 2, E_16_USER, E_32_USER),
+	24 => array(e_ADMIN."userclass2.php", ADLAN_38, ADLAN_39, "4", 2, E_16_USERCLASS, E_32_USERCLASS),
+	25 => array(e_ADMIN."language.php", ADLAN_132, ADLAN_133, "0", 1, E_16_LANGUAGE, E_32_LANGUAGE),
+	26 => array(e_ADMIN."mailout.php", ADLAN_136, ADLAN_137, "W", 2, E_16_MAIL, E_32_MAIL),
+	27 => array(e_ADMIN."users_extended.php", ADLAN_78, ADLAN_79, "4", 2, E_16_USER_EXTENDED, E_32_USER_EXTENDED),
+	28 => array(e_ADMIN."fileinspector.php", ADLAN_147, ADLAN_148, "Y", 4, E_16_INSPECT, E_32_INSPECT),
+	29 => array(e_ADMIN."notify.php", ADLAN_149, ADLAN_150, "O", 4, E_16_NOTIFY, E_32_NOTIFY)
+	);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/adminb.php 75/e107_admin/adminb.php
--- 6171/e107_admin/adminb.php	2004-07-12 06:34:34.000000000 -0500
+++ 75/e107_admin/adminb.php	2005-01-27 13:52:24.000000000 -0600
@@ -1,128 +1,27 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/admin.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-require_once("auth.php");
-
-// auto db update ...
-if("0" == ADMINPERMS){
-        require_once(e_ADMIN."update_routines.php");
-        update_check();
-}
-//        end auto db update
-
-$tdc=0;
-
-function wad($link, $title, $description, $perms, $icon = FALSE){
-        global $tdc;
-        $permicon = ($icon ? e_PLUGIN.$icon : e_IMAGE."generic/hme.png");
-        if(getperms($perms)){
-                $tmp = "<tr>\n<td class='forumheader3' style='text-align:left; vertical-align:top; width:100%'
-                onmouseover='tdover(this)' onmouseout='tdnorm(this)'
-                onclick=\"document.location.href='$link'\">
-                <img src='$permicon' alt='$description' style='border:0; vertical-align:middle'/> <b>".$title."</b> ".($description ? "[ <span class='smalltext'>".$description."</span> ]" : "")."</td></tr>\n";
-        }
-        return $tmp;
-}
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>";
-
-require_once("ad_links.php");
-
-$newarray = asortbyindex ($array_functions, 1);
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>";
-
-while(list($key, $funcinfo) = each($newarray)){
-        $text .= wad($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3]);
-}
-
-if(!$tdc){ $text .= "</tr>"; }
-
-
-        $text .= "<tr>
-        <td colspan='5'>
-                <br />
-        <div class='border'><div class='caption'>Plugins</div></div></div>
-        </td>
-        <tr>";
-
-        $text .= wad(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", e_PLUGIN.e_IMAGE."generic/plugin.png");
-
-        if($sql -> db_Select("plugin", "*", "plugin_installflag=1")){
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        include(e_PLUGIN.$plugin_path."/plugin.php");
-                        if($eplug_conffile){
-                                $text .= wad(e_PLUGIN.$plugin_path."/".$eplug_conffile, $eplug_name, $eplug_caption, "P".$plugin_id, $eplug_icon);
-                }
-        }
-}
-$text .= "</tr>
-</table></div>";
-$ns -> tablerender("<div style='text-align:center'>".ADLAN_47." ".ADMINNAME."</div>", $text);
-require_once("footer.php");
-
-// Multi indice array sort by sweetland@whoadammit.com
-function asortbyindex ($sortarray, $index) {
-        $lastindex = count ($sortarray) - 1;
-        for ($subindex = 0; $subindex < $lastindex; $subindex++) {
-                $lastiteration = $lastindex - $subindex;
-                for ($iteration = 0; $iteration < $lastiteration;    $iteration++) {
-                        $nextchar = 0;
-                        if (comesafter ($sortarray[$iteration][$index], $sortarray[$iteration + 1][$index])) {
-                                $temp = $sortarray[$iteration];
-                                $sortarray[$iteration] = $sortarray[$iteration + 1];
-                                $sortarray[$iteration + 1] = $temp;
-                        }
-                }
-        }
-        return ($sortarray);
-}
-
-function comesafter ($s1, $s2) {
-        $order = 1;
-        if (strlen ($s1) > strlen ($s2)) {
-                $temp = $s1;
-                $s1 = $s2;
-                $s2 = $temp;
-                $order = 0;
-        }
-        for ($index = 0; $index < strlen ($s1); $index++) {
-                if ($s1[$index] > $s2[$index]) return ($order);
-                if ($s1[$index] < $s2[$index]) return (1 - $order);
-        }
-        return ($order);
-}
-
-
-function headerjs(){
-$script = "<script type=\"text/javascript\">
-function tdover(object) {
-  if (object.className == 'forumheader3') object.className = 'forumheader4';
-}
-
-function tdnorm(object) {
-  if (object.className == 'forumheader4') object.className = 'forumheader3';
-}
-</script>\n";
-
-return $script;
-
-}
-
-?>
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/adminb.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/01/27 19:52:24 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (ADMIN) {
+	header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
+	exit;
+} else {
+	header('Location:'.SITEURL.'index.php');
+	exit;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/admin_classis.php 75/e107_admin/admin_classis.php
--- 6171/e107_admin/admin_classis.php	2004-07-12 06:34:34.000000000 -0500
+++ 75/e107_admin/admin_classis.php	2005-01-27 13:52:24.000000000 -0600
@@ -1,112 +1,27 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/admin.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-require_once("auth.php");
-
-// auto db update ...
-if("0" == ADMINPERMS){
-	@require_once(e_ADMIN."update_routines.php");
-	@update_check();	
-}
-//	end auto db update
-
-
-$tdc=0;
-
-function wad($link, $title, $description, $perms, $icon = FALSE){
-	global $tdc;
-	$permicon = ($icon ? e_PLUGIN.$icon : e_IMAGE."generic/e107.gif");
-	if(getperms($perms)){
-		if(!$tdc){$tmp1 = "<tr>";}
-		if($tdc == 4){$tmp2 = "</tr>";$tdc=-1;}
-		$tdc++;
-		$tmp = $tmp1."<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."'><img src='$permicon' alt='$description' style='border:0'/></a><br /><a href='".$link."'><b>".$title."</b></a><br />".$description."<br /><br /></td>\n\n".$tmp2;
-	}
-	return $tmp;
-}
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>";
-
-require_once("ad_links.php");
-
-$newarray = asortbyindex ($array_functions, 1);
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>";
-
-while(list($key, $funcinfo) = each($newarray)){
-	$text .= wad($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3]);
-}
-
-if(!$tdc){ $text .= "</tr>"; }
-
-
-	$text .= "<tr>
-	<td colspan='5'>
-	<div class='border'><div class='caption'>Plugins</div></div></div>
-	<br />
-	</td>
-	<tr>";
-
-        $text .= wad(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", e_PLUGIN.e_IMAGE."generic/plugin.png");
-
-	if($sql -> db_Select("plugin", "*", "plugin_installflag=1")){
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			include(e_PLUGIN.$plugin_path."/plugin.php");
-			if($eplug_conffile){
-                                $text .= wad(e_PLUGIN.$plugin_path."/".$eplug_conffile, $eplug_name, $eplug_caption, "P".$plugin_id, $eplug_icon);
-		}
-	}
-}
-$text .= "</tr>
-</table></div>";
-$ns -> tablerender("<div style='text-align:center'>".ADLAN_47." ".ADMINNAME."</div>", $text);
-require_once("footer.php");
-
-// Multi indice array sort by sweetland@whoadammit.com
-function asortbyindex ($sortarray, $index) {
-	$lastindex = count ($sortarray) - 1;
-	for ($subindex = 0; $subindex < $lastindex; $subindex++) {
-		$lastiteration = $lastindex - $subindex;
-		for ($iteration = 0; $iteration < $lastiteration;    $iteration++) {
-			$nextchar = 0;
-			if (comesafter ($sortarray[$iteration][$index], $sortarray[$iteration + 1][$index])) {
-				$temp = $sortarray[$iteration];
-				$sortarray[$iteration] = $sortarray[$iteration + 1];
-				$sortarray[$iteration + 1] = $temp;
-			}
-		}
-	}
-	return ($sortarray);
-}
-
-function comesafter ($s1, $s2) {
-	$order = 1;
-	if (strlen ($s1) > strlen ($s2)) {
-		$temp = $s1;
-		$s1 = $s2;
-		$s2 = $temp;
-		$order = 0;
-	}
-	for ($index = 0; $index < strlen ($s1); $index++) {
-		if ($s1[$index] > $s2[$index]) return ($order);
-		if ($s1[$index] < $s2[$index]) return (1 - $order);
-	}
-	return ($order);
-}
-
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/admin_classis.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/01/27 19:52:24 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (ADMIN) {
+	header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
+	exit;
+} else {
+	header('Location:'.SITEURL.'index.php');
+	exit;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/admin_combo.php 75/e107_admin/admin_combo.php
--- 6171/e107_admin/admin_combo.php	2004-07-19 18:03:02.000000000 -0500
+++ 75/e107_admin/admin_combo.php	2005-01-27 13:52:24.000000000 -0600
@@ -1,216 +1,27 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/admin.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-require_once("auth.php");
-
-
-// auto db update ...
-if("0" == ADMINPERMS){
-        require_once(e_ADMIN."update_routines.php");
-        update_check();
-}
-//        end auto db update
-
-if(e_QUERY == "purge"){
-        $sql -> db_Delete("tmp", "tmp_ip='adminlog' ");
-}
-
-$tdc=0;
-$tdt=0;
-function wad($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE){
-        global $tdc;
-        $permicon = ($mode == TRUE ? e_IMAGE."generic/rname.png" : e_IMAGE."generic/location.png");
-        if(getperms($perms)){
-                if(!$tdc){$tmp1 = "<tr>";}
-                if($tdc == 4){$tmp2 = "</tr>";$tdc=-1;}
-                $tdc++;
-                $tmp = $tmp1."<td class='td' style='text-align:left; vertical-align:top; width:20%; whitespace:nowrap' onmouseover='tdover(this)' onmouseout='tdnorm(this)'
-                onclick=\"document.location.href='$link'\"><img src='$permicon' alt='$description' style='border:0; vertical-align:middle'/> $title</td>\n\n".$tmp2;
-        }
-        return $tmp;
-}
-
-function wad2($link, $title, $description, $perms, $icon = FALSE){
-        global $tdt;
-        $permicon = ($icon ? e_PLUGIN.$icon : e_IMAGE."generic/e107.gif");
-        if(getperms($perms)){
-             //  if($tdt == 0){$tmp1 = "<tr>";}
-                if($tdt == 4){$tmp2 = "</tr><tr>";$tdt=-1;}
-                $tdt++;
-                $tmp = $tmp1."<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."'><img src='$permicon' alt='$description' style='border:0'/></a><br /><a href='".$link."'><b>".$title."</b></a><br />".$description."<br /><br /></td>\n\n".$tmp2;
-        }
-        return $tmp;
-}
-
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>";
-
-require_once("ad_links.php");
-
-$newarray = asortbyindex ($array_functions, 1);
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>";
-
-while(list($key, $funcinfo) = each($newarray)){
-        $text .= wad($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3]);
-}
-
-if(!$tdc){ $text .= "</tr>"; }
-$text3="";
-
-
-if(getperms("Z")){ // Plugin Manager
-        $text3 .= wad2(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "P0", e_PLUGIN.e_IMAGE."generic/plugin.png");
-}
-
-        if($sql -> db_Select("plugin", "*", "plugin_installflag=1")){
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        include(e_PLUGIN.$plugin_path."/plugin.php");
-                        if($eplug_conffile){
-                                $text3 .= wad2(e_PLUGIN.$plugin_path."/".$eplug_conffile, $eplug_name, $eplug_caption, "P".$plugin_id, $eplug_icon);
-                        }
-                }
-        }
-
-$text .= "</tr></table></div>";
-$ns -> tablerender("<div style='text-align:center'>".ADLAN_47." ".ADMINNAME."</div>", $text);
-
-if($text3){  // Only render if some kind of P access exists.
- $ns -> tablerender("<div style='text-align:center'>Plugins</div>", "<table><tr>".$text3."</tr></table>");
-}
-
-
-// info -------------------------------------------------------
-
-$members = $sql -> db_Count("user");
-$unverified = $sql -> db_Count("user", "(*)", "WHERE user_ban=2");
-$banned = $sql -> db_Count("user", "(*)", "WHERE user_ban=1");
-$chatbox_posts = $sql -> db_Count("chatbox");
-$forum_posts = $sql -> db_Count("forum_t");
-$comments = $sql -> db_Count("comments");
-$permicon = "<img src='".e_IMAGE."generic/location.png' alt='' style='vertical-align:middle' /> ";
-$permicon2 = "<img src='".e_IMAGE."generic/rname.png' alt='' style='vertical-align:middle' /> ";
-$active_uploads = $sql -> db_Select("upload", "*", "upload_active=0");
-$submitted_links = $sql -> db_Select("tmp", "*", "tmp_ip='submitted_link' ");
-$submitted_news = $sql -> db_Select("submitnews", "*", "submitnews_auth ='0' ");
-$submitted_articles = $sql -> db_Select("content", "*", "content_type ='15' ");
-$submitted_reviews = $sql -> db_Select("content", "*", "content_type ='16' ");
-$reported_posts = $sql -> db_Select("tmp", "*", "tmp_ip='reported_post' ");
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>
-<tr>
-<td style='width:50%'>";
-
-
-$text .= $permicon.ADLAN_110.": ".$members."<br />";
-$text .= $permicon.ADLAN_111.": ".$unverified."<br />";
-$text .= $permicon.ADLAN_112.": ".$banned."<br />";
-
-$text .= ($submitted_news ? $permicon2."<a href='".e_ADMIN."newspost.php?sn'>".ADLAN_107.": $submitted_news</a>" : $permicon.ADLAN_107.": 0")."<br />";
-$text .= ($submitted_articles ? $permicon2."<a href='".e_ADMIN."article.php?sa'>".ADLAN_123.": $submitted_articles</a>" : $permicon.ADLAN_123.": ".$submitted_articles)."<br />";
-$text .= ($submitted_reviews ? $permicon2."<a href='".e_ADMIN."review.php?sa'>".ADLAN_124.": $submitted_reviews</a>" : $permicon.ADLAN_124.": ".$submitted_reviews)."<br />";
-$text .= ($submitted_links ? $permicon2."<a href='".e_ADMIN."links.php?sn'>".ADLAN_119.": $submitted_links</a>" : $permicon.ADLAN_119.": ".$submitted_links)."<br /><br />";
-
-$text .= ($reported_posts ? $permicon2."<a href='".e_ADMIN."forum.php?sr'>".ADLAN_125.": $reported_posts</a>" : $permicon.ADLAN_125.": ".$reported_posts)."<br /><br />";
-
-$text .= ($active_uploads ? $permicon2."<a href='".e_ADMIN."upload.php'>".ADLAN_108.": $active_uploads</a>" : $permicon.ADLAN_108.": ".$active_uploads)."<br />";
-
-$text .= $permicon.ADLAN_113.": ".$forum_posts."<br />";
-$text .= $permicon.ADLAN_114.": ".$comments."<br />";
-$text .= $permicon.ADLAN_115.": ".$chatbox_posts;
-
-$text .= "</td>
-<td style='width:50%; vertical-align:top'>";
-
-$text .= $permicon." <a style='cursor: pointer; cursor: hand' onclick=\"expandit(this)\">".ADLAN_116."</a>\n";
-if(e_QUERY != "logall"){
-        $text .= "<div style='display: none;'>";
-}
-if(e_QUERY == "logall"){
-        $sql -> db_Select("tmp", "*", "tmp_ip='adminlog' ORDER BY tmp_time DESC");
-}else{
-        $sql -> db_Select("tmp", "*", "tmp_ip='adminlog' ORDER BY tmp_time DESC LIMIT 0,10");
-}
-$text .= "<ul>";
-$gen = new convert;
-while($row = $sql -> db_Fetch()){
-        extract($row);
-        $datestamp = $gen->convert_date($tmp_time, "short");
-        $text .= "<li>".$datestamp.$tmp_info."</li>";
-}
-$text .= "</ul>";
-
-$text .= "[ <a href='".e_SELF."?logall'>".ADLAN_117."</a> ][ <a href='".e_SELF."?purge'>".ADLAN_118."</a> ]\n</div>
-</td></tr></table></div>
-
-";
-
-$ns -> tablerender(ADLAN_109, $text);
-require_once("footer.php");
-
-// Multi indice array sort by sweetland@whoadammit.com
-function asortbyindex ($sortarray, $index) {
-        $lastindex = count ($sortarray) - 1;
-        for ($subindex = 0; $subindex < $lastindex; $subindex++) {
-                $lastiteration = $lastindex - $subindex;
-                for ($iteration = 0; $iteration < $lastiteration;    $iteration++) {
-                        $nextchar = 0;
-                        if (comesafter ($sortarray[$iteration][$index], $sortarray[$iteration + 1][$index])) {
-                                $temp = $sortarray[$iteration];
-                                $sortarray[$iteration] = $sortarray[$iteration + 1];
-                                $sortarray[$iteration + 1] = $temp;
-                        }
-                }
-        }
-        return ($sortarray);
-}
-
-function comesafter ($s1, $s2) {
-        $order = 1;
-        if (strlen ($s1) > strlen ($s2)) {
-                $temp = $s1;
-                $s1 = $s2;
-                $s2 = $temp;
-                $order = 0;
-        }
-        for ($index = 0; $index < strlen ($s1); $index++) {
-                if ($s1[$index] > $s2[$index]) return ($order);
-                if ($s1[$index] < $s2[$index]) return (1 - $order);
-        }
-        return ($order);
-}
-
-function headerjs(){
-$script = "<script type=\"text/javascript\">
-function tdover(object) {
-  if (object.className == 'td') object.className = 'forumheader5';
-}
-
-function tdnorm(object) {
-  if (object.className == 'forumheader5') object.className = 'td';
-}
-
-</script>\n";
-
- return $script;
-
-}
-
-
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/admin_combo.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/01/27 19:52:24 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (ADMIN) {
+	header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
+	exit;
+} else {
+	header('Location:'.SITEURL.'index.php');
+	exit;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/admin_etalkers.php 75/e107_admin/admin_etalkers.php
--- 6171/e107_admin/admin_etalkers.php	2004-07-12 06:34:34.000000000 -0500
+++ 75/e107_admin/admin_etalkers.php	2005-01-27 13:52:24.000000000 -0600
@@ -1,221 +1,27 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/admin.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-require_once("auth.php");
-
-
-// auto db update ...
-if("0" == ADMINPERMS){
-        @require_once(e_ADMIN."update_routines.php");
-        @update_check();
-}
-//        end auto db update
-
-if(e_QUERY == "purge"){
-        $sql -> db_Delete("tmp", "tmp_ip='adminlog' ");
-}
-
-$tdc=0;
-function wad($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE){
-        global $tdc;
-        $permicon = ($mode == TRUE ? e_IMAGE."generic/rname.png" : e_IMAGE."generic/location.png");
-        if(getperms($perms)){
-                if(!$tdc){$tmp1 = "<tr>";}
-                if($tdc == 4){$tmp2 = "</tr>";$tdc=-1;}
-                $tdc++;
-                $tmp = $tmp1."<td class='td' style='text-align:left; vertical-align:top; width:20%; whitespace:nowrap' onmouseover='tdover(this)' onmouseout='tdnorm(this)'
-                onclick=\"document.location.href='$link'\"><img src='$permicon' alt='$description' style='border:0; vertical-align:middle'/> $title</td>\n\n".$tmp2;
-        }
-        return $tmp;
-}
-
-require_once("ad_links.php");
-
-
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>
-<tr>
-<td colspan='5' >";
-
-$texto = array();
-$texto[1] = ADLAN_126;
-$texto[2] = ADLAN_127;
-$texto[3] = ADLAN_128;
-$texto[4] = ADLAN_129;
-$texto[5] = ADLAN_130;
-$texto[6] = ADLAN_131;
-$texto[7] = ADLAN_95;
-
-$tit_css = " style=\"border: 1px solid #c00; background-color: #fff; padding: 0px 3px 0px 3px;\" ";
-
-for($i=1;$i<7;$i++){
-	$tmpi = 0;
-	$newarray = asortbyindex ($array_functions, 1);
-	$texti = "<b{$tit_css}> ".$texto[$i]." </b></td></tr>";
-	while(list($key, $funcinfo) = each($newarray)){
-			if($funcinfo[4]==$i){
-				$texti .= wad($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3]);
-				$tmpi = 1;
-			}
-	}
-	if(!$tdc){ $texti .= "</tr>"; }
-	$texti .= "<tr><td colspan='5' ><hr /></td></tr><tr><td colspan='5' >";
-	$tdc=0;
-	if($tmpi == 1){$text .= $texti;}
-}
-
-
-unset($tdc);
-
-$text .= "</tr>
-<tr>
-<td colspan='5' ><b{$tit_css}> ".$texto[7]." </b></td></tr>";
-
-$text .= wad(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", "", TRUE);
-
-if($sql -> db_Select("plugin", "*", "plugin_installflag=1")){
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                include(e_PLUGIN.$plugin_path."/plugin.php");
-                if($eplug_conffile){
-                        $text .= wad(e_PLUGIN.$plugin_path."/".$eplug_conffile, $eplug_name, $eplug_caption, "P".$plugin_id, "", TRUE);
-                }
-                unset($eplug_conffile, $eplug_name, $eplug_caption);
-        }
-}
-
-$text .= "</tr>
-</table></div>";
-$ns -> tablerender("<div style='text-align:center'>".ADLAN_47." ".ADMINNAME."</div>", $text);
-
-
-
-// info -------------------------------------------------------
-
-$members = $sql -> db_Count("user");
-$unverified = $sql -> db_Count("user", "(*)", "WHERE user_ban=2");
-$banned = $sql -> db_Count("user", "(*)", "WHERE user_ban=1");
-$chatbox_posts = $sql -> db_Count("chatbox");
-$forum_posts = $sql -> db_Count("forum_t");
-$comments = $sql -> db_Count("comments");
-$permicon = "<img src='".e_IMAGE."generic/location.png' alt='' style='vertical-align:middle' /> ";
-$permicon2 = "<img src='".e_IMAGE."generic/rname.png' alt='' style='vertical-align:middle' /> ";
-$active_uploads = $sql -> db_Select("upload", "*", "upload_active=0");
-$submitted_links = $sql -> db_Select("tmp", "*", "tmp_ip='submitted_link' ");
-$reported_posts = $sql -> db_Select("tmp", "*", "tmp_ip='reported_post' ");
-$submitted_news = $sql -> db_Select("submitnews", "*", "submitnews_auth ='0' ");
-$submitted_articles = $sql -> db_Select("content", "*", "content_type ='15' ");
-$submitted_reviews = $sql -> db_Select("content", "*", "content_type ='16' ");
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>
-<tr>
-<td style='width:50%'>";
-
-
-$text .= $permicon.ADLAN_110.": ".$members."<br />";
-$text .= $permicon.ADLAN_111.": ".$unverified."<br />";
-$text .= $permicon.ADLAN_112.": ".$banned."<br /><br />";
-
-$text .= ($submitted_news ? $permicon2."<a href='".e_ADMIN."newspost.php?sn'>".ADLAN_107.": $submitted_news</a>" : $permicon.ADLAN_107.": 0")."<br />";
-$text .= ($submitted_articles ? $permicon2."<a href='".e_ADMIN."article.php?sa'>".ADLAN_123.": $submitted_articles</a>" : $permicon.ADLAN_123.": ".$submitted_articles)."<br />";
-$text .= ($submitted_reviews ? $permicon2."<a href='".e_ADMIN."review.php?sa'>".ADLAN_124.": $submitted_reviews</a>" : $permicon.ADLAN_124.": ".$submitted_reviews)."<br />";
-$text .= ($submitted_links ? $permicon2."<a href='".e_ADMIN."links.php?sn'>".ADLAN_119.": $submitted_links</a>" : $permicon.ADLAN_119.": ".$submitted_links)."<br /><br />";
-
-$text .= ($reported_posts ? $permicon2."<a href='".e_ADMIN."forum.php?sr'>".ADLAN_125.": $reported_posts</a>" : $permicon.ADLAN_125.": ".$reported_posts)."<br /><br />";
-
-$text .= ($active_uploads ? $permicon2."<a href='".e_ADMIN."upload.php'>".ADLAN_108.": $active_uploads</a>" : $permicon.ADLAN_108.": ".$active_uploads)."<br /><br />";
-
-$text .= $permicon.ADLAN_113.": ".$forum_posts."<br />";
-$text .= $permicon.ADLAN_114.": ".$comments."<br />";
-$text .= $permicon.ADLAN_115.": ".$chatbox_posts;
-
-$text .= "</td>
-<td style='width:50%; vertical-align:top'>";
-
-$text .= $permicon." <a style='cursor: pointer; cursor: hand' onclick=\"expandit(this)\">".ADLAN_116."</a>\n";
-if(e_QUERY != "logall"){
-        $text .= "<div style='display: none;'>";
-}
-if(e_QUERY == "logall"){
-        $sql -> db_Select("tmp", "*", "tmp_ip='adminlog' ORDER BY tmp_time DESC");
-}else{
-        $sql -> db_Select("tmp", "*", "tmp_ip='adminlog' ORDER BY tmp_time DESC LIMIT 0,10");
-}
-$text .= "<ul>";
-$gen = new convert;
-while($row = $sql -> db_Fetch()){
-        extract($row);
-        $datestamp = $gen->convert_date($tmp_time, "short");
-        $text .= "<li>".$datestamp.$tmp_info."</li>";
-}
-$text .= "</ul>";
-
-$text .= "[ <a href='".e_SELF."?logall'>".ADLAN_117."</a> ][ <a href='".e_SELF."?purge'>".ADLAN_118."</a> ]\n</div>
-</td></tr></table></div>
-
-";
-
-$ns -> tablerender(ADLAN_109, $text);
-
-require_once("footer.php");
-
-// Multi indice array sort by sweetland@whoadammit.com
-function asortbyindex ($sortarray, $index) {
-        $lastindex = count ($sortarray) - 1;
-        for ($subindex = 0; $subindex < $lastindex; $subindex++) {
-                $lastiteration = $lastindex - $subindex;
-                for ($iteration = 0; $iteration < $lastiteration;    $iteration++) {
-                        $nextchar = 0;
-                        if (comesafter ($sortarray[$iteration][$index], $sortarray[$iteration + 1][$index])) {
-                                $temp = $sortarray[$iteration];
-                                $sortarray[$iteration] = $sortarray[$iteration + 1];
-                                $sortarray[$iteration + 1] = $temp;
-                        }
-                }
-        }
-        return ($sortarray);
-}
-
-function comesafter ($s1, $s2) {
-        $order = 1;
-        if (strlen ($s1) > strlen ($s2)) {
-                $temp = $s1;
-                $s1 = $s2;
-                $s2 = $temp;
-                $order = 0;
-        }
-        for ($index = 0; $index < strlen ($s1); $index++) {
-                if ($s1[$index] > $s2[$index]) return ($order);
-                if ($s1[$index] < $s2[$index]) return (1 - $order);
-        }
-        return ($order);
-}
-
-function headerjs(){
-$script =  "<script type=\"text/javascript\">
-function tdover(object) {
-  if (object.className == 'td') object.className = 'forumheader5';
-}
-
-function tdnorm(object) {
-  if (object.className == 'forumheader5') object.className = 'td';
-}
-</script>\n";
-
-return $script;
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/admin_etalkers.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/01/27 19:52:24 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (ADMIN) {
+	header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
+	exit;
+} else {
+	header('Location:'.SITEURL.'index.php');
+	exit;
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/administrator.php 75/e107_admin/administrator.php
--- 6171/e107_admin/administrator.php	2004-08-31 11:02:52.000000000 -0500
+++ 75/e107_admin/administrator.php	2006-02-16 13:23:06.000000000 -0600
@@ -1,258 +1,375 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/administrator.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("3")){ header("location:".e_BASE."index.php"); exit; }
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-require_once(e_HANDLER."form_handler.php");
-$rs = new form;
-
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        unset($tmp);
-}
-
-if(IsSet($_POST['add_admin'])){
-        if($_POST['ac'] == md5(ADMINPWCHANGE)){
-                if(!$_POST['ad_name'] || !$_POST['a_password']){
-                        $message = ADMSLAN_55;
-                }else{
-                        for ($i=0; $i<=count($_POST['perms']); $i++){
-                                if($_POST['perms'][$i]){
-                                        $perm .= $_POST['perms'][$i].".";
-                                }
-                        }
-
-                        if(!$sql -> db_Select("user", "*", "user_name='".$_POST['ad_name']."' ")){
-                                $sql -> db_Insert("user", "0, '".$_POST['ad_name']."', '', '".md5($_POST['a_password'])."', '', '".$_POST['ad_email']."',         '".$_POST['website']."', '".$_POST['icq']."', '".$_POST['aim']."', '".$_POST['msn']."', '".$_POST['location']."', '".$_POST['birthday']."', '".$_POST['signature']."', '".$_POST['image']."', '".$_POST['timezone']."', '".$_POST['hideemail']."', '".time()."', '0', '".time()."', '0', '0', '0', '0', '".$ip."', '0', '0', '', '', '', '1', '', '', '$perm', '', '' ");
-                                $message = ADMSLAN_0." ".$_POST['ad_name']."<br />";
-                        }else{
-                                $sql -> db_Update("user", "user_admin='1', user_perms='$perm' WHERE user_name='".$_POST['ad_name']."' ");
-                        }
-                        $message = $_POST['ad_name']." ".ADMSLAN_1."<br />";
-                }
-        }
-}
-
-if(IsSet($_POST['update_admin'])){
-        $sql -> db_Select("user", "*", "user_id='".$_POST['a_id']."' ");
-        $row = $sql -> db_Fetch();
-        $a_name = $row['user_name'];
-        if($_POST['a_password'] == ""){
-                $admin_password = $row['user_password'];
-        }else{
-                $admin_password = md5($_POST['a_password']);
-        }
-
-       for ($i=0; $i<=count($_POST['perms']); $i++){
-                if($_POST['perms'][$i]){
-                        $perm .= $_POST['perms'][$i].".";
-                }
-        }
-        $sql -> db_Update("user", "user_password='$admin_password', user_perms='$perm' WHERE user_name='$a_name' ");
-        unset($ad_name, $a_password, $a_perms);
-        $message = ADMSLAN_56." ".$_POST['ad_name']." ".ADMSLAN_2."<br />";
-}
-
-if($action == "edit"){
-        $sql -> db_Select("user", "*", "user_id=$sub_action");
-        $row = $sql-> db_Fetch();
-        extract($row);
-        $a_id = $user_id; $ad_name = $user_name; $a_perms = $user_perms;
-        if($a_perms == "0"){
-                $text = "<div style='text-align:center'>$ad_name ".ADMSLAN_3."
-                <br /><br />
-                <a href='administrator.php'>".ADMSLAN_4."</a></div>";
-                $ns -> tablerender("<div style='text-align:center'>".ADMSLAN_5."</div>", $text);
-                require_once("footer.php");
-                exit;
-        }
-}
-
-if($action == "delete" && $_POST['del_administrator_confirm']==1){
-        $sql -> db_Select("user", "*", "user_id=$sub_action");
-        $row = $sql-> db_Fetch();
-        extract($row);
-        if($user_perms == "0"){
-                $text = "<div style='text-align:center'>$user_name ".ADMSLAN_6."
-                <br /><br />
-                <a href='administrator.php'>".ADMSLAN_4."</a>";
-                $ns -> tablerender("<div style='text-align:center'>".ADMSLAN_5."</div>", $text);
-                require_once("footer.php");
-                exit;
-        }
-        $sql -> db_Update("user", "user_admin=0, user_perms='' WHERE user_id=$sub_action");
-        $message = ADMSLAN_61;
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$sql -> db_Select("user", "*", "user_admin='1'");
-
-
-$text = "<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 100px; overflow : auto; '>
-<form action=\"".e_SELF."\" method=\"post\" id=\"del_administrator\" >
-<input type=\"hidden\" name=\"del_administrator_confirm\" id=\"del_administrator_confirm\" value=\"1\" />
-<table class='fborder' style='width:100%'>
-<tr>
-<td style='width:5%' class='forumheader2'>ID</td>
-<td style='width:30%' class='forumheader2'>".ADMSLAN_56."</td>
-<td style='width:35%' class='forumheader2'>".ADMSLAN_18."</td>
-<td style='width:30%' class='forumheader2'>".ADMSLAN_57."</td>
-</tr>";
-
-while($row = $sql -> db_Fetch()){
-        extract($row);
-        $text .= "<tr>
-<td style='width:5%' class='forumheader3'>$user_id</td>
-<td style='width:30%' class='forumheader3'>$user_name</td>
-<td style='width:35%' class='forumheader3'>".($user_perms == "0" ? ADMSLAN_58 : ($user_perms ? str_replace(".", "", $user_perms) : "&nbsp;"))."</td>
-<td style='width:30%; text-align:center' class='forumheader3'>".
-($user_perms == "0" ? "&nbsp;" :
-$rs -> form_button("button", "main_edit", ADMSLAN_15, "onclick=\"document.location='".e_SELF."?edit.$user_id'\"").
-$rs -> form_button("button", "main_delete", ADMSLAN_59, "onclick=\"confirm_($user_id, '$user_name')\""))."</td>
-</tr>";
-}
-
-$text .= "</table>\n</form></div>\n</div>";
-
-$ns -> tablerender(ADMSLAN_13, $text);
-
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."' id='myform' >
-<table style='width:95%' class='fborder'>
-<tr>
-<td style='width:30%' class='forumheader3'>".ADMSLAN_16.": </td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='ad_name' size='60' value='$ad_name' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".ADMSLAN_17.": </td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='a_password' size='60' value='$a_password' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".ADMSLAN_18.": <br /></td>
-<td style='width:70%' class='forumheader3'>";
-
-function checkb($arg, $perms){
-        if(getperms($arg, $perms)){
-                $par = "<input type='checkbox' name='perms[]' value='$arg' checked='checked' />\n";
-        }else{
-                $par = "<input type='checkbox' name='perms[]' value='$arg' />\n";
-        }
-        return $par;
-}
-
-$text .= checkb("1", $a_perms).ADMSLAN_19."<br />";
-$text .= checkb("2", $a_perms).ADMSLAN_20."<br />";
-$text .= checkb("3", $a_perms).ADMSLAN_21."<br />";
-$text .= checkb("4", $a_perms).ADMSLAN_22."<br />";
-$text .= checkb("5", $a_perms).ADMSLAN_23."<br />";
-$text .= checkb("Q", $a_perms).ADMSLAN_24."<br />";
-$text .= checkb("6", $a_perms).ADMSLAN_25."<br />";
-$text .= checkb("7", $a_perms).ADMSLAN_26."<br />";
-$text .= checkb("8", $a_perms).ADMSLAN_27."<br />";
-$text .= checkb("9", $a_perms).ADMSLAN_28."<br /><br />";
-
-$text .= checkb("D", $a_perms).ADMSLAN_29."<br />";
-$text .= checkb("E", $a_perms).ADMSLAN_30."<br />";
-$text .= checkb("F", $a_perms).ADMSLAN_31."<br />";
-$text .= checkb("G", $a_perms).ADMSLAN_32."<br />";
-$text .= checkb("S", $a_perms).ADMSLAN_33."<br />";
-$text .= checkb("T", $a_perms).ADMSLAN_34."<br />";
-$text .= checkb("V", $a_perms).ADMSLAN_35."<br />";
-
-$text .= checkb("A", $a_perms).ADMSLAN_36."<br />";
-$text .= checkb("B", $a_perms).ADMSLAN_37."<br />";
-$text .= checkb("C", $a_perms).ADMSLAN_38."<br /><br />";
-
-$text .= checkb("H", $a_perms).ADMSLAN_39."<br />";
-$text .= checkb("I", $a_perms).ADMSLAN_40."<br />";
-$text .= checkb("J", $a_perms).ADMSLAN_41."<br />";
-$text .= checkb("K", $a_perms).ADMSLAN_42."<br />";
-$text .= checkb("L", $a_perms).ADMSLAN_43."<br />";
-$text .= checkb("R", $a_perms).ADMSLAN_44."<br />";
-$text .= checkb("U", $a_perms).ADMSLAN_45."<br />";
-$text .= checkb("M", $a_perms).ADMSLAN_46."<br />";
-$text .= checkb("N", $a_perms).ADMSLAN_47."<br /><br />";
-
-
-$text .= checkb("Z", $a_perms).ADMSLAN_62."<br /><br />";
-
-$sql -> db_Select("plugin", "*", "plugin_installflag='1'");
-while($row = $sql-> db_Fetch()){
-extract($row);
-$text .= checkb("P".$plugin_id, $a_perms).ADMSLAN_63." - ".$plugin_name."<br />";
-}
-
-
-
-
-$text .= "
-<br />
-<a href='".e_SELF."?checkall=1' onclick=\"setCheckboxes('myform', true); return false;\">".ADMSLAN_49."</a> -
-<a href='".e_SELF."' onclick=\"setCheckboxes('myform', false); return false;\">".ADMSLAN_51."</a>
-
-</td>
-</tr>";
-
-$text .= "<tr style='vertical-align:top'>
-<td colspan='2' style='text-align:center' class='forumheader'>";
-
-if($action == "edit"){
-        $text .= "<input class='button' type='submit' name='update_admin' value='".ADMSLAN_52."' />
-        <input type='hidden' name='a_id' value='$a_id' />";
-}else{
-        $text .= "<input class='button' type='submit' name='add_admin' value='".ADMSLAN_53."' />";
-}
-$text .= "</td>
-</tr>
-</table>
-<div><input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' /></div>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".ADMSLAN_54."</div>", $text);
-
-require_once("footer.php");
-
-function headerjs(){
-global $etp;
-$script = "<script type=\"text/javascript\">
-function confirm_(user_id, user_name){
-        var x=confirm(\"".$etp->unentity(ADMSLAN_60)." \" + user_name + \"\");
-        if(x){
-                document.getElementById('del_administrator').action='".e_SELF."?delete.' + user_id;
-                document.getElementById('del_administrator').submit();
-        }
-}
-</script>";
-return $script;
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/administrator.php,v $
+|     $Revision: 1.27 $
+|     $Date: 2006/02/16 19:23:06 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+require_once('../class2.php');
+if (!getperms('3'))
+{
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
+$e_sub_cat = 'admin';
+require_once('auth.php');
+
+if (e_QUERY)
+{
+	$tmp = explode(".", e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	unset($tmp);
+}
+
+if (isset($_POST['update_admin']))
+{
+	$sql->db_Select("user", "*", "user_id='".$_POST['a_id']."' ");
+	$row = $sql->db_Fetch();
+	$a_name = $row['user_name'];
+
+	$perm = "";
+
+	foreach($_POST['perms'] as $value)
+	{
+      if ($value == "0")
+      {
+        if (!getperms('0')) { $value = ""; break; }
+
+        $perm = "0."; break;
+      }
+
+      if ($value)
+      {
+        $perm .= $value.".";
+      }
+    }
+
+	admin_update($sql -> db_Update("user", "user_perms='$perm' WHERE user_name='$a_name' "), 'update', ADMSLAN_56." ".$_POST['ad_name']." ".ADMSLAN_2."<br />");
+	unset($ad_name, $a_perms);
+}
+
+if ($_POST['edit_admin'] || $action == "edit")
+{
+	$edid = array_keys($_POST['edit_admin']);
+    $theid = ($edid[0]) ? $edid[0] : $sub_action;
+	$sql->db_Select("user", "*", "user_id=".$theid);
+	$row = $sql->db_Fetch();
+
+	if ($a_perms == "0")
+	{
+		$text = "<div style='text-align:center'>$ad_name ".ADMSLAN_3."
+		<br /><br />
+		<a href='administrator.php'>".ADMSLAN_4."</a></div>";
+		$ns->tablerender(LAN_ERROR, $text);
+		require_once("footer.php");
+		exit;
+	}
+}
+
+if (isset($_POST['del_admin']))
+{
+	$delid = array_keys($_POST['del_admin']);
+	$sql->db_Select("user", "*", "user_id= ".$delid[0]);
+	$row = $sql->db_Fetch();
+
+	if ($row['user_perms'] == "0")
+	{
+		$text = "<div style='text-align:center'>".$row['user_name']." ".ADMSLAN_6."
+		<br /><br />
+		<a href='administrator.php'>".ADMSLAN_4."</a>";
+		$ns->tablerender(ADMSLAN_5, $text);
+		require_once("footer.php");
+		exit;
+	}
+
+	admin_update($sql -> db_Update("user", "user_admin=0, user_perms='' WHERE user_id= ".$delid[0]), 'update', ADMSLAN_61, LAN_DELETED_FAILED);
+}
+
+if($_POST['edit_admin'] || $action == "edit"){
+	edit_administrator($row);
+}else{
+   show_admins();
+}
+
+function show_admins(){
+    global $sql,$tp,$ns,$pref;
+
+	$sql->db_Select("user", "*", "user_admin='1'");
+
+	$text = "<div style='text-align:center'><div style='padding: 1px; ".ADMIN_WIDTH."; margin-left: auto; margin-right: auto;'>
+	<form action='".e_SELF."' method='post' id='del_administrator'>
+	<div>
+	<input type='hidden' name='del_administrator_confirm' id='del_administrator_confirm' value='1' />
+	<table class='fborder' style='width:99%'>
+	<tr>
+	<td style='width:5%' class='fcaption'>ID</td>
+	<td style='width:20%' class='fcaption'>".ADMSLAN_56."</td>
+	<td style='width:65%' class='fcaption'>".ADMSLAN_18."</td>
+	<td style='width:10%' class='fcaption'>".LAN_OPTIONS."</td>
+	</tr>";
+
+	while ($row = $sql->db_Fetch())
+	{
+
+		$text .= "<tr>
+		<td style='width:5%' class='forumheader3'>".$row['user_id']."</td>
+		<td style='width:20%' class='forumheader3'>".$row['user_name']."</td>
+		<td style='width:65%' class='forumheader3'>";
+
+		$permtxt = "";
+        $text .= renderperms($row['user_perms'],$row['user_id'],"words");
+   		$text .= "</td>
+
+		<td style='width:10%; text-align:center' class='forumheader3'>";
+		if($row['user_id'] != "1")
+		{
+    		$text .= "
+			<input type='image' name='edit_admin[{$row['user_id']}]' value='edit' src='".e_IMAGE."admin_images/edit_16.png' title='".LAN_EDIT."' />
+			<input type='image' name='del_admin[{$row['user_id']}]' value='del' src='".e_IMAGE."admin_images/delete_16.png' onclick=\"return jsconfirm('".$tp->toJS(ADMSLAN_59."? [".$row['user_name']."]")."') \"  title='".ADMSLAN_59."' style='border:0px' />";
+    	}
+		$text .= "&nbsp;</td>
+
+		</tr>";
+	}
+
+	$text .= "</table></div>\n</form></div>\n</div>";
+
+	$ns->tablerender(ADMSLAN_13, $text);
+
+}
+
+
+
+
+function edit_administrator($row){
+    global $sql,$tp,$ns,$pref;
+	$lanlist = explode(",",e_LANLIST);
+
+	$a_id = $row['user_id'];
+	$ad_name = $row['user_name'];
+	$a_perms = $row['user_perms'];
+
+	$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."' id='myform' >
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+	<td style='width:25%' class='forumheader3'>".ADMSLAN_16.": </td>
+	<td style='width:75%' class='forumheader3'>
+	";
+
+	$text .= $ad_name;
+	$text .= "<input type='hidden' name='ad_name' size='60' value='$ad_name' />";
+
+	$text .= "
+	</td>
+	</tr>";
+
+	$text .="
+	<tr>
+	<td style='width:25%;vertical-align:top' class='forumheader3'>".ADMSLAN_18.": <br /></td>
+	<td style='width:75%' class='forumheader3'>";
+
+	$text .= checkb("1", $a_perms).ADMSLAN_19."<br />";
+	$text .= checkb("2", $a_perms).ADMSLAN_20."<br />";
+	$text .= checkb("3", $a_perms).ADMSLAN_21."<br />";
+	$text .= checkb("4", $a_perms).ADMSLAN_22."<br />"; // Moderate users/bans etc
+	$text .= checkb("5", $a_perms).ADMSLAN_23."<br />"; // create/edit custom pages/menus
+	$text .= checkb("Q", $a_perms).ADMSLAN_24."<br />"; // Manage download categories
+	$text .= checkb("6", $a_perms).ADMSLAN_25."<br />"; // Upload /manage files
+	$text .= checkb("Y", $a_perms).ADMSLAN_67."<br />"; // file inspector
+	$text .= checkb("O", $a_perms).ADMSLAN_68."<br />"; // notify
+	$text .= checkb("7", $a_perms).ADMSLAN_26."<br />";
+	$text .= checkb("8", $a_perms).ADMSLAN_27."<br />";
+	$text .= checkb("C", $a_perms).ADMSLAN_64."<br />"; // Clear Cache - Previously moderate chatbox
+	$text .= checkb("9", $a_perms).ADMSLAN_28."<br />";
+	$text .= checkb("W", $a_perms).ADMSLAN_65."<br /><br />";
+
+	$text .= checkb("D", $a_perms).ADMSLAN_29."<br />";
+	$text .= checkb("E", $a_perms).ADMSLAN_30."<br />";
+	$text .= checkb("F", $a_perms).ADMSLAN_31."<br />";
+	$text .= checkb("G", $a_perms).ADMSLAN_32."<br />";
+	$text .= checkb("S", $a_perms).ADMSLAN_33."<br />";
+	$text .= checkb("T", $a_perms).ADMSLAN_34."<br />";
+	$text .= checkb("V", $a_perms).ADMSLAN_35."<br />"; // Configure public file uploads
+	$text .= checkb("X", $a_perms).ADMSLAN_66."<br />";
+//	$text .= checkb("A", $a_perms).ADMSLAN_36."<br />"; // Moderate forums - NOW PLUGIN
+	$text .= checkb("B", $a_perms).ADMSLAN_37."<br />";
+	$text .= checkb("H", $a_perms).ADMSLAN_39."<br />";
+	$text .= checkb("I", $a_perms).ADMSLAN_40."<br />";
+//	$text .= checkb("J", $a_perms).ADMSLAN_41."<br />"; // Post articles   - NOW PLUGIN
+//	$text .= checkb("K", $a_perms).ADMSLAN_42."<br />"; // Post reviews    - NOW PLUGIN
+	$text .= checkb("L", $a_perms).ADMSLAN_43."<br />";
+	$text .= checkb("R", $a_perms).ADMSLAN_44."<br />";
+	$text .= checkb("U", $a_perms).ADMSLAN_45."<br />";
+	$text .= checkb("M", $a_perms).ADMSLAN_46."<br />";
+	$text .= checkb("N", $a_perms).ADMSLAN_47."<br /><br />";
+
+	$text .= "<br /><div class='fcaption'>".ADLAN_CL_7."</div><br />";
+	$text .= checkb("Z", $a_perms).ADMSLAN_62."<br /><br />";
+
+	$sql->db_Select("plugin", "*", "plugin_installflag='1'");
+	while ($row = $sql->db_Fetch())
+	{
+		$text .= checkb("P".$row['plugin_id'], $a_perms).LAN_PLUGIN." - ".$row['plugin_name']."<br />";
+	}
+
+// Language Rights.. --------------
+	if($pref['multilanguage'])
+	{
+		sort($lanlist);
+		$text .= "<br /><div class='fcaption'>".ADLAN_132."</div><br />\n";
+		$text .= checkb($pref['sitelanguage'], $a_perms).$pref['sitelanguage']."<br />\n";
+		foreach($lanlist as $langval)
+		{
+			$langname = $langval;
+			$langval = ($langval == $pref['sitelanguage']) ? "" : $langval;
+			if ($langval)
+	   		{
+				$text .= checkb($langval, $a_perms).$langval."<br />\n";
+			}
+		}
+	}
+	// -------------------------
+
+	if (getperms('0'))
+	{
+		$text .= "<br /><br /><div class='fcaption'>".ADMSLAN_58."</div><br />";
+		$text .= checkb("0", $a_perms).ADMSLAN_58."<br />";
+	}
+
+	$text .= "<br /><br />
+	<a href='".e_SELF."?checkall=1' onclick=\"setCheckboxes('myform', true, 'perms[]'); return false;\">".ADMSLAN_49."</a> -
+	<a href='".e_SELF."' onclick=\"setCheckboxes('myform', false, 'perms[]'); return false;\">".ADMSLAN_51."</a><br />
+	<br />
+	</td>
+	</tr>";
+
+	$text .= "<tr style='vertical-align:top'>
+	<td colspan='2' style='text-align:center' class='forumheader'>";
+
+	$text .= "<input class='button' type='submit' name='update_admin' value='".ADMSLAN_52."' />
+	<input type='hidden' name='a_id' value='$a_id' />";
+
+	$text .= "</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+
+    $text .= "<div style='text-align:center'><br /><a href='".e_SELF."'>".ADMSLAN_70."</a></div>";
+	$ns->tablerender(ADMSLAN_52, $text);
+}
+
+
+
+require_once("footer.php");
+
+
+
+
+
+
+function checkb($arg, $perms)
+{
+	if (getperms($arg, $perms))
+	{
+		$par = "<input type='checkbox' name='perms[]' value='$arg' checked='checked' />\n";
+	}
+	else
+	{
+		$par = "<input type='checkbox' name='perms[]' value='$arg' />\n";
+	}
+	return $par;
+}
+
+
+function renderperms($perm,$id){
+	global $pref,$sql,$pt;
+	if($perm == "0"){
+   		return ADMSLAN_58;
+	}
+    $sql2 = new db;
+	$lanlist = explode(",",e_LANLIST);
+
+
+	if(!$pt){
+    	$pt["1"] = ADMSLAN_19;
+		$pt["2"] = ADMSLAN_20;
+		$pt["3"] = ADMSLAN_21;
+		$pt["4"] = ADMSLAN_22;// Moderate users/bans etc
+		$pt["5"] = ADMSLAN_23;// create/edit custom pages/menus
+		$pt["Q"] = ADMSLAN_24;// Manage download categories
+		$pt["6"] = ADMSLAN_25; //Upload /manage files
+		$pt["Y"] = ADMSLAN_67;// file inspector
+		$pt["O"] = ADMSLAN_68;// notify
+		$pt["7"] = ADMSLAN_26;
+		$pt["8"] = ADMSLAN_27;
+		$pt["C"] = ADMSLAN_64;
+		$pt["9"] = ADMSLAN_28;
+		$pt["W"] = ADMSLAN_65;
+    	$pt["D"] = ADMSLAN_29;
+		$pt["E"] = ADMSLAN_30;
+		$pt["F"] = ADMSLAN_31;
+		$pt["G"] = ADMSLAN_32;
+		$pt["S"] = ADMSLAN_33;
+		$pt["T"] = ADMSLAN_34;
+		$pt["V"] = ADMSLAN_35;
+		$pt["X"] = ADMSLAN_66;
+		$pt["B"] = ADMSLAN_37;
+		$pt["H"] = ADMSLAN_39;
+		$pt["I"] = ADMSLAN_40;
+		$pt["L"] = ADMSLAN_43;
+		$pt["R"] = ADMSLAN_44;
+		$pt["U"] = ADMSLAN_45;
+		$pt["M"] = ADMSLAN_46;
+		$pt["N"] = ADMSLAN_47;
+		$pt["Z"] = ADMSLAN_62;
+
+  //		foreach($lanlist as $lan){
+  //      	$pt[$lan] = $lan;
+  //		}
+
+		$sql2->db_Select("plugin", "*", "plugin_installflag='1'");
+		while ($row2 = $sql2->db_Fetch()){
+			$pt[("P".$row2['plugin_id'])] = LAN_PLUGIN." - ".$row2['plugin_name'];
+		}
+	}
+
+	$tmp = explode(".", $perm);
+		$langperm = "";
+		foreach($tmp as $pms){
+			if(in_array($pms, $lanlist)){
+				$langperm .= $pms."&nbsp;";
+			}else{
+				$permtxt[] = $pms;
+                if($pt[$pms]){
+		   			$ptext[] = $pt[$pms];
+				}
+			}
+		}
+
+	$ret = implode(" ",$permtxt);
+	if($pref['multilanguage']){
+		$ret .= ",&nbsp;". $langperm;
+	}
+
+	$text = "<div onclick=\"expandit('id_$id')\" style='cursor:pointer' title='".ADMSLAN_71."'>$ret</div>
+	<div id='id_$id' style='display:none'><br />".implode("<br />",$ptext)."</div>";
+    return $text;
+
+
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/admin_log.php 75/e107_admin/admin_log.php
--- 6171/e107_admin/admin_log.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/admin_log.php	2006-04-13 10:07:10.000000000 -0500
@@ -0,0 +1,109 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/admin_log.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2006/04/13 15:07:10 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+
+require_once("auth.php");
+$text = "";
+$amount = 30;
+$from = ($_GET['fm']) ? intval($_GET['fm']) : 0;
+
+if(e_QUERY == 'purge')
+{
+	$sql->db_Delete('dblog');
+}
+
+$total = $sql -> db_Select("dblog", "*", "ORDER BY `dblog_datestamp` DESC", "no_where");
+$query = "SELECT l.*, u.user_name FROM #dblog AS l LEFT JOIN #user AS u ON l.dblog_user_id = u.user_id  ORDER BY l.dblog_datestamp DESC LIMIT $from,$amount";
+$sql -> db_Select_gen($query);
+
+if(!is_object($gen)) {
+	$gen = new convert;
+}
+	$parms = $total.",".$amount.",".$from.",".e_SELF.'?fm=[FROM]';
+	$text .= "<div style='text-align:center'><br />".$tp->parseTemplate("{NEXTPREV={$parms}}")."<br /><br /></div>";
+$text .= "<div id='admin_log'><table>\n";
+
+//
+
+$text .= "
+  <tr>
+    <td class='fcaption'>&nbsp;</td>
+    <td class='fcaption' style='font-weight: bold;'>Date</td>
+    <td class='fcaption' style='font-weight: bold;'>Title</td>
+    <td class='fcaption' style='font-weight: bold;'>Description</td>
+    <td class='fcaption' style='font-weight: bold;'>User IP</td>
+    <td class='fcaption' style='font-weight: bold;'>User ID</td>
+  </tr>\n";
+
+while ($row = $sql -> db_Fetch()) {
+	$datestamp = $gen->convert_date($row['dblog_datestamp'], 'short');
+	$image = get_log_img($row['dblog_type']);
+	$text .= "  <tr>\n";
+	$text .= "    <td style='width: 16px;'>{$image}</td>\n";
+	$text .= "    <td>{$datestamp}</td>\n";
+	$text .= "    <td>{$row['dblog_query']}</td>\n";
+	$text .= "    <td>{$row['dblog_remarks']}</td>\n";
+	$text .= "    <td>{$row['dblog_ip']}</td>\n";
+	$text .= ($row['user_name']) ? "    <td><a href='".e_BASE."user.php?id.{$row['dblog_user_id']}'>{$row['user_name']}</a></td>\n" : "    <td>{$row['dblog_user_id']}</td>\n";
+	$text .= "  </tr>\n";
+}
+
+$text .= "</table></div>\n";
+
+	$text .= "<div style='text-align:center'><br />".$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>";
+
+$ns->tablerender("Admin Log", $text);
+require_once("footer.php");
+
+function get_log_img($log_type) {
+	switch ($log_type) {
+		case E_LOG_INFORMATIVE:
+			return "<img src='".e_IMAGE_ABS."admin_images/docs_16.png' alt='Informative Icon' title='Informative Message' />";
+		break;
+		case E_LOG_NOTICE:
+			return "<img src='".e_IMAGE_ABS."admin_images/notice_16.png' alt='Notice Icon' title='Notice Message' />";
+		break;
+		case E_LOG_WARNING:
+			return "<img src='".e_IMAGE_ABS."admin_images/blocked_16.png' alt='Warning Icon' title='Warning Message' />";
+		break;
+		case E_LOG_FATAL:
+			return "<img src='".e_IMAGE_ABS."admin_images/nopreview_16.png' alt='Fatal Icon' title='Fatal Error Message' />";
+		break;
+	}
+		return $log_type;
+}
+
+function headerjs() {
+?>
+<style type="text/css">
+#admin_log td {
+	border: 1px solid #000000;
+	margin: 0px;
+	padding: 2px;
+}
+#admin_log table {
+	width: 99%;
+	/*border-spacing: 0px;
+	border-collapse: collapse;*/
+}
+</style>
+<?php
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/admin.php 75/e107_admin/admin.php
--- 6171/e107_admin/admin.php	2004-07-12 06:34:34.000000000 -0500
+++ 75/e107_admin/admin.php	2006-02-17 17:35:38.000000000 -0600
@@ -1,200 +1,233 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/admin.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-require_once("auth.php");
-
-
-// auto db update ...
-if("0" == ADMINPERMS){
-        @require_once(e_ADMIN."update_routines.php");
-        @update_check();
-}
-//        end auto db update
-
-if(e_QUERY == "purge"){
-        $sql -> db_Delete("tmp", "tmp_ip='adminlog' ");
-}
-
-$tdc=0;
-function wad($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE){
-        global $tdc;
-        $permicon = ($mode == TRUE ? e_IMAGE."generic/rname.png" : e_IMAGE."generic/location.png");
-        if(getperms($perms)){
-                if(!$tdc){$tmp1 = "<tr>";}
-                if($tdc == 4){$tmp2 = "</tr>";$tdc=-1;}
-                $tdc++;
-                $tmp = $tmp1."<td class='td' style='text-align:left; vertical-align:top; width:20%; whitespace:nowrap' onmouseover='tdover(this)' onmouseout='tdnorm(this)'
-                onclick=\"document.location.href='$link'\"><img src='$permicon' alt='$description' style='border:0; vertical-align:middle'/> $title</td>\n\n".$tmp2;
-        }
-        return $tmp;
-}
-
-require_once("ad_links.php");
-
-$newarray = asortbyindex ($array_functions, 1);
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>";
-
-while(list($key, $funcinfo) = each($newarray)){
-        $text .= wad($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3]);
-}
-
-if(!$tdc){ $text .= "</tr>"; }
-
-
-
-        unset($tdc);
-
-        $text .= "</tr><tr>
-        <td colspan='5'><br />
-        </td>
-        </tr>";
-
-        $text .= wad(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", "", TRUE);
-
-        if($sql -> db_Select("plugin", "*", "plugin_installflag=1")){
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        include(e_PLUGIN.$plugin_path."/plugin.php");
-                        if($eplug_conffile){
-                                $text .= wad(e_PLUGIN.$plugin_path."/".$eplug_conffile, $eplug_name, $eplug_caption, "P".$plugin_id, "", TRUE);
-                        }
-                        unset($eplug_conffile, $eplug_name, $eplug_caption);
-                }
-        }
-
-$text .= "</tr>
-</table></div>";
-$ns -> tablerender("<div style='text-align:center'>".ADLAN_47." ".ADMINNAME."</div>", $text);
-
-
-
-// info -------------------------------------------------------
-
-$members = $sql -> db_Count("user");
-$unverified = $sql -> db_Count("user", "(*)", "WHERE user_ban=2");
-$banned = $sql -> db_Count("user", "(*)", "WHERE user_ban=1");
-$chatbox_posts = $sql -> db_Count("chatbox");
-$forum_posts = $sql -> db_Count("forum_t");
-$comments = $sql -> db_Count("comments");
-$permicon = "<img src='".e_IMAGE."generic/location.png' alt='' style='vertical-align:middle' /> ";
-$permicon2 = "<img src='".e_IMAGE."generic/rname.png' alt='' style='vertical-align:middle' /> ";
-$active_uploads = $sql -> db_Select("upload", "*", "upload_active=0");
-$submitted_links = $sql -> db_Select("tmp", "*", "tmp_ip='submitted_link' ");
-$reported_posts = $sql -> db_Select("tmp", "*", "tmp_ip='reported_post' ");
-$submitted_news = $sql -> db_Select("submitnews", "*", "submitnews_auth ='0' ");
-$submitted_articles = $sql -> db_Select("content", "*", "content_type ='15' ");
-$submitted_reviews = $sql -> db_Select("content", "*", "content_type ='16' ");
-
-$text = "<div style='text-align:center'>
-<table style='width:95%'>
-<tr>
-<td style='width:50%'>";
-
-
-$text .= $permicon.ADLAN_110.": ".$members."<br />";
-$text .= $permicon.ADLAN_111.": ".$unverified."<br />";
-$text .= $permicon.ADLAN_112.": ".$banned."<br /><br />";
-
-$text .= ($submitted_news ? $permicon2."<a href='".e_ADMIN."newspost.php?sn'>".ADLAN_107.": $submitted_news</a>" : $permicon.ADLAN_107.": 0")."<br />";
-$text .= ($submitted_articles ? $permicon2."<a href='".e_ADMIN."article.php?sa'>".ADLAN_123.": $submitted_articles</a>" : $permicon.ADLAN_123.": ".$submitted_articles)."<br />";
-$text .= ($submitted_reviews ? $permicon2."<a href='".e_ADMIN."review.php?sa'>".ADLAN_124.": $submitted_reviews</a>" : $permicon.ADLAN_124.": ".$submitted_reviews)."<br />";
-$text .= ($submitted_links ? $permicon2."<a href='".e_ADMIN."links.php?sn'>".ADLAN_119.": $submitted_links</a>" : $permicon.ADLAN_119.": ".$submitted_links)."<br /><br />";
-
-$text .= ($reported_posts ? $permicon2."<a href='".e_ADMIN."forum.php?sr'>".ADLAN_125.": $reported_posts</a>" : $permicon.ADLAN_125.": ".$reported_posts)."<br /><br />";
-
-$text .= ($active_uploads ? $permicon2."<a href='".e_ADMIN."upload.php'>".ADLAN_108.": $active_uploads</a>" : $permicon.ADLAN_108.": ".$active_uploads)."<br /><br />";
-
-$text .= $permicon.ADLAN_113.": ".$forum_posts."<br />";
-$text .= $permicon.ADLAN_114.": ".$comments."<br />";
-$text .= $permicon.ADLAN_115.": ".$chatbox_posts;
-
-$text .= "</td>
-<td style='width:50%; vertical-align:top'>";
-
-$text .= $permicon." <a style='cursor: pointer; cursor: hand' onclick=\"expandit(this)\">".ADLAN_116."</a>\n";
-if(e_QUERY != "logall"){
-        $text .= "<div style='display: none;'>";
-}
-if(e_QUERY == "logall"){
-        $sql -> db_Select("tmp", "*", "tmp_ip='adminlog' ORDER BY tmp_time DESC");
-}else{
-        $sql -> db_Select("tmp", "*", "tmp_ip='adminlog' ORDER BY tmp_time DESC LIMIT 0,10");
-}
-$text .= "<ul>";
-$gen = new convert;
-while($row = $sql -> db_Fetch()){
-        extract($row);
-        $datestamp = $gen->convert_date($tmp_time, "short");
-        $text .= "<li>".$datestamp.$tmp_info."</li>";
-}
-$text .= "</ul>";
-
-$text .= "[ <a href='".e_SELF."?logall'>".ADLAN_117."</a> ][ <a href='".e_SELF."?purge'>".ADLAN_118."</a> ]\n</div>
-</td></tr></table></div>
-
-";
-
-$ns -> tablerender(ADLAN_109, $text);
-
-require_once("footer.php");
-
-// Multi indice array sort by sweetland@whoadammit.com
-function asortbyindex ($sortarray, $index) {
-        $lastindex = count ($sortarray) - 1;
-        for ($subindex = 0; $subindex < $lastindex; $subindex++) {
-                $lastiteration = $lastindex - $subindex;
-                for ($iteration = 0; $iteration < $lastiteration;    $iteration++) {
-                        $nextchar = 0;
-                        if (comesafter ($sortarray[$iteration][$index], $sortarray[$iteration + 1][$index])) {
-                                $temp = $sortarray[$iteration];
-                                $sortarray[$iteration] = $sortarray[$iteration + 1];
-                                $sortarray[$iteration + 1] = $temp;
-                        }
-                }
-        }
-        return ($sortarray);
-}
-
-function comesafter ($s1, $s2) {
-        $order = 1;
-        if (strlen ($s1) > strlen ($s2)) {
-                $temp = $s1;
-                $s1 = $s2;
-                $s2 = $temp;
-                $order = 0;
-        }
-        for ($index = 0; $index < strlen ($s1); $index++) {
-                if ($s1[$index] > $s2[$index]) return ($order);
-                if ($s1[$index] < $s2[$index]) return (1 - $order);
-        }
-        return ($order);
-}
-
-function headerjs(){
-$script =  "<script type=\"text/javascript\">
-function tdover(object) {
-  if (object.className == 'td') object.className = 'forumheader5';
-}
-
-function tdnorm(object) {
-  if (object.className == 'forumheader5') object.className = 'td';
-}
-</script>\n";
-
-return $script;
-}
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/admin.php,v $
+|     $Revision: 1.31 $
+|     $Date: 2006/02/17 23:35:38 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+require_once('../class2.php');
+$e_sub_cat = 'main';
+require_once('auth.php');
+require_once(e_HANDLER.'admin_handler.php');
+
+if (is_dir(e_ADMIN.'htmlarea') || is_dir(e_HANDLER.'htmlarea')) {
+	$text = ADLAN_ERR_2."<br /><br />
+	<div style='text-align:center'>".$HANDLERS_DIRECTORY."htmlarea/<br />".$ADMIN_DIRECTORY."htmlarea/</div>";
+	$ns -> tablerender(ADLAN_ERR_1, $text);
+}
+
+if (is_readable(e_ADMIN.'filetypes.php')) {
+	$a_types = trim(file_get_contents(e_ADMIN.'filetypes.php'));
+} else {
+	$a_types = 'zip, gz, jpg, png, gif';
+}
+$a_types = explode(',', $a_types);
+foreach ($a_types as $f_type) {
+	$allowed_types[] = '.'.trim(str_replace('.', '', $f_type));
+}
+$public = array(e_FILE.'public', e_FILE.'public/avatars');
+foreach ($public as $dir) {
+	if (is_dir($dir)) {
+		if ($dh = opendir($dir)) {
+			while (($file = readdir($dh)) !== false) {
+				if (is_dir($dir."/".$file) == FALSE && $file != '.' && $file != '..' && $file != '/' && $file != 'CVS' && $file != 'avatars' && $file != 'Thumbs.db') {
+					$fext = substr(strrchr($file, "."), 0);
+					if (!in_array($fext, $allowed_types)) {
+						if ($file == 'index.html' || $file == "null.txt") {
+							if (filesize($dir.'/'.$file)) {
+								$potential[] = str_replace('../', '', $dir).'/'.$file;
+							}
+						} else {
+							$potential[] = str_replace('../', '', $dir).'/'.$file;
+						}
+					}
+				}
+			}
+		closedir($dh);
+		}
+	}
+}
+
+if (isset($potential)) {
+	$text = ADLAN_ERR_3."<br /><br />";
+
+	foreach ($potential as $p_file) {
+		$text .= $p_file.'<br />';
+	}
+
+	$ns -> tablerender(ADLAN_ERR_1, $text);
+}
+
+// update users using old layout names to their new names
+$update_prefs = FALSE;
+if (!$pref['adminstyle'] || $pref['adminstyle'] == 'default') {
+	$pref['adminstyle'] = 'compact';
+	$update_prefs = true;
+}
+if ($pref['adminstyle'] == 'adminb') {
+	$pref['adminstyle'] = 'cascade';
+	$update_prefs = true;
+}
+if ($pref['adminstyle'] == 'admin_etalkers') {
+	$pref['adminstyle'] = 'categories';
+	$update_prefs = true;
+}
+if ($pref['adminstyle'] == 'admin_combo') {
+	$pref['adminstyle'] = 'combo';
+	$update_prefs = true;
+}
+if ($pref['adminstyle'] == 'admin_classis') {
+	$pref['adminstyle'] = 'classis';
+	$update_prefs = true;
+}
+
+// temporary code to switch users using admin_jayya to jayya
+
+if ($pref['admintheme'] == 'admin_jayya') {
+	$pref['admintheme'] = 'jayya';
+	$update_prefs = true;
+}
+
+if ($pref['sitetheme'] == 'admin_jayya') {
+	$pref['sitetheme'] = 'jayya';
+	$update_prefs = true;
+}
+
+// ---------------------------------------------------------
+
+
+if ($update_prefs == true) {
+	save_prefs();
+}
+
+// auto db update
+if ('0' == ADMINPERMS) {
+	require_once(e_ADMIN.'update_routines.php');
+	update_check();
+}
+// end auto db update
+
+if (e_QUERY == 'purge') {
+	$admin_log->purge_log_events(false);
+}
+
+$td = 1;
+if(!defined("ADLINK_COLS")){
+	define("ADLINK_COLS",5);
+}
+function render_links($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE) {
+	global $td;
+	$text = '';
+	if (getperms($perms)) {
+		if ($mode == 'adminb') {
+			$text = "<tr><td class='forumheader3'>
+				<div class='td' style='text-align:left; vertical-align:top; width:100%'
+				onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">
+				".$icon." <b>".$title."</b> ".($description ? "[ <span class='smalltext'>".$description."</span> ]" : "")."</div></td></tr>";
+		} else {
+			if ($td == (ADLINK_COLS+1)) {
+				$text .= '</tr>';
+				$td = 1;
+			}
+			if ($td == 1) {
+				$text .= '<tr>';
+			}
+			if ($mode == 'default') {
+				$text .= "<td class='td' style='text-align:left; vertical-align:top; width:20%; white-space:nowrap'
+					onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">".$icon." ".$title."</td>";
+			}
+			else if ($mode == 'classis') {
+				$text .= "<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."' title='$description'>".$icon."</a><br />
+					<a href='".$link."' title='$description'><b>".$title."</b></a><br /><br /></td>";
+			}elseif ($mode == 'beginner'){
+                $text .= "<td style='text-align:center; vertical-align:top; width:20%' ><a href='".$link."' >".$icon."</a>
+					<div style='padding:5px'>
+					<a href='".$link."' title='".$description."' style='text-decoration:none'><b>".$title."</b></a></div><br /><br /><br /></td>";
+			}
+			$td++;
+		}
+	}
+	return $text;
+}
+
+function render_clean() {
+	global $td;
+	while ($td <= ADLINK_COLS) {
+		$text .= "<td class='td' style='width:20%;'></td>";
+		$td++;
+	}
+	$text .= "</tr>";
+	$td = 1;
+	return $text;
+}
+
+$newarray = asortbyindex($array_functions, 1);
+
+require_once(e_ADMIN.'includes/'.$pref['adminstyle'].'.php');
+
+function admin_info() {
+	global $tp;
+	$text = "<div style='text-align:center'>
+		<table style='width: 100%; border-collapse:collapse; border-spacing:0px;'>
+		<tr>
+		<td style='width: 33%; vertical-align: top'>";
+
+	$text .= $tp->parseTemplate('{ADMIN_STATUS}');
+
+	$text .= "</td>
+		<td style='width: 33%; vertical-align: top'>";
+
+	$text .= $tp->parseTemplate('{ADMIN_LATEST}');
+
+	$text .= "</td>
+		<td style='width: 33%; vertical-align: top'>";
+
+	$text .= $tp->parseTemplate('{ADMIN_LOG}');
+
+	$text .= "</td>
+		</tr></table></div>";
+
+	return $text;
+}
+
+function status_request() {
+	global $pref;
+	if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') {
+		return TRUE;
+	} else {
+		return FALSE;
+	}
+}
+
+function latest_request() {
+	global $pref;
+	if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') {
+		return TRUE;
+	} else {
+		return FALSE;
+	}
+}
+
+function log_request() {
+	global $pref;
+	if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade'|| $pref['adminstyle'] == 'beginner') {
+		return TRUE;
+	} else {
+		return FALSE;
+	}
+}
+
+require_once("footer.php");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/article.php 75/e107_admin/article.php
--- 6171/e107_admin/article.php	2004-09-03 03:21:28.000000000 -0500
+++ 75/e107_admin/article.php	2005-12-24 17:34:48.000000000 -0600
@@ -1,658 +1,23 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/review.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|   $Source: /cvsroot/e107/e107/e107_admin/article.php,v $
-|   $Revision: 1.27 $
-|   $Date: 2004/09/03 08:21:28 $
-|   $Author: loloirie $
-
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if($pref['htmlarea']){
-    require_once(e_HANDLER."htmlarea/htmlarea.inc.php");
-   $htmlarea_js =  htmlarea("data");
-  //  htmlarea("content_summary");
-}
-if(!getperms("J") && !getperms("K") && !getperms("L")){header("location:".e_BASE."index.php"); exit; }
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-$aj = new textparse;
-require_once(e_HANDLER."form_handler.php");
-require_once(e_HANDLER."userclass_class.php");
-
-$rs = new form;
-
-$deltest = array_flip($_POST);
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
-        unset($tmp);
-}
-if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$etp->unentity(ARLAN_62)],$matches))
-{
-        $delete = $matches[1];
-        $del_id = $matches[2];
-}
-
-// ##### DB --------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if(IsSet($_POST['create_category'])){
-        $_POST['category_name'] = $aj -> formtpa($_POST['category_name'], "admin");
-        $_POST['category_description'] = $aj -> formtpa($_POST['category_description'], "admin");
-        $sql -> db_Insert("content", " '0', '".$_POST['category_name']."', '".$_POST['category_description']."', '', 0, ".time().", '".ADMINID."', 0, '".$_POST['category_button']."', 6, 0, 0, 0");
-        $message = ARLAN_56;
-        clear_cache("article");
-        $action = "cat";
-}
-
-if(IsSet($_POST['update_category'])){
-        $_POST['category_name'] = $aj -> formtpa($_POST['category_name'], "admin");
-        $_POST['category_description'] = $aj -> formtpa($_POST['category_description'], "admin");
-        $sql -> db_Update("content", "content_heading='".$_POST['category_name']."', content_subheading='".$_POST['category_description']."', content_summary='".$_POST['category_button']."' WHERE content_id='".$_POST['category_id']."' ");
-        $message = ARLAN_57;
-        clear_cache("article");
-        $action = "cat";
-}
-
-if(IsSet($_POST['create_article'])){
-        if($_POST['data'] && $_POST['content_heading']){
-                $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-                $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-                $content_content = $aj -> formtpa($_POST['data'], "admin");
-                $content_author = (!$_POST['content_author'] || $_POST['content_author'] == ARLAN_84 ? ADMINID : $_POST['content_author']."^".$_POST['content_author_email']);
-                $sql -> db_Insert("content", "0, '$content_heading', '$content_subheading', '$content_content', '".$_POST['category']."', '".time()."', '$content_author', '".$_POST['content_comment']."', '".$_POST['content_summary']."', '0' ,'0' ,".$_POST['add_icons'].", ".$_POST['a_class']);
-                unset($content_heading, $content_subheading, $data, $content_summary, $content_author);
-                $message = ARLAN_0;
-                clear_cache("article");
-        }else{
-                $message = ARLAN_1;
-        }
-        unset($action, $sub_action);
-}
-
-If(IsSet($_POST['sa_article'])){
-
-        if($_POST['data'] && $_POST['content_heading']){
-                if($_POST['category'] == -1){ unset($_POST['category']); }
-                $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-                $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-                $content_content = $aj -> formtpa($_POST['data'], "admin");
-                $content_summary = $aj -> formtpa($_POST['content_summary'], "admin");
-                $content_author = ($_POST['content_author'] && $_POST['content_author'] != ARLAN_84 ? $_POST['content_author']."^".$_POST['content_author_email'] : ADMINID);
-                $sql -> db_Update("content", " content_heading='$content_heading', content_subheading='$content_subheading', content_content='$content_content', content_parent='".$_POST['category']."', content_datestamp='".time()."', content_author='$content_author', content_comment='".$_POST['content_comment']."', content_summary='$content_summary', content_type='0',  content_pe_icon=".$_POST['add_icons'].", content_class='{$_POST['a_class']}' WHERE content_id=$id");
-                unset($content_heading, $content_subheading, $data, $content_summary);
-                $message = ARLAN_99;
-                unset($action);
-        }else{
-                $message = ARLAN_1;
-        }
-}
-
-
-If(IsSet($_POST['update_article'])){
-        if($_POST['data'] && $_POST['content_heading']){
-                if($_POST['category'] == -1){ unset($_POST['category']); }
-                $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-                $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-                $content_content = $aj -> formtpa($_POST['data'], "admin");
-                $content_summary = $aj -> formtpa($_POST['content_summary'], "admin");
-                $content_author = ($_POST['content_author'] && $_POST['content_author'] != ARLAN_84 ? $_POST['content_author']."^".$_POST['content_author_email'] : ADMINID);
-                $sql -> db_Update("content", " content_heading='$content_heading', content_subheading='$content_subheading', content_content='$content_content', content_parent='".$_POST['category']."', content_datestamp='".time()."', content_author='$content_author', content_comment='".$_POST['content_comment']."', content_summary='$content_summary', content_type='0', content_pe_icon=".$_POST['add_icons'].", content_class='{$_POST['a_class']}' WHERE content_id='".$_POST['content_id']."'");
-                unset($content_heading, $content_subheading, $data, $content_summary);
-                $message = ARLAN_2;
-                                 unset($action, $sub_action);
-                clear_cache("article");
-        }else{
-                $message = ARLAN_1;
-        }
-}
-
-if(IsSet($_POST['updateoptions'])){
-        $pref['article_submit'] = $_POST['article_submit'];
-        $pref['article_submit_class'] = $_POST['article_submit_class'];
-        save_prefs();
-                if($pref['article_submit'] ){
-                        $sql -> db_Update("links", "link_class=".$pref['article_submit_class']." WHERE link_url='subcontent.php?article' ");
-                }else{
-                        $sql -> db_Update("links", "link_class='255' WHERE link_url='subcontent.php?article' ");
-                }
-        $message = ARLAN_92;
-}
-
-if($delete == 'category')
-{
-        if($sql -> db_Delete("content", "content_id='$del_id' "))
-        {
-                $message = ARLAN_58;
-                unset($sub_action, $id);
-                $action = "cat";
-        }
-}
-
-if($delete == "main")
-{
-        if($sql -> db_Delete("content", "content_id='$del_id' "))
-        {
-                $message = ARLAN_30;
-                clear_cache("article");
-                unset($action, $sub_action, $id);
-        }
-}
-
-
-if(IsSet($_POST['preview']))
-{
-	$obj = new convert;
-	$datestamp = $obj->convert_date(time(), "long");
-	$content_heading = $aj -> formtpa($_POST['content_heading'],"admin"); $ch = $aj -> tpa($content_heading,"nobreak","admin");
-	$content_subheading = $aj -> formtpa($_POST['content_subheading'],"admin"); $cs = $aj -> tpa($content_subheading,"nobreak","admin");
-	$dt = (strstr($_POST['data'], "[img]http") ? $_POST['data'] : str_replace("[img]", "[img]../", $_POST['data']));
-	$dt = $aj -> formtpa($dt,"admin"); $dt = $aj -> tpa($dt,"off","admin");
-	$content_summary = $aj -> formtpa($_POST['content_summary'],"admin"); $cu= $aj -> tpa($content_summary,"nobreak","admin");
-	$ca = $aj -> formtpa($_POST['content_author'] && $_POST['content_author'] != ARLAN_84 ? $_POST['content_author'] : ADMINNAME);
-	$text = "<i>".ARLAN_101." $ca</i><br /><span class='smalltext'>".$datestamp."</span><br />";
-	if( $cs != '' ){$text .= '<br />'.ARLAN_18.": $cs";}
-	if( $cu != '' ){$text .= '<br />'.ARLAN_19.": $cu";}
-	$text .= "<br /><br />$dt";
-	$content_comment = $_POST['content_comment'];
-	$content_pe_icon = $_POST['add_icons'];
-	/* 9 Aug 2004 - unknown - the article preview looks more like the actual article */
-	$text = '<div style="text-align: center"><table class="fborder" style="width:95%" border="0"><tr><td>'.$text.'</td></tr></table></div>';
-	echo "<br /><br />";
-	// make form friendly ...
-	/* Before bug fixing for apostroph
-	$content_heading = $aj -> formtparev($_POST['content_heading']);
-	$content_subheading = $aj -> formtparev($_POST['content_subheading']);
-	$data = $aj -> formtparev(str_replace("../", "", $_POST['data']));
-	$content_summary = $aj -> formtparev($_POST['content_summary']);
-	*/
-	$data = $aj -> formtpa(str_replace("../", "", $_POST['data']),"admin");
-	$content_parent = $_POST['category'];
-	$content_class = $_POST['a_class'];
-	$content_author = $aj -> formtpa($_POST['content_author']);
-	$content_author_email = $aj -> formtpa($_POST['content_author_email']);
-		  
-	$ns -> tablerender($content_heading, $text);
-}
-
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-
-// ##### Categories ------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if($action == "cat"){
-        $text = "<div style='border : solid 1px #000; padding : 4px; width : auto; height : 100px; overflow : auto; '>\n";
-        if($category_total = $sql -> db_Select("content", "*", "content_type='6' ")){
-                $text .= "<table class='fborder' style='width:100%'>
-                <tr>
-                <td style='width:5%' class='forumheader2'>&nbsp;</td>
-                <td style='width:75%' class='forumheader2'>".ARLAN_59."</td>
-                <td style='width:20%; text-align:center' class='forumheader2'>".ARLAN_60."</td>
-                </tr>";
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        $delete_heading = str_replace("&#39;", "\'", $content_heading);
-                        $text .= "<tr>
-                        <td style='width:5%; text-align:center' class='forumheader3'>".($content_summary ? "<img src='".e_IMAGE."link_icons/$content_summary' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
-                        <td style='width:75%' class='forumheader3'>$content_heading [$content_subheading]</td>
-                        <td style='width:20%; text-align:center' class='forumheader3'>
-                        ".$rs -> form_button("submit", "category_edit", ARLAN_61, "onclick=\"document.location='".e_SELF."?cat.edit.$content_id'\"")."
-                               ".$rs -> form_open("post", e_SELF,"myform_{$content_id}","",""," onsubmit=\"return confirm_('cat','$delete_heading','$content_id')\"")."
-                                              ".$rs -> form_button("submit", "category_delete_{$content_id}", ARLAN_62)."
-                                              ".$rs -> form_close()."
-
-                        </td>
-                        </tr>";
-                }
-                $text .= "
-                </table>";
-        }else{
-                $text .= "<div style='text-align:center'>".ARLAN_63."</div>";
-        }
-        $text .= "</div>";
-        $ns -> tablerender(ARLAN_64, $text);
-
-        $handle=opendir(e_IMAGE."link_icons");
-        while ($file = readdir($handle)){
-                if($file != "." && $file != ".." && $file != "/"){
-                        $iconlist[] = $file;
-                }
-        }
-        closedir($handle);
-
-        unset($content_heading, $content_summary, $content_subheading);
-
-        if($sub_action == "edit"){
-                if($sql -> db_Select("content", "*", "content_id='$id' ")){
-                        $row = $sql -> db_Fetch(); extract($row);
-                }
-        }
-
-        $text = "<div style='text-align:center'>
-        ".$rs -> form_open("post", e_SELF."?cat", "dataform")."
-        <table class='fborder' style='width:auto'>
-        <tr>
-        <td class='forumheader3' style='width:30%'><span class='defaulttext'>".ARLAN_65."</span></td>
-        <td class='forumheader3' style='width:70%'>".$rs -> form_text("category_name", 30, $content_heading, 25)."</td>
-        </tr>
-        <tr>
-        <td class='forumheader3' style='width:30%'><span class='defaulttext'>".ARLAN_66."</span></td>
-        <td class='forumheader3' style='width:70%'>
-        ".$rs -> form_text("category_button", 60, $content_summary, 100)."
-        <br />
-        <input class='button' type ='button' style='cursor:hand' size='30' value='".ARLAN_67."' onclick='expandit(this)' />
-        <div style='{head}; display:none'>";
-        while(list($key, $icon) = each($iconlist)){
-                $text .= "<a href='javascript:addtext2(\"$icon\")'><img src='".e_IMAGE."link_icons/".$icon."' style='border:0' alt='' /></a> ";
-        }
-        $text .= "</div></td>
-        </tr>
-        <tr>
-        <td class='forumheader3' style='width:30%'><span class='defaulttext'>".ARLAN_68."</span></td>
-        <td class='forumheader3' style='width:70%'>".$rs->form_textarea("category_description", 59, 3, $content_subheading)."</td>
-        </tr>
-        <tr><td colspan='2' style='text-align:center' class='forumheader'>";
-        if($id){
-                $text .= "<input class='button' type='submit' name='update_category' value='".ARLAN_69."' />
-                ".$rs -> form_button("submit", "category_clear", "".ARLAN_70."").
-                $rs -> form_hidden("category_id", $id)."
-                </td></tr>";
-        }else{
-                $text .= "<input class='button' type='submit' name='create_category' value='".ARLAN_71."' /></td></tr>";
-        }
-        $text .= "</table>
-        ".$rs -> form_close()."
-        </div>";
-
-        $ns -> tablerender(ARLAN_71, $text);
-}
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-// ##### Display scrolling list of existing articles --------------------------------------------------------------------------------------------------------------------------
-if(!$action || $action == "confirm" || $action == 'c'){
-
-        $text = "";
-        // -------- SHOW FIRST LETTERS FIRSTNAMES ------------------------------------
-        $sql = new db;
-        $distinctfirstletter = $sql -> db_Select("content", "DISTINCT(LEFT(content_heading,1)) as letter", "content_type='0' ORDER BY content_heading ASC ");
-
-        if ($distinctfirstletter != 1){
-
-                $text .= "<form method='post' action='".e_SELF."'>
-                <table class='fborder' style='width:100%'>
-
-                <tr><td colspan='2' class='forumheader'>".ARLAN_31."</td></tr>
-                <tr><td colspan='2' class='forumheader3'>";
-
-                while($row = $sql-> db_Fetch()){
-                extract($row);
-                        $text .= "<input class='button' style='width:20' type='submit' name='letter' value='".strtoupper($letter)."' />";
-                }
-
-                $text .= "
-                <input class='button' style='width:20' type='submit' name='letter' value='all' />
-                </td></tr>
-                </table></form> ";
-        }
-        // ---------------------------------------------------------------------------
-
-        // -------- CHECK FOR FIRST LETTER SUBMISSION --------------------------------
-        $sql = new db;
-        $letter=$_POST['letter'];
-        if ($_POST['letter'] != "" && $_POST['letter'] != "all" ) {
-                $letter = $_POST['letter'];
-                $query = "content_type='0' AND content_heading LIKE '".$letter."%' ORDER BY content_datestamp DESC";
-        } else {
-                if($sub_action){
-                        $cat=intval($sub_action);
-                        if($cat=="none"){$cat='0';}
-                        $query = "content_type='0' AND content_parent={$cat} ORDER BY content_datestamp DESC";
-                } else {
-                        $query = "content_type='0' ORDER BY content_datestamp DESC";
-                }
-        }
-        // ---------------------------------------------------------------------------
-
-        $sql2 = new db;
-        $text .= "<div style='border : solid 1px #000; padding : 4px; width : auto; height : 400px; overflow : auto; '>";
-        if($article_total = $sql -> db_Select("content", "*", $query)){
-                if($article_total < 50 || $letter || $cat){
-                        $text .= "<table class='fborder' style='width:100%'>
-                        <tr>
-                        <td style='width:5%' class='forumheader2'>&nbsp;</td>
-                        <td style='width:50%' class='forumheader2'>".ARLAN_20."</td>
-                        <td style='width:45%' class='forumheader2'>".ARLAN_60."</td>
-                        </tr>";
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                unset($cs);
-                                $delete_heading = str_replace("&#39;", "\'", $content_heading);
-                                if($sql2 -> db_Select("content", "content_summary", "content_id=$content_parent")){
-                                        $row = $sql2 -> db_Fetch(); $cs = $row[0];
-                                }
-                                $text .= "<tr>
-                                <td style='width:5%; text-align:center' class='forumheader3'>".($cs ? "<img src='".e_IMAGE."link_icons/$cs' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
-                                <td style='width:75%' class='forumheader3'><a href='".e_BASE."content.php?article.$content_id'>$content_heading</a> [$content_subheading]</td>
-                                <td style='width:20%; text-align:center' class='forumheader3'>
-                                ".$rs -> form_open("post", e_SELF,"myform_{$content_id}","",""," onsubmit=\"return confirm_('create','$delete_heading','$content_id')\"")."
-                                <div>".$rs -> form_button("button", "main_edit_{$content_id}", ARLAN_61, "onclick=\"document.location='".e_SELF."?create.edit.$content_id'\"")."
-                                ".$rs -> form_button("submit", "main_delete_{$content_id}", ARLAN_62)."</div>
-                                ".$rs -> form_close()."
-
-                                </td>
-                                </tr>";
-                        }
-//                                ".$rs -> form_button("submit", "main_delete", ARLAN_62, "onclick=\"confirm_('create', '$delete_heading', $content_id)\"")."
-                        $text .= "</table>";
-                } else {
-                        $text .= "<br /><div style='text-align:center'>".ARLAN_32."</div>";
-                }
-        } else {
-                $text .= "<div style='text-align:center'>".ARLAN_14."</div>";
-        }
-        $text .= "</div>";
-        $ns -> tablerender(ARLAN_72, $text);
-        }
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-// ##### Display the create article entry screen ------------------------------------------------------------------------------------------------------------------------------
-
-
-if($action == "create"){
-        if($sub_action == "edit" && !$_POST['preview']){
-                if($sql -> db_Select("content", "*", "content_id='$id' ")){
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $data = str_replace("<br />", "", $aj -> formtparev($content_content));
-                        if(is_numeric($content_author)){
-                                $content_author = "";
-                                $content_author_email = "";
-                        }else{
-                                $tmp = explode("^", $content_author);
-                                $content_author = $tmp[0];
-                                $content_author_email = $tmp[1];
-                        }
-                }
-        }
-
-        if($sub_action == "sa" && !$_POST['preview']){
-                if($sql -> db_Select("content", "*", "content_id=$id")){
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $data = $content_content;
-                        $tmp = explode("^", $content_author);
-                        $content_author = $tmp[0];
-                        $content_author_email = $tmp[1];
-                }
-        }
-
-        require_once(e_HANDLER."userclass_class.php");
-
-        $text = "<div style='text-align:center'>
-        ".$rs -> form_open("post", e_SELF."?".e_QUERY."", "dataform")."
-
-        <table style='width:95%' class='fborder'>
-
-        <tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'>".ARLAN_74.":</td>
-        <td style='width:80%' class='forumheader3'>";
-
-        $sql -> db_Select("content", "*", "content_type=6 ");
-        $text .= $rs->form_select_open("category");
-        $text .= (!$content_parent ? $rs -> form_option("- ".ARLAN_75." -", 1, -1) : $rs -> form_option("- ".ARLAN_75." -", 0, -1));
-        while(list($category_id, $category_name) = $sql-> db_Fetch()){
-                $text .= ($category_id == $content_parent ? $rs -> form_option($category_name, 1, $category_id) : $rs -> form_option($category_name, 0, $category_id));
-        }
-        $text .= $rs -> form_select_close()."
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'>".ARLAN_82.":<br /><span class='smalltext'>(".ARLAN_83.")</span></td>
-        <td style='width:80%; vertical-align:top' class='forumheader3'>
-                <a href=\"javascript:void(0);\" onclick=\"expandit(this);\" >".ARLAN_100."</a>\n
-        <span style=\"display: none;\" >
-                <br /><br />
-                <input class='tbox' type='text' name='content_author' size='60' value='".($content_author ? $content_author : ARLAN_84)."' maxlength='100' ".($content_author ? "" : "onfocus=\"if(document.dataform.content_author.value=='".ARLAN_84."'){document.dataform.content_author.value='';}\"")." /><br />
-        <input class='tbox' type='text' name='content_author_email' size='60' value='".($content_author_email ? $content_author_email : ARLAN_85)."' maxlength='100' ".($content_author_email ? "" : "onfocus=\"if(document.dataform.content_author_email.value=='".ARLAN_85."'){document.dataform.content_author_email.value='';}\"")." /><br />
-        </span>
-                </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'>".ARLAN_17.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_heading' size='60' value='$content_heading' maxlength='100' />
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_18.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_subheading' size='60' value='$content_subheading' maxlength='100' />
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_19.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <textarea class='tbox' id='content_summary' name='content_summary' cols='90' rows='5'>$content_summary</textarea>
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_20.": </td>
-        <td style='width:80%' class='forumheader3'>
-        <textarea class='tbox' id='data' name='data' cols='90' rows='30' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$data</textarea>
-        ";
-        if(!$pref['htmlarea']){
-            $text .="<br />
-            <input class='helpbox' type='text' name='helpb' size='100' />
-            <br />";
-
-            require_once(e_HANDLER."ren_help.php");
-            $text .= ren_help();
-            }
-        $text .="
-        </td>
-        </tr>
-
-        <tr>
-        <td colspan='2' class='forumheader3'>".ARLAN_21.":&nbsp;&nbsp;".
-
-        ($content_comment ? ARLAN_22.": <input type='radio' name='content_comment' value='1' checked='checked' />".ARLAN_23.": <input type='radio' name='content_comment' value='0' />" : ARLAN_22.": <input type='radio' name='content_comment' value='1' />".ARLAN_23.": <input type='radio' name='content_comment' value='0' checked='checked' />")."
-        </td>
-        </tr>
-
-        <tr>
-        <td colspan='2' class='forumheader3'>".ARLAN_24.":&nbsp;&nbsp;".
-        ($content_pe_icon ? ARLAN_25.": <input type='radio' name='add_icons' value='1' checked='checked' />".ARLAN_26.": <input type='radio' name='add_icons' value='0' />" : ARLAN_25.": <input type='radio' name='add_icons' value='1' />".ARLAN_26.": <input type='radio' name='add_icons' value='0' checked='checked' />")."
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_55.":</td>
-        <td style='width:80%' class='forumheader3'>
-        ".r_userclass("a_class",$content_class)."
-        </td>
-        </tr>
-
-        <tr style='vertical-align:top'>
-        <td colspan='2'  style='text-align:center' class='forumheader'>".
-        (!$_POST['preview'] ? "<input class='button' type='submit' name='preview' value='".ARLAN_28."' />" : "<input class='button' type='submit' name='preview' value='".ARLAN_27."' />")." ".
-        ($sub_action == "edit" || $_POST['editp']? "<input class='button' type='submit' name='update_article' value='".ADLAN_81." ".ARLAN_20."' />\n<input type='hidden' name='content_id' value='$id' />" : ($sub_action == "sa" ? "<input class='button' type='submit' name='sa_article' value='".ARLAN_98."' />" : "<input class='button' type='submit' name='create_article' value='".ADLAN_85." ".ARLAN_20."' />"))."
-        </td>
-        </tr>
-        </table>
-        </form>
-        </div>";
-
-        $ns -> tablerender("<div style='text-align:center'>".ARLAN_15."</div>", $text);
-
-}
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if($action == "opt"){
-        global $pref, $ns;
-        $text = "<div style='text-align:center'>
-        <form method='post' action='".e_SELF."?".e_QUERY."'>\n
-        <table style='width:auto' class='fborder'>
-        <tr>
-
-        <td style='width:70%' class='forumheader3'>
-        ".ARLAN_86."<br />
-        <span class='smalltext'>".ARLAN_87."</span>
-        </td>
-        <td class='forumheader2' style='width:30%;text-align:center'>".
-        ($pref['article_submit'] ? "<input type='checkbox' name='article_submit' value='1' checked='checked' />" : "<input type='checkbox' name='article_submit' value='1' />")."
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:70%' class='forumheader3'>
-        ".ARLAN_88."<br />
-        <span class='smalltext'>".ARLAN_89."</span>
-        </td>
-        <td class='forumheader2' style='width:30%; text-align:center'>".r_userclass("article_submit_class", $pref['article_submit_class'])."</td>
-        </tr>
-
-        <tr style='vertical-align:top'>
-        <td colspan='2'  style='text-align:center' class='forumheader'>
-        <input class='button' type='submit' name='updateoptions' value='".ARLAN_90."' />
-        </td>
-        </tr>
-
-        </table>
-        </form>
-        </div>";
-        $ns -> tablerender(ARLAN_91, $text);
-}
-
-if($action == "sa"){
-        global $sql, $rs, $ns, $aj;
-        $text = "<div style='border : solid 1px #000; padding : 4px; width :auto; height : 200px; overflow : auto; '>\n";
-        if($article_total = $sql -> db_Select("content", "*", "content_type=15")){
-                $text .= "<table class='fborder' style='width:100%'>
-                <tr>
-                <td style='width:5%' class='forumheader2'>ID</td>
-                <td style='width:75%' class='forumheader2'>".ARLAN_96."</td>
-                <td style='width:20%; text-align:center' class='forumheader2'>".ARLAN_60."</td>
-                </tr>";
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        $tmp = explode("^", $content_author);
-                        $content_author = $tmp[0];
-                        $content_author_email = ($tmp[1] ? $tmp[1] : ARLAN_95);
-                        $text .= "<tr>
-                        <td style='width:5%; text-align:center; vertical-align:top' class='forumheader3'>$content_id</td>
-                        <td style='width:75%' class='forumheader3'><b>".$aj -> tpa($content_heading)."</b> [".$aj -> tpa($content_subheading)."]<br />$content_author ($content_author_email)</td>
-                        <td style='width:20%; text-align:center; vertical-align:top' class='forumheader3'>
-                        ".$rs -> form_button("submit", "category_edit", ARLAN_97, "onclick=\"document.location='".e_SELF."?create.sa.$content_id'\"")."
-                        ".$rs -> form_button("submit", "category_delete", ARLAN_62, "onclick=\"confirm_('sa', '$content_heading', $content_id);\"")."
-                        </td>
-                        </tr>\n";
-                }
-                $text .= "</table>";
-        }else{
-                $text .= "<div style='text-align:center'>".ARLAN_94."</div>";
-        }
-        $text .= "</div>";
-        $ns -> tablerender(ARLAN_93, $text);
-}
-
-// ##### Display options --------------------------------------------------------------------------------------------------------------------------------------------------------
-
-function article_adminmenu(){
-
-                global $action,$sql,$sub_action;
-                $act=$action;
-                if($act==""){$act="main";}
-                $var['main']['text']=ARLAN_76;
-                $var['main']['link']=e_SELF;
-
-                $var['create']['text']=ARLAN_77;
-                $var['create']['link']=e_SELF."?create";
-
-                $var['cat']['text']=ARLAN_78;
-                $var['cat']['link']=e_SELF."?cat";
-
-                $var['opt']['text']=ARLAN_60;
-                $var['opt']['link']=e_SELF."?opt";
-                if($sql -> db_Select("content", "*", "content_type ='15' ")){
-                        $var['sa']['text']=ARLAN_93;
-                        $var['sa']['link']=e_SELF."?sa";
-                }
-
-                show_admin_menu(ARLAN_79,$act,$var);
-
-                                        unset($var);
-                                        $var=array();
-                                        if($sql -> db_Select("content","content_id,content_heading","content_type='6'")){
-                                                 $var['cnone']['text']=ARLAN_75;
-                                                 $var['cnone']['link']=e_SELF."?c.none";
-                                                 while($row = $sql -> db_Fetch()){
-                                                         extract($row);
-                                                        $txt = substr($content_heading,0,15);
-                                                        if(strlen($content_heading)>15){
-                                                                $txt .= " ...";
-                                                        }
-                                                         $var['c'.$content_id]['text']=$txt;
-                                                         $var['c'.$content_id]['link']=e_SELF."?c.{$content_id}";
-                                                 }
-                                                 show_admin_menu(ARLAN_78,'c'.$sub_action,$var);
-                                         }
-
-
-
-}
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-require_once("footer.php");
-
-function headerjs(){
-global $etp;
-$script = "<script type=\"text/javascript\">
-function addtext2(sc){
-        document.getElementById('dataform').category_button.value = sc;
-}
-
-</script>\n";
-
-$script .= "<script type=\"text/javascript\">
-function confirm_(mode, content_heading, content_id){
-        if(mode == 'cat'){
-                return confirm(\"".$etp->unentity(ARLAN_80)." [ID \" + content_id + \": \" + content_heading + \"]\");
-        }else{
-                return confirm(\"".$etp->unentity(ARLAN_81)." [ID \" + content_id + \": \" + content_heading + \"]\");
-        }
-}
-</script>";
-return $script;
-
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/article.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2005/12/24 23:34:48 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+header('Location: admin.php');
+exit;
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/auth.php 75/e107_admin/auth.php
--- 6171/e107_admin/auth.php	2004-05-05 08:03:28.000000000 -0500
+++ 75/e107_admin/auth.php	2006-02-02 00:37:52.000000000 -0600
@@ -1,128 +1,175 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/auth.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-@include(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php");
-@include(e_LANGUAGEDIR."English/admin/lan_admin.php");
-if(ADMIN){
-	require_once(e_ADMIN."header.php");
-}else{
-	if($_POST['authsubmit']){
-		$obj = new auth;
-
-		$row = $authresult = $obj -> authcheck($_POST['authname'], $_POST['authpass']);
-		if($row[0] == "fop"){
-			echo "<script type='text/javascript'>document.location.href='admin.php?e'</script>\n";
-		}else if($row[0] == "fon"){
-			echo "<script type='text/javascript'>document.location.href='admin.php?f'</script>\n";
-		}else{
-
-			$userpass = md5($_POST['authpass']);
-			$cookieval = $row['user_id'].".".md5($userpass);
-
-			$sql -> db_Select("user", "*", "user_name='".$_POST['authname']."'");
-			list($user_id, $user_name, $userpass) = $sql-> db_Fetch();
-			if($pref['tracktype'] == "session"){
-				$_SESSION[$pref['cookie_name']] = $cookieval;
-			}else{
-				cookie($pref['cookie_name'], $cookieval, ( time()+3600*24*30));
-			}
-			echo "<script type='text/javascript'>document.location.href='admin.php'</script>\n";
-		}
-	}
-
-	require_once(e_ADMIN."header.php");
-
-	if(e_QUERY == "e"){
-		$text = "<div style=\"text-align:center\">".ADLAN_86."</div>";
-		$ns -> tablerender("Unable to login", $text);
-	}
-	if(e_QUERY == "f"){
-		$text = "<div style=\"text-align:center\">".ADLAN_87."</div>";
-		$ns -> tablerender(ADLAN_88, $text);
-	}
-
-	if(ADMIN == FALSE){
-		$obj = new auth;
-		$obj -> authform();
-		require_once(e_ADMIN."footer.php");
-		exit;
-	}
-}
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-class auth{
-	
-	function authform(){
-		/*
-		# Admin auth login
-		#
-		# - parameters		none
-		# - return				null
-		# - scope					public
-		*/
-		
-		$text =  "<div style='text-align:center'>
-		<form method='post' action='".e_SELF."'>\n
-<table style='width:50%' class='fborder'>
-<tr>
-<td style='width:35%' class='forumheader3'>".ADLAN_89."</td>
-<td class='forumheader3' style='text-align:center'><input class='tbox' type='text' name='authname' size='30' value='$authname' maxlength='20' />\n</td>
-</tr>
-<tr>
-<td style='width:35%' class='forumheader3'>".ADLAN_90."</td>
-<td class='forumheader3' style='text-align:center'><input class='tbox' type='password' name='authpass' size='30' value='' maxlength='20' />\n</td>
-</tr>
-<tr>
-<td colspan='2' style='text-align:center' class='forumheader'>
-
-<input class='button' type='submit' name='authsubmit' value='".ADLAN_91."' /> 
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$au = new e107table;
-$au -> tablerender(ADLAN_92, $text);
-	}
-
-	function authcheck($authname, $authpass){
-		/*
-		# Admin auth check
-		# - parameter #1:		string $authname, entered name
-		# - parameter #2:		string $authpass, entered pass
-		# - return				boolean if fail, else result array
-		# - scope					public
-		*/
-		$sql_auth = new db;
-		$authname = ereg_replace("\sOR\s|\=|\#", "", $authname);
-		if($sql_auth -> db_Select("user", "*", "user_name='$authname' AND user_admin='1' ")){
-			if($sql_auth -> db_Select("user", "*", "user_name='$authname' AND user_password='".md5($authpass)."' AND user_admin='1' ")){
-				$row = $sql_auth -> db_Fetch();
-				return $row;
-			}else{
-				$row = array("fop");
-				return $row;
-			}
-		}else{
-			$row = array("fon");
-			return $row;
-		}
-	}
-}
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/auth.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2006/02/02 06:37:52 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php");
+@include_once(e_LANGUAGEDIR."English/admin/lan_admin.php");
+if (ADMIN)
+{
+	define("ADMIN_PAGE", true);
+	require_once(e_ADMIN."header.php");
+}
+else
+{
+	$use_imagecode = ($pref['logcode'] && extension_loaded("gd"));
+	if ($use_imagecode)
+	{
+		require_once(e_HANDLER."secure_img_handler.php");
+		$sec_img = new secure_image;
+	}
+
+	if ($_POST['authsubmit'])
+	{
+		$obj = new auth;
+
+		if($use_imagecode)
+		{
+			if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify']))
+			{
+				echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
+				header("location: ../index.php");
+				exit;
+			}
+		}
+
+		$row = $authresult = $obj->authcheck($_POST['authname'], $_POST['authpass']);
+		if ($row[0] == "authfail") {
+			echo "<script type='text/javascript'>document.location.href='../index.php'</script>\n";
+			header("location: ../index.php");
+			exit;
+		} else {
+			 
+			$userpass = md5($_POST['authpass']);
+			$cookieval = $row['user_id'].".".md5($userpass);
+			 
+			$sql->db_Select("user", "*", "user_name='".$tp -> toDB($_POST['authname'])."'");
+			list($user_id, $user_name, $userpass) = $sql->db_Fetch();
+			if ($pref['tracktype'] == "session") {
+				$_SESSION[$pref['cookie_name']] = $cookieval;
+			} else {
+				cookie($pref['cookie_name'], $cookieval, (time()+3600 * 24 * 30));
+			}
+			echo "<script type='text/javascript'>document.location.href='admin.php'</script>\n";
+		}
+	}
+	 
+	$e_sub_cat = 'logout';
+	require_once(e_ADMIN."header.php");
+	 
+	if (ADMIN == FALSE) {
+		$obj = new auth;
+		$obj->authform();
+		require_once(e_ADMIN."footer.php");
+		exit;
+	}
+}
+	
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+class auth
+{
+	 
+	function authform()
+	{
+		/*
+		# Admin auth login
+		#
+		# - parameters	none
+		# - return		null
+		# - scope		public
+		*/
+		 
+		global $use_imagecode, $sec_img;
+		
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."'>\n
+			<table style='width:50%' class='fborder'>
+			<tr>
+			<td style='width:35%' class='forumheader3'>".ADLAN_89."</td>
+			<td class='forumheader3' style='text-align:center'><input class='tbox' type='text' name='authname' size='30' value='$authname' maxlength='20' />\n</td>
+			</tr>
+			<tr>
+			<td style='width:35%' class='forumheader3'>".ADLAN_90."</td>
+			<td class='forumheader3' style='text-align:center'><input class='tbox' type='password' name='authpass' size='30' value='' maxlength='20' />\n</td>
+			</tr>
+			";
+
+		if ($use_imagecode) {
+			$text .= "
+			<tr>
+			<td style='width:35%' class='forumheader3'>".ADLAN_152."</td>
+			<td style='text-align:center'>
+			<input type='hidden' name='rand_num' value='".$sec_img->random_number."'>".
+			$sec_img->r_image().
+			"<br /><input class='tbox' type='text' name='code_verify' size='15' maxlength='20'></td>
+			</tr>
+			";
+		}
+
+		$text .= "
+			<tr>
+			<td colspan='2' style='text-align:center' class='forumheader'>
+			 
+			<input class='button' type='submit' name='authsubmit' value='".ADLAN_91."' />
+			</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+		 
+		$au = new e107table;
+		$au->tablerender(ADLAN_92, $text);
+	}
+	 
+	function authcheck($authname, $authpass)
+	{
+		/*
+		# Admin auth check
+		# - parameter #1:                string $authname, entered name
+		# - parameter #2:                string $authpass, entered pass
+		# - return                                boolean if fail, else result array
+		# - scope                                        public
+		*/
+		global $tp;
+		$sql_auth = new db;
+		$authname = $tp -> toDB(preg_replace("/\sOR\s|\=|\#/", "", $authname));
+		if ($sql_auth->db_Select("user", "*", "user_loginname='$authname' AND user_admin='1' "))
+		{
+			$row = $sql_auth->db_Fetch();
+		}
+		else
+		{
+			if ($sql_auth->db_Select("user", "*", "user_name='$authname' AND user_admin='1' "))
+			{
+				$row = $sql_auth->db_Fetch();
+			}
+		}
+		if($row['user_id'])
+		{
+			if($row['user_password'] == md5($authpass))
+			{
+				return $row;
+			}
+		}
+		return array("authfail");
+	}
+}
+	
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/banlist.php 75/e107_admin/banlist.php
--- 6171/e107_admin/banlist.php	2004-09-10 03:28:16.000000000 -0500
+++ 75/e107_admin/banlist.php	2006-04-07 10:24:12.000000000 -0500
@@ -1,118 +1,123 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/banlist.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("4")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-require_once(e_HANDLER."form_handler.php");
-$rs = new form;
-
-if(e_QUERY){
-        $tmp = explode("-", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
-        unset($tmp);
-}
-
-if(IsSet($_POST['add_ban'])){
-        $aj = new textparse;
-        $bd = $_POST['ban_ip'];
-        $_POST['ban_reason'] = $aj -> formtpa($_POST['ban_reason'], "admin");
-        $sql -> db_Insert("banlist", "'$bd', '".ADMINID."', '".$_POST['ban_reason']."' ");
-        unset($ban_ip);
-}
-
-if(IsSet($_POST['update_ban'])){
-        $aj = new textparse;
-        $bd = $_POST['ban_ip'];
-        $_POST['ban_reason'] = $aj -> formtpa($_POST['ban_reason'], "admin");
-        $sql -> db_Insert("banlist", "'$bd', '".ADMINID."', '".$_POST['ban_reason']."' ");
-		$sql -> db_Delete("banlist", "banlist_ip='".$_POST['old_ip']."'");
-        $message = BANLAN_14;
-        unset($ban_ip);
-}
-
-if($action == "remove" && isset($_POST['ban_secure'])){
-        $sql -> db_Delete("banlist", "banlist_ip='$sub_action'");
-        $message = BANLAN_1;
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-if($action != "edit"){
-	$text = $rs -> form_open("post", e_SELF, "ban_form").$rs -> form_hidden("ban_secure","1")."<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 400px; overflow : auto; '>\n";
-	if(!$ban_total = $sql -> db_Select("banlist")){
-			$text .= "<div style='text-align:center'>".BANLAN_2."</div>";
-	}else{
-			$text .= "<table class='fborder' style='width:100%'>
-			<tr>
-			<td style='width:70%' class='forumheader2'>".BANLAN_10."</td>
-	<td style='width:30%' class='forumheader2'>".BANLAN_11."</td>
-	</tr>";
-			$count =0;
-			while($row = $sql -> db_Fetch()){
-					extract($row);
-					$text .= "<tr><td style='width:70%' class='forumheader3'>$banlist_ip<br />".BANLAN_7.": $banlist_reason</td>
-					<td style='width:30%; text-align:center' class='forumheader3'>".$rs -> form_button("submit", "main_edit_$count", BANLAN_12, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?edit-$banlist_ip'\"").$rs -> form_button("submit", "main_delete_$count", BANLAN_4, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?remove-$banlist_ip'\"")."</td>\n</tr>";
-			$count++;
-			}
-			$text .= "</table>\n";
-	}
-	$text .= "</div></div>".$rs -> form_close();
-	$ns -> tablerender(BANLAN_3, $text);
-}
-
-if($action == "edit"){
-  $sql2 -> db_Select("banlist", "*", "banlist_ip='$sub_action'");
-	$row = $sql2 ->db_Fetch();
-	extract($row);
-}else{
-	unset($banlist_ip, $banlist_reason);
-	if(e_QUERY && strpos($_SERVER["HTTP_REFERER"],"userinfo")){$banlist_ip=$action;}
-}
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:85%' class='fborder'>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".BANLAN_5.": </td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='ban_ip' size='40' value='".$banlist_ip."' maxlength='200' />
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".BANLAN_7.": </td>
-<td style='width:80%' class='forumheader3'>
-<textarea class='tbox' name='ban_reason' cols='50' rows='4'>$banlist_reason</textarea>
-</td>
-</tr>
-
-<tr style='vertical-align:top'>
-<td colspan='2' style='text-align:center' class='forumheader'>".
-
-($action == "edit" ? "<input type='hidden' name='old_ip' value='$banlist_ip' /><input class='button' type='submit' name='update_ban' value='".BANLAN_13."' />" : "<input class='button' type='submit' name='add_ban' value='".BANLAN_8."' />")."
-
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".BANLAN_9."</div>", $text);
-
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/banlist.php,v $
+|     $Revision: 1.17 $
+|     $Date: 2006/04/07 15:24:12 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("4")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'banlist';
+require_once("auth.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+
+if (e_QUERY) {
+	$tmp = explode("-", e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	$id = $tmp[2];
+	unset($tmp);
+}
+
+$_POST['ban_ip'] = trim($_POST['ban_ip']);
+
+if (isset($_POST['add_ban']) && $_POST['ban_ip'] != "" && strpos($_POST['ban_ip'], ' ') === false) {
+	$_POST['ban_reason'] = $tp->toDB($_POST['ban_reason']);
+	admin_update($sql -> db_Insert("banlist", "'".$_POST['ban_ip']."', '".ADMINID."', '".$_POST['ban_reason']."'"), 'insert');
+	unset($ban_ip);
+}
+
+if (isset($_POST['update_ban']) && $_POST['ban_ip'] != "" && strpos($_POST['ban_ip'], ' ') === false) {
+	$_POST['ban_reason'] = $tp->toDB($_POST['ban_reason']);
+	admin_update($sql -> db_Update("banlist", "banlist_ip='".$_POST['ban_ip']."', banlist_admin=".ADMINID.", banlist_reason='".$_POST['ban_reason']."' WHERE banlist_ip='".$_POST['old_ip']."'"));
+	unset($ban_ip);
+}
+
+if ($action == "remove" && isset($_POST['ban_secure'])) {
+	$sql -> db_Delete("generic", "gen_type='failed_login' AND gen_ip='$sub_action'");
+	admin_update($sql -> db_Delete("banlist", "banlist_ip='$sub_action'"), 'delete');
+}
+
+if ($action == "edit") {
+	$sql->db_Select("banlist", "*", "banlist_ip='$sub_action'");
+	$row = $sql->db_Fetch();
+	extract($row);
+} else {
+	unset($banlist_ip, $banlist_reason);
+	if (e_QUERY && strpos($_SERVER["HTTP_REFERER"], "userinfo")) {
+		$banlist_ip = $action;
+	}
+}
+
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+
+	<tr>
+	<td style='width:30%' class='forumheader3'>".BANLAN_5.": </td>
+	<td style='width:70%' class='forumheader3'>
+	<input class='tbox' type='text' name='ban_ip' size='40' value='".$banlist_ip."' maxlength='200' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:20%' class='forumheader3'>".BANLAN_7.": </td>
+	<td style='width:80%' class='forumheader3'>
+	<textarea class='tbox' name='ban_reason' cols='50' rows='4'>$banlist_reason</textarea>
+	</td>
+	</tr>
+
+	<tr style='vertical-align:top'>
+	<td colspan='2' style='text-align:center' class='forumheader'>".
+($action == "edit" ? "<input type='hidden' name='old_ip' value='$banlist_ip' /><input class='button' type='submit' name='update_ban' value='".LAN_UPDATE."' />" : "<input class='button' type='submit' name='add_ban' value='".BANLAN_8."' />")."
+
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+
+$ns->tablerender(BANLAN_9, $text);
+
+if ($action != "edit") {
+	$text = $rs->form_open("post", e_SELF, "ban_form")."<div style='text-align:center'>".$rs->form_hidden("ban_secure", "1");
+	if (!$ban_total = $sql->db_Select("banlist","*","ORDER BY banlist_ip","nowhere")) {
+		$text .= "<div style='text-align:center'>".BANLAN_2."</div>";
+	} else {
+		$text .= "<table class='fborder' style='".ADMIN_WIDTH."'>
+			<tr>
+			<td style='width:70%' class='fcaption'>".BANLAN_10."</td>
+			<td style='width:30%' class='fcaption'>".LAN_OPTIONS."</td>
+			</tr>";
+		$count = 0;
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			$banlist_reason = str_replace("LAN_LOGIN_18", BANLAN_11, $banlist_reason);
+			$text .= "<tr><td style='width:70%' class='forumheader3'>$banlist_ip<br />".BANLAN_7.": $banlist_reason</td>
+				<td style='width:30%; text-align:center' class='forumheader3'>".$rs->form_button("submit", "main_edit_$count", LAN_EDIT, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?edit-$banlist_ip'\"").$rs->form_button("submit", "main_delete_$count", BANLAN_4, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?remove-$banlist_ip'\"")."</td>\n</tr>";
+			$count++;
+		}
+		$text .= "</table>\n";
+	}
+	$text .= "</div>".$rs->form_close();
+	$ns->tablerender(BANLAN_3, $text);
+}
+
+require_once("footer.php");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/banner.php 75/e107_admin/banner.php
--- 6171/e107_admin/banner.php	2004-05-14 21:29:10.000000000 -0500
+++ 75/e107_admin/banner.php	2005-12-05 13:28:57.000000000 -0600
@@ -1,336 +1,670 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/banner.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("D")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-
-$qs = explode(".", e_QUERY);
-$action = $qs[0]; $id = $qs[1];
-
-$edit = ($action == "edit" ? TRUE : FALSE);
-$delete = ($action == "delete" ? TRUE : FALSE);
-
-$handle=opendir(e_IMAGE."banners/");
-while ($file = readdir($handle)){
-        if($file != "." && $file != ".."){
-                $images[] = $file;
-        }
-}
-
-if($_POST['createbanner'] || $_POST['updatebanner']){
-        if(!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? $start_date = 0 : $start_date = mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear']));
-        if(!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? $end_date = 0 : $end_date = mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']));
-
-        $cam = ($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']);
-        $cli = ($_POST['client_name'] ? $_POST['client_name'] : $_POST['banner_client_sel']);
-
-        if($_POST['createbanner']){
-                $sql -> db_Insert("banner", "0, '".$cli."', '".$_POST['client_login']."', '".$_POST['client_password']."', '".$_POST['banner_image']."', '".$_POST['click_url']."', '".$_POST['impressions_purchased']."', '$start_date', '$end_date', '".$_POST['banner_enabled']."', 0, 0, '', '".$cam."' ");
-                $message = "Banner Created";
-        }else{
-                $sql -> db_Update("banner", "banner_clientname='".$cli."', banner_clientlogin='".$_POST['client_login']."', banner_clientpassword='".$_POST['client_password']."', banner_image='".$_POST['banner_image']."', banner_clickurl='".$_POST['click_url']."', banner_impurchased='".$_POST['impressions_purchased']."', banner_startdate='$start_date', banner_enddate='$end_date', banner_active='".$_POST['banner_enabled']."', banner_campaign='".$cam."' WHERE banner_id='".$_POST['eid']."' ");
-                $message = "Banner Updated";
-        }
-        unset($_POST['client_name'], $_POST['client_login'], $_POST['client_password'], $_POST['banner_image'], $_POST['click_url'], $_POST['impressions_purchased'], $start_date, $end_date, $_POST['banner_enabled'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear']);
-}
-
-if(IsSet($_POST['confirm'])){
-        $sql -> db_Delete("banner", "banner_id='".$_POST['id']."' ");
-        $message = BNRLAN_1;
-}
-
-if($delete){
-        $text = "<div style=\"text-align:center\">
-        <b>".BNRLAN_2."</b>
-<br /><br />
-<form method=\"post\" action=\"".e_SELF."\">
-<input class=\"button\" type=\"submit\" name=\"cancel\" value=\"".BNRLAN_3."\" />
-<input class=\"button\" type=\"submit\" name=\"confirm\" value=\"".BNRLAN_4."\" />
-<input type=\"hidden\" name=\"id\" value=\"".$id."\">
-</form>
-</div>";
-$ns -> tablerender(BNRLAN_5, $text);
-
-        require_once("footer.php");
-        exit;
-}
-if(IsSet($_POST['cancel'])){
-        $message = BNRLAN_6;
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style=\"text-align:center\"><b>".$message."</b></div>");
-}
-
-if($sql -> db_Select("banner")){
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                if($banner_campaign){ $campaigns[] = $banner_campaign; }
-                if($banner_clientname){ $clients[] = $banner_clientname; }
-                if($banner_clientlogin){ $logins[] = $banner_clientlogin; }
-                if($banner_clientpassword){ $passwords[] = $banner_clientpassword; }
-        }
-}
-
-$text = "<table class=\"fborder\" style=\"width:98%\">
-<tr><td colspan=\"8\" style=\"text-align:center\" class=\"fcaption\">".BNRLAN_7."</td></tr>
-<tr>
-<td class=\"forumheader\" style=\"text-align:center\"><span class=\"smallblacktext\">".BNRLAN_8."</span></td>
-<td class=\"forumheader\" style=\"text-align:center\"><span class=\"smallblacktext\">".BNRLAN_9."</span></td>
-<td class=\"forumheader\" style=\"text-align:center\"><span class=\"smallblacktext\">".BNRLAN_10."</span></td>
-<td class=\"forumheader\" style=\"text-align:center\"><span class=\"smallblacktext\">".BNRLAN_11."</span></td>
-<td class=\"forumheader\" style=\"text-align:center\"><span class=\"smallblacktext\">".BNRLAN_12."</span></td>
-<td class=\"forumheader\" style=\"text-align:center\"><span class=\"smallblacktext\">".BNRLAN_13."</span></td>
-<td class=\"forumheader\" style=\"text-align:center\"><span class=\"smallblacktext\">".BNRLAN_14."</span></td>
-</tr>";
-
-if(!$banner_total = $sql -> db_Select("banner")){
-        $text .= "<tr>
-        <td colspan=\"8\" class=\"forumheader2\" style=\"text-align:center\">".BNRLAN_15."</td></tr>";
-}else{
-        while($row = $sql-> db_Fetch()){
-                extract($row);
-                if($edit && $id == $banner_id){
-
-                        $_POST['client_name'] = $banner_clientname;
-                        $_POST['client_login'] = $banner_clientlogin;
-                        $_POST['client_password'] = $banner_clientpassword;
-                        $_POST['banner_image'] = $banner_image;
-                        $_POST['click_url'] = $banner_clickurl;
-                        $_POST['impressions_purchased'] = $banner_impurchased;
-                        $_POST['banner_campaign'] = $banner_campaign;
-
-                        if($banner_startdate){$tmp = getdate($banner_startdate);$_POST['startmonth'] = $tmp['mon'];$_POST['startday'] = $tmp['mday'];$_POST['startyear'] = $tmp['year'];}
-                        if($banner_enddate){$tmp = getdate($banner_enddate);$_POST['endmonth'] = $tmp['mon'];$_POST['endday'] = $tmp['mday'];$_POST['endyear'] = $tmp['year'];}
-
-                }
-
-                $clickpercentage = ($banner_clicks && $banner_impressions ? round(($banner_clicks / $banner_impressions) * 100)."%" : "-");
-                $impressions_left = ($banner_impurchased ? $banner_impurchased - $banner_impressions : BNRLAN_16);
-                $impressions_purchased = ($banner_impurchased ? $banner_impurchased : BNRLAN_16);
-
-                $start_date = ($banner_startdate ? strftime("%d %B %Y", $banner_startdate) : BNRLAN_17);
-                $end_date = ($banner_enddate ? strftime("%d %B %Y", $banner_enddate) : BNRLAN_17);
-
-                $text.="<tr>
-                <td class=\"forumheader3\" style=\"text-align:center\">".$banner_id."</td>
-                <td class=\"forumheader3\" style=\"text-align:center\">".$banner_clientname."</td>
-                <td class=\"forumheader3\" style=\"text-align:center\">".$banner_clicks."</td>
-                <td class=\"forumheader3\" style=\"text-align:center\">".$clickpercentage."</td>
-                <td class=\"forumheader3\" style=\"text-align:center\">".$impressions_purchased."</td>
-                <td class=\"forumheader3\" style=\"text-align:center\">".$impressions_left."</td>
-                <td class=\"forumheader3\" style=\"text-align:center\"><a href=\"".e_SELF."?edit.".$banner_id."\">".BNRLAN_44."</a> - <a href=\"".e_SELF."?delete.".$banner_id."\">".BNRLAN_18."</a></td>
-                </tr><tr>
-                <td colspan=\"8\" class=\"forumheader3\" style=\"text-align:center\">
-
-                ".BNRLAN_39.": ". ($banner_active ? BNRLAN_19 : "<b>".BNRLAN_20."</b>")." |
-
-                ".BNRLAN_45.": ".$start_date." &lt;&gt; ".BNRLAN_21.": ".$end_date."</td></tr>
-                <tr><td colspan=\"8\">&nbsp;</td></tr>";
-        }
-}
-
-$text .= "</table>
-<br /><br />
-
-<form method=\"post\" action=\"".e_SELF."\">
-
-<table class=\"fborder\" style=\"width:98%\">
-<tr><td colspan=\"2\" style=\"text-align:center\" class=\"fcaption\">";
-
-$text .= ($edit ? BNRLAN_22 : BNRLAN_23);
-
-$text .= "</td></tr>
-<tr>
-<td class=\"forumheader3\">".BNRLAN_24."</td>
-<td class=\"forumheader3\">";
-if(count($campaigns)){
-        $text .= "<select name=\"banner_campaign_sel\" class=\"tbox\"><option></option>";
-        $c=0;
-        while($campaigns[$c]){
-                if (!isset($for_var[$campaigns[$c]])){
-                        $text .=($_POST['banner_campaign'] == $campaigns[$c] ? "<option selected='selected'>".$campaigns[$c]."</option>" : "<option>".$campaigns[$c]."</option>");
-                        $for_var[$campaigns[$c]] = $campaigns[$c];
-                }
-                $c++;
-        }
-        unset($for_var);
-
-        $text .= "</select> ".BNRLAN_25."&nbsp;&nbsp;";
-}
-$text .= " <input class=\"tbox\" type=\"text\" size=\"30\" maxlength=\"100\" name=\"banner_campaign\" value=\"\" />
-".BNRLAN_26."
-</td>
-</tr>
-
-<tr>
-<td class=\"forumheader3\">".BNRLAN_27."</td>
-<td class=\"forumheader3\">";
-
-if(count($clients)){
-        $text .= "<select name=\"banner_client_sel\" class=\"tbox\" onchange=\"Change_Details(this.form)\"><option></option>";
-        $c=0;
-        while($clients[$c]){
-                if (!isset($for_var[$clients[$c]])){
-                        $text .=($_POST['client_name'] == $clients[$c] ? "<option selected='selected'>".$clients[$c]."</option>" : "<option>".$clients[$c]."</option>");
-                        $for_var[$clients[$c]] = $clients[$c];
-                }
-                $c++;
-        }
-        unset($for_var);
-
-        $text .= "</select> ".BNRLAN_28."&nbsp;&nbsp;";
-        $text .= "<script type='text/javascript'>
-        function Change_Details(form){
-                var login_field = (document.all) ? document.all(\"clientlogin\") : document.getElementById(\"clientlogin\");
-                var password_field = (document.all) ? document.all(\"clientpassword\") : document.getElementById(\"clientpassword\");
-                  switch(form.banner_client_sel.selectedIndex-1){";
-
-                $c = 0;
-                $i = 0;
-                while($logins[$c]){
-                        if (!isset($for_var[$logins[$c]])){
-                                $text .= "
-                                case ".$i.":
-                                        login_field.value = \"".$logins[$c]."\";
-                                        password_field.value = \"".$passwords[$c]."\";
-                                        break;";
-                                $for_var[$logins[$c]] = $logins[$c];
-                                $i++;
-                        }
-                        $c++;
-                }
-                unset($for_var);
-
-        $text .= "
-                                default:
-                                        login_field.value = \"\";
-                                        password_field.value = \"\";
-                                        break;
-                }
-        }
-        </script>";
-}
-
-$text .= "<input class=\"tbox\" type=\"text\" size=\"30\" maxlength=\"100\" name=\"client_name\" value=\"\" />
-".BNRLAN_29."
-</td></tr>
-
-<tr>
-<td class=\"forumheader3\">".BNRLAN_30."</td>
-<td class=\"forumheader3\">
-<input class=\"tbox\" type=\"text\" size=\"30\" maxlength=\"20\" id=\"clientlogin\" name=\"client_login\" value=\"".$_POST['client_login']."\" />
-</td></tr>
-
-<tr>
-<td class=\"forumheader3\">".BNRLAN_31."</td>
-<td class=\"forumheader3\">
-<input class=\"tbox\" type=\"text\" size=\"30\" maxlength=\"50\" id=\"clientpassword\" name=\"client_password\" value=\"".$_POST['client_password']."\" />
-</td></tr>
-
-<tr>
-<td class=\"forumheader3\">".BNRLAN_32."</td>
-<td class=\"forumheader3\">
-<input class=\"button\" type =\"button\" value=\"".BNRLAN_43."\" onclick=\"expandit(this)\" />
-<div style=\"display:none\"><br />";
-$c=0;
-while($images[$c]){
-        $fileext1 = substr(strrchr($images[$c], "."), 1);
-        $fileext2 = substr(strrchr($images[$c], "."), 0);
-
-        $text .= "<input type=\"radio\" name=\"banner_image\" value=\"".$images[$c]."\"";
-        if($images[$c] == $_POST['banner_image']){
-                $text .= "checked='checked'";
-        }
-
-        if ($fileext1 == swf){
-                $text .= " /> <br><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"468\" height=\"60\">
-                <param name=\"movie\" value=\"".e_IMAGE."banners/".$images[$c]."\">
-                 <param name=\"quality\" value=\"high\"><param name=\"SCALE\" value=\"noborder\">
-                 <embed src=\"".e_IMAGE."banners/".$images[$c]."\" width=\"468\" height=\"60\" scale=\"noborder\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"></embed></object>
-                <br />";
-        }else if($fileext1 == "php" || $fileext1 == "html" || $fileext1 == "js"){
-                $text .= " /> ".BNRLAN_46.": ".$images[$c];
-        }else{
-                $text .= " /> <img src=\"".e_IMAGE."banners/".$images[$c]."\" alt=\"\" /><br />";
-        }
-        $c++;
-}
-$text .= "</div></td></tr>
-
-<tr>
-<td class=\"forumheader3\">".BNRLAN_33."</td>
-<td class=\"forumheader3\">
-<input class=\"tbox\" type=\"text\" size=\"70\" maxlength=\"150\" name=\"click_url\" value=\"".$_POST['click_url']."\" />
-</td></tr>
-
-<tr>
-<td class=\"forumheader3\">".BNRLAN_34."</td>
-<td class=\"forumheader3\">
-<input class=\"tbox\" type=\"text\" size=\"10\" maxlength=\"10\" name=\"impressions_purchased\" value=\"".$_POST['impressions_purchased']."\" /> 0 = ".BNRLAN_35."
-</td></tr>
-
-<tr>
-<td class=\"forumheader3\">".BNRLAN_36."</td>
-<td class=\"forumheader3\"><select name=\"startday\" class=\"tbox\"><option selected='selected'> </option>";
-for($a=1; $a<=31; $a++){
-        $text .= ($a == $_POST['startday'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-}
-$text .= "</select> <select name=\"startmonth\" class=\"tbox\"><option selected='selected'> </option>";
-for($a=1; $a<=12; $a++){
-        $text .= ($a == $_POST['startmonth'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-}
-$text .= "</select> <select name=\"startyear\" class=\"tbox\"><option selected='selected'> </option>";
-for($a=2003; $a<=2010; $a++){
-        $text .= ($a == $_POST['startyear'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-}
-$text .= "</select> ".BNRLAN_38."
-</td></tr>
-
-<tr>
-<td class=\"forumheader3\">".BNRLAN_37."</td>
-<td class=\"forumheader3\">
-<select name=\"endday\" class=\"tbox\"><option selected='selected'> </option>";
-for($a=1; $a<=31; $a++){
-        $text .= ($a == $_POST['endday'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-}
-$text .= "</select> <select name=\"endmonth\" class=\"tbox\"><option selected='selected'> </option>";
-for($a=1; $a<=12; $a++){
-        $text .= ($a == $_POST['endmonth'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-}
-$text .= "</select> <select name=\"endyear\" class=\"tbox\"><option selected='selected'> </option>";
-for($a=2003; $a<=2010; $a++){
-        $text .= ($a == $_POST['endyear'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-}
-$text .= "</select> ".BNRLAN_38."
-</td>
-</tr>
-
-<tr>
-<td class=\"forumheader3\">".BNRLAN_39."?</td>
-<td class=\"forumheader3\">
-<input name=\"banner_enabled\" type=\"radio\" value=\"1\" checked='checked' />".BNRLAN_19."&nbsp;&nbsp;<input name=\"banner_enabled\" type=\"radio\" value=\"0\" />".BNRLAN_20."
-</td></tr>
-
-<tr><td colspan=\"2\" style=\"text-align:center\" class=\"forumheader\">";
-$text .= ($edit ? "<input class=\"button\" type=\"submit\" name=\"updatebanner\" value=\"".BNRLAN_40."\" /><input type=\"hidden\" name=\"eid\" value=\"".$id."\"" : "<input class=\"button\" type=\"submit\" name=\"createbanner\" value=\"".BNRLAN_41."\" />");
-
-$text .= "</td></tr></table>
-</form>";
-
-$ns -> tablerender(BNRLAN_42, $text);
-
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/banner.php,v $
+|     $Revision: 1.26 $
+|     $Date: 2005/12/05 19:28:57 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("D")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'banner';
+require_once("auth.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+require_once(e_HANDLER."userclass_class.php");
+require_once(e_HANDLER."file_class.php");
+$fl = new e_file;
+
+$lan_file = e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php";
+include_once(file_exists($lan_file) ? $lan_file : e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php");
+
+
+if(e_QUERY)
+{
+	list($action, $sub_action, $id) = explode(".", e_QUERY);
+}
+
+$reject = array('$.','$..','/','CVS','thumbs.db','*._$',"thumb_", 'index', '.DS_Store');
+$images = $fl->get_files(e_IMAGE."banners/","",$reject);
+
+if (isset($_POST['update_menu'])) {
+	foreach($_POST as $k => $v) {
+		if (strpos($k, "banner_") === 0) {
+			$menu_pref[$k] = $v;
+		}
+	}
+
+	if (isset($_POST['catid'])) {
+		$array_cat = explode("-", $_POST['catid']);
+		for($i = 0; $i < count($array_cat); $i++) {
+			$cat .= $array_cat[$i]."|";
+		}
+		$cat = substr($cat, 0, -1);
+		$menu_pref['banner_campaign'] = $cat;
+	}
+
+	$sysprefs->setArray('menu_pref');
+	$message = BANNER_MENU_L2;
+}
+
+
+
+if ($_POST['createbanner'] || $_POST['updatebanner'])
+{
+
+	$start_date = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear']));
+
+	$end_date = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']));
+
+	$cli = ($_POST['client_name'] ? $_POST['client_name'] : $_POST['banner_client_sel']);
+
+	if ($_POST['banner_pages']) {
+		$postcampaign = ($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']);
+		$pagelist = explode("\r\n", $_POST['banner_pages']);
+		for($i = 0 ; $i < count($pagelist) ; $i++) {
+			$pagelist[$i] = trim($pagelist[$i]);
+		}
+		$plist = implode("|", $pagelist);
+		$pageparms = $postcampaign."^".$_POST['banner_listtype']."-".$plist;
+		$pageparms = preg_replace("#\|$#", "", $pageparms);
+		$pageparms = (trim($_POST['banner_pages']) == '') ? '' :
+		 $pageparms;
+		$cam = $pageparms;
+	} else {
+		$cam = ($_POST['banner_campaign'] ? $_POST['banner_campaign'] : $_POST['banner_campaign_sel']);
+	}
+
+	if ($_POST['createbanner']) {
+		admin_update($sql->db_Insert("banner", "0, '".$cli."', '".$_POST['client_login']."', '".$_POST['client_password']."', '".$_POST['banner_image']."', '".$_POST['click_url']."', '".intval($_POST['impressions_purchased'])."', '$start_date', '$end_date', '".$_POST['banner_class']."', 0, 0, '', '".$cam."'"), 'insert', BNRLAN_63);
+	} else {
+		admin_update($sql->db_Update("banner", "banner_clientname='".$cli."', banner_clientlogin='".$_POST['client_login']."', banner_clientpassword='".$_POST['client_password']."', banner_image='".$_POST['banner_image']."', banner_clickurl='".$_POST['click_url']."', banner_impurchased='".intval($_POST['impressions_purchased'])."', banner_startdate='$start_date', banner_enddate='$end_date', banner_active='".$_POST['banner_class']."', banner_campaign='".$cam."' WHERE banner_id='".$_POST['eid']."'"), 'update', BNRLAN_64);
+	}
+	unset($_POST['client_name'], $_POST['client_login'], $_POST['client_password'], $_POST['banner_image'], $_POST['click_url'], $_POST['impressions_purchased'], $start_date, $end_date, $_POST['banner_enabled'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear'], $_POST['banner_class'], $_POST['banner_pages'], $_POST['banner_listtype']);
+}
+
+if (isset($_POST['confirm'])) {
+	admin_update($sql->db_Delete("banner", "banner_id='".$_POST['id']."' "), 'delete', BNRLAN_1);
+}
+
+if ($action == "delete" && $sub_action) {
+	$text = "<div style='text-align:center'>
+		<b>".BNRLAN_2."</b>
+		<br /><br />
+		<form method='post' action='".e_SELF."'>
+		<input class='button' type='submit' name='cancel' value='".LAN_CANCEL."' />
+		<input class='button' type='submit' name='confirm' value='".LAN_CONFDELETE."' />
+		<input type='hidden' name='id' value='".$sub_action."'>
+		</form>
+		</div>";
+	$ns->tablerender(BNRLAN_5, $text);
+
+	require_once("footer.php");
+	exit;
+}
+if (isset($_POST['cancel'])) {
+	$message = BNRLAN_6;
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+if ($sql->db_Select("banner")) {
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+
+		if (strpos($banner_campaign, "^") !== FALSE) {
+			$campaignsplit = explode("^", $banner_campaign);
+			$banner_campaign = $campaignsplit[0];
+		}
+
+		if ($banner_campaign) {
+			$campaigns[] = $banner_campaign;
+		}
+		if ($banner_clientname) {
+			$clients[] = $banner_clientname;
+		}
+		if ($banner_clientlogin) {
+			$logins[] = $banner_clientlogin;
+		}
+		if ($banner_clientpassword) {
+			$passwords[] = $banner_clientpassword;
+		}
+	}
+}
+
+
+if (!$action) {
+	$text = "
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr><td colspan='7' style='text-align:center' class='fcaption'>".BNRLAN_7."</td></tr>
+		<tr>
+		<td class='forumheader' style='text-align:center'>".BNRLAN_8."</td>
+		<td class='forumheader' style='text-align:center'>".BNRLAN_9."</td>
+		<td class='forumheader' style='text-align:center'>".BNRLAN_10."</td>
+		<td class='forumheader' style='text-align:center'>".BNRLAN_11."</td>
+		<td class='forumheader' style='text-align:center'>".BNRLAN_12."</td>
+		<td class='forumheader' style='text-align:center'>".BNRLAN_13."</td>
+		<td class='forumheader' style='text-align:center'>".LAN_OPTIONS."</td>
+		</tr>";
+
+	if (!$banner_total = $sql->db_Select("banner")) {
+		$text .= "<tr><td colspan='7' class='forumheader3' style='text-align:center'>".BNRLAN_15."</td></tr>";
+	} else {
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+
+			$clickpercentage = ($banner_clicks && $banner_impressions ? round(($banner_clicks / $banner_impressions) * 100)."%" : "-");
+			$impressions_left = ($banner_impurchased ? $banner_impurchased - $banner_impressions : BNRLAN_16);
+			$impressions_purchased = ($banner_impurchased ? $banner_impurchased : BNRLAN_16);
+
+			$start_date = ($banner_startdate ? strftime("%d %B %Y", $banner_startdate) : BNRLAN_17);
+			$end_date = ($banner_enddate ? strftime("%d %B %Y", $banner_enddate) : BNRLAN_17);
+
+			if (strpos($banner_campaign, "^") !== FALSE) {
+				$campaignsplit = explode("^", $banner_campaign);
+				$banner_campaign = $campaignsplit[0];
+				$textvisivilitychanged = "(*)";
+			} else {
+				$textvisivilitychanged = "";
+			}
+
+			$text .= "<tr>
+				<td class='forumheader3' style='text-align:center'>".$banner_id."</td>
+				<td class='forumheader3' style='text-align:center'>".$banner_clientname."</td>
+				<td class='forumheader3' style='text-align:center'>".$banner_clicks."</td>
+				<td class='forumheader3' style='text-align:center'>".$clickpercentage."</td>
+				<td class='forumheader3' style='text-align:center'>".$impressions_purchased."</td>
+				<td class='forumheader3' style='text-align:center'>".$impressions_left."</td>
+				<td class='forumheader3' style='text-align:center'><a href='".e_SELF."?create.edit.".$banner_id."'>".ADMIN_EDIT_ICON."</a> <a href='".e_SELF."?delete.".$banner_id."'>".ADMIN_DELETE_ICON."</a></td>
+				</tr>
+				<tr>
+				<td class='forumheader3' style='text-align:center'>&nbsp;</td>
+				<td class='forumheader3' style='text-align:center'>".$banner_campaign."</td>
+				<td colspan='2' class='forumheader3' style='text-align:center'>".r_userclass_name($banner_active)." ".$textvisivilitychanged."</td>
+				<td colspan='3' class='forumheader3' style='text-align:center'>".BNRLAN_45.": ".$start_date." &lt;&gt; ".BNRLAN_21.": ".$end_date."</td>
+				</tr>
+				<tr><td colspan='8'>&nbsp;</td></tr>";
+		}
+	}
+	$text .= "</table></div>";
+
+	$ns->tablerender(BNRLAN_42, $text);
+}
+
+if ($action == "create") {
+
+	if ($sub_action == "edit" && $id) {
+		if (!$sql->db_Select("banner", "*", "banner_id = '".$id."' " )) {
+			$text .= "<div style='text-align:center;'>".BNRLAN_15."</div>";
+		} else {
+			while ($row = $sql->db_Fetch()) {
+				extract($row);
+
+				$_POST['client_name'] = $banner_clientname;
+				$_POST['client_login'] = $banner_clientlogin;
+				$_POST['client_password'] = $banner_clientpassword;
+				$_POST['banner_image'] = $banner_image;
+				$_POST['click_url'] = $banner_clickurl;
+				$_POST['impressions_purchased'] = $banner_impurchased;
+				$_POST['banner_campaign'] = $banner_campaign;
+				$_POST['banner_active'] = $banner_active;
+
+				if ($banner_startdate) {
+					$tmp = getdate($banner_startdate);
+					$_POST['startmonth'] = $tmp['mon'];
+					$_POST['startday'] = $tmp['mday'];
+					$_POST['startyear'] = $tmp['year'];
+				}
+				if ($banner_enddate) {
+					$tmp = getdate($banner_enddate);
+					$_POST['endmonth'] = $tmp['mon'];
+					$_POST['endday'] = $tmp['mday'];
+					$_POST['endyear'] = $tmp['year'];
+				}
+
+				if (strpos($_POST['banner_campaign'], "^") !== FALSE) {
+					$campaignsplit = explode("^", $_POST['banner_campaign']);
+					$listtypearray = explode("-", $campaignsplit[1]);
+					$listtype = $listtypearray[0];
+					$campaign_pages = str_replace("|", "\n", $listtypearray[1]);
+					$_POST['banner_campaign'] = $campaignsplit[0];
+				} else {
+					$_POST['banner_campaign'] = $banner_campaign;
+				}
+
+			}
+		}
+	}
+
+	$text = "
+		<div style='text-align: center;'>
+		<form method='post' action='".e_SELF."'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr><td colspan='2' style='text-align:center' class='fcaption'>".($sub_action == "edit" ? BNRLAN_22 : BNRLAN_23)."</td></tr>
+		<tr>
+		<td class='forumheader3'>".BNRLAN_24."</td>
+		<td class='forumheader3'>";
+	if (count($campaigns)) {
+		$text .= "<select name='banner_campaign_sel' class='tbox'><option></option>";
+		$c = 0;
+		while ($campaigns[$c]) {
+			if (!isset($for_var[$campaigns[$c]])) {
+				$text .= ($_POST['banner_campaign'] == $campaigns[$c] ? "<option selected='selected'>".$campaigns[$c]."</option>" : "<option>".$campaigns[$c]."</option>");
+				$for_var[$campaigns[$c]] = $campaigns[$c];
+			}
+			$c++;
+		}
+		unset($for_var);
+
+		$text .= "</select> ".BNRLAN_25."&nbsp;&nbsp;";
+	}
+	$text .= " <input class='tbox' type='text' size='30' maxlength='100' name='banner_campaign' value='' />
+		".BNRLAN_26."
+		</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3'>".BNRLAN_27."</td>
+		<td class='forumheader3'>";
+
+	if (count($clients)) {
+		$text .= "<select name='banner_client_sel' class='tbox' onchange=\"Change_Details(this.form)\"><option></option>";
+		$c = 0;
+		while ($clients[$c]) {
+			if (!isset($for_var[$clients[$c]])) {
+				$text .= ($_POST['client_name'] == $clients[$c] ? "<option selected='selected'>".$clients[$c]."</option>" : "<option>".$clients[$c]."</option>");
+				$for_var[$clients[$c]] = $clients[$c];
+			}
+			$c++;
+		}
+		unset($for_var);
+
+		$text .= "</select> ".BNRLAN_28."&nbsp;&nbsp;";
+		$text .= "<script type='text/javascript'>
+			function Change_Details(form){
+			var login_field = (document.all) ? document.all(\"clientlogin\") : document.getElementById(\"clientlogin\");
+			var password_field = (document.all) ? document.all(\"clientpassword\") : document.getElementById(\"clientpassword\");
+			switch(form.banner_client_sel.selectedIndex-1){";
+
+		$c = 0;
+		$i = 0;
+		while ($logins[$c]) {
+			if (!isset($for_var[$logins[$c]])) {
+				$text .= "
+					case ".$i.":
+					login_field.value = \"".$logins[$c]."\";
+					password_field.value = \"".$passwords[$c]."\";
+					break;";
+				$for_var[$logins[$c]] = $logins[$c];
+				$i++;
+			}
+			$c++;
+		}
+		unset($for_var);
+
+		$text .= "
+			default:
+			login_field.value = \"\";
+			password_field.value = \"\";
+			break;
+			}
+			}
+			</script>";
+	}
+
+	$text .= "<input class='tbox' type='text' size='30' maxlength='100' name='client_name' value='' />
+		".BNRLAN_29."
+		</td></tr>
+
+		<tr>
+		<td class='forumheader3'>".BNRLAN_30."</td>
+		<td class='forumheader3'>
+		<input class='tbox' type='text' size='30' maxlength='20' id='clientlogin' name='client_login' value='".$_POST['client_login']."' />
+		</td></tr>
+
+		<tr>
+		<td class='forumheader3'>".BNRLAN_31."</td>
+		<td class='forumheader3'>
+		<input class='tbox' type='text' size='30' maxlength='50' id='clientpassword' name='client_password' value='".$_POST['client_password']."' />
+		</td></tr>
+
+		<tr>
+		<td class='forumheader3'>".BNRLAN_32."</td>
+		<td class='forumheader3'>
+		<input class='button' type ='button' value='".BNRLAN_43."' onclick='expandit(this)' />
+		<div style='display:none'><br />";
+	$c = 0;
+	while ($images[$c])
+	{
+
+		$image = $images[$c]['path'].$images[$c]['fname'];
+
+		$fileext1 = substr(strrchr($image, "."), 1);
+		$fileext2 = substr(strrchr($image, "."), 0);
+
+		$text .= "<input type='radio' name='banner_image' value='".$images[$c]['fname']."'";
+
+		if (basename($image) == $_POST['banner_image']) {
+			$text .= "checked='checked'";
+		}
+
+		if ($fileext1 == swf) {
+			$text .= " /> <br><object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='468' height='60'>
+				<param name='movie' value='".e_IMAGE."banners/".$images[$c]['fname']."'>
+				<param name='quality' value='high'><param name='SCALE' value='noborder'>
+				<embed src='".e_IMAGE."banners/".$images[$c]['fname']."' width='468' height='60' scale='noborder' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>
+				<br />";
+		}
+		else if($fileext1 == "php" || $fileext1 == "html" || $fileext1 == "js") {
+			$text .= " /> ".BNRLAN_46.": ".$images[$c]['fname']."<br />";
+		} else {
+			$text .= " /> <img src='$image' alt='' /><br />";
+		}
+		$c++;
+	}
+	$text .= "</div></td></tr>
+
+		<tr>
+		<td class='forumheader3'>".BNRLAN_33."</td>
+		<td class='forumheader3'>
+		<input class='tbox' type='text' size='70' maxlength='150' name='click_url' value='".$_POST['click_url']."' />
+		</td></tr>
+
+		<tr>
+		<td class='forumheader3'>".BNRLAN_34."</td>
+		<td class='forumheader3'>
+		<input class='tbox' type='text' size='10' maxlength='10' name='impressions_purchased' value='".$_POST['impressions_purchased']."' /> 0 = ".BNRLAN_35."
+		</td></tr>
+
+		<tr>
+		<td class='forumheader3'>".BNRLAN_36."</td>
+		<td class='forumheader3'><select name='startday' class='tbox'><option selected='selected'> </option>";
+	for($a = 1; $a <= 31; $a++) {
+		$text .= ($a == $_POST['startday'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
+	}
+	$text .= "</select> <select name='startmonth' class='tbox'><option selected='selected'> </option>";
+	for($a = 1; $a <= 12; $a++) {
+		$text .= ($a == $_POST['startmonth'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
+	}
+	$text .= "</select> <select name='startyear' class='tbox'><option selected='selected'> </option>";
+	for($a = 2003; $a <= 2010; $a++) {
+		$text .= ($a == $_POST['startyear'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
+	}
+	$text .= "</select> ".BNRLAN_38."
+		</td></tr>
+
+		<tr>
+		<td class='forumheader3'>".BNRLAN_37."</td>
+		<td class='forumheader3'>
+		<select name='endday' class='tbox'><option selected='selected'> </option>";
+	for($a = 1; $a <= 31; $a++) {
+		$text .= ($a == $_POST['endday'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
+	}
+	$text .= "</select> <select name='endmonth' class='tbox'><option selected='selected'> </option>";
+	for($a = 1; $a <= 12; $a++) {
+		$text .= ($a == $_POST['endmonth'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
+	}
+	$text .= "</select> <select name='endyear' class='tbox'><option selected='selected'> </option>";
+	for($a = 2003; $a <= 2010; $a++) {
+		$text .= ($a == $_POST['endyear'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
+	}
+	$text .= "</select> ".BNRLAN_38."
+		</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3'>".BNRLAN_39."</td>
+		<td class='forumheader3'>
+		".MENLAN_4."
+		".r_userclass("banner_class", $_POST['banner_active'], "off", "public,member,guest,admin,classes,nobody,classes")."
+		</td></tr>
+
+
+
+		<tr><td colspan='2' style='text-align:center' class='forumheader'>";
+	$text .= ($sub_action == "edit" && $id ? "<input class='button' type='submit' name='updatebanner' value='".BNRLAN_40."' /><input type='hidden' name='eid' value='".$id."'" : "<input class='button' type='submit' name='createbanner' value='".BNRLAN_41."' />");
+
+	$text .= "</td></tr></table>
+		</form>";
+
+	$ns->tablerender(BNRLAN_42, $text);
+
+}
+
+
+
+if ($action == "menu")
+{
+
+	$array_cat_in = explode("|", $menu_pref['banner_campaign']);
+	if (!$menu_pref['banner_caption'])
+	{
+		$menu_pref['banner_caption'] = BANNER_MENU_L1;
+	}
+
+	$category_total = $sql -> db_Select("banner", "DISTINCT(banner_campaign) as banner_campaign", "ORDER BY banner_campaign", "mode=no_where");
+	while ($row = $sql -> db_Fetch())
+	{
+		extract($row);
+		if (in_array($banner_campaign, $array_cat_in))
+		{
+			$in_catname[] = $banner_campaign;
+		} else {
+			$out_catname[] = $banner_campaign;
+		}
+	}
+
+
+	$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."' name='menu_conf_form'>
+	<table style='".ADMIN_WIDTH."' class='fborder' >
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".BANNER_MENU_L3.": </td>
+	<td style='width:60%' class='forumheader3'>
+	<input class='tbox' type='text' name='banner_caption' size='20' value='".$menu_pref['banner_caption']."' maxlength='100' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".BANNER_MENU_L6."</td>
+	<td style='width:60%' class='forumheader3'>
+
+	<table style='width:90%'>
+	<tr>
+	<td style='width:45%; vertical-align:top'>".BANNER_MENU_L7."<br />
+	<select class='tbox' id='catout' name='catout' size='10' style='width:180px' multiple='multiple' onchange='moveOver();'>\n";
+
+	foreach($out_catname as $name)
+	{
+		$text .= "<option value='$name'>$name</option>\n";
+	}
+
+	$text .= "</select>
+	</td>
+	<td style='width:45%; vertical-align:top'>".BANNER_MENU_L8."<br />
+	<select class='tbox' id='catin' name='catin' size='10' style='width:180px' multiple='multiple'>\n";
+
+	$catidvalues = "";
+	foreach($in_catname as $name)
+	{
+		$text .= "<option value='$name'>$name</option>\n";
+		$catidvalues .= $name."-";
+	}
+
+	$text .= "</select><br /><br />
+	<input class='button' type='button' value='".BANNER_MENU_L9."' onclick='removeMe();' />
+	<input type='hidden' name='catid' id='catid' value='".$catidvalues."'>
+	</td>
+	</tr>
+	</table>
+
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".BANNER_MENU_L10."</td>
+	<td style='width:60%' class='forumheader3'>
+	<select class='tbox' id='banner_rendertype' name='banner_rendertype' size='1'>
+	".$rs->form_option(BANNER_MENU_L12, ($menu_pref['banner_rendertype'] == 1 ? "1" : "0"), 1)."
+	".$rs->form_option(BANNER_MENU_L13, ($menu_pref['banner_rendertype'] == 2 ? "1" : "0"), 2)."
+	".$rs->form_select_close()."
+	</td>
+	</tr>
+
+	<tr>
+	<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='".BANNER_MENU_L18."' /></td>
+	</tr>
+
+	</table>
+	</form>
+	</div>";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+	$ns->tablerender(BANNER_MENU_L5, $text);
+	echo "<script type=\"text/javascript\">
+		//<!--
+		//<!-- Adapted from original:  Kathi O'Shea (Kathi.O'Shea@internet.com) -->
+
+		function moveOver(){
+		var boxLength = document.getElementById('catin').length;
+		var selectedItem = document.getElementById('catout').selectedIndex;
+		var selectedText = document.getElementById('catout').options[selectedItem].text;
+		var selectedValue = document.getElementById('catout').options[selectedItem].value;
+
+		var i;
+		var isNew = true;
+		if (boxLength != 0) {
+		for (i = 0; i < boxLength; i++) {
+		thisitem = document.getElementById('catin').options[i].text;
+		if (thisitem == selectedText) {
+		isNew = false;
+		break;
+		}
+		}
+		}
+		if (isNew) {
+		newoption = new Option(selectedText, selectedValue, false, false);
+		document.getElementById('catin').options[boxLength] = newoption;
+		document.getElementById('catout').options[selectedItem].text = '';
+		}
+		document.getElementById('catout').selectedIndex=-1;
+
+		saveMe();
+		}
+
+		function removeMe() {
+		var boxLength = document.getElementById('catin').length;
+		var boxLength2 = document.getElementById('catout').length;
+		arrSelected = new Array();
+		var count = 0;
+		for (i = 0; i < boxLength; i++) {
+		if (document.getElementById('catin').options[i].selected) {
+		arrSelected[count] = document.getElementById('catin').options[i].value;
+		var valname = document.getElementById('catin').options[i].text;
+		for (j = 0; j < boxLength2; j++) {
+		if (document.getElementById('catout').options[j].value == arrSelected[count]){
+		document.getElementById('catout').options[j].text = valname;
+		}
+		}
+		}
+		count++;
+		}
+		var x;
+		for (i = 0; i < boxLength; i++) {
+		for (x = 0; x < arrSelected.length; x++) {
+		if (document.getElementById('catin').options[i].value == arrSelected[x]) {
+		document.getElementById('catin').options[i] = null;
+		}
+		}
+		boxLength = document.getElementById('catin').length;
+		}
+
+		saveMe();
+		}
+
+		//function clearMe(clid){
+		// location.href = document.location + \"?clear.\" + clid;
+		//}
+
+		function saveMe(clid) {
+		var strValues = \"\";
+		var boxLength = document.getElementById('catin').length;
+		var count = 0;
+		if (boxLength != 0) {
+		for (i = 0; i < boxLength; i++) {
+		if (count == 0) {
+		strValues = document.getElementById('catin').options[i].value;
+		}
+		else {
+		strValues = strValues + \"-\" + document.getElementById('catin').options[i].value;
+		}
+		count++;
+		}
+		}
+		if (strValues.length == 0) {
+		//alert(\"You have not made any selections\");
+		document.getElementById('catid').value = \"\";
+		}
+		else {
+		document.getElementById('catid').value = strValues;
+		}
+		}
+
+		// -->
+		</script>\n";
+}
+
+
+function banner_adminmenu() {
+
+	global $action, $sql, $sub_action, $id;
+	$act = $action;
+	if ($act == "") {
+		$act = "main";
+	}
+	$var['main']['text'] = BNRLAN_58;
+	$var['main']['link'] = e_SELF;
+
+	$var['create']['text'] = BNRLAN_59;
+	$var['create']['link'] = e_SELF."?create";
+
+	$var['menu']['text'] = BNRLAN_61;
+	$var['menu']['link'] = e_SELF."?menu";
+
+	show_admin_menu(BNRLAN_62, $act, $var);
+}
+
+require_once("footer.php");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/cache.php 75/e107_admin/cache.php
--- 6171/e107_admin/cache.php	2004-05-16 20:53:28.000000000 -0500
+++ 75/e107_admin/cache.php	2006-02-16 15:51:39.000000000 -0600
@@ -1,83 +1,87 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/cache.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("0")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-require_once(e_HANDLER."cache_handler.php");
-$ec = new ecache;
-
-if(IsSet($_POST['submit_cache'])){
-	$pref['cachestatus'] = $_POST['cachestatus'];
-	save_prefs();
-	$ec -> clear();
-	$message = CACLAN_4;
-}
-
-if(IsSet($_POST['empty_cache'])){
-	$ec -> clear();
-	$message = CACLAN_6;
-}
-
-if(IsSet($message)){
-	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:85%' class='fborder'>
-<tr>
-<td style='width:98' class='forumheader'>".CACLAN_1."</td>
-</tr>
-<tr>
-<td style='width:98%' class='forumheader3'>";
-$text .= (!$pref['cachestatus']) ? "<input class='tbox' type='radio' name='cachestatus' value='0' checked='checked' />" : "<input type='radio' name='cachestatus' value='0' />";
-$text .=CACLAN_7."
-</td>
-</tr>
-
-<tr>
-<td style='width:98%' class='forumheader3'>";
-$text .= ('1' == $pref['cachestatus']) ? "<input class='tbox' type='radio' name='cachestatus' value='1' checked='checked' />" : "<input type='radio' name='cachestatus' value='1' />";
-$text .=CACLAN_8."
-</td>
-</tr>
-
-<tr>
-<td style='width:98%' class='forumheader3'>";
-if(is_writable(e_FILE."cache")){
-	$text .= ('2' == $pref['cachestatus']) ? "<input class='tbox' type='radio' name='cachestatus' value='2' checked='checked' />" : "<input type='radio' name='cachestatus' value='2' />";
-	$text .= CACLAN_9;
-} else {
-	$text .= CACLAN_9."<br /><br /><b>".CACLAN_10."</b>";
-}
-$text .= "</td>
-</tr>
-
-<tr style='vertical-align:top'> 
-<td style='text-align:center' class='forumheader'>
-
-<input class='button' type='submit' name='submit_cache' value='".CACLAN_2."' /> 
-<input class='button' type='submit' name='empty_cache' value='".CACLAN_5."' />
-
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".CACLAN_3."</div>", $text);
-
-require_once("footer.php");
-?>	
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/cache.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2006/02/16 21:51:39 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("C")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'cache';
+require_once("auth.php");
+require_once(e_HANDLER."cache_handler.php");
+$ec = new ecache;
+if ($pref['cachestatus'] == '2') {
+	$pref['cachestatus'] = '1';
+}
+if (isset($_POST['submit_cache'])) {
+	if ($pref['cachestatus'] != $_POST['cachestatus']) {
+		$pref['cachestatus'] = $_POST['cachestatus'];
+		save_prefs();
+		$ec->clear();
+		$update = true;
+	}
+	admin_update($update, 'update', CACLAN_4);
+}
+	
+if (isset($_POST['empty_cache'])) {
+	$ec->clear();
+	$ns->tablerender(LAN_UPDATE, "<div style='text-align:center'><b>".CACLAN_6."</b></div>");
+}
+	
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+	<td class='fcaption'>".CACLAN_1."</td>
+	</tr>
+	<tr>
+	<td class='forumheader3'>";
+$text .= (!$pref['cachestatus']) ? "<input type='radio' name='cachestatus' value='0' checked='checked' />" :
+ "<input type='radio' name='cachestatus' value='0' />";
+$text .= CACLAN_7."
+	</td>
+	</tr>
+	 
+	<tr>
+	<td class='forumheader3'>";
+if (is_writable(e_FILE."cache")) {
+	$text .= ('1' == $pref['cachestatus']) ? "<input type='radio' name='cachestatus' value='1' checked='checked' />" :
+	 "<input type='radio' name='cachestatus' value='1' />";
+	$text .= CACLAN_9;
+} else {
+	$text .= CACLAN_9."<br /><br /><b>".CACLAN_10."</b>";
+}
+$text .= "</td>
+	</tr>
+	 
+	<tr style='vertical-align:top'>
+	<td style='text-align:center' class='forumheader'>
+	 
+	<input class='button' type='submit' name='submit_cache' value='".CACLAN_2."' />
+	<input class='button' type='submit' name='empty_cache' value='".CACLAN_5."' />
+	 
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+	
+$ns->tablerender(CACLAN_3, $text);
+	
+require_once("footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/cascade.php 75/e107_admin/cascade.php
--- 6171/e107_admin/cascade.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/cascade.php	2005-01-27 13:52:24.000000000 -0600
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/cascade.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:52:24 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (ADMIN) {
+	header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
+	exit;
+} else {
+	header('Location:'.SITEURL.'index.php');
+	exit;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/categories.php 75/e107_admin/categories.php
--- 6171/e107_admin/categories.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/categories.php	2005-01-27 13:52:24.000000000 -0600
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/categories.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:52:24 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (ADMIN) {
+	header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
+	exit;
+} else {
+	header('Location:'.SITEURL.'index.php');
+	exit;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/chatbox.php 75/e107_admin/chatbox.php
--- 6171/e107_admin/chatbox.php	2004-05-17 01:19:14.000000000 -0500
+++ 75/e107_admin/chatbox.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,237 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin//chatbox_conf.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("C")){ header("location:".e_BASE."index.php"); exit ;}
-
-require_once("auth.php");
-
-if($action == "u"){
-        $message = CHBLAN_1;
-}
-
-if(IsSet($_POST['moderate'])){
-
-        extract($_POST);
-        if(is_array($cb_blocked)){
-                while (list ($key, $id) = each ($cb_blocked)){
-                        $sql -> db_Update("chatbox", "cb_blocked='1' WHERE cb_id='$id' ");
-                }
-        }
-        if(is_array($cb_unblocked)){
-                while (list ($key, $id) = each ($cb_unblocked)){
-                        $sql -> db_Update("chatbox", "cb_blocked='0' WHERE cb_id='$id' ");
-                }
-        }
-        if(is_array($cb_delete)){
-                while (list ($key, $id) = each ($cb_delete)) {
-                        $sql -> db_Delete("chatbox", "cb_id='$id' ");
-                }
-        }
-        clear_cache("chatbox");
-        $message = CHBLAN_2;
-}
-
-if(IsSet($_POST['updatesettings'])){
-
-        $pref['chatbox_posts'] = $_POST['chatbox_posts'];
-        $aj = new textparse;
-        $pref['cb_linkc'] = $aj -> formtpa($_POST['cb_linkc'], "admin");
-        $pref['cb_wordwrap'] = $_POST['cb_wordwrap'];
-        $pref['cb_linkreplace'] = $_POST['cb_linkreplace'];
-        $pref['cb_layer'] = $_POST['cb_layer'];
-        $pref['cb_layer_height'] = ($_POST['cb_layer_height'] ? $_POST['cb_layer_height'] : 200);
-        $pref['cb_emote'] = $_POST['cb_emote'];
-        save_prefs();
-        header("location:".e_ADMIN."chatbox.php?u");
-        exit;
-}
-
-if(IsSet($_POST['prune'])){
-        $chatbox_prune = $_POST['chatbox_prune'];
-        $prunetime = time() - $chatbox_prune;
-
-        $sql -> db_Delete("chatbox", "cb_datestamp < '$prunetime' ");
-        $message = CHBLAN_28;
-}
-
-
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-
-if(!$sql -> db_Select("chatbox", "*", "ORDER BY cb_datestamp DESC LIMIT 0, 50", $mode="no_where")){
-        $text = "<div style='text-align:center'>".CHBLAN_3."</div>";
-}else{
-        $con = new convert;
-        $aj = new textparse();
-
-        $text = "<div style='border : solid 1px #000; padding : 4px; width : auto; height : 200px; overflow : auto; '>
-<form method='post' action='".e_SELF."'>
-<table style='width:100%' class='fborder'>";
-
-        $sql2 = new db;
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-
-                $datestamp = $con->convert_date($cb_datestamp, "short");
-
-                $cb_ida = substr($cb_nick, 0, strpos($cb_nick, "."));
-
-                if($cb_ida){
-                        $sql2 -> db_Select("user", "*", "user_id='$cb_ida' ");
-                        $row = $sql2 -> db_Fetch(); extract($row);
-                        $cb_nick = "<a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>";
-                        $cb_str = "".CHBLAN_4." ".$user_id;
-                }else{
-                        $cb_str = CHBLAN_5;
-                        $cb_nick = eregi_replace("[0-9]+\.", "", $cb_nick);
-                }
-
-                $cb_message = $aj -> tpa($cb_message, "on");
-
-                $text .= "<tr>
-<td class='forumheader3' style='width:5%; text-align: center'>".($cb_blocked ? "<img src='".e_IMAGE."generic/blocked.png' />" : "&nbsp;")."</td>
-<td class='forumheader3' style='width:15%'>".$datestamp."</td>
-<td class='forumheader3' style='width:20%'><b>".$cb_nick."</b><br />".$cb_str."<br />IP: ".$cb_ip."</td>
-<td class='forumheader3' style='width:40%'>".$cb_message."</td>
-<td class='forumheader3' style='width:20%;text-align:center' >".
-
-
-($cb_blocked ?  "<input type='checkbox' name='cb_unblocked[]' value='$cb_id' /> ".CHBLAN_6 : "<input type='checkbox' name='cb_blocked[]' value='$cb_id' />".CHBLAN_7)."
- &nbsp;<input type='checkbox' name='cb_delete[]' value='$cb_id' />".CHBLAN_8."
-</td>
-</tr>";
-
-        }
-
-        $text .= "<tr><td colspan='5' class='forumheader' style='text-align:center'><input class='button' type='submit' name='moderate' value='".CHBLAN_9."' />
-        </td>
-        </tr>
-        </table></form></div>";
-
-        $ns -> tablerender(CHBLAN_10, $text);
-
-        echo "<br />";
-
-}
-
-
-$chatbox_posts = $pref['chatbox_posts'];
-$cb_linkreplace = $pref['cb_linkreplace'];
-$cb_linkc = $pref['cb_linkc'];
-$cb_wordwrap = $pref['cb_wordwrap'];
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."' id='cbform'>
-<table style='width:85%' class='fborder'>
-<tr>
-<td class='forumheader3' style='width:40%'>".CHBLAN_11."?:  <div class='smalltext'>".CHBLAN_12."</div></td>
-<td class='forumheader3' style='width:60%'>
-<select name='chatbox_posts' class='tbox'>";
-if($chatbox_posts == 5){
-        $text .= "<option selected='selected'>5</option>\n";
-}else{
-        $text .= "<option>5</option>\n";
-}
-if($chatbox_posts == 10){
-        $text .= "<option selected='selected'>10</option>\n";
-}else{
-        $text .= "<option>10</option>\n";
-}
-if($chatbox_posts == 15){
-        $text .= "<option selected='selected'>15</option>\n";
-}else{
-        $text .= "<option>15</option>\n";
-}
-if($chatbox_posts == 20){
-        $text .= "<option selected='selected'>20</option>\n";
-}else{
-        $text .= "<option>20</option>\n";
-}
-if($chatbox_posts == 25){
-        $text .= "<option selected='selected'>25</option>\n";
-}else{
-        $text .= "<option>25</option>\n";
-}
-
-$text .= "</select>
-</td>
-</tr>
-
-<tr><td class='forumheader3' style='width:40%'>".CHBLAN_29."?: </td>
-<td class='forumheader3' style='width:60%'>".
-($pref['cb_layer'] ? "<input type='checkbox' name='cb_layer' value='1' checked='checked' />" : "<input type='checkbox' name='cb_layer' value='1' />")."&nbsp;&nbsp;".
-CHBLAN_30.": <input class='tbox' type='text' name='cb_layer_height' size='8' value='".$pref['cb_layer_height']."' maxlength='3' />
-</td>
-</tr>
-
-<tr>
-<td class='forumheader3' style='width:40%'>".CHBLAN_13."?:  <div class='smalltext'>".CHBLAN_14."</div></td>
-<td class='forumheader3' style='width:60%'>".
-($cb_linkreplace ? "<input type='checkbox' name='cb_linkreplace' value='1' checked='checked' />" : "<input type='checkbox' name='cb_linkreplace' value='1' />")."
-</td>
-</tr>
-
-
-<tr>
-<td class='forumheader3' style='width:40%'>".CHBLAN_15.": <div class='smalltext'>".CHBLAN_16."</div></td>
-<td class='forumheader3' style='width:60%'>
-<input class='tbox' type='text' name='cb_linkc' size='50' value='$cb_linkc' maxlength='200' />
-</td>
-</tr>
-
-<tr><td class='forumheader3' style='width:40%'>".CHBLAN_31."?: </td>
-<td class='forumheader3' style='width:60%'>".
-($pref['cb_emote'] ? "<input type='checkbox' name='cb_emote' value='1' checked='checked' />" : "<input type='checkbox' name='cb_emote' value='1' />")."
-</td>
-</tr>
-
-
-<tr>
-<td class='forumheader3' style='width:40%'>".CHBLAN_17.":  <div class='smalltext'>".CHBLAN_18."</div></td>
-<td class='forumheader3' style='width:60%'>
-<input class='tbox' type='text' name='cb_wordwrap' size='5' value='$cb_wordwrap' maxlength='3' />
-</td>
-</tr>
-
-<tr>
-<td class='forumheader3' style='width:40%'>".CHBLAN_21.": <div class='smalltext'>".CHBLAN_22."</div></td>
-<td class='forumheader3' style='width:60%'>
-".CHBLAN_23." <select name='chatbox_prune' class='tbox'>
-<option></option>
-<option value='86400'>".CHBLAN_24."</option>
-<option value='604800'>".CHBLAN_25."</option>
-<option value='2592000'>".CHBLAN_26."</option>
-<option value='1'>".CHBLAN_27."</option>
-</select>
-<input class='button' type='submit' name='prune' value='".CHBLAN_21."' />
-</td>
-</tr>
-
-<tr>
-<td  class='forumheader' colspan='3' style='text-align:center'>
-<input class='button' type='submit' name='updatesettings' value='".CHBLAN_19."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".CHBLAN_20."</div>", $text);
-
-require_once("footer.php");
-?>
\ No newline at end of file
diff -ruN 6171/e107_admin/classis.php 75/e107_admin/classis.php
--- 6171/e107_admin/classis.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/classis.php	2005-01-27 13:52:24.000000000 -0600
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/classis.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:52:24 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (ADMIN) {
+	header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
+	exit;
+} else {
+	header('Location:'.SITEURL.'index.php');
+	exit;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/combo.php 75/e107_admin/combo.php
--- 6171/e107_admin/combo.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/combo.php	2005-01-27 13:52:24.000000000 -0600
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/combo.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:52:24 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (ADMIN) {
+	header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
+	exit;
+} else {
+	header('Location:'.SITEURL.'index.php');
+	exit;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/comment.php 75/e107_admin/comment.php
--- 6171/e107_admin/comment.php	2004-04-10 22:44:08.000000000 -0500
+++ 75/e107_admin/comment.php	2005-12-24 19:26:59.000000000 -0600
@@ -1,40 +1,47 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin//comment_conf.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the	
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("B")){ header("location:".e_BASE."index.php"); exit; }
-
-if(e_QUERY){
-	$temp = explode("-", e_QUERY);
-	$action = $temp[0];
-	$id = $temp[1];
-	$item = $temp[2];
-	$c_item = $temp[3];
-	if($action == "block"){
-		$sql -> db_Update("comments", "comment_blocked='1' WHERE comment_id='$id' ");
-	}
-	if($action == "unblock"){
-		$sql -> db_Update("comments", "comment_blocked='0' WHERE comment_id='$id' ");
-	}
-	if($action == "delete"){
-		$sql -> db_Delete("comments", "comment_id='$id' ");
-	}
-	if(!clear_cache($item)){
-		$tmp = explode("?", $item);
-		$item = $tmp[0]."?news.".$c_item;
-		clear_cache($item);
-	}
-}
-echo "<script type='text/javascript'>window.history.go(-1);</script>\n";
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/comment.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/25 01:26:59 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("B")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+	
+if (e_QUERY) {
+	$temp = explode("-", e_QUERY);
+	$action = $temp[0];
+	$id = intval($temp[1]);
+	$item = $temp[2];
+	$c_item = $temp[3];
+	if ($action == "block") {
+		$sql->db_Update("comments", "comment_blocked='1' WHERE comment_id='$id' ");
+	}
+	if ($action == "unblock") {
+		$sql->db_Update("comments", "comment_blocked='0' WHERE comment_id='$id' ");
+	}
+	if ($action == "delete") {
+		$sql->db_Delete("comments", "comment_id='$id' ");
+	}
+	if (!$e107cache->clear($item)) {
+		$tmp = explode("?", $item);
+		$item = $tmp[0]."?news.".$c_item;
+		$e107cache->clear($item);
+	}
+}
+echo "<script type='text/javascript'>window.history.go(-1);</script>\n";
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/compact.php 75/e107_admin/compact.php
--- 6171/e107_admin/compact.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/compact.php	2005-01-27 13:52:24.000000000 -0600
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/compact.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:52:24 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (ADMIN) {
+	header('Location:'.SITEURL.$ADMIN_DIRECTORY.'admin.php');
+	exit;
+} else {
+	header('Location:'.SITEURL.'index.php');
+	exit;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/content.php 75/e107_admin/content.php
--- 6171/e107_admin/content.php	2004-08-31 11:02:52.000000000 -0500
+++ 75/e107_admin/content.php	2005-12-24 17:53:20.000000000 -0600
@@ -1,258 +1,23 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin//content.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-$Id: content.php,v 1.17 2004/08/31 16:02:51 loloirie Exp $  
-*/
-require_once("../class2.php");
-    if($pref['htmlarea']){
-        require_once(e_HANDLER."htmlarea/htmlarea.inc.php");
-       $htmlarea_js =  htmlarea("data");
-    }
-if(!getperms("J") && !getperms("K") && !getperms("L")){
-        header("location:".e_HTTP."index.php");
-        exit;
-}
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-require_once(e_HANDLER."userclass_class.php");
-require_once(e_HANDLER."form_handler.php");
-
-
-$rs = new form;
-
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
-        unset($tmp);
-}
-
-foreach($_POST as $k => $v){
-        if(preg_match("#^main_delete_(\d*)$#",$k,$matches) && $_POST[$k] == $etp->unentity(CNTLAN_7))
-        {
-                $delete_content=$matches[1];
-        }
-}
-
-$aj = new textparse;
-
-If(IsSet($_POST['submit'])){
-        if($_POST['data'] != ""){
-                $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-                $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-                $content_content = $aj -> formtpa($_POST['data'],"admin");
-                $sql -> db_Insert("content", "0, '".$content_heading."', '".$content_subheading."', '$content_content', '".$_POST['auto_line_breaks']."', '".time()."', '".ADMINID."', '".$_POST['content_comment']."', '', '1', 0, ".$_POST['add_icons'].",  {$_POST['c_class']}");
-                if($_POST['content_heading']){
-                        $sql -> db_Select("content", "*", "ORDER BY content_datestamp DESC LIMIT 0,1 ", $mode="no_where");
-                        list($content_id, $content_heading) = $sql-> db_Fetch();
-                        $sql -> db_Insert("links", "0, '".$content_heading."', 'content.php?content.$content_id', '', '', '1', '0', '0', '0', {$_POST['c_class']} ");
-                        clear_cache("sitelinks");
-                        $message = CNTLAN_24;
-                } else {
-                        $sql -> db_Select("content", "*", "ORDER BY content_datestamp DESC LIMIT 0,1 ", $mode="no_where");
-                        list($content_id, $content_heading) = $sql-> db_Fetch();
-                        $message = CNTLAN_23." - 'article.php?".$content_id.".255'.";
-                }
-                clear_cache("content");
-                unset($content_heading, $content_subheading, $content_content, $content_parent);
-        } else {
-                $message = CNTLAN_1;
-        }
-}
-
-if(IsSet($_POST['update'])){
-        $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-        $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-        $content_content = $aj -> formtpa($_POST['data'], "admin");
-        $sql -> db_Update("content", " content_heading='$content_heading', content_subheading='$content_subheading', content_content='$content_content', content_parent='".$_POST['auto_line_breaks']."',  content_comment='".$_POST['content_comment']."', content_type='1', content_class='{$_POST['c_class']}', content_pe_icon='".$_POST['add_icons']."' WHERE content_id='".$_POST['content_id']."'");
-        $sql -> db_Update("links", "link_class='".$_POST['c_class']."' WHERE link_name='$content_heading' ");
-        unset($content_heading, $content_subheading, $content_content, $content_parent);
-        $message = CNTLAN_2;
-        clear_cache("content");
-        clear_cache("sitelinks");
-}
-
-if($delete_content)
-{
-        $sql = new db;
-        $sql -> db_Select("content", "*", "content_id=$delete_content");
-        $row = $sql -> db_Fetch(); extract($row);
-        $sql -> db_Delete("links", "link_name='".$content_heading."' ");
-        $sql -> db_Delete("content", "content_id=$delete_content");
-        $message = CNTLAN_20;
-        unset($content_heading, $content_subheading, $content_content);
-        clear_cache("content");
-        clear_cache("sitelinks");
-}
-
-if(IsSet($message))
-{
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$text = "<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 100px; overflow : auto; '>\n";
-if(!$content_total = $sql -> db_Select("content", "*", "content_type='254' OR content_type='255' OR content_type='1' ORDER BY content_datestamp DESC"))
-{
-        $text .= "<div style='text-align:center'>".CNTLAN_4."</div>";
-} else
-{
-        $text .= "
-        <form method='post' action='".e_SELF."' onsubmit=\"return confirm_()\">
-        <table class='fborder' style='width:100%'>
-        <tr>
-        <td style='width:5%' class='forumheader2'>&nbsp;</td>
-        <td style='width:65%' class='forumheader2'>".CNTLAN_25."</td>
-        <td style='width:30%' class='forumheader2'>".CNTLAN_26."</td>
-        </tr>";
-        while($row = $sql -> db_Fetch())
-        {
-                extract($row);
-                $content_title = ($content_heading) ? $content_heading : $content_subheading;
-                $text .= "<tr><td style='width:5%; text-align:center' class='forumheader3'>$content_id</td>
-                <td style='width:65%' class='forumheader3'>$content_title</td>
-                <td style='width:30%; text-align:center' class='forumheader3'>
-                ".$rs -> form_button("button", "main_edit_{$content_id}", CNTLAN_6, "onclick=\"document.location='".e_SELF."?edit.$content_id'\"")."
-                ".$rs -> form_button("submit", "main_delete_{$content_id}", CNTLAN_7)."
-
-                </td>\n</tr>";
-        }
-        $text .= "</table>\n</form>";
-}
-$text .= "</div></div>";
-
-$ns -> tablerender(CNTLAN_5, $text);
-
-unset($content_heading, $content_subheading, $content_content, $content_parent, $content_comment);
-
-if($action == "edit"){
-        if($sql -> db_Select("content", "*", "content_id=$sub_action")){
-                $row = $sql -> db_Fetch(); extract($row);
-        }
-}else{
-        $content_comment = TRUE;
-}
-
-$article_total = $sql -> db_Select("content", "*", "content_type='254' OR content_type='255' OR content_type='1' ");
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."' id='dataform'>
-<table style='width:80%' class='fborder'>
-
-<tr>
-<td style='width:20%; vertical-align:top' class='forumheader3'>".CNTLAN_10.":</td>
-<td style='width:80%' class='forumheader3'>
-<input class='tbox' type='text' name='content_heading' size='60' value='$content_heading' maxlength='100' />
-
-</td>
-</tr>
-<tr>
-<td style='width:20%' class='forumheader3'>".CNTLAN_11.":</td>
-<td style='width:80%' class='forumheader3'>
-<input class='tbox' type='text' name='content_subheading' size='60' value='$content_subheading' maxlength='100' />
-</td>
-</tr>
-<tr>
-<td style='width:20%' class='forumheader3'><span style='text-decoration: underline'>".CNTLAN_12.": </span></td>
-<td style='width:80%' class='forumheader3'>";
-$insertjs = (!$pref['htmlarea'])? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'":"";
-$text .="<textarea class='tbox' id='data' name='data' style='width:100%' rows='30' cols='60' $insertjs >$content_content</textarea>";
-
-if(!$pref['htmlarea']){
-    $text .="
-      <br />
-      <input class='helpbox' type='text' name='helpb' size='100' />
-      <br />";
-      require_once(e_HANDLER."ren_help.php");
-      $text .= ren_help();
-}
-$text .="
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".CNTLAN_21."?:</td>
-<td style='width:80%' class='forumheader3'>";
-
-if($content_parent){
-        $text .= CNTLAN_14.": <input type='radio' name='auto_line_breaks' value='0' />
-        ".CNTLAN_15.": <input type='radio' name='auto_line_breaks' value='1' checked='checked' />";
-}else{
-        $text .= CNTLAN_14.": <input type='radio' name='auto_line_breaks' value='0' checked='checked' />
-        ".CNTLAN_15.": <input type='radio' name='auto_line_breaks' value='1' />";
-}
-$text .= "<span class='smalltext'>".CNTLAN_22."</span>
-</td></tr>
-<tr>
-<td style='width:20%' class='forumheader3'>".CNTLAN_13."?:</td>
-<td style='width:80%' class='forumheader3'>";
-
-
-if(!$content_comment){
-        $text .= CNTLAN_14.": <input type='radio' name='content_comment' value='1' />
-        ".CNTLAN_15.": <input type='radio' name='content_comment' value='0' checked='checked' />";
-}else{
-        $text .= CNTLAN_14.": <input type='radio' name='content_comment' value='1' checked='checked' />
-        ".CNTLAN_15.": <input type='radio' name='content_comment' value='0' />";
-}
-
-
-$text .= "
-</td></tr>
-
-
-        <tr>
-        <td class='forumheader3'>".CNTLAN_28.":&nbsp;&nbsp;</td><td class='forumheader3'>".
-        ($content_pe_icon ? CNTLAN_29.": <input type='radio' name='add_icons' value='1' checked='checked' />".CNTLAN_30.": <input type='radio' name='add_icons' value='0' />" : CNTLAN_29.": <input type='radio' name='add_icons' value='1' />".CNTLAN_30.": <input type='radio' name='add_icons' value='0' checked='checked' />")."
-        </td>
-        </tr>
-
-";
-
-$text.="
-<tr>
-<td style='width:20%' class='forumheader3'>".CNTLAN_19.":</td>
-<td style='width:80%' class='forumheader3'>".r_userclass("c_class",$content_class)."
-</td>
-</tr>
-<tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center' class='forumheader'>";
-
-
-if($action == "edit"){
-        $text .= "<input class='button' type='submit' name='update' value='".CNTLAN_16."' />
-        <input type='hidden' name='content_id' value='$content_id' />";
-}else{
-        $text .= "<input class='button' type='submit' name='submit' value='".CNTLAN_17."' />";
-}
-
-$text .= "</td>
-</tr>
-</table>
-</form>
-</div>";
-
-
-$ns -> tablerender("<div style='text-align:center'>".CNTLAN_18."</div>", $text);
-
-echo "<script type=\"text/javascript\">
-function confirm_(content_id){
-        return  confirm(\"".$etp->unentity(CNTLAN_27)."\");
-}
-</script>";
-
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/content.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/12/24 23:53:20 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+header('Location: admin.php');
+exit;
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/core_image.php 75/e107_admin/core_image.php
--- 6171/e107_admin/core_image.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/core_image.php	2006-05-22 20:34:32.000000000 -0500
@@ -0,0 +1,5590 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/core_image.php,v $
+|     $Revision: 1.38 $
+|     $Date: 2006/05/23 01:34:32 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$core_image = array (
+  $coredir['admin'] => 
+  array (
+    'includes' => 
+    array (
+      'beginner.php' => '6237124ca4871bfa632a791408bc7669',
+      'cascade.php' => '049e8b646b776c045a0a7df1270c33a3',
+      'categories.php' => '47e63f51c6308780137f0e6219e6f807',
+      'classis.php' => '3773377b0928c8034df8ab3b9eca4a30',
+      'combo.php' => '9596e05f1431e5e04726eeb5e36576ba',
+      'compact.php' => 'bf551b1b617f93bc9aa037d634621230',
+    ),
+    'sql' => 
+    array (
+      'db_update' => 
+      array (
+        'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      ),
+      'core_pg.php' => 'c1c8245091973146cc9ac83195d0ec71',
+      'core_sql.php' => '6dd3714984b97a699be4aeee5ac8504c',
+      'extended_country.php' => '0ef441f85dc0628bbf00c91e1163f114',
+    ),
+    'ad_links.php' => 'd4d181f5337ba8bc939828d9068c8d43',
+    'admin.php' => '7d7187d98e61a3d4e16628905d6d43cb',
+    'admin_classis.php' => 'ed861d18477db9ce0bc3620a69443723',
+    'admin_combo.php' => '8958300a2a42fd2aa68977d566c1edb9',
+    'admin_etalkers.php' => '9d684ef56c54bbf919e3346927cf4509',
+    'admin_log.php' => 'd9cc442f94fbf239ec8d9c937b710f9a',
+    'adminb.php' => '1e31b2ad3907c7cba29dca04342cee1d',
+    'administrator.php' => 'dd5eac7dd3802ff4cf78cc4aa9480603',
+    'article.php' => '7b21dc8ef4bc68ceb9ecf4d1c519a645',
+    'auth.php' => 'bb6e624d16f5f25a206f144d40b10aeb',
+    'banlist.php' => '32450e4bece5aa5c4bb991fdb305d45b',
+    'banner.php' => '1dfcb396a17492639dc7583ee89eedec',
+    'cache.php' => '62fc17d1f4c6db977c66642c5a76127a',
+    'cascade.php' => '3d70a650778f09e6c85efd91b6ab5e4a',
+    'categories.php' => 'cbbed37d26ab602700d46a0cb1955205',
+    'classis.php' => 'ae46c368d41390a44cd6005404d651d7',
+    'combo.php' => '6b0f9e175585ef0b42585b444b003678',
+    'comment.php' => '96f04e71003de6b6a6ea3a0f2ede285d',
+    'compact.php' => '20bccea2ef81cc86a86782fa4841e45f',
+    'content.php' => 'bf2239404990afed185913002429e682',
+    'core_image.php' => '9100de711965cbeaecc5d17057de50ea',
+    'cpage.php' => 'b7a5d16b5ae822cd5284b3ff2398a50b',
+    'credits.php' => '26dc083bbb07e43cedd10d6dbe201120',
+    'db.php' => '3eb086e293e4edceca7bf3e14cb34d1f',
+    'db_verify.php' => 'fd792b49b728528d06f33873ca785738',
+    'docs.php' => 'e5ebdd8fd30362636cfe1a3878b3fb18',
+    'download.php' => 'af89cfebf921ec772a01b3c1182bf2c0',
+    'e107_update.php' => 'c23624862e7dc50fab29aa1890c7872a',
+    'emoticon.php' => 'b3b5fd7aea2941dc0992ad0013ec2587',
+    'fileinspector.php' => '7430c97538e5d63ced422b4d552344ae',
+    'filemanager.php' => 'f8e0f4d49bc2ed01a30f752e79b930ce',
+    'filetypes_.php' => 'f951037335e993337792606cc1475cec',
+    'fla.php' => '65bb3e10db912f98e9ecde7252de9756',
+    'footer.php' => '6315a3f911ed578e9de1c521a31e9a1f',
+    'frontpage.php' => '2b080220f002cf77ef8d8a717fe951dd',
+    'header.php' => '6bc4f8f900e948de9c918649577d3e25',
+    'image.php' => '42d8b58fb59f4cd78a890c1b2cf7a1df',
+    'index.php' => 'e4e143ee2d34d4ce1f17b3f043cc6cd6',
+    'lancheck.php' => '6b61ffa464ee583279bbb841d3e30ebb',
+    'language.php' => 'a25cdaae23382219ea831c0c3986d1b3',
+    'links.php' => '2d56e5d43c8a53efc82a214686f80b68',
+    'mailout.php' => '04141d87eb6cc737a2bf095e12187e45',
+    'menus.php' => '342cd18b9665a439d0640a9e7ba19097',
+    'message.php' => 'c3478de0e58f133518e8fde41ce2b9ea',
+    'meta.php' => '68623037bf4a497856ff8dc01ac50899',
+    'modcomment.php' => 'b8787d8ebce9cc813ccaa416ec3a923c',
+    'newspost.php' => '977d40aeedee43a6b4e28f1838f4769f',
+    'notify.php' => '2740b52482cb339158292d86c1ba1dd6',
+    'phpinfo.php' => '994ea857810fe5f47ac8612f570aadb1',
+    'plugin.php' => '3925332ccc72475659a884217a4359d0',
+    'prefs.php' => '30ba46f22edb990162a4169a670c07e9',
+    'review.php' => '1919d31943803a66cb2d12828bd92db2',
+    'search.php' => '16097d7d63ce23ad21b49f7fec4e2ad8',
+    'theme.php' => 'b05f7265501a3e1c5e7c47cb3f891831',
+    'ugflag.php' => 'f2de9adf44d02735f7364e2378339c0c',
+    'update_routines.php' => '890e402b1b1c984711b2648927969ef3',
+    'updateadmin.php' => '770fff43134883ea4d502498b28d70d2',
+    'upload.php' => '69b274043c816b5a8c7241c20de0b9fb',
+    'userclass.php' => 'b7fd96c785b6f3eead88fd5acd5760ad',
+    'userclass2.php' => '2c68fec8db220660cf7445598fe1aa61',
+    'userinfo.php' => '09131e3ed623691c945592272373d32e',
+    'users.php' => 'cca45a222221196f8ce026674acdfb45',
+    'users_extended.php' => '6225314b33cbe6b59cb6dc44ff9e54d2',
+    'users_extended_predefined.php' => 'a1bd4adc6a6c1996e304b467aed9d2c0',
+    'ver.php' => '1a340fdf81a2eb3e874ac82783fefbc0',
+    'wmessage.php' => 'dc0fa304048a63bee8f8ca2c2321c527',
+  ),
+  $coredir['docs'] => 
+  array (
+    'help' => 
+    array (
+      'English' => 
+      array (
+        'Administrators' => 'fde3f611512ac789609c80fc8a6f3609',
+        'BBCode' => '33451916e62615ddeefb30103f570831',
+        'Banlist' => '83a4c139037713c03d0999e28335c852',
+        'Banners' => 'a1c096485e789b14c720b7c73b4ea7a2',
+        'Cache' => 'bb3356ca038bd2a43b73d4543799f4d1',
+        'Chatbox' => '5fa17c49db4bfef93729d2dac1fcc162',
+        'Classes' => 'ea8b68f265aef007a9636443b7da3dc5',
+        'Downloads' => '37399eb226ad7d1d729f68f65efc7b00',
+        'Emoticons' => '14a0d74aea591e0f8d82577aff8fe979',
+        'Errors' => '46381d88a2326ff760562fea385b2fd0',
+        'Forums' => '1619602477ff749e4c4521cfcb274b83',
+        'Front_Page' => '8cb962ed7c3ddb0d955c8d03ed1ce906',
+        'Help!' => 'dc507cff0acafbbf3abd7f2424dd6b72',
+        'Links' => '320eb08defa1360070a4f0c062e5fc84',
+        'Maintainance' => 'cc818c06e047bba0e2c2349e954cfaf0',
+        'Menus' => '44a53801c18ad52aa9e50c3b4fbfe241',
+        'News' => 'e5ec6c8137c00916343f8f4f5084bfe7',
+        'Preferences' => '518d50601fb29ed7fe20ff5ce73d69f2',
+        'Uploads' => '72e3f738393c8ba76caa195a9f9021a3',
+        'Users' => 'd64be592aae221b66ca4d33b69056e7f',
+        'Welcome_Message' => 'a3a7b26428d35d5ebb520e16ac6204da',
+      ),
+    ),
+    'README.html' => 'd9e0015e610c7aca3ba875848b4cf579',
+    'README_UPGRADE.html' => '6164eaaec5a09bdcc5d6f6b0aeeb8f34',
+    'gpl.txt' => 'e19d8295ecad01988af40b5a943bd55f',
+    'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+    'style.css' => '2e3b2c9e4bff6d8de091af58589faa1c',
+  ),
+  $coredir['files'] => 
+  array (
+    'bbcode' => 
+    array (
+      'b.bb' => '9870aab6f8b8922c56189733cf5c5db2',
+      'blockquote.bb' => '2cfbbd3ab3fe2872d1a9873223d21522',
+      'br.bb' => 'cb8d211703f0459735baa8dfbebb4bb4',
+      'center.bb' => '5a1957946e3d8898a0b3d86650771809',
+      'code.bb' => '7b3dbff57f7ecbfab1bd09cc2d84ba7e',
+      'color.bb' => '98b9d0ddcc76d2ee37af0f36eab8b1c3',
+      'email.bb' => '123a8b604a28524320639ba1e09bef35',
+      'file.bb' => '65a8c1e8c17d7aef91015c37cd90f4cb',
+      'flash.bb' => 'ab7ef959e8a613a62df6328da41ebcfe',
+      'hide.bb' => 'cf30f78c78855565b0bf868a01142fb8',
+      'html.bb' => '9938499c3ef8c80a2598b9c3aed7e371',
+      'i.bb' => 'd97c389b4fe7ce7ba06ee77802835c8c',
+      'img.bb' => '55dbceb76b1d0f3ac070c0122ed7ee10',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'justify.bb' => '016500f910beb0f820dd58c4915f2489',
+      'left.bb' => '990ddba32b14bea648745cc373035bde',
+      'link.bb' => 'ded6e905c2f5d9a12707d3bfa63d1d82',
+      'list.bb' => 'a2b5f8075b9752bb5b60c3862c5d96ca',
+      'php.bb' => '18bfe745513afb3bb7ec4d69f0683d95',
+      'quote.bb' => '52a975031f0f5ac67d91ced1dfc192d7',
+      'right.bb' => '9bd60ca738b30f35742a0049c5efc191',
+      'size.bb' => 'bd62172ecb7083b85b534c2e45e79d48',
+      'spoiler.bb' => '5929f20a04438093df87b7246e843bf0',
+      'stream.bb' => '9661057e8db23c681e3ec2340ff3a4fa',
+      'textarea.bb' => '51f2669f52dfec3ed57f38402fcc7652',
+      'time.bb' => '3d83b0dfa9b139004bb19ee34b142b44',
+      'u.bb' => '4d95b259d881604959e49e8312e7cffc',
+      'url.bb' => 'ded6e905c2f5d9a12707d3bfa63d1d82',
+    ),
+    'cache' => 
+    array (
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'user_extended.xml' => 'd0aebe83cdec17b0a33d8a3dca37bd14',
+    ),
+    'downloadimages' => 
+    array (
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
+    ),
+    'downloads' => 
+    array (
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
+    ),
+    'downloadthumbs' => 
+    array (
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
+    ),
+    'images' => 
+    array (
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
+    ),
+    'import' => 
+    array (
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'mambo.php' => 'bbcff57b96ca83045d9f4afa982a6ff4',
+      'phpbb2.php' => 'fb21b07e4ccd1367ea54bce6c3ff8bc0',
+      'phpnuke.php' => '732653b3f39cf02364be2dcb0f065f3a',
+    ),
+    'misc' => 
+    array (
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
+    ),
+    'public' => 
+    array (
+      'avatars' => 
+      array (
+        'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      ),
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+    ),
+    'resetcore' => 
+    array (
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'resetcore.php' => '3620244184ad7481003ef67a75eba448',
+      'style.css' => 'e294495db6f91c4514c4f40d7b09fcd5',
+    ),
+    'shortcode' => 
+    array (
+      'batch' => 
+      array (
+        'comment_shortcodes.php' => 'cc7624b4c3b2977521e1fae7f0fc4ee1',
+        'download_shortcodes.php' => '3170adde2a2069b2faa952524bc4782b',
+        'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+        'news_archives.php' => '1115fe90b0de9f170fce31c94680dabf',
+        'news_shortcodes.php' => 'cec6080c6fc21e77e46c8594449fd07d',
+        'signup_shortcodes.php' => '141ec3d3923cc08278e68ca0063670a6',
+        'user_shortcodes.php' => '3447bb463cba8c7bb160b1908dc3dd0f',
+        'usersettings_shortcodes.php' => '6a042a12f899061754a15c6bb6653391',
+      ),
+      'admin_alt_nav.sc' => '92450638fbe0a78485c0eda214b3f0ef',
+      'admin_credits.sc' => '221cefb6ab4f24171b7af36f372355e3',
+      'admin_docs.sc' => 'b010b7ac7618fa669c8777754a8337c6',
+      'admin_help.sc' => '1ad9d6f1c5af06e7ce2d0e1744b02cd4',
+      'admin_icon.sc' => 'e479849c3b09aae88aae3532b0550a92',
+      'admin_lang.sc' => 'a0ef4c6337a329ead6566985c68562ac',
+      'admin_latest.sc' => 'a0d7c50805d91d4caf60a068510b8473',
+      'admin_log.sc' => 'fe7bf0efa38817a58f6ef678a8df82e8',
+      'admin_logged.sc' => 'dec16fb0a9f5485db6ca1b4955753c2e',
+      'admin_logo.sc' => 'ff7174ceae0a5e01bfd0bc7a343c16a4',
+      'admin_menu.sc' => '9847249c8cfdc0fb93654d98577b620e',
+      'admin_msg.sc' => '1906530f20e337964878fd144b1047c5',
+      'admin_nav.sc' => 'c22be64cb31ee333f0510f6dd8778363',
+      'admin_plugins.sc' => 'cdf52aad6688cde7741d695a62be944d',
+      'admin_preset.sc' => 'f27d1c59bb7459581fde09d29cfe6303',
+      'admin_pword.sc' => 'abbe3f9d2709e86cfb37b378f2b3d13f',
+      'admin_sel_lan.sc' => '6c2dbc4e17bdcc5f5260664ddb8c3280',
+      'admin_siteinfo.sc' => '63bfd9a632b66f9368337983dd921537',
+      'admin_status.sc' => 'bba261fea5a35f2b3424c039fe61dcb1',
+      'admin_userlan.sc' => 'cbaf3dda959b6a36f6b3f4cf0a6f7536',
+      'banner.sc' => '4a23a473eb15c7afbedbd4816f3922ea',
+      'breadcrumb.sc' => '0591ee7dc26ded7ac9a359dea4b8fdf6',
+      'custom.sc' => '0b871533c2a2661851dbefedd959c65b',
+      'e_image.sc' => '3819fdf5b9dfc7b189fb4073d33ae0d5',
+      'email.sc' => 'a864fe0d78a0c9641b36d65688c63b10',
+      'email_item.sc' => 'a23b3abbb722bbf5bc58be9d23906583',
+      'emailto.sc' => '05843b1a7c7feb8f4985a55ac01ba9f3',
+      'extended.sc' => '8fdffc090d07e85ceb203542ecbb0d32',
+      'extended_icon.sc' => '38a6eddf073fd8228996b4f6e7e9f80c',
+      'extended_text.sc' => '8bd2b2168a8f92aa2548e75c849ffac2',
+      'extended_value.sc' => 'cf2e9f0820126d3f68c39adcfd45c0e8',
+      'imageselector.sc' => '392d0d1c1896ec3a765001b49bf37413',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'linkstyle.sc' => '5ed64d972bc892a798f80179878f1266',
+      'logo.sc' => '9fb4b737a74ac8d1168fa29fe88766ac',
+      'menu.sc' => 'd46421312f79314a9cffd805f065b481',
+      'news_alt.sc' => '25596ffed2cf4bed831b80397c77e295',
+      'news_categories.sc' => 'c520fdee0b041b3622c93ca85f63f6fb',
+      'news_category.sc' => '25596ffed2cf4bed831b80397c77e295',
+      'newsfile.sc' => '3b553625cd46e5c576afa21cab8df3fb',
+      'newsimage.sc' => '75738371cff6146174ea00971730a0da',
+      'nextprev.sc' => 'f027223abe8a007e0f5acc6305e1da36',
+      'picture.sc' => '0f4d00920f1ddbac7293549862b3c0da',
+      'plugin.sc' => '3b827418651f2a8f070d1cf80fe2405f',
+      'print_item.sc' => 'a532b0cea88aff710a3bdcea2cdb322e',
+      'profile.sc' => 'ea7fc4eca12f39e19a735d2014fe341f',
+      'search.sc' => '26d923db11c015b4a0fc6a2d6c0bdee4',
+      'setstyle.sc' => '88ec920b668233bd21ba95e2cdd607e7',
+      'sitecontactinfo.sc' => '5467f65cd62b910389014b5fb8b33fe5',
+      'sitedisclaimer.sc' => '9497e1719f019c9af67fdfac1be16cfc',
+      'sitelinks.sc' => '0c7f62270ac7b4135d6720a6b74cee7e',
+      'sitelinks_alt.sc' => '2fc00cad9b7e50da3d6726647b9a6ae7',
+      'sitename.sc' => '49193510fce1805716ef34478b82daf2',
+      'sitetag.sc' => '338e16589e67c9fe45613e3c6dbb9b0d',
+      'user_avatar.sc' => '09de355193d7629064e8fcaa005ccb18',
+      'wmessage.sc' => '80b94dafe7e2bc0d82a6df7aacb9c1f7',
+    ),
+    'def_e107_prefs.php' => '714c00e30a0c950e6c9b40b17b101763',
+    'e107.css' => 'e5cfa4047831f19def7df032ef8bc830',
+    'e107.js' => '2089336ebd5204061afce9be3094ad73',
+    'e_ajax.js' => 'b583773e72852158e27af8a9bba7c97f',
+    'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+    'nav_menu.css' => '58ca165986f7428fb05e8b7b82c2ee13',
+    'nav_menu.js' => 'f6345dfb29d05884a5017ff17ed36387',
+    'nav_menu_alt.js' => 'cbfeb53bb0dfc7136f097c00265731ff',
+    'popup.js' => 'a9d1e17d0a4c399736fc7bf16ac48fa8',
+    'resetcore.php' => '8329fb938f7ae0058ab9582efc098c4c',
+    'sleight_img.gif' => '7616b49c48ca0cd6cbd15e9f747c8886',
+    'sleight_js.php' => '038fc3cccae701fab1c6aa35339a0853',
+    'thumb.php' => '1506afd0bc12c8663688f7ca449aa853',
+    'user.js' => 'd41d8cd98f00b204e9800998ecf8427e',
+  ),
+  $coredir['handlers'] => 
+  array (
+    'calendar' => 
+    array (
+      'language' => 
+      array (
+        'English.js' => '686fdfb3c6dd89119b0fc100fea0af18',
+      ),
+      'cal.gif' => 'c1e5255bd358fcd5a0779a0cc310a2fe',
+      'calendar-setup.js' => 'bcdf616f6ebfe8fdb0235d389fb1d238',
+      'calendar-setup_stripped.js' => '21fe92ab10616e9d40b066538b4d1fdb',
+      'calendar.css' => '33ea70fdc6b81e988ffce30ad8f7c4f2',
+      'calendar.js' => '0dca67d72cc4e8df1d64003ab4738d60',
+      'calendar_class.php' => '79d604e52ab3b9fa60b9d0cd84e9bd6e',
+      'calendar_stripped.js' => '3222e372b909b3eb246cdf3423493bda',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'menuarrow.gif' => 'b5a91d7a2755198b2eb729541ad3288c',
+      'menuarrow2.gif' => '1f8c673c8f76832febaeeac88a5f4353',
+      'sample.php' => '1d99312cd3ba1d6b9ef0484e6d138641',
+    ),
+    'phpmailer' => 
+    array (
+      'language' => 
+      array (
+        'phpmailer.lang-en.php' => 'dca429b3dfc000a241f32ed11d3a6aca',
+      ),
+      'class.phpmailer.php' => '19387562d781c1e3e71d15be61ec1b10',
+      'class.smtp.php' => 'ddffdc4ffea47a74423038a97d065e5c',
+      'e107.htaccess' => '507de3fb6f951cafa6b1a346d232604f',
+      'mailout_process.php' => '2bb26be6aae543eabdc7a629e9da7d31',
+    ),
+    'search' => 
+    array (
+      'advanced_comment.php' => 'be2b0d04f5abfb8d659288a69cb73d49',
+      'advanced_download.php' => 'fa435e7792317196d187e494212d0988',
+      'advanced_news.php' => '4dd2b43f9acb91ea02b39fa44ccf4299',
+      'advanced_pages.php' => '82c313fb52d708bd9aaad142a00dc2c4',
+      'advanced_user.php' => '0f1f1668327d513090f6e13824d281ad',
+      'comments_download.php' => '2cabddfffb2986e96bb7779da03d1f0a',
+      'comments_news.php' => '771713752895af10bfa75c3c2bac4d1e',
+      'comments_page.php' => '6e5a89313087d403e30cfeb8ddf4da78',
+      'comments_user.php' => 'caa387a56d6f1b35610e80061e18cc1c',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'search_comment.php' => '259c054fc6bbf455d99ebbf4071b0ff0',
+      'search_download.php' => '43c029be2f9b66ee064411ad75404881',
+      'search_event.php' => '17c68ea4f5728e87e7009b96b978006c',
+      'search_news.php' => 'bc0321e07ae69c925ac83a72ae67c136',
+      'search_pages.php' => '57521d1569a214c3ccb99406561a229f',
+      'search_user.php' => '90b545d731c887cef2715096d52cb968',
+    ),
+    'tiny_mce' => 
+    array (
+      'langs' => 
+      array (
+        'en.js' => 'f304920296d23ba3ed1a8ec3a2a1844d',
+      ),
+      'plugins' => 
+      array (
+        'contextmenu' => 
+        array (
+          'css' => 
+          array (
+            'contextmenu.css' => 'f3cb9b44e37f0dc452bed97c02bec4c4',
+          ),
+          'images' => 
+          array (
+            'spacer.gif' => '12bf9e19374920de3146a64775f46a5e',
+          ),
+          'contextmenu.css' => '93ad8b3e8a5e1a48bf6ed727ca0384e2',
+          'editor_plugin.js' => '31b3fae1bca58466a18997c52b9336e8',
+          'editor_plugin_src.js' => 'e25b5fbabe59cfba09cfa09b45c20d4a',
+        ),
+        'emoticons' => 
+        array (
+          'images' => 
+          array (
+            'emoticons.png' => '2867c94a2d99dedf5964a4a0de9e5839',
+          ),
+          'langs' => 
+          array (
+            'en.js' => '8df9c4f5e9083acb89cf152c8ba44f9d',
+          ),
+          'editor_plugin.js' => 'ede01e828a3698e2e00a9dbd503e7d95',
+          'emoticons.php' => '31f361fda0b760ad25d72a9cf8bed070',
+          'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+        ),
+        'flash' => 
+        array (
+          'css' => 
+          array (
+            'content.css' => '9ae9f08d9748dc78ed6e0b33cd11e458',
+            'flash.css' => '5ad8611160baa5f2198abb88baae38c9',
+          ),
+          'images' => 
+          array (
+            'flash.gif' => '709d9df69d8c2030e56321046d76ab8b',
+          ),
+          'jscripts' => 
+          array (
+            'flash.js' => '6b51cb8bf256f6ebc86e3a325475209b',
+          ),
+          'langs' => 
+          array (
+            'en.js' => '52de748671eb0182b112111dbaa35e88',
+          ),
+          'editor_plugin.js' => 'd9a86e84d6de9a92c07caa14c32fa436',
+          'editor_plugin_src.js' => '9f6d08f5269ffb3d107bbb382d1080ae',
+          'flash.css' => '439d26d52ddf50dd5ac7d5fcb29a6e7d',
+          'flash.htm' => 'c67139b142800773e99457bd880978e9',
+        ),
+        'ibrowser' => 
+        array (
+          'images' => 
+          array (
+            'constrain.gif' => '0ed8ffef1fb5cce76e51e2d720063ea9',
+            'ibrowser.gif' => '3f92a28951b2d3048473262f5367d12d',
+            'textflow.gif' => '2b34d07b43d1159590455146078cb4cc',
+          ),
+          'langs' => 
+          array (
+            'en.js' => '5bc48956a398ac86f36edb041a898a85',
+          ),
+          'config.php' => '0af08bfd60ce374b94e0080043183359',
+          'editor_plugin.js' => 'c24c653b8ab5efed78a30e95e68ed0b1',
+          'ibrowser.php' => 'eb13818738cf7ab604a8d9a8b6af92d0',
+        ),
+        'iespell' => 
+        array (
+          'images' => 
+          array (
+            'iespell.gif' => 'eb12c26b5768fcd344ea6205aa98e761',
+          ),
+          'langs' => 
+          array (
+            'en.js' => 'b262530d5b63841b50ab5b67f94883aa',
+          ),
+          'editor_plugin.js' => 'c2db1286b602688099f0636540380d1a',
+          'editor_plugin_src.js' => '16989007849b42b9ad531319af9851c2',
+        ),
+        'table' => 
+        array (
+          'css' => 
+          array (
+            'cell.css' => 'a51b50f9a8153e7f55fe06a03caca016',
+            'row.css' => '6d95ac81b478e4e8a176e209c739c38d',
+            'table.css' => '8357d1c13919a34806d23fa2160a8064',
+          ),
+          'images' => 
+          array (
+            'buttons.gif' => 'bc01f6be1e91618347cc0edd0157aa4a',
+            'table.gif' => '476b000e94b74dac818f1ce03681ace5',
+            'table_cell_props.gif' => '6912d92a00e3e81a9baba3e251b7f0c0',
+            'table_delete.gif' => '060899ca004398671369f92ef6a88a90',
+            'table_delete_col.gif' => '333372a2469c8dfa12a002a2aad8de59',
+            'table_delete_row.gif' => 'c58d9413b1d8150011db91818595871b',
+            'table_insert_col_after.gif' => '5d19acf7a25262cf3ddc7a926a076218',
+            'table_insert_col_before.gif' => 'd5910a210405a8cc7a24086104b06fa1',
+            'table_insert_row_after.gif' => '6b3167fde6db6ac271488b9cef404792',
+            'table_insert_row_before.gif' => '0e37e4c48dcddb1123bc6140ce323694',
+            'table_merge_cells.gif' => 'd5552fd387ff429fbfe7b8aebc76b3c0',
+            'table_row_props.gif' => '639bc7a8c034d99ab1cbef8f602f8aa8',
+            'table_split_cells.gif' => 'aa2082cf1eb2e62eecda57fd2f986ab7',
+          ),
+          'jscripts' => 
+          array (
+            'cell.js' => 'df27f8a9de847dcc4b433960c72f99fa',
+            'merge_cells.js' => '78f470baf2d2278b3535e5389abda244',
+            'row.js' => '5564b689e370fc84c47b192de29e472b',
+            'table.js' => '8e634e43a5315955de1267f713bde296',
+          ),
+          'langs' => 
+          array (
+            'en.js' => 'efb577fa33557c4f819d45f8be16ff20',
+          ),
+          'cell.htm' => '19a425a22f5dc25f42e755ad38d3ba98',
+          'editor_plugin.js' => '508bce2b3685ef444dbdef1d9658deb5',
+          'editor_plugin_src.js' => '05ca57116f9c0df3d69b662e146fd684',
+          'merge_cells.htm' => 'c6a7f1792af1b08d564c5242d74e1795',
+          'row.htm' => '7c8c219909be04d09bad3bfeb048c560',
+          'table.htm' => '9d81653d8894c1321c893cb058b439e2',
+        ),
+        'zoom' => 
+        array (
+          'editor_plugin.js' => '971affe783655dec2cf61d0468d2ecc2',
+          'editor_plugin_src.js' => '1008f77b8fba86700e32752014e16762',
+        ),
+      ),
+      'themes' => 
+      array (
+        'advanced' => 
+        array (
+          'css' => 
+          array (
+            'editor_content.css' => '4950d1774a92d46045b57911d41706ef',
+            'editor_popup.css' => '706af4224c448720974a4b2bd01b120c',
+            'editor_ui.css' => '2aaa14fd106feb476280952cd15ab136',
+          ),
+          'images' => 
+          array (
+            'xp' => 
+            array (
+              'tab_bg.gif' => '3d53300281d4652d1fe2482f1bbec413',
+              'tab_end.gif' => 'de9e554769bc24fc7f2acefddb04e895',
+              'tab_sel_bg.gif' => 'f330e9c65e356cb6829596e421cf1116',
+              'tab_sel_end.gif' => '6a4ffda436f2ffe5a56107d6c8c5a332',
+              'tabs_bg.gif' => 'b3a2d232dd5bf5e8a829571bbec08522',
+            ),
+            'anchor.gif' => '9997d8cbba012a0a8295ff92bced1207',
+            'anchor_symbol.gif' => '5cb42865ce70a58d420786854fed4ae1',
+            'backcolor.gif' => 'a1f0a58d7fa6ebc1376d1e03bf292658',
+            'bold.gif' => 'd4eac7372d4d546db5110407596720dd',
+            'bold_de_se.gif' => 'fa8d362da3c15cab263bc7eb2d192dd1',
+            'bold_es.gif' => 'eedfd6c0dc13c5db5054bd893ac92ca0',
+            'bold_fr.gif' => '8fbda35d5ebfc1474f93f808953b1386',
+            'bold_ru.gif' => 'c227dfb4b70957d31c240fd0fd9f55b6',
+            'browse.gif' => '2babc35c383abee1260e021dd87fd7a5',
+            'bullist.gif' => 'f360470402affab13062de5ffbfb7f74',
+            'button_menu.gif' => 'ed293e6a817f44328f74c0853c628e69',
+            'buttons.gif' => '9322ed07f90ab662d0748b01d6e20bb4',
+            'cancel_button_bg.gif' => '57b808096854d5eeb5785effcd10c468',
+            'center.gif' => '652af6256deb0eeb781b0793ee4142f2',
+            'charmap.gif' => '3c3625a993caca8262dd93d61ff1a747',
+            'cleanup.gif' => 'f082f5fdea8020fd9cdd714a30ca8e71',
+            'close.gif' => '99fb1b6d91aca9519cfc18e182de8600',
+            'code.gif' => '158e1ad2922f59a800e27e459c71d051',
+            'color.gif' => 'c8e11c751b5575025fc50b7701719f0f',
+            'copy.gif' => 'ef9a435cc72f9fe652ebc49498b89e86',
+            'custom_1.gif' => 'bd1f96d299847c47fd535b1b54d3a2df',
+            'cut.gif' => '4e3e44cccf150856322ba78ccf2533e7',
+            'ecode.gif' => 'd78d5418d4c6883c837fdbeb7b824bb4',
+            'forecolor.gif' => '1703ceb1f02e9af817794fe8334f6612',
+            'full.gif' => '009750822e228e10f51e746ddf8d1fec',
+            'help.gif' => 'e244d2c9d8f1d1910c7145699f767a9c',
+            'hr.gif' => '8d92cb73437c32a0327323b538ad2214',
+            'image.gif' => 'decae954176586ab7504c178b28b5041',
+            'indent.gif' => '89c00ba134c89eb949411194060c135c',
+            'insert_button_bg.gif' => '13a80583b2bf71103ea378514ac717e5',
+            'italic.gif' => 'c8652735e55a968a2dd24d286c89642e',
+            'italic_de_se.gif' => '2eafa516095a0d8b3cd03e7b8a4430f7',
+            'italic_es.gif' => '61553fb992530dbbbad211eddcc66eb9',
+            'italic_ru.gif' => 'bbc7be374d89a1ced0441287eeba297a',
+            'justifycenter.gif' => '652af6256deb0eeb781b0793ee4142f2',
+            'justifyfull.gif' => '009750822e228e10f51e746ddf8d1fec',
+            'justifyleft.gif' => '7e1153a270935427f7b61c7b6c21ab8a',
+            'justifyright.gif' => 'b91052a13211f6b1bc0a5ca596fe4a6b',
+            'left.gif' => '7e1153a270935427f7b61c7b6c21ab8a',
+            'link.gif' => '59cbc5812b993e7f6823937e89e85c18',
+            'menu_check.gif' => '889563a22f10dd4535d0050b807e42ad',
+            'newdocument.gif' => 'e6d9f7d0bdc4d21d9b9fd1ad6b888733',
+            'numlist.gif' => 'd4c72d6e6d56fee2315ad59426a99a4e',
+            'opacity.png' => 'bd2babb5fb15f4ad5352dd05be54e898',
+            'outdent.gif' => 'b7249cc5a3bce3971f0b19fccac07f60',
+            'paste.gif' => '14d2f6c0e090ce821ca302a6b5d7e7d9',
+            'quote.gif' => '83277c79354c0cebed4b93b92ca96c56',
+            'redo.gif' => '0fb531683cf59bb0e1c9911d475e640c',
+            'removeformat.gif' => '2a5f195e9ec54e7e0e2fb40238678444',
+            'right.gif' => 'b91052a13211f6b1bc0a5ca596fe4a6b',
+            'separator.gif' => 'b0daa6a4ec9acc86c3b2b1bb71f5b6a5',
+            'spacer.gif' => '12bf9e19374920de3146a64775f46a5e',
+            'statusbar_resize.gif' => '4bece76f20ee7cd203d54c6ebd7a8153',
+            'strikethrough.gif' => '0dcca301aa909817a82d705cc9a62952',
+            'sub.gif' => 'dfbcf5f590c7a7d972f2750bf3e56a72',
+            'sup.gif' => '15145f77c6f9629bfdb83669f14338a9',
+            'table.gif' => '476b000e94b74dac818f1ce03681ace5',
+            'table_delete_col.gif' => '333372a2469c8dfa12a002a2aad8de59',
+            'table_delete_row.gif' => 'c58d9413b1d8150011db91818595871b',
+            'table_insert_col_after.gif' => '5d19acf7a25262cf3ddc7a926a076218',
+            'table_insert_col_before.gif' => 'd5910a210405a8cc7a24086104b06fa1',
+            'table_insert_row_after.gif' => '6b3167fde6db6ac271488b9cef404792',
+            'table_insert_row_before.gif' => '0e37e4c48dcddb1123bc6140ce323694',
+            'underline.gif' => '203e5139ee72c00d597e4b00ed96d84b',
+            'underline_es.gif' => '027608183023f80b0c9bf663c9e81301',
+            'underline_fr.gif' => '027608183023f80b0c9bf663c9e81301',
+            'underline_ru.gif' => '843cb1b52316024629bdc6adc665b918',
+            'undo.gif' => '7883b9e1f9bf0b860e77b904e1941591',
+            'unlink.gif' => 'dcd93dd109c065562fe9f5d6f978a028',
+            'visualaid.gif' => '491fbaab8d180fdd051cece94f2b8845',
+          ),
+          'jscripts' => 
+          array (
+            'about.js' => '7168d330431da1d7c082c84df665a6f0',
+            'anchor.js' => '5bffefe6a515c1b10fd636a4fbd45a34',
+            'charmap.js' => '124138e299a3ef0c823010d2fbbdaf0f',
+            'color_picker.js' => '9dcf13f6303af0db5d3fb280fa526f62',
+            'image.js' => 'bf79747eacc011f3902a1804b49d6265',
+            'link.js' => '3df42cdbae98782ae9a9bffaeba7ab53',
+            'source_editor.js' => '987562f807c2354b120270e17447e664',
+          ),
+          'langs' => 
+          array (
+            'en.js' => 'dd60763dcdafcb1acd494e3950cd5432',
+          ),
+          'about.htm' => 'fc2c574502ccf3e53fd00f52d9aa3869',
+          'anchor.htm' => '15ace71eb4c333034944ef7cfb1646d2',
+          'charmap.htm' => '9848d7254d4979ce94dfbdee055900ba',
+          'color_picker.htm' => 'c00bae115f05a96d5a561dd46cfb9fa4',
+          'editor_content.css' => '99f256c087e16872937f6cf9e4ea0c32',
+          'editor_popup.css' => 'a2bbb5f95ba2d3422c1666222170d700',
+          'editor_template.js' => 'ebbea930e24ec9723baf85a8a7a5054e',
+          'editor_template_src.js' => '3df83a6c451003dc2b521561b5f196e3',
+          'editor_ui.css' => '62632779c868eddf46f3a8e121083d31',
+          'image.htm' => '4a2a0fe9cc33b4997f718b58af1be6ca',
+          'link.htm' => '8f96d1fee5e848c10bd1c73faf0b38a6',
+          'source_editor.htm' => '43153d53a3e9dbbafa5399d6ea3a2e73',
+        ),
+      ),
+      'utils' => 
+      array (
+        'editable_selects.js' => '18b1487fce99cb47592b36535de0b128',
+        'form_utils.js' => 'aadc996ce4f61a4ec7701804f1be9f7b',
+        'mclayer.js' => 'ca81f7eaf3af6e32c30972ef1652a43d',
+        'mctabs.js' => '832f2fed0885cc138f0b831660dd2c31',
+        'validate.js' => 'e600c6db5c42e1b6b17e74531f723563',
+      ),
+      'blank.htm' => '72406c871a9be7972922686221a885a2',
+      'filelist.php' => '63d5fa62565bc100d3345de82ab36985',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'tiny_mce.js' => '9292f09840dcff32a8837f560b589852',
+      'tiny_mce_gzip.php' => '846511eed428312feca1f0e5fec6cd91',
+      'tiny_mce_popup.js' => '069e50a15c68f124213f42533c0ffeef',
+      'tiny_mce_src.js' => '020a68120e9d7c52022509069e845ce1',
+      'wysiwyg.php' => '37206fc679904a99834a4f1e96bb7037',
+    ),
+    'admin_handler.php' => '2d593943e40bf02d5d46cf6b6af6b7e7',
+    'admin_log_class.php' => '0b7760f435d2d36f19b49ef6206392c7',
+    'arraystorage_class.php' => '4862b38926c8f68029c95d31990435a4',
+    'avatar_handler.php' => '54c9f790d9f17e30f52b8011633d486c',
+    'bbcode_handler.php' => '01a5fba10173320244f8e9a7157e6da4',
+    'cache_handler.php' => '8902d17948517fcdbf3a9448dcf39671',
+    'comment_class.php' => '3c40e81e233bacf0a37ca959477321f1',
+    'date_handler.php' => '900262e3d47034c444cf3da1abc9371d',
+    'db_debug_class.php' => 'be1091d952dd6900d9559eca53f0be82',
+    'debug_handler.php' => '19da1125a99430468c50b0907734436a',
+    'e107_Compat_handler.php' => '7e4acf26b5cb655f3fb04231873fd06a',
+    'e107_class.php' => '77749a7f5cff807d7f1b8694baeefd69',
+    'e_parse_class.php' => '278017576cc7ea2553fa2b547413e168',
+    'emailprint_class.php' => 'e2893f34c93b8defd9a579e0c25decb4',
+    'emote.php' => 'b5d34cd652e828769f49b855b090c96f',
+    'emote_filter.php' => 'fedbb8c9daf1acd5f6dbbb9914b05dc4',
+    'encrypt_handler.php' => '7a6f592c0900d68fcf5cbf7b0eb1e364',
+    'equery_secure.php' => '00121b097ba978d5330349abbd350737',
+    'event_class.php' => 'd14906b7576984e7d9467c097e285b65',
+    'file_class.php' => 'f768aa1cedfd0054e52f920a5ca70dd8',
+    'form_handler.php' => '67deba10eb6acf65d941b760deec6134',
+    'forum.php' => '9dc7f57079e136ed26e246aa64af3f88',
+    'forum_include.php' => '8b562f8ba508cc3572c84b443c4e7a6c',
+    'forum_mod.php' => 'fd1adbf1660996aeb4f51384506e0045',
+    'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+    'input_class.php' => 'f819fe76d1fa518f430410aa4e6c803e',
+    'level_handler.php' => 'a231a4e63fcf4f498f9bfd7411250faf',
+    'login.php' => '225de0ff7490fead67e2cc4fc31ec4d9',
+    'magpie_rss.php' => '1297fc8132b5ec0a2c04436b38ec6aee',
+    'mail.php' => '3fd990110951114a7826ac1309699e0c',
+    'mail_validation_class.php' => '75e722bf8c6975349ec402682323314e',
+    'message_handler.php' => '67b1e7f4268d4f42ff1da633f1320b16',
+    'mysql_class.php' => 'fa81c70b14be9457782ec05a6c5cba85',
+    'news_class.php' => '51b6210595dee0636b6a31a905517474',
+    'notify_class.php' => '6d5325aaaa5082db544fdb58b156760b',
+    'np_class.php' => '30a61bcbf3a29dfb7782b4424a6e322e',
+    'override_class.php' => '2acb8a492cebbd9c1f746c5a16876c09',
+    'parser_functions.php' => '81daef0e484ee070d440e4ebc9bc8095',
+    'parser_handler.php' => '650775595b663683a426c61dba6215cc',
+    'pclerror.lib.php' => '7b1498a7efb4524dd899c954526c3ca2',
+    'pcltar.lib.php' => 'b9313066aad3049bb0041099137a648e',
+    'pcltrace.lib.php' => 'eb165fe908cc30c85975b7d35614990b',
+    'pclzip.lib.php' => '1b0212a9a1e09b781172c8f6964296c2',
+    'php_compatibility_handler.php' => 'f77929f2cd211a855516e3e72873ee99',
+    'plugin_class.php' => 'f22e9ab9197a661dac698b9318d51095',
+    'pop3_class.php' => '03797a300bb98806c88023e1addde7e4',
+    'popup_handler.php' => '5f424554d5a7b8e3a22aa855d7438377',
+    'pref_class.php' => '1ff1af54f958073ee2c845d63c252a35',
+    'preset_class.php' => '5a4df9b9b87aa3862dda2afd44165acd',
+    'profanity_filter.php' => '2e9e8c2da7647655d8939ce6c095d68d',
+    'rate_class.php' => 'd7f52533cd2e092485f0a3bd67e0ab1c',
+    'ren_help.php' => '6560d54f7d55221ee7b74c2b6be8c7ce',
+    'resize_handler.php' => '44e5777433fa18d97e80a4c16552f785',
+    'search_class.php' => 'fe9c65c10349512b91164b8b67e724be',
+    'secure_img_handler.php' => 'bd451cb8fba72e5a0af19cbf9fd24e2b',
+    'secure_img_render.php' => '9d4946a4d3c452fab164a1f9718dd1b8',
+    'session_handler.php' => '5fd69cbf9cfb7c31aa9fdc7333978226',
+    'shortcode_handler.php' => '6a2ec1c1178db0b4fc05d361733b05fc',
+    'sitelinks_class.php' => 'e9be0fc4a02e45c7d77055a7697e3ca1',
+    'smtp.php' => '71008c80b0a5e12faef990c0560f8226',
+    'theme_handler.php' => '34e6dd76fc681d084a72689bb39d309d',
+    'traffic_class.php' => '0cd2cc326571109cc20424f448e3d288',
+    'traffic_class_display.php' => '4583aae09eb49619d1b302160c27b721',
+    'upload_handler.php' => 'fb16ce561219c18a33ae9853019c4f3b',
+    'user_extended_class.php' => 'a7676df9454fd4e16efaccf1703ac266',
+    'user_func.php' => 'bb871abafb6c91109c809afa9514afcc',
+    'user_select_class.php' => 'df05137d06087acf9f3c52e9fc4825e4',
+    'userclass_class.php' => '4e4d8711dbd6aea0d3d0e015aa594485',
+    'usersession_class.php' => 'd1e15b80de1174f77e3783ba7b15e199',
+    'xml_class.php' => '2625ffa68fd7516ddf64eea40e47f218',
+  ),
+  $coredir['images'] => 
+  array (
+    'admin_images' => 
+    array (
+      'adminlogs_16.png' => 'fbfd5c6e0baadff05bda59e2f077a0d1',
+      'adminlogs_32.png' => 'efd307a26601627eeebf563e22c8e5e7',
+      'adminpass_16.png' => 'fbba9d9f7580b2f98337f8c0f18d5c53',
+      'adminpass_32.png' => '57fa674965e09299b6cc340c7d406a36',
+      'admins_16.png' => '64ad9ccbbcf1be92f0822150034b9c1a',
+      'admins_32.png' => 'dc9cb0a7263efa4ea1dbb17ee1cdaa92',
+      'arrow_16.png' => '38b69b179e7cdf232aa367a0dc3c4cbd',
+      'arrow_32.png' => '95eb3ca28bf59f4cdbefec8fa86c3895',
+      'arrow_over_16.png' => 'c37f8d92046ccd1ea70cc3cfc8f0fbdf',
+      'arrow_over_32.png' => '93b788fd693c261aa8ea9ad788fce9b1',
+      'articles_16.png' => '2d99036d870389c45c140370ec296050',
+      'articles_32.png' => 'dbcdcd9f704906b9f3e1b48394abd545',
+      'banlist_16.png' => 'e2f4be1afe16286a0a5363ba5a88ffe8',
+      'banlist_32.png' => '5545b900ef6b8c90bce85143e5a985c9',
+      'banners_16.png' => '052830d01fdf73ed2e1955ab76f3859e',
+      'banners_32.png' => '3331be741e6c3f336034d6ddc5d223c3',
+      'blocked.png' => 'd2b20874ccf7079dbb71b6c94e117d21',
+      'cache_16.png' => 'f9aefee07fadf8f40e3883bac2973470',
+      'cache_32.png' => '76ddb6584a9096bab54567a082357f8d',
+      'cat_content_16.png' => 'af826022cad1ad5c5d2703d0a440aaf8',
+      'cat_content_32.png' => '80f9caf4f37acd5bdcdd4afb7ceeb6e9',
+      'cat_files_16.png' => '936037636275ca4c41a08fb962c79b86',
+      'cat_files_32.png' => 'e6d063e74e730d05d688626c6d375b89',
+      'cat_plugins_16.png' => 'a6bac798e6dad7b2e40487e3dedf51ad',
+      'cat_plugins_32.png' => '74b17e491961633f65a2510e92ebde18',
+      'cat_settings_16.png' => 'd981addefa729f697bf0b0dbf70293ea',
+      'cat_settings_32.png' => '707034db3893c074c959a226ac6f6732',
+      'cat_tools_16.png' => 'd1405a8ef3d0320c3ce7c8e870bd50b0',
+      'cat_tools_32.png' => 'ffeca06ab80ddeb1453b397ac30816c1',
+      'cat_users_16.png' => '32441383ed5d50d6fa9188b98d957dde',
+      'cat_users_32.png' => 'a331baef28f6e923bad1a26ba5d17e4f',
+      'chatbox_16.png' => '6524280b8f44bde11dd5ca5581432c14',
+      'chatbox_32.png' => '2e6ae5a5be12ec8d09b5083e959347b9',
+      'comments_16.png' => '721b2c81aa4fa1c43fe4211fb35c2ce0',
+      'comments_32.png' => 'd5ba6ada9b084efe6209e1d9d603f749',
+      'content_16.png' => '0205fc5130dc19a8b279244aeeeb4729',
+      'content_32.png' => '2d2b276bf5f57a38575446262ac4fc75',
+      'credits_16.png' => 'a24c7cbe05d44b7effcb6386f6a69455',
+      'credits_32.png' => '6b96e92e85026907fcc4be6c45ae60df',
+      'custom_16.png' => '3fdd7c500f2a5c8f9fe221d710958593',
+      'custom_32.png' => 'a3813ae977ea3567b61d9bd3dfc398fb',
+      'database_16.png' => '61541674f83748834b299d27d3aa5eb9',
+      'database_32.png' => '83bb87a7cbaf1d57cdded1fc7078f2ec',
+      'delete_16.png' => '3efc7450de9b20183c7196e3fd9a0b8b',
+      'delete_32.png' => '5c479d67b5dc9f8fcc567d4201619b5a',
+      'docs_16.png' => '70c3594a0a096d55e2af638a4bd7105e',
+      'docs_32.png' => '2903138ad0be7ee641704dceca59089b',
+      'down.png' => '434814c2c747f4062c6306fbfbec0622',
+      'downloads_16.png' => '98cbf2ae49e39048e7ca60cc56898477',
+      'downloads_32.png' => '1c745a271507abccff12574123b14f0d',
+      'edit_16.png' => 'b6a25f62385219e73803e16c9682d438',
+      'edit_32.png' => '17546bbd5fe9b8975fca44318f693932',
+      'emoticons_16.png' => 'b92db0a7212cee1023293df03ae5bc90',
+      'emoticons_32.png' => 'fa8974be1a06298f9819a1a203be02d8',
+      'extended_16.png' => '4a6f3c5952ca3417e278c11d2551388e',
+      'extended_32.png' => '72490efba6641db9a7521ff440cd9af9',
+      'failedlogin_16.png' => '8888638ff60c8b47131f02a66c8df598',
+      'fileinspector_16.png' => '7f7e61d6ed995277ce5fb60496d1a512',
+      'fileinspector_32.png' => 'ca4961289d1d1a0aa22f561c6df68f3b',
+      'filemanager_16.png' => '936037636275ca4c41a08fb962c79b86',
+      'filemanager_32.png' => 'e6d063e74e730d05d688626c6d375b89',
+      'forums_16.png' => '5773aa73ab08e4e575ceb2d60001f8f5',
+      'forums_32.png' => '543708df3b2731ea4607ea5741a21f12',
+      'frontpage_16.png' => 'e60c942e6e9a06ef05d167d7baceb2d5',
+      'frontpage_32.png' => '2f385c03a9223119729ae2a08c28c1c9',
+      'images_16.png' => 'baedd05460c41fd50c3eb4560cf1d574',
+      'images_32.png' => '594f730d41b24b6c2da4b18e7173712b',
+      'installed.png' => '31969aa03c0d7315e6b7d6b6b82e9e8c',
+      'language_16.png' => '15f89da876e53572a12521378b92dc0f',
+      'language_32.png' => '361c4a919639d165831e65a3a2c4fef1',
+      'leave_16.png' => '536b996002b22632e757a82256e09417',
+      'leave_32.png' => '171a1609e849b1836046e84cbd590bad',
+      'links_16.png' => 'd3da622046d044d11ee0f4418eafc426',
+      'links_32.png' => '41df266db1ae2cb292804acb1993e383',
+      'logout_16.png' => '1344f00789bc5007f0219ee412bc59cc',
+      'logout_32.png' => 'a97a480f681f58ef845d441fb3cb5eba',
+      'mail_16.png' => '0ef7b53ee7a39baaba506f330f7ae161',
+      'mail_32.png' => 'eb62361ca3d16865045a224fd8c74cf3',
+      'main_16.png' => '7df71fa173411541ec291f858ac33c40',
+      'main_32.png' => '1573eaa39de50801aa3e612ad99cd44c',
+      'maintain_16.png' => '8914863c97d297e7952034ee35b9580d',
+      'maintain_32.png' => '18c74535a7ecea3f53e05ff4ceb47c49',
+      'menus_16.png' => '45889621dc7577c1b5ec6627d1260ecd',
+      'menus_32.png' => '1df6ff20ba41d511667aeb95ec79b024',
+      'meta_16.png' => 'd016ee58c8a4b3be2347e1e6a560f575',
+      'meta_32.png' => 'cebc0933e6f32ebdcd174f1cd2c84175',
+      'news_16.png' => 'bbc0eb1411a21d970b3f3c9855e516af',
+      'news_32.png' => '5d7c3b72896f141b62dc256fa317db5d',
+      'newsfeeds_16.png' => '861fa883c8f6068c7826805013d07373',
+      'newsfeeds_32.png' => 'f0f57c5173167da962adb1517b2f98ff',
+      'noinstall.png' => 'f89fe8f057694f93e4e163e4daf3de2e',
+      'nopreview.png' => '49737d3c5a4ec9283374d6d0ad51d0f5',
+      'notify_16.png' => '18ec179018401ce76acc5c1c06907844',
+      'notify_32.png' => 'f766bf524380a6a38516cbd66ce9c5fb',
+      'phpinfo_16.png' => '5948f2468a9c5103a70f0e6e1345335e',
+      'phpinfo_32.png' => '2a7d8e07347e42d4e0b33e48bc7adffb',
+      'plugins_16.png' => 'a6bac798e6dad7b2e40487e3dedf51ad',
+      'plugins_32.png' => '74b17e491961633f65a2510e92ebde18',
+      'plugmanager_16.png' => 'c9e73da3fd4c7599a95898def126e2da',
+      'plugmanager_32.png' => '07f656ab0bae75a4dd83abdec439b4e5',
+      'polls_16.png' => 'dfa11ad7ecf088f5bc50152e3c8318de',
+      'polls_32.png' => '7c98815961fc0215e8bd38aef5e1c295',
+      'prefs_16.png' => 'ee40f8fae0672844fe428863e7b9b28f',
+      'prefs_32.png' => 'adcc28e37b40a339342bd1777c88efe3',
+      'reviews_16.png' => '8d3eb23e13ea9c11108fe0e2959a0ced',
+      'reviews_32.png' => '22750ab40ad6355053b9f6d88662f775',
+      'search_16.png' => 'f1f617ae57346558eefce7d0b79b71c2',
+      'search_32.png' => 'e0035406d30341e044c130ec0543a6c0',
+      'stats_16.png' => 'f24d43706a08a9b56af5a32b63450ddb',
+      'stats_32.png' => '403f0037feb233afd45899101b1a5630',
+      'sub_forums_16.png' => '16a40908a7b37e8353c978ce3ecd1910',
+      'sublink.png' => 'ccdbd8fa6d0d55ab04db69d55b4b85fc',
+      'sublink_16.png' => '01e36bad2b292ae96fc802fc3a13d3b2',
+      'themes_16.png' => 'dd5f28c2c4d15fae13310583371bde31',
+      'themes_32.png' => '17c89daac72616669908555e43dfc127',
+      'uninstalled.png' => '5b2f9aac0af8a3946a22e0ec066817eb',
+      'up.png' => 'f023b6d5e7688dc3bdc0f42bbb8ba002',
+      'upgrade.png' => 'd22e7b79c115c954255120aee1718277',
+      'uploads_16.png' => '971a694016a861f18d746bbd2912be9d',
+      'uploads_32.png' => '7a1d3f37f5f724f45fb2b9a8bace7582',
+      'userclass_16.png' => '1ec9ff416999d28f737495e5de9a50a6',
+      'userclass_32.png' => '7b017b1b700055243424f94aefeba3e4',
+      'users_16.png' => '32441383ed5d50d6fa9188b98d957dde',
+      'users_32.png' => 'a331baef28f6e923bad1a26ba5d17e4f',
+      'welcome_16.png' => '997361b25db69ead1224a55f44ca7a41',
+      'welcome_32.png' => '2bd4b95221a8d83bb03d9f488e9879b9',
+    ),
+    'avatars' => 
+    array (
+      'avatar_1.png' => 'afcfe041eed1d882cc4931d389a53f6b',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+    ),
+    'banners' => 
+    array (
+      'banner1.png' => '3d15e8b33ec2644f1c63e75b5878cd32',
+      'banner2.png' => '1f7e31b2d7608c12d2f77612780846b7',
+      'banner3.png' => 'e0d62559bab3b6634281900187fa548b',
+    ),
+    'emotes' => 
+    array (
+      'default' => 
+      array (
+        'alien.png' => '132447203b23b5ea2b27f163ae147375',
+        'amazed.png' => '76ccc59194f25ef34164935d0ebdc81a',
+        'angry.png' => '6339c6e824beaf63c72d01e7fc1c5039',
+        'biglaugh.png' => 'd640e904627dec36da78083017e77e71',
+        'cheesey.png' => 'c69f60044b7e243c1fefc24e2097c923',
+        'confused.png' => '68af16e7f4d1031ea0976a73896d3dd2',
+        'cry.png' => '75b3ff5af3f778c338a8e035005bfd96',
+        'dead.png' => 'd1e3e9babb3aa762ec12444ab14b9029',
+        'dodge.png' => '191aaaf658e90d1038fe56c3cf457f48',
+        'frown.png' => '93e1b4df23ce2f4ea9f311c16b3feb78',
+        'gah.png' => 'e86e47f9879750f6b65c4abf11c3b676',
+        'grin.png' => 'a7ca30b7e3e2ff04324c5dc4b5a9f10b',
+        'heart.png' => '6725f455e4bee2790a1e41409ea442fb',
+        'idea.png' => 'bd3714d2834a24f37e44c75d8945aad6',
+        'ill.png' => 'f19506e014a984c51d353e91ab407b63',
+        'mad.png' => '728d6690e01f2e71609042976617ae31',
+        'mistrust.png' => '3b6461df233511acb6b11cbcaf561675',
+        'neutral.png' => 'cbedaeb373af5636babb772e867d53de',
+        'question.png' => 'b90dd830b597832793e79b6cde609039',
+        'rolleyes.png' => '79d5a5bb55e2bea788a1295ee8f3822a',
+        'sad.png' => 'a9c921562b864bccc37d22661bed896a',
+        'shades.png' => 'bc0d623f3569ab29cffcd59ceaf0c7ea',
+        'shy.png' => 'f89a41079638cfbf785a59689b92b628',
+        'smile.png' => '98412834fb8063733c819817150a6706',
+        'special.png' => 'b54e4cddfb082fcf4104e44a71a9599f',
+        'suprised.png' => 'c37ca48c0545b29439594f39e7a11964',
+        'tongue.png' => '2ae4736fd035307f24332e603156e09a',
+        'wink.png' => '5d4053942a4eb9fc6546b981b94fb9b6',
+      ),
+    ),
+    'fileinspector' => 
+    array (
+      'blank.png' => '36d4a4e95c2b83ac5aa338420d1c5bf9',
+      'close.png' => '2955a752035c039435b4b0a8a37b3ee7',
+      'contract.png' => '0fe7c9f9bcb9b3ab1b08d7e8e04c7a0e',
+      'expand.png' => '265205998404f04e3e2341b5af839054',
+      'file.png' => '853ef1ee108dbf52dc94a30b71e34e4e',
+      'file_check.png' => '221397df4726589bb54824f6168d5484',
+      'file_core.png' => '14659f2933ff4d012e0de7c1906a243a',
+      'file_fail.png' => '354ee40218c997f8c91505b7f5921ff5',
+      'file_missing.png' => '98ab830e6df162aef5bcc01f27d4703b',
+      'file_old.png' => '594e132af5820c784354ea1f2266867f',
+      'file_uncalc.png' => 'a64ad7faba8f6cc0cf223a5eb5edd52b',
+      'file_unknown.png' => 'a8c3227bd1a34953f4cf399d8a3fca9d',
+      'file_warning.png' => 'c89ce9c864175d152e68f52da184a50f',
+      'fileinspector.png' => '7f7e61d6ed995277ce5fb60496d1a512',
+      'folder.png' => 'ebc79586731bca95fc8325db909d3868',
+      'folder_check.png' => 'eeb4f5128a415b4a967e419c88a31084',
+      'folder_core.png' => '9b651167d978554d0e9fe8ac8d6014fd',
+      'folder_fail.png' => '5c22933b877ca80494776f773122d179',
+      'folder_missing.png' => '2795a36251fdb85980152557f235a44f',
+      'folder_old.png' => '9a6a2a03b1bb4b93c0f24e3d9359e56c',
+      'folder_old_dir.png' => '1bb0a25fa42a634a3d44c28e0af51723',
+      'folder_root.png' => 'd6c388fcb5d70f133a1fe2275a40ea20',
+      'folder_unknown.png' => '7332f53c115b6bc71972ae311cf030ef',
+      'folder_up.png' => '7039e15ef64fd80a86a485a0ed59ee51',
+      'folder_warning.png' => '06979aa4ae89a09acd2ef5c926566a97',
+      'forward.png' => 'fdd333af9d6f6c75a15353d95b4870d2',
+      'info.png' => '14a80e7098141b76d3a025a31cba972f',
+      'integrity_fail.png' => '1b6843bcc78dd0f3919535f2c4f3131c',
+      'integrity_pass.png' => '324a8f77bfbd3a84b1410cd35c9341ee',
+      'warning.png' => 'df4fc8eca478c717b04b6414c94ae76e',
+    ),
+    'filemanager' => 
+    array (
+      'css.png' => '32ac2a0c288cf0aa36e38f4b5e6dc5b6',
+      'def.png' => 'fb1d041d6a8676ca6b0e06774555fd01',
+      'default.png' => '5930437a90ea872cf3bc52ddb8d960ef',
+      'del.png' => '7ad01b059b7a69f526a0b382e5bf4387',
+      'exe.png' => '5112337d61d7bda70bbecaa268ed1a73',
+      'folder.png' => '106b81b7f1a2a088ac79ddd77fb2f151',
+      'gif.png' => 'b863d1f9574232a6ea988fb7b8557854',
+      'home.png' => 'cf548efa0e9e1ae3e22dd274a0d2d772',
+      'htm.png' => 'de8b6e1e5f6730bb203d972b8ad85932',
+      'jpg.png' => 'ca0dcf0c83d88c7c110070bf1019d1cf',
+      'js.png' => 'd5ab294b6715368d746595b3f315819c',
+      'link.png' => '23a41af7f24cca6ed09919efde7eb13e',
+      'mp3.png' => 'f1686b1c368acb226332ed1f38feb256',
+      'pdf.png' => '03d111bedff573dd436a0cb75de1e19f',
+      'php.png' => 'f2d2759af9ddecc7b90ed8647db7a114',
+      'png.png' => '2b8e0d0f947520dcb37568a3317a0d64',
+      'txt.png' => '64e05312c122b017f6f2595e6df320c5',
+      'updir.png' => '562f1cb1fe4038dc999db57786ad2f3c',
+      'xml.png' => 'd8b2f286726d631b1a819cfd2c62e89e',
+      'zip.png' => 'd4119fcc2b0b0080a1e98645c109e314',
+    ),
+    'generic' => 
+    array (
+      'bbcode' => 
+      array (
+        'blockquote.png' => 'a06a9e6709453140681b7a97a7692870',
+        'bold.png' => '3e23e2d8c5a4a2e7c1b750a5df9b03b8',
+        'center.png' => '742d4eafd59c556ca747f6ae69aa04f8',
+        'code.png' => '30583ffe0299705ee851a87dd7b8abe5',
+        'fontcol.png' => 'd2175741c2e7e09aaaa134146636df67',
+        'fontsize.png' => '89110496b363b669e3e8dffb630b9279',
+        'image.png' => '1db77a12868512a36f836b986e6bb648',
+        'italic.png' => 'a3e561a3c5d01819a3137562fd982958',
+        'left.png' => 'bc27363615e096a000103c21984cd79f',
+        'link.png' => '3adc8c31d1470a6cce76416fe0b6f3d7',
+        'list.png' => '6bb4e650cad9857c47bb1433fd771052',
+        'newpage.png' => 'ca132dbbb5c50e1486c02c3f0f9afe11',
+        'prefile.png' => 'ab42c617455c9f05d5ea8534d607e4f9',
+        'preimage.png' => '101b73c1584a2d14c4c313a15a66242e',
+        'right.png' => '885e764546e87d2fd526b977aed84d1e',
+        'template.png' => '54281aba1f70c00dc1c947fd053fddfe',
+        'underline.png' => '09d08b8f890c4ebba77ecb9f25f20705',
+      ),
+      'dark' => 
+      array (
+        'answer.png' => '211393b753f0c8aed1e9a24856195ce9',
+        'arrow.png' => '998eb269289b90ad8d004bbcf39378c2',
+        'download.png' => '7319b1158fefde24a4d87aab735e6333',
+        'edit.png' => '418103beb48a1d430ef7e0804ba6607b',
+        'email.png' => '7d37fab1f0904165a5f64408f7c455e9',
+        'file.png' => '60fd70ce4acb78b454488c4ef9d99f4a',
+        'image.png' => 'ed4e650087e42f815f5e086f021b9a9f',
+        'new.png' => '96d33a15dfe1558805084225734cea60',
+        'new_comments.png' => 'a4861dd50722e8d8b9b7f4cffa59ad3d',
+        'newsedit.png' => 'fef524ec2422d5a35c422c57afda4f87',
+        'nonew_comments.png' => '5e5332c02e5fd1863ea1e7b907124f89',
+        'password.png' => '2703c1268bee5c1582919a6155ca634c',
+        'printer.png' => '8c123d297261d687712d952ee30d6c4c',
+        'question.png' => '790b246cd96a583ce2bb0b7e814172a6',
+        'search_advanced.png' => '8cfb8fa25c792cbca4f4ff115f81ee08',
+        'search_basic.png' => '9b3da3928a4e3ed317ad0dad431c93ad',
+        'search_enhanced.png' => '6cff954f99c462eb9eb722554b7463d1',
+        'sticky.png' => '25295751d78f9990a6635e6e2715fa43',
+        'user_select.png' => '2431cdbcffa1b1d898b7e0ed8fd967e4',
+      ),
+      'lite' => 
+      array (
+        'answer.png' => 'eb63ab9d559dd785415ab5a783e93901',
+        'arrow.png' => 'c56779c444bd61c1eeddb94fd8af3d61',
+        'download.png' => 'f7cc87125001ff1ed99bf19887f7e6f3',
+        'edit.png' => '726bada8e08555d38a6fa1a2b6655f8e',
+        'email.png' => '14841d450ea66f22b82813f0468dae51',
+        'file.png' => '734c8c413045129b92aac717daeab761',
+        'image.png' => '10146c68a6f1acc36eae2cad602451d2',
+        'new.png' => '28c7e4fb6b93a103c315c6930952cb13',
+        'new_comments.png' => 'a4861dd50722e8d8b9b7f4cffa59ad3d',
+        'newsedit.png' => '987e90984c9450e1dc1af89788d5ec0b',
+        'nonew_comments.png' => '5e5332c02e5fd1863ea1e7b907124f89',
+        'password.png' => '0c9ea13d60acd72b66ac44e2d12d432f',
+        'printer.png' => '743fbcc77ab2017e6d02d6759585e0ca',
+        'question.png' => 'c1ed6f4aa816112b7454eb6b2c2c15ba',
+        'search_advanced.png' => '9d443b535924d4d840533f56def13e1b',
+        'search_basic.png' => '4994d26dfb8a01d9dfdf0e594513db5f',
+        'search_enhanced.png' => '9ad50bb193c4c53ceabfc74131901419',
+        'sticky.png' => '23d10c4451b4f17d249f6eeb7b721cf6',
+        'user_select.png' => '4ee12681a97e352b072dfa9d5dac808f',
+      ),
+      'bar.png' => '278ca1b407bc68f138fa64f226700631',
+      'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+      'code_bg.gif' => '2b9dbcbb11a7b4fd46c3b4b25f419435',
+      'code_bg.jpg' => 'd1693c7b554681efbd2e82ce04907eae',
+      'code_bg.png' => '09bd8d9951b5d993bb4371836a9dae51',
+      'cred.png' => '0e39907fdaf0dca630919b54ab01c9c1',
+      'php-small-trans-light.gif' => 'f3cffe6d2a1a2fdd32c4d694e9cc989c',
+      'poweredbymysql-88.png' => '850c2974bb9ff8fc41fb9cfdf244ce52',
+      'valid-xhtml11.png' => '875ce84f7794284f50cafc7aab8b5a77',
+      'valid-xhtml11_small.png' => '2b4e0a3d4b5b15b6f19593f4b42009d6',
+      'vcss.png' => '780ad30f6a83c9dde3464ba9a4aeb664',
+      'vcss_small.png' => '9f5feb6ca5b6bdb71f62082f9e73b402',
+    ),
+    'icons' => 
+    array (
+      'download_32.png' => '28d16188580b522e2e296ab985aa371d',
+      'folder.png' => '20aa54f4fe9e4c3323d50089f0872a90',
+      'folder_32.png' => '7d501e7392007bcf7458c8291eb0d4fe',
+      'folderx.png' => 'e801994723571d22e198487431ec7573',
+      'folderx_32.png' => '8ac80a5d0cd4a4a08bdabb7d050e272c',
+      'html.png' => 'caa46c5b4aa1bf948a96dcb4c3c6611b',
+      'icon1.png' => 'bdb55c0c08483b5a5f13bb602ffdfaf4',
+      'icon10.png' => 'bef1f2d8866047851fd707f207c56908',
+      'icon11.png' => '9dcfb98cf72b89dbbc7501d944ac1849',
+      'icon12.png' => '1438dfa7e1f6082fe54f27969007b8cc',
+      'icon13.png' => 'd5e20c025e0d4ac1a53adb995733fe9f',
+      'icon14.png' => '8db20481620879f5ab538cca21323834',
+      'icon15.png' => '63083b9dcc1cdeab206c36fa0f1982a1',
+      'icon16.png' => '8195650382046743734b7fcfafcc27d5',
+      'icon17.png' => '7256aa31268c39b5d47744199d7fb18b',
+      'icon18.png' => 'e582b78688372dd7fff9851d1630b948',
+      'icon19.png' => 'c9bc67c97ec8728f1b224599cb440c0b',
+      'icon2.png' => '78fcc298d3b1153a29b95566d42a993f',
+      'icon20.png' => 'f915bdcd951e94a263d4040fb760aed9',
+      'icon21.png' => '0a26bcd73d38dc3acbf36399c66b3c94',
+      'icon22.png' => '69b7fda0348fc416f98b8ef0c5eabe8c',
+      'icon23.png' => 'f33c700ea73802ef02e6a4fc3262c074',
+      'icon24.png' => '3c8bb8e3ed55fb42e81375d62ef4a88e',
+      'icon25.png' => 'ffb34f77aa4a07a00618139204a860b7',
+      'icon26.png' => 'bbc0eb1411a21d970b3f3c9855e516af',
+      'icon3.png' => '8bd10c2043823acfc344a20ab3efee24',
+      'icon4.png' => '66383ba925e4f488df0fe4704d362627',
+      'icon5.png' => '83c34cfb4244dcca5fc42489aab98998',
+      'icon6.png' => '03e04b50657db966ff6ae0fc8930d904',
+      'icon7.png' => 'cdc8a8584b62f53498f4d90ecbffe7d1',
+      'icon8.png' => '716b3b9833d4cb03a5594cd0111784f9',
+      'icon9.png' => 'd0505cfb21a6d1c8cd6589c0a31e82cd',
+    ),
+    'newspost_images' => 
+    array (
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'welcome.png' => 'dcd1a6d6463e28fc84994d56bb383060',
+    ),
+    'rate' => 
+    array (
+      'box' => 
+      array (
+        'box1.png' => '89b6a1c3cf0178d55bb0c13a1f4bc70d',
+        'box10.png' => 'eac820c7f66f66b1aad4bac8b0d42338',
+        'box2.png' => '034686d522c6d907831f8272c9d2c35a',
+        'box3.png' => '98481a017e09f720d6e725dd9a60f189',
+        'box4.png' => 'f001913a928f9b5877e44b6d616d70a9',
+        'box5.png' => '2a007464b58c49afd3f4b00aa9f6d6a0',
+        'box6.png' => '7166324ef491fbc3ce7b20bc207c1699',
+        'box7.png' => '35b7e46ffadd8e7b01beadba18fe1577',
+        'box8.png' => '53be60725cc237466b537c9e47774473',
+        'box9.png' => 'f9e1f9e5a88fec0569830d1bdbc1b5f3',
+      ),
+      'dark' => 
+      array (
+        '1.png' => '069d68706d00652e2279a2370e1e1204',
+        '2.png' => '5d9e897ad6269159cae542557b1b088f',
+        '3.png' => 'b8225487772f15980bd8266a01c22cae',
+        '4.png' => '06197264693d06769207d56b83040cfd',
+        '5.png' => '9cb0b783db4ffccc38364a9aa6528381',
+        '6.png' => 'dc6b3fbb86581ca69175ba77cf1bd0a9',
+        '7.png' => 'ac5ea785f9d34fb2588cf24f5a3a3e60',
+        '8.png' => 'ed599a5204eaedc2c915f9bcdc609948',
+        '9.png' => '1035b9d5ff65916393620614057d1d79',
+        'lev1.png' => '71860ab527620603bb1bd33083cd0c3f',
+        'lev10.png' => '28fe7e15be0ad8e05cd4945e4c130967',
+        'lev2.png' => '0c3cb7d2b6cd217d71a0bb2f5e255ed4',
+        'lev3.png' => '5c1d9aba19a174ff40912534a52c6c8e',
+        'lev4.png' => '7a7b0127d381e6128f1506c6d0ca7470',
+        'lev5.png' => 'c52ea0fdaa597d4f5a2ab93981055b4d',
+        'lev6.png' => '54fc1f5cdb88d2e6760cd44f58ae9a6f',
+        'lev7.png' => '20e4472caa04d0db921de375c6a08b5c',
+        'lev8.png' => '556266576a5d7bec39ccdc083e7b58ed',
+        'lev9.png' => '99197d2afaa22ed2900cd9e231f7a37e',
+        'star.png' => 'ca86f6b6a0dce04e3dbe14e2c9877e3b',
+      ),
+      'lite' => 
+      array (
+        '1.png' => '6f7d1164a961cce68f45285a97e29a76',
+        '2.png' => '0bb0e1552ed71dacd2b824ebb195b8d6',
+        '3.png' => 'a39a7efccfef2e081383ce04cadb0b2a',
+        '4.png' => 'ec2547815e60e48d19fc278820155ffb',
+        '5.png' => 'c30ddc4ef328fc632e3a1d657e5383ac',
+        '6.png' => '1c33896015f47a12c8a64c29c133870b',
+        '7.png' => 'ab0d30021e8cc388eeac86356a92dece',
+        '8.png' => '882dabfb4a1accdb6a43f4f46762fee3',
+        '9.png' => '4e9592963cbcf80bd10cc980c99c71d4',
+        'lev1.png' => '2b93a27bfa68a64c4f943fedc7a2db9b',
+        'lev10.png' => '74736097ad258eda613888017ae1f886',
+        'lev2.png' => '5289520ced54a12c5dde1919e9a5cd71',
+        'lev3.png' => '71d9a412fac35ba7a396fb343d30c792',
+        'lev4.png' => 'd7eef7456c608c89e65f2093e6fa4eae',
+        'lev5.png' => '0ca73f9360c15138214d1660df733e0a',
+        'lev6.png' => '3aec7910ecc2b6a518b67beada1e017c',
+        'lev7.png' => '58c3f5c41b6214171b741bcb0fbf1823',
+        'lev8.png' => 'e9b674e663de20e34520794598be3064',
+        'lev9.png' => '4cb78772cfc2cbf653a3df8576552dec',
+        'star.png' => 'b9f1804f1a08c3084ada5c034184a132',
+      ),
+      'box.png' => '37e0a80e5782adee28a52e456d11ba07',
+      'boxend.png' => 'e075b96122cb84dd7bb9d0ce8c789e84',
+      'star.png' => '59876e874a49bec49ee4c867a5e52251',
+    ),
+    'user_icons' => 
+    array (
+      'realname_dark.png' => '495b61c3f719bc8bec44e1b25cc0b196',
+      'realname_lite.png' => '9ca664d347f80793f016f61986ea3a38',
+      'user_aim.png' => 'd54ddd04c02bcbb1dd6593ff5e8e2fa3',
+      'user_birthday_dark.png' => '4acaaa85b357e0572759282ffe1922cf',
+      'user_birthday_lite.png' => '14bbc908d5d6efefc6739d7806aa6bd4',
+      'user_dark.png' => '85bc493bf67af508e5320a924b54cce2',
+      'user_homepage.png' => 'bf0ee3d43c8ec5aa81d8425e51ef0f37',
+      'user_icq.png' => 'eaa044e6d235a88c79ee2fd42d6e8a17',
+      'user_lite.png' => '12b7c805c022708d57cf0d2ecd8b4a02',
+      'user_location.png' => 'e2571843e8ce3df251f0a3fd5db53729',
+      'user_msn.png' => '6aede4988c88b3e3829f1387cbf3914f',
+      'user_realname_dark.png' => '495b61c3f719bc8bec44e1b25cc0b196',
+      'user_realname_lite.png' => '9ca664d347f80793f016f61986ea3a38',
+      'user_star_dark.png' => '899b215d9dccb0ff4ff38d7d1decf031',
+      'user_star_lite.png' => '3c579e4f29bb42a413567f241cb3a2c2',
+    ),
+    'adminlogo.png' => 'aac088a88a8c729f950c158fa875f1ce',
+    'advanced.png' => '8e1db463c3cace7822b51ee311d208e4',
+    'button.png' => '4388e88589f99a52a2cffe5f7e837548',
+    'e107_icon_16.png' => 'd49ad6870dd304ce1b30b56be446ea07',
+    'e107_icon_32.png' => '9fcedf8edb4728a97001fd5cc9616ef8',
+    'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+    'logo.png' => '22bd0af2fc2849c900ebec1ea80bc8e3',
+    'logo_template.png' => '78e43c6f2492f1c5bcb5b4d223ebfc75',
+    'logo_template_large.png' => 'cce83a8f84255d2bab00522b73a4e6d4',
+    'pcmag.png' => 'abe521ccc3a89a43ff641ab3daf1f37d',
+    'splash.jpg' => '7f749391cb6d31dcf9c9145f3d30df4d',
+    'thumb.php' => 'd606e6c43e39f27bcf9f7622e32365eb',
+  ),
+  $coredir['languages'] => 
+  array (
+    'English' => 
+    array (
+      'admin' => 
+      array (
+        'help' => 
+        array (
+          'administrator.php' => 'bfc3305d4af30024ef36e2c3cac685d5',
+          'article.php' => 'f57a8593995381d72c45460c51abbd7a',
+          'banlist.php' => '589e0268a08606ff935ee928292602c7',
+          'cache.php' => 'f889aa4a1889a3112699c899eb655744',
+          'chatbox.php' => 'd5aede1254e7e48e3e8733f18f6ec0ce',
+          'content.php' => '5369ed6e0df6e1ed980baf910ef1dd2f',
+          'cpage.php' => 'b6f8e28fac199323b49ee54fbf1d498c',
+          'custommenu.php' => 'bc2d5fff1395d8495a45b80da77b7665',
+          'db.php' => '62ea0c3c0479239c5864c14585f53d3d',
+          'download.php' => 'dcfce12aec25465d48762456414ca9db',
+          'emoticon.php' => '44293ed224e20f90dc81554c1064842a',
+          'fileinspector.php' => '9e11d8f26df9aa83c4cc7b593f2c6dfb',
+          'filemanager.php' => '1a677bd67c7fdfe43c6e01484cd75948',
+          'forum.php' => 'cfa0ce294f2307d51bedd70fa4a95d4b',
+          'frontpage.php' => '44e0a1156408e6ccffed96f35a516d04',
+          'image.php' => '11a6e5190f22d4c3586b440a15203fdb',
+          'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+          'language.php' => '514346599719d0abc2f0a947945c77c8',
+          'link_category.php' => '8dfe128ba96dae4ee995a3fbc983a471',
+          'links.php' => 'c9c06673b3d7089ac9a729e1601b82c4',
+          'list_menu_conf.php' => '88bd581ba21987493206e430885cd3f0',
+          'log.php' => '03b4b2167cd5afd8e33d4ae90785baef',
+          'mailout.php' => '5050871042ba40b90e0dac92c29dab0b',
+          'menus.php' => '9b2d9d2e0610b55965d9b49ecd7a91c1',
+          'menus2.php' => '95d400a59300f67d7cef129ac7848c9e',
+          'meta.php' => '6c85ff99c2707a2d6e73ac990971ba83',
+          'news_category.php' => 'c5c0ec9243677fe2560442c790ccd02a',
+          'newsfeed.php' => '93f7ef1481d3fc59ecde4d40ad6b6c84',
+          'newspost.php' => '5c6cd5442e85aa008b07061196e7016d',
+          'notify.php' => '96e76c0244bf06754516ced2bbb6a760',
+          'phpinfo.php' => '201f61e8c6ba0619083a30143af56625',
+          'poll.php' => '3adef894abf1c1920a311899071ff8ee',
+          'prefs.php' => '4cc47a077677b93cdede1ca55e3b354f',
+          'review.php' => 'f62a000ee5131770aeadb06435bbd4ad',
+          'search.php' => 'd2666c12e2b614aafa75bb7204a0d7f9',
+          'theme.php' => '7ac282adfbb1f04fc10a6aa07c11e7bf',
+          'ugflag.php' => '672cc1bd9a2885d7f9a7264be39a98aa',
+          'updateadmin.php' => '60b51ca80381001703f4af931236cbc2',
+          'upload.php' => '38d7510182a2e393cd1a09b924c95df1',
+          'userclass2.php' => 'b1e5e797e72b5015dd9a7b39ad7dff22',
+          'users.php' => '135781d3419791aa07e7fb8988a733fb',
+          'users_extended.php' => 'b73f20ff4c7d9f9b9eae883b300b2426',
+          'wmessage.php' => '5aa5f420a6b29adad555ef7e55bd932f',
+        ),
+        'lan_admin.php' => '9114e7b3d0a5e1bd3f1a8ce992012f2f',
+        'lan_administrator.php' => '5b75cb110a03a18ef9de4265822ff74b',
+        'lan_banlist.php' => '28d4e417164fa6682e8d3387529e36ec',
+        'lan_banner.php' => '5b2ce99d9e2e962e1462caa4221494e1',
+        'lan_cache.php' => '0926abdc99274d71157280c9d58749e0',
+        'lan_cpage.php' => 'c95be0bafa672c32d75394f94bb3af02',
+        'lan_credits.php' => '9d83ac814225653e5862d0d0704f5031',
+        'lan_db.php' => 'c59d72c49322151b7fd120b38e4cae95',
+        'lan_db_verify.php' => '6c6067d3b23c7c0d9f36cb17867dc80a',
+        'lan_docs.php' => '9df02b4a6fafef4e9be2962bfeaed509',
+        'lan_download.php' => '01350f04931b9b086dbaae7c9cd7e9ae',
+        'lan_e107_update.php' => 'a200e7fa82b8607a76b450d33f4fce9c',
+        'lan_emoticon.php' => 'c9bd141a932946c2d640ec3e1aede17d',
+        'lan_fileinspector.php' => 'c3021f79a6c58ec46c5f6507af414653',
+        'lan_filemanager.php' => '8955a0b3b7730d3f008957108525ccb8',
+        'lan_fla.php' => 'a987a7502238c9f1dae9555d944ebd38',
+        'lan_footer.php' => '74880a9ba3fbe4524bc2f0987e936ab6',
+        'lan_frontpage.php' => '37ec01b89e67032f33498cb43e44bdc9',
+        'lan_header.php' => 'a2458aaf0d0b6cf536ba27fc226999ca',
+        'lan_image.php' => '067185121bc4bb95b722d5bf1d30c323',
+        'lan_lancheck.php' => 'fa9bf2e3ddf8ef45303ef25aec77f6a5',
+        'lan_language.php' => '28ed38b445feecbae0d60069484d2b2f',
+        'lan_links.php' => '0be35590679473745983fb5bd0b95155',
+        'lan_mailout.php' => '232441e06abc08339a291da5eaa4fac4',
+        'lan_menus.php' => 'aff6368b11b30bea0515de7cbad89dde',
+        'lan_message.php' => 'bcfd03068e0ee9d76eb1a3df969bb544',
+        'lan_meta.php' => '4c728ceb9da11d2d978996864fd2dcae',
+        'lan_modcomment.php' => '7f8738c7c0b3ab882f4b9c330136b6b3',
+        'lan_newspost.php' => 'a1b7c0f9b245ad636cfe55e27f39c93e',
+        'lan_notify.php' => '5b7d241419a114a1c4c6b521c8ddb6a6',
+        'lan_plugin.php' => '722997f6a14965debe3dd45b232d40d4',
+        'lan_prefs.php' => '8d1d6dbd9a9b082407bd7bd852dff467',
+        'lan_review.php' => '36820722f27e35f1fe10edf238a13d93',
+        'lan_search.php' => '1d7b01d67674e832a8e9dcea6354f070',
+        'lan_theme.php' => 'a3c60a804c469c6ff4b4cb7d3019d981',
+        'lan_ugflag.php' => '29f0ad8c752be1bf98cc067534994711',
+        'lan_updateadmin.php' => '90de3118181658a108f2eac6cfbb2653',
+        'lan_upload.php' => '577fb53d82b6e29ac3e2bff5b55c5c09',
+        'lan_userclass.php' => '3eedcbd961e57434d6c64f9321fddb59',
+        'lan_userclass2.php' => 'e475c31e99b4867d9517705b584f5a44',
+        'lan_userinfo.php' => '552f616f3a00b66bc9d84aebdbe9f67e',
+        'lan_users.php' => '7050bec07b31ac1ff5381f0797e7e29d',
+        'lan_users_extended.php' => '0fe22677f5bad397e4ddba55bfd33e45',
+        'lan_wmessage.php' => '27b96105500cdfa56bc27e391a0c2f3b',
+      ),
+      'English.php' => '6b371cd4820cff8bd7bfb10ee1c108f3',
+      'lan_banner.php' => 'f368fb53095c72c2add3e25381461f42',
+      'lan_comment.php' => '727a9fdff69ceace66d83b6e1a5afb62',
+      'lan_contact.php' => '379a67e389bbf65da7010949fec363bb',
+      'lan_date.php' => 'af33dd14b696babe19fd09e386c200c5',
+      'lan_download.php' => '0acfd66fa377474e976ccf10d9c22aaa',
+      'lan_email.php' => '9fabaac260391fdaf100a0ede907afbc',
+      'lan_equery_secure.php' => '100577fabcdfa3adbe3db5b88eef2baf',
+      'lan_error.php' => '63da78f2e07d86d31497622ec33dcd69',
+      'lan_fpw.php' => '45fc83d63ffeb54941951293bdf949ac',
+      'lan_installer.php' => 'b5538528ec8e52c5094083adc12137d5',
+      'lan_links.php' => '6d9d4ecbac849a6143e31290fe3fb9e3',
+      'lan_login.php' => '3bf7ecb7c00be86b54c83370fab6f8c6',
+      'lan_mail_handler.php' => '0626917dd76f86f168c4f3651d86fc73',
+      'lan_membersonly.php' => '102bba47b482668bb433a5a607767bae',
+      'lan_news.php' => '12d36bb089b37e5391299f1bcd1a1d37',
+      'lan_newspost.php' => '03cca3bd4c3553accde4fe1b2bb9856a',
+      'lan_notify.php' => 'f930fc0c3afd1516e3b63f63f6f51e16',
+      'lan_np.php' => '3d6c87e7ffeaa79de1ba06da0175f367',
+      'lan_online.php' => 'cf15db263203fc5cca674ac1e03923bd',
+      'lan_page.php' => '70979edfe7a243daed3a9c08e22bb6c8',
+      'lan_parser_functions.php' => 'dde30f3b797b4ccb08bfe30a5a8514a2',
+      'lan_prefs.php' => '0520bc45182553a3f44b88c51b5377f7',
+      'lan_print.php' => 'dd0d99919bf9bc77f3a3f5079e9451f5',
+      'lan_rate.php' => '02191b8a77011476d4e3e554387c01d5',
+      'lan_ren_help.php' => '500673591ea1c30f523a557d538ee0fd',
+      'lan_request.php' => '023a40948ec32b3359e9a5bae2b04f71',
+      'lan_search.php' => '01bed4f43957214885351de0d18e0e5c',
+      'lan_signup.php' => '7e1c2115398db73db3656e2b97b466a1',
+      'lan_sitedown.php' => '8c2fc61c6fa1e8e9f0316c780df45639',
+      'lan_sitelinks.php' => '08f8cb9f24cff0e44b778fcf3c80986f',
+      'lan_subcontent.php' => '8307d6e57a66ad7df8a57777c1fdcb36',
+      'lan_submitnews.php' => 'dad73b4f3761044cf03a236386b343fa',
+      'lan_top.php' => 'eaf2c17d7c6e40e4e660e9a6dea851a1',
+      'lan_upload.php' => '52254da910f370cf89a14c080516e7fb',
+      'lan_upload_handler.php' => 'f61e83d33b48733bbf58c4189103b0bc',
+      'lan_user.php' => '59b116f5a1184efb7cbcd962bb1b1f2c',
+      'lan_user_extended.php' => '890b9ce3e1cebdc59d098a3465f7d151',
+      'lan_user_select.php' => '5632220cb249c60e812c3592f086039c',
+      'lan_userclass.php' => '878d0e56e32c03a7ffbd923dd0efe591',
+      'lan_userposts.php' => '976fa5108d96acf116bbd177d9b0f38a',
+      'lan_usersettings.php' => '76e37338a24462d18e3d405d70351913',
+    ),
+    'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+  ),
+  $coredir['plugins'] => 
+  array (
+    'admin_menu' => 
+    array (
+      'admin_menu.php' => '6a22c61a493644b9288a9db4c702c447',
+    ),
+    'alt_auth' => 
+    array (
+      'images' => 
+      array (
+        'icon_ldap.png' => 'a04116417bb033cbb747627677ba44e3',
+      ),
+      'languages' => 
+      array (
+        'English' => 
+        array (
+          'lan_alt_auth_conf.php' => '8f2bff2df6eb9c8fc46f1c181f4baecb',
+          'lan_ldap_auth.php' => '8553f2510a8f44e048e75b0caad969f6',
+        ),
+      ),
+      'alt_auth_conf.php' => 'ed72f592d53b7fcbea3beb28a284cfbe',
+      'alt_auth_login_class.php' => 'd9d25ea7809bd6dca736e56088eb0655',
+      'alt_auth_readme.txt' => '75b056df0169fa9a03bb31633d7fcbdb',
+      'alt_login_class.php' => '4b0323c7f6c566b76b50d9748a77d568',
+      'ldap_auth.php' => 'b169f366bcc3984996b13c4d309a8807',
+      'ldap_conf.php' => 'ac204d3f754c57f88c6cc75d4081dbc4',
+      'plugin.php' => '6a30244d4c83044092a65d43d285219d',
+    ),
+    'alt_news' => 
+    array (
+      'alt_news.php' => 'c32d87e2229fdf2c5f473d970abd2c8a',
+    ),
+    'banner_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => 'db2fd1a909893d6476bfeaf2324003f8',
+      ),
+      'banner_menu.php' => '325dda23599d1b5f4ddade2c46729e29',
+      'config.php' => '0ddb8ce25fa975b2c3f7eed157e1b52a',
+    ),
+    'blogcalendar_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => 'bc4d844c9b0b8bb553913eb462542620',
+      ),
+      'archive.php' => '620cc5c929bbf23b3c7ade778fedc187',
+      'blogcalendar_menu.php' => '512b4589bee3e51d54dffa57dd2347a0',
+      'calendar.php' => '4c05e65f098d38d7ed84783a479d999e',
+      'config.php' => '8bf4ecf1ebf7b0a2628081ebdee358bb',
+      'functions.php' => 'f2cf77b89db87b5ac5d2a3935fd4ac59',
+      'styles.php' => '4bf2fa9fb79e56287fff569b7c31863c',
+    ),
+    'calendar_menu' => 
+    array (
+      'images' => 
+      array (
+        'b1.png' => 'de9174823c3ec762027752d1c8ca2787',
+        'b10.png' => 'e92aab589b5a33207640e533b6e5a68c',
+        'b11.png' => '45a15a73b00f46799b4a456ceb1d7cb7',
+        'b12.png' => '16ceea91edba926971991f86ff99204d',
+        'b13.png' => 'a737e352f69c566e88326015627f77f6',
+        'b14.png' => '5c74299db8f6e92e004b4aacfac7b910',
+        'b15.png' => '492bed712e09f7d95ea0d8593d4b373a',
+        'b16.png' => '5010d685380c5ecaf6d2941ac66e3648',
+        'b2.png' => '88d88374398613838909f9bea531c0d7',
+        'b3.png' => '68c92cd6c067ad930a05ab0262ee4a89',
+        'b4.png' => 'eabb1d49b67487e9b6502d3f22ee54eb',
+        'b5.png' => 'e297c23ad9a7d7a3f3fe34b5f08d2eeb',
+        'b6.png' => '894d38230672afa9765fff0afed8c2f9',
+        'b7.png' => '6aaafba2e9218606e573766a1b79e065',
+        'b8.png' => '2e7439fea8b0d6de515710fd0e894fb8',
+        'b9.png' => '56b3452cfe1d6a898ff17bd446cce73e',
+        'cal1.png' => 'c9a93d59ed67e69075f686563ddde806',
+        'cal2.png' => '80178ae70f6089d2933cf2323f7fed2e',
+        'cal3.png' => '3370f9cf32cc5683e07c2bc919d151e4',
+        'calendar_16.png' => 'ace8396ac74a5909b38a62835e76d9f9',
+        'calendar_32.png' => 'ee297b07e04c5d54afcfd124987c7d9f',
+        'icon_ec.png' => 'de31be991ae1102420a3bc76e3317045',
+        'star1.png' => '22cebabc9731207092fe2242c8922ef5',
+        'star2.png' => 'b50d4638fe170e7766ad473aa4039701',
+        'star3.png' => '8c04fb886a6d4f6d4ab505660186d160',
+        'star4.png' => '3645c9f38bab928554feff707d6a130a',
+        'star5.png' => 'c6289a1dd7d998ee799228b34af10e70',
+        'star6.png' => 'a65f3fa346ad5888f15d2d2d5c5977d8',
+        'star7.png' => 'be1cedf7be3f740c5a3cd92b3220badf',
+        'star8.png' => '575da0a997de16c305cdfd9e0433b09e',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '3747bacde1503ef43529d8cf9d8370f4',
+        'English_search.php' => 'fc1f68851e4c41b94e1bf1fcf9c25e10',
+      ),
+      'search' => 
+      array (
+        'search_parser.php' => '05b18b0087a2816766543bce7da0b5b1',
+      ),
+      'admin_config.php' => '092621473e4b8a45ce06615b3d94e554',
+      'calendar.php' => 'd97c7ede21d006635979a6cd9a328c2d',
+      'calendar_menu.crc.gz' => '90580c372c43234e82c73fe1687611d4',
+      'calendar_menu.php' => 'cd9f210de6b276083be87d604f9c2bb6',
+      'calendar_shortcodes.php' => '4f8f68728525f242a092d8fc86a2443f',
+      'calendar_sql.php' => 'fa11dd0f013775a997f8707aa6d45e87',
+      'calendar_template.php' => 'ddbbcd09d6440c66574b0a27a2a2ea60',
+      'config.php' => '401d559f53265f4b1778701b8e9dd512',
+      'e_list.php' => '78ce81c90bb8ba76439742d32f15ab89',
+      'e_search.php' => 'a1681c6fed9972dd140b72b3ebfbd3c8',
+      'event.php' => '8b359632c9f4efaacfa5f4cb3e77e11a',
+      'plugin.php' => '81812c4090fc5db132f65344c5972305',
+      'readme.rtf' => '47f6de1137030fe2efde782133ab725f',
+      'subs_menu.php' => '678ea436a9d23447ca6b76e9ecd8ae00',
+      'subscribe.php' => '6cab22ea5d89164d89c0a9b9052daae2',
+    ),
+    'chatbox_menu' => 
+    array (
+      'images' => 
+      array (
+        'blocked.png' => 'd2b20874ccf7079dbb71b6c94e117d21',
+        'chatbox_16.png' => '6524280b8f44bde11dd5ca5581432c14',
+        'chatbox_32.png' => '2e6ae5a5be12ec8d09b5083e959347b9',
+      ),
+      'languages' => 
+      array (
+        'English' => 
+        array (
+          'English.php' => '20c22f46f54d574566ca5b7e02809b5b',
+          'English_config.php' => '9adc5ef167b75da9ea343a3f0b1e07a7',
+          'lan_chatbox_search.php' => 'cfe3e4e7191917199b79c85ae8b9f018',
+        ),
+      ),
+      'search' => 
+      array (
+        'search_advanced.php' => 'b7a8eab8e5969256ab578277c92d3c47',
+        'search_parser.php' => 'c576ea7d07ce91c106c3bae38912237c',
+      ),
+      'admin_chatbox.php' => 'd1ba373a0b5e884bbdd46db7690ea54d',
+      'chat.php' => 'fffbc7b9c603acd334ba5c34e50e44c3',
+      'chat_template.php' => 'cf97b7663cd4177f9c7ac299318ef8e5',
+      'chatbox_menu.php' => '66faf713ac200d01ba8397ef9f0dc9da',
+      'chatbox_sql.php' => 'aeb0d501ff23212e304f7f9a83d6926d',
+      'e_list.php' => '11fde3fe8b58bec52bc6220053498509',
+      'e_notify.php' => '379fbef832829bc4e9188b9fed62f31f',
+      'e_search.php' => '172e48694433f84b0f8d43ffb880e881',
+      'e_status.php' => 'd5fbab54f8fcb5ec5eaa42c1b328cf6a',
+      'plugin.php' => 'ecfb4e0f38b4c6db5a73214ae4f83f1f',
+    ),
+    'clock_menu' => 
+    array (
+      'languages' => 
+      array (
+        'admin' => 
+        array (
+          'English.php' => '20d51f72c8ec0b6e93c567cd9d10c126',
+        ),
+        'English.php' => 'a6414a6871116b964cc12d77d72b2748',
+      ),
+      'clock.js' => '576433d4e5242c567e6c6d0d97b7ca73',
+      'clock_menu.php' => 'e0d33629ca46324479cf344eb2bdbdd8',
+      'config.php' => 'b5c6e83c7f9141ade22165ed62ed1884',
+    ),
+    'comment_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => 'a43ede27d8ec0e05536c240d3416bfc3',
+      ),
+      'comment_menu.php' => '337fd74d3bc93f8d18c614124ed58ac6',
+      'config.php' => '6e3c630d6ed02fdef574240c60a6da38',
+    ),
+    'compliance_menu' => 
+    array (
+      'images' => 
+      array (
+        'valid-xhtml11.png' => 'dc71b96214e7b1d1df0db38575f42313',
+        'vcss.png' => 'adcc065d9d9ce649cba7c03f58f3eed8',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'fa122fc7d21d653f3bea9f1a790cb173',
+      ),
+      'compliance_menu.php' => '9e54deeb24e38ca243c298bb3249563b',
+    ),
+    'content' => 
+    array (
+      'handlers' => 
+      array (
+        'content_class.php' => '6496925bf94c71a30b5a4be0226733ed',
+        'content_convert_class.php' => 'ed330381ff2075bb93ef57ae9504ce64',
+        'content_db_class.php' => 'a4ce3f5843d957eac2492f2080ff3efd',
+        'content_defines.php' => 'ed3202f3e12291f5c9d04445496670f0',
+        'content_form_class.php' => '113d385383c4d9078409ae1913b4d0d7',
+        'content_preset.php' => 'f98e2a3c015ed9481518c6dd4b93b826',
+      ),
+      'images' => 
+      array (
+        'cat' => 
+        array (
+          16 => 
+          array (
+            'help.png' => '2e809fd98f717d0cf39cf1106783984f',
+            'ledblue.png' => 'ef03ae552afbfb83a6fa7904e32858ec',
+            'ledgreen.png' => '9fbd1469e20d4d18c42a67b8ba161b1f',
+            'ledlightblue.png' => 'fb788d9f8fcf0db66b7af5d88d0e9dd1',
+            'ledlightgreen.png' => '2469623cdc8957e372a3bcc0c495a438',
+            'ledorange.png' => '35a155381c22a4b41deccab43d72e3e3',
+            'ledpurple.png' => '870e78863fec7bcdf54f298df354708e',
+            'ledred.png' => 'a78b6edef88f45df366721425604da25',
+            'ledyellow.png' => '88b84ff109f92be3ab7771483902be26',
+            'messagebox_info.png' => 'b2fe3cfcbe243aebcb7c933a6937596d',
+          ),
+          48 => 
+          array (
+            'help.png' => 'b5ca621ba2f7f8456b347bc52f42c37e',
+            'ledblue.png' => 'fd023701c69e6d1eaa4ed552f213190c',
+            'ledgreen.png' => 'ec1034e5bc3164b221346b3c74b0059e',
+            'ledlightblue.png' => '4d1c8ed166533c3acbec721421be3400',
+            'ledlightgreen.png' => 'b634d062505badfbef4c2975ca343461',
+            'ledorange.png' => '6d8f2e413a621feca1f30ff286023b91',
+            'ledpurple.png' => '411a1f3315c4875a391d2b405e7a987f',
+            'ledred.png' => 'da8b898d4d4294b4a11a038aee027a7f',
+            'ledyellow.png' => '6d0bfa866c30e0afaa599807cbd802a3',
+            'messagebox_info.png' => '4b8fdb10f2fd9d65d7f09bfe16c432a8',
+          ),
+        ),
+        'file' => 
+        array (
+          'tmp' => 
+          array (
+            'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+          ),
+          'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+        ),
+        'icon' => 
+        array (
+          'tmp' => 
+          array (
+            'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+          ),
+          'blank.gif' => 'e3b9998dfa86c3849180ac8349da3f76',
+        ),
+        'image' => 
+        array (
+          'tmp' => 
+          array (
+            'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+          ),
+          'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+        ),
+        'content_16.png' => '2d99036d870389c45c140370ec296050',
+        'content_32.png' => 'dbcdcd9f704906b9f3e1b48394abd545',
+        'error_16.png' => 'e7eff95804de0967e46c89361bd97604',
+        'file_16.png' => '73d6e8b60327c61034be10adb2325771',
+        'manager_16.png' => '358cedfcdc6ef1f44657050dd5892fac',
+        'manager_48.png' => '3fd9a284f7d0d446ab430ccd4ef550dd',
+        'ok_16.png' => '2a65610ea93831bfb0ad07e77fd2e488',
+        'personal.png' => 'd1e39d963741e12edb0ed6261d72ace4',
+        'redo.png' => 'df3dd61d416b00c26d3cbcdf02e862b4',
+        'score.png' => 'c368fe32f78a4ce09298b0c94f5fa89e',
+        'score_empty.png' => '9cd759fdab39278d2fa4242c15d88871',
+        'score_end.png' => 'e075b96122cb84dd7bb9d0ce8c789e84',
+        'view_remove.png' => '084a9efcb11ca37426fbdae4fbeb0875',
+        'warning_16.png' => '10b4bdba8f5f7d7598822219123e7792',
+        'window_new.png' => '2bbce24fe15c0144cd225856ee0a990f',
+      ),
+      'languages' => 
+      array (
+        'English' => 
+        array (
+          'lan_content.php' => '8e6a7ed4b2cc0bb4da88a04bcf5859ce',
+          'lan_content_admin.php' => '35ada311323c900996c72fdda7a37ce1',
+          'lan_content_frontpage.php' => '1593838cd7ec925d50576a815bd3c9ee',
+          'lan_content_help.php' => '54ede5c5383dfce958f82f1bf57a16ab',
+          'lan_content_search.php' => '2e8fda0d060eaa6e1d5bd76361978935',
+        ),
+      ),
+      'menus' => 
+      array (
+        'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      ),
+      'search' => 
+      array (
+        'search_advanced.php' => 'c6c6ae35cd1020d27a861ac693347560',
+        'search_comments.php' => '34b14edbe1d2e8fbac541dc03262b21d',
+        'search_parser.php' => 'a11c4d73227f733c320333da4b0a49f2',
+      ),
+      'templates' => 
+      array (
+        'default' => 
+        array (
+          'content_archive_template.php' => 'cd9ffa256885c44e9b9f9b744ab1b359',
+          'content_author_template.php' => 'ca52482a2cce64b649978112f6313847',
+          'content_cat_template.php' => 'bcd0114c7f3d36d207d4b4b83ee72b10',
+          'content_content_template.php' => 'd601c1371ff816e49f649410f041b4b2',
+          'content_content_template_bigtext.php' => 'cabac0439d0456b36c5c870fdd441c25',
+          'content_content_template_blackonwhite.php' => '06be15b768d287529b040915a0ffd489',
+          'content_content_template_whiteonblack.php' => 'fc89c26d0a7004f096240d3284f3ad43',
+          'content_recent_template.php' => '56343e014f6ccba20e30781004507766',
+          'content_score_template.php' => 'c17825d54f57b868b7f80fe25ed268e5',
+          'content_search_template.php' => '07c629ee2b5d37c9508fd8c1d6c6ca6c',
+          'content_searchresult_template.php' => '12dc90cd6c1b8e44056a5a61831c2b39',
+          'content_top_template.php' => '25870f37db1b2a68a1683c17d8a4fed2',
+        ),
+        'content_manager_template.php' => 'd9b35da970607141a38d18fd7fe3acd3',
+        'content_submit_type_template.php' => 'fab837ae4c5b4f082b35493a09130800',
+        'content_type_template.php' => 'cd9c8ef95bba36acdc326724926d2d76',
+      ),
+      'admin_content_config.php' => '78b5e01b64f2dab4608737931d035c45',
+      'content.js' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'content.php' => 'a98d9c363fdb48ad0c31be4480082863',
+      'content_manager.php' => '24750433a9d5223d9d4cde2725a2a210',
+      'content_shortcodes.php' => 'add55e11663117ff37ce30c0513929b7',
+      'content_sql.php' => '2632a603dd04ed62bbb3f011d3c5de41',
+      'content_submit.php' => '7e44ceadb92a89b648467c7f77febcd7',
+      'content_update.php' => 'd9045747f69c528e6c5f7fd0cc4e8fa4',
+      'content_update_check.php' => '1719e04046a4fc4c7adbae301d61ec42',
+      'e_comment.php' => 'd4da90b94c8ed7f471b6223b872328f3',
+      'e_emailprint.php' => '4ba168a80c544e6af9114782fafa11cc',
+      'e_frontpage.php' => '4fee2ac77b9c66c1d5b760b95e6ea255',
+      'e_latest.php' => '9e3bf7aa8789693352a9a0644b21a2a7',
+      'e_list.php' => '5154b5a3b1df0b3fc234b92b79ade4e3',
+      'e_search.php' => 'd86c2f562c466bd7200974bd16f07c45',
+      'e_status.php' => 'e327fef8f0ea1ad19fe9579b4f2ebe91',
+      'help.php' => '0469e11aa5659088da95fbf0c5b5a3cd',
+      'plugin.php' => '6c59934808bd3f955fb45146f57a2111',
+    ),
+    'counter_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '33ae994d0cd2b96deadf8d398d5d25d0',
+      ),
+      'counter_menu.php' => '6d5e959504ca9a579f776610c8b258c5',
+    ),
+    'featurebox' => 
+    array (
+      'images' => 
+      array (
+        'featurebox_16.png' => '74eae49d9d53afb825bc21ac95be07b3',
+        'featurebox_32.png' => '9a498cd16e91c5cec29dfac61dc07199',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '9fa4e9a659ccde7db2cc65e81ad6694d',
+      ),
+      'templates' => 
+      array (
+        'centered.php' => '39693534a9eb1b5e00d263fb22b4ded3',
+        'default.php' => '4ae642d4bfc6b53350d75197182330f7',
+      ),
+      'admin_config.php' => '61506bca5d21856190eb627f4b603975',
+      'featurebox.php' => '196e5d4286ac7b19cfa34e66ec382979',
+      'plugin.php' => '7b085870cccdaacc812417ec724702e9',
+    ),
+    'forum' => 
+    array (
+      'images' => 
+      array (
+        'dark' => 
+        array (
+          'admin.png' => '5fed0ae458f2100bfed0ffc655d1c1ce',
+          'admin_block.png' => '53b924444c2bb9e082d47429244a375a',
+          'admin_delete.png' => '21c3e43917c10a029527d768ba059951',
+          'admin_edit.png' => 'ffe67f5626fbc4fe90d4d7e70e3df9ca',
+          'admin_lock.png' => 'fe74ea0725e050cc1522f8c80d509dbd',
+          'admin_move.png' => '7d3010809006f8bd0b52b89d507ee781',
+          'admin_stick.png' => '7dea7baacf217c6f307a9a0a08fa27f4',
+          'admin_unlock.png' => '535939916663b4d3e59fd744ded21481',
+          'admin_unstick.png' => '87f050e6fe15dab0445cfefc47be2ddb',
+          'aim.png' => 'ef7a16b7871c7b353a06186d3e0dce6b',
+          'announce.png' => '86b85187f8e268e08f09b17ef17f1c8e',
+          'announce_small.png' => '4306e6cbc173ecc3864b284e4731ca4f',
+          'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc',
+          'closed.png' => 'baeb3dcbb714f52d5f8007548ba487e9',
+          'closed_small.png' => '6c541b1147791a28e78674a483f681d8',
+          'delete.png' => '895db8d980f9378df51649443a5bdfc6',
+          'e.png' => '5bb5064aaa81d5554ed6f653bf51cef7',
+          'edit.png' => '0788c55ce19665d809c4a87a9d32d141',
+          'email.png' => 'b17fa6548c6a8ef38ac9fc1691f73eff',
+          'icq.png' => '6bc6f030b47ff1ee2de0913e71552681',
+          'main_admin.png' => '1b3ec206bc4a6daabc970c231e148f16',
+          'moderator.png' => '99b9bbef0e3440071ff394422819ea69',
+          'msn.png' => 'cbf3f20c6baa59d7aae61bbc12bd9414',
+          'new.png' => '14ec3ad326cf9efc5db59d08f6168ece',
+          'new_popular.png' => 'e08fb87d0916010b1ea87e22193c26d8',
+          'new_popular_small.png' => '0bb045dd66fa71755f87914d3daa3aa8',
+          'new_small.png' => '893f53029a2c01d0ba9d5bad65c2c7dd',
+          'newthread.png' => '64283f117398e1709a6aca23eba96c5c',
+          'nonew.png' => '4e4745634cd57876764e3de04f2a6f98',
+          'nonew_popular.png' => '4c14f635ff684394ba7f13a46ee2ed04',
+          'nonew_popular_small.png' => 'b52411630e19de222230c516ec3b9ad6',
+          'nonew_small.png' => '7d2084d22597ca40aa944367626eb0b0',
+          'pm.png' => '11bcda04351efb950b1352b9a82a674d',
+          'post.png' => '22de7b984a3044b53c19a4ccd3cb49db',
+          'post2.png' => '0072597171f5e4380bc3715ddccb7e86',
+          'profile.png' => 'f196e49eb8682872379a0ceea4b8ce24',
+          'quote.png' => '44e56d509440c027fadff8fa3c71bb09',
+          'reply.png' => '6a07036cf75d4acf1e4126371998baf8',
+          'report.png' => 'e36a0b879ea8ac19169302705cd806b3',
+          'sticky.png' => 'ba50de659d59a2997ee77ae177a605f9',
+          'sticky_closed.png' => 'ea5b16c543e3056e866ca5579ecd163c',
+          'sticky_closed_small.png' => '8413fe336a2ec79bdcb0b3bfbcd50896',
+          'sticky_small.png' => 'ebf41f357e88f4e6f29e6d7d8b3464e8',
+          'website.png' => 'ecd92710246e39b964a1857e8370db56',
+        ),
+        'lite' => 
+        array (
+          'admin.png' => '5fed0ae458f2100bfed0ffc655d1c1ce',
+          'admin_block.png' => 'e861b2014ffa66b391e3e4152278ec78',
+          'admin_delete.png' => 'a8aca6d9512cdf1f18f98a324fc63fb1',
+          'admin_edit.png' => 'c8d6b7bcc759884b6ed0a6bc4b53ad57',
+          'admin_lock.png' => 'e709f1ded3bdea3174f30ef49f83aee3',
+          'admin_move.png' => '704a6023c7f2900a6371a63f0dd56462',
+          'admin_stick.png' => '7dea7baacf217c6f307a9a0a08fa27f4',
+          'admin_unlock.png' => '19849fb8ace12d49b649724cdb1948de',
+          'admin_unstick.png' => '4a6856f5ef4b32d56bd232c495baa817',
+          'aim.png' => 'ef7a16b7871c7b353a06186d3e0dce6b',
+          'announce.png' => '9874a0390f8b93d75af92a10a6311201',
+          'announce_small.png' => '1b9b7a6b72ff112bc82b20537220e827',
+          'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc',
+          'closed.png' => 'baaf6f3e3dcca0f678f1a3c79a51a3b1',
+          'closed_small.png' => '7207302f70051cff9c0167f20a89646d',
+          'delete.png' => '895db8d980f9378df51649443a5bdfc6',
+          'e.png' => 'b5e5c9ab677b46ae99ac512039d012d8',
+          'edit.png' => 'dc9067455b48da0bbc50993a4217eedd',
+          'email.png' => 'c51f9e3ef6f5b02087decb2ec7686278',
+          'icq.png' => '6bc6f030b47ff1ee2de0913e71552681',
+          'main_admin.png' => '1b3ec206bc4a6daabc970c231e148f16',
+          'moderator.png' => '99b9bbef0e3440071ff394422819ea69',
+          'msn.png' => 'cbf3f20c6baa59d7aae61bbc12bd9414',
+          'new.png' => '8cf7c2a190bbbce7f18ce99818dbd481',
+          'new_popular.png' => '37d60559b22ff18cbf7bdec33f4a72c1',
+          'new_popular_small.png' => '7becbe1b6207fef993f1601463f57345',
+          'new_small.png' => 'cff284b11533ac4bf740a146d019a942',
+          'newthread.png' => 'eb68d1b9677fca9c32c556e050e4f20c',
+          'nonew.png' => '2808e78e081d8c8d2d7802b9a290ce12',
+          'nonew_popular.png' => '8df0ba08e69b552e7e24e9a2751e5d40',
+          'nonew_popular_small.png' => '33355429da0af82e1f1c91bab2ba7f91',
+          'nonew_small.png' => 'edc0414101f2e406d7c0a070f324220b',
+          'pm.png' => '11bcda04351efb950b1352b9a82a674d',
+          'post.png' => '22de7b984a3044b53c19a4ccd3cb49db',
+          'post2.png' => '0f6cfe51518affb7a6baac798abd907b',
+          'profile.png' => '32300a5d0546cf11e2cee898ec2e23c2',
+          'quote.png' => '579d14bfb1faabf191272938fae3ab65',
+          'reply.png' => '58e4791eb2d8b5712b859639a0eb5320',
+          'report.png' => '3194bb43c91125fce2709500bbe33a9a',
+          'sticky.png' => '45f3c7bfd16c3806a79c3a9540a9e847',
+          'sticky_closed.png' => '9fa98262861f0a900236f795dc72096e',
+          'sticky_closed_small.png' => '5c7f041ff02f267c87e4c46d608e7014',
+          'sticky_small.png' => '4e820e6a2bba0f75e38c2d2bdcfe2111',
+          'website.png' => '568b5e9dcc6fcc5067209e9390297162',
+        ),
+        'fcap.png' => 'db19cb1423e2898da7b2d3802c89404f',
+        'fcap2.png' => '5f6f45697bc185d51f2c06d904642aad',
+        'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9',
+        'forums_16.png' => '5773aa73ab08e4e575ceb2d60001f8f5',
+        'forums_32.png' => '543708df3b2731ea4607ea5741a21f12',
+        'sub_forums_16.png' => '16a40908a7b37e8353c978ce3ecd1910',
+      ),
+      'languages' => 
+      array (
+        'English' => 
+        array (
+          'lan_forum.php' => '8496b78042381e1eb0e55919386b1261',
+          'lan_forum_admin.php' => '4ed4ef8c58138b60b616be5b8c4f74b1',
+          'lan_forum_conf.php' => '32ba5f6f5d5dd8d658cd6fdc056866bc',
+          'lan_forum_frontpage.php' => '5ac941c384cf10a76b6ab040f7ee7986',
+          'lan_forum_post.php' => 'fa12b450ef72c74fd3c4ac2c199911dd',
+          'lan_forum_search.php' => 'dd1263ff01cf0b71991de16756677f68',
+          'lan_forum_stats.php' => 'ecccb2b57c568336e5b1accfa29ad08b',
+          'lan_forum_uploads.php' => '840b741edd3f2d8fcc340b29804689b5',
+          'lan_forum_viewforum.php' => '7b44a441080e2b1a40b8c37944d9a719',
+          'lan_forum_viewtopic.php' => 'b883f51cb8f12e35a9e5970c3a85a2fb',
+          'lan_newforumposts_menu.php' => 'affcfab7c6a7dfa7ba9fd1c134075919',
+        ),
+      ),
+      'search' => 
+      array (
+        'search_advanced.php' => '32a26ccc8c2be60abca8ba2930ba329e',
+        'search_parser.php' => 'd0a93b2530bff2c6781bd4470885e25c',
+      ),
+      'templates' => 
+      array (
+        'forum_icons_template.php' => 'ac7e8c8f02f32719f64cd5bde7ec5f20',
+        'forum_post_template.php' => 'ef65e1bc28d9b933b7f9c97726e13cb9',
+        'forum_posted_template.php' => '264f6e6349fbb05cb71016567311f97c',
+        'forum_preview_template.php' => 'd9eb3ca7d65cdd7aa65e06c6c864a461',
+        'forum_template.php' => 'b7be294e90f39ec2a81e2a437a618167',
+        'forum_viewforum_template.php' => '573605ee268d3232997043e282d66173',
+        'forum_viewtopic_template.php' => '41304790b9455e03034be5bc2efbc68b',
+      ),
+      'e_emailprint.php' => '55d52fe06f711815e068124974a1bc88',
+      'e_frontpage.php' => 'c939394e051b055ccbc963d17b1a1d46',
+      'e_latest.php' => '159be5c83e5b0707bb96682ddaa3c766',
+      'e_linkgen.php' => 'e0cdc0183ce0cf9adbbec54271c55766',
+      'e_list.php' => '523f01012192923c6901b7c088101ec0',
+      'e_search.php' => '663a93cb1f0d05351ecbb85a3bf721d4',
+      'e_status.php' => 'e707e64a960612d443e16906faaf0e22',
+      'forum.php' => 'dacf83d1d260d91a331f2770fc71f1e9',
+      'forum_admin.php' => '612f96376fcfdeed0ee72da4b7f85a04',
+      'forum_class.php' => '9e8df8c2e6973bfdedec78cb36c1c0ea',
+      'forum_conf.php' => 'a4a4e140bda4b3d7cd73abd03170dc5b',
+      'forum_mod.php' => 'bc6667cba8050bd3a2c015dea9bcd730',
+      'forum_post.php' => '1233f70ad65e99cd86b125e969ba2f76',
+      'forum_post_shortcodes.php' => 'e7c237cf147aab58a54749ac00a27feb',
+      'forum_shortcodes.php' => 'd0505d0b22fd35160ec836904ac76818',
+      'forum_sql.php' => '3355b8219c200d8d669ce08e59053465',
+      'forum_stats.php' => '1f70aa406da53b7c3e0214878d8dd846',
+      'forum_test.php' => 'ed668e3268952cb268b3f4aca0d2e37a',
+      'forum_update.php' => '8e1fed1bae66e84eb3ad0235a60f0c69',
+      'forum_update_check.php' => '95b6355554098357b5648807c4e95705',
+      'forum_uploads.php' => '2dfce0029f51c1197e55cd18cb53dad4',
+      'forum_viewforum.php' => '73f11856662490d121c779d610892583',
+      'forum_viewtopic.php' => '7ac96c6a5ac29de83e173488e8ae08e6',
+      'index.php' => '1d225ecdb6dfb425fcdd39501ed196c7',
+      'newforumposts_menu.php' => '6e2dc06b647f2e235cd36a27662a63b4',
+      'newforumposts_menu_config.php' => '8c7c855777e097fe6b8d92f9ef4e527b',
+      'plugin.php' => '871a97116e50c74039db5f2e3c96d040',
+    ),
+    'gsitemap' => 
+    array (
+      'images' => 
+      array (
+        'icon.png' => '29534d4c0ba369a5ad90e6150c86a5da',
+        'icon_16.png' => '6d67b9c447227bd3432ad2cc2b197f79',
+      ),
+      'languages' => 
+      array (
+        'gsitemap_English.php' => '350d69eb976b596ee599530d5e6bff1c',
+      ),
+      'admin_config.php' => 'cf875690da2b4097df1705ddba81b5a5',
+      'plugin.php' => 'eff600c64547e834e39581ed332532c5',
+    ),
+    'integrity_check' => 
+    array (
+      'images' => 
+      array (
+        'integ.gif' => '80475f4211b9a876938a439470cde13a',
+        'integrity_16.png' => 'e6ff53bf268d48088c085fb3d3e1f010',
+        'integrity_32.png' => '82a32c32fad17965fcb6ab955b8f15b9',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '4d5d13333a677d089aee630b8011b2d5',
+      ),
+      'admin_integrity_check.php' => '9b7d3100fff1fd1bd6103be11311a7b2',
+      'plugin.php' => 'b32f26e2fc819c93a60a0c53692888fa',
+    ),
+    'lastseen' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '847602620978795e90813a8ca2c2b2ec',
+      ),
+      'lastseen_menu.php' => '2f1a208abccccfe316824d1defe2c857',
+    ),
+    'links_page' => 
+    array (
+      'cat_images' => 
+      array (
+        'linkspage_16.png' => 'e0f7bd92f88b61dd38d82f952b3b1e98',
+      ),
+      'images' => 
+      array (
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'generic.png' => 'bb86189cad80d49fbfe203dbac657a65',
+        'linkspage_16.png' => 'e0f7bd92f88b61dd38d82f952b3b1e98',
+        'linkspage_32.png' => '720b47a8d0dfb2e4cb2646c6be8e34e2',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '7062f642f1078e1f5719f60d9eb96198',
+      ),
+      'link_images' => 
+      array (
+        'button.png' => '11a491739c3c8dba29d7e25e0b2ef50c',
+      ),
+      'search' => 
+      array (
+        'search_advanced.php' => '985406e38223116b67ffe4afa714f176',
+        'search_comments.php' => '6d3c5c4d9d15e0c0adf77b859a4c054b',
+        'search_parser.php' => 'ff43c05ffddd9ce508c98e913f90e167',
+      ),
+      'admin_linkspage_config.php' => '7cd921cba30519a67dae69b0d1445268',
+      'e_comment.php' => '2bcc48c36166376c34cbe480227d68ac',
+      'e_frontpage.php' => '0a352c2a0b559b9d930943f1928f9d45',
+      'e_latest.php' => '6ab452dd2d2d46749d5149c5fd1905fc',
+      'e_list.php' => '9a49a4d6a015fb3fff2cda7a4ef788c1',
+      'e_notify.php' => 'eab13b015f9b5fa679fef28f63d72dde',
+      'e_search.php' => '7a7416dde4bc42481cf92431f4832b65',
+      'e_status.php' => 'c4a657008b1d7ea49d0edef4440563d2',
+      'help.php' => 'a8495b50a8243ebbb3e37c8bcb169184',
+      'link_class.php' => '1a189cbaa50e47fe673e9b864eb82e72',
+      'link_defines.php' => '9253c337c31cdda4f08ec1bb67d714f3',
+      'link_menu.php' => '20fd34d3e851223a174d56533dbb83a6',
+      'link_shortcodes.php' => 'c8a987b6a8349e27a021fb93acedc011',
+      'links.php' => 'f3f6daa320bdf1c03e08193e1964ac27',
+      'links_page_sql.php' => 'ebe16a35037a69b93eaa929782ca66ba',
+      'links_template.php' => '8e668d23fab2e8c43d345d070523e272',
+      'plugin.php' => 'a6c6193e6a6bfe418b8357b34512a3f0',
+    ),
+    'linkwords' => 
+    array (
+      'images' => 
+      array (
+        'linkwords_16.png' => '938cd3261a4a86543de6949f66d2d53b',
+        'linkwords_32.png' => '83211d6305d2d1a4f0ae8ec7fc3e9ad5',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'ad0d4babe14fbc9317ba40e34833bd58',
+      ),
+      'admin_config.php' => '84e9d47d8301b15c0ea3e88c2d7b68dd',
+      'linkwords.php' => 'b17b3da7a73b2f57bdb8217b3e5de345',
+      'linkwords_sql.php' => '33f4d40e8da9aa758c512d4847f6d5d7',
+      'plugin.php' => 'b3aa51d59731aa11501a94e3eef99802',
+    ),
+    'list_new' => 
+    array (
+      'icon' => 
+      array (
+        'list_16.png' => 'a66abd8893e6183633d538bb7e77ee72',
+        'list_32.png' => 'f20fb66244bea4fd4f094a5d79afbbc1',
+      ),
+      'images' => 
+      array (
+        'icon1.gif' => '647fbd5e1ef767240f657eb6c9bf7eb0',
+        'icon10.gif' => 'f476f9f3348d5eaf6c8655d23107aec8',
+        'icon11.gif' => 'acfb3909d01491bbb4e6e70a5d253db7',
+        'icon2.gif' => '0f8cde50c8cf5dcf15ba92db83d823b2',
+        'icon3.gif' => '5c93b3bd203880e147a9cf424dbdfc00',
+        'icon4.gif' => 'd9322f3a64817417a3c31fd5127d0df7',
+        'icon5.gif' => 'dbd33636a4598cb6ae3745c3c12bb036',
+        'icon6.gif' => '7fa95c9ecb71ddd56d90d5a6c57c072a',
+        'icon7.gif' => '0a77dbb9a9297684d76896932c28a7b1',
+        'icon8.gif' => '6447987ad6456afdbb7058326c2b5278',
+        'icon9.gif' => '6681ae39445665dcf8781333888923de',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'c1fce345e4a870b8ad30e51c80ec2492',
+      ),
+      'section' => 
+      array (
+        'list_comment.php' => '0fcb53e6d7cc7c42ac8aab846bcb0814',
+        'list_download.php' => 'd0c7e07e3fe2372c7a8eda1562793b67',
+        'list_members.php' => 'e49b1b7cfad6246287a43e59f803cef3',
+        'list_news.php' => '7faa1d6728ff1e692aa834ac4027c4e0',
+      ),
+      'admin_list_config.php' => '9ec04080feb5ef1b47029bfb5b808704',
+      'list.php' => 'be28ee51d07fc0ce251bcf1790977c7b',
+      'list_class.php' => '4997e3eb0a75772dff50dd5b34edf071',
+      'list_new_menu.php' => 'b130b1aeb94b0c494dc77f6c58c7a19c',
+      'list_recent_menu.php' => '83c2f61863857d3ce02539a668e98083',
+      'list_shortcodes.php' => '1c4972d09e83f1945c6652126bba6248',
+      'list_template.php' => 'ca73750411b19f1b8df71c5111fe1789',
+      'plugin.php' => 'c39cfd9c145036b3cfbfca56aef150dc',
+    ),
+    'log' => 
+    array (
+      'images' => 
+      array (
+        'abrowse.png' => 'da9925bf3cee78bb965c668857bb7225',
+        'amaya.png' => '974a9fb5ae38e4d592aec302594ba58f',
+        'ant.png' => 'f667945ec89b7883922828deec0e2fd2',
+        'aol.png' => '5681ae48b5ab3fca312ade1b42658ee2',
+        'aol2.png' => '5681ae48b5ab3fca312ade1b42658ee2',
+        'avantbrowser.png' => '8dfcaaa62c0f5c07f4982f41bba18f50',
+        'avantgo.png' => '006c1eeda85c0dd975ca56ed75a86d56',
+        'aweb.png' => '1f4fd6be7682b4461b43768160f80746',
+        'bar.png' => '5e921e04974e7fd41cfc34167d31edba',
+        'beonex.png' => '2d5062958c73ad028233553d88c684b8',
+        'beos.png' => 'e81a347cde7806d403369acf5125c4fe',
+        'blazer.png' => '681d0c56db0d9eeec59e3b804dc809a8',
+        'camino.png' => 'bcf331c02452984bada0f73534e15578',
+        'chimera.png' => '6a6ad07a8495264fc00798ee298f3c04',
+        'columbus.png' => 'd24df5eebe796dddf95eb6630f1ce1d3',
+        'crazybrowser.png' => '96283b3c49fe550c35b96c595167670a',
+        'curl.png' => 'c17099e14ae52777d46079cb126349ea',
+        'deepnet.png' => 'a102b4c9f46ed88473190f8390d5ecde',
+        'dillo.png' => 'a95459dde056b7de5965f5c1b984847b',
+        'doris.png' => '0cde70660e8558aee3fd73ee9084f3cc',
+        'epiphany.png' => 'edafb77862629ee99b06478d34689a61',
+        'explorer.png' => '12663e51f35919fb31645ec6248230e4',
+        'firebird.png' => 'e8481a441fb3bcd623b6ca7143443659',
+        'firefox.png' => '7622da97e8ea3a9821a90e1f73aaf851',
+        'freebsd.png' => '836fab28d495b801df8639da8cc13da7',
+        'galeon.png' => '072543cf994aa44a868d24867df80de6',
+        'html.png' => 'caa46c5b4aa1bf948a96dcb4c3c6611b',
+        'ibrowse.png' => '8a94505f697ef87b353c5c6a56f54995',
+        'icab.png' => 'd2d3147c69fca0071ff631900194d8e5',
+        'ice.png' => 'c0a72eb1937576484240f94826a76e67',
+        'isilox.png' => '677a40b0372f3a0b18f62a4793e8d820',
+        'k-meleon.png' => '9ecbc0649045f8dc5115dfea2530adab',
+        'konqueror.png' => '46b06a0ffb9ecbe6606bca51d98a9211',
+        'links.png' => 'c47c6dd145554280f3e29323cbe34341',
+        'linux.png' => '336a3e40452886a7bfac345e8a261138',
+        'logo.png' => '8802e7deba7c6f03110b1541d775feeb',
+        'lotus.png' => 'b9c3348d5ce4d2c4a6065a2229af74c8',
+        'lunascape.png' => 'cecc58426c0c62aa6b7e09cde7c7bbe0',
+        'lynx.png' => '00fcf432cff7e70cc8ef9fc32182fca6',
+        'mac.png' => '3b5ceead951265dc1648d172fbdd6461',
+        'maxthon.png' => '30ee9e712f34cc7cd6f092313ac37fc5',
+        'mbrowser.png' => '491be57a6bcd67ee5a09f8b212fec39c',
+        'mosaic.png' => 'c276bc202f408caaeef5e763e4e2cb18',
+        'mozilla.png' => '0cb5578c00652e82053f81f94736ce58',
+        'mozilla2.png' => '0cb5578c00652e82053f81f94736ce58',
+        'multibrowser.png' => '3e41f9cabd8ca350a61e4adb6aeb52c4',
+        'nautilus.png' => 'daa1ff10ec0a1d85b77db4a4a05a91c6',
+        'netbsd.png' => '0cc1da48e638ee3549a53c459a0beaf1',
+        'netcaptor.png' => '139a1211baca0b00447e64c657bb5161',
+        'netfront.png' => '3ea80a15dabb2e26888d6fb66a16500f',
+        'netpositive.png' => 'f3bf2146aa97c9821ce096f5d38d9ee5',
+        'netscape.png' => '4dda4c2e4c32cc5f1e7cdb5b56156f5c',
+        'netscape2.png' => '4dda4c2e4c32cc5f1e7cdb5b56156f5c',
+        'omniweb.png' => '6b1d71fb7d85a3a5739bf33fa7646031',
+        'openbsd.png' => '36a1043bb8aacd3ea0a85c5f4de3130a',
+        'opera.png' => '8892071cd4ecb31298ec08373d1491dc',
+        'oregano.png' => '50798ac094e34694cd75a1ebe7813689',
+        'phaseout.png' => '5b6c84b85f576c2145dd4944f8b6188a',
+        'phoenix.png' => 'a9544236943de787c6a7e03d47a23424',
+        'proxomitron.png' => 'ad3be5d996043b5ebe5ab619dd2545d3',
+        'remove.png' => '313b424965c1b13451212a2e2817b658',
+        'robot.png' => '467598649618f8a635235011cee3650f',
+        'safari.png' => 'ee7ab5a70f4d927a753756b1d3ec2863',
+        'screen.png' => '64bb3f0780b2fd8ac7ed1ccc07329c38',
+        'shiira.png' => '98568764150bfe30b8b14d9cfdca374f',
+        'sleipnir.png' => '93aba37fc79e5f2459821b3fdffb2f8b',
+        'slimbrowser.png' => 'dd18ad6de3ed12aaca4a495a8663343d',
+        'spiders.png' => '40fe2edf5a3654abbaf364559ffaa62c',
+        'staroffice.png' => '9df8b5abfefb57238799b1a15b6e32d9',
+        'stats_16.png' => '4483cdd34566efe12872d9622f10499e',
+        'stats_32.png' => 'feb2eeda7244d0d78bc635daa7ac4c4f',
+        'sunos.png' => '5cce74b569193c10dfa03b2c8b292268',
+        'sunrise.png' => 'e0ef33096f7b1bef35972c9da07124fe',
+        'unix.png' => '3adfb8b111bb64bb8c01a1b8e7d1fee0',
+        'unknown.png' => '731a1804b991a36c584521a4508e62cc',
+        'unspecified.png' => '731a1804b991a36c584521a4508e62cc',
+        'voyager.png' => '0f977fc50e485153fe5908635de33d0b',
+        'w3m.png' => 'd1644f785735c7b82df2361ec9917eea',
+        'web%20indexing%20robot.png' => '467598649618f8a635235011cee3650f',
+        'webtv.png' => '37217cc2adf3e72c93fce1de22681c1d',
+        'windows.png' => '28190c1e6828a3bb5892e14c5d324a66',
+        'xiino.png' => '1067d1b475466744b562d1be8c7a462a',
+      ),
+      'languages' => 
+      array (
+        'admin' => 
+        array (
+          'English.php' => '21b9aaa282c9772189048a034ce8e42c',
+        ),
+        'English.php' => 'dc746d72b5cd2dde3243ad4b2b3d9caf',
+      ),
+      'logs' => 
+      array (
+        'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
+      ),
+      'admin_config.php' => '9b46de4271f0940015f4b82495104f98',
+      'consolidate.php' => '1a17455630a62ef78d2c14778845df31',
+      'log.php' => '5ae5383b4abb6273e4d2b45850559d52',
+      'log_sql.php' => '6593acd37950a8e486b0fc1490cf1750',
+      'log_update.php' => '619bea78d9c76a1ec0cd4c44eeda36c5',
+      'log_update_check.php' => 'f4e7f5fb3767e4c19adae8cb5e41e62c',
+      'loginfo.php' => '3b1282535cd35e446a9db66a3da29a7b',
+      'plugin.php' => 'b078f64e2aab381fb9f99a109dd96262',
+      'stats.php' => 'd4d9200b6df966437eb88aefc8a8e3c3',
+    ),
+    'login_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '8b3ce8f9ef0baac0b4d81d834bcc83d5',
+      ),
+      'config.php' => 'bdced7d579c121752bda7b68b49022a2',
+      'login_menu.php' => '1ec377498712d3c2b2da767e215dba4e',
+      'login_menu_shortcodes.php' => '1cf659be681675e4d139405b59de2b7b',
+      'login_menu_template.php' => '56bf9dfd36aa2da76027776e7125ab64',
+    ),
+    'newforumposts_main' => 
+    array (
+      'images' => 
+      array (
+        'logo.png' => '06cb23ecc9cd39141194e1016a771f80',
+        'new_forum_16.png' => '6f37a1029e4ffa1a22a65a07269c4a16',
+        'new_forum_32.png' => '8e92602725475253ed57ea7625b19bf2',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'cbabc36202b6ab51003f0b859fb14598',
+      ),
+      'admin_config.php' => '965609648b5052dad40742d8c76b8bf9',
+      'newforumposts_main.php' => '7e3931f2c26d033a621d2d7ad770eb69',
+      'plugin.php' => '81caf517e35d6fdb13bf56fb6ab5395e',
+    ),
+    'newsfeed' => 
+    array (
+      'images' => 
+      array (
+        'newsfeed_16.png' => '854bc5f8ddf61c6dfbe6c32e7bb7c0d1',
+        'newsfeed_32.png' => '6ff097b991a0c24947a29c16433abfdd',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '9bd834a3fad91903509381a6c85e12cc',
+        'English_frontpage.php' => '6bdb1ac20906e1242f6aacc5981325ff',
+      ),
+      'templates' => 
+      array (
+        'newsfeed_menu_template.php' => 'd8ce31013be1888f7967c071b38eb115',
+        'newsfeed_template.php' => '98c73f35ef45e68f9498fd8554dd1147',
+      ),
+      'admin_config.php' => '599f4a9b2a97d27b9a3b70a29a73d6b6',
+      'e_frontpage.php' => '2a8967b05bef4a2eb6b771ca44e6bf01',
+      'help.php' => '7942458e34eb69cdad92cc7d9454f626',
+      'newsfeed.php' => '6c6a2bb8c8988381928da7a4d891b649',
+      'newsfeed_functions.php' => '0057350da7e9bba58dff2ea9843d0287',
+      'newsfeed_menu.php' => '4ab274b2b3dde37f3807457aaeead9d9',
+      'plugin.php' => 'a69fc82ac1c09ad35a0d121b01c05d3c',
+    ),
+    'newsletter' => 
+    array (
+      'images' => 
+      array (
+        'nl_16.png' => '59f315b213118bf6051dc29acea8bb8e',
+        'nl_32.png' => 'f39c84dea17075e27e1c15411fc2b282',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '1671d084b90252937805e6b94e6b1e37',
+      ),
+      'admin_config.php' => '5136a3cfa9a048e04c0478d00c46a6e1',
+      'newsletter_menu.php' => 'f8b8ab30443dea6a8dbb2e27c17799d6',
+      'plugin.php' => 'fd9c93fff602ce118c68e4a0b675975e',
+    ),
+    'online_extended_menu' => 
+    array (
+      'images' => 
+      array (
+        'user.png' => 'ae648cc200000ccbb96c9e6c9049c5e2',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '80ef79863e369f62df51b9659551a432',
+      ),
+      'online_extended_menu.php' => '20780f809d85d39c90e0f6dd8cc8925d',
+    ),
+    'online_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '6761e97b84c471b871020a3416e9d689',
+      ),
+      'online_menu.php' => 'ba0b67252034c72c5a002aef708082bc',
+    ),
+    'other_news_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '5890f4b7958d49715dae9e89c59b16bc',
+      ),
+      'other_news2_menu.php' => '36297a52eaca7eee6dc5b8607fe5f218',
+      'other_news_menu.php' => '176fe1d7556fa0075ecad2aeefc96ddb',
+    ),
+    'pdf' => 
+    array (
+      'font' => 
+      array (
+        'makefont' => 
+        array (
+          'cp1250.map' => 'e100a417c3569cc2b7b8c1e976db4f14',
+          'cp1251.map' => '03af6a71a67c0a5a99e16af4bdf0889f',
+          'cp1252.map' => '2c892997d01d2138d800f5318bd76ad0',
+          'cp1253.map' => '169376db7929541ef8950dd888f53c9f',
+          'cp1254.map' => '6016c6d3a68c1d25696e64879b6527fc',
+          'cp1255.map' => '0359cc7d06098a20400118788c7e1468',
+          'cp1257.map' => '91b18d3c622bffa43003f38a60d15138',
+          'cp1258.map' => '2d92adf84aed86b29765234a77b312bb',
+          'cp874.map' => '3a3d272502dc21d4d12f3922633ca47f',
+          'iso-8859-1.map' => 'a0f13acbaa06faf3fe240e1c49b7616a',
+          'iso-8859-11.map' => '96aee891ad9f8c33f83b19c9b5fdadb2',
+          'iso-8859-15.map' => '3bd2a4bd4eb8130add17624e128e190c',
+          'iso-8859-16.map' => 'd1b40c31c1047d85881db30baee1f96b',
+          'iso-8859-2.map' => '098cf77f5a3c281af86dba50f5389f58',
+          'iso-8859-4.map' => '16c5ed9d616ffc407a560b3a92453f57',
+          'iso-8859-5.map' => 'b9d6ad1f178c189aadf370ac9fe308af',
+          'iso-8859-7.map' => 'bc6f9bdef50e1f802e5b17bd70b36d0d',
+          'iso-8859-9.map' => '4d8ddb1b69f39e44b88addd04269e684',
+          'koi8-r.map' => 'ed1be11b650e23bcf0804524d0299e73',
+          'koi8-u.map' => 'd445ee6c5ec5f2edd31fdc48724dd168',
+          'makefont.php' => 'fbb9fa5ebf6a81a45bb79549c742aa7b',
+        ),
+        'courier.php' => '16234bee90ef280e42cb167d1ba2c60e',
+        'helvetica.php' => '3dbdc93d4d688b45bfc6f4e49c45116e',
+        'helveticab.php' => '0e327a1ae8e5aaec1b28c5c366e14237',
+        'helveticabi.php' => 'f3d59db2e9426ac9e7f110705b07b7d7',
+        'helveticai.php' => '29a074a2a45c43a87630f46e22436b2c',
+        'symbol.php' => 'fd6c383c3cf14278d64b5cb1e8286890',
+        'times.php' => '1f954b34c3d40187b7a67b8dc4535c38',
+        'timesb.php' => 'd6197cb638addc463e2bc020fbf730a9',
+        'timesbi.php' => '1e77620e40e3e4bba0d29da4b10f55a8',
+        'timesi.php' => '9c92d3693094e7c46cfb6c6416369971',
+        'zapfdingbats.php' => 'f4f9f7de4fc64851280d29dfafc868d1',
+      ),
+      'images' => 
+      array (
+        'pdf_16.png' => 'f79c40d961e1125010f572634fa61f8b',
+        'pdf_32.png' => '7815b3da903470812856fe16cd53bc97',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'dfc41b4931191121f06c8909e8e3af53',
+      ),
+      'admin_pdf_config.php' => 'ab75370cbef1f9e7d32448717071eb82',
+      'e107pdf.php' => '020697c91fa842a1c72323985623181f',
+      'fpdf.css' => '35c07d5049ac6e55b8ab473c6dc38bf0',
+      'fpdf.php' => '47653b1a92f6a51cec644abc9b267bdc',
+      'pdf.php' => '9c05a56fbb296b60cddcfc68ec1ae2c3',
+      'pdf.sc' => 'feb9fda2bb21ee8b72d6b5fd045ab356',
+      'plugin.php' => '7a758641685eaf8de5fd14e3385e6f64',
+      'ufpdf.php' => 'fe9444d6d9c0553bd06fc1904b0df484',
+    ),
+    'pm' => 
+    array (
+      'attachments' => 
+      array (
+        'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      ),
+      'images' => 
+      array (
+        'attach.png' => '7b07df07c819ccf0c007e2753b026e6f',
+        'mail_block.png' => '4c23d4b896e42753bfaeeb934e1a7e21',
+        'mail_delete.png' => '6999f9a797e624857e12f875981fee8c',
+        'mail_get.png' => 'f5405868a5064a382ebda5dde8eaa633',
+        'mail_send.png' => 'ac54828ad23a1e10bc84330f0b754a12',
+        'mail_unblock.png' => 'b949c53a1ce63cc57f47d3335ea0468f',
+        'newpm.gif' => '4d16f5fbaa8e76067053c8c901972bc4',
+        'pm.png' => '1adf028fe9c30aa21008b1c7dbc94243',
+        'pvt_message_16.png' => 'd327402ad98c005569023d691458c83d',
+        'pvt_message_32.png' => 'c466117afa172593078f2aae10394306',
+        'read.png' => 'c7bacd62b460d2d05c210030c8733420',
+        'unread.png' => 'ad2e1da81983bb1bf0c1aeb310cd9c17',
+      ),
+      'languages' => 
+      array (
+        'admin' => 
+        array (
+          'English.php' => '1b7b30cf6f6f37cd486080d443968681',
+        ),
+        'English.php' => '30316cc6623a23e9d8924df12a3fadc9',
+      ),
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'plugin.php' => '420c66e5b14350e4266d4b3bc3134351',
+      'pm.php' => '191c8d269bb74b874edd10328e66022f',
+      'pm_class.php' => 'd74691f6a8f4bd3c8ecde30f101dba34',
+      'pm_conf.php' => '13912c612cdc884e63b8250af55afba5',
+      'pm_default.php' => '0213fb9bcfe60d37041f44136727649b',
+      'pm_func.php' => '4b9c0a299c8995c1e6f6aab4071d2e17',
+      'pm_notes.txt' => 'df26332907da1f35c4731d8893aea23e',
+      'pm_shortcodes.php' => 'c1860111454f0f7b20cfe1f924dae6d8',
+      'pm_sql.php' => '4608486c1027c6485dc32674fd536dc5',
+      'pm_template.php' => '028c374fb710251ec1c89fd330e8a7ca',
+      'pm_update.php' => 'e66fc6610e273471a212471e07598710',
+      'pm_update_check.php' => '2526f786f725ebfe8cdb56cf1131f6ab',
+      'private_msg_menu.php' => '0c578297b1fba71b7df890736106f948',
+      'sendpm.sc' => '8e2ef687982946d62df06bf6e9bdbc24',
+    ),
+    'poll' => 
+    array (
+      'images' => 
+      array (
+        'bar.png' => '37d6b48106f4cdde2f549720dfd0cf79',
+        'barl.png' => '11f7a33d11a71e4dc52254ac6dd831ed',
+        'barr.png' => '117b5de6bc7c859de48974d01887d738',
+        'polls_16.png' => 'dfa11ad7ecf088f5bc50152e3c8318de',
+        'polls_32.png' => '7c98815961fc0215e8bd38aef5e1c295',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '4a4c71f7d7f191a4a3dca3cf30760e71',
+      ),
+      'search' => 
+      array (
+        'search_comments.php' => 'cc9ad502cfe9c867ad4b3ff07e6cd019',
+      ),
+      'templates' => 
+      array (
+        'poll_template.php' => '0c83f7e4984e9a0b8bbc196262cc650f',
+      ),
+      'admin_config.php' => 'e6a30e94dc6599fd613d8d735f40cdb3',
+      'oldpolls.php' => '6ab0c3a5db0d610871d817961ccf912c',
+      'plugin.php' => '7ac72ca7cbdd5a98c0c24c82d619e2d9',
+      'poll_class.php' => 'be869a1960ca9cad5e9714f4b6a8811f',
+      'poll_menu.php' => 'b2e1d5b8d5e8cacf51e2724446b663c1',
+      'poll_sql.php' => 'ffe53748dbd1504f7c4204027814064a',
+    ),
+    'powered_by_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '7621008ce0b6bc9caec82f57210e2a3a',
+      ),
+      'powered_by_menu.php' => '030115b6ab06ef38b31510aec2b11ee3',
+    ),
+    'rss_menu' => 
+    array (
+      'images' => 
+      array (
+        'rss1.png' => '5fa63dbd2d0cac4472af83b4b186cb09',
+        'rss2.png' => '73f3385736d36114861d65455af1214b',
+        'rss3.png' => '07b629221a68764c1360d393a710c7aa',
+        'rss_16.png' => '276d6e7671548aea71f2c64b026d731f',
+        'rss_32.png' => '22602a166d61764a13184506dd75ea6c',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'ebd34b4c6be6dd405786c595b158a18b',
+      ),
+      'admin_prefs.php' => 'afd5b10a0c926ed474ee1bd8bf0f4e10',
+      'plugin.php' => '1f1ed2696ae847765888cc70d3614c6e',
+      'rss.php' => '4846b455c7851adfa620dc05ae97ca4f',
+      'rss_menu.php' => 'c39c5e0a4d9e1420782fe9650a23d3a3',
+      'rss_meta.php' => '7205d95791b223ce785e95b0fda76c5a',
+    ),
+    'search_menu' => 
+    array (
+      'images' => 
+      array (
+        'search.png' => 'f1f617ae57346558eefce7d0b79b71c2',
+        'search_32.png' => 'e0035406d30341e044c130ec0543a6c0',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '091e3795b604b11354ad70dfc36ada65',
+      ),
+      'search_menu.php' => '7f656b728eb7b34a48043bda3b35d29f',
+    ),
+    'sitebutton_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => 'fdae05c8659df7d21edf91d0bd8aaa9d',
+      ),
+      'sitebutton_menu.php' => 'a798130948fa4626a4a576f34c71ebf3',
+    ),
+    'trackback' => 
+    array (
+      'images' => 
+      array (
+        'trackback_16.png' => '9092b95903c88570dab202d2a5892ca2',
+        'trackback_32.png' => '323e78071fe7dc88aa05034102403456',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'e482c4c1b04b71a713e8aa21cb4b047c',
+      ),
+      'admin_config.php' => 'b020a0ddacd2841fb6a8e889268e7f57',
+      'modtrackback.php' => 'ee7b186252eab10501c7335b2498bdb8',
+      'plugin.php' => '1308c99c366c05e641fc1a262a72d9fb',
+      'trackback.php' => '68d35830a04bc5283cf0ab718b3ee2f2',
+      'trackbackClass.php' => '40cf1ea472926781f7ce51d0a9653f6e',
+    ),
+    'tree_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => 'be4478e772ee1e1189a57284891582d8',
+      ),
+      'config.php' => 'a78276d858ff5dcaf1980939ea0d9578',
+      'tree_menu.php' => '37933c884c7c6bef71e016e58080cfb4',
+    ),
+    'userlanguage_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '11eb945ea792024fc2ecd881d77781d7',
+      ),
+      'userlanguage_menu.php' => '86492340899ebf9da2fd44250544814a',
+    ),
+    'usertheme_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => 'a4163beed74433ec6657b9cbbba50846',
+      ),
+      'usertheme_menu.php' => 'ee312586d8f026d46e72704b913ccf85',
+    ),
+    'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+  ),
+  $coredir['themes'] => 
+  array (
+    'crahan' => 
+    array (
+      'images' => 
+      array (
+        'bullet2.gif' => '0f846116f7143e8f997f9175ea93168f',
+        'logo1.png' => 'c21ccdf73de64f318dbcb45ed048d585',
+        'logo2.png' => '422b66f0e312417fc5a9647d18b5cd6a',
+        'logo3.png' => '2e8eff0aa8a1c924bf0134e9ba6047ec',
+        'logo4.png' => '8f189548b4f02543a138e9bf0314d9f1',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '5634193f9c40908e7753db6c3b557c37',
+      ),
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'preview.jpg' => 'b841409838526ba769866861bf236100',
+      'style.css' => 'ff3671e52046bb41ae4a7587f86bce09',
+      'theme.php' => '9f63c8aa0ff3f0e6ab07c89a8bb7bd08',
+    ),
+    'e107v4a' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc',
+        'bar.png' => 'e63a0d8adeca917fd487bee6634b0d54',
+        'barl.png' => '4559714c78a2ea8591505123897d528c',
+        'barr.png' => '283538272ee7de8888ddaccec7d0cf93',
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'bottom.png' => '6500994715b4d988e604fdb8cc592562',
+        'bottomleft.png' => '40d167ca546bec754489f2ed4825fe2c',
+        'bottomright.png' => '15c1d7e34d52549c285586ae5e03892c',
+        'bullet2.gif' => '5fea13d481fc903ce05bfed57341e1c1',
+        'bullet3.png' => 'ffd6c250377d22660e9045d5d97705de',
+        'button.png' => '69918234a9caea763d1c66781e50fe34',
+        'button2.png' => 'a0aea9a2dd8889f65f48a0621eb91d2c',
+        'button3.png' => 'd2fcad5cfabc21b2f204b1a5d7229e55',
+        'cap1.png' => '01271e8d5f2f5770bccc7dca903339f1',
+        'capdark.png' => '968732d5e5ddfa288f59af2c47f5d4d7',
+        'capleft.png' => '3beb236cb19fce601ebb3ac45f9e389f',
+        'caplight.png' => '8e6f1d6155da88c011f33ca4784b6989',
+        'capright.png' => 'a83ca3941c8a447f19b51ad89ecfc72a',
+        'captransition.png' => '27e1c09ff88834b2ea140fa4a3f974f2',
+        'fcap.png' => 'fbb6a2f0fb0b7f474812f622dc5423cb',
+        'fcap2.png' => 'df4f0cd94d3949340f9926da33a3b253',
+        'header.png' => 'f486dfa869b0cdf39445ea02d120a68e',
+        'left.png' => '38d094baede7ab50c1f6696a21f222ae',
+        'logo.png' => '8dd271371d50ac36b2a501297e0e8c73',
+        'nforumcaption.png' => '382fc538b165c4228dc1ac962bcccc1c',
+        'nforumcaption2.png' => 'd5095a41f9669de31650e2b397119e29',
+        'right.png' => '22025f8d78f4419f9ee92d9f88a34cef',
+        'search.png' => '088a3d0166f6683ea9586cdce438f8ef',
+        'temp.png' => '443805d6f488cd2669027b443f860483',
+        'top.png' => 'cd6994bb0a6a40ab5bb19edc86668d6e',
+        'topleft.png' => '37a08fb25f85cb85bbb9dca682fb9870',
+        'topright.png' => 'be43c8d3237cc599524fd5100a719057',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '267a4652945d08b0a14d421c47d7cdf8',
+      ),
+      'forum_template.php' => 'b8dcce313578bd6e6758197dc6ee3afe',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'newsfeed_template.php' => 'bf35ae0a44194fb397c9816bd81c7522',
+      'preview.jpg' => '1f1e5815a674ceb1eaa562caa0e23607',
+      'style.css' => 'e9eb572ab4b66385ec2159cbac077106',
+      'theme.php' => '3ed1133c8d03685d339b5309fd827a1d',
+    ),
+    'human_condition' => 
+    array (
+      'images' => 
+      array (
+        'bg.png' => 'e6015f86e49dee0db753301c1e7b3966',
+        'bullet.png' => 'd96af312cdc074075a4e5fb559dac73b',
+        'bullet2.gif' => '9d376a8d449bec3df0d1086127799a6f',
+        'bullet2.png' => 'fad8045a7696954f7435c33bfd435811',
+        'comment.png' => 'f227913f7b341d5a696606d5a5f7baf9',
+        'footer.png' => '5fbba976e98c785c98b10aa2b2fe8e99',
+        'header.png' => '3da9f377741904abbcd94ff63a011e78',
+        'titlebar.png' => '9d7e299f83e2814fccd253d2f7b8ea04',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'e9de51bdb55910fdc36ebcf96dd86396',
+      ),
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'newforumpost.php' => '6a9cd60b76c00cd41384f21ce1265860',
+      'preview.jpg' => '37766edab6519ba0d82d89d0fad9b9df',
+      'style.css' => '121792fc537bb506c2052971de1e1dde',
+      'theme.php' => 'e7f8584099975bafbd28c2f8683de37b',
+    ),
+    'interfectus' => 
+    array (
+      'images' => 
+      array (
+        'background.jpg' => '9d2f41c5d82966332cb6438109160d2c',
+        'bar.png' => 'b67fed22a0eb45e8f98f34513b5ccf46',
+        'barl.png' => 'f89ad6313d8b53becafe22598ae74472',
+        'barr.png' => '0a5849424599a8533be5089ef74d286f',
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'bottomcol.png' => '78c5741f54dfec40c82f641045a92ad9',
+        'bottomleftcol.png' => '03a6d3ec5e14fdf7e478356ba92c955f',
+        'bottomrightcol.png' => 'c2bd7c6b693370833043eef967647829',
+        'bullet1.gif' => '029a9d7164bb4ed6a8be279af02bcb20',
+        'bullet2.gif' => '23c11ebc20e7c45ef75920ae2cfea93e',
+        'button.png' => 'e3f712ad4329ff235174499c2bb64a9d',
+        'cap1.png' => 'ab7deb73123e7f49b1304b0a6b787a8e',
+        'caption.png' => '16f3fb712fc7f9fd498233b6d1d2c56d',
+        'fcap.png' => 'c4a6f800c5ad92d7690d6ef6d33257e9',
+        'fcap2.png' => 'e6261197a46d0ba830b74bac1dbc14c6',
+        'footer.png' => 'c652160dd5fdfc9f4d50508c2ca6ad82',
+        'header.png' => '9bbef79c069270f41c14c7abaa300f68',
+        'leftcol.png' => '028354997e0d91ec6b808f51b4e2d056',
+        'link1.png' => '01c1e8458cd7bab11c832763fcbbbb23',
+        'link2.png' => '73d622e9782c81667528e6244603f832',
+        'menubottom.png' => '56cf53e0f327058a113e8e23610badee',
+        'menubottom2.png' => '6d9773d2afe504030b13627d7fd4d7de',
+        'menutop.png' => '6010f91e233a5898d758db3eafb23a68',
+        'menutop2.png' => '86c8a40fe7738475c143da269138c22f',
+        'pagefooter.png' => 'cef4949afdbdab08dbbdf5a7e6db0643',
+        'pageheader.png' => '916bb72001e7de90e00fb7a812e9438a',
+        'rightcol.png' => '6684d175a110688fca18a06d82c5bc25',
+        'search.png' => '0f9fa3188d15796337583ee1e1119769',
+        'topleftcol.png' => '8b11e9f5354e5d8c84e5aa70eed896b3',
+        'toprightcol.png' => 'aa0e7a7ed969629447669c6fd7ca827a',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'bcd2c57395cc693ee791c8cdc5a7e420',
+      ),
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'preview.jpg' => 'a4b48f473468c22cb5f03054eda08794',
+      'style.css' => 'a774157a11015d800fc0d09aaa83d71b',
+      'theme.php' => '1f15d7afdfee8ca33bd2667085cee2bc',
+    ),
+    'jayya' => 
+    array (
+      'forum' => 
+      array (
+        'admin.png' => '64ebd91cca24b185ac81a05ddbd790eb',
+        'admin_delete.png' => '68567d088171dc9800c75e3717d01551',
+        'admin_edit.png' => 'a89466d56dbaae7d8bde1330e3714807',
+        'admin_lock.png' => '228e1b606811f415c253e851f779fea1',
+        'admin_move.png' => '7ec6991055150d10f3d61b0c4fc18527',
+        'admin_stick.png' => 'c3e003b6f1873284eae24ac8e8997983',
+        'admin_unlock.png' => '184c7a4c28517e01f3fda3c77f4c5d01',
+        'admin_unstick.png' => '87309a3d62a49f3432888c79ece6fb5e',
+        'announce.png' => 'eff175ae24b46fb0ee49a34cc6ca9e1e',
+        'closed_small.png' => '228e1b606811f415c253e851f779fea1',
+        'delete.png' => '7c20906029cbc1fc0c7c64d26d2868e2',
+        'e.png' => '6c335c5d89cc241296a45eddb888ee95',
+        'edit.png' => 'c762eaed37cf8d4a4ff68cdfcb5099a8',
+        'email.png' => 'e6c3d37c6a4c39b9330ca3bd7e9bcffa',
+        'fcap.png' => '20137d499eb7e57064231cc4bc910dd4',
+        'fcap2.png' => '0a733fe6e51713f13276eec753da2d9c',
+        'fcap2orig.png' => '5f6f45697bc185d51f2c06d904642aad',
+        'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9',
+        'forum_icons_template.php' => '7b54f527b4da7200128d6e1e33918080',
+        'main_admin.png' => '4033115a6d4c622f16e23c7d82bc1bd9',
+        'moderator.png' => 'd3100a24d0bf141c8d3e5445d24b712a',
+        'new.png' => 'f80e5840a07b08c9502af386b9c6c928',
+        'new_popular.gif' => '9b92a52b897b1730793c4a975dd0edbf',
+        'new_small.png' => '5197b92d879fd774e87cf9ee26694498',
+        'newthread.png' => 'abfdbdcaa23bd33fdbd11f2f59c8e4c2',
+        'nonew.png' => '4113a87c52860c4e131e919b0f8f0193',
+        'nonew_popular.gif' => '9aa9a7418692e5cd1dd05026f577f984',
+        'nonew_small.png' => '36e801e40256dae69c5f864a60555a22',
+        'post.png' => 'c16dff0c96b789a40f1eb46c96291960',
+        'profile.png' => 'df45fd4fc914d95c3e17b5929e4cd44d',
+        'quote.png' => '33afa118321e687fb74b13c82d8ff04c',
+        'reply.png' => '2b3fe53b428e0449dcf7ac886e309a62',
+        'report.png' => '48eb0e1fd95db4c11441f058a9f45254',
+        'sticky.png' => '4ddcd806ceeccb602772e668a42fc500',
+        'stickyclosed.png' => '79cb1b7e7a1ae3f9d42cf3ec4bf57fc3',
+        'website.png' => '7fba90ad852e9ddcf968eedc7f49a39f',
+      ),
+      'images' => 
+      array (
+        'arrow.png' => '38b69b179e7cdf232aa367a0dc3c4cbd',
+        'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc',
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'bullet2.gif' => 'f46acab251856c2c2e03dbba9ed2e469',
+        'button.png' => '6ea310ffec2a7d4cdc2e76e0fcae2445',
+        'buttonover.png' => 'c76d73539fef2b9d72506583908cfb36',
+        'comments_16.png' => 'ada4e49b53f9732e0020f8f917125e16',
+        'computer.jpg' => '424fa719231f821ffeb6b26f6d8553ff',
+        'computer_pepper.jpg' => 'cdc1fe5c604b577faa4999a53a909f9d',
+        'email_16.png' => '90866c1f54ed36c131038d2fc0851ac8',
+        'on.png' => '34679051e7603ef4f91674e310fbd628',
+        'polls.png' => '2b352ea3b2c392dcc1c6551d1c1b3920',
+        'postedby_16.png' => 'bbc0eb1411a21d970b3f3c9855e516af',
+        'print_16.png' => '574a45049daf40bb348ba6252a1e435c',
+        's_body.png' => '7ba1f7cae60c29f12b290a1306df3281',
+        's_body_.png' => '7ba1f7cae60c29f12b290a1306df3281',
+        's_left_bevel.png' => '8568f929ef599f3116c49491f8893e90',
+        's_left_bevel_.png' => '8d43f9f9c6b647e654e181ad510721f1',
+        's_left_cap.png' => 'b6b3e6544925566237f0f357c7345bfb',
+        's_left_cap_.png' => '1bc0b1738662ed120e97cf2afb0d3d8c',
+        's_main_cap.png' => 'dfda87c00cfc0b6c3540c3666c8f4b51',
+        's_main_cap_.png' => '4061f78621a6fe3b65aeb6fc64faf84a',
+        's_nav.png' => '0ef5452590a980bb30cd463c0c6f4a8f',
+        's_nav_.png' => '0ef5452590a980bb30cd463c0c6f4a8f',
+        'screen.png' => 'd44a65d37f39fd788992214e3a4cbe84',
+        'top_mid_back.jpg' => '1afb134a1f0da2309319bc6f662d155f',
+        'top_mid_back_pepper.jpg' => 'cdc1fe5c604b577faa4999a53a909f9d',
+        'top_right_back.jpg' => '44d2f4803a1d902a0cebf289c9598857',
+        'top_right_back_pepper.png' => 'd44a65d37f39fd788992214e3a4cbe84',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'd2768e8d07f3502047dd7f8cd8009384',
+      ),
+      'admin_template.php' => 'd6f29a8b467c95c18c01db69c1be9867',
+      'canvas.css' => 'fd4de0683d26b402b9489e3040a6c882',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'nav_menu.css' => 'ac9d2df99166eb5ce87c16bb146bc413',
+      'pepper.css' => 'eb6efc98f6d354d1a9bd2b0fbc716f90',
+      'preview.jpg' => '1d775846dbe1b7ea66065fc0eac72eaa',
+      'style.css' => 'a9fbf9295f9c6b07b7ea7032a00d9ccd',
+      'theme.php' => 'a31293384ae5f8d18f15297765c6aaf9',
+    ),
+    'khatru' => 
+    array (
+      'images' => 
+      array (
+        'background.png' => 'ce934d43f3fd71ee27d26b135457f6f6',
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'bottom.png' => '6b249ab3e679d5bd3dd39768683f9d60',
+        'bottomleft.png' => 'e413385707e6a7d1e16229cfa49fe231',
+        'bottomright.png' => '8bf0be6aaa09fce54811e2879e137873',
+        'bullet.png' => '08eed4002e3d9fbf8f71d47c62a0fcfd',
+        'bullet2.gif' => '1ec22e77515023bd344efeef8d827747',
+        'button.png' => '62c64b41d5ad1a53fe6e23a2cf486b85',
+        'icon.png' => '53e431306fb2e33a5ed3df6750933285',
+        'left.png' => 'df5d30abe11aa5bf81d00fe5f16a9d31',
+        'logo1.png' => '2d754a5f6ed77a9c5b58d5ca6d381fa4',
+        'logo2.png' => 'de1b45f1e69c5d1874ee2fcde18e6073',
+        'logo3.png' => '91c059d925a2825e0010a4cc2d5189bd',
+        'menubg.png' => '1255daf004f8842b41e4f5e01e167c75',
+        'menubg2.png' => '68f34e41e6334f70b6f14ed397c3df67',
+        'nforumcaption.png' => '02cc27a5df2d68a063c5b2c8f4c42454',
+        'nforumcaption2.png' => '1d62d20a5c0acbfd2211f2e8519c7fea',
+        'right.png' => 'f29d08d4bf94b7e8946c09443004c77c',
+        'top.png' => '5922796553902b607cca12e9a04b5f8b',
+        'top2.png' => '9c11cc9f67cf21144e2c386fdc0b38d2',
+        'topleft.png' => '4b41f3bed350f3b72de850a0c6f1d7ce',
+        'topleft2.png' => '0dd4664012701da19679b020a916cf27',
+        'topright.png' => 'f2b03fb32176cc7c067b411992d02d02',
+        'topright2.png' => '7b6d4344421aad96d620a25a250d6f50',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '66e19fa68eda6e34636ff907c328bb9e',
+      ),
+      'download_template.php' => 'a9742a3e65ac83e279cabee1e1e50fb6',
+      'forum_post_template.php' => '078471273797b4364959b37090ee2069',
+      'forum_posted_template.php' => '66bb8c27404c12d7e784745685f1f398',
+      'forum_preview_template.php' => '4455c6b5e0991211db66dad466274bc0',
+      'forum_template.php' => '93227cac477be310f0e5a1f6b4a310e5',
+      'forum_viewforum_template.php' => '23b68de8f4d06ce6e22f281668d612d3',
+      'forum_viewtopic_template.php' => 'e26e8e97cbe85e2b248a221af5148537',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'newforumpost.php' => 'bd44d5240db6fb7af02138dd2499a8ef',
+      'news_template.php' => '0f5b689c4ad3d212934707f44b959b11',
+      'poll_template.php' => 'c01388206c3cf373ff04e01c38485d99',
+      'preview.png' => 'b164565b63d086a6a5a28fd76097487c',
+      'style.css' => 'b4a0c07b62ba5061e77027d8032c7416',
+      'theme.php' => '91a9e9dd2439516210c1f0b29437a9ed',
+    ),
+    'kubrick' => 
+    array (
+      'images' => 
+      array (
+        '01_linkbg1.gif' => 'f63772c2cc656495a6d7f65d2a754f5f',
+        '01_linkbg2.gif' => '3bd01b3f95a387963bfb0b1ab01b8d91',
+        'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc',
+        'bullet2.gif' => 'd1b6cacb4849b507dad138766ed3057f',
+        'kubrickbg.jpg' => 'ebc477e9f99d802b450616239317cfb9',
+        'kubrickbgcolor.jpg' => 'a5fc1c9484453bdcc6a0c8eaa1d99ed3',
+        'kubrickbgwide.jpg' => '1214890da2d47e7fcd149817021bdf04',
+        'kubrickfooter.jpg' => '84b95d2c16d25dfef12d3c31ba33cbe4',
+        'kubrickheader.jpg' => '29de9d7614370f301799cb340c1db703',
+        'tileage.jpg' => '3435eafbab94790d5f74cb801b645c0a',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '05890778f266bd0669aac13c92103ba8',
+      ),
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'preview.jpg' => 'cb94c52db72d1ba8bd4d1e08ee41cbfb',
+      'style.css' => '19b6b359a7c17e65ca52ad8264f63edb',
+      'theme.js' => '092a48b0a95fcb44c48236c40948eb13',
+      'theme.php' => '449b35c64b081ab7061a97daec5ae1c0',
+      'ul.sc' => '94dc33c24a82bbe2c357d4ac165d8c09',
+    ),
+    'lamb' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => '48958de1c195f2b5694643a2fe1f2db2',
+        'bg.png' => '6de8f72fdabaf5bf9fbd7cbed462ca68',
+        'bluearrow.png' => 'a2df5d6a0f485040f843786e7c606e27',
+        'bluearrow_greybg.png' => '0e9896ea0eb8c9eb4f01efdccd2f8a03',
+        'boxbottom.png' => '01847b0507171e644013b4bab4febc78',
+        'boxtop.png' => '607a50aed74c069befab870576de5868',
+        'bullet2.gif' => '0f846116f7143e8f997f9175ea93168f',
+        'button.png' => 'a8c0d55b31b31f36c1b1505651e0c5d0',
+        'comment.png' => '4515b0331b8a6cb20f92efeacf214a59',
+        'download.png' => '80f205604db6d451bf57a71166b6a804',
+        'email.png' => '04c8a3218d13cb28be418ee835cac34f',
+        'greyarrow.png' => 'dc96c19cd1ca4751040b1e88cae51c12',
+        'lboxbottom.png' => '9144b3e9b6c290ef7c4348ace98128d8',
+        'lboxtop.png' => '1676f64eaad673a63ae221d370bfcb1d',
+        'left.png' => 'b7eb6f1082d63fa13db0da677ccbfad5',
+        'link.png' => 'ddc7ad68de90d91f2d85d1c8bea8d358',
+        'logo.png' => '5a5fcab0cdd03024f4163b385afa32cb',
+        'logo_template.png' => '7cbeaf46b35c917ceaa378476a8938ed',
+        'logobg.png' => '13be74d210b6e82c561fcf299087b5fa',
+        'nforumcaption.png' => '02cc27a5df2d68a063c5b2c8f4c42454',
+        'nforumcaption2.png' => '2b4a342e0fe48adfddb8e058d67cb8ca',
+        'right.png' => '62054b67c23bbbd0f258fbe8ce23ab2d',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '22dbd47c4a9f41af9d1bf3cbce5e19c9',
+      ),
+      'alt_style.css' => 'e9ee5679b9218c1c7d89c98c2f95b701',
+      'alt_theme.php' => '09fc4de57c31e85eac390e643d401ed7',
+      'chat_template.php' => 'd22d28f3cae0b4e1acfad78faedcbee6',
+      'download_template.php' => 'b6e968dc3f6d17d161b0105b67ae2903',
+      'forum_post_template.php' => 'f0cf45b5dab2047d6029595c7716d947',
+      'forum_posted_template.php' => '56a97c40620ae669bca178f30ffdd044',
+      'forum_preview_template.php' => '2391640ab5380b18ac17e54a99feb29f',
+      'forum_template.php' => '8c5f8a4dedc4829aca2c4f418ac49ceb',
+      'forum_viewforum_template.php' => '4cdfeb489d50e1e90be0ac8a4af60cf0',
+      'forum_viewtopic_template.php' => 'e0d6f0a2678206fa4542ee3ec6459333',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'newforumpost.php' => '7ec9f0bb87045e10862dc2b7dcc9757d',
+      'news_template.php' => '0f5b689c4ad3d212934707f44b959b11',
+      'preview.jpg' => '184658c1d2222cd0137cc445fcc785ea',
+      'style.css' => '5699a694768747a25995d68f93a8157d',
+      'theme.php' => '6ca169bb182d7ef950c2b27ed88d28d2',
+    ),
+    'leaf' => 
+    array (
+      'fontstyles' => 
+      array (
+        'large.css' => '6428f461d0af5de2a5af1547e98b4590',
+        'medium.css' => '26ba7c74395c9c77f21a2345c2ed92b6',
+      ),
+      'images' => 
+      array (
+        '01_bg.gif' => '50f03651c070e4138c97a4a7ee9e5339',
+        '01_bodybg.jpg' => 'ca5f9a092c397986fa10d5990023ab25',
+        '01_font1.gif' => 'df5d2f07cf7e70371169f54c085435fa',
+        '01_font2.gif' => 'e9b455dd3cb7ecde36b321aebe977c47',
+        '01_font3.gif' => '8e9bb2d8d0b48f1cc64e519bb090ef6d',
+        '01_footer.jpg' => 'cf2f00b3e5a2aff05e70e728eb225cb4',
+        '01_hdot.gif' => '945bc76d6f25d2a32fafb0abe1933e1d',
+        '01_header01.jpg' => 'd41622f4fd90237ed438026896dadbc7',
+        '01_header02.jpg' => '3b01a113505d77d9103b8ad7ae490b0a',
+        '01_header03.jpg' => '2c25376dbaa1e2a038f8d46fedd5881f',
+        '01_header04.jpg' => 'dcff85a614aa8fbc68452d2795f5a2f4',
+        '01_item1.gif' => 'fd6e6c5768ada8f441cd1e80d3e61b8a',
+        '01_item2.gif' => 'a46a4994806a4c181310caa3e92e80c1',
+        '01_item3.gif' => '8dce3a9b0c43a0f8b6c9fa4b7500ec19',
+        '01_linkbg1.gif' => 'f63772c2cc656495a6d7f65d2a754f5f',
+        '01_linkbg2.gif' => '3bd01b3f95a387963bfb0b1ab01b8d91',
+        '01_logo.gif' => '06df534ab4f86845ce92257b6737b57a',
+        '01_m_comment.gif' => '27ac7a5eba1cbc30e793a013ac7c0c5d',
+        '01_m_default.gif' => '43b70b8bb69fed0f1ec499eb415dc234',
+        '01_m_news.gif' => '4521605dfa4313520323c28ea26f466d',
+        '01_mountaintop2.gif' => '034d9e56c10dd3579a7e371735b3075b',
+        '01_quote.gif' => '93174f052a4a478a633d57dd5d45e32c',
+        '01_s_about.gif' => '8d0f8698265a152a788fffa7184e681a',
+        '01_s_categories.gif' => 'a5dedac27cf2c1403b60e52fe4897016',
+        '01_s_chatbox.gif' => '493f3eb5cd5cb6655997a7e511e350c5',
+        '01_s_default.gif' => '68c19e8bb6615de2836ec827ab5a6675',
+        '01_s_latestcomment.gif' => '0b310e282c178c70e190f930ce199117',
+        '01_s_links.gif' => 'dc4858a967f948815f08acc3dceb33f4',
+        '01_s_login.gif' => '7f4e38303d5c571bb34660ffb60513e7',
+        '01_s_online.gif' => '1dcaf5db2305af2c315777f91c6fc828',
+        '01_s_search.gif' => '1bc719781f1d326651ad4733906d67a9',
+        'bullet2.gif' => '5d8d5d48a81b4a045de961a77413de18',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'cd1846d0d0b607f6f908465b475a7a9a',
+      ),
+      'bluehigh.ttf' => 'd3003ad3a5de2a785fbb898c89cf40ff',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'links.sc' => '1c6e88dbdfd1b502dfd20ee3fc6ca7f9',
+      'preview.png' => '804c22db1f71223d10e6f7b8b85f69a9',
+      'style.css' => 'cc5e05f85f73792b85870dd61150b1a5',
+      'theme.js' => '16285b5ba2631979457e5e2ec1cf10af',
+      'theme.php' => '28419a3fb6ab106102bd2a72edbd5439',
+      'ul.sc' => '8bc8330e914dbecdf87b56b536352ee3',
+    ),
+    'newsroom' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9',
+        'bullet2.gif' => '2ef6767f3a54a1e7c749421ef0ffad20',
+        'logo_bg.png' => '2a38a1ac257ff1d975e15a5169221fd8',
+        'logo_text.png' => 'a578be578c320aa365e9bf4ae07abe23',
+      ),
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'preview.jpg' => 'de22b398f66e271fdd908ac31f25e7e4',
+      'style.css' => '6811dfefba548ec3903bb2bd6c90778d',
+      'theme.php' => 'f26d6691460bf9433e872ab0ffeb5b9c',
+    ),
+    'reline' => 
+    array (
+      'images' => 
+      array (
+        'arrow.png' => '38b69b179e7cdf232aa367a0dc3c4cbd',
+        'bar.jpg' => '5afc27f5a70a68e53b1a51d74a40fbcc',
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'bullet2.gif' => 'b3baab02dac12534c559cb219422c2b3',
+        'button.png' => '6ea310ffec2a7d4cdc2e76e0fcae2445',
+        'buttonover.png' => 'c76d73539fef2b9d72506583908cfb36',
+        'comments_16.png' => 'ada4e49b53f9732e0020f8f917125e16',
+        'cube.png' => 'd3f6dd7ab8353b169403826534affb42',
+        'e_adminlogo.png' => 'ea8741ecbb591306740e29f420e324b9',
+        'e_logo.png' => 'c326c9fcad890ee3cf652b86b219d044',
+        'email_16.png' => '90866c1f54ed36c131038d2fc0851ac8',
+        'header.jpg' => '56fc3b2e5b74c3f3a111dbc462625c82',
+        'header.png' => '094cd7068dc557ce83b5205499ace920',
+        'loggedin.png' => '92edf005c8272484836b9f81e509b75a',
+        'logo.png' => 'c326c9fcad890ee3cf652b86b219d044',
+        'paperclip.png' => '7239a7df3faa4b0a77709b5f99dbbbf3',
+        'polls.png' => '2b352ea3b2c392dcc1c6551d1c1b3920',
+        'post_it_bottom.png' => '58bd6133cd5439ca03dabcf55a8d94f7',
+        'post_it_middle.png' => '2fabff36c04748927032e2d28bc3ccae',
+        'post_it_top.png' => 'c7caa215f5c456ab26cbf65d768d5568',
+        'postedby_16.png' => 'bbc0eb1411a21d970b3f3c9855e516af',
+        'print_16.png' => '574a45049daf40bb348ba6252a1e435c',
+        's_nav.png' => '0ef5452590a980bb30cd463c0c6f4a8f',
+        'search.png' => '5913e61a181f454a632998805524097d',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '3288884b05004a91af4802cb7e2098a2',
+      ),
+      'admin_style.css' => '7850d3c2db60fb1e649a6eb6201cfc11',
+      'admin_template.php' => '92c8ff5fde3790dbcfc895c52c7dc3d0',
+      'cube.sc' => 'f85e6d1f10ab3372ec7ebdb0548651ad',
+      'full_width.css' => 'f806f549c1200131c4c043db72408da7',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'preview.jpg' => '30da9e1ef04e5f1fef38ae3d23e0f3c4',
+      'style.css' => '579694fcaedd33d0025b75b286fe6214',
+      'theme.php' => '53cd5a558dd6329626b444ead97ec950',
+    ),
+    'sebes' => 
+    array (
+      'images' => 
+      array (
+        'arrow.png' => '26ea2f602e8ea98d2bedda29cb91c821',
+        'button.png' => 'b2ad00a38be298ac4fde8652fb26c8a8',
+        'fcaption.png' => '1cf687c703277456b26ea2aff99b3dce',
+        'forumheader.png' => 'ad4c1d57c875addbcb9b91c249c1400d',
+        'header.png' => '1dadfebcfa12467437c4fd9e02ccf34a',
+        'logo1.png' => '36dd9e17390cdca7ec3e8211df5e744c',
+        'logo1_template.png' => '5dc8493db503307b22ef2866b8bab58f',
+        'logo2.png' => '6c393b306658173bf9f65954aa059260',
+        'logo2_template.png' => '613631693ada2776add607af07ebb5d4',
+        'marrow.png' => 'c5e56a7c552347ba6a4c5f965c013828',
+        'oarrow.png' => '5e15f2f7b6a5e9ccea9583dc841dce8e',
+        'search.png' => '5d1c0bcd24277a60b6e5f13059d3ec4f',
+        'selarrow.png' => 'b8bd05491ab8b6796c01e9b8c54a7467',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '886394355713facf26c16e029a2b9d7b',
+      ),
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'preview.jpg' => 'a9e7139c84a52e4b164c460a6428b317',
+      'style.css' => '2e1a7f9d7c205613b11b958055561330',
+      'theme.php' => '9e888e822f698fbb187bd602ec3ca7c4',
+    ),
+    'templates' => 
+    array (
+      'admin_template.php' => '57aec9f3ef5be669eb7fd47b3635a1b1',
+      'banner_template.php' => 'ba1f7c11ae670d425f8e85075a8b6c02',
+      'comment_template.php' => '8259e0cce978fee71fe713761f9d1bde',
+      'contact_template.php' => '6906f85088051878a4cdd364065aedd6',
+      'content_template.php' => '4234fe2ce5e65e85d0597efc6ee68d5d',
+      'download_template.php' => 'da4896dcdf43994dd2b12ac91626ec45',
+      'email_template.php' => 'e1ca940e806770678e04b8d08466e988',
+      'footer_default.php' => '281f48b459b0513d552a7799bb1b4a88',
+      'fpw_template.php' => '75ed285375dea3c636bc63dc9a1d8c81',
+      'header_default.php' => '2e6913df824b6d6254bac8adbea58ff7',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'links_template.php' => '21d8747bb5c1d6d590a9ad0b0d26e576',
+      'login_template.php' => 'd77e3346f448b156b7ac9e7c0e8b68ac',
+      'membersonly_template.php' => '14635660ab8f2daed92f4260ed0f3fa1',
+      'online_template.php' => 'c883eb20ba65527ecebb94dd78e5d1c1',
+      'search_template.php' => '90fae4ad55e7adf7f711720f4ff7018e',
+      'signup_template.php' => 'ff1efc6462f9164ea681c8db870a3894',
+      'sitedown_template.php' => '39204ec2e30b0f9cb4bba9e2de59979c',
+      'trackback_template.php' => 'fd54d8c26c75f9d380e8ec90860b0107',
+      'user_template.php' => 'a74d87c3805ff751e40c00021c6ece3c',
+      'userposts_template.php' => '4491e3bfb4a8e9765f3c320d70b3da02',
+      'usersettings_template.php' => '0c3205a1e9a7e862268208e8125b4da0',
+    ),
+    'vekna_blue' => 
+    array (
+      'images' => 
+      array (
+        'bg.gif' => '00b62b8cd66526297fcb79d3229eaa8d',
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'bullet2.gif' => '206da1d113ffa22ef1cd732e43885a33',
+        'button.png' => 'd7b133daf7c18942c478780df09d177e',
+        'cap.gif' => 'c63589fcc69d3ad5b10e13e562ac8aa6',
+        'capleft.gif' => 'd4ff03746b118ec243f533208949f7e0',
+        'caption.png' => '2e9177b9f59bb6f6c6748475506d0689',
+        'fcap.png' => '450b53805e3dfaf9d999c2858c40aa60',
+        'line_bg.gif' => 'ab28e1dd152e681ff434f2f7cd9a1a5d',
+        'logo4.jpg' => 'db6d375e1ab289c531b5046ec4a54e10',
+        'menu.png' => '782886f2b16869bc4377c7d2ca745fe2',
+        'menu1.gif' => '9eede26903c3fe185aab6a221bd90659',
+        'menubottom.png' => '2f54898aac2a907a1a0c530ce1ae36aa',
+      ),
+      'languages' => 
+      array (
+        'English.php' => 'ec72bdf5070bdc80cc485e6e2b8ec3a3',
+      ),
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'nav_menu.css' => '74b91306b957f69bc390ed612df76ac9',
+      'preview.jpg' => 'fbb8bde5f9eb4f8efc39f85234959823',
+      'style.css' => '56807dc5973245b8b74394a299102782',
+      'theme.php' => '4e523e4af469271fbfbe5527b8ea859a',
+    ),
+    'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+  ),
+  'article.php' => '1029f6125156dd497347ea0329424268',
+  'backend.php' => '312552577f67c7965a76bda84b949a64',
+  'banner.php' => 'c00bf28d2ef3cfba73d62943c219db1b',
+  'class2.php' => 'f010ee203191a137b3e00be3723e703b',
+  'comment.php' => 'fc3814165cd3585ff8124e6fdd2ca6ac',
+  'contact.php' => 'da837e88412728160dd7a3a200d15537',
+  'content.php' => '10e6c1a9e2180598f8edd8f49022f26b',
+  'download.php' => '412ae71843a6c85cc73e071af4a294eb',
+  'e107.htaccess' => 'c5e1ad68b41f947be285926c0f81d914',
+  'e107_config.php' => 'd41d8cd98f00b204e9800998ecf8427e',
+  'email.php' => '1c0f6fe04644feee6b5d05ae3a21d48d',
+  'error.php' => 'f7601a38e787fd4d0e9fc1745bb7679a',
+  'favicon.ico' => '5fceb78b9124ddae4027396d7cfcd328',
+  'forum.php' => '3c10184d52685d7c9a6906a967b7e3d8',
+  'forum_viewforum.php' => '4b9fcc3a820ed2f93b4dc707c3ebe3b4',
+  'forum_viewtopic.php' => '5fea10d40850fd6f72cfbec7a328e120',
+  'fpw.php' => '56888864af1bdaf8924816dd0f950ef5',
+  'gsitemap.php' => '719d56aad6cb84cbf5ef7b0ead26bc3b',
+  'index.php' => 'b2b096b72f691ceb3f1cb2695412e80f',
+  'links.php' => 'bed206fc2abe8f1307ef4db3b7fee63e',
+  'login.php' => '3549f70df334efc247f46891a403880f',
+  'membersonly.php' => '0903a2ef48312a12ce81b2fa17fe0233',
+  'news.php' => '6b760eaca32527bd614e2bd400f2fe8c',
+  'online.php' => 'f3c435f4ffaf0a9367f45984c3fffb2e',
+  'page.php' => '98decc62c003045f74f9e208530d1328',
+  'print.php' => '25dd15b6c5931e305fcd19879459ce59',
+  'rate.php' => '19160ac5ab1600124219c2b61c9c4a12',
+  'request.php' => '94ee65454ddbf5d4844cfbe780a3f018',
+  'robots.txt' => '718c9c13913590073dd5cddefd161c0b',
+  'search.php' => '8e1a1ef208e260faa7b05d25fdd2d1b1',
+  'signup.php' => 'fdb66a6e88c2b80b96f56960855ef728',
+  'sitedown.php' => 'f38e86b03a6df3eefba443a2859e6ea3',
+  'subcontent.php' => '468072ef82e179b6ed5ff20a4eb36225',
+  'submitnews.php' => 'c087e3248c7a8f1da0db2477b821f1ce',
+  'top.php' => 'd10339ac845228c32a4a9017d5824de1',
+  'upload.php' => 'd9227038c27c3660b7e1f8e66c47c110',
+  'user.php' => 'aebe739c119cef9373e61ad7bdc8cbee',
+  'userposts.php' => 'c53a31db1cb416cea52bda83454b06bd',
+  'usersettings.php' => '6fb4bb566738d8197986a4548b74e2c6',
+);
+
+$deprecated_image = array (
+  $coredir['admin'] => 
+  array (
+    'help' => 
+    array (
+      'administrator.php' => '8d58e249f4c37c48ef3d0fb600db4c8f',
+      'article.php' => '5eaec68b84cbbcbb34f2d970bea1c0b3',
+      'banlist.php' => 'b841446435a2cb171968dafa9042444a',
+      'cache.php' => '32619118102a53828749f6f5198377bb',
+      'chatbox.php' => '64da6bf8536ba4a5f5fbdce91aef02ea',
+      'content.php' => '9acd47fab88f17202b907dda61977762',
+      'custommenu.php' => '23def1d72ae7dac360df9c3f710fdf55',
+      'download.php' => 'd48ddda1acd7a6efe0de0787d6988a20',
+      'downloads.php' => 'eb3a2a4d6c89ab2372d88c2999e8cd2a',
+      'emoticon.php' => 'a1e9636fd7af1573aa4ba481b9c313b3',
+      'filemanager.php' => '60c3a9f7c51c1c9d36c575508711f871',
+      'forum.php' => 'bf299e990db850f86cdbcd42b9b3fd9c',
+      'frontpage.php' => '3416ed1177991400b4aa82b10f91007d',
+      'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'link_category.php' => '4f3852c20f1ef019d22b5760b5e063ae',
+      'links.php' => '566b6088a236cb2c093b425ec9309d66',
+      'list_menu_conf.php' => '44e687a1ff5df331a63ad6a4892eeeab',
+      'log.php' => 'bdb15ca1b175923e93785220f7e5821c',
+      'menus.php' => 'e89bffe7bc21b21201a2d768561c473b',
+      'menus2.php' => 'ef44b977037e87afeb228279c78e3bb3',
+      'meta.php' => '29760d902f4aa3dfb3881842664940e7',
+      'news_category.php' => 'fc0954aaa4fff8f878641c4ad707f08a',
+      'newsfeed.php' => 'a13915c726c3b5dec2b8899c7422db81',
+      'newspost.php' => 'bb22746bfbbdfdd8d7e780105ef9e854',
+      'poll.php' => '041fc9b4489b9d467acbba15cbc5b2df',
+      'review.php' => 'cf0bf878836e63bb7f12bbd978c4d7f9',
+      'ugflag.php' => '309b077d78f56125ce2cbceb056e537f',
+      'updateadmin.php' => '2a51d30073923c6ca0128d63f71dae5a',
+      'userclass2.php' => 'a60b4f7f2c72660f46b34307bfdf39c2',
+      'users.php' => 'df0e3b9a6b200f37225fae370b5c198d',
+      'wmessage.php' => '6eb398815b8165d5ffef65fd42a7922a',
+    ),
+    'htmlarea' => 
+    array (
+      'images' => 
+      array (
+        'ed_about.gif' => '8892c7e4a559a6bb1b50e9009ddb1665',
+        'ed_align_center.gif' => 'f3c560b8cd085dd249e4632107ad5e02',
+        'ed_align_justify.gif' => 'e4fd3728dc374e0cfc24b07ea6be90fc',
+        'ed_align_left.gif' => '3301e69399d07346067114647bb3dc33',
+        'ed_align_right.gif' => '00950f054f71e69d9c30378e76bc12a2',
+        'ed_blank.gif' => 'ca710933239efd41bbf4d1a3231240f4',
+        'ed_charmap.gif' => 'cbdbb8c0c3a4ec3d285d1b45eaafd08b',
+        'ed_color_bg.gif' => 'cc74713d087b0d0a1200016a1e197100',
+        'ed_color_fg.gif' => '3640d2e5ca79aeebd72414c0b85fa3df',
+        'ed_copy.gif' => '684b277b164596eca2e53c750d8b5b04',
+        'ed_custom.gif' => '1ccd6155d74e1b19b4651994219a6615',
+        'ed_cut.gif' => '220ce8bbe529bf3a092a9643e936bdd7',
+        'ed_delete.gif' => '573745a746bf300916c73a19d0819ab2',
+        'ed_format_bold.gif' => '520b80446acc7ff6021574295e0b2a81',
+        'ed_format_italic.gif' => '944c91acc59d24f9769eca617ff9239d',
+        'ed_format_strike.gif' => '1ba752cc9729f54bd87efe636dca247b',
+        'ed_format_sub.gif' => 'f63ce7a2b86ffcf07dcbddc0aac9b9d7',
+        'ed_format_sup.gif' => '7d1ab42fd5003dc07c1a17d6eac514d5',
+        'ed_format_underline.gif' => '468b978544e8811fa3b0deef30741efd',
+        'ed_help.gif' => 'f652d29123b5a2f24d70d9da3c9dc653',
+        'ed_hr.gif' => 'ae6fa428e1f6cda1008a7f608825f6da',
+        'ed_html.gif' => '9b32f161406de6bae7884a3391798042',
+        'ed_image.gif' => '9a1f8c6fbcfb03efe900b90f41851792',
+        'ed_indent_less.gif' => '46c4a489b08646a7f110c360b61be3bc',
+        'ed_indent_more.gif' => '77506085135c4008d62cca50ad3feb20',
+        'ed_link.gif' => 'adfb4f124a9cfcbaf1d5f2dde6194641',
+        'ed_list_bullet.gif' => '1a49be730188f40a7878ec8b9cd03b06',
+        'ed_list_num.gif' => '282b0624844fe048e7f8d180c254c2df',
+        'ed_redo.gif' => 'e8f409bcd2a561274505fa79902d175f',
+        'ed_undo.gif' => '9c6818077df01f6aa3b0113b0c195a88',
+        'fullscreen_maximize.gif' => '361a5915db890026ed4280bc518e502f',
+        'fullscreen_minimize.gif' => '08a51cc59af4c9c1e1cc77290f5f26ad',
+        'insert_table.gif' => 'cc65036d9589d6183342e2eed294ff57',
+      ),
+      'popups' => 
+      array (
+        'about.html' => 'd66d35b6344ded6911fed96b61bd2cb9',
+        'blank.html' => 'c83301425b2ad1d496473a5ff3d9ecca',
+        'custom2.html' => '2ccb932916cc2696d5d1952d4d36eb13',
+        'editor_help.html' => '7ca29d18f18c0040db5c3af15254d0e8',
+        'fullscreen.html' => 'ec725d362b4bb338111e43e064faef37',
+        'insert_image.html' => '8a06b1d93a6115f1ecc12ec2caf5749f',
+        'insert_table.html' => '1562c8c3b40afcef1800e6b753f6b895',
+        'old-fullscreen.html' => '0daa59e83fdb6b487c6502c5e6a2d42d',
+        'old_insert_image.html' => '9482a4fbbea5a45558f2faaf83291f09',
+        'popup.js' => '1fbb9698cd184cd3b7f61aa9ca0a6d17',
+        'select_color.html' => 'd76a6a92c9660aeeee17fc3fa25fa184',
+      ),
+      'dialog.js' => '45236d35186f82dbc2fab623f0406f60',
+      'htmlarea-lang-en.js' => 'c512cf5dbbf3f3194ea314bdf4710c55',
+      'htmlarea.css' => '6113c65492628800a361ccef432b829b',
+      'htmlarea.js' => 'e33f5031dffdd23c855a054bda135502',
+      'index.php' => '0ec862dc66ce060cc098cfd977709c9e',
+      'license.txt' => '0cb5443ecf825c27b9e488adae9ac8b2',
+    ),
+    'includes' => 
+    array (
+    ),
+    'sql' => 
+    array (
+      'db_update' => 
+      array (
+        'table_update_603_rev6.php' => '8d86e635ec98ef9b86f3ee8d442f7402',
+        'table_update_603_to_604.php' => 'b2e91946ffe089e60f26857c2065f352',
+        'table_update_611_to_612.php' => 'ebc6d228d4f32dc709337d173e8e3e92',
+      ),
+    ),
+    'chatbox.php' => '7e75a4fc9d8a70280cf3ea38a6957039',
+    'custommenu.php' => 'a1bcab76003c2d7a26075c6dde92a2ea',
+    'downloadOLD.php' => 'da13cde41db327d1a251bd02b4f11974',
+    'download_.php' => '17e197e6094df8c6f70c9d6ee5d99cb5',
+    'download_category.php' => '6f81e7b0d0fd7b8e1278bab935bcb431',
+    'filetypes.php' => 'f951037335e993337792606cc1475cec',
+    'forum.php' => '8fcecb7939d0e2f3776602f12f256d41',
+    'forum_conf.php' => '59104f7a4e953f4935c82eaedc060931',
+    'header_links.php' => '89b428327e178a5ec1cd590a8a5a5eea',
+    'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+    'link_category.php' => 'a037103b28a327d7f68b179a6430e0cc',
+    'linksOLD.php' => '97ea4f0610899f6f3892d4bf54f8fc57',
+    'log.php' => '79f63402eb374a1756984f60511d13fd',
+    'news_category.php' => 'f797eba058a27b2391eb25bd3cc185d9',
+    'newsfeed.php' => '9b0566edc1f49895997f39a07b9037b1',
+    'poll.php' => 'a2038a1b5a5f03b243ecd07ee5085181',
+    'submenusgen.php' => 'cbb94c39c1a0640983700119686402ac',
+    'submitnews.php' => '684139e60a097eb04be9767c49dd9985',
+    'theme_prev.php' => '386420f2c1c731f23c7df91926443e72',
+  ),
+  $coredir['docs'] => 
+  array (
+    'help' => 
+    array (
+      'English' => 
+      array (
+        'Articles' => '8bdb338ca53cd252f0d3f3a7ad511520',
+        'Content' => '770d62fe3fa3c984956884553e85af2e',
+      ),
+      'Administrators' => 'fde3f611512ac789609c80fc8a6f3609',
+      'Articles' => 'b59d04443bec2260d4bed4ef013c94b4',
+      'BBCode' => '33451916e62615ddeefb30103f570831',
+      'Banlist' => '83a4c139037713c03d0999e28335c852',
+      'Banners' => 'a1c096485e789b14c720b7c73b4ea7a2',
+      'Cache' => '7fc85b1d45b8d7f3cf7b4866d3d37aa8',
+      'Chatbox' => '5fa17c49db4bfef93729d2dac1fcc162',
+      'Classes' => 'ea8b68f265aef007a9636443b7da3dc5',
+      'Content' => '770d62fe3fa3c984956884553e85af2e',
+      'Downloads' => '37399eb226ad7d1d729f68f65efc7b00',
+      'Emoticons' => '14a0d74aea591e0f8d82577aff8fe979',
+      'Errors' => '46381d88a2326ff760562fea385b2fd0',
+      'Forums' => 'a2266bd5b818e1cf30168ac9053b7a59',
+      'Front_Page' => '7df90a02713ecf9d6ff1c7f7f77cbcb0',
+      'Help!' => 'cbbb887146e203d6e2cae27b17db7ff8',
+      'Links' => '320eb08defa1360070a4f0c062e5fc84',
+      'Maintainance' => 'cc818c06e047bba0e2c2349e954cfaf0',
+      'Menus' => '44a53801c18ad52aa9e50c3b4fbfe241',
+      'News' => 'e5ec6c8137c00916343f8f4f5084bfe7',
+      'Preferences' => 'a089239dbffa47eba773c3c4f878d4b3',
+      'Uploads' => '3db7011da6342cf030bb03f011706bb2',
+      'Users' => 'd64be592aae221b66ca4d33b69056e7f',
+      'Welcome_Message' => 'a3a7b26428d35d5ebb520e16ac6204da',
+    ),
+    'ChangeLog_615.txt' => '0e4d3787cd2a3faf41c45d3b70311295',
+  ),
+  $coredir['files'] => 
+  array (
+    'backend' => 
+    array (
+      'news.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
+      'news.xml' => 'd41d8cd98f00b204e9800998ecf8427e',
+    ),
+    'bbcode' => 
+    array (
+    ),
+    'cache' => 
+    array (
+    ),
+    'downloadimages' => 
+    array (
+    ),
+    'downloads' => 
+    array (
+    ),
+    'downloadthumbs' => 
+    array (
+    ),
+    'images' => 
+    array (
+    ),
+    'import' => 
+    array (
+    ),
+    'misc' => 
+    array (
+    ),
+    'public' => 
+    array (
+      'avatars' => 
+      array (
+        'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
+      ),
+    ),
+    'resetcore' => 
+    array (
+    ),
+    'shortcode' => 
+    array (
+      'batch' => 
+      array (
+      ),
+    ),
+    'default.css' => '54d8e232fe73969b593f71df2afd6995',
+    'style.css' => 'd62b27257e32cc08296930879a6df478',
+  ),
+  $coredir['handlers'] => 
+  array (
+    'calendar' => 
+    array (
+      'language' => 
+      array (
+      ),
+    ),
+    'htmlarea' => 
+    array (
+      'examples' => 
+      array (
+        '2-areas.cgi' => 'c26028a87777a45e8792cf9939cd5464',
+        '2-areas.html' => 'df7d45c30d0825f9c450f38c5af60508',
+        'character_map.html' => 'b064eb5c9586d743ec86ac54370ac61f',
+        'context-menu.html' => 'fc0226d993ec92c2a9c98fb06002bda1',
+        'core.html' => 'c0349e4a3810a822cbb01ce26019afcc',
+        'css.html' => '90120b460e62b056e46a443d869b104f',
+        'custom.css' => 'd841b6b070f3ae8e67e196ff2ee6c5fe',
+        'dynamic.css' => '402fa7e28e0b0c2035520676cc4ff581',
+        'dynamic_css.html' => '3bcdb4239b896d49ba2d32c329b54e74',
+        'empty.html' => '4404eb82dbf03fd2825e0fcce3413769',
+        'full-page.html' => '588ce9c643c645eb2b6cbe1dbbfc09fe',
+        'fully-loaded.html' => '5d7c6ca8fa4927dbbb40fc604d856922',
+        'images.html' => '9553c5838b7c90a33a0401084a7a0c46',
+        'index.html' => 'e8fdc4fc45c34917aff59da5c7ff001d',
+        'list-type.html' => '25df168ea209a4be5ea42f559683b96e',
+        'pieng.png' => 'f8915fe3b221dd044a93782fc0d2f5f0',
+        'remove-font-tags.html' => 'a0caff2e51ec7a7aad6e4cf2f6d12dd4',
+        'spell-checker.html' => 'e50a13ee08206801e968270c72adac0b',
+        'table-operations.html' => '3e14d124b11047df9e7ad3ef92c932cc',
+        'test.cgi' => 'b6b0615fc550bfec4c5e5adb1c69cc6a',
+      ),
+      'images' => 
+      array (
+        'ed_about.gif' => 'e0c3a2d4938e92642abe88319c37a019',
+        'ed_align_center.gif' => '419a7cac054b4b2dff1b9eab7a45b747',
+        'ed_align_justify.gif' => '9c31aa4411277ca29c3419f8df7b8b1d',
+        'ed_align_left.gif' => '9c22c00f4c67931140be15e59db6d517',
+        'ed_align_right.gif' => '93862fdc7d08142fa419cbd0f6c66213',
+        'ed_blank.gif' => '020874e9edcbcd0b514d1b30f14b18bb',
+        'ed_charmap.gif' => 'a897a03f66ec432ed8e7cd26c3b5f88e',
+        'ed_color_bg.gif' => 'c6e286fdfa3ba31ebed7f18b0ecc75b4',
+        'ed_color_fg.gif' => 'c72e9bc079196ed7b089afa9593cd8a9',
+        'ed_copy.gif' => 'cf622962955f521c5ae576797d1032f7',
+        'ed_custom.gif' => 'e7b27a6808e66a8a301cbaf64eb8825a',
+        'ed_cut.gif' => 'f512b15c53dea427a6173023b8945a87',
+        'ed_delete.gif' => '79ac46c129cf5dc8b21c5c0d42151831',
+        'ed_format_bold.gif' => 'f4f614c2cb06763fc3063c93f07cf415',
+        'ed_format_italic.gif' => 'a800ad94ba742d72099073f0faeb2004',
+        'ed_format_strike.gif' => '9aa5a079df34a4eedcc5c716c9386a74',
+        'ed_format_sub.gif' => 'b16263bc5ca08886c978db99f4feea40',
+        'ed_format_sup.gif' => 'cad7d563b915d56d38cb0ee680191a59',
+        'ed_format_underline.gif' => '505a23f166dcb38cea34af16ce4dbb5c',
+        'ed_help.gif' => 'e7fce3f8566622f3add66b5255948397',
+        'ed_hr.gif' => 'ff70dd8f9cefacf143e7396dcf4f58b6',
+        'ed_html.gif' => 'fa6e7d1b61493b607b61bd71bf1f36d5',
+        'ed_image.gif' => '4ab7d43a45532267df831d0a8fc34d8c',
+        'ed_indent_less.gif' => '850310807053467daa42cc8bba2fcbac',
+        'ed_indent_more.gif' => '3835d1bdd22a011a5b22e23fcce75e9e',
+        'ed_left_to_right.gif' => 'a0f9ecd9a146094c0265df9ab57e1dce',
+        'ed_link.gif' => 'f04cb59f80844ac38e9ce9f2698ce7f9',
+        'ed_list_bullet.gif' => '236b4559afbfec1d238a939b65ea9d0b',
+        'ed_list_num.gif' => '48d3e7c2c5826371be37b608d33af15a',
+        'ed_paste.gif' => '81e1666c11b6def84943d3fab3aeedfa',
+        'ed_print.gif' => '9bd797173a2fa37bedeeabd5d47e25cc',
+        'ed_redo.gif' => 'e9e8c51b9f00093a3f303f0bf2ce7e05',
+        'ed_right_to_left.gif' => 'c644f85dfa635e265e6a8da8c7c06227',
+        'ed_rmformat.gif' => '287498e569fb9a902e7cfc8dd634e449',
+        'ed_save.gif' => '07ad6426b48b0f86cf0985a599c7ee95',
+        'ed_save.png' => '0a17a62b278ba3554338d254c4e9af60',
+        'ed_show_border.gif' => 'ae228363e7079002dd18dffad8d66c62',
+        'ed_splitcel.gif' => '2c04da7e1c53d5c63aff4f80e5023b22',
+        'ed_undo.gif' => 'b9ba819ac9e7700ca0a876dba2b81c39',
+        'fullscreen_maximize.gif' => '2118040d93941f64f7a2096b2370d7c2',
+        'fullscreen_minimize.gif' => '816c96e44ded878836292b80da38ac1b',
+        'insert_table.gif' => '3a985dd81474a602d4318b67dc5023e2',
+      ),
+      'lang' => 
+      array (
+        'b5.js' => '447acabed5a028ed6130315d9c943de9',
+        'ch.js' => '9ad4148575e696b826345faf9c104ecb',
+        'cz.js' => '7e0d467e3c3f95365f07fcd57e9e6036',
+        'da.js' => '4450a6f37a4619e067466157477e227b',
+        'de.js' => '24be5c7286b694ec285fdd3e39430eb5',
+        'ee.js' => 'cef8b2148ce28b55eafdd41a9479d29e',
+        'el.js' => '49f2dd6d814083e200450934175e54ce',
+        'en.js' => '67a44be798d52f8434b1d5db9afc0344',
+        'es.js' => '465284bdda072f89c1aa381bd129d4eb',
+        'fi.js' => '1648e59b0fc3e98b673e260c4c4f2b54',
+        'fr.js' => '9c8d847c3c1384e36d115c0437036961',
+        'gb.js' => 'b6ff9b489e34676feeb33c94d67e3c40',
+        'he.js' => '5973c58ae6d3cf1a7e13d53968e2f8b5',
+        'hu.js' => 'e4058a7d72a280f4d007b0cba7dba299',
+        'it.js' => '48f677e19fcbbf3eb3e2f32e808e6195',
+        'ja-euc.js' => '1937933840fe8a3f6c27850f9d1a6b15',
+        'ja-jis.js' => '58f5669e271d2a9399ed4319b6a27563',
+        'ja-sjis.js' => '1ce17214bec7f48f7c7fbc0cb14ae591',
+        'ja-utf8.js' => '08eec318143c80b3f9d77c16e302c327',
+        'lt.js' => '8b5d346a3a49d276b0d613dbd05babc7',
+        'lv.js' => '1821f4505b4824daab558b8ab8456589',
+        'nb.js' => 'fe892254acff2640f3e52d26839b936b',
+        'nl.js' => '31994cf5b276689e361684336577611c',
+        'no.js' => 'ddb7044ad152be38f496969473a1175c',
+        'pl.js' => '9ec4ec413e44d1f372db4dc5d3117153',
+        'pt_br.js' => '79ffb2703fc0e55e71e54842a86598bd',
+        'ro.js' => 'cdbeac570a639c27ebddde2825352787',
+        'ru.js' => 'd980179d51e134536810d69fbd48568b',
+        'se.js' => 'eb12fb43788fd80aa4a60b7826ec01cb',
+        'si.js' => '886456af4fc31dbcd830e796ef7f3912',
+        'vn.js' => '8c6666b64ed1206242f30b0b7c47dd56',
+      ),
+      'plugins' => 
+      array (
+        'CSS' => 
+        array (
+          'lang' => 
+          array (
+            'en.js' => '8e6555db8565a1d7f048b6a18dde3fda',
+          ),
+          'css.js' => '090411fa76b76164871cf2344a83816b',
+        ),
+        'CharacterMap' => 
+        array (
+          'img' => 
+          array (
+            'ed_charmap.gif' => 'cbdbb8c0c3a4ec3d285d1b45eaafd08b',
+          ),
+          'lang' => 
+          array (
+            'de.js' => '4ed8e64697d6e02747eecff014fb37f9',
+            'en.js' => 'ead2887475037b02a936253d02b69f3d',
+          ),
+          'popups' => 
+          array (
+            'select_character.html' => 'a04ca5324301728db4e709e1ba6b042a',
+          ),
+          'character-map.js' => '45ca956159d003a48cc3f986d9b9378e',
+          'makefile.xml' => 'd931cda0bf52a8924c8f7ae33c7b2c1f',
+        ),
+        'ContextMenu' => 
+        array (
+          'lang' => 
+          array (
+            'de.js' => '4b2fce5f5d94db5a1a9e8d49b14f251f',
+            'el.js' => 'f66150fc20a7710a38f06ca26aba56c0',
+            'en.js' => '3cd3c38364df0fc5bf545c040b575bb6',
+            'he.js' => '42160bd5787ff8ebb2db2eba0b3765ed',
+            'nl.js' => 'be00a4d988b49422748508b18aaca0b7',
+          ),
+          '1.pl' => 'b6bf5f353d0a8855a1fd306b66cbe9c5',
+          'context-menu.js' => '5a7c67297506ef28729e14a3473862b3',
+          'makefile.xml' => '014bbd44792974fd68bedd459ad86916',
+          'menu.css' => 'e9a7d8e58b8467c4aa2c21d78a3d55f5',
+        ),
+        'EnterParagraphs' => 
+        array (
+          'enter-paragraphs.js' => 'e07557b92190a5afb75a1947b54183f6',
+        ),
+        'FullPage' => 
+        array (
+          'img' => 
+          array (
+            'docprop.gif' => '7d7b378ee76a7261839f1761747c92ca',
+          ),
+          'lang' => 
+          array (
+            'de.js' => 'f2521a052eb077cc4ca8bdac46b52318',
+            'en.js' => 'a32a89a7d529980c4578ce41d5060a83',
+            'he.js' => '4d7d7ac12427b8e83409f5a722b24a3c',
+            'ro.js' => '70c749f56e054ee375d3071835bff971',
+          ),
+          'popups' => 
+          array (
+            'docprop.html' => 'd70ad91008772d4cfddc481047450388',
+          ),
+          'full-page.js' => '64e3137a2797388a5f9c8997bc95254a',
+          'test.html' => 'bc2dbd5b474b8ee25201bdf9d6111f2d',
+        ),
+        'HtmlTidy' => 
+        array (
+          'img' => 
+          array (
+            'html-tidy.gif' => 'df7a4baa0a571884619ae7eb0c200bb7',
+            'makefile.xml' => '51b266fe6e1c56194e882daff3cced7c',
+          ),
+          'lang' => 
+          array (
+            'en.js' => 'db675a7d0202b2fb278038b16fbf9cd2',
+            'makefile.xml' => '093576d9af435ec31fd92da9bce1744a',
+          ),
+          'README' => 'e72c09ecd15ee4288dd403ef47bf0622',
+          'html-tidy-config.cfg' => '09ee92887f93971b1858f289427d441c',
+          'html-tidy-logic.php' => '8f7236a0097cc58f8f72dadb20ab3604',
+          'html-tidy.js' => '7b9e2fcfb2a25fd01ec420a67e32a858',
+          'makefile.xml' => '7dd3abc3e30aa07ac4b0d18810dea63e',
+        ),
+        'ImageManager' => 
+        array (
+          'Classes' => 
+          array (
+            'Files.php' => '2692b44b256a5bd27b675abb64250682',
+            'GD.php' => 'f0b6c4522817f07ca95bc64f9a162599',
+            'IM.php' => 'cba66d49670c9e1e3e12281c1e456999',
+            'ImageEditor.php' => 'e88d5eb443de0968694d7c84231a0a02',
+            'ImageManager.php' => '0c3d9e63708ad26239a03ac4b1b4319f',
+            'NetPBM.php' => 'd13aae16707bca40d61c9603cfb8bb59',
+            'Thumbnail.php' => '57b96ef8a203a79eefbc53c7aa32f79b',
+            'Transform.php' => '70627a5e07fd7bb51c35d5407333f64b',
+          ),
+          'assets' => 
+          array (
+            'EditorContent.js' => '56ca6920dc7b98dc4e975cebb8790712',
+            'ImageEditor.css' => '923a26cbde11cd05a2fe714d75d61edd',
+            'dialog.js' => 'e418b7c77ee9f8bf01d100b3de63757f',
+            'editor.css' => '0523943b213ec2edfd9f3562397ee24d',
+            'editor.js' => '97844fb6bc700e8c832a6bd95b6dd92c',
+            'editorFrame.css' => 'd585831ec0b2a9088755c5748d80ffd3',
+            'editorFrame.js' => '7da85c65207fcb1a66add2105d3d140c',
+            'hover.htc' => 'b8e7a2a9b05a94f4789ec220f4c688ab',
+            'imagelist.css' => '73a0b0581fb0020a3f734334dc60cdca',
+            'images.js' => 'a46d80c6482269737ea52879f92ba643',
+            'manager.css' => '8889b7af3a1d994e472fdd2ebe69500a',
+            'manager.js' => '4b1887eb16e3794e47b707feae04b58e',
+            'popup.js' => 'ce11aaa2796994d1a931e4376951fe8d',
+            'slider.js' => 'd8bf45b210537f1f220d3f7123c51160',
+            'wz_jsgraphics.js' => '034e994a173372f31661f66cd84cdb95',
+          ),
+          'img' => 
+          array (
+            '2x2.gif' => '889a061243a8d254b8a051f4c2e5888e',
+            '2x2_w.gif' => 'e602cc47d26909903907a1141736bc4b',
+            'btnFolderNew.gif' => 'd36d09544ef41db8a3230d25735960c8',
+            'btnFolderUp.gif' => '6ee5eb9556897ac23a6762645b9c98fc',
+            'btn_cancel.gif' => 'a4f53f6cfd7fe94f243762224f9f9c19',
+            'btn_ok.gif' => '9c9ef0692dc686d2f80f387821364454',
+            'crop.gif' => '9423eb4e1b1887ae43479f322bf624c3',
+            'default.gif' => 'fd81a1c481584f1b1f1166f29b9ca60a',
+            'div.gif' => 'cf5b3b40af68e894b7e8daf38dc590f0',
+            'dots.gif' => '1f1d5ee955a043ef4e32a1fb6908a9d6',
+            'edit_active.gif' => 'dd9aef4d47d74d2fd0468b306b93c7eb',
+            'edit_pencil.gif' => '3c1632099bd6d9f628d75cc945d65472',
+            'edit_trash.gif' => '544f51af0afd7c03f89aaed3bd236bce',
+            'folder.gif' => '6d3fe7d47b4a1f5788b755b9f41962fe',
+            'hand.gif' => '228dec68bb9d3e4db8f892da48b82077',
+            'islocked2.gif' => '9d20ae36b2ba9ecbff770e4905779725',
+            'locked.gif' => 'b1da4d2161b8a50077caff0affde606a',
+            'measure.gif' => 'b965f9dec293df5ff007e57a20da5862',
+            'noimages.gif' => '8f1b20dfcbb76ea7eccaaa7dce7bd2e6',
+            'rotate.gif' => '2e9f127ae49427d98a389f97e88b8302',
+            'save.gif' => '0ef008540649f73357ccb9e11fb0c143',
+            'scale.gif' => '7681e29865fd4206871bbf9ff78a0d6e',
+            'spacer.gif' => '221d8352905f2c38b3cb2bd191d630b0',
+            't_black.gif' => '56953a9124d388a2c36e1f40cc539776',
+            't_white.gif' => '9448cc76491fdc49524d19c21fd7c81c',
+            'unlocked.gif' => '180782c948e3dcc25efac3fdb4bc1f25',
+            'unlocked2.gif' => '717ef4a83a86cfc967c64110efdeadf7',
+          ),
+          'lang' => 
+          array (
+            'en.js' => '878cc575e93b0209fe9f16765c9834bc',
+          ),
+          'README.txt' => '1c6d282806895395a23e514c4f1066b5',
+          'config.inc.php' => '03269e9ae6a4b70e123e990a605031e6',
+          'editor.php' => '170e45516bfc45c5a826e430827e1119',
+          'editorFrame.php' => '802917ce477b1acd1e76d42be9aa5f6a',
+          'image-manager.js' => 'dc30741f304b2950d50e7b96e0d47611',
+          'images.php' => 'f218b51d5e9fcc072c5d66315423bab8',
+          'manager.php' => '71baed2d33b08b013ec8b9aeeb4e6077',
+          'newFolder.html' => '767491c7e3685a684e0061a7127b2ee4',
+          'thumbs.php' => 'dac30ffea29e6ce86cd4d00ffc5008cb',
+        ),
+        'ListType' => 
+        array (
+          'lang' => 
+          array (
+            'de.js' => '48151b4536ffef96e950b967a5ad27b3',
+            'en.js' => '3e2424f60d678219d71dd3c5992520b4',
+          ),
+          'list-type.js' => '9ae3d27711d44a896a4994ead5ce0e28',
+        ),
+        'SpellChecker' => 
+        array (
+          'img' => 
+          array (
+            'he-spell-check.gif' => 'a9691fd828640716a4824fd3687095cc',
+            'spell-check.gif' => '45f87ae3a236a82a00590675ab45300e',
+          ),
+          'lang' => 
+          array (
+            'cz.js' => '423ea6b03dd929379d8c3c0e2a1b03a6',
+            'da.js' => '497d53b6de504e815f21e0b52c4429be',
+            'de.js' => '8e1cf54a88bfa8f1f1bae8901ec724d3',
+            'en.js' => '377855eaba880269a2a806e1f410dbd7',
+            'he.js' => 'ee5604c67403b7344bd8aab484993b74',
+            'hu.js' => '2f79d9530b544abcc01c980066319b5e',
+            'it.js' => 'b731ddc9bccc8b8b45862bc8af1fc03c',
+            'nl.js' => '347cc6ab35dc6e52f078173aca6038cb',
+            'ro.js' => '1cb27ad27005caa43d26fe038aca361e',
+          ),
+          'readme-tech.html' => 'dbeb0b3677a42ec8d6ba93c74d80777d',
+          'spell-check-logic.cgi' => '8a73715a7dfca8571e40f2a0c0ce73ca',
+          'spell-check-style.css' => '6953de17403da48de1a429187892200f',
+          'spell-check-ui.html' => '3af087688cd52a07b4baedee45d4a36a',
+          'spell-check-ui.js' => 'a1567a45c985106c96c18e999dc56ffa',
+          'spell-checker.js' => 'd922b5b20388fb3d73ab470c79fb2f4e',
+        ),
+        'TableOperations' => 
+        array (
+          'img' => 
+          array (
+            'cell-delete.gif' => '7bfbe4bb08412b6933b9e4cb67279a50',
+            'cell-insert-after.gif' => '0cfcc1080fe87476e80ee62a5e7c228e',
+            'cell-insert-before.gif' => '90729f21741e8d1e6de6bda134b8e28d',
+            'cell-merge.gif' => '643f7ce0bd58e09e9d33afb7bafcfb41',
+            'cell-prop.gif' => 'd499211088027cb901d0e2110608b6ec',
+            'cell-split.gif' => '5f2d042f04107d2b74e205c4bcd75bed',
+            'col-delete.gif' => 'b7e7a41e9176c07af5a10ca2035019e1',
+            'col-insert-after.gif' => '999e3fec40db7cff90fafc0ef9b67c90',
+            'col-insert-before.gif' => 'bcbdc75b946ef3c67523e26105046731',
+            'col-split.gif' => 'c0c535be91376e5f5a763c3bee9bcaab',
+            'row-delete.gif' => '550b14813b04e8a1a49f2799bbf2ecae',
+            'row-insert-above.gif' => '121b8897f46625b42a0626e98b428ea3',
+            'row-insert-under.gif' => 'dad2c7e0d7b38f9982382c2925ca18a2',
+            'row-prop.gif' => 'e6df91ff1129ca622afb11dd1d9eb693',
+            'row-split.gif' => '42fea49dff83dd1437defdc43795e300',
+            'table-prop.gif' => 'a0c6945eba87e40f753952c16f1e788a',
+          ),
+          'lang' => 
+          array (
+            'cz.js' => '891f6cf5b22f7a1c8dcbf039a3bc29cd',
+            'da.js' => '6253788b287cd7069c02bce1c25458ab',
+            'de.js' => '48a37c922d8b8fc7d93cfb20a50357c4',
+            'el.js' => '342afc0caefe7e53ac753d6b8f2ed041',
+            'en.js' => '0d42d10515c8be7601482beffd37eff9',
+            'fi.js' => '5b8ee761a423e09cc360294f87e85c08',
+            'he.js' => 'a1645eb3b8b5306c7046791fd0b4b6a3',
+            'hu.js' => '971f436dce04d926c0835e93816b2912',
+            'it.js' => 'e9f2d5f3d7ff32468dd44077ea21937e',
+            'nl.js' => '7d1ec5afd720877120bb81f73ba0cf70',
+            'no.js' => '8613a29c3174424b0bf9abee60352434',
+            'ro.js' => 'a01f89c091380da4a56acd9acf06516e',
+          ),
+          'table-operations.js' => '1b988f2a82430274492780b22a2bb7ba',
+        ),
+      ),
+      'popups' => 
+      array (
+        'ImageEditor' => 
+        array (
+          'jscripts' => 
+          array (
+            'EditorContent.js' => 'a0d5619dd3570cd2ecc8711d23aa36d6',
+            'slider.js' => '3d58fd930085aa61cd9fb0e7bc81f01d',
+            'wz_jsgraphics.js' => '034e994a173372f31661f66cd84cdb95',
+          ),
+          '2x2.gif' => '889a061243a8d254b8a051f4c2e5888e',
+          '2x2_w.gif' => 'e602cc47d26909903907a1141736bc4b',
+          'GD.php' => 'ad14fd96ebf77707b3f177536c0b20f2',
+          'IM.php' => 'fcf6c91de9af23e2cb297412df1590e0',
+          'ImageEditor.css' => '923a26cbde11cd05a2fe714d75d61edd',
+          'ImageEditor.php' => '2f8f8c4fbfb1b0b3cd02efec79652c23',
+          'NetPBM.php' => 'aa5eefb655d68a94702d41ccf6ff7d7c',
+          'Transform.php' => 'e6448a8d758d5afb6ca1af5e6bfc7910',
+          'btn_cancel.gif' => 'a4f53f6cfd7fe94f243762224f9f9c19',
+          'btn_ok.gif' => '9c9ef0692dc686d2f80f387821364454',
+          'crop.gif' => '1a76734219b53116f4e9905ea2af2e23',
+          'div.gif' => 'cf5b3b40af68e894b7e8daf38dc590f0',
+          'hand.gif' => '228dec68bb9d3e4db8f892da48b82077',
+          'load_image.php' => 'f155a3b259125b861528d09768ed858d',
+          'locked.gif' => '9d20ae36b2ba9ecbff770e4905779725',
+          'man_image.html' => '8f012c3475587bc082fe6b20d942069a',
+          'rotate.gif' => '2e9f127ae49427d98a389f97e88b8302',
+          'ruler.gif' => '53000656f017f2c128e86dd9f314e95f',
+          'save.gif' => '0ef008540649f73357ccb9e11fb0c143',
+          'scale.gif' => '0ea1e46cc5de3f04a2e83f7daf690a95',
+          'spacer.gif' => '221d8352905f2c38b3cb2bd191d630b0',
+          't_black.gif' => '9897846e47b0b7dc9fcd2b89e918dacb',
+          't_white.gif' => '9448cc76491fdc49524d19c21fd7c81c',
+          'test.html' => '691e4bb7755b5ae86538a8852b9fe759',
+        ),
+        'ImageManager' => 
+        array (
+          'btnBack.gif' => '551c98aa577cd1fc06c6703ec167d6e8',
+          'btnFolderNew.gif' => 'd36d09544ef41db8a3230d25735960c8',
+          'btnFolderUp.gif' => '6ee5eb9556897ac23a6762645b9c98fc',
+          'config.inc.php' => '31d8cebc72d510e35cc1c53f496d6367',
+          'config.inc_orig.php' => '87b4ab3f0e7d8ae6a4562730cfe987c7',
+          'dots.gif' => '1f1d5ee955a043ef4e32a1fb6908a9d6',
+          'edit_active.gif' => 'dd9aef4d47d74d2fd0468b306b93c7eb',
+          'edit_pencil.gif' => '3c1632099bd6d9f628d75cc945d65472',
+          'edit_trash.gif' => '80269e15cbb7187371493dfa52b6a53d',
+          'folder.gif' => '6d3fe7d47b4a1f5788b755b9f41962fe',
+          'images.php' => 'aa1010985b23d278667e33c5d212c14f',
+          'loading.gif' => '3e131b006c211839150e2336691918f4',
+          'locked.gif' => 'b1da4d2161b8a50077caff0affde606a',
+          'newFolder.html' => 'd7a282c567c2d84c6bbd312645538a29',
+          'noimages.gif' => '8f1b20dfcbb76ea7eccaaa7dce7bd2e6',
+          'thumbs.php' => '2f721186a74b6a0ece248b667bdf915e',
+          'unlocked.gif' => '180782c948e3dcc25efac3fdb4bc1f25',
+          'uploading.gif' => '62d8e984849c9747f9a05de393e055be',
+        ),
+        'Copy of insert_image.html' => '8a06b1d93a6115f1ecc12ec2caf5749f',
+        'about.html' => '9c6c02a3a05707cfeb768b428f60516e',
+        'blank.html' => 'c83301425b2ad1d496473a5ff3d9ecca',
+        'custom2.html' => '2ccb932916cc2696d5d1952d4d36eb13',
+        'editor_help.html' => '7ca29d18f18c0040db5c3af15254d0e8',
+        'fullscreen.html' => '4d9d7c276363f212428b2ed15cf9d8a6',
+        'images.php' => '3755c66145eba21cc2199d455e855d73',
+        'insert_image.html' => 'e9db88c76c75487cdd5415525ff94444',
+        'insert_image.php' => 'b024826624d558a4600659d20189738b',
+        'insert_image2.php' => '8a06b1d93a6115f1ecc12ec2caf5749f',
+        'insert_table.html' => '47057008bd2f8af99f40b64d69fc7101',
+        'link.html' => 'c692e60fd034d33bfe452e014d99fdaa',
+        'old-fullscreen.html' => '0daa59e83fdb6b487c6502c5e6a2d42d',
+        'old_insert_image.html' => '9482a4fbbea5a45558f2faaf83291f09',
+        'popup.js' => '8efbf716ae23676c4cd3bec5a6b8df46',
+        'select_color.html' => 'c047474ad06f18557cd711c78bf86c4e',
+      ),
+      'ChangeLog' => 'c68e0a92145cad1afd0738dc0875f7a8',
+      'dialog.js' => 'd84853c01220bee8568dc68701ff5253',
+      'htmlarea.css' => '327b488d20dacdbf5466532bc2f6cd5a',
+      'htmlarea.inc.php' => 'ba73019f5bb7502c17fadeb92975cd59',
+      'htmlarea.js' => '13e42f7db453422762ce64cee52bb8f0',
+      'index.html' => 'dda9c564dbf0a33feb4535edf11f9110',
+      'index.php' => 'e515b64e6a348436045ef89d78776c1c',
+      'license.txt' => '9153c7000079a9f2f6441e6211a20689',
+      'popupdiv.js' => '3363d6531f00951387d0094217fcd3f9',
+      'popupwin.js' => 'b24c467ee42722fc061e262fe11a5b4c',
+      'reference.html' => '8b3cd84619e5476e118fb2d6285eceb7',
+      'release-notes.html' => '64d8c1087c9ae11062682129e1547fca',
+      'test.css' => '0edee201158cd4a1ffecd1334afe63dd',
+    ),
+    'javascript' => 
+    array (
+      'sitemap.php' => 'edd37423c3218ff1c3d242198ebfb60e',
+    ),
+    'parse' => 
+    array (
+      'parse_avatar.php' => 'bc7d58d3b0d15e23e030920b9051e16e',
+      'parse_emailto.php' => 'df63e9219382e8ea652dfc97b4a30ca4',
+      'parse_menu.php' => 'e3fa890a733e4262cfe0ae82910a338a',
+      'parse_picture.php' => '6fee5312651fb1f3b525a02ad1a7ac6a',
+      'parse_profile.php' => '64f116088d3e55f9a82e62c930828561',
+      'parse_username.php' => '986ffd8dd73ebc6685fa5b82b8119307',
+    ),
+    'phpmailer' => 
+    array (
+      'language' => 
+      array (
+      ),
+    ),
+    'search' => 
+    array (
+      'search_article.php' => '9bec55cc19fbce64f7985ca93306a0fa',
+      'search_chatbox.php' => '0de05ea2574562e19a0686a5bb803e43',
+      'search_content.php' => '7bb898d8278a238bb71cb8169b9ed2bc',
+      'search_forum.php' => 'dcfeb61a2f830291b4bb8b5e0617554f',
+      'search_links.php' => '9667c1e5eca93a0cb1610616c8acc329',
+      'search_review.php' => '323c3b48ecc585e6270ad7e35cc9f1e0',
+    ),
+    'sitemap' => 
+    array (
+      'sitemap_articles.php' => 'cadc92c5c59b98157358d7aaafe2750e',
+      'sitemap_content.php' => '51139ad22af3be101821fb95d192fb03',
+      'sitemap_custom.php' => 'fcb7a1472051f94d26428654f76971b6',
+      'sitemap_downloads.php' => '797820b44a3d942e7d01b0671f018238',
+      'sitemap_forums.php' => '0ee814778c6e0bfb2dfc887b55de9285',
+      'sitemap_links.php' => 'bf0baa44ab7bffa9b6edfb9d5d5d4879',
+      'sitemap_members.php' => '9b69a90d417413a0f71526d6e86d45f6',
+      'sitemap_news.php' => 'edbaecb0c53a67c70f18115fdf016929',
+      'sitemap_plugin.php' => '8efa15ed27447e28c5da1575e4585419',
+      'sitemap_reviews.php' => '2ed15c10e8d7cd03e4514483fae57a99',
+      'sitemap_stats.php' => 'b6c748044f12a7ecfd7c3d954368cbde',
+    ),
+    'textparse' => 
+    array (
+      'basic.php' => 'c90c4c7f52e629fdbab1485fe1f5b6b6',
+    ),
+    'tiny_mce' => 
+    array (
+      'langs' => 
+      array (
+        'ar.js' => '169d300416af7cdce6b654bd06ac2a06',
+        'ca.js' => 'e054365bf2a065901d056b32b0a59e70',
+        'cs.js' => '1d3a1ae555dbba9bb95d9ce840baadf3',
+        'cy.js' => '870de31fc18bab817e6d2d7b4aa872db',
+        'da.js' => 'cc247f4d1e6091c73cc7ecf4b4cb7593',
+        'de.js' => 'e537b2b171cd2f23576b629ab19ffa45',
+        'el.js' => 'c096fbf3106ea60a2853ae7b20837083',
+        'es.js' => '722eafb047cf340d2b4b3634c9e21b7e',
+        'fa.js' => '765b91b313f4a0f26d42484c77467435',
+        'fi.js' => 'ccc8cb4f10b06859601658a90bbe345e',
+        'fr.js' => '830a88badcbf0fc6945629fce64170c2',
+        'fr_ca.js' => '6bea7226495c8206f636fa254941f76c',
+        'he.js' => '85bae4a55d6394528f8cad5ff5ea8f99',
+        'hu.js' => 'aadba22877f75ffe0da5aae7411ee555',
+        'is.js' => 'ff7131f18d060c1d1067c34dda46e07f',
+        'it.js' => 'e7916809ed09cb8b08183a26631852b8',
+        'ja.js' => '218c57cf1200749edef223732cac282c',
+        'ko.js' => 'f6c50cb6f13426a16676bde0b40b020a',
+        'nb.js' => '14256f6008d426eb669e371c9cf34060',
+        'nl.js' => '82569f5c2204acb05bc092dda323305f',
+        'nn.js' => '8c5856fcd3202541c30761a0bbe95abb',
+        'no.js' => '4d36ba827e1f9abd6cb9feb15ff57b08',
+        'pl.js' => '1684ef7d0c56a3a8cb05c4aefb819433',
+        'pt.js' => 'bc6ae838e0606cf3fbade874358cfb30',
+        'ru.js' => '56c1ff2e73723c6f8fae848272328d4f',
+        'sk.js' => '9e0bb7f1f7e24a341032200403cbaa33',
+        'sv.js' => '903a021d9a56c081bb7f3c472da74cea',
+        'th.js' => '7f64804bf3630e8f5f15de051babad84',
+        'zh_cn.js' => '20a2d07cc1c450f17bd32628f05d893e',
+      ),
+      'plugins' => 
+      array (
+        'contextmenu' => 
+        array (
+          'css' => 
+          array (
+          ),
+          'images' => 
+          array (
+          ),
+        ),
+        'emoticons' => 
+        array (
+          'images' => 
+          array (
+          ),
+          'langs' => 
+          array (
+            'da.js' => '814c678d68b7846bd3cc7185293f4a1c',
+            'es.js' => '5c5e44038d0d5083510970ed518093b0',
+          ),
+        ),
+        'flash' => 
+        array (
+          'css' => 
+          array (
+          ),
+          'images' => 
+          array (
+          ),
+          'jscripts' => 
+          array (
+          ),
+          'langs' => 
+          array (
+            'cs.js' => '50b2809eb2cd7801895d1e6e98a9c91b',
+            'cy.js' => '5dcfd2755cddfcbe6351d4dbe6c6ac85',
+            'da.js' => 'f2b72ffa4f64243f1c1d8e531ccd74b1',
+            'de.js' => '5d238f5f9a261564e09a002cb5c93ff1',
+            'es.js' => 'ec24f744a0c500a651db47fe579994be',
+            'fa.js' => '14a0820203eea7f22856a2c8174f9636',
+            'fr.js' => 'e489db910121ca476419966302177706',
+            'fr_ca.js' => 'b6768e9d9b8f57a5e19e0bb0e108f84a',
+            'he.js' => '39b200474cb83b04a48c2f07319930ca',
+            'hu.js' => '846d4333e20d69b57cbee77b243f51ae',
+            'is.js' => 'cf9e78d16351bdfe2423a208a82f1ed3',
+            'nb.js' => '2f5c5fe3b2de8c401b0a0649f40e9dd6',
+            'nl.js' => '3d95f1fbb0c52ed3b6d54968de5f6e01',
+            'nn.js' => '25fc03ee93c77b1e98a2294cf6c333b8',
+            'pl.js' => '057d4c9a766965d068c47807ffc65332',
+            'pt_br.js' => '1792b9f671c47547cfe2dbb4ee22bdd4',
+            'ru.js' => '7f292bd82c13f543a2cc9d2ce57920ad',
+            'sk.js' => 'f45dc9dd2d9351d9ad37ddf080b40959',
+            'sv.js' => '0dd9da08e68b78ce0832b75ddf7b0d7f',
+            'zh_cn.js' => 'c5e6a82179266880d79b4626f965b108',
+          ),
+        ),
+        'ibrowser' => 
+        array (
+          'images' => 
+          array (
+          ),
+          'langs' => 
+          array (
+            'da.js' => '3394bc3500d94fa47fd39c17f0bbfcf9',
+            'es.js' => '7b1df3446f8ccb76e80cfd9a5b13ed17',
+            'nl.js' => '7004a5cd5e9e09d193d6742849dfb4ee',
+            'pl.js' => '5bc48956a398ac86f36edb041a898a85',
+            'sv.js' => 'b95727449ec9e4bd7c3774ae8ceef0ab',
+          ),
+        ),
+        'iespell' => 
+        array (
+          'images' => 
+          array (
+          ),
+          'langs' => 
+          array (
+            'cs.js' => 'a0f2834cbbd44d40490c11fe370f7756',
+            'cy.js' => '8f7626778be315a6918f66e19a5ff8c4',
+            'da.js' => 'cfc6d891c08e588b1461202d2568d7d6',
+            'de.js' => '91728a57ef0ba20f25e47ee03b4866da',
+            'el.js' => '3d65d19ee490b26fa1787bd8fbd35855',
+            'es.js' => 'dd6eac9bdd597674c08d5daa9991d0fe',
+            'fr.js' => '724009d0efaff99b88271c7f34ef1dfa',
+            'fr_ca.js' => '54bbb38074a99afe3837478c49c0afc2',
+            'he.js' => '3609aafd758034d56598706932ca4662',
+            'hu.js' => '8b95913effa4e9d396fa734cdc6fe186',
+            'is.js' => '777e6acb33acea76fce8b1109d74c693',
+            'it.js' => '0de3c5e3e36d73e9f3b6ef6ed03ce5c9',
+            'ko.js' => 'a08675987efeac4b71e024e6766d40d9',
+            'nb.js' => '5d570071a5be75f3545dfbdc330bad6d',
+            'nl.js' => 'd868734d3267d4889352a8411a3eb43f',
+            'nn.js' => '8484fc2cdf334f00d461b6c64ef91287',
+            'pl.js' => 'be72eef12fd4177e9283cf6083267079',
+            'pt_br.js' => 'f18184638fe63e45cce421a0caa70a42',
+            'ru.js' => 'cc1b970dd624041f208852864544ce67',
+            'sk.js' => '6b8f43fac2a387024e35f8526f407598',
+            'sv.js' => '9df8dd73b0ab656e8296b8a60969a2bd',
+            'zh_cn.js' => 'fcfa956bf3fa2efc6ce5cb980399f4f8',
+          ),
+        ),
+        'table' => 
+        array (
+          'css' => 
+          array (
+          ),
+          'images' => 
+          array (
+          ),
+          'jscripts' => 
+          array (
+          ),
+          'langs' => 
+          array (
+            'ar.js' => 'ae43b3e7e800feda0f3b30047e791e36',
+            'cs.js' => 'cd74781764e126601991f523238b2997',
+            'cy.js' => 'cdab2180c5e65051912c96cc88c86354',
+            'da.js' => '6149f162722148ecf3876fb10b3e737e',
+            'de.js' => '8cb4b9f7f1c94b051d781acb3da4d0d5',
+            'el.js' => 'dcd0296a2b66bea7eb4014c5e499ae53',
+            'es.js' => '438ea428f82d61c1ed95eaed346f97dc',
+            'fa.js' => 'e64696a278069b4ea22bd952aaadfcaf',
+            'fi.js' => 'fcf27030ae50526ae018dcfafa692002',
+            'fr.js' => '8454709e737811f71a61c8774017da1f',
+            'fr_ca.js' => 'dd198d47e8338b4988847cf2f8f811c5',
+            'he.js' => 'ced8892be5250b25aefd41de3a23916d',
+            'hu.js' => '7efabf89b76f57212804fa31854fb6dc',
+            'is.js' => '0da0419d1bb98cd59afd434715233b54',
+            'it.js' => 'a28c251cfd0f5a8dbc65b8b84d1468cb',
+            'ja.js' => '383db7d235a1afa20b3ca79802f23919',
+            'ko.js' => '69d5c2869ae41c037aff46e60c02aec9',
+            'nb.js' => '797eb5494ea48a5365b289c17069543a',
+            'nl.js' => '2891eccd7b5c22123246970a022098c8',
+            'nn.js' => 'a48ff66d7505c209fa8ee6a27caf20a1',
+            'no.js' => '5752ac40187c94adec44113a9876ed9e',
+            'pl.js' => '59353b4a299e3b5469ed727be36495bd',
+            'pt.js' => '17255ea9f80c38ee898cd6d4b52adf04',
+            'ru.js' => 'c314078b00ff63c22709ce42e3b5ad82',
+            'sk.js' => 'b4bfbc71af3b861f0e9afbb459ebddca',
+            'sv.js' => '3cb350e825625d35ee56a240968978d5',
+            'tw.js' => '460af4c883d0599602a396ac6df2291f',
+            'zh_cn.js' => '5e66efd3b2631d9d8a4b6d465df4444a',
+          ),
+        ),
+      ),
+      'themes' => 
+      array (
+        'advanced' => 
+        array (
+          'css' => 
+          array (
+          ),
+          'images' => 
+          array (
+            'xp' => 
+            array (
+            ),
+          ),
+          'jscripts' => 
+          array (
+          ),
+          'langs' => 
+          array (
+            'ar.js' => '6602819f1c11e5dfa03aa9351b6c6ed4',
+            'ca.js' => 'fc23aa867a542b271be04c0c507cbf7a',
+            'cs.js' => 'fa05040a48ef15b534bcfd559fcc5e2a',
+            'cy.js' => '41d7e18bf59ea3656971025ce7ee2360',
+            'da.js' => '2df17219dbd20b478ddf818e782bf884',
+            'de.js' => 'dacdff80bdd36137be8c01e49f321dc0',
+            'el.js' => 'fd252d3ec3b889b64e49f156e1cce056',
+            'es.js' => '38f3298054a3c0eccef751738c29357e',
+            'fa.js' => '7cba6a1fe0a72e6d7fff260e5434d509',
+            'fi.js' => '05e023a47b125ad62b7ca756f11fca15',
+            'fr.js' => 'dbdb8ed00240c5365184125e39d1db0d',
+            'fr_ca.js' => 'db301661bb2a7e36d5a0fb287e6e2ed0',
+            'he.js' => 'b16b9eb1c62dc0bdefd65c274da9ec9e',
+            'hu.js' => '07f5bcee49de2e283f5cbaee4eaa391a',
+            'is.js' => '7ebb7ccf6298e6f223c39c75852b4a2f',
+            'it.js' => '5e517d045390ec97bd987d1f7fa55541',
+            'ja.js' => '6b3ad91960606adfb97828a7f79b5764',
+            'ko.js' => 'c922cb3ae02c588a318f75c3855866c0',
+            'nb.js' => 'd53cf8e45eb484f6ea1262d1b43ff98b',
+            'nl.js' => '2a72f399dfff3279b8796f5af6a04939',
+            'nn.js' => '0209d5f5c5f26acd1aaa495e61ac4a6a',
+            'no.js' => 'f246a2593152ca90c0849918d12bd12c',
+            'pl.js' => 'a56af438b6dd4609168f023894de62ca',
+            'pt.js' => 'e760ace435516ee6093bf9b83c7288db',
+            'pt_br.js' => '068b915ccea56b2fd1f5b6284457e5ce',
+            'ru.js' => 'f5286bf3ab6e283e096defa8bca3b21a',
+            'sk.js' => '8e9eef23292200746c3f231b4ac2c19f',
+            'sv.js' => 'e0e158d02e077f0bf8102d7a1657b5b9',
+            'tw.js' => '69e5f2fe9dae27269c4a31a8245bb2c7',
+            'zh_cn.js' => 'e9a1c3aeb41c08b7ee4bed86c3cc193b',
+          ),
+        ),
+      ),
+      'utils' => 
+      array (
+      ),
+    ),
+    'errorhandler_class.php' => 'b169b03bc392d49864077e8010abd800',
+    'poll_class.php' => '006ed3500ada715d561997ab4bd0eb5e',
+    'security_handler.php' => '5e858bf7b977021b74bfcc55c0d8f9f4',
+    'shortcuts.php' => '49ef7425046fce13b1fcef4fea3dcd63',
+    'submenus_handler.php' => 'b866789e832461178d2ab169b5158b6a',
+    'user_extended.php' => '45646ad4a16d5ceafadf6565130d226b',
+    'users.php' => 'bffb0d325569bbf3f0d946e226d834fa',
+  ),
+  $coredir['images'] => 
+  array (
+    'admin_images' => 
+    array (
+    ),
+    'avatars' => 
+    array (
+    ),
+    'banners' => 
+    array (
+      'e107.jpg' => '01982e7527b5dfab3b8634a0ab0bd75c',
+    ),
+    'download_icons' => 
+    array (
+      'admin.png' => 'a7376ea540f3ca4f721909bd0e6ae71b',
+      'icon1.png' => 'e931689a5df4fc129cb7edf515504411',
+      'icon2.png' => '861ef3bb6203bb98533f5e4ad01ead5e',
+      'icon3.png' => '7178378df49945353c4cf6cd5e0f8622',
+      'icon4.png' => '3f56677de2890d6db093b0091f8e5e35',
+      'icon5.png' => '62de66653d9f686f7087ee7807fdcfd8',
+      'star2.gif' => '6cb9803a392f283aa7761169df820809',
+      'star4.gif' => '20c59fcebfc2ad7f416afa46752ec89f',
+    ),
+    'emotes' => 
+    array (
+      'default' => 
+      array (
+      ),
+    ),
+    'emoticons' => 
+    array (
+      'alien.png' => '6974b00de984da10b297e7fa9e628afa',
+      'amazed.png' => 'c283684df103a5e20700f96a5f41cb3f',
+      'angry.png' => '5ee786d3503d667e3f31682f1d7b37fa',
+      'biglaugh.png' => '113ab7a2958863073fd293f201b2b7ab',
+      'cheesey.png' => 'ce2406a7c0f680fee7a4980f2f01759b',
+      'confused.png' => 'ce8d57a08d36ae2651fe9a3c36e7ccae',
+      'cry.png' => 'af9f652ec6b891840fa16419b487b590',
+      'dead.png' => '769a5a9cf3fec9ba2025e68a0694ddbc',
+      'dodge.png' => '263141e145f83250115d57a384df93de',
+      'frown.png' => '36cbe1f5dd7d96e4555716391dc26ecd',
+      'gah.png' => 'ed1291107ee075f2878e046116ec8b6b',
+      'grin.png' => '2eaf0c22aab303d555b937331d54de3a',
+      'heart.png' => 'f481cd586397523f5a049ab0e3bb8b6c',
+      'idea.png' => 'efdc92d75376071b4f26bc4d9079504a',
+      'ill.png' => 'f31128acc9a7fcee11364906a62f99a4',
+      'mad.png' => 'cc8e3a28a0fb31ff8835976cadb56438',
+      'mistrust.png' => 'b8d139dac005d271ed1b772293be3004',
+      'neutral.png' => '387cd29b21d0eceab935d3fb161dc1f3',
+      'question.png' => '21d92683bb918283efdc68636a5249b2',
+      'rolleyes.png' => '9f7d79a73089c2080e2bf1023507ab72',
+      'sad.png' => '0e66d4ab21cf0010c9a6e2ffc94795ef',
+      'shades.png' => '2bc442022d4bb9b99850e4fb7c0919ec',
+      'shy.png' => '7d1fa9f1ebacd3bea124648efbcac26c',
+      'smile.png' => '98412834fb8063733c819817150a6706',
+      'special.png' => 'e802a5e499d0794ffc2e93c4eedb5f4c',
+      'suprised.png' => 'a3813e582897e99a5f5980bc6048567a',
+      'template.png' => '190417a4630f9e46eaa58eb782607fc5',
+      'template1.png' => '3b8aeab390660d69fce24f4628f0e0e7',
+      'template2.png' => '42f0eac79e6fc87adf652da6e3c0bf3f',
+      'tongue.png' => 'cd2b96e084ef3df7ab15a366e2bb728e',
+      'wink.png' => '4b057effb0ec0a0c38cc9267adc8e535',
+    ),
+    'fileinspector' => 
+    array (
+    ),
+    'filemanager' => 
+    array (
+    ),
+    'forum' => 
+    array (
+      'admin.png' => 'cdd0a7cbc97c39ceba3bae3bdc01eda2',
+      'admin_delete.png' => '707ddc11a86975090610a76e8ad01923',
+      'admin_edit.png' => 'a383175b504d64e64a84a21dda5c1619',
+      'admin_lock.png' => '744c74fecf65bd64d4ee22681cf6bd11',
+      'admin_move.png' => 'c892805676f983c34dbf308eeb2627c7',
+      'admin_stick.png' => 'ef0bc1380cdbd26118c6c53272e46af6',
+      'admin_unlock.png' => '1818d0d48dfe5f76c8bf3cee9d9e949c',
+      'admin_unstick.png' => '8b57798a150aff163c35a9e2a7c1ff62',
+      'aim.png' => 'bfd4c59a6cc8e1bb380520147657e58a',
+      'announce.png' => '51274830e593a079d57c3213da0b97ab',
+      'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4',
+      'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0',
+      'e.png' => '797612f8767a25e9a934580f7d778ef5',
+      'edit.png' => 'dc9067455b48da0bbc50993a4217eedd',
+      'email.png' => 'd954a0e84dcb099a5ece71ff181650db',
+      'fcap.png' => '3d1b365a597132548eb9635b6bca040d',
+      'fcap2.png' => '5f6f45697bc185d51f2c06d904642aad',
+      'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9',
+      'icq.png' => '3ab7fe8b2bfcd5d1bc376caaa7d01969',
+      'lev1.png' => '6f459327ecc4db1418087664ec99cd0d',
+      'lev10.png' => '00fb85385b347b832cce42195c203000',
+      'lev2.png' => '9c348bddca193d020328b9910a5618ef',
+      'lev3.png' => 'c5baa56ed9d682b28f1ca823f75b69e6',
+      'lev4.png' => '29a7bbedc1bfd1d7a36ccb6b4e679baf',
+      'lev5.png' => 'de0edacf89d8013ec4d63619b0363abb',
+      'lev6.png' => 'c939b5600c78d4f679fa1892f9b57a63',
+      'lev7.png' => '57442dff53452b993d10397a393415e4',
+      'lev8.png' => '6ab02457fabe0c8951b51c80a47ebb5e',
+      'lev9.png' => '5197a5949253e509e4994cb2cbc0dc0d',
+      'main_admin.png' => 'cfdb4442feb26d0031828a0f7424f6fd',
+      'moderator.png' => '5c1772259c00d8aca7eda2bac696a826',
+      'msn.png' => 'd1613fee04df9ac3bca9d2d0cceb0c7f',
+      'new.png' => '2bbd79241cf8036164e9965055b6f8b3',
+      'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad',
+      'new_small.png' => 'df5d599ecd2bdcc93d576d552b71a54c',
+      'newthread.png' => '26fcf53b08097e354ef4d3516fb64c71',
+      'newthread_alt.png' => '286f65b22c67f8edc8caabeb207acbd1',
+      'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6',
+      'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983',
+      'nonew_small.png' => '2544ba225c65f82c7788b003edb2d1fe',
+      'pm.png' => '75d5f1434923e1afa54f93dce494ba96',
+      'post.png' => '5212304c8b38fb4033ddf691fd7b77ba',
+      'post2.png' => '0f6cfe51518affb7a6baac798abd907b',
+      'profile.png' => 'ed21e84603c3bcf82eb1820235c36075',
+      'quote.png' => '579d14bfb1faabf191272938fae3ab65',
+      'reply.png' => 'b260ec33dee1736c5a258567d117eb69',
+      'reply_alt.png' => 'cfe83ef2927d9b7819a20fa62837a139',
+      'report.png' => 'f5e4ecc39864c5a8a66cbc3cac33c3e9',
+      'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20',
+      'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8',
+      'template1.png' => 'feeb5c3f76438732948137e771def211',
+      'template2.png' => '56b7b1d54b872c29042e523c9c043c63',
+      'template3.png' => '66096ef11a4734f52cf06a624786678f',
+      'template4.png' => 'f81e1772495061820f50ed16e489d7b2',
+      'template5.png' => 'f5213d718fe9ad02d6040111c827e8ee',
+      'template6.png' => 'f8319c599737e975bd05ad1890f77725',
+      'template7.png' => 'a1d4f847a68fb991a1126d5c31bda6e5',
+      'website.png' => '568b5e9dcc6fcc5067209e9390297162',
+    ),
+    'generic' => 
+    array (
+      'English' => 
+      array (
+        'but_create.png' => 'fdd815c97c1f2b7cb6fbd579abd72937',
+        'but_delete.png' => '7d0a9a0845029855b1ee3a2df49150f2',
+      ),
+      'bbcode' => 
+      array (
+      ),
+      'dark' => 
+      array (
+      ),
+      'lite' => 
+      array (
+      ),
+      'access.png' => 'f32777222ff51a9d7717a5d66c10417d',
+      'admin.gif' => 'de326ebb9129598abcd207aeacbca61c',
+      'aim.png' => 'c4c641053830a0b470763991e7e1b343',
+      'article.png' => '4c1af0ea92374fcd32eb086f1e63d51b',
+      'attach1.png' => '3f24d017495d3e59a8a18de11a23f63c',
+      'banned.gif' => 'e944e98fc61c72d541437d58309d22d6',
+      'bday.png' => 'b91ccd6511a34855d3da5ec55178ef32',
+      'blankbutton.png' => '32718a34c4e4c62290e5dea6399aaf0c',
+      'blocked.png' => '1227a11750b236543697c6b1f493951c',
+      'broken.png' => 'ded230fd8afbd01c8647e287b78232fe',
+      'chatlink.png' => 'b9579a8c1af6be726547edfc5cfc6eaf',
+      'delete.png' => 'bbffdfd37ba4270e862a73d93b81769b',
+      'down.gif' => '841d5d013c86f7cd61e06b978c5c65a2',
+      'down.png' => 'd94fedebe97edf504f4e3611a831d2c2',
+      'download.png' => 'd121e11e2b01e117e12ca1d9d4bfc8da',
+      'download2.png' => '3fb794a0407283c91fa0f138f26722cb',
+      'e107.gif' => 'fc919304a3df80991ec801f39baf3ba5',
+      'e107.png' => '16751559410e5d868409898522df2cb4',
+      'edit.png' => 'f009b77ab253590ace79a70cfeff566c',
+      'email.png' => '36e771c8c0f3c5508cfb06d09a73133d',
+      'extand2_ico.png' => 'd6cab6c391859427df70a1cf73a3f8b3',
+      'extand_ico.png' => 'ef0dad81c4551e1cf4e5b92cc2682a42',
+      'friend.gif' => 'b86a05be607fc371d4af747e6fed3991',
+      'hme.png' => '18b3c9241db5836b5d5071ba45cb57a6',
+      'hme2.png' => 'e7b5ced50260f1ae8d2fc27d11305fa0',
+      'icq.png' => 'baba3fba52f76960e0917996509849ad',
+      'installed.png' => '13e75fe21dbe487dfe4a70fd8b6a4b8e',
+      'left.gif' => 'a33e2c78aec1bb670527e699bf09142d',
+      'link.png' => '9e921ccc10fdb20e1272441a14bec6cb',
+      'location.png' => 'b47fcee2cfd5e9d8428dbf0bd2279f43',
+      'mainadmin.gif' => 'e2ea0c3a07ad3360b6dc3565fadb92c9',
+      'move.png' => 'c38620b0e49020a0e509bb396629d98b',
+      'msn.png' => 'cb6f3038694b1050815a3c0faea7105c',
+      'new.png' => '19c5797308bdc437a7e612e0e0c36afe',
+      'new_comments.png' => '02c972790cfb529b39567fb2d813fbe4',
+      'newsdelete.png' => 'b108358657ce78bcd8a32bea790c5cef',
+      'newsedit.png' => '7905b143e1a8614f58deba888cfa1831',
+      'noaccess.png' => '1747d86cee75b592d74aa7657f37785e',
+      'noinstall.png' => 'f89fe8f057694f93e4e163e4daf3de2e',
+      'nonew_comments.png' => '7611b72fa10b37d8b25b42b82b7014d5',
+      'not_verified.gif' => '157e88132e5f7e6df5c56857177b5938',
+      'off.gif' => 'b7939422edcdf36818e632fba7fa4c42',
+      'off.png' => '211ebf7f9f317c20c24f34267f4ffe2d',
+      'placeholder.png' => 'b1b16f1feb58cc1c262f4728e710bce4',
+      'plugin.png' => '918cf0e41e6c810a36ddfd88b1571e96',
+      'printer.gif' => '8ac26fe4699decd7a018fcb9887ae04a',
+      'right.gif' => '59521255e9b42ecddf5b5c196db3acd5',
+      'rname.png' => 'd9602be8c82e8b9a439224b659ebbe40',
+      'star1.gif' => 'c92689cfe71f7e6dafccb9f54664ab45',
+      'star2.gif' => '6cb9803a392f283aa7761169df820809',
+      'star3.gif' => 'fde817afe8d962061bfe6e7c1d36d784',
+      'star4.gif' => '20c59fcebfc2ad7f416afa46752ec89f',
+      'uninstalled.png' => '67b9d067ee7eccc0f6732d0e709413c9',
+      'up.gif' => '733fe173358fbd482b5745a3e6b2bf3c',
+      'up.png' => '2bfaa32e6b6c45767ff67961d7f6a758',
+      'upgrade.png' => '8a2a682aa0a1713cb627275c1e371714',
+      'user.png' => '2a791be6fdba60bd8ef16d04faf4e789',
+    ),
+    'icons' => 
+    array (
+    ),
+    'install' => 
+    array (
+      'install1.png' => 'c5cdc95dcb566d3a06dd9491773cb915',
+      'install2.png' => '3a4afe78d9167935869fd62c3e32e5c7',
+    ),
+    'link_icons' => 
+    array (
+      'admin.png' => 'a7376ea540f3ca4f721909bd0e6ae71b',
+      'bullet2.gif' => '5fea13d481fc903ce05bfed57341e1c1',
+      'icon1.png' => 'e931689a5df4fc129cb7edf515504411',
+      'icon2.png' => '861ef3bb6203bb98533f5e4ad01ead5e',
+      'icon3.png' => '7178378df49945353c4cf6cd5e0f8622',
+      'icon4.png' => '3f56677de2890d6db093b0091f8e5e35',
+      'icon5.png' => '62de66653d9f686f7087ee7807fdcfd8',
+      'star2.gif' => '6cb9803a392f283aa7761169df820809',
+      'star4.gif' => '20c59fcebfc2ad7f416afa46752ec89f',
+    ),
+    'log' => 
+    array (
+      'beos.png' => 'e81a347cde7806d403369acf5125c4fe',
+      'explorer.png' => 'ad4b2066d1a13c4c3f01771684de08bc',
+      'firebird.png' => 'aa7ab3a68f2321baccdda8c13d2ba051',
+      'firefox.png' => '2b1b1ceb660b824b9dbffd7eeacf79bb',
+      'freebsd.png' => '0cc1da48e638ee3549a53c459a0beaf1',
+      'konqueror.png' => '086c6a2215282b93a0d827b9208709d8',
+      'linux.png' => '336a3e40452886a7bfac345e8a261138',
+      'lynx.png' => 'bf674cc89d48c3edca70148befacfc0c',
+      'mac.png' => '3b5ceead951265dc1648d172fbdd6461',
+      'mozilla.png' => '3bac9ec175a9a1210fe69133658e7a79',
+      'netbsd.png' => '0cc1da48e638ee3549a53c459a0beaf1',
+      'netcaptor.png' => '2e4d9005519f6ce2b393dfd5957b16f8',
+      'netscape.png' => 'ef183a5383deb9cf83d90cde42efb24d',
+      'openbsd.png' => '36a1043bb8aacd3ea0a85c5f4de3130a',
+      'opera.png' => '8892071cd4ecb31298ec08373d1491dc',
+      'robot.png' => '4af563ba21dd39f7d875f4e4af4f3d60',
+      'spiders.png' => 'd74d7cf44e339255fbf66d5414f14db1',
+      'sunos.png' => '455c936a67729dd85ebec12b9c6139eb',
+      'unix.png' => 'eeddedaa7da41673f0ef6d3e60876dc0',
+      'unknown.png' => 'ff386748bec43130392f50ddf6743d57',
+      'unspecified.png' => 'ff386748bec43130392f50ddf6743d57',
+      'web%20indexing%20robot.png' => '4af563ba21dd39f7d875f4e4af4f3d60',
+      'windows.png' => '693b0f409fb73b8c688582cbf231de41',
+    ),
+    'newsicons' => 
+    array (
+      'admin.png' => 'a7376ea540f3ca4f721909bd0e6ae71b',
+      'icon1.png' => 'e931689a5df4fc129cb7edf515504411',
+      'icon2.png' => '861ef3bb6203bb98533f5e4ad01ead5e',
+      'icon3.png' => '7178378df49945353c4cf6cd5e0f8622',
+      'icon4.png' => '3f56677de2890d6db093b0091f8e5e35',
+      'icon5.png' => '62de66653d9f686f7087ee7807fdcfd8',
+      'null.txt' => 'd41d8cd98f00b204e9800998ecf8427e',
+    ),
+    'newspost_images' => 
+    array (
+    ),
+    'rate' => 
+    array (
+      'box' => 
+      array (
+      ),
+      'dark' => 
+      array (
+      ),
+      'lite' => 
+      array (
+      ),
+      '1.png' => '4b0844d8edcb6f21a30ccd614ce1f681',
+      '2.png' => '78f9dddde6747afdfe4d2ae74809c48b',
+      '3.png' => '0d94d295b5f76d02a3667f314f2e2e16',
+      '4.png' => '6bec72f755855b0f4bcad657627f2c8b',
+      '5.png' => 'f5fcf4a03e0e8a873421453fe9c8faa6',
+      '6.png' => '5f5e7867a7ab294c254490a97dbdb5e0',
+      '7.png' => '2c7386cf7b32d110795ede44b0649db1',
+      '8.png' => 'd831f36e9da9569a3ee9fc76ca744ab8',
+      '9.png' => '06a1a321bc60f7964ff49201187b6d6e',
+      'empty.png' => 'fba656dd42a4642df933475f41555579',
+    ),
+    'user_icons' => 
+    array (
+    ),
+    'logo3.png' => 'd4969f3e493bbf085b7b04db22fb66c3',
+  ),
+  'e107_install' => 
+  array (
+    'images' => 
+    array (
+      '01_bg.gif' => '50f03651c070e4138c97a4a7ee9e5339',
+      '01_bodybg.jpg' => 'ca5f9a092c397986fa10d5990023ab25',
+      '01_footer.jpg' => 'cf2f00b3e5a2aff05e70e728eb225cb4',
+      '01_hdot.gif' => '945bc76d6f25d2a32fafb0abe1933e1d',
+      '01_header01.jpg' => 'cb8f84e1d43a127604ea9b244ecab97e',
+      'bar.jpg' => 'deb2fd16258227f5e99fee0074b764af',
+      'bar2.gif' => 'eb85624e746f91fd33511783cccc92a6',
+      'bar2edge.gif' => '6d273a53798e532091bd6354f1e39c60',
+      'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+      'bottom.png' => '46e798abeb638c4f9540973d239b10e7',
+      'bottomleft.png' => '3db4e800cc8add7f4f360c5f055aba49',
+      'bottomright.png' => '28a54110d855fd47380cf094d6b7b169',
+      'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739',
+      'bullet2.gif' => '5fea13d481fc903ce05bfed57341e1c1',
+      'button.png' => '69918234a9caea763d1c66781e50fe34',
+      'cap1.png' => 'c58d5a7a23bb01572a51ca806cf244e0',
+      'capdark.png' => '968732d5e5ddfa288f59af2c47f5d4d7',
+      'capleft.png' => 'a1af1a726e1aee5e6e9822b9ccba1a48',
+      'caplight.png' => '159e80e78ab67ceb935eb084d8dc51ff',
+      'capright.png' => '57e7b70a495978f5de9575e826cd7878',
+      'captransition.png' => 'f762ef589c33ff9695bf4731eaf23738',
+      'fcap.png' => 'fabf58910351f1f742dee108b60517b8',
+      'fcap2.png' => '777e56bcaf32e29ad505df49f3cb6019',
+      'left.png' => 'a7755093080be75e9430072bd3bb32b3',
+      'pspbrwse.jbf' => 'e84c6e90a5babd91ff1705cdd904a60c',
+      'right.png' => '1dc657e1d9065920653132f3a85d77ed',
+      'temp.png' => '35e34c98922cf2df737eef3cec806af2',
+      'top.png' => '75b4e22fcbe8059bf217690e08c265ac',
+      'topleft.png' => '8b45a5185fa619c3d336e1ceb618bc81',
+      'topright.png' => '1c6d6e49a6d9d173ec12f2baed2f45a8',
+    ),
+    'defaults.php' => 'd74f7f56a35eaba3a446d0d7b9ece61e',
+    'forms_class.php' => 'cab82e1076617e73b142f89e589e6302',
+    'index.html' => 'd41d8cd98f00b204e9800998ecf8427e',
+    'install_template_class.php' => '85720230062e45ca3e6c190a865db9a1',
+    'installer_handling_class.php' => '43abe84e4f29d084e5aeb58f048585b3',
+    'installer_template.html' => '7c5c280e54ef3ffb337143513dbefdcf',
+    'style.css' => '78939dd07a01f44a78bb95f58e7999e5',
+    'writable_file_list.txt' => '65391cea1b3218eee4fc5e3535c4b6eb',
+  ),
+  $coredir['languages'] => 
+  array (
+    'Danish' => 
+    array (
+      'lan_install.php' => '7106553eaeb91ce1f59d0108dac9d579',
+    ),
+    'Dutch' => 
+    array (
+      'lan_install.php' => '1670683dbb0fb0d17f932ae81940a416',
+    ),
+    'English' => 
+    array (
+      'admin' => 
+      array (
+        'help' => 
+        array (
+        ),
+        'lan_admin.php.bak' => 'c8bd5eb16d7834de1975b2ac3cd301e3',
+        'lan_article.php' => '78d8dba28058eb99e32fc670fed68f34',
+        'lan_chatbox.php' => 'dc7462a5fb63958528d842662b0c0d4c',
+        'lan_content.php' => '4b4dd166785d89b717ca41602e4908de',
+        'lan_custommenu.php' => 'fca295a0aaca7e6dc6ea2b07d3ab8474',
+        'lan_download_category.php' => '868e2a17778c821e21579b28c8e8db85',
+        'lan_forum.php' => '3ab28d049e7ef2900dd601deb02ab693',
+        'lan_forum_conf.php' => '208dd010683d2894d17ab734d712a270',
+        'lan_link_category.php' => '4dff35a95718cc5cffee64fc635dc19e',
+        'lan_log.php' => '6bf26c44f7553beeb8ce574de27dc29e',
+        'lan_news_category.php' => '5337d8c36701776b22c27182a258e690',
+        'lan_newsfeed.php' => 'bba9d1991b304ee031ac8f4339aa6a61',
+        'lan_poll.php' => '9bedcde5926715eede2f03afcff20a67',
+        'lan_submenusgen.php' => '40af0cbb4906703d1fc5d29d7f2790e4',
+        'lan_submitnews.php' => '595ca7b58df223022b3f7bd44e8238f4',
+        'lan_theme_prev.php' => '003c8edea2f4b757347a231cd61868ba',
+        'lan_theme_prev.phpOLD' => 'af65c38f8c4bc38654b6fcddc83b2a29',
+      ),
+      'lan_article.php' => '7cb2200110e779d2be72b32b5adae9e4',
+      'lan_chat.php' => '1216025ec3eb4295cb7b7920d9c6d5f4',
+      'lan_content.php' => '175020e7d6e637c7c560c7b710e7da67',
+      'lan_forum.php' => 'ca5e1c87b06b0b4c76aa17222a2049b9',
+      'lan_forum_post.php' => 'e354153441043fabd0cdd6ed99be37a7',
+      'lan_forum_viewforum.php' => 'ae655efbf1d88f64a6f9436894767a64',
+      'lan_forum_viewtopic.php' => 'dc93aa81babfe0ee610d559d70f8681a',
+      'lan_install.php' => '6182909e4053d2da395298e4ca73323a',
+      'lan_oldpolls.php' => '64379ca9ff42aaf1873b93bc41627fa7',
+      'lan_sitemap.php' => '7d926f3eb3c81ed747a6682d4a9048a5',
+      'lan_stats.php' => 'f9058e0cd84a315f694618e2edf94d94',
+    ),
+    'Finnish' => 
+    array (
+      'lan_install.php' => '0f5a7f1603a519ee4456ec9fa1e7f8f9',
+    ),
+    'French' => 
+    array (
+      'lan_install.php' => '74ad3fd72cca13f1968785a89b6a09ad',
+    ),
+    'German' => 
+    array (
+      'lan_install.php' => 'c0e03443e52be1a6492e5b65776df1aa',
+    ),
+    'Hebrew' => 
+    array (
+      'lan_install.php' => '6f5fe3b0b3ba23463026f873453c98ab',
+    ),
+    'Portugese' => 
+    array (
+      'lan_install.php' => 'bfd10a1c0d92d1d5094a63d64aa9a809',
+    ),
+    'Portugese - Brazilian' => 
+    array (
+      'lan_install.php' => '4dcb400544c4cf60bf640d2418e15908',
+    ),
+    'Russian' => 
+    array (
+      'lan_install.php' => 'a99ce749efb53953f0121c71a88c9ae4',
+    ),
+  ),
+  $coredir['plugins'] => 
+  array (
+    'admin_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '9cc7dc759d47e98f86d2223097fb6dd8',
+      ),
+      '.#admin_menu.php.1.1' => '996aec68e661d293d168721272bdeb79',
+    ),
+    'alt_auth' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+        'ldap_auth_English.php' => '8553f2510a8f44e048e75b0caad969f6',
+      ),
+    ),
+    'alt_news' => 
+    array (
+    ),
+    'articles_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '559ed80821be94dbbae47b244dbd837d',
+      ),
+      'articles_menu.php' => 'fd15a3ca2e31528a95fc99184e440f63',
+      'articles_menu.phpOLD' => '879325102370b1fe12e4d7ccdfbb02a2',
+      'config.php' => '00b67a915d74fc094e077ea4466f7c2f',
+      'config.phpMAIN' => 'e72301f4e60ede3df654b0a32ffd07c1',
+    ),
+    'backend_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '2ceeff0b4fd187b6bc41f2c4112bec77',
+      ),
+      'backend_menu.php' => '3518985b836c9d8a0ba41966452d704d',
+    ),
+    'banner_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'blogcalendar_menu' => 
+    array (
+      'languages' => 
+      array (
+        'Dutch.php' => 'a5a25231f132dfe4b7f691e4ffeb684f',
+      ),
+    ),
+    'calendar_menu' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+      'search' => 
+      array (
+      ),
+    ),
+    'chatbox_menu' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+        'English' => 
+        array (
+        ),
+        'English.php' => '89c8271c28118aae2dbbe8f35adc9f9f',
+      ),
+      'search' => 
+      array (
+      ),
+    ),
+    'clock_menu' => 
+    array (
+      'languages' => 
+      array (
+        'admin' => 
+        array (
+        ),
+      ),
+    ),
+    'comment_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'compliance_menu' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'content' => 
+    array (
+      'handlers' => 
+      array (
+      ),
+      'images' => 
+      array (
+        'cat' => 
+        array (
+          16 => 
+          array (
+          ),
+          48 => 
+          array (
+          ),
+        ),
+        'file' => 
+        array (
+          'tmp' => 
+          array (
+          ),
+        ),
+        'icon' => 
+        array (
+          'tmp' => 
+          array (
+          ),
+        ),
+        'image' => 
+        array (
+          'tmp' => 
+          array (
+          ),
+        ),
+      ),
+      'languages' => 
+      array (
+        'English' => 
+        array (
+        ),
+      ),
+      'menus' => 
+      array (
+      ),
+      'search' => 
+      array (
+      ),
+      'templates' => 
+      array (
+        'default' => 
+        array (
+        ),
+      ),
+    ),
+    'counter_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'custom' => 
+    array (
+      'Readme.txt' => '2a5a677029c6a1ff8f31f3cd24452386',
+    ),
+    'custompages' => 
+    array (
+      'Readme.txt' => 'fe1235ad725e996d9f123fdb4e4c13e8',
+    ),
+    'fader_menu' => 
+    array (
+      'images' => 
+      array (
+        'logo.png' => 'bcaf473988c4b267a7dcf56949a452eb',
+      ),
+      'languages' => 
+      array (
+        'English.php' => '33f3cf5b3c8706af602ed4cb3c81db9c',
+      ),
+      'config.php' => '0aabe62b3e1611c441e9a2c2114cd5cf',
+      'fader_menu.php' => '66caa671ec5bafd3fe27b4d2b5e4f6d9',
+      'plugin.php' => '242e63190113a2aa45358d7cb3b7535c',
+    ),
+    'featurebox' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+      'templates' => 
+      array (
+      ),
+    ),
+    'forum' => 
+    array (
+      'images' => 
+      array (
+        'dark' => 
+        array (
+        ),
+        'lite' => 
+        array (
+        ),
+      ),
+      'languages' => 
+      array (
+        'English' => 
+        array (
+        ),
+      ),
+      'search' => 
+      array (
+      ),
+      'templates' => 
+      array (
+      ),
+    ),
+    'gsitemap' => 
+    array (
+      'images' => 
+      array (
+      ),
+    ),
+    'headlines_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '2829e43dff89716317f5e07b2c9be60b',
+      ),
+      'headlines_menu.php' => 'ab3e7718b4bdc0692766939d1cce00bc',
+    ),
+    'integrity_check' => 
+    array (
+      'crc' => 
+      array (
+        'core_v0.603brevision #6.crc.gz' => '951d6ff1eb9b511e9de413fda1025fd0',
+        'core_v0.604b0.crc.gz' => '1b1d32dcd6b5748f5f61c1ae3ed75f60',
+        'core_v0.605b0.crc.gz' => 'cfcbd7b968e01b4d7085b993c2edc2fd',
+        'core_v0.606b0.crc.gz' => 'a507b39e47b6bd4da410800674f18b0e',
+        'core_v0.607b0.crc.gz' => 'd462a23b24951c04630d98fbdaaa303e',
+        'core_v0.608b0.crc.gz' => '8d28c1a7ed767f3b1f37fc2e5d42a7c4',
+        'core_v0.609b0.crc.gz' => '619d9fb859dcebee7335b107df732989',
+        'core_v0.610b0.crc.gz' => '40b629b94d1942330c3d6a00d9eb3928',
+        'core_v0.611b0.crc.gz' => 'd2fa16d9224fe1582e926dab65fd7974',
+        'core_v0.612b0.crc.gz' => '417f80d506105f093852f6ac444401d8',
+        'core_v0.613b0.crc.gz' => '10ee72857c69cee04b32c9713d0854ee',
+        'core_v0.614b0.crc.gz' => '8dc89467864a96ba78930ed1a8be086f',
+        'core_v0.616b0.crc.gz' => 'ff549280c337968ac0ba94797a8713c6',
+        'core_v0.617b20040917.crc.gz' => '772181b8a467cb436be8e70b5d792e36',
+      ),
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+        'German.php' => 'e89edc419022cf2407fb101d3eab899f',
+      ),
+      'do_core_file.php' => 'fac13bd2f065a031c59841ab4cb7074e',
+      'integrity_check.crc.gz' => 'd5cec3024c3e3a0be2cca541bd60d179',
+      'integrity_check.php' => '49d5a8fa37a78f8716cb5e86d77337c0',
+    ),
+    'lastseen' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'links_page' => 
+    array (
+      'cat_images' => 
+      array (
+      ),
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+      'link_images' => 
+      array (
+      ),
+      'search' => 
+      array (
+      ),
+    ),
+    'linkwords' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'list_new' => 
+    array (
+      'icon' => 
+      array (
+      ),
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+      'section' => 
+      array (
+      ),
+      'new.php' => '8c374be27e41a4318f68e707021ff984',
+    ),
+    'log' => 
+    array (
+      'images' => 
+      array (
+        'trans.gif' => '39bc952559e5a8f4e84ba035fb2f7390',
+      ),
+      'languages' => 
+      array (
+        'admin' => 
+        array (
+        ),
+      ),
+      'logs' => 
+      array (
+      ),
+    ),
+    'login_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'newforumposts_main' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+      'config.php' => '276457a4bf2fa83ea6562797782310a6',
+    ),
+    'newforumposts_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '693095a9bd834689047de027f5e0cbbd',
+      ),
+      'config.php' => 'f01b9da7574412da71f6182494f33e1a',
+      'newforumposts_menu.php' => '2cccc461e0dcea560a8d60cbf6923cb8',
+    ),
+    'newsfeed' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+      'templates' => 
+      array (
+      ),
+    ),
+    'newsletter' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'online_extended_menu' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'online_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'other_news_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'pdf' => 
+    array (
+      'font' => 
+      array (
+        'makefont' => 
+        array (
+        ),
+      ),
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'pm' => 
+    array (
+      'attachments' => 
+      array (
+      ),
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+        'admin' => 
+        array (
+        ),
+      ),
+    ),
+    'pm_menu' => 
+    array (
+      'images' => 
+      array (
+        'icon_pm.png' => '2912f05d43fd9f1aa7e5561f01f03d49',
+        'new.png' => '2bbd79241cf8036164e9965055b6f8b3',
+        'newpm.gif' => '4d16f5fbaa8e76067053c8c901972bc4',
+        'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6',
+      ),
+      'languages' => 
+      array (
+        'admin' => 
+        array (
+          'Dutch.php' => 'deaec186998741c967926a2b4a2c8883',
+          'English.php' => '48e55f333c6cce298d8d42d23ac1ea86',
+          'French.php' => 'afada3c05cd276a42b3ea2c0143cc4eb',
+          'Hebrew.php' => '99a11d649976ca09269ba710331692a1',
+          'Hungarian.php' => '24c9bee3429ab4cb0310dbf53bdf46a7',
+          'Lithuanian.php' => '46ff3c0d24248c463bc1d4565ed8ae60',
+          'Swedish.php' => '36db180754f4fc798d801b809afb30c6',
+        ),
+        'Danish.php' => '0fd270f1290f030df0923b51c8e758d5',
+        'Dutch.php' => '70c30863dc1e573e57b29e7ea833fe86',
+        'English.php' => '3a1f134f8dfab0d6e9bd01affac61360',
+        'French.php' => '95edb5e8ee1adbef13968f678013a1c7',
+        'German.php' => '9777ec58ad0ba9749bf67a6fc90aad92',
+        'Hebrew.php' => 'f924ee08fd163ca1b5d8a0971c37350a',
+        'Hungarian.php' => '0bc057bb44fe3472db8782edbba65152',
+        'Icelandic.php' => 'fd660d11befa4952c4389e119311552c',
+        'Italian.php' => '5b1d9585320a00d8dc302c6b1d152dd2',
+        'Lithuanian.php' => '6de02c868fcf76f6eafa4d286139f51e',
+        'Swedish.php' => '89c03081c1f1bd395d8ef118034205f3',
+        'Turkish.php' => '8c3f69574f0a1b7967942bcccd81ce63',
+      ),
+      'parse' => 
+      array (
+        'parse_sendpm.php' => '684f65074a3c163bff33ceee2f60d77f',
+      ),
+      'help.php' => '05353ac9d91d7a289b949cd221209391',
+      'parser.php' => 'a3b9072ded8b976ec8e6a39fb1ec62a1',
+      'plugin.php' => 'e00be629dba8699c216a32717499e4c6',
+      'pm.php' => '854e2027e899d6fe2f61c34b4ec7c231',
+      'pm_class.php' => 'ceb78bfec4fa5d4858f3c6bdd96518f6',
+      'pm_conf.php' => '6356e8c2401e0f56bf3c2d765fc22c7e',
+      'pm_finduser.php' => 'f0f76ad2058a553e71565a514d5e5792',
+      'pm_inc.php' => '884be6eeb255e9896af2df673ed11838',
+      'pm_menu.php' => 'c0cb0fdf9a22d73ec4c296181a63bb9b',
+      'pm_readme.txt' => 'f8a601545af5083601733d9b2f317185',
+      'pm_sql.php' => '3bf115628a81235de959588024d9b06d',
+    ),
+    'poll' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+      'search' => 
+      array (
+      ),
+      'templates' => 
+      array (
+      ),
+    ),
+    'poll_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '75af431da617ae283526e043ba4f3c02',
+      ),
+      'poll_menu.php' => 'c2da89e8e0917e9fdc6d472c8427eade',
+    ),
+    'powered_by_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'review_menu' => 
+    array (
+      'languages' => 
+      array (
+        'English.php' => '7593a048368d0addb3e47bddc9026067',
+      ),
+      'config.php' => '3775094f836031f6027990847d9ebef2',
+      'review_menu.php' => '70f03130e54f35d210a4eb1c8419ce51',
+    ),
+    'rss_menu' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'search_menu' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'sitebutton_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'theme_layout' => 
+    array (
+      'images' => 
+      array (
+        'icon.png' => 'ff19586caf182a0c7cf7cfbc1a074de4',
+      ),
+      'layouts' => 
+      array (
+        'layout1_chatbox.php' => 'b1db2075c5c7ea9f9b2c4f1597d08435',
+        'layout1_comment.php' => 'ff0e3640109d2a025e1faf2e5581ec01',
+        'layout1_forum.php' => '74047e347e584a4533319d7d0593bdb5',
+        'layout1_main.php' => 'a65dc381f0e34fa3285f09720db06442',
+        'layout1_news.php' => '6a36222bfc1e5df83753406ad14f0272',
+        'layout1_poll.php' => '7298986d8189dcb866253b8526fed945',
+      ),
+      'chatbox_layout.php' => '6e16ab5944c40af2d49a1e97bf00b0f8',
+      'comment_layout.php' => '94eae619f29d869141caad9bd75cac24',
+      'forum_layout.php' => '9e701c700316d8f2136f7343b2aa1566',
+      'help.php' => 'a9dd8718eb1cff858c8a8ea9cd430fb5',
+      'main_layout.php' => 'd348abf32cdf27bb2eb744771eea5ff7',
+      'news_layout.php' => '6d609361cfedd501e23cdd4a90cc1e27',
+      'poll_layout.php' => '327e6500d7df79f36e06c700aa413c1f',
+      'theme.php' => 'd028142e833595ed508966fc37593659',
+      'theme_layout.php' => '1ef564f5bfa15e9974c3018da2560688',
+    ),
+    'trackback' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'tree_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'userlanguage_menu' => 
+    array (
+      'languages' => 
+      array (
+      ),
+    ),
+    'usertheme_menu' => 
+    array (
+      'languages' => 
+      array (
+        'French.php' => 'd21ea52501b9efc12e86d3577cb7186f',
+        'usertheme_English.php' => '675a4f2690d5771613818338502eb4c5',
+        'usertheme_French.php' => 'd21ea52501b9efc12e86d3577cb7186f',
+      ),
+    ),
+  ),
+  $coredir['themes'] => 
+  array (
+    'blue_patriot' => 
+    array (
+      'images' => 
+      array (
+        'balloon.jpg' => '64dc97bcb2ba327399ae75905800f4e6',
+        'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199',
+        'blue_patriot_01.jpg' => '7831ce0cb8eb13b4ea1a92adbdab9d62',
+        'blue_patriot_02.jpg' => 'ac12826a6e0a05b9c070c5521161f120',
+        'blue_patriot_03.jpg' => 'c3411aaea64f1ccbd45dd412b7a2467c',
+        'blue_patriot_04.jpg' => 'ac3b851650183ac0d47b41472afcdecf',
+        'blue_patriot_05.jpg' => '0dfcd5f3553aa7e5d3df05dd13629e61',
+        'blue_patriot_06.jpg' => '15b839a9fd716900dd4cf603bff890e8',
+        'blue_patriot_07.jpg' => 'f71799048ccf41e6fc6689f3f609e2db',
+        'blue_patriot_08.jpg' => '5619bba0856394e207e8e39a6670dc50',
+        'blue_patriot_09.jpg' => 'ffec8e1466bbdc30c3c7a15e4cb7727b',
+        'blue_patriot_10.jpg' => '9f486fba3969a36958bbfc1ecb4f9851',
+        'blue_patriot_11.jpg' => '6c2c5e0ad28eb6f70775f9ee64d5b8d7',
+        'blue_patriot_12.jpg' => '5b5775e1043b999729199c4c27f43974',
+        'blue_patriot_13.jpg' => '557e9b1c1cf68dfb1b51969f6ada6fd4',
+        'blue_patriot_14.jpg' => 'bca587141e6745d02447526574e1b9c2',
+        'blue_patriot_15.jpg' => '99a9e333f4cccf0fcd79679864de9346',
+        'blue_patriot_16.jpg' => '71f45abb20a470dbb7b1f05571b9d165',
+        'blue_patriot_17.jpg' => '2955f18ffa7e16c441b17feaa3b6bcca',
+        'blue_patriot_18.jpg' => 'd7c7faf35abfd47fcd387a1745d4e5b3',
+        'blue_patriot_19.jpg' => '16f1986bb5658c5ef33916092760702c',
+        'blue_patriot_20.jpg' => '775a338453d65e0f8e6982b541ccbb95',
+        'blue_patriot_21.jpg' => 'afffe79cf460ce63991c5e85dbf116ba',
+        'blue_patriot_22.jpg' => 'd07ee234e9a0f53999ef60105591da82',
+        'blue_patriot_23.jpg' => 'd33fd108f4828402b9dbb710f29ac2b2',
+        'blue_patriot_24.jpg' => '430faa6d08785afe5254974c08407461',
+        'blue_patriot_25.jpg' => 'd005d6c8d1df0ef80cd308cecf6f8cff',
+        'blue_patriot_26.jpg' => '7f704f010bfb3fd6291a3b6a9ee465ba',
+        'blue_patriot_27.jpg' => '6852500646a0a40f845d29a9998e965d',
+        'blue_patriot_28.jpg' => '1fc8fe28545213a22cce040331db573b',
+        'blue_patriot_29.jpg' => '698df200ff09414407fcc0c84ee74926',
+        'blue_patriot_30.jpg' => 'fdd019a93a7d605d47dfa51ab6e965cc',
+        'blue_patriot_31.jpg' => '27d3aab176590dab3458102d865aed21',
+        'blue_patriot_32.jpg' => '1cee9c979aee7d52bcdf47f0fd1a1756',
+        'blue_patriot_33.jpg' => '802673dea5d6b3318392267cfbe798b4',
+        'blue_patriot_34.jpg' => '4a26464b5b3b2c4fd3621be82506bca9',
+        'blue_patriot_35.jpg' => '48f2693b73a17381db62d36836958406',
+        'blue_patriot_36.jpg' => 'abf7188d7973f01a9f255174ddfddf20',
+        'blue_patriot_37.jpg' => 'dbf963f8163715e98d74c0beb3af2d8a',
+        'blue_patriot_38.jpg' => 'a69c3868b52ceabecde8e10eed6ca0e6',
+        'blue_patriot_39.jpg' => 'd4409c49b7b9fe7ff945a25df0c90395',
+        'blue_patriot_40.jpg' => '623d4acd8692a8d5d91ced7108ec84e7',
+        'bodybg.jpg' => 'cf7b94186d42ddb69a007fe7d6a5a2bd',
+        'bullet2.gif' => 'de856ab1707989549981594c40ac0b0d',
+        'captionbg.jpg' => '3cfcfda4fa37a1dd9800bd2f8ff37b11',
+        'sm_folder.jpg' => 'f8de850ff6da330959af2431eb2b83fa',
+      ),
+      'style.css' => '4eeeebf4cc2410e55cc6d0015a7b2dcb',
+      'theme.php' => '522ceddf68bff62ff177e83d291b7b65',
+    ),
+    'clan' => 
+    array (
+      'forum' => 
+      array (
+        'admin_delete.png' => '707ddc11a86975090610a76e8ad01923',
+        'admin_edit.png' => 'a383175b504d64e64a84a21dda5c1619',
+        'admin_lock.png' => '744c74fecf65bd64d4ee22681cf6bd11',
+        'admin_move.png' => 'c892805676f983c34dbf308eeb2627c7',
+        'admin_stick.png' => 'ef0bc1380cdbd26118c6c53272e46af6',
+        'admin_unlock.png' => '1818d0d48dfe5f76c8bf3cee9d9e949c',
+        'admin_unstick.png' => '8b57798a150aff163c35a9e2a7c1ff62',
+        'announce.png' => '51274830e593a079d57c3213da0b97ab',
+        'closed.png' => '661d62b0359cece8ea019268aea90b72',
+        'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4',
+        'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0',
+        'e.png' => '5c4648034ca4494db00270b4f73cb4e9',
+        'edit.png' => '1dfc36a823e1752f2aef6fce3d4ab4d8',
+        'email.png' => 'f76baf56d637b8918f686345cd3ca7d2',
+        'fcap.png' => '35e09d61f248d03d9ae67ff46f6e5a91',
+        'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9',
+        'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8',
+        'new.png' => '63c68b98a1ebf395a58c194688665404',
+        'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad',
+        'new_small.png' => 'df5d599ecd2bdcc93d576d552b71a54c',
+        'newthread.png' => '0b580ca6d9cd6fd514c7ac3bb3b1c171',
+        'nonew.png' => '7833bd100df8495e076dfaf400d1afb3',
+        'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983',
+        'nonew_small.png' => '2544ba225c65f82c7788b003edb2d1fe',
+        'post.png' => '4abd6992f5bcb6c624ce670468ff538a',
+        'profile.png' => 'd533f49ea50c756a6f61db3ae87ae8b1',
+        'quote.png' => 'fd587e1696430999022aa2e6dd765904',
+        'reply.png' => 'f7004bc6a716839bb4e803a4f08470ce',
+        'sticky.png' => '31f95734f8ddea70f1532658cc123e24',
+        'stickyclosed.png' => '0d8232ce1f8854a81a8832560fe47d4a',
+        'website.png' => '882b8448acefe7857e31639a78acb47e',
+      ),
+      'images' => 
+      array (
+        'bar.jpg' => '699a527e29ee1fee2932255d76c095fa',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => '75b67e121016a521b1b975f3ead317a4',
+        'bullet1.gif' => '097e3c018ae655310889fa98f85be57b',
+        'bullet2.gif' => '026bd38853b2fc24353da648893737e5',
+        'cap.png' => '32a40d90d55b3fc92350e3437ec79d7e',
+        'cap2.png' => 'f56be37f5bb99b498a354762e1fac575',
+        'header.png' => '200d62810e3f06bf792e920bcdce1d30',
+        'logo.png' => 'bc9ceb041746cc1a021af2ed19002663',
+        'menubg.png' => 'c23f21ecfb2ea65d9870e155058fb5b0',
+        'topbar.png' => 'cf65e56f37871f04f3ce83337ae123e7',
+      ),
+      'style.css' => 'b9acced713fc611ec3c94abdbf5a6bcd',
+      'theme.php' => '88af12095e58d509e387eea822d36c0a',
+    ),
+    'comfort' => 
+    array (
+      'forum' => 
+      array (
+        'admin_delete.png' => '36fe015a4b8cfdbbe4b8aee8b7b563a7',
+        'admin_edit.png' => 'c03274b7f9e16ac1cb702ae8db849f7e',
+        'admin_lock.png' => 'e77b92a1f5877b64b9ccad7cf30b798d',
+        'admin_move.png' => '53724301fb9a5f735d47986feabaa5c2',
+        'admin_stick.png' => 'a3f08da8ab9eda3985365793ff91caf5',
+        'admin_unlock.png' => 'abbe887ff2c94e0fc7ccc6ec76e33e2f',
+        'admin_unstick.png' => '61807d0afc335e394bd9050157eae4c5',
+        'announce.png' => '51274830e593a079d57c3213da0b97ab',
+        'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4',
+        'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0',
+        'e.png' => '797612f8767a25e9a934580f7d778ef5',
+        'edit.png' => 'dc9067455b48da0bbc50993a4217eedd',
+        'email.png' => 'bd759f54b3496efb62529a08c2b15116',
+        'fcap.png' => 'fa0919ce75dbdcb15cf7e651d5842415',
+        'fcap2.png' => '2c1e274a0b58e66d9cc36a08df4d20c9',
+        'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9',
+        'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8',
+        'new.png' => '2bbd79241cf8036164e9965055b6f8b3',
+        'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad',
+        'new_popular.png' => '610f65b2547cdd8fd22fdf6903f90f61',
+        'new_small.png' => '7ccbd065e0bb7baff3bca315f2e7989e',
+        'newthread.png' => '2d08a2071204a9a9b4766969704b8fee',
+        'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6',
+        'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983',
+        'nonew_small.png' => '948a5a7b2bcb069fd17dcd0c467ce2b5',
+        'post.png' => '5212304c8b38fb4033ddf691fd7b77ba',
+        'profile.png' => 'ed21e84603c3bcf82eb1820235c36075',
+        'quote.png' => '579d14bfb1faabf191272938fae3ab65',
+        'reply.png' => 'ba0faaf5b9a0c9e4edafc921a049739f',
+        'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20',
+        'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8',
+        'website.png' => '568b5e9dcc6fcc5067209e9390297162',
+      ),
+      'images' => 
+      array (
+        'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195',
+        'bg.gif' => '058052ed6c5234762c53f70b0001fb92',
+        'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739',
+        'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7',
+      ),
+      'style.css' => '6bbba211070fa8517ee4b8a6d3c26e7e',
+      'theme.php' => 'edba9bf51ddd484b9d77ffdb0c9c3a1c',
+    ),
+    'comfortless' => 
+    array (
+      'forum' => 
+      array (
+        'admin_delete.png' => '36fe015a4b8cfdbbe4b8aee8b7b563a7',
+        'admin_edit.png' => 'c03274b7f9e16ac1cb702ae8db849f7e',
+        'admin_lock.png' => 'e77b92a1f5877b64b9ccad7cf30b798d',
+        'admin_move.png' => '53724301fb9a5f735d47986feabaa5c2',
+        'admin_stick.png' => 'a3f08da8ab9eda3985365793ff91caf5',
+        'admin_unlock.png' => 'abbe887ff2c94e0fc7ccc6ec76e33e2f',
+        'admin_unstick.png' => '61807d0afc335e394bd9050157eae4c5',
+        'announce.png' => '51274830e593a079d57c3213da0b97ab',
+        'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4',
+        'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0',
+        'e.png' => '22d175dba98b439b73d17da6cd142adf',
+        'edit.png' => 'dc9067455b48da0bbc50993a4217eedd',
+        'email.png' => 'bd759f54b3496efb62529a08c2b15116',
+        'fcap.png' => 'fa0919ce75dbdcb15cf7e651d5842415',
+        'fcap2.png' => '2c1e274a0b58e66d9cc36a08df4d20c9',
+        'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9',
+        'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8',
+        'new.png' => '2bbd79241cf8036164e9965055b6f8b3',
+        'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad',
+        'new_small.png' => 'efb0e1cd78edb0a66d8e83c245e0f0d5',
+        'newthread.png' => '3b51e035b6cb3579d955372de1b36934',
+        'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6',
+        'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983',
+        'nonew_small.png' => '887892198ae123a03df21132e08c6964',
+        'post.png' => '5212304c8b38fb4033ddf691fd7b77ba',
+        'profile.png' => 'ed21e84603c3bcf82eb1820235c36075',
+        'quote.png' => '579d14bfb1faabf191272938fae3ab65',
+        'reply.png' => '26ff2128f3e5b5c985c688118015b69f',
+        'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20',
+        'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8',
+        'website.png' => '568b5e9dcc6fcc5067209e9390297162',
+      ),
+      'images' => 
+      array (
+        'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195',
+        'bg.gif' => '058052ed6c5234762c53f70b0001fb92',
+        'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739',
+        'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7',
+      ),
+      'style.css' => '92e3bf1e539749704b1fcb013d9df71a',
+      'theme.php' => '58fecc858bb054ae7a71bc79ea12c5b7',
+    ),
+    'crahan' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'e107' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => '75b67e121016a521b1b975f3ead317a4',
+        'bullet1.gif' => '097e3c018ae655310889fa98f85be57b',
+        'bullet2.gif' => 'd6e34836e1e3270c3fe06557f9b93d9d',
+        'button.png' => '5a1a29b5670e03697659581da597b5fc',
+        'cap.png' => 'b439047ea62b69e3569cc70999ff6e5f',
+        'header.png' => '200d62810e3f06bf792e920bcdce1d30',
+        'installlogo.png' => '3cd312e939be5dbb073ce76a3116231d',
+        'logo.png' => '346418f2f391f029e9b83c854b74b1d7',
+      ),
+      'style.css' => 'e92d7179f04ee8849024a9af22877d0b',
+      'theme.php' => '39270d4c1c77ac7f34373d7fdb452984',
+    ),
+    'e107v4a' => 
+    array (
+      'images' => 
+      array (
+        'bar2.gif' => 'eb85624e746f91fd33511783cccc92a6',
+        'bar2edge.gif' => '6d273a53798e532091bd6354f1e39c60',
+      ),
+      'languages' => 
+      array (
+      ),
+      'forum_design.php' => '6afe8b9762a01cad599d77c37d54bf80',
+    ),
+    'example' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => 'd3ef60cb45ff91968ce65db5b49b985b',
+        'bullet1.gif' => '097e3c018ae655310889fa98f85be57b',
+        'bullet2.gif' => 'd6e34836e1e3270c3fe06557f9b93d9d',
+        'cap.png' => '736f4166b8ecd0c1a8f031e336657c5e',
+        'header.png' => '200d62810e3f06bf792e920bcdce1d30',
+        'logo.png' => '346418f2f391f029e9b83c854b74b1d7',
+      ),
+      'style.css' => '64dfcfe7f8a5dd55d755d00f751fa97c',
+      'theme.php' => '6b0cdd3e6833728e44772a8c8722724f',
+    ),
+    'fiblack3d' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => 'a87f6df0dc62f6059164a784e48605f3',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => '75b67e121016a521b1b975f3ead317a4',
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'bottomleft.png' => '258e3e69e770bbeacde6264051d8ac5c',
+        'bottommiddle.png' => '356edf3b2e72b9991576d8cdc1269a1f',
+        'bottomright.png' => 'd9b376c57987219f22b86737e6068080',
+        'bullet1.gif' => '097e3c018ae655310889fa98f85be57b',
+        'bullet2.gif' => 'f7a33fe24f02eb54392eb094b6ded7de',
+        'bullet3.gif' => 'b2cc886c34040cd25e787819e20433f2',
+        'button.png' => '5a1a29b5670e03697659581da597b5fc',
+        'cap.png' => 'b439047ea62b69e3569cc70999ff6e5f',
+        'cap1.gif' => '9ad552a50c8425d6c1d8d766216c1093',
+        'fcap.png' => 'c398adcd3acaa56b3b0168fe63140363',
+        'fcap2.png' => '484bca31074eacfc1b1689437780d987',
+        'g_head.gif' => 'e5b7c8416887f1c7d8d9427763072117',
+        'header.png' => '200d62810e3f06bf792e920bcdce1d30',
+        'left.png' => '96c753c33cf6d69d093120448681a510',
+        'logo.jpg' => 'a2a402adf9ec65f2abe9c5a141791d1e',
+        'logo2.png' => '867f8d31edb08e05bf3540cc03eedd2f',
+        'nforumcaption.png' => '18a5f435d48bdeb8e036af0020f8ed26',
+        'nforumcaption2.png' => '9864c81acddb5f2d2e792738e1468f4e',
+        'right.png' => 'fe20a5ed232fdb263b20b12e74ea34e2',
+        'sb_template.png' => '05d718c4d7ffff4cb4a39e1fe3098a13',
+        'tbbg.png' => '418dea906f043bd84f108e701921d53f',
+        'topleft.png' => '1d78bbdc0e9802cf3067eeb3efcf1a5a',
+        'topmiddle.png' => '875f5c3a51b520a8684a36e55bc412da',
+        'topright.png' => '5be0284fbb41ff6987b64cfb783e7c7d',
+        'y_head.gif' => '052f449cda374ade80ee10df09ecd227',
+      ),
+      'style.css' => 'd398533bd3d96e28ee03af6430dacbce',
+      'theme.php' => 'fdd24c507722ddbb56cd10d77c0c7c7a',
+    ),
+    'human_condition' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'interfectus' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'jayya' => 
+    array (
+      'forum' => 
+      array (
+      ),
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'khatru' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+      'nexter.css' => '9290a07f99bb3d5068a3e6a3a580d325',
+    ),
+    'kubrick' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+      'nicetitle.js' => '81658d0b559af2fb4c0ad27b8ffb9a0d',
+    ),
+    'lamb' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'leaf' => 
+    array (
+      'fontstyles' => 
+      array (
+      ),
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'leap of faith' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => 'deb2fd16258227f5e99fee0074b764af',
+        'bar2.gif' => 'eb85624e746f91fd33511783cccc92a6',
+        'bar2edge.gif' => '6d273a53798e532091bd6354f1e39c60',
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'bottom.png' => '46e798abeb638c4f9540973d239b10e7',
+        'bottomleft.png' => '3db4e800cc8add7f4f360c5f055aba49',
+        'bottomright.png' => '28a54110d855fd47380cf094d6b7b169',
+        'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739',
+        'bullet2.gif' => '5fea13d481fc903ce05bfed57341e1c1',
+        'button.png' => '69918234a9caea763d1c66781e50fe34',
+        'cap1.png' => 'd014368f2839e01b455ef1d63175188d',
+        'capdark.png' => 'f8ec8fc5f9ccb1e72f0543e9405c0649',
+        'capleft.png' => 'b57f36c4daf41cee56d31cbd47f9b1f1',
+        'caplight.png' => 'ca308b892123bdb7e9e0f7cf1f729c59',
+        'capright.png' => '36e3ec810d778dc3664b456c714e62f3',
+        'captransition.png' => '7e9583f5c1c96b4191fa309a058aa314',
+        'fcap.png' => 'fabf58910351f1f742dee108b60517b8',
+        'fcap2.png' => '777e56bcaf32e29ad505df49f3cb6019',
+        'left.png' => 'a7755093080be75e9430072bd3bb32b3',
+        'right.png' => '1dc657e1d9065920653132f3a85d77ed',
+        'temp.png' => '35e34c98922cf2df737eef3cec806af2',
+        'top.png' => '75b4e22fcbe8059bf217690e08c265ac',
+        'topleft.png' => '8b45a5185fa619c3d336e1ceb618bc81',
+        'topright.png' => '1c6d6e49a6d9d173ec12f2baed2f45a8',
+      ),
+      'style.css' => '1b8a431a51e1e374e4eadcd8d7ed3ca6',
+      'theme.php' => 'ecde1a337a506f397465704e887a9865',
+    ),
+    'nagrunium' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195',
+        'bg.gif' => '058052ed6c5234762c53f70b0001fb92',
+        'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739',
+        'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7',
+      ),
+      'style.css' => '289d72f0f610c28fa47e856ef1d16113',
+      'theme.php' => '9417c6b28e9c4f9b2754c26cdb200abb',
+    ),
+    'newsroom' => 
+    array (
+      'images' => 
+      array (
+      ),
+    ),
+    'nordranious' => 
+    array (
+      'forum' => 
+      array (
+        'admin_delete.png' => '36fe015a4b8cfdbbe4b8aee8b7b563a7',
+        'admin_edit.png' => 'c03274b7f9e16ac1cb702ae8db849f7e',
+        'admin_lock.png' => 'e77b92a1f5877b64b9ccad7cf30b798d',
+        'admin_move.png' => '53724301fb9a5f735d47986feabaa5c2',
+        'admin_stick.png' => 'a3f08da8ab9eda3985365793ff91caf5',
+        'admin_unlock.png' => 'abbe887ff2c94e0fc7ccc6ec76e33e2f',
+        'admin_unstick.png' => '61807d0afc335e394bd9050157eae4c5',
+        'announce.png' => '51274830e593a079d57c3213da0b97ab',
+        'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4',
+        'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0',
+        'e.png' => '797612f8767a25e9a934580f7d778ef5',
+        'edit.png' => 'dc9067455b48da0bbc50993a4217eedd',
+        'email.png' => 'bd759f54b3496efb62529a08c2b15116',
+        'fcap.png' => 'b660b71d0208edb76a1b16930f2b81ac',
+        'fcap2.png' => '5f6f45697bc185d51f2c06d904642aad',
+        'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9',
+        'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8',
+        'new.png' => '2bbd79241cf8036164e9965055b6f8b3',
+        'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad',
+        'new_small.png' => 'c593a4a99887c7eaeb1cd8dd000ebfcd',
+        'newthread.png' => '94fdbfd082142c1443af2cf82914a833',
+        'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6',
+        'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983',
+        'nonew_small.png' => '1e88b9f0b2e714475d4243509336b5c4',
+        'post.png' => '5212304c8b38fb4033ddf691fd7b77ba',
+        'profile.png' => 'ed21e84603c3bcf82eb1820235c36075',
+        'quote.png' => '579d14bfb1faabf191272938fae3ab65',
+        'reply.png' => '556906857646412a52b35814b4f707ba',
+        'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20',
+        'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8',
+        'website.png' => '568b5e9dcc6fcc5067209e9390297162',
+      ),
+      'images' => 
+      array (
+        'bar.jpg' => '683a63e29f5c473fe677836187953c1a',
+        'bar.png' => '9791d8cbd8e00c4b4538696990977d2b',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => 'd3ef60cb45ff91968ce65db5b49b985b',
+        'blank.gif' => '7de900b8e3dd46a432e384eb231f079d',
+        'bullet1.gif' => '09331909ba55a4f54c08018cede1ec85',
+        'bullet2.gif' => 'd6e34836e1e3270c3fe06557f9b93d9d',
+        'bullet3.gif' => '54e9d1f816051d002420875fb3499fd8',
+        'button.png' => '5a1a29b5670e03697659581da597b5fc',
+        'cap.png' => '81e98497b6b21b117be42ab30e6b8551',
+        'corner.png' => '55d255b0484a611b1e94e0c9f89fce34',
+        'left.png' => 'ddc536f7ec329942af71a88a8c8edaad',
+        'side.png' => '18dd6404dc3020641158c286b25b0ea9',
+        'top.png' => 'ca8d4b489c4c86f2cc8e1e0d48ef5eaf',
+      ),
+      'style.css' => '60e1cb2188f3fb4e88e21e138ff5aa07',
+      'theme.php' => 'f04beabe808e9269589d0a30889d8d6d',
+    ),
+    'phpbb' => 
+    array (
+      'forum' => 
+      array (
+        'admin_delete.png' => '36fe015a4b8cfdbbe4b8aee8b7b563a7',
+        'admin_edit.png' => 'c03274b7f9e16ac1cb702ae8db849f7e',
+        'admin_lock.png' => 'e77b92a1f5877b64b9ccad7cf30b798d',
+        'admin_move.png' => '53724301fb9a5f735d47986feabaa5c2',
+        'admin_stick.png' => 'a3f08da8ab9eda3985365793ff91caf5',
+        'admin_unlock.png' => 'abbe887ff2c94e0fc7ccc6ec76e33e2f',
+        'admin_unstick.png' => '61807d0afc335e394bd9050157eae4c5',
+        'announce.png' => '51274830e593a079d57c3213da0b97ab',
+        'closed_small.png' => '23df1d00ed2742c32f08664b39ebe5e4',
+        'delete.png' => 'b9fc374f973e51f45c80884b56cab7c0',
+        'e.png' => '797612f8767a25e9a934580f7d778ef5',
+        'edit.png' => 'dc9067455b48da0bbc50993a4217eedd',
+        'email.png' => 'bd759f54b3496efb62529a08c2b15116',
+        'fcap.png' => '3d1b365a597132548eb9635b6bca040d',
+        'fcap2.png' => '5f6f45697bc185d51f2c06d904642aad',
+        'finfobar.png' => '71585c0c2d3340ece8cf769a135286b9',
+        'moderator.png' => 'dc487b54b9dbbc1fc834a8ef882adea8',
+        'new.png' => '2bbd79241cf8036164e9965055b6f8b3',
+        'new_popular.gif' => '3c47023ff01dc15fb3a678cb21cf55ad',
+        'new_small.png' => 'c593a4a99887c7eaeb1cd8dd000ebfcd',
+        'newthread.png' => '94fdbfd082142c1443af2cf82914a833',
+        'nonew.png' => '5fe81217e3c6f672a4e2f2922ddbe1c6',
+        'nonew_popular.gif' => 'bd77c2f2b42336d5690646d4006ea983',
+        'nonew_small.png' => '1e88b9f0b2e714475d4243509336b5c4',
+        'post.png' => '5212304c8b38fb4033ddf691fd7b77ba',
+        'profile.png' => 'ed21e84603c3bcf82eb1820235c36075',
+        'quote.png' => '579d14bfb1faabf191272938fae3ab65',
+        'reply.png' => '556906857646412a52b35814b4f707ba',
+        'sticky.png' => 'c5bb0a20ef02bf8e52f3a93907804f20',
+        'stickyclosed.png' => '810fb2dee4cf3d593f5a50031a52cde8',
+        'website.png' => '568b5e9dcc6fcc5067209e9390297162',
+      ),
+      'images' => 
+      array (
+        'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => '75b67e121016a521b1b975f3ead317a4',
+        'bullet1.gif' => '097e3c018ae655310889fa98f85be57b',
+        'bullet2.gif' => 'd6e34836e1e3270c3fe06557f9b93d9d',
+        'bullet3.gif' => 'e1bfc882a4a4a1f3b245585e17181da6',
+        'button.png' => '5a1a29b5670e03697659581da597b5fc',
+        'cap.png' => 'b439047ea62b69e3569cc70999ff6e5f',
+        'cap1.gif' => '9ad552a50c8425d6c1d8d766216c1093',
+        'header.png' => '200d62810e3f06bf792e920bcdce1d30',
+        'sb_template.png' => '05d718c4d7ffff4cb4a39e1fe3098a13',
+      ),
+      'style.css' => '5eaeee033e7af67e3642494321211461',
+      'theme.php' => '3bebdfb44352857292267e9e40baa744',
+    ),
+    'ranyart' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => 'a6db2ab78d920a41f003a0c31e688199',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => 'd3ef60cb45ff91968ce65db5b49b985b',
+        'bullet1.gif' => '097e3c018ae655310889fa98f85be57b',
+        'bullet2.gif' => 'ffa05a27f0da01830e12d15095b5473b',
+        'button.png' => '15462dc5844b42f6891e3a05dbfc0b3b',
+        'cap.png' => '736f4166b8ecd0c1a8f031e336657c5e',
+        'clock.png' => 'b8a6c6b2c3e1b66f3ae03b217665a1a2',
+        'header.png' => '200d62810e3f06bf792e920bcdce1d30',
+        'logo.png' => '830db48cdb37387b806423ed0ca9960d',
+        'monitor.png' => 'fe57c7050bc8c7903806149e7f4e25b4',
+      ),
+      'style.css' => '62365fd9c2b8b1b18485f69f1503818d',
+      'theme.php' => '0c1cdae9b4143f3ea1a0855231fe4b84',
+    ),
+    'sebes' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'smacks' => 
+    array (
+      'images' => 
+      array (
+        'bg.gif' => '890e67e4d2d362079e3a794ff0c3950b',
+        'bg.png' => 'e70a48befe520f37d50872c6d7816ab6',
+        'body.png' => '555772b48dc8bebc0be424d4ef837e51',
+        'bottom.png' => 'f12ecaa6b26786524f6e9b0c1d0baa91',
+        'bottomleft.png' => '0df01a95deaeecdcfbd378500fb016d1',
+        'bottomright.png' => 'faf4235009b7bceda62f5e6e98f71a92',
+        'bullet1.gif' => '992bd9b4f72c80b5e74168af0adb225b',
+        'bullet2.gif' => 'ee9887f23030161576dc7267a163c59b',
+        'caption.png' => '98afcbf04a2dc04ecd6491c9a4beb3b9',
+        'left.png' => '3eef5624d4a069d3e31fb8576e785419',
+        'logo.png' => 'bb8d5e083cf27c045313e6e5bcd97e52',
+        'right.png' => 'd47a3a781045dc015f9cca05eb1b5ab8',
+        'tablebg.png' => 'c5c91fb04407c388ef0be982bb8809ae',
+        'top.png' => 'a48a0e033119a0289852812325b594ef',
+        'topbar.png' => '0dd080dfcd0a2df285fa26f5a3740147',
+        'topleft.png' => 'c872a73060a134dbdc57727348a6d907',
+        'topright.png' => '23ffd97e5448427efd333179d094387a',
+      ),
+      'style.css' => '44eb298d24e6eff161e327c06289e801',
+      'theme.php' => '8e83b87b38504a2d08292c0bbf7301c5',
+    ),
+    'soar' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195',
+        'bg.gif' => '058052ed6c5234762c53f70b0001fb92',
+        'blank.gif' => '0e94b3486afb85d450b20ea1a6658cd7',
+        'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739',
+        'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7',
+        'cap1.png' => '98be8e32cc8651622d43a466f63b169c',
+        'caption.png' => '3d84f35bff62f78624822c7eae1bc5d2',
+        'caption2.png' => '2eac2c5145782f11f605842c3f5f6911',
+        'caption3.png' => '9804cedbccc111a22dc0b56c4aa5f1ae',
+        'fcap.png' => '808ecd89f8890df55e0f2a76555ef4d2',
+        'fcap2.png' => '90c520d65d4dd19217739cfcc6e3979a',
+        'hr.png' => 'e41d8ce6c3381c08bc20fad9ebf26aee',
+        'logo.jpg' => 'c79b084a3bb2e76ab49f9ddce0319ac1',
+        'nforumcaption.png' => '18a5f435d48bdeb8e036af0020f8ed26',
+        'nforumcaption2.png' => '9864c81acddb5f2d2e792738e1468f4e',
+        'shadow_left.png' => 'f47a342e00d6f4248b552fa5e39294d1',
+        'shadow_middle.png' => '946975a66e4db58fbe6442899afbeb13',
+        'shadow_right.png' => '00a7c72cc479dd89a50ccddeec650758',
+      ),
+      'forum_design.php' => '45e828a47cedaaa44e312470846d4930',
+      'style.css' => '62cb98d0e63beb9ca74cdfcd7c599785',
+      'theme.js' => 'bd6ab25405b19545bbdcad691da94fe8',
+      'theme.php' => '92fa9c0015733df0c6b935d0c2ce082c',
+    ),
+    'templates' => 
+    array (
+      'forum_template.php' => '7c4aa61097a7cf0ea4a5f3d2089a5b9d',
+      'forum_viewforum_template.php' => '7a2c7fc3c28a3df76661ec297119daab',
+      'forum_viewtopic_template.php' => 'fb3516a937155a9e86eaa9a080905646',
+    ),
+    'vekna_blue' => 
+    array (
+      'images' => 
+      array (
+      ),
+      'languages' => 
+      array (
+      ),
+    ),
+    'wan' => 
+    array (
+      'forum' => 
+      array (
+        'fcap.png' => '5c3f4de6a594f0cfc26ba5f262cff6a3',
+        'fcap2.png' => '5faf526e1c2b8b8473d73b5f1a034baa',
+      ),
+      'images' => 
+      array (
+        'bar.jpg' => '36494528dd74cb5869a176be426f48fd',
+        'bar2.gif' => '340f87a5da4dfff37fd833a7a9834a92',
+        'bar2edge.gif' => '3a224f579f9c6fa28687b44c61a03581',
+        'bullet1.gif' => 'c80146f4417e32ea9f21f9a1bd71dd19',
+        'bullet2.gif' => '62dfcf66db90d4a8d16093604582630d',
+        'cap.png' => 'e4767da365351414865449a5b59450a2',
+        'desktop.gif' => '24bdbaec3683f038c4c1e77983357aea',
+        'header.png' => '9123aa2265308104754a534b8540c8ba',
+        'iconmail.png' => 'e4ba543e3f4e02185e7df1ea5b689800',
+        'iconprint.png' => '933d2be01f102e99f7ed03bea96bfbe1',
+      ),
+      'style.css' => '1e999f8f80ebc89a4bde3c803f934bd3',
+      'theme.php' => 'bbe4d283f553c324863c4451e3212ea4',
+    ),
+    'xog' => 
+    array (
+      'images' => 
+      array (
+        'bar.jpg' => '13b2cb049602ff94d0d80a0e0896d8e9',
+        'bar2.gif' => '7a3ae76cbf5e376e3e86eb01aaadefba',
+        'bar2edge.gif' => '30f11ad7f707603148a90c4197c5b195',
+        'bg.gif' => '058052ed6c5234762c53f70b0001fb92',
+        'bullet1.gif' => 'f3e084e73fc80fea93ee8e11ffef4739',
+        'bullet2.gif' => '5e3525d341b9a47c514b094e9a5395a7',
+        'hr.png' => 'e41d8ce6c3381c08bc20fad9ebf26aee',
+        'logo.png' => '973175159c8710e70cbb136a9db781a6',
+      ),
+      'style.css' => '0de81736ec6019f246ee3df97133ba2b',
+      'theme.php' => 'f61421dacc4fb1456f289569b9a22b9c',
+    ),
+  ),
+  'CHANGES.txt' => '20499ea696da01da57ff542cb8cc90ce',
+  'Copy of class2.php' => '4bc75d69d5486bb439f681467ccb9256',
+  'Copy of forum_post.php' => '0063a6cdd546d5f90374bbb3ae342a2a',
+  'ReadMe_English_iso-8859-1.txt' => 'a15c32416143ecdebb10fab747a9065a',
+  'chat.php' => 'f99ca9a68e350852ff12b6f201ff46e4',
+  'e107_6171_readme.txt' => '7f411eaafccc974f91447c8efd9992d4',
+  'forum_post.php' => 'b4537a7296252a0d8c010824b698259b',
+  'install.php' => '0cb8fbb6bb85461a4cd0a0b966b4eefa',
+  'oldpolls.php' => '2758e56550195c508819c6062b950bc3',
+  'readme.txt' => 'ff257006036939e779d287cdfee3b4b3',
+  'sitemap.php' => 'd72fdc265a68f5a3b8a5d4b51d776f84',
+  'stats.php' => '70a4419f7b5ce5ad398a2f2d38ab55eb',
+  'upgrade.php' => '5e74e594b56732d62183c0300e222f2a',
+);
+
diff -ruN 6171/e107_admin/cpage.php 75/e107_admin/cpage.php
--- 6171/e107_admin/cpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/cpage.php	2006-05-16 10:55:05.000000000 -0500
@@ -0,0 +1,433 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/cpage.php,v $
+|     $Revision: 1.30 $
+|     $Date: 2006/05/16 15:55:05 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../class2.php");
+
+if (!getperms("5")) { header("location:".e_BASE."index.php"); exit; }
+
+$e_sub_cat = 'custom';
+$e_wysiwyg = "data";
+$page = new page;
+
+require_once("auth.php");
+require_once(e_HANDLER."ren_help.php");
+require_once(e_HANDLER."userclass_class.php");
+$custpage_lang = ($sql->mySQLlanguage) ? $sql->mySQLlanguage : $pref['sitelanguage'];
+
+if (e_QUERY)
+{
+	$tmp        = explode(".", e_QUERY);
+	$action     = $tmp[0];
+	$sub_action = $tmp[1];
+	$id         = $tmp[2];
+	$from       = ($tmp[3] ? $tmp[3] : 0);
+}
+
+if(isset($_POST['submitPage']))
+{
+	$page -> submitPage();
+}
+
+if(isset($_POST['submitMenu']))
+{
+	$page -> submitPage("", TRUE);
+}
+
+if(isset($_POST['updateMenu']))
+{
+	$page -> submitPage($_POST['pe_id'], TRUE);
+}
+
+if(isset($_POST['updatePage']))
+{
+	$page -> submitPage($_POST['pe_id']);
+}
+
+if(isset($_POST['delete']))
+{
+	foreach(array_keys($_POST['delete']) as $pid)
+	{
+		$page -> delete_page($pid);
+	}
+}
+		
+if (isset($_POST['saveOptions'])) {
+	$page -> saveSettings();
+}
+
+if($page->message)
+{
+	$ns->tablerender("", "<div style='text-align:center'><b>".$page->message."</b></div>");
+}
+
+if(!e_QUERY)
+{
+	$page -> showExistingPages();
+}
+else
+{
+	$function = $action."Page";
+	$page -> $function();
+}
+
+require_once(e_ADMIN."footer.php");
+
+class page
+{
+	var $message;
+
+	function showExistingPages()
+	{
+		global $sql, $tp, $ns;
+
+		$text = "<div style='text-align: center;'>";
+
+		if(!$sql -> db_Select("page", "*", "ORDER BY page_datestamp DESC", "nowhere"))
+		{
+			$text .= CUSLAN_42;
+		}
+		else
+		{
+			$pages = $sql -> db_getList('ALL', FALSE, FALSE);
+			$text .= "<form action='".e_SELF."' id='newsform' method='post'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='width:5%; text-align: center;' class='fcaption'>ID</td>
+			<td style='width:60%' class='fcaption'>".CUSLAN_1."</td>
+			<td style='width:15%; text-align: center;' class='fcaption'>".CUSLAN_2."</td>
+			<td style='width:20%; text-align: center;' class='fcaption'>".CUSLAN_3."</td>
+			</tr>";
+
+			foreach($pages as $pge)
+			{
+				$text .= "
+				<tr>
+				<td style='width:5%; text-align: center;' class='forumheader3'>$pge[page_id]</td>
+				<td style='width:60%' class='forumheader3'><a href='".($pge[page_theme] ? e_ADMIN."menus.php" : e_BASE."page.php?{$pge[page_id]}" )."'>$pge[page_title]</a></td>
+				<td style='width:15%; text-align: center;' class='forumheader3'>".($pge[page_theme] ? "menu" : "page")."</td>
+				<td style='width:20%; text-align: center;' class='forumheader3'>
+				<a href='".e_SELF."?".($pge[page_theme] ? "createm": "create").".edit.{$pge[page_id]}'>".ADMIN_EDIT_ICON."</a>
+				<input type='image' title='".LAN_DELETE."' name='delete[{$pge[page_id]}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".CUSLAN_4." [ ID: $pge[page_id] ]')\"/>
+				</td>
+				</tr>";
+			}
+		
+			$text .= "
+			</table>
+			</form>";
+		}
+
+		$text .= "
+		</div>";
+
+		$ns -> tablerender(CUSLAN_5, $text);
+	}
+
+	function createmPage()
+	{
+		$this -> createPage(TRUE);
+	}
+
+	function createPage($mode=FALSE)
+	{
+		/* mode: FALSE == page, mode: TRUE == menu */
+
+		global $sql, $tp, $ns, $pref, $sub_action, $id;
+
+		if ($sub_action == "edit" && !$_POST['preview'] && !$_POST['submit'])
+		{
+			if ($sql->db_Select("page", "*", "page_id='$id' "))
+			{
+				$row                          = $sql->db_Fetch();
+				$page_class                   = $row['page_class'];
+				$page_password                = $row['page_password'];
+				$page_title                   = $tp -> toFORM($row['page_title']);
+				$page_rating_flag             = $row['page_rating_flag'];
+				$page_comment_flag            = $row['page_comment_flag'];
+				$page_display_authordate_flag = $row['page_author'];
+				$data                         = $tp -> toFORM($row['page_text']);
+				$edit                         = TRUE;
+			}
+			
+			if ($sql -> db_Select("links", "*", "link_url='page.php?".$id."'"))
+			{
+				$row = $sql -> db_Fetch();
+				$page_link = $row['link_name'];
+			}
+		}
+
+		$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."' id='dataform'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+		if($mode)
+		{
+			$text .= "<tr>
+			<td style='width:30%' class='forumheader3'>".CUSLAN_7."</td>
+			<td style='width:70%' class='forumheader3'>";
+			
+			if($edit)
+			{
+				$text .= $page_theme;
+			}
+			else
+			{
+				$text .= "<input class='tbox' type='text' name='menu_name' size='30' value='".$menu_name."' maxlength='50' />";
+			}
+			
+			$text .= "</td>
+			</tr>";
+		}
+
+		$text .= "<tr>
+		<td style='width:30%' class='forumheader3'>".CUSLAN_8."</td>
+		<td style='width:70%' class='forumheader3'><input class='tbox' type='text' name='page_title' size='50' value='".$page_title."' maxlength='250' /></td>
+		</tr>
+		
+		</td>
+		</tr>
+		
+		<tr>
+		<td style='width:30%' class='forumheader3'>".CUSLAN_9."</td>
+		<td style='width:70%' class='forumheader3'>";
+
+		$insertjs = (!$pref['wysiwyg'])?"rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'":
+		"rows='25' style='width:100%' ";
+		$data = $tp->toForm($data);
+		$text .= "<textarea class='tbox' id='data' name='data' cols='80'  style='width:95%' $insertjs>".(strstr($data, "[img]http") ? $data : str_replace("[img]../", "[img]", $data))."</textarea>";
+
+		if (!$pref['wysiwyg']) {
+			$text .= "<input id='helpb' class='helpbox' type='text' name='helpb' size='100' style='width:95%'/>
+			<br />".display_help("helpb");
+		}
+
+		$text .= "</td>
+		</tr>";
+	
+		if(!$mode)
+		{
+			$text .= "<tr>
+			<td style='width:30%' class='forumheader3'>".CUSLAN_10."</td>
+			<td style='width:70%;' class='forumheader3'>
+			<input type='radio' name='page_rating_flag' value='1'".($page_rating_flag ? " checked='checked'" : "")." /> ".CUSLAN_38."&nbsp;&nbsp;
+			<input type='radio' name='page_rating_flag' value='0'".($page_rating_flag ? "" : " checked='checked'")." /> ".CUSLAN_39."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".CUSLAN_13."</td>
+			<td style='width:70%;' class='forumheader3'>
+			<input type='radio' name='page_comment_flag' value='1'".($page_comment_flag ? " checked='checked'" : "")." /> ".CUSLAN_38."&nbsp;&nbsp;
+			<input type='radio' name='page_comment_flag' value='0'".($page_comment_flag ? "" : " checked='checked'")." /> ".CUSLAN_39."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".CUSLAN_41."</td>
+			<td style='width:70%;' class='forumheader3'>
+			<input type='radio' name='page_display_authordate_flag' value='1'".($page_display_authordate_flag ? " checked='checked'" : "")." /> ".CUSLAN_38."&nbsp;&nbsp;
+			<input type='radio' name='page_display_authordate_flag' value='0'".($page_display_authordate_flag ? "" : " checked='checked'")." /> ".CUSLAN_39."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".CUSLAN_14."<br /><span class='smalltext'>".CUSLAN_15."</span></td>
+			<td style='width:70%' class='forumheader3'><input class='tbox' type='text' name='page_password' size='20' value='".$page_password."' maxlength='50' /></td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".CUSLAN_16."<br /><span class='smalltext'>".CUSLAN_17."</span></td>
+			<td style='width:70%' class='forumheader3'><input class='tbox' type='text' name='page_link' size='60' value='".$page_link."' maxlength='50' /></td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".CUSLAN_18."</td>
+			<td style='width:70%' class='forumheader3'>".r_userclass("page_class", $page_class)."</td>
+			</tr>";
+		}
+
+		$text .= "<tr>
+		<td colspan='2' style='text-align:center' class='forumheader'>". 
+
+		(!$mode ? 
+		($edit  ? "<input class='button' type='submit' name='updatePage' value='".CUSLAN_19."' /><input type='hidden' name='pe_id' value='$id' />" : "<input class='button' type='submit' name='submitPage' value='".CUSLAN_20."' />") : 
+		($edit  ? "<input class='button' type='submit' name='updateMenu' value='".CUSLAN_21."' /><input type='hidden' name='pe_id' value='$id' />" : "<input class='button' type='submit' name='submitMenu' value='".CUSLAN_22."' />"))
+
+		."</td>
+		</tr>
+
+		</table>
+		</form>
+		</div>";
+
+		$caption =(!$mode ? ($edit ? CUSLAN_23 : CUSLAN_24) : ($edit ? CUSLAN_25 : CUSLAN_26));
+		$ns -> tablerender($caption, $text);
+	}
+
+
+	function submitPage($mode = FALSE, $type=FALSE)
+	{
+		global $sql, $tp, $e107cache;
+
+		$page_title = $tp -> toDB($_POST['page_title']);
+		$page_text = $tp -> toDB($_POST['data']);
+		$pauthor = ($_POST['page_display_authordate_flag'] ? USERID : 0);
+
+		if($mode)
+		{
+			$update = $sql -> db_Update("page", "page_title='$page_title', page_text='$page_text', page_author='$pauthor', page_rating_flag='".intval($_POST['page_rating_flag'])."', page_comment_flag='".intval($_POST['page_comment_flag'])."', page_password='".$_POST['page_password']."', page_class='".$_POST['page_class']."', page_ip_restrict='".$_POST['page_ip_restrict']."' WHERE page_id='$mode'");
+			$e107cache->clear("page_{$mode}");
+			$e107cache->clear("page-t_{$mode}");
+			
+			if ($_POST['page_link'])
+			{
+				if ($sql -> db_Select("links", "link_id", "link_url='page.php?".$mode."' && link_name!='".$tp -> toDB($_POST['page_link'])."'"))
+				{
+					$sql -> db_Update("links", "link_name='".$tp -> toDB($_POST['page_link'])."' WHERE link_url='page.php?".$mode."'");
+					$update++;
+					$e107cache->clear("sitelinks");
+				}
+				else if (!$sql -> db_Select("links", "link_id", "link_url='page.php?".$mode."'"))
+				{
+					$sql -> db_Insert("links", "0, '".$tp -> toDB($_POST['page_link'])."', 'page.php?".$mode."', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
+					$update++;
+					$e107cache->clear("sitelinks");
+				}
+			} else {
+				if ($sql -> db_Select("links", "link_id", "link_url='page.php?".$mode."'"))
+				{
+					$sql -> db_Delete("links", "link_url='page.php?".$mode."'");
+					$update++;
+					$e107cache->clear("sitelinks");
+				}
+			}
+			admin_update($update, 'update', "Page updated in database.");
+		}
+		else
+		{
+
+			$menuname = ($type ? $tp -> toDB($_POST['menu_name']) : "");
+
+			admin_update($sql -> db_Insert("page", "0, '$page_title', '$page_text', '$pauthor', '".time()."', '".intval($_POST['page_rating_flag'])."', '".intval($_POST['page_comment_flag'])."', '".$_POST['page_password']."', '".$_POST['page_class']."', '', '".$menuname."'"), 'insert', CUSLAN_27);
+
+			if($type)
+			{
+				$sql -> db_Insert("menus", "0, '$menuname', '0', '0', '0', '', '".mysql_insert_id()."' ");
+			}
+
+			if($_POST['page_link'])
+			{
+				$link = "page.php?".mysql_insert_id();
+				if (!$sql->db_Select("links", "link_id", "link_name='".$tp -> toDB($_POST['page_link'])."'"))
+				{
+					$linkname = $tp -> toDB($_POST['page_link']);
+					$sql->db_Insert("links", "0, '$linkname', '$link', '', '', 1, 0, 0, 0, ".$_POST['page_class']);
+					$e107cache->clear("sitelinks");
+				}
+			}
+		}
+	}
+
+	function delete_page($del_id)
+	{
+		global $sql, $e107cache;
+		admin_update($sql -> db_Delete("page", "page_id='$del_id' "), 'delete', CUSLAN_28);
+		$sql -> db_Delete("menus", "menu_path='$del_id' ");
+		if ($sql -> db_Select("links", "link_id", "link_url='page.php?".$del_id."'"))
+		{
+			$sql -> db_Delete("links", "link_url='page.php?".$del_id."'");
+			$e107cache->clear("sitelinks");
+		}
+	}
+
+	function optionsPage()
+	{
+		global $ns, $pref;
+
+		if(!isset($pref['pageCookieExpire'])) $pref['pageCookieExpire'] = 84600;
+
+		$text = "<div style='text-align: center; margin-left:auto; margin-right: auto;'>
+		<form method='post' action='".e_SELF."'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+
+		<tr>
+		<td style='width:50%' class='forumheader3'>".CUSLAN_29."</td>
+		<td style='width:50%; text-align: right;' class='forumheader3'>
+		<input type='radio' name='listPages' value='1'".($pref['listPages'] ? " checked='checked'" : "")." /> ".CUSLAN_38."&nbsp;&nbsp;
+		<input type='radio' name='listPages' value='0'".($pref['listPages'] ? "" : " checked='checked'")." /> ".CUSLAN_39."
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:50%' class='forumheader3'>".CUSLAN_30."</td>
+		<td style='width:50%; text-align: right;' class='forumheader3'>
+		<input class='tbox' type='text' name='pageCookieExpire' size='15' value='".$pref['pageCookieExpire']."' maxlength='10' />
+		</td>
+		</tr>
+
+		<tr>
+		<td colspan='2'  style='text-align:center' class='forumheader'>
+		<input class='button' type='submit' name='saveOptions' value='".CUSLAN_40."' />
+		</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+
+		$ns->tablerender("Options", $text);
+	}
+
+	function saveSettings()
+	{
+		global $pref;
+		$pref['listPages'] = $_POST['listPages'];
+		$pref['pageCookieExpire'] = $_POST['pageCookieExpire'];
+		save_prefs();
+		$this -> message = "Settings saved.";
+	}
+
+	function show_options($action)
+	{
+		if ($action == "")
+		{
+			$action = "main";
+		}
+		$var['main']['text'] = CUSLAN_11;
+		$var['main']['link'] = e_SELF;
+
+		$var['create']['text'] = CUSLAN_12;
+		$var['create']['link'] = e_SELF."?create";
+
+		$var['createm']['text'] = CUSLAN_31;
+		$var['createm']['link'] = e_SELF."?createm";
+
+		$var['options']['text'] = LAN_OPTIONS;
+		$var['options']['link'] = e_SELF."?options";
+
+		show_admin_menu(CUSLAN_33, $action, $var);
+	}
+}
+
+function cpage_adminmenu() {
+	global $page;
+	global $action;
+	$page -> show_options($action);
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/credits.php 75/e107_admin/credits.php
--- 6171/e107_admin/credits.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/credits.php	2006-04-18 03:37:54.000000000 -0500
@@ -0,0 +1,264 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ©Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/credits.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/04/18 08:37:54 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+$e_sub_cat = 'credits';
+include(e_ADMIN.'ver.php');
+
+
+
+$creditsArray = array(
+	array(	"name" => "MagpieRSS",
+				"url" => "http://magpierss.sourceforge.net/",
+				"description" => "MagpieRSS provides an XML-based (expat) RSS parser in PHP.",
+				"version" => "0.71.1",
+				"licence" => "GPL, permission granted"
+			),
+	array(	"name" => "PCLZip",
+				"url" => "http://www.phpconcept.net/pclzip/",
+				"description" => "PclZip library offers compression and extraction functions for Zip formatted archives (WinZip, PKZIP).",
+				"version" => "2.3",
+				"licence" => "GPL"
+			),
+	array(	"name" => "PCLTar",
+				"url" => "http://www.phpconcept.net/pcltar/",
+				"description" => "PclTar offer the ability to archive a list of files or directories with or without compression. The archives created by PclTar are readeable by most of gzip/tar applications and by the Windows WinZip application.",
+				"version" => "1.3",
+				"licence" => "GPL"
+			),
+	array(	"name" => "TinyMCE",
+				"url" => "http://tinymce.moxiecode.com/",
+				"description" => "TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.",
+				"version" => "2.01",
+				"licence" => "GPL"
+			),
+	array(	"name" => "Nuvolo Icons",
+				"url" => "http://www.icon-king.com",
+				"description" => "Icons used in e107",
+				"version" => "1.0",
+				"licence" => "GPL"
+			),
+	array(	"name" => "PHPMailer",
+				"url" => "http://phpmailer.sourceforge.net/",
+				"description" => "Full featured email transfer class for PHP",
+				"version" => "1.72",
+				"licence" => "GPL"
+			),
+	array(	"name" => "Brainjar DHTML Menu",
+				"url" => "http://www.brainjar.com/dhtml/menubar/",
+				"description" => "Menu system used in Jayya theme",
+				"version" => "0.1",
+				"licence" => "GPL, permission granted"
+			),
+	array(	"name" => "DHTML / JavaScript Calendar",
+				"url" => "http://www.dynarch.com/projects/",
+				"description" => "Popup calendar widget",
+				"version" => "1.0",
+				"licence" => "GPL"
+			),
+	array(	"name" => "FPDF",
+				"url" => "http://www.fpdf.org/",
+				"description" => "PDF support",
+				"version" => "1.53",
+				"licence" => "Freeware"
+			),
+	array(	"name" => "UFPDF",
+				"url" => "http://www.acko.net/node/56",
+				"description" => "UTF-8 PDF support",
+				"version" => "0.1",
+				"licence" => "GPL"
+			),
+	);
+
+$contentA = array(
+	"<h3>e107 v0.7 was brought to you by ...</h3>",
+	"<h1>Carl Cedergren</h1>[ asperon ]<br /><br /><br />",
+	"<h1>Cameron Hanly</h1>[ CaMer0n ]<br /><br /><br />Always a pressure..err..pleasure!",
+	"<h1>Steve Dunstan</h1>[ jalist ]<br /><br /><br />\"MTVhNjMyZDgxN2QwM2Q3ZTI<br />5ODM2NDU3YWI0ZjM1NGILJT<br />yarrrrrr! wtf matey!\"",
+	"<h1>Eric Vanderfeesten</h1> [ lisa ]<br /><br /><br />",
+	"<h1>Thom Michelbrink</h1>[ McFly ]<br /><br /><br />",
+	"<h1>William Moffett</h1>[ que ]<br /><br /><br />",
+	"<h1>Martin Nicholls</h1>[ streaky ]<br /><br /><br />",
+	"<h1>James Currie</h1>[ SweetAs ]<br /><br /><br />\"Wot? No tea?? 0_0\"",
+	"<h1>Pete Holzmann</h1>[ MrPete ]<br /><br /><br />"
+);
+
+echo "<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
+<html xmlns='http://www.w3.org/1999/xhtml'>
+<head>
+<title>e107 Credits</title>
+<meta http-equiv='content-type' content='text/html; charset=utf-8' />
+<meta http-equiv='content-style-type' content='text/css' />
+<link rel='stylesheet' href='".e_THEME."lamb/style.css' type='text/css' />
+</head>
+<body style='padding: 0; margin: 0; background-color: #e8e8e8; color: #8E8E8E'>
+
+<img src='".e_IMAGE."generic/cred.png' alt='' />
+<div class='smalltext' style='position: absolute; top: 120px; left: 118px;'><b>version ".$e107info['e107_version'].", build ".($e107info['e107_build'] ? $e107info['e107_build'] : "zero")."</b><br />&copy; 2002-2006, all rights reserved</div>
+
+";
+
+
+$fadejs = "
+<script type='text/javascript'>
+<!--
+
+var delay = 2000;
+var maxsteps=30;
+var stepdelay=40;
+var startcolor= new Array(255,255,255);
+var endcolor=new Array(0,0,0);
+var fcontent=new Array();
+";
+
+
+
+if(e_QUERY && e_QUERY == "stps")
+{
+	$count=1;
+	$fadejs .= "fcontent[0] = '<br /><br />".CRELAN_2."';";
+	foreach($creditsArray as $credits)
+	{
+		extract($credits);
+		$fadejs .= "fcontent[$count] = '<br /><br /><h1>$name</h1>version $version<br /><br />$description<br /><br />[ <a href=\"$url\" rel=\"external\">$url</a> ]';
+		";
+		$count++;
+	}
+}
+else
+{
+	$count=0;
+	foreach($contentA as $content)
+	{
+		$fadejs .= "fcontent[$count] = '<br /><br />$content';
+		";
+		$count++;
+	}
+}
+
+
+
+$fadejs .= <<<TEXT
+begintag='';
+closetag='';
+
+
+var fadelinks=1;
+
+var fwidth='95%';
+var fheight='220px;'
+
+
+///No need to edit below this line/////////////////
+
+var ie4=document.all&&!document.getElementById;
+var DOM2=document.getElementById;
+var faderdelay=0;
+var index=0;
+
+
+/*Rafael Raposo edited function*/
+//function to change content
+function changecontent(){
+  if (index>=fcontent.length)
+    index=0
+  if (DOM2){
+    document.getElementById("fscroller").style.color="rgb("+startcolor[0]+", "+startcolor[1]+", "+startcolor[2]+")"
+    document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
+    if (fadelinks)
+      linkcolorchange(1);
+    colorfade(1, 15);
+  }
+  else if (ie4)
+    document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
+  index++
+}
+
+// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
+// Modified by Dynamicdrive.com
+
+function linkcolorchange(step){
+  var obj=document.getElementById("fscroller").getElementsByTagName("A");
+  if (obj.length>0){
+    for (i=0;i<obj.length;i++)
+      obj[i].style.color=getstepcolor(step);
+  }
+}
+
+/*Rafael Raposo edited function*/
+var fadecounter;
+function colorfade(step) {
+  if(step<=maxsteps) {
+    document.getElementById("fscroller").style.color=getstepcolor(step);
+    if (fadelinks)
+      linkcolorchange(step);
+    step++;
+    fadecounter=setTimeout("colorfade("+step+")",stepdelay);
+  }else{
+    clearTimeout(fadecounter);
+    document.getElementById("fscroller").style.color="rgb("+endcolor[0]+", "+endcolor[1]+", "+endcolor[2]+")";
+    setTimeout("changecontent()", delay);
+
+  }
+}
+
+/*Rafael Raposo's new function*/
+function getstepcolor(step) {
+  var diff
+  var newcolor=new Array(3);
+  for(var i=0;i<3;i++) {
+    diff = (startcolor[i]-endcolor[i]);
+    if(diff > 0) {
+      newcolor[i] = startcolor[i]-(Math.round((diff/maxsteps))*step);
+    } else {
+      newcolor[i] = startcolor[i]+(Math.round((Math.abs(diff)/maxsteps))*step);
+    }
+  }
+  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
+}
+
+if (ie4||DOM2)
+  document.write('<div id="fscroller" style="text-align: center; width:'+fwidth+';height:'+fheight+'"></div>');
+
+if (window.addEventListener)
+window.addEventListener("load", changecontent, false)
+else if (window.attachEvent)
+window.attachEvent("onload", changecontent)
+else if (document.getElementById)
+window.onload=changecontent
+</script>
+<ilayer id="fscrollerns" width=&{fwidth}; height=&{fheight};><layer id="fscrollerns_sub" width=&{fwidth}; height=&{fheight}; left=0 top=0></layer></ilayer>
+
+TEXT;
+
+
+
+echo $fadejs;
+
+
+echo "
+<div style='text-align: center; margin-left: auto; margin-right: auto;'>
+<form>".
+(e_QUERY && e_QUERY == "stps" ? "<input class='tbox' type='button' onclick=\"self.parent.location='".e_ADMIN."credits.php'\" value='Show e107 Dev Team'>" : "<input class='tbox' type='button' onclick=\"self.parent.location='".e_ADMIN."credits.php?stps'\" value='Show third party scripts'>")."
+</form>
+</div>
+";
+
+?>
+
+
diff -ruN 6171/e107_admin/custommenu.php 75/e107_admin/custommenu.php
--- 6171/e107_admin/custommenu.php	2004-09-06 04:54:56.000000000 -0500
+++ 75/e107_admin/custommenu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,325 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/links.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|        16/02/2003
-+---------------------------------------------------------------+
-*/
-
-
-
-require_once("../class2.php");
-if($pref['htmlarea']){
-   require_once(e_HANDLER."htmlarea/htmlarea.inc.php");
-   $htmlarea_js =  htmlarea("menu_text");
-}
-
-if(!getperms("I")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-require_once(e_HANDLER."ren_help.php");
-
-// New texteparse used
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-// End of new textparse
-
-$aj = new textparse;
-$cm = array();
-$cm2 = array();
-unset($message);
-
-// Create link
-if(IsSet($_POST['mainmenu_link']) && $_POST['type_content']==2){
-  //global $PLUGINS_DIRECTORY;
-  if(!$sql -> db_Select("links","link_id","link_name='".$_POST['menu_name']."' AND link_category='1' ")){
-    $sql -> db_Insert("links", "0, '".$_POST['menu_name']."', '".$PLUGINS_DIRECTORY."custompages/".$_POST['menu_name'].".php', '', '', '1', '0', '0', '0', '0'");
-    $message = CUSLAN_28."<br /><br />";
-  }else{
-    $message = CUSLAN_27."<br /><br />";
-  }
-}
-
-if((IsSet($_POST['add_menu']) || IsSet($_POST['update_menu'])) && $_POST['type_content']==1){
-
-        if(!$_POST['menu_name'] || !$_POST['menu_caption'] || !$_POST['menu_text']){
-                $message .= CUSLAN_1;
-        }else{
-
-
-
-                $_POST['menu_caption'] = $etp -> e107in_basic($_POST['menu_caption']);
-                $_POST['menu_text'] = $etp -> e107in_basic($_POST['menu_text']);
-                /*
-                $search = array("\"", "'", "\\");
-                $replace = array("&quot;", "&#39;", "&#92;");
-                $_POST['menu_caption']  = str_replace($search, $replace, stripslashes($_POST['menu_caption']));
-                $_POST['menu_text']  = str_replace($search, $replace, stripslashes($_POST['menu_text']));
-                */
-                $data = chr(60)."?php\n".
-chr(47)."*\n+---------------------------------------------------------------+\n|        e107 website system\n|        ".e_PLUGIN.$_POST['menu_name']."/custom_".$_POST['menu_name'].".php\n|\n|        Steve Dunstan 2001-2002\n|        http://e107.org\n|        jalist@e107.org\n|\n|        Released under the terms and conditions of the\n|        GNU General Public License (http://gnu.org).\n+---------------------------------------------------------------+\n\nThis file has been generated by ".e_ADMIN."custommenu.php.\n\n*".
-chr(47)."\n\n".
-chr(36)."caption = ".chr(34).$_POST['menu_caption'].chr(34).";\n".
-chr(36)."text = ".chr(34).$_POST['menu_text'].chr(34).";\n".
-
-
-chr(36)."aj = new textparse;\n".
-chr(36)."caption = ".chr(36)."aj -> tpa(".chr(36)."caption, \"on\");\n".
-chr(36)."text = ".chr(36)."aj -> tpa(".chr(36)."text, \"on\",\"admin\");\n".
-chr(36)."ns -> tablerender(".chr(36)."caption, ".chr(36)."text);\n?".chr(62);
-
-$_POST['menu_caption'] = $etp -> e107out_basic($_POST['menu_caption']);
-$_POST['menu_text'] = $etp -> e107out_basic($_POST['menu_text']);
-
-                $fp = @fopen(e_PLUGIN."custom/".$_POST['menu_name'].".php","w");
-                if(!@fwrite($fp, $data)){
-                        $message .= CUSLAN_2.e_PLUGIN.CUSLAN_3;
-                }else{
-                        fclose($fp);
-                        $message .= (IsSet($_POST['update_menu']) ? CUSLAN_4 : CUSLAN_5);
-                        unset($_POST['menu_name'], $_POST['menu_caption'], $_POST['menu_text'], $_POST['edit'], $_POST['type_content']);
-                }
-        }
-}
-
-if((IsSet($_POST['add_menu']) || IsSet($_POST['update_menu'])) && $_POST['type_content']==2){
-
-        if(!$_POST['menu_name'] || !$_POST['menu_caption'] || !$_POST['menu_text']){
-                $message .= CUSLAN_1;
-        }else{
-
-
-                $_POST['menu_caption'] = $etp -> e107in_basic($_POST['menu_caption']);
-                $_POST['menu_text'] = $etp -> e107in_basic($_POST['menu_text']);
-                /*
-                $search = array("\"", "'", "\\");
-                $replace = array("&quot;", "&#39;", "&#92;");
-                $_POST['menu_caption']  = str_replace($search, $replace, stripslashes($_POST['menu_caption']));
-                $_POST['menu_text']  = str_replace($search, $replace, stripslashes($_POST['menu_text']));
-                */
-                $data = chr(60)."?php\n".
-chr(47)."*\n+---------------------------------------------------------------+\n|        e107 website system\n|        ".e_PLUGIN."/custompages/".$_POST['menu_name'].".php\n|\n|        e107 Dev Team (Lolo Irie) 2004\n|        http://e107.org\n|        \n|\n|        Released under the terms and conditions of the\n|        GNU General Public License (http://gnu.org).\n+---------------------------------------------------------------+\n\nThis file has been generated by ".e_ADMIN."custommenu.php.\n\n*".
-chr(47)."\n
-require_once(\"../../class2.php\");\n
-require_once(HEADERF);\n\n".
-chr(36)."caption = ".chr(34).$_POST['menu_caption'].chr(34).";\n".
-chr(36)."text = ".chr(34).$_POST['menu_text'].chr(34).";\n".
-
-
-chr(36)."aj = new textparse;\n".
-chr(36)."caption = ".chr(36)."aj -> tpa(".chr(36)."caption, \"on\");\n".
-chr(36)."text = ".chr(36)."aj -> tpa(".chr(36)."text, \"on\",\"admin\");\n".
-chr(36)."ns -> tablerender(".chr(36)."caption, ".chr(36)."text);\n\n
-require_once(FOOTERF);\n
-?".chr(62);
-
-$_POST['menu_caption'] = $etp -> e107out_basic($_POST['menu_caption']);
-$_POST['menu_text'] = $etp -> e107out_basic($_POST['menu_text']);
-
-                $fp = @fopen(e_PLUGIN."custompages/".$_POST['menu_name'].".php","w");
-                if(!@fwrite($fp, $data)){
-                        $message .= CUSLAN_20.e_PLUGIN.CUSLAN_21;
-                }else{
-                        fclose($fp);
-                        $message .= (IsSet($_POST['update_menu']) ? CUSLAN_4 : CUSLAN_24." ".SITEURL.CUSLAN_29);
-                        unset($_POST['menu_name'], $_POST['menu_caption'], $_POST['menu_text'], $_POST['edit'], $_POST['type_content']);
-                }
-        }
-}
-
-if(IsSet($_POST['preview'])){
-        $menu_caption = $aj -> tpa($_POST['menu_caption']);
-        $menu_text = $aj -> tpa($_POST['menu_text'],"on","admin");
-        echo "<div style='text-align:center'>
-        <table style='width:200px'>
-        <tr>
-        <td>";
-        $ns -> tablerender($menu_caption, $menu_text);
-        echo "</td></tr></table></div><br /><br />";
-        $_POST['menu_caption'] = $aj -> tpa($_POST['menu_caption']);
-        $_POST['menu_text'] = $aj -> tpa($_POST['menu_text']);
-        $_POST['menu_text'] = str_replace("<br />", "", $_POST['menu_text']);
-}else if(IsSet($_POST['edit'])){
-        $menu = e_PLUGIN."custom/".$_POST['existing'];
-        if($fp = @fopen($menu,"r")){
-                $buffer = str_replace("\n", "", fread($fp, filesize($menu)));
-                fclose($fp);
-                preg_match_all("/\"(.*?)\"/", $buffer, $result);
-                $_POST['menu_caption'] = $etp -> e107out_basic($result[1][0]);
-                $_POST['menu_text'] = $etp -> e107out_basic($result[1][1]);
-                $_POST['menu_text'] = str_replace("<br />", "", $_POST['menu_text']);
-                $_POST['menu_name'] = eregi_replace(e_PLUGIN."custom/|.php", "", $menu);
-                                $_POST['type_content'] = 1;
-        }else{
-                $message .= CUSLAN_6." '".$_POST['existing']."' ".CUSLAN_7;
-        }
-}else if(IsSet($_POST['edit2'])){
-        $menu = e_PLUGIN."custompages/".$_POST['existingpages'];
-        if($fp = @fopen($menu,"r")){
-                $buffer = str_replace("\n", "", fread($fp, filesize($menu)));
-                fclose($fp);
-                preg_match_all("/\"(.*?)\"/", $buffer, $result);
-                $_POST['menu_caption'] = $etp -> e107out_basic($result[1][1]);
-                $_POST['menu_text'] = $etp -> e107out_basic($result[1][2]);
-                $_POST['menu_text'] = str_replace("<br />", "", $_POST['menu_text']);
-                $_POST['menu_name'] = eregi_replace(e_PLUGIN."custompages/|.php", "", $menu);
-                                $_POST['type_content'] = 2;
-        }else{
-                $message .= CUSLAN_6." '".$_POST['existing']."' ".CUSLAN_7;
-        }
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."' id='dataform'>
-<table style='width:85%' class='fborder'>
-<tr>
-
-<td style='text-align:center' colspan='2' class='forumheader'><span class='defaulttext'>".CUSLAN_8.":</span> ";
-
-$handle=opendir(e_PLUGIN."custom/");
-while(false !== ($file = readdir($handle))){
-        if($file != "." && $file != ".."){
-                $cm[] = $file;
-                $found = TRUE;
-        }
-}
-closedir($handle);
-
-$c = 0;
-if($found){
-        $text .= "<select name='existing' class='tbox'>";
-        while($cm[$c]){
-                $text .= "<option>".$cm[$c]."</option>";
-                $c++;
-        }
-        $text .= "</select>\n<input class='button' type='submit' name='edit' value='".CUSLAN_9."' /> ";
-}else{
-        $text .= "<span class='defaulttext'>".CUSLAN_10."</span>";
-}
-
-$text .= "
-</td>
-</tr>";
-
-$text .= "<tr>
-
-<td style='text-align:center' colspan='2' class='forumheader'><span class='defaulttext'>".CUSLAN_19.":</span> ";
-
-$handle=opendir(e_PLUGIN."custompages/");
-while(false !== ($file = readdir($handle))){
-        if($file != "." && $file != ".."){
-                $cm2[] = $file;
-                $found2 = TRUE;
-        }
-}
-closedir($handle);
-
-$c = 0;
-if($found2){
-        $text .= "<select name='existingpages' class='tbox'>";
-        while($cm2[$c]){
-                $text .= "<option>".$cm2[$c]."</option>";
-                $c++;
-        }
-        $text .= "</select>\n<input class='button' type='submit' name='edit2' value='".CUSLAN_9."' /> ";
-}else{
-        $text .= "<span class='defaulttext'>".CUSLAN_10."</span>";
-}
-
-$_POST['menu_text'] = str_replace("&nbsp;","&#38;nbsp;",$_POST['menu_text']);
-
-$text .= "
-</td>
-</tr>";
-
-$text .= "<tr>
-<td style='width:30%' class='forumheader3'>".CUSLAN_11.": </td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' size='25' maxlength='25' name='menu_name' value='".$_POST['menu_name']."' />
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".CUSLAN_12.": </td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' size='60' maxlength='250' name='menu_caption' value='".$_POST['menu_caption']."' />
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".CUSLAN_13.": </td>
-<td style='width:70%' class='forumheader3'>
-<textarea class='tbox' id='menu_text' name='menu_text' cols='59' rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$_POST['menu_text']."</textarea>
-</td>
-</tr>";
-
-if(!$pref['htmlarea']){
-     $text .="
-     <tr>
-     <td class='forumheader3'>&nbsp;</td>
-     <td class='forumheader3'>
-     <input class='helpbox' type='text' name='helpb' size='100' />
-     <br />". ren_help()."</td>
-     </tr>";
-}
-
-$text .= "<tr>
-<td style='width:30%' class='forumheader3'>".CUSLAN_22.": </td>
-<td style='width:70%' class='forumheader3'>
-<input type='radio' name='type_content' value='1' ".( $_POST['type_content']==1 ? "checked" : "" )." />
-</td>
-</tr>";
-
-$text .= "<tr>
-<td style='width:30%' class='forumheader3'>".CUSLAN_23.": </td>
-<td style='width:70%' class='forumheader3'>
-<input type='radio' name='type_content' value='2' ".( $_POST['type_content']==2 ? "checked" : "" )." />
-<br />".CUSLAN_25." <input type='checkbox' name='mainmenu_link' value='1' />
-<br />
-<b class=\"smalltext\" >".CUSLAN_26."<br /><a href=\"".e_ADMIN."links.php\" >".CUSLAN_30."</a></b></td>
-</tr>";
-
-
-
-$text .="
-<tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center' class='forumheader'>";
-if(IsSet($_POST['preview'])){
-        $text .= "<input class='button' type='submit' name='preview' value='".CUSLAN_14."' /> ";
-        if(IsSet($_POST['edit'])){
-                $text .= "<input type='hidden' name='edit' value='".$_POST['edit']."'>";
-        }
-}else{
-        $text .= "<input class='button' type='submit' name='preview' value='".CUSLAN_15."' /> ";
-        if(IsSet($_POST['edit'])){
-                $text .= "<input type='hidden' name='edit' value='".$_POST['edit']."'>";
-        }
-}
-
-if(IsSet($_POST['edit'])){
-        $text .= "<input class='button' type='submit' name='update_menu' value='".CUSLAN_16."' />";
-}else{
-        $text .= "<input class='button' type='submit' name='add_menu' value='".CUSLAN_17."' />";
-}
-$text .= "</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".CUSLAN_18."</div>", $text);
-
-require_once("footer.php");
-?>
\ No newline at end of file
diff -ruN 6171/e107_admin/db.php 75/e107_admin/db.php
--- 6171/e107_admin/db.php	2004-05-18 22:32:30.000000000 -0500
+++ 75/e107_admin/db.php	2005-11-23 07:25:10.000000000 -0600
@@ -1,211 +1,110 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/db.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-
-if(IsSet($_POST['dump_sql'])){
-        if(!getperms("0")){
-                header("location: ".e_ADMIN."admin.php");
-                exit;
-        }
-        getsql($mySQLdefaultdb);
-        exit;
-}
-
-if(IsSet($_POST['db_update'])){
-        header("location: ".e_ADMIN."e107_update.php");
-        exit;
-}
-
-if(IsSet($_POST['verify_sql'])){
-        header("location: ".e_ADMIN."db_verify.php");
-        exit;
-}
-
-require_once("auth.php");
-if(IsSet($_POST['optimize_sql'])){
-        optimizesql($mySQLdefaultdb);
-        require_once("footer.php");
-        exit;
-}
-
-if(IsSet($_POST['backup_core'])){
-        backup_core();
-        message_handler("MESSAGE", DBLAN_1);
-}
-
-
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>\n
-<table style='width:85%' class='fborder'>
-
-<tr>
-<td style='width:70%' class='forumheader3'>".DBLAN_15."</td>
-<td class='forumheader3' style='width:30%;text-align:center'><input class='button' type='submit' name='db_update' value='".DBLAN_16."' /></td>
-</tr>
-
-<tr>
-<td style='width:70%' class='forumheader3'>".DBLAN_2."</td>
-<td class='forumheader3' style='width:30%;text-align:center'><input class='button' type='submit' name='dump_sql' value='".DBLAN_3."' /></td>
-</tr>
-
-<tr>
-<td style='width:70%' class='forumheader3'>".DBLAN_4."</td>
-<td class='forumheader3' style='width:30%;text-align:center'><input class='button' type='submit' name='verify_sql' value='".DBLAN_5."' /></td>
-</tr>
-
-<tr>
-<td style='width:70%' class='forumheader3'>".DBLAN_6."</td>
-<td class='forumheader3' style='width:30%;text-align:center'><input class='button' type='submit' name='optimize_sql' value='".DBLAN_7."' /></td>
-</tr>
-
-<tr>
-<td style='width:70%' class='forumheader3'>".DBLAN_8."</td>
-<td class='forumheader3' style='width:30%;text-align:center'><input class='button' type='submit' name='backup_core' value='".DBLAN_9."' />
-<input type='hidden' name='sqltext' value='$sqltext' />
-</td></tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender(DBLAN_10, $text);
-
-function backup_core(){
-        global $pref, $sql;
-        if($sql -> db_Select("core", "*", "e107_name='pref_backup' ")){
-                save_prefs();
-        }else{
-                $tmp = addslashes(serialize($pref));
-                $sql -> db_Insert("core", "'pref_backup', '$tmp' ");
-        }
-}
-
-function optimizesql($mySQLdefaultdb){
-
-        $result = mysql_list_tables($mySQLdefaultdb);
-        while ($row = mysql_fetch_row($result)){
-                mysql_query("OPTIMIZE TABLE ".$row[0]);
-        }
-
-        $str = "
-        <div style='text-align:center'>
-        <b>".DBLAN_11." $mySQLdefaultdb ".DBLAN_12.".</b>
-
-        <br /><br />
-
-        <form method='POST' action='".e_SELF."'>
-        <input class='button' type='submit' name='back' value='".DBLAN_13."' />
-        </form>
-        </div>
-        <br />";
-        $ns = new e107table;
-        $ns -> tablerender(DBLAN_14, $str);
-
-}
-
-
-function getsql($mySQLdefaultdb){
-        $filename = "e107_backup";
-        $ext = "sql";
-        $mime_type = "'application/octet-stream";
-        $now = gmdate('D, d M Y H:i:s') . ' GMT';
-
-    header('Content-Type: ' . $mime_type);
-    header('Expires: ' . $now);
-        header('Content-Disposition: inline; filename="' . $filename . '.' . $ext . '"');
-        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
-        header('Pragma: public');
-
-        $sql = new db;
-        $result = mysql_list_tables($mySQLdefaultdb);
-        $es = " \r\n";
-        $sqltext = "#".$es."# e107 sql-dump".$es."# Database: $mySQLdefaultdb".$es."#".$es."# Date: " .  gmdate("d-m-Y H:i:s", time()) . " GMT".$es."#".$es;
-        while ($row = mysql_fetch_row($result)){
-                $sqltext .= $es.$es."## Create data for ".$row[0]." ##".$es;
-                $sqltext .= "CREATE TABLE ".$row[0]."(".$es;
-                $sql -> db_Select_gen("SHOW FIELDS FROM $row[0]");
-                while ($var = $sql -> db_Fetch()){
-                        $sqltext .= '        ' . $var['Field'] . ' ' . $var['Type'];
-                        if(!empty($var['Default'])){
-                                $sqltext .= ' DEFAULT \'' . $var['Default'] . '\'';
-                        }
-                        if($var['Null'] != "YES"){
-                                $sqltext .= ' NOT NULL';
-                        }
-                        if($var['Extra'] != ""){
-                                $sqltext .= ' ' . $var['Extra'];
-                        }
-                        $sqltext .= ",$es";
-                }
-                $sqltext = ereg_replace(','. $es .'$', "", $sqltext);
-                $sql -> db_Select_gen("SHOW KEYS FROM $row[0]");
-                while ($var = $sql -> db_Fetch()){
-                        $kname = $var['Key_name'];
-                        if(($kname != 'PRIMARY') && ($var['Non_unique'] == 0)){
-                                $kname = "UNIQUE|$kname";
-                        }
-                        if(!is_array($index[$kname])){
-                                $index[$kname] = array();
-                        }
-                        $index[$kname][] = $var['Column_name'];
-                }
-                while(list($x, $columns) = @each($index)){
-                        $sqltext .= ", $es";
-                        if($x == 'PRIMARY'){
-                                $sqltext .= '        PRIMARY KEY (' . implode($columns, ', ') . ')';
-                        }
-                        elseif (substr($x,0,6) == 'UNIQUE'){
-                                $sqltext .= '        UNIQUE ' . substr($x,7) . ' (' . implode($columns, ', ') . ')';
-                        }else{
-                                $sqltext .= "        KEY $x (" . implode($columns, ', ') . ')';
-                        }
-                }
-                $sqltext .= "$es);";
-                $maintable = ereg_replace(MPREFIX, "", $row[0]);
-                $sql -> db_Select($maintable);
-                while ($var = $sql -> db_Fetch()){
-                        $sqltext .= $es.$es."## Table Data for ".$row[0]." ##";
-                        $field_names = array();
-                        $num_fields = $sql -> db_Num_fields();
-                        $table_list = '(';
-                        for ($j = 0; $j < $num_fields; $j++){
-                                $field_names[$j] = $sql -> db_Fieldname($j);
-                                $table_list .= (($j > 0) ? ', ' : '') . $field_names[$j];
-
-                        }
-                        $table_list .= ')';
-                        do{
-                                $sqltext .= $es."INSERT INTO ".$row[0]." $table_list VALUES(";
-                                for ($j = 0; $j < $num_fields; $j++){
-                                        $sqltext .= ($j > 0) ? ', ' : '';
-                                        if(!isset($var[$field_names[$j]])){
-                                                $sqltext .= 'NULL';
-                                        }elseif ($var[$field_names[$j]] != ''){
-                                                $sqltext .= "'".addslashes($var[$field_names[$j]])."'";
-                                        }else{
-                                                $sqltext .= "''";
-                                        }
-                                }
-                                $sqltext .= ');';
-                                $sqltext = trim($sqltext);
-                        }
-                        while ($var = $sql -> db_Fetch());
-                }
-        }
-        echo $sqltext;
-}
-
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/db.php,v $
+|     $Revision: 1.15 $
+|     $Date: 2005/11/23 13:25:10 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../class2.php");
+$e_sub_cat = 'database';
+
+if (isset($_POST['db_update'])) {
+	header("location: ".e_ADMIN."e107_update.php");
+	exit;
+}
+
+if (isset($_POST['verify_sql'])) {
+	header("location: ".e_ADMIN."db_verify.php");
+	exit;
+}
+
+require_once("auth.php");
+if (isset($_POST['optimize_sql'])) {
+	optimizesql($mySQLdefaultdb);
+	require_once("footer.php");
+	exit;
+}
+
+if (isset($_POST['backup_core'])) {
+	backup_core();
+	message_handler("MESSAGE", DBLAN_1);
+}
+
+
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>\n
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+
+	<tr>
+	<td style='width:70%' class='forumheader3'>".DBLAN_15."</td>
+	<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='db_update' value='".DBLAN_16."' /></td>
+	</tr>
+	
+	<tr>
+	<td style='width:70%' class='forumheader3'>".DBLAN_4."</td>
+	<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='verify_sql' value='".DBLAN_5."' /></td>
+	</tr>
+
+	<tr>
+	<td style='width:70%' class='forumheader3'>".DBLAN_6."</td>
+	<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='optimize_sql' value='".DBLAN_7."' /></td>
+	</tr>
+
+	<tr>
+	<td style='width:70%' class='forumheader3'>".DBLAN_8."</td>
+	<td class='forumheader3' style='width:30%;text-align:center'><input class='button' style='width: 100%' type='submit' name='backup_core' value='".DBLAN_9."' />
+	<input type='hidden' name='sqltext' value='$sqltext' />
+	</td></tr>
+	</table>
+	</form>
+	</div>";
+
+$ns->tablerender(DBLAN_10, $text);
+
+function backup_core() {
+	global $pref, $sql;
+	$tmp = base64_encode((serialize($pref)));
+	if (!$sql->db_Insert("core", "'pref_backup', '{$tmp}' ")) {
+		$sql->db_Update("core", "e107_value='{$tmp}' WHERE e107_name='pref_backup'");
+	}
+}
+
+function optimizesql($mySQLdefaultdb) {
+
+	$result = mysql_list_tables($mySQLdefaultdb);
+	while ($row = mysql_fetch_row($result)) {
+		mysql_query("OPTIMIZE TABLE ".$row[0]);
+	}
+
+	$str = "
+		<div style='text-align:center'>
+		<b>".DBLAN_11." $mySQLdefaultdb ".DBLAN_12.".</b>
+
+		<br /><br />
+
+		<form method='POST' action='".e_SELF."'>
+		<input class='button' type='submit' name='back' value='".DBLAN_13."' />
+		</form>
+		</div>
+		<br />";
+	$ns = new e107table;
+	$ns->tablerender(DBLAN_14, $str);
+
+}
+
+require_once("footer.php");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/db_verify.php 75/e107_admin/db_verify.php
--- 6171/e107_admin/db_verify.php	2004-05-01 22:42:32.000000000 -0500
+++ 75/e107_admin/db_verify.php	2005-08-23 04:36:30.000000000 -0500
@@ -1,208 +1,409 @@
-<?php
-
-/*****************************************************
-e107 SQL verification script
-
-Mar 02, 2004 (McFly)
-        + Added field number verification
-        + Will now work with table that have multiple KEYs
-
-*****************************************************/
-require_once("../class2.php");
-require_once("auth.php");
-
-$filename = "sql/core_sql.php";
-@$fd = fopen ($filename, "r");
-$sql_data = @fread($fd, filesize($filename));
-@fclose ($fd);
-
-if(!$sql_data){
-        echo DBLAN_1."<br /><br />";
-        exit;
-}
-
-$tables["core"]=$sql_data;
-
-// require_once(HEADERF);
-
-if(!getperms("0")){ header("location:".e_BASE."index.php"); exit; }
-
-//Get any plugin _sql.php files
-$handle=opendir(e_PLUGIN);
-$c=1;
-while(false !== ($file = readdir($handle))){
-        if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)){
-                $plugin_handle=opendir(e_PLUGIN.$file."/");
-                while(false !== ($file2 = readdir($plugin_handle))){
-                        if(preg_match("/(.*?)_sql.php/",$file2,$matches)){
-                                $filename = e_PLUGIN.$file."/".$file2;
-                                @$fd = fopen ($filename, "r");
-                                $sql_data = @fread($fd, filesize($filename));
-                                @fclose ($fd);
-                                $tables[$matches[1]]=$sql_data;
-                        }
-                }
-                closedir($plugin_handle);
-        }
-}
-closedir($handle);
-
-
-function read_tables($tab){
-        global $tablines;
-        global $table_list;
-        global $tables;
-        $file=split("\n",$tables[$tab]);
-        foreach($file as $line){
-                $line=ltrim(stripslashes($line));
-                if(preg_match("/CREATE TABLE (.*) /",$line,$match)){
-                        $table_list[$match[1]]=1;
-                        $current_table=$match[1];
-                        $x=0;
-                        $cnt=0;
-                }
-                if(preg_match("/TYPE=/",$line,$match)){
-                        $current_table="";
-                }
-                if($current_table && $x){
-                        $tablines[$current_table][$cnt++]=$line;
-                }
-                $x=1;
-        }
-}
-
-function get_current($tab,$prefix=""){
-        if(!$prefix){$prefix=MPREFIX;}
-        $result= mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
-        $qry='SHOW CREATE TABLE `'.$prefix.$tab."`";
-   $z=mysql_query($qry);
-        if($z){
-           $row=mysql_fetch_row($z);
-           return str_replace("`","",stripslashes($row[1]));
-   } else {
-           return FALSE;
-   }
-}
-
-function check_tables($what){
-        global $tablines;
-        global $table_list;
-        global $ns;
-
-        $table_list="";
-        read_tables($what);
-
-        $text="<div style='text-align:center'>
-        <table style='width:96%' class='fborder'>
-        <tr>
-        <td class='forumheader' style='text-align:center'>".DBLAN_4."</td>
-        <td class='forumheader' style='text-align:center'>".DBLAN_5."</td>
-        <td class='forumheader' style='text-align:center'>".DBLAN_6."</td>
-        <td class='forumheader' style='text-align:center'>".DBLAN_7."</td>
-        </tr>";
-        foreach(array_keys($table_list) as $k){
-                $text.="<tr>";
-                $prefix=MPREFIX;
-                $current_tab=get_current($k,$prefix);
-                unset($fields);
-                unset($xfields);
-                if($current_tab){
-                        $lines=split("\n",$current_tab);
-                        $fieldnum=0;
-                        foreach($tablines[$k] as $x){
-                                $fieldnum++;
-                                $ffound=0;
-                                list($fname,$fparams)=split(" ",$x,2);
-                                if($fname == "KEY"){
-                                        list($key,$keyname,$keyparms)=split(" ",$x,3);
-                                        $fname=$key." ".$keyname;
-                                        $fparams = $keyparms;
-                                }
-                                $fields[$fname]=1;
-                                $fparams=ltrim(rtrim($fparams));
-                                $fparams=preg_replace("/\r?\n$|\r[^\n]$|,$/", "", $fparams);
-                                $text.="<tr><td class='forumheader3'>$k</td><td class='forumheader3'>$fname";
-                                if(preg_match("#KEY#",$fparams)){$text .= " $fparams";}
-                                $text .= "</td>";
-                                $s=0;
-                                $xfieldnum=-1;
-                                foreach($lines as $l){
-                                        $xfieldnum++;
-                                        list($xl,$tmp)=split("\n",$l,2);
-                                        $xl=ltrim(rtrim(stripslashes($xl)));
-                                        $xl=preg_replace("/\r?\n$|\r[^\n]$/", "", $xl);
-                                        list($xfname,$xfparams)=split(" ",$xl,2);
-
-                                        if($xfname == "KEY"){
-                                                list($key,$keyname,$keyparms)=split(" ",$xl,3);
-                                                $xfname=$key." ".$keyname;
-                                                $xfparams = $keyparms;
-                                        }
-
-                                        if($xfname != "CREATE" && $xfname !=")"){
-                                                $xfields[$xfname]=1;
-                                        }
-                                        $xfparams=preg_replace("/,$/", "", $xfparams);
-                                        $fparams=preg_replace("/,$/", "", $fparams);
-                                        if($xfname==$fname){
-                                                $ffound=1;
-                                                if(strcasecmp($fparams,$xfparams) != 0){
-                                                        $text.="<td class='forumheader' style='text-align:center'>".DBLAN_8."</td>";
-                                                        $text.="<td class='forumheader3' style='text-align:center'>".DBLAN_9."<div class='indent'>".$xfparams."</div><b>".DBLAN_10."</b><div class='indent'>".$fparams."</div></td>";
-                                                } elseif($fieldnum != $xfieldnum) {
-                                                        $text.="<td class='fcaption' style='text-align:center'>".DBLAN_5." ".DBLAN_8."</td>
-                                                        <td class='forumheader3' style='text-align:center'>".DBLAN_9." #{$xfieldnum}<br />".DBLAN_10." #{$fieldnum}</td>";
-                                                } else {
-                                                        $text.="<td class='forumheader3' style='text-align:center;'>OK</td>
-                                                        <td class='forumheader3' style='text-align:center'>&nbsp;</td>";
-                                                }
-                                        }
-                                }
-                                if($ffound==0){
-                                        $text.="<td class='forumheader' style='text-align:center'><strong><em>".DBLAN_11."</em></strong></td>
-                                        <td class='forumheader3' style='text-align:center'><b>".DBLAN_10." [$fparams]</b></td>";
-                                }
-                                $text.="</tr>\n";
-                        }
-                        foreach(array_keys($xfields) as $tf){
-                                if(!$fields[$tf]){
-                                        $text.="<tr><td class='forumheader3' style='text-align:center'>$k</td><td class='forumheader3' style='text-align:center'>$tf</td><td class='forumheader3' style='text-align:center'><strong><em>".DBLAN_12."</em></strong></td><td class='forumheader3' style='text-align:center'>&nbsp;</td></tr>";
-                                }
-                        }
-                } else {
-                        $text.="<tr><td class='forumheader3' style='text-align:center'>$k</td><td class='forumheader3' style='text-align:center'>&nbsp;</td><td class='forumheader' style='text-align:center'>".DBLAN_13."<br /><td class='forumheader3' style='text-align:center'>&nbsp;</td></tr>";
-                }
-        }
-        $text.="</table></div>";
-        return $text;
-}
-
-global $table_list;
-if(!$_POST){
-        $text="
-        <form method='POST' action='".e_SELF."'>
-        <table border=0 align='center'>
-        <tr><td>".DBLAN_14."<br /><br />";
-        foreach(array_keys($tables) as $x){
-                $text.="<input type='checkbox' name='table_".$x."'>".$x."<br />";
-        }
-        $text.="
-        <br /><input class='button' type='submit' value='".DBLAN_15."'>
-        </td></tr></table></form>";
-        $ns->tablerender(DBLAN_16,$text);
-} else {
-        foreach(array_keys($_POST) as $k){
-                if(preg_match("/table_(.*)/",$k,$match)){
-                        $xx=$match[1];
-                        $str = "<br />
-                        <div style='text-align:center'>
-                        <form method='POST' action='db.php'>
-                        <input class='button' type='submit' name='back' value='".DBLAN_17."' />
-                        </form>
-                        </div>";
-                        $ns->tablerender(DBLAN_16." - $xx ".DBLAN_18,check_tables($xx).$str);
-                }
-        }
-}
-require_once(e_ADMIN."footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/db_verify.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2005/08/23 09:36:30 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+$e_sub_cat = 'database';
+require_once("auth.php");
+
+$filename = "sql/core_sql.php";
+@$fd = fopen ($filename, "r");
+$sql_data = @fread($fd, filesize($filename));
+@fclose ($fd);
+
+if (!$sql_data) {
+	echo DBLAN_1."<br /><br />";
+	exit;
+}
+
+$tables["core"] = $sql_data;
+
+if (!getperms("0")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+
+//Get installed plugins
+if($sql->db_Select("plugin","plugin_path","plugin_installflag = '1'")){
+	while($row = $sql->db_Fetch()){
+		$pluginList[] = $row['plugin_path'];
+	}
+}
+
+//Get any plugin _sql.php files
+$handle = opendir(e_PLUGIN);
+$c = 1;
+while (false !== ($file = readdir($handle))) {
+	if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file) && in_array($file, $pluginList))
+	{
+		$plugin_handle = opendir(e_PLUGIN.$file."/");
+		while (false !== ($file2 = readdir($plugin_handle)))
+		{
+			if (preg_match("/(.*?)_sql.php/", $file2, $matches))
+			{
+				$filename = e_PLUGIN.$file."/".$file2;
+				@$fd = fopen ($filename, "r");
+				$sql_data = @fread($fd, filesize($filename));
+				@fclose ($fd);
+				$tables[$matches[1]] = $sql_data;
+			}
+		}
+		closedir($plugin_handle);
+	}
+}
+closedir($handle);
+
+
+function read_tables($tab) {
+	global $tablines;
+	global $table_list;
+	global $tables,$sql,$pref;
+
+	$file = split("\n", $tables[$tab]);
+	foreach($file as $line) {
+		$line = ltrim(stripslashes($line));
+		if (preg_match("/CREATE TABLE (.*) /", $line, $match)) {
+			if($match[1] != "user_extended"){
+				$table_list[$match[1]]  = 1;
+				$current_table = $match[1];
+				$x = 0;
+				$cnt = 0;
+			}
+		}
+
+		if (strpos($line, "TYPE=") !== FALSE) {
+			$current_table = "";
+		}
+
+		if ($current_table && $x) {
+			$tablines[$current_table][$cnt++] = $line;
+
+		}
+
+		$x = 1;
+	}
+
+// Get multi-language tables as well
+	if($pref['multilanguage']){
+		$langs = table_list();
+		foreach($table_list as $name=>$stuff){
+			if($langs[$name]){
+				$ltab = $langs[$name];
+				$table_list[$ltab] = 1;
+				$tablines[$ltab] = $tablines[$name];
+			}
+		}
+	}
+
+}
+
+function get_current($tab, $prefix = "") {
+	if (!$prefix) {
+		$prefix = MPREFIX;
+	}
+	$result = mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
+	$qry = 'SHOW CREATE TABLE `'.$prefix.$tab."`";
+	$z = mysql_query($qry);
+	if ($z) {
+		$row = mysql_fetch_row($z);
+		return str_replace("`", "", stripslashes($row[1]));
+	} else {
+
+		return FALSE;
+	}
+}
+
+function check_tables($what) {
+	global $tablines;
+	global $table_list;
+	global $ns;
+	$cur=0;
+	$table_list = "";
+	read_tables($what);
+
+	$text = "<form method='POST' action='".e_SELF."' id='checktab'>
+		<div style='text-align:center'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td class='fcaption' style='text-align:center'>".DBLAN_4."</td>
+		<td class='fcaption' style='text-align:center'>".DBLAN_5."</td>
+		<td class='fcaption' style='text-align:center'>".DBLAN_6."</td>
+		<td class='fcaption' style='text-align:center'>".DBLAN_7."</td>
+		</tr>";
+	foreach(array_keys($table_list) as $k) {
+		$text .= "<tr>";
+		$prefix = MPREFIX;
+		$current_tab = get_current($k, $prefix);
+		unset($fields);
+		unset($xfields);
+		if ($current_tab) {
+			$lines = split("\n", $current_tab);
+			$fieldnum = 0;
+			foreach($tablines[$k] as $x) {
+				$fieldnum++;
+				$ffound = 0;
+				list($fname, $fparams) = split(" ", $x, 2);
+				if ($fname == "KEY") {
+					list($key, $keyname, $keyparms) = split(" ", $x, 3);
+					$fname = $key." ".$keyname;
+					$fparams = $keyparms;
+				}
+				$fields[$fname] = 1;
+				$fparams = ltrim(rtrim($fparams));
+				$fparams = preg_replace("/\r?\n$|\r[^\n]$|,$/", "", $fparams);
+
+			if(stristr($k, "lan_") !== FALSE && $cur != 1){
+				$text .= "<tr><td colspan='6' class='fcaption'>".ADLAN_132."</td></tr>";
+				$cur = 1;
+			};
+
+
+
+				$text .= "<tr><td class='forumheader3'>$k</td><td class='forumheader3'>$fname";
+				if (strpos($fparams, "KEY") !== FALSE) {
+					$text .= " $fparams";
+				}
+				$text .= "</td>";
+				$s = 0;
+				$xfieldnum = -1;
+				foreach($lines as $l) {
+					$xfieldnum++;
+					list($xl, $tmp) = split("\n", $l, 2);
+					$xl = ltrim(rtrim(stripslashes($xl)));
+					$xl = preg_replace("/\r?\n$|\r[^\n]$/", "", $xl);
+					list($xfname, $xfparams) = split(" ", $xl, 2);
+
+					if ($xfname == "KEY") {
+						list($key, $keyname, $keyparms) = split(" ", $xl, 3);
+						$xfname = $key." ".$keyname;
+						$xfparams = $keyparms;
+					}
+
+					if ($xfname != "CREATE" && $xfname != ")") {
+						$xfields[$xfname] = 1;
+					}
+					$xfparams = preg_replace("/,$/", "", $xfparams);
+					$fparams = preg_replace("/,$/", "", $fparams);
+					if ($xfname == $fname) {
+						$ffound = 1;
+						if (strcasecmp($fparams, $xfparams) != 0) {
+							$text .= "<td class='forumheader' style='text-align:center'>".DBLAN_8."</td>";
+							$text .= "<td class='forumheader3' style='text-align:center'>".DBLAN_9."<div class='indent'>".$xfparams."</div><b>".DBLAN_10."</b><div class='indent'>".$fparams." <br />".fix_form($k,$fname,$fparams,"alter")."</div></td>";
+							$fix_active = TRUE;
+						} elseif($fieldnum != $xfieldnum) {
+							$text .= "<td class='fcaption' style='text-align:center'>".DBLAN_5." ".DBLAN_8."</td>
+								<td class='forumheader3' style='text-align:center'>".DBLAN_9." #{$xfieldnum}<br />".DBLAN_10." #{$fieldnum}</td>";
+						} else {
+							$text .= "<td class='forumheader3' style='text-align:center;'>OK</td>
+								<td class='forumheader3' style='text-align:center'>&nbsp;</td>";
+						}
+					}
+				}
+
+				if ($ffound == 0) {
+					$text .= "<td class='forumheader' style='text-align:center'><strong><em>".DBLAN_11."</em></strong></td>
+						<td class='forumheader3' style='text-align:center'><b>".DBLAN_10." [$fparams]</b><br />".fix_form($k,$fname,$fparams,"insert",$prev_fname)."<br /></td>";
+					$fix_active = TRUE;
+				}
+				$prev_fname = $fname;
+				$text .= "</tr>\n";
+			}
+			foreach(array_keys($xfields) as $tf) {
+				if (!$fields[$tf] && $k != "user_extended") {
+					$fix_active = TRUE;
+					$text .= "<tr><td class='forumheader3' style='text-align:center'>$k</td><td class='forumheader3' style='text-align:center'>$tf</td><td class='forumheader3' style='text-align:center'><strong><em>".DBLAN_12."</em></strong></td><td class='forumheader3' style='text-align:center'>&nbsp;".fix_form($k,$tf,$fparams,"drop")."</td></tr>";
+				}
+			}
+		} else {	// Table Missing.
+			$text .= "<tr><td class='forumheader3' style='text-align:center'>$k</td><td class='forumheader3' style='text-align:center'>&nbsp;</td><td class='forumheader' style='text-align:center'>".DBLAN_13."<br /><td class='forumheader3' style='text-align:center'>&nbsp;".fix_form($k,$tf,$tablines[$k],"create")."</td></tr>";
+			$fix_active = TRUE;
+		}
+	}
+	$text .= "</table></div>";
+
+	if($fix_active){
+		$text .= "<div style='".ADMIN_WIDTH.";text-align:right'>
+		<input class='button' type='submit' name='do_fix' value='".DBLAN_21."' /></div>\n";
+	}
+
+	foreach(array_keys($_POST) as $j) {
+		if (preg_match("/table_(.*)/", $j, $mitch)) {
+			$lx = $mitch[1];
+			$text .= "<input type='hidden' name='table_{$lx}' value='1' />\n";
+		}
+	}
+	$text .= "</form>";
+
+	return $text;
+}
+
+global $table_list;
+
+// -------------------- Table Fixing ------------------------------
+
+if(isset($_POST['do_fix'])){
+	$text = "<div><table class='fborder' style='width:100%'>";
+	foreach( $_POST['fix_active'] as $key=>$val){
+		
+		if (MAGIC_QUOTES_GPC == TRUE) {
+			$table = stripslashes($_POST['fix_table'][$key][0]);
+			$newval = stripslashes($_POST['fix_newval'][$key][0]);
+			$mode = stripslashes($_POST['fix_mode'][$key][0]);
+			$after = stripslashes($_POST['fix_after'][$key][0]);
+		} else {
+			$table = $_POST['fix_table'][$key][0];
+			$newval = $_POST['fix_newval'][$key][0];
+			$mode = $_POST['fix_mode'][$key][0];
+			$after = $_POST['fix_after'][$key][0];
+		}
+		
+		$field= $key;
+
+		if($mode == "alter"){
+			$query = "ALTER TABLE `".MPREFIX.$table."` CHANGE `$field` `$field` $newval";
+		}
+
+		if($mode == "insert"){
+			$query = "ALTER TABLE `".MPREFIX.$table."` ADD `$field` $newval AFTER $after";
+		}
+
+		if($mode == "drop"){
+			$query = "ALTER TABLE `".MPREFIX.$table."` DROP `$field` ";
+		}
+
+		if($mode == "index"){
+			$query = "ALTER TABLE `".MPREFIX.$table."` ADD INDEX (`$field`) ";
+		}
+
+		if($mode == "create"){
+			$query = "CREATE TABLE ".MPREFIX.$table." ($newval) TYPE=MyISAM;";
+		}
+
+
+		$text .= "<tr><td class='forumheader3' style='vertical-align:top;width:70%'>".$query."</td><td class='forumheader3' style='vertical-align:top;width:30%'>";
+		$text .= (mysql_query($query)) ? " - <b>".LAN_UPDATED."</b>" : " - <b>".LAN_UPDATED_FAILED."</b>";
+		$text .= "</td></tr>";
+
+
+	}
+		$text .= "</table></div>";
+		$text .="<div style='text-align:center'><br />
+				<form method='POST' action='db.php'>
+				<input class='button' type='submit' name='back' value='".DBLAN_17."' />
+				</form>
+				</div>";
+
+	$ns -> tablerender(DBLAN_20, $text);
+}
+
+
+
+// ---------------------- Main Form and Submit. ------------------------
+if (!$_POST) {
+	$text = "
+		<form method='POST' action='".e_SELF."'>
+		<table border=0 align='center'>
+		<tr><td>".DBLAN_14."<br /><br />";
+	foreach(array_keys($tables) as $x) {
+		$text .= "<input type='checkbox' name='table_".$x."'>".$x."<br />";
+	}
+	$text .= "
+		<br /><input class='button' type='submit' value='".DBLAN_15."'>
+		</td></tr></table></form>";
+	$ns->tablerender(DBLAN_16, $text);
+} else {
+	foreach(array_keys($_POST) as $k) {
+		if (preg_match("/table_(.*)/", $k, $match)) {
+			$xx = $match[1];
+			$str = "<br />
+				<div style='text-align:center'>
+				<form method='POST' action='db.php'>
+				<input class='button' type='submit' name='back' value='".DBLAN_17."' />
+				</form>
+				</div>";
+			$ns->tablerender(DBLAN_16." - $xx ".DBLAN_18, check_tables($xx).$str);
+		}
+	}
+}
+
+
+
+// --------------------------------------------------------------
+function fix_form($table,$field, $newvalue,$mode,$after =''){
+
+	if(stristr($field, "KEY ") !== FALSE){
+		$field = chop(str_replace("KEY ","",$field));
+		$mode = "index";
+		$search = array("(",")");
+		$newvalue = str_replace($search,"",$newvalue);
+	}
+
+	if($mode == "create"){
+		$newvalue = implode("\n",$newvalue);
+	}
+
+	$text .= "<input type='checkbox'  name=\"fix_active[$field][]\" value='1' /> ".DBLAN_19."\n"; // 'attempt to fix'
+	$text .= "<input type='hidden' name=\"fix_newval[$field][]\" value=\"$newvalue\" />\n";
+	$text .= "<input type='hidden'  name=\"fix_table[$field][]\" value=\"$table\" / >\n";
+	$text .= "<input type='hidden'  name=\"fix_mode[$field][]\" value=\"$mode\" / >\n";
+	$text .= ($after) ? "<input type='hidden'  name=\"fix_after[$field][]\" value=\"$after\" / >\n" : "";
+
+	return $text;
+}
+
+function table_list() {
+	// grab default language lists.
+	global $mySQLdefaultdb;
+
+	$exclude[] = "banlist";		$exclude[] = "banner";
+	$exclude[] = "cache";		$exclude[] = "core";
+	$exclude[] = "online";		$exclude[] = "parser";
+	$exclude[] = "plugin";		$exclude[] = "user";
+	$exclude[] = "upload";		$exclude[] = "userclass_classes";
+	$exclude[] = "rbinary";		$exclude[] = "session";
+	$exclude[] = "tmp";	 		$exclude[] = "flood";
+	$exclude[] = "stat_info";	$exclude[] = "stat_last";
+	$exclude[] = "submit_news";	$exclude[] = "rate";
+	$exclude[] = "stat_counter";$exclude[] = "user_extended";
+	$exclude[] = "user_extended_struc";
+	$exclude[] = "pm_messages";
+	$exclude[] = "pm_blocks";
+
+	//   print_r($search);
+
+	$tables = mysql_list_tables($mySQLdefaultdb);
+	while (list($temp) = mysql_fetch_array($tables)){
+		$prefix = MPREFIX."lan_";
+
+		if(preg_match("/^".$prefix."(.*)/", $temp, $match)){
+			$e107tab = str_replace(MPREFIX, "", $temp);
+			$pos = strrpos($match[1],"_")+1;
+			$core = substr(str_replace("lan_","",$e107tab),$pos);
+			if (str_replace($exclude, "", $e107tab)){
+				$tabs[$core] = $e107tab;
+			}
+		}
+	}
+
+	return $tabs;
+}
+
+
+
+
+require_once(e_ADMIN."footer.php");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/docs.php 75/e107_admin/docs.php
--- 6171/e107_admin/docs.php	2004-05-17 12:43:58.000000000 -0500
+++ 75/e107_admin/docs.php	2005-11-11 22:18:01.000000000 -0600
@@ -1,50 +1,58 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/admin_template.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!ADMIN){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-
-$c=1;
-$lang=e_LANGUAGE; 
-if (!$handle=opendir(e_DOCS.$lang."/")) { 
-	$lang="English"; 
-	$handle=opendir(e_DOCS.$lang."/"); 
-} 
-
-while ($file = readdir($handle)){
-	if($file != "." && $file != ".."){
-		$helplist[$c] = $file;
-		$c++;
-	}
-}
-closedir($handle);
-
-
-if(e_QUERY){
-	$aj = new textparse;
-	$filename = e_DOCS.$lang."/".$helplist[e_QUERY];
-	$fd = fopen ($filename, "r");
-	$text .= fread ($fd, filesize ($filename));
-	fclose ($fd);
-
-	$text = $aj -> tpa($text);
-	$text = preg_replace("/Q\>(.*?)\n/si", "<b>Q>\\1</b>\n", $text);
-
-	$ns -> tablerender($helplist[e_QUERY], $text."<br />");
-	unset($text);
-}
-
-require_once("footer.php");
-?>	
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/docs.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/11/12 04:18:01 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!ADMIN) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'docs';
+require_once("auth.php");
+	
+$i = 1;
+$lang = e_LANGUAGE;
+if (!$handle = opendir(e_DOCS.e_LANGUAGE."/")) {
+	$lang = "English";
+	$handle = opendir(e_DOCS."English/");
+}
+	
+while ($file = readdir($handle)) {
+	if ($file != "." && $file != ".." && $file != "CVS") {
+		$helplist[$i] = $file;
+		$i++;
+	}
+}
+closedir($handle);
+	
+	
+if (e_QUERY) {
+	$filename = e_DOCS.$lang."/".$helplist[e_QUERY];
+	$fd = fopen ($filename, "r");
+	$text .= fread ($fd, filesize ($filename));
+	fclose ($fd);
+	 
+	$text = $tp->toHTML($text, TRUE);
+	$text = preg_replace("/Q\>(.*?)A>/si", "<img src='".e_IMAGE."generic/".IMODE."/question.png' style='vertical-align: middle' /><b>\\1</b>A>", $text);
+	$text = str_replace("A>", "<img src='".e_IMAGE."generic/".IMODE."/answer.png' style='vertical-align: middle' />", $text);
+	 
+	$ns->tablerender(str_replace("_", " ", $helplist[e_QUERY]), $text."<br />");
+	unset($text);
+}
+	
+require_once("footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/download.php 75/e107_admin/download.php
--- 6171/e107_admin/download.php	2004-08-31 11:02:52.000000000 -0500
+++ 75/e107_admin/download.php	2006-05-13 20:01:31.000000000 -0500
@@ -1,831 +1,1500 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/download.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("R")){ header("location:".e_BASE."index.php"); exit; }
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-require_once(e_HANDLER."form_handler.php");
-require_once(e_HANDLER."userclass_class.php");
-$rs = new form;
-$aj = new textparse;
-$download = new download;
-$deltest = array_flip($_POST);
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
-        $from = ($tmp[3] ? $tmp[3] : 0);
-        unset($tmp);
-}
-
-if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$etp->unentity(DOWLAN_9)],$matches))
-{
-        $delete = $matches[1];
-        $del_id = $matches[2];
-}
-
-$from = ($from ? $from : 0);
-$amount = 50;
-
-$e_file = str_replace("../", "", e_FILE);
-
-
-// if($file_array = getfiles($e_file."downloads/")){ sort($file_array); } unset($t_array);
- if($file_array = getfiles($DOWNLOADS_DIRECTORY)){ sort($file_array); } unset($t_array);
-if($sql -> db_Select("rbinary")){
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                $file_array[] = "Binary ".$binary_id."/".$binary_name;
-        }
-}
-
-
-
-if($image_array = getfiles($e_file."downloadimages/",1)){ sort($image_array); } unset($t_array);
-if($thumb_array = getfiles($e_file."downloadthumbs/",1)){ sort($thumb_array); } unset($t_array);
-
-if(IsSet($_POST['add_category'])){
-        $download -> create_category($sub_action, $id);
-}
-
-if(IsSet($_POST['submit_download'])){
-        $download -> submit_download($sub_action, $id);
-        $action = "main";
-        unset($sub_action, $id);
-}
-
-
-if(IsSet($_POST['updateoptions'])){
-	$pref['download_php'] = $_POST['download_php'];
-	$pref['download_view'] = $_POST['download_view'];
-	$pref['download_sort'] = $_POST['download_sort'];
-	$pref['download_order'] = $_POST['download_order'];
-	$pref['agree_flag'] = $_POST['agree_flag'];
-	$pref['agree_text'] = $aj -> formtpa($_POST['agree_text']);
-	save_prefs();
-	$message = DOWLAN_65;
-}
-
-if($action == "dlm"){
-        $action = "create";
-        $id = $sub_action;
-        $sub_action = "dlm";
-}
-
-if($action == "create"){
-        $download -> create_download($sub_action, $id);
-}
-
-
-if($delete == 'category')
-{
-	if($sql -> db_Delete("download_category", "download_category_id='$del_id' "))
-	{
-		$sql -> db_Delete("download_category","download_category_parent='{$del_id}' ");
-		$download -> show_message(DOWLAN_49." #".$del_id." ".DOWLAN_36);
-		$download -> show_categories($sub_action, $del_id);
-	}
-}
-
-if($action == "cat")
-{
-	$download -> show_categories($sub_action, $id);
-}
-
-if($delete == 'main')
-{
-	if($sql -> db_Delete("download", "download_id='$del_id' "))
-	{
-		$download -> show_message(DOWLAN_35." #".$del_id." ".DOWLAN_36);
-	}
-	unset($sub_action, $id);
-}
-
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-if(!e_QUERY || $action == "main"){
-        $download -> show_existing_items($action, $sub_action, $id, $from, $amount);
-}
-
-
-if($action == "opt"){
-        global $pref, $ns;
-          $agree_flag = $pref['agree_flag'];
-          $agree_text = $pref['agree_text'];
-        $text = "<div style='text-align:center'>
-        <form method='post' action='".e_SELF."?".e_QUERY."'>\n
-        <table style='width:auto' class='fborder'>
-
-
-          <tr>
-          <td style='width:70%' class='forumheader3'>".DOWLAN_69."</td>
-        <td class='forumheader3' style='width:30%;text-align:left'>";
-        $c = $pref['download_php'] ? " checked = 'checked' " : "";
-        $text .= "<input type='checkbox' class='tbox' name='download_php' value='1' {$c} /> <span class='smalltext'>".DOWLAN_70."</span></td>
-          </tr>
-
-
-
-
-        <tr>
-        <td style='width:70%' class='forumheader3'>
-        ".DOWLAN_55."
-        </td>
-        <td class='forumheader3' style='width:30%;text-align:left'>
-        <select name='download_view' class='tbox'>".
-        ($pref['download_view'] == 5 ? "<option selected='selected'>5</option>" : "<option>5</option>").
-        ($pref['download_view'] == 10 ? "<option selected='selected'>10</option>" : "<option>10</option>").
-        ($pref['download_view'] == 15 ? "<option selected='selected'>15</option>" : "<option>15</option>").
-        ($pref['download_view'] == 20 ? "<option selected='selected'>20</option>" : "<option>20</option>").
-    ($pref['download_view'] == 50 ? "<option selected='selected'>50</option>" : "<option>50</option>")."
-        </select>
-        </td>
-        </tr>
-
-        <tr><td style='width:70%' class='forumheader3'>
-        ".DOWLAN_56."
-        </td>
-        <td class='forumheader3' style='width:30%;text-align:left'>
-
-        <select name='download_order' class='tbox'>".
-        ($pref['download_order'] == "download_datestamp" ? "<option value='download_datestamp' selected='selected'>".DOWLAN_58."</option>" : "<option value='download_datestamp'>".DOWLAN_58."</option>").
-        ($pref['download_order'] == "download_requested" ? "<option value='download_requested' selected='selected'>".DOWLAN_57."</option>" : "<option value='download_requested'>".DOWLAN_57."</option>").
-        ($pref['download_order'] == "download_name" ? "<option value='download_name' selected='selected'>".DOWLAN_59."</option>" : "<option value='download_name'>".DOWLAN_59."</option>").
-        ($pref['download_order'] == "download_author" ? "<option value='download_author' selected='selected'>".DOWLAN_60."</option>" : "<option value='download_author'>".DOWLAN_60."</option>")."
-        </select>
-        </td>
-        </tr>
-        <tr><td style='width:70%' class='forumheader3'>
-        ".DOWLAN_61."
-        </td>
-        <td class='forumheader3' style='width:30%;text-align:left'>
-        <select name='download_sort' class='tbox'>".
-        ($pref['download_sort'] == "ASC" ? "<option value='ASC' selected='selected'>".DOWLAN_62."</option>" : "<option value='ASC'>".DOWLAN_62."</option>").
-        ($pref['download_sort'] == "DESC" ? "<option value='DESC' selected='selected'>".DOWLAN_63."</option>" : "<option value='DESC'>".DOWLAN_63."</option>")."
-        </select>
-        </td>
-        </tr>
-
-          <tr>
-          <td style='width:70%' class='forumheader3'>".DOWLAN_100."</td>
-        <td class='forumheader3' style='width:30%;text-align:left'>".
-          ($agree_flag ? "<input type='checkbox' name='agree_flag' value='1' checked='checked' />" : "<input type='checkbox' name='agree_flag' value='1' />")."</td>
-          </tr>
-
-          <tr><td style='width:70%' class='forumheader3'>
-        ".DOWLAN_101."
-        </td>
-        <td class='forumheader3' style='width:30%;text-align:left'>
-          <textarea class='tbox' name='agree_text' cols='59' rows='10'>$agree_text</textarea>
-        </td>
-        </tr>
-
-        <tr style='vertical-align:top'>
-        <td colspan='2'  style='text-align:center' class='forumheader'>
-        <input class='button' type='submit' name='updateoptions' value='".DOWLAN_64."' />
-        </td>
-        </tr>
-
-        </table>
-        </form>
-        </div>";
-        $ns -> tablerender(DOWLAN_54, $text);
-}
-
-//$download -> show_options($action);
-
-require_once("footer.php");
-function headerjs(){
-global $etp;
-$headerjs = "<script type=\"text/javascript\">
-
-    function addtext2(str){
-            document.getElementById('download_category_icon').value = str;
-    }
-
-
-    function confirm_(mode, tit_content, download_id){
-            if(download_id=='undefined'){download_id==tit_content;}
-            if(mode == 'cat'){
-                    return confirm(\"".$etp->unentity(DOWLAN_34)." [ID: \" + download_id + \"] \"+tit_content);
-            }else{
-                    return confirm(\"".$etp->unentity(DOWLAN_33)." [ID: \" + download_id + \"] \"+tit_content);
-            }
-    }
-    </script>";
-return $headerjs;
-}
-exit;
-
-class download{
-
-        function show_existing_items($action, $sub_action, $id, $from, $amount){
-                global $sql, $rs, $ns, $aj;
-                $text = "<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 200px; overflow : auto; '>";
-
-                if(IsSet($_POST['searchquery'])){
-                        $query = "download_name REGEXP('".$_POST['searchquery']."') OR download_url REGEXP('".$_POST['searchquery']."') OR download_author REGEXP('".$_POST['searchquery']."') OR download_description  REGEXP('".$_POST['searchquery']."') ORDER BY download_datestamp DESC";
-                }else{
-                        $query = "ORDER BY ".($sub_action ? $sub_action : "download_datestamp")." ".($id ? $id : "DESC")."  LIMIT $from, $amount";
-                }
-
-                if($sql -> db_Select("download", "*", $query, ($_POST['searchquery'] ? 0 : "nowhere"))){
-                        $text .= "<table class='fborder' style='width:100%'>
-                        <tr>
-                        <td style='width:5%' class='forumheader2'>ID</td>
-                        <td style='width:50%' class='forumheader2'>".DOWLAN_27."</td>
-                        <td style='width:45%' class='forumheader2'>".DOWLAN_28."</td>
-                        </tr>";
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $text .= "<tr>
-                                <td style='width:5%' class='forumheader3'>$download_id</td>
-                                <td style='width:75%' class='forumheader3'>$download_name</td>
-                                <td style='width:20%; text-align:center' class='forumheader3'>
-
-											".$rs -> form_open("post", e_SELF,"myform_{$download_id}","",""," onsubmit=\"return confirm_('create','$delete_heading','$download_id')\"")."
-											<div>".$rs -> form_button("button", "main_edit_{$download_id}", DOWLAN_8, "onclick=\"document.location='".e_SELF."?create.edit.$download_id'\"")."
-											".$rs -> form_button("submit", "main_delete_{$download_id}", DOWLAN_9)."</div>
-											".$rs -> form_close()."
-
-
-                                </td>
-                                </tr>";
-                        }
-//                                ".$rs -> form_button("submit", "main_edit_$download_id", DOWLAN_8, "onclick=\"document.location='".e_SELF."?create.edit.$download_id'\"")."
-//                                ".$rs -> form_button("submit", "main_delete_$download_id", DOWLAN_9, "onclick=\"confirm_('create', $download_id)\"")."
-                        $text .= "</table>";
-                }else{
-                        $text .= "<div style='text-align:center'>".DOWLAN_6."</div>";
-                }
-                $text .= "</div>";
-
-                $downloads = $sql -> db_Count("download");
-
-                if($downloads > $amount && !$_POST['searchquery']){
-                        $a = $downloads/$amount;
-                        $r = explode(".", $a);
-                        if($r[1] != 0 ? $pages = ($r[0]+1) : $pages = $r[0]);
-                        if($pages){
-                                $current = ($from/$amount)+1;
-                                $text .= "<br />".DOWLAN_50." ";
-                                for($a=1; $a<=$pages; $a++){
-                                        $text .= ($current == $a ? " <b>[$a]</b>" : " [<a href='".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.download_datestamp.desc.").(($a-1)*$amount)."'>$a</a>] ");
-                                }
-                                $text .= "<br />";
-                        }
-                }
-
-                $text .= "<br /><form method='post' action='".e_SELF."'>\n<p>\n<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />\n<input class='button' type='submit' name='searchsubmit' value='".DOWLAN_51."' />\n</p>\n</form>\n</div>";
-
-
-                $ns -> tablerender(DOWLAN_7, $text);
-        }
-
-        function show_options($action){
-
-                                if($action==""){$action="main";}
-                                        $var['main']['text']=DOWLAN_29;
-                                        $var['main']['link']=e_SELF;
-
-                                        $var['opt']['text']=DOWLAN_28;
-                                        $var['opt']['link']=e_SELF."?opt";
-
-                                        $var['create']['text']=DOWLAN_30;
-                                        $var['create']['link']=e_SELF."?create";
-
-                                        $var['cat']['text']=DOWLAN_31;
-                                        $var['cat']['link']=e_SELF."?cat";
-                                        $var['cat']['perm']="Q";
-                                        show_admin_menu(DOWLAN_32,$action,$var);
-
-        }
-
-        function create_download($sub_action, $id){
-                global $sql, $rs, $ns, $file_array, $image_array, $thumb_array;
-
-                if(!$sql -> db_Select("download_category")){
-                        $ns -> tablerender(DOWLAN_26, "<div style='text-align:center'>".DOWLAN_5."</div>");
-                        return;
-                }
-
-
-                if($sub_action == "edit" && !$_POST['submit']){
-                        if($sql -> db_Select("download", "*", "download_id='$id' ")){
-                                $row = $sql-> db_Fetch();
-                                extract($row);
-                        }
-                }
-
-                if($sub_action == "dlm" && !$_POST['submit']){
-                        if($sql -> db_Select("upload", "*", "upload_id='$id' ")){
-                                $row = $sql-> db_Fetch();
-                                extract($row);
-                                $download_category = $upload_category;
-                                $download_name = $upload_name.($upload_version ? " v" . $upload_version : "");
-                                $download_url = $upload_file;
-                                $download_author_email = $upload_email;
-                                $download_author_website = $upload_website;
-                                $download_description = $upload_description;
-                                $download_image = $upload_ss;
-                                $download_filesize = $upload_filesize;
-                                $image_array[] = $upload_ss;
-                                $download_author = substr($upload_poster, (strpos($upload_poster, ".")+1));
-                        }
-                }
-
-                $text = "
-                <div style='text-align:center'>
-                <form method='post' action='".e_SELF."?".e_QUERY."' id='myform'>
-                <table style='width:85%' class='fborder'>
-                <tr>
-                <td style='width:20%' class='forumheader3'>".DOWLAN_11.":</td>
-                <td style='width:80%' class='forumheader3'>";
-
-                $sql -> db_Select("download_category", "*", "download_category_parent !=0");
-                $text .= "<select name='download_category' class='tbox'>\n";
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        if($download_category_id == $download_category){
-                                $text .= "<option value='$download_category_id' selected='selected'>".$download_category_name."</option>\n";
-                        }else{
-                                $text .= "<option value='$download_category_id'>".$download_category_name."</option>\n";
-                        }
-                }
-                $text .= "</select>
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%; vertical-align:top' class='forumheader3'><span style='text-decoration:underline'>".DOWLAN_12."</span>:</td>
-                <td style='width:80%' class='forumheader3'>
-                <input class='tbox' type='text' name='download_name' size='60' value='$download_name' maxlength='200' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%; vertical-align:top' class='forumheader3'><span style='text-decoration:underline'>".DOWLAN_13."</span>:</td>
-                <td style='width:80%' class='forumheader3'>
-                <select name='download_url' class='tbox'>
-                <option></option>
-                ";
-
-                $counter = 0;
-                while(IsSet($file_array[$counter])){
-
-                        if(eregi($download_url,$file_array[$counter])){
-                        $selected = " selected='selected'";
-                        $found = 1;
-                        }else{
-                        $selected = "";
-                        }
-
-                        $text .= "<option value='".$file_array[$counter]."' $selected>".$file_array[$counter]."</option>\n";
-                        $counter++;
-                }
-
-                if(ereg("http", $download_url) || ereg("ftp", $download_url) ){
-                        $download_url_external = $download_url;
-                }
-
-                $etext = " - (".DOWLAN_68.")";
-                if(file_exists(e_FILE."public/".$download_url) || $download_url_external){
-                $etext= "";
-                $found=1;
-                }
-
-                if(!$found && $download_url){
-                $text .= "<option value='".$download_url."' selected='selected'>".$download_url.$etext."</option>\n";
-                }
-
-                $text .= "</select>
-                <br />
-                <span class='smalltext'> ".DOWLAN_14.": ";
-
-
-
-                $text .= "<input class='tbox' type='text' name='download_url_external' size='40' value='$download_url_external' maxlength='100' />
-                &nbsp;&nbsp;".DOWLAN_66.":
-                <input class='tbox' type='text' name='download_filesize_external' size='8' value='$download_filesize' maxlength='10' />
-                </span>
-
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".DOWLAN_15.":</td>
-                <td style='width:80%' class='forumheader3'>
-                <input class='tbox' type='text' name='download_author' size='60' value='$download_author' maxlength='100' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".DOWLAN_16.":</td>
-                <td style='width:80%' class='forumheader3'>
-                <input class='tbox' type='text' name='download_author_email' size='60' value='$download_author_email' maxlength='100' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".DOWLAN_17.":</td>
-                <td style='width:80%' class='forumheader3'>
-                <input class='tbox' type='text' name='download_author_website' size='60' value='$download_author_website' maxlength='100' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'><span style='text-decoration:underline'>".DOWLAN_18."</span>: </td>
-                <td style='width:80%' class='forumheader3'>
-                <textarea class='tbox' name='download_description' cols='70' rows='5'>$download_description</textarea>
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".DOWLAN_19.":</td>
-                <td style='width:80%' class='forumheader3'>
-                <select name='download_image' class='tbox'>
-                <option></option>
-                ";
-                $counter = 0;
-                while(IsSet($image_array[$counter])){
-                        if($image_array[$counter] == $download_image){
-                                $text .= "<option selected='selected'>".$image_array[$counter]."</option>\n";
-                        }else{
-                                $text .= "<option>".$image_array[$counter]."</option>\n";
-                        }
-                        $counter++;
-                }
-                $text .= "</select>
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".DOWLAN_20.":</td>
-                <td style='width:80%' class='forumheader3'>
-                <select name='download_thumb' class='tbox'>
-                <option></option>
-                ";
-                $counter = 0;
-                while(IsSet($thumb_array[$counter])){
-                        if($thumb_array[$counter] == $download_thumb){
-                                $text .= "<option selected='selected'>".$thumb_array[$counter]."</option>\n";
-                        }else{
-                                $text .= "<option>".$thumb_array[$counter]."</option>\n";
-                        }
-                        $counter++;
-                }
-                $text .= "</select>
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".DOWLAN_21.":</td>
-                <td style='width:80%' class='forumheader3'>";
-
-
-                if($download_active == "0"){
-                        $text .= DOWLAN_22.": <input type='radio' name='download_active' value='1' />
-                        ".DOWLAN_23.": <input type='radio' name='download_active' value='0' checked='checked' />";
-                }else{
-                        $text .= DOWLAN_22.": <input type='radio' name='download_active' value='1' checked='checked' />
-                        ".DOWLAN_23.": <input type='radio' name='download_active' value='0' />";
-                }
-
-                $text .= "</td>
-                </tr>
-
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".DOWLAN_102.":</td>
-                <td style='width:80%' class='forumheader3'>";
-
-
-                if($download_comment == "0"){
-                        $text .= DOWLAN_22.": <input type='radio' name='download_comment' value='1' />
-                        ".DOWLAN_23.": <input type='radio' name='download_comment' value='0' checked='checked' />";
-                }else{
-                        $text .= DOWLAN_22.": <input type='radio' name='download_comment' value='1' checked='checked' />
-                        ".DOWLAN_23.": <input type='radio' name='download_comment' value='0' />";
-                }
-
-                $text .= "</td>
-                </tr>
-                <tr style='vertical-align:top'>
-                <td colspan='2' style='text-align:center' class='forumheader'>";
-
-
-                if($id && $sub_action == "edit"){
-                        $text .= "<input class='button' type='submit' name='submit_download' value='".DOWLAN_24."' /> ";
-                }else{
-                        $text .= "<input class='button' type='submit' name='submit_download' value='".DOWLAN_25."' />";
-                }
-
-                $text .= "</td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-
-
-                $ns -> tablerender("<div style='text-align:center'>".DOWLAN_26."</div>", $text);
-        }
-
-        function show_message($message){
-                global $ns;
-                $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-        }
-
-        function submit_download($sub_action, $id){
-                global $aj, $sql, $DOWNLOADS_DIRECTORY;
-
-                if($_POST['download_url_external']){
-                        $durl = $_POST['download_url_external'];
-                        $filesize = $_POST['download_filesize_external'];
-                }else{
-                        $durl = $_POST['download_url'];
-                        if(preg_match("#^/#",$DOWNLOADS_DIRECTORY) || preg_match("#.:#",$DOWNLOADS_DIRECTORY)){
-                        $filesize = filesize($DOWNLOADS_DIRECTORY.$durl);
-                        }else{
-                        $filesize = filesize(e_BASE.$DOWNLOADS_DIRECTORY.$durl);
-                        }
-                }
-
-                if(!$filesize){
-                        $sql -> db_Select("upload", "upload_filesize", "upload_file='$durl'");
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $filesize = $upload_filesize;
-                }
-
-                $_POST['download_description'] = $aj -> formtpa($_POST['download_description'], "admin");
-
-                if($id){
-                        $sql -> db_Update("download", "download_name='".$_POST['download_name']."', download_url='".$durl."', download_author='".$_POST['download_author']."', download_author_email='".$_POST['download_author_email']."', download_author_website='".$_POST['download_author_website']."', download_description='".$_POST['download_description']."', download_filesize='".$filesize."', download_category='".$_POST['download_category']."', download_active='".$_POST['download_active']."', download_datestamp='".time()."', download_thumb='".$_POST['download_thumb']."', download_image='".$_POST['download_image']."', download_comment='".$_POST['download_comment']."' WHERE download_id=$id");
-                        $this->show_message(DOWLAN_2);
-                }else{
-
-                        $sql -> db_Insert("download", "0, '".$_POST['download_name']."', '".$durl."', '".$_POST['download_author']."', '".$_POST['download_author_email']."', '".$_POST['download_author_website']."', '".$_POST['download_description']."', '".$filesize."', '0', '".$_POST['download_category']."', '".$_POST['download_active']."', '".time()."', '".$_POST['download_thumb']."', '".$_POST['download_image']."', '".$_POST['download_comment']."' ");
-                        $this->show_message(DOWLAN_1);
-                }
-        }
-
-        function show_categories($sub_action, $id){
-                global $sql, $rs, $ns, $sql2, $sql3;
-                if(!is_object($sql2)){
-                        $sql2 = new db;
-                }
-                if(!is_object($sql3)){
-                        $sql3 = new db; $sql4 = new db;
-                }
-                $text = "<div style='border : solid 1px #000; padding : 4px; width : auto; height : 200px; overflow : auto; '>";
-                if($download_total = $sql -> db_Select("download_category", "*", "download_category_parent=0")){
-                        $text .= "<table class='fborder' style='width:100%'>
-
-                        <tr>
-                        <td style='width:5%; text-align:center' class='fcaption'>&nbsp;</td>
-                        <td style='width:70%; text-align:center' class='fcaption'>".DOWLAN_11."</td>
-                        <td style='width:5%; text-align:center' class='fcaption'>".DOWLAN_52."</td>
-                        <td style='width:25%; text-align:center' class='fcaption'>".DOWLAN_28."</td>
-                        </tr>";
-
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $text .= "<tr>
-                                <td style='width:5%; text-align:center' class='forumheader'>".($download_category_icon ? "<img src='".e_IMAGE."download_icons/$download_category_icon' style='vertical-align:middle; border:0' alt='' />" : "&nbsp;")."</td>
-                                <td colspan='2' style='width:70%' class='forumheader'><b>$download_category_name</b></td>
-
-                                <td style='width:20%; text-align:center' class='forumheader'>
-
-											".$rs -> form_open("post", e_SELF,"myform_{$download_category_id}","",""," onsubmit=\"return confirm_('create','$delete_heading','$download_category_id')\"")."
-											<div>".$rs -> form_button("button", "category_edit_{$download_category_id}", DOWLAN_8, "onclick=\"document.location='".e_SELF."?cat.edit.$download_category_id'\"")."
-											".$rs -> form_button("submit", "category_delete_{$download_category_id}", DOWLAN_9)."</div>
-											".$rs -> form_close()."
-
-                                </td>
-                                </tr>";
-//                                ".$rs -> form_button("submit", "main_edit_$download_category_id", DOWLAN_8, "onclick=\"document.location='".e_SELF."?cat.edit.$download_category_id'\"")."
-//                                ".$rs -> form_button("submit", "main_delete_$download_category_id", DOWLAN_9, "onclick=\"confirm_('cat', $download_category_id)\"")."
-                                $parent_id = $download_category_id;
-                                if($sql2 -> db_Select("download_category", "*", "download_category_parent=$parent_id")){
-                                        while($row = $sql2-> db_Fetch()){
-                                                extract($row);
-
-                                                $files = $sql4 -> db_Count("download", "(*)", "WHERE download_category='".$download_category_id."'");
-
-
-                                                $text .= "<tr>
-                                                <td style='width:5%; text-align:center' class='forumheader3'>".($download_category_icon ? "<img src='".e_IMAGE."download_icons/$download_category_icon' style='vertical-align:middle; border:0' alt='' />" : "&nbsp;")."</td>
-                                                <td style='width:70%' class='forumheader3'>$download_category_name<br /><span class='smalltext'>$download_category_description</span></td>
-                                                <td style='width:5%; text-align:center' class='forumheader3'>$files</td>
-                                                <td style='width:20%; text-align:center' class='forumheader3'>
-
-																".$rs -> form_open("post", e_SELF,"myform_{$download_category_id}","",""," onsubmit=\"return confirm_('create','$delete_heading','$download_category_id')\"")."
-																<div>".$rs -> form_button("button", "category_edit_{$download_category_id}", DOWLAN_8, "onclick=\"document.location='".e_SELF."?cat.edit.$download_category_id'\"")."
-																".$rs -> form_button("submit", "category_delete_{$download_category_id}", DOWLAN_9)."</div>
-																".$rs -> form_close()."
-
-
-                                                </td>
-                                                </tr>";
-//                                                ".$rs -> form_button("submit", "main_edit_$download_category_id", DOWLAN_8, "onclick=\"document.location='".e_SELF."?cat.edit.$download_category_id'\"")."
-//                                                ".$rs -> form_button("submit", "main_delete_$download_category_id", DOWLAN_9, "onclick=\"confirm_('cat', $download_category_id)\"")."
-                                                $sub_parent_id = $download_category_id;
-                                                if($sql3 -> db_Select("download_category", "*", "download_category_parent=$sub_parent_id")){
-                                                        while($row = $sql3-> db_Fetch()){
-                                                                extract($row);
-                                                                $files = $sql4 -> db_Count("download", "(*)", "WHERE download_category='".$download_category_id."'");
-                                                                $text .= "<tr>
-                                                                <td style='width:5%; text-align:center' class='forumheader3'>".($download_category_icon ? "<img src='".e_IMAGE."download_icons/$download_category_icon' style='vertical-align:middle; border:0' alt='' />" : "&nbsp;")."</td>
-                                                                <td style='width:70%' class='forumheader3'>&nbsp;&nbsp;&nbsp;&nbsp;".DOWLAN_53.": $download_category_name<br />&nbsp;&nbsp;&nbsp;&nbsp;<span class='smalltext'>$download_category_description</span></td>
-                                                                <td style='width:5%; text-align:center' class='forumheader3'>$files</td>
-                                                                <td style='width:20%; text-align:center' class='forumheader3'>
-                                                                ".$rs -> form_button("submit", "main_edit_$download_category_id", DOWLAN_8, "onclick=\"document.location='".e_SELF."?cat.edit.$download_category_id'\"")."
-                                                                ".$rs -> form_button("submit", "main_delete_$download_category_id", DOWLAN_9, "onclick=\"confirm_('cat', $download_category_id)\"")."
-                                                                </td>
-                                                                </tr>";
-                                                        }
-                                                }
-                                        }
-                                }
-                        }
-                        $text .= "</table>";
-                }else{
-                        $text .= "<div style='text-align:center'>".DOWLAN_38."</div>";
-                }
-                $text .= "</div>";
-                $ns -> tablerender(DOWLAN_37, $text);
-
-                unset($download_category_id, $download_category_name, $download_category_description, $download_category_parent, $download_category_icon, $download_category_class);
-
-
-
-                $handle=opendir(e_IMAGE."download_icons");
-                while ($file = readdir($handle)){
-                        if($file != "." && $file != ".." && $file != "/"){
-                                $iconlist[] = $file;
-                        }
-                }
-                closedir($handle);
-
-                if($sub_action == "edit" && !$_POST['add_category']){
-                        if($sql -> db_Select("download_category", "*", "download_category_id=$id")){
-                                $row = $sql -> db_Fetch(); extract($row);
-                                $main_category_parent = $download_category_parent;
-                        }
-                }
-
-                                        $frm_action = (isset($_POST['add_category'])) ? e_SELF."?cat" : e_SELF."?".e_QUERY;
-                $text = "<div style='text-align:center'>
-                <form method='post' action='{$frm_action}' id='dlform'>
-                <table style='width:auto' class='fborder'>
-                <tr>
-                <td style='width:30%' class='forumheader3'>".DOWLAN_37.": </td>
-                <td style='width:70%' class='forumheader3'>";
-
-                if(!$download_cats = $sql -> db_Select("download_category")){
-                        $text .= "
-                        <select name='download_category_parent' class='tbox'>
-                        <option>".DOWLAN_40."</option>
-                        </select>\n";
-                }else{
-                        $text .= "
-                        <select name='download_category_parent' class='tbox'>
-                        <option>".DOWLAN_40."</option>";
-
-                        while(list($cat_id, $cat_name, $null, $null, $cat_parent) = $sql-> db_Fetch()){
-                                $sql2 -> db_Select("download_category", "download_category_parent", "download_category_id='$cat_parent'", TRUE);
-                                $row = $sql2 -> db_Fetch(); extract($row);
-                                if(!$download_category_parent || !$cat_parent){
-                                        $text .= ($main_category_parent == $cat_id ? "<option value='$cat_id' selected='selected'>".$cat_name."</option>" : "<option value='$cat_id'>".$cat_name."</option>");
-                                }
-                        }
-                        $text .= "</select>";
-                }
-                $text .= "</td></tr><tr>
-                <td style='width:30%' class='forumheader3'>".DOWLAN_12.": </td>
-                <td style='width:70%' class='forumheader3'>
-                <input class='tbox' type='text' name='download_category_name' size='40' value='$download_category_name' maxlength='100' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:30%' class='forumheader3'>".DOWLAN_18.": </td>
-                <td style='width:70%' class='forumheader3'>
-                <textarea class='tbox' name='download_category_description' cols='59' rows='3'>$download_category_description</textarea>
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:30%' class='forumheader3'>".DOWLAN_41.": </td>
-                <td style='width:70%' class='forumheader3'>
-                <input class='tbox' type='text' id='download_category_icon' name='download_category_icon' size='60' value='$download_category_icon' maxlength='100' />
-
-                <br />
-                <input class='button' type ='button' style='cursor:hand' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
-                <div style='display:none;{head}' >";
-
-
-
-                while(list($key, $icon) = each($iconlist)){
-                        $text .= "<a href='javascript:addtext2(\"$icon\")'><img src='".e_IMAGE."download_icons/".$icon."' style='border:0' alt='' /></a> ";
-                }
-
-                $text .= "
-                </div></td>
-                </tr>
-
-                <tr>
-                <td style='width:30%' class='forumheader3'>".DOWLAN_43.":<br /><span class='smalltext'>(".DOWLAN_44.")</span></td>
-                <td style='width:70%' class='forumheader3'>".r_userclass("download_category_class",$download_category_class)."
-
-                </td></tr>
-
-
-                <tr style='vertical-align:top'>
-                <td colspan='2' style='text-align:center' class='forumheader'>";
-                if($id && $sub_action == "edit" && !isset($_POST['add_category'])){
-                        $text .= "<input class='button' type='submit' name='add_category' value='".DOWLAN_46."' /> ";
-                }else{
-                        $text .= "<input class='button' type='submit' name='add_category' value='".DOWLAN_45."' />";
-                }
-                $text .= "</td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-                $ns -> tablerender(DOWLAN_39, $text);
-
-
-
-        }
-
-        function create_category($sub_action, $id){
-                global $aj, $sql;
-                $download_category_name = $aj -> formtpa($_POST['download_category_name'], "admin");
-                $download_category_description = $aj -> formtpa($_POST['download_category_description'], "admin");
-                $download_category_icon = $aj -> formtpa($_POST['download_category_icon'], "admin");
-
-                if($id){
-                        $sql -> db_Update("download_category", "download_category_name='$download_category_name', download_category_description='$download_category_description', download_category_icon ='$download_category_icon', download_category_parent= '".$_POST['download_category_parent']."', download_category_class='".$_POST['download_category_class']."' WHERE download_category_id='$id'");
-                        $this->show_message(DOWLAN_48);
-                }else{
-                        $sql -> db_Insert("download_category", "0, '$download_category_name', '$download_category_description', '$download_category_icon', '".$_POST['download_category_parent']."', '".$_POST['download_category_class']."' ");
-                        $this->show_message(DOWLAN_47);
-                }
-                if($sub_action == "sn"){
-                        $sql -> db_Delete("tmp", "tmp_time='$id' ");
-                }
-        }
-}
-
-function getfiles($dir,$sub=0){
-        global $t_array, $DOWNLOADS_DIRECTORY, $FILES_DIRECTORY;
-        if($DOWNLOADS_DIRECTORY{0}=="/" && $sub!=1 ){
-        $pathdir = $dir;
-        }else{
-        $pathdir = e_BASE.$dir;
-        }
-        $dh = opendir($pathdir);
-        $size = 0;
-        $search = array("../", str_replace("../","",$DOWNLOADS_DIRECTORY), $FILES_DIRECTORY, "downloads/", "downloadimages/", "downloadthumbs/");
-        $replace = array("", "", "", "", "", "");
-        while($file = readdir($dh)){
-                if($file != "." and $file != ".." && $file != "index.html" && $file != "null.txt"){
-                        if(is_file($pathdir.$file)){
-                                $t_array[] = str_replace($search, $replace, $pathdir.$file);
-                        }else{
-                                                                                if(!preg_match("#^CVS#",$patchdir.$file)){
-                                getfiles(str_replace("../", "", $pathdir.$file)."/");
-                               }
-                        }
-                }
-        }
-        closedir($dh);
-        return $t_array;
-}
-
-function download_adminmenu($parms){
-        global $download;
-        global $action;
-        $download -> show_options($action);
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/download.php,v $
+|     $Revision: 1.79 $
+|     $Date: 2006/05/14 01:01:31 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("R")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+
+require_once(e_HANDLER."calendar/calendar_class.php");
+$cal = new DHTML_Calendar(true);
+function headerjs()
+{
+	global $cal;
+	return $cal->load_files();
+}
+
+$e_sub_cat = 'download';
+
+require_once(e_HANDLER."form_handler.php");
+require_once(e_HANDLER."userclass_class.php");
+require_once(e_HANDLER."file_class.php");
+
+$fl = new e_file;
+
+// -------- Presets. ------------
+require_once(e_HANDLER."preset_class.php");
+$pst = new e_preset;
+$pst->form = array("myform","dlform"); // form id of the form that will have it's values saved.
+$pst->page = array("download.php?create","download.php?cat"); // display preset options on which page(s).
+$pst->id = array("admin_downloads","admin_dl_cat");
+// -------------------------------
+
+$download = new download;
+require_once("auth.php");
+$pst->save_preset();  // unique name(s) for the presets - comma separated.
+
+ /*
+One form example (no arrays needed)
+$pst->form = "myform"; // form id of the form that will have it's values saved.
+$pst->page = "download.php?create"; // display preset options on which page.
+$pst->save_preset("admin_downloads");  // unique name for the preset
+*/
+
+$rs = new form;
+if (e_QUERY) {
+	$tmp = explode(".", e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	$id = $tmp[2];
+	$from = ($tmp[3] ? $tmp[3] : 0);
+	unset($tmp);
+}
+
+if(isset($_POST['delete']))
+{
+	$tmp = array_keys($_POST['delete']);
+	list($delete, $del_id) = explode("_", $tmp[0]);
+	unset($_POST['searchquery']);
+}
+
+$from = ($from ? $from : 0);
+$amount = 50;
+
+
+if($file_array = $fl->get_files(e_DOWNLOAD, "","standard",2)){
+		sort($file_array);
+}
+
+if ($sql->db_Select("rbinary")){
+	while ($row = $sql->db_Fetch())	{
+		extract($row);
+		$file_array[] = "Binary ".$binary_id."/".$binary_name;
+	}
+}
+
+$reject = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*');
+
+if($image_array = $fl->get_files(e_FILE."downloadimages/", "",$reject,1)){
+	sort($image_array);
+}
+
+if($thumb_array = $fl->get_files(e_FILE."downloadthumbs/", "",$reject,1)){
+	sort($thumb_array);
+}
+
+
+if (isset($_POST['add_category'])) {
+	$download->create_category($sub_action, $id);
+}
+
+if (isset($_POST['submit_download'])) {
+	$download->submit_download($sub_action, $id);
+	$action = "main";
+	unset($sub_action, $id);
+}
+
+
+if(isset($_POST['update_catorder'])){
+ 	foreach($_POST['catorder'] as $key=>$order){
+		if($_POST['catorder'][$key]){
+			$sql -> db_Update("download_category", "download_category_order='".intval($order)."' WHERE download_category_id='".intval($key)."'");
+	  	}
+	}
+   	$ns->tablerender("", "<div style='text-align:center'><b>".LAN_UPDATED."</b></div>");
+}
+
+if (isset($_POST['updateoptions']))
+{
+	$pref['download_php'] = $_POST['download_php'];
+	$pref['download_view'] = $_POST['download_view'];
+	$pref['download_sort'] = $_POST['download_sort'];
+	$pref['download_order'] = $_POST['download_order'];
+	$pref['agree_flag'] = $_POST['agree_flag'];
+	$pref['download_email'] = $_POST['download_email'];
+	$pref['agree_text'] = $tp->toDB($_POST['agree_text']);
+	$pref['download_denied'] = $tp->toDB($_POST['download_denied']);
+	save_prefs();
+	$message = DOWLAN_65;
+}
+
+if(isset($_POST['addlimit']))
+{
+	if($sql->db_Select('generic','gen_id',"gen_type = 'download_limit' AND gen_datestamp = {$_POST['newlimit_class']}"))
+	{
+		$message = DOWLAN_116;
+	}
+	else
+	{
+		if($sql->db_Insert('generic',"0, 'download_limit', '".intval($_POST['newlimit_class'])."', '".intval($_POST['new_bw_num'])."', '".intval($_POST['new_bw_days'])."', '".intval($_POST['new_count_num'])."', '".intval($_POST['new_count_days'])."'"))
+		{
+			$message = DOWLAN_117;
+		}
+		else
+		{
+			$message = DOWLAN_118;
+		}
+	}
+}
+
+if(isset($_POST['updatelimits']))
+{
+
+	if($pref['download_limits'] != $_POST['download_limits'])
+	{
+		$pref['download_limits'] = ($_POST['download_limits'] == 'on') ? 1 : 0;
+		save_prefs();
+		$message .= DOWLAN_126."<br />";
+	}
+	foreach(array_keys($_POST['count_num']) as $id)
+	{
+		if(!$_POST['count_num'][$id] && !$_POST['count_days'][$id] && !$_POST['bw_num'][$id] && !$_POST['bw_days'][$id])
+		{
+			//All entries empty - Remove record
+			if($sql->db_Delete('generic',"gen_id = {$id}"))
+			{
+				$message .= $id." - ".DOWLAN_119."<br />";
+			}
+			else
+			{
+				$message .= $id." - ".DOWLAN_120."<br />";
+			}
+		}
+		else
+		{
+			$sql->db_Update('generic',"gen_user_id = '".intval($_POST['bw_num'][$id])."', gen_ip = '".intval($_POST['bw_days'][$id])."', gen_intdata = '".intval($_POST['count_num'][$id])."', gen_chardata = '".intval($_POST['count_days'][$id])."' WHERE gen_id = {$id}");
+			$message .= $id." - ".DOWLAN_121."<br />";
+		}
+	}
+}
+
+if(isset($_POST['submit_mirror']))
+{
+	$download->submit_mirror($sub_action, $id);
+}
+
+if($action == "mirror")
+{
+	$download -> show_existing_mirrors();
+}
+
+
+if ($action == "dlm")
+{
+	$action = "create";
+	$id = $sub_action;
+	$sub_action = "dlm";
+}
+
+if ($action == "create") {
+	$download->create_download($sub_action, $id);
+}
+
+if ($delete == 'category') {
+	if (admin_update($sql->db_Delete("download_category", "download_category_id='$del_id' "), 'delete', DOWLAN_49." #".$del_id." ".DOWLAN_36)) {
+		$sql->db_Delete("download_category", "download_category_parent='{$del_id}' ");
+	}
+}
+
+if ($action == "cat") {
+	$download->show_categories($sub_action, $id);
+}
+
+if ($delete == 'main') {
+
+	$result = admin_update($sql->db_Delete("download", "download_id='$del_id' "), 'delete', DOWLAN_35." #".$del_id." ".DOWLAN_36);
+	if($result)
+	{
+		admin_purge_related("download", $del_id);
+	}
+	unset($sub_action, $id);
+}
+
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+if (!e_QUERY || $action == "main") {
+	$download->show_existing_items($action, $sub_action, $id, $from, $amount);
+}
+
+
+if ($action == "opt") {
+	global $pref, $ns;
+	$agree_flag = $pref['agree_flag'];
+	$agree_text = $pref['agree_text'];
+	$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td style='width:70%' class='forumheader3'>".DOWLAN_69."</td>
+		<td class='forumheader3' style='width:30%;text-align:left'>";
+	$c = $pref['download_php'] ? " checked = 'checked' " : "";
+	$text .= "<input type='checkbox' name='download_php' value='1' {$c} /> <span class='smalltext'>".DOWLAN_70."</span></td>
+		</tr>
+		<tr>
+		<td style='width:70%' class='forumheader3'>
+		".DOWLAN_55."
+		</td>
+		<td class='forumheader3' style='width:30%;text-align:left'>
+		<select name='download_view' class='tbox'>". ($pref['download_view'] == 5 ? "<option selected='selected'>5</option>" : "<option>5</option>"). ($pref['download_view'] == 10 ? "<option selected='selected'>10</option>" : "<option>10</option>"). ($pref['download_view'] == 15 ? "<option selected='selected'>15</option>" : "<option>15</option>"). ($pref['download_view'] == 20 ? "<option selected='selected'>20</option>" : "<option>20</option>"). ($pref['download_view'] == 50 ? "<option selected='selected'>50</option>" : "<option>50</option>")."
+		</select>
+		</td>
+		</tr>
+
+		<tr><td style='width:70%' class='forumheader3'>
+		".DOWLAN_56."
+		</td>
+		<td class='forumheader3' style='width:30%;text-align:left'>
+
+		<select name='download_order' class='tbox'>";
+		$order_options = array("download_id"=>"Id No.","download_datestamp"=>LAN_DATE,"download_requested"=>ADLAN_24,"download_name"=>DOWLAN_59,"download_author"=>DOWLAN_60);
+		foreach($order_options as $value=>$label){
+			$select = ($pref['download_order'] == $value) ? "selected='selected'" : "";
+			$text .= "<option value='$value' $select >$label</option>\n";
+		}
+
+		$text .= "</select>
+		</td>
+		</tr>
+		<tr><td style='width:70%' class='forumheader3'>
+		".LAN_ORDER."
+		</td>
+		<td class='forumheader3' style='width:30%;text-align:left'>
+		<select name='download_sort' class='tbox'>". ($pref['download_sort'] == "ASC" ? "<option value='ASC' selected='selected'>".DOWLAN_62."</option>" : "<option value='ASC'>".DOWLAN_62."</option>"). ($pref['download_sort'] == "DESC" ? "<option value='DESC' selected='selected'>".DOWLAN_63."</option>" : "<option value='DESC'>".DOWLAN_63."</option>")."
+		</select>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:70%' class='forumheader3'>".DOWLAN_150."</td>
+		<td class='forumheader3' style='width:30%;text-align:left'>". ($pref['download_email'] ? "<input type='checkbox' name='download_email' value='1' checked='checked' />" : "<input type='checkbox' name='download_email' value='1' />")."</td>
+		</tr>
+
+		<tr>
+		<td style='width:70%' class='forumheader3'>".DOWLAN_100."</td>
+		<td class='forumheader3' style='width:30%;text-align:left'>". ($agree_flag ? "<input type='checkbox' name='agree_flag' value='1' checked='checked' />" : "<input type='checkbox' name='agree_flag' value='1' />")."</td>
+		</tr>
+
+		<tr><td style='width:70%' class='forumheader3'>
+		".DOWLAN_101."
+		</td>
+		<td class='forumheader3' style='width:30%;text-align:left'>
+		<textarea class='tbox' name='agree_text' cols='59' rows='3'>$agree_text</textarea>
+		</td>
+		</tr>
+
+		<tr><td style='width:70%' class='forumheader3'>
+		".DOWLAN_146."
+		</td>
+		<td class='forumheader3' style='width:30%;text-align:left'>
+		<textarea class='tbox' name='download_denied' cols='59' rows='3'>".$pref['download_denied']."</textarea>
+		</td>
+		</tr>
+
+		<tr style='vertical-align:top'>
+		<td colspan='2'  style='text-align:center' class='forumheader'>
+		<input class='button' type='submit' name='updateoptions' value='".DOWLAN_64."' />
+		</td>
+		</tr>
+
+		</table>
+		</form>
+		</div>";
+	$ns->tablerender(DOWLAN_54, $text);
+}
+
+if($action == 'limits')
+{
+	if($sql->db_Select('userclass_classes','userclass_id, userclass_name'))
+	{
+		$classList = $sql->db_getList();
+	}
+	if($sql->db_Select("generic", "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as limit_bw_num, gen_ip as limit_bw_days, gen_intdata as limit_count_num, gen_chardata as limit_count_days", "gen_type = 'download_limit'"))
+	{
+		while($row = $sql->db_Fetch())
+		{
+			$limitList[$row['limit_classnum']] = $row;
+		}
+	}
+	$txt = "
+		<form method='post' action='".e_SELF."?".e_QUERY."'>
+		<table class='fborder' style='width:100%'>
+		<tr>
+			<td colspan='4' class='forumheader3' style='text-align:left'>
+		";
+		if($pref['download_limits'] == 1)
+		{
+			$chk = "checked = 'checked'";
+		}
+		else
+		{
+			$chk = "";
+		}
+
+		$txt .= "
+			<input type='checkbox' name='download_limits' {$chk} /> ".DOWLAN_125."
+			</td>
+		</tr>
+		<tr>
+			<td class='fcaption'>".DOWLAN_67."</td>
+			<td class='fcaption'>".DOWLAN_113."</td>
+			<td class='fcaption'>".DOWLAN_107."</td>
+			<td class='fcaption'>".DOWLAN_108."</td>
+		</tr>
+	";
+
+	foreach($limitList as $row)
+	{
+		$txt .= "
+		<tr>
+		<td class='forumheader3'>".$row['limit_id']."</td>
+		<td class='forumheader3'>".r_userclass_name($row['limit_classnum'])."</td>
+		<td class='forumheader3'>
+			<input type='text' class='tbox' size='5' name='count_num[{$row['limit_id']}]' value='".($row['limit_count_num'] ? $row['limit_count_num'] : "")."' /> ".DOWLAN_109."
+			<input type='text' class='tbox' size='5' name='count_days[{$row['limit_id']}]' value='".($row['limit_count_days'] ? $row['limit_count_days'] : "")."' /> ".DOWLAN_110."
+		</td>
+		<td class='forumheader3'>
+			<input type='text' class='tbox' size='5' name='bw_num[{$row['limit_id']}]' value='".($row['limit_bw_num'] ? $row['limit_bw_num'] : "")."' /> ".DOWLAN_111." ".DOWLAN_109."
+			<input type='text' class='tbox' size='5' name='bw_days[{$row['limit_id']}]' value='".($row['limit_bw_days'] ? $row['limit_bw_days'] : "")."' /> ".DOWLAN_110."
+		</td>
+		</tr>
+		";
+	}
+
+	$txt .= "
+	<tr>
+	<td class='forumheader' colspan='4' style='text-align:center'>
+	<input type='submit' class='button' name='updatelimits' value='".DOWLAN_115."' />
+	</td>
+	</tr>
+	<tr>
+	<td colspan='4'><br /><br /></td>
+	</tr>
+	<tr>
+	<td colspan='2' class='forumheader3'>".r_userclass("newlimit_class", 0, "off", "guest, member, admin, classes, language")."</td>
+	<td class='forumheader3'>
+		<input type='text' class='tbox' size='5' name='new_count_num' value='' /> ".DOWLAN_109."
+		<input type='text' class='tbox' size='5' name='new_count_days' value='' /> ".DOWLAN_110."
+	</td>
+	<td class='forumheader3'>
+		<input type='text' class='tbox' size='5' name='new_bw_num' value='' /> ".DOWLAN_111." ".DOWLAN_109."
+		<input type='text' class='tbox' size='5' name='new_bw_days' value='' /> ".DOWLAN_110."
+	</td>
+	</tr>
+	<tr>
+	<td class='forumheader' colspan='4' style='text-align:center'>
+	<input type='submit' class='button' name='addlimit' value='".DOWLAN_114."' />
+	</td>
+	</tr>
+	";
+
+	$txt .= "</table></form>";
+
+	$ns->tablerender(DOWLAN_112, $txt);
+	require_once(e_ADMIN.'footer.php');
+	exit;
+}
+
+//$download->show_options($action);
+
+require_once("footer.php");
+exit;
+
+class download {
+
+	function show_existing_items($action, $sub_action, $id, $from, $amount) {
+		global $sql, $rs, $ns, $tp, $mySQLdefaultdb,$pref;
+		$text = "<div style='text-align:center'><div style='padding : 1px; ".ADMIN_WIDTH."; margin-left: auto; margin-right: auto;'>";
+        $sortorder = ($pref['download_order']) ? $pref['download_order'] : "download_datestamp";
+		if(isset($_POST['searchdisp'])){
+			$pref['admin_download_disp'] = implode("|",$_POST['searchdisp']);
+			save_prefs();
+		}
+
+		if(!$pref['admin_download_disp']){
+			$search_display = array("download_name","download_class");
+		}else{
+            $search_display = explode("|",$pref['admin_download_disp']);
+		}
+
+         $query = "SELECT d.*, dc.* FROM #download AS d	LEFT JOIN #download_category AS dc ON dc. download_category_id  = d.download_category";
+
+		if (isset($_POST['searchquery']) && $_POST['searchquery'] != "") {
+			$query .= " WHERE  download_url REGEXP('".$_POST['searchquery']."') OR download_author REGEXP('".$_POST['searchquery']."') OR download_description  REGEXP('".$_POST['searchquery']."') ";
+            foreach($search_display as $disp){
+		  		$query .= " OR $disp REGEXP('".$_POST['searchquery']."') ";
+			}
+            $query .= " ORDER BY ".$sortorder." DESC";
+		} else {
+			$query .= " ORDER BY ".($sub_action ? $sub_action : $sortorder)." ".($id ? $id : "DESC")."  LIMIT $from, $amount";
+		}
+
+      	if ($sql->db_Select_gen($query)) {
+			$text .= $rs->form_open("post", e_SELF."?".e_QUERY, "myform")."
+				<table class='fborder' style='width:99%'>
+				<tr>
+				<td style='width:5%' class='fcaption'>ID</td>
+				";
+
+// Search Display Column header.----------
+			foreach($search_display as $disp){
+				if($disp == "download_name"){
+					$text .= "<td class='fcaption'><a href='".e_SELF."?main.download_name.".($id == "desc" ? "asc" : "desc").".$from'>".DOWLAN_27."</a></td>";
+				}else{
+					$repl = array("download_","_");
+					$text .= "<td class='fcaption'><a href='".e_SELF."?main.$disp.".($id == "desc" ? "asc" : "desc").".$from'>".ucwords(str_replace($repl," ",$disp))."</a></td>";
+				}
+			}
+
+// ------------------------------
+			$text .="
+				<td style='width:10%' class='fcaption'>".LAN_OPTIONS."</td>
+				</tr>";
+			while ($row = $sql->db_Fetch()) {
+				extract($row);
+				$text .= "<tr>
+					<td style='width:5%;vertical-align:top' class='forumheader3'>$download_id</td>";
+
+// Display Chosen options -------------------------------------
+        $bolean_list = array("download_active","download_comment");
+
+		foreach($search_display as $disp){
+			$text .= "<td class='forumheader3' style='vertical-align:top'>";
+
+        	if($disp == "download_name"){
+        		$text .= "<a href='".e_BASE."download.php?view.$download_id'>$download_name</a>";
+			}elseif($disp == "download_category"){
+				$text .= $row['download_category_name']."&nbsp;";
+        	}elseif($disp == "download_datestamp"){
+				$text .= ($row[$disp]) ? strftime($pref['shortdate'],$row[$disp])."&nbsp;" : "&nbsp";
+			}elseif($disp == "download_class" || $disp == "download_visible"){
+				$text .= r_userclass_name($row[$disp])."&nbsp;";
+        	}elseif($disp == "download_filesize"){
+				$text .= ($row[$disp]) ? round(($row[$disp] / 1000))." Kb&nbsp;" : "&nbsp";
+			}elseif($disp == "download_thumb"){
+				$text .= ($row[$disp]) ? "<img src='".e_FILE."downloadthumbs/".$row[$disp]."' alt='' />" : "";
+        	}elseif($disp == "download_image"){
+				$text .= "<a rel='external' href='".e_FILE."downloadimages/".$row[$disp]."' >".$row[$disp]."</a>&nbsp;";
+			}elseif($disp == "download_description"){
+				$text .= $tp->toHTML($row[$disp],TRUE)."&nbsp;";
+            }elseif($disp == "download_active"){
+				if($row[$disp]== 1){ $text .= "<img src='".ADMIN_TRUE_ICON_PATH."' title='".DOWLAN_123."' alt='' style='cursor:help' />\n"; 	}
+				elseif($row[$disp]== 2){ $text .= "<img src='".ADMIN_TRUE_ICON_PATH."' title='".DOWLAN_124."' alt='' style='cursor:help' /><img src='".ADMIN_TRUE_ICON_PATH."' title='".DOWLAN_124."' alt='' style='cursor:help' />\n"; 	}
+				else{ $text .= "<img src='".ADMIN_FALSE_ICON_PATH."' title='".DOWLAN_122."' alt='' style='cursor:help' />\n";  }
+			}elseif($disp == "download_comment"){
+                $text .= ($row[$disp]) ? ADMIN_TRUE_ICON : "&nbsp;";
+			}else{
+				$text .= $row[$disp]."&nbsp;";
+        	}
+
+			$text .= "</td>";
+		}
+// -------------------------------------------------------------
+
+			$text .= "
+					<td style='width:20%;vertical-align:top; text-align:center' class='forumheader3'>
+					<a href='".e_SELF."?create.edit.{$download_id}'>".ADMIN_EDIT_ICON."</a>
+					<input type='image' title='".LAN_DELETE."' name='delete[main_{$download_id}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(DOWLAN_33." [ID: $download_id ]")."') \" />
+					</td>
+					</tr>";
+			}
+			$text .= "</table></form>";
+		} else {
+			$text .= "<div style='text-align:center'>".DOWLAN_6."</div>";
+		}
+		$text .= "</div>";
+
+// Next-Previous. ==========================
+
+		$downloads = $sql->db_Count("download");
+		if ($downloads > $amount && !$_POST['searchquery']) {
+			$parms = "{$downloads},{$amount},{$from},".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.download_id.desc.")."[FROM]";
+			$text .= "<br />".$tp->parseTemplate("{NEXTPREV={$parms}}");
+		}
+
+
+// Search  & display options etc. =========================.
+
+		$text .= "<br /><form method='post' action='".e_SELF."'>\n<p>\n<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />\n<input class='button' type='submit' name='searchsubmit' value='".DOWLAN_51."' />\n</p>";
+
+		$text .= "<div style='cursor:pointer' onclick=\"expandit('sdisp')\">".LAN_DISPLAYOPT."</div>";
+		$text .= "<div id='sdisp' style='padding-top:4px;display:none;text-align:center;margin-left:auto;margin-right:auto'>
+		<table class='forumheader3' style='width:95%'><tr>";
+		$fields = mysql_list_fields($mySQLdefaultdb, MPREFIX."download");
+		$columns = mysql_num_fields($fields);
+		for ($i = 0; $i < $columns; $i++) {
+			$fname[] = mysql_field_name($fields, $i);
+		}
+        $m = 0;
+		$replacechar = array("download_","_");
+		foreach($fname as $fcol){
+        $checked = (in_array($fcol,$search_display)) ? "checked='checked'" : "";
+			$text .= "<td style='text-align:left; padding:0px'>";
+			$text .= "<input type='checkbox' name='searchdisp[]' value='".$fcol."' $checked />".str_replace($replacechar," ",$fcol) . "</td>\n";
+			$m++;
+			if($m == 5){
+				$text .= "</tr><tr>";
+				$m = 0;
+			 }
+        }
+
+		$text .= "</table></div>
+		</form>\n
+		</div>";
+// ======================
+
+		$ns->tablerender(DOWLAN_7, $text);
+	}
+
+	function show_options($action) {
+
+		if ($action == "") {
+			$action = "main";
+		}
+		$var['main']['text'] = DOWLAN_29;
+		$var['main']['link'] = e_SELF;
+
+		$var['create']['text'] = DOWLAN_30;
+		$var['create']['link'] = e_SELF."?create";
+
+		$var['cat']['text'] = DOWLAN_31;
+		$var['cat']['link'] = e_SELF."?cat";
+		$var['cat']['perm'] = "Q";
+
+		$var['opt']['text'] = LAN_OPTIONS;
+		$var['opt']['link'] = e_SELF."?opt";
+
+		$var['limits']['text'] = DOWLAN_112;
+		$var['limits']['link'] = e_SELF."?limits";
+
+		$var['mirror']['text'] = DOWLAN_128;
+		$var['mirror']['link'] = e_SELF."?mirror";
+
+		show_admin_menu(DOWLAN_32, $action, $var);
+
+	}
+
+	function create_download($sub_action, $id) {
+		global $cal,$tp, $sql, $rs, $ns, $file_array, $image_array, $thumb_array,$pst;
+		$download_status[0] = DOWLAN_122;
+		$download_status[1] = DOWLAN_123;
+		$download_status[2] = DOWLAN_124;
+		$preset = $pst->read_preset("admin_downloads");  // read preset values into array
+		extract($preset);
+
+		if (!$sql->db_Select("download_category")) {
+			$ns->tablerender(ADLAN_24, "<div style='text-align:center'>".DOWLAN_5."</div>");
+			return;
+		}
+		$download_active = 1;
+		if ($sub_action == "edit" && !$_POST['submit']) {
+			if ($sql->db_Select("download", "*", "download_id='$id' ")) {
+				$row = $sql->db_Fetch();
+				extract($row);
+
+				if($download_mirror)
+				{
+
+					$mirrorTArray = explode(chr(1), $download_mirror);
+					$mirrorArray = array();
+
+					$count=0;
+					foreach($mirrorTArray as $mirror)
+					{
+						if($mirror)
+						{
+							list($mid, $murl) = explode(",", $mirror);
+							$mirrorArray[$count]['id'] = $mid;
+							$mirrorArray[$count]['url'] = $murl;
+							$count++;
+						}
+					}
+				}
+			}
+		}
+
+		if ($sub_action == "dlm" && !$_POST['submit']) {
+			if ($sql->db_Select("upload", "*", "upload_id='$id' ")) {
+				$row = $sql->db_Fetch();
+				extract($row);
+				$download_category = $upload_category;
+				$download_name = $upload_name.($upload_version ? " v" . $upload_version : "");
+				$download_url = $upload_file;
+				$download_author_email = $upload_email;
+				$download_author_website = $upload_website;
+				$download_description = $upload_description;
+				$download_image = $upload_ss;
+				$download_filesize = $upload_filesize;
+				$image_array[] = $upload_ss;
+				$download_author = substr($upload_poster, (strpos($upload_poster, ".")+1));
+			}
+		}
+
+
+		$text = "
+			<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."' id='myform'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_11."</td>
+			<td style='width:80%' class='forumheader3'>";
+
+		$sql->db_Select("download_category", "*", "download_category_parent !=0");
+		$text .= "<select name='download_category' class='tbox'>\n";
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			if ($download_category_id == $download_category) {
+				$text .= "<option value='$download_category_id' selected='selected'>".$download_category_name."</option>\n";
+			} else {
+				$text .= "<option value='$download_category_id'>".$download_category_name."</option>\n";
+			}
+		}
+		$text .= "</select>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%; vertical-align:top' class='forumheader3'><span style='text-decoration:underline'>".DOWLAN_12."</span>:</td>
+			<td style='width:80%' class='forumheader3'>
+			<input class='tbox' type='text' name='download_name' size='60' value=\"".$tp->toForm($download_name)."\" maxlength='200' />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%; vertical-align:top' class='forumheader3'><span style='text-decoration:underline;cursor:help' title='".DOWLAN_127."' >".DOWLAN_13."</span>:</td>
+			<td style='width:80%' class='forumheader3'><div style='padding-bottom:5px'>".DOWLAN_131."&nbsp;&nbsp;
+
+		   <select name='download_url' class='tbox'>
+			<option></option>
+			";
+
+		$counter = 0;
+		while (isset($file_array[$counter])) {
+			$fpath = str_replace(e_DOWNLOAD,"",$file_array[$counter]['path']).$file_array[$counter]['fname'];
+			if (stristr($fpath, $download_url) !== FALSE) {
+				$selected = " selected='selected'";
+				$found = 1;
+			} else {
+				$selected = "";
+			}
+
+			$text .= "<option value='".$fpath."' $selected>".$fpath."</option>\n";
+			$counter++;
+		}
+
+		if (preg_match("/http:|ftp:/", $download_url)) {
+			$download_url_external = $download_url;
+		}
+
+		$etext = " - (".DOWLAN_68.")";
+		if (file_exists(e_FILE."public/".$download_url)) {
+			$etext = "";
+		}
+
+		if (!$found && $download_url) {
+			$text .= "<option value='".$download_url."' selected='selected'>".$download_url.$etext."</option>\n";
+		}
+
+		$text .= "</select></div>
+            <span style='padding-top:6px;cursor:pointer;text-decoration:underline' onclick='expandit(this)' title='".DOWLAN_14."'>".DOWLAN_149."</span>
+			<div id='use_ext' style='padding-top:6px;display:none'>
+           URL:&nbsp;
+
+			<input class='tbox' type='text' name='download_url_external' size='40' value='$download_url_external' maxlength='150' />
+			&nbsp;&nbsp;&nbsp;".DOWLAN_66."
+			<input class='tbox' type='text' name='download_filesize_external' size='8' value='$download_filesize' maxlength='10' />
+           </div>
+
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%' class='forumheader3'><span title='".DOWLAN_129."' style='cursor:help'>".DOWLAN_128."</span>:</td>
+			<td style='width:80%' class='forumheader3'>";
+
+		if(!$sql -> db_Select("download_mirror"))
+		{
+			$text .= DOWLAN_144."</tr></tr>";
+		}
+		else
+		{
+
+			$text .= DOWLAN_132."<br />
+			<div id='mirrorsection'>";
+
+			$mirrorList = $sql -> db_getList();
+
+			$m_count = (count($mirrorArray) ? count($mirrorArray) : 1);
+
+			for($count = 1; $count <= $m_count; $count++){
+
+				$opt = ($count==1) ? "id='mirror'" : "";
+				$text .="<span $opt>
+				<select name='download_mirror_name[]' class='tbox'>
+					<option></option>";
+
+				foreach($mirrorList as $mirror)	{
+					extract($mirror);
+					$text .= "<option value='$mirror_id'".($mirror_id == $mirrorArray[($count-1)]['id'] ? " selected='selected'" : "").">$mirror_name</option>\n";
+				}
+
+				$text .= "</select>
+				<input  class='tbox' type='text' name='download_mirror[]' style='width: 75%;' value=\"".$mirrorArray[($count-1)]['url']."\" maxlength='200' />";
+				$text .= "</span><br />";
+			}
+
+			$text .="</div><input class='button' type='button' name='addoption' value='".DOWLAN_130."' onclick=\"duplicateHTML('mirror','mirrorsection')\" /><br />
+
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%' class='forumheader3' ><span style='cursor:help' title='if using mirrors, select how they will be displayed'>Mirror display type:</span></td>
+			<td style='width:80%' class='forumheader3'>
+
+			<input type='radio' name='download_mirror_type' value='1'".($download_mirror_type ? " checked='checked'" : "")." /> show mirror list, allow user to choose mirror<br />
+			<input type='radio' name='download_mirror_type' value='0'".(!$download_mirror_type ? " checked='checked'" : "")." /> use random mirror - no user choice
+			</td>
+			</tr>";
+		}
+
+
+
+			$text .= "<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_15.":</td>
+			<td style='width:80%' class='forumheader3'>
+			<input class='tbox' type='text' name='download_author' size='60' value='$download_author' maxlength='100' />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_16.":</td>
+			<td style='width:80%' class='forumheader3'>
+			<input class='tbox' type='text' name='download_author_email' size='60' value='$download_author_email' maxlength='100' />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_17.":</td>
+			<td style='width:80%' class='forumheader3'>
+			<input class='tbox' type='text' name='download_author_website' size='60' value='$download_author_website' maxlength='100' />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%' class='forumheader3'><span style='text-decoration:underline'>".DOWLAN_18."</span>: </td>
+			<td style='width:80%' class='forumheader3'>
+			<textarea class='tbox' name='download_description' cols='50' rows='5' style='width:90%'>$download_description</textarea>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_19.":</td>
+			<td style='width:80%' class='forumheader3'>
+			<select name='download_image' class='tbox'>
+			<option value=''></option>";
+
+			foreach($image_array as $img){
+				$fpath = str_replace(e_FILE."downloadimages/","",$img['path'].$img['fname']);
+            	$sel = ($download_image == $fpath) ? " selected='selected'" : "";
+            	$text .= "<option value='".$fpath."' $sel>".$fpath."</option>\n";
+			}
+
+		$text .= "
+			</select>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_20.":</td>
+			<td style='width:80%' class='forumheader3'>
+			<select name='download_thumb' class='tbox'>
+			<option></option>
+			";
+
+			foreach($thumb_array as $thm){
+				$tpath = str_replace(e_FILE."downloadthumbs/","",$thm['path'].$thm['fname']);
+            	$sel = ($download_thumb == $tpath) ? " selected='selected'" : "";
+            	$text .= "<option value='".$tpath."' $sel>".$tpath."</option>\n";
+			}
+
+		$text .= "</select>
+			</td>
+			</tr>
+
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>".LAN_DATESTAMP.":</td>
+		<td style='width:80%' class='forumheader3'>
+		";
+        if(!$download_datestamp){
+        	$download_datestamp = time();
+	   	}
+		$cal_options['firstDay'] = 0;
+		$cal_options['showsTime'] = false;
+		$cal_options['showOthers'] = false;
+		$cal_options['weekNumbers'] = false;
+		$cal_options['ifFormat'] = "%d/%m/%Y %H:%M:%S";
+		$cal_options['timeFormat'] = "24";
+		$cal_attrib['class'] = "tbox";
+		$cal_attrib['size'] = "12";
+		$cal_attrib['name'] = "download_datestamp";
+		$cal_attrib['value'] = date("d/m/Y H:i:s", $download_datestamp);
+		$text .= $cal->make_input_field($cal_options, $cal_attrib);
+
+		$update_checked = ($_POST['update_datestamp']) ? "checked='checked'" : "";
+		$text .= "&nbsp;&nbsp;<span><input type='checkbox' value='1' name='update_datestamp' $update_checked />".DOWLAN_148."
+		</span>
+		</td>
+		</tr>
+
+
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_21.":</td>
+			<td style='width:80%' class='forumheader3'>
+			<select name='download_active' class='tbox'>
+			";
+
+			foreach($download_status as $key => $val){
+				$sel = ($download_active == $key) ? " selected = 'selected' " : "";
+            	$text .= "<option value='{$key}' {$sel}>{$val}</option>\n";
+			}
+			$text .= "</select>";
+
+		$text .= "</td>
+			</tr>
+
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_102.":</td>
+			<td style='width:80%' class='forumheader3'>";
+
+
+		if ($download_comment == "0") {
+			$text .= LAN_YES.": <input type='radio' name='download_comment' value='1' />
+				".LAN_NO.": <input type='radio' name='download_comment' value='0' checked='checked' />";
+		} else {
+			$text .= LAN_YES.": <input type='radio' name='download_comment' value='1' checked='checked' />
+				".LAN_NO.": <input type='radio' name='download_comment' value='0' />";
+		}
+
+		$text .= "</td>
+			</tr>";
+
+
+		$text .= "
+			<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_145.":</td>
+			<td style='width:80%' class='forumheader3'>".r_userclass('download_visible', $download_visible, 'off', 'public, nobody, member, admin, classes, language')."</td>
+			</tr>
+
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".DOWLAN_106.":</td>
+			<td style='width:80%' class='forumheader3'>".r_userclass('download_class', $download_class, 'off', 'public, nobody, member, admin, classes, language')."</td>
+			</tr>
+			";
+
+		if ($sub_action == "dlm") {
+			$text .= "<tr>
+				<td style='width:30%' class='forumheader3'>".DOWLAN_103.":<br /></td>
+				<td style='width:70%' class='forumheader3'>
+				<input type='checkbox' name='remove_upload' value='1' />
+				<input type='hidden' name='remove_id' value='$id' />
+				</td></tr>
+				";
+		}
+
+		$text .= "
+			<tr style='vertical-align:top'>
+			<td colspan='2' style='text-align:center' class='forumheader'>";
+
+
+		if ($id && $sub_action == "edit") {
+			$text .= "<input class='button' type='submit' name='submit_download' value='".DOWLAN_24."' /> ";
+		} else {
+			$text .= "<input class='button' type='submit' name='submit_download' value='".DOWLAN_25."' />";
+		}
+
+		$text .= "</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+		$ns->tablerender(ADLAN_24, $text);
+	}
+
+	function show_message($message) {
+		global $ns;
+		$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+	}
+
+	function submit_download($sub_action, $id) {
+		global $tp, $sql, $DOWNLOADS_DIRECTORY, $e_event;
+
+		if($sub_action == 'edit')
+		{
+			if($_POST['download_url_external'] == '')
+			{
+				$_POST['download_filesize_external'] = FALSE;
+			}
+		}
+
+		if ($_POST['download_url_external'] && $_POST['download_url'] == '')
+		{
+			$durl = $_POST['download_url_external'];
+			$filesize = $_POST['download_filesize_external'];
+		}
+		else
+		{
+			$durl = $_POST['download_url'];
+			if($_POST['download_filesize_external'])
+			{
+				$filesize = $_POST['download_filesize_external'];
+			}
+			else
+			{
+				if (strpos($DOWNLOADS_DIRECTORY, "/") === 0 || strpos($DOWNLOADS_DIRECTORY, ":") >= 1)
+				{
+					$filesize = filesize($DOWNLOADS_DIRECTORY.$durl);
+				}
+				else
+				{
+					$filesize = filesize(e_BASE.$DOWNLOADS_DIRECTORY.$durl);
+				}
+			}
+		}
+
+		if (!$filesize)
+		{
+			if($sql->db_Select("upload", "upload_filesize", "upload_file='$durl'"))
+			{
+				$row = $sql->db_Fetch();
+				$filesize = $row['upload_filesize'];
+			}
+		}
+
+		$_POST['download_description'] = $tp->toDB($_POST['download_description']);
+		$_POST['download_name'] = $tp->toDB($_POST['download_name']);
+		$_POST['download_author'] = $tp->toDB($_POST['download_author']);
+
+		if (preg_match("#(.*?)/(.*?)/(.*?) (.*?):(.*?):(.*?)$#", $_POST['download_datestamp'], $matches)){
+			$_POST['download_datestamp'] = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]);
+		}else{
+           $_POST['download_datestamp'] = time();
+		}
+
+		if($_POST['update_datestamp']){	$_POST['download_datestamp'] = time();	}
+
+		$mirrorStr = "";
+		$mirrorReq = "";
+
+		if($_POST['download_mirror_name'][0])
+		{
+			$mirrors = count($_POST['download_mirror_name']);
+			for($a=0; $a<$mirrors; $a++)
+			{
+				$mirror_id = $_POST['download_mirror_name'][$a];
+				$mirror_url = $_POST['download_mirror'][$a];
+				$mirrorStr .= $mirror_id.",".$mirror_url.",0".chr(1);
+			}
+		}
+
+		if ($id)
+		{
+			admin_update($sql->db_Update("download", "download_name='".$_POST['download_name']."', download_url='".$durl."', download_author='".$_POST['download_author']."', download_author_email='".$_POST['download_author_email']."', download_author_website='".$_POST['download_author_website']."', download_description='".$_POST['download_description']."', download_filesize='".$filesize."', download_category='".intval($_POST['download_category'])."', download_active='".intval($_POST['download_active'])."', download_datestamp='".intval($_POST['download_datestamp'])."', download_thumb='".$_POST['download_thumb']."', download_image='".$_POST['download_image']."', download_comment='".intval($_POST['download_comment'])."', download_class = '{$_POST['download_class']}', download_mirror='$mirrorStr', download_mirror_type='".intval($_POST['download_mirror_type'])."' , download_visible='".$_POST['download_visible']."' WHERE download_id=".intval($id)), 'update', DOWLAN_2);
+		} else {
+			if (admin_update($download_id = $sql->db_Insert("download", "0, '".$_POST['download_name']."', '".$durl."', '".$_POST['download_author']."', '".$_POST['download_author_email']."', '".$_POST['download_author_website']."', '".$_POST['download_description']."', '".$filesize."', '0', '".intval($_POST['download_category'])."', '".intval($_POST['download_active'])."', '".intval($_POST['download_datestamp'])."', '".$_POST['download_thumb']."', '".$_POST['download_image']."', '".intval($_POST['download_comment'])."', '{$_POST['download_class']}', '$mirrorStr', '".intval($_POST['download_mirror_type'])."', '".$_POST['download_visible']."' "), 'insert', DOWLAN_1)) {
+				$dlinfo = array("download_id" => $download_id, "download_name" => $_POST['download_name'], "download_url" => $durl, "download_author" => $_POST['download_author'], "download_author_email" => $_POST['download_author_email'], "download_author_website" => $_POST['download_author_website'], "download_description" => $_POST['download_description'], "download_filesize" => $filesize, "download_category" => $_POST['download_category'], "download_active" => $_POST['download_active'], "download_datestamp" => $time, "download_thumb" => $_POST['download_thumb'], "download_image" => $_POST['download_image'], "download_comment" => $_POST['download_comment'] );
+				$e_event->trigger("dlpost", $dlinfo);
+
+				if ($_POST['remove_upload']) {
+					$sql->db_Update("upload", "upload_active='1' WHERE upload_id='".$_POST['remove_id']."'");
+					$mes = "<br />".$_POST['download_name']." ".DOWLAN_104;
+					$mes .= "<br /><br /><a href='".e_ADMIN."upload.php'>".DOWLAN_105."</a>";
+					$this->show_message($mes);
+				}
+			}
+		}
+	}
+
+	function show_categories($sub_action, $id)
+	{
+		global $sql, $rs, $ns, $tp, $pst;
+
+		if (!is_object($sql2)) {
+			$sql2 = new db;
+		}
+		$text = $rs->form_open("post", e_SELF."?".e_QUERY, "myform");
+		$text .= "<div style='padding : 1px; ".ADMIN_WIDTH."; height : 200px; overflow : auto; margin-left: auto; margin-right: auto;'>";
+		
+		$qry = "
+		SELECT dc.*, COUNT(d.download_id) AS filecount FROM #download_category AS dc
+		LEFT JOIN #download AS d ON d.download_category = dc.download_category_id
+		GROUP BY dc.download_category_id
+		ORDER BY dc.download_category_order
+		";
+		if($sql->db_Select_gen($qry))
+		{
+			$categories = $sql->db_getList();
+			foreach($categories as $cat)
+			{
+				$cat_array[$cat['download_category_parent']][] = $cat;
+			}
+
+			$text .= "
+			<table class='fborder' style='width:99%'>
+				<tr>
+				<td style='width:5%; text-align:center' class='fcaption'>&nbsp;</td>
+				<td style='width:70%; text-align:center' class='fcaption'>".DOWLAN_11."</td>
+				<td style='width:5%; text-align:center' class='fcaption'>".DOWLAN_52."</td>
+				<td style='width:5%; text-align:center' class='fcaption'>".LAN_ORDER."</td>
+				<td style='width:20%; text-align:center' class='fcaption'>".LAN_OPTIONS."</td>
+				</tr>";
+
+
+			//Start displaying parent categories
+			foreach($cat_array[0] as $parent)
+			{
+				if(strstr($parent['download_category_icon'], chr(1)))
+				{
+					list($parent['download_category_icon'], $parent['download_category_icon_empty']) = explode(chr(1), $parent['download_category_icon']);
+				}
+
+				$text .= "<tr>
+					<td style='width:5%; text-align:center' class='forumheader'>".($parent['download_category_icon'] ? "<img src='".e_IMAGE."icons/{$main['download_category_icon']}' style='vertical-align:middle; border:0' alt='' />" : "&nbsp;")."</td>
+					<td colspan='2' style='width:70%' class='forumheader'><b>{$parent['download_category_name']}</b></td>
+					<td class='forumheader3'>
+					 <input class='tbox' type='text' name='catorder[{$parent['download_category_id']}]' value='{$parent['download_category_order']}' size='3' />
+					</td>
+					<td style='text-align:left;padding-left:12px' class='forumheader'>
+					<a href='".e_SELF."?cat.edit.{$parent['download_category_id']}'>".ADMIN_EDIT_ICON."</a>
+					";
+					if(!is_array($cat_array[$parent['download_category_id']]))
+					{
+						$text .= "<input type='image' title='".LAN_DELETE."' name='delete[category_{$parent['download_category_id']}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(DOWLAN_34." [ID: {$parent['download_category_id']} ]")."') \"/>";
+					}
+				$text .= "
+					</td>
+					</tr>
+					";
+
+				//Show main categories
+
+				if(is_array($cat_array[$parent['download_category_id']]))
+				{
+					foreach($cat_array[$parent['download_category_id']] as $main)
+					{
+						
+						if(strstr($main['download_category_icon'], chr(1)))
+						{
+							list($main['download_category_icon'], $main['download_category_icon_empty']) = explode(chr(1), $main['download_category_icon']);
+						}
+						$text .= "<tr>
+						<td style='width:5%; text-align:center' class='forumheader3'>".($main['download_category_icon'] ? "<img src='".e_IMAGE."icons/{$main['download_category_icon']}' style='vertical-align:middle; border:0' alt='' />" : "&nbsp;")."</td>
+						<td style='width:70%' class='forumheader3'>{$main['download_category_name']}<br /><span class='smalltext'>{$main['download_category_description']}</span></td>
+						<td style='width:5%; text-align:center' class='forumheader3'>{$main['filecount']}</td>
+						<td class='forumheader3'>
+							<input class='tbox' type='text' name='catorder[{$main['download_category_id']}]' value='{$main['download_category_order']}' size='3' />
+						</td>
+						<td style='width:20%; text-align:left;padding-left:12px' class='forumheader3'>
+						<a href='".e_SELF."?cat.edit.{$main['download_category_id']}'>".ADMIN_EDIT_ICON."</a>";
+						if(!is_array($cat_array[$main['download_category_id']]) && !$main['filecount'])
+						{
+							$text .= "<input type='image' title='".LAN_DELETE."' name='delete[category_{$main['download_category_id']}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(DOWLAN_34." [ID: {$main['download_category_id']} ]")."') \"/>";
+						}
+						$text .= "
+						</td>
+						</tr>";
+
+						//Show sub categories
+						if(is_array($cat_array[$main['download_category_id']]))
+						{
+							foreach($cat_array[$main['download_category_id']] as $sub)
+							{
+						
+								if(strstr($sub['download_category_icon'], chr(1)))
+								{
+									list($sub['download_category_icon'], $sub['download_category_icon_empty']) = explode(chr(1), $sub['download_category_icon']);
+								}
+								$text .= "<tr>
+									<td style='width:5%; text-align:center' class='forumheader3'>".($sub['download_category_icon'] ? "<img src='".e_IMAGE."icons/{$sub['download_category_icon']}' style='vertical-align:middle; border:0' alt='' />" : "&nbsp;")."</td>
+									<td style='width:70%' class='forumheader3'>&nbsp;&nbsp;&nbsp;&nbsp;".DOWLAN_53.": {$sub['download_category_name']}<br />&nbsp;&nbsp;&nbsp;&nbsp;<span class='smalltext'>{$sub['download_category_description']}</span></td>
+									<td style='width:5%; text-align:center' class='forumheader3'>{$sub['filecount']}</td>
+									<td class='forumheader3'>
+										<input class='tbox' type='text' name='catorder[{$sub['download_category_id']}]' value='{$sub['download_category_order']}' size='3' />
+									</td>
+									<td style='width:20%; text-align:left;padding-left:12px' class='forumheader3'>
+									<a href='".e_SELF."?cat.edit.{$sub['download_category_id']}'>".ADMIN_EDIT_ICON."</a>
+									";
+									if(!$sub['filecount'])
+									{
+										$text .= "<input type='image' title='".LAN_DELETE."' name='delete[category_{$sub['download_category_id']}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(DOWLAN_34." [ID: {$sub['download_category_id']} ]")."') \"/>";
+									}
+								$text .= "
+									</td>
+									</tr>";
+							}
+						}
+					}
+				}
+
+			}
+
+			$text .= "</table></div>";
+			$text .= "<div style='text-align:center'>
+				<input class='button' type='submit' name='update_catorder' value='".LAN_UPDATE."' />
+				</div>";
+		}
+		else
+		{
+			$text .= "<div style='text-align:center'>".DOWLAN_38."</div>";
+		}
+		$text .= "</form>";
+		$ns->tablerender(DOWLAN_37, $text);
+
+		unset($download_category_id, $download_category_name, $download_category_description, $download_category_parent, $download_category_icon, $download_category_class);
+
+		$handle = opendir(e_IMAGE."icons");
+		while ($file = readdir($handle)) {
+			if ($file != "." && $file != ".." && $file != "/" && $file != "CVS") {
+				$iconlist[] = $file;
+			}
+		}
+		closedir($handle);
+
+		if ($sub_action == "edit" && !$_POST['add_category']) {
+			if ($sql->db_Select("download_category", "*", "download_category_id=$id")) {
+				$row = $sql->db_Fetch();
+				 extract($row);
+				$main_category_parent = $download_category_parent;
+				if(strstr($download_category_icon, chr(1)))
+				{
+					list($download_category_icon, $download_category_icon_empty) = explode(chr(1), $download_category_icon);
+				}
+				else
+				{
+					$download_category_icon_empty = "";
+				}
+			}
+		}
+
+		$preset = $pst->read_preset("admin_dl_cat");  // read preset values into array
+		extract($preset);
+
+		$frm_action = (isset($_POST['add_category'])) ? e_SELF."?cat" : e_SELF."?".e_QUERY;
+		$text = "<div style='text-align:center'>
+			<form method='post' action='{$frm_action}' id='dlform'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='width:30%' class='forumheader3'>".DOWLAN_37.": </td>
+			<td style='width:70%' class='forumheader3'>";
+
+		if (!$download_cats = $sql->db_Select("download_category")) {
+			$text .= "
+				<select name='download_category_parent' class='tbox'>
+				<option>".DOWLAN_40."</option>
+				</select>\n";
+		} else {
+			$text .= "
+				<select name='download_category_parent' class='tbox'>
+				<option>".DOWLAN_40."</option>";
+
+			while (list($cat_id, $cat_name, $null, $null, $cat_parent) = $sql->db_Fetch()) {
+				$sql2->db_Select("download_category", "download_category_parent", "download_category_id='$cat_parent'", TRUE);
+				$row = $sql2->db_Fetch();
+				 extract($row);
+				if (!$download_category_parent || !$cat_parent) {
+					$text .= ($main_category_parent == $cat_id ? "<option value='$cat_id' selected='selected'>".$cat_name."</option>" : "<option value='$cat_id'>".$cat_name."</option>");
+				}
+			}
+			$text .= "</select>";
+		}
+		$text .= "</td></tr><tr>
+			<td style='width:30%' class='forumheader3'>".DOWLAN_12.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<input class='tbox' type='text' name='download_category_name' size='40' value='$download_category_name' maxlength='100' />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".DOWLAN_18.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<textarea class='tbox' name='download_category_description' cols='59' rows='3'>$download_category_description</textarea>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".DOWLAN_41.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<input class='tbox' type='text' id='download_category_icon' name='download_category_icon' size='60' value='$download_category_icon' maxlength='100' />
+
+			<br />
+			<input class='button' type ='button' style='cursor:hand' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
+			<div id='cat_icn' style='display:none;{head}' >";
+
+		while (list($key, $icon) = each($iconlist)) {
+			$text .= "<a href=\"javascript:insertext('$icon','download_category_icon','cat_icn')\"><img src='".e_IMAGE."icons/".$icon."' style='border:0' alt='' /></a> ";
+		}
+
+		reset($iconlist);
+
+		$text .= "
+			</div></td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".DOWLAN_147.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<input class='tbox' type='text' id='download_category_icon_empty' name='download_category_icon_empty' size='60' value='$download_category_icon_empty' maxlength='100' />
+
+			<br />
+			<input class='button' type ='button' style='cursor:hand' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
+			<div id='cat_icn_empty' style='display:none;{head}' >";
+
+		while (list($key, $icon) = each($iconlist)) {
+			$text .= "<a href=\"javascript:insertext('$icon','download_category_icon_empty','cat_icn_empty')\"><img src='".e_IMAGE."icons/".$icon."' style='border:0' alt='' /></a> ";
+		}
+
+		$text .= "
+			</div></td>
+			</tr>
+
+
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".DOWLAN_43.":<br /><span class='smalltext'>(".DOWLAN_44.")</span></td>
+			<td style='width:70%' class='forumheader3'>".r_userclass("download_category_class", $download_category_class, 'off', 'public, nobody, member, admin, classes, language')."
+
+			</td></tr>";
+
+
+		$text .= "
+			<tr style='vertical-align:top'>
+			<td colspan='2' style='text-align:center' class='forumheader'>";
+		if ($id && $sub_action == "edit" && !isset($_POST['add_category'])) {
+			$text .= "<input class='button' type='submit' name='add_category' value='".DOWLAN_46."' /> ";
+		} else {
+			$text .= "<input class='button' type='submit' name='add_category' value='".DOWLAN_45."' />";
+		}
+		$text .= "</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+		$ns->tablerender(DOWLAN_39, $text);
+	}
+
+	function create_category($sub_action, $id) {
+		global $sql, $tp;
+		$download_category_name = $tp->toDB($_POST['download_category_name']);
+		$download_category_description = $tp->toDB($_POST['download_category_description']);
+	  	$download_category_icon = $tp->toDB($_POST['download_category_icon']);
+
+		if(isset($_POST['download_category_icon_empty']) && $_POST['download_category_icon_empty'] != ""){
+			$download_category_icon .= trim(chr(1).$tp->toDB($_POST['download_category_icon_empty']));
+		}
+
+		if ($id) {
+			admin_update($sql->db_Update("download_category", "download_category_name='$download_category_name', download_category_description='$download_category_description', download_category_icon ='$download_category_icon', download_category_parent= '".intval($_POST['download_category_parent'])."', download_category_class='".$_POST['download_category_class']."' WHERE download_category_id='$id'"), 'update', DOWLAN_48);
+		} else {
+			admin_update($sql->db_Insert("download_category", "0, '$download_category_name', '$download_category_description', '$download_category_icon', '".intval($_POST['download_category_parent'])."', '".$_POST['download_category_class']."', 0 "), 'insert', DOWLAN_47);
+		}
+		if ($sub_action == "sn") {
+			$sql->db_Delete("tmp", "tmp_time='$id' ");
+		}
+	}
+
+
+
+	function show_existing_mirrors()
+	{
+
+		global $sql, $ns, $tp, $sub_action, $id, $delete, $del_id;
+
+		if($delete == "mirror")
+		{
+			admin_update($sql -> db_Delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135);
+		}
+
+
+		if(!$sql -> db_Select("download_mirror"))
+		{
+			$text = "<div style='text-align:center;'>".DOWLAN_144."</div>"; // No mirrors defined yet
+		}
+		else
+		{
+
+			$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='width: 10%; text-align: center;' class='forumheader'>ID</td>
+			<td style='width: 30%;' class='forumheader'>".DOWLAN_12."</td>
+			<td style='width: 30%;' class='forumheader'>".DOWLAN_136."</td>
+			<td style='width: 30%; text-align: center;' class='forumheader'>".LAN_OPTIONS."</td>
+			</tr>
+			";
+
+			$mirrorList = $sql -> db_getList();
+
+			foreach($mirrorList as $mirror)
+			{
+				extract($mirror);
+				$text .= "
+
+				<tr>
+				<td style='width: 10%; text-align: center;' class='forumheader3'>$mirror_id</td>
+				<td style='width: 30%;' class='forumheader3'>".$tp -> toHTML($mirror_name)."</td>
+				<td style='width: 30%;' class='forumheader3'>".($mirror_image ? "<img src='".e_FILE."downloadimages/".$mirror_image."' alt='' />" : "None")."</td>
+				<td style='width: 30%; text-align: center;' class='forumheader3'>
+				<a href='".e_SELF."?mirror.edit.{$mirror_id}'>".ADMIN_EDIT_ICON."</a>
+				<input type='image' title='".LAN_DELETE."' name='delete[mirror_{$mirror_id}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".DOWLAN_137." [ID: $mirror_id ]')\"/>
+				</td>
+				</tr>
+				";
+			}
+			$text .= "</table></form></div>";
+
+		}
+
+		$ns -> tablerender(DOWLAN_138, $text);
+
+		require_once(e_HANDLER."file_class.php");
+		$fl = new e_file;
+		$rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$',"thumb_", 'index', 'null*');
+		$imagelist = $fl->get_files(e_FILE."downloadimages/","",$rejecthumb);
+
+		if($sub_action == "edit" && !defined("SUBMITTED"))
+		{
+			$sql -> db_Select("download_mirror", "*", "mirror_id=".$id);
+			$row = $sql -> db_Fetch();
+			extract($mirror);
+			$edit = TRUE;
+		}
+		else
+		{
+			unset($mirror_name, $mirror_url, $mirror_image, $mirror_location, $mirror_description);
+			$edit = FALSE;
+		}
+
+
+
+		$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."?".e_QUERY."' id='dataform'>\n
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+
+		<tr>
+		<td style='width: 30%;' class='forumheader3'>".DOWLAN_12."</td>
+		<td style='width: 70%;' class='forumheader3'>
+		<input class='tbox' type='text' name='mirror_name' size='60' value='$mirror_name' maxlength='200' />
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width: 30%;' class='forumheader3'>".DOWLAN_139."</td>
+		<td style='width: 70%;' class='forumheader3'>
+		<input class='tbox' type='text' name='mirror_url' size='70' value='$mirror_url' maxlength='200' />
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width: 30%;' class='forumheader3'>".DOWLAN_136."</td>
+		<td style='width: 70%;' class='forumheader3'>
+		<input class='tbox' type='text' id='mirror_image' name='mirror_image' size='60' value='$mirror_image' maxlength='200' />
+
+
+		<br /><input class='button' type ='button' style='cursor:hand' size='30' value='".DOWLAN_42."' onclick='expandit(this)' />
+		<div id='imagefile' style='display:none;{head}'>";
+
+		$text .= DOWLAN_140."<br /><br />";
+
+		foreach($imagelist as $file){
+			$text .= "<a href=\"javascript:insertext('".$file['fname']."','mirror_image','imagefile')\"><img src='".e_FILE."downloadimages/".$file['fname']."' alt='' /></a> ";
+		}
+
+		$text .= "</div>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width: 30%;' class='forumheader3'>".DOWLAN_141."</td>
+		<td style='width: 70%;' class='forumheader3'>
+		<input class='tbox' type='text' name='mirror_location' size='60' value='$mirror_location' maxlength='200' />
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width: 30%;' class='forumheader3'>".DOWLAN_18."</td>
+		<td style='width: 70%;' class='forumheader3'>
+		<textarea class='tbox' name=' mirror_description' cols='70' rows='6'>$mirror_description</textarea>
+		</td>
+		</tr>
+
+		<tr>
+		<td colspan='2' class='forumheader' style='text-align:center;'>
+		".($edit ? "<input class='button' type='submit' name='submit_mirror' value='".DOWLAN_142."' /><input type='hidden' name='id' value='$mirror_id' />" : "<input class='button' type='submit' name='submit_mirror' value='".DOWLAN_143."' />")."
+		</td>
+		</tr>
+
+		</table>
+		</form>
+		</div>";
+
+		$caption = ($edit ? DOWLAN_142 : DOWLAN_143);
+
+		$ns -> tablerender($caption, $text);
+	}
+
+	function submit_mirror()
+	{
+		global $tp, $sql;
+		define("SUBMITTED", TRUE);
+		if(isset($_POST['mirror_name']) && isset($_POST['mirror_url']))
+		{
+			$name = $tp -> toDB($_POST['mirror_name']);
+			$url = $tp -> toDB($_POST['mirror_url']);
+			$location = $tp -> toDB($_POST['mirror_location']);
+
+			$description = $tp -> toDB($_POST['mirror_description']);
+
+			if (isset($_POST['id'])){
+				admin_update($sql -> db_Update("download_mirror", "mirror_name='$name', mirror_url='$url', mirror_image='".$_POST['mirror_image']."', mirror_location='$location', mirror_description='$description' WHERE mirror_id=".$_POST['id']), 'update', DOWLAN_133);
+			} else {
+				admin_update($sql -> db_Insert("download_mirror", "0, '$name', '$url', '".$_POST['mirror_image']."', '$location', '$description', 0"), 'insert', DOWLAN_134);
+			}
+		}
+	}
+
+}
+
+
+function download_adminmenu($parms) {
+	global $download;
+	global $action;
+	$download->show_options($action);
+}
+
+
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/e107_update.php 75/e107_admin/e107_update.php
--- 6171/e107_admin/e107_update.php	2004-04-07 02:40:26.000000000 -0500
+++ 75/e107_admin/e107_update.php	2006-01-09 11:02:15.000000000 -0600
@@ -1,54 +1,117 @@
-<?php
-
-require_once("../class2.php");
-require_once("auth.php");
-require_once("update_routines.php");
-
-if($_POST){
-        foreach($dbupdate as $func => $rmks){
-                $installed = call_user_func("update_".$func);
-                if((LAN_UPDATE_4 == $_POST[$func] || $_POST['updateall']) && !$installed){
-                        if(function_exists("update_".$func)){
-                                $message .=LAN_UPDATE_7." {$rmks}<br />";
-                                call_user_func("update_".$func,"do");
-                        }
-                }
-        }
-}
-
-if($message){
-        $ns -> tablerender("&nbsp;",$message);
-}
-
-$text = "
-<form method='POST' action='".e_SELF."'>
-<div style='width:100%'>
-<table class='fborder' style='width:100%'>
-<tr>
-        <td class='fcaption'>".LAN_UPDATE_1."</td>
-        <td class='fcaption'>".LAN_UPDATE_2."</td>
-</tr>
-";
-
-$updates=0;
-foreach($dbupdate as $func => $rmks){
-        if(function_exists("update_".$func)){
-                $text .= "<tr><td class='forumheader3'>{$rmks}</td>";
-                if(call_user_func("update_".$func)){
-                        $text .= "<td class='forumheader3' style='text-align:center'>".LAN_UPDATE_3."</td>";
-                } else {
-                        $updates++;
-                        $text .= "<td class='forumheader3' style='text-align:center'><input class='button' type='submit' name='{$func}' value='".LAN_UPDATE_4."' /></td>";
-                }
-                $text .= "</tr>";
-        }
-}
-if($updates > 1){
-        $text .= "
-        <tr><td class='forumheader3'></td><td class='forumheader3'></td></tr>
-        <tr><td class='forumheader3'>{$updates} ".LAN_UPDATE_5."</td><td class='forumheader3'><input class='button' type='submit' name='updateall' value='".LAN_UPDATE_6."' /></td></tr>";
-}
-
-$text .= "</table></div></form>";
-$ns -> tablerender(LAN_UPDATE_10,$text);
-require_once("footer.php");
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/e107_update.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2006/01/09 17:02:15 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+$e_sub_cat = 'database';
+require_once("auth.php");
+require_once("update_routines.php");
+
+function run_updates($dbupdate) {
+	global $ns;
+	foreach($dbupdate as $func => $rmks) {
+		$installed = call_user_func("update_".$func);
+		if ((LAN_UPDATE == $_POST[$func]) && !$installed) {
+			if (function_exists("update_".$func)) {
+				$message .= LAN_UPDATE_7." {$rmks}<br />";
+				$error=call_user_func("update_".$func, "do");
+				if ($error!='') {
+					$message = $error;
+				}
+			}
+		}
+	}
+	if ($message) {
+		$ns->tablerender(LAN_UPDATE, $message);
+	}
+}
+
+function show_updates($dbupdate, $additional = false) {
+	global $ns;
+	$text = "<form method='POST' action='".e_SELF."'>
+	<div style='width:100%'>
+	<table class='fborder' style='".ADMIN_WIDTH."'>
+	<tr>
+	<td class='fcaption'>".LAN_UPDATE."</td>
+	<td class='fcaption'>".LAN_UPDATE_2."</td>
+	</tr>
+	";
+
+	$updates = 0;
+
+	foreach($dbupdate as $func => $rmks) {
+		if (function_exists("update_".$func)) {
+			$text .= "<tr><td class='forumheader3' style='width: 60%'>{$rmks}</td>";
+			if (call_user_func("update_".$func)) {
+				$text .= "<td class='forumheader3' style='text-align:center; width: 40%'>".LAN_UPDATE_3."</td>";
+			} else {
+				$updates++;
+				$text .= "<td class='forumheader3' style='text-align:center; width: 40%'><input class='button' type='submit' name='{$func}' value='".LAN_UPDATE."' /></td>";
+			}
+			$text .= "</tr>";
+		}
+	}
+
+	$text .= "</table></div></form>";
+	$ns->tablerender(($additional ? (defined("LAN_UPDATE_11") ? LAN_UPDATE_11 : '.617 to .7 Update Continued') : LAN_UPDATE_10), $text);
+}
+
+if ($_POST) {
+	$message = run_updates($dbupdate);
+}
+
+if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'forum' AND plugin_installflag='1' ")) {
+	if(file_exists(e_PLUGIN.'forum/forum_update_check.php'))
+	{
+		include_once(e_PLUGIN.'forum/forum_update_check.php');
+	}
+}
+if ($sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."stat_info") && $sql -> db_Select("plugin", "*", "plugin_path = 'log' AND plugin_installflag='1'")) {
+	if(file_exists(e_PLUGIN.'log/log_update_check.php'))
+	{
+		include_once(e_PLUGIN.'log/log_update_check.php');
+	}
+}
+
+if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'content' AND plugin_installflag='1' "))
+{
+	if(file_exists(e_PLUGIN.'content/content_update_check.php'))
+	{
+		include_once(e_PLUGIN.'content/content_update_check.php');
+	}
+}
+
+if ($sql->db_Select("plugin", "plugin_version", "plugin_path = 'pm' AND plugin_installflag='1' "))
+{
+	if(file_exists(e_PLUGIN.'pm/pm_update_check.php'))
+	{
+		include_once(e_PLUGIN.'pm/pm_update_check.php');
+	}
+}
+
+if ($_POST) {
+	$message = run_updates($dbupdatep);
+}
+
+if (isset($dbupdatep)) {
+	show_updates($dbupdatep, true);
+}
+show_updates($dbupdate);
+
+require_once("footer.php");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/emoticon.php 75/e107_admin/emoticon.php
--- 6171/e107_admin/emoticon.php	2004-07-30 20:31:34.000000000 -0500
+++ 75/e107_admin/emoticon.php	2006-01-13 08:38:41.000000000 -0600
@@ -1,154 +1,332 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/emoticon_conf.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("F")){ header("location:".e_BASE."index.php"); exit; }
-
-if(IsSet($_POST['updatesettings'])){
-        $aj = new textparse;
-        while(list($id, $name) = each($_POST['emote_code'])){
-                $emote[] = array($aj -> formtpa($name) => $_POST['emote_text'][$id]);
-        }
-        $tmp = addslashes(serialize($emote));
-        $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='emote' ");
-        if($_POST['smiley_activate'] != $pref['smiley_activate'])
-        {
-        	clear_cache();
-        }
-        $pref['smiley_activate'] = $_POST['smiley_activate'];
-        save_prefs();
-        header("location:".e_ADMIN."emoticon.php?u");
-        exit;
-}
-
-if(!$sql -> db_Select("core", "*", "e107_name='emote'")){
-        $e107_value = setdefault();
-}else{
-        $row = $sql -> db_Fetch(); extract($row);
-}
-$emote = unserialize($e107_value);
-
-if(IsSet($_POST['addemote'])){
-        if($_POST['emote_new_code'] && $_POST['emote_new_image']){
-                $aj = new textparse;
-                $emote[count($emote)] = array($aj -> formtpa($_POST['emote_new_code']) => $_POST['emote_new_image']);
-                $tmp = addslashes(serialize($emote));
-                $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='emote' ");
-                header("location:".e_ADMIN."emoticon.php?v");
-                exit;
-        }
-}
-
-$tmp = explode(".", e_QUERY);
-
-if($tmp[0] == "del"){
-	if(!e_REFERER_SELF){exit;}
-        unset($emote[$tmp[1]]);
-
- //Fix Thermo to allow emote deletion
-        $newemote=array_values($emote);
-        $emote=$newemote;
- //End Change Chris
-
-        $tmp = addslashes(serialize($emote));
-        $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='emote' ");
-        header("location:".e_ADMIN."emoticon.php?w");
-        exit;
-}
-
-require_once("auth.php");
-
-if(e_QUERY == "u"){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".EMOLAN_1."</b></div>");
-}
-
-if(e_QUERY == "v"){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".EMOLAN_2."</b></div>");
-}
-
-if(e_QUERY == "w"){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".EMOLAN_3."</b></div>");
-}
-
-$smiley_activate = $pref['smiley_activate'];
-
-$text = "<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 400px; overflow : auto; '>
-<form method='post' action='".e_SELF."'>
-<table width='85%'>
-<tr>
-<td style='width:30%' class='forumheader3'>".EMOLAN_4.": </td>
-<td colspan='4' class='forumheader3'>";
-$text .= ($pref['smiley_activate'] ? "<input type='checkbox' name='smiley_activate' value='1'  checked='checked' />" : "<input type='checkbox' name='smiley_activate' value='1' />");
-$text .= "
-</td>
-</tr>
-<tr>
-<td rowspan='".count($emote)."' class='forumheader3' style='vertical-align:top'>".EMOLAN_5."</td>";
-foreach ($emote as $c => $value){
-        while(list($short, $name) = @each($emote[$c])){
-                $text .= "
-                <td style='width:20%; text-align:center' class='forumheader3'><input class='tbox' type='text' name='emote_code[]' size='15' value='$short' maxlength='20' /></td>
-                <td style='width:20%; text-align:center' class='forumheader3'><input class='tbox' type='text' name='emote_text[]' size='15' value='$name' maxlength='20' /></td>
-                <td style='width:10%; text-align:center' class='forumheader3'><img src='".e_IMAGE."emoticons/$name' alt='' style='vertical-align:absmiddle' /></td>
-                <td style='width:30%' class='forumheader3'>[ <a href='".e_SELF."?del.$c'>".EMOLAN_6."</a> ]</td>
-                </tr>";
-                $c++;
-        }
-}
-$text .= "<tr>
-<td colspan='5' style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='updatesettings' value='".EMOLAN_7."' />
-</td>
-</tr>
-</table>
-</form>
-</div>
-
-<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table width='85%'>
-<tr>
-<td style='width:30%' class='forumheader3'>".EMOLAN_8.": </td>
-<td class='forumheader3'><input class='tbox' type='text' name='emote_new_code' size='15' value='$name' maxlength='20' /></td>
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".EMOLAN_9.": </td>
-<td class='forumheader3'><input class='tbox' type='text' name='emote_new_image' size='30' value='$name' maxlength='100' /></td>
-</td>
-</tr>
-
-</td>
-</tr>
-<td colspan='2' style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='addemote' value='".EMOLAN_10."' />
-</td>
-</tr>
-</table>
-</form>
-</div></div>";
-
-$ns -> tablerender("<div style='text-align:center'>".EMOLAN_11."</div>", $text);
-require_once("footer.php");
-
-function setdefault(){
-        $sql = new db;
-        $tmp = 'a:60:{i:0;a:1:{s:2:"&|";s:7:"cry.png";}i:1;a:1:{s:3:"&-|";s:7:"cry.png";}i:2;a:1:{s:3:"&o|";s:7:"cry.png";}i:3;a:1:{s:3:":((";s:7:"cry.png";}i:4;a:1:{s:3:"~:(";s:7:"mad.png";}i:5;a:1:{s:4:"~:o(";s:7:"mad.png";}i:6;a:1:{s:4:"~:-(";s:7:"mad.png";}i:7;a:1:{s:2:":)";s:9:"smile.png";}i:8;a:1:{s:3:":o)";s:9:"smile.png";}i:9;a:1:{s:3:":-)";s:9:"smile.png";}i:10;a:1:{s:2:":(";s:9:"frown.png";}i:11;a:1:{s:3:":o(";s:9:"frown.png";}i:12;a:1:{s:3:":-(";s:9:"frown.png";}i:13;a:1:{s:2:":D";s:8:"grin.png";}i:14;a:1:{s:3:":oD";s:8:"grin.png";}i:15;a:1:{s:3:":-D";s:8:"grin.png";}i:16;a:1:{s:2:":?";s:12:"confused.png";}i:17;a:1:{s:3:":o?";s:12:"confused.png";}i:18;a:1:{s:3:":-?";s:12:"confused.png";}i:19;a:1:{s:3:"%-6";s:11:"special.png";}i:20;a:1:{s:2:"x)";s:8:"dead.png";}i:21;a:1:{s:3:"xo)";s:8:"dead.png";}i:22;a:1:{s:3:"x-)";s:8:"dead.png";}i:23;a:1:{s:2:"x(";s:8:"dead.png";}i:24;a:1:{s:3:"xo(";s:8:"dead.png";}i:25;a:1:{s:3:"x-(";s:8:"dead.png";}i:26;a:1:{s:2:":@";s:7:"gah.png";}i:27;a:1:{s:3:":o@";s:7:"gah.png";}i:28;a:1:{s:3:":-@";s:7:"gah.png";}i:29;a:1:{s:2:":!";s:8:"idea.png";}i:30;a:1:{s:3:":o!";s:8:"idea.png";}i:31;a:1:{s:3:":-!";s:8:"idea.png";}i:32;a:1:{s:2:":|";s:11:"neutral.png";}i:33;a:1:{s:3:":o|";s:11:"neutral.png";}i:34;a:1:{s:3:":-|";s:11:"neutral.png";}i:35;a:1:{s:2:"?!";s:12:"question.png";}i:36;a:1:{s:2:"B)";s:12:"rolleyes.png";}i:37;a:1:{s:3:"Bo)";s:12:"rolleyes.png";}i:38;a:1:{s:3:"B-)";s:12:"rolleyes.png";}i:39;a:1:{s:2:"8)";s:10:"shades.png";}i:40;a:1:{s:3:"8o)";s:10:"shades.png";}i:41;a:1:{s:3:"8-)";s:10:"shades.png";}i:42;a:1:{s:2:":O";s:12:"suprised.png";}i:43;a:1:{s:3:":oO";s:12:"suprised.png";}i:44;a:1:{s:3:":-O";s:12:"suprised.png";}i:45;a:1:{s:2:":p";s:10:"tongue.png";}i:46;a:1:{s:3:":op";s:10:"tongue.png";}i:47;a:1:{s:3:":-p";s:10:"tongue.png";}i:48;a:1:{s:2:":P";s:10:"tongue.png";}i:49;a:1:{s:3:":oP";s:10:"tongue.png";}i:50;a:1:{s:3:":-P";s:10:"tongue.png";}i:51;a:1:{s:2:";)";s:8:"wink.png";}i:52;a:1:{s:3:";o)";s:8:"wink.png";}i:53;a:1:{s:3:";-)";s:8:"wink.png";}i:54;a:1:{s:4:"!ill";s:7:"ill.png";}i:55;a:1:{s:7:"!amazed";s:10:"amazed.png";}i:56;a:1:{s:4:"!cry";s:7:"cry.png";}i:57;a:1:{s:6:"!dodge";s:9:"dodge.png";}i:58;a:1:{s:6:"!alien";s:9:"alien.png";}i:59;a:1:{s:6:"!heart";s:9:"heart.png";}}';
-        $sql -> db_Insert("core", "'emote', '$tmp' ");
-        return $tmp;
-}
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/emoticon.php,v $
+|     $Revision: 1.32 $
+|     $Date: 2006/01/13 14:38:41 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../class2.php");
+if (!getperms("F")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'emoticon';
+
+require_once("auth.php");
+
+if(!$sql->db_Count("core", "(*)", "e107_name = 'emote_default'"))
+{
+	$tmp = 'a:28:{s:9:"alien!png";s:6:"!alien";s:10:"amazed!png";s:7:"!amazed";s:9:"angry!png";s:11:"!grr !angry";s:12:"biglaugh!png";s:4:"!lol";s:11:"cheesey!png";s:10:":D :oD :-D";s:12:"confused!png";s:10:":? :o? :-?";s:7:"cry!png";s:19:"&| &-| &o| :(( !cry";s:8:"dead!png";s:21:"x) xo) x-) x( xo( x-(";s:9:"dodge!png";s:6:"!dodge";s:9:"frown!png";s:10:":( :o( :-(";s:7:"gah!png";s:10:":@ :o@ :o@";s:8:"grin!png";s:10:":D :oD :-D";s:9:"heart!png";s:6:"!heart";s:8:"idea!png";s:10:":! :o! :-!";s:7:"ill!png";s:4:"!ill";s:7:"mad!png";s:13:"~:( ~:o( ~:-(";s:12:"mistrust!png";s:9:"!mistrust";s:11:"neutral!png";s:10:":| :o| :-|";s:12:"question!png";s:2:"?!";s:12:"rolleyes!png";s:10:"B) Bo) B-)";s:7:"sad!png";s:4:"!sad";s:10:"shades!png";s:10:"8) 8o) 8-)";s:7:"shy!png";s:4:"!shy";s:9:"smile!png";s:10:":) :o) :-)";s:11:"special!png";s:3:"%-6";s:12:"suprised!png";s:10:":O :oO :-O";s:10:"tongue!png";s:21:":p :op :-p :P :oP :-P";s:8:"wink!png";s:10:";) ;o) ;-)";}';
+	$sql->db_Insert("core", "'emote_default', '$tmp' ");
+}
+
+if (isset($_POST['active']))
+{
+	if ($pref['smiley_activate'] != $_POST['smiley_activate']) {
+		$pref['smiley_activate'] = $_POST['smiley_activate'];
+		save_prefs();
+		$update = true;
+	}
+	admin_update($update);
+}
+
+/* get packs */
+
+require_once(e_HANDLER."file_class.php");
+$fl = new e_file;
+$emote = new emotec;
+foreach($_POST as $key => $value)
+{
+	if(strstr($key, "subPack_"))
+	{
+		$subpack = str_replace("subPack_", "", $key);
+		$emote -> emoteConf($subpack);
+		break;
+	}
+
+	if(strstr($key, "defPack_"))
+	{
+		$pref['emotepack'] = str_replace("defPack_", "", $key);
+		save_prefs();
+		break;
+	}
+}
+
+$emote -> installCheck();
+$emote -> listPacks();
+
+class emotec
+{
+
+	var $packArray;
+
+	function emotec()
+	{
+		/* constructor */
+		global $fl;
+		$this -> packArray = $fl -> get_dirs(e_IMAGE."emotes");
+
+		if(isset($_POST['sub_conf']))
+		{
+			$this -> saveConf();
+		}
+	}
+
+	function listPacks()
+	{
+
+		global $ns, $fl, $pref;
+
+		$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td style='width:30%' class='forumheader3'>".EMOLAN_4.": </td>
+		<td style='width:70%' class='forumheader3'>".($pref['smiley_activate'] ? "<input type='checkbox' name='smiley_activate' value='1'  checked='checked' />" : "<input type='checkbox' name='smiley_activate' value='1' />")."</td>
+		</tr>
+
+		<tr>
+		<td colspan='2' style='text-align:center' class='forumheader'>
+		<input class='button' type='submit' name='active' value='".LAN_UPDATE."' />
+		</td>
+		</tr>
+		</table>
+		</form>
+		</div>
+		";
+
+		$ns -> tablerender(EMOLAN_1, $text);
+
+
+		$text = "
+		<form method='post' action='".e_SELF."'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td class='forumheader' style='width: 20%;'>".EMOLAN_2."</td>
+		<td class='forumheader' style='width: 50%;'>".EMOLAN_3."</td>
+		<td class='forumheader' style='width: 10%; text-align: center;'>".EMOLAN_8."</td>
+		<td class='forumheader' style='width: 20%;'>".EMOLAN_9."</td>
+		";
+
+		$reject = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$', 'emoteconf*');
+		foreach($this -> packArray as $pack)
+		{
+			$emoteArray = $fl -> get_files(e_IMAGE."emotes/".$pack, "", $reject);
+
+			$text .= "
+			<tr>
+			<td class='forumheader' style='width: 20%;'>$pack</td>
+			<td class='forumheader' style='width: 20%;'>
+			";
+
+			foreach($emoteArray as $emote)
+			{
+				$text .= "<img src='".$emote['path']."/".$emote['fname']."' alt='' /> ";
+			}
+			
+			$text .= "</td>
+			<td class='forumheader3' style='width: 10%; text-align: center;'>".($pref['emotepack'] == $pack ? EMOLAN_10 : "<input class='button' type='submit' name='defPack_".$pack."' value='".EMOLAN_11." />")."</td>
+			<td class='forumheader3' style='width: 20%; text-align: center;'><input class='button' type='submit' name='subPack_".$pack."' value='".EMOLAN_12."' /></td>
+			</tr>
+			";
+		}
+
+		$text .= "
+		</table>
+		</form>
+		";
+		$ns -> tablerender(EMOLAN_13, $text);
+	}
+
+	function emoteConf($packID)
+	{
+
+		global $ns, $fl, $pref, $sysprefs, $tp;
+		$corea = "emote_".$packID;
+
+		$emotecode = $sysprefs -> getArray($corea);
+
+		$reject = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$', 'emoteconf*', '*\.txt', '*\.html', '*\.pak', '*php*', '.cvsignore');
+		$emoteArray = $fl -> get_files(e_IMAGE."emotes/".$packID, "", $reject);
+
+		$eArray = array();
+		foreach($emoteArray as $value)
+		{
+			if(!strstr($value['fname'], ".php") && !strstr($value['fname'], ".txt") && !strstr($value['fname'], ".pak") && !strstr($value['fname'], ".xml") && !strstr($value['fname'], "phpBB") && !strstr($value['fname'], ".html"))
+			{
+				$eArray[] = array('path' => $value['path'], 'fname' => $value['fname']);
+			}
+		}
+
+		$text = "
+		<form method='post' action='".e_SELF."'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td class='forumheader' style='width: 20%;'>".EMOLAN_2."</td>
+		<td class='forumheader' style='width: 20%; text-align: center;'>".EMOLAN_5."</td>
+		<td class='forumheader' style='width: 60%;'>".EMOLAN_6." <span class='smalltext'>( ".EMOLAN_7." )</a></td>
+		</tr>
+		";
+
+		foreach($eArray as $emote)
+		{
+			$ename = $emote['fname'];
+			$evalue = str_replace(".", "!", $ename);
+
+			$text .= "
+			<tr>
+			<td class='forumheader3' style='width: 20%;'>".$ename."</td>
+			<td class='forumheader3' style='width: 20%; text-align: center;'><img src='".$emote['path'].$ename."' alt='' /></td>
+			<td class='forumheader3' style='width: 60%;'><input style='width: 80%' class='tbox' type='text' name='$evalue' value='".$tp -> toForm($emotecode[$evalue])."' maxlength='200' /></td>
+			</tr>
+			";	
+		}
+
+		$text .= "
+		<tr>
+		<td style='text-align: center;' colspan='3' class='forumheader'><input class='button' type='submit' name='sub_conf' value='".EMOLAN_14."' /></td>
+		</tr>
+		
+		</table>
+		<input type='hidden' name='packID' value='$packID' />
+		</form>";
+		$ns -> tablerender(EMOLAN_15.": '".$packID."'", $text);
+
+	}
+
+	function saveConf()
+	{
+		global $ns, $sql, $tp;
+
+		$packID = $_POST['packID'];
+		unset($_POST['sub_conf'], $_POST['packID']);
+
+		foreach($_POST as $key => $value)
+		{
+			$key = str_replace("_", "!", $key);
+			$_POST[$key] = $value;
+		}
+
+		$encoded_emotes = $tp -> toDB($_POST);
+		$tmp = addslashes(serialize($encoded_emotes));
+
+		if ($sql->db_Select("core", "*", "e107_name='emote_".$packID."'")) {
+			admin_update($sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='emote_".$packID."' "), 'update', EMOLAN_16);
+		} else {
+			admin_update($sql->db_Insert("core", "'emote_".$packID."', '$tmp' "), 'insert', EMOLAN_16);
+		}
+	}
+
+	function installCheck()
+	{
+		global $sql, $fl;
+		foreach($this -> packArray as $value)
+		{
+			if(!$sql -> db_Select("core", "*", "e107_name='emote_".$value."' "))
+			{
+				$fileArray = $fl -> get_files(e_IMAGE."emotes/".$value);
+				foreach($fileArray as $file)
+				{
+					if(strstr($file['fname'], ".xml"))
+					{
+						$confFile = array('file' => $file['fname'], 'type' => "xml");
+					}
+					else if(strstr($file['fname'], ".pak"))
+					{
+						$confFile = array('file' => $file['fname'], 'type' => "pak");
+					}
+					else if(strstr($file['fname'], ".php"))
+					{
+						$confFile = array('file' => $file['fname'], 'type' => "php");
+					}
+				}
+
+				/* .pak file ------------------------------------------------------------------------------------------------------------------------------------ */
+				if($confFile['type'] == "pak")
+				{
+					$filename = e_IMAGE."emotes/".$value."/".$confFile['file'];
+					$pakconf = file ($filename);
+					$contentArray = array();
+					foreach($pakconf as $line)
+					{
+						if(trim($line) && strstr($line, "=+") && !strstr($line, ".txt") && !strstr($line, ".html") && !strstr($line, "cvs")) $contentArray[] = $line;
+					}
+					$confArray = array();
+					foreach($contentArray as $pakline)
+					{
+						$tmp = explode("=+:", $pakline);
+						$confIC = str_replace(".", "!", $tmp[0]);
+						$confArray[$confIC] = trim($tmp[2]);
+					}
+					$tmp = addslashes(serialize($confArray));
+					$sql->db_Insert("core", "'emote_".$value."', '$tmp' ");
+					echo "<div style='text-align: center;'><b>New emote pak found: '</b> ".$value."'</div>";
+				}
+				/* end ----------------------------------------------------------------------------------------------------------------------------------------- */
+
+				/* .xml file ------------------------------------------------------------------------------------------------------------------------------------ */
+				if($confFile['type'] == "xml")
+				{
+					$filename = e_IMAGE."emotes/".$value."/".$confFile['file'];
+
+					$handle = fopen ($filename, "r"); 
+					$contents = fread ($handle, filesize ($filename)); 
+					fclose ($handle);
+
+					preg_match_all("#\<emoticon file=\"(.*?)\"\>(.*?)\<\/emoticon\>#si", $contents, $match);
+					$confArray = array();
+
+					for($a=0; $a<=(count($match[0])); $a++)
+					{
+						preg_match_all("#\<string\>(.*?)\<\/string\>#si", $match[0][$a], $match2);
+
+						$codet = "";
+						foreach($match2[1] as $code)
+						{
+							$codet .= $code." ";
+						}
+
+						foreach($fileArray as $emote)
+						{
+							if(strstr($emote['fname'], $match[1][$a]))
+							{
+								$file = str_replace(".", "!", $emote['fname']);
+							}
+						}
+						$confArray[$file] = $codet;
+					}
+
+					$tmp = addslashes(serialize($confArray));
+					$sql->db_Insert("core", "'emote_".$value."', '$tmp' ");
+					echo "<div style='text-align: center;'><b>New emote xml pak found: '</b> ".$value."'</div>";
+				}
+
+				if($confFile['type'] == "php")
+				{
+					echo "<b>.conf file found</b>: installing '".$value."'<br />";
+					include_once(e_IMAGE."emotes/".$value."/".$confFile['file']);
+					$sql->db_Insert("core", "'emote_".$value."', '$_emoteconf' ");
+					echo "<div style='text-align: center;'><b>New emote php found: '</b> ".$value."'</div>";
+				}
+				/* end ----------------------------------------------------------------------------------------------------------------------------------------- */
+				
+			}
+		}
+	}
+}
+
+require_once("footer.php");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/fileinspector.php 75/e107_admin/fileinspector.php
--- 6171/e107_admin/fileinspector.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/fileinspector.php	2006-05-16 08:29:26.000000000 -0500
@@ -0,0 +1,785 @@
+<?php
+/*
++----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/fileinspector.php,v $
+|     $Revision: 1.37 $
+|     $Date: 2006/05/16 13:29:26 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once('../class2.php');
+if (!getperms('Y')) {
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
+
+$e_sub_cat = 'fileinspector';
+
+require_once('auth.php');
+require_once(e_HANDLER.'form_handler.php');
+$rs = new form;
+$fi = new file_inspector;
+
+$DOCS_DIRECTORY = str_replace('help/', '', $HELP_DIRECTORY);
+$maindirs = array('admin' => $ADMIN_DIRECTORY, 'files' => $FILES_DIRECTORY, 'images' => $IMAGES_DIRECTORY, 'themes' => $THEMES_DIRECTORY, 'plugins' => $PLUGINS_DIRECTORY, 'handlers' => $HANDLERS_DIRECTORY, 'languages' => $LANGUAGES_DIRECTORY, 'downloads' => $DOWNLOADS_DIRECTORY, 'docs' => $DOCS_DIRECTORY);
+foreach ($maindirs as $maindirs_key => $maindirs_value) {
+	$coredir[$maindirs_key] = substr($maindirs_value, 0, -1);
+}
+
+require_once('core_image.php');
+
+if (e_QUERY) {
+	$fi -> snapshot_interface();
+} else if (isset($_POST['scan'])) {
+	$fi -> scan_results();
+	$fi -> scan_config();
+} else {
+	$fi -> scan_config();
+}
+
+class file_inspector {
+	
+	var $root_dir;
+	var $files = array();
+	var $parent;
+	var $count = array();
+	var $results = 0;
+	
+	function file_inspector() {
+		global $e107;
+		set_time_limit(240);
+		$this -> root_dir = $e107 -> file_path;
+		if (substr($this -> root_dir, -1) == '/') {
+			$this -> root_dir = substr($this -> root_dir, 0, -1);
+		}
+		if ($_POST['core'] == 'fail') {
+			$_POST['integrity'] = TRUE;
+		}
+		if (MAGIC_QUOTES_GPC && $_POST['regex']) {
+			$_POST['regex'] = stripslashes($_POST['regex']);
+		}
+		if ($_POST['regex']) {
+			if ($_POST['core'] == 'fail') {
+				$_POST['core'] = 'all';
+			}
+			$_POST['missing'] = 0;
+			$_POST['integrity'] = 0;
+		}
+	}
+	
+	function scan_config() {
+		global $ns, $rs, $pref;
+
+		$text = "<div style='text-align: center'>
+		<form action='".e_SELF."' method='post' id='scanform'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td class='fcaption' colspan='2'>".FC_LAN_2."</td>
+		</tr>";
+		
+		$text .= "<tr>
+		<td class='forumheader3' style='width: 35%'>
+		".FC_LAN_3." ".FC_LAN_5.":
+		</td>
+		<td colspan='2' class='forumheader3' style='width: 65%'>
+		<input type='radio' name='core' value='all'".(($_POST['core'] == 'all' || !isset($_POST['core'])) ? " checked='checked'" : "")." /> ".FC_LAN_4."&nbsp;&nbsp;
+		<input type='radio' name='core' value='fail'".($_POST['core'] == 'fail' ? " checked='checked'" : "")." /> ".FC_LAN_6."&nbsp;&nbsp;
+		<input type='radio' name='core' value='none'".($_POST['core'] == 'none' ? " checked='checked'" : "")." /> ".FC_LAN_12."&nbsp;&nbsp;
+		</td>
+		</tr>";
+		
+		$text .= "<tr>
+		<td class='forumheader3' style='width: 35%'>
+		".FC_LAN_3." ".FC_LAN_13.":
+		</td>
+		<td colspan='2' class='forumheader3' style='width: 65%'>
+		<input type='radio' name='missing' value='1'".(($_POST['missing'] == '1' || !isset($_POST['missing'])) ? " checked='checked'" : "")." /> ".FC_LAN_9."&nbsp;&nbsp;
+		<input type='radio' name='missing' value='0'".($_POST['missing'] == '0' ? " checked='checked'" : "")." /> ".FC_LAN_10."&nbsp;&nbsp;
+		</td>
+		</tr>";
+		
+		$text .= "<tr>
+		<td class='forumheader3' style='width: 35%'>
+		".FC_LAN_3." ".FC_LAN_7.":
+		</td>
+		<td colspan='2' class='forumheader3' style='width: 65%'>
+		<input type='radio' name='noncore' value='1'".(($_POST['noncore'] == '1' || !isset($_POST['noncore'])) ? " checked='checked'" : "")." /> ".FC_LAN_9."&nbsp;&nbsp;
+		<input type='radio' name='noncore' value='0'".($_POST['noncore'] == '0' ? " checked='checked'" : "")." /> ".FC_LAN_10."&nbsp;&nbsp;
+		</td>
+		</tr>";
+		
+		$text .= "<tr>
+		<td class='forumheader3' style='width: 35%'>
+		".FC_LAN_3." ".FC_LAN_21.":
+		</td>
+		<td colspan='2' class='forumheader3' style='width: 65%'>
+		<input type='radio' name='oldcore' value='1'".(($_POST['oldcore'] == '1' || !isset($_POST['oldcore'])) ? " checked='checked'" : "")." /> ".FC_LAN_9."&nbsp;&nbsp;
+		<input type='radio' name='oldcore' value='0'".($_POST['oldcore'] == '0' ? " checked='checked'" : "")." /> ".FC_LAN_10."&nbsp;&nbsp;
+		</td>
+		</tr>";
+		
+		$text .= "<tr>
+		<td class='forumheader3' style='width: 35%'>
+		".FC_LAN_8.":
+		</td>
+		<td class='forumheader3' style='width: 65%; vertical-align: top'>
+		<input type='radio' name='integrity' value='1'".(($_POST['integrity'] == '1' || !isset($_POST['integrity'])) ? " checked='checked'" : "")." /> ".FC_LAN_9."&nbsp;&nbsp;
+		<input type='radio' name='integrity' value='0'".($_POST['integrity'] == '0' ? " checked='checked'" : "")." /> ".FC_LAN_10."&nbsp;&nbsp;
+		</td></tr>";
+		
+		$text .= "<tr>
+		<td class='forumheader3' style='width: 35%'>
+		".FC_LAN_14.":
+		</td>
+		<td colspan='2' class='forumheader3' style='width: 65%'>
+		<input type='radio' name='type' value='tree'".(($_POST['type'] == 'tree' || !isset($_POST['type'])) ? " checked='checked'" : "")." /> ".FC_LAN_15."&nbsp;&nbsp;
+		<input type='radio' name='type' value='list'".($_POST['type'] == 'list' ? " checked='checked'" : "")." /> ".FC_LAN_16."&nbsp;&nbsp;
+		</td>
+		</tr>";
+		
+		if ($pref['developer']) {
+			$text .= "<tr>
+			<td class='fcaption' colspan='2'>".FC_LAN_17."</td>
+			</tr>";
+			
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 35%'>
+			".FC_LAN_18.":
+			</td>
+			<td colspan='2' class='forumheader3' style='width: 65%'>
+			#<input class='tbox' type='text' name='regex' size='40' value='".htmlentities($_POST['regex'], ENT_QUOTES)."' />#<input class='tbox' type='text' name='mod' size='5' value='".$_POST['mod']."' />
+			</td>
+			</tr>";
+			
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 35%'>
+			".FC_LAN_19.":
+			</td>
+			<td colspan='2' class='forumheader3' style='width: 65%'>
+			<input type='checkbox' name='num' value='1'".(($_POST['num'] || !isset($_POST['num'])) ? " checked='checked'" : "")." />
+			</td>
+			</tr>";
+			
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 35%'>
+			".FC_LAN_20.":
+			</td>
+			<td colspan='2' class='forumheader3' style='width: 65%'>
+			<input type='checkbox' name='line' value='1'".(($_POST['line'] || !isset($_POST['line'])) ? " checked='checked'" : "")." />
+			</td>
+			</tr>";
+		}
+		
+		$text .= "<tr>
+		<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button('submit', 'scan', FC_LAN_11)."</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+
+		$ns -> tablerender(FC_LAN_1, $text);
+		
+	}
+	
+	function scan($dir, $image) {
+		$handle = opendir($dir.'/');
+		while (false !== ($readdir = readdir($handle))) {
+			if ($readdir != '.' && $readdir != '..' && $readdir != '/' && $readdir != 'CVS' && $readdir != 'Thumbs.db' && (strpos('._', $readdir) === FALSE)) {
+				$path = $dir.'/'.$readdir;
+				if (is_dir($path)) {
+					$dirs[$path] = $readdir;
+				} else if (!isset($image[$readdir])) {
+					$files[$readdir] = $this -> checksum($path, TRUE);
+				}
+			}
+		}
+		closedir($handle);
+		
+		if (isset($dirs)) {
+			ksort ($dirs);
+			foreach ($dirs as $dir_path => $dir_list) {
+				$list[$dir_list] = ($set = $this -> scan($dir_path, $image[$dir_list])) ? $set : array();
+			}
+		}
+		
+		if (isset($files)) {
+			ksort ($files);
+			foreach ($files as $file_name => $file_list) {
+				$list[$file_name] = $file_list;
+			}
+		}
+		
+		return $list;
+	}
+	
+	function inspect($list, $deprecated, $level, $dir, &$tree_end, &$parent_expand) {
+		global $coredir;
+		unset ($childOut);
+		$parent_expand = false;
+		if (substr($dir, -1) == '/') {
+			$dir = substr($dir, 0, -1);
+		}
+		$dir_id = dechex(crc32($dir));
+		$this -> files[$dir_id]['.']['level'] = $level;
+		$this -> files[$dir_id]['.']['parent'] = $this -> parent;
+		$this -> files[$dir_id]['.']['file'] = $dir;
+		$directory = $level ? basename($dir) : SITENAME;
+		$level++;
+		
+		foreach ($list as $key => $value) {
+			$this -> parent = $dir_id;
+			if (is_array($value)) {
+				$path = $dir.'/'.$key;
+				$child_open = false;
+				$child_end = true;
+				$sub_text .= $this -> inspect($value, $deprecated[$key], $level, $path, $child_end, $child_expand);
+				$tree_end = false;
+				if ($child_expand) {
+					$parent_expand = true;
+					$last_expand = true;
+				}
+			} else {
+					$path = $dir.'/'.$key;
+					$fid = strtolower($key);
+					$this -> files[$dir_id][$fid]['file'] = ($_POST['type'] == 'tree') ? $key : $path;
+					if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE) {
+						if ($_POST['core'] != 'none') {
+							$this -> count['core']['num']++;
+							$this -> count['core']['size'] += $this -> files[$dir_id][$fid]['size'];
+							if ($_POST['regex']) {
+								$file_content = file($path);
+								if (($this -> files[$dir_id][$fid]['size'] = filesize($path)) !== FALSE) {
+									if ($this -> files[$dir_id][$fid]['lines'] = preg_grep("#".$_POST['regex']."#".$_POST['mod'], $file_content)){
+										$this -> files[$dir_id][$fid]['file'] = ($_POST['type'] == 'tree') ? $key : $path;
+										$this -> files[$dir_id][$fid]['icon'] = 'file_core.png';
+										$dir_icon = 'fileinspector.png';
+										$parent_expand = TRUE;
+										$this -> results++;
+									} else {
+										unset($this -> files[$dir_id][$fid]);
+										$known[$dir_id][$fid] = true;
+										$dir_icon = ($dir_icon == 'fileinspector.png') ? $dir_icon : 'folder.png';
+									}
+								}
+							} else {
+								//if (strpos($dir.'/'.$key, 'htmlarea') === false) {
+									if ($_POST['integrity']) {
+										if ($dir.'/'.$key != $this -> root_dir.'/'.$coredir['admin'].'/core_image.php' && $dir.'/'.$key != $this -> root_dir.'/e107_config.php') {
+											if ($this -> checksum($path) != $value) {
+												$this -> count['fail']['num']++;
+												$this -> count['fail']['size'] += $this -> files[$dir_id][$fid]['size'];
+												$this -> files[$dir_id][$fid]['icon'] = 'file_fail.png';
+												$dir_icon = 'folder_fail.png';
+												$parent_expand = TRUE;
+											} else {
+												$this -> count['pass']['num']++;
+												$this -> count['pass']['size'] += $this -> files[$dir_id][$fid]['size'];
+												if ($_POST['core'] != 'fail') {
+													$this -> files[$dir_id][$fid]['icon'] = 'file_check.png';
+													$dir_icon = ($dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png') ? $dir_icon : 'folder_check.png';
+												} else {
+													unset($this -> files[$dir_id][$fid]);
+													$known[$dir_id][$fid] = true;
+												}
+											}
+										} else {
+											$this -> count['uncalculable']['num']++;
+											$this -> count['uncalculable']['size'] += $this -> files[$dir_id][$fid]['size'];
+											if ($_POST['core'] != 'fail') {
+												$this -> files[$dir_id][$fid]['icon'] = 'file_uncalc.png';
+											} else {
+												unset($this -> files[$dir_id][$fid]);
+												$known[$dir_id][$fid] = true;
+											}
+										}
+									} else {
+										$this -> files[$dir_id][$fid]['icon'] = 'file_core.png';
+									}
+								//} else {
+								//	$this -> count['warning']['num']++;
+								//	$this -> count['warning']['size'] += $this -> files[$dir_id][$fid]['size'];
+								//	$this -> files[$dir_id][$fid]['icon'] = 'file_warning.png';
+								//	$dir_icon = 'folder_warning.png';
+								//	$parent_expand = TRUE;
+								//}
+							}
+						} else {
+							unset ($this -> files[$dir_id][$fid]);
+							$known[$dir_id][$fid] = true;
+						}
+					} else if ($_POST['missing']) {
+						$this -> count['missing']['num']++;
+						$this -> files[$dir_id][$fid]['icon'] = 'file_missing.png';
+						$dir_icon = ($dir_icon == 'folder_fail.png') ? $dir_icon : 'folder_missing.png';
+						$parent_expand = TRUE;
+					} else {
+						unset ($this -> files[$dir_id][$fid]);
+					}
+			}
+		}
+		
+		if ($_POST['noncore'] || $_POST['oldcore']) {
+			$handle = opendir($dir.'/');
+			while (false !== ($readdir = readdir($handle))) {
+				if ($readdir != '.' && $readdir != '..' && $readdir != '/' && $readdir != 'CVS' && $readdir != 'Thumbs.db' && (strpos('._', $readdir) === FALSE)) {
+					if (is_dir($dir.'/'.$readdir)) {
+						if (!isset($list[$readdir]) && ($level > 1 || $readdir == 'e107_install')) {
+							$child_open = false;
+							$child_end = true;
+							$sub_text .= $this -> inspect(array(), $deprecated[$readdir], $level, $dir.'/'.$readdir, $child_end, $child_expand);
+							$tree_end = false;
+							if ($child_expand) {
+								$parent_expand = true;
+								$last_expand = true;
+							}
+						}
+					} else {
+						$aid = strtolower($readdir);
+						if (!isset($this -> files[$dir_id][$aid]['file']) && !$known[$dir_id][$aid]) {
+							if (strpos($dir.'/'.$readdir, 'htmlarea') === false) {
+								if (isset($deprecated[$readdir])) {
+									if ($_POST['oldcore']) {
+										$this -> files[$dir_id][$aid]['file'] = ($_POST['type'] == 'tree') ? $readdir : $dir.'/'.$readdir;
+										$this -> files[$dir_id][$aid]['size'] = filesize($dir.'/'.$readdir);
+										$this -> files[$dir_id][$aid]['icon'] = 'file_old.png';
+										$this -> count['deprecated']['num']++;
+										$this -> count['deprecated']['size'] += $this -> files[$dir_id][$aid]['size'];
+									}
+								} else {
+									if ($_POST['noncore']) {
+										$this -> files[$dir_id][$aid]['file'] = ($_POST['type'] == 'tree') ? $readdir : $dir.'/'.$readdir;
+										$this -> files[$dir_id][$aid]['size'] = filesize($dir.'/'.$readdir);
+										$this -> files[$dir_id][$aid]['icon'] = 'file_unknown.png';
+										$this -> count['unknown']['num']++;
+										$this -> count['unknown']['size'] += $this -> files[$dir_id][$aid]['size'];
+									}
+								}
+							} else {
+								$this -> files[$dir_id][$aid]['file'] = ($_POST['type'] == 'tree') ? $readdir : $dir.'/'.$readdir;
+								$this -> files[$dir_id][$aid]['size'] = filesize($dir.'/'.$readdir);
+								$this -> files[$dir_id][$aid]['icon'] = 'file_warning.png';
+								$this -> count['warning']['num']++;
+								$this -> count['warning']['size'] += $this -> files[$dir_id][$aid]['size'];
+								$this -> count['deprecated']['num']++;
+								$this -> count['deprecated']['size'] += $this -> files[$dir_id][$aid]['size'];
+								$dir_icon = 'folder_warning.png';
+								$parent_expand = TRUE;
+							}
+							if ($_POST['regex']) {
+								$file_content = file($dir.'/'.$readdir);
+								if ($this -> files[$dir_id][$aid]['lines'] = preg_grep("#".$_POST['regex']."#".$_POST['mod'], $file_content)) {
+									$dir_icon = 'fileinspector.png';
+									$parent_expand = TRUE;
+									$this -> results++;
+								} else {
+									unset($this -> files[$dir_id][$aid]);
+									$dir_icon = ($dir_icon == 'fileinspector.png') ? $dir_icon : 'folder.png';
+								}
+							} else {
+								if (isset($deprecated[$readdir])) {
+									if ($_POST['oldcore']) {
+										$dir_icon = ($dir_icon == 'folder_warning.png' || $dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png' || $dir_icon == 'folder_old_dir.png') ? $dir_icon : 'folder_old.png';
+										$parent_expand = TRUE;
+									}
+								} else {
+									if ($_POST['noncore']) {
+										$dir_icon = ($dir_icon == 'folder_warning.png' || $dir_icon == 'folder_fail.png' || $dir_icon == 'folder_missing.png' || $dir_icon == 'folder_old.png' || $dir_icon == 'folder_old_dir.png') ? $dir_icon : 'folder_unknown.png';
+										$parent_expand = TRUE;
+									}
+								}
+							}
+						} else if ($_POST['core'] == 'none') {
+							unset($this -> files[$dir_id][$aid]);
+						}
+					}
+				}
+			}
+			closedir($handle);
+		}
+		
+		$dir_icon = $dir_icon ? $dir_icon : 'folder.png';
+		$icon = "<img src='".e_IMAGE."fileinspector/".$dir_icon."' class='i' alt='' />";
+		$hide = ($last_expand && $dir_icon != 'folder_core.png') ? "" : "style='display: none'";
+		$text = "<div class='d' style='margin-left: ".($level * 8)."px'>";
+		$text .= $tree_end ? "<img src='".e_IMAGE."fileinspector/blank.png' class='e' alt='' />" : "<span onclick=\"ec('".$dir_id."')\"><img src='".e_IMAGE."fileinspector/".($hide ? 'expand.png' : 'contract.png')."' class='e' alt='' id='e_".$dir_id."' /></span>";
+		$text .= "&nbsp;<span onclick=\"sh('f_".$dir_id."')\">".$icon."&nbsp;".$directory."</span>";
+		$text .= $tree_end ? "" : "<div ".$hide." id='d_".$dir_id."'>".$sub_text."</div>";
+		$text .= "</div>";
+		
+		$this -> files[$dir_id]['.']['icon'] = $dir_icon;
+
+		return $text;
+	}
+
+	function scan_results() {
+		global $ns, $rs, $core_image, $deprecated_image;
+		$scan_text = $this -> inspect($core_image, $deprecated_image, 0, $this -> root_dir);
+
+		if ($_POST['type'] == 'tree') {
+			$text = "<div style='text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td class='fcaption' colspan='2'>".FR_LAN_2."</td>
+			</tr>";
+
+			$text .= "<tr style='display: none'><td style='width:50%'></td><td style='width:50%'></td></tr>";
+		
+			$text .= "<tr>
+			<td class='forumheader3' style='width:50%'>
+			<div style='height: 400px; overflow: auto'>
+			".$scan_text."
+			</div>
+			</td>
+			<td class='forumheader3' style='width:50%; vertical-align: top'><div style='height: 400px; overflow: auto'>";	
+		} else {
+			$text = "<div style='text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td class='fcaption' colspan='2'>".FR_LAN_2."</td>
+			</tr>";
+			
+			$text .= "<tr>
+			<td class='forumheader3' colspan='2'>";
+		}
+
+		$text .= "<table class='t' id='initial'>";
+		
+		if ($_POST['type'] == 'tree') {
+			$text .= "<tr><td class='f' style='padding-left: 4px'>
+			<img src='".e_IMAGE."fileinspector/fileinspector.png' class='i' alt='' />&nbsp;<b>".FR_LAN_3."</b></td>
+			<td class='s' style='text-align: right; padding-right: 4px' onclick=\"sh('f_".dechex(crc32($this -> root_dir))."')\">
+			<img src='".e_IMAGE."fileinspector/forward.png' class='i' alt='' /></td></tr>";
+		} else {
+			$text .= "<tr><td class='f' style='padding-left: 4px' colspan='2'>
+			<img src='".e_IMAGE."fileinspector/fileinspector.png' class='i' alt='' />&nbsp;<b>".FR_LAN_3."</b></td>
+			</tr>";
+		}
+
+		if ($_POST['core'] != 'none') {
+			$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_core.png' class='i' alt='' />&nbsp;".FR_LAN_4.":&nbsp;".($this -> count['core']['num'] ? $this -> count['core']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['core']['size'], 2)."</td></tr>";
+		}
+		if ($_POST['missing']) {
+			$text .= "<tr><td class='f' colspan='2'><img src='".e_IMAGE."fileinspector/file_missing.png' class='i' alt='' />&nbsp;".FR_LAN_22.":&nbsp;".($this -> count['missing']['num'] ? $this -> count['missing']['num'] : FR_LAN_21)."&nbsp;</td></tr>";
+		}
+		if ($_POST['noncore']) {
+			$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_unknown.png' class='i' alt='' />&nbsp;".FR_LAN_5.":&nbsp;".($this -> count['unknown']['num'] ? $this -> count['unknown']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['unknown']['size'], 2)."</td></tr>";
+		}
+		if ($_POST['oldcore']) {
+			$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_old.png' class='i' alt='' />&nbsp;".FR_LAN_24.":&nbsp;".($this -> count['deprecated']['num'] ? $this -> count['deprecated']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['deprecated']['size'], 2)."</td></tr>";
+		}
+		if ($_POST['core'] == 'all') {
+			$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file.png' class='i' alt='' />&nbsp;".FR_LAN_6.":&nbsp;".($this -> count['core']['num'] + $this -> count['unknown']['num'] + $this -> count['deprecated']['num'])."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['core']['size'] + $this -> count['unknown']['size'] + $this -> count['deprecated']['size'], 2)."</td></tr>";
+		}
+		
+		if ($this -> count['warning']['num']) {
+			$text .= "<tr><td colspan='2'>&nbsp;</td></tr>";
+			$text .= "<tr><td style='padding-left: 4px' colspan='2'>
+			<img src='".e_IMAGE."fileinspector/warning.png' class='i' alt='' />&nbsp;<b>".FR_LAN_26."</b></td></tr>";
+		
+			$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_warning.png' class='i' alt='' />&nbsp;".FR_LAN_28.":&nbsp;".($this -> count['warning']['num'] ? $this -> count['warning']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['warning']['size'], 2)."</td></tr>";
+			
+			$text .= "<tr><td class='w' colspan='2'><img src='".e_IMAGE."fileinspector/info.png' class='i' alt='' />&nbsp;".FR_LAN_27."</td></tr>";
+
+		}
+		if ($_POST['integrity'] && $_POST['core'] != 'none') {
+			$integrity_icon = $this -> count['fail']['num'] ? 'integrity_fail.png' : 'integrity_pass.png';
+			$integrity_text = $this -> count['fail']['num'] ? '( '.$this -> count['fail']['num'].' '.FR_LAN_19.' )' : '( '.FR_LAN_20.' )';
+			$text .= "<tr><td colspan='2'>&nbsp;</td></tr>";
+			$text .= "<tr><td class='f' style='padding-left: 4px' colspan='2'>
+			<img src='".e_IMAGE."fileinspector/".$integrity_icon."' class='i' alt='' />&nbsp;<b>".FR_LAN_7."</b> ".$integrity_text."</td></tr>";
+		
+			$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_check.png' class='i' alt='' />&nbsp;".FR_LAN_8.":&nbsp;".($this -> count['pass']['num'] ? $this -> count['pass']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['pass']['size'], 2)."</td></tr>";
+			$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_fail.png' class='i' alt='' />&nbsp;".FR_LAN_9.":&nbsp;".($this -> count['fail']['num'] ? $this -> count['fail']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['fail']['size'], 2)."</td></tr>";
+			$text .= "<tr><td class='f'><img src='".e_IMAGE."fileinspector/file_uncalc.png' class='i' alt='' />&nbsp;".FR_LAN_25.":&nbsp;".($this -> count['uncalculable']['num'] ? $this -> count['uncalculable']['num'] : FR_LAN_21)."&nbsp;</td><td class='s'>".$this -> parsesize($this -> count['uncalculable']['size'], 2)."</td></tr>";
+		
+			$text .= "<tr><td colspan='2'>&nbsp;</td></tr>";
+
+			$text .= "<tr><td class='f' colspan='2'><img src='".e_IMAGE."fileinspector/info.png' class='i' alt='' />&nbsp;".FR_LAN_10.":&nbsp;</td></tr>";
+
+			$text .= "<tr><td style='padding-right: 4px' colspan='2'>
+			<ul><li>
+			<a href=\"javascript: expandit('i_corrupt')\">".FR_LAN_11."...</a><div style='display: none' id='i_corrupt'>
+			".FR_LAN_12."<br /><br /></div>
+			</li><li>
+			<a href=\"javascript: expandit('i_date')\">".FR_LAN_13."...</a><div style='display: none' id='i_date'>
+			".FR_LAN_14."<br /><br /></div>
+			</li><li>
+			<a href=\"javascript: expandit('i_edit')\">".FR_LAN_15."...</a><div style='display: none' id='i_edit'>
+			".FR_LAN_16."<br /><br /></div>
+			</li><li>
+			<a href=\"javascript: expandit('i_cvs')\">".FR_LAN_17."...</a><div style='display: none' id='i_cvs'>
+			".FR_LAN_18."<br /><br /></div>
+			</li></ul>
+			</td></tr>";
+		}
+		
+		if ($_POST['type'] == 'tree' && !$this -> results && $_POST['regex']) {
+			$text .= "</td></tr>
+			<tr><td style='padding-right: 4px; text-align: center' colspan='2'><br />".FR_LAN_23."</td></tr>";
+		}
+
+		$text .= "</table>";
+		
+		if ($_POST['type'] != 'tree') {
+			$text .= "<br /></td></tr><tr>
+			<td class='forumheader3' colspan='2'>
+			<table class='t'>";
+			if (!$this -> results && $_POST['regex']) {
+				$text .= "<tr><td class='f' style='padding-left: 4px; text-align: center' colspan='2'>".FR_LAN_23."</td></tr>";
+			}
+		}
+
+		foreach ($this -> files as $dir_id => $fid) {
+			ksort($fid);
+			$text .= ($_POST['type'] == 'tree') ? "<table class='t' style='display: none' id='f_".$dir_id."'>" : "";
+			$initial = FALSE;
+			foreach ($fid as $key => $stext) {
+				if (!$initial) {
+					if ($_POST['type'] == 'tree') {
+						$text .= "<tr><td class='f' style='padding-left: 4px' ".($stext['level'] ? "onclick=\"sh('f_".$stext['parent']."')\"" : "").">
+						<img src='".e_IMAGE."fileinspector/".($stext['level'] ? "folder_up.png" : "folder_root.png")."' class='i' alt='' />".($stext['level'] ? "&nbsp;.." : "")."</td>
+						<td class='s' style='text-align: right; padding-right: 4px' onclick=\"sh('initial')\"><img src='".e_IMAGE."fileinspector/close.png' class='i' alt='' /></td></tr>";
+					}
+				} else {
+					if ($_POST['type'] != 'tree') {
+						$stext['file'] = str_replace($this -> root_dir."/", "", $stext['file']);
+					}
+					$text .= "<tr>
+					<td class='f'><img src='".e_IMAGE."fileinspector/".$stext['icon']."' class='i' alt='' />&nbsp;".$stext['file']."&nbsp;";
+					if ($_POST['regex']) {
+						if ($_POST['num'] || $_POST['line']) {
+							$text .= "<br />";
+						}
+						foreach ($stext['lines'] as $rkey => $rvalue) {
+							if ($_POST['num']) {
+								$text .= "[".($rkey + 1)."] ";
+							}
+							if ($_POST['line']) {
+								$text .= htmlspecialchars($rvalue)."<br />";
+							}
+						}
+						$text .= "<br />";
+					} else {
+						$text .= "</td>
+						<td class='s'>".$this -> parsesize($stext['size']);
+					}
+					$text .= "</td></tr>";
+				}
+				$initial = TRUE;
+			}
+			$text .= ($_POST['type'] == 'tree') ? "</table>" : "";
+		}
+		
+		if ($_POST['type'] != 'tree') {
+			$text .= "</td>
+			</tr></table>";
+		}
+
+		$text .= "</td></tr>";
+		
+		$text .= "</table>
+		</dit><br />";
+
+		$ns -> tablerender(FR_LAN_1.'...', $text);
+	}
+	
+	function create_image($dir) {
+		global $core_image, $deprecated_image, $coredir;
+		
+		foreach ($coredir as $trim_key => $trim_dirs) {
+			$search[$trim_key] = "'".$trim_dirs."'";
+			$replace[$trim_key] = "\$coredir['".$trim_key."']";
+		}
+		
+		$data = "<?php\n";
+		$data .= "/*\n";
+		$data .= "+ ----------------------------------------------------------------------------+\n";
+		$data .= "|     e107 website system\n";
+		$data .= "|\n";
+		$data .= "|     Steve Dunstan 2001-2002\n";
+		$data .= "|     http://e107.org\n";
+		$data .= "|     jalist@e107.org\n";
+		$data .= "|\n";
+		$data .= "|     Released under the terms and conditions of the\n";
+		$data .= "|     GNU General Public License (http://gnu.org).\n";
+		$data .= "|\n";
+		$data .= "|     \$Source: /cvsroot/e107/e107_0.7/e107_admin/fileinspector.php,v $\n";
+		$data .= "|     \$Revision: 1.37 $\n";
+		$data .= "|     \$Date: 2006/05/16 13:29:26 $\n";
+		$data .= "|     \$Author: mcfly_e107 $\n";
+		$data .= "+----------------------------------------------------------------------------+\n";
+		$data .= "*/\n\n";
+		$data .= "if (!defined('e107_INIT')) { exit; }\n\n";
+		
+		$scan_current = ($_POST['snaptype'] == 'current') ? $this -> scan($dir) : $core_image;
+		$image_array = var_export($scan_current, true);
+		$image_array = str_replace($search, $replace, $image_array);
+		$data .= "\$core_image = ".$image_array.";\n\n";
+		
+		$scan_deprecated = ($_POST['snaptype'] == 'deprecated') ? $this -> scan($dir, $core_image) : $deprecated_image;
+		$image_array = var_export($scan_deprecated, true);
+		$image_array = str_replace($search, $replace, $image_array);
+		$data .= "\$deprecated_image = ".$image_array.";\n\n";
+
+		$data .= "?>";
+		$fp = fopen(e_ADMIN.'core_image.php', 'w');
+		fwrite($fp, $data);
+	}
+	
+	function snapshot_interface() {
+		global $ns, $rs;
+		$text = "";
+		if (isset($_POST['create_snapshot'])) {
+			$this -> create_image($_POST['snapshot_path']);
+			$text = "<div style='text-align:center'>
+			<form action='".e_SELF."' method='post' id='main_page'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td class='fcaption'>Snapshot Created</td>
+			</tr>";
+		
+			$text .= "<tr>
+			<td class='forumheader3' style='text-align:center'>
+			The snapshot (".e_ADMIN."core_image.php) was successfully created.
+			</td>
+			</tr>
+			<tr>
+			<td style='text-align:center' class='forumheader'>".$rs -> form_button('submit', 'main_page', 'Return To Main Page')."</td>
+			</tr>
+			</table>
+			</form>
+			</div><br />";
+		}
+		
+		$text .= "<div style='text-align:center'>
+		<form action='".e_SELF."?".e_QUERY."' method='post' id='snapshot'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td class='fcaption' colspan='2'>Create Snapshot</td>
+		</tr>";
+		
+		$text .= "<tr>
+		<td class='forumheader3' style='width:50%'>
+		Absolute path of root directory to create image from:
+		</td>
+		<td class='forumheader3' style='width:50%'>
+		<input class='tbox' type='text' name='snapshot_path' size='60' value='".(isset($_POST['snapshot_path']) ? $_POST['snapshot_path'] : $this -> root_dir)."' />
+		</td></tr>
+		
+		<tr>
+		<td class='forumheader3' style='width: 35%'>
+		Create snapshot of current or deprecated core files:
+		</td>
+		<td colspan='2' class='forumheader3' style='width: 65%'>
+		<input type='radio' name='snaptype' value='current'".($_POST['snaptype'] == 'current' || !isset($_POST['snaptype']) ? " checked='checked'" : "")." /> Current&nbsp;&nbsp;
+		<input type='radio' name='snaptype' value='deprecated'".($_POST['snaptype'] == 'deprecated' ? " checked='checked'" : "")." /> Deprecated&nbsp;&nbsp;
+		</td>
+		</tr>
+		
+		<tr>
+		<td class='forumheader' style='text-align:center' colspan='2'>".$rs -> form_button('submit', 'create_snapshot', 'Create Snapshot')."</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+
+		$ns -> tablerender('Snapshot', $text);
+
+	}
+	
+	function checksum($filename) {
+		$checksum = md5(str_replace(array(chr(13),chr(10)), "", file_get_contents($filename)));
+		return $checksum;
+	}
+	
+	function parsesize($size, $dec = 0) {
+		$size = $size ? $size : 0;
+		$kb = 1024;
+		$mb = 1024 * $kb;
+		$gb = 1024 * $mb;
+		$tb = 1024 * $gb;
+		if ($size < $kb) {
+			return $size." b";
+		} else if($size < $mb) {
+			return round($size/$kb)." kb";
+		} else if($size < $gb) {
+			return round($size/$mb, $dec)." mb";
+		} else if($size < $tb) {
+			return round($size/$gb, $dec)." gb";
+		} else {
+			return round($size/$tb, $dec)." tb";
+		}
+	}
+	
+	function regex_match($file) {
+		$file_content = file_get_contents($file);
+		$match = preg_match($_POST['regex'], $file_content);
+		return $match;
+	}
+}
+
+require_once('footer.php');
+
+function headerjs() {
+global $e107;
+$text = "<script type='text/javascript'>
+<!--
+c = new Image(); c = '".SITEURLBASE.e_IMAGE_ABS."fileinspector/contract.png';
+e = '".SITEURLBASE.e_IMAGE_ABS."fileinspector/expand.png';
+function ec(ecid) {
+	icon = document.getElementById('e_' + ecid).src;
+	if (icon == e) {
+		document.getElementById('e_' + ecid).src = c;
+	} else {
+		document.getElementById('e_' + ecid).src = e;
+	}
+
+	div = document.getElementById('d_' + ecid).style;
+	if (div.display == 'none') {
+		div.display = '';
+	} else {
+		div.display = 'none';
+	}
+}
+
+var hideid = 'initial';
+function sh(showid) {
+	if (hideid != showid) {
+		show = document.getElementById(showid).style;
+		hide = document.getElementById(hideid).style;
+		show.display = '';
+		hide.display = 'none';
+		hideid = showid;
+	}
+}
+//-->
+</script>
+<style type='text/css'>
+<!--\n";
+if ($_POST['regex']) {
+	$text .= ".f { padding: 1px 0px 1px 8px; vertical-align: bottom; width: 90% }\n";
+} else {
+	$text .= ".f { padding: 1px 0px 1px 8px; vertical-align: bottom; width: 90%; white-space: nowrap }\n";
+}
+$text .= ".d { margin: 2px 0px 1px 8px; cursor: default; white-space: nowrap }
+.s { padding: 1px 8px 1px 0px; vertical-align: bottom; width: 10%; white-space: nowrap }
+.t { margin-top: 1px; width: 100%; border-collapse: collapse; border-spacing: 0px }
+.w { padding: 1px 0px 1px 8px; vertical-align: bottom; width: 90% }
+.i { width: 16px; height: 16px }
+.e { width: 9px; height: 9px }
+-->
+</style>\n";
+		
+return $text;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/filemanager.php 75/e107_admin/filemanager.php
--- 6171/e107_admin/filemanager.php	2004-09-10 05:12:52.000000000 -0500
+++ 75/e107_admin/filemanager.php	2006-02-14 21:06:43.000000000 -0600
@@ -1,290 +1,377 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/filemanager.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-
-if(!getperms("6")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-
-$imagedir = e_IMAGE."filemanager/";
-
-$choice .= e_FILE;
-
-$admin_choice=$_POST['admin_choice'];
-
-if($admin_choice=="Custom" && getperms("I")){
-	$choice= e_PLUGIN."custom/";
-}
-if($admin_choice=="Custompages" && getperms("I")){
-	$choice= e_PLUGIN."custompages/";
-}
-
-$path = str_replace("../", "", (e_QUERY ? e_QUERY : $choice));
-if(!$path){ $path =  str_replace("../", "", $choice); }
-
-if(IsSet($_POST['deletefile'])){
-	if(!$_POST['ac'] == md5(ADMINPWCHANGE)){ exit; }
-	$destination_file  = e_BASE.$_POST['deleteconfirm'];
-	if(@unlink($destination_file)){
-		$message = FMLAN_26." '".$destination_file."' ".FMLAN_27.".";
-	}else{
-		$message = FMLAN_28." '".$destination_file."'.";
-	}
-}
-
-if(IsSet($_POST['upload'])){
-	if(!$_POST['ac'] == md5(ADMINPWCHANGE)){ exit; }
-	$pref['upload_storagetype'] = "1";
-	require_once(e_HANDLER."upload_handler.php");
-	
-	$files = $_FILES['file_userfile'];
-
-	
-
-
-	foreach($files['name'] as $key => $name){
-		if($files['size'][$key]){
-			$uploaded = file_upload(e_BASE.$_POST['upload_dir'][$key]);
-		}
-	}
-}
-
-if(IsSet($message)){
-	$ns -> tablerender("", "<div style=\"text-align:center\"><b>".$message."</b></div>");
-}
-
-if(strpos(e_QUERY, ".")){
-	echo "<iframe style=\"width:100%\" src=\"".e_BASE.e_QUERY."\" height=\"300\" scrolling=\"yes\"></iframe><br /><br />";
-	if(!strpos(e_QUERY, "/")){
-		$path = "";
-	}else{
-		$path = substr($path, 0, strrpos(substr($path, 0, -1), "/"))."/";
-	}	
-}
-
-$files=array();
-$dirs=array();
-$path=explode("?",$path);
-$path=$path[0];
-$path=explode(".. ",$path);
-$path=$path[0];
-
-if($handle = opendir(e_BASE.$path)){
-	while (false !== ($file = readdir($handle))){ 
-		if($file != "." && $file != ".."){
-
-			if(getenv('windir') && is_file(e_BASE.$path."\\".$file)){
-				if(is_file(e_BASE.$path."\\".$file)){
-					$files[] = $file;
-				}else{
-					$dirs[] = $file;
-				}
-			}else{
-				if(is_file(e_BASE.$path."/".$file)){
-					$files[] = $file;
-				}else{
-					$dirs[] = $file;
-				}
-			}
-		}
-	}
-}
-closedir($handle); 
-
-if(count($files) != 0){
-	sort($files);
-}
-if(count($dirs) != 0){
-	sort($dirs);
-}
-
-if(count($files) == 1){
-	$cstr = FMLAN_12;
-}else{
-	$cstr = FMLAN_13;
-}
-
-if(count($dirs) == 1){
-	$dstr = FMLAN_14;
-}else{
-	$dstr = FMLAN_15;
-}
-
-$pathd = $path;
-
-$text = "<div style='text-align:center'>\n
-<form method='post' action='".e_SELF."?".e_QUERY."'>\n
-<table style='width:auto' class='fborder'>\n
-<tr>\n\n
-
-<td style='width:70%' class='forumheader3'>\n
-".FMLAN_32."
-</td>\n
-<td style='width:30%' class='forumheader3' style='text-align:center'>\n
-<select name='admin_choice' class='tbox'>\n";
-($admin_choice=="Files" ? $text .= "<option value='Files' selected='selected'>".FMLAN_35."</option>" : $text .= "<option value='Files'>".FMLAN_35."</option>");
-if(getperms("I")){
-	($admin_choice=="Custom" ? $text .= "<option value='Custom' selected='selected'>".FMLAN_36."</option>" : $text .= "<option value='Custom'>".FMLAN_36."</option>");
-	($admin_choice=="Custompages" ? $text .= "<option value='Custompages' selected='selected'>".FMLAN_37."</option>" : $text .= "<option value='Custompages'>".FMLAN_37."</option>");
-}
-$text .= "</select>\n
-</td>\n
-</tr>\n\n
-
-<tr style='vertical-align:top'>\n
-<td colspan='2'  style='text-align:center' class='forumheader'>\n
-<input class='button' type='submit' name='updateoptions' value='".FMLAN_33."' />\n
-</td>\n
-</tr>\n\n
-
-</table>\n
-</form>\n
-</div>";
-$ns -> tablerender(FMLAN_34, $text);
-
-
-$text = "<div class=\"border\">
-<div class=\"caption\">
-".FMLAN_29.": <b>root/".$pathd."</b>&nbsp;&nbsp;[ ".count($dirs)." ".$dstr.", ".count($files)." ".$cstr." ]
-</div>
-</div>
-<br />
-<div style=\"text-align:center\">
-<table style=\"width:95%\">
-
-<form ENCTYPE=\"multipart/form-data\" action=\"".e_SELF.(e_QUERY ? "?".e_QUERY : "")."\" method=\"post\">
-<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1000000\" />
-";
-
-if($path != e_FILE){
-	if(substr_count($path, "/") == 1){
-		$pathup = e_SELF;
-	}else{
-		$pathup = e_SELF."?".substr($path, 0, strrpos(substr($path, 0, -1), "/"))."/";
-	}
-	$text .= "<tr><td colspan=\"5\" class=\"forumheader3\"><a href=\"".$pathup."\"><img src=\"".$imagedir."updir.png\" alt=\"".FMLAN_30."\" style=\"border:0\" /> </a>
-	<a href=\"filemanager.php\"><img src=\"".$imagedir."home.png\" alt=\"".FMLAN_16."\" style=\"border:0\" /></a>
-	</td>
-	</tr>";
-}
-
-$text .= "<tr>
-<td style=\"width:5%\" class=\"forumheader3\">&nbsp;</td>
-<td style=\"width:30%\" class=\"forumheader3\"><b>".FMLAN_17."</b></td>
-<td class=\"forumheader3\"><b>".FMLAN_18."</b></td>
-<td style=\"width:30%\" class=\"forumheader3\"><b>".FMLAN_19."</b></td>
-<td class=\"forumheader3\"><b>".FMLAN_20."</b></td>
-</tr>";
-
-
-
-
-$c=0;
-while($dirs[$c]){
-	$dirsize = dirsize($path.$dirs[$c]);
-	$text .= "<tr>
-	<td style=\"width:5%\" class=\"forumheader3\" style=\"vertical-align:middle; text-align:center\">
-	<a href=\"".e_SELF."?".$path.$dirs[$c]."/\"><img src=\"".$imagedir."folder.png\" alt=\"".$dirs[$c]." ".FMLAN_31."\" style=\"border:0\" /></a>
-	<td style=\"width:30%\" class=\"forumheader3\">
-	<a href=\"".e_SELF."?".$path.$dirs[$c]."/\">".$dirs[$c]."</a>
-	</td>
-	<td class=\"forumheader3\">".$dirsize."
-	</td>
-	<td class=\"forumheader3\">&nbsp;</td>
-	<td class=\"forumheader3\">";
-	if(FILE_UPLOADS){
-		$text .= "<input class=\"button\" type=\"button\" name=\"erquest\" value=\"".FMLAN_21."\" onClick=\"expandit(this)\">
-		<div style=\"display:none; &{head}\">
-		<input class=\"tbox\" type=\"file\" name=\"file_userfile[]\" size=\"50\" /> 
-		<input class=\"button\" type=\"submit\" name=\"upload\" value=\"".FMLAN_22."\" />
-		<input type=\"hidden\" name=\"upload_dir[]\" value=\"".$path.$dirs[$c]."\" />
-		</div>";
-	}else{
-		$text .= "&nbsp;";
-	}
-	$text .= "</td>
-	</tr>
-	
-	
-	";
-	$c++;
-}
-
-$c=0;
-while($files[$c]){
-	$img = substr(strrchr($files[$c], "."), 1, 3);
-	if(!$img || !eregi("css|exe|gif|htm|jpg|js|php|png|txt|xml|zip", $img)){
-		$img = "def";
-	}
-	$size = parsesize(filesize(e_BASE.$path."/".$files[$c]));
-	$text .= "<tr>
-	<td style=\"width:5%\" class=\"forumheader3\" style=\"vertical-align:middle; text-align:center\">
-	<img src=\"".$imagedir.$img.".png\" alt=\"".$files[$c]."\" style=\"border:0\" /></a>
-	<td style=\"width:30%\" class=\"forumheader3\">
-	<a href=\"".e_SELF."?".$path.$files[$c]."\">".$files[$c]."</a>
-	</td>";
-	$text .= "<td style=\"width:10%\" class=\"forumheader3\">".$size."</td>
-	<td style=\"width:30%\" class=\"forumheader3\">".date("F j Y, g:i a", filemtime(e_BASE.$path."/".$files[$c]))."</td>
-	<td class=\"forumheader3\"><input class=\"button\" type=\"submit\" name=\"deletefile\" value=\"".FMLAN_23."\" />
-	<input type=\"checkbox\" name=\"deleteconfirm\" value=\"".$path.$files[$c]."\"><span class=\"smalltext\" /> ".FMLAN_24."</span></td>
-	</tr>";
-	$c++;
-}
-
-$text .= "
-<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
-</form>
-</table>
-</div>";
-
-$ns -> tablerender("<div style=\"text-align:center\">".FMLAN_25."</div>", $text);
-
-function dirsize($dir){
-	$_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir;
-	$dh = @opendir($_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir);
-	$size = 0;
-	while($file = @readdir($dh)){
-		if($file != "." and $file != "..") {
-			$path = $dir."/".$file;
-			if(is_file($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path)){
-				$size += filesize($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path);
-			}else{
-				$size += dirsize($path."/");
-			}
-		}
-	}
-	@closedir($dh);
-	return parsesize($size);
-}
-
-function parsesize($size){
-	$kb = 1024;
-	$mb = 1024 * $kb;
-	$gb = 1024 * $mb;
-	$tb = 1024 * $gb;
-	if($size < $kb) {
-		return $size." b";
-	}else if($size < $mb) {
-		return round($size/$kb,2)." kb";
-	}else if($size < $gb) {
-		return round($size/$mb,2)." mb";
-	}else if($size < $tb) {
-		return round($size/$gb,2)." gb";
-	}else {
-		return round($size/$tb,2)." tb";
-	}
-}
-
-require_once("footer.php");
-?>	
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/filemanager.php,v $
+|     $Revision: 1.19 $
+|     $Date: 2006/02/15 03:06:43 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("6")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'filemanage';
+require_once("auth.php");
+
+
+$pubfolder = (str_replace("../","",e_QUERY) == str_replace("../","",e_FILE."public/")) ? TRUE : FALSE;
+
+
+$imagedir = e_IMAGE."filemanager/";
+
+	$dir_options[0] = FMLAN_47;
+	$dir_options[1] = FMLAN_35;
+	$dir_options[2] = FMLAN_40;
+
+
+	$adchoice[0] = e_FILE."public/";
+	$adchoice[1] = e_FILE;
+	$adchoice[2] = e_IMAGE."newspost_images/";
+
+
+$path = str_replace("../", "", e_QUERY);
+if (!$path) {
+	$path = str_replace("../", "", $adchoice[0]);
+}
+
+if($path == "/")
+{
+	$path = $adchoice[0];
+	echo "<b>Debug</b> ".$path." <br />";
+}
+
+
+// ===============================================
+
+
+foreach($_POST['deleteconfirm'] as $key=>$delfile){
+	// check for delete.
+	if (isset($_POST['selectedfile'][$key]) && isset($_POST['deletefiles'])) {
+		if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
+			exit;
+		}
+		$destination_file = e_BASE.$delfile;
+		if (@unlink($destination_file)) {
+			$message .= FMLAN_26." '".$destination_file."' ".FMLAN_27.".<br />";
+		} else {
+			$message .= FMLAN_28." '".$destination_file."'.<br />";
+		}
+	}
+
+	// check for move to downloads or downloadimages.
+	if (isset($_POST['selectedfile'][$key]) && (isset($_POST['movetodls'])) ){
+	$newfile = str_replace($path,"",$delfile);
+
+	// Move file to whatever folder.
+		if (isset($_POST['movetodls'])){
+
+			$newpath = $_POST['movepath'];
+
+			if (rename(e_BASE.$delfile,$newpath.$newfile)){
+				$message .= FMLAN_38." ".$newpath.$newfile."<br />";
+			} else {
+				$message .= FMLAN_39." ".$newpath.$newfile."<br />";
+				$message .= (!is_writable($newpath)) ? $newpath.LAN_NOTWRITABLE : "";
+			}
+		}
+	}
+}
+
+
+
+if (isset($_POST['upload'])) {
+	if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
+		exit;
+	}
+	$pref['upload_storagetype'] = "1";
+	require_once(e_HANDLER."upload_handler.php");
+	$files = $_FILES['file_userfile'];
+	foreach($files['name'] as $key => $name) {
+		if ($files['size'][$key]) {
+			$uploaded = file_upload(e_BASE.$_POST['upload_dir'][$key]);
+		}
+	}
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style=\"text-align:center\"><b>".$message."</b></div>");
+}
+
+if (strpos(e_QUERY, ".")) {
+	echo "<iframe style=\"width:100%\" src=\"".e_BASE.e_QUERY."\" height=\"300\" scrolling=\"yes\"></iframe><br /><br />";
+	if (!strpos(e_QUERY, "/")) {
+		$path = "";
+	} else {
+		$path = substr($path, 0, strrpos(substr($path, 0, -1), "/"))."/";
+	}
+}
+
+$files = array();
+$dirs = array();
+$path = explode("?", $path);
+$path = $path[0];
+$path = explode(".. ", $path);
+$path = $path[0];
+
+if ($handle = opendir(e_BASE.$path)) {
+	while (false !== ($file = readdir($handle))) {
+		if ($file != "." && $file != "..") {
+
+			if (getenv('windir') && is_file(e_BASE.$path."\\".$file)) {
+				if (is_file(e_BASE.$path."\\".$file)) {
+					$files[] = $file;
+				} else {
+					$dirs[] = $file;
+				}
+			} else {
+				if (is_file(e_BASE.$path."/".$file)) {
+					$files[] = $file;
+				} else {
+					$dirs[] = $file;
+				}
+			}
+		}
+	}
+}
+closedir($handle);
+
+if (count($files) != 0) {
+	sort($files);
+}
+if (count($dirs) != 0) {
+	sort($dirs);
+}
+
+if (count($files) == 1) {
+	$cstr = FMLAN_12;
+} else {
+	$cstr = FMLAN_13;
+}
+
+if (count($dirs) == 1) {
+	$dstr = FMLAN_14;
+} else {
+	$dstr = FMLAN_15;
+}
+
+$pathd = $path;
+
+$text = "<div style='text-align:center'>\n
+	<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+	<table style='".ADMIN_WIDTH."' class='fborder'>\n
+	<tr>\n\n
+
+	<td style='width:70%' class='forumheader3'>\n
+	".FMLAN_32."
+	</td>\n
+	<td class='forumheader3' style='text-align:center; width:30%'>\n
+	<select name='admin_choice' class='tbox' onchange=\"location.href=this.options[selectedIndex].value\">\n";
+
+
+	foreach($dir_options as $key=>$opt){
+		$select = (str_replace("../","",$adchoice[$key]) == e_QUERY) ? "selected='selected'" : "";
+		$text .= "<option value='".e_SELF."?".str_replace("../","",$adchoice[$key])."' $select>".$opt."</option>\n";
+	}
+
+$text .= "</select>\n
+	</td>\n
+	</tr>\n\n
+
+	<tr style='vertical-align:top'>\n
+	<td colspan='2'  style='text-align:center' class='forumheader'>\n
+	<input class='button' type='submit' name='updateoptions' value='".FMLAN_33."' />\n
+	</td>\n
+	</tr>\n\n
+
+	</table>\n
+	</form>\n
+	</div>";
+$ns->tablerender(FMLAN_34, $text);
+
+
+$text = "<form enctype=\"multipart/form-data\" action=\"".e_SELF.(e_QUERY ? "?".e_QUERY : "")."\" method=\"post\">
+	<div style=\"text-align:center\">
+	<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1000000\" />
+	<table class='fborder' style=\"".ADMIN_WIDTH."\">";
+
+$text .= "<tr>
+	<td style=\"width:5%\" class=\"fcaption\">&nbsp;</td>
+	<td style=\"width:30%\" class=\"fcaption\"><b>".FMLAN_17."</b></td>
+	<td class=\"fcaption\"><b>".FMLAN_18."</b></td>
+	<td style=\"width:30%\" class=\"fcaption\"><b>".FMLAN_19."</b></td>
+	<td class=\"fcaption\"><b>".LAN_OPTIONS."</b></td>
+	</tr>";
+
+if ($path != e_FILE) {
+	if (substr_count($path, "/") == 1) {
+		$pathup = e_SELF;
+	} else {
+		$pathup = e_SELF."?".substr($path, 0, strrpos(substr($path, 0, -1), "/"))."/";
+	}
+	$text .= "<tr><td colspan=\"5\" class=\"forumheader3\"><a href=\"".$pathup."\"><img src=\"".$imagedir."updir.png\" alt=\"".FMLAN_30."\" style=\"border:0\" /> </a>
+		<a href=\"filemanager.php\"><img src=\"".$imagedir."home.png\" alt=\"".FMLAN_16."\" style=\"border:0\" /></a>
+		</td>
+		</tr>";
+}
+
+$c = 0;
+while ($dirs[$c]) {
+	$dirsize = dirsize($path.$dirs[$c]);
+	$text .= "<tr>
+		<td class=\"forumheader3\" style=\"vertical-align:middle; text-align:center; width:5%\">
+		<a href=\"".e_SELF."?".$path.$dirs[$c]."/\"><img src=\"".$imagedir."folder.png\" alt=\"".$dirs[$c]." ".FMLAN_31."\" style=\"border:0\" /></a>
+		</td>
+		<td style=\"width:30%\" class=\"forumheader3\">
+		<a href=\"".e_SELF."?".$path.$dirs[$c]."/\">".$dirs[$c]."</a>
+		</td>
+		<td class=\"forumheader3\">".$dirsize."
+		</td>
+		<td class=\"forumheader3\">&nbsp;</td>
+		<td class=\"forumheader3\">";
+	if (FILE_UPLOADS && is_writable(e_BASE.$path.$dirs[$c])) {
+		$text .= "<input class=\"button\" type=\"button\" name=\"erquest\" value=\"".FMLAN_21."\" onclick=\"expandit(this)\" />
+			<div style=\"display:none;\">
+			<input class=\"tbox\" type=\"file\" name=\"file_userfile[]\" size=\"50\" />
+			<input class=\"button\" type=\"submit\" name=\"upload\" value=\"".FMLAN_22."\" />
+			<input type=\"hidden\" name=\"upload_dir[]\" value=\"".$path.$dirs[$c]."\" />
+			</div>";
+	} else {
+		$text .= "&nbsp;";
+	}
+	$text .= "</td>
+		</tr>
+
+
+		";
+	$c++;
+}
+
+$c = 0;
+while ($files[$c]) {
+	$img = substr(strrchr($files[$c], "."), 1, 3);
+	if (!$img || !preg_match("/css|exe|gif|htm|jpg|js|php|png|txt|xml|zip/i", $img)) {
+		$img = "def";
+	}
+	$size = parsesize(filesize(e_BASE.$path."/".$files[$c]));
+	$text .= "<tr>
+		<td class=\"forumheader3\" style=\"vertical-align:middle; text-align:center; width:5%\">
+		<img src=\"".$imagedir.$img.".png\" alt=\"".$files[$c]."\" style=\"border:0\" />
+		</td>
+		<td style=\"width:30%\" class=\"forumheader3\">
+		<a href=\"".e_SELF."?".$path.$files[$c]."\">".$files[$c]."</a>
+		</td>";
+	$gen = new convert;
+	$filedate = $gen -> convert_date(filemtime(e_BASE.$path."/".$files[$c]), "forum");
+	$text .= "<td style=\"width:10%\" class=\"forumheader3\">".$size."</td>
+		<td style=\"width:30%\" class=\"forumheader3\">".$filedate."</td>
+		<td class=\"forumheader3\">";
+
+	$text .= "<input  type=\"checkbox\" name=\"selectedfile[$c]\" value=\"1\" />";
+	$text .="<input type=\"hidden\" name=\"deleteconfirm[$c]\" value=\"".$path.$files[$c]."\" />";
+
+	$text .="</td>
+		</tr>";
+	$c++;
+}
+
+	$text .= "<tr><td colspan='5' class='forumheader' style='text-align:right'>";
+
+	if ($pubfolder || e_QUERY == ""){
+        require_once(e_HANDLER."file_class.php");
+		$fl = new e_file;
+		$dl_dirlist = $fl->get_dirs(e_DOWNLOAD);
+		$movechoice = array();
+        $movechoice[] = e_DOWNLOAD;
+		foreach($dl_dirlist as $dirs){
+        	$movechoice[] = e_DOWNLOAD.$dirs."/";
+		}
+		sort($movechoice);
+		$movechoice[] = e_FILE."downloadimages/";
+		if(e_QUERY != str_replace("../","",e_FILE."public/")){
+        	$movechoice[] = e_FILE."public/";
+		}
+		if(e_QUERY != str_replace("../","",e_FILE."downloadthumbs/")){
+        	$movechoice[] = e_FILE."downloadthumbs/";
+		}
+		if(e_QUERY != str_replace("../","",e_FILE."misc/")){
+        	$movechoice[] = e_FILE."misc/";
+		}
+		if(e_QUERY != str_replace("../","",e_IMAGE)){
+        	$movechoice[] = e_IMAGE;
+		}
+		if(e_QUERY != str_replace("../","",e_IMAGE."newspost_images/")){
+        	$movechoice[] = e_IMAGE."newspost_images/";
+		}
+
+
+
+
+        $text .= FMLAN_48."&nbsp;<select class='tbox' name='movepath'>\n";
+        foreach($movechoice as $paths){
+        	$text .= "<option value='$paths'>".str_replace("../","",$paths)."</option>\n";
+		}
+		$text .= "</select>&nbsp;";
+		$text .="<input class=\"button\" type=\"submit\" name=\"movetodls\" value=\"".FMLAN_50."\" onclick=\"return jsconfirm('".$tp->toJS(FMLAN_49)."') \" />
+		";
+	}
+
+	$text .= "<input class=\"button\" type=\"submit\" name=\"deletefiles\" value=\"".FMLAN_43."\" onclick=\"return jsconfirm('".$tp->toJS(FMLAN_46)."') \" />
+		</td></tr></table>
+		<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
+		</div>
+		</form>";
+
+$ns->tablerender(FMLAN_29.": <b>root/".$pathd."</b>&nbsp;&nbsp;[ ".count($dirs)." ".$dstr.", ".count($files)." ".$cstr." ]", $text);
+
+function dirsize($dir) {
+	$_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir;
+	$dh = @opendir($_SERVER["DOCUMENT_ROOT"].e_HTTP.$dir);
+	$size = 0;
+	while ($file = @readdir($dh)) {
+		if ($file != "." and $file != "..") {
+			$path = $dir."/".$file;
+			if (is_file($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path)) {
+				$size += filesize($_SERVER["DOCUMENT_ROOT"].e_HTTP.$path);
+			} else {
+				$size += dirsize($path."/");
+			}
+		}
+	}
+	@closedir($dh);
+	return parsesize($size);
+}
+
+function parsesize($size) {
+	$kb = 1024;
+	$mb = 1024 * $kb;
+	$gb = 1024 * $mb;
+	$tb = 1024 * $gb;
+	if ($size < $kb) {
+		return $size." b";
+	}
+	else if($size < $mb) {
+		return round($size/$kb, 2)." kb";
+	}
+	else if($size < $gb) {
+		return round($size/$mb, 2)." mb";
+	}
+	else if($size < $tb) {
+		return round($size/$gb, 2)." gb";
+	} else {
+		return round($size/$tb, 2)." tb";
+	}
+}
+
+require_once("footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/filetypes_.php 75/e107_admin/filetypes_.php
--- 6171/e107_admin/filetypes_.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/filetypes_.php	2006-01-18 10:15:18.000000000 -0600
@@ -0,0 +1 @@
+zip, gz, jpg, png, gif
\ No newline at end of file
diff -ruN 6171/e107_admin/fla.php 75/e107_admin/fla.php
--- 6171/e107_admin/fla.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/fla.php	2006-03-03 17:36:47.000000000 -0600
@@ -0,0 +1,157 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/fla.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2006/03/03 23:36:47 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("4")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+
+$e_sub_cat = 'failed_login';
+require_once("auth.php");
+
+$tmp = (e_QUERY) ? explode(".", e_QUERY) : "";
+$from = (!$tmp[0]) ? 0 : intval($tmp[0]);
+$amount = (!$tmp[1]) ? 50 : intval($tmp[1]);
+
+
+if(isset($_POST['delbanSubmit']))
+{
+
+	$delcount = 0;
+	foreach($_POST['fladelete'] as $delete)
+	{
+		$delcount ++;
+		$sql -> db_Delete("generic", "gen_id='$delete' ");
+	}
+	$message = FLALAN_3.": ".$delcount;
+
+	$bancount = 0;
+	foreach($_POST['flaban'] as $ban)
+	{
+		if($sql -> db_Select("generic", "*", "gen_id=$ban"))
+		{
+			$at = $sql -> db_Fetch();
+			$banlist_ip = $at['gen_ip'];
+			$sql->db_Insert("banlist", "'$banlist_ip', '".ADMINID."', '".FLALAN_4."' ");
+			$sql -> db_Delete("generic", "gen_id='$ban' ");
+			$bancount ++;
+		}
+	}
+	$message .= ", ".FLALAN_5.": ".$bancount;
+}
+
+
+if(e_QUERY == "dabl")
+{
+	$sql -> db_Delete("generic", "gen_type='auto_banned' ");
+	$message = FLALAN_17;
+}
+
+
+if($sql -> db_Select("generic", "*", "gen_type='auto_banned' ORDER BY gen_datestamp DESC "))
+{
+	$abArray = $sql -> db_getList();
+	$message = FLALAN_15;
+	foreach($abArray as $ab)
+	{
+		$message .= " - ".$ab['gen_ip'];
+	}
+
+	$message .= "<div style='text-align: right;'>( <a href='".e_SELF."?dabl'>".FLALAN_16."</a> )</div>";
+
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+$gen = new convert;
+$fla_total = $sql->db_Count("generic", "(*)", "WHERE gen_type='failed_login'");
+if(!$sql -> db_Select("generic", "*", "gen_type='failed_login' ORDER BY gen_datestamp DESC LIMIT $from,$amount"))
+{
+	$text = "<div style='text-align: center;'>".FLALAN_2."</div>";
+}
+else
+{
+
+	$faArray = $sql -> db_getList('ALL', FALSE, FALSE);
+
+	$text = "
+	<form method='post' action='".e_SELF."' id='flaform' >
+	<table class='fborder' style='width:99%;'>
+	<tr>
+	<td style='width: 20%;' class='forumheader'>".FLALAN_6."</td>
+	<td style='width: 50%;' class='forumheader'>".FLALAN_7."</td>
+	<td style='width: 20%;' class='forumheader'>".FLALAN_8."</td>
+	<td style='width: 10%; text-align: center;' class='forumheader'>".FLALAN_9."</td>
+	</tr>
+	";
+
+	foreach($faArray as $fa)
+	{
+		extract($fa);
+
+		$host = $e107->get_host_name(getenv($gen_ip));
+		$text .= "<tr>
+		<td style='width: 20%;' class='forumheader3'>".$gen->convert_date($gen_datestamp, "forum")."</td>
+		<td style='width: 50%;' class='forumheader3'>".str_replace(":::", "<br />", htmlentities($gen_chardata))."</td>
+		<td style='width: 20%;' class='forumheader'>".$fa['gen_ip']."<br />{$host}</td>
+		<td style='width: 10%; text-align: left;' class='forumheader3'>
+		<input type='checkbox' name='fladelete[]' value='$gen_id' /> ".LAN_DELETE."<br />
+		<input type='checkbox' name='flaban[]' value='$gen_id' /> ".LAN_BAN."
+		</td>
+		</tr>
+		";
+	}
+
+	$text .= "
+	<tr>
+	<td colspan='4' class='forumheader' style='text-align: right;'>
+
+	<a href='".e_SELF."?checkall=1' onclick=\"setCheckboxes('flaform', true, 'fladelete[]'); return false;\">".FLALAN_11."</a> -
+	<a href='".e_SELF."' onclick=\"setCheckboxes('flaform', false, 'fladelete[]'); return false;\">".FLALAN_12."</a>
+	<br />
+	<a href='".e_SELF."?checkall=1' onclick=\"setCheckboxes('flaform', true, 'flaban[]'); return false;\">".FLALAN_13."</a> -
+	<a href='".e_SELF."' onclick=\"setCheckboxes('flaform', false, 'flaban[]'); return false;\">".FLALAN_14."</a>
+
+	</td>
+	</tr>
+
+	<tr>
+	<td colspan='4' class='forumheader' style='text-align: center;'><input class='button' type='submit' name='delbanSubmit' value='".FLALAN_10."' /></td>
+	</tr>
+	</table>
+	</form>
+    <div style='text-align:center'><br />
+	";
+
+	$parms = $fla_total.",".$amount.",".$from.",".e_SELF.'?'."[FROM].".$amount;
+	$text .= $tp->parseTemplate("{NEXTPREV={$parms}}");
+
+    $text .= "</div>";
+
+
+
+}
+
+$ns->tablerender(FLALAN_1, $text);
+
+require_once("footer.php");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/footer.php 75/e107_admin/footer.php
--- 6171/e107_admin/footer.php	2004-09-06 19:51:46.000000000 -0500
+++ 75/e107_admin/footer.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,130 +1,73 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/footer.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-@include(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_footer.php");
-@include(e_LANGUAGEDIR."English/admin/lan_footer.php");
-echo "\n</td>
-<td style='width:20%; vertical-align:top'>";
-
-if(ADMIN){
-
-$sql -> db_Select("core", "*", "e107_name='e107' ");
-$row = $sql -> db_Fetch();
-$e107info = unserialize($row['e107_value']);
-
-if(file_exists(e_ADMIN."ver.php")){ @require_once(e_ADMIN."ver.php"); }
-
-$obj = new convert;
-$install_date = $obj->convert_date($e107info['e107_datestamp'], "long");
-
-//Show upper_right menu if the function exists
-$tmp = explode(".",e_PAGE);
-$adminmenu_func = $tmp[0]."_adminmenu";
-if(function_exists($adminmenu_func)){
-        call_user_func($adminmenu_func,$adminmenu_parms);
-}
-
-$plugindir = (str_replace("/","",str_replace("..","",e_PLUGIN))."/");
-$plugpath = e_PLUGIN.str_replace(basename(e_SELF),"",str_replace($plugindir,"",strstr(e_SELF,$plugindir)))."admin_menu.php";
-if(file_exists($plugpath)){
-        @require_once($plugpath);
-}
-
-$text = "<b>".FOOTLAN_1."</b>
-<br />".
-SITENAME."
-<br /><br />
-<b>".FOOTLAN_2."</b>
-<br />
-<a href=\"mailto:".SITEADMINEMAIL."\">".SITEADMIN."</a>
-<br />
-<br />
-<b>e107</b>
-<br />
-".FOOTLAN_3." ".$e107info['e107_version']. ($e107info['e107_build'] ? " ".FOOTLAN_4." ".$e107info['e107_build'] : "")."
-<br /><br />
-<b>".FOOTLAN_5."</b>
-<br />
-".$themename." v".$themeversion." ".FOOTLAN_6." ".$themeauthor." (".$themedate.")
-<br />
-".FOOTLAN_7.": ".$themeinfo."
-<br /><br />
-<b>".FOOTLAN_8."</b>
-<br />
-".$install_date."
-<br /><br />
-<b>".FOOTLAN_9."</b>
-<br />".
- eregi_replace("PHP.*", "", $_SERVER['SERVER_SOFTWARE'])."<br />(".FOOTLAN_10.": ".$_SERVER['SERVER_NAME'].")
-<br /><br />
-<b>".FOOTLAN_11."</b>
-<br />
-".phpversion()."
-<br /><br />
-<b>".FOOTLAN_12."</b>
-<br />
-".mysql_get_server_info().
-"<br />
-".FOOTLAN_16.": ".$mySQLdefaultdb;
-$ns -> tablerender(FOOTLAN_13, $text);
-
-$c=1;
-if (!$handle=opendir(e_DOCS.e_LANGUAGE."/")) {
- $handle=opendir(e_DOCS."English/");
-}
-while ($file = readdir($handle)){
-        if($file != "." && $file != ".."){
-                $helplist[$c] = $file;
-                $c++;
-        }
-}
-closedir($handle);
-
-if($pref['cachestatus']){
-        if(!$sql -> db_Select("tmp", "*", " tmp_ip='var_store' && tmp_time='1' ")){                // var_store 1 == cache empty time
-                $sql -> db_Insert("tmp", "'var_store', 1, '".$e107info['e107_datestamp']."' ");
-        }else{
-                $row = $sql -> db_Fetch(); extract($row);
-                if(($tmp_info+604800) < time()){
-                        $sql -> db_Delete("cache");
-                        $sql -> db_Update("tmp", "tmp_info='".time()."' WHERE tmp_ip='var_store' AND tmp_time=1 ");
-                }
-        }
-}
-
-
-// Docs menu
-unset($e107_var);
-while(list($key, $value) = each($helplist)){
-        $e107_var['x'.$key]['text'] = $value;
-        $e107_var['x'.$key]['link'] = e_ADMIN."docs.php?".$key;
-}
-
-$text = get_admin_treemenu(FOOTLAN_14,$act,$e107_var);
-$ns -> tablerender(FOOTLAN_14,$text);
-}
-?>
-</td>
-</tr>
-</table>
-</div>
-</div>
-<div><br /><br /></div>
-</body>
-</html>
-
-<?php
-$sql -> db_Close();
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/footer.php,v $
+|     $Revision: 1.19 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $ADMIN_FOOTER;
+
+if (ADMIN == TRUE) {
+	if ($pref['cachestatus']) {
+		if (!$sql->db_Select('generic', '*', "gen_type='empty_cache'"))
+		{
+			$sql->db_Insert('generic', "0,'empty_cache','".time()."','0','','0',''");
+		} else {
+			$row = $sql->db_Fetch();
+			if (($row['gen_datestamp']+604800) < time()) // If cache not cleared in last 7 days, clear it.
+			{
+				require_once(e_HANDLER."cache_handler.php");
+				$ec = new ecache;
+				$ec->clear();
+				$sql->db_Update('generic', "gen_datestamp='".time()."' WHERE gen_type='empty_cache'");
+			}
+		}
+	}
+}
+if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) {
+	parse_admin($ADMIN_FOOTER);
+}
+$eTimingStop = microtime();
+global $eTimingStart, $eTraffic;
+$rendertime = number_format($eTraffic->TimeDelta( $eTimingStart, $eTimingStop ), 4);
+$db_time    = number_format($db_time,4);
+$rinfo = '';
+
+if($pref['displayrendertime']){ $rinfo .= "Render time: {$rendertime} second(s); {$db_time} of that for queries. "; }
+if($pref['displaysql']){ $rinfo .= "DB queries: ".$sql -> db_QueryCount().". "; }
+if(isset($pref['displaycacheinfo']) && $pref['displaycacheinfo']){ $rinfo .= $cachestring."."; }
+echo ($rinfo ? "\n<div style='text-align:center' class='smalltext'>{$rinfo}</div>\n" : "");
+
+if($error_handler->debug == true) {
+	echo "
+	<br /><br />
+	<div>
+		<h3>PHP Errors:</h3><br />
+		".$error_handler->return_errors()."
+	</div>
+	";
+}
+
+if (function_exists('theme_foot')) {
+	echo theme_foot();
+}
+
+echo "</body></html>";
+
+$sql->db_Close();
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/forum_conf.php 75/e107_admin/forum_conf.php
--- 6171/e107_admin/forum_conf.php	2004-08-14 21:16:18.000000000 -0500
+++ 75/e107_admin/forum_conf.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,232 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/forum_conf.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the	
-|	GNU General Public License (http://gnu.org).
-|
-| $Source: /cvsroot/e107/e107/e107_admin/forum_conf.php,v $
-| $Revision: 1.5 $
-| $Date: 2004/08/15 02:16:18 $
-| $Author: mcfly_e107 $ 
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-
-if(!getperms("A")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-
-$qs = explode(".", e_QUERY);
-$action = $qs[0];
-$forum_id = $qs[1];
-$thread_id = $qs[2];
-$thread_parent = $qs[3];
-
-if($action == "close"){
-	$sql -> db_Update("forum_t", "thread_active='0' WHERE thread_id='$thread_id' ");
-	$message = FORLAN_1;
-	$url = e_BASE."forum_viewforum.php?".$forum_id;
-}
-
-if($action == "open"){
-	$sql -> db_Update("forum_t", "thread_active='1' WHERE thread_id='$thread_id' ");
-	$message = FORLAN_2;
-	$url = e_BASE."forum_viewforum.php?".$forum_id;
-}
-
-if($action == "stick"){
-	$sql -> db_Update("forum_t", "thread_s='1' WHERE thread_id='$thread_id' ");
-	$message = FORLAN_3;
-	$url = e_BASE."forum_viewforum.php?".$forum_id;
-}
-
-if($action == "unstick"){
-	$sql -> db_Update("forum_t", "thread_s='0' WHERE thread_id='$thread_id' ");
-	$message = FORLAN_4;
-	$url = e_BASE."forum_viewforum.php?".$forum_id;
-}
-
-if(IsSet($_POST['deletepollconfirm'])){
-	$sql -> db_Delete("poll", "poll_id='$thread_parent' ");
-	$sql -> db_Select("forum_t", "*", "thread_id='".$thread_id."' ");
-	$row = $sql -> db_Fetch(); extract($row);
-	$thread_name = str_replace("[poll] ", "", $thread_name);
-	$sql -> db_Update("forum_t", "thread_name='$thread_name' WHERE thread_id='$thread_id' ");
-	$message = FORLAN_5;
-	$url = e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_id;
-}
-
-
-// delete thread/replies ------------------------------------------------------------------------------------------------------------------------------------
-if($action == "confirm"){
-	$sql -> db_Select("forum_t", "*", "thread_id='".$thread_id."' ");
-	$row = $sql -> db_Fetch(); extract($row);
-	if($thread_parent){ // is post a reply?
-		$sql -> db_Delete("forum_t", "thread_id='$thread_id' ");	// delete reply only
-		$sql -> db_Update("forum", "forum_replies=forum_replies-1 WHERE forum_id='$thread_forum_id' ");	// dec reply count by 1
-		
-		$sql -> db_Select("forum_t", "*", "thread_id=$thread_id");
-		$row = $sql -> db_Fetch(); extract($row);
-		$replies = $sql -> db_Count("forum_t", "(*)", "WHERE thread_parent='".$thread_parent."'");
-		$pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
-		
-		$pages= 0;
-		if($replies){
-			$pages = ((ceil($replies/$pref['forum_postspage']) -1) * $pref['forum_postspage']);
-		}
-		$url = e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_parent.($pages ? ".$pages" : "");	// set return url
-		$message = FORLAN_26;
-	}else{	// post is thread
-		$sql -> db_Delete("poll", "poll_datestamp='$thread_id' ");	 // delete poll if there is one
-		$count = $sql -> db_Delete("forum_t", "thread_parent='$thread_id' ");	// delete replies and grab how many there were
-		$sql -> db_Delete("forum_t", "thread_id='$thread_id' ");	// delete the post itself
-		$sql -> db_Update("forum", "forum_threads=forum_threads-1, forum_replies=forum_replies-$count WHERE forum_id='$thread_forum_id' ");	// update thread/reply counts
-		$url = e_BASE."forum_viewforum.php?".$forum_id;	// set return url
-		$message = FORLAN_6.($count ? ", ".$count." ".FORLAN_7."." : ".");
-	}
-
-	if($sql -> db_Select("forum_t", "*", "thread_forum_id='$forum_id' ORDER BY thread_datestamp DESC LIMIT 0,1")){
-		$row = $sql -> db_Fetch(); extract($row);
-		$new_forum_lastpost = $thread_user.".".$thread_datestamp;
-	}
-	else
-	{
-		$new_forum_lastpost = "";
-	}
-	$sql -> db_Update("forum", "forum_lastpost='{$new_forum_lastpost}' WHERE forum_id='$new_forum' ");
-}
-// end delete ----------------------------------------------------------------------------------------------------------------------------------------------
-
-if(IsSet($_POST['move'])){
-
-	$new_forum = $_POST['forum_move'];
-		
-	$replies = $sql -> db_Select("forum_t", "*", "thread_parent='$thread_id' ");
-	
-	$sql -> db_Select("forum_t", "thread_name", "thread_id ='".$thread_id."' ");
-	$row = $sql -> db_Fetch(); extract($row);
-	$sql -> db_Update("forum_t", "thread_forum_id='$new_forum', thread_name='[".FORLAN_27."] ".$thread_name."' WHERE thread_id='$thread_id' ");
-	$sql -> db_Update("forum_t", "thread_forum_id='$new_forum' WHERE thread_parent='$thread_id' ");
-	$sql -> db_Update("forum", "forum_threads=forum_threads-1, forum_replies=forum_replies-$replies WHERE forum_id='$forum_id' ");
-	$sql -> db_Update("forum", "forum_threads=forum_threads+1, forum_replies=forum_replies+$replies WHERE forum_id='$new_forum' ");
-
-	// update lastposts
-
-	if($sql -> db_Select("forum_t", "*", "thread_forum_id='$new_forum' ORDER BY thread_datestamp DESC LIMIT 0,1")){
-		$row = $sql -> db_Fetch(); extract($row);
-		$new_forum_lastpost = $thread_user.".".$thread_datestamp;
-	}else{
-		$new_forum_lastpost = "";
-	}
-	$sql -> db_Update("forum", "forum_lastpost='{$new_forum_lastpost}' WHERE forum_id='$new_forum' ");
-
-	if($sql -> db_Select("forum_t", "*", "thread_forum_id='$forum_id' ORDER BY thread_datestamp DESC LIMIT 0,1")){
-		$row = $sql -> db_Fetch(); extract($row);
-		$new_forum_lastpost = $thread_user.".".$thread_datestamp;
-	}else{
-		$new_forum_lastpost = "";
-	}
-	$sql -> db_Update("forum", "forum_lastpost='{$new_forum_lastpost}' WHERE forum_id='$forum_id' ");
-
-	$message = FORLAN_9;
-	$url = e_BASE."forum_viewforum.php?".$new_forum;
-}
-
-if(IsSet($_POST['movecancel'])){
-	$message = FORLAN_10;
-	$url = e_BASE."forum_viewforum.php?".$forum_id.".".$thread_id;
-}
-
-if($message){
-	$text = "<div style='text-align:center'>".$message."
-	<br />
-	<a href='$url'>".FORLAN_11."</a>
-	</div>";
-	$ns -> tablerender(FORLAN_12, $text);
-	require_once("footer.php");
-	exit;
-}
-
-if($action == "delete_poll"){
-	$text = "<div style='text-align:center'>
-	".FORLAN_13."
-	<br /><br />
-	<form method='post' action='".e_SELF."?".e_QUERY."'>
-	<input class='button' type='submit' name='deletecancel' value='".FORLAN_14."' /> 
-	<input class='button' type='submit' name='deletepollconfirm' value='".FORLAN_15."' /> 
-	</form>
-	</div>";
-	$ns -> tablerender(FORLAN_16, $text);
-	require_once("footer.php");
-	exit;
-}
-
-if($action == "delete"){
-	$sql -> db_Select("forum_t", "*", "thread_id='".$thread_id."' ");
-	$row = $sql -> db_Fetch(); extract($row);
-	if(!$thread_parent){
-		$sql -> db_Select("forum_t", "*", "thread_parent='".$thread_id."' ");
-	}
-	$post_author_name = substr($thread_user, (strpos($thread_user, ".")+1));
-	$text = "<div style='text-align:center'>\n<b>'".$thread_thread."' <br />".FORLAN_17." ".$post_author_name."</b><br /><br />\n".FORLAN_18." ";
-	if(!$thread_parent){
-		$text .= FORLAN_19;
-		if(eregi("\[poll\]", $thread_name)){
-			$text .= " (".FORLAN_20.").";
-		}
-		$text .= "<br />".FORLAN_21;
-	}else{
-		$text .= FORLAN_22;
-	}
-	$text .= " <b><u>".FORLAN_23."
-	<br /><br />
-	<form method='post' action='".e_SELF."?".e_QUERY.".".$thread_parent."'>
-	<input class='button' type='submit' name='deletecancel' value='".FORLAN_14."' /> 
-	<input class='button' type='submit' name='deleteconfirm' value='".FORLAN_15."' /> 
-	</form>
-	</div>";
-	$ns -> tablerender(FORLAN_15, $text);
-	require_once("footer.php");
-	exit;
-}
-
-if($action == "move"){
-$forum_total = $sql -> db_Select("forum", "forum_id,forum_name", "forum_parent!='0' ");
-$text = "
-<form method='post' action='".e_SELF."?".e_QUERY.".".$thread_parent."'>
-<div style='text-align:center'>
-<table style='width:90%'>
-<tr> 
-<td style='text-align:right'>".FORLAN_24.": </td>
-<td style='text-align:left'>
-<select name='forum_move' class='tbox'>";
-while(list($forum_id_, $forum_name_) = $sql-> db_Fetch())
-{
-	if($forum_id_ != $forum_id)
-	{
-		$text .= "<option value='$forum_id_'>".$forum_name_."</option>";
-	}
-}
-$text .= "</select>
-</td>
-</tr>
-<tr style='vertical-align: top;'>
-<td colspan='2'  style='text-align:center'><br />
-<input class='button' type='submit' name='move' value='".FORLAN_25."' /> 
-<input class='button' type='submit' name='movecancel' value='".FORLAN_14."' />
-</td>
-</tr>
-</table>
-</div>
-</form>";
-$ns -> tablerender(FORLAN_25, $text);
-}
-
-require_once("footer.php");
-?>	
\ No newline at end of file
diff -ruN 6171/e107_admin/forum.php 75/e107_admin/forum.php
--- 6171/e107_admin/forum.php	2004-09-06 04:54:56.000000000 -0500
+++ 75/e107_admin/forum.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,862 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/forum.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("5")){ header("location:".e_BASE."index.php"); exit; }
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-require_once(e_HANDLER."userclass_class.php");
-require_once(e_HANDLER."form_handler.php");
-require_once(e_HANDLER."ren_help.php");
-$rs = new form;
-$forum = new forum;
-$aj = new textparse;
-
-
-$deltest = array_flip($_POST);
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
-        unset($tmp);
-}
-if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$etp->unentity(FORLAN_20)],$matches))
-{
-        $delete = $matches[1];
-        $del_id = $matches[2];
-}
-
-If(IsSet($_POST['submit_parent'])){
-        $_POST['forum_name'] = $aj -> formtpa($_POST['forum_name'], "admin");
-        $sql -> db_Insert("forum", "0, '".$_POST['forum_name']."', '', '', '".time()."', '0', '0', '0', '', '".$_POST['forum_class']."', 0");
-        $forum -> show_message(FORLAN_13);
-}
-
-If(IsSet($_POST['update_parent'])){
-        $_POST['forum_name'] = $aj -> formtpa($_POST['forum_name'], "admin");
-        $sql -> db_Update("forum", "forum_name='".$_POST['forum_name']."', forum_class='".$_POST['forum_class']."' WHERE forum_id=$id");
-        $forum -> show_message(FORLAN_14);
-        $action = "main";
-}
-
-If(IsSet($_POST['submit_forum'])){
-        $mods=implode(", ",$_POST['mod']);
-        $_POST['forum_name'] = $aj -> formtpa($_POST['forum_name'], "admin");
-        $_POST['forum_description'] = $aj -> formtpa($_POST['forum_description'], "admin");
-        $sql -> db_Insert("forum", "0, '".$_POST['forum_name']."', '".$_POST['forum_description']."', '".$_POST['forum_parent']."', '".time()."', '".$mods."', 0, 0, 0, '".$_POST['forum_class']."', 0");
-        $forum -> show_message(FORLAN_11);
-}
-
-If(IsSet($_POST['update_forum'])){
-        $mods=implode(", ",$_POST['mod']);
-        $_POST['forum_name'] = $aj -> formtpa($_POST['forum_name'], "admin");
-        $_POST['forum_description'] = $aj -> formtpa($_POST['forum_description'], "admin");
-        $forum_parent = $row['forum_id'];
-        $sql -> db_Update("forum", "forum_name='".$_POST['forum_name']."', forum_description='".$_POST['forum_description']."', forum_parent='".$_POST['forum_parent']."', forum_moderators='".$mods."', forum_class='".$_POST['forum_class']."' WHERE forum_id=$id");
-        $forum -> show_message(FORLAN_12);
-        $action = "main";
-}
-
-if(IsSet($_POST['update_order'])){
-        extract($_POST);
-        while(list($key, $id) = each($forum_order)){
-                $tmp = explode(".", $id);
-                $sql -> db_Update("forum", "forum_order=".$tmp[1]." WHERE forum_id=".$tmp[0]);
-        }
-        $forum -> show_message(FORLAN_73);
-}
-
-if(IsSet($_POST['updateoptions'])){
-        $pref['email_notify'] = $_POST['email_notify'];
-        $pref['forum_poll'] = $_POST['forum_poll'];
-        $pref['forum_popular'] = $_POST['forum_popular'];
-        $pref['forum_track'] = $_POST['forum_track'];
-        $pref['forum_eprefix'] = $_POST['forum_eprefix'];
-        $pref['forum_enclose'] = $_POST['forum_enclose'];
-        $pref['forum_title'] = $_POST['forum_title'];
-        $pref['forum_postspage'] = $_POST['forum_postspage'];
-        $pref['html_post'] = $_POST['html_post'];
-        $pref['forum_attach'] = $_POST['forum_attach'];
-        $pref['forum_redirect'] = $_POST['forum_redirect'];
-        $pref['forum_user_customtitle'] = $_POST['forum_user_customtitle'];
-        $pref['reported_post_email'] = $_POST['reported_post_email'];
-        $pref['links_new_window'] = $_POST['links_new_window'];
-        $pref['forum_tooltip'] = $_POST['forum_tooltip'];
-        $pref['forum_tiplength'] = $_POST['forum_tiplength'];
-        save_prefs();
-        $forum -> show_message(FORLAN_10);
-}
-
-if(IsSet($_POST['do_prune'])){
-        $sql2 = new db;
-        if($_POST['prune_type'] == "delete"){
-                $prunedate = time() - ($_POST['prune_days']*86400);
-                if($sql -> db_Select("forum_t", "*", "thread_lastpost<$prunedate AND thread_parent=0 AND thread_s!=1")){
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $sql2 -> db_Delete("forum_t", "thread_parent='$thread_id' ");        // delete replies
-                                $sql2 -> db_Delete("forum_t", "thread_id='$thread_id' ");                // delete thread
-                        }
-
-                        $sql -> db_Select("forum", "*", "forum_parent!=0");
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $threads += $sql2 -> db_Count("forum_t", "(*)", "WHERE thread_forum_id=$forum_id AND thread_parent=0");
-                                $replies += $sql2 -> db_Count("forum_t", "(*)", "WHERE thread_forum_id=$forum_id AND thread_parent!=0");
-                                $sql2 -> db_Update("forum", "forum_threads='$threads', forum_replies='$replies' WHERE forum_id='$forum_id' ");
-                        }
-                        $forum -> show_message(FORLAN_8." ( ".$threads." ".FORLAN_92.", ".$replies." ".FORLAN_93." )");
-                }else{
-                        $forum -> show_message(FORLAN_9);
-                }
-        }else{
-                $prunedate = time() - ($_POST['prune_days']*86400);
-                $pruned = $sql -> db_Update("forum_t", "thread_active=0 WHERE thread_lastpost<$prunedate AND thread_parent=0 ");
-                $forum -> show_message(FORLAN_8." ".$pruned." ".FORLAN_91);
-        }
-        $action = "main";
-}
-
-if(IsSet($_POST['set_ranks'])){
-        extract($_POST);
-        for($a=0; $a<=9; $a++){
-                $r_names .= $aj -> formtpa($rank_names[$a], "admin").",";
-                $r_thresholds .= $aj -> formtpa($rank_thresholds[$a], "admin").",";
-                $r_images .= $aj -> formtpa($rank_images[$a], "admin").",";
-        }
-        $pref['rank_main_admin'] = $_POST['rank_main_admin'];
-        $pref['rank_main_admin_image'] = $_POST['rank_main_admin_image'];
-        $pref['rank_admin'] = $_POST['rank_admin'];
-        $pref['rank_admin_image'] = $_POST['rank_admin_image'];
-        $pref['rank_moderator'] = $_POST['rank_moderator'];
-        $pref['rank_moderator_image'] = $_POST['rank_moderator_image'];
-        $pref['forum_levels'] = $r_names;
-        $pref['forum_thresholds'] = $r_thresholds;
-        $pref['forum_images'] = $r_images;
-        save_prefs();
-        $forum -> show_message(FORLAN_95);
-}
-
-if(IsSet($_POST['frsubmit'])){
-
-        $guestrules = $aj -> formtpa($_POST['guestrules'], "admin");
-        $memberrules = $aj -> formtpa($_POST['memberrules'], "admin");
-        $adminrules = $aj -> formtpa($_POST['adminrules'], "admin");
-        $sql -> db_Update("wmessage", "wm_text ='$guestrules', wm_active='".$_POST['wm_active4']."' WHERE wm_id='4' ");
-        $sql -> db_Update("wmessage", "wm_text ='$memberrules', wm_active='".$_POST['wm_active5']."' WHERE wm_id='5' ");
-        $sql -> db_Update("wmessage", "wm_text ='$adminrules', wm_active='".$_POST['wm_active6']."' WHERE wm_id='6' ");
-}
-
-if($delete == 'main')
-{
-        if($sql -> db_Delete("forum", "forum_id='$del_id' "))
-        {
-                $forum -> show_message(FORLAN_96);
-        }
-}
-
-if($action == "create"){
-        if($sql -> db_Select("forum", "*", "forum_parent='0' ")){
-                $forum -> create_forums($sub_action, $id);
-        }else{
-                header("location:".e_ADMIN."forum.php");
-                exit;
-        }
-}
-
-if($delete == 'cat')
-{
-        if($sql -> db_Delete("forum", "forum_id='$del_id' "))
-        {
-                $sql -> db_Delete("forum", "forum_parent='$del_id' ");
-                $forum -> show_message(FORLAN_97);
-                $action = "main";
-        }
-}
-
-if($action == "cat")
-{
-        $forum -> create_parents($sub_action, $id);
-}
-
-if($action == "order"){
-        $forum -> show_existing_forums($sub_action, $id, TRUE);
-}
-
-if($action == "opt"){
-        $forum -> show_prefs();
-}
-
-if($action == "prune"){
-        $forum -> show_prune();
-}
-
-if($action == "rank"){
-        $forum -> show_levels();
-}
-
-if($action == "rules"){
-        $forum -> show_rules();
-}
-
-if($delete == 'reported')
-{
-        $sql -> db_Delete("tmp", "tmp_time='$del_id' ");
-        $forum -> show_message(FORLAN_118);
-        $forum -> show_reported();
-}
-
-
-if($action == "sr"){
-        $forum -> show_reported();
-}
-
-
-if(!e_QUERY || $action == "main"){
-        $forum -> show_existing_forums($sub_action, $id);
-}
-
-//$forum -> show_options($action);
-require_once("footer.php");
-function headerjs(){
-global $etp;
-$headerjs =  "<script type=\"text/javascript\">
-function confirm_(mode, forum_id, forum_name){
-        if(mode == 'sr'){
-                return confirm(\"".$etp->unentity(FORLAN_117)."\");
-        }else if(mode == 'parent'){
-                return confirm(\"".$etp->unentity(FORLAN_81)." [ID: \" + forum_name + \"]\");
-        }else{
-                return confirm(\"".$etp->unentity(FORLAN_82)." [ID: \" + forum_name + \"]\");
-        }
-}
-</script>";
-return $headerjs;
-}
-
-exit;
-
-class forum{
-
-        function show_options($action){
-                global $sql;
-                if($action==""){$action="main";}
-                // ##### Display options ---------------------------------------------------------------------------------------------------------
-                $var['main']['text']=FORLAN_76;
-                $var['main']['link']=e_SELF;
-                $var['cat']['text']=FORLAN_83;
-                $var['cat']['link']=e_SELF."?cat";
-                if($sql -> db_Select("forum", "*", "forum_parent='0' ")){
-                        $var['create']['text']=FORLAN_77;
-                        $var['create']['link']=e_SELF."?create";
-                }
-                $var['order']['text']=FORLAN_78;
-                $var['order']['link']=e_SELF."?order";
-                $var['opt']['text']=FORLAN_79;
-                $var['opt']['link']=e_SELF."?opt";
-                $var['prune']['text']=FORLAN_59;
-                $var['prune']['link']=e_SELF."?prune";
-                $var['rank']['text']=FORLAN_63;
-                $var['rank']['link']=e_SELF."?rank";
-                $var['rules']['text']=FORLAN_123;
-                $var['rules']['link']=e_SELF."?rules";
-                if($sql -> db_Select("tmp", "*", "tmp_ip='reported_post' ")){
-                        $var['sr']['text']=FORLAN_116;
-                        $var['sr']['link']=e_SELF."?sr";
-                }
-                show_admin_menu(FORLAN_7,$action,$var);
-        }
-        function show_existing_forums($sub_action, $id, $mode=FALSE){
-                global $sql, $rs, $ns, $sql2, $sql3;
-                if(!is_object($sql2)){
-                        $sql2 = new db;
-                }
-                if(!is_object($sql3)){
-                        $sql3 = new db;
-                }
-                if(!$mode){
-                        $text = "<div style='border : solid 1px #000; padding : 4px; width : auto; height : 400px; overflow : auto; '>";
-                }else{
-                        $text = "<form method='post' action='".e_SELF."?".e_QUERY."'>";
-                }
-                $text .= "
-                <table style='width:98%' class='fborder'>
-                <tr>
-                <td colspan='2' style='width:70%; text-align:center' class='fcaption'>".FORLAN_28."</td>
-                <td style='width:30%; text-align:center' class='fcaption'>".FORLAN_80."</td>
-                </tr>";
-
-                if(!$parent_amount = $sql -> db_Select("forum", "*", "forum_parent='0' ORDER BY forum_order ASC")){
-                        $text .= "<tr><td class='forumheader3' style='text-align:center' colspan='3'>".FORLAN_29."</td></tr>";
-                }else{
-                        $sql2 = new db; $sql3 = new db;
-                        while($row = $sql-> db_Fetch()){
-                                extract($row);
-
-                                if($forum_class==e_UC_MEMBER){
-                                        $text .= "<tr><td colspan='2' class='forumheader'>".$forum_name." (".FORLAN_84.")</td>";
-                                }else if($forum_class==e_UC_NOBODY){
-                                        $text .= "<tr><td colspan='2' class='forumheader'>".$forum_name." (".FORLAN_38.")</td>";
-                                }else if($forum_class==e_UC_ADMIN){
-                                        $text .= "<tr><td colspan='2' class='forumheader'>".$forum_name." (".FORLAN_39.")</td>";
-                                }else if($forum_class){
-                                        $text .= "<tr><td colspan='2' class='forumheader'>".$forum_name." (".FORLAN_40.")</td>";
-                                }else{
-                                        $text .= "<tr><td colspan='2' class='forumheader'>".$forum_name."</td>";
-                                }
-
-                                $text .= "<td class='forumheader' style='text-align:center'>";
-
-                                if($mode){
-                                        $text .= "<select name='forum_order[]' class='tbox'>\n";
-                                        for($a=1; $a<= $parent_amount; $a++){
-                                                $text .= ($forum_order == $a ? "<option value='$forum_id.$a' selected='selected'>$a</option>\n" : "<option value='$forum_id.$a'>$a</option>\n");
-                                        }
-                                        $text .= "</select>";
-                                }else{
-                                                  $forum_heading = str_replace("&#39;", "\'", $forum_name);
-
-                                                  $text .= $rs -> form_open("post", e_SELF,"parent_{$forum_id}","",""," onsubmit=\"return confirm_('parent',$forum_id,'$forum_heading')\"")."
-                                                  <div>".$rs -> form_button("button", "main_edit_{$forum_id}", FORLAN_19, "onclick=\"document.location='".e_SELF."?cat.edit.$forum_id'\"")."
-                                                  ".$rs -> form_button("submit", "cat_delete_{$forum_id}", FORLAN_20)."
-                                                  </div>".$rs -> form_close();
-                                }
-                                $text .= "</td></tr>";
-
-                                $forums = $sql2 -> db_Select("forum", "*", "forum_parent='".$forum_id."' ORDER BY forum_order ASC");
-                                if(!$forums){
-                                        $text .= "<td colspan='4' style='text-align:center' class='forumheader3'>".FORLAN_29."</td>";
-                                }else{
-                                        while($row = $sql2-> db_Fetch()){
-                                                extract($row);
-
-                                                $text .= "<tr><td style='width:5%; text-align:center' class='forumheader2'><img src='".e_IMAGE."forum/new.png' alt='' /></td>\n<td style='width:55%' class='forumheader2'><a href='".e_BASE."forum_viewforum.php?".$forum_id."'>".$forum_name."</a>" ;
-
-                                                if($forum_class==e_UC_MEMBER){
-                                                        $text .= "(".FORLAN_84.")";
-                                                }else if($forum_class==e_UC_NOBODY){
-                                                        $text .= "(".FORLAN_38.")";
-                                                }else if($forum_class == e_UC_READONLY){
-                                                        $text .= "(".FORLAN_85.")";
-                                                }else if($forum_class == e_UC_ADMIN){
-                                                        $text .= "(".FORLAN_86.")";
-                                                }else if($forum_class){
-                                                        $text .= "(".FORLAN_40.")";
-                                                }
-
-                                                $text .= "<br /><span class='smallblacktext'>".$forum_description."</span></td>
-                                                <td colspan='2' class='forumheader3' style='text-align:center'>";
-
-                                                if($mode){
-                                                        $text .= "<select name='forum_order[]' class='tbox'>\n";
-                                                        for($a=1; $a<= $forums; $a++){
-                                                                $text .= ($forum_order == $a ? "<option value='$forum_id.$a' selected='selected'>$a</option>\n" : "<option value='$forum_id.$a'>$a</option>\n");
-                                                        }
-                                                        $text .= "</select>";
-                                                }else{
-
-                                                       $forum_heading = str_replace("&#39;", "\'", $forum_name);
-                                                       $text .= "
-
-                                                       ".$rs -> form_open("post", e_SELF,"existing_{$forum_id}","",""," onsubmit=\"return confirm_('forum',$forum_id,'$forum_heading')\"")."
-                                                       <div>".$rs -> form_button("button", "main_edit_{$forum_id}", FORLAN_19, "onclick=\"document.location='".e_SELF."?create.edit.$forum_id'\"")."
-                                                       ".$rs -> form_button("submit", "main_delete_{$forum_id}", FORLAN_20)."
-                                                       </div>".$rs -> form_close();
-
-
-
-//                                                        ".$rs -> form_button("submit", "main_delete_{$forum_id}", FORLAN_20, "onclick=\"confirm_('forum', $forum_id, '$forum_heading')\"");
-                                                }
-                                                $text .= "</td>\n</tr>";
-                                        }
-                                }
-                        }
-                }
-
-                if(!$mode){
-                        $text .= "</table></div>";
-                        $ns -> tablerender(FORLAN_30, $text);
-                }else{
-                        $text .= "<tr>\n<td colspan='4' style='text-align:center' class='forumheader'>\n<input class='button' type='submit' name='update_order' value='".FORLAN_72."' />\n</td>\n</tr>\n</table>\n</form>";
-                        $ns -> tablerender(FORLAN_37, $text);
-                }
-
-        }
-
-        function create_parents($sub_action, $id){
-                global $sql, $ns;
-
-                if($sub_action == "edit" && !$_POST['update_parent']){
-                        if($sql -> db_Select("forum", "*", "forum_id=$id")){
-                                $row = $sql -> db_Fetch(); extract($row);
-                        }
-                }
-                $text = "<div style='text-align:center'>
-                <form method='post' action='".e_SELF."?".e_QUERY."'>\n
-                <table style='width:auto' class='fborder'>
-
-                <tr>
-                <td style='width:40%' class='forumheader3'>".FORLAN_31.":</td>
-                <td style='width:60%' class='forumheader3'>
-                <input class='tbox' type='text' name='forum_name' size='60' value='$forum_name' maxlength='250' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:40%' class='forumheader3'>".FORLAN_23.":<br /><span class='smalltext'>(".FORLAN_24.")</span></td>
-                <td style='width:60%' class='forumheader3'>".r_userclass("forum_class",$forum_class);
-                $text .= "</td></tr>";
-                $text .= "<tr style='vertical-align:top'>
-                <td colspan='2'  style='text-align:center' class='forumheader'>";
-
-                if($sub_action == "edit"){
-                        $text .= "<input class='button' type='submit' name='update_parent' value='".FORLAN_25."' />";
-                }else{
-                        $text .= "<input class='button' type='submit' name='submit_parent' value='".FORLAN_26."' />";
-                }
-
-                $text .= "</td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-
-                $ns -> tablerender(FORLAN_75, $text);
-
-        }
-
-        function create_forums($sub_action, $id){
-                global $sql, $ns;
-
-                if($sub_action == "edit" && !$_POST['update_forum']){
-                        if($sql -> db_Select("forum", "*", "forum_id=$id")){
-                                $row = $sql -> db_Fetch(); extract($row);
-                        }
-                }
-
-                $text = "<div style='text-align:center'>
-                <form method='post' action='".e_SELF."?".e_QUERY."'>\n
-                <table style='width:auto' class='fborder'>
-                <tr>
-                <td style='width:40%' class='forumheader3'>".FORLAN_22.":</td>
-                <td style='width:60%' class='forumheader3'>";
-
-                $sql -> db_Select("forum", "*", "forum_parent=0");
-                $text .= "<select name='forum_parent' class='tbox'>\n";
-                while(list($forum_id_, $forum_name_) = $sql-> db_Fetch()){
-                        extract($row);
-                        if($forum_id_ == $forum_parent){
-                                $text .= "<option value='$forum_id_' selected='selected'>".$forum_name_."</option>\n";
-                        }else{
-                                $text .= "<option value='$forum_id_'>".$forum_name_."</option>\n";
-                        }
-                }
-                $text .= "</select>
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:40%' class='forumheader3'>".FORLAN_31.":</td>
-                <td style='width:60%' class='forumheader3'>
-                <input class='tbox' type='text' name='forum_name' size='60' value='$forum_name' maxlength='250' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:40%' class='forumheader3'>".FORLAN_32.": </td>
-                <td style='width:60%' class='forumheader3'>
-                <textarea class='tbox' name='forum_description' cols='50' rows='5'>$forum_description</textarea>
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:40%' class='forumheader3'>".FORLAN_33.":<br /><span class='smalltext'>(".FORLAN_34.")</span></td>
-                <td style='width:60%' class='forumheader3'>";
-                $admin_no = $sql -> db_Select("user", "*", "user_admin='1' AND user_perms REGEXP('A.') OR user_perms='0' ");
-                while($row = $sql-> db_Fetch()){
-                        extract($row);
-                        $text .= "<input type='checkbox' name='mod[]' value='".$user_name ."'";
-                        if(preg_match('/'.preg_quote($user_name).'/', $forum_moderators)){
-                                $text .= " checked";
-                        }
-                        $text .= "/> ".$user_name ."<br />";
-                }
-
-                $text .= "</td>
-                </tr>
-                <tr>
-                <td style='width:40%' class='forumheader3'>".FORLAN_23.":<br /><span class='smalltext'>(".FORLAN_24.")</span></td>
-                <td style='width:60%' class='forumheader3'>".r_userclass("forum_class",$forum_class, "on");
-                $text .= "</td></tr>";
-                $text .= "<tr style='vertical-align:top'>
-                <td colspan='2'  style='text-align:center' class='forumheader'>";
-                if($sub_action == "edit"){
-                        $text .= "<input class='button' type='submit' name='update_forum' value='".FORLAN_35."' />";
-                }else{
-                        $text .= "<input class='button' type='submit' name='submit_forum' value='".FORLAN_36."' />";
-                }
-                $text .= "</td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-                $ns -> tablerender(FORLAN_28, $text);
-        }
-
-        function show_message($message){
-                global $ns;
-                $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-        }
-
-        function show_prefs(){
-                global $pref, $ns;
-                $text = "<div style='text-align:center'>
-                <form method='post' action='".e_SELF."?".e_QUERY."'>\n
-                <table style='width:auto' class='fborder'>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_44."<br /><span class='smalltext'>".FORLAN_45."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['forum_enclose'] ? "<input type='checkbox' name='forum_enclose' value='1' checked='checked' />" : "<input type='checkbox' name='forum_enclose' value='1' />")."</td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_65."<br /><span class='smalltext'>".FORLAN_46."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' ><input class='tbox' type='text' name='forum_title' size='15' value='".$pref['forum_title']."' maxlength='100' /></td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_47."<br /><span class='smalltext'>".FORLAN_48."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['email_notify'] ? "<input type='checkbox' name='email_notify' value='1' checked='checked' />" : "<input type='checkbox' name='email_notify' value='1' />")."</td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_68."<br /><span class='smalltext'>".FORLAN_69."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['html_post'] ? "<input type='checkbox' name='html_post' value='1' checked='checked' />" : "<input type='checkbox' name='html_post' value='1' />")."</td>
-                </tr>
-
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_124."<br /><span class='smalltext'>".FORLAN_125."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['links_new_window'] ? "<input type='checkbox' name='links_new_window' value='1' checked='checked' />" : "<input type='checkbox' name='links_new_window' value='1' />")."</td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_49."<br /><span class='smalltext'>".FORLAN_50."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['forum_poll'] ? "<input type='checkbox' name='forum_poll' value='1' checked='checked' />" : "<input type='checkbox' name='forum_poll' value='1' />")."</td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_70."<br /><span class='smalltext'>".FORLAN_71." <a href='upload.php'>".FORLAN_130."</a> ". FORLAN_131."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['forum_attach'] ? "<input type='checkbox' name='forum_attach' value='1' checked='checked' />" : "<input type='checkbox' name='forum_attach' value='1' />")."</td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_51."<br /><span class='smalltext'>".FORLAN_52."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['forum_track'] ? "<input type='checkbox' name='forum_track' value='1' checked='checked' />" : "<input type='checkbox' name='forum_track' value='1' />")."</td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_112."<br /><span class='smalltext'>".FORLAN_113."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['forum_redirect'] ? "<input type='checkbox' name='forum_redirect' value='1' checked='checked' />" : "<input type='checkbox' name='forum_redirect' value='1' />")."</td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_114."<br /><span class='smalltext'>".FORLAN_115."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['forum_user_customtitle'] ? "<input type='checkbox' name='forum_user_customtitle' value='1' checked='checked' />" : "<input type='checkbox' name='forum_user_customtitle' value='1' />")."</td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_116."<br /><span class='smalltext'>".FORLAN_122."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['reported_post_email'] ? "<input type='checkbox' name='reported_post_email' value='1' checked='checked' />" : "<input type='checkbox' name='reported_post_email' value='1' />")."</td>
-                </tr>
-
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_126."<br /><span class='smalltext'>".FORLAN_127."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' >".($pref['forum_tooltip'] ? "<input type='checkbox' name='forum_tooltip' value='1' checked='checked' />" : "<input type='checkbox' name='forum_tooltip' value='1' />")."</td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_128."<br /><span class='smalltext'>".FORLAN_129."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' ><input class='tbox' type='text' name='forum_tiplength' size='15' value='".$pref['forum_tiplength']."' maxlength='20' /></td>
-                </tr>
-
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_53."<br /><span class='smalltext'>".FORLAN_54."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' ><input class='tbox' type='text' name='forum_eprefix' size='15' value='".$pref['forum_eprefix']."' maxlength='20' /></td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_55."<br /><span class='smalltext'>".FORLAN_56."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' ><input class='tbox' type='text' name='forum_popular' size='3' value='".$pref['forum_popular']."' maxlength='3' /></td>
-                </tr>
-
-                <tr>
-                <td style='width:75%' class='forumheader3'>".FORLAN_57."<br /><span class='smalltext'>".FORLAN_58."</span></td>
-                <td style='width:25%;text-align:center' class='forumheader2' ><input class='tbox' type='text' name='forum_postspage' size='3' value='".$pref['forum_postspage']."' maxlength='3' /></td>
-                </tr>
-
-                <tr>
-                <td colspan='2'  style='text-align:center' class='forumheader'>
-                <input class='button' type='submit' name='updateoptions' value='".FORLAN_61."' />
-                </td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-                $ns -> tablerender(FORLAN_62, $text);
-        }
-
-        function show_reported ($sub_action, $id){
-                        global $sql, $rs, $ns, $aj;
-                        $text = "<div style='border : solid 1px #000; padding : 4px; width :auto; height : 400px; overflow : auto; '>\n";
-                        if($reported_total = $sql -> db_Select("tmp", "*", "tmp_ip='reported_post' ")){
-                                $text .= "<table class='fborder' style='width:100%'>
-                                <tr>
-                                <td style='width:80%' class='forumheader2'>".FORLAN_119."</td>
-                                <td style='width:20%; text-align:center' class='forumheader2'>".FORLAN_80."</td>
-                                </tr>";
-                                while($row = $sql -> db_Fetch()){
-                                        extract($row);
-                                        $reported = explode("^", $tmp_info);
-                                        $text .= "<tr>
-                                        <td style='width:80%' class='forumheader3'><a href='".e_BASE."forum_viewtopic.php?".$reported[0].".".$reported[1]."#".$reported[2]."' rel='external'>".$reported[3]."</a></td>
-                                        <td style='width:20%; text-align:center; vertical-align:top' class='forumheader3'>
-                                                               ".$rs -> form_open("post", e_SELF,"","",""," onsubmit=\"return confirm_('sr',$tmp_time)\"")."
-                                                                    ".$rs -> form_button("submit", "reported_delete_{$tmp_time}", FORLAN_20)."
-                                                                            ".$rs -> form_close()."
-                                        </td>
-                                        </tr>\n";
-                                }
-//                                     ".$rs -> form_button("submit", "reported_delete", FORLAN_20, "onclick=\"confirm_('sr', $tmp_time);\"")."
-                                $text .= "</table>";
-                        }else{
-                                $text .= "<div style='text-align:center'>".FORLAN_121."</div>";
-                        }
-                        $text .= "</div>";
-                        $ns -> tablerender(FORLAN_116, $text);
-                }
-
-        function show_prune(){
-                global $ns;
-                $text = "<div style='text-align:center'>
-                <form method='post' action='".e_SELF."?".e_QUERY."'>\n
-                <table style='width:auto' class='fborder'>
-                <tr>
-                <td style='text-align:center' class='forumheader2'>".FORLAN_60."</td>
-                </tr>
-                <tr>
-
-                <td style='text-align:center' class='forumheader2'>".FORLAN_87."
-                <input class='tbox' type='text' name='prune_days' size='6' value='' maxlength='3' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='text-align:center' class='forumheader3'>".FORLAN_2."<br />
-                ".FORLAN_89." <input type='radio' name='prune_type' value='".FORLAN_3."' />&nbsp;&nbsp;&nbsp;
-                ".FORLAN_90." <input type='radio' name='prune_type' value='".FORLAN_111."' checked='checked' />
-                </td>
-                </tr>
-
-                <tr>
-                <td colspan='2'  style='text-align:center' class='forumheader'>
-                <input class='button' type='submit' name='do_prune' value='".FORLAN_5."' />
-                </td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-                $ns -> tablerender(FORLAN_59, $text);
-        }
-
-        function show_levels(){
-                global $sql, $pref, $ns, $rs;
-
-                $rank_names = explode(",", $pref['forum_levels']);
-                $rank_thresholds = ($pref['forum_thresholds'] ? explode(",", $pref['forum_thresholds']) : array(20, 100, 250, 410, 580, 760, 950, 1150, 1370, 1600));
-                $rank_images = ($pref['forum_images'] ? explode(",", $pref['forum_images']) : array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png"));
-
-                $text = "<div style='text-align:center'>
-                <form method='post' action='".e_SELF."?".e_QUERY."'>\n
-                <table style='width:auto' class='fborder'>
-
-                <tr>
-                <td class='forumheader2' style='width:40%'>".FORLAN_98."</td>
-                <td class='forumheader2' style='width:20%'>".FORLAN_102."<br /><span class='smalltext'>".FORLAN_99."</span></td>
-                <td class='forumheader2' style='width:40%'>".FORLAN_104."<br /><span class='smalltext'>".FORLAN_100."</span></td>
-                </tr>";
-
-                $text .= "<tr>
-                <td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_main_admin' size='30' value='".($pref['rank_main_admin'] ? $pref['rank_main_admin'] : FORLAN_101)."' maxlength='30' /></td>
-                <td class='forumheader3' style='width:40%'>&nbsp;</td>
-                <td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_main_admin_image' size='30' value='".($pref['rank_main_admin_image'] ? $pref['rank_main_admin_image'] : "main_admin.png")."' maxlength='30' /></td>
-                </tr>
-
-                <tr>
-                <td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_admin' size='30' value='".($pref['rank_admin'] ? $pref['rank_admin'] : FORLAN_103)."' maxlength='30' /></td>
-                <td class='forumheader3' style='width:40%'>&nbsp;</td>
-                <td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_admin_image' size='30' value='".($pref['rank_admin_image'] ? $pref['rank_admin_image'] : "admin.png")."' maxlength='30' /></td>
-                </tr>
-
-                <tr>
-                <td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_moderator' size='30' value='".($pref['rank_moderator'] ? $pref['rank_moderator'] : FORLAN_105)."' maxlength='30' /></td>
-                <td class='forumheader3' style='width:40%'>&nbsp;</td>
-                <td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_moderator_image' size='30' value='".($pref['rank_moderator_image'] ? $pref['rank_moderator_image'] : "moderator.png")."' maxlength='30' /></td>
-                </tr>";
-
-                for($a=0; $a<=9; $a++){
-                        $text .= "<tr>
-                        <td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_names[]' size='30' value='".($rank_names[$a] ? $rank_names[$a] : "")."' maxlength='30' /></td>
-                        <td class='forumheader3' style='width:20%; text-align:center'><input class='tbox' type='text' name='rank_thresholds[]' size='10' value='".$rank_thresholds[$a]."' maxlength='5' /></td>
-                        <td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_images[]' size='30' value='".($rank_images[$a] ? $rank_images[$a] : "")."' maxlength='30' /></td>
-                        </tr>";
-                }
-
-                $text .= "<tr>
-                <td colspan='3'  style='text-align:center' class='forumheader'>
-                <input class='button' type='submit' name='set_ranks' value='".FORLAN_94."' />
-                </td>
-                </tr>
-                </table>\n</form>\n</div>";
-                $ns -> tablerender("Ranks", $text);
-        }
-
-        function show_rules(){
-                global $sql, $pref, $ns, $aj;
-
-                $sql -> db_Select("wmessage");
-                list($null) = $sql-> db_Fetch();
-                list($null) = $sql-> db_Fetch();
-                list($null) = $sql-> db_Fetch();
-                list($id, $guestrules, $wm_active4) = $sql-> db_Fetch();
-                list($id, $memberrules, $wm_active5) = $sql-> db_Fetch();
-                list($id, $adminrules, $wm_active6) = $sql-> db_Fetch();
-
-
-                $guestrules = $aj -> formtparev($aj -> editparse($guestrules));
-                $memberrules = $aj -> formtparev($aj -> editparse($memberrules));
-                $adminrules = $aj -> formtparev($aj -> editparse($adminrules));
-
-                $text = "
-                <div style='text-align:center'>
-                <form method='post' action='".$_SERVER['PHP_SELF']."'  id='wmform'>
-                <table style='width:85%' class='fborder'>
-                <tr>";
-
-                $text .= "
-
-                <td style='width:20%' class='forumheader3'>".WMGLAN_1.": <br />
-                ".WMGLAN_6.":";
-                if($wm_active4){
-                        $text .= "<input type='checkbox' name='wm_active4' value='1'  checked='checked' />";
-                }else{
-                        $text .= "<input type='checkbox' name='wm_active4' value='1' />";
-                }
-                $text .= "</td>
-                <td style='width:60%' class='forumheader3'>
-                <textarea class='tbox' name='guestrules' cols='70' rows='10'>$guestrules</textarea>
-                <br />
-                <input class='helpbox' type='text' name='helpguest' size='100' />
-                <br />
-                ".ren_help(1,"addtext1","help1")."
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".WMGLAN_2.": <br />
-                ".WMGLAN_6.":";
-                if($wm_active5){
-                        $text .= "<input type='checkbox' name='wm_active5' value='1'  checked='checked' />";
-                }else{
-                        $text .= "<input type='checkbox' name='wm_active5' value='1' />";
-                }
-                $text .= "</td>
-                <td style='width:60%' class='forumheader3'>
-                <textarea class='tbox' name='memberrules' cols='70' rows='10'>$memberrules</textarea>
-                <br />
-                <input class='helpbox' type='text' name='helpmember' size='100' />
-                <br />
-                ".ren_help(1,"addtext2","help2")."
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".WMGLAN_3.": <br />
-                ".WMGLAN_6.": ";
-
-                if($wm_active6){
-                        $text .= "<input type='checkbox' name='wm_active6' value='1'  checked='checked' />";
-                }else{
-                        $text .= "<input type='checkbox' name='wm_active6' value='1' />";
-                }
-
-                $text .= "</td>
-                <td style='width:60%' class='forumheader3'>
-                <textarea class='tbox' name='adminrules' cols='70' rows='10'>$adminrules</textarea>
-                <br />
-                <input class='helpbox' type='text' name='helpadmin' size='100' />
-                <br />
-                ".ren_help(1,"addtext3","help3")."
-                </td>
-                </tr>
-
-                <tr style='vertical-align:top'>
-                <td class='forumheader3'>&nbsp;</td>
-                <td style='width:60%' class='forumheader3'>
-                <input class='button' type='submit' name='frsubmit' value='".WMGLAN_4."' />
-                </td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-
-                $ns -> tablerender(WMGLAN_5, $text);
-                echo "
-<script type=\"text/javascript\">
-function addtext1(sc){
-        document.getElementById('wmform').guestrules.value += sc;
-}
-function addtext2(sc){
-        document.getElementById('wmform').memberrules.value += sc;
-}
-function addtext3(sc){
-        document.getElementById('wmform').adminrules.value += sc;
-}
-function help1(help){
-        document.getElementById('wmform').helpguest.value = help;
-}
-function help2(help){
-        document.getElementById('wmform').helpmember.value = help;
-}
-function help3(help){
-        document.getElementById('wmform').helpadmin.value = help;
-}
-</script>";
-        }
-}
-
-
-function forum_adminmenu(){
-        global $forum;
-        global $action;
-        $forum -> show_options($action);
-}
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_admin/frontpage.php 75/e107_admin/frontpage.php
--- 6171/e107_admin/frontpage.php	2004-05-18 22:32:30.000000000 -0500
+++ 75/e107_admin/frontpage.php	2006-04-22 14:30:47.000000000 -0500
@@ -1,139 +1,267 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/splash.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("G")){ header("location:".e_BASE."index.php"); exit; }
-$aj = new textparse;
-if(IsSet($_POST['updatesettings'])){
-        if($_POST['frontpage'] == "other"){
-                $_POST['frontpage'] = ($_POST['frontpage_url'] ? $_POST['frontpage_url'] : "news");
-        }
-        $_POST['frontpage_url'] = $aj -> formtpa($_POST['frontpage_url'], "admin");
-        $pref['frontpage'] = $_POST['frontpage'];
-        $pref['frontpage_type'] = $_POST['frontpage_type'];
-        save_prefs();
-
-        if($pref['frontpage'] != "news"){
-                if(!$sql -> db_Select("links", "*", "link_url='news.php' ")){
-                        $sql -> db_Insert("links", "0, 'News', 'news.php', '', '', 1, 0, 0, 0, 0");
-                }
-        }else{
-                $sql -> db_Delete("links", "link_url='news.php'");
-        }
-}
-
-require_once("auth.php");
-
-$frontpage_re = ($pref['frontpage'] ? $pref['frontpage'] : "news");
-$frontpage_type = ($pref['frontpage_type'] ? $pref['frontpage_type'] : "constant");
-
-
-if(e_QUERY == "u"){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".FRTLAN_1."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:95%' class='fborder'>
-<tr>
-
-<td style='width:30%' class='forumheader3'>".FRTLAN_2.": </td>
-<td style='width:70%' class='forumheader3'>
-
-
-<input name='frontpage' type='radio' value='news'";
-if($frontpage_re == "news"){
-        $text .= "checked='checked'";
-        $flag = TRUE;
-}
-$text .= " />".FRTLAN_3."<br />
-<input name='frontpage' type='radio' value='forum'";
-if($frontpage_re == "forum"){
-        $text .= "checked='checked'";
-        $flag = TRUE;
-}
-$text .= " />".FRTLAN_4."<br />
-<input name='frontpage' type='radio' value='download'";
-if($frontpage_re == "download"){
-        $text .= "checked='checked'";
-        $flag = TRUE;
-}
-$text .= " />".FRTLAN_5."<br />
-<input name='frontpage' type='radio' value='links'";
-if($frontpage_re == "links"){
-        $text .= "checked='checked'";
-        $flag = TRUE;
-}
-$text .= " />".FRTLAN_6."<br />";
-
-if($sql -> db_Select("content", "*", "content_type='1'")){
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                $text .= "<input name='frontpage' type='radio' value='".$content_id."'";
-                if($frontpage_re == $content_id){
-                        $text .= "checked='checked'";
-                        $flag = TRUE;
-                }
-                $text .= " />".FRTLAN_7.": ".$content_heading."/".$content_subheading."<br />";
-        }
-}
-
-$text .= "
-<input name='frontpage' type='radio' value='other'";
-if($flag != TRUE){
-        $text .= "checked='checked'";
-}
-
-$text .= " />".FRTLAN_8."
-<input class='tbox' type='text' name='frontpage_url' size='50' value='";
-if($flag != TRUE){
-        $text .= $pref['frontpage'];
-}
-
-$text .= "' maxlength='100' /> ".FRTLAN_14."
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".FRTLAN_9.": </td>
-<td style='width:70%' class='forumheader3'>
-
-<input name='frontpage_type' type='radio' value='constant'";
-if($frontpage_type == "constant"){
-        $text .= "checked='checked'";
-}
-$text .= " />".FRTLAN_10."<br />
-<input name='frontpage_type' type='radio' value='splash'";
-if($frontpage_type == "splash"){
-        $text .= "checked='checked'";
-}
-$text .= " />".FRTLAN_11."<br />
-
-
-</td>
-</tr>
-
-<tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center'  class='forumheader'>
-<input class='button' type='submit' name='updatesettings' value='".FRTLAN_12."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".FRTLAN_13."</div>", $text);
-require_once("footer.php");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/frontpage.php,v $
+|     $Revision: 1.22 $
+|     $Date: 2006/04/22 19:30:47 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+require_once('../class2.php');
+if (!getperms('G')) {
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
+$e_sub_cat = 'frontpage';
+require_once('auth.php');
+require_once(e_HANDLER.'form_handler.php');
+$rs = new form;
+require_once(e_HANDLER.'userclass_class.php');
+
+$front_page['news'] = array('page' => 'news.php', 'title' => ADLAN_0);
+$front_page['download'] = array('page' => 'download.php', 'title' => ADLAN_24);
+$front_page['wmessage'] = array('page' => 'index.php', 'title' => ADLAN_28);   
+
+if ($sql -> db_Select("page", "*", "page_theme=''")) {
+	$front_page['custom']['title'] = 'Custom Page';
+	while ($row = $sql -> db_Fetch()) {
+		$front_page['custom']['page'][] = array('page' => 'page.php?'.$row['page_id'], 'title' => $row['page_title']);
+	}
+}
+
+if ($sql -> db_Select("plugin", "plugin_path", "plugin_installflag = '1'")) {
+	while ($row = $sql -> db_Fetch()) {
+		$frontpage_plugs[] = $row['plugin_path'];
+	}
+}
+
+foreach ($frontpage_plugs as $plugin_id) {
+	if (is_readable(e_PLUGIN.$plugin_id.'/e_frontpage.php')) {
+		require_once(e_PLUGIN.$plugin_id.'/e_frontpage.php');
+	}
+}
+
+if (isset($_POST['edit'])) {
+	$_POST['type'] = (isset($_POST['edit']['all'])) ? 'all_users' : 'user_class';
+	$_POST['class'] = key($_POST['edit']);
+}
+
+if (isset($_POST['updatesettings'])) {
+	if ($_POST['frontpage'] == 'other') {
+		$_POST['other_page'] = $tp -> toForm($_POST['other_page']);
+		$frontpage_value = $_POST['other_page'] ? $_POST['other_page'] : 'news.php';
+	} else {
+		if (is_array($front_page[$_POST['frontpage']]['page'])) {
+			$frontpage_value = $front_page[$_POST['frontpage']]['page'][$_POST['multipage'][$_POST['frontpage']]]['page'];
+		} else {
+			$frontpage_value = $front_page[$_POST['frontpage']]['page'];
+		}
+	}
+
+	if ($_POST['type'] == 'all_users') {
+		unset($pref['frontpage']);
+		$pref['frontpage']['all'] = $frontpage_value;
+	} else {
+		if (isset($pref['frontpage']['all'])) {
+			$pref['frontpage']['252'] = ($_POST['class'] == '252') ? $frontpage_value : $pref['frontpage']['all'];
+			$pref['frontpage']['253'] = ($_POST['class'] == '253') ? $frontpage_value : $pref['frontpage']['all'];
+			$pref['frontpage']['254'] = ($_POST['class'] == '254') ? $frontpage_value : $pref['frontpage']['all'];
+			$class_list = get_userclass_list();
+			foreach ($class_list as $fp_class) {
+				$pref['frontpage'][$fp_class['userclass_id']] = ($_POST['class'] == $fp_class['userclass_id']) ? $frontpage_value : $pref['frontpage']['all'];
+			}
+			unset($pref['frontpage']['all']);
+		}
+		$pref['frontpage'][$_POST['class']] = $frontpage_value;
+	}
+
+	save_prefs();
+	$ns -> tablerender(LAN_UPDATED, "<div style='text-align:center'><b>".FRTLAN_1."</b></div>");
+}
+
+$fp = new frontpage;
+
+if (isset($_POST['select']) || isset($_POST['edit'])) {
+	$fp -> select_page();
+} else {
+	$fp -> select_class();
+}
+
+class frontpage {
+	function select_class() {
+		global $rs, $pref, $ns, $front_page;
+		$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+		$text .= "<tr>
+		<td style='width: 50%' class='forumheader3'>".FRTLAN_2.":</td>
+		<td style='width: 50%' class='forumheader3'>
+		".$rs -> form_radio('type', 'all_users', (isset($pref['frontpage']['all']) ? TRUE : FALSE))." ".FRTLAN_31."&nbsp;
+		".$rs -> form_radio('type', 'user_class', (isset($pref['frontpage']['all']) ? FALSE : TRUE))." ".FRTLAN_32.":
+		".r_userclass('class', '', 'off', 'guest,member,admin,classes')."</td>
+		</tr>";
+
+		$text .= "<tr style='vertical-align:top'>
+		<td colspan='2' style='text-align: center' class='forumheader'>
+		".$rs -> form_button('submit', 'select', LAN_SELECT)."
+		</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+
+		$ns -> tablerender(FRTLAN_13, $text);
+
+		$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."'>
+		<table style='".ADMIN_WIDTH."' class='fborder'><tr>
+		<td style='width: 25%' class='fcaption'>".FRTLAN_32."</td>
+		<td style='width: 65%' class='fcaption'>".FRTLAN_34."</td>
+		<td style='width: 10%' class='fcaption'>".LAN_EDIT."</td>
+		</tr>";
+
+		if (isset($pref['frontpage']['all'])) {
+			$text .= "<tr>
+			<td class='forumheader3'>All Users</td>
+			<td class='forumheader3'>".$pref['frontpage']['all']."</td>
+			<td class='forumheader3' style='text-align:center'>
+			<input type='image' title='".LAN_EDIT."' name='edit[all]' src='".ADMIN_EDIT_ICON_PATH."' />
+			</td>
+			</tr>";
+		} else {
+			foreach ($pref['frontpage'] as $current_key => $current_value) {
+				if ($current_key == 252) {
+					$title = FRTLAN_27;
+				} else if ($current_key == 253) {
+					$title = FRTLAN_28;
+				} else if ($current_key == 254) {
+					$title = FRTLAN_29;
+				} else {
+					$class_list = get_userclass_list();
+					foreach ($class_list as $fp_class) {
+						if ($current_key == $fp_class['userclass_id']) {
+							$title = $fp_class['userclass_name'];
+						}
+					}
+				}
+				$text .= "<tr>
+				<td class='forumheader3'>".$title."</td>
+				<td class='forumheader3'>".$current_value."</td>
+				<td class='forumheader3' style='text-align:center'>
+				<input type='image' title='".LAN_EDIT."' name='edit[".$current_key."]' src='".ADMIN_EDIT_ICON_PATH."' />
+				</td>
+				</tr>";
+			}
+		}
+		$text .= "</table>
+		</form>
+		</div>";
+
+		$ns -> tablerender(FRTLAN_33, $text);
+
+	}
+
+	function select_page() {
+		global $rs, $pref, $ns, $front_page;
+
+		if ($_POST['type'] == 'all_users') {
+			$title = FRTLAN_26;
+		} else {
+			if ($_POST['class'] == 252) {
+				$title = FRTLAN_27;
+			} else if ($_POST['class'] == 253) {
+				$title = FRTLAN_28;
+			} else if ($_POST['class'] == 254) {
+				$title = FRTLAN_29;
+			} else {
+				$class_list = get_userclass_list();
+				foreach ($class_list as $fp_class) {
+					if ($_POST['class'] == $fp_class['userclass_id']) {
+						$title = $fp_class['userclass_name'];
+					}
+				}
+			}
+		}
+
+		$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td colspan='3' class='fcaption'>".FRTLAN_2." ".$title.": </td>
+		</tr>";
+
+		foreach ($front_page as $front_key => $front_value) {
+			$type_selected = FALSE;
+			$current_setting = (isset($pref['frontpage']['all'])) ? $pref['frontpage']['all'] : $pref['frontpage'][$_POST['class']];
+			if (is_array($front_value['page'])) {
+				foreach ($front_value['page'] as $multipage) {
+					if ($current_setting == $multipage['page']) {
+						$type_selected = TRUE;
+						$not_other = TRUE;
+					}
+				}
+			} else {
+				if ($current_setting == $front_value['page']) {
+					$type_selected = TRUE;
+					$not_other = TRUE;
+				}
+			}
+
+			$text .= "<tr><td class='forumheader3'>";
+			$text .= $rs -> form_radio('frontpage', $front_key, $type_selected);
+			$text .= "</td>";
+
+			if (is_array($front_value['page'])) {
+				$text .= "<td style='width: 50%' class='forumheader3'>".$front_value['title']."</td>";
+				$text .= "<td style='width: 50%' class='forumheader3'>";
+				$text .= $rs -> form_select_open('multipage['.$front_key.']');
+				$type = isset($pref['frontpage']['all']) ? 'all' : $_POST['class'];
+				foreach ($front_value['page'] as $multipage_key => $multipage_value) {
+					$sub_selected = ($pref['frontpage'][$type] == $multipage_value['page']) ? TRUE : FALSE;
+					$text .= $rs -> form_option($multipage_value['title'], $sub_selected, $multipage_key);
+				}
+				$text .= $rs -> form_select_close();
+				$text .= "</td>";
+			} else {
+				$text .= "<td style='width: 100%' colspan='2' class='forumheader3'>".$front_value['title']."</td>";
+			}
+			$text .= "</tr>";
+		}
+
+		$text .= "<tr>
+		<td class='forumheader3'>".$rs -> form_radio('frontpage', 'other', (!$not_other ? TRUE : FALSE))."</td>
+		<td style='width: 50%' class='forumheader3'>".FRTLAN_15."</td>
+		<td style='width: 50%' class='forumheader3'>
+		".$rs -> form_text('other_page', 50, (!$not_other ? $current_setting : ''))."
+		</td>
+		</tr>";
+
+		$text .= "<tr style='vertical-align:top'>
+		<td colspan='3' style='text-align: center' class='forumheader'>";
+		$text .= $rs -> form_hidden('type', $_POST['type']);
+		$text .= $rs -> form_hidden('class', $_POST['class']);
+		$text .= $rs -> form_button('submit', 'updatesettings', FRTLAN_12);
+		$text .= "</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+
+		$ns -> tablerender(FRTLAN_13, $text);
+	}
+}
+
+require_once('footer.php');
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/header_links.php 75/e107_admin/header_links.php
--- 6171/e107_admin/header_links.php	2004-07-12 06:34:34.000000000 -0500
+++ 75/e107_admin/header_links.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,128 +0,0 @@
-<?php
-unset($e107_var);
-
-// Admin links menu
-
-$e107_var['a']['text']=ADLAN_8;
-$e107_var['a']['link']=e_ADMIN."administrator.php";
-$e107_var['a']['perm']="3";
-
-$e107_var['b']['text']=ADLAN_10;
-$e107_var['b']['link']=e_ADMIN."updateadmin.php";
-
-$e107_var['c']['text']=ADLAN_14;
-$e107_var['c']['link']=e_ADMIN."article.php";
-$e107_var['c']['perm']="J";
-
-$e107_var['e']['text']=ADLAN_34;
-$e107_var['e']['link']=e_ADMIN."banlist.php";
-$e107_var['e']['perm']="4";
-
-$e107_var['f']['text']=ADLAN_54;
-$e107_var['f']['link']=e_ADMIN."banner.php";
-$e107_var['f']['perm']="D";
-
-$e107_var['g']['text']=ADLAN_74;
-$e107_var['g']['link']=e_ADMIN."cache.php";
-$e107_var['g']['perm']="0";
-
-$e107_var['h']['text']=ADLAN_56;
-$e107_var['h']['link']=e_ADMIN."chatbox.php";
-$e107_var['h']['perm']="C";
-
-$e107_var['i']['text']=ADLAN_16;
-$e107_var['i']['link']=e_ADMIN."content.php";
-$e107_var['i']['perm']="L";
-
-$e107_var['j']['text']=ADLAN_42;
-$e107_var['j']['link']=e_ADMIN."custommenu.php";
-$e107_var['j']['perm']="2";
-
-$e107_var['k']['text']=ADLAN_44;
-$e107_var['k']['link']=e_ADMIN."db.php";
-$e107_var['k']['perm']="0";
-
-$e107_var['l']['text']=ADLAN_24;
-$e107_var['l']['link']=e_ADMIN."download.php";
-$e107_var['l']['perm']="R";
-
-$e107_var['m']['text']=ADLAN_58;
-$e107_var['m']['link']=e_ADMIN."emoticon.php";
-$e107_var['m']['perm']="F";
-
-$e107_var['n']['text']=ADLAN_30;
-$e107_var['n']['link']=e_ADMIN."filemanager.php";
-$e107_var['n']['perm']="6";
-
-$e107_var['o']['text']=ADLAN_12;
-$e107_var['o']['link']=e_ADMIN."forum.php";
-$e107_var['o']['perm']="5";
-
-$e107_var['p']['text']=ADLAN_60;
-$e107_var['p']['link']=e_ADMIN."frontpage.php";
-$e107_var['p']['perm']="G";
-
-$e107_var['q']['text']=ADLAN_105;
-$e107_var['q']['link']=e_ADMIN."image.php";
-$e107_var['q']['perm']="4";
-
-$e107_var['r']['text']=ADLAN_20;
-$e107_var['r']['link']=e_ADMIN."links.php";
-$e107_var['r']['perm']="I";
-
-$e107_var['s']['text']=ADLAN_64;
-$e107_var['s']['link']=e_ADMIN."log.php";
-$e107_var['s']['perm']="S";
-
-$e107_var['t']['text']=ADLAN_40;
-$e107_var['t']['link']=e_ADMIN."ugflag.php";
-$e107_var['t']['perm']="9";
-
-$e107_var['u']['text']=ADLAN_6;
-$e107_var['u']['link']=e_ADMIN."menus.php";
-$e107_var['u']['perm']="2";
-
-$e107_var['v']['text']=ADLAN_66;
-$e107_var['v']['link']=e_ADMIN."meta.php";
-$e107_var['v']['perm']="T";
-
-$e107_var['w']['text']=ADLAN_0;
-$e107_var['w']['link']=e_ADMIN."newspost.php";
-$e107_var['w']['perm']="H";
-
-$e107_var['x']['text']=ADLAN_62;
-$e107_var['x']['link']=e_ADMIN."newsfeed.php";
-$e107_var['x']['perm']="E";
-
-$e107_var['y']['text']=ADLAN_68;
-$e107_var['y']['link']=e_ADMIN."phpinfo.php";
-$e107_var['y']['perm']="0";
-
-$e107_var['z']['text']=ADLAN_70;
-$e107_var['z']['link']=e_ADMIN."poll.php";
-$e107_var['z']['perm']="U";
-
-$e107_var['aa']['text']=ADLAN_4;
-$e107_var['aa']['link']=e_ADMIN."prefs.php";
-$e107_var['aa']['perm']="1";
-
-$e107_var['bb']['text']=ADLAN_72;
-$e107_var['bb']['link']=e_ADMIN."upload.php";
-$e107_var['bb']['perm']="V";
-
-$e107_var['cc']['text']=ADLAN_18;
-$e107_var['cc']['link']=e_ADMIN."review.php";
-$e107_var['cc']['perm']="K";
-
-$e107_var['dd']['text']=ADLAN_36;
-$e107_var['dd']['link']=e_ADMIN."users.php";
-$e107_var['dd']['perm']="4";
-
-$e107_var['ee']['text']=ADLAN_38;
-$e107_var['ee']['link']=e_ADMIN."userclass2.php";
-$e107_var['ee']['perm']="4";
-
-$e107_var['ff']['text']=ADLAN_28;
-$e107_var['ff']['link']=e_ADMIN."wmessage.php";
-$e107_var['ff']['perm']="M";
-?>
\ No newline at end of file
diff -ruN 6171/e107_admin/header.php 75/e107_admin/header.php
--- 6171/e107_admin/header.php	2004-09-06 06:36:42.000000000 -0500
+++ 75/e107_admin/header.php	2006-05-13 13:18:43.000000000 -0500
@@ -1,261 +1,312 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /e107_admin/header.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|   $Source: /cvsroot/e107/e107/e107_admin/header.php,v $
-|   $Revision: 1.23 $
-|   $Date: 2004/09/06 11:36:42 $
-|   $Author: loloirie $
-+---------------------------------------------------------------+
-*/
-echo (defined("STANDARDS_MODE") ? "" : "<?xml version='1.0' encoding='iso-8859-1' ?>");
-if(file_exists(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_header.php")){@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_header.php");}else{@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_header.php");}
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title><?php echo SITENAME." : ".LAN_head_4; ?></title>
-<link rel="stylesheet" href="<?php echo THEME; ?>style.css" />
-<?php if(file_exists(e_FILE."e107.css")){ echo "\n<link rel='stylesheet' href='".e_FILE."e107.css' />\n"; } ?>
-<?php if(file_exists(e_FILE."style.css")){ echo "\n<link rel='stylesheet' href='".e_FILE."style.css' />\n"; } ?>
-<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" />
-<meta http-equiv="content-style-type" content="text/css" />
-<?php
- echo "<script type='text/javascript' src='".e_FILE."e107.js'></script>\n";
-if(file_exists(THEME."theme.js")){echo "<script type='text/javascript' src='".THEME."theme.js'></script>\n";}
- if(file_exists(e_FILE."user.js")){echo "<script type='text/javascript' src='".e_FILE."user.js'></script>\n";}
-if(function_exists("headerjs")){     echo headerjs(); }
-if($htmlarea_js){ echo $htmlarea_js; }
-if($eplug_js){ echo "<script type='text/javascript' src='{$eplug_js}'></script>\n"; }
-if($eplug_css){ echo "\n<link rel='stylesheet' href='{$eplug_css}' type='text/css' />\n"; }
-?>
-</head>
-<body>
-<?php
-
-$ns = new e107table;
-$e107_var = array();
-
-echo "<div style='text-align:center'>
-<img src='".e_IMAGE."adminlogo.png' alt='Logo' />
-<br />";
-
-if(ADMIN == TRUE)
-{
-	$str = str_replace(".", "", ADMINPERMS);
-	if(ADMINPERMS == "0"){
-		echo ADLAN_48.": ".ADMINNAME." (".ADLAN_49.")";
-	}
-	else
-	{
-		echo ADLAN_48.": ".ADMINNAME." (".ADLAN_50.":  ".$str.")";
-	}
-}
-else
-{
-	echo ADLAN_51." ...";
-}
-
-$adminfpage = (!$pref['adminstyle'] || $pref['adminstyle'] == "default" ? "admin.php" : $pref['adminstyle'].".php");
-
-echo "
-<div>
-<table style='width:100%' cellspacing='10' cellpadding='10'>
-<tr>
-<td style='width:15%; vertical-align: top;'>";
-
-if(ADMIN == TRUE){
-
-	if(!strstr(e_SELF, "/".$adminfpage) || strstr(e_SELF, "/".$adminfpage."?")){
-		$e107_var['x']['text']=ADLAN_52;
-		$e107_var['x']['link']=e_ADMIN.$adminfpage;
-
-		$e107_var['y']['text']=ADLAN_53;
-		$e107_var['y']['link']=e_BASE."index.php";
-
-		$text .= show_admin_menu("",time(),$e107_var)."<br />";
-
-		require_once("header_links.php");
-		$text .= get_admin_treemenu(ADLAN_93,time(),$e107_var,TRUE);
-		unset($e107_var);
-
-		// Plugin links menu
-
-		$sql2 = new db;
-		if($sql2 -> db_Select("plugin", "*", "plugin_installflag=1"))
-		{
-			while($row = $sql2 -> db_Fetch())
-			{
-				extract($row);
-				include(e_PLUGIN.$plugin_path."/plugin.php");
-
-				//Link Plugin Manager
-				$e107_var['x']['text'] = "<b>".ADLAN_98."</b>";
-				$e107_var['x']['link'] = e_ADMIN."plugin.php";
-				$e107_var['x']['perm'] = "P";
-
-				// Links Plugins
-				if($eplug_conffile)
-				{
-					$e107_var['x'.$plugin_id]['text'] = $eplug_caption;
-					$e107_var['x'.$plugin_id]['link'] = e_PLUGIN.$plugin_path."/".$eplug_conffile;
-					$e107_var['x'.$plugin_id]['perm'] = "P".$plugin_id;
-				}
-				unset($eplug_conffile, $eplug_name, $eplug_caption);
-			}
-			$text .= get_admin_treemenu(ADLAN_95,time(),$e107_var,TRUE);
-			unset($e107_var);
-		}
-		unset($e107_var);
-		$e107_var['x']['text']=ADLAN_46;
-		$e107_var['x']['link']=e_ADMIN."admin.php?logout";
-		$text .= "<br />".show_admin_menu("",$act,$e107_var);
-		$ns -> tablerender(LAN_head_1, $text);
-
-	}
-	else
-	{
-		$text = "<div style='text-align:center'>";
-		unset($e107_var);
-		$e107_var['x']['text']=ADLAN_53;
-		$e107_var['x']['link']=e_ADMIN."../index.php";
-		$text .= show_admin_menu("",$act,$e107_var);
-		$text  .="</div>";
-		$ns -> tablerender(LAN_head_1, $text);
-		unset($text);
-	}
-
-if(ADMINPERMS == "0")
-{
-	if((ADMINPWCHANGE+2592000) < time())
-	{
-		$text = "<div style='mediumtext; text-align:center'>".ADLAN_102." <a href='".e_ADMIN."updateadmin.php'>".ADLAN_103."</a></div>";
-		$ns -> tablerender(ADLAN_104, $text);
-	}
-}
-
-if(!($handle=opendir(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/"))){
-  $handle=opendir(e_LANGUAGEDIR."English/admin/help/");
-}
-
-$text = "";
-while(false !== ($file = readdir($handle)))
-{
-	if($file != "." && $file != ".." && $file != "CVS")
-	{
-		if(eregi($file, e_SELF))
-		{
-			if(file_exists(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file)){@require_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file);}
-			else{@require_once(e_LANGUAGEDIR."English/admin/help/".$file);}
-		}
-	}
-}
-closedir($handle);
-}
-
-$plugpath = e_PLUGIN.substr(strrchr(substr(e_SELF, 0, strrpos(e_SELF, "/")), "/"), 1)."/help.php";
-if(file_exists($plugpath)){
-	@require_once($plugpath);
-}
-
-echo "<br />";
-
-
-if(!FILE_UPLOADS){
-        message_handler("ADMIN_MESSAGE", LAN_head_2, __LINE__, __FILE__);
-}
-/*
-if(OPEN_BASEDIR){
-        message_handler("ADMIN_MESSAGE", LAN_head_3, __LINE__, __FILE__);
-}
-*/
-
-echo "</td>
-<td style='width:60%; vertical-align: top;'>";
-
-function show_admin_menu($title,$page,$e107_vars){
-	global $ns;
-	$text = "<div style='text-align:center; width:100%'><table class='fborder' style='width:98%;'>";
-	foreach(array_keys($e107_vars) as $act)
-	{
-		$pre = "";
-		$post = "";
-		if($page == $act){
-			$pre = "<b>&laquo;&nbsp;";
-			$post = "&nbsp;&raquo;</b>";
-		}
-		$t=str_replace(" ","&nbsp;",$e107_vars[$act]['text']);
-		if(!$e107_vars[$act]['perm'] || getperms($e107_vars[$act]['perm']))
-		{
-			$text .= "<tr><td class='button'><div style='width:100%; text-align:center'><a style='cursor:hand; cursor:pointer; text-decoration:none;' href='{$e107_vars[$act]['link']}'>{$pre}{$t}{$post}</a></div></td></tr>";
-		}
-	}
-	$text .= "</table></div>";
-	if($title=="")
-	{
-		return $text;
-	}
-	$ns -> tablerender($title,$text);
-}
-
-function get_admin_treemenu($title,$page,$e107_vars,$sortlist=FALSE)
-{
-	global $ns;
-
-	if($sortlist == TRUE)
-	{
-		$temp = $e107_vars;
-		unset($e107_vars);
-		foreach(array_keys($temp) as $key)
-		{
-			$func_list[]=$temp[$key]['text'];
-		}
-    setlocale("LC_ALL","deu");
-    usort($func_list, 'strcoll');
-
-		foreach($func_list as $func_text)
-		{
-			foreach(array_keys($temp) as $key)
-			{
-				if($temp[$key]['text'] == $func_text)
-				{
-					$e107_vars[] = $temp[$key];
-				}
-			}
-		}
-	}
-	
-	$idtitle="yop_".str_replace(" ","",$title);
-	$text = "<div style='text-align:center; width:100%'><table class='fborder' style='width:100%;'>";
-	$text .= "<tr><td class='button'><a style='text-align:center; cursor:hand; cursor:pointer; text-decoration:none;' onclick=\"expandit('{$idtitle}');\" >{$title}</a></td></tr>";
-	$text .= "<tr id=\"{$idtitle}\" style=\"display: none;\" ><td class='forumheader3' style='text-align:left;'>";
-	foreach(array_keys($e107_vars) as $act)
-	{
-		$pre = "";
-		$post = "";
-		if($page == $act)
-		{
-			$pre = "<b> &laquo; ";
-			$post = " &raquo; </b>";
-		}
-		if(!$e107_vars[$act]['perm'] || getperms($e107_vars[$act]['perm']))
-		{
-			$text .= "{$pre}<a style='text-decoration:none;' href='{$e107_vars[$act]['link']}'>{$e107_vars[$act]['text']}</a>{$post}<br />";
-		}
-	}
-
-	$text .= "</td></tr>";
-	$text .= "</table></div>";
-	return $text;
-}
-?>
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        /e107_admin/header.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|   $Source: /cvsroot/e107/e107_0.7/e107_admin/header.php,v $
+|   $Revision: 1.52 $
+|   $Date: 2006/05/13 18:18:43 $
+|   $Author: mcfly_e107 $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// send the charset to the browser - overides spurious server settings with the lan pack settings.
+header("Content-type: text/html; charset=".CHARSET, true);
+
+require_once(e_ADMIN.'ad_links.php');
+echo defined('STANDARDS_MODE') ? "" :
+ "<?xml version='1.0' encoding='".CHARSET."' ?>";
+if (file_exists(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_header.php')) {
+	@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_header.php");
+} else {
+	@include_once(e_LANGUAGEDIR."English/admin/lan_header.php");
+}
+if (file_exists(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_footer.php')) {
+	@include_once(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_footer.php');
+} else {
+	@include_once(e_LANGUAGEDIR.'English/admin/lan_footer.php');
+}
+if (!defined('ADMIN_WIDTH')) {
+	define('ADMIN_WIDTH', 'width: 95%');
+}
+
+if (!defined('ADMIN_TRUE_ICON'))
+{
+	define("ADMIN_TRUE_ICON", "<img src='".e_IMAGE_ABS."fileinspector/integrity_pass.png' alt='' style='border:0px; height:16px; width:16px' />");
+	define("ADMIN_TRUE_ICON_PATH", e_IMAGE."fileinspector/integrity_pass.png");
+}
+
+if (!defined('ADMIN_FALSE_ICON'))
+{
+	define("ADMIN_FALSE_ICON", "<img src='".e_IMAGE_ABS."fileinspector/integrity_fail.png' alt='' style='border:0px; height:16px; width:16px' />");
+	define("ADMIN_FALSE_ICON_PATH", e_IMAGE."fileinspector/integrity_fail.png");
+}
+
+
+if (!defined('ADMIN_EDIT_ICON'))
+{
+	define("ADMIN_EDIT_ICON", "<img src='".e_IMAGE_ABS."admin_images/edit_16.png' alt='' title='".LAN_EDIT."' style='border:0px; height:16px; width:16px' />");
+	define("ADMIN_EDIT_ICON_PATH", e_IMAGE."admin_images/edit_16.png");
+}
+
+
+
+if (!defined('ADMIN_DELETE_ICON'))
+{
+	define("ADMIN_DELETE_ICON", "<img src='".e_IMAGE_ABS."admin_images/delete_16.png' alt='' title='".LAN_DELETE."' style='border:0px; height:16px; width:16px' />");
+	define("ADMIN_DELETE_ICON_PATH", e_IMAGE."admin_images/delete_16.png");
+}
+
+echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
+	<html xmlns='http://www.w3.org/1999/xhtml'".(defined("TEXTDIRECTION") ? " dir='".TEXTDIRECTION."'" : "").(defined("CORE_LC") ? " xml:lang=\"".CORE_LC."\"" : "").">
+	<head>
+	<title>".SITENAME." : ".LAN_head_4."</title>\n";
+echo "<meta http-equiv='content-type' content='text/html; charset=".CHARSET."' />
+	<meta http-equiv='content-style-type' content='text/css' />\n";
+if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE && isset($pref['admincss']) && $pref['admincss'] && file_exists(THEME.$pref['admincss'])) {
+	$css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? THEME_ABS.'admin_'.$pref['admincss'] : THEME_ABS.$pref['admincss'];
+	echo "<link rel='stylesheet' href='".$css_file."' type='text/css' />\n";
+} else if (isset($pref['themecss']) && $pref['themecss'] && file_exists(THEME.$pref['themecss'])) {
+	$css_file = file_exists(THEME.'admin_'.$pref['themecss']) ? THEME_ABS.'admin_'.$pref['themecss'] : THEME_ABS.$pref['themecss'];
+	echo "<link rel='stylesheet' href='".$css_file."' type='text/css' />\n";
+} else {
+	$css_file = file_exists(THEME.'admin_style.css') ? THEME_ABS.'admin_style.css' : THEME_ABS.'style.css';
+	echo "<link rel='stylesheet' href='".$css_file."' type='text/css' />\n";
+}
+
+if (!isset($no_core_css) || !$no_core_css) {
+	echo "<link rel='stylesheet' href='".e_FILE_ABS."e107.css' type='text/css' />\n";
+}
+
+if (function_exists('theme_head')) {
+   	echo theme_head();
+}
+if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) {
+	echo "<script type='text/javascript' src='".e_FILE_ABS."e107.js'></script>\n";
+}
+if (file_exists(THEME."theme.js")) {
+	echo "<script type='text/javascript' src='".THEME_ABS."theme.js'></script>\n";
+}
+if (filesize(e_FILE.'user.js')) {
+	echo "<script type='text/javascript' src='".e_FILE_ABS."user.js'></script>\n";
+}
+if (function_exists("headerjs")) {
+	echo headerjs();
+}
+if (isset($htmlarea_js) && $htmlarea_js) {
+	echo $htmlarea_js;
+}
+if (strpos(e_SELF, 'fileinspector.php') === FALSE) {
+echo "<script type='text/javascript'>
+<!--
+function savepreset(ps,pid){
+	document.getElementById(ps).action='".e_SELF."?savepreset.'+pid;
+	document.getElementById(ps).submit();
+}
+//-->
+</script>\n";
+}
+if (isset($eplug_js) && $eplug_js) {
+	echo "<script type='text/javascript' src='{$eplug_js}'></script>\n";
+}
+if (isset($eplug_css) && $eplug_css) {
+	echo "\n<link rel='stylesheet' href='{$eplug_css}' type='text/css' />\n";
+}
+if(check_class($pref['post_html']) && $pref['wysiwyg'] && $e_wysiwyg == TRUE){
+  	require_once(e_HANDLER."tiny_mce/wysiwyg.php");
+	echo wysiwyg($e_wysiwyg);
+	define("e_WYSIWYG",TRUE);
+}else{
+	define("e_WYSIWYG",FALSE);
+}
+echo "</head>
+<body>\n";
+
+$ns = new e107table;
+$e107_var = array();
+
+if (!function_exists('show_admin_menu')) {
+	function show_admin_menu($title, $active_page, $e107_vars, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE) {
+		global $ns, $BUTTON, $BUTTON_OVER, $BUTTONS_START, $BUTTONS_END, $SUB_BUTTON, $SUB_BUTTON_OVER, $SUB_BUTTONS_START, $SUB_BUTTONS_END;
+		$id_title = "yop_".str_replace(" ", "", $title);
+		if (!isset($BUTTONS_START)) {
+			$BUTTONS_START = "<div style='text-align:center; width:100%'><table class='fborder' style='width:98%;'>\n";
+		}
+		if (!isset($BUTTON)) {
+			$BUTTON = "<tr><td class='button'><div style='width:100%; text-align:center'><a style='cursor:hand; cursor:pointer; text-decoration:none;' {ONCLICK} >{LINK_TEXT}</a></div></td></tr>\n";
+		}
+		if (!isset($BUTTON_OVER)) {
+			$BUTTON_OVER = "<tr><td class='button'><div style='width:100%; text-align:center'><a style='cursor:hand; cursor:pointer; text-decoration:none;' {ONCLICK} ><b>&laquo;&nbsp;{LINK_TEXT}&nbsp;&raquo;</b></a></div></td></tr>\n";
+		}
+		if (!isset($BUTTONS_END)) {
+			$BUTTONS_END = "</table></div>\n";
+		}
+		if (!isset($SUB_BUTTON)) {
+			$SUB_BUTTON = "<a style='text-decoration:none;' href='{LINK_URL}'>{LINK_TEXT}</a><br />";
+		}
+		if (!isset($SUB_BUTTON_OVER)) {
+			$SUB_BUTTON_OVER = "<b> &laquo; <a style='text-decoration:none;' href='{LINK_URL}'>{LINK_TEXT}</a> &raquo; </b><br />";
+		}
+		if (!isset($SUB_BUTTONS_START)) {
+			$SUB_BUTTONS_START = "<div style='text-align:center; width:100%'><table class='fborder' style='width:98%;'>
+			<tr><td class='button'><a style='text-align:center; cursor:hand; cursor:pointer; text-decoration:none;'
+			onclick=\"expandit('{SUB_HEAD_ID}');\" >{SUB_HEAD}</a></td></tr>
+			<tr id='{SUB_HEAD_ID}' style='display: none' ><td class='forumheader3' style='text-align:left;'>";
+		}
+		if (!isset($SUB_BUTTONS_END)) {
+			$SUB_BUTTONS_END = "</td></tr></table></div>";
+		}
+
+		if ($sortlist == TRUE) {
+			$temp = $e107_vars;
+			unset($e107_vars);
+			foreach (array_keys($temp) as $key) {
+				$func_list[] = $temp[$key]['text'];
+			}
+
+			usort($func_list, 'strcoll');
+
+			foreach ($func_list as $func_text) {
+				foreach (array_keys($temp) as $key) {
+					if ($temp[$key]['text'] == $func_text) {
+						$e107_vars[] = $temp[$key];
+					}
+				}
+			}
+		}
+
+		$search[0] = "/\{LINK_TEXT\}(.*?)/si";
+		$search[1] = "/\{LINK_URL\}(.*?)/si";
+		$search[2] = "/\{ONCLICK\}(.*?)/si";
+		$search[3] = "/\{SUB_HEAD\}(.*?)/si";
+		$search[4] = "/\{SUB_HEAD_ID\}(.*?)/si";
+
+		if ($sub_link) {
+			$replace[0] = '';
+			$replace[1] = '';
+			$replace[2] = '';
+			$replace[3] = $title;
+			$replace[4] = $id_title;
+			$text = preg_replace($search, $replace, $SUB_BUTTONS_START);
+		} else {
+			$text = $BUTTONS_START;
+		}
+
+		foreach (array_keys($e107_vars) as $act) {
+			if (!isset($e107_vars[$act]['perm']) || !$e107_vars[$act]['perm'] || getperms($e107_vars[$act]['perm'])) {
+				if ($active_page == $act || (str_replace("?", "", e_PAGE.e_QUERY) == str_replace("?", "", $act))) {
+					$BUTTON_TEMPLATE = $sub_link ? $SUB_BUTTON_OVER : $BUTTON_OVER;
+				} else {
+					$BUTTON_TEMPLATE = $sub_link ? $SUB_BUTTON : $BUTTON;
+				}
+				$replace[0] = str_replace(" ", "&nbsp;", $e107_vars[$act]['text']);
+				$replace[1] = $e107_vars[$act]['link'];
+				if ($e107_vars[$act]['include']!='') {
+					$replace[2] = $e107_vars[$act]['include'];
+				} else {
+					$replace[2] = $js ? "onclick=\"showhideit('".$act."');\"" : "onclick=\"document.location='".$e107_vars[$act]['link']."'; disabled=true;\"";
+				}
+				$replace[3] = $title;
+				$replace[4] = $id_title;
+				$text .= preg_replace($search, $replace, $BUTTON_TEMPLATE);
+			}
+		}
+		$text .= $sub_link ? $SUB_BUTTONS_END : $BUTTONS_END;
+
+		if ($title == "" || $sub_link) {
+			return $text;
+		} else {
+			$ns -> tablerender($title, $text, array('id' => $id_title, 'style' => 'button_menu'));
+		}
+	}
+}
+
+if (file_exists(THEME.'admin_template.php')) {
+  	require_once(THEME.'admin_template.php');
+} else {
+  	require_once(e_BASE.$THEMES_DIRECTORY.'templates/admin_template.php');
+}
+
+if (!function_exists("parse_admin")) {
+	function parse_admin($ADMINLAYOUT) {
+		global $tp;
+		$adtmp = explode("\n", $ADMINLAYOUT);
+		for ($a = 0; $a < count($adtmp); $a++) {
+			if (preg_match("/{.+?}/", $adtmp[$a])) {
+				echo $tp->parseTemplate($adtmp[$a]);
+			} else {
+				echo $adtmp[$a];
+			}
+		}
+	}
+}
+
+function admin_update($update, $type = 'update', $success = false, $failed = false) {
+	global $ns;
+	if (($type == 'update' && $update) || ($type == 'insert' && $update !== false)) {
+		$caption = LAN_UPDATE;
+		$text = "<b>".($success ? $success : LAN_UPDATED)."</b>";
+	} else if ($type == 'delete' && $update) {
+		$caption = LAN_DELETE;
+		$text = "<b>".($success ? $success : LAN_DELETED)."</b>";
+	} else if (!mysql_errno()) {
+		if ($type == 'update') {
+			$caption = LAN_UPDATED_FAILED;
+			$text = "<b>".LAN_NO_CHANGE."<br />".LAN_TRY_AGAIN."</b>";
+		} else if ($type == 'delete') {
+			$caption = LAN_DELETE;
+			$text = "<b>".LAN_DELETED_FAILED.".<br />".LAN_TRY_AGAIN."</b>";
+		}
+	} else {
+		$caption = LAN_UPDATED_FAILED;
+		$text = "<b>".($failed ? $failed : LAN_UPDATED_FAILED." - ".LAN_TRY_AGAIN)."</b><br />".LAN_ERROR." ".mysql_errno().": ".mysql_error();
+	}
+	$ns -> tablerender($caption, "<div style='text-align:center'>".$text."</div>");
+	return $update;
+}
+
+function admin_purge_related($table, $id)
+{
+	global $ns, $tp;
+	$msg = "";
+	$tp->parseTemplate("");
+
+	// Delete any related comments
+	require_once(e_HANDLER."comment_class.php");
+	$_com = new comment;
+	$num = $_com->delete_comments($table, $id);
+	if($num)
+	{
+		$msg .= $num." ".ADLAN_114." ".LAN_DELETED."<br />";
+	}
+
+	// Delete any related ratings
+	require_once(e_HANDLER."rate_class.php");
+	$_rate = new rater;
+	$num = $_rate->delete_ratings($table, $id);
+	if($num)
+	{
+		$msg .= LAN_RATING." ".LAN_DELETED."<br />";
+	}
+	
+	if($msg)
+	{
+		$ns->tablerender(LAN_DELETE, $msg);
+	}
+}
+
+if (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE) {
+	parse_admin($ADMIN_HEADER);
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/image.php 75/e107_admin/image.php
--- 6171/e107_admin/image.php	2004-07-29 21:43:00.000000000 -0500
+++ 75/e107_admin/image.php	2006-04-17 08:23:41.000000000 -0500
@@ -1,238 +1,243 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/image.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("5")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-require_once(e_HANDLER."form_handler.php");
-require_once(e_HANDLER."userclass_class.php");
-$rs = new form;
-
-if(strstr(e_QUERY, "delp")){
-	if(!e_REFERER_SELF){exit;}
-	$tmp = explode("-", e_QUERY);
-	$image = $tmp[1];
-	@unlink(e_FILE."public/avatars/".$image);
-	$sql -> db_Update("user", "user_image='' WHERE user_image='-upload-$image'");
-	$sql -> db_Update("user", "user_sess='' WHERE user_sess='$image'");
-	$message = $image." ".IMALAN_28;
-}
-
-if(e_QUERY == "del"){
-	if(!e_REFERER_SELF){exit;}
-        $handle=opendir(e_FILE."public/avatars/");
-        while ($file = readdir($handle)){
-                if($file != "." && $file != ".." && $file != "index.html" && $file != "/"){
-                        $dirlist[] = $file;
-                }
-        }
-        closedir($handle);
-        $count = 0;
-        while(list($key, $image_name) = each($dirlist)){
-                if(!$sql -> db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")){
-                        unlink(e_FILE."public/avatars/".$image_name);
-                        $count ++;
-                }
-        }
-        $message = $count." ".IMALAN_26;
-}
-
-
-if(IsSet($_POST['update_options'])){
-        $pref['image_post'] = $_POST['image_post'];
-        $pref['resize_method'] = $_POST['resize_method'];
-        $pref['im_path'] = $_POST['im_path'];
-        $pref['image_post_class'] = $_POST['image_post_class'];
-        $pref['image_post_disabled_method'] = $_POST['image_post_disabled_method'];
-        save_prefs();
-        $message = IMALAN_9;
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-
-if(IsSet($_POST['show_avatars'])){
-
-        $handle=opendir(e_FILE."public/avatars/");
-        while ($file = readdir($handle)){
-                if($file != "." && $file != ".." && $file != "index.html" && $file != "/"){
-                        $dirlist[] = $file;
-                }
-        }
-        closedir($handle);
-
-        $text = "<div style='text-align:center'>\n";
-
-        if(!is_array($dirlist)){
-                $text .= IMALAN_29;
-        }else{
-
-
-
-                while(list($key, $image_name) = each($dirlist)){
-                        $users = IMALAN_21." | ";
-                        if($sql -> db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")){
-                                while($row = $sql -> db_Fetch()){
-                                        extract($row);
-                                        $users .= "<a href='".e_BASE."user.php?id.$user_id'>$user_name</a> <span class='smalltext'>(".($user_sess == $image_name ? IMALAN_24 : IMALAN_23).")</span> | ";
-                                }
-                        }else{
-                                $users = IMALAN_22;
-                        }
-
-                        $text .= "<div class='spacer'>
-                        <table style='width:95%' class='fborder'>
-                        <tr>
-                        <td class='forumheader'>$image_name</td>
-                        </tr>
-                        <tr>
-                        <td class='forumheader3'><img src='".e_FILE."public/avatars/".$image_name."' alt='' /><br />[ <a href='".e_SELF."?delp-$image_name'>".IMALAN_27." ]</a></td>
-                        </tr>
-                        <tr>
-                        <td class='forumheader3'>$users</td>
-                        </tr>
-                        </table>
-                        </div>";
-                }
-
-                $text .= "<div class='spacer'>
-                <table style='width:95%' class='fborder'>
-                <tr>
-                <td class='forumheader'><a href='".e_SELF."?del'>".IMALAN_25."</a></td>
-                </tr>
-                </table>";
-
-        }
-
-        $text .= "</div>";
-
-        $ns -> tablerender(IMALAN_18, $text);
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:85%' class='fborder'>
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".IMALAN_1."<br />
-<span class='smalltext'>".IMALAN_2."</span>
-</td>
-<td style='width:25%;text-align:center' class='forumheader3' >".
-($pref['image_post'] ? "<input type='checkbox' name='image_post' value='1' checked='checked' />" : "<input type='checkbox' name='image_post' value='1' />")."
-</td>
-</tr>
-
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".IMALAN_10."<br />
-<span class='smalltext'>".IMALAN_11."</span>
-</td>
-<td style='width:25%;text-align:center' class='forumheader3' >
-
-
-<select class='tbox' name='image_post_class'>
-<option value='".e_UC_PUBLIC."'".($pref['image_post_class'] == e_UC_PUBLIC ? " selected='selected'" : "").">".IMALAN_30."</option>
-<option value='".e_UC_GUEST."'".($pref['image_post_class'] == e_UC_GUEST ? " selected='selected'" : "").">".IMALAN_31."</option>
-<option value='".e_UC_MEMBER."'".($pref['image_post_class'] == e_UC_MEMBER ? " selected='selected'" : "").">".IMALAN_32."</option>
-<option value='".e_UC_ADMIN."'".($pref['image_post_class'] == e_UC_ADMIN ? " selected='selected'" : "").">".IMALAN_33."</option>\n";
-
-
-if($sql -> db_Select("userclass_classes")){
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                $text .= "<option value='".$userclass_id."'".($pref['image_post_class'] == $userclass_id ? " selected='selected'" : "").">$userclass_name</option>\n";
-        }
-}
-$text .= "</select>
-
-</td>
-</tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".IMALAN_12."<br />
-<span class='smalltext'>".IMALAN_13."</span>
-</td>
-<td style='width:25%;text-align:center' class='forumheader3' >
-<select name='image_post_disabled_method' class='tbox'>".
-($pref['image_post_disabled_method'] == "0" ? "<option value='1' selected='selected'>".IMALAN_14."</option>" : "<option value='0'>".IMALAN_14."</option>").
-($pref['image_post_disabled_method'] == "1" ? "<option value='1' selected='selected'>".IMALAN_15."</option>" : "<option value='1'>".IMALAN_15."</option>")."
-</select></td>
-</tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>".IMALAN_3."<br /><span class='smalltext'>".IMALAN_4."</span></td>
-<td style='width:25%;text-align:center' class='forumheader3' >
-<select name='resize_method' class='tbox'>".
-($pref['resize_method'] == "gd1" ? "<option selected='selected'>gd1</option>" : "<option>gd1</option>").
-($pref['resize_method'] == "gd2" ? "<option selected='selected'>gd2</option>" : "<option>gd2</option>").
-($pref['resize_method'] == "ImageMagick" ? "<option selected='selected'>ImageMagick</option>" : "<option>ImageMagick</option>")."
-</select>
-</td>
-</tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>".IMALAN_5."<br /><span class='smalltext'>".IMALAN_6."</span></td>
-<td style='width:25%;text-align:center' class='forumheader3' >
-<input class='tbox' type='text' name='im_path' size='40' value='".$pref['im_path']."' maxlength='200' />
-</td></tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>".IMALAN_16."</td>
-<td style='width:25%;text-align:center' class='forumheader3'  >
-<input class='button' type='submit' name='show_avatars' value='".IMALAN_17."' />
-</td></tr>
-
-<tr>
-<td colspan='2' style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='update_options' value='".IMALAN_8."' />
-</td>
-</tr>
-
-</table></form></div>";
-$ns -> tablerender("<div style='text-align:center'>".IMALAN_7."</div>", $text);
-
-
-require_once("footer.php");
-
-
-
-$pref['resize_method'] = $_POST['resize_method'];
-        $pref['im_path'] = $_POST['im_path'];
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/image.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2006/04/17 13:23:41 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("5")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'image';
+require_once("auth.php");
+require_once(e_HANDLER."form_handler.php");
+require_once(e_HANDLER."userclass_class.php");
+$rs = new form;
+
+if (isset($_POST['delete'])) {
+	$image = $_POST['filename'];
+	@unlink(e_FILE."public/avatars/".$image);
+	$sql->db_Update("user", "user_image='' WHERE user_image='-upload-$image'");
+	$sql->db_Update("user", "user_sess='' WHERE user_sess='$image'");
+	$message = $image." ".IMALAN_28;
+}
+
+if (isset($_POST['deleteall'])) {
+	$handle = opendir(e_FILE."public/avatars/");
+	while ($file = readdir($handle)) {
+		if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db') { 
+			$dirlist[] = $file;
+		}
+	}
+	closedir($handle);
+	$count = 0;
+	while (list($key, $image_name) = each($dirlist)) {
+		if (!$sql->db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")) {
+			unlink(e_FILE."public/avatars/".$image_name);
+			$count ++;
+		}
+	}
+	$message = $count." ".IMALAN_26;
+}
+
+
+if (isset($_POST['update_options'])) {
+	$pref['image_post'] = $_POST['image_post'];
+	$pref['resize_method'] = $_POST['resize_method'];
+	$pref['im_path'] = $_POST['im_path'];
+	$pref['image_post_class'] = $_POST['image_post_class'];
+	$pref['image_post_disabled_method'] = $_POST['image_post_disabled_method'];
+	$pref['enable_png_image_fix'] = $_POST['enable_png_image_fix'];
+	
+	save_prefs();
+	$message = IMALAN_9;
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+
+if (isset($_POST['show_avatars'])) {
+
+	$handle = opendir(e_FILE."public/avatars/");
+	while ($file = readdir($handle)) {
+		if ($file != '.' && $file != '..' && $file != "index.html" && $file != "null.txt" && $file != '/' && $file != 'CVS' && $file != 'Thumbs.db' && !is_dir($file)) { 
+			$dirlist[] = $file;
+		}
+	}
+	closedir($handle);
+
+	$text = "<div style='text-align:center'>\n";
+
+	if (!is_array($dirlist)) {
+		$text .= IMALAN_29;
+	} else {
+
+
+
+		while (list($key, $image_name) = each($dirlist)) {
+			$users = IMALAN_21." | ";
+			if ($sql->db_Select("user", "*", "user_image='-upload-$image_name' OR user_sess='$image_name'")) {
+				while ($row = $sql->db_Fetch()) {
+					extract($row);
+					$users .= "<a href='".e_BASE."user.php?id.$user_id'>$user_name</a> <span class='smalltext'>(".($user_sess == $image_name ? IMALAN_24 : IMALAN_23).")</span> | ";
+				}
+			} else {
+				$users = IMALAN_22;
+			}
+
+			$text .= "<div class='spacer'>
+				<form method='post' action='".e_SELF."'>
+				<table style='".ADMIN_WIDTH."' class='fborder'>
+				<tr>
+				<td class='fcaption'>$image_name</td>
+				</tr>
+				<tr>
+				<td class='forumheader3'><img src='".e_FILE."public/avatars/".$image_name."' alt='' /></a><br />
+				<input type='hidden' name='filename' value='".$image_name."' />
+				<input class='button' type='submit' name='delete' value='".LAN_DELETE."' />
+				</td>
+				</tr>
+				<tr>
+				<td class='forumheader3'>$users</td>
+				</tr>
+				</table>
+				</form>
+				</div>";
+		}
+
+		$text .= "<div class='spacer'>
+			<form method='post' action='".e_SELF."'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td class='forumheader'>
+			<input class='button' type='submit' name='deleteall' value='".IMALAN_25."' />
+			</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+
+	}
+
+	$text .= "</div>";
+
+	$ns->tablerender(IMALAN_18, $text);
+}
+
+
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".IMALAN_1."<br />
+	<span class='smalltext'>".IMALAN_2."</span>
+	</td>
+	<td style='width:25%;text-align:center' class='forumheader3' >". ($pref['image_post'] ? "<input type='checkbox' name='image_post' value='1' checked='checked' />" : "<input type='checkbox' name='image_post' value='1' />")."
+	</td>
+	</tr>
+
+
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".IMALAN_10."<br />
+	<span class='smalltext'>".IMALAN_11."</span>
+	</td>
+	<td style='width:25%;text-align:center' class='forumheader3' >
+
+
+	<select class='tbox' name='image_post_class'>
+	<option value='".e_UC_PUBLIC."'".($pref['image_post_class'] == e_UC_PUBLIC ? " selected='selected'" : "").">".IMALAN_30."</option>
+	<option value='".e_UC_GUEST."'".($pref['image_post_class'] == e_UC_GUEST ? " selected='selected'" : "").">".IMALAN_31."</option>
+	<option value='".e_UC_MEMBER."'".($pref['image_post_class'] == e_UC_MEMBER ? " selected='selected'" : "").">".IMALAN_32."</option>
+	<option value='".e_UC_ADMIN."'".($pref['image_post_class'] == e_UC_ADMIN ? " selected='selected'" : "").">".IMALAN_33."</option>\n";
+
+
+if ($sql->db_Select("userclass_classes")) {
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		$text .= "<option value='".$userclass_id."'".($pref['image_post_class'] == $userclass_id ? " selected='selected'" : "").">$userclass_name</option>\n";
+	}
+}
+$text .= "</select>
+
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".IMALAN_12."<br />
+	<span class='smalltext'>".IMALAN_13."</span>
+	</td>
+	<td style='width:25%;text-align:center' class='forumheader3' >
+	<select name='image_post_disabled_method' class='tbox'>". ($pref['image_post_disabled_method'] == "0" ? "<option value='1' selected='selected'>".IMALAN_14."</option>" : "<option value='0'>".IMALAN_14."</option>"). ($pref['image_post_disabled_method'] == "1" ? "<option value='1' selected='selected'>".IMALAN_15."</option>" : "<option value='1'>".IMALAN_15."</option>")."
+	</select></td>
+	</tr>
+
+	<tr>
+	<td style='width:75%' class='forumheader3'>".IMALAN_3."<br /><span class='smalltext'>".IMALAN_4."</span></td>
+	<td style='width:25%;text-align:center' class='forumheader3' >
+	<select name='resize_method' class='tbox'>". ($pref['resize_method'] == "gd1" ? "<option selected='selected'>gd1</option>" : "<option>gd1</option>"). ($pref['resize_method'] == "gd2" ? "<option selected='selected'>gd2</option>" : "<option>gd2</option>"). ($pref['resize_method'] == "ImageMagick" ? "<option selected='selected'>ImageMagick</option>" : "<option>ImageMagick</option>")."
+	</select>
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:75%' class='forumheader3'>".IMALAN_5."<br /><span class='smalltext'>".IMALAN_6."</span></td>
+	<td style='width:25%;text-align:center' class='forumheader3' >
+	<input class='tbox' type='text' name='im_path' size='40' value='".$pref['im_path']."' maxlength='200' />
+	</td></tr>
+
+	<tr>
+	<td style='width:75%' class='forumheader3'>".IMALAN_34."<br />
+	<span class='smalltext'>".IMALAN_35."</span>
+	</td>
+	<td style='width:25%;text-align:center' class='forumheader3' >".($pref['enable_png_image_fix'] ? "<input type='checkbox' name='enable_png_image_fix' value='1' checked='checked' />" : "<input type='checkbox' name='enable_png_image_fix' value='1' />")."
+	</td>
+	</tr>
+	
+	<tr>
+	<td style='width:75%' class='forumheader3'>".IMALAN_16."</td>
+	<td style='width:25%;text-align:center' class='forumheader3'  >
+	<input class='button' type='submit' name='show_avatars' value='".IMALAN_17."' />
+	</td></tr>
+
+	<tr>
+	<td colspan='2' style='text-align:center' class='forumheader'>
+	<input class='button' type='submit' name='update_options' value='".IMALAN_8."' />
+	</td>
+	</tr>
+	
+	
+
+
+	</table></form></div>";
+$ns->tablerender(IMALAN_7, $text);
+
+
+require_once("footer.php");
+
+
+
+$pref['resize_method'] = $_POST['resize_method'];
+$pref['im_path'] = $_POST['im_path'];
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/includes/beginner.php 75/e107_admin/includes/beginner.php
--- 6171/e107_admin/includes/beginner.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/includes/beginner.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,75 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/includes/beginner.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if($_GET['mode'] == "e_advanced"){
+	$pref['adminstyle'] = "classis";
+  	save_prefs();
+	Header("Location:". e_ADMIN."admin.php");
+}
+
+$text = "<div style='text-align:center;vertical-align:middle'><br /><br />
+	<table style='".ADMIN_WIDTH.";margin-top:auto;margin-bottom:auto' >";
+
+ //	$newarray[28] = array(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", 2, E_16_PLUGMANAGER, E_32_PLUGMANAGER);
+
+  $selection = array(22,12,17,25,5,19,7,23,28,26);
+ // $selection = array(21,11,17,24,5,19,7,27,28,25);
+	foreach($selection as $id){
+	$text .= render_links($newarray[$id][0],$newarray[$id][1],$newarray[$id][2],$newarray[$id][3],$newarray[$id][6],'beginner');
+	}
+
+$text .= "\n</tr></table><br /></div>";
+
+$text .= "<div class='smalltext' style='text-align:center'>".ADLAN_144." <a href='".e_SELF."?mode=e_advanced' >".ADLAN_145."</a>&nbsp;&nbsp;</div>";
+
+$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
+
+
+
+$text = "<div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."'>";
+
+$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_32_PLUGMANAGER, "classis");
+
+if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		include(e_PLUGIN.$plugin_path."/plugin.php");
+		if ($eplug_conffile) {
+			$plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
+			$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
+		}
+		unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon);
+	}
+}
+
+ksort($plugin_array, SORT_STRING);
+foreach ($plugin_array as $plug_key => $plug_value) {
+	$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'classis');
+}
+
+$text .= render_clean();
+
+$text .= "</table></div>";
+
+$ns->tablerender(ADLAN_CL_7, $text);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/includes/cascade.php 75/e107_admin/includes/cascade.php
--- 6171/e107_admin/includes/cascade.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/includes/cascade.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,58 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/includes/cascade.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+$text = "<div style='text-align:center'>
+	<table class='fborder' style='".ADMIN_WIDTH."'>";
+	
+while (list($key, $funcinfo) = each($newarray)) {
+	$text .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'adminb');
+}
+	
+$text .= "<tr>
+	<td class='fcaption' colspan='5'>
+	".ADLAN_CL_7."
+	</td>
+	</tr>";
+	
+$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'adminb');
+	
+if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		include(e_PLUGIN.$plugin_path."/plugin.php");
+		if ($eplug_conffile) {
+			$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN.$eplug_icon_small."' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
+			$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
+		}
+		unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
+	}
+}
+
+ksort($plugin_array, SORT_STRING);
+foreach ($plugin_array as $plug_key => $plug_value) {
+	$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'adminb');
+}
+	
+$text .= "</table></div>";
+	
+$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/includes/categories.php 75/e107_admin/includes/categories.php
--- 6171/e107_admin/includes/categories.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/includes/categories.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,82 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/includes/categories.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+$text = "<div style='text-align:center'>
+	<table class='fborder' style='".ADMIN_WIDTH."'>";
+	
+foreach ($admin_cat['id'] as $cat_key => $cat_id) {
+	$text_check = FALSE;
+	$text_cat = "<tr><td class='fcaption' colspan='2'>".$admin_cat['title'][$cat_key]."</td></tr>
+		<tr><td class='forumheader3' style='text-align: center; vertical-align: middle; width: 72px; height: 48px'>".$admin_cat['lrg_img'][$cat_key]."</td><td class='forumheader3'>
+		<table style='width:100%'>";
+	if ($cat_key != 5) {
+		foreach ($newarray as $key => $funcinfo) {
+			if ($funcinfo[4] == $cat_key) {
+				$text_rend = render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
+				if ($text_rend) {
+					$text_check = TRUE;
+				}
+				$text_cat .= $text_rend;
+			}
+		}
+	} else {
+		$text_rend = render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default');
+
+		if ($text_rend) {
+			$text_check = TRUE;
+		}
+		$text_cat .= $text_rend;
+		if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
+			while ($row = $sql->db_Fetch()) {
+				extract($row);
+				include(e_PLUGIN.$plugin_path."/plugin.php");
+				if ($eplug_conffile) {
+					$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN.$eplug_icon_small."' alt='".$eplug_caption."' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
+					$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
+					//$text_rend = render_links(e_PLUGIN.$plugin_path."/".$eplug_conffile, $eplug_name, $eplug_caption, "P".$plugin_id, $plugin_icon, 'default');
+					if ($plugin_array[0]) {
+						$text_check = TRUE;
+					}
+					//$text_cat .= $text_rend;
+				}
+				unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
+			}
+		}
+		ksort($plugin_array, SORT_STRING);
+		foreach ($plugin_array as $plug_key => $plug_value) {
+			$text_cat .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'default');
+		}
+	}
+	$text_cat .= render_clean();
+	$text_cat .= "</table>
+		</td></tr>";
+	if ($text_check) {
+		$text .= $text_cat;
+	}
+}
+	
+$text .= "</table></div>";
+	
+$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
+	
+echo admin_info();
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/includes/classis.php 75/e107_admin/includes/classis.php
--- 6171/e107_admin/includes/classis.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/includes/classis.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,63 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/includes/classis.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+$text = "<div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."'>";
+	
+while (list($key, $funcinfo) = each($newarray)) {
+	$text .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[6], "classis");
+}
+	
+$text .= render_clean();
+	
+$text .= "</table></div>";
+	
+$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
+	
+$text = "<div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."'>";
+	
+$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_32_PLUGMANAGER, "classis");
+	
+if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		include(e_PLUGIN.$plugin_path."/plugin.php");
+		if ($eplug_conffile) {
+			$plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
+			$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
+		}
+		unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon);
+	}
+}
+
+ksort($plugin_array, SORT_STRING);
+foreach ($plugin_array as $plug_key => $plug_value) {
+	$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'classis');
+}
+	
+$text .= render_clean();
+	
+$text .= "</table></div>";
+	
+$ns->tablerender(ADLAN_CL_7, $text);
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/includes/combo.php 75/e107_admin/includes/combo.php
--- 6171/e107_admin/includes/combo.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/includes/combo.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,69 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/includes/combo.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+$text = "<div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."'>";
+	
+while (list($key, $funcinfo) = each($newarray)) {
+	$text .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
+}
+	
+while ($td <= 5) {
+	$text_cat .= "<td class='td' style='width:20%;' ></td>";
+	$td++;
+}
+$td = 1;
+	
+$text .= "</tr></table></div>";
+	
+$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
+	
+$text = "<div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."'>";
+	
+$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_32_PLUGMANAGER, "classis");
+	
+if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		include(e_PLUGIN.$plugin_path."/plugin.php");
+		if ($eplug_conffile) {
+			$plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
+			$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
+		}
+		unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon);
+	}
+}
+
+ksort($plugin_array, SORT_STRING);
+foreach ($plugin_array as $plug_key => $plug_value) {
+	$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'classis');
+}
+	
+$text .= render_clean();
+	
+$text .= "</table></div>";
+	
+$ns->tablerender(ADLAN_CL_7, $text);
+	
+echo admin_info();
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/includes/compact.php 75/e107_admin/includes/compact.php
--- 6171/e107_admin/includes/compact.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/includes/compact.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,70 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/includes/compact.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+$text = "<div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."'>";
+	
+while (list($key, $funcinfo) = each($newarray)) {
+	$text .= render_links($funcinfo[0], $funcinfo[1], $funcinfo[2], $funcinfo[3], $funcinfo[5], 'default');
+}
+
+$text_cat = '';
+while ($td <= 5) {
+	$text_cat .= "<td class='td' style='width:20%;' ></td>";
+	$td++;
+}
+$td = 1;
+	
+$text .= "</tr></table></div>";
+	
+$ns->tablerender(ADLAN_47." ".ADMINNAME, $text);
+
+
+$text = "<div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."'>";
+	
+$text .= render_links(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z", E_16_PLUGMANAGER, 'default');
+	
+if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		include(e_PLUGIN.$plugin_path."/plugin.php");
+		if ($eplug_conffile) {
+			$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN.$eplug_icon_small."' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
+			$plugin_array[ucfirst($eplug_name)] = array('link' => e_PLUGIN.$plugin_path."/".$eplug_conffile, 'title' => $eplug_name, 'caption' => $eplug_caption, 'perms' => "P".$plugin_id, 'icon' => $plugin_icon);
+		}
+		unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
+	}
+}
+
+ksort($plugin_array, SORT_STRING);
+foreach ($plugin_array as $plug_key => $plug_value) {
+	$text .= render_links($plug_value['link'], $plug_value['title'], $plug_value['caption'], $plug_value['perms'], $plug_value['icon'], 'default');
+}
+	
+$text .= "</tr>
+	</table></div>";
+	
+$ns->tablerender(ADLAN_CL_7, $text);
+	
+echo admin_info();
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/index.php 75/e107_admin/index.php
--- 6171/e107_admin/index.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/index.php	2005-05-27 09:06:47.000000000 -0500
@@ -0,0 +1,23 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/index.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/05/27 14:06:47 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+header('Location: admin.php');
+exit;
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/lancheck.php 75/e107_admin/lancheck.php
--- 6171/e107_admin/lancheck.php	2004-04-21 21:16:28.000000000 -0500
+++ 75/e107_admin/lancheck.php	2005-08-23 04:36:30.000000000 -0500
@@ -1,157 +1,227 @@
-<?php
-require_once("../class2.php");
-if(!getperms("0")){ header("location:".e_BASE."index.php"); exit;}
-require_once("auth.php");
-
-
-function show_comparison($language,$filename){
-	global $LANGUAGES_DIRECTORY;
-	$English = get_lan_phrases("English");
-	$check = get_lan_phrases($language);
-	
-	$keys = array_keys($English[$filename]);
-	natsort($keys);
-	$ret .= "<table class='fborder'>
-	<tr>
-	<td class='fcaption' style='text-align:center;'>".LAN_CHECK_7."</td>
-	<td class='fcaption' style='text-align:center;'>{$LANGUAGES_DIRECTORY}<br />English/{$filename}</td>
-	<td class='fcaption' style='text-align:center;'>{$LANGUAGES_DIRECTORY}<br />{$language}/{$filename}</td>
-	</tr>";
-	foreach($keys as $k){
-		$ret .= "<tr>
-		<td class='forumheader3'>{$k}</td>
-		<td class='forumheader3'>\"{$English[$filename][$k]}\"</td>
-		";
-		if(isset($check[$filename][$k])){
-			$ret .= "<td class='forumheader3'>\"{$check[$filename][$k]}\"</td>";
-		} else {
-			$ret .= "<td class='forumheader'>".LAN_CHECK_5."</td>";
-		}
-		$ret .= "</tr>";
-	}
-	$ret .= "</table>";
-	return $ret;
-}
-
-
-function get_lan_phrases($lang){
-	$ret = array();
-// Read English lan_ files
-	$base_dir = e_LANGUAGEDIR.$lang;
-	if($r = opendir($base_dir)){
-		while($file = readdir($r)){
-			$fname = $base_dir."/".$file;
-			if(preg_match("#^lan_#",$file) && is_file($fname)){
-				$data = file($fname);
-				foreach($data as $line){
-					if(preg_match("#\"(.*?)\".*?\"(.*)\"#",$line,$matches)){
-						$ret[$file][$matches[1]]=htmlentities($matches[2]);
-					}
-				}
-			}
-		}
-		closedir($r);
-	}
-// Read $lang/admin lan_ files
-	$base_dir = e_LANGUAGEDIR.$lang."/admin";
-	if($r = opendir($base_dir)){
-		while($file = readdir($r)){
-			$fname = $base_dir."/".$file;
-			if(preg_match("#^lan_#",$file) && is_file($fname)){
-				$data = file($fname);
-				foreach($data as $line){
-					if(preg_match("#\"(.*?)\".*?\"(.*)\"#",$line,$matches)){
-						$ret["admin/".$file][$matches[1]]=$matches[2];
-					}
-				}
-			}
-		}
-		closedir($r);
-	}
-	return $ret;
-}
-
-
-
-function check_core_lanfiles($checklan){
-
-	$English = get_lan_phrases("English");
-	$check = get_lan_phrases($checklan);
-
-	$text .= "<table class='fborder'>";
-	$keys = array_keys($English);
-	sort($keys);
-	foreach($keys as $k){
-		$lnk = "<a href='?{$checklan}.{$k}'>{$k}</a>";
-		if(array_key_exists($k,$check)){
-			$text .= "<tr><td class='forumheader3'>{$lnk}</td>";
-			$subkeys = array_keys($English[$k]);
-			sort($subkeys);
-			$er="";
-			foreach($subkeys as $sk){
-				if(!array_key_exists($sk,$check[$k])){
-					$er .= ($er) ? "<br />" : "";
-					$er .= $sk." ".LAN_CHECK_5;
-				}
-			}
-			if($er){
-				$text .= "<td class='forumheader2'><div class='smalltext'>{$er}</div></td></tr>";
-			} else {
-				$text .= "<td class='forumheader3'><div class='smalltext'>".LAN_CHECK_6."</div></td></tr>";
-			}
-		} else {
-			$text .= "<tr><td class='forumheader3'>{$lnk}</td><td class='forumheader'>".LAN_CHECK_4."</td></tr>";
-		}
-//		$text .= "$k<br />";
-	}
-	$text .= "</table>";
-
-	return $text;
-}
-
-function show_languages(){
-	if($r = opendir(e_LANGUAGEDIR)){
-		while($file = readdir($r)){
-			$fname = e_LANGUAGEDIR.$file;
-			if(is_dir($fname) && $file != "English" && $file != "CVS" && $file != "." && $file != ".."){
-				$languages[]=$file;
-			}
-		}
-		$text .= "
-		<form name='lancheck' method='POST'>
-		<table class='fborder'>
-		<tr>
-		<td class='forumheader'>".LAN_CHECK_1."</td></tr>
-		<tr><td class='forumheader3'>";
-		foreach($languages as $lang){
-			$text .= "<input type='radio' name='language' value='{$lang}' /> {$lang}<br />";
-		}
-		$text .= "</td></tr>
-		<tr><td class='forumheader2' style='text-align:center;'><input type='submit' name='check_lang' value='".LAN_CHECK_2."' class='button' />
-		</td></tr>
-		</table></form>";
-		return $text;
-	}
-}
-
-if(e_QUERY){
-	$qs = explode(".",rawurldecode(e_QUERY),2);
-	$text = show_comparison($qs[0],$qs[1]);
-	$ns -> tablerender(LAN_CHECK_3.": {$qs[0]}",$text);
-	require_once("footer.php");
-	exit;
-}
-
-if($_POST['check_lang']){
-	$text = check_core_lanfiles($_POST['language']);
-	$ns -> tablerender(LAN_CHECK_3.": ".$_POST['language'],$text);
-	require_once("footer.php");
-	exit;
-}
-
-$ns -> tablerender(" ",show_languages());
-//$text = check_core_lanfiles();
-//$ns -> tablerender("<div style='text-align:center'>".LOGLAN_13."</div>", $text);
-require_once("footer.php");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/lancheck.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/08/23 09:36:30 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("0")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+$e_sub_cat = 'language';
+require_once("auth.php");
+
+			
+function show_comparison($language, $filename)
+{
+	global $LANGUAGES_DIRECTORY;
+	$English = get_lan_phrases("English");
+	$check = get_lan_phrases($language);
+	 
+	$keys = array_keys($English[$filename]);
+	natsort($keys);
+	$ret .= "<table class='fborder' style='".ADMIN_WIDTH."'>
+		<tr>
+		<td class='fcaption' style='text-align:center;'>".LAN_CHECK_7."</td>
+		<td class='fcaption' style='text-align:center;'>{$LANGUAGES_DIRECTORY}<br />English/{$filename}</td>
+		<td class='fcaption' style='text-align:center;'>{$LANGUAGES_DIRECTORY}<br />{$language}/{$filename}</td>
+		</tr>";
+	foreach($keys as $k) {
+		$ret .= "<tr>
+			<td class='forumheader3'>{$k}</td>
+			<td class='forumheader3'>\"{$English[$filename][$k]}\"</td>
+			";
+		if (isset($check[$filename][$k])) {
+			$ret .= "<td class='forumheader3'>\"{$check[$filename][$k]}\"</td>";
+		} else {
+			$ret .= "<td class='forumheader'>".LAN_CHECK_5."</td>";
+		}
+		$ret .= "</tr>";
+	}
+	$ret .= "</table>";
+	return $ret;
+}
+	
+	
+function get_lan_phrases($lang)
+{
+	$ret = array();
+	// Read English lan_ files
+	$base_dir = e_LANGUAGEDIR.$lang;
+	if ($r = opendir($base_dir))
+	{
+		while ($file = readdir($r))
+		{
+			$fname = $base_dir."/".$file;
+			if (strpos($file, "lan_") === 0 && is_file($fname))
+			{
+				$data = file($fname);
+				foreach($data as $line)
+				{
+					if (preg_match("#\"(.*?)\".*?\"(.*)\"#", $line, $matches)) {
+						$ret[$file][$matches[1]] = htmlentities($matches[2]);
+					}
+				}
+			}
+		}
+		closedir($r);
+	}
+	// Read $lang/admin lan_ files
+	$base_dir = e_LANGUAGEDIR.$lang."/admin";
+	if ($r = opendir($base_dir))
+	{
+		while ($file = readdir($r))
+		{
+			$fname = $base_dir."/".$file;
+			if (strpos($file, "lan_") === 0 && is_file($fname))
+			{
+				$data = file($fname);
+				foreach($data as $line)
+				{
+					if (preg_match("#\"(.*?)\".*?\"(.*)\"#", $line, $matches))
+					{
+						$ret["admin/".$file][$matches[1]] = $matches[2];
+					}
+				}
+			}
+		}
+		closedir($r);
+	}
+	return $ret;
+}
+	
+function check_core_lanfiles($checklan) {
+	 
+	$English = get_lan_phrases("English");
+	$check = get_lan_phrases($checklan);
+	 
+	$text .= "<table class='fborder' style='".ADMIN_WIDTH."'>";
+	$keys = array_keys($English);
+	sort($keys);
+	foreach($keys as $k) {
+		$lnk = "<a href='?{$checklan}.{$k}'>{$k}</a>";
+		if (array_key_exists($k, $check)) {
+			$text .= "<tr><td class='forumheader3'>{$lnk}</td>";
+			$subkeys = array_keys($English[$k]);
+			sort($subkeys);
+			$er = "";
+			foreach($subkeys as $sk) {
+				if (!array_key_exists($sk, $check[$k])) {
+					$er .= ($er) ? "<br />" :
+					 "";
+					$er .= $sk." ".LAN_CHECK_5;
+				}
+			}
+			if ($er) {
+				$text .= "<td class='forumheader3'><div class='smalltext'>{$er}</div></td></tr>";
+			} else {
+				$text .= "<td class='forumheader3'><div class='smalltext'>".LAN_CHECK_6."</div></td></tr>";
+			}
+		} else {
+			$text .= "<tr><td class='forumheader3'>{$lnk}</td><td class='forumheader'>".LAN_CHECK_4."</td></tr>";
+		}
+	}
+	$text .= "</table>";
+	 
+	return $text;
+}
+	
+function show_languages()
+{
+	if ($r = opendir(e_LANGUAGEDIR))
+	{
+		while ($file = readdir($r))
+		{
+			$fname = e_LANGUAGEDIR.$file;
+			if (is_dir($fname) && $file != "English" && $file != "CVS" && $file != "." && $file != "..")
+			{
+				$languages[] = $file;
+			}
+		}
+		$text .= "
+			<form name='lancheck' method='POST'>
+			<table class='fborder' style='".ADMIN_WIDTH."'>
+			<tr>
+			<td class='fcaption'>".LAN_CHECK_1."</td></tr>
+			<tr><td class='forumheader3'>";
+		foreach($languages as $lang)
+		{
+			$text .= "<input type='radio' name='language' value='{$lang}' /> {$lang}<br />";
+		}
+		$text .= "</td></tr>
+			<tr><td class='forumheader' style='text-align:center;'><input type='submit' name='check_lang' value='".LAN_CHECK_2."' class='button' />
+			</td></tr>
+			</table></form>";
+		return $text;
+	}
+}
+
+function find_plugins($path)
+{
+	static $plugin_list;
+	if($path == "")
+	{
+		$path = e_PLUGIN;
+	}
+	if(substr($path,-1) == '/') {
+		$path = substr($path, 0, -1);
+	}
+	if($handle = opendir($path))
+	{
+		while (false !== ($file = readdir($handle)))
+		{
+			if($file == "English.php")
+			{
+				$plugin_list['file'][] = $path;
+			}
+			if(is_dir($path."/".$file) && $file !== "." && $file !== ".." && $file !== "CVS")
+			{
+				if($file == "English")
+				{
+					$plugin_list['dir'][] = $path;
+				}
+				else
+				{
+						$xx = find_plugins($path."/".$file);
+				}
+			}
+		}
+		return $plugin_list;
+	}
+	return FALSE;
+}
+
+if (e_QUERY)
+{
+	$qs = explode(".", rawurldecode(e_QUERY), 2);
+	$text = show_comparison($qs[0], $qs[1]);
+	$ns->tablerender(LAN_CHECK_3.": {$qs[0]}", $text);
+	require_once("footer.php");
+	exit;
+}
+	
+if ($_POST['check_lang'])
+{
+	$text = check_core_lanfiles($_POST['language']);
+	$ns->tablerender(LAN_CHECK_3.": ".$_POST['language'], $text);
+	require_once("footer.php");
+	exit;
+}
+	
+$ns->tablerender("", show_languages());
+require_once("footer.php");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/language.php 75/e107_admin/language.php
--- 6171/e107_admin/language.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/language.php	2006-04-17 09:52:38.000000000 -0500
@@ -0,0 +1,354 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/language.php,v $
+|     $Revision: 1.30 $
+|     $Date: 2006/04/17 14:52:38 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("ML"))
+{
+	header("location:".e_BASE."index.php");
+	exit;
+}
+
+$e_sub_cat = 'language';
+
+require_once("auth.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+
+$tabs = table_list(); // array("news","content","links");
+$lanlist = explode(",",e_LANLIST);
+$message = "";
+
+
+if (isset($_POST['submit_prefs']) ) {
+
+	$pref['multilanguage'] = $_POST['multilanguage'];
+	$pref['sitelanguage'] = $_POST['sitelanguage'];
+
+	save_prefs();
+	$ns->tablerender(LAN_SAVED, "<div style='text-align:center'>".LAN_SETSAVED."</div>");
+
+}
+
+
+// ----------------- delete tables ---------------------------------------------
+if (isset($_POST['del_existing']) && $_POST['lang_choices']) {
+
+	$lang = strtolower($_POST['lang_choices']);
+	foreach ($tabs as $del_table) {
+		if (db_Table_exists($lang."_".$del_table)) {
+			$qry = "DROP TABLE ".$mySQLprefix."lan_".$lang."_".$del_table;
+		echo $qry;
+			$message .= (mysql_query($qry)) ? $_POST['lang_choices']." ".$del_table." deleted<br />" :
+			 $_POST['lang_choices']." $del_table couldn't be deleted<br />";
+		}
+	}
+	global $cachevar;
+	unset($cachevar['table_list']);
+
+}
+
+// ----------create tables -----------------------------------------------------
+
+if (isset($_POST['create_tables']) && $_POST['language']) {
+
+	$table_to_copy = array();
+	$lang_to_create = array();
+
+
+	foreach ($tabs as $value) {
+		$lang = strtolower($_POST['language']);
+		if (isset($_POST[$value])) {
+            $copdata = ($_POST['copydata_'.$value]) ? 1 : 0;
+			if (copy_table($value, "lan_".$lang."_".$value, $_POST['drop'],$copdata)) {
+				$message .= " ".$_POST['language']." ".$value." created<br />";
+			} else {
+				$message .= (!$_POST['drop'])? " ".$_POST['language']." ".$value." ".LANG_LAN_00."<br />" : $_POST['language']." ".$value." ".LANG_LAN_01."<br />";
+			}
+		} elseif(db_Table_exists($lang."_".$value)) {
+			if ($_POST['remove']) {
+				// Remove table.
+				$message .= (mysql_query("DROP TABLE ".$mySQLprefix."lan_".$lang."_".$value)) ? $_POST['language']." ".$value." ".LAN_DELETED."<br />" :  $_POST['language']." $value ".LANG_LAN_02."<br />";
+			} else {
+				// leave table.
+				$message = $_POST['language']." ".$value." was disabled but left intact.";
+			}
+		}
+	}
+    global $cachevar;
+	unset($cachevar['table_list']);
+}
+
+
+
+	if(isset($message) && $message){
+  		$ns->tablerender(LAN_OK, $message);
+	}
+
+
+// ------------- render form ---------------------------------------------------
+
+if(isset($pref['multilanguage']) && $pref['multilanguage']){
+	$caption = LANG_LAN_16; // language
+	$text = MLAD_LAN_4."<br /><br />";
+
+
+	// Choose Language to Edit:
+	$text = "<div style='text-align:center'>
+	<div style='".ADMIN_WIDTH."; height:150px; overflow:auto; margin-left: auto; margin-right: auto;'>
+	<table class='fborder' style='width:99%; margin-top: 1px;'>
+	<tr><td class='fcaption'>".ADLAN_132."</td>
+	<td class='fcaption'>".LANG_LAN_03."</td>
+	<td class='fcaption'>".LAN_OPTIONS."</td>
+	</tr>\n\n";
+	sort($lanlist);
+	for($i = 0; $i < count($lanlist); $i++) {
+		$installed = 0;
+
+		$text .= "<tr><td class='forumheader3' style='width:30%'>".$lanlist[$i]."</td><td class='forumheader3'>\n";
+		foreach ($tabs as $tab_name) {
+			if (db_Table_exists(strtolower($lanlist[$i])."_".$tab_name)) {
+				$text .= $tab_name.", ";
+				$installed++;
+			}
+		}
+
+		$text .= (!$installed)? "<div style='text-align:center'><i>".LANG_LAN_05."</i></div>" :
+	 	"";
+		$text .= "</td><td class='forumheader3' style='width:10%;white-space:nowrap;text-align:right'>\n";
+		$text .= $rs->form_open("post", e_SELF."?modify", "lang_form_".str_replace(" ", "_", $lanlist[$i]));
+		$text .= "<div style='text-align: center'>\n";
+
+		if ($installed) {
+			$text .= " <input type='submit' class='button' name='edit_existing' value='".LAN_EDIT."' />\n";
+			$text .= " <input type='submit' class='button' name='del_existing' value='".LAN_DELETE."' onclick=\"return jsconfirm('Delete all tables in ".$lanlist[$i]." ?')\" />\n";
+		} else {
+			$text .= "<input type='submit' class='button' name='edit_existing' value='".LAN_CREATE."' />\n";
+		}
+		$text .= "<input type='hidden' name='lang_choices' value='".$lanlist[$i]."' />";
+   		$text .= "</div>";
+		$text .= $rs->form_close();
+		$text .= "</td></tr>";
+
+}
+
+	$text .= "</table></div></div>";
+
+	$ns->tablerender($caption, $text);
+}
+
+if (!$_POST['language'] && !$_POST['edit_existing']) {
+	multilang_prefs();
+}
+unset($text);
+
+// Grab Language configuration. ---
+if ($_POST['edit_existing']) {
+	$text = $rs->form_open("post", e_SELF);
+	$text .= "<div style='text-align:center'>";
+	$text .= "<table class='fborder' style='".ADMIN_WIDTH."'>\n";
+
+	foreach ($tabs as $table_name) {
+		$installed = strtolower($_POST['lang_choices'])."_".$table_name;
+		if (stristr($_POST['lang_choices'], $installed) === FALSE) {
+			$text .= "<tr>
+				<td style='width:30%' class='forumheader3'>".ucfirst(str_replace("_", " ", $table_name))."</td>\n
+				<td style='width:70%' class='forumheader3'>\n";
+			$selected = (db_Table_exists($installed)) ? "checked='checked'" : "";
+			$text .= "<input type=\"checkbox\" id='$table_name' name=\"$table_name\" value=\"1\" $selected onclick=\"if(document.getElementById('$table_name').checked){document.getElementById('datacopy_$table_name').style.display = '';} \"  />";
+			$text .= "<span id='datacopy_$table_name' style='display:none'>".LANG_LAN_15."<input type=\"checkbox\" name=\"copydata_$table_name\" value=\"1\" /> </span>";
+			$text .= "</td></tr>\n";
+		}
+	}
+
+	$text .= "<tr><td class='forumheader3' colspan='2'>&nbsp;";
+	$text .= "<input type='hidden' name='language' value='".$_POST['lang_choices']."' />";
+	$text .= "</td></tr>";
+
+	// ===========================================================================
+
+	// Drop tables ?
+	$text .= "<tr><td class='forumheader3'><b>".LANG_LAN_07."</b></td>
+		<td class='forumheader3'>".$rs->form_checkbox("drop", 1)."\n
+		<span class=\"smalltext\" >".LANG_LAN_08."</span></td></tr>\n
+
+		<tr>
+			<td class='forumheader3'><b>".LANG_LAN_10."</b></td>
+			<td class='forumheader3'>".$rs->form_checkbox("remove", 1)."\n
+	   		<span class=\"smalltext\" >".LANG_LAN_11."</span></td>
+		</tr>
+
+		<tr>
+			<td colspan='2' style='width:100%; text-align: center;' class='forumheader' >";
+
+			$button_capt = LANG_LAN_06. " / ". LAN_UPDATE;
+			$text .="<input type='submit' class='button' name='create_tables' value=\"".$button_capt."\" />";
+
+	   $text .="</td>
+		</tr>
+
+	</table></div>\n";
+
+	$text .= $rs->form_close();
+	$ns->tablerender($_POST['lang_choices'], $text);
+}
+
+require_once(e_ADMIN."footer.php");
+
+// ---------------------------------------------------------------------------
+function multilang_prefs() {
+	global $ns, $pref,$lanlist;
+
+	$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."' id='linkform'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+
+	$text .= "<tr>
+
+		<td style='width:40%' class='forumheader3'>".LANG_LAN_14.": </td>
+		<td style='width:60%; text-align:center' class='forumheader3'>";
+
+
+	$text .= "
+		<select name='sitelanguage' class='tbox'>\n";
+		$sellan = preg_replace("/lan_*.php/i", "", $pref['sitelanguage']);
+		foreach($lanlist as $lan){
+			$sel =  ($lan == $sellan) ? "selected='selected'" : "";
+    		$text .= "<option value='{$lan}' {$sel}>".$lan."</option>\n";
+		}
+
+	$text .= "</select>
+		</td>
+		</tr>";
+
+	$text .= "
+		<tr>
+		<td style='width:40%' class='forumheader3'>".LANG_LAN_12.": </td>
+		<td style='width:60%;text-align:center' class='forumheader3'>";
+	$checked = ($pref['multilanguage'] == 1) ? "checked='checked'" : "";
+	$text .= "<input type='checkbox' name='multilanguage'   value='1' $checked />
+		</td>
+		</tr>
+		";
+
+
+	$text .= "<tr style='vertical-align:top'>
+		<td colspan='2' style='text-align:center' class='forumheader'>";
+	$text .= "<input class='button' type='submit' name='submit_prefs' value='".LAN_SAVE."' />";
+	$text .= "</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+
+	$caption = LANG_LAN_13; // "Language Preferences";
+	$ns->tablerender($caption, $text);
+}
+
+// ----------------------------------------------------------------------------
+
+function db_Table_exists($table)
+{
+	global $mySQLdefaultdb;
+	$tables = getcachedvars("table_list");
+	if(!$tables)
+	{
+		$tablist = mysql_list_tables($mySQLdefaultdb);
+		while($tmp = mysql_fetch_array($tablist))
+		{
+			$tables[] = $tmp[0];
+		}
+		cachevars("table_list", $tables);
+	}
+	return in_array(strtolower(MPREFIX."lan_".$table), $tables);
+}
+// ----------------------------------------------------------------------------
+
+function copy_table($oldtable, $newtable, $drop = FALSE, $data = FALSE)
+{
+	global $sql;
+	$old = MPREFIX.strtolower($oldtable);
+	$new = MPREFIX.strtolower($newtable);
+	if($drop)
+	{
+		$sql->db_Select_gen("DROP TABLE IF EXISTS {$new}");
+	}
+
+	//Get $old table structure
+	$sql->db_Select_gen('SET SQL_QUOTE_SHOW_CREATE = 1');
+	$qry = "SHOW CREATE TABLE {$old}";
+	if($sql->db_Select_gen($qry))
+	{
+		$row = $sql->db_Fetch();
+		$qry = $row[1];
+		$qry = str_replace($old, $new, $qry);
+	}
+	$result = mysql_query($qry);
+	if(!$result)
+	{
+		return FALSE;
+	}
+	if ($data)  //We need to copy the data too
+	{
+		$qry = "INSERT INTO {$new} SELECT * FROM {$old}";
+		$sql->db_Select_gen($qry);
+	}
+	return TRUE;
+}
+
+// ----------------------------------------------------------------------------
+
+function table_list() {
+	// grab default language lists.
+	global $mySQLdefaultdb;
+
+	$exclude[] = "banlist";		$exclude[] = "banner";
+	$exclude[] = "cache";		$exclude[] = "core";
+	$exclude[] = "online";		$exclude[] = "parser";
+	$exclude[] = "plugin";		$exclude[] = "user";
+	$exclude[] = "upload";		$exclude[] = "userclass_classes";
+	$exclude[] = "rbinary";		$exclude[] = "session";
+	$exclude[] = "tmp";	 		$exclude[] = "flood";
+	$exclude[] = "stat_info";	$exclude[] = "stat_last";
+	$exclude[] = "submit_news";	$exclude[] = "rate";
+	$exclude[] = "stat_counter";$exclude[] = "user_extended";
+	$exclude[] = "user_extended_struc";
+	$exclude[] = "pm_messages";
+	$exclude[] = "pm_blocks";
+
+	$tables = mysql_list_tables($mySQLdefaultdb);
+
+	while (list($temp) = mysql_fetch_array($tables))
+	{
+		if(strpos($temp, MPREFIX) === 0)
+		{
+			$e107tab = str_replace(MPREFIX, "", $temp);
+			if (!in_array($e107tab, $exclude) && stristr($e107tab, "lan_") === FALSE)
+			{
+				$tabs[] = $e107tab;
+			}
+		}
+	}
+
+	return $tabs;
+}
+
+// ----------------------------------------------------------------------------
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/links.php 75/e107_admin/links.php
--- 6171/e107_admin/links.php	2004-08-31 08:57:22.000000000 -0500
+++ 75/e107_admin/links.php	2006-03-21 19:58:18.000000000 -0600
@@ -1,687 +1,676 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/e107_admin/links.php,v $
-|     $Revision: 1.25 $
-|     $Date: 2004/08/31 13:57:21 $
-|     $Author: loloirie $
-+----------------------------------------------------------------------------+
-*/
-
-require_once("../class2.php");
-if(!getperms("I")){ header("location:".e_BASE."index.php"); }
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-require_once(e_HANDLER."userclass_class.php");
-require_once(e_HANDLER."form_handler.php");
-$rs = new form;
-$aj = new textparse;
-$linkpost = new links;
-
-$deltest = array_flip($_POST);
-
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
-        unset($tmp);
-}
-if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$etp->unentity(LCLAN_10)],$matches))
-{
-        $delete = $matches[1];
-        $del_id = $matches[2];
-}
-
-if(preg_match("#create_sn_(\d+)#",$deltest[$etp->unentity(LCLAN_14)],$matches))
-{
-	$action='create';
-	$sub_action='sn';
-	$id=$matches[1];
-}
-
-// ##### Main loop -----------------------------------------------------------------------------------------------------------------------
-
-if($action == "dec" && strpos($_SERVER['HTTP_REFERER'],"links"))
-{
-        $qs = explode(".", e_QUERY);
-        $action = $qs[0];
-        $linkid = $qs[1];
-        $link_order = $qs[2];
-        $location = $qs[3];
-        $sql -> db_Update("links", "link_order=link_order-1 WHERE link_order='".($link_order+1)."' AND link_category='$location' ");
-        $sql -> db_Update("links", "link_order=link_order+1 WHERE link_id='$linkid' AND link_category='$location' ");
-        clear_cache("sitelinks");
-        header("location: ".e_ADMIN."links.php?order");
-        exit;
-}
-
-if($action == "inc" && strpos($_SERVER['HTTP_REFERER'],"links"))
-{
-        $qs = explode(".", e_QUERY);
-        $action = $qs[0];
-        $linkid = $qs[1];
-        $link_order = $qs[2];
-        $location = $qs[3];
-        $sql -> db_Update("links", "link_order=link_order+1 WHERE link_order='".($link_order-1)."' AND link_category='$location' ");
-        $sql -> db_Update("links", "link_order=link_order-1 WHERE link_id='$linkid' AND link_category='$location' ");
-        clear_cache("sitelinks");
-        header("location: ".e_ADMIN."links.php?order");
-        exit;
-}
-
-if(IsSet($_POST['create_category'])){
-        $_POST['link_category_name'] = $aj -> formtpa($_POST['link_category_name'], "admin");
-        $sql -> db_Insert("link_category", " '0', '".$_POST['link_category_name']."', '".$_POST['link_category_description']."', '".$_POST['link_category_icon']."'");
-        $linkpost -> show_message(LCLAN_51);
-}
-
-if(IsSet($_POST['update_category'])){
-        $_POST['category_name'] = $aj -> formtpa($_POST['category_name'], "admin");
-        $sql -> db_Update("link_category", "link_category_name ='".$_POST['link_category_name']."', link_category_description='".$_POST['link_category_description']."',  link_category_icon='".$_POST['link_category_icon']."' WHERE link_category_id='".$_POST['link_category_id']."'");
-        $linkpost -> show_message(LCLAN_52);
-}
-
-if(IsSet($_POST['update_order'])){
-        extract($_POST);
-        while(list($key, $id) = each($link_order)){
-                $tmp = explode(".", $id);
-                $sql -> db_Update("links", "link_order=".$tmp[1]." WHERE link_id=".$tmp[0]);
-        }
-        clear_cache("sitelinks");
-        $linkpost -> show_message(LCLAN_6);
-}
-
-if(IsSet($_POST['updateoptions'])){
-        $pref['linkpage_categories'] = $_POST['linkpage_categories'];
-        $pref['link_submit'] = $_POST['link_submit'];
-        $pref['link_submit_class'] = $_POST['link_submit_class'];
-        $pref['linkpage_screentip'] = $_POST['linkpage_screentip'];
-        save_prefs();
-        $linkpost -> show_message(LCLAN_1);
-}
-
-if($action == "order"){
-        $linkpost -> set_order();
-}
-
-if($delete == 'main')
-{
-        if($sql -> db_Delete("links", "link_id='$del_id' "))
-        {
-                clear_cache("sitelinks");
-                $linkpost -> show_message(LCLAN_53." #".$del_id." ".LCLAN_54);
-        }
-}
-
-if($delete == 'category')
-{
-        if($sql -> db_Delete("link_category", "link_category_id='$del_id' "))
-        {
-                $linkpost -> show_message(LCLAN_55." #".$del_id." ".LCLAN_54);
-                unset($id);
-        }
-}
-
-if($delete == "sn")
-{
-	if($sql -> db_Delete("tmp", "tmp_time='$del_id' "))
-	{
-		$linkpost -> show_message(LCLAN_77);
-	}
-}
-
-if($action == "sn")
-{
-	$linkpost -> show_submitted($sub_action, $id);
-}
-
-
-if(IsSet($_POST['add_link'])){
-        $linkpost -> submit_link($sub_action, $id);
-        unset($id);
-}
-
-if($action == "create"){
-        $linkpost -> create_link($sub_action, $id);
-}
-
-if(!e_QUERY || $action == "main"){
-        $linkpost -> show_existing_items();
-}
-
-if($action == "cat"){
-        $linkpost -> show_categories($sub_action, $id);
-}
-
-
-if($action == "opt"){
-        $linkpost -> show_pref_options();
-}
-
-
-
-//$linkpost -> show_options($action);
-
-require_once("footer.php");
-function headerjs(){
-global $etp;
-$headerjs  = "<script type=\"text/javascript\">
-function addtext(sc){
-        document.getElementById('linkform').link_button.value = sc;
-}
-function addtext2(sc){
-        document.getElementById('linkform').link_category_icon.value = sc;
-}
-</script>\n";
-
-$headerjs .= "<script type=\"text/javascript\">
-function confirm_(mode, link_id){
-        if(mode == 'cat'){
-                return confirm(\"".$etp->unentity(LCLAN_56)." [ID: \" + link_id + \"]\");
-        }else if(mode == 'sn'){
-                return confirm(\"".$etp->unentity(LCLAN_57)." [ID: \" + link_id + \"]\");
-        }else{
-                return confirm(\"".$etp->unentity(LCLAN_58)." [ID: \" + link_id + \"]\");
-        }
-}
-</script>";
-return $headerjs;
-}
-
-exit;
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-class links{
-
-        function show_existing_items(){
-                global $sql;
-                if($sql -> db_Select("link_category")){
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $cat[$link_category_id] = $link_category_name;
-                        }
-                }else{
-                        $sql -> db_Insert("link_category", "0, 'Main', 'Any links with this category will be displayed in main navigation bar.', '' ");
-                        $sql -> db_Insert("link_category", "0, 'Misc', 'Miscellaneous links.', '' ");
-                }
-
-                // ##### Display scrolling list of existing links ---------------------------------------------------------------------------------------------------------
-                global $sql, $rs, $ns, $aj;
-                $text = "<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 400px; overflow : auto; '>";
-                if($link_total = $sql -> db_Select("links", "*", "ORDER BY link_category, link_id ASC", "nowhere")){
-                        $text .= "<table class='fborder' style='width:100%'>
-                        <tr>
-                        <td style='width:5%' class='forumheader2'>ID</td>
-                        <td style='width:10%' class='forumheader2'>".LCLAN_59."</td>
-                        <td style='width:50%' class='forumheader2'>".LCLAN_53."</td>
-                        <td style='width:18%' class='forumheader2'>".LCLAN_60."</td>
-                        </tr>";
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $text .= "<tr>
-                                <td style='width:5%' class='forumheader3'>$link_id</td>
-                                <td style='width:10%' class='forumheader3'>".$cat[$link_category]."</td>
-                                <td style='width:50%' class='forumheader3'><a href='".e_BASE."comment.php?comment.news.$link_id'></a>$link_name</td>
-                                <td style='width:25%; text-align:center' class='forumheader3'>".
-                                $rs -> form_open("post", e_SELF,"myform_{$link_id}","",""," onsubmit=\"return confirm_('create',$link_id)\"")."<div>".
-                                $rs -> form_button("button", "main_edit_{$link_id}", LCLAN_9, "onclick=\"document.location='".e_SELF."?create.edit.$link_id'\"")."
-
-                                ".$rs -> form_button("submit", "main_delete_{$link_id}", LCLAN_10)."
-                                </div>".$rs -> form_close()."
-
-                                </td>
-                                </tr>";
-                        }
-//                                $rs -> form_button("submit", "main_delete_{$link_id}", LCLAN_10, "onclick=\"confirm_('create', $link_id)\"")."
-                        $text .= "</table>";
-                }else{
-                        $text .= "<div style='text-align:center'>".LCLAN_61."</div>";
-                }
-                $text .= "</div></div>";
-                $ns -> tablerender(LCLAN_8, $text);
-        }
-
-        function show_options($action){
-                global $sql;
-                // ##### Display options ---------------------------------------------------------------------------------------------------------
-                if($action==""){$action="main";}
-                $var['main']['text']=LCLAN_62;
-                $var['main']['link']=e_SELF;
-
-                $var['create']['text']=LCLAN_63;
-                $var['create']['link']=e_SELF."?create";
-
-                $var['order']['text']=LCLAN_64;
-                $var['order']['link']=e_SELF."?order";
-
-                $var['cat']['text']=LCLAN_65;
-                $var['cat']['link']=e_SELF."?cat";
-                $var['cat']['perm']="8";
-                if($sql -> db_Select("tmp", "*", "tmp_ip='submitted_link' ")){
-                        $var['sn']['text']=LCLAN_66;
-                        $var['sn']['link']=e_SELF."?sn";
-                }
-
-                $var['opt']['text']=LCLAN_67;
-                $var['opt']['link']=e_SELF."?opt";
-
-                $var['sub']['text']=LCLAN_83;
-                $var['sub']['link']="submenusgen.php";
-
-                show_admin_menu(LCLAN_68,$action,$var);
-        }
-
-        function show_message($message){
-                // ##### Display comfort ---------------------------------------------------------------------------------------------------------
-                global $ns;
-                $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-                if($message==LCLAN_3){echo "<script>\nfunction zou(){\nwindow.location='links.php';\n}\nsetTimeout(\"zou()\",10);\n</script>";}
-        }
-
-
-        function create_link($sub_action, $id){
-                global $sql, $rs, $ns;
-
-                if($sub_action == "edit" && !$_POST['submit']){
-                        if($sql -> db_Select("links", "*", "link_id='$id' ")){
-                                $row = $sql-> db_Fetch();
-                                extract($row);
-                        }
-                }
-
-                if($sub_action == "sn"){
-                        if($sql -> db_Select("tmp", "*", "tmp_time='$id'")){
-                                $row = $sql-> db_Fetch();
-                                extract($row);
-                                $submitted = explode("^", $tmp_info);
-                                $link_category = $submitted[0];
-                                $link_name = $submitted[1];
-                                $link_url = $submitted[2];
-                                $link_description = $submitted[3]."\n[i]".LCLAN_82." ".$submitted[5]."[/i]";
-                                $link_button = $submitted[4];
-                        }
-                }
-
-
-
-                $handle=opendir(e_IMAGE."link_icons");
-                while ($file = readdir($handle)){
-                        if($file != "." && $file != ".." && $file != "/"){
-                                $iconlist[] = $file;
-                        }
-                }
-                closedir($handle);
-
-                $text = "<div style='text-align:center'>
-                <form method='post' action='".e_SELF."?".e_QUERY."' id='linkform'>
-                <table style='width:95%' class='fborder'>
-                <tr>
-                <td style='width:30%' class='forumheader3'>".LCLAN_12.": </td>
-                <td style='width:70%' class='forumheader3'>";
-
-                if(!$link_cats = $sql -> db_Select("link_category")){
-                        $text .= LCLAN_13."<br />";
-                }else{
-                        $text .= "
-                        <select name='cat_id' class='tbox'>";
-
-                        while(list($cat_id, $cat_name, $cat_description) = $sql-> db_Fetch()){
-                                if($link_category == $cat_id || ($cat_id == $linkid && $action == "add")){
-                                        $text .= "<option value='$cat_id' selected='selected'>".$cat_name."</option>";
-                                }else{
-                                        $text .= "<option value='$cat_id'>".$cat_name."</option>";
-                                }
-                        }
-                        $text .= "</select>";
-                }
-                $text .= "</td></tr><tr>
-                <td style='width:30%' class='forumheader3'>".LCLAN_15.": </td>
-                <td style='width:70%' class='forumheader3'>
-                <input class='tbox' type='text' name='link_name' size='60' value='$link_name' maxlength='100' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:30%' class='forumheader3'>".LCLAN_16.": </td>
-                <td style='width:70%' class='forumheader3'>
-                <input class='tbox' type='text' name='link_url' size='60' value='$link_url' maxlength='200' />
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:30%' class='forumheader3'>".LCLAN_17.": </td>
-                <td style='width:70%' class='forumheader3'>
-                <textarea class='tbox' name='link_description' cols='59' rows='3'>$link_description</textarea>
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:30%' class='forumheader3'>".LCLAN_18.": </td>
-                <td style='width:70%' class='forumheader3'>
-                <input class='tbox' type='text' name='link_button' size='60' value='$link_button' maxlength='100' />
-
-                <br />
-                <input class='button' type ='button' style='cursor:hand' size='30' value='".LCLAN_39."' onclick='expandit(this)' />
-                <div style='display:none;{head}'>";
-
-
-
-                while(list($key, $icon) = each($iconlist)){
-                        $text .= "<a href='javascript:addtext(\"$icon\")'><img src='".e_IMAGE."link_icons/".$icon."' style='border:0' alt='' /></a> ";
-                }
-
-// 0 = same window
-// 1 = _blank
-// 2 = _parent
-// 3 = _top
-// 4 = miniwindow
-
-                $text .= "</div></td>
-                </tr>
-                <tr>
-                <td style='width:30%' class='forumheader3'>".LCLAN_19.": </td>
-                <td style='width:70%' class='forumheader3'>
-                <select name='linkopentype' class='tbox'>".
-                ($link_open == 0 ? "<option value='0' selected='selected'>".LCLAN_20."</option>" : "<option value='0'>".LCLAN_20."</option>").
-                ($link_open == 1 ? "<option value='1' selected='selected'>".LCLAN_23."</option>" : "<option value='1'>".LCLAN_23."</option>").
-                ($link_open == 4 ? "<option value='4' selected='selected'>".LCLAN_24."</option>" : "<option value='4'>".LCLAN_24."</option>")."
-                </select>
-                </td>
-                </tr>
-                <tr>
-                <td style='width:30%' class='forumheader3'>".LCLAN_25.":<br /><span class='smalltext'>(".LCLAN_26.")</span></td>
-                <td style='width:70%' class='forumheader3'>".r_userclass("link_class",$link_class,"off","public,guest,nobody,member,admin,classes")."
-
-                </td></tr>
-
-
-                <tr style='vertical-align:top'>
-                <td colspan='2' style='text-align:center' class='forumheader'>";
-                if($id && $sub_action == "edit"){
-                        $text .= "<input class='button' type='submit' name='add_link' value='".LCLAN_27."' />\n<input type='hidden' name='link_id' value='$link_id'>";
-                }else{
-                        $text .= "<input class='button' type='submit' name='add_link' value='".LCLAN_28."' />";
-                }
-                $text .= "</td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-                $ns -> tablerender("<div style='text-align:center'>".LCLAN_29."</div>", $text);
-
-        }
-
-
-        function submit_link($sub_action, $id){
-                // ##### Format and submit link ---------------------------------------------------------------------------------------------------------
-                global $aj, $sql;
-                $link_name = $aj -> formtpa($_POST['link_name'], "admin");
-                $link_url = $aj -> formtpa($_POST['link_url'], "admin");
-                $link_description = $aj -> formtpa($_POST['link_description'], "admin");
-                $link_button = $aj -> formtpa($_POST['link_button'], "admin");
-
-                $link_t = $sql -> db_Count("links", "(*)", "WHERE link_category='".$_POST['cat_id']."'");
-
-                if($id && $sub_action != "sn"){
-                        $sql -> db_Update("links", "link_name='$link_name', link_url='$link_url', link_description='$link_description', link_button= '$link_button', link_category='".$_POST['cat_id']."', link_open='".$_POST['linkopentype']."', link_class='".$_POST['link_class']."' WHERE link_id='$id'");
-                        clear_cache("sitelinks");
-                        $this->show_message(LCLAN_3);
-                }else{
-                        $sql -> db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', '".$_POST['cat_id']."', '".($link_t+1)."', '0', '".$_POST['linkopentype']."', '".$_POST['link_class']."'");
-                        clear_cache("sitelinks");
-                        $this->show_message(LCLAN_2);
-                }
-                if($sub_action == "sn"){
-                        $sql -> db_Delete("tmp", "tmp_time='$id' ");
-                }
-        }
-
-
-        function set_order(){
-                global $sql, $ns, $aj;
-                $text = "<div style='text-align:center'>
-                <form method='post' action='".e_SELF."?order'>
-                <table style='width:85%' class='fborder'>";
-
-                $sql -> db_Select("link_category");
-                $sql2 = new db;
-                while(list($link_category_id, $link_category_name, $link_category_description) = $sql-> db_Fetch()){
-                        if($lamount = $sql2 -> db_Select("links", "*", "link_category ='$link_category_id' ORDER BY link_order ASC ")){
-                                $text .= "<tr><td colspan='3' class='forumheader'>$link_category_name ".LCLAN_59."</td></tr>";
-                                while(list($link_id, $link_name, $link_url, $link_description, $link_button, $link_category, $link_order, $link_refer) = $sql2-> db_Fetch()){
-                                        $text .= "<tr>\n<td style='width:30%' class='forumheader3'>".$link_order." - ".$link_name."</td>\n<td style='width:30%; text-align:center' class='forumheader3'>\n<select name='link_order[]' class='tbox'>";
-                                        for($a=1; $a<= $lamount; $a++){
-                                                $text .= ($link_order == $a ? "<option value='$link_id.$a' selected='selected'>$a</option>\n" : "<option value='$link_id.$a'>$a</option>\n");
-                                        }
-
-                                        $text .= "</select> <select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox'>
-                                        <option value='links.php' selected='selected'></option>
-                                        <option value='links.php?inc.".$link_id.".".$link_order.".".$link_category."'>".LCLAN_30."</option>
-                                        <option value='links.php?dec.".$link_id.".".$link_order.".".$link_category."'>".LCLAN_31."</option>
-                                        </select>
-                                        </td>
-                                        <td style='width:40%' class='forumheader3'>&nbsp;".$aj->tpa($link_description)."</td>
-                                        </tr>";
-                                }
-                        }
-                }
-                $text .= "
-                <tr>
-                <td colspan='3' style='text-align:center' class='forumheader'>
-                <input class='button' type='submit' name='update_order' value='".LCLAN_32."' />
-                </td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-
-                $ns -> tablerender(LCLAN_33, $text);
-        }
-
-
-
-        function show_categories($sub_action, $id){
-                // ##### Display scrolling list of existing categories ---------------------------------------------------------------------------------------------------------
-                global $sql, $rs, $ns, $aj;
-                $text = "<div style='border : solid 1px #000; padding : 4px; width :auto; height : 200px; overflow : auto; '>\n";
-                if($category_total = $sql -> db_Select("link_category")){
-                        $text .= "<table class='fborder' style='width:100%'>
-                        <tr>
-                        <td style='width:5%' class='forumheader2'>&nbsp;</td>
-                        <td style='width:75%' class='forumheader2'>".LCLAN_59."</td>
-                        <td style='width:20%; text-align:center' class='forumheader2'>".LCLAN_60."</td>
-                        </tr>";
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-
-                                $text .= "<tr>
-                                <td style='width:5%; text-align:center' class='forumheader3'>".($link_category_icon ? "<img src='".e_IMAGE."link_icons/$link_category_icon' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
-                                <td style='width:75%' class='forumheader3'>$link_category_name<br /><span class='smalltext'>$link_category_description</span></td>
-                                <td style='width:20%; text-align:center' class='forumheader3'>
-                                ".$rs -> form_button("submit", "category_edit_{$link_category_id}", LCLAN_9, "onclick=\"document.location='".e_SELF."?cat.edit.$link_category_id'\"")."
-
-                                ".$rs -> form_open("post", e_SELF,"","",""," onsubmit=\"return confirm_('cat',$link_category_id)\"")."
-                                ".$rs -> form_button("submit", "category_delete_{$link_category_id}", LCLAN_10)."
-                                ".$rs -> form_close()."
-
-                                </td>
-                                </tr>\n";
-                        }
-//                                ".$rs -> form_button("submit", "category_delete_{$link_category_id}", LCLAN_10, "onclick=\"confirm_('cat', '$link_category_id');\"")."
-                        $text .= "</table>";
-                }else{
-                        $text .= "<div style='text-align:center'>".LCLAN_69."</div>";
-                }
-                $text .= "</div>";
-                $ns -> tablerender(LCLAN_70, $text);
-
-                unset($link_category_name, $link_category_description, $link_category_icon);
-
-                $handle=opendir(e_IMAGE."link_icons");
-                while ($file = readdir($handle)){
-                        if($file != "." && $file != ".."){
-                                $iconlist[] = $file;
-                        }
-                }
-                closedir($handle);
-
-                if($sub_action == "edit"){
-                        if($sql -> db_Select("link_category", "*", "link_category_id ='$id' ")){
-                                $row = $sql -> db_Fetch(); extract($row);
-                        }
-                }
-
-                $text = "<div style='text-align:center'>
-                ".$rs -> form_open("post", e_SELF."?cat", "linkform")."
-                <table class='fborder' style='width:auto'>
-                <tr>
-                <td class='forumheader3' style='width:30%'><span class='defaulttext'>".LCLAN_71."</span></td>
-                <td class='forumheader3' style='width:70%'>".$rs -> form_text("link_category_name", 50, $link_category_name, 200)."</td>
-                </tr>
-                <tr>
-                <td class='forumheader3' style='width:30%'><span class='defaulttext'>".LCLAN_72."</span></td>
-                <td class='forumheader3' style='width:70%'>".$rs -> form_text("link_category_description", 60, $link_category_description, 200)."</td>
-                </tr>
-                <tr>
-                <td class='forumheader3' style='width:30%'><span class='defaulttext'>".LCLAN_73."</span></td>
-                <td class='forumheader3' style='width:70%'>
-                ".$rs -> form_text("link_category_icon", 60, $link_category_icon, 100)."
-                <br />
-                <input class='button' type ='button' style='cursor:hand' size='30' value='".LCLAN_80."' onclick='expandit(this)' />
-                <div style='display:none'>";
-                while(list($key, $icon) = each($iconlist)){
-                        $text .= "<a href='javascript:addtext2(\"$icon\")'><img src='".e_IMAGE."link_icons/".$icon."' style='border:0' alt='' /></a> ";
-                }
-                $text .= "</div></td>
-                </tr>
-
-                <tr><td colspan='2' style='text-align:center' class='forumheader'>";
-                if($id){
-                        $text .= "<input class='button' type='submit' name='update_category' value='".LCLAN_74."'>
-                        ".$rs -> form_button("submit", "category_clear", LCLAN_81).
-                        $rs -> form_hidden("link_category_id", $id)."
-                        </td></tr>";
-                }else{
-                        $text .= "<input class='button' type='submit' name='create_category' value='".LCLAN_75."' /></td></tr>";
-                }
-                $text .= "</table>
-                ".$rs -> form_close()."
-                </div>";
-
-                $ns -> tablerender(LCLAN_75, $text);
-        }
-
-
-        function show_submitted($sub_action, $id){
-                global $sql, $rs, $ns, $aj;
-                $text = "<div style='border : solid 1px #000; padding : 4px; width :auto; height : 200px; overflow : auto; '>\n";
-                if($submitted_total = $sql -> db_Select("tmp", "*", "tmp_ip='submitted_link' ")){
-                        $text .= "<table class='fborder' style='width:100%'>
-                        <tr>
-                        <td style='width:50%' class='forumheader2'>".LCLAN_53."</td>
-                        <td style='width:30%' class='forumheader2'>".LCLAN_45."</td>
-                        <td style='width:20%; text-align:center' class='forumheader2'>".LCLAN_60."</td>
-                        </tr>";
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $submitted = explode("^", $tmp_info);
-                                if(!strstr($submitted[2], "http")){ $submitted[2] = "http://".$submitted[2]; }
-                                $text .= "<tr>
-                                <td style='width:50%' class='forumheader3'><a href='".$submitted[2]."' rel='external'>".$submitted[2]."</a></td>
-                                <td style='width:30%' class='forumheader3'>".$submitted[5]."</td>
-                                <td style='width:20%; text-align:center; vertical-align:top' class='forumheader3'><div>
-                                ".$rs -> form_open("post", e_SELF."?sn","submitted_links")."
-                                ".$rs -> form_button("submit", "create_sn_{$tmp_time}", LCLAN_14, "onclick=\"document.location='".e_SELF."?create.sn.$tmp_time'\"")."
-                                ".$rs -> form_button("submit", "sn_delete_{$tmp_time}", LCLAN_10, "onclick=\"confirm_('sn', $tmp_time);\"")."
-                                </div>".$rs -> form_close()."
-                                </td>
-                                </tr>\n";
-                        }
-                        $text .= "</table>";
-                }else{
-                        $text .= "<div style='text-align:center'>".LCLAN_76."</div>";
-                }
-                $text .= "</div>";
-                $ns -> tablerender(LCLAN_66, $text);
-        }
-
-        function show_pref_options(){
-                global $pref, $ns;
-                $text = "<div style='text-align:center'>
-                <form method='post' action='".e_SELF."?".e_QUERY."'>\n
-                <table style='width:auto' class='fborder'>
-                <tr>
-                <td style='width:70%' class='forumheader3'>
-                ".LCLAN_40."<br />
-                <span class='smalltext'>".LCLAN_34."</span>
-                </td>
-                <td class='forumheader2' style='width:30%;text-align:center'>".
-                ($pref['linkpage_categories'] ? "<input type='checkbox' name='linkpage_categories' value='1' checked='checked' />" : "<input type='checkbox' name='linkpage_categories' value='1' />")."
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:70%' class='forumheader3'>
-                ".LCLAN_78."<br />
-                <span class='smalltext'>".LCLAN_79."</span>
-                </td>
-                <td class='forumheader2' style='width:30%;text-align:center'>".
-                ($pref['linkpage_screentip'] ? "<input type='checkbox' name='linkpage_screentip' value='1' checked='checked' />" : "<input type='checkbox' name='linkpage_screentip' value='1' />")."
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:70%' class='forumheader3'>
-                ".LCLAN_41."<br />
-                <span class='smalltext'>".LCLAN_42."</span>
-                </td>
-                <td class='forumheader2' style='width:30%;text-align:center'>".
-                ($pref['link_submit'] ? "<input type='checkbox' name='link_submit' value='1' checked='checked' />" : "<input type='checkbox' name='link_submit' value='1' />")."
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:70%' class='forumheader3'>
-                ".LCLAN_43."<br />
-                <span class='smalltext'>".LCLAN_44."</span>
-                </td>
-                <td class='forumheader2' style='width:30%;text-align:center'>".r_userclass("link_submit_class", $pref['link_submit_class'])."</td>
-                </tr>
-
-                <tr style='vertical-align:top'>
-                <td colspan='2'  style='text-align:center' class='forumheader'>
-                <input class='button' type='submit' name='updateoptions' value='".LCLAN_35."' />
-                </td>
-                </tr>
-
-                </table>
-                </form>
-                </div>";
-                $ns -> tablerender(LCLAN_36, $text);
-        }
-
-
-}
-
-function links_adminmenu(){
-        global $linkpost;
-        global $action;
-        $linkpost -> show_options($action);
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/links.php,v $
+|     $Revision: 1.55 $
+|     $Date: 2006/03/22 01:58:18 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once('../class2.php');
+if (!getperms('I')) {
+	header('location:'.e_BASE.'index.php');
+}
+
+$e_sub_cat = 'links';
+
+if (!is_object($tp)) $tp = new e_parse;
+
+// ----- Presets.----------
+require_once(e_HANDLER."preset_class.php");
+$pst = new e_preset;
+$pst->form = "linkform";
+$pst->page = "links.php?create";
+$pst->id = "admin_links";
+require_once('auth.php');
+// --------------------
+$pst->save_preset();
+
+require_once(e_HANDLER.'userclass_class.php');
+require_once(e_HANDLER.'form_handler.php');
+
+$rs = new form;
+$linkpost = new links;
+
+if (e_QUERY) {
+	$tmp = explode('.', e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	$id = $tmp[2];
+	unset($tmp);
+}
+
+foreach(array_keys($_POST) as $k)
+{
+	if (preg_match("#(.*?)_delete_(\d+)(.*)#", $k, $matches))
+	{
+		$delete = $matches[1];
+		$del_id = $matches[2];
+	}
+}
+
+if(isset($_POST['generate_sublinks']) && isset($_POST['sublink_type']) && $_POST['sublink_parent'] !="" ){
+
+	$subtype = $_POST['sublink_type'];
+	$sublink = $linkpost->sublink_list($subtype);
+    if(!is_object($sql2)){
+    	$sql2 = new db;
+	}
+
+	$sql -> db_Select("links", "*", "link_id = '".$_POST['sublink_parent']."'");
+	$par = $sql-> db_Fetch();
+	extract($par);
+
+	$sql -> db_Select($sublink['table'], "*", $sublink['query']);
+	$count = 1;
+	while($row = $sql-> db_Fetch()){
+		$subcat = $row[($sublink['fieldid'])];
+		$name = $row[($sublink['fieldname'])];
+		$subname = "submenu.$link_name.$name";
+		$suburl = str_replace("#",$subcat,$sublink['url']);
+		$subicon = ($sublink['fieldicon']) ? $row[($sublink['fieldicon'])] : $link_button;
+		$subdiz = ($sublink['fielddiz']) ? $row[($sublink['fielddiz'])] : $link_description;
+		$subparent = $_POST['sublink_parent'];
+
+		if($sql2->db_Insert("links", "0, '$subname', '$suburl', '$subdiz', '$subicon', '$link_category', '$count', '$subparent', '$link_open', '$link_class' ")){
+			$message .= LAN_CREATED. " ($name)<br />";
+		}else{
+			$message .= LAN_CREATED_FAILED. " ($name)<br />";
+		}
+		$count++;
+	}
+
+    if($message){
+		$ns -> tablerender(LAN_CREATED, $message);
+	}
+}
+
+if (isset($_POST['inc'])) {
+	$qs = explode(".", $_POST['inc']);
+	$linkid = $qs[0];
+	$link_order = $qs[1];
+	$sql->db_Update("links", "link_order=link_order+1 WHERE link_order='".($link_order-1)."'");
+	$sql->db_Update("links", "link_order=link_order-1 WHERE link_id='".$linkid."'");
+}
+
+if (isset($_POST['dec'])) {
+	$qs = explode(".", $_POST['dec']);
+	$linkid = $qs[0];
+	$link_order = $qs[1];
+	$sql->db_Update("links", "link_order=link_order-1 WHERE link_order='".($link_order+1)."'");
+	$sql->db_Update("links", "link_order=link_order+1 WHERE link_id='".$linkid."'");
+}
+
+if (isset($_POST['update'])) {
+
+	foreach ($_POST['link_order'] as $loid) {
+		$tmp = explode(".", $loid);
+		$sql->db_Update("links", "link_order=".$tmp[1]." WHERE link_id=".$tmp[0]);
+	}
+	foreach ($_POST['link_class'] as $lckey => $lcid) {
+	 	$sql->db_Update("links", "link_class='".$lcid."' WHERE link_id=".$lckey);
+	}
+	$e107cache->clear("sitelinks");
+	$linkpost->show_message(LAN_UPDATED);
+}
+
+if (isset($_POST['updateoptions'])) {
+	$pref['linkpage_screentip'] = $_POST['linkpage_screentip'];
+	$pref['sitelinks_expandsub'] = $_POST['sitelinks_expandsub'];
+	save_prefs();
+	$linkpost->show_message(LCLAN_1);
+}
+
+if ($delete == 'main')
+{
+	if($sql->db_Select("links", "link_id, link_name, link_order", "link_id='".$del_id."'")){
+		$row = $sql->db_Fetch();
+		$msg = $linkpost->delete_link($row);
+
+		if($msg){
+			$e107cache->clear("sitelinks");
+			$linkpost->show_message($msg);
+		}
+	}
+}
+
+if (isset($_POST['add_link'])) {
+	$linkpost->submit_link($sub_action, $_POST['link_id']);
+	unset($id);
+}
+
+$linkArray = $linkpost->getLinks();
+
+if ($action == 'create') {
+	$linkpost->create_link($sub_action, $id);
+}
+
+
+if (!e_QUERY || $action == 'main') {
+	$linkpost->show_existing_items();
+}
+
+if ($action == 'opt') {
+	$linkpost->show_pref_options();
+}
+
+if($action == "sublinks"){
+  $linkpost->show_sublink_generator();
+}
+
+require_once('footer.php');
+exit;
+
+// End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+class links
+{
+	var $link_total;
+	
+	function getLinks()
+	{
+		global $sql;
+		if($this->link_total = $sql->db_Select("links", "*", "ORDER BY link_order, link_id ASC", "nowhere"))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				$ret[$row['link_parent']][] = $row;
+			}
+		}
+		return $ret;
+	}
+
+
+	function linkName($text)
+	{
+		if(substr($text, 0, 8) == "submenu.")
+		{
+			$tmp = explode(".",$text);
+			return $tmp[2];
+		}
+		else
+		{
+			return $text;
+		}
+	}
+
+	function dropdown($curval="", $id=0, $indent=0)
+	{
+		global $linkArray;
+		if(0 == $indent) {$ret = "<option value=''>".LINKLAN_3."</option>\n";}
+		foreach($linkArray[$id] as $l)
+		{
+			$s = ($l['link_id'] == $curval ? " selected='selected' " : "" );
+			$ret .= "<option value='{$l['link_id']}|".$this->linkName($l['link_name'])."' {$s}>".str_pad("", $indent*36, "&nbsp;").$this->linkName($l['link_name'])."</option>\n";
+			if(array_key_exists($l['link_id'], $linkArray))
+			{
+				$ret .= $this->dropdown($curval, $l['link_id'], $indent+1);
+			}
+		}
+		return $ret;
+	}
+			
+
+	function existing($id=0, $level=0)
+	{
+		global $linkArray;
+		$ret = "";
+		foreach($linkArray[$id] as $l)
+		{
+			$s = ($l['link_parent'] == $curval ? " selected='selected' " : "" );
+			$ret .= $this->display_row($l, $level);
+			if(array_key_exists($l['link_id'], $linkArray))
+			{
+				$ret .= $this->existing($l['link_id'], $level+1);
+			}
+		}
+		return $ret;
+	}
+
+	function show_existing_items()
+	{
+		global $sql, $rs, $ns, $tp, $linkArray;
+		if (count($linkArray))
+		{
+			$text = $rs->form_open("post", e_SELF, "myform_{$link_id}", "", "");
+			$text .= "<div style='text-align:center'>
+				<table class='fborder' style='".ADMIN_WIDTH."'>
+				<tr>
+				<td class='fcaption' style='width:5%'>".LCLAN_89."</td>
+				<td class='fcaption' style='width:60%'>".LCLAN_90."</td>
+				<td class='fcaption' style='width:15%'>".LAN_OPTIONS."</td>
+				<td class='fcaption' style='width:10%'>".LCLAN_95."</td>
+				<td class='fcaption' style='width:5%'>".LCLAN_91."</td>
+				<td class='fcaption' style='width:5%'>".LAN_ORDER."</td>
+				</tr>";
+				$text .= $this->existing(0);
+				
+			$text .= "<tr>
+				<td class='forumheader' colspan='6' style='text-align:center'><input class='button' type='submit' name='update' value='".LAN_UPDATE."' /></td>
+				</tr>";
+			$text .= "</table></div>";
+			$text .= $rs->form_close();
+		} else {
+			$text .= "<div style='text-align:center'>".LCLAN_61."</div>";
+		}
+		$ns->tablerender(LCLAN_8, $text);
+	}
+
+	function display_row($row2, $indent = FALSE) {
+		global $sql, $rs, $ns, $tp, $linkArray;
+		extract($row2);
+		if(strpos($link_name, "submenu.") !== FALSE || $link_parent !=0){
+			if(substr($link_name,0,8) == "submenu."){
+				$tmp = explode(".",$link_name);
+				$sublinkname = $tmp[2];
+			}else{
+			$sublinkname = $link_name;
+			}
+			$link_name = $sublinkname;
+		}
+
+		if ($indent) {
+			$subimage = "<img src='".e_IMAGE."admin_images/sublink.png' alt='' />";
+			$subspacer = ($indent > 1) ? " style='padding-left: ".(($indent - 1) * 16)."px'" : "";
+			$subindent = "<td".$subspacer.">".$subimage."</td>";
+		}
+
+				$text .= "<tr><td class='forumheader3' style='width:5%; text-align: center; vertical-align: middle' title='".$link_description."'>";
+				$text .= $link_button ? "<img src='".e_IMAGE."icons/".$link_button."' alt='' /> ":
+				"";
+				$text .= "</td><td style='width:60%' class='forumheader3' title='".$link_description."'>
+				<table cellspacing='0' cellpadding='0' border='0' style='width: 100%'>
+				<tr>
+				".$subindent."
+				<td style='".($indent ? "" : "font-weight:bold;")."width: 100%'>".$link_name."</td>
+				</tr>
+				</table>
+				</td>";
+				$text .= "<td style='width:15%; text-align:center; white-space: nowrap' class='forumheader3'>";
+				$text .= "<a href='".e_SELF."?create.sub.{$link_id}'><img src='".e_IMAGE."admin_images/sublink_16.png' title='".LINKLAN_10."' alt='".LINKLAN_10."' /></a>&nbsp;";
+				$text .= "<a href='".e_SELF."?create.edit.{$link_id}'>".ADMIN_EDIT_ICON."</a>&nbsp;";
+				$text .= "<input type='image' title='".LAN_DELETE."' name='main_delete_{$link_id}' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(LCLAN_58." [ $link_name ]")."') \" />";
+				$text .= "</td>";
+				$text .= "<td style='width:10%; text-align:center' class='forumheader3'>".r_userclass("link_class[".$link_id."]", $link_class, "off", "public,guest,nobody,member,admin,classes")."</td>";
+				$text .= "<td style='width:5%; text-align:center; white-space: nowrap' class='forumheader3'>";
+				$text .= "<input type='image' src='".e_IMAGE."admin_images/up.png' title='".LCLAN_30."' value='".$link_id.".".$link_order."' name='inc' />";
+				$text .= "<input type='image' src='".e_IMAGE."admin_images/down.png' title='".LCLAN_31."' value='".$link_id.".".$link_order."' name='dec' />";
+				$text .= "</td>";
+				$text .= "<td style='width:5%; text-align:center' class='forumheader3'>";
+				$text .= "<select name='link_order[]' class='tbox'>\n";
+				for($a = 1; $a <= $this->link_total; $a++) {
+					$selected = ($link_order == $a) ? "selected='selected'" : "";
+					$text .= "<option value='".$link_id.".".$a."' $selected>".$a."</option>\n";
+				}
+				$text .= "</select>";
+				$text .= "</td>";
+				$text .= "</tr>";
+
+	return $text;
+
+	}
+
+	function show_message($message) {
+		global $ns;
+		$ns->tablerender(LAN_UPDATE, "<div style='text-align:center'><b>".$message."</b></div>");
+	}
+
+	function create_link($sub_action, $id) {
+		global $sql, $rs, $ns, $pst;
+		$preset = $pst->read_preset("admin_links");
+		extract($preset);
+
+		if ($sub_action == "edit" && !$_POST['submit'])
+		{
+			if ($sql->db_Select("links", "*", "link_id='$id' "))
+			{
+				$row = $sql->db_Fetch();
+				extract($row);
+			}
+		}
+
+		if("sub" == $sub_action)
+		{
+			$link_parent = $id;
+		}
+
+		if(strpos($link_name, "submenu.") !== FALSE){
+			$tmp = explode(".",$link_name);
+			$link_name = $tmp[2];
+		}
+
+		$handle = opendir(e_IMAGE."icons");
+		while ($file = readdir($handle)) {
+			if ($file != "." && $file != ".." && $file != "/" && $file != "CVS") {
+				$iconlist[] = $file;
+			}
+		}
+		closedir($handle);
+
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."' id='linkform'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+		$text .= "<tr>
+			<td style='width:30%' class='forumheader3'>".LINKLAN_2.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<select class='tbox' name='link_parent' >";
+			$text .= $this->dropdown($link_parent);
+
+		$text .= "</select></td>
+			</tr>
+			<tr>
+			<td style='width:30%' class='forumheader3'>".LCLAN_15.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<input class='tbox' type='text' name='link_name' size='60' value='$link_name' maxlength='100' />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".LCLAN_16.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<input class='tbox' type='text' name='link_url' size='60' value='$link_url' maxlength='200' />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".LCLAN_17.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<textarea class='tbox' name='link_description' cols='59' rows='3'>$link_description</textarea>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".LCLAN_18.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<input class='tbox' type='text' id='link_button' name='link_button' size='42' value='$link_button' maxlength='100' />
+
+					<input class='button' type ='button' style='cursor:hand' size='30' value='".LCLAN_39."' onclick='expandit(this)' />
+			<div id='linkicn' style='display:none;{head}'>";
+
+		while (list($key, $icon) = each($iconlist)) {
+			$text .= "<a href=\"javascript:insertext('$icon','link_button','linkicn')\"><img src='".e_IMAGE."icons/".$icon."' style='border:0' alt='' /></a> ";
+		}
+
+		// 1 = _blank
+		// 2 = _parent   not in use.
+		// 3 = _top   not in use.
+		$linkop[0] = LCLAN_20;  // 0 = same window
+		$linkop[1] = LCLAN_23;
+		$linkop[4] = LCLAN_24;  // 4 = miniwindow  600x400
+		$linkop[5] = LINKLAN_1;  // 5 = miniwindow  800x600
+
+		$text .= "</div></td>
+			</tr>
+			<tr>
+			<td style='width:30%' class='forumheader3'>".LCLAN_19.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<select name='linkopentype' class='tbox'>\n";
+			foreach($linkop as $key=>$val){
+				$selectd = ($link_open == $key) ? "selected='selected'" : "";
+				$text .= "<option value='$key' $selectd>".$val."</option>\n";
+			}
+
+			$text .="</select>
+			</td>
+			</tr>
+			<tr>
+			<td style='width:30%' class='forumheader3'>".LCLAN_12.": </td>
+			<td style='width:70%' class='forumheader3'>
+			<select name='linkrender' class='tbox'>";
+			$rentype = array("","Main","Alt","Alt", "Alt");
+			for ($i=1; $i<count($rentype); $i++) {
+				$sel = ($link_category == $i) ? "selected='selected'" : "";
+				$text .="<option value='$i' $sel>$i - ".$rentype[$i]."</option>";
+			};
+
+			$text .="</select><span class='smalltext'> ".LCLAN_96." {SITELINKS=flat:[rendertype number]}</span>
+			</td>
+			</tr>
+			<tr>
+			<td style='width:30%' class='forumheader3'>".LCLAN_25.":<br /><span class='smalltext'>(".LCLAN_26.")</span></td>
+			<td style='width:70%' class='forumheader3'>".r_userclass("link_class", $link_class, "off", "public,guest,nobody,member,admin,classes")."
+			</td></tr>
+
+			<tr style='vertical-align:top'>
+			<td colspan='2' style='text-align:center' class='forumheader'>";
+		if ($id && $sub_action == "edit") {
+			$text .= "<input class='button' type='submit' name='add_link' value='".LCLAN_27."' />\n<input type='hidden' name='link_id' value='$link_id'>";
+		} else {
+			$text .= "<input class='button' type='submit' name='add_link' value='".LCLAN_28."' />";
+		}
+		$text .= "</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+		$ns->tablerender(LCLAN_29, $text);
+	}
+
+	function submit_link($sub_action, $id) {
+		global $sql, $e107cache, $tp;
+		if(!is_object($tp)) {
+			$tp=new e_parse;
+		}
+		$_POST['link_name'] = $tp->toDB($_POST['link_name']);
+		if($_POST['link_parent']){
+			$tmp = explode("|",$_POST['link_parent']);
+			$link_name = $tp->toDB(("submenu.".$tmp[1].".".$_POST['link_name']));
+			$parent_id = intval($tmp[0]);
+		}else{
+			$parent_id = 0;
+			$link_name = $_POST['link_name'];
+		}
+		$link_url = $tp->toDB($_POST['link_url']);
+		$link_description = $tp->toDB($_POST['link_description']);
+		$link_button = $tp->toDB($_POST['link_button']);
+
+		$link_t = $sql->db_Count("links", "(*)");
+		if ($id) {
+			$sql->db_Update("links", "link_parent='$parent_id', link_name='$link_name', link_url='$link_url', link_description='$link_description', link_button= '$link_button', link_category='".$_POST['linkrender']."', link_open='".$_POST['linkopentype']."', link_class='".$_POST['link_class']."' WHERE link_id='$id'");
+			//rename all sublinks
+			if($sql->db_Select("links", "*", "link_parent='{$id}'"))
+			{
+				$childList = $sql->db_getList();
+				foreach($childList as $c)
+				{
+					$old = explode(".", $c['link_name'], 3);
+					$newname = "submenu.".$_POST['link_name'].".".$old[2];
+					$sql->db_Update("links", "link_name = '{$newname}' WHERE link_id = '{$c['link_id']}'");
+				}
+			}
+
+			$e107cache->clear("sitelinks");
+			$this->show_message(LCLAN_3);
+		} else {
+			$sql->db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', ".$_POST['linkrender'].", ".($link_t+1).", ".$parent_id.", ".$_POST['linkopentype'].", ".$_POST['link_class']);
+			$e107cache->clear("sitelinks");
+			$this->show_message(LCLAN_2);
+		}
+	}
+
+	function show_pref_options() {
+		global $pref, $ns;
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='width:70%' class='forumheader3'>
+			".LCLAN_78."<br />
+			<span class='smalltext'>".LCLAN_79."</span>
+			</td>
+			<td class='forumheader3' style='width:30%;text-align:center'>". ($pref['linkpage_screentip'] ? "<input type='checkbox' name='linkpage_screentip' value='1' checked='checked' />" : "<input type='checkbox' name='linkpage_screentip' value='1' />")."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:70%' class='forumheader3'>
+			".LCLAN_80."<br />
+			<span class='smalltext'>".LCLAN_81."</span>
+			</td>
+			<td class='forumheader3' style='width:30%;text-align:center'>". ($pref['sitelinks_expandsub'] ? "<input type='checkbox' name='sitelinks_expandsub' value='1' checked='checked' />" : "<input type='checkbox' name='sitelinks_expandsub' value='1' />")."
+			</td>
+			</tr>
+
+
+
+			<tr style='vertical-align:top'>
+			<td colspan='2' style='text-align:center' class='forumheader'>
+			<input class='button' type='submit' name='updateoptions' value='".LAN_UPDATE."' />
+			</td>
+			</tr>
+
+			</table>
+			</form>
+			</div>";
+		$ns->tablerender(LCLAN_88, $text);
+	}
+
+	function delete_link($linkInfo)	{
+		global $sql;
+
+		if ($sql->db_Select("links", "link_id", "link_order > '{$linkInfo['link_order']}'")){
+			$linkList = $sql->db_getList();
+			foreach($linkList as $l){
+				$sql->db_Update("links", "link_order = link_order -1 WHERE link_id = '{$l['link_id']}'");
+			}
+		}
+
+
+		if ($sql->db_Delete("links", "link_id='".$linkInfo['link_id']."'")){
+			// Update ophaned sublinks.
+			$sql->db_Update("links", "link_name = SUBSTRING_INDEX(link_name, '.', -1) , link_parent = '0', link_class='255' WHERE link_parent= '".$linkInfo['link_id']."'");
+
+			return LCLAN_53." #".$linkInfo['link_id']." ".LCLAN_54."<br />";
+		}else{
+        	return DELETED_FAILED;
+		}
+
+
+	}
+
+// -------------------------- Sub links generator ------------->
+
+function show_sublink_generator() {
+	global $ns,$sql;
+
+    $sublinks = $this->sublink_list();
+
+	$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>
+	".LINKLAN_6."<br />
+	</td>
+	<td class='forumheader3' style='width:50%;text-align:center'>
+	<select name='sublink_type' class='tbox'>\n
+	<option value=''></option>";
+    foreach($sublinks as $key=>$type){
+    	$text .= "<option value='$key'>".$type['title']."</option>\n";
+	}
+	$text .="</select>\n
+	</td>
+	</tr>
+
+    	<tr>
+	<td style='width:50%' class='forumheader3'>
+	".LINKLAN_7."<br />
+	</td>
+	<td class='forumheader3' style='width:50%;text-align:center'>
+	<select name='sublink_parent' class='tbox'>\n
+	<option value=''></option>";
+    $sql -> db_Select("links", "*", "link_parent='0' ORDER BY link_name ASC");
+	while($row = $sql-> db_Fetch()){
+		$text .= "<option value='".$row['link_id']."'>".$row['link_name']."</option>\n";
+	}
+	$text .="</select>\n
+	</td>
+	</tr>
+
+	<tr style='vertical-align:top'>
+	<td colspan='2' style='text-align:center' class='forumheader'>
+	<input class='button' type='submit' name='generate_sublinks' value='".LINKLAN_5."' />
+	</td>
+	</tr>
+
+	</table>
+	</form>
+	</div>";
+	$ns->tablerender("Sublinks Generator", $text);
+}
+
+
+
+function sublink_list($name=""){
+    global $sql,$PLUGINS_DIRECTORY;
+	$sublink_type['news']['title'] = LINKLAN_8; // "News Categories";
+	$sublink_type['news']['table'] = "news_category";
+	$sublink_type['news']['query'] = "category_id !='-2' ORDER BY category_name ASC";
+	$sublink_type['news']['url'] = "news.php?cat.#";
+	$sublink_type['news']['fieldid'] = "category_id";
+	$sublink_type['news']['fieldname'] = "category_name";
+	$sublink_type['news']['fieldicon'] = "category_icon";
+
+	$sublink_type['downloads']['title'] = LINKLAN_9; //"Download Categories";
+	$sublink_type['downloads']['table'] = "download_category";
+	$sublink_type['downloads']['query'] = "download_category_parent ='0' ORDER BY download_category_name ASC";
+	$sublink_type['downloads']['url'] =   "download.php?list.#";
+	$sublink_type['downloads']['fieldid'] = "download_category_id";
+	$sublink_type['downloads']['fieldname'] = "download_category_name";
+	$sublink_type['downloads']['fieldicon'] = "download_category_icon";
+
+
+	if ($sql -> db_Select("plugin", "plugin_path", "plugin_installflag = '1'")) {
+		while ($row = $sql -> db_Fetch()) {
+			$sublink_plugs[] = $row['plugin_path'];
+		}
+	}
+
+	foreach ($sublink_plugs as $plugin_id) {
+		if (is_readable(e_PLUGIN.$plugin_id.'/e_linkgen.php')) {
+		  	require_once(e_PLUGIN.$plugin_id.'/e_linkgen.php');
+		}
+	}
+    if($name){
+    	return $sublink_type[$name];
+	}
+
+	return $sublink_type;
+
+}
+
+}
+
+function links_adminmenu() {
+	global $action;
+	if ($action == "") {
+		$action = "main";
+	}
+	$var['main']['text'] = LCLAN_62;
+	$var['main']['link'] = e_SELF;
+
+	$var['create']['text'] = LCLAN_63;
+	$var['create']['link'] = e_SELF."?create";
+
+	$var['opt']['text'] = LAN_OPTIONS;
+	$var['opt']['link'] = e_SELF."?opt";
+
+	$var['sub']['text'] = LINKLAN_4;
+	$var['sub']['link'] = e_SELF."?sublinks";
+
+	show_admin_menu(LCLAN_68, $action, $var);
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/log.php 75/e107_admin/log.php
--- 6171/e107_admin/log.php	2004-05-18 22:32:30.000000000 -0500
+++ 75/e107_admin/log.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,112 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/log_conf.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("S")){ header("location:".e_BASE."index.php"); exit;}
-
-if(IsSet($_POST['updatesettings'])){
-
-        $pref['log_activate'] = $_POST['log_activate'];
-        $pref['log_refertype'] = $_POST['refertype'];
-        $pref['log_lvcount'] = $_POST['lvcount'];
-        save_prefs();
-        header("location:".e_SELF."?u");
-        exit;
-}
-
-if(e_QUERY == "u"){
-        $message = LOGLAN_1;
-}
-
-require_once("auth.php");
-
-if(IsSet($_POST['wipe'])){
-
-        if(IsSet($_POST['log_wipe_info'])){
-                $sql -> db_Delete("stat_info", "");
-                $sql -> db_Delete("stat_last", "");
-        }
-        if(IsSet($_POST['log_wipe_counter'])){
-                $sql -> db_Delete("stat_counter", "");
-        }
-
-        $message = LOGLAN_2;
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$log_activate = $pref['log_activate'];
-$lvcount = $pref['log_lvcount'];
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:85%' class='fborder'>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LOGLAN_3.": </td>
-<td style='width:70%' class='forumheader3'>";
-if($log_activate == 1){
-        $text .= "<input type='checkbox' name='log_activate' value='1'  checked='checked' />";
-}else{
-        $text .= "<input type='checkbox' name='log_activate' value='1' />";
-}
-
-$text .= "</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LOGLAN_4.": </td>
-<td style='width:70%' class='forumheader3'>";
-
-if($pref['log_refertype'] == 0){
-        $text .= LOGLAN_5.": <input type='radio' name='refertype' value='0' checked='checked' />
-        ".LOGLAN_6.": <input type='radio' name='refertype' value='1' />";
-}else{
-        $text .= LOGLAN_5.": <input type='radio' name='refertype' value='0' />
-        ".LOGLAN_6.": <input type='radio' name='refertype' value='1' checked='checked' />";
-}
-
-$text .= "</td></tr>
-<tr>
-<td style='width:30%' class='forumheader3'>".LOGLAN_7.": </td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='lvcount' size='10' value='$lvcount' maxlength='5' />
-</td>
-</tr>
-
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LOGLAN_8.": </td>
-<td style='width:70%' class='forumheader3'>
-<input type='checkbox' name='log_wipe_info' value='1' /> ".LOGLAN_9."<br />
-<input type='checkbox' name='log_wipe_counter' value='1' /> ".LOGLAN_10."<br />
-<input class='button' type='submit' name='wipe' value='".LOGLAN_11."' />
-</td>
-</tr>
-
-<tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='updatesettings' value='".LOGLAN_12."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".LOGLAN_13."</div>", $text);
-require_once("footer.php");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_admin/mailout.php 75/e107_admin/mailout.php
--- 6171/e107_admin/mailout.php	2004-07-25 17:56:56.000000000 -0500
+++ 75/e107_admin/mailout.php	2006-05-12 17:50:40.000000000 -0500
@@ -1,296 +1,782 @@
-<?php
-/*  User-Mailout for the e107 core release. .
- This code is experimental
- Still to be added:
-  - pulldown menu with a list of files in the download area.
-  - the {USERNAME} stuff.
-  - bulk mailing with BCC option.. ?
-  - confirm number of recipients, before sending.
-
-*/
-
-require_once("../class2.php");
-require_once(e_ADMIN."auth.php");
-require_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_users.php");
-
-require_once(e_HANDLER."userclass_class.php");
-    if($pref['htmlarea']){
-    require_once(e_HANDLER."htmlarea/htmlarea.inc.php");
-    htmlarea('email_body');
-    }
-
-$send_amount = 5; // amount of people in BCC per email.
-
-
-
-
-
-
-
-
-if(IsSet($_POST['submit'])){
-
-
-    if($_POST['email_to'] == "all"){   // send to all.
-
-       $sql -> db_Select("user", "user_name, user_email, user_class", "ORDER BY user_name", "no-where");
-       $c=0;
-           while($row = $sql -> db_Fetch()){
-               extract($row);
-               $recipient_name[$c] = $user_name;
-               $recipient[$c]= $user_email;
-               $c++;
-           }
-    }else{       // send to a user-class.
-
-        $sql -> db_Select("user", "user_name, user_email, user_class", "ORDER BY user_name", "no-where");
-        $c=0;
-        while($row = $sql -> db_Fetch()){
-            extract($row);
-                if(check_class($_POST['email_to'], $user_class)){
-                    $recipient_name[$c] = $user_name;
-                    $recipient[$c]= $user_email;
-                    $c++;
-                }
-
-        }  // end while
-
-    }
-// ===================
-
-   /* $text = "<div style='text-align:center'>
-   <form method='post' action='".e_SELF."' id='confirmform'>
-   You have chosen to send an email to <b>$c</b> users<br />
-   Are you sure you want to continue ?<br />
-   <input type='submit' class='button' value='submit' name='Yes'>
-   <input type='hidden' name='";*/
-
-
-      /*
-            $chunk=0;
-            for ($j=0; $i<count($recipients); $j++) {
-            $bcc_bulk = "";
-            for ($i=($chunk); $i<($chunk+$amount); $i++) {
-            $bcc_bulk .= $recipients[$i];
-            };
-            $j = $j +amount;
-            $chunk = $chunk+$amount;
-      */
-    require_once(e_HANDLER."mail.php");
-    $text = "<div style='overflow:auto;height:300px'>";
-    $text .= "<table class='fborder' style='width:100%'>";
-    $text .= "<tr><td class='fcaption'>Username</td><td class='fcaption'>Email</td><td class='fcaption'>Status</td></tr>";
-    $message_body = eregi_replace('src="','src="'.SITEURL,$_POST['email_body']);
-    $message_body .="<br />";
-    $
-  //  echo $message_body;
-     $sent_no = 0;
-    for ($i=0; $i<count($recipient); $i++) {
-    $text .="<tr>";
-    $text .="<td class='forumheader3' style='width:40%'>".$recipient_name[$i]."</td>";
-    $text .="<td class='forumheader3' style='width:40%'>".$recipient[$i]."</td>";
-        if(sendemail($recipient[$i],$_POST['email_subject'],$message_body,$recipient_name[$i],$_POST['email_from_email'],$_POST['email_from_name'],$attach,$_POST['email_cc'],$_POST['email_bcc'],"","")){
-        $stat = "<span style='color:green'>Sent</span>";
-        $sent_no ++;
-        }else{
-        $stat = "<span style='color:red'>Error</span>";
-        }
-        $text .="<td class='forumheader3'>&nbsp;&nbsp; $stat </td></tr>";
-    };
-        $text .="</table></div>";
-
-    $rec_text = $c > 1 ? "recipients":"recipient";
-
-    if($c == 0 ){ $text = "<div style='text-align:center'>No Recipients Found</div>"; }
-
-    $ns -> tablerender("Emailing $c $rec_text", $text);
-    require_once(e_ADMIN."footer.php");
-exit;
-}
-
-   $text = "";
-   $text .= ($pref['smtp_enable']==0)? "<div style='text-align:center'>It is recommended that you enable <a href='prefs.php'>SMTP</a> for sending large numbers of emails.<br /><br /></div>":"";
-   $text .= "<div style='text-align:center'>
-   <form method='post' action='".e_SELF."' id='linkform'>
-   <table style='width:96%' class='fborder'>
-   <tr>
-   <td style='width:30%' class='forumheader3'>From Name: </td>
-   <td style='width:70%' class='forumheader3'>
-   <input type='text' name='email_from_name' class='tbox' style='width:80%' value='$email_from_name' />
-   </td>
-   </tr>
-
-   <tr>
-   <td style='width:30%' class='forumheader3'>From Email: </td>
-   <td style='width:70%' class='forumheader3'>
-   <input type='text' name='email_from_email' class='tbox' style='width:80%' value='$email_from_email' />
-   </td>
-   </tr>
-
-   <tr>
-   <td style='width:30%' class='forumheader3'>To: </td>
-   <td style='width:70%' class='forumheader3'>
-   ".userclasses("email_to")."$email_to</td>
-   </tr>";
-
-   $text .="
-
-   <tr>
-   <td style='width:30%' class='forumheader3'>Cc: </td>
-   <td style='width:70%' class='forumheader3'>
-   <input type='text' name='email_cc' class='tbox' style='width:80%' value='' />
-   $email_cc
-   </td>
-   </tr>
-
-
-   <tr>
-   <td style='width:30%' class='forumheader3'>Bcc: </td>
-   <td style='width:70%' class='forumheader3'>
-   <input type='text' name='email_bcc' class='tbox' style='width:80%' value='' />
-   $email_bcc
-   </td>
-   </tr>
-
-   <tr>
-   <td style='width:30%' class='forumheader3'>Subject: </td>
-   <td style='width:70%' class='forumheader3'>
-   <input type='text' name='email_subject' class='tbox' style='width:80%' value='' />
-   $email_subject
-   </td>
-   </tr>
-
-   <tr>
-   <td colspan='2' style='width:30%' class='forumheader3'>
-
-   <textarea rows='10' cols='20' id='email_body' name='email_body'  class='tbox' style='border:1px solid black;width:100%;height:200px'>
-   $email_body
-   </textarea>
-   </td>
-   </tr>
-
-   ";
-
-
-
-   $text .="<tr style='vertical-align:top'>
-   <td colspan='2' style='text-align:center' class='forumheader'>";
-   $text .= "<input class='button' type='submit' name='submit' value='Send Email' />";
-   $text .= "</td>
-   </tr>
-   </table>
-   </form>
-   </div>";
-
-   $caption = "Mail-Out";
-   $ns -> tablerender($caption, $text);
-
-
-require_once(e_ADMIN."footer.php");
-
-function userclasses($name){
-    global $sql;
-   $text .= "<select style='width:80%' class='tbox' name='$name' >
-       <option value='all'>All Members</option>";
-       $sql -> db_Select("userclass_classes");
-       while($row = $sql-> db_Fetch()){
-           extract($row);
-
-       $text .="<option value=\"$userclass_id\" $selected>Userclass - $userclass_name</option>";
-       }
-   $text .= " </select>";
-
-   return $text;
-}
-
-
-//=============================
-/*
-function bulk_email($from,$group, $cc, $bcc, $subject, $message, $format="plain", $amount=2){
-
- global $pref,$sql;
-
-
-
-
-       return "To: ".$send_to."<br>Subject: ".$subject."<br>Message: ".$message."<br>Headers:<br>".str_replace("\n","<br>",$headers);
-
-
-       // ==========================================================
-
-            $bcc_bulk = substr($bcc_bulk,0,-1);
-           /*
-            $headers = "From: \"$from\" <$from> \n";
-            $headers .= ($cc)? "cc: ".$cc."\n":"";
-            $headers .= "bcc: ".$bcc_bulk."\n";
-            $headers .= "Reply-To: ".$from." <".$from.">\n";
-            $headers .= "X-Sender: ".$from."\n";
-            $headers .= "X-Mailer: Microsoft Outlook Express 6.00.2720.3000\n";
-            $headers .= "X-MimeOLE: Produced By e107 website system\n";
-            $headers .= "X-Priority: 3\n";
-            $headers .= "Content-transfer-encoding: 8bit\nDate: " . date('r', time()) . "\n";
-            $headers .= "MIME-Version: 1.0\n";
-            if($format == "html"){
-            $headers .= "Content-Type: text/html; charset=".CHARSET."\n";
-            }else{
-            $headers .= "Content-Type: text/plain; charset=".CHARSET."\n";
-            }
-            $send_to = $from; // send to self.
-
-
-            if($pref['smtp_enable']){
-                    require_once(e_HANDLER."smtp.php");
-                    if(smtpmail($send_to, $subject, $message, $headers)){
-                            return TRUE;
-                    }else{
-                            return FALSE;
-                    }
-            }else{
-                    $headers .= "Return-Path: <".$from.">\n";
-                    if(@mail($send_to, $subject, $message, $headers)){
-                      //      return TRUE;
-                            $batch[] = "Batch# $j - Successful";
-                    }else{
-                     //       return FALSE;
-                            $batch[] = "Batch# $j - Failed";
-                    }
-            }
-          sleep(2);
-     }
- return $bcc_bulk ;
-
-}
-*/
-  function show_options($action){
-                // ##### Display options ---------------------------------------------------------------------------------------------------------
-                                if($action==""){$action="main";}
-                                // ##### Display options ---------------------------------------------------------------------------------------------------------
-                                $var['main']['text']=USRLAN_71;
-                                $var['main']['link']= "users.php";
-
-                                $var['create']['text']=USRLAN_72;
-                                $var['create']['link']="users.php?create";
-
-                                $var['prune']['text']=USRLAN_73;
-                                $var['prune']['link']="users.php?prune";
-
-                                $var['extended']['text']=USRLAN_74;
-                                $var['extended']['link']="users.php?extended";
-
-                                $var['options']['text']=USRLAN_75;
-                                $var['options']['link']="users.php?options";
-
-                                $var['mailing']['text']= USRLAN_121;
-                                $var['mailing']['link']="mailout.php";
-                                show_admin_menu(USRLAN_76,$action,$var);
-                   }
-
-function mailout_adminmenu(){
-        global $user;
-        global $action;
-        $action = "mailing";
-        show_options($action);
-}
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/mailout.php,v $
+|     $Revision: 1.52 $
+|     $Date: 2006/05/12 22:50:40 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../class2.php");
+$e_sub_cat = 'mail';
+if (!isset($_POST['submit'])) {
+	$e_wysiwyg = "email_body";
+}
+set_time_limit(180);
+session_write_close();
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."ren_help.php");
+if (!getperms("W")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_users.php");
+require_once(e_HANDLER."userclass_class.php");
+
+if (isset($_POST['testemail'])) {
+    if(SITEADMINEMAIL == ""){
+		$message = MAILAN_19;
+	}else{
+		$mailheader_e107id = USERID;
+		require_once(e_HANDLER."mail.php");
+		$add = ($pref['mailer']) ? " (".strtoupper($pref['mailer']).")" : " (PHP)";
+		if (!sendemail(SITEADMINEMAIL, PRFLAN_66." ".SITENAME.$add, PRFLAN_67)) {
+			$message = ($pref['mailer'] == "smtp")  ? PRFLAN_75 : PRFLAN_68;
+		} else {
+			$message = PRFLAN_69;
+		}
+	}
+}
+
+$sql->db_Delete("generic", "gen_type='sendmail' AND gen_datestamp < ".(time()-86400));
+
+if (isset($_POST['save_email'])){
+	$qry = "0,'massmail', '".time()."', '".USERID."', '".$tp->toDB($_POST['email_subject'])."',  '0', \"".$tp->toDB($_POST['email_body'])."\"  ";
+	$message = $sql -> db_Insert("generic", $qry) ? LAN_SAVED : LAN_ERROR;
+}
+
+if (isset($_POST['update_email'])){
+	$qry = "gen_user_id = '".USERID."', gen_datestamp = '".time()."', gen_ip = '".$tp->toDB($_POST['email_subject'])."', gen_chardata= \"".$tp->toDB($_POST['email_body'])."\" WHERE gen_id = '".$_POST['update_id']."' ";
+	$message = $sql -> db_Update("generic", $qry) ? LAN_UPDATED : LAN_UPDATED_FAILED;
+}
+
+if (isset($_POST['delete'])){
+	$d_idt = array_keys($_POST['delete']);
+	$message = ($sql -> db_Delete("generic", "gen_id='".$d_idt[0]."'")) ? LAN_DELETED : LAN_DELETED_FAILED;
+}
+
+if (isset($_POST['edit'])){
+	$e_idt = array_keys($_POST['edit']);
+	if($sql -> db_Select("generic", "*", "gen_id='".$e_idt[0]."' ")){
+		$foo = $sql -> db_Fetch();
+
+	}
+}
+
+if (isset($_POST['submit'])) {
+
+	if ($_POST['email_to'] == "all" || $_POST['email_to'] == "admin") {
+
+		switch ($_POST['email_to']) {
+			case "admin":
+				$insert = "u.user_admin='1' ";
+			break;
+
+			case "all":
+				$insert = "u.user_ban='0' ";
+			break;
+		}
+
+		$qry = "SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id WHERE $insert ";
+
+	} elseif($_POST['email_to'] == "unverified"){
+        $qry = "SELECT u.* FROM #user AS u WHERE u.user_ban='2'";
+
+	} elseif($_POST['email_to'] == "self"){
+       $qry = "SELECT u.* FROM #user AS u WHERE u.user_id='".USERID."'";
+
+	} else {
+
+    $insert = "u.user_class REGEXP concat('(^|,)',{$_POST['email_to']},'(,|$)') AND u.user_ban='0' ";
+		$qry = "SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id WHERE $insert ";
+	}
+
+  $sql2 = new db;
+	$c = 0;
+
+	if($_POST['extended_1_name'] && $_POST['extended_1_value']){
+		$qry .= " AND ".$_POST['extended_1_name']." = '".$_POST['extended_1_value']."' ";
+	}
+
+	if($_POST['extended_2_name'] && $_POST['extended_2_value']){
+		$qry .= " AND ".$_POST['extended_2_name']." = '".$_POST['extended_2_value']."' ";
+	}
+
+	if($_POST['user_search_name'] && $_POST['user_search_value']){
+		$qry .= " AND u.".$_POST['user_search_name']." LIKE '%".$_POST['user_search_value']."%' ";
+	}
+
+	$qry .= " ORDER BY u.user_name";
+
+	$_POST['mail_id']  = time();
+
+	$sql->db_Select_gen($qry);
+	if (ob_get_level() == 0) {
+		ob_start();
+	}
+	while ($row = $sql->db_Fetch()) {
+		$qry = "0,'sendmail', '".$_POST['mail_id']."', '".$row['user_id']."', '', '0', \"".$tp->toDB($_POST['email_subject'])."\" ";
+		if($sql2 -> db_Insert("generic", $qry)){
+			$c++;
+		}
+		ob_flush();
+		flush();
+	}
+	ob_end_flush();
+
+	$text = "<div style='text-align:center'>
+		<form method='post' action='".e_HANDLER."phpmailer/mailout_process.php' name='mailform' onsubmit=\"open('', 'popup','width=230,height=170,resizable=1,scrollbars=0');this.target = 'popup';return true;\" >
+		<div>";
+
+    foreach($_POST as $key=>$val){
+		$text .= "<input type='hidden' name='".$key."' value='".stripslashes($tp->post_toForm($val))."' />\n";
+    }
+
+	$text .= "</div>";
+
+	$text .= "<div>$c ".MAILAN_24."</div>";
+
+	$text .= "<div><br /><input class='button' type='submit' name='send_mails' value='Proceed' />
+	<input class='button' type='submit' name='cancel_emails' value='Cancel' />
+	</div>";
+	$text .= "</form><br /><br /></div>";
+
+// --------------- Preview Email -------------------------->
+
+	if(is_numeric($_POST['email_to']))
+	{
+		$sql->db_Select("userclass_classes", "userclass_name", "userclass_id = '{$_POST['email_to']}'");
+		$row = $sql->db_Fetch();
+		$_to = MAILAN_23.$row['userclass_name'];
+	}
+	else
+	{
+		$_to = $_POST['email_to'];
+	}
+	$text .= "
+	<div>
+	<table class='fborder'>
+
+		<tr>
+			<td class='forumheader3' style='width:30%'>".MAILAN_03."</td>
+			<td class='forumheader3'>".$_to."&nbsp;";
+			if($_POST['email_to'] == "self"){
+				$text .= "&lt;".USEREMAIL."&gt;";
+			}
+	$text .="</td>
+		</tr>
+
+		<tr>
+			<td class='forumheader3' style='width:30%'>".MAILAN_01." / ".MAILAN_02."</td>
+			<td class='forumheader3'>".$_POST['email_from_name']." &lt;".$_POST['email_from_email']."&gt;</td>
+		</tr>
+
+		<tr>
+			<td class='forumheader3' style='width:20%'>".MAILAN_06."</td>
+			<td class='forumheader3'>".$_POST['email_subject']."&nbsp;</td>
+		</tr>";
+
+		$text .= ($_POST['email_cc']) ? "
+		<tr>
+			<td class='forumheader3' style='width:30%'>".MAILAN_04."</td>
+			<td class='forumheader3'>".$_POST['email_cc']."&nbsp;</td>
+		</tr>": "";
+
+		$text .= ($_POST['email_bcc']) ? "
+		<tr>
+			<td class='forumheader3' style='width:30%'>".MAILAN_05."</td>
+			<td class='forumheader3'>".$_POST['email_bcc']."&nbsp;</td>
+		</tr>": "";
+
+
+		$text .= ($_POST['user_search_name'] && $_POST['user_search_value']) ? "
+		<tr>
+			<td class='forumheader3' style='width:30%'>".$_POST['user_search_name']."</td>
+			<td class='forumheader3'>".$_POST['user_search_value']."&nbsp;</td>
+		</tr>": "";
+
+
+
+		$text .= ($_POST['extended_1_name'] && $_POST['extended_1_value']) ? "
+		<tr>
+			<td class='forumheader3' style='width:30%'>".$_POST['extended_1_name']."</td>
+			<td class='forumheader3'>".$_POST['extended_1_value']."&nbsp;</td>
+		</tr>": "";
+
+
+
+		$text .= ($_POST['extended_2_name'] && $_POST['extended_2_value']) ? "
+		<tr>
+			<td class='forumheader3' style='width:30%'>".$_POST['extended_2_name']."</td>
+			<td class='forumheader3'>".$_POST['extended_2_value']."&nbsp;</td>
+		</tr>": "";
+
+
+
+		$text .="
+ 		<tr>
+			<td class='forumheader3' colspan='2'>".stripslashes($tp->toHTML($_POST['email_body'],TRUE))."</td>
+		</tr>
+
+	</table>
+	</div>";
+
+
+ 	$ns->tablerender("Emailing ($c) ", $text);
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+
+
+
+//. Update Preferences.
+
+if (isset($_POST['updateprefs'])) {
+	$pref['mailer'] = $_POST['mailer'];
+	$pref['sendmail'] = $_POST['sendmail'];
+	$pref['smtp_server'] = $tp->toDB($_POST['smtp_server']);
+	$pref['smtp_username'] = $tp->toDB($_POST['smtp_username']);
+	$pref['smtp_password'] = $tp->toDB($_POST['smtp_password']);
+	$pref['mail_pause'] = $_POST['mail_pause'];
+	$pref['mail_pausetime'] = $_POST['mail_pausetime'];
+	$pref['mail_bounce_email'] = $_POST['mail_bounce_email'];
+	$pref['mail_bounce_pop3'] = $_POST['mail_bounce_pop3'];
+	$pref['mail_bounce_user'] =	$_POST['mail_bounce_user'];
+	$pref['mail_bounce_pass'] = $_POST['mail_bounce_pass'];
+	$pref['mail_bounce_delete'] = $_POST['mail_bounce_delete'];
+
+	save_prefs();
+	$message = LAN_SETSAVED;
+}
+
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+
+
+// ----------------- Actions ----------------------------------------------->
+
+if(e_QUERY == "prefs"){
+	show_prefs();
+}
+
+if((!e_QUERY && !$_POST['delete']) || $_POST['edit']){
+	show_mailform($foo);
+}
+
+
+if(e_QUERY == "list" || $_POST['delete'] ){
+   showList();
+}
+
+
+require_once(e_ADMIN."footer.php");
+
+
+
+// ------------------- Display Mailout Form.--------------------------------->
+
+function show_mailform($foo=""){
+	global $ns,$sql,$tp,$pref,$HANDLERS_DIRECTORY;
+
+	$email_subject = $foo['gen_ip'];
+	$email_body = $tp->toForm($foo['gen_chardata']);
+	$email_id = $foo['gen_id'];
+	$text = "";
+
+	if(strpos($_SERVER['SERVER_SOFTWARE'],"mod_gzip") && !is_readable(e_HANDLER."phpmailer/.htaccess")){
+		$warning = "You need to rename <b>e107.htaccess</b> to <b>.htaccess</b> in ".$HANDLERS_DIRECTORY."phpmailer/ before sending mail from this page.";
+		$ns -> tablerender("Warning", $warning);
+	}
+
+
+	$text .= "<div style='".ADMIN_WIDTH." text-align:center'>
+	<form method='post' action='".e_SELF."' id='mailout_form'>
+	<table class='fborder' style='".ADMIN_WIDTH."'  cellpadding='0' cellspacing='0'>
+	<tr>
+	<td style='width:30%' class='forumheader3'>".MAILAN_01.": </td>
+	<td style='width:70%' class='forumheader3'>
+	<input type='text' name='email_from_name' class='tbox' style='width:80%' size='10' value=\"".$_POST['email_from_name']."\" />
+	</td>
+	</tr>";
+
+
+	$text .="
+
+	<tr>
+	<td class='forumheader3'>".MAILAN_02.": </td>
+	<td  class='forumheader3'>
+	<input type='text' name='email_from_email' class='tbox' style='width:80%' value=\"".$_POST['email_from_email']."\" />
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3'>".MAILAN_03.": </td>
+	<td class='forumheader3'>
+	".userclasses("email_to", $_POST['email_to'])."</td>
+	</tr>";
+
+
+	// User Search Field.
+
+
+		$u_array = array("user_name"=>"Username","user_login"=>"User Login","user_email"=>"User Email");
+
+		$text .= "
+		<tr>
+			<td style='width:35%' class='forumheader3'>User-Match
+			<select name='user_search_name' class='tbox'>
+			<option value=''>&nbsp;</option>";
+
+			foreach($u_array as $key=>$val){
+				$text .= "<option value='$key' >".$val."</option>\n";
+			}
+
+	$text .= "
+		</select> contains </td>
+		<td style='width:65%' class='forumheader3'>
+		<input type='text' name='user_search_value' class='tbox' style='width:80%' value='' />
+		</td></tr>
+		";
+
+	// Extended Field #1.
+
+		$text .= "
+		<tr>
+			<td class='forumheader3'>User-Match
+			<select name='extended_1_name' class='tbox'>
+			<option value=''>&nbsp;</option>";
+			$sql -> db_Select("user_extended_struct");
+			while($row = $sql-> db_Fetch()){
+				$text .= "<option value='ue.user_".$row['user_extended_struct_name']."' >".ucfirst($row['user_extended_struct_name'])."</option>\n";
+			}
+
+		$text .= "
+		</select> equals </td>
+		<td  class='forumheader3'>
+		<input type='text' name='extended_1_value' class='tbox' style='width:80%' value='' />
+		</td></tr>
+		";
+
+
+
+	// Extended Field #2.
+
+		$text .= "
+		<tr>
+			<td class='forumheader3'>User-Match
+			<select name='extended_2_name' class='tbox'>
+			<option value=''>&nbsp;</option>";
+			$sql -> db_Select("user_extended_struct");
+			while($row = $sql-> db_Fetch()){
+				$text .= "<option value='ue.user_".$row['user_extended_struct_name']."' >".ucfirst($row['user_extended_struct_name'])."</option>\n";
+			}
+
+		$text .= "
+		</select> equals </td>
+		<td  class='forumheader3'>
+		<input type='text' name='extended_2_value' class='tbox' style='width:80%' value='' />
+		</td></tr>
+		";
+
+
+
+
+	$text .= "
+
+	<tr>
+	<td class='forumheader3'>".MAILAN_04.": </td>
+	<td  class='forumheader3'>
+	<input type='text' name='email_cc' class='tbox' style='width:80%' value=\"".$_POST['email_cc']."\" />
+
+	</td>
+	</tr>
+
+
+	<tr>
+	<td class='forumheader3'>".MAILAN_05.": </td>
+	<td  class='forumheader3'>
+	<input type='text' name='email_bcc' class='tbox' style='width:80%' value='$email_bcc' />
+
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3'>".MAILAN_06.": </td>
+	<td class='forumheader3'>
+	<input type='text' name='email_subject' class='tbox' style='width:80%' value='$email_subject' />
+
+	</td>
+	</tr>";
+
+
+
+
+	// Attachment.
+
+	$text .= "<tr>
+	<td class='forumheader3'>".MAILAN_07.": </td>
+	<td  class='forumheader3'>";
+	$text .= "<select class='tbox' name='email_attachment' >
+	<option value=''>&nbsp;</option>\n";
+	$sql->db_Select("download", "download_url,download_name", "download_id !='' ORDER BY download_name");
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		$selected = ($_POST['email_attachment'] == $download_url) ? "selected='selected'" :
+		 "";
+		$text .= "<option value=\"$download_url \" $selected>".htmlspecialchars($download_name)."</option>\n";
+	}
+	$text .= " </select>";
+
+	$text .= "</td>
+	</tr>";
+
+
+
+
+
+	$text .= "
+	<tr>
+	<td class='forumheader3'>".MAILAN_09.": </td>
+	<td  class='forumheader3'>
+	<input type='checkbox' name='use_theme' value='1' />
+	</td>
+	</tr>
+
+	<tr>
+	<td colspan='2'  class='forumheader3'>
+	<textarea rows='10' cols='20' id='email_body' name='email_body'  class='tbox' style='width:100%;height:200px' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>
+	$email_body
+	</textarea>
+	</td>
+	</tr>";
+
+	$text .="
+	<tr>
+	<td style='width:100%' class='forumheader3' colspan='2'>
+	<div style='width:100%;text-align:center;vertical-align: middle;' >".display_help("helpb")
+	."<span style='vertical-align: super;margin-left:5%;margin-bottom:auto;margin-top:auto'>";
+	if($pref['wysiwyg']) {
+		$text .="<input type='button' class='button' name='usrname' value=\"".MAILAN_16."\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'{USERNAME}')\" />
+		<input type='button' class='button' name='usrlink' value=\"".MAILAN_17."\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'{SIGNUP_LINK}')\" />
+		<input type='button' class='button' name='usrid' value=\"".MAILAN_18."\" onclick=\"tinyMCE.selectedInstance.execCommand('mceInsertContent',0,'{USERID}')\" />";
+	} else {
+ 		$text .="<input type='button' class='button' name='usrname' value=\"".MAILAN_16."\" onclick=\"addtext('{USERNAME}')\" />
+ 		<input type='button' class='button' name='usrlink' value=\"".MAILAN_17."\" onclick=\"addtext('{SIGNUP_LINK}')\" />
+ 		<input type='button' class='button' name='usrid' value=\"".MAILAN_18."\" onclick=\"addtext('{USERID}')\" />";
+	}
+
+
+ 	$text .="</span>
+	</div></td>
+	</tr>";
+
+
+	$text .= "<tr style='vertical-align:top'>
+	<td colspan='2' style='text-align:center' class='forumheader'>";
+	if(isset($_POST['edit'])){
+		$text .= "<input type='hidden' name='update_id' value='".$email_id."' />";
+		$text .= "<input class='button' type='submit' name='update_email' value=\"".LAN_UPDATE."\" />";
+	}else{
+		$text .= "<input class='button' type='submit' name='save_email' value=\"".LAN_SAVE."\" />";
+	}
+
+	$text .="&nbsp;<input class='button' type='submit' name='submit' value=\"".MAILAN_08."\" />
+
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+
+	$ns->tablerender(MAILAN_15, $text);
+
+}
+
+// ------------------ Preferences -------------------------------------------->
+
+function show_prefs(){
+	global $pref,$ns;
+$text = "
+	<form method='post' action='".e_SELF."?".e_QUERY."' id='mailsettingsform'>
+	<div id='mail' style='text-align:center;'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+	<td style='width:40%' class='forumheader3'><span title='".PRFLAN_64."' style='cursor:help'>".PRFLAN_63."</span><br /></td>
+	<td style='width:60%; text-align:right' class='forumheader3'><input class='button' type='submit' name='testemail' value=\"".PRFLAN_65." ".SITEADMINEMAIL."\" />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='vertical-align:top' class='forumheader3'>".PRFLAN_70."<br /><span class='smalltext'>".PRFLAN_71."</span></td>
+	<td style='text-align:right' class='forumheader3'>
+	<select class='tbox' name='mailer' onchange='disp(this.value)'>\n";
+	$mailers = array("php","smtp","sendmail");
+	foreach($mailers as $opt){
+		$sel = ($pref['mailer'] == $opt) ? "selected='selected'" : "";
+		$text .= "<option value='$opt' $sel>$opt</option>\n";
+	}
+	$text .="</select><br />";
+// SMTP. -------------->
+	$smtpdisp = ($pref['mailer'] != "smtp") ? "display:none;" : "";
+	$text .= "<div id='smtp' style='$smtpdisp text-align:right'><table style='margin-right:0px;margin-left:auto;border:0px'>";
+	$text .= "	<tr>
+	<td style='text-align:right' >".PRFLAN_72.":&nbsp;&nbsp;</td>
+	<td style='width:50%; text-align:right' >
+	<input class='tbox' type='text' name='smtp_server' size='40' value='".$pref['smtp_server']."' maxlength='50' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='text-align:right' >".PRFLAN_73.":&nbsp;(".LAN_OPTIONAL.")&nbsp;&nbsp;</td>
+	<td style='width:50%; text-align:right' >
+	<input class='tbox' type='text' name='smtp_username' size='40' value=\"".$pref['smtp_username']."\" maxlength='50' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='text-align:right' >".PRFLAN_74.":&nbsp;(".LAN_OPTIONAL.")&nbsp;&nbsp;</td>
+	<td style='width:50%; text-align:right' >
+	<input class='tbox' type='password' name='smtp_password' size='40' value='".$pref['smtp_password']."' maxlength='50' />
+	</td>
+	</tr>
+
+	</table></div>";
+
+// Sendmail. -------------->
+	$senddisp = ($pref['mailer'] != "sendmail") ? "display:none;" : "";
+	$text .= "<div id='sendmail' style='$senddisp text-align:right'><table style='margin-right:0px;margin-left:auto;border:0px'>";
+	$text .= "
+
+	<tr>
+	<td >".MAILAN_20.":&nbsp;&nbsp;</td>
+	<td style='text-align:right' >
+	<input class='tbox' type='text' name='sendmail' size='60' value=\"".(!$pref['sendmail'] ? "/usr/sbin/sendmail -t -i -r ".$pref['siteadminemail'] : $pref['sendmail'])."\" maxlength='80' />
+	</td>
+	</tr>
+
+	</table></div>";
+	$text .="</td>
+	</tr>
+
+	<tr>
+		<td class='forumheader3'>".MAILAN_25."</td>
+		<td class='forumheader3' style='text-align: right;'> ".MAILAN_26."
+		<input class='tbox' size='3' type='text' name='mail_pause' value='".$pref['mail_pause']."' /> ".MAILAN_27.".
+		</td>
+	</tr>\n
+
+	<tr>
+		<td class='forumheader3'>".MAILAN_28."</td>
+		<td class='forumheader3' style='text-align: right;'>
+		<input class='tbox' size='3' type='text' name='mail_pausetime' value='".$pref['mail_pausetime']."' /> ".MAILAN_29.".<br />
+		<span class='smalltext'>".MAILAN_30."</span>
+		</td>
+	</tr>\n
+
+	<tr>
+	<td style='width:40%;vertical-align:top' class='forumheader3'>".MAILAN_31."</td>
+	<td style='width:60%; text-align:right' class='forumheader3'>
+		".MAILAN_32.": <input class='tbox' size='40' type='text' name='mail_bounce_email' value=\"".$pref['mail_bounce_email']."\" /><br />
+		".MAILAN_33." (POP3):  <input class='tbox' size='40' type='text' name='mail_bounce_pop3' value=\"".$pref['mail_bounce_pop3']."\" /><br />
+		".MAILAN_34.":  <input class='tbox' size='40' type='text' name='mail_bounce_user' value=\"".$pref['mail_bounce_user']."\" /><br />
+		".MAILAN_35.":  <input class='tbox' size='40' type='text' name='mail_bounce_pass' value=\"".$pref['mail_bounce_pass']."\" /><br />";
+
+	$check = ($pref['mail_bounce_delete']==1) ? "checked='checked'" : "";
+	$text .= MAILAN_36.":  <input type='checkbox' name='mail_bounce_delete' value='1' {$check} />
+
+	</td>
+	</tr>
+
+
+	<tr>
+	<td style='text-align:center' colspan='2' class='forumheader'>
+	<input class='button' type='submit' name='updateprefs' value=\"".PRFLAN_52."\" />
+	</td>
+	</tr>
+
+
+
+
+
+	</table></div></form>";
+
+	$text .= "";
+	$caption = LAN_PREFS;
+	$ns->tablerender($caption, $text);
+}
+
+
+
+
+function showList()
+	{
+		global $sql,$ns,$tp;
+		$gen = new convert;
+		$qry ="SELECT g.*,u.* FROM #generic AS g LEFT JOIN #user AS u ON g.gen_user_id = u.user_id WHERE g.gen_type = 'massmail' ORDER BY g.gen_datestamp DESC";
+	 //	$count = $sql -> db_Select("generic", "*", "gen_type ='massmail' ORDER BY gen_datestamp DESC");
+		$count = $sql -> db_Select_gen($qry);
+
+		$text = "<div style='text-align:center'>";
+
+		if (!$count)
+		{
+			$text = "
+			<div class='forumheader2' style='text-align:center'>".MAILAN_22."</div>";
+			$ns -> tablerender("<div style='text-align:center'>".MAILAN_21."</div>", $text);
+			require_once(e_ADMIN."footer.php");
+			exit;
+		}
+		else
+		{
+
+			$text .= "
+
+			<form action='".e_SELF."' id='display' method='post'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+
+			<tr>
+			<td style='width:5%; text-align: center;' class='fcaption'>Id</td>
+			<td style='width:10%' class='fcaption'>Author</td>
+			<td style='width:40%' class='fcaption'>Subject</td>
+			<td style='width:20%; text-align: center;' class='fcaption'>Lastmod</td>
+			<td style='width:5%; text-align: center;' class='fcaption'>".LAN_OPTIONS."</td>
+			</tr>
+			";
+
+			$glArray = $sql -> db_getList();
+			foreach($glArray as $row2)
+			{
+
+				$datestamp = $gen->convert_date($row2['gen_datestamp'], "short");
+
+				$text .= "<tr>
+				<td class='forumheader3' style='; text-align: center;'>".$row2['gen_id'] ."</td>
+				<td class='forumheader3'>".$row2['user_name']."</td>
+				<td class='forumheader3'>".$row2['gen_ip']."</td>
+
+				<td class='forumheader3' style='; text-align: center;'>".$datestamp."</td>
+
+				<td style='width:50px;white-space:nowrap' class='forumheader3'>
+				<div>
+				<input type='image' name='edit[{$row2['gen_id']}]' value='edit' src='".e_IMAGE."admin_images/edit_16.png' alt='".LAN_EDIT."' title='".LAN_EDIT."' style='border:0px' />
+				<input type='image' name='delete[{$row2['gen_id']}]' value='del' onclick=\"return jsconfirm('".$tp->toJS(LAN_CONFIRMDEL." [".$row2['gen_ip']."]")."') \" src='".e_IMAGE."admin_images/delete_16.png' alt='".LAN_DELETE."' title='".LAN_DELETE."' style='border:0px' />
+				</div>
+				</td>
+				</tr>
+				";
+			}
+		}
+
+		$text .= "</table>\n</form><br /><br /><br /></div>";
+		$ns -> tablerender("<div style='text-align:center'>".MAILAN_21."</div>", $text);
+	}
+
+
+
+
+function userclasses($name) {
+	global $sql;
+	$text .= "<select style='width:80%' class='tbox' name='$name' >
+		<option value='all'>".MAILAN_12."</option>
+		<option value='unverified'>".MAILAN_13."</option>
+		<option value='admin'>Admins</option>
+		<option value='self'>Self</option>";
+	$query = "SELECT uc.*, count(u.user_id) AS members
+			FROM #userclass_classes AS uc
+			LEFT JOIN #user AS u ON u.user_class REGEXP concat('(^|,)',uc.userclass_id,'(,|$)')
+			GROUP BY uc.userclass_id
+					";
+
+	$sql->db_Select_gen($query);
+	while ($row = $sql->db_Fetch()) {
+		$public = ($row['userclass_editclass'] == 0)? "(".MAILAN_10.")" : "";
+		$text .= "<option value='{$row['userclass_id']}' >Userclass - {$row['userclass_name']}  $public [{$row['members']}]</option>";
+	}
+	$text .= " </select>";
+
+	return $text;
+}
+
+
+function mailout_adminmenu() {
+	$action = (e_QUERY) ? e_QUERY : "post";
+	if($action == "edit"){
+    	$action = "post";
+	}
+    $var['post']['text'] = "Send Mail";
+	$var['post']['link'] = e_SELF;
+	$var['post']['perm'] = "W";
+    $var['list']['text'] = LAN_SAVED;
+	$var['list']['link'] = e_SELF."?list";
+	$var['list']['perm'] = "W";
+	if(getperms("0")){
+		$var['prefs']['text'] = LAN_OPTIONS;
+		$var['prefs']['link'] = e_SELF."?prefs";
+   		$var['prefs']['perm'] = "0";
+    }
+	show_admin_menu(MAILAN_15, $action, $var);
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+function headerjs()
+{
+
+	$text = "
+	<script type='text/javascript'>
+	function disp(type) {
+
+
+		if(type == 'smtp'){
+			document.getElementById('smtp').style.display = '';
+			document.getElementById('sendmail').style.display = 'none';
+			return;
+		}
+
+		if(type =='sendmail'){
+            document.getElementById('smtp').style.display = 'none';
+			document.getElementById('sendmail').style.display = '';
+			return;
+		}
+
+		document.getElementById('smtp').style.display = 'none';
+		document.getElementById('sendmail').style.display = 'none';
+
+	}
+	</script>";
+
+	return $text;
+}
+
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/menus.php 75/e107_admin/menus.php
--- 6171/e107_admin/menus.php	2004-09-10 05:07:52.000000000 -0500
+++ 75/e107_admin/menus.php	2006-04-28 19:16:22.000000000 -0500
@@ -1,353 +1,522 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/menus2.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("2")){ header("location:".e_BASE."index.php"); exit;}
-require_once("auth.php");
-require_once(e_HANDLER."form_handler.php");
-$frm = new form;
-
-//$sql -> db_Select("core", "*", "e107_name='menu_pref' ");
-//$row = $sql -> db_Fetch();
-//$tmp = stripslashes($row['e107_value']);
-//$menu_pref=unserialize($tmp);
-
-foreach($_POST['menuAct'] as $k => $v){
-	if(trim($v)){
-		$id = $k;
-		list($menu_act,$location,$position,$newloc) = explode(".",$_POST['menuAct'][$k]);
-	}
-}
-
-if($menu_act == 'config')
-{
-	header("location:".SITEURL.$PLUGINS_DIRECTORY.$location."_menu/config.php");
-	exit;
-}
-
-if($menu_act == "adv")
-{
-	require_once(e_HANDLER."userclass_class.php");
-	$sql -> db_Select("menus", "*", "menu_id='$id' ");
-	$row = $sql -> db_Fetch(); extract($row);
-	$listtype = substr($menu_pages,0,1);
-	$menu_pages = substr($menu_pages,2);
-	$menu_pages = preg_replace("#\|#","\n",$menu_pages);
-	$text = "<div style='text-align:center'>
-	<form  method='post' action='".e_SELF."'>\n
-	<table style='width:100%'>
-	<tr>
-	<td>
-	<input type='hidden' name='menuAct[$menu_id]' value='sv.$menu_id' />
-	";
-	$text .= MENLAN_4." ";
-	$text .= r_userclass('menu_class',$menu_class,"off","public,member,guest,admin,classes,nobody");
-	$text .= "</td>
-	</tr>";
-	$text .= "<tr><td><br />";
-	$checked = ($listtype == 1) ? " checked='checked' " : "";
-	$text .= "<input type='radio' {$checked} name='listtype' value='1' /> ".MENLAN_26."<br />";
-	$checked = ($listtype == 2) ? " checked='checked' " : "";
-	$text .= "<input type='radio' {$checked} name='listtype' value='2' /> ".MENLAN_27."<br /><br />".MENLAN_28."<br />";
-	$text .= "<textarea name='pagelist' cols='60' rows='10' class='tbox'>$menu_pages</textarea>";
-	$text .= "
-	<tr>
-	<td style=\"text-align:center\"><br />
-	<input class=\"button\" type=\"submit\" name=\"class_submit\" value=\"".MENLAN_6."\" />
-	</td>
-	</tr>
-	</table>
-	</form>
-	</div>";
-	$caption = MENLAN_7." ".$menu_name;
-	$ns -> tablerender($caption, $text);
-}
-
-unset($message);
-
-if($menu_act == "sv")
-{
-	$pagelist = explode("\r\n",$_POST['pagelist']);
-	for($i = 0 ;$i < count($pagelist) ; $i++){
-		$pagelist[$i]=trim($pagelist[$i]);
-	}  
-	$plist = implode("|",$pagelist);
-	$pageparms = $_POST['listtype'].'-'.$plist;
-	$pageparms = preg_replace("#\|$#","",$pageparms);
-	$pageparms = (trim($_POST['pagelist']) == '') ? '' : $pageparms;
-	$sql -> db_Update("menus", "menu_class='".$_POST['menu_class']."', menu_pages='{$pageparms}' WHERE menu_id='$id' ");
-	$message = "<br />".MENLAN_8."<br />";
-}
-
-if($menu_act == "move")
-{
-	$menu_count = $sql -> db_Count("menus", "(*)", " WHERE menu_location='$position' ");
-	$sql -> db_Update("menus", "menu_location='$newloc', menu_order='".($menu_count+1)."' WHERE menu_id='$id' ");
-}
-
-if($menu_act== 'activate')
-{
-	$menu_count = $sql -> db_Count("menus", "(*)", " WHERE menu_location='$position' ");
-	$sql -> db_Update("menus", "menu_location='$location', menu_order='".($menu_count+1)."' WHERE menu_id='$id' ");
-}
-
-if($menu_act == "deac")
-{
-	$sql -> db_Update("menus", "menu_location='0', menu_order='0' WHERE menu_id='$id' ");
-}
-
-if($menu_act == "bot")
-{
-   $menu_count = $sql -> db_Count("menus", "(*)", " WHERE menu_location='$location' ");
-	$sql -> db_Update("menus", "menu_order=".($menu_count+1)." WHERE menu_order='$position' AND menu_location='$location' ");
-	$sql -> db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='$location' AND menu_order > $position");
-}
-
-if($menu_act == "top")
-{
-	$sql -> db_Update("menus", "menu_order=menu_order+1 WHERE menu_location='$location' AND menu_order < $position");
-	$sql -> db_Update("menus", "menu_order=0 WHERE menu_id='$id' ");
-}
-
-if($menu_act == "dec")
-{
-	$sql -> db_Update("menus", "menu_order=menu_order-1 WHERE menu_order='".($position+1)."' AND menu_location='$location' ");
-	$sql -> db_Update("menus", "menu_order=menu_order+1 WHERE menu_id='$id' AND menu_location='$location' ");
-}
-
-if($menu_act == "inc")
-{
-	$sql -> db_Update("menus", "menu_order=menu_order+1 WHERE menu_order='".($position-1)."' AND menu_location='$location' ");
-	$sql -> db_Update("menus", "menu_order=menu_order-1 WHERE menu_id='$id' AND menu_location='$location' ");
-}
-
-$handle=opendir(e_PLUGIN);
-$c=0;
-while(false !== ($file = readdir($handle)))
-{
-	if($file != "." && $file != ".." && $file != "index.html" && (strstr($file, "menu") || (strstr($file, "custom") && !strstr($file, "custompage"))))
-	{
-		if($file == "custom")
-		{
-			$handle2=opendir(e_PLUGIN."custom/");
-			$d=0;
-			while(false !== ($file2 = readdir($handle2)))
-			{
-				if($file2 != "." && $file2 != ".." && $file2 != "/" && $file2 != "Readme.txt")
-				{
-					$file2 = "custom_".str_replace(".php", "", $file2);
-					if(!$sql -> db_Select("menus", "*", "menu_name='$file2'"))
-					{
-						$sql -> db_Insert("menus", " 0, '$file2', 0, 0, 0, '' ");
-						$message .= "<b>".MENLAN_9." - ".$file2."</b><br />";
-					}
-					$menustr .= "&".$file2;
-					$d++;
-				}
-			}
-			closedir($handle2);
-		}
-		else if(!$sql -> db_Select("menus", "*", "menu_name='$file'"))
-		{
-			if(file_exists(e_PLUGIN.$file."/plugin.php")){
-				@include(e_PLUGIN.$file."/plugin.php");
-				if($sql -> db_Select("plugin", "*", "plugin_name='$eplug_name' AND plugin_installflag='1' "))
-				{
-					$sql -> db_Insert("menus", " 0, '$file', 0, 0, 0, '' ");
-					$message .= "<b>".MENLAN_10." - ".$file."</b><br />";
-				}
-			}
-			else
-			{
-			$sql -> db_Insert("menus", " 0, '$file', 0, 0, 0, '' ");
-			$message .= "<b>".MENLAN_10." - ".$file."</b><br />";
-		}
-	}
-	$menustr .= "&".str_replace(".php", "", $file);
-	$c++;
-}
-}
-closedir($handle);
-
-$areas = substr_count(($NEWSHEADER ? $NEWSHEADER : $HEADER).$FOOTER, "MENU");
-
-$sql2 = new db;
-for($a=1; $a<=$areas; $a++)
-{
-	if($sql -> db_Select("menus", "*",  "menu_location='$a' ORDER BY menu_order ASC"))
-	{
-		$c=1;
-		while($row = $sql -> db_Fetch())
-		{
-			extract($row);
-			$sql2 -> db_Update("menus", "menu_order='$c' WHERE menu_id='$menu_id' ");
-			$c++;
-		}
-	}
-}
-
-$sql -> db_Select("menus");
-while(list($menu_id, $menu_name, $menu_location, $menu_order) = $sql-> db_Fetch())
-{
-	if(!eregi($menu_name, $menustr))
-	{
-		$sql2 -> db_Delete("menus", "menu_name='$menu_name'");
-		$message .= "<b>".MENLAN_11." - ".$menu_name."</b><br />";
-	}
-}
-
-$menus_used = (substr_count(($NEWSHEADER ? $NEWSHEADER : $HEADER).$FOOTER, "MENU"));
-$sql -> db_Update("menus", "menu_location='0', menu_order='0' WHERE menu_location>'$menus_used' ");
-
-if($message != ""){
-	echo "<div style='text-align:center'><b>".$message."</b></div>";
-}
-
-parseheader(($NEWSHEADER ? $NEWSHEADER : $HEADER), $menus_used);
-
-echo "<div style='text-align:center'>";
-echo "<div style='font-size:14px' class='fborder'><div class='forumheader'><b>".MENLAN_22."</b></div></div><br />";
-echo $frm -> form_open("post",e_SELF,"menuActivation");
-echo "<table style='width:96%' class='fborder'>";
-
-$sql -> db_Select("menus", "*", "menu_location='0' ");
-while(list($menu_id, $menu_name, $menu_location, $menu_order) = $sql-> db_Fetch())
-{
-	$text="";
-	$menu_name = eregi_replace("_menu", "", $menu_name);
-
-	echo "<tr>
-	<td class=\"fcaption\" style=\"text-align:center\">
-	<b>".$menu_name."</b>
-	</td>
-	</tr>
-	<tr>
-	<td class=\"forumheader3\" style=\"text-align:center\">";
-
-	$text .= "<div>
-	<select id='menuAct_$menu_id' name='menuAct[$menu_id]' class='tbox' onchange='this.form.submit()' >";
-	$text .= $frm -> form_option(MENLAN_12." ...",TRUE, " ");
-
-	for($a=1; $a<=$menus_used; $a++)
-	{
-		$text .= $frm -> form_option(MENLAN_13." ".$a,"", "activate.$a");
-	}
-	$text .= $frm -> form_select_close()."</div>";
-	echo $text;
-	echo "</td></tr>
-	<tr><td><br /></td></tr>
-	";
-}
-echo "</table>";
-echo $frm -> form_close();
-echo "</div>";
-
-parseheader($FOOTER, $menus_used);
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function parseheader($LAYOUT)
-{
-	$tmp = explode("\n", $LAYOUT);
-	for($c=0; $c < count($tmp); $c++)
-	{
-		if(preg_match("/[\{|\}]/", $tmp[$c]))
-		{
-			$str = checklayout($tmp[$c]);
-		}
-		else
-		{
-			echo $tmp[$c];
-		}
-	}
-}
-function checklayout($str){
-        global $pref, $menus_used, $areas;
-        global $frm;
-        
-        if(strstr($str, "LOGO")){
-                echo "[Logo]";
-        }else if(strstr($str, "SITENAME")){
-                echo "[SiteName]";
-        }else if(strstr($str, "SITETAG")){
-                echo "[SiteTag]";
-        }else if(strstr($str, "SITELINKS")){
-                echo "[SiteLinks]";
-        }else if(strstr($str, "MENU")){
-                $ns = new e107table;
-                $menu = preg_replace("/\{MENU=(.*?)\}/si", "\\1", $str);
-                echo "<div style=\"text-align:center; font-size:14px\" class=\"fborder\"><div class=\"forumheader\"><b>".MENLAN_14."  ".$menu."</b></div></div><br />";
-                $text = "&nbsp;";
-                $sql9 = new db;
-                if($sql9 -> db_Count("menus", "(*)", " WHERE menu_location='$menu' "))
-                {
-
-                
-                unset($text);
-					echo $frm -> form_open("post",e_SELF,"frm_menu_".intval($menu));
-					
-                $sql9 -> db_Select("menus", "*",  "menu_location='$menu' ORDER BY menu_order");
-                $menu_count = $sql9 -> db_Rows();
-                while(list($menu_id, $menu_name, $menu_location, $menu_order, $menu_class, $menu_pages) = $sql9-> db_Fetch()){
-                        $menu_name = eregi_replace("_menu", "", $menu_name);
-								$vis = ($menu_class || strlen($menu_pages) > 1) ? " <span style='color:red'>*</span> " : "";
-                        $caption = "<div style=\"text-align:center\">{$menu_name}{$vis}</div>";
-                        $menu_info = "{$menu_location}.{$menu_order}";
-
-								$text = "";
-                        $config_path = e_PLUGIN.$menu_name."_menu/config.php";
-                        $conf = FALSE;
-                        if(file_exists($config_path)){
-                        	$conf = TRUE;
-                        }
-								$text .="<select id='menuAct_$menu_id' name='menuAct[$menu_id]' class='tbox' onchange='this.form.submit()' >";
-								$text .= $frm -> form_option(MENLAN_25,TRUE," ");
-								$text .= $frm -> form_option(MENLAN_15,"","deac.{$menu_info}");
-
-								if($conf)
-								{
-									$text .= $frm -> form_option(MENLAN_16,"","config.{$menu_name}");
-								}
-
-                        if($menu_order != 1){
-									$text .= $frm -> form_option(MENLAN_17,"","inc.{$menu_info}");
-									$text .= $frm -> form_option(MENLAN_24,"","top.{$menu_info}");
-                        }
-                        if($menu_count != $menu_order){
-									$text .= $frm -> form_option(MENLAN_18,"","dec.{$menu_info}");
-									$text .= $frm -> form_option(MENLAN_23,"","bot.{$menu_info}");
-                        }
-                        for($c=1; $c<=$areas; $c++){
-                                if($menu <> $c){
-													$text .= $frm -> form_option(MENLAN_19." ".$c,"","move.{$menu_info}.".$c);
-
-                                }
-                        }
-
-								$text .= $frm -> form_option(MENLAN_20,"","adv.{$menu_info}");
-								$text .= $frm -> form_select_close();
-                        $ns -> tablerender($caption, $text);
-                        echo "<div><br /></div>";
-                }
-					echo $frm -> form_close();
-				}
-        }else if(strstr($str, "SETSTYLE")){
-                $tmp = explode("=", $str);
-                $style = preg_replace("/\{SETSTYLE=(.*?)\}/si", "\\1", $str);
-        }else if(strstr($str, "SITEDISCLAIMER")){
-                echo "[Sitedisclaimer]";
-        }
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/menus.php,v $
+|     $Revision: 1.46 $
+|     $Date: 2006/04/29 00:16:22 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("2")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'menus';
+require_once("auth.php");
+require_once(e_HANDLER."form_handler.php");
+require_once(e_HANDLER."file_class.php");
+$frm = new form;
+
+if($_POST) {
+	$e107cache->clear("menus_");
+}
+
+$menus_equery = explode('.', e_QUERY);
+
+if (isset($_POST['custom_select'])) {
+	$menus_equery[1] = $_POST['custom_select'];
+	//header("location:".e_SELF."?".$_POST['custom_select']);
+	//exit;
+} else if (!isset($menus_equery[1])) {
+	$menus_equery[1] = '';
+}
+
+if ($menus_equery[1] == '' || $menus_equery[1] == 'default_layout') {
+	$menus_header = $HEADER;
+	$menus_footer = $FOOTER;
+}
+else if ($menus_equery[1] == 'custom_layout') {
+	$menus_header = $CUSTOMHEADER ? $CUSTOMHEADER :
+	$HEADER;
+	$menus_footer = $CUSTOMFOOTER ? $CUSTOMFOOTER :
+	$FOOTER;
+}
+else if ($menus_equery[1] == 'newsheader_layout') {
+	$menus_header = $NEWSHEADER ? $NEWSHEADER :
+	$HEADER;
+	$menus_footer = $FOOTER;
+} else {
+	$menus_header = $CUSTOMHEADER[$menus_equery[1]] ? $CUSTOMHEADER[$menus_equery[1]] :
+	$HEADER;
+	$menus_footer = $CUSTOMFOOTER[$menus_equery[1]] ? $CUSTOMFOOTER[$menus_equery[1]] :
+	$FOOTER;
+}
+
+$layouts_str = $HEADER.$FOOTER;
+if ($NEWSHEADER) {
+	$layouts_str .= $NEWSHEADER;
+}
+
+if ($CUSTOMPAGES) {
+	if (is_array($CUSTOMPAGES)) {
+		foreach ($CUSTOMPAGES as $custom_extract_key => $custom_extract_value) {
+			if ($CUSTOMHEADER[$custom_extract_key]) {
+				$layouts_str .= $CUSTOMHEADER[$custom_extract_key];
+			}
+			if ($CUSTOMFOOTER[$custom_extract_key]) {
+				$layouts_str .= $CUSTOMFOOTER[$custom_extract_key];
+			}
+		}
+	} else {
+		if ($CUSTOMHEADER) {
+			$layouts_str .= $CUSTOMHEADER;
+		}
+		if ($CUSTOMFOOTER) {
+			$layouts_str .= $CUSTOMFOOTER;
+		}
+	}
+}
+
+$menu_array = parseheader($layouts_str, 'check');
+sort($menu_array, SORT_NUMERIC);
+$menu_check = 'set';
+foreach ($menu_array as $menu_value) {
+	if ($menu_value != $menu_check) {
+		$menu_areas[] = $menu_value;
+	}
+	$menu_check = $menu_value;
+}
+
+// Cams Bit ----------- Activate Multiple Menus ---
+if($_POST['menuActivate'])
+{
+	foreach ($_POST['menuActivate'] as $k => $v)
+	{
+		if (trim($v))
+		{
+			$location = $k;
+		}
+	}
+
+	$menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location='$location' ");
+
+	foreach($_POST['menuselect'] as $sel_mens)
+	{
+		$sql->db_Update("menus", "menu_location='$location', menu_order='".($menu_count+1)."' WHERE menu_id='$sel_mens' ");
+		$menu_count++;
+	}
+}
+// =============
+
+foreach ($_POST['menuAct'] as $k => $v) {
+	if (trim($v)) {
+		$id = $k;
+		list($menu_act, $location, $position, $newloc) = explode(".", $_POST['menuAct'][$k]);
+	}
+}
+
+if ($menu_act == 'config') {
+	if($newloc)
+	{
+		$newloc = ".".$newloc;
+	}
+	$newurl = $PLUGINS_DIRECTORY.$location."/{$position}{$newloc}.php";
+	$newurl = SITEURL.str_replace("//", "/", $newurl);
+	echo "<script>	top.location.href = '$newurl'; </script> ";
+	exit;
+}
+
+if ($menu_act == "adv") {
+	require_once(e_HANDLER."userclass_class.php");
+	$sql->db_Select("menus", "*", "menu_id='$id' ");
+	$row = $sql->db_Fetch();
+	extract($row);
+	$listtype = substr($menu_pages, 0, 1);
+	$menu_pages = substr($menu_pages, 2);
+	$menu_pages = str_replace("|", "\n", $menu_pages);
+	$text = "<div style='text-align:center;'>
+	<form  method='post' action='".e_SELF."?configure.".$menus_equery[1]."'>\n
+	<table style='width:40%'>
+	<tr>
+	<td>
+	<input type='hidden' name='menuAct[$menu_id]' value='sv.$menu_id' />
+	".MENLAN_4." ".
+	r_userclass('menu_class', $menu_class, "off", "public,member,guest,admin,classes,nobody")."
+	</td>
+	</tr>
+	<tr><td><br />";
+	$checked = ($listtype == 1) ? " checked='checked' " :
+	"";
+	$text .= "<input type='radio' {$checked} name='listtype' value='1' /> ".MENLAN_26."<br />";
+	$checked = ($listtype == 2) ? " checked='checked' " :
+	"";
+	$text .= "<input type='radio' {$checked} name='listtype' value='2' /> ".MENLAN_27."<br /><br />".MENLAN_28."<br />";
+	$text .= "<textarea name='pagelist' cols='60' rows='10' class='tbox'>$menu_pages</textarea>";
+	$text .= "
+	<tr>
+	<td style='text-align:center'><br />
+	<input class='button' type='submit' name='class_submit' value='".MENLAN_6."' />
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+	$caption = MENLAN_7." ".$menu_name;
+	$ns->tablerender($caption, $text);
+}
+
+unset($message);
+
+if ($menu_act == "sv") {
+	$pagelist = explode("\r\n", $_POST['pagelist']);
+	for ($i = 0 ; $i < count($pagelist) ; $i++) {
+		$pagelist[$i] = trim($pagelist[$i]);
+	}
+	$plist = implode("|", $pagelist);
+	$pageparms = $_POST['listtype'].'-'.$plist;
+	$pageparms = preg_replace("#\|$#", "", $pageparms);
+	$pageparms = (trim($_POST['pagelist']) == '') ? '' :
+	$pageparms;
+	$sql->db_Update("menus", "menu_class='".$_POST['menu_class']."', menu_pages='{$pageparms}' WHERE menu_id='$id' ");
+	$message = "<br />".MENLAN_8."<br />";
+}
+
+if ($menu_act == "move") {
+	$menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location='$newloc' ");
+	$sql->db_Update("menus", "menu_location='$newloc', menu_order='".($menu_count+1)."' WHERE menu_id='$id' ");
+	$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='$location' AND menu_order > $position");
+}
+
+if ($menu_act == "deac") {
+	$sql->db_Update("menus", "menu_location='0', menu_order='0' WHERE menu_id='$id' ");
+	$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='$location' AND menu_order > $position");
+}
+
+if ($menu_act == "bot") {
+	$menu_count = $sql->db_Count("menus", "(*)", " WHERE menu_location='$location' ");
+	$sql->db_Update("menus", "menu_order=".($menu_count+1)." WHERE menu_order='$position' AND menu_location='$location' ");
+	$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='$location' AND menu_order > $position");
+}
+
+if ($menu_act == "top") {
+	$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_location='$location' AND menu_order < $position");
+	$sql->db_Update("menus", "menu_order=1 WHERE menu_id='$id' ");
+}
+
+if ($menu_act == "dec") {
+	$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_order='".($position+1)."' AND menu_location='$location' ");
+	$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_id='$id' AND menu_location='$location' ");
+}
+
+if ($menu_act == "inc") {
+	$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_order='".($position-1)."' AND menu_location='$location' ");
+	$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_id='$id' AND menu_location='$location' ");
+}
+
+if (strpos(e_QUERY, 'configure') === FALSE)
+{
+	$efile = new e_file;
+	$fileList = $efile->get_files(e_PLUGIN,"_menu\.php$",'standard',2);
+	foreach($fileList as $file) {
+		list($parent_dir) = explode('/',str_replace(e_PLUGIN,"",$file['path']));
+		$file['path'] = str_replace(e_PLUGIN,"",$file['path']);
+		$file['fname'] = str_replace(".php","",$file['fname']);
+		if (!$sql->db_Count("menus", "(*)", "WHERE menu_name='{$file['fname']}'")) {
+			if (file_exists(e_PLUGIN.$parent_dir."/plugin.php")) {
+				include(e_PLUGIN.$parent_dir."/plugin.php");
+				if ($sql->db_Select("plugin", "*", "plugin_path='".$eplug_folder."' AND plugin_installflag='1' ")) {
+					$sql->db_Insert("menus", " 0, '{$file['fname']}', 0, 0, 0, '' ,'{$file['path']}'");
+					$message .= "<b>".MENLAN_10." - ".$file['fname']."</b><br />";
+				}
+			} else {
+				$sql->db_Insert("menus", " 0, '{$file['fname']}', 0, 0, 0, '' ,'{$file['path']}'");
+				$message .= "<b>".MENLAN_10." - ".$file['fname']."</b><br />";
+			}
+		}
+		$menustr .= "&".str_replace(".php", "", $file['fname']);
+	}
+
+$sql2 = new db;
+foreach ($menu_areas as $menu_act) {
+	if ($sql->db_Select("menus", "*", "menu_location='$menu_act' ORDER BY menu_order ASC")) {
+		$c = 1;
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			$sql2->db_Update("menus", "menu_order='$c' WHERE menu_id='$menu_id' ");
+			$c++;
+		}
+	}
+}
+
+$sql->db_Select("menus", "*", "menu_path NOT REGEXP('[0-9]+') ");
+while (list($menu_id, $menu_name, $menu_location, $menu_order) = $sql->db_Fetch())
+{
+	if (stristr($menustr, $menu_name) === FALSE)
+	{
+		$sql2->db_Delete("menus", "menu_name='$menu_name'");
+		$message .= "<b>".MENLAN_11." - ".$menu_name."</b><br />";
+	}
+}
+}
+
+foreach ($menu_areas as $menu_act) {
+	$menus_sql[] = "menu_location!='".$menu_act."'";
+}
+
+if ($message != "")
+{
+	echo $ns -> tablerender('Updated', "<div style='text-align:center'><b>".$message."</b></div><br /><br />");
+}
+if (strpos(e_QUERY, 'configure') === FALSE)
+{
+	$cnt = $sql->db_Select("menus", "*", "menu_location='1' ORDER BY menu_name "); // calculate height to remove vertical scroll-bar.
+	$text = "<iframe src='".e_SELF."?configure' width='100%' style='width: 100%; height: ".(($cnt*80)+600)."px; border: 0px' frameborder='0' scrolling='auto' ></iframe>";
+	echo $ns -> tablerender(MENLAN_35, $text, 'menus_config');
+}
+else
+{
+
+	$menus_query = implode(' && ', $menus_sql);
+	$sql->db_Update("menus", "menu_location='0', menu_order='0' WHERE ".$menus_query);
+
+	if ($CUSTOMPAGES) {
+		if ($menu_act != 'adv') {
+			$text = "<form  method='post' action='".e_SELF."?configure.".$menus_equery[1]."'><div style='width: 100%'>
+			<table class='fborder' style='".ADMIN_WIDTH."'>
+			<tr>
+			<td class='forumheader3' style='width: 90%'>
+			".MENLAN_30."
+			</td>
+			<td class='forumheader3' style='width: 10%; text-align: center;'>";
+
+			$text .= $frm->form_select_open('custom_select', 'onchange="this.form.submit()"');
+
+			if ($menus_equery[1] == '' || $menus_equery[1] == 'default_layout') {
+				$text .= $frm->form_option(MENLAN_31, 'selected', 'default_layout');
+			} else {
+				$text .= $frm->form_option(MENLAN_31, FALSE, 'default_layout');
+			}
+
+			if ($NEWSHEADER) {
+				if ($menus_equery[1] == 'newsheader_layout') {
+					$text .= $frm->form_option(MENLAN_32, 'selected', 'newsheader_layout');
+				} else {
+					$text .= $frm->form_option(MENLAN_32, FALSE, 'newsheader_layout');
+				}
+			}
+
+			if ($CUSTOMPAGES) {
+				if (is_array($CUSTOMPAGES)) {
+					foreach ($CUSTOMPAGES as $custom_pages_key => $custom_pages_value) {
+						if ($menus_equery[1] == $custom_pages_key) {
+							$text .= $frm->form_option($custom_pages_key, 'selected', $custom_pages_key);
+						} else {
+							$text .= $frm->form_option($custom_pages_key, FALSE, $custom_pages_key);
+						}
+					}
+				} else {
+					if ($menus_equery[1] == 'custom_layout') {
+						$text .= $frm->form_option(MENLAN_33, 'selected', 'custom_layout');
+					} else {
+						$text .= $frm->form_option(MENLAN_33, FALSE, 'custom_layout');
+					}
+				}
+			}
+
+			$text .= $frm->form_select_close();
+
+			$text .= "</td>
+			</tr>
+			</table></div>
+			</form>";
+
+			$ns->tablerender(MENLAN_29, $text);
+		}
+	}
+
+
+	parseheader($menus_header);
+	echo "<div style='text-align:center'>";
+	echo $frm->form_open("post", e_SELF."?configure.".$menus_equery[1], "menuActivation");
+	$text = "<table style='margin-left:auto;margin-right:auto'>";
+
+	$sql->db_Select("menus", "*", "menu_location='0' ORDER BY menu_name ");
+	$text .= "<tr><td style='width:50%;text-align:center;padding-bottom:4px'>".MENLAN_36."...</td><td style='width:50%;padding-bottom:4px;text-align:center'>...".MENLAN_37."</td></tr>";
+	$text .= "<tr><td style='width:50%;vertical-align:top;text-align:center'>";
+
+	$text .= "<select name='menuselect[]' class='tbox' multiple='multiple' style='height:200px;width:95%'>";
+	while ($row = $sql->db_Fetch())
+	{
+		extract($row);
+		if($menu_pages == "dbcustom")
+		{
+			$menu_name .= " [custom]";
+		}
+		else
+		{
+			$menu_name = preg_replace("#_menu#i", "", $menu_name);
+		}
+		$text .= "<option value='$menu_id'>$menu_name</option>\n";
+
+	}
+	$text .= "</select>";
+	$text .= "<br /><br /><span class='smalltext'>".MENLAN_38."</span>";
+	$text .= "</td><td style='width:50%;vertical-align:top;text-align:center'><br />";
+	foreach ($menu_areas as $menu_act) {
+		$text .= "<input type='submit' class='button' id='menuAct_".trim($menu_act)."' name='menuActivate[".trim($menu_act)."]' value='".MENLAN_13." ".trim($menu_act)."' /><br /><br />\n";
+	}
+	$text .= "</td>";
+
+	$text .= "</tr></table>";
+	echo $ns -> tablerender(MENLAN_22, $text);
+	echo $frm->form_close();
+	echo "</div>";
+
+	parseheader($menus_footer);
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+function parseheader($LAYOUT, $check = FALSE) {
+	$tmp = explode("\n", $LAYOUT);
+	for ($c = 0; $c < count($tmp); $c++) {
+		if (preg_match("/[\{|\}]/", $tmp[$c])) {
+			if ($check) {
+				if (strstr($tmp[$c], "MENU")) {
+					$str[] = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $tmp[$c]);
+				}
+			} else {
+				checklayout($tmp[$c]);
+			}
+		} else {
+			if (!$check) {
+				echo $tmp[$c];
+			}
+		}
+	}
+	if ($check) {
+		return $str;
+	}
+}
+
+function checklayout($str) {
+	global $pref, $menu_areas, $ns, $PLUGINS_DIRECTORY, $frm, $sc_style, $tp;
+
+	if (strstr($str, "LOGO")) {
+		echo $tp -> parseTemplate("{LOGO}");
+	}
+	else if(strstr($str, "SITENAME")) {
+		echo "<div style='padding: 2px'>[SiteName]</div>";
+	}
+	else if (strstr($str, "SITETAG")) {
+		echo "<div style='padding: 2px'>[SiteTag]</div>";
+	}
+	else if (strstr($str, "SITELINKS")) {
+		echo "<div style='padding: 2px; text-align: center'>[SiteLinks]</div>";
+	}
+	else if (strstr($str, "CUSTOM")) {
+		$cust = preg_replace("/\W*\{CUSTOM=(.*?)(\+.*)?\}\W*/si", "\\1", $str);
+		echo "<div style='padding: 2px'>[".$cust."]</div>";
+	}
+	// Display embedded Plugin information.
+	else if (strstr($str, "PLUGIN")){
+		$plug = preg_replace("/\{PLUGIN=(.*?)\}/si", "\\1", $str);
+		$plug = trim($plug);
+		if (file_exists((e_PLUGIN."{$plug}/{$plug}_config.php"))){
+			$link = e_PLUGIN."{$plug}/{$plug}_config.php";
+		}
+
+		if(file_exists((e_PLUGIN.$plug."/config.php"))){
+			$link = e_PLUGIN.$plug."/config.php";
+		}
+
+		$plugtext = ($link) ? "(".MENLAN_34.":<a href='$link' title='".MENLAN_16."'>".MENLAN_16."</a>)" : "(".MENLAN_34.")" ;
+		echo "<br />";
+		$ns -> tablerender($plug, $plugtext);
+	}
+	else if (strstr($str, "MENU")) {
+		$ns = new e107table;
+		$menu = preg_replace("/\{MENU=(.*?)(:.*?)?\}/si", "\\1", $str);
+		if (isset($sc_style['MENU']['pre']) && strpos($str, 'ret') !== false) {
+			echo $sc_style['MENU']['pre'];
+		}
+		echo "<div style='text-align:center; font-size:14px' class='fborder'><div class='forumheader'><b>".MENLAN_14."  ".$menu."</b></div></div><br />";
+		$text = "&nbsp;";
+		$sql9 = new db;
+		if ($sql9->db_Count("menus", "(*)", " WHERE menu_location='$menu' ")) {
+			unset($text);
+			echo $frm->form_open("post", e_SELF."?configure.".$menus_equery[1], "frm_menu_".intval($menu));
+
+			$sql9->db_Select("menus", "*", "menu_location='$menu' ORDER BY menu_order");
+			$menu_count = $sql9->db_Rows();
+			while (list($menu_id, $menu_name, $menu_location, $menu_order, $menu_class, $menu_pages, $menu_path) = $sql9->db_Fetch()) {
+				$menu_name = preg_replace("#_menu#i", "", $menu_name);
+				$vis = ($menu_class || strlen($menu_pages) > 1) ? " <span style='color:red'>*</span> " :
+				"";
+				$caption = "<div style='text-align:center'>{$menu_name}{$vis}</div>";
+				$menu_info = "{$menu_location}.{$menu_order}";
+
+				$text = "";
+				$conf = '';
+				if (file_exists(e_PLUGIN."{$menu_path}/{$menu_name}_menu_config.php"))
+				{
+					$conf = "config.{$menu_path}.{$menu_name}_menu_config";
+				}
+
+				if($conf == '' && file_exists(e_PLUGIN."{$menu_path}/config.php"))
+				{
+					$conf = "config.{$menu_path}.config";
+				}
+
+				$text .= "<select id='menuAct_$menu_id' name='menuAct[$menu_id]' class='tbox' onchange='this.form.submit()' >";
+				$text .= $frm->form_option(MENLAN_25, TRUE, " ");
+				$text .= $frm->form_option(MENLAN_15, "", "deac.{$menu_info}");
+
+				if ($conf) {
+					$text .= $frm->form_option(MENLAN_16, "", $conf);
+				}
+
+				if ($menu_order != 1) {
+					$text .= $frm->form_option(MENLAN_17, "", "inc.{$menu_info}");
+					$text .= $frm->form_option(MENLAN_24, "", "top.{$menu_info}");
+				}
+				if ($menu_count != $menu_order) {
+					$text .= $frm->form_option(MENLAN_18, "", "dec.{$menu_info}");
+					$text .= $frm->form_option(MENLAN_23, "", "bot.{$menu_info}");
+				}
+				foreach ($menu_areas as $menu_act) {
+					if ($menu != $menu_act) {
+						$text .= $frm->form_option(MENLAN_19." ".$menu_act, "", "move.{$menu_info}.".$menu_act);
+					}
+				}
+				$text .= $frm->form_option(MENLAN_20, "", "adv.{$menu_info}");
+				$text .= $frm->form_select_close();
+				$ns->tablerender($caption, $text);
+				echo "<div><br /></div>";
+			}
+			echo $frm->form_close();
+		}
+		if(isset($sc_style['MENU']['post']) && strpos($str, 'ret') !== false) {
+			echo $sc_style['MENU']['post'];
+		}
+	}
+	else if (strstr($str, "SETSTYLE")) {
+		$tmp = explode("=", $str);
+		$style = preg_replace("/\{SETSTYLE=(.*?)\}/si", "\\1", $str);
+	}
+	else if (strstr($str, "SITEDISCLAIMER")) {
+		echo "[Sitedisclaimer]";
+	}
+}
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+require_once("footer.php");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/message.php 75/e107_admin/message.php
--- 6171/e107_admin/message.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/message.php	2005-12-24 19:26:59.000000000 -0600
@@ -0,0 +1,190 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/message.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/25 01:26:59 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+
+$e_sub_cat = 'message';
+require_once("auth.php");
+$gen = new convert;
+
+$messageTypes = array("Broken Download", "Dev Team Message");
+$queryString = "";
+foreach($messageTypes as $types) {
+	$queryString .= " gen_type='$types' OR";
+}
+$queryString = substr($queryString, 0, -3);
+
+if(isset($_POST['delete_message']))
+{
+	if(preg_match("/\s[0-9]+/si", $_POST['delete_message'], $match))
+	{
+		$id = $match[0];
+		$sql->db_Delete("generic", "gen_id=$id");
+		$message = MESSLAN_3;
+	}
+}
+
+if(isset($_POST['delete_all']) && isset($_POST['deleteconfirm']))
+{
+	$sql->db_Delete("generic", $queryString);
+	$message = MESSLAN_6;
+}
+
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+
+if($amount = $sql -> db_Select("generic", "*", $queryString))
+{
+
+
+	$text = "<table style='width: 98%;' class='fborder'>\n<form method='post' action='".e_SELF."'>\n";
+	$messages = $sql -> db_getList();
+
+	foreach($messages as $message)
+	{
+		extract($message);
+
+		$sql -> db_Select("user", "user_name", "user_id=$gen_user_id");
+		$user = $sql -> db_Fetch();
+		$user = "<a href='".e_BASE."user.php?id.$gen_user_id'>".$user['user_name']."</a>";
+
+		switch($gen_type)
+		{
+			case "Broken Download":
+				$link = "<a href='".e_BASE."download.php?view.$gen_intdata' rel='external' title='".MESSLAN_11."'>$gen_ip</a>";
+			break;
+			case "Dev Team Message":
+				$link = "";
+			break;
+		}
+
+
+		$text .= "<tr>
+<td style='width: 100%;' class='forumheader3'><b>".MESSLAN_8."</b>: $gen_type<br />
+<b>".MESSLAN_9."</b>: ".$gen->convert_date($gen_datestamp, 'long')."<br />
+<b>".MESSLAN_10."</b>: $user<br />
+<b>".MESSLAN_13."</b>: $link".
+($gen_chardata ? "<br /><b>".MESSLAN_12."</b>: $gen_chardata" : "")."<br /><input class='button' type='submit' name='delete_message' value='".MESSLAN_2." $gen_id' />
+</td>\n</tr>\n";
+	}
+
+$text .= "
+<tr>
+<td><br /><input class='button' type='submit' name='delete_all' value='".MESSLAN_4."' />
+<input type='checkbox' name='deleteconfirm' value='1'> ".MESSLAN_5."
+</td>
+</tr>
+
+
+</form></table>";
+}
+else
+{
+	$text = MESSLAN_7;
+}
+$ns->tablerender(MESSLAN_1, $text);
+	
+require_once("footer.php");
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/*
+if ($action != "edit") {
+	$text = $rs->form_open("post", e_SELF, "ban_form")."<div style='text-align:center'>".$rs->form_hidden("ban_secure", "1")."<div style='padding : 1px; ".ADMIN_WIDTH."; height : 170px; overflow : auto; margin-left: auto; margin-right: auto;'>\n";
+	if (!$ban_total = $sql->db_Select("banlist")) {
+		$text .= "<div style='text-align:center'>".BANLAN_2."</div>";
+	} else {
+		$text .= "<table class='fborder' style='width:99%;'>
+			<tr>
+			<td style='width:70%' class='fcaption'>".BANLAN_10."</td>
+			<td style='width:30%' class='fcaption'>".BANLAN_11."</td>
+			</tr>";
+		$count = 0;
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			$text .= "<tr><td style='width:70%' class='forumheader3'>$banlist_ip<br />".BANLAN_7.": $banlist_reason</td>
+				<td style='width:30%; text-align:center' class='forumheader3'>".$rs->form_button("submit", "main_edit_$count", BANLAN_12, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?edit-$banlist_ip'\"").$rs->form_button("submit", "main_delete_$count", BANLAN_4, "onclick=\"document.getElementById('ban_form').action='".e_SELF."?remove-$banlist_ip'\"")."</td>\n</tr>";
+			$count++;
+		}
+		$text .= "</table>\n";
+	}
+	$text .= "</div></div>".$rs->form_close();
+	$ns->tablerender(BANLAN_3, $text);
+}
+	
+if ($action == "edit") {
+	$sql2->db_Select("banlist", "*", "banlist_ip='$sub_action'");
+	$row = $sql2->db_Fetch();
+	extract($row);
+} else {
+	unset($banlist_ip, $banlist_reason);
+	if (e_QUERY && strpos($_SERVER["HTTP_REFERER"], "userinfo")) {
+		$banlist_ip = $action;
+	}
+}
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	 
+	<tr>
+	<td style='width:30%' class='forumheader3'>".BANLAN_5.": </td>
+	<td style='width:70%' class='forumheader3'>
+	<input class='tbox' type='text' name='ban_ip' size='40' value='".$banlist_ip."' maxlength='200' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:20%' class='forumheader3'>".BANLAN_7.": </td>
+	<td style='width:80%' class='forumheader3'>
+	<textarea class='tbox' name='ban_reason' cols='50' rows='4'>$banlist_reason</textarea>
+	</td>
+	</tr>
+	 
+	<tr style='vertical-align:top'>
+	<td colspan='2' style='text-align:center' class='forumheader'>".  
+($action == "edit" ? "<input type='hidden' name='old_ip' value='$banlist_ip' /><input class='button' type='submit' name='update_ban' value='".BANLAN_13."' />" : "<input class='button' type='submit' name='add_ban' value='".BANLAN_8."' />")."
+	 
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+	
+$ns->tablerender(BANLAN_9, $text);
+	
+require_once("footer.php");
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/meta.php 75/e107_admin/meta.php
--- 6171/e107_admin/meta.php	2004-05-14 20:58:48.000000000 -0500
+++ 75/e107_admin/meta.php	2006-01-19 18:50:31.000000000 -0600
@@ -1,88 +1,120 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|    e107 website system
-|    /admin/meta.php
-|
-|    Steve Dunstan 2001-2002
-|    http://e107.org
-|    jalist@e107.org
-|
-|    Released under the terms and conditions of the
-|    GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("C")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-
-if(IsSet($_POST['metasubmit'])){
-    $aj = new textparse;
-    $pref['meta_tag'] = $aj -> formtpa($_POST['meta'], "admin");
-    save_prefs();
-    $message = METLAN_1;
-}
-
-if($message){
-    $ns -> tablerender(METLAN_4, "<div
-style='text-align:center'>".METLAN_1.".</div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."' id='dataform'>
-<table style='width:85%' class='fborder'>
-<tr>
-
-<td style='width:30%' class='forumheader3'>".METLAN_2.": </td>
-<td style='width:70%' class='forumheader3'>
-<textarea class='tbox' id='meta' name='meta' cols='70'
-rows='10'>".$pref['meta_tag']."</textarea>
-<br />";
-$text .= <<< EOT
-<input class="button" type="button" value="description"
-onclick="addtext2('<meta name=\'description\' content=\'
-EOT;
-$text .= METLAN_5;
-$text .= <<< EOT
-\' />')" />
-<input class="button" type="button" value="keywords"
-onclick="addtext2('<meta name=\'keywords\' content=\'
-EOT;
-$text .= METLAN_6;
-$text .= <<< EOT
-\' />')" />
-<input class="button" type="button" value="copyright"
-onclick="addtext2('<meta name=\'copyright\' content=\'
-EOT;
-$text .= METLAN_7;
-$text .= <<< EOT
-\' />')" />
-EOT;
-$text .= "</td>
-</tr>
-
-<tr><td colspan='2' style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='metasubmit'
-value='".METLAN_3."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender(METLAN_8, $text);
-
-function headerjs(){
-$headerjs = "<script type=\"text/javascript\">
-function addtext2(str){
-    document.getElementById('meta').value += str;
-}
-</script>\n";
-return $headerjs;
-}
-
-?>
-
-<?php
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/meta.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2006/01/20 00:50:31 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("T")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'meta';
+require_once("auth.php");
+
+$current_lang = ($sql->mySQLlanguage != "") ? $sql->mySQLlanguage : $pref['sitelanguage'];
+
+if (isset($_POST['metasubmit'])) {
+
+	$tmp = $pref['meta_tag'];
+	$langs = explode(",",e_LANLIST);
+	foreach($langs as $lan){
+		$meta_tag[$lan] = $tmp[$lan];
+		$meta_diz[$lan] = $pref['meta_description'][$lan];
+		$meta_keywords[$lan] = $pref['meta_keywords'][$lan];
+		$meta_copyright[$lan] = $pref['meta_copyright'][$lan];
+	}
+
+	$meta_tag[$current_lang] = strip_if_magic(chop($_POST['meta']));
+	$meta_diz[$current_lang] = strip_if_magic(chop($_POST['meta_description']));
+	$meta_keywords[$current_lang] = strip_if_magic(chop($_POST['meta_keywords']));
+	$meta_copyright[$current_lang] = strip_if_magic(chop($_POST['meta_copyright']));
+	
+
+	$pref['meta_tag'] = $meta_tag;
+	$pref['meta_description'] = $meta_diz;
+	$pref['meta_keywords'] = $meta_keywords;
+	$pref['meta_copyright'] = $meta_copyright;
+   /*
+    if($pref['meta_tag'][$current_lang] == ""){
+        unset($meta_tag[$current_lang]);
+    }*/
+
+	save_prefs();
+	$message = METLAN_1;
+}
+
+if ($message) {
+	$ns->tablerender(METLAN_4, "<div style='text-align:center'>".METLAN_1." (".$current_lang.").</div>");
+}
+
+$meta = $pref['meta_tag'];
+$meta_diz = $pref['meta_description'];
+$meta_keywords = $pref['meta_keywords'];
+$meta_copyright = $pref['meta_copyright'];
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."' id='dataform'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+
+	<tr>
+    <td style='width:25%' class='forumheader3'>".METLAN_9."</td>
+    <td style='width:75%' class='forumheader3'>
+	<input class='tbox' style='width:90%' size='70' type='text' name='meta_description' value='".$meta_diz[$current_lang]."' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:25%' class='forumheader3'>".METLAN_10."</td>
+    <td style='width:75%' class='forumheader3'>
+	<input class='tbox' style='width:90%' size='70' type='text' name='meta_keywords' value='".$meta_keywords[$current_lang]."' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:25%' class='forumheader3'>".METLAN_11."</td>
+    <td style='width:75%' class='forumheader3'>
+	<input class='tbox' style='width:90%' size='70' type='text' name='meta_copyright' value='".$meta_copyright[$current_lang]."' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:25%' class='forumheader3'>".METLAN_2.":
+	<span class='smalltext'><br /><br />eg.
+	&lt;meta name='author' content='your name' /&gt; </span>
+	</td>
+	<td style='width:75%' class='forumheader3'>
+	<textarea class='tbox' title=\"eg. <meta name='author' content='your name' />\" id='meta' name='meta' cols='70'
+	rows='10' style='width:90%' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".str_replace("<","&lt;",$tp->toForm($meta[$current_lang]))."</textarea>
+	<br />";
+$text .= "</td>
+</tr>
+
+<tr><td colspan='2' style='text-align:center' class='forumheader'>
+
+<input class='button' type='submit' name='metasubmit' value='".METLAN_3."' />
+</td>
+</tr>
+</table>
+</form>
+</div>";
+
+
+
+$ns -> tablerender(METLAN_8." (".$current_lang.")", $text);
+
+require_once("footer.php");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/modcomment.php 75/e107_admin/modcomment.php
--- 6171/e107_admin/modcomment.php	2004-06-03 11:41:12.000000000 -0500
+++ 75/e107_admin/modcomment.php	2006-02-24 12:36:35.000000000 -0600
@@ -1,124 +1,179 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("B")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-
-$tmp = explode(".", e_QUERY);
-$table = $tmp[0];
-$id = $tmp[1];
-
-switch($table){
-	case "news": $type=0; break;
-	case "content" : $type=1; break;
-	case "download" : $type=2; break;
-	case "faq" : $tid=3; $type = "faq"; break;
-	case "poll" :  $type = 4;  break;
-	case "docs" : $tid=5; $type = "docs";  break;
-	case "bugtrack" : $tid=6; $type = "bugtrack";  break;
-	default : $tid = ""; $type=$table; 
-
-	/****************************************
-	Add your comment type here in same format as above, ie ...
-	case "your_comment_type"; $type = your_type_id; break;
-	****************************************/
-}
-
-if(IsSet($_POST['moderate'])){
-	extract($_POST);
-	if(is_array($comment_blocked)){
-		while (list ($key, $cid) = each ($comment_blocked)){
-			$sql -> db_Update("comments", "comment_blocked='1' WHERE comment_id='$cid' ");
-		}
-	}
-	if(is_array($comment_unblocked)){
-		while (list ($key, $cid) = each ($comment_unblocked)){
-			$sql -> db_Update("comments", "comment_blocked='0' WHERE comment_id='$cid' ");
-		}
-	}
-	if(is_array($comment_delete)){
-		while (list ($key, $cid) = each ($comment_delete)){ 
-			if($sql -> db_Select("comments", "*",  "comment_id='$cid' ")){
-				$row = $sql -> db_Fetch(); 
-				delete_children($row, $cid);
-			}
-		}
-	}
-	clear_cache("comment");
-	$message = MDCLAN_1;
-}
-
-if(IsSet($message)){
-	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."'>
-<table style='width:95%' class='fborder'>";
-
-if(!$sql -> db_Select("comments", "*", "(comment_type='".$type."' OR comment_type='".$tid."') AND comment_item_id=$id")){
-	$text .= "<tr><td class='forumheader3' style='text-align:center'>".MDCLAN_2.".</td></tr></table></form></div>";
-}else{
-	$con = new convert;
-	$aj = new textparse();
-	$sql2 = new db;
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		$datestamp = $con->convert_date($comment_datestamp, "short");
-		$comment_author_id = substr($comment_author, 0, strpos($comment_author, "."));
-		if($comment_author_id){
-			$sql2 -> db_Select("user", "*", "user_id='$comment_author_id' ");
-			$row = $sql2 -> db_Fetch(); extract($row);
-			$comment_nick = "<a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>";
-			$comment_str = MDCLAN_3." #".$user_id;
-		}else{
-			$comment_str = MDCLAN_4;
-			$comment_nick = eregi_replace("[0-9]+\.", "", $comment_author);
-		}
-		$comment_comment = $aj -> tpa($comment_comment);
-		$text .= "<tr><td class='forumheader3' style='width:5%; text-align: center;'>".($comment_blocked ? "<img src='".e_IMAGE."generic/blocked.png' />" : "&nbsp;")."</td><td class='forumheader3' style='width:15%'>$datestamp</td><td class='forumheader3' style='width:15%'><b>".$comment_nick."</b><br />".$comment_str."</td><td class='forumheader3' style='width:40%'>".$comment_comment."</td><td class='forumheader3' style='width:25%' style='text-align:center'>".($comment_blocked ?  "<input type='checkbox' name='comment_unblocked[]' value='$comment_id' /> ".MDCLAN_5."" : "<input type='checkbox' name='comment_blocked[]' value='$comment_id' /> ".MDCLAN_6."")."&nbsp;<input type='checkbox' name='comment_delete[]' value='$comment_id' /> ".MDCLAN_7."</td></tr>";
-
-	}
-
-	$text .= "<tr><td colspan='5' class='forumheader' style='text-align:center'>".MDCLAN_9."</td></tr>
-	<tr><td colspan='5' class='forumheader' style='text-align:center'><input class='button' type='submit' name='moderate' value='".MDCLAN_8."' /></td></tr></table></form></div>";
-
-}
-
-$ns -> tablerender(MDCLAN_8, $text);
-
-require_once("footer.php");
-
-
-	function delete_children($row, $cid){
-		global $sql;
-		extract($row);
-		$tmp = explode(".", $row['comment_author']);
-		$u_id = $tmp[0];
-		if($u_id >= 1){
-			$sql -> db_Update("user", "user_comments=user_comments-1 WHERE user_id='$u_id'");
-		}
-		$sql2 = new db;
-		if($sql2 -> db_Select("comments", "*", "comment_pid='$comment_id'")){
-				while($row = $sql2 -> db_Fetch()){
-					delete_children($row, $row['comment_id']);
-				}
-		}
-		$c_del[] = $cid;
-		while (list ($key, $cid) = each ($c_del)){ 
-			
-			$sql -> db_Delete("comments", "comment_id='$cid'");
-		}
-	}
-?>	
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/modcomment.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2006/02/24 18:36:35 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("B")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+require_once("auth.php");
+require_once(e_HANDLER."comment_class.php");
+$cobj = new comment;
+global $tp;
+
+$tmp	= explode(".", e_QUERY);
+$table	= $tmp[0];
+$id		= intval($tmp[1]);
+$editid	= intval($tmp[2]);
+$type	= $cobj -> getCommentType($table);
+
+if (isset($_POST['moderate'])) {
+	if (isset($_POST['comment_comment'])) {
+		$sql->db_Update("comments", "comment_comment='".$tp -> todb($_POST['comment_comment'])."' WHERE comment_id='$editid' ");
+		header("location: ".e_ADMIN."modcomment.php?{$table}.{$id}"); exit;
+	}
+	if (isset($_POST['comment_lock']) && $_POST['comment_lock'] == "1" && $_POST['comment_lock'] != $_POST['current_lock']) {
+		$sql->db_Update("comments", "comment_lock='1' WHERE comment_item_id='$id' ");
+	}
+	if ((!isset($_POST['comment_lock']) || $_POST['comment_lock'] == "0") && $_POST['comment_lock'] != $_POST['current_lock']) {
+		$sql->db_Update("comments", "comment_lock='0' WHERE comment_item_id='$id' ");
+	}
+	if (is_array($_POST['comment_blocked'])) {
+		while (list ($key, $cid) = each ($_POST['comment_blocked'])) {
+			$sql->db_Update("comments", "comment_blocked='1' WHERE comment_id='$cid' ");
+		}
+	}
+	if (is_array($_POST['comment_unblocked'])) {
+		while (list ($key, $cid) = each ($_POST['comment_unblocked'])) {
+			$sql->db_Update("comments", "comment_blocked='0' WHERE comment_id='$cid' ");
+		}
+	}
+	if (is_array($_POST['comment_delete'])) {
+		while (list ($key, $cid) = each ($_POST['comment_delete'])) {
+			if ($sql->db_Select("comments", "*", "comment_id='$cid' ")) {
+				$row = $sql->db_Fetch();
+				delete_children($row, $cid);
+			}
+		}
+	}
+	$e107cache->clear("comment");
+	$e107cache->clear("news");
+	$e107cache->clear($table);
+	$message = MDCLAN_1;
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+$text = "
+<div style='text-align:center'>
+<form method='post' action='".e_SELF."?".e_QUERY."'>
+<table class='fborder' style='".ADMIN_WIDTH."'>";
+
+if ($editid)
+{
+	if (!$sql->db_Select("comments", "*", "comment_id=$editid")) {
+		$text .= "<tr><td class='forumheader3' style='text-align:center'>".MDCLAN_2.".</td></tr>";
+	}
+	else
+	{
+		$row = $sql->db_Fetch();
+		$text .= "<tr><td><textarea class='tbox' name='comment_comment' cols='1' rows='15' style='width:100%;'>".$row['comment_comment']."</textarea></td></tr>";
+		$text .= "<tr><td colspan='5' class='forumheader' style='text-align:center'><input class='button' type='submit' name='moderate' value='".MDCLAN_8."' /></td></tr>";
+	}
+
+	$text .= "</table></form></div>";
+	$ns->tablerender(MDCLAN_8, $text);
+	require_once("footer.php"); exit;
+}
+
+if (!$sql->db_Select("comments", "*", "(comment_type='".$type."' OR comment_type='".$table."') AND comment_item_id=$id")) {
+	$text .= "<tr><td class='forumheader3' style='text-align:center'>".MDCLAN_2.".</td></tr>";
+} else {
+	$con = new convert;
+
+	$commentArray = $sql -> db_getList();
+	$total_comments = count($commentArray);
+
+	$comments = "";
+	foreach($commentArray as $row)
+	{
+		$comment_lock = $row['comment_lock'];
+		$total_blocked += $row['comment_blocked'];
+		$datestamp = $con->convert_date($row['comment_datestamp'], "short");
+		$comment_author_id = substr($row['comment_author'], 0, strpos($row['comment_author'], "."));
+		if ($comment_author_id) {
+			$sql->db_Select("user", "*", "user_id='$comment_author_id' ");
+			$rowu = $sql->db_Fetch();
+			$comment_nick = "<a href='".e_BASE."user.php?id.".$rowu['user_id']."'>".$rowu['user_name']."</a>";
+			$comment_str = MDCLAN_3." #".$rowu['user_id'];
+		} else {
+			$comment_str = MDCLAN_4;
+			$comment_nick = preg_replace("#[0-9]+\.#", "", $row['comment_author']);
+		}
+		$row['comment_comment'] = $tp->toHTML($row['comment_comment'], TRUE, "");
+
+		$comments .= "
+		<tr>
+			<td class='forumheader3' style='width:5%; text-align:center;'>".($row['comment_blocked'] ? "<img src='".e_IMAGE."admin_images/blocked.png' />" : "&nbsp;")."</td>
+			<td class='forumheader3' style='width:15%;'>".$datestamp."</td>
+			<td class='forumheader3' style='width:15%;'><b>".$comment_nick."</b><br />".$comment_str."</td>
+			<td class='forumheader3' style='width:40%;'>".$row['comment_comment']."</td>
+			<td class='forumheader3' style='width:25%;'>
+				<a href='".e_ADMIN."modcomment.php?{$table}.{$id}.".$row['comment_id']."'><img src='".e_IMAGE."admin_images/edit_16.png' alt='".LAN_EDIT."' title='".LAN_EDIT."' style='border:none' /></a>"
+				."&nbsp;".($row['comment_blocked'] ? "<input type='checkbox' name='comment_unblocked[]' value='".$row['comment_id']."' /> ".MDCLAN_5."" : "<input type='checkbox' name='comment_blocked[]' value='".$row['comment_id']."' /> ".MDCLAN_6."")
+				."&nbsp;<input type='checkbox' name='comment_delete[]' value='".$row['comment_id']."' /> ".LAN_DELETE."
+			</td>
+		</tr>";
+	}
+	$text .= "
+	<tr><td colspan='5' class='fcaption'>".MDCLAN_10."</td></tr>
+	<tr>
+	<td class='forumheader3' style='text-align:right' colspan='4'>".MDCLAN_14.":</td>
+	<td style='width:25%;' class='forumheader3'>
+	<input type='radio' name='comment_lock' value='0' ".(!$comment_lock ? " checked='checked'" : "")." /> ".MDCLAN_15." 
+	<input type='radio' name='comment_lock' value='1' ".($comment_lock ? " checked='checked'" : "")." /> ".MDCLAN_16."
+	<input type='hidden' name='current_lock' value='".$comment_lock."' />
+	</td>
+	</tr>
+	<tr><td colspan='5' class='fcaption'>comments (".$total_comments." ".($total_comments == "1" ? MDCLAN_11 : MDCLAN_12).", ".$total_blocked." ".MDCLAN_13.")</td></tr>
+	".$comments."
+	<tr><td colspan='5' class='forumheader' style='text-align:center'>".MDCLAN_9."</td></tr>
+	<tr><td colspan='5' class='forumheader' style='text-align:center'><input class='button' type='submit' name='moderate' value='".MDCLAN_8."' /></td></tr>
+	";
+}
+$text .= "</table></form></div>";
+
+$ns->tablerender(MDCLAN_8, $text);
+
+require_once("footer.php");
+
+function delete_children($row, $cid) {
+	global $sql, $sql2, $table;
+
+	$tmp = explode(".", $row['comment_author']);
+	$u_id = $tmp[0];
+	if ($u_id >= 1) {
+		$sql->db_Update("user", "user_comments=user_comments-1 WHERE user_id='$u_id'");
+	}
+	if($table == "news"){
+		$sql->db_Update("news", "news_comment_total=news_comment_total-1 WHERE news_id='".$row['comment_item_id']."'");
+	}
+	if ($sql2->db_Select("comments", "*", "comment_pid='".$row['comment_id']."'")) {
+		while ($row2 = $sql2->db_Fetch()) {
+			delete_children($row2, $row2['comment_id']);
+		}
+	}
+	$c_del[] = $cid;
+	while (list ($key, $cid) = each ($c_del)) {
+		$sql->db_Delete("comments", "comment_id='$cid'");
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/newsfeed.php 75/e107_admin/newsfeed.php
--- 6171/e107_admin/newsfeed.php	2004-05-18 22:32:30.000000000 -0500
+++ 75/e107_admin/newsfeed.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,130 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/headlines_conf.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("E")){ header("location:".e_BASE."index.php"); exit;}
-require_once("auth.php");
-
-
-if(IsSet($_POST['add_headline'])){
-
-        $datestamp = time();
-        if($_POST['headline_url']){
-                $sql -> db_Insert("headlines", "0, '".$_POST['headline_url']."', '', '0', '', '".$_POST['headline_image']."', '".$_POST['activate']."' ");
-                $message = NWFLAN_1;
-                unset($headline_url, $headline_image);
-        }else{
-                $message = NWFLAN_20;
-        }
-}
-
-if(IsSet($_POST['update_headline'])){
-        $sql -> db_Update("headlines", "headline_url='".$_POST['headline_url']."', headline_timestamp='0', headline_image='".$_POST['headline_image']."', headline_active='".$_POST['activate']."' WHERE headline_id='".$_POST['headline_id']."'");
-        $message = NWFLAN_2;
-        unset($headline_url, $headline_image);
-}
-
-if(IsSet($_POST['delete'])){
-        if($_POST['confirm']){
-                $sql -> db_Delete("headlines", "headline_url='".$_POST['existing']."' ");
-                $message = NWFLAN_3;
-        }else{
-                $message = NWFLAN_4;
-        }
-}
-
-if(IsSet($_POST['edit'])){
-        $sql -> db_Select("headlines", "*", "headline_url='".$_POST['existing']."' ");
-        $row = $sql -> db_Fetch(); extract($row);
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$headline_total = $sql -> db_Select("headlines");
-
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>\n
-
-<table style='width:85%' class='fborder'>
-<tr>
-<td colspan='2' style='text-align:center' class='forumheader'>";
-
-
-if($headline_total == "0"){
-        $text .= "<span style='defaulttext'>".NWFLAN_5."</span>";
-}else{
-        $text .= "<span style='defaulttext'>".NWFLAN_6.": </span>
-        <select name='existing' class='tbox'>";
-        while(list($head_id, $head_url) = $sql-> db_Fetch()){
-                $text .= "<option value='$head_url'>".str_replace(array("http://", "www."), array("", ""), $head_url)."</option>";
-        }
-        $text .= "</select>
-        <input class='button' type='submit' name='edit' value='".NWFLAN_7."' />
-        <input class='button' type='submit' name='delete' value='".NWFLAN_8."' />
-        <input type='checkbox' name='confirm' value='1'><span class='smalltext'> ".NWFLAN_9."</span>";
-}
-
-
-$text .= "
-</td>
-</tr>
-<tr>
-<td style='width:30%' class='forumheader3'>".NWFLAN_10."</td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='headline_url' size='60' value='$headline_url' maxlength='200' />
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".NWFLAN_11."<br /><span class='smalltext'>".NWFLAN_12."</span></td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='headline_image' size='60' value='$headline_image' maxlength='200' />
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".NWFLAN_16."</td>
-<td style='width:80%' class='forumheader3'>";
-if($headline_active == 1){
-        $text .= "<input type='checkbox' name='activate' value='1' checked='checked' />";
-}else{
-        $text .= "<input type='checkbox' name='activate' value='1' />";
-}
-$text .= "</td>
-</tr>
-
-<tr style='vertical-align:top'>
-<td colspan='2' style='text-align:center' class='forumheader'>";
-
-if(IsSet($_POST['edit'])){
-
-        $text .= "<input class='button' type='submit' name='update_headline' value='".NWFLAN_17."' />
-<input type='hidden' name='headline_id' value='$headline_id'>";
-}else{
-        $text .= "<input class='button' type='submit' name='add_headline' value='".NWFLAN_18."' />";
-}
-$text .= "</td>
-</tr>
-
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".NWFLAN_19."</div>", $text);
-
-require_once("footer.php");
-?>
\ No newline at end of file
diff -ruN 6171/e107_admin/newspost.php 75/e107_admin/newspost.php
--- 6171/e107_admin/newspost.php	2004-09-14 01:51:14.000000000 -0500
+++ 75/e107_admin/newspost.php	2006-05-13 19:28:40.000000000 -0500
@@ -1,930 +1,1118 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|   $Source: /cvsroot/e107/e107/e107_admin/newspost.php,v $
-|   $Revision: 1.42 $
-|   $Date: 2004/09/14 06:51:14 $
-|   $Author: e107coders $
-+---------------------------------------------------------------+
-
-*/
-require_once("../class2.php");
-if($pref['htmlarea']){
-    require_once(e_HANDLER."htmlarea/htmlarea.inc.php");
-    $htmlarea_js = (eregi("MSIE",$_SERVER['HTTP_USER_AGENT']))? htmlarea("data,news_extended"): htmlarea("data");
-}
-if(!getperms("H")){ header("location:".e_BASE."index.php"); exit;}
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-require_once(e_HANDLER."userclass_class.php");
-require_once(e_HANDLER."news_class.php");
-require_once(e_HANDLER."ren_help.php");
-require_once(e_HANDLER."form_handler.php");
-
-$rs = new form;
-$aj = new textparse;
-$ix = new news;
-$newspost = new newspost;
-
-$deltest = array_flip($_POST);
-if(e_QUERY){
-        list($action, $sub_action, $id, $from) = explode(".", e_QUERY);
-        unset($tmp);
-}
-
-$from = ($from ? $from : 0);
-$amount = 50;
-
-// ##### Main loop -----------------------------------------------------------------------------------------------------------------------
-
-if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$etp->unentity(NWSLAN_8)],$matches))
-{
-        $delete = $matches[1];
-        $del_id = $matches[2];
-}
-
-if($delete == "main" && $del_id)
-{
-        if($sql -> db_Delete("news", "news_id='$del_id' "))
-        {
-                $newspost -> show_message(NWSLAN_31." #".$del_id." ".NWSLAN_32);
-                clear_cache("news.php");
-        }
-        unset($delete, $del);
-}
-
-if($delete == "category" && $del_id)
-{
-        if($sql -> db_Delete("news_category", "category_id='$del_id' "))
-        {
-                $newspost -> show_message(NWSLAN_33." #".$del_id." ".NWSLAN_32);
-                unset($delete,$del_id);
-        }
-}
-
-if($delete == "sn" && $del_id){
-        if($sql -> db_Delete("submitnews", "submitnews_id='$del_id' "))
-        {
-                $newspost -> show_message(NWSLAN_34." #".$del_id." ".NWSLAN_32);
-                clear_cache("news.php");
-                unset($delete,$del_id);
-        }
-}
-
-if(IsSet($_POST['submitupload'])){
-        $pref['upload_storagetype'] = "1";
-        require_once(e_HANDLER."upload_handler.php");
-        $uploaded = file_upload(($_POST['uploadtype'] == NWSLAN_67 ? e_IMAGE."newspost_images/" : e_FILE."downloads/"));
-        if($_POST['uploadtype'] == "Image" && $_POST['imagecrethumb']){
-                require_once(e_HANDLER."resize_handler.php");
-                resize_image(e_IMAGE."newspost_images/".$uploaded[0]['name'], e_IMAGE."newspost_images/".$uploaded[0]['name'], 250, "copy");
-        }
-}
-
-$_POST['news_title'] = $aj -> formtpa($_POST['news_title']);
-if(IsSet($_POST['preview'])){
-        $newspost -> preview_item($id);
-}
-
-if(IsSet($_POST['submit'])){
-        $newspost -> submit_item($sub_action, $id);
-        $action = "main";
-        unset($sub_action, $id);
-}
-
-if(IsSet($_POST['create_category'])){
-        if($_POST['category_name']){
-                                if(empty($_POST['category_button'])){
-                                        $handle=opendir(e_IMAGE."newsicons");
-                                        while ($file = readdir($handle)){
-                                                        if($file != "." && $file != ".." && $file != "/" && $file != "null.txt" && $file != "CVS"){
-                                                                        $iconlist[] = $file;
-                                                        }
-                                        }
-                                        closedir($handle);
-                                        $_POST['category_button'] = $iconlist[0];
-                                }
-                $_POST['category_name'] = $aj -> formtpa($_POST['category_name'], "admin");
-                $sql -> db_Insert("news_category", " '0', '".$_POST['category_name']."', '".$_POST['category_button']."'");
-                $newspost -> show_message(NWSLAN_35);
-        }
-}
-
-if(IsSet($_POST['update_category'])){
-        if($_POST['category_name']){
-                $category_button = ($_POST['category_button'] ? $_POST['category_button'] : "");
-                $_POST['category_name'] = $aj -> formtpa($_POST['category_name'], "admin");
-                $sql -> db_Update("news_category", "category_name='".$_POST['category_name']."', category_icon='".$category_button."' WHERE category_id='".$_POST['category_id']."'");
-                $newspost -> show_message(NWSLAN_36);
-        }
-}
-
-if(IsSet($_POST['save_prefs'])){
-        $pref['newsposts'] = $_POST['newsposts'];
-
-                // ##### ADDED FOR NEWSARCHIVE --------------------------------------------------------------------
-                $pref['newsposts_archive'] = $_POST['newsposts_archive'];
-                $pref['newsposts_archive_title'] = $_POST['newsposts_archive_title'];
-                // ##### END --------------------------------------------------------------------------------------
-
-        $pref['news_cats'] = $_POST['news_cats'];
-        $pref['nbr_cols'] = $_POST['nbr_cols'];
-        $pref['subnews_attach'] = $_POST['subnews_attach'];
-        $pref['subnews_resize'] = $_POST['subnews_resize'];
-        $pref['subnews_class'] = $_POST['subnews_class'];
-        $pref['subnews_htmlarea'] = $_POST['subnews_htmlarea'];
-        $pref['subnews_hide_news'] = $_POST['subnews_hide_news'];
-
-        save_prefs();
-        clear_cache("news.php");
-        $newspost -> show_message("Settings Saved");
-}
-
-
-
-
-if(!e_QUERY || $action == "main"){
-        $newspost -> show_existing_items($action, $sub_action, $id, $from, $amount);
-}
-
-if($action == "create"){
-        if($sub_action == "edit" && !$_POST['preview']  && !$_POST['submit']){
-                if($sql -> db_Select("news", "*", "news_id='$id' ")){
-                        $row = $sql-> db_Fetch();
-                        extract($row);
-                        $_POST['news_title'] = $news_title;
-                        $_POST['data'] = $aj -> formtparev($news_body);
-                        $_POST['news_extended'] = $aj -> formtparev($news_extended);
-                        $_POST['news_allow_comments'] = $news_allow_comments;
-                        $_POST['news_class'] = $news_class;
-                        $_POST['cat_id'] = $news_category;
-                        if($news_start){$tmp = getdate($news_start);$_POST['startmonth'] = $tmp['mon'];$_POST['startday'] = $tmp['mday'];$_POST['startyear'] = $tmp['year'];}
-                        if($news_end){$tmp = getdate($news_end);$_POST['endmonth'] = $tmp['mon'];$_POST['endday'] = $tmp['mday'];$_POST['endyear'] = $tmp['year'];}
-                        $_POST['comment_total'] = $sql -> db_Count("comments", "(*)", " WHERE comment_item_id='$news_id' AND comment_type='0' ");
-                        $_POST['news_rendertype'] = $news_render_type;
-                }
-        }
-        $newspost -> create_item($sub_action, $id);
-}
-
-if($action == "cat"){
-        $newspost -> show_categories($sub_action, $id);
-}
-
-if($action == "sn"){
-        $newspost -> submitted_news($sub_action, $id);
-}
-
-if($action == "pref"){
-        $newspost -> show_news_prefs($sub_action, $id);
-}
-
-
-
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-// ##### Display options --------------------------------------------------------------------------------------------------------------------------------------------------------
-
-//$newspost -> show_options($action);
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-print "<script type=\"text/javascript\">
-
-
-function addtext3(str){
-        document.getElementById('dataform').category_button.value = str;
-}
-function help2(help){
-        document.getElementById('dataform').help_ext.value = help;
-}
-function fclear(){
-        document.getElementById('dataform').data.value = \"\";
-        document.getElementById('dataform').news_extended.value = \"\";
-}
-
-</script>\n";
-
-echo "<script type=\"text/javascript\">
-function confirm_(mode, news_id){
-        if(mode == 'cat'){
-                return confirm(\"".$etp->unentity(NWSLAN_37)." [ID: \" + news_id + \"]\");
-        }else if(mode == 'sn'){
-                return confirm(\"".$etp->unentity(NWSLAN_38)." [ID: \" + news_id + \"]\");
-        }else{
-                return confirm(\"".$etp->unentity(NWSLAN_39)." [ID: \" + news_id + \"]\");
-        }
-}
-</script>";
-require_once("footer.php");
-exit;
-
-class newspost{
-
-
-        function show_existing_items($action, $sub_action, $id, $from, $amount){
-                // ##### Display scrolling list of existing news items ---------------------------------------------------------------------------------------------------------
-                global $sql, $rs, $ns, $aj;
-                $text = "<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 300px; overflow : auto; '>";
-
-                if(IsSet($_POST['searchquery'])){
-                        $query = "news_title REGEXP('".$_POST['searchquery']."') OR news_body REGEXP('".$_POST['searchquery']."') OR news_extended REGEXP('".$_POST['searchquery']."') ORDER BY news_datestamp DESC";
-                }else{
-                        $query = "ORDER BY ".($sub_action ? $sub_action : "news_datestamp")." ".($id ? $id : "DESC")."  LIMIT $from, $amount";
-                }
-
-                if($sql -> db_Select("news", "*", $query, ($_POST['searchquery'] ? 0 : "nowhere"))){
-                        $text .= "<table class='fborder' style='width:100%'>
-                        <tr>
-
-                        <td style='width:5%' class='forumheader2'><a href='".e_SELF."?main.news_id.".($id == "desc" ? "asc" : "desc").".$from'>ID</a></td>
-                        <td style='width:5%' class='forumheader2'><a href='".e_SELF."?main.news_title.".($id == "desc" ? "asc" : "desc").".$from'>".NWSLAN_40."</a></td>
-                        <td style='width:45%' class='forumheader2'>".NWSLAN_41."</td>
-                        </tr>";
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-
-                        // Note: To fix the alignment bug. Put both buttons inside the Form.
-                        // But make EDIT a 'button' and DELETE 'submit'
-
-                                $text .= "<tr>
-                                <td style='width:5%' class='forumheader3'>$news_id</td>
-                                <td style='width:75%' class='forumheader3'><a href='".e_BASE."comment.php?comment.news.$news_id'>".($news_title ? $aj -> tpa($news_title) : "[".NWSLAN_42."]")."</a></td>
-                                <td style='width:20%; text-align:center' class='forumheader3'>
-                                ".$rs -> form_open("post", e_SELF,"myform__{$news_id}","",""," onsubmit=\"return confirm_('create',$news_id)\"")."
-                                <div>".$rs -> form_button("button", "main_edit_{$news_id}", NWSLAN_7, "onclick=\"document.location='".e_SELF."?create.edit.$news_id'\"")."
-                                ".$rs -> form_button("submit", "main_delete_{$news_id}", NWSLAN_8)."
-                                </div>".$rs -> form_close()."
-                                </td>
-                                </tr>";
-                        }
-                        $text .= "</table>";
-                }else{
-                        $text .= "<div style='text-align:center'>".NWSLAN_43."</div>";
-                }
-                $text .= "</div>";
-
-                $newsposts = $sql -> db_Count("news");
-
-                if($newsposts > $amount && !$_POST['searchquery']){
-                        $a = $newsposts/$amount;
-                        $r = explode(".", $a);
-                        if($r[1] != 0 ? $pages = ($r[0]+1) : $pages = $r[0]);
-                        if($pages){
-                                $current = ($from/$amount)+1;
-                                $text .= "<br />".NWSLAN_62." ";
-                                for($a=1; $a<=$pages; $a++){
-                                        $text .= ($current == $a ? " <b>[$a]</b>" : " [<a href='".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.news_datestamp.desc.").(($a-1)*$amount)."'>$a</a>] ");
-                                }
-                                $text .= "<br />";
-                        }
-                }
-
-                $text .= "<br /><form method='post' action='".e_SELF."'>\n<p>\n<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />\n<input class='button' type='submit' name='searchsubmit' value='".NWSLAN_63."' />\n</p>\n</form>\n</div>";
-
-
-
-                $ns -> tablerender(NWSLAN_43, $text);
-        }
-
-        function show_options($action){
-                        global $sql;
-
-                if($action==""){$action="main";}
-                $var['main']['text']=NWSLAN_44;
-                $var['main']['link']=e_SELF;
-
-                $var['create']['text']=NWSLAN_45;
-                $var['create']['link']=e_SELF."?create";
-
-                $var['cat']['text']=NWSLAN_46;
-                $var['cat']['link']=e_SELF."?cat";
-                $var['cat']['perm']="7";
-
-                $var['pref']['text']=NWSLAN_90;
-                $var['pref']['link']=e_SELF."?pref";
-                $var['pref']['perm']="N";
-                                if($sql -> db_Select("submitnews", "*", "submitnews_auth ='0' ")){
-                                        $var['sn']['text']=NWSLAN_47;
-                                        $var['sn']['link']=e_SELF."?sn";
-                                        $var['sn']['perm']="N";
-                                }
-
-                show_admin_menu(NWSLAN_48,$action,$var);
-
-
-        }
-
-        function create_item($sub_action, $id){
-                // ##### Display creation form ---------------------------------------------------------------------------------------------------------
-                                        /* 08-08-2004 - unknown - fixed `Insert Image' display to use $IMAGES_DIRECTORY */
-                                        global $sql, $rs, $ns, $pref, $IMAGES_DIRECTORY;
-
-                $handle=opendir(e_IMAGE."newspost_images");
-                while ($file = readdir($handle)){
-                        if($file != "." && $file != ".." && $file != "/" && $file != "index.html" && $file != "null.txt" && $file != "CVS"){
-                                if(!strstr($file, "thumb_")){
-                                        $imagelist[] = $file;
-                                }else{
-                                        $thumblist[] = $file;
-                                }
-                        }
-                }
-                closedir($handle);
-
-                $sql -> db_Select("download");
-                $c=0;
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        $filelist[$c][0] = $download_id;
-                        $filelist[$c][1] = $download_url;
-                        $c++;
-                }
-
-
-                $handle=opendir(e_FILE."downloads");
-                while ($file = readdir($handle)){
-                        if($file != "." && $file != ".." && $file != "/" && $file != "index.html" && $file != "null.txt" && $file != "CVS"){
-                                $filelist[$c][0] = "";
-                                $filelist[$c][1] = $file;
-                                $c++;
-                        }
-                }
-                closedir($handle);
-
-                if($sub_action == "sn" && !$_POST['preview']){
-                        if($sql -> db_Select("submitnews", "*", "submitnews_id=$id", TRUE)){
-                                list($id, $submitnews_name, $submitnews_email, $_POST['news_title'], $submitnews_category, $_POST['data'], $submitnews_datestamp, $submitnews_ip, $submitnews_auth, $submitnews_file) = $sql-> db_Fetch();
-
-                                if($pref['htmlarea']){
-                                $_POST['data'] .= "<br /><b>".NWSLAN_49." ".$submitnews_name."</b>";
-                                $_POST['data'] .= ($submitnews_file)? "<br /><br /><img src='".e_IMAGE."newspost_images/$submitnews_file' style='float:right; margin-left:5px;margin-right:5px;margin-top:5px;margin-bottom:5px; border:1px solid' />":"";
-                                }else {
-                                $_POST['data'] .= "\n[[b]".NWSLAN_49." ".$submitnews_name."[/b]]";
-                                $_POST['data'] .= ($submitnews_file)?"\n\n[img]".e_IMAGE."newspost_images/".$submitnews_file." [/img]":"";
-                                }
-                                                                $_POST['cat_id'] = $submitnews_category;
-                        }
-                }
-
-                if($sub_action == "upload" && !$_POST['preview']){
-                        if($sql -> db_Select("upload", "*", "upload_id=$id")){
-                                $row = $sql -> db_Fetch(); extract($row);
-
-                                $post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
-                                $post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
-
-                                $_POST['news_title'] = NWSLAN_66.": ".$upload_name;
-                                $_POST['data'] = $upload_description."\n[b]".NWSLAN_49." <a href='user.php?id.".$post_author_id."'>".$post_author_name."</a>[/b]\n\n[file=request.php?".$id."]".$upload_name."[/file]\n";
-                        }
-                }
-
-                $text = "<div style='text-align:center'>
-                <form ".(FILE_UPLOADS ? "enctype='multipart/form-data'" : "")." method='post' action='".e_SELF."?".e_QUERY."' id='dataform'>
-                <table style='width:95%' class='fborder'>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".NWSLAN_6.": </td>
-                <td style='width:80%' class='forumheader3'>";
-
-                if(!$sql -> db_Select("news_category")){
-                        $text .= NWSLAN_10;
-                }else{
-
-                        $text .= "
-                        <select name='cat_id' class='tbox'>";
-
-                        while(list($cat_id, $cat_name, $cat_icon) = $sql-> db_Fetch()){
-                                $text .= ($_POST['cat_id'] == $cat_id ? "<option value='$cat_id' selected='selected'>".$cat_name."</option>" : "<option value='$cat_id'>".$cat_name."</option>");
-                        }
-                        $text .= "</select>";
-                }
-//                                        $_POST['news_title'] = htmlentities($_POST['news_title'],ENT_QUOTES);
-                $text .= "</td>
-                </tr>
-                <tr>
-                <td style='width:20%' class='forumheader3'>".NWSLAN_12.":</td>
-                <td style='width:80%' class='forumheader3'>
-                <input class='tbox' type='text' name='news_title' size='80' value='".$_POST['news_title']."' maxlength='200' />
-                </td>
-                </tr>
-                <tr>
-                <td style='width:20%' class='forumheader3'>".NWSLAN_13.":<br /></td>
-                <td style='width:80%' class='forumheader3'>";
-
-                $insertjs = (!$pref['htmlarea'])?"rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'":"rows='25' style='width:100%' ";
-                $text .="<textarea class='tbox' id='data' name='data'  cols='80'   $insertjs>".(strstr($_POST['data'], "[img]http") ? $_POST['data'] : str_replace("[img]../", "[img]", $_POST['data']))."</textarea>
-                ";
-//Main news body textarea
-        if(!$pref['htmlarea']){
-        $text .= "
-                <input class='helpbox' type='text' name='helpb' size='100' />
-                <br />".
-                                ren_help()."
-                <select class='tbox' name='thumbps' onChange=\"addtext('[link=".e_IMAGE."newspost_images/' + this.form.thumbps.options[this.form.thumbps.selectedIndex].value + '][img]".e_IMAGE."newspost_images/thumb_' + this.form.thumbps.options[this.form.thumbps.selectedIndex].value + '[/img][/link]');this.selectedIndex=0;\" onMouseOver=\"help('".NWSLAN_50." ".e_IMAGE."/newsicons')\" onMouseOut=\"help('')\">
-                <option>".NWSLAN_80." ...</option>\n";
-                while(list($key, $image) = each($thumblist)){
-                        $image2 = str_replace("thumb_", "", $image);
-                        $text .= "<option value='".$image2."'>thumb_".$image2."</option>\n";
-                }
-                $text .= "</select>
-
-                                        <select class='tbox' name='imageps' onChange=\"addtext('[img]' + this.form.imageps.options[this.form.imageps.selectedIndex].value + '[/img]');this.selectedIndex=0;\" onMouseOver=\"help('".NWSLAN_110."')\" onMouseOut=\"help('')\">
-                <option>".NWSLAN_81." ...</option>\n";
-                while(list($key, $image) = each($imagelist)){
-                                                                $text .= "<option value='".SITEURL.$IMAGES_DIRECTORY."newspost_images/".$image."'>".$image."</option>\n";
-                }
-                $text .= "</select>
-
-                <select class='tbox' name='fileps' onChange=\"addtext('[file=request.php?' + this.form.fileps.options[this.form.fileps.selectedIndex].value + ']' + this.form.fileps.options[this.form.fileps.selectedIndex].value + '[/file]');this.selectedIndex=0;\" onMouseOver=\"help('".NWSLAN_64."')\" onMouseOut=\"help('')\">
-                <option>".NWSLAN_82." ...</option>\n";
-                while(list($key, $file) = each($filelist)){
-                        $text .= "<option value='".$file[1]."'>".$file[1]."</option>\n";
-                }
-                $text .= "</select>";
-
-        } // end of htmlarea check.
-//Extended news form textarea
-                $text .="
-                </td>
-                </tr>
-                <tr>
-                <td style='width:20%' class='forumheader3'>".NWSLAN_14.":</td>
-                <td style='width:80%' class='forumheader3'>
-                <a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_83."</a>
-                <div style='display: none;'>
-                <textarea class='tbox' id='news_extended' name='news_extended' cols='80' rows='15' style='width:100%;height:50px' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".(strstr($_POST['data'], "[img]http") ? $_POST['data'] : str_replace("[img]../", "[img]", $_POST['news_extended']))."</textarea>
-                ";
-        if($pref['htmlarea'] && ($pref['htmlarea'] && !eregi("MSIE",$_SERVER['HTTP_USER_AGENT']))){ $text .="<br />
-                <input class='helpbox' type='text' name='help_ext' size='100' />
-                <br />
-                                ".ren_help("","addtext","help2")."
-                <select class='tbox' name='imageps2' onChange=\"addtext('[img]' + this.form.imageps2.options[this.form.imageps2.selectedIndex].value + '[/img]');this.selectedIndex=0;\" onMouseOver=\"help2('".NWSLAN_110."')\" onMouseOut=\"help2('')\">
-                <option>".NWSLAN_81." ...</option>\n";
-                reset($imagelist);
-                while(list($key, $image) = each($imagelist)){
-                                                $text .= "<option value='".SITEURL.$IMAGES_DIRECTORY."newspost_images/".$image."'>".$image."</option>\n";
-                }
-                $text .= "</select>";
-                }
-                $text .="
-                </div>
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".NWSLAN_66."</td>
-                <td style='width:80%' class='forumheader3'>
-                <a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_69."</a>
-                <div style='display: none;'>";
-
-                if(!FILE_UPLOADS){
-                        $text .= "<b>".NWSLAN_78."</b>";
-                }else{
-
-                        if(!is_writable(e_FILE."downloads")){
-                                $text .= "<b>".NWSLAN_70."</b><br />";
-                        }
-                        if(!is_writable(e_IMAGE."newspost_images")){
-                                $text .= "<b>".NWSLAN_71." ".e_IMAGE."/newspost_images ".NWSLAN_110."</b><br />";
-                        }
-
-                        $text .= "<input class='tbox' type='file' name='file_userfile[]' size='50' />
-                        <select class='tbox' name='uploadtype'>
-                        <option>".NWSLAN_67."</option>
-                        <option>".NWSLAN_68."</option>
-                        </select>
-                        <br />
-                        <input type='checkbox' name='imagecrethumb' value='1' /><span class='smalltext'>".NWSLAN_65."</span>&nbsp;&nbsp;
-                        <input class='button' type='submit' name='submitupload' value='".NWSLAN_66."' />\n";
-                }
-                $text .= "</div>
-                </td>
-                </tr>
-
-
-
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".NWSLAN_15."</td>
-                <td style='width:80%' class='forumheader3'>
-                <a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_18."</a>
-                <div style='display: none;'>
-
-
-                ".
-                ($_POST['news_allow_comments'] ? "<input name='news_allow_comments' type='radio' value='0' />".NWSLAN_16."&nbsp;&nbsp;<input name='news_allow_comments' type='radio' value='1' checked='checked' />".NWSLAN_17 : "<input name='news_allow_comments' type='radio' value='0' checked='checked' />".NWSLAN_16."&nbsp;&nbsp;<input name='news_allow_comments' type='radio' value='1' />".NWSLAN_17)."
-                </div>
-                 </td>
-                </tr>
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".NWSLAN_73.":</td>
-                <td style='width:80%' class='forumheader3'>
-                <a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_74."</a>
-                <div style='display: none;'>".
-
-                (!$_POST['news_rendertype'] ? "<input name='news_rendertype' type='radio' value='0' checked='checked' />" : "<input name='news_rendertype' type='radio' value='0' />").NWSLAN_75."<br />".
-                ($_POST['news_rendertype'] == 1 ? "<input name='news_rendertype' type='radio' value='1' checked='checked' />" : "<input name='news_rendertype' type='radio' value='1' />").NWSLAN_76."<br />".
-                ($_POST['news_rendertype'] == 2 ? "<input name='news_rendertype' type='radio' value='2' checked='checked' />" : "<input name='news_rendertype' type='radio' value='2' />").NWSLAN_77."
-
-                </div>
-                </td>
-                </tr>
-
-
-                <tr>
-                <td style='width:20%' class='forumheader3'>".NWSLAN_19.":</td>
-                <td style='width:80%' class='forumheader3'>
-
-                <a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_72."</a>
-                <div style='display: none;'>
-
-                <br />
-
-
-                ".NWSLAN_21.": <select name='startday' class='tbox'><option selected='selected'> </option>";
-                for($a=1; $a<=31; $a++){
-                        $text .= ($a == $_POST['startday'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-                }
-                $text .= "</select> <select name='startmonth' class='tbox'><option selected='selected'> </option>";
-                for($a=1; $a<=12; $a++){
-                        $text .= ($a == $_POST['startmonth'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-                }
-                $text .= "</select> <select name='startyear' class='tbox'><option selected='selected'> </option>";
-                for($a=2003; $a<=2010; $a++){
-                        $text .= ($a == $_POST['startyear'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-                }
-                $text .= "</select> ".NWSLAN_83." <select name='endday' class='tbox'><option selected='selected'> </option>";
-                for($a=1; $a<=31; $a++){
-                        $text .= ($a == $_POST['endday'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-                }
-                $text .= "</select> <select name='endmonth' class='tbox'><option selected='selected'> </option>";
-                for($a=1; $a<=12; $a++){
-                        $text .= ($a == $_POST['endmonth'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-                }
-                $text .= "</select> <select name='endyear' class='tbox'><option selected='selected'> </option>";
-                for($a=2003; $a<=2010; $a++){
-                        $text .= ($a == $_POST['endyear'] ? "<option selected='selected'>".$a."</option>" : "<option>".$a."</option>");
-                }
-
-                $text .= "</select>
-                </div>
-                </td>
-                </tr>
-
-                <tr>
-                <td class='forumheader3'>
-                ".NWSLAN_22.":
-                </td>
-                <td class='forumheader3'>
-
-                <a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_84."</a>
-                <div style='display: none;'>
-                ".r_userclass("news_class",$_POST['news_class'])."
-                </div>
-                </td></tr>
-
-                <tr style='vertical-align: top;'>
-                <td colspan='2'  style='text-align:center' class='forumheader'>";
-
-                if(IsSet($_POST['preview'])){
-                        $text .= "<input class='button' type='submit' name='preview' value='".NWSLAN_24."' /> ";
-                        if($id && $sub_action != "sn" && $sub_action != "upload"){
-                                $text .= "<input class='button' type='submit' name='submit' value='".NWSLAN_25."' /> ";
-                                                                $text .= "<br /><span class='smalltext'><input type='checkbox' class='tbox' name='update_datestamp' /> ".NWSLAN_105."</span>";
-                        } else {
-                         $text .= "<input class='button' type='submit' name='submit' value='".NWSLAN_26."' /> ";
-                        }
-                } else {
-                        $text .= "<input class='button' type='submit' name='preview' value='".NWSLAN_27."' />";
-                }
-                $text .= "<input type='hidden' name='news_id' value='$news_id' />  \n</td>
-                </tr>
-                </table>
-
-                </form>
-                </div>";
-                $ns -> tablerender("<div style='text-align:center'>".NWSLAN_29."</div>", $text);
-        }
-
-
-        function preview_item($id){
-                // ##### Display news preview ---------------------------------------------------------------------------------------------------------
-                global $aj, $sql, $ix;
-                $_POST['news_id'] = $id;
-                $_POST['active_start'] = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear']));
-                $_POST['active_end'] = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']));
-                $sql -> db_Select("news_category", "*",  "category_id='".$_POST['cat_id']."' ");
-                list($_POST['category_id'], $_POST['category_name'], $_POST['category_icon']) = $sql-> db_Fetch();
-                $_POST['admin_id'] = USERID;
-                $_POST['admin_name'] = USERNAME;
-                $_POST['comment_total'] = $comment_total;
-                $_POST['news_datestamp'] = time();
-
-                $_POST['data'] = (strstr($_POST['data'], "[img]http") ? $_POST['data'] : str_replace("[img]", "[img]../", $_POST['data']));
-                $_POST['data'] = $aj -> formtpa($_POST['data']);
-                $_POST['news_extended'] = $aj -> formtpa($_POST['news_extended']);
-
-                $ix -> render_newsitem($_POST);
-                $_POST['news_title'] = $aj -> formtpa($_POST['news_title']);
-                $_POST['data'] = str_replace("../", "", $aj -> formtparev($_POST['data']));
-                $_POST['news_extended'] = $aj -> formtparev($_POST['news_extended']);
-        }
-
-        function submit_item($sub_action, $id){
-                // ##### Format and submit item ---------------------------------------------------------------------------------------------------------
-                global $aj, $ix,$sql;
-                $_POST['active_start'] = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear']));
-                $_POST['active_end'] = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']));
-                $_POST['admin_id'] = USERID;
-                $_POST['admin_name'] = USERNAME;
-                $_POST['news_datestamp'] = time();
-                if($id && $sub_action != "sn" && $sub_action != "upload"){
-                        $_POST['news_id'] = $id;
-                 } else {
-                         $sql -> db_Update("submitnews", "submitnews_auth='1' WHERE submitnews_id ='".$id."' ");
-                 }
-                if(!$_POST['cat_id']){ $_POST['cat_id'] = 1; }
-                $this->show_message($ix -> submit_item($_POST));
-                unset($_POST['news_title'], $_POST['cat_id'], $_POST['data'], $_POST['news_extended'], $_POST['news_allow_comments'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear'], $_POST['news_id'], $_POST['news_class']);
-        }
-
-        function show_message($message){
-                // ##### Display comfort ---------------------------------------------------------------------------------------------------------
-                global $ns;
-                $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-        }
-
-        function show_categories($sub_action, $id){
-                // ##### Display scrolling list of existing news items ---------------------------------------------------------------------------------------------------------
-                global $sql, $rs, $ns, $aj;
-                $text = "<div style='border : solid 1px #000; padding : 4px; width :auto; height : 200px; overflow : auto; '>\n";
-                if($category_total = $sql -> db_Select("news_category")){
-                        $text .= "<table class='fborder' style='width:100%'>
-                        <tr>
-                        <td style='width:5%' class='forumheader2'>&nbsp;</td>
-                        <td style='width:75%' class='forumheader2'>".NWSLAN_6."</td>
-                        <td style='width:20%; text-align:center' class='forumheader2'>".NWSLAN_41."</td>
-                        </tr>";
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-
-                                if($category_icon){
-                                        $icon = (strstr($category_icon, "images/") ? THEME."$category_icon" : e_IMAGE."newsicons/$category_icon");
-                                }
-
-                                $text .= "<tr>
-                                <td style='width:5%; text-align:center' class='forumheader3'><img src='$icon' alt='' style='vertical-align:middle' /></td>
-                                <td style='width:75%' class='forumheader3'>$category_name</td>
-                                <td style='width:20%; text-align:center' class='forumheader3'>
-                                ".$rs -> form_open("post", e_SELF."?cat","myform__{$category_id}","",""," onsubmit=\"return confirm_('cat',$category_id)\"")."
-                                <div>".$rs -> form_button("button", "category_edit_{$category_id}", NWSLAN_7, "onclick=\"document.location='".e_SELF."?cat.edit.$category_id'\"")."
-                                ".$rs -> form_button("submit", "category_delete_{$category_id}", NWSLAN_8)."
-                                </div>".$rs -> form_close()."
-
-
-                                </td>
-                                </tr>\n";
-                        }
-                        $text .= "</table>";
-                }else{
-                        $text .= "<div style='text-align:center'><div style='vertical-align:center'>".NWSLAN_10."</div>";
-                }
-                $text .= "</div>";
-                $ns -> tablerender(NWSLAN_51, $text);
-
-                $handle=opendir(e_IMAGE."newsicons");
-                while ($file = readdir($handle)){
-                        if($file != "." && $file != ".." && $file != "/" && $file != "null.txt" && $file != "CVS"){
-                                $iconlist[] = $file;
-                        }
-                }
-                closedir($handle);
-
-                unset($category_name, $category_icon);
-
-                if($sub_action == "edit"){
-                        if($sql -> db_Select("news_category", "*", "category_id='$id' ")){
-                                $row = $sql -> db_Fetch(); extract($row);
-                        }
-                }
-
-                $text = "<div style='text-align:center'>
-                ".$rs -> form_open("post", e_SELF."?cat", "dataform")."
-                <table class='fborder' style='width:auto'>
-                <tr>
-                <td class='forumheader3' style='width:30%'><span class='defaulttext'>".NWSLAN_52."</span></td>
-                <td class='forumheader3' style='width:70%'>".$rs -> form_text("category_name", 30, $category_name, 200)."</td>
-                </tr>
-                <tr>
-                <td class='forumheader3' style='width:30%'><span class='defaulttext'>".NWSLAN_53."</span></td>
-                <td class='forumheader3' style='width:70%'>
-                ".$rs -> form_text("category_button", 60, $category_icon, 100)."
-                <br />
-                <input class='button' type ='button' style='cursor:hand' size='30' value='".NWSLAN_54."' onclick='expandit(this)' />
-                <div style='display:none'>";
-                while(list($key, $icon) = each($iconlist)){
-                        $text .= "<a href='javascript:addtext3(\"$icon\")'><img src='".e_IMAGE."newsicons/".$icon."' style='border:0' alt='' /></a>\n ";
-                }
-                $text .= "</div></td>
-                </tr>
-
-                <tr><td colspan='2' style='text-align:center' class='forumheader'>";
-                if($id){
-                        $text .= "<input class='button' type='submit' name='update_category' value='".NWSLAN_55."' />
-                        ".$rs -> form_button("submit", "category_clear", NWSLAN_79).
-                        $rs -> form_hidden("category_id", $id)."
-                        </td></tr>";
-                }else{
-                        $text .= "<input class='button' type='submit' name='create_category' value='".NWSLAN_56."' /></td></tr>";
-                }
-                $text .= "</table>
-                ".$rs -> form_close()."
-                </div>";
-
-                $ns -> tablerender(NWSLAN_56, $text);
-        }
-
-        function show_news_prefs(){
-        global $sql, $rs, $ns,$pref;
-
-                $text = "<div style='text-align:center'>
-                ".$rs -> form_open("post", e_SELF."?pref", "dataform")."
-                <table class='fborder' style='width:94%'>
-                <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_86."</span></td>
-                <td class='forumheader3' style='width:40%'>
-                <input type='checkbox' name='news_cats' value='1' ".($pref['news_cats']==1 ? " checked='checked'" : "")." />
-                        </td>
-
-                </tr>
-
-                <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_87."</span></td>
-                <td class='forumheader3' style='width:40%'>
-                <select class='tbox' name='nbr_cols'>
-                <option value='1' ".($pref['nbr_cols']==1 ? "selected='selected'>" : "").">1</option>
-                <option value='2' ".($pref['nbr_cols']==2 ? "selected='selected'>" : "").">2</option>
-                <option value='3' ".($pref['nbr_cols']==3 ? "selected='selected'>" : "").">3</option>
-                <option value='4' ".($pref['nbr_cols']==4 ? "selected='selected'>" : "").">4</option>
-                <option value='5' ".($pref['nbr_cols']==5 ? "selected='selected'>" : "").">5</option>
-                <option value='6' ".($pref['nbr_cols']==6 ? "selected='selected'>" : "").">6</option>
-                </select></td>
-                </tr>
-
-                <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_88."</span></td>
-                <td class='forumheader3' style='width:40%'>
-                <select class='tbox' name='newsposts'>
-                <option value='1' ".($pref['newsposts']==1 ? "selected='selected'" : "").">1</option>
-                <option value='2' ".($pref['newsposts']==2 ? "selected='selected'" : "").">2</option>
-                <option value='3' ".($pref['newsposts']==3 ? "selected='selected'" : "").">3</option>
-                <option value='5' ".($pref['newsposts']==5 ? "selected='selected'" : "").">5</option>
-                <option value='10' ".($pref['newsposts']==10 ? "selected='selected'" : "").">10</option>
-                <option value='15' ".($pref['newsposts']==15 ? "selected='selected'" : "").">15</option>
-                <option value='20' ".($pref['newsposts']==20 ? "selected='selected'" : "").">20</option>
-                </select></td>
-                </tr>
-
-                <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_108."</span><br /><i>".NWSLAN_109."</i></td>
-                <td class='forumheader3' style='width:40%'>
-                <input type='checkbox' name='subnews_hide_news' value='1' ".($pref['subnews_hide_news']==1 ? " checked='checked'" : "")." />
-                </td>
-                </tr>";
-
-
-
-
-
-// ##### ADDED FOR NEWSARCHIVE --------------------------------------------------------------------
-                                // the possible archive values are from "1" to "< $pref['newsposts']"
-                                // this should really be made as an onchange event on the selectbox for $pref['newsposts'] ...
-                                $text .= "
-                                <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>News posts to display in archive ?</span><br />
-                                        <span class='defaulttext'><i>First update the preferences with the changed display per page setting, then update again after setting the newsarchive preference.</i></span>
-                                </td>
-                <td class='forumheader3' style='width:40%'>
-                <select class='tbox' name='newsposts_archive'>";
-                                for($i=1;$i<$pref['newsposts'];$i++){
-                                        $text .= ($i == $pref['newsposts_archive'] ?  "<option value='".$i."' selected='selected'>".$i."</option>" : " <option value='".$i."'>".$i."</option>");
-                                }
-                $text .= "</select></td>
-                </tr>
-
-                                <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>set the title for the newsarchive</span></td>
-                <td class='forumheader3' style='width:40%'>
-                <input class='tbox' type='text' style='width:150px' name='newsposts_archive_title' value='".$pref['newsposts_archive_title']."' />
-                </td>
-                </tr>
-                                ";
-// ##### END --------------------------------------------------------------------------------------
-
-
-                require_once(e_HANDLER."userclass_class.php");
-                $text .= " <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_106."</span></td>
-                <td class='forumheader3' style='width:40%'>
-                ".r_userclass("subnews_class",$pref['subnews_class']).
-                "</td></tr>";
-
-
-                $text .="
-                <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_107."</span></td>
-                <td class='forumheader3' style='width:40%'>
-                <input type='checkbox' name='subnews_htmlarea' value='1' ".($pref['subnews_htmlarea']==1 ? " checked='checked'" : "")." />
-                </td>
-                </tr>";
-
-
-                  $text .="
-                <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_100."</span></td>
-                <td class='forumheader3' style='width:40%'>
-                <input type='checkbox' name='subnews_attach' value='1' ".($pref['subnews_attach']==1 ? " checked='checked'" : "")." />
-                </td>
-                </tr>
-
-                <tr>
-                <td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_101."</span></td>
-                <td class='forumheader3' style='width:40%'>
-                <input class='tbox' type='text' style='width:50px' name='subnews_resize' value='".$pref['subnews_resize']."' />
-                <span class='smalltext'>".NWSLAN_102."</span></td>
-                </tr>
-
-                <tr><td colspan='2' style='text-align:center' class='forumheader'>";
-                $text .= "<input class='button' type='submit' name='save_prefs' value='".NWSLAN_89."' /></td></tr>";
-
-                $text .= "</table>
-                ".$rs -> form_close()."
-                </div>";
-
-                $ns -> tablerender(NWSLAN_90, $text);
-        }
-
-
-
-
-        function submitted_news($sub_action, $id){
-
-
-                global $sql, $rs, $ns, $aj;
-                $text = "<div style='border : solid 1px #000; padding : 4px; width :auto; height : 300px; overflow : auto; '>\n";
-                if($category_total = $sql -> db_Select("submitnews","*","submitnews_id !='' ORDER BY submitnews_id DESC")){
-                        $text .= "<table class='fborder' style='width:100%'>
-                        <tr>
-                        <td style='width:5%' class='forumheader2'>ID</td>
-                        <td style='width:70%' class='forumheader2'>".NWSLAN_57."</td>
-                        <td style='width:25%; text-align:center' class='forumheader2'>".NWSLAN_41."</td>
-                        </tr>";
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $text .= "<tr>
-                                <td style='width:5%; text-align:center; vertical-align:top' class='forumheader3'>$submitnews_id</td>
-                                <td style='width:70%' class='forumheader3'>";
-                                $text .=($submitnews_auth == 0)? "<b>".$aj -> tpa($submitnews_title)."</b>":$aj -> tpa($submitnews_title);
-                                $text .=" [ ".NWSLAN_104." $submitnews_name on ".date("D dS M y, g:ia",$submitnews_datestamp)."]<br />".$aj -> tpa($submitnews_item)."</td>
-                                <td style='width:25%; text-align:right; vertical-align:top' class='forumheader3'>";
-                                $buttext = ($submitnews_auth == 0)? NWSLAN_58 : NWSLAN_103;
-                                $text .=
-                                $rs -> form_open("post", e_SELF."?sn","myform__{$submitnews_id}","",""," onsubmit=\"return confirm_('sn',$submitnews_id)\"")
-                                ."<div>".$rs -> form_button("button", "category_edit_{$submitnews_id}", $buttext, "onclick=\"document.location='".e_SELF."?create.sn.$submitnews_id'\"")."
-                                ".$rs -> form_button("submit", "sn_delete_{$submitnews_id}", NWSLAN_8)."
-                                </div>".$rs -> form_close()."
-                                </td>
-                                </tr>\n";
-                        }
-                        $text .= "</table>";
-                }else{
-                        $text .= "<div style='text-align:center'>".NWSLAN_59."</div>";
-                }
-                $text .= "</div>";
-                $ns -> tablerender(NWSLAN_60, $text);
-
-        }
-
-}
-
-function newspost_adminmenu(){
-        global $newspost;
-        global $action;
-        $newspost -> show_options($action);
-}
-
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|   $Source: /cvsroot/e107/e107_0.7/e107_admin/newspost.php,v $
+|   $Revision: 1.123 $
+|   $Date: 2006/05/14 00:28:40 $
+|   $Author: e107coders $
++---------------------------------------------------------------+
+
+*/
+require_once("../class2.php");
+
+if (!getperms("H")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+require_once(e_HANDLER."calendar/calendar_class.php");
+$cal = new DHTML_Calendar(true);
+function headerjs(){
+  	global $cal;
+    $js = $cal->load_files();
+
+   return $js;
+}
+$e_sub_cat = 'news';
+$e_wysiwyg = "data,news_extended";
+
+// -------- Presets. ------------  // always load before auth.php
+require_once(e_HANDLER."preset_class.php");
+$pst = new e_preset;
+$pst->form = "dataform"; // form id of the form that will have it's values saved.
+$pst->page = "newspost.php?create"; // display preset options on which page(s).
+$pst->id = "admin_newspost";
+// ------------------------------
+
+$newspost = new newspost;
+require_once("auth.php");
+$pst->save_preset(); // save and render result using unique name
+
+require_once(e_HANDLER."userclass_class.php");
+require_once(e_HANDLER."news_class.php");
+require_once(e_HANDLER."ren_help.php");
+require_once(e_HANDLER."form_handler.php");
+require_once(e_HANDLER."file_class.php");
+
+$fl = new e_file;
+$rs = new form;
+$ix = new news;
+
+$deltest = array_flip($_POST);
+if (e_QUERY) {
+	list($action, $sub_action, $id, $from) = explode(".", e_QUERY);
+	$id = intval($id);
+	$from = intval($from);
+	unset($tmp);
+}
+
+$from = ($from ? $from : 0);
+$amount = 10;
+
+// ##### Main loop -----------------------------------------------------------------------------------------------------------------------
+
+if(isset($_POST['news_userclass']))
+{
+	$_POST['news_class'] = implode(",", array_keys($_POST['news_userclass']));
+}
+
+if (preg_match("#(.*?)_delete_(\d+)#", $deltest[$tp->toJS(LAN_DELETE)], $matches))
+{
+	$delete = $matches[1];
+	$del_id = $matches[2];
+}
+
+if(isset($_POST['delete']))
+{
+	$tmp = array_keys($_POST['delete']);
+	list($delete, $del_id) = explode("_", $tmp[0]);
+}
+
+if ($delete == "main" && $del_id)
+{
+	if ($sql->db_Count('news','(*)',"WHERE news_id = '{$del_id}'"))
+	{
+		$e_event->trigger("newsdel", $del_id);
+		if($sql->db_Delete("news", "news_id='$del_id' "))
+		{
+			$newspost->show_message(NWSLAN_31." #".$del_id." ".NWSLAN_32);
+			$e107cache->clear("news.php");
+
+			admin_purge_related("news", $del_id);
+		}
+	}
+	unset($delete, $del);
+}
+
+if ($delete == "category" && $del_id) {
+	if ($sql->db_Delete("news_category", "category_id='$del_id' ")) {
+		$newspost->show_message(NWSLAN_33." #".$del_id." ".NWSLAN_32);
+		unset($delete, $del_id);
+	}
+}
+
+if($delete == "sn" && $del_id)
+{
+	if ($sql->db_Delete("submitnews", "submitnews_id='$del_id' "))
+	{
+		$newspost->show_message(NWSLAN_34." #".$del_id." ".NWSLAN_32);
+		$e107cache->clear("news.php");
+		unset($delete, $del_id);
+	}
+}
+
+if (isset($_POST['submitupload'])) {
+	$pref['upload_storagetype'] = "1";
+	require_once(e_HANDLER."upload_handler.php");
+
+	$uploaded = file_upload(e_IMAGE."newspost_images/");
+
+	foreach($_POST['uploadtype'] as $key=>$uploadtype){
+		if($uploadtype == "thumb"){
+			rename(e_IMAGE."newspost_images/".$uploaded[$key]['name'],e_IMAGE."newspost_images/thumb_".$uploaded[$key]['name']);
+		}
+
+		if($uploadtype == "file"){
+			rename(e_IMAGE."newspost_images/".$uploaded[$key]['name'],e_FILE."downloads/".$uploaded[$key]['name']);
+		}
+
+		if ($uploadtype == "resize" && $_POST['resize_value']) {
+			require_once(e_HANDLER."resize_handler.php");
+			resize_image(e_IMAGE."newspost_images/".$uploaded[$key]['name'], e_IMAGE."newspost_images/".$uploaded[$key]['name'], $_POST['resize_value'], "copy");
+		}
+	}
+}
+
+// required.
+if (isset($_POST['preview'])) {
+	$_POST['news_title'] = $tp->toDB($_POST['news_title']);
+	$_POST['news_summary'] = $tp->toDB($_POST['news_summary']);
+	$newspost->preview_item($id);
+}
+
+if (isset($_POST['submit_news'])) {
+
+	$newspost->submit_item($sub_action, $id);
+	$action = "main";
+	unset($sub_action, $id);
+}
+
+if (isset($_POST['create_category'])) {
+	if ($_POST['category_name']) {
+		if (empty($_POST['category_button'])) {
+			$handle = opendir(e_IMAGE."icons");
+			while ($file = readdir($handle)) {
+				if ($file != "." && $file != ".." && $file != "/" && $file != "null.txt" && $file != "CVS") {
+					$iconlist[] = $file;
+				}
+			}
+			closedir($handle);
+			$_POST['category_button'] = $iconlist[0];
+		}
+		$_POST['category_name'] = $tp->toDB($_POST['category_name']);
+		$sql->db_Insert("news_category", "'0', '".$_POST['category_name']."', '".$_POST['category_button']."'");
+		$newspost->show_message(NWSLAN_35);
+	}
+}
+
+if (isset($_POST['update_category'])) {
+	if ($_POST['category_name']) {
+		$category_button = ($_POST['category_button'] ? $_POST['category_button'] : "");
+		$_POST['category_name'] = $tp->toDB($_POST['category_name']);
+		$sql->db_Update("news_category", "category_name='".$_POST['category_name']."', category_icon='".$category_button."' WHERE category_id='".$_POST['category_id']."'");
+		$newspost->show_message(NWSLAN_36);
+	}
+}
+
+if (isset($_POST['save_prefs'])) {
+	$pref['newsposts'] = $_POST['newsposts'];
+
+	// ##### ADDED FOR NEWSARCHIVE --------------------------------------------------------------------
+	$pref['newsposts_archive'] = $_POST['newsposts_archive'];
+	$pref['newsposts_archive_title'] = $tp->toDB($_POST['newsposts_archive_title']);
+	// ##### END --------------------------------------------------------------------------------------
+
+	$pref['news_cats'] = $_POST['news_cats'];
+	$pref['nbr_cols'] = $_POST['nbr_cols'];
+	$pref['subnews_attach'] = $_POST['subnews_attach'];
+	$pref['subnews_resize'] = $_POST['subnews_resize'];
+	$pref['subnews_class'] = $_POST['subnews_class'];
+	$pref['subnews_htmlarea'] = $_POST['subnews_htmlarea'];
+	$pref['subnews_hide_news'] = $_POST['subnews_hide_news'];
+	$pref['news_subheader'] = $_POST['news_subheader'];
+	/*
+	changes by jalist 22/01/2005:
+	added pref to render new date header
+	*/
+	$pref['news_newdateheader'] = $_POST['news_newdateheader'];
+	$pref['news_unstemplate'] = $_POST['news_unstemplate'];
+
+	save_prefs();
+	$e107cache->clear("news.php");
+	$newspost->show_message(NWSLAN_119);
+}
+
+if (!e_QUERY || $action == "main") {
+	$newspost->show_existing_items($action, $sub_action, $id, $from, $amount);
+}
+
+if ($action == "create") {
+	$preset = $pst->read_preset("admin_newspost");  //only works here because $_POST is used.
+
+	if ($sub_action == "edit" && !$_POST['preview'] && !$_POST['submit_news']) {
+		if ($sql->db_Select("news", "*", "news_id='$id' ")) {
+			$row = $sql->db_Fetch();
+			extract($row);
+			$_POST['news_title'] = $news_title;
+			$_POST['data'] = $news_body;
+			$_POST['news_extended'] = $news_extended;
+			$_POST['news_allow_comments'] = $news_allow_comments;
+			$_POST['news_class'] = $news_class;
+			$_POST['news_summary'] = $news_summary;
+			$_POST['news_sticky'] = $news_sticky;
+			$_POST['news_datestamp'] = $news_datestamp;
+
+			$_POST['cat_id'] = $news_category;
+			$_POST['news_start'] = $news_start;
+			$_POST['news_end'] = $news_end;
+			$_POST['comment_total'] = $sql->db_Count("comments", "(*)", " WHERE comment_item_id='$news_id' AND comment_type='0' ");
+			$_POST['news_rendertype'] = $news_render_type;
+			$_POST['news_thumbnail'] = $news_thumbnail;
+
+		}
+	}
+	$newspost->create_item($sub_action, $id);
+}
+
+if ($action == "cat") {
+	$newspost->show_categories($sub_action, $id);
+}
+
+if ($action == "sn") {
+	$newspost->submitted_news($sub_action, $id);
+}
+
+if ($action == "pref") {
+	$newspost->show_news_prefs($sub_action, $id);
+}
+
+echo "
+<script type=\"text/javascript\">
+function fclear() {
+	document.getElementById('dataform').data.value = \"\";
+	document.getElementById('dataform').news_extended.value = \"\";
+}
+</script>\n";
+
+require_once("footer.php");
+exit;
+
+class newspost {
+
+
+	function show_existing_items($action, $sub_action, $id, $from, $amount) {
+		// ##### Display scrolling list of existing news items ---------------------------------------------------------------------------------------------------------
+		global $sql, $rs, $ns, $tp;
+		$text = "<div style='text-align:center'>";
+
+		if (isset($_POST['searchquery'])) {
+			$query = "news_title REGEXP('".$_POST['searchquery']."') OR news_body REGEXP('".$_POST['searchquery']."') OR news_extended REGEXP('".$_POST['searchquery']."') ORDER BY news_datestamp DESC";
+			} else {
+			$query = "ORDER BY ".($sub_action ? $sub_action : "news_datestamp")." ".($id ? $id : "DESC")."  LIMIT $from, $amount";
+		}
+
+		if ($sql->db_Select("news", "*", $query, ($_POST['searchquery'] ? 0 : "nowhere")))
+		{
+
+			$newsarray = $sql -> db_getList();
+			$text .= "
+			<form action='".e_SELF."' id='newsform' method='post'>
+			<table class='fborder' style='".ADMIN_WIDTH."'>
+			<tr>
+			<td style='width:5%' class='fcaption'><a href='".e_SELF."?main.news_id.".($id == "desc" ? "asc" : "desc").".$from'>".LAN_NEWS_45."</a></td>
+			<td style='width:55%' class='fcaption'><a href='".e_SELF."?main.news_title.".($id == "desc" ? "asc" : "desc").".$from'>".NWSLAN_40."</a></td>
+			<td style='width:15%' class='fcaption'>".LAN_NEWS_49."</td>
+			<td style='width:15%' class='fcaption'>".LAN_OPTIONS."</td>
+			</tr>";
+			$ren_type = array("default","title","other-news","other-news 2");
+			foreach($newsarray as $row)
+			{
+				extract($row);
+
+				// Note: To fix the alignment bug. Put both buttons inside the Form.
+				// But make EDIT a 'button' and DELETE 'submit'
+
+				$text .= "<tr>
+				<td style='width:5%' class='forumheader3'>$news_id</td>
+				<td style='width:55%' class='forumheader3'><a href='".e_BASE."comment.php?comment.news.$news_id'>".($news_title ? $tp->toHTML($news_title,"","no_make_clickable") : "[".NWSLAN_42."]")."</a></td>
+				<td style='20%' class='forumheader3'>";
+				$text .= $ren_type[$news_render_type];
+				if($news_sticky)
+				{
+					$sicon = (file_exists(THEME."generic/sticky.png") ? THEME."generic/sticky.png" : e_IMAGE."generic/".IMODE."/sticky.png");
+					$text .= " <img src='".$sicon."' alt='' />";
+				}
+				$text .= "
+				</td>
+
+				<td style='width:15%; text-align:center' class='forumheader3'>
+				<a href='".e_SELF."?create.edit.{$news_id}'>".ADMIN_EDIT_ICON."</a>
+				<input type='image' title='".LAN_DELETE."' name='delete[main_{$news_id}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".NWSLAN_39." [ID: $news_id ]')\"/>
+				</td>
+				</tr>";
+			}
+			$text .= "</table></form>";
+			} else {
+			$text .= "<div style='text-align:center'>".NWSLAN_43."</div>";
+		}
+
+		$newsposts = $sql->db_Count("news");
+
+		$text .= "<div style='text-align:center; ".ADMIN_WIDTH."; margin-left: auto; margin-right: auto'>";
+		if ($newsposts > $amount && !$_POST['searchquery']) {
+			$a = $newsposts/$amount;
+			$r = explode(".", $a);
+			if ($r[1] != 0 ? $pages = ($r[0]+1) : $pages = $r[0]);
+			if ($pages) {
+				$current = ($from/$amount)+1;
+				$text .= "<br />".NWSLAN_62." ";
+				for($a = 1; $a <= $pages; $a++) {
+					$text .= ($current == $a ? " <b>[$a]</b>" : " [<a href='".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.news_datestamp.desc.").(($a-1) * $amount)."'>$a</a>] ");
+				}
+				$text .= "<br />";
+			}
+		}
+
+		$text .= "</div><br /><form method='post' action='".e_SELF."'>\n<p>\n<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />\n<input class='button' type='submit' name='searchsubmit' value='".NWSLAN_63."' />\n</p>\n</form>\n</div>";
+
+
+
+		$ns->tablerender(NWSLAN_4, $text);
+	}
+
+	function show_options($action) {
+		global $sql;
+
+		if ($action == "") {
+			$action = "main";
+		}
+		$var['main']['text'] = NWSLAN_44;
+		$var['main']['link'] = e_SELF;
+
+		$var['create']['text'] = NWSLAN_45;
+		$var['create']['link'] = e_SELF."?create";
+
+		$var['cat']['text'] = NWSLAN_46;
+		$var['cat']['link'] = e_SELF."?cat";
+		$var['cat']['perm'] = "7";
+
+		$var['pref']['text'] = NWSLAN_90;
+		$var['pref']['link'] = e_SELF."?pref";
+		$var['pref']['perm'] = "N";
+		if ($sql->db_Select("submitnews", "*", "submitnews_auth ='0' ")) {
+			$var['sn']['text'] = NWSLAN_47;
+			$var['sn']['link'] = e_SELF."?sn";
+			$var['sn']['perm'] = "N";
+		}
+
+		show_admin_menu(NWSLAN_48, $action, $var);
+
+	}
+
+	function create_item($sub_action, $id)
+	{
+		global $cal;
+		// ##### Display creation form ---------------------------------------------------------------------------------------------------------
+		/* 08-08-2004 - unknown - fixed `Insert Image' display to use $IMAGES_DIRECTORY */
+		global $sql, $rs, $ns, $pref, $tp, $pst, $e107;
+
+		if ($sub_action == "sn" && !$_POST['preview']) {
+			if ($sql->db_Select("submitnews", "*", "submitnews_id=$id", TRUE)) {
+				list($id, $submitnews_name, $submitnews_email, $_POST['news_title'], $submitnews_category, $_POST['data'], $submitnews_datestamp, $submitnews_ip, $submitnews_auth, $submitnews_file) = $sql->db_Fetch();
+
+				if (e_WYSIWYG)
+				{
+					$_POST['data'] .= "<br /><b>".NWSLAN_49." ".$submitnews_name."</b>";
+					$_POST['data'] .= ($submitnews_file)? "<br /><br /><img src='".e_IMAGE."newspost_images/$submitnews_file' style='float:right; margin-left:5px;margin-right:5px;margin-top:5px;margin-bottom:5px; border:1px solid' />":	"";
+				}
+				else
+				{
+					$_POST['data'] .= "\n[[b]".NWSLAN_49." ".$submitnews_name."[/b]]";
+					$_POST['data'] .= ($submitnews_file)?"\n\n[img]{E_IMAGE}newspost_images/".$submitnews_file."[/img]": "";
+				}
+				$_POST['cat_id'] = $submitnews_category;
+			}
+		}
+
+		if ($sub_action == "upload" && !$_POST['preview']) {
+			if ($sql->db_Select("upload", "*", "upload_id=$id")) {
+				$row = $sql->db_Fetch();
+				extract($row);
+				$post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
+				$post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
+				$upload_file = "pub_" . (preg_match("#Binary\s(.*?)\/#", $upload_file, $match) ? $match[1] : $upload_file);
+				$_POST['news_title'] = NWSLAN_66.": ".$upload_name;
+				$_POST['data'] = $upload_description."\n[b]".NWSLAN_49." <a href='user.php?id.".$post_author_id."'>".$post_author_name."</a>[/b]\n\n[file=request.php?".$upload_file."]".$upload_name."[/file]\n";
+			}
+		}
+
+		$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."?".e_QUERY."' id='dataform' ".(FILE_UPLOADS ? "enctype='multipart/form-data'" : "")." >
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>".NWSLAN_6.": </td>
+		<td style='width:80%' class='forumheader3'>";
+
+		if (!$sql->db_Select("news_category")) {
+			$text .= NWSLAN_10;
+			} else {
+
+			$text .= "
+			<select name='cat_id' class='tbox'>";
+
+			while (list($cat_id, $cat_name, $cat_icon) = $sql->db_Fetch()) {
+				$text .= ($_POST['cat_id'] == $cat_id ? "<option value='$cat_id' selected='selected'>".$cat_name."</option>" : "<option value='$cat_id'>".$cat_name."</option>");
+			}
+			$text .= "</select>";
+		}
+		$text .= "</td>
+		</tr>
+		<tr>
+		<td style='width:20%' class='forumheader3'>".NWSLAN_12.":</td>
+		<td style='width:80%' class='forumheader3'>
+		<input class='tbox' type='text' name='news_title' size='80' value='".$_POST['news_title']."' maxlength='200' style='width:95%'/>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>".LAN_NEWS_27.":</td>
+		<td style='width:80%' class='forumheader3'>
+		<input class='tbox' type='text' name='news_summary' size='80' value='".$tp->toForm($_POST['news_summary'])."' maxlength='250' style='width:95%'/>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>".NWSLAN_13.":<br /></td>
+		<td style='width:80%;margin-left:auto' class='forumheader3'>";
+
+		$insertjs = (!e_WYSIWYG) ? "rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'": "rows='25' ";
+		$_POST['data'] = $tp->toForm($_POST['data']);
+		$text .= "<textarea class='tbox' id='data' name='data'  cols='80'  style='width:100%' $insertjs>".(strstr($tp->post_toForm($_POST['data']), "[img]http") ? $_POST['data'] : str_replace("[img]../", "[img]", $tp->post_toForm($_POST['data'])))."</textarea>
+		";
+
+		//Main news body textarea
+		if (!e_WYSIWYG) {
+			$text .= "<input id='helpb' class='helpbox' type='text' name='helpb' size='100' style='width:95%'/>
+			<br />". display_help("helpb", 'news');
+		} // end of htmlarea check.
+
+		//Extended news form textarea
+		if(e_WYSIWYG){ $ff_expand = "tinyMCE.execCommand('mceResetDesignMode')";  } // Fixes Firefox issue with hidden wysiwyg textarea.
+		$text .= "
+		</td>
+		</tr>
+		<tr>
+		<td style='width:20%' class='forumheader3'>".NWSLAN_14.":</td>
+		<td style='width:80%' class='forumheader3'>
+		<a style='cursor: pointer; cursor: hand' onclick=\"expandit(this);$ff_expand\">".NWSLAN_83."</a>
+		<div style='display:none'>
+		<textarea class='tbox' id='news_extended' name='news_extended' cols='80' style='width:95%' $insertjs>".(strstr($tp->post_toForm($_POST['news_extended']), "[img]http") ? $tp->post_toForm($_POST['news_extended']) : str_replace("[img]../", "[img]", $tp->post_toForm($_POST['news_extended'])))."</textarea>";
+		if (!e_WYSIWYG) {
+			$text .="<br />". display_help("helpb", 'news');
+		}
+		$text .= "
+		</div>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>".NWSLAN_66.":</td>
+		<td style='width:80%' class='forumheader3'>
+		<a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_69."</a>
+		<div style='display: none;'>";
+
+		if (!FILE_UPLOADS)
+		{
+			$text .= "<b>".NWSLAN_78."</b>";
+		}
+		else
+		{
+			if (!is_writable(e_FILE."downloads"))
+			{
+				$text .= "<b>".NWSLAN_70."</b><br /><br />";
+			}
+			if (!is_writable(e_IMAGE."newspost_images"))
+			{
+				$text .= "<b>".NWSLAN_71."</b><br /><br />";
+			}
+
+			$up_name = array(LAN_NEWS_24,NWSLAN_67,LAN_NEWS_22,NWSLAN_68);
+			$up_value = array("resize","image","thumb","file");
+
+			$text .= "<div id='up_container' >
+			<span id='upline' style='white-space:nowrap'>
+			<input class='tbox' type='file' name='file_userfile[]' size='40' />
+			<select class='tbox' name='uploadtype[]'>";
+			for ($i=0; $i<count($up_value); $i++)
+			{
+				$selected = ($_POST['uploadtype'] == $up_value[$i]) ? "selected='selected'" : "";
+				$text .= "<option value='".$up_value[$i]."' $selected>".$up_name[$i]."</option>\n";
+			};
+
+			$text .="</select>&nbsp;</span>
+
+			</div>
+			<table style='width:100%'>
+			<tr><td><input type='button' class='button' value='".LAN_NEWS_26."' onclick=\"duplicateHTML('upline','up_container');\"  /></td>
+			<td><span class='smalltext'>".LAN_NEWS_25."</span>&nbsp;<input class='tbox' type='text' name='resize_value' value='".($_POST['resize_value'] ? $_POST['resize_value'] : '100')."' size='3' />&nbsp;px</td>
+			<td><input class='button' type='submit' name='submitupload' value='".NWSLAN_66."' /></td>
+			</tr></table>";
+
+		}
+		$text .= "</div>
+		</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3'>".LAN_NEWS_47.":</td>
+		<td class='forumheader3'>
+		<a style='cursor: pointer' onclick='expandit(this);'>".LAN_NEWS_23."</a>
+		<div style='display: none'><br />";
+
+        $parms = "name=news_thumbnail";
+		$parms .= "&path=".e_IMAGE."newspost_images/";
+		$parms .= "&default=".$_POST['news_thumbnail'];
+		$parms .= "&width=100px";
+		$parms .= "&height=100px";
+		$parms .= "&multiple=TRUE";
+		$parms .= "&label=-- ".LAN_NEWS_48." --";
+
+        $text .= $tp->parseTemplate("{IMAGESELECTOR={$parms}}");
+
+		$text .= "</div>
+		</td>
+		</tr>
+		";
+
+		$text .= "<tr>
+		<td style='width:20%' class='forumheader3'>".NWSLAN_15.":</td>
+		<td style='width:80%' class='forumheader3'>
+		<a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_18."</a>
+		<div style='display: none;'>
+
+		". ($_POST['news_allow_comments'] ? "<input name='news_allow_comments' type='radio' value='0' />".NWSLAN_16."&nbsp;&nbsp;<input name='news_allow_comments' type='radio' value='1' checked='checked' />".NWSLAN_17 : "<input name='news_allow_comments' type='radio' value='0' checked='checked' />".NWSLAN_16."&nbsp;&nbsp;<input name='news_allow_comments' type='radio' value='1' />".NWSLAN_17)."
+		</div>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>".NWSLAN_73.":</td>
+		<td style='width:80%' class='forumheader3'>
+		<a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_74."</a>
+		<div style='display: none;'>";
+		$ren_type = array(NWSLAN_75,NWSLAN_76,NWSLAN_77,NWSLAN_77." 2");
+		foreach($ren_type as $key=>$value) {
+			$checked = ($_POST['news_rendertype'] == $key) ? "checked='checked'" : "";
+			$text .= "<input name='news_rendertype' type='radio' value='$key' $checked />";
+			$text .= $value."<br />";
+		}
+
+		$text .="</div>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>".NWSLAN_19.":</td>
+		<td style='width:80%' class='forumheader3'>
+
+		<a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_72."</a>
+		<div style='display: none;'>
+
+		<br />
+		".NWSLAN_21.":<br />";
+
+		$_startdate = ($_POST['news_start'] > 0) ? date("d/m/Y", $_POST['news_start']) : "";
+
+		$cal_options['firstDay'] = 0;
+		$cal_options['showsTime'] = false;
+		$cal_options['showOthers'] = false;
+		$cal_options['weekNumbers'] = false;
+		$cal_options['ifFormat'] = "%d/%m/%Y";
+		$cal_attrib['class'] = "tbox";
+		$cal_attrib['size'] = "10";
+		$cal_attrib['name'] = "news_start";
+		$cal_attrib['value'] = $_startdate;
+		$text .= $cal->make_input_field($cal_options, $cal_attrib);
+
+		$text .= " - ";
+
+		$_enddate = ($_POST['news_end'] > 0) ? date("d/m/Y", $_POST['news_end']) : "";
+
+		unset($cal_options);
+		unset($cal_attrib);
+		$cal_options['firstDay'] = 0;
+		$cal_options['showsTime'] = false;
+		$cal_options['showOthers'] = false;
+		$cal_options['weekNumbers'] = false;
+		$cal_options['ifFormat'] = "%d/%m/%Y";
+		$cal_attrib['class'] = "tbox";
+		$cal_attrib['size'] = "10";
+		$cal_attrib['name'] = "news_end";
+		$cal_attrib['value'] = $_enddate;
+		$text .= $cal->make_input_field($cal_options, $cal_attrib);
+
+		$text .= "
+		</div>
+		</td>
+		</tr>";
+		$text .="<tr>
+		<td class='forumheader3'>
+		".LAN_NEWS_32.":
+		</td>
+		<td class='forumheader3'>
+		<a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".LAN_NEWS_33."</a>
+		<div style='display: none;'>";
+		$update_checked = ($_POST['update_datestamp']) ? "checked='checked'" : "";
+
+		$_update_datestamp = ($_POST['news_datestamp'] > 0) ? date("d/m/Y H:i:s", $_POST['news_datestamp']) : "";
+		unset($cal_options);
+		unset($cal_attrib);
+		$cal_options['firstDay'] = 0;
+		$cal_options['showsTime'] = true;
+		$cal_options['showOthers'] = true;
+		$cal_options['weekNumbers'] = false;
+		$cal_options['ifFormat'] = "%d/%m/%Y %H:%M:%S";
+		$cal_options['timeFormat'] = "24";
+		$cal_attrib['class'] = "tbox";
+		$cal_attrib['name'] = "news_datestamp";
+		$cal_attrib['value'] = $_update_datestamp;
+		$text .= $cal->make_input_field($cal_options, $cal_attrib);
+
+		$text .= "<br />
+		<input type='checkbox' value='1' name='update_datestamp' $update_checked />".NWSLAN_105."
+		</div>
+		</td></tr>";
+
+		// -------- end of datestamp ---------------------
+
+		$text .="	<tr>
+		<td class='forumheader3'>
+		".NWSLAN_22.":
+		</td>
+		<td class='forumheader3'>
+
+		<a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".NWSLAN_84."</a>
+		<div style='display: none;'>
+		".r_userclass_check("news_userclass", $_POST['news_class'], "nobody,public,guest,member,admin,classes,language")."
+		</div>
+		</td></tr>
+
+
+		<tr>
+		<td class='forumheader3'>
+		".LAN_NEWS_28.":
+		</td>
+		<td class='forumheader3'>
+
+		<a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".LAN_NEWS_29."</a>
+		<div style='display: none;'>
+		";
+		if($_POST['news_sticky'])
+		{
+			$sel = " checked='checked' ";
+		}
+		else
+		{
+			$sel = "";
+		}
+		$text .= "<input type='checkbox' {$sel} name='news_sticky' value='1' /> ".LAN_NEWS_30."\n</div>\n</td>\n</tr>\n";
+
+		if($pref['trackbackEnabled']){
+			$text .= "<tr>
+			<td class='forumheader3'>".LAN_NEWS_34.":</td>
+			<td class='forumheader3'><a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>".LAN_NEWS_35."</a>
+			<div style='display: none;'>
+			<span class='smalltext'>";
+			/* pingback */
+			//	<input type='checkbox' name='pingback_urls' ".($_POST['pingback_urls'] ? " checked='checked'" : "")." />".LAN_NEWS_36."<br />
+			$text .= LAN_NEWS_37."</span><br />
+			<textarea class='tbox' name='trackback_urls' style='width:95%;height:100px'>".$_POST['trackback_urls']."</textarea>
+			</div>
+			</td>
+			</tr>\n";
+		}
+
+
+		$text .= "<tr style='vertical-align: top;'>
+		<td colspan='2'  style='text-align:center' class='forumheader'>".
+
+		(isset($_POST['preview']) ? "<input class='button' type='submit' name='preview' value='".NWSLAN_24."' /> " : "<input class='button' type='submit' name='preview' value='".NWSLAN_27."' /> ").
+		($id && $sub_action != "sn" && $sub_action != "upload" ? "<input class='button' type='submit' name='submit_news' value='".NWSLAN_25."' /> " : "<input class='button' type='submit' name='submit_news' value='".NWSLAN_26."' /> ")."
+
+
+		<input type='hidden' name='news_id' value='$news_id' />  \n</td>
+		</tr>
+		</table>
+
+		</form>
+		</div>";
+		$ns->tablerender(NWSLAN_29, $text);
+	}
+
+
+	function preview_item($id) {
+		// ##### Display news preview ---------------------------------------------------------------------------------------------------------
+		global $tp, $sql, $ix, $IMAGES_DIRECTORY;
+
+		$_POST['news_id'] = $id;
+
+		if($_POST['news_start'])
+		{
+			$tmp = explode("/", $_POST['news_start']);
+			$_POST['news_start'] = mktime(0, 0, 0, $tmp[1], $tmp[0], $tmp[2]);
+		}
+		else
+		{
+			$_POST['news_start'] = 0;
+		}
+
+		if($_POST['news_end'])
+		{
+			$tmp = explode("/", $_POST['news_end']);
+			$_POST['news_end'] = mktime(0, 0, 0, $tmp[1], $tmp[0], $tmp[2]);
+		}
+		else
+		{
+			$_POST['news_end'] = 0;
+		}
+
+		if(preg_match("#(.*?)/(.*?)/(.*?) (.*?):(.*?):(.*?)$#", $_POST['news_datestamp'], $matches))
+		{
+			$_POST['news_datestamp'] = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]);
+		}
+		else
+		{
+			$_POST['news_datestamp'] = time();
+		}
+
+		if($_POST['update_datestamp'])
+		{
+			$_POST['news_datestamp'] = time();
+		}
+
+		$sql->db_Select("news_category", "*", "category_id='".$_POST['cat_id']."' ");
+		list($_POST['category_id'], $_POST['category_name'], $_POST['category_icon']) = $sql->db_Fetch();
+		$_POST['user_id'] = USERID;
+		$_POST['user_name'] = USERNAME;
+		$_POST['comment_total'] = $comment_total;
+		$_PR = $_POST;
+
+
+		$_PR['news_body'] = $tp->post_toHTML($_PR['data'],FALSE);
+		$_PR['news_title'] = $tp->post_toHTML($_PR['news_title']);
+		$_PR['news_summary'] = $tp->post_toHTML($_PR['news_summary']);
+		$_PR['news_extended'] = $tp->post_toHTML($_PR['news_extended']);
+		$_PR['news_file'] = $_POST['news_file'];
+		$_PR['news_image'] = $_POST['news_image'];
+
+		$ix -> render_newsitem($_PR);
+		echo $tp -> parseTemplate('{NEWSINFO}', FALSE, $news_shortcodes);
+	}
+
+	function submit_item($sub_action, $id) {
+		// ##### Format and submit item ---------------------------------------------------------------------------------------------------------
+		global $tp, $ix, $sql;
+		if($_POST['news_start'])
+		{
+			$tmp = explode("/", $_POST['news_start']);
+			$_POST['news_start'] = mktime(0, 0, 0, $tmp[1], $tmp[0], $tmp[2]);
+		}
+		else
+		{
+			$_POST['news_start'] = 0;
+		}
+
+		if($_POST['news_end'])
+		{
+			$tmp = explode("/", $_POST['news_end']);
+			$_POST['news_end'] = mktime(0, 0, 0, $tmp[1], $tmp[0], $tmp[2]);
+		}
+		else
+		{
+			$_POST['news_end'] = 0;
+		}
+
+		$_POST['update_datestamp'] = 0;
+
+		if(preg_match("#(.*?)/(.*?)/(.*?) (.*?):(.*?):(.*?)$#", $_POST['news_datestamp'], $matches))
+		{
+			$_POST['news_datestamp'] = mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[1], $matches[3]);
+		}
+		else
+		{
+			$_POST['news_datestamp'] = time();
+		}
+
+		if($_POST['update_datestamp'])
+		{
+			$_POST['news_datestamp'] = time();
+		}
+
+		if($sub_action == 'edit')
+		{
+			$_POST['news_author'] = -1;
+		}
+
+		if ($id && $sub_action != "sn" && $sub_action != "upload")
+		{
+			$_POST['news_id'] = $id;
+		}
+		else
+		{
+			$sql->db_Update("submitnews", "submitnews_auth='1' WHERE submitnews_id ='".$id."' ");
+		}
+		if (!$_POST['cat_id']) {
+			$_POST['cat_id'] = 1;
+		}
+		$this->show_message($ix->submit_item($_POST));
+		unset($_POST['news_title'], $_POST['cat_id'], $_POST['data'], $_POST['news_extended'], $_POST['news_allow_comments'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear'], $_POST['news_id'], $_POST['news_class']);
+	}
+
+	function show_message($message) {
+		// ##### Display comfort ---------------------------------------------------------------------------------------------------------
+		global $ns;
+		$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+	}
+
+	function show_categories($sub_action, $id) {
+		global $sql, $rs, $ns, $tp;
+		$handle = opendir(e_IMAGE."icons");
+		while ($file = readdir($handle)) {
+			if ($file != "." && $file != ".." && $file != "/" && $file != "null.txt" && $file != "CVS") {
+				$iconlist[] = $file;
+			}
+		}
+		closedir($handle);
+
+		if ($sub_action == "edit") {
+			if ($sql->db_Select("news_category", "*", "category_id='$id' ")) {
+				$row = $sql->db_Fetch();
+				extract($row);
+			}
+		}
+
+		$text = "<div style='text-align:center'>
+		".$rs->form_open("post", e_SELF."?cat", "dataform")."
+		<table class='fborder' style='".ADMIN_WIDTH."'>
+		<tr>
+		<td class='forumheader3' style='width:30%'><span class='defaulttext'>".NWSLAN_52."</span></td>
+		<td class='forumheader3' style='width:70%'>".$rs->form_text("category_name", 30, $category_name, 200)."</td>
+		</tr>
+		<tr>
+		<td class='forumheader3' style='width:30%'><span class='defaulttext'>".NWSLAN_53."</span></td>
+		<td class='forumheader3' style='width:70%'>
+		".$rs->form_text("category_button", 60, $category_icon, 100)."
+		<br />
+		<input class='button' type ='button' style='cursor:hand' size='30' value='".NWSLAN_54."' onclick='expandit(this)' />
+		<div id='caticn' style='display:none'>";
+		while (list($key, $icon) = each($iconlist)) {
+			$text .= "<a href=\"javascript:insertext('$icon','category_button','caticn')\"><img src='".e_IMAGE."icons/".$icon."' style='border:0' alt='' /></a>\n ";
+		}
+		$text .= "</div></td>
+		</tr>
+
+		<tr><td colspan='2' style='text-align:center' class='forumheader'>";
+		if ($id) {
+			$text .= "<input class='button' type='submit' name='update_category' value='".NWSLAN_55."' />
+			".$rs->form_button("submit", "category_clear", NWSLAN_79). $rs->form_hidden("category_id", $id)."
+			</td></tr>";
+			} else {
+			$text .= "<input class='button' type='submit' name='create_category' value='".NWSLAN_56."' /></td></tr>";
+		}
+		$text .= "</table>
+		".$rs->form_close()."
+		</div>";
+
+		$ns->tablerender(NWSLAN_56, $text);
+
+		unset($category_name, $category_icon);
+
+		$text = "<div style='text-align: center'>";
+		if ($category_total = $sql->db_Select("news_category")) {
+			$text .= "
+			<form action='".e_SELF."?cat' id='newscatform' method='post'>
+			<table class='fborder' style='".ADMIN_WIDTH."'>
+			<tr>
+			<td style='width:5%' class='fcaption'>".LAN_NEWS_45."</td>
+			<td style='width:5%' class='fcaption'>&nbsp;</td>
+			<td style='width:70%' class='fcaption'>".NWSLAN_6."</td>
+			<td style='width:20%; text-align:center' class='fcaption'>".LAN_OPTIONS."</td>
+			</tr>";
+			while ($row = $sql->db_Fetch()) {
+				extract($row);
+
+				if ($category_icon) {
+					$icon = (strstr($category_icon, "images/") ? THEME."$category_icon" : e_IMAGE."icons/$category_icon");
+				}
+
+				$text .= "<tr>
+				<td style='width:5%; text-align:center' class='forumheader3'>{$category_id}</td>
+				<td style='width:5%; text-align:center' class='forumheader3'><img src='$icon' alt='' style='vertical-align:middle' /></td>
+				<td style='width:70%' class='forumheader3'>$category_name</td>
+				<td style='width:20%; text-align:center' class='forumheader3'>
+				<a href='".e_SELF."?cat.edit.{$category_id}'>".ADMIN_EDIT_ICON."</a>
+				<input type='image' title='".LAN_DELETE."' name='delete[category_{$category_id}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(NWSLAN_37." [ID: $category_id ]")."') \"/>
+				</td>
+				</tr>\n";
+			}
+			$text .= "</table></form>";
+			} else {
+			$text .= "<div style='text-align:center'><div style='vertical-align:center'>".NWSLAN_10."</div>";
+		}
+		$text .= "</div>";
+		$ns->tablerender(NWSLAN_51, $text);
+	}
+
+	function show_news_prefs() {
+		global $sql, $rs, $ns, $pref;
+
+		$text = "<div style='text-align:center'>
+		".$rs->form_open("post", e_SELF."?pref", "dataform")."
+		<table class='fborder' style='".ADMIN_WIDTH."'>
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_86."</span></td>
+		<td class='forumheader3' style='width:40%'>
+		<input type='checkbox' name='news_cats' value='1' ".($pref['news_cats'] == 1 ? " checked='checked'" : "")." />
+		</td>
+
+		</tr>
+
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_87."</span></td>
+		<td class='forumheader3' style='width:40%'>
+		<select class='tbox' name='nbr_cols'>
+		<option value='1' ".($pref['nbr_cols'] == 1 ? "selected='selected'>" : "").">1</option>
+		<option value='2' ".($pref['nbr_cols'] == 2 ? "selected='selected'>" : "").">2</option>
+		<option value='3' ".($pref['nbr_cols'] == 3 ? "selected='selected'>" : "").">3</option>
+		<option value='4' ".($pref['nbr_cols'] == 4 ? "selected='selected'>" : "").">4</option>
+		<option value='5' ".($pref['nbr_cols'] == 5 ? "selected='selected'>" : "").">5</option>
+		<option value='6' ".($pref['nbr_cols'] == 6 ? "selected='selected'>" : "").">6</option>
+		</select></td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_88."</span></td>
+		<td class='forumheader3' style='width:40%'>
+		<input class='tbox' type='text' style='width:30px' name='newsposts' value='".$pref['newsposts']."' />
+		</td>
+		</tr>";
+
+		//			<tr>
+		//			<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_108."</span><br /><i>".NWSLAN_109."</i></td>
+		//			<td class='forumheader3' style='width:40%'>
+		//			<input type='checkbox' name='subnews_hide_news' value='1' ".($pref['subnews_hide_news'] == 1 ? " checked='checked'" : "")." />
+		//			</td>
+		//			</tr>";
+
+
+
+
+
+		// ##### ADDED FOR NEWSARCHIVE --------------------------------------------------------------------
+		// the possible archive values are from "0" to "< $pref['newsposts']"
+		// this should really be made as an onchange event on the selectbox for $pref['newsposts'] ...
+		$text .= "
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_115."</span><br />
+		<span class='defaulttext'><i>".NWSLAN_116."</i></span>
+		</td>
+		<td class='forumheader3' style='width:40%'>
+		<select class='tbox' name='newsposts_archive'>";
+		for($i = 0; $i < $pref['newsposts']; $i++) {
+			$text .= ($i == $pref['newsposts_archive'] ? "<option value='".$i."' selected='selected'>".$i."</option>" : " <option value='".$i."'>".$i."</option>");
+		}
+		$text .= "</select></td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_117."</span></td>
+		<td class='forumheader3' style='width:40%'>
+		<input class='tbox' type='text' style='width:150px' name='newsposts_archive_title' value='".$pref['newsposts_archive_title']."' />
+		</td>
+		</tr>
+		";
+		// ##### END --------------------------------------------------------------------------------------
+
+
+		require_once(e_HANDLER."userclass_class.php");
+		$text .= " <tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_106."</span></td>
+		<td class='forumheader3' style='width:40%'>
+		".r_userclass("subnews_class", $pref['subnews_class']). "</td></tr>";
+
+
+		$text .= "
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_107."</span></td>
+		<td class='forumheader3' style='width:40%'>
+		<input type='checkbox' name='subnews_htmlarea' value='1' ".($pref['subnews_htmlarea'] == 1 ? " checked='checked'" : "")." />
+		</td>
+		</tr>";
+
+
+		$text .= "
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_100."</span></td>
+		<td class='forumheader3' style='width:40%'>
+		<input type='checkbox' name='subnews_attach' value='1' ".($pref['subnews_attach'] == 1 ? " checked='checked'" : "")." />
+		</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_101."</span></td>
+		<td class='forumheader3' style='width:40%'>
+		<input class='tbox' type='text' style='width:50px' name='subnews_resize' value='".$pref['subnews_resize']."' />
+		<span class='smalltext'>".NWSLAN_102."</span></td>
+		</tr>
+
+
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_111."</span><br /><i>".NWSLAN_112."</i></td>
+		<td class='forumheader3' style='width:40%'>
+		<input type='checkbox' name='news_newdateheader' value='1' ".($pref['news_newdateheader'] == 1 ? " checked='checked'" : "")." />
+		</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_113."</span><br /><i>".NWSLAN_114."</i></td>
+		<td class='forumheader3' style='width:40%'>
+		<input type='checkbox' name='news_unstemplate' value='1' ".($pref['news_unstemplate'] == 1 ? " checked='checked'" : "")." />
+		</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3' style='width:60%'><span class='defaulttext'>".NWSLAN_120."</span><br /></td>
+		<td class='forumheader3' style='width:40%'>
+		<textarea name='news_subheader' style='width:95%;' rows='6' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);' class='tbox'>".stripcslashes($pref['news_subheader'])." </textarea><br />" . ren_help(2) . "
+		</td>
+		</tr>
+
+
+		<tr><td colspan='2' style='text-align:center' class='forumheader'>";
+		$text .= "<input class='button' type='submit' name='save_prefs' value='".NWSLAN_89."' /></td></tr>";
+
+		$text .= "</table>
+		".$rs->form_close()."
+		</div>";
+
+		$ns->tablerender(NWSLAN_90, $text);
+	}
+
+
+
+
+	function submitted_news($sub_action, $id) {
+		global $rs, $ns, $tp;
+		$sql2 = new db;
+		$text = "<div style='text-align: center'>";
+		if ($category_total = $sql2->db_Select("submitnews", "*", "submitnews_id !='' ORDER BY submitnews_id DESC")) {
+			$text .= "<table class='fborder' style='".ADMIN_WIDTH."'>
+			<tr>
+			<td style='width:5%' class='fcaption'>ID</td>
+			<td style='width:70%' class='fcaption'>".NWSLAN_57."</td>
+			<td style='width:25%; text-align:center' class='fcaption'>".LAN_OPTIONS."</td>
+			</tr>";
+			while ($row = $sql2->db_Fetch()) {
+				extract($row);
+				$text .= "<tr>
+				<td style='width:5%; text-align:center; vertical-align:top' class='forumheader3'>$submitnews_id</td>
+				<td style='width:70%' class='forumheader3'>";
+				$text .= ($submitnews_auth == 0)? "<b>".$tp->toHTML($submitnews_title)."</b>": $tp->toHTML($submitnews_title);
+				$text .= " [ ".NWSLAN_104." $submitnews_name on ".date("D dS M y, g:ia", $submitnews_datestamp)."]<br />".$tp->toHTML($submitnews_item)."</td>
+				<td style='width:25%; text-align:right; vertical-align:top' class='forumheader3'>";
+				$buttext = ($submitnews_auth == 0)? NWSLAN_58 :	NWSLAN_103;
+				$text .= $rs->form_open("post", e_SELF."?sn", "myform__{$submitnews_id}", "", "", " onsubmit=\"return jsconfirm('".$tp->toJS(NWSLAN_38." [ID: $submitnews_id ]")."')\"   ")
+				."<div>".$rs->form_button("button", "category_edit_{$submitnews_id}", $buttext, "onclick=\"document.location='".e_SELF."?create.sn.$submitnews_id'\"")."
+				".$rs->form_button("submit", "delete[sn_{$submitnews_id}]", LAN_DELETE)."
+				</div>".$rs->form_close()."
+				</td>
+				</tr>\n";
+			}
+			$text .= "</table>";
+			} else {
+			$text .= "<div style='text-align:center'>".NWSLAN_59."</div>";
+		}
+		$text .= "</div>";
+		$ns->tablerender(NWSLAN_60, $text);
+
+	}
+
+}
+
+function newspost_adminmenu() {
+	global $newspost;
+	global $action;
+	$newspost->show_options($action);
+}
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/notify.php 75/e107_admin/notify.php
--- 6171/e107_admin/notify.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/notify.php	2005-12-21 11:17:22.000000000 -0600
@@ -0,0 +1,180 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/notify.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/12/21 17:17:22 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once('../class2.php');
+if (!getperms('O')) {
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
+
+$e_sub_cat = 'notify';
+
+require_once('auth.php');
+require_once(e_HANDLER.'userclass_class.php');
+require_once(e_HANDLER.'form_handler.php');
+$rs = new form;
+$nc = new notify_config;
+if (isset($_POST['update'])) {
+	$nc -> update();
+}
+$nc -> config();
+
+class notify_config {
+	
+	var $notify_prefs;
+	
+	function notify_config() {
+		global $sysprefs, $eArrayStorage, $tp, $sql;
+		$this -> notify_prefs = $sysprefs -> get('notify_prefs');
+		$this -> notify_prefs = $eArrayStorage -> ReadArray($this -> notify_prefs);
+		
+		$handle = opendir(e_PLUGIN);
+		while (false !== ($file = readdir($handle))) {
+			if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)) {
+				$plugin_handle = opendir(e_PLUGIN.$file."/");
+				while (false !== ($file2 = readdir($plugin_handle))) {
+					if ($file2 == "e_notify.php") {
+						if ($sql -> db_Select("plugin", "plugin_path", "plugin_path='".$file."' AND plugin_installflag='1'")) {
+							if (!isset($this -> notify_prefs['plugins'][$file])) {
+								$this -> notify_prefs['plugins'][$file] = TRUE;
+								require_once(e_PLUGIN.$file.'/e_notify.php');
+								foreach ($config_events as $event_id => $event_text) {
+									$this -> notify_prefs['event'][$event_id] = array('type' => 'off', 'class' => '254', 'email' => '');
+								}
+								$recalibrate = true;
+							}
+						}
+					}
+				}
+			}
+		}
+		
+		if ($recalibrate) {
+			$s_prefs = $tp -> toDB($this -> notify_prefs);
+			$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
+			$sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'");
+		}
+	}
+	
+	function config() {
+		global $ns, $rs;
+
+		$text = "<div style='text-align: center'>
+		<form action='".e_SELF."?results' method='post' id='scanform'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td class='fcaption' colspan='2'>".NT_LAN_2.":</td>
+		</tr>";
+		
+		$text .= "<tr>
+		<td colspan='2' class='forumheader'>".NU_LAN_1."</td>
+		</tr>";
+		
+		$text .= $this -> render_event('usersup', NU_LAN_2);		
+		$text .= $this -> render_event('userveri', NU_LAN_3);
+		$text .= $this -> render_event('login', NU_LAN_4);
+		$text .= $this -> render_event('logout', NU_LAN_5);
+		
+		$text .= "<tr>
+		<td colspan='2' class='forumheader'>".NS_LAN_1."</td>
+		</tr>";
+		
+		$text .= $this -> render_event('flood', NS_LAN_2);
+
+		
+		$text .= "<tr>
+		<td colspan='2' class='forumheader'>".NN_LAN_1."</td>
+		</tr>";
+		
+		$text .= $this -> render_event('subnews', NN_LAN_2);
+		$text .= $this -> render_event('newspost', NN_LAN_3);
+		$text .= $this -> render_event('newsupd', NN_LAN_4);
+		$text .= $this -> render_event('newsdel', NN_LAN_5);
+		
+		foreach ($this -> notify_prefs['plugins'] as $plugin_id => $plugin_settings) {
+			require(e_PLUGIN.$plugin_id.'/e_notify.php');
+			$text .= "<tr>
+			<td colspan='2' class='forumheader'>".$config_category."</td>
+			</tr>";
+			foreach ($config_events as $event_id => $event_text) {
+				$text .= $this -> render_event($event_id, $event_text);
+			}
+		}
+
+		$text .= "<tr>
+		<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button('submit', 'update', LAN_UPDATE)."</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+
+		$ns -> tablerender(NT_LAN_1, $text);
+	}
+	
+	function render_event($id, $description) {
+		global $rs, $tp;
+		$text .= "<tr>
+		<td class='forumheader3' style='width: 30%'>
+		".$description.":
+		</td>
+		<td class='forumheader3' style='width: 70%; white-space: nowrap'>
+		<input type='radio' name='event[".$id."][type]' value='off' ".(($this -> notify_prefs['event'][$id]['type'] == 'off' || !$this -> notify_prefs['event'][$id]['type']) ? " checked='checked'" : "")." /> ".NT_LAN_3." 
+		<input type='radio' name='event[".$id."][type]' value='main' ".($this -> notify_prefs['event'][$id]['type'] == 'main' ? " checked='checked'" : "")." /> ".NT_LAN_4." 
+		<input type='radio' name='event[".$id."][type]' value='class' ".($this -> notify_prefs['event'][$id]['type'] == 'class' ? " checked='checked'" : "")." /> ".NT_LAN_5.": 
+		".r_userclass('event['.$id.'][class]', $this -> notify_prefs['event'][$id]['class'], 'off', 'member,admin,classes')." 
+		<input type='radio' name='event[".$id."][type]' value='email' ".($this -> notify_prefs['event'][$id]['type'] == 'email' ? " checked='checked'" : "")." /> ".NT_LAN_6.": 
+		".$rs -> form_text('event['.$id.'][email]', 17, $tp -> toForm($this -> notify_prefs['event'][$id]['email']))."
+		</td>
+		</tr>";
+		return $text;
+	}
+	
+	function update() {
+		global $sql, $pref, $tp, $eArrayStorage;
+		foreach ($_POST['event'] as $key => $value) {
+			if ($this -> update_event($key)) {
+				$active = TRUE;
+			}
+		}
+		
+		$s_prefs = $tp -> toDB($this -> notify_prefs);
+		$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
+		$sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'");
+		if ($active) {
+			$pref['notify'] = TRUE;
+		} else {
+			$pref['notify'] = FALSE;
+		}
+		save_prefs();
+	}
+	
+	function update_event($id) {
+		$this -> notify_prefs['event'][$id]['type'] = $_POST['event'][$id]['type'];
+		$this -> notify_prefs['event'][$id]['class'] = $_POST['event'][$id]['class'];
+		$this -> notify_prefs['event'][$id]['email'] = $_POST['event'][$id]['email'];
+		if ($this -> notify_prefs['event'][$id]['type'] != 'off') {
+			return TRUE;
+		} else {
+			return FALSE;
+		}
+	}
+}
+
+require_once('footer.php');
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/phpinfo.php 75/e107_admin/phpinfo.php
--- 6171/e107_admin/phpinfo.php	2004-03-03 12:23:46.000000000 -0600
+++ 75/e107_admin/phpinfo.php	2005-08-23 15:57:49.000000000 -0500
@@ -1,26 +1,34 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/phpinfo.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("0")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-
-ob_start();
-phpinfo();
-$phpinfo .= ob_get_contents();
-$phpinfo = eregi_replace("^.*\<body\>", "", $phpinfo);
-ob_end_clean();
-$ns -> tablerender("PHPInfo", $phpinfo);
-require_once("footer.php");
-?>	
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/phpinfo.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/08/23 20:57:49 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("0")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'phpinfo';
+require_once("auth.php");
+	
+ob_start();
+phpinfo();
+$phpinfo .= ob_get_contents();
+$phpinfo = preg_replace("#^.*<body>#is", "", $phpinfo);
+ob_end_clean();
+$ns->tablerender("PHPInfo", $phpinfo);
+require_once("footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/plugin.php 75/e107_admin/plugin.php
--- 6171/e107_admin/plugin.php	2004-09-03 12:28:06.000000000 -0500
+++ 75/e107_admin/plugin.php	2006-03-16 09:58:14.000000000 -0600
@@ -1,410 +1,574 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        code adapted from original by Lolo Irie (lolo@touchatou.com)
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("Z")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-require_once(e_HANDLER."parser_handler.php");
-
-//        check for new plugins, create entry in plugin table ...
-$handle=opendir(e_PLUGIN);
-while(false !== ($file = readdir($handle)))
-{
-	if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file))
-	{
-		$plugin_handle=opendir(e_PLUGIN.$file."/");
-		while(false !== ($file2 = readdir($plugin_handle)))
-		{
-			if($file2 == "plugin.php")
-			{
-				include(e_PLUGIN.$file."/".$file2);
-				if(!$sql -> db_Select("plugin", "*", "plugin_name='$eplug_name'"))
-				{
-					if(!$eplug_prefs && !$eplug_table_names && !$eplug_user_prefs && !$eplug_parse && !$eplug_userclass && !$eplug_module)
-					{
-						// new plugin, assign entry in plugin table, install is not necessary so mark it as intalled
-						$sql -> db_Insert("plugin", "0, '$eplug_name', '$eplug_version', '$eplug_folder', 1");        
-					}
-					else
-					{
-						// new plugin, assign entry in plugin table, install is necessary
-						$sql -> db_Insert("plugin", "0, '$eplug_name', '$eplug_version', '$eplug_folder', 0");        
-					}
-				}
-			}
-		}
-		closedir($plugin_handle);
-	}
-}
-closedir($handle);
-
-$sql -> db_Select("plugin");
-while($row = $sql -> db_fetch())
-{
-	if(!is_dir(e_PLUGIN.$row[plugin_path]))
-	{
-		$sql -> db_Delete("plugin", "plugin_path='{$row['plugin_path']}'");
-	}
-}
-
-if(strstr(e_QUERY, "uninstall")){
-        $tmp = explode(".", e_QUERY);
-        $id = intval($tmp[1]); unset($tmp);
-
-        $sql -> db_Select("plugin", "*", "plugin_id='$id' ");
-        $row = $sql -> db_Fetch(); extract($row);
-        $text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:95%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr>
-<td class='forumheader3' style='text-align:center'>".EPL_ADLAN_2."<br /><br />
-<input class='button' type='submit' name='cancel' value='".EPL_CANCEL."' />
-<input class='button' type='submit' name='confirm' value='".EPL_ADLAN_1." $plugin_name' />
-</td>
-</tr>
-</table>
-<input type='hidden' name='id' value='$id' />
-</form>
-</div>";
-        $ns -> tablerender(EPL_ADLAN_3, $text);
-        require_once("footer.php");
-        exit;
-}
-
-if(IsSet($_POST['cancel'])){
-        $ns -> tablerender("", "<div style='text-align:center'>".EPL_ADLAN_4."</div>");
-}
-
-if(IsSet($_POST['confirm'])){
-
-        $id = $_POST['id'];
-        $sql -> db_Select("plugin", "*", "plugin_id='$id' ");
-        $row = $sql -> db_Fetch(); extract($row);
-        if($plugin_installflag){  //Uninstall Plugin
-                include(e_PLUGIN.$plugin_path."/plugin.php");
-                if(is_array($eplug_tables)){
-                        while(list($key, $e_table) = each($eplug_table_names)){
-                                if(!mysql_query("DROP TABLE ".$mySQLprefix.$e_table)){
-                                        $text .= EPL_ADLAN_27." <b>".$mySQLprefix.$e_table."</b> - ".EPL_ADLAN_30."<br />";
-                                        $err_plug = TRUE;
-                                }
-                        }
-                         if(!$err_plug){
-                                $text .= EPL_ADLAN_28."<br />";
-                        }
-                }
-
-                if(is_array($eplug_prefs)){
-                        while(list($key, $e_pref) = each($eplug_prefs)){
-                                unset($pref[$key]);
-                        }
-                        save_prefs();
-                        $text .= EPL_ADLAN_29."<br />";
-                }
-                                        if($eplug_module){
-                                                $mods=explode(",",$pref['modules']);
-                                                foreach($mods as $k => $v){
-                                                        if($v == $eplug_folder){unset($mods[$k]);}
-                                                }
-                                                $pref['modules'] = implode(",",$mods);
-                  save_prefs();
-                }
-
-
-                if(is_array($eplug_user_prefs)){
-                        $sql = new db;
-                        $sql -> db_Select("core", " e107_value", " e107_name='user_entended'");
-                        $row = $sql -> db_Fetch();
-                        $user_entended = unserialize($row[0]);
-                        $user_entended = array_values(array_diff($user_entended, array_keys($eplug_user_prefs)));
-                        if($user_entended == NULL){
-                                $sql -> db_Delete("core", "e107_name='user_entended'");
-                        }else{
-                                $tmp = addslashes(serialize($user_entended));
-                                $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
-                        }
-                        while(list($key, $e_user_pref) = each($eplug_user_prefs)){
-                                unset($user_pref[$key]);
-                        }
-                        save_prefs("user");
-                }
-                if($eplug_menu_name){
-                        $sql -> db_Delete("menus", "menu_name='$eplug_menu_name' ");
-                }
-
-                if($eplug_link){
-                        $sql -> db_Delete("links", "link_name='$eplug_link_name' ");
-                }
-
-                if($eplug_userclass){
-                        $sql -> db_Delete("userclass_classes", "userclass_name='$eplug_userclass' ");
-                }
-
-                if(is_array($eplug_parse)){
-                        $sql -> db_Delete("parser","parser_pluginname='".$eplug_folder."'");
-                }
-
-                $sql -> db_Update("plugin", "plugin_installflag=0, plugin_version='$eplug_version' WHERE plugin_id='$id' ");
-                $text .= "<br />".EPL_ADLAN_31." <b>".e_PLUGIN.$eplug_folder."</b> ".EPL_ADLAN_32;
-                $ns->tablerender(EPL_ADLAN_1." ".$eplug_name, $text);
-        }
-}
-
-if(strstr(e_QUERY, "install")){
-        //        install plugin ...
-        $tmp = explode(".", e_QUERY);
-        $id = $tmp[1]; unset($tmp);
-
-        $sql -> db_Select("plugin", "*", "plugin_id='$id' ");
-        $row = $sql -> db_Fetch(); extract($row);
-        if(!$plugin_installflag){
-                include(e_PLUGIN.$plugin_path."/plugin.php");
-
-
-                if(is_array($eplug_tables)){
-                        while(list($key, $e_table) = each($eplug_tables)){
-                                if(!mysql_query($e_table)){
-                                        $text .= EPL_ADLAN_18."<br />";
-                                        $err_plug = TRUE;
-                                        break;
-                                }
-                        }
-                         if(!$err_plug){
-                                $text .= EPL_ADLAN_19."<br />";
-                         }
-                }
-
-                if(is_array($eplug_prefs)){
-                        while(list($key, $e_pref) = each($eplug_prefs)){
-                                if(!in_array($pref, $e_pref)){
-                                        $pref[$key] = $e_pref;
-                                }
-                        }
-                        save_prefs();
-                        $text .= EPL_ADLAN_20."<br />";
-
-                }
-                                        if($eplug_module){
-                                                $mods = explode(",",$pref['modules']);
-                                                if(!in_array($eplug_folder,$mods)){
-                                                        $mods[]=$eplug_folder;
-                                                }
-                                                $pref['modules'] = implode(",",$mods);
-                  save_prefs();
-               }
-
-
-                if(is_array($eplug_user_prefs)){
-                        $sql = new db;
-                        $sql -> db_Select("core", " e107_value", " e107_name='user_entended'");
-                        $row = $sql -> db_Fetch();
-                        $user_entended = unserialize($row[0]);
-                        while(list($e_user_pref, $default_value) = each($eplug_user_prefs)){
-                            $user_entended[] = $e_user_pref;
-                                $user_pref['$e_user_pref'] = $default_value;
-                        }
-                        save_prefs("user");
-                        $tmp = addslashes(serialize($user_entended));
-                        if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-                                $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
-                        }else{
-                                $sql -> db_Insert("core", "'user_entended', '$tmp' ");
-                        }
-                        $text .= EPL_ADLAN_20."<br />";
-                }
-
-                if(is_array($eplug_parse)){
-                        while(list($key, $e_regexp) = each($eplug_parse)){
-                                if(register_parser($eplug_folder,$e_regexp) == 2){
-                                        $text .= EPL_ADLAN_36."<br />";
-                                }
-                        }
-                        $text .= EPL_ADLAN_35."<br />";
-                }
-
-                if($eplug_link){
-                        $path = str_replace("../", "", $eplug_link_url);
-                        if(!$sql -> db_Select("links", "*", "link_name='$eplug_link_name' ")){
-                                $sql -> db_Insert("links", "0, '$eplug_link_name', '$path', '', '', '1', '0', '0', '0', '' ");
-                        }
-                }
-
-                if($eplug_userclass){
-                        $i=1;
-                        while($sql -> db_Select("userclass_classes", "*", "userclass_id='".$i."' ") && $i<255){
-                                $i++;
-                        }
-                        if($i<255){
-                                $sql -> db_Insert("userclass_classes", $i.", '".strip_tags(strtoupper($eplug_userclass))."', '{$eplug_userclass_description}' ,".e_UC_PUBLIC);
-                        }
-                }
-
-                $sql -> db_Update("plugin", "plugin_installflag=1 WHERE plugin_id='$id' ");
-                $text .= ($eplug_done ? "<br />".$eplug_done : "");
-        }else{
-                $text = EPL_ADLAN_21;
-        }
-
-        $ns->tablerender(EPL_ADLAN_33, $text);
-
-
-}
-
-if(strstr(e_QUERY, "upgrade")){
-        $tmp = explode(".", e_QUERY);
-        $id = $tmp[1]; unset($tmp);
-
-        $sql -> db_Select("plugin", "*", "plugin_id='$id' ");
-        $row = $sql -> db_Fetch(); extract($row);
-        include(e_PLUGIN.$plugin_path."/plugin.php");
-
-        if(is_array($upgrade_alter_tables)){
-                while(list($key, $e_table) = each($upgrade_alter_tables)){
-                        if(!mysql_query($e_table)){
-                                $text .= EPL_ADLAN_9."<br />";
-                                $err_plug = TRUE;
-                                break;
-                        }
-                }
-                 if(!$err_plug){
-                        $text .= EPL_ADLAN_7."<br />";
-                 }
-        }
-
-        if(is_array($eplug_parse)){
-                while(list($key, $e_regexp) = each($eplug_parse)){
-                        $p_added .= register_parser($eplug_folder,$e_regexp);
-                }
-                if($p_added){
-                        $text .= EPL_ADLAN_35."<br />";
-                }
-        }
-
-        if(is_array($upgrade_add_prefs)){
-                while(list($key, $e_pref) = each($upgrade_add_prefs)){
-                        if(!in_array($pref, $e_pref)){
-                                $pref[$key] = $e_pref;
-                        }
-                }
-                save_prefs();
-                $text .= EPL_ADLAN_8."<br />";
-
-        }
-
-        if(is_array($upgrade_remove_prefs)){
-                while(list($key, $e_pref) = each($upgrade_remove_prefs)){
-                        unset($pref[$key]);
-                }
-                save_prefs();
-        }
-        if(is_array($upgrade_add_user_prefs)){
-                $sql = new db;
-                $sql -> db_Select("core", " e107_value", " e107_name='user_entended'");
-                $row = $sql -> db_Fetch();
-                $user_entended = unserialize($row[0]);
-                while(list($key, $e_user_pref) = each($eplug_user_prefs)){
-                    $user_entended[] = $e_user_pref;
-                }
-                $tmp = addslashes(serialize($user_entended));
-                if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-                        $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
-                }else{
-                        $sql -> db_Insert("core", "'user_entended', '$tmp' ");
-                }
-                $text .= EPL_ADLAN_8."<br />";
-        }
-
-        if(is_array($upgrade_remove_user_prefs)){
-                $sql = new db;
-                $sql -> db_Select("core", " e107_value", " e107_name='user_entended'");
-                $row = $sql -> db_Fetch();
-                $user_entended = unserialize($row[0]);
-                $user_entended = array_values(array_diff($user_entended, $eplug_user_prefs));
-                if($user_entended == NULL){
-                        $sql -> db_Delete("core", "e107_name='user_entended'");
-                }else{
-                        $tmp = addslashes(serialize($user_entended));
-                        $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
-                }
-        }
-
-        $text .= "<br />".$eplug_upgrade_done;
-
-        $sql -> db_Update("plugin", "plugin_version ='$eplug_version' WHERE plugin_id='$id' ");
-
-        $ns->tablerender(EPL_ADLAN_34, $text);
-
-}
-
-// ----------------------------------------------------------
-
-//        render plugin information ...
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:95%' class='fborder'>";
-
-$sql -> db_Select("plugin");
-while($row = $sql -> db_Fetch()){
-        extract($row);
-        unset($eplug_module, $eplug_parse, $eplug_name, $eplug_version, $eplug_author, $eplug_logo, $eplug_url, $eplug_email, $eplug_description, $eplug_compatible, $eplug_readme, $eplug_folder, $eplug_table_names, $eplug_userclass);
-        include(e_PLUGIN.$plugin_path."/plugin.php");
-
-        if(is_array($eplug_table_names) || is_array($eplug_prefs)  || is_array($eplug_user_prefs) || is_array($eplug_parse) || $eplug_module || $eplug_userclass){
-                $img = (!$plugin_installflag ? "<img src='".e_IMAGE."generic/uninstalled.png' alt='' />" : "<img src='".e_IMAGE."generic/installed.png' alt='' />");
-        }else{
-                $img = "<img src='".e_IMAGE."generic/noinstall.png' alt='' />";
-        }
-
-        if($plugin_version != $eplug_version && $plugin_installflag){
-                $img = "<img src='".e_IMAGE."generic/upgrade.png' alt='' />";
-        }
-
-        $text .= "<tr>
-        <td class='forumheader3' style='width:30%; text-align:center; vertical-align:middle'>".($eplug_logo && $eplug_logo != "button.png" ? "<img src='".e_PLUGIN.$eplug_folder."/".$eplug_logo."' alt='' /><br /><br />" : "")."
-
-
-        $img <b>$plugin_name</b><br />version $plugin_version<br /></td>
-        <td class='forumheader3' style='width:70%'><b>".EPL_ADLAN_12."</b>: $eplug_author<br />[ ".EPL_EMAIL.": $eplug_email | ".EPL_WEBSITE.": $eplug_url ]<br />
-        <b>".EPL_ADLAN_14."</b>: $eplug_description<br /><b>Requires</b> : $eplug_compatible <br />\n";
-        if($eplug_readme){
-                $text .= "[ <a href='".e_PLUGIN.$eplug_folder."/".$eplug_readme."'>".$eplug_readme."</a> ]<br />";
-        }
-        if($eplug_module || is_array($eplug_table_names) || is_array($eplug_prefs)  || is_array($eplug_user_prefs) || is_array($eplug_parse)){
-                $text .= "<b>".EPL_OPTIONS."</b>: [ ".($plugin_installflag ? "<a href='".e_SELF."?uninstall.$plugin_id' title='".EPL_ADLAN_1."'> ".EPL_ADLAN_1."</a>" : "<a href='".e_SELF."?install.$plugin_id' title='".EPL_ADLAN_0."'>".EPL_ADLAN_0."</a>")." ]";
-        }else{
-                if($eplug_menu_name){
-                        $text .= EPL_NOINSTALL.str_replace("..", "", e_PLUGIN.$plugin_path)."/ ".EPL_DIRECTORY;
-                }else{
-                        $text .= EPL_NOINSTALL_1.str_replace("..", "", e_PLUGIN.$plugin_path)."/ ".EPL_DIRECTORY;
-                }
-        }
-        if($plugin_version != $eplug_version && $plugin_installflag){
-                $text .= " [ <a href='".e_SELF."?upgrade.$plugin_id' title='".EPL_UPGRADE." to v".$eplug_version."'>".EPL_UPGRADE."</a> ]";
-        }
-        $text .= "</td>
-        </tr>";
-}
-
-$text .= "</table>
-<div><br />
-<img src='".e_IMAGE."generic/uninstalled.png' alt='' /> ".EPL_ADLAN_23."&nbsp;&nbsp;
-<img src='".e_IMAGE."generic/installed.png' alt='' /> ".EPL_ADLAN_22."&nbsp;&nbsp;
-<img src='".e_IMAGE."generic/upgrade.png' alt='' /> ".EPL_ADLAN_24."&nbsp;&nbsp;
-<img src='".e_IMAGE."generic/noinstall.png' alt='' /> ".EPL_ADLAN_25."</div></form></div>";
-
-$ns -> tablerender(Plugins, $text);
-// ----------------------------------------------------------
-
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/plugin.php,v $
+|     $Revision: 1.59 $
+|     $Date: 2006/03/16 15:58:14 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../class2.php");
+if (!getperms("Z")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'plug_manage';
+require_once("auth.php");
+require_once(e_HANDLER.'plugin_class.php');
+require_once(e_HANDLER.'file_class.php');
+$plugin = new e107plugin;
+
+$tmp = explode('.', e_QUERY);
+$action = $tmp[0];
+$id = intval($tmp[1]);
+
+if (isset($_POST['upload'])) {
+	if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
+		exit;
+	}
+
+	extract($_FILES);
+	/* check if e_PLUGIN dir is writable ... */
+	if(!is_writable(e_PLUGIN)) {
+		/* still not writable - spawn error message */
+		$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_39);
+	} else {
+		/* e_PLUGIN is writable - continue */
+		$pref['upload_storagetype'] = "1";
+		require_once(e_HANDLER."upload_handler.php");
+		$fileName = $file_userfile['name'][0];
+		$fileSize = $file_userfile['size'][0];
+		$fileType = $file_userfile['type'][0];
+
+		if(strstr($file_userfile['type'][0], "gzip")) {
+			$fileType = "tar";
+		} else if (strstr($file_userfile['type'][0], "zip")) {
+			$fileType = "zip";
+		} else {
+			/* not zip or tar - spawn error message */
+			$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_41);
+			require_once("footer.php");
+			exit;
+		}
+
+		if ($fileSize) {
+
+			$opref = $pref['upload_storagetype'];
+			$pref['upload_storagetype'] = 1;		/* temporarily set upload type pref to flatfile */
+			$uploaded = file_upload(e_PLUGIN);
+			$pref['upload_storagetype'] = $opref;
+
+			$archiveName = $uploaded[0]['name'];
+
+			/* attempt to unarchive ... */
+
+			if($fileType == "zip") {
+				require_once(e_HANDLER."pclzip.lib.php");
+				$archive = new PclZip(e_PLUGIN.$archiveName);
+				$unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_PLUGIN, PCLZIP_OPT_SET_CHMOD, 0666));
+			} else {
+				require_once(e_HANDLER."pcltar.lib.php");
+				$unarc = ($fileList = PclTarExtract($archiveName, e_PLUGIN));
+			}
+
+			if(!$unarc) {
+				/* unarc failed ... */
+				if($fileType == "zip") {
+					$error = "PCLZIP extract error: '".$archive -> errorName(TRUE)."'";
+				} else {
+					$error = "PCLTAR extract error: ".PclErrorString().", code: ".intval(PclErrorCode());
+				}
+				$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_42." ".$archiveName." ".$error);
+				require_once("footer.php");
+				exit;
+			}
+
+			/* ok it looks like the unarc succeeded - continue */
+
+			/* get folder name ... */
+			$folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/")));
+
+			if(file_exists(e_PLUGIN.$folderName."/plugin.php")) {
+				/* upload is a plugin */
+				$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_43);
+			} else {
+				/* upload is a menu */
+				$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_45);
+			}
+
+			/* attempt to delete uploaded archive */
+			@unlink(e_PLUGIN.$archiveName);
+		}
+	}
+}
+
+
+if ($action == 'uninstall')
+{
+	if(!isset($_POST['uninstall_confirm']))
+	{
+		show_uninstall_confirm();
+		exit;
+	}
+
+	$id = intval($id);
+	$plug = $plugin->getinfo($id);
+	//Uninstall Plugin
+	if ($plug['plugin_installflag'] == TRUE ) {
+		include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
+
+		$func = $eplug_folder.'_uninstall';
+		if (function_exists($func)) {
+			$text .= call_user_func($func);
+		}
+
+		if(is_array($eplug_rss)) {
+			foreach($eplug_rss as $key=>$values) {
+				$text .= ($sql -> db_Update("plugin", "plugin_rss = '' WHERE plugin_id='{$id}'")) ? EPL_ADLAN_47 .". ($key)<br />" : EPL_ADLAN_49 .". ($key)<br />";
+			}
+		}
+		
+		if($_POST['delete_tables'])
+		{
+			if (is_array($eplug_table_names))
+			{
+				$result = $plugin->manage_tables('remove', $eplug_table_names);
+				if ($result !== TRUE)
+				{
+					$text .= EPL_ADLAN_27.' <b>'.$mySQLprefix.$result.'</b> - '.EPL_ADLAN_30.'<br />';
+				}
+				else
+				{
+					$text .= EPL_ADLAN_28."<br />";
+				}
+			}
+		}
+		else
+		{
+			$text .= "Tables not deleted during uninstall process by request<br />";
+		}
+
+		if (is_array($eplug_prefs)) {
+			$plugin->manage_prefs('remove', $eplug_prefs);
+			$text .= EPL_ADLAN_29."<br />";
+		}
+
+		if (is_array($eplug_comment_ids)) {
+			$text .= ($plugin->manage_comments('remove', $eplug_comment_ids)) ? EPL_ADLAN_50."<br />" : "";
+		}
+
+
+		if ($eplug_module) {
+			$plugin->manage_plugin_prefs('remove', 'modules', $eplug_folder);
+		}
+
+		if ($eplug_status) {
+			$plugin->manage_plugin_prefs('remove', 'plug_status', $eplug_folder);
+		}
+
+		if ($eplug_latest) {
+			$plugin->manage_plugin_prefs('remove', 'plug_latest', $eplug_folder);
+		}
+
+		if (is_array($eplug_array_pref))
+		{
+			foreach($eplug_array_pref as $key => $val)
+			{
+				$plugin->manage_plugin_prefs('remove', $key, $val);
+			}
+		}
+
+		if (is_array($eplug_sc))
+		{
+			$plugin->manage_plugin_prefs('remove', 'plug_sc', $eplug_folder, $eplug_sc);
+		}
+
+		if (is_array($eplug_bb))
+		{
+			$plugin->manage_plugin_prefs('remove', 'plug_bb', $eplug_folder, $eplug_bb);
+		}
+
+		if (is_array($eplug_user_prefs)) {
+			$sql = new db;
+			$sql->db_Select("core", " e107_value", " e107_name='user_entended'");
+			$row = $sql->db_Fetch();
+			$user_entended = unserialize($row[0]);
+			$user_entended = array_values(array_diff($user_entended, array_keys($eplug_user_prefs)));
+			if ($user_entended == NULL) {
+				$sql->db_Delete("core", "e107_name='user_entended'");
+			} else {
+				$tmp = addslashes(serialize($user_entended));
+				$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
+			}
+			while (list($key, $e_user_pref) = each($eplug_user_prefs)) {
+				unset($user_pref[$key]);
+			}
+			save_prefs("user");
+		}
+
+		if ($eplug_menu_name) {
+			$sql->db_Delete('menus', "menu_name='$eplug_menu_name' ");
+		}
+
+		if ($eplug_link) {
+			$plugin->manage_link('remove', '', $eplug_link_name);
+		}
+
+		if ($eplug_userclass) {
+			$plugin->manage_userclass('remove', $eplug_userclass);
+		}
+
+		$plugin -> manage_search('remove', $eplug_folder);
+
+		$plugin -> manage_notify('remove', $eplug_folder);
+
+		$sql->db_Update('plugin', "plugin_installflag=0, plugin_version='{$eplug_version}' WHERE plugin_id='{$id}' ");
+		
+		if($_POST['delete_files'])
+		{
+			include_once(e_HANDLER."file_class.php");
+			$fi = new e_file;
+			$result = $fi->rmtree(e_PLUGIN.$eplug_folder);
+			$text .= ($result ? "<br />All files removed from ".e_PLUGIN.$eplug_folder : '<br />File deletion failed<br />'.EPL_ADLAN_31.' <b>'.e_PLUGIN.$eplug_folder.'</b> '.EPL_ADLAN_32);
+		}
+		else
+		{
+			$text .= '<br />'.EPL_ADLAN_31.' <b>'.e_PLUGIN.$eplug_folder.'</b> '.EPL_ADLAN_32;
+		}
+		$ns->tablerender(EPL_ADLAN_1.' '.$eplug_name, $text);
+		$text = "";
+	}
+}
+
+if ($action == 'install') {
+	$plugin->install_plugin(intval($id));
+}
+
+if ($action == 'upgrade') {
+	$plug = $plugin->getinfo($id);
+	include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
+
+	$func = $eplug_folder.'_upgrade';
+	if (function_exists($func)) {
+		$text .= call_user_func($func);
+	}
+
+	if (is_array($upgrade_alter_tables)) {
+		$result = $plugin->manage_tables('upgrade', $upgrade_alter_tables);
+		if (!$result) {
+			$text .= EPL_ADLAN_9.'<br />';
+		} else {
+			$text .= EPL_ADLAN_7."<br />";
+		}
+	}
+
+	if ($eplug_module) {
+		$plugin->manage_plugin_prefs('add', 'modules', $eplug_folder);
+	} else {
+		$plugin->manage_plugin_prefs('remove', 'modules', $eplug_folder);
+	}
+
+	if ($eplug_status) {
+		$plugin->manage_plugin_prefs('add', 'plug_status', $eplug_folder);
+	} else {
+		$plugin->manage_plugin_prefs('remove', 'plug_status', $eplug_folder);
+	}
+
+	if ($eplug_latest) {
+		$plugin->manage_plugin_prefs('add', 'plug_latest', $eplug_folder);
+	} else {
+		$plugin->manage_plugin_prefs('remove', 'plug_latest', $eplug_folder);
+	}
+
+	if (is_array($upgrade_add_eplug_sc))
+	{
+		$plugin->manage_plugin_prefs('add', 'plug_sc', $eplug_folder, $eplug_sc);
+	}
+
+	if (is_array($upgrade_remove_eplug_sc))
+	{
+		$plugin->manage_plugin_prefs('remove', 'plug_sc', $eplug_folder, $eplug_sc);
+	}
+
+	if (is_array($upgrade_add_eplug_bb))
+	{
+		$plugin->manage_plugin_prefs('add', 'plug_bb', $eplug_folder, $eplug_bb);
+	}
+
+	if (is_array($upgrade_remove_eplug_bb))
+	{
+		$plugin->manage_plugin_prefs('remove', 'plug_bb', $eplug_folder, $eplug_bb);
+	}
+
+	if (is_array($upgrade_add_prefs)) {
+		$plugin->manage_prefs('add', $upgrade_add_prefs);
+		$text .= EPL_ADLAN_8.'<br />';
+	}
+
+	if (is_array($upgrade_remove_prefs)) {
+		$plugin->manage_prefs('remove', $upgrade_remove_prefs);
+	}
+
+	if (is_array($upgrade_add_user_prefs)) {
+		$sql = new db;
+		$sql->db_Select("core", " e107_value", " e107_name='user_entended'");
+		$row = $sql->db_Fetch();
+		$user_entended = unserialize($row[0]);
+		while (list($key, $e_user_pref) = each($eplug_user_prefs)) {
+			$user_entended[] = $e_user_pref;
+		}
+		$tmp = addslashes(serialize($user_entended));
+		if ($sql->db_Select("core", " e107_value", " e107_name='user_entended'")) {
+			$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
+		} else {
+			$sql->db_Insert("core", "'user_entended', '$tmp' ");
+		}
+		$text .= EPL_ADLAN_8."<br />";
+	}
+
+	if (is_array($upgrade_remove_user_prefs)) {
+		$sql = new db;
+		$sql->db_Select("core", " e107_value", " e107_name='user_entended'");
+		$row = $sql->db_Fetch();
+		$user_entended = unserialize($row[0]);
+		$user_entended = array_values(array_diff($user_entended, $eplug_user_prefs));
+		if ($user_entended == NULL) {
+			$sql->db_Delete("core", "e107_name='user_entended'");
+		} else {
+			$tmp = addslashes(serialize($user_entended));
+			$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
+		}
+	}
+
+	$plugin -> manage_search('upgrade', $eplug_folder);
+
+	$plugin -> manage_notify('upgrade', $eplug_folder);
+
+	$text .= '<br />'.$eplug_upgrade_done;
+	$sql->db_Update('plugin', "plugin_version ='{$eplug_version}' WHERE plugin_id='$id' ");
+	$ns->tablerender(EPL_ADLAN_34, $text);
+}
+
+
+// Check for new plugins, create entry in plugin table ...
+
+$plugin->update_plugins_table();
+
+// ----------------------------------------------------------
+//        render plugin information ...
+
+/* plugin upload form */
+
+if(!is_writable(e_PLUGIN)) {
+	$ns->tablerender(EPL_ADLAN_40, EPL_ADLAN_44);
+} else {
+	$text = "<div style='text-align:center'>
+	<form enctype='multipart/form-data' method='post' action='".e_SELF."'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+	<td class='forumheader3' style='width: 50%;'>".EPL_ADLAN_37."</td>
+	<td class='forumheader3' style='width: 50%;'>
+	<input type='hidden' name='MAX_FILE_SIZE' value='1000000' />
+	<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
+	<input class='tbox' type='file' name='file_userfile[]' size='50' />
+	</td>
+	</tr>
+	<tr>
+	<td colspan='2' style='text-align:center' class='forumheader'>
+	<input class='button' type='submit' name='upload' value='".EPL_ADLAN_38."' />
+	</td>
+	</tr>
+	</table>
+	</form>
+	<br />\n";
+}
+// Uninstall and Install sorting should be fixed once and for all now !
+$installed = $plugin->getall(1);
+$uninstalled = $plugin->getall(0);
+
+$text .= "<table style='".ADMIN_WIDTH."' class='fborder'>";
+$text .= "<tr><td class='fcaption' colspan='3'>".EPL_ADLAN_22."</td></tr>";
+$text .= render_plugs($installed);
+$text .= "<tr><td class='fcaption' colspan='3'>".EPL_ADLAN_23."</td></tr>";
+$text .= render_plugs($uninstalled);
+
+
+function render_plugs($pluginList){
+	global $tp;
+
+	foreach($pluginList as $plug) {
+	//Unset any possible eplug_ variables set by last plugin.php
+		$defined_vars = array_keys(get_defined_vars());
+		foreach($defined_vars as $varname) {
+			if (substr($varname, 0, 6) == 'eplug_' || substr($varname, 0, 8) == 'upgrade_') {
+				unset($$varname);
+			}
+		}
+
+		include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
+
+ 		if ($eplug_conffile || is_array($eplug_table_names) || is_array($eplug_prefs) || is_array($eplug_user_prefs) || is_array($eplug_sc) || is_array($eplug_bb) || $eplug_module || $eplug_userclass || $eplug_status || $eplug_latest) {
+			$img = (!$plug['plugin_installflag'] ? "<img src='".e_IMAGE."admin_images/uninstalled.png' alt='' />" : "<img src='".e_IMAGE."admin_images/installed.png' alt='' />");
+		} else {
+			$img = "<img src='".e_IMAGE."admin_images/noinstall.png' alt='' />";
+		}
+
+		if ($plug['plugin_version'] != $eplug_version && $plug['plugin_installflag']) {
+			$img = "<img src='".e_IMAGE."admin_images/upgrade.png' alt='' />";
+		}
+
+		$plugin_icon = $eplug_icon ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px;vertical-align: bottom; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
+		if ($eplug_conffile && $plug['plugin_installflag'] == TRUE) {
+			$conf_title = EPL_CONFIGURE.' '.$eplug_name;
+			$plugin_icon = "<a title='{$conf_title}' href='".e_PLUGIN.$eplug_folder.'/'.$eplug_conffile."' >".$plugin_icon.'</a>';
+		}
+
+		$text .= "
+		<tr>
+		<td class='forumheader3' style='width:160px; text-align:center; vertical-align:top'>
+		<table style='width:100%'><tr><td style='text-align:left;width:40px;vertical-align:top'>
+		".$plugin_icon."
+		</td><td>
+		$img <b>{$plug['plugin_name']}</b><br />".EPL_ADLAN_11." {$plug['plugin_version']}
+		<br />";
+
+		$text .="</td>
+		</tr></table>
+		</td>
+		<td class='forumheader3' style='vertical-align:top'>
+		<table cellspacing='3' style='width:98%'>
+		<tr><td style='vertical-align:top;width:15%'><b>".EPL_ADLAN_12."</b>:</td><td style='vertical-align:top'><a href='mailto:$eplug_email' title='$eplug_email'>$eplug_author</a>&nbsp;";
+        if($eplug_url){
+        	$text .= "&nbsp;&nbsp;[ <a href='$eplug_url' title='$eplug_url' >".EPL_WEBSITE."</a> ] ";
+		}
+		$text .="</td></tr>
+		<tr><td style='vertical-align:top'><b>".EPL_ADLAN_14."</b>:</td><td style='vertical-align:top'> $eplug_description&nbsp;";
+        if ($eplug_readme) {
+			$text .= "[ <a href='".e_PLUGIN.$eplug_folder."/".$eplug_readme."'>".$eplug_readme."</a> ]";
+		}
+
+		$text .="</td></tr>
+		<tr><td style='vertical-align:top'><b>".EPL_ADLAN_13."</b>:</td><td style='vertical-align:top'><span style='vertical-align:top'> $eplug_compatible&nbsp;</span>";
+    	if ($eplug_compliant) {
+			$text .= "&nbsp;&nbsp;<img src='".e_IMAGE."generic/valid-xhtml11_small.png' alt='' style='margin-top:0px' />";
+		}
+		$text .="</td></tr>\n";
+
+
+		$text .= "</table></td>";
+		$text .= "<td class='forumheader3' style='width:70px;text-align:center'>";
+    	if ($eplug_conffile || $eplug_module || is_array($eplug_table_names) || is_array($eplug_prefs) || is_array($eplug_user_prefs) || is_array($eplug_sc) || is_array($eplug_bb) || $eplug_status || $eplug_latest) {
+			$text .= ($plug['plugin_installflag'] ? "<input type='button' class='button' onclick=\"location.href='".e_SELF."?uninstall.{$plug['plugin_id']}'\" title='".EPL_ADLAN_1."' value='".EPL_ADLAN_1."' /> " : "<input type='button' class='button' onclick=\"location.href='".e_SELF."?install.{$plug['plugin_id']}'\" title='".EPL_ADLAN_0."' value='".EPL_ADLAN_0."' />");
+		} else {
+	   		if ($eplug_menu_name) {
+				$text .= EPL_NOINSTALL.str_replace("..", "", e_PLUGIN.$plug['plugin_path'])."/ ".EPL_DIRECTORY;
+			} else {
+				$text .= EPL_NOINSTALL_1.str_replace("..", "", e_PLUGIN.$plug['plugin_path'])."/ ".EPL_DIRECTORY;
+				if($plug['plugin_installflag'] == FALSE){
+					global $sql;
+					$sql->db_Delete('plugin', "plugin_installflag=0 AND (plugin_path='{$plug['plugin_path']}' OR plugin_path='{$plug['plugin_path']}/' )  ");
+				}
+			}
+		}
+
+		if ($plug['plugin_version'] != $eplug_version && $plug['plugin_installflag']) {
+			$text .= "<br /><input type='button' class='button' onclick=\"location.href='".e_SELF."?upgrade.{$plug['plugin_id']}'\" title='".EPL_UPGRADE." to v".$eplug_version."' value='".EPL_UPGRADE."' />";
+		}
+
+		$text .="</td>";
+		$text .= "</tr>";
+	}
+
+
+return $text;
+}
+
+$text .= "</table>
+	<div style='text-align:center'><br />
+	<img src='".e_IMAGE."admin_images/uninstalled.png' alt='' /> ".EPL_ADLAN_23."&nbsp;&nbsp;
+	<img src='".e_IMAGE."admin_images/installed.png' alt='' /> ".EPL_ADLAN_22."&nbsp;&nbsp;
+	<img src='".e_IMAGE."admin_images/upgrade.png' alt='' /> ".EPL_ADLAN_24."&nbsp;&nbsp;
+	<img src='".e_IMAGE."admin_images/noinstall.png' alt='' /> ".EPL_ADLAN_25."</div></div>";
+
+$ns->tablerender(EPL_ADLAN_16, $text);
+// ----------------------------------------------------------
+
+require_once("footer.php");
+exit;
+
+
+function show_uninstall_confirm()
+{
+	global $plugin, $tp, $id, $ns;
+	$id = intval($id);
+	$plug = $plugin->getinfo($id);
+	
+	if ($plug['plugin_installflag'] == TRUE )
+	{
+		include(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
+	}
+
+	if(is_writable(e_PLUGIN.$plug['plugin_path']))
+	{
+		$del_text = "
+		<select class='tbox' name='delete_files'>
+		<option value='0'>".EPL_ADLAN_51."</option>
+		<option value='1'>".EPL_ADLAN_52."</option>
+		</select>
+		";
+	}
+	else
+	{
+		$del_text = "
+		".EPL_ADLAN_53."
+		<input type='hidden' name='delete_files' value='0' />
+		";
+	}
+	
+	$text = "
+	<form action='".e_SELF."?".e_QUERY."' method='post'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+		<td colspan='2' class='forumheader'>".EPL_ADLAN_54." $eplug_name </td>
+	</tr>
+	<tr>
+		<td class='forumheader3'>".EPL_ADLAN_55."</td>
+		<td class='forumheader3'>".EPL_ADLAN_52."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>
+			".EPL_ADLAN_57."<div class='smalltext'>".EPL_ADLAN_58."</div>
+		</td>
+		<td class='forumheader3'>
+			<select class='tbox' name='delete_tables'>
+			<option value='1'>".EPL_ADLAN_52."</option>
+			<option value='0'>".EPL_ADLAN_51."</option>
+			</select>
+		</td>
+	</tr>
+	<tr>
+		<td class='forumheader3'>".EPL_ADLAN_59."<div class='smalltext'>".EPL_ADLAN_60."</div></td>
+		<td class='forumheader3'>{$del_text}</td>
+	</tr>
+	<tr>
+		<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='uninstall_confirm' value='".EPL_ADLAN_61."' />&nbsp;&nbsp;<input class='button' type='submit' name='uninstall_cancel' value='".EPL_ADLAN_62."' onclick=\"location.href='".e_SELF."'; return false;\"/></td>
+	</tr>
+	</table>
+	</form>
+	";
+	$ns->tablerender(EPL_ADLAN_63." {$eplug_name}", $text);
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/poll.php 75/e107_admin/poll.php
--- 6171/e107_admin/poll.php	2004-09-01 08:50:52.000000000 -0500
+++ 75/e107_admin/poll.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,203 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/poll_conf.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("U")){ header("location:".e_BASE."index.php"); exit;}
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-require_once(e_HANDLER."poll_class.php");
-require_once(e_HANDLER."form_handler.php");
-$rs = new form;
-$poll = new poll; $aj = new textparse;
-
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        unset($tmp);
-}
-
-if(IsSet($_POST['addoption']) && $_POST['option_count'] < 10){
-        $_POST['option_count']++;
-        $_POST['poll_title'] = $aj -> formtpa($_POST['poll_title'], "admin");
-        $c=0;
-        while(list($key, $option) = each($_POST['poll_option'])){
-                $_POST['poll_option'][$c] = $aj -> formtpa($option, "admin");
-                $c++;
-        }
-}
-
-if(IsSet($_POST['reset'])){
-        unset($poll_id, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate']);
-}
-
-if($action == "delete" && $_POST['del_poll_confirm']==1){
-        $message = $poll -> delete_poll($sub_action);
-        unset($poll_id, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate']);
-}
-
-if(IsSet($_POST['submit'])){
-        $message = $poll -> submit_poll($sub_action, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']);
-        unset($_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']);
-}
-
-if($action == "edit" && !$_POST['preview']  && !$_POST['addoption'] && !$_POST['submit']){
-        
-        if($sql -> db_Select("poll", "*", "poll_id=$sub_action")){
-                $row = $sql-> db_Fetch(); extract($row);
-                for($a=1; $a<=10; $a++){
-                        $var = "poll_option_".$a;
-                        if($$var){
-                                $_POST['poll_option'][($a-1)] = $$var;
-                        }
-                }
-                $_POST['activate'] = $poll_active;
-                $_POST['option_count'] = count($_POST['poll_option']);
-                $_POST['poll_title'] = $poll_title;
-				$_POST['poll_comment'] = $poll_comment;
-        }
-}
-
-if(IsSet($_POST['preview'])){
-
-        $_POST['poll_title'] = $aj -> formtpa($_POST['poll_title'], "admin");
-        $c=0;
-        while(list($key, $option) = each($_POST['poll_option'])){
-                $_POST['poll_option'][$c] = $aj -> formtpa($option, "admin");
-                $c++;
-        }
-
-
-        $text = $poll -> render_poll($_POST['existing'], $_POST['poll_title'], $_POST['poll_option'], array($votes), "preview");
-        $ns -> tablerender(POLLAN_23, $text);
-        $count=0;
-        while($_POST['poll_option'][$count]){
-                $_POST['poll_option'][$count] = stripslashes($_POST['poll_option'][$count]);
-                $count++;
-        }
-        $_POST['poll_title'] = stripslashes($_POST['poll_title']);
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$text = "<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 200px; overflow : auto; '>
-<form action=\"".e_SELF."\" method=\"post\" id=\"del_poll\" >
-<input type=\"hidden\" name=\"del_poll_confirm\" id=\"del_poll_confirm\" value=\"1\" />";
-if($poll_total = $sql -> db_Select("poll")){
-        $text .= "<table class='fborder' style='width:100%'>
-        <tr>
-        <td style='width:5%' class='forumheader2'>ID</td>
-        <td style='width:75%' class='forumheader2'>".POLLAN_7."</td>
-        <td style='width:20%' class='forumheader2'>".POLLAN_20."</td>
-        </tr>";
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                $text .= "<tr>
-                <td style='width:5%' class='forumheader3'>$poll_id</td>
-                <td style='width:75%' class='forumheader3'>$poll_title</td>
-                <td style='width:20%; text-align:center' class='forumheader3'>".
-                $rs -> form_button("button", "main_edit_{$poll_id}", POLLAN_4, "onclick=\"document.location='".e_SELF."?edit.$poll_id'\"").
-                $rs -> form_button("submit", "main_delete_{$poll_id}", POLLAN_5, "onclick=\"confirm_($poll_id)\"")."
-                </td>
-                </tr>";
-        }
-        $text .= "</table>";
-}else{
-        $text .= "<div style='text-align:center'>".POLLAN_22."</div>";
-}
-$text .= "</form></div></div>";
-$ns -> tablerender(POLLAN_3, $text);
-
-$poll_total = $sql -> db_Select("poll");
-
-$act_add = (e_QUERY && !strpos(e_QUERY,"elete")) ? "?".e_QUERY : "";
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF.$act_add."'>
-<table style='width:85%' class='fborder'>
-<tr>
-<td style='width:30%' class='forumheader3'><div class='normaltext'>".POLLAN_7.":</div></td>
-<td style='width:70%'class='forumheader3'>
-<input class='tbox' type='text' name='poll_title' size='70' value='".$_POST['poll_title']."' maxlength='200' />";
-
-$option_count = ($_POST['option_count'] ? $_POST['option_count'] : 1);
-$text .= "<input type='hidden' name='option_count' value='$option_count' /></td></tr>";
-
-for($count=1; $count<=$option_count; $count++){
-        $text .= "<tr>
-<td style='width:30%' class='forumheader3'>".POLLAN_8." ".$count.":</td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='poll_option[]' size='40' value=\"".$_POST['poll_option'][($count-1)]."\" maxlength='200' />";
-if($option_count == $count){
-        $text .= " <input class='button' type='submit' name='addoption' value='".POLLAN_9."' /> ";
-}
-$text .= "</td></tr>";
-}
-
-$text .= "<tr>
-<td style='width:30%' class='forumheader3'>".POLLAN_10."?:</td>
-<td class='forumheader3'>";
-$text .= (!$_POST['activate'] ? "<input name='activate' type='radio' value='0' checked='checked' />".POLLAN_11."<br />" : "<input name='activate' type='radio' value='0' />".POLLAN_11."<br />");
-$text .= ($_POST['activate'] == 1 ? "<input name='activate' type='radio' value='1' checked='checked' />".POLLAN_12."<br />" : "<input name='activate' type='radio' value='1' />".POLLAN_12."<br />");
-$text .= ($_POST['activate'] == 2 ? "<input name='activate' type='radio' value='2' checked='checked' />".POLLAN_13."<br />" : "<input name='activate' type='radio' value='2' />".POLLAN_13."<br />");
-
-$text .= "</td>
-</tr>
-<tr>
-<td class='forumheader3'>".POLLAN_24.": </td><td class='forumheader3'>".
-
- ($_POST['poll_comment'] ? "<input name='poll_comment' type='radio' value='1' checked='checked' />".POLLAN_25."&nbsp;&nbsp;<input name='poll_comment' type='radio' value='0' />".POLLAN_26 : "<input name='poll_comment' type='radio' value='1' />".POLLAN_25."&nbsp;&nbsp;<input name='poll_comment' type='radio' value='0' checked='checked' />".POLLAN_26)."
-        </td>
-        </tr>
-<tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center' class='forumheader'>";
-
-if(IsSet($_POST['preview'])){
-        $text .= "<input class='button' type='submit' name='preview' value='".POLLAN_14."' /> ";
-        if($action == "edit"){
-                $text .= "<input class='button' type='submit' name='submit' value='".POLLAN_15."' /> ";
-        }else{
-                $text .= "<input class='button' type='submit' name='submit' value='".POLLAN_16."' /> ";
-        }
-}else{
-        $text .= "<input class='button' type='submit' name='preview' value='".POLLAN_17."' /> ";
-}
-if(IsSet($poll_id)){
-        $text .= "<input class='button' type='submit' name='reset' value='".POLLAN_18."' /> ";
-}
-
-$text .= "</td></tr></table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".POLLAN_19."</div>", $text);
-require_once("footer.php");
-function headerjs(){
-global $etp;
-$headerjs = "<script type=\"text/javascript\">
-function confirm_(poll_id){
-        var x=confirm(\"".$etp->unentity(POLLAN_21)." [ID: \" + poll_id + \"]\");
-        if(x){
-                document.getElementById('del_poll').action='".e_SELF."?delete.' + poll_id;
-                document.getElementById('del_poll').submit();
-        }
-}
-</script>";
-return $headerjs;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_admin/prefs.php 75/e107_admin/prefs.php
--- 6171/e107_admin/prefs.php	2004-09-06 04:54:56.000000000 -0500
+++ 75/e107_admin/prefs.php	2006-05-01 18:58:46.000000000 -0500
@@ -1,800 +1,948 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        //prefs.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-
-if(IsSet($_POST['newver'])){
-        header("location:http://e107.org/index.php");
-        exit;
-}
-
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit;}
-if(!$pref['timezone']){ $pref['timezone'] = "GMT"; }
-
-$signup_title = array(CUSTSIG_2,CUSTSIG_3,"ICQ","Aim","MSN",CUSTSIG_4,CUSTSIG_5,CUSTSIG_6,CUSTSIG_7,CUSTSIG_8);
-$signup_name = array("real","url","icq","aim","msn","dob","loc","sig","avt","zone");
-
-$aj = new textparse;
-if(IsSet($_POST['updateprefs'])){
-        $pref['sitename'] = $aj -> formtpa($_POST['sitename']);
-        $pref['siteurl'] = $aj -> formtpa($_POST['siteurl']);
-        $pref['sitebutton'] = $aj -> formtpa($_POST['sitebutton']);
-        $pref['sitetag'] = $aj -> formtpa($_POST['sitetag']);
-        $pref['sitedescription'] = $aj -> formtpa($_POST['sitedescription']);
-        $pref['siteadmin'] = $aj -> formtpa($_POST['siteadmin']);
-        $pref['siteadminemail'] = $aj -> formtpa($_POST['siteadminemail']);
-        $pref['sitetheme'] = ($_POST['sitetheme'] && $_POST['sitetheme'] != "/" ? $_POST['sitetheme'] : "leap of faith");
-        $pref['admintheme'] = ($_POST['admintheme'] && $_POST['admintheme'] != "/" ? $_POST['admintheme'] : "leap of faith");
-        $pref['sitedisclaimer'] = $aj -> formtpa($_POST['sitedisclaimer']);
-
-        $pref['anon_post'] = $_POST['anon_post'];
-        $pref['user_reg'] = $_POST['user_reg'];
-        $pref['profanity_filter'] = $_POST['profanity_filter'];
-        $pref['profanity_replace'] = $aj -> formtpa($_POST['profanity_replace']);
-        $pref['profanity_words'] = $aj -> formtpa($_POST['profanity_words']);
-        $pref['use_coppa'] = $_POST['use_coppa'];
-        $pref['shortdate'] = $aj -> formtpa($_POST['shortdate']);
-        $pref['longdate'] = $aj -> formtpa($_POST['longdate']);
-        $pref['forumdate'] = $aj -> formtpa($_POST['forumdate']);
-        $pref['sitelanguage'] = $_POST['sitelanguage'];
-        $pref['time_offset'] = $_POST['time_offset'];
-        $pref['user_reg_veri'] = $_POST['user_reg_veri'];
-        $pref['user_reg_secureveri'] = $_POST['user_reg_secureveri'];
-        $pref['user_tracking'] = $_POST['user_tracking'];
-        $pref['cookie_name'] = ereg_replace("[^[:alpha:]]", "", $_POST['cookie_name']);
-        $pref['auth_method'] = $_POST['auth_method'];
-        $pref['displaythemeinfo'] = $_POST['displaythemeinfo'];
-        $pref['displayrendertime'] = $_POST['displayrendertime'];
-        $pref['displaysql'] = $_POST['displaysql'];
-        $pref['timezone'] = $_POST['timezone'];
-        $pref['adminstyle'] = $_POST['adminstyle'];
-        $pref['membersonly_enabled'] = $_POST['membersonly_enabled'];
-        $pref['ssl_enabled'] = $_POST['ssl_enabled'];
-        $pref['search_restrict'] = $_POST['search_restrict'];
-        $pref['nested_comments'] = $_POST['nested_comments'];
-        $pref['antiflood1'] = $_POST['antiflood1'];
-        $pref['antiflood_timeout'] = $_POST['antiflood_timeout'];
-        $pref['autoban'] = $_POST['autoban'];
-
-        // Signup. ====================================================
-
-        $pref['signup_pass_len'] = $_POST['signup_pass_len'];
-
-
-        // Create prefs to custom fields.
-        if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-        $row = $sql -> db_Fetch();
-        $user_entended = unserialize($row[0]);
-        $c=0;
-        $user_pref = unserialize($user_prefs);
-            while(list($key, $u_entended) = each($user_entended)){
-                    if($u_entended){
-                    $signup_ext =  "signup_ext".$key;
-                    $pref[$signup_ext] = $_POST[$signup_ext];
-                    $signup_ext_req =  "signup_ext_req".$key;
-                    $pref[$signup_ext_req] = $_POST[$signup_ext_req];
-                    }
-            }
-        }
-
-        $signup_options = "";
-                        for ($i=0; $i<count($signup_title); $i++) {
-                                $valuesignup =  $signup_name[$i];
-                                $signup_options .= $_POST[$valuesignup];
-                                $signup_options .= $i < (count($signup_title)-1)?".":"";
-                        }
-        $pref['signup_options'] = $signup_options;
-
-        // =========================
-
-        $pref['signcode'] = $_POST['signcode'];
-        $pref['logcode'] = $_POST['logcode'];
-
-        $pref['htmlarea'] = $_POST['htmlarea'];
-
-        $pref['smtp_enable'] = $_POST['smtp_enable'];
-        $pref['smtp_server'] = $aj -> formtpa($_POST['smtp_server']);
-        $pref['smtp_username'] = $aj -> formtpa($_POST['smtp_username']);
-        $pref['smtp_password'] = $aj -> formtpa($_POST['smtp_password']);
-
-        clear_cache();
-        save_prefs();
-        header("location:".e_ADMIN."prefs.php");
-       echo "<script type='text/javascript'>document.location.href='prefs.php'</script>\n";
-        exit;
-}
-
-$sql -> db_Select("plugin","*","plugin_installflag='1' ");
-while($row = $sql -> db_Fetch()){
-        extract($row);
-        if(preg_match("/^auth_(.*)/",$plugin_path,$match)){
-                $authlist[]=$match[1];
-        }
-}
-if($authlist){
-        $authlist[] = "e107";
-        $auth_dropdown = "\n<tr>
-        <td style='width:50%' class='forumheader3'>".PRFLAN_56.": </td>
-        <td style='width:50%; text-align:right;' class='forumheader3'>";
-        $auth_dropdown .= "<select class='tbox' name='auth_method'>\n";
-        foreach($authlist as $a){
-                $s = ($pref['auth_method'] == $a) ? " selected='selected'>" : "";
-                $auth_dropdown .= "<option {$s}>".$a."</option>\n";
-        }
-        $auth_dropdown .= "</select>\n";
-        $auth_dropdown .= "</td></tr>";
-} else {
-        $auth_dropdown="<input type='hidden' name='auth_method' value='' />";
-        $pref['auth_method']="";
-}
-
-
-//added prefs since v2.0 ...
-$anon_post = $pref['anon_post'];
-$user_reg = $pref['user_reg'];
-$profanity_filter = $pref['profanity_filter'];
-$profanity_replace = $pref['profanity_replace'];
-$profanity_words = $pref['profanity_words'];
-$search_restrict = $pref['search_restrict'];
-$use_coppa = $pref['use_coppa'];
-$shortdate = $pref['shortdate'];
-$longdate = $pref['longdate'];
-$forumdate = $pref['forumdate'];
-$sitelocale = $pref['sitelocale'];
-$time_offset = $pref['time_offset'];
-$user_reg_veri = $pref['user_reg_veri'];
-$user_reg_secureveri = $pref['user_reg_secureveri'];
-$user_tracking = $pref['user_tracking'];
-$antiflood1 = $pref['antiflood1'];
-$antiflood_timeout = $pref['antiflood_timeout'];
-$autoban = $pref['autoban'];
-
-require_once("auth.php");
-
-
-if(IsSet($_POST['testemail'])){
-        require_once(e_HANDLER."mail.php");
-        if(!sendemail(SITEADMINEMAIL, PRFLAN_66." ".SITENAME, PRFLAN_67)){
-                $message = ($pref['smtp_enable'] ? PRFLAN_75 : PRFLAN_68);
-        }else{
-                $message = PRFLAN_69;
-        }
-}
-
-
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$handle=opendir(e_THEME);
-while ($file = readdir($handle)){
-        if($file != "." && $file != ".." && $file != "templates" && $file != "/"){
-                if (is_readable(e_THEME.$file."/theme.php") && is_readable(e_THEME.$file."/style.css")){
-                        $dirlist[] = $file;
-                }
-        }
-}
-closedir($handle);
-
-$handle=opendir(e_LANGUAGEDIR);
-while ($file = readdir($handle)){
-        if($file != "." && $file != ".." && $file != "/"){
-                $lanlist[] = $file;
-        }
-}
-closedir($handle);
-
-$handle=opendir(e_ADMIN);
-while ($file = readdir($handle)){
-        if(strstr($file, "admin") && $file != "administrator.php" && $file != "updateadmin.php"){
-                $file = str_replace(".php", "", $file);
-                if($file == "admin"){ $file = "default"; }
-                $adminlist[] = $file;
-        }
-}
-closedir($handle);
-// new
-/*
-$text .= "<div style='text-align:center'><div style='text-align:center; width:97%'>";
-$text .="<input type='button' class='button' style='width:280px' value='".PRFLAN_1."' onclick=\"expandit('main')\"><br/>";
-$text .="<input type='button' class='button' style='width:280px' value='".PRFLAN_21."' onclick=\"expandit('date')\"><br/>";
-$text .="<input type='button' class='button' style='width:280px' value='".PRFLAN_77."' onclick=\"expandit('admindisp')\"><br/>";
-$text .="<input type='button' class='button' style='width:280px' value='".PRFLAN_28."' onclick=\"expandit('registration')\"><br/>";
-$text .="<input type='button' class='button' style='width:280px' value='".PRFLAN_47."' onclick=\"expandit('security')\"><br/>";
-$text .="<input type='button' class='button' style='width:280px' value='".PRFLAN_62."' onclick=\"expandit('mail')\"><br/>";
-$text .="</div>";
-*/
-// end new.
-
-$text = "<form method='post' action='prefs.php' >
-<div style='text-align:center;margin-left: auto;margin-right: auto'>
-<div style='text-align:center;width:95%;margin-left: auto;margin-right: auto'>
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_1."</div>
-
-<div id='main' style='display:none;text-align:center'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_2.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"sitename\" size=\"50\" value=\"".SITENAME."\" maxlength=\"100\" />
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_3.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='siteurl' size='50' value='".SITEURL."' maxlength='150' />
-</td>
-</tr>
-
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_4.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='sitebutton' size='50' value='".SITEBUTTON."' maxlength='150' />
-</td>
-</tr>
-<tr>
-
-<td style='width:50%' class='forumheader3'>".PRFLAN_5.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<textarea class='tbox' name='sitetag' cols='59' rows='3'>".SITETAG."</textarea>
-</td>
-</tr>
-<tr>
-
-<td style='width:50%' class='forumheader3'>".PRFLAN_6.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<textarea class='tbox' name='sitedescription' cols='59' rows='3'>".SITEDESCRIPTION."</textarea>
-</td>
-</tr>
-<tr>
-
-<td style='width:50%' class='forumheader3'>".PRFLAN_7.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='siteadmin' size='50' value='".SITEADMIN."' maxlength='100' />
-</td>
-</tr>
-<tr>
-
-<td style='width:50%' class='forumheader3'>".PRFLAN_8.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='siteadminemail' size='50' value='".SITEADMINEMAIL."' maxlength='100' />
-</td>
-</tr>
-<tr>
-
-<td style='width:50%' class='forumheader3'>".PRFLAN_9.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<textarea class='tbox' name='sitedisclaimer' cols='59' rows='3'>".SITEDISCLAIMER."</textarea>
-</td>
-</tr>
-
-</table></div>
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_10."</div>
-<div id='theme' style='display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr>
-
-<td style='width:50%' class='forumheader3'>".PRFLAN_11.":<br /><span class='smalltext'>".PRFLAN_85."</span></td>
-<td style='width:50%; text-align:right' class='forumheader3'><a href='".e_ADMIN."theme_prev.php'>".PRFLAN_12."</a>
-<select name='sitetheme' class='tbox'>\n";
-$counter = 0;
-while(IsSet($dirlist[$counter])){
-        $text .= ($dirlist[$counter] == $pref['sitetheme'] ? "<option selected='selected'>".$dirlist[$counter]."</option>\n" : "<option>".$dirlist[$counter]."</option>\n");
-        $counter++;
-}
-$text .= "</select>
-</td>
-</tr>
-
-
-</table></div>
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_13."</div>
-<div id='theme2' style='display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_14." </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['displaythemeinfo'] ? "<input type='checkbox' name='displaythemeinfo' value='1' checked='checked' />" : "<input type='checkbox' name='displaythemeinfo' value='1' />")."
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_15." </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['displayrendertime'] ? "<input type='checkbox' name='displayrendertime' value='1' checked='checked' />" : "<input type='checkbox' name='displayrendertime' value='1' />")."
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_16." </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['displaysql'] ? "<input type='checkbox' name='displaysql' value='1' checked='checked' />" : "<input type='checkbox' name='displaysql' value='1' />")."
-</td>
-</tr>
-
-</table></div>
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_17."</div>
-<div id='language' style='display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-
-<tr>
-
-<td style='width:50%' class='forumheader3'>".PRFLAN_18.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'><a href='".e_ADMIN."lancheck.php'>".PRFLAN_86."</a>
-
-
-<select name='sitelanguage' class='tbox'>\n";
-$counter = 0;
-$sellan = eregi_replace("lan_*.php", "", $pref['sitelanguage']);
-while(IsSet($lanlist[$counter])){
-        if($lanlist[$counter] == $sellan){
-                $text .= "<option selected='selected'>".$lanlist[$counter]."</option>\n";
-        }else{
-                $text .= "<option>".$lanlist[$counter]."</option>\n";
-        }
-        $counter++;
-}
-$text .= "</select>
-</td>
-</tr>";
-$text .="</table></div>";
-
-// Admin Display Areas. .
-
-$text .="
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_77."</div>
-<div id='admindisp' style='display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_54.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<select name='admintheme' class='tbox'>\n";
-$counter = 0;
-while(IsSet($dirlist[$counter])){
-        $text .= ($dirlist[$counter] == $pref['admintheme'] ? "<option selected='selected'>".$dirlist[$counter]."</option>\n" : "<option>".$dirlist[$counter]."</option>\n");
-        $counter++;
-}
-$text .= "</select>
-</td>
-</tr>
-
-
-
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_57.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<select name='adminstyle' class='tbox'>\n";
-$counter = 0;
-while(IsSet($adminlist[$counter])){
-        $text .= ($adminlist[$counter] == $pref['adminstyle'] ? "<option selected='selected'>".$adminlist[$counter]."</option>\n" : "<option>".$adminlist[$counter]."</option>\n");
-        $counter++;
-}
-$text .= "</select>
-</td>
-</tr>
-
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_79.":</td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['htmlarea'] ? "<input type='checkbox' name='htmlarea' value='1'  checked='checked' />" : "<input type='checkbox' name='htmlarea' value='1' />")."
-</td>
-</tr></table></div>";
-
-// Date options.
-$text .="
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_21."</div>
-<div id='date' style='text-align:center; display:none' >
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr>";
-
-$ga = new convert;
-$date1 = $ga -> convert_date(time(), "short");
-$date2 = $ga -> convert_date(time(), "long");
-$date3 = $ga -> convert_date(time(), "forum");
-
-
-$text .= "<td style='width:50%' class='forumheader3'>".PRFLAN_22.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='shortdate' size='40' value='$shortdate' maxlength='50' />
-<br />".PRFLAN_83.": $date1
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_23.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='longdate' size='40' value='$longdate' maxlength='50' />
-<br />".PRFLAN_83.": $date2
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_24.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='forumdate' size='40' value='$forumdate' maxlength='50' />
-<br />".PRFLAN_83.": $date3
-</td>
-</tr>
-
-<tr>
-<td colspan='2' style='text-align:center' class='forumheader3'>
-(".PRFLAN_25." <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>".PRFLAN_93."</a>)
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_26.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<select name='time_offset' class='tbox'>\n";
-$toffset = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13", "+14", "+15", "+16");
-$counter = 0;
-while(IsSet($toffset[$counter])){
-        if($toffset[$counter] == $pref['time_offset']){
-                $text .= "<option selected='selected'>".$toffset[$counter]."</option>\n";
-        }else{
-                $text .= "<option>".$toffset[$counter]."</option>\n";
-        }
-        $counter++;
-}
-$text .= "</select>
-</td></tr>
-
-<tr>
-<td colspan='2' style='text-align:center' class='forumheader3'>
-(".PRFLAN_27.")
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_56.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='timezone' size='20' value='".$pref['timezone']."' maxlength='50' />
-</td>
-</tr></table></div>";
-
-// =========== Registration Preferences. ==================
-
-$text .="
-
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_28."</div>
-<div id='registration' style='text-align:center; display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_29.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($user_reg ? "<input type='checkbox' name='user_reg' value='1'  checked='checked' />" : "<input type='checkbox' name='user_reg' value='1' />")."
- (".PRFLAN_30.")
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_31.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($user_reg_veri ? "<input type='checkbox' name='user_reg_veri' value='1'  checked='checked' />" : "<input type='checkbox' name='user_reg_veri' value='1' />")."
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_32.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($anon_post ? "<input type='checkbox' name='anon_post' value='1'  checked='checked' />" : "<input type='checkbox' name='anon_post' value='1' />")."
-(".PRFLAN_33.")
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_45.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>";
-if($use_coppa == 1){
-        $text .= "<input type='checkbox' name='use_coppa' value='1'  checked='checked' />";
-}else{
-        $text .= "<input type='checkbox' name='use_coppa' value='1' />";
-}
-
-
-$text .= "(".PRFLAN_46." <a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".PRFLAN_94."</a>)
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_58.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['membersonly_enabled'] ? "<input type='checkbox' name='membersonly_enabled' value='1'  checked='checked' />" : "<input type='checkbox' name='membersonly_enabled' value='1' />")."
-(".PRFLAN_59.")
-</td>
-</tr>
-
-
-";
-
-$text .="
-<tr>
-<td style='width:50%' class='forumheader3'>".CUSTSIG_16."</td>
-<td class='forumheader3' style='width:50%;text-align:right' >
-<input type='text' class='tbox' size='3' name='signup_pass_len' value='".$pref['signup_pass_len']."' />
-(".PRFLAN_78.") </td>
-</tr></table></div>";
-
-
-// Signup options ===========================.
-
-$text .= "
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_19."</div>
-<div id='signup' style='text-align:center; display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr >
-<td class=\"fcaption\">".CUSTSIG_13."</td>
-<td class=\"fcaption\">".CUSTSIG_14."</td>
-</tr>";
- $signupval = explode(".",$pref['signup_options']);
-
-
-    for ($i=0; $i<count($signup_title); $i++) {
-
-    $text .="
-    <tr>
-<td style='width:50%' class='forumheader3'>".$signup_title[$i]."</td>
-<td style='width:50%;text-align:right' class='forumheader3' >".
-($signupval[$i] == "0" || $$signup_name[$i]=="" ? "<input type='radio' name='".$signup_name[$i]."' value='0' checked='checked' /> ".CUSTSIG_12 : "<input type='radio' name='".$signup_name[$i]."' value='0' /> ".CUSTSIG_12)."&nbsp;&nbsp;".
-($signupval[$i] == "1" ? "<input type='radio' name='".$signup_name[$i]."' value='1' checked='checked' /> ".CUSTSIG_14 : "<input type='radio' name='".$signup_name[$i]."' value='1' /> ".CUSTSIG_14)."&nbsp;&nbsp;".
-($signupval[$i] == "2" ? "<input type='radio' name='".$signup_name[$i]."' value='2' checked='checked' /> ".CUSTSIG_15 : "<input type='radio' name='".$signup_name[$i]."' value='2' /> ".CUSTSIG_15)."&nbsp;&nbsp;
-
-</td>
-
-</tr>";
-
-    }
-
-// Custom Fields.
-
-if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-        $row = $sql -> db_Fetch();
-        $user_entended = unserialize($row[0]);
-        $c=0;
-        $user_pref = unserialize($user_prefs);
-        while(list($key, $u_entended) = each($user_entended)){
-                if($u_entended){
-                        $ut = explode("|",$u_entended);
-                        $u_name = ($ut[0] != "") ? str_replace("_"," ",$ut[0]): $u_entended;
-                        $u_type = $ut[1];
-                        $u_value = $ut[2];
-                        $signup_ext = "signup_ext";
-                        $text .="
-                        <tr>
-                        <td style='width:50%' class='forumheader3'>".$u_name." <span class='smalltext'>(custom field)</span></td>
-                        <td style='width:50%;text-align:right' class='forumheader3' >".
-                        ($pref['signup_ext'.$key] == "0" || $pref['signup_ext'.$key]=="" ? "<input type='radio' name='signup_ext".$key."' value='0' checked='checked' /> ".CUSTSIG_12 : "<input type='radio' name='signup_ext".$key."' value='0' /> ".CUSTSIG_12)."&nbsp;&nbsp;".
-                        ($pref['signup_ext'.$key] == "1" ? "<input type='radio' name='signup_ext".$key."' value='1' checked='checked' /> ".CUSTSIG_14 : "<input type='radio' name='signup_ext".$key."' value='1' /> ".CUSTSIG_14)."&nbsp;&nbsp;".
-                        ($pref['signup_ext'.$key] == "2" ? "<input type='radio' name='signup_ext".$key."' value='2' checked='checked' /> ".CUSTSIG_15 : "<input type='radio' name='signup_ext".$key."' value='2' /> ".CUSTSIG_15)."&nbsp;&nbsp;".
-                        "</td>
-                        </tr>";
-                }
-        }
-}
-
-$text .="</table></div>";
-
- // Security Options. .
-
-$text .="
-
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_47."</div>
-<div id='security' style='text-align:center; display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_60."<br /><span class='smalltext'>".PRFLAN_61."</span> </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['ssl_enabled'] ? "<input type='checkbox' name='ssl_enabled' value='1'  checked='checked' />" : "<input type='checkbox' name='ssl_enabled' value='1' />")."
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_76.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['signcode'] ? "<input type='checkbox' name='signcode' value='1'  checked='checked' />" : "<input type='checkbox' name='signcode' value='1' />")."
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_81.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['logcode'] ? "<input type='checkbox' name='logcode' value='1'  checked='checked' />" : "<input type='checkbox' name='logcode' value='1' />")."
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_92.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($user_reg_secureveri ? "<input type='checkbox' name='user_reg_secureveri' value='1'  checked='checked' />" : "<input type='checkbox' name='user_reg_secureveri' value='1' />")."
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_48.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($user_tracking == "cookie" ? "<input type='radio' name='user_tracking' value='cookie' checked='checked' /> ".PRFLAN_49 : "<input type='radio' name='user_tracking' value='cookie' /> ".PRFLAN_49).
-($user_tracking == "session" ? "<input type='radio' name='user_tracking' value='session' checked='checked' /> ".PRFLAN_50 : "<input type='radio' name='user_tracking' value='session' /> ".PRFLAN_50)."
-<br />
-".PRFLAN_55.": <input class='tbox' type='text' name='cookie_name' size='20' value='".$pref['cookie_name']."' maxlength='20' />
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_40.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>";
-if($profanity_filter == 1){
-        $text .= "<input type='checkbox' name='profanity_filter' value='1'  checked='checked' />";
-}else{
-        $text .= "<input type='checkbox' name='profanity_filter' value='1' />";
-}
-
-$text .= "(".PRFLAN_41.")
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_42.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='profanity_replace' size='30' value='$profanity_replace' maxlength='20' />
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_43.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<textarea class='tbox' name='profanity_words' cols='59' rows='2'>".$profanity_words."</textarea>
-<br />".PRFLAN_44."
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_82.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>";
-if($search_restrict == 1){
-        $text .= "<input type='checkbox' name='search_restrict' value='1'  checked='checked' />";
-}else{
-        $text .= "<input type='checkbox' name='search_restrict' value='1' />";
-}
-$text .= "</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_35.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>";
-if($antiflood1 == 1){
-        $text .= "<input type='checkbox' name='antiflood1' value='1'  checked='checked' />";
-}else{
-        $text .= "<input type='checkbox' name='antiflood1' value='1' />";
-}
-$text .= "</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_36.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='antiflood_timeout' size='3' value='$antiflood_timeout' maxlength='3' />
-<br />
-<b class=\"smalltext\" >".PRFLAN_38."</b>
-</td>
-</tr>
-
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_37.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>";
-if($autoban == 1){
-        $text .= "<input type='checkbox' name='autoban' value='1'  checked='checked' />";
-}else{
-        $text .= "<input type='checkbox' name='autoban' value='1' />";
-}
-$text .= "<br />
-<b class=\"smalltext\" >".PRFLAN_91."</b></td>
-</tr>
-
-</table></div>";
-
-
-
-
-
-// Mail settings..........................
-$text .="
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_62."</div>
-<div id='mail' style='text-align:center; display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_63."<br /><span class='smalltext'>".PRFLAN_64."</span></td>
-<td style='width:50%; text-align:right' class='forumheader3'><input class='button' type='submit' name='testemail' value='".PRFLAN_65." ".SITEADMINEMAIL."' />
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_70."<br /><span class='smalltext'>".PRFLAN_71."</span></td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['smtp_enable'] ? "<input type='checkbox' name='smtp_enable' value='1' checked='checked' />" : "<input type='checkbox' name='smtp_enable' value='1' />")." </td>
-</tr>
-
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_72.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='smtp_server' size='30' value='".$pref['smtp_server']."' maxlength='50' />
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_73.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='text' name='smtp_username' size='30' value='".$pref['smtp_username']."' maxlength='50' />
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_74.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>
-<input class='tbox' type='password' name='smtp_password' size='30' value='".$pref['smtp_password']."' maxlength='50' />
-</td>
-</tr></table></div>";
-
-$text .="
-<div class='caption' title='".PRFLAN_87."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">".PRFLAN_87."</div>
-<div id='comments' style='text-align:center; display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr>
-<td style='width:50%' class='forumheader3'>".PRFLAN_88.": </td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-($pref['nested_comments'] ?  "<input type='checkbox' name='nested_comments' value='1'  checked='checked' />" : "<input type='checkbox' name='nested_comments' value='1' />"). "</td>
-</tr>
-</table></div>";
-
-
-$text .="
-
-
-<div class='caption' title='".PRFLAN_80."' style='cursor:pointer;cursor:hand;text-align:left;border:1px solid black' onclick=\"expandit(this)\">e107</div>
-<div id='update' style='text-align:center; display:none'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr>
-<td colspan='2' class='forumheader3'>".$auth_dropdown."
-<div style='text-align:center'><input class='button' type='submit' name='newver' value='".PRFLAN_51."' /></div>
-</td>
-</tr></table>
-</div>";
-
-$text .="<div style='text-align:center'>
-<table style='width:100%' class='fborder' cellspacing='1' cellpadding='0'>  <tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center' class='forumheader3'>
-<br />
-<input class='caption' type='submit' name='updateprefs' value='".PRFLAN_52."' />
-</td>
-</tr>
-</table></div>
-
-</div></div></form>";
-
-
-
-
-$ns -> tablerender("<div style='text-align:center'>".PRFLAN_53."</div>", $text);
-
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ?Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/prefs.php,v $
+|     $Revision: 1.89 $
+|     $Date: 2006/05/01 23:58:46 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+include_once(e_HANDLER."userclass_class.php");
+include_once(e_HANDLER."user_extended_class.php");
+$ue = new e107_user_extended;
+
+if (isset($_POST['newver'])) {
+	header("location:http://e107.org/index.php");
+	exit;
+}
+
+if (!getperms("1")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+$e_sub_cat = 'prefs';
+if (!$pref['timezone']) {
+	$pref['timezone'] = "GMT";
+}
+
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+
+if ($_POST['submit_resetdisplaynames'])
+{
+    $sql -> db_Update("user", "user_name=user_loginname");
+	$message = PRFLAN_157;
+}
+
+if (isset($_POST['updateprefs']))
+{
+	unset($_POST['updateprefs']);
+
+	$_POST['cookie_name'] = str_replace(array(" ","."), "_", $_POST['cookie_name']);
+	$_POST['cookie_name'] = preg_replace("#[^a-zA-Z0-9_]#", "", $_POST['cookie_name']);
+
+	$_POST['siteurl']     = trim($_POST['siteurl']) ? trim($_POST['siteurl']) : SITEURL;
+	$_POST['siteurl']     = substr($_POST['siteurl'], -1) == "/" ? $_POST['siteurl'] : $_POST['siteurl']."/";
+
+	foreach($_POST as $key => $value)
+	{
+		$pref[$key] = $tp->toDB($value);
+	}
+
+	$e107cache->clear();
+	save_prefs();
+	$sql -> db_Select_gen("TRUNCATE ".MPREFIX."online");
+	header("location:".e_ADMIN."prefs.php?u");
+	exit;
+}
+
+if($sql->db_Select("plugin", "plugin_path", "plugin_installflag='1' AND plugin_path = 'alt_auth'"))
+{
+	$authlist[] = "e107";
+	$handle=opendir(e_PLUGIN."alt_auth");
+	while ($file = readdir($handle))
+	{
+		if(preg_match("/^(.*)_auth\.php/",$file,$match))
+		{
+			$authlist[] = $match[1];
+		}
+	}
+}
+
+if ($authlist) {
+	$auth_dropdown .= "<select class='tbox' name='auth_method'>\n";
+	foreach($authlist as $a) {
+		$s = ($pref['auth_method'] == $a ? " selected='selected'>" : "");
+		$auth_dropdown .= "<option {$s}>".$a."</option>\n";
+	}
+	$auth_dropdown .= "</select>\n";
+} else {
+	$auth_dropdown = "<input type='hidden' name='auth_method' value='' />".PRFLAN_151;
+	$pref['auth_method'] = "";
+}
+
+
+require_once("auth.php");
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+if(e_QUERY == "u") {
+	$ns->tablerender("", "<div style='text-align:center'><b>".PRFLAN_106."</b></div>");
+}
+
+$handle = opendir(e_ADMIN.'includes/');
+while ($file = readdir($handle)) {
+	if ($file != "." && $file != "..") {
+		$file = str_replace(".php", "", $file);
+		$adminlist[] = $file;
+	}
+}
+closedir($handle);
+
+$text = "<script type=\"text/javascript\">
+	<!--
+	var hideid=\"main\";
+	function showhideit(showid){
+	if (hideid!=showid){
+	show=document.getElementById(showid).style;
+	hide=document.getElementById(hideid).style;
+	show.display=\"\";
+	hide.display=\"none\";
+	hideid = showid;
+	}
+	}
+	//-->
+	</script>
+	<div style='text-align:center'>
+	<div style='text-align:center; ".ADMIN_WIDTH."; margin-left: auto; margin-right: auto'>
+	<form method='post' action='".e_SELF."'>
+	<div id='main' style='text-align:center'>
+	<table style='width:100%' class='fborder'>
+	<tr>
+	<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_1."</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_2."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='sitename' size='50' value='".$pref['sitename']."' maxlength='100' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_3."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='siteurl' size='50' value='".$pref['siteurl']."' maxlength='150' /><br />
+	".($pref['siteurl'] == SITEURL ? "" : "<br />( ".PRFLAN_159.": <b>".SITEURL."</b> )")."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_134."<br /><span class='smalltext'>".PRFLAN_135."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='redirectsiteurl' value='1'".($pref['redirectsiteurl'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='redirectsiteurl' value='0'".(!$pref['redirectsiteurl'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_4."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>";
+
+    $param = "sitebutton,".e_IMAGE.",".SITEBUTTON.",81px,30px,";
+    $text .= $tp->parseTemplate("{IMAGESELECTOR={$param}}");
+
+	$text .= "
+		</td>
+	</tr>
+	<tr>
+
+	<td style='width:50%' class='forumheader3'>".PRFLAN_5."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<textarea class='tbox' name='sitetag' cols='59' rows='3'>".$pref['sitetag']."</textarea>
+	</td>
+	</tr>
+	<tr>
+
+	<td style='width:50%' class='forumheader3'>".PRFLAN_6."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<textarea class='tbox' name='sitedescription' cols='59' rows='6'>".$pref['sitedescription']."</textarea>
+	</td>
+	</tr>
+	<tr>
+
+	<td style='width:50%' class='forumheader3'>".PRFLAN_7."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='siteadmin' size='50' value='".SITEADMIN."' maxlength='100' />
+	</td>
+	</tr>
+	<tr>
+
+	<td style='width:50%' class='forumheader3'>".PRFLAN_8."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='siteadminemail' size='50' value='".SITEADMINEMAIL."' maxlength='100' />
+	</td>
+	</tr>
+	<tr>
+
+	<td style='width:50%' class='forumheader3'>".PRFLAN_162."<br /><span class='smalltext'>".PRFLAN_163."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<textarea class='tbox' name='sitecontactinfo' cols='59' rows='6'>".$pref['sitecontactinfo']."</textarea>
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_164."<br /><span class='smalltext'>".PRFLAN_165."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='contact_emailcopy' value='1'".($pref['contact_emailcopy'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='contact_emailcopy' value='0'".(!$pref['contact_emailcopy'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<td style='width:50%' class='forumheader3'>".PRFLAN_9."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<textarea class='tbox' name='sitedisclaimer' cols='59' rows='6'>".$pref['sitedisclaimer']."</textarea>
+	</td>
+	</tr>
+
+	";
+
+$text .= pref_submit();
+
+$text .= "</table>
+	</div>
+
+	<div id='display' style='display:none; text-align:center'>
+	<table style='width:100%' class='fborder'>
+	<tr>
+	<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_13."</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_14." </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='displaythemeinfo' value='1'".($pref['displaythemeinfo'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='displaythemeinfo' value='0'".(!$pref['displaythemeinfo'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_15." </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='displayrendertime' value='1'".($pref['displayrendertime'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='displayrendertime' value='0'".(!$pref['displayrendertime'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_16." </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='displaysql' value='1'".($pref['displaysql'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='displaysql' value='0'".(!$pref['displaysql'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+	";
+if(function_exists("memory_get_usage")){
+	$text .= "
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_137." </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='display_memory_usage' value='1'".($pref['display_memory_usage'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='display_memory_usage' value='0'".(!$pref['display_memory_usage'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+	";
+}
+$text .= pref_submit();
+
+$text .= "</table></div>";
+
+// Admin Display Areas. .
+
+$text .= "<div id='admindisp' style='display:none; text-align:center'>
+	<table style='width:100%' class='fborder'>
+	<tr>
+	<td class='fcaption' title='".PRFLAN_80."' style='; text-align:left;' colspan='2'>".PRFLAN_77."</td>
+	</tr>
+
+
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_95."<br /><span class='smalltext'>".PRFLAN_96."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='admin_alerts_ok' value='1'".($pref['admin_alerts_ok'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='admin_alerts_ok' value='0'".(!$pref['admin_alerts_ok'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>";
+
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_97."<br /><span class='smalltext'>".PRFLAN_98."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='admin_alerts_uniquemenu' value='1'".($pref['admin_alerts_uniquemenu'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='admin_alerts_uniquemenu' value='0'".(!$pref['admin_alerts_uniquemenu'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>";
+
+
+$text .= pref_submit();
+
+$text .= "</table></div>";
+
+// Date options.
+$text .= "<div id='date' style='display:none; text-align:center'>
+	<table style='width:100%' class='fborder'>
+	<tr>
+	<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_21."</td>
+	</tr>
+
+	<tr>";
+
+$ga = new convert;
+$date1 = $ga->convert_date(time(), "short");
+$date2 = $ga->convert_date(time(), "long");
+$date3 = $ga->convert_date(time(), "forum");
+
+
+$text .= "<td style='width:50%' class='forumheader3'>".PRFLAN_22.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='shortdate' size='40' value='".$pref['shortdate']."' maxlength='50' />
+	<br />".PRFLAN_83.": $date1
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_23.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='longdate' size='40' value='".$pref['longdate']."' maxlength='50' />
+	<br />".PRFLAN_83.": $date2
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_24."<br /><span class='smalltext'>".PRFLAN_25." <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>".PRFLAN_93."</a></span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='forumdate' size='40' value='".$pref['forumdate']."' maxlength='50' />
+	<br />".PRFLAN_83.": $date3
+	</td>
+	</tr>
+
+
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_26."<br /><span class='smalltext'>".PRFLAN_27."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<select name='time_offset' class='tbox'>\n";
+$toffset = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13", "+14", "+15", "+16");
+if(!isset($pref['time_offset']))
+{
+	$pref['time_offset'] = "0";
+}
+foreach($toffset as $o)
+{
+	if (!isset($pref['time_offset']) || $o == $pref['time_offset']) {
+		$text .= "<option selected='selected'>".$o."</option>\n";
+	} else {
+		$text .= "<option>".$o."</option>\n";
+	}
+}
+$text .= "</select>
+	</td></tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_56.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='timezone' size='20' value='".$pref['timezone']."' maxlength='50' />
+	</td>
+	</tr>";
+
+$text .= pref_submit();
+
+$text .= "</table></div>";
+
+// =========== Registration Preferences. ==================
+
+$text .= "<div id='registration' style='display:none; text-align:center'><table style='width:100%' class='fborder'>
+	<tr>
+	<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_28."</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_29."<br /><span class='smalltext'>".PRFLAN_30."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='user_reg' value='1'".($pref['user_reg'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='user_reg' value='0'".(!$pref['user_reg'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_141."<br /></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='xup_enabled' value='1'".($pref['xup_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='xup_enabled' value='0'".(!$pref['xup_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_154."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+
+	<select name='user_reg_veri' class='tbox'>";
+	$veri_list[0] = PRFLAN_152;
+	$veri_list[1] = PRFLAN_31;
+	$veri_list[2] = PRFLAN_153;
+
+	foreach($veri_list as $v => $v_title){
+		$sel = ($pref['user_reg_veri'] == $v) ? "selected='selected'" : "";
+    	$text .= "<option value='$v' $sel>".$v_title."</option>\n";
+	}
+
+	$text .="</select></td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_160."<br /></td>
+	<td class='forumheader3' style='width:50%;text-align:right' >
+	<input type='radio' name='signup_remote_emailcheck' value='1'".($pref['signup_remote_emailcheck'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='signup_remote_emailcheck' value='0'".(!$pref['signup_remote_emailcheck'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_32."<br /><span class='smalltext'>".PRFLAN_33."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='anon_post' value='1'".($pref['anon_post'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='anon_post' value='0'".(!$pref['anon_post'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_45."<br /><span class='smalltext'>".PRFLAN_46." <a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".PRFLAN_94."</a></span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='use_coppa' value='1'".($pref['use_coppa'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='use_coppa' value='0'".(!$pref['use_coppa'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_58."<br /><span class='smalltext'>".PRFLAN_59."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='membersonly_enabled' value='1'".($pref['membersonly_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='membersonly_enabled' value='0'".(!$pref['membersonly_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".CUSTSIG_16."<br /><span class='smalltext'>".PRFLAN_78."</span></td>
+	<td class='forumheader3' style='width:50%;text-align:right' >
+	<input type='text' class='tbox' size='3' name='signup_pass_len' value='".$pref['signup_pass_len']."' />
+	</td>
+	</tr>
+
+
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_136."</td>
+	<td class='forumheader3' style='width:50%;text-align:right' >
+	<input type='text' class='tbox' size='3' name='signup_maxip' value='".$pref['signup_maxip']."' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".CUSTSIG_18."<br /><span class='smalltext'>".CUSTSIG_19."</span></td>
+	<td class='forumheader3' style='width:50%;text-align:right' >
+	<textarea class='tbox' name='signup_disallow_text' cols='1' rows='3' style='width: 80%;'>".$pref['signup_disallow_text']."</textarea>
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_155.":</td>
+	<td class='forumheader3' style='width:50%;text-align:right' >
+	".r_userclass('displayname_class',$pref['displayname_class'],'off','nobody, public, admin, classes')."
+	<input class='button' type='submit' name='submit_resetdisplaynames' value='".PRFLAN_156."' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_158.":</td>
+	<td class='forumheader3' style='width:50%;text-align:right' >
+	<input type='text' class='tbox' size='3' name='displayname_maxlength' value='".$pref['displayname_maxlength']."' />
+	</td>
+	</tr>
+
+	";
+
+$text .= pref_submit();
+$text .= "</table></div>";
+
+// Signup options ===========================.
+
+$text .= "<div id='signup' style='display:none; text-align:center'>
+	<table style='width:100%' class='fborder'>
+	<tr>
+	<td class='fcaption' style='text-align:left;' colspan='2'>".PRFLAN_19."</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_126."</td>
+	<td style='width:50%' class='forumheader3'><textarea class='tbox' name='signup_text' cols='1' rows='3' style='width: 100%;'>".$pref['signup_text']."</textarea>
+	</td>
+	</tr>
+
+    <tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_140."</td>
+	<td style='width:50%' class='forumheader3'><textarea class='tbox' name='signup_text_after' cols='1' rows='3' style='width: 100%;'>".$pref['signup_text_after']."</textarea>
+	</td>
+	</tr>
+
+
+	<tr>
+	<td class='forumheader'>".CUSTSIG_13."</td>
+	<td class='forumheader'>".CUSTSIG_14."</td>
+	</tr>";
+
+    $signup_option_title = array(CUSTSIG_2, CUSTSIG_6, CUSTSIG_7, CUSTSIG_8, CUSTSIG_17);
+    $signup_option_names = array("signup_option_realname", "signup_option_signature", "signup_option_image", "signup_option_timezone", "signup_option_class");
+
+	foreach($signup_option_names as $key => $value)
+	{
+		$text .= "
+		<tr>
+			<td style='width:50%' class='forumheader3'>".$signup_option_title[$key]."</td>
+			<td style='width:50%' class='forumheader3'>".
+			(!$pref[$value]        ? "<input type='radio' name='{$value}' value='0' checked='checked' /> ".CUSTSIG_12 : "<input type='radio' name='{$value}' value='0' /> ".CUSTSIG_12)."&nbsp;&nbsp;".
+			( $pref[$value] == "1" ? "<input type='radio' name='{$value}' value='1' checked='checked' /> ".CUSTSIG_14 : "<input type='radio' name='{$value}' value='1' /> ".CUSTSIG_14)."&nbsp;&nbsp;".
+			( $pref[$value] == "2" ? "<input type='radio' name='{$value}' value='2' checked='checked' /> ".CUSTSIG_15 : "<input type='radio' name='{$value}' value='2' /> ".CUSTSIG_15)."&nbsp;&nbsp;
+			</td>
+		</tr>";
+	}
+
+// Custom Fields.
+
+$text .= pref_submit();
+$text .= "</table></div>";
+
+/* text render options */
+
+if(!isset($pref['post_html']))
+{
+	$pref['post_html'] = '254';
+	save_prefs();
+}
+
+$text .= "<div id='textpost' style='display:none; text-align:center'>
+	<table style='width:100%' class='fborder'>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_127.":  <div class='smalltext'>".PRFLAN_128."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input type='radio' name='make_clickable' value='1'".($pref['make_clickable'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='make_clickable' value='0'".(!$pref['make_clickable'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_102."?:  <div class='smalltext'>".PRFLAN_103."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input type='radio' name='link_replace' value='1'".($pref['link_replace'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='link_replace' value='0'".(!$pref['link_replace'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_145."?:  <div class='smalltext'>".PRFLAN_146."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input type='radio' name='links_new_window' value='1'".($pref['links_new_window'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='links_new_window' value='0'".(!$pref['links_new_window'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_104.": <div class='smalltext'>".PRFLAN_105."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input class='tbox' type='text' name='link_text' size='50' value='".$tp -> post_toForm($pref['link_text'])."' maxlength='200' />
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_107.": <div class='smalltext'>".PRFLAN_108."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input class='tbox' type='text' name='email_text' size='50' value='".$tp -> post_toForm($pref['email_text'])."' maxlength='200' />
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_109.":  <div class='smalltext'>".PRFLAN_110."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input class='tbox' type='text' name='main_wordwrap' size='5' value='".$pref['main_wordwrap']."' maxlength='3' />
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_111.":  <div class='smalltext'>".PRFLAN_110."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input class='tbox' type='text' name='menu_wordwrap' size='5' value='".$pref['menu_wordwrap']."' maxlength='3' />
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_116.":  <div class='smalltext'>".PRFLAN_117."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	".r_userclass('post_html',$pref['post_html'],'off','nobody, public, member, admin, classes')."
+	</td>
+	</tr>\n
+
+    <tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_122.":  <div class='smalltext'>".PRFLAN_123."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input type='radio' name='wysiwyg' value='1'".($pref['wysiwyg'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='wysiwyg' value='0'".(!$pref['wysiwyg'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>\n
+
+    <tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_124.":  <div class='smalltext'>".PRFLAN_125."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input type='radio' name='old_np' value='1'".($pref['old_np'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='old_np' value='0'".(!$pref['old_np'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_131.":  <div class='smalltext'>".PRFLAN_132."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	".r_userclass('php_bbcode',$pref['php_bbcode'],'off','nobody, admin, classes')."
+	</td>
+	</tr>\n
+
+";
+
+	if(file_exists(e_PLUGIN."geshi/geshi.php")) {
+		$text .= "<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_118."?:  <div class='smalltext'>".PRFLAN_119."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input type='radio' name='useGeshi' value='1'".($pref['useGeshi'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='useGeshi' value='0'".(!$pref['useGeshi'] ? " checked='checked'" : "")." /> ".PRFLAN_113."<br />
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:50%;'>".PRFLAN_120."?:  <div class='smalltext'>".PRFLAN_121."</div></td>
+	<td class='forumheader3' style='width:50%; text-align: right;'>
+	<input class='tbox' type='text' name='defaultLanGeshi' size='10' value='".($pref['defaultLanGeshi'] ? $pref['defaultLanGeshi'] : "php")."' maxlength='20' />
+	</td>
+	</tr>
+	";
+	}
+
+
+
+$text .= pref_submit();
+$text .= "</table></div>";
+
+// Security Options. .
+$hasGD = extension_loaded("gd");
+
+$text .= "<div id='security' style='display:none; text-align:center'>
+	<table style='width:100%' class='fborder'>
+	<tr>
+	<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_47."</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_60."<br /><span class='smalltext'>".PRFLAN_61."</span> </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='ssl_enabled' value='1'".($pref['ssl_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='ssl_enabled' value='0'".(!$pref['ssl_enabled'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_76.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	";
+	if($hasGD)
+	{
+	$text .= "
+	<input type='radio' name='signcode' value='1'".($pref['signcode'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='signcode' value='0'".(!$pref['signcode'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	";
+	}
+	else
+	{
+		$text .= PRFLAN_133;
+	}
+	$text .= "
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_81.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	";
+	if($hasGD)
+	{
+	$text .= "
+	<input type='radio' name='logcode' value='1'".($pref['logcode'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='logcode' value='0'".(!$pref['logcode'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	";
+	}
+	else
+	{
+		$text .= PRFLAN_133;
+	}
+	$text .= "
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_138.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	";
+	if($hasGD)
+	{
+	$text .= "
+	<input type='radio' name='fpwcode' value='1'".($pref['fpwcode'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='fpwcode' value='0'".(!$pref['fpwcode'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	";
+	}
+	else
+	{
+		$text .= PRFLAN_133;
+	}
+	$text .= "
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_92.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='user_reg_secureveri' value='1'".($pref['user_reg_secureveri'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='user_reg_secureveri' value='0'".(!$pref['user_reg_secureveri'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_129.":<br /><span class='smalltext'>".PRFLAN_130."</span> </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='disallowMultiLogin' value='1'".($pref['disallowMultiLogin'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='disallowMultiLogin' value='0'".(!$pref['disallowMultiLogin'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_48.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>". ($pref['user_tracking'] == "cookie" ? "<input type='radio' name='user_tracking' value='cookie' checked='checked' /> ".PRFLAN_49 : "<input type='radio' name='user_tracking' value='cookie' /> ".PRFLAN_49). ($pref['user_tracking'] == "session" ? "<input type='radio' name='user_tracking' value='session' checked='checked' /> ".PRFLAN_50 : "<input type='radio' name='user_tracking' value='session' /> ".PRFLAN_50)."
+	<br />
+	".PRFLAN_55.": <input class='tbox' type='text' name='cookie_name' size='20' value='".$pref['cookie_name']."' maxlength='20' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_40."<br /><span class='smalltext'>".PRFLAN_41."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='profanity_filter' value='1'".($pref['profanity_filter'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='profanity_filter' value='0'".(!$pref['profanity_filter'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_42.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='profanity_replace' size='30' value='".$pref['profanity_replace']."' maxlength='20' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_43.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<textarea class='tbox' name='profanity_words' cols='59' rows='2' style='width:100%'>".$pref['profanity_words']."</textarea>
+	<br />".PRFLAN_44."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_35.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='antiflood1' value='1'".($pref['antiflood1'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='antiflood1' value='0'".(!$pref['antiflood1'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_36.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input class='tbox' type='text' name='antiflood_timeout' size='3' value='".$pref['antiflood_timeout']."' maxlength='3' />
+	<br />
+	<b class=\"smalltext\" >".PRFLAN_38."</b>
+	</td>
+	</tr>
+
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_37."<br /><span class='smalltext'>".PRFLAN_91."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<select name='autoban' class='tbox'>";
+    $autoban_list[0] = PRFLAN_113;
+    $autoban_list[1] = PRFLAN_144;
+    $autoban_list[2] = PRFLAN_142;
+    $autoban_list[3] = PRFLAN_143;
+
+	foreach($autoban_list as $ab=>$ab_title){
+		$sel = ($pref['autoban'] == $ab) ? "selected='selected'" : "";
+    	$text .= "<option value='$ab' $sel>".$ab_title."</option>\n";
+	}
+
+	$text .="</select></td>
+	</tr>
+
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_139.":</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='adminpwordchange' value='1'".($pref['adminpwordchange'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='adminpwordchange' value='0'".(!$pref['adminpwordchange'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>";
+
+$text .= pref_submit();
+
+$text .= "</table></div>";
+
+$text .= "<div id='comments' style='display:none; text-align:center'>
+	<table style='width:100%' class='fborder'>
+	<tr>
+	<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_87."</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_89.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='comments_icon' value='1'".($pref['comments_icon'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='comments_icon' value='0'".(!$pref['comments_icon'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_88.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='nested_comments' value='1'".($pref['nested_comments'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='nested_comments' value='0'".(!$pref['nested_comments'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_90.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='allowCommentEdit' value='1'".($pref['allowCommentEdit'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='allowCommentEdit' value='0'".(!$pref['allowCommentEdit'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_161.": </td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='comments_disabled' value='1'".($pref['comments_disabled'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='comments_disabled' value='0'".(!$pref['comments_disabled'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	";
+
+$text .= pref_submit();
+
+$text .= "</table></div>";
+
+
+//Advanced Features
+$text .= "<div id='advanced' style='display:none; text-align:center'>
+	<table style='width:100%' class='fborder'>
+	<tr>
+	<td class='fcaption' title='".PRFLAN_80."' style='text-align:left;' colspan='2'>".PRFLAN_149."</td>
+	</tr>";
+
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_147.":<br /><span class='smalltext'>".PRFLAN_148."</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='developer' value='1'".($pref['developer'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='developer' value='0'".(!$pref['developer'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_17."<br /><span class='smalltext'>&nbsp;</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='compress_output' value='1'".($pref['compress_output'] ? " checked='checked'" : "")." /> ".PRFLAN_112."&nbsp;&nbsp;
+	<input type='radio' name='compress_output' value='0'".(!$pref['compress_output'] ? " checked='checked'" : "")." /> ".PRFLAN_113."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".PRFLAN_150."<br /><span class='smalltext'>&nbsp;</span></td>
+	<td style='width:50%; text-align:right' class='forumheader3'>{$auth_dropdown}</td>
+	</tr>
+
+	";
+
+$text .= pref_submit();
+
+$text .= "</table></div>";
+// END Advanced Features
+
+
+
+$text .= "</form></div></div>";
+
+$ns->tablerender(PRFLAN_53, $text);
+
+require_once("footer.php");
+
+function pref_submit() {
+	$text = "<tr>
+		<td colspan='2' style='text-align:center' class='forumheader'>";
+
+	// ML
+	/* if(e_MLANG == 1){
+	//$text .="<input class='fcaption' type='submit' name='updateprefs' value='".PRFLAN_52."' />
+	$but_typ = array(""); // empty = submit
+	$but_nam = array("updateprefs"); // empty = autobutX with X autoincrement
+	$but_val = array("updateprefs"); // empty = Submit
+	$but_class = array("caption"); // empty = button
+	$butjs = array(""); // empty = ""
+	$buttitle = array(""); // empty = ""
+	$text .= e107ml_adpanel(1,$but_typ,$but_nam,$but_val,$but_class,$butjs,$buttitle);
+	}else{*/
+	$text .= "<input class='button' type='submit' name='updateprefs' value='".PRFLAN_52."' />";
+	// }
+	$text .= "</td>
+		</tr>";
+
+	// END ML
+	return $text;
+}
+
+function prefs_adminmenu() {
+	$var['main']['text'] = PRFLAN_1;
+	$var['display']['text'] = PRFLAN_13;
+	$var['admindisp']['text'] = PRFLAN_77;
+	$var['date']['text'] = PRFLAN_21;
+	$var['registration']['text'] = PRFLAN_28;
+	$var['signup']['text'] = PRFLAN_19;
+	$var['textpost']['text'] = PRFLAN_101;
+	$var['security']['text'] = PRFLAN_47;
+	$var['comments']['text'] = PRFLAN_87;
+	$var['advanced']['text'] = PRFLAN_149;
+	show_admin_menu(LAN_OPTIONS, $action, $var, TRUE);
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/review.php 75/e107_admin/review.php
--- 6171/e107_admin/review.php	2004-08-31 11:02:52.000000000 -0500
+++ 75/e107_admin/review.php	2005-12-24 19:26:59.000000000 -0600
@@ -1,592 +1,23 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/review.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-$Id: review.php,v 1.22 2004/08/31 16:02:51 loloirie Exp $  
-*/
-require_once("../class2.php");
-    if($pref['htmlarea']){
-        require_once(e_HANDLER."htmlarea/htmlarea.inc.php");
-       $htmlarea_js = htmlarea("data");
-    }
-if(!getperms("J") && !getperms("K") && !getperms("L")){
-        header("location:".e_BASE."index.php");
-        exit;
-}
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-$aj = new textparse;
-require_once(e_HANDLER."form_handler.php");
-require_once(e_HANDLER."userclass_class.php");
-
-$rs = new form;
-
-$deltest = array_flip($_POST);
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
-        unset($tmp);
-}
-if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$etp->unentity(REVLAN_9)],$matches))
-{
-        $delete = $matches[1];
-        $del_id = $matches[2];
-}
-
-// ##### DB --------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if(IsSet($_POST['create_category'])){
-        $_POST['category_name'] = $aj -> formtpa($_POST['category_name'], "admin");
-        $_POST['category_description'] = $aj -> formtpa($_POST['category_description'], "admin");
-        $sql -> db_Insert("content", " '0', '".$_POST['category_name']."', '".$_POST['category_description']."', 0, 0, ".time().", '".ADMINID."', 0, '".$_POST['category_button']."', 10, 0, 0, 0");
-        $message = REVLAN_25;
-        clear_cache("review");
-        $action = "cat";
-}
-
-if(IsSet($_POST['update_category'])){
-        $_POST['category_name'] = $aj -> formtpa($_POST['category_name'], "admin");
-        $_POST['category_description'] = $aj -> formtpa($_POST['category_description'], "admin");
-        $sql -> db_Update("content", "content_heading='".$_POST['category_name']."', content_subheading='".$_POST['category_description']."', content_summary='".$_POST['category_button']."' WHERE content_id='".$_POST['category_id']."' ");
-        $message = REVLAN_26;
-        clear_cache("review");
-        $action = "cat";
-}
-
-if(IsSet($_POST['create_review'])){
-        if($_POST['data'] != ""){
-                $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-                $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-                $content_content = $aj -> formtpa($_POST['data'], "admin");
-                $content_author = (!$_POST['content_author'] || $_POST['content_author'] == REVLAN_53 ? ADMINID : $_POST['content_author']."^".$_POST['content_author_email']);
-                 $sql -> db_Insert("content", "0, '".$content_heading."', '".$content_subheading."', '$content_content', '".$_POST['category']."', '".time()."', '".$content_author."', '".$_POST['content_comment']."', '".$_POST['content_summary']."', '3', ".$_POST['content_rating'].",".$_POST['add_icons']." ,".$_POST['r_class']);
-                unset($content_heading, $content_subheading, $data, $content_summary);
-                $message = REVLAN_1;
-                clear_cache("review");
-        }else{
-                $message = REVLAN_2;
-        }
-        unset($action);
-}
-
-If(IsSet($_POST['update_review'])){
-        if($_POST['category'] == -1){ unset($_POST['category']); }
-        $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-        $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-        $content_content = $aj -> formtpa($_POST['data'], "admin");
-        $content_author = ($_POST['content_author'] && $_POST['content_author'] != ARLAN_84 ? $_POST['content_author']."^".$_POST['content_author_email'] : ADMINID);
-        $sql -> db_Update("content", " content_heading='$content_heading', content_subheading='$content_subheading', content_content='$content_content', content_parent='".$_POST['category']."', content_datestamp='".time()."', content_author='$content_author', content_comment='".$_POST['content_comment']."', content_summary='".$_POST['content_summary']."', content_type='3', content_review_score=".$_POST['content_rating'].", content_pe_icon=".$_POST['add_icons'].", content_class='{$_POST['r_class']}' WHERE content_id='".$_POST['content_id']."'");
-        unset($action);
-        $message = REVLAN_3;
-        clear_cache("review");
-}
-
-If(IsSet($_POST['sa_article'])){
-        if($_POST['category'] == -1){ unset($_POST['category']); }
-        $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-        $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-        $content_content = $aj -> formtpa($_POST['data'], "admin");
-        $content_author = ($_POST['content_author'] && $_POST['content_author'] != ARLAN_84 ? $_POST['content_author']."^".$_POST['content_author_email'] : ADMINID);
-        $sql -> db_Update("content", " content_heading='$content_heading', content_subheading='$content_subheading', content_content='$content_content', content_parent='".$_POST['category']."', content_author='$content_author', content_comment='".$_POST['content_comment']."', content_summary='".$_POST['content_summary']."',  content_type='3', content_review_score=".$_POST['content_rating'].", content_pe_icon=".$_POST['add_icons'].", content_class='{$_POST['r_class']}' WHERE content_id='".$_POST['content_id']."'");
-        unset($action);
-        $message = REVLAN_68;
-}
-
-if(IsSet($_POST['updateoptions'])){
-        $pref['review_submit'] = $_POST['review_submit'];
-        $pref['review_submit_class'] = $_POST['review_submit_class'];
-        save_prefs();
-                if($pref['review_submit'] ){
-                        $sql -> db_Update("links", "link_class=".$pref['review_submit_class']." WHERE link_url='subcontent.php?review' ");
-                }else{
-                        $sql -> db_Update("links", "link_class='255' WHERE link_url='subcontent.php?review' ");
-                }
-        $message = REVLAN_61;
-}
-
-if($delete == 'category')
-{
-if($sql -> db_Delete("content", "content_id='$del_id' "))
-        {
-                $message = REVLAN_27;
-                unset($sub_action, $id);
-                $action = "cat";
-        }
-}
-
-if($delete == "main")
-{
-        if($sql -> db_Delete("content", "content_id='$del_id' "))
-        {
-                $message = REVLAN_4;
-                clear_cache("article");
-                unset($action, $sub_action, $id);
-        }
-}
-
-/*
-if($action == "cat" && $sub_action == "confirm"){
-        if($sql -> db_Delete("content", "content_id='$id' ")){
-                $message = REVLAN_27;
-                                unset($sub_action,        $id);
-                                $action = "cat";
-        }
-}
-
-
-if($action == "confirm"){
-        if($sql -> db_Delete("content", "content_id='$sub_action' ")){
-                $message = REVLAN_4;
-                clear_cache("review");
-                                unset($action, $sub_action,        $id);
-        }
-}
-*/
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-
-// ##### Categories ------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if($action == "cat"){
-        $text = "<div style='border : solid 1px #000; padding : 4px; width : auto; height : 100px; overflow : auto; '>\n";
-        if($category_total = $sql -> db_Select("content", "*", "content_type='10' ")){
-                $text .= "<table class='fborder' style='width:100%'>
-                <tr>
-                <td style='width:5%' class='forumheader2'>ID</td>
-                <td style='width:75%' class='forumheader2'>".REVLAN_28."</td>
-                <td style='width:20%; text-align:center' class='forumheader2'>".REVLAN_29."</td>
-                </tr>";
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                                                $delete_heading = str_replace("&#39;", "\'", $content_heading);
-                        $text .= "<tr>
-                        <td style='width:5%; text-align:center' class='forumheader3'>".($content_summary ? "<img src='".e_IMAGE."link_icons/$content_summary' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
-                        <td style='width:75%' class='forumheader3'>$content_heading [$content_subheading]</td>
-                        <td style='width:20%; text-align:center' class='forumheader3'>
-                        ".$rs -> form_button("submit", "category_edit", REVLAN_30, "onclick=\"document.location='".e_SELF."?cat.edit.$content_id'\"")."
-                                                                ".$rs -> form_open("post", e_SELF,"myform_{$content_id}","",""," onsubmit=\"return confirm_('cat','$delete_heading','$content_id')\"")."
-                                                                ".$rs -> form_button("submit", "category_delete_{$content_id}", REVLAN_31)."
-                                                                ".$rs -> form_close()."
-                        </td>
-                        </tr>";
-                }
-                $text .= "
-                </table>";
-        }else{
-                $text .= "<div style='text-align:center'>".REVLAN_32."</div>";
-        }
-        $text .= "</div>";
-        $ns -> tablerender(REVLAN_33, $text);
-
-        $handle=opendir(e_IMAGE."link_icons");
-        while ($file = readdir($handle)){
-                if($file != "." && $file != ".." && $file != "/"){
-                        $iconlist[] = $file;
-                }
-        }
-        closedir($handle);
-
-        unset($content_heading, $content_summary, $content_subheading);
-
-        if($sub_action == "edit"){
-                if($sql -> db_Select("content", "*", "content_id='$id' ")){
-                        $row = $sql -> db_Fetch(); extract($row);
-                }
-        }
-
-        $text = "<div style='text-align:center'>
-        ".$rs -> form_open("post", e_SELF."?cat", "dataform")."
-        <table class='fborder' style='width:auto'>
-        <tr>
-        <td class='forumheader3' style='width:30%'><span class='defaulttext'>".REVLAN_34."</span></td>
-        <td class='forumheader3' style='width:70%'>".$rs -> form_text("category_name", 30, $content_heading, 25)."</td>
-        </tr>
-        <tr>
-        <td class='forumheader3' style='width:30%'><span class='defaulttext'>".REVLAN_35."</span></td>
-        <td class='forumheader3' style='width:70%'>
-        ".$rs -> form_text("category_button", 60, $content_summary, 100)."
-        <br />
-        <input class='button' type ='button' style='cursor:hand' size='30' value='".REVLAN_36."' onclick='expandit(this)' />
-        <div style='display:none;{head} ' >";
-        while(list($key, $icon) = each($iconlist)){
-                $text .= "<a href='javascript:addtext2(\"$icon\")'><img src='".e_IMAGE."link_icons/".$icon."' style='border:0' alt='' /></a> ";
-        }
-        $text .= "</div></td>
-        </tr>
-        <tr>
-        <td class='forumheader3' style='width:30%'><span class='defaulttext'>".REVLAN_37."</span></td>
-        <td class='forumheader3' style='width:70%'>".$rs->form_textarea("category_description", 59, 3, $content_subheading)."</td>
-        </tr>
-        <tr><td colspan='2' style='text-align:center' class='forumheader'>";
-        if($id){
-                $text .= "<input class='button' type='submit' name='update_category' value='".REVLAN_38."' />
-                ".$rs -> form_button("submit", "category_clear", REVLAN_69).
-                $rs -> form_hidden("category_id", $id)."
-                </td></tr>";
-        }else{
-                $text .= "<input class='button' type='submit' name='create_category' value='".REVLAN_39."' /></td></tr>";
-        }
-        $text .= "</table>
-        ".$rs -> form_close()."
-        </div>";
-
-        $ns -> tablerender(REVLAN_39, $text);
-}
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-// ##### Display scrolling list of existing reviews ----------------------------------------------------------------------------------------------------------------------------
-if(!$action || $action == "confirm"){
-        $sql2 = new db;
-        $text = "<div style='border : solid 1px #000; padding : 4px; width : auto; height : 200px; overflow : auto; '>";
-        if($article_total = $sql -> db_Select("content", "*", "content_type='3' ORDER BY content_datestamp DESC")){
-                $text .= "<table class='fborder' style='width:100%'>
-                <tr>
-                <td style='width:5%' class='forumheader2'>&nbsp;</td>
-                <td style='width:50%' class='forumheader2'>".REVLAN_15."</td>
-                <td style='width:45%' class='forumheader2'>".REVLAN_29."</td>
-                </tr>";
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        unset($cs);
-                                                $delete_heading = str_replace("&#39;", "\'", $content_heading);
-                        if($sql2 -> db_Select("content", "content_summary", "content_id=$content_parent")){
-                                $row = $sql2 -> db_Fetch(); $cs = $row[0];
-                        }
-                        $text .= "<tr>
-                        <td style='width:5%; text-align:center' class='forumheader3'>".($cs ? "<img src='".e_IMAGE."link_icons/$cs' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
-                        <td style='width:75%' class='forumheader3'><a href='".e_BASE."content.php?review.$content_id'>$content_heading</a> [".preg_replace("/-.*-/", "", $content_subheading)."]</td>
-                        <td style='width:20%; text-align:center' class='forumheader3'>
-
-                                                                ".$rs -> form_open("post", e_SELF,"myform_{$content_id}","",""," onsubmit=\"return confirm_('create','$delete_heading','$content_id')\"")."
-                                                                <div>".$rs -> form_button("button", "main_edit_{$content_id}", REVLAN_30, "onclick=\"document.location='".e_SELF."?create.edit.$content_id'\"")."
-                                                                ".$rs -> form_button("submit", "main_delete_{$content_id}", REVLAN_31)."</div>
-                                                                ".$rs -> form_close()."
-
-                        </td>
-                        </tr>";
-                }
-// ".$rs -> form_button("submit", "main_edit", REVLAN_30, "onclick=\"document.location='".e_SELF."?create.edit.$content_id'\"")."
-// ".$rs -> form_button("submit", "main_delete", REVLAN_31, "onclick=\"confirm_('create', '$delete_heading', $content_id)\"")."
-                $text .= "</table>";
-        }else{
-                $text .= "<div style='text-align:center'>".REVLAN_40."</div>";
-        }
-        $text .= "</div>";
-        $ns -> tablerender(REVLAN_41, $text);
-}
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-// ##### Display the create review entry screen ------------------------------------------------------------------------------------------------------------------------------
-
-
-if($action == "create"){
-        if($sub_action == "edit"){
-                if($sql -> db_Select("content", "*", "content_id='$id' ")){
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $data = $content_content;
-                        $content_rating = $content_review_score;
-                        $category = $content_parent;
-                        if(is_numeric($content_author)){
-                                $content_author = "";
-                                $content_author_email = "";
-                        }else{
-                                $tmp = explode("^", $content_author);
-                                $content_author = $tmp[0];
-                                $content_author_email = $tmp[1];
-                        }
-                }
-        }
-
-        if($sub_action == "sa" && !$_POST['preview']){
-                if($sql -> db_Select("content", "*", "content_id=$id")){
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $data = $content_content;
-                        $tmp = explode("^", $content_author);
-                        $content_author = $tmp[0];
-                        $content_author_email = $tmp[1];
-                        $content_rating = $content_review_score;
-                }
-        }
-
-        require_once(e_HANDLER."userclass_class.php");
-        $text = "<div style='text-align:center'>
-        ".$rs -> form_open("post", e_SELF."?create", "dataform")."
-
-        <table style='width:95%' class='fborder'>
-
-        <tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'><span style='text-decoration:underline'>".REVLAN_43."</span>:</td>
-        <td style='width:80%' class='forumheader3'>";
-
-        $sql -> db_Select("content", "*", "content_type=10 ");
-        $text .= $rs->form_select_open("category");
-        $text .= (!$category ? $rs -> form_option("- ".REVLAN_44." -", 1, -1) : $rs -> form_option("- ".REVLAN_44." -", 0, -1));
-        while(list($category_id, $category_name) = $sql-> db_Fetch()){
-                $text .= ($category_id == $category ? $rs -> form_option($category_name, 1, $category_id) : $rs -> form_option($category_name, 0, $category_id));
-        }
-        $text .= $rs -> form_select_close()."
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'>".REVLAN_51.":<br /><span class='smalltext'>(".REVLAN_52.")</span></td>
-        <td style='width:80%' class='forumheader3'>
-        <a href=\"javascript:void(0);\" onclick=\"expandit(this);\" >".REVLAN_70."</a>\n
-        <span style=\"display: none;\" >
-                <br /><br />
-                <input class='tbox' type='text' name='content_author' size='60' value='".($content_author ? $content_author : REVLAN_53)."' maxlength='100' ".($content_author ? "" : "onfocus=\"document.dataform.content_author.value='';\"")." /><br />
-        <input class='tbox' type='text' name='content_author_email' size='60' value='".($content_author_email ? $content_author_email : REVLAN_54)."' maxlength='100' ".($content_author_email ? "" : "onfocus=\"document.dataform.content_author_email.value='';\"")." /><br />
-        </span>
-                </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'><span style='text-decoration:underline'>".REVLAN_12."</span>:</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_heading' size='60' value='$content_heading' maxlength='100' />
-
-        </td>
-        </tr>
-        <tr>
-        <td style='width:20%' class='forumheader3'>".REVLAN_13.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_subheading' size='60' value='$content_subheading' maxlength='200' />
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".REVLAN_14.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <textarea class='tbox' name='content_summary' cols='70' rows='5'>$content_summary</textarea>
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'><span style='text-decoration:underline'>".REVLAN_15."</span>: </td>
-        <td style='width:80%' class='forumheader3'>
-        <textarea class='tbox' id='data' name='data' cols='70' rows='30' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$data</textarea>";
-
-            if(!$pref['htmlarea']){
-                $text .="
-                <br />
-                <input class='helpbox' type='text' name='helpb' size='100' />
-                <br />";
-                require_once(e_HANDLER."ren_help.php");
-                $text .= ren_help();
-                }
-        $text .="
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".REVLAN_16.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <select name='content_rating' class='tbox'>
-        <option value='0'>".REVLAN_17." ...</option>";
-        for($a=1; $a<=100; $a++){
-                $text .= ($content_rating == $a ? "<option value='$a' selected='selected'>$a</option>" : "<option value='$a'>$a</option>");
-        }
-        $text .= "</select>
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".REVLAN_18.":</td>
-        <td style='width:80%' class='forumheader3'>
-        ";
-
-
-        if($content_comment == "0"){
-                $text .= REVLAN_19.": <input type='radio' name='content_comment' value='1' />
-                ".REVLAN_20.": <input type='radio' name='content_comment' value='0' checked='checked' />";
-        }else{
-                $text .= REVLAN_19.": <input type='radio' name='content_comment' value='1' checked='checked' />
-                ".REVLAN_20.": <input type='radio' name='content_comment' value='0' />";
-        }
-
-        $text .= "</td></tr>";
-
-        $text.="
-        <tr>
-        <td  class='forumheader3'>".REVLAN_71.":&nbsp;&nbsp;</td><td class='forumheader3'>".
-        ($content_pe_icon ? REVLAN_72.": <input type='radio' name='add_icons' value='1' checked='checked' />".REVLAN_73.": <input type='radio' name='add_icons' value='0' />" : REVLAN_72.": <input type='radio' name='add_icons' value='1' />".REVLAN_73.": <input type='radio' name='add_icons' value='0' checked='checked' />")."
-        </td>
-        </tr>
-
-        <tr><td style='width:20%' class='forumheader3'>".REVLAN_21.":</td>
-        <td style='width:80%' class='forumheader3'>".r_userclass("r_class",$content_class)."
-        ";
-
-        $text.="</td></tr>
-        <tr style='vertical-align:top'>
-        <td colspan='2' style='text-align:center' class='forumheader'>
-        ";
-
-
-        if($sub_action == "edit"){
-                $text .= "<input class='button' type='submit' name='update_review' value='".REVLAN_22."' />
-                <input type='hidden' name='content_id' value='$id'>";
-        }else if($sub_action == "sa"){
-                $text .= "<input class='button' type='submit' name='sa_article' value='".REVLAN_67."' />
-                <input type='hidden' name='content_id' value='$id'>";
-        }else{
-                $text .= "<input class='button' type='submit' name='create_review' value='".REVLAN_23."' />";
-        }
-
-        $text .= "</td>
-        </tr>
-        </table>
-        </form>
-        </div>";
-
-        $ns -> tablerender("<div style='text-align:center'>".REVLAN_24."</div>", $text);
-
-}
-
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if($action == "opt"){
-        global $pref, $ns;
-        $text = "<div style='text-align:center'>
-        <form method='post' action='".e_SELF."?".e_QUERY."'>\n
-        <table style='width:auto' class='fborder'>
-        <tr>
-
-        <td style='width:70%' class='forumheader3'>
-        ".REVLAN_55."<br />
-        <span class='smalltext'>".REVLAN_56."</span>
-        </td>
-        <td class='forumheader2' style='width:30%;text-align:center'>".
-        ($pref['review_submit'] ? "<input type='checkbox' name='review_submit' value='1' checked='checked' />" : "<input type='checkbox' name='review_submit' value='1' />")."
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:70%' class='forumheader3'>
-        ".REVLAN_57."<br />
-        <span class='smalltext'>".REVLAN_58."</span>
-        </td>
-        <td class='forumheader2' style='width:30%;text-align:center'>".r_userclass("review_submit_class", $pref['review_submit_class'])."</td>
-        </tr>
-
-        <tr style='vertical-align:top'>
-        <td colspan='2'  style='text-align:center' class='forumheader'>
-        <input class='button' type='submit' name='updateoptions' value='".REVLAN_59."' />
-        </td>
-        </tr>
-
-        </table>
-        </form>
-        </div>";
-        $ns -> tablerender(REVLAN_60, $text);
-}
-
-
-if($action == "sa"){
-        global $sql, $rs, $ns, $aj;
-        $text = "<div style='border : solid 1px #000; padding : 4px; width :auto; height : 200px; overflow : auto; '>\n";
-        if($article_total = $sql -> db_Select("content", "*", "content_type=16")){
-                $text .= "<table class='fborder' style='width:100%'>
-                <tr>
-                <td style='width:5%' class='forumheader2'>ID</td>
-                <td style='width:75%' class='forumheader2'>".REVLAN_65."</td>
-                <td style='width:20%; text-align:center' class='forumheader2'>".REVLAN_29."</td>
-                </tr>";
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        $tmp = explode("^", $content_author);
-                        $content_author = $tmp[0];
-                        $content_author_email = ($tmp[1] ? $tmp[1] : ARLAN_95);
-                        $text .= "<tr>
-                        <td style='width:5%; text-align:center; vertical-align:top' class='forumheader3'>$content_id</td>
-                        <td style='width:75%' class='forumheader3'><b>".$aj -> tpa($content_heading)."</b> [".$aj -> tpa($content_subheading)."]<br />$content_author ($content_author_email)</td>
-                        <td style='width:20%; text-align:center; vertical-align:top' class='forumheader3'>
-                        ".$rs -> form_button("submit", "category_edit", REVLAN_66, "onclick=\"document.location='".e_SELF."?create.sa.$content_id'\"")."
-                        ".$rs -> form_button("submit", "category_delete", REVLAN_9, "onclick=\"confirm_('sa', $content_id);\"")."
-                        </td>
-                        </tr>\n";
-                }
-                $text .= "</table>";
-        }else{
-                $text .= "<div style='text-align:center'>".REVLAN_63."</div>";
-        }
-        $text .= "</div>";
-        $ns -> tablerender(REVLAN_62, $text);
-}
-
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-function review_adminmenu(){
-
-                global $action,$sql;
-                $act=$action;
-                if($act==""){$act="main";}
-                $var['main']['text']=REVLAN_45;
-                $var['main']['link']=e_SELF;
-
-                $var['create']['text']=REVLAN_46;
-                $var['create']['link']=e_SELF."?create";
-
-                $var['cat']['text']=REVLAN_47;
-                $var['cat']['link']=e_SELF."?cat";
-
-                $var['opt']['text']=REVLAN_29;
-                $var['opt']['link']=e_SELF."?opt";
-                if($sql -> db_Select("content", "*", "content_type ='16' ")){
-                        $var['sa']['text']=REVLAN_62;
-                        $var['sa']['link']=e_SELF."?sa";
-                }
-
-                show_admin_menu(REVLAN_48,$act,$var);
-}
-
-require_once("footer.php");
-
-function headerjs(){
-global $etp;
-$script = "<script type=\"text/javascript\">
-function addtext2(sc){
-        document.getElementById('dataform').category_button.value = sc;
-}
-</script>\n";
-
-
-
-
-$script .= "<script type=\"text/javascript\">
-function confirm_(mode, content_heading, content_id){
-        if(mode == 'cat'){
-                return confirm(\"".$etp->unentity(REVLAN_49)." [ID \" + content_id + \": \" + content_heading + \"]\");
-        }else{
-                return confirm(\"".$etp->unentity(REVLAN_50)." [ID \" + content_id + \": \" + content_heading + \"]\");
-        }
-}
-</script>";
-return $script;
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/review.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/25 01:26:59 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+header('Location: admin.php');
+exit;
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/search.php 75/e107_admin/search.php
--- 6171/e107_admin/search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/search.php	2006-01-16 09:06:30.000000000 -0600
@@ -0,0 +1,405 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/search.php,v $
+|     $Revision: 1.33 $
+|     $Date: 2006/01/16 15:06:30 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+require_once('../class2.php');
+if (!getperms('X')) {
+	header('location:'.e_BASE.'index.php');
+	exit;
+}
+$e_sub_cat = 'search';
+require_once('auth.php');
+require_once(e_HANDLER.'userclass_class.php');
+
+$query = explode('.', e_QUERY);
+
+$search_prefs = $sysprefs -> getArray('search_prefs');
+
+$search_handlers['news'] = ADLAN_0;
+$search_handlers['comments'] = SEALAN_6;
+$search_handlers['users'] = SEALAN_7;
+$search_handlers['downloads'] = ADLAN_24;
+$search_handlers['pages'] = SEALAN_39;
+
+preg_match("/^(.*?)($|-)/", mysql_get_server_info(), $mysql_version);
+if (version_compare($mysql_version[1], '4.0.1', '<')) {
+	$mysql_supported = false;
+} else {
+	$mysql_supported = true;
+}
+
+$handle = opendir(e_PLUGIN);
+while (false !== ($file = readdir($handle))) {
+	if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)) {
+		if ($sql -> db_Select("plugin", "plugin_path", "plugin_path='".$file."' AND plugin_installflag='1'")) {
+			if (is_readable(e_PLUGIN.$file."/e_search.php") && !isset($search_prefs['plug_handlers'][$file])) {
+				$search_prefs['plug_handlers'][$file] = array('class' => 0, 'pre_title' => 1, 'pre_title_alt' => '', 'chars' => 150, 'results' => 10);
+				$save_search = TRUE;
+			}
+			if (is_readable(e_PLUGIN.$file.'/search/search_comments.php') && !isset($search_prefs['comments_handlers'][$file])) {
+				include_once(e_PLUGIN.$file.'/search/search_comments.php');
+				$search_prefs['comments_handlers'][$file] = array('id' => $comments_type_id, 'class' => '0', 'dir' => $file);
+				unset($comments_type_id);
+				$save_search = TRUE;
+			}
+		}
+	}
+}
+closedir($handle);
+
+if (!isset($search_prefs['boundary'])) {
+	$search_prefs['boundary'] = 1;
+	$save_search = TRUE;
+}
+
+if ($save_search) {
+	$serialpref = addslashes(serialize($search_prefs));
+	$sql -> db_Update("core", "e107_value='".$serialpref."' WHERE e107_name='search_prefs'");
+}
+
+if (isset($_POST['update_main'])) {
+	foreach($search_handlers as $s_key => $s_value) {
+		$search_prefs['core_handlers'][$s_key]['class'] = $_POST['core_handlers'][$s_key]['class'];
+		$search_prefs['core_handlers'][$s_key]['order'] = $_POST['core_handlers'][$s_key]['order'];
+	}
+
+	foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) {
+		$search_prefs['plug_handlers'][$plug_dir]['class'] = $_POST['plug_handlers'][$plug_dir]['class'];
+		$search_prefs['plug_handlers'][$plug_dir]['order'] = $_POST['plug_handlers'][$plug_dir]['order'];
+	}
+
+	foreach ($search_prefs['comments_handlers'] as $key => $value) {
+		$search_prefs['comments_handlers'][$key]['class'] = $_POST['comments_handlers'][$key]['class'];
+	}
+	
+	$search_prefs['google'] = $_POST['google'];
+
+	$tmp = addslashes(serialize($search_prefs));
+	admin_update($sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'"));
+}
+
+if (isset($_POST['update_handler'])) {
+	if ($query[1] == 'c') {
+		$handler_type = 'core_handlers';
+	} else if ($query[1] == 'p') {
+		$handler_type = 'plug_handlers';
+	}
+	$search_prefs[$handler_type][$query[2]]['class'] = $_POST['class'];
+	$search_prefs[$handler_type][$query[2]]['chars'] = $tp -> toDB($_POST['chars']);
+	$search_prefs[$handler_type][$query[2]]['results'] = $tp -> toDB($_POST['results']);
+	$search_prefs[$handler_type][$query[2]]['pre_title'] = $_POST['pre_title'];
+	$search_prefs[$handler_type][$query[2]]['pre_title_alt'] = $tp -> toDB($_POST['pre_title_alt']);
+
+	$tmp = addslashes(serialize($search_prefs));
+	admin_update($sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'"));
+}
+
+if (isset($_POST['update_prefs'])) {
+	$search_prefs['relevance'] = $_POST['relevance'];
+	$search_prefs['user_select'] = $_POST['user_select'];
+	$search_prefs['multisearch'] = $_POST['multisearch'];
+	$search_prefs['selector'] = $_POST['selector'];
+	$search_prefs['time_restrict'] = $_POST['time_restrict'];
+	$search_prefs['time_secs'] = $_POST['time_secs'] > 300 ? 300 : $tp -> toDB($_POST['time_secs']);
+	if ($_POST['search_sort'] == 'mysql') {
+		if ($mysql_supported) {
+			$search_prefs['mysql_sort'] = TRUE;
+		} else {
+			$search_prefs['mysql_sort'] = FALSE;
+			$ns -> tablerender(LAN_ERROR, "<div style='text-align:center'><b>".SEALAN_33."<br />".SEALAN_34." ".$mysql_version[1]."</b></div>");
+		}
+	} else {
+		$search_prefs['mysql_sort'] = FALSE;
+	}
+	$search_prefs['php_limit'] = $tp -> toDB($_POST['php_limit']);
+	$search_prefs['boundary'] = $_POST['boundary'];
+
+	$tmp = addslashes(serialize($search_prefs));
+	admin_update($sql -> db_Update("core", "e107_value='".$tmp."' WHERE e107_name='search_prefs'"));
+
+	$pref['search_restrict'] = $_POST['search_restrict'];
+	$pref['search_highlight'] = $_POST['search_highlight'];
+	save_prefs();
+}
+
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+
+$handlers_total = count($search_prefs['core_handlers']) + count($search_prefs['plug_handlers']);
+
+if ($query[0] == 'settings') {
+	$text = "<form method='post' action='".e_SELF."?settings'><div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>";
+	
+	$text .= "<tr>
+	<td class='fcaption' colspan='2'>".SEALAN_20."</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_15.": </td>
+	<td style='width:50%' class='forumheader3'>
+	".r_userclass("search_restrict", $pref['search_restrict'], "off", "public,guest,nobody,member,admin,classes")."
+	</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_30."</td>
+	<td style='width:50%;' colspan='2' class='forumheader3'>
+	<input type='radio' name='search_highlight' value='1'".($pref['search_highlight'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
+	<input type='radio' name='search_highlight' value='0'".(!$pref['search_highlight'] ? " checked='checked'" : "")." /> ".SEALAN_17."
+	</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_10."</td>
+	<td style='width:50%;' colspan='2' class='forumheader3'>
+	<input type='radio' name='relevance' value='1'".($search_prefs['relevance'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
+	<input type='radio' name='relevance' value='0'".(!$search_prefs['relevance'] ? " checked='checked'" : "")." /> ".SEALAN_17."
+	</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_11."</td>
+	<td style='width:50%;' colspan='2' class='forumheader3'>
+	<input type='radio' name='user_select' value='1'".($search_prefs['user_select'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
+	<input type='radio' name='user_select' value='0'".(!$search_prefs['user_select'] ? " checked='checked'" : "")." /> ".SEALAN_17."
+	</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_19."</td>
+	<td style='width:50%;' colspan='2' class='forumheader3'>
+	<input type='radio' name='multisearch' value='1'".($search_prefs['multisearch'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
+	<input type='radio' name='multisearch' value='0'".(!$search_prefs['multisearch'] ? " checked='checked'" : "")." /> ".SEALAN_17."
+	</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_35."</td>
+	<td style='width:50%;' colspan='2' class='forumheader3'>
+	<input type='radio' name='selector' value='2'".($search_prefs['selector'] == '2' ? " checked='checked'" : "")." /> ".SEALAN_36."&nbsp;&nbsp;
+	<input type='radio' name='selector' value='1'".($search_prefs['selector'] == '1' ? " checked='checked'" : "")." /> ".SEALAN_37."&nbsp;&nbsp;
+	<input type='radio' name='selector' value='0'".($search_prefs['selector'] == '0' ? " checked='checked'" : "")." /> ".SEALAN_38."
+	</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_12."</td>
+	<td style='width:50%' colspan='2' class='forumheader3'>
+	<input type='radio' name='time_restrict' value='0'".(!$search_prefs['time_restrict'] ? " checked='checked'" : "")." /> ".SEALAN_17."&nbsp;&nbsp;
+	<input type='radio' name='time_restrict' value='1'".($search_prefs['time_restrict'] ? " checked='checked'" : "")." />
+	".SEALAN_13." ".$rs -> form_text("time_secs", 3, $tp -> toForm($search_prefs['time_secs']), 3)." ".SEALAN_14."</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td class='forumheader3' style='width:50%'>".SEALAN_3."<br />".SEALAN_49."</td>
+	<td colspan='2' class='forumheader3' style='width:50%'>
+	".$rs -> form_radio('search_sort', 'mysql', ($search_prefs['mysql_sort'] == TRUE ? 1 : 0), 'MySql', ($mysql_supported ? "" : "disabled='true'"))."MySql<br />
+	".$rs -> form_radio('search_sort', 'php', ($search_prefs['mysql_sort'] == TRUE ? 0 : 1)).SEALAN_31." 
+	".$rs -> form_text("php_limit", 5, $tp -> toForm($search_prefs['php_limit']), 5)." ".SEALAN_32." 
+	</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_47."<br />".SEALAN_48."</td>
+	<td style='width:50%;' colspan='2' class='forumheader3'>
+	<input type='radio' name='boundary' value='1'".($search_prefs['boundary'] ? " checked='checked'" : "")." /> ".SEALAN_16."&nbsp;&nbsp;
+	<input type='radio' name='boundary' value='0'".(!$search_prefs['boundary'] ? " checked='checked'" : "")." /> ".SEALAN_17."
+	</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button("submit", "update_prefs", LAN_UPDATE)."</td>
+	</tr>";
+	
+	$text .= "</table>
+	</div></form>";
+
+} else if ($query[0] == 'edit') {
+	if ($query[1] == 'c') {
+		$handlers = $search_handlers;
+		$handler_type = 'core_handlers';
+	} else if ($query[1] == 'p') {
+		$handlers = $search_prefs['plug_handlers'];
+		$handler_type = 'plug_handlers';
+	}
+	
+	$text = "<form method='post' action='".e_SELF."?main.".$query[1].".".$query[2]."'>
+	<div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>";
+	
+	$text .= "<tr>
+	<td class='fcaption' colspan='2'>".SEALAN_43.": ".$handlers[$query[2]]."</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_44.":</td>
+	<td style='width:50%' class='forumheader3'>";
+	$text .= r_userclass("class", $search_prefs[$handler_type][$query[2]]['class'], "off", "public,guest,nobody,member,admin,classes");
+	$text .= "</td>
+	</tr><tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_45.":</td>
+	<td style='width:5%' class='forumheader3'>".$rs -> form_text("results", 4, $tp -> toForm($search_prefs[$handler_type][$query[2]]['results']), 4)."</td>
+	</tr><tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_46.":</td>
+	<td style='width:5' class='forumheader3'>".$rs -> form_text("chars", 4, $tp -> toForm($search_prefs[$handler_type][$query[2]]['chars']), 4)."</td>
+	</tr><tr>
+	<td style='width:50%' class='forumheader3'>".SEALAN_26.":</td>
+	<td style='width:35%' class='forumheader3'>
+	<input type='radio' name='pre_title' value='1'".(($search_prefs[$handler_type][$query[2]]['pre_title'] == 1) ? " checked='checked'" : "")." /> ".SEALAN_22."<br />
+	<input type='radio' name='pre_title' value='0'".(($search_prefs[$handler_type][$query[2]]['pre_title'] == 0) ? " checked='checked'" : "")." /> ".SEALAN_17."<br />
+	<input type='radio' name='pre_title' value='2'".(($search_prefs[$handler_type][$query[2]]['pre_title'] == 2) ? " checked='checked'" : "")." /> ".SEALAN_23."&nbsp;&nbsp;
+	".$rs -> form_text("pre_title_alt", 20, $tp -> toForm($search_prefs[$handler_type][$query[2]]['pre_title_alt']))."
+	</td>
+	</tr>";
+
+	$text .= "<tr>
+	<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button("submit", "update_handler", LAN_UPDATE)."</td>
+	</tr>";
+	
+	$text .= "</table>
+	</div>
+	</form>";
+
+} else {
+
+	$text = "<form method='post' action='".e_SELF."'><div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>";
+	
+	$text .= "<tr>
+	<td class='fcaption' colspan='4'>".SEALAN_21."</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td class='forumheader'>".SEALAN_24."</td>
+	<td class='forumheader'>".SEALAN_25."</td>
+	<td class='forumheader'>".LAN_ORDER."</td>
+	<td class='forumheader'>".LAN_EDIT."</td>
+	</tr>";
+	
+	foreach($search_handlers as $key => $value) {
+		$text .= "<tr>
+		<td style='width:55%; white-space:nowrap' class='forumheader3'>".$value."</td>
+		<td style='width:25%' class='forumheader3'>";
+		$text .= r_userclass("core_handlers[".$key."][class]", $search_prefs['core_handlers'][$key]['class'], "off", "public,guest,nobody,member,admin,classes");
+		$text .= "</td>";
+		$text .= "<td style='width:10%; text-align:center' class='forumheader3'>";
+		$text .= "<select name='core_handlers[".$key."][order]' class='tbox'>";
+		for($a = 1; $a <= $handlers_total; $a++) {
+			$text .= ($search_prefs['core_handlers'][$key]['order'] == $a) ? "<option value='".$a."' selected='selected'>".$a."</option>" : "<option value='".$a."'>".$a."</option>";
+		}
+		$text .= "</select>
+		</td>
+		<td style='width:10%; text-align:center' class='forumheader3'>
+		<a href='".e_SELF."?edit.c.".$key."'>".ADMIN_EDIT_ICON."</a>
+		</td>
+		</tr>";
+	}
+	
+	foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) {
+		require_once(e_PLUGIN.$plug_dir."/e_search.php");
+		$text .= "<tr>
+		<td style='width:55%; white-space:nowrap' class='forumheader3'>".$search_info[0]['qtype']."</td>
+		<td style='width:25%' class='forumheader3'>";
+		$text .= r_userclass("plug_handlers[".$plug_dir."][class]", $search_prefs['plug_handlers'][$plug_dir]['class'], "off", "public,guest,nobody,member,admin,classes");
+		unset($search_info);
+		$text .= "</td>";
+		$text .= "<td style='width:10%; text-align:center' class='forumheader3'>";
+		$text .= "<select name='plug_handlers[".$plug_dir."][order]' class='tbox'>";
+		for($a = 1; $a <= $handlers_total; $a++) {
+			$text .= ($search_prefs['plug_handlers'][$plug_dir]['order'] == $a) ? "<option value='".$a."' selected='selected'>".$a."</option>" : "<option value='".$a."'>".$a."</option>";
+		}
+		$text .= "</select>
+		</td>
+		<td style='width:10%; text-align:center' class='forumheader3'>
+		<a href='".e_SELF."?edit.p.".$plug_dir."'>".ADMIN_EDIT_ICON."</a>
+		</td>
+		</tr>";
+	}
+	
+	$text .= "<tr>
+	<td style='white-space:nowrap' class='forumheader3'>Google</td>
+	<td colspan='3' class='forumheader3'>";
+	$sel = (isset($search_prefs['google']) && $search_prefs['google']) ? " checked='checked'" : "";
+	$text .= r_userclass("google", $search_prefs['google'], "off", "public,guest,nobody,member,admin,classes");
+	$text .= "</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td colspan='4' style='text-align:center' class='forumheader'>".$rs -> form_button("submit", "update_main", LAN_UPDATE)."</td>
+	</tr>";
+	
+	$text .= "</table>
+	</div><br />";
+	
+	$text .= "<div style='text-align:center'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>";
+	
+	$text .= "<tr>
+	<td class='fcaption' colspan='2'>".SEALAN_18."</td>
+	</tr>";
+	
+	$text .= "<tr>
+	<td class='forumheader'>".SEALAN_24."</td>
+	<td class='forumheader'>".SEALAN_25."</td>
+	</tr>";
+	
+	foreach ($search_prefs['comments_handlers'] as $key => $value) {
+		$path = ($value['dir'] == 'core') ? e_HANDLER.'search/comments_'.$key.'.php' : e_PLUGIN.$value['dir'].'/search/search_comments.php';
+		require_once($path);
+		$text .= "<tr>
+		<td style='width:55%; white-space:nowrap' class='forumheader3'>".$comments_title."</td>
+		<td style='width:45%' class='forumheader3'>";
+		$text .= r_userclass("comments_handlers[".$key."][class]", $search_prefs['comments_handlers'][$key]['class'], "off", "public,guest,nobody,member,admin,classes");
+		$text .= "</td>
+		</tr>";
+		unset($comments_title);
+	}
+	
+	$text .= "<tr>
+	<td colspan='2' style='text-align:center' class='forumheader'>".$rs -> form_button("submit", "update_main", LAN_UPDATE)."</td>
+	</tr>";
+	
+	$text .= "</table>
+	</div>
+	</form>";
+
+}
+
+$ns -> tablerender(SEALAN_1, $text);
+
+require_once("footer.php");
+
+function search_adminmenu() {
+	global $query;
+	if ($query[0] == '' || $query[0] == 'main') {
+		$action = "main";
+	} else if ($query[0] == 'settings') {
+		$action = "settings";
+	}
+	
+	$var['main']['text'] = SEALAN_41;
+	$var['main']['link'] = e_SELF;
+
+	$var['settings']['text'] = SEALAN_42;
+	$var['settings']['link'] = e_SELF."?settings";
+
+	show_admin_menu(SEALAN_40, $action, $var);
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/sql/core_pg.php 75/e107_admin/sql/core_pg.php
--- 6171/e107_admin/sql/core_pg.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/sql/core_pg.php	2005-12-24 19:33:05.000000000 -0600
@@ -0,0 +1,298 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/sql/core_pg.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/25 01:33:05 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+header("location:../index.php");
+exit;
+?>
+
+CREATE SEQUENCE banner_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE chatbox_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE comments_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE content_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE download_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE download_category_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE forum_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE forum_t_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE headlines_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE links_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE menus_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE news_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE news_category_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE plugin_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE poll_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+CREATE SEQUENCE rate_seq start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1;
+
+
+
+
+
+CREATE TABLE banlist (
+  banlist_ip varchar(100) NOT NULL,
+  banlist_admin int4 DEFAULT '0' NOT NULL,
+  banlist_reason text NOT NULL,
+  CONSTRAINT banlist_pkey PRIMARY KEY (banlist_ip)
+);
+
+CREATE TABLE banner (
+  banner_id int4 NOT NULL,
+  banner_clientname varchar(100) DEFAULT '' NOT NULL,
+  banner_clientlogin varchar(20) DEFAULT '' NOT NULL,
+  banner_clientpassword varchar(50) DEFAULT '' NOT NULL,
+  banner_image varchar(150) DEFAULT '' NOT NULL,
+  banner_clickurl varchar(150) DEFAULT '' NOT NULL,
+  banner_impurchased int4 DEFAULT '0' NOT NULL,
+  banner_startdate int4 DEFAULT '0' NOT NULL,
+  banner_enddate int4 DEFAULT '0' NOT NULL,
+  banner_active int2 DEFAULT '0' NOT NULL,
+  banner_clicks int4 DEFAULT '0' NOT NULL,
+  banner_impressions int4 DEFAULT '0' NOT NULL,
+  banner_ip text NOT NULL,
+  banner_campaign varchar(150) DEFAULT '' NOT NULL,
+  CONSTRAINT banner_pkey PRIMARY KEY (banner_id)
+);
+
+CREATE TABLE chatbox (
+  cb_id int4 NOT NULL,
+  cb_nick varchar(30) DEFAULT '' NOT NULL,
+  cb_message text NOT NULL,
+  cb_datestamp int4 DEFAULT '0' NOT NULL,
+  cb_blocked int2 DEFAULT '0' NOT NULL,
+  cb_ip varchar(15) DEFAULT '' NOT NULL,
+  CONSTRAINT chatbox_pkey PRIMARY KEY (cb_id)
+);
+
+CREATE TABLE comments (
+  comment_id int4 DEFAULT '0' NOT NULL,
+  comment_pid int4 DEFAULT '0' NOT NULL,
+  comment_item_id int4 DEFAULT '0' NOT NULL,
+  comment_subject varchar(100) DEFAULT '' NOT NULL,
+  comment_author varchar(100) DEFAULT '' NOT NULL,
+  comment_author_email varchar(200) DEFAULT '' NOT NULL,
+  comment_datestamp int4 DEFAULT '0' NOT NULL,
+  comment_comment text NOT NULL,
+  comment_blocked int2 DEFAULT '0' NOT NULL,
+  comment_ip varchar(20) DEFAULT '' NOT NULL,
+  comment_type varchar(10) DEFAULT '' NOT NULL,
+  CONSTRAINT comments_pkey PRIMARY KEY (comment_id)
+);
+
+CREATE TABLE content (
+  content_id int4 DEFAULT '0' NOT NULL,
+  content_heading text NOT NULL,
+  content_subheading text NOT NULL,
+  content_content text NOT NULL,
+  content_parent int4 DEFAULT '0' NOT NULL,
+  content_datestamp int4 DEFAULT '0' NOT NULL,
+  content_author varchar(200) DEFAULT '' NOT NULL,
+  content_comment int2 DEFAULT '0' NOT NULL,
+  content_summary text NOT NULL,
+  content_type int2 DEFAULT '0' NOT NULL,
+  content_review_score int2 DEFAULT '0' NOT NULL,
+  content_pe_icon int2 DEFAULT '0' NOT NULL,
+  content_class int2 DEFAULT '0' NOT NULL,
+  CONSTRAINT content_pkey PRIMARY KEY (content_id)
+);
+
+CREATE TABLE core (
+  e107_name varchar(20) DEFAULT '' NOT NULL,
+  e107_value text NOT NULL,
+  CONSTRAINT core_pkey PRIMARY KEY (e107_name)
+);
+
+CREATE TABLE download (
+  download_id int4 DEFAULT '0' NOT NULL,
+  download_name varchar(100) DEFAULT '' UNIQUE NOT NULL,
+  download_url varchar(150) DEFAULT '' NOT NULL,
+  download_author varchar(100) DEFAULT '' NOT NULL,
+  download_author_email varchar(200) DEFAULT '' NOT NULL,
+  download_author_website varchar(200) DEFAULT '' NOT NULL,
+  download_description text NOT NULL,
+  download_filesize varchar(20) DEFAULT '' NOT NULL,
+  download_requested int4 DEFAULT '0' NOT NULL,
+  download_category int4 DEFAULT '0' NOT NULL,
+  download_active int2 DEFAULT '0' NOT NULL,
+  download_datestamp int4 DEFAULT '0' NOT NULL,
+  download_thumb varchar(150) DEFAULT '' NOT NULL,
+  download_image varchar(150) DEFAULT '' NOT NULL,
+  download_comment int2 DEFAULT '0' NOT NULL,
+  CONSTRAINT download_pkey PRIMARY KEY (download_id)
+);
+
+CREATE TABLE download_category (
+  download_category_id int4 DEFAULT '0' NOT NULL,
+  download_category_name varchar(100) DEFAULT '' NOT NULL,
+  download_category_description text NOT NULL,
+  download_category_icon varchar(100) DEFAULT '' NOT NULL,
+  download_category_parent int4 DEFAULT '0' NOT NULL,
+  download_category_class varchar(100) DEFAULT '' NOT NULL,
+  CONSTRAINT download_category_pkey PRIMARY KEY (download_category_id)
+);
+
+CREATE TABLE flood (
+  flood_url text NOT NULL,
+  flood_time int4 DEFAULT '0' NOT NULL,
+);
+
+CREATE TABLE forum (
+  forum_id int4 DEFAULT '0' NOT NULL,
+  forum_name varchar(250) DEFAULT '' NOT NULL,
+  forum_description text NOT NULL,
+  forum_parent int4 DEFAULT '0' NOT NULL,
+  forum_datestamp int4 DEFAULT '0' NOT NULL,
+  forum_moderators text NOT NULL,
+  forum_threads int4 DEFAULT '0' NOT NULL,
+  forum_replies int4 DEFAULT '0' NOT NULL,
+  forum_lastpost varchar(200) DEFAULT '' NOT NULL,
+  forum_class varchar(100) DEFAULT '' NOT NULL,
+  forum_order int4 DEFAULT '0' NOT NULL,
+  CONSTRAINT forum_pkey PRIMARY KEY (forum_id)
+);
+
+CREATE TABLE forum_t (
+  thread_id int4 DEFAULT '0' NOT NULL,
+  thread_name varchar(250) DEFAULT '' NOT NULL,
+  thread_thread text NOT NULL,
+  thread_forum_id int4 DEFAULT '0' NOT NULL,
+  thread_datestamp int4 DEFAULT '0' NOT NULL,
+  thread_parent int4 DEFAULT '0' NOT NULL,
+  thread_user varchar(250) DEFAULT '' NOT NULL,
+  thread_views int4 DEFAULT '0' NOT NULL,
+  thread_active int2 DEFAULT '0' NOT NULL,
+  thread_lastpost int4 DEFAULT '0' NOT NULL,
+  thread_s int2 DEFAULT '0' NOT NULL,
+  CONSTRAINT forum_t_pkey PRIMARY KEY (thread_id)
+);
+
+CREATE TABLE headlines (
+  headline_id int4 DEFAULT '0' NOT NULL,
+  headline_url varchar(150) DEFAULT '' NOT NULL,
+  headline_data text NOT NULL,
+  headline_timestamp int4 DEFAULT '0' NOT NULL,
+  headline_description text NOT NULL,
+  headline_image varchar(100) DEFAULT '' NOT NULL,
+  headline_active int2 DEFAULT '0' NOT NULL,
+  CONSTRAINT headlines_pkey PRIMARY KEY (headline_id)
+);
+
+CREATE TABLE links (
+  link_id int4 DEFAULT '0' NOT NULL,
+  link_name varchar(100) DEFAULT '' NOT NULL,
+  link_url varchar(200) DEFAULT '' NOT NULL,
+  link_description text NOT NULL,
+  link_button varchar(100) DEFAULT '' NOT NULL,
+  link_category int2 DEFAULT '0' NOT NULL,
+  link_order int4 DEFAULT '0' NOT NULL,
+  link_refer int4 DEFAULT '0' NOT NULL,
+  link_open int2 DEFAULT '0' NOT NULL,
+  link_class int2 DEFAULT '0' NOT NULL,
+  CONSTRAINT links_pkey PRIMARY KEY (link_id)
+);
+
+CREATE TABLE menus (
+  menu_id int4 DEFAULT '0' NOT NULL,
+  menu_name varchar(100) DEFAULT '' NOT NULL,
+  menu_location int2 DEFAULT '0' NOT NULL,
+  menu_order int2 DEFAULT '0' NOT NULL,
+  menu_class int2 DEFAULT '0' NOT NULL,
+  menu_pages text NOT NULL,
+  CONSTRAINT menus_pkey PRIMARY KEY (menu_id)
+);
+
+CREATE TABLE news (
+  news_id int4 DEFAULT '0' NOT NULL,
+  news_title varchar(200) DEFAULT '' NOT NULL,
+  news_body text NOT NULL,
+  news_extended text NOT NULL,
+  news_datestamp int4 DEFAULT '0' NOT NULL,
+  news_author int4 DEFAULT '0' NOT NULL,
+  news_category int2 DEFAULT '0' NOT NULL,
+  news_allow_comments int2 DEFAULT '0' NOT NULL,
+  news_start int4 DEFAULT '0' NOT NULL,
+  news_end int4 DEFAULT '0' NOT NULL,
+  news_class int2 DEFAULT '0' NOT NULL,
+  news_render_type int2 DEFAULT '0' NOT NULL,
+  news_comment_total int4 DEFAULT '0' NOT NULL,
+  CONSTRAINT news_pkey PRIMARY KEY (news_id)
+);
+
+CREATE TABLE news_category (
+  category_id int4 DEFAULT '0' NOT NULL,
+  category_name varchar(200) DEFAULT '' NOT NULL,
+  category_icon varchar(250) DEFAULT '' NOT NULL,
+  CONSTRAINT news_category_pkey PRIMARY KEY (category_id)
+);
+
+CREATE TABLE online (
+  online_timestamp int4 DEFAULT '0' NOT NULL,
+  online_flag int2 DEFAULT '0' NOT NULL,
+  online_user_id varchar(100) DEFAULT '' NOT NULL,
+  online_ip varchar(15) DEFAULT '' NOT NULL,
+  online_location varchar(100) DEFAULT '' NOT NULL,
+  online_pagecount tinyint(3) int2 DEFAULT '0' NOT NULL,
+);
+
+CREATE TABLE plugin (
+  plugin_id int4 DEFAULT '0' NOT NULL,
+  plugin_name varchar(100) DEFAULT '' NOT NULL,
+  plugin_version varchar(10) DEFAULT '' NOT NULL,
+  plugin_path varchar(100) DEFAULT '' NOT NULL,
+  plugin_installflag int2 DEFAULT '0' NOT NULL,
+  CONSTRAINT plugin_pkey PRIMARY KEY (plugin_id)
+);
+
+CREATE TABLE poll (
+  poll_id int4 DEFAULT '0' NOT NULL,
+  poll_datestamp int4 DEFAULT '0' NOT NULL,
+  poll_end_datestamp int4 DEFAULT '0' NOT NULL,
+  poll_admin_id int4 DEFAULT '0' NOT NULL,
+  poll_title varchar(250) DEFAULT '' NOT NULL,
+  poll_option_1 varchar(250) DEFAULT '' NOT NULL,
+  poll_option_2 varchar(250) DEFAULT '' NOT NULL,
+  poll_option_3 varchar(250) DEFAULT '' NOT NULL,
+  poll_option_4 varchar(250) DEFAULT '' NOT NULL,
+  poll_option_5 varchar(250) DEFAULT '' NOT NULL,
+  poll_option_6 varchar(250) DEFAULT '' NOT NULL,
+  poll_option_7 varchar(250) DEFAULT '' NOT NULL,
+  poll_option_8 varchar(250) DEFAULT '' NOT NULL,
+  poll_option_9 varchar(250) DEFAULT '' NOT NULL,
+  poll_option_10 varchar(250) DEFAULT '' NOT NULL,
+  poll_votes_1 int4 DEFAULT '0' NOT NULL,
+  poll_votes_2 int4 DEFAULT '0' NOT NULL,
+  poll_votes_3 int4 DEFAULT '0' NOT NULL,
+  poll_votes_4 int4 DEFAULT '0' NOT NULL,
+  poll_votes_5 int4 DEFAULT '0' NOT NULL,
+  poll_votes_6 int4 DEFAULT '0' NOT NULL,
+  poll_votes_7 int4 DEFAULT '0' NOT NULL,
+  poll_votes_8 int4 DEFAULT '0' NOT NULL,
+  poll_votes_9 int4 DEFAULT '0' NOT NULL,
+  poll_votes_10 int4 DEFAULT '0' NOT NULL,
+  poll_ip text NOT NULL,
+  poll_active int2 DEFAULT '0' NOT NULL,
+  poll_comment int2 DEFAULT '1' NOT NULL,
+  CONSTRAINT poll_pkey PRIMARY KEY (poll_id)
+);
+
+CREATE TABLE rate (
+  rate_id int4 DEFAULT '0' NOT NULL,
+  rate_table varchar(100) DEFAULT '' NOT NULL,
+  rate_itemid int4 DEFAULT '0' NOT NULL,
+  rate_rating int4 DEFAULT '0' NOT NULL,
+  rate_votes int4 DEFAULT '0' NOT NULL,
+  rate_voters text NOT NULL,
+  CONSTRAINT rate_pkey PRIMARY KEY (rate_id)
+);
diff -ruN 6171/e107_admin/sql/core_sql.php 75/e107_admin/sql/core_sql.php
--- 6171/e107_admin/sql/core_sql.php	2004-08-20 03:21:04.000000000 -0500
+++ 75/e107_admin/sql/core_sql.php	2006-04-16 03:35:10.000000000 -0500
@@ -1,596 +1,564 @@
-<?php
-header("location:../index.php");
-exit;
-?>
-#
-# +---------------------------------------------------------------+
-# |	e107 website system
-# |	/files/sql.php
-# |
-# |	Steve Dunstan 2001-2002
-# |	http://e107.org
-# |	jalist@e107.org
-# |
-# |	Released under the terms and conditions of the
-# |	GNU General Public License (http://gnu.org).
-# +---------------------------------------------------------------+
-# Database : <variable>
-# --------------------------------------------------------
-
-#
-# Table structure for table `banlist`
-#
-
-CREATE TABLE banlist (
-  banlist_ip varchar(100) NOT NULL default '',
-  banlist_admin smallint(5) unsigned NOT NULL default '0',
-  banlist_reason tinytext NOT NULL,
-  PRIMARY KEY  (banlist_ip)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `banner`
-#
-
-CREATE TABLE banner (
-  banner_id int(10) unsigned NOT NULL auto_increment,
-  banner_clientname varchar(100) NOT NULL default '',
-  banner_clientlogin varchar(20) NOT NULL default '',
-  banner_clientpassword varchar(50) NOT NULL default '',
-  banner_image varchar(150) NOT NULL default '',
-  banner_clickurl varchar(150) NOT NULL default '',
-  banner_impurchased int(10) unsigned NOT NULL default '0',
-  banner_startdate int(10) unsigned NOT NULL default '0',
-  banner_enddate int(10) unsigned NOT NULL default '0',
-  banner_active tinyint(1) unsigned NOT NULL default '0',
-  banner_clicks int(10) unsigned NOT NULL default '0',
-  banner_impressions int(10) unsigned NOT NULL default '0',
-  banner_ip text NOT NULL,
-  banner_campaign varchar(150) NOT NULL default '',
-  PRIMARY KEY  (banner_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `cache`
-#
-
-CREATE TABLE cache (
-  cache_url varchar(200) NOT NULL default '',
-  cache_datestamp int(10) unsigned NOT NULL default '0',
-  cache_data longtext NOT NULL
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `chatbox`
-#
-
-CREATE TABLE chatbox (
-  cb_id int(10) unsigned NOT NULL auto_increment,
-  cb_nick varchar(30) NOT NULL default '',
-  cb_message text NOT NULL,
-  cb_datestamp int(10) unsigned NOT NULL default '0',
-  cb_blocked tinyint(3) unsigned NOT NULL default '0',
-  cb_ip varchar(15) NOT NULL default '',
-  PRIMARY KEY  (cb_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `comments`
-#
-
-CREATE TABLE comments (
-  comment_id int(10) unsigned NOT NULL auto_increment,
-  comment_pid int(10) unsigned NOT NULL default '0',
-  comment_item_id int(10) unsigned NOT NULL default '0',
-  comment_subject varchar(100) NOT NULL default '',
-  comment_author varchar(100) NOT NULL default '',
-  comment_author_email varchar(200) NOT NULL default '',
-  comment_datestamp int(10) unsigned NOT NULL default '0',
-  comment_comment text NOT NULL,
-  comment_blocked tinyint(3) unsigned NOT NULL default '0',
-  comment_ip varchar(20) NOT NULL default '',
-  comment_type varchar(10) NOT NULL default '0',
-  PRIMARY KEY  (comment_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `content`
-#
-
-CREATE TABLE content (
-  content_id int(10) unsigned NOT NULL auto_increment,
-  content_heading tinytext NOT NULL,
-  content_subheading tinytext NOT NULL,
-  content_content text NOT NULL,
-  content_parent int(10) unsigned NOT NULL default '0',
-  content_datestamp int(10) unsigned NOT NULL default '0',
-  content_author varchar(200) NOT NULL default '',
-  content_comment tinyint(3) unsigned NOT NULL default '0',
-  content_summary text NOT NULL,
-  content_type tinyint(3) unsigned NOT NULL default '0',
-  content_review_score tinyint(3) unsigned NOT NULL default '0',
-  content_pe_icon tinyint(1) unsigned NOT NULL default '0',
-  content_class tinyint(3) unsigned NOT NULL default '0',
-  PRIMARY KEY  (content_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `core`
-#
-
-CREATE TABLE core (
-  e107_name varchar(20) NOT NULL default '',
-  e107_value text NOT NULL,
-  PRIMARY KEY  (e107_name)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `download`
-#
-
-CREATE TABLE download (
-  download_id int(10) unsigned NOT NULL auto_increment,
-  download_name varchar(100) NOT NULL default '',
-  download_url varchar(150) NOT NULL default '',
-  download_author varchar(100) NOT NULL default '',
-  download_author_email varchar(200) NOT NULL default '',
-  download_author_website varchar(200) NOT NULL default '',
-  download_description text NOT NULL,
-  download_filesize varchar(20) NOT NULL default '',
-  download_requested int(10) unsigned NOT NULL default '0',
-  download_category int(10) unsigned NOT NULL default '0',
-  download_active tinyint(3) unsigned NOT NULL default '0',
-  download_datestamp int(10) unsigned NOT NULL default '0',
-  download_thumb varchar(150) NOT NULL default '',
-  download_image varchar(150) NOT NULL default '',
-  download_comment tinyint(3) unsigned NOT NULL default '0',
-  PRIMARY KEY  (download_id),
-  UNIQUE KEY download_name (download_name)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `download_category`
-#
-
-CREATE TABLE download_category (
-  download_category_id int(10) unsigned NOT NULL auto_increment,
-  download_category_name varchar(100) NOT NULL default '',
-  download_category_description text NOT NULL,
-  download_category_icon varchar(100) NOT NULL default '',
-  download_category_parent int(10) unsigned NOT NULL default '0',
-  download_category_class varchar(100) NOT NULL default '',
-  PRIMARY KEY  (download_category_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `flood`
-#
-
-CREATE TABLE flood (
-  flood_url text NOT NULL,
-  flood_time int(10) unsigned NOT NULL default '0'
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `forum`
-#
-
-CREATE TABLE forum (
-  forum_id int(10) unsigned NOT NULL auto_increment,
-  forum_name varchar(250) NOT NULL default '',
-  forum_description text NOT NULL,
-  forum_parent int(10) unsigned NOT NULL default '0',
-  forum_datestamp int(10) unsigned NOT NULL default '0',
-  forum_moderators text NOT NULL,
-  forum_threads int(10) unsigned NOT NULL default '0',
-  forum_replies int(10) unsigned NOT NULL default '0',
-  forum_lastpost varchar(200) NOT NULL default '',
-  forum_class varchar(100) NOT NULL default '',
-  forum_order int(10) unsigned NOT NULL default '0',
-  PRIMARY KEY  (forum_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `forum_t`
-#
-
-CREATE TABLE forum_t (
-  thread_id int(10) unsigned NOT NULL auto_increment,
-  thread_name varchar(250) NOT NULL default '',
-  thread_thread text NOT NULL,
-  thread_forum_id int(10) unsigned NOT NULL default '0',
-  thread_datestamp int(10) unsigned NOT NULL default '0',
-  thread_parent int(10) unsigned NOT NULL default '0',
-  thread_user varchar(250) NOT NULL default '',
-  thread_views int(10) unsigned NOT NULL default '0',
-  thread_active tinyint(3) unsigned NOT NULL default '0',
-  thread_lastpost int(10) unsigned NOT NULL default '0',
-  thread_s tinyint(1) unsigned NOT NULL default '0',
-  PRIMARY KEY  (thread_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `headlines`
-#
-
-CREATE TABLE headlines (
-  headline_id int(10) unsigned NOT NULL auto_increment,
-  headline_url varchar(150) NOT NULL default '',
-  headline_data text NOT NULL,
-  headline_timestamp int(10) unsigned NOT NULL default '0',
-  headline_description text NOT NULL,
-  headline_image varchar(100) NOT NULL default '',
-  headline_active tinyint(1) unsigned NOT NULL default '0',
-  PRIMARY KEY  (headline_id)
-) TYPE=MyISAM;
-
-# --------------------------------------------------------
-
-#
-# Table structure for table `link_category`
-#
-
-CREATE TABLE link_category (
-  link_category_id int(10) unsigned NOT NULL auto_increment,
-  link_category_name varchar(100) NOT NULL default '',
-  link_category_description varchar(250) NOT NULL default '',
-  link_category_icon varchar(100) NOT NULL default '',
-  PRIMARY KEY  (link_category_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `links`
-#
-
-CREATE TABLE links (
-  link_id int(10) unsigned NOT NULL auto_increment,
-  link_name varchar(100) NOT NULL default '',
-  link_url varchar(200) NOT NULL default '',
-  link_description text NOT NULL,
-  link_button varchar(100) NOT NULL default '',
-  link_category tinyint(3) unsigned NOT NULL default '0',
-  link_order int(10) unsigned NOT NULL default '0',
-  link_refer int(10) unsigned NOT NULL default '0',
-  link_open tinyint(1) unsigned NOT NULL default '0',
-  link_class tinyint(3) unsigned NOT NULL default '0',
-  PRIMARY KEY  (link_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `menus`
-#
-
-CREATE TABLE menus (
-  menu_id int(10) unsigned NOT NULL auto_increment,
-  menu_name varchar(100) NOT NULL default '',
-  menu_location tinyint(3) unsigned NOT NULL default '0',
-  menu_order tinyint(3) unsigned NOT NULL default '0',
-  menu_class tinyint(3) unsigned NOT NULL default '0',
-  menu_pages text NOT NULL,
-  PRIMARY KEY  (menu_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `news`
-#
-
-CREATE TABLE news (
-  news_id int(10) unsigned NOT NULL auto_increment,
-  news_title varchar(200) NOT NULL default '',
-  news_body text NOT NULL,
-  news_extended text NOT NULL,
-  news_datestamp int(10) unsigned NOT NULL default '0',
-  news_author int(10) unsigned NOT NULL default '0',
-  news_category tinyint(3) unsigned NOT NULL default '0',
-  news_allow_comments tinyint(3) unsigned NOT NULL default '0',
-  news_start int(10) unsigned NOT NULL default '0',
-  news_end int(10) unsigned NOT NULL default '0',
-  news_class tinyint(3) unsigned NOT NULL default '0',
-  news_render_type tinyint(3) unsigned NOT NULL default '0',
-  PRIMARY KEY  (news_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `news_category`
-#
-
-CREATE TABLE news_category (
-  category_id int(10) unsigned NOT NULL auto_increment,
-  category_name varchar(200) NOT NULL default '',
-  category_icon varchar(250) NOT NULL default '',
-  PRIMARY KEY  (category_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `online`
-#
-
-CREATE TABLE online (
-  online_timestamp int(10) unsigned NOT NULL default '0',
-  online_flag tinyint(3) unsigned NOT NULL default '0',
-  online_user_id varchar(100) NOT NULL default '',
-  online_ip varchar(15) NOT NULL default '',
-  online_location varchar(100) NOT NULL default '',
-  online_pagecount tinyint(3) unsigned NOT NULL default '0'
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `plugin`
-#
-
-CREATE TABLE plugin (
-  plugin_id int(10) unsigned NOT NULL auto_increment,
-  plugin_name varchar(100) NOT NULL default '',
-  plugin_version varchar(10) NOT NULL default '',
-  plugin_path varchar(100) NOT NULL default '',
-  plugin_installflag tinyint(1) unsigned NOT NULL default '0',
-  PRIMARY KEY  (plugin_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `poll`
-#
-
-CREATE TABLE poll (
-  poll_id int(10) unsigned NOT NULL auto_increment,
-  poll_datestamp int(10) unsigned NOT NULL default '0',
-  poll_end_datestamp int(10) unsigned NOT NULL default '0',
-  poll_admin_id int(10) unsigned NOT NULL default '0',
-  poll_title varchar(250) NOT NULL default '',
-  poll_option_1 varchar(250) NOT NULL default '',
-  poll_option_2 varchar(250) NOT NULL default '',
-  poll_option_3 varchar(250) NOT NULL default '',
-  poll_option_4 varchar(250) NOT NULL default '',
-  poll_option_5 varchar(250) NOT NULL default '',
-  poll_option_6 varchar(250) NOT NULL default '',
-  poll_option_7 varchar(250) NOT NULL default '',
-  poll_option_8 varchar(250) NOT NULL default '',
-  poll_option_9 varchar(250) NOT NULL default '',
-  poll_option_10 varchar(250) NOT NULL default '',
-  poll_votes_1 int(10) unsigned NOT NULL default '0',
-  poll_votes_2 int(10) unsigned NOT NULL default '0',
-  poll_votes_3 int(10) unsigned NOT NULL default '0',
-  poll_votes_4 int(10) unsigned NOT NULL default '0',
-  poll_votes_5 int(10) unsigned NOT NULL default '0',
-  poll_votes_6 int(10) unsigned NOT NULL default '0',
-  poll_votes_7 int(10) unsigned NOT NULL default '0',
-  poll_votes_8 int(10) unsigned NOT NULL default '0',
-  poll_votes_9 int(10) unsigned NOT NULL default '0',
-  poll_votes_10 int(10) unsigned NOT NULL default '0',
-  poll_ip text NOT NULL,
-  poll_active tinyint(3) unsigned NOT NULL default '0',
-  poll_comment tinyint(3) unsigned NOT NULL default '1',
-  PRIMARY KEY  (poll_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `rate`
-#
-
-CREATE TABLE rate (
-  rate_id int(10) unsigned NOT NULL auto_increment,
-  rate_table varchar(100) NOT NULL default '',
-  rate_itemid int(10) unsigned NOT NULL default '0',
-  rate_rating int(10) unsigned NOT NULL default '0',
-  rate_votes int(10) unsigned NOT NULL default '0',
-  rate_voters text NOT NULL,
-  PRIMARY KEY  (rate_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `rbinary`
-#
-
-CREATE TABLE rbinary (
-  binary_id int(10) unsigned NOT NULL auto_increment,
-  binary_name varchar(200) NOT NULL default '',
-  binary_filetype varchar(100) NOT NULL default '',
-  binary_data longblob NOT NULL,
-  PRIMARY KEY  (binary_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `session`
-#
-
-CREATE TABLE session (
-  session_id varchar(32) NOT NULL default '',
-  session_expire int(10) unsigned NOT NULL default '0',
-  session_datestamp int(10) unsigned NOT NULL default '0',
-  session_ip varchar(200) NOT NULL default '',
-  session_data text NOT NULL
-) TYPE=MyISAM;
-
-# --------------------------------------------------------
-
-#
-# Table structure for table `stat_counter`
-#
-
-CREATE TABLE stat_counter (
-  counter_date date NOT NULL default '0000-00-00',
-  counter_url varchar(100) NOT NULL default '',
-  counter_unique int(10) unsigned NOT NULL default '0',
-  counter_total int(10) unsigned NOT NULL default '0',
-  counter_ip text NOT NULL
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `stat_info`
-#
-
-CREATE TABLE stat_info (
-  info_name text NOT NULL,
-  info_count int(10) unsigned NOT NULL default '0',
-  info_type tinyint(3) unsigned NOT NULL default '0'
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `stat_last`
-#
-
-CREATE TABLE stat_last (
-  stat_last_date int(11) unsigned NOT NULL default '0',
-  stat_last_info text NOT NULL
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `submitnews`
-#
-
-CREATE TABLE submitnews (
-  submitnews_id int(10) unsigned NOT NULL auto_increment,
-  submitnews_name varchar(100) NOT NULL default '',
-  submitnews_email varchar(100) NOT NULL default '',
-  submitnews_title varchar(200) NOT NULL default '',
-  submitnews_category tinyint(3) unsigned NOT NULL default '0',
-  submitnews_item text NOT NULL,
-  submitnews_datestamp int(10) unsigned NOT NULL default '0',
-  submitnews_ip varchar(15) NOT NULL default '',
-  submitnews_auth tinyint(3) unsigned NOT NULL default '0',
-  submitnews_file varchar(100) NOT NULL default '',
-  PRIMARY KEY  (submitnews_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `tmp`
-#
-
-CREATE TABLE tmp (
-  tmp_ip varchar(20) NOT NULL default '',
-  tmp_time int(10) unsigned NOT NULL default '0',
-  tmp_info text NOT NULL
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `upload`
-#
-
-CREATE TABLE upload (
-  upload_id int(10) unsigned NOT NULL auto_increment,
-  upload_poster varchar(100) NOT NULL default '',
-  upload_email varchar(100) NOT NULL default '',
-  upload_website varchar(100) NOT NULL default '',
-  upload_datestamp int(10) unsigned NOT NULL default '0',
-  upload_name varchar(100) NOT NULL default '',
-  upload_version varchar(10) NOT NULL default '',
-  upload_file varchar(100) NOT NULL default '',
-  upload_ss varchar(100) NOT NULL default '',
-  upload_description text NOT NULL,
-  upload_demo varchar(100) NOT NULL default '',
-  upload_filesize int(10) unsigned NOT NULL default '0',
-  upload_active tinyint(3) unsigned NOT NULL default '0',
-  upload_category tinyint(3) unsigned NOT NULL default '0',
-  PRIMARY KEY  (upload_id)
-) TYPE=MyISAM;
-
-# --------------------------------------------------------
-
-#
-# Table structure for table `user`
-#
-
-CREATE TABLE user (
-  user_id int(10) unsigned NOT NULL auto_increment,
-  user_name varchar(100) NOT NULL default '',
-  user_customtitle varchar(100) NOT NULL default '',
-  user_password varchar(32) NOT NULL default '',
-  user_sess varchar(32) NOT NULL default '',
-  user_email varchar(100) NOT NULL default '',
-  user_homepage varchar(150) NOT NULL default '',
-  user_icq varchar(10) NOT NULL default '',
-  user_aim varchar(100) NOT NULL default '',
-  user_msn varchar(100) NOT NULL default '',
-  user_location varchar(150) NOT NULL default '',
-  user_birthday date NOT NULL default '0000-00-00',
-  user_signature text NOT NULL,
-  user_image varchar(100) NOT NULL default '',
-  user_timezone char(3) NOT NULL default '',
-  user_hideemail tinyint(3) unsigned NOT NULL default '0',
-  user_join int(10) unsigned NOT NULL default '0',
-  user_lastvisit int(10) unsigned NOT NULL default '0',
-  user_currentvisit int(10) unsigned NOT NULL default '0',
-  user_lastpost int(10) unsigned NOT NULL default '0',
-  user_chats int(10) unsigned NOT NULL default '0',
-  user_comments int(10) unsigned NOT NULL default '0',
-  user_forums int(10) unsigned NOT NULL default '0',
-  user_ip varchar(20) NOT NULL default '',
-  user_ban tinyint(3) unsigned NOT NULL default '0',
-  user_prefs text NOT NULL,
-  user_new text NOT NULL,
-  user_viewed text NOT NULL,
-  user_visits int(10) unsigned NOT NULL default '0',
-  user_admin tinyint(3) unsigned NOT NULL default '0',
-  user_login varchar(100) NOT NULL default '',
-  user_class text NOT NULL,
-  user_perms text NOT NULL,
-  user_realm text NOT NULL,
-  user_pwchange int(10) unsigned NOT NULL default '0',
-  PRIMARY KEY  (user_id),
-  UNIQUE KEY user_name (user_name)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `userclass_classes`
-#
-
-CREATE TABLE userclass_classes (
-  userclass_id tinyint(3) unsigned NOT NULL default '0',
-  userclass_name varchar(100) NOT NULL default '',
-  userclass_description varchar(250) NOT NULL default '',
-  userclass_editclass tinyint(3) unsigned NOT NULL default '0',
-  PRIMARY KEY  (userclass_id)
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `wmessage`
-#
-
-CREATE TABLE wmessage (
-  wm_id tinyint(3) unsigned NOT NULL default '0',
-  wm_text text NOT NULL,
-  wm_active tinyint(3) unsigned NOT NULL default '0'
-) TYPE=MyISAM;
-# --------------------------------------------------------
-
-#
-# Table structure for table `parser`
-#
-
-CREATE TABLE parser (
-  parser_id int(10) unsigned NOT NULL auto_increment,
-  parser_pluginname varchar(100) NOT NULL default '',
-  parser_regexp varchar(100) NOT NULL default '',
-  PRIMARY KEY  (parser_id),
-  UNIQUE KEY parser_regexp (parser_regexp)
-) TYPE=MyISAM;
-# --------------------------------------------------------
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/sql/core_sql.php,v $
+|     $Revision: 1.46 $
+|     $Date: 2006/04/16 08:35:10 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+header("location:../index.php");
+exit;
+?>
+#
+# +---------------------------------------------------------------+
+# |        e107 website system
+# |        /files/sql.php
+# |
+# |        ?Steve Dunstan 2001-2002
+# |        http://e107.org
+# |        jalist@e107.org
+# |
+# |        Released under the terms and conditions of the
+# |        GNU General Public License (http://gnu.org).
+# +---------------------------------------------------------------+
+# Database : <variable>
+# --------------------------------------------------------
+
+#
+# Table structure for table `banlist`
+#
+
+CREATE TABLE banlist (
+  banlist_ip varchar(100) NOT NULL default '',
+  banlist_admin smallint(5) unsigned NOT NULL default '0',
+  banlist_reason tinytext NOT NULL,
+  PRIMARY KEY  (banlist_ip)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `banner`
+#
+
+CREATE TABLE banner (
+  banner_id int(10) unsigned NOT NULL auto_increment,
+  banner_clientname varchar(100) NOT NULL default '',
+  banner_clientlogin varchar(20) NOT NULL default '',
+  banner_clientpassword varchar(50) NOT NULL default '',
+  banner_image varchar(150) NOT NULL default '',
+  banner_clickurl varchar(150) NOT NULL default '',
+  banner_impurchased int(10) unsigned NOT NULL default '0',
+  banner_startdate int(10) unsigned NOT NULL default '0',
+  banner_enddate int(10) unsigned NOT NULL default '0',
+  banner_active tinyint(3) unsigned NOT NULL default '0',
+  banner_clicks int(10) unsigned NOT NULL default '0',
+  banner_impressions int(10) unsigned NOT NULL default '0',
+  banner_ip text NOT NULL,
+  banner_campaign varchar(150) NOT NULL default '',
+  PRIMARY KEY  (banner_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `comments`
+#
+
+CREATE TABLE comments (
+  comment_id int(10) unsigned NOT NULL auto_increment,
+  comment_pid int(10) unsigned NOT NULL default '0',
+  comment_item_id int(10) unsigned NOT NULL default '0',
+  comment_subject varchar(100) NOT NULL default '',
+  comment_author varchar(100) NOT NULL default '',
+  comment_author_email varchar(200) NOT NULL default '',
+  comment_datestamp int(10) unsigned NOT NULL default '0',
+  comment_comment text NOT NULL,
+  comment_blocked tinyint(3) unsigned NOT NULL default '0',
+  comment_ip varchar(20) NOT NULL default '',
+  comment_type varchar(10) NOT NULL default '0',
+  comment_lock tinyint(1) unsigned NOT NULL default '0',
+  PRIMARY KEY  (comment_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `core`
+#
+CREATE TABLE core (
+  e107_name varchar(100) NOT NULL default '',
+  e107_value text NOT NULL,
+  PRIMARY KEY  (e107_name)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `dblog`
+#
+CREATE TABLE dblog (
+  dblog_id int(10) unsigned NOT NULL auto_increment,
+  dblog_type varchar(60) NOT NULL default '',
+  dblog_datestamp int(10) unsigned NOT NULL default '0',
+  dblog_user_id int(10) unsigned NOT NULL default '0',
+  dblog_ip varchar(80) NOT NULL default '',
+  dblog_query text NOT NULL,
+  dblog_remarks varchar(255) NOT NULL default '',
+  PRIMARY KEY  (dblog_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `download`
+#
+
+CREATE TABLE download (
+  download_id int(10) unsigned NOT NULL auto_increment,
+  download_name varchar(100) NOT NULL default '',
+  download_url varchar(150) NOT NULL default '',
+  download_author varchar(100) NOT NULL default '',
+  download_author_email varchar(200) NOT NULL default '',
+  download_author_website varchar(200) NOT NULL default '',
+  download_description text NOT NULL,
+  download_filesize varchar(20) NOT NULL default '',
+  download_requested int(10) unsigned NOT NULL default '0',
+  download_category int(10) unsigned NOT NULL default '0',
+  download_active tinyint(3) unsigned NOT NULL default '0',
+  download_datestamp int(10) unsigned NOT NULL default '0',
+  download_thumb varchar(150) NOT NULL default '',
+  download_image varchar(150) NOT NULL default '',
+  download_comment tinyint(3) unsigned NOT NULL default '0',
+  download_class varchar(255) NOT NULL default '0',
+  download_mirror text NOT NULL,
+  download_mirror_type tinyint(1) unsigned NOT NULL default '0',
+  download_visible varchar(255) NOT NULL default '0',
+  PRIMARY KEY  (download_id),
+  UNIQUE KEY download_name (download_name),
+  KEY download_category (download_category)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `download_category`
+#
+
+CREATE TABLE download_category (
+  download_category_id int(10) unsigned NOT NULL auto_increment,
+  download_category_name varchar(100) NOT NULL default '',
+  download_category_description text NOT NULL,
+  download_category_icon varchar(100) NOT NULL default '',
+  download_category_parent int(10) unsigned NOT NULL default '0',
+  download_category_class varchar(255) NOT NULL default '0',
+  download_category_order int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (download_category_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `download_mirror`
+#
+
+CREATE TABLE download_mirror (
+  mirror_id int(10) unsigned NOT NULL auto_increment,
+  mirror_name varchar(200) NOT NULL default '',
+  mirror_url varchar(200) NOT NULL default '',
+  mirror_image varchar(200) NOT NULL default '',
+  mirror_location varchar(100) NOT NULL default '',
+  mirror_description text NOT NULL,
+  mirror_count int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (mirror_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `download_requests`
+#
+CREATE TABLE download_requests (
+  download_request_id int(10) unsigned NOT NULL auto_increment,
+  download_request_userid int(10) unsigned NOT NULL default '0',
+  download_request_ip varchar(30) NOT NULL default '',
+  download_request_download_id int(10) unsigned NOT NULL default '0',
+  download_request_datestamp int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (download_request_id),
+  KEY download_request_userid (download_request_userid),
+  KEY download_request_download_id (download_request_download_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+
+#
+# Table structure for table `flood`
+#
+
+CREATE TABLE flood (
+  flood_url text NOT NULL,
+  flood_time int(10) unsigned NOT NULL default '0'
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `headlines`
+#
+
+CREATE TABLE headlines (
+  headline_id int(10) unsigned NOT NULL auto_increment,
+  headline_url varchar(150) NOT NULL default '',
+  headline_data text NOT NULL,
+  headline_timestamp int(10) unsigned NOT NULL default '0',
+  headline_description text NOT NULL,
+  headline_image varchar(100) NOT NULL default '',
+  headline_active tinyint(1) unsigned NOT NULL default '0',
+  PRIMARY KEY  (headline_id)
+) TYPE=MyISAM;
+
+# --------------------------------------------------------
+
+#
+# Table structure for table `links`
+#
+
+CREATE TABLE links (
+  link_id int(10) unsigned NOT NULL auto_increment,
+  link_name varchar(100) NOT NULL default '',
+  link_url varchar(200) NOT NULL default '',
+  link_description text NOT NULL,
+  link_button varchar(100) NOT NULL default '',
+  link_category tinyint(3) unsigned NOT NULL default '0',
+  link_order int(10) unsigned NOT NULL default '0',
+  link_parent int(10) unsigned NOT NULL default '0',
+  link_open tinyint(1) unsigned NOT NULL default '0',
+  link_class varchar(255) NOT NULL default '0',
+  PRIMARY KEY  (link_id)
+) TYPE=MyISAM;
+
+# --------------------------------------------------------
+
+#
+# Table structure for table `menus`
+#
+
+CREATE TABLE menus (
+  menu_id int(10) unsigned NOT NULL auto_increment,
+  menu_name varchar(100) NOT NULL default '',
+  menu_location tinyint(3) unsigned NOT NULL default '0',
+  menu_order tinyint(3) unsigned NOT NULL default '0',
+  menu_class varchar(255) NOT NULL default '0',
+  menu_pages text NOT NULL,
+  menu_path varchar(100) NOT NULL default '',
+  PRIMARY KEY  (menu_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `news`
+#
+
+CREATE TABLE news (
+  news_id int(10) unsigned NOT NULL auto_increment,
+  news_title varchar(200) NOT NULL default '',
+  news_body text NOT NULL,
+  news_extended text NOT NULL,
+  news_datestamp int(10) unsigned NOT NULL default '0',
+  news_author int(10) unsigned NOT NULL default '0',
+  news_category tinyint(3) unsigned NOT NULL default '0',
+  news_allow_comments tinyint(3) unsigned NOT NULL default '0',
+  news_start int(10) unsigned NOT NULL default '0',
+  news_end int(10) unsigned NOT NULL default '0',
+  news_class varchar(255) NOT NULL default '0',
+  news_render_type tinyint(3) unsigned NOT NULL default '0',
+  news_comment_total int(10) unsigned NOT NULL default '0',
+  news_summary text NOT NULL,
+  news_thumbnail text NOT NULL,
+  news_sticky tinyint(3) unsigned NOT NULL default '0',
+  PRIMARY KEY  (news_id)
+) TYPE=MyISAM;
+
+
+
+
+
+# --------------------------------------------------------
+
+#
+# Table structure for table `news_category`
+#
+
+CREATE TABLE news_category (
+  category_id int(10) unsigned NOT NULL auto_increment,
+  category_name varchar(200) NOT NULL default '',
+  category_icon varchar(250) NOT NULL default '',
+  PRIMARY KEY  (category_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `online`
+#
+
+CREATE TABLE online (
+  online_timestamp int(10) unsigned NOT NULL default '0',
+  online_flag tinyint(3) unsigned NOT NULL default '0',
+  online_user_id varchar(100) NOT NULL default '',
+  online_ip varchar(15) NOT NULL default '',
+  online_location varchar(100) NOT NULL default '',
+  online_pagecount tinyint(3) unsigned NOT NULL default '0'
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `page`
+#
+
+CREATE TABLE page (
+  page_id int(10) unsigned NOT NULL auto_increment,
+  page_title varchar(250) NOT NULL default '',
+  page_text mediumtext NOT NULL,
+  page_author int(10) unsigned NOT NULL default '0',
+  page_datestamp int(10) unsigned NOT NULL default '0',
+  page_rating_flag tinyint(1) unsigned NOT NULL default '0',
+  page_comment_flag tinyint(1) unsigned NOT NULL default '0',
+  page_password varchar(50) NOT NULL default '',
+  page_class varchar(250) NOT NULL default '',
+  page_ip_restrict text NOT NULL,
+  page_theme varchar(50) NOT NULL default '',
+  PRIMARY KEY  (page_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `plugin`
+#
+
+CREATE TABLE plugin (
+  plugin_id int(10) unsigned NOT NULL auto_increment,
+  plugin_name varchar(100) NOT NULL default '',
+  plugin_version varchar(10) NOT NULL default '',
+  plugin_path varchar(100) NOT NULL default '',
+  plugin_installflag tinyint(1) unsigned NOT NULL default '0',
+  plugin_rss varchar(255) NOT NULL default '',
+  PRIMARY KEY  (plugin_id)
+) TYPE=MyISAM;
+
+# --------------------------------------------------------
+
+#
+# Table structure for table `rate`
+#
+
+CREATE TABLE preset (
+  preset_id int(10) unsigned NOT NULL auto_increment,
+  preset_name varchar(80) NOT NULL default '',
+  preset_field varchar(80) NOT NULL default '',
+  preset_value varchar(255) NOT NULL default '',
+  PRIMARY KEY  (preset_id)
+) TYPE=MyISAM;
+
+# --------------------------------------------------------
+
+#
+# Table structure for table `rate`
+#
+
+CREATE TABLE rate (
+  rate_id int(10) unsigned NOT NULL auto_increment,
+  rate_table varchar(100) NOT NULL default '',
+  rate_itemid int(10) unsigned NOT NULL default '0',
+  rate_rating int(10) unsigned NOT NULL default '0',
+  rate_votes int(10) unsigned NOT NULL default '0',
+  rate_voters text NOT NULL,
+  PRIMARY KEY  (rate_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `rbinary`
+#
+
+CREATE TABLE rbinary (
+  binary_id int(10) unsigned NOT NULL auto_increment,
+  binary_name varchar(200) NOT NULL default '',
+  binary_filetype varchar(100) NOT NULL default '',
+  binary_data longblob NOT NULL,
+  PRIMARY KEY  (binary_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `session`
+#
+
+CREATE TABLE session (
+  session_id varchar(32) NOT NULL default '',
+  session_expire int(10) unsigned NOT NULL default '0',
+  session_datestamp int(10) unsigned NOT NULL default '0',
+  session_ip varchar(200) NOT NULL default '',
+  session_data text NOT NULL
+) TYPE=MyISAM;
+
+# --------------------------------------------------------
+
+#
+# Table structure for table `submitnews`
+#
+
+CREATE TABLE submitnews (
+  submitnews_id int(10) unsigned NOT NULL auto_increment,
+  submitnews_name varchar(100) NOT NULL default '',
+  submitnews_email varchar(100) NOT NULL default '',
+  submitnews_title varchar(200) NOT NULL default '',
+  submitnews_category tinyint(3) unsigned NOT NULL default '0',
+  submitnews_item text NOT NULL,
+  submitnews_datestamp int(10) unsigned NOT NULL default '0',
+  submitnews_ip varchar(15) NOT NULL default '',
+  submitnews_auth tinyint(3) unsigned NOT NULL default '0',
+  submitnews_file varchar(100) NOT NULL default '',
+  PRIMARY KEY  (submitnews_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `tmp`
+#
+
+CREATE TABLE tmp (
+  tmp_ip varchar(20) NOT NULL default '',
+  tmp_time int(10) unsigned NOT NULL default '0',
+  tmp_info text NOT NULL
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `upload`
+#
+
+CREATE TABLE upload (
+  upload_id int(10) unsigned NOT NULL auto_increment,
+  upload_poster varchar(100) NOT NULL default '',
+  upload_email varchar(100) NOT NULL default '',
+  upload_website varchar(100) NOT NULL default '',
+  upload_datestamp int(10) unsigned NOT NULL default '0',
+  upload_name varchar(100) NOT NULL default '',
+  upload_version varchar(10) NOT NULL default '',
+  upload_file varchar(100) NOT NULL default '',
+  upload_ss varchar(100) NOT NULL default '',
+  upload_description text NOT NULL,
+  upload_demo varchar(100) NOT NULL default '',
+  upload_filesize int(10) unsigned NOT NULL default '0',
+  upload_active tinyint(3) unsigned NOT NULL default '0',
+  upload_category tinyint(3) unsigned NOT NULL default '0',
+  PRIMARY KEY  (upload_id)
+) TYPE=MyISAM;
+
+# --------------------------------------------------------
+
+#
+# Table structure for table `user`
+#
+
+CREATE TABLE user (
+  user_id int(10) unsigned NOT NULL auto_increment,
+  user_name varchar(100) NOT NULL default '',
+  user_loginname varchar(100) NOT NULL default '',
+  user_customtitle varchar(100) NOT NULL default '',
+  user_password varchar(32) NOT NULL default '',
+  user_sess varchar(100) NOT NULL default '',
+  user_email varchar(100) NOT NULL default '',
+  user_signature text NOT NULL,
+  user_image varchar(100) NOT NULL default '',
+  user_timezone char(3) NOT NULL default '',
+  user_hideemail tinyint(3) unsigned NOT NULL default '0',
+  user_join int(10) unsigned NOT NULL default '0',
+  user_lastvisit int(10) unsigned NOT NULL default '0',
+  user_currentvisit int(10) unsigned NOT NULL default '0',
+  user_lastpost int(10) unsigned NOT NULL default '0',
+  user_chats int(10) unsigned NOT NULL default '0',
+  user_comments int(10) unsigned NOT NULL default '0',
+  user_forums int(10) unsigned NOT NULL default '0',
+  user_ip varchar(20) NOT NULL default '',
+  user_ban tinyint(3) unsigned NOT NULL default '0',
+  user_prefs text NOT NULL,
+  user_new text NOT NULL,
+  user_viewed text NOT NULL,
+  user_visits int(10) unsigned NOT NULL default '0',
+  user_admin tinyint(3) unsigned NOT NULL default '0',
+  user_login varchar(100) NOT NULL default '',
+  user_class text NOT NULL,
+  user_perms text NOT NULL,
+  user_realm text NOT NULL,
+  user_pwchange int(10) unsigned NOT NULL default '0',
+  user_xup varchar(100) NOT NULL default '',
+  PRIMARY KEY  (user_id),
+  UNIQUE KEY user_name (user_name),
+  KEY user_ban_index (user_ban)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `userclass_classes`
+#
+CREATE TABLE userclass_classes (
+  userclass_id tinyint(3) unsigned NOT NULL default '0',
+  userclass_name varchar(100) NOT NULL default '',
+  userclass_description varchar(250) NOT NULL default '',
+  userclass_editclass tinyint(3) unsigned NOT NULL default '0',
+  PRIMARY KEY  (userclass_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+#
+# Table structure for table `e107_user_extended`
+#
+
+CREATE TABLE user_extended (
+  user_extended_id int(10) unsigned NOT NULL default '0',
+  user_hidden_fields text NOT NULL,
+  PRIMARY KEY  (user_extended_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+
+#
+# Table structure for table `e107_user_extended_struct`
+#
+
+CREATE TABLE user_extended_struct (
+  user_extended_struct_id int(10) unsigned NOT NULL auto_increment,
+  user_extended_struct_name varchar(255) NOT NULL default '',
+  user_extended_struct_text varchar(255) NOT NULL default '',
+  user_extended_struct_type tinyint(3) unsigned NOT NULL default '0',
+  user_extended_struct_parms varchar(255) NOT NULL default '',
+  user_extended_struct_values text NOT NULL,
+  user_extended_struct_default varchar(255) NOT NULL default '',
+  user_extended_struct_read tinyint(3) unsigned NOT NULL default '0',
+  user_extended_struct_write tinyint(3) unsigned NOT NULL default '0',
+  user_extended_struct_required tinyint(3) unsigned NOT NULL default '0',
+  user_extended_struct_signup tinyint(3) unsigned NOT NULL default '0',
+  user_extended_struct_applicable tinyint(3) unsigned NOT NULL default '0',
+  user_extended_struct_order int(10) unsigned NOT NULL default '0',
+  user_extended_struct_parent int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (user_extended_struct_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+
+#
+# Table structure for table `generic`
+#
+CREATE TABLE generic (
+  gen_id int(10) unsigned NOT NULL auto_increment,
+  gen_type varchar(80) NOT NULL default '',
+  gen_datestamp int(10) unsigned NOT NULL default '0',
+  gen_user_id int(10) unsigned NOT NULL default '0',
+  gen_ip varchar(80) NOT NULL default '',
+  gen_intdata int(10) unsigned NOT NULL default '0',
+  gen_chardata text NOT NULL,
+  PRIMARY KEY  (gen_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
\ No newline at end of file
diff -ruN 6171/e107_admin/sql/extended_country.php 75/e107_admin/sql/extended_country.php
--- 6171/e107_admin/sql/extended_country.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/sql/extended_country.php	2006-04-29 01:45:38.000000000 -0500
@@ -0,0 +1,271 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/sql/extended_country.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2006/04/29 06:45:38 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+header("location:../index.php");
+exit;
+?>
+
+CREATE TABLE user_extended_country (
+  country_code char(3) NOT NULL default '',
+  country_name char(52) NOT NULL default '',
+  country_continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia',
+  country_region char(26) NOT NULL default '',
+  country_iso char(2) NOT NULL default '',
+  PRIMARY KEY  (country_code),
+  KEY country_iso (country_iso)
+) TYPE=MyISAM;
+
+INSERT INTO user_extended_country VALUES('AFG', 'Afghanistan', 'Asia', 'Southern and Central Asia', 'AF');
+INSERT INTO user_extended_country VALUES('NLD', 'Netherlands', 'Europe', 'Western Europe', 'NL');
+INSERT INTO user_extended_country VALUES('ANT', 'Netherlands Antilles', 'North America', 'Caribbean', 'AN');
+INSERT INTO user_extended_country VALUES('ALB', 'Albania', 'Europe', 'Southern Europe', 'AL');
+INSERT INTO user_extended_country VALUES('DZA', 'Algeria', 'Africa', 'Northern Africa', 'DZ');
+INSERT INTO user_extended_country VALUES('ASM', 'American Samoa', 'Oceania', 'Polynesia', 'AS');
+INSERT INTO user_extended_country VALUES('AND', 'Andorra', 'Europe', 'Southern Europe', 'AD');
+INSERT INTO user_extended_country VALUES('AGO', 'Angola', 'Africa', 'Central Africa', 'AO');
+INSERT INTO user_extended_country VALUES('AIA', 'Anguilla', 'North America', 'Caribbean', 'AI');
+INSERT INTO user_extended_country VALUES('ATG', 'Antigua and Barbuda', 'North America', 'Caribbean', 'AG');
+INSERT INTO user_extended_country VALUES('ARE', 'United Arab Emirates', 'Asia', 'Middle East', 'AE');
+INSERT INTO user_extended_country VALUES('ARG', 'Argentina', 'South America', 'South America', 'AR');
+INSERT INTO user_extended_country VALUES('ARM', 'Armenia', 'Asia', 'Middle East', 'AM');
+INSERT INTO user_extended_country VALUES('ABW', 'Aruba', 'North America', 'Caribbean', 'AW');
+INSERT INTO user_extended_country VALUES('AUS', 'Australia', 'Oceania', 'Australia and New Zealand', 'AU');
+INSERT INTO user_extended_country VALUES('AZE', 'Azerbaijan', 'Asia', 'Middle East', 'AZ');
+INSERT INTO user_extended_country VALUES('BHS', 'Bahamas', 'North America', 'Caribbean', 'BS');
+INSERT INTO user_extended_country VALUES('BHR', 'Bahrain', 'Asia', 'Middle East', 'BH');
+INSERT INTO user_extended_country VALUES('BGD', 'Bangladesh', 'Asia', 'Southern and Central Asia', 'BD');
+INSERT INTO user_extended_country VALUES('BRB', 'Barbados', 'North America', 'Caribbean', 'BB');
+INSERT INTO user_extended_country VALUES('BEL', 'Belgium', 'Europe', 'Western Europe', 'BE');
+INSERT INTO user_extended_country VALUES('BLZ', 'Belize', 'North America', 'Central America', 'BZ');
+INSERT INTO user_extended_country VALUES('BEN', 'Benin', 'Africa', 'Western Africa', 'BJ');
+INSERT INTO user_extended_country VALUES('BMU', 'Bermuda', 'North America', 'North America', 'BM');
+INSERT INTO user_extended_country VALUES('BTN', 'Bhutan', 'Asia', 'Southern and Central Asia', 'BT');
+INSERT INTO user_extended_country VALUES('BOL', 'Bolivia', 'South America', 'South America', 'BO');
+INSERT INTO user_extended_country VALUES('BIH', 'Bosnia and Herzegovina', 'Europe', 'Southern Europe', 'BA');
+INSERT INTO user_extended_country VALUES('BWA', 'Botswana', 'Africa', 'Southern Africa', 'BW');
+INSERT INTO user_extended_country VALUES('BRA', 'Brazil', 'South America', 'South America', 'BR');
+INSERT INTO user_extended_country VALUES('GBR', 'United Kingdom', 'Europe', 'British Islands', 'GB');
+INSERT INTO user_extended_country VALUES('VGB', 'Virgin Islands, British', 'North America', 'Caribbean', 'VG');
+INSERT INTO user_extended_country VALUES('BRN', 'Brunei', 'Asia', 'Southeast Asia', 'BN');
+INSERT INTO user_extended_country VALUES('BGR', 'Bulgaria', 'Europe', 'Eastern Europe', 'BG');
+INSERT INTO user_extended_country VALUES('BFA', 'Burkina Faso', 'Africa', 'Western Africa', 'BF');
+INSERT INTO user_extended_country VALUES('BDI', 'Burundi', 'Africa', 'Eastern Africa', 'BI');
+INSERT INTO user_extended_country VALUES('CYM', 'Cayman Islands', 'North America', 'Caribbean', 'KY');
+INSERT INTO user_extended_country VALUES('CHL', 'Chile', 'South America', 'South America', 'CL');
+INSERT INTO user_extended_country VALUES('COK', 'Cook Islands', 'Oceania', 'Polynesia', 'CK');
+INSERT INTO user_extended_country VALUES('CRI', 'Costa Rica', 'North America', 'Central America', 'CR');
+INSERT INTO user_extended_country VALUES('DJI', 'Djibouti', 'Africa', 'Eastern Africa', 'DJ');
+INSERT INTO user_extended_country VALUES('DMA', 'Dominica', 'North America', 'Caribbean', 'DM');
+INSERT INTO user_extended_country VALUES('DOM', 'Dominican Republic', 'North America', 'Caribbean', 'DO');
+INSERT INTO user_extended_country VALUES('ECU', 'Ecuador', 'South America', 'South America', 'EC');
+INSERT INTO user_extended_country VALUES('EGY', 'Egypt', 'Africa', 'Northern Africa', 'EG');
+INSERT INTO user_extended_country VALUES('SLV', 'El Salvador', 'North America', 'Central America', 'SV');
+INSERT INTO user_extended_country VALUES('ERI', 'Eritrea', 'Africa', 'Eastern Africa', 'ER');
+INSERT INTO user_extended_country VALUES('ESP', 'Spain', 'Europe', 'Southern Europe', 'ES');
+INSERT INTO user_extended_country VALUES('ZAF', 'South Africa', 'Africa', 'Southern Africa', 'ZA');
+INSERT INTO user_extended_country VALUES('ETH', 'Ethiopia', 'Africa', 'Eastern Africa', 'ET');
+INSERT INTO user_extended_country VALUES('FLK', 'Falkland Islands', 'South America', 'South America', 'FK');
+INSERT INTO user_extended_country VALUES('FJI', 'Fiji Islands', 'Oceania', 'Melanesia', 'FJ');
+INSERT INTO user_extended_country VALUES('PHL', 'Philippines', 'Asia', 'Southeast Asia', 'PH');
+INSERT INTO user_extended_country VALUES('FRO', 'Faroe Islands', 'Europe', 'Nordic Countries', 'FO');
+INSERT INTO user_extended_country VALUES('GAB', 'Gabon', 'Africa', 'Central Africa', 'GA');
+INSERT INTO user_extended_country VALUES('GMB', 'Gambia', 'Africa', 'Western Africa', 'GM');
+INSERT INTO user_extended_country VALUES('GEO', 'Georgia', 'Asia', 'Middle East', 'GE');
+INSERT INTO user_extended_country VALUES('GHA', 'Ghana', 'Africa', 'Western Africa', 'GH');
+INSERT INTO user_extended_country VALUES('GIB', 'Gibraltar', 'Europe', 'Southern Europe', 'GI');
+INSERT INTO user_extended_country VALUES('GRD', 'Grenada', 'North America', 'Caribbean', 'GD');
+INSERT INTO user_extended_country VALUES('GRL', 'Greenland', 'North America', 'North America', 'GL');
+INSERT INTO user_extended_country VALUES('GLP', 'Guadeloupe', 'North America', 'Caribbean', 'GP');
+INSERT INTO user_extended_country VALUES('GUM', 'Guam', 'Oceania', 'Micronesia', 'GU');
+INSERT INTO user_extended_country VALUES('GTM', 'Guatemala', 'North America', 'Central America', 'GT');
+INSERT INTO user_extended_country VALUES('GIN', 'Guinea', 'Africa', 'Western Africa', 'GN');
+INSERT INTO user_extended_country VALUES('GNB', 'Guinea-Bissau', 'Africa', 'Western Africa', 'GW');
+INSERT INTO user_extended_country VALUES('GUY', 'Guyana', 'South America', 'South America', 'GY');
+INSERT INTO user_extended_country VALUES('HTI', 'Haiti', 'North America', 'Caribbean', 'HT');
+INSERT INTO user_extended_country VALUES('HND', 'Honduras', 'North America', 'Central America', 'HN');
+INSERT INTO user_extended_country VALUES('HKG', 'Hong Kong', 'Asia', 'Eastern Asia', 'HK');
+INSERT INTO user_extended_country VALUES('SJM', 'Svalbard and Jan Mayen', 'Europe', 'Nordic Countries', 'SJ');
+INSERT INTO user_extended_country VALUES('IDN', 'Indonesia', 'Asia', 'Southeast Asia', 'ID');
+INSERT INTO user_extended_country VALUES('IND', 'India', 'Asia', 'Southern and Central Asia', 'IN');
+INSERT INTO user_extended_country VALUES('IRQ', 'Iraq', 'Asia', 'Middle East', 'IQ');
+INSERT INTO user_extended_country VALUES('IRN', 'Iran', 'Asia', 'Southern and Central Asia', 'IR');
+INSERT INTO user_extended_country VALUES('IRL', 'Ireland', 'Europe', 'British Islands', 'IE');
+INSERT INTO user_extended_country VALUES('ISL', 'Iceland', 'Europe', 'Nordic Countries', 'IS');
+INSERT INTO user_extended_country VALUES('ISR', 'Israel', 'Asia', 'Middle East', 'IL');
+INSERT INTO user_extended_country VALUES('ITA', 'Italy', 'Europe', 'Southern Europe', 'IT');
+INSERT INTO user_extended_country VALUES('TMP', 'East Timor', 'Asia', 'Southeast Asia', 'TP');
+INSERT INTO user_extended_country VALUES('AUT', 'Austria', 'Europe', 'Western Europe', 'AT');
+INSERT INTO user_extended_country VALUES('JAM', 'Jamaica', 'North America', 'Caribbean', 'JM');
+INSERT INTO user_extended_country VALUES('JPN', 'Japan', 'Asia', 'Eastern Asia', 'JP');
+INSERT INTO user_extended_country VALUES('YEM', 'Yemen', 'Asia', 'Middle East', 'YE');
+INSERT INTO user_extended_country VALUES('JOR', 'Jordan', 'Asia', 'Middle East', 'JO');
+INSERT INTO user_extended_country VALUES('CXR', 'Christmas Island', 'Oceania', 'Australia and New Zealand', 'CX');
+INSERT INTO user_extended_country VALUES('YUG', 'Serbia and Montenegro', 'Europe', 'Southern Europe', 'YU');
+INSERT INTO user_extended_country VALUES('KHM', 'Cambodia', 'Asia', 'Southeast Asia', 'KH');
+INSERT INTO user_extended_country VALUES('CMR', 'Cameroon', 'Africa', 'Central Africa', 'CM');
+INSERT INTO user_extended_country VALUES('CAN', 'Canada', 'North America', 'North America', 'CA');
+INSERT INTO user_extended_country VALUES('CPV', 'Cape Verde', 'Africa', 'Western Africa', 'CV');
+INSERT INTO user_extended_country VALUES('KAZ', 'Kazakstan', 'Asia', 'Southern and Central Asia', 'KZ');
+INSERT INTO user_extended_country VALUES('KEN', 'Kenya', 'Africa', 'Eastern Africa', 'KE');
+INSERT INTO user_extended_country VALUES('CAF', 'Central African Republic', 'Africa', 'Central Africa', 'CF');
+INSERT INTO user_extended_country VALUES('CHN', 'China', 'Asia', 'Eastern Asia', 'CN');
+INSERT INTO user_extended_country VALUES('KGZ', 'Kyrgyzstan', 'Asia', 'Southern and Central Asia', 'KG');
+INSERT INTO user_extended_country VALUES('KIR', 'Kiribati', 'Oceania', 'Micronesia', 'KI');
+INSERT INTO user_extended_country VALUES('COL', 'Colombia', 'South America', 'South America', 'CO');
+INSERT INTO user_extended_country VALUES('COM', 'Comoros', 'Africa', 'Eastern Africa', 'KM');
+INSERT INTO user_extended_country VALUES('COG', 'Congo', 'Africa', 'Central Africa', 'CG');
+INSERT INTO user_extended_country VALUES('COD', 'Congo, The Democratic Republic of the', 'Africa', 'Central Africa', 'CD');
+INSERT INTO user_extended_country VALUES('CCK', 'Cocos (Keeling) Islands', 'Oceania', 'Australia and New Zealand', 'CC');
+INSERT INTO user_extended_country VALUES('PRK', 'North Korea', 'Asia', 'Eastern Asia', 'KP');
+INSERT INTO user_extended_country VALUES('KOR', 'South Korea', 'Asia', 'Eastern Asia', 'KR');
+INSERT INTO user_extended_country VALUES('GRC', 'Greece', 'Europe', 'Southern Europe', 'GR');
+INSERT INTO user_extended_country VALUES('HRV', 'Croatia', 'Europe', 'Southern Europe', 'HR');
+INSERT INTO user_extended_country VALUES('CUB', 'Cuba', 'North America', 'Caribbean', 'CU');
+INSERT INTO user_extended_country VALUES('KWT', 'Kuwait', 'Asia', 'Middle East', 'KW');
+INSERT INTO user_extended_country VALUES('CYP', 'Cyprus', 'Asia', 'Middle East', 'CY');
+INSERT INTO user_extended_country VALUES('LAO', 'Laos', 'Asia', 'Southeast Asia', 'LA');
+INSERT INTO user_extended_country VALUES('LVA', 'Latvia', 'Europe', 'Baltic Countries', 'LV');
+INSERT INTO user_extended_country VALUES('LSO', 'Lesotho', 'Africa', 'Southern Africa', 'LS');
+INSERT INTO user_extended_country VALUES('LBN', 'Lebanon', 'Asia', 'Middle East', 'LB');
+INSERT INTO user_extended_country VALUES('LBR', 'Liberia', 'Africa', 'Western Africa', 'LR');
+INSERT INTO user_extended_country VALUES('LBY', 'Libyan Arab Jamahiriya', 'Africa', 'Northern Africa', 'LY');
+INSERT INTO user_extended_country VALUES('LIE', 'Liechtenstein', 'Europe', 'Western Europe', 'LI');
+INSERT INTO user_extended_country VALUES('LTU', 'Lithuania', 'Europe', 'Baltic Countries', 'LT');
+INSERT INTO user_extended_country VALUES('LUX', 'Luxembourg', 'Europe', 'Western Europe', 'LU');
+INSERT INTO user_extended_country VALUES('ESH', 'Western Sahara', 'Africa', 'Northern Africa', 'EH');
+INSERT INTO user_extended_country VALUES('MAC', 'Macao', 'Asia', 'Eastern Asia', 'MO');
+INSERT INTO user_extended_country VALUES('MDG', 'Madagascar', 'Africa', 'Eastern Africa', 'MG');
+INSERT INTO user_extended_country VALUES('MKD', 'Macedonia', 'Europe', 'Southern Europe', 'MK');
+INSERT INTO user_extended_country VALUES('MWI', 'Malawi', 'Africa', 'Eastern Africa', 'MW');
+INSERT INTO user_extended_country VALUES('MDV', 'Maldives', 'Asia', 'Southern and Central Asia', 'MV');
+INSERT INTO user_extended_country VALUES('MYS', 'Malaysia', 'Asia', 'Southeast Asia', 'MY');
+INSERT INTO user_extended_country VALUES('MLI', 'Mali', 'Africa', 'Western Africa', 'ML');
+INSERT INTO user_extended_country VALUES('MLT', 'Malta', 'Europe', 'Southern Europe', 'MT');
+INSERT INTO user_extended_country VALUES('MAR', 'Morocco', 'Africa', 'Northern Africa', 'MA');
+INSERT INTO user_extended_country VALUES('MHL', 'Marshall Islands', 'Oceania', 'Micronesia', 'MH');
+INSERT INTO user_extended_country VALUES('MTQ', 'Martinique', 'North America', 'Caribbean', 'MQ');
+INSERT INTO user_extended_country VALUES('MRT', 'Mauritania', 'Africa', 'Western Africa', 'MR');
+INSERT INTO user_extended_country VALUES('MUS', 'Mauritius', 'Africa', 'Eastern Africa', 'MU');
+INSERT INTO user_extended_country VALUES('MYT', 'Mayotte', 'Africa', 'Eastern Africa', 'YT');
+INSERT INTO user_extended_country VALUES('MEX', 'Mexico', 'North America', 'Central America', 'MX');
+INSERT INTO user_extended_country VALUES('FSM', 'Micronesia, Federated States of', 'Oceania', 'Micronesia', 'FM');
+INSERT INTO user_extended_country VALUES('MDA', 'Moldova', 'Europe', 'Eastern Europe', 'MD');
+INSERT INTO user_extended_country VALUES('MCO', 'Monaco', 'Europe', 'Western Europe', 'MC');
+INSERT INTO user_extended_country VALUES('MNG', 'Mongolia', 'Asia', 'Eastern Asia', 'MN');
+INSERT INTO user_extended_country VALUES('MSR', 'Montserrat', 'North America', 'Caribbean', 'MS');
+INSERT INTO user_extended_country VALUES('MOZ', 'Mozambique', 'Africa', 'Eastern Africa', 'MZ');
+INSERT INTO user_extended_country VALUES('MMR', 'Myanmar', 'Asia', 'Southeast Asia', 'MM');
+INSERT INTO user_extended_country VALUES('NAM', 'Namibia', 'Africa', 'Southern Africa', 'NA');
+INSERT INTO user_extended_country VALUES('NRU', 'Nauru', 'Oceania', 'Micronesia', 'NR');
+INSERT INTO user_extended_country VALUES('NPL', 'Nepal', 'Asia', 'Southern and Central Asia', 'NP');
+INSERT INTO user_extended_country VALUES('NIC', 'Nicaragua', 'North America', 'Central America', 'NI');
+INSERT INTO user_extended_country VALUES('NER', 'Niger', 'Africa', 'Western Africa', 'NE');
+INSERT INTO user_extended_country VALUES('NGA', 'Nigeria', 'Africa', 'Western Africa', 'NG');
+INSERT INTO user_extended_country VALUES('NIU', 'Niue', 'Oceania', 'Polynesia', 'NU');
+INSERT INTO user_extended_country VALUES('NFK', 'Norfolk Island', 'Oceania', 'Australia and New Zealand', 'NF');
+INSERT INTO user_extended_country VALUES('NOR', 'Norway', 'Europe', 'Nordic Countries', 'NO');
+INSERT INTO user_extended_country VALUES('CIV', 'CÃ´te dâ€™Ivoire', 'Africa', 'Western Africa', 'CI');
+INSERT INTO user_extended_country VALUES('OMN', 'Oman', 'Asia', 'Middle East', 'OM');
+INSERT INTO user_extended_country VALUES('PAK', 'Pakistan', 'Asia', 'Southern and Central Asia', 'PK');
+INSERT INTO user_extended_country VALUES('PLW', 'Palau', 'Oceania', 'Micronesia', 'PW');
+INSERT INTO user_extended_country VALUES('PAN', 'Panama', 'North America', 'Central America', 'PA');
+INSERT INTO user_extended_country VALUES('PNG', 'Papua New Guinea', 'Oceania', 'Melanesia', 'PG');
+INSERT INTO user_extended_country VALUES('PRY', 'Paraguay', 'South America', 'South America', 'PY');
+INSERT INTO user_extended_country VALUES('PER', 'Peru', 'South America', 'South America', 'PE');
+INSERT INTO user_extended_country VALUES('PCN', 'Pitcairn', 'Oceania', 'Polynesia', 'PN');
+INSERT INTO user_extended_country VALUES('MNP', 'Northern Mariana Islands', 'Oceania', 'Micronesia', 'MP');
+INSERT INTO user_extended_country VALUES('PRT', 'Portugal', 'Europe', 'Southern Europe', 'PT');
+INSERT INTO user_extended_country VALUES('PRI', 'Puerto Rico', 'North America', 'Caribbean', 'PR');
+INSERT INTO user_extended_country VALUES('POL', 'Poland', 'Europe', 'Eastern Europe', 'PL');
+INSERT INTO user_extended_country VALUES('GNQ', 'Equatorial Guinea', 'Africa', 'Central Africa', 'GQ');
+INSERT INTO user_extended_country VALUES('QAT', 'Qatar', 'Asia', 'Middle East', 'QA');
+INSERT INTO user_extended_country VALUES('FRA', 'France', 'Europe', 'Western Europe', 'FR');
+INSERT INTO user_extended_country VALUES('GUF', 'French Guiana', 'South America', 'South America', 'GF');
+INSERT INTO user_extended_country VALUES('PYF', 'French Polynesia', 'Oceania', 'Polynesia', 'PF');
+INSERT INTO user_extended_country VALUES('REU', 'RÃ©union', 'Africa', 'Eastern Africa', 'RE');
+INSERT INTO user_extended_country VALUES('ROM', 'Romania', 'Europe', 'Eastern Europe', 'RO');
+INSERT INTO user_extended_country VALUES('RWA', 'Rwanda', 'Africa', 'Eastern Africa', 'RW');
+INSERT INTO user_extended_country VALUES('SWE', 'Sweden', 'Europe', 'Nordic Countries', 'SE');
+INSERT INTO user_extended_country VALUES('SHN', 'Saint Helena', 'Africa', 'Western Africa', 'SH');
+INSERT INTO user_extended_country VALUES('KNA', 'Saint Kitts and Nevis', 'North America', 'Caribbean', 'KN');
+INSERT INTO user_extended_country VALUES('LCA', 'Saint Lucia', 'North America', 'Caribbean', 'LC');
+INSERT INTO user_extended_country VALUES('VCT', 'Saint Vincent and the Grenadines', 'North America', 'Caribbean', 'VC');
+INSERT INTO user_extended_country VALUES('SPM', 'Saint Pierre and Miquelon', 'North America', 'North America', 'PM');
+INSERT INTO user_extended_country VALUES('DEU', 'Germany', 'Europe', 'Western Europe', 'DE');
+INSERT INTO user_extended_country VALUES('SLB', 'Solomon Islands', 'Oceania', 'Melanesia', 'SB');
+INSERT INTO user_extended_country VALUES('ZMB', 'Zambia', 'Africa', 'Eastern Africa', 'ZM');
+INSERT INTO user_extended_country VALUES('WSM', 'Samoa', 'Oceania', 'Polynesia', 'WS');
+INSERT INTO user_extended_country VALUES('SMR', 'San Marino', 'Europe', 'Southern Europe', 'SM');
+INSERT INTO user_extended_country VALUES('STP', 'Sao Tome and Principe', 'Africa', 'Central Africa', 'ST');
+INSERT INTO user_extended_country VALUES('SAU', 'Saudi Arabia', 'Asia', 'Middle East', 'SA');
+INSERT INTO user_extended_country VALUES('SEN', 'Senegal', 'Africa', 'Western Africa', 'SN');
+INSERT INTO user_extended_country VALUES('SYC', 'Seychelles', 'Africa', 'Eastern Africa', 'SC');
+INSERT INTO user_extended_country VALUES('SLE', 'Sierra Leone', 'Africa', 'Western Africa', 'SL');
+INSERT INTO user_extended_country VALUES('SGP', 'Singapore', 'Asia', 'Southeast Asia', 'SG');
+INSERT INTO user_extended_country VALUES('SVK', 'Slovakia', 'Europe', 'Eastern Europe', 'SK');
+INSERT INTO user_extended_country VALUES('SVN', 'Slovenia', 'Europe', 'Southern Europe', 'SI');
+INSERT INTO user_extended_country VALUES('SOM', 'Somalia', 'Africa', 'Eastern Africa', 'SO');
+INSERT INTO user_extended_country VALUES('LKA', 'Sri Lanka', 'Asia', 'Southern and Central Asia', 'LK');
+INSERT INTO user_extended_country VALUES('SDN', 'Sudan', 'Africa', 'Northern Africa', 'SD');
+INSERT INTO user_extended_country VALUES('FIN', 'Finland', 'Europe', 'Nordic Countries', 'FI');
+INSERT INTO user_extended_country VALUES('SUR', 'Suriname', 'South America', 'South America', 'SR');
+INSERT INTO user_extended_country VALUES('SWZ', 'Swaziland', 'Africa', 'Southern Africa', 'SZ');
+INSERT INTO user_extended_country VALUES('CHE', 'Switzerland', 'Europe', 'Western Europe', 'CH');
+INSERT INTO user_extended_country VALUES('SYR', 'Syria', 'Asia', 'Middle East', 'SY');
+INSERT INTO user_extended_country VALUES('TJK', 'Tajikistan', 'Asia', 'Southern and Central Asia', 'TJ');
+INSERT INTO user_extended_country VALUES('TWN', 'Taiwan', 'Asia', 'Eastern Asia', 'TW');
+INSERT INTO user_extended_country VALUES('TZA', 'Tanzania', 'Africa', 'Eastern Africa', 'TZ');
+INSERT INTO user_extended_country VALUES('DNK', 'Denmark', 'Europe', 'Nordic Countries', 'DK');
+INSERT INTO user_extended_country VALUES('THA', 'Thailand', 'Asia', 'Southeast Asia', 'TH');
+INSERT INTO user_extended_country VALUES('TGO', 'Togo', 'Africa', 'Western Africa', 'TG');
+INSERT INTO user_extended_country VALUES('TKL', 'Tokelau', 'Oceania', 'Polynesia', 'TK');
+INSERT INTO user_extended_country VALUES('TON', 'Tonga', 'Oceania', 'Polynesia', 'TO');
+INSERT INTO user_extended_country VALUES('TTO', 'Trinidad and Tobago', 'North America', 'Caribbean', 'TT');
+INSERT INTO user_extended_country VALUES('TCD', 'Chad', 'Africa', 'Central Africa', 'TD');
+INSERT INTO user_extended_country VALUES('CZE', 'Czech Republic', 'Europe', 'Eastern Europe', 'CZ');
+INSERT INTO user_extended_country VALUES('TUN', 'Tunisia', 'Africa', 'Northern Africa', 'TN');
+INSERT INTO user_extended_country VALUES('TUR', 'Turkey', 'Asia', 'Middle East', 'TR');
+INSERT INTO user_extended_country VALUES('TKM', 'Turkmenistan', 'Asia', 'Southern and Central Asia', 'TM');
+INSERT INTO user_extended_country VALUES('TCA', 'Turks and Caicos Islands', 'North America', 'Caribbean', 'TC');
+INSERT INTO user_extended_country VALUES('TUV', 'Tuvalu', 'Oceania', 'Polynesia', 'TV');
+INSERT INTO user_extended_country VALUES('UGA', 'Uganda', 'Africa', 'Eastern Africa', 'UG');
+INSERT INTO user_extended_country VALUES('UKR', 'Ukraine', 'Europe', 'Eastern Europe', 'UA');
+INSERT INTO user_extended_country VALUES('HUN', 'Hungary', 'Europe', 'Eastern Europe', 'HU');
+INSERT INTO user_extended_country VALUES('URY', 'Uruguay', 'South America', 'South America', 'UY');
+INSERT INTO user_extended_country VALUES('NCL', 'New Caledonia', 'Oceania', 'Melanesia', 'NC');
+INSERT INTO user_extended_country VALUES('NZL', 'New Zealand', 'Oceania', 'Australia and New Zealand', 'NZ');
+INSERT INTO user_extended_country VALUES('UZB', 'Uzbekistan', 'Asia', 'Southern and Central Asia', 'UZ');
+INSERT INTO user_extended_country VALUES('BLR', 'Belarus', 'Europe', 'Eastern Europe', 'BY');
+INSERT INTO user_extended_country VALUES('WLF', 'Wallis and Futuna', 'Oceania', 'Polynesia', 'WF');
+INSERT INTO user_extended_country VALUES('VUT', 'Vanuatu', 'Oceania', 'Melanesia', 'VU');
+INSERT INTO user_extended_country VALUES('VAT', 'Holy See (Vatican City State)', 'Europe', 'Southern Europe', 'VA');
+INSERT INTO user_extended_country VALUES('VEN', 'Venezuela', 'South America', 'South America', 'VE');
+INSERT INTO user_extended_country VALUES('RUS', 'Russian Federation', 'Europe', 'Eastern Europe', 'RU');
+INSERT INTO user_extended_country VALUES('VNM', 'Vietnam', 'Asia', 'Southeast Asia', 'VN');
+INSERT INTO user_extended_country VALUES('EST', 'Estonia', 'Europe', 'Baltic Countries', 'EE');
+INSERT INTO user_extended_country VALUES('USA', 'United States', 'North America', 'North America', 'US');
+INSERT INTO user_extended_country VALUES('VIR', 'Virgin Islands, U.S.', 'North America', 'Caribbean', 'VI');
+INSERT INTO user_extended_country VALUES('ZWE', 'Zimbabwe', 'Africa', 'Eastern Africa', 'ZW');
+INSERT INTO user_extended_country VALUES('PSE', 'Palestine', 'Asia', 'Middle East', 'PS');
+INSERT INTO user_extended_country VALUES('ATA', 'Antarctica', 'Antarctica', 'Antarctica', 'AQ');
+INSERT INTO user_extended_country VALUES('BVT', 'Bouvet Island', 'Antarctica', 'Antarctica', 'BV');
+INSERT INTO user_extended_country VALUES('IOT', 'British Indian Ocean Territory', 'Africa', 'Eastern Africa', 'IO');
+INSERT INTO user_extended_country VALUES('SGS', 'South Georgia and the South Sandwich Islands', 'Antarctica', 'Antarctica', 'GS');
+INSERT INTO user_extended_country VALUES('HMD', 'Heard Island and McDonald Islands', 'Antarctica', 'Antarctica', 'HM');
+INSERT INTO user_extended_country VALUES('ATF', 'French Southern territories', 'Antarctica', 'Antarctica', 'TF');
+INSERT INTO user_extended_country VALUES('UMI', 'United States Minor Outlying Islands', 'Oceania', 'Micronesia/Caribbean', 'UM');
\ No newline at end of file
diff -ruN 6171/e107_admin/submenusgen.php 75/e107_admin/submenusgen.php
--- 6171/e107_admin/submenusgen.php	2004-09-06 04:54:58.000000000 -0500
+++ 75/e107_admin/submenusgen.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,268 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/submenugen.php
-|
-|        Lolo Irie (e107 core team) 2004
-|        http://touchatou.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("I")){ header("location:".e_BASE."index.php"); }
-$lan_file = e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_links.php";
-if(file_exists($lan_file)){@include_once($lan_file);}
-else{@include_once(e_LANGUAGEDIR."english/admin/lan_links.php");}
-
-require_once("auth.php");
-require_once(e_HANDLER."form_handler.php");
-require_once(e_HANDLER."submenus_handler.php");
-$rs = new form;
-//$aj = new textparse;
-
-
-
-unset($message);
-// Add links
-if($_POST['subNews']==1){
-        $sub_url = "news.php";
-        $sub_name = LAN_MENGEN_4; // News
-        $sub_getcat = "news_category";
-        $sub_getcatfield = "category_id, category_name";
-        $sub_getcatsql = "category_id !='-2' ORDER BY category_name ASC";
-        $sub_suburl = "news.php?cat.";
-        $message .= create_submenu();
-}
-
-if($_POST['subLinks']==1){
-        $sub_url = "links.php";
-        $sub_name = LAN_MENGEN_41; // Links
-        $sub_getcat = "link_category";
-        $sub_getcatfield = "link_category_id, link_category_name";
-        $sub_getcatsql = "link_category_id !='1' ORDER BY link_category_name ASC";
-        $sub_suburl = "links.php?cat.";
-        $message .= create_submenu();
-}
-
-if($_POST['subForums']==1){
-        $sub_url = "forum.php";
-        $sub_name = LAN_MENGEN_5; // Forum
-        $sub_getcat = "forum";
-        $sub_getcatfield = "forum_id, forum_name";
-        $sub_getcatsql = "forum_parent !='0' ORDER BY forum_order ASC";
-        $sub_suburl = "forum_viewforum.php?";
-        $message .= create_submenu();
-}
-
-if($_POST['subArticles']==1){
-        $sub_url = "content.php?article";
-        $sub_name = LAN_MENGEN_6; // Articles
-        $sub_getcat = "content";
-        $sub_getcatfield = "content_id, content_heading";
-        $sub_getcatsql = "content_type ='6' ORDER BY content_heading ASC";
-        $sub_suburl = "content.php?article.cat.";
-        $message .= create_submenu();
-}
-
-if($_POST['subDownloads']==1){
-        $sub_url = "download.php";
-        $sub_name = LAN_MENGEN_7; // Download
-        $sub_getcat = "download_category";
-        $sub_getcatfield = "download_category_id, download_category_name";
-        $sub_getcatsql = "download_category_parent ='0' ORDER BY download_category_name ASC";
-        $sub_suburl = "download.php#cat";
-        $message .= create_submenu();
-}
-
-// Add specific links
-if(isset($_POST['sublinkname'])){
-        for($i=0;$i<count($_POST['sublinkname']);$i++){
-                if($_POST['sublinkname'][$i]!=""){
-                        $namelink = explode(".",$_POST['sublinkname'][$i]);
-                        $name_link = str_replace("submenu.".$namelink[1].".","",$_POST['sublinkname'][$i]);
-                        if($_POST['sublinkurl'][$i]!=""){
-                                $sql -> db_Insert("links", "0, '".$_POST['sublinkname'][$i]."', '".$_POST['sublinkurl'][$i]."', '', '', '1', '".$i."', '0', '0', '0'");
-                                $message .= LAN_MENGEN_26."<b>".$name_link."</b>".LAN_MENGEN_30."<b>".$namelink[1]."</b><br />";
-                        }else{
-                                $message .= "<b>".$name_link."</b>".LAN_MENGEN_40."<br />";
-                        }
-                }
-        }
-}
-
-// Delete links
-if($_POST['delNews']==1){
-        $sub_suburl = "news.php?cat.";
-        $message .= delete_submenu();
-}
-if($_POST['delLinks']==1){
-        $sub_suburl = "links.php?cat.";
-        $message .= delete_submenu();
-}
-if($_POST['delForums']==1){
-        $sub_suburl = "forum_viewforum.php?";
-        $message .= delete_submenu();
-}
-if($_POST['delArticles']==1){
-        $sub_suburl = "content.php?article.cat.";
-        $message .= delete_submenu();
-}
-if($_POST['delDownloads']==1){
-        $sub_suburl = "download.php#cat";
-        $message .= delete_submenu();
-}
-if($_POST['delAll']==1){
-        $sub_delall = 1;
-        $message .= delete_submenu();
-}
-
-// Display messages
-if(isset($message)){
-        $ns -> tablerender(LAN_MENGEN_15,$message);
-}
-
-// Function to display HTML to add links
-function display_addlink($hsub_label, $hsub_element, $hsub_help){
-        $rs = new form;
-        $textform ="<tr>
-        <td style=\"width:30%; vertical-align:top\" class=\"forumheader3\">".$hsub_label."</td>\n
-        <td style=\"width:70%\" class=\"forumheader3\">\n";
-        $textform .= $rs -> form_checkbox($hsub_element,1,0);
-        $textform .= "<br /><b class=\"smalltext\" >".$hsub_help."</b></td>\n
-        </tr>\n";
-        return $textform;
-}
-// Function to display HTML to delete links
-function display_dellink($hsub_label, $hsub_element, $hsub_help){
-        $rs = new form;
-        $textform ="<tr>\n
-        <td style=\"width:30%; vertical-align:top\" class=\"forumheader3\">".$hsub_label."</td>\n
-        <td style=\"width:70%\" class=\"forumheader3\">\n";
-        $textform .= $rs -> form_checkbox($hsub_element,1,0);
-        $textform .= "<br /><b class=\"smalltext\" >".$hsub_help."</b></td>\n
-        </tr>\n";
-        return $textform;
-}
-// Automatic Menu Generator HTML
-
-$caption = LAN_MENGEN_1;
-$text = "";
-$text .= $rs -> form_open("post", e_SELF, "submenus_config");
-
-$text .= "<table style=\"width:94%\" class=\"fborder\" >\n";
-
-$text .="<tr>\n
-<td style=\"vertical-align:top\" colspan=\"2\"  >\n
-<img src=\"".e_IMAGE."generic/English/but_create.png\" width=\"55\" height=\"16\" style=\"vertical-align: middle; margin: 0px 5px 0px 5px;\" >
-<b>".LAN_MENGEN_2."</b><br /><b class=\"smalltext\" >".LAN_MENGEN_3."</b></td>\n
-</tr>\n";
-
-
-// Add news links
-$text .= display_addlink(LAN_MENGEN_4, "subNews", LAN_MENGEN_8);
-
-// Add news links
-$text .= display_addlink(LAN_MENGEN_41, "subLinks", LAN_MENGEN_42);
-
-// Add forums links
-$text .= display_addlink(LAN_MENGEN_5, "subForums", LAN_MENGEN_9);
-
-// Add articles links
-$text .= display_addlink(LAN_MENGEN_6, "subArticles", LAN_MENGEN_11);
-
-// Add downloads links
-$text .= display_addlink(LAN_MENGEN_7, "subDownloads", LAN_MENGEN_12);
-
-
-// Add other sublinks
-if($sql -> db_Select("links", "link_id,link_name,link_url", "link_category='1' AND link_name NOT REGEXP('submenu') AND (link_url NOT LIKE '%news.php%' AND link_url NOT LIKE '%forum.php%' AND link_url NOT LIKE '%content.php%' AND link_url NOT LIKE '%download.php%' AND link_url NOT LIKE '%links.php%')")){
-        $text .="<tr>
-        <td style=\"vertical-align:top\" class=\"forumheader3\" colspan=\"2\" >".LAN_MENGEN_34."\n";
-        $text .= "<br /><b class=\"smalltext\" >".LAN_MENGEN_36."</b></td>\n
-        </tr>\n";
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                $text .="<tr>
-                <td style=\"width:30%; vertical-align:top\" class=\"forumheader3\">".$row[1]."</td>\n
-                <td style=\"width:70%\" class=\"forumheader3\">".LAN_MENGEN_35."<ul>\n<li style=\"margin: 2px 0px 2px 0px;\" >1 ".LAN_MENGEN_37;
-                $text .= $rs -> form_text("sublinkname[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_37, " onchange=\"this.value='submenu.".$row[1].".'+this.value\" ");
-                $text .= " - ".LAN_MENGEN_39." ";
-                $text .= $rs -> form_text("sublinkurl[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_39);
-                $text .= "</li><li style=\"margin: 2px 0px 2px 0px;\">2 ".LAN_MENGEN_37;
-                $text .= $rs -> form_text("sublinkname[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_37, " onchange=\"this.value='submenu.".$row[1].".'+this.value\" ");
-                $text .= " - ".LAN_MENGEN_39." ";
-                $text .= $rs -> form_text("sublinkurl[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_39);
-                $text .= "</li><li style=\"margin: 2px 0px 2px 0px;\">3 ".LAN_MENGEN_37;
-                $text .= $rs -> form_text("sublinkname[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_37, " onchange=\"this.value='submenu.".$row[1].".'+this.value\" ");
-                $text .= " - ".LAN_MENGEN_39." ";
-                $text .= $rs -> form_text("sublinkurl[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_39);
-                $text .= "</li><li style=\"margin: 2px 0px 2px 0px;\">4 ".LAN_MENGEN_37;
-                $text .= $rs -> form_text("sublinkname[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_37, " onchange=\"this.value='submenu.".$row[1].".'+this.value\" ");
-                $text .= " - ".LAN_MENGEN_39." ";
-                $text .= $rs -> form_text("sublinkurl[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_39);
-                $text .= "</li><li style=\"margin: 2px 0px 2px 0px;\">5 ".LAN_MENGEN_37;
-                $text .= $rs -> form_text("sublinkname[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_37, " onchange=\"this.value='submenu.".$row[1].".'+this.value\" ");
-                $text .= " - ".LAN_MENGEN_39." ";
-                $text .= $rs -> form_text("sublinkurl[]", 20, "", 100, "tbox", FALSE, LAN_MENGEN_39);
-                $text .= "</li></ul>\n<b class=\"smalltext\" >".LAN_MENGEN_38."</b></td>\n
-                </tr>\n";
-        }
-}
-
-// Button Submit
-$text .="<tr>\n
-<td style=\"vertical-align:top; text-align: center;\" class=\"forumheader3\" colspan=\"2\" >\n";
-$text .= $rs -> form_button("submit", "submenus_submit", LAN_MENGEN_13." / ".LAN_MENGEN_18);
-$text .= "</td>\n
-</tr>\n";
-
-
-
-// Delete submenus
-$text .="<tr>\n
-<td style=\"vertical-align:top\" colspan=\"2\"  >\n
-<img src=\"".e_IMAGE."generic/English/but_delete.png\" width=\"55\" height=\"16\" style=\"vertical-align: middle; margin: 0px 5px 0px 5px;\" >\n
-<b>".LAN_MENGEN_19."</b><br /><b class=\"smalltext\" >".LAN_MENGEN_20."</b></td>
-</tr>\n";
-
-// Delete news links
-$text .= display_dellink(LAN_MENGEN_4, "delNews", LAN_MENGEN_21." ".LAN_MENGEN_4.LAN_MENGEN_22);
-
-// Delete Links sublinks
-$text .= display_dellink(LAN_MENGEN_41, "delLinks", LAN_MENGEN_43);
-
-// Delete forums links
-$text .= display_dellink(LAN_MENGEN_5, "delForums", LAN_MENGEN_21." ".LAN_MENGEN_5.LAN_MENGEN_22);
-
-// Delete articles links
-$text .= display_dellink(LAN_MENGEN_6, "delArticles", LAN_MENGEN_21." ".LAN_MENGEN_6.LAN_MENGEN_22);
-
-// Delete downloads links
-$text .= display_dellink(LAN_MENGEN_7, "delDownloads", LAN_MENGEN_21." ".LAN_MENGEN_7.LAN_MENGEN_22);
-
-// Delete ALL submenu links
-$text .="<tr>\n
-<td style=\"width:30%; vertical-align:top\" class=\"forumheader3\">".LAN_MENGEN_14."</td>\n
-<td style=\"width:70%\" class=\"forumheader3\">";
-$text .= $rs -> form_checkbox("delAll",1,0);
-$text .= "<br /><b class=\"smalltext\" >".LAN_MENGEN_17." ".LAN_MENGEN_4.", ".LAN_MENGEN_5.", ".LAN_MENGEN_6.", ".LAN_MENGEN_7.")<br />".LAN_MENGEN_23. " <a href=\"".e_ADMIN."links.php\" >".LAN_MENGEN_24."</a></b></td>\n
-</tr>\n";
-
-// Button Submit
-$text .="<tr>\n
-<td style=\"vertical-align:top; text-align: center;\" class=\"forumheader3\" colspan=\"2\" >\n";
-$text .= $rs -> form_button("submit", "delete_submit", LAN_MENGEN_13." / ".LAN_MENGEN_18);
-$text .= "</td>\n
-</tr>\n";
-
-$text .= "</table>\n";
-
-$text .= $rs -> form_close();
-
-$ns -> tablerender($caption, $text);
-
-require_once("footer.php");
-?>
\ No newline at end of file
diff -ruN 6171/e107_admin/theme.php 75/e107_admin/theme.php
--- 6171/e107_admin/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/theme.php	2005-03-15 06:08:01.000000000 -0600
@@ -0,0 +1,39 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/theme.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/03/15 12:08:01 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../class2.php");
+if (!getperms("1")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'theme_manage';
+
+require_once("auth.php");
+
+require_once(e_HANDLER."theme_handler.php");
+$themec = new themeHandler;
+
+
+
+$themec -> showThemes();
+require_once("footer.php");
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/theme_prev.php 75/e107_admin/theme_prev.php
--- 6171/e107_admin/theme_prev.php	2004-08-25 20:36:32.000000000 -0500
+++ 75/e107_admin/theme_prev.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,134 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/theme preview by Chavo
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-if (IsSet($_POST['updateprefs'])) {
-	require_once("../class2.php");
-	require_once(e_ADMIN."auth.php");
-	$pref['sitetheme'] = $_POST['sitetheme'];
-	save_prefs();
-	header("location:".e_SELF);
-	exit;
-}
-
-if(isSet($_POST['sitetheme'])) {
-    $temp_sitetheme = $_POST['sitetheme'];
-    define("USERTHEME", $temp_sitetheme);
-    require_once("../class2.php");
-    require_once(HEADERF);
-    $text = "<form method='post' action='".e_SELF."'>
-	<table style='width:95%' >
-	<tr>
-		<td >".TPVLAN_2."</td>
-	</tr>
-	<tr>
-		<td >".TPVLAN_10."
-		<input type ='hidden' name='sitetheme' value='".USERTHEME."'>
-		<input class='button' type='submit' name='updateprefs' value='".TPVLAN_15."'>
-		</td>
-	</tr>
-	<tr>
-		<td ><br />".TPVLAN_9."<br />"
-		.theme_dropdown()."
-	<input class='button' type='submit' name='previewtheme' value='".TPVLAN_6."' /></td>
-	</tr>
-	</table>
-	</form>
-		<br /><b>".TPVLAN_13."</b><br />
-	".$themename." v".$themeversion." by ".$themeauthor." (".$themedate.")";
-		$text .= (!empty($themeinfo) ? "<br />".TPVLAN_11.": ".$themeinfo."<br />" : "");
-		$ns->tablerender(TPVLAN_1, $text);
-		require_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_news.php");
-		require_once(e_HANDLER."news_class.php");
-		if (!is_object($aj)) {
-			$aj = new textparse;
-		}
-    $ix = new news;
-    ob_start();
-    $news_total = $sql -> db_Count("news");
-    if (!$sql -> db_Select("news", "*", "(news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ORDER BY news_datestamp DESC LIMIT 0,".ITEMVIEW)) {
-        echo "<br /><br /><div style='text-align:center'><b>".LAN_83."</b></div><br /><br />";
-    } else {
-        $sql2 = new db;
-        while (list($news['news_id'], $news['news_title'], $news['data'], $news['news_extended'], $news['news_datestamp'], $news['admin_id'], $news_category, $news['news_allow_comments'],  $news['news_start'], $news['news_end'], $news_active, $news['news_class']) = $sql -> db_Fetch()) {
-            if (strstr(USERCLASS, $news['news_class'].".") || !$news['news_class']) {
-                if (!$news_active) {
-                    if ($news['admin_id'] == 1) {
-                        $news['admin_name'] = $pref['siteadmin'];
-                    } else if (!$news['admin_name'] = getcachedvars($news['admin_id'])) {
-                        $sql2 -> db_Select("user", "user_name", "user_id='".$news['admin_id']."' ");
-                        list($news['admin_name']) = $sql2 -> db_Fetch();
-                        cachevars($news['admin_id'], $news['admin_name']);
-                    }
-                    $sql2 -> db_Select("news_category", "*",  "category_id='$news_category' ");
-                    list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2-> db_Fetch();
-                    $news['comment_total'] = $sql2 -> db_Count("comments", "(*)",  "WHERE comment_item_id='".$news['news_id']."' AND comment_type='0' ");
-                    $ix -> render_newsitem($news);
-                }
-            }
-        }
-    }
-    require_once(FOOTERF);
-    exit;
-}
-require_once("../class2.php");
-
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit;}
-
-require_once("auth.php");
-
-$text = (IsSet($message) ? $message : "");
-
-$text .= "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:95%' class='fborder' cellspacing='1' cellpadding='0'>
-<tr>
-<td style='width:50%' class='forumheader3'>".TPVLAN_5.":<br /><span class='smalltext'>".TPVLAN_14."</span></td>
-<td style='width:50%; text-align:right' class='forumheader3'>".
-theme_dropdown()."
-
-<input class='button' type='submit' name='previewtheme' value='".TPVLAN_6."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".TPVLAN_7."</div>", $text);
-
-require_once("footer.php");
-function theme_dropdown(){
-	$handle=opendir(e_THEME);
-	while ($file = readdir($handle)){
-		if($file != "." && $file != ".." && $file != "templates" && $file != "shared"){
-			if (is_readable(e_THEME.$file."/theme.php") && is_readable(e_THEME.$file."/style.css")){
-				$dirlist[] = $file;
-			}
-		}
-	}
-	closedir($handle);
-	$text ="<select name='sitetheme' class='tbox'>\n";
-	$counter = 0;
-	while(IsSet($dirlist[$counter])){
-		if($dirlist[$counter] == $pref['sitetheme'][1] || $dirlist[$counter] == USERTHEME){
-			$text .= "<option selected='selected'>".$dirlist[$counter]."</option>\n";
-		}else{
-		$text .= "<option>".$dirlist[$counter]."</option>\n";
-	}
-	$counter++;
-}
-$text .= "</select>";
-return $text;
-}
-?>	
\ No newline at end of file
diff -ruN 6171/e107_admin/ugflag.php 75/e107_admin/ugflag.php
--- 6171/e107_admin/ugflag.php	2004-05-18 22:32:30.000000000 -0500
+++ 75/e107_admin/ugflag.php	2005-12-24 19:26:59.000000000 -0600
@@ -1,79 +1,86 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/ugflag.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("9")){ header("location:".e_BASE."index.php"); exit;}
-require_once(e_HANDLER."ren_help.php");
-
-if(IsSet($_POST['updatesettings'])){
-        $aj = new textparse;
-        $pref['maintainance_flag'] = $_POST['maintainance_flag'];
-        $pref['maintainance_text'] = $aj -> formtpa($_POST['maintainance_text']);
-        save_prefs();
-        header("location:".e_SELF."?u");
-        exit;
-}
-
-require_once("auth.php");
-
-if(e_QUERY == "u"){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".UGFLAN_1.".</b></div>");
-}
-
-$maintainance_flag = $pref['maintainance_flag'];
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."' id='dataform'>
-<table style='width:85%' class='fborder'>
-<tr>
-<td style='width:30%' class='forumheader3'>".UGFLAN_2.": </td>
-<td style='width:70%' class='forumheader3'>";
-
-
-if($maintainance_flag == 1){
-        $text .= "<input type='checkbox' name='maintainance_flag' value='1'  checked='checked' />";
-}else{
-        $text .= "<input type='checkbox' name='maintainance_flag' value='1' />";
-}
-
-$text .= "</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".UGFLAN_5."<br /><span class='smalltext'>".UGFLAN_6."</span></td>
-<td style='width:70%' class='forumheader3'>
-<textarea class='tbox' name='maintainance_text' cols='59' rows='10' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$pref['maintainance_text']."</textarea>
-</td>
-</tr>
-
-<tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center' class='forumheader3'>
-".ren_help(2)."
-</td>
-</tr>
-
-
-<tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='updatesettings' value='".UGFLAN_3."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".UGFLAN_4."</div>", $text);
-require_once("footer.php");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/ugflag.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/25 01:26:59 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("9")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+$e_sub_cat = 'maintain';
+require_once(e_HANDLER."ren_help.php");
+
+if (isset($_POST['updatesettings'])) {
+	$pref['maintainance_flag'] = intval($_POST['maintainance_flag']);
+	$pref['maintainance_text'] = $tp->toDB($_POST['maintainance_text']);
+	save_prefs();
+	header("location:".e_SELF."?u");
+	exit;
+}
+
+require_once("auth.php");
+
+if (e_QUERY == "u") {
+	$ns->tablerender("", "<div style='text-align:center'><b>".UGFLAN_1.".</b></div>");
+}
+
+$maintainance_flag = $pref['maintainance_flag'];
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."' id='dataform'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+	<td style='width:30%' class='forumheader3'>".UGFLAN_2.": </td>
+	<td style='width:70%' class='forumheader3'>";
+
+
+if ($maintainance_flag == 1) {
+	$text .= "<input type='checkbox' name='maintainance_flag' value='1'  checked='checked' />";
+} else {
+	$text .= "<input type='checkbox' name='maintainance_flag' value='1' />";
+}
+
+$text .= "</td>
+	</tr>
+
+	<tr>
+	<td style='width:30%' class='forumheader3'>".UGFLAN_5."<br /><span class='smalltext'>".UGFLAN_6."</span></td>
+	<td style='width:70%' class='forumheader3'>
+	<textarea id='maintainance_text' class='tbox' name='maintainance_text' cols='59' rows='10' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$pref['maintainance_text']."</textarea>
+	</td>
+	</tr>
+
+	<tr style='vertical-align:top'>
+	<td colspan='2'  style='text-align:center' class='forumheader3'>
+	".display_help("",2)."
+	</td>
+	</tr>
+
+
+	<tr style='vertical-align:top'>
+	<td colspan='2'  style='text-align:center' class='forumheader'>
+	<input class='button' type='submit' name='updatesettings' value='".UGFLAN_3."' />
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+
+$ns->tablerender(UGFLAN_4, $text);
+require_once("footer.php");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/updateadmin.php 75/e107_admin/updateadmin.php
--- 6171/e107_admin/updateadmin.php	2004-05-18 22:32:30.000000000 -0500
+++ 75/e107_admin/updateadmin.php	2006-02-14 21:23:43.000000000 -0600
@@ -1,77 +1,73 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/updateadmin.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-require_once("auth.php");
-
-if(IsSet($_POST['update_settings'])){
-        if($_POST['ac'] == md5(ADMINPWCHANGE)){
-                if($_POST['a_password'] != "" && $_POST['a_password2'] != "" && ($_POST['a_password'] == $_POST['a_password2'])){
-                        $sql -> db_Update("user", "user_password='".md5($_POST['a_password'])."', user_pwchange='".time()."' WHERE user_name='".ADMINNAME."' ");
-                        $se = TRUE;
-                }else{
-                        $message = UDALAN_1;
-                }
-        }
-}
-
-if($se == TRUE){
-        $text = "<div style='text-align:center'>".UDALAN_2.".</div>";
-        $ns -> tablerender("<div style='text-align:center'>".UDALAN_3." ".($a_name ? $a_name : ADMINNAME)."</div>", $text);
-        require_once("footer.php");
-        exit;
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>\n
-<table style='width:85%' class='fborder'>
-<tr>
-<td style='width:30%' class='forumheader3'>".UDALAN_4.": </td>
-<td style='width:70%' class='forumheader3'>
-".ADMINNAME."
-</td>
-</tr>
-<tr>
-<td style='width:30%' class='forumheader3'>".UDALAN_5.": </td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='password' name='a_password' size='60' value='' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".UDALAN_6.": </td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='password' name='a_password2' size='60' value='' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td colspan='2' style ='text-align:center'  class='forumheader'>
-<input class='button' type='submit' name='update_settings' value='".UDALAN_7."' />
-<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />  
-</td>
-</tr>
-</table>
-
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".UDALAN_8." ".ADMINNAME."</div>", $text);
-
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/updateadmin.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2006/02/15 03:23:43 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once('../class2.php');
+$e_sub_cat = 'admin_pass';
+require_once('auth.php');
+
+if (isset($_POST['update_settings'])) {
+	if ($_POST['ac'] == md5(ADMINPWCHANGE)) {
+		if ($_POST['a_password'] != "" && $_POST['a_password2'] != "" && ($_POST['a_password'] == $_POST['a_password2'])) {
+			if (admin_update($sql -> db_Update("user", "user_password='".md5($_POST['a_password'])."', user_pwchange='".time()."' WHERE user_name='".ADMINNAME."'"), 'update', UDALAN_3." ".ADMINNAME)) {
+				$e_event -> trigger('adpword');
+			}
+		} else {
+			$ns->tablerender(LAN_UPDATED_FAILED, "<div style='text-align:center'><b>".UDALAN_1."</b></div>");
+		}
+	}
+} else {
+	$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>\n
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+	<td style='width:30%' class='forumheader3'>".UDALAN_4.": </td>
+	<td style='width:70%' class='forumheader3'>
+	".ADMINNAME."
+	</td>
+	</tr>
+	<tr>
+	<td style='width:30%' class='forumheader3'>".UDALAN_5.": </td>
+	<td style='width:70%' class='forumheader3'>
+	<input class='tbox' type='password' name='a_password' size='60' value='' maxlength='20' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:30%' class='forumheader3'>".UDALAN_6.": </td>
+	<td style='width:70%' class='forumheader3'>
+	<input class='tbox' type='password' name='a_password2' size='60' value='' maxlength='20' />
+	</td>
+	</tr>
+
+	<tr>
+	<td colspan='2' style ='text-align:center'  class='forumheader'>
+	<input class='button' type='submit' name='update_settings' value='".UDALAN_7."' />
+	<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
+	</td>
+	</tr>
+	</table>
+
+	</form>
+	</div>";
+
+	$ns->tablerender(UDALAN_8." ".ADMINNAME, $text);
+}
+
+require_once('footer.php');
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/update_routines.php 75/e107_admin/update_routines.php
--- 6171/e107_admin/update_routines.php	2004-08-19 22:59:14.000000000 -0500
+++ 75/e107_admin/update_routines.php	2006-04-08 19:51:16.000000000 -0500
@@ -1,189 +1,1553 @@
-<?php
-
-require_once("../class2.php");
-
-$dbupdate=array(	
-						"616_to_617" => LAN_UPDATE_8." .616 ".LAN_UPDATE_9." .617",
-						"615_to_616" => LAN_UPDATE_8." .615 ".LAN_UPDATE_9." .616",
-						"614_to_615" => LAN_UPDATE_8." .614 ".LAN_UPDATE_9." .615",
-						"613b_to_614" => LAN_UPDATE_8." .613b ".LAN_UPDATE_9." .614",
-						"611_to_612" => LAN_UPDATE_8." .611 ".LAN_UPDATE_9." .612",
-						"603_to_604" => LAN_UPDATE_8." .603 ".LAN_UPDATE_9." .604",
-					);
-
-
-function update_check(){
-	global $ns, $dbupdate;
-	foreach($dbupdate as $func => $rmks){
-		if(function_exists("update_".$func)){
-			if(!call_user_func("update_".$func)){
-				$update_needed=TRUE;
-				continue;
-			}
-		}
-	}
-	if($update_needed === TRUE){
-		$txt = "<div style='text-align:center;'>".ADLAN_120;
-		$txt .= "<br /><form method='POST' action='".e_ADMIN."e107_update.php'>
-		<input class='button' type='submit' value='".ADLAN_122."' />
-		</form></div>";
-		$ns -> tablerender(ADLAN_122,$txt);
-	}
-}
-
-
-
-function update_616_to_617($type){
-	global $sql;
-	if($type=="do"){
-		mysql_query("ALTER TABLE  ".MPREFIX."poll ADD poll_comment TINYINT( 3 ) UNSIGNED DEFAULT '1' NOT NULL ");
-		mysql_query("ALTER TABLE  ".MPREFIX."menus ADD menu_pages TEXT NOT NULL ");
-		$sql2 = new db;
-		$sql2 -> db_Update("poll", "poll_comment='1' WHERE poll_id!='0'");
-	} else {
-		global $mySQLdefaultdb;
-		$fields = mysql_list_fields($mySQLdefaultdb,MPREFIX."menus");
-		$columns = mysql_num_fields($fields);
-		for ($i = 0; $i < $columns; $i++) {
-	   	if("menu_pages" == mysql_field_name($fields, $i)){return TRUE;}
-		}
-		return FALSE;
-	}
-}
-
-function update_615_to_616($type){
-	global $sql;
-	if($type=="do"){
-		mysql_query("INSERT INTO ".MPREFIX."wmessage VALUES (4, 'This text (if activated) will appear on a page when \"Forum Rules\" link is clicked on.', '0')");
-		mysql_query("INSERT INTO ".MPREFIX."wmessage VALUES (5, 'Member rules ----- This text (if activated) will appear on a page when \"Forum Rules\" link is clicked on - only logged in members will see this.', '0')");
-		mysql_query("INSERT INTO ".MPREFIX."wmessage VALUES (6, 'Administrator rules ----- This text (if activated) will appear on a page when \"Forum Rules\" link is clicked on - only logged in administrators will see this.', '0')");
-		mysql_query("ALTER TABLE ".MPREFIX."download ADD download_comment TINYINT( 3 ) UNSIGNED NOT NULL ");
-		mysql_query("ALTER TABLE ".MPREFIX."chatbox CHANGE cb_nick cb_nick VARCHAR( 30 ) NOT NULL ");
-		mysql_query("ALTER TABLE ".MPREFIX."comments CHANGE comment_type comment_type VARCHAR( 10 ) DEFAULT '0' NOT NULL ");
- 		mysql_query("ALTER TABLE ".MPREFIX."comments ADD comment_pid INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL AFTER comment_id ");
-		mysql_query("ALTER TABLE ".MPREFIX."comments ADD comment_subject VARCHAR( 100 ) NOT NULL AFTER comment_item_id ");
-		mysql_query("ALTER TABLE ".MPREFIX."user ADD user_customtitle VARCHAR( 100 ) NOT NULL AFTER user_name ");
-		mysql_query("ALTER TABLE ".MPREFIX."parser ADD UNIQUE (parser_regexp)");
-		mysql_query("ALTER TABLE ".MPREFIX."userclass_classes ADD userclass_editclass TINYINT( 3 ) UNSIGNED NOT NULL ");
-		update_extended_616();
-	} else {
-		global $mySQLdefaultdb;
-		$fields = mysql_list_fields($mySQLdefaultdb,MPREFIX."userclass_classes");
-		$columns = mysql_num_fields($fields);
-		for ($i = 0; $i < $columns; $i++) {
-	   	if("userclass_editclass" == mysql_field_name($fields, $i)){return TRUE;}
-		}
-		return FALSE;
-	}
-}
-
-function update_614_to_615($type){
-	global $sql;
-	if($type=="do"){
-		mysql_query("ALTER TABLE ".MPREFIX."submitnews ADD submitnews_category TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER submitnews_title");
-		mysql_query("ALTER TABLE ".MPREFIX."upload ADD upload_category TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'");
-		mysql_query("ALTER TABLE ".MPREFIX."online ADD online_pagecount tinyint(3) unsigned NOT NULL default '0'");
-		mysql_query("ALTER TABLE ".MPREFIX."submitnews ADD submitnews_file VARCHAR(100) NOT NULL default '' ");
-
-		global $DOWNLOADS_DIRECTORY;
-		$sql2 = new db;
-		$sql -> db_Select("download", "download_id, download_url", "download_filesize=0");
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$sql2 -> db_Update("download", "download_filesize='".filesize(e_BASE.$DOWNLOADS_DIRECTORY.$download_url)."' WHERE download_id='".$download_id."'");
-		}
-	} else {
-		global $mySQLdefaultdb;
-		$fields = mysql_list_fields($mySQLdefaultdb,MPREFIX."submitnews");
-		$columns = mysql_num_fields($fields);
-		for ($i = 0; $i < $columns; $i++) {
-	   	if("submitnews_file" == mysql_field_name($fields, $i)){return TRUE;}
-		}
-		return FALSE;
-	}
-}
-
-
-function update_613b_to_614($type){
-	global $sql;
-	if($type=="do"){
-		$qry = "CREATE TABLE ".MPREFIX."parser (
-		parser_id int(10) unsigned NOT NULL auto_increment,
-		parser_pluginname varchar(100) NOT NULL default '',
-	  	parser_regexp varchar(100) NOT NULL default '',
-	  	PRIMARY KEY  (parser_id)) TYPE=MyISAM;";
-		$sql -> db_Select_gen($qry);
-	} else {
-		if($sql -> db_Select("parser") === FALSE){
-			return FALSE;
-		} else {
-			return TRUE;
-		}
-	}
-}
-
-function update_611_to_612($type){
-	global $sql;
-	if($type=="do"){
-		mysql_query("ALTER TABLE ".MPREFIX."news ADD news_render_type TINYINT UNSIGNED NOT NULL ");
-		mysql_query("ALTER TABLE ".MPREFIX."content CHANGE content_parent content_parent INT UNSIGNED DEFAULT '0' NOT NULL ");
-	} else {
-		global $mySQLdefaultdb;
-		$fields = mysql_list_fields($mySQLdefaultdb,MPREFIX."news");
-		$columns = mysql_num_fields($fields);
-		for ($i = 0; $i < $columns; $i++) {
-	   	if("news_render_type" == mysql_field_name($fields, $i)){return TRUE;}
-		}
-		return FALSE;
-	}
-}
-
-function update_603_to_604($type){
-	global $sql;
-	if($type=="do"){
-		mysql_query("ALTER TABLE ".MPREFIX."link_category ADD link_category_icon VARCHAR( 100 ) NOT NULL");
-		mysql_query("ALTER TABLE ".MPREFIX."headlines ADD headline_image VARCHAR( 100 ) NOT NULL AFTER headline_description");
-		mysql_query("ALTER TABLE ".MPREFIX."content CHANGE content_page content_parent TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL");
-		mysql_query("ALTER TABLE ".MPREFIX."content ADD content_review_score TINYINT UNSIGNED NOT NULL AFTER content_type");
-		mysql_query("ALTER TABLE ".MPREFIX."content CHANGE content_author content_author VARCHAR( 200 ) NOT NULL");
-		mysql_query("ALTER TABLE ".MPREFIX."content ADD content_pe_icon TINYINT( 1 ) UNSIGNED NOT NULL AFTER content_review_score");
-	} else {
-		global $mySQLdefaultdb;
-		$fields = mysql_list_fields($mySQLdefaultdb,MPREFIX."link_category");
-		$columns = mysql_num_fields($fields);
-		for ($i = 0; $i < $columns; $i++) {
-	   	if("link_category_icon" == mysql_field_name($fields, $i)){return TRUE;}
-		}
-		return FALSE;
-	}
-}
-
-function update_extended_616(){
-	global $sql, $ns;
-	$sql2 = new db;
-	if($sql2 -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-		$row = $sql2 -> db_Fetch();
-		$user_extended = unserialize($row[0]);
-		if(count($user_extended)){
-			if($sql -> db_Select("user","user_id,user_prefs")){
-				while($row = $sql -> db_Fetch()){
-					$uid = $row[0];
-					$user_pref = unserialize($row[1]);
-					foreach($user_extended as $key => $v){
-						list($fname,$null)=explode("|",$v,2);
-						$fname = $v;
-						if(isset($user_pref[$fname])){
-							$user_pref["ue_{$key}"]=$user_pref[$fname];
-							unset($user_pref[$fname]);
-						}
-					}
-					$tmp = addslashes(serialize($user_pref));
-					$sql2 -> db_Update("user", "user_prefs='$tmp' WHERE user_id=$uid");
-				}
-			}
-		}
-	}
-	$ns -> tablerender("Extended Users","Updated extended user field data");
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/update_routines.php,v $
+|     $Revision: 1.178 $
+|     $Date: 2006/04/09 00:51:16 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../class2.php");
+
+if (isset($pref['signup_options'])) // CONVERT 0.6 STYLE SIGNUP OPTIONS
+{
+    $tmp = explode(".", $pref['signup_options']);
+	$pref['signup_option_realname']  = $tmp[0];
+	$pref['signup_option_signature'] = $tmp[7];
+	$pref['signup_option_image']     = $tmp[8];
+	$pref['signup_option_timezone']  = $tmp[9];
+	$pref['signup_option_class']     = $tmp[10];
+	unset($pref['signup_options']);
+	save_prefs();
+}
+
+if (!$pref['displayname_maxlength'])
+{
+  $pref['displayname_maxlength'] = 15;
+  save_prefs();
+}
+
+if (!defined("LAN_UPDATE_8")) { define("LAN_UPDATE_8", ""); }
+if (!defined("LAN_UPDATE_9")) { define("LAN_UPDATE_9", ""); }
+
+if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'forum' AND plugin_installflag='1' ")) {
+	if(file_exists(e_PLUGIN.'forum/forum_update_check.php'))
+	{
+		include_once(e_PLUGIN.'forum/forum_update_check.php');
+	}
+}
+if ($sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."stat_info") && $sql -> db_Select("plugin", "*", "plugin_path = 'log' AND plugin_installflag='1'")) {
+	if(file_exists(e_PLUGIN.'log/log_update_check.php'))
+	{
+		include_once(e_PLUGIN.'log/log_update_check.php');
+	}
+}
+
+//content
+if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'content' AND plugin_installflag='1' "))
+{
+	if(file_exists(e_PLUGIN.'content/content_update_check.php'))
+	{
+		include_once(e_PLUGIN.'content/content_update_check.php');
+	}
+}
+
+if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'pm' AND plugin_installflag='1' "))
+{
+	if(file_exists(e_PLUGIN.'pm/pm_update_check.php'))
+	{
+		include_once(e_PLUGIN.'pm/pm_update_check.php');
+	}
+}
+
+// $dbupdate["701_to_702"] = LAN_UPDATE_8." .7.1 ".LAN_UPDATE_9." .7.2";
+$dbupdate["617_to_700"] = LAN_UPDATE_8." .617 ".LAN_UPDATE_9." .7";
+$dbupdate["616_to_617"] = LAN_UPDATE_8." .616 ".LAN_UPDATE_9." .617";
+$dbupdate["615_to_616"] = LAN_UPDATE_8." .615 ".LAN_UPDATE_9." .616";
+$dbupdate["614_to_615"] = LAN_UPDATE_8." .614 ".LAN_UPDATE_9." .615";
+$dbupdate["611_to_612"] = LAN_UPDATE_8." .611 ".LAN_UPDATE_9." .612";
+$dbupdate["603_to_604"] = LAN_UPDATE_8." .603 ".LAN_UPDATE_9." .604";
+
+function update_check() {
+	global $ns, $dbupdate, $dbupdatep;
+	foreach($dbupdate as $func => $rmks) {
+		if (function_exists("update_".$func)) {
+			if (!call_user_func("update_".$func, FALSE)) {
+				$update_needed = TRUE;
+				continue;
+			}
+		}
+	}
+
+	foreach($dbupdatep as $func => $rmks) {
+		if (function_exists("update_".$func)) {
+			if (!call_user_func("update_".$func, FALSE)) {
+				$update_needed = TRUE;
+				continue;
+			}
+		}
+	}
+
+	if ($update_needed === TRUE) {
+		$txt = "<div style='text-align:center;'>".ADLAN_120;
+		$txt .= "<br /><form method='POST' action='".e_ADMIN."e107_update.php'>
+		<input class='button' type='submit' value='".LAN_UPDATE."' />
+		</form></div>";
+		$ns->tablerender(LAN_UPDATE, $txt);
+	}
+}
+/*
+// ------------------------------- .7.1 to .7.2 etc ----------------------------------
+function update_701_to_702($type='') {
+
+//  $sql->db_Query_all() must be used for all mysql queries to avoid serious multi-language issues.
+
+
+}
+*/
+
+// ------------------------------- .6 to .7 ----------------------------------
+function update_617_to_700($type='') {
+	global $sql, $ns, $mySQLdefaultdb, $pref, $tp, $sysprefs, $eArrayStorage;
+	if ($type == "do") {
+
+		set_time_limit(400);
+		$s_prefs = FALSE;
+
+		// Lets build an array with all the table names.
+		$result = mysql_query("SHOW tables");
+		while($row = mysql_fetch_row($result))
+		{
+			$tablenames[]=$row[0];
+		}
+
+		// Switch 0.6xx upgraders back to standard English pack ========================
+		if ($pref['sitelanguage'] == 'English-iso') {
+			$pref['sitelanguage'] = 'English';
+			$s_prefs = TRUE;
+		}
+
+		if ($sql -> db_Select("link_category", "link_category_id")){
+			if (is_dir(e_LANGUAGEDIR.e_LANGUAGE."-iso")) {
+				$pref['sitelanguage'] = $pref['sitelanguage']."-iso";
+				$s_prefs = TRUE;
+			}
+		}
+
+		// ==============================================================
+
+		// add an index on user_ban - speeds up page render time massively on large user tables.
+		mysql_query("ALTER TABLE `".MPREFIX."user` ADD INDEX `user_ban_index`(`user_ban`);");
+		catch_error();
+
+		if(!$sql -> db_Select("userclass_classes", "*", "userclass_editclass='254' ")){
+			$sql->db_Update("userclass_classes", "userclass_editclass='254' WHERE userclass_editclass ='0' ");
+			catch_error();
+		}
+
+		/*
+		changes by jalist 19/01/05:
+		altered structure of news table
+		*/
+			mysql_query("ALTER TABLE ".MPREFIX."news ADD news_comment_total int(10) unsigned NOT NULL default '0'");
+			catch_error();
+			$sql->db_Select_gen("SELECT comment_item_id AS id, COUNT(*) AS amount FROM #comments GROUP BY comment_item_id");
+			$commentArray = $sql->db_getList();
+			foreach($commentArray as $comments) {
+				extract($comments);
+				$sql->db_Update("news", "news_comment_total=$amount WHERE news_id=$id");
+				catch_error();
+			}
+			mysql_query("ALTER TABLE `".MPREFIX."content` CHANGE `content_content` `content_content` LONGTEXT NOT NULL");
+			catch_error();
+		/* end */
+
+		/* start poll update */
+			$query = "CREATE TABLE ".MPREFIX."polls (
+			poll_id int(10) unsigned NOT NULL auto_increment,
+			poll_datestamp int(10) unsigned NOT NULL default '0',
+			poll_start_datestamp int(10) unsigned NOT NULL default '0',
+			poll_end_datestamp int(10) unsigned NOT NULL default '0',
+			poll_admin_id int(10) unsigned NOT NULL default '0',
+			poll_title varchar(250) NOT NULL default '',
+			poll_options text NOT NULL,
+			poll_votes text NOT NULL,
+			poll_ip text NOT NULL,
+			poll_type tinyint(1) unsigned NOT NULL default '0',
+			poll_comment tinyint(1) unsigned NOT NULL default '1',
+			poll_allow_multiple tinyint(1) unsigned NOT NULL default '0',
+			poll_result_type tinyint(2) unsigned NOT NULL default '0',
+			poll_vote_userclass tinyint(3) unsigned NOT NULL default '0',
+			poll_storage_method tinyint(1) unsigned NOT NULL default '0',
+			PRIMARY KEY  (poll_id)
+			) TYPE=MyISAM;";
+			$sql->db_Select_gen($query);
+			catch_error();
+			if($sql -> db_Select("poll"))
+			{
+				$polls = $sql -> db_getList();
+				foreach($polls as $row)
+				{
+					extract($row);
+					$poll_options = "";
+					$poll_votes = "";
+					for($count=1; $count <= 10; $count++)
+					{
+						$var = "poll_option_".$count;
+						$var2 = "poll_votes_".$count;
+						if($$var)
+						{
+							$poll_options .= $$var.chr(1);
+							$poll_votes .= $$var2.chr(1);
+						}
+					}
+					$poll_type = (strlen($poll_datestamp) > 9 ? 1 : 2);
+					$sql->db_Insert("polls", "$poll_id, $poll_datestamp, 0, $poll_end_datestamp, $poll_admin_id, '$poll_title', '$poll_options', '$poll_votes', '$poll_ip', $poll_type, $poll_comment, 0, 0, 255, 1");
+					catch_error();
+				}
+				$sql -> db_Select("polls", "poll_id", "poll_type=1 ORDER BY poll_datestamp DESC LIMIT 0,1");
+				$row = $sql -> db_Fetch();
+				$sql -> db_Update("polls", "poll_vote_userclass=0 WHERE poll_id=".$row['poll_id']);
+				$sql->db_Select_gen("DROP TABLE ".MPREFIX."poll");
+				catch_error();
+			}
+		/* end poll update */
+
+		/* general table structure changes */
+			mysql_query("ALTER TABLE `".MPREFIX."user` CHANGE `user_sess` `user_sess` varchar(100) NOT NULL default ''");
+			catch_error();
+		/*	end	*/
+
+
+		/* start newsfeed update */
+		if (!mysql_table_exists('newsfeed')) {
+			$sql->db_Select_gen("CREATE TABLE ".MPREFIX."newsfeed (
+			newsfeed_id int(10) unsigned NOT NULL auto_increment,
+			newsfeed_name varchar(150) NOT NULL default '',
+			newsfeed_url varchar(150) NOT NULL default '',
+			newsfeed_data longtext NOT NULL,
+			newsfeed_timestamp int(10) unsigned NOT NULL default '0',
+			newsfeed_description text NOT NULL,
+			newsfeed_image varchar(100) NOT NULL default '',
+			newsfeed_active tinyint(1) unsigned NOT NULL default '0',
+			newsfeed_updateint int(10) unsigned NOT NULL default '0',
+			PRIMARY KEY  (newsfeed_id)
+			) TYPE=MyISAM;");
+			catch_error();
+		}
+
+		if (mysql_table_exists('newsfeed')) {
+			mysql_query("ALTER TABLE `".MPREFIX."newsfeed` CHANGE `newsfeed_data` `newsfeed_data` LONGTEXT NOT NULL");
+			catch_error();
+			$sql -> db_Update("newsfeed", "newsfeed_timestamp='0' ");
+			catch_error();
+		}
+		/*	end 	*/
+
+		/* start emote update */
+			$tmp =
+			'a:28:{s:9:"alien!png";s:6:"!alien";s:10:"amazed!png";s:7:"!amazed";s:9:"angry!png";s:11:"!grr !angry";s:12:"biglaugh!png";s:4:"!lol";s:11:"cheesey!png";s:10:":D :oD :-D";s:12:"confused!png";s:10:":? :o? :-?";s:7:"cry!png";s:19:"&| &-| &o| :(( !cry";s:8:"dead!png";s:21:"x) xo) x-) x( xo( x-(";s:9:"dodge!png";s:6:"!dodge";s:9:"frown!png";s:10:":( :o( :-(";s:7:"gah!png";s:10:":@ :o@ :o@";s:8:"grin!png";s:10:":D :oD :-D";s:9:"heart!png";s:6:"!heart";s:8:"idea!png";s:10:":! :o! :-!";s:7:"ill!png";s:4:"!ill";s:7:"mad!png";s:13:"~:( ~:o( ~:-(";s:12:"mistrust!png";s:9:"!mistrust";s:11:"neutral!png";s:10:":| :o| :-|";s:12:"question!png";s:2:"?!";s:12:"rolleyes!png";s:10:"B) Bo) B-)";s:7:"sad!png";s:4:"!sad";s:10:"shades!png";s:10:"8) 8o) 8-)";s:7:"shy!png";s:4:"!shy";s:9:"smile!png";s:10:":) :o) :-)";s:11:"special!png";s:3:"%-6";s:12:"suprised!png";s:10:":O :oO :-O";s:10:"tongue!png";s:21:":p :op :-p :P :oP :-P";s:8:"wink!png";s:10:";) ;o) ;-)";}';
+			$sql->db_Insert("core", "'emote_default', '$tmp' ");
+			catch_error();
+
+			if(!$pref['emotepack']){
+        			$pref['emotepack'] = "default";
+			}
+			mysql_query("ALTER TABLE ".MPREFIX."core CHANGE e107_name e107_name varchar(100) NOT NULL default ''");
+			catch_error();
+		/*	end 	*/
+
+		/* start download updates */
+		if (!mysql_table_exists("download_mirror")) {
+			$query = "CREATE TABLE ".MPREFIX."download_mirror (
+			mirror_id int(10) unsigned NOT NULL auto_increment,
+			mirror_name varchar(200) NOT NULL default '',
+			mirror_url varchar(200) NOT NULL default '',
+			mirror_image varchar(200) NOT NULL default '',
+			mirror_location varchar(100) NOT NULL default '',
+			mirror_description text NOT NULL,
+			mirror_count int(10) unsigned NOT NULL default '0',
+			PRIMARY KEY  (mirror_id)
+			) TYPE=MyISAM;";
+			$sql->db_Select_gen($query);
+			catch_error();
+			mysql_query("ALTER TABLE ".MPREFIX."download ADD download_class TINYINT ( 3 ) UNSIGNED NOT NULL");
+			catch_error();
+			mysql_query("ALTER TABLE ".MPREFIX."download_category ADD download_category_order int(10) unsigned NOT NULL default '0'");
+			catch_error();
+			mysql_query("ALTER TABLE `".MPREFIX."download` ADD `download_mirror` TEXT NOT NULL , ADD `download_mirror_type` tinyint(1) unsigned NOT NULL default '0' ");
+			catch_error();
+		}
+		/*	end	*/
+
+
+		/* start user update */
+			mysql_query("ALTER TABLE ".MPREFIX."user ADD user_loginname varchar(100) NOT NULL default '' AFTER user_name");
+			catch_error();
+			mysql_query("ALTER TABLE ".MPREFIX."user ADD user_xup varchar(100) NOT NULL default ''");
+			catch_error();
+			$sql->db_Update("user", "user_loginname=user_name WHERE user_loginname=''");
+			catch_error();
+		/* end */
+
+		/* start page update */
+		if (!mysql_table_exists("page")) {
+			$sql->db_Select_gen("CREATE TABLE ".MPREFIX."page (
+		  	page_id int(10) unsigned NOT NULL auto_increment,
+		  	page_title varchar(250) NOT NULL default '',
+		  	page_text mediumtext NOT NULL,
+		  	page_author int(10) unsigned NOT NULL default '0',
+		  	page_datestamp int(10) unsigned NOT NULL default '0',
+		  	page_rating_flag tinyint(1) unsigned NOT NULL default '0',
+		  	page_comment_flag tinyint(1) unsigned NOT NULL default '0',
+		  	page_password varchar(50) NOT NULL default '',
+		  	page_class varchar(250) NOT NULL default '',
+		  	page_ip_restrict text NOT NULL,
+		  	page_theme varchar(50) NOT NULL default '',
+		  	PRIMARY KEY  (page_id)
+			) TYPE=MyISAM;");
+			catch_error();
+			mysql_query("ALTER TABLE ".MPREFIX."page CHANGE page_class page_class varchar(250) NOT NULL default ''");
+			catch_error();
+		}
+		/*	end 	*/
+
+
+		// start links update -------------------------------------------------------------------------------------------
+			if ($sql->db_Query("SHOW COLUMNS FROM ".MPREFIX."link_category")) {
+				global $IMAGES_DIRECTORY, $PLUGINS_DIRECTORY;
+
+				$sql->db_Select_gen("CREATE TABLE ".MPREFIX."links_page_cat (
+				link_category_id int(10) unsigned NOT NULL auto_increment,
+				link_category_name varchar(100) NOT NULL default '',
+				link_category_description varchar(250) NOT NULL default '',
+				link_category_icon varchar(100) NOT NULL default '',
+				PRIMARY KEY  (link_category_id)
+				) TYPE=MyISAM;");
+				catch_error();
+				$sql->db_Select_gen("CREATE TABLE ".MPREFIX."links_page (
+				link_id int(10) unsigned NOT NULL auto_increment,
+				link_name varchar(100) NOT NULL default '',
+				link_url varchar(200) NOT NULL default '',
+				link_description text NOT NULL,
+				link_button varchar(100) NOT NULL default '',
+				link_category tinyint(3) unsigned NOT NULL default '0',
+				link_order int(10) unsigned NOT NULL default '0',
+				link_refer int(10) unsigned NOT NULL default '0',
+				link_open tinyint(1) unsigned NOT NULL default '0',
+				link_class tinyint(3) unsigned NOT NULL default '0',
+				PRIMARY KEY  (link_id)
+				) TYPE=MyISAM;");
+				catch_error();
+				$new_cat_id = 1;
+				$sql->db_Select("link_category", "*", "link_category_id!=1 ORDER BY link_category_id");
+				while ($row = $sql->db_Fetch()) {
+					$link_cat_id[$row['link_category_id']] = $new_cat_id;
+					if ($row['link_category_icon']) {
+						$link_category_icon = strstr($row['link_category_icon'], "/") ? $row['link_category_icon'] : $IMAGES_DIRECTORY."link_icons/".$row['link_category_icon'];
+					} else {
+						$link_category_icon = "";
+					}
+					$link_cat_export[] = "'0', '".$row['link_category_name']."', '".$row['link_category_description']."', '".$link_category_icon."'";
+					$link_cat_del[] = $row['link_category_id'];
+					$new_cat_id++;
+				}
+
+				foreach ($link_cat_export as $link_cat_export_commit) {
+					if (!$sql->db_Insert("links_page_cat", $link_cat_export_commit)) {
+						$links_upd_failed = TRUE;
+					}
+				}
+
+				$sql->db_Select("links", "*", "link_category!=1 ORDER BY link_category");
+				while ($row = $sql->db_Fetch()) {
+					if ($row['link_button']) {
+						$link_button = strstr($row['link_button'], "/") ? $row['link_button'] : $IMAGES_DIRECTORY."link_icons/".$row['link_button'];
+					} else {
+						$link_button = "";
+					}
+					$link_export[] = "'0', '".$row['link_name']."', '".$row['link_url']."', '".$row['link_description']."', '".$link_button."', '".$link_cat_id[$row['link_category']]."', '".$row['link_order']."', '".$row['link_refer']."', '".$row['link_open']."', '".$row['link_class']."'";
+					$link_del[] = $row['link_id'];
+				}
+
+				foreach ($link_export as $link_export_commit) {
+					if (!$sql->db_Insert("links_page", $link_export_commit)) {
+						$links_upd_failed = TRUE;
+					}
+				}
+
+				if (!$links_upd_failed) {
+					$sql->db_Select_gen("DROP TABLE ".MPREFIX."link_category");
+
+					foreach ($link_del as $link_del_commit) {
+						$sql->db_Delete("links", "link_id='".$link_del_commit."'");
+					}
+				}
+				$sql->db_Insert("plugin", "0, 'Links Page', '1.0', 'links_page', 1");
+				$sql->db_Update("links", "link_url = '".$PLUGINS_DIRECTORY."links_page/links.php' WHERE link_url = 'links.php'");
+
+				$pref['plug_latest'] = $pref['plug_latest'].",links_page";
+				$s_prefs = TRUE;
+			}
+		// end links update -------------------------------------------------------------------------------------------
+
+		//  #########  McFly's 0.7 Updates ############
+
+		// parse table obsolete
+		if(mysql_table_exists("parser")){
+			mysql_query('DROP TABLE `'.MPREFIX.'parser`');
+			catch_error();
+        }
+			mysql_query("ALTER TABLE ".MPREFIX."menus ADD menu_path varchar(100) NOT NULL default ''");
+			catch_error();
+
+			$sql -> db_Update("menus", "menu_path='poll/' WHERE menu_name='poll_menu' ");
+			catch_error();
+
+			mysql_query("UPDATE ".MPREFIX."menus SET menu_path = 'custom', menu_name = substring(menu_name,8) WHERE substring(menu_name,1,6) = 'custom'");
+			catch_error();
+
+			mysql_query("UPDATE ".MPREFIX."menus SET menu_path = menu_name  WHERE menu_path = ''");
+			catch_error();
+
+		// New dblog table for logging db calls (admin log)
+		if (!mysql_table_exists("dblog")) {
+			$sql->db_Select_gen("CREATE TABLE ".MPREFIX."dblog (
+			dblog_id int(10) unsigned NOT NULL auto_increment,
+			dblog_type varchar(60) NOT NULL default '',
+			dblog_datestamp int(10) unsigned NOT NULL default '0',
+			dblog_user_id int(10) unsigned NOT NULL default '0',
+			dblog_ip varchar(80) NOT NULL default '',
+			dblog_query text NOT NULL,
+			dblog_remarks varchar(255) NOT NULL default '',
+			PRIMARY KEY  (dblog_id)
+			) TYPE=MyISAM;");
+			catch_error();
+		}
+
+		// New generic table for storing any miscellaneous data
+		if (!mysql_table_exists("generic")) {
+			$sql->db_Select_gen("CREATE TABLE ".MPREFIX."generic (
+			gen_id int(10) unsigned NOT NULL auto_increment,
+			gen_type varchar(80) NOT NULL default '',
+			gen_datestamp int(10) unsigned NOT NULL default '0',
+			gen_user_id int(10) unsigned NOT NULL default '0',
+			gen_ip varchar(80) NOT NULL default '',
+			gen_intdata int(10) unsigned NOT NULL default '0',
+			gen_chardata text NOT NULL,
+			PRIMARY KEY  (gen_id)
+			) TYPE=MyISAM;");
+			catch_error();
+		}
+
+		if (!mysql_table_exists("user_extended")) {
+			$sql->db_Select_gen("CREATE TABLE ".MPREFIX."user_extended (
+			user_extended_id int(10) unsigned NOT NULL default '0',
+			PRIMARY KEY  (user_extended_id)
+			) TYPE=MyISAM;");
+			catch_error();
+
+			$sql->db_Select_gen("CREATE TABLE ".MPREFIX."user_extended_struct (
+			user_extended_struct_id int(10) unsigned NOT NULL auto_increment,
+			user_extended_struct_name varchar(255) NOT NULL default '',
+			user_extended_struct_text varchar(255) NOT NULL default '',
+			user_extended_struct_type tinyint(3) unsigned NOT NULL default '0',
+			user_extended_struct_parms varchar(255) NOT NULL default '',
+			user_extended_struct_values text NOT NULL,
+			user_extended_struct_default varchar(255) NOT NULL default '',
+			user_extended_struct_read tinyint(3) unsigned NOT NULL default '0',
+			user_extended_struct_write tinyint(3) unsigned NOT NULL default '0',
+			user_extended_struct_required tinyint(3) unsigned NOT NULL default '0',
+			user_extended_struct_signup tinyint(3) unsigned NOT NULL default '0',
+			PRIMARY KEY  (user_extended_struct_id)
+			) TYPE=MyISAM;");
+			catch_error();
+
+			$sql->db_Select_gen("ALTER TABLE #user_extended_struct ADD user_extended_struct_applicable tinyint(3) unsigned NOT NULL default '0'");
+			catch_error();
+
+			$sql->db_Select_gen("ALTER TABLE #user_extended_struct ADD user_extended_struct_order int(10) unsigned NOT NULL default '0'");
+			catch_error();
+
+			$sql->db_Select_gen("ALTER TABLE #user_extended_struct ADD user_extended_struct_icon VARCHAR( 255 ) NOT NULL");
+			catch_error();
+
+
+			//Begin Extended user field conversion
+			require_once(e_HANDLER."user_extended_class.php");
+			$ue = new e107_user_extended;
+
+			if($sql->db_Select("core", " e107_value", " e107_name='user_entended'", 'default'))
+			{
+				$row = $sql->db_Fetch();
+
+				$user_extended = unserialize($row['e107_value']);
+				$new_types = array('text' => 1, 'radio' => 2, 'dropdown' => 3, 'table' => 4);
+
+				foreach($user_extended as $key => $val)
+				{
+					unset($new_field);
+					$parms = explode("|", $val);
+					$ext_name['ue_'.$key] = 'user_'.preg_replace("#\W#","",$parms[0]);
+					$new_field['name'] = preg_replace("#\W#","",$parms[0]);
+					$new_field['text'] = $parms[0];
+					$new_field['type'] = $new_types[$parms[1]];
+					$new_field['values'] = $parms[2];
+					$new_field['default'] = $parms[3];
+					$new_field['applicable'] = $parms[4];
+					$new_field['read'] = $parms[5];
+					$new_field['write'] = e_UC_MEMBER;
+					$new_field['signup'] = $pref['signup_ext'.$key];
+					$new_field['parms'] = "";
+					$new_field['required'] = 0;
+					unset($pref['signup_ext'.$key]);
+					unset($pref['signup_ext_req'.$key]);
+					$ue->user_extended_add($new_field);
+				}
+				$s_prefs = TRUE;
+				if($sql->db_Select('user','user_id, user_prefs',"1 ORDER BY user_id"))
+				{
+					$sql2 = new db;
+					while($row = $sql->db_Fetch())
+					{
+						$user_pref = unserialize($row['user_prefs']);
+						$new_values = "";
+						foreach($user_pref as $key => $val)
+						{
+							if(array_key_exists($key, $ext_name))
+							{
+								unset($user_pref[$key]);
+								if($val)
+								{
+									if($new_values)
+									{
+										$new_values .= ", ";
+									}
+									$new_values .= "`".$ext_name[$key]."`='".$val."'";
+								}
+							}
+						}
+						foreach ($user_pref as $key => $prefvalue)
+						{
+							$user_pref[$key] = $tp->toDB($prefvalue);
+						}
+						$tmp=addslashes(serialize($user_pref));
+						$sql2->db_Update("user", "user_prefs='$tmp' WHERE user_id='{$row['user_id']}'");
+						if($new_values)
+						{
+//							echo $new_values."<br />";
+							$sql2->db_Select_gen("INSERT INTO #user_extended (user_extended_id) values ('{$row['user_id']}')");
+							$sql2->db_Update('user_extended', $new_values." WHERE user_extended_id = '{$row['user_id']}'");
+						}
+					}
+				}
+			}
+			$sql->db_Select_gen("DELETE FROM #core WHERE e107_name='user_entended'");
+		}
+		//End Extended user field conversion
+
+
+		// Update user_class field to use #,#,# instead of #.#.#. notation
+			if ($sql->db_Select('user', 'user_id, user_class')) {
+				$sql2 = new db;
+				while ($row = $sql->db_Fetch()) {
+					$carray = explode('.', $row['user_class']);
+					$carray = array_unique(array_diff($carray, array('')));
+					if (count($carray) > 1) {
+						$new_userclass = implode(',', $carray);
+						} else {
+						$new_userclass = $carray[0];
+					}
+					$sql2->db_Update('user', "user_class = '{$new_userclass}' WHERE user_id={$row['user_id']}");
+					catch_error();
+				}
+			}
+
+			mysql_query("ALTER TABLE ".MPREFIX."generic CHANGE gen_chardata gen_chardata TEXT NOT NULL");
+			catch_error();
+
+			mysql_query("ALTER TABLE ".MPREFIX."banner CHANGE banner_active banner_active TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'");
+			catch_error();
+
+		if ($sql->db_Field("cache",0) == "cache_url") {
+
+			mysql_query('DROP TABLE `'.MPREFIX.'cache`'); // db cache is no longer an available option..
+			catch_error();
+		}
+		$sql->db_Update("banner", "banner_active='255' WHERE banner_active = '0' ");
+		$sql->db_Update("banner", "banner_active='0' WHERE banner_active = '1' ");
+		$pref['wm_enclose'] = 1;
+		$s_prefs = TRUE;
+		/*
+		Changes by McFly 2/12/2005
+		Moving forum rules from wmessage table to generic table
+		*/
+			if($sql -> db_Select("wmessage"))
+			{
+				while($row = $sql->db_Fetch())
+				{
+					$wmList[] = $row;
+				}
+				foreach($wmList as $wm)
+				{
+					$fieldlist = "";
+					$gen_type='wmessage';
+
+					if($wm['wm_id'] == '1') { $wm_class = $wm['wm_active'] ? e_UC_GUEST : '255'; }
+					if($wm['wm_id'] == '2') { $wm_class = $wm['wm_active'] ? e_UC_MEMBER : '255'; }
+					if($wm['wm_id'] == '3') { $wm_class = $wm['wm_active'] ? e_UC_ADMIN : '255'; }
+					if($wm['wm_id'] == '4') { $gen_type = 'forum_rules_guest'; $wm_class = $wm['wm_active'] ? e_UC_GUEST : '255'; }
+					if($wm['wm_id'] == '5') { $gen_type = 'forum_rules_member'; $wm_class = $wm['wm_active'] ? e_UC_MEMBER : '255'; }
+					if($wm['wm_id'] == '6') { $gen_type = 'forum_rules_admin'; $wm_class = $wm['wm_active'] ? e_UC_ADMIN : '255'; }
+
+					if($gen_type != "wmessage")
+					{
+						$exists = $sql->db_Count('generic','(*)',"WHERE gen_type = '{$gen_type}'");
+						if(!$exists)
+						{
+							$fieldlist = "0,'$gen_type','".time()."','".USERID."','',{$wm_class},'{$wm['wm_text']}'";
+						}
+					}
+					else
+					{
+						$exists = $sql->db_Count('generic','(*)',"WHERE gen_type = 'wmessage' AND gen_user_id = '".$wm['wm_id']."'");
+						if(!$exists)
+						{
+							$fieldlist = "0,'wmessage','".time()."','".$wm['wm_id']."','',{$wm_class},'{$wm['wm_text']}'";
+						}
+					}
+					if($fieldlist)
+					{
+						$sql->db_Insert('generic',$fieldlist);
+					}
+				}
+				$sql -> db_Select_gen("DROP TABLE ".MPREFIX."wmessage");
+				catch_error();
+			}
+
+		// ############# END McFly's Updates  ##############
+
+		// start chatbox update -------------------------------------------------------------------------------------------
+			if (!$sql->db_Select("plugin", "plugin_path", "plugin_path='chatbox_menu'")) {
+				$sql->db_Insert("plugin", "0, 'Chatbox', '1.0', 'chatbox_menu', 1");
+				catch_error();
+				$pref['plug_status'] = $pref['plug_status'].",chatbox_menu";
+				$s_prefs = TRUE;
+			}
+		// end chatbox update -------------------------------------------------------------------------------------------
+
+		// Cam's new PRESET Table. -------------------------------------------------------------------------------------------
+		if (!mysql_table_exists("preset")) {
+			$sql->db_Select_gen("CREATE TABLE ".MPREFIX."preset (
+			preset_id int(10) unsigned NOT NULL auto_increment,
+			preset_name varchar(80) NOT NULL default '',
+			preset_field varchar(80) NOT NULL default '',
+			preset_value varchar(255) NOT NULL default '',
+			PRIMARY KEY  (preset_id)
+			) TYPE=MyISAM;");
+			catch_error();
+		}
+
+		// News Updates -----------------
+
+			$field1 = $sql->db_Field("news",13);
+			$field2 = $sql->db_Field("news",14);
+			$field3 = $sql->db_Field("news",15);
+
+			if($field1 != "news_summary" && $field1 != "news_thumbnail" && $field3 != "news_sticky"){
+				mysql_query("ALTER TABLE `".MPREFIX."news` ADD `news_summary` text NOT NULL");
+				catch_error();
+				mysql_query("ALTER TABLE `".MPREFIX."news` ADD `news_thumbnail` text NOT NULL");
+				catch_error();
+				mysql_query("ALTER TABLE ".MPREFIX."news ADD news_sticky tinyint(3) unsigned NOT NULL default '0'");
+				catch_error();
+			}
+
+		// Downloads updates - Added March 1, 2005 by McFly
+
+		if (!mysql_table_exists("download_requests")) {
+			$sql->db_Select_gen("CREATE TABLE ".MPREFIX."download_requests (
+			download_request_id int(10) unsigned NOT NULL auto_increment,
+			download_request_userid int(10) unsigned NOT NULL default '0',
+			download_request_ip varchar(30) NOT NULL default '',
+			download_request_download_id int(10) unsigned NOT NULL default '0',
+			download_request_datestamp int(10) unsigned NOT NULL default '0',
+			PRIMARY KEY  (download_request_id)
+			) TYPE=MyISAM;");
+			catch_error();
+		}
+
+
+		// Missing Forum upgrade stuff by Cam.
+			global $PLUGINS_DIRECTORY;
+			if($sql -> db_Select("links", "*", "link_url = 'forum.php'")){
+				$sql -> db_Insert("plugin", "0, 'Forum', '1.1', 'forum', '1' ");
+				catch_error();
+				$sql -> db_Update("links", "link_url='".$PLUGINS_DIRECTORY."forum/forum.php' WHERE link_url='forum.php' ");
+				catch_error();
+			}
+
+			if($sql -> db_Select("menus", "*", "menu_name = 'newforumposts_menu' and menu_path='newforumposts_menu' ")){
+				$sql -> db_Update("menus", "menu_path='forum' WHERE menu_name = 'newforumposts_menu' ");
+				catch_error();
+			}
+
+		if($pref['cb_linkreplace'] && !$pref['link_replace']){
+			$pref['link_text'] = "[link]";
+			$pref['link_replace'] = 1;
+			$pref['make_clickable'] = 1;
+			$pref['cb_linkreplace'] = "";
+			$s_prefs = TRUE;
+		}
+
+		// db verify fixes
+			// Are these needed? To facilitate for users that upgraded to the cvs during development, or?
+			mysql_query("ALTER TABLE `".MPREFIX."user_extended_struct` DROP `user_extended_struct_signup_show` , DROP `user_extended_struct_signup_required`;");
+			catch_error();
+			mysql_query("ALTER TABLE `".MPREFIX."user_extended_struct` ADD `user_extended_struct_signup` TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `user_extended_struct_required`;");
+			catch_error();
+			mysql_query("ALTER TABLE `".MPREFIX."user_extended_struct` DROP `user_extended_struct_icon`;");
+			catch_error();
+	        mysql_query("ALTER TABLE `".MPREFIX."user_extended_struct` ADD `user_extended_struct_parent` int(10) unsigned NOT NULL default '0'");
+			catch_error();
+        	mysql_query("ALTER TABLE `".MPREFIX."user_extended` ADD `user_hidden_fields` TEXT NOT NULL AFTER `user_extended_id`");
+			catch_error();
+
+
+			mysql_query("ALTER TABLE `".MPREFIX."download_category` CHANGE `download_category_class` `download_category_class` TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL");
+			catch_error();
+
+
+			mysql_query("ALTER TABLE `".MPREFIX."generic` CHANGE `gen_chardata` `gen_chardata` TEXT NOT NULL");
+			catch_error();
+
+			mysql_query("ALTER TABLE `".MPREFIX."news` CHANGE `news_class` `news_class` VARCHAR( 255 ) DEFAULT '0' NOT NULL");
+			catch_error();
+			// news_attach removal / field structure changes / 'thumb:' prefix removal
+			mysql_query("ALTER TABLE `".MPREFIX."news` CHANGE `news_attach` `news_thumbnail` TEXT NOT NULL;");
+			catch_error();
+			mysql_query("ALTER TABLE `".MPREFIX."news` CHANGE `news_summary` `news_summary` TEXT NOT NULL;");
+			catch_error();
+			if ($sql -> db_Select("news", "news_id, news_thumbnail", "news_thumbnail LIKE '%thumb:%'")) {
+				while ($row = $sql -> db_Fetch()) {
+					$thumbnail = trim(str_replace('thumb:', '', $row['news_thumbnail']));
+					$sql2 -> db_Update("news", "news_thumbnail='".$thumbnail."' WHERE news_id='".$row['news_id']."'");
+					catch_error();
+				}
+			}
+
+			if (!$sql->db_Select("plugin", "plugin_path", "plugin_path='log'") && !mysql_table_exists("logstats")) {
+				$sql->db_Select_gen("CREATE TABLE ".MPREFIX."logstats (
+				log_uniqueid int(11) NOT NULL auto_increment,
+				log_id varchar(50) NOT NULL default '',
+				log_data longtext NOT NULL,
+				PRIMARY KEY  (log_uniqueid),
+				UNIQUE KEY log_id (log_id)
+				) TYPE=MyISAM;");
+				catch_error();
+			}
+
+		if (isset($pref['log_activate'])) {
+			if ($pref['log_activate']) {
+				$pref['statActivate'] = 1;
+				$pref['statCountAdmin'] = 0;
+				$pref['statBrowser'] = 1;
+				$pref['statOs'] = 1;
+				$pref['statScreen'] = 1;
+				$pref['statDomain'] = 1;
+				$pref['statRefer'] = 1;
+				$pref['statQuery'] = 1;
+				$pref['statRecent'] = 1;
+			} else {
+				$pref['statActivate'] = 0;
+			}
+			unset($pref['log_activate']);
+			$s_prefs = TRUE;
+		}
+
+
+			// start poll update -------------------------------------------------------------------------------------------
+			if (!$sql->db_Select("plugin", "plugin_path", "plugin_path='poll'")) {
+				$sql->db_Insert("plugin", "0, 'Poll', '2.0', 'poll', 1");
+				$s_prefs = TRUE;
+			}
+			// end poll update -------------------------------------------------------------------------------------------
+
+			// start newsfeed update -------------------------------------------------------------------------------------------
+			if (!$sql->db_Select("plugin", "plugin_path", "plugin_path='newsfeed'")) {
+				$sql->db_Insert("plugin", "0, 'Newsfeeds', '2.0', 'newsfeed', 1");
+				$s_prefs = TRUE;
+			}
+			// end newsfeed update -------------------------------------------------------------------------------------------
+
+			// start stats update -------------------------------------------------------------------------------------------
+			if (!$sql->db_Select("plugin", "plugin_path", "plugin_path='log'")) {
+				$sql->db_Insert("plugin", "0, 'Statistic Logging', '2.0', 'log', 1");
+				$s_prefs = TRUE;
+			}
+			// end stats update -------------------------------------------------------------------------------------------
+
+			// start content update -------------------------------------------------------------------------------------------
+			if (!$sql->db_Select("plugin", "plugin_path", "plugin_path='content'")) {
+				$sql->db_Insert("plugin", "0, 'Content Management', '1.0', 'content', 1");
+				$s_prefs = TRUE;
+			}
+			// end content update -------------------------------------------------------------------------------------------
+
+			// start list_new update -------------------------------------------------------------------------------------------
+			if (!$sql->db_Select("plugin", "plugin_path", "plugin_path='list_new'")) {
+				$sql->db_Insert("plugin", "0, 'List', '1.0', 'list_new', 1");
+				$s_prefs = TRUE;
+			}
+			// end list_new update -------------------------------------------------------------------------------------------
+
+
+		// Truncate logstats table if log_id = pageTotal not found
+		/* log update - previous log entries are not compatible with later versions, sorry but we have to clear the table :\ */
+		if (mysql_table_exists("logstats")) {
+				if(!$sql->db_Select("logstats","log_id","log_id = 'pageTotal'")){
+					mysql_query("TRUNCATE TABLE `".MPREFIX."logstats");
+					catch_error();
+				}
+		}
+		// -----------------------------------------------------
+
+		// Fix corrupted Plugin Table.
+		$sql -> db_Delete("plugin", " plugin_installflag='0' ");
+
+		// Notify
+		if (!$sql -> db_Select("core", "e107_name", "e107_name = 'notify_prefs'")) {
+			$serial_prefs = "a:1:{s:5:\"event\";a:9:{s:7:\"usersup\";a:3:{s:4:\"type\";s:3:\"off\";s:5:\"class\";s:3:\"254\";s:5:\"email\";s:0:\"\";}s:8:\"userveri\";a:3:{s:4:\"type\";s:3:\"off\";s:5:\"class\";s:3:\"254\";s:5:\"email\";s:0:\"\";}s:5:\"flood\";a:3:{s:4:\"type\";s:3:\"off\";s:5:\"class\";s:3:\"254\";s:5:\"email\";s:0:\"\";}s:7:\"subnews\";a:3:{s:4:\"type\";s:3:\"off\";s:5:\"class\";s:3:\"254\";s:5:\"email\";s:0:\"\";}s:5:\"login\";a:3:{s:4:\"type\";s:3:\"off\";s:5:\"class\";s:3:\"254\";s:5:\"email\";s:0:\"\";}s:6:\"logout\";a:3:{s:4:\"type\";s:3:\"off\";s:5:\"class\";s:3:\"254\";s:5:\"email\";s:0:\"\";}s:8:\"newspost\";a:3:{s:4:\"type\";s:3:\"off\";s:5:\"class\";s:3:\"254\";s:5:\"email\";s:0:\"\";}s:7:\"newsupd\";a:3:{s:4:\"type\";s:3:\"off\";s:5:\"class\";s:3:\"254\";s:5:\"email\";s:0:\"\";}s:7:\"newsdel\";a:3:{s:4:\"type\";s:3:\"off\";s:5:\"class\";s:3:\"254\";s:5:\"email\";s:0:\"\";}}}";
+			$notify_prefs = unserialize(stripslashes($serial_prefs));
+			$handle = opendir(e_PLUGIN);
+			while (false !== ($file = readdir($handle))) {
+				if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)) {
+					$plugin_handle = opendir(e_PLUGIN.$file."/");
+					while (false !== ($file2 = readdir($plugin_handle))) {
+						if ($file2 == "e_notify.php") {
+							if ($sql -> db_Select("plugin", "plugin_path", "plugin_path='".$file."' AND plugin_installflag='1'")) {
+								$notify_prefs['plugins'][$file] = TRUE;
+								require_once(e_PLUGIN.$file.'/e_notify.php');
+								foreach ($config_events as $event_id => $event_text) {
+									$notify_prefs['event'][$event_id] = array('type' => 'off', 'class' => '254', 'email' => '');
+								}
+							}
+						}
+					}
+				}
+			}
+			$n_prefs = $tp -> toDB($notify_prefs);
+			$n_prefs = $eArrayStorage -> WriteArray($n_prefs);
+			$sql -> db_Insert("core", "'notify_prefs', '".$n_prefs."'");
+			$pref['notify'] = FALSE;
+			$s_prefs = TRUE;
+		}
+
+		// Admin Password Change Menu Display
+
+		if (!isset($pref['adminpwordchange'])) {
+			$pref['adminpwordchange'] = TRUE;
+			$s_prefs = TRUE;
+		}
+
+		// Front Page Upgrade
+
+		if (!is_array($pref['frontpage'])) {
+			if (!$pref['frontpage']) {
+				$up_pref = 'news.php';
+			} else if ($pref['frontpage'] == 'links') {
+				$up_pref = $PLUGINS_DIRECTORY.'links_page/links.php';
+			} else if ($pref['frontpage'] == 'forum') {
+				$up_pref = $PLUGINS_DIRECTORY.'forum/forum.php';
+			} else if (is_numeric($pref['frontpage'])) {
+				$up_pref = $PLUGINS_DIRECTORY.'content/content.php?content.'.$pref['frontpage'];
+			} else if (substr($pref['frontpage'], -1) != '/' && strpos($pref['frontpage'], '.') === FALSE) {
+				$up_pref = $pref['frontpage'].'.php';
+			} else {
+				$up_pref = $pref['frontpage'];
+			}
+			unset($pref['frontpage']);
+			$pref['frontpage']['all'] = $up_pref;
+			$s_prefs = TRUE;
+		}
+
+
+
+		// convert notify prefs from serialised to eArrayStorage
+		$notify_prefs = $sysprefs -> getArray('notify_prefs');
+		if (is_array($notify_prefs)) {
+			$s_prefs = $tp -> toDB($notify_prefs);
+			$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
+			$sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs' ");
+		}
+
+		// New Downloads visibility field.
+			if($sql->db_Field("download",18) != "download_visible"){
+				mysql_query("ALTER TABLE `".MPREFIX."download` ADD `download_visible` varchar(255) NOT NULL default '0';");
+				catch_error();
+				mysql_query("UPDATE `".MPREFIX."download` SET download_visible = download_class");
+				catch_error();
+				mysql_query("ALTER TABLE `".MPREFIX."download` CHANGE `download_class` `download_class` varchar(255) NOT NULL default '0'");
+				catch_error();
+			}
+			mysql_query("ALTER TABLE `".MPREFIX."download_category` CHANGE `download_category_class` `download_category_class` varchar(255) NOT NULL default '0'");
+			catch_error();
+
+		// Links Update for using Link_Parent. .
+			if($sql->db_Field("links",7) != "link_parent"){
+				mysql_query("ALTER TABLE `".MPREFIX."links` CHANGE `link_refer` `link_parent` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL");
+				catch_error();
+				$sql -> db_Select("links", "link_id,link_name", "link_name NOT LIKE 'submenu.%' ORDER BY link_name");
+				while($row = $sql-> db_Fetch()){
+					$name = $row['link_name'];
+					$parent[$name] = $row['link_id'];
+				}
+        			if(!is_object($sql2)){
+        				$sql2 = new db;
+				}
+				$sql -> db_Select("links", "link_id,link_name", "link_name LIKE 'submenu.%' ORDER BY link_name");
+				while($row = $sql-> db_Fetch()){
+					$tmp = explode(".",$row['link_name']);
+            				$nm = $tmp[1];
+					$id = $row['link_id'];
+			   		$sql2 -> db_Update("links", "link_parent='".$parent[$nm]."' WHERE link_id ='$id' ");
+					catch_error();
+				}
+        		}
+
+		//20050626 : update links_page_cat and links_page
+			$field1 = $sql->db_Field("links_page_cat",4);
+			$field2 = $sql->db_Field("links_page_cat",5);
+			$field3 = $sql->db_Field("links_page_cat",6);
+
+			if($field1 != "link_category_order" && $field2 != "link_category_class" && $field3 != "link_category_datestamp"){
+				mysql_query("ALTER TABLE ".MPREFIX."links_page_cat ADD link_category_order VARCHAR ( 100 ) NOT NULL DEFAULT '0';");
+				catch_error();
+				mysql_query("ALTER TABLE ".MPREFIX."links_page_cat ADD link_category_class VARCHAR ( 100 ) NOT NULL DEFAULT '0';");
+				catch_error();
+				mysql_query("ALTER TABLE ".MPREFIX."links_page_cat ADD link_category_datestamp INT ( 10 ) UNSIGNED NOT NULL DEFAULT '0';");
+				catch_error();
+			}
+			if($sql->db_Field("links_page",10) != "link_datestamp"){
+				mysql_query("ALTER TABLE ".MPREFIX."links_page ADD link_datestamp INT ( 10 ) UNSIGNED NOT NULL DEFAULT '0';");
+				catch_error();
+			}
+
+		// Search Update
+			$search_prefs = $sysprefs -> getArray('search_prefs');
+			if ((!$sql -> db_Select("core", "e107_name", "e107_name='search_prefs'")) || !isset($pref['search_highlight'])) {
+				$serial_prefs = "a:11:{s:11:\"user_select\";s:1:\"1\";s:9:\"time_secs\";s:2:\"60\";s:13:\"time_restrict\";s:1:\"0\";s:8:\"selector\";i:2;s:9:\"relevance\";i:0;s:13:\"plug_handlers\";N;s:10:\"mysql_sort\";i:0;s:11:\"multisearch\";s:1:\"1\";s:6:\"google\";s:1:\"0\";s:13:\"core_handlers\";a:4:{s:4:\"news\";a:5:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"0\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";}s:8:\"comments\";a:5:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"1\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";}s:5:\"users\";a:5:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"1\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";}s:9:\"downloads\";a:5:{s:5:\"class\";s:1:\"0\";s:9:\"pre_title\";s:1:\"1\";s:13:\"pre_title_alt\";s:0:\"\";s:5:\"chars\";s:3:\"150\";s:7:\"results\";s:2:\"10\";}}s:17:\"comments_handlers\";a:2:{s:4:\"news\";a:3:{s:2:\"id\";i:0;s:3:\"dir\";s:4:\"core\";s:5:\"class\";s:1:\"0\";}s:8:\"download\";a:3:{s:2:\"id\";i:2;s:3:\"dir\";s:4:\"core\";s:5:\"class\";s:1:\"0\";}}}";
+				$search_prefs = unserialize(stripslashes($serial_prefs));
+				$handle = opendir(e_PLUGIN);
+				while (false !== ($file = readdir($handle))) {
+					if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)) {
+						if ($sql -> db_Select("plugin", "plugin_path", "plugin_path='".$file."' AND plugin_installflag='1'") || $file == 'content' || $file == 'forum' || $file == 'links_page' || $file == 'chatbox_menu') {
+							$plugin_handle = opendir(e_PLUGIN.$file."/");
+							while (false !== ($file2 = readdir($plugin_handle))) {
+								if ($file2 == "e_search.php") {
+									$search_prefs['plug_handlers'][$file] = array('class' => 0, 'pre_title' => 1, 'pre_title_alt' => '', 'chars' => 150, 'results' => 10);
+								}
+								if ($file2 == "search" && is_readable(e_PLUGIN.$file.'/search/search_comments.php')) {
+									require_once(e_PLUGIN.$file.'/search/search_comments.php');
+									$search_prefs['comments_handlers'][$file] = array('id' => $comments_type_id, 'class' => '0', 'dir' => $file);
+									unset($comments_type_id);
+								}
+							}
+						}
+					}
+				}
+				preg_match("/^(.*?)($|-)/", mysql_get_server_info(), $mysql_version);
+				if (version_compare($mysql_version[1], '4.0.1', '<')) {
+					$search_prefs['mysql_sort'] = FALSE;
+				} else {
+					$search_prefs['mysql_sort'] = TRUE;
+				}
+				$serial_prefs = addslashes(serialize($search_prefs));
+				if (!$sql -> db_Select("core", "e107_name", "e107_name='search_prefs'")) {
+					$sql -> db_Insert("core", "'search_prefs', '".$serial_prefs."'");
+				} else {
+					$sql -> db_Update("core", "e107_value='".$serial_prefs."' WHERE e107_name='search_prefs' ");
+				}
+				if ($pref['search_restrict']) {
+					$pref['search_restrict'] = 253;
+					} else {
+					$pref['search_restrict'] = 0;
+				}
+				$pref['search_highlight'] = TRUE;
+				$s_prefs = TRUE;
+			}
+
+			// search sort method and search selector updates
+			if (!isset($search_prefs['selector'])) {
+				preg_match("/^(.*?)($|-)/", mysql_get_server_info(), $mysql_version);
+				if (version_compare($mysql_version[1], '4.0.1', '<')) {
+					$search_prefs['mysql_sort'] = FALSE;
+				} else {
+					$search_prefs['mysql_sort'] = TRUE;
+				}
+				$search_prefs['selector'] = 2;
+				$search_prefs['multisearch'] = 1;
+				unset($search_prefs['search_sort']);
+			}
+
+			// search content plugin comments id change
+			if ($search_prefs['comments_handlers']['content']['id'] == '1') {
+				$search_prefs['comments_handlers']['content']['id'] = 'pcontent';
+			}
+
+			// custom pages search added
+			if (!isset($search_prefs['core_handlers']['pages'])) {
+				$search_prefs['core_handlers']['pages'] = array('class' => 0, 'chars' => 150, 'results' => 10, 'pre_title' => 1, 'pre_title_alt' => '', 'order' => 13);
+			}
+
+        if(!is_array($pref['meta_tag'])){
+        	$pref['meta_tag'] = array($pref['sitelanguage']=>$pref['meta_tag']);
+		}
+
+			$serial_prefs = addslashes(serialize($search_prefs));
+			$sql -> db_Update("core", "e107_value='".$serial_prefs."' WHERE e107_name='search_prefs'");
+
+		// end search updates
+
+			$result = mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
+			catch_error();
+
+			$qry = "SHOW CREATE TABLE `".MPREFIX."links`";
+			$res = mysql_query($qry);
+			catch_error();
+
+			if ($res) {
+				$row = mysql_fetch_row($res);
+				$lines = explode("\n", $row[1]);
+				if(strpos($lines[10],"tinyint")){
+					mysql_query("ALTER TABLE `".MPREFIX."links` CHANGE `link_class` `link_class` VARCHAR( 255 ) DEFAULT '0' NOT NULL ");
+					catch_error();
+					mysql_query("ALTER TABLE `".MPREFIX."menus` CHANGE `menu_class` `menu_class` VARCHAR( 255 ) DEFAULT '0' NOT NULL ");
+					catch_error();
+				}
+			}
+
+
+			if($sql->db_Field("plugin",5) != "plugin_rss"){
+				mysql_query("ALTER TABLE `".MPREFIX."plugin` ADD `plugin_rss` varchar(255) NOT NULL default ''");
+				catch_error();
+			}
+
+		//20050630: added comment_lock to comments
+			if($sql->db_Field("comments",11) != "comment_lock"){
+				mysql_query("ALTER TABLE `".MPREFIX."comments` ADD `comment_lock` TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0';");
+				catch_error();
+			}
+
+			if($sql->db_Field("links_page",11) != "link_author"){
+				mysql_query("ALTER TABLE `".MPREFIX."links_page` ADD `link_author` VARCHAR( 255 ) NOT NULL DEFAULT '';");
+				catch_error();
+			}
+
+			if($sql->db_Field("user", 8) == "user_icq")
+			{
+				require_once(e_HANDLER."user_extended_class.php");
+				$ue = new e107_user_extended;
+				$ue->convert_old_fields();
+			}
+
+			if ($sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."links_page_cat")) {
+				while ($row = $sql -> db_Fetch()) {
+					if ($row['Field'] == 'link_category_order' && strpos($row['Type'], 'int') === FALSE) {
+						mysql_query("ALTER TABLE `".MPREFIX."links_page_cat` CHANGE `link_category_order` `link_category_order` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL;");
+						catch_error();
+					}
+				}
+			}
+
+		if (!isset($pref['track_online'])) {
+			$pref['track_online'] = 1;
+			$s_prefs = TRUE;
+		}
+
+		// custom menus / pages update
+
+			unset($type);
+			global $tp, $ns, $sql;
+			require_once(e_HANDLER."file_class.php");
+			$file = new e_file;
+			$reject = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*', 'Readme.txt');
+			$cpages = $file -> get_files(e_PLUGIN."custompages", "", $reject);
+			$cmenus = $file -> get_files(e_PLUGIN."custom", "", $reject);
+
+			$customs = array_merge($cpages, $cmenus);
+
+			$count = 0;
+			foreach($customs as $p)
+			{
+				$type = (strstr($p['path'], "custompages") ? "" : str_replace(".php", "", $p['fname']));
+				$filename = $p['path'].$p['fname'];
+				$handle = fopen ($filename, "r");
+				$contents = fread ($handle, filesize ($filename));
+				fclose ($handle);
+				$contents = str_replace("'", "&#039;", $contents);
+				if(!preg_match('#\$caption = "(.*?)";#si', $contents, $match))
+				{
+					preg_match('#<CAPTION(.*?)CAPTION#si', $contents, $match);
+				}
+				$page_title = $tp -> toDB(trim($match[1]));
+
+				if(!preg_match('#\$text = "(.*?)";#si', $contents, $match))
+				{
+					preg_match('#TEXT(.*?)TEXT#si', $contents, $match);
+				}
+
+				$page_text = $tp -> toDB(trim($match[1]));
+				$filetime = filemtime($filename);
+
+				if(!$sql -> db_Select("page", "*", "page_title='$page_title' "))
+				{
+					$sql -> db_Insert("page", "0, '$page_title', '$page_text', '".USERID."', '".$filetime."', '0', '0', '', '', '', '$type' ");
+					$text .= "<b>Inserting: </b> '".$page_title."' <br />";
+					$count ++;
+				}
+
+				$iid = mysql_insert_id();
+
+				if($type)
+				{
+					if(!$sql -> db_Select("menus", "*", "menu_path='$iid' "))
+					{
+						mysql_query("UPDATE ".MPREFIX."menus SET menu_pages = '', menu_path='".$iid."' WHERE menu_name = '".$type."'");
+					}
+				}
+				if (strstr($p['path'], "custompages")) {
+					if ($sql -> db_Select("links", "*", "link_url LIKE '%custompages/".$p['fname']."%'")) {
+						$sql -> db_Update("links", "link_url='page.php?".$iid."' WHERE link_url LIKE '%custompages/".$p['fname']."%'");
+					}
+				}
+			}
+			catch_error();
+
+			if($sql -> db_Select("menus", "*", "menu_pages='dbcustom'")) {
+				mysql_query("UPDATE ".MPREFIX."menus SET menu_pages = '' WHERE menu_pages='dbcustom'");
+			}
+
+			mysql_query("ALTER TABLE `".MPREFIX."news` CHANGE `news_thumbnail` `news_thumbnail` TEXT NOT NULL;");
+
+			// Add forum indexes, remove any extras
+			if ($sql -> db_Query("SHOW INDEX FROM ".MPREFIX."forum_t"))
+			{
+				$a = array("PRIMARY", "thread_id", "thread_parent", "thread_datestamp", "thread_forum_id");
+				while ($row = $sql -> db_Fetch())
+				{
+					if(!in_array($row['Key_name'], $a))
+					{
+						mysql_query("ALTER TABLE `".MPREFIX."forum_t` DROP INDEX `".$row['Key_name']."`");
+						catch_error();
+					}
+					$index_list[] = $row['Key_name'];
+				}
+				$a = array("thread_parent", "thread_datestamp", "thread_forum_id");
+				foreach($a as $f)
+				{
+					if(!in_array($f, $index_list))
+					{
+						mysql_query("ALTER TABLE `".MPREFIX."forum_t` ADD INDEX ( `{$f}` );");
+						catch_error();
+					}
+				}
+			}
+
+			if (!isset($pref['download_email'])) {
+				$pref['download_email'] = $pref['reported_post_email'];
+				$s_prefs = TRUE;
+			}
+
+		if (!isset($pref['mailer'])) {
+			$pref['mailer'] = $pref['smtp_enable'] ? 'smtp' : 'php';
+			$s_prefs = TRUE;
+		}
+
+		//calendar_menu
+			if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'calendar_menu' AND plugin_installflag='1' ")) {
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_class int(10) unsigned NOT NULL default '0';");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_subs tinyint(3) unsigned NOT NULL default '0';");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force tinyint(3) unsigned NOT NULL default '0';");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_ahead tinyint(3) unsigned NOT NULL default '0';");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_msg1 text;");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_msg2 text;");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_notify  tinyint(3) unsigned NOT NULL default '0';");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_last int(10) unsigned NOT NULL default '0';");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_today int(10) unsigned NOT NULL default '0';");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_lastupdate int(10) unsigned NOT NULL default '0';");
+				mysql_query("ALTER TABLE ".MPREFIX."event_cat ADD event_cat_addclass int(10) unsigned NOT NULL default '0';");
+
+				mysql_query("CREATE TABLE ".MPREFIX."event_subs (
+					event_subid int(10) unsigned NOT NULL auto_increment,
+					event_userid int(10) unsigned NOT NULL default '0',
+					event_cat int(10) unsigned NOT NULL default '0',
+					PRIMARY KEY (event_subid)
+					) TYPE=MyISAM;");
+
+				$row = $sql->db_Fetch();
+				if($row['plugin_version'] != '3.5'){
+					$sql -> db_Update("plugin", "plugin_version='3.5' WHERE plugin_path = 'calendar_menu' ");
+				}
+			}
+		// end calendar_menu
+
+		//update plugin_version : links_page
+		if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'links_page' AND plugin_installflag='1' ")) {
+			$row = $sql->db_Fetch();
+			if($row['plugin_version'] != '1.12'){
+				$sql -> db_Update("plugin", "plugin_version='1.12' WHERE plugin_path = 'links_page' ");
+			}
+		}
+
+		// install new private message plugin if old plugin is installed
+		if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'pm_menu' AND plugin_installflag='1' "))
+		{
+			$sql->db_Insert("plugin", "0, 'Private Messenger', '3.0', 'pm', 1, ''");
+			catch_error();
+		}
+
+		if(!array_key_exists('ue_upgrade', $pref)){
+			$pref['ue_upgrade'] = 1;
+			$s_prefs = TRUE;
+		}
+
+		// Add default pref for Max IP signups.
+		if(!isset($pref['signup_maxip'])){
+			$pref['signup_maxip'] = 3;
+			$s_prefs = TRUE;
+		}
+
+		// -----------------------------------------------------
+
+		// Save all prefs that were set in above update routines
+		if ($s_prefs == TRUE) {
+			save_prefs();
+		}
+
+		return '';
+
+	} else {
+
+		// Check if update is needed to 0.7. -----------------------------------------------
+		global $pref;
+		if (!$sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."user_extended")) {
+			return update_needed();
+		}
+
+		if ($pref['sitelanguage'] == 'English-iso') {
+			return update_needed();
+		}
+
+		if (!isset($pref['download_email'])) {
+			return update_needed();
+		}
+
+		if($sql -> db_Select("menus", "*", "menu_pages='dbcustom'")) {
+			return update_needed();
+		}
+
+		if ($sql->db_Query("SHOW INDEX FROM ".MPREFIX."forum_t"))
+		{
+			$a = array("PRIMARY", "thread_parent", "thread_datestamp", "thread_forum_id");
+			while ($row = $sql->db_Fetch())
+			{
+				if(!in_array($row['Key_name'], $a))
+				{
+					return update_needed();
+				}
+				$index_list[] = $row['Key_name'];
+			}
+			if(!in_array("thread_parent", $index_list) || !in_array("thread_datestamp", $index_list) || !in_array("thread_forum_id", $index_list))
+			{
+				return update_needed();
+			}
+		}
+
+		if ($sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."news")) {
+			while ($row = $sql -> db_Fetch()) {
+				if ($row['Field'] == 'news_thumbnail' && strpos($row['Null'], 'YES') !== FALSE) {
+					return update_needed();
+				}
+			}
+		}
+
+		if ($sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."links_page_cat")) {
+			while ($row = $sql -> db_Fetch()) {
+				if ($row['Field'] == 'link_category_order' && strpos($row['Type'], 'int') === FALSE) {
+					return update_needed();
+				}
+			}
+		}
+
+      $result = mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
+		$qry = "SHOW CREATE TABLE `".MPREFIX."links`";
+		$res = mysql_query($qry);
+		if ($res) {
+			$row = mysql_fetch_row($res);
+			$lines = explode("\n", $row[1]);
+			if(strpos($lines[10],"tinyint")){
+		  		return update_needed();
+			}
+		}
+
+		if($pref['meta_tag']!="" && !is_array($pref['meta_tag'])){
+			return update_needed();
+		}
+
+		if(!array_key_exists('ue_upgrade', $pref)){
+			return update_needed();
+		}
+
+		if($sql->db_Field("plugin",5) != "plugin_rss"){
+		 	return update_needed();
+		}
+
+		if($sql->db_Field("links",7) != "link_parent"){
+			return update_needed();
+		}
+
+		if($sql->db_Field("user", 8) == "user_icq")
+		{
+			return update_needed();
+		}
+
+		if($sql->db_Field("user",36) != "user_xup" && $sql->db_Field("user", 30) != "user_xup"){
+		 	return update_needed();
+		}
+
+		if($sql->db_Field("download",18) != "download_visible"){
+		 	return update_needed();
+		}
+
+		if (!$sql -> db_Select("core", "e107_name", "e107_name = 'notify_prefs'")) {
+		 	return update_needed();
+		}
+
+		// search content plugin comments id change
+		$search_prefs = $sysprefs -> getArray('search_prefs');
+		if ($search_prefs['comments_handlers']['content']['id'] == '1') {
+		 	return update_needed();
+		}
+
+		// custom pages search added
+		if (is_array($search_prefs) && !isset($search_prefs['core_handlers']['pages'])) {
+		 	return update_needed();
+		}
+
+		$result = mysql_query('SET SQL_QUOTE_SHOW_CREATE = 1');
+		$qry = "SHOW CREATE TABLE `".MPREFIX."user`";
+		$res = mysql_query($qry);
+		if ($res) {
+			$row = mysql_fetch_row($res);
+			if(!strstr($row[1], "KEY `user_ban_index` (`user_ban`)")) {
+			 	return update_needed();
+			}
+		}
+
+		global $pref;
+		if (!is_array($pref['frontpage'])) {
+		 	return update_needed();
+		}
+
+		if ((!$sql -> db_Select("core", "e107_name", "e107_name='search_prefs'")) || !isset($pref['search_highlight'])) {
+		 	return update_needed();
+		}
+
+		if($sql->db_Field("comments",11) != "comment_lock"){
+		 	return update_needed();
+		}
+
+		if($sql->db_Select("links_page") && $sql->db_Field("links_page",11) != "link_author"){
+		  	return update_needed();
+		}
+
+		if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'calendar_menu' AND plugin_installflag='1' ")) {
+			if($sql->db_Field("event_cat",3) != "event_cat_class"){
+			 	return update_needed();
+			}
+		}
+
+		// No updates needed
+	 	return TRUE;
+	}
+}
+
+
+function update_616_to_617($type='') {
+	global $sql;
+
+	if ($type == "do") {
+		mysql_query("ALTER TABLE  ".MPREFIX."poll ADD poll_comment TINYINT( 3 ) UNSIGNED DEFAULT '1' NOT NULL ");
+		mysql_query("ALTER TABLE  ".MPREFIX."menus ADD menu_pages TEXT NOT NULL ");
+		$sql2 = new db;
+		$sql2->db_Update("poll", "poll_comment='1' WHERE poll_id!='0'");
+		} else {
+			if($sql->db_Field("menus",5) == "menu_pages"){
+				return TRUE;
+			}
+
+	 	return update_needed();
+	}
+}
+
+function update_615_to_616($type='') {
+	global $sql;
+	if ($type == "do") {
+		mysql_query("INSERT INTO ".MPREFIX."wmessage VALUES (4, 'This text (if activated) will appear on a page when \"Forum Rules\" link is clicked on.', '0')");
+		mysql_query("INSERT INTO ".MPREFIX."wmessage VALUES (5, 'Member rules ----- This text (if activated) will appear on a page when \"Forum Rules\" link is clicked on - only logged in members will see this.', '0')");
+		mysql_query("INSERT INTO ".MPREFIX."wmessage VALUES (6, 'Administrator rules ----- This text (if activated) will appear on a page when \"Forum Rules\" link is clicked on - only logged in administrators will see this.', '0')");
+		mysql_query("ALTER TABLE ".MPREFIX."download ADD download_comment TINYINT( 3 ) UNSIGNED NOT NULL ");
+		mysql_query("ALTER TABLE ".MPREFIX."chatbox CHANGE cb_nick cb_nick VARCHAR( 30 ) NOT NULL default ''");
+		mysql_query("ALTER TABLE ".MPREFIX."comments CHANGE comment_type comment_type VARCHAR( 10 ) DEFAULT '0' NOT NULL ");
+		mysql_query("ALTER TABLE ".MPREFIX."comments ADD comment_pid INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL AFTER comment_id ");
+		mysql_query("ALTER TABLE ".MPREFIX."comments ADD comment_subject VARCHAR( 100 ) NOT NULL AFTER comment_item_id ");
+		mysql_query("ALTER TABLE ".MPREFIX."user ADD user_customtitle VARCHAR( 100 ) NOT NULL AFTER user_name ");
+		mysql_query("ALTER TABLE ".MPREFIX."parser ADD UNIQUE (parser_regexp)");
+		mysql_query("ALTER TABLE ".MPREFIX."userclass_classes ADD userclass_editclass TINYINT( 3 ) UNSIGNED NOT NULL ");
+		update_extended_616();
+		} else {
+
+		if($sql->db_Field("userclass_classes",3) == "userclass_editclass"){
+			return TRUE;
+		}
+
+	 	return update_needed();
+	}
+}
+
+function update_614_to_615($type='') {
+	global $sql;
+	if ($type == "do") {
+		mysql_query("ALTER TABLE ".MPREFIX."submitnews ADD submitnews_category TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER submitnews_title");
+		mysql_query("ALTER TABLE ".MPREFIX."upload ADD upload_category TINYINT(3) UNSIGNED NOT NULL DEFAULT '0'");
+		mysql_query("ALTER TABLE ".MPREFIX."online ADD online_pagecount tinyint(3) unsigned NOT NULL default '0'");
+		mysql_query("ALTER TABLE ".MPREFIX."submitnews ADD submitnews_file VARCHAR(100) NOT NULL default '' ");
+
+		global $DOWNLOADS_DIRECTORY;
+		$sql2 = new db;
+		$sql->db_Select("download", "download_id, download_url", "download_filesize=0");
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			$sql2->db_Update("download", "download_filesize='".filesize(e_BASE.$DOWNLOADS_DIRECTORY.$download_url)."' WHERE download_id='".$download_id."'");
+		}
+		} else {
+		global $mySQLdefaultdb;
+
+		if($sql->db_Field("submitnews",9) == "submitnews_file"){
+        	return TRUE;
+		}
+
+		 	return update_needed();
+	}
+}
+
+function update_611_to_612($type='') {
+	global $sql;
+	if ($type == "do") {
+		mysql_query("ALTER TABLE ".MPREFIX."news ADD news_render_type TINYINT UNSIGNED NOT NULL ");
+		mysql_query("ALTER TABLE ".MPREFIX."content CHANGE content_parent content_parent INT UNSIGNED DEFAULT '0' NOT NULL ");
+		} else {
+		global $mySQLdefaultdb;
+
+		if($sql->db_Field("news",11) == "news_render_type"){
+        	return TRUE;
+		}
+
+		return FALSE;
+	}
+}
+
+function update_603_to_604($type='') {
+	global $sql;
+	if ($type == "do") {
+		mysql_query("ALTER TABLE ".MPREFIX."link_category ADD link_category_icon VARCHAR( 100 ) NOT NULL");
+		mysql_query("ALTER TABLE ".MPREFIX."headlines ADD headline_image VARCHAR( 100 ) NOT NULL AFTER headline_description");
+		mysql_query("ALTER TABLE ".MPREFIX."content CHANGE content_page content_parent TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL");
+		mysql_query("ALTER TABLE ".MPREFIX."content ADD content_review_score TINYINT UNSIGNED NOT NULL AFTER content_type");
+		mysql_query("ALTER TABLE ".MPREFIX."content CHANGE content_author content_author VARCHAR( 200 ) NOT NULL");
+		mysql_query("ALTER TABLE ".MPREFIX."content ADD content_pe_icon TINYINT( 1 ) UNSIGNED NOT NULL AFTER content_review_score");
+		} else {
+   		global $mySQLdefaultdb;
+		if ($sql->db_Query("SHOW COLUMNS FROM ".MPREFIX."link_category")) {
+			$fields = mysql_list_fields($mySQLdefaultdb, MPREFIX."link_category");
+			$columns = mysql_num_fields($fields);
+			for ($i = 0; $i < $columns; $i++) {
+				if ("link_category_icon" == mysql_field_name($fields, $i)) {
+					return TRUE;
+				}
+			}
+		 	return update_needed();
+			} else {
+			return TRUE;
+		}
+	}
+}
+
+function update_extended_616() {
+	global $sql, $ns;
+	$sql2 = new db;
+	if ($sql2->db_Select("core", " e107_value", " e107_name='user_entended'")) {
+		$row = $sql2->db_Fetch();
+		$user_extended = unserialize($row[0]);
+		if (count($user_extended)) {
+			if ($sql->db_Select("user", "user_id,user_prefs")) {
+				while ($row = $sql->db_Fetch()) {
+					$uid = $row[0];
+					$user_pref = unserialize($row[1]);
+					foreach($user_extended as $key => $v) {
+						list($fname, $null) = explode("|", $v, 2);
+						$fname = $v;
+						if (isset($user_pref[$fname])) {
+							$user_pref["ue_{$key}"] = $user_pref[$fname];
+							unset($user_pref[$fname]);
+						}
+					}
+					$tmp = addslashes(serialize($user_pref));
+					$sql2->db_Update("user", "user_prefs='$tmp' WHERE user_id=$uid");
+				}
+			}
+		}
+	}
+	$ns->tablerender("Extended Users", "Updated extended user field data");
+}
+
+function update_needed()
+{
+	global $ns;
+	if(E107_DEBUG_LEVEL > 0)
+	{
+		$tmp = debug_backtrace();
+		$ns->tablerender("", "<div style='text-align:center'>Update required in ".basename(__FILE__)." on line ".$tmp[0]['line']."</div>");
+	}
+	return FALSE;
+}
+
+function mysql_table_exists($table){
+     $exists = mysql_query("SELECT 1 FROM ".MPREFIX."$table LIMIT 0");
+     if ($exists) return TRUE;
+     return FALSE;
+}
+
+
+function catch_error(){
+	if (mysql_error()!='' && E107_DEBUG_LEVEL > 0) {
+		$tmp2 = debug_backtrace();
+		$tmp = mysql_error();
+		echo $tmp." [ ".basename(__FILE__)." on line ".$tmp2[0]['line']."] <br />";
+	}
+	return;
+}
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/upload.php 75/e107_admin/upload.php
--- 6171/e107_admin/upload.php	2004-07-14 23:02:28.000000000 -0500
+++ 75/e107_admin/upload.php	2006-02-20 13:29:52.000000000 -0600
@@ -1,333 +1,333 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/upload.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("6")){ header("location:".e_BASE."index.php"); exit; }
-if(e_QUERY)
-{
-	$tmp = explode(".", e_QUERY);
-	$action = $tmp[0];
-	$id = $tmp[1];
-}
-
-
-if($action == "dis")
-{
-	if($_POST['confirm']){
-		$sql -> db_Update("upload", "upload_active='1' WHERE upload_id='$id' ");
-		$message = UPLLAN_1;
-	} elseif($_POST['cancel'])
-	{
-		$action = "";	
-	} else 
-	{
-		$sql -> db_Select("upload", "*", "upload_id='$id'");
-		$row = $sql -> db_Fetch(); extract($row);
-		require_once(e_HANDLER."form_handler.php");
-		$rs = new form;
-		include_once("header.php");
-		$caption = UPLLAN_17;
-		$txt = UPLLAN_45."<br /><br />";
-		$txt .= UPLLAN_10.": ".(is_numeric($upload_file) ? "Binary file ID ".$upload_file :  $upload_file);
-		$txt .= "<br />".UPLLAN_5.": ".substr($upload_poster, strpos($upload_poster, ".")+1);
-		$txt .= "<br /><br />
-		".$rs -> form_open("post", e_SELF."?".e_QUERY)."
-		".$rs -> form_button("submit", "confirm", UPLLAN_46)."
-		".$rs -> form_button("submit", "cancel", UPLLAN_47)."
-		".$rs -> form_close();
-		$ns -> tablerender($caption,$txt);
-		include_once("footer.php");
-		exit;
-	}
-}
-
-if($action == "dlm"){
-        header("location: ".e_ADMIN."download.php?dlm.".$id);
-        exit;
-}
-
-if($action == "news"){
-        header("location: ".e_ADMIN."newspost.php?create.upload.".$id);
-        exit;
-}
-
-
-if($action == "dl"){
-
-        $id = str_replace("%20", " ", $id);
-
-        if(preg_match("/Binary\s(.*?)\/.*/", $id, $result)){
-                $bid = $result[1];
-                $result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id='$bid' ");
-                $binary_data = @mysql_result($result, 0, "binary_data");
-                $binary_filetype = @mysql_result($result, 0, "binary_filetype");
-                $binary_name = @mysql_result($result, 0, "binary_name");
-                header("Content-type: ".$binary_filetype);
-                header("Content-length: ".$download_filesize);
-                header("Content-Disposition: attachment; filename=".$binary_name);
-                header("Content-Description: PHP Generated Data");
-                echo $binary_data;
-                exit;
-        }else{
-                header("location:".e_FILE."public/".str_replace("dl.", "", e_QUERY));
-                exit;
-        }
-}
-
-require_once("auth.php");
-require_once(e_HANDLER."userclass_class.php");
-$gen = new convert;
-require_once(e_HANDLER."form_handler.php");
-$rs = new form;
-
-if(IsSet($_POST['optionsubmit'])){
-
-        $pref['upload_storagetype'] = $_POST['upload_storagetype'];
-        $pref['upload_maxfilesize'] = $_POST['upload_maxfilesize'];
-        $pref['upload_allowedfiletype'] = $_POST['upload_allowedfiletype'];
-        $pref['upload_class'] = $_POST['upload_class'];
-        $pref['upload_enabled'] = (FILE_UPLOADS ? $_POST['upload_enabled'] : 0);
-        if($pref['upload_enabled'] && !$sql -> db_Select("links", "*", "link_url='upload.php' ")){
-                $sql -> db_Insert("links", "0, '".UPLLAN_44."', 'upload.php', '', '', 1,0,0,0,0");
-        }
-
-        if(!$pref['upload_enabled'] && $sql -> db_Select("links", "*", "link_url='upload.php' ")){
-                $sql -> db_Delete("links", "link_url='upload.php' ");
-        }
-
-        save_prefs();
-        $message = UPLLAN_2;
-}
-
-if(IsSet($message)){
-        require_once(e_HANDLER."message_handler.php");
-        message_handler("ADMIN_MESSAGE", $message);
-}
-
-if(!FILE_UPLOADS){
-        message_handler("ADMIN_MESSAGE", UPLLAN_41);
-}
-
-
-// view -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if($action == "view"){
-        $sql -> db_Select("upload", "*", "upload_id='$id'");
-        $row = $sql -> db_Fetch(); extract($row);
-
-        $post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
-        $post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
-        $poster = (!$post_author_id ? "<b>".$post_author_name."</b>" : "<a href='".e_BASE."user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>");
-        $upload_datestamp = $gen->convert_date($upload_datestamp, "long");
-
-        $text = "<div style='text-align:center'>
-        <table style='width:85%' class='fborder'>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_3."</td>
-        <td style='width:70%' class='forumheader3'>$upload_id</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_4."</td>
-        <td style='width:70%' class='forumheader3'>$upload_datestamp</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_5."</td>
-        <td style='width:70%' class='forumheader3'>$poster</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_6."</td>
-        <td style='width:70%' class='forumheader3'><a href='mailto:$upload_email'>$upload_email</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_7."</td>
-        <td style='width:70%' class='forumheader3'>".($upload_website ? "<a href='$upload_website'>$upload_website</a>" : " - ")."</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_8."</td>
-        <td style='width:70%' class='forumheader3'>".($upload_name ? $upload_name: " - ")."</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_9."</td>
-        <td style='width:70%' class='forumheader3'>".($upload_version ? $upload_version : " - ")."</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_10."</td>
-        <td style='width:70%' class='forumheader3'>".(is_numeric($upload_file) ? "Binary file ID ".$upload_file :  "<a href='".e_SELF."?dl.$upload_file'>$upload_file</a>")."</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_11."</td>
-        <td style='width:70%' class='forumheader3'>".parsesize($upload_filesize)."</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_12."</td>
-        <td style='width:70%' class='forumheader3'>".($upload_ss ? "<a href='".e_BASE."request.php?upload.".$upload_id."'>".$upload_ss."</a>" : " - ")."</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_13."</td>
-        <td style='width:70%' class='forumheader3'>$upload_description</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_14."</td>
-        <td style='width:70%' class='forumheader3'>".($upload_demo ? $upload_demo : " - ")."</td>
-        </tr>
-
-        <tr>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_15."</td>
-        <td style='width:70%' class='forumheader3'><a href='".e_SELF."?dlm.$upload_id'>".UPLAN_COPYTODLM."</a> | <a href='".e_SELF."?news.$upload_id'>".UPLLAN_16."</a> | <a href='".e_SELF."?dis.$upload_id'>".UPLLAN_17."</a></td>
-        </tr>
-
-        </table>
-        </div>";
-
-        $ns -> tablerender(UPLLAN_18, $text);
-
-}
-
-
-// list -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-$imgd = e_BASE.$IMAGES_DIRECTORY;
-$text = "<div style='text-align:center'>
-<table style='width:85%' class='fborder'>
-<tr><td class='forumheader' style='text-align:center' colspan='6'>";
-
-if(!$active_uploads = $sql -> db_Select("upload", "*", "upload_active=0")){
-        $text .= UPLLAN_19.".\n</td>\n</tr>";
-}else{
-        $text .= UPLLAN_20." ".($active_uploads == 1 ? UPLAN_IS : UPLAN_ARE).$active_uploads." ".UPLLAN_21.($active_uploads == 1 ? "" : "s")." ...";
-
-        $text .= "</td></tr>";
-        $text .= "<tr>
-        <td style='width:5%' class='forumheader3'>".UPLLAN_22."</td>
-        <td style='width:10%' class='forumheader3'>".UPLLAN_4."</td>
-        <td style='width:20%' class='forumheader3'>".UPLLAN_5."</td>
-        <td style='width:20%' class='forumheader3'>".UPLLAN_23."</td>
-        <td style='width:30%' class='forumheader3'>".UPLLAN_24."</td>
-        <td style='width:18px' class='forumheader3'>".UPLLAN_42."</td>
-        </tr>";
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                $post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
-                $post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
-                $poster = (!$post_author_id ? "<b>".$post_author_name."</b>" : "<a href='".e_BASE."user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>");
-                $upload_datestamp = $gen->convert_date($upload_datestamp, "short");
-                $text .= "<tr>
-                <td style='width:5%' class='forumheader3'>".$upload_id ."</td>
-                <td style='width:20%' class='forumheader3'>".$upload_datestamp."</td>
-                <td style='width:20%' class='forumheader3'>".$poster."</td>
-                <td style='width:20%' class='forumheader3'><a href='".e_SELF."?view.".$upload_id."'>".$upload_name ."</a></td>
-                <td style='width:20%' class='forumheader3'>".$upload_file ."</td>
-                <td style='width:18px' class='forumheader3'>
-                                <a href='".e_SELF."?dlm.$upload_id'><img src='".$imgd."filemanager/exe.png' alt='".UPLAN_COPYTODLS."' title='".UPLAN_COPYTODLS."' style='border:0' /></a><br />
-                                <a href='".e_SELF."?news.$upload_id'><img src='".$imgd."filemanager/htm.png' alt='".UPLLAN_16."' title='".UPLLAN_16."' style='border:0' /></a><br />
-                                <a href='".e_SELF."?dis.$upload_id'><img src='".$imgd."filemanager/del.png' alt='".UPLLAN_17."' title='".UPLLAN_17."' style='border:0' /></a>
-                </td>
-                </tr>";
-        }
-}
-$text .= "</table>\n</div>";
-
-$ns -> tablerender(UPLLAN_43, $text);
-
-
-// options -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:85%' class='fborder'>
-<tr>
-<td style='width:50%' class='forumheader3'>".UPLLAN_25."<br />
-<span class='smalltext'>".UPLLAN_26."</span></td>
-<td style='width:50%' class='forumheader3'>".
-($pref['upload_enabled'] == 1 ? $rs -> form_radio("upload_enabled", 1, 1)." ".UPLLAN_27.$rs -> form_radio("upload_enabled", 0)." ".UPLLAN_28 : $rs -> form_radio("upload_enabled", 1)." ".UPLLAN_27.$rs -> form_radio("upload_enabled", 0, 1)." ".UPLLAN_28)."
-</td>
-</tr>
-
-<tr>
-<td style='width:50%' class='forumheader3'>".UPLLAN_29."<br />
-<span class='smalltext'>".UPLLAN_30."</span></td>
-<td style='width:50%' class='forumheader3'>".
-($pref['upload_storagetype'] == 1 ? $rs -> form_radio("upload_storagetype", 1, 1)." ".UPLLAN_31."<br />".$rs -> form_radio("upload_storagetype", 2)." ".UPLLAN_32 : $rs -> form_radio("upload_storagetype", 1)." ".UPLLAN_31."<br />".$rs -> form_radio("upload_storagetype", 2,1)." ".UPLLAN_32)."
-</td>
-</tr>
-
-<tr>
-<td style='width:70%' class='forumheader3'>".UPLLAN_33."<br />
-<span class='smalltext'>".UPLLAN_34." ".ini_get('upload_max_filesize')." )</span></td>
-<td style='width:30%' class='forumheader3'>".
-$rs -> form_text("upload_maxfilesize", 10, $pref['upload_maxfilesize'], 10)."
-</td>
-</tr>
-
-<tr>
-<td style='width:70%' class='forumheader3'>".UPLLAN_35."<br />
-<span class='smalltext'>".UPLLAN_36."</span></td>
-<td style='width:30%' class='forumheader3'>".
-$rs -> form_textarea("upload_allowedfiletype", 20, 5, $pref['upload_allowedfiletype'])."
-</td>
-</tr>
-
-<tr>
-<td style='width:70%' class='forumheader3'>".UPLLAN_37."<br />
-<span class='smalltext'>".UPLLAN_38."</span></td>
-<td style='width:30%' class='forumheader3'>".r_userclass("upload_class",$pref['upload_class'])."
-
-</td>
-</tr>
-
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'>".
-$rs -> form_button("submit", "optionsubmit", UPLLAN_39)."
-</td>
-</tr>
-</table>".
-$rs -> form_close()."
-</div>";
-
-$ns -> tablerender(UPLLAN_40, $text);
-
-
-
-function parsesize($size){
-        $kb = 1024;
-        $mb = 1024 * $kb;
-        $gb = 1024 * $mb;
-        $tb = 1024 * $gb;
-        if($size < $kb) {
-                return $size." b";
-        }else if($size < $mb) {
-                return round($size/$kb,2)." kb";
-        }else if($size < $gb) {
-                return round($size/$mb,2)." mb";
-        }else if($size < $tb) {
-                return round($size/$gb,2)." gb";
-        }else {
-                return round($size/$tb,2)." tb";
-        }
-}
-
-
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/upload.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2006/02/20 19:29:52 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("V")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'upload';
+if (e_QUERY) {
+	$tmp = explode(".", e_QUERY);
+	$action = $tmp[0];
+	$id = $tmp[1];
+}
+
+if ($action == "dis" && isset($_POST['updelete']['upload_'.$id]) ) {
+	$res = $sql -> db_Select("upload", "*", "upload_id='".intval($id)."'");
+	$row = $sql -> db_Fetch();
+	if (preg_match("#Binary (.*?)/#", $row['upload_file'], $match)) {
+		$sql -> db_Delete("rbinary", "binary_id='".$tp -> toDB($match[1])."'");
+	} else if ($row['upload_file'] && file_exists(e_FILE."public/".$row['upload_file'])) {
+		unlink(e_FILE."public/".$row['upload_file']);
+	}
+	if (preg_match("#Binary (.*?)/#", $row['upload_ss'], $match)) {
+		$sql -> db_Delete("rbinary", "binary_id='".$tp -> toDB($match[1])."'");
+	} else if ($row['upload_ss'] && file_exists(e_FILE."public/".$row['upload_ss'])) {
+		unlink(e_FILE."public/".$row['upload_ss']);
+	}
+	$message = ($sql->db_Delete("upload", "upload_id='".intval($id)."'")) ? UPLLAN_1 : LAN_DELETED_FAILED;
+}
+
+if ($action == "dlm") {
+	header("location: ".e_ADMIN."download.php?dlm.".$id);
+	exit;
+}
+
+if ($action == "news") {
+	header("location: ".e_ADMIN."newspost.php?create.upload.".$id);
+	exit;
+}
+
+
+if ($action == "dl") {
+
+	$id = str_replace("%20", " ", $id);
+
+	if (preg_match("/Binary\s(.*?)\/.*/", $id, $result)) {
+		$bid = $result[1];
+		$result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id='$bid' ");
+		$binary_data = @mysql_result($result, 0, "binary_data");
+		$binary_filetype = @mysql_result($result, 0, "binary_filetype");
+		$binary_name = @mysql_result($result, 0, "binary_name");
+		header("Content-type: ".$binary_filetype);
+		header("Content-length: ".$download_filesize);
+		header("Content-Disposition: attachment; filename=".$binary_name);
+		header("Content-Description: PHP Generated Data");
+		echo $binary_data;
+		exit;
+	} else {
+		header("location:".e_FILE."public/".str_replace("dl.", "", e_QUERY));
+		exit;
+	}
+}
+
+require_once("auth.php");
+require_once(e_HANDLER."userclass_class.php");
+$gen = new convert;
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+
+if (isset($_POST['optionsubmit'])) {
+
+	$pref['upload_storagetype'] = $_POST['upload_storagetype'];
+	$pref['upload_maxfilesize'] = $_POST['upload_maxfilesize'];
+	$pref['upload_class'] = $_POST['upload_class'];
+	$pref['upload_enabled'] = (FILE_UPLOADS ? $_POST['upload_enabled'] : 0);
+	if ($pref['upload_enabled'] && !$sql->db_Select("links", "*", "link_url='upload.php' ")) {
+		$sql->db_Insert("links", "0, '".UPLLAN_44."', 'upload.php', '', '', 1,0,0,0,0");
+	}
+
+	if (!$pref['upload_enabled'] && $sql->db_Select("links", "*", "link_url='upload.php' ")) {
+		$sql->db_Delete("links", "link_url='upload.php' ");
+	}
+
+	save_prefs();
+	$message = UPLLAN_2;
+}
+
+if (isset($message)) {
+	require_once(e_HANDLER."message_handler.php");
+	message_handler("ADMIN_MESSAGE", $message);
+}
+
+if (!FILE_UPLOADS) {
+	message_handler("ADMIN_MESSAGE", UPLLAN_41);
+}
+
+
+// view -------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+if ($action == "view") {
+	$sql->db_Select("upload", "*", "upload_id='$id'");
+	$row = $sql->db_Fetch();
+	 extract($row);
+
+	$post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
+	$post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
+	$poster = (!$post_author_id ? "<b>".$post_author_name."</b>" : "<a href='".e_BASE."user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>");
+	$upload_datestamp = $gen->convert_date($upload_datestamp, "long");
+
+	$text = "<div style='text-align:center'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_3."</td>
+		<td style='width:70%' class='forumheader3'>$upload_id</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".LAN_DATE."</td>
+		<td style='width:70%' class='forumheader3'>$upload_datestamp</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_5."</td>
+		<td style='width:70%' class='forumheader3'>$poster</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_6."</td>
+		<td style='width:70%' class='forumheader3'><a href='mailto:$upload_email'>$upload_email</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_7."</td>
+		<td style='width:70%' class='forumheader3'>".($upload_website ? "<a href='$upload_website'>$upload_website</a>" : " - ")."</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_8."</td>
+		<td style='width:70%' class='forumheader3'>".($upload_name ? $upload_name: " - ")."</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_9."</td>
+		<td style='width:70%' class='forumheader3'>".($upload_version ? $upload_version : " - ")."</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_10."</td>
+		<td style='width:70%' class='forumheader3'>".(is_numeric($upload_file) ? "Binary file ID ".$upload_file : "<a href='".e_SELF."?dl.$upload_file'>$upload_file</a>")."</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_11."</td>
+		<td style='width:70%' class='forumheader3'>".parsesize($upload_filesize)."</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_12."</td>
+		<td style='width:70%' class='forumheader3'>".($upload_ss ? "<a href='".e_BASE."request.php?upload.".$upload_id."'>".$upload_ss."</a>" : " - ")."</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_13."</td>
+		<td style='width:70%' class='forumheader3'>$upload_description</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".UPLLAN_14."</td>
+		<td style='width:70%' class='forumheader3'>".($upload_demo ? $upload_demo : " - ")."</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".LAN_OPTIONS."</td>
+		<td style='width:70%' class='forumheader3'><a href='".e_SELF."?dlm.$upload_id'>".UPLAN_COPYTODLM."</a> | <a href='".e_SELF."?news.$upload_id'>".UPLLAN_16."</a> | <a href='".e_SELF."?dis.$upload_id'>".UPLLAN_17."</a></td>
+		</tr>
+
+		</table>
+		</div>";
+
+	$ns->tablerender(UPLLAN_18, $text);
+
+}
+
+
+// list -------------------------------------------------------------------------------------------------------------------------------------------------------------------
+$imgd = e_BASE.$IMAGES_DIRECTORY;
+$text = "<div style='text-align:center'>
+<table style='".ADMIN_WIDTH."' class='fborder'>
+<tr>
+<td style='width:5%' class='fcaption'>".UPLLAN_22."</td>
+<td style='width:10%' class='fcaption'>".LAN_DATE."</td>
+<td style='width:20%' class='fcaption'>".UPLLAN_5."</td>
+<td style='width:20%' class='fcaption'>".UPLLAN_23."</td>
+<td style='width:30%' class='fcaption'>".UPLLAN_24."</td>
+<td style='width:18px' class='fcaption'>".UPLLAN_42."</td>
+</tr>";
+
+$text .= "<tr><td class='forumheader3' style='text-align:center' colspan='6'>";
+
+if (!$active_uploads = $sql->db_Select("upload", "*", "upload_active=0 ORDER BY upload_id ASC")) {
+	$text .= UPLLAN_19.".\n</td>\n</tr>";
+} else {
+
+	$activeUploads = $sql -> db_getList();
+
+	$text .= UPLLAN_20." ".($active_uploads == 1 ? UPLAN_IS : UPLAN_ARE).$active_uploads." ".UPLLAN_21.($active_uploads == 1 ? "" : "s")." ...";
+
+	$text .= "</td></tr>";
+
+	foreach($activeUploads as $row)
+	{
+		extract($row);
+		$post_author_id = substr($upload_poster, 0, strpos($upload_poster, "."));
+		$post_author_name = substr($upload_poster, (strpos($upload_poster, ".")+1));
+		$poster = (!$post_author_id ? "<b>".$post_author_name."</b>" : "<a href='".e_BASE."user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>");
+		$upload_datestamp = $gen->convert_date($upload_datestamp, "short");
+		$text .= "<tr>
+		<td style='width:5%' class='forumheader3'>".$upload_id ."</td>
+		<td style='width:20%' class='forumheader3'>".$upload_datestamp."</td>
+		<td style='width:15%' class='forumheader3'>".$poster."</td>
+		<td style='width:20%' class='forumheader3'><a href='".e_SELF."?view.".$upload_id."'>".$upload_name ."</a></td>
+		<td style='width:20%' class='forumheader3'>".$upload_file ."</td>
+		<td style='width:50px;white-space:nowrap' class='forumheader3'>
+		<form action='".e_SELF."?dis.$upload_id' id='uploadform_{$upload_id}' method='post'>
+		<div><a href='".e_SELF."?dlm.$upload_id'><img src='".e_IMAGE."admin_images/downloads_16.png' alt='".UPLAN_COPYTODLS."' title='".UPLAN_COPYTODLS."' style='border:0' /></a>
+		<a href='".e_SELF."?news.$upload_id'><img src='".e_IMAGE."admin_images/news_16.png' alt='".UPLLAN_16."' title='".UPLLAN_16."' style='border:0' /></a>
+        <input type='image' title='".LAN_DELETE."' name='updelete[upload_{$upload_id}]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(UPLLAN_45." [ $upload_name ]")."') \"/>
+		</div></form></td>
+		</tr>";
+	}
+}
+$text .= "</table>\n</div>";
+
+$ns->tablerender(UPLLAN_43, $text);
+
+
+// options -------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+if (is_readable(e_ADMIN.'filetypes.php')) {
+	$allowed_filetypes = trim(file_get_contents(e_ADMIN.'filetypes.php'));
+}
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+	<td style='width:50%' class='forumheader3'>".UPLLAN_25."<br />
+	<span class='smalltext'>".UPLLAN_26."</span></td>
+	<td style='width:50%' class='forumheader3'>". ($pref['upload_enabled'] == 1 ? $rs->form_radio("upload_enabled", 1, 1)." ".LAN_YES.$rs->form_radio("upload_enabled", 0)." ".LAN_NO : $rs->form_radio("upload_enabled", 1)." ".LAN_YES.$rs->form_radio("upload_enabled", 0, 1)." ".LAN_NO)."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".UPLLAN_29."<br />
+	<span class='smalltext'>".UPLLAN_30."</span></td>
+	<td style='width:50%' class='forumheader3'>". ($pref['upload_storagetype'] == 1 ? $rs->form_radio("upload_storagetype", 1, 1)." ".UPLLAN_31."<br />".$rs->form_radio("upload_storagetype", 2)." ".UPLLAN_32 : $rs->form_radio("upload_storagetype", 1)." ".UPLLAN_31."<br />".$rs->form_radio("upload_storagetype", 2, 1)." ".UPLLAN_32)."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:70%' class='forumheader3'>".UPLLAN_33."<br />
+	<span class='smalltext'>".UPLLAN_34." ".ini_get('upload_max_filesize')." )</span></td>
+	<td style='width:30%' class='forumheader3'>". $rs->form_text("upload_maxfilesize", 10, $pref['upload_maxfilesize'], 10)."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:70%' class='forumheader3'>".UPLLAN_35."<br />
+	<span class='smalltext'>".UPLLAN_48."</span></td>
+	<td style='width:30%' class='forumheader3'>".$allowed_filetypes."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:70%' class='forumheader3'>".UPLLAN_37."<br />
+	<span class='smalltext'>".UPLLAN_38."</span></td>
+	<td style='width:30%' class='forumheader3'>".r_userclass("upload_class", $pref['upload_class'],"off","nobody,public,guest,member,admin,classes")."
+
+	</td>
+	</tr>
+
+	<tr>
+	<td colspan='2' class='forumheader' style='text-align:center'>". $rs->form_button("submit", "optionsubmit", UPLLAN_39)."
+	</td>
+	</tr>
+	</table>". $rs->form_close()."
+	</div>";
+
+$ns->tablerender(LAN_OPTIONS, $text);
+
+
+
+function parsesize($size) {
+	$kb = 1024;
+	$mb = 1024 * $kb;
+	$gb = 1024 * $mb;
+	$tb = 1024 * $gb;
+	if ($size < $kb) {
+		return $size." b";
+	}
+	else if($size < $mb) {
+		return round($size/$kb, 2)." kb";
+	}
+	else if($size < $gb) {
+		return round($size/$mb, 2)." mb";
+	}
+	else if($size < $tb) {
+		return round($size/$gb, 2)." gb";
+	} else {
+		return round($size/$tb, 2)." tb";
+	}
+}
+
+
+require_once("footer.php");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/userclass2.php 75/e107_admin/userclass2.php
--- 6171/e107_admin/userclass2.php	2004-07-22 18:58:50.000000000 -0500
+++ 75/e107_admin/userclass2.php	2006-02-12 21:04:25.000000000 -0600
@@ -1,363 +1,400 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/admin.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("4")){ header("location:".e_BASE."index.php"); exit;}
-require_once("auth.php");
-require_once(e_HANDLER."userclass_class.php");
-$aj = new textparse;
-$sql2=new db;
-
-function check_allowed($class_id){
-        global $sql;
-        if(!$sql -> db_Select("userclass_classes","*","userclass_id = {$class_id}")){
-                header("location:".SITEURL);
-                exit;
-        }
-        $row = $sql -> db_Fetch();
-        extract($row);
-        if(!getperms("0") && !check_class($userclass_editclass)){
-                header("location:".SITEURL);
-                exit;
-        }
-}
-
-if(strstr(e_QUERY, "clear")){
-        $tmp = explode(".", e_QUERY);
-        $class_id = $tmp[1];
-        check_allowed($class_id);
-        if($sql -> db_Select("user", "*", "user_class REGEXP('^{$class_id}\.') OR user_class REGEXP('\.{$class_id}\.') OR user_class REGEXP('\.{$class_id}$')")){
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        $cl=explode(".",$user_class);
-                        $i=array_search($class_id,$cl);
-                        if(is_numeric($i)){
-                                unset($cl[$i]);
-                                $user_class=implode(".",$cl);
-                                $sql2 -> db_Update("user", "user_class='$user_class' WHERE user_id='$user_id' ");
-                        }
-                }
-                $message = UCSLAN_1;
-        }
-}else if(e_QUERY){
-        $tmp2 = explode("-", e_QUERY);
-        $class_id = $tmp2[0];
-        check_allowed($class_id);
-        $tmp = explode(".", $tmp2[1]);
-        $tmp=array_flip($tmp);
-        $message = UCSLAN_2;
-
-        $sql -> db_Select("user", "*");
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                if(array_key_exists($user_id,$tmp)){  //Add user to the class
-                        $cl=explode(".",$user_class);
-                        $flip=array_flip($cl);
-                        if(!array_key_exists($class_id,$flip)){
-                                array_push($cl,$class_id);
-                                $user_class=implode(".",$cl);
-                                $sql2 -> db_Update("user", "user_class='$user_class' WHERE user_id='$user_id' ");
-                        }
-                } else {  //Remove user from class
-                        $cl=explode(".",$user_class);
-                        $i=array_search($class_id,$cl);
-                        if(is_numeric($i)){  //Belongs to array?
-                                unset($cl[$i]);
-                                $user_class=implode(".",$cl);
-                                $sql2 -> db_Update("user", "user_class='$user_class' WHERE user_id='$user_id' ");
-                        }
-                }
-        }
-}
-
-If(IsSet($_POST['delete'])){
-        $sql2=new db;
-        $class_id = $_POST['existing'];
-   check_allowed($class_id);
-        if($_POST['confirm']){
-                $sql -> db_Delete("userclass_classes", "userclass_id='".$_POST['existing']."' ");
-                $sql -> db_Select("user", "user_id, user_class", "user_class REGEXP('^{$class_id}\.') OR user_class REGEXP('\.{$class_id}\.') OR user_class REGEXP('\.{$class_id}$')");
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        $classes=explode(".",$user_class);
-                        $newclass="";
-                        foreach($classes as $c){
-                                if($c !==$_POST['existing'] && $c){
-                                        $newclass.=".".$c;
-                                }
-                        }
-                        $sql2 -> db_Update("user","user_class='$newclass' WHERE user_id='$user_id' ");
-                }
-                $message = UCSLAN_3;
-        } else {
-                $message = UCSLAN_4;
-        }
-}
-
-If(IsSet($_POST['edit'])){
-        check_allowed($_POST['existing']);
-        $sql -> db_Select("userclass_classes", "*", "userclass_id='".$_POST['existing']."' ");
-        $row = $sql -> db_Fetch(); extract($row);
-}
-
-if(IsSet($_POST['updateclass'])){
-        check_allowed($_POST['userclass_id']);
-        $_POST['userclass_name'] = $aj -> formtpa($_POST['userclass_name'], "admin");
-        $_POST['userclass_description'] = $aj -> formtpa($_POST['userclass_description'], "admin");
-        $sql -> db_Update("userclass_classes", "userclass_editclass={$_POST['userclass_editclass']}, userclass_name='".$_POST['userclass_name']."', userclass_description='".$_POST['userclass_description']."' WHERE userclass_id='".$_POST['userclass_id']."' ");
-        $message = UCSLAN_5;
-}
-
-if(IsSet($_POST['createclass'])){
-        $_POST['userclass_name'] = $aj -> formtpa($_POST['userclass_name'], "admin");
-        $_POST['userclass_description'] = $aj -> formtpa($_POST['userclass_description'], "admin");
-
-        if(getperms("0") || check_class($_POST['userclass_editclass']) && $_POST['userclass_editclass']){
-                $editclass = $_POST['userclass_editclass'];
-                $i=1;
-                while($sql -> db_Select("userclass_classes", "*", "userclass_id='".$i."' ") && $i<255){
-                        $i++;
-                }
-                if($i<255){
-                        $sql -> db_Insert("userclass_classes", $i.", '".strip_tags(strtoupper($_POST['userclass_name']))."', '".$_POST['userclass_description']."',{$editclass} ");
-                }
-                $message = UCSLAN_6;
-        } else {
-                header("location:".SITEURL);
-                exit;
-        }
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$class_total = $sql -> db_Select("userclass_classes");
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."' id='classForm'>
-<table class='fborder' style='width:95%'>
-<tr>
-<td class='forumheader' style='text-align:center' colspan='2'>";
-
-if($class_total == "0"){
-        $text .= UCSLAN_7;
-} else {
-        $text .= "<span class='defaulttext'>".UCSLAN_8.":</span>
-        <select name='existing' class='tbox'>";
-        while($row = $sql-> db_Fetch()){
-                if(check_class($row['userclass_editclass']) || getperms("0")){
-                        $text .= "<option value='{$row['userclass_id']}'>{$row['userclass_name']}</option>";
-                }
-        }
-        $text .= "</select>
-        <input class='button' type='submit' name='edit' value='".UCSLAN_9."' />
-        <input class='button' type='submit' name='delete' value='".UCSLAN_10."' />
-        <input type='checkbox' name='confirm' value='1' /><span class='smalltext'> ".UCSLAN_11."</span>
-        </td>
-        </tr>";
-}
-
-$text.="
-<tr>
-<td class='forumheader3' style='width:30%'>".UCSLAN_12."</td>
-<td class='forumheader3' style='width:70%'>
-<input class='tbox' type='text' size='30' maxlength='25' name='userclass_name' value='$userclass_name' /></td>
-</tr>
-<tr>
-<td class='forumheader3'>".UCSLAN_13."</td>
-<td class='forumheader3' style='width:70%'><input class='tbox' type='text' size='60' maxlength='85' name='userclass_description' value='$userclass_description' /></td>
-</tr>
-";
-
-$text .= "
-<tr>
-<td class='forumheader3'>".UCSLAN_24."</td>
-<td class='forumheader3'>".r_userclass("userclass_editclass",$userclass_editclass,"off","classes,matchclass,public")."</td>
-</tr>
-";
-
-$text .="
-<tr><td colspan='2' style='text-align:center' class='forumheader'>";
-
-If(IsSet($_POST['edit'])){
-        $text .= "<input class='button' type='submit' name='updateclass' value='".UCSLAN_14."' />
-        <input type='hidden' name='userclass_id' value='$userclass_id' />";
-}else{
-        $text .= "<input class='button' type='submit' name='createclass' value='".UCSLAN_15."' />";
-}
-
-$text .= "</td></tr></table>";
-
-If(IsSet($_POST['edit'])){
-
-        $sql -> db_Select("user", "user_id, user_name, user_class, user_login", "ORDER BY user_name", "no-where");
-        $c=0; $d=0;
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                if(check_class($userclass_id, $user_class)){
-                        $in_userid[$c] = $user_id;
-                        $in_username[$c] = $user_name;
-                        $in_userlogin[$c] = $user_login ? "(".$user_login.")" : "";
-                        $c++;
-                }else{
-                $out_userid[$d] = $user_id;
-                $out_username[$d] = $user_name;
-                $out_userlogin[$d] = $user_login ? "(".$user_login.")" : "";
-                $d++;
-                }
-
-        }
-
-        $text .= "<br /><table class='fborder' style='width:95%'>
-        <tr>
-        <td class='fcaption' style='text-align:center;width:30%'>".UCSLAN_16."</td></tr>
-        <tr>
-        <td class='forumheader3' style='width:70%; text-align:center'>
-
-        <table style='width:90%'>
-        <tr>
-        <td style='width:45%; vertical-align:top'>
-        ".UCSLAN_22."<br />
-        <select class='tbox' id='assignclass1' name='assignclass1' size='10' style='width:220px' multiple='multiple' onchange='moveOver();'>";
-
-        for($a=0; $a<=($d-1); $a++){
-                $text .= "<option value=".$out_userid[$a].">".$out_username[$a]." ".$out_userlogin[$a]."</option>";
-        }
-
-        $text .= "</select>
-        </td>
-        <td style='width:45%; vertical-align:top'>
-        ".UCSLAN_23."<br />
-        <select class='tbox' id='assignclass2' name='assignclass2' size='10' style='width:220px' multiple='multiple'>";
-        for($a=0; $a<=($c-1); $a++){
-                $text .= "<option value=".$in_userid[$a].">".$in_username[$a]." ".$in_userlogin[$a]."</option>";
-        }
-        $text .= "</select><br /><br />
-        <input class='button' type='button' value='".UCSLAN_17."' onclick='removeMe();' />
-        <input class='button' type='button' value='".UCSLAN_18."' onclick='clearMe($userclass_id);' />
-        <input type='hidden' name='class_id' value='$userclass_id'>
-
-        </td></tr></table>
-        </td></tr>
-        <tr><td colspan='2' style='text-align:center' class='forumheader'>
-        <input class='button' type='button' value='".UCSLAN_19." ".$userclass_name." ".UCSLAN_20."' onclick='saveMe($userclass_id);' />
-        </tr>
-        </td>
-        </table>";
-
-}
-
-
-$text .= "</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".UCSLAN_21."</div>", $text);
-
-require_once("footer.php");
-function headerjs(){
-
-$script_js= "<script type=\"text/javascript\">
-//<![CDATA[
-// Adapted from original:  Kathi O'Shea (Kathi.O'Shea@internet.com)
-function moveOver()
-{
-var boxLength = document.getElementById('assignclass2').length;
-var selectedItem = document.getElementById('assignclass1').selectedIndex;
-var selectedText = document.getElementById('assignclass1').options[selectedItem].text;
-var selectedValue = document.getElementById('assignclass1').options[selectedItem].value;
-var i;
-var isNew = true;
-if (boxLength != 0) {
-for (i = 0; i < boxLength; i++) {
-thisitem = document.getElementById('assignclass2').options[i].text;
-if (thisitem == selectedText) {
-isNew = false;
-break;
-      }
-   }
-}
-if (isNew) {
-newoption = new Option(selectedText, selectedValue, false, false);
-document.getElementById('assignclass2').options[boxLength] = newoption;
-document.getElementById('assignclass1').options[selectedItem].text = '';
-}
-document.getElementById('assignclass1').selectedIndex=-1;
-}
-
-
-function removeMe() {
-var boxLength = document.getElementById('assignclass2').length;
-var boxLength2 = document.getElementById('assignclass1').length;
-arrSelected = new Array();
-var count = 0;
-for (i = 0; i < boxLength; i++) {
-if (document.getElementById('assignclass2').options[i].selected) {
-arrSelected[count] = document.getElementById('assignclass2').options[i].value;
-var valname = document.getElementById('assignclass2').options[i].text;
-   for (j = 0; j < boxLength2; j++) {
-        if(document.getElementById('assignclass1').options[j].value == arrSelected[count]){
-        document.getElementById('assignclass1').options[j].text = valname;
-        }
-   }
-
-// document.getElementById('assignclass1').options[i].text = valname;
-}
-count++;
-}
-var x;
-for (i = 0; i < boxLength; i++) {
-for (x = 0; x < arrSelected.length; x++) {
-if (document.getElementById('assignclass2').options[i].value == arrSelected[x]) {
-document.getElementById('assignclass2').options[i] = null;
-   }
-}
-boxLength = document.getElementById('assignclass2').length;
-   }
-}
-
-function clearMe(clid){
-        location.href = document.location + \"?clear.\" + clid;
-}
-
-function saveMe(clid) {
-var strValues = \"\";
-var boxLength = document.getElementById('assignclass2').length;
-var count = 0;
-if (boxLength != 0) {
-for (i = 0; i < boxLength; i++) {
-if (count == 0) {
-strValues = document.getElementById('assignclass2').options[i].value;
-}
-else {
-strValues = strValues + \".\" + document.getElementById('assignclass2').options[i].value;
-}
-count++;
-   }
-}
-if (strValues.length == 0) {
-//alert(\"You have not made any selections\");
-}
-else {
-location.href = document.location + \"?\" + clid + \"-\" + strValues;
-   }
-}
-//]]>
-</script>\n";
- return $script_js;
-}
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/userclass2.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2006/02/13 03:04:25 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("4")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+$e_sub_cat = 'userclass';
+require_once("auth.php");
+require_once(e_HANDLER."userclass_class.php");
+$uclass = new e_userclass;
+
+function check_allowed($class_id)
+{
+	global $sql;
+	if (!$sql->db_Select('userclass_classes', '*', "userclass_id = {$class_id}"))
+	{
+		header("location:".SITEURL);
+		exit;
+	}
+	$row = $sql->db_Fetch();
+	if (!getperms('0') && !check_class($row['userclass_editclass']))
+	{
+		header("location:".SITEURL);
+		exit;
+	}
+}
+
+if (strstr(e_QUERY, 'clear'))
+{
+	$tmp = explode('.', e_QUERY);
+	$class_id = $tmp[1];
+	check_allowed($class_id);
+	if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')"))
+	{
+		while ($row = $sql->db_Fetch())
+		{
+			$uidList[$row['user_id']] = $row['user_class'];
+		}
+		$uclass->class_remove($class_id, $uidList);
+		$message = UCSLAN_1;
+	}
+}
+elseif(e_QUERY)
+{
+	$tmp2 = explode('-', e_QUERY);
+	$class_id = $tmp2[0];
+	check_allowed($class_id);
+	$message = UCSLAN_2;
+
+	if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')"))
+	{
+		while ($row = $sql->db_Fetch())
+		{
+			$uidList[$row['user_id']] = $row['user_class'];
+		}
+		$uclass->class_remove($class_id, $uidList);
+	}
+	unset($uidList);
+	if ($sql->db_Select('user', 'user_id, user_class', "user_id IN({$tmp2[1]})"))
+	{
+		while ($row = $sql->db_Fetch())
+		{
+			$uidList[$row['user_id']] = $row['user_class'];
+		}
+		$uclass->class_add($class_id, $uidList);
+	}
+}
+
+if (isset($_POST['delete']))
+{
+	$class_id = $_POST['existing'];
+	check_allowed($class_id);
+	if ($_POST['confirm']) {
+		$sql->db_Delete('userclass_classes', "userclass_id='".$_POST['existing']."' ");
+		if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$class_id}' OR user_class REGEXP('^{$class_id},') OR user_class REGEXP(',{$class_id},') OR user_class REGEXP(',{$class_id}$')"))
+		{
+			while ($row = $sql->db_Fetch())
+			{
+				$uidList[$row['user_id']] = $row['user_class'];
+			}
+			$uclass->class_remove($class_id, $uidList);
+		}
+		if (isset($pref['frontpage'][$class_id]))
+		{
+			unset($pref['frontpage'][$class_id]);
+			save_prefs();
+		}
+		$message = UCSLAN_3;
+	}
+	else
+	{
+		$message = UCSLAN_4;
+	}
+}
+
+if(isset($_POST['edit']))
+{
+	check_allowed($_POST['existing']);
+	$sql->db_Select('userclass_classes', '*', "userclass_id='".$_POST['existing']."' ");
+	$row = $sql->db_Fetch();
+	extract($row);
+}
+
+if (isset($_POST['updateclass']))
+{
+	check_allowed($_POST['userclass_id']);
+	$_POST['userclass_name'] = $tp->toDB($_POST['userclass_name']);
+	$_POST['userclass_description'] = $tp->toDB($_POST['userclass_description']);
+	$sql->db_Update('userclass_classes', "userclass_editclass={$_POST['userclass_editclass']}, userclass_name='".$_POST['userclass_name']."', userclass_description='".$_POST['userclass_description']."' WHERE userclass_id='".$_POST['userclass_id']."' ");
+	$message = UCSLAN_5;
+}
+
+if (isset($_POST['createclass']))
+{
+	if($_POST['userclass_name'])
+	{
+		$_POST['userclass_name'] = $tp->toDB($_POST['userclass_name']);
+		$_POST['userclass_description'] = $tp->toDB($_POST['userclass_description']);
+
+		if (getperms("0") || check_class($_POST['userclass_editclass']) && $_POST['userclass_editclass']) {
+			$editclass = $_POST['userclass_editclass'];
+			$i = 1;
+			while ($sql->db_Select('userclass_classes', '*', "userclass_id='".$i."' ") && $i < 255)
+			{
+				$i++;
+			}
+			if ($i < 255)
+			{
+				$sql->db_Insert("userclass_classes", $i.", '".strip_tags($_POST['userclass_name'])."', '".$_POST['userclass_description']."',{$editclass} ");
+			}
+			if (!isset($pref['frontpage'][$i]))
+			{
+				$pref['frontpage'][$i] = $pref['frontpage'][e_UC_GUEST];
+				save_prefs();
+			}
+			$message = UCSLAN_6;
+		}
+		else
+		{
+			header("location:".SITEURL);
+			exit;
+		}
+	}
+}
+
+if (isset($message))
+{
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+$class_total = $sql->db_Select("userclass_classes");
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."' id='classForm'>
+	<table class='fborder' style='".ADMIN_WIDTH."'>
+	<tr>
+	<td class='fcaption' style='text-align:center' colspan='2'>";
+
+if ($class_total == "0")
+{
+	$text .= UCSLAN_7;
+}
+else
+{
+	$text .= "<span class='defaulttext'>".UCSLAN_8.":</span>
+		<select name='existing' class='tbox'>";
+	while ($row = $sql->db_Fetch())
+	{
+		if (check_class($row['userclass_editclass']) || getperms("0"))
+		{
+			$text .= "<option value='{$row['userclass_id']}'>{$row['userclass_name']}</option>";
+		}
+	}
+	$text .= "</select>
+		<input class='button' type='submit' name='edit' value='".LAN_EDIT."' />
+		<input class='button' type='submit' name='delete' value='".LAN_DELETE."' />
+		<input type='checkbox' name='confirm' value='1' /><span class='smalltext'> ".UCSLAN_11."</span>
+		</td>
+		</tr>";
+}
+
+$text .= "
+	<tr>
+	<td class='forumheader3' style='width:30%'>".UCSLAN_12."</td>
+	<td class='forumheader3' style='width:70%'>
+	<input class='tbox' type='text' size='30' maxlength='25' name='userclass_name' value='$userclass_name' /></td>
+	</tr>
+	<tr>
+	<td class='forumheader3'>".UCSLAN_13."</td>
+	<td class='forumheader3' style='width:70%'><input class='tbox' type='text' size='60' maxlength='85' name='userclass_description' value='$userclass_description' /></td>
+	</tr>
+	";
+
+	if(!isset($userclass_editclass))
+	{
+		$userclass_editclass = e_UC_ADMIN;
+	}
+
+$text .= "
+	<tr>
+	<td class='forumheader3'>".UCSLAN_24."</td>
+	<td class='forumheader3'>".r_userclass("userclass_editclass", $userclass_editclass, "off", "admin,classes,matchclass,public,nobody")."</td>
+	</tr>
+	";
+
+$text .= "
+	<tr><td colspan='2' style='text-align:center' class='forumheader'>";
+
+if(isset($_POST['edit']))
+{
+	$text .= "<input class='button' type='submit' name='updateclass' value='".UCSLAN_14."' />
+		<input type='hidden' name='userclass_id' value='$userclass_id' />";
+}
+else
+{
+	$text .= "<input class='button' type='submit' name='createclass' value='".UCSLAN_15."' />";
+}
+
+$text .= "</td></tr></table>";
+
+if(isset($_POST['edit']))
+{
+	$sql->db_Select("user", "user_id, user_name, user_class, user_login", "ORDER BY user_name", "no-where");
+	$c = 0;
+	$d = 0;
+	while ($row = $sql->db_Fetch())
+	{
+		extract($row);
+		if (check_class($userclass_id, $user_class))
+		{
+			$in_userid[$c] = $user_id;
+			$in_username[$c] = $user_name;
+			$in_userlogin[$c] = $user_login ? "(".$user_login.")" : "";
+			$c++;
+		}
+		else
+		{
+			$out_userid[$d] = $user_id;
+			$out_username[$d] = $user_name;
+			$out_userlogin[$d] = $user_login ? "(".$user_login.")" : "";
+			$d++;
+		}
+	}
+
+	$text .= "<br /><table class='fborder' style='".ADMIN_WIDTH."'>
+		<tr>
+		<td class='fcaption' style='text-align:center;width:30%'>".UCSLAN_16."</td></tr>
+		<tr>
+		<td class='forumheader3' style='width:70%; text-align:center'>
+
+		<table style='width:90%'>
+		<tr>
+		<td style='width:45%; vertical-align:top'>
+		".UCSLAN_22."<br />
+		<select class='tbox' id='assignclass1' name='assignclass1' size='10' style='width:220px' multiple='multiple' onchange='moveOver();'>";
+
+	for ($a = 0; $a <= ($d-1); $a++)
+	{
+		$text .= "<option value=".$out_userid[$a].">".$out_username[$a]." ".$out_userlogin[$a]."</option>";
+	}
+
+	$text .= "</select>
+		</td>
+		<td style='width:45%; vertical-align:top'>
+		".UCSLAN_23."<br />
+		<select class='tbox' id='assignclass2' name='assignclass2' size='10' style='width:220px' multiple='multiple'>";
+	for($a = 0; $a <= ($c-1); $a++)
+	{
+		$text .= "<option value=".$in_userid[$a].">".$in_username[$a]." ".$in_userlogin[$a]."</option>";
+	}
+	$text .= "</select><br /><br />
+		<input class='button' type='button' value='".UCSLAN_17."' onclick='removeMe();' />
+		<input class='button' type='button' value='".UCSLAN_18."' onclick='clearMe($userclass_id);' />
+		<input type='hidden' name='class_id' value='$userclass_id'>
+
+		</td></tr></table>
+		</td></tr>
+		<tr><td colspan='2' style='text-align:center' class='forumheader'>
+		<input class='button' type='button' value='".UCSLAN_19." ".$userclass_name." ".UCSLAN_20."' onclick='saveMe($userclass_id);' />
+		</tr>
+		</td>
+		</table>";
+
+}
+
+$text .= "</form>
+	</div>";
+
+$ns->tablerender(UCSLAN_21, $text);
+
+require_once("footer.php");
+function headerjs()
+{
+
+	$script_js = "<script type=\"text/javascript\">
+		//<![CDATA[
+		// Adapted from original:  Kathi O'Shea (Kathi.O'Shea@internet.com)
+		function moveOver() {
+		var boxLength = document.getElementById('assignclass2').length;
+		var selectedItem = document.getElementById('assignclass1').selectedIndex;
+		var selectedText = document.getElementById('assignclass1').options[selectedItem].text;
+		var selectedValue = document.getElementById('assignclass1').options[selectedItem].value;
+		var i;
+		var isNew = true;
+		if (boxLength != 0) {
+		for (i = 0; i < boxLength; i++) {
+		thisitem = document.getElementById('assignclass2').options[i].text;
+		if (thisitem == selectedText) {
+		isNew = false;
+		break;
+		}
+		}
+		}
+		if (isNew) {
+		newoption = new Option(selectedText, selectedValue, false, false);
+		document.getElementById('assignclass2').options[boxLength] = newoption;
+		document.getElementById('assignclass1').options[selectedItem].text = '';
+		}
+		document.getElementById('assignclass1').selectedIndex=-1;
+		}
+
+
+		function removeMe() {
+		var boxLength = document.getElementById('assignclass2').length;
+		var boxLength2 = document.getElementById('assignclass1').length;
+		arrSelected = new Array();
+		var count = 0;
+		for (i = 0; i < boxLength; i++) {
+		if (document.getElementById('assignclass2').options[i].selected) {
+		arrSelected[count] = document.getElementById('assignclass2').options[i].value;
+		var valname = document.getElementById('assignclass2').options[i].text;
+		for (j = 0; j < boxLength2; j++) {
+		if (document.getElementById('assignclass1').options[j].value == arrSelected[count]){
+		document.getElementById('assignclass1').options[j].text = valname;
+		}
+		}
+
+		// document.getElementById('assignclass1').options[i].text = valname;
+		}
+		count++;
+		}
+		var x;
+		for (i = 0; i < boxLength; i++) {
+		for (x = 0; x < arrSelected.length; x++) {
+		if (document.getElementById('assignclass2').options[i].value == arrSelected[x]) {
+		document.getElementById('assignclass2').options[i] = null;
+		}
+		}
+		boxLength = document.getElementById('assignclass2').length;
+		}
+		}
+
+		function clearMe(clid) {
+		location.href = document.location + \"?clear.\" + clid;
+		}
+
+		function saveMe(clid) {
+		var strValues = \"\";
+		var boxLength = document.getElementById('assignclass2').length;
+		var count = 0;
+		if (boxLength != 0) {
+		for (i = 0; i < boxLength; i++) {
+		if (count == 0) {
+		strValues = document.getElementById('assignclass2').options[i].value;
+		} else {
+		strValues = strValues + \",\" + document.getElementById('assignclass2').options[i].value;
+		}
+		count++;
+		}
+		}
+		if (strValues.length == 0) {
+		//alert(\"You have not made any selections\");
+		}
+		else {
+		location.href = document.location + \"?\" + clid + \"-\" + strValues;
+		}
+		}
+		//]]>
+		</script>\n";
+	return $script_js;
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/userclass.php 75/e107_admin/userclass.php
--- 6171/e107_admin/userclass.php	2004-05-23 13:57:04.000000000 -0500
+++ 75/e107_admin/userclass.php	2006-02-16 08:25:46.000000000 -0600
@@ -1,116 +1,135 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/admin.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("4")){ header("location:".e_BASE."index.php"); exit;}
-require_once("auth.php");
-
-function check_allowed($class_id){
-	global $sql;
-	if(!$sql -> db_Select("userclass_classes","*","userclass_id = {$class_id}")){
-		header("location:".SITEURL);
-		exit;
-	}
-	$row = $sql -> db_Fetch();
-	extract($row);
-	if(!getperms("0") && !check_class($userclass_editclass)){
-		header("location:".SITEURL);
-		exit;
-	}
-}
-
-if(!e_QUERY){
-        header("location:".e_ADMIN."admin.php");
-        exit;
-}else{
-        $id = e_QUERY;
-}
-
-if(IsSet($_POST['updateclass'])){
-        $remuser = TRUE;
-        extract($_POST);
-        for($a=0; $a<=(count($_POST['userclass'])-1); $a++){
-        		check_allowed($userclass[$a]);
-                $svar .= $userclass[$a].".";
-        }
-        $sql -> db_Update("user", "user_class='$svar' WHERE user_id='$id' ");
-        $message = UCSLAN_8;
-        $sql -> db_Select("user", "user_name", "user_id='$id' ");
-        $row = $sql -> db_Fetch();
-        if($_POST['notifyuser']){
-                $message .= "<br />".UCSLAN_1.":</b> ".$row['user_name']."<br />";
-        }
-}
-
-$sql -> db_Select("user", "*", "user_id='$id' ");
-$row = $sql -> db_Fetch(); extract($row);
-
-$sql -> db_Select("userclass_classes");
-$c=0;
-while($row = $sql -> db_Fetch()){
-	if(getperms("0") || check_class($row['userclass_editclass'])){
-        $class[$c][0] = $row['userclass_id'];
-        $class[$c][1] = $row['userclass_name'];
-        $class[$c][2] = $row['userclass_description'];
-        $c++;
-    }
-}
-
-if($_POST['notifyuser']){
-        require_once(e_HANDLER."mail.php");
-        unset($messaccess);
-        for($a=0; $a<= (count($class)-1); $a++){
-                if(check_class($class[$a][0], $user_class)){
-                        $messaccess .= " - " . $class[$a][2]. "\n";
-                }
-        }
-        $send_to = $user_email;
-        $subject = UCSLAN_2;
-        $message = UCSLAN_3." " . $user_name. ",\n\n".UCSLAN_4." ".SITENAME."\n( ".SITEURL . " )\n\n".UCSLAN_5.": \n\n".$messaccess."\n".UCSLAN_8."\n".SITEADMIN."\n( ".SITENAME." )";
-        sendemail($send_to, $subject, $message);
-}
-
-if($remuser){
-        header("location:".e_ADMIN."users.php?cu.$id");
-        exit;
-}
-
-$caption = UCSLAN_6." <b>".$user_name."</b> (".$user_class.")";
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."'>
-<table style='width:90%' class='fborder'>";
-
-for($a=0; $a<= (count($class)-1); $a++){
-        $text .= "<tr><td style='width:30%' class='forumheader'>";
-        if(check_class($class[$a][0], $user_class)){
-                $text .= "<input type='checkbox' name='userclass[]' value='".$class[$a][0]."' checked='checked' />".$class[$a][1]." ";
-        }else{
-                $text .= "<input type='checkbox' name='userclass[]' value='".$class[$a][0]."' />".$class[$a][1]." ";
-        }
-        $text .= "</td><td style='width:70%' class='forumheader3'> ".$class[$a][2]."</td></tr>";
-}
-
-$text .= "<tr><td class='forumheader' colspan='2' style='text-align:center'><input type='checkbox' name='notifyuser' value='1' /> ".UCSLAN_8."&nbsp;&nbsp;<input class='button' type='submit' name='updateclass' value='".UCSLAN_7."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender($caption, $text);
-
-
-require_once("footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/userclass.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2006/02/16 14:25:46 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("4")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+
+if (!e_QUERY) {
+  	header("location:".e_ADMIN."admin.php");
+	exit;
+} else {
+    $qs = explode(".", e_QUERY);
+	$id = $qs[0];
+}
+
+$sql->db_Select("userclass_classes");
+$c = 0;
+while ($row = $sql->db_Fetch()) {
+	if (getperms("0") || check_class($row['userclass_editclass'])) {
+		$class[$c][0] = $row['userclass_id'];
+		$class[$c][1] = $row['userclass_name'];
+		$class[$c][2] = $row['userclass_description'];
+		$c++;
+	}
+}
+
+if (isset($_POST['updateclass'])) {
+	$remuser = TRUE;
+	$classcount = count($_POST['userclass'])-1;
+	for($a = 0; $a <= $classcount; $a++) {
+		check_allowed($_POST['userclass'][$a]);
+		$svar .= $_POST['userclass'][$a];
+		$svar .= ($a < $classcount ) ? "," : "";
+	}
+	$sql->db_Update("user", "user_class='$svar' WHERE user_id='$id' ");
+        $message = UCSLAN_9;
+	$sql->db_Select("user", "*", "user_id='$id' ");
+	$row = $sql->db_Fetch();
+	if ($_POST['notifyuser']) {
+		$message .= "<br />".UCSLAN_1.":</b> ".$row['user_name']."<br />";
+		require_once(e_HANDLER."mail.php");
+   		unset($messaccess);
+		for($a = 0; $a <= (count($class)-1); $a++) {
+			if (check_class($class[$a][0], $row['user_class'])) {
+				$messaccess .= $class[$a][1]." - " . $class[$a][2]. "\n";
+			}
+		}
+		$send_to = $row['user_email'];
+		$subject = UCSLAN_2;
+        $message = UCSLAN_3." " . $row['user_name']. ",\n\n".UCSLAN_4." ".SITENAME."\n( ".SITEURL . " )\n\n".UCSLAN_5.": \n\n".$messaccess."\n".UCSLAN_10."\n".SITEADMIN."\n( ".SITENAME." )";
+		sendemail($send_to, $subject, $message);
+	}
+
+
+	 header("location: ".$_POST['adminreturn']);
+	 echo "location redirect failed.";
+     exit;
+}
+
+
+$e_sub_cat = 'userclass';
+require_once("auth.php");
+
+
+
+$sql->db_Select("user", "*", "user_id='$id' ");
+$row = $sql->db_Fetch();
+
+$caption = UCSLAN_6." <b>".$row['user_name']."</b> (".$row['user_class'].")";
+
+$text = "	<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+for($a = 0; $a <= (count($class)-1); $a++) {
+	$text .= "<tr><td style='width:30%' class='forumheader3'>";
+	if (check_class($class[$a][0], $row['user_class'])) {
+		$text .= "<input type='checkbox' name='userclass[]' value='".$class[$a][0]."' checked='checked' />".$class[$a][1]." ";
+	} else {
+		$text .= "<input type='checkbox' name='userclass[]' value='".$class[$a][0]."' />".$class[$a][1]." ";
+	}
+	$text .= "</td><td style='width:70%' class='forumheader3'> ".$class[$a][2]."</td></tr>";
+}
+ 
+$adminreturn = e_ADMIN."users.php?cu".($qs[2] ? ".{$qs[2]}.{$qs[3]}.{$qs[4]}" : "");
+
+$text .= "	<tr><td class='forumheader' colspan='2' style='text-align:center'>
+			<input type='hidden' name='adminreturn' value='$adminreturn' />
+			<input type='checkbox' name='notifyuser' value='1' /> ".UCSLAN_8."&nbsp;&nbsp;
+			<input class='button' type='submit' name='updateclass' value='".UCSLAN_7."' />
+			</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+
+$ns->tablerender($caption, $text);
+
+
+require_once("footer.php");
+
+
+// ----------------------------------------------------------
+
+function check_allowed($class_id) {
+	global $sql;
+	if (!$sql->db_Select("userclass_classes", "*", "userclass_id = {$class_id}")) {
+		header("location:".SITEURL);
+		exit;
+	}
+	$row = $sql->db_Fetch();
+	extract($row);
+	if (!getperms("0") && !check_class($userclass_editclass)) {
+		header("location:".SITEURL);
+		exit;
+	}
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/userinfo.php 75/e107_admin/userinfo.php
--- 6171/e107_admin/userinfo.php	2004-03-03 12:23:46.000000000 -0600
+++ 75/e107_admin/userinfo.php	2005-08-04 04:56:38.000000000 -0500
@@ -1,63 +1,71 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/userinfo.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("4")){ header("location:".e_BASE."index.php"); exit;}
-require_once("auth.php");
-
-if(!e_QUERY){
-	$text = "<div style=\"text-align:center\">".USFLAN_1."</div>";
-	$ns -> tablerender(USFLAN_2, $text);
-	require_once("footer.php");
-	exit;
-}else{
-	$ipd = e_QUERY;
-}
-
-if(IsSet($ipd)){
-	$obj = new convert;
-	$sql -> db_Select("chatbox", "*", "cb_ip='$ipd' LIMIT 0,20");
-	$host = gethostbyaddr($ipd);
-	$text = USFLAN_3." <b>".$ipd."</b> [ ".USFLAN_4.": $host ]<br />
-	<i><a href=\"banlist.php?".$ipd."\">".USFLAN_5."</a></i>
-	
-	<br /><br />";
-	while(list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip ) = $sql-> db_Fetch()){
-		$datestamp = $obj->convert_date($cb_datestamp, "short");
-		$post_author_id = substr($cb_nick, 0, strpos($cb_nick, "."));
-		$post_author_name = substr($cb_nick, (strpos($cb_nick, ".")+1));
-		$text .= "<img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" />
-<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />".
-$cb_message."
-</div><br />";
-	}
-
-	$text .= "<hr />";
-
-	$sql -> db_Select("comments", "*", "comment_ip='$ipd' LIMIT 0,20");
-	while(list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, 	$comment_ip) = $sql-> db_Fetch()){
-		$datestamp = $obj->convert_date($comment_datestamp, "short");
-		$post_author_id = substr($comment_author, 0, strpos($comment_author, "."));
-		$post_author_name = substr($comment_author, (strpos($comment_author, ".")+1));
-		$text .= "<img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" />
-<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />".
-$comment_comment."</div><br />";
-	}
-
-}
-
-$ns -> tablerender("<div style=\"text-align:center\">".USFLAN_7."</div>", $text);
-
-require_once("footer.php");
-?>	
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/userinfo.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/08/04 09:56:38 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("4")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+$e_sub_cat = 'users';
+require_once("auth.php");
+
+if (!e_QUERY) {
+	$text = "<div style=\"text-align:center\">".USFLAN_1."</div>";
+	$ns->tablerender(LAN_ERROR, $text);
+	require_once("footer.php");
+	exit;
+} else {
+	$ipd = e_QUERY;
+}
+
+if (isset($ipd)) {
+	$obj = new convert;
+	$sql->db_Select("chatbox", "*", "cb_ip='$ipd' LIMIT 0,20");
+	$host = $e107->get_host_name($ipd);
+	$text = USFLAN_3." <b>".$ipd."</b> [ ".USFLAN_4.": $host ]<br />
+		<i><a href=\"banlist.php?".$ipd."\">".USFLAN_5."</a></i>
+
+		<br /><br />";
+	while (list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip ) = $sql->db_Fetch()) {
+		$datestamp = $obj->convert_date($cb_datestamp, "short");
+		$post_author_id = substr($cb_nick, 0, strpos($cb_nick, "."));
+		$post_author_name = substr($cb_nick, (strpos($cb_nick, ".")+1));
+		$text .= "<img src='".THEME_ABS."images/".BULLET."' alt='bullet' />
+			<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />". $cb_message."
+			</div><br />";
+	}
+
+	$text .= "<hr />";
+
+	if(!defined("BULLET"))	 define("BULLET", "bullet2.gif");
+
+	$sql->db_Select("comments", "*", "comment_ip='$ipd' LIMIT 0,20");
+	while (list($comment_id, $comment_item_id, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip) = $sql->db_Fetch()) {
+		$datestamp = $obj->convert_date($comment_datestamp, "short");
+		$post_author_id = substr($comment_author, 0, strpos($comment_author, "."));
+		$post_author_name = substr($comment_author, (strpos($comment_author, ".")+1));
+		$text .= "<img src='".THEME_ABS."images/".BULLET."' alt='bullet' />
+			<span class=\"defaulttext\"><i>".$post_author_name." (".USFLAN_6.": ".$post_author_id.")</i></span>\n<div class=\"mediumtext\">".$datestamp."<br />". $comment_comment."</div><br />";
+	}
+
+}
+
+$ns->tablerender(USFLAN_7, $text);
+
+require_once("footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/users_extended.php 75/e107_admin/users_extended.php
--- 6171/e107_admin/users_extended.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/users_extended.php	2006-04-29 01:53:08.000000000 -0500
@@ -0,0 +1,1003 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/users_extended.php,v $
+|     $Revision: 1.37 $
+|     $Date: 2006/04/29 06:53:08 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("4")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+if (isset($_POST['cancel']))
+{
+	header("location:".e_SELF);
+	exit;
+}
+
+$e_sub_cat = 'user_extended';
+$user = new users_ext;
+$curtype = '1';
+require_once(e_HANDLER."calendar/calendar_class.php");
+$cal = new DHTML_Calendar(true);
+require_once("auth.php");
+require_once(e_HANDLER."user_extended_class.php");
+require_once(e_HANDLER."userclass_class.php");
+
+
+$ue = new e107_user_extended;
+
+if (e_QUERY)
+{
+	$tmp = explode(".", e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	$id = $tmp[2];
+	unset($tmp);
+}
+
+
+
+if (isset($_POST['up_x']))
+{
+	$qs = explode(".", $_POST['id']);
+	$_id = $qs[0];
+	$_order = $qs[1];
+	$_parent = $qs[2];
+	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order+1 WHERE user_extended_struct_type > 0 AND user_extended_struct_parent = {$_parent} AND user_extended_struct_order ='".($_order-1)."'");
+	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type > 0 AND user_extended_struct_parent = {$_parent} AND user_extended_struct_id='".$_id."'");
+}
+
+if (isset($_POST['down_x']))
+{
+	$qs = explode(".", $_POST['id']);
+	$_id = $qs[0];
+	$_order = $qs[1];
+	$_parent = $qs[2];
+	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type > 0 AND user_extended_struct_parent = {$_parent} AND user_extended_struct_order='".($_order+1)."'");
+	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order+1 WHERE user_extended_struct_type > 0 AND user_extended_struct_parent = {$_parent} AND user_extended_struct_id='".$_id."'");
+}
+
+
+if (isset($_POST['catup_x']))
+{
+	$qs = explode(".", $_POST['id']);
+	$_id = $qs[0];
+	$_order = $qs[1];
+	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order+1 WHERE user_extended_struct_type = 0 AND user_extended_struct_order='".($_order-1)."'");
+	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type = 0 AND user_extended_struct_id='".$_id."'");
+}
+
+if (isset($_POST['catdown_x']))
+{
+	$qs = explode(".", $_POST['id']);
+	$_id = $qs[0];
+	$_order = $qs[1];
+	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type = 0 AND user_extended_struct_order='".($_order+1)."'");
+	$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order+1 WHERE user_extended_struct_type = 0 AND user_extended_struct_id='".$_id."'");
+}
+
+if (isset($_POST['add_field']))
+{
+	if($_POST['user_type']==4){
+    	$_POST['user_values'] = array($_POST['table_db'],$_POST['field_id'],$_POST['field_value'],$_POST['field_order']);
+	}
+	$new_values = make_delimited($_POST['user_values']);
+	$new_parms = $tp->toDB($_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide']);
+	admin_update($ue->user_extended_add($_POST['user_field'], $_POST['user_text'], $_POST['user_type'], $new_parms, $new_values, $_POST['user_default'], $_POST['user_required'], $_POST['user_read'], $_POST['user_write'], $_POST['user_applicable'], 0, $_POST['user_parent']), 'insert', EXTLAN_29);
+}
+
+if (isset($_POST['update_field'])) {
+	if($_POST['user_type']==4){
+    	$_POST['user_values'] = array($_POST['table_db'],$_POST['field_id'],$_POST['field_value'],$_POST['field_order']);
+	}
+	$upd_values = make_delimited($_POST['user_values']);
+	$upd_parms = $tp->toDB($_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide']);
+	admin_update($ue->user_extended_modify($sub_action, $_POST['user_field'], $_POST['user_text'], $_POST['user_type'], $upd_parms, $upd_values, $_POST['user_default'], $_POST['user_required'], $_POST['user_read'], $_POST['user_write'], $_POST['user_applicable'], $_POST['user_parent']), 'update', EXTLAN_29);
+}
+
+if (isset($_POST['update_category']))
+{
+	$name = trim($tp->toHTML($_POST['user_field']));
+	admin_update($sql->db_Update("user_extended_struct","user_extended_struct_name = '{$name}', user_extended_struct_read = '{$_POST['user_read']}', user_extended_struct_write = '{$_POST['user_write']}', user_extended_struct_applicable = '{$_POST['user_applicable']}' WHERE user_extended_struct_id = '{$sub_action}'"), 'update', EXTLAN_43);
+}
+
+if (isset($_POST['add_category']))
+{
+	$name = $tp->toHTML($_POST['user_field']);
+	admin_update($sql->db_Insert("user_extended_struct","'0', '$name', '', 0, '', '', '', '{$_POST['user_read']}', '{$_POST['user_write']}', '0', '0', '{$_POST['user_applicable']}', '0', '0'"), 'insert', EXTLAN_40);
+}
+
+if ($_POST['eu_action'] == "delext")
+{
+	list($_id, $_name) = explode(",",$_POST['key']);
+	if($ue->user_extended_remove($_id, $_name))
+	{
+		$message = EXTLAN_30;
+	}
+}
+
+if ($_POST['eu_action'] == "delcat")
+{
+	list($_id, $_name) = explode(",",$_POST['key']);
+	if($ue->user_extended_remove($_id, $_name))
+	{
+		$message = EXTLAN_41;
+	}
+}
+
+if(isset($_POST['activate']))
+{
+	$message .= field_activate();
+}
+
+if(isset($_POST['deactivate']))
+{
+	$message .= field_deactivate();
+}
+
+if($sql->db_Select("user_extended_struct","DISTINCT(user_extended_struct_parent)"))
+{
+	$plist = $sql->db_getList();
+	foreach($plist as $_p)
+	{
+		$o = 0;
+		if($sql->db_Select("user_extended_struct", "user_extended_struct_id", "user_extended_struct_parent = {$_p['user_extended_struct_parent']} && user_extended_struct_type != 0 ORDER BY user_extended_struct_order ASC"))
+		{
+			$_list = $sql->db_getList();
+			foreach($_list as $r)
+			{
+				$sql->db_Update("user_extended_struct", "user_extended_struct_order = '{$o}' WHERE user_extended_struct_id = {$r['user_extended_struct_id']}");
+				$o++;
+			}
+		}
+	}
+}
+
+if($message)
+{
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+if(isset($_POST['table_db']) && !$_POST['add_field'] && !$_POST['update_field']){
+	$action = "continue";
+	$current['user_extended_struct_name'] = $_POST['user_field'];
+    $current['user_extended_struct_parms'] = $_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide'];
+    $current['user_extended_struct_text'] = $_POST['user_text'];
+	$current['user_extended_struct_type'] = $_POST['user_type'];
+	$user->show_extended($current);
+}
+
+if (!e_QUERY || $action == 'main')
+{
+	$user->show_extended();
+}
+
+if ($action == "editext")
+{
+	if($sql->db_Select('user_extended_struct','*',"user_extended_struct_id = '{$sub_action}'"))
+	{
+		$tmp = $sql->db_Fetch();
+		$user->show_extended($tmp);
+	}
+	else
+	{
+		$user->show_extended('new');
+	}
+}
+
+if($action == 'pre')
+{
+	show_predefined();
+}
+
+if($action == 'cat')
+{
+	if(is_numeric($sub_action))
+	{
+		if($sql->db_Select('user_extended_struct','*',"user_extended_struct_id = '{$sub_action}'"))
+		{
+			$tmp = $sql->db_Fetch();
+		}
+	}
+	$user->show_categories($tmp);
+}
+
+require_once("footer.php");
+
+class users_ext
+{
+
+	function show_extended($current)
+	{
+		global $sql, $ns, $ue, $curtype, $tp, $mySQLdefaultdb, $action, $sub_action;
+
+		$catList = $ue->user_extended_get_categories();
+		$catList[0][0] = array('user_extended_struct_name' => EXTLAN_36);
+		$catNums = array_keys($catList);
+		$extendedList = $ue->user_extended_get_fields();
+
+		if(!$current){
+			$text = "<div style='text-align:center'>";
+			$text .= "<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td class='fcaption'>".EXTLAN_1."</td>
+			<td class='fcaption'>".EXTLAN_2."</td>";
+		//	$text .="<td class='fcaption'>".EXTLAN_3."</td>";
+			$text .="<td class='fcaption'>".EXTLAN_4."</td>
+			<td class='fcaption'>".EXTLAN_5."</td>
+			<td class='fcaption'>".EXTLAN_6."</td>
+			<td class='fcaption'>".EXTLAN_7."</td>
+			<td class='fcaption'>&nbsp;</td>
+			<td class='fcaption'>".EXTLAN_8."</td>
+			</tr>
+			";
+
+			foreach($catNums as $cn)
+			{
+				$text .= "
+				<tr>
+				<td class='forumheader' colspan='9' style='text-align:center'>{$catList[$cn][0]['user_extended_struct_name']}</td>
+				</tr>
+				";
+
+				$i=0;
+				if(count($extendedList))
+				{
+					//	Show current extended fields
+					foreach($extendedList[$cn] as $ext)	{
+					$fname = "user_".$ext['user_extended_struct_name'];
+					$uVal = str_replace(chr(1), "", $curVal[$fname]);
+						$text .= "
+						<tr>
+						<td class='forumheader3'>{$ext['user_extended_struct_name']}<br />[".$tp->toHTML($ext['user_extended_struct_text'], FALSE, "defs")."]</td>
+						<td class='forumheader3'>".$ue->user_extended_edit($ext,$uVal)."</td>
+						<td class='forumheader3'>".($ext['user_extended_struct_required'] == 1 ? LAN_YES : LAN_NO)."</td>
+						<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_applicable'])."</td>
+						<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_read'])."</td>
+						<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_write'])."</td>
+						<td class='forumheader3' style='width:5px'>
+						<form method='post' action='".e_SELF."'>
+						<input type='hidden' name='id' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}.{$ext['user_extended_struct_parent']}' />
+						";
+						if($i > 0){
+							$text .= "
+							<input type='image' alt='' title='".EXTLAN_26."' src='".e_IMAGE."/admin_images/up.png' name='up' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}.{$ext['user_extended_struct_parent']}' />
+							";
+						}
+						if($i <= count($extendedList[$cn])-2)
+						{
+							$text .= "<input type='image' alt='' title='".EXTLAN_25."' src='".e_IMAGE."/admin_images/down.png' name='down' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}.{$ext['user_extended_struct_parent']}' />";
+						}
+						$text .= "
+						</form>
+						</td>
+						<td class='forumheader3' style='width:50px;text-align:center;'>
+						<form method='post' action='".e_SELF."?extended' onsubmit='return confirm(\"".EXTLAN_27."\")'>
+						<a style='text-decoration:none' href='".e_SELF."?editext.{$ext['user_extended_struct_id']}'>".ADMIN_EDIT_ICON."</a>
+						<input type='hidden' name='eu_action' value='delext' />
+						<input type='hidden' name='key' value='{$ext['user_extended_struct_id']},{$ext['user_extended_struct_name']}' />
+						<input type='image' title='".LAN_DELETE."' name='eudel' src='".ADMIN_DELETE_ICON_PATH."' />
+						</form>
+						</td>
+						</tr>
+						";
+						$i++;
+					}
+				}
+				else
+				{
+					$text .= "
+					<tr>
+					<td colspan='8' class='forumheader3' style='text-align:center'>".EXTLAN_28."</td>
+					</tr>
+					";
+				}
+			}
+			//Show add/edit form
+			$text .= "
+			</table>";
+		}
+		else
+		{
+			if($current == 'new')
+			{
+				$current = '';
+			}
+			list($current_include, $current_regex, $current_regexfail, $current_hide) = explode("^,^",$current['user_extended_struct_parms']);
+			$text .= "
+			<form method='post' action='".e_SELF."?".e_QUERY."'>
+			";
+			$text .= "<table style='".ADMIN_WIDTH."' class='fborder'>  ";
+			$text .= "
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_10.":</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>user_";
+			if(is_array($current) && $current['user_extended_struct_name'])
+			{
+				$text .= $current['user_extended_struct_name']."
+				<input type='hidden' name='user_field' value='".$current['user_extended_struct_name']."' />
+				";
+			}
+			else
+			{
+				$text .= "
+				<input class='tbox' type='text' name='user_field' size='40' value='".$current['user_extended_struct_name']."' maxlength='50' />
+				";
+			}
+			$text .= "
+			<br /><span class='smalltext'>".EXTLAN_11."</span>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_12.":</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			<input class='tbox' type='text' name='user_text' size='40' value='".$current['user_extended_struct_text']."' maxlength='50' /><br />
+			<span class='smalltext'>".EXTLAN_13."</span>
+			</td>
+			</tr>
+			";
+
+			$text .= "<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_14."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			<select onchange='changeHelp(this.value)' class='tbox' name='user_type' id='user_type'>";
+			foreach($ue->user_extended_types as $key => $val)
+			{
+				$selected = ($current['user_extended_struct_type'] == $key) ? " selected='selected'": "";
+				$text .= "<option value='".$key."' $selected>".$val."</option>";
+			}
+			$curtype = $current['user_extended_struct_type'];
+			if(!$curtype)
+			{
+				$curtype = '1';
+			}
+			$text .= "
+			</select>
+			</td></tr>";
+
+
+
+			$text .= "
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_3."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>";
+  // Start of Values ---------------------------------
+
+      		$val_hide = ($current['user_extended_struct_type'] != 4) ? "visible" : "none";
+
+			$text .= "<div id='values' style='display:$val_hide'>\n";
+			$text .= "<div id='value_container' >\n";
+			$curVals = explode(",",$current['user_extended_struct_values']);
+			if(count($curVals) == 0){
+				$curVals[]='';
+			}
+			$i=0;
+			foreach($curVals as $v){
+				$id = $i ? "" : " id='value_line'";
+				$i++;
+				$text .= "
+				<span {$id}>
+				<input class='tbox' type='text' name='user_values[]' size='40' value='{$v}' /></span><br />";
+			}
+			$text .= "
+			</div>
+			<input type='button' class='button' value='".EXTLAN_48."' onclick=\"duplicateHTML('value_line','value_container');\"  />
+			<br /><span class='smalltext'>".EXTLAN_17."</span></div>";
+// End of Values. --------------------------------------
+       		$db_hide = ($current['user_extended_struct_type'] == 4) ? "visible" : "none";
+
+			$text .= "<div id='db_mode' style='display:$db_hide'>\n";
+			$text .= "<table style='width:70%;margin-left:0px'><tr><td>";
+            $text .= EXTLAN_62."</td><td style='70%'><select style='width:99%' class='tbox' name='table_db' onchange=\"this.form.submit()\" >
+            <option value='' class='caption'>".EXTLAN_61."</option>\n";
+			$result = mysql_list_tables($mySQLdefaultdb);
+			while ($row2 = mysql_fetch_row($result)){
+				$fld = str_replace(MPREFIX,"",$row2[0]);
+				$selected =  ($_POST['table_db'] == $fld || $curVals[0] == $fld) ? " selected='selected'" : "";
+         		$text .= (strpos($row2[0], MPREFIX) !== FALSE) ? "<option value=\"".$fld."\" $selected>".$fld."</option>\n" : "";
+			}
+			$text .= " </select></td></tr>";
+     	if($_POST['table_db'] || $curVals[0]){
+			// Field ID
+			$text .= "<tr><td>".EXTLAN_63."</td><td><select style='width:99%' class='tbox' name='field_id' >\n
+			<option value='' class='caption'>".EXTLAN_61."</option>\n";
+			$table_list = ($_POST['table_db']) ? $_POST['table_db'] : $curVals[0] ;
+			if($sql -> db_Select_gen("DESCRIBE ".MPREFIX."{$table_list}")){
+		   		while($row3 = $sql -> db_Fetch()){
+    				$field_name=$row3[0];
+					$selected =  ($curVals[1] == $field_name) ? " selected='selected' " : "";
+					$text .="<option value=\"$field_name\" $selected>".$field_name."</option>\n";
+				}
+			}
+    		$text .= " </select></td></tr><tr><td>";
+             // Field Value
+			$text .= EXTLAN_64."</td><td><select style='width:99%' class='tbox' name='field_value' >
+			<option value='' class='caption'>".EXTLAN_61."</option>\n";
+			$table_list = ($_POST['table_db']) ? $_POST['table_db'] : $curVals[0] ;
+			if($sql -> db_Select_gen("DESCRIBE ".MPREFIX."{$table_list}")){
+		   		while($row3 = $sql -> db_Fetch()){
+    				$field_name=$row3[0];
+					$selected =  ($curVals[2] == $field_name) ? " selected='selected' " : "";
+					$text .="<option value=\"$field_name\" $selected>".$field_name."</option>\n";
+				}
+			}
+    		$text .= " </select></td></tr><tr><td>";
+
+			$text .= LAN_ORDER."</td><td><select style='width:99%' class='tbox' name='field_order' >
+			<option value='' class='caption'>".EXTLAN_61."</option>\n";
+			$table_list = ($_POST['table_db']) ? $_POST['table_db'] : $curVals[0] ;
+			if($sql -> db_Select_gen("DESCRIBE ".MPREFIX."{$table_list}")){
+		   		while($row3 = $sql -> db_Fetch()){
+    				$field_name=$row3[0];
+					$selected =  ($curVals[3] == $field_name) ? " selected='selected' " : "";
+					$text .="<option value=\"$field_name\" $selected>".$field_name."</option>\n";
+				}
+			}
+    		$text .= " </select></td></tr>";
+
+     	}
+        $text .= "</table></div>";
+// ---------------------------------------------------------
+			$text .= "
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_16."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			<input class='tbox' type='text' name='user_default' size='40' value='{$current['user_extended_struct_default']}' />
+			</td>
+			</tr>
+
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_15."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			<textarea class='tbox' name='user_include' cols='60' rows='2'>{$current_include}</textarea><br />
+			<span class='smalltext'>".EXTLAN_51."</span><br />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_52."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			<input class='tbox' type='text' name='user_regex' size='30' value='{$current_regex}' /><br />
+			<span class='smalltext'>".EXTLAN_53."</span><br />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_54."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			<input class='tbox' type='text' name='user_regexfail' size='40' value='{$current_regexfail}' /><br />
+			<span class='smalltext'>".EXTLAN_55."</span><br />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_44."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			<select class='tbox' name='user_parent'>";
+			foreach($catNums as $k)
+			{
+				$sel = ($k == $current['user_extended_struct_parent']) ? " selected='selected' " : "";
+				$text .= "<option value='{$k}' {$sel}>{$catList[$k][0]['user_extended_struct_name']}</option>\n";
+			}
+			$text .= "</select>
+
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_18."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			<select class='tbox' name='user_required'>
+			";
+			$_r = array('0' => EXTLAN_65, '1' => EXTLAN_66, '2' => EXTLAN_67);
+			foreach($_r as $k => $v)
+			{
+				$sel = ($current['user_extended_struct_required'] == $k ? " selected='selected' " : "");
+				$text .= "<option value='{$k}' {$sel}>{$v}</option>\n";
+			}
+
+			$text .= "
+			</select>
+			<br />
+			<span class='smalltext'>".EXTLAN_19."</span>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_5."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			".r_userclass("user_applicable", $current['user_extended_struct_applicable'], 'off', 'member, admin, classes, nobody')."<br /><span class='smalltext'>".EXTLAN_20."</span>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_6."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			".r_userclass("user_read", $current['user_extended_struct_read'], 'off', 'public, member, admin, readonly, classes')."<br /><span class='smalltext'>".EXTLAN_22."</span>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_7."</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			".r_userclass("user_write", $current['user_extended_struct_write'], 'off', 'member, admin, classes')."<br /><span class='smalltext'>".EXTLAN_21."</span>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%;vertical-align:top' class='forumheader3'>".EXTLAN_49."
+			</td>
+			<td style='width:70%' class='forumheader3' colspan='3'>
+			<select class='tbox' name='user_hide'>
+			";
+			if($current_hide)
+			{
+				$text .= "
+				<option value='1' selected='selected'>".LAN_YES."</option>
+				<option value='0'>".LAN_NO."</option>";
+			}
+			else
+			{
+				$text .= "
+				<option value='1'>".LAN_YES."</option>
+				<option value='0' selected='selected'>".LAN_NO."</option>";
+			}
+			$text .= "
+			</select>
+			<br /><span class='smalltext'>".EXTLAN_50."</span>
+			</td>
+			</tr>
+			";
+
+			$text .= "<tr>
+			<td colspan='4' style='text-align:center' class='forumheader'>";
+
+			if ((!is_array($current) || $action == "continue") && $sub_action == "")
+			{
+				$text .= "
+				<input class='button' type='submit' name='add_field' value='".EXTLAN_23."' />
+				";
+			}
+			else
+			{
+				$text .= "
+				<input class='button' type='submit' name='update_field' value='".EXTLAN_24."' /> &nbsp; &nbsp;
+				<input class='button' type='submit' name='cancel' value='".EXTLAN_33."' />
+				";
+			}
+			// ======= end added by Cam.
+			$text .= "</td>
+			</tr>
+
+			</table></form>
+			";
+		}
+		//		$text .= "</div>";
+		$ns->tablerender(EXTLAN_9, $text);
+	}
+
+	function show_categories($current)
+	{
+		global $sql, $ns, $ue;
+
+		$text = "<div style='text-align:center'>";
+		$text .= "
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td class='fcaption'>".EXTLAN_1."</td>
+		<td class='fcaption'>".EXTLAN_5."</td>
+		<td class='fcaption'>".EXTLAN_6."</td>
+		<td class='fcaption'>".EXTLAN_7."</td>
+		<td class='fcaption'>&nbsp;</td>
+		<td class='fcaption'>".EXTLAN_8."</td>
+		</tr>
+		";
+		$catList = $ue->user_extended_get_categories(FALSE);
+		if(count($catList))
+		{
+			//			Show current categories
+			$i=0;
+			foreach($catList as $ext)
+			{
+				$text .= "
+				<td class='forumheader3'>{$ext['user_extended_struct_name']}</td>
+				</td>
+				<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_applicable'])."</td>
+				<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_read'])."</td>
+				<td class='forumheader3'>".r_userclass_name($ext['user_extended_struct_write'])."</td>
+				<td class='forumheader3'>
+				<form method='post' action='".e_SELF."?cat'>
+				<input type='hidden' name='id' value='{$ext['user_extended_struct_id']}.{$ext['user_extended_struct_order']}' />
+				";
+				if($i > 0)
+				{
+					$text .= "
+					<input type='image' alt='' title='".EXTLAN_26."' src='".e_IMAGE."/admin_images/up.png' name='catup' value='{$ext['user_extended_struct_id']}' />
+					";
+				}
+				if($i <= count($catList)-2)
+				{
+					$text .= "<input type='image' alt='' title='".EXTLAN_25."' src='".e_IMAGE."/admin_images/down.png' name='catdown' value='{$ext['user_extended_struct_id']}' />";
+				}
+				$text .= "
+				</form>
+				</td>
+				<td class='forumheader3' style='text-align:center; white-space: nowrap'>
+				<form method='post' action='".e_SELF."?cat' onsubmit='return confirm(\"".EXTLAN_27."\")'>
+				<input type='hidden' name='eu_action' value='delcat' />
+				<input type='hidden' name='key' value='{$ext['user_extended_struct_id']},{$ext['user_extended_struct_name']}' />
+				<a style='text-decoration:none' href='".e_SELF."?cat.{$ext['user_extended_struct_id']}'>".ADMIN_EDIT_ICON."</a>
+				<input type='image' title='".LAN_DELETE."' name='eudel' src='".ADMIN_DELETE_ICON_PATH."' />
+				</form>
+				</td>
+				</tr>
+				";
+				$i++;
+			}
+		}
+		else
+		{
+			$text .= "
+			<tr>
+			<td colspan='8' class='forumheader3' style='text-align:center'>".EXTLAN_37."</td>
+			</tr>
+			";
+		}
+
+		//Show add/edit form
+		$text .= "
+		</table>
+		<form method='post' action='".e_SELF."?".e_QUERY."'>
+		";
+		$text .= "<div><br /></div><table style='".ADMIN_WIDTH."' class='fborder'>  ";
+		$text .= "
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".EXTLAN_38.":</td>
+		<td style='width:70%' class='forumheader3' colspan='3'>
+		<input class='tbox' type='text' name='user_field' size='40' value='".$current['user_extended_struct_name']."' maxlength='50' />
+		<br /><span class='smalltext'>".EXTLAN_11."</span>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".EXTLAN_5."</td>
+		<td style='width:70%' class='forumheader3' colspan='3'>
+		".r_userclass("user_applicable", $current['user_extended_struct_applicable'], 'off', 'member, admin, classes')."<br /><span class='smalltext'>".EXTLAN_20."</span>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".EXTLAN_6."</td>
+		<td style='width:70%' class='forumheader3' colspan='3'>
+		".r_userclass("user_read", $current['user_extended_struct_read'], 'off', 'public, member, admin, classes, readonly')."<br /><span class='smalltext'>".EXTLAN_22."</span>
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".EXTLAN_7."</td>
+		<td style='width:70%' class='forumheader3' colspan='3'>
+		".r_userclass("user_write", $current['user_extended_struct_write'], 'off', 'member, admin, classes')."<br /><span class='smalltext'>".EXTLAN_21."</span>
+		</td>
+		</tr>";
+
+
+		$text .= "<tr>
+		<td colspan='4' style='text-align:center' class='forumheader'>";
+
+		if (!is_array($current))
+		{
+			$text .= "
+			<input class='button' type='submit' name='add_category' value='".EXTLAN_39."' />
+			";
+		}
+		else
+		{
+			$text .= "
+			<input class='button' type='submit' name='update_category' value='".EXTLAN_42."' /> &nbsp; &nbsp;
+			<input class='button' type='submit' name='cancel_cat' value='".EXTLAN_33."' />
+			";
+		}
+		// ======= end added by Cam.
+		$text .= "</td>
+		</tr>
+
+		</table></form></div>";
+		$ns->tablerender(EXTLAN_9, $text);
+	}
+
+	function show_options($action) {
+		// ##### Display options ---------------------------------------------------------------------------------------------------------
+		if ($action == "") {
+			$action = "main";
+		}
+		// ##### Display options ---------------------------------------------------------------------------------------------------------
+		$var['main']['text'] = EXTLAN_34;
+		$var['main']['link'] = e_SELF;
+
+		$var['editext']['text'] = EXTLAN_45;
+		$var['editext']['link'] = e_SELF."?editext";
+
+		$var['cat']['text'] = EXTLAN_35;
+		$var['cat']['link'] = e_SELF."?cat";
+
+		$var['pre']['text'] = EXTLAN_56;
+		$var['pre']['link'] = e_SELF."?pre";
+
+		show_admin_menu(EXTLAN_9, $action, $var);
+	}
+}
+
+function users_extended_adminmenu() {
+	global $user, $action, $ns, $curtype, $action;
+	$user->show_options($action);
+	if($action == 'editext' || $action == 'continue')
+	{
+		$ns->tablerender(EXTLAN_46." - <span id='ue_type'>&nbsp;</span>", "<div id='ue_help'>&nbsp;</div>");
+		echo "<script type='text/javascript'>changeHelp('{$curtype}');</script>";
+	}
+}
+
+
+function make_delimited($var)
+{
+	global $tp;
+	foreach($var as $k => $v)
+	{
+		$var[$k] = $tp->toDB(trim($v));
+		$var[$k] = str_replace(",", "[E_COMMA]", $var[$k]);
+		if($var[$k] == "")
+		{
+			unset($var[$k]);
+		}
+	}
+	$ret = implode(",", $var);
+	return $ret;
+}
+
+function show_predefined()
+{
+	global $tp, $ns, $ue, $sql;
+
+	// Get list of current extended fields
+	$curList = $ue->user_extended_get_fieldlist();
+	foreach($curList as $c)
+	{
+		$curNames[] = $c['user_extended_struct_name'];
+	}
+
+	//Get list of predefined fields, determine which are already activated.
+	$preList = $ue->parse_extended_xml('getfile');
+	ksort($preList);
+	foreach($preList as $k => $v)
+	{
+		if($k != 'version')
+		{
+		if(in_array($v['name'], $curNames))
+		{
+			$active[] = $v;
+		}
+		else
+		{
+			$inactive[] = $v;
+		}
+		}
+	}
+
+	$txt = "
+	<form method='post' action='".e_SELF."?pre'>
+	<table class='fborder' style='".ADMIN_WIDTH."'>
+	<tr>
+	<td class='fcaption' colspan='4'>".EXTLAN_57."</td>
+	</tr>
+	";
+	if(count($active))
+	{
+		foreach($active as $a)
+		{
+			$txt .= show_field($a, 'deactivate');
+		}
+	}
+	else
+	{
+		$txt .= "<tr><td class='forumheader3' colspan='4'>".EXTLAN_61."</td></tr>";
+	}
+
+	$txt .= "
+	<tr>
+	<td class='fcaption' colspan='4'>".EXTLAN_58."</td>
+	</tr>
+	";
+	foreach($inactive as $a)
+	{
+		$txt .= show_field($a);
+	}
+	$txt .= "</table></form>";
+	$ns->tablerender(EXTLAN_56, $txt);
+	require_once('footer.php');
+	exit;
+}
+
+function show_field($var, $type='activate')
+{
+	global $tp;
+	static $head_shown;
+	$txt = "";
+//	$showlist = array('type','text', 'values', 'include_text', 'regex');
+	if($head_shown != 1)
+	{
+
+		$txt .= "
+		<tr>
+		<td class='forumheader'>".UE_LAN_9."</td>
+		<td class='forumheader'>".UE_LAN_10."</td>
+		<td class='forumheader'>".UE_LAN_11."</td>
+		<td class='forumheader' style='width: 5%'>&nbsp;</td>
+		</tr>
+		";
+		$head_shown = 1;
+	}
+	$txt .= "
+	<tr>
+	<td class='forumheader3'>{$var['name']}</td>
+	<td class='forumheader3'>".$tp->toHTML($var['type'], false, 'defs')."</td>
+	<td class='forumheader3'>".constant(strtoupper($var['text'])."_DESC")."</td>
+	";
+//	$txt .= constant("UE_LAN_".strtoupper($var['text'])."DESC")."<br />";
+//	foreach($showlist as $f)
+//	{
+//		if($var[$f] != "" && $f != 'type' && $f !='text')
+//		{
+//			$txt .= "<strong>{$f}: </strong>".$tp->toHTML($var[$f], false, 'defs')."<br />";
+//		}
+//	}
+	$val = ('activate' == $type) ? EXTLAN_59 : EXTLAN_60;
+	$txt .= "
+	<td class='forumheader3' style='text-align: center'><input class='button' type='submit' name='{$type}[{$var['name']}]' value='{$val}' /></td>
+	</tr>";
+	return $txt;
+}
+
+function field_activate()
+{
+	global $ue, $ns, $tp;
+	$ret = "";
+	$preList = $ue->parse_extended_xml('getfile');
+	$tmp = $preList;
+
+	foreach(array_keys($_POST['activate']) as $f)
+	{
+
+		$tmp[$f]['parms'] = $tp->toDB($tmp[$f]['parms']);
+		if($ue->user_extended_add($tmp[$f]))
+		{
+			$ret .= "Field: $f has been activated <br />";
+
+			if($tmp[$f]['type']=="db field" && is_readable(e_ADMIN."sql/extended_".$f.".php")){
+             	$ret .= (process_sql($f)) ? LAN_CREATED." user_extended_{$f}<br />" : LAN_CREATED_FAILED." user_extended_{$f}<br />";
+			}
+		}
+		else
+		{
+			$ret .= "ERROR!!  Field: $f was not activated! <br />";
+		}
+	}
+	return $ret;
+}
+
+function field_deactivate()
+{
+	global $ue, $ns, $tp,$sql;
+	$ret = "";
+	foreach(array_keys($_POST['deactivate']) as $f)
+	{
+		if($ue->user_extended_remove($f, $f))
+		{
+			$ret .= "Field: $f has been deactivated <br />";
+			if(is_readable(e_ADMIN."sql/extended_".$f.".php")){
+             	$ret .= (mysql_query("DROP TABLE ".MPREFIX."user_extended_".$f)) ? LAN_DELETED." user_extended_".$f."<br />" : LAN_DELETED_FAILED." user_extended_".$f."<br />";
+			}
+		}
+		else
+		{
+			$ret .= "ERROR!!  Field: $f was not deactivated! <br />";
+		}
+	}
+	return $ret;
+}
+
+
+function process_sql($f){
+    global $sql;
+	$filename = e_ADMIN."sql/extended_".$f.".php";
+	$fd = fopen ($filename, "r");
+	$sql_data = fread($fd, filesize($filename));
+	fclose ($fd);
+
+	$search[0] = "CREATE TABLE ";	$replace[0] = "CREATE TABLE ".MPREFIX;
+	$search[1] = "INSERT INTO ";	$replace[1] = "INSERT INTO ".MPREFIX;
+
+    preg_match_all("/create(.*?)myisam;/si", $sql_data, $creation);
+    foreach($creation[0] as $tab){
+		$query = str_replace($search,$replace,$tab);
+      	if(!mysql_query($query)){
+        	$error = TRUE;
+		}
+	}
+
+    preg_match_all("/insert(.*?);/si", $sql_data, $inserts);
+	foreach($inserts[0] as $ins){
+		$qry = str_replace($search,$replace,$ins);
+		if(!mysql_query($qry)){
+		  	$error = TRUE;
+		}
+    }
+
+	return ($error) ? FALSE : TRUE;
+
+}
+
+
+
+function headerjs()
+{
+	include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_extended.php");
+	$text = "
+	<script type='text/javascript'>
+
+	function changeHelp(type) {
+		var ftype;
+		var helptext;
+		";
+		for($i=0; $i<=7; $i++)
+		{
+			$type_const = "UE_LAN_{$i}";
+			$help_const = "EXTLAN_HELP_{$i}";
+			$text .= "
+			if(type == \"{$i}\")
+			{
+				xtype=\"".constant($type_const)."\";
+				what=\"".constant($help_const)."\";
+			}";
+		}
+		$text .= "
+		document.getElementById('ue_type').innerHTML=''+xtype+'';
+		document.getElementById('ue_help').innerHTML=''+what+'';
+
+		if(type == 4){
+			document.getElementById('db_mode').style.display = '';
+			document.getElementById('values').style.display = 'none';
+		}else{
+            document.getElementById('values').style.display = '';
+			document.getElementById('db_mode').style.display = 'none';
+		}
+	}
+
+
+	</script>";
+
+	global $cal;
+	$text .= $cal->load_files();
+
+	echo $text;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_admin/users_extended_predefined.php 75/e107_admin/users_extended_predefined.php
--- 6171/e107_admin/users_extended_predefined.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_admin/users_extended_predefined.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,56 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/users_extended_predefined.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+function get_extended_predefined()
+{
+	$ue_field['location'] = array(
+	"text" => EXTLAN_PRE1,
+	"type" => "textbox",
+	"include_text" => "class='tbox' size='80' maxlength='254'"
+	);
+
+	$ue_field['aim'] = array(
+	"text" => EXTLAN_PRE2,
+	"type" => "textbox",
+	"include_text" => "class='tbox' size='40' maxlength='254'"
+	);
+
+	$ue_field['icq'] = array(
+	"text" => EXTLAN_PRE3,
+	"type" => "textbox",
+	"include_text" => "class='tbox' size='40' maxlength='254'"
+	);
+
+	$ue_field['yahoo'] = array(
+	"text" => EXTLAN_PRE4,
+	"type" => "textbox",
+	"include_text" => "class='tbox' size='40' maxlength='254'"
+	);
+
+	$ue_field['homepage'] = array(
+	"text" => EXTLAN_PRE5,
+	"type" => "textbox",
+	"include_text" => "class='tbox' size='40' maxlength='254'",
+	"regex validation" => "#^[a-z0-9]+://#si"
+	);
+
+	return $ue_field;
+}
\ No newline at end of file
diff -ruN 6171/e107_admin/users.php 75/e107_admin/users.php
--- 6171/e107_admin/users.php	2004-09-09 04:31:16.000000000 -0500
+++ 75/e107_admin/users.php	2006-05-14 01:04:33.000000000 -0500
@@ -1,867 +1,1056 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/e107_admin/users.php,v $
-|     $Revision: 1.29 $
-|     $Date: 2004/09/09 09:31:15 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("4")){ header("location:".e_BASE."index.php"); exit;}
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-require_once("auth.php");
-$user = new users;
-require_once(e_HANDLER."form_handler.php");
-$rs = new form;
-
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
-        $from = ($tmp[3] ? $tmp[3] : 0);
-        unset($tmp);
-}
-
-$from = ($from ? $from : 0);
-$amount = 50;
-
-
-
-if(IsSet($_POST['resend_mail'])){
-    $id = $_POST['resend_id'];
-    $key = $_POST['resend_key'];
-    $name = $_POST['resend_name'];
-   define("RETURNADDRESS", (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$id.".".$key : SITEURL."/signup.php?activate.".$id.".".$key));
-
-   $message = USRLAN_114." ".$_POST['resend_name']."\n\n".USRLAN_122." ".SITENAME."\n".USRLAN_123."\n\n".USRLAN_124."...\n\n";
-   $message .= RETURNADDRESS . "\n\n".USRLAN_115."\n\n ".USRLAN_125." ".SITENAME."\n".SITEURL;
-
-   require_once(e_HANDLER."mail.php");
-   sendemail($_POST['resend_email'], USRLAN_113." ".SITENAME, $message);
- //  echo str_replace("\n","<br>",$message);
-   $user -> show_message("Email Re-sent to: ".$name);
-   unset($id,$action,$sub_cation);
-}
-
-if(IsSet($_POST['test_mail'])){
-   require_once(e_HANDLER."mail.php");
-   $text = validatemail($_POST['test_email']);
-   $caption = $_POST['test_email']." - ";
-   $caption .= ($text[0]==TRUE)?"Successful": "Error";
-   $ns -> tablerender($caption, $text[1]);
-   unset($id,$action,$sub_cation);
-}
-
-if(IsSet($_POST['update_options'])){
-        $pref['avatar_upload'] = (FILE_UPLOADS ? $_POST['avatar_upload'] : 0);
-        $pref['im_width'] = $_POST['im_width'];
-        $pref['im_height'] = $_POST['im_height'];
-        $pref['photo_upload'] = (FILE_UPLOADS ? $_POST['photo_upload'] : 0);
-                $pref['del_unv'] = $_POST['del_unv'];
-        save_prefs();
-        $user -> show_message(USRLAN_1);
-}
-
-if(IsSet($_POST['prune'])){
-        $sql2 = new db;
-        $text = USRLAN_56." ";
-        if($sql -> db_Select("user", "user_id, user_name", "user_ban=2")){
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        $text .= $user_name." ";
-                        $sql2 -> db_Delete("user", "user_id='$user_id' ");
-                }
-        }
-        $ns -> tablerender(USRLAN_57, "<div style='text-align:center'><b>".$text."</b></div>");
-        unset($text);
-}
-
-if(IsSet($_POST['adduser'])){
-        if(!$_POST['ac'] == md5(ADMINPWCHANGE)){
-                exit;
-        }
-
-        require_once(e_HANDLER."message_handler.php");
-        if(strstr($_POST['name'], "#") || strstr($_POST['name'], "=")){
-                message_handler("P_ALERT", USRLAN_92);
-                $error = TRUE;
-        }
-        $_POST['name'] = trim(chop(str_replace("&nbsp;", "", $_POST['name'])));
-        if($_POST['name'] == "Anonymous"){
-                message_handler("P_ALERT", USRLAN_65);
-                $error = TRUE;
-        }
-        if($sql -> db_Select("user", "*", "user_name='".$_POST['name']."' ")){
-                message_handler("P_ALERT", USRLAN_66);
-                $error = TRUE;
-        }
-        if($_POST['password1'] != $_POST['password2']){
-                message_handler("P_ALERT", USRLAN_67);
-                $error = TRUE;
-        }
-
-        if($_POST['name'] == "" || $_POST['password1'] =="" || $_POST['password2'] = ""){
-                message_handler("P_ALERT", USRLAN_68);
-                $error = TRUE;
-        }
-                if(!preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $_POST['email'])){
-           message_handler("P_ALERT", USRLAN_69);
-           $error = TRUE;
-        }
-        if(!$error){
-                if($sql -> db_Select("user", "*", "user_email='".$_POST['email']."' AND user_ban='1' ")){
-                        exit;
-                }
-                if($sql -> db_Select("banlist", "*", "banlist_ip='".$_POST['email']."'")){
-                        exit;
-                }
-
-                $username = strip_tags($_POST['name']);
-                $ip = getip();
-                                extract($_POST);
-                            for($a=0; $a<=(count($_POST['userclass'])-1); $a++){
-                                                           $svar .= $userclass[$a].".";
-                                }
-                $sql -> db_Insert("user", "0, '".$username."', '', '".md5($_POST['password1'])."', '$key', '".$_POST['email']."',         '".$_POST['website']."', '".$_POST['icq']."', '".$_POST['aim']."', '".$_POST['msn']."', '".$_POST['location']."', '".$_POST['birthday']."', '".$_POST['signature']."', '".$_POST['image']."', '".$_POST['timezone']."', '1', '".time()."', '0', '".$time."', '0', '0', '0', '0', '".$ip."', '0', '0', '', '', '', '0', '".$_POST['realname']."', '".$svar."', '', '', '' ");
-                $user -> show_message(USRLAN_70);
-        }
-}
-
-if($_POST['useraction'] == 'userinfo')
-{
-        header('location:'.SITEURL.$ADMIN_DIRECTORY."userinfo.php?{$_POST['userip']}");
-        exit;
-}
-
-if($_POST['useraction'] == 'usersettings')
-{
-        header('location:'.SITEURL."usersettings.php?{$_POST['userid']}");
-        exit;
-}
-
-if($_POST['useraction'] == 'userclass')
-{
-        header('location:'.SITEURL.$ADMIN_DIRECTORY."userclass.php?{$_POST['userid']}");
-        exit;
-}
-
-
-if($_POST['useraction'] == "ban")
-{
-        $sub_action = $_POST['userid'];
-        $sql -> db_Select("user", "*", "user_id='$sub_action'");
-        $row = $sql -> db_Fetch(); extract($row);
-        if($user_perms == "0")
-        {
-                $user -> show_message(USRLAN_7);
-        } else
-        {
-                $sql -> db_Update("user", "user_ban='1' WHERE user_id=$sub_action");
-                $user -> show_message(USRLAN_8);
-        }
-        $action = "main";
-        $sub_action = "user_id";
-}
-
-if($_POST['useraction'] == "unban")
-{
-        $sub_action=$_POST['userid'];
-        $sql -> db_Update("user", "user_ban='0' WHERE user_id='$sub_action' ");
-        $user -> show_message(USRLAN_9);
-        $action = "main";
-        $sub_action = "user_id";
-}
-
-
-if($_POST['useraction'] == 'resend')
-{
-        $sub_action=$_POST['userid'];
-        if($sql -> db_Select("user", "*", "user_id='$sub_action' "))
-        {
-                $resend = $sql -> db_Fetch();
-                $text .= "<form method='post' action='".e_SELF."'><div style='text-align:center'>\n";
-                $text .= USRLAN_116." <b>".$resend['user_name']."</b><br /><br />
-
-                <input type='hidden' name='resend_id' value='$sub_action' />\n
-                <input type='hidden' name='resend_name' value='".$resend['user_name']."' />\n
-                <input type='hidden' name='resend_key' value='".$resend['user_sess']."' />\n
-                <input type='hidden' name='resend_email' value='".$resend['user_email']."' />\n
-                <input class='button' type='submit' name='resend_mail' value='".USRLAN_112."' />\n</div></form>\n";
-                $caption = USRLAN_112;
-                $ns -> tablerender($caption, $text);
-        }
-}
-
-if($_POST['useraction'] == 'test')
-{
-        $sub_action=$_POST['userid'];
-        if($sql -> db_Select("user", "*", "user_id='$sub_action' ")){
-                $test = $sql -> db_Fetch();
-                $text .= "<form method='post' action='".e_SELF."'><div style='text-align:center'>\n";
-                $text .= USRLAN_117." <br /><b>".$test['user_email']."</b><br /><br />
-                <input type='hidden' name='test_email' value='".$test['user_email']."' />\n
-                <input class='button' type='submit' name='test_mail' value='".USRLAN_118."' />\n</div></form>\n";
-                $caption = USRLAN_118;
-                $ns -> tablerender($caption, $text);
-        }
-}
-
-if($_POST['useraction'] == 'deluser')
-{
-        $sub_action=$_POST['userid'];
-        if($_POST['confirm'])
-        {
-                if($sql -> db_Delete("user", "user_id=$sub_action AND user_perms != '0'"))
-                {
-                        $user -> show_message(USRLAN_10);
-                }
-                $sub_action = "user_id";
-                $id = "DESC";
-        } else
-        {
-                if($sql -> db_Select("user", "*", "user_id='$sub_action' "))
-                {
-                        $row = $sql -> db_Fetch();
-                        $text .= "<form method='post' action='".e_SELF."'><div style='text-align:center'>\n";
-                        $text .= "<div>
-                         <input type='hidden' name='useraction' value='deluser' />
-                        <input type='hidden' name='userid' value='{$row['user_id']}' /></div>".
-                        USRLAN_13."
-                        <br /><br /><span class='indent'>#{$row['user_id']} : {$row['user_name']}</span>
-                        <br /><br />
-                        <input type='submit' class='button' name='confirm' value='".USRLAN_17."' />
-                        &nbsp;&nbsp;
-                        <input type='submit' class='button' name='cancel' value='".USRLAN_15."' />
-                        </div>
-                        </form>
-                        ";
-                        $ns -> tablerender(USRLAN_16,$text);
-                        require_once("footer.php");
-                        exit;
-                }
-        }
-}
-
-if($_POST['useraction'] == "admin")
-{
-        $sub_action = $_POST['userid'];
-        $sql -> db_Select("user", "*", "user_id='$sub_action'");
-        $row = $sql -> db_Fetch(); extract($row);
-        $sql -> db_Update("user", "user_admin='1' WHERE user_id=$sub_action");
-        $user -> show_message($user_name." ".USRLAN_3." <a href='".e_ADMIN."administrator.php?edit.$sub_action'>".USRLAN_4."</a>");
-        $action = "main";
-        $sub_action = "user_id";
-        $id = "DESC";
-}
-
-if($_POST['useraction'] == "unadmin")
-{
-        $sub_action = $_POST['userid'];
-        $sql -> db_Select("user", "*", "user_id='$sub_action'");
-        $row = $sql -> db_Fetch(); extract($row);
-        if($user_perms == "0"){
-                $user -> show_message(USRLAN_5);
-        } else
-        {
-                $sql -> db_Update("user", "user_admin='0' WHERE user_id=$sub_action");
-                $user -> show_message($user_name." ".USRLAN_6);
-                $action = "main";
-                $sub_action = "user_id";
-                $id = "DESC";
-        }
-}
-
-if(IsSet($_POST['add_field'])){
-        extract($_POST);
-        $sql -> db_Select("core", " e107_value", " e107_name='user_entended'");
-        $row = $sql -> db_Fetch();
-        $user_entended = unserialize($row[0]);
-        // changed by Cameron
-        $user_field = str_replace(" ","_",$user_field);
-        $user_entended[] = $user_field."|".$user_type."|".$user_value."|".$user_default."|".$user_visible."|".$user_hide;
-   //     $user_entended[] = $user_field;
-        $tmp = addslashes(serialize($user_entended));
-        if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-                $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
-        }else{
-                $sql -> db_Insert("core", "'user_entended', '$tmp' ");
-        }
-        $message = USRLAN_2;
-}
-
-if(IsSet($_POST['update_field'])){
-        extract($_POST);
-        $sql -> db_Select("core", " e107_value", " e107_name='user_entended'");
-        $row = $sql -> db_Fetch();
-        $user_entended = unserialize($row[0]);
-//        unset($user_entended[$sub_action]);
-        $user_field = str_replace(" ","_",$user_field);
-        $user_entended[$sub_action] = $user_field."|".$user_type."|".$user_value."|".$user_default."|".$user_visible."|".$user_hide;
-        $tmp = addslashes(serialize($user_entended));
-        if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-                $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
-        }else{
-                $sql -> db_Insert("core", "'user_entended', '$tmp' ");
-        }
-        $message = "Updated";
-}
-
-
-if($_POST['eu_action'] == "delext"){
-        $sub_action = $_POST['key'];
-        $sql -> db_Select("core", " e107_value", " e107_name='user_entended'");
-        $row = $sql -> db_Fetch();
-        $user_entended = unserialize($row[0]);
-        unset($user_entended[$sub_action]);
-        $tmp = addslashes(serialize($user_entended));
-        $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='user_entended' ");
-        $user -> show_message(USRLAN_83);
-//        $action = "extended"; // this line prevents adding another field without resetting.
-//        $user -> show_extended();//   this fixes the delete/add problem but causes the showmessage to occur.
-}
-
-if($action == "editext"){
-        $sql -> db_Select("core", " e107_value", " e107_name='user_entended'");
-        $row = $sql -> db_Fetch();
-        $user_entended = unserialize($row[0]);
-        $tmp = explode("|",$user_entended[$sub_action]);
-        $uf_name = $tmp[0];
-        $uf_type = $tmp[1];
-        $uf_value = $tmp[2];
-        $uf_default = $tmp[3];
-        $uf_visible = $tmp[4];
-        $uf_hide = $tmp[5];
-        $user -> show_extended();
-}
-
-if($_POST['useraction'] == "verify")
-{
-        $sub_action = $_POST['userid'];
-        if($sql -> db_Update("user", "user_ban='0' WHERE user_id=$sub_action"))
-        {
-                $user -> show_message(USRLAN_86);
-                $action = "main";
-                $sub_action = "user_id";
-                $id = "DESC";
-        }
-}
-
-if($action == "main" && is_numeric($sub_action)){
-        $user -> show_message(USRLAN_87);
-}
-
-if($action == "cu" && is_numeric($sub_action)){
-        $user -> show_message(USRLAN_88);
-        $action = "main";
-        $sub_action = "user_id";
-}
-
-if(!e_QUERY || $action == "main"){
-        $user -> show_existing_users($action, $sub_action, $id, $from, $amount);
-}
-
-if($action == "options"){
-        $user -> show_prefs();
-}
-
-if($action == "extended"){
-        $user -> show_extended();
-}
-
-if($action == "prune"){
-        $user -> show_prune();
-}
-
-if($action == "create"){
-        $user -> add_user();
-}
-
-//$user -> show_options($action);
-require_once("footer.php");
-function headerjs(){
-global $etp;
-$header_js= "<script type=\"text/javascript\">
-function confirm_(mode, user_id, user_name){
-        if(mode == 'cat'){
-                var x=confirm(\"".$etp->unentity(NWSLAN_37)." [ID: \" + user_id + \"]\");
-        }else if(mode == 'sn'){
-                var x=confirm(\"".$etp->unentity(NWSLAN_38)." [ID: \" + user_id + \"]\");
-        }else{
-                var x=confirm(\"".$etp->unentity(USRLAN_82)." [".USRLAN_61.": \" + user_name + \"]\");
-        }
-if(x)
-        if(mode == 'cat'){
-                window.location='".e_SELF."?cat.confirm.' + user_id;
-        }else if(mode == 'sn'){
-                window.location='".e_SELF."?sn.confirm.' + user_id;
-        }else{
-                window.location='".e_SELF."?main.confirm.' + user_id;
-        }
-}
-</script>";
- return $header_js;
-}
-class users{
-
-        function show_existing_users($action, $sub_action, $id, $from, $amount){
-                // ##### Display scrolling list of existing news items ---------------------------------------------------------------------------------------------------------
-
-                global $sql, $rs, $ns, $aj;
-
-                if($sql -> db_Select("userclass_classes")){
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $class[$userclass_id] = $userclass_name;
-                        }
-                }
-
-
-                $text = "<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 200px; overflow : auto; '>";
-
-                if(IsSet($_POST['searchquery'])){
-
-                        $query = (eregi("@",$_POST['searchquery']))?"user_email REGEXP('".$_POST['searchquery']."') OR ":"";
-                        $query .= (eregi(".",$_POST['searchquery']))?"user_ip REGEXP('".$_POST['searchquery']."') OR ":"";
-                        $query .= "user_login REGEXP('".$_POST['searchquery']."') OR ";
-                        $query .= "user_name REGEXP('".$_POST['searchquery']."') ORDER BY user_id";
-                }else{
-                        $query = "ORDER BY ".($sub_action ? $sub_action : "user_id")." ".($id ? $id : "DESC")."  LIMIT $from, $amount";
-                }
-
-
-                if($sql -> db_Select("user", "*", $query, ($_POST['searchquery'] ? 0 : "nowhere"))){
-                        $text .= "<table class='fborder' style='width:100%'>
-                        <tr>
-                        <td style='width:5%' class='forumheader2'><a href='".e_SELF."?main.user_id.".($id == "desc" ? "asc" : "desc").".$from'>ID</a></td>
-                        <td style='width:10%' class='forumheader2'><a href='".e_SELF."?main.user_ban.".($id == "desc" ? "asc" : "desc").".$from'>".USRLAN_79."</a></td>
-                        <td style='width:30%' class='forumheader2'><a href='".e_SELF."?main.user_name.".($id == "desc" ? "asc" : "desc").".$from'>".USRLAN_78."</a></td>
-                        <td style='width:15%' class='forumheader2'><a href='".e_SELF."?main.user_class.".($id == "desc" ? "asc" : "desc").".$from'>".USRLAN_91."</a></td>
-                        <td style='width:30%' class='forumheader2'>".USRLAN_75."</td>
-                        </tr>";
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $text .= "<tr>
-                                <td style='width:5%; text-align:center' class='forumheader3'>$user_id</td>
-                                <td style='width:10%' class='forumheader3'>";
-
-                                if($user_perms == "0"){
-                                        $text .= "<img src='".e_IMAGE."generic/mainadmin.gif' alt='' style='vertical-align:middle' />";
-                                }else if($user_admin){
-                                        $text .= "<a href='".e_SELF."?main.user_admin.".($id == "desc" ? "asc" : "desc")."'><img src='".e_IMAGE."generic/admin.gif' alt='' style='vertical-align:middle; border:0' /></a>";
-                                }else if($user_ban == 1){
-                                        $text .= "<a href='".e_SELF."?main.user_ban.".($id == "desc" ? "asc" : "desc")."'><img src='".e_IMAGE."generic/banned.gif' alt='' style='vertical-align:middle; border:0' /></a>";
-                                }else if($user_ban == 2){
-                                        $text .= "<img src='".e_IMAGE."generic/not_verified.gif' alt='' style='vertical-align:middle' />";
-                                }else{
-                                        $text .= "&nbsp;";
-                                }
-
-                                $text .= "</td>
-                                <td style='width:30%' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
-                                <td style='width:15%' class='forumheader3'>";
-
-                                if($user_class){
-                                        $tmp = explode(".", $user_class);
-                                        while(list($key, $class_id) = each($tmp)){
-                                                $text .= ($class[$class_id] ? $class[$class_id]."<br />\n" : "");;
-                                        }
-                                }else{
-                                        $text .= "&nbsp;";
-                                }
-
-
-                                $text .= "</td>
-                                <td style='width:30%; text-align:center' class='forumheader3'>
-                                <form method='post' action='".e_SELF."'>
-                                <div>
-                                <input type='hidden' name='userid' value='{$user_id}' />
-                                <input type='hidden' name='userip' value='{$user_ip}' />
-                                <select name='useraction' onchange='this.form.submit()' class='tbox'>
-                                <option selected='selected' value=''></option>";
-
-                                if($user_perms != "0"){
-                                        $text .= "<option value='userinfo'>".USRLAN_80."</option>
-                                        <option value='usersettings'>".USRLAN_81."</option>";
-
-                                        if($user_ban == 1){
-                                                $text .= "<option value='unban'>".USRLAN_33."</option>";
-                                        }else if($user_ban == 2){
-                                                $text .= "<option value='ban'>".USRLAN_30."</option>
-                                                <option value='verify'>".USRLAN_32."</option>
-                                                <option value='resend'>".USRLAN_112."</option>
-                                                <option value='test'>".USRLAN_118."</option>";
-                                        }else{
-                                                $text .= "<option value='ban'>".USRLAN_30."</option>";
-                                        }
-
-                                        if(!$user_admin && !$user_ban && $user_ban != 2){
-                                                $text .= "<option value='admin'>".USRLAN_35."</option>";
-                                        }else if ($user_admin && $user_perms != "0"){
-                                                $text .= "<option value='unadmin'>".USRLAN_34."</option>";
-                                        }
-
-                                }       if($user_perms == "0" && !getperms("0")){
-                                        $text .="";
-                                        } elseif($user_id != USERID || getperms("0") ){
-                                        $text .= "<option value='userclass'>".USRLAN_36."</option>";
-                                        }
-
-                                if($user_perms != "0")
-                                {
-                                                $text .= "<option value='deluser'>".USRLAN_29."</option>";
-//                                        $text .= $rs -> form_button("submit", "main_$user_id", USRLAN_29, "onclick=\"confirm_('main', '$user_id', '$user_name');\"");
-                                }
-                                $text .= "</select></div>";
-                                 $text .="</form></td></tr>";
-                        }
-                        $text .= "</table>";
-                }
-                $text .= "</div>";
-                $users = $sql -> db_Count("user");
-
-                if($users > $amount && !$_POST['searchquery']){
-                        $a = $users/$amount;
-                        $r = explode(".", $a);
-                        if($r[1] != 0 ? $pages = ($r[0]+1) : $pages = $r[0]);
-                        if($pages){
-                                $current = ($from/$amount)+1;
-                                $text .= "<br />".USRLAN_89." ";
-                                for($a=1; $a<=$pages; $a++){
-                                        $text .= ($current == $a ? " <b>[$a]</b>" : " [<a href='".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.user_id.desc.").(($a-1)*$amount)."'>$a</a>] ");
-                                }
-                                $text .= "<br />";
-                        }
-                }
-
-                $text .= "<br /><form method='post' action='".e_SELF."'>\n<p>\n<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />\n<input class='button' type='submit' name='searchsubmit' value='".USRLAN_90."' />\n</p>\n</form>\n</div>";
-
-                $ns -> tablerender(USRLAN_77, $text);
-
-        }
-
-        function show_options($action){
-                // ##### Display options ---------------------------------------------------------------------------------------------------------
-                                if($action==""){$action="main";}
-                                // ##### Display options ---------------------------------------------------------------------------------------------------------
-                                $var['main']['text']=USRLAN_71;
-                                $var['main']['link']=e_SELF;
-
-                                $var['create']['text']=USRLAN_72;
-                                $var['create']['link']=e_SELF."?create";
-
-                                $var['prune']['text']=USRLAN_73;
-                                $var['prune']['link']=e_SELF."?prune";
-
-                                $var['extended']['text']=USRLAN_74;
-                                $var['extended']['link']=e_SELF."?extended";
-
-                                $var['options']['text']=USRLAN_75;
-                                $var['options']['link']=e_SELF."?options";
-
-                                $var['mailing']['text']= USRLAN_121;
-                                $var['mailing']['link']="mailout.php";
-                                show_admin_menu(USRLAN_76,$action,$var);
-                   }
-
-        function show_prefs(){
-                global $ns, $pref;
-                $text = "<div style='text-align:center'>
-                <form method='post' action='".e_SELF."?".e_QUERY."'>
-                <table style='width:85%' class='fborder'>
-
-                <tr>
-                <td style='width:50%' class='forumheader3'>".USRLAN_44.":</td>
-                <td style='width:50%' class='forumheader3'>".
-                ($pref['avatar_upload'] ? "<input name='avatar_upload' type='radio' value='1' checked='checked' />".USRLAN_45."&nbsp;&nbsp;<input name='avatar_upload' type='radio' value='0' />".USRLAN_46 : "<input name='avatar_upload' type='radio' value='1' />".USRLAN_45."&nbsp;&nbsp;<input name='avatar_upload' type='radio' value='0' checked='checked' />".USRLAN_46).
-                (!FILE_UPLOADS ? " <span class='smalltext'>(".USRLAN_58.")</span>" : "")."
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:50%' class='forumheader3'>".USRLAN_53.":</td>
-                <td style='width:50%' class='forumheader3'>".
-                ($pref['photo_upload'] ? "<input name='photo_upload' type='radio' value='1' checked='checked' />".USRLAN_45."&nbsp;&nbsp;<input name='photo_upload' type='radio' value='0' />".USRLAN_46 : "<input name='photo_upload' type='radio' value='1' />".USRLAN_45."&nbsp;&nbsp;<input name='photo_upload' type='radio' value='0' checked='checked' />".USRLAN_46).
-                (!FILE_UPLOADS ? " <span class='smalltext'>(".USRLAN_58.")</span>" : "")."
-                </td>
-                </tr>
-
-                <tr>
-                <td style='width:50%' class='forumheader3'>".USRLAN_47.":</td>
-                <td style='width:50%' class='forumheader3'>
-                <input class='tbox' type='text' name='im_width' size='10' value='".$pref['im_width']."' maxlength='5' /> (".USRLAN_48.")
-                </td></tr>
-
-                <tr>
-                <td style='width:50%' class='forumheader3'>".USRLAN_49.":</td>
-                <td style='width:50%' class='forumheader3'>
-                <input class='tbox' type='text' name='im_height' size='10' value='".$pref['im_height']."' maxlength='5' /> (".USRLAN_50.")
-                </td></tr>
-
-                                <tr>
-                <td style='width:50%' class='forumheader3'>".USRLAN_93."<br /><span class='smalltext'>".USRLAN_94."</span></td>
-                <td style='width:50%' class='forumheader3'>
-                <input class='tbox' type='text' name='del_unv' size='10' value='".$pref['del_unv']."' maxlength='5' /> ".USRLAN_95."
-               </td></tr>
-
-                <tr>
-                <td colspan='2' style='text-align:center' class='forumheader'>
-                <input class='button' type='submit' name='update_options' value='".USRLAN_51."' />
-                </td></tr>
-
-                </table></form></div>";
-                $ns -> tablerender(USRLAN_52, $text);
-        }
-
-        function show_message($message){
-                global $ns;
-                $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-        }
-
-        function show_extended(){
-                global $sql, $ns, $uf_name, $uf_type, $uf_value, $uf_default, $uf_visible, $uf_hide;
-                                require_once(e_HANDLER."userclass_class.php");
-
-                $sql -> db_Select("core", " e107_value", " e107_name='user_entended'");
-                $row = $sql -> db_Fetch();
-                $user_entended = unserialize($row[0]);
-
-                $text = "<div style='text-align:center'>";
-      //    $text = "<div style='text-align:center'><div style='border : solid 1px #000; padding : 4px; width : auto; height : 200px; overflow : auto; '>";
-
-                $text .="
-                <table style='width:97%' class='fborder'><tr>
-                <td class='fcaption'>".USRLAN_96."</td>
-                <td class='fcaption'>".USRLAN_97."</td>
-                <td class='fcaption'>".USRLAN_98."</td>
-                                <td class='fcaption'>".USRLAN_99."</td>
-                                <td class='fcaption'>".USRLAN_100."</td>
-                                <td class='fcaption'>".USRLAN_101."</td>
-                <td class='fcaption'>".USRLAN_102."</td></tr>
-                \n";
-
-                if(!$row[0]){
-                        $text .= "<tr>
-                        <td colspan='4' class='forumheader3' style='text-align:center'>".USRLAN_40."</td>
-                        </tr>";
-                }else{
-                        $c=0;
-
-                        while(list($key, $u_entended) = each($user_entended)){
-                                if($u_entended){
-                                // added by cameron..=============================
-                                $ut = explode("|",$u_entended);
-                                $u_name = ($ut[0] != "" ? str_replace("_"," ",$ut[0]) : $u_entended);
-                                $u_type = $ut[1];
-                                $u_value = $ut[2];
-                                $u_default = $ut[3];
-                                $u_visible = $ut[4];
-                                $u_hide = $ut[5];
-                                                                                $text .= "<tr>
-                                        <td class='forumheader3' >".$u_name."&nbsp; </td>
-                                        <td class='forumheader3' >".$u_type."&nbsp; </td>
-                                        <td class='forumheader3' >".$u_value."&nbsp; </td>
-                                                                                <td class='forumheader3' >".$u_default."&nbsp; </td>
-                                                                                <td class='forumheader3' >".r_userclass_name($u_visible)."&nbsp; </td>
-                                                                                <td class='forumheader3' >".r_userclass_name($u_hide)."&nbsp; </td>
-                                        <td class='forumheader3' style='text-align:center;'>
-                                        <span class='button' style='height:16px; width:50%;'>
-                                        <a style='text-decoration:none' href='".e_SELF."?editext.$key'>".USRLAN_81."</a>
-                                        </span>
-                                        &nbsp;
-                                        <form method='post' action='".e_SELF."?extended' onsubmit='return confirm(\"".USRLAN_16."\")'>
-                                        <div>
-                                        <input type='hidden' name='eu_action' value='delext' />
-                                        <input type='hidden' name='key' value='{$key}' />
-                                        <input type='submit' class='button' name='eudel' value='".USRLAN_29."' />
-                                        </div>
-                                        </form>
-                                        </td>
-                                        </tr>";
-                                        $c++;
-                                }
-//                                        <a style='text-decoration:none' href='".e_SELF."?delext.$key'>".USRLAN_29."</a>
-                        }
-                }
-
-                $text .="
-                </table>
-                <form method='post' action='".e_SELF."?".e_QUERY."'>
-                ";
-                $text .="<div><br /></div><table style='width:97%' class='fborder'>  ";
-                $text .= "<tr>
-                <td style='width:30%' class='forumheader3'>".USRLAN_41.":</td>
-                <td style='width:70%' class='forumheader3' colspan='3'>
-                <input class='tbox' type='text' name='user_field' size='40' value='".$uf_name."' maxlength='50' /></td>
-                </tr>";
-
-               $text .="<tr>
-                <td style='width:30%' class='forumheader3'>".USRLAN_103."</td>
-                <td style='width:70%' class='forumheader3' colspan='3'>
-                <select class='tbox' name='user_type'>";
-
-     $typevalue = array("text","radio","dropdown","table");
-     $typename = array(USRLAN_108,USRLAN_109,USRLAN_110,USRLAN_111);
-
-     for ($i=0; $i<count($typevalue); $i++) {
-     $selected = ($uf_type == $typevalue[$i])? " selected='selected'": "";
-     $text .="<option value='".$typevalue[$i]."' $selected>".$typename[$i]."</option>";
-     };
-
-                $text .="
-                </select></td></tr>";
-
-                $text .= "<tr>
-                <td style='width:30%' class='forumheader3'>".USRLAN_98."</td>
-                <td style='width:70%' class='forumheader3' colspan='3'>
-                <input class='tbox' type='text' name='user_value' size='40' value='$uf_value' /><br />
-                <span class='smalltext'>".USRLAN_105."</span>
-                </td>
-                </tr>
-
-                                <tr>
-                                <td style='width:30%' class='forumheader3'>".USRLAN_104."</td>
-                <td style='width:70%' class='forumheader3' colspan='3'>
-                                <input class='tbox' type='text' name='user_default' size='40' value='$uf_default' />
-                                </td>
-                </tr>
-
-                                <tr>
-                                <td style='width:30%' class='forumheader3'>".USRLAN_100."</td>
-                <td style='width:70%' class='forumheader3' colspan='3'>
-                                ".r_userclass("user_visible", $uf_visible)."<br /><span class='smalltext'>".USRLAN_106."</span>
-                                </td>
-                </tr>
-
-                                <tr>
-                                <td style='width:30%' class='forumheader3'>".USRLAN_101."</td>
-                <td style='width:70%' class='forumheader3' colspan='3'>
-                                ".r_userclass("user_hide", $uf_hide)."<br /><span class='smalltext'>".USRLAN_107."</span>
-                                </td>
-                </tr>";
-
-
-                $text .="<tr>
-                <td colspan='4' style='text-align:center' class='forumheader'>";
-
-                if(!$uf_name){
-                $text .="
-                <input class='button' type='submit' name='add_field' value='".USRLAN_42."' />
-                ";
-                }else{
-                $text .="
-                <input class='button' type='submit' name='update_field' value='".USRLAN_119."' />
-                ";
-                }
-            // ======= end added by Cam.
-                $text .="</td>
-                </tr>
-
-                </table></form></div>";
-                $ns -> tablerender(USRLAN_43, $text);
-        }
-
-        function show_prune(){
-                global $ns, $sql;
-
-                $unactive = $sql -> db_Select("user", "*", "user_ban=2");
-                $text = "<div style='text-align:center'>".USRLAN_84." ".$unactive." ".USRLAN_85."<br /><br />
-                <form method='post' action='".e_SELF."'>
-                <table style='width:85%' class='fborder'>
-                <tr>
-                <td class='forumheader3' style='text-align:center'>
-                <input class='button' type='submit' name='prune' value='".USRLAN_54."' />
-                </td>
-                </tr>
-                </table>
-                </form>
-                </div>";
-                $ns -> tablerender(USRLAN_55, $text);
-        }
-
-        function add_user(){
-                global $rs, $ns;
-                $text = "<div style='text-align:center'>".
-                $rs -> form_open("post", e_SELF, "adduserform")."
-                <table style='width:85%' class='fborder'>
-                <tr>
-                <td style='width:30%' class='forumheader3'>".USRLAN_61."</td>
-                <td style='width:70%' class='forumheader3'>
-                ".$rs -> form_text("name", 40, "", 30)."
-                </td>
-                </tr>
-                <tr>
-                <td style='width:30%' class='forumheader3'>".USRLAN_62."</td>
-                <td style='width:70%' class='forumheader3'>
-                ".$rs -> form_password("password1", 40, "", 20)."
-                </td>
-                </tr>
-                <tr>
-                <td style='width:30%' class='forumheader3'>".USRLAN_63."</td>
-                <td style='width:70%' class='forumheader3'>
-                ".$rs -> form_password("password2", 40, "", 20)."
-                </td>
-                </tr>
-                <tr>
-                <td style='width:30%' class='forumheader3'>".USRLAN_64."</td>
-                <td style='width:70%' class='forumheader3'>
-                ".$rs -> form_text("email", 60, "", 100)."
-                </td>
-                </tr>";
-
-
-                                if(!is_object($sql)) $sql = new db;
-                                if($sql -> db_Select("userclass_classes")){
-                                    $text .= "<tr style='vertical-align:top'>
-                                    <td colspan='2' style='text-align:center' class='forumheader'>
-                                                    ".USRLAN_120."
-                                    </td>
-                                    </tr>";
-                                    $c=0;
-                                    while($row = $sql -> db_Fetch()){
-                                            $class[$c][0] = $row['userclass_id'];
-                                            $class[$c][1] = $row['userclass_name'];
-                                            $class[$c][2] = $row['userclass_description'];
-                                            $c++;
-                                    }
-                                    for($a=0; $a<= (count($class)-1); $a++){
-                                            $text .= "<tr><td style='width:30%' class='forumheader'>
-                                            <input type='checkbox' name='userclass[]' value='".$class[$a][0]."' />".$class[$a][1]."
-                                            </td><td style='width:70%' class='forumheader3'> ".$class[$a][2]."</td></tr>";
-                                    }
-                                }
-                                $text .= "
-                <tr style='vertical-align:top'>
-                <td colspan='2' style='text-align:center' class='forumheader'>
-                <input class='button' type='submit' name='adduser' value='".USRLAN_60."' />
-                <input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
-                </td>
-                </tr>
-                </table>
-                </form>
-                </div>
-                ";
-
-                $ns -> tablerender(USRLAN_59, $text);
-        }
-
-}
-function users_adminmenu(){
-        global $user;
-        global $action;
-        $user -> show_options($action);
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/users.php,v $
+|     $Revision: 1.78 $
+|     $Date: 2006/05/14 06:04:33 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+
+if (!getperms("4")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+
+if (isset($_POST['useraction']) && $_POST['useraction'] == 'userinfo') {
+	header('location:'.e_ADMIN."userinfo.php?".$tp -> toDB($_POST['userip']));
+	exit;
+}
+
+if (isset($_POST['useraction']) && $_POST['useraction'] == 'usersettings') {
+	header('location:'.e_BASE."usersettings.php?".$tp -> toDB($_POST['userid']));
+	exit;
+}
+
+if (isset($_POST['useraction']) && $_POST['useraction'] == 'userclass') {
+	header('location:'.e_ADMIN."userclass.php?".$tp -> toDB($_POST['userid'].".".e_QUERY));
+	exit;
+}
+
+$e_sub_cat = 'users';
+$user = new users;
+require_once("auth.php");
+
+require_once(e_HANDLER."form_handler.php");
+
+$rs = new form;
+
+if (e_QUERY) {
+	$tmp = explode(".", e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	$id = $tmp[2];
+	$from = ($tmp[3] ? $tmp[3] : 0);
+	unset($tmp);
+}
+
+$from = (isset($from)) ? $from : 0;
+$amount = 30;
+
+if(isset($_POST['check_bounces'])){
+	$user->check_bounces();
+}
+
+
+// ------- Resend Email. --------------
+if (isset($_POST['resend_mail'])) {
+
+	$user->resend($_POST['resend_id'],$_POST['resend_key'],$_POST['resend_name'],$_POST['resend_email']);
+
+}
+// ------- Resend Email. --------------
+if(isset($_POST['resend_to_all'])){
+	$user->resend_to_all();
+}
+
+
+
+// ------- Test Email. --------------
+if (isset($_POST['test_mail'])) {
+	require_once(e_HANDLER."mail_validation_class.php");
+	list($adminuser,$adminhost) = split ("@", SITEADMINEMAIL);
+	$validator = new email_validation_class;
+	$validator->localuser= $adminuser;
+	$validator->localhost= $adminhost;
+	$validator->timeout=5;
+	$validator->debug=1;
+	$validator->html_debug=1;
+	$text = "<div style='".ADMIN_WIDTH."'>";
+	ob_start();
+	$email_status = $validator->ValidateEmailBox($_POST['test_email']);
+	$text .= ob_get_contents();
+	ob_end_clean();
+	$text .= "</div>";
+	$caption = $_POST['test_email']." - ";
+	$caption .= ($email_status == 1)? "Valid": "Invalid";
+
+	if($email_status == 1){
+		$text .= "<form method='post' action='".e_SELF.$qry."'>
+			<div style='text-align:left'>
+			<input type='hidden' name='useraction' value='resend' />\n
+			<input type='hidden' name='userid' value='".$_POST['test_id']."' />\n
+			<input class='button' type='submit' name='resend_' value='".USRLAN_112."' />\n</div></form>\n";
+    	$text .= "<div>";
+	}
+
+
+	$ns->tablerender($caption, $text);
+	unset($id, $action, $sub_cation);
+}
+// ------- Update Options. --------------
+if (isset($_POST['update_options'])) {
+	$pref['avatar_upload'] = (FILE_UPLOADS ? $_POST['avatar_upload'] : 0);
+	$pref['im_width'] = $_POST['im_width'];
+	$pref['im_height'] = $_POST['im_height'];
+	$pref['photo_upload'] = (FILE_UPLOADS ? $_POST['photo_upload'] : 0);
+	$pref['del_unv'] = $_POST['del_unv'];
+	$pref['profile_rate'] = $_POST['profile_rate'];
+	$pref['profile_comments'] = $_POST['profile_comments'];
+	$pref['track_online'] = $_POST['track_online'];
+	$pref['force_userupdate'] = $_POST['force_userupdate'];
+	save_prefs();
+	$user->show_message(USRLAN_1);
+}
+// ------- Prune Users. --------------
+if (isset($_POST['prune'])) {
+	$e107cache->clear("online_menu_totals");
+	$text = USRLAN_56." ";
+	$bantype = $_POST['prune_type'];
+	if ($sql->db_Select("user", "user_id, user_name", "user_ban= {$bantype}"))
+	{
+		$uList = $sql->db_getList();
+		foreach($uList as $u)
+		{
+			$text .= $u['user_name']." ";
+			$sql->db_Delete("user", "user_id='{$u['user_id']}' ");
+			$sql->db_Delete("user_extended", "user_extended_id='{$u['user_id']}' ");
+		}
+	}
+	$ns->tablerender(USRLAN_57, "<div style='text-align:center'><b>".$text."</b></div>");
+	unset($text);
+}
+// ------- Quick Add User --------------
+if (isset($_POST['adduser'])) {
+	$e107cache->clear("online_menu_totals");
+	if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
+		exit;
+	}
+
+	require_once(e_HANDLER."message_handler.php");
+	if (strstr($_POST['name'], "#") || strstr($_POST['name'], "=")) {
+		message_handler("P_ALERT", USRLAN_92);
+		$error = TRUE;
+	}
+	$_POST['name'] = trim(str_replace("&nbsp;", "", $_POST['name']));
+	if ($_POST['name'] == "Anonymous") {
+		message_handler("P_ALERT", USRLAN_65);
+		$error = TRUE;
+	}
+	if ($sql->db_Select("user", "*", "user_name='".$_POST['name']."' ")) {
+		message_handler("P_ALERT", USRLAN_66);
+		$error = TRUE;
+	}
+	if ($_POST['password1'] != $_POST['password2']) {
+		message_handler("P_ALERT", USRLAN_67);
+		$error = TRUE;
+	}
+
+	if ($_POST['name'] == "" || $_POST['password1'] == "" || $_POST['password2'] = "") {
+		message_handler("P_ALERT", USRLAN_68);
+		$error = TRUE;
+	}
+	if (!preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $_POST['email'])) {
+		message_handler("P_ALERT", USRLAN_69);
+		$error = TRUE;
+	}
+	if (!$error) {
+		if ($sql->db_Select("user", "*", "user_email='".$_POST['email']."' AND user_ban='1' ")) {
+			exit;
+		}
+		if ($sql->db_Select("banlist", "*", "banlist_ip='".$_POST['email']."'")) {
+			exit;
+		}
+
+		$username = strip_tags($_POST['name']);
+		$loginname = strip_tags($_POST['loginname']);
+		$ip = $e107->getip();
+//		extract($_POST);
+//		for($a = 0; $a <= (count($_POST['userclass'])-1); $a++) {
+//			$svar .= $userclass[$a].".";
+//		}
+		$svar = implode(",", $_POST['userclass']);
+		admin_update($sql -> db_Insert("user", "0, '$username', '$loginname',  '', '".md5($_POST['password1'])."', '$key', '".$_POST['email']."', '".$_POST['signature']."', '".$_POST['image']."', '".$_POST['timezone']."', '1', '".time()."', '".time()."', '".time()."', '0', '0', '0', '0', '".$ip."', '0', '0', '', '', '0', '0', '".$_POST['realname']."', '".$svar."', '', '', '".time()."', ''"), 'insert', USRLAN_70);
+	}
+}
+
+// ------- Ban User. --------------
+if (isset($_POST['useraction']) && $_POST['useraction'] == "ban")
+{
+  //	$sub_action = $_POST['userid'];
+	$sql->db_Select("user", "*", "user_id='".$_POST['userid']."'");
+	$row = $sql->db_Fetch();
+//	 extract($row);
+	if ($row['user_perms'] == "0")
+	{
+		$user->show_message(USRLAN_7);
+	}
+	else
+	{
+		if($sql->db_Update("user", "user_ban='1' WHERE user_id='".$_POST['userid']."' "))
+		{
+			$user->show_message(USRLAN_8);
+		}
+		if(trim($row['user_ip']) == "")
+		{
+			$user->show_message(USRLAN_135);
+		}
+		else
+		{
+			if($sql->db_Count("user", "(*)", "WHERE user_ip = '{$row['user_ip']}'") > 1)
+			{
+				$user->show_message(str_replace("{IP}", $row['user_ip'], USRLAN_136));
+			}
+			else
+			{
+				$sql -> db_Insert("banlist", "'".$row['user_ip']."', '".USERID."', '".$row['user_name']."' ");
+				$user->show_message(str_replace("{IP}", $row['user_ip'], USRLAN_137));
+			}
+		}
+	}
+	$action = "main";
+	if(!$sub_action){$sub_action = "user_id"; }
+}
+// ------- Unban User --------------
+if (isset($_POST['useraction']) && $_POST['useraction'] == "unban") {
+	$sql->db_Select("user", "*", "user_id='".$_POST['userid']."'");
+	$row = $sql->db_Fetch();
+	extract($row);
+	$sql->db_Update("user", "user_ban='0' WHERE user_id='".$_POST['userid']."' ");
+	$sql -> db_Delete("banlist", " banlist_ip='$user_ip' ");
+	$user->show_message(USRLAN_9);
+	$action = "main";
+	if(!$sub_action){$sub_action = "user_id"; }
+}
+
+// ------- Resend Email Confirmation. --------------
+if (isset($_POST['useraction']) && $_POST['useraction'] == 'resend') {
+	$qry = (e_QUERY) ? "?".e_QUERY : "";
+	if ($sql->db_Select("user", "*", "user_id='".$_POST['userid']."' ")) {
+		$resend = $sql->db_Fetch();
+		$text .= "<form method='post' action='".e_SELF.$qry."'><div style='text-align:center'>\n";
+		$text .= USRLAN_116." <b>".$resend['user_name']."</b><br /><br />
+
+			<input type='hidden' name='resend_id' value='".$_POST['userid']."' />\n
+			<input type='hidden' name='resend_name' value='".$resend['user_name']."' />\n
+			<input type='hidden' name='resend_key' value='".$resend['user_sess']."' />\n
+			<input type='hidden' name='resend_email' value='".$resend['user_email']."' />\n
+			<input class='button' type='submit' name='resend_mail' value='".USRLAN_112."' />\n</div></form>\n";
+		$caption = USRLAN_112;
+		$ns->tablerender($caption, $text);
+		require_once("footer.php");
+		exit;
+	}
+}
+// ------- TEst Email confirmation. --------------
+if (isset($_POST['useraction']) && $_POST['useraction'] == 'test') {
+	$qry = (e_QUERY) ? "?".e_QUERY : "";
+	if ($sql->db_Select("user", "*", "user_id='".$_POST['userid']."' ")) {
+		$test = $sql->db_Fetch();
+		$text .= "<form method='post' action='".e_SELF.$qry."'><div style='text-align:center'>\n";
+		$text .= USRLAN_117." <br /><b>".$test['user_email']."</b><br /><br />
+			<input type='hidden' name='test_email' value='".$test['user_email']."' />\n
+			<input type='hidden' name='test_id' value='".$_POST['userid']."' />\n
+			<input class='button' type='submit' name='test_mail' value='".USRLAN_118."' />\n</div></form>\n";
+		$caption = USRLAN_118;
+		$ns->tablerender($caption, $text);
+		require_once("footer.php");
+		exit;
+	}
+}
+// ------- Delete User --------------
+if (isset($_POST['useraction']) && $_POST['useraction'] == 'deluser') {
+	if ($_POST['confirm']) {
+		if ($sql->db_Delete("user", "user_id='".$_POST['userid']."' AND user_perms != '0'")) {
+		   $sql->db_Delete("user_extended", "user_extended_id='".$_POST['userid']."' ");
+			$user->show_message(USRLAN_10);
+		}
+		if(!$sub_action){ $sub_action = "user_id"; }
+		if(!$id){ $id = "DESC"; }
+
+	} else {
+		if ($sql->db_Select("user", "*", "user_id='".$_POST['userid']."' ")) {
+			$row = $sql->db_Fetch();
+			$qry = (e_QUERY) ? "?".e_QUERY : "";
+			$text .= "<form method='post' action='".e_SELF.$qry."'><div style='text-align:center'>\n";
+			$text .= "<div>
+				<input type='hidden' name='useraction' value='deluser' />
+				<input type='hidden' name='userid' value='{$row['user_id']}' /></div>". USRLAN_13."
+				<br /><br /><span class='indent'>#{$row['user_id']} : {$row['user_name']}</span>
+				<br /><br />
+				<input type='submit' class='button' name='confirm' value='".USRLAN_17."' />
+				&nbsp;&nbsp;
+				<input type='button' class='button' name='cancel' value='".LAN_CANCEL."' onclick=\"location.href='".e_SELF.$qry."' \"/>
+				</div>
+				</form>
+				";
+			$ns->tablerender(USRLAN_16, $text);
+			require_once("footer.php");
+			exit;
+		}
+	}
+}
+// ------- Make Admin.. --------------
+if (isset($_POST['useraction']) && $_POST['useraction'] == "admin") {
+	$sql->db_Select("user", "*", "user_id='".$_POST['userid']."'");
+	$row = $sql->db_Fetch();
+	 extract($row);
+	$sql->db_Update("user", "user_admin='1' WHERE user_id='".$_POST['userid']."' ");
+	$user->show_message($user_name." ".USRLAN_3." <a href='".e_ADMIN."administrator.php?edit.$user_id'>".USRLAN_4."</a>");
+	$action = "main";
+	if(!$sub_action){ $sub_action = "user_id"; }
+	if(!$id){ $id = "DESC"; }
+}
+
+// ------- Remove Admin --------------
+if (isset($_POST['useraction']) && $_POST['useraction'] == "unadmin") {
+	$sql->db_Select("user", "*", "user_id='".$_POST['userid']."'");
+	$row = $sql->db_Fetch();
+	 extract($row);
+	if ($user_perms == "0") {
+		$user->show_message(USRLAN_5);
+	} else {
+		$sql->db_Update("user", "user_admin='0', user_perms='' WHERE user_id='".$_POST['userid']."'");
+		$user->show_message($user_name." ".USRLAN_6);
+	$action = "main";
+	if(!$sub_action){ $sub_action = "user_id"; }
+	if(!$id){ $id = "DESC"; }
+	}
+}
+
+// ------- Approve User. --------------
+if (isset($_POST['useraction']) && $_POST['useraction'] == "verify")
+{
+	$uid = intval($_POST['userid']);
+	if ($sql->db_Update("user", "user_ban='0' WHERE user_id='{$uid}' "))
+	{
+		$user->show_message(USRLAN_86);
+		if(!$action){ $action = "main"; }
+		if(!$sub_action){ $sub_action = "user_id"; }
+		if(!$id){ $id = "DESC"; }
+
+		if($pref['user_reg_veri'] == 2)
+		{
+			if($sql->db_Select("user", "user_email, user_name", "user_id = '{$uid}'"))
+			{
+				$row = $sql->db_Fetch();
+				$message = USRLAN_114." ".$row['user_name'].",\n\n".USRLAN_122." ".SITENAME.".\n\n".USRLAN_123."\n\n";
+				$message .= str_replace("{SITEURL}", SITEURL, USRLAN_139);
+
+				require_once(e_HANDLER."mail.php");
+				if(sendemail($row['user_email'], USRLAN_113." ".SITENAME, $message))
+				{
+				//  echo str_replace("\n","<br>",$message);
+				$user->show_message("Email sent to: ".$row['user_name']);
+				}
+				else
+				{
+		    	$user->show_message("Failed to send to: ".$row['user_name']);
+		    }
+			}
+		}
+	}
+}
+
+if (isset($action) && $action == "uset") {
+	$user->show_message(USRLAN_87);
+	$action = "main";
+}
+
+if (isset($action) && $action == "cu") {
+	$user->show_message(USRLAN_88);
+	$action = "main";
+  //	$sub_action = "user_id";
+}
+
+/*
+echo "action= ".$action."<br />";
+echo "subaction= ".$sub_action."<br />";
+echo "id= ".$id."<br />";
+echo "from= ".$from."<br />";
+echo "amount= ".$amount."<br />";
+*/
+
+
+$unverified = $sql -> db_Count("user", "(*)", "WHERE user_ban = 2");
+
+if (!e_QUERY || ($action == "main")) {
+	$user->show_existing_users($action, $sub_action, $id, $from, $amount);
+}
+
+if (isset($action) && $action == "unverified") {
+	$user->show_existing_users($action, $sub_action, $id, $from, $amount);
+}
+
+if (isset($action) && $action == "options") {
+	$user->show_prefs();
+}
+
+if (isset($action) && $action == "prune") {
+	$user->show_prune();
+}
+
+if (isset($action) && $action == "create") {
+	$user->add_user();
+}
+
+require_once("footer.php");
+
+class users{
+
+	function show_existing_users($action, $sub_action, $id, $from, $amount) {
+		// ##### Display scrolling list of existing news items ---------------------------------------------------------------------------------------------------------
+
+		global $sql, $rs, $ns, $tp, $mySQLdefaultdb,$pref;
+		// save the display choices.
+		if(isset($_POST['searchdisp'])){
+			$pref['admin_user_disp'] = implode("|",$_POST['searchdisp']);
+			save_prefs();
+		}
+
+		if(!$pref['admin_user_disp']){
+			$search_display = array("user_name","user_class");
+		}else{
+			$search_display = explode("|",$pref['admin_user_disp']);
+		}
+
+		if ($sql->db_Select("userclass_classes")) {
+			while ($row = $sql->db_Fetch())
+			{
+				$class[$row['userclass_id']] = $tp->toHTML($row['userclass_name'],"","defs");
+			}
+		}
+
+		$text = "<div style='text-align:center'>";
+
+		if (isset($_POST['searchquery']) && $_POST['searchquery'] != "")
+		{
+			$_POST['searchquery'] = trim($_POST['searchquery']);
+      $query = "WHERE ".
+			$query .= (strpos($_POST['searchquery'], "@") !== FALSE) ? "user_email REGEXP('".$_POST['searchquery']."') OR ": "";
+			$query .= (strpos($_POST['searchquery'], ".") !== FALSE) ? "user_ip REGEXP('".$_POST['searchquery']."') OR ": "";
+			foreach($search_display as $disp)
+			{
+				$query .= "$disp REGEXP('".$_POST['searchquery']."') OR ";
+			}
+			$query .= "user_login REGEXP('".$_POST['searchquery']."') OR ";
+			$query .= "user_name REGEXP('".$_POST['searchquery']."') ";
+			if($action == 'unverified')
+			{
+				$query .= " AND user_ban = 2 ";
+			}
+			$query .= " ORDER BY user_id";
+		} else {
+			$query = "";
+			if($action == 'unverified')
+			{
+				$query = "WHERE user_ban = 2 ";
+			}
+			$query .= "ORDER BY ".($sub_action ? $sub_action : "user_id")." ".($id ? $id : "DESC")."  LIMIT $from, $amount";
+		}
+
+// $user_total = db_Count($table, $fields = '(*)',
+	$qry_insert = "SELECT u.*, ue.* FROM #user AS u	LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id ";
+
+		if ($user_total = $sql->db_Select_gen($qry_insert. $query)) {
+			$text .= "<table class='fborder' style='".ADMIN_WIDTH."'>
+				<tr>
+				<td style='width:5%' class='fcaption'><a href='".e_SELF."?main.user_id.".($id == "desc" ? "asc" : "desc").".$from'>ID</a></td>
+				<td style='width:10%' class='fcaption'><a href='".e_SELF."?main.user_ban.".($id == "desc" ? "asc" : "desc").".$from'>".USRLAN_79."</a></td>";
+
+
+// Search Display Column header.
+	$display_lan = array('user_id' => DUSRLAN_1,
+	'user_id' => DUSRLAN_1,
+	'user_name' => DUSRLAN_2,
+	'user_loginname' => DUSRLAN_3,
+	'user_customtitle' => DUSRLAN_4,
+	'user_password' => DUSRLAN_5,
+	'user_sess' => DUSRLAN_6,
+	'user_email' => DUSRLAN_7,
+	'user_homepage' => DUSRLAN_8,
+	'user_icq' => DUSRLAN_9,
+	'user_aim' => DUSRLAN_10,
+	'user_msn' => DUSRLAN_11,
+	'user_location' => DUSRLAN_12,
+	'user_birthday' => DUSRLAN_13,
+	'user_signature' => DUSRLAN_14,
+	'user_image' => DUSRLAN_15,
+	'user_timezone' => DUSRLAN_16,
+	'user_hideemail' => DUSRLAN_17,
+	'user_join' => DUSRLAN_18,
+	'user_lastvisit' => DUSRLAN_19,
+	'user_currentvisit' => DUSRLAN_20,
+	'user_lastpost' => DUSRLAN_21,
+	'user_chats' => DUSRLAN_22,
+	'user_comments' => DUSRLAN_23,
+	'user_forums' => DUSRLAN_24,
+	'user_ip' => DUSRLAN_25,
+	'user_ban' => DUSRLAN_26,
+	'user_prefs' => DUSRLAN_27,
+	'user_new' => DUSRLAN_28,
+	'user_viewed' => DUSRLAN_29,
+	'user_visits' => DUSRLAN_30,
+	'user_admin' => DUSRLAN_31,
+	'user_login' => DUSRLAN_32,
+	'user_class' => DUSRLAN_33,
+	'user_perms' => DUSRLAN_34,
+	'user_realm' => DUSRLAN_35,
+	'user_pwchange' => DUSRLAN_36,
+	'user_xup' => DUSRLAN_37
+	);
+
+			foreach($search_display as $disp){
+				if (isset($display_lan[$disp])) {
+					$text .= "<td style='width:15%' class='fcaption'><a href='".e_SELF."?main.$disp.".($id == "desc" ? "asc" : "desc").".$from'>".$display_lan[$disp]."</a></td>";
+				} else {
+					$text .= "<td style='width:15%' class='fcaption'><a href='".e_SELF."?main.$disp.".($id == "desc" ? "asc" : "desc").".$from'>".ucwords(str_replace("_"," ",$disp))."</a></td>";
+				}
+			}
+
+// ------------------------------
+
+			$text .= " 	<td style='width:30%' class='fcaption'>".LAN_OPTIONS."</td>
+				</tr>";
+
+			while ($row = $sql->db_Fetch()) {
+				extract($row);
+				$text .= "<tr>
+					<td style='width:5%; text-align:center' class='forumheader3'>$user_id</td>
+					<td style='width:10%' class='forumheader3'>";
+
+				if ($user_perms == "0") {
+					$text .= "<div class='fcaption' style='padding-left:3px;padding-right:3px;text-align:center;white-space:nowrap'>".LAN_MAINADMIN."</div>";
+				}
+				else if($user_admin) {
+					$text .= "<div class='fcaption' style='padding-left:3px;padding-right:3px;;text-align:center'><a href='".e_SELF."?main.user_admin.".($id == "desc" ? "asc" : "desc")."'>".LAN_ADMIN."</a></div>";
+				}
+				else if($user_ban == 1) {
+					$text .= "<div class='fcaption' style='padding-left:3px;padding-right:3px;text-align:center;white-space:nowrap'><a href='".e_SELF."?main.user_ban.".($id == "desc" ? "asc" : "desc")."'>".LAN_BANNED."</a></div>";
+				}
+				else if($user_ban == 2) {
+					$text .= "<div class='fcaption' style='padding-left:3px;padding-right:3px;text-align:center;white-space:nowrap' >".LAN_NOTVERIFIED."</div>";
+				}
+				else if($user_ban == 3) {
+					$text .= "<div class='fcaption' style='padding-left:3px;padding-right:3px;text-align:center;white-space:nowrap' >".LAN_BOUNCED."</div>";
+				}  else {
+					$text .= "&nbsp;";
+				}
+
+				$text .= "</td>";
+
+
+
+ // Display Chosen options -------------------------------------
+
+	$datefields = array("user_lastpost","user_lastvisit","user_join","user_currentvisit");
+	$boleanfields = array("user_admin","user_hideemail","user_ban");
+
+	foreach($search_display as $disp)
+	{
+		$text .= "<td style='white-space:nowrap' class='forumheader3'>";
+		if($disp == "user_class")
+		{
+			if ($user_class)
+			{
+				$tmp = explode(",", $user_class);
+				while (list($key, $class_id) = each($tmp))
+				{
+					$text .= ($class[$class_id] ? $class[$class_id]."<br />\n" : "");
+				}
+			}
+			else
+			{
+				$text .= "&nbsp;";
+			}
+		}elseif(in_array($disp,$boleanfields))
+		{
+        	$text .= ($row[$disp]) ? ADMIN_TRUE_ICON : "";
+		}
+		elseif(in_array($disp,$datefields))
+		{
+			$text .= ($row[$disp]) ? strftime($pref['shortdate'],$row[$disp])."&nbsp;" : "&nbsp";
+		}
+		elseif($disp == "user_name")
+		{
+			$text .= "<a href='".e_BASE."user.php?id.{$row['user_id']}'>{$row['user_name']}</a>";
+		}
+		else
+		{
+			$text .= $row[$disp]."&nbsp;";
+		}
+		if(!in_array($disp,$boleanfields) && isset($prev[$disp]) && $row[$disp] == $prev[$disp] && $prev[$disp] != "")
+		{ // show matches
+			$text .= " <b>*</b>";
+		}
+
+		$text .= "</td>";
+		$prev[$disp] = $row[$disp];
+	}
+// -------------------------------------------------------------
+				$qry = (e_QUERY) ?  "?".e_QUERY : "";
+				$text .= "
+					<td style='width:30%;text-align:center' class='forumheader3'>
+					<form method='post' action='".e_SELF.$qry."'>
+					<div>
+
+					<input type='hidden' name='userid' value='{$user_id}' />
+					<input type='hidden' name='userip' value='{$user_ip}' />
+					<select name='useraction' onchange='this.form.submit()' class='tbox' style='width:75%'>
+					<option selected='selected' value=''>&nbsp;</option>";
+
+				if ($user_perms != "0") {
+					$text .= "<option value='userinfo'>".USRLAN_80."</option>
+						<option value='usersettings'>".LAN_EDIT."</option>";
+
+					if ($user_ban == 1) {
+						$text .= "<option value='unban'>".USRLAN_33."</option>\n";
+					}
+					else if($user_ban == 2) {
+						$text .= "<option value='ban'>".USRLAN_30."</option>
+							<option value='verify'>".USRLAN_32."</option>
+							<option value='resend'>".USRLAN_112."</option>
+							<option value='test'>".USRLAN_118."</option>";
+					} else {
+						$text .= "<option value='ban'>".USRLAN_30."</option>\n";
+					}
+
+					if (!$user_admin && !$user_ban && $user_ban != 2) {
+						$text .= "<option value='admin'>".USRLAN_35."</option>\n";
+					}
+					else if ($user_admin && $user_perms != "0") {
+						$text .= "<option value='unadmin'>".USRLAN_34."</option>\n";
+					}
+
+				}
+				if ($user_perms == "0" && !getperms("0")) {
+					$text .= "";
+				} elseif($user_id != USERID || getperms("0") ) {
+					$text .= "<option value='userclass'>".USRLAN_36."</option>\n";
+				}
+
+				if ($user_perms != "0") {
+					$text .= "<option value='deluser'>".LAN_DELETE."</option>\n";
+				}
+				$text .= "</select></div>";
+				$text .= "</form></td></tr>";
+			}
+			$text .= "</table>";
+		}
+
+		if($action == "unverified"){
+        	$text .= "
+				<div style='text-align:center'>
+				<br />
+				<form method='post' action='".e_SELF.$qry."'>";
+			if($pref['mail_bounce_pop3']!=''){
+				$text .= "<input type='submit' class='button' name='check_bounces' value=\"".USRLAN_143."\" />\n";
+			}
+			$text .= "&nbsp;<input type='submit' class='button' name='resend_to_all' value=\"".USRLAN_144."\" />
+				</form>
+				</div>";
+
+		}
+
+		$users = $sql->db_Count("user");
+
+		if ($users > $amount && !$_POST['searchquery']) {
+			$parms = "{$users},{$amount},{$from},".e_SELF."?".(e_QUERY ? "$action.$sub_action.$id." : "main.user_id.desc.")."[FROM]";
+			$text .= "<br />".$tp->parseTemplate("{NEXTPREV={$parms}}");
+		}
+
+// Search - display options etc. .
+
+		$text .= "<br /><form method='post' action='".e_SELF."?".e_QUERY."'>\n";
+		$text .= "<p>\n<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />\n
+		<input class='button' type='submit' name='searchsubmit' value='".USRLAN_90."' />\n
+		<br /><br /></p>\n";
+
+		$text .= "<div style='cursor:pointer' onclick=\"expandit('sdisp')\">".LAN_DISPLAYOPT."</div>";
+		$text .= "<div  id='sdisp' style='padding-top:4px;display:none;text-align:center;margin-left:auto;margin-right:auto'>
+		<table class='forumheader3' style='width:95%'><tr>";
+		$fields = mysql_list_fields($mySQLdefaultdb, MPREFIX."user");
+		$columns = mysql_num_fields($fields);
+		for ($i = 0; $i < $columns; $i++) {
+			$fname[] = mysql_field_name($fields, $i);
+		}
+
+		// include extended fields in the list.
+        $sql -> db_Select("user_extended_struct");
+            while($row = $sql-> db_Fetch()){
+            $fname[] = "user_".$row['user_extended_struct_name'];
+		}
+        $m = 0;
+		foreach($fname as $fcol){
+        $checked = (in_array($fcol,$search_display)) ? "checked='checked'" : "";
+			$text .= "<td style='text-align:left; padding:0px'>";
+			$text .= "<input type='checkbox' name='searchdisp[]' value='".$fcol."' $checked />".str_replace("user_","",$fcol) . "</td>\n";
+			$m++;
+			if($m == 5){
+				$text .= "</tr><tr>";
+				$m = 0;
+			 }
+        }
+
+		$text .= "</table></div>
+		</form>\n
+		</div>";
+
+
+
+// ======================
+		$caption = USRLAN_77 ."&nbsp;&nbsp;   (total: $users)";
+		$ns->tablerender($caption, $text);
+
+	}
+
+	function show_options($action) {
+
+		global $unverified;
+		// ##### Display options ---------------------------------------------------------------------------------------------------------
+		if ($action == "") {
+			$action = "main";
+		}
+		// ##### Display options ---------------------------------------------------------------------------------------------------------
+		$var['main']['text'] = USRLAN_71;
+		$var['main']['link'] = e_SELF;
+
+		$var['create']['text'] = USRLAN_72;
+		$var['create']['link'] = e_SELF."?create";
+
+		$var['prune']['text'] = USRLAN_73;
+		$var['prune']['link'] = e_SELF."?prune";
+
+		$var['options']['text'] = LAN_OPTIONS;
+		$var['options']['link'] = e_SELF."?options";
+
+		if($unverified)
+		{
+			$var['unveri']['text'] = USRLAN_138." ($unverified)";
+			$var['unveri']['link'] = e_SELF."?unverified";
+		}
+
+		//  $var['mailing']['text']= USRLAN_121;
+		//   $var['mailing']['link']="mailout.php";
+		show_admin_menu(USRLAN_76, $action, $var);
+	}
+
+	function show_prefs() {
+		global $ns, $pref;
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+
+			<tr>
+			<td style='width:50%' class='forumheader3'>".USRLAN_44.":</td>
+			<td style='width:50%' class='forumheader3'>". ($pref['avatar_upload'] ? "<input name='avatar_upload' type='radio' value='1' checked='checked' />".LAN_YES."&nbsp;&nbsp;<input name='avatar_upload' type='radio' value='0' />".LAN_NO : "<input name='avatar_upload' type='radio' value='1' />".LAN_YES."&nbsp;&nbsp;<input name='avatar_upload' type='radio' value='0' checked='checked' />".LAN_NO). (!FILE_UPLOADS ? " <span class='smalltext'>(".USRLAN_58.")</span>" : "")."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:50%' class='forumheader3'>".USRLAN_53.":</td>
+			<td style='width:50%' class='forumheader3'>". ($pref['photo_upload'] ? "<input name='photo_upload' type='radio' value='1' checked='checked' />".LAN_YES."&nbsp;&nbsp;<input name='photo_upload' type='radio' value='0' />".LAN_NO : "<input name='photo_upload' type='radio' value='1' />".LAN_YES."&nbsp;&nbsp;<input name='photo_upload' type='radio' value='0' checked='checked' />".LAN_NO). (!FILE_UPLOADS ? " <span class='smalltext'>(".USRLAN_58.")</span>" : "")."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:50%' class='forumheader3'>".USRLAN_47.":</td>
+			<td style='width:50%' class='forumheader3'>
+			<input class='tbox' type='text' name='im_width' size='10' value='".$pref['im_width']."' maxlength='5' /> (".USRLAN_48.")
+			</td></tr>
+
+			<tr>
+			<td style='width:50%' class='forumheader3'>".USRLAN_49.":</td>
+			<td style='width:50%' class='forumheader3'>
+			<input class='tbox' type='text' name='im_height' size='10' value='".$pref['im_height']."' maxlength='5' /> (".USRLAN_50.")
+			</td></tr>
+
+			<tr>
+			<td style='width:50%' class='forumheader3'>".USRLAN_126.":</td>
+			<td style='width:50%;vertical-align:top' class='forumheader3'>". ($pref['profile_rate'] ? "<input name='profile_rate' type='radio' value='1' checked='checked' />".LAN_YES."&nbsp;&nbsp;<input name='profile_rate' type='radio' value='0' />".LAN_NO : "<input name='profile_rate' type='radio' value='1' />".LAN_YES."&nbsp;&nbsp;<input name='profile_rate' type='radio' value='0' checked='checked' />".LAN_NO)."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:50%' class='forumheader3'>".USRLAN_127.":</td>
+			<td style='width:50%;vertical-align:top' class='forumheader3'>". ($pref['profile_comments'] ? "<input name='profile_comments' type='radio' value='1' checked='checked' />".LAN_YES."&nbsp;&nbsp;<input name='profile_comments' type='radio' value='0' />".LAN_NO : "<input name='profile_comments' type='radio' value='1' />".LAN_YES."&nbsp;&nbsp;<input name='profile_comments' type='radio' value='0' checked='checked' />".LAN_NO)."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:50%;vertical-align:top' class='forumheader3'>".USRLAN_133.":<br /><span class='smalltext'>".USRLAN_134."</span></td>
+			<td style='width:50%;vertical-align:top' class='forumheader3'>". ($pref['force_userupdate'] ? "<input name='force_userupdate' type='radio' value='1' checked='checked' />".LAN_YES."&nbsp;&nbsp;<input name='force_userupdate' type='radio' value='0' />".LAN_NO : "<input name='force_userupdate' type='radio' value='1' />".LAN_YES."&nbsp;&nbsp;<input name='force_userupdate' type='radio' value='0' checked='checked' />".LAN_NO)."
+			</td>
+			</tr>
+
+
+			<tr>
+			<td style='width:50%;vertical-align:top' class='forumheader3'>".USRLAN_93."<br /><span class='smalltext'>".USRLAN_94."</span></td>
+			<td style='width:50%' class='forumheader3'>
+			<input class='tbox' type='text' name='del_unv' size='10' value='".$pref['del_unv']."' maxlength='5' /> ".USRLAN_95."
+			</td></tr>
+
+			<tr>
+			<td style='width:50%' class='forumheader3'>".USRLAN_130."<br /><span class='smalltext'>".USRLAN_131."</span></td>
+			<td style='width:50%' class='forumheader3'>&nbsp;
+			<input type='checkbox' name='track_online' value='1'".($pref['track_online'] ? " checked='checked'" : "")." /> ".USRLAN_132."&nbsp;&nbsp;
+			</td>
+			</tr>
+
+			<tr>
+			<td colspan='2' style='text-align:center' class='forumheader'>
+			<input class='button' type='submit' name='update_options' value='".USRLAN_51."' />
+			</td></tr>
+
+			</table></form></div>";
+		$ns->tablerender(USRLAN_52, $text);
+	}
+
+	function show_message($message) {
+		global $ns;
+		$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+	}
+
+	function show_prune() {
+		global $ns, $sql;
+
+		$unactive = $sql->db_Select("user", "*", "user_ban=2");
+		$bounced = $sql->db_Select("user", "*", "user_ban=3");
+		$text = "<div style='text-align:center'><br /><br />
+			<form method='post' action='".e_SELF."'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td class='forumheader3' style='text-align:center'><br />".LAN_DELETE.":&nbsp;
+			<select class='tbox' name='prune_type'>";
+            $prune_type = array(2=>USRLAN_138." [".$unactive."]",3=>USRLAN_145." [".$bounced."]");
+			foreach($prune_type as $key=>$val){
+            	$text .= "<option value='$key'>{$val}</option>\n";
+			}
+
+		$text .= "</select><br /><br /></td>
+			</tr>
+			<tr>
+			<td class='forumheader' style='text-align:center'>
+			<input class='button' type='submit' name='prune' value=\"".USRLAN_55."\" />
+			</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+		$ns->tablerender(USRLAN_55, $text);
+	}
+
+	function add_user() {
+		global $rs, $ns;
+		$text = "<div style='text-align:center'>". $rs->form_open("post", e_SELF, "adduserform")."
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='width:30%' class='forumheader3'>".USRLAN_61."</td>
+			<td style='width:70%' class='forumheader3'>
+			".$rs->form_text("name", 40, "", 30)."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".USRLAN_128."</td>
+			<td style='width:70%' class='forumheader3'>
+			".$rs->form_text("loginname", 40, "", 30)."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:30%' class='forumheader3'>".USRLAN_62."</td>
+			<td style='width:70%' class='forumheader3'>
+			".$rs->form_password("password1", 40, "", 20)."
+			</td>
+			</tr>
+			<tr>
+			<td style='width:30%' class='forumheader3'>".USRLAN_63."</td>
+			<td style='width:70%' class='forumheader3'>
+			".$rs->form_password("password2", 40, "", 20)."
+			</td>
+			</tr>
+			<tr>
+			<td style='width:30%' class='forumheader3'>".USRLAN_64."</td>
+			<td style='width:70%' class='forumheader3'>
+			".$rs->form_text("email", 60, "", 100)."
+			</td>
+			</tr>";
+
+
+		if (!is_object($sql)) $sql = new db;
+		if ($sql->db_Select("userclass_classes")) {
+			$text .= "<tr style='vertical-align:top'>
+				<td colspan='2' style='text-align:center' class='forumheader'>
+				".USRLAN_120."
+				</td>
+				</tr>";
+			$c = 0;
+			while ($row = $sql->db_Fetch()) {
+				$class[$c][0] = $row['userclass_id'];
+				$class[$c][1] = $row['userclass_name'];
+				$class[$c][2] = $row['userclass_description'];
+				$c++;
+			}
+			for($a = 0; $a <= (count($class)-1); $a++) {
+				$text .= "<tr><td style='width:30%' class='forumheader'>
+					<input type='checkbox' name='userclass[]' value='".$class[$a][0]."' />".$class[$a][1]."
+					</td><td style='width:70%' class='forumheader3'> ".$class[$a][2]."</td></tr>";
+			}
+		}
+		$text .= "
+			<tr style='vertical-align:top'>
+			<td colspan='2' style='text-align:center' class='forumheader'>
+			<input class='button' type='submit' name='adduser' value='".USRLAN_60."' />
+			<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
+			</td>
+			</tr>
+			</table>
+			</form>
+			</div>
+			";
+
+		$ns->tablerender(USRLAN_59, $text);
+	}
+
+
+	function resend($id,$key,$name,$email,$lfile=''){
+        global $sql,$mailheader_e107id;
+
+
+    	// Check for a Language field, and if present, send the email in the user's language.
+        if($lfile == ""){
+			if($sql -> db_Select("user_extended", "user_language", "user_extended_id = '$id'")){
+    			$row = $sql -> db_Fetch();
+				$lfile = e_LANGUAGEDIR.$row['user_language']."/lan_signup.php";
+    		}
+        }
+   		if(is_readable($lfile)){
+			require_once($lfile);
+		}else{
+			$row['user_language'] = e_LANGUAGE;
+    		require_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_signup.php");
+		}
+
+
+		define("RETURNADDRESS", (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$id.".".$key : SITEURL."/signup.php?activate.".$id.".".$key));
+
+		$message = LAN_EMAIL_01." ".$name."\n\n".LAN_SIGNUP_24." ".SITENAME.".\n".LAN_SIGNUP_21."...\n\n";
+		$message .= RETURNADDRESS . "\n\n".SITENAME."\n".SITEURL;
+
+        $mailheader_e107id = $id;
+
+		require_once(e_HANDLER."mail.php");
+	  	if(sendemail($email, LAN_404." ".SITENAME, $message)){
+	   //		echo str_replace("\n","<br>",$message);
+			$this->show_message(USRLAN_140.": <a href='mailto:".$email."?body=".RETURNADDRESS."' title=\"".DUSRLAN_7."\" >".$name."</a> (".$row['user_language'].") ");
+	  	}else{
+    		$this->show_message(USRLAN_141.": ".$name);
+	  	}
+
+	}
+
+
+	function resend_to_all(){
+        global $sql,$pref,$sql3;
+		$pause_count = 1;
+		$pause_amount = ($pref['mail_pause']) ? $pref['mail_pause'] : 10;
+		$pause_time = ($pref['mail_pausetime']) ? $pref['mail_pausetime'] : 1;
+
+		if($sql -> db_Select_gen("SELECT user_language FROM #user_extended LIMIT 1")){
+			$query = "SELECT u.*, ue.* FROM #user AS u LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id WHERE u.user_ban = 2 ORDER BY u.user_id DESC";
+		}else{
+        	$query = "SELECT * FROM #user WHERE user_ban='2'";
+		}
+
+		if(!is_object($sql3)){
+        	$sql3 = new db;
+		}
+
+        $sql3 -> db_Select_gen($query,TRUE);
+			while($row = $sql3-> db_Fetch()){
+				  	echo $row['user_id']." ".$row['user_sess']." ".$row['user_name']." ".$row['user_email']."<br />";
+                    $this->resend($row['user_id'],$row['user_sess'],$row['user_name'],$row['user_email'],$row['user_language']);
+                	if($pause_count > $pause_amount){
+						sleep($pause_time);
+            			$pause_count = 1;
+        			}
+				sleep(1);
+				$pause_count++;
+			}
+	}
+
+// ---------------------------------------------------------------------
+
+	function check_bounces(){
+		global $sql,$pref;
+        include(e_HANDLER."pop3_class.php");
+
+		$obj= new receiveMail($pref['mail_bounce_user'],$pref['mail_bounce_pass'],$pref['mail_bounce_email'],$pref['mail_bounce_pop3'],'pop3','110');
+		$obj->connect();
+		$tot=$obj->getTotalMails();
+        $found = FALSE;
+		$DEL = ($pref['mail_bounce_delete']) ? TRUE : FALSE;
+
+		for($i=1;$i<=$tot;$i++)	{
+			 $head=$obj->getHeaders($i);
+            if($head['bounce']){
+		   		if (ereg('.*X-e107-id:(.*)MIME', $obj->getBody($i), $result)){
+					if($result[1]){
+						$id[] = intval($result[1]);
+						$found = TRUE;
+					}
+
+        		}elseif(preg_match("/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i", $obj->getBody($i), $result)){
+                	if($result[0] && $result[0] != $pref['mail_bounce_email']){
+						$emails[] = "'".$result[0]."'";
+						$found = TRUE;
+					}elseif($result[1] && $result[1] != $pref['mail_bounce_email']){
+                    	$emails[] = "'".$result[1]."'";
+						$found = TRUE;
+					}
+
+				}
+					if($DEL && $found){ $obj->deleteMails($i); }
+			}
+
+		}
+        $all_ids = implode(",",$id);
+		$all_emails = implode(",",$emails);
+		$obj->close_mailbox();
+        $found = count($id) + count($emails);
+	  	if($ed = $sql -> db_Update("user", "user_ban=3 WHERE (user_id IN (".$all_ids.") OR user_email IN (".$all_emails.")) AND user_sess !='' ")){
+        	$this->show_message(LAN_UPDATED."<br >Found $tot, updated $ed / $found");
+	  	}else{
+        	$this->show_message(LAN_UPDATED_FAILED."<br >Found $tot, not updated $ed / $found");
+	  	}
+
+	}
+
+}
+function users_adminmenu() {
+	global $user;
+	global $action;
+	$user->show_options($action);
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/ver.php 75/e107_admin/ver.php
--- 6171/e107_admin/ver.php	2005-05-12 23:04:50.000000000 -0500
+++ 75/e107_admin/ver.php	2006-05-22 20:12:40.000000000 -0500
@@ -1,6 +1,24 @@
-<?php
-
-$e107info['e107_version'] = "v0.6171";
-$e107info['e107_build'] = "20050513";
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/ver.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2006/05/23 01:12:40 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+$e107info['e107_version'] = "0.7.5";
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_admin/wmessage.php 75/e107_admin/wmessage.php
--- 6171/e107_admin/wmessage.php	2004-05-23 10:09:34.000000000 -0500
+++ 75/e107_admin/wmessage.php	2006-04-29 00:20:57.000000000 -0500
@@ -1,147 +1,227 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/wmessage.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("M")){ header("location:".e_BASE."index.php"); exit;}
-require_once("auth.php");
-require_once(e_HANDLER."ren_help.php");
-$aj = new textparse;
-if(IsSet($_POST['wmsubmit'])){
-
-	$guestmessage = $aj -> formtpa($_POST['guestmessage'], "admin");
-	$membermessage = $aj -> formtpa($_POST['membermessage'], "admin");
-	$adminmessage = $aj -> formtpa($_POST['adminmessage'], "admin");
-	$sql -> db_Update("wmessage", "wm_text ='$guestmessage', wm_active='".$_POST['wm_active1']."' WHERE wm_id='1' ");
-	$sql -> db_Update("wmessage", "wm_text ='$membermessage', wm_active='".$_POST['wm_active2']."' WHERE wm_id='2' ");
-	$sql -> db_Update("wmessage", "wm_text ='$adminmessage', wm_active='".$_POST['wm_active3']."' WHERE wm_id='3' ");
-}
-
-if(IsSet($message)){
-	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$sql -> db_Select("wmessage");
-list($id, $guestmessage, $wm_active1) = $sql-> db_Fetch();
-list($id, $membermessage, $wm_active2) = $sql-> db_Fetch();	
-list($id, $adminmessage, $wm_active3) = $sql-> db_Fetch();
-
-
-$guestmessage = $aj -> formtparev($aj -> editparse($guestmessage));
-$membermessage = $aj -> formtparev($aj -> editparse($membermessage));
-$adminmessage = $aj -> formtparev($aj -> editparse($adminmessage));
-
-$text = "
-<div style='text-align:center'>
-<form method='post' action='".e_SELF."'  id='wmform'>
-<table style='width:85%' class='fborder'>
-<tr>";
-
-$text .= "
-
-<td style='width:20%' class='forumheader3'>".WMGLAN_1.": <br />
-".WMGLAN_6.":";
-if($wm_active1){
-	$text .= "<input type='checkbox' name='wm_active1' value='1'  checked='checked' />";
-}else{
-	$text .= "<input type='checkbox' name='wm_active1' value='1' />";
-}
-$text .= "</td>
-<td style='width:60%' class='forumheader3'>
-<textarea class='tbox' name='guestmessage' cols='70' rows='10'>$guestmessage</textarea>
-<br />
-<input class='helpbox' type='text' name='helpguest' size='100' />
-<br />
-".ren_help(1,"addtext1","help1")."
-</td>
-
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".WMGLAN_2.": <br />
-".WMGLAN_6.":";
-if($wm_active2){
-	$text .= "<input type='checkbox' name='wm_active2' value='1'  checked='checked' />";
-}else{
-	$text .= "<input type='checkbox' name='wm_active2' value='1' />";
-}
-$text .= "</td>
-<td style='width:60%' class='forumheader3'>
-<textarea class='tbox' name='membermessage' cols='70' rows='10'>$membermessage</textarea>
-<br />
-<input class='helpbox' type='text' name='helpmember' size='100' />
-<br />
-".ren_help(1,"addtext2","help2")."
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".WMGLAN_3.": <br />
-".WMGLAN_6.": ";
-
-if($wm_active3){
-	$text .= "<input type='checkbox' name='wm_active3' value='1'  checked='checked' />";
-}else{
-	$text .= "<input type='checkbox' name='wm_active3' value='1' />";
-}
-
-$text .= "</td>
-<td style='width:60%' class='forumheader3'>
-<textarea class='tbox' name='adminmessage' cols='70' rows='10'>$adminmessage</textarea>
-<br />
-<input class='helpbox' type='text' name='helpadmin' size='100' />
-<br />
-".ren_help(1,"addtext3","help3")."
-</td>
-</tr>
-
-<tr style='vertical-align:top'> 
-<td class='forumheader3'>&nbsp;</td>
-<td style='width:60%' class='forumheader3'>
-<input class='button' type='submit' name='wmsubmit' value='".WMGLAN_4."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender(WMGLAN_5, $text);
-
-?>
-<script type="text/javascript">
-function addtext1(sc){
-	document.getElementById('wmform').guestmessage.value += sc;
-}
-function addtext2(sc){
-	document.getElementById('wmform').membermessage.value += sc;
-}
-function addtext3(sc){
-	document.getElementById('wmform').adminmessage.value += sc;
-}
-function fclear(){
-	document.newspostform.message.value = "";
-}
-function help1(help){
-	document.getElementById('wmform').helpguest.value = help;
-}
-function help2(help){
-	document.getElementById('wmform').helpmember.value = help;
-}
-function help3(help){
-	document.getElementById('wmform').helpadmin.value = help;
-}
-</script>
-<?php
-
-require_once("footer.php");
-?>	
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_admin/wmessage.php,v $
+|     $Revision: 1.24 $
+|     $Date: 2006/04/29 05:20:57 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../class2.php");
+if (!getperms("M")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+$e_sub_cat = 'wmessage';
+$e_wysiwyg = "wm_text";
+
+require_once(e_HANDLER."preset_class.php");
+$pst = new e_preset;
+$pst->form = "wmform";
+$pst->page = "wmessage.php?create";
+$pst->id = "admin_wmessage";
+require_once("auth.php");
+$pst->save_preset();  // save and render result
+
+require_once(e_HANDLER.'form_handler.php');
+require_once(e_HANDLER.'userclass_class.php');
+require_once(e_HANDLER."ren_help.php");
+
+$rs = new form;
+
+if (e_QUERY) {
+	$tmp = explode('.', e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	$id = $tmp[2];
+	unset($tmp);
+}
+
+if (isset($_POST['wm_update'])) {
+	$wm_text = $tp->toDB($_POST['wm_text']);
+	$wm_title = $tp->toDB($_POST['wm_caption']);
+	$message = ($sql->db_Update("generic", "gen_chardata ='$wm_text',gen_ip ='$wm_title', gen_intdata='".$_POST['wm_active']."' WHERE gen_id='".$_POST['wm_id']."' ")) ? LAN_UPDATED : LAN_UPDATED_FAILED;
+}
+
+if (isset($_POST['wm_insert'])) {
+	$wmtext = $tp->toDB($_POST['wm_text']);
+	$wmtitle = $tp->toDB($_POST['wm_caption']);
+	$message = ($sql->db_Insert("generic", "0, 'wmessage', '".time()."', ".USERID.", '{$wmtitle}', '{$_POST['wm_active']}', '{$wmtext}' ")) ? LAN_CREATED :  LAN_CREATED_FAILED ;
+}
+
+if (isset($_POST['updateoptions'])) {
+	$pref['wm_enclose'] = $_POST['wm_enclose'];
+	$pref['wmessage_sc'] = $_POST['wmessage_sc'];
+	save_prefs();
+	$message = LAN_SETSAVED;
+}
+
+if (isset($_POST['main_delete'])) {
+	$del_id = array_keys($_POST['main_delete']);
+	$message = ($sql->db_Delete("generic", "gen_id='".$del_id[0]."' ")) ? LAN_DELETED : LAN_DELETED_FAILED ;
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+// Show Existing -------
+if ($action == "main" || $action == "") {
+	if ($wm_total = $sql->db_Select("generic", "gen_id, gen_intdata, gen_chardata", "gen_type='wmessage' ORDER BY gen_id ASC")) {
+		$wmList = $sql->db_getList();
+		$text = $rs->form_open("post", e_SELF, "myform_{$gen_id}", "", "");
+		$text .= "<div style='text-align:center'>
+			<table class='fborder' style='".ADMIN_WIDTH."'>
+			<tr>
+			<td class='fcaption' style='width:5%'>ID</td>
+			<td class='fcaption' style='width:70%'>".WMLAN_02."</td>
+			<td class='fcaption' style='width:20%'>".WMLAN_03."</td>
+			<td class='fcaption' style='width:15%'>".LAN_OPTIONS."</td>
+			</tr>";
+		foreach($wmList as $row) {
+			$text .= "
+			<tr>
+				<td class='forumheader3' style='width:5%; text-align: center; vertical-align: middle'>".$row['gen_id']."</td>
+				<td style='width:70%' class='forumheader3'>".strip_tags($tp->toHTML($row['gen_chardata']))."</td>
+				<td style='width:70%' class='forumheader3'>".r_userclass_name($row['gen_intdata'])."</td>
+            	<td style='width:15%; text-align:center; white-space: nowrap' class='forumheader3'>
+					<a href='".e_SELF."?create.edit.{$row['gen_id']}'>".ADMIN_EDIT_ICON."</a>
+					<input type='image' title='".LAN_DELETE."' name='main_delete[".$row['gen_id']."]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".LAN_CONFIRMDEL." [ID: {$row['gen_id']} ]')\"/>
+				</td>
+			</tr>";
+		}
+
+		$text .= "</table></div>";
+		$text .= $rs->form_close();
+	} else {
+		$text .= "<div style='text-align:center'>".WMLAN_09."</div>";
+	}
+	$ns->tablerender(WMLAN_00, $text);
+}
+
+// Create and Edit
+if ($action == "create" || $action == "edit")
+{
+
+	if ($sub_action == "edit")
+	{
+		$sql->db_Select("generic", "gen_intdata, gen_ip, gen_chardata", "gen_id = $id");
+		$row = $sql->db_Fetch();
+	}
+
+	if ($sub_action != 'edit')
+	{
+		$preset = $pst->read_preset("admin_wmessage");
+		extract($preset);
+	}
+
+	$text = "
+		<div style='text-align:center'>
+		<form method='post' action='".e_SELF."'  id='wmform'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		";
+
+	$text .= "
+		<tr>
+		<td style='width:20%' class='forumheader3'>".WMLAN_10."</td>
+		<td style='width:60%' class='forumheader3'>
+		<input type='text' class='tbox' id='wm_caption' name='wm_caption' maxlength='80' style='width:95%' value=\"".$tp->toForm($row['gen_ip'])."\" />
+		</td>
+		</tr>";
+
+	$text .= "<tr>
+		<td style='width:20%' class='forumheader3'>".WMLAN_04."</td>
+		<td style='width:60%' class='forumheader3'>
+		<textarea class='tbox' id='wm_text' name='wm_text' cols='70' rows='15' style='width:95%' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this)'>".$tp->toForm($row['gen_chardata'])."</textarea>
+		<br />";
+
+	if(!e_WYSIWYG){
+		$text .= "<br />".display_help("helpb", 2);
+	}
+
+	$text .= "
+		</td>
+		</tr>
+		<tr><td class='forumheader3'>".WMLAN_03."</td>
+		<td class='forumheader3'>".r_userclass("wm_active", $row['gen_intdata'], "off", "public,guest,nobody,member,admin,classes")."</td></tr>";
+
+	$text .= "
+		<tr style='vertical-align:top'>
+		<td colspan='2' class='forumheader' style='text-align:center'>";
+
+	$text .= ($sub_action == "edit") ? "<input class='button' type='submit' name='wm_update' value='".LAN_UPDATE."' />" :
+	 "<input class='button' type='submit' name='wm_insert' value='".LAN_CREATE."' />" ;
+	$text .= "<input type='hidden' name='wm_id' value='".$id."' />";
+	$text .= "</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+	$ns->tablerender(WMLAN_01, $text);
+}
+
+
+if ($action == "opt") {
+	global $pref, $ns;
+	$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+
+		<td style='width:70%' class='forumheader3'>
+		".WMLAN_05."<br />
+		<span class='smalltext'>".WMLAN_06."</span>
+		</td>
+		<td class='forumheader3' style='width:30%;text-align:center'>". ($pref['wm_enclose'] ? "<input type='checkbox' name='wm_enclose' value='1' checked='checked' />" : "<input type='checkbox' name='wm_enclose' value='1' />")."
+		</td>
+		</tr>
+		<tr>
+
+		<td style='width:70%' class='forumheader3'>
+		".WMLAN_07."
+		</td>
+		<td class='forumheader3' style='width:30%;text-align:center'>". ($pref['wmessage_sc'] ? "<input type='checkbox' name='wmessage_sc' value='1' checked='checked' />" : "<input type='checkbox' name='wmessage_sc' value='1' />")."
+		</td>
+		</tr>
+
+		<tr style='vertical-align:top'>
+		<td colspan='2'  style='text-align:center' class='forumheader'>
+		<input class='button' type='submit' name='updateoptions' value='".LAN_SAVE."' />
+		</td>
+		</tr>
+
+		</table>
+		</form>
+		</div>";
+
+	$ns->tablerender(WMLAN_00.": ".LAN_PREFS, $text);
+
+
+}
+
+function wmessage_adminmenu() {
+	global $action;
+	if ($action == "") {
+		$action = "main";
+	}
+	$var['main']['text'] = WMLAN_00;
+	$var['main']['link'] = e_SELF;
+	$var['create']['text'] = WMLAN_01;
+	$var['create']['link'] = e_SELF."?create";
+	$var['opt']['text'] = LAN_PREFS;
+	$var['opt']['link'] = e_SELF."?opt";
+
+	show_admin_menu(LAN_OPTIONS, $action, $var);
+}
+
+require_once("footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_docs/gpl.txt 75/e107_docs/gpl.txt
--- 6171/e107_docs/gpl.txt	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_docs/gpl.txt	2004-09-21 14:10:22.000000000 -0500
@@ -1,342 +1,342 @@
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		    GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-			    NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
-
-
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
diff -ruN 6171/e107_docs/help/English/Administrators 75/e107_docs/help/English/Administrators
--- 6171/e107_docs/help/English/Administrators	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Administrators	2004-09-21 14:10:23.000000000 -0500
@@ -1,6 +1,6 @@
-
-Q>	What are permissions?
-A>	These allow you to give administrators different access levels to the admin section. For example you might only want to let a certain admin post news items, using permissions you can do this. There are some admin functions that are only accessable to the main site admin, this is for security reasons.
-
-Q>	I want to make an existing registered member into an administrator - how?
-A>	Click on Users in your admin section and search for the registered member, then click on Make Admin. You should then go immediately to the Administrators section and set his permissions. You can also remove admin status from someone in this way.
+
+Q>	What are permissions?
+A>	These allow you to give administrators different access levels to the admin section. For example you might only want to let a certain admin post news items, using permissions you can do this. There are some admin functions that are only accessable to the main site admin, this is for security reasons.
+
+Q>	I want to make an existing registered member into an administrator - how?
+A>	Click on Users in your admin section and search for the registered member, then click on Make Admin. You should then go immediately to the Administrators section and set his permissions. You can also remove admin status from someone in this way.
diff -ruN 6171/e107_docs/help/English/Articles 75/e107_docs/help/English/Articles
--- 6171/e107_docs/help/English/Articles	2004-05-17 11:13:06.000000000 -0500
+++ 75/e107_docs/help/English/Articles	1969-12-31 18:00:00.000000000 -0600
@@ -1,12 +0,0 @@
-
-Q>	What's an article parent?
-A>	Parents allow you to group your articles under different headings, this makes it easier for your visitors to find what they're looking for.
-
-Q>	Can I create an article with more than one page?
-A>	Yes. Enter your article as normal but seperate the pages by entering [newpage], this will seperate your article into pages with links to each page at the foot of each page.
-
-Q>	What are the email / print icons for?
-A>	These allow you to add a link at the end of your article to the 'email to a friend' and 'printer-friendly' pages.
-
-Q>	Do these answers all apply to reviews as well?
-A>	Yes. Reviews can also use the [newpage] and email/print features.
\ No newline at end of file
diff -ruN 6171/e107_docs/help/English/Banlist 75/e107_docs/help/English/Banlist
--- 6171/e107_docs/help/English/Banlist	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Banlist	2004-09-21 14:10:23.000000000 -0500
@@ -1,6 +1,6 @@
-
-Q>	What's this section for?
-A>	This page allows you to ban visitors to your site, either by their IP address and/or email address.
-
-Q>	Why do I have to give a reason?
-A>	You dont, that textbox is there so that other administrators can see the reason for the ban, or they might remove it by mistake.
+
+Q>	What's this section for?
+A>	This page allows you to ban visitors to your site, either by their IP address and/or email address.
+
+Q>	Why do I have to give a reason?
+A>	You dont, that textbox is there so that other administrators can see the reason for the ban, or they might remove it by mistake.
diff -ruN 6171/e107_docs/help/English/Banners 75/e107_docs/help/English/Banners
--- 6171/e107_docs/help/English/Banners	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Banners	2004-09-21 14:10:23.000000000 -0500
@@ -1,18 +1,18 @@
-
-Q>	I defined a new banner from the admin area but it's not showing up - why?
-A>	The theme you're using needs to know to display a banner. Open the theme.php of the theme and make sure you have {BANNER} or {BANNER=yourcampaignname} in the $HEADER section.
-
-Q>	I want to one set of banners in one area and a different set in another area - how?
-A>	You can group your banners under 'campaigns', and then set up your theme to show banners from certain campaigns. For example, if you had two campaigns, called cam_1 and cam_2, putting {BANNER=cam1} in one area of your $HEADER section in the theme.php will show only cam_1 banners, and putting {BANNER=cam_2} in another area will only show cam_2 banners. Putting {BANNER} (no campaign name) in your theme.php will show random banners from all campaigns.
-
-Q>	What's the client login and client password for?
-A>	You can define a login and password for your banner clients, they can then use these to access information about how their banners are performing by going to http://yoursite.com/banner.php and entering the name and pass.
-
-Q>	How can I have a 'tower' type banner in a menu item?
-A>	First you need to define the campaign for the tower type banners (this will keep them seperate from bar type banners) ...
-	1. Go to your admin area and click on banners.
-	2. Enter your tower-type banner(s), make sure you use a new campaign name, for example 'towers'.
-	3. Now go to your Menus area, and activate the Banner_menu into one of your menu areas.
-	4. Click on the 'Configure' link in the menu item.
-	5. Enter the caption title (by default it's 'Advertisment'), and enter the campaign name you defined before.
+
+Q>	I defined a new banner from the admin area but it's not showing up - why?
+A>	The theme you're using needs to know to display a banner. Open the theme.php of the theme and make sure you have {BANNER} or {BANNER=yourcampaignname} in the $HEADER section.
+
+Q>	I want to one set of banners in one area and a different set in another area - how?
+A>	You can group your banners under 'campaigns', and then set up your theme to show banners from certain campaigns. For example, if you had two campaigns, called cam_1 and cam_2, putting {BANNER=cam1} in one area of your $HEADER section in the theme.php will show only cam_1 banners, and putting {BANNER=cam_2} in another area will only show cam_2 banners. Putting {BANNER} (no campaign name) in your theme.php will show random banners from all campaigns.
+
+Q>	What's the client login and client password for?
+A>	You can define a login and password for your banner clients, they can then use these to access information about how their banners are performing by going to http://yoursite.com/banner.php and entering the name and pass.
+
+Q>	How can I have a 'tower' type banner in a menu item?
+A>	First you need to define the campaign for the tower type banners (this will keep them seperate from bar type banners) ...
+	1. Go to your admin area and click on banners.
+	2. Enter your tower-type banner(s), make sure you use a new campaign name, for example 'towers'.
+	3. Now go to your Menus area, and activate the Banner_menu into one of your menu areas.
+	4. Click on the 'Configure' link in the menu item.
+	5. Enter the caption title (by default it's 'Advertisment'), and enter the campaign name you defined before.
 	6. Leave your admin area and you'll see your tower-type banner(s) in the area you assigned them to.
\ No newline at end of file
diff -ruN 6171/e107_docs/help/English/BBCode 75/e107_docs/help/English/BBCode
--- 6171/e107_docs/help/English/BBCode	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/BBCode	2004-09-21 14:10:23.000000000 -0500
@@ -1,12 +1,12 @@
-
-Q>	What's BBCode?
-A>	A BBCode is a shortcut to an HTML tag, for example entering &#91;b] I am bold text! &#91;/b] in any of your admin textboxes will make the text inside the &#91;b] and &#91;/b] appear in bold text, so [b]I am bold text![/b] would appear on the screen.
-
-Q>	But what's it for?
-A>	It saves you time when entering HTML tags. You can use normal HTML tags in your text entry boxes but using BBCode will really speed up your text entry.
-
-Q>	When I click one of the BBCode buttons to enter the code, it enters it at the end of my text, not where the cursor is - why?
-A>	There is a bug in Internet Explorer that can cause it to crash if e107 tries to enter the code at the cursor position, so in the interests of compatibility the code is entered at the end of your text.
-
-Q>	What BBCodes can I use?
-A>	Hover your mouse pointer above any of the bbcode boxes, you'll see a small explanation appear just above the buttons. There are also codes for links &#91;url] &#91;/url] and email &#91;email] &#91;/email], although again using normal HTML tags is ok. All web addresses and email addresses entered are automatically made into clickable hyperlinks.
+
+Q>	What's BBCode?
+A>	A BBCode is a shortcut to an HTML tag, for example entering &#91;b] I am bold text! &#91;/b] in any of your admin textboxes will make the text inside the &#91;b] and &#91;/b] appear in bold text, so [b]I am bold text![/b] would appear on the screen.
+
+Q>	But what's it for?
+A>	It saves you time when entering HTML tags. You can use normal HTML tags in your text entry boxes but using BBCode will really speed up your text entry.
+
+Q>	When I click one of the BBCode buttons to enter the code, it enters it at the end of my text, not where the cursor is - why?
+A>	There is a bug in Internet Explorer that can cause it to crash if e107 tries to enter the code at the cursor position, so in the interests of compatibility the code is entered at the end of your text.
+
+Q>	What BBCodes can I use?
+A>	Hover your mouse pointer above any of the bbcode boxes, you'll see a small explanation appear just above the buttons. There are also codes for links &#91;url] &#91;/url] and email &#91;email] &#91;/email], although again using normal HTML tags is ok. All web addresses and email addresses entered are automatically made into clickable hyperlinks.
diff -ruN 6171/e107_docs/help/English/Cache 75/e107_docs/help/English/Cache
--- 6171/e107_docs/help/English/Cache	2004-05-17 11:13:06.000000000 -0500
+++ 75/e107_docs/help/English/Cache	2005-11-24 10:26:27.000000000 -0600
@@ -1,9 +1,9 @@
-
-Q>	Whats this section for?
-A>	Setting Cache Status to on will save certain areas of your site in your database. This reduces calls to mySQL, and vastly speeds up your site.
-
-Q>	I made some alterations to the theme I'm using but it hasn't changed - is it because it's cached.
-A>	Most probably. When you change themes the cache is cleared but altering code in your theme.php wont clear the cache. Set Cache Status to off until you're finished.
-
-Q>	Can I save the cache to files on the hardrive?
-A>	Yes. Just make sure that your e107_files/cache directory is writable (chmod 777). And then click the option on the cache page.
+
+Q>	Whats this section for?
+A>	Setting Cache Status to on will save certain areas of your site in your database. This reduces calls to MySQL, and vastly speeds up your site.
+
+Q>	I made some alterations to the theme I'm using but it hasn't changed - is it because it's cached.
+A>	Most probably. When you change themes the cache is cleared but altering code in your theme.php wont clear the cache. Set Cache Status to off until you're finished.
+
+Q>	Can I save the cache to files on the hardrive?
+A>	Yes. Just make sure that your e107_files/cache directory is writable (chmod 777). And then click the option on the cache page.
diff -ruN 6171/e107_docs/help/English/Chatbox 75/e107_docs/help/English/Chatbox
--- 6171/e107_docs/help/English/Chatbox	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Chatbox	2004-09-21 14:10:23.000000000 -0500
@@ -1,9 +1,9 @@
-
-Q>	What is the Replace Links section for?
-A>	You can convert any links entered in your chatbox to other text, or an image. This keeps your chatbox from overflowing with long website addresses. To use an image, tick Replace Links, and in the box below enter &lt;img src='path_to_your_image' alt='' />, now any links entered will be converted to the image you entered.
-
-Q>	Whats Wordwrap for?
-A>	If someone entered a very long word in your chatbox it could disrupt the layout of your site. If you were to enter 40 in the Wordrap box, any works longer than 40 characters would be wrapped so the column wouldn't be extended. You may have to change this value corrosponding to the theme you are using, and the width of the column your chatbox is in.
-
-Q>	My site is for all ages yet someone keeps swearing in the chatbox - how can I stop this?
-A>	Go to the Preferences screen in your admin section, and find the Protection of minors options. You can add a list of words here that will be replaced by a word or sentence of your choice, for example CENSORED! Now anytime that work is encountered on your site it will be replaced with the text you entered.
+
+Q>	What is the Replace Links section for?
+A>	You can convert any links entered in your chatbox to other text, or an image. This keeps your chatbox from overflowing with long website addresses. To use an image, tick Replace Links, and in the box below enter &lt;img src='path_to_your_image' alt='' />, now any links entered will be converted to the image you entered.
+
+Q>	Whats Wordwrap for?
+A>	If someone entered a very long word in your chatbox it could disrupt the layout of your site. If you were to enter 40 in the Wordrap box, any works longer than 40 characters would be wrapped so the column wouldn't be extended. You may have to change this value corrosponding to the theme you are using, and the width of the column your chatbox is in.
+
+Q>	My site is for all ages yet someone keeps swearing in the chatbox - how can I stop this?
+A>	Go to the Preferences screen in your admin section, and find the Protection of minors options. You can add a list of words here that will be replaced by a word or sentence of your choice, for example CENSORED! Now anytime that work is encountered on your site it will be replaced with the text you entered.
diff -ruN 6171/e107_docs/help/English/Classes 75/e107_docs/help/English/Classes
--- 6171/e107_docs/help/English/Classes	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Classes	2004-09-21 14:10:23.000000000 -0500
@@ -1,5 +1,5 @@
-
-Q>	What are these user-classes I keep seeing? What are they for?
-A>	User classes restrict access to certain areas or functions of your site. If you define a class, then add certain users to it, you can choose to make things visible to only the users in that class.
-For example, there is a class already created by default when you install e107 called PRIVATEFORUM. Adding users to this class then creating a forum under that class will make only the uers in that class able to access that forum. You can restrict other areas and functions by class, like news items, links, downloads etc.
-
+
+Q>	What are these user-classes I keep seeing? What are they for?
+A>	User classes restrict access to certain areas or functions of your site. If you define a class, then add certain users to it, you can choose to make things visible to only the users in that class.
+For example, there is a class already created by default when you install e107 called PRIVATEFORUM. Adding users to this class then creating a forum under that class will make only the uers in that class able to access that forum. You can restrict other areas and functions by class, like news items, links, downloads etc.
+
diff -ruN 6171/e107_docs/help/English/Content 75/e107_docs/help/English/Content
--- 6171/e107_docs/help/English/Content	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Content	1969-12-31 18:00:00.000000000 -0600
@@ -1,3 +0,0 @@
-
-Q>	What's a content page?
-A>	A content page allows you to enter text, or anything else on a page, then have it accessable to your visitors. It saves you from having to code the page seperately without having to worry about integrating it into e107.
diff -ruN 6171/e107_docs/help/English/Downloads 75/e107_docs/help/English/Downloads
--- 6171/e107_docs/help/English/Downloads	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Downloads	2004-09-21 14:10:23.000000000 -0500
@@ -1,6 +1,6 @@
-
-Q>	What's a download parent?
-A>	This allows you to group your downloads into different categories.
-
-Q>	I want to add a download but the file doesn't appear in the list - why?
-A>	Only files in the e107_files/downloads folder appear in the dropdown list. Copy the file into this folder and it will appear. The same applies to images, they must be in the e107_files/downloadimages folder.
+
+Q>	What's a download parent?
+A>	This allows you to group your downloads into different categories.
+
+Q>	I want to add a download but the file doesn't appear in the list - why?
+A>	Only files in the e107_files/downloads folder appear in the dropdown list. Copy the file into this folder and it will appear. The same applies to images, they must be in the e107_files/downloadimages folder.
diff -ruN 6171/e107_docs/help/English/Emoticons 75/e107_docs/help/English/Emoticons
--- 6171/e107_docs/help/English/Emoticons	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Emoticons	2004-09-21 14:10:23.000000000 -0500
@@ -1,6 +1,6 @@
-
-Q>	What are emoticons?
-A>	Emoticons are the smiley images you see on other websites. If you enable emoticons on your site, any time someone enters a smiley, for example &#58;), it will be replaced by the image equivalent :)
-
-Q>	Can I enter new emoticon codes?
-A>	Yes, from the emoticon screen you can enter new, edit existing or delete emoticons.
+
+Q>	What are emoticons?
+A>	Emoticons are the smiley images you see on other websites. If you enable emoticons on your site, any time someone enters a smiley, for example &#58;), it will be replaced by the image equivalent :)
+
+Q>	Can I enter new emoticon codes?
+A>	Yes, from the emoticon screen you can enter new, edit existing or delete emoticons.
diff -ruN 6171/e107_docs/help/English/Errors 75/e107_docs/help/English/Errors
--- 6171/e107_docs/help/English/Errors	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Errors	2004-09-21 14:10:23.000000000 -0500
@@ -1,3 +1,3 @@
-
-Q>	I'm getting some errors on a certain page, what do I do about it?
-A>	Browse the Problems forum at e107.org and see if anyone else is getting the same problem. If you think it's a bug please post the error on the bugtracker at e107.org.
+
+Q>	I'm getting some errors on a certain page, what do I do about it?
+A>	Browse the Problems forum at e107.org and see if anyone else is getting the same problem. If you think it's a bug please post the error on the bugtracker at e107.org.
diff -ruN 6171/e107_docs/help/English/Forums 75/e107_docs/help/English/Forums
--- 6171/e107_docs/help/English/Forums	2004-05-17 11:13:06.000000000 -0500
+++ 75/e107_docs/help/English/Forums	2004-09-21 14:10:23.000000000 -0500
@@ -1,15 +1,15 @@
-
-Q>	What are forum parents?
-A>	A parent is a heading to group other foums under, this makes it easier to navigate your forums.
-
-Q>	I want to make a certain administator a forum moderator but his name isn't in the list - why?
-A>	Administrators will only be listed if they have the correct permission set to be a forum moderator, Go to the Administrators section and edit the admin in quetion, and make sure 'Moderate forums' is ticked.
-
-Q>	What's tracking?
-A>	If you have this enabled, it allows users to track a forum thread, they will receive an email when someone replies to the thread.
-
-Q>	What's pruning?
-A>	This allows you to remove old threads that havent received a reply in a certain time. Please be careful with this function, once threads are deleted they cannot be retrieved.
-
-Q>	What are reported posts?
-A>	Users can report posts that they find to contain objectionable material. You can open the reported thread and moderate as you wish.
+
+Q>	What are forum parents?
+A>	A parent is a heading to group other foums under, this makes it easier to navigate your forums.
+
+Q>	I want to make a certain administator a forum moderator but his name isn't in the list - why?
+A>	Administrators will only be listed if they have the correct permission set to be a forum moderator, Go to the Administrators section and edit the admin in quetion, and make sure 'Moderate forums' is ticked.
+
+Q>	What's tracking?
+A>	If you have this enabled, it allows users to track a forum thread, they will receive an email when someone replies to the thread.
+
+Q>	What's pruning?
+A>	This allows you to remove old threads that havent received a reply in a certain time. Please be careful with this function, once threads are deleted they cannot be retrieved.
+
+Q>	What are reported posts?
+A>	Users can report posts that they find to contain objectionable material. You can open the reported thread and moderate as you wish.
diff -ruN 6171/e107_docs/help/English/Front_Page 75/e107_docs/help/English/Front_Page
--- 6171/e107_docs/help/English/Front_Page	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Front_Page	2005-08-31 04:14:04.000000000 -0500
@@ -1,9 +1,6 @@
-
-Q>	Whats this section for?
-A>	This screen allows you to set what appears on the front page of your site, by default it's set to news.
-
-Q>	What other pages can I display?
-A>	Any. You can either tick the preset ones (forum, downloads etc) or enter the address to the page you want to use.
-
-Q>	How do I set up a splashscreen?
-A>	Enter the address to your splashscreen page, then tick Splashscreen only. The page will be showed for 10 seconds before redirecting to your news page.
+
+Q>	Whats this section for?
+A>	This screen allows you to set what appears on the front page of your site, by default it's set to news.
+
+Q>	What other pages can I display?
+A>	Any. You can either tick the preset ones (forum, downloads etc) or enter the address to the page you want to use.
diff -ruN 6171/e107_docs/help/English/Help! 75/e107_docs/help/English/Help!
--- 6171/e107_docs/help/English/Help!	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Help!	2005-11-24 10:26:27.000000000 -0600
@@ -1,9 +1,9 @@
-
-Q>	I made some changes to my site and now I'm getting mySQL errors and my site doesn't appear.
-A>	It could be that your core has become corrupt. The core is the core settings and variables of e107. To reset your core, go to http://yoursite.com/e107_files/resetcore.php. Always back up your core (from the Database screen) before you apply changes, you can then restore the core backup if something goes wrong (again from resetcore.php).
-
-Q>	I forgot my main admin password and now I cant access my admin area.
-A>	For very good security reasons it's impossible to reset your password unless you're logged in. If you haven't written your password down in a safe place please do so now, then this scenario will never happen. If it does, you will have to reset your password manually using PHPMyAdmin or another similar mySQL manager. Go to the users table, the main admin should be user numver 1. Click on the edit button and change the password to 4cb9c8a8048fd02294477fcb1a41191a, this will change your password to changeme. Now log in and [b]update your password immediately[/b].
-
-Q>	I installed a theme/plugin etc and now my site is unreachable, what can I do?
-A>	Use resetcore.php (see above).
+
+Q>	I made some changes to my site and now I'm getting MySQL errors and my site doesn't appear.
+A>	It could be that your core has become corrupt. The core is the core settings and variables of e107. To reset your core, go to http://yoursite.com/e107_files/resetcore/resetcore.php. Always back up your core (from the Database screen) before you apply changes, you can then restore the core backup if something goes wrong (again from resetcore.php).
+
+Q>	I forgot my main admin password and now I cant access my admin area.
+A>	For very good security reasons it's impossible to reset your password unless you're logged in. If you haven't written your password down in a safe place please do so now, then this scenario will never happen. If it does, you will have to reset your password manually using PHPMyAdmin or another similar MySQL manager. Go to the users table, the main admin should be user numver 1. Click on the edit button and change the password to 4cb9c8a8048fd02294477fcb1a41191a, this will change your password to changeme. Now log in and [b]update your password immediately[/b].
+
+Q>	I installed a theme/plugin etc and now my site is unreachable, what can I do?
+A>	Use resetcore.php (see above).
diff -ruN 6171/e107_docs/help/English/Links 75/e107_docs/help/English/Links
--- 6171/e107_docs/help/English/Links	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Links	2004-09-21 14:10:23.000000000 -0500
@@ -1,6 +1,6 @@
-
-Q>	How can I enter a link so that it appears in my main navigation menu?
-A>	Any links in the Main category will appear in your main nav menu. All other categories appear on the Links page.
-
-Q>	What's the link button text box for?
-A>	This allows you to display the button for the link on the Links page. If you leave it blank a blank button will be displayed.
+
+Q>	How can I enter a link so that it appears in my main navigation menu?
+A>	Any links in the Main category will appear in your main nav menu. All other categories appear on the Links page.
+
+Q>	What's the link button text box for?
+A>	This allows you to display the button for the link on the Links page. If you leave it blank a blank button will be displayed.
diff -ruN 6171/e107_docs/help/English/Maintainance 75/e107_docs/help/English/Maintainance
--- 6171/e107_docs/help/English/Maintainance	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Maintainance	2004-09-21 14:10:23.000000000 -0500
@@ -1,6 +1,6 @@
-
-Q>	Whats this section for?
-A>	This screen allows you to make your site inaccessable to visitors, use it when you are upgrading your site or need to take it down for any reason. Only the main site administrator can access the site when in maintainance mode, you'll know this as a message is displayed on every page.
-
-Q>	Help! I set the Maintainance Flag and accidently logged out, how do I get back in to my admin section to put the site back up?
-A>	Go to http://yoursite.com/e107_admin.php/admin.php and log in from there.
+
+Q>	Whats this section for?
+A>	This screen allows you to make your site inaccessable to visitors, use it when you are upgrading your site or need to take it down for any reason. Only the main site administrator can access the site when in maintainance mode, you'll know this as a message is displayed on every page.
+
+Q>	Help! I set the Maintainance Flag and accidently logged out, how do I get back in to my admin section to put the site back up?
+A>	Go to http://yoursite.com/e107_admin.php/admin.php and log in from there.
diff -ruN 6171/e107_docs/help/English/Menus 75/e107_docs/help/English/Menus
--- 6171/e107_docs/help/English/Menus	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Menus	2004-09-21 14:10:23.000000000 -0500
@@ -1,12 +1,12 @@
-
-Q>	What are menus?
-A>	They are items that appear in the menu areas (or columns) of your site. These can contain text, links, anything.
-
-Q>	How do I activate a menu item?
-A>	Go to your admin area and click on Menus. You'll see the main layout of your site with a list of the menus in their respective areas. The menu items in the center of the page are inactive, you can move them into an active area by clicking on Activate this menu. You can also move the area the menu is in or move it up and down the column once it's activated.
-
-Q>	I need to put some text inside a menu item, how can I do this?
-A>	Go to the admin area and click on Custom Menus. From here you can enter any text you like to a menu and it will be saved and available like any other menu.
-
-Q>	How can I change the options for a menu item?
-A>	If a config panel is available you will see a link to it (called 'Configure') in the menu box once activated.
+
+Q>	What are menus?
+A>	They are items that appear in the menu areas (or columns) of your site. These can contain text, links, anything.
+
+Q>	How do I activate a menu item?
+A>	Go to your admin area and click on Menus. You'll see the main layout of your site with a list of the menus in their respective areas. The menu items in the center of the page are inactive, you can move them into an active area by clicking on Activate this menu. You can also move the area the menu is in or move it up and down the column once it's activated.
+
+Q>	I need to put some text inside a menu item, how can I do this?
+A>	Go to the admin area and click on Custom Menus. From here you can enter any text you like to a menu and it will be saved and available like any other menu.
+
+Q>	How can I change the options for a menu item?
+A>	If a config panel is available you will see a link to it (called 'Configure') in the menu box once activated.
diff -ruN 6171/e107_docs/help/English/News 75/e107_docs/help/English/News
--- 6171/e107_docs/help/English/News	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/News	2004-09-21 14:10:23.000000000 -0500
@@ -1,12 +1,12 @@
-
-Q>	What are news categories for?
-A>	You can group your news items under different categories, and they will be displayed with a different icon etc if defined. This makes it easier for your visitors to navigate your site and read only the items that interest them.
-
-Q>	What is the Extended box for?
-A>	You may have noticed the way news items are reported on some sites, they have a small intro with a link to the whole article, you can do this by entering the intro in the Body text box and the rest of the article in the Extended box.
-
-Q>	What are the activation boxes for? 
-A>	You can set up a news item to only appear between cerain dates by using the activation boxes. If you leave them blank the news you post will appear immediately.
-
-Q>	I entered a news item and it says 'News saved in database' - does that mean it will show on my news page?
-A>	It means the text you entered has been saved. If the news item you entered is set to active, then yes it will apaear on your news page.
+
+Q>	What are news categories for?
+A>	You can group your news items under different categories, and they will be displayed with a different icon etc if defined. This makes it easier for your visitors to navigate your site and read only the items that interest them.
+
+Q>	What is the Extended box for?
+A>	You may have noticed the way news items are reported on some sites, they have a small intro with a link to the whole article, you can do this by entering the intro in the Body text box and the rest of the article in the Extended box.
+
+Q>	What are the activation boxes for? 
+A>	You can set up a news item to only appear between cerain dates by using the activation boxes. If you leave them blank the news you post will appear immediately.
+
+Q>	I entered a news item and it says 'News saved in database' - does that mean it will show on my news page?
+A>	It means the text you entered has been saved. If the news item you entered is set to active, then yes it will apaear on your news page.
diff -ruN 6171/e107_docs/help/English/Preferences 75/e107_docs/help/English/Preferences
--- 6171/e107_docs/help/English/Preferences	2004-05-17 11:13:06.000000000 -0500
+++ 75/e107_docs/help/English/Preferences	2004-09-21 14:10:23.000000000 -0500
@@ -1,15 +1,15 @@
-
-Q>	How do I change themes?
-A>	There is a section in your Preferences page that allows you to change your site theme. Please preview the theme first as some older themes are no longer compatible and could render your site unusable if applied.
-
-Q>	What's COPPA?
-A>	The Children's Online Privacy Protection Act of 1998. It's a univarsally used rule that protects minors aged 13 and under. It ensures that no information on minors will be used by the 'Operator' (ie, you) for purposes other than maintaining the website. For more information please see http://www.cdt.org/legislation/105th/privacy/coppa.html.
-
-Q>	What's flood protextion?
-A>	It prevents your site being flooded by HTTP calls, which can render your site unreachable.
-
-Q>	Should I use Cookies or Sessions for tracking my users?
-A>	It's your choice, if your site is working ok with cookies (the default) then leave it like that. If you prefer to use PHP sessions, then use that (a custom session handler is used by e107 to store and handle sessions).
-
-Q>	Why should I run my site in standards mode?
+
+Q>	How do I change themes?
+A>	There is a section in your Preferences page that allows you to change your site theme. Please preview the theme first as some older themes are no longer compatible and could render your site unusable if applied.
+
+Q>	What's COPPA?
+A>	The Children's Online Privacy Protection Act of 1998. It's a univarsally used rule that protects minors aged 13 and under. It ensures that no information on minors will be used by the 'Operator' (ie, you) for purposes other than maintaining the website. For more information please see http://www.cdt.org/legislation/105th/privacy/coppa.html.
+
+Q>	What's flood protextion?
+A>	It prevents your site being flooded by HTTP calls, which can render your site unreachable.
+
+Q>	Should I use Cookies or Sessions for tracking my users?
+A>	It's your choice, if your site is working ok with cookies (the default) then leave it like that. If you prefer to use PHP sessions, then use that (a custom session handler is used by e107 to store and handle sessions).
+
+Q>	Why should I run my site in standards mode?
 A>	If your developing a theme and having trouble getting it to render correctly in Firefox/Mozilla and IE, try ticking this box. IE will then be run in standards mode and use the correct box model.
\ No newline at end of file
diff -ruN 6171/e107_docs/help/English/Uploads 75/e107_docs/help/English/Uploads
--- 6171/e107_docs/help/English/Uploads	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Uploads	2005-11-24 10:26:27.000000000 -0600
@@ -1,6 +1,6 @@
-
-Q>	I'd like to let people upload files to my site but I'm worried about security ...
-A>	There are a couple of things to do to improve security. First, use Binary storage, the uploaded files will then be stored in the mySQL database and wont be accessable to anyone apart from to download. Also, set the list of allowed file types, if anyone tries to upload a filetype other than the types you have defined it will be deleted immediately from your server.
-
-Q>	I've had some files uploaded, what do I do now?
-A>	You have the option to copy the file to your Download Manager, to allow others to download it, and to copy the upload information to your newspost section, to make a news item announcement about it.
+
+Q>	I'd like to let people upload files to my site but I'm worried about security ...
+A>	There are a couple of things to do to improve security. First, use Binary storage, the uploaded files will then be stored in the MySQL database and wont be accessable to anyone apart from to download. Also, set the list of allowed file types, if anyone tries to upload a filetype other than the types you have defined it will be deleted immediately from your server.
+
+Q>	I've had some files uploaded, what do I do now?
+A>	You have the option to copy the file to your Download Manager, to allow others to download it, and to copy the upload information to your newspost section, to make a news item announcement about it.
diff -ruN 6171/e107_docs/help/English/Users 75/e107_docs/help/English/Users
--- 6171/e107_docs/help/English/Users	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Users	2004-09-21 14:10:23.000000000 -0500
@@ -1,3 +1,3 @@
-
-Q>	What's the Extended Field section for?
-A>	This allows you to add more sections to the Users page. For example, if you were running a clan, you could add a field for clan nickname, or average number of frags :) The new field will appear in the User Settings page, and also the Members list.
+
+Q>	What's the Extended Field section for?
+A>	This allows you to add more sections to the Users page. For example, if you were running a clan, you could add a field for clan nickname, or average number of frags :) The new field will appear in the User Settings page, and also the Members list.
diff -ruN 6171/e107_docs/help/English/Welcome_Message 75/e107_docs/help/English/Welcome_Message
--- 6171/e107_docs/help/English/Welcome_Message	2004-05-10 09:45:16.000000000 -0500
+++ 75/e107_docs/help/English/Welcome_Message	2004-09-21 14:10:23.000000000 -0500
@@ -1,3 +1,3 @@
-
-Q>	What's this section for?
-A>	You can enter some text here that will always be displayed above your news items on the front page. You can enter a different message for Guests, Members and Administators.
+
+Q>	What's this section for?
+A>	You can enter some text here that will always be displayed above your news items on the front page. You can enter a different message for Guests, Members and Administators.
diff -ruN 6171/e107_docs/README.html 75/e107_docs/README.html
--- 6171/e107_docs/README.html	2004-05-17 13:37:12.000000000 -0500
+++ 75/e107_docs/README.html	2006-01-16 10:38:00.000000000 -0600
@@ -1,239 +1,217 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title>[e107 readme]</title>
-<link rel="stylesheet" href="style.css" type="text/css" />
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<meta http-equiv="content-style-type" content="text/css" />
-</head>
-<body>
-
-<div class='mainbox'>
-
-<a href="http://e107.org"><img src="../e107_images/logo.png" alt="Logo" style="border:0" /></a>
-<br /><br />
-<span class="smalltext">Steve Dunstan 2002. See gpl.txt for license details.</span><br /><br /><br />
-
-<a href="#requirements">Requirements</a> | 
-<a href="#installing">Installing</a> | 
-<a href="#upgrading">Upgrading</a> | 
-<a href="#security">Security</a> | 
-<a href="#backup">Backing up / restoring your database</a> | 
-<a href="#problems">Common Problems</a> | 
-<a href="#support">Support</a> | 
-<a href="#development">Development</a> | 
-<a href="#thankyou">Thank Yous</a> | 
-<a href="#disclaimer">Disclaimer</a><br /><br /><br />
-
-
-
-
-<a name='#requirements'></a><span class="headertext">Requirements</span><br /><br />
-<ul><li>e107 requires a webserver that has PHP 4.1.0 (or newer) and mySQL 3.22 (or newer), contact your host if you're not sure if you have these installed.</li>
-<li>If you host your own site you can download <a href="http://www.php.net">PHP</a> and <a href="http://www.mysql.com">mySQL</a> and install them yourself, both are free.</li>
-<li>You will need your mySQL username and password, and a database for content storage. Don't worry if you only have one database, e107 is happy to share it's database with other applications.</li>
-<li>e107 requires approximately 2mb of disk space on your server, although this can be reduced down to 0.5mb by removing unused themes etc if you are short of space.</li></ul>
-<br /><br />
-
-
-<a name='#installing'></a><span class="headertext">Installing</span><br /><br />
-<ul>
-	<li>After downloading and unzipping the package, you need to upload the files to your server using an FTP client. e107 will happily run in your webserver root or in a sub-directory ...
-		<ul>
-			<li>Open your FTP client and connect to your webserver</li>
-			<li>Move into the folder on your webserver where web pages are stored, generally it's 'public_html', 'www' or 'html'</li>
-			<li>Copy all the files from the unzipped e107 package onto your webserver - this could take a while, time for a cup of coffee!</li>
-		</ul>
-	</li>
-	<li>If you have the correct permissions on your server you can use an alternative (and much quicker) method to upload the files ...
-		<ul>
-			<li>Download e107 in tar.gz format from <a href='http://e107.org'>e107.org</a></li>
-			<li>Using your FTP client, upload the tar.gz to your webserver without unzipping it first</li>
-			<li>Now open a shell prompt, and navigate to the folder where you uploaded the e107 tar.gz</li>
-			<li>type tar xvzf file.tar.gz to unpack the archive</li>
-		</ul>
-	</li>
-</ul>
-<ul>
-	<li>You now need to set the file permissions of some files for e107 to access them correctly ...
-		<ul>
-			<li>In your FTP client, browse the e107_files/backend/ folder, you should see two files called news.xml and news.txt</li>
-			<li>Highlight both files, and press your right mouse button</li>
-			<li>In the menu that appears find the entry for Set File Permissions, or CHMOD, and select it</li>
-			<li>Set the file permissions to 0777, if a series of checkboxes appear tick every box</li>
-		</ul>
-		Here is a list of the files you need to set permissions 0777 to ...
-		<ul>
-			<li>/e107_config.php</li>
-			<li>/e107_files/backend/news.xml</li>
-			<li>/e107_files/backend/news.txt</li>
-			<li>/e107_files/public/</li>
-			<li>e107_files/public/avatars/</li>
-		</ul>
-	</li>
-</ul>
-<ul>
-	<li>Now open your web browser and navigate to install.php, for example http://<i>yourwebspace.com/install.php</i> or http://<i>yourwebspace.com/e107/install.php</i></li>
-		<ul>
-			<li>If all the files have been uploaded successfully, you will see the first page of the install script. Choose the language you wish to use during the procedure and click the button to continue</li>
-			<li>e107 will now carry out a series of tests to see if requirements are met and all files that need permissions set are ok to be written to. If you get a warning about mySQL don't worry too much, some versions of mySQL don't return the correct version, or return nothing at all. Click on the button to continue if all criteria has been met, or else repair the prblem and retest.
-			<li>Next you have to enter your mySQL details. Enter your server name (generally 'localhost'), username and password. If you don't know your username and/or password contact your webhosts. Now enter the name of the database ou want e107 to use. If you have the correct permissions you can create the database directly from the install script should you want to</li>
-			<li>If all is well e107 should now connect to your mySQL database, if any error messages are shown return to the previous page and make sure you entered your details correctly</li>
-			Now you have to enter your main admin details. Enter your username, password and email address, you can change your email address and password at a later stage but your username cannot be changed, so make sure you enter it correctly</li>
-			<li>e107 will now create the mySQL database tables and populate them with settings etc</li>
-			<li>If all is well, the last button will take you to your new website. There, all done, that wasn't too bad was it?!</li>
-		</ul>
-	</li>
-</ul>
-
-<ul>
-	<li>You must now set the file permissions of the main config file back to 0644 ...</li>
-		<ul>
-			<li>Using your FTP client, select the e107_config.php file</li>
-			<li>Set its file permission (using the method explained above) to 0644</li>
-		</ul>
-	</li>
-	<li><b>Now delete the install.php file from your server, if you do not there is a potential security risk to your site</b></li>
-</ul>
-<br /><br />
-
-
-<a name='#upgrading'></a><span class="headertext">Upgrading</span><br /><br />
-
-You should back up your database before applying any updates, see the section below on how to do that.<br /><br/>
-If upgrading from one version previous (v.614 to v.615)<br />
-
-<ul>
-	<li>Download the update package and unzip it</li>
-	<li>Open your FTP client and navigate to your e107 installation</li>
-	<li>Upload the files in the update package, overwriting the originals</li>
-	<li>Go to your administration section on your website, if there are any changes to be made to the e107 database you'll see a message informing you - click the button to carry out the database changes.</li>
-</ul>
-<br />
-If upgrading from a version less than one number previous (v.610 to v.615). Versions .615 and above now include all updates back to .600.<br/>
-You can use this method to upgrade any e107 install that is greater than v.600.<br />
-
-<ul>
-	<li>Download the full install package and unzip it</li>
-	<li>Open your FTP client and navigate to your e107 installation</li>
-	<li><strong>Delete the e107_config.php and install.php files before uploading.</strong>Upload the files in the update package, overwriting the originals.</li>
-	<li><strong>Once again when updating using this method, DO NOT upload e107config.php it will overwrite your configuration settings.</strong></li>
-	<li>Go to your administration section on your website, if there are any changes to be made to the e107 database you'll see a message informing you - click the button to carry out the database changes.</li>
-</ul>
-<br />
-
-
-<a name='#backup'></a><span class="headertext">Using phpMyAdmin to backup your database</span><br /><br />
-<ul>
-	<li>First, navigate to your phpMyAdmin page and log in</li>
-	<li>From the dropdown box on the left (or the text link) click on your e107 database</li>
-	<li>In the main page, click on the 'Export' tab</li>
-	<li>In the right box, make sure 'Add drop table', 'Add AUTO_INCREMENT value' and 'Enclose table and field names with backquotes' are ticked</li>
-	<li>Make sure the main 'Structure' and 'Data' boxes are ticked</li>
-	<li>Tick 'Save as file'</li>
-	<li>If you want the backup file compressed, tick either 'zipped' or 'gzipped'</li>
-	<li>Click 'Go'</li>
-</ul>
-<ul>
-	<li>To restore a backup, Click on the 'SQL' tab at the top and browse to your backup, you may need to empty your existing database before you can restore the backup</li>
-</ul>
-<br />
-
-
-<a name='#security'></a><span class="headertext">Security</span><br /><br />
-Security has been a primary concern since the first released versions of e107, and for this reason there are some very easy measures you can take to make your site more secure ...
-<ul>
-	<li>Rename your e107_admin directory: this will make it less obvious to other e107 users where your admin files are.</li><br /><br />
-	<li><strong>The procedure to change your directory names has changed. The definitions have been moved to e107_config.php.</strong></li><br /><br />
-	<li>If you are <b><u>UPGRADING</u></b> from an old version of e107 (less than v.615), you will need to open class2.php and find the following lines.</li><br /><br />
-	<div class='indent'>
-	// If you need to change the names of any of your directories, change the value here then rename the respective folder on your server ...<br />
-	$ADMIN_DIRECTORY = "e107_admin/";<br />
-	$FILES_DIRECTORY = "e107_files/";<br />
-	$IMAGES_DIRECTORY = "e107_images/";<br />
-	$THEMES_DIRECTORY = "e107_themes/";<br />
-	$PLUGINS_DIRECTORY = "e107_plugins/";<br />
-	$HANDLERS_DIRECTORY = "e107_handlers/";<br />
-	$LANGUAGES_DIRECTORY = "e107_languages/";<br />
-	$HELP_DIRECTORY = "e107_docs/help/";<br />
-	$DOWNLOADS_DIRECTORY =  "e107_files/downloads/";<br />
-	// $DOWNLOADS_DIRECTORY =  "&lt;fullpath&gt;/downloads/";<br />
-	// eg. $DOWNLOADS_DIRECTORY =  "/home/downloads/";<br />
-	</div><br />
-	<li>Cut these lines from <u>class2.php</u> and paste them into <u>e107_config.php</u> Now you can change the folder names from here.</li><br /><br />
-
-	<li>If this is a <b><u>NEW INSTALL</u></b> the folder names are already in e107_config.php. They have been left in class2.php for backwards compatibility. They will be removed from there in the future.</li><br /><br />
-	
-	<li>This procedure depends on you completing the steps above and making sure the file paths are located in e107_config.php now.</li>
-	<li>To rename your e107_admin directory (or any of your other directories), first rename the folder in the usual manner using your FTP client. Then open e107_config.php  from the root directory of your e107 installation in a text editor, and find the following line near the top of the file ...<br />
-	<i>$ADMIN_DIRECTORY = "e107_admin/";</i><br />
-	... and change <i>e107_admin/</i> to the name you've renamed it on your server
-	</li>
-	<li>You can change the name of all your e107 directories using this method</li>
-	<li>There are some security settings that you can change from your admin area. Go to the preferences page and you'll see a section marked Security</li>
-</ul>
-<br />
-
-
-
-
-
-
-<a name='#problems'></a><span class="headertext">Common Problems</span><br /><br />
-<ul>
-	<li>If for any reason you get a critical error message concering your core settings, you can easily reset them to default using the resetcore utility. You can find this in your e107_files folder, use your web browser to navigate to http://<i>yourwebspace.com/</i>resetcore.php and follow the instructions. This will not affect any content on your site, it will merely reset your core settings, so your site theme etc will revert to default. You can make a backup of your core at any time and restore this from the resetcore utility, to backup your core go to your admin section, click on Database ten click on Backup Core</li>
-	<li>If after installing e107 you get a blank page, check your error_reporting level in your php.ini file. This is generally caused by an error on your site not being reported because your error reporting is set too low, or turned off completely. If you don't have access to your php.ini contact your web host</li>
-	<li>If you are seeing Undefined Variable or Notice errors on your site, your error_reporting is set too high. Make sure it's set to E_ERROR | E_WARNING | E_PARSE in your php.ini, again if you don't have access contact your web hosts and ask them to change it</li>
-</ul>
-<br />
-
-<a name='#support'></a><span class="headertext">Support</span><br /><br />
-All these places are very friendly, please dont hesitate to use them even if you think your question is trivial, you'll get a polite reply.
-<ul>
-	<li><b>e107 forums</b></br >
-	<a href='http://e107.org/forum.php'>http://e107.org/forum.php</a></li>
-	<li><b>e107 faq</b></br >
-	<a href='http://e107faq.bkwon.net'>http://e107faq.bkwon.net</a></li>
-	<li><b>IRC channel</b><br />
-	#e107 on <a href='irc://freenode.net'>irc.freenode.net</a></li><br />
-	<li><b>Third party plugin support: e107coders</b><br />
-	<a href='http://e107coders.org'>http://e107coders.org/</a></li><br />
-	<li><b>Third party theme support: e107themes</b><br />
-	<a href='http://e107themes.org'>http://e107themes.org/</a></li><br />
-</ul>
-<br />
-
-
-<a name='#development'></a><span class="headertext">Development</span><br /><br />
-e107 has been tested under Apache versions 1 and 2, and under IIS webservers.<br />
-It is developed by the e107 dev team (McFly, Cameron, Lolo, Chavo and Vilhelm).<br />
-( If you have made changes to the core you think might benefit others please email them to us at <a href='mailto:chavo@2sdw.com'>chavo@2sdw.com</a> and we'll consider adding your changes. }<br /><br /><br />
-
-
-<a name='#thankyou'></a><span class="headertext">Thank you</span><br /><br />
-<ul>
-	<li>Thanks first to jalist for starting this whole thing out and sticking with it for so long. </li>
-	<li>Thanks mainly to Terrence, Damon, que, nalenb, Dawn, HeX0R, JuhaH, bkwon, Knight, Aldrin for their unstinting support.</li>
-	<li>Also to everyone else who has assisted and submitted translations/fixes etc</li>
-	<li>Thanks to CraHan, NeXTer, Kuhndog, wols, [steev], rootrider, Claymore, demigod, maaneeack, Schmots, dreamer, galois and the others in [#ls.g] for their friendship.</li>
-	<li>Thanks to Jrme C. Meijers and Craig Bramscher</li>
-	<li>e107.net for donated hosting</li>
-	<li>Thanks to all of you who have taken the time to create plugins/themes/hacks, answer questions in the forums and IRC channel etc. We have a wonderful community here and it's because of people like you.</li>
-	<li>And thanks to you for trying e107, I hope you like it and it fits your website needs. If it doesn't try <a href='http://opensourcecms.com'>OpenSourceCMS</a> for a full list of alternative systems.</li>
-	<li>A couple of third-party scripts have been integrated into e107 to make your life easier, so thankyou to ...
-	<ul>
-		<li>InteractiveTools (<a href='http://interactivetools.com'>http://interactivetools.com</a>) for HTMLArea</li>
-		<li>Mihai Bazon (<a href='http://dynarch.com/mishoo/home.epl'>http://dynarch.com/mishoo/home.epl</a>) for the calendar widget</li>
-	</ul>
-	Both these scripts are released under the GPL license and as stated the copyright information has been left intact in the scripts themselves, if you want to use these scripts in your own code you must abide by the GPL license.</li>
-</ul>
-</br >
-
-<a name='#disclaimer'></a><span class="headertext">Disclaimer</span><br /><br />
-This software is free and as such comes without warranty as stated in the GNU GPL License v2 (included in this package). Any problems encountered due to deficiancies in this software is not the responsibility of the author.
-</br >
-
-</div>
-
-</body>
-</html>
\ No newline at end of file
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<!-- Version Info:
+
+$Source: /cvsroot/e107/e107_0.7/e107_docs/README.html,v $
+$Revision: 1.9 $
+$Date: 2006/01/16 16:38:00 $
+$Author: sweetas $
+
+-->
+<title>e107 Readme</title>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="content-style-type" content="text/css" />
+</head>
+<body>
+<div id='mainbox'> <a href="http://e107.org"><img src="../e107_images/logo.png" alt="Logo" style="border:0" /></a> <br />
+  <br />
+  <span class="smalltext">© Steve Dunstan 2002. See gpl.txt for license details.</span><br />
+  <br />
+  <br />
+  <a href="#requirements">Requirements</a> | <a href="#installing">Installing</a> | <a href="#upgrading">Upgrading</a> | <a href="#security">Security</a> | <a href="#backup">Backing Up and Restoring Your Database</a> | <a href="#problems">Common Problems</a> | <a href="#support">Support</a> | <a href="#development">Development</a> | <a href="#thankyou">Thank You</a> | <a href="#disclaimer">Disclaimer</a><br />
+  <br />
+  <br />
+  <a id='requirements' name='requirements'></a><span class="headertext">Requirements</span>
+  <ul>
+    <li>e107 requires a webserver that has PHP 4.3 (or newer) and MySQL 3.22 (or newer), contact your host if you're not sure if you have these installed.</li>
+    <li>If you host your own site you can download <a href="http://php.net">PHP</a> and <a href="http://mysql.com">MySQL</a> and install them yourself, both are free.</li>
+    <li>You will need your MySQL username and password, and a database for content storage. Don't worry if you only have one database, e107 is happy to share it's database with other applications.</li>
+    <li>A complete e107 install requires approximately 9MB of disk space on your server, although this should be reduced dramatically for most users by removing the plugins and themes they won't be using, simply by removing the relevent folder.</li>
+  </ul>
+  <br />
+  <a id='installing' name='installing'></a><span class="headertext">Installing</span>
+  <ul>
+    <li>After downloading and unzipping the package, you need to upload the files to your server using an FTP client. e107 will happily run in your webserver root or in a sub-directory ... <br />
+      <ul>
+        <li>Open your FTP client and connect to your webserver</li>
+        <li>Move into the folder on your webserver where web pages are stored, generally it's 'public_html', 'www' or 'html'</li>
+        <li>Copy all the files from the unzipped e107 package onto your webserver - this could take a while, time for a cup of coffee!<br />
+        </li>
+      </ul>
+    </li>
+    <li>If you have the correct permissions on your server you can use an alternative (and much quicker) method to upload the files ... <br />
+      <ul>
+        <li>Download e107 in tar.gz format from <a href='http://e107.org'>e107.org</a></li>
+        <li>Using your FTP client, upload the tar.gz to your webserver without unzipping it first</li>
+        <li>Now open a shell prompt, and navigate to the folder where you uploaded the e107 tar.gz</li>
+        <li>type tar xvzf file.tar.gz to unpack the archive</li>
+      </ul>
+    </li>
+  </ul>
+  <ul>
+    <li>You now need to set the file permissions of some files for e107 to access them correctly. Set the file permissions to 0777 (readable writable by the server), if a series of checkboxes appear tick every box. Here is a list of the files you need to ensure the server can read / write to...<br /><br />
+      <ul>
+        <li>e107_config.php</li>
+        <li>e107_files/public/</li>
+        <li>e107_files/cache/</li>
+        <li>e107_files/public/avatars/</li>
+        <li>e107_plugins/</li>
+        <li>e107_themes/</li>
+      </ul>
+    </li>
+  </ul>
+  <ul>
+    <li>Now open your web browser and navigate to install.php, for example <i>http://yourwebspace.com/install.php</i> or <i>http://yourwebspace.com/e107/install.php</i><br />
+      </i></li>
+    <ul>
+      <li>If all the files have been uploaded successfully, you will see the first page of the install script. Choose the language you wish to use during the procedure and click the button to continue</li>
+      <li>e107 will now carry out a series of tests to see if requirements are met and all files that need permissions set are ok to be written to. If you get a warning about MySQL don't worry too much, some versions of MySQL don't return the correct version, or return nothing at all. Click on the button to continue if all criteria has been met, or else repair the prblem and retest. </li>
+      <li>Next you have to enter your MySQL details. Enter your server name (generally 'localhost'), username and password. If you don't know your username and/or password contact your webhosts. Now enter the name of the database ou want e107 to use. If you have the correct permissions you can create the database directly from the install script should you want to</li>
+      <li>If all is well e107 should now connect to your MySQL database, if any error messages are shown return to the previous page and make sure you entered your details correctly</li>
+      Now you have to enter your main admin details. Enter your username, password and email address, you can change your email address and password at a later stage but your username cannot be changed, so make sure you enter it correctly
+      </li>
+      <li>e107 will now create the MySQL database tables and populate them with settings etc</li>
+      <li>If all is well, the last button will take you to your new website. There, all done, that wasn't too bad was it?!</li>
+    </ul>
+    </li>
+  </ul>
+  <ul>
+    <li>You must now set the file permissions of the main config file back to 0644 ...<br />
+    </li>
+    <ul>
+      <li>Using your FTP client, select the e107_config.php file</li>
+      <li>Set its file permission (using the method explained above) to 0644</li>
+    </ul>
+    </li>
+    <li><b>Now delete the install.php file, and the e107_install folder from your server, if you do not they could pose a potential security risk to your site</b></li>
+  </ul>
+  <br />
+  <br />
+  <a id='upgrading' name='upgrading'></a><span class="headertext">Upgrading</span><br />
+  <br />
+  <a href='README_UPGRADE.html'>Please click here for instructions on upgrading your 0.6175 website to 0.7.</a>
+  <br /><br /><br />
+  <a id='backup' name='backup'></a><span class="headertext">Using phpMyAdmin to backup your database</span><br />
+  <br />
+  <ul>
+    <li>First, navigate to your phpMyAdmin page and log in</li>
+    <li>From the dropdown box on the left (or the text link) click on your e107 database</li>
+    <li>In the main page, click on the 'Export' tab</li>
+    <li>In the right box, make sure 'Add drop table', 'Add AUTO_INCREMENT value' and 'Enclose table and field names with backquotes' are ticked</li>
+    <li>Make sure the main 'Structure' and 'Data' boxes are ticked</li>
+    <li>Tick 'Save as file'</li>
+    <li>If you want the backup file compressed, tick either 'zipped' or 'gzipped'</li>
+    <li>Click 'Go'</li>
+  </ul>
+  <ul>
+    <li>To restore a backup, Click on the 'SQL' tab at the top and browse to your backup, you may need to empty your existing database before you can restore the backup</li>
+  </ul>
+  <br />
+  <a id='security' name='security'></a><span class="headertext">Security</span><br />
+  <br />
+  Security has been a primary concern since the first released versions of e107, and for this reason there are some very easy measures you can take to make your site more secure ...
+  <ul>
+    <li>Rename your e107_admin directory: this will make it less obvious to other e107 users where your admin files are.</li>
+    <br />
+    <br />
+    <li><strong>The procedure to change your directory names has changed. The definitions have been moved to e107_config.php.</strong></li>
+    <br />
+    <br />
+    <li>If you are <b><u>UPGRADING</u></b> from a very old version of e107 (e.g. less than v.615), you will need to open class2.php and find the following lines.</li>
+    <br />
+    <br />
+    <div class='indent'> // If you need to change the names of any of your directories, change the value here then rename the respective folder on your server ...<br />
+      $ADMIN_DIRECTORY = "e107_admin/";<br />
+      $FILES_DIRECTORY = "e107_files/";<br />
+      $IMAGES_DIRECTORY = "e107_images/";<br />
+      $THEMES_DIRECTORY = "e107_themes/";<br />
+      $PLUGINS_DIRECTORY = "e107_plugins/";<br />
+      $HANDLERS_DIRECTORY = "e107_handlers/";<br />
+      $LANGUAGES_DIRECTORY = "e107_languages/";<br />
+      $HELP_DIRECTORY = "e107_docs/help/";<br />
+      $DOWNLOADS_DIRECTORY = "e107_files/downloads/";</div>
+    <br />
+    <li>Cut these lines from <u>class2.php</u> and paste them into <u>e107_config.php</u>. Now you can change the folder names from here.</li>
+    <br />
+    <br />
+    <li>If this is a <b><u>NEW INSTALL</u></b> the folder names are already in e107_config.php. They have been left in class2.php for backwards compatibility. They will be removed from there in the future.</li>
+    <br />
+    <br />
+    <li>This procedure depends on you completing the steps above and making sure the file paths are located in e107_config.php now.</li>
+    <li>To rename your e107_admin directory (or any of your other directories), first rename the folder in the usual manner using your FTP client. Then open e107_config.php from the root directory of your e107 installation in a text editor, and find the following line near the top of the file ...<br />
+      <i>$ADMIN_DIRECTORY = "e107_admin/";</i><br />
+      ... and change <i>e107_admin/</i> to the name you've renamed it on your server </li>
+    <li>You can change the name of all your e107 directories using this method</li>
+    <li>There are some security settings that you can change from your admin area. Go to the preferences page and you'll see a section marked Security</li>
+  </ul>
+  <br />
+  <a id='problems' name='problems'></a><span class="headertext">Common Problems</span><br />
+  <br />
+  <ul>
+    <li>If for any reason you get a critical error message concering your core settings, you can easily reset them to default using the resetcore utility. You can find this in your e107_files folder, use your web browser to navigate to http://yoursite.com/e107_files/resetcore/resetcore.php and follow the instructions. This will not affect any content on your site, it will merely reset your core settings, so your site theme etc will revert to default. You can make a backup of your core at any time and restore this from the resetcore utility, to backup your core go to your admin section, click on Database ten click on Backup Core</li>
+    <li>If after installing e107 you get a blank page, check your error_reporting level in your php.ini file. This is generally caused by an error on your site not being reported because your error reporting is set too low, or turned off completely. If you don't have access to your php.ini contact your web host</li>
+    <li>If you are seeing Undefined Variable or Notice errors on your site, your error_reporting is set too high. Make sure it's set to E_ERROR | E_WARNING | E_PARSE in your php.ini, again if you don't have access contact your web hosts and ask them to change it</li>
+  </ul>
+  <br />
+  <a id='support' name='support'></a><span class="headertext">Support</span><br />
+  <br />
+  All these places are very friendly, please dont hesitate to use them even if you think your question is trivial, you'll get a polite reply.
+  <ul>
+    <li><b>e107 forums</b></br >
+      <a href='http://e107.org/forum.php'>http://e107.org/forum.php</a></li>
+    <li><b>e107 faq</b></br >
+      <a href='http://e107faq.bkwon.net'>http://e107faq.bkwon.net</a></li>
+    <li><b>IRC channel</b><br />
+      #e107 on <a href='irc://freenode.net'>irc.freenode.net</a></li>
+    <br />
+    <li><b>Third party plugin support: e107coders</b><br />
+      <a href='http://e107coders.org'>http://e107coders.org/</a></li>
+    <br />
+    <li><b>Third party theme support: e107styles | e107themes</b><br />
+      <a href='http://e107styles.org'>http://e107styles.org/</a> | <a href='http://e107themes.org'>http://e107themes.org/</a></li>
+  </ul>
+  <p><br />
+    <a id='development' name='development'></a><span class="headertext">Development</span><br />
+    <br />
+    e107 has been tested, and developed on Apache 1 and 2, IIS, and PHP 4.3+ (Including 5.0).<br />
+    It is developed by the e107 dev team (Jalist, McFly, Cameron, Streaky, SweetAs, Asperon, Que, Lolo, Chavo, Lisa, MrPete).<br />
+    <br />
+    If you have made changes to the core you think might benefit others please let us know about them in the forums at e107.org :)<br />
+    <br />
+    <br />
+    <a id='thankyou' name='thankyou'></a><span class="headertext">Thank you</span><br />
+    <br />
+    Thanks first to jalist for starting this whole thing out and sticking with it for so long. </p>
+  <ul>
+    <li>Thanks mainly to Terrence, Damon, que, nalenb, Dawn, HeX0R, JuhaH, bkwon, Knight, Aldrin for their unstinting support.</li>
+    <li>Also to everyone else who has assisted and submitted translations/fixes etc</li>
+    <li>Thanks to CraHan, NeXTer, Kuhndog, wols, [steev], rootrider, Claymore, demigod, maaneeack, Schmots, dreamer, galois and the others in [#ls.g] for their friendship.</li>
+    <li>Thanks to Jérôme C. Meijers and Craig Bramscher</li>
+    <li>e107.net for donated hosting</li>
+    <li>Thanks to all of you who have taken the time to create plugins/themes/hacks, answer questions in the forums and IRC channel etc. We have a wonderful community here and it's because of people like you.</li>
+    <li>And thanks to you for trying e107, I hope you like it and it fits your website needs. If it doesn't try <a href='http://opensourcecms.com'>OpenSourceCMS</a> for a full list of alternative systems.</li>
+    <li>A couple of third-party scripts have been integrated into e107 to make your life easier, so thankyou to ...<br />
+      <ul>
+    <li>MagpieRSS (<a href='http://magpierss.sourceforge.net'>http://magpierss.sourceforge.net</a>) MagpieRSS provides an XML-based (expat) RSS parser in PHP.</li>
+	<li>PCLZip (<a href='http://www.phpconcept.net/pclzip/'>http://www.phpconcept.net/pclzip/</a>) PclZip library offers compression and extraction functions for Zip formatted archives (WinZip, PKZIP).</li>
+	<li>PCLTar (<a href='http://www.phpconcept.net/pcltar/'>http://www.phpconcept.net/pcltar/</a>) PclTar offer the ability to archive a list of files or directories with or without compression. The archives created by PclTar are readeable by most of gzip/tar applications and by the Windows WinZip application.</li>
+	<li>TinyMCE (<a href='http://tinymce.moxiecode.com'>http://tinymce.moxiecode.com</a>) TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</li>
+	<li>Nuvolo Icons (<a href='http://www.icon-king.com'>http://www.icon-king.com</a>) Icons used in e107</li>
+	<li>PHPMailer (<a href='http://phpmailer.sourceforge.net'>http://phpmailer.sourceforge.net</a>) Full featured email transfer class for PHP</li>
+	<li>Brainjar DHTML Menu (<a href='http://www.brainjar.com/dhtml/menubar/'>http://www.brainjar.com/dhtml/menubar/</a>) Menu system used in several themes</li>
+	<li>DHTML / JavaScript Calendar (<a href='http://www.dynarch.com/projects/'>http://www.dynarch.com/projects/</a>) Popup calendar widget</li>
+	<li>FPDF (<a href='http://www.fpdf.org'>http://www.fpdf.org</a>) PDF support</li>
+	<li>UFPDF (<a href='http://www.acko.net/node/56'>http://www.acko.net/node/56</a>) UTF-8 PDF support</li>
+      </ul>
+      <br />
+      Both these scripts are released under the GPL license and as stated the copyright information has been left intact in the scripts themselves, if you want to use these scripts in your own code you must abide by the GPL license.</li>
+  </ul>
+  </br >
+  <a id='disclaimer' name='disclaimer'></a><span class="headertext">Disclaimer</span><br />
+  <br />
+  This software is free and as such comes without warranty as stated in the GNU GPL License  (included in this package). Any problems encountered due to deficiancies in this software is not the responsibility of the author. </br >
+</div>
+</body>
+</html>
diff -ruN 6171/e107_docs/README_UPGRADE.html 75/e107_docs/README_UPGRADE.html
--- 6171/e107_docs/README_UPGRADE.html	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_docs/README_UPGRADE.html	2006-01-16 10:38:32.000000000 -0600
@@ -0,0 +1,150 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<!-- Version Info:
+
+$Source: /cvsroot/e107/e107_0.7/e107_docs/README_UPGRADE.html,v $
+$Revision: 1.2 $
+$Date: 2006/01/16 16:38:32 $
+$Author: sweetas $
+
+-->
+<title>e107 Readme</title>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="content-style-type" content="text/css" />
+</head>
+<body>
+<div id='mainbox'> <a href="http://e107.org"><img src="../e107_images/logo.png" alt="Logo" style="border:0" /></a> <br />
+  <br />
+  <span class="smalltext">© Steve Dunstan 2002. See gpl.txt for license details.</span><br />
+  <br />
+  <br />
+  <a id='upgrading' name='upgrading'></a><span class="headertext">Upgrading</span><br />
+  <br />
+0.6175 -> .7 Upgrade Guide
+<pre>
+e107 has undergone a lot of changes from .617 to .7 and bkwon has compiled a comprehensive list of these over
+at click to open link in new window .
+
+Essential Points
+
+    * If you are upgrading an English site from .617 you will need the seperate English iso-8859-1 language pack, as the
+      default core English language pack is now in the UTF character set. If you do not do this some characters in your
+      database content will display corrupted.
+    * If your .617 site is non English you will need to make sure the .7 lan pack in your language is both available and in the same 
+      character set as your current .617 language pack. If it is not in the same character set as your original,
+      some characters in your content, if not all, will display corrupted.
+    * The plugins you currently use on your .617 site may not work with .7 so you must check this before upgrading your site.
+    * .7 is almost a complete rewrite of .617 and so there are many database changes. For this reason it is essential
+      that you make a backup of your site using PhpMyAdmin or another third party SQL backup - do not use the e107 core
+      database backup system in e107 as this does not work. I know everyone always says you should backup - but for once this
+      time it's really meant as we will not be able to help you if you lose content or it gets corrupted and with such
+      heavy database changes this could be possible.
+
+
+Warning!
+There are files related to htmlArea, the WYSIWYG system in the 0.6xx branch of e107 that are known to be exploitable. These must be 
+removed immediately. Please delete the following directories and all their contents from your server:
+e107_handlers/htmlarea/
+e107_admin/htmlarea/
+
+Upgrade process
+
+   1. Download the .7 core zip and your required .7 language pack (English iso-8859-1 for English sites).
+   2. Login to your site and go to the admin area and set your maintenance flag to true (Admin => Maintenance).
+      This will close your site off to visitors whilst you perform the upgrade.
+   3. Check your database validity by using the tool located at Admin => Database => Check Database Validity. If you have
+      any errors do not continue with the upgrade process as these must be fixed first.
+   4. Go back to your admin area frontpage.
+   5. Extract the contents of the core zip and upload the files to your server - overwriting the existing .617 files.
+   6. Extract the contents of the language pack (in this release its just one file - English.php) and upload the file(s) to 
+      your server - overwriting the existing one(s).
+   7. Refresh your admin front page in your browser and you will see an update available button appear.
+      Click this to take to you to the update page (Alternatively you can reach the update page through Admin =>Database => 
+      Check For Updates).
+   8. Click the .617 to .7 core update button. This will run the first step in the upgrade process.
+      When it finishes you will see several new buttons appear for the upgrade routines for forum, content
+      and statistics. Even if you do not use these e107 features, run each update anyway.
+   9. Once all updates have been processed you should no longer have buttons on the updates page and you have completed
+      the upgrade process.
+  10. Go back to the database validity tool and check once again that everything passes ok.
+
+
+
+You may notice some e107 elements have gone missing - forum, chatbox, content, links, etc... well dont worry
+they haven't really! A large part of the e107 core has been 'pluginfied' and you will find all these elements are
+now stand alone plugins and can be located under Admin => Plugins. A point to note with links is that your existing
+links page links have been seperated from the main 'site links' and the upgrade routine has moved them to the new
+links page plugin.
+
+Reviews, articles and content have also been pluginfied and incorporated into one plugin called 'Content Management'.
+If you used any of these features in 0.6xx or will be wanting to use this new plugin for new content, you will need to
+change some additional directory permissions for the new plugin. Please see the relevant entry regards this under
+'Permissions'.
+
+Version .7 comes with a new theme, Jayya, which has been designed for the admin area of the site and is intended to
+make administration more user friendly, implementing several new features for this job. If you would like to try it
+out, go to Admin => Theme Manager and change the admin area theme to 'Jayya'.
+
+Because of the huge number of changes in .7 and on the basis its an almost total rewrite, there may be some
+problems when you upgrade. If you find a specific bug please post this in the bugtracker here on e107.org so that
+we may fix the issue in the next release of the system. Thanks.
+
+Permissions: Core
+The following permissions should be set for using e107 core (most of these will have already been set this way
+from your previous 0.6xx install):
+
+chmod 777: e107_themes/
+chmod 777: e107_plugins/
+chmod 777: e107_files/public/
+chmod 777: e107_files/public/avatars/
+chmod 777: e107_files/cache/
+
+Permissions: Plugins
+The following permissions will need to be set if you were using statistics in your 0.6xx site or wish to use the new
+Statistic Logging plugin at some point in the future:
+
+chmod 777: e107_plugins/log/logs/
+
+The following permissions will need to be set if you were using the links page in your 0.6xx site or wish to use the new
+links page plugin at some point in the future:
+
+chmod 777: e107_plugins/links_page/cat_images/
+chmod 777: e107_plugins/links_page/link_images/
+
+The following permissions will need to be set if you were using Reviews / Articles or Content in your 0.6xx site or
+wish to use the new Content Management plugin at some point in the future:
+
+chmod 777: e107_plugins/content/images/cat/
+chmod 777: e107_plugins/content/images/cat/16/
+chmod 777: e107_plugins/content/images/cat/48/
+chmod 777: e107_plugins/content/images/file/
+chmod 777: e107_plugins/content/images/file/tmp/
+chmod 777: e107_plugins/content/images/icon/
+chmod 777: e107_plugins/content/images/icon/tmp/
+chmod 777: e107_plugins/content/images/image/
+chmod 777: e107_plugins/content/images/image/tmp/
+chmod 777: e107_plugins/content/menus/
+
+
+Troubleshooting
+If you have any problems with the upgrade such as being locked out of your site please clear your cache by deleting
+the php files in e107_files/cache/.
+
+CVS Users
+If you have upgraded your 0.6xx install to 0.7 using a CVS nightly build or downloading directly from the CVS 
+repository, you need to check what character set you are currently using. You will find this information displayed 
+on your admin area front page under the 'Site Info' menu where it says 'Charset'. If under Charset it says you are 
+using 'utf-8' then you need only download the main core zip and upgrade with that. Your charset is the default that 
+0.7 runs with and so is included in the main zip. However, if the Charset says iso-8859-1 and you run an English site 
+then you must download the seperate English iso-8858-1 language pack alongside the main core zip and overwrite the 
+language files in the core zip with those you find in the iso-8858-1 zip. For non English sites make sure to get your 
+language in the same Charset as is listed on the admin area frontpage under Site Info.
+</pre>
+  <a id='disclaimer' name='disclaimer'></a><span class="headertext">Disclaimer</span><br />
+  <br />
+  This software is free and as such comes without warranty as stated in the GNU GPL License  (included in this package). Any problems encountered due to deficiancies in this software is not the responsibility of the author. </br >
+</div>
+</body>
+</html>
diff -ruN 6171/e107_docs/style.css 75/e107_docs/style.css
--- 6171/e107_docs/style.css	2004-05-17 13:37:12.000000000 -0500
+++ 75/e107_docs/style.css	2005-06-11 15:23:22.000000000 -0500
@@ -1,38 +1,40 @@
-body {
-	color: #000;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	background-color: #D1CFCF;
-}
-a {
-	color: #035479; 
-	text-decoration: none;
-}
-a:hover {
-	color: #DC6504;
-	text-decoration: none;
-}
-
-.mainbox {
-	border: 1px solid #879397;
-	background-color: #fff;
-	color: #000;
-	padding: 10px;
-}
-
-.smalltext {
-	color: #000;
-	font: 10px verdana, tahoma, arial, sans-serif;
-}
-
-.headertext {
-	color: #DC6504;
-	font: 16px verdana, tahoma, arial, sans-serif;
-	font-weight: bold;
-}
-
-.indent {
-	border: 1px solid #D1CFCF;
-	background-color: #efefef;
-	color: #000;
-	padding: 10px;
+body {
+	color: #000;
+	font: 12px tahoma, arial, sans-serif;
+	background-color: #767E8F;
+	padding: 8px 8px 8px 8px;
+	margin: 0px 0px 0px 0px;
+}
+a {
+	color: #035479; 
+	text-decoration: none;
+}
+a:hover {
+	color: #DC6504;
+	text-decoration: none;
+}
+
+#mainbox {
+	border: 2px solid #000000;
+	background-color: #fff;
+	color: #000;
+	padding: 30px;
+}
+
+.smalltext {
+	color: #000;
+	font: 12px verdana, tahoma, arial, sans-serif;
+}
+
+.headertext {
+	color: #DC6504;
+	font: 16px verdana, tahoma, arial, sans-serif;
+	font-weight: bold;
+}
+
+.indent {
+	border: 1px solid #D1CFCF;
+	background-color: #efefef;
+	color: #000;
+	padding: 10px;
 }
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/b.bb 75/e107_files/bbcode/b.bb
--- 6171/e107_files/bbcode/b.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/b.bb	2004-09-24 21:19:43.000000000 -0500
@@ -0,0 +1 @@
+return "<strong class='bbcode'>$code_text</strong>";
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/blockquote.bb 75/e107_files/bbcode/blockquote.bb
--- 6171/e107_files/bbcode/blockquote.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/blockquote.bb	2005-12-24 20:14:43.000000000 -0600
@@ -0,0 +1 @@
+return "<div class='indent'>{$code_text}</div>";
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/br.bb 75/e107_files/bbcode/br.bb
--- 6171/e107_files/bbcode/br.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/br.bb	2005-12-24 20:14:43.000000000 -0600
@@ -0,0 +1 @@
+return '<br />';
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/center.bb 75/e107_files/bbcode/center.bb
--- 6171/e107_files/bbcode/center.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/center.bb	2005-12-24 20:14:43.000000000 -0600
@@ -0,0 +1 @@
+return "<div style='text-align:center'>$code_text</div>";
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/code.bb 75/e107_files/bbcode/code.bb
--- 6171/e107_files/bbcode/code.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/code.bb	2006-05-17 07:03:13.000000000 -0500
@@ -0,0 +1,37 @@
+global $pref, $e107cache, $tp;
+
+if($pref['smiley_activate']) {
+	$code_text = $tp->e_emote->filterEmotesRev($code_text);
+}
+
+$search = array(E_NL,'&#092;','&#036;', '&lt');
+$replace = array("\r\n","\\",'$', '<');
+$code_text = str_replace($search, $replace, $code_text);
+
+if($pref['useGeshi'] && file_exists(e_PLUGIN."geshi/geshi.php")) {
+
+	$code_md5 = md5($code_text);
+	if(!$CodeCache = $e107cache->retrieve('GeshiParsed_'.$code_md5)) {
+		require_once(e_PLUGIN."geshi/geshi.php");
+		if($parm) {
+			$geshi = new GeSHi($code_text, $parm, e_PLUGIN."geshi/geshi/");
+		} else {
+			$geshi = new GeSHi($code_text, ($pref['defaultLanGeshi'] ? $pref['defaultLanGeshi'] : 'php'), e_PLUGIN."geshi/geshi/");
+		}
+		$geshi->set_encoding(CHARSET);
+		$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
+		$geshi->set_header_type(GESHI_HEADER_DIV);
+		$CodeCache = $geshi->parse_code();
+		$e107cache->set('GeshiParsed_'.$code_md5, $CodeCache);
+	}
+	$ret = "<div class='code_highlight'>".str_replace("&amp;", "&", $CodeCache)."</div>";
+}
+else
+{
+	$code_text = html_entity_decode($code_text, ENT_QUOTES, CHARSET);
+	$highlighted_text = highlight_string($code_text, TRUE);
+	$divClass = ($parm) ? $parm : 'code_highlight';
+	$ret = "<div class='".$tp -> toAttribute($divClass)."'>{$highlighted_text}</div>";
+}
+$ret = str_replace("[", "&#091;", $ret);
+return $ret;
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/color.bb 75/e107_files/bbcode/color.bb
--- 6171/e107_files/bbcode/color.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/color.bb	2006-04-17 09:59:33.000000000 -0500
@@ -0,0 +1,38 @@
+$aColors = array(
+"black" => "#000000",
+"blue" => "#0000FF",
+"brown" => "#A52A2A",
+"cyan" => "#00FFFF",
+"darkblue" => "#00008B",
+"darkred" => "#8B0000",
+"green" => "#008000",
+"indigo" => "#4B0082",
+"olive" => "#808000",
+"orange" => "#FFA500",
+"red" => "#FF0000",
+"violet" => "#EE82EE",
+"white" => "#FFFFFF",
+"yellow" => "#FFFF00",
+"aqua" => "#00FFFF",
+"fuchsia" => "#FF00FF",
+"gray" => "#808080",
+"lime" => "#00FF00",
+"maroon" => "#800000",
+"navy" => "#000080",
+"purple" => "#800080",
+"silver" => "#C0C0C0",
+"teal" => "#008080"
+);
+
+if(array_key_exists($parm, $aColors))
+{
+	return "<span style='color:{$aColors[$parm]}'>$code_text</span>";
+}
+else
+{
+	if(preg_match("/(#[a-fA-F0-9]{3,6})/", $parm, $matches))
+	{
+		return "<span style='color:{$matches[1]}'>$code_text</span>";
+
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/email.bb 75/e107_files/bbcode/email.bb
--- 6171/e107_files/bbcode/email.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/email.bb	2006-02-10 09:31:51.000000000 -0600
@@ -0,0 +1,5 @@
+if ($parm) {
+	return "<a href='mailto:".$tp -> toAttribute($parm)."'>".$code_text."</a>";
+} else {
+	return "<a href='mailto:".$tp -> toAttribute($code_text)."'>".$code_text."</a>";
+}
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/file.bb 75/e107_files/bbcode/file.bb
--- 6171/e107_files/bbcode/file.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/file.bb	2006-03-18 08:59:48.000000000 -0600
@@ -0,0 +1,14 @@
+global $pref, $fromadmin;
+if (array_key_exists('forum_attach', $pref) && $pref['forum_attach'] && FILE_UPLOADS || ADMIN || $fromadmin)
+{
+	$image = (file_exists(THEME."generic/file.png") ? THEME."generic/file.png" : e_IMAGE."generic/".IMODE."/file.png");
+	list($fname, $uc) = explode("^", $parm);
+	if(isset($uc))
+	{
+		if(!check_class($uc))
+		{
+			return;
+		}
+	}
+	return "<br /><a href='".$tp -> toAttribute($fname)."'><img src='".$image."' alt='' style='border:0; vertical-align:middle' /></a> <a href='".$tp -> toAttribute($fname)."'>".$code_text."</a>";
+}
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/flash.bb 75/e107_files/bbcode/flash.bb
--- 6171/e107_files/bbcode/flash.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/flash.bb	2006-02-16 11:14:09.000000000 -0600
@@ -0,0 +1,21 @@
+// USAGE: [flash=width,height]http://www.example.com/file.swf[/flash]
+
+$movie_path   = "http://".eregi_replace("http://", "",$code_text);
+$movie_path   = $tp -> toAttribute($movie_path);
+
+$parm_array   = explode(",",$parm);
+
+$width_type   = strpos($parm_array[0], "%") !== FALSE ? "%" : "px";
+$height_type  = strpos($parm_array[1], "%") !== FALSE ? "%" : "px";
+
+$width_value  = ereg_replace("[^0-9]","",$parm_array[0]);
+$height_value = ereg_replace("[^0-9]","",$parm_array[1]);
+
+$width_value  = $width_value  ? $width_value.$width_type   : "50px";
+$height_value = $height_value ? $height_value.$height_type : "50px";
+
+return "<object type='application/x-shockwave-flash' data='$movie_path' width='$width_value' height='$height_value'>
+		<param name='movie'   value='$movie_path' />
+		<param name='quality' value='high' />
+		<param name='allowscriptaccess' value='samedomain' />
+		</object>";
diff -ruN 6171/e107_files/bbcode/hide.bb 75/e107_files/bbcode/hide.bb
--- 6171/e107_files/bbcode/hide.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/hide.bb	2006-02-03 13:57:50.000000000 -0600
@@ -0,0 +1,24 @@
+global $sql, $e_hide_query, $e_hide_hidden, $e_hide_allowed;
+
+if(!$e_hide_allowed || !isset($e_hide_query) || !$sql->db_Select_gen($e_hide_query))
+{
+	if(defined('HIDE_TEXT_HIDDEN'))
+	{
+		return "<div class='".HIDE_TEXT_HIDDEN."'>{$e_hide_hidden}</div>";
+	}
+	else
+	{
+		return "<div style='border:solid 1px;padding:5px'>{$e_hide_hidden}</div>";
+	}
+}
+else
+{
+	if(defined('HIDE_TEXT_SHOWN'))
+	{
+		return "<div class='".HIDE_TEXT_SHOWN."'>$code_text</div>";
+	}
+	else
+	{
+		return "<div style='border:solid 1px;padding:5px'>$code_text</div>";
+	}
+}
diff -ruN 6171/e107_files/bbcode/html.bb 75/e107_files/bbcode/html.bb
--- 6171/e107_files/bbcode/html.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/html.bb	2006-02-24 11:14:22.000000000 -0600
@@ -0,0 +1,3 @@
+//$code_text = str_replace("\r\n", " ", $code_text);
+//$code_text = html_entity_decode($code_text, ENT_QUOTES, CHARSET);
+return $code_text;
diff -ruN 6171/e107_files/bbcode/i.bb 75/e107_files/bbcode/i.bb
--- 6171/e107_files/bbcode/i.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/i.bb	2004-09-24 21:20:00.000000000 -0500
@@ -0,0 +1 @@
+return "<em class='bbcode'>$code_text</em>";
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/img.bb 75/e107_files/bbcode/img.bb
--- 6171/e107_files/bbcode/img.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/img.bb	2006-04-05 07:19:19.000000000 -0500
@@ -0,0 +1,62 @@
+global $pref;
+if (preg_match("#\.php\?.*#",$code_text)){return "";}
+global $IMAGES_DIRECTORY, $FILES_DIRECTORY, $e107;
+$search = array('"', '{E_IMAGE}', '{E_FILE}');
+$replace = array('&#039;', $e107->base_path.$IMAGES_DIRECTORY, $e107->base_path.$FILES_DIRECTORY);
+$code_text = str_replace($search, $replace, $code_text);
+unset($imgParms);
+$imgParms['class']="bbcode";  
+$imgParms['alt']='';
+$imgParms['style']="vertical-align:middle; border:0";
+
+$code_text = $tp -> toAttribute($code_text);
+
+if($parm) {
+	$parm = preg_replace('#onerror *=#i','',$parm);
+	$parm = str_replace("amp;", "&", $parm);
+	parse_str($parm,$tmp);
+	foreach($tmp as $p => $v) {
+		$imgParms[$p]=$v;
+	}
+}
+$parmStr="";
+foreach($imgParms as $k => $v) {
+	$parmStr .= $tp -> toAttribute($k)."='".$tp -> toAttribute($v)."' ";
+}
+
+
+if(file_exists(e_IMAGE."newspost_images/".$code_text))
+{
+	$code_text = e_IMAGE."newspost_images/".$code_text;
+}
+
+if (!$postID) {
+	return "<img src='".$code_text."' {$parmStr} />";
+} else {
+	if(strstr($postID,'class:')) {
+		$uc = substr($postID,6);
+	}
+	if ($pref['image_post']) {
+		if($uc == '') {
+			if (!function_exists('e107_userGetuserclass')) {
+				require_once(e_HANDLER.'user_func.php');
+			}
+			$uc = e107_userGetuserclass($postID);
+		}
+		if (check_class($pref['image_post_class'],$uc)) {
+			return "<img src='".$code_text."' {$parmStr} />";
+		}
+		else
+		{
+			return ($pref['image_post_disabled_method'] ? "[ image disabled ]" : "Image: $code_text");
+		}
+	}
+	else
+	{
+		if ($pref['image_post_disabled_method']) {
+			return '[ image disabled ]';
+		} else {
+			return "Image: $code_text";
+		}
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/justify.bb 75/e107_files/bbcode/justify.bb
--- 6171/e107_files/bbcode/justify.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/justify.bb	2005-02-14 19:36:24.000000000 -0600
@@ -0,0 +1 @@
+return "<div style='text-align:justify'>$code_text</div>";
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/left.bb 75/e107_files/bbcode/left.bb
--- 6171/e107_files/bbcode/left.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/left.bb	2004-09-27 10:15:50.000000000 -0500
@@ -0,0 +1 @@
+return "<div style='text-align:left'>$code_text</div>";
diff -ruN 6171/e107_files/bbcode/link.bb 75/e107_files/bbcode/link.bb
--- 6171/e107_files/bbcode/link.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/link.bb	2006-02-17 13:13:54.000000000 -0600
@@ -0,0 +1,14 @@
+global $pref;
+
+$parm     = trim($parm);
+$external = ($pref['links_new_window'] || strpos($parm, 'external') === 0) ? " rel='external'" : "";
+
+if ($parm && $parm != 'external' && strpos($parm, ' ') === FALSE)
+{
+	$parm = preg_replace('#^external.#is', '', $parm);
+	return "<a href='".$tp -> toAttribute($parm)."'".$external.">".$code_text."</a>";
+}
+else
+{
+	return "<a href='".$tp -> toAttribute($code_text)."'".$external.">".$code_text."</a>";
+}
diff -ruN 6171/e107_files/bbcode/list.bb 75/e107_files/bbcode/list.bb
--- 6171/e107_files/bbcode/list.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/list.bb	2006-02-10 09:31:51.000000000 -0600
@@ -0,0 +1,48 @@
+
+
+/* Tag: unordered list [list]*line 1*line2*line 3*line 4*line5 etc[/list] */
+/* Tag: ordered list [list=<list type>]*line 1*line2*line 3*line 4*line5 etc[/list] */
+/* valid list types: 
+				disc
+				circle
+				square
+				decimal		1, 2, 3	(default)
+				lower-roman	i, ii, iii
+				upper-roman	I, II, III
+				lower-alpha	a, b, c
+				upper-alpha	A, B, C
+*/
+
+
+
+if(preg_match("#\[list\](.*?)\[/list\]#si", $full_text, $match))
+{
+	/* unordered list */
+	$listitems = explode("*", $match[1]);
+	$listtext = "<ul>";
+	foreach($listitems as $item)
+	{
+		if($item && $item != E_NL)
+		{
+			$listtext .= "<li>$item</li>";
+		}
+	}
+	$listtext .= "</ul>";
+	return $listtext;
+}
+else if(preg_match("#\[list=(.*?)\](.*?)\[/list\]#si", $full_text, $match))
+{
+	$type = $tp -> toAttribute($match[1]);
+	$listitems = $match[2];
+	$listitems = explode("*", $match[2]);
+	$listtext = "\n<ol style='list-style-type: $type'>";
+	foreach($listitems as $item)
+	{
+		if($item && $item != E_NL)
+		{
+			$listtext .= "<li>$item</li>";
+		}
+	}
+	$listtext .= "</ol>";
+	return $listtext;
+}
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/php.bb 75/e107_files/bbcode/php.bb
--- 6171/e107_files/bbcode/php.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/php.bb	2005-09-16 07:46:34.000000000 -0500
@@ -0,0 +1,4 @@
+$search = array("&quot;", "&#039;", "&#036;", "<br />", "[E_NL]", "-&gt;");
+$replace = array('"', "'", "$", "\n", "\n", "->");
+$code_text = str_replace($search, $replace, $code_text);
+return eval($code_text);
diff -ruN 6171/e107_files/bbcode/quote.bb 75/e107_files/bbcode/quote.bb
--- 6171/e107_files/bbcode/quote.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/quote.bb	2005-07-27 13:21:58.000000000 -0500
@@ -0,0 +1 @@
+return "<div class='indent'><em>$parm said</em> ...<br />$code_text</div>";
diff -ruN 6171/e107_files/bbcode/right.bb 75/e107_files/bbcode/right.bb
--- 6171/e107_files/bbcode/right.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/right.bb	2004-09-27 10:15:50.000000000 -0500
@@ -0,0 +1 @@
+return "<div style='text-align:right'>$code_text</div>";
diff -ruN 6171/e107_files/bbcode/size.bb 75/e107_files/bbcode/size.bb
--- 6171/e107_files/bbcode/size.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/size.bb	2006-02-10 09:31:51.000000000 -0600
@@ -0,0 +1,8 @@
+if(is_numeric($parm) && $parm > 0 && $parm < 38)
+{
+	return "<span style='font-size:{$parm}px'>$code_text</span>";
+}
+else
+{
+	return $code_text;
+}
diff -ruN 6171/e107_files/bbcode/spoiler.bb 75/e107_files/bbcode/spoiler.bb
--- 6171/e107_files/bbcode/spoiler.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/spoiler.bb	2006-05-06 14:22:33.000000000 -0500
@@ -0,0 +1,2 @@
+$spoiler_color = (defined("SPOILER_COLOR") ? SPOILER_COLOR : "#ff00ff");
+return "<span style='color:{$spoiler_color};background-color:{$spoiler_color}'>$code_text</span>";
diff -ruN 6171/e107_files/bbcode/stream.bb 75/e107_files/bbcode/stream.bb
--- 6171/e107_files/bbcode/stream.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/stream.bb	2006-03-01 07:13:07.000000000 -0600
@@ -0,0 +1,51 @@
+unset($stream_parms);
+
+if($parm)
+{
+	parse_str($parm,$tmp);
+	foreach($tmp as $p => $v)
+	{
+		$stream_parms[$p]=$v;
+	}
+}
+
+$stream_parms['autostart'] = isset($stream_parms['autostart']) ? $stream_parms['autostart'] : 'true';
+$stream_parms['showcontrols'] = isset($stream_parms['showcontrols']) ? $stream_parms['showcontrols'] : 'true';
+$stream_parms['showstatusbar'] = isset($stream_parms['showstatusbar']) ? $stream_parms['showstatusbar'] : 'true';
+$stream_parms['autorewind'] = isset($stream_parms['autorewind']) ? $stream_parms['autorewind'] : 'true';
+$stream_parms['showdisplay'] = isset($stream_parms['showdisplay']) ? $stream_parms['showdisplay'] : 'true';
+
+if (isset($stream_parms['width'])) {
+	$width = $stream_parms['width'];
+	unset($stream_parms['width']);
+} else {
+	$width = '320';
+}
+
+if (isset($stream_parms['height'])) {
+	$height = $stream_parms['height'];
+	unset($stream_parms['height']);
+} else {
+	$height = '360';
+}
+
+$parmStr="";
+foreach($stream_parms as $k => $v)
+{
+	$MozparmStr .= "<param name='".$tp -> toAttribute($k)."' value='".$tp -> toAttribute($v)."'>\n";
+	$IEparmStr .= $tp -> toAttribute($k)."='".$tp -> toAttribute($v)."' ";
+}
+
+$ret = "
+<object id='MediaPlayer' classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112' width='".$tp -> toAttribute($width)."' height='".$tp -> toAttribute($height)."'>\n";
+$ret .= "<param name='filename' value='".$tp -> toAttribute($code_text)."'>\n";
+$ret .= $MozparmStr;
+$ret .= "<embed src='".$tp -> toAttribute($code_text)."' width='".$tp -> toAttribute($width)."' height='".$tp -> toAttribute($height)."' id='mediaPlayer' name='mediaPlayer' {$IEparmStr}>
+</object>
+";
+
+return $ret;
+
+
+
+
diff -ruN 6171/e107_files/bbcode/textarea.bb 75/e107_files/bbcode/textarea.bb
--- 6171/e107_files/bbcode/textarea.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/textarea.bb	2006-02-10 09:31:51.000000000 -0600
@@ -0,0 +1,20 @@
+
+
+/* Tag: [textarea name=name&style=style&row=rows&whatever=whatever]value[/textarea] */
+
+
+$tastr = "";
+
+parse_str($parm, $tmp);
+
+foreach($tmp as $key => $p)
+{
+	$tastr .= $tp -> toAttribute($key)." = '".$tp -> toAttribute($p)."' ";
+}
+
+
+preg_match ("#\](.*?)\[/textarea#", $full_text, $match);
+$value = $match[1];
+
+return "<textarea $tastr>$value</textarea>";
+
diff -ruN 6171/e107_files/bbcode/time.bb 75/e107_files/bbcode/time.bb
--- 6171/e107_files/bbcode/time.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/time.bb	2005-06-01 14:49:24.000000000 -0500
@@ -0,0 +1,2 @@
+include_once(e_HANDLER."date_class.php");
+return convert::convert_date($code_text, $parm); 
diff -ruN 6171/e107_files/bbcode/u.bb 75/e107_files/bbcode/u.bb
--- 6171/e107_files/bbcode/u.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/u.bb	2006-01-11 12:13:28.000000000 -0600
@@ -0,0 +1 @@
+return "<span style='text-decoration:underline'>$code_text</span>";
\ No newline at end of file
diff -ruN 6171/e107_files/bbcode/url.bb 75/e107_files/bbcode/url.bb
--- 6171/e107_files/bbcode/url.bb	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/bbcode/url.bb	2006-02-17 13:13:54.000000000 -0600
@@ -0,0 +1,14 @@
+global $pref;
+
+$parm     = trim($parm);
+$external = ($pref['links_new_window'] || strpos($parm, 'external') === 0) ? " rel='external'" : "";
+
+if ($parm && $parm != 'external' && strpos($parm, ' ') === FALSE)
+{
+	$parm = preg_replace('#^external.#is', '', $parm);
+	return "<a href='".$tp -> toAttribute($parm)."'".$external.">".$code_text."</a>";
+}
+else
+{
+	return "<a href='".$tp -> toAttribute($code_text)."'".$external.">".$code_text."</a>";
+}
diff -ruN 6171/e107_files/cache/user_extended.xml 75/e107_files/cache/user_extended.xml
--- 6171/e107_files/cache/user_extended.xml	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/cache/user_extended.xml	2006-04-29 01:45:38.000000000 -0500
@@ -0,0 +1,67 @@
+<?xml version="1.0" ?>
+<e107_extended_user_fields version="1.0">
+	<item name="language">
+		<type>language</type>
+		<include_text></include_text>
+		<applicable>253</applicable>
+		<read>253</read>
+		<write>253</write>
+	</item>
+	<item name="country">
+		<type>db field</type>
+		<values>user_extended_country,country_iso,country_name,country_name</values>
+		<include_text></include_text>
+		<applicable>253</applicable>
+		<read>253</read>
+		<write>253</write>
+	</item>
+	<item name="location">
+		<type>text</type>
+		<include_text>class='tbox' size='40' maxlength='254'</include_text>
+		<applicable>253</applicable>
+		<read>253</read>
+		<write>253</write>
+	</item>
+	<item name="aim">
+		<type>text</type>
+		<include_text>class='tbox' size='40' maxlength='254'</include_text>
+		<applicable>253</applicable>
+		<read>253</read>
+		<write>253</write>
+	</item>
+	<item name="icq">
+		<type>text</type>
+		<include_text>class='tbox' size='40' maxlength='254'</include_text>
+		<applicable>253</applicable>
+		<read>253</read>
+		<write>253</write>
+	</item>
+	<item name="yahoo">
+		<type>text</type>
+		<include_text>class='tbox' size='40' maxlength='254'</include_text>
+		<applicable>253</applicable>
+		<read>253</read>
+		<write>253</write>
+	</item>
+	<item name="msn">
+		<type>text</type>
+		<include_text>class='tbox' size='40' maxlength='254'</include_text>
+		<applicable>253</applicable>
+		<read>253</read>
+		<write>253</write>
+	</item>
+	<item name="homepage">
+		<type>text</type>
+		<include_text>class='tbox' size='40' maxlength='254'</include_text>
+		<regex>#^[a-z0-9]+://#si</regex>
+		<applicable>253</applicable>
+		<read>253</read>
+		<write>253</write>
+	</item>
+	<item name="birthday">
+		<type>date</type>
+		<applicable>253</applicable>
+		<read>253</read>
+		<write>253</write>
+	</item>
+</e107_extended_user_fields>
\ No newline at end of file
diff -ruN 6171/e107_files/default.css 75/e107_files/default.css
--- 6171/e107_files/default.css	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_files/default.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,22 +0,0 @@
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/links.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-.defaulttable{
-	display: block;
-	width: auto;
-}
-
-.centre{
-	text-align:center;
-}
\ No newline at end of file
diff -ruN 6171/e107_files/def_e107_prefs.php 75/e107_files/def_e107_prefs.php
--- 6171/e107_files/def_e107_prefs.php	2004-07-08 10:53:52.000000000 -0500
+++ 75/e107_files/def_e107_prefs.php	2006-05-05 01:41:38.000000000 -0500
@@ -1,72 +1,160 @@
-<?php
-// default preferences for e107
-
-$pref['sitename'] = "e107 powered website";
-$pref['siteurl'] = $e_HTTP;
-$pref['sitebutton'] = "button.png";
-$pref['sitetag'] = "e107 website system";
-$pref['sitedescription'] = "";
-$pref['siteadmin'] = $_POST['admin_name'];
-$pref['siteadminemail'] = $_POST['admin_email'];
-$pref['sitetheme'] = "e107v4a";
-$pref['admintheme'] = "e107v4a";
-$pref['sitedisclaimer'] = "All trademarks are &copy; their respective owners, all other content is &copy; e107 powered website.<br />e107 is &copy; e107.org 2002/2003 and is released under the <a href=&#39;http://www.gnu.org/&#39;>GNU GPL license</a>.";
-$pref['newsposts'] = "10";
-$pref['flood_protect'] = "1";
-$pref['flood_timeout'] = "5";
-$pref['flood_time'] = "30";
-$pref['flood_hits'] = "100";
-$pref['anon_post'] = "1";
-$pref['user_reg'] = "1";
-$pref['use_coppa'] = "1";
-$pref['profanity_filter'] = "1";
-$pref['profanity_replace'] = "[censored]";
-$pref['chatbox_posts'] = "10";
-$pref['smiley_activate'] = "";
-$pref['log_activate'] = "";
-$pref['log_refertype'] = "1";
-$pref['longdate'] = "%A %d %B %Y - %H:%M:%S";
-$pref['shortdate'] = "%d %b : %H:%M";
-$pref['forumdate'] = "%a %b %d %Y, %I:%M%p";
-$pref['sitelanguage'] = "English";
-$pref['maintainance_flag'] = "0";
-$pref['time_offset'] = "0";
-$pref['cb_linkc'] = " -link- ";
-$pref['cb_wordwrap'] = "20";
-$pref['cb_linkreplace'] = "1";
-$pref['log_lvcount'] = "10";
-$pref['meta_tag'] = "";
-$pref['user_reg_veri'] = "1";
-$pref['email_notify'] = "0";
-$pref['forum_poll'] = "0";
-$pref['forum_popular'] = "10";
-$pref['forum_track'] = "0";
-$pref['forum_eprefix'] = "[forum]";
-$pref['forum_enclose'] = "1";
-$pref['forum_title'] = "Forums";
-$pref['forum_postspage'] = "10";
-$pref['user_tracking'] = "cookie";
-$pref['cookie_name'] = "e107cookie";
-$pref['resize_method'] = "gd2";
-$pref['im_path'] = "/usr/X11R6/bin/convert";
-$pref['im_quality'] = "80";
-$pref['im_width'] = "120";
-$pref['im_height'] = "100";
-$pref['upload_enabled'] = "0";
-$pref['upload_allowedfiletype'] = ".zip\n.gz\n.jpg\n.png\n.gif\n.txt";
-$pref['upload_storagetype'] = "2";
-$pref['upload_maxfilesize'] = "";
-$pref['upload_class'] = "999";
-$pref['cachestatus'] = "";
-$pref['displayrendertime'] = "1";
-$pref['displaysql'] = "";
-$pref['displaythemeinfo'] = "1";
-$pref['link_submit'] = "1";
-$pref['link_submit_class'] = "0";
-$pref['timezone'] = "GMT";
-$pref['search_restrict'] = "1";
-$pref['antiflood1'] = "1";
-$pref['antiflood_timeout'] = "10";
-$pref['autoban'] = "1";
-
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/def_e107_prefs.php,v $
+|     $Revision: 1.56 $
+|     $Date: 2006/05/05 06:41:38 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$pref = array (
+  'install_date' => time(),
+  'sitename' => LAN_PREF_1,
+  'siteurl' => $e_HTTP,
+  'sitebutton' => 'button.png',
+  'sitetag' => LAN_PREF_2,
+  'sitedescription' => '',
+  'siteadmin' => $site_admin_user,
+  'siteadminemail' => $site_admin_email,
+  'sitecontactinfo' => '[b]My Company[/b]
+13 My Address St.
+City, State, Country
+[b]Phone:[/b] 555-555-5555
+[b]Email:[/b] sales@mydomain.com',
+  'sitetheme' => 'reline',
+  'themecss' => 'style.css',
+  'image_preload' => '0',
+  'admintheme' => 'jayya',
+  'admincss' => 'style.css',
+  'adminstyle' => 'classis',
+  'sitedisclaimer' => LAN_PREF_3,
+  'newsposts' => '10',
+  'flood_protect' => '1',
+  'flood_timeout' => '5',
+  'flood_time' => '30',
+  'flood_hits' => '100',
+  'anon_post' => '0',
+  'user_reg' => '1',
+  'use_coppa' => '1',
+  'profanity_filter' => '0',
+  'profanity_replace' => '[censored]',
+  'smiley_activate' => '',
+  'log_refertype' => '1',
+  'longdate' => '%A %d %B %Y - %H:%M:%S',
+  'shortdate' => '%d %b : %H:%M',
+  'forumdate' => '%a %b %d %Y, %I:%M%p',
+  'sitelanguage' => 'English',
+  'maintainance_flag' => '0',
+  'time_offset' => '0',
+  'log_lvcount' => '10',
+  'meta_tag' => '',
+  'user_reg_veri' => '1',
+  'email_notify' => '0',
+  'user_tracking' => 'cookie',
+  'cookie_name' => 'e107cookie',
+  'resize_method' => 'gd2',
+  'im_path' => '/usr/X11R6/bin/convert',
+  'im_quality' => '80',
+  'im_width' => '120',
+  'im_height' => '100',
+  'upload_enabled' => '0',
+  'upload_storagetype' => '2',
+  'upload_maxfilesize' => '',
+  'upload_class' => '255',
+  'cachestatus' => '',
+  'displayrendertime' => '0',
+  'displaysql' => '0',
+  'displaythemeinfo' => '0',
+  'timezone' => 'GMT',
+  'search_restrict' => '0',
+  'antiflood1' => '1',
+  'antiflood_timeout' => '10',
+  'autoban' => '1',
+  'sitelang_init' => (isset($_POST['installlanguage']) ? $_POST['installlanguage'] :  "English"),
+  'linkpage_screentip' => '0',
+  'plug_status' => 'rss_menu',
+  'plug_latest' => '',
+  'wmessage_sc' => '0',
+  'frontpage' =>
+  array (
+    'all' => 'news.php',
+  ),
+  'signup_text' => '',
+  'admin_alerts_ok' => '1',
+  'link_replace' => '0',
+  'link_text' => '',
+  'signcode' => '0',
+  'logcode' => '0',
+  'signup_option_realname' => '1',
+  'signup_option_signature' => '1',
+  'signup_option_image' => '1',
+  'signup_option_timezone' => '1',
+  'signup_option_class' => '1',
+  'newsposts_archive' => '0',
+  'newsposts_archive_title' => '',
+  'news_cats' => '',
+  'nbr_cols' => '1',
+  'subnews_attach' => '',
+  'subnews_resize' => '',
+  'subnews_class' => '0',
+  'subnews_htmlarea' => '0',
+  'subnews_hide_news' => '',
+  'news_newdateheader' => '0',
+  'email_text' => '',
+  'useGeshi' => '0',
+  'wysiwyg' => '0',
+  'old_np' => '0',
+  'make_clickable' => '0',
+  'signup_maxip' => '3',
+  'track_online' => '1',
+  'emotepack' => 'default',
+  'xup_enabled' => '1',
+  'mailer' => 'php',
+  'ue_upgrade' => '1',
+  'search_highlight' => '1',
+  'mail_pause' => '3',
+  'mail_pausetime' => '4',
+  'themecss' => 'canvas.css',
+  'plug_sc' => ':featurebox',
+  'auth_method' => '',
+  'post_html' => '254',
+  'redirectsiteurl' => '0',
+  'admin_alerts_uniquemenu' => '0',
+  'membersonly_enabled' => '0',
+  'signup_pass_len' => '',
+  'signup_disallow_text' => '',
+  'signup_text_after' => '',
+  'null' => '',
+  'links_new_window' => '1',
+  'main_wordwrap' => '',
+  'menu_wordwrap' => '',
+  'php_bbcode' => '255',
+  'ssl_enabled' => '0',
+  'fpwcode' => '0',
+  'user_reg_secureveri' => '1',
+  'disallowMultiLogin' => '0',
+  'profanity_words' => '',
+  'adminpwordchange' => '0',
+  'comments_icon' => '0',
+  'nested_comments' => '1',
+  'allowCommentEdit' => '0',
+  'rss_feeds' => '1',
+  'admincss' => 'style.css',
+  'developer' => '0',
+  'download_email' => '0',
+  'comments_disabled' => '0'
+);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/e107.css 75/e107_files/e107.css
--- 6171/e107_files/e107.css	2004-05-06 14:24:22.000000000 -0500
+++ 75/e107_files/e107.css	2005-02-08 00:42:21.000000000 -0600
@@ -1,21 +1,44 @@
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/files/e107.css
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-This file is here for a possible future project of making themes more css compatible
-*/
-
-.defaulttable, .fbdefault, .fdefault, .f2default, .f3default, .fcdefault{ display: block; width: auto; }
-.center{ text-align:center; }
-.right { text-align:right; }
-.left { text-align:left; }
-table { margin-left:auto; margin-right:auto; }
-.searchhighlight{text-decoration: underline;color:#FF0000;font-weight:bold;}
\ No newline at end of file
+table { margin-left:auto; margin-right:auto; }
+.searchhighlight{text-decoration: underline;color:#FF0000;font-weight:bold;}
+
+/*
+ * Please DO NOT USE or reference any of the following class definitions.
+ * They are not referenced anywhere in the e107 core. (0.700, 7 Feb 2005)
+ * This file will be eliminated after the remaining definitions (above) 
+ *   have been either verified as unnecessary, or added to all themes.
+ */
+
+.defaulttable, .fbdefault, .fdefault, .f2default, .f3default, .fcdefault{ display: block; width: auto; }
+.center{ text-align:center; }
+.right { text-align:right; }
+.left { text-align:left; }
+.day {
+  text-align: center;
+  background: #F1EAE1;
+  font: 10px tahoma, verdana, arial, helvetica, sans-serif;
+  padding: 2px 1px 2px 1px;
+}
+.dayentry {
+  text-align: center;
+  background: #F1C7B7;
+  font: 10px tahoma, verdana, arial, helvetica, sans-serif;
+  padding: 2px 1px 2px 1px;
+}
+.forumheader4{
+	background-color: #EBEFF2;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 11px;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+	cursor: pointer;
+}
+.forumheader5{
+	background-color: #BCD5EA;
+	color:#000;
+	cursor: pointer;
+}
+ul{
+	margin-top:0px;
+	margin-bottom:0px;
+}
\ No newline at end of file
diff -ruN 6171/e107_files/e107.js 75/e107_files/e107.js
--- 6171/e107_files/e107.js	2004-06-08 17:38:00.000000000 -0500
+++ 75/e107_files/e107.js	2006-04-29 17:52:38.000000000 -0500
@@ -1,148 +1,322 @@
-<!--
-
-if(parent.frames[0])
-{
-parent.location.href = self.location.href;
-}
-
-if(document.getElementById&&!document.all){ns6=1;}else{ns6=0;}
-var agtbrw=navigator.userAgent.toLowerCase();
-var operaaa=(agtbrw.indexOf('opera')!=-1);
-var head="display:''";
-var folder='';
-function expandit(curobj){
-if(document.getElementById(curobj)){
-  folder=document.getElementById(curobj).style;
-  }else{
-
-if(ns6==1||operaaa==true){
-	folder=curobj.nextSibling.nextSibling.style;
-}else{
-	folder=document.all[curobj.sourceIndex+1].style;
-}
-   }
-if (folder.display=="none"){folder.display="";}else{folder.display="none";}
-}
-
-
-function urljump(url){
-	top.window.location = url; 
-}
-
-function open_window(url,type) {
-	if('full' == type){
-		pwindow = window.open(url);
-	} else {
-		pwindow = window.open(url,'Name', 'top=100,left=100,resizable=yes,width=600,height=400,scrollbars=yes,menubar=yes')
-	}
-}
-
-function ejs_preload(ejs_path, ejs_imageString){
-	var ejs_imageArray = ejs_imageString.split(','); 
-	for(ejs_loadall=0; ejs_loadall<ejs_imageArray.length; ejs_loadall++){ 
-		var ejs_LoadedImage=new Image(); 
-		ejs_LoadedImage.src=ejs_path + ejs_imageArray[ejs_loadall]; 
-	} 
-} 
-
-function textCounter(field,cntfield) {
-	cntfield.value = field.value.length;
-}
-
-function openwindow() {
-	opener = window.open("htmlarea/index.php", "popup","top=50,left=100,resizable=no,width=670,height=520,scrollbars=no,menubar=no");            
-}
-function setCheckboxes(the_form, do_check){
-	var elts = (typeof(document.forms[the_form].elements['perms[]']) != 'undefined') ? document.forms[the_form].elements['perms[]'] : document.forms[the_form].elements['perms[]'];
-    var elts_cnt  = (typeof(elts.length) != 'undefined') ? elts.length : 0;
-    if(elts_cnt){
-		for(var i = 0; i < elts_cnt; i++){
-			elts[i].checked = do_check;
-        }
-	}else{
-		elts.checked        = do_check;
-    }
-	return true;
-}
-
-var ref=""+escape(top.document.referrer);
-var colord = window.screen.colorDepth; 
-var res = window.screen.width + "x" + window.screen.height;
-var eself = document.location;
-
-// From http://phpbb.com
-var clientPC = navigator.userAgent.toLowerCase();
-var clientVer = parseInt(navigator.appVersion);
-var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
-var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
-var is_moz = 0;
-var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
-var is_mac = (clientPC.indexOf("mac")!=-1);
-var selectedInputArea;
-
-
-// From http://www.massless.org/mozedit/
-function mozWrap(txtarea, open, close){
-	var selLength = txtarea.textLength;
-	var selStart = txtarea.selectionStart;
-	var selEnd = txtarea.selectionEnd;
-	if (selEnd == 1 || selEnd == 2) selEnd = selLength;
-	var s1 = (txtarea.value).substring(0,selStart);
-	var s2 = (txtarea.value).substring(selStart, selEnd)
-	var s3 = (txtarea.value).substring(selEnd, selLength);
-	txtarea.value = s1 + open + s2 + close + s3;
-	return;
-}
-
-function storeCaret (textAr){
-	selectedInputArea = textAr;
-	if (textAr.createTextRange){
-		selectedRange = document.selection.createRange().duplicate();
-	}
-}
-
-function addtext(text){
-	if (window.selectedInputArea){
-		var ta = selectedInputArea;
-		val = text.split('][');
-		if ((clientVer >= 4) && is_ie && is_win){
-			theSelection = document.selection.createRange().text;
-			if (theSelection) {
-				document.selection.createRange().text = val[0] +']' +  theSelection + '[' + val[1];
-				ta.focus();
-				theSelection = '';
-				return;
-			}
-		}else if (ta.selectionEnd && (ta.selectionEnd - ta.selectionStart > 0)){
-			mozWrap(ta, val[0] +']', '[' + val[1]);
-			return;
-		}
-		text = ' ' + text + ' ';
-		if (ta.createTextRange && selectedRange) {
-			var caretPos = selectedRange;
-			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
-			ta.focus();
-		} else {
-			ta.value  += text;
-			ta.focus();
-		}
-	}
-}
-
-function help(help){
-	document.getElementById('dataform').helpb.value = help;
-}
-function externalLinks() { 
- if (!document.getElementsByTagName) return; 
- var anchors = document.getElementsByTagName("a"); 
- for (var i=0; i<anchors.length; i++) { 
-   var anchor = anchors[i]; 
-   if (anchor.getAttribute("href") && 
-       anchor.getAttribute("rel") == "external") 
-     anchor.target = "_blank"; 
- } 
-} 
-
-
-
+<!--
+
+/*
++ ----------------------------------------------------------------------------+
+|	e107 website system - Javascript File.
+|
+|	$Source: /cvsroot/e107/e107_0.7/e107_files/e107.js,v $
+|	$Revision: 1.19 $
+|	$Date: 2006/04/29 22:52:38 $
+|	$Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+/*
+ * NOTE: KEEP THIS AT THE TOP OF E107.JS!
+ * localTime is recorded ASAP after page load; SyncWithServerTime is called at the END
+ * of page processing. We want localTime and serverTime set in close chronological order.
+ * Page Processing order is as follows:
+ * A) All PHP code encountered sequentially in page
+ * B) All Javascript code encountered sequentially in page NOT including function internals
+ * So best proximity is achieved by setting
+ * serverTime at END of php code, and localTime at START of js code.
+ * NOTE: this method means reported times include transfer delay. It's slightly MORE accurate this way!
+ * Final product: tdOffset cookie contains server-browser time difference in seconds,
+ * independent of time zone. tzOffset contains browser time zone in minutes.
+ */
+
+var nowLocal = new Date();		/* time at very beginning of js execution */
+var localTime = Math.floor(nowLocal.getTime()/1000);	/* time, in ms -- recorded at top of jscript */
+/* NOTE: if serverDelta is needed for js functions, you must pull it from
+ * the cookie (as calculated during a previous page load!)
+ * The value calculated in SyncWithServerTime is not known until after the
+ * entire page has been processed.
+ */
+function SyncWithServerTime(serverTime)
+{
+	if (serverTime) {
+	  	/* update time difference cookie */
+		tdCookie='e107_tdOffset=';
+		tdSetTimeCookie='e107_tdSetTime=';
+		serverDelta=Math.floor(localTime-serverTime);
+	  	document.cookie = tdCookie+serverDelta;
+	  	document.cookie = tdSetTimeCookie+(localTime-serverDelta); /* server time when set */
+	}
+
+	tzCookie = 'e107_tzOffset=';
+	if (document.cookie.indexOf(tzCookie) < 0) {
+		/* set if not already set */
+		timezoneOffset = nowLocal.getTimezoneOffset(); /* client-to-GMT in minutes */
+		document.cookie = tzCookie + timezoneOffset;
+	}
+}
+
+if(document.getElementById&&!document.all){ns6=1;}else{ns6=0;}
+var agtbrw=navigator.userAgent.toLowerCase();
+var operaaa=(agtbrw.indexOf('opera')!=-1);
+var head="display:''";
+var folder='';
+
+function expandit(curobj, hide) {
+	if(document.getElementById(curobj)) {
+  		folder=document.getElementById(curobj).style;
+	} else {
+		if(ns6==1||operaaa==true) {
+			folder=curobj.nextSibling.nextSibling.style;
+		} else {
+			folder=document.all[curobj.sourceIndex+1].style;
+		}
+   }
+	if(folder.display=="none")
+	{
+		folder.display="";
+	} else {
+		folder.display="none";
+	}
+	if(hide) {
+		var hide_objects = hide.split(",");
+		for(i=0; i<hide_objects.length; i++) {
+			hide_objects[i]=hide_objects[i].replace(/^\s*(.*)/, "$1");
+			hide_objects[i]=hide_objects[i].replace(/(.*?)\s*$/, "$1");
+			if(document.getElementById(hide_objects[i])) {
+				hidden=document.getElementById(hide_objects[i]).style;
+				if(hidden.display=="") {
+					hidden.display="none";
+				}
+			}
+		}
+	}
+}
+
+function urljump(url){
+	top.window.location = url;
+}
+
+function setInner(id, txt) {
+	document.getElementById(id).innerHTML = txt;
+}
+
+function jsconfirm(thetext){
+		return confirm(thetext);
+}
+
+function insertext(str,tagid,display){
+	document.getElementById(tagid).value = str;
+	if(display){
+		document.getElementById(display).style.display='none';
+	}
+}
+
+function appendtext(str,tagid,display){
+	document.getElementById(tagid).value += str;
+	document.getElementById(tagid).focus();
+	if(display){
+		document.getElementById(display).style.display='none';
+	}
+}
+
+function open_window(url,wth,hgt) {
+	if('full' == wth){
+		pwindow = window.open(url);
+	} else {
+		if (wth) {
+			mywidth=wth;
+		} else {
+			mywidth=600;
+		}
+
+		if (hgt) {
+			myheight=hgt;
+		} else {
+			myheight=400;
+		}
+
+		pwindow = window.open(url,'Name', 'top=100,left=100,resizable=yes,width='+mywidth+',height='+myheight+',scrollbars=yes,menubar=yes')
+	}
+	pwindow.focus();
+}
+
+function ejs_preload(ejs_path, ejs_imageString){
+	var ejs_imageArray = ejs_imageString.split(',');
+	for(ejs_loadall=0; ejs_loadall<ejs_imageArray.length; ejs_loadall++){
+		var ejs_LoadedImage=new Image();
+		ejs_LoadedImage.src=ejs_path + ejs_imageArray[ejs_loadall];
+	}
+}
+
+function textCounter(field,cntfield) {
+	cntfield.value = field.value.length;
+}
+
+function openwindow() {
+	opener = window.open("htmlarea/index.php", "popup","top=50,left=100,resizable=no,width=670,height=520,scrollbars=no,menubar=no");
+	opener.focus();
+}
+
+function setCheckboxes(the_form, do_check, the_cb){
+	var elts = (typeof(document.forms[the_form].elements[the_cb]) != 'undefined') ? document.forms[the_form].elements[the_cb] : document.forms[the_form].elements[the_cb];
+	var elts_cnt  = (typeof(elts.length) != 'undefined') ? elts.length : 0;
+	if(elts_cnt){
+		for(var i = 0; i < elts_cnt; i++){
+			elts[i].checked = do_check;
+		}
+	}else{
+		elts.checked        = do_check;
+		}
+	return true;
+}
+
+var ref=""+escape(top.document.referrer);
+var colord = window.screen.colorDepth;
+var res = window.screen.width + "x" + window.screen.height;
+var eself = document.location;
+
+// From http://phpbb.com
+var clientPC = navigator.userAgent.toLowerCase();
+var clientVer = parseInt(navigator.appVersion);
+var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
+var is_nav = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1) && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));
+var is_moz = 0;
+var is_win = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
+var is_mac = (clientPC.indexOf("mac")!=-1);
+var e107_selectedInputArea;
+var e107_selectedRange;
+var e107_dupCounter = 1;
+
+// From http://www.massless.org/mozedit/
+function mozWrap(txtarea, open, close){
+	var selLength = txtarea.textLength;
+	var selStart = txtarea.selectionStart;
+	var selEnd = txtarea.selectionEnd;
+	if (selEnd == 1 || selEnd == 2) selEnd = selLength;
+	var s1 = (txtarea.value).substring(0,selStart);
+	var s2 = (txtarea.value).substring(selStart, selEnd)
+	var s3 = (txtarea.value).substring(selEnd, selLength);
+	txtarea.value = s1 + open + s2 + close + s3;
+	return;
+}
+
+function storeCaret (textAr){
+	e107_selectedInputArea = textAr;
+	if (textAr.createTextRange){
+		e107_selectedRange = document.selection.createRange().duplicate();
+	}
+}
+
+function addtext(text, emote){
+	if (window.e107_selectedInputArea){
+		var ta = e107_selectedInputArea;
+		if (emote != true){
+			val = text.split('][');
+			}
+		else { val = text; }
+
+		if ((clientVer >= 4) && is_ie && is_win){
+			theSelection = document.selection.createRange().text; /* wrap selected text */
+			if (theSelection) {
+				if (emote != true){
+					document.selection.createRange().text = val[0] +']' +  theSelection + '[' + val[1];
+				} else {
+					document.selection.createRange().text = val + theSelection;
+				}
+				ta.focus();
+				theSelection = '';
+				return;
+			}
+
+		}else if (ta.selectionEnd && (ta.selectionEnd - ta.selectionStart > 0)){
+			if (emote != true){
+				mozWrap(ta, val[0] +']', '[' + val[1]); /* wrap selected text */
+			} else {
+				mozWrap(ta, val, ''); /* wrap selected text */
+			}
+			return;
+		}
+		text = ' ' + text + ' ';
+		if (ta.createTextRange && e107_selectedRange) {
+			var caretPos = e107_selectedRange; /* IE */
+			caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
+		} else if (ta.selectionStart || ta.selectionStart == '0') { /* Moz */
+		   	var startPos = ta.selectionStart;
+			var endPos = ta.selectionEnd;
+			var charb4 = ta.value.charAt(endPos-1);
+			ta.value = ta.value.substring(0, endPos)+ text + ta.value.substring(endPos);
+		} else {
+			ta.value  += text;
+		}
+		ta.focus();
+	}
+}
+
+function help(help,tagid){
+	if(tagid){
+		document.getElementById(tagid).value = help;
+	} else if(document.getElementById('dataform')) {
+		document.getElementById('dataform').helpb.value = help;
+	}
+}
+function externalLinks() {
+	if (!document.getElementsByTagName) return;
+	var anchors = document.getElementsByTagName("a");
+	for (var i=0; i<anchors.length; i++) {
+	var anchor = anchors[i];
+	if (anchor.getAttribute("href") &&
+		anchor.getAttribute("rel") == "external")
+		anchor.target = "_blank";
+	}
+}
+
+function eover(object, over) {
+	object.className = over;
+}
+
+function duplicateHTML(copy,paste,baseid){
+		if(document.getElementById(copy)){
+
+			e107_dupCounter++;
+			var type = document.getElementById(copy).nodeName; // get the tag name of the source copy.
+
+			var but = document.createElement('input');
+			var br = document.createElement('br');
+
+			but.type = 'button';
+			but.value = 'x';
+			but.className = 'button';
+			but.onclick = function(){ this.parentNode.parentNode.removeChild(this.parentNode); };
+
+			var destination = document.getElementById(paste);
+			var source      = document.getElementById(copy).cloneNode(true);
+
+			var newentry = document.createElement(type);
+
+			newentry.appendChild(source);
+			newentry.value='';
+			newentry.appendChild(but);
+			newentry.appendChild(br);
+			if(baseid)
+			{
+				newid = baseid+e107_dupCounter;
+				newentry.innerHTML = newentry.innerHTML.replace(new RegExp(baseid, 'g'), newid);
+				newentry.id=newid;
+			}
+
+			destination.appendChild(newentry);
+		}
+}
+
+function preview_image(src_val,img_path){
+	var ta;
+	var desti
+
+	var desti = src_val + '_prev';
+	ta = document.getElementById(src_val).value;
+	if(ta){
+		document.getElementById(desti).src = img_path + ta;
+	}else{
+		document.getElementById(desti).src = '".e_IMAGE."generic/blank.gif';
+	}
+	return;
+}
+
+
 //-->
\ No newline at end of file
diff -ruN 6171/e107_files/e_ajax.js 75/e107_files/e_ajax.js
--- 6171/e107_files/e_ajax.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/e_ajax.js	2006-01-19 15:43:22.000000000 -0600
@@ -0,0 +1,250 @@
+if (window.ActiveXObject && !window.XMLHttpRequest) {
+  window.XMLHttpRequest = function() {
+    return new ActiveXObject((navigator.userAgent.toLowerCase().indexOf('msie 5') != -1) ? 'Microsoft.XMLHTTP' : 'Msxml2.XMLHTTP');
+  };
+}
+// Gecko support
+/* ;-) */
+// Opera support
+if (window.opera && !window.XMLHttpRequest) {
+  window.XMLHttpRequest = function() {
+    this.readyState = 0; // 0=uninitialized,1=loading,2=loaded,3=interactive,4=complete
+    this.status = 0; // HTTP status codes
+    this.statusText = '';
+    this._headers = [];
+    this._aborted = false;
+    this._async = true;
+    this.abort = function() {
+      this._aborted = true;
+    };
+    this.getAllResponseHeaders = function() {
+      return this.getAllResponseHeader('*');
+    };
+    this.getAllResponseHeader = function(header) {
+      var ret = '';
+      for (var i = 0; i < this._headers.length; i++) {
+        if (header == '*' || this._headers[i].h == header) {
+          ret += this._headers[i].h + ': ' + this._headers[i].v + '\n';
+        }
+      }
+      return ret;
+    };
+    this.setRequestHeader = function(header, value) {
+      this._headers[this._headers.length] = {h:header, v:value};
+    };
+    this.open = function(method, url, async, user, password) {
+      this.method = method;
+      this.url = url;
+      this._async = true;
+      this._aborted = false;
+      if (arguments.length >= 3) {
+        this._async = async;
+      }
+      if (arguments.length > 3) {
+        // user/password support requires a custom Authenticator class
+        opera.postError('XMLHttpRequest.open() - user/password not supported');
+      }
+      this._headers = [];
+      this.readyState = 1;
+      if (this.onreadystatechange) {
+        this.onreadystatechange();
+      }
+    };
+    this.send = function(data) {
+      if (!navigator.javaEnabled()) {
+        alert("XMLHttpRequest.send() - Java must be installed and enabled.");
+        return;
+      }
+      if (this._async) {
+        setTimeout(this._sendasync, 0, this, data);
+        // this is not really asynchronous and won't execute until the current
+        // execution context ends
+      } else {
+        this._sendsync(data);
+      }
+    }
+    this._sendasync = function(req, data) {
+      if (!req._aborted) {
+        req._sendsync(data);
+      }
+    };
+    this._sendsync = function(data) {
+      this.readyState = 2;
+      if (this.onreadystatechange) {
+        this.onreadystatechange();
+      }
+      // open connection
+      var url = new java.net.URL(new java.net.URL(window.location.href), this.url);
+      var conn = url.openConnection();
+      for (var i = 0; i < this._headers.length; i++) {
+        conn.setRequestProperty(this._headers[i].h, this._headers[i].v);
+      }
+      this._headers = [];
+      if (this.method == 'POST') {
+        // POST data
+        conn.setDoOutput(true);
+        var wr = new java.io.OutputStreamWriter(conn.getOutputStream());
+        wr.write(data);
+        wr.flush();
+        wr.close();
+      }
+      // read response headers
+      // NOTE: the getHeaderField() methods always return nulls for me :(
+      var gotContentEncoding = false;
+      var gotContentLength = false;
+      var gotContentType = false;
+      var gotDate = false;
+      var gotExpiration = false;
+      var gotLastModified = false;
+      for (var i = 0; ; i++) {
+        var hdrName = conn.getHeaderFieldKey(i);
+        var hdrValue = conn.getHeaderField(i);
+        if (hdrName == null && hdrValue == null) {
+          break;
+        }
+        if (hdrName != null) {
+          this._headers[this._headers.length] = {h:hdrName, v:hdrValue};
+          switch (hdrName.toLowerCase()) {
+            case 'content-encoding': gotContentEncoding = true; break;
+            case 'content-length'  : gotContentLength   = true; break;
+            case 'content-type'    : gotContentType     = true; break;
+            case 'date'            : gotDate            = true; break;
+            case 'expires'         : gotExpiration      = true; break;
+            case 'last-modified'   : gotLastModified    = true; break;
+          }
+        }
+      }
+      // try to fill in any missing header information
+      var val;
+      val = conn.getContentEncoding();
+      if (val != null && !gotContentEncoding) this._headers[this._headers.length] = {h:'Content-encoding', v:val};
+      val = conn.getContentLength();
+      if (val != -1 && !gotContentLength) this._headers[this._headers.length] = {h:'Content-length', v:val};
+      val = conn.getContentType();
+      if (val != null && !gotContentType) this._headers[this._headers.length] = {h:'Content-type', v:val};
+      val = conn.getDate();
+      if (val != 0 && !gotDate) this._headers[this._headers.length] = {h:'Date', v:(new Date(val)).toUTCString()};
+      val = conn.getExpiration();
+      if (val != 0 && !gotExpiration) this._headers[this._headers.length] = {h:'Expires', v:(new Date(val)).toUTCString()};
+      val = conn.getLastModified();
+      if (val != 0 && !gotLastModified) this._headers[this._headers.length] = {h:'Last-modified', v:(new Date(val)).toUTCString()};
+      // read response data
+      var reqdata = '';
+      var stream = conn.getInputStream();
+      if (stream) {
+        var reader = new java.io.BufferedReader(new java.io.InputStreamReader(stream));
+        var line;
+        while ((line = reader.readLine()) != null) {
+          if (this.readyState == 2) {
+            this.readyState = 3;
+            if (this.onreadystatechange) {
+              this.onreadystatechange();
+            }
+          }
+          reqdata += line + '\n';
+        }
+        reader.close();
+        this.status = 200;
+        this.statusText = 'OK';
+        this.responseText = reqdata;
+        this.readyState = 4;
+        if (this.onreadystatechange) {
+          this.onreadystatechange();
+        }
+        if (this.onload) {
+          this.onload();
+        }
+      } else {
+        // error
+        this.status = 404;
+        this.statusText = 'Not Found';
+        this.responseText = '';
+        this.readyState = 4;
+        if (this.onreadystatechange) {
+          this.onreadystatechange();
+        }
+        if (this.onerror) {
+          this.onerror();
+        }
+      }
+    };
+  };
+}
+// ActiveXObject emulation
+if (!window.ActiveXObject && window.XMLHttpRequest) {
+  window.ActiveXObject = function(type) {
+    switch (type.toLowerCase()) {
+      case 'microsoft.xmlhttp':
+      case 'msxml2.xmlhttp':
+        return new XMLHttpRequest();
+    }
+    return null;
+  };
+}
+
+function sendInfo() {
+	var handler = sendInfo.arguments[0];
+	var id = sendInfo.arguments[1];
+	var req = new XMLHttpRequest();
+	if (req) {
+		req.onreadystatechange = function() { 
+			if (req.readyState == 4 && (req.status == 200 || req.status == 304)) { 
+				document.getElementById(id).innerHTML = req.responseText;
+			}
+		};
+	} else {
+		alert("XMLHTTPRequest failed");
+		return null;
+	}
+	if( sendInfo.arguments.length == 2) {
+		req.open('GET', handler);
+		req.send(null);
+	} else {
+		var obj = sendInfo.arguments[2];
+		var poststr = "ajax_used=1&";
+		var tmp;
+		var show;
+		for(i=0; i < obj.length; i++) {
+			tmp = "";
+			show = 1;
+			switch (obj.elements[i].type) {
+				case "text":
+				case "textarea":
+				case "hidden":
+				case "submit":
+				case "button":
+				case "password":
+					tmp = obj.elements[i].value;
+					break;
+				case "checkbox":
+					tmp = obj.elements[i].checked;
+					if(tmp) {
+						tmp = 1;
+					} else {
+						show = 0;
+					}
+					break;
+				case "select-one":
+					tmp = obj.elements[i].options[obj.elements[i].selectedIndex].value;
+					break;
+				case "radio":
+					tmp = obj.elements[i].checked;
+					if(tmp) {
+						tmp = obj.elements[i].value;
+					} else {
+						show = 0;
+					}
+					break;
+			}
+			if(show && obj.elements[i].id) {
+				tmp = tmp.replace(/&/g, "%26");
+				poststr += obj.elements[i].id + '=' + tmp + '&';
+			}
+		}
+		req.open('POST', handler, true);
+		req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+		req.setRequestHeader("Content-length", poststr.length);
+		req.setRequestHeader("Connection", "close");
+		req.send(poststr);
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/import/mambo.php 75/e107_files/import/mambo.php
--- 6171/e107_files/import/mambo.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/import/mambo.php	2005-05-12 16:34:56.000000000 -0500
@@ -0,0 +1,156 @@
+<?
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/import/mambo.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/05/12 21:34:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+require_once(e_ADMIN."auth.php");
+
+if(!isset($_POST['do_conversion']))
+{
+
+	$text = "
+	<table style='width: 100%;' class='fborder'>
+	<tr>
+	<td class='forumheader3' style='text-align: center; margin-left: auto; margin-right: auto;'>
+	This script will import your Mambo database to e107. It will copy over users only.<br /><br /></b>
+
+	<br /><br />\n
+
+
+	<form method='post' action='".e_SELF."'>
+	Please enter the details for your Mambo database ...<br /><br />
+
+	<table style='width: 50%;' class='fborder'>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Host&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='mamboHost' size='30' value='localhost' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Username&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='mamboUsername' size='30' value='' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Password&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='mamboPassword' size='30' value='' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Database&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='mamboDatabase' size='30' value='mambo' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Table Prefix&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='mamboPrefix' size='30' value='mos_' maxlength='100' />
+	</tr>
+	</table>
+	<br /><br />
+	<input class='button' type='submit' name='do_conversion' value='Continue' />
+	</td>
+	</tr>
+	</table>";
+
+	$ns -> tablerender("mambo to e107 Conversion Script", $text);
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+if(!isset($_POST['mamboHost']) || !isset($_POST['mamboUsername']) || !isset($_POST['mamboPassword']) || !isset($_POST['mamboDatabase'])){
+	echo "Field(s) left blank, please go back and re-enter values.";
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+extract($_POST);
+
+$text .= "<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader3' style='text-align: center; margin-left: auto; margin-right: auto;'>
+Attempting to connect to Mambo database [ {$mamboDatabase} @ {$mamboHost} ] ...<br />\n";
+flush();
+
+$phpbbConnection = mysql_connect($mamboHost, $mamboUsername, $mamboPassword, TRUE);
+if(!mysql_select_db($mamboDatabase, $phpbbConnection)){
+	goError("Error! Cound not connect to Mambo database. Please go back to the previous page and check your settings");
+}
+
+$e107Connection = mysql_connect($mySQLserver, $mySQLuser, $mySQLpassword, TRUE);
+if(!mysql_select_db($mySQLdefaultdb, $e107Connection)){
+	goError("Error! Cound not connect to e107 database.");
+}
+
+echo "Successfully connected to Mambo and e107 databases ...<br><br />";
+
+
+$phpbb_res = mysql_query("SELECT * FROM {$mamboPrefix}users", $phpbbConnection);
+if(!$phpbb_res){
+	goError("Error! Unable to access ".$mamboPrefix."users table.");
+}
+
+
+
+$text = "<div><table class='fborder'>";
+$text .= "<tr>";
+$text .= "<td class='fcaption'>name</td>";
+$text .= "<td class='fcaption'>username</td>";
+$text .= "<td class='fcaption'>email</td>";
+$text .= "<td class='fcaption'>password</td>";
+$text .= "<td class='fcaption'>usertype</td>";
+$text .= "<td class='fcaption'>block</td>";
+$text .= "<td class='fcaption'>sendEmail</td>";
+$text .= "<td class='fcaption'>gid</td>";
+$text .= "<td class='fcaption'>regDate</td>";
+$text .= "<td class='fcaption'>lvDate</td>";
+$text .= "</tr>";
+
+$result = mysql_query("SELECT name,username,email,block,sendEmail,gid,password,usertype,UNIX_TIMESTAMP(registerDate) AS regDate,UNIX_TIMESTAMP(lastvisitDate) AS lvDate FROM mos_users", $phpbbConnection);
+while ($mos = mysql_fetch_array($result, MYSQL_ASSOC)) {
+$text .= "<tr>";
+$text .= "<td class='forumheader3'>".$mos['name']."</td>";
+$text .= "<td class='forumheader3'>".$mos['username']."</td>";
+$text .= "<td class='forumheader3'>".$mos['email']."</td>";
+$text .= "<td class='forumheader3'>".$mos['password']."</td>";
+$text .= "<td class='forumheader3'>".$mos['usertype']."</td>";
+$text .= "<td class='forumheader3'>".$mos['block']."</td>";
+$text .= "<td class='forumheader3'>".$mos['sendEmail']."</td>";
+$text .= "<td class='forumheader3'>".$mos['gid']."</td>";
+$text .= "<td class='forumheader3'>".$mos['regDate']."</td>";
+$text .= "<td class='forumheader3'>".$mos['lvDate']."</td>";
+$text .= "</tr>";
+
+$block = ($mos['block']) ? 2 : 0;
+$admin = ($mos['usertype'] == "superadministrator") ? 1 : 0;
+$query = "INSERT INTO ".$mySQLprefix."user VALUES (";
+$query .= "0, \"".$mos['name']."\", \"".$mos['username']."\", '', \"".$mos['password']."\", '', \"".$mos['email']."\", '', '', '', '', '', '', '', '', '', \"1\", \"".$mos['regDate']."\", \"".$mos['lvDate']."\", \"\", \"\", \"\", \"\", \"\", \"\", \"$block\", '', '', '', '', \"$admin\", \"".$mos['name']."\", \"$class\", 0, 0, 0 ";
+$query .= ")";
+$message = mysql_query($query, $e107Connection) ? LAN_CREATED: LAN_CREATED_FAILED;
+
+}
+$text .= "</table></div>";
+
+echo $text."<br /><br /></div>";
+echo "<div style='text-align:center'>$message</div>";
+
+
+
+function goError($error){
+	echo "<b>{$error}</b></td></tr></table>";
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+
+require_once(e_ADMIN."footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/import/phpbb2.php 75/e107_files/import/phpbb2.php
--- 6171/e107_files/import/phpbb2.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/import/phpbb2.php	2005-12-24 20:02:41.000000000 -0600
@@ -0,0 +1,396 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/import/phpbb2.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/25 02:02:41 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+require_once(e_ADMIN."auth.php");
+
+if(!isset($_POST['do_conversion']))
+{
+
+	$text = "
+	<table style='width: 100%;' class='fborder'>
+	<tr>
+	<td class='forumheader3' style='text-align: center; margin-left: auto; margin-right: auto;'>
+	This script will import your phpBB2 database to e107. It will copy over users, forums, forum posts and polls.<br /><br /><br /><b>*** IMPORTANT ***<br />Running this script will empty your e107 forum, users and polls table - make sure you have a backup before continuing!</b>
+
+	<br /><br /><br />\n
+
+
+	<form method='post' action='".e_SELF."'>
+	Please enter the details for your phpBB2 database ...<br /><br />
+
+	<table style='width: 50%;' class='fborder'>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Host&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='phpbb2Host' size='30' value='localhost' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Username&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='phpbb2Username' size='30' value='' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Password&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='phpbb2Password' size='30' value='' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Database&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='phpbb2Database' size='30' value='phpbb2' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Table Prefix&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='phpbb2Prefix' size='30' value='phpbb_' maxlength='100' />
+	</tr>
+	</table>
+	<br /><br />
+	<input class='button' type='submit' name='do_conversion' value='Continue' />
+	</td>
+	</tr>
+	</table>";
+	
+	$ns -> tablerender("phpBB2 to e107 Conversion Script", $text);
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+if(!isset($_POST['phpbb2Host']) || !isset($_POST['phpbb2Username']) || !isset($_POST['phpbb2Password']) || !isset($_POST['phpbb2Database']))
+{
+	echo "Field(s) left blank, please go back and re-enter values.";
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+if(!isset($_POST['phpbb2Prefix']))
+{
+	$phpbb2Prefix = "";
+}
+
+extract($_POST);
+
+echo "<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader3' style='text-align: center; margin-left: auto; margin-right: auto;'>
+Attempting to connect to phpBB database [ {$phpbb2Database} @ {$phpbb2Host} ] ...<br />\n";
+flush();
+
+$phpbbConnection = mysql_connect($phpbb2Host, $phpbb2Username, $phpbb2Password, TRUE);
+if(!mysql_select_db($phpbb2Database, $phpbbConnection))
+{
+	goError("Error! Cound not connect to phpBB database. Please go back to the previous page and check your settings");
+}
+
+$e107Connection = mysql_connect($mySQLserver, $mySQLuser, $mySQLpassword, TRUE);
+if(!mysql_select_db($mySQLdefaultdb, $e107Connection))
+{
+	goError("Error! Cound not connect to e107 database.");
+}
+
+echo "Successfully connected to phpBB and e107 databases ...<br><br />";
+
+
+$phpbb_res = mysql_query("SELECT * FROM {$phpbb2Prefix}users", $phpbbConnection);
+if(!$phpbb_res)
+{
+	goError("Error! Unable to access ".$phpbb2Prefix."users table.");
+}
+
+
+while($user = mysql_fetch_array($phpbb_res))
+{
+	$userArray = convertUsers();
+	if($user['user_level'] != 1 && $user['user_id'] != -1)
+	{
+		$query = createQuery($userArray, $user, $mySQLprefix."user");		
+		echo (mysql_query($query, $e107Connection) ? "Successfully inserted user: ".$user['user_id'].": ".$user['username'] : "Unable to insert user: ".$user['user_id'].": ".$user['username']."<br />".mysql_errno() . ": " . mysql_error())."<br />";
+		flush();
+	}
+}
+
+
+// ### get phpbb categrories and inset them as forum parents
+
+mysql_query("TRUNCATE TABLE {$mySQLprefix}forum", $e107Connection);
+
+
+$phpbb_res = mysql_query("SELECT * FROM {$phpbb2Prefix}categories", $phpbbConnection);
+if(!$phpbb_res)
+{
+	goError("Error! Unable to access ".$phpbb2Prefix."categories table.");
+}
+
+$catcount = 500;
+while($parent = mysql_fetch_array($phpbb_res))
+{
+
+	$parentArray = convertParents($catcount);
+	
+	$query = createQuery($parentArray, $parent, $mySQLprefix."forum");	
+	echo (mysql_query($query, $e107Connection) ? "Successfully inserted parent: ".$parent['cat_id'].": ".$parent['cat_title'] : "Unable to insert parent: ".$parent['cat_id'].": ".$parent['cat_title']."<br />".mysql_errno() . ": " . mysql_error())."<br />";
+	flush();
+
+	$phpbb_res2 = mysql_query("SELECT * FROM {$phpbb2Prefix}forums WHERE cat_id = ".$parent['cat_id'], $phpbbConnection);
+	if($phpbb_res2)
+	{
+		while($forum = mysql_fetch_array($phpbb_res2))
+		{
+			$forumArray = convertForums($catcount);
+			$query = createQuery($forumArray, $forum, $mySQLprefix."forum");
+			echo (mysql_query($query, $e107Connection) ? "Successfully inserted forum: ".$parent['cat_id'].": ".$parent['cat_title'] : "Unable to insert forum: ".$parent['cat_id'].": ".$parent['cat_title']."<br />".mysql_errno() . ": " . mysql_error())."<br />";
+			flush();
+		}
+	}
+	else
+	{
+		echo "Didn't find any forums for parent '".$parent['cat_title']."'<br />";
+	}
+	$catcount ++;
+}
+
+mysql_query("TRUNCATE TABLE {$mySQLprefix}forum_t", $e107Connection);
+mysql_query("TRUNCATE TABLE {$mySQLprefix}polls", $e107Connection);
+
+$query = "SELECT * FROM {$phpbb2Prefix}topics 
+LEFT JOIN {$phpbb2Prefix}posts_text ON ({$phpbb2Prefix}topics.topic_title = {$phpbb2Prefix}posts_text.post_subject)
+LEFT JOIN {$phpbb2Prefix}posts ON ({$phpbb2Prefix}posts.post_id = {$phpbb2Prefix}posts_text.post_id)
+ORDER BY topic_time ASC";
+
+$phpbb_res = mysql_query($query, $phpbbConnection);
+if(!$phpbb_res)
+{
+	goError("Error! Unable to access ".$phpbb2Prefix."topics table.");
+}
+while($topic = mysql_fetch_array($phpbb_res))
+{
+
+	//echo "<pre>"; print_r($topic); echo "</pre>";
+
+	if($topic['topic_vote'])
+	{
+		// poll attached to this topic ...
+		$topic['topic_title'] = "[poll] ".$topic['topic_title'];
+		$query = "SELECT * FROM {$phpbb2Prefix}vote_desc WHERE topic_id=".$topic['topic_id'];
+		$phpbb_res3 = mysql_query($query, $phpbbConnection);
+		$pollQ = mysql_fetch_array($phpbb_res3);
+		
+		$query = "SELECT * FROM {$phpbb2Prefix}vote_results WHERE vote_id=".$pollQ['vote_id'];
+		$phpbb_res3 = mysql_query($query, $phpbbConnection);
+		$options = "";
+		$votes = "";
+		while($pollO = mysql_fetch_array($phpbb_res3))
+		{
+			$options .= $pollO['vote_option_text'].chr(1);
+			$votes .= $pollO['vote_result'].chr(1);
+		}
+
+		extract($pollQ);
+		$query = "INSERT INTO ".$mySQLprefix."polls VALUES ('0', {$vote_start}, {$vote_start}, 0, 0, '{$vote_text}', '{$options}', '{$votes}', '', 2, 0, 0, 0, 255, 0)";
+		echo (mysql_query($query, $e107Connection) ? "Poll successfully inserted" : "Unable to insert poll ({$query})")."<br />";
+	}
+
+
+	if($topic['topic_poster'] == 2)
+	{
+		$topic['topic_poster'] = 1;
+	}
+
+	if($topic['topic_poster'] == -1)
+	{
+		$topic['topic_poster'] = 0;
+		$poster = ($topic['post_username'] ? $topic['post_username'] : "Anonymous");
+	}
+
+	$topicArray = convertTopics($poster);
+	$query = createQuery($topicArray, $topic, $mySQLprefix."forum_t");	
+
+	if(!mysql_query($query, $e107Connection))
+	{
+		echo "Unable to insert topic: ".$topic['topic_id']."<br />";
+		flush();
+	}
+	else
+	{
+		echo "Successfully inserted topic: ".$topic['topic_id']."<br />";
+		flush();
+		$parent_id = mysql_insert_id();
+		$topic_id = $topic['topic_id'];
+
+		//echo "PARENT: $parent_id, TOPIC: $topic_id<br />"; 
+
+		$query = "SELECT * FROM {$phpbb2Prefix}posts LEFT JOIN {$phpbb2Prefix}posts_text ON ({$phpbb2Prefix}posts.post_id = {$phpbb2Prefix}posts_text.post_id) WHERE topic_id='{$topic_id}' AND post_subject = '' ORDER BY post_time DESC";
+		$phpbb_res2 = mysql_query($query, $phpbbConnection);
+		if(!$phpbb_res2)
+		{
+			goError("Error! Unable to access ".$phpbb2Prefix."posts / ".$phpbb2Prefix."posts_text table.");
+		}
+		while($post = mysql_fetch_array($phpbb_res2))
+		{
+			
+			if($post['poster_id'] == 2)
+			{
+				$post['poster_id'] = 1;
+			}
+			if($post['poster_id'] == -1)
+			{
+				$post['poster_id'] = 0;
+				$poster = ($post['post_username'] ? $post['post_username'] : "Anonymous");
+			}
+	
+
+			$postArray = convertForumPosts($parent_id, $poster);
+			$query = createQuery($postArray, $post, $mySQLprefix."forum_t");	
+			echo (mysql_query($query, $e107Connection) ? "Successfully inserted thread: ".$post['post_id'] : "Unable to insert thread: ".$parent['cat_id'].": ".$parent['cat_title']."<br />".mysql_errno() . ": " . mysql_error())."<br />";
+			flush();
+		}
+	}
+}
+
+
+echo "</td></tr></table>";
+
+require_once(e_ADMIN."footer.php");
+
+
+function goError($error)
+{
+	echo "<b>{$error}</b></td></tr></table>";
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+
+function convertUsers()
+{
+	$usersArray = array(
+		array("phpbb" => "user_id", "e107" => "user_id", "type" => "INT"),
+		array("phpbb" => "username", "e107" => "user_name", "type" => "STRING"),
+		array("phpbb" => "username", "e107" => "user_loginname", "type" => "STRING"),
+		array("phpbb" => "user_password", "e107" => "user_password", "type" => "STRING"),
+		array("phpbb" => "user_email", "e107" => "user_email", "type" => "STRING"),
+		array("phpbb" => "user_website", "e107" => "user_homepage", "type" => "STRING"),
+		array("phpbb" => "user_from", "e107" => "user_location", "type" => "STRING"),
+		array("phpbb" => "user_sig", "e107" => "user_signature", "type" => "STRING"),
+		array("phpbb" => "user_viewemail", "e107" => "user_hideemail", "type" => "INT"),
+		array("phpbb" => "user_regdate", "e107" => "user_join", "type" => "INT"), 
+		array("phpbb" => "user_posts", "e107" => "user_forums", "type" => "INT"), 
+		array("phpbb" => "user_level", "e107" => "user_admin", "type" => "INT")
+	);
+	return $usersArray;
+}
+
+function convertParents($catid)
+{
+	$parentArray = array(
+		array("phpbb" => "cat_id", "e107" => "forum_id", "type" => "INT", "value" => $catid),
+		array("phpbb" => "cat_title", "e107" => "forum_name", "type" => "STRING"),
+		array("phpbb" => "cat_order", "e107" => "forum_order", "type" => "INT")
+	);
+	return $parentArray;
+}
+
+function convertForums($catid)
+{
+	$forumArray = array(
+		array("phpbb" => "forum_id", "e107" => "forum_id", "type" => "INT"),
+		array("phpbb" => "cat_id", "e107" => "forum_parent", "type" => "STRING", "value" => $catid),
+		array("phpbb" => "forum_name", "e107" => "forum_name", "type" => "STRING"),
+		array("phpbb" => "forum_desc", "e107" => "forum_description", "type" => "STRING"),
+		array("phpbb" => "forum_order", "e107" => "forum_order", "type" => "INT"),
+		array("phpbb" => "forum_topics", "e107" => "forum_threads", "type" => "INT"),
+		array("phpbb" => "forum_posts", "e107" => "forum_replies", "type" => "INT")
+	);
+	return $forumArray;
+}
+
+
+function convertTopics($poster)
+{
+	$topicArray = array(
+		array("phpbb" => "forum_id", "e107" => "thread_forum_id", "type" => "INT"),
+		array("phpbb" => "topic_title", "e107" => "thread_name", "type" => "STRING"),
+		array("phpbb" => "post_text", "e107" => "thread_thread", "type" => "STRING"),
+		array("phpbb" => "topic_poster", "e107" => "thread_user", "type" => "INT"), 
+		array("phpbb" => "null", "e107" => "thread_active", "type" => "INT", "value" => 1), 
+		array("phpbb" => "topic_time", "e107" => "thread_datestamp", "type" => "INT"),
+		array("phpbb" => "topic_views", "e107" => "thread_views", "type" => "INT"),
+		array("phpbb" => "topic_replies", "e107" => "thread_total_replies", "type" => "INT"), 
+		array("phpbb" => "null", "e107" => "thread_parent", "type" => "INT", "value" => 0), 
+		array("phpbb" => "null", "e107" => "thread_anon", "type" => "INT", "value" => $poster)
+	);
+	return $topicArray;
+}
+
+
+
+
+function convertForumPosts($parent_id, $poster)
+{
+	$postArray = array(
+		array("phpbb" => "post_text", "e107" => "thread_thread", "type" => "STRING"),
+		array("phpbb" => "forum_id", "e107" => "thread_forum_id", "type" => "INT"),
+		array("phpbb" => "post_time", "e107" => "thread_datestamp", "type" => "INT"),
+		array("phpbb" => "topic_views", "e107" => "thread_views", "type" => "INT"),
+		array("phpbb" => "post_time", "e107" => "thread_lastpost", "type" => "INT"),
+		array("phpbb" => "poster_id", "e107" => "thread_user", "type" => "INT"), 
+		array("phpbb" => "post_subject", "e107" => "thread_name", "type" => "STRING"), 
+		array("phpbb" => "null", "e107" => "thread_parent", "type" => "INT", "value" => $parent_id), 
+		array("phpbb" => "null", "e107" => "thread_anon", "type" => "INT", "value" => $poster)
+	);
+	return $postArray;
+}
+
+
+
+
+
+
+function createQuery($convertArray, $dataArray, $table)
+{
+	global $tp;
+
+	$columns = "(";
+	$values = "(";
+
+
+	foreach($convertArray as $convert)
+	{
+		if($convert['type'] == "STRING")
+		{
+			$dataArray[$convert['phpbb']] = preg_replace("#\[.*\]#", "", $tp -> toDB($dataArray[$convert['phpbb']]));
+		}
+		$columns .= $convert['e107'].",";
+		$values .= (array_key_exists("value", $convert) ? "'".$convert['value']."'," : "'".$dataArray[$convert['phpbb']]."',");
+	}
+	
+
+	$columns = substr($columns, 0, -1).")";
+	$values = substr($values, 0, -1).")";
+
+	return "INSERT INTO $table $columns VALUES $values";
+	
+}	
+
+
+
+
+
+
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/import/phpnuke.php 75/e107_files/import/phpnuke.php
--- 6171/e107_files/import/phpnuke.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/import/phpnuke.php	2005-12-24 20:02:41.000000000 -0600
@@ -0,0 +1,393 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/import/phpnuke.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/25 02:02:41 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+require_once(e_ADMIN."auth.php");
+
+define("ASYSTEM", "php-nuke");
+define("DEFAULTPREFIX", "nuke_");
+
+if(!isset($_POST['do_conversion']))
+{
+
+	$text = "
+	<table style='width: 100%;' class='fborder'>
+	<tr>
+	<td class='forumheader3' style='text-align: center; margin-left: auto; margin-right: auto;'>
+	This script will import your ".ASYSTEM." database to e107. <br /><br /><br /><b>*** IMPORTANT ***<br />Running this script will empty most of your e107 tables - make sure you have a backup before continuing!</b>
+
+	<br /><br /><br />\n
+
+
+	<form method='post' action='".e_SELF."'>
+	Please enter the details for your ".ASYSTEM." database ...<br /><br />
+
+	<table style='width: 50%;' class='fborder'>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Host&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='dbHost' size='30' value='localhost' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Username&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='dbUsername' size='30' value='' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Password&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='dbPassword' size='30' value='' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Database&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='dbDatabase' size='30' value='' maxlength='100' />
+	</tr>
+	<tr>
+	<td style='width: 50%; text-align: right;'>Table Prefix&nbsp;&nbsp;</td>
+	<td style='width: 50%; text-align: left;'><input class='tbox' type='text' name='dbPrefix' size='30' value='".DEFAULTPREFIX."' maxlength='100' />
+	</tr>
+	</table>
+	<br /><br />
+	<input class='button' type='submit' name='do_conversion' value='Continue' />
+	</td>
+	</tr>
+	</table>";
+	
+	$ns -> tablerender(ASYSTEM." to e107 Conversion Script", $text);
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+if(!isset($_POST['dbHost']) || !isset($_POST['dbUsername']) || !isset($_POST['dbPassword']) || !isset($_POST['dbDatabase']))
+{
+	echo "Field(s) left blank, please go back and re-enter values.";
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+if(!isset($_POST['dbPrefix']))
+{
+	$nukePrefix = "";
+}
+
+extract($_POST);
+
+echo "<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader3' style='text-align: center; margin-left: auto; margin-right: auto;'>
+Attempting to connect to ".ASYSTEM." database [ {$dbDatabase} @ {$dbHost} ] ...<br />\n";
+flush();
+
+$ASystemConnection = mysql_connect($dbHost, $dbUsername, $dbPassword, TRUE);
+if(!mysql_select_db($dbDatabase, $ASystemConnection))
+{
+	goError("Error! Cound not connect to ".ASYSTEM." database. Please go back to the previous page and check your settings");
+}
+
+$e107Connection = mysql_connect($mySQLserver, $mySQLuser, $mySQLpassword, TRUE);
+if(!mysql_select_db($mySQLdefaultdb, $e107Connection))
+{
+	goError("Error! Cound not connect to e107 database.");
+}
+
+echo "Successfully connected to ".ASYSTEM." and e107 databases ...<br><br />";
+
+/* ++++++++++++++ USERS ++++++++++++++ */
+$result = mysql_query("SELECT * FROM {$dbPrefix}users", $ASystemConnection);
+if(!$result)
+{
+	goError("Error! Unable to access ".$dbPrefix."users table.");
+}
+$pass = 0; $fail = 0;
+while($aResult = mysql_fetch_array($result))
+{
+	$aArray = convertUsers();
+	$query = createQuery($aArray, $aResult, $mySQLprefix."user");		
+	if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;}
+	flush();
+}
+echo "Inserted $pass users into database ($fail fails).<br />";
+/* +++++++++++++++ END +++++++++++++++ */
+
+/* ++++++++++++++ NEWS ++++++++++++++ */
+$query = "SELECT * FROM {$dbPrefix}stories
+LEFT JOIN {$dbPrefix}users ON {$dbPrefix}stories.aid={$dbPrefix}users.username
+ORDER BY {$dbPrefix}stories.sid ASC";
+
+$result = mysql_query($query, $ASystemConnection);
+if(!$result)
+{
+	goError("Error! Unable to access ".$dbPrefix."stories table.");
+}
+$pass = 0; $fail = 0;
+while($aResult = mysql_fetch_array($result))
+{
+	$aArray = convertNews();
+	$query = createQuery($aArray, $aResult, $mySQLprefix."news");		
+	if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;}
+	flush();
+}
+echo "Inserted $pass news items into database ($fail fails).<br />";
+/* +++++++++++++++ END +++++++++++++++ */
+
+/* ++++++++++++++ BANLIST ++++++++++++++ */
+$result = mysql_query("SELECT * FROM {$dbPrefix}banned_ip", $ASystemConnection);
+if(!$result)
+{
+	goError("Error! Unable to access ".$dbPrefix."banned_ip table.");
+}
+$pass = 0; $fail = 0;
+while($aResult = mysql_fetch_array($result))
+{
+	$aArray = convertBans();
+	$query = createQuery($aArray, $aResult, $mySQLprefix."banlist");		
+	if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;}
+	flush();
+}
+echo "Inserted $pass banned IP addresses into database ($fail fails).<br />";
+/* +++++++++++++++ END +++++++++++++++ */
+
+/* ++++++++++++++ CUSTOM PAGES ++++++++++++++ */
+$result = mysql_query("SELECT * FROM {$dbPrefix}pages", $ASystemConnection);
+if(!$result)
+{
+	goError("Error! Unable to access ".$dbPrefix."pages table.");
+}
+$pass = 0; $fail = 0;
+while($aResult = mysql_fetch_array($result))
+{
+	$aArray = convertPages();
+	$query = createQuery($aArray, $aResult, $mySQLprefix."page");		
+	if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;}
+	flush();
+}
+echo "Inserted $pass custom pages into database ($fail fails).<br />";
+/* +++++++++++++++ END +++++++++++++++ */
+
+
+/* ++++++++++++++ FORUMS ++++++++++++++ 
+
+$result = mysql_query("SHOW COLUMNS FROM {$mySQLprefix}forum", $e107Connection);
+if(!$result)
+{
+	goError("Error! Unable to access the e107 'forum' table - have you installed the e107 Forum System plugin?");
+}
+$result = mysql_query("SELECT * FROM {$dbPrefix}bbforums ORDER BY forum_order ASC", $ASystemConnection);
+if(!$result)
+{
+	goError("Error! Unable to access ".$dbPrefix."bbforums table.");
+}
+$pass = 0; $fail = 0;
+while($aResult = mysql_fetch_array($result))
+{
+	$aArray = convertForums();
+	$query = createQuery($aArray, $aResult, $mySQLprefix."forum");		
+	if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;}
+	flush();
+}
+
+	$query = "INSERT INTO {$mySQLprefix}forum VALUES (0, 'Default Forum Parent', 'This parent has been created by the ".ASYSTEM." conversion script, you can edit it from admin -> forums', '0', '0', '".time()."', '', '0', '0', '', '', '', '0', '0')";
+	mysql_query($query, $e107Connection);
+	$id = mysql_insert_id();
+	$query = "UPDATE {$mySQLprefix}forum SET forum_parent='$id' WHERE forum_name!='Default Forum Parent'";
+	mysql_query($query, $e107Connection);
+
+echo "Inserted $pass forums into database ($fail fails).<br />";
+/* +++++++++++++++ END +++++++++++++++ */
+
+
+/* ++++++++++++++ FORUM POSTS ++++++++++++++ 
+$query = "SELECT * FROM {$dbPrefix}bbposts
+LEFT JOIN {$dbPrefix}bbposts_text ON {$dbPrefix}bbposts.post_id={$dbPrefix}bbposts_text.post_id 
+LEFT JOIN {$dbPrefix}users ON {$dbPrefix}bbposts.poster_id={$dbPrefix}users.user_id  
+ORDER BY {$dbPrefix}bbposts.post_id ASC";
+
+$result = mysql_query($query, $ASystemConnection);
+if(!$result)
+{
+	goError("Error! Unable to access ".$dbPrefix."stories table.");
+}
+$pass = 0; $fail = 0;
+while($aResult = mysql_fetch_array($result))
+{
+	$aArray = convertForumPosts();
+	$query = createQuery($aArray, $aResult, $mySQLprefix."forum_t");
+	$poster = ($aResult['poster_id'] == -1 ? "0.".($aResult['username'] ? $aResult['username'] : "Anonymous") : $aResult['poster_id'].".".$aResult['username']);
+	$query = str_replace("''", "'$poster'", $query);
+	if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;}
+	flush();
+}
+echo "Inserted $pass forum posts into database ($fail fails).<br />";
+ +++++++++++++++ END +++++++++++++++ */
+
+
+
+echo "</td></tr></table>";
+
+require_once(e_ADMIN."footer.php");
+
+
+function goError($error)
+{
+	echo "<b>{$error}</b></td></tr></table>";
+	require_once(e_ADMIN."footer.php");
+	exit;
+}
+
+
+function convertUsers()
+{
+	$rArray = array(
+		array("asystem" => "user_id", "e107" => "user_id", "type" => "INT"),
+		array("asystem" => "name", "e107" => "user_login", "type" => "STRING"),
+		array("asystem" => "username", "e107" => "user_name", "type" => "STRING"),
+		array("asystem" => "username", "e107" => "user_loginname", "type" => "STRING"),
+		array("asystem" => "user_password", "e107" => "user_password", "type" => "STRING"),
+		array("asystem" => "user_email", "e107" => "user_email", "type" => "STRING"),
+		array("asystem" => "user_avatar", "e107" => "user_image", "type" => "STRING"),
+		array("asystem" => "user_regdate", "e107" => "user_join", "type" => "STRTOTIME"),
+		array("asystem" => "user_sig", "e107" => "user_signature", "type" => "STRING"),
+		array("asystem" => "user_viewemail", "e107" => "user_hideemail", "type" => "INT"),
+		array("asystem" => "user_posts", "e107" => "user_forums", "type" => "INT"), 
+		array("asystem" => "user_lastvisit", "e107" => "user_lastvisit", "type" => "INT"), 
+		array("asystem" => "user_timezone", "e107" => "user_timezone", "type" => "STRING")
+	);
+	return $rArray;
+}
+
+function convertNews()
+{
+	$rArray = array(
+		array("asystem" => "sid", "e107" => "news_id", "type" => "INT"),
+		array("asystem" => "user_id", "e107" => "news_author", "type" => "INT"),
+		array("asystem" => "title", "e107" => "news_title", "type" => "STRING"),
+		array("asystem" => "time", "e107" => " news_datestamp", "type" => "STRTOTIME"),
+		array("asystem" => "hometext", "e107" => " news_body", "type" => "STRING"),
+		array("asystem" => "bodytext", "e107" => " news_extended", "type" => "STRING"),
+		array("asystem" => "comments", "e107" => " news_comment_total", "type" => "INT"),
+		array("asystem" => "catid", "e107" => " news_category", "type" => "INT")
+	);
+	return $rArray;
+}
+
+function convertBans()
+{
+	$rArray = array(
+		array("asystem" => "ip_address", "e107" => " banlist_ip", "type" => "STRING"),
+		array("asystem" => "reason", "e107" => "banlist_reason", "type" => "STRING")
+	);
+	return $rArray;
+}
+
+
+function convertPages()
+{
+	$rArray = array(
+		array("asystem" => "pid", "e107" => "page_id", "type" => "INT"),
+		array("asystem" => "title", "e107" => "page_title", "type" => "STRING"),
+		array("asystem" => "text", "e107" => "page_text", "type" => "STRING"), 
+		array("asystem" => "date", "e107" => "page_datestamp", "type" => "STRTOTIME")
+	);
+	return $rArray;
+}
+
+/*
+function convertForums()
+{
+	$rArray = array(
+		array("asystem" => "forum_id", "e107" => "forum_id", "type" => "INT"),
+		array("asystem" => "forum_name", "e107" => "forum_name", "type" => "STRING"),
+		array("asystem" => "forum_desc", "e107" => "forum_description", "type" => "STRING"), 
+		array("asystem" => "forum_topics", "e107" => "forum_threads", "type" => "INT"), 
+		array("asystem" => "forum_posts", "e107" => "forum_replies", "type" => "INT"), 
+		array("asystem" => "null", "e107" => "forum_postclass", "type" => "INT", "value" => 253), 
+		array("asystem" => "null", "e107" => "forum_moderators", "type" => "INT", "value" => 2), 
+		array("asystem" => "null", "e107" => "forum_class", "type" => "INT", "value" => 0)
+	);
+	return $rArray;
+}
+
+
+ function convertForumPosts()
+{
+	$rArray = array(
+		array("asystem" => "post_id", "e107" => "thread_id", "type" => "INT"),
+		array("asystem" => "topic_id", "e107" => "thread_parent", "type" => "INT"),
+		array("asystem" => "forum_id", "e107" => "thread_forum_id", "type" => "INT"), 
+		array("asystem" => "null", "e107" => "thread_active", "type" => "INT", "value" => 1), 
+		array("asystem" => "poster", "e107" => "thread_user", "type" => "STRING"), 
+		array("asystem" => "post_time", "e107" => "thread_datestamp", "type" => "INT"), 
+		array("asystem" => "post_subject", "e107" => "thread_name", "type" => "STRING"), 
+		array("asystem" => "post_text", "e107" => "thread_thread", "type" => "STRING")
+	);
+	return $rArray;
+}
+*/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+function createQuery($convertArray, $dataArray, $table)
+{
+	global $tp;
+
+	$columns = "(";
+	$values = "(";
+
+
+	foreach($convertArray as $convert)
+	{
+		if($convert['type'] == "STRING")
+		{
+			$dataArray[$convert['asystem']] = preg_replace("#\[.*\]#", "", $tp -> toDB($dataArray[$convert['asystem']]));
+		}
+		else if($convert['type'] == "STRTOTIME")
+		{
+			$dataArray[$convert['asystem']] = strtotime($dataArray[$convert['asystem']]);
+		}
+
+		$columns .= $convert['e107'].",";
+		$values .= (array_key_exists("value", $convert) ? "'".$convert['value']."'," : "'".$dataArray[$convert['asystem']]."',");
+	}
+	
+
+	$columns = substr($columns, 0, -1).")";
+	$values = substr($values, 0, -1).")";
+
+	return "INSERT INTO $table $columns VALUES $values";
+	
+}	
+
+
+
+
+
+
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/nav_menu_alt.js 75/e107_files/nav_menu_alt.js
--- 6171/e107_files/nav_menu_alt.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/nav_menu_alt.js	2005-11-23 12:11:14.000000000 -0600
@@ -0,0 +1,588 @@
+//<![CDATA[
+
+//*****************************************************************************
+// Do not remove this notice.
+//
+// Copyright 2000-2004 by Mike Hall.
+// See http://www.brainjar.com for terms of use.
+//*****************************************************************************
+
+//----------------------------------------------------------------------------
+// Code to determine the browser and version.
+//----------------------------------------------------------------------------
+
+function Browser() {
+
+  var ua, s, i;
+
+  this.isIE    = false;  // Internet Explorer
+  this.isOP    = false;  // Opera
+  this.isNS    = false;  // Netscape
+  this.version = null;
+
+  ua = navigator.userAgent;
+
+  s = "Opera";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isOP = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  s = "Netscape6/";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  // Treat any other "Gecko" browser as Netscape 6.1.
+
+  s = "Gecko";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = 6.1;
+    return;
+  }
+
+  s = "MSIE";
+  if ((i = ua.indexOf(s))) {
+    this.isIE = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+}
+
+var browser = new Browser();
+
+//----------------------------------------------------------------------------
+// Code for handling the menu bar and active button.
+//----------------------------------------------------------------------------
+
+var activeButton = null;
+
+/* [MODIFIED] This code commented out, not needed for activate/deactivate
+   on mouseover.
+
+// Capture mouse clicks on the page so any active button can be
+// deactivated.
+
+if (browser.isIE)
+  document.onmousedown = pageMousedown;
+else
+  document.addEventListener("mousedown", pageMousedown, true);
+
+function pageMousedown(event) {
+
+  var el;
+
+  // If there is no active button, exit.
+
+  if (activeButton == null)
+    return;
+
+  // Find the element that was clicked on.
+
+  if (browser.isIE)
+    el = window.event.srcElement;
+  else
+    el = (event.target.tagName ? event.target : event.target.parentNode);
+
+  // If the active button was clicked on, exit.
+
+  if (el == activeButton)
+    return;
+
+  // If the element is not part of a menu, reset and clear the active
+  // button.
+
+  if (getContainerWith(el, "DIV", "menu") == null) {
+    resetButton(activeButton);
+    activeButton = null;
+  }
+}
+
+[END MODIFIED] */
+
+function buttonClick(event, menuId) {
+
+  var button;
+
+  // Get the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // Blur focus from the link to remove that annoying outline.
+
+  button.blur();
+
+  // Associate the named menu to this button if not already done.
+  // Additionally, initialize menu display.
+
+  if (button.menu == null) {
+    button.menu = document.getElementById(menuId);
+    if (button.menu.isInitialized == null)
+      menuInit(button.menu);
+  }
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the button, if not already done.
+
+  if (button.onmouseout == null)
+    button.onmouseout = buttonOrMenuMouseout;
+
+  // Exit if this button is the currently active one.
+
+  if (button == activeButton)
+    return false;
+
+  // [END MODIFIED]
+
+  // Reset the currently active button, if any.
+
+  if (activeButton != null)
+    resetButton(activeButton);
+
+  // Activate this button, unless it was the currently active one.
+
+  if (button != activeButton) {
+    depressButton(button);
+    activeButton = button;
+  }
+  else
+    activeButton = null;
+
+  return false;
+}
+
+function buttonMouseover(event, menuId) {
+
+  var button;
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Activates this button's menu if no other is currently active.
+
+  if (activeButton == null) {
+    buttonClick(event, menuId);
+    return;
+  }
+
+  // [END MODIFIED]
+
+  // Find the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // If any other button menu is active, make this one active instead.
+
+  if (activeButton != null && activeButton != button)
+    buttonClick(event, menuId);
+}
+
+function depressButton(button) {
+
+  var x, y;
+
+  // Update the button's style class to make it look like it's
+  // depressed.
+
+  button.className += " menuButtonActive";
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the button, if not already done.
+
+  if (button.onmouseout == null)
+    button.onmouseout = buttonOrMenuMouseout;
+  if (button.menu.onmouseout == null)
+    button.menu.onmouseout = buttonOrMenuMouseout;
+
+  // [END MODIFIED]
+
+  // Position the associated drop down menu under the button and
+  // show it.
+
+  x = getPageOffsetLeft(button);
+  y = getPageOffsetTop(button) + button.offsetHeight;
+
+  // For IE, adjust position.
+
+  if (browser.isIE) {
+    x += button.offsetParent.clientLeft;
+    y += button.offsetParent.clientTop - 1;
+  }
+
+  button.menu.style.left = x + "px";
+  button.menu.style.top  = y + "px";
+  button.menu.style.visibility = "visible";
+
+  // For IE; size, position and show the menu's IFRAME as well.
+
+  if (button.menu.iframeEl != null)
+  {
+    button.menu.iframeEl.style.left = button.menu.style.left;
+    button.menu.iframeEl.style.top  = button.menu.style.top;
+    button.menu.iframeEl.style.width  = button.menu.offsetWidth + "px";
+    button.menu.iframeEl.style.height = button.menu.offsetHeight + "px";
+    button.menu.iframeEl.style.display = "";
+  }
+}
+
+function resetButton(button) {
+
+  // Restore the button's style class.
+
+  removeClassName(button, "menuButtonActive");
+
+  // Hide the button's menu, first closing any sub menus.
+
+  if (button.menu != null) {
+    closeSubMenu(button.menu);
+    button.menu.style.visibility = "hidden";
+
+    // For IE, hide menu's IFRAME as well.
+
+    if (button.menu.iframeEl != null)
+      button.menu.iframeEl.style.display = "none";
+  }
+}
+
+//----------------------------------------------------------------------------
+// Code to handle the menus and sub menus.
+//----------------------------------------------------------------------------
+
+function menuMouseover(event) {
+
+  var menu;
+
+  // Find the target menu element.
+
+  if (browser.isIE)
+    menu = getContainerWith(window.event.srcElement, "DIV", "menu");
+  else
+    menu = event.currentTarget;
+
+  // Close any active sub menu.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+}
+
+function menuItemMouseover(event, menuId) {
+
+  var item, menu, x, y;
+
+  // Find the target item element and its parent menu element.
+
+  if (browser.isIE)
+    item = getContainerWith(window.event.srcElement, "A", "menuItem");
+  else
+    item = event.currentTarget;
+  menu = getContainerWith(item, "DIV", "menu");
+
+  // Close any active sub menu and mark this one as active.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+  menu.activeItem = item;
+
+  // Highlight the item element.
+
+  item.className += " menuItemHighlight";
+
+  // Initialize the sub menu, if not already done.
+
+  if (item.subMenu == null) {
+    item.subMenu = document.getElementById(menuId);
+    if (item.subMenu.isInitialized == null)
+      menuInit(item.subMenu);
+  }
+
+  // [MODIFIED] Added for activate/deactivate on mouseover.
+
+  // Set mouseout event handler for the sub menu, if not already done.
+
+  if (item.subMenu.onmouseout == null)
+    item.subMenu.onmouseout = buttonOrMenuMouseout;
+
+  // [END MODIFIED]
+
+  // Get position for submenu based on the menu item.
+
+  x = getPageOffsetLeft(item) + item.offsetWidth;
+  y = getPageOffsetTop(item);
+
+  // Adjust position to fit in view.
+
+  var maxX, maxY;
+
+  if (browser.isIE) {
+    maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) +
+      (document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth);
+    maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) +
+      (document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight);
+  }
+  if (browser.isOP) {
+    maxX = document.documentElement.scrollLeft + window.innerWidth;
+    maxY = document.documentElement.scrollTop  + window.innerHeight;
+  }
+  if (browser.isNS) {
+    maxX = window.scrollX + window.innerWidth;
+    maxY = window.scrollY + window.innerHeight;
+  }
+  maxX -= item.subMenu.offsetWidth;
+  maxY -= item.subMenu.offsetHeight;
+
+  if (x > maxX)
+    x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
+      + (menu.offsetWidth - item.offsetWidth));
+  y = Math.max(0, Math.min(y, maxY));
+
+  // Position and show the sub menu.
+
+  item.subMenu.style.left       = x + "px";
+  item.subMenu.style.top        = y + "px";
+  item.subMenu.style.visibility = "visible";
+
+  // For IE; size, position and display the menu's IFRAME as well.
+
+  if (item.subMenu.iframeEl != null)
+  {
+    item.subMenu.iframeEl.style.left    = item.subMenu.style.left;
+    item.subMenu.iframeEl.style.top     = item.subMenu.style.top;
+    item.subMenu.iframeEl.style.width   = item.subMenu.offsetWidth + "px";
+    item.subMenu.iframeEl.style.height  = item.subMenu.offsetHeight + "px";
+    item.subMenu.iframeEl.style.display = "";
+  }
+
+  // Stop the event from bubbling.
+
+  if (browser.isIE)
+    window.event.cancelBubble = true;
+  else
+    event.stopPropagation();
+}
+
+function closeSubMenu(menu) {
+
+  if (menu == null || menu.activeItem == null)
+    return;
+
+  // Recursively close any sub menus.
+
+  if (menu.activeItem.subMenu != null) {
+    closeSubMenu(menu.activeItem.subMenu);
+    menu.activeItem.subMenu.style.visibility = "hidden";
+
+    // For IE, hide the sub menu's IFRAME as well.
+
+    if (menu.activeItem.subMenu.iframeEl != null)
+      menu.activeItem.subMenu.iframeEl.style.display = "none";
+
+    menu.activeItem.subMenu = null;
+  }
+
+  // Deactivate the active menu item.
+
+  removeClassName(menu.activeItem, "menuItemHighlight");
+  menu.activeItem = null;
+}
+
+// [MODIFIED] Added for activate/deactivate on mouseover. Handler for mouseout
+// event on buttons and menus.
+
+function buttonOrMenuMouseout(event) {
+
+  var el;
+
+  // If there is no active button, exit.
+
+  if (activeButton == null)
+    return;
+
+  // Find the element the mouse is moving to.
+
+  if (browser.isIE)
+    el = window.event.toElement;
+  else if (event.relatedTarget != null)
+      el = (event.relatedTarget.tagName ? event.relatedTarget : event.relatedTarget.parentNode);
+
+  // If the element is not part of a menu, reset the active button.
+
+  if (getContainerWith(el, "DIV", "menu") == null) {
+    resetButton(activeButton);
+    activeButton = null;
+  }
+}
+
+// [END MODIFIED]
+
+//----------------------------------------------------------------------------
+// Code to initialize menus.
+//----------------------------------------------------------------------------
+
+function menuInit(menu) {
+
+  var itemList, spanList;
+  var textEl, arrowEl;
+  var itemWidth;
+  var w, dw;
+  var i, j;
+
+  // For IE, replace arrow characters.
+
+  if (browser.isIE) {
+    menu.style.lineHeight = "2.5ex";
+    spanList = menu.getElementsByTagName("SPAN");
+    for (i = 0; i < spanList.length; i++)
+      if (hasClassName(spanList[i], "menuItemArrow")) {
+        spanList[i].style.fontFamily = "Webdings";
+        spanList[i].firstChild.nodeValue = "4";
+      }
+  }
+
+  // Find the width of a menu item.
+
+  itemList = menu.getElementsByTagName("A");
+  if (itemList.length > 0)
+    itemWidth = itemList[0].offsetWidth;
+  else
+    return;
+
+  // For items with arrows, add padding to item text to make the
+  // arrows flush right.
+
+  for (i = 0; i < itemList.length; i++) {
+    spanList = itemList[i].getElementsByTagName("SPAN");
+    textEl  = null;
+    arrowEl = null;
+    for (j = 0; j < spanList.length; j++) {
+      if (hasClassName(spanList[j], "menuItemText"))
+        textEl = spanList[j];
+      if (hasClassName(spanList[j], "menuItemArrow"))
+        arrowEl = spanList[j];
+    }
+    if (textEl != null && arrowEl != null) {
+      textEl.style.paddingRight = (itemWidth 
+        - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
+      // For Opera, remove the negative right margin to fix a display bug.
+      if (browser.isOP)
+        arrowEl.style.marginRight = "0px";
+    }
+  }
+
+  // Fix IE hover problem by setting an explicit width on first item of
+  // the menu.
+
+  if (browser.isIE) {
+    w = itemList[0].offsetWidth;
+    itemList[0].style.width = w + "px";
+    dw = itemList[0].offsetWidth - w;
+    w -= dw;
+    itemList[0].style.width = w + "px";
+  }
+
+  // Fix the IE display problem (SELECT elements and other windowed controls
+  // overlaying the menu) by adding an IFRAME under the menu.
+
+  if (browser.isIE) {
+    var iframeEl = document.createElement("iframe");
+    iframeEl.frameBorder = 0;
+    iframeEl.src = "#";
+    iframeEl.style.display = "none";
+    iframeEl.style.position = "absolute";
+    iframeEl.style.filter = "progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
+    menu.iframeEl = menu.parentNode.insertBefore(iframeEl, menu);
+  }
+
+  // Mark menu as initialized.
+
+  menu.isInitialized = true;
+}
+
+//----------------------------------------------------------------------------
+// General utility functions.
+//----------------------------------------------------------------------------
+
+function getContainerWith(node, tagName, className) {
+
+  // Starting with the given node, find the nearest containing element
+  // with the specified tag name and style class.
+
+  while (node != null) {
+    if (node.tagName != null && node.tagName == tagName &&
+        hasClassName(node, className))
+      return node;
+    node = node.parentNode;
+  }
+
+  return node;
+}
+
+function hasClassName(el, name) {
+
+  var i, list;
+
+  // Return true if the given element currently has the given class
+  // name.
+
+  list = el.className.split(" ");
+  for (i = 0; i < list.length; i++)
+    if (list[i] == name)
+      return true;
+
+  return false;
+}
+
+function removeClassName(el, name) {
+
+  var i, curList, newList;
+
+  if (el.className == null)
+    return;
+
+  // Remove the given class name from the element's className property.
+
+  newList = new Array();
+  curList = el.className.split(" ");
+  for (i = 0; i < curList.length; i++)
+    if (curList[i] != name)
+      newList.push(curList[i]);
+  el.className = newList.join(" ");
+}
+
+function getPageOffsetLeft(el) {
+
+  var x;
+
+  // Return the x coordinate of an element relative to the page.
+
+  x = el.offsetLeft;
+  if (el.offsetParent != null)
+    x += getPageOffsetLeft(el.offsetParent);
+
+  return x;
+}
+
+function getPageOffsetTop(el) {
+
+  var y;
+
+  // Return the x coordinate of an element relative to the page.
+
+  y = el.offsetTop;
+  if (el.offsetParent != null)
+    y += getPageOffsetTop(el.offsetParent);
+
+  return y;
+}
+
+//]]>
\ No newline at end of file
diff -ruN 6171/e107_files/nav_menu.css 75/e107_files/nav_menu.css
--- 6171/e107_files/nav_menu.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/nav_menu.css	2005-02-01 07:18:34.000000000 -0600
@@ -0,0 +1,108 @@
+div.menuBar,
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over, 
+div.menu,
+div.menu a.menuItem {
+  font-family: "MS Sans Serif2", arial, sans-serif;
+  font-size: 11px;
+  font-style: normal;
+  font-weight: normal;
+  color: #000000;
+}
+
+div.menuBar {
+  background-color: #FFF8D9;
+  border-top: 1px solid #ffffff;
+  border-bottom: 0px solid #000;
+  padding: 4px 0px 4px 0px;
+  text-align: left;
+}
+
+div.emenuBar {
+  background-color: #FFF8D9;
+  border-top: 1px solid #ffffff;
+  border-bottom: 0px solid #000;
+  text-align: left;
+}
+
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over {
+  background-color: transparent;
+  border: 1px solid #FFF8D9;
+  color: #000000;
+  cursor: default;
+  left: 0px;
+  margin: 0px;
+  padding: 2px 4px 2px 22px;
+  position: relative;
+  text-decoration: none;
+  top: 0px;
+  z-index: 100;
+}
+
+div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over {
+  background-color: transparent;
+  border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff;
+  color: #000000;
+}
+
+div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, 
+div.menuBar a.menuButtonActive:hover {
+  background-color: #ffffef;
+  border-color: #a5a5a5 #ffffff #ffffff #a5a5a5;
+  color: #000;
+  left: 1px;
+  top: 1px;
+}
+
+div.menu {
+  background-color: #FFF8D9;
+  border: 1px solid;
+  border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff;
+  left: 0px;
+  padding: 1px 1px 1px 1px;
+  position: absolute;
+  top: 0px;
+  visibility: hidden;
+  z-index: 101;
+}
+
+div.menu a.menuItem {
+  color: #000000;
+  cursor: default;
+  display: block;
+  padding: 2px 11px 2px 0px;
+  text-decoration: none;
+  white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+  background-color: #ffffef;
+  color: #000000;
+}
+
+div.menu a.menuItem span.menuItemBuffer {
+  padding: 0px 2px 0px 2px;
+  color: #ffffff;
+}
+
+div.menu a.menuItem:hover span.menuItemBuffer {
+  padding: 0px 2px 0px 2px;
+  color: #000000;
+}
+
+div.menu a.menuItem span.menuItemText {
+	padding: 0px 0px 0px 3px;
+}
+
+div.menu a.menuItem span.menuItemArrow {
+  margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+  border-top: 1px solid #a5a5a5;
+  border-bottom: 1px solid #ffffff;
+  margin: 4px 2px;
+}
+
+a.menuItem.header {
+  border-bottom: 1px solid #b3b3b3;
+}
\ No newline at end of file
diff -ruN 6171/e107_files/nav_menu.js 75/e107_files/nav_menu.js
--- 6171/e107_files/nav_menu.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/nav_menu.js	2005-11-23 11:36:29.000000000 -0600
@@ -0,0 +1,511 @@
+//<![CDATA[
+
+//*****************************************************************************
+// Do not remove this notice.
+//
+// Copyright 2000-2004 by Mike Hall.
+// See http://www.brainjar.com for terms of use.
+//*****************************************************************************
+
+//----------------------------------------------------------------------------
+// Code to determine the browser and version.
+//----------------------------------------------------------------------------
+
+function Browser() {
+
+  var ua, s, i;
+
+  this.isIE    = false;  // Internet Explorer
+  this.isOP    = false;  // Opera
+  this.isNS    = false;  // Netscape
+  this.version = null;
+
+  ua = navigator.userAgent;
+
+  s = "Opera";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isOP = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  s = "Netscape6/";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+
+  // Treat any other "Gecko" browser as Netscape 6.1.
+
+  s = "Gecko";
+  if ((i = ua.indexOf(s)) >= 0) {
+    this.isNS = true;
+    this.version = 6.1;
+    return;
+  }
+
+  s = "MSIE";
+  if ((i = ua.indexOf(s))) {
+    this.isIE = true;
+    this.version = parseFloat(ua.substr(i + s.length));
+    return;
+  }
+}
+
+var browser = new Browser();
+
+//----------------------------------------------------------------------------
+// Code for handling the menu bar and active button.
+//----------------------------------------------------------------------------
+
+var activeButton = null;
+
+// Capture mouse clicks on the page so any active button can be
+// deactivated.
+
+if (browser.isIE)
+  document.onmousedown = pageMousedown;
+else
+  document.addEventListener("mousedown", pageMousedown, true);
+
+function pageMousedown(event) {
+
+  var el;
+
+  // If there is no active button, exit.
+
+  if (activeButton == null)
+    return;
+
+  // Find the element that was clicked on.
+
+  if (browser.isIE)
+    el = window.event.srcElement;
+  else
+    el = (event.target.tagName ? event.target : event.target.parentNode);
+
+  // If the active button was clicked on, exit.
+
+  if (el == activeButton)
+    return;
+
+  // If the element is not part of a menu, reset and clear the active
+  // button.
+
+  if (getContainerWith(el, "DIV", "menu") == null) {
+    resetButton(activeButton);
+    activeButton = null;
+  }
+}
+
+function buttonClick(event, menuId) {
+
+  var button;
+
+  // Get the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // Blur focus from the link to remove that annoying outline.
+
+  button.blur();
+
+  // Associate the named menu to this button if not already done.
+  // Additionally, initialize menu display.
+
+  if (button.menu == null) {
+    button.menu = document.getElementById(menuId);
+    if (button.menu.isInitialized == null)
+      menuInit(button.menu);
+  }
+
+  // Reset the currently active button, if any.
+
+  if (activeButton != null)
+    resetButton(activeButton);
+
+  // Activate this button, unless it was the currently active one.
+
+  if (button != activeButton) {
+    depressButton(button);
+    activeButton = button;
+  }
+  else
+    activeButton = null;
+
+  return false;
+}
+
+function buttonMouseover(event, menuId) {
+
+  var button;
+
+  // Find the target button element.
+
+  if (browser.isIE)
+    button = window.event.srcElement;
+  else
+    button = event.currentTarget;
+
+  // If any other button menu is active, make this one active instead.
+
+  if (activeButton != null && activeButton != button)
+    buttonClick(event, menuId);
+}
+
+function depressButton(button) {
+
+  var x, y;
+
+  // Update the button's style class to make it look like it's
+  // depressed.
+
+  button.className += " menuButtonActive";
+
+  // Position the associated drop down menu under the button and
+  // show it.
+
+  x = getPageOffsetLeft(button);
+  y = getPageOffsetTop(button) + button.offsetHeight;
+
+  // For IE, adjust position.
+
+  if (browser.isIE) {
+    x += button.offsetParent.clientLeft;
+    y += button.offsetParent.clientTop - 1;
+  }
+
+  button.menu.style.left = x + "px";
+  button.menu.style.top  = y + "px";
+  button.menu.style.visibility = "visible";
+
+  // For IE; size, position and show the menu's IFRAME as well.
+
+  if (button.menu.iframeEl != null)
+  {
+    button.menu.iframeEl.style.left = button.menu.style.left;
+    button.menu.iframeEl.style.top  = button.menu.style.top;
+    button.menu.iframeEl.style.width  = button.menu.offsetWidth + "px";
+    button.menu.iframeEl.style.height = button.menu.offsetHeight + "px";
+    button.menu.iframeEl.style.display = "";
+  }
+}
+
+function resetButton(button) {
+
+  // Restore the button's style class.
+
+  removeClassName(button, "menuButtonActive");
+
+  // Hide the button's menu, first closing any sub menus.
+
+  if (button.menu != null) {
+    closeSubMenu(button.menu);
+    button.menu.style.visibility = "hidden";
+
+    // For IE, hide menu's IFRAME as well.
+
+    if (button.menu.iframeEl != null)
+      button.menu.iframeEl.style.display = "none";
+  }
+}
+
+//----------------------------------------------------------------------------
+// Code to handle the menus and sub menus.
+//----------------------------------------------------------------------------
+
+function menuMouseover(event) {
+
+  var menu;
+
+  // Find the target menu element.
+
+  if (browser.isIE)
+    menu = getContainerWith(window.event.srcElement, "DIV", "menu");
+  else
+    menu = event.currentTarget;
+
+  // Close any active sub menu.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+}
+
+function menuItemMouseover(event, menuId) {
+
+  var item, menu, x, y;
+
+  // Find the target item element and its parent menu element.
+
+  if (browser.isIE)
+    item = getContainerWith(window.event.srcElement, "A", "menuItem");
+  else
+    item = event.currentTarget;
+  menu = getContainerWith(item, "DIV", "menu");
+
+  // Close any active sub menu and mark this one as active.
+
+  if (menu.activeItem != null)
+    closeSubMenu(menu);
+  menu.activeItem = item;
+
+  // Highlight the item element.
+
+  item.className += " menuItemHighlight";
+
+  // Initialize the sub menu, if not already done.
+
+  if (item.subMenu == null) {
+    item.subMenu = document.getElementById(menuId);
+    if (item.subMenu.isInitialized == null)
+      menuInit(item.subMenu);
+  }
+
+  // Get position for submenu based on the menu item.
+
+  x = getPageOffsetLeft(item) + item.offsetWidth;
+  y = getPageOffsetTop(item);
+
+  // Adjust position to fit in view.
+
+  var maxX, maxY;
+
+  if (browser.isIE) {
+    maxX = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) +
+      (document.documentElement.clientWidth != 0 ? document.documentElement.clientWidth : document.body.clientWidth);
+    maxY = Math.max(document.documentElement.scrollTop, document.body.scrollTop) +
+      (document.documentElement.clientHeight != 0 ? document.documentElement.clientHeight : document.body.clientHeight);
+  }
+  if (browser.isOP) {
+    maxX = document.documentElement.scrollLeft + window.innerWidth;
+    maxY = document.documentElement.scrollTop  + window.innerHeight;
+  }
+  if (browser.isNS) {
+    maxX = window.scrollX + window.innerWidth;
+    maxY = window.scrollY + window.innerHeight;
+  }
+  maxX -= item.subMenu.offsetWidth;
+  maxY -= item.subMenu.offsetHeight;
+
+  if (x > maxX)
+    x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
+      + (menu.offsetWidth - item.offsetWidth));
+  y = Math.max(0, Math.min(y, maxY));
+
+  // Position and show it.
+
+  item.subMenu.style.left       = x + "px";
+  item.subMenu.style.top        = y + "px";
+  item.subMenu.style.visibility = "visible";
+
+  // For IE; size, position and show the menu's IFRAME as well.
+
+  if (item.subMenu.iframeEl != null)
+  {
+    item.subMenu.iframeEl.style.left    = item.subMenu.style.left;
+    item.subMenu.iframeEl.style.top     = item.subMenu.style.top;
+    item.subMenu.iframeEl.style.width   = item.subMenu.offsetWidth + "px";
+    item.subMenu.iframeEl.style.height  = item.subMenu.offsetHeight + "px";
+    item.subMenu.iframeEl.style.display = "";
+  }
+
+  // Stop the event from bubbling.
+
+  if (browser.isIE)
+    window.event.cancelBubble = true;
+  else
+    event.stopPropagation();
+}
+
+function closeSubMenu(menu) {
+
+  if (menu == null || menu.activeItem == null)
+    return;
+
+  // Recursively close any sub menus.
+
+  if (menu.activeItem.subMenu != null) {
+    closeSubMenu(menu.activeItem.subMenu);
+
+
+    // Hide the sub menu.
+    menu.activeItem.subMenu.style.visibility = "hidden";
+
+    // For IE, hide the sub menu's IFRAME as well.
+
+    if (menu.activeItem.subMenu.iframeEl != null)
+      menu.activeItem.subMenu.iframeEl.style.display = "none";
+
+    menu.activeItem.subMenu = null;
+  }
+
+  // Deactivate the active menu item.
+
+  removeClassName(menu.activeItem, "menuItemHighlight");
+  menu.activeItem = null;
+}
+
+//----------------------------------------------------------------------------
+// Code to initialize menus.
+//----------------------------------------------------------------------------
+
+function menuInit(menu) {
+
+  var itemList, spanList;
+  var textEl, arrowEl;
+  var itemWidth;
+  var w, dw;
+  var i, j;
+
+  // For IE, replace arrow characters.
+
+  if (browser.isIE) {
+    menu.style.lineHeight = "2.5ex";
+    spanList = menu.getElementsByTagName("SPAN");
+    for (i = 0; i < spanList.length; i++)
+      if (hasClassName(spanList[i], "menuItemArrow")) {
+        spanList[i].style.fontFamily = "Webdings";
+        spanList[i].firstChild.nodeValue = "4";
+      }
+  }
+
+  // Find the width of a menu item.
+
+  itemList = menu.getElementsByTagName("A");
+  if (itemList.length > 0)
+    itemWidth = itemList[0].offsetWidth;
+  else
+    return;
+
+  // For items with arrows, add padding to item text to make the
+  // arrows flush right.
+
+  for (i = 0; i < itemList.length; i++) {
+    spanList = itemList[i].getElementsByTagName("SPAN");
+    textEl  = null;
+    arrowEl = null;
+    for (j = 0; j < spanList.length; j++) {
+      if (hasClassName(spanList[j], "menuItemText"))
+        textEl = spanList[j];
+      if (hasClassName(spanList[j], "menuItemArrow")) {
+        arrowEl = spanList[j];
+      }
+    }
+    if (textEl != null && arrowEl != null) {
+      textEl.style.paddingRight = (itemWidth 
+        - (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
+
+      // For Opera, remove the negative right margin to fix a display bug.
+
+      if (browser.isOP)
+        arrowEl.style.marginRight = "0px";
+    }
+  }
+
+  // Fix IE hover problem by setting an explicit width on first item of
+  // the menu.
+
+  if (browser.isIE) {
+    w = itemList[0].offsetWidth;
+    itemList[0].style.width = w + "px";
+    dw = itemList[0].offsetWidth - w;
+    w -= dw;
+    itemList[0].style.width = w + "px";
+  }
+
+  // Fix the IE display problem (SELECT elements and other windowed controls
+  // overlaying the menu) by adding an IFRAME under the menu.
+
+  if (browser.isIE) {
+    menu.iframeEl = menu.parentNode.insertBefore(document.createElement("IFRAME"), menu);
+    menu.iframeEl.style.display = "none";
+    menu.iframeEl.style.position = "absolute";
+  }
+
+  // Mark menu as initialized.
+
+  menu.isInitialized = true;
+}
+
+//----------------------------------------------------------------------------
+// General utility functions.
+//----------------------------------------------------------------------------
+
+function getContainerWith(node, tagName, className) {
+
+  // Starting with the given node, find the nearest containing element
+  // with the specified tag name and style class.
+
+  while (node != null) {
+    if (node.tagName != null && node.tagName == tagName &&
+        hasClassName(node, className))
+      return node;
+    node = node.parentNode;
+  }
+
+  return node;
+}
+
+function hasClassName(el, name) {
+
+  var i, list;
+
+  // Return true if the given element currently has the given class
+  // name.
+
+  list = el.className.split(" ");
+  for (i = 0; i < list.length; i++)
+    if (list[i] == name)
+      return true;
+
+  return false;
+}
+
+function removeClassName(el, name) {
+
+  var i, curList, newList;
+
+  if (el.className == null)
+    return;
+
+  // Remove the given class name from the element's className property.
+
+  newList = new Array();
+  curList = el.className.split(" ");
+  for (i = 0; i < curList.length; i++)
+    if (curList[i] != name)
+      newList.push(curList[i]);
+  el.className = newList.join(" ");
+}
+
+function getPageOffsetLeft(el) {
+
+  var x;
+
+  // Return the x coordinate of an element relative to the page.
+
+  x = el.offsetLeft;
+  if (el.offsetParent != null)
+    x += getPageOffsetLeft(el.offsetParent);
+
+  return x;
+}
+
+function getPageOffsetTop(el) {
+
+  var y;
+
+  // Return the x coordinate of an element relative to the page.
+
+  y = el.offsetTop;
+  if (el.offsetParent != null)
+    y += getPageOffsetTop(el.offsetParent);
+
+  return y;
+}
+
+//]]>
\ No newline at end of file
diff -ruN 6171/e107_files/popup.js 75/e107_files/popup.js
--- 6171/e107_files/popup.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/popup.js	2005-06-26 19:17:14.000000000 -0500
@@ -0,0 +1,157 @@
+window.defaultStatus = "";
+
+//get reference object for popup
+function getRefToDivMod( divID, oDoc ) {
+	if( !oDoc ) { oDoc = document; }
+	if( document.layers ) {
+		if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
+			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
+				y = getRefToDivMod(divID,oDoc.layers[x].document);
+			}
+			return y;
+		}
+	}
+	if( document.getElementById ) { return oDoc.getElementById(divID); }
+	if( document.all ) { return oDoc.all[divID]; }
+	return document[divID];
+}
+
+
+//resize method for popup window (resize to fit contents)
+function resizeWinTo() {
+	if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }
+	if( !document.images[0].height || window.doneAlready ) { return; } //in case images are disabled
+	var oH = getRefToDivMod( 'myID' ); if( !oH ) { return false; }
+	var oW = oH.clip ? oH.clip.width : oH.offsetWidth;
+	var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }
+	if( !oH || window.doneAlready ) { return; } //in case images are disabled
+	window.doneAlready = true; //for Safari and Opera
+	/*//no idea why this is in here
+	if(document.getElementsByTagName) {
+		for( var l = document.getElementsByTagName(\'a\'), x = 0; l[x]; x++ ) {
+			if(l[x].className==\'makeright\'&&!l[x].style.position){
+				l[x].style.position=\'relative\';
+				l[x].style.left=(document.images[0].width-(l[x].offsetWidth+l[x].offsetLeft))+\'px\';
+	}}}
+	*/
+	var x = window; x.resizeTo( oW + 200, oH + 200 );
+	var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;
+	if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }
+	else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }
+	else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }
+	if( window.opera && !document.childNodes ) { myW += 16; }
+	x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );
+	//three lines to center the popup on the screen
+	//'var scW = screen.availWidth ? screen.availWidth : screen.width;
+	//'var scH = screen.availHeight ? screen.availHeight : screen.height;
+	//'if( !window.opera ) { x.moveTo(Math.round((scW-oW)/2),Math.round((scH-oH)/2)); }
+}
+
+
+//open popup with image and text
+function openPerfectPopup(oSrc, oWidth, oTitle, oText){
+
+	//the first two should be small for Opera's sake
+	PositionX = 20;
+	PositionY = 20;
+	defaultWidth  = 600;
+	defaultHeight = 400;
+	var AutoClose = '';
+	var oW1 = oWidth+30;
+	var oContent
+
+	var buttonclose = "<input class='button' type='button' value='close' onClick='window.close();' />";
+
+	oContent  = "<table border='0' cellspacing='10' cellpadding='0' style='text-align:center; width:"+oWidth+"px; height:100px;'>\n";
+	oContent  += "<tr><td style='white-space:nowrap; width:"+oWidth+"px;'>";
+	oContent  += "<img src='"+oSrc+"' alt='' style='width:"+oWidth+"px;'  />";
+	oContent  += "</td></tr>\n";
+	oContent  += "<tr><td class='poptext' style='width:"+oWidth+"px; text-align:left;'>"+oText+"</td></tr>\n";
+	oContent  += "<tr><td colspan='2' style='white-space:nowrap; width:"+oWidth+"px; text-align:right;'>"+buttonclose+"</td></tr>\n";
+	oContent  += "</table>\n";
+
+	var imgWin = window.open('','name','scrollbars=no,resizable=1,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
+	if( !imgWin ) { return true; } //popup blockers should not cause errors
+	imgWin.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html>\n'+
+		'<head>\n'+
+		'<title>'+oTitle+'<\/title>\n'+
+		'<script type="text/javaScript">\n'+
+		'//get reference object for popup\n'+
+		'function getRefToDivMod( divID, oDoc ) {\n'+
+		'	if( !oDoc ) { oDoc = document; }\n'+
+		'	if( document.layers ) {\n'+
+		'		if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {\n'+
+		'			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {\n'+
+		'				y = getRefToDivMod(divID,oDoc.layers[x].document);\n'+
+		'			}\n'+
+		'			return y;\n'+
+		'		}\n'+
+		'	}\n'+
+		'	if( document.getElementById ) { return oDoc.getElementById(divID); }\n'+
+		'	if( document.all ) { return oDoc.all[divID]; }\n'+
+		'	return document[divID];\n'+
+		'}\n'+
+		'\n'+
+		'//resize method for popup window (resize to fit contents)\n'+
+		'function resizeWinTo() {\n'+
+		'	if( !document.images.length ) { document.images[0] = document.layers[0].images[0]; }\n'+
+		'	if( !document.images[0].height || window.doneAlready ) { return; } //in case images are disabled\n'+
+		'	var oH = getRefToDivMod( "myID" ); if( !oH ) { return false; }\n'+
+		'	var oW = oH.clip ? oH.clip.width : oH.offsetWidth;\n'+
+		'	var oH = oH.clip ? oH.clip.height : oH.offsetHeight; if( !oH ) { return false; }\n'+
+		'	if( !oH || window.doneAlready ) { return; } //in case images are disabled\n'+
+		'	window.doneAlready = true; //for Safari and Opera\n'+
+		'	var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
+		'	var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
+		'	if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
+		'	else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
+		'	else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
+		'	if( window.opera && !document.childNodes ) { myW += 16; }\n'+
+		'	x.resizeTo( oW = oW + ( ( oW + 200 ) - myW ), oH = oH + ( (oH + 200 ) - myH ) );\n'+
+		'}\n'+
+		'<\/script>\n'+
+		'<style type="text/css">\n'+
+		'html,body{\n'+
+		'	text-align:center;\n'+
+		'	font-family: arial, verdana, helvetica, tahoma, sans-serif;\n'+
+		'	font-size: 11px;\n'+
+		'	color: #444;\n'+
+		'	margin-left: auto;\n'+
+		'  	margin-right: auto;	\n'+
+		'  	margin-top:0px;\n'+
+		'	margin-bottom:0px;\n'+
+		'	padding: 0px;\n'+
+		'	background-color:#FFF;\n'+
+		'	height:100%;\n'+
+		'	cursor:default;\n'+
+		'}\n'+
+		'.poptext{\n'+
+		'	font-size: 11px;\n'+
+		'	text-align:left;\n'+
+		'	color:#444;\n'+
+		'	line-height:140%;\n'+
+		'	vertical-align:top;\n'+
+		'	text-align:left;\n'+
+		'}\n'+
+		'.button{\n'+
+		'	border:1px solid #444;\n'+
+		'	color: #444;\n'+
+		'	background-color:#FFF;\n'+
+		'	font-size: 11px;\n'+
+		'	padding:2px;\n'+
+		'	cursor:pointer;\n'+
+		'	width:50px;\n'+
+		'}\n'+
+		'<\/style>\n'+
+
+		'<\/head>\n'+
+		'<body onload="resizeWinTo();">\n'+
+		(document.layers?('<layer left="0" top="0" id="myID">\n'):('<div style="width:'+oW1+'px; position:absolute;left:0px;top:0px;" id="myID" >\n'))+
+		oContent+
+		(document.layers?'<\/layer>\n':'<\/div>\n')+
+		'<\/body>\n'+
+		'<\/html>\n');
+
+	imgWin.document.close();
+	if( imgWin.focus ) { imgWin.focus(); }
+}
diff -ruN 6171/e107_files/resetcore/resetcore.php 75/e107_files/resetcore/resetcore.php
--- 6171/e107_files/resetcore/resetcore.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/resetcore/resetcore.php	2006-05-12 20:21:56.000000000 -0500
@@ -0,0 +1,349 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ?Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/resetcore/resetcore.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2006/05/13 01:21:56 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+
+/* ####################################################
+
+
+To use this file, you must edit the following line, removing the // so it reads:
+define("ACTIVE", true);
+If you don't, the script will not be usable.
+
+When you have finished with resetcore you should swap true for false so it can't be used by
+people it shouldn't be used by.
+
+*/
+
+define("ACTIVE", false);
+
+
+/* #################################################### */
+
+
+
+
+$register_globals = true;
+if(function_exists('ini_get'))
+{
+	$register_globals = ini_get('register_globals');
+}
+if($register_globals == true)
+{
+	while (list($global) = each($GLOBALS))
+	{
+		if (!preg_match('/^(_POST|_GET|_COOKIE|_SERVER|_FILES|GLOBALS|HTTP.*|_REQUEST|eTimingStart)$/', $global))
+		{
+			unset($$global);
+		}
+	}
+	unset($global);
+}
+
+require_once("../../e107_config.php");
+mysql_connect($mySQLserver, $mySQLuser, $mySQLpassword);
+mysql_select_db($mySQLdefaultdb);
+define("MAGIC_QUOTES_GPC", (ini_get('magic_quotes_gpc') ? TRUE : FALSE));
+
+define("e107_INIT", TRUE);
+require_once('../../'.$HANDLERS_DIRECTORY.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+
+echo "<?xml version='1.0' encoding='iso-8859-1' ?>\n";
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title><e107 resetcore></title>
+<link rel="stylesheet" href="style.css" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<meta http-equiv="content-style-type" content="text/css" />
+</head>
+<body>
+<div class='mainbox'>
+<a href="http://e107.org"><img src="../../e107_images/logo_template_large.png" alt="Logo" style="border: 0px; vertical-align: middle;" /></a> <span class='headertext'>e107 Reset Core Utility</span>
+<br />
+<br />
+<br />
+<br />
+<?php
+
+if(ACTIVE !== true) {
+	echo "<span class='headertext2'>Currently disabled. To enable please open this file in a text editor and follow the instructions to activate.</span>";
+	exit;
+}
+
+if (isset($_POST['usubmit'])) {
+	if (($row = e_verify()) !== FALSE) {
+		extract($row);
+
+		$result = mysql_query("SELECT * FROM ".$mySQLprefix."core WHERE e107_name='pref_backup' ");
+		$bu_exist = ($row = mysql_fetch_array($result) ? TRUE : FALSE);
+
+		$admin_directory = "e107_admin";
+
+//			<input type='radio' name='mode' value='1'> <span class='headertext2'>Manually edit core values</span><br />
+
+		echo "<span class='headertext2'><b>Please select which method you want to use, then click the button to proceed ...</b></span><br /><br /><br /><br />
+			<table style='width: auto; margin-left:auto; margin-right: auto;'>
+			<tr>
+			<td>
+			<form method='post' action='".$_SERVER['PHP_SELF']."'>
+			<input type='radio' name='mode' value='2'> <span class='headertext2'>Reset core to default values</span><br />". ($bu_exist ? "<input type='radio' name='mode' value='3'> <span class='headertext2'>Restore core backup</span>" : "<br />( There is no backed-up core - unable to offer option to restore backup )")."<br /><br /><input class='button' type='submit' name='reset_core_sub' value='Select method then click here to continue' />
+				 
+			<input type='hidden' name='a_name' value='".$_POST['a_name']."' />
+			<input type='hidden' name='a_password' value='".$_POST['a_password']."' />
+				 
+			</form>
+			</td>
+			</tr>
+			</table>
+			";
+
+		$END = TRUE;
+	} else {
+		$message = "<b>Administrator not found in database / incorrect password / insufficient permissions - aborting.</b><br />";
+		$END = TRUE;
+	}
+}
+
+
+if (isset($_POST['reset_core_sub']) && $_POST['mode'] == 2)
+{
+	if (($at = e_verify()) === FALSE) {
+		exit;
+	}
+
+	$tmpr = substr(str_replace($_SERVER['DOCUMENT_ROOT'], "", $_SERVER['SCRIPT_FILENAME']), 1);
+	$root = "/".substr($tmpr, 0, strpos($tmpr, "/"))."/";
+	$e_HTTP = $root;
+	$admin_directory = "e107_admin";
+	$url_prefix = substr($_SERVER['PHP_SELF'], strlen($e_HTTP), strrpos($_SERVER['PHP_SELF'], "/")+1-strlen($e_HTTP));
+	$num_levels = substr_count($url_prefix, "/");
+	$link_prefix = '';
+	for($i = 1; $i <= $num_levels; $i++) {
+		$link_prefix .= "../";
+	}
+
+	define("e_ADMIN", $e_HTTP.$admin_directory."/");
+	define("e_SELF", "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
+	define("e_QUERY", preg_replace("#&|/?PHPSESSID.*#i", "", $_SERVER['QUERY_STRING']));
+	define('e_BASE', $link_prefix);
+	$e_path = (!strpos($_SERVER['SCRIPT_FILENAME'], ".php") ? $_SERVER['PATH_TRANSLATED'] : $_SERVER['SCRIPT_FILENAME']);
+	define("e_PATH", $e_path);
+
+
+	$pref_language = "English";
+	include_once("../../".$LANGUAGES_DIRECTORY."English/lan_prefs.php");
+	require_once("../../".$FILES_DIRECTORY."def_e107_prefs.php");
+
+	$PrefOutput = $eArrayStorage->WriteArray($pref);
+
+	mysql_query("DELETE FROM ".$mySQLprefix."core WHERE e107_name='SitePrefs' OR e107_name='SitePrefs_Backup'");
+	if (!mysql_query("INSERT INTO ".$mySQLprefix."core VALUES ('SitePrefs', '{$PrefOutput}')")) {
+		$message = "Rebuild failed ...";
+		$END = TRUE;
+	} else {
+		mysql_query("INSERT INTO ".$mySQLprefix."core VALUES ('SitePrefs_Backup', '{$PrefOutput}')");
+		$message = "Core reset. <br /><br /><a href='../../index.php'>Click here to continue</a>";
+		$END = TRUE;
+	}
+}
+
+function recurse_pref($ppost) {
+	$search = array("\"", "'", "\\", '\"', "\'", "$", "?");
+	$replace = array("&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&#036;", "&copy;");
+	foreach ($ppost as $key => $value) {
+		if(!is_array($value)){
+			$ret[$key] = str_replace($search, $replace, $text);
+		} else {
+			$ret[$key] = recurse_pref($value);
+		}
+	}
+	return $ret;
+}
+
+if (isset($_POST['coreedit_sub']))
+{
+	if (($at = e_verify()) === FALSE) {
+		exit;
+	}
+
+	$pref = recurse_pref($_POST);
+
+	$PrefOutput = $eArrayStorage->WriteArray($pref);
+
+	mysql_query("DELETE FROM ".$mySQLprefix."core WHERE e107_name='SitePrefs' OR e107_name='SitePrefs_Backup'");
+	mysql_query("INSERT INTO ".$mySQLprefix."core VALUES ('SitePrefs', '{$PrefOutput}')");
+	mysql_query("INSERT INTO ".$mySQLprefix."core VALUES ('SitePrefs_Backup', '{$PrefOutput}')");
+
+	$message = "Core settings successfully updated. <br /><br /><a href='../../index.php'>Click here to continue</a>";
+	$END = TRUE;
+}
+
+if (isset($_POST['reset_core_sub']) && $_POST['mode'] == 3) {
+	if (($at = e_verify()) === FALSE) {
+		exit;
+	}
+
+	$result = mysql_query("SELECT * FROM ".$mySQLprefix."core WHERE e107_name='pref_backup'");
+	$row = mysql_fetch_array($result);
+
+	$pref = unserialize(base64_decode($row['e107_value']));
+
+	$PrefOutput = $eArrayStorage->WriteArray($pref);
+
+	mysql_query("DELETE FROM ".$mySQLprefix."core WHERE `e107_name` = 'SitePrefs' OR `e107_name` = 'SitePrefs_Backup'");
+	mysql_query("INSERT INTO ".$mySQLprefix."core VALUES ('SitePrefs', '{$PrefOutput}')");
+	mysql_query("INSERT INTO ".$mySQLprefix."core VALUES ('SitePrefs_Backup', '{$PrefOutput}')");
+
+	$message = "Core backup successfully restored. <br /><br /><a href='../../index.php'>Click here to continue</a>";
+	$END = TRUE;
+}
+
+
+if (isset($_POST['reset_core_sub']) && $_POST['mode'] == 1)
+{
+	if (($at = e_verify()) === FALSE) {
+		exit;
+	}
+
+	$result = @mysql_query("SELECT * FROM ".$mySQLprefix."core WHERE e107_name='SitePrefs'");
+	$row = @mysql_fetch_array($result);
+
+	$pref = $eArrayStorage->ReadArray($row['e107_value']);
+
+	echo "
+		<span class='headertext2'><b>Edit your individual core items and click the button to save - <span class='headertext'>use this script with caution</span>.</b></span><br /><br />
+		<form method='post' action='".$_SERVER['PHP_SELF']."'>
+		<table style='width:95%'>\n";
+
+	while (list($key, $prefr) = each($pref)) {
+		if (is_array($prefr)) {
+			foreach ($prefr as $akey => $apref) {
+				echo "<tr><td class='headertext2' style='width:50%; text-align:right;'>{$key}[{$akey}]&nbsp;&nbsp;</td>
+				<td style='width:50%'><input type='text' name='{$key}[{$akey}]' value='{$apref}' size='50' maxlength='100' /></td></tr>\n";
+
+			}
+		} else {
+			echo "<tr><td class='headertext2' style='width:50%; text-align:right;'>{$key}&nbsp;&nbsp;</td>
+			<td style='width:50%'><input type='text' name='{$key}' value='{$prefr}' size='50' maxlength='100' /></td></tr>\n";
+		}
+	}
+	echo "
+		<tr>
+		<td colspan='2' style='text-align:center'><br /><input class='button' type='submit' name='coreedit_sub' value='Save Core Settings' /></td>
+		</tr>
+		</table>
+		<input type='hidden' name='a_name' value='".$_POST['a_name']."' />
+		<input type='hidden' name='a_password' value='".preg_replace("/\W/", '', $_POST['a_password'])."' />
+		</form>";
+	$END = TRUE;
+}
+
+if (isset($message)) {
+	echo "<br /><br /><div style='text-align:center'><span class='headertext2'>{$message}</span></div><br />";
+}
+
+if (isset($END)) {
+	echo "<br /></div></body></html>";
+	exit;
+}
+
+echo "<span class='headertext2'>
+	This is the e107 resetcore utility. It allows you to completely rebuild your core if it becomes corrupt, or to restore a backup. <br />It won't affect your actual content (news posts, forum posts, articles etc).<br />
+	<b>Only run this utility if your site is failing to load due to a critical core error, or if you need to change a setting and can't log into your admin area.</b></span><br /><br /><br /><br />
+	 
+	<span class='headertext'>Please enter your main administrator username and password to continue ...</span><br /><br />
+	<form method='post' action='".$_SERVER['PHP_SELF']."'>
+	<table style='width:95%'>
+	<tr>
+	<td style='width:50%; text-align:right;' class='mediumtext'>Main administrator name:</td>
+	<td style='width:50%'>
+	<input class='tbox' type='text' name='a_name' size='30' value='' maxlength='100' />
+	</td>
+	</tr>
+	<tr>
+	<td style='width:50%; text-align:right;' class='mediumtext'>Main administrator Password:</td>
+	<td style='width:50%'>
+	<input class='tbox' type='password' name='a_password' size='30' value='' maxlength='100' />
+	</td>
+	</tr>
+	<tr>
+	<td colspan='2' style='text-align:center'>
+	<br />
+	<input class='button' type='submit' name='usubmit' value='Continue' />
+	</td>
+	</tr>
+	</table>
+	<br />
+	</div>
+	</body>
+	</html>";
+
+function e_verify() {
+	global $mySQLprefix;
+	if (ACTIVE !== TRUE) {
+		exit;
+	}
+	if (MAGIC_QUOTES_GPC == FALSE) {
+		$a_name = addslashes($_POST['a_name']);
+	}
+	else
+	{
+		$a_name = $_POST['a_name'];
+	}
+
+	$a_name = str_replace('/*', '', $a_name);
+
+	$result = mysql_query("SELECT * FROM ".$mySQLprefix."user WHERE user_name='".$a_name."'");
+	$row = mysql_fetch_array($result);
+
+	if (($row['user_password'] === md5($_POST['a_password'])) && ($row['user_perms'] === '0') && (ACTIVE === TRUE)) {
+		clear_cache();
+		return $row;
+	} else {
+		return FALSE;
+	}
+}
+
+function clear_cache() {
+	$dir = "../cache/";
+	$pattern = "*.cache.php";
+	$deleted = false;
+	$pattern = str_replace(array("\*", "\?"), array(".*", "."), preg_quote($pattern));
+	if (substr($dir, -1) != "/") {
+		$dir .= "/";
+	}
+	if (is_dir($dir)) {
+		$d = opendir($dir);
+		while ($file = readdir($d)) {
+			if (is_file($dir.$file) && preg_match("/^{$pattern}$/", $file)) {
+				if (unlink($dir.$file)) {
+					$deleted[] = $file;
+				}
+			}
+		}
+		closedir($d);
+		return true;
+	} else {
+		return false;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/resetcore/style.css 75/e107_files/resetcore/style.css
--- 6171/e107_files/resetcore/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/resetcore/style.css	2005-07-06 06:27:10.000000000 -0500
@@ -0,0 +1,58 @@
+body {
+	color: #000;
+	font: 11px verdana, tahoma, arial, sans-serif;
+	background-color: #D1CFCF;
+}
+a {
+	color: #035479; 
+	text-decoration: none;
+}
+a:hover {
+	color: #DC6504;
+	text-decoration: none;
+}
+
+.mainbox {
+	border: 1px solid #879397;
+	background-color: #fff;
+	color: #000;
+	padding: 10px;
+}
+
+.smalltext {
+	color: #000;
+	font: 12px verdana, tahoma, arial, sans-serif;
+}
+
+.headertext {
+	color: #DC6504;
+	font: 16px verdana, tahoma, arial, sans-serif;
+	font-weight: bold;
+}
+
+.headertext2 {
+	color: #000;
+	font: 12px verdana, tahoma, arial, sans-serif;
+	font-weight: bold;
+}
+
+.indent {
+	border: 1px solid #D1CFCF;
+	background-color: #efefef;
+	color: #000;
+	padding: 10px;
+}
+
+.tbox {
+	background-color: #fff;
+	border: #b7b5b5 1px solid;
+	color: #000000;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.button {
+	border: 1px solid #000;
+	color: #000;
+	font: 7pt verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+}
\ No newline at end of file
diff -ruN 6171/e107_files/resetcore.php 75/e107_files/resetcore.php
--- 6171/e107_files/resetcore.php	2004-09-05 21:35:38.000000000 -0500
+++ 75/e107_files/resetcore.php	2005-12-24 19:33:05.000000000 -0600
@@ -1,245 +1,23 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/template.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../e107_config.php");
-mysql_connect($mySQLserver, $mySQLuser, $mySQLpassword);
-mysql_select_db($mySQLdefaultdb);
-
-echo "<?xml version='1.0' encoding='iso-8859-1' ?>\n";
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title><e107 resetcore></title>
-<link rel="stylesheet" href="../e107_docs/style.css" />
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<meta http-equiv="content-style-type" content="text/css" />
-</head>
-<body>
-
-<div class='mainbox'>
-
-<a href="http://e107.org"><img src="../e107_images/logo.png" alt="Logo" style="border:0" /></a>
-<br /><br />
-<span class="smalltext">Steve Dunstan 2002-2004. See gpl.txt for license details.</span><br /><br /><br />
-
-
-<?php
-
-if(IsSet($_POST['usubmit'])){
-
-	$a_name = $_POST['a_name'];
-	$a_password = md5($_POST['a_password']);
-
-	if($result = mysql_query("SELECT * FROM ".$mySQLprefix."user WHERE user_name='$a_name' AND user_password='$a_password' AND user_perms=0")){
-		if($row = mysql_fetch_array($result)){
-			extract($row);
-
-			$result = mysql_query("SELECT * FROM ".$mySQLprefix."core WHERE e107_name='pref_backup' ");
-			$bu_exist = ($row = mysql_fetch_array($result) ? TRUE : FALSE);
-			
-			$admin_directory = "e107_admin";
-
-			echo "<span class='headertext2'><b>Please select which method you want to use, then click the button to proceed ...</b></span><br /><br /><br /><br />
-			<div style='text-align:center'>
-			<form method='post' action='".$_SERVER['PHP_SELF']."'>
-			<input type='radio' name='mode' value='1'> <span class='headertext'>Manually edit core values</span><br />
-			<input type='radio' name='mode' value='2'> <span class='headertext'>Reset core to default values</span><br />".
-			($bu_exist ? "<input type='radio' name='mode' value='3'> <span class='headertext'>Restore core backup</span>" : " <span class='headertext'>[ No core backup found - unable to restore core ]</span>")."<br /><br /><input class='button' type='submit' name='reset_core_sub' value='Select method then click here to continue' />
-
-			<input type='hidden' name='a_name' value='$a_name' />
-			<input type='hidden' name='a_password' value='$a_password' />
-
-			</form>
-			</div>";
-			$END = TRUE;
-		}else{
-			$message = "<b>Administrator not found in database / incorrect password / insufficient permissions - aborting.</b><br />";
-			$END = TRUE;
-		}
-	}else{
-		$message = "<b>Administrator not found in database / incorrect password / insufficient permissions - aborting.</b><br />";
-		$END = TRUE;
-	}
-}
-
-
-if(IsSet($_POST['reset_core_sub']) && $_POST['mode'] == 2){
-	$a_name = $_POST['a_name'];
-	$a_password = $_POST['a_password'];
-	if(!$result = mysql_query("SELECT * FROM ".$mySQLprefix."user WHERE user_name='$a_name' AND user_password='$a_password' AND user_perms='0' ")){
-		exit;
-	}
-	$at = ($row = mysql_fetch_array($result) ? TRUE : FALSE);
-	if(!$at){ exit; }
-
-	$tmpr = substr(str_replace($_SERVER['DOCUMENT_ROOT'], "", $_SERVER['SCRIPT_FILENAME']), 1);
-	$root = "/".substr($tmpr, 0, strpos($tmpr, "/"))."/";
-	define("e_HTTP", $root);
-	$admin_directory = "e107_admin";
-	$url_prefix=substr($_SERVER['PHP_SELF'],strlen(e_HTTP),strrpos($_SERVER['PHP_SELF'],"/")+1-strlen(e_HTTP));
-	$num_levels=substr_count($url_prefix,"/");
-	for($i=1;$i<=$num_levels;$i++){
-		$link_prefix.="../";
-	}
-
-	define("e_ADMIN", e_HTTP.$admin_directory."/");
-	define("e_SELF", "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
-	define("e_QUERY", eregi_replace("&|/?PHPSESSID.*", "", $_SERVER['QUERY_STRING']));
-	define('e_BASE',$link_prefix);
-	$e_path = (!strpos($_SERVER['SCRIPT_FILENAME'], ".php") ? $_SERVER['PATH_TRANSLATED'] : $_SERVER['SCRIPT_FILENAME']);
-	define("e_PATH", $e_path);
-	require_once(e_BASE.$FILES_DIRECTORY."def_e107_prefs.php");
-
-	$tmp = addslashes(serialize($pref));
-
-	mysql_query("DELETE FROM ".$mySQLprefix."core WHERE e107_name='pref'");
-	if(!mysql_query("INSERT INTO ".$mySQLprefix."core VALUES ('pref', '$tmp')")){
-		$message = "Rebuild failed ...";
-		$END = TRUE;
-	}else{
-		$message = "Core reset. <br /><br /><a href='../index.php'>Click here to continue</a>";
-		$END = TRUE;
-	}
-}
-
-
-if(IsSet($_POST['coreedit_sub'])){
-	$a_name = $_POST['a_name'];
-	$a_password = $_POST['a_password'];
-	if(!$result = mysql_query("SELECT * FROM ".$mySQLprefix."user WHERE user_name='$a_name' AND user_password='$a_password' AND user_perms='0' ")){
-		exit;
-	}
-	$at = ($row = mysql_fetch_array($result) ? TRUE : FALSE);
-	if(!$at){ exit; }
-
-
-
-	while(list($key, $prefvalue) = each($_POST)){
-		$pref[$key] = formtpa($prefvalue);
-	}
-
-	$tmp = addslashes(serialize($pref));
-
-	@mysql_query("UPDATE ".$mySQLprefix."core set e107_value='$tmp' WHERE e107_name='pref' ");
-	$message = "Core settings successfully updated. <br /><br /><a href='../index.php'>Click here to continue</a>";
-	$END = TRUE;
-	
-
-
-}
-
-if(IsSet($_POST['reset_core_sub']) && $_POST['mode'] == 3){
-	$a_name = $_POST['a_name'];
-	$a_password = $_POST['a_password'];
-	if(!$result = mysql_query("SELECT * FROM ".$mySQLprefix."user WHERE user_name='$a_name' AND user_password='$a_password' AND user_perms='0' ")){
-		exit;
-	}
-	$at = ($row = mysql_fetch_array($result) ? TRUE : FALSE);
-	if(!$at){ exit; }
-	
-	$result = @mysql_query("SELECT * FROM ".$mySQLprefix."core WHERE e107_name='pref_backup' ");
-	$row = @mysql_fetch_array($result);
-	$tmp = stripslashes($row['e107_value']);
-	$pref=unserialize($tmp);
-	if(!is_array($pref)){
-		$pref=unserialize($row['e107_value']);
-	}
-	@mysql_query("UPDATE ".$mySQLprefix."core set e107_value='".$row['e107_value']."' WHERE e107_name='pref' ");
-	$message = "Core backup successfully restored. <br /><br /><a href='../index.php'>Click here to continue</a>";
-	$END = TRUE;
-}
-
-
-if(IsSet($_POST['reset_core_sub']) && $_POST['mode'] == 1){
-
-	$a_name = $_POST['a_name'];
-	$a_password = $_POST['a_password'];
-	if(!$result = mysql_query("SELECT * FROM ".$mySQLprefix."user WHERE user_name='$a_name' AND user_password='$a_password' AND user_perms=0")){
-		exit;
-	}
-
-	$result = @mysql_query("SELECT * FROM ".$mySQLprefix."core WHERE e107_name='pref' ");
-	$row = @mysql_fetch_array($result);
-	$tmp = stripslashes($row['e107_value']);
-	$pref=unserialize($tmp);
-
-	echo "
-	<span class='headertext2'><b>Edit your individual core items and click the button to save - <span class='headertext'>use this script with caution</span>.</b></span><br /><br />
-	<form method='post' action='".$_SERVER['PHP_SELF']."'>
-	<table style='width:95%'>\n";
-
-	while(list($key, $prefr) = each($pref)){ 
-		echo "<tr><td class='headertext' style='width:50%; text-align:right;'>$key&nbsp;&nbsp;</td>
-		<td style='width:50%'><input type='text' name='$key' value='$prefr' size='50' maxlength='100' /></td></tr>\n";
-	}
-	echo "
-	<tr>
-	<td colspan='2' style='text-align:center'><br /><input class='button' type='submit' name='coreedit_sub' value='Save Core Settings' /></td>
-	</tr>
-	</table>
-	<input type='hidden' name='a_name' value='".$_POST['a_name']."' />
-	<input type='hidden' name='a_password' value='".$_POST['a_password']."' />
-	</form>";
-	$END = TRUE;
-}
-
-if($message){
-	echo "<br /><br /><div style='text-align:center'><span class='headertext'>".$message."</span></div><br />";
-}
-
-if($END){
-	echo "<br /></div></body></html>";
-	exit;
-}
-
-echo "<span class='headertext2'>
-This is the e107 resetcore utility. It allows you to completely rebuild your core if it becomes corrupt, or to restore a backup, or to change core settings manually. It won't affect your actual content (news posts, forum posts, articles etc).<br />
-<b>Only run this utility if your site is failing to load due to a critical core error, or if you need to change a setting and can't log into your admin area.</b></span><br /><br /><br /><br />
-
-<span class='headertext'>Please enter your main administrator username and password to continue ...</span><br /><br />
-<form method='post' action='".$_SERVER['PHP_SELF']."'>
-<table style='width:95%'>
-<tr>
-<td style='width:50%; text-align:right;' class='mediumtext'>Main administrator name:</td>
-<td style='width:50%'>
-<input class='tbox' type='text' name='a_name' size='30' value='' maxlength='100' />
-</td>
-</tr>
-<tr>
-<td style='width:50%; text-align:right;' class='mediumtext'>Main administrator Password:</td>
-<td style='width:50%'>
-<input class='tbox' type='password' name='a_password' size='30' value='' maxlength='100' />
-</td>
-</tr>
-<tr>
-<td colspan='2' style='text-align:center'>
-<br />
-<input class='button' type='submit' name='usubmit' value='Continue' />
-</td>
-</tr>
-</table>
-<br />
-</div>
-</body>
-</html>";
-
-function formtpa($text){
-	$search = array("\"", "'", "\\", '\"', "\'", "$");
-	$replace = array("&quot;", "&#39;", "&#92;", "&quot;", "&#39;", "&#036;");
-	$text = str_replace($search, $replace, $text);
-	return $text;
-}
-
-?>
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/resetcore.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2005/12/25 01:33:05 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+require_once('../class2.php');
+header('Location:'.SITEURL.$FILES_DIRECTORY.'resetcore/resetcore.php');
+exit;
+?>
diff -ruN 6171/e107_files/shortcode/admin_alt_nav.sc 75/e107_files/shortcode/admin_alt_nav.sc
--- 6171/e107_files/shortcode/admin_alt_nav.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_alt_nav.sc	2006-05-13 18:37:50.000000000 -0500
@@ -0,0 +1,130 @@
+if (ADMIN) {
+	global $sql, $pref;
+	parse_str($parm);
+	require(e_ADMIN.'ad_links.php');
+	require_once(e_HANDLER.'admin_handler.php');
+	function adnav_cat($cat_title, $cat_link, $cat_img, $cat_id=FALSE) {
+		$cat_link = ($cat_link ? $cat_link : "javascript:void(0);");
+		$text = "<a class='menuButton' href='".$cat_link."' style='background-image: url(".$cat_img."); background-repeat: no-repeat;  background-position: 3px 1px' ";
+		if ($cat_id) { 
+			$text .= "onclick=\"return buttonClick(event, '".$cat_id."');\" onmouseover=\"buttonMouseover(event, '".$cat_id."');\"";
+		}
+		$text .= ">".$cat_title."</a>";
+		return $text;
+	}
+
+	function adnav_main($cat_title, $cat_link, $cat_img, $cat_id=FALSE, $cat_highlight='') {
+		$text = "<a class='menuItem ".$cat_highlight."' href='".$cat_link."' ";
+		if ($cat_id) { 
+			$text .= "onclick=\"return false;\" onmouseover=\"menuItemMouseover(event, '".$cat_id."');\"";
+		}
+			$text .= "><span class='menuItemBuffer'>".$cat_img."</span><span class='menuItemText'>".$cat_title."</span>";
+		if ($cat_id) { 
+			$text .= "<span class=\"menuItemArrow\">&#9654;</span>";
+		}
+			$text .= "</a>";
+		return $text;
+	}
+	if (file_exists(THEME.'nav_menu.js')) {
+		$text = "<script type='text/javascript' src='".THEME_ABS."nav_menu.js'></script>";
+	} else {
+		$text = "<script type='text/javascript' src='".e_FILE_ABS."nav_menu.js'></script>";
+	}
+	
+	$text .= "<div style='width: 100%'><table border='0' cellspacing='0' cellpadding='0' style='width: 100%'>
+	<tr><td>
+	<div class='menuBar' style='width: 100%'>";
+
+	$text .= adnav_cat(ADLAN_151, e_ADMIN.'admin.php', E_16_NAV_MAIN);
+
+	for ($i = 1; $i < 5; $i++) {
+		$ad_tmpi = 0;
+		$ad_links_array = asortbyindex($array_functions, 1);
+		$nav_main = adnav_cat($admin_cat['title'][$i], '', $admin_cat['img'][$i], $admin_cat['id'][$i]);
+		$ad_texti = "<div id='".$admin_cat['id'][$i]."' class='menu' onmouseover=\"menuMouseover(event)\">";
+		while(list($key, $nav_extract) = each($ad_links_array)){
+			if($nav_extract[4]==$i){
+				if(getperms($nav_extract[3])){
+					$ad_texti .= adnav_main($nav_extract[1], $nav_extract[0], $nav_extract[5]);
+					$ad_tmpi = 1;
+				}
+			}
+		}
+		$ad_texti .= "</div>";
+		if ($ad_tmpi == 1) {
+			$text .= $nav_main;
+			$text .= $ad_texti;
+		}
+	}
+	
+	$render_plugins = FALSE;
+	if($sql -> db_Select("plugin", "*", "plugin_installflag=1")){
+		while($row = $sql -> db_Fetch()){
+			if(getperms('P'.$row['plugin_id'])){
+				include_once(e_PLUGIN.$row['plugin_path']."/plugin.php");
+				if($eplug_conffile){
+					$plugin_icon = $eplug_icon_small ? "<img src='".e_PLUGIN_ABS.$eplug_icon_small."' alt='".$eplug_caption."' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />" : E_16_PLUGIN;
+					$plugin_array[ucfirst($eplug_name)] = adnav_main($eplug_name, e_PLUGIN.$row['plugin_path']."/".$eplug_conffile, $plugin_icon);
+				}
+				unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
+				$render_plugins = TRUE;
+				$active_plugs = TRUE;
+			}
+		}
+		ksort($plugin_array, SORT_STRING);
+		$plugs_text = '';
+		foreach ($plugin_array as $plugin_compile) {
+			$plugs_text .= $plugin_compile;
+		}
+	}
+	
+	if (getperms('Z')) {
+		$pclass_extended = $active_plugs ? 'header' : '';
+		$plugin_text = adnav_main(ADLAN_98, e_ADMIN.'plugin.php', E_16_PLUGMANAGER, FALSE, $pclass_extended);
+		$render_plugins = TRUE;
+	}
+	
+	if ($render_plugins) {
+		$text .= adnav_cat(ADLAN_CL_7, '', E_16_CAT_PLUG, 'plugMenu');
+		$text .= "<div id='plugMenu' class='menu' onmouseover=\"menuMouseover(event)\">";
+		$text .= $plugin_text.$plugs_text;
+		$text .= "</div>";
+	}
+	
+	$text .= adnav_cat(ADLAN_CL_8, '', E_16_NAV_DOCS, 'docsMenu');
+	$text .= "<div id='docsMenu' class='menu' onmouseover=\"menuMouseover(event)\">";
+	if (!$handle=opendir(e_DOCS.e_LANGUAGE."/")) {
+		$handle=opendir(e_DOCS."English/");
+	}
+	$i=1;
+	while ($file = readdir($handle)) {
+		if ($file != "." && $file != ".." && $file != "CVS") {
+			$text .= adnav_main(str_replace("_", " ", $file), e_ADMIN."docs.php?".$i, E_16_DOCS);
+			$i++;
+		}
+	}
+	closedir($handle);
+	$text .= "</div>";
+
+
+	$text .= "</div>
+	</td>";
+	
+	if ($exit != 'off') {
+		$text .= "<td style='width: 160px; white-space: nowrap'>
+		<div class='menuBar' style='width: 100%'>";
+	
+		$text .= adnav_cat(ADLAN_53, e_BASE.'index.php', E_16_NAV_LEAV);
+		$text .= adnav_cat(ADLAN_46, e_ADMIN.'admin.php?logout', E_16_NAV_LGOT);
+	
+		$text .= "</div>
+		</td>";
+	}
+	
+	$text .= "</tr>
+	</table>
+	</div>";
+
+	return $text;
+}
+
diff -ruN 6171/e107_files/shortcode/admin_credits.sc 75/e107_files/shortcode/admin_credits.sc
--- 6171/e107_files/shortcode/admin_credits.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_credits.sc	2005-08-22 11:53:23.000000000 -0500
@@ -0,0 +1,5 @@
+if (ADMIN) {
+	return "<div style='text-align: center'>
+			<input class='button' type='button' onclick=\"javascript: window.open('".e_ADMIN."credits.php', 'myWindow', 'status = 1, height = 400, width = 300, resizable = 0')\" value='Credits' />
+			</div>";
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_docs.sc 75/e107_files/shortcode/admin_docs.sc
--- 6171/e107_files/shortcode/admin_docs.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_docs.sc	2005-11-11 02:37:32.000000000 -0600
@@ -0,0 +1,24 @@
+if(ADMIN){
+	global $ns;
+	$i=1;
+	if (!$handle=opendir(e_DOCS.e_LANGUAGE."/")) {
+	 $handle=opendir(e_DOCS."English/");
+	}
+	while ($file = readdir($handle)){
+	        if($file != "." && $file != ".." && $file != "CVS"){
+	                $helplist[$i] = $file;
+	                $i++;
+	        }
+	}
+	closedir($handle);
+
+	unset($e107_var);
+	foreach ($helplist as $key => $value) {
+	        $e107_var['x'.$key]['text'] = str_replace("_", " ", $value);
+	        $e107_var['x'.$key]['link'] = e_ADMIN."docs.php?".$key;
+	}
+
+	$text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);
+	return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
+}
+
diff -ruN 6171/e107_files/shortcode/admin_help.sc 75/e107_files/shortcode/admin_help.sc
--- 6171/e107_files/shortcode/admin_help.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_help.sc	2005-11-13 20:40:17.000000000 -0600
@@ -0,0 +1,30 @@
+if (ADMIN) {
+	global $ns, $pref;
+	if (!($handle=opendir(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/"))) {
+		$handle=opendir(e_LANGUAGEDIR."English/admin/help/");
+	}
+	ob_start();
+	$text = "";
+	while(false !== ($file = readdir($handle))) {
+		if ($file != "." && $file != ".." && $file != "CVS") {
+			if (strpos(e_SELF, $file) !== FALSE) {
+				if (is_readable(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file)) {
+					include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/help/".$file);
+				} else if (is_readable(e_LANGUAGEDIR."English/admin/help/".$file)) {
+					include_once(e_LANGUAGEDIR."English/admin/help/".$file);
+				}
+			}
+		}
+	}
+	closedir($handle);
+   $plugpath = getcwd()."/help.php";
+	if(file_exists($plugpath))
+	{
+		@require_once($plugpath);
+	}
+	$help_text = ob_get_contents();
+	ob_end_clean();
+	return $help_text;
+}
+
+
diff -ruN 6171/e107_files/shortcode/admin_icon.sc 75/e107_files/shortcode/admin_icon.sc
--- 6171/e107_files/shortcode/admin_icon.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_icon.sc	2005-09-07 08:24:51.000000000 -0500
@@ -0,0 +1,12 @@
+if (ADMIN) {
+	global $e_sub_cat, $e_icon_array, $PLUGINS_DIRECTORY;
+	if (strstr(e_SELF, $PLUGINS_DIRECTORY)) {
+		include('plugin.php');
+		$icon = ($eplug_icon && file_exists(e_PLUGIN.$eplug_icon)) ? "<img src='".e_PLUGIN.$eplug_icon."' alt='' style='border:0px; width: 32px; height: 32px' />" : E_32_CAT_PLUG;
+	} else {
+		$icon = $e_icon_array[$e_sub_cat];
+	}
+	return $icon;
+} else {
+	return E_32_LOGOUT;
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_lang.sc 75/e107_files/shortcode/admin_lang.sc
--- 6171/e107_files/shortcode/admin_lang.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_lang.sc	2005-10-20 11:46:59.000000000 -0500
@@ -0,0 +1,87 @@
+if (ADMIN) {
+	global $ns, $sql, $pref;
+	if ($pref['multilanguage'])
+	{
+		$filepath = e_PLUGIN."userlanguage_menu/languages/".e_LANGUAGE.".php";
+		if(file_exists($filepath))
+		{
+			require_once($filepath);
+		}
+		else
+		{
+			require_once(e_PLUGIN."userlanguage_menu/languages/English.php");
+		}
+		$lanlist = explode(",",e_LANLIST);
+        sort($lanlist);
+		foreach($lanlist as $langval)
+		{
+			if (getperms($langval))
+			{
+				$lanperms[] = $langval;
+			}
+		}
+
+		if(!getperms($sql->mySQLlanguage) && $lanperms)
+		{
+			$sql->mySQLlanguage = ($lanperms[0] != $pref['sitelanguage']) ? $lanperms[0] : "";
+			if ($pref['user_tracking'] == "session")
+			{
+				$_SESSION['e107language_'.$pref['cookie_name']] = $lanperms[0];
+			}
+			else
+			{
+				setcookie('e107language_'.$pref['cookie_name'], $lanperms[0], time() + 86400);
+				$_COOKIE['e107language_'.$pref['cookie_name']]= $lanperms[0];
+			}
+		}
+
+		foreach($GLOBALS['mySQLtablelist'] as $tabs)
+		{
+			$clang = strtolower($sql->mySQLlanguage);
+			if(strpos($tabs,"lan_".$clang) && $clang !="")
+			{
+				$aff[] = str_replace(MPREFIX."lan_".$clang."_","",$tabs);
+			}
+		}
+
+		$text .= "<div><img src='".e_IMAGE."admin_images/language_16.png' alt='' />&nbsp;";
+		if(isset($aff))
+		{
+			$text .= $sql->mySQLlanguage.
+			": <span class='button' style='cursor: pointer;' onclick='expandit(\"lan_tables\");'><a style='text-decoration:none' title='' href=\"javascript:void(0);\" >&nbsp;&nbsp;".count($aff)." ".UTHEME_MENU_L3."&nbsp;&nbsp;</a></span><br />
+			<span style='display:none' id='lan_tables'>
+			";
+			$text .= implode("<br />",$aff);
+			$text .= "</span>";
+		}
+		elseif($sql->mySQLlanguage)
+		{
+			$text .= $sql->mySQLlanguage.": ".LAN_INACTIVE;
+		}
+		else
+		{
+			$text .= $pref['sitelanguage'].": ".LAN_INACTIVE;
+		}
+		$text .= "<br /><br /></div>";
+
+		$text .= "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."'>
+		<div>
+		<select name='sitelanguage' class='tbox'>";
+
+		foreach($lanperms as $lng)
+		{
+			$langval = ($lng == $pref['sitelanguage']) ? "" : $lng;
+			$selected = ($lng == $sql->mySQLlanguage || ($lng == $pref['sitelanguage'] && !$sql->mySQLlanguage)) ? "selected='selected'" : "";
+			$text .= "<option value='".$langval."' $selected>$lng</option>\n";
+		}
+		$text .= "</select>
+		<br /><br />
+		<input class='button' type='submit' name='setlanguage' value='".UTHEME_MENU_L1."' />
+		</div>
+		</form>
+		</div>";
+
+		return $ns -> tablerender(UTHEME_MENU_L2, $text, '', TRUE);
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_latest.sc 75/e107_files/shortcode/admin_latest.sc
--- 6171/e107_files/shortcode/admin_latest.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_latest.sc	2005-10-16 04:07:27.000000000 -0500
@@ -0,0 +1,44 @@
+if (ADMIN) {
+	if (!function_exists('admin_latest')) {
+		function admin_latest() {
+			global $sql, $ns, $pref;
+			$active_uploads = $sql -> db_Select("upload", "*", "upload_active=0");
+			$submitted_news = $sql -> db_Select("submitnews", "*", "submitnews_auth ='0' ");
+
+			$text = "<div style='padding-bottom: 2px;'>".E_16_NEWS.($submitted_news ? " <a href='".e_ADMIN."newspost.php?sn'>".ADLAN_LAT_2.": $submitted_news</a>" : " ".ADLAN_LAT_2.": 0")."</div>";
+			$text .= "<div style='padding-bottom: 2px;'>".E_16_UPLOADS.($active_uploads ? " <a href='".e_ADMIN."upload.php'>".ADLAN_LAT_7.": $active_uploads</a>" : " ".ADLAN_LAT_7.": ".$active_uploads)."</div>";
+
+			if ($pref['plug_latest']) {
+				$lats = explode(",", $pref['plug_latest']);
+				foreach($lats as $lat) {
+					if (file_exists(e_PLUGIN.$lat."/e_latest.php")) {
+						include_once(e_PLUGIN.$lat."/e_latest.php");
+					}
+				}
+			}
+
+			$messageTypes = array("Broken Download", "Dev Team Message");
+			$queryString = "";
+			foreach($messageTypes as $types) {
+				$queryString .= " gen_type='$types' OR";
+			}
+			$queryString = substr($queryString, 0, -3);
+
+			if($amount = $sql -> db_Select("generic", "*", $queryString)) {
+				$text .= "<br /><b><a href='".e_ADMIN."message.php'>".ADLAN_LAT_8." [".$amount."]</a></b>";
+			}
+
+			return $ns -> tablerender(ADLAN_LAT_1, $text, '', TRUE);
+		}
+	}
+
+	if ($parm == 'request') {
+		if (function_exists('latest_request')) {
+			if (latest_request()) {
+				return admin_latest();
+			}
+		}
+	} else {
+		return admin_latest();
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_logged.sc 75/e107_files/shortcode/admin_logged.sc
--- 6171/e107_files/shortcode/admin_logged.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_logged.sc	2005-06-30 23:00:13.000000000 -0500
@@ -0,0 +1,10 @@
+if (ADMIN) {
+	$str = str_replace(".", "", ADMINPERMS);
+	if (ADMINPERMS == "0") {
+		return "<b>".ADLAN_48.":</b> ".ADMINNAME." (".ADLAN_49.") ".( defined('e_DBLANGUAGE') ? "<b>".LAN_head_5."</b> ".e_DBLANGUAGE : "" ) ;
+	} else {
+		return "<b>".ADLAN_48.":</b> ".ADMINNAME." ".( defined('e_DBLANGUAGE') ? "<b>".LAN_head_5."</b> ".e_DBLANGUAGE : "" ) ;
+	}
+} else {
+	return ADLAN_51." ...";
+}
diff -ruN 6171/e107_files/shortcode/admin_logo.sc 75/e107_files/shortcode/admin_logo.sc
--- 6171/e107_files/shortcode/admin_logo.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_logo.sc	2006-04-29 01:01:26.000000000 -0500
@@ -0,0 +1,33 @@
+parse_str($parm);
+
+if (isset($file) && $file && is_readable($file))
+{
+	$logo = $file;
+	$path = $file;
+}
+else if (is_readable(THEME."images/e_adminlogo.png"))
+{
+	$logo = THEME_ABS."images/e_adminlogo.png";
+	$path = THEME."images/e_adminlogo.png";
+}
+else
+{
+	$logo = e_IMAGE."adminlogo.png";
+	$path = $logo;
+}
+
+$dimensions = getimagesize($path);
+
+$image = "<img class='logo admin_logo' src='".$logo."' style='width: ".$dimensions[0]."px; height: ".$dimensions[1]."px' alt='Admin Area' />\n";
+
+if (isset($link) && $link) {
+	if ($link == 'index') {
+		$image = "<a href='".e_ADMIN."index.php'>".$image."</a>";
+	}
+	else
+	{
+		$image = "<a href='".$link."'>".$image."</a>";
+	}
+}
+
+return $image;
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_log.sc 75/e107_files/shortcode/admin_log.sc
--- 6171/e107_files/shortcode/admin_log.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_log.sc	2006-02-18 16:52:34.000000000 -0600
@@ -0,0 +1,36 @@
+if (ADMIN) {
+	if (!function_exists('admin_log')) {
+		function admin_log() {
+			global $sql, $ns;
+			$text = E_16_ADMINLOG." <a style='cursor: pointer; cursor: hand' onclick=\"expandit('adminlog')\">".ADLAN_116."</a>\n";
+			if (e_QUERY == "logall") {
+				$text .= "<div id='adminlog'>";
+				$cnt = $sql -> db_Select("dblog", "*", "ORDER BY `dblog_datestamp` DESC", "no_where");
+			} else {
+				$text .= "<div style='display: none;' id='adminlog'>";
+				$cnt = $sql -> db_Select("dblog", "*", "ORDER BY `dblog_datestamp` DESC LIMIT 0,10", "no_where");
+			}
+			$text .= ($cnt) ? "<ul>" : "";
+			$gen = new convert;
+			while ($row = $sql -> db_Fetch()) {
+				$datestamp = $gen->convert_date($row['dblog_datestamp'], 'short');
+				$text .= "<li>{$datestamp} - {$row['dblog_remarks']}</li>";
+			}
+			$text .= ($cnt ? "</ul>" : "");
+
+			$text .= "[ <a href='".e_ADMIN."admin_log.php?logall'>".ADLAN_117."</a> ][ <a href='".e_ADMIN."admin_log.php?purge'>".ADLAN_118."</a> ]\n</div>";
+
+			return $ns -> tablerender(ADLAN_135, $text, '', TRUE);
+		}
+	}
+
+	if ($parm == 'request') {
+		if (function_exists('log_request')) {
+			if (log_request()) {
+				return admin_log();
+			}
+		}
+	} else {
+		return admin_log();
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_menu.sc 75/e107_files/shortcode/admin_menu.sc
--- 6171/e107_files/shortcode/admin_menu.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_menu.sc	2005-01-17 20:55:22.000000000 -0600
@@ -0,0 +1,26 @@
+if (ADMIN) {
+	global $ns, $pref;
+	ob_start();
+	//Show upper_right menu if the function exists
+	$tmp = explode(".",e_PAGE);
+	$adminmenu_func = $tmp[0]."_adminmenu";
+	if(function_exists($adminmenu_func)){
+		if (!$parm) {
+			call_user_func($adminmenu_func,$adminmenu_parms);
+		} else {
+			return 'pre';
+		}
+	}
+	$plugindir = (str_replace("/","",str_replace("..","",e_PLUGIN))."/");
+	$plugpath = e_PLUGIN.str_replace(basename(e_SELF),"",str_replace($plugindir,"",strstr(e_SELF,$plugindir)))."admin_menu.php";
+	if(file_exists($plugpath)){
+		if (!$parm) {
+			@require_once($plugpath);
+		} else {
+			return 'pre';
+		}
+	}
+	$ret = ob_get_contents();
+	ob_end_clean();
+	return $ret;
+}
diff -ruN 6171/e107_files/shortcode/admin_msg.sc 75/e107_files/shortcode/admin_msg.sc
--- 6171/e107_files/shortcode/admin_msg.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_msg.sc	2005-02-04 02:17:24.000000000 -0600
@@ -0,0 +1,15 @@
+if (ADMIN) {
+	global $ns;
+	ob_start();
+	if(!FILE_UPLOADS){
+	         echo message_handler("ADMIN_MESSAGE", LAN_head_2, __LINE__, __FILE__);
+	}
+	/*
+	if(OPEN_BASEDIR){
+	        echo message_handler("ADMIN_MESSAGE", LAN_head_3, __LINE__, __FILE__);
+	}
+	*/
+	$message_text = ob_get_contents();
+	ob_end_clean();
+	return $message_text;
+}
diff -ruN 6171/e107_files/shortcode/admin_nav.sc 75/e107_files/shortcode/admin_nav.sc
--- 6171/e107_files/shortcode/admin_nav.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_nav.sc	2005-06-14 17:39:24.000000000 -0500
@@ -0,0 +1,54 @@
+if (ADMIN) {
+	global $ns, $pref, $e107_plug, $array_functions;
+	if (strstr(e_SELF, "/admin.php")) {
+		$active_page = 'x';
+	} else {
+		$active_page = time();
+	}
+	$e107_var['x']['text']=ADLAN_52;
+	$e107_var['x']['link']=e_ADMIN.'admin.php';
+	$e107_var['y']['text']=ADLAN_53;
+	$e107_var['y']['link']=e_BASE."index.php";
+
+	$text .= show_admin_menu("",$active_page,$e107_var);
+
+	unset($e107_var);
+	foreach ($array_functions as $links_key => $links_value) {
+		$e107_var[$links_key]['text'] = $links_value[1];
+		$e107_var[$links_key]['link'] = $links_value[0];
+	}
+	$text .= show_admin_menu(ADLAN_93, time(), $e107_var, FALSE, TRUE, TRUE);
+	unset($e107_var);
+	// Plugin links menu
+
+	$sql = new db;
+	if ($sql -> db_Select("plugin", "*", "plugin_installflag=1")) {
+		//Link Plugin Manager
+		$e107_var['x']['text'] = "<b>".ADLAN_98."</b>";
+		$e107_var['x']['link'] = e_ADMIN."plugin.php";
+		$e107_var['x']['perm'] = "P";
+
+		while($rowplug = $sql -> db_Fetch()) {
+			extract($rowplug);
+			$e107_plug[$rowplug[1]] = $rowplug[3];
+			include_once(e_PLUGIN.$plugin_path."/plugin.php");
+
+			// Links Plugins
+			if ($eplug_conffile) {
+				$e107_var['x'.$plugin_id]['text'] = $eplug_caption;
+				$e107_var['x'.$plugin_id]['link'] = e_PLUGIN.$plugin_path."/".$eplug_conffile;
+				$e107_var['x'.$plugin_id]['perm'] = "P".$plugin_id;
+			}
+			unset($eplug_conffile, $eplug_name, $eplug_caption);
+		}
+
+		$text .= show_admin_menu(ADLAN_95, time(), $e107_var, FALSE, TRUE, TRUE);
+		unset($e107_var);
+	}
+	unset($e107_var);
+	$e107_var['x']['text']=ADLAN_46;
+	$e107_var['x']['link']=e_ADMIN."admin.php?logout";
+	$text .= show_admin_menu("",$act,$e107_var);
+	return $ns -> tablerender(LAN_head_1, $text, array('id' => 'admin_nav', 'style' => 'button_menu'), TRUE);
+}
+
diff -ruN 6171/e107_files/shortcode/admin_plugins.sc 75/e107_files/shortcode/admin_plugins.sc
--- 6171/e107_files/shortcode/admin_plugins.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_plugins.sc	2005-02-04 02:17:24.000000000 -0600
@@ -0,0 +1,44 @@
+if (ADMIN) {
+	global $e107_plug, $ns, $pref;
+	if ($pref['admin_alerts_ok'] == 1) {
+		ob_start();
+		$text = "";
+		$i = 0;
+		if (strstr(e_SELF, "/admin.php")) {
+			global $sql;
+			if ($sql -> db_Select("plugin", "*", "plugin_installflag=1")) {
+				while($rowplug = $sql -> db_Fetch()){
+					extract($rowplug);
+					$e107_plug[$rowplug[1]] = $rowplug[3];
+				}
+			}
+		}
+		foreach(array_keys($e107_plug) as $xplug){
+			if (file_exists(e_PLUGIN.$e107_plug[$xplug]."/admin_info.php")) {
+				if ($pref['admin_alerts_uniquemenu'] == 1) {
+					$text .= "<b>".$xplug."</b><br />";
+				} else {
+					$text = "";
+				}
+				require_once(e_PLUGIN.$e107_plug[$xplug]."/admin_info.php");
+				$text .= "<br />";
+				if ($pref['admin_alerts_uniquemenu'] != 1) {
+					$caption = $xplug;
+					$ns -> tablerender($caption, $text);
+				} else {
+					$text .= "<br />";
+				}
+				$i++;
+			}
+		}
+    
+		$caption = LAN_head_6;
+    
+		if ($i>0 && $pref['admin_alerts_uniquemenu'] == 1) {
+			$ns -> tablerender($caption, $text);
+		}
+		$plug_text = ob_get_contents();
+		ob_end_clean();
+		return $plug_text;
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_preset.sc 75/e107_files/shortcode/admin_preset.sc
--- 6171/e107_files/shortcode/admin_preset.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_preset.sc	2005-12-27 13:19:39.000000000 -0600
@@ -0,0 +1,38 @@
+if(ADMIN){
+	global $sql,$pst,$ns,$tp,$e_wysiwyg,$pref;
+	if(isset($pst) && $pst->form && $pst->page){
+		$thispage = urlencode(e_SELF."?".e_QUERY);
+		if(is_array($pst->page)){
+		for ($i=0; $i<count($pst->page); $i++) {
+			if (strpos($thispage, urlencode($pst->page[$i])) !== FALSE){
+				$query = urlencode($pst->page[$i]);
+				$theform = $pst->form[$i];
+				$pid = $i;
+				}
+			}
+		}else{
+			$query = urlencode($pst->page);
+			$theform = $pst->form;
+			$pid = 0;
+		}
+
+		$existing = is_array($pst->id) ? $pst->id[$pid] : $pst->id;
+        $trigger = ($e_wysiwyg && $pref['wysiwyg']) ? "tinyMCE.triggerSave();" : "";
+
+
+		 if (strpos($thispage, $query) !== FALSE) {
+			$pst_text = "
+			<form method='post' action='".e_SELF."?clr_preset' id='e_preset' >
+			<div style='text-align:center'>";
+			if(!$sql->db_Count("preset", "(*)", " WHERE preset_name='".$tp -> toDB($existing, true)."'  ")){
+				$pst_text .= "<input type='button' class='button' name='save_preset' value='".LAN_SAVE."' onclick=\"$trigger savepreset('".$theform."',$pid)\" />";
+			}else{
+				$pst_text .= "<input type='button' class='button' name='save_preset' value='".LAN_UPDATE."' onclick=\"$trigger savepreset('".$theform."',$pid)\" />";
+				$pst_text .= "<input type='hidden' name='del_id' value='$pid' />
+				<input type='submit' class='button' name='delete_preset' value='".LAN_DELETE."' onclick=\"return jsconfirm('".$tp->toJS(LAN_PRESET_CONFIRMDEL." [".$existing."]")."')\" />";
+			}
+			$pst_text .= "</div></form>";
+			return $ns -> tablerender(LAN_PRESET, $pst_text, '', TRUE);
+		}
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_pword.sc 75/e107_files/shortcode/admin_pword.sc
--- 6171/e107_files/shortcode/admin_pword.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_pword.sc	2005-06-01 11:02:17.000000000 -0500
@@ -0,0 +1,7 @@
+if (ADMIN && ADMINPERMS == "0") {
+	global $ns;
+	if ($pref['adminpwordchange'] && ((ADMINPWCHANGE+2592000) < time())) {
+		$text = "<div style='mediumtext; text-align:center'>".ADLAN_102." <a href='".e_ADMIN."updateadmin.php'>".ADLAN_103."</a></div>";
+		return $ns -> tablerender(ADLAN_104, $text, '', TRUE);
+	}
+}
diff -ruN 6171/e107_files/shortcode/admin_sel_lan.sc 75/e107_files/shortcode/admin_sel_lan.sc
--- 6171/e107_files/shortcode/admin_sel_lan.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_sel_lan.sc	2005-01-05 10:57:38.000000000 -0600
@@ -0,0 +1,8 @@
+if (ADMIN) {
+	if ($pref['multilanguage']) {
+		global $sql;
+		$ret = " <b>".ADLAN_132.":</b> ";
+		$ret .= ($sql->mySQLlanguage) ? $sql->mySQLlanguage : ADLAN_133;
+		return $ret;
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_siteinfo.sc 75/e107_files/shortcode/admin_siteinfo.sc
--- 6171/e107_files/shortcode/admin_siteinfo.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_siteinfo.sc	2006-04-18 03:53:36.000000000 -0500
@@ -0,0 +1,63 @@
+if (ADMIN) {
+	global $sql, $ns, $pref, $themename, $themeversion, $themeauthor, $themedate, $themeinfo, $mySQLdefaultdb;
+
+	if (!isset($pref['install_date'])) {
+		$sql -> db_Select("core", "*", "e107_name='e107' ");
+		$row = $sql -> db_Fetch();
+		$coreinfo = unserialize($row['e107_value']);
+		$pref['install_date'] = $coreinfo['e107_datestamp'];
+   		save_prefs();
+   		$sql -> db_Delete("core", "e107_name='e107'");
+	}
+	
+
+	if (file_exists(e_ADMIN."ver.php"))
+	{ 
+		include(e_ADMIN."ver.php"); 
+	}
+
+	$obj = new convert;
+	$install_date = $obj->convert_date($pref['install_date'], "long");
+
+	$text = "<b>".FOOTLAN_1."</b>
+	<br />".
+	SITENAME."
+	<br /><br />
+	<b>".FOOTLAN_2."</b>
+	<br />
+	<a href=\"mailto:".SITEADMINEMAIL."\">".SITEADMIN."</a>
+	<br />
+	<br />
+	<b>e107</b>
+	<br />
+	".FOOTLAN_3." ".$e107info['e107_version']."
+	<br /><br />
+	<b>".FOOTLAN_5."</b>
+	<br />
+	".$themename." v".$themeversion." ".($themeauthor ? FOOTLAN_6.' '.$themeauthor : '')." ".($themedate ? "(".$themedate.")" : "");
+
+	$text .= $themeinfo ? "<br />".FOOTLAN_7.": ".$themeinfo : "";
+
+	$text .= "<br /><br />
+	<b>".FOOTLAN_8."</b>
+	<br />
+	".$install_date."
+	<br /><br />
+	<b>".FOOTLAN_9."</b>
+	<br />".
+	 preg_replace("/PHP.*/i", "", $_SERVER['SERVER_SOFTWARE'])."<br />(".FOOTLAN_10.": ".$_SERVER['SERVER_NAME'].")
+	<br /><br />
+	<b>".FOOTLAN_11."</b>
+	<br />
+	".phpversion()."
+	<br /><br />
+	<b>".FOOTLAN_12."</b>
+	<br />
+	".mysql_get_server_info().
+	"<br />
+	".FOOTLAN_16.": ".$mySQLdefaultdb."
+	<br /><br />
+	<b>".FOOTLAN_17."</b>
+	<br />".CHARSET;
+	return $ns -> tablerender(FOOTLAN_13, $text, '', TRUE);
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_status.sc 75/e107_files/shortcode/admin_status.sc
--- 6171/e107_files/shortcode/admin_status.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_status.sc	2006-01-04 14:46:45.000000000 -0600
@@ -0,0 +1,54 @@
+if (ADMIN) {
+	if (!function_exists('admin_status')) {
+		function admin_status() {
+			global $sql, $ns, $pref;
+			$members = $sql -> db_Count("user");
+			$unverified = $sql -> db_Count("user", "(*)", "WHERE user_ban=2");
+			$banned = $sql -> db_Count("user", "(*)", "WHERE user_ban=1");
+			$comments = $sql -> db_Count("comments");
+			$unver = ($unverified ? " <a href='".e_ADMIN."users.php?unverified'>".ADLAN_111."</a>" : ADLAN_111);
+
+			$text = "<div style='padding-bottom: 2px;'>".E_16_USER." ".ADLAN_110.": ".$members."</div>";
+			$text .= "<div style='padding-bottom: 2px;'>".E_16_USER." {$unver}: ".$unverified."</div>";
+			$text .= "<div style='padding-bottom: 2px;'>".E_16_BANLIST." ".ADLAN_112.": ".$banned."</div>";
+			$text .= "<div style='padding-bottom: 2px;'>".E_16_COMMENT." ".ADLAN_114.": ".$comments."</div>";
+
+			if ($pref['plug_status']) {
+				$stas = explode(",", $pref['plug_status']);
+				foreach($stas as $sta) {
+					if (file_exists(e_PLUGIN.$sta."/e_status.php")) {
+						include_once(e_PLUGIN.$sta."/e_status.php");
+					}
+				}
+			}
+
+			require_once(e_HANDLER.'file_class.php');
+			$fl = new e_file;
+			$pluginList = $fl->get_files(e_PLUGIN, "^adminlist\.php$", "standard", 1);
+
+			foreach($pluginList as $p)
+			{
+				$text .= include_once($p['path'].$p['fname']);
+			}
+
+			if($flo = $sql -> db_Select("generic", "*", "gen_type='failed_login' "))
+			{
+
+				$text .= "<img src='".e_IMAGE."admin_images/failedlogin_16.png' alt='' style='vertical-align: middle;' /> <a href='".e_ADMIN."fla.php'>".ADLAN_146.": $flo</a>";
+			}
+
+
+			return $ns -> tablerender(ADLAN_134, $text, '', TRUE);
+		}
+	}
+
+	if ($parm == 'request') {
+		if (function_exists('status_request')) {
+			if (status_request()) {
+				return admin_status();
+			}
+		}
+	} else {
+		return admin_status();
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/admin_userlan.sc 75/e107_files/shortcode/admin_userlan.sc
--- 6171/e107_files/shortcode/admin_userlan.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/admin_userlan.sc	2005-03-09 04:40:42.000000000 -0600
@@ -0,0 +1,4 @@
+if (isset($_COOKIE['userlan']) && $_COOKIE['userlan']) {
+	return " <b>Language:</b> ".$_COOKIE['userlan'];
+}
+
diff -ruN 6171/e107_files/shortcode/banner.sc 75/e107_files/shortcode/banner.sc
--- 6171/e107_files/shortcode/banner.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/banner.sc	2005-12-27 13:19:39.000000000 -0600
@@ -0,0 +1,44 @@
+global $sql, $tp, $ns, $menu_pref;
+$ret = "";
+
+unset($text);
+mt_srand ((double) microtime() * 1000000);
+$seed = mt_rand(1,2000000000);
+
+$query = " (banner_startdate=0 OR banner_startdate<=".time().") AND (banner_enddate=0 OR banner_enddate>".time().") AND (banner_impurchased=0 OR banner_impressions<=banner_impurchased)".($parm ? " AND banner_campaign='".$tp -> toDB($parm)."'" : "")." 
+AND banner_active IN (".USERCLASS_LIST.")
+ORDER BY RAND($seed)";
+
+if($sql -> db_Select("banner", "*", $query)){
+	$row = $sql->db_Fetch();
+
+	if(!$row['banner_image'])
+	{
+		return "<a href='".e_HTTP."banner.php?".$row['banner_id']."' rel='external'>no image assigned to this banner</a>";
+	}
+
+	$fileext1 = substr(strrchr($row['banner_image'], "."), 1);
+	$sql->db_Update("banner", "banner_impressions=banner_impressions+1 WHERE banner_id='{$row['banner_id']}' ");
+	if ($fileext1 == 'swf')
+	{
+		return "
+		<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"468\" height=\"60\">\n
+			<param name=\"movie\" value=\"".e_IMAGE_ABS."banners/".$row['banner_image']."\">\n
+			<param name=\"quality\" value=\"high\">\n
+			<param name=\"SCALE\" value=\"noborder\">\n
+			<embed src=\"".e_IMAGE_ABS."banners/".$row['banner_image']."\" width=\"468\" height=\"60\" scale=\"noborder\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"></embed>
+		</object>
+		";
+	}
+	elseif($fileext1 == 'php' || $fileext1 == 'html' || $fileext1 == 'js')
+	{
+		$file_data = file_get_contents(e_IMAGE."banners/".$row['banner_image']);
+		return $file_data;
+	}
+	else
+	{
+		return "<a href='".e_HTTP."banner.php?".$row['banner_id']."' rel='external'><img src='".e_IMAGE_ABS."banners/".$row['banner_image']."' alt='".$row['banner_clickurl']."' style='border:0' /></a>";
+	}
+} else {
+	return "&nbsp;";
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/batch/comment_shortcodes.php 75/e107_files/shortcode/batch/comment_shortcodes.php
--- 6171/e107_files/shortcode/batch/comment_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/batch/comment_shortcodes.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,133 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/comment_shortcodes.php,v $
+|     $Revision: 1.15 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$comment_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+/*
+
+SC_BEGIN SUBJECT
+global $SUBJECT, $comrow, $pref, $NEWIMAGE, $tp;
+if (isset($pref['nested_comments']) && $pref['nested_comments']) {
+	$SUBJECT = $NEWIMAGE." ".(empty($comrow['comment_subject']) ? $subject : $tp->toHTML($comrow['comment_subject'], TRUE));
+} else {
+	$SUBJECT = '';
+}
+return $SUBJECT;
+SC_END
+
+SC_BEGIN USERNAME
+global $USERNAME, $comrow;
+if (isset($comrow['user_id']) && $comrow['user_id']) {
+	$USERNAME = "<a href='".e_BASE."user.php?id.".$comrow['user_id']."'>".$comrow['user_name']."</a>\n";
+}else{
+	$comrow['user_id'] = 0;
+	$USERNAME = preg_replace("/[0-9]+\./", '', $comrow['comment_author']);
+}
+return $USERNAME;
+SC_END
+
+SC_BEGIN TIMEDATE
+global $TIMEDATE, $comrow, $datestamp, $gen;
+$datestamp = $gen->convert_date($comrow['comment_datestamp'], "short");
+return $datestamp;
+SC_END
+
+SC_BEGIN REPLY
+global $REPLY, $comrow, $action, $pref, $table, $id, $thisaction, $thistable, $thisid;
+$REPLY = '';
+if($comrow['comment_lock'] != "1"){
+	if ($thisaction == "comment" && $pref['nested_comments']) {
+		$REPLY = "<a href='".e_BASE."comment.php?reply.".$thistable.".".$comrow['comment_id'].".".$thisid."'>".COMLAN_6."</a>";
+	}
+}
+return $REPLY;
+SC_END
+
+SC_BEGIN AVATAR
+global $AVATAR, $comrow;
+if (isset($comrow['user_id']) && $comrow['user_id']) {
+	if (isset($comrow['user_image']) && $comrow['user_image']) {
+		require_once(e_HANDLER."avatar_handler.php");
+		$comrow['user_image'] = avatar($comrow['user_image']);
+		$comrow['user_image'] = "<div class='spacer'><img src='".$comrow['user_image']."' alt='' /></div>";
+	}else{
+		$comrow['user_image'] = '';
+	}
+}else{
+	$comrow['user_image'] = '';
+}
+return $comrow['user_image'];
+SC_END
+
+SC_BEGIN COMMENTS
+global $COMMENTS, $comrow;
+return (isset($comrow['user_id']) && $comrow['user_id'] ? LAN_99.": ".$comrow['user_comments'] : LAN_194)."<br />";
+SC_END
+
+SC_BEGIN JOINED
+global $JOINED, $comrow, $gen;
+$JOINED = '';
+if ($comrow['user_id'] && !$comrow['user_admin']) {
+	$comrow['user_join'] = $gen->convert_date($comrow['user_join'], "short");
+	$JOINED = ($comrow['user_join'] ? LAN_145." ".$comrow['user_join'] : '');
+}
+return $JOINED;
+SC_END
+
+SC_BEGIN COMMENT
+global $COMMENT, $comrow, $tp, $pref;
+return (isset($comrow['comment_blocked']) && $comrow['comment_blocked'] ? LAN_0 : $tp->toHTML($comrow['comment_comment'], TRUE, FALSE, $comrow['user_id']));
+SC_END
+
+SC_BEGIN COMMENTEDIT
+global $COMMENTEDIT, $pref, $comrow;
+return ($pref['allowCommentEdit'] && (ADMIN || (USER && $comrow['user_id'] == USERID && $comrow['comment_lock'] != "1")) && !strstr(e_QUERY, "edit") ? "<a href='".e_SELF."?".e_QUERY.".edit.".$comrow['comment_id']."'><img src='".e_IMAGE."generic/".IMODE."/newsedit.png' alt='".LAN_318."' title='".LAN_318."' style='border: 0;' /></a>" : "");
+SC_END
+
+SC_BEGIN RATING
+global $RATING;
+return $RATING;
+SC_END
+
+SC_BEGIN IPADDRESS
+global $IPADDRESS, $comrow;
+require_once(e_HANDLER."encrypt_handler.php");
+return (ADMIN ? "<a href='".e_BASE."userposts.php?0.comments.".$comrow['comment_ip']."'>IP: ".decode_ip($comrow['comment_ip'])."</a>" : "");
+SC_END
+
+SC_BEGIN LEVEL
+global $LEVEL, $comrow, $pref;
+$ldata = get_level($comrow['user_id'], $comrow['user_forums'], $comrow['user_comments'], $comrow['user_chats'], $comrow['user_visits'], $comrow['user_join'], $comrow['user_admin'], $comrow['user_perms'], $pref);
+return ($comrow['user_admin'] ? $ldata[0] : $ldata[1]);
+SC_END
+
+SC_BEGIN LOCATION
+global $LOCATION, $comrow, $tp;
+return (isset($comrow['user_location']) && $comrow['user_location'] ? LAN_313.": ".$tp->toHTML($comrow['user_location'], TRUE) : '');
+SC_END
+
+SC_BEGIN SIGNATURE
+global $SIGNATURE, $comrow, $tp;
+$SIGNATURE = (isset($comrow['user_signature']) && $comrow['user_signature'] ? $tp->toHTML($comrow['user_signature'], true) : '');
+return $SIGNATURE;
+SC_END
+
+*/
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/batch/download_shortcodes.php 75/e107_files/shortcode/batch/download_shortcodes.php
--- 6171/e107_files/shortcode/batch/download_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/batch/download_shortcodes.php	2006-01-15 20:37:30.000000000 -0600
@@ -0,0 +1,113 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/download_shortcodes.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/01/16 02:37:30 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$download_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+/*
+SC_BEGIN DOWNLOAD_LIST_NAME
+global $row,$tp;
+return  "<a href='".e_SELF."?view.".$row['download_id']."'>".$tp->toHTML($row['download_name'])."</a>";
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_AUTHOR
+global $row;
+return $row['download_author'];
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_REQUESTED
+global $row;
+return $row['download_requested'];
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_ICON
+global $row;
+$img = "<img src='".IMAGE_DOWNLOAD."' alt='' style='border:0' title='".LAN_dl_32."' />";
+if($parm == "link"){
+	return "<a href='".e_SELF."?view.".$row['download_id']."' >".$img."</a>";
+}else{
+	return $img;
+}
+return;
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_NEWICON
+global $row;
+return (USER && $row['download_datestamp'] > USERLV ? "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' />" : "");
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_FILESIZE
+global $row;
+return parsesize($row['download_filesize']);
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_DATESTAMP
+global $row;
+$gen = new convert;
+return $gen->convert_date($row['download_datestamp'], "short");
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_THUMB
+global $row;
+$img = ($row['download_thumb']) ? "<img src='".e_FILE."downloadthumbs/".$row['download_thumb']."' alt='' style='".DL_IMAGESTYLE."' />" : "";
+if($parm == "link" && $row['download_thumb']){
+	return "<a href='".e_SELF."?view.".$row['download_id']."'>".$img."</a>";
+}else{
+	return $img;
+}
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_ID
+global $row;
+return $row['download_id'];
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_RATING
+global $row;
+$rater = new rater;
+$ratearray = $rater->getrating("download", $row['download_id']);
+	if (!$ratearray[0]) {
+		return LAN_dl_13;
+	} else {
+		return ($ratearray[2] ? "{$ratearray[1]}.{$ratearray[2]}/{$ratearray[0]}" : "{$ratearray[1]}/{$ratearray[0]}");
+	}
+SC_END
+
+
+SC_BEGIN DOWNLOAD_LIST_LINK
+global $tp,$row,$pref;
+$agreetext = $tp->toJS($pref['agree_text']);
+	if($row['download_mirror_type']){
+		return ($pref['agree_flag'] ? "<a href='".e_SELF."?mirror.".$row['download_id']."' onclick= \"return confirm('{$agreetext}');\">" : "<a href='".e_SELF."?mirror.".$row['download_id']."' >");
+	}else{
+		return ($pref['agree_flag'] ? "<a href='".e_BASE."request.php?".$row['download_id']."' onclick= \"return confirm('{$agreetext}');\">" : "<a href='".e_BASE."request.php?".$row['download_id']."' >");
+	}
+SC_END
+
+
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/batch/news_archives.php 75/e107_files/shortcode/batch/news_archives.php
--- 6171/e107_files/shortcode/batch/news_archives.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/batch/news_archives.php	2006-01-25 01:17:59.000000000 -0600
@@ -0,0 +1,48 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$news_archive_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+		
+/*
+SC_BEGIN ARCHIVE_BULLET
+global $news2;
+return "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' style='border:0px' alt='' />";
+SC_END
+
+SC_BEGIN ARCHIVE_LINK
+global $news2;
+return "<a href='news.php?item.".$news2['news_id']."'>".$news2['news_title']."</a>";
+SC_END
+
+
+SC_BEGIN ARCHIVE_AUTHOR
+global $news2;
+return "<a href='".e_BASE."user.php?id.".$news2['user_id']."'>".$news2['user_name']."</a>";
+SC_END
+
+
+SC_BEGIN ARCHIVE_DATESTAMP
+global $news2;
+return $news2['news_datestamp'];
+SC_END
+
+SC_BEGIN ARCHIVE_CATEGORY
+global $news2;
+return $news2['category_name'];
+SC_END
+
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/batch/news_shortcodes.php 75/e107_files/shortcode/batch/news_shortcodes.php
--- 6171/e107_files/shortcode/batch/news_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/batch/news_shortcodes.php	2006-04-26 07:54:28.000000000 -0500
@@ -0,0 +1,292 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/news_shortcodes.php,v $
+|     $Revision: 1.22 $
+|     $Date: 2006/04/26 12:54:28 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$news_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+/*
+SC_BEGIN NEWSTITLE
+global $tp;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+return $tp -> toHTML($news_item['news_title'], TRUE, 'parse_sc');
+SC_END
+
+SC_BEGIN NEWSBODY
+global $tp;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$news_body = $tp -> toHTML($news_item['news_body'], TRUE, 'parse_sc, fromadmin', $news_item['news_author']);
+if($news_item['news_extended'] && (isset($_POST['preview']) || strpos(e_QUERY, 'extend') !== FALSE)) {
+    $news_extended = $tp -> toHTML($news_item['news_extended'], TRUE, 'parse_sc, fromadmin', $news_item['news_author']);
+    $news_body .= "<br /><br />".$news_extended;
+}
+return $news_body;
+SC_END
+
+SC_BEGIN NEWSICON
+global $tp, $news_shortcodes;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$category_icon = $tp -> parseTemplate('{NEWSHEADER}', FALSE, $news_shortcodes);
+return "<a href='".e_BASE."news.php?cat.".$news_item['news_category']."'><img style='".$param['caticon']."'  src='".$category_icon."' alt='' /></a>";
+SC_END
+	
+SC_BEGIN NEWSHEADER
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$category_icon = str_replace("../", "", $news_item['category_icon']);
+if ($category_icon && strstr("images", $category_icon)) {
+	return THEME.$category_icon;
+} else {
+	return e_IMAGE."icons/".$category_icon;
+}
+SC_END
+	
+SC_BEGIN NEWSCATEGORY
+global $tp;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$category_name = $tp -> toHTML($news_item['category_name']);
+return "<a style='".(isset($param['catlink']) ? $param['catlink'] : "#")."' href='".e_BASE."news.php?cat.".$news_item['news_category']."'>".$category_name."</a>";
+SC_END
+	
+SC_BEGIN NEWSAUTHOR
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+if($news_item['user_id'])
+{
+	if($parm == 'nolink')
+	{
+		return $news_item['user_name'];
+	}
+	else
+	{
+		return "<a href='".e_BASE."user.php?id.".$news_item['user_id']."'>".$news_item['user_name']."{$parm}</a>";
+	}
+}
+return "<a href='http://e107.org'>e107</a>";
+SC_END
+	
+SC_BEGIN NEWSDATE
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$con = new convert;
+if($parm == "")
+{
+	return  $con -> convert_date($news_item['news_datestamp'], 'long');
+}
+switch($parm)
+{
+	case 'long':
+		return  $con -> convert_date($news_item['news_datestamp'], 'long');
+		break;
+	case 'short':
+		return  $con -> convert_date($news_item['news_datestamp'], 'short');
+		break;
+	case 'forum':
+		return  $con -> convert_date($news_item['news_datestamp'], 'forum');
+		break;
+	default :
+		return date($parm, $news_item['news_datestamp']);
+		break;
+}	
+SC_END
+
+SC_BEGIN NEWSCOMMENTS
+global $pref, $sql;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$news_item['news_comment_total'] = $sql->db_Select("comments", "*", "comment_item_id='".$news_item['news_id']."' AND comment_type='0' ");
+if ($news_item['news_comment_total']) {
+	$sql->db_Select("comments", "comment_datestamp", "comment_item_id='".intval($news_item['news_id'])."' AND comment_type='0' ORDER BY comment_datestamp DESC LIMIT 0,1");
+	list($comments['comment_datestamp']) = $sql->db_Fetch();
+	$latest_comment = $comments['comment_datestamp'];
+	if ($latest_comment > USERLV ) {
+		$NEWIMAGE = $param['image_new_small'];
+	} else {
+		$NEWIMAGE = $param['image_nonew_small'];
+	}
+} else {
+	$NEWIMAGE = $param['image_nonew_small'];
+}
+return ($news_item['news_allow_comments'] ? $param['commentoffstring'] : "".($pref['comments_icon'] ? $NEWIMAGE : "")." <a href='".e_BASE."comment.php?comment.news.".$news_item['news_id']."'>".$param['commentlink'].$news_item['news_comment_total']."</a>");
+SC_END
+
+SC_BEGIN NEWSCOMMENTLINK
+global $pref, $sql;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+return ($news_item['news_allow_comments'] ? $param['commentoffstring'] : " <a href='".e_BASE."comment.php?comment.news.".$news_item['news_id']."'>".$param['commentlink']."</a>");
+SC_END
+
+SC_BEGIN NEWSCOMMENTCOUNT
+global $pref, $sql;
+$news_item = getcachedvars('current_news_item');
+return $news_item['news_comment_total'];
+SC_END
+
+	
+SC_BEGIN EMAILICON
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+require_once(e_HANDLER.'emailprint_class.php');
+return emailprint::render_emailprint('news', $news_item['news_id'], 1);
+SC_END
+	
+SC_BEGIN PRINTICON
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+require_once(e_HANDLER.'emailprint_class.php');
+return emailprint::render_emailprint('news', $news_item['news_id'], 2);
+SC_END
+
+SC_BEGIN PDFICON
+global $tp;
+$news_item = getcachedvars('current_news_item');
+return $tp -> parseTemplate("{PDF=".LAN_NEWS_24."^news.".$news_item['news_id']."}");
+SC_END
+
+SC_BEGIN NEWSID
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+return $news_item['news_id'];
+SC_END
+	
+SC_BEGIN ADMINOPTIONS
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+if (ADMIN && getperms("H")) {
+	$adop_icon = (file_exists(THEME."generic/newsedit.png") ? THEME."generic/newsedit.png" : e_IMAGE."generic/".IMODE."/newsedit.png");
+	return " <a href='".e_BASE.e_ADMIN."newspost.php?create.edit.".$news_item['news_id']."'><img src='".$adop_icon."' alt='' style='border:0' /></a>\n";
+} else {
+	return '';
+}
+SC_END
+	
+SC_BEGIN EXTENDED
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+if ($news_item['news_extended'] && strpos(e_QUERY, 'extend') === FALSE) {
+	if (defined("PRE_EXTENDEDSTRING")) {
+		$es1 = PRE_EXTENDEDSTRING;
+	}
+	if (defined("POST_EXTENDEDSTRING")) {
+		$es2 = POST_EXTENDEDSTRING;
+	}
+	if (isset($_POST['preview'])) {
+		return $es1.EXTENDEDSTRING.$es2."<br />".$news_item['news_extended'];
+	} else {
+		return $es1."<a href='".e_BASE."news.php?extend.".$news_item['news_id']."'>".EXTENDEDSTRING."</a>".$es2;
+	}
+} else {
+	return "";
+}
+SC_END
+	
+SC_BEGIN CAPTIONCLASS
+global $tp;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$news_title = $tp -> toHTML($news_item['news_title'], TRUE);
+return "<div class='category".$news_item['news_category']."'>".($news_item['news_render_type'] == 1 ? "<a href='".e_BASE."comment.php?comment.news.".$news_item['news_id']."'>".$news_title."</a>" : $news_title)."</div>";
+SC_END
+	
+SC_BEGIN ADMINCAPTION
+global $tp;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$news_title = $tp -> toHTML($news_item['news_title'], TRUE);
+return "<div class='".(defined(ADMINNAME) ? ADMINNAME : "null")."'>".($news_item['news_render_type'] == 1 ? "<a href='".e_BASE."comment.php?comment.news.".$news_item['news_id']."'>".$news_title."</a>" : $news_title)."</div>";
+SC_END
+	
+SC_BEGIN ADMINBODY
+global $tp, $news_shortcodes;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$news_body = $tp -> parseTemplate('{NEWSBODY}', FALSE, $news_shortcodes);
+return "<div class='".(defined(ADMINNAME) ? ADMINNAME : "null")."'>".$news_body."</div>";
+SC_END
+	
+SC_BEGIN NEWSSUMMARY
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+return ($news_item['news_summary']) ? $news_item['news_summary']."<br />" : "";
+SC_END
+	
+SC_BEGIN NEWSTHUMBNAIL
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+return (isset($news_item['news_thumbnail']) && $news_item['news_thumbnail']) ? "<a href='".e_BASE."news.php?item.".$news_item['news_id'].".".$news_item['news_category']."'><img class='news_image' src='".e_IMAGE."newspost_images/".$news_item['news_thumbnail']."' alt='' style='".$param['thumbnail']."' /></a>" : "";
+SC_END
+
+SC_BEGIN NEWSIMAGE
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+return (isset($news_item['news_thumbnail']) && $news_item['news_thumbnail']) ? "<a href='".e_BASE."news.php?item.".$news_item['news_id'].".".$news_item['news_category']."'><img class='news_image' src='".e_IMAGE."newspost_images/".$news_item['news_thumbnail']."' alt='' style='".$param['thumbnail']."' /></a>" : "";
+SC_END
+	
+SC_BEGIN STICKY_ICON
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+return $news_item['news_sticky'] ? $param['image_sticky'] : "";
+SC_END
+	
+SC_BEGIN NEWSTITLELINK
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+return "<a style='".(isset($param['itemlink']) ? $param['itemlink'] : "null")."' href='".e_BASE."news.php?item.".$news_item['news_id'].".".$news_item['news_category']."'>".$news_item['news_title']."</a>";
+SC_END
+	
+SC_BEGIN NEWSCATICON
+global $tp, $news_shortcodes;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$category_icon = $tp -> parseTemplate('{NEWSHEADER}', FALSE, $news_shortcodes);
+if($param['caticon'] == ""){$param['caticon'] = "border:0px";}
+return "<a href='".e_BASE."news.php?cat.".$news_item['news_category']."'><img style='".$param['caticon']."' src='".$category_icon."' alt='' /></a>";
+SC_END
+	
+SC_BEGIN TRACKBACK
+global $pref;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+if(isset($pref['trackbackEnabled'])) {
+	return ($param['trackbackbeforestring'] ? $param['trackbackbeforestring'] : "")."<a href='".e_BASE."comment.php?comment.news.".$news_item['news_id']."#track'>".$param['trackbackstring'].$news_item['tb_count']."</a>".($param['trackbackafterstring'] ? $param['trackbackafterstring'] : "");
+} else {
+	return "";
+}
+SC_END
+
+SC_BEGIN NEWSINFO
+global $ns;
+$news_item = getcachedvars('current_news_item');
+$param = getcachedvars('current_news_param');
+$con = new convert;
+$news_item['news_start'] = (isset($news_item['news_start']) && $news_item['news_start'] ? str_replace(" - 00:00:00", "", $con -> convert_date($news_item['news_start'], "long")) : LAN_NEWS_19);
+$news_item['news_end'] = (isset($news_item['news_end']) && $news_item['news_end'] ? " to ".str_replace(" - 00:00:00", "", $con -> convert_date($news_item['news_end'], "long")) : "");
+$info = $news_item['news_render_type'] == 1 ? LAN_NEWS_9 : "";
+$info .= $news_item['news_class'] == 255 ? LAN_NEWS_10 : LAN_NEWS_11;
+$info .= $news_item['news_sticky'] ? "<br />".LAN_NEWS_31 : "";
+$info .= "<br />".($news_item['news_allow_comments'] ? LAN_NEWS_13 : LAN_NEWS_12);
+$info .= LAN_NEWS_14.$news_item['news_start'].$news_item['news_end']."<br />";
+$info .= LAN_NEWS_15.strlen($news_item['news_body']).LAN_NEWS_16.strlen($news_item['news_extended']).LAN_NEWS_17."<br /><br /></div>";
+return $ns -> tablerender(LAN_NEWS_18, $info);
+SC_END
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/batch/signup_shortcodes.php 75/e107_files/shortcode/batch/signup_shortcodes.php
--- 6171/e107_files/shortcode/batch/signup_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/batch/signup_shortcodes.php	2006-05-05 01:40:20.000000000 -0500
@@ -0,0 +1,289 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/signup_shortcodes.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/05/05 06:40:20 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$signup_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+
+/*
+SC_BEGIN SIGNUP_COPPA_FORM
+if (strpos(LAN_109, "stage") !== FALSE)
+{
+	return "";
+}
+else
+{
+	return "
+<form method='post' action='".e_SELF."?stage1' >\n
+<div><br />
+<input type='radio' name='coppa' value='0' checked='checked' /> ".LAN_200."
+<input type='radio' name='coppa' value='1' /> ".LAN_201."<br />
+<br />
+<input class='button' type='submit' name='newver' value='".LAN_399."' />
+</div></form>
+";
+}
+SC_END
+
+SC_BEGIN SIGNUP_FORM_OPEN
+global $rs;
+return $rs->form_open("post", e_SELF, "signupform");
+SC_END
+
+SC_BEGIN SIGNUP_SIGNUP_TEXT
+global $pref, $tp, $SIGNUP_TEXT;
+
+if($pref['signup_text'])
+{
+	return $tp->toHTML($pref['signup_text'], TRUE, 'parse_sc,defs');
+}
+elseif($pref['user_reg_veri'])
+{
+	return $SIGNUP_TEXT;
+}
+SC_END
+
+
+SC_BEGIN SIGNUP_XUP
+global $pref, $tp, $SIGNUP_XUP_FORM, $signup_shortcodes;
+if(isset($pref['xup_enabled']) && $pref['xup_enabled'])
+{
+	return $tp->parseTemplate($SIGNUP_XUP_FORM, TRUE, $signup_shortcodes);
+}
+SC_END
+
+
+SC_BEGIN SIGNUP_DISPLAYNAME
+global $pref, $rs;
+if (check_class($pref['displayname_class']))
+{
+	return $rs->form_text("name", 30, ($_POST['name'] ? $_POST['name'] : $name), 30);
+}
+SC_END
+
+
+SC_BEGIN SIGNUP_LOGINNAME
+global $rs;
+return $rs->form_text("loginname", 30,  ($_POST['loginname'] ? $_POST['loginname'] : $loginname), 30);
+SC_END
+
+SC_BEGIN SIGNUP_REALNAME
+global $rs, $pref;
+if ($pref['signup_option_realname'])
+{
+	return $rs->form_text("realname", 30,  ($_POST['realname'] ? $_POST['realname'] : $realname), 100);
+}
+SC_END
+
+SC_BEGIN SIGNUP_PASSWORD1
+global $rs;
+return $rs->form_password("password1", 30, $password1, 20);
+SC_END
+
+SC_BEGIN SIGNUP_PASSWORD2
+global $rs;
+return $rs->form_password("password2", 30, $password2, 20);
+SC_END
+
+SC_BEGIN SIGNUP_PASSWORD_LEN
+global $pref, $SIGNUP_PASSWORD_LEN;
+if($pref['signup_pass_len'])
+{
+	return $SIGNUP_PASSWORD_LEN;
+}
+SC_END
+
+SC_BEGIN SIGNUP_EMAIL
+global $rs;
+return $rs->form_text("email", 30, ($_POST['email'] ? $_POST['email'] : $email), 100);
+SC_END
+
+SC_BEGIN SIGNUP_EMAIL_CONFIRM
+global $rs;
+return $rs->form_text("email_confirm", 30, ($_POST['email_confirm'] ? $_POST['email_confirm'] : $email_confirm), 100);
+SC_END
+
+
+SC_BEGIN SIGNUP_HIDE_EMAIL
+global $rs;
+return $rs->form_radio("hideemail", 1)." ".LAN_SIGNUP_10."&nbsp;&nbsp;".$rs->form_radio("hideemail", 0, 1)." ".LAN_200;
+SC_END
+
+
+SC_BEGIN SIGNUP_USERCLASS_SUBSCRIBE
+global $tp, $pref, $sql, $USERCLASS_SUBSCRIBE_START, $USERCLASS_SUBSCRIBE_ROW, $USERCLASS_SUBSCRIBE_END;
+$ret = "";
+$search = array('{USERCLASS_ID}', '{USERCLASS_NAME}', '{USERCLASS_DESCRIPTION}');
+if($pref['signup_option_class'] && ($sql->db_Select("userclass_classes", "*", "userclass_editclass = 0 order by userclass_name")))
+{
+	$ret = $USERCLASS_SUBSCRIBE_START;
+	while($row = $sql->db_Fetch())
+	{
+		$row['userclass_description'] = $tp->toHTML($row['userclass_description'], "", "defs");
+		$row['userclass_name'] = $tp->toHTML($row['userclass_name'], "", "defs");
+		$replace = array($row['userclass_id'], $row['userclass_name'], $row['userclass_description']);
+		$ret .= str_replace($search, $replace, $USERCLASS_SUBSCRIBE_ROW);
+	}
+	$ret .= $USERCLASS_SUBSCRIBE_END;
+	return $ret;
+}
+SC_END
+
+
+SC_BEGIN SIGNUP_EXTENDED_USER_FIELDS
+global $usere, $tp, $SIGNUP_EXTENDED_USER_FIELDS, $EXTENDED_USER_FIELD_REQUIRED;
+$text = "";
+
+$extList = $usere->user_extended_get_fieldList();
+
+$search = array(
+'{EXTENDED_USER_FIELD_TEXT}',
+'{EXTENDED_USER_FIELD_REQUIRED}',
+'{EXTENDED_USER_FIELD_EDIT}'
+);
+
+foreach($extList as $ext)
+{
+	if($ext['user_extended_struct_required'] == 1 || $ext['user_extended_struct_required'] == 2)
+	{
+		$replace = array(
+			$tp->toHTML($ext['user_extended_struct_text'], '', 'emotes_off defs'),
+			($ext['user_extended_struct_required'] == 1 ? $EXTENDED_USER_FIELD_REQUIRED : ''),
+			$usere->user_extended_edit($ext, $_POST['ue']['user_'.$ext['user_extended_struct_name']])
+		);
+		$text .= str_replace($search, $replace, $SIGNUP_EXTENDED_USER_FIELDS);
+	}
+}
+	return $text;
+SC_END
+
+SC_BEGIN SIGNUP_SIGNATURE
+global $pref, $SIGNUP_SIGNATURE_START, $SIGNUP_SIGNATURE_END;
+if($pref['signup_option_signature'])
+{
+	require_once(e_HANDLER."ren_help.php");
+	$SIGNUP_SIGNATURE_START = str_replace("{REN_HELP}", ren_help(2), $SIGNUP_SIGNATURE_START);
+	$SIGNUP_SIGNATURE_END = str_replace("{REN_HELP}", ren_help(2), $SIGNUP_SIGNATURE_END);
+	$sig = ($_POST['signature'] ? $_POST['signature'] : $signature);
+	return $SIGNUP_SIGNATURE_START.$sig.$SIGNUP_SIGNATURE_END;
+}
+SC_END
+
+SC_BEGIN SIGNUP_IMAGES
+global $pref;
+if($pref['signup_option_image'])
+{
+
+	$text = "
+	<input class='tbox' style='width:80%' id='avatar' type='text' name='image' size='40' value='$image' maxlength='100' />
+
+	<input class='button' type ='button' style='cursor:hand' size='30' value='".LAN_SIGNUP_27."' onclick='expandit(this)' />
+	<div style='display:none' >";
+	$avatarlist[0] = "";
+	$handle = opendir(e_IMAGE."avatars/");
+	while ($file = readdir($handle))
+	{
+		if ($file != "." && $file != ".." && $file != "CVS" && $file != "index.html")
+		{
+			$avatarlist[] = $file;
+		}
+	}
+	closedir($handle);
+
+	for($c = 1; $c <= (count($avatarlist)-1); $c++)
+	{
+		$text .= "<a href='javascript:insertext(\"$avatarlist[$c]\", \"avatar\")'><img src='".e_IMAGE."avatars/".$avatarlist[$c]."' style='border:0' alt='' /></a> ";
+	}
+
+	$text .= "<br />
+	</div><br />";
+
+	if ($pref['avatar_upload'] && FILE_UPLOADS)
+	{
+		$text .= "<br /><span class='smalltext'>".LAN_SIGNUP_25."</span> <input class='tbox' name='file_userfile[]' type='file' size='40' />
+		<br /><div class='smalltext'>".LAN_SIGNUP_34."</div>";
+	}
+
+	if ($pref['photo_upload'] && FILE_UPLOADS)
+	{
+		$text .= "<br /><span class='smalltext'>".LAN_SIGNUP_26."</span> <input class='tbox' name='file_userfile[]' type='file' size='40' />
+		<br /><div class='smalltext'>".LAN_SIGNUP_34."</div>";
+	}
+	return $text;
+}
+SC_END
+
+SC_BEGIN SIGNUP_TIMEZONE
+global $pref;
+if ($pref['signup_option_timezone'])
+{
+	$timezone = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "GMT", "+1", "+2", "+3", "+4", "+5", "+5.30", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13");
+	$timearea = array("International DateLine West", "Samoa", "Hawaii", "Alaska", "Pacific Time (US and Canada)", "Mountain Time (US and Canada)", "Central Time (US and Canada), Central America", "Eastern Time (US and Canada)", "Atlantic Time (Canada)", "Greenland, Brasilia, Buenos Aires, Georgetown", "Mid-Atlantic", "Azores", "GMT - UK, Ireland, Lisbon", "West Central Africa, Western Europe", "Greece, Egypt, parts of Africa", "Russia, Baghdad, Kuwait, Nairobi", "Abu Dhabi, Kabul", "Islamabad, Karachi", "Mumbai, Delhi, Calcutta", "Astana, Dhaka", "Bangkok, Rangoon", "Hong Kong, Singapore, Perth, Beijing", "Tokyo, Seoul", "Brisbane, Canberra, Sydney, Melbourne", "Soloman Islands", "New Zealand", "Nuku'alofa");
+	$text .= "
+	<select style='width:99%' name='timezone' class='tbox'>\n";
+
+	$count = 0;
+	while ($timezone[$count])
+	{
+		if ($timezone[$count] == $user_timezone)
+		{
+			$text .= "<option value='".$timezone[$count]."' selected>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
+		}
+		else
+		{
+			$text .= "<option value='".$timezone[$count]."'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
+		}
+		$count++;
+	}
+	$text .= "</select>";
+	return $text;
+}
+return "";
+SC_END
+
+
+SC_BEGIN SIGNUP_IMAGECODE
+global $signup_imagecode, $rs, $sec_img;
+if($signup_imagecode)
+{
+	return $rs->form_hidden("rand_num", $sec_img->random_number). $sec_img->r_image()."<br />".$rs->form_text("code_verify", 20, "", 20);
+}
+SC_END
+
+SC_BEGIN SIGNUP_FORM_CLOSE
+return "</form>";
+SC_END
+
+SC_BEGIN SIGNUP_XUP_LOGINNAME
+global $rs, $loginname;
+return $rs->form_text("loginnamexup", 30, $loginname, 30);
+SC_END
+
+SC_BEGIN SIGNUP_XUP_PASSWORD1
+global $rs, $password1;
+return $rs->form_password("password1xup", 30, $password1, 20);
+SC_END
+
+SC_BEGIN SIGNUP_XUP_PASSWORD2
+global $rs, $password1;
+return $rs->form_password("password2xup", 30, $password2, 20);
+SC_END
+
+*/
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/batch/usersettings_shortcodes.php 75/e107_files/shortcode/batch/usersettings_shortcodes.php
--- 6171/e107_files/shortcode/batch/usersettings_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/batch/usersettings_shortcodes.php	2006-05-15 22:11:13.000000000 -0500
@@ -0,0 +1,344 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/usersettings_shortcodes.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2006/05/16 03:11:13 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$usersettings_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+/*
+SC_BEGIN USERNAME
+global $rs, $curVal, $pref;
+if (check_class($pref['displayname_class']))
+{
+	return $rs->form_text("username", 20, $curVal['user_name'], $pref['displayname_maxlength'], "tbox");
+}
+else
+{
+	return $curVal['user_name'];
+}
+SC_END
+
+SC_BEGIN LOGINNAME
+global $rs, $curVal;
+if (ADMIN && getperms("4"))
+{
+	return $rs->form_text("loginname", 20, $curVal['user_loginname'], 100, "tbox");
+}
+else
+{
+	return $curVal['user_loginname'];
+}
+SC_END
+
+SC_BEGIN CUSTOMTITLE
+global $rs, $curVal, $pref;
+if ($pref['forum_user_customtitle'] || ADMIN)
+{
+	return $rs->form_text("customtitle", 40, $curVal['user_customtitle'], 100, "tbox");
+}
+SC_END
+
+SC_BEGIN REALNAME
+global $rs, $curVal;
+return $rs->form_text("realname", 20, $curVal['user_login'], 100, "tbox");
+SC_END
+
+SC_BEGIN PASSWORD1
+global $rs, $curVal;
+return $rs->form_password("password1", 40, "", 20);
+SC_END
+
+SC_BEGIN PASSWORD2
+global $rs, $curVal;
+return $rs->form_password("password2", 40, "", 20);
+SC_END
+
+SC_BEGIN PASSWORD_LEN
+global $pref;
+return $pref['signup_pass_len'];
+SC_END
+
+SC_BEGIN EMAIL
+global $rs, $curVal;
+return $rs->form_text("email", 40, $curVal['user_email'], 100);
+SC_END
+
+SC_BEGIN HIDEEMAIL
+global $rs, $curVal;
+if($parm == 'radio')
+{
+	return ($curVal['user_hideemail'] ? $rs->form_radio("hideemail", 1, 1)." ".LAN_416."&nbsp;&nbsp;".$rs->form_radio("hideemail", 0)." ".LAN_417 : $rs->form_radio("hideemail", 1)." ".LAN_416."&nbsp;&nbsp;".$rs->form_radio("hideemail", 0, 1)." ".LAN_417);
+}
+SC_END
+
+SC_BEGIN USERCLASSES
+global $sql, $pref, $tp, $curVal;
+$ret = "";
+if(ADMIN && $curVal['user_id'] != USERID)
+{
+	return "";
+}
+if($sql->db_Select("userclass_classes", "*", "userclass_editclass IN(".$tp -> toDB($curVal['userclass_list'], true).") ORDER BY userclass_name"))
+{
+	$ucList = $sql->db_getList();
+	$ret = "<table style='width:95%'>";
+	foreach($ucList as $row)
+	{
+		$inclass = check_class($row['userclass_id'], $curVal['user_class']) ? TRUE : FALSE;
+		if(isset($_POST['class']))
+		{
+			$inclass = in_array($row['userclass_id'], $_POST['class']);
+		}
+		$frm_checked = $inclass ? "checked='checked'" : "";
+		$ret .= "<tr><td class='defaulttext'>";
+		$ret .= "<input type='checkbox' name='class[]' value='{$row['userclass_id']}' $frm_checked />\n";
+		$ret .= $tp->toHTML($row['userclass_name'], "", "defs")."</td>";
+		$ret .= "<td class='smalltext'>".$tp->toHTML($row['userclass_description'], "", "defs")."</td>";
+		$ret .= "</tr>\n";
+	}
+	$ret .= "</table>\n";
+}
+return $ret;
+SC_END
+
+SC_BEGIN SIGNATURE
+global $curVal;
+parse_str($parm);
+$cols = (isset($cols) ? $cols : 58);
+$rows = (isset($rows) ? $rows : 4);
+return "<textarea class='tbox' name='signature' cols='{$cols}' rows='{$rows}' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$curVal['user_signature']."</textarea>";
+SC_END
+
+SC_BEGIN SIGNATURE_HELP
+return display_help("", 2);
+SC_END
+
+
+SC_BEGIN TIMEZONE
+global $curVal;
+$ret = "<select name='timezone' class='tbox'>\n";
+$timezone = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "GMT", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13");
+$timearea = array("International DateLine West", "Samoa", "Hawaii", "Alaska", "Pacific Time (US and Canada)", "Mountain Time (US and Canada)", "Central Time (US and Canada), Central America", "Eastern Time (US and Canada)", "Atlantic Time (Canada)", "Greenland, Brasilia, Buenos Aires, Georgetown", "Mid-Atlantic", "Azores", "GMT - UK, Ireland, Lisbon", "West Central Africa, Western Europe", "Greece, Egypt, parts of Africa", "Russia, Baghdad, Kuwait, Nairobi", "Abu Dhabi, Kabul", "Islamabad, Karachi", "Astana, Dhaka", "Bangkok, Rangoon", "Hong Kong, Singapore, Perth, Beijing", "Tokyo, Seoul", "Brisbane, Canberra, Sydney, Melbourne", "Soloman Islands", "New Zealand", "Nuku'alofa");
+$count = 0;
+while ($timezone[$count])
+{
+	if ($timezone[$count] == $curVal['user_timezone'])
+	{
+		$ret .= "<option value='".$timezone[$count]."' selected='selected'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
+	}
+	else
+	{
+		$ret .= "<option value='".$timezone[$count]."'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
+	}
+	$count++;
+}
+
+$ret .= "</select>";
+return $ret;
+SC_END
+
+SC_BEGIN AVATAR_UPLOAD
+global $pref;
+if ($pref['avatar_upload'] && FILE_UPLOADS)
+{
+		return "<input class='tbox' name='file_userfile[]' type='file' size='47' />";
+}
+SC_END
+
+SC_BEGIN AVATAR_REMOTE
+global $curVal;
+return "<input class='tbox' type='text' name='image' size='60' value='".$curVal['user_image']."' maxlength='100' />";
+SC_END
+
+SC_BEGIN AVATAR_CHOOSE
+$ret = "
+<input class='button' type ='button' style=' cursor:hand' size='30' value='".LAN_403."' onclick='expandit(this)' />
+<div style='display:none' >";
+$avatarlist[0] = "";
+$handle = opendir(e_IMAGE."avatars/");
+while ($file = readdir($handle))
+{
+	if ($file != "." && $file != ".." && $file != "index.html" && $file != "CVS")
+	{
+		$avatarlist[] = $file;
+	}
+}
+closedir($handle);
+
+for($c = 1; $c <= (count($avatarlist)-1); $c++)
+{
+	$ret .= "<a href='javascript:addtext_us(\"$avatarlist[$c]\")'><img src='".e_IMAGE."avatars/".$avatarlist[$c]."' style='border:0' alt='' /></a> ";
+}
+
+$ret .= "
+<br />
+</div>
+";
+return $ret;
+SC_END
+
+SC_BEGIN PHOTO_UPLOAD
+global $pref;
+if ($pref['photo_upload'] && FILE_UPLOADS)
+{
+		return "<input class='tbox' name='file_userfile[]' type='file' size='47' />";
+}
+SC_END
+
+SC_BEGIN XUP
+global $pref,$curVal;
+if(isset($pref['xup_enabled']) && $pref['xup_enabled'] == 1)
+{
+	return 	"<input class='tbox' type='text' name='user_xup' size='50' value='{$curVal['user_xup']}' maxlength='100' />";
+}
+SC_END
+
+
+SC_BEGIN USEREXTENDED_ALL
+global $sql, $tp, $curVal, $usersettings_shortcodes;
+$qry = "
+SELECT * FROM #user_extended_struct
+WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).")
+AND user_extended_struct_write IN (".$tp -> toDB($curVal['userclass_list'], true).")
+AND user_extended_struct_type = 0
+ORDER BY user_extended_struct_order ASC
+";
+$ret="";
+if($sql->db_Select_gen($qry))
+{
+	$catList = $sql->db_getList();
+}
+$catList[] = array("user_extended_struct_id" => 0, "user_extended_struct_name" => LAN_USET_7);
+foreach($catList as $cat)
+{
+	cachevars("extendedcat_{$cat['user_extended_struct_id']}", $cat);
+	$ret .= $tp->parseTemplate("{USEREXTENDED_CAT={$cat['user_extended_struct_id']}}", FALSE, $usersettings_shortcodes);
+}
+return $ret;
+SC_END
+
+SC_BEGIN USEREXTENDED_CAT
+global $sql, $tp, $curVal, $usersettings_shortcodes, $USER_EXTENDED_CAT, $extended_showed;
+if(isset($extended_showed['cat'][$parm]))
+{
+	return "";
+}
+$ret = "";
+$catInfo = getcachedvars("extendedcat_{$parm}");
+if(!$catInfo)
+{
+	$qry = "
+	SELECT * FROM #user_extended_struct
+	WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).")
+	AND user_extended_struct_write IN (".USERCLASS_LIST.")
+	AND user_extended_struct_id = ".intval($parm)."
+	";
+	if($sql->db_Select_gen($qry))
+	{
+		$catInfo = $sql->db_Fetch();
+	}
+}
+
+if($catInfo)
+{
+	$qry = "
+	SELECT * FROM #user_extended_struct
+	WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).")
+	AND user_extended_struct_write IN (".USERCLASS_LIST.")
+	AND user_extended_struct_parent = ".intval($parm)."
+	AND user_extended_struct_type != 0
+	ORDER BY user_extended_struct_order ASC
+	";
+	if($sql->db_Select_gen($qry))
+	{
+		$fieldList = $sql->db_getList();
+		foreach($fieldList as $field)
+		{
+			cachevars("extendedfield_{$cat['user_extended_struct_name']}", $field);
+			$ret .= $tp->parseTemplate("{USEREXTENDED_FIELD={$field['user_extended_struct_name']}}", FALSE, $usersettings_shortcodes);
+		}
+	}
+}
+
+if($ret)
+{
+	$ret = str_replace("{CATNAME}", $catInfo['user_extended_struct_name'], $USER_EXTENDED_CAT).$ret;
+}
+
+$extended_showed['cat'][$parm] = 1;
+return $ret;
+SC_END
+
+SC_BEGIN USEREXTENDED_FIELD
+global $sql, $tp, $curVal, $usersettings_shortcodes, $extended_showed, $ue, $USEREXTENDED_FIELD, $REQUIRED_FIELD;
+if(isset($extended_showed['field'][$parm]))
+{
+	return "";
+}
+$ret = "";
+
+$fInfo = getcachedvars("extendeddata_{$parm}");
+if(!$fInfo)
+{
+	$qry = "
+	SELECT * FROM #user_extended_struct
+	WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).")
+	AND user_extended_struct_write IN (".USERCLASS_LIST.")
+	AND user_extended_struct_name = '".$tp -> toDB($parm, true)."'
+	";
+	if($sql->db_Select_gen($qry))
+	{
+		$fInfo = $sql->db_Fetch();
+	}
+}
+
+if($fInfo)
+{
+	$fname = $tp->toHTML($fInfo['user_extended_struct_text'], "", "emotes_off defs");
+	if($fInfo['user_extended_struct_required'] == 1)
+	{
+		$fname = str_replace("{FIELDNAME}", $fname, $REQUIRED_FIELD);
+	}
+
+	$parms = explode("^,^",$fInfo['user_extended_struct_parms']);
+
+	$fhide="";
+	if($parms[3])
+	{
+		$chk = (strpos($curVal['user_hidden_fields'], "^user_".$parm."^") === FALSE) ? FALSE : TRUE;
+		if(isset($_POST['updatesettings']))
+		{
+			$chk = isset($_POST['hide']['user_'.$parm]);
+		}
+		$fhide = $ue->user_extended_hide($fInfo, $chk);
+	}
+
+	$uVal = str_replace(chr(1), "", $curVal['user_'.$parm]);
+	$fval = $ue->user_extended_edit($fInfo, $uVal);
+
+	$ret = $USEREXTENDED_FIELD;
+	$ret = str_replace("{FIELDNAME}", $fname, $ret);
+	$ret = str_replace("{FIELDVAL}", $fval, $ret);
+	$ret = str_replace("{HIDEFIELD}", $fhide, $ret);
+}
+
+$extended_showed['field'][$parm] = 1;
+return $ret;
+SC_END
+
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/batch/user_shortcodes.php 75/e107_files/shortcode/batch/user_shortcodes.php
--- 6171/e107_files/shortcode/batch/user_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/batch/user_shortcodes.php	2006-02-22 19:02:13.000000000 -0600
@@ -0,0 +1,472 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/batch/user_shortcodes.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2006/02/23 01:02:13 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$user_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+
+/*
+SC_BEGIN TOTAL_CHATPOSTS
+global $sql;
+if(!$chatposts = getcachedvars('total_chatposts'))
+{
+	$chatposts = $sql->db_Count("chatbox");
+	cachevars('total_chatposts', $chatposts);
+}
+return $chatposts;
+SC_END
+
+SC_BEGIN TOTAL_COMMENTPOSTS
+global $sql;
+if(!$commentposts = getcachedvars('total_commentposts'))
+{
+	$commentposts = $sql->db_Count("comments");
+	cachevars('total_commentposts', $commentposts);
+}
+return $commentposts;
+SC_END
+
+SC_BEGIN TOTAL_FORUMPOSTS
+global $sql;
+if(!$forumposts = getcachedvars('total_forumposts'))
+{
+	$forumposts = $sql->db_Count("forum_t");
+	cachevars('total_forumposts', $forumposts);
+}
+return $forumposts;
+SC_END
+
+SC_BEGIN USER_COMMENTPOSTS
+global $user;
+return $user['user_comments'];
+SC_END
+
+SC_BEGIN USER_FORUMPOSTS
+global $user;
+return $user['user_forums'];
+SC_END
+
+SC_BEGIN USER_CHATPOSTS
+global $user;
+return $user['user_chats'];
+SC_END
+
+SC_BEGIN USER_CHATPER
+global $sql, $user;
+if(!$chatposts = getcachedvars('total_chatposts'))
+{
+	$chatposts = $sql->db_Count("chatbox");
+	cachevars('total_chatposts', $chatposts);
+}
+return round(($user['user_chats']/$chatposts) * 100, 2);
+SC_END
+
+SC_BEGIN USER_COMMENTPER
+global $sql, $user;
+if(!$commentposts = getcachedvars('total_commentposts'))
+{
+	$commentposts = $sql->db_Count("comments");
+	cachevars('total_commentposts', $commentposts);
+}
+return round(($user['user_comments']/$commentposts) * 100, 2);
+SC_END
+
+SC_BEGIN USER_FORUMPER
+global $sql, $user;
+if(!$forumposts = getcachedvars('total_forumposts'))
+{
+	$forumposts = $sql->db_Count("forum_t");
+	cachevars('total_forumposts', $forumposts);
+}
+return round(($user['user_forums']/$forumposts) * 100, 2);
+SC_END
+
+SC_BEGIN USER_LEVEL
+global $user, $pref;
+require_once(e_HANDLER."level_handler.php");
+$ldata = get_level($user['user_id'], $user['user_forums'], $user['user_comments'], $user['user_chats'], $user['user_visits'], $user['user_join'], $user['user_admin'], $user['user_perms'], $pref);
+
+if (strstr($ldata[0], "IMAGE_rank_main_admin_image")) {
+	return LAN_417;
+}
+else if(strstr($ldata[0], "IMAGE")) {
+	return LAN_418;
+}
+else
+{
+	return $USER_LEVEL = $ldata[1];
+}
+SC_END
+
+SC_BEGIN USER_LASTVISIT
+global $user;
+$gen = new convert;
+return $user['user_currentvisit'] ? $gen->convert_date($user['user_currentvisit'], "long") : "<i>".LAN_401."</i>";
+SC_END
+
+SC_BEGIN USER_LASTVISIT_LAPSE
+global $user;
+$gen = new convert;
+return $user['user_currentvisit'] ? "( ".$gen -> computeLapse($user['user_currentvisit'])." ".LAN_426." )" : "<i>".LAN_401."</i>";
+SC_END
+
+SC_BEGIN USER_VISITS
+global $user;
+return $user['user_visits'];
+SC_END
+
+SC_BEGIN USER_JOIN
+global $user;
+$gen = new convert;
+return $gen->convert_date($user['user_join'], "forum");
+SC_END
+
+SC_BEGIN USER_DAYSREGGED
+global $user;
+$gen = new convert;
+return $gen -> computeLapse($user['user_join'])." ".LAN_426;
+SC_END
+
+SC_BEGIN USER_REALNAME_ICON
+if(defined("USER_REALNAME_ICON"))
+{
+	return USER_REALNAME_ICON;
+}
+if(file_exists(THEME."generic/user_realname.png"))
+{
+	return "<img src='".THEME_ABS."generic/user_realname.png' alt='' style='border:0px;vertical-align:middle;' /> ";
+}
+return "<img src='".e_IMAGE_ABS."user_icons/user_realname_".IMODE.".png' alt='' style='border:0px;vertical-align:middle;' /> ";
+SC_END
+
+SC_BEGIN USER_REALNAME
+global $user;
+return $user['user_login'] ? $user['user_login'] : "<i>".LAN_401."</i>";
+SC_END
+
+SC_BEGIN USER_EMAIL_ICON
+if(defined("USER_EMAIL_ICON"))
+{
+	return USER_EMAIL_ICON;
+}
+if(file_exists(THEME."generic/email.png"))
+{
+	return "<img src='".THEME_ABS."generic/email.png' alt='' style='vertical-align:middle;' /> ";
+}
+return "<img src='".e_IMAGE_ABS."generic/".IMODE."/email.png' alt='' style='vertical-align:middle;' /> ";
+SC_END
+
+SC_BEGIN USER_EMAIL_LINK
+global $user, $tp;
+return ($user['user_hideemail'] && !ADMIN) ? "<i>".LAN_143."</i>" : $tp->parseTemplate("{email={$user['user_email']}-link}");
+SC_END
+
+SC_BEGIN USER_EMAIL
+global $user,$tp;
+return ($user['user_hideemail'] && !ADMIN) ? "<i>".LAN_143."</i>" : $tp->toHTML($user['user_email'],"no_replace"); 
+SC_END
+
+SC_BEGIN USER_ICON
+if(defined("USER_ICON"))
+{
+	return USER_ICON;
+}
+if(file_exists(THEME."generic/user.png"))
+{
+	return "<img src='".THEME_ABS."generic/user.png' alt='' style='border:0px;vertical-align:middle;' /> ";
+}
+return "<img src='".e_IMAGE_ABS."user_icons/user_".IMODE.".png' alt='' style='border:0px;vertical-align:middle;' /> ";
+SC_END
+
+SC_BEGIN USER_ICON_LINK
+global $user;
+if(defined("USER_ICON"))
+{
+	$icon = USER_ICON;
+}
+else if(file_exists(THEME."generic/user.png"))
+{
+	$icon = "<img src='".THEME_ABS."generic/user.png' alt='' style='border:0px;vertical-align:middle;' /> ";
+}
+else
+{
+	$icon = "<img src='".e_IMAGE_ABS."user_icons/user_".IMODE.".png' alt='' style='border:0px;vertical-align:middle;' /> ";
+}
+return "<a href='".e_SELF."?id.{$user['user_id']}'>{$icon}</a>";
+SC_END
+
+SC_BEGIN USER_ID
+global $user;
+return $user['user_id'];
+SC_END
+
+SC_BEGIN USER_NAME
+global $user;
+return $user['user_name'];
+SC_END
+
+SC_BEGIN USER_NAME_LINK
+global $user;
+return "<a href='".e_SELF."?id.{$user['user_id']}'>".$user['user_name']."</a>";
+SC_END
+
+SC_BEGIN USER_LOGINNAME
+global $user;
+if(ADMIN && getperms("4")) {
+	return $user['user_loginname'];
+}
+SC_END
+
+SC_BEGIN USER_BIRTHDAY_ICON
+if(defined("USER_BIRTHDAY_ICON"))
+{
+	return USER_BIRTHDAY_ICON;
+}
+if(file_exists(THEME."generic/user_birthday.png"))
+{
+	return "<img src='".THEME_ABS."generic/user_birthday.png' alt='' style='vertical-align:middle;' /> ";
+}
+return "<img src='".e_IMAGE_ABS."user_icons/user_birthday_".IMODE.".png' alt='' style='vertical-align:middle;' /> ";
+SC_END
+
+SC_BEGIN USER_BIRTHDAY
+global $user;
+if ($user['user_birthday'] != "" && $user['user_birthday'] != "0000-00-00" && preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/", $user['user_birthday'], $regs))
+{
+	return "$regs[3].$regs[2].$regs[1]";
+}
+else
+{
+	return "<i>".LAN_401."</i>";
+}
+SC_END
+
+SC_BEGIN USER_SIGNATURE
+global $tp, $user;
+return $user['user_signature'] ? $tp->toHTML($user['user_signature'], TRUE) : "";
+SC_END
+
+SC_BEGIN USER_COMMENTS_LINK
+global $user;
+return $user['user_comments'] ? "<a href='".e_HTTP."userposts.php?0.comments.".$user['user_id']."'>".LAN_423."</a>" : "";
+SC_END
+
+SC_BEGIN USER_FORUM_LINK
+global $user;
+return $user['user_forums'] ? "<a href='".e_HTTP."userposts.php?0.forums.".$user['user_id']."'>".LAN_424."</a>" : "";
+SC_END
+
+SC_BEGIN USER_SENDPM
+global $tp, $user;
+return $tp->parseTemplate("{SENDPM={$user['user_id']}}");
+SC_END
+
+SC_BEGIN USER_RATING
+global $pref, $user;
+if($pref['profile_rate'] && USER)
+{
+	include_once(e_HANDLER."rate_class.php");
+	$rater = new rater;
+	$ret = "<span>";
+	if($rating = $rater->getrating('user', $user['user_id']))
+	{
+		$num = $rating[1];
+		for($i=1; $i<= $num; $i++)
+		{
+			$ret .= "<img src='".e_IMAGE_ABS."user_icons/user_star_".IMODE.".png' style='border:0' alt='' />";
+		}
+	}
+	if(!$rater->checkrated('user', $user['user_id']))
+	{
+		$ret .= " &nbsp; &nbsp;".$rater->rateselect('', 'user', $user['user_id']);
+	}
+	$ret .= "</span>";
+	return $ret;
+}
+return "";
+SC_END
+
+SC_BEGIN USER_UPDATE_LINK
+global $user;
+if (USERID == $user['user_id']) {
+	return "<a href='".e_HTTP."usersettings.php'>".LAN_411."</a>";
+}
+else if(ADMIN && getperms("4") && !$user['user_admin']) {
+	return "<a href='".e_HTTP."usersettings.php?".$user['user_id']."'>".LAN_412."</a>";
+}
+SC_END
+
+SC_BEGIN USER_JUMP_LINK
+global $sql, $user;
+if(!$userjump = getcachedvars('userjump'))
+{
+	$sql->db_Select("user", "user_id, user_name", "ORDER BY user_id ASC", "no-where");
+	$c = 0;
+	while ($row = $sql->db_Fetch())
+	{
+		$array[$c]['id'] = $row['user_id'];
+		$array[$c]['name'] = $row['user_name'];
+		if ($row['user_id'] == $user['user_id'])
+		{
+			$userjump['prev']['id'] = $array[$c-1]['id'];
+			$userjump['prev']['name'] = $array[$c-1]['name'];
+			$row = $sql->db_Fetch();
+			$userjump['next']['id'] = $row['user_id'];
+			$userjump['next']['name'] = $row['user_name'];
+			break;
+		}
+		$c++;
+	}
+	cachevars('userjump', $userjump);
+}
+if($parm == 'prev')
+{
+	return $userjump['prev']['id'] ? "&lt;&lt; ".LAN_414." [ <a href='".e_SELF."?id.".$userjump['prev']['id']."'>".$userjump['prev']['name']."</a> ]" : "&nbsp;";
+}
+else
+{
+	return $userjump['next']['id'] ? "[ <a href='".e_SELF."?id.".$userjump['next']['id']."'>".$userjump['next']['name']."</a> ] ".LAN_415." &gt;&gt;" : "&nbsp;";
+}
+SC_END
+
+SC_BEGIN USER_PICTURE
+global $user;
+if ($user['user_sess'] && file_exists(e_FILE."public/avatars/".$user['user_sess']))
+{
+	return "<img src='".e_FILE_ABS."public/avatars/".$user['user_sess']."' alt='' />";
+}
+else
+{
+	return LAN_408;
+}
+SC_END
+
+SC_BEGIN USER_PICTURE_NAME
+global $user;
+if (ADMIN && getperms("4"))
+{
+	return $user['user_sess'];
+}
+SC_END
+
+SC_BEGIN USER_PICTURE_DELETE
+if (USERID == $user['user_id'] || (ADMIN && getperms("4")))
+{
+	return "
+	<form method='post' action='".e_SELF."?".e_QUERY."'>
+	<input class='button' type='submit' name='delp' value='".LAN_413."' />
+	</form>
+	";
+}
+SC_END
+
+SC_BEGIN USER_EXTENDED_ALL
+global $user, $tp, $sql;
+global $EXTENDED_CATEGORY_START, $EXTENDED_CATEGORY_END, $EXTENDED_CATEGORY_TABLE;
+$qry = "
+	SELECT f.*, c.user_extended_struct_name AS category_name, c.user_extended_struct_id AS category_id FROM #user_extended_struct as f
+	LEFT JOIN #user_extended_struct as c ON f.user_extended_struct_parent = c.user_extended_struct_id
+	ORDER BY c.user_extended_struct_order ASC, f.user_extended_struct_order ASC
+";
+
+require_once(e_HANDLER."user_extended_class.php");
+$ue = new e107_user_extended;
+$ueCatList = $ue->user_extended_get_categories();
+$ueFieldList = $ue->user_extended_get_fields();
+$ueCatList[0][0] = array('user_extended_struct_name' => LAN_410);
+
+foreach($ueCatList as $catnum => $cat)
+{
+	$key = $cat[0]['user_extended_struct_name'];
+	$cat_name = $tp->parseTemplate("{EXTENDED={$key}.text.{$user['user_id']}}", TRUE);
+	if($cat_name != FALSE && count($ueFieldList[$catnum]))
+	{
+		$ret .= str_replace("{EXTENDED_NAME}", $key, $EXTENDED_CATEGORY_START);
+		foreach($ueFieldList[$catnum] as $f)
+		{
+			$key = $f['user_extended_struct_name'];
+			if($ue_name = $tp->parseTemplate("{EXTENDED={$key}.text.{$user['user_id']}}", TRUE))
+			{
+				$extended_record = str_replace("EXTENDED_ICON","EXTENDED={$key}.icon", $EXTENDED_CATEGORY_TABLE);
+			 	$extended_record = str_replace("{EXTENDED_NAME}", $tp->toHTML($ue_name,"","defs"), $extended_record);
+				$extended_record = str_replace("EXTENDED_VALUE","EXTENDED={$key}.value.{$user['user_id']}", $extended_record);
+				if(HIDE_EMPTY_FIELDS === TRUE)
+				{
+					$this_value = $tp->parseTemplate("{EXTENDED={$key}.value.{$user['user_id']}}", TRUE);
+					if($this_value != "")
+					{
+						$ret .= $tp->parseTemplate($extended_record, TRUE);
+					}
+				}
+				else
+				{
+					$ret .= $tp->parseTemplate($extended_record, TRUE);
+				}
+			}
+		}
+	}
+	$ret .= $EXTENDED_CATEGORY_END;
+}
+return $ret;
+SC_END
+
+SC_BEGIN PROFILE_COMMENTS
+global $user, $pref, $sql, $ns;
+if($pref['profile_comments'])
+{
+	include_once(e_HANDLER."comment_class.php");
+	$cobj = new comment;
+	$qry = "
+	SELECT c.*, u.*, ue.* FROM #comments AS c
+	LEFT JOIN #user AS u ON c.comment_author = u.user_id
+	LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
+	WHERE c.comment_item_id='".intval($user['user_id'])."'
+	AND c.comment_type='profile'
+	AND c.comment_pid='0'
+	ORDER BY c.comment_datestamp
+	";
+
+	if($comment_total = $sql->db_Select_gen($qry))
+	{
+		while($row = $sql->db_Fetch())
+		{
+			$ret .= $cobj->render_comment($row);
+		}
+	}
+	return $ns->tablerender(LAN_5, $ret, 'profile_comments', TRUE);
+}
+return "";
+SC_END
+
+SC_BEGIN PROFILE_COMMENT_FORM
+global $pref, $user;
+if($pref['profile_comments'])
+{
+	include_once(e_HANDLER."comment_class.php");
+	$cobj = new comment;
+	$ret = "";
+	if(ADMIN === TRUE)
+	{
+		$ret .= "<a href='".e_BASE.e_ADMIN."modcomment.php?profile.{$user['user_id']}'>".LAN_314."</a><br /><br />";
+	}
+	$ret .= $cobj->form_comment("comment", "profile", $user['user_id'], "", "", TRUE);
+	return $ret;
+}
+SC_END
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/breadcrumb.sc 75/e107_files/shortcode/breadcrumb.sc
--- 6171/e107_files/shortcode/breadcrumb.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/breadcrumb.sc	2005-12-28 20:12:23.000000000 -0600
@@ -0,0 +1,17 @@
+global $$parm;
+$bc = $$parm;
+$flist = explode(",", $bc['fieldlist']);
+$ret = "";
+foreach($flist as $f)
+{
+	if($bc[$f]['value'])
+	{
+		$ret .= $bc[$f]['value'];
+		if($bc[$f]['sep'])
+		{
+			$ret .= $bc[$f]['sep'];
+		}
+	}
+}
+
+return $ret;
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/custom.sc 75/e107_files/shortcode/custom.sc
--- 6171/e107_files/shortcode/custom.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/custom.sc	2006-04-24 18:46:36.000000000 -0500
@@ -0,0 +1,91 @@
+global $tp;
+$ret = "";
+$custom_query = explode('+', $parm);
+switch($custom_query[0])
+{
+		case "login":
+		case "login noprofile":
+				@include_once(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php");
+				@include_once(e_PLUGIN."login_menu/languages/English.php");
+
+				if (USER == TRUE){
+						$ret .= "<span class='mediumtext'>".LOGIN_MENU_L5." ".USERNAME."&nbsp;&nbsp;&nbsp;.:. ";
+						if(ADMIN == TRUE){
+								$ret .= "<a href='".e_ADMIN."admin.php'>".LOGIN_MENU_L11."</a> .:. ";
+						}
+						$ret .= ($custom_query[0] != "login noprofile") ? "<a href='".e_BASE."user.php?id.".USERID."'>".LOGIN_MENU_L13."</a>\n.:. ":"";
+						$ret .= "<a href='" . e_BASE . "usersettings.php'>".LOGIN_MENU_L12."</a> .:. <a href='".e_BASE."?logout'>".LOGIN_MENU_L8."</a> .:.</span>";
+				} else {
+						$ret .= "<form method='post' action='".e_SELF."'>\n<div class='loginc_div'>\n".LOGIN_MENU_L1."<input class='tbox loginc user' type='text' name='username' size='15' value='$username' maxlength='20' />&nbsp;&nbsp;\n".LOGIN_MENU_L2."<input class='tbox loginc pass' type='password' name='userpass' size='15' value='' maxlength='20' />&nbsp;&nbsp;\n<input type='checkbox' name='autologin' value='1' />".LOGIN_MENU_L6."&nbsp;&nbsp;\n<input class='button loginc' type='submit' name='userlogin' value='Login' />";
+						if($pref['user_reg'])
+						{
+							$ret .= "&nbsp;&nbsp;<a href='".e_SIGNUP."'>".LOGIN_MENU_L3."</a>";
+						}
+						$ret .= "</div>\n</form>";
+				}
+				return $ret;
+				break;
+
+		case "search":
+				if(!USER && $pref['search_restrict'] == 1)
+				{
+						return "";
+				}
+				$searchflat = TRUE;
+				include_once(e_PLUGIN."search_menu/search_menu.php");
+				return "";
+				break;
+
+		case "quote":
+				$qotd_file = e_BASE."quote.txt";
+				if(!file_exists($qotd_file))
+				{
+						$quote = "Quote file not found ($qotd_file)";
+				}
+				else
+				{
+						$quotes = file(e_BASE."quote.txt");
+						$quote = $tp->toHTML($quotes[rand(0, count($quotes) -1 )], TRUE);
+				}
+				return $quote;
+				break;
+
+		case "language":
+
+				require_once(e_HANDLER."file_class.php");
+				$fl = new e_file;
+				$reject = array('.','..','/','CVS','thumbs.db','*._$');
+				$lanlist = $fl->get_dirs(e_LANGUAGEDIR);
+				sort($lanlist);
+				$action = (e_QUERY && !$_GET['elan']) ? e_SELF."?".e_QUERY : e_SELF;
+				$lantext = "<form method='post' action='".$action."' id='langchange'>
+				<div><select name='sitelanguage' class='tbox' onchange=\"document.getElementById('langchange').submit()\">\n";
+
+				foreach($lanlist as $langval) {
+						$langname = $langval;
+						$langval = ($langval == $pref['sitelanguage']) ? "" : $langval;
+						$selected = ($langval == USERLAN) ? "selected='selected'" : "";
+						$lantext .= "<option value='".$langval."' $selected>".$langname."</option>\n ";
+				}
+
+				$lantext .= "</select>\n";
+				$lantext .= "<input type='hidden' name='setlanguage' value='1' />";
+				$lantext .= "</div></form>";
+				return $lantext;
+				break;
+
+
+
+		case "clock":
+				$clock_flat = TRUE;
+				include_once(e_PLUGIN."clock_menu/clock_menu.php");
+				return "";
+				break;
+
+
+
+		case "welcomemessage":
+
+				return $tp->parseTemplate("{WMESSAGE}");
+				break;
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/e_image.sc 75/e107_files/shortcode/e_image.sc
--- 6171/e107_files/shortcode/e_image.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/e_image.sc	2005-04-30 10:12:12.000000000 -0500
@@ -0,0 +1,2 @@
+global $IMAGES_DIRECTORY;
+return $IMAGES_DIRECTORY;
diff -ruN 6171/e107_files/shortcode/email_item.sc 75/e107_files/shortcode/email_item.sc
--- 6171/e107_files/shortcode/email_item.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/email_item.sc	2005-03-30 09:49:52.000000000 -0600
@@ -0,0 +1,11 @@
+if (defined("ICONMAIL") && file_exists(THEME."images/".ICONMAIL)) 
+{
+	$icon = THEME."images/".ICONMAIL;
+}
+else
+{
+	$icon = e_IMAGE."generic/".IMODE."/email.png";
+}
+$parms = explode("^",$parm);
+// message^source^other_parms
+return "<a href='".e_BASE."email.php?{$parms[1]}'><img src='".$icon."' style='border:0' alt='{$parms[0]}' title='{$parms[0]}'/></a>";
diff -ruN 6171/e107_files/shortcode/email.sc 75/e107_files/shortcode/email.sc
--- 6171/e107_files/shortcode/email.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/email.sc	2005-07-05 12:12:00.000000000 -0500
@@ -0,0 +1,15 @@
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_user.php");
+@include_once(e_LANGUAGEDIR."English/lan_user.php");
+global $tp;
+if (substr($parm, -5) == '-link')
+{
+	$parm = substr($parm, 0, -5);
+	return ($user_hideemail && !ADMIN) ? "<i>".LAN_143."</i>" : $tp->toHTML($parm);
+}
+else
+{
+	return ($user_hideemail && !ADMIN) ? "<i>".LAN_143."</i>" : $parm;
+}
+
+
+
diff -ruN 6171/e107_files/shortcode/emailto.sc 75/e107_files/shortcode/emailto.sc
--- 6171/e107_files/shortcode/emailto.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/emailto.sc	2006-03-16 07:07:55.000000000 -0600
@@ -0,0 +1,17 @@
+global $pref;
+
+if (!USER)
+{
+	return "";
+}
+
+$image = IMAGE_email;
+
+if(is_numeric($parm))
+{
+	return "<a href='".e_BASE."emailmember.php?id.{$parm}'>{$image}</a>";
+}
+else
+{
+	return "<a href='mailto:{$parm}'>{$image}</a>";
+}
diff -ruN 6171/e107_files/shortcode/extended_icon.sc 75/e107_files/shortcode/extended_icon.sc
--- 6171/e107_files/shortcode/extended_icon.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/extended_icon.sc	2005-09-04 22:00:57.000000000 -0500
@@ -0,0 +1,5 @@
+//USAGE:  {EXTENDED_ICON=<field_name>.<user_id>}
+//EXAMPLE: {EXTENDED_ICON=user_gender.5}  will show the icon of the extended field user_gender for user #5
+$parms = explode(".", $parm);
+global $tp;
+return $tp->parseTemplate("{EXTENDED={$parms[0]}.icon.{$parms[1]}}");
diff -ruN 6171/e107_files/shortcode/extended.sc 75/e107_files/shortcode/extended.sc
--- 6171/e107_files/shortcode/extended.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/extended.sc	2006-01-14 18:13:05.000000000 -0600
@@ -0,0 +1,106 @@
+//USAGE:  {EXTENDED=<field_name>.[text|value|icon].<user_id>}
+//EXAMPLE: {EXTENDED=user_gender.value.5}  will show the value of the extended field user_gender for user #5
+include(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_extended.php");
+$parms = explode(".", $parm);
+global $currentUser, $sql, $tp, $loop_uid, $e107;
+if(isset($loop_uid) && intval($loop_uid) == 0) { return ""; }
+$ueStruct = getcachedvars("user_extended_struct");
+if(!$ueStruct)
+{
+	require_once(e_HANDLER."user_extended_class.php");
+	$ueStruct = e107_user_extended::user_extended_getStruct();
+	cachevars("user_extended_struct", $ueStruct);
+}
+
+$uid = intval($parms[2]);
+if($uid == 0)
+{
+	if(isset($loop_uid) && intval($loop_uid) > 0)
+	{
+		$uid = $loop_uid;
+	}
+	else
+	{
+		$uid = USERID;
+	}
+}
+
+$udata = get_user_data($uid);
+
+$udata['user_class'] .= ($udata['user_class'] == "" ? "" : ",");
+$udata['user_class'] .= e_UC_PUBLIC.",".e_UC_MEMBER;
+if($udata['user_admin'] == 1)
+{
+	$udata['user_class'].= ",".e_UC_ADMIN;
+}
+
+if (
+!check_class($ueStruct["user_".$parms[0]]['user_extended_struct_applicable'], $udata['user_class'])
+|| !check_class($ueStruct["user_".$parms[0]]['user_extended_struct_read'])
+|| ($ueStruct["user_".$parms[0]]['user_extended_struct_read'] == e_UC_READONLY && (!ADMIN && $udata['user_id'] != USERID))
+|| (!ADMIN && substr($ueStruct["user_".$parms[0]]['user_extended_struct_parms'], -1) == 1 
+&& strpos($udata['user_hidden_fields'], "^user_".$parms[0]."^") !== FALSE && $uid != USERID)
+)
+{
+	return FALSE;
+}
+
+if ($parms[1] == 'text')
+{
+	$text_val = $ueStruct["user_".$parms[0]]['user_extended_struct_text'];
+	if($text_val)
+	{
+		return (defined($text_val) ? constant($text_val) : $text_val);
+	}
+	else
+	{
+		return TRUE;
+	}
+}
+
+if ($parms[1] == 'icon')
+{
+	if(defined(strtoupper($parms[0])."_ICON"))
+	{
+		return constant(strtoupper($parms[0])."_ICON");
+	}
+	elseif(file_exists(e_IMAGE."user_icons/{$parms[0]}.png"))
+	{
+		return "<img src='".e_IMAGE."user_icons/{$parms[0]}.png' style='width:16px; height:16px' alt='' />";
+	}
+	return "";
+}
+
+if ($parms[1] == 'value')
+{
+	$uVal = str_replace(chr(1), "", $udata['user_'.$parms[0]]);
+	// check for db_lookup type
+	if($ueStruct["user_".$parms[0]]['user_extended_struct_type'] == '4')
+	{
+		$tmp = explode(",",$ueStruct["user_".$parms[0]]['user_extended_struct_values']);
+		if($sql->db_Select($tmp[0],"{$tmp[1]}, {$tmp[2]}","{$tmp[1]} = '{$uVal}'"))
+		{
+			$row = $sql->db_Fetch();
+			$ret_data = $row[$tmp[2]];
+		}
+		else
+		{
+			$ret_data = FALSE;
+		}
+	}
+	else
+	{
+		//check for 0000-00-00 in date field
+		if($ueStruct["user_".$parms[0]]['user_extended_struct_type'] == '7')
+		{
+			if($uVal == "0000-00-00") { $uVal = ""; }
+		}
+		$ret_data = $uVal;
+	}
+	if($ret_data != "")
+	{
+		return $tp->toHTML($ret_data, TRUE, "no_make_clickable", "class:{$udata['user_class']}");
+	}
+	return FALSE;
+}
+return TRUE;
diff -ruN 6171/e107_files/shortcode/extended_text.sc 75/e107_files/shortcode/extended_text.sc
--- 6171/e107_files/shortcode/extended_text.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/extended_text.sc	2005-09-04 22:02:07.000000000 -0500
@@ -0,0 +1,5 @@
+//USAGE:  {EXTENDED_TEXT=<field_name>.<user_id>}
+//EXAMPLE: {EXTENDED_TEXT=user_gender.5}  will show the text of the extended field user_gender for user #5
+$parms = explode(".", $parm);
+global $tp;
+return $tp->parseTemplate("{EXTENDED={$parms[0]}.text.{$parms[1]}}");
diff -ruN 6171/e107_files/shortcode/extended_value.sc 75/e107_files/shortcode/extended_value.sc
--- 6171/e107_files/shortcode/extended_value.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/extended_value.sc	2005-09-04 21:51:59.000000000 -0500
@@ -0,0 +1,5 @@
+//USAGE:  {EXTENDED_VALUE=<field_name>.<user_id>}
+//EXAMPLE: {EXTENDED_VALUE=user_gender.5}  will show the value of the extended field user_gender for user #5
+$parms = explode(".", $parm);
+global $tp;
+return $tp->parseTemplate("{EXTENDED={$parms[0]}.value.{$parms[1]}}");
diff -ruN 6171/e107_files/shortcode/imageselector.sc 75/e107_files/shortcode/imageselector.sc
--- 6171/e107_files/shortcode/imageselector.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/imageselector.sc	2006-05-05 22:25:40.000000000 -0500
@@ -0,0 +1,40 @@
+// $Id: imageselector.sc,v 1.2 2006/05/06 03:25:40 e107coders Exp $
+
+global $sql,$parm;
+
+	if(strstr($parm,"=")){  // query style parms.
+    	 parse_str($parm, $tmp);
+		 extract($tmp);
+	}else{        // comma separated parms.
+    	list($name,$path,$default,$width,$height,$multiple,$label) = explode(",",$parm);
+    }
+
+
+	require_once(e_HANDLER."file_class.php");
+	$fl = new e_file;
+
+  //	$paths = explode("|",$path);
+
+	if($imagelist = $fl->get_files($path,".jpg|.gif|.png")){
+		sort($imagelist);
+	}
+
+    $multi = ($multiple == "TRUE" || $multiple == "1") ? "multiple='multiple' style='height:{$height}'" : "style='float:left'";
+    $width = ($width) ? $width : "*";
+    $height = ($height) ? $height : "*";
+    $label = ($label) ? $label : " -- -- ";
+
+	$text .= "<select {$multi} class='tbox' name='$name' id='$name' onchange=\"preview_image('$name','$path');\">
+	<option value=''>".$label."</option>\n";
+	foreach($imagelist as $icon)
+	{
+		$selected = ($default == $icon['fname']) ? " selected='selected'" : "";
+		$text .= "<option value='".$icon['fname']."'".$selected.">".$icon['fname']."</option>\n";
+	}
+	$text .= "</select>";
+
+	$pvw_default = ($default) ? $path.$default : e_IMAGE."generic/blank.gif";
+  	$text .= "&nbsp;<img id='{$name}_prev' src='{$pvw_default}' alt='' style='width:{$width};height:{$height}' />\n";
+
+
+ return "\n\n<!-- Start Image Selector -->\n\n".$text."\n\n<!-- End Image Selector -->\n\n";
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/linkstyle.sc 75/e107_files/shortcode/linkstyle.sc
--- 6171/e107_files/shortcode/linkstyle.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/linkstyle.sc	2005-03-27 01:56:17.000000000 -0600
@@ -0,0 +1,2 @@
+global $linkstyle;
+$linkstyle = $parm;
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/logo.sc 75/e107_files/shortcode/logo.sc
--- 6171/e107_files/shortcode/logo.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/logo.sc	2006-04-27 13:49:14.000000000 -0500
@@ -0,0 +1,33 @@
+parse_str($parm);
+
+if (isset($file) && $file && is_readable($file))
+{
+	$logo = $file;
+	$path = $file;
+}
+else if (is_readable(THEME."images/e_logo.png"))
+{
+	$logo = THEME_ABS."images/e_logo.png";
+	$path = THEME."images/e_logo.png";
+}
+else
+{
+	$logo = e_IMAGE."logo.png";
+	$path = $logo;
+}
+
+$dimensions = getimagesize($path);
+
+$image = "<img class='logo' src='".$logo."' style='width: ".$dimensions[0]."px; height: ".$dimensions[1]."px' alt='".SITENAME."' />\n";
+
+if (isset($link) && $link) {
+	if ($link == 'index') {
+		$image = "<a href='".e_BASE."index.php'>".$image."</a>";
+	}
+	else
+	{
+		$image = "<a href='".$link."'>".$image."</a>";
+	}
+}
+
+return $image;
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/menu.sc 75/e107_files/shortcode/menu.sc
--- 6171/e107_files/shortcode/menu.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/menu.sc	2006-05-04 12:01:27.000000000 -0500
@@ -0,0 +1,112 @@
+global $sql;
+global $ns;
+global $eMenuList;
+global $error_handler;
+$tmp = explode(":",$parm);
+
+if (!array_key_exists($tmp[0],$eMenuList)) {
+	return;
+}
+
+if (isset($tmp[1]) && $tmp[1] == 'ret') {
+	ob_start();
+}
+
+foreach($eMenuList[$tmp[0]] as $row)
+{
+	$show_menu = TRUE;
+	if($row['menu_pages']) {
+		list($listtype,$listpages) = explode("-",$row['menu_pages']);
+		$pagelist = explode("|",$listpages);
+		$check_url = e_SELF."?".e_QUERY;
+
+		if($listtype == '1')  //show menu
+		{
+			$show_menu = FALSE;
+			foreach($pagelist as $p)
+			{
+				if(substr($p, -1) == '!')
+				{
+					$p = substr($p, 0, -1);
+					if(substr($check_url, strlen($p)*-1) == $p)
+					{
+						$show_menu = TRUE;
+					}
+				}
+				else 
+				{
+					if(strpos($check_url,$p) !== FALSE)
+					{
+						$show_menu = TRUE;
+					}
+				}
+			}
+		}
+		elseif($listtype == '2') //hide menu
+		{
+			$show_menu = TRUE;
+			foreach($pagelist as $p) {
+				if(substr($p, -1) == '!')
+				{
+					$p = substr($p, 0, -1);
+					if(substr($check_url, strlen($p)*-1) == $p)
+					{
+						$show_menu = FALSE;
+					}
+				}
+				else 
+				{
+					if(strpos($check_url, $p) !== FALSE)
+					{
+						$show_menu = FALSE;
+					}
+				}
+			}
+		}
+	}
+	if($show_menu) {
+		$mname = $row['menu_name'];
+		if($error_handler->debug == true) {
+			echo "\n<!-- Menu Start: ".$mname." -->\n";
+		}
+		$sql->db_Mark_Time($row['menu_name']);
+		if(is_numeric($row['menu_path']))
+		{
+			global $tp;
+			$sql -> db_Select("page", "*", "page_id='".$row['menu_path']."' ");
+			$page  = $sql -> db_Fetch();
+			$caption = $tp -> toHTML($page['page_title'], TRUE, 'parse_sc, constants');
+			$text = $tp -> toHTML($page['page_text'], TRUE, 'parse_sc, constants');
+			$ns -> tablerender($caption, $text);
+		}
+		else
+		{
+			if(is_readable(e_LANGUAGEDIR.e_LANGUAGE."/plugins/lan_{$row['menu_path']}.php")) {
+				include_once(e_LANGUAGEDIR.e_LANGUAGE."/plugins/lan_{$row['menu_path']}.php");
+			} elseif (is_readable(e_PLUGIN.$row['menu_path']."/languages/".e_LANGUAGE.".php")) {
+				include_once(e_PLUGIN.$row['menu_path']."/languages/".e_LANGUAGE.".php");	
+			} elseif (is_readable(e_PLUGIN.$row['menu_path']."/languages/".e_LANGUAGE."/".e_LANGUAGE.".php")) {
+				include_once(e_PLUGIN.$row['menu_path']."/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");	
+			} elseif (is_readable(e_LANGUAGEDIR."english/plugins/lan_{$row['menu_path']}.php")) {
+				include_once(e_LANGUAGEDIR."English/plugins/lan_{$row['menu_path']}.php");
+			} elseif (is_readable(e_PLUGIN.$row['menu_path']."/languages/English.php")) {
+				include_once(e_PLUGIN.$row['menu_path']."/languages/English.php");
+			} 
+			
+			if(file_exists(e_PLUGIN.$row['menu_path']."/".$mname.".php"))
+			{
+				include_once(e_PLUGIN.$row['menu_path']."/".$mname.".php");
+			}
+		}
+		$sql->db_Mark_Time("(After ".$mname.")");
+		if ($error_handler->debug == true) {
+			echo "\n<!-- Menu Start: ".$mname." -->\n";			
+		}
+	}
+}
+
+if (isset($tmp[1]) && $tmp[1] == 'ret') {
+	$ret = ob_get_contents();
+	ob_end_clean();
+	return $ret;
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/news_alt.sc 75/e107_files/shortcode/news_alt.sc
--- 6171/e107_files/shortcode/news_alt.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/news_alt.sc	2005-02-08 16:03:27.000000000 -0600
@@ -0,0 +1,3 @@
+require_once(e_PLUGIN."alt_news/alt_news.php");
+alt_news($parm);
+return "";
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/news_categories.sc 75/e107_files/shortcode/news_categories.sc
--- 6171/e107_files/shortcode/news_categories.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/news_categories.sc	2006-05-13 17:06:01.000000000 -0500
@@ -0,0 +1,124 @@
+global $sql,$pref,$tp,$NEWSCAT,$NEWSCAT_ITEM;
+require_once(e_HANDLER."news_class.php");
+$ix = new news;
+
+$nbr_cols = (isset($pref['nbr_cols'])) ? $pref['nbr_cols'] : 1;
+$nbr_cols = (defined("NEWSCAT_COLS")) ? NEWSCAT_COLS : $nbr_cols;
+
+	if(!defined("NEWSCAT_AMOUNT")){
+		define("NEWSCAT_AMOUNT",3);
+	}
+
+	if(!$NEWSCAT){
+		$NEWSCAT = "
+			<div style='padding:5px'><div style='border-bottom:1px inset black; padding-bottom:1px;margin-bottom:5px'>
+			{NEWSCATICON}&nbsp;{NEWSCATEGORY}
+			</div>
+			{NEWSCAT_ITEM}
+			</div>
+			";
+	}
+
+	if(!$NEWSCAT_ITEM){
+		$NEWSCAT_ITEM = "
+		<div style='width:100%;padding-bottom:2px'>
+		<table style='width:100%' cellpadding='0' cellspacing='0' border='0'>
+		<tr>
+		<td style='width:2px;vertical-align:top'>&#8226;
+		</td>
+		<td style='text-align:left;vertical-align:top;padding-left:3px'>
+		{NEWSTITLELINK}
+		<br />
+		</td></tr>
+		</table>
+		</div>
+		";
+	}
+
+
+	if(!defined("NEWSCAT_CATLINK")){
+			define("NEWSCAT_CATLINK","");
+	}
+	if(!defined("NEWSCAT_ITEMLINK")){
+			define("NEWSCAT_ITEMLINK","");
+	}
+	if(!defined("NEWSCAT_STYLE")){
+			define("NEWSCAT_STYLE","width:96%");
+	}
+	if(!defined("NEWSCAT_CATICON")){
+			define("NEWSCAT_CATICON","border:0px");
+	}
+	if(!defined("NEWSCAT_THUMB")){
+			define("NEWSCAT_THUMB","border:0px");
+	}
+
+	if(!defined("NEWSCAT_CELL")){
+			define("NEWSCAT_CELL","vertical-align:top");
+	}
+
+
+
+	$param['itemlink'] = NEWSCAT_ITEMLINK;
+	$param['thumbnail'] = NEWSCAT_THUMB;
+	$param['catlink'] = NEWSCAT_CATLINK;
+	$param['caticon'] = NEWSCAT_CATICON;
+
+	$sql2 = new db;
+	$sql2->db_Select("news_category", "*", "category_id!='' ORDER BY category_name ASC");
+
+	$text3 = "\n\n\n
+	<div style='width:100%;text-align:center;margin-left:auto;margin-right:auto'>
+	<table style='".NEWSCAT_STYLE."'  cellpadding='0' cellspacing='0'>
+	\n";
+	$t = 0;
+			$wid = floor(100/$nbr_cols);
+	while ($row3 = $sql2->db_Fetch()) {
+		extract($row3);
+
+		$search[0] = "/\{NEWSCATICON\}(.*?)/si";
+		$replace[0] = ($category_icon) ? "<a href='".e_BASE."news.php?cat.".$category_id."'><img src='".e_IMAGE."icons/".$category_icon."' alt='' style='".$param['caticon']."' /></a>" : "";
+
+		$search[1] = "/\{NEWSCATEGORY\}(.*?)/si";
+		$replace[1] = ($category_name) ? "<a href='".e_BASE."news.php?cat.".$category_id."' style='".$param['catlink']."' >".$tp->toHTML($category_name)."</a>" : "";
+
+		$text3 .= ($t % $nbr_cols == 0) ? "<tr>" : "";
+		$text3 .= "\n<td style='".NEWSCAT_CELL."; width:$wid%;'>\n";
+
+// Grab each news item.--------------
+
+		$count = $sql->db_Select("news", "*", "news_category='".intval($category_id)."' AND news_class IN (".USERCLASS_LIST.") AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().")  ORDER BY news_datestamp DESC LIMIT 0,".NEWSCAT_AMOUNT);
+		while ($row = $sql->db_Fetch()) {
+
+			$row['category_name'] = $category_name;
+			$row['category_icon'] = $category_icon;
+
+			$textbody .= $ix -> render_newsitem($row, 'return', '', $NEWSCAT_ITEM, $param);
+
+		}
+// ----------------------------------
+
+		$search[2] = "/\{NEWSCAT_ITEM\}(.*?)/si";
+		$replace[2] = $textbody;
+
+		$text3 .= preg_replace($search, $replace,$NEWSCAT);
+		unset($textbody);
+
+
+		$text3 .= "\n</td>\n";
+		if (($t+1) % $nbr_cols == 0) {
+			$text3 .= "</tr>";
+			$t++;
+		} else {
+			$t++;
+		}
+	}
+
+	while ($t % $nbr_cols != 0){
+		$text3 .= "<td style='".NEWSCAT_CELL.";width:{$wid}%'>&nbsp;</td>\n";
+		$text3 .= (($t+1) % nbr_cols == 0) ? "</tr>" : "";
+		$t++;
+	}
+
+	$text3 .= "</table></div>";
+
+return $text3;
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/news_category.sc 75/e107_files/shortcode/news_category.sc
--- 6171/e107_files/shortcode/news_category.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/news_category.sc	2004-09-25 23:09:25.000000000 -0500
@@ -0,0 +1,3 @@
+require_once(e_PLUGIN."alt_news/alt_news.php");
+alt_news($parm);
+return "";
diff -ruN 6171/e107_files/shortcode/newsfile.sc 75/e107_files/shortcode/newsfile.sc
--- 6171/e107_files/shortcode/newsfile.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/newsfile.sc	2005-03-30 09:46:23.000000000 -0600
@@ -0,0 +1,5 @@
+
+
+$image = (file_exists(THEME."generic/download.png") ? THEME."generic/download.png" : e_IMAGE."generic/".IMODE."/download.png");
+return "<img src='$image' alt='' style='vertical-align: middle;' /> <a href='".e_FILE."downloads/".$parm."'>".$parm."</a>";
+
diff -ruN 6171/e107_files/shortcode/newsimage.sc 75/e107_files/shortcode/newsimage.sc
--- 6171/e107_files/shortcode/newsimage.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/newsimage.sc	2005-03-11 02:51:02.000000000 -0600
@@ -0,0 +1,4 @@
+
+
+return "<img src='".e_IMAGE."newspost_images/".$parm."' alt='' />";
+
diff -ruN 6171/e107_files/shortcode/nextprev.sc 75/e107_files/shortcode/nextprev.sc
--- 6171/e107_files/shortcode/nextprev.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/nextprev.sc	2006-04-27 13:37:54.000000000 -0500
@@ -0,0 +1,186 @@
+
+global $pref;
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_np.php");
+@include_once(e_LANGUAGEDIR."English/lan_np.php");
+
+list($total_items, $perpage, $current_start, $url, $caption) = explode(",", $parm, 5);
+
+if($total_items < $perpage){
+	return "";
+}
+
+$caption = (!$caption && $caption != "off") ? NP_3."&nbsp;" : $caption;
+if($caption == "off"){
+ $caption = "";
+}
+while(substr($url, -1) == ".")
+{
+	$url=substr($url, 0, -1);
+}
+
+$current_page = ($current_start/$perpage) + 1;
+$total_pages = ceil($total_items/$perpage);
+
+if($total_pages > 1)
+{
+	if(isset($pref['old_np']) && $pref['old_np'])
+	{
+
+		$NP_PRE_ACTIVE = "";
+		$NP_POST_ACTIVE = "";
+		$NP_STYLE = "";
+
+        if(!defined("NEXTPREV_NOSTYLE") || NEXTPREV_NOSTYLE==FALSE){
+        	$NP_PRE_ACTIVE = "[";
+            $NP_POST_ACTIVE = "] ";
+			$NP_STYLE = "style='text-decoration:underline'";
+		}
+
+
+		//	Use OLD nextprev metod
+		$nppage = '';
+		$nppage .= "\n\n<!-- Start of Next/Prev -->\n\n";
+		if ($total_pages > 10)
+		{
+			$current_page = ($current_start/$perpage)+1;
+
+			for($c = 0; $c <= 2; $c++)
+			{
+				if($perpage * $c == $current_start)
+				{
+					$nppage .= $NP_PRE_ACTIVE."<span class='nextprev_current' {$NP_STYLE} >".($c+1)."</span>".$NP_POST_ACTIVE."\n";
+				}
+				else
+				{
+					$link = str_replace("[FROM]", ($perpage * $c), $url);
+					$nppage .= "<a class='nextprev_link' href='{$link}'>".($c+1)."</a> \n";
+
+				}
+			}
+
+			if ($current_page >= 3 && $current_page <= 5)
+			{
+				for($c = 3; $c <= $current_page; $c++)
+				{
+					if($perpage * $c == $current_start)
+					{
+						$nppage .= $NP_PRE_ACTIVE."<span class='nextprev_current' {$NP_STYLE} >".($c+1)."</span>".$NP_POST_ACTIVE."\n";
+					}
+					else
+					{
+						$link = str_replace("[FROM]", ($perpage * $c), $url);
+						$nppage .= "<a class='nextprev_link' href='{$link}'>".($c+1)."</a> \n";
+					}
+				}
+			}
+			else if($current_page >= 6 && $current_page <= ($total_pages-5))
+			{
+				$nppage .= " ... ";
+				for($c = ($current_page-2); $c <= $current_page; $c++)
+				{
+					if($perpage * $c == $current_start)
+					{
+						$nppage .= $NP_PRE_ACTIVE."<span class='nextprev_current' {$NP_STYLE} >".($c+1)."</span>".$NP_POST_ACTIVE."\n";
+					}
+					else
+					{
+						$link = str_replace("[FROM]", ($perpage * $c), $url);
+						$nppage .= "<a class='nextprev_link' href='{$link}'>".($c+1)."</a> \n";
+					}
+				}
+			}
+			$nppage .= " ... ";
+
+			if (($current_page+5) > $total_pages && $current_page != $total_pages)
+			{
+				$tmp = ($current_page-2);
+			}
+			else
+			{
+				$tmp = $total_pages-3;
+			}
+
+			for($c = $tmp; $c <= ($total_pages-1); $c++)
+			{
+				if($perpage * $c == $current_start)
+				{
+					$nppage .= $NP_PRE_ACTIVE."<span class='nextprev_current' {$NP_STYLE} >".($c+1)."</span>".$NP_POST_ACTIVE."\n";
+				}
+				else
+				{
+					$link = str_replace("[FROM]", ($perpage * $c), $url);
+					$nppage .= "<a class='nextprev_link' href='{$link}'>".($c+1)."</a> \n";
+				}
+			}
+
+		}
+		else
+		{
+			for($c = 0; $c < $total_pages; $c++)
+			{
+				if($perpage * $c == $current_start)
+				{
+					$nppage .= $NP_PRE_ACTIVE."<span class='nextprev_current' {$NP_STYLE} >".($c+1)."</span>".$NP_POST_ACTIVE."\n";
+				}
+				else
+				{
+					$link = str_replace("[FROM]", ($perpage * $c), $url);
+					$nppage .= "<a class='nextprev_link' href='{$link}'>".($c+1)."</a> \n";
+				}
+			}
+		}
+        $nppage .= "\n\n<!-- End of Next/Prev -->\n\n";
+		return $caption.$nppage;
+	}
+
+	// Use NEW nextprev method
+	$np_parm['template'] = "[PREV]&nbsp;&nbsp;[DROPDOWN]&nbsp;&nbsp;[NEXT]";
+	$np_parms['prev'] = "&nbsp;&nbsp;&lt;&lt;&nbsp;&nbsp;";
+	$np_parms['next'] = "&nbsp;&nbsp;&gt;&gt;&nbsp;&nbsp;";
+	$np_parms['np_class'] = 'tbox npbutton';
+	$np_parms['dropdown_class'] = 'tbox npdropdown';
+
+	if($cached_parms = getcachedvars('nextprev'))
+	{
+		$tmp = $cached_parms;
+		foreach($tmp as $key => $val)
+		{
+			$np_parms[$key]=$val;
+		}
+	}
+
+	$prev="";
+	$next="";
+	if($current_page > 1)
+	{
+		$prevstart = ($current_start - $perpage);
+		$link = str_replace("[FROM]", $prevstart, $url);
+		$prev = "<a class='{$np_parms['np_class']}' style='text-decoration:none' href='{$link}'>{$np_parms['prev']}</a>";
+	}
+	if($current_page < $total_pages)
+	{
+		$nextstart = ($current_start + $perpage);
+		$link = str_replace("[FROM]", $nextstart, $url);
+		$next = "<a class='{$np_parms['np_class']}' style='text-decoration:none' href='{$link}'>{$np_parms['next']}</a>";
+	}
+	$dropdown = "<select class='{$np_parms['dropdown_class']}' name='pageSelect' onchange='location.href=this.options[selectedIndex].value'>";
+	for($i = 1; $i <= $total_pages; $i++)
+	{
+		$sel = "";
+		if($current_page == $i)
+		{
+			$sel = " selected='selected' ";
+		}
+		$newstart = ($i-1)*$perpage;
+		$link = str_replace("[FROM]", $newstart, $url);
+		$dropdown .= "<option value='{$link}' {$sel}>{$i}</option>\n";
+	}
+	$dropdown .= "</select>";
+	$ret = $np_parm['template'];
+	$ret = str_replace('[DROPDOWN]', $dropdown, $ret);
+	$ret = str_replace('[PREV]', $prev, $ret);
+	$ret = str_replace('[NEXT]', $next, $ret);
+	return $caption.$ret;
+}
+return "";
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/picture.sc 75/e107_files/shortcode/picture.sc
--- 6171/e107_files/shortcode/picture.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/picture.sc	2006-04-30 18:48:39.000000000 -0500
@@ -0,0 +1,33 @@
+global $loop_uid;
+if($parm == "" && is_numeric($loop_uid))
+{
+	$parm = $loop_uid;
+}
+if(is_numeric($parm))
+{
+	if(intval($parm) == USERID)
+	{
+		$image = USERSESS;
+	}
+	else
+	{
+		$row = get_user_data(intval($parm));
+		$image=$row['user_sess'];
+	}
+}
+elseif($parm)
+{
+	$image=$parm;
+}
+else
+{
+	$image = USERSESS;
+}
+if($image && file_exists(e_FILE."public/avatars/".$image))
+{
+	 return "<img src='".e_FILE."public/avatars/{$image}' alt='' />";
+}
+else
+{
+	return "";
+}
diff -ruN 6171/e107_files/shortcode/plugin.sc 75/e107_files/shortcode/plugin.sc
--- 6171/e107_files/shortcode/plugin.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/plugin.sc	2006-01-21 13:36:58.000000000 -0600
@@ -0,0 +1,56 @@
+global $sql, $tp, $ns;
+$menu = $parm;
+
+$path = $tp -> toDB(dirname($menu));
+$name = $tp -> toDB(basename($menu));
+if($path == '.')
+{
+	$path = $menu;
+}
+if($sql->db_Select('menus','menu_id, menu_pages',"menu_name = '$name' AND (menu_path = '".$path."/' OR menu_path = '".$path."') AND menu_class IN (".USERCLASS_LIST.")"))
+{
+	$row = $sql->db_Fetch();
+	$show_menu = TRUE;
+	if($row['menu_pages']){
+		list($listtype,$listpages) = explode("-",$row['menu_pages']);
+		$pagelist = explode("|",$listpages);
+		$check_url = e_SELF."?".e_QUERY;
+		if($listtype == '1')  //show menu
+		{
+			$show_menu = FALSE;
+			foreach($pagelist as $p)
+			{
+				if(strpos($check_url,$p) !== FALSE)
+				{
+					$show_menu = TRUE;
+				}
+			}
+		}
+		elseif($listtype == '2')  //hide menu
+		{
+			$show_menu = TRUE;
+			foreach($pagelist as $p)
+			{
+				if(strpos($check_url,$p) !== FALSE)
+				{
+					$show_menu = FALSE;
+				}
+			}
+		}
+	}
+
+	if($show_menu) {
+		$sql->db_Mark_Time($name);
+		if($path != 'custom')
+		{
+			if(is_readable(e_PLUGIN.$path."/languages/".e_LANGUAGE.".php")){
+				include_once(e_PLUGIN.$path."/languages/".e_LANGUAGE.".php");
+			}
+			if(e_LANGUAGE != 'English' && is_readable(e_PLUGIN.$path."/languages/English.php")){
+				include_once(e_PLUGIN.$path."/languages/English.php");
+			}
+		}
+		include_once(e_PLUGIN.$path."/".$name.".php");
+		$sql->db_Mark_Time("(After $name)");
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/print_item.sc 75/e107_files/shortcode/print_item.sc
--- 6171/e107_files/shortcode/print_item.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/print_item.sc	2005-04-09 14:47:15.000000000 -0500
@@ -0,0 +1,10 @@
+if (defined("ICONPRINT") && file_exists(THEME."images/".ICONPRINT)) 
+{
+	$icon = THEME."images/".ICONPRINT;
+}
+else
+{
+	$icon = e_IMAGE."generic/".IMODE."/printer.png";
+}
+$parms = explode("^",$parm);
+return "<a href='".e_BASE."print.php?{$parms[1]}'><img src='".$icon."' style='border:0' alt='{$parms[0]}' title='{$parms[0]}'/></a>";
diff -ruN 6171/e107_files/shortcode/profile.sc 75/e107_files/shortcode/profile.sc
--- 6171/e107_files/shortcode/profile.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/profile.sc	2005-03-24 10:30:42.000000000 -0600
@@ -0,0 +1,2 @@
+$id = ($parm) ? $parm : USERID;
+return "<a href='".e_BASE."user.php?id.{$id}'>".IMAGE_profile."</a>";
diff -ruN 6171/e107_files/shortcode/search.sc 75/e107_files/shortcode/search.sc
--- 6171/e107_files/shortcode/search.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/search.sc	2006-04-25 00:28:07.000000000 -0500
@@ -0,0 +1,49 @@
+global $sql,$sysprefs,$SEARCH_SHORTCODE;
+
+
+@include_once(e_PLUGIN."search_menu/languages/".e_LANGUAGE.".php");
+
+if (!isset($SEARCH_SHORTCODE)) {
+	if (file_exists(THEME."search_template.php")) {
+			include(THEME."search_template.php");
+	} else {
+	  		include(e_THEME."templates/search_template.php");
+	}
+}
+	$ref['all'] = 'all';
+	$ref['news'] = '0';
+	$ref['comments'] = 1;
+	$ref['users'] = 2;
+	$ref['downloads'] = 3;
+	$ref['pages'] = 4;
+
+	$search_prefs = $sysprefs -> getArray('search_prefs');
+
+    foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) {
+		if (is_readable(e_PLUGIN.$plug_dir."/e_search.php")) {
+			$ref[$plug_dir] = $plug_dir;
+		}
+	}
+
+	if($ref[$parm]!= ''){
+        $page = $ref[$parm];
+    }elseif($parm='all' && $ref[e_PAGE] != ''){
+    	$page = $ref[e_PAGE];
+	}else{
+    	$page = 'all';
+	}
+
+	$text .= "<form method='get' action='".e_HTTP."search.php'><div>\n";
+	$text .= "<input type='hidden' name='t' value='$page' />\n";
+	$text .= "<input type='hidden' name='r' value='0' />\n";
+
+	if (defined('SEARCH_SHORTCODE_REF') && SEARCH_SHORTCODE_REF != '') {
+	  	$text .= "<input type='hidden' name='ref' value=\"".SEARCH_SHORTCODE_REF."\" />\n";
+	}
+
+	$text .= $SEARCH_SHORTCODE;
+
+	$text .="\n</div></form>";
+
+ return $text;
+
diff -ruN 6171/e107_files/shortcode/setstyle.sc 75/e107_files/shortcode/setstyle.sc
--- 6171/e107_files/shortcode/setstyle.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/setstyle.sc	2004-09-28 06:38:06.000000000 -0500
@@ -0,0 +1,2 @@
+global $style;
+$style = $parm;
diff -ruN 6171/e107_files/shortcode/sitecontactinfo.sc 75/e107_files/shortcode/sitecontactinfo.sc
--- 6171/e107_files/shortcode/sitecontactinfo.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/sitecontactinfo.sc	2006-04-24 16:52:29.000000000 -0500
@@ -0,0 +1 @@
+return SITECONTACTINFO;
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/sitedisclaimer.sc 75/e107_files/shortcode/sitedisclaimer.sc
--- 6171/e107_files/shortcode/sitedisclaimer.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/sitedisclaimer.sc	2004-09-25 23:09:25.000000000 -0500
@@ -0,0 +1 @@
+return SITEDISCLAIMER.(defined("THEME_DISCLAIMER") && $pref['displaythemeinfo'] ? THEME_DISCLAIMER : "");
diff -ruN 6171/e107_files/shortcode/sitelinks_alt.sc 75/e107_files/shortcode/sitelinks_alt.sc
--- 6171/e107_files/shortcode/sitelinks_alt.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/sitelinks_alt.sc	2006-01-13 18:23:04.000000000 -0600
@@ -0,0 +1,169 @@
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/shortcode/sitelinks_alt.sc,v $
+|     $Revision: 1.33 $
+|     $Date: 2006/01/14 00:23:04 $
+|     $Author: qnome $
++----------------------------------------------------------------------------+
+*/
+
+	global $sql, $pref;
+	$params = explode('+', $parm);
+	if (isset($params[0]) && $params[0] && $params[0] != 'no_icons' && $params[0] != 'default') {
+		$icon = $params[0];
+	} else {
+		$icon = e_IMAGE."generic/".IMODE."/arrow.png";
+	}
+
+	function adnav_cat($cat_title, $cat_link, $cat_img, $cat_id=FALSE, $cat_open=FALSE) {
+		global $tp;
+		$cat_link = (strpos($cat_link, '://') === FALSE && strpos($cat_link, 'mailto:') !== 0 ? e_HTTP.$cat_link : $cat_link);
+		
+		if ($cat_open == 4 || $cat_open == 5){
+			$dimen = ($cat_open == 4) ? "600,400" : "800,600";
+			$href = " href=\"javascript:open_window('".$cat_link."',".$dimen.")\"";
+		} else {
+			$href = "href='".$cat_link."'";
+		}
+		
+		$text = "<a class='menuButton' ".$href." ";
+		if ($cat_img != 'no_icons') {
+			$text .= "style='background-image: url(".$cat_img."); background-repeat: no-repeat; background-position: 3px 1px; white-space: nowrap' ";
+		}
+		if ($cat_id) {
+			$text .= "onclick=\"return buttonClick(event, '".$cat_id."');\" onmouseover=\"buttonMouseover(event, '".$cat_id."');\"";
+		}
+		if ($cat_open == 1){
+			$text .= " rel='external' ";
+		}
+		$text .= ">".$tp->toHTML($cat_title,"","defs no_hook")."</a>";
+		return $text;
+	}
+
+	function adnav_main($cat_title, $cat_link, $cat_img, $cat_id=FALSE, $params, $cat_open=FALSE) {
+		global $tp;
+		$cat_link = (strpos($cat_link, '://') === FALSE) ? e_HTTP.$cat_link : $cat_link;
+		
+		if ($cat_open == 4 || $cat_open == 5){
+			$dimen = ($cat_open == 4) ? "600,400" : "800,600";
+			$href = " href=\"javascript:open_window('".$cat_link."',".$dimen.")\"";
+		} else {
+			$href = "href='".$cat_link."'";
+		}
+		
+		$text = "<a class='menuItem' ".$href." ";
+		if ($cat_id) {
+			if (isset($params[2]) && $params[2] == 'link') {
+				$text .= "onmouseover=\"menuItemMouseover(event, '".$cat_id."');\"";
+			} else {
+				$text .= "onclick=\"return false;\" onmouseover=\"menuItemMouseover(event, '".$cat_id."');\"";
+			}
+		}
+		if ($cat_open == 1){
+			$text .= " rel='external' ";
+		}
+		$text .= ">";
+		if ($cat_img != 'no_icons') {
+			$text .= "<span class='menuItemBuffer'>".$cat_img."</span>";
+		}
+		$text .= "<span class='menuItemText'>".$tp->toHTML($cat_title,"","defs no_hook")."</span>";
+		if ($cat_id) {
+			$text .= "<span class=\"menuItemArrow\">&#9654;</span>";
+		}
+		$text .= "</a>";
+		return $text;
+	}
+
+	$js_file = ($params[1] == 'noclick') ? 'nav_menu_alt.js' : 'nav_menu.js';
+	if (file_exists(THEME.$js_file)) {
+		$text = "<script type='text/javascript' src='".THEME_ABS.$js_file."'></script>";
+	} else {
+		$text = "<script type='text/javascript' src='".e_FILE_ABS.$js_file."'></script>";
+	}
+	$text .= "<div class='menuBar' style='width:100%; white-space: nowrap'>";
+
+	// Setup Parent/Child Arrays ---->
+
+ 	$link_total = $sql->db_Select("links", "*", "link_class IN (".USERCLASS_LIST.") AND link_category=1 ORDER BY link_order ASC");
+	while ($row = $sql->db_Fetch()) {
+		if($row['link_parent'] == 0){
+			$linklist['head_menu'][] = $row;
+			$parents[] = $row['link_id'];
+		}else{
+			$pid = $row['link_parent'];
+			$linklist['sub_'.$pid][] = $row;
+		}
+	}
+
+
+	// Loops thru parents.--------->
+
+    foreach ($linklist['head_menu'] as $lk) {
+
+		if ($params[0] == 'no_icons') {
+			$link_icon = 'no_icons';
+		} else {
+			$link_icon = $lk['link_button'] ? e_IMAGE.'icons/'.$lk['link_button'] : $icon;
+		}
+
+		$main_linkid = $lk['link_id'];
+		if (isset($linklist['sub_'.$main_linkid])) {  // Has Children.
+
+			$text .= adnav_cat($lk['link_name'], '', $link_icon, 'l_'.$main_linkid);
+			$text .= render_sub($linklist, $main_linkid, $params, $icon);
+
+		} else {
+
+	  		// Display Parent only.
+
+        	$text .= adnav_cat($lk['link_name'], $lk['link_url'], $link_icon, FALSE, $lk['link_open']);
+
+		}
+	}
+
+	$text .= "</div>";
+
+	return $text;
+	
+	function render_sub($linklist, $id, $params, $icon) {
+		$text = "<div id='l_".$id."' class='menu' onmouseover=\"menuMouseover(event)\">";
+			foreach ($linklist['sub_'.$id] as $sub) {
+				// Filter title for backwards compatibility ---->
+
+                if(substr($sub['link_name'],0,8) == "submenu."){
+					$tmp = explode(".",$sub['link_name']);
+					$subname = $tmp[2];
+				}else{
+            		$subname = $sub['link_name'];
+				}
+
+				// Setup Child Icon --------->
+
+                if (!$sub['link_button'] && $params[0] == 'no_icons') {
+					$sub_icon = 'no_icons';
+				} else {
+					$sub_icon = "<img src='";
+					$sub_icon .= ($sub['link_button']) ? e_IMAGE.'icons/'.$sub['link_button'] : $icon;
+					$sub_icon .= "' alt='' style='border:0px; vertical-align:bottom; width: 16px; height: 16px' />";
+				}
+				if (isset($linklist['sub_'.$sub['link_id']])) {  // Has Children.
+					$sub_ids[] = $sub['link_id'];
+					$text .= adnav_main($subname, $sub['link_url'], $sub_icon, 'l_'.$sub['link_id'], $params, $sub['link_open']);
+				} else {
+					$text .= adnav_main($subname, $sub['link_url'], $sub_icon, null, $params, $sub['link_open']);
+				}
+
+			}
+			$text .= "</div>";
+			
+			if(isset($sub_ids) && is_array($sub_ids))
+			{
+				foreach ($sub_ids as $sub_id) {
+					$text .= render_sub($linklist, $sub_id, $params, $icon);
+				}
+			}
+			
+			return $text;
+	}
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/sitelinks.sc 75/e107_files/shortcode/sitelinks.sc
--- 6171/e107_files/shortcode/sitelinks.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/sitelinks.sc	2006-01-24 01:18:35.000000000 -0600
@@ -0,0 +1,20 @@
+global $eMenuActive,$linkstyle;
+if(!in_array('edynamic_menu',$eMenuActive) && !in_array('tree_menu',$eMenuActive) && !in_array('q_tree_menu',$eMenuActive)) {
+    $tmp = explode(":",$parm);
+	$linktype = $tmp[0];
+	$cat = ($tmp[1]) ? $tmp[1] : 1;
+	$css_class = ($tmp[2]) ? $tmp[2] : false;
+	if(!defined('LINKDISPLAY')) {
+		define("LINKDISPLAY", ($linktype == "menu" ? 2 : 1));
+	}
+	require_once(e_HANDLER."sitelinks_class.php");
+	$sitelinks = new sitelinks;
+	if(function_exists("linkstyle")){
+    	$style = linkstyle($linkstyle);
+	}else{
+		$style="";
+	}
+	return $sitelinks->get($cat, $style, $css_class);
+}
+
+
diff -ruN 6171/e107_files/shortcode/sitename.sc 75/e107_files/shortcode/sitename.sc
--- 6171/e107_files/shortcode/sitename.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/sitename.sc	2004-09-24 21:20:00.000000000 -0500
@@ -0,0 +1 @@
+return SITENAME;
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/sitetag.sc 75/e107_files/shortcode/sitetag.sc
--- 6171/e107_files/shortcode/sitetag.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/sitetag.sc	2004-09-24 21:20:00.000000000 -0500
@@ -0,0 +1 @@
+return SITETAG;
\ No newline at end of file
diff -ruN 6171/e107_files/shortcode/user_avatar.sc 75/e107_files/shortcode/user_avatar.sc
--- 6171/e107_files/shortcode/user_avatar.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/user_avatar.sc	2006-04-30 18:48:39.000000000 -0500
@@ -0,0 +1,22 @@
+if(is_numeric($parm))
+{
+	if($parm == USERID)
+	{
+		$image = USERIMAGE;
+	}
+	else
+	{
+		$row = get_user_data(intval($parm));
+		$image=$row['user_image'];
+	}
+}
+elseif($parm)
+{
+	$image=$parm;
+}
+else
+{
+	$image = USERIMAGE;
+}
+require_once(e_HANDLER."avatar_handler.php");
+return "<div class='spacer'><img src='".avatar($image)."' alt='' /></div><br />";
diff -ruN 6171/e107_files/shortcode/wmessage.sc 75/e107_files/shortcode/wmessage.sc
--- 6171/e107_files/shortcode/wmessage.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/shortcode/wmessage.sc	2006-04-24 19:40:53.000000000 -0500
@@ -0,0 +1,60 @@
+// $Id: wmessage.sc,v 1.11 2006/04/25 00:40:53 e107coders Exp $
+
+if (($pref['wmessage_sc'] && $parm == "header") || (!$pref['wmessage_sc'] && $parm !='header') ){
+	return;
+}
+
+	global $e107;
+	if (isset($pref['frontpage']['all']) && $pref['frontpage']['all']) {
+		$front_url = ((strpos($pref['frontpage']['all'], 'http') === FALSE) ? SITEURL : '').$pref['frontpage']['all'];
+	} else if (ADMIN) {
+		$front_url = ((strpos($pref['frontpage']['254'], 'http') === FALSE) ? SITEURL : '').$pref['frontpage']['254'];
+	} else if (USER) {
+		require_once(e_HANDLER.'userclass_class.php');
+		$class_list = get_userclass_list();
+		foreach ($class_list as $fp_class) {
+			if (check_class($fp_class['userclass_id'])) {
+				$front_url = ((strpos($pref['frontpage'][$fp_class['userclass_id']], 'http') === FALSE) ? SITEURL : '').$pref['frontpage'][$fp_class['userclass_id']];
+				$class_match = true;
+				break;
+			}
+		}
+		if (!$class_match) {
+			$front_url = ((strpos($pref['frontpage']['253'], 'http') === FALSE) ? SITEURL : '').$pref['frontpage']['253'];
+		}
+	} else {
+		$front_url = ((strpos($pref['frontpage']['252'], 'http') === FALSE) ? SITEURL : '').$pref['frontpage']['252'];
+	}
+
+	if (e_SELF == $front_url) {
+		global $sql, $pref, $tp, $ns;
+		if (!defined("WMFLAG")) {
+			$qry = "
+			SELECT * FROM #generic
+			WHERE gen_type ='wmessage' AND gen_intdata IN (".USERCLASS_LIST.")";
+
+			if($sql->db_Select_gen($qry))
+			{
+				while ($row = $sql->db_Fetch())
+				{
+					$wmessage .= $tp->toHTML($row['gen_chardata'], TRUE, 'parse_sc defs', 'admin')."<br />";
+					if(!$wmcaption){
+						$wmcaption = $tp->toHTML($row['gen_ip'], TRUE, 'defs');
+					}
+				}
+			}
+
+			if (isset($wmessage) && $wmessage)
+			{
+				if ($pref['wm_enclose'])
+				{
+					$ns->tablerender($wmcaption, $wmessage, "wm");
+				}
+				else
+				{
+					echo ($wmcaption) ? $wmcaption."<br />" : "";
+					echo $wmessage;
+				}
+			}
+		}
+	}
Files 6171/e107_files/sleight_img.gif and 75/e107_files/sleight_img.gif differ
diff -ruN 6171/e107_files/sleight_js.php 75/e107_files/sleight_js.php
--- 6171/e107_files/sleight_js.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/sleight_js.php	2005-12-24 19:33:05.000000000 -0600
@@ -0,0 +1,73 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/sleight_js.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/25 01:33:05 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+// Credit to youngpup.net for sorting the annoyince that is ie for us =)
+// modified to ignore ie 7+ and figure out where it is on the server.
+
+// Slieght fix for sites that need it..
+
+$folder = dirname($_SERVER['PHP_SELF']).'/';
+$slashed_folder = str_replace(array("/", "."), array("\\/", "\\."), $folder);
+
+header("Content-type: application/x-javascript");
+
+?>
+if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
+	window.attachEvent("onload", fnLoadPngs);
+}
+
+function fnLoadPngs() {
+	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
+	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5 && Number(rslt[1]) < 7);
+
+	for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
+		if (itsAllGood && img.src.match(/\.png$/i) != null) {
+			fnFixPng(img);
+			img.attachEvent("onpropertychange", fnPropertyChanged);
+		}
+	}
+
+	var nl = document.getElementsByTagName("input");
+	for (var i = nl.length - 1, e = null; (e = nl[i]); i--) {
+		if (e.type == 'image') {
+			if (e.src.match(/\.png$/i) != null) {
+				fnFixPng(e);
+				e.attachEvent("onpropertychange", fnPropertyChanged);
+			}
+		}
+	}
+}
+
+function fnPropertyChanged() {
+	if (window.event.propertyName == "src") {
+		var el = window.event.srcElement;
+		if (!el.src.match(/<?php echo $slashed_folder; ?>sleight_img\.gif$/i)) {
+			el.filters.item(0).src = el.src;
+			el.src = "<?php echo $folder; ?>sleight_img.gif";
+		}
+	}
+}
+
+function fnFixPng(img) {
+	var src = img.src;
+	img.style.width = img.width + "px";
+	img.style.height = img.height + "px";
+	img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='scale')"
+	img.src = "<?php echo $folder; ?>sleight_img.gif";
+}
\ No newline at end of file
diff -ruN 6171/e107_files/style.css 75/e107_files/style.css
--- 6171/e107_files/style.css	2004-08-26 08:42:58.000000000 -0500
+++ 75/e107_files/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,34 +0,0 @@
-.day {
-  text-align: center;
-  background: #F1EAE1;
-  font: 10px tahoma, verdana, arial, helvetica, sans-serif;
-  padding: 2px 1px 2px 1px;
-}
-
-.dayentry {
-  text-align: center;
-  background: #F1C7B7;
-  font: 10px tahoma, verdana, arial, helvetica, sans-serif;
-  padding: 2px 1px 2px 1px;
-}
-
-.forumheader4{
-	background-color: #EBEFF2;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-	cursor: pointer;
-}
-
-.forumheader5{
-	background-color: #BCD5EA;
-	color:#000;
-	cursor: pointer;
-}
-
-ul{
-	margin-top:0px;
-	margin-bottom:0px;
-}
\ No newline at end of file
diff -ruN 6171/e107_files/thumb.php 75/e107_files/thumb.php
--- 6171/e107_files/thumb.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_files/thumb.php	2005-08-22 22:54:04.000000000 -0500
@@ -0,0 +1,45 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_files/thumb.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/08/23 03:54:04 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+/*
+ Usage: simply replace your <img src='filename.jpg'
+ with
+ <img src='".e_IMAGE."thumb.php?filename.jpg+size"' />
+ or
+ <img src='".e_IMAGE."thumb.php?<full path to file>/filename.jpg+size"' />
+ eg <img src='".e_IMAGE."thumb.php?home/images/myfilename.jpg+100)"' />
+
+*/
+
+require_once("../class2.php");
+require_once(e_HANDLER."resize_handler.php");
+
+    if (e_QUERY){
+        $tmp = explode("+",rawurldecode(e_QUERY));
+        if(strpos($tmp[0], "/") === 0 || strpos($tmp[0], ":") >= 1){
+            $source = $tmp[0];
+        }else{
+            $source = "../".str_replace("../","",$tmp[0]);
+        }
+
+        $newsize = $tmp[1];
+        if(!resize_image($source, "stdout", $newsize)){
+            echo "Couldn't find: ".$source;
+        }
+    }
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/admin_handler.php 75/e107_handlers/admin_handler.php
--- 6171/e107_handlers/admin_handler.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/admin_handler.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,39 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+// Multi indice array sort by sweetland@whoadammit.com
+if (!function_exists('asortbyindex')) {
+	function asortbyindex($sortarray, $index) {
+		$lastindex = count ($sortarray) - 1;
+		for ($subindex = 0; $subindex < $lastindex; $subindex++) {
+			$lastiteration = $lastindex - $subindex;
+			for ($iteration = 0; $iteration < $lastiteration; $iteration++) {
+				$nextchar = 0;
+				if (comesafter ($sortarray[$iteration][$index], $sortarray[$iteration + 1][$index])) {
+					$temp = $sortarray[$iteration];
+					$sortarray[$iteration] = $sortarray[$iteration + 1];
+					$sortarray[$iteration + 1] = $temp;
+				}
+			}
+		}
+		return ($sortarray);
+	}
+}
+	
+if (!function_exists('comesafter')) {
+	function comesafter($s1, $s2) {
+		$order = 1;
+		if (strlen ($s1) > strlen ($s2)) {
+			$temp = $s1;
+			$s1 = $s2;
+			$s2 = $temp;
+			$order = 0;
+		}
+		for ($index = 0; $index < strlen ($s1); $index++) {
+			if ($s1[$index] > $s2[$index]) return ($order);
+				if ($s1[$index] < $s2[$index]) return (1 - $order);
+			}
+		return ($order);
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/admin_log_class.php 75/e107_handlers/admin_log_class.php
--- 6171/e107_handlers/admin_log_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/admin_log_class.php	2006-04-13 09:33:06.000000000 -0500
@@ -0,0 +1,124 @@
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     �Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/admin_log_class.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/04/13 14:33:06 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/**
+ * Admin logging class.
+ *
+ */
+class e_admin_log {
+
+	/**
+	 * Contains default class options, plus any that are overidden by the constructor
+	 *
+	 * @var array
+	 */
+	var $_options = array(
+		'log_level' => 2,
+		'backtrace' => false,
+	);
+
+	/**
+	 * Constructor. Sets up constants and overwrites default options where set.
+	 *
+	 * @param array $options
+	 * @return e_admin_log
+	 */
+	function e_admin_log ($options = array()){
+		foreach ($options as $key => $val) {
+			$this->_options[$key] = $val;
+		}
+
+		/**
+		 * Minmal Log Level, including really minor stuff
+		 *
+		 */
+
+		define("E_LOG_INFORMATIVE", 0);
+
+		/**
+		 * More important than informative, but less important than notice
+		 *
+		 */
+		define("E_LOG_NOTICE", 1);
+
+		/**
+		 * Not anything serious, but important information
+		 *
+		 */
+		define("E_LOG_WARNING", 2);
+
+		/**
+		 * An event so bad your site ceased execution.
+		 *
+		 */
+		define("E_LOG_FATAL", 3);
+	}
+
+	/**
+	 * Log an event to the core table
+	 *
+	 * @param string $event_title
+	 * @param string $event_detail
+	 * @param int $event_type Log level
+	 */
+	function log_event ($event_title, $event_detail, $event_type = E_LOG_INFORMATIVE) {
+		global $e107, $sql, $tp;
+		if($event_type >= $this->_options['log_level']) {
+			$event_title = $tp -> toDB($event_title, true);
+			$event_detail = $tp -> toDB($event_detail, true);
+			$event_type = $tp -> toDB($event_type, true);
+			$time_stamp = time();
+			$uid = (USERID !== FALSE) ? USERID : '0';
+			$ip = $e107->getip();
+			if($this->_options['backtrace'] == true) {
+				$event_detail .= "\n\n".debug_backtrace();
+			}
+			$sql->db_Insert('dblog', "'', '{$event_type}', {$time_stamp}, {$uid}, '{$ip}', '{$event_title}', '{$event_detail}'");
+		}
+	}
+
+	function get_log_events($count = 15, $offset) {
+		global $sql;
+		$count = intval($count);
+	}
+
+	/**
+	 * Removes all events older than $days, or truncates the table if $days == false
+	 *
+	 * @param int $days
+	 */
+	function purge_log_events($days) {
+		global $sql;
+		if($days == false) {
+			// $days is false, so truncate the log table
+			$sql->db_Select_gen("TRUNCATE TABLE #dblog ");
+		} else {
+			// $days is set, so remove all entries older than that.
+			$days = intval($days);
+			$mintime = $days * 24 * 60 * 60;
+			$time = time() - $mintime;
+			$sql->db_Delete("dblog", "WHERE `dblog_datestamp` < {$time}", true);
+		}
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/arraystorage_class.php 75/e107_handlers/arraystorage_class.php
--- 6171/e107_handlers/arraystorage_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/arraystorage_class.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,68 @@
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/arraystorage_class.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/**
+* Allows Storage of arrays without use of serialize functions
+*
+*/
+class ArrayData {
+
+	/**
+	* Return a string containg exported array data.
+	*
+	* @param array $ArrayData array to be stored
+	* @param bool $AddSlashes default true, add slashes for db storage, else false
+	* @return string
+	*/
+	function WriteArray($ArrayData, $AddSlashes = true) {
+		if (!is_array($ArrayData)) {
+			return false;
+		}
+		$Array = var_export($ArrayData, true);
+		if ($AddSlashes == true) {
+			$Array = addslashes($Array);
+		}
+		return $Array;
+	}
+
+	/**
+	* Returns an array from stored array data.
+	*
+	* @param string $ArrayData
+	* @return array stored data
+	*/
+	function ReadArray($ArrayData) {
+		if ($ArrayData == ""){
+			return false;
+		}
+		$data = "";
+		$ArrayData = '$data = '.trim($ArrayData).';';
+		@eval($ArrayData);
+		if (!isset($data) || !is_array($data)) {
+			trigger_error("Bad stored array data - <br /><br />".htmlentities($ArrayData), E_USER_ERROR);
+			return false;
+		}
+		return $data;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/avatar_handler.php 75/e107_handlers/avatar_handler.php
--- 6171/e107_handlers/avatar_handler.php	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_handlers/avatar_handler.php	2005-12-27 14:17:17.000000000 -0600
@@ -1,31 +1,39 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/classes/avatar_handler.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-function avatar($avatar){
-	if(eregi("-upload-", $avatar)){
-		return e_FILE."public/avatars/".str_replace("-upload-", "", $avatar);
-	}else if(eregi("Binary", $avatar)){
-		$sqla = new db;
-		preg_match("/Binary\s(.*?)\//", $avatar, $result);
-		$sqla -> db_Select("rbinary", "*", "binary_id='".$result[1]."' ");
-		$row = $sqla -> db_Fetch(); extract($row);
-		return $binary_data;
-	}else if(!eregi("http://", $avatar)){
-		return e_IMAGE."avatars/".$avatar;
-	}else{
-		return $avatar;
-	}
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/avatar_handler.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/27 20:17:17 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+function avatar($avatar) {
+	global $tp;
+	if (stristr($avatar, "-upload-") !== FALSE) {
+		return e_FILE."public/avatars/".str_replace("-upload-", "", $avatar);
+	} else if (stristr($avatar, "Binary") !== FALSE) {
+		$sqla = new db;
+		preg_match("/Binary\s(.*?)\//", $avatar, $result);
+		$sqla->db_Select("rbinary", "*", "binary_id='".$tp -> toDB($result[1])."' ");
+		$row = $sqla->db_Fetch();
+		 extract($row);
+		return $binary_data;
+	} else if (strpos($avatar, "http://") === FALSE) {
+		return e_IMAGE."avatars/".$avatar;
+	} else {
+		return $avatar;
+	}
+}
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/bbcode_handler.php 75/e107_handlers/bbcode_handler.php
--- 6171/e107_handlers/bbcode_handler.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/bbcode_handler.php	2006-05-05 18:06:45.000000000 -0500
@@ -0,0 +1,189 @@
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/bbcode_handler.php,v $
+|     $Revision: 1.40 $
+|     $Date: 2006/05/05 23:06:45 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e_bbcode
+{
+
+	var $bbList;
+	var $bbLocation;
+	var $single_bb;
+	var $List;
+
+	function e_bbcode()
+	{
+		global $pref;
+		$core_bb = array(
+		'blockquote', 'img', 'i', 'u', 'center',
+		'*br', 'color', 'size', 'code',
+		'html', 'flash', 'link', 'email',
+		'url', 'quote', 'left', 'right',
+		'b', 'justify', 'file', 'stream',
+		'textarea', 'list', 'php', 'time',
+		'spoiler', 'hide'
+		);
+
+		foreach($core_bb as $c)
+		{
+			$this->bbLocation[$c] = 'core';
+		}
+		if(isset($pref['plug_bb']) && $pref['plug_bb'] != '')
+		{
+			$tmp = explode(',',$pref['plug_bb']);
+			foreach($tmp as $val)
+			{
+				list($code, $location) = explode(':',$val);
+				$this->bbLocation[$code] = $location;
+			}
+		}
+		$this->bbLocation = array_diff($this->bbLocation, array(''));
+		krsort($this->bbLocation);
+		$this->List = array_keys($this->bbLocation);
+		while($this->List[count($this->List)-1]{0} == "*")
+		{
+			array_unshift($this->List, array_pop($this->List));
+		}
+		if(($_c = array_search('code', $this->List)) !== FALSE)
+		{
+			unset($this->List[$c]);
+			array_unshift($this->List, "code");
+		}
+	}
+
+	function parseBBCodes($text, $p_ID)
+	{
+		global $code;
+		global $postID;
+		global $single_bb;
+		global $_matches;
+		$postID = $p_ID;
+		$done = false;
+		$single_bb = false;
+		$i=0;
+		
+		$tmplist = array();
+		foreach($this->List as $code)
+		{
+			if("*" == $code[0])
+			{
+				if(strpos($text, "[".substr($code, 1)) !== FALSE)
+				{
+					$tmplist[] = $code;
+				}
+			}
+			else
+			{
+				if(strpos($text, "[{$code}") !== FALSE && strpos($text, "[/{$code}") !== FALSE)
+				{
+					$tmplist[] = $code;
+				}
+			}
+		}
+
+		foreach($tmplist as $code)
+		{
+			if("*" == $code{0})
+			{
+				$code = substr($code, 1);
+				$this->single_bb = true;
+				$pattern = "#\[({$code})(\d*)(.*?)\]#s";
+			}
+			else
+			{
+				$this->single_bb = false;
+				$pattern = "#\[({$code})(\d*)(.*?)\](.*?)\[\/{$code}\\2\]#s";
+			}
+			$i=0;
+			while($code && ($pos = strpos($text, "[{$code}")) !== false)
+			{
+				$text = preg_replace_callback($pattern, array($this, 'doCode'), $text);
+				$leftover_code = $_matches[1].$_matches[2];
+				$text = str_replace("[{$leftover_code}", "&#091;{$leftover_code}", $text);
+			}
+		}
+		return $text;
+	}
+
+	function doCode($matches)
+	{
+		global $tp, $postID, $full_text, $code_text, $parm, $_matches;
+		$_matches = $matches;
+		$full_text = $tp->replaceConstants($matches[0]);
+		$code = $matches[1];
+		$parm = substr($matches[3], 1);
+		$code_text = $tp->replaceConstants($matches[4]);
+		if($this->single_bb == true)
+		{
+			$code = '*'.$code;
+		}
+		if (E107_DEBUG_LEVEL)
+		{
+			global $db_debug;
+			$db_debug->logCode(1, $code, $parm, $postID);
+		}
+
+		if (is_array($this->bbList) && array_key_exists($code, $this->bbList))
+		{
+			$bbcode = $this->bbList[$code];
+		}
+		else
+		{
+			if ($this->bbLocation[$code] == 'core')
+			{
+				$bbFile = e_FILE.'bbcode/'.strtolower(str_replace('*', '', $code)).'.bb';
+			}
+			else
+			{
+				// Add code to check for plugin bbcode addition
+				$bbFile = e_PLUGIN.$this->bbLocation[$code].'/'.strtolower(str_replace('*', '', $code)).'.bb';
+			}
+			if (file_exists($bbFile))
+			{
+				$bbcode = file_get_contents($bbFile);
+				$this->bbList[$code] = $bbcode;
+			}
+			else
+			{
+				$this->bbList[$code] = '';
+				return false;
+			}
+		}
+		global $e107_debug;
+		if($e107_debug)
+		{
+			trigger_error("starting bbcode [$code]", E_USER_ERROR);
+		}
+		ob_start();
+		$bbcode_return = eval($bbcode);
+		$bbcode_output = ob_get_contents();
+		ob_end_clean();
+
+		/* added to remove possibility of nested bbcode exploits ... */
+		if(strpos($bbcode_return, "[") !== FALSE)
+		{
+			$exp_search = array("eval", "expression");
+			$exp_replace = array("ev<b></b>al", "expres<b></b>sion");
+			$bbcode_return = str_replace($exp_search, $exp_replace, $bbcode_return);
+		}
+		return $bbcode_output.$bbcode_return;
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/cache_handler.php 75/e107_handlers/cache_handler.php
--- 6171/e107_handlers/cache_handler.php	2004-09-02 20:31:42.000000000 -0500
+++ 75/e107_handlers/cache_handler.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,110 +1,141 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /e107_handlers/cache_handler.php
-|
-|        http://e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/e107_handlers/cache_handler.php,v $
-|     $Revision: 1.5 $
-|     $Date: 2004/09/03 01:31:41 $
-|     $Author: mcfly_e107 $
-+---------------------------------------------------------------+
-*/
-
-class ecache {
-
-        function e107cache_page_md5(){
-                return md5(e_BASE.e_LANGUAGE.THEME.USERCLASS);
-        }
-
-			function cache_fname($query){
-				global $FILES_DIRECTORY;
-				$q = preg_replace("#\W#","_",$query);
-				$fname = "./".e_BASE.$FILES_DIRECTORY."cache/".$q."-".$this -> e107cache_page_md5().".cache.php";
-				return $fname;
-			}
-
-        function retrieve($query){
-                global $pref,$FILES_DIRECTORY;
-                if('1' == $pref['cachestatus']){  //Save to db
-                        global $sql;
-                        if(!is_object($sql)){$sql = new db;}
-                        $qry = $query."-".$this -> e107cache_page_md5();
-                        if($sql -> db_Select("cache", "cache_data", "cache_url='$qry' ")){
-                                $row = $sql -> db_Fetch();
-                                return "\n\n<!-- BEGIN CACHE DB: $query -->\n\n".stripslashes($row['cache_data'])."\n<!-- END CACHE DB: $query -->\n\n";
-                        } else {
-                                return FALSE;
-                        }
-                }
-                if('2' == $pref['cachestatus']){  //Save to file
-                        $cache_file = $this -> cache_fname($query);
-                        if($fp = fopen($cache_file, 'rb')) {
-                                fseek($fp,6);
-                                $ret = fread($fp, filesize($cache_file));
-                                fclose($fp);
-                                return ('' == $ret) ? '<!-- null -->' : $ret;
-                        } else {
-                                return FALSE;
-                        }
-                }
-        }
-
-        function set($query, $text){
-                global $pref,$FILES_DIRECTORY;
-                if('1' == $pref['cachestatus']){
-                        global $sql;
-                        $query = $query."-".$this -> e107cache_page_md5();
-                        if(!is_object($sql)){$sql = new db;}
-                        $sql -> db_Insert("cache", "'$query', '".time()."', '".mysql_escape_string($text)."' ");
-                }
-                if('2' == $pref['cachestatus']){
-                        $cache_file = $this -> cache_fname($query);
-                        $fp = fopen($cache_file, 'w+');
-                        fwrite ($fp, "<?php\n<!-- BEGIN CACHE FILE: $query -->\n\n".$text."\n\n<!-- END CACHE FILE: $query -->");
-                        fclose($fp);
-                        @chmod($cache_file, 0777);
-                }
-        }
-
-        function clear($query){
-                global $pref,$FILES_DIRECTORY;
-                if('1' == $pref['cachestatus'] || !$query){
-                        global $sql;
-                        if(!is_object($sql)){$sql = new db;}
-                        $ret = $sql -> db_Delete("cache", "cache_url LIKE '%".$query."%' ");
-                }
-                if('2' == $pref['cachestatus'] || !$query){
-                        $file = ($query) ? preg_replace("#\W#","_",$query)."*.cache.php" : "*.cache.php";
-                        $dir = "./".e_BASE.$FILES_DIRECTORY."cache/";
-                        $ret = $this -> delete($dir, $file);
-                }
-                return $ret;
-        }
-
-        function delete($dir, $pattern = "*.*") {
-                $deleted = false;
-                $pattern = str_replace(array("\*","\?"), array(".*","."), preg_quote($pattern));
-                if (substr($dir,-1) != "/") $dir.= "/";
-                if (is_dir($dir)) {
-                        $d = opendir($dir);
-                        while ($file = readdir($d)) {
-                                if (is_file($dir.$file) && ereg("^".$pattern."$", $file)) {
-                                        if (unlink($dir.$file)) {
-                                                $deleted[] = $file;
-                                        }
-                                }
-                        }
-                        closedir($d);
-                        return true;
-                } else {
-                        return false;
-                }
-        }
-}
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/cache_handler.php,v $
+|     $Revision: 1.27 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/**
+* Class to cache data as files, improving site speed and throughput.
+*
+* @package     e107
+* @version     $Revision: 1.27 $
+* @author      $Author: sweetas $
+*/
+class ecache {
+
+	var $CachePageMD5;
+
+	/**
+	* @return string
+	* @param string $query
+	* @desc Internal class function that returns the filename of a cache file based on the query.
+	* @scope private
+	*/
+	function cache_fname($CacheTag) {
+		global $FILES_DIRECTORY;
+		if (isset($this)) {
+			if (defined("THEME") && !$this->CachePageMD5) {
+				$this->CachePageMD5 = md5(e_BASE.e_LANGUAGE.THEME.USERCLASS.e_QUERY.filemtime(THEME.'theme.php'));
+			}
+			$CheckTag = '_'.$this->CachePageMD5;
+		} else {
+			$CheckTag = '';
+		}
+		$q = preg_replace("#\W#", "_", $CacheTag);
+		$fname = './'.e_BASE.$FILES_DIRECTORY.'cache/'.$q.$CheckTag.'.cache.php';
+		return $fname;
+	}
+
+	/**
+	* @return string
+	* @param string $query
+	* @param int $MaximumAge the time in minutes before the cache file 'expires'
+	* @desc Returns the data from the cache file associated with $query, else it returns false if there is no cache for $query.
+	* @scope public
+	*/
+	function retrieve($CacheTag, $MaximumAge = false, $ForcedCheck = false) {
+		global $pref, $FILES_DIRECTORY;
+		if ($pref['cachestatus'] || $ForcedCheck == true) {
+			$cache_file = (isset($this) ? $this->cache_fname($CacheTag) : ecache::cache_fname($CacheTag));
+			if (file_exists($cache_file)) {
+				if ($MaximumAge != false && (filemtime($cache_file) + ($MaximumAge * 60)) < time()) {
+					unlink($cache_file);
+					return false;
+				} else {
+					$ret = file_get_contents($cache_file);
+					$ret = substr($ret, 5);
+					return $ret;
+				}
+			} else {
+				return false;
+			}
+		}
+	}
+
+	/**
+	* @return void
+	* @param string $query
+	* @param string $text
+	* @desc Creates / overwrites the cache file for $query, $text is the data to store for $query.
+	* @scope public
+	*/
+	function set($CacheTag, $Data, $ForceCache = false) {
+		global $pref, $FILES_DIRECTORY;
+		if ($pref['cachestatus'] || $ForceCache == true) {
+			$cache_file = (isset($this) ? $this->cache_fname($CacheTag) : ecache::cache_fname($CacheTag));
+			file_put_contents($cache_file, '<?php'.$Data);
+			@chmod($cache_file, 0777);
+			@touch($cache_file);
+		}
+	}
+
+	/**
+	* @return bool
+	* @param string $CacheTag
+	* @desc Deletes cache files. If $query is set, deletes files named {$CacheTag}*.cache.php, if not it deletes all cache files - (*.cache.php)
+	*/
+	function clear($CacheTag = '') {
+		global $pref, $FILES_DIRECTORY;
+		$file = ($CacheTag) ? preg_replace("#\W#", "_", $CacheTag)."*.cache.php" : "*.cache.php";
+		$dir = "./".e_BASE.$FILES_DIRECTORY."cache/";
+		$ret = ecache::delete($dir, $file);
+		return $ret;
+	}
+
+	/**
+	* @return bool
+	* @param string $dir
+	* @param string $pattern
+	* @desc Internal class function to allow deletion of cache files using a pattern, default '*.*'
+	* @scope private
+	*/
+	function delete($dir, $pattern = "*.*") {
+		$deleted = false;
+		$pattern = str_replace(array("\*", "\?"), array(".*", "."), preg_quote($pattern));
+		if (substr($dir, -1) != "/") {
+			$dir .= "/";
+		}
+		if (is_dir($dir)) {
+			$d = opendir($dir);
+			while ($file = readdir($d)) {
+				if (is_file($dir.$file) && preg_match("/^{$pattern}$/", $file)) {
+					if (unlink($dir.$file)) {
+						$deleted[] = $file;
+					}
+				}
+			}
+			closedir($d);
+			return true;
+		} else {
+			return false;
+		}
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/calendar/calendar_class.php 75/e107_handlers/calendar/calendar_class.php
--- 6171/e107_handlers/calendar/calendar_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/calendar/calendar_class.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,141 @@
+<?php
+/**
+*  File: calendar.php | (c) dynarch.com 2004
+*  Distributed as part of "The Coolest DHTML Calendar"
+*  under the same terms.
+*  -----------------------------------------------------------------
+*  This file implements a simple PHP wrapper for the calendar.  It
+*  allows you to easily include all the calendar files and setup the
+*  calendar by instantiating and calling a PHP object.
+*/
+
+define('NEWLINE', "\n");
+
+class DHTML_Calendar
+{
+	var $calendar_file;
+	var $calendar_lang_file;
+	var $calendar_setup_file;
+	var $calendar_theme_file;
+	var $calendar_options;
+	var $calendar_img;
+
+	function DHTML_Calendar($stripped = true)
+	{
+		if ($stripped)
+		{
+			$this->calendar_file = e_HANDLER.'calendar/calendar_stripped.js';
+			$this->calendar_setup_file = e_HANDLER.'calendar/calendar-setup_stripped.js';
+		}
+		else
+		{
+			$this->calendar_file = e_HANDLER.'calendar/calendar.js';
+			$this->calendar_setup_file = e_HANDLER.'calendar/calendar-setup.js';
+		}
+
+
+		if(file_exists(e_HANDLER.'calendar/language/'.e_LANGUAGE.'.js'))
+		{
+			$this->calendar_lang_file = e_HANDLER.'calendar/language/'.e_LANGUAGE.'.js';
+		}
+		else
+		{
+			$this->calendar_lang_file = e_HANDLER.'calendar/language/English.js';
+		}
+
+		if(defined('CALENDAR_IMG'))
+		{
+			$this->calendar_img = CALENDAR_IMG;
+		}
+		else
+		{
+			$this->calendar_img = "<img style='vertical-align:middle; border:0px' src='".e_HANDLER."calendar/cal.gif'  alt='' />";
+		}
+
+		if(file_exists(THEME."calendar.css"))
+		{
+			$this->calendar_theme_file = THEME."calendar.css";
+		}
+		else
+		{
+			$this->calendar_theme_file = e_HANDLER."calendar/calendar.css";
+		}
+
+		$this->calendar_options = array('ifFormat' => '%Y/%m/%d', 'daFormat' => '%Y/%m/%d');
+	}
+
+	function set_option($name, $value) {
+		$this->calendar_options[$name] = $value;
+	}
+
+	function load_files() {
+		return $this->get_load_files_code();
+	}
+
+	function get_load_files_code() {
+		$code  = ( '<link rel="stylesheet" type="text/css" media="all" href="' . $this->calendar_theme_file . '" />' . NEWLINE );
+		$code .= ( '<script type="text/javascript" src="'.$this->calendar_file.'"></script>' . NEWLINE );
+		$code .= ( '<script type="text/javascript" src="'.$this->calendar_setup_file.'"></script>' . NEWLINE );
+		$code .= ( '<script type="text/javascript" src="'.$this->calendar_lang_file.'"></script>' . NEWLINE );
+		return $code;
+	}
+
+	function _make_calendar($other_options = array()) {
+		$js_options = $this->_make_js_hash(array_merge($this->calendar_options, $other_options));
+		$code  = ( '<script type="text/javascript">Calendar.setup({' . $js_options . '});</script>' );
+		return $code;
+	}
+
+	function make_input_field($cal_options = array(), $field_attributes = array())
+	{
+		$ret = "";
+		$id = $this->_gen_id();
+		$attrstr = $this->_make_html_attr(array_merge($field_attributes, array('id'   => $this->_field_id($id), 'type' => 'text')));
+		$ret .= '<input ' . $attrstr .'/> ';
+		$ret .= "<a href='#' id='".$this->_trigger_id($id)."'>".$this->calendar_img."</a>";
+		$options = array_merge($cal_options, array('inputField' => $this->_field_id($id), 'button' => $this->_trigger_id($id)));
+		$ret .= $this->_make_calendar($options);
+		return $ret;
+	}
+
+	/// PRIVATE SECTION
+
+	function _field_id($id) { return 'f-calendar-field-' . $id; }
+	function _trigger_id($id) { return 'f-calendar-trigger-' . $id; }
+	function _gen_id() { static $id = 0; return ++$id; }
+
+	function _make_js_hash($array) {
+		$jstr = '';
+		reset($array);
+		while (list($key, $val) = each($array))
+		{
+			if (is_bool($val))
+			{
+				$val = $val ? 'true' : 'false';
+			}
+			elseif (!is_numeric($val))
+			{
+				$val = '"'.$val.'"';
+			}
+			if ($jstr)
+			{
+				$jstr .= ',';
+			}
+
+			$jstr .= '"' . $key . '":' . $val;
+		}
+		return $jstr;
+	}
+
+	function _make_html_attr($array) {
+		$attrstr = '';
+		reset($array);
+		while (list($key, $val) = each($array))
+		{
+			$attrstr .= $key . '="' . $val . '" ';
+		}
+		return $attrstr;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/calendar/calendar.css 75/e107_handlers/calendar/calendar.css
--- 6171/e107_handlers/calendar/calendar.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/calendar/calendar.css	2005-03-30 13:34:38.000000000 -0600
@@ -0,0 +1,274 @@
+/* The main calendar widget.  DIV containing a table. */
+
+.calendar {
+  position: relative;
+  display: none;
+/*
+  border-top: 2px solid #fff;
+  border-right: 2px solid #000;
+  border-bottom: 2px solid #000;
+  border-left: 2px solid #fff;
+*/
+  font-size: 11px;
+  color: #000;
+  cursor: default;
+  background: #d4d0c8;
+  font-family: tahoma,verdana,sans-serif;
+  width: 190px;
+}
+
+.calendar table {
+  border-top: 1px solid #000;
+  border-right: 1px solid #fff;
+  border-bottom: 1px solid #fff;
+  border-left: 1px solid #000;
+  font-size: 11px;
+  color: #000;
+  cursor: default;
+  background: #d4d0c8;
+  font-family: tahoma,verdana,sans-serif;
+}
+
+/* Header part -- contains navigation buttons and day names. */
+
+.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
+  text-align: center;
+  padding: 1px;
+  border-top: 1px solid #fff;
+  border-right: 1px solid #000;
+  border-bottom: 1px solid #000;
+  border-left: 1px solid #fff;
+}
+
+.calendar .nav {
+  background: transparent url(menuarrow.gif) no-repeat 100% 100%;
+}
+
+.calendar thead .title { /* This holds the current "month, year" */
+  font-weight: bold;
+  padding: 1px;
+  border: 1px solid #000;
+  background: #848078;
+  color: #fff;
+  text-align: center;
+}
+
+.calendar thead .headrow { /* Row <TR> containing navigation buttons */
+}
+
+.calendar thead .daynames { /* Row <TR> containing the day names */
+}
+
+.calendar thead .name { /* Cells <TD> containing the day names */
+  border-bottom: 1px solid #000;
+  padding: 2px;
+  text-align: center;
+  background: #f4f0e8;
+}
+
+.calendar thead .weekend { /* How a weekend day name shows in header */
+  color: #f00;
+}
+
+.calendar thead .hilite { /* How do the buttons in header appear when hover */
+  border-top: 2px solid #fff;
+  border-right: 2px solid #000;
+  border-bottom: 2px solid #000;
+  border-left: 2px solid #fff;
+  padding: 0px;
+  background-color: #e4e0d8;
+}
+
+.calendar thead .active { /* Active (pressed) buttons in header */
+  padding: 2px 0px 0px 2px;
+  border-top: 1px solid #000;
+  border-right: 1px solid #fff;
+  border-bottom: 1px solid #fff;
+  border-left: 1px solid #000;
+  background-color: #c4c0b8;
+}
+
+/* The body part -- contains all the days in month. */
+
+.calendar tbody .day { /* Cells <TD> containing month days dates */
+  width: 2em;
+  text-align: right;
+  padding: 2px 4px 2px 2px;
+}
+.calendar tbody .day.othermonth {
+  font-size: 80%;
+  color: #aaa;
+}
+.calendar tbody .day.othermonth.oweekend {
+  color: #faa;
+}
+
+.calendar table .wn {
+  padding: 2px 3px 2px 2px;
+  border-right: 1px solid #000;
+  background: #f4f0e8;
+}
+
+.calendar tbody .rowhilite td {
+  background: #e4e0d8;
+}
+
+.calendar tbody .rowhilite td.wn {
+  background: #d4d0c8;
+}
+
+.calendar tbody td.hilite { /* Hovered cells <TD> */
+  padding: 1px 3px 1px 1px;
+  border-top: 1px solid #fff;
+  border-right: 1px solid #000;
+  border-bottom: 1px solid #000;
+  border-left: 1px solid #fff;
+}
+
+.calendar tbody td.active { /* Active (pressed) cells <TD> */
+  padding: 2px 2px 0px 2px;
+  border-top: 1px solid #000;
+  border-right: 1px solid #fff;
+  border-bottom: 1px solid #fff;
+  border-left: 1px solid #000;
+}
+
+.calendar tbody td.selected { /* Cell showing selected date */
+  font-weight: bold;
+  border-top: 1px solid #000;
+  border-right: 1px solid #fff;
+  border-bottom: 1px solid #fff;
+  border-left: 1px solid #000;
+  padding: 2px 2px 0px 2px;
+  background: #e4e0d8;
+}
+
+.calendar tbody td.weekend { /* Cells showing weekend days */
+  color: #f00;
+}
+
+.calendar tbody td.today { /* Cell showing today date */
+  font-weight: bold;
+  color: #00f;
+}
+
+.calendar tbody .disabled { color: #999; }
+
+.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
+  visibility: hidden;
+}
+
+.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
+  display: none;
+}
+
+/* The footer part -- status bar and "Close" button */
+
+.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
+}
+
+.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
+  background: #f4f0e8;
+  padding: 1px;
+  border: 1px solid #000;
+  background: #848078;
+  color: #fff;
+  text-align: center;
+}
+
+.calendar tfoot .hilite { /* Hover style for buttons in footer */
+  border-top: 1px solid #fff;
+  border-right: 1px solid #000;
+  border-bottom: 1px solid #000;
+  border-left: 1px solid #fff;
+  padding: 1px;
+  background: #e4e0d8;
+}
+
+.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
+  padding: 2px 0px 0px 2px;
+  border-top: 1px solid #000;
+  border-right: 1px solid #fff;
+  border-bottom: 1px solid #fff;
+  border-left: 1px solid #000;
+}
+
+/* Combo boxes (menus that display months/years for direct selection) */
+
+.calendar .combo {
+  position: absolute;
+  display: none;
+  width: 4em;
+  top: 0px;
+  left: 0px;
+  cursor: default;
+  border-top: 1px solid #fff;
+  border-right: 1px solid #000;
+  border-bottom: 1px solid #000;
+  border-left: 1px solid #fff;
+  background: #e4e0d8;
+  font-size: 90%;
+  padding: 1px;
+  z-index: 100;
+}
+
+.calendar .combo .label,
+.calendar .combo .label-IEfix {
+  text-align: center;
+  padding: 1px;
+}
+
+.calendar .combo .label-IEfix {
+  width: 4em;
+}
+
+.calendar .combo .active {
+  background: #c4c0b8;
+  padding: 0px;
+  border-top: 1px solid #000;
+  border-right: 1px solid #fff;
+  border-bottom: 1px solid #fff;
+  border-left: 1px solid #000;
+}
+
+.calendar .combo .hilite {
+  background: #048;
+  color: #fea;
+}
+
+.calendar td.time {
+  border-top: 1px solid #000;
+  padding: 1px 0px;
+  text-align: center;
+  background-color: #f4f0e8;
+}
+
+.calendar td.time .hour,
+.calendar td.time .minute,
+.calendar td.time .ampm {
+  padding: 0px 3px 0px 4px;
+  border: 1px solid #889;
+  font-weight: bold;
+  background-color: #fff;
+}
+
+.calendar td.time .ampm {
+  text-align: center;
+}
+
+.calendar td.time .colon {
+  padding: 0px 2px 0px 3px;
+  font-weight: bold;
+}
+
+.calendar td.time span.hilite {
+  border-color: #000;
+  background-color: #766;
+  color: #fff;
+}
+
+.calendar td.time span.active {
+  border-color: #f00;
+  background-color: #000;
+  color: #0f0;
+}
diff -ruN 6171/e107_handlers/calendar/calendar.js 75/e107_handlers/calendar/calendar.js
--- 6171/e107_handlers/calendar/calendar.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/calendar/calendar.js	2005-03-30 13:34:38.000000000 -0600
@@ -0,0 +1,1806 @@
+/*  Copyright Mihai Bazon, 2002-2005  |  www.bazon.net/mishoo
+ * -----------------------------------------------------------
+ *
+ * The DHTML Calendar, version 1.0 "It is happening again"
+ *
+ * Details and latest version at:
+ * www.dynarch.com/projects/calendar
+ *
+ * This script is developed by Dynarch.com.  Visit us at www.dynarch.com.
+ *
+ * This script is distributed under the GNU Lesser General Public License.
+ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
+ */
+
+// $Id: calendar.js,v 1.1 2005/03/30 19:34:38 mcfly_e107 Exp $
+
+/** The Calendar object constructor. */
+Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) {
+	// member variables
+	this.activeDiv = null;
+	this.currentDateEl = null;
+	this.getDateStatus = null;
+	this.getDateToolTip = null;
+	this.getDateText = null;
+	this.timeout = null;
+	this.onSelected = onSelected || null;
+	this.onClose = onClose || null;
+	this.dragging = false;
+	this.hidden = false;
+	this.minYear = 1970;
+	this.maxYear = 2050;
+	this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"];
+	this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"];
+	this.isPopup = true;
+	this.weekNumbers = true;
+	this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc.
+	this.showsOtherMonths = false;
+	this.dateStr = dateStr;
+	this.ar_days = null;
+	this.showsTime = false;
+	this.time24 = true;
+	this.yearStep = 2;
+	this.hiliteToday = true;
+	this.multiple = null;
+	// HTML elements
+	this.table = null;
+	this.element = null;
+	this.tbody = null;
+	this.firstdayname = null;
+	// Combo boxes
+	this.monthsCombo = null;
+	this.yearsCombo = null;
+	this.hilitedMonth = null;
+	this.activeMonth = null;
+	this.hilitedYear = null;
+	this.activeYear = null;
+	// Information
+	this.dateClicked = false;
+
+	// one-time initializations
+	if (typeof Calendar._SDN == "undefined") {
+		// table of short day names
+		if (typeof Calendar._SDN_len == "undefined")
+			Calendar._SDN_len = 3;
+		var ar = new Array();
+		for (var i = 8; i > 0;) {
+			ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len);
+		}
+		Calendar._SDN = ar;
+		// table of short month names
+		if (typeof Calendar._SMN_len == "undefined")
+			Calendar._SMN_len = 3;
+		ar = new Array();
+		for (var i = 12; i > 0;) {
+			ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len);
+		}
+		Calendar._SMN = ar;
+	}
+};
+
+// ** constants
+
+/// "static", needed for event handlers.
+Calendar._C = null;
+
+/// detect a special case of "web browser"
+Calendar.is_ie = ( /msie/i.test(navigator.userAgent) &&
+		   !/opera/i.test(navigator.userAgent) );
+
+Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) );
+
+/// detect Opera browser
+Calendar.is_opera = /opera/i.test(navigator.userAgent);
+
+/// detect KHTML-based browsers
+Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent);
+
+// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate
+//        library, at some point.
+
+Calendar.getAbsolutePos = function(el) {
+	var SL = 0, ST = 0;
+	var is_div = /^div$/i.test(el.tagName);
+	if (is_div && el.scrollLeft)
+		SL = el.scrollLeft;
+	if (is_div && el.scrollTop)
+		ST = el.scrollTop;
+	var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST };
+	if (el.offsetParent) {
+		var tmp = this.getAbsolutePos(el.offsetParent);
+		r.x += tmp.x;
+		r.y += tmp.y;
+	}
+	return r;
+};
+
+Calendar.isRelated = function (el, evt) {
+	var related = evt.relatedTarget;
+	if (!related) {
+		var type = evt.type;
+		if (type == "mouseover") {
+			related = evt.fromElement;
+		} else if (type == "mouseout") {
+			related = evt.toElement;
+		}
+	}
+	while (related) {
+		if (related == el) {
+			return true;
+		}
+		related = related.parentNode;
+	}
+	return false;
+};
+
+Calendar.removeClass = function(el, className) {
+	if (!(el && el.className)) {
+		return;
+	}
+	var cls = el.className.split(" ");
+	var ar = new Array();
+	for (var i = cls.length; i > 0;) {
+		if (cls[--i] != className) {
+			ar[ar.length] = cls[i];
+		}
+	}
+	el.className = ar.join(" ");
+};
+
+Calendar.addClass = function(el, className) {
+	Calendar.removeClass(el, className);
+	el.className += " " + className;
+};
+
+// FIXME: the following 2 functions totally suck, are useless and should be replaced immediately.
+Calendar.getElement = function(ev) {
+	var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget;
+	while (f.nodeType != 1 || /^div$/i.test(f.tagName))
+		f = f.parentNode;
+	return f;
+};
+
+Calendar.getTargetElement = function(ev) {
+	var f = Calendar.is_ie ? window.event.srcElement : ev.target;
+	while (f.nodeType != 1)
+		f = f.parentNode;
+	return f;
+};
+
+Calendar.stopEvent = function(ev) {
+	ev || (ev = window.event);
+	if (Calendar.is_ie) {
+		ev.cancelBubble = true;
+		ev.returnValue = false;
+	} else {
+		ev.preventDefault();
+		ev.stopPropagation();
+	}
+	return false;
+};
+
+Calendar.addEvent = function(el, evname, func) {
+	if (el.attachEvent) { // IE
+		el.attachEvent("on" + evname, func);
+	} else if (el.addEventListener) { // Gecko / W3C
+		el.addEventListener(evname, func, true);
+	} else {
+		el["on" + evname] = func;
+	}
+};
+
+Calendar.removeEvent = function(el, evname, func) {
+	if (el.detachEvent) { // IE
+		el.detachEvent("on" + evname, func);
+	} else if (el.removeEventListener) { // Gecko / W3C
+		el.removeEventListener(evname, func, true);
+	} else {
+		el["on" + evname] = null;
+	}
+};
+
+Calendar.createElement = function(type, parent) {
+	var el = null;
+	if (document.createElementNS) {
+		// use the XHTML namespace; IE won't normally get here unless
+		// _they_ "fix" the DOM2 implementation.
+		el = document.createElementNS("http://www.w3.org/1999/xhtml", type);
+	} else {
+		el = document.createElement(type);
+	}
+	if (typeof parent != "undefined") {
+		parent.appendChild(el);
+	}
+	return el;
+};
+
+// END: UTILITY FUNCTIONS
+
+// BEGIN: CALENDAR STATIC FUNCTIONS
+
+/** Internal -- adds a set of events to make some element behave like a button. */
+Calendar._add_evs = function(el) {
+	with (Calendar) {
+		addEvent(el, "mouseover", dayMouseOver);
+		addEvent(el, "mousedown", dayMouseDown);
+		addEvent(el, "mouseout", dayMouseOut);
+		if (is_ie) {
+			addEvent(el, "dblclick", dayMouseDblClick);
+			el.setAttribute("unselectable", true);
+		}
+	}
+};
+
+Calendar.findMonth = function(el) {
+	if (typeof el.month != "undefined") {
+		return el;
+	} else if (typeof el.parentNode.month != "undefined") {
+		return el.parentNode;
+	}
+	return null;
+};
+
+Calendar.findYear = function(el) {
+	if (typeof el.year != "undefined") {
+		return el;
+	} else if (typeof el.parentNode.year != "undefined") {
+		return el.parentNode;
+	}
+	return null;
+};
+
+Calendar.showMonthsCombo = function () {
+	var cal = Calendar._C;
+	if (!cal) {
+		return false;
+	}
+	var cal = cal;
+	var cd = cal.activeDiv;
+	var mc = cal.monthsCombo;
+	if (cal.hilitedMonth) {
+		Calendar.removeClass(cal.hilitedMonth, "hilite");
+	}
+	if (cal.activeMonth) {
+		Calendar.removeClass(cal.activeMonth, "active");
+	}
+	var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];
+	Calendar.addClass(mon, "active");
+	cal.activeMonth = mon;
+	var s = mc.style;
+	s.display = "block";
+	if (cd.navtype < 0)
+		s.left = cd.offsetLeft + "px";
+	else {
+		var mcw = mc.offsetWidth;
+		if (typeof mcw == "undefined")
+			// Konqueror brain-dead techniques
+			mcw = 50;
+		s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px";
+	}
+	s.top = (cd.offsetTop + cd.offsetHeight) + "px";
+};
+
+Calendar.showYearsCombo = function (fwd) {
+	var cal = Calendar._C;
+	if (!cal) {
+		return false;
+	}
+	var cal = cal;
+	var cd = cal.activeDiv;
+	var yc = cal.yearsCombo;
+	if (cal.hilitedYear) {
+		Calendar.removeClass(cal.hilitedYear, "hilite");
+	}
+	if (cal.activeYear) {
+		Calendar.removeClass(cal.activeYear, "active");
+	}
+	cal.activeYear = null;
+	var Y = cal.date.getFullYear() + (fwd ? 1 : -1);
+	var yr = yc.firstChild;
+	var show = false;
+	for (var i = 12; i > 0; --i) {
+		if (Y >= cal.minYear && Y <= cal.maxYear) {
+			yr.innerHTML = Y;
+			yr.year = Y;
+			yr.style.display = "block";
+			show = true;
+		} else {
+			yr.style.display = "none";
+		}
+		yr = yr.nextSibling;
+		Y += fwd ? cal.yearStep : -cal.yearStep;
+	}
+	if (show) {
+		var s = yc.style;
+		s.display = "block";
+		if (cd.navtype < 0)
+			s.left = cd.offsetLeft + "px";
+		else {
+			var ycw = yc.offsetWidth;
+			if (typeof ycw == "undefined")
+				// Konqueror brain-dead techniques
+				ycw = 50;
+			s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px";
+		}
+		s.top = (cd.offsetTop + cd.offsetHeight) + "px";
+	}
+};
+
+// event handlers
+
+Calendar.tableMouseUp = function(ev) {
+	var cal = Calendar._C;
+	if (!cal) {
+		return false;
+	}
+	if (cal.timeout) {
+		clearTimeout(cal.timeout);
+	}
+	var el = cal.activeDiv;
+	if (!el) {
+		return false;
+	}
+	var target = Calendar.getTargetElement(ev);
+	ev || (ev = window.event);
+	Calendar.removeClass(el, "active");
+	if (target == el || target.parentNode == el) {
+		Calendar.cellClick(el, ev);
+	}
+	var mon = Calendar.findMonth(target);
+	var date = null;
+	if (mon) {
+		date = new Date(cal.date);
+		if (mon.month != date.getMonth()) {
+			date.setMonth(mon.month);
+			cal.setDate(date);
+			cal.dateClicked = false;
+			cal.callHandler();
+		}
+	} else {
+		var year = Calendar.findYear(target);
+		if (year) {
+			date = new Date(cal.date);
+			if (year.year != date.getFullYear()) {
+				date.setFullYear(year.year);
+				cal.setDate(date);
+				cal.dateClicked = false;
+				cal.callHandler();
+			}
+		}
+	}
+	with (Calendar) {
+		removeEvent(document, "mouseup", tableMouseUp);
+		removeEvent(document, "mouseover", tableMouseOver);
+		removeEvent(document, "mousemove", tableMouseOver);
+		cal._hideCombos();
+		_C = null;
+		return stopEvent(ev);
+	}
+};
+
+Calendar.tableMouseOver = function (ev) {
+	var cal = Calendar._C;
+	if (!cal) {
+		return;
+	}
+	var el = cal.activeDiv;
+	var target = Calendar.getTargetElement(ev);
+	if (target == el || target.parentNode == el) {
+		Calendar.addClass(el, "hilite active");
+		Calendar.addClass(el.parentNode, "rowhilite");
+	} else {
+		if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2)))
+			Calendar.removeClass(el, "active");
+		Calendar.removeClass(el, "hilite");
+		Calendar.removeClass(el.parentNode, "rowhilite");
+	}
+	ev || (ev = window.event);
+	if (el.navtype == 50 && target != el) {
+		var pos = Calendar.getAbsolutePos(el);
+		var w = el.offsetWidth;
+		var x = ev.clientX;
+		var dx;
+		var decrease = true;
+		if (x > pos.x + w) {
+			dx = x - pos.x - w;
+			decrease = false;
+		} else
+			dx = pos.x - x;
+
+		if (dx < 0) dx = 0;
+		var range = el._range;
+		var current = el._current;
+		var count = Math.floor(dx / 10) % range.length;
+		for (var i = range.length; --i >= 0;)
+			if (range[i] == current)
+				break;
+		while (count-- > 0)
+			if (decrease) {
+				if (--i < 0)
+					i = range.length - 1;
+			} else if ( ++i >= range.length )
+				i = 0;
+		var newval = range[i];
+		el.innerHTML = newval;
+
+		cal.onUpdateTime();
+	}
+	var mon = Calendar.findMonth(target);
+	if (mon) {
+		if (mon.month != cal.date.getMonth()) {
+			if (cal.hilitedMonth) {
+				Calendar.removeClass(cal.hilitedMonth, "hilite");
+			}
+			Calendar.addClass(mon, "hilite");
+			cal.hilitedMonth = mon;
+		} else if (cal.hilitedMonth) {
+			Calendar.removeClass(cal.hilitedMonth, "hilite");
+		}
+	} else {
+		if (cal.hilitedMonth) {
+			Calendar.removeClass(cal.hilitedMonth, "hilite");
+		}
+		var year = Calendar.findYear(target);
+		if (year) {
+			if (year.year != cal.date.getFullYear()) {
+				if (cal.hilitedYear) {
+					Calendar.removeClass(cal.hilitedYear, "hilite");
+				}
+				Calendar.addClass(year, "hilite");
+				cal.hilitedYear = year;
+			} else if (cal.hilitedYear) {
+				Calendar.removeClass(cal.hilitedYear, "hilite");
+			}
+		} else if (cal.hilitedYear) {
+			Calendar.removeClass(cal.hilitedYear, "hilite");
+		}
+	}
+	return Calendar.stopEvent(ev);
+};
+
+Calendar.tableMouseDown = function (ev) {
+	if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {
+		return Calendar.stopEvent(ev);
+	}
+};
+
+Calendar.calDragIt = function (ev) {
+	var cal = Calendar._C;
+	if (!(cal && cal.dragging)) {
+		return false;
+	}
+	var posX;
+	var posY;
+	if (Calendar.is_ie) {
+		posY = window.event.clientY + document.body.scrollTop;
+		posX = window.event.clientX + document.body.scrollLeft;
+	} else {
+		posX = ev.pageX;
+		posY = ev.pageY;
+	}
+	cal.hideShowCovered();
+	var st = cal.element.style;
+	st.left = (posX - cal.xOffs) + "px";
+	st.top = (posY - cal.yOffs) + "px";
+	return Calendar.stopEvent(ev);
+};
+
+Calendar.calDragEnd = function (ev) {
+	var cal = Calendar._C;
+	if (!cal) {
+		return false;
+	}
+	cal.dragging = false;
+	with (Calendar) {
+		removeEvent(document, "mousemove", calDragIt);
+		removeEvent(document, "mouseup", calDragEnd);
+		tableMouseUp(ev);
+	}
+	cal.hideShowCovered();
+};
+
+Calendar.dayMouseDown = function(ev) {
+	var el = Calendar.getElement(ev);
+	if (el.disabled) {
+		return false;
+	}
+	var cal = el.calendar;
+	cal.activeDiv = el;
+	Calendar._C = cal;
+	if (el.navtype != 300) with (Calendar) {
+		if (el.navtype == 50) {
+			el._current = el.innerHTML;
+			addEvent(document, "mousemove", tableMouseOver);
+		} else
+			addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver);
+		addClass(el, "hilite active");
+		addEvent(document, "mouseup", tableMouseUp);
+	} else if (cal.isPopup) {
+		cal._dragStart(ev);
+	}
+	if (el.navtype == -1 || el.navtype == 1) {
+		if (cal.timeout) clearTimeout(cal.timeout);
+		cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250);
+	} else if (el.navtype == -2 || el.navtype == 2) {
+		if (cal.timeout) clearTimeout(cal.timeout);
+		cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250);
+	} else {
+		cal.timeout = null;
+	}
+	return Calendar.stopEvent(ev);
+};
+
+Calendar.dayMouseDblClick = function(ev) {
+	Calendar.cellClick(Calendar.getElement(ev), ev || window.event);
+	if (Calendar.is_ie) {
+		document.selection.empty();
+	}
+};
+
+Calendar.dayMouseOver = function(ev) {
+	var el = Calendar.getElement(ev);
+	if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) {
+		return false;
+	}
+	if (el.ttip) {
+		if (el.ttip.substr(0, 1) == "_") {
+			el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1);
+		}
+		el.calendar.tooltips.innerHTML = el.ttip;
+	}
+	if (el.navtype != 300) {
+		Calendar.addClass(el, "hilite");
+		if (el.caldate) {
+			Calendar.addClass(el.parentNode, "rowhilite");
+		}
+	}
+	return Calendar.stopEvent(ev);
+};
+
+Calendar.dayMouseOut = function(ev) {
+	with (Calendar) {
+		var el = getElement(ev);
+		if (isRelated(el, ev) || _C || el.disabled)
+			return false;
+		removeClass(el, "hilite");
+		if (el.caldate)
+			removeClass(el.parentNode, "rowhilite");
+		if (el.calendar)
+			el.calendar.tooltips.innerHTML = _TT["SEL_DATE"];
+		return stopEvent(ev);
+	}
+};
+
+/**
+ *  A generic "click" handler :) handles all types of buttons defined in this
+ *  calendar.
+ */
+Calendar.cellClick = function(el, ev) {
+	var cal = el.calendar;
+	var closing = false;
+	var newdate = false;
+	var date = null;
+	if (typeof el.navtype == "undefined") {
+		if (cal.currentDateEl) {
+			Calendar.removeClass(cal.currentDateEl, "selected");
+			Calendar.addClass(el, "selected");
+			closing = (cal.currentDateEl == el);
+			if (!closing) {
+				cal.currentDateEl = el;
+			}
+		}
+		cal.date.setDateOnly(el.caldate);
+		date = cal.date;
+		var other_month = !(cal.dateClicked = !el.otherMonth);
+		if (!other_month && !cal.currentDateEl)
+			cal._toggleMultipleDate(new Date(date));
+		else
+			newdate = !el.disabled;
+		// a date was clicked
+		if (other_month)
+			cal._init(cal.firstDayOfWeek, date);
+	} else {
+		if (el.navtype == 200) {
+			Calendar.removeClass(el, "hilite");
+			cal.callCloseHandler();
+			return;
+		}
+		date = new Date(cal.date);
+		if (el.navtype == 0)
+			date.setDateOnly(new Date()); // TODAY
+		// unless "today" was clicked, we assume no date was clicked so
+		// the selected handler will know not to close the calenar when
+		// in single-click mode.
+		// cal.dateClicked = (el.navtype == 0);
+		cal.dateClicked = false;
+		var year = date.getFullYear();
+		var mon = date.getMonth();
+		function setMonth(m) {
+			var day = date.getDate();
+			var max = date.getMonthDays(m);
+			if (day > max) {
+				date.setDate(max);
+			}
+			date.setMonth(m);
+		};
+		switch (el.navtype) {
+		    case 400:
+			Calendar.removeClass(el, "hilite");
+			var text = Calendar._TT["ABOUT"];
+			if (typeof text != "undefined") {
+				text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : "";
+			} else {
+				// FIXME: this should be removed as soon as lang files get updated!
+				text = "Help and about box text is not translated into this language.\n" +
+					"If you know this language and you feel generous please update\n" +
+					"the corresponding file in \"lang\" subdir to match calendar-en.js\n" +
+					"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\n" +
+					"Thank you!\n" +
+					"http://dynarch.com/mishoo/calendar.epl\n";
+			}
+			alert(text);
+			return;
+		    case -2:
+			if (year > cal.minYear) {
+				date.setFullYear(year - 1);
+			}
+			break;
+		    case -1:
+			if (mon > 0) {
+				setMonth(mon - 1);
+			} else if (year-- > cal.minYear) {
+				date.setFullYear(year);
+				setMonth(11);
+			}
+			break;
+		    case 1:
+			if (mon < 11) {
+				setMonth(mon + 1);
+			} else if (year < cal.maxYear) {
+				date.setFullYear(year + 1);
+				setMonth(0);
+			}
+			break;
+		    case 2:
+			if (year < cal.maxYear) {
+				date.setFullYear(year + 1);
+			}
+			break;
+		    case 100:
+			cal.setFirstDayOfWeek(el.fdow);
+			return;
+		    case 50:
+			var range = el._range;
+			var current = el.innerHTML;
+			for (var i = range.length; --i >= 0;)
+				if (range[i] == current)
+					break;
+			if (ev && ev.shiftKey) {
+				if (--i < 0)
+					i = range.length - 1;
+			} else if ( ++i >= range.length )
+				i = 0;
+			var newval = range[i];
+			el.innerHTML = newval;
+			cal.onUpdateTime();
+			return;
+		    case 0:
+			// TODAY will bring us here
+			if ((typeof cal.getDateStatus == "function") &&
+			    cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) {
+				return false;
+			}
+			break;
+		}
+		if (!date.equalsTo(cal.date)) {
+			cal.setDate(date);
+			newdate = true;
+		} else if (el.navtype == 0)
+			newdate = closing = true;
+	}
+	if (newdate) {
+		ev && cal.callHandler();
+	}
+	if (closing) {
+		Calendar.removeClass(el, "hilite");
+		ev && cal.callCloseHandler();
+	}
+};
+
+// END: CALENDAR STATIC FUNCTIONS
+
+// BEGIN: CALENDAR OBJECT FUNCTIONS
+
+/**
+ *  This function creates the calendar inside the given parent.  If _par is
+ *  null than it creates a popup calendar inside the BODY element.  If _par is
+ *  an element, be it BODY, then it creates a non-popup calendar (still
+ *  hidden).  Some properties need to be set before calling this function.
+ */
+Calendar.prototype.create = function (_par) {
+	var parent = null;
+	if (! _par) {
+		// default parent is the document body, in which case we create
+		// a popup calendar.
+		parent = document.getElementsByTagName("body")[0];
+		this.isPopup = true;
+	} else {
+		parent = _par;
+		this.isPopup = false;
+	}
+	this.date = this.dateStr ? new Date(this.dateStr) : new Date();
+
+	var table = Calendar.createElement("table");
+	this.table = table;
+	table.cellSpacing = 0;
+	table.cellPadding = 0;
+	table.calendar = this;
+	Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown);
+
+	var div = Calendar.createElement("div");
+	this.element = div;
+	div.className = "calendar";
+	if (this.isPopup) {
+		div.style.position = "absolute";
+		div.style.display = "none";
+	}
+	div.appendChild(table);
+
+	var thead = Calendar.createElement("thead", table);
+	var cell = null;
+	var row = null;
+
+	var cal = this;
+	var hh = function (text, cs, navtype) {
+		cell = Calendar.createElement("td", row);
+		cell.colSpan = cs;
+		cell.className = "button";
+		if (navtype != 0 && Math.abs(navtype) <= 2)
+			cell.className += " nav";
+		Calendar._add_evs(cell);
+		cell.calendar = cal;
+		cell.navtype = navtype;
+		cell.innerHTML = "<div unselectable='on'>" + text + "</div>";
+		return cell;
+	};
+
+	row = Calendar.createElement("tr", thead);
+	var title_length = 6;
+	(this.isPopup) && --title_length;
+	(this.weekNumbers) && ++title_length;
+
+	hh("?", 1, 400).ttip = Calendar._TT["INFO"];
+	this.title = hh("", title_length, 300);
+	this.title.className = "title";
+	if (this.isPopup) {
+		this.title.ttip = Calendar._TT["DRAG_TO_MOVE"];
+		this.title.style.cursor = "move";
+		hh("&#x00d7;", 1, 200).ttip = Calendar._TT["CLOSE"];
+	}
+
+	row = Calendar.createElement("tr", thead);
+	row.className = "headrow";
+
+	this._nav_py = hh("&#x00ab;", 1, -2);
+	this._nav_py.ttip = Calendar._TT["PREV_YEAR"];
+
+	this._nav_pm = hh("&#x2039;", 1, -1);
+	this._nav_pm.ttip = Calendar._TT["PREV_MONTH"];
+
+	this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0);
+	this._nav_now.ttip = Calendar._TT["GO_TODAY"];
+
+	this._nav_nm = hh("&#x203a;", 1, 1);
+	this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"];
+
+	this._nav_ny = hh("&#x00bb;", 1, 2);
+	this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"];
+
+	// day names
+	row = Calendar.createElement("tr", thead);
+	row.className = "daynames";
+	if (this.weekNumbers) {
+		cell = Calendar.createElement("td", row);
+		cell.className = "name wn";
+		cell.innerHTML = Calendar._TT["WK"];
+	}
+	for (var i = 7; i > 0; --i) {
+		cell = Calendar.createElement("td", row);
+		if (!i) {
+			cell.navtype = 100;
+			cell.calendar = this;
+			Calendar._add_evs(cell);
+		}
+	}
+	this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild;
+	this._displayWeekdays();
+
+	var tbody = Calendar.createElement("tbody", table);
+	this.tbody = tbody;
+
+	for (i = 6; i > 0; --i) {
+		row = Calendar.createElement("tr", tbody);
+		if (this.weekNumbers) {
+			cell = Calendar.createElement("td", row);
+		}
+		for (var j = 7; j > 0; --j) {
+			cell = Calendar.createElement("td", row);
+			cell.calendar = this;
+			Calendar._add_evs(cell);
+		}
+	}
+
+	if (this.showsTime) {
+		row = Calendar.createElement("tr", tbody);
+		row.className = "time";
+
+		cell = Calendar.createElement("td", row);
+		cell.className = "time";
+		cell.colSpan = 2;
+		cell.innerHTML = Calendar._TT["TIME"] || "&nbsp;";
+
+		cell = Calendar.createElement("td", row);
+		cell.className = "time";
+		cell.colSpan = this.weekNumbers ? 4 : 3;
+
+		(function(){
+			function makeTimePart(className, init, range_start, range_end) {
+				var part = Calendar.createElement("span", cell);
+				part.className = className;
+				part.innerHTML = init;
+				part.calendar = cal;
+				part.ttip = Calendar._TT["TIME_PART"];
+				part.navtype = 50;
+				part._range = [];
+				if (typeof range_start != "number")
+					part._range = range_start;
+				else {
+					for (var i = range_start; i <= range_end; ++i) {
+						var txt;
+						if (i < 10 && range_end >= 10) txt = '0' + i;
+						else txt = '' + i;
+						part._range[part._range.length] = txt;
+					}
+				}
+				Calendar._add_evs(part);
+				return part;
+			};
+			var hrs = cal.date.getHours();
+			var mins = cal.date.getMinutes();
+			var t12 = !cal.time24;
+			var pm = (hrs > 12);
+			if (t12 && pm) hrs -= 12;
+			var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23);
+			var span = Calendar.createElement("span", cell);
+			span.innerHTML = ":";
+			span.className = "colon";
+			var M = makeTimePart("minute", mins, 0, 59);
+			var AP = null;
+			cell = Calendar.createElement("td", row);
+			cell.className = "time";
+			cell.colSpan = 2;
+			if (t12)
+				AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]);
+			else
+				cell.innerHTML = "&nbsp;";
+
+			cal.onSetTime = function() {
+				var pm, hrs = this.date.getHours(),
+					mins = this.date.getMinutes();
+				if (t12) {
+					pm = (hrs >= 12);
+					if (pm) hrs -= 12;
+					if (hrs == 0) hrs = 12;
+					AP.innerHTML = pm ? "pm" : "am";
+				}
+				H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs;
+				M.innerHTML = (mins < 10) ? ("0" + mins) : mins;
+			};
+
+			cal.onUpdateTime = function() {
+				var date = this.date;
+				var h = parseInt(H.innerHTML, 10);
+				if (t12) {
+					if (/pm/i.test(AP.innerHTML) && h < 12)
+						h += 12;
+					else if (/am/i.test(AP.innerHTML) && h == 12)
+						h = 0;
+				}
+				var d = date.getDate();
+				var m = date.getMonth();
+				var y = date.getFullYear();
+				date.setHours(h);
+				date.setMinutes(parseInt(M.innerHTML, 10));
+				date.setFullYear(y);
+				date.setMonth(m);
+				date.setDate(d);
+				this.dateClicked = false;
+				this.callHandler();
+			};
+		})();
+	} else {
+		this.onSetTime = this.onUpdateTime = function() {};
+	}
+
+	var tfoot = Calendar.createElement("tfoot", table);
+
+	row = Calendar.createElement("tr", tfoot);
+	row.className = "footrow";
+
+	cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300);
+	cell.className = "ttip";
+	if (this.isPopup) {
+		cell.ttip = Calendar._TT["DRAG_TO_MOVE"];
+		cell.style.cursor = "move";
+	}
+	this.tooltips = cell;
+
+	div = Calendar.createElement("div", this.element);
+	this.monthsCombo = div;
+	div.className = "combo";
+	for (i = 0; i < Calendar._MN.length; ++i) {
+		var mn = Calendar.createElement("div");
+		mn.className = Calendar.is_ie ? "label-IEfix" : "label";
+		mn.month = i;
+		mn.innerHTML = Calendar._SMN[i];
+		div.appendChild(mn);
+	}
+
+	div = Calendar.createElement("div", this.element);
+	this.yearsCombo = div;
+	div.className = "combo";
+	for (i = 12; i > 0; --i) {
+		var yr = Calendar.createElement("div");
+		yr.className = Calendar.is_ie ? "label-IEfix" : "label";
+		div.appendChild(yr);
+	}
+
+	this._init(this.firstDayOfWeek, this.date);
+	parent.appendChild(this.element);
+};
+
+/** keyboard navigation, only for popup calendars */
+Calendar._keyEvent = function(ev) {
+	var cal = window._dynarch_popupCalendar;
+	if (!cal || cal.multiple)
+		return false;
+	(Calendar.is_ie) && (ev = window.event);
+	var act = (Calendar.is_ie || ev.type == "keypress"),
+		K = ev.keyCode;
+	if (ev.ctrlKey) {
+		switch (K) {
+		    case 37: // KEY left
+			act && Calendar.cellClick(cal._nav_pm);
+			break;
+		    case 38: // KEY up
+			act && Calendar.cellClick(cal._nav_py);
+			break;
+		    case 39: // KEY right
+			act && Calendar.cellClick(cal._nav_nm);
+			break;
+		    case 40: // KEY down
+			act && Calendar.cellClick(cal._nav_ny);
+			break;
+		    default:
+			return false;
+		}
+	} else switch (K) {
+	    case 32: // KEY space (now)
+		Calendar.cellClick(cal._nav_now);
+		break;
+	    case 27: // KEY esc
+		act && cal.callCloseHandler();
+		break;
+	    case 37: // KEY left
+	    case 38: // KEY up
+	    case 39: // KEY right
+	    case 40: // KEY down
+		if (act) {
+			var prev, x, y, ne, el, step;
+			prev = K == 37 || K == 38;
+			step = (K == 37 || K == 39) ? 1 : 7;
+			function setVars() {
+				el = cal.currentDateEl;
+				var p = el.pos;
+				x = p & 15;
+				y = p >> 4;
+				ne = cal.ar_days[y][x];
+			};setVars();
+			function prevMonth() {
+				var date = new Date(cal.date);
+				date.setDate(date.getDate() - step);
+				cal.setDate(date);
+			};
+			function nextMonth() {
+				var date = new Date(cal.date);
+				date.setDate(date.getDate() + step);
+				cal.setDate(date);
+			};
+			while (1) {
+				switch (K) {
+				    case 37: // KEY left
+					if (--x >= 0)
+						ne = cal.ar_days[y][x];
+					else {
+						x = 6;
+						K = 38;
+						continue;
+					}
+					break;
+				    case 38: // KEY up
+					if (--y >= 0)
+						ne = cal.ar_days[y][x];
+					else {
+						prevMonth();
+						setVars();
+					}
+					break;
+				    case 39: // KEY right
+					if (++x < 7)
+						ne = cal.ar_days[y][x];
+					else {
+						x = 0;
+						K = 40;
+						continue;
+					}
+					break;
+				    case 40: // KEY down
+					if (++y < cal.ar_days.length)
+						ne = cal.ar_days[y][x];
+					else {
+						nextMonth();
+						setVars();
+					}
+					break;
+				}
+				break;
+			}
+			if (ne) {
+				if (!ne.disabled)
+					Calendar.cellClick(ne);
+				else if (prev)
+					prevMonth();
+				else
+					nextMonth();
+			}
+		}
+		break;
+	    case 13: // KEY enter
+		if (act)
+			Calendar.cellClick(cal.currentDateEl, ev);
+		break;
+	    default:
+		return false;
+	}
+	return Calendar.stopEvent(ev);
+};
+
+/**
+ *  (RE)Initializes the calendar to the given date and firstDayOfWeek
+ */
+Calendar.prototype._init = function (firstDayOfWeek, date) {
+	var today = new Date(),
+		TY = today.getFullYear(),
+		TM = today.getMonth(),
+		TD = today.getDate();
+	this.table.style.visibility = "hidden";
+	var year = date.getFullYear();
+	if (year < this.minYear) {
+		year = this.minYear;
+		date.setFullYear(year);
+	} else if (year > this.maxYear) {
+		year = this.maxYear;
+		date.setFullYear(year);
+	}
+	this.firstDayOfWeek = firstDayOfWeek;
+	this.date = new Date(date);
+	var month = date.getMonth();
+	var mday = date.getDate();
+	var no_days = date.getMonthDays();
+
+	// calendar voodoo for computing the first day that would actually be
+	// displayed in the calendar, even if it's from the previous month.
+	// WARNING: this is magic. ;-)
+	date.setDate(1);
+	var day1 = (date.getDay() - this.firstDayOfWeek) % 7;
+	if (day1 < 0)
+		day1 += 7;
+	date.setDate(-day1);
+	date.setDate(date.getDate() + 1);
+
+	var row = this.tbody.firstChild;
+	var MN = Calendar._SMN[month];
+	var ar_days = this.ar_days = new Array();
+	var weekend = Calendar._TT["WEEKEND"];
+	var dates = this.multiple ? (this.datesCells = {}) : null;
+	for (var i = 0; i < 6; ++i, row = row.nextSibling) {
+		var cell = row.firstChild;
+		if (this.weekNumbers) {
+			cell.className = "day wn";
+			cell.innerHTML = date.getWeekNumber();
+			cell = cell.nextSibling;
+		}
+		row.className = "daysrow";
+		var hasdays = false, iday, dpos = ar_days[i] = [];
+		for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) {
+			iday = date.getDate();
+			var wday = date.getDay();
+			cell.className = "day";
+			cell.pos = i << 4 | j;
+			dpos[j] = cell;
+			var current_month = (date.getMonth() == month);
+			if (!current_month) {
+				if (this.showsOtherMonths) {
+					cell.className += " othermonth";
+					cell.otherMonth = true;
+				} else {
+					cell.className = "emptycell";
+					cell.innerHTML = "&nbsp;";
+					cell.disabled = true;
+					continue;
+				}
+			} else {
+				cell.otherMonth = false;
+				hasdays = true;
+			}
+			cell.disabled = false;
+			cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday;
+			if (dates)
+				dates[date.print("%Y%m%d")] = cell;
+			if (this.getDateStatus) {
+				var status = this.getDateStatus(date, year, month, iday);
+				if (this.getDateToolTip) {
+					var toolTip = this.getDateToolTip(date, year, month, iday);
+					if (toolTip)
+						cell.title = toolTip;
+				}
+				if (status === true) {
+					cell.className += " disabled";
+					cell.disabled = true;
+				} else {
+					if (/disabled/i.test(status))
+						cell.disabled = true;
+					cell.className += " " + status;
+				}
+			}
+			if (!cell.disabled) {
+				cell.caldate = new Date(date);
+				cell.ttip = "_";
+				if (!this.multiple && current_month
+				    && iday == mday && this.hiliteToday) {
+					cell.className += " selected";
+					this.currentDateEl = cell;
+				}
+				if (date.getFullYear() == TY &&
+				    date.getMonth() == TM &&
+				    iday == TD) {
+					cell.className += " today";
+					cell.ttip += Calendar._TT["PART_TODAY"];
+				}
+				if (weekend.indexOf(wday.toString()) != -1)
+					cell.className += cell.otherMonth ? " oweekend" : " weekend";
+			}
+		}
+		if (!(hasdays || this.showsOtherMonths))
+			row.className = "emptyrow";
+	}
+	this.title.innerHTML = Calendar._MN[month] + ", " + year;
+	this.onSetTime();
+	this.table.style.visibility = "visible";
+	this._initMultipleDates();
+	// PROFILE
+	// this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms";
+};
+
+Calendar.prototype._initMultipleDates = function() {
+	if (this.multiple) {
+		for (var i in this.multiple) {
+			var cell = this.datesCells[i];
+			var d = this.multiple[i];
+			if (!d)
+				continue;
+			if (cell)
+				cell.className += " selected";
+		}
+	}
+};
+
+Calendar.prototype._toggleMultipleDate = function(date) {
+	if (this.multiple) {
+		var ds = date.print("%Y%m%d");
+		var cell = this.datesCells[ds];
+		if (cell) {
+			var d = this.multiple[ds];
+			if (!d) {
+				Calendar.addClass(cell, "selected");
+				this.multiple[ds] = date;
+			} else {
+				Calendar.removeClass(cell, "selected");
+				delete this.multiple[ds];
+			}
+		}
+	}
+};
+
+Calendar.prototype.setDateToolTipHandler = function (unaryFunction) {
+	this.getDateToolTip = unaryFunction;
+};
+
+/**
+ *  Calls _init function above for going to a certain date (but only if the
+ *  date is different than the currently selected one).
+ */
+Calendar.prototype.setDate = function (date) {
+	if (!date.equalsTo(this.date)) {
+		this._init(this.firstDayOfWeek, date);
+	}
+};
+
+/**
+ *  Refreshes the calendar.  Useful if the "disabledHandler" function is
+ *  dynamic, meaning that the list of disabled date can change at runtime.
+ *  Just * call this function if you think that the list of disabled dates
+ *  should * change.
+ */
+Calendar.prototype.refresh = function () {
+	this._init(this.firstDayOfWeek, this.date);
+};
+
+/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */
+Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) {
+	this._init(firstDayOfWeek, this.date);
+	this._displayWeekdays();
+};
+
+/**
+ *  Allows customization of what dates are enabled.  The "unaryFunction"
+ *  parameter must be a function object that receives the date (as a JS Date
+ *  object) and returns a boolean value.  If the returned value is true then
+ *  the passed date will be marked as disabled.
+ */
+Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) {
+	this.getDateStatus = unaryFunction;
+};
+
+/** Customization of allowed year range for the calendar. */
+Calendar.prototype.setRange = function (a, z) {
+	this.minYear = a;
+	this.maxYear = z;
+};
+
+/** Calls the first user handler (selectedHandler). */
+Calendar.prototype.callHandler = function () {
+	if (this.onSelected) {
+		this.onSelected(this, this.date.print(this.dateFormat));
+	}
+};
+
+/** Calls the second user handler (closeHandler). */
+Calendar.prototype.callCloseHandler = function () {
+	if (this.onClose) {
+		this.onClose(this);
+	}
+	this.hideShowCovered();
+};
+
+/** Removes the calendar object from the DOM tree and destroys it. */
+Calendar.prototype.destroy = function () {
+	var el = this.element.parentNode;
+	el.removeChild(this.element);
+	Calendar._C = null;
+	window._dynarch_popupCalendar = null;
+};
+
+/**
+ *  Moves the calendar element to a different section in the DOM tree (changes
+ *  its parent).
+ */
+Calendar.prototype.reparent = function (new_parent) {
+	var el = this.element;
+	el.parentNode.removeChild(el);
+	new_parent.appendChild(el);
+};
+
+// This gets called when the user presses a mouse button anywhere in the
+// document, if the calendar is shown.  If the click was outside the open
+// calendar this function closes it.
+Calendar._checkCalendar = function(ev) {
+	var calendar = window._dynarch_popupCalendar;
+	if (!calendar) {
+		return false;
+	}
+	var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev);
+	for (; el != null && el != calendar.element; el = el.parentNode);
+	if (el == null) {
+		// calls closeHandler which should hide the calendar.
+		window._dynarch_popupCalendar.callCloseHandler();
+		return Calendar.stopEvent(ev);
+	}
+};
+
+/** Shows the calendar. */
+Calendar.prototype.show = function () {
+	var rows = this.table.getElementsByTagName("tr");
+	for (var i = rows.length; i > 0;) {
+		var row = rows[--i];
+		Calendar.removeClass(row, "rowhilite");
+		var cells = row.getElementsByTagName("td");
+		for (var j = cells.length; j > 0;) {
+			var cell = cells[--j];
+			Calendar.removeClass(cell, "hilite");
+			Calendar.removeClass(cell, "active");
+		}
+	}
+	this.element.style.display = "block";
+	this.hidden = false;
+	if (this.isPopup) {
+		window._dynarch_popupCalendar = this;
+		Calendar.addEvent(document, "keydown", Calendar._keyEvent);
+		Calendar.addEvent(document, "keypress", Calendar._keyEvent);
+		Calendar.addEvent(document, "mousedown", Calendar._checkCalendar);
+	}
+	this.hideShowCovered();
+};
+
+/**
+ *  Hides the calendar.  Also removes any "hilite" from the class of any TD
+ *  element.
+ */
+Calendar.prototype.hide = function () {
+	if (this.isPopup) {
+		Calendar.removeEvent(document, "keydown", Calendar._keyEvent);
+		Calendar.removeEvent(document, "keypress", Calendar._keyEvent);
+		Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar);
+	}
+	this.element.style.display = "none";
+	this.hidden = true;
+	this.hideShowCovered();
+};
+
+/**
+ *  Shows the calendar at a given absolute position (beware that, depending on
+ *  the calendar element style -- position property -- this might be relative
+ *  to the parent's containing rectangle).
+ */
+Calendar.prototype.showAt = function (x, y) {
+	var s = this.element.style;
+	s.left = x + "px";
+	s.top = y + "px";
+	this.show();
+};
+
+/** Shows the calendar near a given element. */
+Calendar.prototype.showAtElement = function (el, opts) {
+	var self = this;
+	var p = Calendar.getAbsolutePos(el);
+	if (!opts || typeof opts != "string") {
+		this.showAt(p.x, p.y + el.offsetHeight);
+		return true;
+	}
+	function fixPosition(box) {
+		if (box.x < 0)
+			box.x = 0;
+		if (box.y < 0)
+			box.y = 0;
+		var cp = document.createElement("div");
+		var s = cp.style;
+		s.position = "absolute";
+		s.right = s.bottom = s.width = s.height = "0px";
+		document.body.appendChild(cp);
+		var br = Calendar.getAbsolutePos(cp);
+		document.body.removeChild(cp);
+		if (Calendar.is_ie) {
+			br.y += document.body.scrollTop;
+			br.x += document.body.scrollLeft;
+		} else {
+			br.y += window.scrollY;
+			br.x += window.scrollX;
+		}
+		var tmp = box.x + box.width - br.x;
+		if (tmp > 0) box.x -= tmp;
+		tmp = box.y + box.height - br.y;
+		if (tmp > 0) box.y -= tmp;
+	};
+	this.element.style.display = "block";
+	Calendar.continuation_for_the_fucking_khtml_browser = function() {
+		var w = self.element.offsetWidth;
+		var h = self.element.offsetHeight;
+		self.element.style.display = "none";
+		var valign = opts.substr(0, 1);
+		var halign = "l";
+		if (opts.length > 1) {
+			halign = opts.substr(1, 1);
+		}
+		// vertical alignment
+		switch (valign) {
+		    case "T": p.y -= h; break;
+		    case "B": p.y += el.offsetHeight; break;
+		    case "C": p.y += (el.offsetHeight - h) / 2; break;
+		    case "t": p.y += el.offsetHeight - h; break;
+		    case "b": break; // already there
+		}
+		// horizontal alignment
+		switch (halign) {
+		    case "L": p.x -= w; break;
+		    case "R": p.x += el.offsetWidth; break;
+		    case "C": p.x += (el.offsetWidth - w) / 2; break;
+		    case "l": p.x += el.offsetWidth - w; break;
+		    case "r": break; // already there
+		}
+		p.width = w;
+		p.height = h + 40;
+		self.monthsCombo.style.display = "none";
+		fixPosition(p);
+		self.showAt(p.x, p.y);
+	};
+	if (Calendar.is_khtml)
+		setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10);
+	else
+		Calendar.continuation_for_the_fucking_khtml_browser();
+};
+
+/** Customizes the date format. */
+Calendar.prototype.setDateFormat = function (str) {
+	this.dateFormat = str;
+};
+
+/** Customizes the tooltip date format. */
+Calendar.prototype.setTtDateFormat = function (str) {
+	this.ttDateFormat = str;
+};
+
+/**
+ *  Tries to identify the date represented in a string.  If successful it also
+ *  calls this.setDate which moves the calendar to the given date.
+ */
+Calendar.prototype.parseDate = function(str, fmt) {
+	if (!fmt)
+		fmt = this.dateFormat;
+	this.setDate(Date.parseDate(str, fmt));
+};
+
+Calendar.prototype.hideShowCovered = function () {
+	if (!Calendar.is_ie && !Calendar.is_opera)
+		return;
+	function getVisib(obj){
+		var value = obj.style.visibility;
+		if (!value) {
+			if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C
+				if (!Calendar.is_khtml)
+					value = document.defaultView.
+						getComputedStyle(obj, "").getPropertyValue("visibility");
+				else
+					value = '';
+			} else if (obj.currentStyle) { // IE
+				value = obj.currentStyle.visibility;
+			} else
+				value = '';
+		}
+		return value;
+	};
+
+	var tags = new Array("applet", "iframe", "select");
+	var el = this.element;
+
+	var p = Calendar.getAbsolutePos(el);
+	var EX1 = p.x;
+	var EX2 = el.offsetWidth + EX1;
+	var EY1 = p.y;
+	var EY2 = el.offsetHeight + EY1;
+
+	for (var k = tags.length; k > 0; ) {
+		var ar = document.getElementsByTagName(tags[--k]);
+		var cc = null;
+
+		for (var i = ar.length; i > 0;) {
+			cc = ar[--i];
+
+			p = Calendar.getAbsolutePos(cc);
+			var CX1 = p.x;
+			var CX2 = cc.offsetWidth + CX1;
+			var CY1 = p.y;
+			var CY2 = cc.offsetHeight + CY1;
+
+			if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
+				if (!cc.__msh_save_visibility) {
+					cc.__msh_save_visibility = getVisib(cc);
+				}
+				cc.style.visibility = cc.__msh_save_visibility;
+			} else {
+				if (!cc.__msh_save_visibility) {
+					cc.__msh_save_visibility = getVisib(cc);
+				}
+				cc.style.visibility = "hidden";
+			}
+		}
+	}
+};
+
+/** Internal function; it displays the bar with the names of the weekday. */
+Calendar.prototype._displayWeekdays = function () {
+	var fdow = this.firstDayOfWeek;
+	var cell = this.firstdayname;
+	var weekend = Calendar._TT["WEEKEND"];
+	for (var i = 0; i < 7; ++i) {
+		cell.className = "day name";
+		var realday = (i + fdow) % 7;
+		if (i) {
+			cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]);
+			cell.navtype = 100;
+			cell.calendar = this;
+			cell.fdow = realday;
+			Calendar._add_evs(cell);
+		}
+		if (weekend.indexOf(realday.toString()) != -1) {
+			Calendar.addClass(cell, "weekend");
+		}
+		cell.innerHTML = Calendar._SDN[(i + fdow) % 7];
+		cell = cell.nextSibling;
+	}
+};
+
+/** Internal function.  Hides all combo boxes that might be displayed. */
+Calendar.prototype._hideCombos = function () {
+	this.monthsCombo.style.display = "none";
+	this.yearsCombo.style.display = "none";
+};
+
+/** Internal function.  Starts dragging the element. */
+Calendar.prototype._dragStart = function (ev) {
+	if (this.dragging) {
+		return;
+	}
+	this.dragging = true;
+	var posX;
+	var posY;
+	if (Calendar.is_ie) {
+		posY = window.event.clientY + document.body.scrollTop;
+		posX = window.event.clientX + document.body.scrollLeft;
+	} else {
+		posY = ev.clientY + window.scrollY;
+		posX = ev.clientX + window.scrollX;
+	}
+	var st = this.element.style;
+	this.xOffs = posX - parseInt(st.left);
+	this.yOffs = posY - parseInt(st.top);
+	with (Calendar) {
+		addEvent(document, "mousemove", calDragIt);
+		addEvent(document, "mouseup", calDragEnd);
+	}
+};
+
+// BEGIN: DATE OBJECT PATCHES
+
+/** Adds the number of days array to the Date object. */
+Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
+
+/** Constants used for time computations */
+Date.SECOND = 1000 /* milliseconds */;
+Date.MINUTE = 60 * Date.SECOND;
+Date.HOUR   = 60 * Date.MINUTE;
+Date.DAY    = 24 * Date.HOUR;
+Date.WEEK   =  7 * Date.DAY;
+
+Date.parseDate = function(str, fmt) {
+	var today = new Date();
+	var y = 0;
+	var m = -1;
+	var d = 0;
+	var a = str.split(/\W+/);
+	var b = fmt.match(/%./g);
+	var i = 0, j = 0;
+	var hr = 0;
+	var min = 0;
+	for (i = 0; i < a.length; ++i) {
+		if (!a[i])
+			continue;
+		switch (b[i]) {
+		    case "%d":
+		    case "%e":
+			d = parseInt(a[i], 10);
+			break;
+
+		    case "%m":
+			m = parseInt(a[i], 10) - 1;
+			break;
+
+		    case "%Y":
+		    case "%y":
+			y = parseInt(a[i], 10);
+			(y < 100) && (y += (y > 29) ? 1900 : 2000);
+			break;
+
+		    case "%b":
+		    case "%B":
+			for (j = 0; j < 12; ++j) {
+				if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; }
+			}
+			break;
+
+		    case "%H":
+		    case "%I":
+		    case "%k":
+		    case "%l":
+			hr = parseInt(a[i], 10);
+			break;
+
+		    case "%P":
+		    case "%p":
+			if (/pm/i.test(a[i]) && hr < 12)
+				hr += 12;
+			else if (/am/i.test(a[i]) && hr >= 12)
+				hr -= 12;
+			break;
+
+		    case "%M":
+			min = parseInt(a[i], 10);
+			break;
+		}
+	}
+	if (isNaN(y)) y = today.getFullYear();
+	if (isNaN(m)) m = today.getMonth();
+	if (isNaN(d)) d = today.getDate();
+	if (isNaN(hr)) hr = today.getHours();
+	if (isNaN(min)) min = today.getMinutes();
+	if (y != 0 && m != -1 && d != 0)
+		return new Date(y, m, d, hr, min, 0);
+	y = 0; m = -1; d = 0;
+	for (i = 0; i < a.length; ++i) {
+		if (a[i].search(/[a-zA-Z]+/) != -1) {
+			var t = -1;
+			for (j = 0; j < 12; ++j) {
+				if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; }
+			}
+			if (t != -1) {
+				if (m != -1) {
+					d = m+1;
+				}
+				m = t;
+			}
+		} else if (parseInt(a[i], 10) <= 12 && m == -1) {
+			m = a[i]-1;
+		} else if (parseInt(a[i], 10) > 31 && y == 0) {
+			y = parseInt(a[i], 10);
+			(y < 100) && (y += (y > 29) ? 1900 : 2000);
+		} else if (d == 0) {
+			d = a[i];
+		}
+	}
+	if (y == 0)
+		y = today.getFullYear();
+	if (m != -1 && d != 0)
+		return new Date(y, m, d, hr, min, 0);
+	return today;
+};
+
+/** Returns the number of days in the current month */
+Date.prototype.getMonthDays = function(month) {
+	var year = this.getFullYear();
+	if (typeof month == "undefined") {
+		month = this.getMonth();
+	}
+	if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) {
+		return 29;
+	} else {
+		return Date._MD[month];
+	}
+};
+
+/** Returns the number of day in the year. */
+Date.prototype.getDayOfYear = function() {
+	var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
+	var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0);
+	var time = now - then;
+	return Math.floor(time / Date.DAY);
+};
+
+/** Returns the number of the week in year, as defined in ISO 8601. */
+Date.prototype.getWeekNumber = function() {
+	var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0);
+	var DoW = d.getDay();
+	d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu
+	var ms = d.valueOf(); // GMT
+	d.setMonth(0);
+	d.setDate(4); // Thu in Week 1
+	return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1;
+};
+
+/** Checks date and time equality */
+Date.prototype.equalsTo = function(date) {
+	return ((this.getFullYear() == date.getFullYear()) &&
+		(this.getMonth() == date.getMonth()) &&
+		(this.getDate() == date.getDate()) &&
+		(this.getHours() == date.getHours()) &&
+		(this.getMinutes() == date.getMinutes()));
+};
+
+/** Set only the year, month, date parts (keep existing time) */
+Date.prototype.setDateOnly = function(date) {
+	var tmp = new Date(date);
+	this.setDate(1);
+	this.setFullYear(tmp.getFullYear());
+	this.setMonth(tmp.getMonth());
+	this.setDate(tmp.getDate());
+};
+
+/** Prints the date in a string according to the given format. */
+Date.prototype.print = function (str) {
+	var m = this.getMonth();
+	var d = this.getDate();
+	var y = this.getFullYear();
+	var wn = this.getWeekNumber();
+	var w = this.getDay();
+	var s = {};
+	var hr = this.getHours();
+	var pm = (hr >= 12);
+	var ir = (pm) ? (hr - 12) : hr;
+	var dy = this.getDayOfYear();
+	if (ir == 0)
+		ir = 12;
+	var min = this.getMinutes();
+	var sec = this.getSeconds();
+	s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N]
+	s["%A"] = Calendar._DN[w]; // full weekday name
+	s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N]
+	s["%B"] = Calendar._MN[m]; // full month name
+	// FIXME: %c : preferred date and time representation for the current locale
+	s["%C"] = 1 + Math.floor(y / 100); // the century number
+	s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31)
+	s["%e"] = d; // the day of the month (range 1 to 31)
+	// FIXME: %D : american date style: %m/%d/%y
+	// FIXME: %E, %F, %G, %g, %h (man strftime)
+	s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format)
+	s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format)
+	s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366)
+	s["%k"] = hr;		// hour, range 0 to 23 (24h format)
+	s["%l"] = ir;		// hour, range 1 to 12 (12h format)
+	s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12
+	s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59
+	s["%n"] = "\n";		// a newline character
+	s["%p"] = pm ? "PM" : "AM";
+	s["%P"] = pm ? "pm" : "am";
+	// FIXME: %r : the time in am/pm notation %I:%M:%S %p
+	// FIXME: %R : the time in 24-hour notation %H:%M
+	s["%s"] = Math.floor(this.getTime() / 1000);
+	s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59
+	s["%t"] = "\t";		// a tab character
+	// FIXME: %T : the time in 24-hour notation (%H:%M:%S)
+	s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn;
+	s["%u"] = w + 1;	// the day of the week (range 1 to 7, 1 = MON)
+	s["%w"] = w;		// the day of the week (range 0 to 6, 0 = SUN)
+	// FIXME: %x : preferred date representation for the current locale without the time
+	// FIXME: %X : preferred time representation for the current locale without the date
+	s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99)
+	s["%Y"] = y;		// year with the century
+	s["%%"] = "%";		// a literal '%' character
+
+	var re = /%./g;
+	if (!Calendar.is_ie5 && !Calendar.is_khtml)
+		return str.replace(re, function (par) { return s[par] || par; });
+
+	var a = str.match(re);
+	for (var i = 0; i < a.length; i++) {
+		var tmp = s[a[i]];
+		if (tmp) {
+			re = new RegExp(a[i], 'g');
+			str = str.replace(re, tmp);
+		}
+	}
+
+	return str;
+};
+
+Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear;
+Date.prototype.setFullYear = function(y) {
+	var d = new Date(this);
+	d.__msh_oldSetFullYear(y);
+	if (d.getMonth() != this.getMonth())
+		this.setDate(28);
+	this.__msh_oldSetFullYear(y);
+};
+
+// END: DATE OBJECT PATCHES
+
+
+// global object that remembers the calendar
+window._dynarch_popupCalendar = null;
diff -ruN 6171/e107_handlers/calendar/calendar-setup.js 75/e107_handlers/calendar/calendar-setup.js
--- 6171/e107_handlers/calendar/calendar-setup.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/calendar/calendar-setup.js	2005-03-30 13:34:38.000000000 -0600
@@ -0,0 +1,200 @@
+/*  Copyright Mihai Bazon, 2002, 2003  |  http://dynarch.com/mishoo/
+ * ---------------------------------------------------------------------------
+ *
+ * The DHTML Calendar
+ *
+ * Details and latest version at:
+ * http://dynarch.com/mishoo/calendar.epl
+ *
+ * This script is distributed under the GNU Lesser General Public License.
+ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
+ *
+ * This file defines helper functions for setting up the calendar.  They are
+ * intended to help non-programmers get a working calendar on their site
+ * quickly.  This script should not be seen as part of the calendar.  It just
+ * shows you what one can do with the calendar, while in the same time
+ * providing a quick and simple method for setting it up.  If you need
+ * exhaustive customization of the calendar creation process feel free to
+ * modify this code to suit your needs (this is recommended and much better
+ * than modifying calendar.js itself).
+ */
+
+// $Id: calendar-setup.js,v 1.1 2005/03/30 19:34:38 mcfly_e107 Exp $
+
+/**
+ *  This function "patches" an input field (or other element) to use a calendar
+ *  widget for date selection.
+ *
+ *  The "params" is a single object that can have the following properties:
+ *
+ *    prop. name   | description
+ *  -------------------------------------------------------------------------------------------------
+ *   inputField    | the ID of an input field to store the date
+ *   displayArea   | the ID of a DIV or other element to show the date
+ *   button        | ID of a button or other element that will trigger the calendar
+ *   eventName     | event that will trigger the calendar, without the "on" prefix (default: "click")
+ *   ifFormat      | date format that will be stored in the input field
+ *   daFormat      | the date format that will be used to display the date in displayArea
+ *   singleClick   | (true/false) wether the calendar is in single click mode or not (default: true)
+ *   firstDay      | numeric: 0 to 6.  "0" means display Sunday first, "1" means display Monday first, etc.
+ *   align         | alignment (default: "Br"); if you don't know what's this see the calendar documentation
+ *   range         | array with 2 elements.  Default: [1900, 2999] -- the range of years available
+ *   weekNumbers   | (true/false) if it's true (default) the calendar will display week numbers
+ *   flat          | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID
+ *   flatCallback  | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar)
+ *   disableFunc   | function that receives a JS Date object and should return true if that date has to be disabled in the calendar
+ *   onSelect      | function that gets called when a date is selected.  You don't _have_ to supply this (the default is generally okay)
+ *   onClose       | function that gets called when the calendar is closed.  [default]
+ *   onUpdate      | function that gets called after the date is updated in the input field.  Receives a reference to the calendar.
+ *   date          | the date that the calendar will be initially displayed to
+ *   showsTime     | default: false; if true the calendar will include a time selector
+ *   timeFormat    | the time format; can be "12" or "24", default is "12"
+ *   electric      | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close
+ *   step          | configures the step of the years in drop-down boxes; default: 2
+ *   position      | configures the calendar absolute position; default: null
+ *   cache         | if "true" (but default: "false") it will reuse the same calendar object, where possible
+ *   showOthers    | if "true" (but default: "false") it will show days from other months too
+ *
+ *  None of them is required, they all have default values.  However, if you
+ *  pass none of "inputField", "displayArea" or "button" you'll get a warning
+ *  saying "nothing to setup".
+ */
+Calendar.setup = function (params) {
+	function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } };
+
+	param_default("inputField",     null);
+	param_default("displayArea",    null);
+	param_default("button",         null);
+	param_default("eventName",      "click");
+	param_default("ifFormat",       "%Y/%m/%d");
+	param_default("daFormat",       "%Y/%m/%d");
+	param_default("singleClick",    true);
+	param_default("disableFunc",    null);
+	param_default("dateStatusFunc", params["disableFunc"]);	// takes precedence if both are defined
+	param_default("dateText",       null);
+	param_default("firstDay",       null);
+	param_default("align",          "Br");
+	param_default("range",          [1900, 2999]);
+	param_default("weekNumbers",    true);
+	param_default("flat",           null);
+	param_default("flatCallback",   null);
+	param_default("onSelect",       null);
+	param_default("onClose",        null);
+	param_default("onUpdate",       null);
+	param_default("date",           null);
+	param_default("showsTime",      false);
+	param_default("timeFormat",     "24");
+	param_default("electric",       true);
+	param_default("step",           2);
+	param_default("position",       null);
+	param_default("cache",          false);
+	param_default("showOthers",     false);
+	param_default("multiple",       null);
+
+	var tmp = ["inputField", "displayArea", "button"];
+	for (var i in tmp) {
+		if (typeof params[tmp[i]] == "string") {
+			params[tmp[i]] = document.getElementById(params[tmp[i]]);
+		}
+	}
+	if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) {
+		alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");
+		return false;
+	}
+
+	function onSelect(cal) {
+		var p = cal.params;
+		var update = (cal.dateClicked || p.electric);
+		if (update && p.inputField) {
+			p.inputField.value = cal.date.print(p.ifFormat);
+			if (typeof p.inputField.onchange == "function")
+				p.inputField.onchange();
+		}
+		if (update && p.displayArea)
+			p.displayArea.innerHTML = cal.date.print(p.daFormat);
+		if (update && typeof p.onUpdate == "function")
+			p.onUpdate(cal);
+		if (update && p.flat) {
+			if (typeof p.flatCallback == "function")
+				p.flatCallback(cal);
+		}
+		if (update && p.singleClick && cal.dateClicked)
+			cal.callCloseHandler();
+	};
+
+	if (params.flat != null) {
+		if (typeof params.flat == "string")
+			params.flat = document.getElementById(params.flat);
+		if (!params.flat) {
+			alert("Calendar.setup:\n  Flat specified but can't find parent.");
+			return false;
+		}
+		var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect);
+		cal.showsOtherMonths = params.showOthers;
+		cal.showsTime = params.showsTime;
+		cal.time24 = (params.timeFormat == "24");
+		cal.params = params;
+		cal.weekNumbers = params.weekNumbers;
+		cal.setRange(params.range[0], params.range[1]);
+		cal.setDateStatusHandler(params.dateStatusFunc);
+		cal.getDateText = params.dateText;
+		if (params.ifFormat) {
+			cal.setDateFormat(params.ifFormat);
+		}
+		if (params.inputField && typeof params.inputField.value == "string") {
+			cal.parseDate(params.inputField.value);
+		}
+		cal.create(params.flat);
+		cal.show();
+		return false;
+	}
+
+	var triggerEl = params.button || params.displayArea || params.inputField;
+	triggerEl["on" + params.eventName] = function() {
+		var dateEl = params.inputField || params.displayArea;
+		var dateFmt = params.inputField ? params.ifFormat : params.daFormat;
+		var mustCreate = false;
+		var cal = window.calendar;
+		if (dateEl)
+			params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt);
+		if (!(cal && params.cache)) {
+			window.calendar = cal = new Calendar(params.firstDay,
+							     params.date,
+							     params.onSelect || onSelect,
+							     params.onClose || function(cal) { cal.hide(); });
+			cal.showsTime = params.showsTime;
+			cal.time24 = (params.timeFormat == "24");
+			cal.weekNumbers = params.weekNumbers;
+			mustCreate = true;
+		} else {
+			if (params.date)
+				cal.setDate(params.date);
+			cal.hide();
+		}
+		if (params.multiple) {
+			cal.multiple = {};
+			for (var i = params.multiple.length; --i >= 0;) {
+				var d = params.multiple[i];
+				var ds = d.print("%Y%m%d");
+				cal.multiple[ds] = d;
+			}
+		}
+		cal.showsOtherMonths = params.showOthers;
+		cal.yearStep = params.step;
+		cal.setRange(params.range[0], params.range[1]);
+		cal.params = params;
+		cal.setDateStatusHandler(params.dateStatusFunc);
+		cal.getDateText = params.dateText;
+		cal.setDateFormat(dateFmt);
+		if (mustCreate)
+			cal.create();
+		cal.refresh();
+		if (!params.position)
+			cal.showAtElement(params.button || params.displayArea || params.inputField, params.align);
+		else
+			cal.showAt(params.position[0], params.position[1]);
+		return false;
+	};
+
+	return cal;
+};
diff -ruN 6171/e107_handlers/calendar/calendar-setup_stripped.js 75/e107_handlers/calendar/calendar-setup_stripped.js
--- 6171/e107_handlers/calendar/calendar-setup_stripped.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/calendar/calendar-setup_stripped.js	2005-03-30 13:34:38.000000000 -0600
@@ -0,0 +1,21 @@
+/*  Copyright Mihai Bazon, 2002, 2003  |  http://dynarch.com/mishoo/
+ * ---------------------------------------------------------------------------
+ *
+ * The DHTML Calendar
+ *
+ * Details and latest version at:
+ * http://dynarch.com/mishoo/calendar.epl
+ *
+ * This script is distributed under the GNU Lesser General Public License.
+ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
+ *
+ * This file defines helper functions for setting up the calendar.  They are
+ * intended to help non-programmers get a working calendar on their site
+ * quickly.  This script should not be seen as part of the calendar.  It just
+ * shows you what one can do with the calendar, while in the same time
+ * providing a quick and simple method for setting it up.  If you need
+ * exhaustive customization of the calendar creation process feel free to
+ * modify this code to suit your needs (this is recommended and much better
+ * than modifying calendar.js itself).
+ */
+ Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n  Nothing to setup (no fields found).  Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n  Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&&params.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;};
\ No newline at end of file
diff -ruN 6171/e107_handlers/calendar/calendar_stripped.js 75/e107_handlers/calendar/calendar_stripped.js
--- 6171/e107_handlers/calendar/calendar_stripped.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/calendar/calendar_stripped.js	2005-03-30 13:34:38.000000000 -0600
@@ -0,0 +1,14 @@
+/*  Copyright Mihai Bazon, 2002-2005  |  www.bazon.net/mishoo
+ * -----------------------------------------------------------
+ *
+ * The DHTML Calendar, version 1.0 "It is happening again"
+ *
+ * Details and latest version at:
+ * www.dynarch.com/projects/calendar
+ *
+ * This script is developed by Dynarch.com.  Visit us at www.dynarch.com.
+ *
+ * This script is distributed under the GNU Lesser General Public License.
+ * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html
+ */
+ Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.innerHTML=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)return false;removeClass(el,"hilite");if(el.caldate)removeClass(el.parentNode,"rowhilite");if(el.calendar)el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)cal._toggleMultipleDate(new Date(date));else newdate=!el.disabled;if(other_month)cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=new Date(cal.date);if(el.navtype==0)date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to <mihai_bazon@yahoo.com> to get it into the distribution  ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year<cal.maxYear){date.setFullYear(year+1);setMonth(0);}break;case 2:if(year<cal.maxYear){date.setFullYear(year+1);}break;case 100:cal.setFirstDayOfWeek(el.fdow);return;case 50:var range=el._range;var current=el.innerHTML;for(var i=range.length;--i>=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)newdate=closing=true;}if(newdate){ev&&cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="<div unselectable='on'>"+text+"</div>";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("&#x00d7;",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("&#x00ab;",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("&#x2039;",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("&#x203a;",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("&#x00bb;",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||"&nbsp;";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML="&nbsp;";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i<Calendar._MN.length;++i){var mn=Calendar.createElement("div");mn.className=Calendar.is_ie?"label-IEfix":"label";mn.month=i;mn.innerHTML=Calendar._SMN[i];div.appendChild(mn);}div=Calendar.createElement("div",this.element);this.yearsCombo=div;div.className="combo";for(i=12;i>0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)ne=cal.ar_days[y][x];else{x=6;K=38;continue;}break;case 38:if(--y>=0)ne=cal.ar_days[y][x];else{prevMonth();setVars();}break;case 39:if(++x<7)ne=cal.ar_days[y][x];else{x=0;K=40;continue;}break;case 40:if(++y<cal.ar_days.length)ne=cal.ar_days[y][x];else{nextMonth();setVars();}break;}break;}if(ne){if(!ne.disabled)Calendar.cellClick(ne);else if(prev)prevMonth();else nextMonth();}}break;case 13:if(act)Calendar.cellClick(cal.currentDateEl,ev);break;default:return false;}return Calendar.stopEvent(ev);};Calendar.prototype._init=function(firstDayOfWeek,date){var today=new Date(),TY=today.getFullYear(),TM=today.getMonth(),TD=today.getDate();this.table.style.visibility="hidden";var year=date.getFullYear();if(year<this.minYear){year=this.minYear;date.setFullYear(year);}else if(year>this.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML="&nbsp;";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)cell.title=toolTip;}if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&&current_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1)cell.className+=cell.otherMonth?" oweekend":" weekend";}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)continue;if(cell)cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "l":p.x+=el.offsetWidth-w;break;case "r":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2<EX1)||(CY1>EY2)||(CY2<EY1)){if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility=cc.__msh_save_visibility;}else{if(!cc.__msh_save_visibility){cc.__msh_save_visibility=getVisib(cc);}cc.style.visibility="hidden";}}}};Calendar.prototype._displayWeekdays=function(){var fdow=this.firstDayOfWeek;var cell=this.firstdayname;var weekend=Calendar._TT["WEEKEND"];for(var i=0;i<7;++i){cell.className="day name";var realday=(i+fdow)%7;if(i){cell.ttip=Calendar._TT["DAY_FIRST"].replace("%s",Calendar._DN[realday]);cell.navtype=100;cell.calendar=this;cell.fdow=realday;Calendar._add_evs(cell);}if(weekend.indexOf(realday.toString())!=-1){Calendar.addClass(cell,"weekend");}cell.innerHTML=Calendar._SDN[(i+fdow)%7];cell=cell.nextSibling;}};Calendar.prototype._hideCombos=function(){this.monthsCombo.style.display="none";this.yearsCombo.style.display="none";};Calendar.prototype._dragStart=function(ev){if(this.dragging){return;}this.dragging=true;var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posY=ev.clientY+window.scrollY;posX=ev.clientX+window.scrollX;}var st=this.element.style;this.xOffs=posX-parseInt(st.left);this.yOffs=posY-parseInt(st.top);with(Calendar){addEvent(document,"mousemove",calDragIt);addEvent(document,"mouseup",calDragEnd);}};Date._MD=new Array(31,28,31,30,31,30,31,31,30,31,30,31);Date.SECOND=1000;Date.MINUTE=60*Date.SECOND;Date.HOUR=60*Date.MINUTE;Date.DAY=24*Date.HOUR;Date.WEEK=7*Date.DAY;Date.parseDate=function(str,fmt){var today=new Date();var y=0;var m=-1;var d=0;var a=str.split(/\W+/);var b=fmt.match(/%./g);var i=0,j=0;var hr=0;var min=0;for(i=0;i<a.length;++i){if(!a[i])continue;switch(b[i]){case "%d":case "%e":d=parseInt(a[i],10);break;case "%m":m=parseInt(a[i],10)-1;break;case "%Y":case "%y":y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);break;case "%b":case "%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;else if(/am/i.test(a[i])&&hr>=12)hr-=12;break;case "%M":min=parseInt(a[i],10);break;}}if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i<a.length;++i){if(a[i].search(/[a-zA-Z]+/)!=-1){var t=-1;for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){t=j;break;}}if(t!=-1){if(m!=-1){d=m+1;}m=t;}}else if(parseInt(a[i],10)<=12&&m==-1){m=a[i]-1;}else if(parseInt(a[i],10)>31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0)y=today.getFullYear();if(m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i<a.length;i++){var tmp=s[a[i]];if(tmp){re=new RegExp(a[i],'g');str=str.replace(re,tmp);}}return str;};Date.prototype.__msh_oldSetFullYear=Date.prototype.setFullYear;Date.prototype.setFullYear=function(y){var d=new Date(this);d.__msh_oldSetFullYear(y);if(d.getMonth()!=this.getMonth())this.setDate(28);this.__msh_oldSetFullYear(y);};window._dynarch_popupCalendar=null;
\ No newline at end of file
Files 6171/e107_handlers/calendar/cal.gif and 75/e107_handlers/calendar/cal.gif differ
diff -ruN 6171/e107_handlers/calendar/language/English.js 75/e107_handlers/calendar/language/English.js
--- 6171/e107_handlers/calendar/language/English.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/calendar/language/English.js	2005-03-30 13:40:39.000000000 -0600
@@ -0,0 +1,127 @@
+// ** I18N
+
+// Calendar EN language
+// Author: Mihai Bazon, <mihai_bazon@yahoo.com>
+// Encoding: any
+// Distributed under the same terms as the calendar itself.
+
+// For translators: please use UTF-8 if possible.  We strongly believe that
+// Unicode is the answer to a real internationalized world.  Also please
+// include your contact information in the header, as can be seen above.
+
+// full day names
+Calendar._DN = new Array
+("Sunday",
+ "Monday",
+ "Tuesday",
+ "Wednesday",
+ "Thursday",
+ "Friday",
+ "Saturday",
+ "Sunday");
+
+// Please note that the following array of short day names (and the same goes
+// for short month names, _SMN) isn't absolutely necessary.  We give it here
+// for exemplification on how one can customize the short day names, but if
+// they are simply the first N letters of the full name you can simply say:
+//
+//   Calendar._SDN_len = N; // short day name length
+//   Calendar._SMN_len = N; // short month name length
+//
+// If N = 3 then this is not needed either since we assume a value of 3 if not
+// present, to be compatible with translation files that were written before
+// this feature.
+
+// short day names
+Calendar._SDN = new Array
+("Sun",
+ "Mon",
+ "Tue",
+ "Wed",
+ "Thu",
+ "Fri",
+ "Sat",
+ "Sun");
+
+// First day of the week. "0" means display Sunday first, "1" means display
+// Monday first, etc.
+Calendar._FD = 0;
+
+// full month names
+Calendar._MN = new Array
+("January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December");
+
+// short month names
+Calendar._SMN = new Array
+("Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec");
+
+// tooltips
+Calendar._TT = {};
+Calendar._TT["INFO"] = "About the calendar";
+
+Calendar._TT["ABOUT"] =
+"DHTML Date/Time Selector\n" +
+"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-)
+"For latest version visit: http://www.dynarch.com/projects/calendar/\n" +
+"Distributed under GNU LGPL.  See http://gnu.org/licenses/lgpl.html for details." +
+"\n\n" +
+"Date selection:\n" +
+"- Use the \xab, \xbb buttons to select year\n" +
+"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" +
+"- Hold mouse button on any of the above buttons for faster selection.";
+Calendar._TT["ABOUT_TIME"] = "\n\n" +
+"Time selection:\n" +
+"- Click on any of the time parts to increase it\n" +
+"- or Shift-click to decrease it\n" +
+"- or click and drag for faster selection.";
+
+Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)";
+Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)";
+Calendar._TT["GO_TODAY"] = "Go Today";
+Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)";
+Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)";
+Calendar._TT["SEL_DATE"] = "Select date";
+Calendar._TT["DRAG_TO_MOVE"] = "Drag to move";
+Calendar._TT["PART_TODAY"] = " (today)";
+
+// the following is to inform that "%s" is to be the first day of week
+// %s will be replaced with the day name.
+Calendar._TT["DAY_FIRST"] = "Display %s first";
+
+// This may be locale-dependent.  It specifies the week-end days, as an array
+// of comma-separated numbers.  The numbers are from 0 to 6: 0 means Sunday, 1
+// means Monday, etc.
+Calendar._TT["WEEKEND"] = "0,6";
+
+Calendar._TT["CLOSE"] = "Close";
+Calendar._TT["TODAY"] = "Today";
+Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value";
+
+// date formats
+Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d";
+Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e";
+
+Calendar._TT["WK"] = "wk";
+Calendar._TT["TIME"] = "Time:";
Files 6171/e107_handlers/calendar/menuarrow2.gif and 75/e107_handlers/calendar/menuarrow2.gif differ
Files 6171/e107_handlers/calendar/menuarrow.gif and 75/e107_handlers/calendar/menuarrow.gif differ
diff -ruN 6171/e107_handlers/calendar/sample.php 75/e107_handlers/calendar/sample.php
--- 6171/e107_handlers/calendar/sample.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/calendar/sample.php	2005-03-30 13:34:38.000000000 -0600
@@ -0,0 +1,49 @@
+<?php
+require_once('../../class2.php');
+require_once(e_HANDLER."calendar/calendar_class.php");
+$cal = new DHTML_Calendar(true);
+function headerjs()
+{
+	global $cal;
+	return $cal->load_files();
+}
+require_once(HEADERF);
+
+echo "
+<table style='border:2px solid'>
+<tr>
+<td>
+";
+echo $cal->make_input_field(
+           // calendar options go here; see the documentation and/or calendar-setup.js
+           array('firstDay'       => 1, // show Monday first
+                 'showsTime'      => true,
+                 'showOthers'     => true,
+                 'ifFormat'       => '%Y/%m/%d %I:%M %P',
+                 'weekNumbers'    => false,
+                 'timeFormat'     => '12'),
+           // field attributes go here
+           array('style'       => 'color: #840; background-color: #ff8; border: 1px solid #000; text-align: center',
+                 'name'        => 'date1',
+                 'value'       => strftime('%Y/%m/%d %I:%M %P', strtotime('now'))));
+
+
+echo "</td></tr><tr><td>";
+unset($cal_options);
+unset($cal_attrib);
+$cal_options['firstDay'] = 0;
+$cal_options['showsTime'] = false;
+$cal_options['showOthers'] = false;
+$cal_options['weekNumbers'] = true;
+$cal_attrib['class'] = "tbox";
+$cal_attrib['name'] = "date2";
+$cal_attrib['value'] = "[select date]";
+echo $cal->make_input_field($cal_options, $cal_attrib);
+echo "
+</td>
+</tr>
+</table>
+";
+require_once(FOOTERF);
+                 
+?>
diff -ruN 6171/e107_handlers/comment_class.php 75/e107_handlers/comment_class.php
--- 6171/e107_handlers/comment_class.php	2004-09-06 02:51:40.000000000 -0500
+++ 75/e107_handlers/comment_class.php	2006-05-13 10:05:38.000000000 -0500
@@ -1,271 +1,561 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /classes/comment_class.php
-|
-|        Steve Dunstan 2001-2002
-|        http://jalist.com
-|        stevedunstan@jalist.com
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-@include(e_LANGUAGEDIR.e_LANGUAGE."/lan_comment.php");
-@include(e_LANGUAGEDIR."English/lan_comment.php");
-class comment{
-
-        function form_comment($action, $table, $id, $subject, $content_type){
-                global $pref;
-                require_once(e_HANDLER."ren_help.php");
-                if(ANON == TRUE || USER == TRUE){
-                        $ns = new e107table;
-                        if($action == "reply" && substr($subject, 0, 4) != "Re: "){
-                                $subject = "Re: ".$subject;
-                        }
-                        $text = "\n<div style='text-align:center'><form method='post' action='".e_SELF."?".e_QUERY."' id='dataform' >\n<table style='width:95%'>";
-                        if($pref['nested_comments']){
-                                $text .= "<tr>\n<td style='width:20%'>Subject</td>\n<td style='width:80%'>\n<input class='tbox' type='text' name='subject' size='60' value='$subject' maxlength='100' />\n</td>\n</tr>";
-                        }else{
-                                $text2 = "<input  type='hidden' name='subject' value='$subject'  />\n";
-                        }
-                        if(ANON == TRUE && USER == FALSE){
-                                $text .= "<tr>\n<td style='width:20%'>".LAN_16."</td>\n<td style='width:80%'>\n<input class='tbox' type='text' name='author_name' size='60' value='$author_name' maxlength='100' />\n</td>\n</tr>";
-                        }
-                        $text .= "<tr> \n<td style='width:20%'>".LAN_8.":</td>\n<td style='width:80%'>\n<textarea class='tbox' name='comment' cols='70' rows='10' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea>\n<br />
-                        <input class='helpbox' type='text' name='helpb' size='100' /><br />".ren_help(1,'addtext','help')."</td></tr>\n<tr style='vertical-align:top'> \n<td style='width:20%'>".$text2."</td>\n<td style='width:80%'>\n".
-                        ($action == "reply" ? "<input type='hidden' name='pid' value='$id' />" : "").($content_type  ? "<input type='hidden' name='content_type' value='$content_type' />" : "").
-                                "<input class='button' type='submit' name='".$action."submit' value='".LAN_9."' />\n</td>\n</tr>\n</table>\n</form></div>";
-                        $ns -> tablerender("", $text);
-                }else{
-                        echo "<br /><div style='text-align:center'><b>".LAN_6." <a href='".e_SIGNUP."'>".COMLAN_1."</a> ".COMLAN_2."</b></div>";
-                }
-        }
-
-        function render_comment($row, $table, $action, $id, $width, $subject){
-                global $COMMENTSTYLE, $pref, $aj;
-                require_once(e_HANDLER."level_handler.php");
-                if(!$width){$width = 0;}
-                define("IMAGE_nonew_comments", (file_exists(THEME."forum/nonew_comments.png") ? "<img src='".THEME."forum/nonew_comments.png' alt=''  /> " : "<img src='".e_IMAGE."generic/nonew_comments.png' alt=''  />"));
-                define("IMAGE_new_comments", (file_exists(THEME."forum/new_comments.png") ? "<img src='".THEME."forum/new_comments.png' alt=''  /> " : "<img src='".e_IMAGE."generic/new_comments.png' alt=''  /> "));
-                $sql = new db;
-                $ns = new e107table;
-                extract($row);
-                $comment_author = eregi_replace("[0-9]+\.", "", $comment_author);
-                $comment_subject = (empty($comment_subject) ? $subject : $aj -> tpa($comment_subject));
-                $gen = new convert; $datestamp = $gen->convert_date($comment_datestamp, "short");
-                if($sql -> db_Select("user", "*", "user_name='$comment_author'")){
-                        $row = $sql -> db_Fetch();
-                        extract($row);
-                        if($user_image){
-                                require_once(e_HANDLER."avatar_handler.php");
-                                $user_image = avatar($user_image);
-                        }
-                }else{
-                        $user_id = 0;
-                        $user_name = $comment_author;
-                }
-
-                $user_join = $gen->convert_date($user_join, "short");
-
-                $url = e_PAGE."?".e_QUERY;
-
-                $unblock = "[<a href='".e_BASE.e_ADMIN."comment.php?unblock-$comment_id-$url-$comment_item_id'>".LAN_1."</a>] ";
-                $block = "[<a href='".e_BASE.e_ADMIN."comment.php?block-$comment_id-$url-$comment_item_id'>".LAN_2."</a>] ";
-                $delete = "[<a href='".e_BASE.e_ADMIN."comment.php?delete-$comment_id-$url-$comment_item_id'>".LAN_3."</a>] ";
-                $userinfo = "[<a href='".e_BASE.e_ADMIN."userinfo.php?$comment_ip'>".LAN_4."</a>]";
-
-                if(!$COMMENTSTYLE){
-                        $COMMENTSTYLE = "
-<table style='width:100%'>
-<tr>
-<td colspan='2' class='forumheader3'>
-{SUBJECT}
-<b>
-{USERNAME}
-</b>
-|
-{TIMEDATE}
-</td>
-</tr>
-<tr>
-<td style='width:30%; vertical-align:top'>
-<div class='spacer'>
-{AVATAR}
-</div>
-<span class='smalltext'>
-{COMMENTS}
-<br />
-{JOINED}
-</span>
-<br/>
-{REPLY}
-</td>
-<td style='width:70%; vertical-align:top'>
-{COMMENT}
-</td>
-</tr>
-</table>
-<br />";
-                }
-                if($pref['nested_comments']){
-                        $width2 = 100 - $width;
-                        $total_width = ($pref['standards_mode'] ? "98%" : "95%");
-                        $renderstyle = "
-<table style='width:".$total_width."'>
-<tr>
-<td style='width:".$width."%' ></td>
-<td style='width:".$width2."%'>"
-.$COMMENTSTYLE.
-"
-</td>
-</tr>
-</table>";
-                        if($comment_datestamp > USERLV ){
-                                $NEWIMAGE = IMAGE_new_comments;
-                        }else{
-                                $NEWIMAGE = IMAGE_nonew_comments;
-                        }
-                }else{
-                        $renderstyle = $COMMENTSTYLE;
-                }
-
-                $aj = new textparse;
-                $search[0] = "/\{USERNAME\}(.*?)/si";
-                $replace[0] = ($user_id ? "<a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>\n" : $user_name."\n");
-
-                $search[1] = "/\{TIMEDATE\}(.*?)/si";
-                $replace[1] = $datestamp;
-
-                $search[2] = "/\{AVATAR\}(.*?)/si";
-                $replace[2] = ($user_image ? "<div class='spacer'><img src='".$user_image."' alt='' /></div><br />" : "");
-
-                $search[3] = "/\{COMMENTS\}(.*?)/si";
-                $replace[3] = ($user_id ? LAN_99.": ".$user_comments : LAN_194)."<br />";
-
-                $highlight_search = FALSE;
-                if(IsSet($_POST['highlight_search'])){
-                        $highlight_search = TRUE;
-                }
-
-                $search[4] = "/\{COMMENT\}(.*?)/si";
-                $replace[4] = ($comment_blocked ? LAN_0 : preg_quote($aj -> tpa($comment_comment, "off", "public", $highlight_search)));
-
-                $search[5] = "/\{SIGNATURE\}(.*?)/si";
-                if($user_signature){
-//                        $user_signature = preg_replace("/\[img\](.*?)\[\/img\]/si", "\\1", $user_signature);
-//                        $user_signature = "[ ".$aj -> tpa($user_signature)." ]"; // uncomment if you want images removed from signatures
-
-                        $user_signature = $aj -> tpa($user_signature);
-                }
-                $replace[5] = $user_signature;
-
-                $search[6] = "/\{JOINED\}(.*?)/si";
-                if($user_admin){
-                        $replace[6] = "";
-                }else{
-                        $replace[6] = ($user_join != "01 Jan : 00:00" && $user_join != "31 Dec : 19:00" ? LAN_145.$user_join."<br />" : "");
-                }
-
-                $search[7] = "/\{LOCATION\}(.*?)/si";
-                $replace[7] = ($user_location ? LAN_313.": ".$aj -> tpa($user_location) : "");
-
-                $search[8] = "/\{LEVEL\}(.*?)/si";
-                define("IMAGE_rank_main_admin_image", ($pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "<img src='".THEME."forum/".$pref['rank_main_admin_image']."' alt='' />" : "<img src='".e_IMAGE."forum/main_admin.png' alt='' />"));
-                define("IMAGE_rank_moderator_image", ($pref['rank_moderator_image'] && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "<img src='".THEME."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_IMAGE."forum/admin.png' alt='' />"));
-                define("IMAGE_rank_admin_image", ($pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "<img src='".THEME."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_IMAGE."forum/admin.png' alt='' />"));
-                $ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
-                $replace[8] = ($user_admin ? $ldata[0] : $ldata[1]);
-
-                        $search[9] = "/\{REPLY\}(.*?)/si";
-                if($action == "comment" && $pref['nested_comments']){
-                        $replace[9] = "<a href='".e_BASE."comment.php?reply.".$table.".".$comment_id.".".$id."'>Reply to this</a>";
-                }else{
-                        $replace[9] = "";
-                }
-
-
-
-                $search[10] = "/\{SUBJECT\}(.*?)/si";
-                if($pref['nested_comments']){
-                        $replace[10] = $NEWIMAGE." <b>".$comment_subject."</b>";
-                }else{
-                        $replace[10] = "";
-                }
-
-
-                $text .= preg_replace($search, $replace, $renderstyle);
-                if($action == "comment" && $pref['nested_comments']){
-                        $sub_query = "comment_pid='".$comment_id."' ORDER BY comment_datestamp" ;
-                                $sql2 = new db;
-                                if($sub_total = $sql2 -> db_Select("comments", "*",  "".$sub_query."")){
-                                                        while($row = $sql2 -> db_Fetch()){
-                                        if($pref['nested_comments']){$width = $width + 3;if($width >80){$width =80;}}
-                                        $text .= $this -> render_comment($row, $table, $action, $id, $width);
-                                                        }
-                                        $total ++;
-                                }
-                }
-                return stripslashes($text);
-        }
-
-        function enter_comment($author_name, $comment, $table, $id, $pid, $subject){
-                global $sql, $aj;
-                if(!is_object($aj)){ $aj = new textparse; }
-
-                switch($table){
-                        case "news": $type=0; break;
-                        case "content" : $type=1; break;
-                        case "download" : $type=2; break;
-                        case "faq" : $type=3; break;
-                        case "poll" : $type=4; break;
-                        case "docs" : $type=5; break;
-                        case "bugtrack" : $type=6; break;
-                        /****************************************
-                        Add your comment type here in same format as above, ie ...
-                        case "your_comment_type"; $type = your_type_id; break;
-                        ****************************************/
-                }
-                if(!Isset($type)){
-                        $type = $table;
-                }
-
-                $comment = $aj -> formtpa($comment, "public");
-                $subject = $aj -> formtpa($subject, "public");
-                if(!$sql -> db_Select("comments", "*", "comment_comment='".$comment."' AND comment_item_id='$id' AND comment_type='$type' ")){
-                        if($_POST['comment']){
-                                if(USER == TRUE){
-                                        $nick = USERID.".".USERNAME;
-                                        $sql -> db_Update("user", "user_comments=user_comments+1, user_lastpost='".time()."' WHERE user_id='".USERID."' ");
-                                }else if($_POST['author_name'] == ""){
-                                        $nick = "0.Anonymous";
-                                }else{
-                                        $sql2 = new db;
-                                        if($sql2 -> db_Select("user", "*", "user_name='".$_POST['author_name']."' ")){
-                                                $ip = getip();
-                                                if($sql2 -> db_Select("user", "*", "user_name='".$_POST['author_name']."' AND user_ip='$ip' ")){
-                                                        list($cuser_id, $cuser_name) = $sql2-> db_Fetch();
-                                                        $nick = $cuser_id.".".$cuser_name;
-                                                }else{
-                                                        define("emessage", LAN_310);
-                                                }
-                                        }else{
-                                                $nick = "0.".$aj -> formtpa($author_name, "public");
-                                        }
-                                }
-                                if(!defined("emessage")){
-                                        if(!$sql -> db_Insert("comments", "0, '$pid', '$id', '$subject', '$nick', '', '".time()."', '$comment', '0', '$ip', '$type' ")){
-                                                echo "<b>".COMLAN_3."</b> ".LAN_11;
-                                        }else{
-                                                clear_cache("comment");
-                                        }
-                                }
-                        }
-                }else{
-                        define("emessage", LAN_312);
-                }
-        }
-}
-
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/comment_class.php,v $
+|     $Revision: 1.58 $
+|     $Date: 2006/05/13 15:05:38 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_comment.php");
+@include_once(e_LANGUAGEDIR."English/lan_comment.php");
+require_once(e_FILE."shortcode/batch/comment_shortcodes.php");
+
+/**
+ * Enter description here...
+ *
+ */
+class comment {
+
+	/**
+	 * Enter description here...
+	 *
+	 * @param unknown_type $action
+	 * @param unknown_type $table
+	 * @param unknown_type $id
+	 * @param unknown_type $subject
+	 * @param unknown_type $content_type
+	 * @param unknown_type $return
+	 * @param unknown_type $rating
+	 * @return unknown
+	 */
+	function form_comment($action, $table, $id, $subject, $content_type, $return=FALSE, $rating=FALSE, $tablerender=TRUE)
+	{
+		//rating	: boolean, to show rating system in comment
+		global $pref, $sql, $tp;
+		if(isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE){
+        	return;
+		}
+
+		require_once(e_HANDLER."ren_help.php");
+		if (ANON == TRUE || USER == TRUE)
+		{
+			$itemid = $id;
+			$ns = new e107table;
+			if ($action == "reply" && substr($subject, 0, 4) != "Re: ")
+			{
+				$subject = COMLAN_5.' '.$subject;
+			}
+
+			$text = "\n<div style='text-align:center'><form method='post' action='".e_SELF."?".e_QUERY."' id='dataform' >\n<table style='width:100%'>";
+
+			if ($pref['nested_comments'])
+			{
+				$text .= "<tr>\n<td style='width:20%'>".COMLAN_4."</td>\n<td style='width:80%'>\n<input class='tbox' type='text' name='subject' size='61' value='".$tp -> toForm($subject)."' maxlength='100' />\n</td>\n</tr>";
+				$text2 = "";
+			}
+			else
+			{
+				$text2 = "<input type='hidden' name='subject' value='".$tp -> toForm($subject)."'  />\n";
+			}
+
+			if(strstr(e_QUERY, "edit"))
+			{
+				$eaction = "edit";
+				$tmp = explode(".", e_QUERY);
+				$count = 0;
+
+				foreach($tmp as $t)
+				{
+					if($t == "edit")
+					{
+						$id = $tmp[($count+1)];
+						break;
+					}
+					$count++;
+				}
+			}
+
+			if(isset($eaction) && $eaction == "edit")
+			{
+				$id=intval($id);
+				$sql -> db_Select("comments", "*", "comment_id='$id' ");
+				$ecom = $sql -> db_Fetch();
+				list($prid, $pname) = explode(".", $ecom['comment_author']);
+
+				if($prid != USERID || !USER)
+				{
+					echo "<div style='text-align: center;'>Unauthorized</div>";
+					require_once(FOOTERF);
+					exit;
+				}
+
+				$caption = LAN_318;
+				$comval = $tp -> toFORM($ecom['comment_comment']);
+				$comval = preg_replace("#\[ ".LAN_319.".*\]#si", "", $comval);
+			}
+			else
+			{
+				$caption = LAN_9;
+				$comval = "";
+			}
+
+			//add the rating select box/result ?
+			$rate = "";
+			if($rating == TRUE && !(ANON == TRUE && USER == FALSE) )
+			{
+				global $rater;
+				require_once(e_HANDLER."rate_class.php");
+				if(!is_object($rater)){ $rater = new rater; }
+				$rate = $rater -> composerating($table, $itemid, $enter=TRUE, USERID, TRUE);
+				$rate = "<tr><td style='width:20%; vertical-align:top;'>".COMLAN_7.":</td>\n<td style='width:80%;'>".$rate."</td></tr>\n";
+			}
+			//end rating area
+
+			if (ANON == TRUE && USER == FALSE)
+			{
+				$text .= "<tr>\n<td style='width:20%; vertical-align:top;'>".LAN_16."</td>\n<td style='width:80%'>\n<input class='tbox' type='text' name='author_name' size='61' value='$author_name' maxlength='100' />\n</td>\n</tr>";
+			}
+			$text .= $rate."<tr> \n
+			<td style='width:20%; vertical-align:top;'>".LAN_8.":</td>\n<td id='commentform' style='width:80%;'>\n<textarea class='tbox' name='comment' cols='62' rows='7' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$comval</textarea>\n<br />
+			<input class='helpbox' type='text' name='helpb' style='width:80%' /><br />".ren_help(1, 'addtext', 'help')."</td></tr>\n<tr style='vertical-align:top'> \n<td style='width:20%'>".$text2."</td>\n<td id='commentformbutton' style='width:80%;'>\n". (isset($action) && $action == "reply" ? "<input type='hidden' name='pid' value='$id' />" : '').(isset($eaction) && $eaction == "edit" ? "<input type='hidden' name='editpid' value='$id' />" : "").(isset($content_type) && $content_type ? "<input type='hidden' name='content_type' value='$content_type' />" : ''). "<input class='button' type='submit' name='".$action."submit' value='".(isset($eaction) && $eaction == "edit" ? LAN_320 : LAN_9)."' />\n</td>\n</tr>\n</table>\n</form></div>";
+
+			if($tablerender)
+			{
+				$text = $ns->tablerender($caption, $text, '', TRUE);
+			}
+
+			if($return)
+			{
+				return $text;
+			}
+			else
+			{
+				echo $text;
+			}
+		}
+		else
+		{
+			echo "<br /><div style='text-align:center'><b>".LAN_6." <a href='".e_SIGNUP."'>".COMLAN_1."</a> ".COMLAN_2."</b></div>";
+		}
+	}
+
+	/**
+	 * Enter description here...
+	 *
+	 * @param unknown_type $row
+	 * @param unknown_type $table
+	 * @param unknown_type $action
+	 * @param unknown_type $id
+	 * @param unknown_type $width
+	 * @param unknown_type $subject
+	 * @param unknown_type $addrating
+	 * @return unknown
+	 */
+	function render_comment($row, $table, $action, $id, $width, $subject, $addrating=FALSE) {
+		//addrating	: boolean, to show rating system in rendered comment
+		global $sql, $sc_style, $comment_shortcodes, $COMMENTSTYLE, $rater, $gen;
+		global $pref, $comrow, $tp, $NEWIMAGE, $USERNAME, $RATING, $datestamp;
+		global $thisaction, $thistable, $thisid;
+
+		if(isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE){
+        	return;
+		}
+
+
+		$comrow				= $row;
+		$thistable			= $table;
+		$thisid				= $id;
+		$thisaction			= $action;
+
+		if($addrating===TRUE){
+			require_once(e_HANDLER."rate_class.php");
+			if(!$rater || !is_object($rater)){ $rater = new rater; }
+		}
+
+		require_once(e_HANDLER."level_handler.php");
+		if (!$width) {
+			$width = 0;
+		}
+		if(!defined("IMAGE_nonew_comments")){
+			define("IMAGE_nonew_comments", (file_exists(THEME."generic/nonew_comments.png") ? "<img src='".THEME_ABS."generic/nonew_comments.png' alt=''  /> " : "<img src='".e_IMAGE_ABS."generic/".IMODE."/nonew_comments.png' alt=''  />"));
+		}
+		if(!defined("IMAGE_new_comments")){
+			define("IMAGE_new_comments", (file_exists(THEME."generic/new_comments.png") ? "<img src='".THEME_ABS."generic/new_comments.png' alt=''  /> " : "<img src='".e_IMAGE_ABS."generic/".IMODE."/new_comments.png' alt=''  /> "));
+		}
+		$ns			= new e107table;
+		if(!$gen || !is_object($gen)){ $gen = new convert; }
+		$url		= e_PAGE."?".e_QUERY;
+		$unblock	= "[<a href='".e_ADMIN_ABS."comment.php?unblock-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".LAN_1."</a>] ";
+		$block		= "[<a href='".e_ADMIN_ABS."comment.php?block-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".LAN_2."</a>] ";
+		$delete		= "[<a href='".e_ADMIN_ABS."comment.php?delete-".$comrow['comment_id']."-$url-".$comrow['comment_item_id']."'>".LAN_3."</a>] ";
+		$userinfo	= "[<a href='".e_ADMIN_ABS."userinfo.php?".$comrow['comment_ip']."'>".LAN_4."</a>]";
+
+		if (!$COMMENTSTYLE) {
+			global $THEMES_DIRECTORY;
+			$COMMENTSTYLE = "";
+			if (file_exists(THEME."comment_template.php")) {
+				require_once(THEME."comment_template.php");
+			} else {
+				require_once(e_BASE.$THEMES_DIRECTORY."templates/comment_template.php");
+			}
+		}
+		if ($pref['nested_comments']) {
+			$width2 = 100 - $width;
+			$total_width = (isset($pref['standards_mode']) && $pref['standards_mode'] ? "98%" : "95%");
+			if($width){
+				$renderstyle = "
+				<table style='width:".$total_width."' border='0'>
+				<tr>
+				<td style='width:".$width."%' ></td>
+				<td style='width:".$width2."%'>" .$COMMENTSTYLE. "
+				</td>
+				</tr>
+				</table>";
+			}else{
+				$renderstyle = $COMMENTSTYLE;
+			}
+			if($pref['comments_icon']) {
+				if ($comrow['comment_datestamp'] > USERLV ) {
+					$NEWIMAGE = IMAGE_new_comments;
+				} else {
+					$NEWIMAGE = IMAGE_nonew_comments;
+				}
+			} else {
+				$NEWIMAGE = "";
+			}
+		} else {
+			$renderstyle = $COMMENTSTYLE;
+		}
+
+		$highlight_search = FALSE;
+		if (isset($_POST['highlight_search'])) {
+			$highlight_search = TRUE;
+		}
+
+		if(!defined("IMAGE_rank_main_admin_image")){
+			define("IMAGE_rank_main_admin_image", (isset($pref['rank_main_admin_image']) && $pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_main_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/main_admin.png' alt='' />"));
+		}
+		if(!defined("IMAGE_rank_moderator_image")){
+			define("IMAGE_rank_moderator_image", (isset($pref['rank_moderator_image']) && $pref['rank_moderator_image'] && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_moderator_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/admin.png' alt='' />"));
+		}
+		if(!defined("IMAGE_rank_admin_image")){
+			define("IMAGE_rank_admin_image", (isset($pref['rank_admin_image']) && $pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/admin.png' alt='' />"));
+		}
+
+		$RATING = ($addrating==TRUE && $comrow['user_id'] ? $rater->composerating($thistable, $thisid, FALSE, $comrow['user_id']) : "");
+
+		$text = $tp -> parseTemplate($renderstyle, TRUE, $comment_shortcodes);
+
+		if ($action == "comment" && $pref['nested_comments']) {
+
+			$type = $this -> getCommentType($thistable);
+			$sub_query = "
+			SELECT c.*, u.*, ue.*
+			FROM #comments AS c
+			LEFT JOIN #user AS u ON c.comment_author = u.user_id
+			LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
+			WHERE comment_item_id='".intval($thisid)."' AND comment_type='".$tp -> toDB($type, true)."' AND comment_pid='".intval($comrow['comment_id'])."'
+			ORDER BY comment_datestamp
+			";
+
+			$sql2 = new db;	/* a new db must be created here, for nested comment  */
+			if ($sub_total = $sql2->db_Select_gen($sub_query)) {
+				while ($row1 = $sql2->db_Fetch()) {
+					if ($pref['nested_comments']) {
+						$width = $width + 3;
+						if ($width > 80) {
+							$width = 80;
+						}
+					}
+					$text .= $this->render_comment($row1, $table, $action, $id, $width, $subject, $addrating);
+					unset($width);
+				}
+			}
+		}
+		//echo $text;
+		return stripslashes($text);
+	}
+
+	/**
+	 * Enter description here...
+	 *
+	 * @param unknown_type $author_name
+	 * @param unknown_type $comment
+	 * @param unknown_type $table
+	 * @param unknown_type $id
+	 * @param unknown_type $pid
+	 * @param unknown_type $subject
+	 * @param unknown_type $rateindex
+	 */
+	function enter_comment($author_name, $comment, $table, $id, $pid, $subject, $rateindex=FALSE) {
+		//rateindex	: the posted value from the rateselect box (without the urljump) (see function rateselect())
+		global $sql, $sql2, $tp, $e107cache, $e_event, $e107, $pref, $rater;
+
+		if(isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE){
+        	return;
+		}
+
+		if(strstr(e_QUERY, "edit"))
+		{
+			$eaction = "edit";
+			$tmp = explode(".", e_QUERY);
+			$count = 0;
+			foreach($tmp as $t)
+			{
+				if($t == "edit")
+				{
+					$editpid = $tmp[($count+1)];
+					break;
+				}
+				$count++;
+			}
+		}
+
+		$type = $this -> getCommentType($table);
+
+		$comment = $tp->toDB($comment);
+		$subject = $tp->toDB($subject);
+		if (!$sql->db_Select("comments", "*", "comment_comment='".$comment."' AND comment_item_id='".intval($id)."' AND comment_type='".$tp -> toDB($type, true)."' ")) {
+			if ($_POST['comment']) {
+				if (USER == TRUE) {
+					$nick = USERID.".".USERNAME;
+				} else if($_POST['author_name'] == '') {
+					$nick = "0.Anonymous";
+				} else {
+					if ($sql2->db_Select("user", "*", "user_name='".$tp -> toDB($_POST['author_name'])."' ")) {
+						if ($sql2->db_Select("user", "*", "user_name='".$tp -> toDB($_POST['author_name'])."' AND user_ip='".$tp -> toDB($ip, true)."' ")) {
+							list($cuser_id, $cuser_name) = $sql2->db_Fetch();
+							$nick = $cuser_id.".".$cuser_name;
+						} else {
+							define("emessage", LAN_310);
+						}
+					} else {
+						$nick = "0.".$tp->toDB($author_name);
+					}
+				}
+
+				if (!defined("emessage"))
+				{
+					$ip = $e107->getip();
+					require_once(e_HANDLER."encrypt_handler.php");
+					$ip = encode_ip($ip);
+					$_t = time();
+
+					if($editpid)
+					{
+						$comment .= "\n[ ".LAN_319." [time=short]".time()."[/time] ]";
+						$sql -> db_Update("comments", "comment_comment='$comment' WHERE comment_id='".intval($editpid)."' ");
+						$e107cache->clear("comment");
+						return;
+					}
+
+					if (!$sql->db_Insert("comments", "0, '".intval($pid)."', '".intval($id)."', '$subject', '$nick', '', '".$_t."', '$comment', '0', '$ip', '".$tp -> toDB($type, true)."', '0' "))
+					{
+						echo "<b>".COMLAN_3."</b> ".LAN_11;
+					}
+					else
+					{
+						if (USER == TRUE) {
+							$sql -> db_Update("user", "user_comments=user_comments+1, user_lastpost='".time()."' WHERE user_id='".USERID."' ");
+						}
+						$edata_li = array("comment_type" => $type, "comment_subject" => $subject, "comment_item_id" => $id, "comment_nick" => $nick, "comment_time" => $_t, "comment_comment" => $comment);
+						$e_event->trigger("postcomment", $edata_li);
+						$e107cache->clear("comment");
+						if(!$type || $type == "news")
+						{
+							$sql->db_Update("news", "news_comment_total=news_comment_total+1 WHERE news_id=".intval($id));
+						}
+					}
+				}
+			}
+		}
+		else
+		{
+			define("emessage", LAN_312);
+		}
+		//if rateindex is posted, enter the rating from this user
+		if($rateindex){
+			$rater -> enterrating($rateindex);
+		}
+
+		if(defined("emessage"))
+		{
+			message_handler("ALERT", emessage);
+		}
+	}
+
+	/**
+	 * Enter description here...
+	 *
+	 * @param unknown_type $table
+	 * @return unknown
+	 */
+	function getCommentType($table){
+			switch($table) {
+				case "news"		: $type = 0; break;
+				case "content"	: $type = 1; break;
+				case "download"	: $type = 2; break;
+				case "faq"		: $type = 3; break;
+				case "poll"		: $type = 4; break;
+				case "docs"		: $type = 5; break;
+				case "bugtrack"	: $type = 6; break;
+				/****************************************
+				Add your comment type here in same format as above, ie ...
+				case "your_comment_type"; $type = your_type_id; break;
+				****************************************/
+			}
+			if (!isset($type)) {
+				$type = $table;
+			}
+			return $type;
+	}
+
+	/**
+	 * Enter description here...
+	 *
+	 * @param unknown_type $table
+	 * @param unknown_type $id
+	 * @return unknown
+	 */
+	function count_comments($table, $id){
+		global $sql, $tp;
+
+		if(is_numeric($table)){
+			$type = $table;
+		}else{
+			$type = $this -> getCommentType($table);
+		}
+		$count_comments = $sql -> db_Count("comments", "(*)", "WHERE comment_item_id='".intval($id)."' AND comment_type='".$tp -> toDB($type, true)."' ORDER BY comment_item_id");
+		return $count_comments;
+	}
+
+
+	/**
+	 * Enter description here...
+	 *
+	 * @param unknown_type $table
+	 * @param unknown_type $action
+	 * @param unknown_type $id
+	 * @param unknown_type $width
+	 * @param unknown_type $subject
+	 * @param unknown_type $rate
+	 */
+	function compose_comment($table, $action, $id, $width, $subject, $rate=FALSE, $return=FALSE, $tablerender=TRUE){
+		//compose comment	: single call function will render the existing comments and show the form_comment
+		//rate				: boolean, to show/hide rating system in comment, default FALSE
+		global $pref, $sql, $ns, $e107cache, $tp, $totcc;
+
+		if(isset($pref['comments_disabled']) && $pref['comments_disabled'] == TRUE){
+        	return;
+		}
+
+		$count_comments = $this -> count_comments($table, $id, $pid=FALSE);
+
+		$type = $this -> getCommentType($table);
+
+		$query = $pref['nested_comments'] ?
+		"SELECT c.*, u.*, ue.* FROM #comments AS c
+		LEFT JOIN #user AS u ON c.comment_author = u.user_id
+		LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
+		WHERE c.comment_item_id='".intval($id)."' AND c.comment_type='".$tp -> toDB($type, true)."' AND c.comment_pid='0' ORDER BY c.comment_datestamp"
+		:
+		"SELECT c.*, u.*, ue.* FROM #comments AS c
+		LEFT JOIN #user AS u ON c.comment_author = u.user_id
+		LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
+		WHERE c.comment_item_id='".intval($id)."' AND c.comment_type='".$tp -> toDB($type, true)."' ORDER BY c.comment_datestamp";
+
+		$text = "";
+
+		if ($comment_total = $sql->db_Select_gen($query))
+		{
+			$width = 0;
+			while ($row = $sql->db_Fetch())
+			{
+				$lock = $row['comment_lock'];
+				// $subject = $tp->toHTML($subject);
+				if ($pref['nested_comments'])
+				{
+					$text .= $this->render_comment($row, $table , $action, $id, $width, $tp->toHTML($subject), $rate);
+				}
+				else
+				{
+					$text .= $this->render_comment($row, $table , $action, $id, $width, $tp->toHTML($subject), $rate);
+				}
+			}
+
+			if ($tablerender)
+			{
+				$text = $ns->tablerender(LAN_99, $text, '', TRUE);
+			}
+
+			if (!$return)
+			{
+				echo $text;
+            }
+            else
+            {
+				$ret['comment'] = $text;
+			}
+
+			if (ADMIN && getperms("B"))
+			{
+				$modcomment =  "<div style='text-align:right'><a href='".e_ADMIN_ABS."modcomment.php?$table.$id'>".LAN_314."</a></div><br />";
+			}
+		}
+
+		if ($lock != "1")
+		{
+		   	$comment =	$this->form_comment($action, $table, $id, $subject, "", TRUE, $rate, $tablerender);
+		}
+		else
+		{
+			$comment = "<br /><div style='text-align:center'><b>".COMLAN_8."</b></div>";
+		}
+
+		if (!$return)
+		{
+          	echo $modcomment.$comment;
+		}
+
+		$ret['comment'] .= $modcomment;
+		$ret['comment_form'] = $comment;
+		$ret['caption'] = LAN_99;
+
+		return (!$return) ? "" : $ret;
+	}
+	
+	function delete_comments($table, $id)
+	{
+		global $sql, $tp;
+
+		if(is_numeric($table))
+		{
+			$type = $table;
+		}
+		else
+		{
+			$type = $this -> getCommentType($table);
+		}
+		$type = $tp -> toDB($type, true);
+		$id = intval($id);
+		$num_deleted = $sql -> db_Delete("comments", "comment_item_id='{$id}' AND comment_type='{$type}'");
+		return $num_deleted;
+	}
+	
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/date_handler.php 75/e107_handlers/date_handler.php
--- 6171/e107_handlers/date_handler.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/date_handler.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,107 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/date_handler.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+if (is_readable(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php")) {
+	@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php");
+} else {
+	@include_once(e_LANGUAGEDIR."English/lan_date.php");
+}
+
+class convert
+{
+
+	function convert_date($datestamp, $mode = "long") {
+		/*
+		# Date convert
+		# - parameter #1:  string $datestamp, unix stamp
+		# - parameter #2:  string $mode, date format, default long
+		# - return         parsed text
+		# - scope          public
+		*/
+		global $pref;
+
+		$datestamp += TIMEOFFSET;
+
+		if ($mode == "long") {
+			return strftime($pref['longdate'], $datestamp);
+		} else if ($mode == "short") {
+			return strftime($pref['shortdate'], $datestamp);
+		} else {
+			return strftime($pref['forumdate'], $datestamp);
+		}
+	}
+
+	function computeLapse($older_date, $newer_date = FALSE, $mode = FALSE, $show_secs = TRUE, $format = 'long') 
+	{
+
+		/*
+		$mode = TRUE :: return array
+		$mode = FALSE :: return string
+		*/
+
+		$newer_date = ($newer_date == FALSE ? (time()) : $newer_date);
+		$since = $newer_date - $older_date;
+		if($format == 'short')
+		{
+			$sec = LANDT_09;
+			$secs = LANDT_09s;
+			$min = LANDT_08;
+			$mins = LANDT_08s;
+		}
+		else
+		{
+			$sec = LANDT_07;
+			$secs = LANDT_07s;
+			$min = LANDT_06;
+			$mins = LANDT_06s;
+		}
+
+		$timings = array(
+			array(31536000 , LANDT_01,LANDT_01s),
+			array(2592000 , LANDT_02, LANDT_02s),
+			array(604800, LANDT_03, LANDT_03s),
+			array(86400 , LANDT_04, LANDT_04s),
+			array(3600 , LANDT_05, LANDT_05s),
+			array(60 , $min, $mins)
+		);
+		if($show_secs)
+		{
+			$timings[] = array(1 , $sec, $secs);
+		}
+		$newer_date = ($newer_date == FALSE ? (time()) : $newer_date);
+		$since = $newer_date - $older_date;
+
+		$outputArray = array();
+		$total = $since;
+		$value = FALSE;
+		foreach($timings as $time)
+		{
+			$seconds = floor($total / $time[0]);
+			if($seconds || $value)
+			{
+				$outputArray[] = $seconds." ".($seconds == 1 ? $time[1] : $time[2]);
+				$value = TRUE;
+			}
+			$total = fmod($total, $time[0]);
+		}
+		return ($mode ? $outputArray : implode(", ", $outputArray));
+	}
+
+}
\ No newline at end of file
diff -ruN 6171/e107_handlers/db_debug_class.php 75/e107_handlers/db_debug_class.php
--- 6171/e107_handlers/db_debug_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/db_debug_class.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,445 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/db_debug_class.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e107_db_debug {
+	var $aSQLdetails = array();     // DB query analysis (in pieces for further analysis)
+	var $aDBbyTable = array();
+	var $aOBMarks = array(0 => ''); // Track output buffer level at each time mark
+	var $aMarkNotes = array();      // Other notes can be added and output...
+	var $aTimeMarks = array();      // Overall time markers
+	var $curTimeMark = 'Start';
+	var $nTimeMarks = 0;            // Provide an array index for time marks. Stablizes 'current' function
+	var $aGoodQueries = array();
+	var $aBadQueries = array();
+	var $scbbcodes = array();
+	var $scbcount;
+	var $depreciated_funcs = array();
+
+	function e107_db_debug() {
+		global $eTimingStart;
+
+		$this->aTimeMarks[0]=array(
+		'Index' => 0,
+		'What' => 'Start',
+		'%Time' => 0,
+		'%DB Time' => 0,
+		'%DB Count' => 0,
+		'Time' => ($eTimingStart),
+		'DB Time' => 0,
+		'DB Count' => 0
+		);
+	}
+
+	function Mark_Time($sMarker) { // Should move to traffic_class?
+	$timeNow=microtime();
+	$nMarks=++$this->nTimeMarks;
+
+	if (!strlen($sMarker)) {
+		$sMarker = "Mark not set";
+	}
+
+	$this->aTimeMarks[$nMarks]=array(
+	'Index' => ($this->nTimeMarks),
+	'What' => $sMarker,
+	'%Time' => 0,
+	'%DB Time' => 0,
+	'%DB Count' => 0,
+	'Time' => $timeNow,
+	'DB Time' => 0,
+	'DB Count' => 0
+	);
+
+	$this->aOBMarks[$nMarks]=ob_get_level().'('.ob_get_length().')';
+	$this->curTimeMark=$sMarker;
+
+	// Add any desired notes to $aMarkNotes[$nMarks]... e.g.
+	//global $eTimingStart;
+	//$this->aMarkNotes[$nMarks] .= "verify start: ".$eTimingStart."<br/>";
+	}
+
+	function Mark_Query($query, $rli, $origQryRes, $aTrace, $mytime, $curtable) {
+		global $sql;
+
+		// Explain the query, if possible...
+		list($qtype,$args) = explode(" ", ltrim($query), 2);
+
+		$nFields=0;
+		if (!strcasecmp($qtype,'SELECT')) {
+			$sQryRes=is_null($rli) ? mysql_query("EXPLAIN $query") : mysql_query("EXPLAIN $query", $rli);
+
+			if ($sQryRes) { // There's something to explain
+			$nFields = mysql_num_fields($sQryRes);
+			}
+		} else {
+			$sQryRes = $origQryRes;
+			$nFields=0;
+		}
+
+		// Record Basic query info
+		$sCallingFile=$aTrace[1]['file'];
+		$sCallingLine=$aTrace[1]['line'];
+
+		$t = &$this->aSQLdetails[$sql->db_QueryCount()];
+		$t['marker']=$this->curTimeMark;
+		$t['caller']="$sCallingFile($sCallingLine)";
+		$t['query']=$query;
+		$t['ok']=$sQryRes ? TRUE : FALSE;
+		$t['error']=$sQryRes ? '' : mysql_error();
+		$t['nFields']=$nFields;
+		$t['time']=$mytime;
+
+		if ($sQryRes != 1) {
+			$bRowHeaders=FALSE;
+			while ($row = @mysql_fetch_assoc($sQryRes)) {
+				if (!$bRowHeaders) {
+					$bRowHeaders=TRUE;
+					$t['explain']="<tr><td class='forumheader3'><b>".implode("</b></td><td class='forumheader3'><b>", array_keys($row))."</b></td></tr>\n";
+				}
+
+				$t['explain'] .= "<tr><td class='forumheader3'>".implode("&nbsp;</td><td class='forumheader3'>", array_values($row))."&nbsp;</td></tr>\n";
+			}
+		} else {
+			$t['explain'] = '';
+		}
+
+		$this->aTimeMarks[$this->nTimeMarks]['DB Time'] += $mytime;
+		$this->aTimeMarks[$this->nTimeMarks]['DB Count']++;
+
+		if (array_key_exists($curtable, $this->aDBbyTable)) {
+			$this->aDBbyTable[$curtable]['DB Time'] += $mytime;
+			$this->aDBbyTable[$curtable]['DB Count']++;
+		} else {
+			$this->aDBbyTable[$curtable]['Table']=$curtable;
+			$this->aDBbyTable[$curtable]['%DB Time']=0;  // placeholder
+			$this->aDBbyTable[$curtable]['%DB Count']=0; // placeholder
+			$this->aDBbyTable[$curtable]['DB Time']=$mytime;
+			$this->aDBbyTable[$curtable]['DB Count']=1;
+		}
+	}
+
+	function Show_SQL_Details() {
+		global $sql;
+		//
+		// Show stats from aSQLdetails array
+		//
+		$text='';
+		$nQueries=$sql->db_QueryCount();
+
+		if (!$nQueries) return $text;
+
+		//
+		// ALWAYS summarize query errors
+		//
+		$badCount=0;
+		$okCount=0;
+
+		foreach ($this->aSQLdetails as $cQuery) {
+			if ($cQuery['ok']) {
+				$okCount++;
+			} else {
+				$badCount++;
+			}
+		}
+
+		if ($badCount) {
+			$text .= "\n<table class='fborder'>\n";
+			$text .= "<tr><td class='fcaption' colspan='2'><b>$badCount Query Errors!</b></td></tr>\n";
+			$text .= "<tr><td class='fcaption'><b>Index</b></td><td class='fcaption'><b>Query</b></td></tr>\n";
+
+			foreach ($this->aSQLdetails as $idx => $cQuery) {
+				if (!$cQuery['ok']) {
+					$text .= "<tr><td class='forumheader3' style='text-align:right'>{$idx}&nbsp;</td>
+    	       	        <td class='forumheader3'>".$cQuery['query']."</td></tr>\n";
+				}
+			}
+			$text .= "\n</table><br/>\n";
+		}
+
+		//
+		// Optionally list good queries
+		//
+		if ($okCount && E107_DBG_SQLQUERIES) {
+			$text .= "\n<table class='fborder'>\n";
+			$text .= "<tr><td class='fcaption' colspan='3'><b>{$okCount[TRUE]} Good Queries</b></td></tr>\n";
+			$text .= "<tr><td class='fcaption'><b>Index</b></td><td class='fcaption'><b>Qtime</b></td><td class='fcaption'><b>Query</b></td></tr>\n
+				 <tr><td class='fcaption'>&nbsp;</td><td class='fcaption'><b>(msec)</b></td><td class='fcaption'>&nbsp;</td></tr>\n
+				 ";
+
+			foreach ($this->aSQLdetails as $idx => $cQuery) {
+				if ($cQuery['ok']) {
+					$text .= "<tr><td class='forumheader3' style='text-align:right'>{$idx}&nbsp;</td>
+	       	        <td class='forumheader3' style='text-align:right'>".number_format($cQuery['time'] * 1000.0, 4)."&nbsp;</td><td class='forumheader3'>".$cQuery['query'].'<br/>['.$cQuery['marker']." - ".$cQuery['caller']."]</td></tr>\n";
+				}
+			}
+			$text .= "\n</table><br/>\n";
+		}
+
+
+		//
+		// Optionally list query details
+		//
+		if (E107_DBG_SQLDETAILS) {
+			foreach ($this->aSQLdetails as $idx => $cQuery) {
+				$text .= "\n<table class='fborder' style='width: 100%;'>\n";
+				$text .= "<tr><td class='forumheader3' colspan='".$cQuery['nFields']."'><b>".$idx.") Query:</b> [".$cQuery['marker']." - ".$cQuery['caller']."]<br/>".$cQuery['query']."</td></tr>\n";
+				if (isset($cQuery['explain'])) {
+					$text .= $cQuery['explain'];
+				}
+				if (strlen($cQuery['error'])) {
+					$text .= "<tr><td class='forumheader3' ><b>Error in query:</b></td></tr>\n<tr><td class='forumheader3'>".$cQuery['error']."</td></tr>\n";
+				}
+
+				$text .= "<tr><td class='forumheader3'  colspan='".$cQuery['nFields']."'><b>Query time:</b> ".number_format($cQuery['time'] * 1000.0, 4).' (ms)</td></tr></table><br />'."\n";
+			}
+		}
+
+		return $text;
+	}
+
+	function Show_Performance() {
+		//
+		// Stats by Time Marker
+		//
+		global $db_time;
+		global $sql;
+		global $eTimingStart, $eTimingStop, $eTraffic;
+
+		$this->Mark_Time('Stop');
+
+		if (!E107_DBG_TIMEDETAILS) return '';
+
+		$text='';
+		$totTime=$eTraffic->TimeDelta($eTimingStart, $eTimingStop);
+		$text .= "\n<table class='fborder'>\n";
+		$bRowHeaders=FALSE;
+		reset($this->aTimeMarks);
+		$aSum=$this->aTimeMarks[0]; // create a template from the 'real' array
+		$aSum['Index']='';
+		$aSum['What']='Total';
+		$aSum['Time']=0;
+		$aSum['DB Count']=0;
+		$aSum['DB Time']=0;
+
+		while (list($tKey, $tMarker) = each($this->aTimeMarks)) {
+			if (!$bRowHeaders) {
+				// First time: emit headers
+				$bRowHeaders=TRUE;
+				$text .= "<tr><td class='fcaption' style='text-align:right'><b>".implode("</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>", array_keys($tMarker))."</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>OB Lev&nbsp;</b></td></tr>\n";
+				$aUnits = $tMarker;
+				foreach ($aUnits as $key=>$val) {
+					switch ($key) {
+						case 'DB Time':
+						case 'Time':
+						$aUnits[$key] = '(msec)';
+						break;
+						default:
+						$aUnits[$key] = '';
+						break;
+					}
+				}
+				$aUnits['OB Lev'] = 'lev(buf bytes)';
+				$text .= "<tr><td class='fcaption' style='text-align:right'><b>".implode("</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>", $aUnits)."</b>&nbsp;</td></tr>\n";
+			}
+
+			if ($tMarker['What'] == 'Stop') {
+				break; // We're on the 'stop' mark
+			}
+
+			// Convert from start time to delta time, i.e. from now to next entry
+			$nextMarker=current($this->aTimeMarks);
+			$aNextT=$nextMarker['Time'];
+			$aThisT=$tMarker['Time'];
+
+			$thisDelta=$eTraffic->TimeDelta($aThisT, $aNextT);
+			$aSum['Time'] += $thisDelta;
+			$aSum['DB Time'] += $tMarker['DB Time'];
+			$aSum['DB Count'] += $tMarker['DB Count'];
+			$tMarker['Time']=number_format($thisDelta*1000.0, 1);
+			$tMarker['%Time']=$totTime ? number_format(100.0 * ($thisDelta / $totTime), 0) : 0;
+			$tMarker['%DB Count']=number_format(100.0 * $tMarker['DB Count'] / $sql->db_QueryCount(), 0);
+			$tMarker['%DB Time']=$db_time ? number_format(100.0 * $tMarker['DB Time'] / $db_time, 0) : 0;
+			$tMarker['DB Time']=number_format($tMarker['DB Time']*1000.0, 1);
+			$tMarker['OB Lev']=$this->aOBMarks[$tKey];
+			$text .= "<tr><td class='forumheader3' >".implode("&nbsp;</td><td class='forumheader3'  style='text-align:right'>", array_values($tMarker))."&nbsp;</td></tr>\n";
+
+			if (isset($this->aMarkNotes[$tKey])) {
+				$text .= "<tr><td class='forumheader3' >&nbsp;</td><td class='forumheader3' colspan='4'>";
+				$text .= $this->aMarkNotes[$tKey]."</td></tr>\n";
+			}
+		}
+
+		$aSum['%Time']=$totTime ? number_format(100.0 * ($aSum['Time'] / $totTime), 0) : 0;
+		$aSum['%DB Time']=$db_time ? number_format(100.0 * ($aSum['DB Time'] / $db_time), 0) : 0;
+		$aSum['%DB Count']=($sql->db_QueryCount()) ? number_format(100.0 * ($aSum['DB Count'] / ($sql->db_QueryCount())), 0) : 0;
+		$aSum['Time']=number_format($aSum['Time']*1000.0, 1);
+		$aSum['DB Time']=number_format($aSum['DB Time']*1000.0, 1);
+
+		$text .= "<tr><td class='fcaption'><b>".implode("</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>", $aSum)."</b>&nbsp;</td><td class='fcaption'>&nbsp;</td></tr>\n";
+		$text .= "\n</table><br/>\n";
+
+		//
+		// Stats by Table
+		//
+
+		$text .= "\n<table class='fborder'>\n";
+
+		$bRowHeaders=FALSE;
+
+		foreach ($this->aDBbyTable as $curTable) {
+			if (!$bRowHeaders) {
+				$bRowHeaders=TRUE;
+				$text .= "<tr><td class='fcaption'><b>".implode("</b></td><td class='fcaption'><b>", array_keys($curTable))."</b></td></tr>\n";
+				$aUnits = $curTable;
+				foreach ($aUnits as $key=>$val) {
+					switch ($key) {
+						case 'DB Time':
+						$aUnits[$key] = '(msec)';
+						break;
+						default:
+						$aUnits[$key] = '';
+						break;
+					}
+				}
+				$text .= "<tr><td class='fcaption' style='text-align:right'><b>".implode("</b>&nbsp;</td><td class='fcaption' style='text-align:right'><b>", $aUnits)."</b>&nbsp;</td></tr>\n";
+			}
+
+			$curTable['%DB Count']=number_format(100.0 * $curTable['DB Count'] / $sql->db_QueryCount(), 0);
+			$curTable['%DB Time']=number_format(100.0 * $curTable['DB Time'] / $db_time, 0);
+			$curTable['DB Time']=number_format($curTable['DB Time'], 4);
+			$text .= "<tr><td class='forumheader3'>".implode("&nbsp;</td><td class='forumheader3' style='text-align:right'>", array_values($curTable))."&nbsp;</td></tr>\n";
+		}
+
+		$text .= "\n</table><br/>\n";
+
+		return $text;
+	}
+
+	function aDeprecatiated(){
+
+		$back_trace = debug_backtrace();
+
+		print_r($back_trace);
+
+		$this->depreciated_funcs[] =	array (
+		'func'	=> ($back_trace[1]['type'] == '::' || $back_trace[1]['type'] == '->' ? $back_trace[1]['class'].$back_trace[1]['type'].$back_trace[1]['function'] : $back_trace[1]['function']),
+		'file'	=> $back_trace[1]['file'],
+		'line'	=> $back_trace[1]['line']
+		);
+
+	}
+
+	function logCode($type, $code, $parm, $postID)
+	{
+		if (!E107_DBG_BBSC)
+		{
+			return FALSE;
+		}
+		$this -> scbbcodes[$this -> scbcount]['type'] = $type;
+		$this -> scbbcodes[$this -> scbcount]['code'] = $code;
+		$this -> scbbcodes[$this -> scbcount]['parm'] = $parm;
+		$this -> scbbcodes[$this -> scbcount]['postID'] = $postID;
+		$this -> scbcount ++;
+	}
+
+	function Show_SC_BB()
+	{
+		if (!E107_DBG_BBSC)
+		{
+			return FALSE;
+		}
+		$text .= "<table class='fborder' style='width: 100%'>
+			<tr><td class='fcaption' colspan='4'><b>Shortcode / BBCode</b></td></tr>
+			<tr>
+			<td class='fcaption' style='width: 10%;'>Type</td>
+			<td class='fcaption' style='width: 10%;'>Code</td>
+			<td class='fcaption' style='width: 10%;'>Parm</td>
+			<td class='fcaption' style='width: 10%;'>Post ID</td>
+			</tr>\n";
+
+		foreach($this -> scbbcodes as $codes)
+		{
+			$text .= "<tr>
+				<td class='forumheader3' style='width: 10%;'>".($codes['type'] == 1 ? "BBCode" : "Shortcode")."</td>
+				<td class='forumheader3' style='width: 10%;'>".(isset($codes['code']) ? $codes['code'] : "&nbsp;")."</td>
+				<td class='forumheader3' style='width: 10%;'>".($codes['parm'] ? $codes['parm'] : "&nbsp;")."</td>
+				<td class='forumheader3' style='width: 10%;'>".($codes['postID'] ? $codes['postID'] : "&nbsp;")."</td>
+				</tr>\n";
+		}
+		$text .= "</table>";
+		return $text;
+	}
+
+	function Show_PATH()
+	{
+		if (!E107_DBG_PATH)
+		{
+			return FALSE;
+		}
+		global $e107;
+		$text .= "<table class='fborder' style='width: 100%'>
+			<tr><td class='fcaption' colspan='4'><b>Paths</b></td></tr>
+			<tr>
+			<td class='forumheader3'>\n";
+
+		ob_start();
+		echo "<pre>"; print_r($e107); echo "</pre>";
+		$text .= ob_get_contents();
+		ob_end_clean();
+
+		$text .= "e_HTTP: '".e_HTTP."'<br />";
+		$text .= "e_BASE: '".e_BASE."'<br />";
+		$text .= "\$_SERVER['PHP_SELF']: '".$_SERVER['PHP_SELF']."'<br />";
+		$text .= "\$_SERVER['DOCUMENT_ROOT']: '".$_SERVER['DOCUMENT_ROOT']."'<br />";
+		$text .= "\$_SERVER['HTTP_HOST']: '".$_SERVER['HTTP_HOST']."'<br />";
+
+		$text .= "</td></tr></table>";
+		return $text;
+	}
+
+
+	function Show_DEPRECIATED(){
+		$text = '';
+		if (!E107_DBG_DEPRECIATED){
+			return FALSE;
+		} else {
+			$text .= "<table class='fborder' style='width: 100%'>
+			<tr><td class='fcaption' colspan='4'><b>The following depreciated functions were used:</b></td></tr>
+			<tr>
+			<td class='fcaption' style='width: 10%;'>Function</td>
+			<td class='fcaption' style='width: 10%;'>File</td>
+			<td class='fcaption' style='width: 10%;'>Line</td>
+			</tr>\n";
+
+			foreach($this->depreciated_funcs as $funcs)
+			{
+				$text .= "<tr>
+				<td class='forumheader3' style='width: 10%;'>{$funcs['func']}()</td>
+				<td class='forumheader3' style='width: 10%;'>{$funcs['file']}</td>
+				<td class='forumheader3' style='width: 10%;'>{$funcs['line']}</td>
+				</tr>\n";
+			}
+			$text .= "</table>";
+			return $text;
+		}
+	}
+}
+
+?>
diff -ruN 6171/e107_handlers/debug_handler.php 75/e107_handlers/debug_handler.php
--- 6171/e107_handlers/debug_handler.php	2004-04-29 07:57:14.000000000 -0500
+++ 75/e107_handlers/debug_handler.php	2006-02-01 08:19:15.000000000 -0600
@@ -1,31 +1,107 @@
-<?php
-// Functions to fix webmasters errors...
-// Initial release by Lolo Irie, e107 Dev Team, 2004
-
-function search_validtheme(){
-	$theme_found = 0;
-	$th = substr(e_THEME, 0, -1);
-	$handle = opendir($th);
-	while ($file = readdir($handle)){
-	        if(!strstr($file, ".")){
-				$subhandle=opendir(e_THEME.$file);
-				while ($file2 = readdir($subhandle)){
-					if($file2 == "theme.php"){
-						$theme_found = 1;
-						break;
-					}
-				}
-				if($theme_found == 1){closedir($subhandle);break;}
-				closedir($subhandle);
-	        }
-	}
-	
-	if($theme_found == 1){
-		closedir($handle);
-		return $file;
-	}
-	
-	closedir($handle);
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/debug_handler.php,v $
+|     $Revision: 1.17 $
+|     $Date: 2006/02/01 14:19:15 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e107_debug {
+
+	var $debug_level = 1;
+	//
+	// DEBUG SHORTCUTS
+	//
+	var $aDebugShortcuts = array(
+		'all'		 	=> 255,     // all basics
+		'basic'			=> 255,     // all basics
+		'b'				=> 255,     // all basics
+		'depreciated'	=> 32766,   // show if code is using depreciated functions
+		'showsql'		=> 2,       // sql basics
+		'counts'		=> 4,       // traffic counters
+		'detail'		=> 32767,   // all details
+		'd' 			=> 32767,   // all details
+		'time' 			=> 256,     // time details
+		'sql' 			=> 512,     // sql details
+		'warn'			=> 1,       // just warnings, parse errrors, etc
+		'notice'		=> 32768,   // you REALLY don't want all this, do you?
+		'everything' 	=> 65535,
+		'bbsc' 			=> 65536,
+		'paths' 		=> 131072,
+		'sc'			=> 5		// Shortcode paths only.
+	);
+
+	function e107_debug() {
+		if (preg_match('/debug(=?)(.*?),?(\+|stick|-|unstick|$)/', e_MENU, $debug_param) || isset($_COOKIE['e107_debug_level'])) {
+			if (isset($_COOKIE['e107_debug_level'])) {
+				$dVal = substr($_COOKIE['e107_debug_level'],6);
+			}
+			if (preg_match('/debug(=?)(.*?),?(\+|stick|-|unstick|$)/', e_MENU)) {
+				$dVal = $debug_param[1] == '=' ? $debug_param[2] : 'everything';
+			}
+			if ($debug_param[3] == '+' || $debug_param[3] == 'stick')
+			{
+				cookie('e107_debug_level', 'level='.$dVal, time() + 86400);
+			}
+			if ($debug_param[3] == '-' || $debug_param[3] == 'unstick')
+			{
+				cookie('e107_debug_level', '', time() - 3600);
+			}
+
+			if (isset($this->aDebugShortcuts[$dVal])) {
+				$this->debug_level = $this->aDebugShortcuts[$dVal];
+			} else {
+				$this->debug_level = $dVal;
+			}
+		}
+	}
+
+	function set_error_reporting() {
+	}
+}
+
+if (strstr(e_MENU, "debug") || isset($_COOKIE['e107_debug_level'])) {
+	$e107_debug = new e107_debug;
+	require_once(e_HANDLER.'db_debug_class.php');
+	$db_debug = new e107_db_debug;
+	$e107_debug->set_error_reporting();
+	$e107_debug_level = $e107_debug->debug_level;
+	define('E107_DEBUG_LEVEL', $e107_debug_level);
+} else {
+	define('E107_DEBUG_LEVEL', 0);
+}
+
+// Basic levels
+define('E107_DBG_BASIC',		(E107_DEBUG_LEVEL & 1));       // basics: worst php errors, sql errors, etc
+define('E107_DBG_SQLQUERIES',	(E107_DEBUG_LEVEL & 2));       // display all sql queries
+define('E107_DBG_TRAFFIC',		(E107_DEBUG_LEVEL & 4));       // display traffic counters
+define('E107_DBG_FILLIN8',		(E107_DEBUG_LEVEL & 8));       // fill in what it is
+define('E107_DBG_FILLIN16',		(E107_DEBUG_LEVEL & 16));      // fill in what it is
+define('E107_DBG_FILLIN32',		(E107_DEBUG_LEVEL & 32));      // fill in what it is
+define('E107_DBG_FILLIN64',		(E107_DEBUG_LEVEL & 64));      // fill in what it is
+define('E107_DBG_FILLIN128',	(E107_DEBUG_LEVEL & 128));     // fill in what it is
+
+// Gory detail levels
+define('E107_DBG_TIMEDETAILS',	(E107_DEBUG_LEVEL & 256));     // detailed time profile
+define('E107_DBG_SQLDETAILS',	(E107_DEBUG_LEVEL & 512));     // detailed sql analysis
+define('E107_DBG_FILLIN1024',	(E107_DEBUG_LEVEL & 1024));    // fill in what it is
+define('E107_DBG_FILLIN2048',	(E107_DEBUG_LEVEL & 2048));    // fill in what it is
+define('E107_DBG_DEPRECIATED',	(E107_DEBUG_LEVEL & 32766));   // show used depricated funcs
+define('E107_DBG_ALLERRORS',	(E107_DEBUG_LEVEL & 32768));   // show ALL errors//...
+define('E107_DBG_BBSC',			(E107_DEBUG_LEVEL & 65536));   // BBCode / Shortcode
+define('E107_DBG_PATH',			(E107_DEBUG_LEVEL & 131072));
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/e107_class.php 75/e107_handlers/e107_class.php
--- 6171/e107_handlers/e107_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/e107_class.php	2006-04-05 07:03:04.000000000 -0500
@@ -0,0 +1,218 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     �Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/e107_class.php,v $
+|     $Revision: 1.51 $
+|     $Date: 2006/04/05 12:03:04 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/**
+ * Core e107 class
+ *
+ */
+class e107{
+
+	var $server_path;
+	var $e107_dirs;
+	var $http_path;
+	var $https_path;
+	var $base_path;
+	var $file_path;
+	var $relative_base_path;
+	var $_ip_cache;
+	var $_host_name_cache;
+
+	/**
+	 * e107 class constructor
+	 *
+	 * @param array $e107_paths
+	 * @param string $e107_root_path
+	 * @return e107
+	 */
+	function e107($e107_paths, $e107_root_path){
+		$this->e107_dirs = $e107_paths;
+		$this->set_paths();
+		$this->file_path = $this->fix_windows_paths($e107_root_path)."/";
+	}
+
+	function set_base_path()
+	{
+		global $pref;
+		$this->base_path = ($pref['ssl_enabled']==1 ?  $this->https_path : $this->http_path);
+	}
+
+	function set_paths(){
+		global $DOWNLOADS_DIRECTORY, $ADMIN_DIRECTORY, $IMAGES_DIRECTORY, $THEMES_DIRECTORY, $PLUGINS_DIRECTORY,
+		$FILES_DIRECTORY, $HANDLERS_DIRECTORY, $LANGUAGES_DIRECTORY, $HELP_DIRECTORY;
+		$path = ""; $i = 0;
+		while (!file_exists("{$path}class2.php")) {
+			$path .= "../";
+			$i++;
+		}
+		if($_SERVER['PHP_SELF'] == "") { $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME']; }
+
+		$http_path = dirname($_SERVER['PHP_SELF']);
+		$http_path = explode("/", $http_path);
+		$http_path = array_reverse($http_path);
+		$j = 0;
+		while ($j < $i) {
+			unset($http_path[$j]);
+			$j++;
+		}
+		$http_path = array_reverse($http_path);
+		$this->server_path = implode("/", $http_path)."/";
+		$this->server_path = $this->fix_windows_paths($this->server_path);
+
+		if ($this->server_path == "//") {
+			$this->server_path = "/";
+		}
+		$this->relative_base_path = $path;
+		$this->http_path = "http://{$_SERVER['HTTP_HOST']}{$this->server_path}";
+		$this->https_path = "https://{$_SERVER['HTTP_HOST']}{$this->server_path}";
+		$this->file_path = $path;
+
+		define("e_HTTP", $this->server_path);
+		define("e_BASE", $this->relative_base_path);
+		define("e_ADMIN", e_BASE.$ADMIN_DIRECTORY);
+		define("e_IMAGE", e_BASE.$IMAGES_DIRECTORY);
+		define("e_THEME", e_BASE.$THEMES_DIRECTORY);
+		define("e_PLUGIN", e_BASE.$PLUGINS_DIRECTORY);
+		define("e_FILE", e_BASE.$FILES_DIRECTORY);
+		define("e_HANDLER", e_BASE.$HANDLERS_DIRECTORY);
+		define("e_LANGUAGEDIR", e_BASE.$LANGUAGES_DIRECTORY);
+
+		define("e_ADMIN_ABS", e_HTTP.$ADMIN_DIRECTORY);
+		define("e_IMAGE_ABS", e_HTTP.$IMAGES_DIRECTORY);
+		define("e_THEME_ABS", e_HTTP.$THEMES_DIRECTORY);
+		define("e_PLUGIN_ABS", e_HTTP.$PLUGINS_DIRECTORY);
+		define("e_FILE_ABS", e_HTTP.$FILES_DIRECTORY);
+		define("e_HANDLER_ABS", e_HTTP.$HANDLERS_DIRECTORY);
+		define("e_LANGUAGEDIR_ABS", e_HTTP.$LANGUAGES_DIRECTORY);
+
+		define("e_DOCS", e_BASE.$HELP_DIRECTORY);
+		define("e_DOCROOT", $_SERVER['DOCUMENT_ROOT']."/");
+
+		define("e_DOCS_ABS", e_HTTP.$HELP_DIRECTORY);
+
+		if ($DOWNLOADS_DIRECTORY{0} == "/") {
+			define("e_DOWNLOAD", $DOWNLOADS_DIRECTORY);
+		} else {
+			define("e_DOWNLOAD", e_BASE.$DOWNLOADS_DIRECTORY);
+		}
+	}
+
+	function fix_windows_paths($path) {
+		$fixed_path = str_replace(array('\\\\', '\\'), array('/', '/'), $path);
+		$fixed_path = (substr($fixed_path, 1, 2) == ":/" ? substr($fixed_path, 2) : $fixed_path);
+		return $fixed_path;
+	}
+
+	/**
+	 * Check if current user is banned
+	 *
+	 */
+	function ban() {
+		global $sql, $e107, $tp;
+		$ban_count = $sql->db_Count("banlist");
+		if($ban_count){
+			$ip = $this->getip();
+			$tmp = explode(".",$ip);
+			$wildcard =  $tmp[0].".".$tmp[1].".".$tmp[2].".*";
+			$wildcard2 = $tmp[0].".".$tmp[1].".*.*";
+
+			$tmp = $e107->get_host_name(getenv('REMOTE_ADDR'));
+
+			preg_match("/[\w]+\.[\w]+$/si", $tmp, $match);
+			$bhost = (isset($match[0]) ? " OR banlist_ip='".$tp -> toDB($match[0], true)."'" : "");
+
+			if ($ip != '127.0.0.1') {
+				if ($sql->db_Select("banlist", "*", "banlist_ip='".$tp -> toDB($_SERVER['REMOTE_ADDR'], true)."' OR banlist_ip='".USEREMAIL."' OR banlist_ip='{$ip}' OR banlist_ip='{$wildcard}' OR banlist_ip='{$wildcard2}' {$bhost}")) {
+				  header("HTTP/1.1 403 Forbidden", true);
+					// enter a message here if you want some text displayed to banned users ...
+					exit();
+				}
+			}
+		}
+	}
+
+	/**
+	 * Get the current user's IP address
+	 *
+	 * @return string
+	 */
+	function getip() {
+		if(!$this->_ip_cache){
+			if (getenv('HTTP_X_FORWARDED_FOR')) {
+				$ip=$_SERVER['REMOTE_ADDR'];
+				if (preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip3)) {
+					$ip2 = array(
+					'/^0\./',
+					'/^127\.0\.0\.1/',
+					'/^192\.168\..*/',
+					'/^172\.16\..*/',
+					'/^10..*/',
+					'/^224..*/',
+					'/^240..*/'
+					);
+					$ip = preg_replace($ip2, $ip, $ip3[1]);
+				}
+			} else {
+				$ip = $_SERVER['REMOTE_ADDR'];
+			}
+			if ($ip == "") {
+				$ip = "x.x.x.x";
+			}
+			$this->_ip_cache = $ip;
+		}
+		return $this->_ip_cache;
+	}
+
+	function get_host_name($ip_address) {
+		if(!$this->_host_name_cache[$ip_address]) {
+			$this->_host_name_cache[$ip_address] = gethostbyaddr($ip_address);
+		}
+		return $this->_host_name_cache[$ip_address];
+	}
+
+	/**
+	 * Get the current memory usage of the code
+	 *
+	 * @return string memory usage
+	 */
+	function get_memory_usage(){
+		if(function_exists("memory_get_usage")){
+			$memusage = memory_get_usage();
+			$memunit = 'b';
+			if ($memusage > 1024){
+				$memusage = $memusage / 1024;
+				$memunit = 'kb';
+			}
+			if ($memusage > 1024){
+				$memusage = $memusage / 1024;
+				$memunit = 'mb';
+			}
+			if ($memusage > 1024){
+				$memusage = $memusage / 1024;
+				$memunit = 'gb';
+			}
+			return (number_format($memusage, 0).$memunit);
+		} else {
+			return ('Unknown');
+		}
+	}
+
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/e107_Compat_handler.php 75/e107_handlers/e107_Compat_handler.php
--- 6171/e107_handlers/e107_Compat_handler.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/e107_Compat_handler.php	2005-12-21 14:48:43.000000000 -0600
@@ -0,0 +1,172 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/e107_Compat_handler.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2005/12/21 20:48:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/**
+ * A pointer for $cache->retrieve() to help keep old code compatable
+ *
+ * @see ecache::retrieve()
+ * @deprecated deprecated since v.700
+ *
+ * @param string $query
+ * @return string
+ */
+function retrieve_cache($query) {
+	if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+		global $db_debug;
+		$db_debug->aDeprecatiated();
+	}
+	global $e107cache, $e107_debug;
+	if (!is_object($e107cache)) {
+		return FALSE;
+	}
+	$ret = $e107cache->retrieve($query);
+	if ($e107_debug && $ret) {
+		echo "cache used for: {$query} <br />";
+	}
+	return $ret;
+}
+
+/**
+ * A pointer for $cache->set() to help keep old code compatable
+ *
+ * @see ecache::set()
+ * @deprecated deprecated since v.700
+ *
+ * @param string $query
+ * @param string $text
+ * @return string
+ */
+function set_cache($query, $text) {
+	if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+		global $db_debug;
+		$db_debug->aDeprecatiated();
+	}
+	global $e107cache;
+	if (!is_object($e107cache)) {
+		return FALSE;
+	}
+	if ($e107_debug) {
+		echo "cache set for: {$query} <br />";
+	}
+	$e107cache->set($query, $text);
+}
+
+/**
+ * A pointer for $cache->clear() to help keep old code compatable
+ *
+ * @see ecache::clear()
+ * @deprecated deprecated since v.700
+ *
+ * @param string $query
+ * @return bool
+ */
+function clear_cache($query) {
+	if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+		global $db_debug;
+		$db_debug->aDeprecatiated();
+	}
+	global $e107cache;
+	if (!is_object($e107cache)) {
+		return FALSE;
+	}
+	return $e107cache->clear($query);
+}
+
+/**
+ * A pointer for $e107->ban() to help keep old code compatable
+ *
+ * @see e107::ban()
+ * @deprecated deprecated since v.700
+ */
+function ban() {
+	if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+		global $db_debug;
+		$db_debug->aDeprecatiated();
+	}
+	global $e107;
+	$e107->ban();
+}
+
+/**
+ * A pointer for $e107->getip() to help keep old code compatable
+ *
+ * @see e107::getip()
+ * @deprecated deprecated since v.700
+ */
+function getip() {
+	if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+		global $db_debug;
+		$db_debug->aDeprecatiated();
+	}
+	global $e107;
+	return $e107->getip();
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+class textparse {
+	function editparse($text, $mode = "off") {
+		if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+			global $db_debug;
+			$db_debug->aDeprecatiated();
+		}
+		global $tp;
+		return $tp->toForm($text);
+	}
+
+	function tpa($text, $mode = '', $referrer = '', $highlight_search = FALSE, $poster_id = '') {
+		if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+			global $db_debug;
+			$db_debug->aDeprecatiated();
+		}
+		global $tp;
+		return $tp->toHTML($text, TRUE, $mode, $poster_id);
+	}
+
+	function tpj($text) {
+		if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+			global $db_debug;
+			$db_debug->aDeprecatiated();
+		}
+		return $text;
+	}
+
+	function formtpa($text, $mode = '') {
+		if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+			global $db_debug;
+			$db_debug->aDeprecatiated();
+		}
+		global $tp;
+		return $tp->toDB($text);
+	}
+
+	function formtparev($text) {
+		if (defined('E107_DEBUG_LEVEL') && E107_DEBUG_LEVEL >= 32766) {
+			global $db_debug;
+			$db_debug->aDeprecatiated();
+		}
+		global $tp;
+		return $tp->toFORM($text);
+	}
+
+}
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/emailprint_class.php 75/e107_handlers/emailprint_class.php
--- 6171/e107_handlers/emailprint_class.php	2004-06-03 19:35:56.000000000 -0500
+++ 75/e107_handlers/emailprint_class.php	2006-02-17 17:49:04.000000000 -0600
@@ -1,56 +1,65 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/classes/emailprint_class.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-class emailprint{
-	function render_emailprint($mode, $id, $look=0){
-		// $look = 0  --->  display all icons
-		// $look = 1  --->  display email icon only
-		// $look = 2  --->  display print icon only
-		$text_emailprint="";
-		switch($mode){
-			case "article":
-				$email = "article";
-				$print = "article";
-			break;
-			case "news":
-				$email = "news";
-				$print = "news";				
-			break;
-			case "content":
-				$email = "content";
-				$print = "content";				
-			break;
-		}
-		if($look==0 || $look==1){
-			if(defined("ICONMAIL")&&file_exists(THEME."images/".ICONMAIL)){
-				$ico_mail = THEME."images/".ICONMAIL;
-			}else{
-				$ico_mail = e_IMAGE."generic/friend.gif";
-			}
-			$text_emailprint .= "<a href='email.php?".$email.".".$id."'><img src='".$ico_mail."' style='border:0' alt='email to someone' /></a> ";
-		}
-		if($look==0 || $look==2){
-			if(defined("ICONPRINT")&&file_exists(THEME."images/".ICONPRINT)){
-				$ico_print = THEME."images/".ICONPRINT;
-			}else{
-				$ico_print = e_IMAGE."generic/printer.gif";
-			}
-			$text_emailprint .= "<a href='print.php?".$print.".".$id."'><img src='".$ico_print."' style='border:0' alt='printer friendly' /></a>";
-		}
-		return $text_emailprint;
-	}
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/emailprint_class.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/02/17 23:49:04 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_print.php");
+@include_once(e_LANGUAGEDIR."English/lan_print.php");
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_email.php");
+@include_once(e_LANGUAGEDIR."English/lan_email.php");
+
+class emailprint {
+	function render_emailprint($mode, $id, $look = 0) {
+		// $look = 0  --->display all icons
+		// $look = 1  --->display email icon only
+		// $look = 2  --->display print icon only
+		$text_emailprint = "";
+
+		//new method emailprint_class : (only news is core, rest is plugin: searched for e_emailprint.php which should hold $email and $print values)
+		if($mode == "news"){
+			$email = "news";
+			$print = "news";
+		}else{
+			//load the others from plugins
+			$handle = opendir(e_PLUGIN);
+			while (false !== ($file = readdir($handle))) {
+				if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)) {
+					$plugin_handle = opendir(e_PLUGIN.$file."/");
+					while (false !== ($file2 = readdir($plugin_handle))) {
+						if ($file2 == "e_emailprint.php") {
+							require_once(e_PLUGIN.$file."/".$file2);
+						}
+					}
+				}
+			}
+		}
+
+		if ($look == 0 || $look == 1) {
+			$ico_mail = (file_exists(THEME."generic/email.png") ? THEME."generic/email.png" : e_IMAGE."generic/".IMODE."/email.png");
+			$text_emailprint .= "<a href='".e_BASE."email.php?".$email.".".$id."'><img src='".$ico_mail."' style='border:0' alt='".LAN_email_7."' title='".LAN_email_7."' /></a> ";
+		}
+		if ($look == 0 || $look == 2) {
+			$ico_print = (file_exists(THEME."generic/printer.png") ? THEME."generic/printer.png" : e_IMAGE."generic/".IMODE."/printer.png");
+			$text_emailprint .= "<a href='".e_BASE."print.php?".$print.".".$id."'><img src='".$ico_print."' style='border:0' alt='".LAN_PRINT_1."' title='".LAN_PRINT_1."'/></a>";
+		}
+		return $text_emailprint;
+	}
+}
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/emote_filter.php 75/e107_handlers/emote_filter.php
--- 6171/e107_handlers/emote_filter.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/emote_filter.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,93 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/emote_filter.php,v $
+|     $Revision: 1.15 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e_emotefilter {
+	var $search;
+	var $replace;
+	var $emotes;
+	 
+	function e_emotefilter() /* constructor */
+	{
+		global $sysprefs, $pref;
+		if(!$pref['emotepack'])	
+		{	
+			$pref['emotepack'] = "default";
+			save_prefs();
+		}
+		$this->emotes = $sysprefs->getArray("emote_".$pref['emotepack']);
+
+		foreach($this->emotes as $key => $value)
+		{
+			$key = preg_replace("#!(\w{3,}?)$#si", ".\\1", $key);
+			$key = preg_replace("#_(\w{3})$#", ".\\1", $key);
+			$key = str_replace("!", "_", $key);
+
+			$value = trim($value);
+
+			$filename = e_IMAGE."emotes/" . $pref['emotepack'] . "/" . $key;
+			$fileloc = SITEURLBASE.e_IMAGE_ABS."emotes/" . $pref['emotepack'] . "/" . $key;
+
+			if(file_exists($filename))
+			{
+				if(strstr($value, " "))
+				{
+					$tmp = explode(" ", $value);
+					foreach($tmp as $code)
+					{
+						$this->search[] = " ".$code;
+						$this->search[] = "\n".$code;
+						$this->replace[] = " <img src='".$fileloc."' alt='' style='vertical-align:middle; border:0' /> ";
+						$this->replace[] = "\n <img src='".$fileloc."' alt='' style='vertical-align:middle; border:0' /> ";
+					}
+					unset($tmp);
+				}
+				else
+				{
+					if($value)
+					{
+						$this->search[] = " ".$value;
+						$this->search[] = "\n".$value;
+						$this->replace[] = " <img src='".$filename."' alt='' style='vertical-align:middle; border:0' /> ";
+						$this->replace[] = "\n <img src='".$filename."' alt='' style='vertical-align:middle; border:0' /> ";
+					}
+				}
+			}
+		}
+	}
+	 
+	function filterEmotes($text)
+	{	 
+		$text = str_replace($this->search, $this->replace, $text);
+		return $text;
+	}
+	 
+	function filterEmotesRev($text)
+	{
+		$text = str_replace($this->replace, $this->search, $text);
+		return $text;
+	}
+}
+	
+	
+	
+	
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/emote.php 75/e107_handlers/emote.php
--- 6171/e107_handlers/emote.php	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_handlers/emote.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,22 +1,46 @@
-<?php
-function r_emote(){
-	$sql = new db;
-	$sql -> db_Select("core", "*", "e107_name='emote'");
-	$row = $sql -> db_Fetch(); extract($row);
-	$emote = unserialize($e107_value);
-
-	$str = "<div class='spacer'>";
-
-	$c=0;
-	while(list($code, $name) = @each($emote[$c])){
-		if(!$orig[$name]){
-			$str .= "<a href=\"javascript:addtext(' $code')\"><img src=\"".e_IMAGE."emoticons/$name\" style=\"border:0\" alt=\"\" /></a> \n";
-			$orig[$name] = TRUE;
-		}
-		$c++;
-	}
-
-	$str .= "</div>";
-	return $str;
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/emote.php,v $
+|     $Revision: 1.15 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+function r_emote()
+{
+	global $sysprefs, $pref, $tp;
+
+	if (!is_object($tp->e_emote))
+	{
+		require_once(e_HANDLER.'emote_filter.php');
+		$tp->e_emote = new e_emoteFilter;
+	}
+	
+	foreach($tp->e_emote->emotes as $key => $value)
+	{
+		$key = str_replace("!", ".", $key);
+		$key = preg_replace("#_(\w{3})$#", ".\\1", $key);
+		$key = e_IMAGE."emotes/" . $pref['emotepack'] . "/" .$key;
+
+		$value2 = substr($value, 0, strpos($value, " "));
+		$value = ($value2 ? $value2 : $value);
+		$value = ($value == '&|') ? ':((' : $value;
+		$str .= "\n<a href=\"javascript:addtext('$value',true)\"><img src='$key' style='border:0; padding-top:2px;' alt='' /></a> ";
+	}
+
+	return "<div class='spacer'>".$str."</div>";
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/encrypt_handler.php 75/e107_handlers/encrypt_handler.php
--- 6171/e107_handlers/encrypt_handler.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/encrypt_handler.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,37 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/encrypt_handler.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+function encode_ip($ip)
+{
+	$ipa = explode('.', $ip);
+	return sprintf('%02x%02x%02x%02x', $ipa[0], $ipa[1], $ipa[2], $ipa[3]);
+}
+
+function decode_ip($encodedIP)
+{
+	$hexip = explode('.', chunk_split($encodedIP, 2, '.'));
+	return hexdec($hexip[0]). '.' . hexdec($hexip[1]) . '.' . hexdec($hexip[2]) . '.' . hexdec($hexip[3]);
+}
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/e_parse_class.php 75/e107_handlers/e_parse_class.php
--- 6171/e107_handlers/e_parse_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/e_parse_class.php	2006-04-28 20:03:10.000000000 -0500
@@ -0,0 +1,498 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|      Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/e_parse_class.php,v $
+|     $Revision: 1.150 $
+|     $Date: 2006/04/29 01:03:10 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+define ("E_NL", chr(2));
+class e_parse
+{
+	var $e_sc;
+	var $e_bb;
+	var $e_pf;
+	var $e_emote;
+	var $e_hook;
+	var $search = array('&#39;', '&#039;', '&quot;', 'onerror', '&gt;', '&amp;#039;', '&amp;quot;');
+	var $replace = array("'", "'", '"', 'one<i></i>rror', '>', "'", '"');
+	var $e_query;
+
+	function toDB($data, $nostrip = false, $no_encode = false, $mod = false)
+	{
+		global $pref;
+		if (is_array($data)) {
+			// recursively run toDB (for arrays)
+			foreach ($data as $key => $var) {
+				$ret[$key] = $this -> toDB($var, $nostrip, $no_encode);
+			}
+		} else {
+			if (MAGIC_QUOTES_GPC == TRUE && $nostrip == false) {
+				$data = stripslashes($data);
+			}
+			if(isset($pref['post_html']) && check_class($pref['post_html']))
+			{
+				$no_encode = TRUE;
+			}
+			if (getperms("0") || $no_encode === TRUE)
+			{
+				$search = array('$', '"', "'", '\\', '<?');
+				$replace = array('&#036;','&quot;','&#039;', '&#092;', '&lt?');
+				$ret = str_replace($search, $replace, $data);
+			} else {
+				$data = htmlspecialchars($data, ENT_QUOTES, CHARSET);
+				$data = str_replace('\\', '&#092;', $data);
+				$ret = preg_replace("/&amp;#(\d*?);/", "&#\\1;", $data);
+			}
+		}
+
+		return $ret;
+	}
+
+	function toForm($text, $single_quotes = FALSE)
+	{
+		if($text == "") { return ""; }
+		$mode = ($single_quotes ? ENT_QUOTES :ENT_COMPAT);
+		$search = array('&#036;', '&quot;');
+		$replace = array('$', '"');
+		$text = str_replace($search, $replace, $text);
+		return html_entity_decode($text, $mode);
+	}
+
+	function post_toForm($text) {
+		if (MAGIC_QUOTES_GPC == TRUE) {
+			$text = stripslashes($text);
+		}
+		// ensure apostrophes are properly converted, or else the form item could break
+		return str_replace(array( "'", '"'), array("&#039;", "&quot;"), $text);
+	}
+
+	function post_toHTML($text, $modifier = true, $extra = '') {
+		/*
+		changes by jalist 30/01/2005:
+		description had to add modifier to /not/ send formatted text on to this->toHTML at end of method, this was causing problems when MAGIC_QUOTES_GPC == TRUE.
+		*/
+		global $pref;
+
+		if(isset($pref['post_html']) && check_class($pref['post_html'])) {
+			$no_encode = true;
+		}
+
+		if (ADMIN === true || $no_encode === true) {
+			$search = array('$', '"', "'", '\\', "'&#092;'");
+			$replace = array('&#036;','&quot;','&#039;','&#092;','&#039;');
+			$text = str_replace($search, $replace, $text);
+			/*
+			changes by jalist 30/01/2005:
+			description dirty fix for servers with magic_quotes_gpc == true
+			*/
+			if (MAGIC_QUOTES_GPC) {
+				$search = array('&#092;&#092;&#092;&#092;', '&#092;&#039;', '&#092;&quot;');
+				$replace = array('&#092;&#092;','&#039;', '&quot;');
+				$text = str_replace($search, $replace, $text);
+			}
+		} else {
+
+			if (MAGIC_QUOTES_GPC) {
+				$text = stripslashes($text);
+			}
+		  	$text = htmlentities($text, ENT_QUOTES, CHARSET);
+		}
+
+		$text = $this->replaceConstants($text);
+
+		return ($modifier ? $this->toHTML($text, true, $extra) : $text);
+	}
+
+	function parseTemplate($text, $parseSCFiles = TRUE, $extraCodes = "") {
+		// Start parse {XXX} codes
+		if (!is_object($this->e_sc))
+		{
+			require_once(e_HANDLER."shortcode_handler.php");
+			$this->e_sc = new e_shortcode;
+		}
+		return $this->e_sc->parseCodes($text, $parseSCFiles, $extraCodes);
+		// End parse {XXX} codes
+	}
+
+	function htmlwrap($str, $width, $break = "\n", $nobreak = "", $nobr = "pre", $utf = false)
+	{
+		/*
+		* htmlwrap() function - v1.1
+		* Copyright (c) 2004 Brian Huisman AKA GreyWyvern
+		* http://www.greywyvern.com/code/php/htmlwrap_1.1.php.txt
+		*
+		* This program may be distributed under the terms of the GPL
+		*   - http://www.gnu.org/licenses/gpl.txt
+		*/
+
+		$content = preg_split("/([<>])/", $str, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
+		$nobreak = explode(" ", $nobreak);
+		$nobr = explode(" ", $nobr);
+		$intag = false;
+		$innbk = array();
+		$innbr = array();
+		$drain = "";
+		$utf = ($utf || CHARSET == 'utf-8') ? "u" : "";
+		$lbrks = "/?!%)-}]\\\"':;";
+		if ($break == "\r")
+		{
+			$break = "\n";
+		}
+		while (list(, $value) = each($content))
+		{
+			switch ($value)
+			{
+				case "<": $intag = true; break;
+				case ">": $intag = false; break;
+				default:
+				if ($intag)
+				{
+					if ($value{0} != "/")
+					{
+						preg_match('/^(.*?)(\s|$)/'.$utf, $value, $t);
+						if ((!count($innbk) && in_array($t[1], $nobreak)) || in_array($t[1], $innbk)) $innbk[] = $t[1];
+						if ((!count($innbr) && in_array($t[1], $nobr)) || in_array($t[1], $innbr)) $innbr[] = $t[1];
+					} else {
+						if (in_array(substr($value, 1), $innbk)) unset($innbk[count($innbk)]);
+						if (in_array(substr($value, 1), $innbr)) unset($innbr[count($innbr)]);
+					}
+				} else if ($value)
+				{
+					if (!count($innbr)) $value = str_replace("\n", "\r", str_replace("\r", "", $value));
+					if (!count($innbk))
+					{
+						do
+						{
+							$store = $value;
+							if (preg_match("/^(.*?\s|^)(([^\s&]|&(\w{2,5}|#\d{2,4});){".$width."})(?!(".preg_quote($break, "/").'|\s))(.*)$/s'.$utf, $value, $match))
+							{
+								for ($x = 0, $ledge = 0; $x < strlen($lbrks); $x++) $ledge = max($ledge, strrpos($match[2], $lbrks{$x}));
+								if (!$ledge) $ledge = strlen($match[2]) - 1;
+								$value = $match[1].substr($match[2], 0, $ledge + 1).$break.substr($match[2], $ledge + 1).$match[6];
+							}
+						}
+						while ($store != $value);
+					}
+					if (!count($innbr)) $value = str_replace("\r", E_NL, $value);
+				}
+			}
+			$drain .= $value;
+		}
+		return $drain;
+	}
+
+	function html_truncate ($text, $len = 200, $more = "[more]")
+	{
+		$pos = 0;
+		$curlen = 0;
+		$tmp_pos = 0;
+		while($curlen < $len && $curlen < strlen($text))
+		{
+			switch($text{$pos})
+			{
+				case "<" :
+				if($text{$pos+1} == "/")
+				{
+					$closing_tag = TRUE;
+				}
+				$intag = TRUE;
+				$tmp_pos = $pos-1;
+				$pos++;
+				break;
+				case ">" :
+				if($text{$pos-1} == "/")
+				{
+					$closing_tag = TRUE;
+				}
+				if($closing_tag == TRUE)
+				{
+					$tmp_pos = 0;
+					$closing_tag = FALSE;
+				}
+				$intag = FALSE;
+				$pos++;
+				break;
+				case "&" :
+				if($text{$pos+1} == "#")
+				{
+					$end = strpos(substr($text, $pos, 7), ";");
+					if($end !== FALSE)
+					{
+						$pos+=($end+1);
+						if(!$intag) {$curlen++;}
+						break;
+					}
+				}
+				else
+				{
+					$pos++;
+					if(!$intag) {$curlen++;}
+					break;
+				}
+				default:
+				$pos++;
+				if(!$intag) {$curlen++;}
+				break;
+			}
+		}
+		$ret = ($tmp_pos > 0 ? substr($text, 0, $tmp_pos) : substr($text, 0, $pos));
+		if($pos < strlen($text))
+		{
+			$ret = $ret.$more;
+		}
+		return $ret;
+	}
+
+	function text_truncate($text, $len = 200, $more = "[more]") {
+		if(strlen($text) <= $len) {
+			return $text;
+		} else {
+			return substr($text, 0, $len).$more;
+		}
+	}
+
+	function textclean ($text, $wrap=100)
+	{
+		$text = str_replace ("\n\n\n", "\n\n", $text);
+		$text = $this -> htmlwrap($text, $wrap);
+		$text = str_replace (array ("<br /> ", " <br />", " <br /> "), "<br />", $text);
+		/* we can remove any linebreaks added by htmlwrap function as any \n's will be converted later anyway */
+		return $text;
+	}
+
+	function toHTML($text, $parseBB = FALSE, $modifiers = "", $postID = "", $wrap=FALSE) {
+		if ($text == '')
+		{
+			return $text;
+		}
+		global $pref, $fromadmin;
+
+		$fromadmin = strpos($modifiers, "fromadmin");
+		//$text = str_replace(array("&#092;&quot;", "&#092;&#039;", "&#092;&#092;"), array("&quot;", "&#039;", "&#092;"), $text);
+
+		// support for converting defines(constants) within text. eg. Lan_XXXX
+		if(strpos($modifiers,"defs") !== FALSE && strlen($text) < 25 && defined(trim($text))){
+			return constant(trim($text));
+		}
+
+		// replace all {e_XXX} constants with their e107 value
+		if(strpos($modifiers, "constants") !== FALSE)
+		{
+			$text = $this->replaceConstants($text);
+		}
+
+		if(!$wrap && $pref['main_wordwrap']) $wrap = $pref['main_wordwrap'];
+		$text = " ".$text;
+
+		if (strpos($modifiers, 'nobreak') === FALSE) {
+			$text = preg_replace("#>\s*[\r]*\n[\r]*#", ">", $text);
+			preg_match_all("#<(script|style)[^>]+>.*?</(script|style)>#is", $text, $embeds);
+			$text = preg_replace("#<(script|style)[^>]+>.*?</(script|style)>#is", "<|>", $text);
+		}
+
+		if($pref['make_clickable'] && strpos($modifiers, 'no_make_clickable') === FALSE) {
+			if($pref['link_replace'] && strpos($modifiers, 'no_replace') === FALSE) {
+				$_ext = ($pref['links_new_window'] ? " rel=\"external\"" : "");
+				$text = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<]*)#is", "\\1<a href=\"\\2\" {$_ext}>".$pref['link_text']."</a>", $text);
+				$text = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" {$_ext}>".$pref['link_text']."</a>", $text);
+				if(CHARSET != "utf-8" && CHARSET != "UTF-8"){
+					$email_text = ($pref['email_text']) ? $pref['email_text'] : "\\1\\2&copy;\\3";
+				}else{
+					$email_text = ($pref['email_text']) ? $pref['email_text'] : "\\1\\2©\\3";
+				}
+				$text = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a rel='external' href='javascript:window.location=\"mai\"+\"lto:\"+\"\\2\"+\"@\"+\"\\3\";self.close();' onmouseover='window.status=\"mai\"+\"lto:\"+\"\\2\"+\"@\"+\"\\3\"; return true;' onmouseout='window.status=\"\";return true;'>".$email_text."</a>", $text);
+			} else {
+				$text = preg_replace("#(^|[\n ])([\w]+?://[^ \"\n\r\t<,]*)#is", "\\1<a href=\"\\2\" rel=\"external\">\\2</a>", $text);
+				$text = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<,]*)#is", "\\1<a href=\"http://\\2\" rel=\"external\">\\2</a>", $text);
+				$text = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a rel='external' href='javascript:window.location=\"mai\"+\"lto:\"+\"\\2\"+\"@\"+\"\\3\";self.close();' onmouseover='window.status=\"mai\"+\"lto:\"+\"\\2\"+\"@\"+\"\\3\"; return true;' onmouseout='window.status=\"\";return true;'>-email-</a>", $text);
+			}
+		}
+
+		if (strpos($modifiers, 'emotes_off') === FALSE) {
+			if ($pref['smiley_activate'] || strpos($modifiers,'emotes_on') !== FALSE) {
+				if (!is_object($this->e_emote)) {
+					require_once(e_HANDLER.'emote_filter.php');
+					$this->e_emote = new e_emoteFilter;
+				}
+				$text = $this->e_emote->filterEmotes($text);
+			}
+		}
+
+		if (strpos($modifiers, 'nobreak') === FALSE) {
+			$text = preg_replace("#[\r]*\n[\r]*#", E_NL, $text);
+			foreach ($embeds[0] as $embed) {
+				$text = preg_replace("#<\|>#", $embed, $text, 1);
+			}
+		}
+
+		$text = str_replace($this -> search, $this -> replace, $text);
+
+		// Start parse [bb][/bb] codes
+		if ($parseBB === TRUE) {
+			if (!is_object($this->e_bb)) {
+				require_once(e_HANDLER.'bbcode_handler.php');
+				$this->e_bb = new e_bbcode;
+			}
+			$text = $this->e_bb->parseBBCodes($text, $postID);
+		}
+		// End parse [bb][/bb] codes
+
+		if ($pref['profanity_filter']) {
+			if (!is_object($this->e_pf)) {
+				require_once(e_HANDLER."profanity_filter.php");
+				$this->e_pf = new e_profanityFilter;
+			}
+			$text = $this->e_pf->filterProfanities($text);
+		}
+
+		if (strpos($modifiers,'parse_sc') !== FALSE)
+		{
+			$text = $this->parseTemplate($text, TRUE);
+		}
+
+		//Run any hooked in parsers
+		if(isset($pref['tohtml_hook']) && $pref['tohtml_hook'])
+		{
+			foreach(explode(",",$pref['tohtml_hook']) as $hook)
+			{
+				if (strpos($modifiers, 'no_hook') === FALSE)
+				{
+					if (!is_object($this->e_hook[$hook]))
+					{
+						require_once(e_PLUGIN.$hook."/".$hook.".php");
+						$hook_class = "e_".$hook;
+						$this->e_hook[$hook] = new $hook_class;
+					}
+					$text = $this->e_hook[$hook]->$hook($text);
+				}
+			}
+		}
+
+		if (strpos($modifiers, 'nobreak') === FALSE) {
+			$text = $this -> textclean($text, $wrap);
+		}
+
+		// Search Highlight
+		if (strpos($modifiers, 'emotes_off') === FALSE) {
+			$shr = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "");
+			if ($pref['search_highlight'] && (strpos(e_SELF, 'search.php') === FALSE) && ((strpos($shr, 'q=') !== FALSE) || (strpos($shr, 'p=') !== FALSE))) {
+				if (!isset($this -> e_query)) {
+					$query = preg_match('#(q|p)=(.*?)(&|$)#', $shr, $matches);
+					$this -> e_query = str_replace(array('+', '*', '"', ' '), array('', '.*?', '', '\b|\b'), trim(urldecode($matches[2])));
+				}
+				$text = $this -> e_highlight($text, $this -> e_query);
+			}
+		}
+
+		$nl_replace = "<br />";
+		if (strpos($modifiers, 'nobreak') !== FALSE)
+		{
+			$nl_replace = '';
+		}
+		elseif (strpos($modifiers, 'retain_nl') !== FALSE)
+		{
+			$nl_replace = "\n";
+		}
+		$text = str_replace(E_NL, $nl_replace, $text);
+
+		return trim($text);
+	}
+
+	function toAttribute($text) {
+		if (!preg_match('/&#|\'|"|\(|\)|<|>/s', $text)) {
+			return $text;
+		} else {
+			return '';
+		}
+	}
+
+	function toJS($stringarray) {
+		$stringarray = str_replace("\r\n", "\\n", $stringarray);
+		$stringarray = str_replace("\r", "", $stringarray);
+		$trans_tbl = get_html_translation_table (HTML_ENTITIES);
+		$trans_tbl = array_flip ($trans_tbl);
+		return strtr ($stringarray, $trans_tbl);
+	}
+
+	function toRss($text,$tags=FALSE)
+	{
+
+		if($tags != TRUE){
+			$text = $this -> toHTML($text,TRUE);
+			$text = strip_tags($text);
+		}
+
+		$search = array("&amp;#039;", "&amp;#036;", "&#039;", "&#036;"," & ",);
+		$replace = array("'", '$', "'", '$',' &amp; ' );
+		$text = str_replace($search, $replace, $text);
+
+		//$text = htmlspecialchars($text);
+
+		return $text;
+	}
+
+	//Convert specific characters back to original form, for use in storing code (or regex) values in the db.
+	function toText($text)
+	{
+		$search = array("&amp;#039;", "&amp;#036;", "&#039;", "&#036;", "&#092;", "&amp;#092;");
+		$replace = array("'", '$', "'", '$', "\\", "\\");
+		$text = str_replace($search, $replace, $text);
+		return $text;
+	}
+
+	function replaceConstants($text,$nonrelative = FALSE)
+	{
+		if($nonrelative !== FALSE){
+			global $IMAGES_DIRECTORY, $PLUGINS_DIRECTORY, $FILES_DIRECTORY, $THEMES_DIRECTORY;
+        	$replace = array($IMAGES_DIRECTORY,$PLUGINS_DIRECTORY,$FILES_DIRECTORY,$THEMES_DIRECTORY);
+        	$search = array("{"."e_IMAGE"."}","{"."e_PLUGIN"."}","{"."e_FILE"."}","{"."e_THEME"."}");
+            return str_replace($search,$replace,$text);
+		}
+
+		$text = preg_replace_callback("#\{(e_[A-Z]*)\}#s", array($this, 'doReplace'), $text);
+		$text = str_replace("{THEME}",constant("THEME"),$text);
+		return $text;
+	}
+
+	function doReplace($matches)
+	{
+		if(defined($matches[1]) && ($matches[1] != 'e_ADMIN' || ADMIN))
+		{
+			return constant($matches[1]);
+		}
+		return $matches[1];
+	}
+
+    function createConstants($text){
+        global $IMAGES_DIRECTORY, $PLUGINS_DIRECTORY, $FILES_DIRECTORY, $THEMES_DIRECTORY;
+        $search = array($IMAGES_DIRECTORY,$PLUGINS_DIRECTORY,$FILES_DIRECTORY,$THEMES_DIRECTORY);
+        $replace = array("{"."e_IMAGE"."}","{"."e_PLUGIN"."}","{"."e_FILE"."}","{"."e_THEME"."}");
+		return str_replace($search,$replace,$text);
+    }
+
+
+	function e_highlight($text, $match) {
+		preg_match_all("#<[^>]+>#", $text, $tags);
+		$text = preg_replace("#<[^>]+>#", "<|>", $text);
+		$text = preg_replace("#(\b".$match."\b)#i", "<span class='searchhighlight'>\\1</span>", $text);
+		foreach ($tags[0] as $tag) {
+			$text = preg_replace("#<\|>#", $tag, $text, 1);
+		}
+		return $text;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/equery_secure.php 75/e107_handlers/equery_secure.php
--- 6171/e107_handlers/equery_secure.php	2004-07-16 12:43:14.000000000 -0500
+++ 75/e107_handlers/equery_secure.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,34 +1,52 @@
-<?php
-// Secure handler for queries in URLs
-
-if(file_exists(e_LANGUAGEDIR.e_LANGUAGE."/lan_equery_secure.php")){
-  include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_equery_secure.php");
-}else{
-  include_once(e_LANGUAGEDIR."English/lan_equery_secure.php");
-}
-require_once(HEADERF);
-
-$caption = EQSEC_LAN2;
-$text = "<div style='text-align: center;' >
-<div class='fcaption'>".EQSEC_LAN1."</div>
-<br />";
-$text .= "<table style='text-align:center;'>
-<tr><td><b>".EQSEC_LAN4."</b></td><td> ".($tmp_s_ref!="" ? $tmp_s_ref : EQSEC_LAN3 )."</td></tr>
-<tr><td><b>".EQSEC_LAN5."</b></td><td> ".e_SELF."</td></tr></table>
-<br />";
-$text .= "<br />
-<form action=\"".e_SELF."?".e_QUERY."\" method=\"post\" >
-<div><input class='button' type='submit' value='".EQSEC_LAN6."' name='equery_secure' id='equery_secure' /></div>
-</form>
-<br /><br />
-
-<br />
-<a href=\"javascript:void(0);\" onclick=\"history.go(-1);\" >".EQSEC_LAN7."</a>
-
-</div>";
-
-$ns -> tablerender($caption, $text);
-
-require_once(FOOTERF);
-exit;
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/equery_secure.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+if (file_exists(e_LANGUAGEDIR.e_LANGUAGE."/lan_equery_secure.php")) {
+	include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_equery_secure.php");
+} else {
+	include_once(e_LANGUAGEDIR."English/lan_equery_secure.php");
+}
+require_once(HEADERF);
+	
+$caption = EQSEC_LAN2;
+$text = "<div style='text-align: center;' >
+	<div class='fcaption'>".EQSEC_LAN1."</div>
+	<br />";
+$text .= "<table style='text-align:center;'>
+	<tr><td><b>".EQSEC_LAN4."</b></td><td> ".($tmp_s_ref != "" ? $tmp_s_ref : EQSEC_LAN3 )."</td></tr>
+	<tr><td><b>".EQSEC_LAN5."</b></td><td> ".e_SELF."</td></tr></table>
+	<br />";
+$text .= "<br />
+	<form action=\"".e_SELF."?".e_QUERY."\" method=\"post\" >
+	<div><input class='button' type='submit' value='".EQSEC_LAN6."' name='equery_secure' id='equery_secure' /></div>
+	</form>
+	<br /><br />
+	 
+	<br />
+	<a href=\"javascript:void(0);\" onclick=\"history.go(-1);\" >".EQSEC_LAN7."</a>
+	 
+	</div>";
+	
+$ns->tablerender($caption, $text);
+	
+require_once(FOOTERF);
+exit;
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/errorhandler_class.php 75/e107_handlers/errorhandler_class.php
--- 6171/e107_handlers/errorhandler_class.php	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_handlers/errorhandler_class.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,34 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/error_handler_class.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-function error_handler($type, $message, $file, $line, $context){
-	$debug_state = "ERROR";
-
-	switch($type){
-		case E_NOTICE:
-			if(eregi("NOTICE", $debug_state)){ echo "<b>e107 Notice: </b>".$message.", Line <b>".$line."</b> of <b>".$file."</b><br />"; }
-		break;
-		case E_WARNING:
-			if(eregi("WARNING", $debug_state)){ echo "<b>e107 Warning: A non fatal error has occurred </b>".$message.", Line <b>".$line."</b> of <b>".$file."</b><br />"; }
-		break;
-		case E_ERROR:
-			if(eregi("ERROR", $debug_state)){ echo "<b>e107 ERROR: A fatal error has occurred </b>".$message.", Line <b>".$line."</b> of <b>".$file."</b><br />"; }
-		break;
-	}
-	if(eregi("ECHOSTATE", $debug_state)){
-		echo "<br />Variable state when error occurred: <br>";
-		print_r($context);
-	}
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/event_class.php 75/e107_handlers/event_class.php
--- 6171/e107_handlers/event_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/event_class.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,55 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/event_class.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+class e107_event {
+	var $functions = array();
+	var $includes = array();
+	 
+	function register($eventname, $function, $include='') {
+		if ($include!='') {
+			$this->includes[$eventname][] = $include;
+		}
+		$this->functions[$eventname][] = $function;
+	}
+	 
+	function trigger($eventname, &$data) {
+		if (isset($this -> includes[$eventname])) {
+			foreach($this->includes[$eventname] as $evt_inc) {
+				if (file_exists($evt_inc)) {
+					include_once($evt_inc);
+				}
+			}
+		}
+		if (isset($this -> functions[$eventname])) {
+			foreach($this->functions[$eventname] as $evt_func) {
+				if (function_exists($evt_func)) {
+					$ret = $evt_func($data);
+					if ($ret!='') {
+						break;
+					}
+				}
+			}
+		}
+		return (isset($ret) ? $ret : false);
+	}
+}
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/file_class.php 75/e107_handlers/file_class.php
--- 6171/e107_handlers/file_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/file_class.php	2006-01-31 13:36:21.000000000 -0600
@@ -0,0 +1,178 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/file_class.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2006/01/31 19:36:21 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e_file
+{
+	function get_files($path, $fmask = '', $omit='standard', $recurse_level = 0, $current_level = 0)
+	{
+		$ret = array();
+		if($recurse_level != 0 && $current_level > $recurse_level)
+		{
+			return $ret;
+		}
+		if(substr($path,-1) == '/')
+		{
+			$path = substr($path, 0, -1);
+		}
+
+		if(!$handle = opendir($path))
+		{
+			return $ret;
+		}
+		if($omit == 'standard')
+		{
+			$rejectArray = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$');
+		}
+		else
+		{
+			if(is_array($omit))
+			{
+				$rejectArray = $omit;
+			}
+			else
+			{
+				$rejectArray = array($omit);
+			}
+		}
+		while (false !== ($file = readdir($handle)))
+		{
+			if(is_dir($path.'/'.$file))
+			{
+				if($file != '.' && $file != '..' && $file != 'CVS' && $recurse_level > 0 && $current_level < $recurse_level)
+				{
+					$xx = $this->get_files($path.'/'.$file, $fmask, $omit, $recurse_level, $current_level+1);
+					$ret = array_merge($ret,$xx);
+				}
+			}
+			elseif ($fmask == '' || preg_match("#".$fmask."#", $file))
+			{
+				$rejected = FALSE;
+
+				foreach($rejectArray as $rmask)
+				{
+					if(preg_match("#".$rmask."#", $file))
+					{
+						$rejected = TRUE;
+						break;
+					}
+				}
+				if($rejected == FALSE)
+				{
+					$finfo['path'] = $path."/";  // important: leave this slash here and update other file instead.
+					$finfo['fname'] = $file;
+					$ret[] = $finfo;
+				}
+			}
+		}
+		return $ret;
+	}
+
+	function get_dirs($path, $fmask = '', $omit='standard')
+	{
+		$ret = array();
+		if(substr($path,-1) == '/')
+		{
+			$path = substr($path, 0, -1);
+		}
+
+		if(!$handle = opendir($path))
+		{
+			return $ret;
+		}
+		if($omit == 'standard')
+		{
+			$rejectArray = array('^\.$','^\.\.$','^\/$','^CVS$','thumbs\.db','.*\._$');
+		}
+		else
+		{
+			if(is_array($omit))
+			{
+				$rejectArray = $omit;
+			}
+			else
+			{
+				$rejectArray = array($omit);
+			}
+		}
+		while (false !== ($file = readdir($handle)))
+		{
+			if(is_dir($path.'/'.$file) && ($fmask == '' || preg_match("#".$fmask."#", $file)))
+			{
+				$rejected = FALSE;
+				foreach($rejectArray as $rmask)
+				{
+					if(preg_match("#".$rmask."#", $file))
+					{
+						$rejected = TRUE;
+						break;
+					}
+				}
+				if($rejected == FALSE)
+				{
+					$ret[] = $file;
+				}
+			}
+		}
+		return $ret;
+	}
+
+	function rmtree($dir)
+	{
+		if (substr($dir, strlen($dir)-1, 1) != '/')
+		{
+			$dir .= '/';
+		}
+		if ($handle = opendir($dir))
+		{
+			while ($obj = readdir($handle))
+			{
+				if ($obj != '.' && $obj != '..')
+				{
+					if (is_dir($dir.$obj))
+					{
+						if (!$this->rmtree($dir.$obj))
+						{
+							return false;
+						}
+					}
+					elseif (is_file($dir.$obj))
+					{
+						if (!unlink($dir.$obj))
+						{
+							return false;
+						}
+					}
+				}
+			}
+
+			closedir($handle);
+
+			if (!@rmdir($dir))
+			{
+				return false;
+			}
+			return true;
+		}
+		return false;
+	}
+
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/form_handler.php 75/e107_handlers/form_handler.php
--- 6171/e107_handlers/form_handler.php	2004-07-16 12:43:14.000000000 -0500
+++ 75/e107_handlers/form_handler.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,129 +1,135 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /classes/form_handler.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-class form{
-
-        function form_open($form_method, $form_action, $form_name="", $form_target = "", $form_enctype="", $form_js=""){
-                $method = ($form_method ? "method='".$form_method."'" : "");
-                $target = ($form_target ? " target='".$form_target."'" : "");
-                $name = ($form_name ? " id='".$form_name."' " : " id='myform'");
-                return "\n<form action='".$form_action."' ".$method.$target.$name.$form_enctype.$form_js.">";
-        }
-
-        function form_text($form_name, $form_size, $form_value, $form_maxlength, $form_class="tbox", $form_readonly="", $form_tooltip="", $form_js=""){
-                $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
-                $value = ($form_value ? " value='".$form_value."'" : "");
-                $size = ($form_size ? " size='".$form_size."'" : "");
-                $maxlength = ($form_maxlength ? " maxlength='".$form_maxlength."'" : "");
-                $readonly = ($form_readonly ? " readonly='readonly'" : "");
-                $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
-                return "\n<input class='".$form_class."' type='text' ".$name.$value.$size.$maxlength.$readonly.$tooltip.$form_js." />";
-        }
-
-        function form_password($form_name, $form_size, $form_value, $form_maxlength, $form_class="tbox", $form_readonly="", $form_tooltip="", $form_js=""){
-                $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
-                $value = ($form_value ? " value='".$form_value."'" : "");
-                $size = ($form_size ? " size='".$form_size."'" : "");
-                $maxlength = ($form_maxlength ? " maxlength='".$form_maxlength."'" : "");
-                $readonly = ($form_readonly ? " readonly='readonly'" : "");
-                $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
-                return "\n<input class='".$form_class."' type='password' ".$name.$value.$size.$maxlength.$readonly.$tooltip.$form_js." />";
-        }
-
-        function form_button($form_type, $form_name, $form_value, $form_js="", $form_image="", $form_tooltip=""){
-                $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
-                $image = ($form_image ? " src='".$form_image."' " : "");
-                $tooltip = ($form_tooltip ? " title='".$form_tooltip."' " : "");
-                return "\n<input class='button' type='".$form_type."' ".$form_js." value='".$form_value."'".$name.$image.$tooltip." />";
-        }
-
-        function form_textarea($form_name, $form_columns, $form_rows, $form_value, $form_js="", $form_style="", $form_wrap="", $form_readonly="", $form_tooltip=""){
-                $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
-                $readonly = ($form_readonly ? " readonly='readonly'" : "");
-                $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
-                $wrap = ($form_wrap ? " wrap='".$form_wrap."'" : "");
-                $style = ($form_style ? " style='".$form_style."'" : "");
-                return "\n<textarea class='tbox' cols='".$form_columns."' rows='".$form_rows."' ".$name.$form_js.$style.$wrap.$readonly.$tooltip.">".$form_value."</textarea>";
-        }
-
-        function form_checkbox($form_name, $form_value, $form_checked=0, $form_tooltip="", $form_js=""){
-                $name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : "");
-                $checked = ($form_checked ? " checked='checked'" : "");
-                $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
-                return "\n<input type='checkbox' value='".$form_value."'".$name.$checked.$tooltip.$form_js." />";
-
-        }
-
-        function form_radio($form_name, $form_value, $form_checked=0, $form_tooltip="", $form_js=""){
-                $name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : "");
-                $checked = ($form_checked ? " checked='checked'" : "");
-                $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
-                return "\n<input type='radio' value='".$form_value."'".$name.$checked.$tooltip.$form_js." />";
-
-        }
-
-        function form_file($form_name, $form_size, $form_tooltip="", $form_js=""){
-                $name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
-                $tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
-                return "<input type='file' class='tbox' size='".$form_size."'".$name.$tooltip.$form_js." />";
-        }
-
-        function form_select_open($form_name, $form_js=""){
-                return "\n<select id='".$form_name."' name='".$form_name."' class='tbox' ".$form_js." >";
-        }
-
-        function form_select_close(){
-                return "\n</select>";
-        }
-
-        function form_option($form_option, $form_selected="", $form_value="", $form_js=""){
-                $value = ($form_value ? " value='".$form_value."'" : "");
-                $selected = ($form_selected ? " selected='selected'" : "");
-                return "\n<option".$value.$selected." ".$form_js." >".$form_option."</option>";
-        }
-
-        function form_hidden($form_name, $form_value){
-                return "\n<input type='hidden' id='".$form_name."' name='".$form_name."' value='".$form_value."' />";
-        }
-
-        function form_close(){
-                return "\n</form>";
-        }
-}
-
-/*
-Usage
-echo $rs -> form_open("post", e_SELF, "_blank");
-echo $rs -> form_text("testname", 100, "this is the value", 100, 0, "tooltip");
-echo $rs -> form_button("submit", "testsubmit", "SUBMIT!", "", "Click to submit");
-echo $rs -> form_button("reset", "testreset", "RESET!", "", "Click to reset");
-echo $rs -> form_textarea("textareaname", 10, 10, "Value", "overflow:hidden");
-echo $rs -> form_checkbox("testcheckbox", 1, 1);
-echo $rs -> form_checkbox("testcheckbox2", 2);
-echo $rs -> form_hidden("hiddenname", "hiddenvalue");
-echo $rs -> form_radio("testcheckbox", 1, 1);
-echo $rs -> form_radio("testcheckbox", 1);
-echo $rs -> form_file("testfile", "20");
-echo $rs -> form_select_open("testselect");
-echo $rs -> form_option("Option 1");
-echo $rs -> form_option("Option 2");
-echo $rs -> form_option("Option 3", 1, "defaultvalue");
-echo $rs -> form_option("Option 4");
-echo $rs -> form_select_close();
-echo $rs -> form_close();
-*/
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/form_handler.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+class form {
+	 
+	function form_open($form_method, $form_action, $form_name = "", $form_target = "", $form_enctype = "", $form_js = "") {
+		$method = ($form_method ? "method='".$form_method."'" : "");
+		$target = ($form_target ? " target='".$form_target."'" : "");
+		$name = ($form_name ? " id='".$form_name."' " : " id='myform'");
+		return "\n<form action='".$form_action."' ".$method.$target.$name.$form_enctype.$form_js.">";
+	}
+	 
+	function form_text($form_name, $form_size, $form_value, $form_maxlength, $form_class = "tbox", $form_readonly = "", $form_tooltip = "", $form_js = "") {
+		$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
+		$value = ($form_value ? " value='".$form_value."'" : "");
+		$size = ($form_size ? " size='".$form_size."'" : "");
+		$maxlength = ($form_maxlength ? " maxlength='".$form_maxlength."'" : "");
+		$readonly = ($form_readonly ? " readonly='readonly'" : "");
+		$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
+		return "\n<input class='".$form_class."' type='text' ".$name.$value.$size.$maxlength.$readonly.$tooltip.$form_js." />";
+	}
+	 
+	function form_password($form_name, $form_size, $form_value, $form_maxlength, $form_class = "tbox", $form_readonly = "", $form_tooltip = "", $form_js = "") {
+		$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
+		$value = ($form_value ? " value='".$form_value."'" : "");
+		$size = ($form_size ? " size='".$form_size."'" : "");
+		$maxlength = ($form_maxlength ? " maxlength='".$form_maxlength."'" : "");
+		$readonly = ($form_readonly ? " readonly='readonly'" : "");
+		$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
+		return "\n<input class='".$form_class."' type='password' ".$name.$value.$size.$maxlength.$readonly.$tooltip.$form_js." />";
+	}
+	 
+	function form_button($form_type, $form_name, $form_value, $form_js = "", $form_image = "", $form_tooltip = "") {
+		$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
+		$image = ($form_image ? " src='".$form_image."' " : "");
+		$tooltip = ($form_tooltip ? " title='".$form_tooltip."' " : "");
+		return "\n<input class='button' type='".$form_type."' ".$form_js." value='".$form_value."'".$name.$image.$tooltip." />";
+	}
+	 
+	function form_textarea($form_name, $form_columns, $form_rows, $form_value, $form_js = "", $form_style = "", $form_wrap = "", $form_readonly = "", $form_tooltip = "") {
+		$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
+		$readonly = ($form_readonly ? " readonly='readonly'" : "");
+		$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
+		$wrap = ($form_wrap ? " wrap='".$form_wrap."'" : "");
+		$style = ($form_style ? " style='".$form_style."'" : "");
+		return "\n<textarea class='tbox' cols='".$form_columns."' rows='".$form_rows."' ".$name.$form_js.$style.$wrap.$readonly.$tooltip.">".$form_value."</textarea>";
+	}
+	 
+	function form_checkbox($form_name, $form_value, $form_checked = 0, $form_tooltip = "", $form_js = "") {
+		$name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : "");
+		$checked = ($form_checked ? " checked='checked'" : "");
+		$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
+		return "\n<input type='checkbox' value='".$form_value."'".$name.$checked.$tooltip.$form_js." />";
+		 
+	}
+	 
+	function form_radio($form_name, $form_value, $form_checked = 0, $form_tooltip = "", $form_js = "") {
+		$name = ($form_name ? " id='".$form_name.$form_value."' name='".$form_name."'" : "");
+		$checked = ($form_checked ? " checked='checked'" : "");
+		$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
+		return "\n<input type='radio' value='".$form_value."'".$name.$checked.$tooltip.$form_js." />";
+		 
+	}
+	 
+	function form_file($form_name, $form_size, $form_tooltip = "", $form_js = "") {
+		$name = ($form_name ? " id='".$form_name."' name='".$form_name."'" : "");
+		$tooltip = ($form_tooltip ? " title='".$form_tooltip."'" : "");
+		return "<input type='file' class='tbox' size='".$form_size."'".$name.$tooltip.$form_js." />";
+	}
+	 
+	function form_select_open($form_name, $form_js = "") {
+		return "\n<select id='".$form_name."' name='".$form_name."' class='tbox' ".$form_js." >";
+	}
+	 
+	function form_select_close() {
+		return "\n</select>";
+	}
+	 
+	function form_option($form_option, $form_selected = "", $form_value = "", $form_js = "") {
+		$value = ($form_value !== FALSE ? " value='".$form_value."'" : "");
+		$selected = ($form_selected ? " selected='selected'" : "");
+		return "\n<option".$value.$selected." ".$form_js.">".$form_option."</option>";
+	}
+	 
+	function form_hidden($form_name, $form_value) {
+		return "\n<input type='hidden' id='".$form_name."' name='".$form_name."' value='".$form_value."' />";
+	}
+	 
+	function form_close() {
+		return "\n</form>";
+	}
+}
+	
+/*
+Usage
+echo $rs->form_open("post", e_SELF, "_blank");
+echo $rs->form_text("testname", 100, "this is the value", 100, 0, "tooltip");
+echo $rs->form_button("submit", "testsubmit", "SUBMIT!", "", "Click to submit");
+echo $rs->form_button("reset", "testreset", "RESET!", "", "Click to reset");
+echo $rs->form_textarea("textareaname", 10, 10, "Value", "overflow:hidden");
+echo $rs->form_checkbox("testcheckbox", 1, 1);
+echo $rs->form_checkbox("testcheckbox2", 2);
+echo $rs->form_hidden("hiddenname", "hiddenvalue");
+echo $rs->form_radio("testcheckbox", 1, 1);
+echo $rs->form_radio("testcheckbox", 1);
+echo $rs->form_file("testfile", "20");
+echo $rs->form_select_open("testselect");
+echo $rs->form_option("Option 1");
+echo $rs->form_option("Option 2");
+echo $rs->form_option("Option 3", 1, "defaultvalue");
+echo $rs->form_option("Option 4");
+echo $rs->form_select_close();
+echo $rs->form_close();
+*/
+	
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/forum_include.php 75/e107_handlers/forum_include.php
--- 6171/e107_handlers/forum_include.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/forum_include.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,61 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/forum_include.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+require_once(e_HANDLER.'multilang/pictures.php');
+	
+/**
+* @return string path to and filename of forum icon image
+*
+* @param string $filename  filename of forum image
+* @param string $eMLANG_folder if specified, indicates its a multilanguage image being processed and
+*       gives the subfolder of the image path to the eMLANG_path() function,
+*       default = FALSE
+* @param string $eMLANG_pref  if specified, indicates that $filename may be overridden by the
+*       $pref with $eMLANG_pref as its key if that pref is TRUE, default = FALSE
+*
+* @desc checks for the existence of a forum icon image in the themes forum folder and if it is found
+*  returns the path and filename of that file, otherwise it returns the path and filename of the
+*  default forum icon image in e_IMAGES. The additional $eMLANG args if specfied switch the process
+*  to the sister multi-language function eMLANG_path().
+*
+* @access public
+*/
+function img_path($filename, $eMLANG_folder = FALSE, $eMLANG_pref = FALSE) {
+	global $pref;
+	if ($eMLANG_folder) {
+		if ($eMLANG_pref) {
+			$filename = $pref[$eMLANG_pref] ? $pref[$eMLANG_pref] :
+			 $filename;
+		}
+		$image = eMLANG_path($filename, $eMLANG_folder);
+	} else {
+		$image = file_exists(THEME.'forum/'.$filename) ? THEME.'forum/'.$filename : e_IMAGE.'forum/'.$filename;
+	}
+	return $image;
+}
+	
+if (file_exists(THEME.'forum/forum_icons_template.php')) {
+	require_once(THEME.'forum/forum_icons_template.php');
+} else {
+	require_once(e_BASE.$THEMES_DIRECTORY.'templates/forum_icons_template.php');
+}
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/forum_mod.php 75/e107_handlers/forum_mod.php
--- 6171/e107_handlers/forum_mod.php	2004-08-08 10:13:12.000000000 -0500
+++ 75/e107_handlers/forum_mod.php	2005-12-28 08:03:36.000000000 -0600
@@ -1,87 +1,101 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107_handlers/forum_mod.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the	
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-function forum_thread_moderate($p)
-{
-	global $sql;
-
-	foreach($p as $key => $val)
-	{
-		if(preg_match("#(.*?)_(\d+)_x#",$key,$matches))
-		{
-			$act = $matches[1];
-			$id = $matches[2];
-	
-			switch($act)
-			{
-				case 'lock' :
-					$sql -> db_Update("forum_t", "thread_active='0' WHERE thread_id='$id' ");
-					return FORLAN_CLOSE;
-					break;
-
-				case 'unlock' :
-					$sql -> db_Update("forum_t", "thread_active='1' WHERE thread_id='$id' ");
-					return FORLAN_OPEN;
-					break;
-				
-				case 'stick' :
-					$sql -> db_Update("forum_t", "thread_s='1' WHERE thread_id='$id' ");
-					return FORLAN_STICK;
-					break;
-					
-				case 'unstick' :
-					$sql -> db_Update("forum_t", "thread_s='0' WHERE thread_id='$id' ");
-					return FORLAN_UNSTICK;
-					break;
-
-				case 'delete' :
-					return forum_delete_thread($id);
-					break;
-
-			}
-		}
-	}
-}
-
-function forum_delete_thread($thread_id)
-{
-	global $sql;
-	$sql -> db_Select("forum_t", "*", "thread_id='".$thread_id."' ");
-	$row = $sql -> db_Fetch(); extract($row);
-	if($thread_parent){ // is post a reply?
-		$sql -> db_Delete("forum_t", "thread_id='$thread_id' ");	// delete reply only
-		$sql -> db_Update("forum", "forum_replies=forum_replies-1 WHERE forum_id='$thread_forum_id' ");	// dec reply count by 1
-		
-		$sql -> db_Select("forum_t", "*", "thread_id=$thread_id");
-		$row = $sql -> db_Fetch(); extract($row);
-		$replies = $sql -> db_Count("forum_t", "(*)", "WHERE thread_parent='".$thread_parent."'");
-		$pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
-		
-		$pages= 0;
-		if($replies){
-			$pages = ((ceil($replies/$pref['forum_postspage']) -1) * $pref['forum_postspage']);
-		}
-		
-		$url = e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_parent.($pages ? ".$pages" : "");	// set return url
-		return FORLAN_26;
-	}else{	// post is thread
-		$sql -> db_Delete("poll", "poll_datestamp='$thread_id' ");	 // delete poll if there is one
-		$count = $sql -> db_Delete("forum_t", "thread_parent='$thread_id' ");	// delete replies and grab how many there were
-		$sql -> db_Delete("forum_t", "thread_id='$thread_id' ");	// delete the post itself
-		$sql -> db_Update("forum", "forum_threads=forum_threads-1, forum_replies=forum_replies-$count WHERE forum_id='$thread_forum_id' ");	// update thread/reply counts
-		$url = e_BASE."forum_viewforum.php?".$forum_id;	// set return url
-		return FORLAN_6.($count ? ", ".$count." ".FORLAN_7."." : ".");
-	}
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/forum_mod.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/28 14:03:36 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+function forum_thread_moderate($p) {
+	global $sql;
+	 
+	foreach($p as $key => $val) {
+		if (preg_match("#(.*?)_(\d+)_x#", $key, $matches)) {
+			$act = $matches[1];
+			$id = $matches[2];
+			 
+			switch($act) {
+				case 'lock' :
+				$sql->db_Update("forum_t", "thread_active='0' WHERE thread_id='".intval($id)."' ");
+				return FORLAN_CLOSE;
+				break;
+				 
+				case 'unlock' :
+				$sql->db_Update("forum_t", "thread_active='1' WHERE thread_id='".intval($id)."' ");
+				return FORLAN_OPEN;
+				break;
+				 
+				case 'stick' :
+				$sql->db_Update("forum_t", "thread_s='1' WHERE thread_id='".intval($id)."' ");
+				return FORLAN_STICK;
+				break;
+				 
+				case 'unstick' :
+				$sql->db_Update("forum_t", "thread_s='0' WHERE thread_id='".intval($id)."' ");
+				return FORLAN_UNSTICK;
+				break;
+				 
+				case 'delete' :
+				return forum_delete_thread($id);
+				break;
+				 
+			}
+		}
+	}
+}
+	
+function forum_delete_thread($thread_id) {
+	global $sql;
+	$sql->db_Select("forum_t", "*", "thread_id='".intval($thread_id)."' ");
+	$row = $sql->db_Fetch();
+	 extract($row);
+	if ($thread_parent) {
+		// is post a reply?
+		$sql->db_Delete("forum_t", "thread_id = '".intval($thread_id)."' ");
+		// delete reply only
+		$sql->db_Update("forum", "forum_replies=forum_replies-1 WHERE forum_id='{$thread_forum_id}'");
+		// dec reply count by 1
+		 
+		$sql->db_Select("forum_t", "*", "thread_id = ".intval($thread_id));
+		$row = $sql->db_Fetch();
+		 extract($row);
+		$replies = $sql->db_Count("forum_t", "(*)", "WHERE thread_parent='".$thread_parent."'");
+		$pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
+		 
+		$pages = 0;
+		if ($replies) {
+			$pages = ((ceil($replies / $pref['forum_postspage']) -1) * $pref['forum_postspage']);
+		}
+		 
+		$url = e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_parent.($pages ? ".$pages" : "");
+		// set return url
+		return FORLAN_26;
+	} else {
+		// post is thread
+		$sql->db_Delete("poll", "poll_datestamp='".intval($thread_id)."'");
+		// delete poll if there is one
+		$count = $sql->db_Delete("forum_t", "thread_parent='".intval($thread_id)."'");
+		// delete replies and grab how many there were
+		$sql->db_Delete("forum_t", "thread_id='".intval($thread_id)."'");
+		// delete the post itself
+		$sql->db_Update("forum", "forum_threads=forum_threads-1, forum_replies = forum_replies - {$count} WHERE forum_id = '{$thread_forum_id}'");
+		// update thread/reply counts
+		$url = e_BASE."forum_viewforum.php?".$forum_id;
+		// set return url
+		return FORLAN_6.($count ? ", ".$count." ".FORLAN_7."." : ".");
+	}
+}
+	
\ No newline at end of file
diff -ruN 6171/e107_handlers/forum.php 75/e107_handlers/forum.php
--- 6171/e107_handlers/forum.php	2004-03-23 21:59:28.000000000 -0600
+++ 75/e107_handlers/forum.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,613 +1,593 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/forum.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the	
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../class2.php");
-if(!getperms("5")){ header("location:".e_BASE."index.php"); exit; }
-require_once("auth.php");
-require_once(e_HANDLER."userclass_class.php");
-$aj = new textparse;
-
-if(e_QUERY){
-	$qs = explode(".", e_QUERY);
-	$action = $qs[0];
-	$forum_id = $qs[1];
-	$forum_order = $qs[2];
-}
-
-$sql2 = new db;
-
-if(IsSet($_POST['prune'])){
-	if(!$_POST['prune_days']){
-		$message = FORLAN_1;
-	}else{
-
-		$text = "<div style='text-align:center'>
-		<form method='post' action='".e_SELF."'>\n
-		<table style='width:85%' class='fborder'>
-		<tr>
-		<td style='width:75%' class='forumheader3'>
-		".FORLAN_106."<br />
-		<span class='smalltext'>".FORLAN_2."</span>
-		</td>
-		<td style='width:25%' class='forumheader2' style='text-align:right'>
-		<input type='radio' name='prune_type' value='delete'> ".FORLAN_3."<br />
-		<input type='radio' name='prune_type' value='unactivatate' checked> ".FORLAN_4."
-		</td>
-		</tr>
-		<tr>
-		<td colspan='2'  style='text-align:center' class='forumheader'>
-		<input class='button' type='submit' name='doprune' value='".FORLAN_5."' /> 
-		<input class='button' type='submit' name='cancelprune' value='".FORLAN_6."' />
-		<input type='hidden' name='prune_days' value='".$_POST['prune_days']."'>
-		</td>
-		</tr>
-
-		</table>
-		</form>
-		</div>";
-		$ns -> tablerender(FORLAN_7, $text);
-		require_once("footer.php");
-	}
-}
-
-if(IsSet($_POST['doprune'])){
-	if($_POST['prune_type'] == "delete"){
-		$prunedate = time() - ($_POST['prune_days']*86400);
-		if($sql -> db_Select("forum_t", "*", "thread_lastpost<$prunedate AND thread_parent=0 AND thread_s!=1")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				$sql2 -> db_Delete("forum_t", "thread_parent='$thread_id' ");	// delete replies
-				$sql2 -> db_Delete("forum_t", "thread_id='$thread_id' ");		// delete thread
-			}
-
-			$sql -> db_Select("forum", "*", "forum_parent!=0");
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				$threads = $sql2 -> db_Count("forum_t", "(*)", "WHERE thread_forum_id=$forum_id AND thread_parent=0");
-				$replies = $sql2 -> db_Count("forum_t", "(*)", "WHERE thread_forum_id=$forum_id AND thread_parent!=0");
-				$sql2 -> db_Update("forum", "forum_threads='$threads', forum_replies='$replies' WHERE forum_id='$forum_id' ");
-			}
-			$message = FORLAN_8;
-		}else{
-			$message = FORLAN_9;
-		}
-	}else{
-		$prunedate = time() - ($_POST['prune_days']*86400);
-		$sql -> db_Update("forum_t", "thread_active=0 WHERE thread_lastpost<$prunedate AND thread_parent=0 ");
-		$message = FORLAN_8;
-	}
-}
-
-/*
-if($action == "dec"){
-	$sql -> db_Update("forum", "forum_order=forum_order-1 WHERE forum_order='".($forum_order+1)."' ");
-	$sql -> db_Update("forum", "forum_order=forum_order+1 WHERE forum_id='$forum_id' ");
-	header("location: ".e_SELF);
-	exit;
-}
-
-if($action == "inc"){
-	$sql -> db_Update("forum", "forum_order=forum_order+1 WHERE forum_order='".($forum_order-1)."' ");
-	$sql -> db_Update("forum", "forum_order=forum_order-1 WHERE forum_id='$forum_id' ");
-	header("location: ".e_SELF);
-	exit;
-}
-*/
-
-if(IsSet($_POST['update_order'])){
-	extract($_POST);
-	while(list($key, $id) = each($forum_order_)){
-		$tmp = explode(".", $id);
-		$sql -> db_Update("forum", "forum_order=".$tmp[1]." WHERE forum_id=".$tmp[0]);
-		echo "forum_order=".$tmp[1]." WHERE forum_id=".$tmp[0]."<br />";
-	}
-	$message = FORLAN_73;
-}
-
-
-
-$sql -> db_Select("forum", "forum_id, forum_order", "forum_parent=0 ORDER BY forum_order ASC");
-$c=1;
-while($row = $sql -> db_Fetch()){
-	extract($row);
-	$sql2 -> db_Update("forum", "forum_order='$c' WHERE forum_id='$forum_id' ");
-	$c++;
-}
-$sql -> db_Select("forum", "forum_id, forum_order", "forum_parent!=0 ORDER BY forum_order ASC");
-while($row = $sql -> db_Fetch()){
-	extract($row);
-	$sql2 -> db_Update("forum", "forum_order='$c' WHERE forum_id='$forum_id' ");
-	$c++;
-}
-
-if(IsSet($_POST['updateoptions'])){
-	$pref['email_notify'] = $_POST['email_notify'];
-	$pref['forum_poll'] = $_POST['forum_poll'];
-	$pref['forum_popular'] = $_POST['forum_popular'];
-	$pref['forum_track'] = $_POST['forum_track'];
-	$pref['forum_eprefix'] = $_POST['forum_eprefix'];
-	$pref['forum_enclose'] = $_POST['forum_enclose'];
-	$pref['forum_title'] = $_POST['forum_title'];
-	$pref['forum_postspage'] = $_POST['forum_postspage'];
-	$pref['forum_levels'] = $_POST['forum_levels'];
-	$pref['image_post'] = $_POST['image_post'];
-	$pref['html_post'] = $_POST['html_post'];
-	$pref['forum_attach'] = $_POST['forum_attach'];
-	save_prefs();
-	$message = FORLAN_10;
-}
-
-If(IsSet($_POST['submit'])){
-
-	$c = 0;
-	while($_POST['mod'][$c]){
-		$mods .= $_POST['mod'][$c].", ";
-		$c++;
-	}
-	$mods = ereg_replace(", $", ".", $mods);
-
-	$sql -> db_Select("forum", "*", "forum_name='".$_POST['parentforum']."' ");
-	$row = $sql -> db_Fetch();
-	$forum_parent = $row['forum_id'];
-	$_POST['forum_name'] = $aj -> formtpa($_POST['forum_name'], "admin");
-	$_POST['forum_description'] = $aj -> formtpa($_POST['forum_description'], "admin");
-
-	$sql -> db_Insert("forum", "0, '".$_POST['forum_name']."', '".$_POST['forum_description']."', '".$forum_parent."', '".time()."', '".$mods."', 0, 0, 0, '".$_POST['forum_class']."', 0 ");
-	unset($forum_name, $forum_description, $forum_parent);
-	$message = FORLAN_11;
-}
-
-If(IsSet($_POST['update'])){
-
-	$c = 0;
-	while($_POST['mod'][$c]){
-		$mods .= $_POST['mod'][$c].", ";
-		$c++;
-	}
-	$mods = ereg_replace(", $", ".", $mods);
-	$sql -> db_Select("forum", "*", "forum_name='".$_POST['parentforum']."' ");
-	$row = $sql -> db_Fetch();
-	$_POST['forum_name'] = $aj -> formtpa($_POST['forum_name'], "admin");
-	$_POST['forum_description'] = $aj -> formtpa($_POST['forum_description'], "admin");
-	$forum_parent = $row['forum_id'];
-	$sql -> db_Update("forum", "forum_name='".$_POST['forum_name']."', forum_description='".$_POST['forum_description']."', forum_parent='".$forum_parent."', forum_moderators='".$mods."', forum_class='".$_POST['forum_class']."' WHERE forum_id='".$_POST['forum_id']."' ");
-	unset($forum_name, $forum_description, $forum_parent, $forum_active);
-	$message = FORLAN_12;
-}
-
-If(IsSet($_POST['psubmit'])){
-	$_POST['parent'] = $aj -> formtpa($_POST['parent'], "admin");
-	$sql -> db_Insert("forum", "0, '".$_POST['parent']."', '', '', '".time()."', '0', '0', '0', '', '".$_POST['parent_class']."', 0 ");
-	unset($parent);
-	$message = FORLAN_13;
-}
-
-If(IsSet($_POST['pupdate'])){
-	$_POST['parent'] = $aj -> formtpa($_POST['parent'], "admin");
-	$sql -> db_Update("forum", "forum_name='".$_POST['parent']."', forum_class='".$_POST['parent_class']."' WHERE forum_id='".$_POST['existing']."' ");
-	unset($parent);
-	$message = FORLAN_14;
-}
-
-If(IsSet($_POST['pedit'])){
-	$sql -> db_Select("forum", "*", "forum_id='".$_POST['existing']."' ");
-	list($forum_id, $parent, $forum_description, $forum_parent, $forum_datestamp, $forum_moderators, $forum_threads, $forum_replies, $forum_lastpost, $parent_class) = $sql-> db_Fetch();
-	$parent = stripslashes($parent);
-}
-
-If(IsSet($_POST['edit'])){
-	$sql -> db_Select("forum", "*", "forum_id='".$_POST['existing']."' ");
-	list($forum_id, $forum_name, $forum_description, $forum_parent, $forum_datestamp, $forum_moderators, $forum_threads, $forum_replies, $forum_lastpost, $forum_class) = $sql-> db_Fetch();
-	$parent = stripslashes($parent);
-}
-
-If(IsSet($_POST['delete'])){
-	if($_POST['confirm']){
-		$sql -> db_Select("forum", "forum_id, forum_parent", "forum_id='".$_POST['existing']."' ");
-		$row = $sql -> db_Fetch();
-		extract($row);
-		$tt = ($forum_parent ? "" : "parent"); 
-		$sql -> db_Delete("forum", "forum_id='".$_POST['existing']."' ");
-		$message = FORLAN_107.$tt.FORLAN_108;
-	}else{
-		$message = FORLAN_15;
-	}
-}
-
-
-if(IsSet($message)){
-	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-$ns -> tablerender("<div style='text-align:center'>".FORLAN_16."</div>", $text);
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>\n
-<table style='width:85%' class='fborder'>
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'>";
-
-$forum_parent_total = $sql -> db_Select("forum", "*", "forum_parent='0' ");
-if($forum_parent_total == 0){
-	$text .= "<span class='defaulttext'>".FORLAN_17."</span>";
-}else{
-	$text .= "<span class='defaulttext'>".FORLAN_18.": </span>
-<select name='existing' class='tbox'>";
-	$c = 0;
-	while(list($forum_id_, $forum_parent_) = $sql-> db_Fetch()){
-		$parents[$c] = $forum_parent_;
-		$parents_id[$c] = $forum_id_;
-		$text .= "<option value='$forum_id_'>".$parents[$c]."</option>";
-		$c++;
-	}
-	$text .= "</select>
-<input class='button' type='submit' name='pedit' value='".FORLAN_19."' /> 
-<input class='button' type='submit' name='delete' value='".FORLAN_20."' />
-<input type=\"checkbox\" name=\"confirm\" value=\"1\"><span class=\"smalltext\"> ".FORLAN_21."</span>
-";
-}
-$text .= "
-</td>
-</tr>
-<tr>
-<td style='width:20%' class='forumheader3'><u>".FORLAN_22."</u>:</td>
-<td style='width:80%' class='forumheader3'>
-<input class='tbox' type='text' name='parent' size='60' value='$parent' maxlength='250' />
-</td>
-</tr>
-
-<tr> 
-<td style='width:20%' class='forumheader3'>".FORLAN_23.":<br /><span class='smalltext'>(".FORLAN_24.")</span></td>
-<td style='width:80%' class='forumheader3'>".r_userclass("parent_class",$parent_class);
-
-$text .= "<tr style='vertical-align:top'> 
-<td colspan='2'  style='text-align:center' class='forumheader'>";
-
-if(IsSet($_POST['pedit'])){
-	$text .= "<input class='button' type='submit' name='pupdate' value='".FORLAN_25."' />
-<input type='hidden' name='existing' value='".$_POST['existing']."'>";
-}else{
-	$text .= "<input class='button' type='submit' name='psubmit' value='".FORLAN_26."' />";
-}
-
-$text .= "</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("Parents", $text);
-
-if($forum_parent_total == 0){
-	$text = "<div style='text-align:center'>".FORLAN_27."</div>";
-	$ns -> tablerender(FORLAN_28, $text);
-	require_once("footer.php");
-	exit;
-}
-
-
-$forum_total = $sql -> db_Select("forum", "*", "forum_parent!='0' ");
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>\n
-<table style='width:85%' class='fborder'>
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'>";
-
-if($forum_total == "0"){
-	$text .= "<span class='defaulttext'>".FORLAN_29."</span>";
-}else{
-	$text .= "<span class='defaulttext'>".FORLAN_30.": </span>
-	<select name='existing' class='tbox'>";
-	while(list($forum_id_, $forum_name_) = $sql-> db_Fetch()){
-		$text .= "<option value='$forum_id_'>".$forum_name_."</option>";
-	}
-	$text .= "</select> 
-	<input class='button' type='submit' name='edit' value='".FORLAN_19."' /> 
-	<input class='button' type='submit' name='delete' value='".FORLAN_20."' />
-	<input type='checkbox' name='confirm' value='1'><span class='smalltext'> ".FORLAN_21."</span>
-	";
-}
-
-$text .= "
-</td>
-</tr>
-<tr>
-<td style='width:20%' class='forumheader3'><u>".FORLAN_22."</u>:</td>
-<td style='width:80%' class='forumheader3'>
-<select name='parentforum' class='tbox'>";
-$c = 0;
-	while($parents[$c]){
-		if($parents_id[$c] == $forum_parent){
-			$text .= "<option selected>".$parents[$c]."</option>";
-		}else{
-			$text .= "<option>".$parents[$c]."</option>";
-		}
-		$c++;
-	}
-$text .= "</select>
-</td>
-</tr>
-
-
-
-<tr>
-<td style='width:20%' class='forumheader3'><u>".FORLAN_31."</u>:</td>
-<td style='width:80%' class='forumheader3'>
-<input class='tbox' type='text' name='forum_name' size='60' value='$forum_name' maxlength='100' />
-</td>
-</tr>
-<tr>
-
-<td style='width:20%' class='forumheader3'><u>".FORLAN_32."</u>: </td>
-<td style='width:80%' class='forumheader3'>
-<textarea class='tbox' name='forum_description' cols='50' rows='5'>$forum_description</textarea>
-</td>
-</tr>
-
-<tr> 
-<td style='width:20%' class='forumheader3'>".FORLAN_23.":<br /><span class='smalltext'>(".FORLAN_24.")</span></td>
-<td style='width:80%' class='forumheader3'>".r_userclass("forum_class", $forum_class, "on")."
-</td></tr><tr>
-
-<td style='width:20%' class='forumheader3'>".FORLAN_33.":<br /><span class='smalltext'>(".FORLAN_34.")</span></td>
-<td style='width:80%' class='forumheader3'>";
-$admin_no = $sql -> db_Select("user", "*", "user_admin='1' AND user_perms REGEXP('A.') OR user_perms='0' "); 
-while($row = $sql-> db_Fetch()){	
-	extract($row);
-	$text .= "<input type='checkbox' name='mod[]' value='".$user_name ."'";
-	if(preg_match('/'.preg_quote($user_name).'/', $forum_moderators)){
-		$text .= " checked";
-	}
-	$text .= "> ".$user_name ."<br />";
-}
-
-$text .= "</td>
-</tr>
-<tr style='vertical-align:top'> 
-<td colspan='2'  style='text-align:center' class='forumheader'>";
-
-
-If(IsSet($_POST['edit'])){
-	$text .= "<input class='button' type='submit' name='update' value='".FORLAN_35."' />
-	<input type='hidden' name='forum_id' value='".$forum_id."'>";
-}else{
-	$text .= "<input class='button' type='submit' name='submit' value='".FORLAN_36."' />";
-}
-
-$text .= "</td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender("Forums", $text);
-
-
-$text = "<div style='text-align:center'>
-<table style='width:95%' class='fborder'>
-<form method='post' action='".e_SELF."'>
-<tr>
-<td colspan='2' style='width:70%; text-align:center' class='fcaption'>".FORLAN_28."</td>
-<td style='width:30%; text-align:center' class='fcaption'>".FORLAN_37."</td>
-</tr>";
-
-if(!$parent_amount = $sql -> db_Select("forum", "*", "forum_parent='0' ORDER BY forum_order ASC")){
-	$text .= "<tr><td class='forumheader3' style='text-align:center' colspan='3'>".FORLAN_29."</td></tr>";
-}else{
-	$sql2 = new db; $sql3 = new db;
-	while($row = $sql-> db_Fetch()){
-		extract($row);
-		if($forum_class==255){
-			$text .= "<tr><td colspan='2' class='forumheader'>".$forum_name." (".FORLAN_38.")</td>";
-		}else if($forum_class==254){
-			$text .= "<tr><td colspan='2' class='forumheader'>".$forum_name." (".FORLAN_39.")</td>";
-		}else if($forum_class){
-			$text .= "<tr><td colspan='2' class='forumheader'>".$forum_name." (".FORLAN_40.")</td>";
-		}else{
-			$text .= "<tr><td colspan='2' class='forumheader'>".$forum_name."</td>";
-		}
-
-		$text .= "<td class='forumheader' style='text-align:center'>\n<select name='activate' class='tbox'>\n";
-		
-		for($a=1; $a<= $parent_amount; $a++){
-			$text .= ($forum_order == $a ? "<option value='$forum_id.$a' selected>$a</option>\n" : "<option value='$forum_id.$a'>$a</option>\n");
-		}
-
-		$text .= "</select></td></tr>";
-
-
-
-
-
-//		$text .= "<td class='forumheader' style='text-align:center'>\n<select name='activate' onChange='urljump(this.options[selectedIndex].value)' class='tbox'>\n<option value='forum.php' selected></option>\n<option value='forum.php?inc.".$forum_id.".".$forum_order."'>move up!!</option>\n<option value='forum.php?dec.".$forum_id.".".$forum_order."'>move down</option>\n</select>\n</td></tr>";
-
-
-
-		$forums = $sql2 -> db_Select("forum", "*", "forum_parent='".$forum_id."' ORDER BY forum_order ASC");
-		if(!$forums){
-			$text .= "<td colspan='4' style='text-align:center' class='forumheader3'>".FORLAN_29."</td>";
-		}else{
-			while($row = $sql2-> db_Fetch()){
-				extract($row);
-
-				$text .= "<tr><td style='width:5%; text-align:center' class='forumheader2'><img src='".e_IMAGE."forum/new.png' alt='' /></td>\n<td style='width:55%' class='forumheader2'><a href='".e_BASE."forum_viewforum.php?".$forum_id."'>".$forum_name."</a><br /><span class='smallblacktext'>".$forum_description."</span></td>
-				<td colspan='2' class='forumheader3' style='text-align:center'>\n<select name='forum_order_[]' class='tbox'>\n";
-				for($a=1; $a<= $forums; $a++){
-					$text .= ($forum_order == $a ? "<option value='$forum_id.$a' selected>$a</option>\n" : "<option value='$forum_id.$a'>$a</option>\n");
-				}
-
-				$text .= "</select>\n</td>\n</tr>";
-
-
-				/*
-				$text .= "<tr><td style='width:5%; text-align:center' class='forumheader2'><img src='".e_IMAGE."forum/new.png' alt='' /></td>\n<td style='width:55%' class='forumheader2'><a href='".e_BASE."forum_viewforum.php?".$forum_id."'>".$forum_name."</a><br /><span class='smallblacktext'>".$forum_description."</span></td>
-				<td colspan='2' class='forumheader3' style='text-align:center'>\n<select name='activate' onChange='urljump(this.options[selectedIndex].value)' class='tbox'>\n<option value='forum.php' selected></option>\n<option value='forum.php?inc.".$forum_id.".".$forum_order."'>".FORLAN_41."</option>\n<option value='forum.php?dec.".$forum_id.".".$forum_order."'>".FORLAN_42."</option>\n</select>\n</td>\n</tr>";
-				*/
-			}
-		}
-	}
-}
-
-$text .= "<tr>
-<td colspan='4' style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='update_order' value='".FORLAN_72."' />
-</td>
-</tr>
-
-</table></form></div>";
-$ns -> tablerender(FORLAN_43, $text);
-
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>\n
-<table style='width:85%' class='fborder'>
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_44."<br />
-<span class='smalltext'>".FORLAN_45."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>".
-($pref['forum_enclose'] ? "<input type='checkbox' name='forum_enclose' value='1' checked>" : "<input type='checkbox' name='forum_enclose' value='1'>")."
-</td>
-</tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_65."<br />
-<span class='smalltext'>".FORLAN_46."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>
-<input class='tbox' type='text' name='forum_title' size='15' value='".$pref['forum_title']."' maxlength='20' />
-</td>
-</tr>
-
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_47."<br />
-<span class='smalltext'>".FORLAN_48."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>".
-($pref['email_notify'] ? "<input type='checkbox' name='email_notify' value='1' checked>" : "<input type='checkbox' name='email_notify' value='1'>")."
-</td>
-</tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_68."<br />
-<span class='smalltext'>".FORLAN_69."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>".
-($pref['html_post'] ? "<input type='checkbox' name='html_post' value='1' checked>" : "<input type='checkbox' name='html_post' value='1'>")."
-</td>
-</tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_49."<br />
-<span class='smalltext'>".FORLAN_50."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>".
-($pref['forum_poll'] ? "<input type='checkbox' name='forum_poll' value='1' checked>" : "<input type='checkbox' name='forum_poll' value='1'>")."
-</tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_70."<br />
-<span class='smalltext'>".FORLAN_71."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>".
-($pref['forum_attach'] ? "<input type='checkbox' name='forum_attach' value='1' checked>" : "<input type='checkbox' name='forum_attach' value='1'>")."
-</td>
-</tr>
-
-
-
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_51."<br />
-<span class='smalltext'>".FORLAN_52."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>".
-($pref['forum_track'] ? "<input type='checkbox' name='forum_track' value='1' checked>" : "<input type='checkbox' name='forum_track' value='1'>")."
-</tr>
-
-
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_53."<br />
-<span class='smalltext'>".FORLAN_54."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>
-<input class='tbox' type='text' name='forum_eprefix' size='15' value='".$pref['forum_eprefix']."' maxlength='20' />
-</tr>
-
-
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_55."<br />
-<span class='smalltext'>".FORLAN_56."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>
-<input class='tbox' type='text' name='forum_popular' size='3' value='".$pref['forum_popular']."' maxlength='3' />
-</tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_57."<br />
-<span class='smalltext'>".FORLAN_58."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>
-<input class='tbox' type='text' name='forum_postspage' size='3' value='".$pref['forum_postspage']."' maxlength='3' />
-</tr>
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_63."<br />
-<span class='smalltext'>".FORLAN_64."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>
-<textarea class='tbox' name='forum_levels' cols='15' rows='5'>".$pref['forum_levels']."</textarea>
-</td>
-</tr>
-
-
-<tr>
-<td style='width:75%' class='forumheader3'>
-".FORLAN_59."<br />
-<span class='smalltext'>".FORLAN_60."</span>
-</td>
-<td style='width:25%' class='forumheader2' style='text-align:center'>
-<span class='smalltext'>".FORLAN_109."</span> <input class='tbox' type='text' name='prune_days' size='3' value='' maxlength='3' />
- <input class='button' type='submit' name='prune' value='".FORLAN_110."' />
-</tr>
-
-
-<tr style='vertical-align:top'> 
-<td colspan='2'  style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='updateoptions' value='".FORLAN_61."' />
-</td>
-</tr>
-
-</table>
-</form>
-</div>";
-$ns -> tablerender(FORLAN_62, $text);
-
-require_once("footer.php");
-?>	
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/forum.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+require_once("../class2.php");
+if (!getperms("5")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+require_once("auth.php");
+require_once(e_HANDLER."userclass_class.php");
+$aj = new textparse;
+
+if (e_QUERY) {
+	$qs = explode(".", e_QUERY);
+	$action = $qs[0];
+	$forum_id = $qs[1];
+	$forum_order = $qs[2];
+}
+
+$sql2 = new db;
+
+if (isset($_POST['prune'])) {
+	if (!$_POST['prune_days']) {
+		$message = FORLAN_1;
+	} else {
+
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."'>\n
+			<table style='width:85%' class='fborder'>
+			<tr>
+			<td style='width:75%' class='forumheader3'>
+			".FORLAN_106."<br />
+			<span class='smalltext'>".FORLAN_2."</span>
+			</td>
+			<td style='width:25%' class='forumheader2' style='text-align:right'>
+			<input type='radio' name='prune_type' value='delete'> ".FORLAN_3."<br />
+			<input type='radio' name='prune_type' value='unactivatate' checked> ".FORLAN_4."
+			</td>
+			</tr>
+			<tr>
+			<td colspan='2'  style='text-align:center' class='forumheader'>
+			<input class='button' type='submit' name='doprune' value='".FORLAN_5."' />
+			<input class='button' type='submit' name='cancelprune' value='".FORLAN_6."' />
+			<input type='hidden' name='prune_days' value='".$_POST['prune_days']."'>
+			</td>
+			</tr>
+			 
+			</table>
+			</form>
+			</div>";
+		$ns->tablerender(FORLAN_7, $text);
+		require_once("footer.php");
+	}
+}
+
+if (isset($_POST['doprune'])) {
+	if ($_POST['prune_type'] == "delete") {
+		$prunedate = time() - ($_POST['prune_days'] * 86400);
+		if ($sql->db_Select("forum_t", "*", "thread_lastpost < {$prunedate} AND thread_parent=0 AND thread_s!=1")) {
+			while ($row = $sql->db_Fetch()) {
+				extract($row);
+				$sql2->db_Delete("forum_t", "thread_parent = '{$thread_id}' ");
+				// delete replies
+				$sql2->db_Delete("forum_t", "thread_id = '{$thread_id}' ");
+				// delete thread
+			}
+
+			$sql->db_Select("forum", "*", "forum_parent != 0");
+			while ($row = $sql->db_Fetch()) {
+				extract($row);
+				$threads = $sql2->db_Count("forum_t", "(*)", "WHERE thread_forum_id = {$forum_id} AND thread_parent = 0");
+				$replies = $sql2->db_Count("forum_t", "(*)", "WHERE thread_forum_id = {$forum_id} AND thread_parent != 0");
+				$sql2->db_Update("forum", "forum_threads = '{$threads}', forum_replies = '{$replies}' WHERE forum_id = '{$forum_id}'");
+			}
+			$message = FORLAN_8;
+		} else {
+			$message = FORLAN_9;
+		}
+	} else {
+		$prunedate = time() - ($_POST['prune_days'] * 86400);
+		$sql->db_Update("forum_t", "thread_active = 0 WHERE thread_lastpost < {$prunedate} AND thread_parent=0 ");
+		$message = FORLAN_8;
+	}
+}
+
+if (isset($_POST['update_order'])) {
+	extract($_POST);
+	while (list($key, $id) = each($forum_order_)) {
+		$tmp = explode(".", $id);
+		$sql->db_Update("forum", "forum_order = {$tmp[1]} WHERE forum_id = {$tmp[0]}");
+		echo "forum_order = {$tmp[1]} WHERE forum_id = {$tmp[0]}<br />";
+	}
+	$message = FORLAN_73;
+}
+
+
+
+$sql->db_Select("forum", "forum_id, forum_order", "forum_parent=0 ORDER BY forum_order ASC");
+$c = 1;
+while ($row = $sql->db_Fetch()) {
+	extract($row);
+	$sql2->db_Update("forum", "forum_order = '{$c}' WHERE forum_id = '{$forum_id}'");
+	$c++;
+}
+$sql->db_Select("forum", "forum_id, forum_order", "forum_parent != 0 ORDER BY forum_order ASC");
+while ($row = $sql->db_Fetch()) {
+	extract($row);
+	$sql2->db_Update("forum", "forum_order = '{$c}' WHERE forum_id = '{$forum_id}' ");
+	$c++;
+}
+
+if (isset($_POST['updateoptions'])) {
+	$pref['email_notify'] = $_POST['email_notify'];
+	$pref['forum_poll'] = $_POST['forum_poll'];
+	$pref['forum_popular'] = $_POST['forum_popular'];
+	$pref['forum_track'] = $_POST['forum_track'];
+	$pref['forum_eprefix'] = $_POST['forum_eprefix'];
+	$pref['forum_enclose'] = $_POST['forum_enclose'];
+	$pref['forum_title'] = $_POST['forum_title'];
+	$pref['forum_postspage'] = $_POST['forum_postspage'];
+	$pref['forum_levels'] = $_POST['forum_levels'];
+	$pref['image_post'] = $_POST['image_post'];
+	$pref['html_post'] = $_POST['html_post'];
+	$pref['forum_attach'] = $_POST['forum_attach'];
+	save_prefs();
+	$message = FORLAN_10;
+}
+
+If(isset($_POST['submit'])) {
+
+	$c = 0;
+	while ($_POST['mod'][$c]) {
+		$mods .= $_POST['mod'][$c].", ";
+		$c++;
+	}
+	$mods = preg_replace("/, $/", ".", $mods);
+
+	$sql->db_Select("forum", "*", "forum_name='".$_POST['parentforum']."' ");
+	$row = $sql->db_Fetch();
+	$forum_parent = $row['forum_id'];
+	$_POST['forum_name'] = $aj->formtpa($_POST['forum_name'], "admin");
+	$_POST['forum_description'] = $aj->formtpa($_POST['forum_description'], "admin");
+
+	$sql->db_Insert("forum", "0, '".$_POST['forum_name']."', '".$_POST['forum_description']."', '".$forum_parent."', '".time()."', '".$mods."', 0, 0, 0, '".$_POST['forum_class']."', 0 ");
+	unset($forum_name, $forum_description, $forum_parent);
+	$message = FORLAN_11;
+}
+
+If(isset($_POST['update'])) {
+
+	$c = 0;
+	while ($_POST['mod'][$c]) {
+		$mods .= $_POST['mod'][$c].", ";
+		$c++;
+	}
+	$mods = preg_replace("/, $/", ".", $mods);
+	$sql->db_Select("forum", "*", "forum_name='".$_POST['parentforum']."' ");
+	$row = $sql->db_Fetch();
+	$_POST['forum_name'] = $aj->formtpa($_POST['forum_name'], "admin");
+	$_POST['forum_description'] = $aj->formtpa($_POST['forum_description'], "admin");
+	$forum_parent = $row['forum_id'];
+	$sql->db_Update("forum", "forum_name='".$_POST['forum_name']."', forum_description='".$_POST['forum_description']."', forum_parent='".$forum_parent."', forum_moderators='".$mods."', forum_class='".$_POST['forum_class']."' WHERE forum_id='".$_POST['forum_id']."' ");
+	unset($forum_name, $forum_description, $forum_parent, $forum_active);
+	$message = FORLAN_12;
+}
+
+If(isset($_POST['psubmit'])) {
+	$_POST['parent'] = $aj->formtpa($_POST['parent'], "admin");
+	$sql->db_Insert("forum", "0, '".$_POST['parent']."', '', '', '".time()."', '0', '0', '0', '', '".$_POST['parent_class']."', 0 ");
+	unset($parent);
+	$message = FORLAN_13;
+}
+
+If(isset($_POST['pupdate'])) {
+	$_POST['parent'] = $aj->formtpa($_POST['parent'], "admin");
+	$sql->db_Update("forum", "forum_name='".$_POST['parent']."', forum_class='".$_POST['parent_class']."' WHERE forum_id='".$_POST['existing']."' ");
+	unset($parent);
+	$message = FORLAN_14;
+}
+
+If(isset($_POST['pedit'])) {
+	$sql->db_Select("forum", "*", "forum_id='".$_POST['existing']."' ");
+	list($forum_id, $parent, $forum_description, $forum_parent, $forum_datestamp, $forum_moderators, $forum_threads, $forum_replies, $forum_lastpost, $parent_class) = $sql->db_Fetch();
+	$parent = stripslashes($parent);
+}
+
+If(isset($_POST['edit'])) {
+	$sql->db_Select("forum", "*", "forum_id='".$_POST['existing']."' ");
+	list($forum_id, $forum_name, $forum_description, $forum_parent, $forum_datestamp, $forum_moderators, $forum_threads, $forum_replies, $forum_lastpost, $forum_class) = $sql->db_Fetch();
+	$parent = stripslashes($parent);
+}
+
+If(isset($_POST['delete'])) {
+	if ($_POST['confirm']) {
+		$sql->db_Select("forum", "forum_id, forum_parent", "forum_id='".$_POST['existing']."' ");
+		$row = $sql->db_Fetch();
+		extract($row);
+		$tt = ($forum_parent ? "" : "parent");
+		$sql->db_Delete("forum", "forum_id='".$_POST['existing']."' ");
+		$message = FORLAN_107.$tt.FORLAN_108;
+	} else {
+		$message = FORLAN_15;
+	}
+}
+
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>{$message}</b></div>");
+}
+
+$ns->tablerender("<div style='text-align:center'>".FORLAN_16."</div>", $text);
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>\n
+	<table style='width:85%' class='fborder'>
+	<tr>
+	<td colspan='2' class='forumheader' style='text-align:center'>";
+
+$forum_parent_total = $sql->db_Select("forum", "*", "forum_parent = '0' ");
+if ($forum_parent_total == 0) {
+	$text .= "<span class='defaulttext'>".FORLAN_17."</span>";
+} else {
+	$text .= "<span class='defaulttext'>".FORLAN_18.": </span>
+		<select name='existing' class='tbox'>\n";
+	$c = 0;
+	while (list($forum_id_, $forum_parent_) = $sql->db_Fetch()) {
+		$parents[$c] = $forum_parent_;
+		$parents_id[$c] = $forum_id_;
+		$text .= "<option value='{$forum_id_}'>{$parents[$c]}</option>\n";
+		$c++;
+	}
+	$text .= "</select>
+		<input class='button' type='submit' name='pedit' value='".FORLAN_19."' />
+		<input class='button' type='submit' name='delete' value='".FORLAN_20."' />
+		<input type=\"checkbox\" name=\"confirm\" value=\"1\"><span class=\"smalltext\"> ".FORLAN_21."</span>
+		";
+}
+$text .= "
+	</td>
+	</tr>
+	<tr>
+	<td style='width:20%' class='forumheader3'><u>".FORLAN_22."</u>:</td>
+	<td style='width:80%' class='forumheader3'>
+	<input class='tbox' type='text' name='parent' size='60' value='{$parent}' maxlength='250' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:20%' class='forumheader3'>".FORLAN_23.":<br /><span class='smalltext'>(".FORLAN_24.")</span></td>
+	<td style='width:80%' class='forumheader3'>".r_userclass("parent_class", $parent_class);
+
+$text .= "<tr style='vertical-align:top'>
+	<td colspan='2'  style='text-align:center' class='forumheader'>";
+
+if (isset($_POST['pedit'])) {
+	$text .= "<input class='button' type='submit' name='pupdate' value='".FORLAN_25."' />
+		<input type='hidden' name='existing' value='".$_POST['existing']."'>";
+} else {
+	$text .= "<input class='button' type='submit' name='psubmit' value='".FORLAN_26."' />";
+}
+
+$text .= "</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+
+$ns->tablerender("Parents", $text);
+
+if ($forum_parent_total == 0) {
+	$text = "<div style='text-align:center'>".FORLAN_27."</div>";
+	$ns->tablerender(FORLAN_28, $text);
+	require_once("footer.php");
+	exit;
+}
+
+
+$forum_total = $sql->db_Select("forum", "*", "forum_parent!='0' ");
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>\n
+	<table style='width:85%' class='fborder'>
+	<tr>
+	<td colspan='2' class='forumheader' style='text-align:center'>";
+
+if ($forum_total == "0") {
+	$text .= "<span class='defaulttext'>".FORLAN_29."</span>";
+} else {
+	$text .= "<span class='defaulttext'>".FORLAN_30.": </span>
+		<select name='existing' class='tbox'>";
+	while (list($forum_id_, $forum_name_) = $sql->db_Fetch()) {
+		$text .= "<option value='{$forum_id_}'>{$forum_name_}</option>";
+	}
+	$text .= "</select>
+		<input class='button' type='submit' name='edit' value='".FORLAN_19."' />
+		<input class='button' type='submit' name='delete' value='".FORLAN_20."' />
+		<input type='checkbox' name='confirm' value='1'><span class='smalltext'> ".FORLAN_21."</span>
+		";
+}
+
+$text .= "
+	</td>
+	</tr>
+	<tr>
+	<td style='width:20%' class='forumheader3'><u>".FORLAN_22."</u>:</td>
+	<td style='width:80%' class='forumheader3'>
+	<select name='parentforum' class='tbox'>";
+$c = 0;
+
+while ($parents[$c]) {
+	if ($parents_id[$c] == $forum_parent) {
+		$text .= "<option selected>{$parents[$c]}</option>\n";
+	} else {
+		$text .= "<option>{$parents[$c]}</option>\n";
+	}
+	$c++;
+}
+$text .= "</select>
+	</td>
+	</tr>
+	 
+	 
+	 
+	<tr>
+	<td style='width:20%' class='forumheader3'><u>".FORLAN_31."</u>:</td>
+	<td style='width:80%' class='forumheader3'>
+	<input class='tbox' type='text' name='forum_name' size='60' value='{$forum_name}' maxlength='100' />
+	</td>
+	</tr>
+	<tr>
+	 
+	<td style='width:20%' class='forumheader3'><u>".FORLAN_32."</u>: </td>
+	<td style='width:80%' class='forumheader3'>
+	<textarea class='tbox' name='forum_description' cols='50' rows='5'>{$forum_description}</textarea>
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:20%' class='forumheader3'>".FORLAN_23.":<br /><span class='smalltext'>(".FORLAN_24.")</span></td>
+	<td style='width:80%' class='forumheader3'>".r_userclass("forum_class", $forum_class, "on")."
+	</td></tr><tr>
+	 
+	<td style='width:20%' class='forumheader3'>".FORLAN_33.":<br /><span class='smalltext'>(".FORLAN_34.")</span></td>
+	<td style='width:80%' class='forumheader3'>";
+$admin_no = $sql->db_Select("user", "*", "user_admin='1' AND user_perms REGEXP('A.') OR user_perms='0' ");
+while ($row = $sql->db_Fetch()) {
+	extract($row);
+	$text .= "<input type='checkbox' name='mod[]' value='{$user_name}'";
+	if (strpos($forum_moderators, $user_name) !== FALSE) {
+		$text .= " checked";
+	}
+	$text .= "> {$user_name}<br />";
+}
+
+$text .= "</td>
+	</tr>
+	<tr style='vertical-align:top'>
+	<td colspan='2'  style='text-align:center' class='forumheader'>";
+
+
+If(isset($_POST['edit'])) {
+	$text .= "<input class='button' type='submit' name='update' value='".FORLAN_35."' />
+		<input type='hidden' name='forum_id' value='{$forum_id}'>";
+} else {
+	$text .= "<input class='button' type='submit' name='submit' value='".FORLAN_36."' />";
+}
+
+$text .= "</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+$ns->tablerender("Forums", $text);
+
+
+$text = "<div style='text-align:center'>
+	<table style='width:95%' class='fborder'>
+	<form method='post' action='".e_SELF."'>
+	<tr>
+	<td colspan='2' style='width:70%; text-align:center' class='fcaption'>".FORLAN_28."</td>
+	<td style='width:30%; text-align:center' class='fcaption'>".FORLAN_37."</td>
+	</tr>";
+
+if (!$parent_amount = $sql->db_Select("forum", "*", "forum_parent='0' ORDER BY forum_order ASC")) {
+	$text .= "<tr><td class='forumheader3' style='text-align:center' colspan='3'>".FORLAN_29."</td></tr>";
+} else {
+	$sql2 = new db;
+	$sql3 = new db;
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		if ($forum_class == 255) {
+			$text .= "<tr><td colspan='2' class='forumheader'>{$forum_name} (".FORLAN_38.")</td>";
+		}
+		else if($forum_class == 254) {
+			$text .= "<tr><td colspan='2' class='forumheader'>{$forum_name} (".FORLAN_39.")</td>";
+		}
+		else if($forum_class) {
+			$text .= "<tr><td colspan='2' class='forumheader'>{$forum_name} (".FORLAN_40.")</td>";
+		} else {
+			$text .= "<tr><td colspan='2' class='forumheader'>{$forum_name}</td>";
+		}
+
+		$text .= "<td class='forumheader' style='text-align:center'>\n<select name='activate' class='tbox'>\n";
+
+		for($a = 1; $a <= $parent_amount; $a++) {
+			$text .= ($forum_order == $a ? "<option value='{$forum_id}.{$a}' selected>{$a}</option>\n" : "<option value='{$forum_id}.{$a}'>$a</option>\n");
+		}
+
+		$text .= "</select></td></tr>\n";
+
+		$forums = $sql2->db_Select("forum", "*", "forum_parent = '{$forum_id}' ORDER BY forum_order ASC");
+		if (!$forums) {
+			$text .= "<td colspan='4' style='text-align:center' class='forumheader3'>".FORLAN_29."</td>";
+		} else {
+			while ($row = $sql2->db_Fetch()) {
+				extract($row);
+
+				$text .= "<tr><td style='width:5%; text-align:center' class='forumheader2'><img src='".e_IMAGE."forum/new.png' alt='' /></td>\n<td style='width:55%' class='forumheader2'><a href='".e_BASE."forum_viewforum.php?".$forum_id."'>".$forum_name."</a><br /><span class='smallblacktext'>".$forum_description."</span></td>
+					<td colspan='2' class='forumheader3' style='text-align:center'>\n<select name='forum_order_[]' class='tbox'>\n";
+				for($a = 1; $a <= $forums; $a++) {
+					$text .= ($forum_order == $a ? "<option value='{$forum_id}.{$a}' selected>{$a}</option>\n" : "<option value='{$forum_id}.{$a}'>{$a}</option>\n");
+				}
+
+				$text .= "</select>\n</td>\n</tr>";
+			}
+		}
+	}
+}
+
+$text .= "<tr>
+	<td colspan='4' style='text-align:center' class='forumheader'>
+	<input class='button' type='submit' name='update_order' value='".FORLAN_72."' />
+	</td>
+	</tr>
+	 
+	</table></form></div>";
+$ns->tablerender(FORLAN_43, $text);
+
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>\n
+	<table style='width:85%' class='fborder'>
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_44."<br />
+	<span class='smalltext'>".FORLAN_45."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>". ($pref['forum_enclose'] ? "<input type='checkbox' name='forum_enclose' value='1' checked>" : "<input type='checkbox' name='forum_enclose' value='1'>")."
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_65."<br />
+	<span class='smalltext'>".FORLAN_46."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>
+	<input class='tbox' type='text' name='forum_title' size='15' value='".$pref['forum_title']."' maxlength='20' />
+	</td>
+	</tr>
+	 
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_47."<br />
+	<span class='smalltext'>".FORLAN_48."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>". ($pref['email_notify'] ? "<input type='checkbox' name='email_notify' value='1' checked>" : "<input type='checkbox' name='email_notify' value='1'>")."
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_68."<br />
+	<span class='smalltext'>".FORLAN_69."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>". ($pref['html_post'] ? "<input type='checkbox' name='html_post' value='1' checked>" : "<input type='checkbox' name='html_post' value='1'>")."
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_49."<br />
+	<span class='smalltext'>".FORLAN_50."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>". ($pref['forum_poll'] ? "<input type='checkbox' name='forum_poll' value='1' checked>" : "<input type='checkbox' name='forum_poll' value='1'>")."
+	</tr>
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_70."<br />
+	<span class='smalltext'>".FORLAN_71."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>". ($pref['forum_attach'] ? "<input type='checkbox' name='forum_attach' value='1' checked>" : "<input type='checkbox' name='forum_attach' value='1'>")."
+	</td>
+	</tr>
+	 
+	 
+	 
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_51."<br />
+	<span class='smalltext'>".FORLAN_52."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>". ($pref['forum_track'] ? "<input type='checkbox' name='forum_track' value='1' checked>" : "<input type='checkbox' name='forum_track' value='1'>")."
+	</tr>
+	 
+	 
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_53."<br />
+	<span class='smalltext'>".FORLAN_54."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>
+	<input class='tbox' type='text' name='forum_eprefix' size='15' value='".$pref['forum_eprefix']."' maxlength='20' />
+	</tr>
+	 
+	 
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_55."<br />
+	<span class='smalltext'>".FORLAN_56."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>
+	<input class='tbox' type='text' name='forum_popular' size='3' value='".$pref['forum_popular']."' maxlength='3' />
+	</tr>
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_57."<br />
+	<span class='smalltext'>".FORLAN_58."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>
+	<input class='tbox' type='text' name='forum_postspage' size='3' value='".$pref['forum_postspage']."' maxlength='3' />
+	</tr>
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_63."<br />
+	<span class='smalltext'>".FORLAN_64."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>
+	<textarea class='tbox' name='forum_levels' cols='15' rows='5'>".$pref['forum_levels']."</textarea>
+	</td>
+	</tr>
+	 
+	 
+	<tr>
+	<td style='width:75%' class='forumheader3'>
+	".FORLAN_59."<br />
+	<span class='smalltext'>".FORLAN_60."</span>
+	</td>
+	<td style='width:25%' class='forumheader2' style='text-align:center'>
+	<span class='smalltext'>".FORLAN_109."</span> <input class='tbox' type='text' name='prune_days' size='3' value='' maxlength='3' />
+	<input class='button' type='submit' name='prune' value='".FORLAN_110."' />
+	</tr>
+	 
+	 
+	<tr style='vertical-align:top'>
+	<td colspan='2'  style='text-align:center' class='forumheader'>
+	<input class='button' type='submit' name='updateoptions' value='".FORLAN_61."' />
+	</td>
+	</tr>
+	 
+	</table>
+	</form>
+	</div>";
+$ns->tablerender(FORLAN_62, $text);
+
+require_once("footer.php");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/ChangeLog 75/e107_handlers/htmlarea/ChangeLog
--- 6171/e107_handlers/htmlarea/ChangeLog	2004-03-16 02:22:52.000000000 -0600
+++ 75/e107_handlers/htmlarea/ChangeLog	1969-12-31 18:00:00.000000000 -0600
@@ -1,1185 +0,0 @@
-2004-02-17  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/el.js, plugins/ContextMenu/lang/el.js, plugins/TableOperations/lang/el.js:
-	updated headers
-
-	* lang/no.js: updated (thanks havardw)
-
-2004-02-09  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/EnterParagraphs/enter-paragraphs.js:
-	Plugin that enables Mozilla to create a <p> instead of <br /> at ENTER.
-	Code contributed by Adam Wright.
-
-	* htmlarea.js: code to call onKeyPress for plugins that define it
-	code that keeps single spaces as &nbsp;
-	(thanks to hipikat @ IT forums (Adam Wright))
-
-	* ChangeLog:
-	ChangeLog is acutally automatically generated so there's no point keep it in CVS
-
-2004-02-08  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: fixed possible bug
-
-	* images/ed_align_center.gif, images/ed_align_justify.gif, images/ed_align_left.gif, images/ed_align_right.gif, images/ed_blank.gif, images/ed_charmap.gif, images/ed_color_bg.gif, images/ed_color_fg.gif, images/ed_copy.gif, images/ed_custom.gif, images/ed_cut.gif, images/ed_delete.gif, images/ed_format_bold.gif, images/ed_format_italic.gif, images/ed_format_strike.gif, images/ed_format_sub.gif, images/ed_format_sup.gif, images/ed_format_underline.gif, images/ed_help.gif, images/ed_hr.gif, images/ed_html.gif, images/ed_image.gif, images/ed_indent_less.gif, images/ed_indent_more.gif, images/ed_left_to_right.gif, images/ed_link.gif, images/ed_list_bullet.gif, images/ed_list_num.gif, images/ed_paste.gif, images/ed_redo.gif, images/ed_right_to_left.gif, images/ed_save.gif, images/ed_show_border.gif, images/ed_splitcel.gif, images/ed_undo.gif, images/fullscreen_maximize.gif, images/fullscreen_minimize.gif, images/insert_table.gif, images/ed_about.gif:
-	optimized images (thanks to Alexander Kandzior and OpenCMS group)
-
-2004-02-01  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* project-config.xml: release candidate 1
-
-	* release-notes.html: updated release notes
-
-	* examples/index.html, examples/makefile.xml:
-	added examples directory index
-
-	* release-notes.html: fix
-
-2004-01-31  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* makefile.xml: ensure correct file permissions
-
-	* plugins/SpellChecker/spell-check-logic.cgi, plugins/SpellChecker/spell-check-ui.html, plugins/SpellChecker/spell-check-ui.js:
-	spell checker now reports some document information (such as total number of
-	words, number of mispelled words, number of suggestions, etc)
-
-	* htmlarea.js: removed some custom attributes
-
-	* plugins/SpellChecker/spell-check-ui.js:
-	fixed bug (frame scroll in IE)
-
-2004-01-30  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* ChangeLog, release-notes.html: updated release notes, changelog
-
-	* plugins/SpellChecker/readme-tech.html:
-	updated text about Aspell Unicode support
-
-	* plugins/SpellChecker/spell-check-style.css: - lorem ipsum
-
-	* plugins/SpellChecker/spell-check-logic.cgi: - optimization
-
-	* plugins/SpellChecker/spell-check-logic.cgi:
-	- bugfix (removed <spellchecker> tags)
-
-	* plugins/SpellChecker/spell-check-logic.cgi:
-	bleah.. this version seems to be safer; no mo' HTML::Parser; DOM rulz.
-
-	* plugins/SpellChecker/spell-check-logic.cgi:
-	seems to be better now :-\  hell knows how perl & unicode works :-/
-
-	* plugins/SpellChecker/spell-check-logic.cgi, plugins/SpellChecker/spell-check-ui.js:
-	- big performance improvement (suggestion is now passed only once for each
-	  mispelled word)
-	- bugs fixed (text already corrected in Unicode is now correctly decoded)
-
-	* plugins/SpellChecker/lang/en.js: - added word "Revert"
-
-	* plugins/SpellChecker/spell-checker.js: - lorem ipsum
-	- window is a bit higher now (450px)
-
-	* plugins/SpellChecker/spell-check-ui.js:
-	- fixed IE bug ("undefined is undefined or undefined", or something..)
-	- the highlighted word will now remain in view (window scrolls if necessary)
-	- functionality for "Revert"
-	- (tried to) eliminate some of the screen blinking in Mozilla
-	- select the current dictionary on first display
-
-	* plugins/SpellChecker/spell-check-ui.html:
-	added "Revert" button (reverts the current word to the mispelled original)
-
-	* plugins/SpellChecker/spell-check-style.css: *** empty log message ***
-
-	* plugins/SpellChecker/spell-check-logic.cgi:
-	- fixed (hopefully) unicode support (by the way, it seems that Aspell _does_
-	  in fact know Unicode!!)
-	- remembers the selected dictionary in a cookie
-	- removed debug code
-
-2004-01-28  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* index.html: updated main page
-
-	* release-notes.html: updated release notes
-
-	* htmlarea.js: jscrunch-safe
-
-	* popups/about.html:
-	stop tab click event so that they don't get selected
-
-	* reference.html: some parts updated
-
-	* popups/about.html, examples/2-areas.html, examples/context-menu.html, examples/core.html, examples/css.html, examples/full-page.html, examples/fully-loaded.html, examples/spell-checker.html, examples/table-operations.html, plugins/SpellChecker/readme-tech.html, ChangeLog, dialog.js, htmlarea.js, index.html, license.txt, popupwin.js, release-notes.html:
-	ChangeLog updated; copyright years/info updated
-
-2004-01-27  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js:
-	Included an workaround for a strange IE problem: IE's getElementById can
-	return a field having the _name_ attribute equal to the searched ID, even if
-	it's not having any ID at all.  This can sometimes lead to taking a
-	different field (even if it's not a textarea) as the replacement field which
-	trashes the whole layout, look, feel, and functionality :-(  Need to say it
-	again, IE SUCKS.
-
-	Thanks goes to Mike Dick for the bug report and for the patch ;-)
-
-2004-01-18  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/SpellChecker/spell-check-ui.js:
-	fixed bug (thanks Bill Sechrist for report):
-	when you "ignore"-ed the last mispelled word, no changes were applied
-
-2004-01-16  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: border: 0px on body,html in pageStyle
-
-	* popups/about.html: report userAgent in plugins tab
-
-2004-01-12  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/ru.js: updated (thanks to Yulya Shtyryakova)
-
-2004-01-03  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/ContextMenu/lang/de.js: updated
-
-2004-01-02  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/ContextMenu/lang/de.js:
-	DE translation, thanks to Martin Jaggi
-
-2003-12-22  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/ee.js: Estonian translation
-
-2003-12-05  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: word cleaner: now it actually works ;-)
-
-	* plugins/ContextMenu/lang/el.js, lang/el.js, plugins/TableOperations/lang/el.js:
-	added Greek translation (thanks to Dimitris Glezos)
-
-	* htmlarea.js:
-	call an onGenerate handler, if found on the editor object
-
-	* popups/about.html, popups/popup.js: updated about box
-
-	* plugins/SpellChecker/spell-check-ui.js: *** empty log message ***
-
-	* plugins/ContextMenu/context-menu.js:
-	open the normal insert_link dialog on modify link
-
-2003-11-28  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.css: -moz-opacity got back
-
-	* popups/about.html: *** empty log message ***
-
-	* htmlarea.js: added Word cleaner code (thanks weeezl)
-	fixed the bug concerning the url of relative link/images
-
-2003-11-24  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/CSS/css.js:
-	allows updation of parent element's class (no span).  thanks goes to Michael (pepl @ IT forums)
-
-2003-11-22  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/ContextMenu/lang/nl.js, plugins/TableOperations/lang/nl.js:
-	translation thanks to mmcw /IT forums
-
-	* lang/nl.js: updated (thanks to mmcw /IT forums)
-
-2003-11-21  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* makefile.xml: added ChangeLog to project dist
-
-	* ChangeLog: Updated ChangeLog
-
-	* examples/context-menu.html, examples/fully-loaded.html, examples/pieng.png, index.html, plugins/ContextMenu/1.pl, plugins/ContextMenu/context-menu.js, plugins/ContextMenu/lang/en.js, plugins/ContextMenu/lang/makefile.xml, plugins/ContextMenu/makefile.xml, plugins/ContextMenu/menu.css, plugins/makefile.xml:
-	Added ContextMenu plugin (work sponsored by American Bible Society)
-
-2003-11-11  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/en.js, lang/ro.js: support for the link dialog
-
-	* plugins/FullPage/popups/docprop.html, popups/popup.js:
-	support for I18N of core dialogs, added function to select a value in a <select>, all dialogs close on ESC
-
-	* htmlarea.js:
-	support for insert link popup, minor bug-fix in Mozilla (catch exception)
-
-	* examples/fully-loaded.html:
-	workaround some IE problems (it appears that it's definitely better to wait half a second before generate()-ing the editor
-
-	* popups/link.html: allow ling target, title, edit link
-
-	* plugins/TableOperations/lang/no.js, lang/no.js:
-	Norwegian translation (thanks to Svein Sando)
-
-2003-11-10  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/es.js: fixed (thanks to Jorge)
-
-2003-11-07  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/about.html:
-	changed to Unix encoding; Credits page needs to be redesigned
-
-2003-11-06  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/lt.js: Lithuanian translation, thanks to Jaroslav Satkevic
-
-2003-11-05  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/he.js: Hebrew language definition (thanks to Liron Newman)
-
-2003-11-04  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/vn.js: updated vietnamese translation, thanks to Nguyen Dinh Nam
-
-2003-11-03  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/nl.js: updated (thanks to ephemeros)
-
-	* images/ed_left_to_right.gif, images/ed_right_to_left.gif:
-	text direction icons
-
-	* htmlarea.js, lang/en.js:
-	implemented text direction support (LTR or RTL)
-	workaround for a serious bug in IE (looses selection? bleah..)
-
-2003-10-31  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* examples/2-areas.cgi, examples/2-areas.html:
-	added sample that demonstrates how to create more editors in the same page and form
-
-	* htmlarea.js:
-	- increased the initial timeout after creating the iframe
-	- apply the timeout to IE too (actually we need a better idea that will only
-	  create the editor _after_ all images are loaded; it seems that IE has
-	  serious problems about it: if HTMLArea is initialized while loading images,
-	  the rest of images will never be loaded and functionality will miss [IE only])
-	- custom undo queue disabled by default as it's still buggy
-
-2003-10-28  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/about.html: only loaded plugins
-
-	* plugins/CSS/css.js: copyright notices updated
-
-	* examples/core.html, examples/css.html, examples/full-page.html, examples/spell-checker.html, examples/table-operations.html:
-	updated to new style (load only htmlarea.js, define _editor_lang)
-
-	* dialog.js, htmlarea.js, popups/popup.js, popupwin.js:
-	copyright notices updated
-
-	* htmlarea.js: Text "Path: " back in the status bar
-
-	* popups/fullscreen.html:
-	correctly loads all scripts and registers plugins
-
-	* plugins/SpellChecker/spell-checker.js:
-	dropped config.editorURL in favor if _editor_url
-
-	* lang/en.js:
-	- IE sucks in full screen message (not yet used but might be if users
-	  complain; I'm sick of IE, that sick that I will start charging 4 times more
-	  for IE compatibility; I might get a ulcer because of it... no kiddin')
-
-	* htmlarea.js: - support _editor_lang
-	- loads all required files
-	- correct loading of plugins in full-screen mode
-	- config.editorURL was permanently dropped in favor of _editor_url
-
-	* popups/fullscreen.html, htmlarea.js:
-	config.editorURL removed, better handling of _editor_url
-
-2003-10-27  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/fullscreen.html:
-	bugfix: setting the BASE tag to the caller document's URL so we have no other
-	problems like editor or button images not loading.  Ha HA! >:-)
-
-	* plugins/CSS/css.js:
-	CSS plugin drop-down boxes appear on the second toolbar line by default
-
-	* popupwin.js: added position for the opening window
-
-	* lang/en.js: Insert Image ==> Insert/Modify Image
-
-	* htmlarea.js:
-	- Insert Image command patched to allow modification of a current image, if
-	  it's selected
-	- Correct handling of selection for IE (test for ControlRange object) which
-	  fixes a lot of bugs (IMG elements is now present in Path, no more table
-	  props failures when an IMG or floating element is selected, etc.)
-
-2003-10-25  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/insert_image.html, htmlarea.js:
-	insert image can now modify the properties of an existing image
-
-	* htmlarea.js:
-	Cut/copy/paste -- show hint of where to find information to enable it in Gecko
-
-	* examples/core.html, examples/css.html, examples/full-page.html, examples/fully-loaded.html, examples/spell-checker.html, examples/table-operations.html:
-	removed @import url(../htmlarea.css) -- HTMLArea takes care of loading the CSS by itself how
-
-	* htmlarea.js:
-	bugfix: catched some exceptions that otherwise would have led Mozilla to crash
-	removed Path text from the statusbar
-
-	* htmlarea.js:
-	call onGenerate() for plugins that implement it; added loadStyle helper for easier stylesheet loading
-
-2003-10-24  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/FullPage/test.html, examples/css.html, examples/full-page.html:
-	removed unused code
-
-	* plugins/makefile.xml, plugins/CSS/lang/makefile.xml, plugins/CSS/makefile.xml:
-	CSS plugin added to distribution
-
-	* examples/custom.css, htmlarea.js: removed default styles
-
-	* popups/about.html:
-	fixed resizable window (Moz fix only, IE worked fine)
-
-	* plugins/CSS/css.js, plugins/CSS/lang/en.js, plugins/FullPage/full-page.js, examples/css.html, examples/custom.css, examples/fully-loaded.html:
-	added the CSS plugin (sponsored by www.miro.com.au)
-
-	* htmlarea.js:
-	bugfix: sometimes getHTML failed as root.tagName was undefined (for DocumentFragment nodes)
-
-	* project-config.xml: switching to CVS snapshot releases
-
-2003-10-23  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* examples/test.cgi: moved from ../
-
-	* test.cgi: moved to examples/
-
-	* makefile.xml: added examples subdir
-
-	* examples/makefile.xml: distribute example files
-
-	* examples/full-page.html: FullPage plugin demo
-
-	* examples/fully-loaded.html: added FullPage plugin
-
-	* index.html: added link to FullPage plugin demo
-
-	* examples/core.html, examples/fully-loaded.html, examples/spell-checker.html, examples/table-operations.html, popups/fullscreen.html, index.html:
-	fixed example files, added _editor_url (REQUIREDcvs -q update -d .), fixed problems with the full-screen editor
-
-	* examples/core.html, examples/fully-loaded.html, examples/spell-checker.html, examples/table-operations.html:
-	examples previously found in ../
-
-	* example-fully-loaded.html, example-spell-checker.html, example-table-operations.html, example.html:
-	moved to examples/
-
-	* popups/about.html: minor
-
-2003-10-18  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/si.js: Slovenian translation (thanks to Tomaz Kregar)
-
-2003-10-15  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/fr.js: updated French translation (thanks to Jonathan Ernst)
-
-2003-10-07  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/FullPage/full-page.js, plugins/FullPage/img/docprop.gif, plugins/FullPage/img/makefile.xml, plugins/FullPage/lang/en.js, plugins/FullPage/lang/makefile.xml, plugins/FullPage/lang/ro.js, plugins/FullPage/makefile.xml, plugins/FullPage/popups/docprop.html, plugins/FullPage/popups/makefile.xml, plugins/FullPage/test.html, plugins/makefile.xml:
-	FullPage plugin (allows configuring document properties)
-
-	* lang/en.js: fixed typo
-
-2003-10-06  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/about.html: Released=>Compiled
-
-	* popups/about.html: plugins credits only in plugins page
-
-	* popups/popup.js: added ability to translate popup dialogs
-
-	* htmlarea.css:
-	small fix for Mozilla/XHTML mode (buttons have now correct size)
-
-	* plugins/SpellChecker/spell-checker.js, plugins/TableOperations/table-operations.js:
-	fixed plugin images paths
-
-	* htmlarea.js: fixed doctype support
-	fixed support for full page editing (did I mention that IE sucks?)
-	avoids retrieving the contenteditable tag for body (IE only)
-	fixed _colorToRgb function (returns '' for empty or null color)
-	fixed editor/plugin images paths
-
-	* popups/popup.js:
-	allow __dlg_init to resize the window to cover a certain element
-
-	* popups/fullscreen.html: save the doctype too in the new editor
-
-	* popupwin.js:
-	fixed bug: now functions correctly for absolute _editor_url
-
-2003-10-05  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js:
-	full page editing facility; better interface for plugins popup dialogs
-
-2003-10-03  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: calls the plugin update function, if supplied
-
-	* popups/insert_image.html:
-	added nice image preview (submitted by rickroot on the interactivetools
-	forums, thanks!)
-
-2003-10-02  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: implemented proprietary undo/redo system (still buggy)
-
-	* popups/about.html: no bold on tabs
-
-2003-10-01  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: undo/redo are removed only if IE and config.statusBar
-
-	* popups/about.html: larger about box
-
-	* htmlarea.js: registers the plugin instance too (where was my head?)
-
-	* htmlarea.js: registers the plugin instance too
-
-	* htmlarea.js: fixed bug: opening the help window from the right place
-
-	* htmlarea.js:
-	don't use eval to register new plugins (allows better plugin arguments handling)
-
-2003-09-29  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* project-config.xml: beta+CVS
-
-	* popups/about.html: more "space" between tabs
-
-	* popups/about.html: the coolest about box ;-)
-
-	* dialog.js, popups/insert_image.html, popups/insert_table.html, popups/popup.js, popups/select_color.html:
-	fixed popups display under IE/Win
-
-	* plugins/SpellChecker/spell-checker.js, plugins/TableOperations/table-operations.js, htmlarea.js:
-	plugins will now register information about themselves
-
-	* popups/popup.js:
-	fixed an infantile mistake ;-) (popup windows are now centered correctly in
-	Moz too)
-
-2003-09-28  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* makefile.xml: mason args not needed
-
-	* popups/about.html: better about box ;-)
-
-	* project-config.xml: version beta+
-
-	* htmlarea.js: support passing parameters to plugins
-
-	* plugins/TableOperations/lang/en.js, plugins/TableOperations/lang/ro.js, popups/about.html, lang/en.js, lang/lv.js, lang/ro.js, plugins/SpellChecker/lang/en.js, plugins/SpellChecker/lang/ro.js, plugins/SpellChecker/readme-tech.html, plugins/SpellChecker/spell-check-logic.cgi, plugins/SpellChecker/spell-check-ui.html, plugins/SpellChecker/spell-check-ui.js, plugins/SpellChecker/spell-checker.js, plugins/TableOperations/table-operations.js, release-notes.html, example-spell-checker.html, htmlarea.js, index.html, make-release.pl, reference.html:
-	updated links
-
-2003-09-27  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/fullscreen.html: dont load null scripts ;-)
-
-	* htmlarea.js: undo/redo buttons removed for IE
-
-2003-09-25  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* images/ed_save.gif, images/ed_save.png: added save icon
-
-	* plugins/SpellChecker/lang/da.js: Danish translation available
-
-2003-09-19  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/SpellChecker/lang/de.js:
-	DE translation added (thanks to broxx.com)
-
-	* plugins/TableOperations/lang/da.js:
-	danish translation provided by Steen Sønderup
-
-	* plugins/TableOperations/lang/de.js:
-	DE translation provided by broxx.com
-
-	* lang/de.js: up-to-date by broxx.com
-
-2003-09-16  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/SpellChecker/lang/hu.js:
-	added Hungarian translation for the SpellChecker plugin
-
-2003-09-15  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/hu.js, plugins/TableOperations/lang/hu.js:
-	added Hungarian translation (thanks to Miklós Somogyi)
-
-2003-09-14  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/lv.js: added Latvian translation (thanks to Janis Klavins)
-
-2003-09-02  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js:
-	added helper function for removing stuff from the configuration toolbar
-
-	* popupwin.js:
-	fixed bug that prevented TableOperation popups to show up in IE
-
-2003-08-25  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: fixed status-bar behavior (can be hidden if desired)
-
-	* lang/es.js: fixed structure
-
-2003-08-21  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popupwin.js:
-	bugfix: use _editor_url to allow the editor to be some place else
-
-2003-08-14  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/SpellChecker/lang/it.js: utf-8-ified
-
-	* lang/it.js: Italian translation updated (thanks to Fabio Rotondo)
-
-	* plugins/TableOperations/lang/it.js:
-	Italian translation, thanks to Fabio Rotondo
-
-2003-08-13  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/SpellChecker/lang/it.js:
-	Added Italian translation (thanks to Fabio Rotondo)
-
-2003-08-12  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/SpellChecker/lang/cz.js, plugins/TableOperations/lang/cz.js, lang/cz.js:
-	CZ translation
-
-	* htmlarea.js:
-	fixed bug when more HTMLAreas were present in the same <FORM> -- get each
-	one's text onsubmit. (thanks Fabio Rotondo for report and test case)
-
-2003-08-11  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* index.html: added brief installation notes
-
-2003-08-10  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* index.html, makefile.xml, release-notes.html:
-	added version/release to index.html
-
-	* lang/da.js, lang/de.js, lang/en.js, lang/es.js, lang/fi.js, lang/fr.js, lang/gb.js, lang/it.js, lang/ja-euc.js, lang/ja-jis.js, lang/ja-sjis.js, lang/ja-utf8.js, lang/makefile.xml, lang/nb.js, lang/nl.js, lang/pl.js, lang/pt_br.js, lang/ro.js, lang/ru.js, lang/se.js, lang/vn.js, plugins/SpellChecker/img/makefile.xml, plugins/SpellChecker/img/spell-check.gif, plugins/SpellChecker/lang/en.js, plugins/SpellChecker/lang/makefile.xml, plugins/SpellChecker/lang/ro.js, plugins/SpellChecker/makefile.xml, plugins/SpellChecker/readme-tech.html, plugins/SpellChecker/spell-check-logic.cgi, plugins/SpellChecker/spell-check-style.css, plugins/SpellChecker/spell-check-ui.html, plugins/SpellChecker/spell-check-ui.js, plugins/SpellChecker/spell-checker.js, plugins/TableOperations/img/cell-delete.gif, plugins/TableOperations/img/cell-insert-after.gif, plugins/TableOperations/img/cell-insert-before.gif, plugins/TableOperations/img/cell-merge.gif, plugins/TableOperations/img/cell-prop.gif, plugins/TableOperations/img/cell-split.gif, plugins/TableOperations/img/col-delete.gif, plugins/TableOperations/img/col-insert-after.gif, plugins/TableOperations/img/col-insert-before.gif, plugins/TableOperations/img/col-split.gif, plugins/TableOperations/img/makefile.xml, plugins/TableOperations/img/row-delete.gif, plugins/TableOperations/img/row-insert-above.gif, plugins/TableOperations/img/row-insert-under.gif, plugins/TableOperations/img/row-prop.gif, plugins/TableOperations/img/row-split.gif, plugins/TableOperations/img/table-prop.gif, plugins/TableOperations/lang/en.js, plugins/TableOperations/lang/fi.js, plugins/TableOperations/lang/makefile.xml, plugins/TableOperations/lang/ro.js, plugins/TableOperations/makefile.xml, plugins/TableOperations/table-operations.js, plugins/makefile.xml, popups/about.html, popups/fullscreen.html, popups/makefile.xml, example-fully-loaded.html, example-spell-checker.html, example-table-operations.html, example.html, htmlarea-lang-b5.js, htmlarea-lang-da.js, htmlarea-lang-de.js, htmlarea-lang-en.js, htmlarea-lang-es.js, htmlarea-lang-fr.js, htmlarea-lang-gb.js, htmlarea-lang-it.js, htmlarea-lang-ja-euc.js, htmlarea-lang-ja-jis.js, htmlarea-lang-ja-sjis.js, htmlarea-lang-ja-utf8.js, htmlarea-lang-nb.js, htmlarea-lang-nl.js, htmlarea-lang-pl.js, htmlarea-lang-pt_br.js, htmlarea-lang-ru.js, htmlarea-lang-se.js, htmlarea-lang-vn.js, htmlarea.css, htmlarea.js, images/ed_paste.gif, images/ed_show_border.gif, images/ed_splitcel.gif, images/makefile.xml, index.html, lang/b5.js, make-release.pl, makefile.xml, popupdiv.js, popupwin.js, project-config.xml, readme.html, reference.html, release-notes.html:
-	Merged from table-devel branch.  Development back on main trunk.
-
-	* plugins/SpellChecker/readme-tech.html: added I18N file to description
-
-	* plugins/SpellChecker/spell-check-ui.html, plugins/SpellChecker/spell-check-ui.js:
-	internationalization now supported
-
-	* plugins/TableOperations/table-operations.js:
-	fixed bug icons inside dialogs
-
-	* popups/about.html:
-	nicer dialog, + automatic version/release management
-
-	* htmlarea.js, lang/en.js, plugins/SpellChecker/lang/en.js, plugins/TableOperations/lang/en.js:
-	I18N for some messages that were left out, small IMG bug fixed, added loadPlugin static function
-
-	* example-fully-loaded.html, example-spell-checker.html, example-table-operations.html, example.html:
-	UTF-8 charset by default
-
-	* lang/ro.js, plugins/SpellChecker/lang/ro.js, plugins/TableOperations/lang/ro.js:
-	New file.
-
-	* lang/ro.js, plugins/SpellChecker/lang/ro.js, plugins/TableOperations/lang/ro.js:
-	Romanian translation (thanks to My Self)
-
-	* release-notes.html: New file.
-
-	* release-notes.html: release notes
-
-	* lang/makefile.xml, plugins/SpellChecker/img/makefile.xml, plugins/SpellChecker/lang/makefile.xml, plugins/SpellChecker/makefile.xml, plugins/TableOperations/img/makefile.xml, plugins/TableOperations/lang/makefile.xml, plugins/TableOperations/makefile.xml, plugins/makefile.xml, popups/makefile.xml:
-	New file.
-
-	* lang/makefile.xml, plugins/SpellChecker/img/makefile.xml, plugins/SpellChecker/lang/makefile.xml, plugins/SpellChecker/makefile.xml, plugins/TableOperations/img/makefile.xml, plugins/TableOperations/lang/makefile.xml, plugins/TableOperations/makefile.xml, plugins/makefile.xml, popups/makefile.xml:
-	automatic release management (a la makefile)
-
-	* images/makefile.xml, make-release.pl, makefile.xml, project-config.xml:
-	New file.
-
-	* images/makefile.xml, make-release.pl, makefile.xml, project-config.xml:
-	automatic release management (a la makefile)
-
-2003-08-03  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* lang/fi.js, plugins/TableOperations/lang/fi.js:
-	Finnish translation added (thanks bestis)
-
-	* lang/fi.js, plugins/TableOperations/lang/fi.js, index.html: New file.
-
-	* index.html: short description, copyright, links
-
-	* reference.html:
-	LAST VERSION OF THIS DOCUMENT.  IT WILL BE SOON DELETED.
-
-	* lang/b5.js, lang/da.js, lang/de.js, lang/en.js, lang/es.js, lang/fr.js, lang/gb.js, lang/it.js, lang/ja-euc.js, lang/ja-jis.js, lang/ja-sjis.js, lang/ja-utf8.js, lang/nb.js, lang/nl.js, lang/pl.js, lang/pt_br.js, lang/ru.js, lang/se.js, lang/vn.js:
-	added lang in I18N, so that we can load automatically plugin's lang file
-
-	* example-fully-loaded.html: New file.
-
-	* example-fully-loaded.html: loads all plugins
-
-	* example-spell-checker.html: removed TableOperations from this example
-
-2003-08-01  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* readme.html: documentation for 2.x is heavily outdated... removed.
-
-	* example-spell-checker.html, plugins/SpellChecker/img/spell-check.gif, plugins/SpellChecker/lang/en.js, plugins/SpellChecker/readme-tech.html, plugins/SpellChecker/spell-check-logic.cgi, plugins/SpellChecker/spell-check-style.css, plugins/SpellChecker/spell-check-ui.html, plugins/SpellChecker/spell-check-ui.js, plugins/SpellChecker/spell-checker.js:
-	New file.
-
-	* example-spell-checker.html, plugins/SpellChecker/img/spell-check.gif, plugins/SpellChecker/lang/en.js, plugins/SpellChecker/readme-tech.html, plugins/SpellChecker/spell-check-logic.cgi, plugins/SpellChecker/spell-check-style.css, plugins/SpellChecker/spell-check-ui.html, plugins/SpellChecker/spell-check-ui.js, plugins/SpellChecker/spell-checker.js:
-	added the SpellChecker plugin (sponsored by www.AmericanBible.org)
-
-	* example.html, example-table-operations.html:
-	* moved lang files to separate directory
-
-	* htmlarea-lang-en.js, htmlarea-lang-es.js, htmlarea-lang-fr.js, htmlarea-lang-gb.js, htmlarea-lang-it.js, htmlarea-lang-ja-euc.js, htmlarea-lang-ja-jis.js, htmlarea-lang-ja-sjis.js, htmlarea-lang-ja-utf8.js, htmlarea-lang-nb.js, htmlarea-lang-nl.js, htmlarea-lang-pl.js, htmlarea-lang-pt_br.js, htmlarea-lang-ru.js, htmlarea-lang-se.js, htmlarea-lang-vn.js, htmlarea-lang-b5.js, htmlarea-lang-da.js, htmlarea-lang-de.js:
-	moved to lang/
-
-	* lang/b5.js, lang/da.js, lang/de.js, lang/en.js, lang/es.js, lang/fr.js, lang/gb.js, lang/it.js, lang/ja-euc.js, lang/ja-jis.js, lang/ja-sjis.js, lang/ja-utf8.js, lang/nb.js, lang/nl.js, lang/pl.js, lang/pt_br.js, lang/ru.js, lang/se.js, lang/vn.js:
-	New file.
-
-	* lang/b5.js, lang/da.js, lang/de.js, lang/en.js, lang/es.js, lang/fr.js, lang/gb.js, lang/it.js, lang/ja-euc.js, lang/ja-jis.js, lang/ja-sjis.js, lang/ja-utf8.js, lang/nb.js, lang/nl.js, lang/pl.js, lang/pt_br.js, lang/ru.js, lang/se.js, lang/vn.js:
-	lang files separated
-
-	* htmlarea.js, htmlarea.css:
-	* added registerDropdown -- for adding custom drop-down boxes to the toolbar
-	* registerDropdown and registerButton verify for existing ID-s first (alert
-	  if that's the case)
-	* support for text labels in the toolbar
-	* fixed some bugs in insertHTML (Mozilla specific)
-
-2003-07-16  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* example-table-operations.html:
-	TableOperations lang file moved to 'lang' directory
-
-	* plugins/TableOperations/lang/en.js: New file.
-
-	* plugins/TableOperations/lang/en.js, plugins/TableOperations/table-operations-lang-en.js:
-	lang files in dedicated directory [lang]
-
-	* htmlarea.js: [IE] no status bar on fullscreen editor
-
-2003-07-15  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js:
-	[IE] fixed annoying bug: displacement of the separators within the toolbar;
-	     IE assigns a random image width/height, if not explicitely stated ;-)
-
-2003-07-13  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/fullscreen.html: moved plugin images to ../plugins
-	fixed bug that only applied to Moz-1.4 or newer Geckos (script.src is always
-	an absolute URL)
-
-	* htmlarea.js: restructuration concerning images
-
-	* plugins/TableOperations/table-operations.js:
-	images moved to the plugin directory
-
-	* plugins/TableOperations/img/cell-delete.gif, plugins/TableOperations/img/cell-insert-after.gif, plugins/TableOperations/img/cell-insert-before.gif, plugins/TableOperations/img/cell-merge.gif, plugins/TableOperations/img/cell-prop.gif, plugins/TableOperations/img/cell-split.gif, plugins/TableOperations/img/col-delete.gif, plugins/TableOperations/img/col-insert-after.gif, plugins/TableOperations/img/col-insert-before.gif, plugins/TableOperations/img/col-split.gif, plugins/TableOperations/img/row-delete.gif, plugins/TableOperations/img/row-insert-above.gif, plugins/TableOperations/img/row-insert-under.gif, plugins/TableOperations/img/row-prop.gif, plugins/TableOperations/img/row-split.gif, plugins/TableOperations/img/table-prop.gif:
-	New file.
-
-	* plugins/TableOperations/img/cell-delete.gif, plugins/TableOperations/img/cell-insert-after.gif, plugins/TableOperations/img/cell-insert-before.gif, plugins/TableOperations/img/cell-merge.gif, plugins/TableOperations/img/cell-prop.gif, plugins/TableOperations/img/cell-split.gif, plugins/TableOperations/img/col-delete.gif, plugins/TableOperations/img/col-insert-after.gif, plugins/TableOperations/img/col-insert-before.gif, plugins/TableOperations/img/col-split.gif, plugins/TableOperations/img/row-delete.gif, plugins/TableOperations/img/row-insert-above.gif, plugins/TableOperations/img/row-insert-under.gif, plugins/TableOperations/img/row-prop.gif, plugins/TableOperations/img/row-split.gif, plugins/TableOperations/img/table-prop.gif:
-	moved TableOperations icons here
-
-	* images/ed_splitcell.gif:
-	moved to ../plugins/TableOperations/img/cell-split.gif
-
-	* images/ed_mergecels.gif:
-	moved to ../plugins/TableOperations/img/cell-merge.gif
-
-	* images/ed_delcel.gif:
-	moved to ../plugins/TableOperations/img/cell-delete.gif
-
-	* images/ed_inscelrgt.gif:
-	moved to ../plugins/TableOperations/img/cell-insert-after.gif
-
-	* images/ed_inscellft.gif:
-	moved to ../plugins/TableOperations/img/cell-insert-before.gif
-
-	* images/ed_cellprop.gif:
-	moved to ../plugins/TableOperations/img/cell-prop.gif
-
-	* images/ed_splitcol.gif:
-	moved to ../plugins/TableOperations/img/col-split.gif
-
-	* images/ed_delcol.gif:
-	moved to ../plugins/TableOperations/img/col-delete.gif
-
-	* images/ed_insright.gif:
-	moved to ../plugins/TableOperations/img/col-insert-after.gif
-
-	* images/ed_insleft.gif:
-	moved to ../plugins/TableOperations/img/col-insert-before.gif
-
-	* images/ed_splitrow.gif:
-	moved to ../plugins/TableOperations/img/row-split.gif
-
-	* images/ed_delrow.gif:
-	moved to ../plugins/TableOperations/img/row-delete.gif
-
-	* images/ed_insunder.gif:
-	moved to ../plugins/TableOperations/img/row-insert-under.gif
-
-	* images/ed_insabove.gif:
-	moved to ../plugins/TableOperations/img/row-insert-above.gif
-
-	* images/ed_rowprop.gif:
-	moved to ../plugins/TableOperations/img/row-prop.gif
-
-	* images/ed_tableprop.gif:
-	moved to ../plugins/TableOperations/img/table-prop.gif
-
-2003-06-11  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations.js:
-	revamped code for table "border", "frame" and "rules" attributes
-
-2003-06-08  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations.js:
-	added focusEditor() calls (editor lost focus in IE after some operations)
-
-	* plugins/TableOperations/table-operations.js:
-	fixed 2 bugs (correct title in row/cell properties dialog, clear cell
-	contents when inserting new row in Internet Explorer)
-
-2003-06-02  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/fullscreen.html:
-	[IE] fixed problem that caused toolbar buttons to be unusable
-
-	* popups/fullscreen.html:
-	[IE] fixed bug when copying the click handler.  Editor is now functional in
-	fullscreen.
-
-	* plugins/TableOperations/table-operations-lang-en.js, plugins/TableOperations/table-operations.js:
-	1. Removed code that selects the table/row/cell before displaying the
-	dialog.
-
-	2. Focus back the table after closing the dialog box (was causing some
-	problems in IE).
-
-	3. Implemented merge cells for IE (user will be prompted for number of
-	cols/rows to span the current cell).
-
-	* htmlarea.js:
-	1. Display an alert if cut/copy/paste is not supported, when one of the buttons
-	is clicked.  The button will also be removed from the toolbar.
-
-	2. Fixed bug when clicking on some table/image margin in IE.
-
-2003-05-31  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations.js:
-	[IE5.5] IE5.5 doesn't support createDocumentFragment; workarounded.
-
-	* htmlarea.css: Better looking dialogs
-
-	* htmlarea.js: Fixed IE5.5 compatibility issues.
-
-	* htmlarea.js: Now IE5.5 compatible.
-
-2003-05-27  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: workaround for a horrible bug (thanks Dror!)
-
-	* htmlarea.js: oops... ;-)
-
-	* htmlarea.js: workaround for a horrible bug (thanks Dror!)
-
-2003-05-18  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations-lang-en.js:
-	added some comment notes for translators
-
-	* plugins/TableOperations/table-operations.js: bugfix:
-	  - border-style changes are updated correctly in Mozilla
-	  - do not show Float for td, th, tr elements
-	feature (eye-candy)
-	  - added small icons on each dialog
-
-	* popupwin.js: added baseURL to the object (useful in dialogs)
-
-	* plugins/TableOperations/table-operations-lang-en.js, plugins/TableOperations/table-operations.js:
-	modified dialogs (more css-friendly, trying to avoid deprecated HTML
-	attributes).  fixed some bugs.
-
-	* htmlarea.js:
-	added oncontextmenu for status-bar elements (displays inline style)
-	fixed problem with textindicator (background-color in Mozilla)
-
-	* htmlarea.css: tables in dialogs have border-collapse: collapse
-
-	* example-table-operations.html:
-	modified example HTML (more colorful, blah blah)
-
-2003-05-14  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations.js:
-	(trying to) force redraw after table/row/cell properties dialogs close with
-	OK
-
-2003-05-13  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations-lang-en.js, plugins/TableOperations/table-operations.js, popupwin.js:
-	some fixes for IE; implemented border-collapse style properties (tables only)
-
-2003-05-12  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations-lang-en.js, plugins/TableOperations/table-operations.js, example-table-operations.html, htmlarea.css, popupwin.js:
-	improvements of the color selector button, added row properties and cell properties dialogs, fixes, etc.
-
-2003-05-08  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations.js:
-	border properties now functional
-
-	* plugins/TableOperations/table-operations-lang-en.js:
-	CSS Style -> Style [CSS]
-
-	* popupwin.js: smaller padding.. looks better.
-
-	* htmlarea.css, plugins/TableOperations/table-operations-lang-en.js, plugins/TableOperations/table-operations.js:
-	added functionality (style properties, changed BUTTON to DIV for color
-	selection widget, added border properties [not completed yed])
-
-2003-05-07  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations.js:
-	fixed small bug; added some comments
-
-2003-05-06  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js:
-	fixed small bug (user might close the select_color dialog by pressing "X"
-	button, case in which the selection is now ignored)
-
-	* htmlarea.js: debug code can sometimes be annoying -- commented out.
-
-	* htmlarea.js: bug #730593 fixed
-
-	* plugins/TableOperations/table-operations-lang-en.js, plugins/TableOperations/table-operations.js:
-	added first dialog (table properties) + other useful stuff like generic style properties that should eventually make it into a separated plugin
-
-	* popupdiv.js, popupwin.js: New file.
-
-	* popupdiv.js, popupwin.js:
-	files for handling some popup dialogs generated from JS code
-
-	* example-table-operations.html: credit modified
-
-2003-05-05  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea-lang-en.js:
-	I18N for 2 very common text-s ("ok" and "cancel")
-
-	* htmlarea.css: style for new popups
-
-	* htmlarea.js:
-	added new variable (_mdoc which keeps a reference to the document that
-	contains the HTMLArea.  it's sometimes useful (mainly in popups))
-
-2003-04-25  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations.js:
-	modified credit (bloki.com instead of zapatec.com)
-
-2003-04-24  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* plugins/TableOperations/table-operations.js:
-	fixed code to work if editor used in fullscreen
-
-	* popups/fullscreen.html:
-	added nice code that automagically loads all scripts in the parent page (opener)
-
-	* plugins/TableOperations/table-operations.js:
-	- fixes for IE (IE doesn't need the BR inside empty TD-s)
-	- when called in fullscreen mode it doesn't update the toolbar
-
-	* htmlarea.js:
-	small fix for IE (getAllAncestors sometimes returned the HTML and Document element too)
-
-2003-04-23  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/fullscreen.html: small bug fixed
-
-	* htmlarea.css:
-	changed bg for disabled buttons (this is for debug, I repeat ;-)
-
-	* htmlarea.js: - API support for external plugins
-	- support for context-enabled buttons
-	- performance improvement: cancelling updateToolbar requests if made in less
-	  than 50ms -- in other words, only honor the last one
-
-	* example.html: test for context-enabled buttons
-
-	* plugins/TableOperations/table-operations.js: New file.
-
-	* plugins/TableOperations/table-operations.js:
-	added TableOperations plugin
-	several new toolbar buttons + fixes to some existent ones
-	file that demonstrate usage of the TableOperations plugin
-
-	* plugins/TableOperations/table-operations-lang-en.js: New file.
-
-	* plugins/TableOperations/table-operations-lang-en.js:
-	added TableOperations plugin
-	several new toolbar buttons + fixes to some existent ones
-	file that demonstrate usage of the TableOperations plugin
-
-	* images/ed_splitcell.gif, images/ed_splitcol.gif: New file.
-
-	* images/ed_splitcell.gif, images/ed_splitcol.gif, images/ed_splitrow.gif, images/ed_paste.gif, images/ed_insunder.gif, images/ed_mergecels.gif, images/ed_inscellft.gif, images/ed_inscelrgt.gif, images/ed_insleft.gif, images/ed_insright.gif, images/ed_insabove.gif, images/ed_delcol.gif, images/ed_delrow.gif:
-	added TableOperations plugin
-	several new toolbar buttons + fixes to some existent ones
-	file that demonstrate usage of the TableOperations plugin
-
-	* example-table-operations.html: New file.
-
-	* example-table-operations.html, images/ed_delcel.gif:
-	added TableOperations plugin
-	several new toolbar buttons + fixes to some existent ones
-	file that demonstrate usage of the TableOperations plugin
-
-2003-04-21  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: added status bar (cool B-)
-
-	* htmlarea.css: various improvements for the status bar
-
-	* example.html: minor fix (background-color instead of background)
-
-2003-04-20  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: fix: IE parsing problem
-
-	* htmlarea.css, htmlarea.js, popups/fullscreen.html: added statusbar
-
-	* images/ed_tableprop.gif: New file.
-
-	* images/ed_tableprop.gif: added images for table operations buttons
-
-	* images/ed_cellprop.gif, images/ed_delcel.gif, images/ed_delcol.gif, images/ed_delrow.gif, images/ed_insabove.gif, images/ed_inscellft.gif, images/ed_inscelrgt.gif, images/ed_insleft.gif, images/ed_insright.gif, images/ed_insunder.gif, images/ed_mergecels.gif, images/ed_paste.gif, images/ed_rowprop.gif, images/ed_show_border.gif, images/ed_splitcel.gif, images/ed_splitrow.gif:
-	New file.
-
-	* images/ed_cellprop.gif, images/ed_delcel.gif, images/ed_delcol.gif, images/ed_delrow.gif, images/ed_insabove.gif, images/ed_inscellft.gif, images/ed_inscelrgt.gif, images/ed_insleft.gif, images/ed_insright.gif, images/ed_insunder.gif, images/ed_mergecels.gif, images/ed_paste.gif, images/ed_rowprop.gif, images/ed_show_border.gif, images/ed_splitcel.gif, images/ed_splitrow.gif:
-	added images for table operations buttons
-
-	* example.html:
-	even more examples of customization, but commented out so that the example
-	page looks initially with the editor defaults
-
-	* htmlarea-lang-en.js:
-	Added tooltips for cut, copy, paste, undo, redo buttons
-
-	* htmlarea.js: new features:
-
-	  - cut, copy, paste, undo, redo buttons
-	  - added functions: getParentElement, getAllAncestors
-	  - buttons can now be enabled/disabled function of the context (i.e. caret
-	    is inside a table)
-	  - iframe border removed on Mozilla (looks better)
-
-	* htmlarea.css:
-	minor fix [padding]; also contains some debugging stuff that needs to be
-	removed (disabled buttons have red background, that's because Mozilla
-	doesn't seem to support opacity any longer)
-
-2003-04-19  itools  <itools@mishoo>
-
-	* test.cgi: ..
-
-	* test.cgi: ...
-
-2003-04-15  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: added address: block-level element
-
-2003-04-02  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* popups/fullscreen.html: fixed small issue
-
-2003-03-24  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea-lang-pt_br.js: brasilian translation
-
-2003-03-19  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea-lang-nb.js: norwegian translation added
-
-	* reference.html: fixed typo
-
-2003-03-15  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js:
-	fixed bug (createlink needs UI -> true, otherwise we get a link to nowhere)
-
-2003-03-04  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea-lang-ja-euc.js, htmlarea-lang-ja-jis.js, htmlarea-lang-ja-sjis.js, htmlarea-lang-ja-utf8.js, htmlarea-lang-pl.js:
-	new translations: japanese and polish
-
-2003-03-03  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* example.html, htmlarea.js: example.html: now validates (hopefully)
-	htmlarea.js: opening help in a named window
-
-2003-03-02  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* reference.html:
-	minor fix: showing how to include the "dialog.js" file
-
-2003-02-27  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* reference.html: fixes, improvements
-	new sections on creating custom buttons
-
-	* example.html:
-	example on how to submit the form from something that's not a submit button
-
-	* htmlarea.js: added "onsubmit" handler with usual syntax.
-
-	* example.html: examples now using registerButton
-
-	* popups/fullscreen.html:
-	[fix] using now the new btnList layout; removed _textArea2
-
-	* htmlarea.js: - added helper function HTMLArea.Config.registerButton
-	- _editor_url is back
-	- fixed a problem that might disturb JS compressors ('"' character in
-	regexp)
-
-2003-02-26  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: iframe border back..
-
-	* example.html: fixes -- new btnList style
-
-	* htmlarea.js:
-	changed btnList order -- tooltip, icon, textmode, action.
-
-	* example.html: demo fix
-
-	* example.html: [minor] validity
-
-	* htmlarea.js:
-	BUG FIX: now it remembers textarea content on page reload.  Got rid of the
-	         secondary textarea.
-
-	* htmlarea-lang-it.js: Italian translation -- from TeddyZ
-
-2003-02-24  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea-lang-vn.js: Vietnamese lang module
-
-2003-02-22  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js:
-	Reorganized the btnList.  Now it uses direct function calls.
-
-	* reference.html: minor: use replace() instead of replaceAll()
-
-	* htmlarea.js:
-	- fixed bug: HTMLArea.replace() needs to call generate() (thanks Dlo)
-	- adding the onsubmit handler -- check if the form is there first
-	- added onunload handler that saves the HTML content, just in case user
-	  presses Back/Fwd or Refresh.
-
-	* htmlarea-lang-se.js: swedish translation
-
-2003-02-21  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea.js: done some of the changes suggested by Dlo
-	bodyStyle -> pageStyle and allows other elements' styles too
-
-	* example.html: example: how to add a custom button
-
-	* reference.html: started documentation project
-
-2003-02-20  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea-lang-da.js, htmlarea-lang-gb.js, htmlarea-lang-b5.js:
-	added new lang files
-
-2003-02-19  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* htmlarea-lang-de.js: added credits
-
-	* htmlarea-lang-nl.js: credit for redspider ;)
-
-	* htmlarea-lang-de.js: added german translation (from atk)
-
-	* htmlarea-lang-nl.js: dutch translation, from redspider
-
-	* htmlarea-lang-ru.js: RU translation (from Frol, itools forums)
-
-	* htmlarea-lang-es.js:
-	added ES translation from itools forums (thanks Luis)
-
-	* htmlarea-lang-fr.js:
-	added french translation, from Ronan (interactivetools.com forums)
-
-2003-02-17  Mihai Bazon  <mishoo@localhost.localdomain>
-
-	* images/.xvpics/ed_align_justify.gif: not needed
-
-	* htmlarea.js:
-	-- made HTMLArea constructor to work with object instead of ID (if type of
-	   argument is not string)
-	-- a simpler "replaceAll" function (2 lines)
-	-- fixed a major bug that prevented IE6 to correctly retrieve the HTML (it
-	   seems that it was ignoring attribute values and only displaying "")
-	-- used various techniques to reduce the code size (currently only 37K, 10K
-	   less than the original editor.js code [v 2.03])
-
-	* htmlarea.js:
-	removed NodeIterator code -- was only used in one place and I found a
-	different way to accomplish that task; code smaller by about 5K
-
-	* dialog.js, images/.xvpics/ed_align_justify.gif, images/ed_about.gif, images/ed_align_center.gif, images/ed_align_justify.gif, images/ed_align_left.gif, images/ed_align_right.gif, images/ed_blank.gif, images/ed_charmap.gif, images/ed_color_bg.gif, images/ed_color_fg.gif, images/ed_copy.gif, images/ed_custom.gif, images/ed_cut.gif, images/ed_delete.gif, images/ed_format_bold.gif, images/ed_format_italic.gif, images/ed_format_strike.gif, images/ed_format_sub.gif, images/ed_format_sup.gif, images/ed_format_underline.gif, images/ed_help.gif, images/ed_hr.gif, images/ed_html.gif, images/ed_image.gif, images/ed_indent_less.gif, images/ed_indent_more.gif, images/ed_link.gif, images/ed_list_bullet.gif, images/ed_list_num.gif, images/ed_redo.gif, images/ed_undo.gif, images/fullscreen_maximize.gif, images/fullscreen_minimize.gif, images/insert_table.gif, popups/about.html, popups/blank.html, popups/custom2.html, popups/editor_help.html, popups/fullscreen.html, popups/insert_image.html, popups/insert_table.html, popups/old-fullscreen.html, popups/old_insert_image.html, popups/popup.js, popups/select_color.html:
-	New file.
-
-	* dialog.js, images/.xvpics/ed_align_justify.gif, images/ed_about.gif, images/ed_align_center.gif, images/ed_align_justify.gif, images/ed_align_left.gif, images/ed_align_right.gif, images/ed_blank.gif, images/ed_charmap.gif, images/ed_color_bg.gif, images/ed_color_fg.gif, images/ed_copy.gif, images/ed_custom.gif, images/ed_cut.gif, images/ed_delete.gif, images/ed_format_bold.gif, images/ed_format_italic.gif, images/ed_format_strike.gif, images/ed_format_sub.gif, images/ed_format_sup.gif, images/ed_format_underline.gif, images/ed_help.gif, images/ed_hr.gif, images/ed_html.gif, images/ed_image.gif, images/ed_indent_less.gif, images/ed_indent_more.gif, images/ed_link.gif, images/ed_list_bullet.gif, images/ed_list_num.gif, images/ed_redo.gif, images/ed_undo.gif, images/fullscreen_maximize.gif, images/fullscreen_minimize.gif, images/insert_table.gif, popups/about.html, popups/blank.html, popups/custom2.html, popups/editor_help.html, popups/fullscreen.html, popups/insert_image.html, popups/insert_table.html, popups/old-fullscreen.html, popups/old_insert_image.html, popups/popup.js, popups/select_color.html:
-	first moved to CVS (close to release 3.0-beta)
-
-	* htmlarea.js, test.cgi: New file.
-
-	* htmlarea.js, test.cgi: first moved to CVS (close to release 3.0-beta)
-
-	* htmlarea-lang-en.js, readme.html: New file.
-
-	* htmlarea-lang-en.js, readme.html:
-	first moved to CVS (close to release 3.0-beta)
-
-	* example.html, htmlarea.css, license.txt: New file.
-
-	* example.html, htmlarea.css, license.txt:
-	first moved to CVS (close to release 3.0-beta)
-
diff -ruN 6171/e107_handlers/htmlarea/dialog.js 75/e107_handlers/htmlarea/dialog.js
--- 6171/e107_handlers/htmlarea/dialog.js	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/dialog.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,73 +0,0 @@
-// htmlArea v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
-// This copyright notice MUST stay intact for use (see license.txt).
-//
-// Portions (c) dynarch.com, 2003-2004
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon.
-//   http://dynarch.com/mishoo
-//
-// $Id: dialog.js,v 1.5 2004/08/11 09:26:35 e107coders Exp $
-
-// Though "Dialog" looks like an object, it isn't really an object.  Instead
-// it's just namespace for protecting global symbols.
-
-function Dialog(url, action, init) {
-	if (typeof init == "undefined") {
-		init = window;	// pass this window object by default
-	}
-	Dialog._geckoOpenModal(url, action, init);
-};
-
-Dialog._parentEvent = function(ev) {
-	setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
-	if (Dialog._modal && !Dialog._modal.closed) {
-		HTMLArea._stopEvent(ev);
-	}
-};
-
-
-// should be a function, the return handler of the currently opened dialog.
-Dialog._return = null;
-
-// constant, the currently opened dialog
-Dialog._modal = null;
-
-// the dialog will read it's args from this variable
-Dialog._arguments = null;
-
-Dialog._geckoOpenModal = function(url, action, init) {
-	var dlg = window.open(url, "hadialog",
-			      "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
-			      "scrollbars=no,resizable=yes,modal=yes,dependable=yes");
-	Dialog._modal = dlg;
-	Dialog._arguments = init;
-
-	// capture some window's events
-	function capwin(w) {
-		HTMLArea._addEvent(w, "click", Dialog._parentEvent);
-		HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent);
-		HTMLArea._addEvent(w, "focus", Dialog._parentEvent);
-	};
-	// release the captured events
-	function relwin(w) {
-		HTMLArea._removeEvent(w, "click", Dialog._parentEvent);
-		HTMLArea._removeEvent(w, "mousedown", Dialog._parentEvent);
-		HTMLArea._removeEvent(w, "focus", Dialog._parentEvent);
-	};
-	capwin(window);
-	// capture other frames
-	for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
-	// make up a function to be called when the Dialog ends.
-	Dialog._return = function (val) {
-		if (val && action) {
-			action(val);
-		}
-		relwin(window);
-		// capture other frames
-		for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
-		Dialog._modal = null;
-	};
-};
diff -ruN 6171/e107_handlers/htmlarea/examples/2-areas.cgi 75/e107_handlers/htmlarea/examples/2-areas.cgi
--- 6171/e107_handlers/htmlarea/examples/2-areas.cgi	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/2-areas.cgi	1969-12-31 18:00:00.000000000 -0600
@@ -1,16 +0,0 @@
-#! /usr/bin/perl -w
-
-use strict;
-use CGI;
-
-my $cgi = new CGI;
-my $text1 = $cgi->param('text1');
-my $text2 = $cgi->param('text2');
-
-print "Content-type: text/html\n\n";
-
-print "<p>You submitted:</p>";
-print "<table border='1'>";
-print "<thead><tr bgcolor='#cccccc'><td width='50%'>text1</td><td width='50%'>text2</td></tr></thead>";
-print "<tbody><tr><td>$text1</td><td>$text2</td></tr></tbody>";
-print "</table>";
diff -ruN 6171/e107_handlers/htmlarea/examples/2-areas.html 75/e107_handlers/htmlarea/examples/2-areas.html
--- 6171/e107_handlers/htmlarea/examples/2-areas.html	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/2-areas.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,158 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title>Example with 2 HTMLAreas in the same form</title>
-    <script type="text/javascript">
-      // the _editor_url is REQUIRED!  don't forget to set it.
-      _editor_url = "../";
-      // implicit language will be "en", but let's set it for brevity
-      _editor_lang = "en";
-    </script>
-    <script type="text/javascript" src="../htmlarea.js"></script>
-    <script type="text/javascript">
-      // load the plugins that we will use
-      // loading is necessary ONLY ONCE, regardless on how many editors you create
-      // basically calling the following functions will load the plugin files as if
-      // we would have wrote script src="..." but with easier and cleaner code
-      HTMLArea.loadPlugin("TableOperations");
-      HTMLArea.loadPlugin("SpellChecker");
-      HTMLArea.loadPlugin("CSS");
-
-      // this function will get called at body.onload
-      function initDocument() {
-        // cache these values as we need to pass it for both editors
-        var css_plugin_args = {
-          combos : [
-            { label: "Syntax",
-                         // menu text       // CSS class
-              options: { "None"           : "",
-                         "Code" : "code",
-                         "String" : "string",
-                         "Comment" : "comment",
-                         "Variable name" : "variable-name",
-                         "Type" : "type",
-                         "Reference" : "reference",
-                         "Preprocessor" : "preprocessor",
-                         "Keyword" : "keyword",
-                         "Function name" : "function-name",
-                         "Html tag" : "html-tag",
-                         "Html italic" : "html-helper-italic",
-                         "Warning" : "warning",
-                         "Html bold" : "html-helper-bold"
-                       },
-              context: "pre"
-            },
-            { label: "Info",
-              options: { "None"           : "",
-                         "Quote"          : "quote",
-                         "Highlight"      : "highlight",
-                         "Deprecated"     : "deprecated"
-                       }
-            }
-          ]
-        };
-
-        //---------------------------------------------------------------------
-        // GENERAL PATTERN
-        //
-	//  1. Instantitate an editor object.
-	//  2. Register plugins (note, it's required to have them loaded).
-	//  3. Configure any other items in editor.config.
-	//  4. generate() the editor
-	//
-	// The above are steps that you use to create one editor.  Nothing new
-	// so far.  In order to create more than one editor, you just have to
-	// repeat those steps for each of one.  Of course, you can register any
-	// plugins you want (no need to register the same plugins for all
-	// editors, and to demonstrate that we'll skip the TableOperations
-	// plugin for the second editor).  Just be careful to pass different
-	// ID-s in the constructor (you don't want to _even try_ to create more
-	// editors for the same TEXTAREA element ;-)).
-	//
-	// So much for the noise, see the action below.
-	//---------------------------------------------------------------------
-
-
-        //---------------------------------------------------------------------
-        // CREATE FIRST EDITOR
-        //
-        var editor1 = new HTMLArea("text-area-1");
-
-        // plugins must be registered _per editor_.  Therefore, we register
-        // plugins for the first editor here, and we will also do this for the
-        // second editor.
-        editor1.registerPlugin(TableOperations);
-        editor1.registerPlugin(SpellChecker);
-        editor1.registerPlugin(CSS, css_plugin_args);
-
-        // custom config must be done per editor.  Here we're importing the
-        // stylesheet used by the CSS plugin.
-        editor1.config.pageStyle = "@import url(custom.css);";
-
-        // generate first editor
-        editor1.generate();
-        //---------------------------------------------------------------------
-
-
-        //---------------------------------------------------------------------
-        // CREATE SECOND EDITOR
-        //
-        var editor2 = new HTMLArea("text-area-2");
-
-        // we are using the same plugins
-        editor2.registerPlugin(TableOperations);
-        editor2.registerPlugin(SpellChecker);
-        editor2.registerPlugin(CSS, css_plugin_args);
-
-        // import the CSS plugin styles
-        editor2.config.pageStyle = "@import url(custom.css);";
-
-        // generate the second editor
-        // IMPORTANT: if we don't give it a timeout, the first editor will
-        // not function in Mozilla.  Soon I'll think about starting to
-        // implement some kind of event that will fire when the editor
-        // finished creating, then we'll be able to chain the generate()
-        // calls in an elegant way.  But right now there's no other solution
-        // than the following.
-        setTimeout(function() {
-          editor2.generate();
-        }, 500);
-        //---------------------------------------------------------------------
-      };
-    </script>
-  </head>
-
-  <body onload="initDocument()">
-    <h1>Example with 2 HTMLAreas in the same form</h1>
-
-    <form action="2-areas.cgi" method="post" target="_blank">
-
-      <input type="submit" value=" Submit " />
-      <br />
-
-      <textarea id="text-area-1" name="text1" style="width: 100%; height: 12em">
-        &lt;h3&gt;HTMLArea #1&lt;/h3&gt;
-        &lt;p&gt;This will submit a field named &lt;em&gt;text1&lt;/em&gt;.&lt;/p&gt;
-      </textarea>
-
-      <br />
-
-      <textarea id="text-area-2" name="text2" style="width: 100%; height: 12em">
-        &lt;h3&gt;Second HTMLArea&lt;/h3&gt; &lt;p&gt;&lt;em&gt;text2&lt;/em&gt; submission.  Both are
-        located in the same FORM element and the script action is
-        2-areas.cgi (see it in the examples directory)&lt;/p&gt;
-      </textarea>
-
-      <br />
-      <input type="submit" value=" Submit " />
-
-    </form>
-
-    <hr>
-    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
-<!-- Created: Fri Oct 31 09:37:10 EET 2003 -->
-<!-- hhmts start --> Last modified: Wed Jan 28 11:10:40 EET 2004 <!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/character_map.html 75/e107_handlers/htmlarea/examples/character_map.html
--- 6171/e107_handlers/htmlarea/examples/character_map.html	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/examples/character_map.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,33 +0,0 @@
-<html>
-  <head>
-    <title>Test of CharacterMap plugin</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <script type="text/javascript">
-      _editor_url = "../";
-      _editor_lang = "en";
-    </script>
-
-    <!-- load the main HTMLArea files -->
-    <script type="text/javascript" src="../htmlarea.js"></script>
-
-    <script type="text/javascript">
-      HTMLArea.loadPlugin("CharacterMap");
-
-      function initDocument() {
-        var editor = new HTMLArea("editor");
-        editor.registerPlugin(CharacterMap);
-        editor.generate();
-      }
-      
-      
-      
-    </script>
-
-  </head>
-
-  <body onload="initDocument()">
-    <h1>Test of DynamicCSS plugin</h1>
-
-    <textarea id="editor" style="height: 30em; width: 100%;"></textarea>
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/context-menu.html 75/e107_handlers/htmlarea/examples/context-menu.html
--- 6171/e107_handlers/htmlarea/examples/context-menu.html	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/context-menu.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,95 +0,0 @@
-<html>
-  <head>
-    <title>Test of ContextMenu plugin</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <script type="text/javascript">
-      _editor_url = "../";
-      _editor_lang = "en";
-    </script>
-
-    <!-- load the main HTMLArea file -->
-    <script type="text/javascript" src="../htmlarea.js"></script>
-
-    <script type="text/javascript">
-      HTMLArea.loadPlugin("ContextMenu");
-      HTMLArea.loadPlugin("TableOperations");
-
-      function initDocument() {
-        var editor = new HTMLArea("editor");
-        editor.registerPlugin(ContextMenu);
-        editor.registerPlugin(TableOperations);
-        editor.generate();
-      }
-    </script>
-
-  </head>
-
-  <body onload="initDocument()">
-    <h1>Test of ContextMenu plugin</h1>
-
-
-<textarea id="editor" style="height: 30em; width: 100%;">
-&lt;table border="1" style="border: 1px dotted rgb(0, 102, 255); width:
-100%; background-color: rgb(255, 204, 51); background-image: none; float:
-none; text-align: left; vertical-align: top; border-collapse: collapse;"
-summary="" cellspacing="" cellpadding="" frame="box"
-rules="all"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="border: 1px solid
-rgb(255, 0, 0); background-color: rgb(0, 51, 51); background-image: none;
-text-align: left; vertical-align: top;"&gt;&lt;a
-href="http://dynarch.com/mishoo/articles.epl?art_id=430"&gt;&lt;img
-src="http://127.0.0.1/~mishoo/htmlarea/examples/pieng.png" alt="" align=""
-border="0" hspace="0" vspace="0" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td
-style="border: 1px solid rgb(255, 0, 0); background-color: rgb(255, 255, 0);
-background-image: none; text-align: left; vertical-align: top;"&gt;The
-article linked on the left image presents a script that allows Internet
-Explorer to use PNG images.  We hope to be able to implement IE PNG support
-in HTMLArea soon.&lt;br /&gt; &lt;br /&gt; Go on, right-click everywhere and
-test our new context menus.  And be thankful to &lt;a
-href="http://www.americanbible.org/"&gt;American Bible Society&lt;/a&gt; who
-sponsored the development, &lt;a
-href="http://dynarch.com/mishoo/"&gt;mishoo&lt;/a&gt; who made it happen and
-God, Who keeps mishoo alife. ;-)&lt;br /&gt; &lt;br /&gt;&lt;span
-style="font-style: italic;"&gt;P.S.&lt;/span&gt; No animals were harmed
-while producing this movie.&lt;br /&gt;
-&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td style="border-style: none;
-background-color: rgb(255, 255, 51); background-image: none; text-align:
-left; vertical-align: top;"&gt;Welcome to HTMLArea, the best online
-editor.&lt;br /&gt;&lt;/td&gt;&lt;td&gt;HTMLArea is a project initiated by
-&lt;a href="http://interactivetools.com/"&gt;InteractiveTools.com&lt;/a&gt;.
-Other companies contributed largely by sponsoring the development of
-additional extensions.  Many thanks to:&lt;br /&gt; &lt;br
-style="font-family: courier new,courier,monospace;" /&gt; &lt;div
-style="margin-left: 40px;"&gt;&lt;a href="http://www.zapatec.com/"
-style="font-family: courier
-new,courier,monospace;"&gt;http://www.zapatec.com&lt;/a&gt;&lt;br
-style="font-family: courier new,courier,monospace;" /&gt; &lt;a
-href="http://www.americanbible.org/" style="font-family: courier
-new,courier,monospace;"&gt;http://www.americanbible.org&lt;/a&gt;&lt;br
-style="font-family: courier new,courier,monospace;" /&gt; &lt;a
-href="http://www.neomedia.ro/" style="font-family: courier
-new,courier,monospace;"&gt;http://www.neomedia.ro&lt;/a&gt;&lt;br
-style="font-family: courier new,courier,monospace;" /&gt; &lt;a
-href="http://www.os3.it/" style="font-family: courier
-new,courier,monospace;"&gt;http://www.os3.it&lt;/a&gt;&lt;br
-style="font-family: courier new,courier,monospace;" /&gt; &lt;a
-href="http://www.miro.com.au/" style="font-family: courier
-new,courier,monospace;"&gt;http://www.miro.com.au&lt;/a&gt;&lt;br
-style="font-family: courier new,courier,monospace;" /&gt; &lt;a
-href="http://www.thycotic.com/" style="font-family: courier
-new,courier,monospace;"&gt;http://www.thycotic.com&lt;/a&gt;&lt;br /&gt;
-&lt;/div&gt; &lt;br /&gt; and to all the posters at <a
-href="http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/
-">InteractiveTools</a> HTMLArea forums, whose feedback is continually
-useful in polishing HTMLArea.&lt;br /&gt; &lt;br /&gt;&lt;div
-style="text-align: right;"&gt;-- developers and maintainers of version 3,
-&lt;a href="http://dynarch.com/"&gt;dynarch.com&lt;/a&gt;.&lt;br
-/&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
-    </textarea>
-
-    <hr />
-    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
-<!-- Created: Wed Oct  1 19:55:37 EEST 2003 -->
-<!-- hhmts start --> Last modified: Wed Jan 28 11:10:29 EET 2004 <!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/core.html 75/e107_handlers/htmlarea/examples/core.html
--- 6171/e107_handlers/htmlarea/examples/core.html	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/core.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,184 +0,0 @@
-<html>
-<head>
-<title>Example of HTMLArea 3.0</title>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
-<!-- Configure the path to the editor.  We make it relative now, so that the
-    example ZIP file will work anywhere, but please NOTE THAT it's better to
-    have it an absolute path, such as '/htmlarea/'. -->
-<script type="text/javascript">
-  _editor_url = "../";
-  _editor_lang = "en";
-</script>
-<script type="text/javascript" src="../htmlarea.js"></script>
-
-<style type="text/css">
-html, body {
-  font-family: Verdana,sans-serif;
-  background-color: #fea;
-  color: #000;
-}
-a:link, a:visited { color: #00f; }
-a:hover { color: #048; }
-a:active { color: #f00; }
-
-textarea { background-color: #fff; border: 1px solid 00f; }
-</style>
-
-<script type="text/javascript">
-var editor = null;
-function initEditor() {
-  editor = new HTMLArea("ta");
-
-  // comment the following two lines to see how customization works
-  editor.generate();
-  return false;
-
-  var cfg = editor.config; // this is the default configuration
-  cfg.registerButton({
-    id        : "my-hilite",
-    tooltip   : "Highlight text",
-    image     : "ed_custom.gif",
-    textMode  : false,
-    action    : function(editor) {
-                  editor.surroundHTML("<span class=\"hilite\">", "</span>");
-                },
-    context   : 'table'
-  });
-
-  cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
-
-  // BEGIN: code that adds a custom button
-  // uncomment it to test
-  var cfg = editor.config; // this is the default configuration
-  /*
-  cfg.registerButton({
-    id        : "my-hilite",
-    tooltip   : "Highlight text",
-    image     : "ed_custom.gif",
-    textMode  : false,
-    action    : function(editor) {
-                  editor.surroundHTML("<span class=\"hilite\">", "</span>");
-                }
-  });
-  */
-
-function clickHandler(editor, buttonId) {
-  switch (buttonId) {
-    case "my-toc":
-      editor.insertHTML("<h1>Table Of Contents</h1>");
-      break;
-    case "my-date":
-      editor.insertHTML((new Date()).toString());
-      break;
-    case "my-bold":
-      editor.execCommand("bold");
-      editor.execCommand("italic");
-      break;
-    case "my-hilite":
-      editor.surroundHTML("<span class=\"hilite\">", "</span>");
-      break;
-  }
-};
-cfg.registerButton("my-toc",  "Insert TOC", "ed_custom.gif", false, clickHandler);
-cfg.registerButton("my-date", "Insert date/time", "ed_custom.gif", false, clickHandler);
-cfg.registerButton("my-bold", "Toggle bold/italic", "ed_custom.gif", false, clickHandler);
-cfg.registerButton("my-hilite", "Hilite selection", "ed_custom.gif", false, clickHandler);
-
-cfg.registerButton("my-sample", "Class: sample", "ed_custom.gif", false,
-  function(editor) {
-    if (HTMLArea.is_ie) {
-      editor.insertHTML("<span class=\"sample\">&nbsp;&nbsp;</span>");
-      var r = editor._doc.selection.createRange();
-      r.move("character", -2);
-      r.moveEnd("character", 2);
-      r.select();
-    } else { // Gecko/W3C compliant
-      var n = editor._doc.createElement("span");
-      n.className = "sample";
-      editor.insertNodeAtSelection(n);
-      var sel = editor._iframe.contentWindow.getSelection();
-      sel.removeAllRanges();
-      var r = editor._doc.createRange();
-      r.setStart(n, 0);
-      r.setEnd(n, 0);
-      sel.addRange(r);
-    }
-  }
-);
-
-
-  /*
-  cfg.registerButton("my-hilite", "Highlight text", "ed_custom.gif", false,
-    function(editor) {
-      editor.surroundHTML('<span class="hilite">', '</span>');
-    }
-  );
-  */
-  cfg.pageStyle = "body { background-color: #efd; } .hilite { background-color: yellow; } "+
-                  ".sample { color: green; font-family: monospace; }";
-  cfg.toolbar.push(["linebreak", "my-toc", "my-date", "my-bold", "my-hilite", "my-sample"]); // add the new button to the toolbar
-  // END: code that adds a custom button
-
-  editor.generate();
-}
-function insertHTML() {
-  var html = prompt("Enter some HTML code here");
-  if (html) {
-    editor.insertHTML(html);
-  }
-}
-function highlight() {
-  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
-}
-</script>
-
-</head>
-
-<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
-     customizing the editor.  It's the easiest way! :) -->
-<body onload="initEditor()">
-
-<h1>HTMLArea 3.0</h1>
-
-<p>A replacement for <code>TEXTAREA</code> elements.  &copy; <a
-href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
-
-<form action="test.cgi" method="post" id="edit" name="edit">
-
-<textarea id="ta" name="ta" style="width:100%" rows="20" cols="80">
-  &lt;p&gt;Here is some sample text: &lt;b&gt;bold&lt;/b&gt;, &lt;i&gt;italic&lt;/i&gt;, &lt;u&gt;underline&lt;/u&gt;. &lt;/p&gt;
-  &lt;p align=center&gt;Different fonts, sizes and colors (all in bold):&lt;/p&gt;
-  &lt;p&gt;&lt;b&gt;
-   &lt;font face="arial"           size="7" color="#000066"&gt;arial&lt;/font&gt;,
-   &lt;font face="courier new"     size="6" color="#006600"&gt;courier new&lt;/font&gt;,
-   &lt;font face="georgia"         size="5" color="#006666"&gt;georgia&lt;/font&gt;,
-   &lt;font face="tahoma"          size="4" color="#660000"&gt;tahoma&lt;/font&gt;,
-   &lt;font face="times new roman" size="3" color="#660066"&gt;times new roman&lt;/font&gt;,
-   &lt;font face="verdana"         size="2" color="#666600"&gt;verdana&lt;/font&gt;,
-   &lt;font face="tahoma"          size="1" color="#666666"&gt;tahoma&lt;/font&gt;
-  &lt;/b&gt;&lt;/p&gt;
-  &lt;p&gt;Click on &lt;a href="http://www.interactivetools.com/"&gt;this link&lt;/a&gt; and then on the link button to the details ... OR ... select some text and click link to create a &lt;b&gt;new&lt;/b&gt; link.&lt;/p&gt;
-</textarea>
-
-<p />
-
-<input type="submit" name="ok" value="  submit  " />
-<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
-<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
-
-<a href="javascript:mySubmit()">submit</a>
-
-<script type="text/javascript">
-function mySubmit() {
-// document.edit.save.value = "yes";
-document.edit.onsubmit(); // workaround browser bugs.
-document.edit.submit();
-};
-</script>
-
-</form>
-
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/css.html 75/e107_handlers/htmlarea/examples/css.html
--- 6171/e107_handlers/htmlarea/examples/css.html	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/css.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,88 +0,0 @@
-<html>
-  <head>
-    <title>Test of CSS plugin</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <script type="text/javascript">
-      _editor_url = "../";
-      _editor_lang = "en";
-    </script>
-
-    <!-- load the main HTMLArea files -->
-    <script type="text/javascript" src="../htmlarea.js"></script>
-
-    <script type="text/javascript">
-      HTMLArea.loadPlugin("CSS");
-
-      function initDocument() {
-        var editor = new HTMLArea("editor");
-        editor.config.pageStyle = "@import url(custom.css);";
-        editor.registerPlugin(CSS, {
-          combos : [
-            { label: "Syntax",
-                         // menu text       // CSS class
-              options: { "None"           : "",
-                         "Code" : "code",
-                         "String" : "string",
-                         "Comment" : "comment",
-                         "Variable name" : "variable-name",
-                         "Type" : "type",
-                         "Reference" : "reference",
-                         "Preprocessor" : "preprocessor",
-                         "Keyword" : "keyword",
-                         "Function name" : "function-name",
-                         "Html tag" : "html-tag",
-                         "Html italic" : "html-helper-italic",
-                         "Warning" : "warning",
-                         "Html bold" : "html-helper-bold"
-                       },
-              context: "pre"
-            },
-            { label: "Info",
-              options: { "None"           : "",
-                         "Quote"          : "quote",
-                         "Highlight"      : "highlight",
-                         "Deprecated"     : "deprecated"
-                       }
-            }
-          ]
-        });
-        editor.generate();
-      }
-    </script>
-
-  </head>
-
-  <body onload="initDocument()">
-    <h1>Test of FullPage plugin</h1>
-
-    <textarea id="editor" style="height: 30em; width: 100%;"
->&lt;h1&gt;&lt;tt&gt;registerDropdown&lt;/tt&gt;&lt;/h1&gt;
-
-&lt;p&gt;Here's some sample code that adds a dropdown to the toolbar.  Go on, do
-        syntax highlighting on it ;-)&lt;/p&gt;
-
-&lt;pre&gt;var the_options = {
-	"Keyword"          : "keyword",
-	"Function name"    : "function-name",
-	"String"           : "string",
-	"Numeric"          : "integer",
-	"Variable name"    : "variable"
-};
-var css_class = {
-	id                 : "CSS-class",
-	tooltip            : i18n["tooltip"],
-	options            : the_options,
-	action             : function(editor) { self.onSelect(editor, this); }
-};
-cfg.registerDropdown(css_class);
-toolbar[0].unshift(["CSS-class"]);&lt;/pre&gt;
-
-&lt;p&gt;Easy, eh? ;-)&lt;/p&gt;</textarea>
-
-    <hr />
-    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
-<!-- Created: Wed Oct  1 19:55:37 EEST 2003 -->
-<!-- hhmts start --> Last modified: Wed Jan 28 11:10:16 EET 2004 <!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/custom.css 75/e107_handlers/htmlarea/examples/custom.css
--- 6171/e107_handlers/htmlarea/examples/custom.css	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/custom.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,29 +0,0 @@
-body { background-color: #234; color: #dd8; font-family: tahoma; font-size: 12px; }
-
-a:link, a:visited { color: #8cf; }
-a:hover { color: #ff8; }
-
-h1 { background-color: #456; color: #ff8; padding: 2px 5px; border: 1px solid; border-color: #678 #012 #012 #678; }
-
-/* syntax highlighting (used by the first combo defined for the CSS plugin) */
-
-pre { margin: 0px 1em; padding: 5px 1em; background-color: #000; border: 1px dotted #02d; border-left: 2px solid #04f; }
-.code { color: #f5deb3; }
-.string { color: #00ffff; }
-.comment { color: #8fbc8f; }
-.variable-name { color: #fa8072; }
-.type { color: #90ee90; font-weight: bold; }
-.reference { color: #ee82ee; }
-.preprocessor { color: #faf; }
-.keyword { color: #ffffff; font-weight: bold; }
-.function-name { color: #ace; }
-.html-tag { font-weight: bold; }
-.html-helper-italic { font-style: italic; }
-.warning { color: #ffa500; font-weight: bold; }
-.html-helper-bold { font-weight: bold; }
-
-/* info combo */
-
-.quote { font-style: italic; color: #ee9; }
-.highlight { background-color: yellow; color: #000; }
-.deprecated { text-decoration: line-through; color: #aaa; }
diff -ruN 6171/e107_handlers/htmlarea/examples/dynamic.css 75/e107_handlers/htmlarea/examples/dynamic.css
--- 6171/e107_handlers/htmlarea/examples/dynamic.css	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/examples/dynamic.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,45 +0,0 @@
-p { 
-  FONT-FAMILY: Arial, Helvetica;
-  FONT-SIZE: 9pt;
-  FONT-WEIGHT: normal;
-  COLOR: #000000;
-}
-
-p.p1 { 
-  FONT-FAMILY: Arial, Helvetica;
-  FONT-SIZE: 11pt;
-  FONT-WEIGHT: normal;
-  COLOR: #000000;
-}
-
-p.p2 { 
-  FONT-FAMILY: Arial, Helvetica;
-  FONT-SIZE: 13pt;
-  FONT-WEIGHT: normal;
-  COLOR: #000000;
-}
-
-div { 
-  FONT-FAMILY: Arial, Helvetica;
-  FONT-SIZE: 9pt;
-  FONT-WEIGHT: bold;
-  COLOR: #000000;
-}
-
-div.div1 { 
-  FONT-FAMILY: Arial, Helvetica;
-  FONT-SIZE: 11pt;
-  FONT-WEIGHT: bold;
-  COLOR: #000000;
-}
-
-div.div2 { 
-  FONT-FAMILY: Arial, Helvetica;
-  FONT-SIZE: 13pt;
-  FONT-WEIGHT: bold;
-  COLOR: #000000;
-}
-
-.quote { font-style: italic; color: #ee9; }
-.highlight { background-color: yellow; color: #000; }
-.deprecated { text-decoration: line-through; color: #aaa; }
diff -ruN 6171/e107_handlers/htmlarea/examples/dynamic_css.html 75/e107_handlers/htmlarea/examples/dynamic_css.html
--- 6171/e107_handlers/htmlarea/examples/dynamic_css.html	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/examples/dynamic_css.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,44 +0,0 @@
-<html>
-  <head>
-    <title>Test of CSS plugin</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <script type="text/javascript">
-      _editor_url = "../";
-      _editor_lang = "en";
-    </script>
-
-    <!-- load the main HTMLArea files -->
-    <script type="text/javascript" src="../htmlarea.js"></script>
-
-    <script type="text/javascript">
-      HTMLArea.loadPlugin("DynamicCSS");
-
-      function initDocument() {
-        var editor = new HTMLArea("editor");
-        editor.config.pageStyle = "@import url(dynamic.css);";
-        editor.registerPlugin(DynamicCSS);
-        editor.generate();
-      }
-      
-      
-      
-    </script>
-
-  </head>
-
-  <body onload="initDocument()">
-    <h1>Test of DynamicCSS plugin</h1>
-
-    <textarea id="editor" style="height: 30em; width: 100%;">
-        <p>p with default p style</p><br>
-        <p class="p1">p with p.class="p1"</p><br>
-        <p class="p2">p with p.class="p2"</p><br>
-        <br>
-        <div>div with default div class</div><br>
-        <div class="div1">div with div.class="div1"</div><br>
-        <div class="div2">div with div.class="div2"</div><br>
-        <br>
-        <span class="highlight">testtext with common class="highlight"</span>
-    </textarea>
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/empty.html 75/e107_handlers/htmlarea/examples/empty.html
--- 6171/e107_handlers/htmlarea/examples/empty.html	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/examples/empty.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,22 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <title>HTMLArea 3.0 core test</title>
-    <script type="text/javascript">
-      _editor_url = "../";
-      _editor_lang = "en";
-    </script>
-    <script type="text/javascript" src="../htmlarea.js"></script>
-    <script type="text/javascript">
-      HTMLArea.loadPlugin("ContextMenu");
-      HTMLArea.onload = function() {
-        var editor = new HTMLArea("editor");
-        editor.registerPlugin(ContextMenu);
-        editor.generate();
-      };
-      HTMLArea.init();
-    </script>
-  </head>
-  <body>
-    <textarea id="editor" rows="20" cols="80" style="width: 100%"></textarea>
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/full-page.html 75/e107_handlers/htmlarea/examples/full-page.html
--- 6171/e107_handlers/htmlarea/examples/full-page.html	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/full-page.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,75 +0,0 @@
-<html>
-  <head>
-    <title>Test of FullPage plugin</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <script type="text/javascript">
-      _editor_url = "../";
-      _editor_lang = "en";
-    </script>
-
-    <!-- load the main HTMLArea files -->
-    <script type="text/javascript" src="../htmlarea.js"></script>
-
-    <script type="text/javascript">
-      HTMLArea.loadPlugin("FullPage");
-
-      function initDocument() {
-        var editor = new HTMLArea("editor");
-        editor.registerPlugin(FullPage);
-        editor.generate();
-      }
-    </script>
-
-  </head>
-
-  <body onload="initDocument()">
-    <h1>Test of FullPage plugin</h1>
-
-    <textarea id="editor" style="height: 30em; width: 100%;">
-      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
-      &lt;html&gt;
-        &lt;head&gt;
-          &lt;title&gt;FullPage plugin for HTMLArea&lt;/title&gt;
-          &lt;link rel="alternate stylesheet" href="http://dynarch.com/mishoo/css/dark.css" /&gt;
-          &lt;link rel="stylesheet" href="http://dynarch.com/mishoo/css/cool-light.css" /&gt;
-        &lt;/head&gt;
-        &lt;body style="background-color: #ddddee; color: #000077;"&gt;
-          &lt;table style="width:60%; height: 90%; margin: 2% auto 1% auto;" align="center" border="0" cellpadding="0" cellspacing="0"&gt;
-            &lt;tr&gt;
-              &lt;td style="background-color: #ddeedd; border: 2px solid #002; height: 1.5em; padding: 2px; font: bold 24px Verdana;"&gt;
-                FullPage plugin
-              &lt;/td&gt;
-            &lt;/tr&gt;
-            &lt;tr&gt;
-              &lt;td style="background-color: #fff; border: 1px solid #aab; padding: 1em 3em; font: 12px Verdana;"&gt;
-                &lt;p&gt;
-                  This plugin enables one to edit a full HTML file in &lt;a
-                    href="http://dynarch.com/htmlarea/"&gt;HTMLArea&lt;/a&gt;.  This is not
-                  normally possible with just the core editor since it only
-                  retrieves the HTML inside the &lt;code&gt;body&lt;/code&gt; tag.
-                &lt;/p&gt;
-                &lt;p&gt;
-                  It provides the ability to change the &lt;code&gt;DOCTYPE&lt;/code&gt; of
-                  the document, &lt;code&gt;body&lt;/code&gt; &lt;code&gt;bgcolor&lt;/code&gt; and
-                  &lt;code&gt;fgcolor&lt;/code&gt; attributes as well as to add additional
-                  &lt;code&gt;link&lt;/code&gt;-ed stylesheets.  Cool, eh?
-                &lt;/p&gt;
-                &lt;p&gt;
-                  The development of this plugin was initiated and sponsored by
-                  &lt;a href="http://thycotic.com"&gt;Thycotic Software Ltd.&lt;/a&gt;.
-                  That's also cool, isn't it? ;-)
-                &lt;/p&gt;
-              &lt;/td&gt;
-            &lt;/tr&gt;
-          &lt;/table&gt;
-        &lt;/body&gt;
-      &lt;/html&gt;
-    </textarea>
-
-    <hr />
-    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
-<!-- Created: Wed Oct  1 19:55:37 EEST 2003 -->
-<!-- hhmts start --> Last modified: Wed Jan 28 11:10:07 EET 2004 <!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/fully-loaded.html 75/e107_handlers/htmlarea/examples/fully-loaded.html
--- 6171/e107_handlers/htmlarea/examples/fully-loaded.html	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/examples/fully-loaded.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,262 +0,0 @@
-<html>
-<head>
-<title>Example of HTMLArea 3.0</title>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
-<!-- Configure the path to the editor.  We make it relative now, so that the
-    example ZIP file will work anywhere, but please NOTE THAT it's better to
-    have it an absolute path, such as '/htmlarea/'. -->
-<script type="text/javascript">
-  _editor_url = "../";
-  _editor_lang = "en";
-</script>
-
-<!-- load the main HTMLArea file, this will take care of loading the CSS and
-    other required core scripts. -->
-<script type="text/javascript" src="../htmlarea.js"></script>
-
-<!-- load the plugins -->
-<script type="text/javascript">
-      // WARNING: using this interface to load plugin
-      // will _NOT_ work if plugins do not have the language
-      // loaded by HTMLArea.
-
-      // In other words, this function generates SCRIPT tags
-      // that load the plugin and the language file, based on the
-      // global variable HTMLArea.I18N.lang (defined in the lang file,
-      // in our case "lang/en.js" loaded above).
-
-      // If this lang file is not found the plugin will fail to
-      // load correctly and NOTHING WILL WORK.
-
-      HTMLArea.loadPlugin("TableOperations");
-      HTMLArea.loadPlugin("SpellChecker");
-      HTMLArea.loadPlugin("FullPage");
-      HTMLArea.loadPlugin("CSS");
-      HTMLArea.loadPlugin("ContextMenu");
-      //HTMLArea.loadPlugin("HtmlTidy");
-      HTMLArea.loadPlugin("ListType");
-      HTMLArea.loadPlugin("CharacterMap");
-HTMLArea.loadPlugin("DynamicCSS");
-</script>
-
-<style type="text/css">
-html, body {
-  font-family: Verdana,sans-serif;
-  background-color: #fea;
-  color: #000;
-}
-a:link, a:visited { color: #00f; }
-a:hover { color: #048; }
-a:active { color: #f00; }
-
-textarea { background-color: #fff; border: 1px solid 00f; }
-</style>
-
-<script type="text/javascript">
-var editor = null;
-
-function initEditor() {
-
-  // create an editor for the "ta" textbox
-  editor = new HTMLArea("ta");
-
-  // register the FullPage plugin
-  editor.registerPlugin(FullPage);
-
-  // register the SpellChecker plugin
-  editor.registerPlugin(TableOperations);
-
-  // register the SpellChecker plugin
-  editor.registerPlugin(SpellChecker);
-  
-  // register the HtmlTidy plugin
-  //editor.registerPlugin(HtmlTidy);
-
-  // register the ListType plugin
-  editor.registerPlugin(ListType);
-
-  editor.registerPlugin(CharacterMap);
-editor.registerPlugin(DynamicCSS);
-
-  // register the CSS plugin
-  editor.registerPlugin(CSS, {
-    combos : [
-      { label: "Syntax:",
-                   // menu text       // CSS class
-        options: { "None"           : "",
-                   "Code" : "code",
-                   "String" : "string",
-                   "Comment" : "comment",
-                   "Variable name" : "variable-name",
-                   "Type" : "type",
-                   "Reference" : "reference",
-                   "Preprocessor" : "preprocessor",
-                   "Keyword" : "keyword",
-                   "Function name" : "function-name",
-                   "Html tag" : "html-tag",
-                   "Html italic" : "html-helper-italic",
-                   "Warning" : "warning",
-                   "Html bold" : "html-helper-bold"
-                 },
-        context: "pre"
-      },
-      { label: "Info:",
-        options: { "None"           : "",
-                   "Quote"          : "quote",
-                   "Highlight"      : "highlight",
-                   "Deprecated"     : "deprecated"
-                 }
-      }
-    ]
-  });
-
-  // add a contextual menu
-  editor.registerPlugin("ContextMenu");
-
-  // load the stylesheet used by our CSS plugin configuration
-  editor.config.pageStyle = "@import url(custom.css);";
-
-  editor.generate();
-  return false;
-}
-
-HTMLArea.onload = initEditor;
-
-function insertHTML() {
-  var html = prompt("Enter some HTML code here");
-  if (html) {
-    editor.insertHTML(html);
-  }
-}
-function highlight() {
-  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
-}
-</script>
-
-</head>
-
-<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
-     customizing the editor.  It's the easiest way! :) -->
-<body onload="HTMLArea.init();">
-
-<h1>HTMLArea 3.0</h1>
-
-<p>A replacement for <code>TEXTAREA</code> elements.  &copy; <a
-href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
-
-<form action="test.cgi" method="post" id="edit" name="edit">
-
-<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
-&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN"&gt;
-&lt;html&gt;
-
-&lt;head&gt;
-&lt;title&gt;Passing parameters to JavaScript code&lt;/title&gt;
-&lt;link rel="stylesheet" href="custom.css" /&gt;
-&lt;/head&gt;
-
-&lt;body&gt;
-&lt;h1&gt;Passing parameters to JavaScript code&lt;/h1&gt;
-
-&lt;p&gt;Sometimes we need to pass parameters to some JavaScript function that we
-wrote ourselves.  But sometimes it's simply more convenient to include the
-parameter not in the function call, but in the affected HTML elements.
-Usually, all JavaScript calls affect some element, right? ;-)&lt;/p&gt;
-
-&lt;p&gt;Well, here's an original way to do it.  Or at least, I think it's
-original.&lt;/p&gt;
-
-&lt;h2&gt;But first...&lt;/h2&gt;
-
-&lt;p&gt;... an example.  Why would I need such thing?  I have a JS function that
-is called on &lt;code&gt;BODY&lt;/code&gt; &lt;code&gt;onload&lt;/code&gt; handler.  This function
-tries to retrieve the element with the ID "conttoc" and, if present, it will
-&lt;a href="toc.epl" title="Automatic TOC generation"&gt;generate an index&lt;/a&gt;.
-The problem is, this function exists in some external JavaScript library
-that it's loaded in page.  I only needed to pass the parameter from
-&lt;em&gt;one&lt;/em&gt; page.  Thus, it makes sense to pass the parameter from the HTML
-code on &lt;em&gt;that&lt;/em&gt; page, not to affect the others.&lt;/p&gt;
-
-&lt;p&gt;The first idea that came to me was to use some attribute, like "id" or
-"class".  But "id" was locked already, it &lt;em&gt;had&lt;/em&gt; to be "conttoc".  Use
-"class"?  It's not elegant.. what if I really wanted to give it a class, at
-some point?&lt;/p&gt;
-
-&lt;h2&gt;The idea&lt;/h2&gt;
-
-&lt;p&gt;So I thought: what are the HTML elements that do not affect the page
-rendering in any way?  Well, comments.  I mean, &lt;em&gt;comments&lt;/em&gt;, HTML
-comments.  You know, like &lt;code&gt;&amp;lt;!-- this is a comment --&amp;gt;&lt;/code&gt;.&lt;/p&gt;
-
-&lt;p&gt;Though comments do not normally affect the way browser renders the page,
-they are still parsed and are part of the DOM, as well as any other node.
-But this mean that we can access comments from JavaScript code, just like we
-access any other element, right?  Which means that they &lt;em&gt;can&lt;/em&gt; affect
-the way that page finally appears ;-)&lt;/p&gt;
-
-&lt;h2&gt;The code&lt;/h2&gt;
-
-&lt;p&gt;The main part was the idea.  The code is simple ;-)  Suppose we have the
-following HTML code:&lt;/p&gt;
-
-&lt;pre class="code"&gt;&lt;span class="function-name"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html-tag"&gt;div&lt;/span&gt; &lt;span class="variable-name"&gt;id=&lt;/span&gt;&lt;span class="string"&gt;&amp;quot;conttoc&amp;quot;&lt;/span&gt;&lt;span class="paren-face-match"&gt;&amp;gt;&lt;/span&gt;&lt;span class="function-name"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html-tag"&gt;/div&lt;/span&gt;&lt;span class="function-name"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
-
-&lt;p&gt;and our function checks for the presence an element having the ID
-"conttoc", and generates a table of contents into it.  Our code will also
-check if the "conttoc" element's first child is a comment node, and if so
-will parse additional parameters from there, for instance, a desired prefix
-for the links that are to be generated into it.  Why did I need it?  Because
-if the page uses a &lt;code&gt;&amp;lt;base&amp;gt;&lt;/code&gt; element to specify the default
-link prefix, then links like "#gen1" generated by the &lt;a href="toc.epl"&gt;toc
-generator&lt;/a&gt; will not point to that same page as they should, but to the
-page reffered from &lt;code&gt;&amp;lt;base&amp;gt;&lt;/code&gt;.&lt;/p&gt;
-
-&lt;p&gt;So the HTML would now look like this:&lt;/p&gt;
-
-&lt;pre class="code"&gt;&lt;span class="function-name"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html-tag"&gt;div&lt;/span&gt; &lt;span class="variable-name"&gt;id=&lt;/span&gt;&lt;span class="string"&gt;&amp;quot;conttoc&amp;quot;&lt;/span&gt;&lt;span class="function-name"&gt;&amp;gt;&lt;/span&gt;&lt;span class="comment"&gt;&amp;lt;!-- base:link/prefix.html --&amp;gt;&lt;/span&gt;&lt;span class="paren-face-match"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html-tag"&gt;/div&lt;/span&gt;&lt;span class="paren-face-match"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
-
-&lt;p&gt;And our TOC generation function does something like this:&lt;/p&gt;
-
-&lt;pre class="code"&gt;&lt;span class="keyword"&gt;var&lt;/span&gt; &lt;span class="variable-name"&gt;element&lt;/span&gt; = getElementById(&amp;quot;&lt;span class="string"&gt;conttoc&lt;/span&gt;&amp;quot;);
-&lt;span class="keyword"&gt;if&lt;/span&gt; (element.firstChild &amp;amp;&amp;amp; element.firstChild.nodeType == 8) {
-  &lt;span class="comment"&gt;// 8 means Node.COMMENT_NODE.  We're using numeric values
-&lt;/span&gt;  &lt;span class="comment"&gt;// because IE6 does not support constant names.
-&lt;/span&gt;  &lt;span class="keyword"&gt;var&lt;/span&gt; &lt;span class="variable-name"&gt;parameters&lt;/span&gt; = element.firstChild.data;
-  &lt;span class="comment"&gt;// at this point &amp;quot;parameters&amp;quot; contains base:link/prefix.html
-&lt;/span&gt;  &lt;span class="comment"&gt;// ...
-&lt;/span&gt;}&lt;/pre&gt;
-
-&lt;p&gt;So we retrieved the value passed to the script from the HTML code.  This
-was the goal of this article.&lt;/p&gt;
-
-&lt;hr /&gt;
-&lt;address&gt;&lt;a href="http://students.infoiasi.ro/~mishoo/"&gt;Mihai Bazon&lt;/a&gt;&lt;/address&gt;
-&lt;!-- hhmts start --&gt; Last modified on Thu Apr  3 20:34:17 2003
-&lt;!-- hhmts end --&gt;
-&lt;!-- doc-lang: English --&gt;
-&lt;/body&gt;
-&lt;/html&gt;
-</textarea>
-
-<p />
-
-<input type="submit" name="ok" value="  submit  " />
-<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
-<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
-
-<a href="javascript:mySubmit()">submit</a>
-
-<script type="text/javascript">
-function mySubmit() {
-// document.edit.save.value = "yes";
-document.edit.onsubmit(); // workaround browser bugs.
-document.edit.submit();
-};
-</script>
-
-</form>
-
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/images.html 75/e107_handlers/htmlarea/examples/images.html
--- 6171/e107_handlers/htmlarea/examples/images.html	2004-06-26 08:48:22.000000000 -0500
+++ 75/e107_handlers/htmlarea/examples/images.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,56 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <title>Test of Image Manager plugin</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <style type="text/css">
-    /*<![CDATA[*/
-        <!--
-                .textarea { height: 30em; width: 80%; } 
-        -->
-        /*]]>*/
-    </style>
-    <script type="text/javascript">
-    //<![CDATA[
-      _editor_url = "../";
-      _editor_lang = "en";
-    //]]>
-    </script><!-- load the main HTMLArea file -->
-    <script type="text/javascript" src="../htmlarea.js">
-    </script>
-    <script type="text/javascript">
-    //<![CDATA[
-          HTMLArea.loadPlugin("ImageManager");
-     initdocument = function () {
-        var editor = new HTMLArea("editor");
-        editor.generate();
-      }
-        function addEvent(obj, evType, fn)
-        { 
-                if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
-                else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
-                else {  return false; } 
-        } 
-        addEvent(window, 'load', initdocument);
-    //]]>
-    </script>
-  </head>
-  <body>
-    <h1>HTMLArea 3 RC1 + Image Manager + Image Editor</h1>
-    <p>PHP Image Manager, Image Editor for HTMLArea. Requires PHP, GD or NetPBM or
-    ImageMagick.</p>
-    <ul>
-      <li>Auto cache thumbnails (JPEG, PNG, GIF depending on GD).</li>
-      <li>Filmstrip view.</li>
-      <li>Online Image Editor.</li>
-      <li>Create folders (if permitting).</li>
-      <li>Editor - Resize, Crop, Rotate, Save as.</li>
-    </ul>
-     <div><textarea id="editor" class="textarea" rows="10" cols="40"></textarea></div>
-    <hr />
-    <address>
-      <a href="http://www.zhuo.org/htmlarea/" title="Home of the ImageManger+Editor">Xiang Wei Zhuo</a>
-    </address>
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/index.html 75/e107_handlers/htmlarea/examples/index.html
--- 6171/e107_handlers/htmlarea/examples/index.html	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/examples/index.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html> <head>
-<title>HTMLArea examples index</title>
-</head>
-
-<body>
-<h1>HTMLArea: auto-generated examples index</h1>
-
-<ul>
-% while (<*.html>) {
-% next if /^index.html$/;
-  <li>
-    <a href="<% $_ %>"><% $_ %></a>
-  </li>
-% }
-</ul>
-
-<hr />
-<address>mihai_bazon@yahoo.com</address>
-<!-- hhmts start --> Last modified: Sun Feb  1 13:30:39 EET 2004 <!-- hhmts end -->
-</body> </html>
-
-<%INIT>
-my $dir = $m->interp->comp_root;
-$dir =~ s{/+$}{}g;
-#$dir =~ s{/[^/]+$}{}g;
-$dir .= $m->current_comp->dir_path;
-chdir $dir;
-</%INIT>
diff -ruN 6171/e107_handlers/htmlarea/examples/list-type.html 75/e107_handlers/htmlarea/examples/list-type.html
--- 6171/e107_handlers/htmlarea/examples/list-type.html	2004-06-26 08:48:22.000000000 -0500
+++ 75/e107_handlers/htmlarea/examples/list-type.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,66 +0,0 @@
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>Example of HTMLArea 3.0 -- ListType plugin</title>
-
-<script type="text/javascript">
-  _editor_lang = "en";
-  _editor_url = "../";
-</script>
-
-<!-- load the main HTMLArea files -->
-<script type="text/javascript" src="../htmlarea.js"></script>
-
-<style type="text/css">
-html, body {
-  font-family: Verdana,sans-serif;
-  background-color: #fea;
-  color: #000;
-}
-a:link, a:visited { color: #00f; }
-a:hover { color: #048; }
-a:active { color: #f00; }
-
-textarea { background-color: #fff; border: 1px solid 00f; }
-</style>
-
-<script type="text/javascript">
-// load the plugin files
-HTMLArea.loadPlugin("ListType");
-var editor = null;
-function initEditor() {
-  editor = new HTMLArea("ta");
-  editor.registerPlugin(ListType);
-  editor.generate();
-  return false;
-}
-</script>
-
-</head>
-
-<body onload="initEditor()">
-
-<h1>HTMLArea :: the ListType plugin</h1>
-
-<form action="test.cgi" method="post" id="edit" name="edit">
-
-<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
-
-<p>List style type is selected using the CSS property
-&quot;list-style-type&quot;.  Hopefully it will work with Internet Explorer,
-right? ;-) Let's start the monster to test it out.<br /></p><p>Cool, it
-works.  Except for &quot;lower-greek&quot;, which doesn't seem to be
-supported (and worse, a gross error message is displayed).  Therefore, I
-hide that proerty from IE--it will only be available if the browser is not
-IE.<br /></p><ol style="list-style-type: decimal;"><li>This is a list<br
-/></li><li>with decimal numbers<br /></li><li>blah blah<br /></li><li>dolor
-sic amet<br /></li></ol><ol style="list-style-type: lower-greek;"><li>yet
-another</li><li>list with greek<br /></li><li>letters<br /></li><li>lorem
-ipsum<br /></li><li>yada yada<br /></li></ol>
-
-</textarea>
-
-</form>
-
-</body>
-</html>
Files 6171/e107_handlers/htmlarea/examples/pieng.png and 75/e107_handlers/htmlarea/examples/pieng.png differ
diff -ruN 6171/e107_handlers/htmlarea/examples/remove-font-tags.html 75/e107_handlers/htmlarea/examples/remove-font-tags.html
--- 6171/e107_handlers/htmlarea/examples/remove-font-tags.html	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/examples/remove-font-tags.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,41 +0,0 @@
-<html>
-  <head>
-    <title>The "htmlRemoveTags" feature</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <script type="text/javascript">
-      _editor_url = "../";
-      _editor_lang = "en";
-    </script>
-
-    <!-- load the main HTMLArea file -->
-    <script type="text/javascript" src="../htmlarea.js"></script>
-
-    <script type="text/javascript">
-      HTMLArea.loadPlugin("ContextMenu");
-      HTMLArea.loadPlugin("TableOperations");
-
-      function initDocument() {
-        var editor = new HTMLArea("editor");
-        // the following line ensures that FONT tags won't be reported by HTMLArea
-        editor.config.htmlRemoveTags = /^(font)$/i;
-        editor.registerPlugin(ContextMenu);
-        editor.registerPlugin(TableOperations);
-        editor.generate();
-      }
-    </script>
-
-  </head>
-
-  <body onload="initDocument()">
-    <h1>Remove FONT tags</h1>
-
-
-    <textarea id="editor" style="height: 30em; width: 100%;"></textarea>
-
-    <hr />
-    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
-<!-- Created: Wed Oct  1 19:55:37 EEST 2003 -->
-<!-- hhmts start --> Last modified: Wed Apr 28 15:09:09 EEST 2004 <!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/spell-checker.html 75/e107_handlers/htmlarea/examples/spell-checker.html
--- 6171/e107_handlers/htmlarea/examples/spell-checker.html	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/spell-checker.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,132 +0,0 @@
-<html>
-<head>
-<title>Example of HTMLArea 3.0</title>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
-<!-- Configure the path to the editor.  We make it relative now, so that the
-    example ZIP file will work anywhere, but please NOTE THAT it's better to
-    have it an absolute path, such as '/htmlarea/'. -->
-<script type="text/javascript">
-  _editor_lang = "en";
-  _editor_url = "../";
-</script>
-<!-- load the main HTMLArea files -->
-<script type="text/javascript" src="../htmlarea.js"></script>
-
-<style type="text/css">
-html, body {
-  font-family: Verdana,sans-serif;
-  background-color: #fea;
-  color: #000;
-}
-a:link, a:visited { color: #00f; }
-a:hover { color: #048; }
-a:active { color: #f00; }
-
-textarea { background-color: #fff; border: 1px solid 00f; }
-</style>
-
-<script type="text/javascript">
-HTMLArea.loadPlugin("SpellChecker");
-var editor = null;
-function initEditor() {
-  // create an editor for the "ta" textbox
-  editor = new HTMLArea("ta");
-
-  // register the SpellChecker plugin
-  editor.registerPlugin(SpellChecker);
-
-  editor.generate();
-  return false;
-}
-
-function insertHTML() {
-  var html = prompt("Enter some HTML code here");
-  if (html) {
-    editor.insertHTML(html);
-  }
-}
-function highlight() {
-  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
-}
-</script>
-
-</head>
-
-<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
-     customizing the editor.  It's the easiest way! :) -->
-<body onload="initEditor()">
-
-<h1>HTMLArea 3.0</h1>
-
-<p>A replacement for <code>TEXTAREA</code> elements.  &copy; <a
-href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
-
-<p>Plugins:
-      <tt>SpellChecker</tt> (sponsored by <a
-        href="http://americanbible.org">American Bible Society</a>).
-</p>
-
-<form action="test.cgi" method="post" id="edit" name="edit">
-
-<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
-
-<h1>The <tt>SpellChecker</tt> plugin</h1>
-
-      <p>This file deminstrates the <tt>SpellChecker</tt> plugin of
-      HTMLArea.  To inwoke the spell checkert you need to press the
-      <em>spell-check</em> buton in the toolbar.</p>
-
-      <p>The spell-checker uses a serverside script written in Perl.  The
-        Perl script calls <a href="http://aspell.net">aspell</a> for any
-        word in the text and reports wordz that aren't found in the
-        dyctionari.</p>
-
-      <p>The document that yu are reading now <b>intentionaly</b> containes
-        some errorz, so that you have something to corect ;-)</p>
-
-      <p>Credits for the <tt>SpellChecker</tt> plugin go to:</p>
-
-      <ul>
-
-        <li><a href="http://aspell.net">Aspell</a> -- spell
-          checker</li>
-
-        <li>The <a href="http://perl.org">Perl</a> programming language</li>
-
-        <li><tt><a
-              href="http://cpan.org/modules/by-module/Text/Text-Aspell-0.02.readme">Text::Aspell</a></tt>
-          -- Perl interface to Aspell</li>
-
-        <li><a href="http://americanbible.org">American Bible Society</a> --
-          for sponsoring the <tt>SpellChecker</tt> plugin for
-          <tt>HTMLArea</tt></li>
-
-        <li><a href="http://dynarch.com/mishoo/">Your humble servant</a> for
-          implementing it ;-)</li>
-
-      </ul>
-
-</textarea>
-
-<p />
-
-<input type="submit" name="ok" value="  submit  " />
-<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
-<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
-
-<a href="javascript:mySubmit()">submit</a>
-
-<script type="text/javascript">
-function mySubmit() {
-// document.edit.save.value = "yes";
-document.edit.onsubmit(); // workaround browser bugs.
-document.edit.submit();
-};
-</script>
-
-</form>
-
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/table-operations.html 75/e107_handlers/htmlarea/examples/table-operations.html
--- 6171/e107_handlers/htmlarea/examples/table-operations.html	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/table-operations.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,116 +0,0 @@
-<html>
-<head>
-<title>Example of HTMLArea 3.0</title>
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
-<!-- Configure the path to the editor.  We make it relative now, so that the
-    example ZIP file will work anywhere, but please NOTE THAT it's better to
-    have it an absolute path, such as '/htmlarea/'. -->
-<script type="text/javascript">
-  _editor_lang = "en";
-  _editor_url = "../";
-</script>
-<!-- load the main HTMLArea files -->
-<script type="text/javascript" src="../htmlarea.js"></script>
-
-<style type="text/css">
-html, body {
-  font-family: Verdana,sans-serif;
-  background-color: #fea;
-  color: #000;
-}
-a:link, a:visited { color: #00f; }
-a:hover { color: #048; }
-a:active { color: #f00; }
-
-textarea { background-color: #fff; border: 1px solid 00f; }
-</style>
-
-<script type="text/javascript">
-// load the plugin files
-HTMLArea.loadPlugin("TableOperations");
-
-var editor = null;
-function initEditor() {
-  // create an editor for the "ta" textbox
-  editor = new HTMLArea("ta");
-
-  // register the TableOperations plugin with our editor
-  editor.registerPlugin(TableOperations);
-
-  editor.generate();
-  return false;
-}
-
-function insertHTML() {
-  var html = prompt("Enter some HTML code here");
-  if (html) {
-    editor.insertHTML(html);
-  }
-}
-function highlight() {
-  editor.surroundHTML('<span style="background-color: yellow">', '</span>');
-}
-</script>
-
-</head>
-
-<!-- use <body onload="HTMLArea.replaceAll()" if you don't care about
-     customizing the editor.  It's the easiest way! :) -->
-<body onload="initEditor()">
-
-<h1>HTMLArea 3.0</h1>
-
-<p>A replacement for <code>TEXTAREA</code> elements.  &copy; <a
-href="http://interactivetools.com">InteractiveTools.com</a>, 2003-2004.</p>
-
-<p>Page that demonstrates the additional features of the
-<tt>TableOperations</tt> plugin (sponsored by <a
-href="http://www.bloki.com">Zapatec Inc.</a>).</p>
-
-<form action="test.cgi" method="post" id="edit" name="edit">
-
-<textarea id="ta" name="ta" style="width:100%" rows="24" cols="80">
-
-<h1>Plugin: <tt>TableOperations</tt></h1>
-
-<p>This page exemplifies the table operations toolbar, provided by the
-TableOperations plugin.</p>
-
-<p>Following there is a table.</p>
-
-<table border="1" style="border: 2px solid rgb(255, 0, 0); width: 80%; background-image: none; border-collapse: collapse; color: rgb(153, 102, 0); background-color: rgb(255, 255, 51);" align="center" cellspacing="2" cellpadding="1" summary="">
-  <caption>This <span style="font-weight: bold;">is</span> a table</caption>
-  <tbody>
-  <tr style="border-style: none; background-image: none; background-color: rgb(255, 255, 153);" char="." align="left" valign="middle"> <td>1.1</td> <td>1.2</td> <td>1.3</td> <td>1.4</td> </tr>
-  <tr> <td>2.1</td> <td style="border: 1px solid rgb(51, 51, 255); background-image: none; background-color: rgb(102, 255, 255); color: rgb(0, 0, 51);" char="." align="left" valign="middle">2.2</td> <td>2.3</td> <td>2.4</td> </tr>
-  <tr> <td>3.1</td> <td>3.2</td> <td style="border: 2px dashed rgb(51, 204, 102); background-image: none; background-color: rgb(102, 255, 153); color: rgb(0, 51, 0);" char="." align="left" valign="middle">3.3</td> <td>3.4</td> </tr>
-  <tr> <td style="background-color: rgb(255, 204, 51);">4.1</td> <td style="background-color: rgb(255, 204, 51);">4.2</td> <td style="background-color: rgb(255, 204, 51);">4.3</td> <td style="background-color: rgb(255, 204, 51);">4.4</td> </tr>
-  </tbody>
-</table>
-
-<p>Text after the table</p>
-
-</textarea>
-
-<p />
-
-<input type="submit" name="ok" value="  submit  " />
-<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
-<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
-
-<a href="javascript:mySubmit()">submit</a>
-
-<script type="text/javascript">
-function mySubmit() {
-// document.edit.save.value = "yes";
-document.edit.onsubmit(); // workaround browser bugs.
-document.edit.submit();
-};
-</script>
-
-</form>
-
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/examples/test.cgi 75/e107_handlers/htmlarea/examples/test.cgi
--- 6171/e107_handlers/htmlarea/examples/test.cgi	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/examples/test.cgi	1969-12-31 18:00:00.000000000 -0600
@@ -1,21 +0,0 @@
-#! /usr/bin/perl -w
-#
-#
-#
-
-
-
-use CGI;
-
-print "Content-type: text/html\n\n";
-$c = new CGI;
-$ta = $c->param('ta');
-
-print <<EOF;
-<html>
-<body>
-<textarea style="width: 100%; height: 200px">$ta</textarea>
-$ta
-</body>
-</html>
-EOF
diff -ruN 6171/e107_handlers/htmlarea/htmlarea.css 75/e107_handlers/htmlarea/htmlarea.css
--- 6171/e107_handlers/htmlarea/htmlarea.css	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/htmlarea.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,180 +0,0 @@
-.htmlarea { background: #fff; }
-
-.htmlarea .toolbar {
-  cursor: default;
-  background: ButtonFace;
-  padding: 3px;
-  border: 1px solid;
-  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-.htmlarea .toolbar table { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
-.htmlarea .toolbar img { border: none; }
-.htmlarea .toolbar .label { padding: 0px 3px; }
-
-.htmlarea .toolbar .button {
-  background: ButtonFace;
-  color: ButtonText;
-  border: 1px solid ButtonFace;
-  padding: 1px;
-  margin: 0px;
-  width: 18px;
-  height: 18px;
-}
-.htmlarea .toolbar .buttonHover {
-  border: 1px solid;
-  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-.htmlarea .toolbar .buttonActive, .htmlarea .toolbar .buttonPressed {
-  padding: 2px 0px 0px 2px;
-  border: 1px solid;
-  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
-}
-.htmlarea .toolbar .buttonPressed {
-  background: ButtonHighlight;
-}
-.htmlarea .toolbar .indicator {
-  padding: 0px 3px;
-  overflow: hidden;
-  width: 20px;
-  text-align: center;
-  cursor: default;
-  border: 1px solid ButtonShadow;
-}
-
-.htmlarea .toolbar .buttonDisabled img {
-  filter: gray() alpha(opacity = 25);
-  -moz-opacity: 0.25;
-}
-
-.htmlarea .toolbar .separator {
-  position: relative;
-  margin: 3px;
-  border-left: 1px solid ButtonShadow;
-  border-right: 1px solid ButtonHighlight;
-  width: 0px;
-  height: 16px;
-  padding: 0px;
-}
-
-.htmlarea .toolbar .space { width: 5px; }
-
-.htmlarea .toolbar select { font: 11px Tahoma,Verdana,sans-serif; }
-
-.htmlarea .toolbar select,
-.htmlarea .toolbar select:hover,
-.htmlarea .toolbar select:active { background: FieldFace; color: ButtonText; }
-
-.htmlarea .statusBar {
-  border: 1px solid;
-  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
-  padding: 2px 4px;
-  background-color: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-
-.htmlarea .statusBar .statusBarTree a {
-  padding: 2px 5px;
-  color: #00f;
-}
-
-.htmlarea .statusBar .statusBarTree a:visited { color: #00f; }
-.htmlarea .statusBar .statusBarTree a:hover {
-  background-color: Highlight;
-  color: HighlightText;
-  padding: 1px 4px;
-  border: 1px solid HighlightText;
-}
-
-
-/* Hidden DIV popup dialogs (PopupDiv) */
-
-.dialog {
-  color: ButtonText;
-  background: ButtonFace;
-}
-
-.dialog .content { padding: 2px; }
-
-.dialog, .dialog button, .dialog input, .dialog select, .dialog textarea, .dialog table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-
-.dialog table { border-collapse: collapse; }
-
-.dialog .title {
-  background: #008;
-  color: #ff8;
-  border-bottom: 1px solid #000;
-  padding: 1px 0px 2px 5px;
-  font-size: 12px;
-  font-weight: bold;
-  cursor: default;
-}
-
-.dialog .title .button {
-  float: right;
-  border: 1px solid #66a;
-  padding: 0px 1px 0px 2px;
-  margin-right: 1px;
-  color: #fff;
-  text-align: center;
-}
-
-.dialog .title .button-hilite { border-color: #88f; background: #44c; }
-
-.dialog button {
-  width: 5em;
-  padding: 0px;
-}
-
-.dialog .buttonColor {
-  padding: 1px;
-  cursor: default;
-  border: 1px solid;
-  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-
-.dialog .buttonColor-hilite {
-  border-color: #000;
-}
-
-.dialog .buttonColor .chooser, .dialog .buttonColor .nocolor {
-  height: 0.6em;
-  border: 1px solid;
-  padding: 0px 1em;
-  border-color: ButtonShadow ButtonHighlight ButtonHighlight ButtonShadow;
-}
-
-.dialog .buttonColor .nocolor { padding: 0px; }
-.dialog .buttonColor .nocolor-hilite { background-color: #fff; color: #f00; }
-
-.dialog .label { text-align: right; width: 6em; }
-.dialog .value input { width: 100%; }
-.dialog .buttons { text-align: right; padding: 2px 4px 0px 4px; }
-
-.dialog legend { font-weight: bold; }
-.dialog fieldset table { margin: 2px 0px; }
-
-.popupdiv {
-  border: 2px solid;
-  border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-}
-
-.popupwin {
-  padding: 0px;
-  margin: 0px;
-}
-
-.popupwin .title {
-  background: #fff;
-  color: #000;
-  font-weight: bold;
-  font-size: 120%;
-  padding: 3px 10px;
-  margin-bottom: 10px;
-  border-bottom: 1px solid black;
-  letter-spacing: 2px;
-}
-
-form { margin: 0px; border: none; }
diff -ruN 6171/e107_handlers/htmlarea/htmlarea.inc.php 75/e107_handlers/htmlarea/htmlarea.inc.php
--- 6171/e107_handlers/htmlarea/htmlarea.inc.php	2004-08-13 18:42:44.000000000 -0500
+++ 75/e107_handlers/htmlarea/htmlarea.inc.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,159 +0,0 @@
-<?php
-
-// HTMLAREA handler for e107.
-// $Id: htmlarea.inc.php,v 1.13 2004/08/13 23:42:43 e107coders Exp $
-
-// Settings ==========================================================
-    $width = "520px";  // htmlarea width
-    $height = "300px";  // htmlarea height
-    $fullscreen = 0;   // Show Full-Screen Editor button. 0=no 1=yes
-    $display_emoticons = 0; // Show Emoticons when enabled in e107 ?
-    $tableops = 1;  // Table operations Plugin.
-    $spelling = 0;  // Spell Checking Plugin.
-    $tidy = 0; // Html Tidy Plugin.
-    $context = 1; // Context Menu Plugin
-    $imgmanager = 1; // Use Image-Manager in ADMINS areas.
-    $charmap = 1; // Load Character Map
- // ========================================================================
-
-function htmlarea($ta_name){
-/*  usage:
-    $name should be the name of the <textarea> element you wish to replace with Htmlarea.
-    You should also add ID="fieldname" to your <textarea> tag.
-    eg. <textarea id='post' name='post' >
-
-    And at the beginning of your page (after require_once("class2.php");)
-    you would include:
-
-    require_once(e_HANDLER."htmlarea/htmlarea.inc.php");
-    $htmlarea_js = htmlarea("post");
-    or for multiple textareas:
-    $htmlarea_js = htmlarea("post,data,otherfield");
-*/
-
-  global $charmap,$display_emoticons,$tableops,$spelling,$plgcnt,$height,$width,$context, $tidy,$imagebut, $imgmanager;
-    $plgcnt =0; // do not change.
- //   $imagebut = (ADMIN) ? "insertimage" : "space"; // image button for  ADMINS only
-    $popupeditor = $fullscreen == 1 ? "popupeditor":"space";
-    $charmapon = $charmap ==1 ? "'insertcharacter',":"";
-
-// ==================================================
-
-
-$areajs = "\n\n<script type='text/javascript'>\n _editor_url = '".e_HANDLER."htmlarea/'; \n _editor_lang = 'en'; \n</script>\n";
-$areajs .= "<script type='text/javascript' src='".e_HANDLER."htmlarea/htmlarea.js'></script>\n";
-$areajs .= "<script type='text/javascript' >\n";
-$areajs .= ($context==1) ? "HTMLArea.loadPlugin('ContextMenu');\n":"";
-$areajs .= ($tableops==1) ? "HTMLArea.loadPlugin('TableOperations');\n":"";
-$areajs .= ($spelling==1) ? "HTMLArea.loadPlugin('SpellChecker');\n":"";
-$areajs .= ($imgmanager==1 && ADMIN) ? "HTMLArea.loadPlugin('ImageManager');\n":"";
-$areajs .= ($tidy==1) ? "HTMLArea.loadPlugin('HtmlTidy');\n":"";
-$areajs .= ($charmap==1) ? "HTMLArea.loadPlugin('CharacterMap');\n":"";
-$areajs .= "</script>\n\n";
-
-
-$areajs .= "\n<script type='text/javascript' >\n";
-$areajs .= "function initEditor() { \n";
-$name = explode(",",$ta_name);
-    for ($i=0; $i<count($name); $i++) {
-        $areajs .= "var editor_".$name[$i]." = new HTMLArea('".$name[$i]."');\n";
-        $areajs .= ($context==1) ? " editor_".$name[$i].".registerPlugin('ContextMenu');\n ":"";
-        $areajs .=  ($tableops==1) ? " editor_".$name[$i].".registerPlugin(TableOperations);\n ":"";
-        $areajs .= ($spelling==1) ? " editor_".$name[$i].".registerPlugin(SpellChecker);\n ":"";
-        $areajs .= ($tidy==1) ? " editor_".$name[$i].".registerPlugin(HtmlTidy);\n ":"";
-        $areajs .= ($imgmanager==1 && ADMIN) ? " editor_".$name[$i].".registerPlugin(ImageManager);\n ":"";
-        $areajs .= ($charmap==1) ? " editor_".$name[$i].".registerPlugin(CharacterMap);\n ":"";
-
-        $areajs .="editor_".$name[$i].".config.toolbar =  [
-                [ 'fontname', 'space',
-                  'fontsize', 'space',
-                  'formatblock', 'space',
-                  'bold', 'italic', 'underline', 'separator',
-                  'copy', 'cut', 'paste', 'space', 'undo', 'redo', 'space' ],
-
-                [ 'removeformat', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'separator',
-                  'lefttoright', 'righttoleft', 'separator',
-                  'orderedlist', 'unorderedlist', 'outdent', 'indent', 'separator',
-                  'forecolor', 'hilitecolor', 'separator',
-                  'inserthorizontalrule', 'createlink', 'insertimage', 'inserttable', ".$charmapon." 'separator', 'htmlmode',
-                  'popupeditor', 'separator', 'showhelp' ]";
-
-        $areajs .= $display_emoticons ? ",[".htmlarea_emote(2)."]":"";
-        $areajs .="]\n\n
-
-        editor_".$name[$i].".config.pageStyle =
-                'body { background-color: white; font-size: 12px; border:1px solid black; color: black; font-family: tahoma, verdana, arial, sans-serif; } ' +
-                'p { font-width: bold; } ';\n\n";
-
-        $areajs .= "editor_".$name[$i].".config.killWordOnPaste = true;\n";
-        $areajs .= ($height)?"editor_".$name[$i].".config.height = '".$height."';\n":"";
-        $areajs .= ($width)?"editor_".$name[$i].".config.width = '".$width."';\n":"";
-
-
-        $areajs .= "
-              var check = '".$name[$i]."';
-              if(document.getElementById(check)){
-
-              setTimeout(function() {
-            editor_".$name[$i].".generate();
-             }, 500); \n ";
-
-
-
-        $areajs .= "   }";
-
-}
-$areajs .="
- }
-
- HTMLArea.onload = initEditor;
- HTMLArea.init();
-
-</script>\n";
-
-return $areajs;
-}
-
-// Build Custom Emoticon Buttons=================
-
-function htmlarea_emote($mode){
-global $IMAGES_DIRECTORY, $pref,$display_emoticons;
-if($pref['smiley_activate'] && $display_emoticons==1){
-
-        $sql = new db;
-        $sql -> db_Select("core", "*", "e107_name='emote'");
-        $row = $sql -> db_Fetch(); extract($row);
-        $emote = unserialize($e107_value);
-
-        $c=0;
-        while(list($code, $name) = @each($emote[$c])){
-                if(!$orig[$name]){
-                $orig[$name] = TRUE;
-        if($mode == "1"){
-         //   $str .= "config.registerButton(\"$name\", \"$name\", \"../../".$IMAGES_DIRECTORY."emoticons/".$name."\", false,
-            $str .= "config.registerButton(\"$name\", \"$name\", \"".e_IMAGE."emoticons/".$name."\", false,
-
-
-            // function that gets called when the button is clicked
-            function(editor, id) {
-            editor.focusEditor();
-            editor.insertHTML('<img src=\"".e_IMAGE."emoticons/$name\" style=\"border:0\" alt=\"\" />');
-                        } );";
-        }
-
-        if($mode == "2"){
-            $str .= "'$name' ,";
-        }
-
-    }
-                $c++;
-    }
-
-
-        return $str;
-        }else{
-        return "";
-        }
-}
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/htmlarea.js 75/e107_handlers/htmlarea/htmlarea.js
--- 6171/e107_handlers/htmlarea/htmlarea.js	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/htmlarea.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,2397 +0,0 @@
-// htmlArea v3.0 - Copyright (c) 2002-2004 interactivetools.com, inc.
-// This copyright notice MUST stay intact for use (see license.txt).
-//
-// Portions (c) dynarch.com, 2003-2004
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon.
-//   http://dynarch.com/mishoo
-//
-// $Id: htmlarea.js,v 1.9 2004/08/11 09:26:35 e107coders Exp $
-
-if (typeof _editor_url == "string") {
-        // Leave exactly one backslash at the end of _editor_url
-        _editor_url = _editor_url.replace(/\x2f*$/, '/');
-} else {
-        alert("WARNING: _editor_url is not set!  You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea/', but it can be relative if you prefer.  Further we will try to load the editor files correctly but we'll probably fail.");
-        _editor_url = '';
-}
-
-// make sure we have a language
-if (typeof _editor_lang == "string") {
-        _editor_lang = _editor_lang.toLowerCase();
-} else {
-        _editor_lang = "en";
-}
-
-// browser identification
-HTMLArea.agt = navigator.userAgent.toLowerCase();
-HTMLArea.is_ie           = ((HTMLArea.agt.indexOf("msie") != -1) && (HTMLArea.agt.indexOf("opera") == -1));
-HTMLArea.is_opera  = (HTMLArea.agt.indexOf("opera") != -1);
-HTMLArea.is_mac           = (HTMLArea.agt.indexOf("mac") != -1);
-HTMLArea.is_mac_ie = (HTMLArea.is_ie && HTMLArea.is_mac);
-HTMLArea.is_win_ie = (HTMLArea.is_ie && !HTMLArea.is_mac);
-HTMLArea.is_gecko  = (navigator.product == "Gecko");
-
-// Creates a new HTMLArea object.  Tries to replace the textarea with the given
-// ID with it.
-function HTMLArea(textarea, config) {
-        if (HTMLArea.checkSupportedBrowser()) {
-                if (typeof config == "undefined") {
-                        this.config = new HTMLArea.Config();
-                } else {
-                        this.config = config;
-                }
-                this._htmlArea = null;
-                this._textArea = textarea;
-                this._editMode = "wysiwyg";
-                this.plugins = {};
-                this._timerToolbar = null;
-                this._timerUndo = null;
-                this._undoQueue = new Array(this.config.undoSteps);
-                this._undoPos = -1;
-                this._customUndo = false;
-                this._mdoc = document; // cache the document, we need it in plugins
-                this.doctype = '';
-        }
-};
-
-HTMLArea.onload = function(){};
-HTMLArea._scripts = [];
-HTMLArea._loadScript = function(url) { this._scripts.push(url); };
-
-HTMLArea.init = function() {
-        var head = document.getElementsByTagName("head")[0];
-        var current = 0;
-        var savetitle = document.title;
-        var evt = HTMLArea.is_ie ? "onreadystatechange" : "onload";
-        function loadNextScript() {
-                if (current > 0 && HTMLArea.is_ie &&
-                    !/loaded|complete/.test(window.event.srcElement.readyState))
-                        return;
-                if (current < HTMLArea._scripts.length) {
-                        var url = HTMLArea._scripts[current++];
-                        document.title = "[HTMLArea: loading script " + current + "/" + HTMLArea._scripts.length + "]";
-                        var script = document.createElement("script");
-                        script.type = "text/javascript";
-                        script.src = url;
-                        script[evt] = loadNextScript;
-                        head.appendChild(script);
-                } else {
-                        document.title = savetitle;
-                        HTMLArea.onload();
-                }
-        };
-        loadNextScript();
-};
-
-HTMLArea._loadScript(_editor_url + "dialog.js");
-HTMLArea._loadScript(_editor_url + "popupwin.js");
-HTMLArea._loadScript(_editor_url + "lang/" + _editor_lang + ".js");
-
-// cache some regexps
-HTMLArea.RE_tagName = /(<\/|<)\s*([^ \t\n>]+)/ig;
-HTMLArea.RE_doctype = /(<!doctype((.|\n)*?)>)\n?/i;
-HTMLArea.RE_head    = /<head>((.|\n)*?)<\/head>/i;
-HTMLArea.RE_body    = /<body>((.|\n)*?)<\/body>/i;
-
-HTMLArea.Config = function () {
-        this.version = "3.0";
-
-        this.width = "auto";
-        this.height = "auto";
-
-        // enable creation of a status bar?
-        this.statusBar = true;
-
-        // intercept ^V and use the HTMLArea paste command
-        // If false, then passes ^V through to browser editor widget
-        this.htmlareaPaste = false;
-
-        // maximum size of the undo queue
-        this.undoSteps = 20;
-
-        // the time interval at which undo samples are taken
-        this.undoTimeout = 500;        // 1/2 sec.
-
-        // the next parameter specifies whether the toolbar should be included
-        // in the size or not.
-        this.sizeIncludesToolbar = true;
-
-        // if true then HTMLArea will retrieve the full HTML, starting with the
-        // <HTML> tag.
-        this.fullPage = false;
-
-        // style included in the iframe document
-        this.pageStyle = "";
-
-        // set to true if you want Word code to be cleaned upon Paste
-        this.killWordOnPaste = false;
-
-        // enable the 'Target' field in the Make Link dialog
-        this.makeLinkShowsTarget = true;
-
-        // BaseURL included in the iframe document
-        this.baseURL = document.baseURI || document.URL;
-        if (this.baseURL && this.baseURL.match(/(.*)\/([^\/]+)/))
-                this.baseURL = RegExp.$1 + "/";
-
-        // URL-s
-        this.imgURL = "images/";
-        this.popupURL = "popups/";
-
-        // remove tags (these have to be a regexp, or null if this functionality is not desired)
-        this.htmlRemoveTags = null;
-
-        /** CUSTOMIZING THE TOOLBAR
-         * -------------------------
-         *
-         * It is recommended that you customize the toolbar contents in an
-         * external file (i.e. the one calling HTMLArea) and leave this one
-         * unchanged.  That's because when we (InteractiveTools.com) release a
-         * new official version, it's less likely that you will have problems
-         * upgrading HTMLArea.
-         */
-        this.toolbar = [
-                [ "fontname", "space",
-                  "fontsize", "space",
-                  "formatblock", "space",
-                  "bold", "italic", "underline", "strikethrough", "separator",
-                  "subscript", "superscript", "separator",
-                  "copy", "cut", "paste", "space", "undo", "redo", "space", "removeformat" ],
-
-                [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
-                  "lefttoright", "righttoleft", "separator",
-                  "orderedlist", "unorderedlist", "outdent", "indent", "separator",
-                  "forecolor", "hilitecolor", "separator",
-                  "inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
-                  "popupeditor", "separator", "showhelp", "about" ]
-        ];
-
-        this.fontname = {
-                "&mdash; font &mdash;":         '',
-                "Arial":           'arial,helvetica,sans-serif',
-                "Courier New":           'courier new,courier,monospace',
-                "Georgia":           'georgia,times new roman,times,serif',
-                "Tahoma":           'tahoma,arial,helvetica,sans-serif',
-                "Times New Roman": 'times new roman,times,serif',
-                "Verdana":           'verdana,arial,helvetica,sans-serif',
-                "impact":           'impact',
-                "WingDings":           'wingdings'
-        };
-
-        this.fontsize = {
-                "&mdash; size &mdash;"  : "",
-                "1 (8 pt)" : "1",
-                "2 (10 pt)": "2",
-                "3 (12 pt)": "3",
-                "4 (14 pt)": "4",
-                "5 (18 pt)": "5",
-                "6 (24 pt)": "6",
-                "7 (36 pt)": "7"
-        };
-
-        this.formatblock = {
-                "&mdash; format &mdash;"  : "",
-                "Heading 1": "h1",
-                "Heading 2": "h2",
-                "Heading 3": "h3",
-                "Heading 4": "h4",
-                "Heading 5": "h5",
-                "Heading 6": "h6",
-                "Normal"   : "p",
-                "Address"  : "address",
-                "Formatted": "pre"
-        };
-
-        this.customSelects = {};
-
-        function cut_copy_paste(e, cmd, obj) {
-                e.execCommand(cmd);
-        };
-
-        this.debug = true;
-
-        // ADDING CUSTOM BUTTONS: please read below!
-        // format of the btnList elements is "ID: [ ToolTip, Icon, Enabled in text mode?, ACTION ]"
-        //    - ID: unique ID for the button.  If the button calls document.execCommand
-        //            it's wise to give it the same name as the called command.
-        //    - ACTION: function that gets called when the button is clicked.
-        //              it has the following prototype:
-        //                 function(editor, buttonName)
-        //              - editor is the HTMLArea object that triggered the call
-        //              - buttonName is the ID of the clicked button
-        //              These 2 parameters makes it possible for you to use the same
-        //              handler for more HTMLArea objects or for more different buttons.
-        //    - ToolTip: default tooltip, for cases when it is not defined in the -lang- file (HTMLArea.I18N)
-        //    - Icon: path to an icon image file for the button (TODO: use one image for all buttons!)
-        //    - Enabled in text mode: if false the button gets disabled for text-only mode; otherwise enabled all the time.
-        this.btnList = {
-                bold: [ "Bold", "ed_format_bold.gif", false, function(e) {e.execCommand("bold");} ],
-                italic: [ "Italic", "ed_format_italic.gif", false, function(e) {e.execCommand("italic");} ],
-                underline: [ "Underline", "ed_format_underline.gif", false, function(e) {e.execCommand("underline");} ],
-                strikethrough: [ "Strikethrough", "ed_format_strike.gif", false, function(e) {e.execCommand("strikethrough");} ],
-                subscript: [ "Subscript", "ed_format_sub.gif", false, function(e) {e.execCommand("subscript");} ],
-                superscript: [ "Superscript", "ed_format_sup.gif", false, function(e) {e.execCommand("superscript");} ],
-                justifyleft: [ "Justify Left", "ed_align_left.gif", false, function(e) {e.execCommand("justifyleft");} ],
-                justifycenter: [ "Justify Center", "ed_align_center.gif", false, function(e) {e.execCommand("justifycenter");} ],
-                justifyright: [ "Justify Right", "ed_align_right.gif", false, function(e) {e.execCommand("justifyright");} ],
-                justifyfull: [ "Justify Full", "ed_align_justify.gif", false, function(e) {e.execCommand("justifyfull");} ],
-                orderedlist: [ "Ordered List", "ed_list_num.gif", false, function(e) {e.execCommand("insertorderedlist");} ],
-                unorderedlist: [ "Bulleted List", "ed_list_bullet.gif", false, function(e) {e.execCommand("insertunorderedlist");} ],
-                outdent: [ "Decrease Indent", "ed_indent_less.gif", false, function(e) {e.execCommand("outdent");} ],
-                indent: [ "Increase Indent", "ed_indent_more.gif", false, function(e) {e.execCommand("indent");} ],
-                forecolor: [ "Font Color", "ed_color_fg.gif", false, function(e) {e.execCommand("forecolor");} ],
-                hilitecolor: [ "Background Color", "ed_color_bg.gif", false, function(e) {e.execCommand("hilitecolor");} ],
-                inserthorizontalrule: [ "Horizontal Rule", "ed_hr.gif", false, function(e) {e.execCommand("inserthorizontalrule");} ],
-                createlink: [ "Insert Web Link", "ed_link.gif", false, function(e) {e.execCommand("createlink", true);} ],
-                insertimage: [ "Insert/Modify Image", "ed_image.gif", false, function(e) {e.execCommand("insertimage");} ],
-                inserttable: [ "Insert Table", "insert_table.gif", false, function(e) {e.execCommand("inserttable");} ],
-                htmlmode: [ "Toggle HTML Source", "ed_html.gif", true, function(e) {e.execCommand("htmlmode");} ],
-                popupeditor: [ "Enlarge Editor", "fullscreen_maximize.gif", true, function(e) {e.execCommand("popupeditor");} ],
-                about: [ "About this editor", "ed_about.gif", true, function(e) {e.execCommand("about");} ],
-                showhelp: [ "Help using editor", "ed_help.gif", true, function(e) {e.execCommand("showhelp");} ],
-                undo: [ "Undoes your last action", "ed_undo.gif", false, function(e) {e.execCommand("undo");} ],
-                redo: [ "Redoes your last action", "ed_redo.gif", false, function(e) {e.execCommand("redo");} ],
-                cut: [ "Cut selection", "ed_cut.gif", false, cut_copy_paste ],
-                copy: [ "Copy selection", "ed_copy.gif", false, cut_copy_paste ],
-                paste: [ "Paste from clipboard", "ed_paste.gif", false, cut_copy_paste ],
-                lefttoright: [ "Direction left to right", "ed_left_to_right.gif", false, function(e) {e.execCommand("lefttoright");} ],
-                righttoleft: [ "Direction right to left", "ed_right_to_left.gif", false, function(e) {e.execCommand("righttoleft");} ],
-                removeformat: [ "Remove formatting", "ed_rmformat.gif", false, function(e) {e.execCommand("removeformat");} ],
-                print: [ "Print document", "ed_print.gif", false, function(e) {e._iframe.contentWindow.print();} ]
-        };
-        /* ADDING CUSTOM BUTTONS
-         * ---------------------
-         *
-         * It is recommended that you add the custom buttons in an external
-         * file and leave this one unchanged.  That's because when we
-         * (InteractiveTools.com) release a new official version, it's less
-         * likely that you will have problems upgrading HTMLArea.
-         *
-         * Example on how to add a custom button when you construct the HTMLArea:
-         *
-         *   var editor = new HTMLArea("your_text_area_id");
-         *   var cfg = editor.config; // this is the default configuration
-         *   cfg.btnList["my-hilite"] =
-         *        [ function(editor) { editor.surroundHTML('<span style="background:yellow">', '</span>'); }, // action
-         *          "Highlight selection", // tooltip
-         *          "my_hilite.gif", // image
-         *          false // disabled in text mode
-         *        ];
-         *   cfg.toolbar.push(["linebreak", "my-hilite"]); // add the new button to the toolbar
-         *
-         * An alternate (also more convenient and recommended) way to
-         * accomplish this is to use the registerButton function below.
-         */
-        // initialize tooltips from the I18N module and generate correct image path
-        for (var i in this.btnList) {
-                var btn = this.btnList[i];
-                btn[1] = _editor_url + this.imgURL + btn[1];
-                if (typeof HTMLArea.I18N.tooltips[i] != "undefined") {
-                        btn[0] = HTMLArea.I18N.tooltips[i];
-                }
-        }
-};
-
-/** Helper function: register a new button with the configuration.  It can be
- * called with all 5 arguments, or with only one (first one).  When called with
- * only one argument it must be an object with the following properties: id,
- * tooltip, image, textMode, action.  Examples:
- *
- * 1. config.registerButton("my-hilite", "Hilite text", "my-hilite.gif", false, function(editor) {...});
- * 2. config.registerButton({
- *      id       : "my-hilite",      // the ID of your button
- *      tooltip  : "Hilite text",    // the tooltip
- *      image    : "my-hilite.gif",  // image to be displayed in the toolbar
- *      textMode : false,            // disabled in text mode
- *      action   : function(editor) { // called when the button is clicked
- *                   editor.surroundHTML('<span class="hilite">', '</span>');
- *                 },
- *      context  : "p"               // will be disabled if outside a <p> element
- *    });
- */
-HTMLArea.Config.prototype.registerButton = function(id, tooltip, image, textMode, action, context) {
-        var the_id;
-        if (typeof id == "string") {
-                the_id = id;
-        } else if (typeof id == "object") {
-                the_id = id.id;
-        } else {
-                alert("ERROR [HTMLArea.Config::registerButton]:\ninvalid arguments");
-                return false;
-        }
-        // check for existing id
-        if (typeof this.customSelects[the_id] != "undefined") {
-                // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
-        }
-        if (typeof this.btnList[the_id] != "undefined") {
-                // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
-        }
-        switch (typeof id) {
-            case "string": this.btnList[id] = [ tooltip, image, textMode, action, context ]; break;
-            case "object": this.btnList[id.id] = [ id.tooltip, id.image, id.textMode, id.action, id.context ]; break;
-        }
-};
-
-/** The following helper function registers a dropdown box with the editor
- * configuration.  You still have to add it to the toolbar, same as with the
- * buttons.  Call it like this:
- *
- * FIXME: add example
- */
-HTMLArea.Config.prototype.registerDropdown = function(object) {
-        // check for existing id
-        if (typeof this.customSelects[object.id] != "undefined") {
-                // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA dropdown with the same ID already exists.");
-        }
-        if (typeof this.btnList[object.id] != "undefined") {
-                // alert("WARNING [HTMLArea.Config::registerDropdown]:\nA button with the same ID already exists.");
-        }
-        this.customSelects[object.id] = object;
-};
-
-/** Call this function to remove some buttons/drop-down boxes from the toolbar.
- * Pass as the only parameter a string containing button/drop-down names
- * delimited by spaces.  Note that the string should also begin with a space
- * and end with a space.  Example:
- *
- *   config.hideSomeButtons(" fontname fontsize textindicator ");
- *
- * It's useful because it's easier to remove stuff from the defaul toolbar than
- * create a brand new toolbar ;-)
- */
-HTMLArea.Config.prototype.hideSomeButtons = function(remove) {
-        var toolbar = this.toolbar;
-        for (var i = toolbar.length; --i >= 0;) {
-                var line = toolbar[i];
-                for (var j = line.length; --j >= 0; ) {
-                        if (remove.indexOf(" " + line[j] + " ") >= 0) {
-                                var len = 1;
-                                if (/separator|space/.test(line[j + 1])) {
-                                        len = 2;
-                                }
-                                line.splice(j, len);
-                        }
-                }
-        }
-};
-
-/** Helper function: replace all TEXTAREA-s in the document with HTMLArea-s. */
-HTMLArea.replaceAll = function(config) {
-        var tas = document.getElementsByTagName("textarea");
-        for (var i = tas.length; i > 0; (new HTMLArea(tas[--i], config)).generate());
-};
-
-/** Helper function: replaces the TEXTAREA with the given ID with HTMLArea. */
-HTMLArea.replace = function(id, config) {
-        var ta = HTMLArea.getElementById("textarea", id);
-        return ta ? (new HTMLArea(ta, config)).generate() : null;
-};
-
-// Creates the toolbar and appends it to the _htmlarea
-HTMLArea.prototype._createToolbar = function () {
-        var editor = this;        // to access this in nested functions
-
-        var toolbar = document.createElement("div");
-        this._toolbar = toolbar;
-        toolbar.className = "toolbar";
-        toolbar.unselectable = "1";
-        var tb_row = null;
-        var tb_objects = new Object();
-        this._toolbarObjects = tb_objects;
-
-        // creates a new line in the toolbar
-        function newLine() {
-                var table = document.createElement("table");
-                table.border = "0px";
-                table.cellSpacing = "0px";
-                table.cellPadding = "0px";
-                toolbar.appendChild(table);
-                // TBODY is required for IE, otherwise you don't see anything
-                // in the TABLE.
-                var tb_body = document.createElement("tbody");
-                table.appendChild(tb_body);
-                tb_row = document.createElement("tr");
-                tb_body.appendChild(tb_row);
-        }; // END of function: newLine
-        // init first line
-        newLine();
-
-        // updates the state of a toolbar element.  This function is member of
-        // a toolbar element object (unnamed objects created by createButton or
-        // createSelect functions below).
-        function setButtonStatus(id, newval) {
-                var oldval = this[id];
-                var el = this.element;
-                if (oldval != newval) {
-                        switch (id) {
-                            case "enabled":
-                                if (newval) {
-                                        HTMLArea._removeClass(el, "buttonDisabled");
-                                        el.disabled = false;
-                                } else {
-                                        HTMLArea._addClass(el, "buttonDisabled");
-                                        el.disabled = true;
-                                }
-                                break;
-                            case "active":
-                                if (newval) {
-                                        HTMLArea._addClass(el, "buttonPressed");
-                                } else {
-                                        HTMLArea._removeClass(el, "buttonPressed");
-                                }
-                                break;
-                        }
-                        this[id] = newval;
-                }
-        }; // END of function: setButtonStatus
-
-        // this function will handle creation of combo boxes.  Receives as
-        // parameter the name of a button as defined in the toolBar config.
-        // This function is called from createButton, above, if the given "txt"
-        // doesn't match a button.
-        function createSelect(txt) {
-                var options = null;
-                var el = null;
-                var cmd = null;
-                var customSelects = editor.config.customSelects;
-                var context = null;
-                var tooltip = "";
-                switch (txt) {
-                    case "fontsize":
-                    case "fontname":
-                    case "formatblock":
-                        // the following line retrieves the correct
-                        // configuration option because the variable name
-                        // inside the Config object is named the same as the
-                        // button/select in the toolbar.  For instance, if txt
-                        // == "formatblock" we retrieve config.formatblock (or
-                        // a different way to write it in JS is
-                        // config["formatblock"].
-                        options = editor.config[txt];
-                        cmd = txt;
-                        break;
-                    default:
-                        // try to fetch it from the list of registered selects
-                        cmd = txt;
-                        var dropdown = customSelects[cmd];
-                        if (typeof dropdown != "undefined") {
-                                options = dropdown.options;
-                                context = dropdown.context;
-                                if (typeof dropdown.tooltip != "undefined") {
-                                        tooltip = dropdown.tooltip;
-                                }
-                        } else {
-                                alert("ERROR [createSelect]:\nCan't find the requested dropdown definition");
-                        }
-                        break;
-                }
-                if (options) {
-                        el = document.createElement("select");
-                        el.title = tooltip;
-                        var obj = {
-                                name        : txt, // field name
-                                element : el,        // the UI element (SELECT)
-                                enabled : true, // is it enabled?
-                                text        : false, // enabled in text mode?
-                                cmd        : cmd, // command ID
-                                state        : setButtonStatus, // for changing state
-                                context : context
-                        };
-                        tb_objects[txt] = obj;
-                        for (var i in options) {
-                                var op = document.createElement("option");
-                                op.innerHTML = i;
-                                op.value = options[i];
-                                el.appendChild(op);
-                        }
-                        HTMLArea._addEvent(el, "change", function () {
-                                editor._comboSelected(el, txt);
-                        });
-                }
-                return el;
-        }; // END of function: createSelect
-
-        // appends a new button to toolbar
-        function createButton(txt) {
-                // the element that will be created
-                var el = null;
-                var btn = null;
-                switch (txt) {
-                    case "separator":
-                        el = document.createElement("div");
-                        el.className = "separator";
-                        break;
-                    case "space":
-                        el = document.createElement("div");
-                        el.className = "space";
-                        break;
-                    case "linebreak":
-                        newLine();
-                        return false;
-                    case "textindicator":
-                        el = document.createElement("div");
-                        el.appendChild(document.createTextNode("A"));
-                        el.className = "indicator";
-                        el.title = HTMLArea.I18N.tooltips.textindicator;
-                        var obj = {
-                                name        : txt, // the button name (i.e. 'bold')
-                                element : el, // the UI element (DIV)
-                                enabled : true, // is it enabled?
-                                active        : false, // is it pressed?
-                                text        : false, // enabled in text mode?
-                                cmd        : "textindicator", // the command ID
-                                state        : setButtonStatus // for changing state
-                        };
-                        tb_objects[txt] = obj;
-                        break;
-                    default:
-                        btn = editor.config.btnList[txt];
-                }
-                if (!el && btn) {
-                        el = document.createElement("div");
-                        el.title = btn[0];
-                        el.className = "button";
-                        // let's just pretend we have a button object, and
-                        // assign all the needed information to it.
-                        var obj = {
-                                name        : txt, // the button name (i.e. 'bold')
-                                element : el, // the UI element (DIV)
-                                enabled : true, // is it enabled?
-                                active        : false, // is it pressed?
-                                text        : btn[2], // enabled in text mode?
-                                cmd        : btn[3], // the command ID
-                                state        : setButtonStatus, // for changing state
-                                context : btn[4] || null // enabled in a certain context?
-                        };
-                        tb_objects[txt] = obj;
-                        // handlers to emulate nice flat toolbar buttons
-                        HTMLArea._addEvent(el, "mouseover", function () {
-                                if (obj.enabled) {
-                                        HTMLArea._addClass(el, "buttonHover");
-                                }
-                        });
-                        HTMLArea._addEvent(el, "mouseout", function () {
-                                if (obj.enabled) with (HTMLArea) {
-                                        _removeClass(el, "buttonHover");
-                                        _removeClass(el, "buttonActive");
-                                        (obj.active) && _addClass(el, "buttonPressed");
-                                }
-                        });
-                        HTMLArea._addEvent(el, "mousedown", function (ev) {
-                                if (obj.enabled) with (HTMLArea) {
-                                        _addClass(el, "buttonActive");
-                                        _removeClass(el, "buttonPressed");
-                                        _stopEvent(is_ie ? window.event : ev);
-                                }
-                        });
-                        // when clicked, do the following:
-                        HTMLArea._addEvent(el, "click", function (ev) {
-                                if (obj.enabled) with (HTMLArea) {
-                                        _removeClass(el, "buttonActive");
-                                        _removeClass(el, "buttonHover");
-                                        obj.cmd(editor, obj.name, obj);
-                                        _stopEvent(is_ie ? window.event : ev);
-                                }
-                        });
-                        var img = document.createElement("img");
-                        img.src = btn[1];
-                        img.style.width = "18px";
-                        img.style.height = "18px";
-                        el.appendChild(img);
-                } else if (!el) {
-                        el = createSelect(txt);
-                }
-                if (el) {
-                        var tb_cell = document.createElement("td");
-                        tb_row.appendChild(tb_cell);
-                        tb_cell.appendChild(el);
-                } else {
-                        alert("FIXME: Unknown toolbar item: " + txt);
-                }
-                return el;
-        };
-
-        var first = true;
-        for (var i = 0; i < this.config.toolbar.length; ++i) {
-                if (!first) {
-                        createButton("linebreak");
-                } else {
-                        first = false;
-                }
-                var group = this.config.toolbar[i];
-                for (var j = 0; j < group.length; ++j) {
-                        var code = group[j];
-                        if (/^([IT])\[(.*?)\]/.test(code)) {
-                                // special case, create text label
-                                var l7ed = RegExp.$1 == "I"; // localized?
-                                var label = RegExp.$2;
-                                if (l7ed) {
-                                        label = HTMLArea.I18N.custom[label];
-                                }
-                                var tb_cell = document.createElement("td");
-                                tb_row.appendChild(tb_cell);
-                                tb_cell.className = "label";
-                                tb_cell.innerHTML = label;
-                        } else {
-                                createButton(code);
-                        }
-                }
-        }
-
-        this._htmlArea.appendChild(toolbar);
-};
-
-HTMLArea.prototype._createStatusBar = function() {
-        var statusbar = document.createElement("div");
-        statusbar.className = "statusBar";
-        this._htmlArea.appendChild(statusbar);
-        this._statusBar = statusbar;
-        // statusbar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
-        // creates a holder for the path view
-        div = document.createElement("span");
-        div.className = "statusBarTree";
-        div.innerHTML = HTMLArea.I18N.msg["Path"] + ": ";
-        this._statusBarTree = div;
-        this._statusBar.appendChild(div);
-        if (!this.config.statusBar) {
-                // disable it...
-                statusbar.style.display = "none";
-        }
-};
-
-// Creates the HTMLArea object and replaces the textarea with it.
-HTMLArea.prototype.generate = function () {
-        var editor = this;        // we'll need "this" in some nested functions
-        // get the textarea
-        var textarea = this._textArea;
-        if (typeof textarea == "string") {
-                // it's not element but ID
-                this._textArea = textarea = HTMLArea.getElementById("textarea", textarea);
-        }
-        this._ta_size = {
-                w: textarea.offsetWidth,
-                h: textarea.offsetHeight
-        };
-        textarea.style.display = "none";
-
-        // create the editor framework
-        var htmlarea = document.createElement("div");
-        htmlarea.className = "htmlarea";
-        this._htmlArea = htmlarea;
-
-        // insert the editor before the textarea.
-        textarea.parentNode.insertBefore(htmlarea, textarea);
-
-        if (textarea.form) {
-                // we have a form, on submit get the HTMLArea content and
-                // update original textarea.
-                var f = textarea.form;
-                if (typeof f.onsubmit == "function") {
-                        var funcref = f.onsubmit;
-                        if (typeof f.__msh_prevOnSubmit == "undefined") {
-                                f.__msh_prevOnSubmit = [];
-                        }
-                        f.__msh_prevOnSubmit.push(funcref);
-                }
-                f.onsubmit = function() {
-                        editor._textArea.value = editor.getHTML();
-                        var a = this.__msh_prevOnSubmit;
-                        // call previous submit methods if they were there.
-                        if (typeof a != "undefined") {
-                                for (var i = a.length; --i >= 0;) {
-                                        a[i]();
-                                }
-                        }
-                };
-                if (typeof f.onreset == "function") {
-                        var funcref = f.onreset;
-                        if (typeof f.__msh_prevOnReset == "undefined") {
-                                f.__msh_prevOnReset = [];
-                        }
-                        f.__msh_prevOnReset.push(funcref);
-                }
-                f.onreset = function() {
-                        editor.setHTML(editor._textArea.value);
-                        editor.updateToolbar();
-                        var a = this.__msh_prevOnReset;
-                        // call previous reset methods if they were there.
-                        if (typeof a != "undefined") {
-                                for (var i = a.length; --i >= 0;) {
-                                        a[i]();
-                                }
-                        }
-                };
-        }
-
-        // add a handler for the "back/forward" case -- on body.unload we save
-        // the HTML content into the original textarea.
-        try {
-                window.onunload = function() {
-                        editor._textArea.value = editor.getHTML();
-                };
-        } catch(e) {};
-
-        // creates & appends the toolbar
-        this._createToolbar();
-
-        // create the IFRAME
-        var iframe = document.createElement("iframe");
-
-        // workaround for the HTTPS problem
-        // iframe.setAttribute("src", "javascript:void(0);");
-        iframe.src = _editor_url + "popups/blank.html";
-
-        htmlarea.appendChild(iframe);
-
-        this._iframe = iframe;
-
-        // creates & appends the status bar, if the case
-        this._createStatusBar();
-
-        // remove the default border as it keeps us from computing correctly
-        // the sizes.  (somebody tell me why doesn't this work in IE)
-
-        if (!HTMLArea.is_ie) {
-                iframe.style.borderWidth = "1px";
-        // iframe.frameBorder = "1";
-        // iframe.marginHeight = "0";
-        // iframe.marginWidth = "0";
-        }
-
-        // size the IFRAME according to user's prefs or initial textarea
-        var height = (this.config.height == "auto" ? (this._ta_size.h + "px") : this.config.height);
-        height = parseInt(height);
-        var width = (this.config.width == "auto" ? (this._ta_size.w + "px") : this.config.width);
-        width = parseInt(width);
-
-        if (!HTMLArea.is_ie) {
-                height -= 2;
-                width -= 2;
-        }
-
-        iframe.style.width = width + "px";
-        if (this.config.sizeIncludesToolbar) {
-                // substract toolbar height
-                height -= this._toolbar.offsetHeight;
-                height -= this._statusBar.offsetHeight;
-        }
-        if (height < 0) {
-                height = 0;
-        }
-        iframe.style.height = height + "px";
-
-        // the editor including the toolbar now have the same size as the
-        // original textarea.. which means that we need to reduce that a bit.
-        textarea.style.width = iframe.style.width;
-         textarea.style.height = iframe.style.height;
-
-        // IMPORTANT: we have to allow Mozilla a short time to recognize the
-        // new frame.  Otherwise we get a stupid exception.
-        function initIframe() {
-                var doc = editor._iframe.contentWindow.document;
-                if (!doc) {
-                        // Try again..
-                        // FIXME: don't know what else to do here.  Normally
-                        // we'll never reach this point.
-                        if (HTMLArea.is_gecko) {
-                                setTimeout(initIframe, 100);
-                                return false;
-                        } else {
-                                alert("ERROR: IFRAME can't be initialized.");
-                        }
-                }
-                if (HTMLArea.is_gecko) {
-                        // enable editable mode for Mozilla
-                        doc.designMode = "on";
-                }
-                editor._doc = doc;
-                if (!editor.config.fullPage) {
-                        doc.open();
-                        var html = "<html>\n";
-                        html += "<head>\n";
-                        if (editor.config.baseURL)
-                                html += '<base href="' + editor.config.baseURL + '" />';
-                        html += "<style>" + editor.config.pageStyle +
-                                " html,body { border: 0px; }</style>\n";
-                        html += "</head>\n";
-                        html += "<body>\n";
-                        html += editor._textArea.value;
-                        html += "</body>\n";
-                        html += "</html>";
-                        doc.write(html);
-                        doc.close();
-                } else {
-                        var html = editor._textArea.value;
-                        if (html.match(HTMLArea.RE_doctype)) {
-                                editor.setDoctype(RegExp.$1);
-                                html = html.replace(HTMLArea.RE_doctype, "");
-                        }
-                        doc.open();
-                        doc.write(html);
-                        doc.close();
-                }
-
-                if (HTMLArea.is_ie) {
-                        // enable editable mode for IE.         For some reason this
-                        // doesn't work if done in the same place as for Gecko
-                        // (above).
-                        doc.body.contentEditable = true;
-                }
-
-                editor.focusEditor();
-                // intercept some events; for updating the toolbar & keyboard handlers
-                HTMLArea._addEvents
-                        (doc, ["keydown", "keypress", "mousedown", "mouseup", "drag"],
-                         function (event) {
-                                 return editor._editorEvent(HTMLArea.is_ie ? editor._iframe.contentWindow.event : event);
-                         });
-
-                // check if any plugins have registered refresh handlers
-                for (var i in editor.plugins) {
-                        var plugin = editor.plugins[i].instance;
-                        if (typeof plugin.onGenerate == "function")
-                                plugin.onGenerate();
-                        if (typeof plugin.onGenerateOnce == "function") {
-                                plugin.onGenerateOnce();
-                                plugin.onGenerateOnce = null;
-                        }
-                }
-
-                setTimeout(function() {
-                        editor.updateToolbar();
-                }, 250);
-
-                if (typeof editor.onGenerate == "function")
-                        editor.onGenerate();
-        };
-        setTimeout(initIframe, 100);
-};
-
-// Switches editor mode; parameter can be "textmode" or "wysiwyg".  If no
-// parameter was passed this function toggles between modes.
-HTMLArea.prototype.setMode = function(mode) {
-        if (typeof mode == "undefined") {
-                mode = ((this._editMode == "textmode") ? "wysiwyg" : "textmode");
-        }
-        switch (mode) {
-            case "textmode":
-                this._textArea.value = this.getHTML();
-                this._iframe.style.display = "none";
-                this._textArea.style.display = "block";
-                if (this.config.statusBar) {
-                        this._statusBar.innerHTML = HTMLArea.I18N.msg["TEXT_MODE"];
-                }
-                break;
-            case "wysiwyg":
-                if (HTMLArea.is_gecko) {
-                        // disable design mode before changing innerHTML
-                        try {
-                                this._doc.designMode = "off";
-                        } catch(e) {};
-                }
-                if (!this.config.fullPage)
-                        this._doc.body.innerHTML = this.getHTML();
-                else
-                        this.setFullHTML(this.getHTML());
-                this._iframe.style.display = "block";
-                this._textArea.style.display = "none";
-                if (HTMLArea.is_gecko) {
-                        // we need to refresh that info for Moz-1.3a
-                        try {
-                                this._doc.designMode = "on";
-                        } catch(e) {};
-                }
-                if (this.config.statusBar) {
-                        this._statusBar.innerHTML = '';
-                        this._statusBar.appendChild(document.createTextNode(HTMLArea.I18N.msg["Path"] + ": "));
-                        this._statusBar.appendChild(this._statusBarTree);
-                }
-                break;
-            default:
-                alert("Mode <" + mode + "> not defined!");
-                return false;
-        }
-        this._editMode = mode;
-        this.focusEditor();
-
-        for (var i in this.plugins) {
-                var plugin = this.plugins[i].instance;
-                if (typeof plugin.onMode == "function") plugin.onMode(mode);
-        }
-};
-
-HTMLArea.prototype.setFullHTML = function(html) {
-        var save_multiline = RegExp.multiline;
-        RegExp.multiline = true;
-        if (html.match(HTMLArea.RE_doctype)) {
-                this.setDoctype(RegExp.$1);
-                html = html.replace(HTMLArea.RE_doctype, "");
-        }
-        RegExp.multiline = save_multiline;
-        if (!HTMLArea.is_ie) {
-                if (html.match(HTMLArea.RE_head))
-                        this._doc.getElementsByTagName("head")[0].innerHTML = RegExp.$1;
-                if (html.match(HTMLArea.RE_body))
-                        this._doc.getElementsByTagName("body")[0].innerHTML = RegExp.$1;
-        } else {
-                var html_re = /<html>((.|\n)*?)<\/html>/i;
-                html = html.replace(html_re, "$1");
-                this._doc.open();
-                this._doc.write(html);
-                this._doc.close();
-                this._doc.body.contentEditable = true;
-                return true;
-        }
-};
-
-/***************************************************
- *  Category: PLUGINS
- ***************************************************/
-
-// Create the specified plugin and register it with this HTMLArea
-HTMLArea.prototype.registerPlugin = function() {
-        var plugin = arguments[0];
-        var args = [];
-        for (var i = 1; i < arguments.length; ++i)
-                args.push(arguments[i]);
-        this.registerPlugin2(plugin, args);
-};
-
-// this is the variant of the function above where the plugin arguments are
-// already packed in an array.  Externally, it should be only used in the
-// full-screen editor code, in order to initialize plugins with the same
-// parameters as in the opener window.
-HTMLArea.prototype.registerPlugin2 = function(plugin, args) {
-        if (typeof plugin == "string")
-                plugin = eval(plugin);
-        if (typeof plugin == "undefined") {
-                /* FIXME: This should never happen. But why does it do? */
-                return false;
-        }
-        var obj = new plugin(this, args);
-        if (obj) {
-                var clone = {};
-                var info = plugin._pluginInfo;
-                for (var i in info)
-                        clone[i] = info[i];
-                clone.instance = obj;
-                clone.args = args;
-                this.plugins[plugin._pluginInfo.name] = clone;
-        } else
-                alert("Can't register plugin " + plugin.toString() + ".");
-};
-
-// static function that loads the required plugin and lang file, based on the
-// language loaded already for HTMLArea.  You better make sure that the plugin
-// _has_ that language, otherwise shit might happen ;-)
-HTMLArea.loadPlugin = function(pluginName) {
-        var dir = _editor_url + "plugins/" + pluginName;
-        var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
-                                        function (str, l1, l2, l3) {
-                                                return l1 + "-" + l2.toLowerCase() + l3;
-                                        }).toLowerCase() + ".js";
-        var plugin_file = dir + "/" + plugin;
-        var plugin_lang = dir + "/lang/" + _editor_lang + ".js";
-        //document.write("<script type='text/javascript' src='" + plugin_file + "'></script>");
-        //document.write("<script type='text/javascript' src='" + plugin_lang + "'></script>");
-        this._loadScript(plugin_file);
-        this._loadScript(plugin_lang);
-};
-
-HTMLArea.loadStyle = function(style, plugin) {
-        var url = _editor_url || '';
-        if (typeof plugin != "undefined") {
-                url += "plugins/" + plugin + "/";
-        }
-        url += style;
-        if (/^\//.test(style))
-                url = style;
-        var head = document.getElementsByTagName("head")[0];
-        var link = document.createElement("link");
-        link.rel = "stylesheet";
-        link.href = url;
-        head.appendChild(link);
-        //document.write("<style type='text/css'>@import url(" + url + ");</style>");
-};
-HTMLArea.loadStyle(typeof _editor_css == "string" ? _editor_css : "htmlarea.css");
-
-/***************************************************
- *  Category: EDITOR UTILITIES
- ***************************************************/
-
-// The following function is a slight variation of the word cleaner code posted
-// by Weeezl (user @ InteractiveTools forums).
-HTMLArea.prototype._wordClean = function() {
-        var D = this.getInnerHTML();
-        if ( (D.indexOf('class=Mso') >= 0) || (D.indexOf('class="Mso') >= 0) ) {
-
-                // make one line
-                D = D.replace(/\r\n/g, ' ').
-                        replace(/\n/g, ' ').
-                        replace(/\r/g, ' ').
-                        replace(/\&nbsp\;/g,' ');
-
-                // keep tags, strip attributes
-                D = D.replace(/ class=[^\s|>]*/gi,'').
-                        //replace(/<p [^>]*TEXT-ALIGN: justify[^>]*>/gi,'<p align="justify">').
-                        replace(/ style=\"[^>]*\"/gi,'').
-                        replace(/ align=[^\s|>]*/gi,'');
-
-                //clean up tags
-                D = D.replace(/<b [^>]*>/gi,'<b>').
-                        replace(/<i [^>]*>/gi,'<i>').
-                        replace(/<li [^>]*>/gi,'<li>').
-                        replace(/<ul [^>]*>/gi,'<ul>');
-
-                // replace outdated tags
-                D = D.replace(/<b>/gi,'<strong>').
-                        replace(/<\/b>/gi,'</strong>');
-
-                // mozilla doesn't like <em> tags
-                D = D.replace(/<em>/gi,'<i>').
-                        replace(/<\/em>/gi,'</i>');
-
-                // kill unwanted tags
-                D = D.replace(/<\?xml:[^>]*>/g, '').       // Word xml
-                        replace(/<\/?st1:[^>]*>/g,'').     // Word SmartTags
-                        replace(/<\/?[a-z]\:[^>]*>/g,'').  // All other funny Word non-HTML stuff
-                        replace(/<\/?font[^>]*>/gi,'').    // Disable if you want to keep font formatting
-                        replace(/<\/?span[^>]*>/gi,' ').
-                        replace(/<\/?div[^>]*>/gi,' ').
-                        replace(/<\/?pre[^>]*>/gi,' ').
-                        replace(/<\/?h[1-6][^>]*>/gi,' ');
-
-                //remove empty tags
-                //D = D.replace(/<strong><\/strong>/gi,'').
-                //replace(/<i><\/i>/gi,'').
-                //replace(/<P[^>]*><\/P>/gi,'');
-
-                // nuke double tags
-                oldlen = D.length + 1;
-                while(oldlen > D.length) {
-                        oldlen = D.length;
-                        // join us now and free the tags, we'll be free hackers, we'll be free... ;-)
-                        D = D.replace(/<([a-z][a-z]*)> *<\/\1>/gi,' ').
-                                replace(/<([a-z][a-z]*)> *<([a-z][^>]*)> *<\/\1>/gi,'<$2>');
-                }
-                D = D.replace(/<([a-z][a-z]*)><\1>/gi,'<$1>').
-                        replace(/<\/([a-z][a-z]*)><\/\1>/gi,'<\/$1>');
-
-                // nuke double spaces
-                D = D.replace(/  */gi,' ');
-
-                this.setHTML(D);
-                this.updateToolbar();
-        }
-};
-
-HTMLArea.prototype.forceRedraw = function() {
-        this._doc.body.style.visibility = "hidden";
-        this._doc.body.style.visibility = "visible";
-        // this._doc.body.innerHTML = this.getInnerHTML();
-};
-
-// focuses the iframe window.  returns a reference to the editor document.
-HTMLArea.prototype.focusEditor = function() {
-        switch (this._editMode) {
-            // notice the try { ... } catch block to avoid some rare exceptions in FireFox
-            // (perhaps also in other Gecko browsers). Manual focus by user is required in
-        // case of an error. Somebody has an idea?
-            case "wysiwyg" : try { this._iframe.contentWindow.focus() } catch (e) {} break;
-            case "textmode": try { this._textArea.focus() } catch (e) {} break;
-            default           : alert("ERROR: mode " + this._editMode + " is not defined");
-        }
-        return this._doc;
-};
-
-// takes a snapshot of the current text (for undo)
-HTMLArea.prototype._undoTakeSnapshot = function() {
-        ++this._undoPos;
-        if (this._undoPos >= this.config.undoSteps) {
-                // remove the first element
-                this._undoQueue.shift();
-                --this._undoPos;
-        }
-        // use the fasted method (getInnerHTML);
-        var take = true;
-        var txt = this.getInnerHTML();
-        if (this._undoPos > 0)
-                take = (this._undoQueue[this._undoPos - 1] != txt);
-        if (take) {
-                this._undoQueue[this._undoPos] = txt;
-        } else {
-                this._undoPos--;
-        }
-};
-
-HTMLArea.prototype.undo = function() {
-        if (this._undoPos > 0) {
-                var txt = this._undoQueue[--this._undoPos];
-                if (txt) this.setHTML(txt);
-                else ++this._undoPos;
-        }
-};
-
-HTMLArea.prototype.redo = function() {
-        if (this._undoPos < this._undoQueue.length - 1) {
-                var txt = this._undoQueue[++this._undoPos];
-                if (txt) this.setHTML(txt);
-                else --this._undoPos;
-        }
-};
-
-// updates enabled/disable/active state of the toolbar elements
-HTMLArea.prototype.updateToolbar = function(noStatus) {
-        var doc = this._doc;
-        var text = (this._editMode == "textmode");
-        var ancestors = null;
-        if (!text) {
-                ancestors = this.getAllAncestors();
-                if (this.config.statusBar && !noStatus) {
-                        this._statusBarTree.innerHTML = HTMLArea.I18N.msg["Path"] + ": "; // clear
-                        for (var i = ancestors.length; --i >= 0;) {
-                                var el = ancestors[i];
-                                if (!el) {
-                                        // hell knows why we get here; this
-                                        // could be a classic example of why
-                                        // it's good to check for conditions
-                                        // that are impossible to happen ;-)
-                                        continue;
-                                }
-                                var a = document.createElement("a");
-                                a.href = "#";
-                                a.el = el;
-                                a.editor = this;
-                                a.onclick = function() {
-                                        this.blur();
-                                        this.editor.selectNodeContents(this.el);
-                                        this.editor.updateToolbar(true);
-                                        return false;
-                                };
-                                a.oncontextmenu = function() {
-                                        // TODO: add context menu here
-                                        this.blur();
-                                        var info = "Inline style:\n\n";
-                                        info += this.el.style.cssText.split(/;\s*/).join(";\n");
-                                        alert(info);
-                                        return false;
-                                };
-                                var txt = el.tagName.toLowerCase();
-                                a.title = el.style.cssText;
-                                if (el.id) {
-                                        txt += "#" + el.id;
-                                }
-                                if (el.className) {
-                                        txt += "." + el.className;
-                                }
-                                a.appendChild(document.createTextNode(txt));
-                                this._statusBarTree.appendChild(a);
-                                if (i != 0) {
-                                        this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(0xbb)));
-                                }
-                        }
-                }
-        }
-
-        for (var i in this._toolbarObjects) {
-                var btn = this._toolbarObjects[i];
-                var cmd = i;
-                var inContext = true;
-                if (btn.context && !text) {
-                        inContext = false;
-                        var context = btn.context;
-                        var attrs = [];
-                        if (/(.*)\[(.*?)\]/.test(context)) {
-                                context = RegExp.$1;
-                                attrs = RegExp.$2.split(",");
-                        }
-                        context = context.toLowerCase();
-                        var match = (context == "*");
-                        for (var k = 0; k < ancestors.length; ++k) {
-                                if (!ancestors[k]) {
-                                        // the impossible really happens.
-                                        continue;
-                                }
-                                if (match || (ancestors[k].tagName.toLowerCase() == context)) {
-                                        inContext = true;
-                                        for (var ka = 0; ka < attrs.length; ++ka) {
-                                                if (!eval("ancestors[k]." + attrs[ka])) {
-                                                        inContext = false;
-                                                        break;
-                                                }
-                                        }
-                                        if (inContext) {
-                                                break;
-                                        }
-                                }
-                        }
-                }
-                btn.state("enabled", (!text || btn.text) && inContext);
-                if (typeof cmd == "function") {
-                        continue;
-                }
-                // look-it-up in the custom dropdown boxes
-                var dropdown = this.config.customSelects[cmd];
-                if ((!text || btn.text) && (typeof dropdown != "undefined")) {
-                        dropdown.refresh(this);
-                        continue;
-                }
-                switch (cmd) {
-                    case "fontname":
-                    case "fontsize":
-                    case "formatblock":
-                        if (!text) try {
-                                var value = ("" + doc.queryCommandValue(cmd)).toLowerCase();
-                                if (!value) {
-                                        btn.element.selectedIndex = 0;
-                                        break;
-                                }
-                                // HACK -- retrieve the config option for this
-                                // combo box.  We rely on the fact that the
-                                // variable in config has the same name as
-                                // button name in the toolbar.
-                                var options = this.config[cmd];
-                                var k = 0;
-                                for (var j in options) {
-                                        // FIXME: the following line is scary.
-                                        if ((j.toLowerCase() == value) ||
-                                            (options[j].substr(0, value.length).toLowerCase() == value)) {
-                                                btn.element.selectedIndex = k;
-                                                throw "ok";
-                                        }
-                                        ++k;
-                                }
-                                btn.element.selectedIndex = 0;
-                        } catch(e) {};
-                        break;
-                    case "textindicator":
-                        if (!text) {
-                                try {with (btn.element.style) {
-                                        backgroundColor = HTMLArea._makeColor(
-                                                doc.queryCommandValue(HTMLArea.is_ie ? "backcolor" : "hilitecolor"));
-                                        if (/transparent/i.test(backgroundColor)) {
-                                                // Mozilla
-                                                backgroundColor = HTMLArea._makeColor(doc.queryCommandValue("backcolor"));
-                                        }
-                                        color = HTMLArea._makeColor(doc.queryCommandValue("forecolor"));
-                                        fontFamily = doc.queryCommandValue("fontname");
-                                        fontWeight = doc.queryCommandState("bold") ? "bold" : "normal";
-                                        fontStyle = doc.queryCommandState("italic") ? "italic" : "normal";
-                                }} catch (e) {
-                                        // alert(e + "\n\n" + cmd);
-                                }
-                        }
-                        break;
-                    case "htmlmode": btn.state("active", text); break;
-                    case "lefttoright":
-                    case "righttoleft":
-                        var el = this.getParentElement();
-                        while (el && !HTMLArea.isBlockElement(el))
-                                el = el.parentNode;
-                        if (el)
-                                btn.state("active", (el.style.direction == ((cmd == "righttoleft") ? "rtl" : "ltr")));
-                        break;
-                    default:
-                        cmd = cmd.replace(/(un)?orderedlist/i, "insert$1orderedlist");
-                        try {
-                                btn.state("active", (!text && doc.queryCommandState(cmd)));
-                        } catch (e) {}
-                }
-        }
-        // take undo snapshots
-        if (this._customUndo && !this._timerUndo) {
-                this._undoTakeSnapshot();
-                var editor = this;
-                this._timerUndo = setTimeout(function() {
-                        editor._timerUndo = null;
-                }, this.config.undoTimeout);
-        }
-
-        // check if any plugins have registered refresh handlers
-        for (var i in this.plugins) {
-                var plugin = this.plugins[i].instance;
-                if (typeof plugin.onUpdateToolbar == "function")
-                        plugin.onUpdateToolbar();
-        }
-};
-
-/** Returns a node after which we can insert other nodes, in the current
- * selection.  The selection is removed.  It splits a text node, if needed.
- */
-HTMLArea.prototype.insertNodeAtSelection = function(toBeInserted) {
-        if (!HTMLArea.is_ie) {
-                var sel = this._getSelection();
-                var range = this._createRange(sel);
-                // remove the current selection
-                sel.removeAllRanges();
-                range.deleteContents();
-                var node = range.startContainer;
-                var pos = range.startOffset;
-                switch (node.nodeType) {
-                    case 3: // Node.TEXT_NODE
-                        // we have to split it at the caret position.
-                        if (toBeInserted.nodeType == 3) {
-                                // do optimized insertion
-                                node.insertData(pos, toBeInserted.data);
-                                range = this._createRange();
-                                range.setEnd(node, pos + toBeInserted.length);
-                                range.setStart(node, pos + toBeInserted.length);
-                                sel.addRange(range);
-                        } else {
-                                node = node.splitText(pos);
-                                var selnode = toBeInserted;
-                                if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
-                                        selnode = selnode.firstChild;
-                                }
-                                node.parentNode.insertBefore(toBeInserted, node);
-                                this.selectNodeContents(selnode);
-                                this.updateToolbar();
-                        }
-                        break;
-                    case 1: // Node.ELEMENT_NODE
-                        var selnode = toBeInserted;
-                        if (toBeInserted.nodeType == 11 /* Node.DOCUMENT_FRAGMENT_NODE */) {
-                                selnode = selnode.firstChild;
-                        }
-                        node.insertBefore(toBeInserted, node.childNodes[pos]);
-                        this.selectNodeContents(selnode);
-                        this.updateToolbar();
-                        break;
-                }
-        } else {
-                return null;        // this function not yet used for IE <FIXME>
-        }
-};
-
-// Returns the deepest node that contains both endpoints of the selection.
-HTMLArea.prototype.getParentElement = function() {
-        var sel = this._getSelection();
-        var range = this._createRange(sel);
-        if (HTMLArea.is_ie) {
-                switch (sel.type) {
-                    case "Text":
-                    case "None":
-                        // It seems that even for selection of type "None",
-                        // there _is_ a parent element and it's value is not
-                        // only correct, but very important to us.  MSIE is
-                        // certainly the buggiest browser in the world and I
-                        // wonder, God, how can Earth stand it?
-                        return range.parentElement();
-                    case "Control":
-                        return range.item(0);
-                    default:
-                        return this._doc.body;
-                }
-        } else try {
-                var p = range.commonAncestorContainer;
-                if (!range.collapsed && range.startContainer == range.endContainer &&
-                    range.startOffset - range.endOffset <= 1 && range.startContainer.hasChildNodes())
-                        p = range.startContainer.childNodes[range.startOffset];
-                /*
-                alert(range.startContainer + ":" + range.startOffset + "\n" +
-                      range.endContainer + ":" + range.endOffset);
-                */
-                while (p.nodeType == 3) {
-                        p = p.parentNode;
-                }
-                return p;
-        } catch (e) {
-                return null;
-        }
-};
-
-// Returns an array with all the ancestor nodes of the selection.
-HTMLArea.prototype.getAllAncestors = function() {
-        var p = this.getParentElement();
-        var a = [];
-        while (p && (p.nodeType == 1) && (p.tagName.toLowerCase() != 'body')) {
-                a.push(p);
-                p = p.parentNode;
-        }
-        a.push(this._doc.body);
-        return a;
-};
-
-// Selects the contents inside the given node
-HTMLArea.prototype.selectNodeContents = function(node, pos) {
-        this.focusEditor();
-        this.forceRedraw();
-        var range;
-        var collapsed = (typeof pos != "undefined");
-        if (HTMLArea.is_ie) {
-                range = this._doc.body.createTextRange();
-                range.moveToElementText(node);
-                (collapsed) && range.collapse(pos);
-                range.select();
-        } else {
-                var sel = this._getSelection();
-                range = this._doc.createRange();
-                range.selectNodeContents(node);
-                (collapsed) && range.collapse(pos);
-                sel.removeAllRanges();
-                sel.addRange(range);
-        }
-};
-
-/** Call this function to insert HTML code at the current position.  It deletes
- * the selection, if any.
- */
-HTMLArea.prototype.insertHTML = function(html) {
-        var sel = this._getSelection();
-        var range = this._createRange(sel);
-        if (HTMLArea.is_ie) {
-                range.pasteHTML(html);
-        } else {
-                // construct a new document fragment with the given HTML
-                var fragment = this._doc.createDocumentFragment();
-                var div = this._doc.createElement("div");
-                div.innerHTML = html;
-                while (div.firstChild) {
-                        // the following call also removes the node from div
-                        fragment.appendChild(div.firstChild);
-                }
-                // this also removes the selection
-                var node = this.insertNodeAtSelection(fragment);
-        }
-};
-
-/**
- *  Call this function to surround the existing HTML code in the selection with
- *  your tags.  FIXME: buggy!  This function will be deprecated "soon".
- */
-HTMLArea.prototype.surroundHTML = function(startTag, endTag) {
-        var html = this.getSelectedHTML();
-        // the following also deletes the selection
-        this.insertHTML(startTag + html + endTag);
-};
-
-/// Retrieve the selected block
-HTMLArea.prototype.getSelectedHTML = function() {
-        var sel = this._getSelection();
-        var range = this._createRange(sel);
-        var existing = null;
-        if (HTMLArea.is_ie) {
-                existing = range.htmlText;
-        } else {
-                existing = HTMLArea.getHTML(range.cloneContents(), false, this);
-        }
-        return existing;
-};
-
-/// Return true if we have some selection
-HTMLArea.prototype.hasSelectedText = function() {
-        // FIXME: come _on_ mishoo, you can do better than this ;-)
-        return this.getSelectedHTML() != '';
-};
-
-HTMLArea.prototype._createLink = function(link) {
-        var editor = this;
-        var outparam = null;
-        if (typeof link == "undefined") {
-                link = this.getParentElement();
-                if (link && !/^a$/i.test(link.tagName))
-                        link = null;
-        }
-        if (!link) {
-                var sel = editor._getSelection();
-                var range = editor._createRange(sel);
-                var compare = 0;
-                if (HTMLArea.is_ie) {
-                        compare = range.compareEndPoints("StartToEnd", range);
-                } else {
-                        compare = range.compareBoundaryPoints(range.START_TO_END, range);
-                }
-                if (compare == 0) {
-                        alert("You need to select some text before creating a link");
-                        return;
-                }
-                outparam = {
-                        f_href : '',
-                        f_title : '',
-                        f_target : '',
-                        f_usetarget : editor.config.makeLinkShowsTarget
-                };
-        } else
-                outparam = {
-                        f_href   : HTMLArea.is_ie ? editor.stripBaseURL(link.href) : link.getAttribute("href"),
-                        f_title  : link.title,
-                        f_target : link.target,
-                        f_usetarget : editor.config.makeLinkShowsTarget
-                };
-        this._popupDialog("link.html", function(param) {
-                if (!param)
-                        return false;
-                var a = link;
-                if (!a) try {
-                        editor._doc.execCommand("createlink", false, param.f_href);
-                        a = editor.getParentElement();
-                        var sel = editor._getSelection();
-                        var range = editor._createRange(sel);
-                        if (!HTMLArea.is_ie) {
-                                a = range.startContainer;
-                                if (!/^a$/i.test(a.tagName)) {
-                                        a = a.nextSibling;
-                                        if (a == null)
-                                                a = range.startContainer.parentNode;
-                                }
-                        }
-                } catch(e) {}
-                else {
-                        var href = param.f_href.trim();
-                        editor.selectNodeContents(a);
-                        if (href == "") {
-                                editor._doc.execCommand("unlink", false, null);
-                                editor.updateToolbar();
-                                return false;
-                        }
-                        else {
-                                a.href = href;
-                        }
-                }
-                if (!(a && /^a$/i.test(a.tagName)))
-                        return false;
-                a.target = param.f_target.trim();
-                a.title = param.f_title.trim();
-                editor.selectNodeContents(a);
-                editor.updateToolbar();
-        }, outparam);
-};
-
-// Called when the user clicks on "InsertImage" button.  If an image is already
-// there, it will just modify it's properties.
-HTMLArea.prototype._insertImage = function(image) {
-        var editor = this;        // for nested functions
-        var outparam = null;
-        if (typeof image == "undefined") {
-                image = this.getParentElement();
-                if (image && !/^img$/i.test(image.tagName))
-                        image = null;
-        }
-        if (image) outparam = {
-                f_url    : HTMLArea.is_ie ? editor.stripBaseURL(image.src) : image.getAttribute("src"),
-                f_alt    : image.alt,
-                f_border : image.border,
-                f_align  : image.align,
-                f_vert   : image.vspace,
-                f_horiz  : image.hspace
-        };
-        this._popupDialog("insert_image.html", function(param) {
-                if (!param) {        // user must have pressed Cancel
-                        return false;
-                }
-                var img = image;
-                if (!img) {
-                        var sel = editor._getSelection();
-                        var range = editor._createRange(sel);
-                        editor._doc.execCommand("insertimage", false, param.f_url);
-                        if (HTMLArea.is_ie) {
-                                img = range.parentElement();
-                                // wonder if this works...
-                                if (img.tagName.toLowerCase() != "img") {
-                                        img = img.previousSibling;
-                                }
-                        } else {
-                                img = range.startContainer.previousSibling;
-                        }
-                } else {
-                        img.src = param.f_url;
-                }
-
-                for (var field in param) {
-                        var value = param[field];
-                        switch (field) {
-                            case "f_alt"    : img.alt         = value; break;
-                            case "f_border" : img.border = parseInt(value || "0"); break;
-                            case "f_align"  : img.align         = value; break;
-                            case "f_vert"   : img.vspace = parseInt(value || "0"); break;
-                            case "f_horiz"  : img.hspace = parseInt(value || "0"); break;
-                        }
-                }
-        }, outparam);
-};
-
-// Called when the user clicks the Insert Table button
-HTMLArea.prototype._insertTable = function() {
-        var sel = this._getSelection();
-        var range = this._createRange(sel);
-        var editor = this;        // for nested functions
-        this._popupDialog("insert_table.html", function(param) {
-                if (!param) {        // user must have pressed Cancel
-                        return false;
-                }
-                var doc = editor._doc;
-                // create the table element
-                var table = doc.createElement("table");
-                // assign the given arguments
-
-                for (var field in param) {
-                        var value = param[field];
-                        if (!value) {
-                                continue;
-                        }
-                        switch (field) {
-                            case "f_width"   : table.style.width = value + param["f_unit"]; break;
-                            case "f_align"   : table.align         = value; break;
-                            case "f_border"  : table.border         = parseInt(value); break;
-                            case "f_spacing" : table.cellSpacing = parseInt(value); break;
-                            case "f_padding" : table.cellPadding = parseInt(value); break;
-                        }
-                }
-                var tbody = doc.createElement("tbody");
-                table.appendChild(tbody);
-                for (var i = 0; i < param["f_rows"]; ++i) {
-                        var tr = doc.createElement("tr");
-                        tbody.appendChild(tr);
-                        for (var j = 0; j < param["f_cols"]; ++j) {
-                                var td = doc.createElement("td");
-                                tr.appendChild(td);
-                                // Mozilla likes to see something inside the cell.
-                                (HTMLArea.is_gecko) && td.appendChild(doc.createElement("br"));
-                        }
-                }
-                if (HTMLArea.is_ie) {
-                        range.pasteHTML(table.outerHTML);
-                } else {
-                        // insert the table
-                        editor.insertNodeAtSelection(table);
-                }
-                return true;
-        }, null);
-};
-
-/***************************************************
- *  Category: EVENT HANDLERS
- ***************************************************/
-
-// el is reference to the SELECT object
-// txt is the name of the select field, as in config.toolbar
-HTMLArea.prototype._comboSelected = function(el, txt) {
-        this.focusEditor();
-        var value = el.options[el.selectedIndex].value;
-        switch (txt) {
-            case "fontname":
-            case "fontsize": this.execCommand(txt, false, value); break;
-            case "formatblock":
-                (HTMLArea.is_ie) && (value = "<" + value + ">");
-                this.execCommand(txt, false, value);
-                break;
-            default:
-                // try to look it up in the registered dropdowns
-                var dropdown = this.config.customSelects[txt];
-                if (typeof dropdown != "undefined") {
-                        dropdown.action(this);
-                } else {
-                        alert("FIXME: combo box " + txt + " not implemented");
-                }
-        }
-};
-
-// the execCommand function (intercepts some commands and replaces them with
-// our own implementation)
-HTMLArea.prototype.execCommand = function(cmdID, UI, param) {
-        var editor = this;        // for nested functions
-        this.focusEditor();
-        cmdID = cmdID.toLowerCase();
-        if (HTMLArea.is_gecko) try { this._doc.execCommand('useCSS', false, true); } catch (e) {};
-        switch (cmdID) {
-            case "htmlmode" : this.setMode(); break;
-            case "hilitecolor":
-                (HTMLArea.is_ie) && (cmdID = "backcolor");
-            case "forecolor":
-                this._popupDialog("select_color.html", function(color) {
-                        if (color) { // selection not canceled
-                                editor._doc.execCommand(cmdID, false, "#" + color);
-                        }
-                }, HTMLArea._colorToRgb(this._doc.queryCommandValue(cmdID)));
-                break;
-            case "createlink":
-                this._createLink();
-                break;
-            case "popupeditor":
-                // this object will be passed to the newly opened window
-                HTMLArea._object = this;
-                if (HTMLArea.is_ie) {
-                        //if (confirm(HTMLArea.I18N.msg["IE-sucks-full-screen"]))
-                        {
-                                window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
-                                            "toolbar=no,location=no,directories=no,status=no,menubar=no," +
-                                            "scrollbars=no,resizable=yes,width=640,height=480");
-                        }
-                } else {
-                        window.open(this.popupURL("fullscreen.html"), "ha_fullscreen",
-                                    "toolbar=no,menubar=no,personalbar=no,width=640,height=480," +
-                                    "scrollbars=no,resizable=yes");
-                }
-                break;
-            case "undo":
-            case "redo":
-                if (this._customUndo)
-                        this[cmdID]();
-                else
-                        this._doc.execCommand(cmdID, UI, param);
-                break;
-            case "inserttable": this._insertTable(); break;
-            case "insertimage": this._insertImage(); break;
-            case "about"    : this._popupDialog("about.html", null, this); break;
-            case "showhelp" : window.open(_editor_url + "reference.html", "ha_help"); break;
-
-            case "killword": this._wordClean(); break;
-
-            case "cut":
-            case "copy":
-            case "paste":
-                try {
-                        if (this.config.killWordOnPaste)
-                                this._wordClean();
-                        this._doc.execCommand(cmdID, UI, param);
-                } catch (e) {
-                        if (HTMLArea.is_gecko) {
-                                if (typeof HTMLArea.I18N.msg["Moz-Clipboard"] == "undefined") {
-                                        HTMLArea.I18N.msg["Moz-Clipboard"] =
-                                                "Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
-                                                "for security reasons.  Click OK to see a technical note at mozilla.org " +
-                                                "which shows you how to allow a script to access the clipboard.\n\n" +
-                                                "[FIXME: please translate this message in your language definition file.]";
-                                }
-                                if (confirm(HTMLArea.I18N.msg["Moz-Clipboard"]))
-                                        window.open("http://mozilla.org/editor/midasdemo/securityprefs.html");
-                        }
-                }
-                break;
-            case "lefttoright":
-            case "righttoleft":
-                var dir = (cmdID == "righttoleft") ? "rtl" : "ltr";
-                var el = this.getParentElement();
-                while (el && !HTMLArea.isBlockElement(el))
-                        el = el.parentNode;
-                if (el) {
-                        if (el.style.direction == dir)
-                                el.style.direction = "";
-                        else
-                                el.style.direction = dir;
-                }
-                break;
-            default: try { this._doc.execCommand(cmdID, UI, param); }
-                catch(e) { if (this.config.debug) { alert(e + "\n\nby execCommand(" + cmdID + ");"); } }
-        }
-        this.updateToolbar();
-        return false;
-};
-
-/** A generic event handler for things that happen in the IFRAME's document.
- * This function also handles key bindings. */
-HTMLArea.prototype._editorEvent = function(ev) {
-        var editor = this;
-        var keyEvent = (HTMLArea.is_ie && ev.type == "keydown") || (ev.type == "keypress");
-
-        if (keyEvent) {
-                for (var i in editor.plugins) {
-                        var plugin = editor.plugins[i].instance;
-                        if (typeof plugin.onKeyPress == "function") plugin.onKeyPress(ev);
-                }
-        }
-        if (keyEvent && ev.ctrlKey && !ev.altKey) {
-                var sel = null;
-                var range = null;
-                var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
-                var cmd = null;
-                var value = null;
-                switch (key) {
-                    case 'a':
-                        if (!HTMLArea.is_ie) {
-                                // KEY select all
-                                sel = this._getSelection();
-                                sel.removeAllRanges();
-                                range = this._createRange();
-                                range.selectNodeContents(this._doc.body);
-                                sel.addRange(range);
-                                HTMLArea._stopEvent(ev);
-                        }
-                        break;
-
-                        // simple key commands follow
-
-                    case 'b': cmd = "bold"; break;
-                    case 'i': cmd = "italic"; break;
-                    case 'u': cmd = "underline"; break;
-                    case 's': cmd = "strikethrough"; break;
-                    case 'l': cmd = "justifyleft"; break;
-                    case 'e': cmd = "justifycenter"; break;
-                    case 'r': cmd = "justifyright"; break;
-                    case 'j': cmd = "justifyfull"; break;
-                    case 'z': cmd = "undo"; break;
-                    case 'y': cmd = "redo"; break;
-                    case 'v': if (editor.config.htmlareaPaste) { cmd = "paste"; } break;
-                    case 'n': cmd = "formatblock"; value = HTMLArea.is_ie ? "<p>" : "p"; break;
-
-                    case '0': cmd = "killword"; break;
-
-                        // headings
-                    case '1':
-                    case '2':
-                    case '3':
-                    case '4':
-                    case '5':
-                    case '6':
-                        cmd = "formatblock";
-                        value = "h" + key;
-                        if (HTMLArea.is_ie)
-                                value = "<" + value + ">";
-                        break;
-                }
-                if (cmd) {
-                        // execute simple command
-                        this.execCommand(cmd, false, value);
-                        HTMLArea._stopEvent(ev);
-                }
-        }
-        else if (keyEvent) {
-                // other keys here
-                switch (ev.keyCode) {
-                    case 13: // KEY enter
-                        if (HTMLArea.is_gecko && !ev.shiftKey) {
-                                this.checkInsertP();
-                                HTMLArea._stopEvent(ev);
-                        }
-                        break;
-                }
-        }
-
-        // update the toolbar state after some time
-        if (editor._timerToolbar) {
-                clearTimeout(editor._timerToolbar);
-        }
-        editor._timerToolbar = setTimeout(function() {
-                editor.updateToolbar();
-                editor._timerToolbar = null;
-        }, 50);
-};
-
-HTMLArea.prototype.convertNode = function(el, newTagName) {
-        var newel = this._doc.createElement(newTagName);
-        while (el.firstChild)
-                newel.appendChild(el.firstChild);
-        return newel;
-};
-
-HTMLArea.prototype.checkInsertP = function() {
-        var p = this.getAllAncestors();
-        var block = null;
-        var body = this._doc.body;
-        for (var i = 0; i < p.length; ++i)
-                if (HTMLArea.isBlockElement(p[i]) && !/body|html/i.test(p[i].tagName)) {
-                        block = p[i];
-                        break;
-                }
-        var sel = this._getSelection();
-        var range = this._createRange(sel);
-        if (!range.collapsed)
-                range.deleteContents();
-        sel.removeAllRanges();
-        var SC = range.startContainer;
-        var SO = range.startOffset;
-        var EC = range.endContainer;
-        var EO = range.endOffset;
-        //alert(SC.tagName + ":" + SO + " => " + EC.tagName + ":" + EO);
-        if (SC == EC && SC == body && !SO && !EO) {
-                p = this._doc.createTextNode(" ");
-                body.insertBefore(p, body.firstChild);
-                range.selectNodeContents(p);
-                SC = range.startContainer;
-                SO = range.startOffset;
-                EC = range.endContainer;
-                EO = range.endOffset;
-        }
-        if (!block) {
-                var r2 = range.cloneRange();
-                r2.setStartBefore(SC);
-                r2.setEndAfter(EC);
-                r2.surroundContents(block = this._doc.createElement("p"));
-                range.setEndAfter(block);
-                range.setStart(block.firstChild, SO);
-        } else range.setEndAfter(block);
-        var df = range.extractContents();
-        if (!/\S/.test(block.innerHTML))
-                block.innerHTML = "<br />";
-        p = df.firstChild;
-        if (!/\S/.test(p.innerHTML))
-                p.innerHTML = "<br />";
-        if (/^\s*<br\s*\/?>\s*$/.test(p.innerHTML) && /^h[1-6]$/i.test(p.tagName)) {
-                df.appendChild(this.convertNode(p, "p"));
-                df.removeChild(p);
-        }
-        block.parentNode.insertBefore(df, block.nextSibling);
-        range.selectNodeContents(block.nextSibling);
-        range.collapse(true);
-        sel.addRange(range);
-        this.forceRedraw();
-};
-
-// retrieve the HTML
-HTMLArea.prototype.getHTML = function() {
-        switch (this._editMode) {
-            case "wysiwyg"  :
-                if (!this.config.fullPage) {
-                        return HTMLArea.getHTML(this._doc.body, false, this);
-                } else
-                        return this.doctype + "\n" + HTMLArea.getHTML(this._doc.documentElement, true, this);
-            case "textmode" : return this._textArea.value;
-            default            : alert("Mode <" + mode + "> not defined!");
-        }
-        return false;
-};
-
-// retrieve the HTML (fastest version, but uses innerHTML)
-HTMLArea.prototype.getInnerHTML = function() {
-        switch (this._editMode) {
-            case "wysiwyg"  :
-                if (!this.config.fullPage)
-                        return this._doc.body.innerHTML;
-                else
-                        return this.doctype + "\n" + this._doc.documentElement.innerHTML;
-            case "textmode" : return this._textArea.value;
-            default            : alert("Mode <" + mode + "> not defined!");
-        }
-        return false;
-};
-
-// completely change the HTML inside
-HTMLArea.prototype.setHTML = function(html) {
-        switch (this._editMode) {
-            case "wysiwyg"  :
-                if (!this.config.fullPage)
-                        this._doc.body.innerHTML = html;
-                else
-                        // this._doc.documentElement.innerHTML = html;
-                        this._doc.body.innerHTML = html;
-                break;
-            case "textmode" : this._textArea.value = html; break;
-            default            : alert("Mode <" + mode + "> not defined!");
-        }
-        return false;
-};
-
-// sets the given doctype (useful when config.fullPage is true)
-HTMLArea.prototype.setDoctype = function(doctype) {
-        this.doctype = doctype;
-};
-
-/***************************************************
- *  Category: UTILITY FUNCTIONS
- ***************************************************/
-
-// variable used to pass the object to the popup editor window.
-HTMLArea._object = null;
-
-// function that returns a clone of the given object
-HTMLArea.cloneObject = function(obj) {
-        if (!obj) return null;
-        var newObj = new Object;
-
-        // check for array objects
-        if (obj.constructor.toString().indexOf("function Array(") == 1) {
-                newObj = obj.constructor();
-        }
-
-        // check for function objects (as usual, IE is fucked up)
-        if (obj.constructor.toString().indexOf("function Function(") == 1) {
-                newObj = obj; // just copy reference to it
-        } else for (var n in obj) {
-                var node = obj[n];
-                if (typeof node == 'object') { newObj[n] = HTMLArea.cloneObject(node); }
-                else                         { newObj[n] = node; }
-        }
-
-        return newObj;
-};
-
-// FIXME!!! this should return false for IE < 5.5
-HTMLArea.checkSupportedBrowser = function() {
-        if (HTMLArea.is_gecko) {
-                if (navigator.productSub < 20021201) {
-                        alert("You need at least Mozilla-1.3 Alpha.\n" +
-                              "Sorry, your Gecko is not supported.");
-                        return false;
-                }
-                if (navigator.productSub < 20030210) {
-                        alert("Mozilla < 1.3 Beta is not supported!\n" +
-                              "I'll try, though, but it might not work.");
-                }
-        }
-        return HTMLArea.is_gecko || HTMLArea.is_ie;
-};
-
-// selection & ranges
-
-// returns the current selection object
-HTMLArea.prototype._getSelection = function() {
-        if (HTMLArea.is_ie) {
-                return this._doc.selection;
-        } else {
-                return this._iframe.contentWindow.getSelection();
-        }
-};
-
-// returns a range for the current selection
-HTMLArea.prototype._createRange = function(sel) {
-        if (HTMLArea.is_ie) {
-                return sel.createRange();
-        } else {
-                this.focusEditor();
-                if (typeof sel != "undefined") {
-                        try {
-                                return sel.getRangeAt(0);
-                        } catch(e) {
-                                return this._doc.createRange();
-                        }
-                } else {
-                        return this._doc.createRange();
-                }
-        }
-};
-
-// event handling
-
-HTMLArea._addEvent = function(el, evname, func) {
-        if (HTMLArea.is_ie) {
-                el.attachEvent("on" + evname, func);
-        } else {
-                el.addEventListener(evname, func, true);
-        }
-};
-
-HTMLArea._addEvents = function(el, evs, func) {
-        for (var i = evs.length; --i >= 0;) {
-                HTMLArea._addEvent(el, evs[i], func);
-        }
-};
-
-HTMLArea._removeEvent = function(el, evname, func) {
-        if (HTMLArea.is_ie) {
-                el.detachEvent("on" + evname, func);
-        } else {
-                el.removeEventListener(evname, func, true);
-        }
-};
-
-HTMLArea._removeEvents = function(el, evs, func) {
-        for (var i = evs.length; --i >= 0;) {
-                HTMLArea._removeEvent(el, evs[i], func);
-        }
-};
-
-HTMLArea._stopEvent = function(ev) {
-        if (HTMLArea.is_ie) {
-                ev.cancelBubble = true;
-                ev.returnValue = false;
-        } else {
-                ev.preventDefault();
-                ev.stopPropagation();
-        }
-};
-
-HTMLArea._removeClass = function(el, className) {
-        if (!(el && el.className)) {
-                return;
-        }
-        var cls = el.className.split(" ");
-        var ar = new Array();
-        for (var i = cls.length; i > 0;) {
-                if (cls[--i] != className) {
-                        ar[ar.length] = cls[i];
-                }
-        }
-        el.className = ar.join(" ");
-};
-
-HTMLArea._addClass = function(el, className) {
-        // remove the class first, if already there
-        HTMLArea._removeClass(el, className);
-        el.className += " " + className;
-};
-
-HTMLArea._hasClass = function(el, className) {
-        if (!(el && el.className)) {
-                return false;
-        }
-        var cls = el.className.split(" ");
-        for (var i = cls.length; i > 0;) {
-                if (cls[--i] == className) {
-                        return true;
-                }
-        }
-        return false;
-};
-
-HTMLArea.isBlockElement = function(el) {
-        var blockTags = " body form textarea fieldset ul ol dl li div " +
-                "p h1 h2 h3 h4 h5 h6 quote pre table thead " +
-                "tbody tfoot tr td iframe address ";
-        return (blockTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
-};
-
-HTMLArea.needsClosingTag = function(el) {
-        var closingTags = " head script style div span tr td tbody table em strong font a title ";
-        return (closingTags.indexOf(" " + el.tagName.toLowerCase() + " ") != -1);
-};
-
-// performs HTML encoding of some given string
-HTMLArea.htmlEncode = function(str) {
-        // we don't need regexp for that, but.. so be it for now.
-        str = str.replace(/&/ig, "&amp;");
-        str = str.replace(/</ig, "&lt;");
-        str = str.replace(/>/ig, "&gt;");
-        str = str.replace(/\x22/ig, "&quot;");
-        // \x22 means '"' -- we use hex reprezentation so that we don't disturb
-        // JS compressors (well, at least mine fails.. ;)
-        return str;
-};
-
-// Retrieves the HTML code from the given node.         This is a replacement for
-// getting innerHTML, using standard DOM calls.
-// Wrapper catch a Mozilla-Exception with non well formed html source code
-HTMLArea.getHTML = function(root, outputRoot, editor){
-    try{
-        return HTMLArea.getHTMLWrapper(root,outputRoot,editor);
-    }
-    catch(e){
-        alert('Your Document is not well formed. Check JavaScript console for details.');
-        return editor._iframe.contentWindow.document.body.innerHTML;
-    }
-}
-
-HTMLArea.getHTMLWrapper = function(root, outputRoot, editor) {
-        var html = "";
-        switch (root.nodeType) {
-            case 1: // Node.ELEMENT_NODE
-            case 11: // Node.DOCUMENT_FRAGMENT_NODE
-                var closed;
-                var i;
-                var root_tag = (root.nodeType == 1) ? root.tagName.toLowerCase() : '';
-                if (outputRoot)
-                        outputRoot = !(editor.config.htmlRemoveTags && editor.config.htmlRemoveTags.test(root_tag));
-                if (HTMLArea.is_ie && root_tag == "head") {
-                        if (outputRoot)
-                                html += "<head>";
-                        // lowercasize
-                        var save_multiline = RegExp.multiline;
-                        RegExp.multiline = true;
-                        var txt = root.innerHTML.replace(HTMLArea.RE_tagName, function(str, p1, p2) {
-                                return p1 + p2.toLowerCase();
-                        });
-                        RegExp.multiline = save_multiline;
-                        html += txt;
-                        if (outputRoot)
-                                html += "</head>";
-                        break;
-                } else if (outputRoot) {
-                        closed = (!(root.hasChildNodes() || HTMLArea.needsClosingTag(root)));
-                        html = "<" + root.tagName.toLowerCase();
-                        var attrs = root.attributes;
-                        for (i = 0; i < attrs.length; ++i) {
-                                var a = attrs.item(i);
-                                if (!a.specified) {
-                                        continue;
-                                }
-                                var name = a.nodeName.toLowerCase();
-                                if (/_moz_editor_bogus_node/.test(name)) {
-                                        html = "";
-                                        break;
-                                }
-                                if (/_moz|contenteditable|_msh/.test(name)) {
-                                        // avoid certain attributes
-                                        continue;
-                                }
-                                var value;
-                                if (name != "style") {
-                                        // IE5.5 reports 25 when cellSpacing is
-                                        // 1; other values might be doomed too.
-                                        // For this reason we extract the
-                                        // values directly from the root node.
-                                        // I'm starting to HATE JavaScript
-                                        // development.  Browser differences
-                                        // suck.
-                                        //
-                                        // Using Gecko the values of href and src are converted to absolute links
-                                        // unless we get them using nodeValue()
-                                        if (typeof root[a.nodeName] != "undefined" && name != "href" && name != "src" && !/^on/.test(name)) {
-                                                value = root[a.nodeName];
-                                        } else {
-                                                value = a.nodeValue;
-                                                // IE seems not willing to return the original values - it converts to absolute
-                                                // links using a.nodeValue, a.value, a.stringValue, root.getAttribute("href")
-                                                // So we have to strip the baseurl manually -/
-                                                if (HTMLArea.is_ie && (name == "href" || name == "src")) {
-                                                        value = editor.stripBaseURL(value);
-                                                }
-                                        }
-                                } else { // IE fails to put style in attributes list
-                                        // FIXME: cssText reported by IE is UPPERCASE
-                                        value = root.style.cssText;
-                                }
-                                if (/(_moz|^$)/.test(value)) {
-                                        // Mozilla reports some special tags
-                                        // here; we don't need them.
-                                        continue;
-                                }
-                                html += " " + name + '="' + value + '"';
-                        }
-                        if (html != "") {
-                                html += closed ? " />" : ">";
-                        }
-                }
-                for (i = root.firstChild; i; i = i.nextSibling) {
-                        html += HTMLArea.getHTMLWrapper(i, true, editor);
-                }
-                if (outputRoot && !closed) {
-                        html += "</" + root.tagName.toLowerCase() + ">";
-                }
-                break;
-            case 3: // Node.TEXT_NODE
-                // If a text node is alone in an element and all spaces, replace it with an non breaking one
-                // This partially undoes the damage done by moz, which translates '&nbsp;'s into spaces in the data element
-                if ( !root.previousSibling && !root.nextSibling && root.data.match(/^\s*$/i) ) html = '&nbsp;';
-                else html = /^script|style$/i.test(root.parentNode.tagName) ? root.data : HTMLArea.htmlEncode(root.data);
-                break;
-            case 4: // Node.CDATA_SECTION_NODE
-                // FIXME: it seems we never get here, but I believe we should..
-                //        maybe a browser problem?--CDATA sections are converted to plain text nodes and normalized
-                // CDATA sections should go "as is" without further encoding
-                html = "<![CDATA[" + root.data + "]]>";
-                break;
-            case 8: // Node.COMMENT_NODE
-                html = "<!--" + root.data + "-->";
-                break;                // skip comments, for now.
-        }
-        return html;
-};
-
-HTMLArea.prototype.stripBaseURL = function(string) {
-        var baseurl = this.config.baseURL;
-
-        // strip to last directory in case baseurl points to a file
-        baseurl = baseurl.replace(/[^\/]+$/, '');
-        var basere = new RegExp(baseurl);
-        string = string.replace(basere, "");
-
-        // strip host-part of URL which is added by MSIE to links relative to server root
-        baseurl = baseurl.replace(/^(https?:\/\/[^\/]+)(.*)$/, '$1');
-        basere = new RegExp(baseurl);
-        return string.replace(basere, "");
-};
-
-String.prototype.trim = function() {
-        a = this.replace(/^\s+/, '');
-        return a.replace(/\s+$/, '');
-};
-
-// creates a rgb-style color from a number
-HTMLArea._makeColor = function(v) {
-        if (typeof v != "number") {
-                // already in rgb (hopefully); IE doesn't get here.
-                return v;
-        }
-        // IE sends number; convert to rgb.
-        var r = v & 0xFF;
-        var g = (v >> 8) & 0xFF;
-        var b = (v >> 16) & 0xFF;
-        return "rgb(" + r + "," + g + "," + b + ")";
-};
-
-// returns hexadecimal color representation from a number or a rgb-style color.
-HTMLArea._colorToRgb = function(v) {
-        if (!v)
-                return '';
-
-        // returns the hex representation of one byte (2 digits)
-        function hex(d) {
-                return (d < 16) ? ("0" + d.toString(16)) : d.toString(16);
-        };
-
-        if (typeof v == "number") {
-                // we're talking to IE here
-                var r = v & 0xFF;
-                var g = (v >> 8) & 0xFF;
-                var b = (v >> 16) & 0xFF;
-                return "#" + hex(r) + hex(g) + hex(b);
-        }
-
-        if (v.substr(0, 3) == "rgb") {
-                // in rgb(...) form -- Mozilla
-                var re = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;
-                if (v.match(re)) {
-                        var r = parseInt(RegExp.$1);
-                        var g = parseInt(RegExp.$2);
-                        var b = parseInt(RegExp.$3);
-                        return "#" + hex(r) + hex(g) + hex(b);
-                }
-                // doesn't match RE?!  maybe uses percentages or float numbers
-                // -- FIXME: not yet implemented.
-                return null;
-        }
-
-        if (v.substr(0, 1) == "#") {
-                // already hex rgb (hopefully :D )
-                return v;
-        }
-
-        // if everything else fails ;)
-        return null;
-};
-
-// modal dialogs for Mozilla (for IE we're using the showModalDialog() call).
-
-// receives an URL to the popup dialog and a function that receives one value;
-// this function will get called after the dialog is closed, with the return
-// value of the dialog.
-HTMLArea.prototype._popupDialog = function(url, action, init) {
-        Dialog(this.popupURL(url), action, init);
-};
-
-// paths
-
-HTMLArea.prototype.imgURL = function(file, plugin) {
-        if (typeof plugin == "undefined")
-                return _editor_url + file;
-        else
-                return _editor_url + "plugins/" + plugin + "/img/" + file;
-};
-
-HTMLArea.prototype.popupURL = function(file) {
-        var url = "";
-        if (file.match(/^plugin:\/\/(.*?)\/(.*)/)) {
-                var plugin = RegExp.$1;
-                var popup = RegExp.$2;
-                if (!/\.html$/.test(popup))
-                        popup += ".html";
-                url = _editor_url + "plugins/" + plugin + "/popups/" + popup;
-        } else
-                url = _editor_url + this.config.popupURL + file;
-        return url;
-};
-
-/**
- * FIX: Internet Explorer returns an item having the _name_ equal to the given
- * id, even if it's not having any id.  This way it can return a different form
- * field even if it's not a textarea.  This workarounds the problem by
- * specifically looking to search only elements having a certain tag name.
- */
-HTMLArea.getElementById = function(tag, id) {
-        var el, i, objs = document.getElementsByTagName(tag);
-        for (i = objs.length; --i >= 0 && (el = objs[i]);)
-                if (el.id == id)
-                        return el;
-        return null;
-};
-
-
-
-// EOF
-// Local variables: //
-// c-basic-offset:8 //
-// indent-tabs-mode:t //
-// End: //
\ No newline at end of file
Files 6171/e107_handlers/htmlarea/images/ed_about.gif and 75/e107_handlers/htmlarea/images/ed_about.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_align_center.gif and 75/e107_handlers/htmlarea/images/ed_align_center.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_align_justify.gif and 75/e107_handlers/htmlarea/images/ed_align_justify.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_align_left.gif and 75/e107_handlers/htmlarea/images/ed_align_left.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_align_right.gif and 75/e107_handlers/htmlarea/images/ed_align_right.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_blank.gif and 75/e107_handlers/htmlarea/images/ed_blank.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_charmap.gif and 75/e107_handlers/htmlarea/images/ed_charmap.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_color_bg.gif and 75/e107_handlers/htmlarea/images/ed_color_bg.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_color_fg.gif and 75/e107_handlers/htmlarea/images/ed_color_fg.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_copy.gif and 75/e107_handlers/htmlarea/images/ed_copy.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_custom.gif and 75/e107_handlers/htmlarea/images/ed_custom.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_cut.gif and 75/e107_handlers/htmlarea/images/ed_cut.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_delete.gif and 75/e107_handlers/htmlarea/images/ed_delete.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_format_bold.gif and 75/e107_handlers/htmlarea/images/ed_format_bold.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_format_italic.gif and 75/e107_handlers/htmlarea/images/ed_format_italic.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_format_strike.gif and 75/e107_handlers/htmlarea/images/ed_format_strike.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_format_sub.gif and 75/e107_handlers/htmlarea/images/ed_format_sub.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_format_sup.gif and 75/e107_handlers/htmlarea/images/ed_format_sup.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_format_underline.gif and 75/e107_handlers/htmlarea/images/ed_format_underline.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_help.gif and 75/e107_handlers/htmlarea/images/ed_help.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_hr.gif and 75/e107_handlers/htmlarea/images/ed_hr.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_html.gif and 75/e107_handlers/htmlarea/images/ed_html.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_image.gif and 75/e107_handlers/htmlarea/images/ed_image.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_indent_less.gif and 75/e107_handlers/htmlarea/images/ed_indent_less.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_indent_more.gif and 75/e107_handlers/htmlarea/images/ed_indent_more.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_left_to_right.gif and 75/e107_handlers/htmlarea/images/ed_left_to_right.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_link.gif and 75/e107_handlers/htmlarea/images/ed_link.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_list_bullet.gif and 75/e107_handlers/htmlarea/images/ed_list_bullet.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_list_num.gif and 75/e107_handlers/htmlarea/images/ed_list_num.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_paste.gif and 75/e107_handlers/htmlarea/images/ed_paste.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_print.gif and 75/e107_handlers/htmlarea/images/ed_print.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_redo.gif and 75/e107_handlers/htmlarea/images/ed_redo.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_right_to_left.gif and 75/e107_handlers/htmlarea/images/ed_right_to_left.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_rmformat.gif and 75/e107_handlers/htmlarea/images/ed_rmformat.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_save.gif and 75/e107_handlers/htmlarea/images/ed_save.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_save.png and 75/e107_handlers/htmlarea/images/ed_save.png differ
Files 6171/e107_handlers/htmlarea/images/ed_show_border.gif and 75/e107_handlers/htmlarea/images/ed_show_border.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_splitcel.gif and 75/e107_handlers/htmlarea/images/ed_splitcel.gif differ
Files 6171/e107_handlers/htmlarea/images/ed_undo.gif and 75/e107_handlers/htmlarea/images/ed_undo.gif differ
Files 6171/e107_handlers/htmlarea/images/fullscreen_maximize.gif and 75/e107_handlers/htmlarea/images/fullscreen_maximize.gif differ
Files 6171/e107_handlers/htmlarea/images/fullscreen_minimize.gif and 75/e107_handlers/htmlarea/images/fullscreen_minimize.gif differ
Files 6171/e107_handlers/htmlarea/images/insert_table.gif and 75/e107_handlers/htmlarea/images/insert_table.gif differ
diff -ruN 6171/e107_handlers/htmlarea/index.html 75/e107_handlers/htmlarea/index.html
--- 6171/e107_handlers/htmlarea/index.html	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/index.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,210 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
-<html>
-  <head>
-    <title>HTMLArea -- the free, customizable online editor</title>
-
-    <style type="text/css">
-      html, body { font-family: georgia,"times new roman",serif; background-color: #fff; color: #000; }
-      .label { text-align: right; padding-right: 0.3em; }
-      .bline { border-bottom: 1px solid #aaa; }
-    </style>
-  </head>
-
-  <body>
-    <div style="float: right; border: 1px solid #aaa; background-color: #eee; padding: 3px; margin-left: 10px; margin-bottom: 10px;">
-      <table cellspacing="0" cellpadding="0" border="0">
-        <tr>
-          <td class="label">Version:</td><td><% $version %></td>
-        </tr>
-        <tr>
-          <td class="label">Release:</td><td><% $release %> (<a href="release-notes.html">release notes</a>)</td>
-        </tr>
-        <tr>
-          <td class="label bline">Compiled at:</td><td class="bline"><% $time %></td>
-        </tr>
-        <tr>
-          <td class="label">SourceForge page:</td><td><a href="http://sf.net/projects/itools-htmlarea/">http://sf.net/projects/itools-htmlarea/</a></td>
-      </table>
-    </div>
-    <h1>HTMLArea -- the free<br/>customizable online editor</h1>
-
-    <p>
-      HTMLArea is a free, customizable online editor.  It works inside your
-      browser.  It uses a non-standard feature implemented in Internet
-      Explorer 5.5 or better for Windows and Mozilla 1.3 or better (any
-      platform), therefore it will only work in one of these browsers.
-    </p>
-
-    <p>
-      HTMLArea is copyright <a
-      href="http://interactivetools.com">InteractiveTools.com</a> and <a
-      href="http://dynarch.com">Dynarch.com</a> and it is
-      released under a BSD-style license.  HTMLArea is created and developed
-      upto version 2.03 by InteractiveTools.com.  Version 3.0 developed by
-      <a href="http://dynarch.com/mishoo/">Mihai Bazon</a> for
-      InteractiveTools.  It contains code sponsored by third-party companies as well.
-      Please see our About Box for details about who sponsored what plugins.
-    </p>
-
-    <h2><a href="examples/">Online demos</a></h2>
-
-    <ul>
-
-      <li><a href="examples/core.html">HTMLArea standard</a> -- contains the core
-        editor.</li>
-
-      <li><a href="examples/table-operations.html">HTMLArea + tables</a> --
-        loads the <tt>TableOperations</tt> plugin which provides some extra
-        editing features for tables.</li>
-
-      <li><a href="examples/spell-checker.html">HTMLArea + spell checher</a>
-        -- loads the <tt>SpellChecker</tt> plugin which provides what its
-        name says: a spell checker.  This one requires additional support on
-        the server-side.</li>
-
-      <li><a href="examples/full-page.html">HTMLArea Full HTML Editor</a> --
-        loads the <tt>FullPage</tt> plugin which allows you to edit a full
-        HTML page, including &lt;title&gt;, &lt;!DOCTYPE...&gt; and some
-        other options.</li>
-
-      <li><a href="examples/context-menu.html">HTMLArea with Context
-          Menu</a> -- this plugin provides a nice and useful context menu.</li>
-
-      <li><a href="examples/fully-loaded.html">HTMLArea fully loaded</a> --
-        all of the above. ;-)</li>
-
-    </ul>
-
-    <h2>Installation</h2>
-
-    <p>
-      Installation is (or should be) easy.  You need to unpack the ZIP file
-      in a directory accessible through your webserver.  Supposing you
-      unpack in your <tt>DocumentRoot</tt> and your <tt>DocumentRoot</tt> is
-      <tt>/var/www/html</tt> as in a standard RedHat installation, you need
-      to acomplish the following steps: (the example is for a Unix-like
-      operating system)
-    </p>
-
-    <pre style="margin-left: 2em"
->
-cd /var/www/html
-unzip /path/to/archive/<% $basename %>.zip
-mv <% $basename %> htmlarea
-find htmlarea/ -type f -exec chmod 644 {} \;
-find htmlarea/ -type d -exec chmod 755 {} \;
-find htmlarea/ -name "*.cgi" -exec chmod 755 {} \;</pre>
-
-    <p>
-      <strong>Notes.</strong> You may chose to symlink "htmlarea" to "<%
-      $basename %>", in which case your server needs to be configured to
-      "<tt>FollowSymLinks</tt>".  You need to make sure that *.cgi files are
-      interpreted as CGI scripts.  If you want to use the SpellChecker
-      plugin you need to have a recent version of Perl installed (I
-      recommend 5.8.0) on the server, and the module Text::Aspell, available
-      from CPAN.  More info in "<a
-      href="plugins/SpellChecker/readme-tech.html">plugins/SpellChecker/readme-tech.html</a>".
-    </p>
-
-    <p>About how to setup your pages to use the editor, please read the
-      [outdated yet generally valid] <a
-        href="reference.html">documentation</a>.</p>
-
-    <h2>Status and links</h2>
-
-    <p>HTMLArea has reached version 3.0.  As of this version, it
-      supports:</p>
-
-    <ul>
-
-      <li>Customizable toolbar</li>
-
-      <li>Easy internationalization</li>
-
-      <li>Plugin-based infrastructure</li>
-
-      <li>Delivers W3-compliant HTML (with few exceptions)</li>
-
-      <li>Has a subset of Microsoft Word's keyboard shortcuts</li>
-
-      <li>Full-screen editor</li>
-
-      <li>Advanced table operations (by external plugin
-        "TableOperations")</li>
-
-      <li>Spell checker (by external plugin "SpellChecker")</li>
-
-      <li>probably more... ;-)</li>
-
-    </ul>
-
-    <p>We have a <a
-    href="http://sourceforge.net/projects/itools-htmlarea/">project page</a>
-    at <a href="http://sourceforge.net">SourceForge.net</a>.  There you can
-    also find out <a href="http://sourceforge.net/cvs/?group_id=69750">how
-    to retrieve the code from CVS</a>, or you can <a
-    href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/itools-htmlarea">browse
-    the CVS online</a>.  We also have a <a
-    href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
-    system</a>, a <a
-    href="http://sourceforge.net/tracker/?atid=525658&group_id=69750&func=browse">patch
-    tracking system</a> and a <a
-    href="http://sourceforge.net/tracker/?atid=525659&group_id=69750&func=browse">feature
-    request page</a>.</p>
-
-    <p>We invite you to say everything you want about HTMLArea <a
-    href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">on the
-    forums</a> at InteractiveTools.com.  There you should also find the
-    latest news.</p>
-
-    <p>Sometimes I post news about the latest developments on <a
-    href="http://dynarch.com/mishoo/">my personal homepage</a>.</p>
-
-    <h2>"It doesn't work, what's wrong?"</h2>
-
-    <p>If it doesn't work, you have several options:</p>
-
-    <ul>
-
-      <li>Post a message to the forum.  Describe your problem in as much
-      detail as possible.  Include errors you might find in the JavaScript
-      console (if you are a Mozilla user), or errors displayed by IE (though
-      they're most of the times useless).</li>
-
-      <li>If you're positive that you discovered a bug in HTMLArea then feel
-      free to fill a bug report in our bug system.  If you have the time you
-      should check to see if a similar bug was reported or not; it might be
-      fixed already in the CVS ;-) If you're positive that a similar bug was
-      not yet reported, do fill a bug report and please include as much
-      detail as possible, such as your browser, OS, errors from JavaScript
-      console, etc.</li>
-
-      <li>If you want a new feature to be implemented, post it on the
-      features request and someone will hopefully take care of it.</li>
-
-    </ul>
-
-    <p>You can <a href="mailto:mihai_bazon@yahoo.com">contact me directly</a>
-    <em>only</em> if you want to pay me for implementing custom features to
-    HTMLArea.  If you want to sponsor these features (that is, allow them to
-    get back into the public HTMLArea distribution) I'll be cheaper. ;-)</p>
-
-    <hr />
-    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
-<!-- Created: Sun Aug  3 14:11:26 EEST 2003 -->
-<!-- hhmts start --> Last modified: Wed Jul 14 13:20:53 CEST 2004 <!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
-
-<%ARGS>
-  $project => 'HTMLArea'
-  $version => '3.0'
-  $release => 'rc1'
-  $basename => 'HTMLArea-3.0-rc1'
-</%ARGS>
-
-<%INIT>;
-use POSIX qw(strftime);
-my $time = strftime '%b %e, %Y [%H:%M] GMT', gmtime;
-</%INIT>
diff -ruN 6171/e107_handlers/htmlarea/index.php 75/e107_handlers/htmlarea/index.php
--- 6171/e107_handlers/htmlarea/index.php	2004-03-16 02:22:52.000000000 -0600
+++ 75/e107_handlers/htmlarea/index.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,92 +0,0 @@
-<html>
-<head>
-<title>HTMLArea 3.0 for e107</title>
-  <script type="text/javascript">
-   //   _editor_url = window.opener._editor_url;
-  //    _editor_lang = window.opener._editor_lang;
- //     var BASE = window.opener.document.baseURI || window.opener.document.URL;
-  //    var head = document.getElementsByTagName("head")[0];
- //     var base = document.createElement("base");
- //     base.href = BASE;
- //     head.appendChild(base);
-    </script>
-
-<script type="text/javascript" src="htmlarea.js"></script>
-
-
-<script type="text/javascript" src="htmlarea-lang-en.js"></script>
-<script type="text/javascript" src="dialog.js"></script>
-<script type="text/javascript" src="editor.js"></script>
-
-
-
-<style type="text/css">
-@import url(htmlarea.css);
-
-html, body {
-  font-family: Verdana,sans-serif;
-  background-color: #ddd;
-  color: #000;
-}
-a:link, a:visited { color: #00f; }
-a:hover { color: #048; }
-a:active { color: #f00; }
-
-textarea { background-color: #fff; border: 1px solid 00f; }
-</style>
-
-<script type="text/javascript">
-var editor = null;
-function initEditor() {
-  editor = new HTMLArea("ta");
-  editor.generate();
-
-}
-function insertHTML() {
-  var html = prompt("Enter some HTML code here");
-  if (html) {
-    editor.insertHTML(html);
-  }
-}
-function highlight() {
-  editor.surroundHTML('<span style="background:yellow">', '</span>');
-}
-
-function updateOpener(){
-        htmresult = editor.getHTML();
-      opener.document.forms.dataform.data.value = htmresult;
-   //      parent_object.setHTML(editor.getInnerHTML());
-        window.close()
-}
-
-</script>
-
-</head>
-
-<!-- use <body onload="initEditor()"> if you don't care about
-     customizing the editor.  It's the easiest way! :)
-         <body onload="HTMLArea.replaceAll()"> -->
-<body onload="initEditor()">
-
-HTMLArea &copy; <a href="http://interactivetools.com">InteractiveTools.com</a>, 2003.</p>
-
-<form method="POST" action="" name="mainform">
-
-<textarea id="ta" name='ta' style="width:60%" rows="20"></textarea>
-
-<p>
-
-<input class="button" type="button" value="Finished" onClick="updateOpener()">
-<input class="button" type="button" value="Cancel" onClick="window.close()">
-
-<input type="button" name="ins" value="  insert html  " onclick="return insertHTML();" />
-<input type="button" name="hil" value="  highlight text  " onclick="return highlight();" />
-
-<script type="text/javascript">
-document.forms.mainform.ta.value = opener.document.forms.dataform.data.value
-</script>
-
-</form>
-
-</body>
-</html>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/lang/b5.js 75/e107_handlers/htmlarea/lang/b5.js
--- 6171/e107_handlers/htmlarea/lang/b5.js	2004-03-15 16:36:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/b5.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,36 +0,0 @@
-// I18N constants -- Chinese Big-5
-// by Dave Lo -- dlo@interactivetools.com
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "b5",
-
-	tooltips: {
-		bold:           "",
-		italic:         "",
-		underline:      "u",
-		strikethrough:  "Ru",
-		subscript:      "U",
-		superscript:    "W",
-		justifyleft:    "ma",
-		justifycenter:  "m~",
-		justifyright:   "mak",
-		justifyfull:    "mk",
-		orderedlist:    "ǲM",
-		unorderedlist:  "LǲM",
-		outdent:        "peť",
-		indent:         "[eeť",
-		forecolor:      "rC",
-		backcolor:      "IC",
-		horizontalrule: "u",
-		createlink:     "Js",
-		insertimage:    "Jϧ",
-		inserttable:    "J",
-		htmlmode:       "HTMLlX",
-		popupeditor:    "j",
-		about:          " HTMLArea",
-		help:           "",
-		textindicator:  "rҤl"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/ch.js 75/e107_handlers/htmlarea/lang/ch.js
--- 6171/e107_handlers/htmlarea/lang/ch.js	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/ch.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,83 +0,0 @@
-// I18N constants
-
-// LANG: "ch", ENCODING: UTF-8
-// Samuel Stone, http://stonemicro.com/
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "ch",
-
-	tooltips: {
-		bold:           "粗體",
-		italic:         "斜體",
-		underline:      "底線",
-		strikethrough:  "刪線",
-		subscript:      "下標",
-		superscript:    "上標",
-		justifyleft:    "靠左",
-		justifycenter:  "居中",
-		justifyright:   "靠右",
-		justifyfull:    "整齊",
-		orderedlist:    "順序清單",
-		unorderedlist:  "無序清單",
-		outdent:        "伸排",
-		indent:         "縮排",
-		forecolor:      "文字顏色",
-		backcolor:      "背景顏色",
-		horizontalrule: "水平線",
-		createlink:     "插入連結",
-		insertimage:    "插入圖像",
-		inserttable:    "插入表格",
-		htmlmode:       "切換HTML原始碼",
-		popupeditor:    "伸出編輯系統",
-		about:          "關於 HTMLArea",
-		help:           "說明",
-		textindicator:  "字體例子",
-		undo:           "回原",
-		redo:           "重来",
-		cut:            "剪制选项",
-		copy:           "复制选项",
-		paste:          "贴上",
-		lefttoright:    "从左到右",
-		righttoleft:    "从右到左"
-	},
-
-	buttons: {
-		"ok":           "好",
-		"cancel":       "取消"
-	},
-
-	msg: {
-		"Path":         "途徑",
-		"TEXT_MODE":    "你在用純字編輯方式.  用 [<>] 按鈕轉回 所見即所得 編輯方式.",
-
-		"IE-sucks-full-screen" :
-		// translate here
-		"整頁式在Internet Explorer 上常出問題, " +
-		"因為這是 Internet Explorer 的無名問題，我們無法解決。" +
-		"你可能看見一些垃圾，或遇到其他問題。" +
-		"我們已警告了你. 如果要轉到 正頁式 請按 好.",
-
-		"Moz-Clipboard" :
-		"Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
-		"for security reasons.  Click OK to see a technical note at mozilla.org " +
-		"which shows you how to allow a script to access the clipboard."
-	},
-
-	dialogs: {
-		"Cancel"                                            : "取消",
-		"Insert/Modify Link"                                : "插入/改寫連結",
-		"New window (_blank)"                               : "新窗户(_blank)",
-		"None (use implicit)"                               : "無(use implicit)",
-		"OK"                                                : "好",
-		"Other"                                             : "其他",
-		"Same frame (_self)"                                : "本匡 (_self)",
-		"Target:"                                           : "目標匡:",
-		"Title (tooltip):"                                  : "主題 (tooltip):",
-		"Top frame (_top)"                                  : "上匡 (_top)",
-		"URL:"                                              : "網址:",
-		"You must enter the URL where this link points to"  : "你必須輸入你要连结的網址"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/cz.js 75/e107_handlers/htmlarea/lang/cz.js
--- 6171/e107_handlers/htmlarea/lang/cz.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/cz.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,63 +0,0 @@
-﻿// I18N constants

-

-// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2

-// Author: Jiri Löw, <jirilow@jirilow.com>

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-HTMLArea.I18N = {

-

-	// the following should be the filename without .js extension

-	// it will be used for automatically load plugin language.

-	lang: "cz",

-

-	tooltips: {

-		bold:           "Tučně",

-		italic:         "Kurzíva",

-		underline:      "Podtržení",

-		strikethrough:  "Přeškrtnutí",

-		subscript:      "Dolní index",

-		superscript:    "Horní index",

-		justifyleft:    "Zarovnat doleva",

-		justifycenter:  "Na střed",

-		justifyright:   "Zarovnat doprava",

-		justifyfull:    "Zarovnat do stran",

-		orderedlist:    "Seznam",

-		unorderedlist:  "Odrážky",

-		outdent:        "Předsadit",

-		indent:         "Odsadit",

-		forecolor:      "Barva písma",

-		hilitecolor:    "Barva pozadí",

-		horizontalrule: "Vodorovná čára",

-		createlink:     "Vložit odkaz",

-		insertimage:    "Vložit obrázek",

-		inserttable:    "Vložit tabulku",

-		htmlmode:       "Přepnout HTML",

-		popupeditor:    "Nové okno editoru",

-		about:          "O této aplikaci",

-		showhelp:       "Nápověda aplikace",

-		textindicator:  "Zvolený styl",

-		undo:           "Vrátí poslední akci",

-		redo:           "Opakuje poslední akci",

-		cut:            "Vyjmout",

-		copy:           "Kopírovat",

-		paste:          "Vložit"

-	},

-

-	buttons: {

-		"ok":           "OK",

-		"cancel":       "Zrušit"

-	},

-

-	msg: {

-		"Path":         "Cesta",

-		"TEXT_MODE":    "Jste v TEXTOVÉM REŽIMU.  Použijte tlačítko [<>] pro přepnutí do WYSIWIG."

-	}

-};

diff -ruN 6171/e107_handlers/htmlarea/lang/da.js 75/e107_handlers/htmlarea/lang/da.js
--- 6171/e107_handlers/htmlarea/lang/da.js	2004-03-15 16:36:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/da.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,38 +0,0 @@
-// danish version for htmlArea v3.0 - Alpha Release
-// - translated by rene<rene@laerke.net>
-// terms and licenses are equal to htmlarea!
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "da",
-
-	tooltips: {
-		bold:           "Fed",
-		italic:         "Kursiv",
-		underline:      "Understregning",
-		strikethrough:  "Overstregning ",
-		subscript:      "Snket skrift",
-		superscript:    "Hvet skrift",
-		justifyleft:    "Venstrejuster",
-		justifycenter:  "Centrer",
-		justifyright:   "Hjrejuster",
-		justifyfull:    "Lige margener",
-		orderedlist:    "Opstilling med tal",
-		unorderedlist:  "Opstilling med punkttegn",
-		outdent:        "Formindsk indrykning",
-		indent:         "Forg indrykning",
-		forecolor:      "Skriftfarve",
-		backcolor:      "Baggrundsfarve",
-		horizontalrule: "Horisontal linie",
-		createlink:     "Indst hyperlink",
-		insertimage:    "Indst billede",
-		inserttable:    "Indst tabel",
-		htmlmode:       "HTML visning",
-		popupeditor:    "Vis editor i popup",
-		about:          "Om htmlarea",
-		help:           "Hjlp",
-		textindicator:  "Anvendt stil"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/de.js 75/e107_handlers/htmlarea/lang/de.js
--- 6171/e107_handlers/htmlarea/lang/de.js	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/de.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,80 +0,0 @@
-// I18N constants
-
-// LANG: "de", ENCODING: ISO-8859-1 for the german umlaut!
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "de",
-
-	tooltips: {
-		bold:           "Fett",
-		italic:         "Kursiv",
-		underline:      "Unterstrichen",
-		strikethrough:  "Durchgestrichen",
-		subscript:      "Hochgestellt",
-		superscript:    "Tiefgestellt",
-        justifyleft:            "Linksbndig",
-        justifycenter:          "Zentriert",
-        justifyright:           "Rechtsbndig",
-		justifyfull:    "Blocksatz",
-        orderedlist:      "Nummerierung",
-        unorderedlist:    "Aufzhlungszeichen",
-		outdent:        "Einzug verkleinern",
-        indent:                 "Einzug vergrern",
-        forecolor:              "Schriftfarbe",
-        backcolor:              "Hindergrundfarbe",
-        hilitecolor:            "Hintergrundfarbe",
-		horizontalrule: "Horizontale Linie",
-        inserthorizontalrule:   "Horizontale Linie",
-        createlink:             "Hyperlink einfgen",
-        insertimage:            "Bild einfgen",
-        inserttable:            "Tabelle einfgen",
-		htmlmode:       "HTML Modus",
-		popupeditor:    "Editor im Popup ffnen",
-        about:                  "ber htmlarea",
-        help:                   "Hilfe",
-		showhelp:       "Hilfe",
-        textindicator:          "Derzeitiger Stil",
-        undo:                   "Rckgngig",
-		redo:           "Wiederholen",
-		cut:            "Ausschneiden",
-		copy:           "Kopieren",
-        paste:                  "Einfgen aus der Zwischenablage",
-        lefttoright:            "Textrichtung von Links nach Rechts",
-        righttoleft:            "Textrichtung von Rechts nach Links",
-        removeformat:            "Formatierung entfernen"
-	},
-  
- buttons: {
-		"ok":           "OK",
-		"cancel":       "Abbrechen"
-	},
-
-	msg: {
-		"Path":         "Pfad",
-        "TEXT_MODE":            "Sie sind im Text-Modus. Benutzen Sie den [<>] Knopf um in den visuellen Modus (WYSIWIG) zu gelangen.",
-
-        "Moz-Clipboard" :
-        "Aus Sicherheitsgrnden drfen Skripte normalerweise nicht programmtechnisch auf " +
-        "Ausschneiden/Kopieren/Einfgen zugreifen. Bitte klicken Sie OK um die technische " +
-        "Erluterung auf mozilla.org zu ffnen, in der erklrt wird, wie einem Skript Zugriff " +
-        "gewhrt werden kann."
-    },
-    
-    dialogs: {
-        "OK":                   "OK",
-        "Cancel":               "Abbrechen",
-        "Insert/Modify Link":   "Verknpfung hinzufgen/ndern",
-        "None (use implicit)":  "k.A. (implizit)",
-        "New window (_blank)":  "Neues Fenster (_blank)",
-        "Same frame (_self)":   "Selber Rahmen (_self)",
-        "Top frame (_top)":     "Oberster Rahmen (_top)",
-        "Other":                "Anderes",
-        "Target:":              "Ziel:",
-        "Title (tooltip):":     "Titel (Tooltip):",
-        "URL:":                 "URL:",
-        "You must enter the URL where this link points to": "Sie mssen eine Ziel-URL angeben fr die Verknpfung angeben"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/ee.js 75/e107_handlers/htmlarea/lang/ee.js
--- 6171/e107_handlers/htmlarea/lang/ee.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/ee.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,63 +0,0 @@
-// I18N constants
-
-// LANG: "ee", ENCODING: UTF-8 | ISO-8859-1
-// Author: Martin Raie, <albertvill@hot.ee>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "ee",
-
-	tooltips: {
-		bold:           "Paks",
-		italic:         "Kursiiv",
-		underline:      "Allakriipsutatud",
-		strikethrough:  "Lbikriipsutatud",
-		subscript:      "Allindeks",
-		superscript:    "laindeks",
-		justifyleft:    "Joonda vasakule",
-		justifycenter:  "Joonda keskele",
-		justifyright:   "Joonda paremale",
-		justifyfull:    "Rpjoonda",
-		orderedlist:    "Nummerdus",
-		unorderedlist:  "Tpploend",
-		outdent:        "Vhenda taanet",
-		indent:         "Suurenda taanet",
-		forecolor:      "Fondi vrv",
-		hilitecolor:    "Tausta vrv",
-		inserthorizontalrule: "Horisontaaljoon",
-		createlink:     "Lisa viit",
-		insertimage:    "Lisa pilt",
-		inserttable:    "Lisa tabel",
-		htmlmode:       "HTML/tavaline vaade",
-		popupeditor:    "Suurenda toimeti aken",
-		about:          "Teave toimeti kohta",
-		showhelp:       "Spikker",
-		textindicator:  "Kirjastiil",
-		undo:           "Vta tagasi",
-		redo:           "Tee uuesti",
-		cut:            "Lika",
-		copy:           "Kopeeri",
-		paste:          "Kleebi"
-	},
-
-	buttons: {
-		"ok":           "OK",
-		"cancel":       "Loobu"
-	},
-
-	msg: {
-		"Path":         "Path",
-		"TEXT_MODE":    "Sa oled tekstireziimis.  Kasuta nuppu [<>] llitamaks tagasi WYSIWIG reziimi."
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/el.js 75/e107_handlers/htmlarea/lang/el.js
--- 6171/e107_handlers/htmlarea/lang/el.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/el.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,75 +0,0 @@
-// I18N constants
-
-// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
-// Author: Dimitris Glezos, dimitris@glezos.com
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "el",
-
-	tooltips: {
-		bold:           "Έντονα",
-		italic:         "Πλάγια",
-		underline:      "Υπογραμμισμένα",
-		strikethrough:  "Διαγραμμένα",
-		subscript:      "Δείκτης",
-		superscript:    "Δείκτης",
-		justifyleft:    "Στοίχιση Αριστερά",
-		justifycenter:  "Στοίχιση Κέντρο",
-		justifyright:   "Στοίχιση Δεξιά",
-		justifyfull:    "Πλήρης Στοίχιση",
-		orderedlist:    "Αρίθμηση",
-		unorderedlist:  "Κουκκίδες",
-		outdent:        "Μείωση Εσοχής",
-		indent:         "Αύξηση Εσοχής",
-		forecolor:      "Χρώμα Γραμματοσειράς",
-		hilitecolor:    "Χρώμα Φόντου",
-		horizontalrule: "Οριζόντια Γραμμή",
-		createlink:     "Εισαγωγή Συνδέσμου",
-		insertimage:    "Εισαγωγή/Τροποποίηση Εικόνας",
-		inserttable:    "Εισαγωγή Πίνακα",
-		htmlmode:       "Εναλλαγή σε/από HTML",
-		popupeditor:    "Μεγένθυνση επεξεργαστή",
-		about:          "Πληροφορίες",
-		showhelp:       "Βοήθεια",
-		textindicator:  "Παρών στυλ",
-		undo:           "Αναίρεση τελευταίας ενέργειας",
-		redo:           "Επαναφορά από αναίρεση",
-		cut:            "Αποκοπή",
-		copy:           "Αντιγραφή",
-		paste:          "Επικόλληση",
-        lefttoright:    "Κατεύθυνση αριστερά προς δεξιά",
-        righttoleft:    "Κατεύθυνση από δεξιά προς τα αριστερά"
-	},
-
-	buttons: {
-		"ok":           "OK",
-		"cancel":       "Ακύρωση"
-	},
-
-	msg: {
-		"Path":         "Διαδρομή",
-		"TEXT_MODE":    "Είστε σε TEXT MODE.  Χρησιμοποιήστε το κουμπί [<>] για να επανέρθετε στο WYSIWIG.",
-
-       "IE-sucks-full-screen":	"Η κατάσταση πλήρης οθόνης έχει προβλήματα με τον Internet Explorer, " +
-       							"λόγω σφαλμάτων στον ίδιο τον browser.  Αν το σύστημα σας είναι Windows 9x " +
-       							"μπορεί και να χρειαστείτε reboot. Αν είστε σίγουροι, πατήστε ΟΚ."
-       },
-
-       dialogs: {
-               "Cancel"                                            : "Ακύρωση",
-               "Insert/Modify Link"                                : "Εισαγωγή/Τροποποίηση σύνδεσμου",
-               "New window (_blank)"                               : "Νέο παράθυρο (_blank)",
-               "None (use implicit)"                               : "Κανένα (χρήση απόλυτου)",
-               "OK"                                                : "Εντάξει",
-               "Other"                                             : "Αλλο",
-               "Same frame (_self)"                                : "Ίδιο frame (_self)",
-               "Target:"                                           : "Target:",
-               "Title (tooltip):"                                  : "Τίτλος (tooltip):",
-               "Top frame (_top)"                                  : "Πάνω frame (_top)",
-               "URL:"                                              : "URL:",
-               "You must enter the URL where this link points to"  : "Πρέπει να εισάγετε το URL που οδηγεί αυτός ο σύνδεσμος"
-       }
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/en.js 75/e107_handlers/htmlarea/lang/en.js
--- 6171/e107_handlers/htmlarea/lang/en.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,93 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "en",
-
-	tooltips: {
-		bold:           "Bold",
-		italic:         "Italic",
-		underline:      "Underline",
-		strikethrough:  "Strikethrough",
-		subscript:      "Subscript",
-		superscript:    "Superscript",
-		justifyleft:    "Justify Left",
-		justifycenter:  "Justify Center",
-		justifyright:   "Justify Right",
-		justifyfull:    "Justify Full",
-		orderedlist:    "Ordered List",
-		unorderedlist:  "Bulleted List",
-		outdent:        "Decrease Indent",
-		indent:         "Increase Indent",
-		forecolor:      "Font Color",
-		hilitecolor:    "Background Color",
-		horizontalrule: "Horizontal Rule",
-		createlink:     "Insert Web Link",
-		insertimage:    "Insert/Modify Image",
-		inserttable:    "Insert Table",
-		htmlmode:       "Toggle HTML Source",
-		popupeditor:    "Enlarge Editor",
-		about:          "About this editor",
-		showhelp:       "Help using editor",
-		textindicator:  "Current style",
-		undo:           "Undoes your last action",
-		redo:           "Redoes your last action",
-		cut:            "Cut selection",
-		copy:           "Copy selection",
-		paste:          "Paste from clipboard",
-		lefttoright:    "Direction left to right",
-		righttoleft:    "Direction right to left"
-	},
-
-	buttons: {
-		"ok":           "OK",
-		"cancel":       "Cancel"
-	},
-
-	msg: {
-		"Path":         "Path",
-		"TEXT_MODE":    "You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.",
-
-		"IE-sucks-full-screen" :
-		// translate here
-		"The full screen mode is known to cause problems with Internet Explorer, " +
-		"due to browser bugs that we weren't able to workaround.  You might experience garbage " +
-		"display, lack of editor functions and/or random browser crashes.  If your system is Windows 9x " +
-		"it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" +
-		"You have been warned.  Please press OK if you still want to try the full screen editor.",
-
-		"Moz-Clipboard" :
-		"Unprivileged scripts cannot access Cut/Copy/Paste programatically " +
-		"for security reasons.  Click OK to see a technical note at mozilla.org " +
-		"which shows you how to allow a script to access the clipboard."
-	},
-
-	dialogs: {
-		"Cancel"                                            : "Cancel",
-		"Insert/Modify Link"                                : "Insert/Modify Link",
-		"New window (_blank)"                               : "New window (_blank)",
-		"None (use implicit)"                               : "None (use implicit)",
-		"OK"                                                : "OK",
-		"Other"                                             : "Other",
-		"Same frame (_self)"                                : "Same frame (_self)",
-		"Target:"                                           : "Target:",
-		"Title (tooltip):"                                  : "Title (tooltip):",
-		"Top frame (_top)"                                  : "Top frame (_top)",
-		"URL:"                                              : "URL:",
-		"You must enter the URL where this link points to"  : "You must enter the URL where this link points to"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/es.js 75/e107_handlers/htmlarea/lang/es.js
--- 6171/e107_handlers/htmlarea/lang/es.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/es.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,51 +0,0 @@
-// I18N constants
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "es",
-
-	tooltips: {
-		bold:           "Negrita",
-		italic:         "Cursiva",
-		underline:      "Subrayado",
-		strikethrough:  "Tachado",
-		subscript:      "Subndice",
-		superscript:    "Superndice",
-		justifyleft:    "Alinear a la Izquierda",
-		justifycenter:  "Centrar",
-		justifyright:   "Alinear a la Derecha",
-		justifyfull:    "Justificar",
-		orderedlist:    "Lista Ordenada",
-		unorderedlist:  "Lista No Ordenada",
-		outdent:        "Aumentar Sangra",
-		indent:         "Disminuir Sangra",
-		forecolor:      "Color del Texto",
-		hilitecolor:    "Color del Fondo",
-		inserthorizontalrule: "Lnea Horizontal",
-		createlink:     "Insertar Enlace",
-		insertimage:    "Insertar Imagen",
-		inserttable:    "Insertar Tabla",
-		htmlmode:       "Ver Documento en HTML",
-		popupeditor:    "Ampliar Editor",
-		about:          "Acerca del Editor",
-		showhelp:       "Ayuda",
-		textindicator:  "Estilo Actual",
-		undo:           "Deshacer",
-		redo:           "Rehacer",
-		cut:            "Cortar seleccin",
-		copy:           "Copiar seleccin",
-		paste:          "Pegar desde el portapapeles"
-	},
-
-	buttons: {
-		"ok":           "Aceptar",
-		"cancel":       "Cancelar"
-	},
-
-	msg: {
-		"Path":         "Ruta",
-		"TEXT_MODE":    "Esta en modo TEXTO. Use el boton [<>] para cambiar a WYSIWIG",
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/fi.js 75/e107_handlers/htmlarea/lang/fi.js
--- 6171/e107_handlers/htmlarea/lang/fi.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/fi.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,46 +0,0 @@
-// I18N constants
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "en",
-
-	tooltips: {
-		bold:           	"Lihavoitu",
-		italic:         	"Kursivoitu",
-		underline:      	"Alleviivattu",
-		strikethrough:  	"Yliviivattu",
-		subscript:      	"Alaindeksi",
-		superscript:    	"Ylindeksi",
-		justifyleft:    	"Tasaa vasemmat reunat",
-		justifycenter:  	"Keskit",
-		justifyright:   	"Tasaa oikeat reunat",
-		justifyfull:    	"Tasaa molemmat reunat",
-		orderedlist: 	"Numerointi",
-		unorderedlist: 	"Luettelomerkit",
-		outdent:        	"Lis sisennyst",
-		indent:         	"Pienenn sisennyst",
-		forecolor:      	"Fontin vri",
-		hilitecolor:    	"Taustavri",
-		inserthorizontalrule: 	"Vaakaviiva",
-		createlink:     	"Lis Linkki",
-		insertimage:    	"Lis Kuva",
-		inserttable:    	"Lis Taulu",
-		htmlmode:       	"HTML Lhdekoodi vs WYSIWYG",
-		popupeditor:    	"Suurenna Editori",
-		about:          	"Tietoja Editorista",
-		showhelp:           	"Nyt Ohje",
-		textindicator:  	"Nykyinen tyyli",
-		undo:           	"Peruuta viimeinen toiminto",
-		redo:           	"Palauta viimeinen toiminto",
-		cut:            	"Leikkaa maalattu",
-		copy:           	"Kopioi maalattu",
-		paste:          	"Liit leikepydlt"
-	},
-
-	buttons: {
-		"ok":           	"Hyvksy",
-		"cancel":       	"Peruuta"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/fr.js 75/e107_handlers/htmlarea/lang/fr.js
--- 6171/e107_handlers/htmlarea/lang/fr.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/fr.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,97 +0,0 @@
-// I18N constants
-
-// LANG: "fr", ENCODING: UTF-8 | ISO-8859-1
-// Author: Simon Richard, s.rich@sympatico.ca
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-// All technical terms used in this document are the ones approved
-// by the Office qubcois de la langue franaise.
-// Tous les termes techniques utiliss dans ce document sont ceux
-// approuvs par l'Office qubcois de la langue franaise.
-// http://www.oqlf.gouv.qc.ca/
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "fr",
-
-	tooltips: {
-		bold:           "Gras",
-		italic:         "Italique",
-		underline:      "Soulign",
-		strikethrough:  "Barr",
-		subscript:      "Indice",
-		superscript:    "Exposant",
-		justifyleft:    "Align  gauche",
-		justifycenter:  "Centr",
-		justifyright:   "Align  droite",
-		justifyfull:    "Justifier",
-		orderedlist:    "Numrotation",
-		unorderedlist:  "Puces",
-		outdent:        "Diminuer le retrait",
-		indent:         "Augmenter le retrait",
-		forecolor:      "Couleur de police",
-		hilitecolor:    "Surlignage",
-		horizontalrule: "Ligne horizontale",
-		createlink:     "Insrer un hyperlien",
-		insertimage:    "Insrer/Modifier une image",
-		inserttable:    "Insrer un tableau",
-		htmlmode:       "Passer au code source",
-		popupeditor:    "Agrandir l'diteur",
-		about:          " propos de cet diteur",
-		showhelp:       "Aide sur l'diteur",
-		textindicator:  "Style courant",
-		undo:           "Annuler la dernire action",
-		redo:           "Rpter la dernire action",
-		cut:            "Couper la slection",
-		copy:           "Copier la slection",
-		paste:          "Coller depuis le presse-papier",
-		lefttoright:    "Direction de gauche  droite",
-		righttoleft:    "Direction de droite  gauche"
-	},
-
-	buttons: {
-		"ok":           "OK",
-		"cancel":       "Annuler"
-	},
-
-	msg: {
-		"Path":         "Chemin",
-		"TEXT_MODE":    "Vous tes en MODE TEXTE.  Appuyez sur le bouton [<>] pour retourner au mode tel-tel.",
-
-		"IE-sucks-full-screen" :
-		// translate here
-		"Le mode plein cran peut causer des problmes sous Internet Explorer, " +
-		"ceci d  des bogues du navigateur qui ont t impossible  contourner.  " +
-		"Les diffrents symptmes peuvent tre un affichage dficient, le manque de " +
-		"fonctions dans l'diteur et/ou pannes alatoires du navigateur.  Si votre " +
-		"systme est Windows 9x, il est possible que vous subissiez une erreur de type " +
-		"General Protection Fault et que vous ayez  redmarrer votre ordinateur." +
-		"\n\nConsidrez-vous comme ayant t avis.  Appuyez sur OK si vous dsirez tout " +
-		"de mme essayer le mode plein cran de l'diteur."
-	},
-
-	dialogs: {
-		"Cancel"                                            : "Annuler",
-		"Insert/Modify Link"                                : "Insrer/Modifier Lien",
-		"New window (_blank)"                               : "Nouvelle fentre (_blank)",
-		"None (use implicit)"                               : "Aucun (par dfaut)",
-		"OK"                                                : "OK",
-		"Other"                                             : "Autre",
-		"Same frame (_self)"                                : "Mme cadre (_self)",
-		"Target:"                                           : "Cible:",
-		"Title (tooltip):"                                  : "Titre (infobulle):",
-		"Top frame (_top)"                                  : "Cadre du haut (_top)",
-		"URL:"                                              : "Adresse Web:",
-		"You must enter the URL where this link points to"  : "Vous devez entrer l'adresse Web du lien"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/gb.js 75/e107_handlers/htmlarea/lang/gb.js
--- 6171/e107_handlers/htmlarea/lang/gb.js	2004-03-15 16:36:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/gb.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,36 +0,0 @@
-// I18N constants -- Chinese GB
-// by Dave Lo -- dlo@interactivetools.com
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "gb",
-
-	tooltips: {
-		bold:           "",
-		italic:         "б",
-		underline:      "",
-		strikethrough:  "ɾ",
-		subscript:      "±",
-		superscript:    "ϱ",
-		justifyleft:    "λÿ",
-		justifycenter:  "λþ",
-		justifyright:   "λÿ",
-		justifyfull:    "λƽ",
-		orderedlist:    "˳嵥",
-		unorderedlist:  "嵥",
-		outdent:        "Сǰհ",
-		indent:         "ӿǰհ",
-		forecolor:      "ɫ",
-		backcolor:      "ɫ",
-		horizontalrule: "ˮƽ",
-		createlink:     "",
-		insertimage:    "ͼ",
-		inserttable:    "",
-		htmlmode:       "лHTMLԭʼ",
-		popupeditor:    "Ŵ",
-		about:          " HTMLArea",
-		help:           "˵",
-		textindicator:  ""
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/he.js 75/e107_handlers/htmlarea/lang/he.js
--- 6171/e107_handlers/htmlarea/lang/he.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/he.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,89 +0,0 @@
-// I18N constants

-

-// LANG: "he", ENCODING: UTF-8

-// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-HTMLArea.I18N = {

-

-	// the following should be the filename without .js extension

-	// it will be used for automatically load plugin language.

-	lang: "he",

-

-	tooltips: {

-		bold:           "מודגש",

-		italic:         "נטוי",

-		underline:      "קו תחתי",

-		strikethrough:  "קו אמצע",

-		subscript:      "כתב עילי",

-		superscript:    "כתב תחתי",

-		justifyleft:    " ישור לשמאל",

-		justifycenter:  "ישור למרכז",

-		justifyright:   "ישור לימין",

-		justifyfull:    "ישור לשורה מלאה",

-		orderedlist:    "רשימה ממוספרת",

-		unorderedlist:  "רשימה לא ממוספרת",

-		outdent:        "הקטן כניסה",

-		indent:         "הגדל כניסה",

-		forecolor:      "צבע גופן",

-		hilitecolor:    "צבע רקע",

-		horizontalrule: "קו אנכי",

-		createlink:     "הכנס היפר-קישור",

-		insertimage:    "הכנס/שנה תמונה",

-		inserttable:    "הכנס טבלה",

-		htmlmode:       "שנה מצב קוד HTML",

-		popupeditor:    "הגדל את העורך",

-		about:          "אודות עורך זה",

-		showhelp:       "עזרה לשימוש בעורך",

-		textindicator:  "סגנון נוכחי",

-		undo:           "מבטל את פעולתך האחרונה",

-		redo:           "מבצע מחדש את הפעולה האחרונה שביטלת",

-		cut:            "גזור בחירה",

-		copy:           "העתק בחירה",

-		paste:          "הדבק מהלוח",

-		lefttoright:    "כיוון משמאל לימין",

-		righttoleft:    "כיוון מימין לשמאל"

-	},

-

-	buttons: {

-		"ok":           "אישור",

-		"cancel":       "ביטול"

-	},

-

-	msg: {

-		"Path":         "נתיב עיצוב",

-		"TEXT_MODE":    "אתה במצב טקסט נקי (קוד). השתמש בכפתור [<>] כדי לחזור למצב WYSIWYG (תצוגת עיצוב).",

-

-		"IE-sucks-full-screen" :

-		// translate here

-		"מצב מסך מלא יוצר בעיות בדפדפן Internet Explorer, " +

-		"עקב באגים בדפדפן לא יכולנו לפתור את זה.  את/ה עלול/ה לחוות תצוגת זבל,  " +

-		"בעיות בתפקוד העורך ו/או קריסה של הדפדפן.  אם המערכת שלך היא Windows 9x " +

-		"סביר להניח שתקבל/י 'General Protection Fault' ותאלצ/י לאתחל את המחשב.\n\n" +

-		"ראה/י הוזהרת.  אנא לחץ/י אישור אם את/ה עדיין רוצה לנסות את העורך במסך מלא."

-	},

-

-	dialogs: {

-		"Cancel"                                            : "ביטול",

-		"Insert/Modify Link"                                : "הוסף/שנה קישור",

-		"New window (_blank)"                               : "חלון חדש (_blank)",

-		"None (use implicit)"                               : "ללא (השתמש ב-frame הקיים)",

-		"OK"                                                : "OK",

-		"Other"                                             : "אחר",

-		"Same frame (_self)"                                : "אותו frame (_self)",

-		"Target:"                                           : "יעד:",

-		"Title (tooltip):"                                  : "כותרת (tooltip):",

-		"Top frame (_top)"                                  : "Frame עליון (_top)",

-		"URL:"                                              : "URL:",

-		"You must enter the URL where this link points to"  : "חובה לכתוב URL שאליו קישור זה מצביע"

-

-	}

-};

diff -ruN 6171/e107_handlers/htmlarea/lang/hu.js 75/e107_handlers/htmlarea/lang/hu.js
--- 6171/e107_handlers/htmlarea/lang/hu.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/hu.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-// I18N constants
-
-// LANG: "hu", ENCODING: UTF-8
-// Author: Miklós Somogyi, <somogyine@vnet.hu>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "hu",
-
-	tooltips: {
-		bold:           "Félkövér",
-		italic:         "Dőlt",
-		underline:      "Aláhúzott",
-		strikethrough:  "Áthúzott",
-		subscript:      "Alsó index",
-		superscript:    "Felső index",
-		justifyleft:    "Balra zárt",
-		justifycenter:  "Középre zárt",
-		justifyright:   "Jobbra zárt",
-		justifyfull:    "Sorkizárt",
-		orderedlist:    "Számozott lista",
-		unorderedlist:  "Számozatlan lista",
-		outdent:        "Behúzás csökkentése",
-		indent:         "Behúzás növelése",
-		forecolor:      "Karakterszín",
-		hilitecolor:    "Háttérszín",
-		horizontalrule: "Elválasztó vonal",
-		createlink:     "Hiperhivatkozás beszúrása",
-		insertimage:    "Kép beszúrása",
-		inserttable:    "Táblázat beszúrása",
-		htmlmode:       "HTML forrás be/ki",
-		popupeditor:    "Szerkesztő külön ablakban",
-		about:          "Névjegy",
-		showhelp:       "Súgó",
-		textindicator:  "Aktuális stílus",
-		undo:           "Visszavonás",
-		redo:           "Újra végrehajtás",
-		cut:            "Kivágás",
-		copy:           "Másolás",
-		paste:          "Beillesztés",
-		lefttoright:    "Irány balról jobbra",
-		righttoleft:    "Irány jobbról balra"
-	},
-
-	buttons: {
-		"ok":           "Rendben",
-		"cancel":       "Mégsem"
-	},
-
-	msg: {
-		"Path":         "Hierarchia",
-		"TEXT_MODE":    "Forrás mód. Visszaváltás [<>] gomb",
-
-		"IE-sucks-full-screen" :
-		// translate here
-		"A teljesképrenyős szerkesztés hibát okozhat Internet Explorer használata esetén, " +
-		"ez a böngésző a hibája, amit nem tudunk kikerülni. Szemetet észlelhet a képrenyőn, " +
-		"illetve néhány funkció hiányozhat és/vagy véletlenszerűen lefagyhat a böngésző. " +
-		"Windows 9x operaciós futtatása esetén elég valószínű, hogy 'General Protection Fault' " +
-		"hibát okoz és újra kell indítania a számítógépet.\n\n" +
-		"Figyelmeztettük.  Kérjük nyomja meg a Rendben gombot, ha mégis szeretné megnyitni a " +
-		"szerkesztőt külön ablakban."
-	},
-
-	dialogs: {
-		"Cancel"                                            : "Mégsem",
-		"Insert/Modify Link"                                : "Hivatkozás Beszúrása/Módosítása",
-		"New window (_blank)"                               : "Új ablak (_blank)",
-		"None (use implicit)"                               : "Nincs (use implicit)",
-		"OK"                                                : "OK",
-		"Other"                                             : "Más",
-		"Same frame (_self)"                                : "Ugyanabba a keretbe (_self)",
-		"Target:"                                           : "Cél:",
-		"Title (tooltip):"                                  : "Cím (tooltip):",
-		"Top frame (_top)"                                  : "Felső keret (_top)",
-		"URL:"                                              : "URL:",
-		"You must enter the URL where this link points to"  : "Be kell írnia az URL-t, ahova a hivatkozás mutasson"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/it.js 75/e107_handlers/htmlarea/lang/it.js
--- 6171/e107_handlers/htmlarea/lang/it.js	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/it.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,79 +0,0 @@
-// I18N constants
-
-// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
-// Author: Fabio Rotondo <fabio@rotondo.it>
-// Update for 3.0 rc1: Giovanni Premuda <gpremuda@softwerk.it>
-
-HTMLArea.I18N = {
-
-        // the following should be the filename without .js extension
-        // it will be used for automatically load plugin language.
-        lang: "it",
-
-        tooltips: {
-                bold:           "Grassetto",
-                italic:         "Corsivo",
-                underline:      "Sottolineato",
-                strikethrough:  "Barrato",
-                subscript:      "Pedice",
-                superscript:    "Apice",
-                justifyleft:    "Allinea a sinistra",
-                justifycenter:  "Allinea in centro",
-                justifyright:   "Allinea a destra",
-                justifyfull:    "Giustifica",
-                insertorderedlist:    "Lista ordinata",
-                insertunorderedlist:  "Lista puntata",
-                outdent:        "Decrementa indentazione",
-                indent:         "Incrementa indentazione",
-                forecolor:      "Colore del carattere",
-                hilitecolor:    "Colore di sfondo",
-                inserthorizontalrule: "Linea orizzontale",
-                createlink:     "Inserisci un link",
-                insertimage:    "Inserisci un'immagine",
-                inserttable:    "Inserisci una tabella",
-                htmlmode:       "Visualizzazione HTML",
-                popupeditor:    "Editor a pieno schermo",
-                about:          "Info sull'editor",
-                showhelp:       "Aiuto sull'editor",
-                textindicator:  "Stile corrente",
-                undo:           "Annulla",
-                redo:           "Ripristina",
-                cut:            "Taglia",
-                copy:           "Copia",
-                paste:          "Incolla",
-                lefttoright:    "Scrivi da sinistra a destra",
-                righttoleft:    "Scrivi da destra a sinistra"
-        },
-
-        buttons: {
-                "ok":           "OK",
-                "cancel":       "Annulla"
-        },
-
-        msg: {
-                "Path":         "Percorso",
-                "TEXT_MODE":    "Sei in MODALITA' TESTO. Usa il bottone [<>] per tornare alla modalità WYSIWYG.",
-                "IE-sucks-full-screen" :
-                // translate here
-                "The full screen mode is known to cause problems with Internet Explorer, " +
-                "due to browser bugs that we weren't able to workaround.  You might experience garbage " +
-                "display, lack of editor functions and/or random browser crashes.  If your system is Windows 9x " +
-                "it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" +
-                "You have been warned.  Please press OK if you still want to try the full screen editor."
-        },
-
-        dialogs: {
-                "Annulla"                                            : "Cancel",
-                "Inserisci/modifica Link"                                : "Insert/Modify Link",
-                "Nuova finestra (_blank)"                               : "New window (_blank)",
-                "Nessuno (usa predefinito)"                               : "None (use implicit)",
-                "OK"                                                : "OK",
-                "Altro"                                             : "Other",
-                "Stessa finestra (_self)"                                : "Same frame (_self)",
-                "Target:"                                           : "Target:",
-                "Title (suggerimento):"                                  : "Title (tooltip):",
-                "Frame principale (_top)"                                  : "Top frame (_top)",
-                "URL:"                                              : "URL:",
-                "You must enter the URL where this link points to"  : "Devi inserire un indirizzo per questo link"
-        }
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/ja-euc.js 75/e107_handlers/htmlarea/lang/ja-euc.js
--- 6171/e107_handlers/htmlarea/lang/ja-euc.js	2004-03-15 16:36:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/ja-euc.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-// I18N constants -- Japanese EUC
-// by Manabu Onoue -- tmocsys@tmocsys.com
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "ja-euc",
-
-	tooltips: {
-		bold:           "",
-		italic:         "",
-		underline:      "",
-		strikethrough:  "Ǥä",
-		subscript:      "դź",
-		superscript:    "դź",
-		justifyleft:    "",
-		justifycenter:  "",
-		justifyright:   "",
-		justifyfull:    "",
-		orderedlist:    "ֹդվ",
-		unorderedlist:  "դվ",
-		outdent:        "ǥȲ",
-		indent:         "ǥ",
-		forecolor:      "ʸ",
-		backcolor:      "طʿ",
-		horizontalrule: "ʿ",
-		createlink:     "󥯺",
-		insertimage:    "",
-		inserttable:    "ơ֥",
-		htmlmode:       "HTMLɽ",
-		popupeditor:    "ǥ",
-		about:          "С",
-		help:           "إ",
-		textindicator:  "ߤΥ"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/ja-jis.js 75/e107_handlers/htmlarea/lang/ja-jis.js
--- 6171/e107_handlers/htmlarea/lang/ja-jis.js	2004-03-15 16:36:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/ja-jis.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-// I18N constants -- Japanese JIS
-// by Manabu Onoue -- tmocsys@tmocsys.com
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "ja-jis",
-
-	tooltips: {
-		bold:           "$BB@;z(B",
-		italic:         "$B<PBN(B",
-		underline:      "$B2<@~(B",
-		strikethrough:  "$BBG$A>C$7@~(B",
-		subscript:      "$B2<IU$-E:$(;z(B",
-		superscript:    "$B>eIU$-E:$(;z(B",
-		justifyleft:    "$B:84s$;(B",
-		justifycenter:  "$BCf1{4s$;(B",
-		justifyright:   "$B1&4s$;(B",
-		justifyfull:    "$B6QEy3dIU(B",
-		orderedlist:    "$BHV9fIU$-2U>r=q$-(B",
-		unorderedlist:  "$B5-9fIU$-2U>r=q$-(B",
-		outdent:        "$B%$%s%G%s%H2r=|(B",
-		indent:         "$B%$%s%G%s%H@_Dj(B",
-		forecolor:      "$BJ8;z?'(B",
-		backcolor:      "$BGX7J?'(B",
-		horizontalrule: "$B?eJ?@~(B",
-		createlink:     "$B%j%s%/:n@.(B",
-		insertimage:    "$B2hA|A^F~(B",
-		inserttable:    "$B%F!<%V%kA^F~(B",
-		htmlmode:       "HTML$BI=<(@ZBX(B",
-		popupeditor:    "$B%(%G%#%?3HBg(B",
-		about:          "$B%P!<%8%g%s>pJs(B",
-		help:           "$B%X%k%W(B",
-		textindicator:  "$B8=:_$N%9%?%$%k(B"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/ja-sjis.js 75/e107_handlers/htmlarea/lang/ja-sjis.js
--- 6171/e107_handlers/htmlarea/lang/ja-sjis.js	2004-03-15 16:36:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/ja-sjis.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-// I18N constants -- Japanese Shift-JIS
-// by Manabu Onoue -- tmocsys@tmocsys.com
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "ja-sjis",
-
-	tooltips: {
-		bold:           "",
-		italic:         "Α",
-		underline:      "",
-		strikethrough:  "ł",
-		subscript:      "tY",
-		superscript:    "tY",
-		justifyleft:    "",
-		justifycenter:  "",
-		justifyright:   "E",
-		justifyfull:    "ϓt",
-		orderedlist:    "ԍtӏ",
-		unorderedlist:  "Ltӏ",
-		outdent:        "Cfg",
-		indent:         "Cfgݒ",
-		forecolor:      "F",
-		backcolor:      "wiF",
-		horizontalrule: "",
-		createlink:     "N쐬",
-		insertimage:    "摜}",
-		inserttable:    "e[u}",
-		htmlmode:       "HTML\ؑ",
-		popupeditor:    "GfB^g",
-		about:          "o[W",
-		help:           "wv",
-		textindicator:  "݂̃X^C"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/ja-utf8.js 75/e107_handlers/htmlarea/lang/ja-utf8.js
--- 6171/e107_handlers/htmlarea/lang/ja-utf8.js	2004-03-15 16:36:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/ja-utf8.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-﻿// I18N constants -- Japanese UTF-8
-// by Manabu Onoue -- tmocsys@tmocsys.com
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "ja-utf8",
-
-	tooltips: {
-		bold:           "太字",
-		italic:         "斜体",
-		underline:      "下線",
-		strikethrough:  "打ち消し線",
-		subscript:      "下付き添え字",
-		superscript:    "上付き添え字",
-		justifyleft:    "左寄せ",
-		justifycenter:  "中央寄せ",
-		justifyright:   "右寄せ",
-		justifyfull:    "均等割付",
-		orderedlist:    "番号付き箇条書き",
-		unorderedlist:  "記号付き箇条書き",
-		outdent:        "インデント解除",
-		indent:         "インデント設定",
-		forecolor:      "文字色",
-		backcolor:      "背景色",
-		horizontalrule: "水平線",
-		createlink:     "リンク作成",
-		insertimage:    "画像挿入",
-		inserttable:    "テーブル挿入",
-		htmlmode:       "HTML表示切替",
-		popupeditor:    "エディタ拡大",
-		about:          "バージョン情報",
-		help:           "ヘルプ",
-		textindicator:  "現在のスタイル"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/lt.js 75/e107_handlers/htmlarea/lang/lt.js
--- 6171/e107_handlers/htmlarea/lang/lt.js	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/lt.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,77 +0,0 @@
-// I18N constants
-
-// LANG: "lt", ENCODING: UTF-8
-// Author: Jaroslav Šatkevič, <jaro@akl.lt>
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "en",
-
-	tooltips: {
-		bold:           "Paryškinti",
-		italic:         "Kursyvas",
-		underline:      "Pabraukti",
-		strikethrough:  "Perbraukti",
-		subscript:      "Apatinis indeksas",
-		superscript:    "Viršutinis indeksas",
-		justifyleft:    "Lygiavimas pagal kairę",
-		justifycenter:  "Lygiavimas pagal centrą",
-		justifyright:   "Lygiavimas pagal dešinę",
-		justifyfull:    "Lygiuoti pastraipą",
-		orderedlist:    "Numeruotas sąrašas",
-		unorderedlist:  "Suženklintas sąrašas",
-		outdent:        "Sumažinti paraštę",
-		indent:         "Padidinti paraštę",
-		forecolor:      "Šrifto spalva",
-		hilitecolor:    "Fono spalva",
-		horizontalrule: "Horizontali linija",
-		createlink:     "Įterpti nuorodą",
-		insertimage:    "Įterpti paveiksliuką",
-		inserttable:    "Įterpti lentelę",
-		htmlmode:       "Perjungti į HTML/WYSIWYG",
-		popupeditor:    "Išplėstas redagavimo ekranas/Enlarge Editor",
-		about:          "Apie redaktorių",
-		showhelp:       "Pagalba naudojant redaktorių",
-		textindicator:  "Dabartinis stilius",
-		undo:           "Atšaukia paskutini jūsų veiksmą",
-		redo:           "Pakartoja paskutinį atšauktą jūsų veiksmą",
-		cut:            "Iškirpti",
-		copy:           "Kopijuoti",
-		paste:          "Įterpti"
-},
-
-	buttons: {
-		"ok":           "OK",
-		"cancel":       "Atšaukti"
-	},
-
-	msg: {
-		"Path":         "Kelias",
-		"TEXT_MODE":    "Jūs esete teksto režime.  Naudokite [<>] mygtuką grįžimui į WYSIWYG.",
-
-		"IE-sucks-full-screen" :
-		// translate here
-		"The full screen mode is known to cause problems with Internet Explorer, " +
-		"due to browser bugs that we weren't able to workaround.  You might experience garbage " +
-		"display, lack of editor functions and/or random browser crashes.  If your system is Windows 9x " +
-		"it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\n" +
-		"You have been warned.  Please press OK if you still want to try the full screen editor."
-	},
-
-	dialogs: {
-		"Cancel"                                            : "Atšaukti",
-		"Insert/Modify Link"                                : "Idėti/Modifikuoti",
-		"New window (_blank)"                               : "Naujas langas (_blank)",
-		"None (use implicit)"                               : "None (use implicit)",
-		"OK"                                                : "OK",
-		"Other"                                             : "Kitas",
-		"Same frame (_self)"                                : "Same frame (_self)",
-		"Target:"                                           : "Target:",
-		"Title (tooltip):"                                  : "Pavadinimas (tooltip):",
-		"Top frame (_top)"                                  : "Top frame (_top)",
-		"URL:"                                              : "URL:",
-		"You must enter the URL where this link points to"  : "Jus privalote nurodyti URL į kuri rodo šitą nuoroda"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/lv.js 75/e107_handlers/htmlarea/lang/lv.js
--- 6171/e107_handlers/htmlarea/lang/lv.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/lv.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,55 +0,0 @@
-// I18N constants

-

-// LANG: "lv", ENCODING: UTF-8 | ISO-8859-1

-// Author: Mihai Bazon, http://dynarch.com/mishoo

-// Translated by: Janis Klavins, <janis.klavins@devia.lv>

-

-HTMLArea.I18N = {

-

-	// the following should be the filename without .js extension

-	// it will be used for automatically load plugin language.

-	lang: "lv",

-

-	tooltips: {

-		bold:           "Trekniem burtiem",

-		italic:         "Kursv",

-		underline:      "Pasvtrots",

-		strikethrough:  "Prsvtrots",

-		subscript:      "Novietot zem rindas",

-		superscript:    "Novietot virs rindas",

-		justifyleft:    "Izldzint pa kreisi",

-		justifycenter:  "Izldzint centr",

-		justifyright:   "Izldzint pa labi",

-		justifyfull:    "Izldzint pa visu lapu",

-		orderedlist:    "Numurts saraksts",

-		unorderedlist:  "Saraksts",

-		outdent:        "Samazint atkpi",

-		indent:         "Palielint atkpi",

-		forecolor:      "Burtu krsa",

-		hilitecolor:    "Fona krsa",

-		horizontalrule: "Horizontla atdaltjsvtra",

-		createlink:     "Ievietot hipersaiti",

-		insertimage:    "Ievietot attlu",

-		inserttable:    "Ievietot tabulu",

-		htmlmode:       "Skatt HTML kodu",

-		popupeditor:    "Palielint Reditju",

-		about:          "Par o reditju",

-		showhelp:       "Reditja palgs",

-		textindicator:  "Patreizjais stils",

-		undo:           "Atcelt pdjo darbbu",

-		redo:           "Atkrtot pdjo darbbu",

-		cut:            "Izgriezt iezmto",

-		copy:           "Kopt iezmto",

-		paste:          "Ievietot iezmto"

-	},

-

-	buttons: {

-		"ok":           "Labi",

-		"cancel":       "Atcelt"

-	},

-

-	msg: {

-		"Path":         "Ce",

-		"TEXT_MODE":    "Js patlaban darbojaties TEKSTA REM. Lai prietu atpaka uz GRAFISKO REMU (WYSIWIG), lietojiet [<>] pogu."

-	}

-};

diff -ruN 6171/e107_handlers/htmlarea/lang/nb.js 75/e107_handlers/htmlarea/lang/nb.js
--- 6171/e107_handlers/htmlarea/lang/nb.js	2004-03-15 16:36:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/nb.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,36 +0,0 @@
-// I18N constants
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "nb",
-
-	tooltips: {
-		bold:           "Fet",
-		italic:         "Kursiv",
-		underline:      "Understreket",
-		strikethrough:  "Gjennomstreket",
-		subscript:      "Senket",
-		superscript:    "Hevet",
-		justifyleft:    "Venstrejuster",
-		justifycenter:  "Midtjuster",
-		justifyright:   "Hyrejuster",
-		justifyfull:    "Blokkjuster",
-		orderedlist:    "Nummerert liste",
-		unorderedlist:  "Punktmerket liste",
-		outdent:        "ke innrykk",
-		indent:         "Reduser innrykk",
-		forecolor:      "Skriftfarge",
-		backcolor:      "Bakgrunnsfarge",
-		horizontalrule: "Horisontal linje",
-		createlink:     "Sett inn lenke",
-		insertimage:    "Sett inn bilde",
-		inserttable:    "Sett inn tabell",
-		htmlmode:       "Vis HTML kode",
-		popupeditor:    "Forstrr redigeringsvindu",
-		about:          "Om..",
-		help:           "Hjelp",
-		textindicator:  "Gjeldende stil"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/nl.js 75/e107_handlers/htmlarea/lang/nl.js
--- 6171/e107_handlers/htmlarea/lang/nl.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/nl.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-// I18N constants

-

-// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1

-// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-HTMLArea.I18N = {

-

-	// the following should be the filename without .js extension

-	// it will be used for automatically load plugin language.

-	lang: "nl",

-

-	tooltips: {

-		bold:					"Vet",

-		italic:					"Cursief",

-		underline:				"Onderstrepen",

-		strikethrough:			"Doorhalen",

-		subscript:				"Subscript",

-		superscript:			"Superscript",

-		justifyleft:			"Links uitlijnen",

-		justifycenter:			"Centreren",

-		justifyright:			"Rechts uitlijnen",

-		justifyfull:			"Uitvullen",

-		orderedlist:		"Nummering",

-		unorderedlist:	"Opsommingstekens",

-		outdent:				"Inspringing verkleinen",

-		indent:					"Inspringing vergroten",

-		forecolor:				"Tekstkleur",

-		hilitecolor:			"Achtergrondkleur",

-		inserthorizontalrule:	"Horizontale lijn",

-		createlink:				"Hyperlink invoegen/aanpassen",

-		insertimage:			"Afbeelding invoegen/aanpassen",

-		inserttable:			"Tabel invoegen",

-		htmlmode:				"HTML broncode",

-		popupeditor:			"Vergroot Editor",

-		about:					"Over deze editor",

-		showhelp:				"HTMLArea help",

-		textindicator:			"Huidige stijl",

-		undo:					"Ongedaan maken",

-		redo:					"Herhalen",

-		cut:					"Knippen",

-		copy:					"Kopiren",

-		paste:					"Plakken",

-		lefttoright:			"Tekstrichting links naar rechts",

-		righttoleft:			"Tekstrichting rechts naar links"

-	},

-

-	buttons: {

-		"ok":					"OK",

-		"cancel":				"Annuleren"

-	},

-

-	msg: {

-		"Path":					"Pad",

-		"TEXT_MODE":			"Je bent in TEKST-mode. Gebruik de [<>] knop om terug te keren naar WYSIWYG-mode.",

-      

-		"IE-sucks-full-screen" :

-		// translate here

-		"Fullscreen-mode veroorzaakt problemen met Internet Explorer door bugs in de webbrowser " +

-		"die we niet kunnen omzeilen. Hierdoor kunnen de volgende effecten optreden: verknoeide teksten, " +

-		"een verlies aan editor-functionaliteit en/of willekeurig vastlopen van de webbrowser. " +

-		"Als u Windows 95 of 98 gebruikt, is het zeer waarschijnlijk dat u een algemene beschermingsfout " +

-		"('General Protection Fault') krijgt en de computer opnieuw zal moeten opstarten.\n\n" +

-		"U bent gewaarschuwd. Druk OK als u toch nog de Fullscreen-editor wil gebruiken."

-	},

-

-	dialogs: {

-		"Cancel"                                            : "Annuleren",

-		"Insert/Modify Link"                                : "Hyperlink invoegen/aanpassen",

-		"New window (_blank)"                               : "Nieuw venster (_blank)",

-		"None (use implicit)"                               : "Geen",

-		"OK"                                                : "OK",

-		"Other"                                             : "Ander",

-		"Same frame (_self)"                                : "Zelfde frame (_self)",

-		"Target:"                                           : "Doel:",

-		"Title (tooltip):"                                  : "Titel (tooltip):",

-		"Top frame (_top)"                                  : "Bovenste frame (_top)",

-		"URL:"                                              : "URL:",

-		"You must enter the URL where this link points to"  : "Geef de URL in waar de link naar verwijst"

-	}

-};

-

diff -ruN 6171/e107_handlers/htmlarea/lang/no.js 75/e107_handlers/htmlarea/lang/no.js
--- 6171/e107_handlers/htmlarea/lang/no.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/no.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,79 +0,0 @@
-// Norwegian version for htmlArea v3.0 - pre1

-// - translated by ses<ses@online.no>

-// Additional translations by Hvard Wigtil <havardw@extend.no>

-// terms and licenses are equal to htmlarea!

-

-HTMLArea.I18N = {

-

-	// the following should be the filename without .js extension

-	// it will be used for automatically load plugin language.

-	lang: "no",

-

-	tooltips: {

-		bold:                 "Fet",

-		italic:               "Kursiv",

-		underline:            "Understreket",

-		strikethrough:        "Gjennomstreket",

-		subscript:            "Nedsenket",

-		superscript:          "Opphyet",

-		justifyleft:          "Venstrejuster",

-		justifycenter:        "Midtjuster",

-		justifyright:         "Hyrejuster",

-		justifyfull:          "Blokkjuster",

-		orderedlist:    "Nummerert liste",

-		unorderedlist:  "Punktliste",

-		outdent:              "Reduser innrykk",

-		indent:               "ke innrykk",

-		forecolor:            "Tekstfarge",

-		hilitecolor:          "Bakgrundsfarge",

-		inserthorizontalrule: "Vannrett linje",

-		createlink:           "Lag lenke",

-		insertimage:          "Sett inn bilde",

-		inserttable:          "Sett inn tabell",

-		htmlmode:             "Vis kildekode",

-		popupeditor:          "Vis i eget vindu",

-		about:                "Om denne editor",

-		showhelp:             "Hjelp",

-		textindicator:        "Nvrende stil",

-                undo:                 "Angrer siste redigering",

-		redo:                 "Gjr om siste angring",

-		cut:                  "Klipp ut omrde",

-		copy:                 "Kopier omrde",

-		paste:                "Lim inn",

-		lefttoright:          "Fra venstre mot hyre",

-		righttoleft:          "Fra hyre mot venstre"

-	},

-    

-	buttons: {

-		"ok":           "OK",

-		"cancel":       "Avbryt"

-	},

-

-	msg: {

-		"Path":         "Tekstvelger",

-		"TEXT_MODE":    "Du er i tekstmodus  Klikk p [<>] for  g tilbake til WYSIWIG.",

-                "IE-sucks-full-screen" :

-		// translate here

-                "Visning i eget vindu har kjente problemer med Internet Explorer, " + 

-                "p grunn av problemer med denne nettleseren. Mulige problemer er et uryddig " + 

-                "skjermbilde, manglende editorfunksjoner og/eller at nettleseren crasher. Hvis du bruker Windows 95 eller Windows 98 " +

-                "er det ogs muligheter for at Windows will crashe.\n\n" +

-                "Trykk 'OK' hvis du vil bruke visning i eget vindu p tross av denne advarselen."

-	},

-

-	dialogs: {

-		"Cancel"                                            : "Avbryt",

-		"Insert/Modify Link"                                : "Rediger lenke",

-		"New window (_blank)"                               : "Eget vindu (_blank)",

-		"None (use implicit)"                               : "Ingen (bruk standardinnstilling)",

-		"OK"                                                : "OK",

-		"Other"                                             : "Annen",

-		"Same frame (_self)"                                : "Samme ramme (_self)",

-		"Target:"                                           : "Ml:",

-		"Title (tooltip):"                                  : "Tittel (tooltip):",

-		"Top frame (_top)"                                  : "Toppramme (_top)",

-		"URL:"                                              : "Adresse:",

-		"You must enter the URL where this link points to"  : "Du m skrive inn en adresse som denne lenken skal peke til"

-	}

-};

-

diff -ruN 6171/e107_handlers/htmlarea/lang/pl.js 75/e107_handlers/htmlarea/lang/pl.js
--- 6171/e107_handlers/htmlarea/lang/pl.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/pl.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,36 +0,0 @@
-// I18N constants

-

-HTMLArea.I18N = {

-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "pl",
-
-	tooltips: {

-		bold:           "Pogrubienie",

-		italic:         "Pochylenie",

-		underline:      "Podkrelenie",

-		strikethrough:  "Przekrelenie",

-		subscript:      "Indeks dolny",

-		superscript:    "Indeks grny",

-		justifyleft:    "Wyrwnaj do lewej",

-		justifycenter:  "Wyrodkuj",

-		justifyright:   "Wyrwnaj do prawej",

-		justifyfull:    "Wyjustuj",

-		orderedlist:    "Numerowanie",

-		unorderedlist:  "Wypunktowanie",

-		outdent:        "Zmniejsz wcicie",

-		indent:         "Zwiksz wcicie",

-		forecolor:      "Kolor czcionki",

-		backcolor:      "Kolor ta",

-		horizontalrule: "Linia pozioma",

-		createlink:     "Wstaw adres sieci Web",

-		insertimage:    "Wstaw obraz",

-		inserttable:    "Wstaw tabel",

-		htmlmode:       "Edycja WYSIWYG/w rdle strony",

-		popupeditor:    "Peny ekran",

-		about:          "Informacje o tym edytorze",

-		help:           "Pomoc",

-		textindicator:  "Obecny styl"

-	}

-};

diff -ruN 6171/e107_handlers/htmlarea/lang/pt_br.js 75/e107_handlers/htmlarea/lang/pt_br.js
--- 6171/e107_handlers/htmlarea/lang/pt_br.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/pt_br.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-// I18N constants

-// Brazilian Portuguese Translation by Alex Piaz <webmaster@globalmap.com>

-

-HTMLArea.I18N = {

-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "pt_br",
-
-	tooltips: {

-		bold:           "Negrito",

-		italic:         "Itlico",

-		underline:      "Sublinhado",

-		strikethrough:  "Tachado",

-		subscript:      "Subescrito",

-		superscript:    "Sobrescrito",

-		justifyleft:    "Alinhar  Esquerda",

-		justifycenter:  "Centralizar",

-		justifyright:   "Alinhar  Direita",

-		justifyfull:    "Justificar",

-		orderedlist:    "Lista Numerada",

-		unorderedlist:  "Lista Marcadores",

-		outdent:        "Diminuir Indentao",

-		indent:         "Aumentar Indentao",

-		forecolor:      "Cor da Fonte",

-		backcolor:      "Cor do Fundo",

-		horizontalrule: "Linha Horizontal",

-		createlink:     "Inserir Link",

-		insertimage:    "Inserir Imagem",

-		inserttable:    "Inserir Tabela",

-		htmlmode:       "Ver Cdigo-Fonte",

-		popupeditor:    "Expandir Editor",

-		about:          "Sobre",

-		help:           "Ajuda",

-		textindicator:  "Estilo Atual"

-	}

-};

diff -ruN 6171/e107_handlers/htmlarea/lang/ro.js 75/e107_handlers/htmlarea/lang/ro.js
--- 6171/e107_handlers/htmlarea/lang/ro.js	2004-03-16 02:22:58.000000000 -0600
+++ 75/e107_handlers/htmlarea/lang/ro.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,80 +0,0 @@
-// I18N constants
-
-// LANG: "ro", ENCODING: UTF-8
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "ro",
-
-	tooltips: {
-		bold:           "Îngroşat",
-		italic:         "Italic",
-		underline:      "Subliniat",
-		strikethrough:  "Tăiat",
-		subscript:      "Indice jos",
-		superscript:    "Indice sus",
-		justifyleft:    "Aliniere la stânga",
-		justifycenter:  "Aliniere pe centru",
-		justifyright:   "Aliniere la dreapta",
-		justifyfull:    "Aliniere în ambele părţi",
-		orderedlist:    "Listă ordonată",
-		unorderedlist:  "Listă marcată",
-		outdent:        "Micşorează alineatul",
-		indent:         "Măreşte alineatul",
-		forecolor:      "Culoarea textului",
-		hilitecolor:    "Culoare de fundal",
-		horizontalrule: "Linie orizontală",
-		createlink:     "Inserează/modifică link",
-		insertimage:    "Inserează/modifică imagine",
-		inserttable:    "Inserează un tabel",
-		htmlmode:       "Sursa HTML / WYSIWYG",
-		popupeditor:    "Maximizează editorul",
-		about:          "Despre editor",
-		showhelp:       "Documentaţie (devel)",
-		textindicator:  "Stilul curent",
-		undo:           "Anulează ultima acţiune",
-		redo:           "Reface ultima acţiune anulată",
-		cut:            "Taie în clipboard",
-		copy:           "Copie în clipboard",
-		paste:          "Aduce din clipboard",
-		lefttoright:    "Direcţia de scriere: stânga - dreapta",
-		righttoleft:    "Direcţia de scriere: dreapta - stânga"
-	},
-
-	buttons: {
-		"ok":           "OK",
-		"cancel":       "Anulează"
-	},
-
-	msg: {
-		"Path":         "Calea",
-		"TEXT_MODE":    "Eşti în modul TEXT.  Apasă butonul [<>] pentru a te întoarce în modul WYSIWYG."
-	},
-
-	dialogs: {
-		"Cancel"                                            : "Renunţă",
-		"Insert/Modify Link"                                : "Inserează/modifcă link",
-		"New window (_blank)"                               : "Fereastră nouă (_blank)",
-		"None (use implicit)"                               : "Nimic (foloseşte ce-i implicit)",
-		"OK"                                                : "Acceptă",
-		"Other"                                             : "Alt target",
-		"Same frame (_self)"                                : "Aceeaşi fereastră (_self)",
-		"Target:"                                           : "Ţinta:",
-		"Title (tooltip):"                                  : "Titlul (tooltip):",
-		"Top frame (_top)"                                  : "Fereastra principală (_top)",
-		"URL:"                                              : "URL:",
-		"You must enter the URL where this link points to"  : "Trebuie să introduceţi un URL"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/lang/ru.js 75/e107_handlers/htmlarea/lang/ru.js
--- 6171/e107_handlers/htmlarea/lang/ru.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/ru.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,63 +0,0 @@
-﻿// I18N constants

-

-// LANG: "ru", ENCODING: UTF-8 | ISO-8859-1

-// Author: Yulya Shtyryakova, <yulya@vdcom.ru>

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-HTMLArea.I18N = {

-

-	// the following should be the filename without .js extension

-	// it will be used for automatically load plugin language.

-	lang: "ru",

-

-	tooltips: {

-		bold:           "Полужирный",

-		italic:         "Наклонный",

-		underline:      "Подчеркнутый",

-		strikethrough:  "Перечеркнутый",

-		subscript:      "Нижний индекс",

-		superscript:    "Верхний индекс",

-		justifyleft:    "По левому краю",

-		justifycenter:  "По центру",

-		justifyright:   "По правому краю",

-		justifyfull:    "По ширине",

-		orderedlist:    "Нумерованный лист",

-		unorderedlist:  "Маркированный лист",

-		outdent:        "Уменьшить отступ",

-		indent:         "Увеличить отступ",

-		forecolor:      "Цвет шрифта",

-		hilitecolor:    "Цвет фона",

-		horizontalrule: "Горизонтальный разделитель",

-		createlink:     "Вставить гиперссылку",

-		insertimage:    "Вставить изображение",

-		inserttable:    "Вставить таблицу",

-		htmlmode:       "Показать Html-код",

-		popupeditor:    "Увеличить редактор",

-		about:          "О редакторе",

-		showhelp:       "Помощь",

-		textindicator:  "Текущий стиль",

-		undo:           "Отменить",

-		redo:           "Повторить",

-		cut:            "Вырезать",

-		copy:           "Копировать",

-		paste:          "Вставить"

-	},

-

-	buttons: {

-		"ok":           "OK",

-		"cancel":       "Отмена"

-	},

-

-	msg: {

-		"Path":         "Путь",

-		"TEXT_MODE":    "Вы в режиме отображения Html-кода. нажмите кнопку [<>], чтобы переключиться в визуальный режим."

-	}

-};

diff -ruN 6171/e107_handlers/htmlarea/lang/se.js 75/e107_handlers/htmlarea/lang/se.js
--- 6171/e107_handlers/htmlarea/lang/se.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/se.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,38 +0,0 @@
-// Swedish version for htmlArea v3.0 - Alpha Release

-// - translated by pat<pat@engvall.nu>

-// terms and licenses are equal to htmlarea!

-

-HTMLArea.I18N = {

-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "se",
-
-	tooltips: {

-		bold:           "Fet",

-		italic:         "Kursiv",

-		underline:      "Understruken",

-		strikethrough:  "Genomstruken",

-		subscript:      "Nedsnkt",

-		superscript:    "Upphjd",

-		justifyleft:    "Vnsterjustera",

-		justifycenter:  "Centrera",

-		justifyright:   "Hgerjustera",

-		justifyfull:    "Marginaljustera",

-		orderedlist:    "Numrerad lista",

-		unorderedlist:  "Punktlista",

-		outdent:        "Minska indrag",

-		indent:         "ka indrag",

-		forecolor:      "Textfrg",

-		backcolor:      "Bakgrundsfrg",

-		horizontalrule: "Vgrt linje",

-		createlink:     "Infoga lnk",

-		insertimage:    "Infoga bild",

-		inserttable:    "Infoga tabell",

-		htmlmode:       "Visa kllkod",

-		popupeditor:    "Visa i eget fnster",

-		about:          "Om denna editor",

-		help:           "Hjlp",

-		textindicator:  "Nuvarande stil"

-	}

-};

diff -ruN 6171/e107_handlers/htmlarea/lang/si.js 75/e107_handlers/htmlarea/lang/si.js
--- 6171/e107_handlers/htmlarea/lang/si.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/si.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,63 +0,0 @@
-// I18N constants

-

-// LANG: "si", ENCODING: ISO-8859-2

-// Author: Tomaz Kregar, x_tomo_x@email.si

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-HTMLArea.I18N = {

-

-	// the following should be the filename without .js extension

-	// it will be used for automatically load plugin language.

-	lang: "si",

-

-	tooltips: {

-		bold:           "Krepko",

-		italic:         "Leee",

-		underline:      "Podrtano",

-		strikethrough:  "Prertano",

-		subscript:      "Podpisano",

-		superscript:    "Nadpisano",

-		justifyleft:    "Poravnaj levo",

-		justifycenter:  "Na sredino",

-		justifyright:   "Poravnaj desno",

-		justifyfull:    "Porazdeli vsebino",

-		orderedlist:    "Otevilevanje",

-		unorderedlist:  "Oznaevanje",

-		outdent:        "Zmanjaj zamik",

-		indent:         "Poveaj zamik",

-		forecolor:      "Barva pisave",

-		hilitecolor:    "Barva ozadja",

-		horizontalrule: "Vodoravna rta",

-		createlink:     "Vstavi hiperpovezavo",

-		insertimage:    "Vstavi sliko",

-		inserttable:    "Vstavi tabelo",

-		htmlmode:       "Preklopi na HTML kodo",

-		popupeditor:    "Poveaj urejevalnik",

-		about:          "Vizitka za urejevalnik",

-		showhelp:       "Pomo za urejevalnik",

-		textindicator:  "Trenutni slog",

-		undo:           "Razveljavi zadnjo akcijo",

-		redo:           "Uveljavi zadnjo akcijo",

-		cut:            "Izrei",

-		copy:           "Kopiraj",

-		paste:          "Prilepi"

-	},

-

-	buttons: {

-		"ok":           "V redu",

-		"cancel":       "Preklii"

-	},

-

-	msg: {

-		"Path":         "Pot",

-		"TEXT_MODE":    "Si v tekstovnem nainu.  Uporabi [<>] gumb za prklop nazaj na WYSIWYG."

-	}

-};

diff -ruN 6171/e107_handlers/htmlarea/lang/vn.js 75/e107_handlers/htmlarea/lang/vn.js
--- 6171/e107_handlers/htmlarea/lang/vn.js	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/lang/vn.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,77 +0,0 @@
-// I18N constants : Vietnamese
-// LANG: "en", ENCODING: UTF-8
-// Author: Nguyễn Đình Nam, <hncryptologist@yahoo.com>
-// Modified 21/07/2004 by Phạm Mai Quân <pmquan@4vn.org>
-
-HTMLArea.I18N = {
-
-  // the following should be the filename without .js extension
-  // it will be used for automatically load plugin language.
-  lang: "vn",
-
-  tooltips: {
-    bold:           "Đậm",
-    italic:         "Nghiêng",
-    underline:      "Gạch Chân",
-    strikethrough:  "Gạch Xóa",
-    subscript:      "Viết Xuống Dưới",
-    superscript:    "Viết Lên Trên",
-    justifyleft:    "Căn Trái",
-    justifycenter:  "Căn Giữa",
-    justifyright:   "Căn Phải",
-    justifyfull:    "Căn Đều",
-    insertorderedlist:    "Danh Sách Có Thứ Tự (1, 2, 3)",
-    insertunorderedlist:  "Danh Sách Phi Thứ Tự (Chấm đầu dòng)",
-    outdent:        "Lùi Ra Ngoài",
-    indent:         "Thụt Vào Trong",
-    forecolor:      "Màu Chữ",
-    hilitecolor:    "Màu Nền",
-    inserthorizontalrule: "Dòng Kẻ Ngang",
-    createlink:     "Tạo Liên Kết",
-    insertimage:    "Chèn Ảnh",
-    inserttable:    "Chèn Bảng",
-    htmlmode:       "Chế Độ Mã HTML",
-    popupeditor:    "Phóng To Ô Soạn Thảo",
-    about:          "Tự Giới Thiệu",
-    showhelp:       "Giúp Đỡ",
-    textindicator:  "Định Dạng Hiện Thời",
-    undo:           "Hủy thao tác trước",
-    redo:           "Lấy lại thao tác vừa bỏ",
-    cut:            "Cắt",
-    copy:           "Sao chép",
-    paste:          "Dán",
-    lefttoright:    "Viết từ trái sang phải",
-    righttoleft:    "Viết từ phải sang trái"
-  },
-  buttons: {
-    "ok":           "Đồng ý",
-    "cancel":       "Hủy",
-
-    "IE-sucks-full-screen" :
-    // translate here
-    "Chế độ phóng to ô soạn thảo có thể gây lỗi với Internet Explorer vì một số lỗi của trình duyệt này," +
-    " vì thế chế độ này có thể sẽ không chạy. Hiển thị không đúng, lộn xộn, không có đầy đủ chức năng," +
-    " và cũng có thể làm trình duyệt của bạn bị tắt ngang. Nếu bạn đang sử dụng Windows 9x " +
-    "bạn có thể bị báo lỗi 'General Protection Fault' và máy tính của bạn buộc phải khởi động lại.\n\n" +
-    "Chúng tôi đã cảnh báo bạn. Nhấn nút 'Đồng ý' nếu bạn vẫn muốn sử dụng tính năng này."
-  },
-  msg: {
-    "Path":         "Đường Dẫn",
-    "TEXT_MODE":    "Bạn đang ở chế độ text.  Sử dụng nút [<>] để chuyển lại chế độ WYSIWIG."
-  },
-
-  dialogs: {
-    "Cancel"                                            : "Hủy",
-    "Insert/Modify Link"                                : "Thêm/Chỉnh sửa đường dẫn",
-    "New window (_blank)"                               : "Cửa sổ mới (_blank)",
-    "None (use implicit)"                               : "Không (sử dụng implicit)",
-    "OK"                                                : "Đồng ý",
-    "Other"                                             : "Khác",
-    "Same frame (_self)"                                : "Trên cùng khung (_self)",
-    "Target:"                                           : "Nơi hiện thị:",
-    "Title (tooltip):"                                  : "Tiêu đề (của hướng dẫn):",
-    "Top frame (_top)"                                  : "Khung trên cùng (_top)",
-    "URL:"                                              : "URL:",
-    "You must enter the URL where this link points to"  : "Bạn phải điền địa chỉ (URL) mà đường dẫn sẽ liên kết tới"
-  }
-};
diff -ruN 6171/e107_handlers/htmlarea/license.txt 75/e107_handlers/htmlarea/license.txt
--- 6171/e107_handlers/htmlarea/license.txt	2004-06-26 08:48:20.000000000 -0500
+++ 75/e107_handlers/htmlarea/license.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1,30 +0,0 @@
-htmlArea License (based on BSD license)

-Copyright (c) 2002-2004, interactivetools.com, inc.

-Copyright (c) 2003-2004 dynarch.com

-All rights reserved.

-

-Redistribution and use in source and binary forms, with or without

-modification, are permitted provided that the following conditions are met:

-

-1) Redistributions of source code must retain the above copyright notice,

-   this list of conditions and the following disclaimer.

-

-2) Redistributions in binary form must reproduce the above copyright notice,

-   this list of conditions and the following disclaimer in the documentation

-   and/or other materials provided with the distribution.

-

-3) Neither the name of interactivetools.com, inc. nor the names of its

-   contributors may be used to endorse or promote products derived from this

-   software without specific prior written permission.

-

-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"

-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE

-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR

-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF

-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS

-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN

-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)

-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE

-POSSIBILITY OF SUCH DAMAGE.

diff -ruN 6171/e107_handlers/htmlarea/plugins/CharacterMap/character-map.js 75/e107_handlers/htmlarea/plugins/CharacterMap/character-map.js
--- 6171/e107_handlers/htmlarea/plugins/CharacterMap/character-map.js	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/CharacterMap/character-map.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,70 +0,0 @@
-// Character Map plugin for HTMLArea
-// Sponsored by http://www.systemconcept.de
-// Implementation by Holger Hees based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/)
-// Original Author - Bernhard Pfeifer novocaine@gmx.net 
-//
-// (c) systemconcept.de 2004
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-
-function CharacterMap(editor) {
-        this.editor = editor;
-	        
-        var cfg = editor.config;
-	var toolbar = cfg.toolbar;
-	var self = this;
-	var i18n = CharacterMap.I18N;
-        
-	cfg.registerButton({
-                id       : "insertcharacter",
-                tooltip  : i18n["CharacterMapTooltip"],
-                image    : editor.imgURL("ed_charmap.gif", "CharacterMap"),
-                textMode : false,
-                action   : function(editor) {
-                                self.buttonPress(editor);
-                           }
-            })
-
-	var a, i, j, found = false;
-	for (i = 0; !found && i < toolbar.length; ++i) {
-		a = toolbar[i];
-		for (j = 0; j < a.length; ++j) {
-			if (a[j] == "inserthorizontalrule") {
-				found = true;
-				break;
-			}
-		}
-	}
-	if (found)
-	    a.splice(j, 0, "insertcharacter");
-        else{                
-            toolbar[1].splice(0, 0, "separator");
-	    toolbar[1].splice(0, 0, "insertcharacter");
-        }
-};
-
-CharacterMap._pluginInfo = {
-	name          : "CharacterMap",
-	version       : "1.0",
-	developer     : "Holger Hees & Bernhard Pfeifer",
-	developer_url : "http://www.systemconcept.de/",
-	c_owner       : "Holger Hees & Bernhard Pfeifer",
-	sponsor       : "System Concept GmbH & Bernhard Pfeifer",
-	sponsor_url   : "http://www.systemconcept.de/",
-	license       : "htmlArea"
-};
-
-CharacterMap.prototype.buttonPress = function(editor) {
-    editor._popupDialog( "plugin://CharacterMap/select_character", function( entity ) 
-    {
-        if ( !entity ) 
-        {  
-            //user must have pressed Cancel
-            return false;
-        }
-        
-        editor.insertHTML( entity );
-               
-    }, null);
-}
-
Files 6171/e107_handlers/htmlarea/plugins/CharacterMap/img/ed_charmap.gif and 75/e107_handlers/htmlarea/plugins/CharacterMap/img/ed_charmap.gif differ
diff -ruN 6171/e107_handlers/htmlarea/plugins/CharacterMap/lang/de.js 75/e107_handlers/htmlarea/plugins/CharacterMap/lang/de.js
--- 6171/e107_handlers/htmlarea/plugins/CharacterMap/lang/de.js	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/CharacterMap/lang/de.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,16 +0,0 @@
-// I18N constants
-
-// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
-// Sponsored by http://www.systemconcept.de
-// Author: Holger Hees, <hhees@systemconcept.de>
-//
-// (c) systemconcept.de 2004
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-
-CharacterMap.I18N = {
-	"CharacterMapTooltip"       : "Sonderzeichen einfgen",
-	"Insert special character"  : "Sonderzeichen einfgen",
-	"HTML value:"               : "HTML Wert:",
-	"Cancel"                    : "Abbrechen"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/CharacterMap/lang/en.js 75/e107_handlers/htmlarea/plugins/CharacterMap/lang/en.js
--- 6171/e107_handlers/htmlarea/plugins/CharacterMap/lang/en.js	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/CharacterMap/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,16 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Sponsored by http://www.systemconcept.de
-// Author: Holger Hees, <hhees@systemconcept.de>
-//
-// (c) systemconcept.de 2004
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-
-CharacterMap.I18N = {
-	"CharacterMapTooltip"       : "Insert special character",
-	"Insert special character"  : "Insert special character",
-	"HTML value:"               : "HTML value:",
-	"Cancel"                    : "Cancel"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/CharacterMap/makefile.xml 75/e107_handlers/htmlarea/plugins/CharacterMap/makefile.xml
--- 6171/e107_handlers/htmlarea/plugins/CharacterMap/makefile.xml	2004-08-12 09:32:26.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/CharacterMap/makefile.xml	1969-12-31 18:00:00.000000000 -0600
@@ -1,8 +0,0 @@
-<files>
-  <file name="*.{js,html,cgi,css}" />
-
-  <dir name="lang" />
-  <dir name="img" />
-  <dir name="popups" />
-</files>
-
diff -ruN 6171/e107_handlers/htmlarea/plugins/CharacterMap/popups/select_character.html 75/e107_handlers/htmlarea/plugins/CharacterMap/popups/select_character.html
--- 6171/e107_handlers/htmlarea/plugins/CharacterMap/popups/select_character.html	2004-08-12 09:32:28.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/CharacterMap/popups/select_character.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,251 +0,0 @@
-<html>

-<head>

-<title>Insert special character</title>

-<style type="text/css">

-@import url(../../../htmlarea.css);

-td.character {

-    font-family: Verdana,Arial,Helvetica,sans-serif;

-    font-size: 14px;

-    font-weight: bold;

-    text-align: center;

-    background: #FFF;

-    padding: 4px;

-}

-

-td.character-hilite {

-    background: Highlight;

-    color: HighlightText;

-}

-

-html, body {

-  background: ButtonFace;

-  color: ButtonText;

-  font: 11px Tahoma,Verdana,sans-serif;

-  margin: 0px;

-  padding: 0px;

-}

-body { padding: 5px; }

-table {

-  font: 11px Tahoma,Verdana,sans-serif;

-}

-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }

-button { width: 70px; }

-table .label { text-align: right; width: 8em; }

-

-.title { background: none; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;

-border-bottom: 1px solid black; letter-spacing: 2px;

-}

-#buttons {

-      margin-top: 1em; border-top: 1px solid #999;

-      padding: 2px; text-align: right;

-}

-</style>

-<script type="text/javascript" src="../../../popups/popup.js"></script>

-<script type="text/javascript">

-// HTMLSource based on HTMLArea XTD 1.5 (http://mosforge.net/projects/htmlarea3xtd/) modified by Holger Hees

-// Original Author - Bernhard Pfeifer novocaine@gmx.net

-

-CharacterMap = window.opener.CharacterMap; // load the CharacterMap plugin and lang file ;-)

-window.resizeTo(480, 300);

-// center on parent

-var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;

-var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;

-window.moveTo(x, y);

-

-function _CloseOnEsc()

-{

-    if ( event.keyCode == 27 )

-    {

-        window.close();

-        return;

-    }

-}

-

-function Init()                                                         // run on page load

-{

-   __dlg_translate(CharacterMap.I18N);

-   __dlg_init();

-    document.body.onkeypress = _CloseOnEsc;

-

-    var character = '';                                                   // set default input to empty

-    View( null, character );

-}

-

-var oldView = null;

-function View( td, character )               // preview character

-{

-    if (oldView)

-        oldView.className = oldView.className.replace(/\s+character-hilite/, '');

-    document.getElementById( 'characterPreview' ).value = character;

-    document.getElementById( 'showCharacter' ).value = character;

-    if (td)

-        (oldView = td).className += " character-hilite";

-}

-

-function Set( string )                // return character

-{

-    var character = string;

-

-    __dlg_close( character );

-}

-

-function onCancel()                   // cancel selection

-{

-    __dlg_close( null );

-

-    return false;

-};

-

-</script>

-</head>

-<body style="background: Buttonface; margin: 0px; padding: 0px" onload="Init();self.focus();">

-<form method="get" style="margin:2px; padding:2px" onSubmit="Set(document.getElementById('showCharacter').value); return false;">

-<table border="0" cellspacing="0" cellpadding="4" width="100%">

- <tr>

-  <td style="background: Buttonface" valign="center"><div style="padding: 1px; white-space: nowrap; font-family: tahoma,arial,sans-serif; font-size: 11px; font-weight: normal;">HTML value:<div id="characterPreview"></div></div></td>

-  <td style="background: Buttonface" valign="center"><input type="text" name="showcharacter" id="showCharacter" value="" size="15" style="background: #fff; font-size: 11px;" /></td>

-  <td style="background: Buttonface" width="100%"></td>

- </tr>

-</table>

-</form>

-<table border="0" cellspacing="1" cellpadding="0" width="100%" style="cursor: pointer; background: #ADAD9C; border: 1px inset;">

-<tr>

-<td class="character" onMouseOver="View(this,'&amp;Yuml;')" onClick="Set('&Yuml;')">&Yuml;</td>

-<td class="character" onMouseOver="View(this,'&amp;scaron;')" onClick="Set('&scaron;')">&scaron;</td>

-<td class="character" onMouseOver="View(this,'&amp;#064;')" onClick="Set('&#064;')">@</td>

-<td class="character" onMouseOver="View(this,'&amp;quot;')" onClick="Set('&quot;')">&quot;</td>

-<td class="character" onMouseOver="View(this,'&amp;iexcl;')" onClick="Set('&iexcl;')">&iexcl;</td>

-<td class="character" onMouseOver="View(this,'&amp;cent;')" onClick="Set('&cent;')">&cent;</td>

-<td class="character" onMouseOver="View(this,'&amp;pound;')" onClick="Set('&pound;')">&pound;</td>

-<td class="character" onMouseOver="View(this,'&amp;curren;')" onClick="Set('&curren;')">&curren;</td>

-<td class="character" onMouseOver="View(this,'&amp;yen;')" onClick="Set('&yen;')">&yen;</td>

-<td class="character" onMouseOver="View(this,'&amp;brvbar;')" onClick="Set('&brvbar;')">&brvbar;</td>

-<td class="character" onMouseOver="View(this,'&amp;sect;')" onClick="Set('&sect;')">&sect;</td>

-<td class="character" onMouseOver="View(this,'&amp;uml;')" onClick="Set('&uml;')">&uml;</td>

-<td class="character" onMouseOver="View(this,'&amp;copy;')" onClick="Set('&copy;')">&copy;</td>

-<td class="character" onMouseOver="View(this,'&amp;ordf;')" onClick="Set('&ordf;')">&ordf;</td>

-<td class="character" onMouseOver="View(this,'&amp;laquo;')" onClick="Set('&laquo;')">&laquo;</td>

-<td class="character" onMouseOver="View(this,'&amp;not;')" onClick="Set('&not;')">&not</td>

-</tr><tr>

-<td class="character" onMouseOver="View(this,'&amp;macr;')" onClick="Set('&macr;')">&macr;</td>

-<td class="character" onMouseOver="View(this,'&amp;deg;')" onClick="Set('&deg;')">&deg;</td>

-<td class="character" onMouseOver="View(this,'&amp;plusmn;')" onClick="Set('&plusmn;')">&plusmn;</td>

-<td class="character" onMouseOver="View(this,'&amp;sup2;')" onClick="Set('&sup2;')">&sup2;</td>

-<td class="character" onMouseOver="View(this,'&amp;sup3;')" onClick="Set('&sup3;')">&sup3;</td>

-<td class="character" onMouseOver="View(this,'&amp;acute;')" onClick="Set('&acute;')">&acute;</td>

-<td class="character" onMouseOver="View(this,'&amp;micro;')" onClick="Set('&micro;')">&micro;</td>

-<td class="character" onMouseOver="View(this,'&amp;para;')" onClick="Set('&para;')">&para;</td>

-<td class="character" onMouseOver="View(this,'&amp;middot;')" onClick="Set('&middot;')">&middot;</td>

-<td class="character" onMouseOver="View(this,'&amp;cedil;')" onClick="Set('&cedil;')">&cedil;</td>

-<td class="character" onMouseOver="View(this,'&amp;sup1;')" onClick="Set('&sup1;')">&sup1;</td>

-<td class="character" onMouseOver="View(this,'&amp;ordm;')" onClick="Set('&ordm;')">&ordm;</td>

-<td class="character" onMouseOver="View(this,'&amp;raquo;')" onClick="Set('&raquo;')">&raquo;</td>

-<td class="character" onMouseOver="View(this,'&amp;frac14;')" onClick="Set('&frac14;')">&frac14;</td>

-<td class="character" onMouseOver="View(this,'&amp;frac12;')" onClick="Set('&frac12;')">&frac12;</td>

-<td class="character" onMouseOver="View(this,'&amp;frac34;')" onClick="Set('&frac34;')">&frac34;</td>

-</tr><tr>

-<td class="character" onMouseOver="View(this,'&amp;iquest;')" onClick="Set('&iquest;')">&iquest;</td>

-<td class="character" onMouseOver="View(this,'&amp;times;')" onClick="Set('&times;')">&times;</td>

-<td class="character" onMouseOver="View(this,'&amp;Oslash;')" onClick="Set('&Oslash;')">&Oslash;</td>

-<td class="character" onMouseOver="View(this,'&amp;divide;')" onClick="Set('&divide;')">&divide;</td>

-<td class="character" onMouseOver="View(this,'&amp;oslash;')" onClick="Set('&oslash;')">&oslash;</td>

-<td class="character" onMouseOver="View(this,'&amp;fnof;')" onClick="Set('&fnof;')">&fnof;</td>

-<td class="character" onMouseOver="View(this,'&amp;circ;')" onClick="Set('&circ;')">&circ;</td>

-<td class="character" onMouseOver="View(this,'&amp;tilde;')" onClick="Set('&tilde;')">&tilde;</td>

-<td class="character" onMouseOver="View(this,'&amp;ndash;')" onClick="Set('&ndash;')">&ndash;</td>

-<td class="character" onMouseOver="View(this,'&amp;mdash;')" onClick="Set('&mdash;')">&mdash;</td>

-<td class="character" onMouseOver="View(this,'&amp;lsquo;')" onClick="Set('&lsquo;')">&lsquo;</td>

-<td class="character" onMouseOver="View(this,'&amp;rsquo;')" onClick="Set('&rsquo;')">&rsquo;</td>

-<td class="character" onMouseOver="View(this,'&amp;sbquo;')" onClick="Set('&sbquo;')">&sbquo;</td>

-<td class="character" onMouseOver="View(this,'&amp;ldquo;')" onClick="Set('&ldquo;')">&ldquo;</td>

-<td class="character" onMouseOver="View(this,'&amp;rdquo;')" onClick="Set('&rdquo;')">&rdquo;</td>

-<td class="character" onMouseOver="View(this,'&amp;bdquo;')" onClick="Set('&bdquo;')">&bdquo;</td>

-</tr><tr>

-<td class="character" onMouseOver="View(this,'&amp;dagger;')" onClick="Set('&dagger;')">&dagger;</td>

-<td class="character" onMouseOver="View(this,'&amp;Dagger;')" onClick="Set('&Dagger;')">&Dagger;</td>

-<td class="character" onMouseOver="View(this,'&amp;bull;')" onClick="Set('&bull;')">&bull;</td>

-<td class="character" onMouseOver="View(this,'&amp;hellip;')" onClick="Set('&hellip;')">&hellip;</td>

-<td class="character" onMouseOver="View(this,'&amp;permil;')" onClick="Set('&permil;')">&permil;</td>

-<td class="character" onMouseOver="View(this,'&amp;lsaquo;')" onClick="Set('&lsaquo;')">&lsaquo;</td>

-<td class="character" onMouseOver="View(this,'&amp;rsaquo;')" onClick="Set('&rsaquo;')">&rsaquo;</td>

-<td class="character" onMouseOver="View(this,'&amp;euro;')" onClick="Set('&euro;')">&euro;</td>

-<td class="character" onMouseOver="View(this,'&amp;trade;')" onClick="Set('&trade;')">&trade;</td>

-<td class="character" onMouseOver="View(this,'&amp;Agrave;')" onClick="Set('&Agrave;')">&Agrave;</td>

-<td class="character" onMouseOver="View(this,'&amp;Aacute;')" onClick="Set('&Aacute;')">&Aacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;Acirc;')" onClick="Set('&Acirc;')">&Acirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;Atilde;')" onClick="Set('&Atilde;')">&Atilde;</td>

-<td class="character" onMouseOver="View(this,'&amp;Auml;')" onClick="Set('&Auml;')">&Auml;</td>

-<td class="character" onMouseOver="View(this,'&amp;Aring;')" onClick="Set('&Aring;')">&Aring;</td>

-<td class="character" onMouseOver="View(this,'&amp;AElig;')" onClick="Set('&AElig;')">&AElig;</td>

-</tr><tr>

-<td class="character" onMouseOver="View(this,'&amp;Ccedil;')" onClick="Set('&Ccedil;')">&Ccedil;</td>

-<td class="character" onMouseOver="View(this,'&amp;Egrave;')" onClick="Set('&Egrave;')">&Egrave;</td>

-<td class="character" onMouseOver="View(this,'&amp;Eacute;')" onClick="Set('&Eacute;')">&Eacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;Ecirc;')" onClick="Set('&Ecirc;')">&Ecirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;Euml;')" onClick="Set('&Euml;')">&Euml;</td>

-<td class="character" onMouseOver="View(this,'&amp;Igrave;')" onClick="Set('&Igrave;')">&Igrave;</td>

-<td class="character" onMouseOver="View(this,'&amp;Iacute;')" onClick="Set('&Iacute;')">&Iacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;Icirc;')" onClick="Set('&Icirc;')">&Icirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;Iuml;')" onClick="Set('&Iuml;')">&Iuml;</td>

-<td class="character" onMouseOver="View(this,'&amp;ETH;')" onClick="Set('&ETH;')">&ETH;</td>

-<td class="character" onMouseOver="View(this,'&amp;Ntilde;')" onClick="Set('&Ntilde;')">&Ntilde;</td>

-<td class="character" onMouseOver="View(this,'&amp;Ograve;')" onClick="Set('&Ograve;')">&Ograve;</td>

-<td class="character" onMouseOver="View(this,'&amp;Oacute;')" onClick="Set('&Oacute;')">&Oacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;Ocirc;')" onClick="Set('&Ocirc;')">&Ocirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;Otilde;')" onClick="Set('&Otilde;')">&Otilde;</td>

-<td class="character" onMouseOver="View(this,'&amp;Ouml;')" onClick="Set('&Ouml;')">&Ouml;</td>

-</tr><tr>

-<td class="character" onMouseOver="View(this,'&amp;reg;')" onClick="Set('&reg;')">&reg;</td>

-<td class="character" onMouseOver="View(this,'&amp;times;')" onClick="Set('&times;')">&times;</td>

-<td class="character" onMouseOver="View(this,'&amp;Ugrave;')" onClick="Set('&Ugrave;')">&Ugrave;</td>

-<td class="character" onMouseOver="View(this,'&amp;Uacute;')" onClick="Set('&Uacute;')">&Uacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;Ucirc;')" onClick="Set('&Ucirc;')">&Ucirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;Uuml;')" onClick="Set('&Uuml;')">&Uuml;</td>

-<td class="character" onMouseOver="View(this,'&amp;Yacute;')" onClick="Set('&Yacute;')">&Yacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;THORN;')" onClick="Set('&THORN;')">&THORN;</td>

-<td class="character" onMouseOver="View(this,'&amp;szlig;')" onClick="Set('&szlig;')">&szlig;</td>

-<td class="character" onMouseOver="View(this,'&amp;agrave;')" onClick="Set('&agrave;')">&agrave;</td>

-<td class="character" onMouseOver="View(this,'&amp;aacute;')" onClick="Set('&aacute;')">&aacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;acirc;')" onClick="Set('&acirc;')">&acirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;atilde;')" onClick="Set('&atilde;')">&atilde;</td>

-<td class="character" onMouseOver="View(this,'&amp;auml;')" onClick="Set('&auml;')">&auml;</td>

-<td class="character" onMouseOver="View(this,'&amp;aring;')" onClick="Set('&aring;')">&aring;</td>

-<td class="character" onMouseOver="View(this,'&amp;aelig;')" onClick="Set('&aelig;')">&aelig;</td>

-</tr><tr>

-<td class="character" onMouseOver="View(this,'&amp;ccedil;')" onClick="Set('&ccedil;')">&ccedil;</td>

-<td class="character" onMouseOver="View(this,'&amp;egrave;')" onClick="Set('&egrave;')">&egrave;</td>

-<td class="character" onMouseOver="View(this,'&amp;eacute;')" onClick="Set('&eacute;')">&eacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;ecirc;')" onClick="Set('&ecirc;')">&ecirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;euml;')" onClick="Set('&euml;')">&euml;</td>

-<td class="character" onMouseOver="View(this,'&amp;igrave;')" onClick="Set('&igrave;')">&igrave;</td>

-<td class="character" onMouseOver="View(this,'&amp;iacute;')" onClick="Set('&iacute;')">&iacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;icirc;')" onClick="Set('&icirc;')">&icirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;iuml;')" onClick="Set('&iuml;')">&iuml;</td>

-<td class="character" onMouseOver="View(this,'&amp;eth;')" onClick="Set('&eth;')">&eth;</td>

-<td class="character" onMouseOver="View(this,'&amp;ntilde;')" onClick="Set('&ntilde;')">&ntilde;</td>

-<td class="character" onMouseOver="View(this,'&amp;ograve;')" onClick="Set('&ograve;')">&ograve;</td>

-<td class="character" onMouseOver="View(this,'&amp;oacute;')" onClick="Set('&oacute;')">&oacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;ocirc;')" onClick="Set('&ocirc;')">&ocirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;otilde;')" onClick="Set('&otilde;')">&otilde;</td>

-<td class="character" onMouseOver="View(this,'&amp;ouml;')" onClick="Set('&ouml;')">&ouml;</td>

-</tr><tr>

-<td class="character" onMouseOver="View(this,'&amp;divide;')" onClick="Set('&divide;')">&divide;</td>

-<td class="character" onMouseOver="View(this,'&amp;oslash;')" onClick="Set('&oslash;')">&oslash;</td>

-<td class="character" onMouseOver="View(this,'&amp;ugrave;')" onClick="Set('&ugrave;')">&ugrave;</td>

-<td class="character" onMouseOver="View(this,'&amp;uacute;')" onClick="Set('&uacute;')">&uacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;ucirc;')" onClick="Set('&ucirc;')">&ucirc;</td>

-<td class="character" onMouseOver="View(this,'&amp;uuml;')" onClick="Set('&uuml;')">&uuml;</td>

-<td class="character" onMouseOver="View(this,'&amp;yacute;')" onClick="Set('&yacute;')">&yacute;</td>

-<td class="character" onMouseOver="View(this,'&amp;thorn;')" onClick="Set('&thorn;')">&thorn;</td>

-<td class="character" onMouseOver="View(this,'&amp;yuml;')" onClick="Set('&yuml;')">&yuml;</td>

-<td class="character" onMouseOver="View(this,'&amp;OElig;')" onClick="Set('&OElig;')">&OElig;</td>

-<td class="character" onMouseOver="View(this,'&amp;oelig;')" onClick="Set('&oelig;')">&oelig;</td>

-<td class="character" onMouseOver="View(this,'&amp;Scaron;')" onClick="Set('&Scaron;')">&Scaron;</td>

-<td class="character">&nbsp;</td>

-<td class="character">&nbsp;</td>

-<td class="character">&nbsp;</td>

-<td class="character">&nbsp;</td>

-</table><br />

-<form style="text-align: center;"><button type="button" name="cancel" onclick="return onCancel();" class="submitInsertTable">Cancel</button></form>

-</body>

-</html>

diff -ruN 6171/e107_handlers/htmlarea/plugins/ContextMenu/1.pl 75/e107_handlers/htmlarea/plugins/ContextMenu/1.pl
--- 6171/e107_handlers/htmlarea/plugins/ContextMenu/1.pl	2004-05-09 15:43:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ContextMenu/1.pl	1969-12-31 18:00:00.000000000 -0600
@@ -1,38 +0,0 @@
-#! /usr/bin/perl -w
-
-use strict;
-
-my $file = 'context-menu.js';
-my $outfile = $file.'-i18n';
-my $langfile = 'en.js';
-
-open FILE, "<$file";
-#open OUTFILE, ">$outfile";
-#open LANGFILE, ">$langfile";
-my %texts = ();
-while (<FILE>) {
-    if (/"(.*?)"/) {
-        my $inline = $_;
-        chomp $inline;
-        my $key = $1;
-        my $val = $1;
-        print "Key: [$key]: ";
-        my $line = <STDIN>;
-        if (defined $line) {
-            chomp $line;
-            if ($line =~ /(\S+)/) {
-                $key = $1;
-                print "-- using $key\n";
-            }
-            $texts{$val} = $key;
-        } else {
-            print " -- skipped...\n";
-        }
-    }
-}
-#close LANGFILE;
-#close OUTFILE;
-close FILE;
-
-print "\n\n\n";
-print '"', join("\"\n\"", sort keys %texts), '"', "\n";
diff -ruN 6171/e107_handlers/htmlarea/plugins/ContextMenu/context-menu.js 75/e107_handlers/htmlarea/plugins/ContextMenu/context-menu.js
--- 6171/e107_handlers/htmlarea/plugins/ContextMenu/context-menu.js	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ContextMenu/context-menu.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,418 +0,0 @@
-// Context Menu Plugin for HTMLArea-3.0
-// Sponsored by www.americanbible.org
-// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
-//
-// (c) dynarch.com 2003.
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-//
-// $Id: context-menu.js,v 1.4 2004/08/11 09:26:37 e107coders Exp $
-
-HTMLArea.loadStyle("menu.css", "ContextMenu");
-
-function ContextMenu(editor) {
-	this.editor = editor;
-};
-
-ContextMenu._pluginInfo = {
-	name          : "ContextMenu",
-	version       : "1.0",
-	developer     : "Mihai Bazon",
-	developer_url : "http://dynarch.com/mishoo/",
-	c_owner       : "dynarch.com",
-	sponsor       : "American Bible Society",
-	sponsor_url   : "http://www.americanbible.org",
-	license       : "htmlArea"
-};
-
-ContextMenu.prototype.onGenerate = function() {
-	var self = this;
-	var doc = this.editordoc = this.editor._iframe.contentWindow.document;
-	HTMLArea._addEvents(doc, ["contextmenu"],
-			    function (event) {
-				    return self.popupMenu(HTMLArea.is_ie ? self.editor._iframe.contentWindow.event : event);
-			    });
-	this.currentMenu = null;
-};
-
-ContextMenu.prototype.getContextMenu = function(target) {
-	var self = this;
-	var editor = this.editor;
-	var config = editor.config;
-	var menu = [];
-	var tbo = this.editor.plugins.TableOperations;
-	if (tbo) tbo = tbo.instance;
-	var i18n = ContextMenu.I18N;
-
-	var selection = editor.hasSelectedText();
-	if (selection)
-		menu.push([ i18n["Cut"], function() { editor.execCommand("cut"); }, null, config.btnList["cut"][1] ],
-			  [ i18n["Copy"], function() { editor.execCommand("copy"); }, null, config.btnList["copy"][1] ]);
-	menu.push([ i18n["Paste"], function() { editor.execCommand("paste"); }, null, config.btnList["paste"][1] ]);
-
-	var currentTarget = target;
-	var elmenus = [];
-
-	var link = null;
-	var table = null;
-	var tr = null;
-	var td = null;
-	var img = null;
-
-	function tableOperation(opcode) {
-		tbo.buttonPress(editor, opcode);
-	};
-
-	for (; target; target = target.parentNode) {
-		var tag = target.tagName;
-		if (!tag)
-			continue;
-		tag = tag.toLowerCase();
-		switch (tag) {
-		    case "img":
-			img = target;
-			elmenus.push(null,
-				     [ i18n["Image Properties"],
-				       function() {
-					       editor._insertImage(img);
-				       },
-				       i18n["Show the image properties dialog"],
-				       config.btnList["insertimage"][1] ]
-				);
-			break;
-		    case "a":
-			link = target;
-			elmenus.push(null,
-				     [ i18n["Modify Link"],
-				       function() { editor.execCommand("createlink", true); },
-				       i18n["Current URL is"] + ': ' + link.href,
-				       config.btnList["createlink"][1] ],
-
-				     [ i18n["Check Link"],
-				       function() { window.open(link.href); },
-				       i18n["Opens this link in a new window"] ],
-
-				     [ i18n["Remove Link"],
-				       function() {
-					       if (confirm(i18n["Please confirm that you want to unlink this element."] + "\n" +
-							   i18n["Link points to:"] + " " + link.href)) {
-						       while (link.firstChild)
-							       link.parentNode.insertBefore(link.firstChild, link);
-						       link.parentNode.removeChild(link);
-					       }
-				       },
-				       i18n["Unlink the current element"] ]
-				);
-			break;
-		    case "td":
-			td = target;
-			if (!tbo) break;
-			elmenus.push(null,
-				     [ i18n["Cell Properties"],
-				       function() { tableOperation("TO-cell-prop"); },
-				       i18n["Show the Table Cell Properties dialog"],
-				       config.btnList["TO-cell-prop"][1] ]
-				);
-			break;
-		    case "tr":
-			tr = target;
-			if (!tbo) break;
-			elmenus.push(null,
-				     [ i18n["Row Properties"],
-				       function() { tableOperation("TO-row-prop"); },
-				       i18n["Show the Table Row Properties dialog"],
-				       config.btnList["TO-row-prop"][1] ],
-
-				     [ i18n["Insert Row Before"],
-				       function() { tableOperation("TO-row-insert-above"); },
-				       i18n["Insert a new row before the current one"],
-				       config.btnList["TO-row-insert-above"][1] ],
-
-				     [ i18n["Insert Row After"],
-				       function() { tableOperation("TO-row-insert-under"); },
-				       i18n["Insert a new row after the current one"],
-				       config.btnList["TO-row-insert-under"][1] ],
-
-				     [ i18n["Delete Row"],
-				       function() { tableOperation("TO-row-delete"); },
-				       i18n["Delete the current row"],
-				       config.btnList["TO-row-delete"][1] ]
-				);
-			break;
-		    case "table":
-			table = target;
-			if (!tbo) break;
-			elmenus.push(null,
-				     [ i18n["Table Properties"],
-				       function() { tableOperation("TO-table-prop"); },
-				       i18n["Show the Table Properties dialog"],
-				       config.btnList["TO-table-prop"][1] ],
-
-				     [ i18n["Insert Column Before"],
-				       function() { tableOperation("TO-col-insert-before"); },
-				       i18n["Insert a new column before the current one"],
-				       config.btnList["TO-col-insert-before"][1] ],
-
-				     [ i18n["Insert Column After"],
-				       function() { tableOperation("TO-col-insert-after"); },
-				       i18n["Insert a new column after the current one"],
-				       config.btnList["TO-col-insert-after"][1] ],
-
-				     [ i18n["Delete Column"],
-				       function() { tableOperation("TO-col-delete"); },
-				       i18n["Delete the current column"],
-				       config.btnList["TO-col-delete"][1] ]
-				);
-			break;
-		    case "body":
-			elmenus.push(null,
-				     [ i18n["Justify Left"],
-				       function() { editor.execCommand("justifyleft"); }, null,
-				       config.btnList["justifyleft"][1] ],
-				     [ i18n["Justify Center"],
-				       function() { editor.execCommand("justifycenter"); }, null,
-				       config.btnList["justifycenter"][1] ],
-				     [ i18n["Justify Right"],
-				       function() { editor.execCommand("justifyright"); }, null,
-				       config.btnList["justifyright"][1] ],
-				     [ i18n["Justify Full"],
-				       function() { editor.execCommand("justifyfull"); }, null,
-				       config.btnList["justifyfull"][1] ]
-				);
-			break;
-		}
-	}
-
-	if (selection && !link)
-		menu.push(null, [ i18n["Make link"],
-				  function() { editor.execCommand("createlink", true); },
-				  i18n["Create a link"],
-				  config.btnList["createlink"][1] ]);
-
-	for (var i = 0; i < elmenus.length; ++i)
-		menu.push(elmenus[i]);
-
-	if (!/html|body/i.test(currentTarget.tagName))
-		menu.push(null,
-			  [ i18n["Remove the"] + " &lt;" + currentTarget.tagName + "&gt; " + i18n["Element"],
-			    function() {
-				    if (confirm(i18n["Please confirm that you want to remove this element:"] + " " +
-						currentTarget.tagName)) {
-					    var el = currentTarget;
-					    var p = el.parentNode;
-					    p.removeChild(el);
-					    if (HTMLArea.is_gecko) {
-						    if (p.tagName.toLowerCase() == "td" && !p.hasChildNodes())
-							    p.appendChild(editor._doc.createElement("br"));
-						    editor.forceRedraw();
-						    editor.focusEditor();
-						    editor.updateToolbar();
-						    if (table) {
-							    var save_collapse = table.style.borderCollapse;
-							    table.style.borderCollapse = "collapse";
-							    table.style.borderCollapse = "separate";
-							    table.style.borderCollapse = save_collapse;
-						    }
-					    }
-				    }
-			    },
-			    i18n["Remove this node from the document"] ]);
-	return menu;
-};
-
-ContextMenu.prototype.popupMenu = function(ev) {
-	var self = this;
-	var i18n = ContextMenu.I18N;
-	if (this.currentMenu)
-		this.currentMenu.parentNode.removeChild(this.currentMenu);
-	function getPos(el) {
-		var r = { x: el.offsetLeft, y: el.offsetTop };
-		if (el.offsetParent) {
-			var tmp = getPos(el.offsetParent);
-			r.x += tmp.x;
-			r.y += tmp.y;
-		}
-		return r;
-	};
-	function documentClick(ev) {
-		ev || (ev = window.event);
-		if (!self.currentMenu) {
-			alert(i18n["How did you get here? (Please report!)"]);
-			return false;
-		}
-		var el = HTMLArea.is_ie ? ev.srcElement : ev.target;
-		for (; el != null && el != self.currentMenu; el = el.parentNode);
-		if (el == null)
-			self.closeMenu();
-		//HTMLArea._stopEvent(ev);
-		//return false;
-	};
-	var keys = [];
-	function keyPress(ev) {
-		ev || (ev = window.event);
-		HTMLArea._stopEvent(ev);
-		if (ev.keyCode == 27) {
-			self.closeMenu();
-			return false;
-		}
-		var key = String.fromCharCode(HTMLArea.is_ie ? ev.keyCode : ev.charCode).toLowerCase();
-		for (var i = keys.length; --i >= 0;) {
-			var k = keys[i];
-			if (k[0].toLowerCase() == key)
-				k[1].__msh.activate();
-		}
-	};
-	self.closeMenu = function() {
-		self.currentMenu.parentNode.removeChild(self.currentMenu);
-		self.currentMenu = null;
-		HTMLArea._removeEvent(document, "mousedown", documentClick);
-		HTMLArea._removeEvent(self.editordoc, "mousedown", documentClick);
-		if (keys.length > 0)
-			HTMLArea._removeEvent(self.editordoc, "keypress", keyPress);
-		if (HTMLArea.is_ie)
-			self.iePopup.hide();
-	};
-	var target = HTMLArea.is_ie ? ev.srcElement : ev.target;
-	var ifpos = getPos(self.editor._iframe);
-	var x = ev.clientX + ifpos.x;
-	var y = ev.clientY + ifpos.y;
-
-	var div;
-	var doc;
-	if (!HTMLArea.is_ie) {
-		doc = document;
-	} else {
-		// IE stinks
-		var popup = this.iePopup = window.createPopup();
-		doc = popup.document;
-		doc.open();
-		doc.write("<html><head><style type='text/css'>@import url(" + _editor_url + "plugins/ContextMenu/menu.css); html, body { padding: 0px; margin: 0px; overflow: hidden; border: 0px; }</style></head><body unselectable='yes'></body></html>");
-		doc.close();
-	}
-	div = doc.createElement("div");
-	if (HTMLArea.is_ie)
-		div.unselectable = "on";
-	div.oncontextmenu = function() { return false; };
-	div.className = "htmlarea-context-menu";
-	if (!HTMLArea.is_ie)
-		div.style.left = div.style.top = "0px";
-	doc.body.appendChild(div);
-
-	var table = doc.createElement("table");
-	div.appendChild(table);
-	table.cellSpacing = 0;
-	table.cellPadding = 0;
-	var parent = doc.createElement("tbody");
-	table.appendChild(parent);
-
-	var options = this.getContextMenu(target);
-	for (var i = 0; i < options.length; ++i) {
-		var option = options[i];
-		var item = doc.createElement("tr");
-		parent.appendChild(item);
-		if (HTMLArea.is_ie)
-			item.unselectable = "on";
-		else item.onmousedown = function(ev) {
-			HTMLArea._stopEvent(ev);
-			return false;
-		};
-		if (!option) {
-			item.className = "separator";
-			var td = doc.createElement("td");
-			td.className = "icon";
-			var IE_IS_A_FUCKING_SHIT = '>';
-			if (HTMLArea.is_ie) {
-				td.unselectable = "on";
-				IE_IS_A_FUCKING_SHIT = " unselectable='on' style='height=1px'>&nbsp;";
-			}
-			td.innerHTML = "<div" + IE_IS_A_FUCKING_SHIT + "</div>";
-			var td1 = td.cloneNode(true);
-			td1.className = "label";
-			item.appendChild(td);
-			item.appendChild(td1);
-		} else {
-			var label = option[0];
-			item.className = "item";
-			item.__msh = {
-				item: item,
-				label: label,
-				action: option[1],
-				tooltip: option[2] || null,
-				icon: option[3] || null,
-				activate: function() {
-					self.closeMenu();
-					self.editor.focusEditor();
-					this.action();
-				}
-			};
-			label = label.replace(/_([a-zA-Z0-9])/, "<u>$1</u>");
-			if (label != option[0])
-				keys.push([ RegExp.$1, item ]);
-			label = label.replace(/__/, "_");
-			var td1 = doc.createElement("td");
-			if (HTMLArea.is_ie)
-				td1.unselectable = "on";
-			item.appendChild(td1);
-			td1.className = "icon";
-			if (item.__msh.icon)
-				td1.innerHTML = "<img align='middle' src='" + item.__msh.icon + "' />";
-			var td2 = doc.createElement("td");
-			if (HTMLArea.is_ie)
-				td2.unselectable = "on";
-			item.appendChild(td2);
-			td2.className = "label";
-			td2.innerHTML = label;
-			item.onmouseover = function() {
-				this.className += " hover";
-				self.editor._statusBarTree.innerHTML = this.__msh.tooltip || '&nbsp;';
-			};
-			item.onmouseout = function() { this.className = "item"; };
-			item.oncontextmenu = function(ev) {
-				this.__msh.activate();
-				if (!HTMLArea.is_ie)
-					HTMLArea._stopEvent(ev);
-				return false;
-			};
-			item.onmouseup = function(ev) {
-				var timeStamp = (new Date()).getTime();
-				if (timeStamp - self.timeStamp > 500)
-					this.__msh.activate();
-				if (!HTMLArea.is_ie)
-					HTMLArea._stopEvent(ev);
-				return false;
-			};
-			//if (typeof option[2] == "string")
-			//item.title = option[2];
-		}
-	}
-
-	if (!HTMLArea.is_ie) {
-		var dx = x + div.offsetWidth - window.innerWidth + 4;
-		var dy = y + div.offsetHeight - window.innerHeight + 4;
-		if (dx > 0) x -= dx;
-		if (dy > 0) y -= dy;
-		div.style.left = x + "px";
-		div.style.top = y + "px";
-	} else {
-		// determine the size (did I mention that IE stinks?)
-		var foobar = document.createElement("div");
-		foobar.className = "htmlarea-context-menu";
-		foobar.innerHTML = div.innerHTML;
-		document.body.appendChild(foobar);
-		var w = foobar.offsetWidth;
-		var h = foobar.offsetHeight;
-		document.body.removeChild(foobar);
-		this.iePopup.show(ev.screenX, ev.screenY, w, h);
-	}
-
-	this.currentMenu = div;
-	this.timeStamp = (new Date()).getTime();
-
-	HTMLArea._addEvent(document, "mousedown", documentClick);
-	HTMLArea._addEvent(this.editordoc, "mousedown", documentClick);
-	if (keys.length > 0)
-		HTMLArea._addEvent(this.editordoc, "keypress", keyPress);
-
-	HTMLArea._stopEvent(ev);
-	return false;
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/de.js 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/de.js
--- 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/de.js	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/de.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,59 +0,0 @@
-﻿// I18N constants
-
-// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
-
-// translated: <]{MJ}[>  i@student.ethz.ch
-
-
-ContextMenu.I18N = {
-	// Items that appear in menu.  Please note that an underscore (_)
-	// character in the translation (right column) will cause the following
-	// letter to become underlined and be shortcut for that menu option.
-
-	"Cut"                                                   : "Ausschneiden",
-	"Copy"                                                  : "Kopieren",
-	"Paste"                                                 : "Einfügen",
-	"Image Properties"                                      : "_Bild Einstellungen...",
-	"Modify Link"                                           : "_Link ändern...",
-	"Check Link"                                            : "Link testen...",
-	"Remove Link"                                           : "Link entfernen...",
-	"Cell Properties"                                       : "Z_ellen Einstellungen...",
-	"Row Properties"                                        : "Ze_ilen Einstellungen...",
-	"Insert Row Before"                                     : "Zeile einfügen v_or Position",
-	"Insert Row After"                                      : "Zeile einfügen n_ach Position",
-	"Delete Row"                                            : "Zeile löschen",
-	"Table Properties"                                      : "_Tabellen Einstellungen...",
-	"Insert Column Before"                                  : "Spalte einfügen vo_r Position",
-	"Insert Column After"                                   : "Spalte einfügen na_ch Position",
-	"Delete Column"                                         : "Spalte löschen",
-	"Justify Left"                                          : "Links ausrichten",
-	"Justify Center"                                        : "Zentriert",
-	"Justify Right"                                         : "Rechts ausrichten",
-	"Justify Full"                                          : "Blocksatz",
-	"Make link"                                             : "Lin_k erstellen...",
-	"Remove the"                                            : "",
-	"Element"                                               : "Element entfernen...",
-
-	// Other labels (tooltips and alert/confirm box messages)
-
-	"Please confirm that you want to remove this element:"  : "Wollen sie dieses Element wirklich entfernen ?",
-	"Remove this node from the document"                    : "Dieses Element aus dem Dokument entfernen",
-	"How did you get here? (Please report!)"                : "How did you get here? (Please report!)",
-	"Show the image properties dialog"                      : "Fenster für die Bild-Einstellungen anzeigen",
-	"Modify URL"                                            : "URL ändern",
-	"Current URL is"                                        : "Aktuelle URL ist",
-	"Opens this link in a new window"                       : "Diesen Link in neuem Fenster öffnen",
-	"Please confirm that you want to unlink this element."  : "Wollen sie diesen Link wirklich entfernen ?",
-	"Link points to:"                                       : "Link zeigt auf:",
-	"Unlink the current element"                            : "Link auf Element entfernen",
-	"Show the Table Cell Properties dialog"                 : "Zellen-Einstellungen anzeigen",
-	"Show the Table Row Properties dialog"                  : "Zeilen-Einstellungen anzeigen",
-	"Insert a new row before the current one"               : "Zeile einfügen vor der aktuellen Position",
-	"Insert a new row after the current one"                : "Zeile einfügen nach der aktuellen Position",
-	"Delete the current row"                                : "Zeile löschen",
-	"Show the Table Properties dialog"                      : "Show the Table Properties dialog",
-	"Insert a new column before the current one"            : "Spalte einfügen vor der aktuellen Position",
-	"Insert a new column after the current one"             : "Spalte einfügen nach der aktuellen Position",
-	"Delete the current column"                             : "Spalte löschen",
-	"Create a link"                                         : "Link erstellen"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/el.js 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/el.js
--- 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/el.js	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/el.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,57 +0,0 @@
-// I18N constants
-
-// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
-// Author: Dimitris Glezos, dimitris@glezos.com
-
-ContextMenu.I18N = {
-	// Items that appear in menu.  Please note that an underscore (_)
-	// character in the translation (right column) will cause the following
-	// letter to become underlined and be shortcut for that menu option.
-
-	"Cut"                                                   : "Αποκοπή",
-	"Copy"                                                  : "Αντιγραφή",
-	"Paste"                                                 : "Επικόλληση",
-	"Image Properties"                                      : "Ιδιότητες Εικόνας...",
-	"Modify Link"                                           : "Τροποποίηση συνδέσμου...",
-	"Check Link"                                            : "Έλεγχος συνδέσμων...",
-	"Remove Link"                                           : "Διαγραφή συνδέσμου...",
-	"Cell Properties"                                       : "Ιδιότητες κελιού...",
-	"Row Properties"                                        : "Ιδιότητες γραμμής...",
-	"Insert Row Before"                                     : "Εισαγωγή γραμμής πριν",
-	"Insert Row After"                                      : "Εισαγωγή γραμμής μετά",
-	"Delete Row"                                            : "Διαγραφή γραμμής",
-	"Table Properties"                                      : "Ιδιότητες πίνακα...",
-	"Insert Column Before"                                  : "Εισαγωγή στήλης πριν",
-	"Insert Column After"                                   : "Εισαγωγή στήλης μετά",
-	"Delete Column"                                         : "Διαγραφή στήλης",
-	"Justify Left"                                          : "Στοίχηση Αριστερά",
-	"Justify Center"                                        : "Στοίχηση Κέντρο",
-	"Justify Right"                                         : "Στοίχηση Δεξιά",
-	"Justify Full"                                          : "Πλήρης Στοίχηση",
-	"Make link"                                             : "Δημιουργία συνδέσμου...",
-	"Remove the"                                            : "Αφαίρεση",
-	"Element"                                               : "στοιχείου...",
-
-	// Other labels (tooltips and alert/confirm box messages)
-
-	"Please confirm that you want to remove this element:"  : "Είστε βέβαιος πως θέλετε να αφαιρέσετε το στοιχείο ",
-	"Remove this node from the document"                    : "Αφαίρεση αυτού του κόμβου από το έγγραφο",
-	"How did you get here? (Please report!)"                : "Πώς ήρθατε μέχρι εδώ; (Παρακαλούμε αναφέρετε το!)",
-	"Show the image properties dialog"                      : "Εμφάνιση διαλόγου με τις Ιδιότητες εικόνας",
-	"Modify URL"                                            : "Τροποποίηση URL",
-	"Current URL is"                                        : "Το τρέχων URL είναι",
-	"Opens this link in a new window"                       : "Ανοίγει αυτό τον σύνδεσμο σε ένα νέο παράθυρο",
-	"Please confirm that you want to unlink this element."  : "Είστε βέβαιος πως θέλετε να αφαιρέσετε τον σύνδεσμο από αυτό το στοιχείο:",
-	"Link points to:"                                       : "Ο σύνδεμος οδηγεί εδώ:",
-	"Unlink the current element"                            : "Αφαίρεση συνδέσμου από το παρών στοιχείο",
-	"Show the Table Cell Properties dialog"                 : "Εμφάνιση διαλόγου με τις Ιδιότητες κελιού Πίνακα",
-	"Show the Table Row Properties dialog"                  : "Εμφάνιση διαλόγου με τις Ιδιότητες γραμμής Πίνακα",
-	"Insert a new row before the current one"               : "Εισαγωγή μιας νέας γραμμής πριν την επιλεγμένη",
-	"Insert a new row after the current one"                : "Εισαγωγή μιας νέας γραμμής μετά την επιλεγμένη",
-	"Delete the current row"                                : "Διαγραφή επιλεγμένης γραμμής",
-	"Show the Table Properties dialog"                      : "Εμφάνιση διαλόγου με τις Ιδιότητες Πίνακα",
-	"Insert a new column before the current one"            : "Εισαγωγή νέας στήλης πριν την επιλεγμένη",
-	"Insert a new column after the current one"             : "Εισαγωγή νέας στήλης μετά την επιλεγμένη",
-	"Delete the current column"                             : "Διαγραφή επιλεγμένης στήλης",
-	"Create a link"                                         : "Δημιουργία συνδέσμου"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/en.js 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/en.js
--- 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/en.js	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,66 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-ContextMenu.I18N = {
-	// Items that appear in menu.  Please note that an underscore (_)
-	// character in the translation (right column) will cause the following
-	// letter to become underlined and be shortcut for that menu option.
-
-	"Cut"                                                   : "Cut",
-	"Copy"                                                  : "Copy",
-	"Paste"                                                 : "Paste",
-	"Image Properties"                                      : "_Image Properties...",
-	"Modify Link"                                           : "_Modify Link...",
-	"Check Link"                                            : "Chec_k Link...",
-	"Remove Link"                                           : "_Remove Link...",
-	"Cell Properties"                                       : "C_ell Properties...",
-	"Row Properties"                                        : "Ro_w Properties...",
-	"Insert Row Before"                                     : "I_nsert Row Before",
-	"Insert Row After"                                      : "In_sert Row After",
-	"Delete Row"                                            : "_Delete Row",
-	"Table Properties"                                      : "_Table Properties...",
-	"Insert Column Before"                                  : "Insert _Column Before",
-	"Insert Column After"                                   : "Insert C_olumn After",
-	"Delete Column"                                         : "De_lete Column",
-	"Justify Left"                                          : "Justify Left",
-	"Justify Center"                                        : "Justify Center",
-	"Justify Right"                                         : "Justify Right",
-	"Justify Full"                                          : "Justify Full",
-	"Make link"                                             : "Make lin_k...",
-	"Remove the"                                            : "Remove the",
-	"Element"                                               : "Element...",
-
-	// Other labels (tooltips and alert/confirm box messages)
-
-	"Please confirm that you want to remove this element:"  : "Please confirm that you want to remove this element:",
-	"Remove this node from the document"                    : "Remove this node from the document",
-	"How did you get here? (Please report!)"                : "How did you get here? (Please report!)",
-	"Show the image properties dialog"                      : "Show the image properties dialog",
-	"Modify URL"                                            : "Modify URL",
-	"Current URL is"                                        : "Current URL is",
-	"Opens this link in a new window"                       : "Opens this link in a new window",
-	"Please confirm that you want to unlink this element."  : "Please confirm that you want to unlink this element.",
-	"Link points to:"                                       : "Link points to:",
-	"Unlink the current element"                            : "Unlink the current element",
-	"Show the Table Cell Properties dialog"                 : "Show the Table Cell Properties dialog",
-	"Show the Table Row Properties dialog"                  : "Show the Table Row Properties dialog",
-	"Insert a new row before the current one"               : "Insert a new row before the current one",
-	"Insert a new row after the current one"                : "Insert a new row after the current one",
-	"Delete the current row"                                : "Delete the current row",
-	"Show the Table Properties dialog"                      : "Show the Table Properties dialog",
-	"Insert a new column before the current one"            : "Insert a new column before the current one",
-	"Insert a new column after the current one"             : "Insert a new column after the current one",
-	"Delete the current column"                             : "Delete the current column",
-	"Create a link"                                         : "Create a link"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/he.js 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/he.js
--- 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/he.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/he.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,66 +0,0 @@
-// I18N constants

-

-// LANG: "he", ENCODING: UTF-8

-// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-ContextMenu.I18N = {

-	// Items that appear in menu.  Please note that an underscore (_)

-	// character in the translation (right column) will cause the following

-	// letter to become underlined and be shortcut for that menu option.

-

-	"Cut"                                                   : "גזור",

-	"Copy"                                                  : "העתק",

-	"Paste"                                                 : "הדבק",

-	"Image Properties"                                      : "_מאפייני תמונה...",

-	"Modify Link"                                           : "_שנה קישור...",

-	"Check Link"                                            : "בדו_ק קישור...",

-	"Remove Link"                                           : "_הסר קישור...",

-	"Cell Properties"                                       : "מאפייני ת_א...",

-	"Row Properties"                                        : "מאפייני _טור...",

-	"Insert Row Before"                                     : "ה_כנס שורה לפני",

-	"Insert Row After"                                      : "הכנ_ס שורה אחרי",

-	"Delete Row"                                            : "_מחק שורה",

-	"Table Properties"                                      : "מאפייני ט_בלה...",

-	"Insert Column Before"                                  : "הכנס _טור לפני",

-	"Insert Column After"                                   : "הכנס ט_ור אחרי",

-	"Delete Column"                                         : "מח_ק טור",

-	"Justify Left"                                          : "ישור לשמאל",

-	"Justify Center"                                        : "ישור למרכז",

-	"Justify Right"                                         : "ישור לימין",

-	"Justify Full"                                          : "ישור לשורה מלאה",

-	"Make link"                                             : "צור קי_שור...",

-	"Remove the"                                            : "הסר את אלמנט ה-",

-	"Element"                                               : "...",

-

-	// Other labels (tooltips and alert/confirm box messages)

-

-	"Please confirm that you want to remove this element:"  : "אנא אשר שברצונך להסיר את האלמנט הזה:",

-	"Remove this node from the document"                    : "הסרה של node זה מהמסמך",

-	"How did you get here? (Please report!)"                : "איך הגעת הנה? (אנא דווח!)",

-	"Show the image properties dialog"                      : "מציג את חלון הדו-שיח של מאפייני תמונה",

-	"Modify URL"                                            : "שינוי URL",

-	"Current URL is"                                        : "URL נוכחי הוא",

-	"Opens this link in a new window"                       : "פתיחת קישור זה בחלון חדש",

-	"Please confirm that you want to unlink this element."  : "אנא אשר שאתה רוצה לנתק את אלמנט זה.",

-	"Link points to:"                                       : "הקישור מצביע אל:",

-	"Unlink the current element"                            : "ניתוק את האלמנט הנוכחי",

-	"Show the Table Cell Properties dialog"                 : "מציג את חלון הדו-שיח של מאפייני תא בטבלה",

-	"Show the Table Row Properties dialog"                  : "מציג את חלון הדו-שיח של מאפייני שורה בטבלה",

-	"Insert a new row before the current one"               : "הוספת שורה חדשה לפני הנוכחית",

-	"Insert a new row after the current one"                : "הוספת שורה חדשה אחרי הנוכחית",

-	"Delete the current row"                                : "מחיקת את השורה הנוכחית",

-	"Show the Table Properties dialog"                      : "מציג את חלון הדו-שיח של מאפייני טבלה",

-	"Insert a new column before the current one"            : "הוספת טור חדש לפני הנוכחי",

-	"Insert a new column after the current one"             : "הוספת טור חדש אחרי הנוכחי",

-	"Delete the current column"                             : "מחיקת את הטור הנוכחי",

-	"Create a link"                                         : "יצירת קישור"

-};

diff -ruN 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/nl.js 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/nl.js
--- 6171/e107_handlers/htmlarea/plugins/ContextMenu/lang/nl.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ContextMenu/lang/nl.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,66 +0,0 @@
-// I18N constants

-

-// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1

-// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-ContextMenu.I18N = {

-	// Items that appear in menu.  Please note that an underscore (_)

-	// character in the translation (right column) will cause the following

-	// letter to become underlined and be shortcut for that menu option.

-

-	"Cut"                                                   : "Knippen",

-	"Copy"                                                  : "Kopiren",

-	"Paste"                                                 : "Plakken",

-	"Image Properties"                                      : "Eigenschappen afbeelding...",

-	"Modify Link"                                           : "Hyperlin_k aanpassen...",

-	"Check Link"                                            : "Controleer hyperlin_k...",

-	"Remove Link"                                           : "Ve_rwijder hyperlink...",

-	"Cell Properties"                                       : "C_eleigenschappen...",

-	"Row Properties"                                        : "Rijeigenscha_ppen...",

-	"Insert Row Before"                                     : "Rij invoegen boven",

-	"Insert Row After"                                      : "Rij invoegen onder",

-	"Delete Row"                                            : "Rij _verwijderen",

-	"Table Properties"                                      : "_Tabeleigenschappen...",

-	"Insert Column Before"                                  : "Kolom invoegen voor",

-	"Insert Column After"                                   : "Kolom invoegen na",

-	"Delete Column"                                         : "Kolom verwijderen",

-	"Justify Left"                                          : "Links uitlijnen",

-	"Justify Center"                                        : "Centreren",

-	"Justify Right"                                         : "Rechts uitlijnen",

-	"Justify Full"                                          : "Uitvullen",

-	"Make link"                                             : "Maak hyperlin_k...",

-	"Remove the"                                            : "Verwijder het",

-	"Element"                                               : "element...",

-

-	// Other labels (tooltips and alert/confirm box messages)

-

-	"Please confirm that you want to remove this element:"  : "Is het werkelijk de bedoeling dit element te verwijderen:",

-	"Remove this node from the document"                    : "Verwijder dit punt van het document",

-	"How did you get here? (Please report!)"                : "Hoe kwam je hier? (A.U.B. doorgeven!)",

-	"Show the image properties dialog"                      : "Laat het afbeeldingseigenschappen dialog zien",

-	"Modify URL"                                            : "Aanpassen URL",

-	"Current URL is"                                        : "Huidig URL is",

-	"Opens this link in a new window"                       : "Opend deze hyperlink in een nieuw venster",

-	"Please confirm that you want to unlink this element."  : "Is het werkelijk de bedoeling dit element te unlinken.",

-	"Link points to:"                                       : "Hyperlink verwijst naar:",

-	"Unlink the current element"                            : "Unlink het huidige element",

-	"Show the Table Cell Properties dialog"                 : "Laat de tabel celeigenschappen dialog zien",

-	"Show the Table Row Properties dialog"                  : "Laat de tabel rijeigenschappen dialog zien",

-	"Insert a new row before the current one"               : "Voeg een nieuwe rij in boven de huidige",

-	"Insert a new row after the current one"                : "Voeg een nieuwe rij in onder de huidige",

-	"Delete the current row"                                : "Verwijder de huidige rij",

-	"Show the Table Properties dialog"                      : "Laat de tabel eigenschappen dialog zien",

-	"Insert a new column before the current one"            : "Voeg een nieuwe kolom in voor de huidige",

-	"Insert a new column after the current one"             : "Voeg een nieuwe kolom in na de huidige",

-	"Delete the current column"                             : "Verwijder de huidige kolom",

-	"Create a link"                                         : "Maak een hyperlink"

-};

diff -ruN 6171/e107_handlers/htmlarea/plugins/ContextMenu/makefile.xml 75/e107_handlers/htmlarea/plugins/ContextMenu/makefile.xml
--- 6171/e107_handlers/htmlarea/plugins/ContextMenu/makefile.xml	2004-05-09 15:43:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ContextMenu/makefile.xml	1969-12-31 18:00:00.000000000 -0600
@@ -1,6 +0,0 @@
-<files>
-  <file name="*.{js,html,cgi,css}" />
-
-  <dir name="lang" />
-</files>
-
diff -ruN 6171/e107_handlers/htmlarea/plugins/ContextMenu/menu.css 75/e107_handlers/htmlarea/plugins/ContextMenu/menu.css
--- 6171/e107_handlers/htmlarea/plugins/ContextMenu/menu.css	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ContextMenu/menu.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,65 +0,0 @@
-/* styles for the ContextMenu /HTMLArea */
-/* The ContextMenu plugin is (c) dynarch.com 2003. */
-/* Distributed under the same terms as HTMLArea itself */
-
-div.htmlarea-context-menu {
-  position: absolute;
-  border: 1px solid #aca899;
-  padding: 2px;
-  background-color: #fff;
-  color: #000;
-  cursor: default;
-  z-index: 1000;
-}
-
-div.htmlarea-context-menu table {
-  font: 11px tahoma,verdana,sans-serif;
-  border-collapse: collapse;
-}
-
-div.htmlarea-context-menu tr.item td.icon img {
-  width: 18px;
-  height: 18px;
-}
-
-div.htmlarea-context-menu tr.item td.icon {
-  padding: 0px 3px;
-  height: 18px;
-  background-color: #cdf;
-}
-
-div.htmlarea-context-menu tr.item td.label {
-  padding: 1px 10px 1px 3px;
-}
-
-div.htmlarea-context-menu tr.separator td {
-  padding: 2px 0px;
-}
-
-div.htmlarea-context-menu tr.separator td div {
-  border-top: 1px solid #aca899;
-  overflow: hidden;
-  position: relative;
-}
-
-div.htmlarea-context-menu tr.separator td.icon {
-  background-color: #cdf;
-}
-
-div.htmlarea-context-menu tr.separator td.icon div {
-/*  margin-left: 3px; */
-  border-color: #fff;
-}
-
-div.htmlarea-context-menu tr.separator td.label div {
-  margin-right: 3px;
-}
-
-div.htmlarea-context-menu tr.item.hover {
-  background-color: #316ac5;
-  color: #fff;
-}
-
-div.htmlarea-context-menu tr.item.hover td.icon {
-  background-color: #619af5;
-}
diff -ruN 6171/e107_handlers/htmlarea/plugins/CSS/css.js 75/e107_handlers/htmlarea/plugins/CSS/css.js
--- 6171/e107_handlers/htmlarea/plugins/CSS/css.js	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/CSS/css.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,116 +0,0 @@
-// Simple CSS (className) plugin for the editor
-// Sponsored by http://www.miro.com.au
-// Implementation by Mihai Bazon, http://dynarch.com/mishoo.
-//
-// (c) dynarch.com 2003
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-//
-// $Id: css.js,v 1.3 2004/08/11 09:26:36 e107coders Exp $
-
-function CSS(editor, params) {
-	this.editor = editor;
-	var cfg = editor.config;
-	var toolbar = cfg.toolbar;
-	var self = this;
-	var i18n = CSS.I18N;
-	var plugin_config = params[0];
-	var combos = plugin_config.combos;
-
-	var first = true;
-	for (var i = combos.length; --i >= 0;) {
-		var combo = combos[i];
-		var id = "CSS-class" + i;
-		var css_class = {
-			id         : id,
-			options    : combo.options,
-			action     : function(editor) { self.onSelect(editor, this, combo.context, combo.updatecontextclass); },
-			refresh    : function(editor) { self.updateValue(editor, this); },
-			context    : combo.context
-		};
-		cfg.registerDropdown(css_class);
-
-		// prepend to the toolbar
-		toolbar[1].splice(0, 0, first ? "separator" : "space");
-		toolbar[1].splice(0, 0, id);
-		if (combo.label)
-			toolbar[1].splice(0, 0, "T[" + combo.label + "]");
-		first = false;
-	}
-};
-
-CSS._pluginInfo = {
-	name          : "CSS",
-	version       : "1.0",
-	developer     : "Mihai Bazon",
-	developer_url : "http://dynarch.com/mishoo/",
-	c_owner       : "Mihai Bazon",
-	sponsor       : "Miro International",
-	sponsor_url   : "http://www.miro.com.au",
-	license       : "htmlArea"
-};
-
-CSS.prototype.onSelect = function(editor, obj, context, updatecontextclass) {
-	var tbobj = editor._toolbarObjects[obj.id];
-	var index = tbobj.element.selectedIndex;
-	var className = tbobj.element.value;
-
-	// retrieve parent element of the selection
-	var parent = editor.getParentElement();
-	var surround = true;
-
-	var is_span = (parent && parent.tagName.toLowerCase() == "span");
-	var update_parent = (context && updatecontextclass && parent && parent.tagName.toLowerCase() == context);
-
-	if (update_parent) {
-		parent.className = className;
-		editor.updateToolbar();
-		return;
-	}
-
-	if (is_span && index == 0 && !/\S/.test(parent.style.cssText)) {
-		while (parent.firstChild) {
-			parent.parentNode.insertBefore(parent.firstChild, parent);
-		}
-		parent.parentNode.removeChild(parent);
-		editor.updateToolbar();
-		return;
-	}
-
-	if (is_span) {
-		// maybe we could simply change the class of the parent node?
-		if (parent.childNodes.length == 1) {
-			parent.className = className;
-			surround = false;
-			// in this case we should handle the toolbar updation
-			// ourselves.
-			editor.updateToolbar();
-		}
-	}
-
-	// Other possibilities could be checked but require a lot of code.  We
-	// can't afford to do that now.
-	if (surround) {
-		// shit happens ;-) most of the time.  this method works, but
-		// it's dangerous when selection spans multiple block-level
-		// elements.
-		editor.surroundHTML("<span class='" + className + "'>", "</span>");
-	}
-};
-
-CSS.prototype.updateValue = function(editor, obj) {
-	var select = editor._toolbarObjects[obj.id].element;
-	var parent = editor.getParentElement();
-	if (typeof parent.className != "undefined" && /\S/.test(parent.className)) {
-		var options = select.options;
-		var value = parent.className;
-		for (var i = options.length; --i >= 0;) {
-			var option = options[i];
-			if (value == option.value) {
-				select.selectedIndex = i;
-				return;
-			}
-		}
-	}
-	select.selectedIndex = 0;
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/CSS/lang/en.js 75/e107_handlers/htmlarea/plugins/CSS/lang/en.js
--- 6171/e107_handlers/htmlarea/plugins/CSS/lang/en.js	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/CSS/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,2 +0,0 @@
-// none yet; this file is a stub.
-CSS.I18N = {};
diff -ruN 6171/e107_handlers/htmlarea/plugins/EnterParagraphs/enter-paragraphs.js 75/e107_handlers/htmlarea/plugins/EnterParagraphs/enter-paragraphs.js
--- 6171/e107_handlers/htmlarea/plugins/EnterParagraphs/enter-paragraphs.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/EnterParagraphs/enter-paragraphs.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,204 +0,0 @@
-// Modification to htmlArea to insert Paragraphs instead of
-// linebreaks, under Gecko engines, circa January 2004
-// By Adam Wright, for The University of Western Australia
-//
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-
-function EnterParagraphs(editor, params) {
-	this.editor = editor;
-	// activate only if we're talking to Gecko
-	if (HTMLArea.is_gecko)
-		this.onKeyPress = this.__onKeyPress;
-};
-
-EnterParagraphs._pluginInfo = {
-	name          : "EnterParagraphs",
-	version       : "1.0",
-	developer     : "Adam Wright",
-	developer_url : "http://blog.hipikat.org/",
-	sponsor       : "The University of Western Australia",
-	sponsor_url   : "http://www.uwa.edu.au/",
-	license       : "htmlArea"
-};
-
-// An array of elements who, in html4, by default, have an inline display and can have children
-// we use RegExp here since it should be a bit faster, also cleaner to check
-EnterParagraphs.prototype._html4_inlines_re = /^(a|abbr|acronym|b|bdo|big|cite|code|dfn|em|font|i|kbd|label|q|s|samp|select|small|span|strike|strong|sub|sup|textarea|tt|u|var)$/i;
-
-// Finds the first parent element of a given node whose display is probably not inline
-EnterParagraphs.prototype.parentBlock = function(node) {
-	while (node.parentNode && (node.nodeType != 1 || this._html4_inlines_re.test(node.tagName)))
-		node = node.parentNode;
-	return node;
-};
-
-// Internal function for recursively itterating over a all nodes in a fragment
-// If a callback function returns a non-null value, that is returned and the crawl is therefore broken
-EnterParagraphs.prototype.walkNodeChildren = function(me, callback) {
-	if (me.firstChild) {
-		var myChild = me.firstChild;
-		var retVal;
-		while (myChild) {
-			if ((retVal = callback(this, myChild)) != null)
-				return retVal;
-			if ((retVal = this.walkNodeChildren(myChild, callback)) != null)
-				return retVal;
-			myChild = myChild.nextSibling;
-		}
-	}
-};
-
-// Callback function to be performed on each node in the hierarchy
-// Sets flag to true if we find actual text or an element that's not usually displayed inline
-EnterParagraphs.prototype._isFilling = function(self, node) {
-	if (node.nodeType == 1 && !self._html4_inlines_re.test(node.nodeName))
-		return true;
-	else if (node.nodeType == 3 && node.nodeValue != '')
-		return true;
-	return null;
-	//alert(node.nodeName);
-};
-
-// Inserts a node deeply on the left of a hierarchy of nodes
-EnterParagraphs.prototype.insertDeepLeftText = function(target, toInsert) {
-	var falling = target;
-	while (falling.firstChild && falling.firstChild.nodeType == 1)
-		falling = falling.firstChild;
-	//var refNode = falling.firstChild ? falling.firstChild : null;
-	//falling.insertBefore(toInsert, refNode);
-	falling.innerHTML = toInsert;
-};
-
-// Kind of like a macros, for a frequent query...
-EnterParagraphs.prototype.isElem = function(node, type) {
-	return node.nodeName.toLowerCase() == type.toLowerCase();
-};
-
-// The onKeyPress even that does all the work - nicely breaks the line into paragraphs
-EnterParagraphs.prototype.__onKeyPress = function(ev) {
-
-	if (ev.keyCode == 13 && !ev.shiftKey && this.editor._iframe.contentWindow.getSelection) {
-
-		var editor = this.editor;
-
-		// Get the selection and solid references to what we're dealing with chopping
-		var sel = editor._iframe.contentWindow.getSelection();
-
-		// Set the start and end points such that they're going /forward/ through the document
-		var rngLeft = editor._doc.createRange();		var rngRight = editor._doc.createRange();
-		rngLeft.setStart(sel.anchorNode, sel.anchorOffset);	rngRight.setStart(sel.focusNode, sel.focusOffset);
-		rngLeft.collapse(true);					rngRight.collapse(true);
-
-		var direct = rngLeft.compareBoundaryPoints(rngLeft.START_TO_END, rngRight) < 0;
-
-		var startNode = direct ? sel.anchorNode : sel.focusNode;
-		var startOffset = direct ? sel.anchorOffset : sel.focusOffset;
-		var endNode = direct ? sel.focusNode : sel.anchorNode;
-		var endOffset = direct ? sel.focusOffset : sel.anchorOffset;
-
-		// Find the parent blocks of nodes at either end, and their attributes if they're paragraphs
-		var startBlock = this.parentBlock(startNode);		var endBlock = this.parentBlock(endNode);
-		var attrsLeft = new Array();				var attrsRight = new Array();
-
-		// If a list, let the browser take over, if we're in a paragraph, gather it's attributes
-		if (this.isElem(startBlock, 'li') || this.isElem(endBlock, 'li'))
-			return;
-
-		if (this.isElem(startBlock, 'p')) {
-			for (var i = 0; i < startBlock.attributes.length; i++) {
-				attrsLeft[startBlock.attributes[i].nodeName] = startBlock.attributes[i].nodeValue;
-			}
-		}
-		if (this.isElem(endBlock, 'p')) {
-			for (var i = 0; i < endBlock.attributes.length; i++) {
-				// If we start and end within one paragraph, don't duplicate the 'id'
-				if (endBlock != startBlock || endBlock.attributes[i].nodeName.toLowerCase() != 'id')
-					attrsRight[endBlock.attributes[i].nodeName] = endBlock.attributes[i].nodeValue;
-			}
-		}
-
-		// Look for where to start and end our chopping - within surrounding paragraphs
-		// if they exist, or at the edges of the containing block, otherwise
-		var startChop = startNode;				var endChop = endNode;
-
-		while ((startChop.previousSibling && !this.isElem(startChop.previousSibling, 'p'))
-		       || (startChop.parentNode && startChop.parentNode != startBlock && startChop.parentNode.nodeType != 9))
-			startChop = startChop.previousSibling ? startChop.previousSibling : startChop.parentNode;
-
-		while ((endChop.nextSibling && !this.isElem(endChop.nextSibling, 'p'))
-		       || (endChop.parentNode && endChop.parentNode != endBlock && endChop.parentNode.nodeType != 9))
-			endChop = endChop.nextSibling ? endChop.nextSibling : endChop.parentNode;
-
-		// Set up new paragraphs
-		var pLeft = editor._doc.createElement('p');		var pRight = editor._doc.createElement('p');
-
-		for (var attrName in attrsLeft) {
-			var thisAttr = editor._doc.createAttribute(attrName);
-			thisAttr.value = attrsLeft[attrName];
-			pLeft.setAttributeNode(thisAttr);
-		}
-		for (var attrName in attrsRight) {
-			var thisAttr = editor._doc.createAttribute(attrName);
-			thisAttr.value = attrsRight[attrName];
-			pRight.setAttributeNode(thisAttr);
-		}
-
-		// Get the ranges destined to be stuffed into new paragraphs
-		rngLeft.setStartBefore(startChop);
-		rngLeft.setEnd(startNode,startOffset);
-		pLeft.appendChild(rngLeft.cloneContents());		// Copy into pLeft
-
-		rngRight.setEndAfter(endChop);
-		rngRight.setStart(endNode,endOffset);
-		pRight.appendChild(rngRight.cloneContents());		// Copy into pRight
-
-		// If either paragraph is empty, fill it with a nonbreakable space
-		var foundBlock = false;
-		foundBlock = this.walkNodeChildren(pLeft, this._isFilling);
-		if (foundBlock != true)
-			this.insertDeepLeftText(pLeft, '&nbsp;');
-
-		foundBlock = false;
-		foundBlock = this.walkNodeChildren(pRight, this._isFilling);
-		if (foundBlock != true)
-			this.insertDeepLeftText(pRight, '&nbsp;');
-
-		// Get a range for everything to be replaced and replace it
-		var rngAround = editor._doc.createRange();
-
-		if (!startChop.previousSibling && this.isElem(startChop.parentNode, 'p'))
-			rngAround.setStartBefore(startChop.parentNode);
-		else
-			rngAround.setStart(rngLeft.startContainer, rngLeft.startOffset);
-
-		if (!endChop.nextSibling && this.isElem(endChop.parentNode, 'p'))
-			rngAround.setEndAfter(endChop.parentNode);
-		else
-			rngAround.setEnd(rngRight.endContainer, rngRight.endOffset);
-
-		rngAround.deleteContents();
-		rngAround.insertNode(pRight);
-		rngAround.insertNode(pLeft);
-
-		// Set the selection to the start of the (second) new paragraph
-		if (pRight.firstChild) {
-			while (pRight.firstChild && this._html4_inlines_re.test(pRight.firstChild.nodeName))
-				pRight = pRight.firstChild;
-			// Slip into any inline tags
-			if (pRight.firstChild && pRight.firstChild.nodeType == 3)
-				pRight = pRight.firstChild;	// and text, if they've got it
-
-			var rngCaret = editor._doc.createRange();
-			rngCaret.setStart(pRight, 0);
-			rngCaret.collapse(true);
-
-			sel = editor._iframe.contentWindow.getSelection();
-			sel.removeAllRanges();
-			sel.addRange(rngCaret);
-		}
-
-		// Stop the bubbling
-		HTMLArea._stopEvent(ev);
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/FullPage/full-page.js 75/e107_handlers/htmlarea/plugins/FullPage/full-page.js
--- 6171/e107_handlers/htmlarea/plugins/FullPage/full-page.js	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/FullPage/full-page.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,143 +0,0 @@
-// FullPage Plugin for HTMLArea-3.0
-// Implementation by Mihai Bazon.  Sponsored by http://thycotic.com
-//
-// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
-// This notice MUST stay intact for use (see license.txt).
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon for InteractiveTools.
-//   http://dynarch.com/mishoo
-//
-// $Id: full-page.js,v 1.3 2004/08/11 09:26:37 e107coders Exp $
-
-function FullPage(editor) {
-	this.editor = editor;
-
-	var cfg = editor.config;
-	cfg.fullPage = true;
-	var tt = FullPage.I18N;
-	var self = this;
-
-	cfg.registerButton("FP-docprop", tt["Document properties"], editor.imgURL("docprop.gif", "FullPage"), false,
-			   function(editor, id) {
-				   self.buttonPress(editor, id);
-			   });
-
-	// add a new line in the toolbar
-	cfg.toolbar[0].splice(0, 0, "separator");
-	cfg.toolbar[0].splice(0, 0, "FP-docprop");
-};
-
-FullPage._pluginInfo = {
-	name          : "FullPage",
-	version       : "1.0",
-	developer     : "Mihai Bazon",
-	developer_url : "http://dynarch.com/mishoo/",
-	c_owner       : "Mihai Bazon",
-	sponsor       : "Thycotic Software Ltd.",
-	sponsor_url   : "http://thycotic.com",
-	license       : "htmlArea"
-};
-
-FullPage.prototype.buttonPress = function(editor, id) {
-	var self = this;
-	switch (id) {
-	    case "FP-docprop":
-		var doc = editor._doc;
-		var links = doc.getElementsByTagName("link");
-		var style1 = '';
-		var style2 = '';
-		for (var i = links.length; --i >= 0;) {
-			var link = links[i];
-			if (/stylesheet/i.test(link.rel)) {
-				if (/alternate/i.test(link.rel))
-					style2 = link.href;
-				else
-					style1 = link.href;
-			}
-		}
-		var title = doc.getElementsByTagName("title")[0];
-		title = title ? title.innerHTML : '';
-		var init = {
-			f_doctype      : editor.doctype,
-			f_title        : title,
-			f_body_bgcolor : HTMLArea._colorToRgb(doc.body.style.backgroundColor),
-			f_body_fgcolor : HTMLArea._colorToRgb(doc.body.style.color),
-			f_base_style   : style1,
-			f_alt_style    : style2,
-
-			editor         : editor
-		};
-		editor._popupDialog("plugin://FullPage/docprop", function(params) {
-			self.setDocProp(params);
-		}, init);
-		break;
-	}
-};
-
-FullPage.prototype.setDocProp = function(params) {
-	var txt = "";
-	var doc = this.editor._doc;
-	var head = doc.getElementsByTagName("head")[0];
-	var links = doc.getElementsByTagName("link");
-	var style1 = null;
-	var style2 = null;
-	for (var i = links.length; --i >= 0;) {
-		var link = links[i];
-		if (/stylesheet/i.test(link.rel)) {
-			if (/alternate/i.test(link.rel))
-				style2 = link;
-			else
-				style1 = link;
-		}
-	}
-	function createLink(alt) {
-		var link = doc.createElement("link");
-		link.rel = alt ? "alternate stylesheet" : "stylesheet";
-		head.appendChild(link);
-		return link;
-	};
-
-	if (!style1 && params.f_base_style)
-		style1 = createLink(false);
-	if (params.f_base_style)
-		style1.href = params.f_base_style;
-	else if (style1)
-		head.removeChild(style1);
-
-	if (!style2 && params.f_alt_style)
-		style2 = createLink(true);
-	if (params.f_alt_style)
-		style2.href = params.f_alt_style;
-	else if (style2)
-		head.removeChild(style2);
-
-	for (var i in params) {
-		var val = params[i];
-		switch (i) {
-		    case "f_title":
-			var title = doc.getElementsByTagName("title")[0];
-			if (!title) {
-				title = doc.createElement("title");
-				head.appendChild(title);
-			} else while (node = title.lastChild)
-				title.removeChild(node);
-			if (!HTMLArea.is_ie)
-				title.appendChild(doc.createTextNode(val));
-			else
-				doc.title = val;
-			break;
-		    case "f_doctype":
-			this.editor.setDoctype(val);
-			break;
-		    case "f_body_bgcolor":
-			doc.body.style.backgroundColor = val;
-			break;
-		    case "f_body_fgcolor":
-			doc.body.style.color = val;
-			break;
-		}
-	}
-};
Files 6171/e107_handlers/htmlarea/plugins/FullPage/img/docprop.gif and 75/e107_handlers/htmlarea/plugins/FullPage/img/docprop.gif differ
diff -ruN 6171/e107_handlers/htmlarea/plugins/FullPage/lang/de.js 75/e107_handlers/htmlarea/plugins/FullPage/lang/de.js
--- 6171/e107_handlers/htmlarea/plugins/FullPage/lang/de.js	2004-08-12 09:32:28.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/FullPage/lang/de.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,25 +0,0 @@
-// I18N for the FullPage plugin
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Holger Hees, http://www.systemconcept.de
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-FullPage.I18N = {
-	"Alternate style-sheet:":		"Alternativer Stylesheet:",
-	"Background color:":			"Hintergrundfarbe:",
-	"Cancel":				"Abbrechen",
-	"DOCTYPE:":				"DOCTYPE:",
-	"Document properties":			"Dokumenteigenschaften",
-	"Document title:":			"Dokumenttitel:",
-	"OK":					"OK",
-	"Primary style-sheet:":			"Stylesheet:",
-	"Text color:":				"Textfarbe:"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/FullPage/lang/en.js 75/e107_handlers/htmlarea/plugins/FullPage/lang/en.js
--- 6171/e107_handlers/htmlarea/plugins/FullPage/lang/en.js	2004-03-16 02:23:04.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/FullPage/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,25 +0,0 @@
-// I18N for the FullPage plugin
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-FullPage.I18N = {
-	"Alternate style-sheet:":		"Alternate style-sheet:",
-	"Background color:":			"Background color:",
-	"Cancel":				"Cancel",
-	"DOCTYPE:":				"DOCTYPE:",
-	"Document properties":			"Document properties",
-	"Document title:":			"Document title:",
-	"OK":					"OK",
-	"Primary style-sheet:":			"Primary style-sheet:",
-	"Text color:":				"Text color:"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/FullPage/lang/he.js 75/e107_handlers/htmlarea/plugins/FullPage/lang/he.js
--- 6171/e107_handlers/htmlarea/plugins/FullPage/lang/he.js	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/FullPage/lang/he.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,25 +0,0 @@
-// I18N for the FullPage plugin

-

-// LANG: "he", ENCODING: UTF-8

-// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-FullPage.I18N = {

-	"Alternate style-sheet:":		"גיליון סגנון אחר:",

-	"Background color:":			"צבע רקע:",

-	"Cancel":				"ביטול",

-	"DOCTYPE:":				"DOCTYPE:",

-	"Document properties":			"מאפייני מסמך",

-	"Document title:":			"כותרת מסמך:",

-	"OK":					"אישור",

-	"Primary style-sheet:":			"גיליון סגנון ראשי:",

-	"Text color:":				"צבע טקסט:"

-};

diff -ruN 6171/e107_handlers/htmlarea/plugins/FullPage/lang/ro.js 75/e107_handlers/htmlarea/plugins/FullPage/lang/ro.js
--- 6171/e107_handlers/htmlarea/plugins/FullPage/lang/ro.js	2004-03-16 02:23:04.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/FullPage/lang/ro.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,25 +0,0 @@
-// I18N for the FullPage plugin
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-FullPage.I18N = {
-	"Alternate style-sheet:":		"Template CSS alternativ:",
-	"Background color:":			"Culoare de fundal:",
-	"Cancel":				"Renunţă",
-	"DOCTYPE:":				"DOCTYPE:",
-	"Document properties":			"Proprietăţile documentului",
-	"Document title:":			"Titlul documentului:",
-	"OK":					"Acceptă",
-	"Primary style-sheet:":			"Template CSS principal:",
-	"Text color:":				"Culoare text:"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/FullPage/popups/docprop.html 75/e107_handlers/htmlarea/plugins/FullPage/popups/docprop.html
--- 6171/e107_handlers/htmlarea/plugins/FullPage/popups/docprop.html	2004-03-16 02:23:04.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/FullPage/popups/docprop.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,131 +0,0 @@
-<html>
-
-<head>
-  <title>Document properties</title>
-
-<script type="text/javascript" src="../../../popups/popup.js"></script>
-
-<script type="text/javascript">
-
-FullPage = window.opener.FullPage; // load the FullPage plugin and lang file ;-)
-window.resizeTo(400, 100);
-
-  var accepted = {
-      f_doctype       : true,
-      f_title         : true,
-      f_body_bgcolor  : true,
-      f_body_fgcolor  : true,
-      f_base_style    : true,
-      f_alt_style     : true
-  };
-
-var editor = null;
-function Init() {
-  __dlg_translate(FullPage.I18N);
-  __dlg_init();
-  var params = window.dialogArguments;
-  for (var i in params) {
-      if (i in accepted) {
-        var el = document.getElementById(i);
-        el.value = params[i];
-      }
-  }
-  editor = params.editor;
-  document.getElementById("f_title").focus();
-  document.getElementById("f_title").select();
-};
-
-function onOK() {
-  var required = {
-  };
-  for (var i in required) {
-    var el = document.getElementById(i);
-    if (!el.value) {
-      alert(required[i]);
-      el.focus();
-      return false;
-    }
-  }
-
-  var param = {};
-  for (var i in accepted) {
-    var el = document.getElementById(i);
-    param[i] = el.value;
-  }
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  __dlg_close(null);
-  return false;
-};
-
-</script>
-
-<style type="text/css">
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-table .label { text-align: right; width: 12em; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-
-#buttons {
-      margin-top: 1em; border-top: 1px solid #999;
-      padding: 2px; text-align: right;
-}
-</style>
-
-  </head>
-
-  <body onload="Init()">
-
-    <div class="title"><span>Document properties</span></div>
-
-    <table style="width: 100%">
-      <tr>
-        <td class="label"><span>Document title:</span></td>
-        <td><input type="text" id="f_title" style="width: 100%" /></td>
-      </tr>
-      <tr>
-        <td class="label"><span>DOCTYPE:</span></td>
-        <td><input type="text" id="f_doctype" style="width: 100%" /></td>
-      </tr>
-      <tr>
-        <td class="label"><span>Primary style-sheet:</span></td>
-        <td><input type="text" id="f_base_style" style="width: 100%" /></td>
-      </tr>
-      <tr>
-        <td class="label"><span>Alternate style-sheet:</span></td>
-        <td><input type="text" id="f_alt_style" style="width: 100%" /></td>
-      </tr>
-      <tr>
-        <td class="label"><span>Background color:</span></td>
-        <td><input type="text" id="f_body_bgcolor" size="7" /></td>
-      </tr>
-      <tr>
-        <td class="label"><span>Text color:</span></td>
-        <td><input type="text" id="f_body_fgcolor" size="7" /></td>
-      </tr>
-    </table>
-
-    <div id="buttons">
-      <button type="button" name="ok" onclick="return onOK();"><span>OK</span></button>
-      <button type="button" name="cancel" onclick="return onCancel();"><span>Cancel</span></button>
-    </div>
-
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/plugins/FullPage/test.html 75/e107_handlers/htmlarea/plugins/FullPage/test.html
--- 6171/e107_handlers/htmlarea/plugins/FullPage/test.html	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/FullPage/test.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,89 +0,0 @@
-<html>
-  <head>
-    <title>Test of FullPage plugin</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <script type="text/javascript">
-      _editor_url = "../../";
-    </script>
-
-    <!-- load the main HTMLArea files -->
-    <script type="text/javascript" src="../../htmlarea.js"></script>
-    <script type="text/javascript" src="../../lang/en.js"></script>
-    <script type="text/javascript" src="../../dialog.js"></script>
-
-    <!-- <script type="text/javascript" src="popupdiv.js"></script> -->
-    <script type="text/javascript" src="../../popupwin.js"></script>
-
-    <script type="text/javascript">
-      HTMLArea.loadPlugin("TableOperations");
-      HTMLArea.loadPlugin("SpellChecker");
-      HTMLArea.loadPlugin("FullPage");
-
-      function initDocument() {
-        var editor = new HTMLArea("editor");
-        editor.registerPlugin(TableOperations);
-        editor.registerPlugin(SpellChecker);
-        editor.registerPlugin(FullPage);
-        editor.generate();
-      }
-    </script>
-
-    <style type="text/css">
-      @import url(../../htmlarea.css);
-    </style>
-
-  </head>
-
-  <body onload="initDocument()">
-    <h1>Test of FullPage plugin</h1>
-
-    <textarea id="editor" style="height: 30em; width: 100%;">
-      &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
-      &lt;html&gt;
-        &lt;head&gt;
-          &lt;title&gt;FullPage plugin for HTMLArea&lt;/title&gt;
-          &lt;link rel="alternate stylesheet" href="http://dynarch.com/mishoo/css/dark.css" /&gt;
-          &lt;link rel="stylesheet" href="http://dynarch.com/mishoo/css/cool-light.css" /&gt;
-        &lt;/head&gt;
-        &lt;body style="background-color: #ddddee; color: #000077;"&gt;
-          &lt;table style="width:60%; height: 90%; margin: 2% auto 1% auto;" align="center" border="0" cellpadding="0" cellspacing="0"&gt;
-            &lt;tr&gt;
-              &lt;td style="background-color: #ddeedd; border: 2px solid #002; height: 1.5em; padding: 2px; font: bold 24px Verdana;"&gt;
-                FullPage plugin
-              &lt;/td&gt;
-            &lt;/tr&gt;
-            &lt;tr&gt;
-              &lt;td style="background-color: #fff; border: 1px solid #aab; padding: 1em 3em; font: 12px Verdana;"&gt;
-                &lt;p&gt;
-                  This plugin enables one to edit a full HTML file in &lt;a
-                    href="http://dynarch.com/htmlarea/"&gt;HTMLArea&lt;/a&gt;.  This is not
-                  normally possible with just the core editor since it only
-                  retrieves the HTML inside the &lt;code&gt;body&lt;/code&gt; tag.
-                &lt;/p&gt;
-                &lt;p&gt;
-                  It provides the ability to change the &lt;code&gt;DOCTYPE&lt;/code&gt; of
-                  the document, &lt;code&gt;body&lt;/code&gt; &lt;code&gt;bgcolor&lt;/code&gt; and
-                  &lt;code&gt;fgcolor&lt;/code&gt; attributes as well as to add additional
-                  &lt;code&gt;link&lt;/code&gt;-ed stylesheets.  Cool, eh?
-                &lt;/p&gt;
-                &lt;p&gt;
-                  The development of this plugin was initiated and sponsored by
-                  &lt;a href="http://thycotic.com"&gt;Thycotic Software Ltd.&lt;/a&gt;.
-                  That's also cool, isn't it? ;-)
-                &lt;/p&gt;
-              &lt;/td&gt;
-            &lt;/tr&gt;
-          &lt;/table&gt;
-        &lt;/body&gt;
-      &lt;/html&gt;
-    </textarea>
-
-    <hr />
-    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
-<!-- Created: Wed Oct  1 19:55:37 EEST 2003 -->
-<!-- hhmts start -->
-Last modified on Sat Oct 25 01:06:59 2003
-<!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy-config.cfg 75/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy-config.cfg
--- 6171/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy-config.cfg	2004-06-26 08:48:24.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy-config.cfg	1969-12-31 18:00:00.000000000 -0600
@@ -1,29 +0,0 @@
-// Default configuration file for the htmlArea, HtmlTidy plugin
-// By Adam Wright, for The University of Western Australia
-//
-// Evertything you always wanted to know about HTML Tidy *
-// can be found at http://tidy.sourceforge.net/, and a
-// quick reference to the configuration options exists at
-// http://tidy.sourceforge.net/docs/quickref.html
-//
-// * But were afraid to ask
-//
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-
-word-2000: yes
-clean: no
-drop-font-tags: yes
-doctype: auto
-drop-empty-paras: yes
-drop-proprietary-attributes: yes
-enclose-block-text: yes
-enclose-text: yes
-escape-cdata: yes
-logical-emphasis: yes
-indent: auto
-indent-spaces: 2
-break-before-br: yes
-output-xhtml: yes
-
-force-output: yes
diff -ruN 6171/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy.js 75/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy.js
--- 6171/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy.js	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,128 +0,0 @@
-// Plugin for htmlArea to run code through the server's HTML Tidy
-// By Adam Wright, for The University of Western Australia
-//
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-
-function HtmlTidy(editor) {
-	this.editor = editor;
-
-	var cfg = editor.config;
-	var tt = HtmlTidy.I18N;
-	var bl = HtmlTidy.btnList;
-	var self = this;
-
-	this.onMode = this.__onMode;
-
-	// register the toolbar buttons provided by this plugin
-	var toolbar = [];
-	for (var i = 0; i < bl.length; ++i) {
-		var btn = bl[i];
-		if (btn == "html-tidy") {
-			var id = "HT-html-tidy";
-			cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "HtmlTidy"), true,
-					   function(editor, id) {
-						   // dispatch button press event
-						   self.buttonPress(editor, id);
-					   }, btn[1]);
-			toolbar.push(id);
-		} else if (btn == "html-auto-tidy") {
-			var ht_class = {
-				id	: "HT-auto-tidy",
-				options	: { "Auto-Tidy" : "auto", "Don't Tidy" : "noauto" },
-				action	: function (editor) { self.__onSelect(editor, this); },
-				refresh	: function (editor) { },
-				context	: "body"
-			};
-			cfg.registerDropdown(ht_class);
-		}
-	}
-
-	for (var i in toolbar) {
-		cfg.toolbar[0].push(toolbar[i]);
-	}
-};
-
-HtmlTidy._pluginInfo = {
-	name          : "HtmlTidy",
-	version       : "1.0",
-	developer     : "Adam Wright",
-	developer_url : "http://blog.hipikat.org/",
-	sponsor       : "The University of Western Australia",
-	sponsor_url   : "http://www.uwa.edu.au/",
-	license       : "htmlArea"
-};
-
-HtmlTidy.prototype.__onSelect = function(editor, obj) {
-	// Get the toolbar element object
-	var elem = editor._toolbarObjects[obj.id].element;
-
-	// Set our onMode event appropriately
-	if (elem.value == "auto")
-		this.onMode = this.__onMode;
-	else
-		this.onMode = null;
-};
-
-HtmlTidy.prototype.__onMode = function(mode) {
-	if ( mode == "textmode" ) {
-		this.buttonPress(this.editor, "HT-html-tidy");
-	}
-};
-
-HtmlTidy.btnList = [
-		    null, // separator
-		    ["html-tidy"],
-		    ["html-auto-tidy"]
-];
-
-HtmlTidy.prototype.onGenerateOnce = function() {
-	var editor = this.editor;
-
-	var ifr = document.createElement("iframe");
-	ifr.name = "htiframe_name";
-	var s = ifr.style;
-	s.position = "absolute";
-	s.width = s.height = s.border = s.left = s.top = s.padding = s.margin = "0px";
-	document.body.appendChild(ifr);
-
-	var frm = '<form id="htiform_id" name="htiform_name" method="post" target="htiframe_name" action="';
-	frm += _editor_url + 'plugins/HtmlTidy/html-tidy-logic.php';
-	frm += '"><textarea name="htisource_name" id="htisource_id">';
-	frm += '</textarea></form>';
-
-	var newdiv = document.createElement('div');
-	newdiv.style.display = "none";
-	newdiv.innerHTML = frm;
-	document.body.appendChild(newdiv);
-};
-
-HtmlTidy.prototype.buttonPress = function(editor, id) {
-	var i18n = HtmlTidy.I18N;
-
-	switch (id) {
-	    case "HT-html-tidy":
-
-		var oldhtml = editor.getHTML();
-
-		// Ask the server for some nice new html, based on the old...
-		var myform = document.getElementById('htiform_id');
-		var txtarea = document.getElementById('htisource_id');
-		txtarea.value = editor.getHTML();
-
-		// Apply the 'meanwhile' text, e.g. "Tidying HTML, please wait..."
-		editor.setHTML(i18n['tidying']);
-
-		// The returning tidying processing script needs to find the editor
-		window._editorRef = editor;
-
-		// ...And send our old source off for processing!
-		myform.submit();
-		break;
-	}
-};
-
-HtmlTidy.prototype.processTidied = function(newSrc) {
-	editor = this.editor;
-	editor.setHTML(newSrc);
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy-logic.php 75/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy-logic.php
--- 6171/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy-logic.php	2004-05-09 15:43:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/HtmlTidy/html-tidy-logic.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,83 +0,0 @@
-<?  ###################################################################
-   ##
-  ##  Plugin for htmlArea, to run code through the server's HTML Tidy
- ##   By Adam Wright, for The University of Western Australia
-##    This is the server-side script, which dirty code is run through.
-##
-##  Distributed under the same terms as HTMLArea itself.
-##  This notice MUST stay intact for use (see license.txt).
-##
-
-	// Get the original source
-	$source = $_POST['htisource_name'];
-	$source = stripslashes($source);
-
-	// Open a tidy process - I hope it's installed!
-	$descriptorspec = array(
-		0 => array("pipe", "r"),
-		1 => array("pipe", "w"),
-		2 => array("file", "/dev/null", "a")
-	);
-	$process = proc_open("tidy -config html-tidy-config.cfg", $descriptorspec, $pipes);
-
-	// Make sure the program started and we got the hooks...
-	// Either way, get some source code into $source
-	if (is_resource($process)) {
-
-		// Feed untidy source into the stdin
-		fwrite($pipes[0], $source);
-		fclose($pipes[0]);
-
-		// Read clean source out to the browser
-		while (!feof($pipes[1])) {
-			//echo fgets($pipes[1], 1024);
-			$newsrc .= fgets($pipes[1], 1024);
-		}
-		fclose($pipes[1]);
-
-		// Clean up after ourselves
-		proc_close($process);
-
-	} else {
-		// Better give them back what they came with, so they don't lose it all...
-		$newsrc = "<body>\n" .$source. "\n</body>";
-	}
-
-	// Split our source into an array by lines
-	$srcLines = explode("\n",$newsrc);
-
-	// Get only the lines between the body tags
-	$startLn = 0;
-	while ( strpos( $srcLines[$startLn++], '<body' ) === false && $startLn < sizeof($srcLines) );
-	$endLn = $startLn;
-	while ( strpos( $srcLines[$endLn++], '</body' ) === false && $endLn < sizeof($srcLines) );
-
-	$srcLines = array_slice( $srcLines, $startLn, ($endLn - $startLn - 1) );
-
-	// Create a set of javascript code to compile a new source string
-	foreach ($srcLines as $line) {
-		$jsMakeSrc .= "\tns += '" . str_replace("'","\'",$line) . "\\n';\n";
-	}
-?>
-
-
-<html>
-  <head>
-    <script type="text/javascript">
-
-function setNewHtml() {
-	var htRef = window.parent._editorRef.plugins['HtmlTidy'];
-	htRef.instance.processTidied(tidyString());
-}
-function tidyString() {
-	var ns = '\n';
-	<?=$jsMakeSrc;?>
-	return ns;
-}
-
-    </script>
-  </head>
-
-  <body id="htiNewBody" onload="setNewHtml()">
-  </body>
-</html>
Files 6171/e107_handlers/htmlarea/plugins/HtmlTidy/img/html-tidy.gif and 75/e107_handlers/htmlarea/plugins/HtmlTidy/img/html-tidy.gif differ
diff -ruN 6171/e107_handlers/htmlarea/plugins/HtmlTidy/img/makefile.xml 75/e107_handlers/htmlarea/plugins/HtmlTidy/img/makefile.xml
--- 6171/e107_handlers/htmlarea/plugins/HtmlTidy/img/makefile.xml	2004-05-09 15:43:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/HtmlTidy/img/makefile.xml	1969-12-31 18:00:00.000000000 -0600
@@ -1,3 +0,0 @@
-<files>
-  <file name="*.{gif,png,jpg}" />
-</files>
diff -ruN 6171/e107_handlers/htmlarea/plugins/HtmlTidy/lang/en.js 75/e107_handlers/htmlarea/plugins/HtmlTidy/lang/en.js
--- 6171/e107_handlers/htmlarea/plugins/HtmlTidy/lang/en.js	2004-05-09 15:43:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/HtmlTidy/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,18 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Adam Wright, http://blog.hipikat.org/
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-HtmlTidy.I18N = {
-	"tidying"                               : "\n Tidying up the HTML source, please wait...",
-	"HT-html-tidy"                          : "HTML Tidy"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/HtmlTidy/lang/makefile.xml 75/e107_handlers/htmlarea/plugins/HtmlTidy/lang/makefile.xml
--- 6171/e107_handlers/htmlarea/plugins/HtmlTidy/lang/makefile.xml	2004-05-09 15:43:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/HtmlTidy/lang/makefile.xml	1969-12-31 18:00:00.000000000 -0600
@@ -1,3 +0,0 @@
-<files>
-  <file name="*.js" />
-</files>
diff -ruN 6171/e107_handlers/htmlarea/plugins/HtmlTidy/makefile.xml 75/e107_handlers/htmlarea/plugins/HtmlTidy/makefile.xml
--- 6171/e107_handlers/htmlarea/plugins/HtmlTidy/makefile.xml	2004-05-09 15:43:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/HtmlTidy/makefile.xml	1969-12-31 18:00:00.000000000 -0600
@@ -1,7 +0,0 @@
-<files>
-  <file name="*.{html,js,cgi,php,css,cfg}" />
-  <file name="README" />
-
-  <dir name="lang" />
-  <dir name="img" />
-</files>
diff -ruN 6171/e107_handlers/htmlarea/plugins/HtmlTidy/README 75/e107_handlers/htmlarea/plugins/HtmlTidy/README
--- 6171/e107_handlers/htmlarea/plugins/HtmlTidy/README	2004-05-09 15:43:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/HtmlTidy/README	1969-12-31 18:00:00.000000000 -0600
@@ -1,104 +0,0 @@
-// Plugin for htmlArea to run code through the server's HTML Tidy
-// By Adam Wright, for The University of Western Australia
-//
-//   Email:      zeno@ucc.gu.uwa.edu.au
-//   Homepage:   http://blog.hipikat.org/
-//
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-//
-// Version: 0.5
-// Released to the outside world: 04/03/04
-
-
-HtmlTidy is a plugin for the popular cross-browser TTY WYSIWYG editor,
-htmlArea (http://www.interactivetools.com/products/htmlarea/). HtmlTidy
-basically queries HTML Tidy (http://tidy.sourceforge.net/) on the
-server side, getting it to make-html-nice, instead of relying on masses
-of javascript, which the client would have to download.
-
-Hi, this is a quick explanation of how to install HtmlTidy. Much better
-documentation is probably required, and you're welcome to write it :)
-
-
-* The HtmlTidy directory you should have found this file in should
-  include the following:
-
-  - README
-        This file, providing help installing the plugin.
-
-  - html-tidy-config.cfg
-        This file contains the configuration options HTML Tidy uses to
-        clean html, and can be modified to suit your organizations
-        requirements.
-
-  - html-tidy-logic.php
-        This is the php script, which is queried with dirty html and is
-        responsible for invoking HTML Tidy, getting nice new html and
-        returning it to the client.
-
-  - html-tidy.js
-        The main htmlArea plugin, providing functionality to tidy html
-        through the htmlArea interface.
-
-  - htmlarea.js.onmode_event.diff
-        At the time of publishing, an extra event handler was required
-        inside the main htmlarea.js file. htmlarea.js may be patched
-        against this file to make the changes reuquired, but be aware
-        that the event handler may either now be in the core or
-        htmlarea.js may have changed enough to invalidate the patch.
-	
-	UPDATE: now it exists in the official htmlarea.js; applying
-	this patch is thus no longer necessary.
-
-  - img/html-tidy.gif
-        The HtmlTidy icon, for the htmlArea toolbar. Created by Dan
-        Petty for The University of Western Australia.
-
-  - lang/en.js
-        English language file. Add your own language files here and
-        please contribute back into the htmlArea community!
-
-  The HtmlArea directory should be extracted to your htmlarea/plugins/
-  directory.
-
-
-* Make sure the onMode event handler mentioned above, regarding
-  htmlarea.js.onmode_event.diff, exists in your htmlarea.js
-
-
-* html-tidy-logic.php should be executable, and your web server should
-  be configured to execute php scripts in the directory
-  html-tidy-logic.php exists in.
-
-
-* HTML Tidy needs to be installed on your server, and 'tidy' should be
-  an alias to it, lying in the PATH known to the user executing such
-  web scripts.
-
-
-* In your htmlArea configuration, do something like this:
-
-    HTMLArea.loadPlugin("HtmlTidy");
-
-    editor = new HTMLArea("doc");
-    editor.registerPlugin("HtmlTidy");
-
-
-* Then, in your htmlArea toolbar configuration, use:
-
-    - "HT-html-tidy"
-        This will create the 'tidy broom' icon on the toolbar, which
-        will attempt to tidy html source when clicked, and;
-
-    - "HT-auto-tidy"
-        This will create an "Auto Tidy" / "Don't Tidy" dropdown, to
-        select whether the source should be tidied automatically when
-        entering source view. On by default, if you'd like it otherwise
-        you can do so programatically after generating the toolbar :)
-        (Or just hack it to be otherwise...)
-    
-
-Thank you.
-
-Any bugs you find can be emailed to zeno@ucc.gu.uwa.edu.au
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/dialog.js 75/e107_handlers/htmlarea/plugins/ImageManager/assets/dialog.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/dialog.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/dialog.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,111 +0,0 @@
-// Dialog v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
-// This copyright notice MUST stay intact for use (see license.txt).
-//
-// Portions (c) dynarch.com, 2003-2004
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon.
-//   http://dynarch.com/mishoo
-//
-// $Id: dialog.js,v 1.1 2004/06/26 13:48:37 e107coders Exp $
-
-// Though "Dialog" looks like an object, it isn't really an object.  Instead
-// it's just namespace for protecting global symbols.
-
-function Dialog(url, action, init) {
-	if (typeof init == "undefined") {
-		init = window;	// pass this window object by default
-	}
-	Dialog._geckoOpenModal(url, action, init);
-};
-
-Dialog._parentEvent = function(ev) {
-	setTimeout( function() { if (Dialog._modal && !Dialog._modal.closed) { Dialog._modal.focus() } }, 50);
-	if (Dialog._modal && !Dialog._modal.closed) {
-		Dialog._stopEvent(ev);
-	}
-};
-
-
-// should be a function, the return handler of the currently opened dialog.
-Dialog._return = null;
-
-// constant, the currently opened dialog
-Dialog._modal = null;
-
-// the dialog will read it's args from this variable
-Dialog._arguments = null;
-
-Dialog._geckoOpenModal = function(url, action, init) {
-	//var urlLink = "hadialog"+url.toString();
-	var myURL = "hadialog"+url;
-	var regObj = /\W/g;
-	myURL = myURL.replace(regObj,'_');
-	var dlg = window.open(url, myURL,
-			      "toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
-			      "scrollbars=no,resizable=yes,modal=yes,dependable=yes");
-	Dialog._modal = dlg;
-	Dialog._arguments = init;
-
-	// capture some window's events
-	function capwin(w) {
-		Dialog._addEvent(w, "click", Dialog._parentEvent);
-		Dialog._addEvent(w, "mousedown", Dialog._parentEvent);
-		Dialog._addEvent(w, "focus", Dialog._parentEvent);
-	};
-	// release the captured events
-	function relwin(w) {
-		Dialog._removeEvent(w, "click", Dialog._parentEvent);
-		Dialog._removeEvent(w, "mousedown", Dialog._parentEvent);
-		Dialog._removeEvent(w, "focus", Dialog._parentEvent);
-	};
-	capwin(window);
-	// capture other frames
-	for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
-	// make up a function to be called when the Dialog ends.
-	Dialog._return = function (val) {
-		if (val && action) {
-			action(val);
-		}
-		relwin(window);
-		// capture other frames
-		for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
-		Dialog._modal = null;
-	};
-};
-
-
-// event handling
-
-Dialog._addEvent = function(el, evname, func) {
-	if (Dialog.is_ie) {
-		el.attachEvent("on" + evname, func);
-	} else {
-		el.addEventListener(evname, func, true);
-	}
-};
-
-
-Dialog._removeEvent = function(el, evname, func) {
-	if (Dialog.is_ie) {
-		el.detachEvent("on" + evname, func);
-	} else {
-		el.removeEventListener(evname, func, true);
-	}
-};
-
-
-Dialog._stopEvent = function(ev) {
-	if (Dialog.is_ie) {
-		ev.cancelBubble = true;
-		ev.returnValue = false;
-	} else {
-		ev.preventDefault();
-		ev.stopPropagation();
-	}
-};
-
-Dialog.agt = navigator.userAgent.toLowerCase();
-Dialog.is_ie	   = ((Dialog.agt.indexOf("msie") != -1) && (Dialog.agt.indexOf("opera") == -1));
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/EditorContent.js 75/e107_handlers/htmlarea/plugins/ImageManager/assets/EditorContent.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/EditorContent.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/EditorContent.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,744 +0,0 @@
-/***********************************************************************
-** Title.........:  Online Image Editor Interface
-** Version.......:  1.0
-** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
-** Filename......:  EditorContents.js
-** Last changed..:  31 Mar 2004 
-** Notes.........:  Handles most of the interface routines for the ImageEditor.
-*
-* Added:  29 Mar 2004  - Constrainted resizing/scaling
-**/ 
-
-
-function MM_findObj(n, d) { //v4.01
-  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
-    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
-  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
-  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
-  if(!x && d.getElementById) x=d.getElementById(n); return x;
-}
-
-var pic_x, pic_y;
-function P7_Snap() { //v2.62 by PVII
-  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
-  for (k=0; k<(args.length-3); k+=4)
-   if ((g=MM_findObj(args[k]))!=null) {
-    el=eval(MM_findObj(args[k+1]));
-    a=parseInt(args[k+2]);b=parseInt(args[k+3]);
-    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
-    if(document.getElementById) {
-     d="document.getElementsByName('"+args[k]+"')[0]";
-     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
-    }else if(document.all) {d=da;} 
-    if (document.all || document.getElementById) {
-     while (tx==1) {p+=".offsetParent";
-      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
-      }else{tx=0;}}
-     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
-     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
-      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
-      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
-      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
-      //alert(event.clientX);
-	  if (event == null) x=document.body.scrollLeft + bx;
-		else x=document.body.scrollLeft + event.clientX + bx;
-	  if (event == null) y=document.body.scrollTop;
-		else y=document.body.scrollTop + event.clientY;}}
-   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
-    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
-     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
-   if(el) {e=(document.layers)?el:el.style;
-   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
-   //alert(xx+":"+yy);
-   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
-   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
-    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
-    xx+="px";yy+="px";}e.left=xx;e.top=yy;}
-    pic_x = parseInt(xx); pic_y = parseInt(yy);
-    //alert(xx+":"+yy);
-    }
-}
-
-var ie=document.all
-var ns6=document.getElementById&&!document.all
-
-var dragapproved=false
-var z,x,y,status, ant, canvas, content, pic_width, pic_height, image, resizeHandle, oa_w, oa_h, oa_x, oa_y, mx2, my2;
-
-
-function init_resize() 
-{
-    if(mode == "scale") 
-    {
-        P7_Snap('theImage','ant',0,0);
-
-        if (canvas == null)
-            canvas = MM_findObj("imgCanvas");
-
-        if (pic_width == null || pic_height == null)
-        {
-            image = MM_findObj("theImage");
-            pic_width = image.width;
-            pic_height = image.height;
-        }
-        
-        if (ant == null)
-            ant = MM_findObj("ant");
-
-        ant.style.left = pic_x; ant.style.top = pic_y;
-        ant.style.width = pic_width; ant.style.height = pic_height;
-        ant.style.visibility = "visible";
-
-        drawBoundHandle();
-        jg_doc.paint();
-    }
-}
-
-initEditor = function () 
-{
-    init_crop();
-    init_resize();
-    var markerImg = MM_findObj('markerImg', window.top.document);
-
-    if (markerImg.src.indexOf("img/t_white.gif")>0)
-        toggleMarker() ;
-}
-
-function init_crop() 
-{
-    //if(mode == "crop") {
-        P7_Snap('theImage','ant',0,0);
-    //}
-}
-
-function setMode(newMode) 
-{
-    mode = newMode;
-    reset();
-}
-
-function reset() 
-{
-    if (ant == null)
-        ant = MM_findObj("ant");
-
-    ant.style.visibility = "hidden";
-    ant.style.left = 0;
-    ant.style.top = 0;
-    ant.style.width = 0;
-    ant.style.height = 0;
-
-    mx2 = null;
-    my2 = null;
-
-    jg_doc.clear();
-    if(mode != 'measure')
-        showStatus();   
-
-    if(mode == "scale") {
-        init_resize();
-    }
-
-    P7_Snap('theImage','ant',0,0);
-}
-
-function toggleMarker() 
-{
-    //alert("Toggle");
-    if (ant == null)
-        ant = MM_findObj("ant");
-
-    if(ant.className=="selection")
-        ant.className="selectionWhite";
-    else
-        ant.className="selection";
-    
-    if (jg_doc.getColor() == "#000000")
-        jg_doc.setColor("#FFFFFF");
-    else
-        jg_doc.setColor("#000000");
-    
-    drawBoundHandle
-    jg_doc.paint();
-}
-
-
-function move(e)
-{
-    if (dragapproved)
-    {
-        //z.style.left=ns6? temp1+e.clientX-x: temp1+event.clientX-x
-        //z.style.top=ns6? temp2+e.clientY-y : temp2+event.clientY-y
-        var w = ns6? temp1+e.clientX - x : temp1+event.clientX - x;
-        var h = ns6? temp2+e.clientY - y : temp2+event.clientY - y;
-
-        //alert(canvas.style.left);
-        /*if (status !=null)
-        {
-            status.innerHTML  = "x:"+x+" y:"+y+" w:"+w+" h:"+h+" can_h:"+pic_height;
-            status.innerHTML += " can_w:"+pic_width+" px:"+pic_x+" py:"+pic_y;
-            status.innerHTML += " pix:"+image.style.left+" piy:"+image.style.top+" obj:"+obj.id;
-        }*/
-
-        /*jg_doc.clear();
-        jg_doc.fillRectPattern(0,0,Math.abs(w),Math.abs(h),pattern);
-        jg_doc.paint();
-*/
-        if (ant != null)
-        {
-            if (w >= 0)
-            {
-                ant.style.left = x;
-                ant.style.width = w;
-            }
-            else
-            {
-                ant.style.left = x+w;
-                ant.style.width = -1*w;
-            }
-
-            if (h >= 0)
-            {
-                ant.style.top = y;
-                ant.style.height = h;
-            }
-            else
-            {
-                ant.style.top = y+h;
-                ant.style.height = -1*h
-            }
-        }
-        
-        showStatus();
-        return false
-    }
-}
-
-function moveContent(e) 
-{
-    if (dragapproved)
-    {
-
-        var dx =ns6? oa_x + e.clientX-x: oa_x + event.clientX-x
-        var dy =ns6? oa_y + e.clientY-y : oa_y + event.clientY-y
-
-
-        /*if (status !=null)
-        {
-            status.innerHTML  = "x:"+x+" y:"+y+" dx:"+dx+" dy:"+dy;
-        }*/
-
-        ant.style.left = dx;
-        ant.style.top = dy;
-
-        showStatus();
-
-        return false;
-    }
-}
-
-//Code add for constraints by Frdric Klee <fklee@isuisse.com>
-function moveHandle(e) 
-{
-    if (dragapproved)
-    {
-        var w = ns6? e.clientX - x : event.clientX - x;
-        var h = ns6? e.clientY - y : event.clientY - y;
-        
-		var constrained = MM_findObj('constProp', window.top.document);
-        var orginal_height = document.theImage.height ;
-        var orginal_width = document.theImage.width ;
-        rapp = orginal_width/orginal_height ;
-        rapp_inv = orginal_height / orginal_width ;
-
-        switch(resizeHandle) 
-        {
-
-            case "s-resize":
-                if (oa_h + h >= 0) 
-				{
-                    ant.style.height = oa_h + h;
-					if(constrained.checked) 
-					{
-						ant.style.width = rapp * (oa_h + h) ;
-                        ant.style.left = oa_x - rapp * h/2;
-					}
-
-				}
-                break;
-            case "e-resize":
-                if(oa_w + w >= 0)
-				{
-                    ant.style.width = oa_w + w;
-					if(constrained.checked) 
-					{
-                        ant.style.height = rapp_inv * (oa_w + w) ;
-                        ant.style.top = oa_y - rapp_inv * w/2;
-                    }
-
-				}
-                break;
-            case "n-resize":
-                if (oa_h - h >= 0)
-                {
-                    ant.style.top = oa_y + h;
-                    ant.style.height = oa_h - h;
-					if(constrained.checked) 
-					{
-						ant.style.width = rapp * (oa_h - h) ;
-                        ant.style.left = oa_x + rapp * h/2;
-                    }
-
-                }
-                break;
-            case "w-resize":
-                if(oa_w - w >= 0) 
-				{
-                    ant.style.left = oa_x + w;
-                    ant.style.width = oa_w - w;
-					if(constrained.checked) 
-					{
-						ant.style.height = rapp_inv * (oa_w - w) ;
-						ant.style.top = oa_y + rapp_inv * w/2;
-                    }
-
-                }break;
-            case "nw-resize":
-                if(oa_h - h >= 0 && oa_w - w >= 0) {
-                    ant.style.left = oa_x + w;
-                    ant.style.width = oa_w - w;
-                    ant.style.top = oa_y + h;
-                    if(constrained.checked) 
-                        ant.style.height = rapp_inv * (oa_w - w) ;
-                    else
-                        ant.style.height = oa_h - h;
-                }
-            break;
-            case "ne-resize":
-                if (oa_h - h >= 0 && oa_w + w >= 0){
-                    ant.style.top = oa_y + h;
-					ant.style.width = oa_w + w;
-					if(constrained.checked) 
-                        ant.style.height = rapp_inv * (oa_w + w) ;
-                    else
-                        ant.style.height = oa_h - h;
-                }
-                break;
-            case "se-resize":
-                if (oa_h + h >= 0 && oa_w + w >= 0) 
-                {
-                    ant.style.width = oa_w + w;
-                    if(constrained.checked)
-                        ant.style.height = rapp_inv * (oa_w + w) ;
-                    else
-                        ant.style.height = oa_h + h;
-                }
-                break;
-            case "sw-resize":
-                if (oa_h + h >= 0 && oa_w - w >= 0)
-                {
-                    ant.style.left = oa_x + w;
-                    ant.style.width = oa_w - w;
-					if(constrained.checked)
-                        ant.style.height = rapp_inv * (oa_w - w) ;
-                    else
-                       ant.style.height = oa_h + h;
-				}
-        }
-        
-        showStatus();
-        return false;
-        
-    }
-}
-
-function drags(e)
-{
-    if (!ie&&!ns6)
-        return
-    
-    var firedobj=ns6? e.target : event.srcElement
-    var topelement=ns6? "HTML" : "BODY"
-
-    while (firedobj.tagName!=topelement&&
-            !(firedobj.className=="crop" 
-                || firedobj.className=="handleBox" 
-                || firedobj.className=="selection" || firedobj.className=="selectionWhite"))
-    {
-        firedobj=ns6? firedobj.parentNode : firedobj.parentElement
-    }
-
-    if(firedobj.className=="handleBox") {
-        
-        if(content != null) {
-            if(content.width != null && content.height != null) {
-                content.width = 0;
-                content.height = 0;
-            }
-            //alert(content.width+":"+content.height);
-        }
-        resizeHandle = firedobj.id;
-        
-        /*if(status!=null) {
-            status.innerHTML  = " obj:"+firedobj.id;
-        }*/
-
-        x=ns6? e.clientX: event.clientX
-        y=ns6? e.clientY: event.clientY
-
-        oa_w = parseInt(ant.style.width);
-        oa_h = parseInt(ant.style.height);
-        oa_x = parseInt(ant.style.left);
-        oa_y = parseInt(ant.style.top);
-
-        dragapproved=true
-        document.onmousemove=moveHandle;
-        return false;
-    }
-    else
-    if((firedobj.className == "selection" || firedobj.className=="selectionWhite")&& mode == "crop") {
-        
-        x=ns6? e.clientX: event.clientX
-        y=ns6? e.clientY: event.clientY
-        
-        oa_x = parseInt(ant.style.left);
-        oa_y = parseInt(ant.style.top);
-
-        dragapproved=true
-        document.onmousemove=moveContent;
-        return false;
-    }
-    else
-    if (firedobj.className=="crop" && mode == "crop")
-    {
-        if(content != null) {
-            if(content.width != null && content.height != null) {
-                content.width = 0;
-                content.height = 0;
-            }
-            //alert(content.width+":"+content.height);
-        }
-
-        if (status == null)
-            status = MM_findObj("status");
-
-        if (ant == null)
-            ant = MM_findObj("ant");
-
-        if (canvas == null)
-            canvas = MM_findObj("imgCanvas");
-        if(content == null) {
-            content = MM_findObj("cropContent");
-        }
-
-        if (pic_width == null || pic_height == null)
-        {
-            image = MM_findObj("theImage");
-            pic_width = image.width;
-            pic_height = image.height;
-        }
-
-        ant.style.visibility = "visible";
-
-        obj = firedobj;
-        dragapproved=true
-        z=firedobj
-        temp1=parseInt(z.style.left+0)
-        temp2=parseInt(z.style.top+0)
-        x=ns6? e.clientX: event.clientX
-        y=ns6? e.clientY: event.clientY
-        document.onmousemove=move
-        return false
-    }
-        else if(firedobj.className=="crop" && mode == "measure") {
-
-            if (ant == null)
-                ant = MM_findObj("ant");
-
-            if (canvas == null)
-                canvas = MM_findObj("imgCanvas");
-
-            x=ns6? e.clientX: event.clientX
-            y=ns6? e.clientY: event.clientY
-
-                //jg_doc.draw
-            dragapproved=true
-            document.onmousemove=measure
-
-            return false
-        }
-}
-
-function measure(e) 
-{
-    if (dragapproved)
-    {
-        mx2 = ns6? e.clientX : event.clientX;
-        my2 = ns6? e.clientY : event.clientY;
-        
-        jg_doc.clear();
-        jg_doc.setStroke(Stroke.DOTTED); 
-        jg_doc.drawLine(x,y,mx2,my2);
-        jg_doc.paint();
-        showStatus();
-        return false;
-    }
-}
-
-function setMarker(nx,ny,nw,nh) 
-{
-    if (ant == null)
-        ant = MM_findObj("ant");
-
-    if (canvas == null)
-        canvas = MM_findObj("imgCanvas");
-    if(content == null) {
-        content = MM_findObj("cropContent");
-    }
-
-    if (pic_width == null || pic_height == null)
-    {
-        image = MM_findObj("theImage");
-        pic_width = image.width;
-        pic_height = image.height;
-    }
-
-    ant.style.visibility = "visible";
-
-    nx = pic_x + nx;
-    ny = pic_y + ny;
-
-    if (nw >= 0)
-    {
-        ant.style.left = nx;
-        ant.style.width = nw;
-    }
-    else
-    {
-        ant.style.left = nx+nw;
-        ant.style.width = -1*nw;
-    }
-
-    if (nh >= 0)
-    {
-        ant.style.top = ny;
-        ant.style.height = nh;
-    }
-    else
-    {
-        ant.style.top = ny+nh;
-        ant.style.height = -1*nh
-    }
-
-    
-}
-
-function max(x,y) 
-{
-    if(y > x)
-        return x;
-    else 
-        return y;
-}
-
-function drawBoundHandle() 
-{
-    if(ant == null || ant.style == null) 
-        return false;
-
-    var ah = parseInt(ant.style.height);
-    var aw = parseInt(ant.style.width);
-    var ax = parseInt(ant.style.left);
-    var ay = parseInt(ant.style.top);
-
-    jg_doc.drawHandle(ax-15,ay-15,30,30,"nw-resize"); //upper left
-    jg_doc.drawHandle(ax-15,ay+ah-15,30,30,"sw-resize"); //lower left
-    jg_doc.drawHandle(ax+aw-15,ay-15,30,30,"ne-resize"); //upper right
-    jg_doc.drawHandle(ax+aw-15,ay+ah-15,30,30,"se-resize"); //lower right
-
-    jg_doc.drawHandle(ax+max(15,aw/10),ay-8,aw-2*max(15,aw/10),8,"n-resize"); //top middle
-    jg_doc.drawHandle(ax+max(15,aw/10),ay+ah,aw-2*max(15,aw/10),8,"s-resize"); //bottom middle
-    jg_doc.drawHandle(ax-8, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"w-resize"); //left middle
-    jg_doc.drawHandle(ax+aw, ay+max(15,ah/10),8,ah-2*max(15,ah/10),"e-resize"); //right middle
-
-
-
-    jg_doc.drawHandleBox(ax-4,ay-4,8,8,"nw-resize"); //upper left
-    jg_doc.drawHandleBox(ax-4,ay+ah-4,8,8,"sw-resize"); //lower left
-    jg_doc.drawHandleBox(ax+aw-4,ay-4,8,8,"ne-resize"); //upper right
-    jg_doc.drawHandleBox(ax+aw-4,ay+ah-4,8,8,"se-resize"); //lower right
-
-    jg_doc.drawHandleBox(ax+aw/2-4,ay-4,8,8,"n-resize"); //top middle
-    jg_doc.drawHandleBox(ax+aw/2-4,ay+ah-4,8,8,"s-resize"); //bottom middle
-    jg_doc.drawHandleBox(ax-4, ay+ah/2-4,8,8,"w-resize"); //left middle
-    jg_doc.drawHandleBox(ax+aw-4, ay+ah/2-4,8,8,"e-resize"); //right middle
-
-    //jg_doc.paint();
-}
-
-function showStatus() 
-{
-    if(ant == null || ant.style == null) {
-        return false;
-    }
-
-    if(mode == "measure") {
-        //alert(pic_x);
-        mx1 = x - pic_x;
-        my1 = y - pic_y;
-
-        mw = mx2 - x;
-        mh = my2 - y;
-
-        md = parseInt(Math.sqrt(mw*mw + mh*mh)*100)/100;
-
-        ma = (Math.atan(-1*mh/mw)/Math.PI)*180;
-        if(mw < 0 && mh < 0)
-            ma = ma+180;
-
-        if (mw <0 && mh >0)
-            ma = ma - 180;
-
-        ma = parseInt(ma*100)/100;
-
-        if (m_sx != null && !isNaN(mx1))
-            m_sx.value = mx1+"px";
-        if (m_sy != null && !isNaN(my1))
-            m_sy.value = my1+"px";
-        if(m_w != null && !isNaN(mw))
-            m_w.value = mw + "px";
-        if(m_h != null && !isNaN(mh))
-            m_h.value = mh + "px";
-
-        if(m_d != null && !isNaN(md))
-            m_d.value = md + "px";
-        if(m_a != null && !isNaN(ma))
-            m_a.value = ma + "";
-
-        if(r_ra != null &&!isNaN(ma))
-            r_ra.value = ma;            
-
-        //alert("mx1:"+mx1+" my1"+my1);
-        return false;
-    }
-
-    var ah = parseInt(ant.style.height);
-    var aw = parseInt(ant.style.width);
-    var ax = parseInt(ant.style.left);
-    var ay = parseInt(ant.style.top);
-
-    var cx = ax-pic_x<0?0:ax-pic_x;
-    var cy = ay-pic_y<0?0:ay-pic_y;
-    cx = cx>pic_width?pic_width:cx;
-    cy = cy>pic_height?pic_height:cy;
-    
-    var cw = ax-pic_x>0?aw:aw-(pic_x-ax);
-    var ch = ay-pic_y>0?ah:ah-(pic_y-ay);
-
-    ch = ay+ah<pic_y+pic_height?ch:ch-(ay+ah-pic_y-pic_height);
-    cw = ax+aw<pic_x+pic_width?cw:cw-(ax+aw-pic_x-pic_width);
-
-    ch = ch<0?0:ch; cw = cw<0?0:cw;
-    
-    if (ant.style.visibility == "hidden")
-    {
-        cx = ""; cy = ""; cw=""; ch="";
-    }
-
-    if(mode == 'crop') {
-        if(t_cx != null)
-            t_cx.value = cx;
-        if (t_cy != null)   
-            t_cy.value = cy;
-        if(t_cw != null)
-            t_cw.value = cw;
-        if (t_ch != null)   
-            t_ch.value = ch;
-    }
-    else if(mode == 'scale') {
-
-        var sw = aw, sh = ah;
-
-        if (s_sw.value.indexOf('%')>0 && s_sh.value.indexOf('%')>0)
-        {   
-            sw = cw/pic_width;
-            sh = ch/pic_height;
-        }
-        if (s_sw != null)
-            s_sw.value = sw;
-        if (s_sh != null)
-            s_sh.value = sh;
-    }
-
-}
-
-function dragStopped()
-{
-    dragapproved=false;
-
-    if(ant == null || ant.style == null) {
-        return false;
-    }
-
-    if(mode == "measure") {
-        jg_doc.drawLine(x-4,y,x+4,y);
-        jg_doc.drawLine(x,y-4,x,y+4);
-        jg_doc.drawLine(mx2-4,my2,mx2+4,my2);
-        jg_doc.drawLine(mx2,my2-4,mx2,my2+4);
-
-        jg_doc.paint();
-        showStatus();
-        return false;
-    }
-        var ah = parseInt(ant.style.height);
-        var aw = parseInt(ant.style.width);
-        var ax = parseInt(ant.style.left);
-        var ay = parseInt(ant.style.top);
-        jg_doc.clear();
-        
-        if(content != null) {
-            if(content.width != null && content.height != null) {
-                content.width = aw-1;
-                content.height = ah-1;
-            }
-            //alert(content.width+":"+content.height);
-        }
-        if(mode == "crop") {
-            //alert(pic_y);
-            jg_doc.fillRectPattern(pic_x,pic_y,pic_width,ay-pic_y,pattern);
-            
-            var h1 = ah;
-            var y1 = ay;
-            if (ah+ay >= pic_height+pic_y)
-                h1 = pic_height+pic_y-ay;
-            else if (ay <= pic_y)
-            {
-                h1 = ay+ah-pic_y;
-                y1 = pic_y;
-            }
-            jg_doc.fillRectPattern(pic_x,y1,ax-pic_x,h1,pattern);
-            jg_doc.fillRectPattern(ax+aw,y1,pic_x+pic_width-ax-aw,h1,pattern);
-            jg_doc.fillRectPattern(pic_x,ay+ah,pic_width,pic_height+pic_y-ay-ah,pattern);
-        }
-        else if(mode == "scale") {
-            //alert("Resizing: iw:"+image.width+" nw:"+aw);
-            document.theImage.height = ah;
-            document.theImage.width = aw;
-            document.theImage.style.height = ah+" px";
-            document.theImage.style.width = aw+" px";
-
-            P7_Snap('theImage','ant',0,0);
-
-            //alert("After Resizing: iw:"+image.width+" nw:"+aw);
-        }
-
-        drawBoundHandle();
-        jg_doc.paint();
-    
-        showStatus();
-    return false;
-}
-
-document.onmousedown=drags
-document.onmouseup=dragStopped;
-
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/editor.css 75/e107_handlers/htmlarea/plugins/ImageManager/assets/editor.css
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/editor.css	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/editor.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,194 +0,0 @@
-		body
-		{
-			margin: 0; padding: 0;
-			font: 11px Tahoma,Verdana,sans-serif;
-		}
-		select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-
-		#indicator
-		{
-			width: 25px;
-			height: 20px;
-			background-color: #eef;			
-			padding: 15px 20px;
-			position: absolute;
-			left: 0; top: 0;
-		}
-		* html #indicator
-		{
-			padding: 14px 22px;
-		}
-		#tools
-		{
-			width: 600px;
-			height: 50px;
-			background-color: #eef;
-			padding: 0;
-			position: absolute;
-			left: 63px;
-			border-left: 1px solid white;
-			border-bottom: 1px solid white;
-		}
-		#toolbar
-		{
-			width: 53px;
-			height: 435px;
-			background-color: #eef;
-			float: left;
-			text-align: center;
-			padding: 5px;
-			position: absolute;
-			top: 50px;
-			border-top: 1px solid white;
-			border-right: 1px solid white;
-		}
-		
-		#contents
-		{
-			width: 600px;
-			height: 445px;
-			position: absolute;
-			left: 64px; top: 51px;
-		}
-		
-		#editor
-		{
-			width: 600px;
-			height: 445px;
-		}
-
-		#toolbar a 
-		{
-			padding: 5px;
-			width: 40px;
-			display: block;
-			border: 1px solid #eef;
-			text-align: center;
-			text-decoration: none;
-			color: #669;
-			margin: 5px 0;
-		}
-		#toolbar a:hover
-		{
-			background-color: #F9F9FF;
-			border-color: #669;
-		}
-		
-		#toolbar a.iconActive
-		{
-			border-color: #669;
-		}
-
-		#toolbar a span
-		{
-			display: block;
-			text-decoration: none;
-			
-		}
-		#toolbar a img
-		{
-			border: 0 none;
-		}
-		
-		#tools .textInput
-		{
-			width: 3em;
-			vertical-align: 0px;
-
-		}
-		* html #tools .textInput
-		{
-			vertical-align: middle;
-		}
-		#tools .measureStats
-		{
-			width: 4.5em;
-			border: 0 none;
-			background-color: #eef;
-			vertical-align: 0px;
-		}
-		* html #tools .measureStats
-		{
-			vertical-align: middle;
-		}
-		#tools label
-		{
-			margin: 0 2px 0 5px;
-		}
-		#tools input
-		{
-			vertical-align: middle;
-		}
-		#tools #tool_inputs
-		{
-			padding-top: 10px;
-			float: left;			
-		}
-		#tools .div
-		{
-			vertical-align: middle;
-			margin: 0 5px;
-		}
-		#tools img
-		{
-			border: 0 none;
-		}
-		#tools a.buttons
-		{
-			margin-top: 10px;
-			border: 1px solid #eef;
-			display: block;
-			float: left;
-		}
-		#tools a.buttons:hover
-		{
-			background-color: #F9F9FF;
-			border-color: #669;
-		}
-		#slidercasing {
-    /*border:1px solid #CCCCCC;
-    background-color:#FFFFFF;*/
-    width:100px;
-    height:5px;
-    position:relative;
-    z-index:4;
-    padding:10px;
-	 top: 6px;
-	 margin: 0 -5px 0 -10px;
-
-	
-}
-
-
-#slidertrack {
-    position:relative;
-    border:1px solid #CCCCCC;
-    background-color:#FFFFCC;
-    z-index:5;
-    height:5px;
-}
-
-
-#sliderbar {
-    position:absolute;
-    z-index:6;
-    border:1px solid #CCCCCC;
-    background-color:#DDDDDD;
-    width:15px;     
-    padding:0px;
-    height:20px; 
-    cursor: pointer;
-    top:2px;
-}
-
-* html #slidercasing
-{
-	top:0;
-}
-
-
-#bottom
-{
-	position: relative;
-	top: 490px;
-}
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/editorFrame.css 75/e107_handlers/htmlarea/plugins/ImageManager/assets/editorFrame.css
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/editorFrame.css	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/editorFrame.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,8 +0,0 @@
-body { margin: 0; padding: 0;  background-color: #eee; }
-table { width: 100%; }
-table td { text-align: center; }
-.crop{cursor:crosshair;}
-.selection { border: dotted 1px #000000; position:absolute; width: 0px; height: 1px; z-index:5; }
-.selectionWhite{ border: dotted 1px #FFFFFF; position:absolute; width: 0px; height: 1px; z-index:5; }
-.handleBox{ z-index:105; }
-.error { font-size:large; font-weight:bold; color:#c00; font-family: Helvetica, sans-serif; } 
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/editorFrame.js 75/e107_handlers/htmlarea/plugins/ImageManager/assets/editorFrame.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/editorFrame.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/editorFrame.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,96 +0,0 @@
-/**
- * Javascript used by the editorFrame.php, it basically initializes the frame.
- * @author $Author: e107coders $
- * @version $Id: editorFrame.js,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-var topDoc = window.top.document;
-
-var t_cx = topDoc.getElementById('cx');
-var t_cy = topDoc.getElementById('cy');
-var t_cw = topDoc.getElementById('cw');
-var t_ch = topDoc.getElementById('ch');
-
-var m_sx = topDoc.getElementById('sx');
-var m_sy = topDoc.getElementById('sy');
-var m_w = topDoc.getElementById('mw');
-var m_h = topDoc.getElementById('mh');
-var m_a = topDoc.getElementById('ma');
-var m_d = topDoc.getElementById('md');
-
-var s_sw = topDoc.getElementById('sw');
-var s_sh = topDoc.getElementById('sh');
-
-var r_ra = topDoc.getElementById('ra');
-
-var pattern = "img/2x2.gif";
-
-function doSubmit(action)
-{
-    if (action == 'crop')
-    {
-        var url = "editorFrame.php?img="+currentImageFile+"&action=crop&params="+parseInt(t_cx.value)+','+parseInt(t_cy.value)+','+ parseInt(t_cw.value)+','+parseInt(t_ch.value);
-
-        //alert(url);
-        location.href = url;
-
-        //location.reload();
-    }   
-    else if (action == 'scale')
-    {
-        var url = "editorFrame.php?img="+currentImageFile+"&action=scale&params="+parseInt(s_sw.value)+','+parseInt(s_sh.value);
-        //alert(url);
-        location.href = url;
-        
-    }
-    else if (action == 'rotate')
-    {
-        var flip = topDoc.getElementById('flip');
-
-        if(flip.value == 'hoz' || flip.value == 'ver') 
-            location.href = "editorFrame.php?img="+currentImageFile+"&action=flip&params="+flip.value;
-        else if (isNaN(parseFloat(r_ra.value))==false)
-            location.href = "editorFrame.php?img="+currentImageFile+"&action=rotate&params="+parseFloat(r_ra.value);
-    }
-    else if(action == 'save') {
-        var s_file = topDoc.getElementById('save_filename');
-        var s_format = topDoc.getElementById('save_format');
-        var s_quality = topDoc.getElementById('quality');
-
-        var format = s_format.value.split(",");
-        if(s_file.value.length <= 0) 
-		{
-            alert(i18n('Please enter a filename to save.'));
-        }
-        else
-        {
-            var filename = encodeURI(s_file.value);
-            var quality = parseInt(s_quality.value);
-            var url = "editorFrame.php?img="+currentImageFile+"&action=save&params="+format[0]+","+quality+"&file="+filename;
-            //alert(url);
-            location.href = url;
-        }
-    }
-}
-
-
-function addEvent(obj, evType, fn)
-{ 
-	if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
-	else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
-	else {  return false; } 
-} 
-
-var jg_doc
-
-init = function()
-{
-	jg_doc = new jsGraphics("imgCanvas"); // draw directly into document
-	jg_doc.setColor("#000000"); // black
-
-	initEditor();
-}
-
-addEvent(window, 'load', init);
-
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/editor.js 75/e107_handlers/htmlarea/plugins/ImageManager/assets/editor.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/editor.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/editor.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,172 +0,0 @@
-/**
- * Functions for the ImageEditor interface, used by editor.php only	
- * @author $Author: e107coders $
- * @version $Id: editor.js,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-	var current_action = null;
-	var actions = ['crop', 'scale', 'rotate', 'measure', 'save'];
-	var orginal_width = null, orginal_height=null;
-	function toggle(action) 
-	{
-		if(current_action != action)
-		{
-
-			for (var i in actions)
-			{
-				if(actions[i] != action)
-				{
-					var tools = document.getElementById('tools_'+actions[i]);
-					tools.style.display = 'none';
-					var icon = document.getElementById('icon_'+actions[i]);
-					icon.className = '';
-				}
-			}
-
-			current_action = action;
-			
-			var tools = document.getElementById('tools_'+action);
-			tools.style.display = 'block';
-			var icon = document.getElementById('icon_'+action);
-			icon.className = 'iconActive';
-
-			var indicator = document.getElementById('indicator_image');
-			indicator.src = 'img/'+action+'.gif';
-
-			editor.setMode(current_action);
-
-			//constraints on the scale,
-			//code by Frdric Klee <fklee@isuisse.com>
-			if(action == 'scale') 
-			{
-				var theImage = editor.window.document.getElementById('theImage');
-				orginal_width = theImage.width ;
-				orginal_height = theImage.height;
-
-                var w = document.getElementById('sw');
-				w.value = orginal_width ;
-				var h = document.getElementById('sh') ;
-				h.value = orginal_height ;
-			}
-
-		}
-	}
-
-	function toggleMarker() 
-	{
-		var marker = document.getElementById("markerImg");
-		
-		if(marker != null && marker.src != null) {
-			if(marker.src.indexOf("t_black.gif") >= 0)
-				marker.src = "img/t_white.gif";
-			else
-				marker.src = "img/t_black.gif";
-
-			editor.toggleMarker();
-		}
-	}
-
-	//Togggle constraints, by Frdric Klee <fklee@isuisse.com>
-	function toggleConstraints() 
-	{
-		var lock = document.getElementById("scaleConstImg");
-		var checkbox = document.getElementById("constProp");
-		
-		if(lock != null && lock.src != null) {
-			if(lock.src.indexOf("unlocked2.gif") >= 0)
-			{
-				lock.src = "img/islocked2.gif";
-				checkbox.checked = true;
-				checkConstrains('width');
-
-			}
-			else
-			{
-				lock.src = "img/unlocked2.gif";
-				checkbox.checked = false;
-			}
-		}
-	}
-	
-	//check the constraints, by Frdric Klee <fklee@isuisse.com>
-	function checkConstrains(changed) 
-	{
-		var constrained = document.getElementById('constProp');
-		if(constrained.checked) 
-		{
-			var w = document.getElementById('sw') ;
-			var width = w.value ;
-			var h = document.getElementById('sh') ;
-			var height = h.value ;
-			
-			if(orginal_width > 0 && orginal_height > 0) 
-			{
-				if(changed == 'width' && width > 0) 
-					h.value = parseInt((width/orginal_width)*orginal_height);
-				else if(changed == 'height' && height > 0) 
-					w.value = parseInt((height/orginal_height)*orginal_width);
-			}
-		}
-		
-		updateMarker('scale') ;
-	}
-
-
-	function updateMarker(mode) 
-	{
-		if (mode == 'crop')
-		{
-			var t_cx = document.getElementById('cx');
-			var t_cy = document.getElementById('cy');
-			var t_cw = document.getElementById('cw');
-			var t_ch = document.getElementById('ch');
-
-			editor.setMarker(parseInt(t_cx.value), parseInt(t_cy.value), parseInt(t_cw.value), parseInt(t_ch.value));
-		}
-		else if(mode == 'scale') {
-			var s_sw = document.getElementById('sw');
-			var s_sh = document.getElementById('sh');
-			editor.setMarker(0, 0, parseInt(s_sw.value), parseInt(s_sh.value));
-		}
-	}
-
-	
-	function rotatePreset(selection) 
-	{
-		var value = selection.options[selection.selectedIndex].value;
-		
-		if(value.length > 0 && parseInt(value) != 0) {
-			var ra = document.getElementById('ra');
-			ra.value = parseInt(value);
-		}
-	}
-
-	function updateFormat(selection) 
-	{
-		var selected = selection.options[selection.selectedIndex].value;
-
-		var values = selected.split(",");
-		if(values.length >1) {
-			updateSlider(parseInt(values[1]));
-		}
-
-	}
-	function addEvent(obj, evType, fn)
-	{ 
-		if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
-		else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
-		else {  return false; } 
-	} 
-
-	init = function()
-	{
-		var bottom = document.getElementById('bottom');
-		if(window.opener)
-		{
-			__dlg_init(bottom);
-			__dlg_translate(I18N);
-		}
-	}
-
-	addEvent(window, 'load', init);
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/hover.htc 75/e107_handlers/htmlarea/plugins/ImageManager/assets/hover.htc
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/hover.htc	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/hover.htc	1969-12-31 18:00:00.000000000 -0600
@@ -1,34 +0,0 @@
-<attach event="onmouseover" handler="hoverRollOver" />
-<attach event="onmouseout" handler="hoverRollOff" />
-<script type="text/javascript">
-//
-//	Simple behaviour for IE5+ to emulate :hover CSS pseudo-class.
-//  Experimental ver 0.1
-//
-//	This is an experimental version! Handle with care!
-//	Manual at: http://www.hszk.bme.hu/~hj130/css/list_menu/hover/
-//
-
-function hoverRollOver() {
-	
-	element.origClassName = element.className;	// backup origonal className
-	
-	var tempClassStr = element.className;		
-	
-	tempClassStr += "Hover";					// convert name+'Hover' the last class name	to emulate tag.class:hover
-	
-	tempClassStr = tempClassStr.replace(/\s/g,"Hover ");	//convert name+'Hover' the others to emulate tag.class:hover
-	
-	tempClassStr += " hover";				// add simple 'hover' class name to emulate tag:hover
-	
-	element.className = element.className + " " + tempClassStr; 
-	
-	//alert(element.className);
-	//window.status = element.className;		// only for TEST
-}
-function hoverRollOff() {
-	element.className = element.origClassName;
-}
-
-</script>
-
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/ImageEditor.css 75/e107_handlers/htmlarea/plugins/ImageManager/assets/ImageEditor.css
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/ImageEditor.css	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/ImageEditor.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,76 +0,0 @@
-.icons {
-    font: 11px Tahoma,Verdana,sans-serif;
-    color: #666699;
-    text-align: center;
-    text-decoration: none;
-    border: 1px solid #EEEEFF;
-    -Moz-Border-Radius: 6px 6px 6px 6px;
-}
-
-body, td, p {
-    font: 11px Tahoma,Verdana,sans-serif;
-}
-.iconsOver {
-    font: 11px Tahoma,Verdana,sans-serif;
-    color: #666699;
-    text-align: center;
-    text-decoration: none;
-    background-color: #F9F9FF;
-    border: 1px solid #666699;
-    -Moz-Border-Radius: 6px 6px 6px 6px;
-}
-.topBar {
-    font: 11px Tahoma,Verdana,sans-serif;
-    color: #666699;
-}
-.iconsSel {
-    font: 11px Tahoma,Verdana,sans-serif;
-    color: #666699;
-    text-align: center;
-    text-decoration: none;
-    border: 1px solid #666699;
-    -Moz-Border-Radius: 6px 6px 6px 6px;
-}
-.iconText {
-    font: 11px Tahoma,Verdana,sans-serif;
-    color: #666699;
-    text-decoration: none;
-    text-align: center;
-}
-.measureStats{
-    width: 50px;
-}
-
-#slidercasing {
-    /*border:1px solid #CCCCCC;
-    background-color:#FFFFFF;*/
-    width:100px;
-    height:5px;
-    position:relative;
-    z-index:4;
-    padding:10px;
-}
-
-
-#slidertrack {
-    position:relative;
-    border:1px solid #CCCCCC;
-    background-color:#FFFFCC;
-    z-index:5;
-    height:5px;
-}
-
-
-#sliderbar {
-    position:absolute;
-    z-index:6;
-    border:1px solid #CCCCCC;
-    background-color:#DDDDDD;
-    width:15px;     
-    padding:0px;
-    height:20px; 
-    cursor: pointer;
-    top:2px;
-}
-
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/imagelist.css 75/e107_handlers/htmlarea/plugins/ImageManager/assets/imagelist.css
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/imagelist.css	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/imagelist.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,10 +0,0 @@
-body { margin: 0; padding: 0; }
-.block { height: 98px; width: 98px; border: 1px solid threedface; text-align: center; behavior: url(hover.htc ); }
-.block a img { border: 0 none; }
-.block:hover, .block.hover{ background-color: #ffc; }
-.edit { font-size: 9pt; font-family: "MS Sans Serif", Geneva, sans-serif; padding-top: 3px;}
-.edit a { border: 1px solid white; padding: 3px; }
-.edit a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; background-color: #ffc; }
-.edit a img { border: 0 none; vertical-align: bottom; }
-.noResult { font-size:large; font-weight:bold; color:#ccc; font-family: Helvetica, sans-serif;  text-align: center;  padding-top: 60px;   }
-.error { color:#c00; font-weight:bold; font-size: medium; font-family: Helvetica, sans-serif; text-align: center;  padding-top: 65px;}
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/images.js 75/e107_handlers/htmlarea/plugins/ImageManager/assets/images.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/images.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/images.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,105 +0,0 @@
-/**
- * Functions for the image listing, used by images.php only	
- * @author $Author: e107coders $
- * @version $Id: images.js,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-	function i18n(str) {
-		if(I18N)
-		  return (I18N[str] || str);
-		else
-			return str;
-	};
-
-	function changeDir(newDir) 
-	{
-		showMessage('Loading');
-		location.href = "images.php?dir="+newDir;
-	}
-
-
-	function newFolder(dir, newDir) 
-	{
-		location.href = "images.php?dir="+dir+"&newDir="+newDir;
-	}
-
-	//update the dir list in the parent window.
-	function updateDir(newDir)
-	{
-		var selection = window.top.document.getElementById('dirPath');
-		if(selection)
-		{
-			for(var i = 0; i < selection.length; i++)
-			{
-				var thisDir = selection.options[i].text;
-				if(thisDir == newDir)
-				{
-					selection.selectedIndex = i;
-					showMessage('Loading');
-					break;
-				}
-			}		
-		}
-	}
-
-	function selectImage(filename, alt, width, height) 
-	{
-		var topDoc = window.top.document;
-		
-		var obj = topDoc.getElementById('f_url');  obj.value = filename;
-		var obj = topDoc.getElementById('f_width');  obj.value = width;
-		var obj = topDoc.getElementById('f_width'); obj.value = width;
-		var obj = topDoc.getElementById('f_height'); obj.value = height;
-		var obj = topDoc.getElementById('f_alt'); obj.value = alt;
-		var obj = topDoc.getElementById('orginal_width'); obj.value = width;
-		var obj = topDoc.getElementById('orginal_height'); obj.value = height;		
-	}
-
-	function showMessage(newMessage) 
-	{
-		var topDoc = window.top.document;
-
-		var message = topDoc.getElementById('message');
-		var messages = topDoc.getElementById('messages');
-		if(message && messages)
-		{
-			if(message.firstChild)
-				message.removeChild(message.firstChild);
-
-			message.appendChild(topDoc.createTextNode(i18n(newMessage)));
-			
-			messages.style.display = "block";
-		}
-	}
-
-	function addEvent(obj, evType, fn)
-	{ 
-		if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
-		else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
-		else {  return false; } 
-	} 
-
-	function confirmDeleteFile(file) 
-	{
-		if(confirm(i18n("Delete file?")))
-			return true;
-	
-		return false;		
-	}
-
-	function confirmDeleteDir(dir, count) 
-	{
-		if(count > 0)
-		{
-			alert(i18n("Please delete all files/folders inside the folder you wish to delete first."));
-			return;
-		}
-
-		if(confirm(i18n("Delete folder?"))) 
-			return true;
-
-		return false;
-	}
-
-	addEvent(window, 'load', init);
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/manager.css 75/e107_handlers/htmlarea/plugins/ImageManager/assets/manager.css
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/manager.css	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/manager.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,19 +0,0 @@
-html, body {  background-color: ButtonFace;  color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;}
-body { padding: 5px; }
-fieldset { padding: 0;}
-.title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px  solid black; letter-spacing: 2px;}
-form { padding: 0px;  margin: 0 auto; width: 550px;}
-.dirWidth { width: 70%; }
-a { padding: 5px; border: 1px solid ButtonFace;	}	
-a img	{ border: 0; }	
-a:hover { border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight; }
-.dirs {	padding: 1em; 	}
-.imageFrame { width: 525px; height: 145px; margin: 0 auto; margin-top: 1em; background-color: White;}
-.smallWidth{ width: 4em; }
-.largelWidth{ width: 22em; }
-.inputTable { margin: 1em auto; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-.buttons { width: 70px; text-align: center; }
-.clearboth{ clear: both; }
-#messages { position: relative; left: 175px; top: 115px; background-color: white; width:200px;  float: left; margin-top: -52px; border: 1px solid #ccc; text-align: center; padding: 15px; }
-#message  { font-size: 15px; font-weight: bold; color: #69c; }
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/manager.js 75/e107_handlers/htmlarea/plugins/ImageManager/assets/manager.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/manager.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/manager.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,241 +0,0 @@
-/**
- * Functions for the ImageManager, used by manager.php only	
- * @author $Author: e107coders $
- * @version $Id: manager.js,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-	
-	//Translation
-	function i18n(str) {
-		if(I18N)
-		  return (I18N[str] || str);
-		else
-			return str;
-	};
-
-
-	//set the alignment options
-	function setAlign(align) 
-	{
-		var selection = document.getElementById('f_align');
-		for(var i = 0; i < selection.length; i++)
-		{
-			if(selection.options[i].value == align)
-			{
-				selection.selectedIndex = i;
-				break;
-			}
-		}
-	}
-
-	//initialise the form
-	init = function () 
-	{
-		__dlg_init();
-
-		if(I18N)
-			__dlg_translate(I18N);
-
-		var uploadForm = document.getElementById('uploadForm');
-		if(uploadForm) uploadForm.target = 'imgManager';
-
-		var param = window.dialogArguments;
-		if (param) 
-		{
-			document.getElementById("f_url").value = param["f_url"];
-			document.getElementById("f_alt").value = param["f_alt"];
-			document.getElementById("f_border").value = param["f_border"];
-			document.getElementById("f_vert").value = param["f_vert"];
-			document.getElementById("f_horiz").value = param["f_horiz"];
-			document.getElementById("f_width").value = param["f_width"];
-			document.getElementById("f_height").value = param["f_height"];
-			setAlign(param["f_align"]);
-		}
-
-		document.getElementById("f_url").focus();
-	}
-
-
-	function onCancel() 
-	{
-		__dlg_close(null);
-		return false;
-	};
-
-	function onOK() 
-	{
-		// pass data back to the calling window
-		var fields = ["f_url", "f_alt", "f_align", "f_border", "f_horiz", "f_vert", "f_height", "f_width"];
-		var param = new Object();
-		for (var i in fields) 
-		{
-			var id = fields[i];
-			var el = document.getElementById(id);
-			if(id == "f_url" && el.value.indexOf('://') < 0 )
-				param[id] = makeURL(base_url,el.value);
-			else
-				param[id] = el.value;
-		}
-		__dlg_close(param);
-		return false;
-	};
-
-	//similar to the Files::makeFile() in Files.php
-	function makeURL(pathA, pathB) 
-	{
-		if(pathA.substring(pathA.length-1) != '/')
-			pathA += '/';
-
-		if(pathB.charAt(0) == '/');	
-			pathB = pathB.substring(1);
-
-		return pathA+pathB;
-	}
-
-
-	function updateDir(selection) 
-	{
-		var newDir = selection.options[selection.selectedIndex].value;
-		changeDir(newDir);
-	}
-
-	function goUpDir() 
-	{
-		var selection = document.getElementById('dirPath');
-		var currentDir = selection.options[selection.selectedIndex].text;
-		if(currentDir.length < 2)
-			return false;
-		var dirs = currentDir.split('/');
-		
-		var search = '';
-
-		for(var i = 0; i < dirs.length - 2; i++)
-		{
-			search += dirs[i]+'/';
-		}
-
-		for(var i = 0; i < selection.length; i++)
-		{
-			var thisDir = selection.options[i].text;
-			if(thisDir == search)
-			{
-				selection.selectedIndex = i;
-				var newDir = selection.options[i].value;
-				changeDir(newDir);
-				break;
-			}
-		}
-	}
-
-	function changeDir(newDir) 
-	{
-		if(typeof imgManager != 'undefined')
-			imgManager.changeDir(newDir);
-	}
-
-	function toggleConstrains(constrains) 
-	{
-		var lockImage = document.getElementById('imgLock');
-		var constrains = document.getElementById('constrain_prop');
-
-		if(constrains.checked) 
-		{
-			lockImage.src = "img/locked.gif";	
-			checkConstrains('width') 
-		}
-		else
-		{
-			lockImage.src = "img/unlocked.gif";	
-		}
-	}
-
-	function checkConstrains(changed) 
-	{
-		//alert(document.form1.constrain_prop);
-		var constrains = document.getElementById('constrain_prop');
-		
-		if(constrains.checked) 
-		{
-			var obj = document.getElementById('orginal_width');
-			var orginal_width = parseInt(obj.value);
-			var obj = document.getElementById('orginal_height');
-			var orginal_height = parseInt(obj.value);
-
-			var widthObj = document.getElementById('f_width');
-			var heightObj = document.getElementById('f_height');
-			
-			var width = parseInt(widthObj.value);
-			var height = parseInt(heightObj.value);
-
-			if(orginal_width > 0 && orginal_height > 0) 
-			{
-				if(changed == 'width' && width > 0) {
-					heightObj.value = parseInt((width/orginal_width)*orginal_height);
-				}
-
-				if(changed == 'height' && height > 0) {
-					widthObj.value = parseInt((height/orginal_height)*orginal_width);
-				}
-			}			
-		}
-	}
-
-	function showMessage(newMessage) 
-	{
-		var message = document.getElementById('message');
-		var messages = document.getElementById('messages');
-		if(message.firstChild)
-			message.removeChild(message.firstChild);
-
-		message.appendChild(document.createTextNode(i18n(newMessage)));
-		
-		messages.style.display = "block";
-	}
-
-	function addEvent(obj, evType, fn)
-	{ 
-		if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
-		else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
-		else {  return false; } 
-	} 
-
-	function doUpload() 
-	{
-		
-		var uploadForm = document.getElementById('uploadForm');
-		if(uploadForm)
-			showMessage('Uploading');
-	}
-
-	function refresh()
-	{
-		var selection = document.getElementById('dirPath');
-		updateDir(selection);
-	}
-
-
-	function newFolder() 
-	{
-		var selection = document.getElementById('dirPath');
-		var dir = selection.options[selection.selectedIndex].value;
-
-		Dialog("newFolder.html", function(param) 
-		{
-			if (!param) // user must have pressed Cancel
-				return false;
-			else
-			{
-				var folder = param['f_foldername'];
-				if(folder == thumbdir)
-				{
-					alert(i18n('Invalid folder name, please choose another folder name.'));
-					return false;
-				}
-
-				if (folder && folder != '' && typeof imgManager != 'undefined') 
-					imgManager.newFolder(dir, encodeURI(folder)); 
-			}
-		}, null);
-	}
-
-	addEvent(window, 'load', init);
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/popup.js 75/e107_handlers/htmlarea/plugins/ImageManager/assets/popup.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/popup.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/popup.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,123 +0,0 @@
-// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
-// This copyright notice MUST stay intact for use (see license.txt).
-//
-// Portions (c) dynarch.com, 2003
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon.
-//   http://dynarch.com/mishoo
-//
-// $Id: popup.js,v 1.1 2004/06/26 13:48:37 e107coders Exp $
-
-// Slightly modified for the ImageManager, window resizing is done only
-// by each window's script. Added translation for a few other HTML elements.
-
-function getAbsolutePos(el) {
-	var r = { x: el.offsetLeft, y: el.offsetTop };
-	if (el.offsetParent) {
-		var tmp = getAbsolutePos(el.offsetParent);
-		r.x += tmp.x;
-		r.y += tmp.y;
-	}
-	return r;
-};
-
-function comboSelectValue(c, val) {
-	var ops = c.getElementsByTagName("option");
-	for (var i = ops.length; --i >= 0;) {
-		var op = ops[i];
-		op.selected = (op.value == val);
-	}
-	c.value = val;
-};
-
-function __dlg_onclose() {
-	if(opener.Dialog._return)
-		opener.Dialog._return(null);
-};
-
-function __dlg_init(bottom) {
-	var body = document.body;
-	var body_height = 0;
-	if (typeof bottom == "undefined") {
-		var div = document.createElement("div");
-		body.appendChild(div);
-		var pos = getAbsolutePos(div);
-		body_height = pos.y;
-	} else {
-		var pos = getAbsolutePos(bottom);
-		body_height = pos.y + bottom.offsetHeight;
-	}
-	if(opener && opener.Dialog && opener.Dialog._arguments)
-		window.dialogArguments = opener.Dialog._arguments;
-	if (!document.all) {
-		//window.sizeToContent();
-		//window.sizeToContent();	// for reasons beyond understanding,
-					// only if we call it twice we get the
-					// correct size.
-		window.addEventListener("unload", __dlg_onclose, true);
-		// center on parent
-		var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
-		var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
-		window.moveTo(x, y);
-		//window.innerWidth = body.offsetWidth + 5;
-		//window.innerHeight = body_height + 2;
-	} else {
-		// window.dialogHeight = body.offsetHeight + 50 + "px";
-		// window.dialogWidth = body.offsetWidth + "px";
-		//window.resizeTo(body.offsetWidth, body_height);
-		var ch = body.clientHeight;
-		var cw = body.clientWidth;
-		//window.resizeBy(body.offsetWidth - cw, body_height - ch);
-		var W = body.offsetWidth;
-		var H = 2 * body_height - ch;
-		if(ch <= 0) H = body_height;
-		var x = (screen.availWidth - W) / 2;
-		var y = (screen.availHeight - H) / 2;
-		
-		window.moveTo(x, y);
-	}
-	document.body.onkeypress = __dlg_close_on_esc;
-};
-
-function __dlg_translate(i18n) {
-	var types = ["span", "option", "td", "button", "div", "label", "a","img", "legend"];
-	for (var type in types) {
-		var spans = document.getElementsByTagName(types[type]);
-		for (var i = spans.length; --i >= 0;) {
-			var span = spans[i];
-			if (span.firstChild && span.firstChild.data) {				
-				var txt = i18n[span.firstChild.data];
-				if (txt) span.firstChild.data = txt;
-			}
-			if(span.title){
-				var txt = i18n[span.title];
-				if(txt) span.title = txt;
-			}
-			if(span.alt){
-				var txt = i18n[span.alt];
-				if(txt) span.alt = txt;
-			}
-		}
-	}
-	var txt = i18n[document.title];
-	if (txt)
-		document.title = txt;
-};
-
-// closes the dialog and passes the return info upper.
-function __dlg_close(val) {
-	opener.Dialog._return(val);
-	window.close();
-};
-
-function __dlg_close_on_esc(ev) {
-	ev || (ev = window.event);
-	if (ev.keyCode == 27) {
-		window.close();
-		return false;
-	}
-	return true;
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/slider.js 75/e107_handlers/htmlarea/plugins/ImageManager/assets/slider.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/slider.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/slider.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,105 +0,0 @@
-/***********************************************************************
-** Title.........:  Simple Lite Slider for Image Editor
-** Version.......:  1.1
-** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
-** Filename......:  slider.js
-** Last changed..:  31 Mar 2004 
-** Notes.........:  Works in IE and Mozilla
-**/ 
-
-var ie=document.all
-var ns6=document.getElementById&&!document.all
-
-document.onmouseup = captureStop;
-
-var currentSlider = null,sliderField = null;
-var rangeMin = null, rangeMax= null, sx = -1, sy = -1, initX=0;
-
-function getMouseXY(e) {
-
-    //alert('hello');
-    x = ns6? e.clientX: event.clientX
-    y = ns6? e.clientY: event.clientY
-    
-    if (sx < 0) sx = x; if (sy < 0) sy = y;
-
-    var dx = initX +(x-sx);
-    
-    if (dx <= rangeMin)
-        dx = rangeMin;
-    else if (dx >= rangeMax)
-        dx = rangeMax;
-
-    var range = (dx-rangeMin)/(rangeMax - rangeMin)*100;
-
-    if (currentSlider !=  null)
-        currentSlider.style.left = dx+"px";
-        
-    if (sliderField != null)
-    {
-        sliderField.value = parseInt(range);
-    }
-    return false;
-
-}
-
-function initSlider()
-{
-    if (currentSlider == null)
-        currentSlider = document.getElementById('sliderbar');
-   
-    if (sliderField == null)
-        sliderField = document.getElementById('quality');
-
-    if (rangeMin == null)
-        rangeMin = 3
-    if (rangeMax == null)
-    {
-        var track = document.getElementById('slidertrack');
-        rangeMax = parseInt(track.style.width);
-    }
-
-}
-
-function updateSlider(value)
-{
-    initSlider();
-
-    var newValue = parseInt(value)/100*(rangeMax-rangeMin);
-
-    if (newValue <= rangeMin)
-        newValue = rangeMin;
-    else if (newValue >= rangeMax)
-        newValue = rangeMax;
-
-    if (currentSlider !=  null)
-        currentSlider.style.left = newValue+"px";
-    
-    var range = newValue/(rangeMax - rangeMin)*100;
-
-    if (sliderField != null)
-        sliderField.value = parseInt(range);
-}
-
-function captureStart()
-{
-    
-    initSlider();
-
-    initX = parseInt(currentSlider.style.left);
-    if (initX > rangeMax)
-        initX = rangeMax;
-    else if (initX < rangeMin)
-        initX = rangeMin;
-
-    document.onmousemove = getMouseXY;
-
-    return false;
-}
-
-function captureStop()
-{
-    sx = -1; sy = -1;
-    document.onmousemove = null;
-    return false;
-}
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/wz_jsgraphics.js 75/e107_handlers/htmlarea/plugins/ImageManager/assets/wz_jsgraphics.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/assets/wz_jsgraphics.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/assets/wz_jsgraphics.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,921 +0,0 @@
-/***********************************************************************
-** Title.........:  Javascript Graphics
-** Version.......:  1.0
-** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
-** Filename......:  wz_jsgraphics.js
-** Last changed..:  31 Aug 2003  
-** Notes.........:  Modified for Image Editor, added extra commands
-**/ 
-
-/* This notice must be untouched at all times.
-
-wz_jsgraphics.js    v. 2.03
-The latest version is available at
-http://www.walterzorn.com
-or http://www.devira.com
-or http://www.walterzorn.de
-
-Copyright (c) 2002-2003 Walter Zorn. All rights reserved.
-Created 3. 11. 2002 by Walter Zorn <walter@kreuzotter.de>
-Last modified: 11. 6. 2003
-
-High Performance JavaScript Graphics Library.
-Provides methods
-- to draw lines, rectangles, ellipses, polygons
-  with specifiable line thickness,
-- to fill rectangles and ellipses
-- to draw text.
-NOTE: Operations, functions and branching have rather been optimized
-to efficiency and speed than to shortness of source code.
-
-This program is free software;
-you can redistribute it and/or modify it under the terms of the
-GNU General Public License as published by the Free Software Foundation;
-either version 2 of the License, or (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY;
-without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-See the GNU General Public License
-at http://www.gnu.org/copyleft/gpl.html for more details.
-*/
-
-
-
-
-
-var jg_ihtm, jg_ie, jg_dom,
-jg_n4 = (document.layers && typeof document.classes != "undefined");
-
-
-
-
-
-function chkDHTM(x, i)
-{
-    x = document.body || null;
-    jg_ie = (x && typeof x.insertAdjacentHTML != "undefined");
-    jg_dom = (x && !jg_ie &&
-        typeof x.appendChild != "undefined" &&
-        typeof document.createRange != "undefined" &&
-        typeof (i = document.createRange()).setStartBefore != "undefined" &&
-        typeof i.createContextualFragment != "undefined");
-    jg_ihtm = (!jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined");
-}
-
-
-
-
-
-function pntDoc()
-{
-    this.wnd.document.write(this.htm);
-    this.htm = '';
-}
-
-
-
-
-
-function pntCnvDom()
-{
-    var x = document.createRange();
-    x.setStartBefore(this.cnv);
-    x = x.createContextualFragment(this.htm);
-    this.cnv.appendChild(x);
-    this.htm = '';
-}
-
-
-
-
-
-function pntCnvIe()
-{
-    this.cnv.insertAdjacentHTML("BeforeEnd", this.htm);
-    this.htm = '';
-}
-
-
-
-
-
-function pntCnvIhtm()
-{
-    this.cnv.innerHTML += this.htm;
-    this.htm = '';
-}
-
-
-
-
-
-function pntCnv()
-{
-    this.htm = '';
-}
-
-
-
-
-
-function mkDiv(x, y, w, h)
-{
-    this.htm += '<div style="position:absolute;'+
-        'left:' + x + 'px;'+
-        'top:' + y + 'px;'+
-        'width:' + w + 'px;'+
-        'height:' + h + 'px;'+
-        'clip:rect(0,'+w+'px,'+h+'px,0);'+
-        'overflow:hidden;background-color:' + this.color + ';'+
-        '"><\/div>';
-
-    //alert(this.htm);
-}
-
-
-
-
-function mkDivPrint(x, y, w, h)
-{
-    this.htm += '<div style="position:absolute;'+
-        'border-left:' + w + 'px solid ' + this.color + ';'+
-        'left:' + x + 'px;'+
-        'top:' + y + 'px;'+
-        'width:' + w + 'px;'+
-        'height:' + h + 'px;'+
-        'clip:rect(0,'+w+'px,'+h+'px,0);'+
-        'overflow:hidden;background-color:' + this.color + ';'+
-        '"><\/div>';
-}
-
-
-
-
-
-function mkLyr(x, y, w, h)
-{
-    this.htm += '<layer '+
-        'left="' + x + '" '+
-        'top="' + y + '" '+
-        'width="' + w + '" '+
-        'height="' + h + '" '+
-        'bgcolor="' + this.color + '"><\/layer>\n';
-}
-
-
-
-
-
-function mkLbl(txt, x, y)
-{
-    this.htm += '<div style="position:absolute;white-space:nowrap;'+
-        'left:' + x + 'px;'+
-        'top:' + y + 'px;'+
-        'font-family:' +  this.ftFam + ';'+
-        'font-size:' + this.ftSz + ';'+
-        'color:' + this.color + ';' + this.ftSty + '">'+
-        txt +
-        '<\/div>';
-}
-
-
-
-
-
-function mkLin(x1, y1, x2, y2)
-{
-    if (x1 > x2)
-    {
-        var _x2 = x2;
-        var _y2 = y2;
-        x2 = x1;
-        y2 = y1;
-        x1 = _x2;
-        y1 = _y2;
-    }
-    var dx = x2-x1, dy = Math.abs(y2-y1),
-    x = x1, y = y1,
-    yIncr = (y1 > y2)? -1 : 1;
-
-    if (dx >= dy)
-    {
-        var pr = dy<<1,
-        pru = pr - (dx<<1),
-        p = pr-dx,
-        ox = x;
-        while ((dx--) > 0)
-        {
-            ++x;
-            if (p > 0)
-            {
-                this.mkDiv(ox, y, x-ox, 1);
-                y += yIncr;
-                p += pru;
-                ox = x;
-            }
-            else p += pr;
-        }
-        this.mkDiv(ox, y, x2-ox+1, 1);
-    }
-
-    else
-    {
-        var pr = dx<<1,
-        pru = pr - (dy<<1),
-        p = pr-dy,
-        oy = y;
-        if (y2 <= y1)
-        {
-            while ((dy--) > 0)
-            {
-                if (p > 0)
-                {
-                    this.mkDiv(x++, y, 1, oy-y+1);
-                    y += yIncr;
-                    p += pru;
-                    oy = y;
-                }
-                else
-                {
-                    y += yIncr;
-                    p += pr;
-                }
-            }
-            this.mkDiv(x2, y2, 1, oy-y2+1);
-        }
-        else
-        {
-            while ((dy--) > 0)
-            {
-                y += yIncr;
-                if (p > 0)
-                {
-                    this.mkDiv(x++, oy, 1, y-oy);
-                    p += pru;
-                    oy = y;
-                }
-                else p += pr;
-            }
-            this.mkDiv(x2, oy, 1, y2-oy+1);
-        }
-    }
-}
-
-
-
-
-
-function mkLin2D(x1, y1, x2, y2)
-{
-    if (x1 > x2)
-    {
-        var _x2 = x2;
-        var _y2 = y2;
-        x2 = x1;
-        y2 = y1;
-        x1 = _x2;
-        y1 = _y2;
-    }
-    var dx = x2-x1, dy = Math.abs(y2-y1),
-    x = x1, y = y1,
-    yIncr = (y1 > y2)? -1 : 1;
-
-
-    var s = this.stroke;
-    if (dx >= dy)
-    {
-        if (s-0x3 > 0)
-        {
-            var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx;
-            _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1;
-        }
-        else var _s = s;
-        var ad = Math.ceil(s/2);
-
-        var pr = dy<<1,
-        pru = pr - (dx<<1),
-        p = pr-dx,
-        ox = x;
-        while ((dx--) > 0)
-        {
-            ++x;
-            if (p > 0)
-            {
-                this.mkDiv(ox, y, x-ox+ad, _s);
-                y += yIncr;
-                p += pru;
-                ox = x;
-            }
-            else p += pr;
-        }
-        this.mkDiv(ox, y, x2-ox+ad+1, _s);
-    }
-
-    else
-    {
-        if (s-0x3 > 0)
-        {
-            var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy;
-            _s = (!(s-0x4)? Math.ceil(_s) : Math.round(_s)) + 1;
-        }
-        else var _s = s;
-        var ad = Math.round(s/2);
-
-        var pr = dx<<1,
-        pru = pr - (dy<<1),
-        p = pr-dy,
-        oy = y;
-        if (y2 <= y1)
-        {
-            ++ad;
-            while ((dy--) > 0)
-            {
-                if (p > 0)
-                {
-                    this.mkDiv(x++, y, _s, oy-y+ad);
-                    y += yIncr;
-                    p += pru;
-                    oy = y;
-                }
-                else
-                {
-                    y += yIncr;
-                    p += pr;
-                }
-            }
-            this.mkDiv(x2, y2, _s, oy-y2+ad);
-        }
-        else
-        {
-            while ((dy--) > 0)
-            {
-                y += yIncr;
-                if (p > 0)
-                {
-                    this.mkDiv(x++, oy, _s, y-oy+ad);
-                    p += pru;
-                    oy = y;
-                }
-                else p += pr;
-            }
-            this.mkDiv(x2, oy, _s, y2-oy+ad+1);
-        }
-    }
-}
-
-
-
-
-
-function mkLinDott(x1, y1, x2, y2)
-{
-    if (x1 > x2)
-    {
-        var _x2 = x2;
-        var _y2 = y2;
-        x2 = x1;
-        y2 = y1;
-        x1 = _x2;
-        y1 = _y2;
-    }
-    var dx = x2-x1, dy = Math.abs(y2-y1),
-    x = x1, y = y1,
-    yIncr = (y1 > y2)? -1 : 1,
-    drw = true;
-    if (dx >= dy)
-    {
-        var pr = dy<<1,
-        pru = pr - (dx<<1),
-        p = pr-dx;
-        while ((dx--) > 0)
-        {
-            if (drw) this.mkDiv(x, y, 1, 1);
-            drw = !drw;
-            if (p > 0)
-            {
-                y += yIncr;
-                p += pru;
-            }
-            else p += pr;
-            ++x;
-        }
-        if (drw) this.mkDiv(x, y, 1, 1);
-    }
-
-    else
-    {
-        var pr = dx<<1,
-        pru = pr - (dy<<1),
-        p = pr-dy;
-        while ((dy--) > 0)
-        {
-            if (drw) this.mkDiv(x, y, 1, 1);
-            drw = !drw;
-            y += yIncr;
-            if (p > 0)
-            {
-                ++x;
-                p += pru;
-            }
-            else p += pr;
-        }
-        if (drw) this.mkDiv(x, y, 1, 1);
-    }
-}
-
-
-
-
-
-function mkOv(left, top, width, height)
-{
-    var a = width>>1, b = height>>1,
-    wod = width&1, hod = (height&1)+1,
-    cx = left+a, cy = top+b,
-    x = 0, y = b,
-    ox = 0, oy = b,
-    aa = (a*a)<<1, bb = (b*b)<<1,
-    st = (aa>>1)*(1-(b<<1)) + bb,
-    tt = (bb>>1) - aa*((b<<1)-1),
-    w, h;
-    while (y > 0)
-    {
-        if (st < 0)
-        {
-            st += bb*((x<<1)+0x3);
-            tt += (bb<<1)*(++x);
-        }
-        else if (tt < 0)
-        {
-            st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
-            tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
-            w = x-ox;
-            h = oy-y;
-            if (w&0x2 && h&0x2)
-            {
-                this.mkOvQds(cx, cy, -x+0x2, ox+wod, -oy, oy-1+hod, 1, 1);
-                this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1);
-            }
-            else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h);
-            ox = x;
-            oy = y;
-        }
-        else
-        {
-            tt -= aa*((y<<1)-0x3);
-            st -= (aa<<1)*(--y);
-        }
-    }
-    this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod);
-    this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod);
-}
-
-
-
-
-
-function mkOv2D(left, top, width, height)
-{
-    var s = this.stroke;
-    width += s-1;
-    height += s-1;
-    var a = width>>1, b = height>>1,
-    wod = width&1, hod = (height&1)+1,
-    cx = left+a, cy = top+b,
-    x = 0, y = b,
-    aa = (a*a)<<1, bb = (b*b)<<1,
-    st = (aa>>1)*(1-(b<<1)) + bb,
-    tt = (bb>>1) - aa*((b<<1)-1);
-
-
-    if (s-0x4 < 0 && (!(s-0x2) || width-0x33 > 0 && height-0x33 > 0))
-    {
-        var ox = 0, oy = b,
-        w, h,
-        pxl, pxr, pxt, pxb, pxw;
-        while (y > 0)
-        {
-            if (st < 0)
-            {
-                st += bb*((x<<1)+0x3);
-                tt += (bb<<1)*(++x);
-            }
-            else if (tt < 0)
-            {
-                st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
-                tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
-                w = x-ox;
-                h = oy-y;
-
-                if (w-1)
-                {
-                    pxw = w+1+(s&1);
-                    h = s;
-                }
-                else if (h-1)
-                {
-                    pxw = s;
-                    h += 1+(s&1);
-                }
-                else pxw = h = s;
-                this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h);
-                ox = x;
-                oy = y;
-            }
-            else
-            {
-                tt -= aa*((y<<1)-0x3);
-                st -= (aa<<1)*(--y);
-            }
-        }
-        this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod);
-        this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod);
-    }
-
-
-    else
-    {
-        var _a = (width-((s-1)<<1))>>1,
-        _b = (height-((s-1)<<1))>>1,
-        _x = 0, _y = _b,
-        _aa = (_a*_a)<<1, _bb = (_b*_b)<<1,
-        _st = (_aa>>1)*(1-(_b<<1)) + _bb,
-        _tt = (_bb>>1) - _aa*((_b<<1)-1),
-
-        pxl = new Array(),
-        pxt = new Array(),
-        _pxb = new Array();
-        pxl[0] = 0;
-        pxt[0] = b;
-        _pxb[0] = _b-1;
-        while (y > 0)
-        {
-            if (st < 0)
-            {
-                st += bb*((x<<1)+0x3);
-                tt += (bb<<1)*(++x);
-                pxl[pxl.length] = x;
-                pxt[pxt.length] = y;
-            }
-            else if (tt < 0)
-            {
-                st += bb*((x<<1)+0x3) - (aa<<1)*(y-1);
-                tt += (bb<<1)*(++x) - aa*(((y--)<<1)-0x3);
-                pxl[pxl.length] = x;
-                pxt[pxt.length] = y;
-            }
-            else
-            {
-                tt -= aa*((y<<1)-0x3);
-                st -= (aa<<1)*(--y);
-            }
-
-            if (_y > 0)
-            {
-                if (_st < 0)
-                {
-                    _st += _bb*((_x<<1)+0x3);
-                    _tt += (_bb<<1)*(++_x);
-                    _pxb[_pxb.length] = _y-1;
-                }
-                else if (_tt < 0)
-                {
-                    _st += _bb*((_x<<1)+0x3) - (_aa<<1)*(_y-1);
-                    _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-0x3);
-                    _pxb[_pxb.length] = _y-1;
-                }
-                else
-                {
-                    _tt -= _aa*((_y<<1)-0x3);
-                    _st -= (_aa<<1)*(--_y);
-                    _pxb[_pxb.length-1]--;
-                }
-            }
-        }
-
-        var ox = 0, oy = b,
-        _oy = _pxb[0],
-        l = pxl.length,
-        w, h;
-        for (var i = 0; i < l; i++)
-        {
-            if (typeof _pxb[i] != "undefined")
-            {
-                if (_pxb[i] < _oy || pxt[i] < oy)
-                {
-                    x = pxl[i];
-                    this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy);
-                    ox = x;
-                    oy = pxt[i];
-                    _oy = _pxb[i];
-                }
-            }
-            else
-            {
-                x = pxl[i];
-                this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod);
-                this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
-                ox = x;
-                oy = pxt[i];
-            }
-        }
-        this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod);
-        this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
-    }
-}
-
-
-
-
-
-function mkOvDott(left, top, width, height)
-{
-    var a = width>>1, b = height>>1,
-    wod = width&1, hod = height&1,
-    cx = left+a, cy = top+b,
-    x = 0, y = b,
-    aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
-    st = (aa2>>1)*(1-(b<<1)) + bb,
-    tt = (bb>>1) - aa2*((b<<1)-1),
-    drw = true;
-    while (y > 0)
-    {
-        if (st < 0)
-        {
-            st += bb*((x<<1)+0x3);
-            tt += (bb<<1)*(++x);
-        }
-        else if (tt < 0)
-        {
-            st += bb*((x<<1)+0x3) - aa4*(y-1);
-            tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3);
-        }
-        else
-        {
-            tt -= aa2*((y<<1)-0x3);
-            st -= aa4*(--y);
-        }
-        if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1);
-        drw = !drw;
-    }
-}
-
-
-
-
-
-function mkRect(x, y, w, h)
-{
-    var s = this.stroke;
-    this.mkDiv(x, y, w, s);
-    this.mkDiv(x+w, y, s, h);
-    this.mkDiv(x, y+h, w+s, s);
-    this.mkDiv(x, y+s, s, h-s);
-}
-
-
-
-
-
-function mkRectDott(x, y, w, h)
-{
-    this.drawLine(x, y, x+w, y);
-    this.drawLine(x+w, y, x+w, y+h);
-    this.drawLine(x, y+h, x+w, y+h);
-    this.drawLine(x, y, x, y+h);
-}
-
-
-
-
-
-function jsgFont()
-{
-    this.PLAIN = 'font-weight:normal;';
-    this.BOLD = 'font-weight:bold;';
-    this.ITALIC = 'font-style:italic;';
-    this.ITALIC_BOLD = this.ITALIC + this.BOLD;
-    this.BOLD_ITALIC = this.ITALIC_BOLD;
-}
-var Font = new jsgFont();
-
-
-
-
-
-function jsgStroke()
-{
-    this.DOTTED = -1;
-}
-var Stroke = new jsgStroke();
-
-
-
-
-
-function jsGraphics(id, wnd)
-{
-    this.setColor = new Function('arg', 'this.color = arg;');
-
-
-    this.getColor = new Function('return this.color');
-
-    this.setStroke = function(x)
-    {
-        this.stroke = x;
-        if (!(x+1))
-        {
-            this.drawLine = mkLinDott;
-            this.mkOv = mkOvDott;
-            this.drawRect = mkRectDott;
-        }
-        else if (x-1 > 0)
-        {
-            this.drawLine = mkLin2D;
-            this.mkOv = mkOv2D;
-            this.drawRect = mkRect;
-        }
-        else
-        {
-            this.drawLine = mkLin;
-            this.mkOv = mkOv;
-            this.drawRect = mkRect;
-        }
-    };
-
-
-
-    this.setPrintable = function(arg)
-    {
-        this.printable = arg;
-        this.mkDiv = jg_n4? mkLyr : arg? mkDivPrint : mkDiv;
-    };
-
-
-
-    this.setFont = function(fam, sz, sty)
-    {
-        this.ftFam = fam;
-        this.ftSz = sz;
-        this.ftSty = sty || Font.PLAIN;
-    };
-
-
-
-    this.drawPolyline = this.drawPolyLine = function(x, y, s)
-    {
-        var i = x.length-1; while (i >= 0)
-            this.drawLine(x[i], y[i], x[--i], y[i]);
-    };
-
-
-
-    this.fillRect = function(x, y, w, h)
-    {
-        this.mkDiv(x, y, w, h);
-    };
-
-
-    this.fillRectPattern = function(x, y, w, h, url)
-    {
-        this.htm += '<div style="position:absolute;'+
-            'left:' + x + 'px;'+
-            'top:' + y + 'px;'+
-            'width:' + w + 'px;'+
-            'height:' + h + 'px;'+
-            'clip:rect(0,'+w+'px,'+h+'px,0);'+
-            'overflow:hidden;'+
-            //'background-color:' + this.color + ';'+
-            "background-image: url('" + url + "');"+
-            "layer-background-image: url('" + url + "');"+
-            'z-index:100;"><\/div>';
-        //alert(this.htm);
-    }
-
-    this.drawHandle = function(x, y, w, h, cursor)
-    {
-        
-        this.htm += '<div style="position:absolute;'+
-        'left:' + x + 'px;'+
-        'top:' + y + 'px;'+
-        'width:' + w + 'px;'+
-        'height:' + h + 'px;'+
-        'clip:rect(0,'+w+'px,'+h+'px,0);'+
-        'padding: 2px;overflow:hidden;'+
-        "cursor: '" + cursor + "';"+
-        '" class="handleBox" id="' + cursor + '" ><\/div>';
-    }
-
-    this.drawHandleBox = function(x, y, w, h, cursor)
-    {
-        
-        this.htm += '<div style="position:absolute;'+
-        'left:' + x + 'px;'+
-        'top:' + y + 'px;'+
-        'width:' + w + 'px;'+
-        'height:' + h + 'px;'+
-        'clip:rect(0,'+(w+2)+'px,'+(h+2)+'px,0);'+
-        'overflow:hidden; border: solid 1px '+ this.color+';'+
-        "cursor: '" + cursor + "';"+
-        '" class="handleBox" id="' + cursor + '" ><\/div>';
-
-        
-    }
-
-    this.drawPolygon = function(x, y)
-    {
-        this.drawPolyline(x, y);
-        this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);
-    };
-
-
-
-    this.drawEllipse = this.drawOval = function(x, y, w, h)
-    {
-        this.mkOv(x, y, w, h);
-    };
-
-
-
-    this.fillEllipse = this.fillOval = function(left, top, w, h)
-    {
-        var a = (w -= 1)>>1, b = (h -= 1)>>1,
-        wod = (w&1)+1, hod = (h&1)+1,
-        cx = left+a, cy = top+b,
-        x = 0, y = b,
-        ox = 0, oy = b,
-        aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
-        st = (aa2>>1)*(1-(b<<1)) + bb,
-        tt = (bb>>1) - aa2*((b<<1)-1),
-        pxl, dw, dh;
-        if (w+1) while (y > 0)
-        {
-            if (st < 0)
-            {
-                st += bb*((x<<1)+0x3);
-                tt += (bb<<1)*(++x);
-            }
-            else if (tt < 0)
-            {
-                st += bb*((x<<1)+0x3) - aa4*(y-1);
-                pxl = cx-x;
-                dw = (x<<1)+wod;
-                tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-0x3);
-                dh = oy-y;
-                this.mkDiv(pxl, cy-oy, dw, dh);
-                this.mkDiv(pxl, cy+oy-dh+hod, dw, dh);
-                ox = x;
-                oy = y;
-            }
-            else
-            {
-                tt -= aa2*((y<<1)-0x3);
-                st -= aa4*(--y);
-            }
-        }
-        this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod);
-    };
-
-
-
-    this.drawString = mkLbl;
-
-
-
-    this.clear = function()
-    {
-        this.htm = "";
-        if (this.cnv) this.cnv.innerHTML = this.defhtm;
-        
-    };
-
-
-
-    this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h)
-    {
-        this.mkDiv(xr+cx, yt+cy, w, h);
-        this.mkDiv(xr+cx, yb+cy, w, h);
-        this.mkDiv(xl+cx, yb+cy, w, h);
-        this.mkDiv(xl+cx, yt+cy, w, h);
-    };
-
-
-    this.setStroke(1);
-    this.setPrintable(false);
-    this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN);
-    this.color = '#000000';
-    this.htm = '';
-    this.wnd = wnd || window;
-
-
-    if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM();
-    if (typeof id != 'string' || !id) this.paint = pntDoc;
-    else
-    {
-        this.cnv = document.all? (this.wnd.document.all[id] || null)
-            : document.getElementById? (this.wnd.document.getElementById(id) || null)
-            : null;
-        this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : '';
-        this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv;
-    }
-}
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/Files.php 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/Files.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/Files.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/Files.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,215 +0,0 @@
-<?
-/**
- * File Utilities.
- * @author $Author: e107coders $
- * @version $Id: Files.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-define('FILE_ERROR_NO_SOURCE', 100);
-define('FILE_ERROR_COPY_FAILED', 101);
-define('FILE_ERROR_DST_DIR_FAILED', 102);
-define('FILE_COPY_OK', 103);
-
-/**
- * File Utilities
- * @author $Author: e107coders $
- * @version $Id: Files.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- * @subpackage files
- */
-class Files 
-{
-	
-	/**
-	 * Copy a file from source to destination. If unique == true, then if
-	 * the destination exists, it will be renamed by appending an increamenting 
-	 * counting number.
-	 * @param string $source where the file is from, full path to the files required
-	 * @param string $destination_file name of the new file, just the filename
-	 * @param string $destination_dir where the files, just the destination dir,
-	 * e.g., /www/html/gallery/
-	 * @param boolean $unique create unique destination file if true.
-	 * @return string the new copied filename, else error if anything goes bad.
-	 */
-	function copyFile($source, $destination_dir, $destination_file, $unique=true) 
-	{
-		if(!(file_exists($source) && is_file($source))) 
-			return FILE_ERROR_NO_SOURCE;
-
-		$destination_dir = Files::fixPath($destination_dir);
-
-		if(!is_dir($destination_dir)) 
-			Return FILE_ERROR_DST_DIR_FAILED;
-
-		$filename = Files::escape($destination_file);
-
-		if($unique) 
-		{
-			$dotIndex = strrpos($destination_file, '.');
-			$ext = '';
-			if(is_int($dotIndex)) 
-			{
-				$ext = substr($destination_file, $dotIndex);
-				$base = substr($destination_file, 0, $dotIndex);
-			}
-			$counter = 0;
-			while(is_file($destination_dir.$filename)) 
-			{
-				$counter++;
-				$filename = $base.'_'.$counter.$ext;
-			}
-		}
-
-		if (!copy($source, $destination_dir.$filename))
-			return FILE_ERROR_COPY_FAILED;
-		
-		//verify that it copied, new file must exists
-		if (is_file($destination_dir.$filename))
-			Return $filename;
-		else
-			return FILE_ERROR_COPY_FAILED;
-	}
-
-	/**
-	 * Create a new folder.
-	 * @param string $newFolder specifiy the full path of the new folder.
-	 * @return boolean true if the new folder is created, false otherwise.
-	 */
-	function createFolder($newFolder) 
-	{
-		mkdir ($newFolder, 0777);
-		return chmod($newFolder, 0777);
-	}
-
-
-	/**
-	 * Escape the filenames, any non-word characters will be
-	 * replaced by an underscore.
-	 * @param string $filename the orginal filename
-	 * @return string the escaped safe filename
-	 */
-	function escape($filename) 
-	{
-		Return preg_replace('/[^\w\._]/', '_', $filename);
-	}
-
-	/**
-	 * Delete a file.
-	 * @param string $file file to be deleted
-	 * @return boolean true if deleted, false otherwise.
-	 */
-	function delFile($file) 
-	{
-		if(is_file($file)) 
-			Return unlink($file);
-		else
-			Return false;
-	}
-
-	/**
-	 * Delete folder(s), can delete recursively.
-	 * @param string $folder the folder to be deleted.
-	 * @param boolean $recursive if true, all files and sub-directories
-	 * are delete. If false, tries to delete the folder, can throw
-	 * error if the directory is not empty.
-	 * @return boolean true if deleted.
-	 */
-	function delFolder($folder, $recursive=false) 
-	{
-		$deleted = true;
-		if($recursive) 
-		{
-			$d = dir($folder);
-			while (false !== ($entry = $d->read())) 
-			{
-				if ($entry != '.' && $entry != '..')
-				{
-					$obj = Files::fixPath($folder).$entry;
-					//var_dump($obj);
-					if (is_file($obj))
-					{
-						$deleted &= Files::delFile($obj);					
-					}
-					else if(is_dir($obj))
-					{
-						$deleted &= Files::delFolder($obj, $recursive);
-					}
-					
-				}
-			}
-			$d->close();
-
-		}
-
-		//$folder= $folder.'/thumbs';
-		//var_dump($folder);
-		if(is_dir($folder)) 
-			$deleted &= rmdir($folder);
-		else
-			$deleted &= false;
-
-		Return $deleted;
-	}
-
-	/**
-	 * Append a / to the path if required.
-	 * @param string $path the path
-	 * @return string path with trailing /
-	 */
-	function fixPath($path) 
-	{
-		//append a slash to the path if it doesn't exists.
-		if(!(substr($path,-1) == '/'))
-			$path .= '/';
-		Return $path;
-	}
-
-	/**
-	 * Concat two paths together. Basically $pathA+$pathB
-	 * @param string $pathA path one
-	 * @param string $pathB path two
-	 * @return string a trailing slash combinded path.
-	 */
-	function makePath($pathA, $pathB) 
-	{
-		$pathA = Files::fixPath($pathA);
-		if(substr($pathB,0,1)=='/')
-			$pathB = substr($pathB,1);
-		Return Files::fixPath($pathA.$pathB);
-	}
-
-	/**
-	 * Similar to makePath, but the second parameter
-	 * is not only a path, it may contain say a file ending.
-	 * @param string $pathA the leading path
-	 * @param string $pathB the ending path with file
-	 * @return string combined file path.
-	 */
-	function makeFile($pathA, $pathB) 
-	{		
-		$pathA = Files::fixPath($pathA);
-		if(substr($pathB,0,1)=='/')
-			$pathB = substr($pathB,1);
-		
-		Return $pathA.$pathB;
-	}
-
-	
-	/**
-	 * Format the file size, limits to Mb.
-	 * @param int $size the raw filesize
-	 * @return string formated file size.
-	 */
-	function formatSize($size) 
-	{
-		if($size < 1024) 
-			return $size.' bytes';	
-		else if($size >= 1024 && $size < 1024*1024) 
-			return sprintf('%01.2f',$size/1024.0).' Kb';	
-		else
-			return sprintf('%01.2f',$size/(1024.0*1024)).' Mb';	
-	}
-}
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/GD.php 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/GD.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/GD.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/GD.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,503 +0,0 @@
-<?php
-/***********************************************************************
-** Title.........:  GD Driver
-** Version.......:  1.0
-** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
-** Filename......:  GD.php
-** Last changed..:  30 Aug 2003 
-** Notes.........:  Orginal is from PEAR
-**/
-// +----------------------------------------------------------------------+
-// | PHP Version 4                                                        |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2002 The PHP Group                                |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license,      |
-// | that is bundled with this package in the file LICENSE, and is        |
-// | available at through the world-wide-web at                           |
-// | http://www.php.net/license/2_02.txt.                                 |
-// | If you did not receive a copy of the PHP license and are unable to   |
-// | obtain it through the world-wide-web, please send a note to          |
-// | license@php.net so we can mail you a copy immediately.               |
-// +----------------------------------------------------------------------+
-// | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
-// |          Alan Knowles <alan@akbkhome.com>                            |
-// +----------------------------------------------------------------------+
-//
-//    Usage :
-//    $img    = new Image_Transform_GD();
-//    $angle  = -78;
-//    $img->load('magick.png');
-//
-//    if($img->rotate($angle,array('autoresize'=>true,'color_mask'=>array(255,0,0)))){
-//        $img->addText(array('text'=>"Rotation $angle",'x'=>0,'y'=>100,'font'=>'/usr/share/fonts/default/TrueType/cogb____.ttf'));
-//        $img->display();
-//    } else {
-//        echo "Error";
-//    }
-//
-//
-// $Id: GD.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
-//
-// Image Transformation interface using the GD library
-//
-
-require_once "Transform.php";
-
-Class Image_Transform_Driver_GD extends Image_Transform
-{
-    /**
-     * Holds the image file for manipulation
-     */
-    var $imageHandle = '';
-
-    /**
-     * Holds the original image file
-     */
-    var $old_image = '';
-
-    /**
-     * Check settings
-     *
-     * @return mixed true or  or a PEAR error object on error
-     *
-     * @see PEAR::isError()
-     */
-    function Image_Transform_GD()
-    {
-        return;
-    } // End function Image
-
-    /**
-     * Load image
-     *
-     * @param string filename
-     *
-     * @return mixed none or a PEAR error object on error
-     * @see PEAR::isError()
-     */
-    function load($image)
-    {
-        $this->uid = md5($_SERVER['REMOTE_ADDR']);
-        $this->image = $image;
-        $this->_get_image_details($image);
-        $functionName = 'ImageCreateFrom' . $this->type;
-		if(function_exists($functionName))
-		{
-			$this->imageHandle = $functionName($this->image);
-		}
-    } // End load
-
-    /**
-     * addText
-     *
-     * @param   array   options     Array contains options
-     *                              array(
-     *                                  'text'  The string to draw
-     *                                  'x'     Horizontal position
-     *                                  'y'     Vertical Position
-     *                                  'Color' Font color
-     *                                  'font'  Font to be used
-     *                                  'size'  Size of the fonts in pixel
-     *                                  'resize_first'  Tell if the image has to be resized
-     *                                                  before drawing the text
-     *                              )
-     *
-     * @return none
-     * @see PEAR::isError()
-     */
-    function addText($params)
-    {
-        $default_params = array(
-                                'text' => 'This is Text',
-                                'x' => 10,
-                                'y' => 20,
-                                'color' => array(255,0,0),
-                                'font' => 'Arial.ttf',
-                                'size' => '12',
-                                'angle' => 0,
-                                'resize_first' => false // Carry out the scaling of the image before annotation?  Not used for GD
-                                );
-        $params = array_merge($default_params, $params);
-        extract($params);
-
-        if( !is_array($color) ){
-            if ($color[0]=='#'){
-                $this->colorhex2colorarray( $color );
-            } else {
-                include_once('Image/Transform/Driver/ColorsDefs.php');
-                $color = isset($colornames[$color])?$colornames[$color]:false;
-            }
-        }
-
-        $c = imagecolorresolve ($this->imageHandle, $color[0], $color[1], $color[2]);
-
-        if ('ttf' == substr($font, -3)) {
-            ImageTTFText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text);
-        } else {
-            ImagePSText($this->imageHandle, $size, $angle, $x, $y, $c, $font, $text);
-        }
-        return true;
-    } // End addText
-
-
-    /**
-     * Rotate image by the given angle
-     * Uses a fast rotation algorythm for custom angles
-     * or lines copy for multiple of 90 degrees
-     *
-     * @param int       $angle      Rotation angle
-     * @param array     $options    array(  'autoresize'=>true|false,
-     *                                      'color_mask'=>array(r,g,b), named color or #rrggbb
-     *                                   )
-     * @author Pierre-Alain Joye
-     * @return mixed none or a PEAR error object on error
-     * @see PEAR::isError()
-     */
-    function rotate($angle, $options=null)
-    {
-        if(function_exists('imagerotate')) {
-            $white = imagecolorallocate ($this->imageHandle, 255, 255, 255);
-			$this->imageHandle = imagerotate($this->imageHandle, $angle, $white);
-            return true;
-        }
-
-        if ( $options==null ){
-            $autoresize = true;
-            $color_mask = array(255,255,0);
-        } else {
-            extract( $options );
-        }
-
-        while ($angle <= -45) {
-            $angle  += 360;
-        }
-        while ($angle > 270) {
-            $angle  -= 360;
-        }
-
-        $t      = deg2rad($angle);
-
-        if( !is_array($color_mask) ){
-            if ($color[0]=='#'){
-                $this->colorhex2colorarray( $color_mask );
-            } else {
-                include_once('Image/Transform/Driver/ColorDefs.php');
-                $color = isset($colornames[$color_mask])?$colornames[$color_mask]:false;
-            }
-        }
-
-        // Do not round it, too much lost of quality
-        $cosT   = cos($t);
-        $sinT   = sin($t);
-
-        $img    =& $this->imageHandle;
-
-        $width  = $max_x  = $this->img_x;
-        $height = $max_y  = $this->img_y;
-        $min_y  = 0;
-        $min_x  = 0;
-
-        $x1     = round($max_x/2,0);
-        $y1     = round($max_y/2,0);
-
-        if ( $autoresize ){
-            $t      = abs($t);
-            $a      = round($angle,0);
-            switch((int)($angle)){
-                case 0:
-                        $width2     = $width;
-                        $height2    = $height;
-                    break;
-                case 90:
-                        $width2     = $height;
-                        $height2    = $width;
-                    break;
-                case 180:
-                        $width2     = $width;
-                        $height2    = $height;
-                    break;
-                case 270:
-                        $width2     = $height;
-                        $height2    = $width;
-                    break;
-                default:
-                    $width2     = (int)(abs(sin($t) * $height + cos($t) * $width));
-                    $height2    = (int)(abs(cos($t) * $height+sin($t) * $width));
-            }
-
-            $width2     -= $width2%2;
-            $height2    -= $height2%2;
-
-            $d_width    = abs($width - $width2);
-            $d_height   = abs($height - $height2);
-            $x_offset   = $d_width/2;
-            $y_offset   = $d_height/2;
-            $min_x2     = -abs($x_offset);
-            $min_y2     = -abs($y_offset);
-            $max_x2     = $width2;
-            $max_y2     = $height2;
-        }
-
-        $img2   = @imagecreate($width2,$height2);
-
-        if ( !is_resource($img2) ){
-            return false;/*PEAR::raiseError('Cannot create buffer for the rotataion.',
-                                null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/
-        }
-
-        $this->img_x = $width2;
-        $this->img_y = $height2;
-
-
-        imagepalettecopy($img2,$img);
-
-        $mask   = imagecolorresolve($img2,$color_mask[0],$color_mask[1],$color_mask[2]);
-
-        // use simple lines copy for axes angles
-        switch((int)($angle)){
-            case 0:
-                imagefill ($img2, 0, 0,$mask);
-                for ($y=0; $y < $max_y; $y++) {
-                    for ($x = $min_x; $x < $max_x; $x++){
-                        $c  = @imagecolorat ( $img, $x, $y);
-                        imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c);
-                    }
-                }
-                break;
-            case 90:
-                imagefill ($img2, 0, 0,$mask);
-                for ($x = $min_x; $x < $max_x; $x++){
-                    for ($y=$min_y; $y < $max_y; $y++) {
-                        $c  = imagecolorat ( $img, $x, $y);
-                        imagesetpixel($img2,$max_y-$y-1,$x,$c);
-                    }
-                }
-                break;
-            case 180:
-                imagefill ($img2, 0, 0,$mask);
-                for ($y=0; $y < $max_y; $y++) {
-                    for ($x = $min_x; $x < $max_x; $x++){
-                        $c  = @imagecolorat ( $img, $x, $y);
-                        imagesetpixel($img2, $max_x2-$x-1, $max_y2-$y-1, $c);
-                    }
-                }
-                break;
-            case 270:
-                imagefill ($img2, 0, 0,$mask);
-                for ($y=0; $y < $max_y; $y++) {
-                    for ($x = $max_x; $x >= $min_x; $x--){
-                        $c  = @imagecolorat ( $img, $x, $y);
-                        imagesetpixel($img2,$y,$max_x-$x-1,$c);
-                    }
-                }
-                break;
-            // simple reverse rotation algo
-            default:
-                $i=0;
-                for ($y = $min_y2; $y < $max_y2; $y++){
-
-                    // Algebra :)
-                    $x2 = round((($min_x2-$x1) * $cosT) + (($y-$y1) * $sinT + $x1),0);
-                    $y2 = round((($y-$y1) * $cosT - ($min_x2-$x1) * $sinT + $y1),0);
-
-                    for ($x = $min_x2; $x < $max_x2; $x++){
-
-                        // Check if we are out of original bounces, if we are
-                        // use the default color mask
-                        if ( $x2>=0 && $x2<$max_x && $y2>=0 && $y2<$max_y ){
-                            $c  = imagecolorat ( $img, $x2, $y2);
-                        } else {
-                            $c  = $mask;
-                        }
-                        imagesetpixel($img2,$x+$x_offset,$y+$y_offset,$c);
-
-                        // round verboten!
-                        $x2  += $cosT;
-                        $y2  -= $sinT;
-                    }
-                }
-                break;
-        }
-        $this->old_image    = $this->imageHandle;
-        $this->imageHandle  =  $img2;
-        return true;
-    }
-
-
-   /**
-    * Resize Action
-    *
-    * For GD 2.01+ the new copyresampled function is used
-    * It uses a bicubic interpolation algorithm to get far
-    * better result.
-    *
-    * @param $new_x int  new width
-    * @param $new_y int  new height
-    *
-    * @return true on success or pear error
-    * @see PEAR::isError()
-    */
-    function _resize($new_x, $new_y) {
-        if ($this->resized === true) {
-            return false; /*PEAR::raiseError('You have already resized the image without saving it.  Your previous resizing will be overwritten', null, PEAR_ERROR_TRIGGER, E_USER_NOTICE);*/
-        }
-        if(function_exists('ImageCreateTrueColor')){
-            $new_img =ImageCreateTrueColor($new_x,$new_y);
-        } else {
-            $new_img =ImageCreate($new_x,$new_y);
-        }
-        if(function_exists('ImageCopyResampled')){
-            ImageCopyResampled($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
-        } else {
-            ImageCopyResized($new_img, $this->imageHandle, 0, 0, 0, 0, $new_x, $new_y, $this->img_x, $this->img_y);
-        }
-        $this->old_image = $this->imageHandle;
-        $this->imageHandle = $new_img;
-        $this->resized = true;
-
-        $this->new_x = $new_x;
-        $this->new_y = $new_y;
-        return true;
-    }
-
-    /**
-     * Crop the image
-     *
-     * @param int $crop_x left column of the image
-     * @param int $crop_y top row of the image
-     * @param int $crop_width new cropped image width
-     * @param int $crop_height new cropped image height
-     */
-    function crop($new_x, $new_y, $new_width, $new_height) 
-    {
-        if(function_exists('ImageCreateTrueColor')){
-            $new_img =ImageCreateTrueColor($new_width,$new_height);
-        } else {
-            $new_img =ImageCreate($new_width,$new_height);
-        }
-        if(function_exists('ImageCopyResampled')){
-            ImageCopyResampled($new_img, $this->imageHandle, 0, 0, $new_x, $new_y,$new_width,$new_height,$new_width,$new_height);
-        } else {
-            ImageCopyResized($new_img, $this->imageHandle, 0, 0, $new_x, $new_y, $new_width,$new_height,$new_width,$new_height);
-        }
-        $this->old_image = $this->imageHandle;
-        $this->imageHandle = $new_img;
-        $this->resized = true;
-
-        $this->new_x = $new_x;
-        $this->new_y = $new_y;
-        return true;
-    }
-   
-    /**
-     * Flip the image horizontally or vertically
-     *
-     * @param boolean $horizontal true if horizontal flip, vertical otherwise
-     */
-    function flip($horizontal)
-    {
-        if(!$horizontal) {
-            $this->rotate(180);
-        }
-
-        $width = imagesx($this->imageHandle); 
-        $height = imagesy($this->imageHandle); 
-
-        for ($j = 0; $j < $height; $j++) { 
-                $left = 0; 
-                $right = $width-1; 
-
-
-                while ($left < $right) { 
-                    //echo " j:".$j." l:".$left." r:".$right."\n<br>";
-                    $t = imagecolorat($this->imageHandle, $left, $j); 
-                    imagesetpixel($this->imageHandle, $left, $j, imagecolorat($this->imageHandle, $right, $j)); 
-                    imagesetpixel($this->imageHandle, $right, $j, $t); 
-                    $left++; $right--; 
-                } 
-            
-        }
-
-        return true;
-    }
-
-
-    /**
-     * Adjust the image gamma
-     *
-     * @param float $outputgamma
-     *
-     * @return none
-     */
-    function gamma($outputgamma=1.0) {
-        ImageGammaCorrect($this->imageHandle, 1.0, $outputgamma);
-    }
-
-    /**
-     * Save the image file
-     *
-     * @param $filename string  the name of the file to write to
-     * @param $quality  int     output DPI, default is 85
-     * @param $types    string  define the output format, default
-     *                          is the current used format
-     *
-     * @return none
-     */
-    function save($filename, $type = '', $quality = 85)
-    {
-		$type           = $type==''? $this->type : $type;
-		$functionName   = 'image' . $type;
-
-		if(function_exists($functionName))
-		{
-			$this->old_image = $this->imageHandle;
-			if($type=='jpeg')
-				$functionName($this->imageHandle, $filename, $quality);
-			else
-				$functionName($this->imageHandle, $filename);
-			$this->imageHandle = $this->old_image;
-			$this->resized = false;
-		}
-    } // End save
-
-
-    /**
-     * Display image without saving and lose changes
-     *
-     * @param string type (JPG,PNG...);
-     * @param int quality 75
-     *
-     * @return none
-     */
-    function display($type = '', $quality = 75)
-    {
-        if ($type != '') {
-            $this->type = $type;
-        }
-        $functionName = 'Image' . $this->type;
-		if(function_exists($functionName))
-		{
-			header('Content-type: image/' . strtolower($this->type));
-			$functionName($this->imageHandle, '', $quality);
-			$this->imageHandle = $this->old_image;
-			$this->resized = false;
-			ImageDestroy($this->old_image);
-			$this->free();
-		}
-    }
-
-    /**
-     * Destroy image handle
-     *
-     * @return none
-     */
-    function free()
-    {
-        if ($this->imageHandle){
-            ImageDestroy($this->imageHandle);
-        }
-    }
-
-} // End class ImageGD
-?>
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/ImageEditor.php 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/ImageEditor.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/ImageEditor.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/ImageEditor.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,446 +0,0 @@
-<?
-/**
- * Image Editor. Editing tools, crop, rotate, scale and save.
- * @author $Author: e107coders $
- * @version $Id: ImageEditor.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-require_once('Transform.php');
-
-/**
- * Handles the basic image editing capbabilities.
- * @author $Author: e107coders $
- * @version $Id: ImageEditor.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- * @subpackage Editor
- */
-class ImageEditor 
-{
-	/**
-	 * ImageManager instance.
-	 */
-	var $manager;
-
-	/**
-	 * user based on IP address
-	 */
-	var $_uid;
-
-	/**
-	 * tmp file storage time.
-	 */
-	var $lapse_time =900; //15 mins
-
-	var $filesaved = 0;
-
-	/**
-	 * Create a new ImageEditor instance. Editing requires a 
-	 * tmp file, which is saved in the current directory where the
-	 * image is edited. The tmp file is assigned by md5 hash of the
-	 * user IP address. This hashed is used as an ID for cleaning up
-	 * the tmp files. In addition, any tmp files older than the
-	 * the specified period will be deleted.
-	 * @param ImageManager $manager the image manager, we need this
-	 * for some file and path handling functions.
-	 */
-	function ImageEditor($manager) 
-	{
-		$this->manager = $manager;
-		$this->_uid = md5($_SERVER['REMOTE_ADDR']);
-	}
-	
-	/**
-	 * Did we save a file?
-	 * @return int 1 if the file was saved sucessfully, 
-	 * 0 no save operation, -1 file save error.
-	 */
-	function isFileSaved() 
-	{
-		Return $this->filesaved;
-	}
-
-	/**
-	 * Process the image, if not action, just display the image.
-	 * @return array with image information, empty array if not an image.
-	 * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"',
-	 * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code>
-	 */
-	function processImage() 
-	{
-		if(isset($_GET['img']))
-			$relative = rawurldecode($_GET['img']);
-		else
-			Return array();
-		
-		//$relative = '/Series2004NoteFront.jpg';
-
-		$imgURL = $this->manager->getFileURL($relative);
-		$fullpath = $this->manager->getFullPath($relative);
-		
-		$imgInfo = @getImageSize($fullpath);
-		if(!is_array($imgInfo))
-			Return array();
-
-		$action = $this->getAction();
-
-		if(!is_null($action))
-		{
-			$image = $this->processAction($action, $relative, $fullpath);
-		}
-		else
-		{
-			$image['src'] = $imgURL;
-			$image['dimensions'] = $imgInfo[3];
-			$image['file'] = $relative;
-			$image['fullpath'] = $fullpath;
-		}
-
-		Return $image;
-	}
-
-	/**
-	 * Process the actions, crop, scale(resize), rotate, flip, and save.
-	 * When ever an action is performed, the result is save into a
-	 * temporary image file, see createUnique on the filename specs.
-	 * It does not return the saved file, alway returning the tmp file.
-	 * @param string $action, should be 'crop', 'scale', 'rotate','flip', or 'save'
-	 * @param string $relative the relative image filename
-	 * @param string $fullpath the fullpath to the image file
-	 * @return array with image information
-	 * <code>array('src'=>'url of the image', 'dimensions'=>'width="xx" height="yy"',
-	 * 'file'=>'image file, relative', 'fullpath'=>'full path to the image');</code>
-	 */
-	function processAction($action, $relative, $fullpath) 
-	{
-		$params = '';
-		
-		if(isset($_GET['params']))
-			$params = $_GET['params'];
-
-		$values =  explode(',',$params,4);
-		$saveFile = $this->getSaveFileName($values[0]);
-
-		$img = Image_Transform::factory(IMAGE_CLASS);
-		$img->load($fullpath);
-
-		switch ($action) 
-		{
-			case 'crop':
-				$img->crop(intval($values[0]),intval($values[1]),
-							intval($values[2]),intval($values[3]));
-			break;
-			case 'scale':
-				$img->resize(intval($values[0]),intval($values[1]));
-				break;
-			case 'rotate':
-				$img->rotate(floatval($values[0]));
-				break;
-			case 'flip':
-				if ($values[0] == 'hoz')
-					$img->flip(true);
-				else if($values[0] == 'ver') 
-					$img->flip(false);
-				break;
-			case 'save':
-				if(!is_null($saveFile))
-				{
-					$quality = intval($values[1]);
-		            if($quality <0) $quality = 85;
-					$newSaveFile = $this->makeRelative($relative, $saveFile);
-					$newSaveFile = $this->getUniqueFilename($newSaveFile);
-					
-					//get unique filename just returns the filename, so
-					//we need to make the relative path once more.
-					$newSaveFile = $this->makeRelative($relative, $newSaveFile);
-					$newSaveFullpath = $this->manager->getFullPath($newSaveFile);
-					$img->save($newSaveFullpath, $values[0], $quality);
-					if(is_file($newSaveFullpath))
-						$this->filesaved = 1;
-					else
-						$this->filesaved = -1;
-				}
-				break;
-		}
-		
-		//create the tmp image file
-		$filename = $this->createUnique($fullpath);
-		$newRelative = $this->makeRelative($relative, $filename);
-		$newFullpath = $this->manager->getFullPath($newRelative);
-		$newURL = $this->manager->getFileURL($newRelative);
-		
-		//save the file.
-		$img->save($newFullpath);
-		$img->free();
-
-		//get the image information
-		$imgInfo = @getimagesize($newFullpath);
-
-		$image['src'] = $newURL;
-		$image['dimensions'] = $imgInfo[3];
-		$image['file'] = $newRelative;
-		$image['fullpath'] = $newFullpath;
-
-		Return $image;
-	
-	}
-
-	/**
-	 * Get the file name base on the save name
-	 * and the save type.
-	 * @param string $type image type, 'jpeg', 'png', or 'gif'
-	 * @return string the filename according to save type
-	 */
-	function getSaveFileName($type) 
-	{
-		if(!isset($_GET['file']))
-			Return null;
-
-		$filename = Files::escape(rawurldecode($_GET['file']));
-		$index = strrpos($filename,'.');
-		$base = substr($filename,0,$index);
-		$ext = strtolower(substr($filename,$index+1,strlen($filename)));
-
-		if($type == 'jpeg' && !($ext=='jpeg' || $ext=='jpg'))
-		{
-			Return $base.'.jpeg';
-		}
-		if($type=='png' && $ext != 'png')
-			Return $base.'.png';
-		if($type=='gif' && $ext != 'gif')
-			Return $base.'.gif';
-
-		Return $filename;
-	}
-
-	/**
-	 * Get the default save file name, used by editor.php.
-	 * @return string a suggestive filename, this should be unique
-	 */
-	function getDefaultSaveFile() 
-	{
-		if(isset($_GET['img']))
-			$relative = rawurldecode($_GET['img']);
-		else
-			Return null;
-
-		Return $this->getUniqueFilename($relative);
-	}
-
-	/**
-	 * Get a unique filename. If the file exists, the filename
-	 * base is appended with an increasing integer.
-	 * @param string $relative the relative filename to the base_dir
-	 * @return string a unique filename in the current path
-	 */
-	function getUniqueFilename($relative) 
-	{
-		$fullpath = $this->manager->getFullPath($relative);
-		
-		$pathinfo = pathinfo($fullpath);
-
-		$path = Files::fixPath($pathinfo['dirname']);
-		$file = Files::escape($pathinfo['basename']);
-		
-		$filename = $file;
-
-		$dotIndex = strrpos($file, '.');
-		$ext = '';
-
-		if(is_int($dotIndex)) 
-		{
-			$ext = substr($file, $dotIndex);
-			$base = substr($file, 0, $dotIndex);
-		}
-
-		$counter = 0;
-		while(is_file($path.$filename)) 
-		{
-			$counter++;
-			$filename = $base.'_'.$counter.$ext;
-		}
-		
-		Return $filename;
-		
-	}
-
-	/**
-	 * Specifiy the original relative path, a new filename
-	 * and return the new filename with relative path.
-	 * i.e. $pathA (-filename) + $file
-	 * @param string $pathA the relative file
-	 * @param string $file the new filename
-	 * @return string relative path with the new filename
-	 */
-	function makeRelative($pathA, $file) 
-	{
-		$index = strrpos($pathA,'/');
-		if(!is_int($index))
-			Return $file;
-
-		$path = substr($pathA, 0, $index);
-		Return Files::fixPath($path).$file;
-	}
-
-	/**
-	 * Get the action GET parameter
-	 * @return string action parameter
-	 */
-	function getAction() 
-	{
-		$action = null;
-		if(isset($_GET['action']))
-			$action = $_GET['action'];
-		Return $action;
-	}
-
-	/**
-	 * Generate a unique string based on md5(microtime()).
-	 * Well not so uniqe, as it is limited to 6 characters
-	 * @return string unique string.
-	 */
-    function uniqueStr()
-    {
-      return substr(md5(microtime()),0,6);
-    }
-
-	/**
-	 * Create unique tmp image file name.
-	 * The filename is based on the tmp file prefix
-	 * specified in config.inc.php plus 
-	 * the UID (basically a md5 of the remote IP)
-	 * and some random 6 character string.
-	 * This function also calls to clean up the tmp files.
-	 * @param string $file the fullpath to a file
-	 * @return string a unique filename for that path
-	 * NOTE: it only returns the filename, path no included.
-	 */
-	function createUnique($file) 
-	{
-		$pathinfo = pathinfo($file);
-		$path = Files::fixPath($pathinfo['dirname']);
-		$imgType = $this->getImageType($file);
-
-		$unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType;
-
-	   //make sure the the unique temp file does not exists
-        while (file_exists($path.$unique_str))
-        {
-            $unique_str = $this->manager->getTmpPrefix().$this->_uid.'_'.$this->uniqueStr().".".$imgType;
-        }
-
-		$this->cleanUp($path,$pathinfo['basename']);
-
-		Return $unique_str;
-	}
-
-	/**
-	 * Delete any tmp image files.
-	 * @param string $path the full path 
-	 * where the clean should take place.
-	 */
-	function cleanUp($path,$file) 
-	{
-		$path = Files::fixPath($path);
-
-		if(!is_dir($path))
-			Return false;
-
-		$d = @dir($path);
-		
-		$tmp = $this->manager->getTmpPrefix();
-		$tmpLen = strlen($tmp);
-
-		$prefix = $tmp.$this->_uid;
-		$len = strlen($prefix);
-
-		while (false !== ($entry = $d->read())) 
-		{
-			//echo $entry."<br>";
-			if(is_file($path.$entry) && $this->manager->isTmpFile($entry))
-			{
-				if(substr($entry,0,$len)==$prefix && $entry != $file)
-					Files::delFile($path.$entry);
-				else if(substr($entry,0,$tmpLen)==$tmp && $entry != $file)
-				{
-					if(filemtime($path.$entry)+$this->lapse_time < time())
-						Files::delFile($path.$entry);
-				}
-			}
-		}
-		$d->close();
-	}
-
-	/**
-	 * Get the image type base on an image file.
-	 * @param string $file the full path to the image file.
-	 * @return string of either 'gif', 'jpeg', 'png' or 'bmp'
-	 * otherwise it will return null.
-	 */
-	function getImageType($file) 
-	{
-		$imageInfo = @getImageSize($file);
-
-		if(!is_array($imageInfo))
-			Return null;
-
-		switch($imageInfo[2]) 
-		{
-			case 1:
-				Return 'gif';
-			case 2:
-				Return 'jpeg';
-			case 3:
-				Return 'png';
-			case 6:
-				Return 'bmp';
-		}
-
-		Return null;
-	}
-
-	/**
-	 * Check if the specified image can be edit by GD
-	 * mainly to check that GD can read and save GIFs
-	 * @return int 0 if it is not a GIF file, 1 is GIF is editable, -1 if not editable.
-	 */
-	function isGDEditable() 
-	{
-		if(isset($_GET['img']))
-			$relative = rawurldecode($_GET['img']);
-		else
-			Return 0;
-		if(IMAGE_CLASS != 'GD')
-			Return 0;
-
-		$fullpath = $this->manager->getFullPath($relative);
-
-		$type = $this->getImageType($fullpath);
-		if($type != 'gif')
-			Return 0;
-
-		if(function_exists('ImageCreateFrom'+$type)
-			&& function_exists('image'+$type))
-			Return 1;
-		else
-			Return -1;
-	}
-
-	/**
-	 * Check if GIF can be edit by GD.
-	 * @return int 0 if it is not using the GD library, 1 is GIF is editable, -1 if not editable.
-	 */
-	function isGDGIFAble() 
-	{
-		if(IMAGE_CLASS != 'GD')
-			Return 0;
-
-		if(function_exists('ImageCreateFromGif')
-			&& function_exists('imagegif'))
-			Return 1;
-		else
-			Return -1;
-	}
-}
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/ImageManager.php 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/ImageManager.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/ImageManager.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/ImageManager.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,617 +0,0 @@
-<?
-/**
- * ImageManager, list images, directories, and thumbnails.
- * @author $Author: e107coders $
- * @version $Id: ImageManager.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-require_once('Files.php');
-
-/**
- * ImageManager Class.
- * @author $Author: e107coders $
- * @version $Id: ImageManager.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- */
-class ImageManager 
-{
-	/**
-	 * Configuration array.
-	 */
-	var $config;
-
-	/**
-	 * Array of directory information.
-	 */
-	var $dirs;
-
-	/**
-	 * Constructor. Create a new Image Manager instance.
-	 * @param array $config configuration array, see config.inc.php
-	 */
-	function ImageManager($config) 
-	{
-		$this->config = $config;
-	}
-
-	/**
-	 * Get the base directory.
-	 * @return string base dir, see config.inc.php
-	 */
-	function getBaseDir() 
-	{
-		Return $this->config['base_dir'];
-	}
-
-	/**
-	 * Get the base URL.
-	 * @return string base url, see config.inc.php
-	 */
-	function getBaseURL() 
-	{
-		Return $this->config['base_url'];
-	}
-
-	function isValidBase()
-	{
-		return is_dir($this->getBaseDir());
-	}
-
-	/**
-	 * Get the tmp file prefix.
-     * @return string tmp file prefix.
-	 */
-	function getTmpPrefix() 
-	{
-		Return $this->config['tmp_prefix'];
-	}
-
-	/**
-	 * Get the sub directories in the base dir.
-	 * Each array element contain
-	 * the relative path (relative to the base dir) as key and the 
-	 * full path as value.
-	 * @return array of sub directries
-	 * <code>array('path name' => 'full directory path', ...)</code>
-	 */
-	function getDirs() 
-	{
-		if(is_null($this->dirs))
-		{
-			$dirs = $this->_dirs($this->getBaseDir(),'/');
-			ksort($dirs);
-			$this->dirs = $dirs;
-		}
-		return $this->dirs;
-	}
-
-	/**
-	 * Recursively travese the directories to get a list
-	 * of accessable directories.
-	 * @param string $base the full path to the current directory
-	 * @param string $path the relative path name
-	 * @return array of accessiable sub-directories
-	 * <code>array('path name' => 'full directory path', ...)</code>
-	 */
-	function _dirs($base, $path) 
-	{
-		$base = Files::fixPath($base);
-		$dirs = array();
-
-		if($this->isValidBase() == false)
-			return $dirs;
-
-		$d = @dir($base);
-		
-		while (false !== ($entry = $d->read())) 
-		{
-			//If it is a directory, and it doesn't start with
-			// a dot, and if is it not the thumbnail directory
-			if(is_dir($base.$entry) 
-				&& substr($entry,0,1) != '.'
-				&& $this->isThumbDir($entry) == false) 
-			{
-				$relative = Files::fixPath($path.$entry);
-				$fullpath = Files::fixPath($base.$entry);
-				$dirs[$relative] = $fullpath;
-				$dirs = array_merge($dirs, $this->_dirs($fullpath, $relative));
-			}
-		}
-		$d->close();
-
-		Return $dirs;
-	}
-
-	/**
-	 * Get all the files and directories of a relative path.
-	 * @param string $path relative path to be base path.
-	 * @return array of file and path information.
-	 * <code>array(0=>array('relative'=>'fullpath',...), 1=>array('filename'=>fileinfo array(),...)</code>
-	 * fileinfo array: <code>array('url'=>'full url', 
-	 *                       'relative'=>'relative to base', 
-	 *                        'fullpath'=>'full file path', 
-	 *                        'image'=>imageInfo array() false if not image,
-	 *                        'stat' => filestat)</code>
-	 */
-	function getFiles($path) 
-	{
-		$files = array();
-		$dirs = array();
-
-		if($this->isValidBase() == false)
-			return array($files,$dirs);
-
-		$path = Files::fixPath($path);
-		$base = Files::fixPath($this->getBaseDir());
-		$fullpath = Files::makePath($base,$path);
-
-
-		$d = @dir($fullpath);
-		
-		while (false !== ($entry = $d->read())) 
-		{
-			//not a dot file or directory
-			if(substr($entry,0,1) != '.')
-			{
-				if(is_dir($fullpath.$entry)
-					&& $this->isThumbDir($entry) == false)
-				{
-					$relative = Files::fixPath($path.$entry);
-					$full = Files::fixPath($fullpath.$entry);
-					$count = $this->countFiles($full);
-					$dirs[$relative] = array('fullpath'=>$full,'entry'=>$entry,'count'=>$count);
-				}
-				else if(is_file($fullpath.$entry) && $this->isThumb($entry)==false && $this->isTmpFile($entry) == false) 
-				{
-					$img = $this->getImageInfo($fullpath.$entry);
-
-					if(!(!is_array($img)&&$this->config['validate_images']))
-					{
-						$file['url'] = Files::makePath($this->config['base_url'],$path).$entry;
-						$file['relative'] = $path.$entry;
-						$file['fullpath'] = $fullpath.$entry;
-						$file['image'] = $img;
-						$file['stat'] = stat($fullpath.$entry);
-						$files[$entry] = $file;
-					}
-				}
-			}
-		}
-		$d->close();
-		ksort($dirs);
-		ksort($files);
-		
-		Return array($dirs, $files);
-	}	
-
-	/**
-	 * Count the number of files and directories in a given folder
-	 * minus the thumbnail folders and thumbnails.
-	 */
-	function countFiles($path) 
-	{
-		$total = 0;
-
-		if(is_dir($path)) 
-		{
-			$d = @dir($path);
-
-			while (false !== ($entry = $d->read())) 
-			{
-				//echo $entry."<br>";
-				if(substr($entry,0,1) != '.'
-					&& $this->isThumbDir($entry) == false
-					&& $this->isTmpFile($entry) == false
-					&& $this->isThumb($entry) == false) 
-				{
-					$total++;
-				}
-			}
-			$d->close();
-		}
-		return $total;
-	}
-
-	/**
-	 * Get image size information.
-	 * @param string $file the image file
-	 * @return array of getImageSize information, 
-	 *  false if the file is not an image.
-	 */
-	function getImageInfo($file) 
-	{
-		Return @getImageSize($file);
-	}
-
-	/**
-	 * Check if the file contains the thumbnail prefix.
-	 * @param string $file filename to be checked
-	 * @return true if the file contains the thumbnail prefix, false otherwise.
-	 */
-	function isThumb($file) 
-	{
-		$len = strlen($this->config['thumbnail_prefix']);
-		if(substr($file,0,$len)==$this->config['thumbnail_prefix'])
-			Return true;
-		else
-			Return false;
-	}
-
-	/**
-	 * Check if the given directory is a thumbnail directory.
-	 * @param string $entry directory name
-	 * @return true if it is a thumbnail directory, false otherwise
-	 */
-	function isThumbDir($entry) 
-	{
-		if($this->config['thumbnail_dir'] == false
-			|| strlen(trim($this->config['thumbnail_dir'])) == 0)
-			Return false;		
-		else
-			Return ($entry == $this->config['thumbnail_dir']);
-	}
-
-	/**
-	 * Check if the given file is a tmp file.
-	 * @param string $file file name
-	 * @return boolean true if it is a tmp file, false otherwise
-	 */
-	function isTmpFile($file) 
-	{
-		$len = strlen($this->config['tmp_prefix']);
-		if(substr($file,0,$len)==$this->config['tmp_prefix'])
-			Return true;
-		else
-			Return false;	 	
-	}
-
-	/**
-	 * For a given image file, get the respective thumbnail filename
-	 * no file existence check is done.
-	 * @param string $fullpathfile the full path to the image file
-	 * @return string of the thumbnail file
-	 */
-	function getThumbName($fullpathfile) 
-	{
-		$path_parts = pathinfo($fullpathfile);
-		
-		$thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
-
-		if($this->config['safe_mode'] == true
-			|| strlen(trim($this->config['thumbnail_dir'])) == 0)
-		{
-			Return Files::makeFile($path_parts['dirname'],$thumbnail);
-		}
-		else
-		{
-			if(strlen(trim($this->config['thumbnail_dir'])) > 0)
-			{
-				$path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']);
-				if(!is_dir($path))
-					Files::createFolder($path);
-				Return Files::makeFile($path,$thumbnail);
-			}
-			else //should this ever happen?
-			{
-				//error_log('ImageManager: Error in creating thumbnail name');
-			}
-		}
-	}
-	
-	/**
-	 * Similar to getThumbName, but returns the URL, base on the
-	 * given base_url in config.inc.php
-	 * @param string $relative the relative image file name, 
-	 * relative to the base_dir path
-	 * @return string the url of the thumbnail
-	 */
-	function getThumbURL($relative) 
-	{
-		$path_parts = pathinfo($relative);
-		$thumbnail = $this->config['thumbnail_prefix'].$path_parts['basename'];
-		if($path_parts['dirname']=='\\') $path_parts['dirname']='/';
-
-		if($this->config['safe_mode'] == true
-			|| strlen(trim($this->config['thumbnail_dir'])) == 0)
-		{
-			Return Files::makeFile($this->getBaseURL(),$thumbnail);
-		}
-		else
-		{
-			if(strlen(trim($this->config['thumbnail_dir'])) > 0)
-			{
-				$path = Files::makePath($path_parts['dirname'],$this->config['thumbnail_dir']);
-				$url_path = Files::makePath($this->getBaseURL(), $path);
-				Return Files::makeFile($url_path,$thumbnail);
-			}
-			else //should this ever happen?
-			{
-				//error_log('ImageManager: Error in creating thumbnail url');
-			}
-
-		}
-	}
-
-	/**
-	 * Check if the given path is part of the subdirectories
-	 * under the base_dir.
-	 * @param string $path the relative path to be checked
-	 * @return boolean true if the path exists, false otherwise
-	 */
-	function validRelativePath($path) 
-	{
-		$dirs = $this->getDirs();
-		if($path == '/')
-			Return true;
-		//check the path given in the url against the 
-		//list of paths in the system.
-		for($i = 0; $i < count($dirs); $i++)
-		{
-			$key = key($dirs);
-			//we found the path
-			if($key == $path)
-				Return true;
-		
-			next($dirs);
-		}		
-		Return false;
-	}
-
-	/**
-	 * Process uploaded files, assumes the file is in 
-	 * $_FILES['upload'] and $_POST['dir'] is set.
-	 * The dir must be relative to the base_dir and exists.
-	 * If 'validate_images' is set to true, only file with
-	 * image dimensions will be accepted.
-	 * @return null
-	 */
-	function processUploads() 
-	{
-		if($this->isValidBase() == false)
-			return;
-
-		$relative = null;
-
-		if(isset($_POST['dir'])) 
-			$relative = rawurldecode($_POST['dir']);
-		else
-			return;
-
-		//check for the file, and must have valid relative path
-		if(isset($_FILES['upload']) && $this->validRelativePath($relative))
-		{
-			$this->_processFiles($relative, $_FILES['upload']);
-		}
-	}
-
-	/**
-	 * Process upload files. The file must be an 
-	 * uploaded file. If 'validate_images' is set to
-	 * true, only images will be processed. Any duplicate
-	 * file will be renamed. See Files::copyFile for details
-	 * on renaming.
-	 * @param string $relative the relative path where the file
-	 * should be copied to.
-	 * @param array $file the uploaded file from $_FILES
-	 * @return boolean true if the file was processed successfully, 
-	 * false otherwise
-	 */
-	function _processFiles($relative, $file)
-	{
-		
-		if($file['error']!=0)
-		{
-			Return false;
-		}
-
-		if(!is_file($file['tmp_name']))
-		{
-			Return false;
-		}
-
-		if(!is_uploaded_file($file['tmp_name']))
-		{
-			Files::delFile($file['tmp_name']);
-			Return false;
-		}
-		
-
-		if($this->config['validate_images'] == true)
-		{
-			$imgInfo = @getImageSize($file['tmp_name']);
-			if(!is_array($imgInfo))
-			{
-				Files::delFile($file['tmp_name']);
-				Return false;
-			}
-		}
-
-		//now copy the file
-		$path = Files::makePath($this->getBaseDir(),$relative);
-		$result = Files::copyFile($file['tmp_name'], $path, $file['name']);
-
-		//no copy error
-		if(!is_int($result))
-		{
-			Files::delFile($file['tmp_name']);
-			Return true;
-		}
-
-		//delete tmp files.
-		Files::delFile($file['tmp_name']);
-		Return false;
-	}
-
-	/**
-	 * Get the URL of the relative file.
-	 * basically appends the relative file to the 
-	 * base_url given in config.inc.php
-	 * @param string $relative a file the relative to the base_dir
-	 * @return string the URL of the relative file.
-	 */
-	function getFileURL($relative) 
-	{
-		Return Files::makeFile($this->getBaseURL(),$relative);
-	}
-
-	/**
-	 * Get the fullpath to a relative file.
-	 * @param string $relative the relative file.
-	 * @return string the full path, .ie. the base_dir + relative.
-	 */
-	function getFullPath($relative) 
-	{
-		Return Files::makeFile($this->getBaseDir(),$relative);;
-	}
-
-	/**
-	 * Get the default thumbnail.
-	 * @return string default thumbnail, empty string if 
-	 * the thumbnail doesn't exist.
-	 */
-	function getDefaultThumb() 
-	{
-		if(is_file($this->config['default_thumbnail']))
-			Return $this->config['default_thumbnail'];
-		else 
-			Return '';
-	}
-
-
-	/**
-	 * Get the thumbnail url to be displayed. 
-	 * If the thumbnail exists, and it is up-to-date
-	 * the thumbnail url will be returns. If the 
-	 * file is not an image, a default image will be returned.
-	 * If it is an image file, and no thumbnail exists or 
-	 * the thumbnail is out-of-date (i.e. the thumbnail 
-	 * modified time is less than the original file)
-	 * then a thumbs.php?img=filename.jpg is returned.
-	 * The thumbs.php url will generate a new thumbnail
-	 * on the fly. If the image is less than the dimensions
-	 * of the thumbnails, the image will be display instead.
-	 * @param string $relative the relative image file.
-	 * @return string the url of the thumbnail, be it
-	 * actually thumbnail or a script to generate the
-	 * thumbnail on the fly.
-	 */
-	function getThumbnail($relative) 
-	{
-		$fullpath = Files::makeFile($this->getBaseDir(),$relative);
-
-		//not a file???
-		if(!is_file($fullpath))
-			Return $this->getDefaultThumb();
-
-		$imgInfo = @getImageSize($fullpath);
-		
-		//not an image
-		if(!is_array($imgInfo))
-			Return $this->getDefaultThumb();
-
-		//the original image is smaller than thumbnails,
-		//so just return the url to the original image.
-		if ($imgInfo[0] <= $this->config['thumbnail_width']
-		 && $imgInfo[1] <= $this->config['thumbnail_height'])
-			Return $this->getFileURL($relative);
-
-		$thumbnail = $this->getThumbName($fullpath);
-		
-		//check for thumbnails, if exists and
-		// it is up-to-date, return the thumbnail url
-		if(is_file($thumbnail))
-		{
-			if(filemtime($thumbnail) >= filemtime($fullpath))
-				Return $this->getThumbURL($relative);
-		}
-
-		//well, no thumbnail was found, so ask the thumbs.php
-		//to generate the thumbnail on the fly.
-		Return 'thumbs.php?img='.rawurlencode($relative);
-	}
-
-	/**
-	 * Delete and specified files.
-	 * @return boolean true if delete, false otherwise
-	 */
-	function deleteFiles() 
-	{
-		if(isset($_GET['delf']))
-			$this->_delFile(rawurldecode($_GET['delf']));
-	}
-
-	/**
-	 * Delete and specified directories.
-	 * @return boolean true if delete, false otherwise
-	 */
-	function deleteDirs() 
-	{
-		 if(isset($_GET['deld']))
-			return $this->_delDir(rawurldecode($_GET['deld']));		
-		 else
-			 Return false;
-	}
-
-	/**
-	 * Delete the relative file, and any thumbnails.
-	 * @param string $relative the relative file.
-	 * @return boolean true if deleted, false otherwise.
-	 */
-	function _delFile($relative) 
-	{
-		$fullpath = Files::makeFile($this->getBaseDir(),$relative);
-		
-		//check that the file is an image
-		if($this->config['validate_images'] == true)
-		{
-			if(!is_array($this->getImageInfo($fullpath)))
-				return false; //hmmm not an Image!!???
-		}
-
-		$thumbnail = $this->getThumbName($fullpath);
-
-		if(Files::delFile($fullpath))
-			Return Files::delFile($thumbnail);
-		else
-			Return false;
-	}
-
-	/**
-	 * Delete directories recursively.
-	 * @param string $relative the relative path to be deleted.
-	 * @return boolean true if deleted, false otherwise.
-	 */
-	function _delDir($relative) 
-	{
-		$fullpath = Files::makePath($this->getBaseDir(),$relative);
-		if($this->countFiles($fullpath) <= 0)
-			return Files::delFolder($fullpath,true); //delete recursively.
-		else
-			Return false;
-	}
-
-	/**
-	 * Create new directories.
-	 * If in safe_mode, nothing happens.
-	 * @return boolean true if created, false otherwise.
-	 */
-	function processNewDir() 
-	{
-		if($this->config['safe_mode'] == true)
-			Return false;
-
-		if(isset($_GET['newDir']) && isset($_GET['dir']))
-		{
-			$newDir = rawurldecode($_GET['newDir']);
-			$dir = rawurldecode($_GET['dir']);
-			$path = Files::makePath($this->getBaseDir(),$dir);
-			$fullpath = Files::makePath($path, Files::escape($newDir));
-			if(is_dir($fullpath))
-				Return false;
-
-			Return Files::createFolder($fullpath);
-		}
-	}
-}
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/IM.php 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/IM.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/IM.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/IM.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,235 +0,0 @@
-<?php
-
-/***********************************************************************
-** Title.........:  ImageMagick Driver
-** Version.......:  1.0
-** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
-** Filename......:  IM.php
-** Last changed..:  30 Aug 2003 
-** Notes.........:  Orginal is from PEAR
-**/
-
-// +----------------------------------------------------------------------+
-// | PHP Version 4                                                        |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2002 The PHP Group                                |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license,      |
-// | that is bundled with this package in the file LICENSE, and is        |
-// | available at through the world-wide-web at                           |
-// | http://www.php.net/license/2_02.txt.                                 |
-// | If you did not receive a copy of the PHP license and are unable to   |
-// | obtain it through the world-wide-web, please send a note to          |
-// | license@php.net so we can mail you a copy immediately.               |
-// +----------------------------------------------------------------------+
-// | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
-// +----------------------------------------------------------------------+
-//
-// $Id: IM.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
-//
-// Image Transformation interface using command line ImageMagick
-//
-
-require_once "Transform.php";
-
-Class Image_Transform_Driver_IM extends Image_Transform
-{
-    /**
-     * associative array commands to be executed
-     * @var array
-     */
-    var $command = array();
-
-    /**
-     *
-     *
-     */
-    function Image_Transform_Driver_IM()
-    {
-        return true;
-    } // End Image_IM
-
-    /**
-     * Load image
-     *
-     * @param string filename
-     *
-     * @return mixed none or a PEAR error object on error
-     * @see PEAR::isError()
-     */
-    function load($image)
-    {
-
-        $this->uid = md5($_SERVER['REMOTE_ADDR']);
-        /*if (!file_exists($image)) {
-            return PEAR::raiseError('The image file ' . $image . ' does\'t exist', true);
-        }*/
-        $this->image = $image;
-        $this->_get_image_details($image);
-    } // End load
-
-    /**
-     * Resize Action
-     *
-     * @param int   new_x   new width
-     * @param int   new_y   new height
-     *
-     * @return none
-     * @see PEAR::isError()
-     */
-    function _resize($new_x, $new_y)
-    {
-        /*if (isset($this->command['resize'])) {
-            return PEAR::raiseError("You cannot scale or resize an image more than once without calling save or display", true);
-        }*/
-        $this->command['resize'] = "-geometry ${new_x}x${new_y}!";
-
-        $this->new_x = $new_x;
-        $this->new_y = $new_y;
-    } // End resize
-
-    /**
-     * Crop the image
-     *
-     * @param int $crop_x left column of the image
-     * @param int $crop_y top row of the image
-     * @param int $crop_width new cropped image width
-     * @param int $crop_height new cropped image height
-     */
-    function crop($crop_x, $crop_y, $crop_width, $crop_height) 
-    {
-        $this->command['crop'] = "-crop {$crop_width}x{$crop_height}+{$crop_x}+{$crop_y}";
-    }
-
-    /**
-     * Flip the image horizontally or vertically
-     *
-     * @param boolean $horizontal true if horizontal flip, vertical otherwise
-     */
-    function flip($horizontal) 
-    {
-        if($horizontal)
-            $this->command['flop'] = "-flop";
-        else
-            $this->command['flip'] = "-flip";
-    }
-    /**
-     * rotate
-     *
-     * @param   int     angle   rotation angle
-     * @param   array   options no option allowed
-     *
-     */
-    function rotate($angle, $options=null)
-    {
-        if ('-' == $angle{0}) {
-            $angle = 360 - substr($angle, 1);
-        }
-         $this->command['rotate'] = "-rotate $angle";
-    } // End rotate
-
-    /**
-     * addText
-     *
-     * @param   array   options     Array contains options
-     *                              array(
-     *                                  'text'  The string to draw
-     *                                  'x'     Horizontal position
-     *                                  'y'     Vertical Position
-     *                                  'Color' Font color
-     *                                  'font'  Font to be used
-     *                                  'size'  Size of the fonts in pixel
-     *                                  'resize_first'  Tell if the image has to be resized
-     *                                                  before drawing the text
-     *                              )
-     *
-     * @return none
-     * @see PEAR::isError()
-     */
-    function addText($params)
-    {
-        $default_params = array(
-                                'text' => 'This is Text',
-                                'x' => 10,
-                                'y' => 20,
-                                'color' => 'red',
-                                'font' => 'Arial.ttf',
-                                'resize_first' => false // Carry out the scaling of the image before annotation?
-                                );
-         $params = array_merge($default_params, $params);
-         extract($params);
-         if (true === $resize_first) {
-             // Set the key so that this will be the last item in the array
-            $key = 'ztext';
-         } else {
-            $key = 'text';
-         }
-         $this->command[$key] = "-font $font -fill $color -draw 'text $x,$y \"$text\"'";
-         // Producing error: gs: not found gs: not found convert: Postscript delegate failed [No such file or directory].
-    } // End addText
-
-    /**
-     * Adjust the image gamma
-     *
-     * @param float $outputgamma
-     *
-     * @return none
-     */
-    function gamma($outputgamma=1.0) {
-        $this->command['gamma'] = "-gamma $outputgamma";
-    }
-
-    /**
-     * Save the image file
-     *
-     * @param $filename string  the name of the file to write to
-     * @param $quality  quality image dpi, default=75
-     * @param $type     string  (JPG,PNG...)
-     *
-     * @return none
-     */
-    function save($filename, $type='', $quality = 85)
-    {
-        $type == '' ? $this->type : $type;
-        $cmd = '' . IMAGE_TRANSFORM_LIB_PATH . 'convert ';
-		$cmd .= implode(' ', $this->command) . " -quality $quality ";
-		$cmd .= '"'.($this->image) . '" "' . ($filename) . '" 2>&1';
-        
-        //$cmd = str_replace('/', '\\', $cmd);
-		//echo($cmd.'<br>');
-        exec($cmd,$retval);
-		//error_log('IM '.print_r($retval,true));
-    } // End save
-
-    /**
-     * Display image without saving and lose changes
-     *
-     * @param string type (JPG,PNG...);
-     * @param int quality 75
-     *
-     * @return none
-     */
-    function display($type = '', $quality = 75)
-    {
-        if ($type == '') {
-            header('Content-type: image/' . $this->type);
-            passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality "  . escapeshellarg($this->image) . ' ' . strtoupper($this->type) . ":-");
-        } else {
-            header('Content-type: image/' . $type);
-            passthru(IMAGE_TRANSFORM_LIB_PATH . 'convert ' . implode(' ', $this->command) . " -quality $quality "  . escapeshellarg($this->image) . ' ' . strtoupper($type) . ":-");
-        }
-    }
-
-
-    /**
-     * Destroy image handle
-     *
-     * @return none
-     */
-    function free()
-    {
-        return true;
-    }
-
-} // End class ImageIM
-?>
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/NetPBM.php 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/NetPBM.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/NetPBM.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/NetPBM.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,257 +0,0 @@
-<?php
-/***********************************************************************
-** Title.........:  NetPBM Driver
-** Version.......:  1.0
-** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
-** Filename......:  NetPBM.php
-** Last changed..:  30 Aug 2003 
-** Notes.........:  Orginal is from PEAR
-**/
-
-// +----------------------------------------------------------------------+
-// | PHP Version 4                                                        |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2002 The PHP Group                                |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license,      |
-// | that is bundled with this package in the file LICENSE, and is        |
-// | available at through the world-wide-web at                           |
-// | http://www.php.net/license/2_02.txt.                                 |
-// | If you did not receive a copy of the PHP license and are unable to   |
-// | obtain it through the world-wide-web, please send a note to          |
-// | license@php.net so we can mail you a copy immediately.               |
-// +----------------------------------------------------------------------+
-// | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
-// +----------------------------------------------------------------------+
-//
-// $Id: NetPBM.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
-//
-// Image Transformation interface using command line NetPBM
-
-require_once "Transform.php";
-
-Class Image_Transform_Driver_NetPBM extends Image_Transform
-{
-
-    /**
-     * associative array commands to be executed
-     * @var array
-     */
-    var $command = array();
-
-    /**
-     * Class Constructor
-     */
-    function Image_Transform_Driver_NetPBM()
-    {
-        $this->uid = md5($_SERVER['REMOTE_ADDR']);
-            
-        return true;
-    } // End function Image_NetPBM
-
-    /**
-     * Load image
-     *
-     * @param string filename
-     *
-     * @return mixed none or a PEAR error object on error
-     * @see PEAR::isError()
-     */
-    function load($image)
-    {
-        //echo $image;
-        $this->image = $image;
-        $this->_get_image_details($image);
-    } // End load
-
-    /**
-     * Resizes the image
-     *
-     * @return none
-     * @see PEAR::isError()
-     */
-    function _resize($new_x, $new_y)
-    {
-        // there's no technical reason why resize can't be called multiple
-        // times...it's just silly to do so
-
-        $this->command[] = IMAGE_TRANSFORM_LIB_PATH .
-                           "pnmscale -width $new_x -height $new_y";
-
-        $this->_set_new_x($new_x);
-        $this->_set_new_y($new_y);
-    } // End resize
-
-    /**
-     * Crop the image
-     *
-     * @param int $crop_x left column of the image
-     * @param int $crop_y top row of the image
-     * @param int $crop_width new cropped image width
-     * @param int $crop_height new cropped image height
-     */
-    function crop($crop_x, $crop_y, $crop_width, $crop_height) 
-    {
-        $this->command[] = IMAGE_TRANSFORM_LIB_PATH .
-                            "pnmcut -left $crop_x -top $crop_y -width $crop_width -height $crop_height";
-    }
-
-    /**
-     * Rotates the image
-     *
-     * @param int $angle The angle to rotate the image through
-     */
-    function rotate($angle)
-    {
-        $angle = -1*floatval($angle);
-
-        if($angle > 90)
-        {   
-            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias 90";
-            $this->rotate(-1*($angle-90));
-        }
-        else if ($angle < -90)
-        {
-            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias -90";
-            $this->rotate(-1*($angle+90));
-        }
-        else
-            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmrotate -noantialias $angle";
-    } // End rotate
-
-    /**
-     * Flip the image horizontally or vertically
-     *
-     * @param boolean $horizontal true if horizontal flip, vertical otherwise
-     */
-    function flip($horizontal) 
-    {
-        if($horizontal) 
-            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmflip -lr";
-        else
-            $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmflip -tb";
-    }
-
-    /**
-     * Adjust the image gamma
-     *
-     * @param float $outputgamma
-     *
-     * @return none
-     */
-    function gamma($outputgamma = 1.0) {
-        $this->command[13] = IMAGE_TRANSFORM_LIB_PATH . "pnmgamma $outputgamma";
-    }
-
-    /**
-     * adds text to an image
-     *
-     * @param   array   options     Array contains options
-     *             array(
-     *                  'text'          // The string to draw
-     *                  'x'             // Horizontal position
-     *                  'y'             // Vertical Position
-     *                  'Color'         // Font color
-     *                  'font'          // Font to be used
-     *                  'size'          // Size of the fonts in pixel
-     *                  'resize_first'  // Tell if the image has to be resized
-     *                                  // before drawing the text
-     *                   )
-     *
-     * @return none
-     */
-    function addText($params)
-    {
-        $default_params = array('text' => 'This is Text',
-                                'x' => 10,
-                                'y' => 20,
-                                'color' => 'red',
-                                'font' => 'Arial.ttf',
-                                'size' => '12',
-                                'angle' => 0,
-                                'resize_first' => false);
-        // we ignore 'resize_first' since the more logical approach would be
-        // for the user to just call $this->_resize() _first_ ;)
-        extract(array_merge($default_params, $params));
-        $this->command[] = "ppmlabel -angle $angle -colour $color -size "
-                           ."$size -x $x -y ".$y+$size." -text \"$text\"";
-    } // End addText
-
-    function _postProcess($type, $quality, $save_type)
-    {
-        $type = is_null($type) || $type==''? $this->type : $type;
-        $save_type = is_null($save_type) || $save_type==''? $this->type : $save_type;
-        //echo "TYPE:". $this->type;
-        array_unshift($this->command, IMAGE_TRANSFORM_LIB_PATH
-                      . $type.'topnm '. $this->image);
-        $arg = '';
-        switch(strtolower($save_type)){
-            case 'gif':
-                $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmquant 256";
-                $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmto$save_type";
-                break;
-            case 'jpg':
-            case 'jpeg':
-                $arg = "--quality=$quality";
-                $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "ppmto$save_type $arg";
-                break;
-            default:
-                $this->command[] = IMAGE_TRANSFORM_LIB_PATH . "pnmto$save_type $arg";
-                break;
-        } // switch
-        return implode('|', $this->command);
-    } 
-
-    /**
-     * Save the image file
-     *
-     * @param $filename string the name of the file to write to
-     * @param string $type (jpeg,png...);
-     * @param int $quality 75
-     * @return none
-     */
-    function save($filename, $type=null, $quality = 85)
-    {
-        $cmd = $this->_postProcess('', $quality, $type) . ">$filename";
-            
-		//if we have windows server
-        if(isset($_ENV['OS']) && eregi('window',$_ENV['OS']))
-			$cmd = ereg_replace('/','\\',$cmd);
-        //echo $cmd."##";
-        $output = system($cmd);
-		error_log('NETPBM: '.$cmd);
-		//error_log($output);
-        $this->command = array();
-    } // End save
-
-
-    /**
-     * Display image without saving and lose changes
-     *
-     * @param string $type (jpeg,png...);
-     * @param int $quality 75
-     * @return none
-     */
-    function display($type = null, $quality = 75)
-    {
-        header('Content-type: image/' . $type);
-        $cmd = $this->_postProcess($type, $quality);
-        
-        passthru($cmd);
-        $this->command = array();
-    }
-
-    /**
-     * Destroy image handle
-     *
-     * @return none
-     */
-    function free()
-    {
-        // there is no image handle here
-        return true;
-    }
-
-
-} // End class NetPBM
-?>
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/Thumbnail.php 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/Thumbnail.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/Thumbnail.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/Thumbnail.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,125 +0,0 @@
-<?
-/**
- * Create thumbnails.
- * @author $Author: e107coders $
- * @version $Id: Thumbnail.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-
-require_once('Transform.php');
-
-/**
- * Thumbnail creation
- * @author $Author: e107coders $
- * @version $Id: Thumbnail.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- * @subpackage Images
- */
-class Thumbnail 
-{
-	/**
-	 * Graphics driver, GD, NetPBM or ImageMagick.
-	 */
-	var $driver;
-
-	/**
-	 * Thumbnail default width.
-	 */
-	var $width = 96;
-
-	/**
-	 * Thumbnail default height.
-	 */
-	var $height = 96;
-
-	/**
-	 * Thumbnail default JPEG quality.
-	 */
-	var $quality = 85;
-
-	/**
-	 * Thumbnail is proportional
-	 */
-	var $proportional = true;
-
-	/**
-	 * Default image type is JPEG.
-	 */
-	var $type = 'jpeg';
-
-	/**
-	 * Create a new Thumbnail instance.
-	 * @param int $width thumbnail width
-	 * @param int $height thumbnail height
-	 */
-	function Thumbnail($width=96, $height=96) 
-	{
-		$this->driver = Image_Transform::factory(IMAGE_CLASS);
-		$this->width = $width;
-		$this->height = $height;
-	}
-
-	/**
-	 * Create a thumbnail.
-	 * @param string $file the image for the thumbnail
-	 * @param string $thumbnail if not null, the thumbnail will be saved
-	 * as this parameter value.
-	 * @return boolean true if thumbnail is created, false otherwise
-	 */
-	function createThumbnail($file, $thumbnail=null) 
-	{
-		if(!is_file($file)) 
-			Return false;
-
-		//error_log('Creating Thumbs: '.$file);
-
-		$this->driver->load($file);
-
-		if($this->proportional) 
-		{
-			$width = $this->driver->img_x;
-			$height = $this->driver->img_y;
-
-			if ($width > $height)
-				$this->height = intval($this->width/$width*$height);
-			else if ($height > $width)
-				$this->width = intval($this->height/$height*$width);
-		}
-
-		$this->driver->resize($this->width, $this->height);
-
-		if(is_null($thumbnail)) 
-			$this->save($file);
-		else
-			$this->save($thumbnail);
-
-
-		$this->free();
-
-		if(is_file($thumbnail)) 
-			Return true;
-		else
-			Return false;
-	}
-
-	/**
-	 * Save the thumbnail file.
-	 * @param string $file file name to be saved as.
-	 */
-	function save($file) 
-	{
-		$this->driver->save($file);
-	}
-
-	/**
-	 * Free up the graphic driver resources.
-	 */
-	function free() 
-	{
-		$this->driver->free();
-	}
-}
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/Transform.php 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/Transform.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/Classes/Transform.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/Classes/Transform.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,569 +0,0 @@
-<?php
-/***********************************************************************
-** Title.........:  Image Transformation Interface
-** Version.......:  1.0
-** Author........:  Xiang Wei ZHUO <wei@zhuo.org>
-** Filename......:  Transform.php
-** Last changed..:  30 Aug 2003 
-** Notes.........:  Orginal is from PEAR
-                    
-                    Added a few extra,
-                        - create unique filename in a particular directory,
-                          used for temp image files.
-                        - added cropping to GD, NetPBM, ImageMagick
-**/
-
-// +----------------------------------------------------------------------+
-// | PHP Version 4                                                        |
-// +----------------------------------------------------------------------+
-// | Copyright (c) 1997-2002 The PHP Group                                |
-// +----------------------------------------------------------------------+
-// | This source file is subject to version 2.02 of the PHP license,      |
-// | that is bundled with this package in the file LICENSE, and is        |
-// | available at through the world-wide-web at                           |
-// | http://www.php.net/license/2_02.txt.                                 |
-// | If you did not receive a copy of the PHP license and are unable to   |
-// | obtain it through the world-wide-web, please send a note to          |
-// | license@php.net so we can mail you a copy immediately.               |
-// +----------------------------------------------------------------------+
-// | Authors: Peter Bowyer <peter@mapledesign.co.uk>                      |
-// |          Alan Knowles <alan@akbkhome.com>                            |
-// |          Vincent Oostindie <vincent@sunlight.tmfweb.nl>              |
-// +----------------------------------------------------------------------+
-//
-// $Id: Transform.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
-//
-// Image Transformation interface
-//
-
-
-/**
- * The main "Image_Resize" class is a container and base class which
- * provides the static methods for creating Image objects as well as
- * some utility functions (maths) common to all parts of Image Resize.
- *
- * The object model of DB is as follows (indentation means inheritance):
- *
- * Image_Resize The base for each Image implementation.  Provides default
- * |            implementations (in OO lingo virtual methods) for
- * |            the actual Image implementations as well as a bunch of
- * |            maths methods.
- * |
- * +-Image_GD   The Image implementation for the PHP GD extension .  Inherits
- *              Image_Resize
- *              When calling DB::setup for GD images the object returned is an
- *              instance of this class.
- *
- * @package  Image Resize
- * @version  1.00
- * @author   Peter Bowyer <peter@mapledesign.co.uk>
- * @since    PHP 4.0
- */
-Class Image_Transform
-{
-    /**
-     * Name of the image file
-     * @var string
-     */
-    var $image = '';
-    /**
-     * Type of the image file (eg. jpg, gif png ...)
-     * @var string
-     */
-    var $type = '';
-    /**
-     * Original image width in x direction
-     * @var int
-     */
-    var $img_x = '';
-    /**
-     * Original image width in y direction
-     * @var int
-     */
-    var $img_y = '';
-    /**
-     * New image width in x direction
-     * @var int
-     */
-    var $new_x = '';
-    /**
-     * New image width in y direction
-     * @var int
-     */
-    var $new_y = '';
-    /**
-     * Path the the library used
-     * e.g. /usr/local/ImageMagick/bin/ or
-     * /usr/local/netpbm/
-     */
-    var $lib_path = '';
-    /**
-     * Flag to warn if image has been resized more than once before displaying
-     * or saving.
-     */
-     var $resized = false;
-
-
-     var $uid = '';
-
-     var $lapse_time =900; //15 mins
-
-    /**
-     * Create a new Image_resize object
-     *
-     * @param string $driver name of driver class to initialize
-     *
-     * @return mixed a newly created Image_Transform object, or a PEAR
-     * error object on error
-     *
-     * @see PEAR::isError()
-     * @see Image_Transform::setOption()
-     */
-    function &factory($driver)
-    {
-        if ('' == $driver) {
-            die("No image library specified... aborting.  You must call ::factory() with one parameter, the library to load.");
-
-        }
-        $this->uid = md5($_SERVER['REMOTE_ADDR']);
-
-        include_once "$driver.php";
-
-        $classname = "Image_Transform_Driver_{$driver}";
-        $obj =& new $classname;
-        return $obj;
-    }
-
-
-    /**
-     * Resize the Image in the X and/or Y direction
-     * If either is 0 it will be scaled proportionally
-     *
-     * @access public
-     *
-     * @param mixed $new_x (0, number, percentage 10% or 0.1)
-     * @param mixed $new_y (0, number, percentage 10% or 0.1)
-     *
-     * @return mixed none or PEAR_error
-     */
-    function resize($new_x = 0, $new_y = 0)
-    {
-        // 0 means keep original size
-        $new_x = (0 == $new_x) ? $this->img_x : $this->_parse_size($new_x, $this->img_x);
-        $new_y = (0 == $new_y) ? $this->img_y : $this->_parse_size($new_y, $this->img_y);
-        // Now do the library specific resizing.
-        return $this->_resize($new_x, $new_y);
-    } // End resize
-
-
-    /**
-     * Scale the image to have the max x dimension specified.
-     *
-     * @param int $new_x Size to scale X-dimension to
-     * @return none
-     */
-    function scaleMaxX($new_x)
-    {
-        $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);
-        return $this->_resize($new_x, $new_y);
-    } // End resizeX
-
-    /**
-     * Scale the image to have the max y dimension specified.
-     *
-     * @access public
-     * @param int $new_y Size to scale Y-dimension to
-     * @return none
-     */
-    function scaleMaxY($new_y)
-    {
-        $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);
-        return $this->_resize($new_x, $new_y);
-    } // End resizeY
-
-    /**
-     * Scale Image to a maximum or percentage
-     *
-     * @access public
-     * @param mixed (number, percentage 10% or 0.1)
-     * @return mixed none or PEAR_error
-     */
-    function scale($size)
-    {
-        if ((strlen($size) > 1) && (substr($size,-1) == '%')) {
-            return $this->scaleByPercentage(substr($size, 0, -1));
-        } elseif ($size < 1) {
-            return $this->scaleByFactor($size);
-        } else {
-            return $this->scaleByLength($size);
-        }
-    } // End scale
-
-    /**
-     * Scales an image to a percentage of its original size.  For example, if
-     * my image was 640x480 and I called scaleByPercentage(10) then the image
-     * would be resized to 64x48
-     *
-     * @access public
-     * @param int $size Percentage of original size to scale to
-     * @return none
-     */
-    function scaleByPercentage($size)
-    {
-        return $this->scaleByFactor($size / 100);
-    } // End scaleByPercentage
-
-    /**
-     * Scales an image to a factor of its original size.  For example, if
-     * my image was 640x480 and I called scaleByFactor(0.5) then the image
-     * would be resized to 320x240.
-     *
-     * @access public
-     * @param float $size Factor of original size to scale to
-     * @return none
-     */
-    function scaleByFactor($size)
-    {
-        $new_x = round($size * $this->img_x, 0);
-        $new_y = round($size * $this->img_y, 0);
-        return $this->_resize($new_x, $new_y);
-    } // End scaleByFactor
-
-    /**
-     * Scales an image so that the longest side has this dimension.
-     *
-     * @access public
-     * @param int $size Max dimension in pixels
-     * @return none
-     */
-    function scaleByLength($size)
-    {
-         if ($this->img_x >= $this->img_y) {
-            $new_x = $size;
-            $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);
-        } else {
-            $new_y = $size;
-            $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);
-        }
-        return $this->_resize($new_x, $new_y);
-    } // End scaleByLength
-
-
-    /**
-     *
-     * @access public
-     * @return void
-     */
-    function _get_image_details($image)
-    {
-        //echo $image;
-        $data = @GetImageSize($image);
-        #1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order,
-        # 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC
-        if (is_array($data)){
-            switch($data[2]){
-                case 1:
-                    $type = 'gif';
-                    break;
-                case 2:
-                    $type = 'jpeg';
-                    break;
-                case 3:
-                    $type = 'png';
-                    break;
-                case 4:
-                    $type = 'swf';
-                    break;
-                case 5:
-                    $type = 'psd';
-                case 6:
-                    $type = 'bmp';
-                case 7:
-                case 8:
-                    $type = 'tiff';
-                default:
-                    echo("We do not recognize this image format");
-            }
-            $this->img_x = $data[0];
-            $this->img_y = $data[1];
-            $this->type = $type;
-
-            return true;
-        } else {
-            echo("Cannot fetch image or images details.");
-            return null;
-        }
-        /*
-        $output = array(
-                        'width' => $data[0],
-                        'height' => $data[1],
-                        'type' => $type
-                        );
-        return $output;
-        */
-    }
-
-
-    /**
-     * Parse input and convert
-     * If either is 0 it will be scaled proportionally
-     *
-     * @access private
-     *
-     * @param mixed $new_size (0, number, percentage 10% or 0.1)
-     * @param int $old_size
-     *
-     * @return mixed none or PEAR_error
-     */
-    function _parse_size($new_size, $old_size)
-    {
-        if ('%' == $new_size) {
-            $new_size = str_replace('%','',$new_size);
-            $new_size = $new_size / 100;
-        }
-        if ($new_size > 1) {
-            return (int) $new_size;
-        } elseif ($new_size == 0) {
-            return (int) $old_size;
-        } else {
-            return (int) round($new_size * $old_size, 0);
-        }
-    }
-
-
-    function uniqueStr()
-    {
-      return substr(md5(microtime()),0,6);
-    }
-
-    //delete old tmp files, and allow only 1 file per remote host.
-    function cleanUp($id, $dir)
-    {
-        $d = dir($dir);
-        $id_length = strlen($id);
-
-        while (false !== ($entry = $d->read())) {
-            if (is_file($dir.'/'.$entry) && substr($entry,0,1) == '.' && !ereg($entry, $this->image))
-            {
-                //echo filemtime($this->directory.'/'.$entry)."<br>"; 
-                //echo time();
-
-                if (filemtime($dir.'/'.$entry) + $this->lapse_time < time())
-                    unlink($dir.'/'.$entry);
-
-                if (substr($entry, 1, $id_length) == $id)
-                {
-                    if (is_file($dir.'/'.$entry))
-                        unlink($dir.'/'.$entry);
-                }
-            }
-        }
-        $d->close();
-    }
-
-
-    function createUnique($dir)
-    {
-       $unique_str = '.'.$this->uid.'_'.$this->uniqueStr().".".$this->type;
-        
-       //make sure the the unique temp file does not exists
-        while (file_exists($dir.$unique_str))
-        {
-            $unique_str = '.'.$this->uid.'_'.$this->uniqueStr().".".$this->type;
-        }
-        
-      $this->cleanUp($this->uid, $dir);
-
-       return $unique_str;
-    }
-
-
-    /**
-     * Set the image width
-     * @param int $size dimension to set
-     * @since 29/05/02 13:36:31
-     * @return
-     */
-    function _set_img_x($size)
-    {
-        $this->img_x = $size;
-    }
-
-    /**
-     * Set the image height
-     * @param int $size dimension to set
-     * @since 29/05/02 13:36:31
-     * @return
-     */
-    function _set_img_y($size)
-    {
-        $this->img_y = $size;
-    }
-
-    /**
-     * Set the image width
-     * @param int $size dimension to set
-     * @since 29/05/02 13:36:31
-     * @return
-     */
-    function _set_new_x($size)
-    {
-        $this->new_x = $size;
-    }
-
-    /**
-     * Set the image height
-     * @param int $size dimension to set
-     * @since 29/05/02 13:36:31
-     * @return
-     */
-    function _set_new_y($size)
-    {
-        $this->new_y = $size;
-    }
-
-    /**
-     * Get the type of the image being manipulated
-     *
-     * @return string $this->type the image type
-     */
-    function getImageType()
-    {
-        return $this->type;
-    }
-
-    /**
-     *
-     * @access public
-     * @return string web-safe image type
-     */
-    function getWebSafeFormat()
-    {
-        switch($this->type){
-            case 'gif':
-            case 'png':
-                return 'png';
-                break;
-            default:
-                return 'jpeg';
-        } // switch
-    }
-
-    /**
-     * Place holder for the real resize method
-     * used by extended methods to do the resizing
-     *
-     * @access private
-     * @return PEAR_error
-     */
-    function _resize() {
-        return null; //PEAR::raiseError("No Resize method exists", true);
-    }
-
-    /**
-     * Place holder for the real load method
-     * used by extended methods to do the resizing
-     *
-     * @access public
-     * @return PEAR_error
-     */
-    function load($filename) {
-        return null; //PEAR::raiseError("No Load method exists", true);
-    }
-
-    /**
-     * Place holder for the real display method
-     * used by extended methods to do the resizing
-     *
-     * @access public
-     * @param string filename
-     * @return PEAR_error
-     */
-    function display($type, $quality) {
-        return null; //PEAR::raiseError("No Display method exists", true);
-    }
-
-    /**
-     * Place holder for the real save method
-     * used by extended methods to do the resizing
-     *
-     * @access public
-     * @param string filename
-     * @return PEAR_error
-     */
-    function save($filename, $type, $quality) {
-        return null; //PEAR::raiseError("No Save method exists", true);
-    }
-
-    /**
-     * Place holder for the real free method
-     * used by extended methods to do the resizing
-     *
-     * @access public
-     * @return PEAR_error
-     */
-    function free() {
-        return null; //PEAR::raiseError("No Free method exists", true);
-    }
-
-    /**
-     * Reverse of rgb2colorname.
-     *
-     * @access public
-     * @return PEAR_error
-     *
-     * @see rgb2colorname
-     */
-    function colorhex2colorarray($colorhex) {
-        $r = hexdec(substr($colorhex, 1, 2));
-        $g = hexdec(substr($colorhex, 3, 2));
-        $b = hexdec(substr($colorhex, 4, 2));
-        return array($r,$g,$b);
-    }
-
-    /**
-     * Reverse of rgb2colorname.
-     *
-     * @access public
-     * @return PEAR_error
-     *
-     * @see rgb2colorname
-     */
-    function colorarray2colorhex($color) {
-        $color = '#'.dechex($color[0]).dechex($color[1]).dechex($color[2]);
-        return strlen($color)>6?false:$color;
-    }
-
-
-    /* Methods to add to the driver classes in the future */
-    function addText()
-    {
-        return null; //PEAR::raiseError("No addText method exists", true);
-    }
-
-    function addDropShadow()
-    {
-        return null; //PEAR::raiseError("No AddDropShadow method exists", true);
-    }
-
-    function addBorder()
-    {
-        return null; //PEAR::raiseError("No addBorder method exists", true);
-    }
-
-    function crop()
-    {
-        return null; //PEAR::raiseError("No crop method exists", true);
-    }
-
-    function flip() 
-    {
-        return null;
-    }
-
-    function gamma()
-    {
-        return null; //PEAR::raiseError("No gamma method exists", true);
-    }
-}
-?>
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/config.inc.php 75/e107_handlers/htmlarea/plugins/ImageManager/config.inc.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/config.inc.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/config.inc.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,144 +0,0 @@
-<?
-
-if(file_exists("../../../class2.php")){require_once("../../../class2.php");}
-else{require_once("../../../../class2.php");}
-
-
-
-/**
- * Image Manager configuration file.
- * @author $Author: e107coders $
- * @version $Id: config.inc.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-
-/*
- File system path to the directory you want to manage the images
- for multiple user systems, set it dynamically.
-
- NOTE: This directory requires write access by PHP. That is,
-       PHP must be able to create files in this directory.
-           Able to create directories is nice, but not necessary.
-*/
-// $IMConfig['base_dir'] = 'c:/www/assets/';
-
-$IMConfig['base_dir'] = e_IMAGE;
-
-
-/*
- The URL to the above path, the web browser needs to be able to see it.
- It can be protected via .htaccess on apache or directory permissions on IIS,
- check you web server documentation for futher information on directory protection
- If this directory needs to be publicly accessiable, remove scripting capabilities
- for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets
- in this directory and its subdirectories.
-*/
-// $IMConfig['base_url'] = 'http://127.0.0.1/assets/';
-
-
-$IMConfig['base_url'] = SITEURL.$IMAGES_DIRECTORY;
-
-/*
-  Possible values: true, false
-
-  TRUE - If PHP on the web server is in safe mode, set this to true.
-         SAFE MODE restrictions: directory creation will not be possible,
-                 only the GD library can be used, other libraries require
-                 Safe Mode to be off.
-
-  FALSE - Set to false if PHP on the web server is not in safe mode.
-*/
-// $IMConfig['safe_mode'] = false;
-$IMConfig['safe_mode'] = (ini_get('safe_mode'))? "true" : "false";
-/*
- Possible values: 'GD', 'IM', or 'NetPBM'
-
- The image manipulation library to use, either GD or ImageMagick or NetPBM.
- If you have safe mode ON, or don't have the binaries to other packages,
- your choice is 'GD' only. Other packages require Safe Mode to be off.
-*/
-define('IMAGE_CLASS', 'GD');
-
-
-/*
- After defining which library to use, if it is NetPBM or IM, you need to
- specify where the binary for the selected library are. And of course
- your server and PHP must be able to execute them (i.e. safe mode is OFF).
- GD does not require the following definition.
-*/
-define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/');
-
-
-/* ==============  OPTIONAL SETTINGS ============== */
-
-
-/*
-  The prefix for thumbnail files, something like .thumb will do. The
-  thumbnails files will be named as "prefix_imagefile.ext", that is,
-  prefix + orginal filename.
-*/
-$IMConfig['thumbnail_prefix'] = '.';
-
-/*
-  Thumbnail can also be stored in a directory, this directory
-  will be created by PHP. If PHP is in safe mode, this parameter
-  is ignored, you can not create directories.
-
-  If you do not want to store thumbnails in a directory, set this
-  to false or empty string '';
-*/
-$IMConfig['thumbnail_dir'] = '.thumbs';
-
-/*
-  Possible values: true, false
-
- TRUE -  Allow the user to create new sub-directories in the
-         $IMConfig['base_dir'].
-
- FALSE - No directory creation.
-
- NOTE: If $IMConfig['safe_mode'] = true, this parameter
-       is ignored, you can not create directories
-*/
-$IMConfig['allow_new_dir'] = true;
-
-/*
-  Possible values: true, false
-
-  TRUE - Allow the user to upload files.
-
-  FALSE - No uploading allowed.
-*/
-$IMConfig['allow_upload'] = true;
-
-/*
- Possible values: true, false
-
- TRUE - If set to true, uploaded files will be validated based on the
-        function getImageSize, if we can get the image dimensions then
-        I guess this should be a valid image. Otherwise the file will be rejected.
-
- FALSE - All uploaded files will be processed.
-
- NOTE: If uploading is not allowed, this parameter is ignored.
-*/
-$IMConfig['validate_images'] = true;
-
-/*
- The default thumbnail if the thumbnails can not be created, either
- due to error or bad image file.
-*/
-$IMConfig['default_thumbnail'] = 'img/default.gif';
-
-/*
-  Thumbnail dimensions.
-*/
-$IMConfig['thumbnail_width'] = 96;
-$IMConfig['thumbnail_height'] = 96;
-
-/*
-  Image Editor temporary filename prefix.
-*/
-$IMConfig['tmp_prefix'] = '.editor_';
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/editorFrame.php 75/e107_handlers/htmlarea/plugins/ImageManager/editorFrame.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/editorFrame.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/editorFrame.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,69 +0,0 @@
-<?
-
-/**
- * The frame that contains the image to be edited.
- * @author $Author: e107coders $
- * @version $Id: editorFrame.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-require_once('config.inc.php');
-require_once('Classes/ImageManager.php');
-require_once('Classes/ImageEditor.php');
-
-$manager = new ImageManager($IMConfig);
-$editor = new ImageEditor($manager);
-$imageInfo = $editor->processImage();
-
-?>
-
-<html>
-<head>
-	<title></title>
-<link href="assets/editorFrame.css" rel="stylesheet" type="text/css" />	
-<script type="text/javascript" src="assets/wz_jsgraphics.js"></script>
-<script type="text/javascript" src="assets/EditorContent.js"></script>
-<script type="text/javascript">
-if(window.top)
-	I18N = window.top.I18N;
-
-function i18n(str) {
-	if(I18N)
-		return (I18N[str] || str);
-	else
-		return str;
-};
-	
-	var mode = "<? echo $editor->getAction(); ?>" //crop, scale, measure
-
-var currentImageFile = "<? if(count($imageInfo)>0) echo rawurlencode($imageInfo['file']); ?>";
-
-<? if ($editor->isFileSaved() == 1) { ?>
-	alert(i18n('File saved.'));
-<? } else if ($editor->isFileSaved() == -1) { ?>
-	alert(i18n('File was not saved.'));
-<? } ?>
-
-</script>
-<script type="text/javascript" src="assets/editorFrame.js"></script>
-</head>
-
-<body>
-<div id="status"></div>
-<div id="ant" class="selection" style="visibility:hidden"><img src="img/spacer.gif" width="0" height="0" border="0" alt="" id="cropContent"></div>
-<? if ($editor->isGDEditable() == -1) { ?>
-	<div style="text-align:center; padding:10px;"><span class="error">GIF format is not supported, image editing not supported.</span></div>
-<? } ?>
-<table height="100%" width="100%">
-	<tr>
-		<td>
-<? if(count($imageInfo) > 0 && is_file($imageInfo['fullpath'])) { ?>
-	<span id="imgCanvas" class="crop"><img src="<? echo $imageInfo['src']; ?>" <? echo $imageInfo['dimensions']; ?> alt="" id="theImage" name="theImage"></span>
-<? } else { ?>
-	<span class="error">No Image Available</span>
-<? } ?>
-		</td>
-	</tr>
-</table>
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/editor.php 75/e107_handlers/htmlarea/plugins/ImageManager/editor.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/editor.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/editor.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,144 +0,0 @@
-<?
-/**
- * The PHP Image Editor user interface.
- * @author $Author: e107coders $
- * @version $Id: editor.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-require_once('config.inc.php');
-require_once('Classes/ImageManager.php');
-require_once('Classes/ImageEditor.php');
-
-$manager = new ImageManager($IMConfig);
-$editor = new ImageEditor($manager);
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html>
-<head>
-	<title></title>
-	<link href="assets/editor.css" rel="stylesheet" type="text/css" />	
-<script type="text/javascript" src="assets/slider.js"></script>
-<script type="text/javascript" src="assets/popup.js"></script>
-<script type="text/javascript">
-/*<![CDATA[*/
-	window.resizeTo(673, 531);
-	if(window.opener)
-		I18N = window.opener.I18N;
-/*]]>*/
-</script>
-<script type="text/javascript" src="assets/editor.js"></script>
-</head>
-
-<body>
-<div id="indicator">
-<img src="img/spacer.gif" id="indicator_image" height="20" width="20" alt="" />
-</div>
-<div id="tools">
-	<div id="tools_crop" style="display:none;">
-		<div id="tool_inputs">
-			<label for="cx">Start X:</label><input type="text" id="cx"  class="textInput" onchange="updateMarker('crop')"/>
-			<label for="cy">Start Y:</label><input type="text" id="cy" class="textInput" onchange="updateMarker('crop')"/>
-			<label for="cw">Width:</label><input type="text" id="cw" class="textInput" onchange="updateMarker('crop')"/>
-			<label for="ch">Height:</label><input type="text" id="ch" class="textInput" onchange="updateMarker('crop')"/>
-			<img src="img/div.gif" height="30" width="2" class="div" alt="|" />
-		</div>	
-		<a href="javascript: editor.doSubmit('crop');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
-		<a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>		
-	</div>	
-	<div id="tools_scale" style="display:none;">
-		<div id="tool_inputs">
-			<label for="sw">Width:</label><input type="text" id="sw" class="textInput" onchange="checkConstrains('width')"/>
-			<a href="javascript:toggleConstraints();" title="Lock"><img src="img/islocked2.gif" id="scaleConstImg" height="14" width="8" alt="Lock" class="div" /></a><label for="sh">Height:</label>
-			<input type="text" id="sh" class="textInput" onchange="checkConstrains('height')"/>
-			<input type="checkbox" id="constProp" value="1" checked="checked" onclick="toggleConstraints()"/>
-			<label for="constProp">Constrain Proportions</label>
-			<img src="img/div.gif" height="30" width="2" class="div" alt="|" />
-		</div>	
-		<a href="javascript: editor.doSubmit('scale');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
-		<a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>		
-	</div>	
-	<div id="tools_rotate" style="display:none;">
-		<div id="tool_inputs">
-			<select id="flip" name="flip" style="margin-left: 10px; vertical-align: middle;">
-              <option selected>Flip Image</option>
-              <option>-----------------</option>
-              <option value="hoz">Flip Horizontal</option>
-              <option value="ver">Flip Virtical</option>
-         </select>
-			<select name="rotate" onchange="rotatePreset(this)" style="margin-left: 20px; vertical-align: middle;">
-              <option selected>Rotate Image</option>
-              <option>-----------------</option>
-
-              <option value="180">Rotate 180 &deg;</option>
-              <option value="90">Rotate 90 &deg; CW</option>
-              <option value="-90">Rotate 90 &deg; CCW</option>
-         </select>
-			<label for="ra">Angle:</label><input type="text" id="ra" class="textInput" />
-			<img src="img/div.gif" height="30" width="2" class="div" alt="|" />
-		</div>	
-		<a href="javascript: editor.doSubmit('rotate');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
-		<a href="javascript: editor.reset();" class="buttons" title="Cancle"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>		
-	</div>		
-	<div id="tools_measure" style="display:none;">
-		<div id="tool_inputs">
-			<label>X:</label><input type="text" class="measureStats" id="sx" />
-			<label>Y:</label><input type="text" class="measureStats" id="sy" />
-			<img src="img/div.gif" height="30" width="2" class="div" alt="|" />
-			<label>W:</label><input type="text" class="measureStats" id="mw" />
-			<label>H:</label><input type="text" class="measureStats" id="mh" />
-			<img src="img/div.gif" height="30" width="2" class="div" alt="|" />
-			<label>A:</label><input type="text" class="measureStats" id="ma" />		
-			<label>D:</label><input type="text" class="measureStats" id="md" />		
-			<img src="img/div.gif" height="30" width="2" class="div" alt="|" />
-			<button type="button" onclick="editor.reset();" >Clear</button>
-		</div>	
-	</div>
-	<div id="tools_save" style="display:none;">
-		<div id="tool_inputs">
-			<label for="save_filename">Filename:</label><input type="text" id="save_filename" value="<? echo $editor->getDefaultSaveFile();?>"/>
-			<select name="format" id="save_format" style="margin-left: 10px; vertical-align: middle;" onchange="updateFormat(this)">
-            <option value="" selected>Image Format</option>
-            <option value="">---------------------</option>
-            <option value="jpeg,85">JPEG High</option>
-            <option value="jpeg,60">JPEG Medium</option>
-            <option value="jpeg,35">JPEG Low</option>
-            <option value="png">PNG</option>
-			<? if($editor->isGDGIFAble() != -1) { ?>
-            <option value="gif">GIF</option>
-			<? } ?>
-         </select>
-			<label>Quality:</label>
-			<table style="display: inline; vertical-align: middle;" cellpadding="0" cellspacing="0">
-				<tr>
-				<td>
-					<div id="slidercasing"> 
-				<div id="slidertrack" style="width:100px"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
-            <div id="sliderbar" style="left:85px" onmousedown="captureStart();"><img src="img/spacer.gif" width="1" height="1" border="0" alt="track"></div>
-			</div>	
-				</td>
-				</tr>
-			</table>				
-			<input type="text" id="quality" onchange="updateSlider(this.value)" style="width: 2em;" value="85"/>
-			<img src="img/div.gif" height="30" width="2" class="div" alt="|" />
-		</div>	
-		<a href="javascript: editor.doSubmit('save');" class="buttons" title="OK"><img src="img/btn_ok.gif" height="30" width="30" alt="OK" /></a>
-		<a href="javascript: editor.reset();" class="buttons" title="Cancel"><img src="img/btn_cancel.gif" height="30" width="30" alt="Cancel" /></a>		
-	</div>	
-</div>
-<div id="toolbar">
-<a href="javascript:toggle('crop')" id="icon_crop" title="Crop"><img src="img/crop.gif" height="20" width="20" alt="Crop" /><span>Crop</span></a>
-<a href="javascript:toggle('scale')" id="icon_scale" title="Resize"><img src="img/scale.gif" height="20" width="20" alt="Resize" /><span>Resize</span></a>
-<a href="javascript:toggle('rotate')" id="icon_rotate" title="Rotate"><img src="img/rotate.gif" height="20" width="20" alt="Rotate" /><span>Rotate</span></a>
-<a href="javascript:toggle('measure')" id="icon_measure" title="Measure"><img src="img/measure.gif" height="20" width="20" alt="Measure" /><span>Measure</span></a>
-<a href="javascript: toggleMarker();" title="Marker"><img id="markerImg" src="img/t_black.gif" height="20" width="20" alt="Marker" /><span>Marker</span></a>
-<a href="javascript:toggle('save')" id="icon_save" title="Save"><img src="img/save.gif" height="20" width="20" alt="Save" /><span>Save</span></a>
-</div>
-<div id="contents">
-<iframe src="editorFrame.php?img=<? if(isset($_GET['img'])) echo rawurlencode($_GET['img']); ?>" name="editor" id="editor"  scrolling="auto" title="Image Editor" frameborder="0"></iframe>
-</div>
-<div id="bottom"></div>
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/image-manager.js 75/e107_handlers/htmlarea/plugins/ImageManager/image-manager.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/image-manager.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/image-manager.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,100 +0,0 @@
-/**
- * The ImageManager plugin javascript.
- * @author $Author: e107coders $
- * @version $Id: image-manager.js,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-/**
- * To Enable the plug-in add the following line before HTMLArea is initialised.
- *
- * HTMLArea.loadPlugin("ImageManager");
- *
- * Then configure the config.inc.php file, that is all.
- * For up-to-date documentation, please visit http://www.zhuo.org/htmlarea/
- */
-
-/**
- * It is pretty simple, this file over rides the HTMLArea.prototype._insertImage
- * function with our own, only difference is the popupDialog url
- * point that to the php script.
- */
-function ImageManager(editor)
-{
-	var tt = ImageManager.I18N;	
-
-};
-
-ImageManager._pluginInfo = {
-	name          : "ImageManager",
-	version       : "1.0",
-	developer     : "Xiang Wei Zhuo",
-	developer_url : "http://www.zhuo.org/htmlarea/",
-	license       : "htmlArea"
-};
-
-
-// Over ride the _insertImage function in htmlarea.js.
-// Open up the ImageManger script instead.
-HTMLArea.prototype._insertImage = function(image) {
-
-	var editor = this;	// for nested functions
-	var outparam = null;
-	if (typeof image == "undefined") {
-		image = this.getParentElement();
-		if (image && !/^img$/i.test(image.tagName))
-			image = null;
-	}
-	if (image) outparam = {
-		f_url    : HTMLArea.is_ie ? image.src : image.getAttribute("src"),
-		f_alt    : image.alt,
-		f_border : image.border,
-		f_align  : image.align,
-		f_vert   : image.vspace,
-		f_horiz  : image.hspace,
-		f_width  : image.width,
-		f_height  : image.height
-	};
-
-	var manager = _editor_url + 'plugins/ImageManager/manager.php';
-
-	Dialog(manager, function(param) {
-		if (!param) {	// user must have pressed Cancel
-			return false;
-		}
-		var img = image;
-		if (!img) {
-			var sel = editor._getSelection();
-			var range = editor._createRange(sel);			
-			editor._doc.execCommand("insertimage", false, param.f_url);
-			if (HTMLArea.is_ie) {
-				img = range.parentElement();
-				// wonder if this works...
-				if (img.tagName.toLowerCase() != "img") {
-					img = img.previousSibling;
-				}
-			} else {
-				img = range.startContainer.previousSibling;
-			}
-		} else {			
-			img.src = param.f_url;
-		}
-		
-		for (field in param) {
-			var value = param[field];
-			switch (field) {
-			    case "f_alt"    : img.alt	 = value; break;
-			    case "f_border" : img.border = parseInt(value || "0"); break;
-			    case "f_align"  : img.align	 = value; break;
-			    case "f_vert"   : img.vspace = parseInt(value || "0"); break;
-			    case "f_horiz"  : img.hspace = parseInt(value || "0"); break;
-				case "f_width"  : img.width = parseInt(value || "0"); break;
-				case "f_height"  : img.height = parseInt(value || "0"); break;
-			}
-		}
-		
-		
-	}, outparam);
-};
-
-
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/images.php 75/e107_handlers/htmlarea/plugins/ImageManager/images.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/images.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/images.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,205 +0,0 @@
-<?
-/**
- * Show a list of images in a long horizontal table.
- * @author $Author: e107coders $
- * @version $Id: images.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-require_once('config.inc.php');
-require_once('Classes/ImageManager.php');
-
-//default path is /
-$relative = '/';
-$manager = new ImageManager($IMConfig);
-
-//process any file uploads
-$manager->processUploads();
-
-$manager->deleteFiles();
-
-$refreshDir = false;
-//process any directory functions
-if($manager->deleteDirs() || $manager->processNewDir())
-	$refreshDir = true;
-
-//check for any sub-directory request
-//check that the requested sub-directory exists
-//and valid
-if(isset($_REQUEST['dir']))
-{
-	$path = rawurldecode($_REQUEST['dir']);
-	if($manager->validRelativePath($path))
-		$relative = $path;
-}
-
-
-$manager = new ImageManager($IMConfig);
-
-
-//get the list of files and directories
-$list = $manager->getFiles($relative);
-
-
-/* ================= OUTPUT/DRAW FUNCTIONS ======================= */
-
-/**
- * Draw the files in an table.
- */
-function drawFiles($list, &$manager)
-{
-	global $relative;
-
-	foreach($list as $entry => $file) 
-	{ ?>
-		<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
-		<a href="javascript:;" onclick="selectImage('<? echo $file['relative'];?>', '<? echo $entry; ?>', <? echo $file['image'][0];?>, <? echo $file['image'][1]; ?>);"title="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"><img src="<? echo $manager->getThumbnail($file['relative']); ?>" alt="<? echo $entry; ?> - <? echo Files::formatSize($file['stat']['size']); ?>"/></a>
-		</td></tr><tr><td class="edit">
-			<a href="images.php?dir=<? echo $relative; ?>&amp;delf=<? echo rawurlencode($file['relative']);?>" title="Trash" onclick="return confirmDeleteFile('<? echo $entry; ?>');"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a><a href="javascript:;" title="Edit" onclick="editImage('<? echo rawurlencode($file['relative']);?>');"><img src="img/edit_pencil.gif" height="15" width="15" alt="Edit"/></a>
-		<? if($file['image']){ echo $file['image'][0].'x'.$file['image'][1]; } else echo $entry;?>
-		</td></tr></table></td> 
-	  <? 
-	}//foreach
-}//function drawFiles
-
-
-/**
- * Draw the directory.
- */
-function drawDirs($list, &$manager) 
-{
-	global $relative;
-
-	foreach($list as $path => $dir) 
-	{ ?>
-		<td><table width="100" cellpadding="0" cellspacing="0"><tr><td class="block">
-		<a href="images.php?dir=<? echo rawurlencode($path); ?>" onclick="updateDir('<? echo $path; ?>')" title="<? echo $dir['entry']; ?>"><img src="img/folder.gif" height="80" width="80" alt="<? echo $dir['entry']; ?>" /></a>
-		</td></tr><tr>
-		<td class="edit">
-			<a href="images.php?dir=<? echo $relative; ?>&amp;deld=<? echo rawurlencode($path); ?>" title="Trash" onclick="return confirmDeleteDir('<? echo $dir['entry']; ?>', <? echo $dir['count']; ?>);"><img src="img/edit_trash.gif" height="15" width="15" alt="Trash"/></a>
-			<? echo $dir['entry']; ?>
-		</td>
-		</tr></table></td>
-	  <? 
-	} //foreach
-}//function drawDirs
-
-
-/**
- * No directories and no files.
- */
-function drawNoResults() 
-{
-?>
-<table width="100%">
-  <tr>
-    <td class="noResult">No Images Found</td>
-  </tr>
-</table>
-<?	
-}
-
-/**
- * No directories and no files.
- */
-function drawErrorBase(&$manager) 
-{
-?>
-<table width="100%">
-  <tr>
-    <td class="error">Invalid base directory: <? echo $manager->config['base_dir']; ?></td>
-  </tr>
-</table>
-<?	
-}
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html>
-<head>
-	<title>Image List</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<link href="assets/imagelist.css" rel="stylesheet" type="text/css" />
-<script type="text/javascript" src="assets/dialog.js"></script>
-<script type="text/javascript">
-/*<![CDATA[*/
-
-	if(window.top)
-		I18N = window.top.I18N;
-
-	function hideMessage()
-	{
-		var topDoc = window.top.document;
-		var messages = topDoc.getElementById('messages');
-		if(messages)
-			messages.style.display = "none";
-	}
-
-	init = function()
-	{
-		hideMessage();
-		var topDoc = window.top.document;
-
-<? 
-	//we need to refesh the drop directory list
-	//save the current dir, delete all select options
-	//add the new list, re-select the saved dir.
-	if($refreshDir) 
-	{ 
-		$dirs = $manager->getDirs();
-?>
-		var selection = topDoc.getElementById('dirPath');
-		var currentDir = selection.options[selection.selectedIndex].text;
-
-		while(selection.length > 0)
-		{	selection.remove(0); }
-		
-		selection.options[selection.length] = new Option("/","<? echo rawurlencode('/'); ?>");	
-		<? foreach($dirs as $relative=>$fullpath) { ?>
-		selection.options[selection.length] = new Option("<? echo $relative; ?>","<? echo rawurlencode($relative); ?>");		
-		<? } ?>
-		
-		for(var i = 0; i < selection.length; i++)
-		{
-			var thisDir = selection.options[i].text;
-			if(thisDir == currentDir)
-			{
-				selection.selectedIndex = i;
-				break;
-			}
-		}		
-<? } ?>
-	}	
-
-	function editImage(image) 
-	{
-		var url = "editor.php?img="+image;
-		Dialog(url, function(param) 
-		{
-			if (!param) // user must have pressed Cancel
-				return false;
-			else
-			{
-				return true;
-			}
-		}, null);		
-	}
-
-/*]]>*/
-</script>
-<script type="text/javascript" src="assets/images.js"></script>
-</head>
-
-<body>
-<? if ($manager->isValidBase() == false) { drawErrorBase($manager); } 
-	elseif(count($list[0]) > 0 || count($list[1]) > 0) { ?>
-<table>
-	<tr>
-	<? drawDirs($list[0], $manager); ?>
-	<? drawFiles($list[1], $manager); ?>
-	</tr>
-</table>
-<? } else { drawNoResults(); } ?>
-</body>
-</html>
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/2x2.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/2x2.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/2x2_w.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/2x2_w.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/btn_cancel.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/btn_cancel.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/btnFolderNew.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/btnFolderNew.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/btnFolderUp.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/btnFolderUp.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/btn_ok.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/btn_ok.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/crop.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/crop.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/default.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/default.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/div.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/div.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/dots.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/dots.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/edit_active.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/edit_active.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/edit_pencil.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/edit_pencil.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/edit_trash.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/edit_trash.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/folder.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/folder.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/hand.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/hand.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/islocked2.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/islocked2.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/locked.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/locked.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/measure.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/measure.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/noimages.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/noimages.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/rotate.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/rotate.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/save.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/save.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/scale.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/scale.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/spacer.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/spacer.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/t_black.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/t_black.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/t_white.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/t_white.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/unlocked2.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/unlocked2.gif differ
Files 6171/e107_handlers/htmlarea/plugins/ImageManager/img/unlocked.gif and 75/e107_handlers/htmlarea/plugins/ImageManager/img/unlocked.gif differ
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/lang/en.js 75/e107_handlers/htmlarea/plugins/ImageManager/lang/en.js
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/lang/en.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,22 +0,0 @@
-﻿// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Xiang Wei Zhuo, http://www.zhuo.org
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-ImageManager.I18N = {
-	"Image Manager"									: "Image Manager",
-	"Crop"											: "Crop"
-};
-/*
-
-
-*/
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/manager.php 75/e107_handlers/htmlarea/plugins/ImageManager/manager.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/manager.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/manager.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,129 +0,0 @@
-<?
-/**
- * The main GUI for the ImageManager.
- * @author $Author: e107coders $
- * @version $Id: manager.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-	require_once('config.inc.php');
-	require_once('Classes/ImageManager.php');
-	
-	$manager = new ImageManager($IMConfig);
-	$dirs = $manager->getDirs();
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html>
-<head>
-	<title>Insert Image</title>
-  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link href="assets/manager.css" rel="stylesheet" type="text/css" />	
-<script type="text/javascript" src="assets/popup.js"></script>
-<script type="text/javascript" src="assets/dialog.js"></script>
-<script type="text/javascript">
-/*<![CDATA[*/
-	window.resizeTo(600, 460);
-
-	if(window.opener)
-		I18N = window.opener.ImageManager.I18N;
-
-	var thumbdir = "<? echo $IMConfig['thumbnail_dir']; ?>";
-	var base_url = "<? echo $manager->getBaseURL(); ?>";
-/*]]>*/
-</script>
-<script type="text/javascript" src="assets/manager.js"></script>
-</head>
-<body>
-<div class="title">Insert Image</div>
-<form action="images.php" id="uploadForm" method="post" enctype="multipart/form-data">
-<fieldset><legend>Image Manager</legend>
-<div class="dirs">
-	<label for="dirPath">Directory</label>
-	<select name="dir" class="dirWidth" id="dirPath" onchange="updateDir(this)">
-	<option value="/">/</option>
-<? foreach($dirs as $relative=>$fullpath) { ?>
-		<option value="<? echo rawurlencode($relative); ?>"><? echo $relative; ?></option>
-<? } ?>
-	</select>
-	<a href="#" onclick="javascript: goUpDir();" title="Directory Up"><img src="img/btnFolderUp.gif" height="15" width="15" alt="Directory Up" /></a>
-<? if($IMConfig['safe_mode'] == false && $IMConfig['allow_new_dir']) { ?>
-	<a href="#" onclick="newFolder();" title="New Folder"><img src="img/btnFolderNew.gif" height="15" width="15" alt="New Folder" /></a>
-<? } ?>
-	<div id="messages" style="display: none;"><span id="message"></span><img SRC="img/dots.gif" width="22" height="12" alt="..." /></div>
-	<iframe src="images.php" name="imgManager" id="imgManager" class="imageFrame" scrolling="auto" title="Image Selection" frameborder="0"></iframe>
-</div>
-</fieldset>
-<!-- image properties -->
-	<table class="inputTable">
-		<tr>
-			<td align="right"><label for="f_url">Image File</label></td>
-			<td><input type="text" id="f_url" class="largelWidth" value="" /></td>
-			<td rowspan="3" align="right">&nbsp;</td>
-			<td align="right"><label for="f_width">Width</label></td>
-			<td><input type="text" id="f_width" class="smallWidth" value="" onchange="javascript:checkConstrains('width');"/></td>
-			<td rowspan="2" align="right"><img src="img/locked.gif" id="imgLock" width="25" height="32" alt="Constrained Proportions" /></td>
-			<td rowspan="3" align="right">&nbsp;</td>
-			<td align="right"><label for="f_vert">V Space</label></td>
-			<td><input type="text" id="f_vert" class="smallWidth" value="" /></td>
-		</tr>		
-		<tr>
-			<td align="right"><label for="f_alt">Alt</label></td>
-			<td><input type="text" id="f_alt" class="largelWidth" value="" /></td>
-			<td align="right"><label for="f_height">Height</label></td>
-			<td><input type="text" id="f_height" class="smallWidth" value="" onchange="javascript:checkConstrains('height');"/></td>
-			<td align="right"><label for="f_horiz">H Space</label></td>
-			<td><input type="text" id="f_horiz" class="smallWidth" value="" /></td>
-		</tr>
-		<tr>
-<? if($IMConfig['allow_upload'] == true) { ?>
-			<td align="right"><label for="upload">Upload</label></td>
-			<td>
-				<table cellpadding="0" cellspacing="0" border="0">
-                  <tr>
-                    <td><input type="file" name="upload" id="upload"/></td>
-                    <td>&nbsp;<button type="submit" name="submit" onclick="doUpload();"/>Upload</button></td>
-                  </tr>
-                </table>
-			</td>
-<? } else { ?>
-			<td colspan="2"></td>
-<? } ?>
-			<td align="right"><label for="f_align">Align</label></td>
-			<td colspan="2">
-				<select size="1" id="f_align"  title="Positioning of this image">
-				  <option value=""                             >Not Set</option>
-				  <option value="left"                         >Left</option>
-				  <option value="right"                        >Right</option>
-				  <option value="texttop"                      >Texttop</option>
-				  <option value="absmiddle"                    >Absmiddle</option>
-				  <option value="baseline" selected="selected" >Baseline</option>
-				  <option value="absbottom"                    >Absbottom</option>
-				  <option value="bottom"                       >Bottom</option>
-				  <option value="middle"                       >Middle</option>
-				  <option value="top"                          >Top</option>
-				</select>
-			</td>
-			<td align="right"><label for="f_border">Border</label></td>
-			<td><input type="text" id="f_border" class="smallWidth" value="" /></td>
-		</tr>
-		<tr> 
-         <td colspan="4" align="right">
-				<input type="hidden" id="orginal_width" />
-				<input type="hidden" id="orginal_height" />
-            <input type="checkbox" id="constrain_prop" checked="checked" onclick="javascript:toggleConstrains(this);" />
-          </td>
-          <td colspan="5"><label for="constrain_prop">Constrain Proportions</label></td>
-      </tr>
-	</table>
-<!--// image properties -->	
-	<div style="text-align: right;"> 
-          <hr />
-		  <button type="button" class="buttons" onclick="return refresh();">Refresh</button>
-          <button type="button" class="buttons" onclick="return onOK();">OK</button>
-          <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
-    </div>
-</form>
-</body>
-</html>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/newFolder.html 75/e107_handlers/htmlarea/plugins/ImageManager/newFolder.html
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/newFolder.html	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/newFolder.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,78 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-<title>New Folder</title>
- <style type="text/css">
- /*<![CDATA[*/
- html, body {  background-color: ButtonFace;  color: ButtonText; font: 11px Tahoma,Verdana,sans-serif; margin: 0; padding: 0;}
-body { padding: 5px; }
- .title { background-color: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; border-bottom: 1px  solid black; letter-spacing: 2px;}
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-.buttons { width: 70px; text-align: center; }
-form { padding: 0px;  margin: 0;}
-form .elements{
-	padding: 10px; text-align: center;
-}
- /*]]>*/
- </style>
-<script type="text/javascript" src="assets/popup.js"></script>
-<script type="text/javascript">
-/*<![CDATA[*/
-	window.resizeTo(300, 160);
-
-	if(window.opener)
-		I18N = window.opener.I18N;
-
-	init = function () 
-	{
-		__dlg_init();
-		__dlg_translate(I18N);
-		document.getElementById("f_foldername").focus();
-	}
-
-	function onCancel() 
-	{
-		__dlg_close(null);
-		return false;
-	}
-
-	function onOK() 
-	{
-		 // pass data back to the calling window
-	  var fields = ["f_foldername"];
-	  var param = new Object();
-	  for (var i in fields) {
-		var id = fields[i];
-		var el = document.getElementById(id);
-		param[id] = el.value;
-	  }
-	  __dlg_close(param);
-	  return false;
-	}
-
-	function addEvent(obj, evType, fn)
-	{ 
-		if (obj.addEventListener) { obj.addEventListener(evType, fn, true); return true; } 
-		else if (obj.attachEvent) {  var r = obj.attachEvent("on"+evType, fn);  return r;  } 
-		else {  return false; } 
-	} 
-	
-	addEvent(window, 'load', init);
-//-->
-</script>
-</head>
-<body >
-<div class="title">New Folder</div>
-<form action="">
-<div class="elements">
-	<label for="f_foldername">Folder Name:</label>
-	<input type="text" id="f_foldername" />
-</div>
-<div style="text-align: right;"> 
-	  <hr />
-	  <button type="button" class="buttons" onclick="return onOK();">OK</button>
-	  <button type="button" class="buttons" onclick="return onCancel();">Cancel</button>
-</div>
-</form>
-</body>
-</html>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/README.txt 75/e107_handlers/htmlarea/plugins/ImageManager/README.txt
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/README.txt	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/README.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1,12 +0,0 @@
-This is a plug-in for HTMLArea 3.0
-
-The PHP ImageManager + Editor provides an interface to 
-browser for image files on your web server. The Editor
-allows some basic image manipulations such as, cropping,
-rotation, flip, and scaling.
-
-Further and up-to-date documentation can be found at
-http://www.zhuo.org/htmlarea/docs/index.html
-
-Cheer,
-Wei
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ImageManager/thumbs.php 75/e107_handlers/htmlarea/plugins/ImageManager/thumbs.php
--- 6171/e107_handlers/htmlarea/plugins/ImageManager/thumbs.php	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ImageManager/thumbs.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,82 +0,0 @@
-<?
-/**
- * On the fly Thumbnail generation.
- * Creates thumbnails given by thumbs.php?img=/relative/path/to/image.jpg
- * relative to the base_dir given in config.inc.php
- * @author $Author: e107coders $
- * @version $Id: thumbs.php,v 1.1 2004/06/26 13:48:37 e107coders Exp $
- * @package ImageManager
- */
-
-require_once('config.inc.php');
-require_once('Classes/ImageManager.php');
-require_once('Classes/Thumbnail.php');
-
-//check for img parameter in the url
-if(!isset($_GET['img']))
-	exit();
-
-
-$manager = new ImageManager($IMConfig);
-
-//get the image and the full path to the image
-$image = rawurldecode($_GET['img']);
-$fullpath = Files::makeFile($manager->getBaseDir(),$image);
-
-//not a file, so exit
-if(!is_file($fullpath))
-	exit();
-
-$imgInfo = @getImageSize($fullpath);
-
-//Not an image, send default thumbnail
-if(!is_array($imgInfo))
-{
-	//show the default image, otherwise we quit!
-	$default = $manager->getDefaultThumb();
-	if($default)
-	{
-		header('Location: '.$default);
-		exit();
-	}
-}
-//if the image is less than the thumbnail dimensions
-//send the original image as thumbnail
-if ($imgInfo[0] <= $IMConfig['thumbnail_width']
- && $imgInfo[1] <= $IMConfig['thumbnail_height'])
- {
-	 header('Location: '.$manager->getFileURL($image));
-	 exit();
- }
-
-//Check for thumbnails
-$thumbnail = $manager->getThumbName($fullpath);
-if(is_file($thumbnail))
-{
-	//if the thumbnail is newer, send it
-	if(filemtime($thumbnail) >= filemtime($fullpath))
-	{
-		header('Location: '.$manager->getThumbURL($image));
-		exit();
-	}
-}
-
-//creating thumbnails
-$thumbnailer = new Thumbnail($IMConfig['thumbnail_width'],$IMConfig['thumbnail_height']);
-$thumbnailer->createThumbnail($fullpath, $thumbnail);
-
-//Check for NEW thumbnails
-if(is_file($thumbnail))
-{
-	//send the new thumbnail
-	header('Location: '.$manager->getThumbURL($image));
-	exit();
-}
-else
-{
-	//show the default image, otherwise we quit!
-	$default = $manager->getDefaultThumb();
-	if($default)
-		header('Location: '.$default);
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/plugins/ListType/lang/de.js 75/e107_handlers/htmlarea/plugins/ListType/lang/de.js
--- 6171/e107_handlers/htmlarea/plugins/ListType/lang/de.js	2004-08-12 09:32:28.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ListType/lang/de.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,23 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Holger Hees, http://www.systemconcept.de
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-ListType.I18N = {
-	"Decimal"                :    "1-Zahlen",
-	"Lower roman"            :    "i-Roemisch",
-	"Upper roman"            :    "I-Roemisch",
-	"Lower latin"            :    "a-Zeichen",
-	"Upper latin"            :    "A-Zeichen",
-	"Lower greek"            :    "Griechisch",
-	"ListStyleTooltip"       :    "Whlen Sie einen Typ fr die Nummerierung aus"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/ListType/lang/en.js 75/e107_handlers/htmlarea/plugins/ListType/lang/en.js
--- 6171/e107_handlers/htmlarea/plugins/ListType/lang/en.js	2004-06-26 08:48:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ListType/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,23 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-ListType.I18N = {
-	"Decimal"                :    "Decimal numbers",
-	"Lower roman"            :    "Lower roman numbers",
-	"Upper roman"            :    "Upper roman numbers",
-	"Lower latin"            :    "Lower latin letters",
-	"Upper latin"            :    "Upper latin letters",
-	"Lower greek"            :    "Lower greek letters",
-	"ListStyleTooltip"       :    "Choose list style type (for ordered lists)"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/ListType/list-type.js 75/e107_handlers/htmlarea/plugins/ListType/list-type.js
--- 6171/e107_handlers/htmlarea/plugins/ListType/list-type.js	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/ListType/list-type.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,89 +0,0 @@
-// ListType Plugin for HTMLArea-3.0
-// Sponsored by MEdTech Unit - Queen's University
-// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
-//
-// (c) dynarch.com 2003.
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-//
-// $Id: list-type.js,v 1.2 2004/08/11 09:26:37 e107coders Exp $
-
-function ListType(editor) {
-	this.editor = editor;
-	var cfg = editor.config;
-	var toolbar = cfg.toolbar;
-	var self = this;
-	var i18n = ListType.I18N;
-	var options = {};
-	options[i18n["Decimal"]] = "decimal";
-	options[i18n["Lower roman"]] = "lower-roman";
-	options[i18n["Upper roman"]] = "upper-roman";
-	options[i18n["Lower latin"]] = "lower-alpha";
-	options[i18n["Upper latin"]] = "upper-alpha";
-	if (!HTMLArea.is_ie)
-		// IE doesn't support this property; even worse, it complains
-		// with a gross error message when we tried to select it,
-		// therefore let's hide it from the damn "browser".
-		options[i18n["Lower greek"]] = "lower-greek";
-	var obj = {
-		id            : "ListType",
-		tooltip       : i18n["ListStyleTooltip"],
-		options       : options,
-		action        : function(editor) { self.onSelect(editor, this); },
-		refresh       : function(editor) { self.updateValue(editor, this); },
-		context       : "ol"
-	};
-	cfg.registerDropdown(obj);
-	var a, i, j, found = false;
-	for (i = 0; !found && i < toolbar.length; ++i) {
-		a = toolbar[i];
-		for (j = 0; j < a.length; ++j) {
-			if (a[j] == "unorderedlist") {
-				found = true;
-				break;
-			}
-		}
-	}
-	if (found)
-		a.splice(j, 0, "space", "ListType", "space");
-};
-
-ListType._pluginInfo = {
-	name          : "ListType",
-	version       : "1.0",
-	developer     : "Mihai Bazon",
-	developer_url : "http://dynarch.com/mishoo/",
-	c_owner       : "dynarch.com",
-	sponsor       : "MEdTech Unit - Queen's University",
-	sponsor_url   : "http://www.queensu.ca/",
-	license       : "htmlArea"
-};
-
-ListType.prototype.onSelect = function(editor, combo) {
-	var tbobj = editor._toolbarObjects[combo.id].element;
-	var parent = editor.getParentElement();
-	while (!/^ol$/i.test(parent.tagName)) {
-		parent = parent.parentNode;
-	}
-	parent.style.listStyleType = tbobj.value;
-};
-
-ListType.prototype.updateValue = function(editor, combo) {
-	var tbobj = editor._toolbarObjects[combo.id].element;
-	var parent = editor.getParentElement();
-	while (parent && !/^ol$/i.test(parent.tagName)) {
-		parent = parent.parentNode;
-	}
-	if (!parent) {
-		tbobj.selectedIndex = 0;
-		return;
-	}
-	var type = parent.style.listStyleType;
-	if (!type) {
-		tbobj.selectedIndex = 0;
-	} else {
-		for (var i = tbobj.firstChild; i; i = i.nextSibling) {
-			i.selected = (type.indexOf(i.value) != -1);
-		}
-	}
-};
Files 6171/e107_handlers/htmlarea/plugins/SpellChecker/img/he-spell-check.gif and 75/e107_handlers/htmlarea/plugins/SpellChecker/img/he-spell-check.gif differ
Files 6171/e107_handlers/htmlarea/plugins/SpellChecker/img/spell-check.gif and 75/e107_handlers/htmlarea/plugins/SpellChecker/img/spell-check.gif differ
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/cz.js 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/cz.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/cz.js	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/cz.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-﻿// I18N constants

-

-// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2

-// Author: Jiri Löw, <jirilow@jirilow.com>

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-SpellChecker.I18N = {

-	"CONFIRM_LINK_CLICK"                    : "Prosím potvrďte otevření tohoto odkazu",

-	"Cancel"                                : "Zrušit",

-	"Dictionary"                            : "Slovník",

-	"Finished list of mispelled words"      : "Dokončen seznam chybných slov",

-	"I will open it in a new page."         : "Bude otevřen jej v nové stránce.",

-	"Ignore all"                            : "Ignorovat vše",

-	"Ignore"                                : "Ignorovat",

-	"NO_ERRORS"                             : "Podle zvoleného slovníku nebyla nalezena žádná chybná slova.",

-	"NO_ERRORS_CLOSING"                     : "Kontrola správnosti slov dokončena, nebyla nalezena žádná chybná slova. Ukončování ...",

-	"OK"                                    : "OK",

-	"Original word"                         : "Původní slovo",

-	"Please wait.  Calling spell checker."  : "Prosím čekejte. Komunikuace s kontrolou správnosti slov.",

-	"Please wait: changing dictionary to"   : "Prosím čekejte: změna adresáře na",

-	"QUIT_CONFIRMATION"                     : "Změny budou zrušeny a kontrola správnosti slov ukončena. Prosím potvrďte.",

-	"Re-check"                              : "Překontrolovat",

-	"Replace all"                           : "Zaměnit všechno",

-	"Replace with"                          : "Zaměnit za",

-	"Replace"                               : "Zaměnit",

-	"SC-spell-check"                        : "Kontrola správnosti slov",

-	"Suggestions"                           : "Doporučení",

-	"pliz weit ;-)"                         : "strpení prosím ;-)"

-};

diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/da.js 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/da.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/da.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/da.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-﻿// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Steen Sønderup, <steen@soenderup.com>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-SpellChecker.I18N = {
-	"CONFIRM_LINK_CLICK"                    : "Vil du følge dette link?",
-	"Cancel"                                : "Anuler",
-	"Dictionary"                            : "Ordbog",
-	"Finished list of mispelled words"      : "Listen med stavefejl er gennemgået",
-	"I will open it in a new page."         : "Jeg vil åbne det i en ny side.",
-	"Ignore all"                            : "Ignorer alle",
-	"Ignore"                                : "Ignorer",
-	"NO_ERRORS"                             : "Der blev ikke fundet nogle stavefejl med den valgte ordbog.",
-	"NO_ERRORS_CLOSING"                     : "Stavekontrollen er gennemført, der blev ikke fundet nogle stavefejl.  Lukker...",
-	"OK"                                    : "OK",
-	"Original word"                         : "Oprindeligt ord",
-	"Please wait.  Calling spell checker."  : "Vent venligst.  Henter stavekontrol.",
-	"Please wait: changing dictionary to"   : "Vent venligst: skifter ordbog til",
-	"QUIT_CONFIRMATION"                     : "Alle dine ændringer vil gå tabt, vil du fortsætte?",
-	"Re-check"                              : "Tjek igen",
-	"Replace all"                           : "Erstat alle",
-	"Replace with"                          : "Erstat med",
-	"Replace"                               : "Erstat",
-	"SC-spell-check"                        : "Stavekontrol",
-	"Suggestions"                           : "Forslag",
-	"pliz weit ;-)"                         : "Vent venligst"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/de.js 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/de.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/de.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/de.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,28 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Broxx, <broxx@broxx.com>
-
-SpellChecker.I18N = {
-	"CONFIRM_LINK_CLICK"                    : "Wollen Sie diesen Link oeffnen",
-	"Cancel"                                : "Abbrechen",
-	"Dictionary"                            : "Woerterbuch",
-	"Finished list of mispelled words"      : "Liste der nicht bekannten Woerter",
-	"I will open it in a new page."         : "Wird auf neuer Seite geoeffnet",
-	"Ignore all"                            : "Alle ignorieren",
-	"Ignore"                                : "Ignorieren",
-	"NO_ERRORS"                             : "Keine falschen Woerter mit gewaehlten Woerterbuch gefunden",
-	"NO_ERRORS_CLOSING"                     : "Rechtsschreibpruefung wurde ohne Fehler fertiggestellt.  Wird nun geschlossen...",
-	"OK"                                    : "OK",
-	"Original word"                         : "Original Wort",
-	"Please wait.  Calling spell checker."  : "Bitte warten.  Woerterbuch wird durchsucht.",
-	"Please wait: changing dictionary to"   : "Bitte warten: Woerterbuch wechseln zu",
-	"QUIT_CONFIRMATION"                     : "Aenderungen werden nicht uebernommen.  Bitte bestaettigen.",
-	"Re-check"                              : "Neuueberpruefung",
-	"Replace all"                           : "Alle ersetzen",
-	"Replace with"                          : "Ersetzen mit",
-	"Replace"                               : "Ersetzen",
-	"SC-spell-check"                        : "Ueberpruefung",
-	"Suggestions"                           : "Vorschlag",
-	"pliz weit ;-)"                         : "bittsche wartn ;-)"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/en.js 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/en.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/en.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,38 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-SpellChecker.I18N = {
-	"CONFIRM_LINK_CLICK"                    : "Please confirm that you want to open this link",
-	"Cancel"                                : "Cancel",
-	"Dictionary"                            : "Dictionary",
-	"Finished list of mispelled words"      : "Finished list of mispelled words",
-	"I will open it in a new page."         : "I will open it in a new page.",
-	"Ignore all"                            : "Ignore all",
-	"Ignore"                                : "Ignore",
-	"NO_ERRORS"                             : "No mispelled words found with the selected dictionary.",
-	"NO_ERRORS_CLOSING"                     : "Spell check complete, didn't find any mispelled words.  Closing now...",
-	"OK"                                    : "OK",
-	"Original word"                         : "Original word",
-	"Please wait.  Calling spell checker."  : "Please wait.  Calling spell checker.",
-	"Please wait: changing dictionary to"   : "Please wait: changing dictionary to",
-	"QUIT_CONFIRMATION"                     : "This will drop changes and quit spell checker.  Please confirm.",
-	"Re-check"                              : "Re-check",
-	"Replace all"                           : "Replace all",
-	"Replace with"                          : "Replace with",
-	"Replace"                               : "Replace",
-	"Revert"                                : "Revert",
-	"SC-spell-check"                        : "Spell-check",
-	"Suggestions"                           : "Suggestions",
-	"pliz weit ;-)"                         : "pliz weit ;-)"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/he.js 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/he.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/he.js	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/he.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,38 +0,0 @@
-// I18N constants

-

-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1

-// Author: Mihai Bazon, http://dynarch.com/mishoo

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-SpellChecker.I18N = {

-	"CONFIRM_LINK_CLICK"                    : "אנא אשר שברצונך לפתוח קישור זה",

-	"Cancel"                                : "ביטול",

-	"Dictionary"                            : "מילון",

-	"Finished list of mispelled words"      : "הסתיימה רשימת המילים המאויתות באופן שגוי",

-	"I will open it in a new page."         : "אני אפתח את זה בחלון חדש.",

-	"Ignore all"                            : "התעלם מהכל",

-	"Ignore"                                : "התעלם",

-	"NO_ERRORS"                             : "לא נמצאו מילים מאויתות באופן שגוי עם המילון הנבחר.",

-	"NO_ERRORS_CLOSING"                     : "בדיקת האיות נסתיימה, לא נמצאו מילים מאויתות באופן שגוי.  נסגר כעת...",

-	"OK"                                    : "אישור",

-	"Original word"                         : "המילה המקורית",

-	"Please wait.  Calling spell checker."  : "אנא המתן.  קורא לבודק איות.",

-	"Please wait: changing dictionary to"   : "אנא המתן: מחליף מילון ל-",

-	"QUIT_CONFIRMATION"                     : "זה יבטל את השינויים ויצא מבודק האיות.  אנא אשר.",

-	"Re-check"                              : "בדוק מחדש",

-	"Replace all"                           : "החלף הכל",

-	"Replace with"                          : "החלף ב-",

-	"Replace"                               : "החלף",

-	"Revert"                                : "החזר שינויים",

-	"SC-spell-check"                        : "בדיקת איות",

-	"Suggestions"                           : "הצעות",

-	"pliz weit ;-)"                         : "ענא המטן ;-)"

-};

diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/hu.js 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/hu.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/hu.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/hu.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-// I18N constants
-
-// LANG: "hu", ENCODING: UTF-8
-// Author: Miklós Somogyi, <somogyine@vnet.hu>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-SpellChecker.I18N = {
-	"CONFIRM_LINK_CLICK"                    : "Megerősítés",
-	"Cancel"                                : "Mégsem",
-	"Dictionary"                            : "Szótár",
-	"Finished list of mispelled words"      : "A tévesztett szavak listájának vége",
-	"I will open it in a new page."         : "Megnyitás új lapon",
-	"Ignore all"                            : "Minden elvetése",
-	"Ignore"                                : "Elvetés",
-	"NO_ERRORS"                             : "A választott szótár szerint nincs tévesztett szó.",
-	"NO_ERRORS_CLOSING"                     : "A helyesírásellenőrzés kész, tévesztett szó nem fordult elő. Bezárás...",
-	"OK"                                    : "Rendben",
-	"Original word"                         : "Eredeti szó",
-	"Please wait.  Calling spell checker."  : "Kis türelmet, a helyesírásellenőrző hívása folyamatban.",
-	"Please wait: changing dictionary to"   : "Kis türelmet, szótár cseréje",
-	"QUIT_CONFIRMATION"                     : "Kilépés a változások eldobásával. Jóváhagyja?",
-	"Re-check"                              : "Újraellenőrzés",
-	"Replace all"                           : "Mind cseréje",
-	"Replace with"                          : "Csere a következőre:",
-	"Replace"                               : "Csere",
-	"SC-spell-check"                        : "Helyesírásellenőrzés",
-	"Suggestions"                           : "Tippek",
-	"pliz weit ;-)"                         : "Kis türelmet ;-)"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/it.js 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/it.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/it.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/it.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,28 +0,0 @@
-// I18N constants
-
-// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
-// Author: Fabio Rotondo, <fabio@rotondo.it>
-
-SpellChecker.I18N = {
-	"CONFIRM_LINK_CLICK"                    : "Devi confermare l'apertura di questo link",
-	"Cancel"                                : "Annulla",
-	"Dictionary"                            : "Dizionario",
-	"Finished list of mispelled words"      : "La lista delle parole scritte male è terminata",
-	"I will open it in a new page."         : "Lo aprirò in una nuova pagina.",
-	"Ignore all"                            : "Ignora sempre",
-	"Ignore"                                : "Ignora",
-	"NO_ERRORS"                             : "Non sono state trovate parole scritte male con il dizionario selezionato.",
-	"NO_ERRORS_CLOSING"                     : "Controllo completato, non sono state trovate parole scritte male. Sto chiudendo...",
-	"OK"                                    : "OK",
-	"Original word"                         : "Parola originale",
-	"Please wait.  Calling spell checker."  : "Attendere.  Sto invocando lo Spell Checker.",
-	"Please wait: changing dictionary to"   : "Attendere. Cambio il dizionario in",
-	"QUIT_CONFIRMATION"                     : "Questo annullerà le modifiche e chiuderà lo Spell Checker. Conferma.",
-	"Re-check"                              : "Ricontrolla",
-	"Replace all"                           : "Sostituisci sempre",
-	"Replace with"                          : "Stostituisci con",
-	"Replace"                               : "Sostituisci",
-	"SC-spell-check"                        : "Spell-check",
-	"Suggestions"                           : "Suggerimenti",
-	"pliz weit ;-)"                         : "Attendere Prego ;-)"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/nl.js 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/nl.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/nl.js	2004-08-12 09:32:28.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/nl.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,39 +0,0 @@
-// I18N constants
-
-// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1
-// Author: A.H van den Broek  http://www.kontaktfm.nl
-// Email : tonbroek@kontaktfm.nl
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-SpellChecker.I18N = {
-	"CONFIRM_LINK_CLICK"                    : "Weet u zeker dat u deze link wilt openen?",
-	"Cancel"                                : "Annuleer",
-	"Dictionary"                            : "Woordenboek",
-	"Finished list of mispelled words"      : "klaar met de lijst van fouten woorden",
-	"I will open it in a new page."         : "Ik zal het in een nieuwe pagina openen.",
-	"Ignore all"                            : "alles overslaan",
-	"Ignore"                                : "Overslaan",
-	"NO_ERRORS"                             : "Geen fouten gevonden met dit woordenboek.",
-	"NO_ERRORS_CLOSING"                     : "Spell checking is klaar, geen fouten gevonden.  spell checking word gesloten...",
-	"OK"                                    : "OK",
-	"Original word"                         : "Originele woord",
-	"Please wait.  Calling spell checker."  : "Even wachten. spell checker wordt geladen.",
-	"Please wait: changing dictionary to"   : "even wachten: woordenboek wordt veranderd naar",
-	"QUIT_CONFIRMATION"                     : "Dit zal alle veranderingen annuleren en de spell checker sluiten.  Weet u het zeker?",
-	"Re-check"                              : "Opnieuw",
-	"Replace all"                           : "Alles vervangen",
-	"Replace with"                          : "Vervangen met",
-	"Replace"                               : "Vervangen",
-	"Revert"                                : "Omkeren",
-	"SC-spell-check"                        : "Spell-check",
-	"Suggestions"                           : "Suggestie",
-	"pliz weit ;-)"                         : "Even wachten ;-)"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/ro.js 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/ro.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/lang/ro.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/lang/ro.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-// I18N constants
-
-// LANG: "ro", ENCODING: UTF-8
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-SpellChecker.I18N = {
-	"CONFIRM_LINK_CLICK"                    : "Vă rog confirmaţi că vreţi să deschideţi acest link",
-	"Cancel"                                : "Anulează",
-	"Dictionary"                            : "Dicţionar",
-	"Finished list of mispelled words"      : "Am terminat lista de cuvinte greşite",
-	"I will open it in a new page."         : "O voi deschide într-o altă fereastră.",
-	"Ignore all"                            : "Ignoră toate",
-	"Ignore"                                : "Ignoră",
-	"NO_ERRORS"                             : "Nu am găsit nici un cuvânt greşit cu acest dicţionar.",
-	"NO_ERRORS_CLOSING"                     : "Am terminat, nu am detectat nici o greşeală.  Acum închid fereastra...",
-	"OK"                                    : "OK",
-	"Original word"                         : "Cuvântul original",
-	"Please wait.  Calling spell checker."  : "Vă rog aşteptaţi.  Apelez spell-checker-ul.",
-	"Please wait: changing dictionary to"   : "Vă rog aşteptaţi.  Schimb dicţionarul cu",
-	"QUIT_CONFIRMATION"                     : "Doriţi să renunţaţi la modificări şi să închid spell-checker-ul?",
-	"Re-check"                              : "Scanează",
-	"Replace all"                           : "Înlocuieşte toate",
-	"Replace with"                          : "Înlocuieşte cu",
-	"Replace"                               : "Înlocuieşte",
-	"SC-spell-check"                        : "Detectează greşeli",
-	"Suggestions"                           : "Sugestii",
-	"pliz weit ;-)"                         : "va rog ashteptatzi ;-)"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/readme-tech.html 75/e107_handlers/htmlarea/plugins/SpellChecker/readme-tech.html
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/readme-tech.html	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/readme-tech.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,114 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
-<html>
-  <head>
-    <title>HTMLArea Spell Checker</title>
-  </head>
-
-  <body>
-    <h1>HTMLArea Spell Checker</h1>
-
-    <p>The HTMLArea Spell Checker subsystem consists of the following
-      files:</p>
-
-    <ul>
-
-      <li>spell-checker.js &mdash; the spell checker plugin interface for
-        HTMLArea</li>
-
-      <li>spell-checker-ui.html &mdash; the HTML code for the user
-        interface</li>
-
-      <li>spell-checker-ui.js &mdash; functionality of the user
-        interface</li>
-
-      <li>spell-checker-logic.cgi &mdash; Perl CGI script that checks a text
-        given through POST for spelling errors</li>
-
-      <li>spell-checker-style.css &mdash; style for mispelled words</li>
-
-      <li>lang/en.js &mdash; main language file (English).</li>
-
-    </ul>
-
-    <h2>Process overview</h2>
-
-    <p>
-      When an end-user clicks the "spell-check" button in the HTMLArea
-      editor, a new window is opened with the URL of "spell-check-ui.html".
-      This window initializes itself with the text found in the editor (uses
-      <tt>window.opener.SpellChecker.editor</tt> global variable) and it
-      submits the text to the server-side script "spell-check-logic.cgi".
-      The target of the FORM is an inline frame which is used both to
-      display the text and correcting.
-    </p>
-
-    <p>
-      Further, spell-check-logic.cgi calls Aspell for each portion of plain
-      text found in the given HTML.  It rebuilds an HTML file that contains
-      clear marks of which words are incorrect, along with suggestions for
-      each of them.  This file is then loaded in the inline frame.  Upon
-      loading, a JavaScript function from "spell-check-ui.js" is called.
-      This function will retrieve all mispelled words from the HTML of the
-      iframe and will setup the user interface so that it allows correction.
-    </p>
-
-    <h2>The server-side script (spell-check-logic.cgi)</h2>
-
-    <p>
-      <strong>Unicode safety</strong> &mdash; the program <em>is</em>
-      Unicode safe.  HTML entities are expanded into their corresponding
-      Unicode characters.  These characters will be matched as part of the
-      word passed to Aspell.  All texts passed to Aspell are in Unicode
-      (when appropriate).  <strike>However, Aspell seems to not support Unicode
-      yet (<a
-        href="http://mail.gnu.org/archive/html/aspell-user/2000-11/msg00007.html">thread concerning Aspell and Unicode</a>).
-      This mean that words containing Unicode
-      characters that are not in 0..255 are likely to be reported as "mispelled" by Aspell.</strike>
-    </p>
-
-    <p>
-      <strong style="font-variant: small-caps; color:
-      red;">Update:</strong> though I've never seen it mentioned
-      anywhere, it looks that Aspell <em>does</em>, in fact, speak
-      Unicode.  Or else, maybe <code>Text::Aspell</code> does
-      transparent conversion; anyway, this new version of our
-      SpellChecker plugin is, as tests show so far, fully
-      Unicode-safe... well, probably the <em>only</em> freeware
-      Web-based spell-checker which happens to have Unicode support.
-    </p>
-
-    <p>
-      The Perl Unicode manual (man perluniintro) states:
-    </p>
-
-    <blockquote>
-      <em>
-        Starting from Perl 5.6.0, Perl has had the capacity to handle Unicode
-        natively.  Perl 5.8.0, however, is the first recommended release for
-        serious Unicode work.  The maintenance release 5.6.1 fixed many of the
-        problems of the initial Unicode implementation, but for example regular
-        expressions still do not work with Unicode in 5.6.1.
-      </em>
-    </blockquote>
-
-    <p>In other words, do <em>not</em> assume that this script is
-      Unicode-safe on Perl interpreters older than 5.8.0.</p>
-
-    <p>The following Perl modules are required:</p>
-
-    <ul>
-      <li><a href="http://search.cpan.org/search?query=Text%3A%3AAspell&mode=all" target="_blank">Text::Aspell</a></li>
-      <li><a href="http://search.cpan.org/search?query=XML%3A%3ADOM&mode=all" target="_blank">XML::DOM</a></li>
-      <li><a href="http://search.cpan.org/search?query=CGI&mode=all" target="_blank">CGI</a></li>
-    </ul>
-
-    <p>Of these, only Text::Aspell might need to be installed manually.  The
-      others are likely to be available by default in most Perl distributions.</p>
-
-    <hr />
-    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
-<!-- Created: Thu Jul 17 13:22:27 EEST 2003 -->
-<!-- hhmts start --> Last modified: Fri Jan 30 19:14:11 EET 2004 <!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-checker.js 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-checker.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-checker.js	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-checker.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,79 +0,0 @@
-// Spell Checker Plugin for HTMLArea-3.0
-// Sponsored by www.americanbible.org
-// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
-//
-// (c) dynarch.com 2003.
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-//
-// $Id: spell-checker.js,v 1.5 2004/08/11 09:26:38 e107coders Exp $
-
-function SpellChecker(editor) {
-	this.editor = editor;
-
-	var cfg = editor.config;
-	var tt = SpellChecker.I18N;
-	var bl = SpellChecker.btnList;
-	var self = this;
-
-	// register the toolbar buttons provided by this plugin
-	var toolbar = [];
-	for (var i = 0; i < bl.length; ++i) {
-		var btn = bl[i];
-		if (!btn) {
-			toolbar.push("separator");
-		} else {
-			var id = "SC-" + btn[0];
-			cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "SpellChecker"), false,
-					   function(editor, id) {
-						   // dispatch button press event
-						   self.buttonPress(editor, id);
-					   }, btn[1]);
-			toolbar.push(id);
-		}
-	}
-
-	for (var i = 0; i < toolbar.length; ++i) {
-		cfg.toolbar[0].push(toolbar[i]);
-	}
-};
-
-SpellChecker._pluginInfo = {
-	name          : "SpellChecker",
-	version       : "1.0",
-	developer     : "Mihai Bazon",
-	developer_url : "http://dynarch.com/mishoo/",
-	c_owner       : "Mihai Bazon",
-	sponsor       : "American Bible Society",
-	sponsor_url   : "http://www.americanbible.org",
-	license       : "htmlArea"
-};
-
-SpellChecker.btnList = [
-	null, // separator
-	["spell-check"]
-	];
-
-SpellChecker.prototype.buttonPress = function(editor, id) {
-	switch (id) {
-	    case "SC-spell-check":
-		SpellChecker.editor = editor;
-		SpellChecker.init = true;
-		var uiurl = _editor_url + "plugins/SpellChecker/spell-check-ui.html";
-		var win;
-		if (HTMLArea.is_ie) {
-			win = window.open(uiurl, "SC_spell_checker",
-					  "toolbar=no,location=no,directories=no,status=no,menubar=no," +
-					  "scrollbars=no,resizable=yes,width=600,height=450");
-		} else {
-			win = window.open(uiurl, "SC_spell_checker",
-					  "toolbar=no,menubar=no,personalbar=no,width=600,height=450," +
-					  "scrollbars=no,resizable=yes");
-		}
-		win.focus();
-		break;
-	}
-};
-
-// this needs to be global, it's accessed from spell-check-ui.html
-SpellChecker.editor = null;
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-logic.cgi 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-logic.cgi
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-logic.cgi	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-logic.cgi	1969-12-31 18:00:00.000000000 -0600
@@ -1,210 +0,0 @@
-#! /usr/bin/perl -w
-
-# Spell Checker Plugin for HTMLArea-3.0
-# Sponsored by www.americanbible.org
-# Implementation by Mihai Bazon, http://dynarch.com/mishoo/
-#
-# (c) dynarch.com 2003.
-# Distributed under the same terms as HTMLArea itself.
-# This notice MUST stay intact for use (see license.txt).
-#
-# $Id: spell-check-logic.cgi,v 1.5 2004/08/11 09:26:38 e107coders Exp $
-
-use strict;
-use utf8;
-use Encode;
-use Text::Aspell;
-use XML::DOM;
-use CGI;
-
-my $TIMER_start = undef;
-eval {
-    use Time::HiRes qw( gettimeofday tv_interval );
-    $TIMER_start = [gettimeofday()];
-};
-# use POSIX qw( locale_h );
-
-binmode STDIN, ':utf8';
-binmode STDOUT, ':utf8';
-
-my $debug = 0;
-
-my $speller = new Text::Aspell;
-my $cgi = new CGI;
-
-my $total_words = 0;
-my $total_mispelled = 0;
-my $total_suggestions = 0;
-my $total_words_suggested = 0;
-
-# FIXME: report a nice error...
-die "Can't create speller!" unless $speller;
-
-my $dict = $cgi->param('dictionary') || $cgi->cookie('dictionary') || 'en';
-
-# add configurable option for this
-$speller->set_option('lang', $dict);
-$speller->set_option('encoding', 'UTF-8');
-#setlocale(LC_CTYPE, $dict);
-
-# ultra, fast, normal, bad-spellers
-# bad-spellers seems to cause segmentation fault
-$speller->set_option('sug-mode', 'normal');
-
-my %suggested_words = ();
-keys %suggested_words = 128;
-
-my $file_content = decode('UTF-8', $cgi->param('content'));
-$file_content = parse_with_dom($file_content);
-
-my $ck_dictionary = $cgi->cookie(-name     => 'dictionary',
-                                 -value    => $dict,
-                                 -expires  => '+30d');
-
-print $cgi->header(-type    => 'text/html; charset: utf-8',
-                   -cookie  => $ck_dictionary);
-
-my $js_suggested_words = make_js_hash(\%suggested_words);
-my $js_spellcheck_info = make_js_hash_from_array
-  ([
-    [ 'Total words'           , $total_words ],
-    [ 'Mispelled words'       , $total_mispelled . ' in dictionary \"'.$dict.'\"' ],
-    [ 'Total suggestions'     , $total_suggestions ],
-    [ 'Total words suggested' , $total_words_suggested ],
-    [ 'Spell-checked in'      , defined $TIMER_start ? (tv_interval($TIMER_start) . ' seconds') : 'n/a' ]
-   ]);
-
-print qq^<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="stylesheet" type="text/css" media="all" href="spell-check-style.css" />
-<script type="text/javascript">
-  var suggested_words = { $js_suggested_words };
-  var spellcheck_info = { $js_spellcheck_info }; </script>
-</head>
-<body onload="window.parent.finishedSpellChecking();">^;
-
-print $file_content;
-if ($cgi->param('init') eq '1') {
-    my @dicts = $speller->dictionary_info();
-    my $dictionaries = '';
-    foreach my $i (@dicts) {
-        next if $i->{jargon};
-        my $name = $i->{name};
-        if ($name eq $dict) {
-            $name = '@'.$name;
-        }
-        $dictionaries .= ',' . $name;
-    }
-    $dictionaries =~ s/^,//;
-    print qq^<div id="HA-spellcheck-dictionaries">$dictionaries</div>^;
-}
-
-print '</body></html>';
-
-# Perl is beautiful.
-sub spellcheck {
-    my $node = shift;
-    my $doc = $node->getOwnerDocument;
-    my $check = sub {                 # called for each word in the text
-        # input is in UTF-8
-        my $word = shift;
-        my $already_suggested = defined $suggested_words{$word};
-        ++$total_words;
-        if (!$already_suggested && $speller->check($word)) {
-            return undef;
-        } else {
-            # we should have suggestions; give them back to browser in UTF-8
-            ++$total_mispelled;
-            if (!$already_suggested) {
-                # compute suggestions for this word
-                my @suggestions = $speller->suggest($word);
-                my $suggestions = decode($speller->get_option('encoding'), join(',', @suggestions));
-                $suggested_words{$word} = $suggestions;
-                ++$total_suggestions;
-                $total_words_suggested += scalar @suggestions;
-            }
-            # HA-spellcheck-error
-            my $err = $doc->createElement('span');
-            $err->setAttribute('class', 'HA-spellcheck-error');
-            my $tmp = $doc->createTextNode;
-            $tmp->setNodeValue($word);
-            $err->appendChild($tmp);
-            return $err;
-        }
-    };
-    while ($node->getNodeValue =~ /([\p{IsWord}']+)/) {
-        my $word = $1;
-        my $before = $`;
-        my $after = $';
-        my $df = &$check($word);
-        if (!$df) {
-            $before .= $word;
-        }
-        {
-            my $parent = $node->getParentNode;
-            my $n1 = $doc->createTextNode;
-            $n1->setNodeValue($before);
-            $parent->insertBefore($n1, $node);
-            $parent->insertBefore($df, $node) if $df;
-            $node->setNodeValue($after);
-        }
-    }
-};
-
-sub check_inner_text {
-    my $node = shift;
-    my $text = '';
-    for (my $i = $node->getFirstChild; defined $i; $i = $i->getNextSibling) {
-        if ($i->getNodeType == TEXT_NODE) {
-            spellcheck($i);
-        }
-    }
-};
-
-sub parse_with_dom {
-    my ($text) = @_;
-    $text = '<spellchecker>'.$text.'</spellchecker>';
-
-    my $parser = new XML::DOM::Parser;
-    if ($debug) {
-        open(FOO, '>:utf8', '/tmp/foo');
-        print FOO $text;
-        close FOO;
-    }
-    my $doc = $parser->parse($text);
-    my $nodes = $doc->getElementsByTagName('*');
-    my $n = $nodes->getLength;
-
-    for (my $i = 0; $i < $n; ++$i) {
-        my $node = $nodes->item($i);
-        if ($node->getNodeType == ELEMENT_NODE) {
-            check_inner_text($node);
-        }
-    }
-
-    my $ret = $doc->toString;
-    $ret =~ s{<spellchecker>(.*)</spellchecker>}{$1}sg;
-    return $ret;
-};
-
-sub make_js_hash {
-    my ($hash) = @_;
-    my $js_hash = '';
-    while (my ($key, $val) = each %$hash) {
-        $js_hash .= ',' if $js_hash;
-        $js_hash .= '"'.$key.'":"'.$val.'"';
-    }
-    return $js_hash;
-};
-
-sub make_js_hash_from_array {
-    my ($array) = @_;
-    my $js_hash = '';
-    foreach my $i (@$array) {
-        $js_hash .= ',' if $js_hash;
-        $js_hash .= '"'.$i->[0].'":"'.$i->[1].'"';
-    }
-    return $js_hash;
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-style.css 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-style.css
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-style.css	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,10 +0,0 @@
-.HA-spellcheck-error { border-bottom: 1px dashed #f00; cursor: default; }
-.HA-spellcheck-same { background-color: #cef; color: #000; }
-.HA-spellcheck-hover { background-color: #433; color: white; }
-.HA-spellcheck-fixed { border-bottom: 1px dashed #0b8; }
-.HA-spellcheck-current { background-color: #9be; color: #000; }
-.HA-spellcheck-suggestions { display: none; }
-
-#HA-spellcheck-dictionaries { display: none; }
-
-a:link, a:visited { color: #55e; }
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-ui.html 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-ui.html
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-ui.html	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-ui.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,122 +0,0 @@
-<!--
-
-  Strangely, IE sucks with or without the DOCTYPE switch.
-  I thought it would only suck without it.
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
-    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-
-   Spell Checker Plugin for HTMLArea-3.0
-   Sponsored by www.americanbible.org
-   Implementation by Mihai Bazon, http://dynarch.com/mishoo/
-  
-   (c) dynarch.com 2003.
-   Distributed under the same terms as HTMLArea itself.
-   This notice MUST stay intact for use (see license.txt).
-
-   $Id: spell-check-ui.html,v 1.5 2004/08/11 09:26:38 e107coders Exp $
-
--->
-<html xmlns="http://www.w3.org/1999/xhtml">
-
-  <head>
-    <title>Spell Checker</title>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <script type="text/javascript" src="spell-check-ui.js"></script>
-
-    <style type="text/css">
-      html, body { height: 100%; margin: 0px; padding: 0px; background-color: #fff;
-      color: #000; }
-      a:link, a:visited { color: #00f; text-decoration: none; }
-      a:hover { color: #f00; text-decoration: underline; }
-
-      table { background-color: ButtonFace; color: ButtonText;
-      font-family: tahoma,verdana,sans-serif; font-size: 11px; }
-
-      iframe { background-color: #fff; color: #000; height: 100%; width: 100%; }
-
-      .controls { width: 13em; }
-      .controls .sectitle { /* background-color: #736c6c; color: #fff;
-      border-top: 1px solid #000; border-bottom: 1px solid #fff; */
-      text-align: center;
-      font-weight: bold; padding: 2px 4px; }
-      .controls .secbody { margin-bottom: 10px; }
-
-      button, select { font-family: tahoma,verdana,sans-serif; font-size: 11px; }
-      button { width: 6em; padding: 0px; }
-
-      input, select { font-family: fixed,"andale mono",monospace; }
-
-      #v_currentWord { color: #f00; font-weight: bold; }
-      #statusbar { padding: 7px 0px 0px 5px; }
-      #status { font-weight: bold; }
-    </style>
-
-  </head>
-
-  <body onload="initDocument()">
-
-    <form style="display: none;" action="spell-check-logic.cgi"
-          method="post" target="framecontent"
-          accept-charset="UTF-8"
-          ><input type="hidden" name="content" id="f_content"
-          /><input type="hidden" name="dictionary" id="f_dictionary"
-          /><input type="hidden" name="init" id="f_init" value="1"
-    /></form>
-
-    <table style="height: 100%; width: 100%; border-collapse: collapse;" cellspacing="0" cellpadding="0">
-      <tr>
-        <td colspan="2" style="height: 1em; padding: 2px;">
-          <div style="float: right; padding: 2px;"><span>Dictionary</span>
-            <select id="v_dictionaries" style="width: 10em"></select>
-            <button id="b_recheck">Re-check</button>
-          </div>
-          <span id="status">Please wait.  Calling spell checker.</span>
-        </td>
-      </tr>
-      <tr>
-        <td valign="top" class="controls">
-          <div class="secbody" style="text-align: center">
-            <button id="b_info">Info</button>
-          </div>
-          <div class="sectitle">Original word</div>
-          <div class="secbody" id="v_currentWord" style="text-align:
-          center; margin-bottom: 0px;">pliz weit ;-)</div>
-          <div class="secbody" style="text-align: center">
-            <button id="b_revert">Revert</button>
-          </div>
-          <div class="sectitle">Replace with</div>
-          <div class="secbody">
-            <input type="text" id="v_replacement" style="width: 94%; margin-left: 3%;" /><br />
-            <div style="text-align: center; margin-top: 2px;">
-              <button id="b_replace">Replace</button><button
-                id="b_replall">Replace all</button><br /><button
-                id="b_ignore">Ignore</button><button
-                id="b_ignall">Ignore all</button>
-            </div>
-          </div>
-          <div class="sectitle">Suggestions</div>
-          <div class="secbody">
-            <select size="11" style="width: 94%; margin-left: 3%;" id="v_suggestions"></select>
-          </div>
-        </td>
-
-        <td>
-          <iframe src="about:blank" width="100%" height="100%"
-            id="i_framecontent" name="framecontent"></iframe>
-        </td>
-      </tr>
-      <tr>
-        <td style="height: 1em;" colspan="2">
-          <div style="padding: 4px 2px 2px 2px; float: right;">
-            <button id="b_ok">OK</button>
-            <button id="b_cancel">Cancel</button>
-          </div>
-          <div id="statusbar"></div>
-        </td>
-      </tr>
-    </table>
-
-  </body>
-
-</html>
diff -ruN 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-ui.js 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-ui.js
--- 6171/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-ui.js	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/SpellChecker/spell-check-ui.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,397 +0,0 @@
-// Spell Checker Plugin for HTMLArea-3.0
-// Sponsored by www.americanbible.org
-// Implementation by Mihai Bazon, http://dynarch.com/mishoo/
-//
-// (c) dynarch.com 2003.
-// Distributed under the same terms as HTMLArea itself.
-// This notice MUST stay intact for use (see license.txt).
-//
-// $Id: spell-check-ui.js,v 1.5 2004/08/11 09:26:38 e107coders Exp $
-
-// internationalization file was already loaded in parent ;-)
-var SpellChecker = window.opener.SpellChecker;
-var i18n = SpellChecker.I18N;
-
-var HTMLArea = window.opener.HTMLArea;
-var is_ie = HTMLArea.is_ie;
-var editor = SpellChecker.editor;
-var frame = null;
-var currentElement = null;
-var wrongWords = null;
-var modified = false;
-var allWords = {};
-var fixedWords = [];
-var suggested_words = {};
-
-function makeCleanDoc(leaveFixed) {
-	// document.getElementById("status").innerHTML = 'Please wait: rendering valid HTML';
-	var words = wrongWords.concat(fixedWords);
-	for (var i = words.length; --i >= 0;) {
-		var el = words[i];
-		if (!(leaveFixed && /HA-spellcheck-fixed/.test(el.className))) {
-			el.parentNode.insertBefore(el.firstChild, el);
-			el.parentNode.removeChild(el);
-		} else
-			el.className = "HA-spellcheck-fixed";
-	}
-	// we should use innerHTML here, but IE6's implementation fucks up the
-	// HTML to such extent that our poor Perl parser doesn't understand it
-	// anymore.
-	return window.opener.HTMLArea.getHTML(frame.contentWindow.document.body, false, editor);
-};
-
-function recheckClicked() {
-	document.getElementById("status").innerHTML = i18n["Please wait: changing dictionary to"] + ': "' + document.getElementById("f_dictionary").value + '".';
-	var field = document.getElementById("f_content");
-	field.value = makeCleanDoc(true);
-	field.form.submit();
-};
-
-function saveClicked() {
-	if (modified) {
-		editor.setHTML(makeCleanDoc(false));
-	}
-	window.close();
-	return false;
-};
-
-function cancelClicked() {
-	var ok = true;
-	if (modified) {
-		ok = confirm(i18n["QUIT_CONFIRMATION"]);
-	}
-	if (ok) {
-		window.close();
-	}
-	return false;
-};
-
-function replaceWord(el) {
-	var replacement = document.getElementById("v_replacement").value;
-	var this_word_modified = (el.innerHTML != replacement);
-	if (this_word_modified)
-		modified = true;
-	if (el) {
-		el.className = el.className.replace(/\s*HA-spellcheck-(hover|fixed)\s*/g, " ");
-	}
-	el.className += " HA-spellcheck-fixed";
-	el.__msh_fixed = true;
-	if (!this_word_modified) {
-		return false;
-	}
-	el.innerHTML = replacement;
-};
-
-function replaceClicked() {
-	replaceWord(currentElement);
-	var start = currentElement.__msh_id;
-	var index = start;
-	do {
-		++index;
-		if (index == wrongWords.length) {
-			index = 0;
-		}
-	} while ((index != start) && wrongWords[index].__msh_fixed);
-	if (index == start) {
-		index = 0;
-		alert(i18n["Finished list of mispelled words"]);
-	}
-	wrongWords[index].__msh_wordClicked(true);
-	return false;
-};
-
-function revertClicked() {
-	document.getElementById("v_replacement").value = currentElement.__msh_origWord;
-	replaceWord(currentElement);
-	currentElement.className = "HA-spellcheck-error HA-spellcheck-current";
-	return false;
-};
-
-function replaceAllClicked() {
-	var replacement = document.getElementById("v_replacement").value;
-	var ok = true;
-	var spans = allWords[currentElement.__msh_origWord];
-	if (spans.length == 0) {
-		alert("An impossible condition just happened.  Call FBI.  ;-)");
-	} else if (spans.length == 1) {
-		replaceClicked();
-		return false;
-	}
-	/*
-	var message = "The word \"" + currentElement.__msh_origWord + "\" occurs " + spans.length + " times.\n";
-	if (replacement == currentElement.__msh_origWord) {
-		ok = confirm(message + "Ignore all occurrences?");
-	} else {
-		ok = confirm(message + "Replace all occurrences with \"" + replacement + "\"?");
-	}
-	*/
-	if (ok) {
-		for (var i = 0; i < spans.length; ++i) {
-			if (spans[i] != currentElement) {
-				replaceWord(spans[i]);
-			}
-		}
-		// replace current element the last, so that we jump to the next word ;-)
-		replaceClicked();
-	}
-	return false;
-};
-
-function ignoreClicked() {
-	document.getElementById("v_replacement").value = currentElement.__msh_origWord;
-	replaceClicked();
-	return false;
-};
-
-function ignoreAllClicked() {
-	document.getElementById("v_replacement").value = currentElement.__msh_origWord;
-	replaceAllClicked();
-	return false;
-};
-
-function learnClicked() {
-	alert("Not [yet] implemented");
-	return false;
-};
-
-function internationalizeWindow() {
-	var types = ["div", "span", "button"];
-	for (var i = 0; i < types.length; ++i) {
-		var tag = types[i];
-		var els = document.getElementsByTagName(tag);
-		for (var j = els.length; --j >= 0;) {
-			var el = els[j];
-			if (el.childNodes.length == 1 && /\S/.test(el.innerHTML)) {
-				var txt = el.innerHTML;
-				if (typeof i18n[txt] != "undefined") {
-					el.innerHTML = i18n[txt];
-				}
-			}
-		}
-	}
-};
-
-function initDocument() {
-	internationalizeWindow();
-	modified = false;
-	frame = document.getElementById("i_framecontent");
-	var field = document.getElementById("f_content");
-	field.value = HTMLArea.getHTML(editor._doc.body, false, editor);
-	field.form.submit();
-	document.getElementById("f_init").value = "0";
-
-	// assign some global event handlers
-
-	var select = document.getElementById("v_suggestions");
-	select.onchange = function() {
-		document.getElementById("v_replacement").value = this.value;
-	};
-	if (is_ie) {
-		select.attachEvent("ondblclick", replaceClicked);
-	} else {
-		select.addEventListener("dblclick", replaceClicked, true);
-	}
-
-	document.getElementById("b_replace").onclick = replaceClicked;
-	// document.getElementById("b_learn").onclick = learnClicked;
-	document.getElementById("b_replall").onclick = replaceAllClicked;
-	document.getElementById("b_ignore").onclick = ignoreClicked;
-	document.getElementById("b_ignall").onclick = ignoreAllClicked;
-	document.getElementById("b_recheck").onclick = recheckClicked;
-	document.getElementById("b_revert").onclick = revertClicked;
-	document.getElementById("b_info").onclick = displayInfo;
-
-	document.getElementById("b_ok").onclick = saveClicked;
-	document.getElementById("b_cancel").onclick = cancelClicked;
-
-	select = document.getElementById("v_dictionaries");
-	select.onchange = function() {
-		document.getElementById("f_dictionary").value = this.value;
-	};
-};
-
-function getAbsolutePos(el) {
-	var r = { x: el.offsetLeft, y: el.offsetTop };
-	if (el.offsetParent) {
-		var tmp = getAbsolutePos(el.offsetParent);
-		r.x += tmp.x;
-		r.y += tmp.y;
-	}
-	return r;
-};
-
-function wordClicked(scroll) {
-	var self = this;
-	if (scroll) (function() {
-		var pos = getAbsolutePos(self);
-		var ws = { x: frame.offsetWidth - 4,
-			   y: frame.offsetHeight - 4 };
-		var wp = { x: frame.contentWindow.document.body.scrollLeft,
-			   y: frame.contentWindow.document.body.scrollTop };
-		pos.x -= Math.round(ws.x/2);
-		if (pos.x < 0) pos.x = 0;
-		pos.y -= Math.round(ws.y/2);
-		if (pos.y < 0) pos.y = 0;
-		frame.contentWindow.scrollTo(pos.x, pos.y);
-	})();
-	if (currentElement) {
-		var a = allWords[currentElement.__msh_origWord];
-		currentElement.className = currentElement.className.replace(/\s*HA-spellcheck-current\s*/g, " ");
-		for (var i = 0; i < a.length; ++i) {
-			var el = a[i];
-			if (el != currentElement) {
-				el.className = el.className.replace(/\s*HA-spellcheck-same\s*/g, " ");
-			}
-		}
-	}
-	currentElement = this;
-	this.className += " HA-spellcheck-current";
-	var a = allWords[currentElement.__msh_origWord];
-	for (var i = 0; i < a.length; ++i) {
-		var el = a[i];
-		if (el != currentElement) {
-			el.className += " HA-spellcheck-same";
-		}
-	}
-	// document.getElementById("b_replall").disabled = (a.length <= 1);
-	// document.getElementById("b_ignall").disabled = (a.length <= 1);
-	var txt;
-	if (a.length == 1) {
-		txt = "one occurrence";
-	} else if (a.length == 2) {
-		txt = "two occurrences";
-	} else {
-		txt = a.length + " occurrences";
-	}
-	var suggestions = suggested_words[this.__msh_origWord];
-	if (suggestions)
-		suggestions = suggestions.split(/,/);
-	else
-		suggestions = [];
-	var select = document.getElementById("v_suggestions");
-	document.getElementById("statusbar").innerHTML = "Found " + txt +
-		' for word "<b>' + currentElement.__msh_origWord + '</b>"';
-	for (var i = select.length; --i >= 0;) {
-		select.remove(i);
-	}
-	for (var i = 0; i < suggestions.length; ++i) {
-		var txt = suggestions[i];
-		var option = document.createElement("option");
-		option.value = txt;
-		option.appendChild(document.createTextNode(txt));
-		select.appendChild(option);
-	}
-	document.getElementById("v_currentWord").innerHTML = this.__msh_origWord;
-	if (suggestions.length > 0) {
-		select.selectedIndex = 0;
-		select.onchange();
-	} else {
-		document.getElementById("v_replacement").value = this.innerHTML;
-	}
-	select.style.display = "none";
-	select.style.display = "block";
-	return false;
-};
-
-function wordMouseOver() {
-	this.className += " HA-spellcheck-hover";
-};
-
-function wordMouseOut() {
-	this.className = this.className.replace(/\s*HA-spellcheck-hover\s*/g, " ");
-};
-
-function displayInfo() {
-	var info = frame.contentWindow.spellcheck_info;
-	if (!info)
-		alert("No information available");
-	else {
-		var txt = "** Document information **";
-		for (var i in info) {
-			txt += "\n" + i + " : " + info[i];
-		}
-		alert(txt);
-	}
-	return false;
-};
-
-function finishedSpellChecking() {
-	// initialization of global variables
-	currentElement = null;
-	wrongWords = null;
-	allWords = {};
-	fixedWords = [];
-	suggested_words = frame.contentWindow.suggested_words;
-
-	document.getElementById("status").innerHTML = "HTMLArea Spell Checker (<a href='readme-tech.html' target='_blank' title='Technical information'>info</a>)";
-	var doc = frame.contentWindow.document;
-        var spans = doc.getElementsByTagName("span");
-        var sps = [];
-	var id = 0;
-        for (var i = 0; i < spans.length; ++i) {
-                var el = spans[i];
-                if (/HA-spellcheck-error/.test(el.className)) {
-                        sps.push(el);
-			el.__msh_wordClicked = wordClicked;
-			el.onclick = function(ev) {
-				ev || (ev = window.event);
-				ev && HTMLArea._stopEvent(ev);
-				return this.__msh_wordClicked(false);
-			};
-			el.onmouseover = wordMouseOver;
-			el.onmouseout = wordMouseOut;
-			el.__msh_id = id++;
-			var txt = (el.__msh_origWord = el.firstChild.data);
-			el.__msh_fixed = false;
-			if (typeof allWords[txt] == "undefined") {
-				allWords[txt] = [el];
-			} else {
-				allWords[txt].push(el);
-			}
-                } else if (/HA-spellcheck-fixed/.test(el.className)) {
-			fixedWords.push(el);
-		}
-        }
-	wrongWords = sps;
-	if (sps.length == 0) {
-		if (!modified) {
-			alert(i18n["NO_ERRORS_CLOSING"]);
-			window.close();
-		} else {
-			alert(i18n["NO_ERRORS"]);
-		}
-		return false;
-	}
-	(currentElement = sps[0]).__msh_wordClicked(true);
-	var as = doc.getElementsByTagName("a");
-	for (var i = as.length; --i >= 0;) {
-		var a = as[i];
-		a.onclick = function() {
-			if (confirm(i18n["CONFIRM_LINK_CLICK"] + ":\n" +
-				    this.href + "\n" + i18n["I will open it in a new page."])) {
-				window.open(this.href);
-			}
-			return false;
-		};
-	}
-	var dicts = doc.getElementById("HA-spellcheck-dictionaries");
-	if (dicts) {
-		dicts.parentNode.removeChild(dicts);
-		dicts = dicts.innerHTML.split(/,/);
-		var select = document.getElementById("v_dictionaries");
-		for (var i = select.length; --i >= 0;) {
-			select.remove(i);
-		}
-		for (var i = 0; i < dicts.length; ++i) {
-			var txt = dicts[i];
-			var option = document.createElement("option");
-			if (/^@(.*)$/.test(txt)) {
-				txt = RegExp.$1;
-				option.selected = true;
-			}
-			option.value = txt;
-			option.appendChild(document.createTextNode(txt));
-			select.appendChild(option);
-		}
-	}
-};
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/cell-delete.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/cell-delete.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/cell-insert-after.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/cell-insert-after.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/cell-insert-before.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/cell-insert-before.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/cell-merge.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/cell-merge.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/cell-prop.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/cell-prop.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/cell-split.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/cell-split.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/col-delete.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/col-delete.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/col-insert-after.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/col-insert-after.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/col-insert-before.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/col-insert-before.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/col-split.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/col-split.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/row-delete.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/row-delete.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/row-insert-above.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/row-insert-above.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/row-insert-under.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/row-insert-under.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/row-prop.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/row-prop.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/row-split.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/row-split.gif differ
Files 6171/e107_handlers/htmlarea/plugins/TableOperations/img/table-prop.gif and 75/e107_handlers/htmlarea/plugins/TableOperations/img/table-prop.gif differ
diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/cz.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/cz.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/cz.js	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/cz.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-﻿// I18N constants

-

-// LANG: "cz", ENCODING: UTF-8 | ISO-8859-2

-// Author: Jiri Löw, <jirilow@jirilow.com>

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-TableOperations.I18N = {

-	"Align":					  "Zarovnání",

-	"All four sides":				  "Všechny čtyři strany",

-	"Background":					  "Pozadí",

-	"Baseline":                                       "Základní linka",

-	"Border":					  "Obrys",

-	"Borders":					  "Obrysy",

-	"Bottom":                                         "Dolů",

-	"CSS Style":					  "Kaskádové styly (CSS)",

-	"Caption":					  "Titulek",

-	"Cell Properties":                                "Vlastnosti buňky",

-	"Center":					  "Na střed",

-	"Char":                                           "Znak",

-	"Collapsed borders":                              "Stlačené okraje",

-	"Color":					  "Barva",

-	"Description":					  "Popis",

-	"FG Color":					  "Barva popředí",

-	"Float":                                          "Obtékání",

-	"Frames":					  "Rámečky",

-	"Height":                                         "Výška",

-	"How many columns would you like to merge?":      "Kolik sloupců si přejete spojit?",

-	"How many rows would you like to merge?":         "Kolik řádků si přejete spojit?",

-	"Image URL":					  "Adresa obrázku",

-	"Justify":                                        "Do stran",

-	"Layout":					  "Rozložení",

-	"Left":						  "Vlevo",

-	"Margin":                                         "Okraj",

-	"Middle":                                         "Na střed",

-	"No rules":					  "Žádné čáry",

-	"No sides":					  "Žádné strany",

-	"None":                                           "Žádné",

-	"Padding":					  "Odsazování",

-	"Please click into some cell":                    "Prosím klikněte do některé buňky",

-	"Right":					  "Vpravo",

-	"Row Properties":                                 "Vlastnosti řádku",

-	"Rules will appear between all rows and columns": "Čáry mezi všemi řádky i sloupci",

-	"Rules will appear between columns only":	  "Čáry pouze mezi sloupci",

-	"Rules will appear between rows only":		  "Čáry pouze mezi řádky",

-	"Rules":					  "Čáry",

-	"Spacing and padding":                            "Mezery a odsazování",

-	"Spacing":					  "Mezery",

-	"Summary":					  "Shrnutí",

-	"TO-cell-delete":				  "Smazat buňku",

-	"TO-cell-insert-after":				  "Vložit buňku za",

-	"TO-cell-insert-before":			  "Vložit buňku před",

-	"TO-cell-merge":				  "Spojit buňky",

-	"TO-cell-prop":					  "Vlastnosti buňky",

-	"TO-cell-split":				  "Rozdělit buňku",

-	"TO-col-delete":				  "Smazat sloupec",

-	"TO-col-insert-after":				  "Vložit sloupec za",

-	"TO-col-insert-before":				  "Vložit sloupec před",

-	"TO-col-split":					  "Rozdělit sloupec",

-	"TO-row-delete":				  "Smazat řádek",

-	"TO-row-insert-above":				  "Smazat řádek nad",

-	"TO-row-insert-under":				  "Smazat řádek pod",

-	"TO-row-prop":					  "Vlastnosti řádku",

-	"TO-row-split":					  "Rozdělit řádek",

-	"TO-table-prop":				  "Vlastnosti tabulky",

-	"Table Properties":				  "Vlastnosti tabulky",

-	"Text align":                                     "Zarovnání textu",

-	"The bottom side only":				  "Pouze spodní strana",

-	"The left-hand side only":			  "Pouze levá strana",

-	"The right and left sides only":		  "Pouze levá a pravá strana",

-	"The right-hand side only":			  "Pouze pravá strana",

-	"The top and bottom sides only":		  "Pouze horní a dolní strana",

-	"The top side only":				  "Pouze horní strana",

-	"Top":                                            "Nahoru",	

-	"Unset color":                                    "Zrušit barvu",

-	"Vertical align":                                 "Svislé zarovnání",

-	"Width":					  "Šířka",

-	"not-del-last-cell":				  "HTMLArea zbaběle odmítá smazat poslední buňku v řádku.",

-	"not-del-last-col":				  "HTMLArea zbaběle odmítá smazat poslední sloupec v tabulce.",

-	"not-del-last-row":				  "HTMLArea zbaběle odmítá smazat poslední řádek v tabulce.",

-	"percent":					  "procent",

-	"pixels":					  "pixelů"

-};

diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/da.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/da.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/da.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/da.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-﻿// I18N constants
-
-// LANG: "da", ENCODING: UTF-8 | ISO-8859-1
-// Author: Steen Sønderup, <steen@soenderup.com>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-TableOperations.I18N = {
-	"Align":											"Placer",
-	"All four sides":									"Alle fire sider",
-	"Background":										"Baggrund",
-	"Baseline":											"Bundlinie",
-	"Border":											"Kant",
-	"Borders":											"Kanter",
-	"Bottom":											"Bund",
-	"CSS Style":										"Stil [CSS]",
-	"Caption":											"Titel",
-	"Cell Properties":									"Celle egenskaber",
-	"Center":											"Centrer",
-	"Char":												"Plads",
-	"Collapsed borders":								"Sammensmelt rammer",
-	"Color":											"Farve",
-	"Description":										"Beskrivelse",
-	"FG Color":											"Font farve",
-	"Float":											"Justering",
-	"Frames":											"Udvendig",
-	"Height":											"Højde",
-	"How many columns would you like to merge?":		"Hvor mange kollonner vil du samle?",
-	"How many rows would you like to merge?":			"Hvor mange rækker vil du samle?",
-	"Image URL":										"Billede URL",
-	"Justify":											"Lige margener",
-	"Layout":											"Opsætning",
-	"Left":												"Venstre",
-	"Margin":											"Margen",
-	"Middle":											"Centrer",
-	"No rules":											"Ingen rammer",
-	"No sides":											"Ingen sider",
-	"None":												"Ingen",
-	"Padding":											"Margen",
-	"Please click into some cell":						"Klik på en celle",
-	"Right":											"Højre",
-	"Row Properties":									"Række egenskaber",
-	"Rules will appear between all rows and columns":	"Rammer mellem rækker og kolonner",
-	"Rules will appear between columns only":			"Kun rammer mellem kolonner",
-	"Rules will appear between rows only":				"Kun rammer mellem rækker",
-	"Rules":											"Invendig",
-	"Spacing and padding":								"Afstand og margen",
-	"Spacing":											"Afstand",
-	"Summary":											"Beskrivelse",
-	"TO-cell-delete":									"Slet celle",
-	"TO-cell-insert-after":								"Indsæt celle efter",
-	"TO-cell-insert-before":							"Indsæt celle før",
-	"TO-cell-merge":									"Sammensæt celler",
-	"TO-cell-prop":										"Celle egenskaber",
-	"TO-cell-split":									"Opdel celle",
-	"TO-col-delete":									"Slet kollonne",
-	"TO-col-insert-after":								"Indsæt kolonne efter",
-	"TO-col-insert-before":								"Indsæt kolonne før",
-	"TO-col-split":										"Opdel kolonne",
-	"TO-row-delete":									"Slet række",
-	"TO-row-insert-above":								"Indsæt række før",
-	"TO-row-insert-under":								"Indsæt række efter",
-	"TO-row-prop":										"Række egenskaber",
-	"TO-row-split":										"Opdel række",
-	"TO-table-prop":									"Tabel egenskaber",
-	"Table Properties":									"Tabel egenskaber",
-	"Text align":										"Tekst",
-	"The bottom side only":								"Kun i bunden",
-	"The left-hand side only":							"Kun i højre side",
-	"The right and left sides only":					"Kun i siderne",
-	"The right-hand side only":							"Kun i venstre side",
-	"The top and bottom sides only":					"Kun i top og bund",
-	"The top side only":								"Kun i toppen",
-	"Top":												"Top",	
-	"Unset color":										"Farve ikke valgt",
-	"Vertical align":									"Vertikal placering",
-	"Width":											"Bredde",
-	"not-del-last-cell":								"Du kan ikke slette den sidste celle i en række.",
-	"not-del-last-col":									"Du kan ikke slette den sidste kolonne i en tabel.",
-	"not-del-last-row":									"Du kan ikke slette den sidste række i en tabel.",
-	"percent":											"procent",
-	"pixels":											"pixel"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/de.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/de.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/de.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/de.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,81 +0,0 @@
-// I18N constants
-
-// LANG: "de", ENCODING: UTF-8 | ISO-8859-1
-// Author: broxx, <broxx@broxx.com>
-
-TableOperations.I18N = {
-	"Align":					  "Ausrichten",
-	"All four sides":				  "Alle 4 Seiten",
-	"Background":					  "Hintergrund",
-	"Baseline":                                       "Basislinie",
-	"Border":					  "Rand",
-	"Borders":					  "Raender",
-	"Bottom":                                         "Unten",
-	"CSS Style":					  "Style [CSS]",
-	"Caption":					  "Ueberschrift",
-	"Cell Properties":                                "Zellen",
-	"Center":					  "Zentrieren",
-	"Char":                                           "Zeichen",
-	"Collapsed borders":                              "Collapsed borders",
-	"Color":					  "Farbe",
-	"Description":					  "Beschreibung",
-	"FG Color":					  "FG Farbe",
-	"Float":                                          "Ausrichtung",
-	"Frames":					  "Rahmen",
-	"Height":                                         "Hoehe",
-	"How many columns would you like to merge?":      "Wieviele Spalten willst du verbinden?",
-	"How many rows would you like to merge?":         "Wieviele Zeilen willst du verbinden?",
-	"Image URL":					  "Bild URL",
-	"Justify":                                        "Justieren",
-	"Layout":					  "Layout",
-	"Left":						  "Links",
-	"Margin":                                         "Rand",
-	"Middle":                                         "Mitte",
-	"No rules":					  "Keine Balken",
-	"No sides":					  "Keine Seiten",
-	"None":                                           "Keine",
-	"Padding":					  "Auffuellung",
-	"Please click into some cell":                    "Waehle eine Zelle",
-	"Right":					  "Rechts",
-	"Row Properties":                                 "Reihen",
-	"Rules will appear between all rows and columns": "Balken zwischen Reihen und Spalten",
-	"Rules will appear between columns only":	  "Balken zwischen Spalten",
-	"Rules will appear between rows only":		  "Balken zwischen Reihen",
-	"Rules":					  "Balken",
-	"Spacing and padding":                            "Abstaende",
-	"Spacing":					  "Abstand",
-	"Summary":					  "Zusammenfassung",
-	"TO-cell-delete":				  "Zelle loeschen",
-	"TO-cell-insert-after":				  "Zelle einfuegen nach",
-	"TO-cell-insert-before":			  "Zelle einfuegen bevor",
-	"TO-cell-merge":				  "Zellen zusammenfuegen",
-	"TO-cell-prop":					  "Zelleinstellungen",
-	"TO-cell-split":				  "Zellen aufteilen",
-	"TO-col-delete":				  "Spalte loeschen",
-	"TO-col-insert-after":				  "Spalte einfuegen nach",
-	"TO-col-insert-before":				  "Spalte einfuegen bevor",
-	"TO-col-split":					  "Spalte aufteilen",
-	"TO-row-delete":				  "Reihe loeschen",
-	"TO-row-insert-above":				  "Reihe einfuegen vor",
-	"TO-row-insert-under":				  "Reihe einfuegen nach",
-	"TO-row-prop":					  "Reiheneinstellungen",
-	"TO-row-split":					  "Reihen aufteilen",
-	"TO-table-prop":				  "Tabelle",
-	"Table Properties":				  "Tabelle",
-	"Text align":                                     "Ausrichtung",
-	"The bottom side only":				  "Nur untere Seite",
-	"The left-hand side only":			  "Nur linke Seite",
-	"The right and left sides only":		  "Nur linke und rechte Seite",
-	"The right-hand side only":			  "Nur rechte Seite",
-	"The top and bottom sides only":		  "Nur obere und untere Seite",
-	"The top side only":				  "Nur obere Seite",
-	"Top":                                            "Oben",	
-	"Unset color":                                    "Farbe",
-	"Vertical align":                                 "Ausrichtung",
-	"Width":					  "Breite",
-	"not-del-last-cell":				  "Letzte Zelle in dieser Reihe!",
-	"not-del-last-col":				  "Letzte Spalte in dieser Tabelle!",
-	"not-del-last-row":				  "Letzte Reihe in dieser Tabelle",
-	"percent":					  "%",
-	"pixels":					  "pixels"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/el.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/el.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/el.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/el.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,81 +0,0 @@
-// I18N constants
-
-// LANG: "el", ENCODING: UTF-8 | ISO-8859-7
-// Author: Dimitris Glezos, dimitris@glezos.com
-
-TableOperations.I18N = {
-	"Align":					  "Στοίχηση",
-	"All four sides":				  "Και οι 4 πλευρές",
-	"Background":					  "Φόντο",
-	"Baseline":                                       "Baseline",
-	"Border":					  "Περίγραμμα",
-	"Borders":					  "Περιγράμματα",
-	"Bottom":                                         "Κάτω μέρος",
-	"CSS Style":					  "Στυλ [CSS]",
-	"Caption":					  "Λεζάντα",
-	"Cell Properties":                                "Ιδιότητες Κελιού",
-	"Center":					  "Κέντρο",
-	"Char":                                           "Χαρακτήρας",
-	"Collapsed borders":                              "Συμπτυγμένα περιγράμματα",
-	"Color":					  "Χρώμα",
-	"Description":					  "Περιγραφή",
-	"FG Color":					  "Χρώμα αντικειμένων",
-	"Float":                                          "Float",
-	"Frames":					  "Frames",
-	"Height":                                         "Ύψος",
-	"How many columns would you like to merge?":      "Πόσες στήλες θέλετε να ενώσετε;",
-	"How many rows would you like to merge?":         "Πόσες γραμμές θέλετε να ενώσετε;",
-	"Image URL":					  "URL εικόνας",
-	"Justify":                                        "Πλήρης στοίχηση",
-	"Layout":					  "Διάταξη",
-	"Left":						  "Αριστερά",
-	"Margin":                                         "Περιθώριο",
-	"Middle":                                         "Κέντρο",
-	"No rules":					  "Χωρίς Γραμμές",
-	"No sides":					  "No sides",
-	"None":                                           "Τίποτα",
-	"Padding":					  "Εσοχή",
-	"Please click into some cell":                    "Κάντε κλικ μέσα σε κάποιο κελί",
-	"Right":					  "Δεξιά",
-	"Row Properties":                                 "Ιδιότητες Γραμμής",
-	"Rules will appear between all rows and columns": "Γραμμές θα εμφανίζονται μεταξύ όλων των γραμμών και στηλών",
-	"Rules will appear between columns only":	  "Γραμμές θα εμφανίζονται μόνο μεταξύ στηλών",
-	"Rules will appear between rows only":		  "Γραμμές θα εμφανίζονται μόνο μεταξύ γραμμών",
-	"Rules":					  "Γραμμές",
-	"Spacing and padding":                            "Αποστάσεις και εσοχές",
-	"Spacing":					  "Αποστάσεις",
-	"Summary":					  "Σύνοψη",
-	"TO-cell-delete":				  "Διαγραφή κελιού",
-	"TO-cell-insert-after":				  "Εισαγωγή κελιού μετά",
-	"TO-cell-insert-before":			  "Εισαγωγή κελιού πριν",
-	"TO-cell-merge":				  "Συγχώνευση κελιών",
-	"TO-cell-prop":					  "Ιδιότητες κελιού",
-	"TO-cell-split":				  "Διαίρεση κελιού",
-	"TO-col-delete":				  "Διαγραφή στήλης",
-	"TO-col-insert-after":				  "Εισαγωγή στήλης μετά",
-	"TO-col-insert-before":				  "Εισαγωγή στήλης πριν",
-	"TO-col-split":					  "Διαίρεση στήλης",
-	"TO-row-delete":				  "Διαγραφή γραμμής",
-	"TO-row-insert-above":				  "Εισαγωγή γραμμής μετά",
-	"TO-row-insert-under":				  "Εισαγωγή γραμμής πριν",
-	"TO-row-prop":					  "Ιδιότητες γραμμής",
-	"TO-row-split":					  "Διαίρεση γραμμής",
-	"TO-table-prop":				  "Ιδιότητες πίνακα",
-	"Table Properties":				  "Ιδιότητες πίνακα",
-	"Text align":                                     "Στοίχηση κειμένου",
-	"The bottom side only":				  "Η κάτω πλευρά μόνο",
-	"The left-hand side only":			  "Η αριστερή πλευρά μόνο",
-	"The right and left sides only":		  "Οι δεξιές και αριστερές πλευρές μόνο",
-	"The right-hand side only":			  "Η δεξιά πλευρά μόνο",
-	"The top and bottom sides only":		  "Οι πάνω και κάτω πλευρές μόνο",
-	"The top side only":				  "Η πάνω πλευρά μόνο",
-	"Top":                                            "Πάνω",	
-	"Unset color":                                    "Αναίρεση χρώματος",
-	"Vertical align":                                 "Κατακόρυφη στοίχηση",
-	"Width":					  "Πλάτος",
-	"not-del-last-cell":				  "Δεν μπορεί να διαγραφεί το τελευταίο κελί σε μια γραμμή.",
-	"not-del-last-col":				  "Δεν μπορεί να διαγραφεί η τελευταία στήλη σε ένα πίνακα.",
-	"not-del-last-row":				  "Δεν μπορεί να διαγραφεί η τελευταία γραμμή σε ένα πίνακα.",
-	"percent":					  "τοις εκατόν",
-	"pixels":					  "pixels"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/en.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/en.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/en.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/en.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-// I18N constants
-
-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-TableOperations.I18N = {
-	"Align":					  "Align",
-	"All four sides":				  "All four sides",
-	"Background":					  "Background",
-	"Baseline":                                       "Baseline",
-	"Border":					  "Border",
-	"Borders":					  "Borders",
-	"Bottom":                                         "Bottom",
-	"CSS Style":					  "Style [CSS]",
-	"Caption":					  "Caption",
-	"Cell Properties":                                "Cell Properties",
-	"Center":					  "Center",
-	"Char":                                           "Char",
-	"Collapsed borders":                              "Collapsed borders",
-	"Color":					  "Color",
-	"Description":					  "Description",
-	"FG Color":					  "FG Color",
-	"Float":                                          "Float",
-	"Frames":					  "Frames",
-	"Height":                                         "Height",
-	"How many columns would you like to merge?":      "How many columns would you like to merge?",
-	"How many rows would you like to merge?":         "How many rows would you like to merge?",
-	"Image URL":					  "Image URL",
-	"Justify":                                        "Justify",
-	"Layout":					  "Layout",
-	"Left":						  "Left",
-	"Margin":                                         "Margin",
-	"Middle":                                         "Middle",
-	"No rules":					  "No rules",
-	"No sides":					  "No sides",
-	"None":                                           "None",
-	"Padding":					  "Padding",
-	"Please click into some cell":                    "Please click into some cell",
-	"Right":					  "Right",
-	"Row Properties":                                 "Row Properties",
-	"Rules will appear between all rows and columns": "Rules will appear between all rows and columns",
-	"Rules will appear between columns only":	  "Rules will appear between columns only",
-	"Rules will appear between rows only":		  "Rules will appear between rows only",
-	"Rules":					  "Rules",
-	"Spacing and padding":                            "Spacing and padding",
-	"Spacing":					  "Spacing",
-	"Summary":					  "Summary",
-	"TO-cell-delete":				  "Delete cell",
-	"TO-cell-insert-after":				  "Insert cell after",
-	"TO-cell-insert-before":			  "Insert cell before",
-	"TO-cell-merge":				  "Merge cells",
-	"TO-cell-prop":					  "Cell properties",
-	"TO-cell-split":				  "Split cell",
-	"TO-col-delete":				  "Delete column",
-	"TO-col-insert-after":				  "Insert column after",
-	"TO-col-insert-before":				  "Insert column before",
-	"TO-col-split":					  "Split column",
-	"TO-row-delete":				  "Delete row",
-	"TO-row-insert-above":				  "Insert row before",
-	"TO-row-insert-under":				  "Insert row after",
-	"TO-row-prop":					  "Row properties",
-	"TO-row-split":					  "Split row",
-	"TO-table-prop":				  "Table properties",
-	"Table Properties":				  "Table Properties",
-	"Text align":                                     "Text align",
-	"The bottom side only":				  "The bottom side only",
-	"The left-hand side only":			  "The left-hand side only",
-	"The right and left sides only":		  "The right and left sides only",
-	"The right-hand side only":			  "The right-hand side only",
-	"The top and bottom sides only":		  "The top and bottom sides only",
-	"The top side only":				  "The top side only",
-	"Top":                                            "Top",	
-	"Unset color":                                    "Unset color",
-	"Vertical align":                                 "Vertical align",
-	"Width":					  "Width",
-	"not-del-last-cell":				  "HTMLArea cowardly refuses to delete the last cell in row.",
-	"not-del-last-col":				  "HTMLArea cowardly refuses to delete the last column in table.",
-	"not-del-last-row":				  "HTMLArea cowardly refuses to delete the last row in table.",
-	"percent":					  "percent",
-	"pixels":					  "pixels"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/fi.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/fi.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/fi.js	2004-03-15 16:36:04.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/fi.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,66 +0,0 @@
-TableOperations.I18N = {
-	"Align":					  "Kohdistus",
-	"All four sides":				  "Kaikki nelj sivua",
-	"Background":					  "Tausta",
-	"Baseline":                                       "Takaraja",
-	"Border":					  "Reuna",
-	"Borders":					  "Reunat",
-	"Bottom":                                         "Alle",
-	"CSS Style":					  "Tyyli [CSS]",
-	"Caption":					  "Otsikko",
-	"Cell Properties":                                "Solun asetukset",
-	"Center":					  "Keskelle",
-	"Char":                                           "Merkki",
-	"Collapsed borders":                              "Luhistetut reunat",
-	"Color":					  "Vri",
-	"Description":					  "Kuvaus",
-	"FG Color":					  "FG Vri",
-	"Frames":					  "Kehykset",
-	"Image URL":					  "Kuvan osoite",
-	"Layout":					  "Sommittelu",
-	"Left":						  "Vasen",
-	"Margin":                                         "Marginaali",
-	"Middle":                                         "Keskelle",
-	"No rules":					  "Ei viivoja",
-	"No sides":					  "Ei sivuja",
-	"Padding":					  "Palstantyte",
-	"Right":					  "Oikea",
-	"Row Properties":                                 "Rivin asetukset",
-	"Rules will appear between all rows and columns": "Viivat jokaisen rivin ja sarakkeen vlill",
-	"Rules will appear between columns only":	  "Viivat ainoastaan sarakkeiden vlill",
-	"Rules will appear between rows only":		  "Viivat ainoastaan rivien vlill",
-	"Rules":					  "Viivat",
-	"Spacing":					  "Palstatila",
-	"Summary":					  "Yhteenveto",
-	"TO-cell-delete":				  "Poista solu",
-	"TO-cell-insert-after":				  "Lis solu pern",
-	"TO-cell-insert-before":			  "Lis solu ennen",
-	"TO-cell-merge":				  "Yhdist solut",
-	"TO-cell-prop":					  "Solun asetukset",
-	"TO-cell-split":				  "Jaa solu",
-	"TO-col-delete":				  "Poista sarake",
-	"TO-col-insert-after":				  "Lis sarake pern",
-	"TO-col-insert-before":				  "Lis sarake ennen",
-	"TO-col-split":					  "Jaa sarake",
-	"TO-row-delete":				  "Poista rivi",
-	"TO-row-insert-above":				  "Lis rivi ylpuolelle",
-	"TO-row-insert-under":				  "Lis rivi alapuolelle",
-	"TO-row-prop":					  "Rivin asetukset",
-	"TO-row-split":					  "Jaa rivi",
-	"TO-table-prop":				  "Taulukon asetukset",
-	"Top":                                            "Yls",	
-	"Table Properties":				  "Taulukon asetukset",
-	"The bottom side only":				  "Ainoastaan alapuolelle",
-	"The left-hand side only":			  "Ainoastaan vasenreuna",
-	"The right and left sides only":		  "Oikea- ja vasenreuna",
-	"The right-hand side only":			  "Ainoastaan oikeareuna",
-	"The top and bottom sides only":		  "Yl- ja alapuoli.",
-	"The top side only":				  "Ainoastaan ylpuoli",
-	"Vertical align":                                 "Vertikaali kohdistus",
-	"Width":					  "Leveys",
-	"not-del-last-cell":				  "Ei voida poistaa viimeist solua rivist.",
-	"not-del-last-col":				  "Ei voida poistaa viimeist saraketta taulusta.",
-	"not-del-last-row":				  "Ei voida poistaa viimeist rivi taulusta.",
-	"percent":					  "prosenttia",
-	"pixels":					  "pikseli"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/he.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/he.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/he.js	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/he.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-// I18N constants

-

-// LANG: "he", ENCODING: UTF-8

-// Author: Liron Newman, http://www.eesh.net, <plastish at ultinet dot org>

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-TableOperations.I18N = {

-	"Align":					  "ישור",

-	"All four sides":				  "כל ארבעת הצדדים",

-	"Background":					  "רקע",

-	"Baseline":                                       "קו בסיס",

-	"Border":					  "גבול",

-	"Borders":					  "גבולות",

-	"Bottom":                                         "תחתון",

-	"CSS Style":					  "סגנון [CSS]",

-	"Caption":					  "כותרת",

-	"Cell Properties":                                "מאפייני תא",

-	"Center":					  "מרכז",

-	"Char":                                           "תו",

-	"Collapsed borders":                              "גבולות קורסים",

-	"Color":					  "צבע",

-	"Description":					  "תיאור",

-	"FG Color":					  "צבע קידמה",

-	"Float":                                          "מרחף",

-	"Frames":					  "מסגרות",

-	"Height":                                         "גובה",

-	"How many columns would you like to merge?":      "כמה טורים ברצונך למזג?",

-	"How many rows would you like to merge?":         "כמה שורות ברצונך למזג?",

-	"Image URL":					  "URL התמונה",

-	"Justify":                                        "ישור",

-	"Layout":					  "פריסה",

-	"Left":						  "שמאל",

-	"Margin":                                         "שוליים",

-	"Middle":                                         "אמצע",

-	"No rules":					  "ללא קווים",

-	"No sides":					  "ללא צדדים",

-	"None":                                           "אין",

-	"Padding":					  "ריווח בשוליים",

-	"Please click into some cell":                    "אנא לחץ על תא כלשהו",

-	"Right":					  "ימין",

-	"Row Properties":                                 "מאפייני שורה",

-	"Rules will appear between all rows and columns": "קווים יופיעו בין כל השורות והטורים",

-	"Rules will appear between columns only":	  "קווים יופיעו בין טורים בלבד",

-	"Rules will appear between rows only":		  "קווים יופיעו בין שורות בלבד",

-	"Rules":					  "קווים",

-	"Spacing and padding":                            "ריווח ושוליים",

-	"Spacing":					  "ריווח",

-	"Summary":					  "סיכום",

-	"TO-cell-delete":				  "מחק תא",

-	"TO-cell-insert-after":				  "הכנס תא אחרי",

-	"TO-cell-insert-before":			  "הכנס תא לפני",

-	"TO-cell-merge":				  "מזג תאים",

-	"TO-cell-prop":					  "מאפייני תא",

-	"TO-cell-split":				  "פצל תא",

-	"TO-col-delete":				  "מחק טור",

-	"TO-col-insert-after":				  "הכנס טור אחרי",

-	"TO-col-insert-before":				  "הכנס טור לפני",

-	"TO-col-split":					  "פצל טור",

-	"TO-row-delete":				  "מחק שורה",

-	"TO-row-insert-above":				  "הכנס שורה לפני",

-	"TO-row-insert-under":				  "הכנס שורה אחרי",

-	"TO-row-prop":					  "מאפייני שורה",

-	"TO-row-split":					  "פצל שורה",

-	"TO-table-prop":				  "מאפייני טבלה",

-	"Table Properties":				  "מאפייני טבלה",

-	"Text align":                                     "ישור טקסט",

-	"The bottom side only":				  "הצד התחתון בלבד",

-	"The left-hand side only":			  "הצד השמאלי בלבד",

-	"The right and left sides only":		  "הצדדים הימני והשמאלי בלבד",

-	"The right-hand side only":			  "הצד הימני בלבד",

-	"The top and bottom sides only":		  "הצדדים העליון והתחתון בלבד",

-	"The top side only":				  "הצד העליון בלבד",

-	"Top":                                            "עליון",	

-	"Unset color":                                    "צבע לא נבחר",

-	"Vertical align":                                 "יישור אנכי",

-	"Width":					  "רוחב",

-	"not-del-last-cell":				  "HTMLArea מסרב בפחדנות למחוק את התא האחרון בשורה.",

-	"not-del-last-col":				  "HTMLArea מסרב בפחדנות למחוק את הטור האחרון בטבלה.",

-	"not-del-last-row":				  "HTMLArea מסרב בפחדנות למחוק את השורה האחרונה בטבלה.",

-	"percent":					  "אחוז",

-	"pixels":					  "פיקסלים"

-};

diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/hu.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/hu.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/hu.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/hu.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,63 +0,0 @@
-// I18N constants
-
-// LANG: "hu", ENCODING: UTF-8
-// Author: Miklós Somogyi, <somogyine@vnet.hu>
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-HTMLArea.I18N = {
-
-	// the following should be the filename without .js extension
-	// it will be used for automatically load plugin language.
-	lang: "hu",
-
-	tooltips: {
-		bold:           "Félkövér",
-		italic:         "Dőlt",
-		underline:      "Aláhúzott",
-		strikethrough:  "Áthúzott",
-		subscript:      "Alsó index",
-		superscript:    "Felső index",
-		justifyleft:    "Balra zárt",
-		justifycenter:  "Középre zárt",
-		justifyright:   "Jobbra zárt",
-		justifyfull:    "Sorkizárt",
-		orderedlist:    "Számozott lista",
-		unorderedlist:  "Számozatlan lista",
-		outdent:        "Behúzás csökkentése",
-		indent:         "Behúzás növelése",
-		forecolor:      "Karakterszín",
-		hilitecolor:    "Háttérszín",
-		horizontalrule: "Elválasztó vonal",
-		createlink:     "Hiperhivatkozás beszúrása",
-		insertimage:    "Kép beszúrása",
-		inserttable:    "Táblázat beszúrása",
-		htmlmode:       "HTML forrás be/ki",
-		popupeditor:    "Szerkesztő külön ablakban",
-		about:          "Névjegy",
-		showhelp:       "Súgó",
-		textindicator:  "Aktuális stílus",
-		undo:           "Visszavonás",
-		redo:           "Újra végrehajtás",
-		cut:            "Kivágás",
-		copy:           "Másolás",
-		paste:          "Beillesztés"
-	},
-
-	buttons: {
-		"ok":           "Rendben",
-		"cancel":       "Mégsem"
-	},
-
-	msg: {
-		"Path":         "Hierarchia",
-		"TEXT_MODE":    "Forrás mód. Visszaváltás [<>] gomb"
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/it.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/it.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/it.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/it.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,81 +0,0 @@
-// I18N constants
-
-// LANG: "it", ENCODING: UTF-8 | ISO-8859-1
-// Author: Fabio Rotondo <fabio@rotondo.it>
-
-TableOperations.I18N = {
-	"Align":					  "Allinea",
-	"All four sides":				  "Tutti e quattro i lati",
-	"Background":					  "Sfondo",
-	"Baseline":                                       "Allineamento",
-	"Border":					  "Bordo",
-	"Borders":					  "Bordi",
-	"Bottom":                                         "Basso",
-	"CSS Style":					  "Stile [CSS]",
-	"Caption":					  "Titolo",
-	"Cell Properties":                                "Proprietà della Cella",
-	"Center":					  "Centra",
-	"Char":                                           "Carattere",
-	"Collapsed borders":                              "Bordi chiusi",
-	"Color":					  "Colore",
-	"Description":					  "Descrizione",
-	"FG Color":					  "Colore Principale",
-	"Float":                                          "Fluttuante",
-	"Frames":					  "Frames",
-	"Height":                                         "Altezza",
-	"How many columns would you like to merge?":      "Quante colonne vuoi unire?",
-	"How many rows would you like to merge?":         "Quante righe vuoi unire?",
-	"Image URL":					  "URL dell'Immagine",
-	"Justify":                                        "Justifica",
-	"Layout":					  "Layout",
-	"Left":						  "Sinistra",
-	"Margin":                                         "Margine",
-	"Middle":                                         "Centrale",
-	"No rules":					  "Nessun righello",
-	"No sides":					  "Nessun lato",
-	"None":                                           "Nulla",
-	"Padding":					  "Padding",
-	"Please click into some cell":                    "Per favore, clicca in una cella",
-	"Right":					  "Destra",
-	"Row Properties":                                 "Proprietà della Riga",
-	"Rules will appear between all rows and columns": "Le linee appariranno tra tutte le righe e colonne",
-	"Rules will appear between columns only":	  "Le linee appariranno solo tra le colonne",
-	"Rules will appear between rows only":		  "Le linee appariranno solo tra le righe",
-	"Rules":					  "Linee",
-	"Spacing and padding":                            "Spaziatura e Padding",
-	"Spacing":					  "Spaziatura",
-	"Summary":					  "Sommario",
-	"TO-cell-delete":				  "Cancella cella",
-	"TO-cell-insert-after":				  "Inserisci cella dopo",
-	"TO-cell-insert-before":			  "Inserisci cella prima",
-	"TO-cell-merge":				  "Unisci celle",
-	"TO-cell-prop":					  "Proprietà della cella",
-	"TO-cell-split":				  "Dividi cella",
-	"TO-col-delete":				  "Cancella colonna",
-	"TO-col-insert-after":				  "Inserisci colonna dopo",
-	"TO-col-insert-before":				  "Inserisci colonna prima",
-	"TO-col-split":					  "Dividi colonna",
-	"TO-row-delete":				  "Cancella riga",
-	"TO-row-insert-above":				  "Inserisci riga prima",
-	"TO-row-insert-under":				  "Inserisci riga dopo",
-	"TO-row-prop":					  "Proprietà della riga",
-	"TO-row-split":					  "Dividi riga",
-	"TO-table-prop":				  "Proprietà della Tabella",
-	"Table Properties":				  "Proprietà della Tabella",
-	"Text align":                                     "Allineamento del Testo",
-	"The bottom side only":				  "Solo la parte inferiore",
-	"The left-hand side only":			  "Solo la parte sinistra",
-	"The right and left sides only":		  "Solo destra e sinistra",
-	"The right-hand side only":			  "Solo la parte destra",
-	"The top and bottom sides only":		  "Solo sopra e sotto",
-	"The top side only":				  "Solo la parte sopra",
-	"Top":                                            "Alto",	
-	"Unset color":                                    "Rimuovi colore",
-	"Vertical align":                                 "Allineamento verticale",
-	"Width":					  "Larghezza",
-	"not-del-last-cell":				  "HTMLArea si rifiuta codardamente di cancellare l'ultima cella nella riga.",
-	"not-del-last-col":				  "HTMLArea si rifiuta codardamente di cancellare l'ultima colonna nella tabella.",
-	"not-del-last-row":				  "HTMLArea si rifiuta codardamente di cancellare l'ultima riga nella tabella.",
-	"percent":					  "percento",
-	"pixels":					  "pixels"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/nl.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/nl.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/nl.js	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/nl.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-// I18N constants

-

-// LANG: "nl", ENCODING: UTF-8 | ISO-8859-1

-// Author: Michel Weegeerink (info@mmc-shop.nl), http://mmc-shop.nl

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-TableOperations.I18N = {

-	"Align":											"Uitlijning",

-	"All four sides":									"Alle 4 zijden",

-	"Background":										"Achtergrond",

-	"Baseline":											"Basis",

-	"Border":											"Rand",

-	"Borders":											"Randen",

-	"Bottom":											"Onder",

-	"CSS Style":										"CSS Style",

-	"Caption":											"Opmerking",

-	"Cell Properties":									"Celeigenschappen",

-	"Center":											"Centreren",

-	"Char":												"Karakter",

-	"Collapsed borders":								"Geen randen",

-	"Color":											"Kleur",

-	"Description":										"Omschrijving",

-	"FG Color":											"Voorgrond",

-	"Float":											"Zwevend",

-	"Frames":											"Frames",

-	"Height":											"Hoogte",

-	"How many columns would you like to merge?":		"Hoeveel kolommen wilt u samenvoegen?",

-	"How many rows would you like to merge?":			"Hoeveel rijen wilt u samenvoegen?",

-	"Image URL":										"Afbeelding URL",

-	"Justify":											"Uitvullen",

-	"Layout":											"Opmaak",

-	"Left":												"Links",

-	"Margin":											"Marge",

-	"Middle":											"Midden",

-	"No rules":											"Geen regels",

-	"No sides":											"Geen zijlijnen",

-	"None":												"Geen",

-	"Padding":											"Celmarge",

-	"Please click into some cell":						"Klik in een cel a.u.b.",

-	"Right":											"Rechts",

-	"Row Properties":									"Rijeigenschappen",

-	"Rules will appear between all rows and columns":	"Regels verschijnen tussen alle rijen en kolommen",

-	"Rules will appear between columns only":	  		"Regels verschijnen enkel tussen de kolommen",

-	"Rules will appear between rows only":				"Regels verschijnen enkel tussen de rijen",

-	"Rules":					  						"Regels",

-	"Spacing and padding":                           	"Celmarge en afstand tussen cellen",

-	"Spacing":											"marge",

-	"Summary":											"Overzicht",

-	"TO-cell-delete":				  					"Cel verwijderen",

-	"TO-cell-insert-after":				  				"Voeg cel toe achter",

-	"TO-cell-insert-before":			  				"Voeg cel toe voor",

-	"TO-cell-merge":									"Cellen samenvoegen",

-	"TO-cell-prop":										"Celeigenschappen",

-	"TO-cell-split":									"Cel splitsen",

-	"TO-col-delete":									"Kolom verwijderen",

-	"TO-col-insert-after":								"Kolom invoegen achter",

-	"TO-col-insert-before":								"Kolom invoegen voor",

-	"TO-col-split":										"Kolom splitsen",

-	"TO-row-delete":									"Rij verwijderen",

-	"TO-row-insert-above":								"Rij invoegen boven",

-	"TO-row-insert-under":								"Rij invoegen onder",

-	"TO-row-prop":										"Rij eigenschappen",

-	"TO-row-split":										"Rij splitsen",

-	"TO-table-prop":				  					"Tabel eigenschappen",

-	"Table Properties":				  					"Tabel eigenschappen",

-	"Text align":                                     	"Text uitlijning",

-	"The bottom side only":				  				"Enkel aan de onderkant",

-	"The left-hand side only":			 				"Enkel aan de linkerkant",

-	"The right and left sides only":		 			"Enkel aan de linker en rechterkant",

-	"The right-hand side only":							"Enkel aan de rechterkant",

-	"The top and bottom sides only":					"Enkel aan de bovenen onderkant",

-	"The top side only":								"Enkel aan de bovenkant",

-	"Top":												"Boven",

-	"Unset color":										"Wis kleur",

-	"Vertical align":									"Vertikale uitlijning",

-	"Width":					 						"Breedte",

-	"not-del-last-cell":								"HTMLArea kan de laatste cel in deze tabel niet verwijderen.",

-	"not-del-last-col":									"HTMLArea kan de laatste kolom in deze tabel niet verwijderen.",

-	"not-del-last-row":									"HTMLArea kan de laatste rij in deze tabel niet verwijderen.",

-	"percent":											"procent",

-	"pixels":											"pixels"

-};

diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/no.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/no.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/no.js	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/no.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,91 +0,0 @@
-// I18N constants

-

-// LANG: "en", ENCODING: UTF-8 | ISO-8859-1

-// Author: Mihai Bazon, <mihai_bazon@yahoo.com>

-// translated into Norwegia: ses@online.no  11.11.03

-

-// FOR TRANSLATORS:

-//

-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE

-//      (at least a valid email address)

-//

-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;

-//      (if this is not possible, please include a comment

-//       that states what encoding is necessary.)

-

-TableOperations.I18N = {

-	"Align":					  	"Juster",

-	"All four sides":			  	"Alle fire sider",

-	"Background":					"Bakgrund",

-	"Baseline":                   	"Grunnlinje",

-	"Border":					  	"Kantlinje",

-	"Borders":					  	"Kantlinjer",

-	"Bottom":                     	"Bunn",

-	"CSS Style":					"Stil [CSS]",

-	"Caption":					  	"Overskrift",

-	"Cell Properties":              "Celleegenskaper",

-	"Center":					  	"Sentrer",

-	"Char":                         "Tegn",

-	"Collapsed borders":            "Fjern kantlinjer",

-	"Color":					  	"Farge",

-	"Description":					"Beskrivelse",

-	"FG Color":					  	"FG farge",

-	"Float":                        "Flytende",

-	"Frames":					  	"rammer",

-	"Height":                       "Hyde",

-	"How many columns would you like to merge?":      "Hvor mange kolonner vil du sl sammen?",

-	"How many rows would you like to merge?":         "Hvor mange rader vil du sl sammen?",

-	"Image URL":					"Bildets URL",

-	"Justify":                      "Juster",

-	"Layout":					  	"Layout",

-	"Left":						  	"Venstre",

-	"Margin":                       "Marg",

-	"Middle":                       "Midten",

-	"No rules":					  	"Ingen linjal",

-	"No sides":					  	"Ingen sider",

-	"None":                         "Ingen",

-	"Padding":					  	"Luft",

-	"Please click into some cell":  "Klikk i en eller annen celle",

-	"Right":					  	"Hyre",

-	"Row Properties":               "Egenskaper for rad",

-	"Rules will appear between all rows and columns": "Linjer vil synes mellom alle rader og kolonner",

-	"Rules will appear between columns only":	  "Linjer vil synes kun mellom kolonner",

-	"Rules will appear between rows only":		  "Linjer vil synes kun mellom rader",

-	"Rules":					  	"Linjer",

-	"Spacing and padding":          "Luft",

-	"Spacing":					  	"Luft",

-	"Summary":					  	"Sammendrag",

-	"TO-cell-delete":				"Slett celle",

-	"TO-cell-insert-after":			"Sett inn celle etter",

-	"TO-cell-insert-before":		"Sett inn celle foran",

-	"TO-cell-merge":				"Sl sammen celler",

-	"TO-cell-prop":					"Egenskaper for celle",

-	"TO-cell-split":				"Del celle",

-	"TO-col-delete":				"Slett kolonne",

-	"TO-col-insert-after":			"Skyt inn kolonne etter",

-	"TO-col-insert-before":			"Skyt inn kolonne fr",

-	"TO-col-split":					"Del kolonne",

-	"TO-row-delete":				"Slett rad",

-	"TO-row-insert-above":			"Skyt inn rad foran",

-	"TO-row-insert-under":			"Skyt inn rad etter",

-	"TO-row-prop":					"Egenskaper for rad",

-	"TO-row-split":					"Del rad",

-	"TO-table-prop":				"Tabellegenskaper",

-	"Table Properties":				"Tabellegenskaper",

-	"Text align":                   "Juster tekst",

-	"The bottom side only":			"Bunnen kun",

-	"The left-hand side only":		"Venstresiden kun",

-	"The right and left sides only":	"Hyre- og venstresiden kun",

-	"The right-hand side only":			"Hyresiden kun",

-	"The top and bottom sides only":	"The top and bottom sides only",

-	"The top side only":				"Overkanten kun",

-	"Top":                          "Overkant",	

-	"Unset color":                  "Ikke-bestemt farge",

-	"Vertical align":               "Vertikal justering",

-	"Width":					  	"Bredde",

-	"not-del-last-cell":			"HTMLArea nekter  slette siste cellen i tabellen.",

-	"not-del-last-col":				"HTMLArea nekter  slette siste kolonnen i tabellen.",

-	"not-del-last-row":				"HTMLArea nekter  slette siste raden i tabellen.",

-	"percent":					  	"prosent",

-	"pixels":					  	"billedpunkter"

-};

diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/ro.js 75/e107_handlers/htmlarea/plugins/TableOperations/lang/ro.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/lang/ro.js	2004-03-16 02:23:00.000000000 -0600
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/lang/ro.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-// I18N constants
-
-// LANG: "ro", ENCODING: UTF-8
-// Author: Mihai Bazon, http://dynarch.com/mishoo
-
-// FOR TRANSLATORS:
-//
-//   1. PLEASE PUT YOUR CONTACT INFO IN THE ABOVE LINE
-//      (at least a valid email address)
-//
-//   2. PLEASE TRY TO USE UTF-8 FOR ENCODING;
-//      (if this is not possible, please include a comment
-//       that states what encoding is necessary.)
-
-TableOperations.I18N = {
-	"Align":					  "Aliniere",
-	"All four sides":				  "Toate părţile",
-	"Background":					  "Fundal",
-	"Baseline":                                       "Baseline",
-	"Border":					  "Chenar",
-	"Borders":					  "Chenare",
-	"Bottom":                                         "Jos",
-	"CSS Style":					  "Stil [CSS]",
-	"Caption":					  "Titlu de tabel",
-	"Cell Properties":                                "Proprietăţile celulei",
-	"Center":					  "Centru",
-	"Char":                                           "Caracter",
-	"Collapsed borders":                              "Chenare asimilate",
-	"Color":					  "Culoare",
-	"Description":					  "Descriere",
-	"FG Color":					  "Culoare text",
-	"Float":                                          "Poziţie",
-	"Frames":					  "Chenare",
-	"Height":                                         "Înălţimea",
-	"How many columns would you like to merge?":      "Câte coloane vrei să uneşti?",
-	"How many rows would you like to merge?":         "Câte linii vrei să uneşti?",
-	"Image URL":					  "URL-ul imaginii",
-	"Justify":                                        "Justify",
-	"Layout":					  "Aranjament",
-	"Left":						  "Stânga",
-	"Margin":                                         "Margine",
-	"Middle":                                         "Mijloc",
-	"No rules":					  "Fără linii",
-	"No sides":					  "Fără părţi",
-	"None":                                           "Nimic",
-	"Padding":					  "Spaţiere",
-	"Please click into some cell":                    "Vă rog să daţi click într-o celulă",
-	"Right":					  "Dreapta",
-	"Row Properties":                                 "Proprietăţile liniei",
-	"Rules will appear between all rows and columns": "Vor apărea linii între toate rândurile şi coloanele",
-	"Rules will appear between columns only":	  "Vor apărea doar linii verticale",
-	"Rules will appear between rows only":		  "Vor apărea doar linii orizontale",
-	"Rules":					  "Linii",
-	"Spacing and padding":                            "Spaţierea",
-	"Spacing":					  "Între celule",
-	"Summary":					  "Sumar",
-	"TO-cell-delete":				  "Şterge celula",
-	"TO-cell-insert-after":				  "Inserează o celulă la dreapta",
-	"TO-cell-insert-before":			  "Inserează o celulă la stânga",
-	"TO-cell-merge":				  "Uneşte celulele",
-	"TO-cell-prop":					  "Proprietăţile celulei",
-	"TO-cell-split":				  "Împarte celula",
-	"TO-col-delete":				  "Şterge coloana",
-	"TO-col-insert-after":				  "Inserează o coloană la dreapta",
-	"TO-col-insert-before":				  "Inserează o coloană la stânga",
-	"TO-col-split":					  "Împarte coloana",
-	"TO-row-delete":				  "Şterge rândul",
-	"TO-row-insert-above":				  "Inserează un rând înainte",
-	"TO-row-insert-under":				  "Inserează un rând după",
-	"TO-row-prop":					  "Proprietăţile rândului",
-	"TO-row-split":					  "Împarte rândul",
-	"TO-table-prop":				  "Proprietăţile tabelei",
-	"Table Properties":				  "Proprietăţile tabelei",
-	"Text align":                                     "Aliniere",
-	"The bottom side only":				  "Doar partea de jos",
-	"The left-hand side only":			  "Doar partea din stânga",
-	"The right and left sides only":		  "Partea din stânga şi cea din dreapta",
-	"The right-hand side only":			  "Doar partea din dreapta",
-	"The top and bottom sides only":		  "Partea de sus si cea de jos",
-	"The top side only":				  "Doar partea de sus",
-	"Top":                                            "Sus",	
-	"Unset color":                                    "Dezactivează culoarea",
-	"Vertical align":                                 "Aliniere pe verticală",
-	"Width":					  "Lăţime",
-	"not-del-last-cell":				  "HTMLArea refuză cu laşitate să şteargă ultima celulă din rând.",
-	"not-del-last-col":				  "HTMLArea refuză cu laşitate să şteargă ultima coloamă din tabela.",
-	"not-del-last-row":				  "HTMLArea refuză cu laşitate să şteargă ultimul rând din tabela.",
-	"percent":					  "procente",
-	"pixels":					  "pixeli"
-};
diff -ruN 6171/e107_handlers/htmlarea/plugins/TableOperations/table-operations.js 75/e107_handlers/htmlarea/plugins/TableOperations/table-operations.js
--- 6171/e107_handlers/htmlarea/plugins/TableOperations/table-operations.js	2004-08-11 04:26:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/plugins/TableOperations/table-operations.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,1160 +0,0 @@
-// Table Operations Plugin for HTMLArea-3.0
-// Implementation by Mihai Bazon.  Sponsored by http://www.bloki.com
-//
-// htmlArea v3.0 - Copyright (c) 2002 interactivetools.com, inc.
-// This notice MUST stay intact for use (see license.txt).
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon for InteractiveTools.
-//   http://dynarch.com/mishoo
-//
-// $Id: table-operations.js,v 1.5 2004/08/11 09:26:38 e107coders Exp $
-
-// Object that will encapsulate all the table operations provided by
-// HTMLArea-3.0 (except "insert table" which is included in the main file)
-function TableOperations(editor) {
-	this.editor = editor;
-
-	var cfg = editor.config;
-	var tt = TableOperations.I18N;
-	var bl = TableOperations.btnList;
-	var self = this;
-
-	// register the toolbar buttons provided by this plugin
-	var toolbar = ["linebreak"];
-	for (var i = 0; i < bl.length; ++i) {
-		var btn = bl[i];
-		if (!btn) {
-			toolbar.push("separator");
-		} else {
-			var id = "TO-" + btn[0];
-			cfg.registerButton(id, tt[id], editor.imgURL(btn[0] + ".gif", "TableOperations"), false,
-					   function(editor, id) {
-						   // dispatch button press event
-						   self.buttonPress(editor, id);
-					   }, btn[1]);
-			toolbar.push(id);
-		}
-	}
-
-	// add a new line in the toolbar
-	cfg.toolbar.push(toolbar);
-};
-
-TableOperations._pluginInfo = {
-	name          : "TableOperations",
-	version       : "1.0",
-	developer     : "Mihai Bazon",
-	developer_url : "http://dynarch.com/mishoo/",
-	c_owner       : "Mihai Bazon",
-	sponsor       : "Zapatec Inc.",
-	sponsor_url   : "http://www.bloki.com",
-	license       : "htmlArea"
-};
-
-/************************
- * UTILITIES
- ************************/
-
-// retrieves the closest element having the specified tagName in the list of
-// ancestors of the current selection/caret.
-TableOperations.prototype.getClosest = function(tagName) {
-	var editor = this.editor;
-	var ancestors = editor.getAllAncestors();
-	var ret = null;
-	tagName = ("" + tagName).toLowerCase();
-	for (var i = 0; i < ancestors.length; ++i) {
-		var el = ancestors[i];
-		if (el.tagName.toLowerCase() == tagName) {
-			ret = el;
-			break;
-		}
-	}
-	return ret;
-};
-
-// this function requires the file PopupDiv/PopupWin to be loaded from browser
-TableOperations.prototype.dialogTableProperties = function() {
-	var i18n = TableOperations.I18N;
-	// retrieve existing values
-	var table = this.getClosest("table");
-	// this.editor.selectNodeContents(table);
-	// this.editor.updateToolbar();
-
-	var dialog = new PopupWin(this.editor, i18n["Table Properties"], function(dialog, params) {
-		TableOperations.processStyle(params, table);
-		for (var i in params) {
-			var val = params[i];
-			switch (i) {
-			    case "f_caption":
-				if (/\S/.test(val)) {
-					// contains non white-space characters
-					var caption = table.getElementsByTagName("caption")[0];
-					if (!caption) {
-						caption = dialog.editor._doc.createElement("caption");
-						table.insertBefore(caption, table.firstChild);
-					}
-					caption.innerHTML = val;
-				} else {
-					// search for caption and delete it if found
-					var caption = table.getElementsByTagName("caption")[0];
-					if (caption) {
-						caption.parentNode.removeChild(caption);
-					}
-				}
-				break;
-			    case "f_summary":
-				table.summary = val;
-				break;
-			    case "f_width":
-				table.style.width = ("" + val) + params.f_unit;
-				break;
-			    case "f_align":
-				table.align = val;
-				break;
-			    case "f_spacing":
-				table.cellSpacing = val;
-				break;
-			    case "f_padding":
-				table.cellPadding = val;
-				break;
-			    case "f_borders":
-				table.border = val;
-				break;
-			    case "f_frames":
-				table.frame = val;
-				break;
-			    case "f_rules":
-				table.rules = val;
-				break;
-			}
-		}
-		// various workarounds to refresh the table display (Gecko,
-		// what's going on?! do not disappoint me!)
-		dialog.editor.forceRedraw();
-		dialog.editor.focusEditor();
-		dialog.editor.updateToolbar();
-		var save_collapse = table.style.borderCollapse;
-		table.style.borderCollapse = "collapse";
-		table.style.borderCollapse = "separate";
-		table.style.borderCollapse = save_collapse;
-	},
-
-	// this function gets called when the dialog needs to be initialized
-	function (dialog) {
-
-		var f_caption = "";
-		var capel = table.getElementsByTagName("caption")[0];
-		if (capel) {
-			f_caption = capel.innerHTML;
-		}
-		var f_summary = table.summary;
-		var f_width = parseInt(table.style.width);
-		isNaN(f_width) && (f_width = "");
-		var f_unit = /%/.test(table.style.width) ? 'percent' : 'pixels';
-		var f_align = table.align;
-		var f_spacing = table.cellSpacing;
-		var f_padding = table.cellPadding;
-		var f_borders = table.border;
-		var f_frames = table.frame;
-		var f_rules = table.rules;
-
-		function selected(val) {
-			return val ? " selected" : "";
-		};
-
-		// dialog contents
-		dialog.content.style.width = "400px";
-		dialog.content.innerHTML = " \
-<div class='title'\
- style='background: url(" + dialog.baseURL + dialog.editor.imgURL("table-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n["Table Properties"] + "\
-</div> \
-<table style='width:100%'> \
-  <tr> \
-    <td> \
-      <fieldset><legend>" + i18n["Description"] + "</legend> \
-       <table style='width:100%'> \
-        <tr> \
-          <td class='label'>" + i18n["Caption"] + ":</td> \
-          <td class='value'><input type='text' name='f_caption' value='" + f_caption + "'/></td> \
-        </tr><tr> \
-          <td class='label'>" + i18n["Summary"] + ":</td> \
-          <td class='value'><input type='text' name='f_summary' value='" + f_summary + "'/></td> \
-        </tr> \
-       </table> \
-      </fieldset> \
-    </td> \
-  </tr> \
-  <tr><td id='--HA-layout'></td></tr> \
-  <tr> \
-    <td> \
-      <fieldset><legend>" + i18n["Spacing and padding"] + "</legend> \
-       <table style='width:100%'> \
-"+//        <tr> \
-//           <td class='label'>" + i18n["Width"] + ":</td> \
-//           <td><input type='text' name='f_width' value='" + f_width + "' size='5' /> \
-//             <select name='f_unit'> \
-//               <option value='%'" + selected(f_unit == "percent") + ">" + i18n["percent"] + "</option> \
-//               <option value='px'" + selected(f_unit == "pixels") + ">" + i18n["pixels"] + "</option> \
-//             </select> &nbsp;&nbsp;" + i18n["Align"] + ": \
-//             <select name='f_align'> \
-//               <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
-//               <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
-//               <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
-//             </select> \
-//           </td> \
-//         </tr> \
-"        <tr> \
-          <td class='label'>" + i18n["Spacing"] + ":</td> \
-          <td><input type='text' name='f_spacing' size='5' value='" + f_spacing + "' /> &nbsp;" + i18n["Padding"] + ":\
-            <input type='text' name='f_padding' size='5' value='" + f_padding + "' /> &nbsp;&nbsp;" + i18n["pixels"] + "\
-          </td> \
-        </tr> \
-       </table> \
-      </fieldset> \
-    </td> \
-  </tr> \
-  <tr> \
-    <td> \
-      <fieldset><legend>Frame and borders</legend> \
-        <table width='100%'> \
-          <tr> \
-            <td class='label'>" + i18n["Borders"] + ":</td> \
-            <td><input name='f_borders' type='text' size='5' value='" + f_borders + "' /> &nbsp;&nbsp;" + i18n["pixels"] + "</td> \
-          </tr> \
-          <tr> \
-            <td class='label'>" + i18n["Frames"] + ":</td> \
-            <td> \
-              <select name='f_frames'> \
-                <option value='void'" + selected(f_frames == "void") + ">" + i18n["No sides"] + "</option> \
-                <option value='above'" + selected(f_frames == "above") + ">" + i18n["The top side only"] + "</option> \
-                <option value='below'" + selected(f_frames == "below") + ">" + i18n["The bottom side only"] + "</option> \
-                <option value='hsides'" + selected(f_frames == "hsides") + ">" + i18n["The top and bottom sides only"] + "</option> \
-                <option value='vsides'" + selected(f_frames == "vsides") + ">" + i18n["The right and left sides only"] + "</option> \
-                <option value='lhs'" + selected(f_frames == "lhs") + ">" + i18n["The left-hand side only"] + "</option> \
-                <option value='rhs'" + selected(f_frames == "rhs") + ">" + i18n["The right-hand side only"] + "</option> \
-                <option value='box'" + selected(f_frames == "box") + ">" + i18n["All four sides"] + "</option> \
-              </select> \
-            </td> \
-          </tr> \
-          <tr> \
-            <td class='label'>" + i18n["Rules"] + ":</td> \
-            <td> \
-              <select name='f_rules'> \
-                <option value='none'" + selected(f_rules == "none") + ">" + i18n["No rules"] + "</option> \
-                <option value='rows'" + selected(f_rules == "rows") + ">" + i18n["Rules will appear between rows only"] + "</option> \
-                <option value='cols'" + selected(f_rules == "cols") + ">" + i18n["Rules will appear between columns only"] + "</option> \
-                <option value='all'" + selected(f_rules == "all") + ">" + i18n["Rules will appear between all rows and columns"] + "</option> \
-              </select> \
-            </td> \
-          </tr> \
-        </table> \
-      </fieldset> \
-    </td> \
-  </tr> \
-  <tr> \
-    <td id='--HA-style'></td> \
-  </tr> \
-</table> \
-";
-		var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, table);
-		var p = dialog.doc.getElementById("--HA-style");
-		p.appendChild(st_prop);
-		var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, table);
-		p = dialog.doc.getElementById("--HA-layout");
-		p.appendChild(st_layout);
-		dialog.modal = true;
-		dialog.addButtons("ok", "cancel");
-		dialog.showAtElement(dialog.editor._iframe, "c");
-	});
-};
-
-// this function requires the file PopupDiv/PopupWin to be loaded from browser
-TableOperations.prototype.dialogRowCellProperties = function(cell) {
-	var i18n = TableOperations.I18N;
-	// retrieve existing values
-	var element = this.getClosest(cell ? "td" : "tr");
-	var table = this.getClosest("table");
-	// this.editor.selectNodeContents(element);
-	// this.editor.updateToolbar();
-
-	var dialog = new PopupWin(this.editor, i18n[cell ? "Cell Properties" : "Row Properties"], function(dialog, params) {
-		TableOperations.processStyle(params, element);
-		for (var i in params) {
-			var val = params[i];
-			switch (i) {
-			    case "f_align":
-				element.align = val;
-				break;
-			    case "f_char":
-				element.ch = val;
-				break;
-			    case "f_valign":
-				element.vAlign = val;
-				break;
-			}
-		}
-		// various workarounds to refresh the table display (Gecko,
-		// what's going on?! do not disappoint me!)
-		dialog.editor.forceRedraw();
-		dialog.editor.focusEditor();
-		dialog.editor.updateToolbar();
-		var save_collapse = table.style.borderCollapse;
-		table.style.borderCollapse = "collapse";
-		table.style.borderCollapse = "separate";
-		table.style.borderCollapse = save_collapse;
-	},
-
-	// this function gets called when the dialog needs to be initialized
-	function (dialog) {
-
-		var f_align = element.align;
-		var f_valign = element.vAlign;
-		var f_char = element.ch;
-
-		function selected(val) {
-			return val ? " selected" : "";
-		};
-
-		// dialog contents
-		dialog.content.style.width = "400px";
-		dialog.content.innerHTML = " \
-<div class='title'\
- style='background: url(" + dialog.baseURL + dialog.editor.imgURL(cell ? "cell-prop.gif" : "row-prop.gif", "TableOperations") + ") #fff 98% 50% no-repeat'>" + i18n[cell ? "Cell Properties" : "Row Properties"] + "</div> \
-<table style='width:100%'> \
-  <tr> \
-    <td id='--HA-layout'> \
-"+//      <fieldset><legend>" + i18n["Layout"] + "</legend> \
-//        <table style='width:100%'> \
-//         <tr> \
-//           <td class='label'>" + i18n["Align"] + ":</td> \
-//           <td> \
-//             <select name='f_align'> \
-//               <option value='left'" + selected(f_align == "left") + ">" + i18n["Left"] + "</option> \
-//               <option value='center'" + selected(f_align == "center") + ">" + i18n["Center"] + "</option> \
-//               <option value='right'" + selected(f_align == "right") + ">" + i18n["Right"] + "</option> \
-//               <option value='char'" + selected(f_align == "char") + ">" + i18n["Char"] + "</option> \
-//             </select> \
-//             &nbsp;&nbsp;" + i18n["Char"] + ": \
-//             <input type='text' style='font-family: monospace; text-align: center' name='f_char' size='1' value='" + f_char + "' /> \
-//           </td> \
-//         </tr><tr> \
-//           <td class='label'>" + i18n["Vertical align"] + ":</td> \
-//           <td> \
-//             <select name='f_valign'> \
-//               <option value='top'" + selected(f_valign == "top") + ">" + i18n["Top"] + "</option> \
-//               <option value='middle'" + selected(f_valign == "middle") + ">" + i18n["Middle"] + "</option> \
-//               <option value='bottom'" + selected(f_valign == "bottom") + ">" + i18n["Bottom"] + "</option> \
-//               <option value='baseline'" + selected(f_valign == "baseline") + ">" + i18n["Baseline"] + "</option> \
-//             </select> \
-//           </td> \
-//         </tr> \
-//        </table> \
-//       </fieldset> \
-"    </td> \
-  </tr> \
-  <tr> \
-    <td id='--HA-style'></td> \
-  </tr> \
-</table> \
-";
-		var st_prop = TableOperations.createStyleFieldset(dialog.doc, dialog.editor, element);
-		var p = dialog.doc.getElementById("--HA-style");
-		p.appendChild(st_prop);
-		var st_layout = TableOperations.createStyleLayoutFieldset(dialog.doc, dialog.editor, element);
-		p = dialog.doc.getElementById("--HA-layout");
-		p.appendChild(st_layout);
-		dialog.modal = true;
-		dialog.addButtons("ok", "cancel");
-		dialog.showAtElement(dialog.editor._iframe, "c");
-	});
-};
-
-// this function gets called when some button from the TableOperations toolbar
-// was pressed.
-TableOperations.prototype.buttonPress = function(editor, button_id) {
-	this.editor = editor;
-	var mozbr = HTMLArea.is_gecko ? "<br />" : "";
-	var i18n = TableOperations.I18N;
-
-	// helper function that clears the content in a table row
-	function clearRow(tr) {
-		var tds = tr.getElementsByTagName("td");
-		for (var i = tds.length; --i >= 0;) {
-			var td = tds[i];
-			td.rowSpan = 1;
-			td.innerHTML = mozbr;
-		}
-	};
-
-	function splitRow(td) {
-		var n = parseInt("" + td.rowSpan);
-		var nc = parseInt("" + td.colSpan);
-		td.rowSpan = 1;
-		tr = td.parentNode;
-		var itr = tr.rowIndex;
-		var trs = tr.parentNode.rows;
-		var index = td.cellIndex;
-		while (--n > 0) {
-			tr = trs[++itr];
-			var otd = editor._doc.createElement("td");
-			otd.colSpan = td.colSpan;
-			otd.innerHTML = mozbr;
-			tr.insertBefore(otd, tr.cells[index]);
-		}
-		editor.forceRedraw();
-		editor.updateToolbar();
-	};
-
-	function splitCol(td) {
-		var nc = parseInt("" + td.colSpan);
-		td.colSpan = 1;
-		tr = td.parentNode;
-		var ref = td.nextSibling;
-		while (--nc > 0) {
-			var otd = editor._doc.createElement("td");
-			otd.rowSpan = td.rowSpan;
-			otd.innerHTML = mozbr;
-			tr.insertBefore(otd, ref);
-		}
-		editor.forceRedraw();
-		editor.updateToolbar();
-	};
-
-	function splitCell(td) {
-		var nc = parseInt("" + td.colSpan);
-		splitCol(td);
-		var items = td.parentNode.cells;
-		var index = td.cellIndex;
-		while (nc-- > 0) {
-			splitRow(items[index++]);
-		}
-	};
-
-	function selectNextNode(el) {
-		var node = el.nextSibling;
-		while (node && node.nodeType != 1) {
-			node = node.nextSibling;
-		}
-		if (!node) {
-			node = el.previousSibling;
-			while (node && node.nodeType != 1) {
-				node = node.previousSibling;
-			}
-		}
-		if (!node) {
-			node = el.parentNode;
-		}
-		editor.selectNodeContents(node);
-	};
-
-	switch (button_id) {
-		// ROWS
-
-	    case "TO-row-insert-above":
-	    case "TO-row-insert-under":
-		var tr = this.getClosest("tr");
-		if (!tr) {
-			break;
-		}
-		var otr = tr.cloneNode(true);
-		clearRow(otr);
-		tr.parentNode.insertBefore(otr, /under/.test(button_id) ? tr.nextSibling : tr);
-		editor.forceRedraw();
-		editor.focusEditor();
-		break;
-	    case "TO-row-delete":
-		var tr = this.getClosest("tr");
-		if (!tr) {
-			break;
-		}
-		var par = tr.parentNode;
-		if (par.rows.length == 1) {
-			alert(i18n["not-del-last-row"]);
-			break;
-		}
-		// set the caret first to a position that doesn't
-		// disappear.
-		selectNextNode(tr);
-		par.removeChild(tr);
-		editor.forceRedraw();
-		editor.focusEditor();
-		editor.updateToolbar();
-		break;
-	    case "TO-row-split":
-		var td = this.getClosest("td");
-		if (!td) {
-			break;
-		}
-		splitRow(td);
-		break;
-
-		// COLUMNS
-
-	    case "TO-col-insert-before":
-	    case "TO-col-insert-after":
-		var td = this.getClosest("td");
-		if (!td) {
-			break;
-		}
-		var rows = td.parentNode.parentNode.rows;
-		var index = td.cellIndex;
-		for (var i = rows.length; --i >= 0;) {
-			var tr = rows[i];
-			var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)];
-			var otd = editor._doc.createElement("td");
-			otd.innerHTML = mozbr;
-			tr.insertBefore(otd, ref);
-		}
-		editor.focusEditor();
-		break;
-	    case "TO-col-split":
-		var td = this.getClosest("td");
-		if (!td) {
-			break;
-		}
-		splitCol(td);
-		break;
-	    case "TO-col-delete":
-		var td = this.getClosest("td");
-		if (!td) {
-			break;
-		}
-		var index = td.cellIndex;
-		if (td.parentNode.cells.length == 1) {
-			alert(i18n["not-del-last-col"]);
-			break;
-		}
-		// set the caret first to a position that doesn't disappear
-		selectNextNode(td);
-		var rows = td.parentNode.parentNode.rows;
-		for (var i = rows.length; --i >= 0;) {
-			var tr = rows[i];
-			tr.removeChild(tr.cells[index]);
-		}
-		editor.forceRedraw();
-		editor.focusEditor();
-		editor.updateToolbar();
-		break;
-
-		// CELLS
-
-	    case "TO-cell-split":
-		var td = this.getClosest("td");
-		if (!td) {
-			break;
-		}
-		splitCell(td);
-		break;
-	    case "TO-cell-insert-before":
-	    case "TO-cell-insert-after":
-		var td = this.getClosest("td");
-		if (!td) {
-			break;
-		}
-		var tr = td.parentNode;
-		var otd = editor._doc.createElement("td");
-		otd.innerHTML = mozbr;
-		tr.insertBefore(otd, /after/.test(button_id) ? td.nextSibling : td);
-		editor.forceRedraw();
-		editor.focusEditor();
-		break;
-	    case "TO-cell-delete":
-		var td = this.getClosest("td");
-		if (!td) {
-			break;
-		}
-		if (td.parentNode.cells.length == 1) {
-			alert(i18n["not-del-last-cell"]);
-			break;
-		}
-		// set the caret first to a position that doesn't disappear
-		selectNextNode(td);
-		td.parentNode.removeChild(td);
-		editor.forceRedraw();
-		editor.updateToolbar();
-		break;
-	    case "TO-cell-merge":
-		// !! FIXME: Mozilla specific !!
-		var sel = editor._getSelection();
-		var range, i = 0;
-		var rows = [];
-		var row = null;
-		var cells = null;
-		if (!HTMLArea.is_ie) {
-			try {
-				while (range = sel.getRangeAt(i++)) {
-					var td = range.startContainer.childNodes[range.startOffset];
-					if (td.parentNode != row) {
-						row = td.parentNode;
-						(cells) && rows.push(cells);
-						cells = [];
-					}
-					cells.push(td);
-				}
-			} catch(e) {/* finished walking through selection */}
-			rows.push(cells);
-		} else {
-			// Internet Explorer "browser"
-			var td = this.getClosest("td");
-			if (!td) {
-				alert(i18n["Please click into some cell"]);
-				break;
-			}
-			var tr = td.parentElement;
-			var no_cols = prompt(i18n["How many columns would you like to merge?"], 2);
-			if (!no_cols) {
-				// cancelled
-				break;
-			}
-			var no_rows = prompt(i18n["How many rows would you like to merge?"], 2);
-			if (!no_rows) {
-				// cancelled
-				break;
-			}
-			var cell_index = td.cellIndex;
-			while (no_rows-- > 0) {
-				td = tr.cells[cell_index];
-				cells = [td];
-				for (var i = 1; i < no_cols; ++i) {
-					td = td.nextSibling;
-					if (!td) {
-						break;
-					}
-					cells.push(td);
-				}
-				rows.push(cells);
-				tr = tr.nextSibling;
-				if (!tr) {
-					break;
-				}
-			}
-		}
-		var HTML = "";
-		for (i = 0; i < rows.length; ++i) {
-			// i && (HTML += "<br />");
-			var cells = rows[i];
-			for (var j = 0; j < cells.length; ++j) {
-				// j && (HTML += "&nbsp;");
-				var cell = cells[j];
-				HTML += cell.innerHTML;
-				(i || j) && (cell.parentNode.removeChild(cell));
-			}
-		}
-		var td = rows[0][0];
-		td.innerHTML = HTML;
-		td.rowSpan = rows.length;
-		td.colSpan = rows[0].length;
-		editor.selectNodeContents(td);
-		editor.forceRedraw();
-		editor.focusEditor();
-		break;
-
-		// PROPERTIES
-
-	    case "TO-table-prop":
-		this.dialogTableProperties();
-		break;
-
-	    case "TO-row-prop":
-		this.dialogRowCellProperties(false);
-		break;
-
-	    case "TO-cell-prop":
-		this.dialogRowCellProperties(true);
-		break;
-
-	    default:
-		alert("Button [" + button_id + "] not yet implemented");
-	}
-};
-
-// the list of buttons added by this plugin
-TableOperations.btnList = [
-	// table properties button
-	["table-prop",       "table"],
-	null,			// separator
-
-	// ROWS
-	["row-prop",         "tr"],
-	["row-insert-above", "tr"],
-	["row-insert-under", "tr"],
-	["row-delete",       "tr"],
-	["row-split",        "td[rowSpan!=1]"],
-	null,
-
-	// COLS
-	["col-insert-before", "td"],
-	["col-insert-after",  "td"],
-	["col-delete",        "td"],
-	["col-split",         "td[colSpan!=1]"],
-	null,
-
-	// CELLS
-	["cell-prop",          "td"],
-	["cell-insert-before", "td"],
-	["cell-insert-after",  "td"],
-	["cell-delete",        "td"],
-	["cell-merge",         "tr"],
-	["cell-split",         "td[colSpan!=1,rowSpan!=1]"]
-	];
-
-
-
-//// GENERIC CODE [style of any element; this should be moved into a separate
-//// file as it'll be very useful]
-//// BEGIN GENERIC CODE -----------------------------------------------------
-
-TableOperations.getLength = function(value) {
-	var len = parseInt(value);
-	if (isNaN(len)) {
-		len = "";
-	}
-	return len;
-};
-
-// Applies the style found in "params" to the given element.
-TableOperations.processStyle = function(params, element) {
-	var style = element.style;
-	for (var i in params) {
-		var val = params[i];
-		switch (i) {
-		    case "f_st_backgroundColor":
-			style.backgroundColor = val;
-			break;
-		    case "f_st_color":
-			style.color = val;
-			break;
-		    case "f_st_backgroundImage":
-			if (/\S/.test(val)) {
-				style.backgroundImage = "url(" + val + ")";
-			} else {
-				style.backgroundImage = "none";
-			}
-			break;
-		    case "f_st_borderWidth":
-			style.borderWidth = val;
-			break;
-		    case "f_st_borderStyle":
-			style.borderStyle = val;
-			break;
-		    case "f_st_borderColor":
-			style.borderColor = val;
-			break;
-		    case "f_st_borderCollapse":
-			style.borderCollapse = val ? "collapse" : "";
-			break;
-		    case "f_st_width":
-			if (/\S/.test(val)) {
-				style.width = val + params["f_st_widthUnit"];
-			} else {
-				style.width = "";
-			}
-			break;
-		    case "f_st_height":
-			if (/\S/.test(val)) {
-				style.height = val + params["f_st_heightUnit"];
-			} else {
-				style.height = "";
-			}
-			break;
-		    case "f_st_textAlign":
-			if (val == "char") {
-				var ch = params["f_st_textAlignChar"];
-				if (ch == '"') {
-					ch = '\\"';
-				}
-				style.textAlign = '"' + ch + '"';
-			} else {
-				style.textAlign = val;
-			}
-			break;
-		    case "f_st_verticalAlign":
-			style.verticalAlign = val;
-			break;
-		    case "f_st_float":
-			style.cssFloat = val;
-			break;
-// 		    case "f_st_margin":
-// 			style.margin = val + "px";
-// 			break;
-// 		    case "f_st_padding":
-// 			style.padding = val + "px";
-// 			break;
-		}
-	}
-};
-
-// Returns an HTML element for a widget that allows color selection.  That is,
-// a button that contains the given color, if any, and when pressed will popup
-// the sooner-or-later-to-be-rewritten select_color.html dialog allowing user
-// to select some color.  If a color is selected, an input field with the name
-// "f_st_"+name will be updated with the color value in #123456 format.
-TableOperations.createColorButton = function(doc, editor, color, name) {
-	if (!color) {
-		color = "";
-	} else if (!/#/.test(color)) {
-		color = HTMLArea._colorToRgb(color);
-	}
-
-	var df = doc.createElement("span");
- 	var field = doc.createElement("input");
-	field.type = "hidden";
-	df.appendChild(field);
- 	field.name = "f_st_" + name;
-	field.value = color;
-	var button = doc.createElement("span");
-	button.className = "buttonColor";
-	df.appendChild(button);
-	var span = doc.createElement("span");
-	span.className = "chooser";
-	// span.innerHTML = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
-	span.style.backgroundColor = color;
-	button.appendChild(span);
-	button.onmouseover = function() { if (!this.disabled) { this.className += " buttonColor-hilite"; }};
-	button.onmouseout = function() { if (!this.disabled) { this.className = "buttonColor"; }};
-	span.onclick = function() {
-		if (this.parentNode.disabled) {
-			return false;
-		}
-		editor._popupDialog("select_color.html", function(color) {
-			if (color) {
-				span.style.backgroundColor = "#" + color;
-				field.value = "#" + color;
-			}
-		}, color);
-	};
-	var span2 = doc.createElement("span");
-	span2.innerHTML = "&#x00d7;";
-	span2.className = "nocolor";
-	span2.title = TableOperations.I18N["Unset color"];
-	button.appendChild(span2);
-	span2.onmouseover = function() { if (!this.parentNode.disabled) { this.className += " nocolor-hilite"; }};
-	span2.onmouseout = function() { if (!this.parentNode.disabled) { this.className = "nocolor"; }};
-	span2.onclick = function() {
-		span.style.backgroundColor = "";
-		field.value = "";
-	};
-	return df;
-};
-
-TableOperations.createStyleLayoutFieldset = function(doc, editor, el) {
-	var i18n = TableOperations.I18N;
-	var fieldset = doc.createElement("fieldset");
-	var legend = doc.createElement("legend");
-	fieldset.appendChild(legend);
-	legend.innerHTML = i18n["Layout"];
-	var table = doc.createElement("table");
-	fieldset.appendChild(table);
-	table.style.width = "100%";
-	var tbody = doc.createElement("tbody");
-	table.appendChild(tbody);
-
-	var tagname = el.tagName.toLowerCase();
-	var tr, td, input, select, option, options, i;
-
-	if (tagname != "td" && tagname != "tr" && tagname != "th") {
-		tr = doc.createElement("tr");
-		tbody.appendChild(tr);
-		td = doc.createElement("td");
-		td.className = "label";
-		tr.appendChild(td);
-		td.innerHTML = i18n["Float"] + ":";
-		td = doc.createElement("td");
-		tr.appendChild(td);
-		select = doc.createElement("select");
-		td.appendChild(select);
-		select.name = "f_st_float";
-		options = ["None", "Left", "Right"];
-		for (var i = 0; i < options.length; ++i) {
-			var Val = options[i];
-			var val = options[i].toLowerCase();
-			option = doc.createElement("option");
-			option.innerHTML = i18n[Val];
-			option.value = val;
-			option.selected = (("" + el.style.cssFloat).toLowerCase() == val);
-			select.appendChild(option);
-		}
-	}
-
-	tr = doc.createElement("tr");
-	tbody.appendChild(tr);
-	td = doc.createElement("td");
-	td.className = "label";
-	tr.appendChild(td);
-	td.innerHTML = i18n["Width"] + ":";
-	td = doc.createElement("td");
-	tr.appendChild(td);
-	input = doc.createElement("input");
-	input.type = "text";
-	input.value = TableOperations.getLength(el.style.width);
-	input.size = "5";
-	input.name = "f_st_width";
-	input.style.marginRight = "0.5em";
-	td.appendChild(input);
-	select = doc.createElement("select");
-	select.name = "f_st_widthUnit";
-	option = doc.createElement("option");
-	option.innerHTML = i18n["percent"];
-	option.value = "%";
-	option.selected = /%/.test(el.style.width);
-	select.appendChild(option);
-	option = doc.createElement("option");
-	option.innerHTML = i18n["pixels"];
-	option.value = "px";
-	option.selected = /px/.test(el.style.width);
-	select.appendChild(option);
-	td.appendChild(select);
-
-	select.style.marginRight = "0.5em";
-	td.appendChild(doc.createTextNode(i18n["Text align"] + ":"));
-	select = doc.createElement("select");
-	select.style.marginLeft = select.style.marginRight = "0.5em";
-	td.appendChild(select);
-	select.name = "f_st_textAlign";
-	options = ["Left", "Center", "Right", "Justify"];
-	if (tagname == "td") {
-		options.push("Char");
-	}
-	input = doc.createElement("input");
-	input.name = "f_st_textAlignChar";
-	input.size = "1";
-	input.style.fontFamily = "monospace";
-	td.appendChild(input);
-	for (var i = 0; i < options.length; ++i) {
-		var Val = options[i];
-		var val = Val.toLowerCase();
-		option = doc.createElement("option");
-		option.value = val;
-		option.innerHTML = i18n[Val];
-		option.selected = (el.style.textAlign.toLowerCase() == val);
-		select.appendChild(option);
-	}
-	function setCharVisibility(value) {
-		input.style.visibility = value ? "visible" : "hidden";
-		if (value) {
-			input.focus();
-			input.select();
-		}
-	};
-	select.onchange = function() { setCharVisibility(this.value == "char"); };
-	setCharVisibility(select.value == "char");
-
-	tr = doc.createElement("tr");
-	tbody.appendChild(tr);
-	td = doc.createElement("td");
-	td.className = "label";
-	tr.appendChild(td);
-	td.innerHTML = i18n["Height"] + ":";
-	td = doc.createElement("td");
-	tr.appendChild(td);
-	input = doc.createElement("input");
-	input.type = "text";
-	input.value = TableOperations.getLength(el.style.height);
-	input.size = "5";
-	input.name = "f_st_height";
-	input.style.marginRight = "0.5em";
-	td.appendChild(input);
-	select = doc.createElement("select");
-	select.name = "f_st_heightUnit";
-	option = doc.createElement("option");
-	option.innerHTML = i18n["percent"];
-	option.value = "%";
-	option.selected = /%/.test(el.style.height);
-	select.appendChild(option);
-	option = doc.createElement("option");
-	option.innerHTML = i18n["pixels"];
-	option.value = "px";
-	option.selected = /px/.test(el.style.height);
-	select.appendChild(option);
-	td.appendChild(select);
-
-	select.style.marginRight = "0.5em";
-	td.appendChild(doc.createTextNode(i18n["Vertical align"] + ":"));
-	select = doc.createElement("select");
-	select.name = "f_st_verticalAlign";
-	select.style.marginLeft = "0.5em";
-	td.appendChild(select);
-	options = ["Top", "Middle", "Bottom", "Baseline"];
-	for (var i = 0; i < options.length; ++i) {
-		var Val = options[i];
-		var val = Val.toLowerCase();
-		option = doc.createElement("option");
-		option.value = val;
-		option.innerHTML = i18n[Val];
-		option.selected = (el.style.verticalAlign.toLowerCase() == val);
-		select.appendChild(option);
-	}
-
-	return fieldset;
-};
-
-// Returns an HTML element containing the style attributes for the given
-// element.  This can be easily embedded into any dialog; the functionality is
-// also provided.
-TableOperations.createStyleFieldset = function(doc, editor, el) {
-	var i18n = TableOperations.I18N;
-	var fieldset = doc.createElement("fieldset");
-	var legend = doc.createElement("legend");
-	fieldset.appendChild(legend);
-	legend.innerHTML = i18n["CSS Style"];
-	var table = doc.createElement("table");
-	fieldset.appendChild(table);
-	table.style.width = "100%";
-	var tbody = doc.createElement("tbody");
-	table.appendChild(tbody);
-
-	var tr, td, input, select, option, options, i;
-
-	tr = doc.createElement("tr");
-	tbody.appendChild(tr);
-	td = doc.createElement("td");
-	tr.appendChild(td);
-	td.className = "label";
-	td.innerHTML = i18n["Background"] + ":";
-	td = doc.createElement("td");
-	tr.appendChild(td);
-	var df = TableOperations.createColorButton(doc, editor, el.style.backgroundColor, "backgroundColor");
-	df.firstChild.nextSibling.style.marginRight = "0.5em";
-	td.appendChild(df);
-	td.appendChild(doc.createTextNode(i18n["Image URL"] + ": "));
-	input = doc.createElement("input");
-	input.type = "text";
-	input.name = "f_st_backgroundImage";
-	if (el.style.backgroundImage.match(/url\(\s*(.*?)\s*\)/)) {
-		input.value = RegExp.$1;
-	}
-	// input.style.width = "100%";
-	td.appendChild(input);
-
-	tr = doc.createElement("tr");
-	tbody.appendChild(tr);
-	td = doc.createElement("td");
-	tr.appendChild(td);
-	td.className = "label";
-	td.innerHTML = i18n["FG Color"] + ":";
-	td = doc.createElement("td");
-	tr.appendChild(td);
-	td.appendChild(TableOperations.createColorButton(doc, editor, el.style.color, "color"));
-
-	// for better alignment we include an invisible field.
-	input = doc.createElement("input");
-	input.style.visibility = "hidden";
-	input.type = "text";
-	td.appendChild(input);
-
-	tr = doc.createElement("tr");
-	tbody.appendChild(tr);
-	td = doc.createElement("td");
-	tr.appendChild(td);
-	td.className = "label";
-	td.innerHTML = i18n["Border"] + ":";
-	td = doc.createElement("td");
-	tr.appendChild(td);
-
-	var colorButton = TableOperations.createColorButton(doc, editor, el.style.borderColor, "borderColor");
-	var btn = colorButton.firstChild.nextSibling;
-	td.appendChild(colorButton);
-	// borderFields.push(btn);
-	btn.style.marginRight = "0.5em";
-
-	select = doc.createElement("select");
-	var borderFields = [];
-	td.appendChild(select);
-	select.name = "f_st_borderStyle";
-	options = ["none", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"];
-	var currentBorderStyle = el.style.borderStyle;
-	// Gecko reports "solid solid solid solid" for "border-style: solid".
-	// That is, "top right bottom left" -- we only consider the first
-	// value.
-	(currentBorderStyle.match(/([^\s]*)\s/)) && (currentBorderStyle = RegExp.$1);
-	for (var i in options) {
-		var val = options[i];
-		option = doc.createElement("option");
-		option.value = val;
-		option.innerHTML = val;
-		(val == currentBorderStyle) && (option.selected = true);
-		select.appendChild(option);
-	}
-	select.style.marginRight = "0.5em";
-	function setBorderFieldsStatus(value) {
-		for (var i = 0; i < borderFields.length; ++i) {
-			var el = borderFields[i];
-			el.style.visibility = value ? "hidden" : "visible";
-			if (!value && (el.tagName.toLowerCase() == "input")) {
-				el.focus();
-				el.select();
-			}
-		}
-	};
-	select.onchange = function() { setBorderFieldsStatus(this.value == "none"); };
-
-	input = doc.createElement("input");
-	borderFields.push(input);
-	input.type = "text";
-	input.name = "f_st_borderWidth";
-	input.value = TableOperations.getLength(el.style.borderWidth);
-	input.size = "5";
-	td.appendChild(input);
-	input.style.marginRight = "0.5em";
-	var span = doc.createElement("span");
-	span.innerHTML = i18n["pixels"];
-	td.appendChild(span);
-	borderFields.push(span);
-
-	setBorderFieldsStatus(select.value == "none");
-
-	if (el.tagName.toLowerCase() == "table") {
-		// the border-collapse style is only for tables
-		tr = doc.createElement("tr");
-		tbody.appendChild(tr);
-		td = doc.createElement("td");
-		td.className = "label";
-		tr.appendChild(td);
-		input = doc.createElement("input");
-		input.type = "checkbox";
-		input.name = "f_st_borderCollapse";
-		input.id = "f_st_borderCollapse";
-		var val = (/collapse/i.test(el.style.borderCollapse));
-		input.checked = val ? 1 : 0;
-		td.appendChild(input);
-
-		td = doc.createElement("td");
-		tr.appendChild(td);
-		var label = doc.createElement("label");
-		label.htmlFor = "f_st_borderCollapse";
-		label.innerHTML = i18n["Collapsed borders"];
-		td.appendChild(label);
-	}
-
-// 	tr = doc.createElement("tr");
-// 	tbody.appendChild(tr);
-// 	td = doc.createElement("td");
-// 	td.className = "label";
-// 	tr.appendChild(td);
-// 	td.innerHTML = i18n["Margin"] + ":";
-// 	td = doc.createElement("td");
-// 	tr.appendChild(td);
-// 	input = doc.createElement("input");
-// 	input.type = "text";
-// 	input.size = "5";
-// 	input.name = "f_st_margin";
-// 	td.appendChild(input);
-// 	input.style.marginRight = "0.5em";
-// 	td.appendChild(doc.createTextNode(i18n["Padding"] + ":"));
-
-// 	input = doc.createElement("input");
-// 	input.type = "text";
-// 	input.size = "5";
-// 	input.name = "f_st_padding";
-// 	td.appendChild(input);
-// 	input.style.marginLeft = "0.5em";
-// 	input.style.marginRight = "0.5em";
-// 	td.appendChild(doc.createTextNode(i18n["pixels"]));
-
-	return fieldset;
-};
-
-//// END GENERIC CODE -------------------------------------------------------
diff -ruN 6171/e107_handlers/htmlarea/popupdiv.js 75/e107_handlers/htmlarea/popupdiv.js
--- 6171/e107_handlers/htmlarea/popupdiv.js	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popupdiv.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,369 +0,0 @@
-/** This file is derived from PopupDiv, developed by Mihai Bazon for
- * SamWare.net.  Modifications were needed to make it usable in HTMLArea.
- * HTMLArea is a free WYSIWYG online HTML editor from InteractiveTools.com.
- *
- * This file does not function standalone.  It is dependent of global functions
- * defined in HTMLArea-3.0 (htmlarea.js).
- *
- * Please see file htmlarea.js for further details.
- **/
-
-var is_ie = ( (navigator.userAgent.toLowerCase().indexOf("msie") != -1) &&
-	      (navigator.userAgent.toLowerCase().indexOf("opera") == -1) );
-var is_compat = (document.compatMode == "BackCompat");
-
-function PopupDiv(editor, titleText, handler, initFunction) {
-	var self = this;
-
-	this.editor = editor;
-	this.doc = editor._mdoc;
-	this.handler = handler;
-
-	var el = this.doc.createElement("div");
-	el.className = "content";
-
-	var popup = this.doc.createElement("div");
-	popup.className = "dialog popupdiv";
-	this.element = popup;
-	var s = popup.style;
-	s.position = "absolute";
-	s.left = "0px";
-	s.top = "0px";
-
-	var title = this.doc.createElement("div");
-	title.className = "title";
-	this.title = title;
-	popup.appendChild(title);
-
-	HTMLArea._addEvent(title, "mousedown", function(ev) {
-		self._dragStart(is_ie ? window.event : ev);
-	});
-
-	var button = this.doc.createElement("div");
-	button.className = "button";
-	title.appendChild(button);
-	button.innerHTML = "&#x00d7;";
-	title.appendChild(this.doc.createTextNode(titleText));
-	this.titleText = titleText;
-
-	button.onmouseover = function() {
-		this.className += " button-hilite";
-	};
-	button.onmouseout = function() {
-		this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
-	};
-	button.onclick = function() {
-		this.className = this.className.replace(/\s*button-hilite\s*/g, " ");
-		self.close();
-	};
-
-	popup.appendChild(el);
-	this.content = el;
-
-	this.doc.body.appendChild(popup);
-
-	this.dragging = false;
-	this.onShow = null;
-	this.onClose = null;
-	this.modal = false;
-
-	initFunction(this);
-};
-
-PopupDiv.currentPopup = null;
-
-PopupDiv.prototype.showAtElement = function(el, mode) {
-	this.defaultSize();
-	var pos, ew, eh;
-	var popup = this.element;
-	popup.style.display = "block";
-	var w = popup.offsetWidth;
-	var h = popup.offsetHeight;
-	popup.style.display = "none";
-	if (el != window) {
-		pos = PopupDiv.getAbsolutePos(el);
-		ew = el.offsetWidth;
-		eh = el.offsetHeight;
-	} else {
-		pos = {x:0, y:0};
-		var size = PopupDiv.getWindowSize();
-		ew = size.x;
-		eh = size.y;
-	}
-	var FX = false, FY = false;
-	if (mode.indexOf("l") != -1) {
-		pos.x -= w;
-		FX = true;
-	}
-	if (mode.indexOf("r") != -1) {
-		pos.x += ew;
-		FX = true;
-	}
-	if (mode.indexOf("t") != -1) {
-		pos.y -= h;
-		FY = true;
-	}
-	if (mode.indexOf("b") != -1) {
-		pos.y += eh;
-		FY = true;
-	}
-	if (mode.indexOf("c") != -1) {
-		FX || (pos.x += Math.round((ew - w) / 2));
-		FY || (pos.y += Math.round((eh - h) / 2));
-	}
-	this.showAt(pos.x, pos.y);
-};
-
-PopupDiv.prototype.defaultSize = function() {
-	var s = this.element.style;
-	var cs = this.element.currentStyle;
-	var addX = (is_ie && is_compat) ? (parseInt(cs.borderLeftWidth) +
-					   parseInt(cs.borderRightWidth) +
-					   parseInt(cs.paddingLeft) +
-					   parseInt(cs.paddingRight)) : 0;
-	var addY = (is_ie && is_compat) ? (parseInt(cs.borderTopWidth) +
-					   parseInt(cs.borderBottomWidth) +
-					   parseInt(cs.paddingTop) +
-					   parseInt(cs.paddingBottom)) : 0;
-	s.display = "block";
-	s.width = (this.content.offsetWidth + addX) + "px";
-	s.height = (this.content.offsetHeight + this.title.offsetHeight) + "px";
-	s.display = "none";
-};
-
-PopupDiv.prototype.showAt = function(x, y) {
-	this.defaultSize();
-	var s = this.element.style;
-	s.display = "block";
-	s.left = x + "px";
-	s.top = y + "px";
-	this.hideShowCovered();
-
-	PopupDiv.currentPopup = this;
-	HTMLArea._addEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
-	HTMLArea._addEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
-	if (is_ie && this.modal) {
-		this.doc.body.setCapture(false);
-		this.doc.body.onlosecapture = function() {
-			(PopupDiv.currentPopup) && (this.doc.body.setCapture(false));
-		};
-	}
-	window.event && HTMLArea._stopEvent(window.event);
-
-	if (typeof this.onShow == "function") {
-		this.onShow();
-	} else if (typeof this.onShow == "string") {
-		eval(this.onShow);
-	}
-
-	var field = this.element.getElementsByTagName("input")[0];
-	if (!field) {
-		field = this.element.getElementsByTagName("select")[0];
-	}
-	if (!field) {
-		field = this.element.getElementsByTagName("textarea")[0];
-	}
-	if (field) {
-		field.focus();
-	}
-};
-
-PopupDiv.prototype.close = function() {
-	this.element.style.display = "none";
-	PopupDiv.currentPopup = null;
-	this.hideShowCovered();
-	HTMLArea._removeEvents(this.doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
-	HTMLArea._removeEvents(this.editor._doc.body, ["mousedown", "click"], PopupDiv.checkPopup);
-	is_ie && this.modal && this.doc.body.releaseCapture();
-	if (typeof this.onClose == "function") {
-		this.onClose();
-	} else if (typeof this.onClose == "string") {
-		eval(this.onClose);
-	}
-	this.element.parentNode.removeChild(this.element);
-};
-
-PopupDiv.prototype.getForm = function() {
-	var forms = this.content.getElementsByTagName("form");
-	return (forms.length > 0) ? forms[0] : null;
-};
-
-PopupDiv.prototype.callHandler = function() {
-	var tags = ["input", "textarea", "select"];
-	var params = new Object();
-	for (var ti = tags.length; --ti >= 0;) {
-		var tag = tags[ti];
-		var els = this.content.getElementsByTagName(tag);
-		for (var j = 0; j < els.length; ++j) {
-			var el = els[j];
-			params[el.name] = el.value;
-		}
-	}
-	this.handler(this, params);
-	return false;
-};
-
-PopupDiv.getAbsolutePos = function(el) {
-	var r = { x: el.offsetLeft, y: el.offsetTop };
-	if (el.offsetParent) {
-		var tmp = PopupDiv.getAbsolutePos(el.offsetParent);
-		r.x += tmp.x;
-		r.y += tmp.y;
-	}
-	return r;
-};
-
-PopupDiv.getWindowSize = function() {
-	if (window.innerHeight) {
-		return { y: window.innerHeight, x: window.innerWidth };
-	}
-	if (this.doc.body.clientHeight) {
-		return { y: this.doc.body.clientHeight, x: this.doc.body.clientWidth };
-	}
-	return { y: this.doc.documentElement.clientHeight, x: this.doc.documentElement.clientWidth };
-};
-
-PopupDiv.prototype.hideShowCovered = function () {
-	var self = this;
-	function isContained(el) {
-		while (el) {
-			if (el == self.element) {
-				return true;
-			}
-			el = el.parentNode;
-		}
-		return false;
-	};
-	var tags = new Array("applet", "select");
-	var el = this.element;
-
-	var p = PopupDiv.getAbsolutePos(el);
-	var EX1 = p.x;
-	var EX2 = el.offsetWidth + EX1;
-	var EY1 = p.y;
-	var EY2 = el.offsetHeight + EY1;
-
-	if (el.style.display == "none") {
-		EX1 = EX2 = EY1 = EY2 = 0;
-	}
-
-	for (var k = tags.length; k > 0; ) {
-		var ar = this.doc.getElementsByTagName(tags[--k]);
-		var cc = null;
-
-		for (var i = ar.length; i > 0;) {
-			cc = ar[--i];
-			if (isContained(cc)) {
-				cc.style.visibility = "visible";
-				continue;
-			}
-
-			p = PopupDiv.getAbsolutePos(cc);
-			var CX1 = p.x;
-			var CX2 = cc.offsetWidth + CX1;
-			var CY1 = p.y;
-			var CY2 = cc.offsetHeight + CY1;
-
-			if ((CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) {
-				cc.style.visibility = "visible";
-			} else {
-				cc.style.visibility = "hidden";
-			}
-		}
-	}
-};
-
-PopupDiv.prototype._dragStart = function (ev) {
-	if (this.dragging) {
-		return false;
-	}
-	this.dragging = true;
-	PopupDiv.currentPopup = this;
-	var posX = ev.clientX;
-	var posY = ev.clientY;
-	if (is_ie) {
-		posY += this.doc.body.scrollTop;
-		posX += this.doc.body.scrollLeft;
-	} else {
-		posY += window.scrollY;
-		posX += window.scrollX;
-	}
-	var st = this.element.style;
-	this.xOffs = posX - parseInt(st.left);
-	this.yOffs = posY - parseInt(st.top);
-	HTMLArea._addEvent(this.doc, "mousemove", PopupDiv.dragIt);
-	HTMLArea._addEvent(this.doc, "mouseover", HTMLArea._stopEvent);
-	HTMLArea._addEvent(this.doc, "mouseup", PopupDiv.dragEnd);
-	HTMLArea._stopEvent(ev);
-};
-
-PopupDiv.dragIt = function (ev) {
-	var popup = PopupDiv.currentPopup;
-	if (!(popup && popup.dragging)) {
-		return false;
-	}
-	is_ie && (ev = window.event);
-	var posX = ev.clientX;
-	var posY = ev.clientY;
-	if (is_ie) {
-		posY += this.doc.body.scrollTop;
-		posX += this.doc.body.scrollLeft;
-	} else {
-		posY += window.scrollY;
-		posX += window.scrollX;
-	}
-	popup.hideShowCovered();
-	var st = popup.element.style;
-	st.left = (posX - popup.xOffs) + "px";
-	st.top = (posY - popup.yOffs) + "px";
-	HTMLArea._stopEvent(ev);
-};
-
-PopupDiv.dragEnd = function () {
-	var popup = PopupDiv.currentPopup;
-	if (!popup) {
-		return false;
-	}
-	popup.dragging = false;
-	HTMLArea._removeEvent(popup.doc, "mouseup", PopupDiv.dragEnd);
-	HTMLArea._removeEvent(popup.doc, "mouseover", HTMLArea._stopEvent);
-	HTMLArea._removeEvent(popup.doc, "mousemove", PopupDiv.dragIt);
-	popup.hideShowCovered();
-};
-
-PopupDiv.checkPopup = function (ev) {
-	is_ie && (ev = window.event);
-	var el = is_ie ? ev.srcElement : ev.target;
-	var cp = PopupDiv.currentPopup;
-	for (; (el != null) && (el != cp.element); el = el.parentNode);
-	if (el == null) {
-		cp.modal || ev.type == "mouseover" || cp.close();
-		HTMLArea._stopEvent(ev);
-	}
-};
-
-PopupDiv.prototype.addButtons = function() {
-	var self = this;
-	var div = this.doc.createElement("div");
-	this.content.appendChild(div);
-	div.className = "buttons";
-	for (var i = 0; i < arguments.length; ++i) {
-		var btn = arguments[i];
-		var button = this.doc.createElement("button");
-		div.appendChild(button);
-		button.innerHTML = HTMLArea.I18N.buttons[btn];
-		switch (btn) {
-		    case "ok":
-			button.onclick = function() {
-				self.callHandler();
-				self.close();
-			};
-			break;
-		    case "cancel":
-			button.onclick = function() {
-				self.close();
-			};
-			break;
-		}
-	}
-};
diff -ruN 6171/e107_handlers/htmlarea/popups/about.html 75/e107_handlers/htmlarea/popups/about.html
--- 6171/e107_handlers/htmlarea/popups/about.html	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/about.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,392 +0,0 @@
-<!--
-
-(c) dynarch.com, 2003-2004
-Author: Mihai Bazon, http://dynarch.com/mishoo
-Distributed as part of HTMLArea 3.0
-
-"You are not expected to understand this...  I don't neither."
-
-                      (from The Linux Kernel Source Code,
-                            ./arch/x86_64/ia32/ptrace.c:90)
-
-;-)
-
--->
-
-<html style="height: 100%">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>About HTMLArea</title>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript">
-window.resizeTo(450, 250);
-var TABS = [];
-var CURRENT_TAB = 0;
-var CONTENT_HEIGHT_DIFF = 0;
-var CONTENT_WIDTH_DIFF = 0;
-function selectTab(idx) {
-  var ct = TABS[CURRENT_TAB];
-  ct.className = ct.className.replace(/\s*tab-current\s*/, ' ');
-  ct = TABS[CURRENT_TAB = idx];
-  ct.className += ' tab-current';
-  for (var i = TABS.length; --i >= 0;) {
-    var area = document.getElementById("tab-area-" + i);
-    if (CURRENT_TAB == i) {
-      area.style.display = "block";
-    } else {
-      area.style.display = "none";
-    }
-  }
-  document.body.style.visibility = "hidden";
-  document.body.style.visibility = "visible";
-  document.cookie = "HTMLAREA-ABOUT-TAB=" + idx;
-}
-var editor = null;
-function initDocument() {
-  editor = window.dialogArguments;
-  HTMLArea = window.opener.HTMLArea;
-
-  var plugins = document.getElementById("plugins");
-  var j = 0;
-  var html = "<table width='99%' cellpadding='0' style='margin-top: 1em; collapse-borders: collapse; border: 1px solid #8b8;'>" +
-	  "<thead><tr>" +
-	  "<td>Name</td>" +
-	  "<td>Developer</td>" +
-	  "<td>Sponsored by</td>" +
-	  "<td>License<sup>*</sup></td>" +
-	  "</tr></thead><tbody>";
-  for (var i in editor.plugins) {
-    var info = editor.plugins[i];
-    html += "<tr><td>" + info.name + " v" + info.version + "</td>" + 
-            "<td><a href='" + info.developer_url + "' target='_blank' title='Visit developer website'>" +
-	    info.developer + "</a></td>" +
-	    "<td><a href='" + info.sponsor_url + "' target='_blank' title='Visit sponsor website'>" +
-	    info.sponsor + "</a></td>" +
-	    "<td>" + info.license + "</td></tr>";
-    ++j;
-  }
-
-  if (j) {
-          html += "</tbody></table>" +
-		  "<p><sup>*</sup> License \"htmlArea\" means that the plugin is distributed under the same terms " +
-		  "as HTMLArea itself.  Such plugins are likely to be those included in the official " +
-		  "HTMLArea distribution</p>";
-	  plugins.innerHTML = "<p>The following plugins have been loaded.</p>" + html;
-  } else {
-	  plugins.innerHTML = "<p>No plugins have been loaded</p>";
-  }
-
-  plugins.innerHTML += "<p>User agent reports:<br/>" + navigator.userAgent + "</p>";
-
-  var content = document.getElementById("content");
-  if (window.innerHeight) {
-    CONTENT_HEIGHT_DIFF = window.innerHeight - 250;
-    CONTENT_WIDTH_DIFF = window.innerWidth - content.offsetWidth;
-  } else {
-    CONTENT_HEIGHT_DIFF = document.body.offsetHeight - 250;
-    CONTENT_WIDTH_DIFF = document.body.offsetWidth - 400;
-  }
-  window.onresize();
-  var bar = document.getElementById("tabbar");
-  j = 0;
-  for (var i = bar.firstChild; i; i = i.nextSibling) {
-    TABS.push(i);
-    i.__msh_tab = j;
-    i.onmousedown = function(ev) { selectTab(this.__msh_tab); HTMLArea._stopEvent(ev || window.event); };
-    var area = document.getElementById("tab-area-" + j);
-    if (/tab-current/.test(i.className)) {
-      CURRENT_TAB = j;
-      area.style.display = "block";
-    } else {
-      area.style.display = "none";
-    }
-    ++j;
-  }
-  if (document.cookie.match(/HTMLAREA-ABOUT-TAB=([0-9]+)/))
-    selectTab(RegExp.$1);
-}
-window.onresize = function() {
-  var content = document.getElementById("content");
-  if (window.innerHeight) {
-    content.style.height = (window.innerHeight - CONTENT_HEIGHT_DIFF) + "px";
-    content.style.width = (window.innerWidth - CONTENT_WIDTH_DIFF) + "px";
-  } else {
-    content.style.height = (document.body.offsetHeight - CONTENT_HEIGHT_DIFF) + "px";
-    //content.style.width = (document.body.offsetWidth - CONTENT_WIDTH_DIFF) + "px";
-  }
-}
-</script>
-<style>
-  html,body,textarea,table { font-family: tahoma,verdana,arial; font-size: 11px;
-padding: 0px; margin: 0px; }
-  tt { font-size: 120%; }
-  body { padding: 0px; background: #cea; color: 000; }
-  a:link, a:visited { color: #00f; }
-  a:hover { color: #f00; }
-  a:active { color: #f80; }
-  button { font: 11px tahoma,verdana,sans-serif; background-color: #cea;
-      border-width: 1px; }
-
-  p { margin: 0.5em 0px; }
-
-  h1 { font: bold 130% georgia,"times new roman",serif; margin: 0px; border-bottom: 1px solid #6a6; }
-  h2 { font: bold 110% georgia,"times new roman",serif; margin: 0.7em 0px; }
-
-  thead {
-    font-weight: bold;
-    background-color: #dfb;
-  }
-
-  .logo, .logo-hover {
-    white-space: nowrap;
-    background-color: #8f4; color: #040; padding: 3px; border-bottom: 1px solid #555;
-    height: 5em;
-  }
-  .logo .brand, .logo-hover .brand {
-    margin-left: 0.5em; margin-right: 0.5em; padding-bottom: 0.1em;
-    font-family: impact,'arial black',arial,sans-serif; font-size: 28px;
-    border-bottom: 1px solid #595; text-align: center;
-    cursor: pointer;
-  }
-  .logo-hover {
-    background-color: #fff;
-  }
-  .logo-hover .brand {
-    color: #800;
-    border-color: #04f;
-  }
-  .logo .letter, .logo-hover .letter { position: relative; font-family: monospace; }
-  .logo .letter1 { top: 0.1em; }
-  .logo .letter2 { top: 0.05em; }
-  .logo .letter3 { top: -0.05em; }
-  .logo .letter4 { top: -0.1em; }
-
-  .logo-hover .letter1 { top: -0.1em; }
-  .logo-hover .letter2 { top: -0.05em; }
-  .logo-hover .letter3 { top: 0.05em; }
-  .logo-hover .letter4 { top: 0.1em; }
-  .logo .version, .logo-hover .version { font-family: georgia,"times new roman",serif; }
-  .logo .release {
-    font-size: 90%; margin-bottom: 1em;
-    text-align: center; color: #484;
-  }
-  .logo .visit { display: none; }
-  .logo-hover .release { display: none; }
-  .logo-hover .visit {
-    font-size: 90%; margin-bottom: 1em;
-    text-align: center; color: #448;
-  }
-  .buttons {
-    text-align: right; padding: 3px; background-color: #8f4;
-    border-top: 1px solid #555;
-  }
-  #tabbar {
-    position: relative;
-    left: 10px;
-  }
-  .tab {
-    color: #454;
-    cursor: pointer;
-    margin-left: -5px;
-    float: left; position: relative;
-    border: 1px solid #555;
-    top: -3px; left: -2px;
-    padding: 2px 10px 3px 10px;
-    border-top: none; background-color: #9b7;
-    -moz-border-radius: 0px 0px 4px 4px;
-    z-index: 0;
-  }
-  .tab-current {
-    color: #000;
-    top: -4px;
-    background-color: #cea;
-    padding: 3px 10px 4px 10px;
-    z-index: 10;
-  }
-  table.sponsors { border-top: 1px solid #aca; }
-  table.sponsors td {
-    border-bottom: 1px solid #aca; vertical-align: top;
-  }
-  table.sponsors tr td { padding: 2px 0px; }
-  table.sponsors tr td.sponsor { text-align: right; padding-right: 0.3em; white-space: nowrap; }
-  li, ol, ul { margin-top: 0px; margin-bottom: 0px; }
-</style></head>
-<body onload="__dlg_init(); initDocument();"
-><table cellspacing="0" cellpadding="0" style="border-collapse: collapse;
-      width: 100%; height: 100%;">
-
-<tr style="height: 1em"><td id="tdheader">
-
-<div class="logo">
-<div class="brand"
-onmouseover="this.parentNode.className='logo-hover';"
-onmouseout="this.parentNode.className='logo';"
-onclick="window.open('http://dynarch.com/htmlarea/');">
-<span class="letter letter1">&lt;H</span><span
-class="letter letter2">T</span><span
-class="letter letter3">M</span><span
-class="letter letter4">L</span>Area <span class="letter">/&gt;</span>
-<span class="version"><% $version.$release %></span></div>
-<div class="release">Compiled on <% $time %></div>
-<div class="visit">Go to http://dynarch.com/htmlarea/ [latest milestone release]</div>
-</div>
-
-</td></tr>
-<tr><td id="tdcontent" style="padding: 0.5em;">
-
-<div style="overflow: auto; height: 250px;" id="content">
-<div id="tab-areas">
-
-<div id="tab-area-0">
-
-  <h1>HTMLArea</h1>
-  
-  <p>A free WYSIWYG editor replacement for <tt>&lt;textarea&gt;</tt> fields.<br />
-  For Mozilla 1.3+ (any platform) or Internet Explorer 5.5+ (Windows).
-  </p>
-
-  <p style="text-align: center"
-  >&copy; 2002-2004 <a href="http://interactivetools.com" target="_blank">interactivetools.com</a>, inc.<br />
-  &copy; 2003-2004 <a href="http://dynarch.com" target="_blank">dynarch.com</a> LLC.<br />
-  All Rights Reserved.</p>
-
-  <h2>Project resources</h2>
-
-  <ul>
-  <li><a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
-  >Project page</a> (@ sourceforge.net)</li>
-  <li><a href="http://sourceforge.net/cvs/?group_id=69750" target="_blank"
-  >Anonymous CVS access</a> (@ sourceforge.net)</li>
-  <li><a href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse" target="_blank"
-  >Bug system</a> (@ sourceforge.net)</li>
-  <li><a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;" target="_blank"
-  >Forum</a> (@ interactivetools.com)</li>
-  <li><a href="http://www.dynarch.com/htmlarea/" target="_blank"
-  >Last public release</a> (@ dynarch.com)</li>
-  </ul>
-
-  <p>
-  For download section please see the <a href="http://sourceforge.net/projects/itools-htmlarea/" target="_blank"
-  >project page @ SourceForge</a>.
-  </p>
-
-<p style="margin-top: 1em; text-align: center;">Version 3.0 developed and maintained by <a
-href="http://dynarch.com/mishoo/" title="http://dynarch.com/mishoo/" target="_blank">Mihai Bazon</a> / <a
-href="http://dynarch.com" title="http://dynarch.com/" target="_blank">dynarch.com</a></p>
-
-</div>
-
-<div id="tab-area-1">
-<h1>Thank you</h1>
-
-  <p>
-  <a href="http://dynarch.com" target="_blank">dynarch.com</a> would like to thank the following
-  companies/persons for their <em>donations</em> to support development of HTMLArea (listed alphabetically):
-  </p>
-
-  <ul>
-    <li><a href="http://www.computerlove.co.uk" target="_blank">Code Computer Love Ltd.</a> (UK)</li>
-    <li><a href="http://www.neomedia.ro" target="_blank">Neomedia</a> (Romania)</li>
-    <li><a href="http://www.os3.it" target="_blank">OS3</a> (Italy)</li>
-    <li><a href="http://www.softwerk.net" target="_blank">SoftWerk</a> (Italy)</li>
-  </ul>
-
-  <p>Also many thanks to all people at InteractiveTools.com
-  <a href="http://www.interactivetools.com/forum/gforum.cgi?forum=14;">HTMLArea forums</a> for
-  contributing translations, feedback, bug reports and fixes.</p>
-
-  <p>
-  Last but not least, this project wouldn't have existed without
-  <a href="http://interactivetools.com" target="_blank">InteractiveTools.com</a>.
-  </p>
-
-</div>
-
-<div id="tab-area-2">
-<h1>htmlArea License (based on BSD license)</h1>
-
-<p style="text-align: center">© 2002-2004, interactivetools.com, inc.<br />
-  © 2003-2004 dynarch.com LLC<br />
-  All rights reserved.</p>
-
-<p>
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-</p>
-
-<ol>
-<li>
-Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-</li>
-
-<li>
-Redistributions in binary form must reproduce the above copyright notice,
-this list of conditions and the following disclaimer in the documentation
-and/or other materials provided with the distribution.
-</li>
-
-<li>
-Neither the name of interactivetools.com, inc. nor the names of its
-contributors may be used to endorse or promote products derived from this
-software without specific prior written permission.
-</li>
-</ol>
-
-<p>
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-</p>
-
-</div>
-
-<div id="tab-area-3">
-<h1>Plugins</h1>
-<div id="plugins">
-</div>
-</div>
-
-</div></div>
-
-
-</tr></td>
-<tr style="height: 1em"><td id="tdfooter">
-
-
-<div class="buttons">
-<div id="tabbar"
-><div class="tab tab-current"
->About</div><div class="tab"
->Thanks</div><div class="tab"
->License</div><div class="tab"
->Plugins</div></div>
-<button type="button" onclick="__dlg_close(null);">I agree it's cool</button>
-</div>
-
-</td></tr></table>
-
-</body></html>
-
-<%ARGS>
-  $version => '3.0'
-  $release => 'beta+'
-  $basename => 'HTMLArea-3.0-beta'
-</%ARGS>
-
-<%INIT>;
-if ($release =~ /\S/) {
-    $release = ' <span style="position: relative; top: -0.6em; font-size: 50%; font-weight: normal">[ rev. '.$release.' ]</span>';
-}
-
-use POSIX qw(strftime);
-my $time = strftime '%b %e, %Y %H:%M GMT', gmtime;
-</%INIT>
diff -ruN 6171/e107_handlers/htmlarea/popups/blank.html 75/e107_handlers/htmlarea/popups/blank.html
--- 6171/e107_handlers/htmlarea/popups/blank.html	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/blank.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,2 +0,0 @@
-<html>

-</html>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/popups/custom2.html 75/e107_handlers/htmlarea/popups/custom2.html
--- 6171/e107_handlers/htmlarea/popups/custom2.html	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/custom2.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,35 +0,0 @@
-<html style="width:300px; Height: 60px;">

- <head>

-  <title>Select Phrase</title>

-<script language="javascript">

-

-var myTitle = window.dialogArguments;

-document.title = myTitle;

-

-

-function returnSelected() {

-  var idx  = document.all.textPulldown.selectedIndex;

-  var text = document.all.textPulldown[idx].text;

-

-  window.returnValue = text;          // set return value

-  window.close();                     // close dialog

-}

-

-</script>

-</head>

-<body bgcolor="#FFFFFF" topmargin=15 leftmargin=0>

-

-<form method=get onSubmit="Set(document.all.ColorHex.value); return false;">

-<div align=center>

-

-<select name="textPulldown">

-<option>The quick brown</option>

-<option>fox jumps over</option>

-<option>the lazy dog.</option>

-</select>

-

-<input type="button" value=" Go " onClick="returnSelected()">

-

-</div>

-</form>

-</body></html>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/popups/editor_help.html 75/e107_handlers/htmlarea/popups/editor_help.html
--- 6171/e107_handlers/htmlarea/popups/editor_help.html	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/editor_help.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,16 +0,0 @@
-<html>

- <head>

-  <title>Editor Help</title>

-  <style>

-    body, td, p, div { font-family: arial; font-size: x-small; }

-  </style>

- </head>

-<body>

-

-<h2>Editor Help<hr></h2>

-

-Todo...

-

-

-</body>

-</html>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/popups/fullscreen.html 75/e107_handlers/htmlarea/popups/fullscreen.html
--- 6171/e107_handlers/htmlarea/popups/fullscreen.html	2004-08-11 04:26:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/fullscreen.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,139 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

-<html>

-  <head>

-    <title>Fullscreen HTMLArea</title>

-    <script type="text/javascript">

-      _editor_url = window.opener._editor_url || '../';

-      _editor_lang = window.opener._editor_lang;

-      _editor_css = window.opener._editor_css;

-      var BASE = window.opener.document.baseURI || window.opener.document.URL;

-      var head = document.getElementsByTagName("head")[0];

-      var base = document.createElement("base");

-      base.href = BASE;

-      head.appendChild(base);

-    </script>

-

-    <script type="text/javascript">

-        document.write('<scr' + 'ipt type="text/javascript" src="' + _editor_url + 'htmlarea.js"></scr' + 'ipt>');

-    </script>

-    <script type="text/javascript">

-	// load HTMLArea scripts that are present in the opener frame

-	var scripts = window.opener.HTMLArea._scripts;

-	for (var i = 3; i < scripts.length; ++i) {

-           //document.write("<scr" + "ipt type='text/javascript' src='" + scripts[i] + "'></scr" + "ipt>");

-           HTMLArea._loadScript(scripts[i]);

-        }

-    </script>

-

-    <!-- browser takes a coffee break here -->

-    <script type="text/javascript">

-var parent_object  = null;

-var editor	   = null;	// to be initialized later [ function init() ]

-

-/* ---------------------------------------------------------------------- *\

-   Function    : 

-   Description : 

-\* ---------------------------------------------------------------------- */

-

-function _CloseOnEsc(ev) {

-	ev || (ev = window.event) || (ev = editor._iframe.contentWindow.event);

-	if (ev.keyCode == 27) {

-		// update_parent();

-		window.close();

-		return;

-	}

-}

-

-/* ---------------------------------------------------------------------- *\

-   Function    : resize_editor

-   Description : resize the editor when the user resizes the popup

-\* ---------------------------------------------------------------------- */

-

-function resize_editor() {  // resize editor to fix window

-	var newHeight;

-	if (document.all) {

-		// IE

-		newHeight = document.body.offsetHeight - editor._toolbar.offsetHeight;

-		if (newHeight < 0) { newHeight = 0; }

-	} else {

-		// Gecko

-		newHeight = window.innerHeight - editor._toolbar.offsetHeight;

-	}

-	if (editor.config.statusBar) {

-		newHeight -= editor._statusBar.offsetHeight;

-	}

-	editor._textArea.style.height = editor._iframe.style.height = newHeight - (HTMLArea.is_gecko ? 8 : 0) + "px";

-}

-

-/* ---------------------------------------------------------------------- *\

-   Function    : init

-   Description : run this code on page load

-\* ---------------------------------------------------------------------- */

-

-function init() {

-	parent_object	   = opener.HTMLArea._object;

-	var config	   = HTMLArea.cloneObject( parent_object.config );

-	config.width	   = "100%";

-	config.height	   = "auto";

-

-	// change maximize button to minimize button

-	config.btnList["popupeditor"] = [ 'Minimize Editor', _editor_url + 'images/fullscreen_minimize.gif', true,

-					  function() { window.close(); } ];

-

-	// generate editor and resize it

-	editor = new HTMLArea("editor", config);

-

-	// register the plugins, if any

-	for (var i in parent_object.plugins) {

-		var plugin = parent_object.plugins[i];

-		try {

-			eval(plugin.name);

-			editor.registerPlugin2(plugin.name, plugin.args);

-		} catch(e) {};

-	}

-	// and restore the original toolbar

-        config.toolbar = parent_object.config.toolbar;

-	editor.generate();

-	editor._iframe.style.width = "100%";

-	editor._textArea.style.width = "100%";

-	resize_editor();

-

-	editor.doctype = parent_object.doctype;

-

-	// set child window contents and event handlers, after a small delay

-	setTimeout(function() {

-			   editor.setHTML(parent_object.getInnerHTML());

-

-			   // switch mode if needed

-			   if (parent_object._mode == "textmode") { editor.setMode("textmode"); }

-

-			   // continuously update parent editor window

-			   setInterval(update_parent, 500);

-

-			   // setup event handlers

-			   document.body.onkeypress = _CloseOnEsc;

-			   editor._doc.body.onkeypress = _CloseOnEsc;

-			   editor._textArea.onkeypress = _CloseOnEsc;

-			   window.onresize = resize_editor;

-		   }, 333);			 // give it some time to meet the new frame

-}

-

-/* ---------------------------------------------------------------------- *\

-   Function    : update_parent

-   Description : update parent window editor field with contents from child window

-   \* ---------------------------------------------------------------------- */

-

-function update_parent() {

-	// use the fast version

-	parent_object.setHTML(editor.getInnerHTML());

-}

-

-    </script>

-    <style type="text/css"> html, body { height: 100%; margin: 0px; border: 0px; background-color: buttonface; } </style>

-  </head>

-  <body scroll="no" onload="HTMLArea.onload = init; HTMLArea.init();" onunload="update_parent()">

-    <form style="margin: 0px; border: 1px solid; border-color: threedshadow threedhighlight threedhighlight threedshadow;">

-      <textarea name="editor" id="editor" style="width:100%; height:300px">&nbsp;</textarea>

-    </form>

-  </body>

-</html>

diff -ruN 6171/e107_handlers/htmlarea/popups/images.php 75/e107_handlers/htmlarea/popups/images.php
--- 6171/e107_handlers/htmlarea/popups/images.php	2005-05-13 06:18:38.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/images.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,658 +0,0 @@
-<?
-/***********************************************************************
-** Title.........:        Image Manager, draws the thumbnails and directies
-** Version.......:        1.01
-** Author........:        Xiang Wei ZHUO <wei@zhuo.org>
-** Filename......:        images.php
-** Last changed..:        8 Mar 2003
-** Notes.........:        Configuration in config.inc.php
-
-                    Functions
-                     - create a new folder,
-                     - delete folder,
-                     - upload new image
-                     - use cached thumbnail views
-
-***********************************************************************/
-require_once("../../../../class2.php"); 
-require_once( 'config.inc.php');
-
-if(isset($_GET['dir'])) {
-        $dirParam = $_GET['dir'];
-
-        if(strlen($dirParam) > 0)
-        {
-                if(substr($dirParam,0,1)=='/')
-                        $IMG_ROOT .= $dirParam;
-                else
-                        $IMG_ROOT = $dirParam;
-        }
-}
-
-$refresh_dirs = false;
-$clearUploads = false;
-
-if(strrpos($IMG_ROOT, '/')!= strlen($IMG_ROOT)-1)
-        $IMG_ROOT .= '/';
-
-
-if(isset($_GET['create']) && isset($_GET['dir']) && $SAFE_MODE == false)
-{
-        create_folder();
-}
-
-if(isset($_GET['delFile']) && isset($_GET['dir']))
-{
-        delete_file($_GET['delFile']);
-}
-
-if(isset($_GET['delFolder']) && isset($_GET['dir']))
-{
-        delete_folder($_GET['delFolder']);
-}
-
-if(USER && isset($_FILES['upload']) && is_array($_FILES['upload']) && isset($_POST['dirPath']))
-{
-
-        $dirPathPost = $_POST['dirPath'];
-
-        if(strlen($dirPathPost) > 0)
-        {
-                if(substr($dirPathPost,0,1)=='/')
-                        $IMG_ROOT .= $dirPathPost;
-                else
-                        $IMG_ROOT = $dirPathPost;
-        }
-
-        if(strrpos($IMG_ROOT, '/')!= strlen($IMG_ROOT)-1)
-                $IMG_ROOT .= '/';
-
-        do_upload($_FILES['upload'], $BASE_DIR.$BASE_ROOT.$dirPathPost.'/');
-}
-
-function do_upload($file, $dest_dir)
-{
-        global $clearUploads;
-
-        if(is_file($file['tmp_name']))
-        {
-                //var_dump($file); echo "DIR:$dest_dir";
-                move_uploaded_file($file['tmp_name'], $dest_dir.$file['name']);
-                chmod($dest_dir.$file['name'], 0666);
-        }
-
-
-
-        $clearUploads = true;
-}
-
-function delete_folder($folder)
-{
-        global $BASE_DIR, $refresh_dirs;
-        //var_dump($BASE_DIR);
-        $del_folder = dir_name($BASE_DIR).$folder;
-        //echo $del_folder;
-        if(is_dir($del_folder) && num_files($del_folder) <= 0) {
-                //echo $del_folder.'<br>';
-                rm_all_dir($del_folder);
-                $refresh_dirs = true;
-        }
-}
-
-function rm_all_dir($dir)
-{
-        //$dir = dir_name($dir);
-        //echo "OPEN:".$dir.'<Br>';
-        if(is_dir($dir))
-        {
-                $d = @dir($dir);
-
-                while (false !== ($entry = $d->read()))
-                {
-                        //echo "#".$entry.'<br>';
-                        if($entry != '.' && $entry != '..')
-                        {
-                                $node = $dir.'/'.$entry;
-                                //echo "NODE:".$node;
-                                if(is_file($node)) {
-                                        //echo " - is file<br>";
-                                        unlink($node);
-                                }
-                                else if(is_dir($node)) {
-                                        //echo " -        is Dir<br>";
-                                        rm_all_dir($node);
-                                }
-                        }
-                }
-                $d->close();
-
-                rmdir($dir);
-        }
-        //echo "RM: $dir <br>";
-}
-
-function delete_file($file)
-{
-        global $BASE_DIR;
-
-        $del_image = dir_name($BASE_DIR).$file;
-
-        $del_thumb = dir_name($del_image).'.'.basename($del_image);
-
-        if(is_file($del_image)) {
-                unlink($del_image);
-        }
-
-        if(is_file($del_thumb)) {
-                unlink($del_thumb);
-        }
-}
-
-function create_folder()
-{
-        global $BASE_DIR, $IMG_ROOT, $refresh_dirs;
-
-        $folder_name = $_GET['foldername'];
-
-        if(strlen($folder_name) >0)
-        {
-                $folder = $BASE_DIR.$IMG_ROOT.$folder_name;
-
-                if(!is_dir($folder) && !is_file($folder))
-                {
-                        mkdir($folder,0777);
-                        chmod($folder,0777);
-                        $refresh_dirs = true;
-                }
-        }
-}
-
-function num_files($dir)
-{
-        $total = 0;
-
-        if(is_dir($dir))
-        {
-                $d = @dir($dir);
-
-                while (false !== ($entry = $d->read()))
-                {
-                        //echo $entry."<br>";
-                        if(substr($entry,0,1) != '.') {
-                                $total++;
-                        }
-                }
-                $d->close();
-        }
-        return $total;
-}
-
-function dirs($dir,$abs_path)
-{
-        $d = dir($dir);
-                //echo "Handle: ".$d->handle."<br>\n";
-                //echo "Path: ".$d->path."<br>\n";
-                $dirs = array();
-                while (false !== ($entry = $d->read())) {
-                        if(is_dir($dir.'/'.$entry) && substr($entry,0,1) != '.')
-                        {
-                                //dirs($dir.'/'.$entry, $prefix.$prefix);
-                                //echo $prefix.$entry."<br>\n";
-                                $path['path'] = $dir.'/'.$entry;
-                                $path['name'] = $entry;
-                                $dirs[$entry] = $path;
-                        }
-                }
-                $d->close();
-
-                ksort($dirs);
-                for($i=0; $i<count($dirs); $i++)
-                {
-                        $name = key($dirs);
-                        $current_dir = $abs_path.'/'.$dirs[$name]['name'];
-                        echo ", \"$current_dir\"\n";
-                        dirs($dirs[$name]['path'],$current_dir);
-                        next($dirs);
-                }
-}
-
-function parse_size($size)
-{
-        if($size < 1024)
-                return $size.' btyes';
-        else if($size >= 1024 && $size < 1024*1024)
-        {
-                return sprintf('%01.2f',$size/1024.0).' Kb';
-        }
-        else
-        {
-                return sprintf('%01.2f',$size/(1024.0*1024)).' Mb';
-        }
-}
-
-function show_image($img, $file, $info, $size)
-{
-        global $BASE_DIR, $BASE_URL, $newPath;
-
-        $img_path = dir_name($img);
-        $img_file = basename($img);
-
-        $thumb_image = 'thumbs.php?img='.urlencode($img);
-
-        $img_url = $BASE_URL.$img_path.'/'.$img_file;
-
-        $filesize = parse_size($size);
-
-?>
-<td>
-<table width="102" border="0" cellpadding="0" cellspacing="2">
-  <tr>
-    <td align="center" class="imgBorder" onMouseOver="pviiClassNew(this,'imgBorderHover')" onMouseOut="pviiClassNew(this,'imgBorder')">
-        <a href="javascript:;" onClick="javascript:imageSelected('<? echo $img_url; ?>', <? echo $info[0];?>, <? echo $info[1]; ?>,'<? echo $file; ?>');"><img src="<? echo $thumb_image; ?>" alt="<? echo $file; ?> - <? echo $filesize; ?>" border="0"></a></td>
-  </tr>
-  <tr>
-    <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
-        <tr>
-          <td width="1%" class="buttonOut" onMouseOver="pviiClassNew(this,'buttonHover')" onMouseOut="pviiClassNew(this,'buttonOut')">
-                        <a href="javascript:;" onClick="javascript:preview('<? echo $img_url; ?>', '<? echo $file; ?>', ' <? echo $filesize; ?>',<? echo $info[0].','.$info[1]; ?>);"><img src="edit_pencil.gif" width="15" height="15" border="0"></a></td>
-          <td width="1%" class="buttonOut" onMouseOver="pviiClassNew(this,'buttonHover')" onMouseOut="pviiClassNew(this,'buttonOut')">
-                        <a href="images.php?delFile=<? echo $img_url; ?>&dir=<? echo $newPath; ?>" onClick="return deleteImage('<? echo $file; ?>');"><img src="edit_trash.gif" width="15" height="15" border="0"></a></td>
-          <td width="98%" class="imgCaption"><? echo $info[0].'x'.$info[1]; ?></td>
-        </tr>
-      </table></td>
-  </tr>
-</table>
-</td>
-<?
-}
-
-function show_dir($path, $dir)
-{
-        global $newPath, $BASE_DIR, $BASE_URL;
-
-        $num_files = num_files($BASE_DIR.$path);
-?>
-<td>
-<table width="102" border="0" cellpadding="0" cellspacing="2">
-  <tr>
-    <td align="center" class="imgBorder" onMouseOver="pviiClassNew(this,'imgBorderHover')" onMouseOut="pviiClassNew(this,'imgBorder')">
-          <a href="images.php?dir=<? echo $path; ?>" onClick="changeLoadingStatus('load')">
-                <img src="folder.gif" width="80" height="80" border=0 alt="<? echo $dir; ?>">
-          </a>
-        </td>
-  </tr>
-  <tr>
-    <td><table width="100%" border="0" cellspacing="1" cellpadding="2">
-        <tr>
-          <td width="1%" class="buttonOut" onMouseOver="pviiClassNew(this,'buttonHover')" onMouseOut="pviiClassNew(this,'buttonOut')">
-                        <a href="images.php?delFolder=<? echo $BASE_URL.$path; ?>&dir=<? echo $newPath; ?>" onClick="return deleteFolder('<? echo $dir; ?>', <? echo $num_files; ?>);"><img src="edit_trash.gif" width="15" height="15" border="0"></a></td>
-          <td width="99%" class="imgCaption"><? echo $dir; ?></td>
-        </tr>
-      </table></td>
-  </tr>
-</table>
-</td>
-<?
-}
-
-function draw_no_results()
-{
-?>
-<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
-  <tr>
-    <td><div align="center" style="font-size:large;font-weight:bold;color:#CCCCCC;font-family: Helvetica, sans-serif;">No Images Found</div></td>
-  </tr>
-</table>
-<?
-}
-
-function draw_no_dir()
-{
-        global $BASE_DIR, $BASE_ROOT;
-?>
-<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
-  <tr>
-    <td><div align="center" style="font-size:small;font-weight:bold;color:#CC0000;font-family: Helvetica, sans-serif;">Configuration Problem: &quot;<? echo $BASE_DIR.$BASE_ROOT; ?>&quot; does not exist.</div></td>
-  </tr>
-</table>
-<?
-}
-
-
-function draw_table_header()
-{
-        echo '<table border="0" cellpadding="0" cellspacing="2">';
-        echo '<tr>';
-}
-
-function draw_table_footer()
-{
-        echo '</tr>';
-        echo '</table>';
-}
-
-?>
-<html>
-<head>
-<title>Image Browser</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
-<style type="text/css">
-<!--
-.imgBorder {
-        height: 96px;
-        border: 1px solid threedface;
-        vertical-align: middle;
-}
-.imgBorderHover {
-        height: 96px;
-        border: 1px solid threedface;
-        vertical-align: middle;
-        background: #FFFFCC;
-        cursor: hand;
-}
-
-.buttonHover {
-        border: 1px solid;
-        border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-        cursor: hand;
-        background: #FFFFCC;
-}
-.buttonOut
-{
- border: 1px solid;
- border-color: white;
-}
-
-.imgCaption {
-        font-size: 9pt;
-        font-family: "MS Shell Dlg", Helvetica, sans-serif;
-        text-align: center;
-}
-.dirField {
-        font-size: 9pt;
-        font-family: "MS Shell Dlg", Helvetica, sans-serif;
-        width:110px;
-}
-
--->
-</style>
-<?
-        $dirPath = eregi_replace($BASE_ROOT,'',$IMG_ROOT);
-
-        $paths = explode('/', $dirPath);
-        $upDirPath = '/';
-        for($i=0; $i<count($paths)-2; $i++)
-        {
-                $path = $paths[$i];
-                if(strlen($path) > 0)
-                {
-                        $upDirPath .= $path.'/';
-                }
-        }
-
-        $slashIndex = strlen($dirPath);
-        $newPath = $dirPath;
-        if($slashIndex > 1 && substr($dirPath, $slashIndex-1, $slashIndex) == '/')
-        {
-                $newPath = substr($dirPath, 0,$slashIndex-1);
-        }
-?>
-<script type="text/javascript" src="../popup.js"></script>
-<script type="text/javascript" src="../../dialog.js"></script>
-<script language="JavaScript" type="text/JavaScript">
-<!--
-function pviiClassNew(obj, new_style) { //v2.6 by PVII
-  obj.className=new_style;
-}
-
-function goUp()
-{
-        location.href = "ImageManager/images.php?dir=<? echo $upDirPath; ?>";
-}
-
-function changeDir(newDir)
-{
-        location.href = "ImageManager/images.php?dir="+newDir;
-}
-
-function newFolder(oldDir, newFolder)
-{
-        location.href = "ImageManager/images.php?dir="+oldDir+'&create=folder&foldername='+newFolder;
-}
-
-function updateDir()
-{
-        var newPath = "<? echo $newPath; ?>";
-        if(window.top.document.forms[0] != null) {
-
-        var allPaths = window.top.document.forms[0].dirPath.options;
-        //alert("new:"+newPath);
-        for(i=0; i<allPaths.length; i++)
-        {
-                //alert(allPaths.item(i).value);
-                allPaths.item(i).selected = false;
-                if((allPaths.item(i).value)==newPath)
-                {
-                        allPaths.item(i).selected = true;
-                }
-        }
-
-<?
-        if($clearUploads) {
-?>
-        var topDoc = window.top.document.forms[0];
-        topDoc.upload.value = null;
-        //topDoc.upload.disabled = true;
-<?
-        }
-?>
-
-        }
-
-}
-
-<? if ($refresh_dirs) { ?>
-function refreshDirs()
-{
-        var allPaths = window.top.document.forms[0].dirPath.options;
-        var fields = ["/" <? dirs($BASE_DIR.$BASE_ROOT,'');?>];
-
-        var newPath = "<? echo $newPath; ?>";
-
-        while(allPaths.length > 0)
-        {
-                for(i=0; i<allPaths.length; i++)
-                {
-                        allPaths.remove(i);
-                }
-        }
-
-        for(i=0; i<fields.length; i++)
-        {
-                var newElem =        document.createElement("OPTION");
-                var newValue = fields[i];
-                newElem.text = newValue;
-                newElem.value = newValue;
-
-                if(newValue == newPath)
-                        newElem.selected = true;
-                else
-                        newElem.selected = false;
-
-                allPaths.add(newElem);
-        }
-}
-refreshDirs();
-<? } ?>
-
-function imageSelected(filename, width, height, alt)
-{
-        var topDoc = window.top.document.forms[0];
-        topDoc.f_url.value = filename;
-        topDoc.f_width.value= width;
-        topDoc.f_height.value = height;
-        topDoc.f_alt.value = alt;
-        topDoc.orginal_width.value = width;
-        topDoc.orginal_height.value = height;
-
-}
-
-function preview(file, image, size, width, height)
-{
-        /*
-        var predoc = '<img src="'+file+'" alt="'+image+' ('+width+'x'+height+', '+size+')">';
-        var w = 450;
-        var h = 400;
-        var LeftPosition=(screen.width)?(screen.width-w)/2:100;
-        var TopPosition=(screen.height)?(screen.height-h)/2:100;
-
-         var win = window.open('','image_preview','toolbar=no,location=no,menubar=no,status=yes,scrollbars=yes,resizable=yes,width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition);
-     var doc=win.document.open();
-
-     doc.writeln('<html>\n<head>\n<title>Image Preview - '+image+' ('+width+'x'+height+', '+size+')</title>');
-     doc.writeln('</head>\n<body>');
-     doc.writeln(predoc);
-     doc.writeln('</body>\n</html>\n');
-     doc=win.document.close();
-     win.focus();*/
-        //alert(file);
-         Dialog("../ImageEditor/ImageEditor.php?img="+escape(file), function(param) {
-                if (!param) {        // user must have pressed Cancel
-                        return false;
-                }
-        }, null);
-     return;
-}
-
-function deleteImage(file)
-{
-        if(confirm("Delete image \""+file+"\"?"))
-                return true;
-
-        return false;
-}
-
-function deleteFolder(folder, numFiles)
-{
-        if(numFiles > 0) {
-                alert("There are "+numFiles+" files/folders in \""+folder+"\".\n\nPlease delete all files/folder in \""+folder+"\" first.");
-                return false;
-        }
-
-        if(confirm("Delete folder \""+folder+"\"?"))
-                return true;
-
-        return false;
-}
-
-function MM_findObj(n, d) { //v4.01
-  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
-    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
-  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
-  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
-  if(!x && d.getElementById) x=d.getElementById(n); return x;
-}
-
-function MM_showHideLayers() { //v6.0
-  var i,p,v,obj,args=MM_showHideLayers.arguments;
-  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i],window.top.document))!=null) { v=args[i+2];
-    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
-    obj.visibility=v; }
-}
-
-function changeLoadingStatus(state)
-{
-        var statusText = null;
-        if(state == 'load') {
-                statusText = 'Loading Images';
-        }
-        else if(state == 'upload') {
-                statusText = 'Uploading Files';
-        }
-        if(statusText != null) {
-                var obj = MM_findObj('loadingStatus', window.top.document);
-                //alert(obj.innerHTML);
-                if (obj != null && obj.innerHTML != null)
-                        obj.innerHTML = statusText;
-                MM_showHideLayers('loading','','show')
-        }
-}
-
-//-->
-</script>
-</head>
-<body onLoad="updateDir();" bgcolor="#FFFFFF">
-
-<?
-//var_dump($_GET);
-//echo $dirParam.':'.$upDirPath;
-//echo '<br>';
-$d = @dir($BASE_DIR.$IMG_ROOT);
-
-if($d)
-{
-        //var_dump($d);
-        $images = array();
-        $folders = array();
-        while (false !== ($entry = $d->read()))
-        {
-                $img_file = $IMG_ROOT.$entry;
-
-                if(is_file($BASE_DIR.$img_file) && substr($entry,0,1) != '.')
-                {
-                        $image_info = @getimagesize($BASE_DIR.$img_file);
-                        if(is_array($image_info))
-                        {
-                                $file_details['file'] = $img_file;
-                                $file_details['img_info'] = $image_info;
-                                $file_details['size'] = filesize($BASE_DIR.$img_file);
-                                $images[$entry] = $file_details;
-                                //show_image($img_file, $entry, $image_info);
-                        }
-                }
-                else if(is_dir($BASE_DIR.$img_file) && substr($entry,0,1) != '.')
-                {
-                        $folders[$entry] = $img_file;
-                        //show_dir($img_file, $entry);
-                }
-        }
-        $d->close();
-
-        if(count($images) > 0 || count($folders) > 0)
-        {
-                //now sort the folders and images by name.
-                ksort($images);
-                ksort($folders);
-
-                draw_table_header();
-
-                for($i=0; $i<count($folders); $i++)
-                {
-                        $folder_name = key($folders);
-                        show_dir($folders[$folder_name], $folder_name);
-                        next($folders);
-                }
-                for($i=0; $i<count($images); $i++)
-                {
-                        $image_name = key($images);
-                        show_image($images[$image_name]['file'], $image_name, $images[$image_name]['img_info'], $images[$image_name]['size']);
-                        next($images);
-                }
-                draw_table_footer();
-        }
-        else
-        {
-                draw_no_results();
-        }
-}
-else
-{
-        draw_no_dir();
-}
-
-?>
-<script language="JavaScript" type="text/JavaScript">
-MM_showHideLayers('loading','','hide')
-</script>
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/popups/insert_image2.php 75/e107_handlers/htmlarea/popups/insert_image2.php
--- 6171/e107_handlers/htmlarea/popups/insert_image2.php	2004-03-15 16:36:06.000000000 -0600
+++ 75/e107_handlers/htmlarea/popups/insert_image2.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,216 +0,0 @@
-<html style="width: 398; height: 218">
-
-<head>
-  <title>Insert Image</title>
-
-<script type="text/javascript" src="popup.js"></script>
-
-<script type="text/javascript">
-var preview_window = null;
-
-function Init() {
-  __dlg_init();
-  document.getElementById("f_url").focus();
-};
-
-function onOK() {
-  var required = {
-    "f_url": "You must enter the URL",
-    "f_alt": "Please enter the alternate text"
-  };
-  for (var i in required) {
-    var el = document.getElementById(i);
-    if (!el.value) {
-      alert(required[i]);
-      el.focus();
-      return false;
-    }
-  }
-  // pass data back to the calling window
-  var fields = ["f_url", "f_alt", "f_align", "f_border",
-                "f_horiz", "f_vert"];
-  var param = new Object();
-  for (var i in fields) {
-    var id = fields[i];
-    var el = document.getElementById(id);
-    param[id] = el.value;
-  }
-  if (preview_window) {
-    preview_window.close();
-  }
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  if (preview_window) {
-    preview_window.close();
-  }
-  __dlg_close(null);
-  return false;
-};
-
-function onPreview() {
-  alert("FIXME: preview needs rewritten:\n  show the image inside this window instead of opening a new one.");
-  var f_url = document.getElementById("f_url");
-  var url = f_url.value;
-  if (!url) {
-    alert("You have to enter an URL first");
-    f_url.focus();
-    return false;
-  }
-  var img = new Image();
-  img.src = url;
-  var win = null;
-  if (!document.all) {
-    win = window.open("about:blank", "ha_imgpreview", "toolbar=no,menubar=no,personalbar=no,innerWidth=100,innerHeight=100,scrollbars=no,resizable=yes");
-  } else {
-    win = window.open("about:blank", "ha_imgpreview", "channelmode=no,directories=no,height=100,width=100,location=no,menubar=no,resizable=yes,scrollbars=no,toolbar=no");
-  }
-  preview_window = win;
-  var doc = win.document;
-  var body = doc.body;
-  if (body) {
-    body.innerHTML = "";
-    body.style.padding = "0px";
-    body.style.margin = "0px";
-    var el = doc.createElement("img");
-    el.src = url;
-
-    var table = doc.createElement("table");
-    body.appendChild(table);
-    table.style.width = "100%";
-    table.style.height = "100%";
-    var tbody = doc.createElement("tbody");
-    table.appendChild(tbody);
-    var tr = doc.createElement("tr");
-    tbody.appendChild(tr);
-    var td = doc.createElement("td");
-    tr.appendChild(td);
-    td.style.textAlign = "center";
-
-    td.appendChild(el);
-    win.resizeTo(el.offsetWidth + 30, el.offsetHeight + 30);
-  }
-  win.focus();
-  return false;
-};
-</script>
-
-<style type="text/css">
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-form p {
-  margin-top: 5px;
-  margin-bottom: 5px;
-}
-.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
-.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
-fieldset { padding: 0px 10px 5px 5px; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-.space { padding: 2px; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-form { padding: 0px; margin: 0px; }
-</style>
-
-</head>
-
-<body onload="Init()">
-
-<div class="title">Insert Image</div>
-
-<form action="" method="get">
-<table border="0" width="100%" style="padding: 0px; margin: 0px">
-  <tbody>
-
-  <tr>
-    <td style="width: 7em; text-align: right">Image URL:</td>
-    <td><input type="text" name="url" id="f_url" style="width:75%"
-      title="Enter the image URL here" />
-      <button name="preview" onclick="return onPreview();"
-      title="Preview the image in a new window">Preview</button>
-    </td>
-  </tr>
-  <tr>
-    <td style="width: 7em; text-align: right">Alternate text:</td>
-    <td><input type="text" name="alt" id="f_alt" style="width:100%"
-      title="For browsers that don't support images" /></td>
-  </tr>
-
-  </tbody>
-</table>
-
-<p />
-
-<fieldset style="float: left; margin-left: 5px;">
-<legend>Layout</legend>
-
-<div class="space"></div>
-
-<div class="fl">Alignment:</div>
-<select size="1" name="align" id="f_align"
-  title="Positioning of this image">
-  <option value=""                             >Not set</option>
-  <option value="left"                         >Left</option>
-  <option value="right"                        >Right</option>
-  <option value="texttop"                      >Texttop</option>
-  <option value="absmiddle"                    >Absmiddle</option>
-  <option value="baseline" selected="1"        >Baseline</option>
-  <option value="absbottom"                    >Absbottom</option>
-  <option value="bottom"                       >Bottom</option>
-  <option value="middle"                       >Middle</option>
-  <option value="top"                          >Top</option>
-</select>
-
-<p />
-
-<div class="fl">Border thickness:</div>
-<input type="text" name="border" id="f_border" size="5"
-title="Leave empty for no border" />
-
-<div class="space"></div>
-
-</fieldset>
-
-<fieldset style="float:right; margin-right: 5px;">
-<legend>Spacing</legend>
-
-<div class="space"></div>
-
-<div class="fr">Horizontal:</div>
-<input type="text" name="horiz" id="f_horiz" size="5"
-title="Horizontal padding" />
-
-<p />
-
-<div class="fr">Vertical:</div>
-<input type="text" name="vert" id="f_vert" size="5"
-title="Vertical padding" />
-
-<div class="space"></div>
-
-</fieldset>
-
-<div style="margin-top: 85px; text-align: right;">
-<hr />
-<button type="button" name="ok" onclick="return onOK();">OK</button>
-<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
-</div>
-
-</form>
-
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/popups/insert_image.html 75/e107_handlers/htmlarea/popups/insert_image.html
--- 6171/e107_handlers/htmlarea/popups/insert_image.html	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/insert_image.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,191 +0,0 @@
-<html>

-

-<head>

-  <title>Insert Image</title>

-

-<script type="text/javascript" src="popup.js"></script>

-

-<script type="text/javascript">

-

-window.resizeTo(400, 100);

-

-function Init() {

-  __dlg_init();

-  var param = window.dialogArguments;

-  if (param) {

-      document.getElementById("f_url").value = param["f_url"];

-      document.getElementById("f_alt").value = param["f_alt"];

-      document.getElementById("f_border").value = param["f_border"];

-      document.getElementById("f_align").value = param["f_align"];

-      document.getElementById("f_vert").value = param["f_vert"];

-      document.getElementById("f_horiz").value = param["f_horiz"];

-      window.ipreview.location.replace(param.f_url);

-  }

-  document.getElementById("f_url").focus();

-};

-

-function onOK() {

-  var required = {

-    "f_url": "You must enter the URL"

-  };

-  for (var i in required) {

-    var el = document.getElementById(i);

-    if (!el.value) {

-      alert(required[i]);

-      el.focus();

-      return false;

-    }

-  }

-  // pass data back to the calling window

-  var fields = ["f_url", "f_alt", "f_align", "f_border",

-                "f_horiz", "f_vert"];

-  var param = new Object();

-  for (var i in fields) {

-    var id = fields[i];

-    var el = document.getElementById(id);

-    param[id] = el.value;

-  }

-  __dlg_close(param);

-  return false;

-};

-

-function onCancel() {

-  __dlg_close(null);

-  return false;

-};

-

-function onPreview() {

-  var f_url = document.getElementById("f_url");

-  var url = f_url.value;

-  if (!url) {

-    alert("You have to enter an URL first");

-    f_url.focus();

-    return false;

-  }

-  window.ipreview.location.replace(url);

-  return false;

-};

-</script>

-

-<style type="text/css">

-html, body {

-  background: ButtonFace;

-  color: ButtonText;

-  font: 11px Tahoma,Verdana,sans-serif;

-  margin: 0px;

-  padding: 0px;

-}

-body { padding: 5px; }

-table {

-  font: 11px Tahoma,Verdana,sans-serif;

-}

-form p {

-  margin-top: 5px;

-  margin-bottom: 5px;

-}

-.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }

-.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }

-fieldset { padding: 0px 10px 5px 5px; }

-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }

-button { width: 70px; }

-.space { padding: 2px; }

-

-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;

-border-bottom: 1px solid black; letter-spacing: 2px;

-}

-form { padding: 0px; margin: 0px; }

-</style>

-

-</head>

-

-<body onload="Init()">

-

-<div class="title">Insert Image</div>

-<!--- new stuff --->

-<form action="" method="get">

-<table border="0" width="100%" style="padding: 0px; margin: 0px">

-  <tbody>

-

-  <tr>

-    <td style="width: 7em; text-align: right">Image URL:</td>

-    <td><input type="text" name="url" id="f_url" style="width:75%"

-      title="Enter the image URL here" />

-      <button name="preview" onclick="return onPreview();"

-      title="Preview the image in a new window">Preview</button>

-    </td>

-  </tr>

-  <tr>

-    <td style="width: 7em; text-align: right">Alternate text:</td>

-    <td><input type="text" name="alt" id="f_alt" style="width:100%"

-      title="For browsers that don't support images" /></td>

-  </tr>

-

-  </tbody>

-</table>

-

-<p />

-

-<fieldset style="float: left; margin-left: 5px;">

-<legend>Layout</legend>

-

-<div class="space"></div>

-

-<div class="fl">Alignment:</div>

-<select size="1" name="align" id="f_align"

-  title="Positioning of this image">

-  <option value=""                             >Not set</option>

-  <option value="left"                         >Left</option>

-  <option value="right"                        >Right</option>

-  <option value="texttop"                      >Texttop</option>

-  <option value="absmiddle"                    >Absmiddle</option>

-  <option value="baseline" selected="1"        >Baseline</option>

-  <option value="absbottom"                    >Absbottom</option>

-  <option value="bottom"                       >Bottom</option>

-  <option value="middle"                       >Middle</option>

-  <option value="top"                          >Top</option>

-</select>

-

-<p />

-

-<div class="fl">Border thickness:</div>

-<input type="text" name="border" id="f_border" size="5"

-title="Leave empty for no border" />

-

-<div class="space"></div>

-

-</fieldset>

-

-<fieldset style="float:right; margin-right: 5px;">

-<legend>Spacing</legend>

-

-<div class="space"></div>

-

-<div class="fr">Horizontal:</div>

-<input type="text" name="horiz" id="f_horiz" size="5"

-title="Horizontal padding" />

-

-<p />

-

-<div class="fr">Vertical:</div>

-<input type="text" name="vert" id="f_vert" size="5"

-title="Vertical padding" />

-

-<div class="space"></div>

-

-</fieldset>

-<br clear="all" />

-<table width="100%" style="margin-bottom: 0.2em">

- <tr>

-  <td valign="bottom">

-    Image Preview:<br />

-    <iframe name="ipreview" id="ipreview" frameborder="0" style="border : 1px solid gray;" height="200" width="300" src=""></iframe>

-  </td>

-  <td valign="bottom" style="text-align: right">

-    <button type="button" name="ok" onclick="return onOK();">OK</button><br>

-    <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>

-  </td>

- </tr>

-</table>

-</form>

-</body>

-</html>

diff -ruN 6171/e107_handlers/htmlarea/popups/insert_image.php 75/e107_handlers/htmlarea/popups/insert_image.php
--- 6171/e107_handlers/htmlarea/popups/insert_image.php	2004-03-16 02:23:02.000000000 -0600
+++ 75/e107_handlers/htmlarea/popups/insert_image.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,456 +0,0 @@
-<?
-/***********************************************************************
-** Title.........:        Image Manager for HTMLArea 3.0 Alpha, PHP Version
-** Version.......:        1.01
-** Author........:        Xiang Wei ZHUO <wei@zhuo.org>
-** Filename......:        insert_image.php
-** Last changed..:        8 Mar 2003
-** Notes.........:        Configuration in config.inc.php
-
-                    - Only compatible with IE 5.5+
-
-***********************************************************************/
-
-    //    require_once("../../../../class2.php");
-    if(file_exists("../../../../class2.php")){
-        require_once( "../../../../class2.php");
-        }
-
-
-
-        include 'ImageManager/config.inc.php';
-
-        $no_dir = false;
-        if(!is_dir($BASE_DIR.$BASE_ROOT)) {
-                $no_dir = true;
-        }
-       $https = ($pref['ssl_enabled']) ? "https://":"http://";
-?>
-<html style="width: 580; height: 440;">
-<head>
-<title>Insert Image</title>
-<script type="text/javascript" src="popup.js"></script>
-<script type="text/javascript" src="../dialog.js"></script>
-<script type="text/javascript">
-window.resizeTo(600, 150);   
-
-
-var preview_window = null;
-
-function Init() {
-
-  __dlg_init();
-  var doc = MM_findObj("f_url");
-
-  if(doc != null) {
-          doc.focus();
-  }
-};
-
-function onOK() {
-  var required = {
-    "f_url": "You must enter the URL",
-    "f_alt": "Please enter the alternate text"
-  };
-  for (var i in required) {
-    var el = MM_findObj(i);
-    if (!el.value) {
-      alert(required[i]);
-      el.focus();
-      return false;
-    }
-  }
-  // pass data back to the calling window
-  var fields = ["f_url", "f_alt", "f_align", "f_border",
-                "f_horiz", "f_vert", "f_width", "f_height"];
-  var param = new Object();
-  for (var i in fields) {
-    var id = fields[i];
-    var el = MM_findObj(id);
-        if(id == "f_url")
-                param[id] = "<? echo $https.$_SERVER['SERVER_NAME']; ?>" + el.value;
-        else
-            param[id] = el.value;
-  }
-  if (preview_window) {
-    preview_window.close();
-  }
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  if (preview_window) {
-    preview_window.close();
-  }
-  __dlg_close(null);
-  return false;
-};
-
-</script>
-<style type="text/css">
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-form p {
-  margin-top: 5px;
-  margin-bottom: 5px;
-}
-.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
-.fr { width: 6em; float: left; padding: 2px 5px; text-align: right; }
-fieldset { padding: 0px 10px 5px 5px; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-.space { padding: 2px; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-form { padding: 0px; margin: 0px; }
-</style>
-<style type="text/css">
-<!--
-.buttonHover {
-        border: 1px solid;
-        border-color: ButtonHighlight ButtonShadow ButtonShadow ButtonHighlight;
-        cursor: hand;
-}
-.buttonOut
-{
-        border: 1px solid ButtonFace;
-}
-
-.separator {
-  position: relative;
-  margin: 3px;
-  border-left: 1px solid ButtonShadow;
-  border-right: 1px solid ButtonHighlight;
-  width: 0px;
-  height: 16px;
-  padding: 0px;
-}
-.manager
-{
-}
-.statusLayer
-{
-        background:#FFFFFF;
-        border: 1px solid #CCCCCC;
-}
-.statusText {
-        font-family: Verdana, Arial, Helvetica, sans-serif;
-        font-size: 15px;
-        font-weight: bold;
-        color: #6699CC;
-        text-decoration: none;
-}
--->
-</style>
-<script language="JavaScript" type="text/JavaScript">
-<!--
-function pviiClassNew(obj, new_style) { //v2.6 by PVII
-  obj.className=new_style;
-}
-function goUpDir()
-{
-        var selection = document.forms[0].dirPath;
-        var dir = selection.options[selection.selectedIndex].value;
-        if(dir != '/')
-        {
-                imgManager.goUp();
-                changeLoadingStatus('load');
-        }
-
-}
-
-function updateDir(selection)
-{
-        var newDir = selection.options[selection.selectedIndex].value;
-        imgManager.changeDir(newDir);
-        changeLoadingStatus('load');
-}
-
-function newFolder()
-{
-        var selection = document.forms[0].dirPath;
-        var dir = selection.options[selection.selectedIndex].value;
-        Dialog("ImageManager/newFolder.html", function(param) {
-                if (!param) {        // user must have pressed Cancel
-                        return false;
-                }
-                else
-                {
-                        var folder = param['f_foldername'];
-                        if (folder && folder != '') {
-                                imgManager.newFolder(dir,folder);
-                        }
-                }
-        }, null);
-}
-
-function toggleConstrains(constrains)
-{
-        if(constrains.checked)
-        {
-                document.locked_img.src = "ImageManager/locked.gif";
-                checkConstrains('width')
-        }
-        else
-        {
-                document.locked_img.src = "ImageManager/unlocked.gif";
-        }
-}
-
-function checkConstrains(changed)
-{
-        //alert(document.form1.constrain_prop);
-        var constrained = document.form1.constrain_prop.checked;
-
-        if(constrained)
-        {
-                var orginal_width = parseInt(document.form1.orginal_width.value);
-                var orginal_height = parseInt(document.form1.orginal_height.value);
-
-                var width = parseInt(document.form1.f_width.value);
-                var height = parseInt(document.form1.f_height.value);
-
-                if(orginal_width > 0 && orginal_height > 0)
-                {
-                        if(changed == 'width' && width > 0) {
-                                document.form1.f_height.value = parseInt((width/orginal_width)*orginal_height);
-                        }
-
-                        if(changed == 'height' && height > 0) {
-                                document.form1.f_width.value = parseInt((height/orginal_height)*orginal_width);
-                        }
-                }
-
-        }
-
-}
-
-function MM_findObj(n, d) { //v4.01
-  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
-    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
-  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
-  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
-  if(!x && d.getElementById) x=d.getElementById(n); return x;
-}
-
-function P7_Snap() { //v2.62 by PVII
-  var x,y,ox,bx,oy,p,tx,a,b,k,d,da,e,el,args=P7_Snap.arguments;a=parseInt(a);
-  for (k=0; k<(args.length-3); k+=4)
-   if ((g=MM_findObj(args[k]))!=null) {
-    el=eval(MM_findObj(args[k+1]));
-    a=parseInt(args[k+2]);b=parseInt(args[k+3]);
-    x=0;y=0;ox=0;oy=0;p="";tx=1;da="document.all['"+args[k]+"']";
-    if(document.getElementById) {
-     d="document.getElementsByName('"+args[k]+"')[0]";
-     if(!eval(d)) {d="document.getElementById('"+args[k]+"')";if(!eval(d)) {d=da;}}
-    }else if(document.all) {d=da;}
-    if (document.all || document.getElementById) {
-     while (tx==1) {p+=".offsetParent";
-      if(eval(d+p)) {x+=parseInt(eval(d+p+".offsetLeft"));y+=parseInt(eval(d+p+".offsetTop"));
-      }else{tx=0;}}
-     ox=parseInt(g.offsetLeft);oy=parseInt(g.offsetTop);var tw=x+ox+y+oy;
-     if(tw==0 || (navigator.appVersion.indexOf("MSIE 4")>-1 && navigator.appVersion.indexOf("Mac")>-1)) {
-      ox=0;oy=0;if(g.style.left){x=parseInt(g.style.left);y=parseInt(g.style.top);
-      }else{var w1=parseInt(el.style.width);bx=(a<0)?-5-w1:-10;
-      a=(Math.abs(a)<1000)?0:a;b=(Math.abs(b)<1000)?0:b;
-      x=document.body.scrollLeft + event.clientX + bx;
-      y=document.body.scrollTop + event.clientY;}}
-   }else if (document.layers) {x=g.x;y=g.y;var q0=document.layers,dd="";
-    for(var s=0;s<q0.length;s++) {dd='document.'+q0[s].name;
-     if(eval(dd+'.document.'+args[k])) {x+=eval(dd+'.left');y+=eval(dd+'.top');break;}}}
-   if(el) {e=(document.layers)?el:el.style;
-   var xx=parseInt(x+ox+a),yy=parseInt(y+oy+b);
-   if(navigator.appName=="Netscape" && parseInt(navigator.appVersion)>4){xx+="px";yy+="px";}
-   if(navigator.appVersion.indexOf("MSIE 5")>-1 && navigator.appVersion.indexOf("Mac")>-1){
-    xx+=parseInt(document.body.leftMargin);yy+=parseInt(document.body.topMargin);
-    xx+="px";yy+="px";}e.left=xx;e.top=yy;}}
-}
-
-function MM_showHideLayers() { //v6.0
-  var i,p,v,obj,args=MM_showHideLayers.arguments;
-  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
-    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
-    obj.visibility=v; }
-}
-
-function changeLoadingStatus(state)
-{
-        var statusText = null;
-        if(state == 'load') {
-                statusText = 'Loading Images';
-        }
-        else if(state == 'upload') {
-                statusText = 'Uploading Files';
-        }
-        if(statusText != null) {
-                var obj = MM_findObj('loadingStatus');
-                if (obj != null && obj.innerHTML != null)
-                        obj.innerHTML = statusText;
-                MM_showHideLayers('loading','','show')
-        }
-}
-
-function refresh()
-{
-        var selection = document.forms[0].dirPath;
-        updateDir(selection);
-}
-
-
-//-->
-</script>
-</head>
-<body onload="Init(); P7_Snap('dirPath','loading',120,70);">
-<div class="title">Insert Image</div>
-<form action="ImageManager/images.php" name="form1" method="post" target="imgManager" enctype="multipart/form-data">
-<div id="loading" style="position:absolute; left:200px; top:130px; width:184px; height:48px; z-index:1" class="statusLayer">
-  <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
-    <tr>
-      <td><div align="center"><span id="loadingStatus" class="statusText">Loading Images</span><img src="ImageManager/dots.gif" width="22" height="12"></div></td>
-    </tr>
-  </table>
-</div>
-  <table width="100%" border="0" align="center" cellspacing="2" cellpadding="2">
-    <tr>
-      <td align="center">          <fieldset>
-          <legend>Image Manager</legend>
-        <table width="99%" align="center" border="0" cellspacing="2" cellpadding="2">
-          <tr>
-            <td><table border="0" cellspacing="1" cellpadding="3">
-                <tr>
-                  <td>Directory</td>
-                  <td>
-                                  <select name="dirPath" id="dirPath" style="width:30em" onChange="updateDir(this)">
-                                  <option value="/">/</option>
-<?
-
-
-function dirs($dir,$abs_path)
-{
-        $d = dir($dir);
-                $dirs = array();
-                while (false !== ($entry = $d->read())) {
-                        if(is_dir($dir.'/'.$entry) && substr($entry,0,1) != '.')
-                        {
-                                $path['path'] = $dir.'/'.$entry;
-                                $path['name'] = $entry;
-                                $dirs[$entry] = $path;
-                        }
-                }
-                $d->close();
-
-                ksort($dirs);
-                for($i=0; $i<count($dirs); $i++)
-                {
-                        $name = key($dirs);
-                        $current_dir = $abs_path.'/'.$dirs[$name]['name'];
-                        echo "<option value=\"$current_dir\">$current_dir</option>\n";
-                        dirs($dirs[$name]['path'],$current_dir);
-                        next($dirs);
-                }
-}
-
-if($no_dir == false) {
-        dirs($BASE_DIR.$BASE_ROOT,'');
-}
-?>
-                                </select>
-                                  </td>
-                  <td class="buttonOut" onMouseOver="pviiClassNew(this,'buttonHover')" onMouseOut="pviiClassNew(this,'buttonOut')">
-                                  <a href="#" onClick="javascript:goUpDir();"><img src="ImageManager/btnFolderUp.gif" width="15" height="15" border="0" alt="Up"></a></td>
-<? if ($SAFE_MODE == false) { ?>
-                  <td><div class="separator"></div></td>
-                  <td class="buttonOut" onMouseOver="pviiClassNew(this,'buttonHover')" onMouseOut="pviiClassNew(this,'buttonOut')">
-                                  <a href="#" onClick="javascript:newFolder();"><img src="ImageManager/btnFolderNew.gif" width="15" height="15" border="0" alt="New Folder"></a></td>
-<? } ?>
-                </tr>
-              </table></td>
-          </tr>
-          <tr>
-            <td align="center" bgcolor="white"><div name="manager" class="manager">
-        <iframe src="ImageManager/images.php" name="imgManager" id="imgManager" width="520" height="150" marginwidth="0" marginheight="0" align="top" scrolling="auto" frameborder="0" hspace="0" vspace="0" background="white"></iframe>
-                </div>
-                        </td>
-          </tr>
-        </table>
-        </fieldset></td>
-    </tr>
-    <tr>
-      <td><table border="0" align="center" cellpadding="2" cellspacing="2">
-          <tr>
-            <td nowrap><div align="right">Image File </div></td>
-            <td><input name="url" id="f_url" type="text" style="width:20em" size="30"></td>
-            <td rowspan="3">&nbsp;</td>
-            <td><div align="right">Width </div></td>
-            <td><input name="width" id="f_width" type="text" size="5" style="width:4em" onChange="javascript:checkConstrains('width');"></td>
-            <td rowspan="2"><img src="ImageManager/locked.gif" name="locked_img" width="25" height="32" id="locked_img" alt="Locked"></td>
-            <td rowspan="3">&nbsp;</td>
-            <td><div align="right">V Space</div></td>
-            <td><input name="vert" id="f_vert" type="text" size="5" style="width:4em"></td>
-          </tr>
-          <tr>
-            <td nowrap><div align="right">Alt </div></td>
-            <td><input type="text" style="width:20em" name="alt" id="f_alt"></td>
-            <td><div align="right">Height </div></td>
-            <td><input name="height" id="f_height" type="text" size="5" style="width:4em" onChange="javascript:checkConstrains('height');"></td>
-            <td><div align="right">H Space</div></td>
-            <td><input name="horiz" id="f_horiz" type="text" size="5" style="width:4em"></td>
-          </tr>
-          <tr>
-            <td><div align="right">Upload </div></td>
-            <td><input type="file" name="upload" id="upload">
-              <input type="submit" style="width:5em" value="Upload" onClick="javascript:changeLoadingStatus('upload');" />
-                         </td>
-            <td><div align="right">Align</div></td>
-            <td colspan="2"><select name="align" ID="f_align" style="width:7em">
-                <OPTION id="optNotSet" value=""> Not set </OPTION>
-                <OPTION id="optLeft" value="left"> Left </OPTION>
-                <OPTION id="optRight" value="right"> Right </OPTION>
-                <OPTION id="optTexttop" value="textTop"> Texttop </OPTION>
-                <OPTION id="optAbsMiddle" value="absMiddle"> Absmiddle </OPTION>
-                <OPTION id="optBaseline" value="baseline" SELECTED> Baseline </OPTION>
-                <OPTION id="optAbsBottom" value="absBottom"> Absbottom </OPTION>
-                <OPTION id="optBottom" value="bottom"> Bottom </OPTION>
-                <OPTION id="optMiddle" value="middle"> Middle </OPTION>
-                <OPTION id="optTop" value="top"> Top </OPTION>
-              </select></td>
-            <td><div align="right">Border</div></td>
-            <td><input name="border" id="f_border" type="text" size="5" style="width:4em"></td>
-          </tr>
-          <tr>
-            <td colspan="3">&nbsp;</td>
-            <td><div align="right">
-                            <input type="hidden" name="orginal_width" id="orginal_width">
-                                <input type="hidden" name="orginal_height" id="orginal_height">
-                <input type="checkbox" name="constrain_prop" id="constrain_prop" checked onClick="javascript:toggleConstrains(this);">
-              </div></td>
-            <td colspan="5">Constrain Proportions</td>
-          </tr>
-        </table>
-
-      </td>
-    </tr>
-    <tr>
-      <td><div style="text-align: right;">
-          <hr />
-                  <button type="button" name="ok" onclick="return refresh();">Refresh</button>
-          <button type="button" name="ok" onclick="return onOK();">OK</button>
-          <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
-        </div></td>
-    </tr>
-  </table>
-</form>
-</body>
-</html>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/popups/insert_table.html 75/e107_handlers/htmlarea/popups/insert_table.html
--- 6171/e107_handlers/htmlarea/popups/insert_table.html	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/insert_table.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,174 +0,0 @@
-<html>
-
-<head>
-  <title>Insert Table</title>
-
-<script type="text/javascript" src="popup.js"></script>
-
-<script type="text/javascript">
-
-window.resizeTo(400, 100);
-
-function Init() {
-  __dlg_init();
-  document.getElementById("f_rows").focus();
-};
-
-function onOK() {
-  var required = {
-    "f_rows": "You must enter a number of rows",
-    "f_cols": "You must enter a number of columns"
-  };
-  for (var i in required) {
-    var el = document.getElementById(i);
-    if (!el.value) {
-      alert(required[i]);
-      el.focus();
-      return false;
-    }
-  }
-  var fields = ["f_rows", "f_cols", "f_width", "f_unit",
-                "f_align", "f_border", "f_spacing", "f_padding"];
-  var param = new Object();
-  for (var i in fields) {
-    var id = fields[i];
-    var el = document.getElementById(id);
-    param[id] = el.value;
-  }
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  __dlg_close(null);
-  return false;
-};
-
-</script>
-
-<style type="text/css">
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-form p {
-  margin-top: 5px;
-  margin-bottom: 5px;
-}
-.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
-.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
-fieldset { padding: 0px 10px 5px 5px; }
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-.space { padding: 2px; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-form { padding: 0px; margin: 0px; }
-</style>
-
-</head>
-
-<body onload="Init()">
-
-<div class="title">Insert Table</div>
-
-<form action="" method="get">
-<table border="0" style="padding: 0px; margin: 0px">
-  <tbody>
-
-  <tr>
-    <td style="width: 4em; text-align: right">Rows:</td>
-    <td><input type="text" name="rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
-    <td></td>
-    <td></td>
-    <td></td>
-  </tr>
-  <tr>
-    <td style="width: 4em; text-align: right">Cols:</td>
-    <td><input type="text" name="cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
-    <td style="width: 4em; text-align: right">Width:</td>
-    <td><input type="text" name="width" id="f_width" size="5" title="Width of the table" value="100" /></td>
-    <td><select size="1" name="unit" id="f_unit" title="Width unit">
-      <option value="%" selected="1"  >Percent</option>
-      <option value="px"              >Pixels</option>
-      <option value="em"              >Em</option>
-    </select></td>
-  </tr>
-
-  </tbody>
-</table>
-
-<p />
-
-<fieldset style="float: left; margin-left: 5px;">
-<legend>Layout</legend>
-
-<div class="space"></div>
-
-<div class="fl">Alignment:</div>
-<select size="1" name="align" id="f_align"
-  title="Positioning of this image">
-  <option value="" selected="1"                >Not set</option>
-  <option value="left"                         >Left</option>
-  <option value="right"                        >Right</option>
-  <option value="texttop"                      >Texttop</option>
-  <option value="absmiddle"                    >Absmiddle</option>
-  <option value="baseline"                     >Baseline</option>
-  <option value="absbottom"                    >Absbottom</option>
-  <option value="bottom"                       >Bottom</option>
-  <option value="middle"                       >Middle</option>
-  <option value="top"                          >Top</option>
-</select>
-
-<p />
-
-<div class="fl">Border thickness:</div>
-<input type="text" name="border" id="f_border" size="5" value="1"
-title="Leave empty for no border" />
-<!--
-<p />
-
-<div class="fl">Collapse borders:</div>
-<input type="checkbox" name="collapse" id="f_collapse" />
--->
-<div class="space"></div>
-
-</fieldset>
-
-<fieldset style="float:right; margin-right: 5px;">
-<legend>Spacing</legend>
-
-<div class="space"></div>
-
-<div class="fr">Cell spacing:</div>
-<input type="text" name="spacing" id="f_spacing" size="5" value="1"
-title="Space between adjacent cells" />
-
-<p />
-
-<div class="fr">Cell padding:</div>
-<input type="text" name="padding" id="f_padding" size="5" value="1"
-title="Space between content and border in cell" />
-
-<div class="space"></div>
-
-</fieldset>
-
-<div style="margin-top: 85px; border-top: 1px solid #999; padding: 2px; text-align: right;">
-<button type="button" name="ok" onclick="return onOK();">OK</button>
-<button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
-</div>
-
-</form>
-
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/popups/link.html 75/e107_handlers/htmlarea/popups/link.html
--- 6171/e107_handlers/htmlarea/popups/link.html	2004-08-11 04:26:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/link.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,155 +0,0 @@
-<html>
-
-<head>
-  <title>Insert/Modify Link</title>
-  <script type="text/javascript" src="popup.js"></script>
-  <script type="text/javascript">
-    window.resizeTo(400, 200);
-
-I18N = window.opener.HTMLArea.I18N.dialogs;
-
-function i18n(str) {
-  return (I18N[str] || str);
-};
-
-function onTargetChanged() {
-  var f = document.getElementById("f_other_target");
-  if (this.value == "_other") {
-    f.style.visibility = "visible";
-    f.select();
-    f.focus();
-  } else f.style.visibility = "hidden";
-};
-
-function Init() {
-  __dlg_translate(I18N);
-  __dlg_init();
-  var param = window.dialogArguments;
-  var target_select = document.getElementById("f_target");
-  var use_target = true;
-  if (param) {
-    if ( typeof param["f_usetarget"] != "undefined" ) {
-      use_target = param["f_usetarget"];
-    }
-    if ( typeof param["f_href"] != "undefined" ) {
-      document.getElementById("f_href").value = param["f_href"];
-      document.getElementById("f_title").value = param["f_title"];
-      comboSelectValue(target_select, param["f_target"]);
-      if (target_select.value != param.f_target) {
-        var opt = document.createElement("option");
-        opt.value = param.f_target;
-        opt.innerHTML = opt.value;
-        target_select.appendChild(opt);
-        opt.selected = true;
-      }
-    }
-  }
-  if (! use_target) {
-    document.getElementById("f_target_label").style.visibility = "hidden";
-    document.getElementById("f_target").style.visibility = "hidden";
-    document.getElementById("f_target_other").style.visibility = "hidden";
-  }
-  var opt = document.createElement("option");
-  opt.value = "_other";
-  opt.innerHTML = i18n("Other");
-  target_select.appendChild(opt);
-  target_select.onchange = onTargetChanged;
-  document.getElementById("f_href").focus();
-  document.getElementById("f_href").select();
-};
-
-function onOK() {
-  var required = {
-    // f_href shouldn't be required or otherwise removing the link by entering an empty

-    // url isn't possible anymore.

-    // "f_href": i18n("You must enter the URL where this link points to")

-  };
-  for (var i in required) {
-    var el = document.getElementById(i);
-    if (!el.value) {
-      alert(required[i]);
-      el.focus();
-      return false;
-    }
-  }
-  // pass data back to the calling window
-  var fields = ["f_href", "f_title", "f_target" ];
-  var param = new Object();
-  for (var i in fields) {
-    var id = fields[i];
-    var el = document.getElementById(id);
-    param[id] = el.value;
-  }
-  if (param.f_target == "_other")
-    param.f_target = document.getElementById("f_other_target").value;
-  __dlg_close(param);
-  return false;
-};
-
-function onCancel() {
-  __dlg_close(null);
-  return false;
-};
-
-</script>
-
-<style type="text/css">
-html, body {
-  background: ButtonFace;
-  color: ButtonText;
-  font: 11px Tahoma,Verdana,sans-serif;
-  margin: 0px;
-  padding: 0px;
-}
-body { padding: 5px; }
-table {
-  font: 11px Tahoma,Verdana,sans-serif;
-}
-select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
-button { width: 70px; }
-table .label { text-align: right; width: 8em; }
-
-.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
-border-bottom: 1px solid black; letter-spacing: 2px;
-}
-
-#buttons {
-      margin-top: 1em; border-top: 1px solid #999;
-      padding: 2px; text-align: right;
-}
-</style>
-
-</head>
-
-<body onload="Init()">
-<div class="title">Insert/Modify Link</div>
-<form>
-<table border="0" style="width: 100%;">
-  <tr>
-    <td class="label">URL:</td>
-    <td><input type="text" id="f_href" style="width: 100%" /></td>
-  </tr>
-  <tr>
-    <td class="label">Title (tooltip):</td>
-    <td><input type="text" id="f_title" style="width: 100%" /></td>
-  </tr>
-  <tr>
-    <td class="label"><span id="f_target_label">Target:</span></td>
-    <td><select id="f_target">
-      <option value="">None (use implicit)</option>
-      <option value="_blank">New window (_blank)</option>
-      <option value="_self">Same frame (_self)</option>
-      <option value="_top">Top frame (_top)</option>
-    </select>
-    <input type="text" name="f_other_target" id="f_other_target" size="10" style="visibility: hidden" />
-    </td>
-  </tr>
-</table>
-
-<div id="buttons">
-  <button type="submit" name="ok" onclick="return onOK();">OK</button>
-  <button type="button" name="cancel" onclick="return onCancel();">Cancel</button>
-</div>
-</form>
-</body>
-</html>
diff -ruN 6171/e107_handlers/htmlarea/popups/old-fullscreen.html 75/e107_handlers/htmlarea/popups/old-fullscreen.html
--- 6171/e107_handlers/htmlarea/popups/old-fullscreen.html	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/old-fullscreen.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,131 +0,0 @@
-<html>

-<head><title>Fullscreen Editor</title>

-<style type="text/css"> body {	margin: 0px; border: 0px; background-color: buttonface; } </style>

-

-<script>

-

-// if we pass the "window" object as a argument and then set opener to

-// equal that we can refer to dialogWindows and popupWindows the same way

-if (window.dialogArguments) { opener = window.dialogArguments; }

-

-var _editor_url = "../";

-document.write('<scr'+'ipt src="' +_editor_url+ 'editor.js" language="Javascript1.2"></scr'+'ipt>');

-

-var parent_objname = location.search.substring(1,location.search.length);  // parent editor objname

-var parent_config  = opener.document.all[parent_objname].config;

-

-var config         = cloneObject( parent_config );

-var objname        = 'editor'; // name of this editor

-

-//  DOMViewerObj = config;

-//  DOMViewerName = 'config';

-//  window.open('/innerHTML/domviewer.htm');  

-

-/* ---------------------------------------------------------------------- *\

-  Function    : 

-  Description : 

-\* ---------------------------------------------------------------------- */

-

-function _CloseOnEsc() {

-  if (event.keyCode == 27) {

-    update_parent();

-    window.close();

-    return;

-  }

-}

-

-/* ---------------------------------------------------------------------- *\

-  Function    : cloneObject

-  Description : copy an object by value instead of by reference

-  Usage       : var newObj = cloneObject(oldObj);

-\* ---------------------------------------------------------------------- */

-

-function cloneObject(obj) {

-  var newObj          = new Object; 

-

-  // check for array objects

-  if (obj.constructor.toString().indexOf('function Array(') == 1) {

-    newObj = obj.constructor();

-  }

-

-  for (var n in obj) {

-    var node = obj[n];

-    if (typeof node == 'object') { newObj[n] = cloneObject(node); }

-    else                         { newObj[n] = node; }

-  }

-  

-  return newObj;

-}

-

-/* ---------------------------------------------------------------------- *\

-  Function    : resize_editor

-  Description : resize the editor when the user resizes the popup

-\* ---------------------------------------------------------------------- */

-

-function resize_editor() {  // resize editor to fix window

-  var editor = document.all['_editor_editor'];

-

-  newWidth  = document.body.offsetWidth;

-  newHeight = document.body.offsetHeight - editor.offsetTop;

-

-  if (newWidth < 0) { newWidth = 0; }

-  if (newHeight < 0) { newHeight = 0; }

-

-  editor.style.width  = newWidth;

-  editor.style.height = newHeight;

-}

-

-/* ---------------------------------------------------------------------- *\

-  Function    : init

-  Description : run this code on page load

-\* ---------------------------------------------------------------------- */

-

-function init() {

-  // change maximize button to minimize button

-  config.btnList["popupeditor"] = ['popupeditor', 'Minimize Editor',  'update_parent(); window.close();', 'fullscreen_minimize.gif'];

-

-  // set htmlmode button to refer to THIS editor

-  config.btnList["htmlmode"]    = ['HtmlMode',    'View HTML Source', 'editor_setmode(\'editor\')',  'ed_html.gif'];

-

-  // change image url to be relative to current path

-  config.imgURL = "../images/";

-  

-  // generate editor and resize it

-  editor_generate('editor', config);

-  resize_editor();

-

-  // switch mode if needed

-  if (parent_config.mode == 'textedit') { editor_setmode(objname, 'textedit'); }

-

-  // set child window contents

-  var parentHTML = opener.editor_getHTML(parent_objname);

-  editor_setHTML(objname, parentHTML);

-

-  // continuously update parent editor window

-  window.setInterval(update_parent, 333);

-

-  // setup event handlers

-  document.body.onkeypress = _CloseOnEsc;

-  window.onresize = resize_editor;

-}

-

-/* ---------------------------------------------------------------------- *\

-  Function    : update_parent

-  Description : update parent window editor field with contents from child window

-\* ---------------------------------------------------------------------- */

-

-function update_parent() {

-  var childHTML = editor_getHTML(objname);

-  opener.editor_setHTML(parent_objname, childHTML);

-}

-

-

-</script>

-</head>

-<body scroll="no" onload="init()" onunload="update_parent()">

-

-<div style="margin: 0 0 0 0; border-width: 1; border-style: solid; border-color: threedshadow threedhighlight threedhighlight threedshadow; "></div>

-

-<textarea name="editor" style="width:100%; height:300px"></textarea><br>

-

-</body></html>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/popups/old_insert_image.html 75/e107_handlers/htmlarea/popups/old_insert_image.html
--- 6171/e107_handlers/htmlarea/popups/old_insert_image.html	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/old_insert_image.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,206 +0,0 @@
-<!-- based on insimage.dlg -->

-

-<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">

-<HTML  id=dlgImage STYLE="width: 432px; height: 194px; ">

-<HEAD>

-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

-<meta http-equiv="MSThemeCompatible" content="Yes">

-<TITLE>Insert Image</TITLE>

-<style>

-  html, body, button, div, input, select, fieldset { font-family: MS Shell Dlg; font-size: 8pt; position: absolute; };

-</style>

-<SCRIPT defer>

-

-function _CloseOnEsc() {

-  if (event.keyCode == 27) { window.close(); return; }

-}

-

-function _getTextRange(elm) {

-  var r = elm.parentTextEdit.createTextRange();

-  r.moveToElementText(elm);

-  return r;

-}

-

-window.onerror = HandleError

-

-function HandleError(message, url, line) {

-  var str = "An error has occurred in this dialog." + "\n\n"

-  + "Error: " + line + "\n" + message;

-  alert(str);

-  window.close();

-  return true;

-}

-

-function Init() {

-  var elmSelectedImage;

-  var htmlSelectionControl = "Control";

-  var globalDoc = window.dialogArguments;

-  var grngMaster = globalDoc.selection.createRange();

-  

-  // event handlers  

-  document.body.onkeypress = _CloseOnEsc;

-  btnOK.onclick = new Function("btnOKClick()");

-

-  txtFileName.fImageLoaded = false;

-  txtFileName.intImageWidth = 0;

-  txtFileName.intImageHeight = 0;

-

-  if (globalDoc.selection.type == htmlSelectionControl) {

-    if (grngMaster.length == 1) {

-      elmSelectedImage = grngMaster.item(0);

-      if (elmSelectedImage.tagName == "IMG") {

-        txtFileName.fImageLoaded = true;

-        if (elmSelectedImage.src) {

-          txtFileName.value          = elmSelectedImage.src.replace(/^[^*]*(\*\*\*)/, "$1");  // fix placeholder src values that editor converted to abs paths

-          txtFileName.intImageHeight = elmSelectedImage.height;

-          txtFileName.intImageWidth  = elmSelectedImage.width;

-          txtVertical.value          = elmSelectedImage.vspace;

-          txtHorizontal.value        = elmSelectedImage.hspace;

-          txtBorder.value            = elmSelectedImage.border;

-          txtAltText.value           = elmSelectedImage.alt;

-          selAlignment.value         = elmSelectedImage.align;

-        }

-      }

-    }

-  }

-  txtFileName.value = txtFileName.value || "http://";

-  txtFileName.focus();

-}

-

-function _isValidNumber(txtBox) {

-  var val = parseInt(txtBox);

-  if (isNaN(val) || val < 0 || val > 999) { return false; }

-  return true;

-}

-

-function btnOKClick() {

-  var elmImage;

-  var intAlignment;

-  var htmlSelectionControl = "Control";

-  var globalDoc = window.dialogArguments;

-  var grngMaster = globalDoc.selection.createRange();

-  

-  // error checking

-

-  if (!txtFileName.value || txtFileName.value == "http://") { 

-    alert("Image URL must be specified.");

-    txtFileName.focus();

-    return;

-  }

-  if (txtHorizontal.value && !_isValidNumber(txtHorizontal.value)) {

-    alert("Horizontal spacing must be a number between 0 and 999.");

-    txtHorizontal.focus();

-    return;

-  }

-  if (txtBorder.value && !_isValidNumber(txtBorder.value)) {

-    alert("Border thickness must be a number between 0 and 999.");

-    txtBorder.focus();

-    return;

-  }

-  if (txtVertical.value && !_isValidNumber(txtVertical.value)) {

-    alert("Vertical spacing must be a number between 0 and 999.");

-    txtVertical.focus();

-    return;

-  }

-

-  // delete selected content and replace with image

-  if (globalDoc.selection.type == htmlSelectionControl && !txtFileName.fImageLoaded) {

-    grngMaster.execCommand('Delete');

-    grngMaster = globalDoc.selection.createRange();

-  }

-    

-  idstr = "\" id=\"556e697175657e537472696e67";     // new image creation ID

-  if (!txtFileName.fImageLoaded) {

-    grngMaster.execCommand("InsertImage", false, idstr);

-    elmImage = globalDoc.all['556e697175657e537472696e67'];

-    elmImage.removeAttribute("id");

-    elmImage.removeAttribute("src");

-    grngMaster.moveStart("character", -1);

-  } else {

-    elmImage = grngMaster.item(0);

-    if (elmImage.src != txtFileName.value) {

-      grngMaster.execCommand('Delete');

-      grngMaster = globalDoc.selection.createRange();

-      grngMaster.execCommand("InsertImage", false, idstr);

-      elmImage = globalDoc.all['556e697175657e537472696e67'];

-      elmImage.removeAttribute("id");

-      elmImage.removeAttribute("src");

-      grngMaster.moveStart("character", -1);

-      txtFileName.fImageLoaded = false;

-    }

-    grngMaster = _getTextRange(elmImage);

-  }

-

-  if (txtFileName.fImageLoaded) {

-    elmImage.style.width = txtFileName.intImageWidth;

-    elmImage.style.height = txtFileName.intImageHeight;

-  }

-

-  if (txtFileName.value.length > 2040) {

-    txtFileName.value = txtFileName.value.substring(0,2040);

-  }

-  

-  elmImage.src = txtFileName.value;

-  

-  if (txtHorizontal.value != "") { elmImage.hspace = parseInt(txtHorizontal.value); }

-  else                           { elmImage.hspace = 0; }

-

-  if (txtVertical.value != "") { elmImage.vspace = parseInt(txtVertical.value); }

-  else                         { elmImage.vspace = 0; }

-  

-  elmImage.alt = txtAltText.value;

-

-  if (txtBorder.value != "") { elmImage.border = parseInt(txtBorder.value); }

-  else                       { elmImage.border = 0; }

-

-  elmImage.align = selAlignment.value;

-  grngMaster.collapse(false);

-  grngMaster.select();

-  window.close();

-}

-</SCRIPT>

-</HEAD>

-<BODY id=bdy onload="Init()" style="background: threedface; color: windowtext;" scroll=no>

-

-<DIV id=divFileName style="left: 0.98em; top: 1.2168em; width: 7em; height: 1.2168em; ">Image URL:</DIV>

-<INPUT ID=txtFileName type=text style="left: 8.54em; top: 1.0647em; width: 21.5em;height: 2.1294em; " tabIndex=10 onfocus="select()">

-

-<DIV id=divAltText style="left: 0.98em; top: 4.1067em; width: 6.58em; height: 1.2168em; ">Alternate Text:</DIV>

-<INPUT type=text ID=txtAltText tabIndex=15 style="left: 8.54em; top: 3.8025em; width: 21.5em; height: 2.1294em; " onfocus="select()">

-

-<FIELDSET id=fldLayout style="left: .9em; top: 7.1em; width: 17.08em; height: 7.6em;">

-<LEGEND id=lgdLayout>Layout</LEGEND>

-</FIELDSET>

-

-<FIELDSET id=fldSpacing style="left: 18.9em; top: 7.1em; width: 11em; height: 7.6em;">

-<LEGEND id=lgdSpacing>Spacing</LEGEND>

-</FIELDSET>

-

-<DIV id=divAlign style="left: 1.82em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Alignment:</DIV>

-<SELECT size=1 ID=selAlignment tabIndex=20 style="left: 10.36em; top: 8.8218em; width: 6.72em; height: 1.2168em; ">

-<OPTION id=optNotSet value=""> Not set </OPTION>

-<OPTION id=optLeft value=left> Left </OPTION>

-<OPTION id=optRight value=right> Right </OPTION>

-<OPTION id=optTexttop value=textTop> Texttop </OPTION>

-<OPTION id=optAbsMiddle value=absMiddle> Absmiddle </OPTION>

-<OPTION id=optBaseline value=baseline SELECTED> Baseline </OPTION>

-<OPTION id=optAbsBottom value=absBottom> Absbottom </OPTION>

-<OPTION id=optBottom value=bottom> Bottom </OPTION>

-<OPTION id=optMiddle value=middle> Middle </OPTION>

-<OPTION id=optTop value=top> Top </OPTION>

-</SELECT>

-

-<DIV id=divHoriz style="left: 19.88em; top: 9.126em; width: 4.76em; height: 1.2168em; ">Horizontal:</DIV>

-<INPUT ID=txtHorizontal style="left: 24.92em; top: 8.8218em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=25 onfocus="select()">

-

-<DIV id=divBorder style="left: 1.82em; top: 12.0159em; width: 8.12em; height: 1.2168em; ">Border Thickness:</DIV>

-<INPUT ID=txtBorder style="left: 10.36em; top: 11.5596em; width: 6.72em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=21 onfocus="select()">

-

-<DIV id=divVert style="left: 19.88em; top: 12.0159em; width: 3.64em; height: 1.2168em; ">Vertical:</DIV>

-<INPUT ID=txtVertical style="left: 24.92em; top: 11.5596em; width: 4.2em; height: 2.1294em; ime-mode: disabled;" type=text size=3 maxlength=3 value="" tabIndex=30 onfocus="select()">

-

-<BUTTON ID=btnOK style="left: 31.36em; top: 1.0647em; width: 7em; height: 2.2em; " type=submit tabIndex=40>OK</BUTTON>

-<BUTTON ID=btnCancel style="left: 31.36em; top: 3.6504em; width: 7em; height: 2.2em; " type=reset tabIndex=45 onClick="window.close();">Cancel</BUTTON>

-

-</BODY>

-</HTML>
\ No newline at end of file
diff -ruN 6171/e107_handlers/htmlarea/popups/popup.js 75/e107_handlers/htmlarea/popups/popup.js
--- 6171/e107_handlers/htmlarea/popups/popup.js	2004-08-11 04:26:40.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/popup.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,109 +0,0 @@
-// htmlArea v3.0 - Copyright (c) 2002, 2003 interactivetools.com, inc.
-// This copyright notice MUST stay intact for use (see license.txt).
-//
-// Portions (c) dynarch.com, 2003
-//
-// A free WYSIWYG editor replacement for <textarea> fields.
-// For full source code and docs, visit http://www.interactivetools.com/
-//
-// Version 3.0 developed by Mihai Bazon.
-//   http://dynarch.com/mishoo
-//
-// $Id: popup.js,v 1.5 2004/08/11 09:26:39 e107coders Exp $
-
-function getAbsolutePos(el) {
-	var r = { x: el.offsetLeft, y: el.offsetTop };
-	if (el.offsetParent) {
-		var tmp = getAbsolutePos(el.offsetParent);
-		r.x += tmp.x;
-		r.y += tmp.y;
-	}
-	return r;
-};
-
-function comboSelectValue(c, val) {
-	var ops = c.getElementsByTagName("option");
-	for (var i = ops.length; --i >= 0;) {
-		var op = ops[i];
-		op.selected = (op.value == val);
-	}
-	c.value = val;
-};
-
-function __dlg_onclose() {
-	opener.Dialog._return(null);
-};
-
-function __dlg_init(bottom) {
-	var body = document.body;
-	var body_height = 0;
-	if (typeof bottom == "undefined") {
-		var div = document.createElement("div");
-		body.appendChild(div);
-		var pos = getAbsolutePos(div);
-		body_height = pos.y;
-	} else {
-		var pos = getAbsolutePos(bottom);
-		body_height = pos.y + bottom.offsetHeight;
-	}
-	window.dialogArguments = opener.Dialog._arguments;
-	if (!document.all) {
-		window.sizeToContent();
-		window.sizeToContent();	// for reasons beyond understanding,
-					// only if we call it twice we get the
-					// correct size.
-		window.addEventListener("unload", __dlg_onclose, true);
-		// center on parent
-		var x = opener.screenX + (opener.outerWidth - window.outerWidth) / 2;
-		var y = opener.screenY + (opener.outerHeight - window.outerHeight) / 2;
-		window.moveTo(x, y);
-		window.innerWidth = body.offsetWidth + 5;
-		window.innerHeight = body_height + 2;
-	} else {
-		// window.dialogHeight = body.offsetHeight + 50 + "px";
-		// window.dialogWidth = body.offsetWidth + "px";
-		window.resizeTo(body.offsetWidth, body_height);
-		var ch = body.clientHeight;
-		var cw = body.clientWidth;
-		window.resizeBy(body.offsetWidth - cw, body_height - ch);
-		var W = body.offsetWidth;
-		var H = 2 * body_height - ch;
-		var x = (screen.availWidth - W) / 2;
-		var y = (screen.availHeight - H) / 2;
-		window.moveTo(x, y);
-	}
-	document.body.onkeypress = __dlg_close_on_esc;
-};
-
-function __dlg_translate(i18n) {
-	var types = ["span", "option", "td", "button", "div"];
-	for (var type = 0; type < types.length; ++type) {
-		var spans = document.getElementsByTagName(types[type]);
-		for (var i = spans.length; --i >= 0;) {
-			var span = spans[i];
-			if (span.firstChild && span.firstChild.data) {
-				var txt = i18n[span.firstChild.data];
-				if (txt)
-					span.firstChild.data = txt;
-			}
-		}
-	}
-	var txt = i18n[document.title];
-	if (txt)
-		document.title = txt;
-};
-
-// closes the dialog and passes the return info upper.
-function __dlg_close(val) {
-	opener.Dialog._return(val);
-	window.close();
-};
-
-function __dlg_close_on_esc(ev) {
-	ev || (ev = window.event);
-	if (ev.keyCode == 27) {
-		window.close();
-		return false;
-	}
-	return true;
-};
diff -ruN 6171/e107_handlers/htmlarea/popups/select_color.html 75/e107_handlers/htmlarea/popups/select_color.html
--- 6171/e107_handlers/htmlarea/popups/select_color.html	2004-06-26 08:48:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popups/select_color.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,347 +0,0 @@
-<!-- note: this version of the color picker is optimized for IE 5.5+ only -->

-

-<html><head><title>Select Color</title>

-

-<script type="text/javascript" src="popup.js"></script>

-

-<script type="text/javascript">

-

-window.resizeTo(240, 182);

-function _CloseOnEsc() {

-  if (event.keyCode == 27) { window.close(); return; }

-}

-

-function Init() {                                                       // run on page load

-  __dlg_init();    // <!-- this can be found in popup.js -->

-  document.body.onkeypress = _CloseOnEsc;

-

-  var color = window.dialogArguments;

-  color = ValidateColor(color) || '000000';

-  View(color);                                                          // set default color

-}

-

-function View(color) {                  // preview color

-  document.getElementById("ColorPreview").style.backgroundColor = '#' + color;

-  document.getElementById("ColorHex").value = '#' + color;

-}

-

-function Set(string) {                   // select color

-  var color = ValidateColor(string);

-  if (color == null) { alert("Invalid color code: " + string); }        // invalid color

-  else {                                                                // valid color

-    View(color);                          // show selected color

-    __dlg_close(color);

-  }

-}

-

-function ValidateColor(string) {                // return valid color code

-  string = string || '';

-  string = string + "";

-  string = string.toUpperCase();

-  var chars = '0123456789ABCDEF';

-  var out   = '';

-

-  for (var i=0; i<string.length; i++) {             // remove invalid color chars

-    var schar = string.charAt(i);

-    if (chars.indexOf(schar) != -1) { out += schar; }

-  }

-

-  if (out.length != 6) { return null; }            // check length

-  return out;

-}

-

-</script>

-</head>

-<body style="background:ButtonFace; margin:0px; padding:0px" onload="Init()">

-

-<form method="get" style="margin:0px; padding:0px" onSubmit="Set(document.getElementById('ColorHex').value); return false;">

-<table border="0px" cellspacing="0px" cellpadding="4" width="100%">

- <tr>

-  <td style="background:buttonface" valign=center><div style="background-color: #000000; padding: 1; height: 21px; width: 50px"><div id="ColorPreview" style="height: 100%; width: 100%"></div></div></td>

-  <td style="background:buttonface" valign=center><input type="text" name="ColorHex"

-    id="ColorHex" value="" size=15 style="font-size: 12px"></td>

-  <td style="background:buttonface" width=100%></td>

- </tr>

-</table>

-</form>

-

-<table border="0" cellspacing="1px" cellpadding="0px" width="100%" bgcolor="#000000" style="cursor: hand;">

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#003300 onMouseOver=View('003300') onClick=Set('003300') height="10px" width="10px"></td>

-<td bgcolor=#006600 onMouseOver=View('006600') onClick=Set('006600') height="10px" width="10px"></td>

-<td bgcolor=#009900 onMouseOver=View('009900') onClick=Set('009900') height="10px" width="10px"></td>

-<td bgcolor=#00CC00 onMouseOver=View('00CC00') onClick=Set('00CC00') height="10px" width="10px"></td>

-<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>

-<td bgcolor=#330000 onMouseOver=View('330000') onClick=Set('330000') height="10px" width="10px"></td>

-<td bgcolor=#333300 onMouseOver=View('333300') onClick=Set('333300') height="10px" width="10px"></td>

-<td bgcolor=#336600 onMouseOver=View('336600') onClick=Set('336600') height="10px" width="10px"></td>

-<td bgcolor=#339900 onMouseOver=View('339900') onClick=Set('339900') height="10px" width="10px"></td>

-<td bgcolor=#33CC00 onMouseOver=View('33CC00') onClick=Set('33CC00') height="10px" width="10px"></td>

-<td bgcolor=#33FF00 onMouseOver=View('33FF00') onClick=Set('33FF00') height="10px" width="10px"></td>

-<td bgcolor=#660000 onMouseOver=View('660000') onClick=Set('660000') height="10px" width="10px"></td>

-<td bgcolor=#663300 onMouseOver=View('663300') onClick=Set('663300') height="10px" width="10px"></td>

-<td bgcolor=#666600 onMouseOver=View('666600') onClick=Set('666600') height="10px" width="10px"></td>

-<td bgcolor=#669900 onMouseOver=View('669900') onClick=Set('669900') height="10px" width="10px"></td>

-<td bgcolor=#66CC00 onMouseOver=View('66CC00') onClick=Set('66CC00') height="10px" width="10px"></td>

-<td bgcolor=#66FF00 onMouseOver=View('66FF00') onClick=Set('66FF00') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#000033 onMouseOver=View('000033') onClick=Set('000033') height="10px" width="10px"></td>

-<td bgcolor=#003333 onMouseOver=View('003333') onClick=Set('003333') height="10px" width="10px"></td>

-<td bgcolor=#006633 onMouseOver=View('006633') onClick=Set('006633') height="10px" width="10px"></td>

-<td bgcolor=#009933 onMouseOver=View('009933') onClick=Set('009933') height="10px" width="10px"></td>

-<td bgcolor=#00CC33 onMouseOver=View('00CC33') onClick=Set('00CC33') height="10px" width="10px"></td>

-<td bgcolor=#00FF33 onMouseOver=View('00FF33') onClick=Set('00FF33') height="10px" width="10px"></td>

-<td bgcolor=#330033 onMouseOver=View('330033') onClick=Set('330033') height="10px" width="10px"></td>

-<td bgcolor=#333333 onMouseOver=View('333333') onClick=Set('333333') height="10px" width="10px"></td>

-<td bgcolor=#336633 onMouseOver=View('336633') onClick=Set('336633') height="10px" width="10px"></td>

-<td bgcolor=#339933 onMouseOver=View('339933') onClick=Set('339933') height="10px" width="10px"></td>

-<td bgcolor=#33CC33 onMouseOver=View('33CC33') onClick=Set('33CC33') height="10px" width="10px"></td>

-<td bgcolor=#33FF33 onMouseOver=View('33FF33') onClick=Set('33FF33') height="10px" width="10px"></td>

-<td bgcolor=#660033 onMouseOver=View('660033') onClick=Set('660033') height="10px" width="10px"></td>

-<td bgcolor=#663333 onMouseOver=View('663333') onClick=Set('663333') height="10px" width="10px"></td>

-<td bgcolor=#666633 onMouseOver=View('666633') onClick=Set('666633') height="10px" width="10px"></td>

-<td bgcolor=#669933 onMouseOver=View('669933') onClick=Set('669933') height="10px" width="10px"></td>

-<td bgcolor=#66CC33 onMouseOver=View('66CC33') onClick=Set('66CC33') height="10px" width="10px"></td>

-<td bgcolor=#66FF33 onMouseOver=View('66FF33') onClick=Set('66FF33') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#000066 onMouseOver=View('000066') onClick=Set('000066') height="10px" width="10px"></td>

-<td bgcolor=#003366 onMouseOver=View('003366') onClick=Set('003366') height="10px" width="10px"></td>

-<td bgcolor=#006666 onMouseOver=View('006666') onClick=Set('006666') height="10px" width="10px"></td>

-<td bgcolor=#009966 onMouseOver=View('009966') onClick=Set('009966') height="10px" width="10px"></td>

-<td bgcolor=#00CC66 onMouseOver=View('00CC66') onClick=Set('00CC66') height="10px" width="10px"></td>

-<td bgcolor=#00FF66 onMouseOver=View('00FF66') onClick=Set('00FF66') height="10px" width="10px"></td>

-<td bgcolor=#330066 onMouseOver=View('330066') onClick=Set('330066') height="10px" width="10px"></td>

-<td bgcolor=#333366 onMouseOver=View('333366') onClick=Set('333366') height="10px" width="10px"></td>

-<td bgcolor=#336666 onMouseOver=View('336666') onClick=Set('336666') height="10px" width="10px"></td>

-<td bgcolor=#339966 onMouseOver=View('339966') onClick=Set('339966') height="10px" width="10px"></td>

-<td bgcolor=#33CC66 onMouseOver=View('33CC66') onClick=Set('33CC66') height="10px" width="10px"></td>

-<td bgcolor=#33FF66 onMouseOver=View('33FF66') onClick=Set('33FF66') height="10px" width="10px"></td>

-<td bgcolor=#660066 onMouseOver=View('660066') onClick=Set('660066') height="10px" width="10px"></td>

-<td bgcolor=#663366 onMouseOver=View('663366') onClick=Set('663366') height="10px" width="10px"></td>

-<td bgcolor=#666666 onMouseOver=View('666666') onClick=Set('666666') height="10px" width="10px"></td>

-<td bgcolor=#669966 onMouseOver=View('669966') onClick=Set('669966') height="10px" width="10px"></td>

-<td bgcolor=#66CC66 onMouseOver=View('66CC66') onClick=Set('66CC66') height="10px" width="10px"></td>

-<td bgcolor=#66FF66 onMouseOver=View('66FF66') onClick=Set('66FF66') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#000099 onMouseOver=View('000099') onClick=Set('000099') height="10px" width="10px"></td>

-<td bgcolor=#003399 onMouseOver=View('003399') onClick=Set('003399') height="10px" width="10px"></td>

-<td bgcolor=#006699 onMouseOver=View('006699') onClick=Set('006699') height="10px" width="10px"></td>

-<td bgcolor=#009999 onMouseOver=View('009999') onClick=Set('009999') height="10px" width="10px"></td>

-<td bgcolor=#00CC99 onMouseOver=View('00CC99') onClick=Set('00CC99') height="10px" width="10px"></td>

-<td bgcolor=#00FF99 onMouseOver=View('00FF99') onClick=Set('00FF99') height="10px" width="10px"></td>

-<td bgcolor=#330099 onMouseOver=View('330099') onClick=Set('330099') height="10px" width="10px"></td>

-<td bgcolor=#333399 onMouseOver=View('333399') onClick=Set('333399') height="10px" width="10px"></td>

-<td bgcolor=#336699 onMouseOver=View('336699') onClick=Set('336699') height="10px" width="10px"></td>

-<td bgcolor=#339999 onMouseOver=View('339999') onClick=Set('339999') height="10px" width="10px"></td>

-<td bgcolor=#33CC99 onMouseOver=View('33CC99') onClick=Set('33CC99') height="10px" width="10px"></td>

-<td bgcolor=#33FF99 onMouseOver=View('33FF99') onClick=Set('33FF99') height="10px" width="10px"></td>

-<td bgcolor=#660099 onMouseOver=View('660099') onClick=Set('660099') height="10px" width="10px"></td>

-<td bgcolor=#663399 onMouseOver=View('663399') onClick=Set('663399') height="10px" width="10px"></td>

-<td bgcolor=#666699 onMouseOver=View('666699') onClick=Set('666699') height="10px" width="10px"></td>

-<td bgcolor=#669999 onMouseOver=View('669999') onClick=Set('669999') height="10px" width="10px"></td>

-<td bgcolor=#66CC99 onMouseOver=View('66CC99') onClick=Set('66CC99') height="10px" width="10px"></td>

-<td bgcolor=#66FF99 onMouseOver=View('66FF99') onClick=Set('66FF99') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#0000CC onMouseOver=View('0000CC') onClick=Set('0000CC') height="10px" width="10px"></td>

-<td bgcolor=#0033CC onMouseOver=View('0033CC') onClick=Set('0033CC') height="10px" width="10px"></td>

-<td bgcolor=#0066CC onMouseOver=View('0066CC') onClick=Set('0066CC') height="10px" width="10px"></td>

-<td bgcolor=#0099CC onMouseOver=View('0099CC') onClick=Set('0099CC') height="10px" width="10px"></td>

-<td bgcolor=#00CCCC onMouseOver=View('00CCCC') onClick=Set('00CCCC') height="10px" width="10px"></td>

-<td bgcolor=#00FFCC onMouseOver=View('00FFCC') onClick=Set('00FFCC') height="10px" width="10px"></td>

-<td bgcolor=#3300CC onMouseOver=View('3300CC') onClick=Set('3300CC') height="10px" width="10px"></td>

-<td bgcolor=#3333CC onMouseOver=View('3333CC') onClick=Set('3333CC') height="10px" width="10px"></td>

-<td bgcolor=#3366CC onMouseOver=View('3366CC') onClick=Set('3366CC') height="10px" width="10px"></td>

-<td bgcolor=#3399CC onMouseOver=View('3399CC') onClick=Set('3399CC') height="10px" width="10px"></td>

-<td bgcolor=#33CCCC onMouseOver=View('33CCCC') onClick=Set('33CCCC') height="10px" width="10px"></td>

-<td bgcolor=#33FFCC onMouseOver=View('33FFCC') onClick=Set('33FFCC') height="10px" width="10px"></td>

-<td bgcolor=#6600CC onMouseOver=View('6600CC') onClick=Set('6600CC') height="10px" width="10px"></td>

-<td bgcolor=#6633CC onMouseOver=View('6633CC') onClick=Set('6633CC') height="10px" width="10px"></td>

-<td bgcolor=#6666CC onMouseOver=View('6666CC') onClick=Set('6666CC') height="10px" width="10px"></td>

-<td bgcolor=#6699CC onMouseOver=View('6699CC') onClick=Set('6699CC') height="10px" width="10px"></td>

-<td bgcolor=#66CCCC onMouseOver=View('66CCCC') onClick=Set('66CCCC') height="10px" width="10px"></td>

-<td bgcolor=#66FFCC onMouseOver=View('66FFCC') onClick=Set('66FFCC') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>

-<td bgcolor=#0033FF onMouseOver=View('0033FF') onClick=Set('0033FF') height="10px" width="10px"></td>

-<td bgcolor=#0066FF onMouseOver=View('0066FF') onClick=Set('0066FF') height="10px" width="10px"></td>

-<td bgcolor=#0099FF onMouseOver=View('0099FF') onClick=Set('0099FF') height="10px" width="10px"></td>

-<td bgcolor=#00CCFF onMouseOver=View('00CCFF') onClick=Set('00CCFF') height="10px" width="10px"></td>

-<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>

-<td bgcolor=#3300FF onMouseOver=View('3300FF') onClick=Set('3300FF') height="10px" width="10px"></td>

-<td bgcolor=#3333FF onMouseOver=View('3333FF') onClick=Set('3333FF') height="10px" width="10px"></td>

-<td bgcolor=#3366FF onMouseOver=View('3366FF') onClick=Set('3366FF') height="10px" width="10px"></td>

-<td bgcolor=#3399FF onMouseOver=View('3399FF') onClick=Set('3399FF') height="10px" width="10px"></td>

-<td bgcolor=#33CCFF onMouseOver=View('33CCFF') onClick=Set('33CCFF') height="10px" width="10px"></td>

-<td bgcolor=#33FFFF onMouseOver=View('33FFFF') onClick=Set('33FFFF') height="10px" width="10px"></td>

-<td bgcolor=#6600FF onMouseOver=View('6600FF') onClick=Set('6600FF') height="10px" width="10px"></td>

-<td bgcolor=#6633FF onMouseOver=View('6633FF') onClick=Set('6633FF') height="10px" width="10px"></td>

-<td bgcolor=#6666FF onMouseOver=View('6666FF') onClick=Set('6666FF') height="10px" width="10px"></td>

-<td bgcolor=#6699FF onMouseOver=View('6699FF') onClick=Set('6699FF') height="10px" width="10px"></td>

-<td bgcolor=#66CCFF onMouseOver=View('66CCFF') onClick=Set('66CCFF') height="10px" width="10px"></td>

-<td bgcolor=#66FFFF onMouseOver=View('66FFFF') onClick=Set('66FFFF') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#990000 onMouseOver=View('990000') onClick=Set('990000') height="10px" width="10px"></td>

-<td bgcolor=#993300 onMouseOver=View('993300') onClick=Set('993300') height="10px" width="10px"></td>

-<td bgcolor=#996600 onMouseOver=View('996600') onClick=Set('996600') height="10px" width="10px"></td>

-<td bgcolor=#999900 onMouseOver=View('999900') onClick=Set('999900') height="10px" width="10px"></td>

-<td bgcolor=#99CC00 onMouseOver=View('99CC00') onClick=Set('99CC00') height="10px" width="10px"></td>

-<td bgcolor=#99FF00 onMouseOver=View('99FF00') onClick=Set('99FF00') height="10px" width="10px"></td>

-<td bgcolor=#CC0000 onMouseOver=View('CC0000') onClick=Set('CC0000') height="10px" width="10px"></td>

-<td bgcolor=#CC3300 onMouseOver=View('CC3300') onClick=Set('CC3300') height="10px" width="10px"></td>

-<td bgcolor=#CC6600 onMouseOver=View('CC6600') onClick=Set('CC6600') height="10px" width="10px"></td>

-<td bgcolor=#CC9900 onMouseOver=View('CC9900') onClick=Set('CC9900') height="10px" width="10px"></td>

-<td bgcolor=#CCCC00 onMouseOver=View('CCCC00') onClick=Set('CCCC00') height="10px" width="10px"></td>

-<td bgcolor=#CCFF00 onMouseOver=View('CCFF00') onClick=Set('CCFF00') height="10px" width="10px"></td>

-<td bgcolor=#FF0000 onMouseOver=View('FF0000') onClick=Set('FF0000') height="10px" width="10px"></td>

-<td bgcolor=#FF3300 onMouseOver=View('FF3300') onClick=Set('FF3300') height="10px" width="10px"></td>

-<td bgcolor=#FF6600 onMouseOver=View('FF6600') onClick=Set('FF6600') height="10px" width="10px"></td>

-<td bgcolor=#FF9900 onMouseOver=View('FF9900') onClick=Set('FF9900') height="10px" width="10px"></td>

-<td bgcolor=#FFCC00 onMouseOver=View('FFCC00') onClick=Set('FFCC00') height="10px" width="10px"></td>

-<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#00FF00 onMouseOver=View('00FF00') onClick=Set('00FF00') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#990033 onMouseOver=View('990033') onClick=Set('990033') height="10px" width="10px"></td>

-<td bgcolor=#993333 onMouseOver=View('993333') onClick=Set('993333') height="10px" width="10px"></td>

-<td bgcolor=#996633 onMouseOver=View('996633') onClick=Set('996633') height="10px" width="10px"></td>

-<td bgcolor=#999933 onMouseOver=View('999933') onClick=Set('999933') height="10px" width="10px"></td>

-<td bgcolor=#99CC33 onMouseOver=View('99CC33') onClick=Set('99CC33') height="10px" width="10px"></td>

-<td bgcolor=#99FF33 onMouseOver=View('99FF33') onClick=Set('99FF33') height="10px" width="10px"></td>

-<td bgcolor=#CC0033 onMouseOver=View('CC0033') onClick=Set('CC0033') height="10px" width="10px"></td>

-<td bgcolor=#CC3333 onMouseOver=View('CC3333') onClick=Set('CC3333') height="10px" width="10px"></td>

-<td bgcolor=#CC6633 onMouseOver=View('CC6633') onClick=Set('CC6633') height="10px" width="10px"></td>

-<td bgcolor=#CC9933 onMouseOver=View('CC9933') onClick=Set('CC9933') height="10px" width="10px"></td>

-<td bgcolor=#CCCC33 onMouseOver=View('CCCC33') onClick=Set('CCCC33') height="10px" width="10px"></td>

-<td bgcolor=#CCFF33 onMouseOver=View('CCFF33') onClick=Set('CCFF33') height="10px" width="10px"></td>

-<td bgcolor=#FF0033 onMouseOver=View('FF0033') onClick=Set('FF0033') height="10px" width="10px"></td>

-<td bgcolor=#FF3333 onMouseOver=View('FF3333') onClick=Set('FF3333') height="10px" width="10px"></td>

-<td bgcolor=#FF6633 onMouseOver=View('FF6633') onClick=Set('FF6633') height="10px" width="10px"></td>

-<td bgcolor=#FF9933 onMouseOver=View('FF9933') onClick=Set('FF9933') height="10px" width="10px"></td>

-<td bgcolor=#FFCC33 onMouseOver=View('FFCC33') onClick=Set('FFCC33') height="10px" width="10px"></td>

-<td bgcolor=#FFFF33 onMouseOver=View('FFFF33') onClick=Set('FFFF33') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#0000FF onMouseOver=View('0000FF') onClick=Set('0000FF') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#990066 onMouseOver=View('990066') onClick=Set('990066') height="10px" width="10px"></td>

-<td bgcolor=#993366 onMouseOver=View('993366') onClick=Set('993366') height="10px" width="10px"></td>

-<td bgcolor=#996666 onMouseOver=View('996666') onClick=Set('996666') height="10px" width="10px"></td>

-<td bgcolor=#999966 onMouseOver=View('999966') onClick=Set('999966') height="10px" width="10px"></td>

-<td bgcolor=#99CC66 onMouseOver=View('99CC66') onClick=Set('99CC66') height="10px" width="10px"></td>

-<td bgcolor=#99FF66 onMouseOver=View('99FF66') onClick=Set('99FF66') height="10px" width="10px"></td>

-<td bgcolor=#CC0066 onMouseOver=View('CC0066') onClick=Set('CC0066') height="10px" width="10px"></td>

-<td bgcolor=#CC3366 onMouseOver=View('CC3366') onClick=Set('CC3366') height="10px" width="10px"></td>

-<td bgcolor=#CC6666 onMouseOver=View('CC6666') onClick=Set('CC6666') height="10px" width="10px"></td>

-<td bgcolor=#CC9966 onMouseOver=View('CC9966') onClick=Set('CC9966') height="10px" width="10px"></td>

-<td bgcolor=#CCCC66 onMouseOver=View('CCCC66') onClick=Set('CCCC66') height="10px" width="10px"></td>

-<td bgcolor=#CCFF66 onMouseOver=View('CCFF66') onClick=Set('CCFF66') height="10px" width="10px"></td>

-<td bgcolor=#FF0066 onMouseOver=View('FF0066') onClick=Set('FF0066') height="10px" width="10px"></td>

-<td bgcolor=#FF3366 onMouseOver=View('FF3366') onClick=Set('FF3366') height="10px" width="10px"></td>

-<td bgcolor=#FF6666 onMouseOver=View('FF6666') onClick=Set('FF6666') height="10px" width="10px"></td>

-<td bgcolor=#FF9966 onMouseOver=View('FF9966') onClick=Set('FF9966') height="10px" width="10px"></td>

-<td bgcolor=#FFCC66 onMouseOver=View('FFCC66') onClick=Set('FFCC66') height="10px" width="10px"></td>

-<td bgcolor=#FFFF66 onMouseOver=View('FFFF66') onClick=Set('FFFF66') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#FFFF00 onMouseOver=View('FFFF00') onClick=Set('FFFF00') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#990099 onMouseOver=View('990099') onClick=Set('990099') height="10px" width="10px"></td>

-<td bgcolor=#993399 onMouseOver=View('993399') onClick=Set('993399') height="10px" width="10px"></td>

-<td bgcolor=#996699 onMouseOver=View('996699') onClick=Set('996699') height="10px" width="10px"></td>

-<td bgcolor=#999999 onMouseOver=View('999999') onClick=Set('999999') height="10px" width="10px"></td>

-<td bgcolor=#99CC99 onMouseOver=View('99CC99') onClick=Set('99CC99') height="10px" width="10px"></td>

-<td bgcolor=#99FF99 onMouseOver=View('99FF99') onClick=Set('99FF99') height="10px" width="10px"></td>

-<td bgcolor=#CC0099 onMouseOver=View('CC0099') onClick=Set('CC0099') height="10px" width="10px"></td>

-<td bgcolor=#CC3399 onMouseOver=View('CC3399') onClick=Set('CC3399') height="10px" width="10px"></td>

-<td bgcolor=#CC6699 onMouseOver=View('CC6699') onClick=Set('CC6699') height="10px" width="10px"></td>

-<td bgcolor=#CC9999 onMouseOver=View('CC9999') onClick=Set('CC9999') height="10px" width="10px"></td>

-<td bgcolor=#CCCC99 onMouseOver=View('CCCC99') onClick=Set('CCCC99') height="10px" width="10px"></td>

-<td bgcolor=#CCFF99 onMouseOver=View('CCFF99') onClick=Set('CCFF99') height="10px" width="10px"></td>

-<td bgcolor=#FF0099 onMouseOver=View('FF0099') onClick=Set('FF0099') height="10px" width="10px"></td>

-<td bgcolor=#FF3399 onMouseOver=View('FF3399') onClick=Set('FF3399') height="10px" width="10px"></td>

-<td bgcolor=#FF6699 onMouseOver=View('FF6699') onClick=Set('FF6699') height="10px" width="10px"></td>

-<td bgcolor=#FF9999 onMouseOver=View('FF9999') onClick=Set('FF9999') height="10px" width="10px"></td>

-<td bgcolor=#FFCC99 onMouseOver=View('FFCC99') onClick=Set('FFCC99') height="10px" width="10px"></td>

-<td bgcolor=#FFFF99 onMouseOver=View('FFFF99') onClick=Set('FFFF99') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#00FFFF onMouseOver=View('00FFFF') onClick=Set('00FFFF') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#9900CC onMouseOver=View('9900CC') onClick=Set('9900CC') height="10px" width="10px"></td>

-<td bgcolor=#9933CC onMouseOver=View('9933CC') onClick=Set('9933CC') height="10px" width="10px"></td>

-<td bgcolor=#9966CC onMouseOver=View('9966CC') onClick=Set('9966CC') height="10px" width="10px"></td>

-<td bgcolor=#9999CC onMouseOver=View('9999CC') onClick=Set('9999CC') height="10px" width="10px"></td>

-<td bgcolor=#99CCCC onMouseOver=View('99CCCC') onClick=Set('99CCCC') height="10px" width="10px"></td>

-<td bgcolor=#99FFCC onMouseOver=View('99FFCC') onClick=Set('99FFCC') height="10px" width="10px"></td>

-<td bgcolor=#CC00CC onMouseOver=View('CC00CC') onClick=Set('CC00CC') height="10px" width="10px"></td>

-<td bgcolor=#CC33CC onMouseOver=View('CC33CC') onClick=Set('CC33CC') height="10px" width="10px"></td>

-<td bgcolor=#CC66CC onMouseOver=View('CC66CC') onClick=Set('CC66CC') height="10px" width="10px"></td>

-<td bgcolor=#CC99CC onMouseOver=View('CC99CC') onClick=Set('CC99CC') height="10px" width="10px"></td>

-<td bgcolor=#CCCCCC onMouseOver=View('CCCCCC') onClick=Set('CCCCCC') height="10px" width="10px"></td>

-<td bgcolor=#CCFFCC onMouseOver=View('CCFFCC') onClick=Set('CCFFCC') height="10px" width="10px"></td>

-<td bgcolor=#FF00CC onMouseOver=View('FF00CC') onClick=Set('FF00CC') height="10px" width="10px"></td>

-<td bgcolor=#FF33CC onMouseOver=View('FF33CC') onClick=Set('FF33CC') height="10px" width="10px"></td>

-<td bgcolor=#FF66CC onMouseOver=View('FF66CC') onClick=Set('FF66CC') height="10px" width="10px"></td>

-<td bgcolor=#FF99CC onMouseOver=View('FF99CC') onClick=Set('FF99CC') height="10px" width="10px"></td>

-<td bgcolor=#FFCCCC onMouseOver=View('FFCCCC') onClick=Set('FFCCCC') height="10px" width="10px"></td>

-<td bgcolor=#FFFFCC onMouseOver=View('FFFFCC') onClick=Set('FFFFCC') height="10px" width="10px"></td>

-</tr>

-<tr>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>

-<td bgcolor=#000000 onMouseOver=View('000000') onClick=Set('000000') height="10px" width="10px"></td>

-<td bgcolor=#9900FF onMouseOver=View('9900FF') onClick=Set('9900FF') height="10px" width="10px"></td>

-<td bgcolor=#9933FF onMouseOver=View('9933FF') onClick=Set('9933FF') height="10px" width="10px"></td>

-<td bgcolor=#9966FF onMouseOver=View('9966FF') onClick=Set('9966FF') height="10px" width="10px"></td>

-<td bgcolor=#9999FF onMouseOver=View('9999FF') onClick=Set('9999FF') height="10px" width="10px"></td>

-<td bgcolor=#99CCFF onMouseOver=View('99CCFF') onClick=Set('99CCFF') height="10px" width="10px"></td>

-<td bgcolor=#99FFFF onMouseOver=View('99FFFF') onClick=Set('99FFFF') height="10px" width="10px"></td>

-<td bgcolor=#CC00FF onMouseOver=View('CC00FF') onClick=Set('CC00FF') height="10px" width="10px"></td>

-<td bgcolor=#CC33FF onMouseOver=View('CC33FF') onClick=Set('CC33FF') height="10px" width="10px"></td>

-<td bgcolor=#CC66FF onMouseOver=View('CC66FF') onClick=Set('CC66FF') height="10px" width="10px"></td>

-<td bgcolor=#CC99FF onMouseOver=View('CC99FF') onClick=Set('CC99FF') height="10px" width="10px"></td>

-<td bgcolor=#CCCCFF onMouseOver=View('CCCCFF') onClick=Set('CCCCFF') height="10px" width="10px"></td>

-<td bgcolor=#CCFFFF onMouseOver=View('CCFFFF') onClick=Set('CCFFFF') height="10px" width="10px"></td>

-<td bgcolor=#FF00FF onMouseOver=View('FF00FF') onClick=Set('FF00FF') height="10px" width="10px"></td>

-<td bgcolor=#FF33FF onMouseOver=View('FF33FF') onClick=Set('FF33FF') height="10px" width="10px"></td>

-<td bgcolor=#FF66FF onMouseOver=View('FF66FF') onClick=Set('FF66FF') height="10px" width="10px"></td>

-<td bgcolor=#FF99FF onMouseOver=View('FF99FF') onClick=Set('FF99FF') height="10px" width="10px"></td>

-<td bgcolor=#FFCCFF onMouseOver=View('FFCCFF') onClick=Set('FFCCFF') height="10px" width="10px"></td>

-<td bgcolor=#FFFFFF onMouseOver=View('FFFFFF') onClick=Set('FFFFFF') height="10px" width="10px"></td>

-</tr>

-</table>

-

-</body></html>

diff -ruN 6171/e107_handlers/htmlarea/popupwin.js 75/e107_handlers/htmlarea/popupwin.js
--- 6171/e107_handlers/htmlarea/popupwin.js	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/popupwin.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,139 +0,0 @@
-// (c) dynarch.com 2003-2004
-// Distributed under the same terms as HTMLArea itself.
-
-function PopupWin(editor, title, handler, initFunction) {
-	this.editor = editor;
-	this.handler = handler;
-	var dlg = window.open("", "__ha_dialog",
-			      "toolbar=no,menubar=no,personalbar=no,width=600,height=600,left=20,top=40" +
-			      "scrollbars=no,resizable=no");
-	this.window = dlg;
-	var doc = dlg.document;
-	this.doc = doc;
-	var self = this;
-
-	var base = document.baseURI || document.URL;
-	if (base && base.match(/(.*)\/([^\/]+)/)) {
-		base = RegExp.$1 + "/";
-	}
-	if (typeof _editor_url != "undefined" && !/^\//.test(_editor_url) && !/http:\/\//.test(_editor_url)) {
-		// _editor_url doesn't start with '/' which means it's relative
-		// FIXME: there's a problem here, it could be http:// which
-		// doesn't start with slash but it's not relative either.
-		base += _editor_url;
-	} else
-		base = _editor_url;
-	if (!/\/$/.test(base)) {
-		// base does not end in slash, add it now
-		base += '/';
-	}
-	this.baseURL = base;
-
-	doc.open();
-	var html = "<html><head><title>" + title + "</title>\n";
-	// html += "<base href='" + base + "htmlarea.js' />\n";
-	html += "<style type='text/css'>@import url(" + base + "htmlarea.css);</style></head>\n";
-	html += "<body class='dialog popupwin' id='--HA-body'></body></html>";
-	doc.write(html);
-	doc.close();
-
-	// sometimes I Hate Mozilla... ;-(
-	function init2() {
-		var body = doc.body;
-		if (!body) {
-			setTimeout(init2, 25);
-			return false;
-		}
-		dlg.title = title;
-		doc.documentElement.style.padding = "0px";
-		doc.documentElement.style.margin = "0px";
-		var content = doc.createElement("div");
-		content.className = "content";
-		self.content = content;
-		body.appendChild(content);
-		self.element = body;
-		initFunction(self);
-		dlg.focus();
-	};
-	init2();
-};
-
-PopupWin.prototype.callHandler = function() {
-	var tags = ["input", "textarea", "select"];
-	var params = new Object();
-	for (var ti = tags.length; --ti >= 0;) {
-		var tag = tags[ti];
-		var els = this.content.getElementsByTagName(tag);
-		for (var j = 0; j < els.length; ++j) {
-			var el = els[j];
-			var val = el.value;
-			if (el.tagName.toLowerCase() == "input") {
-				if (el.type == "checkbox") {
-					val = el.checked;
-				}
-			}
-			params[el.name] = val;
-		}
-	}
-	this.handler(this, params);
-	return false;
-};
-
-PopupWin.prototype.close = function() {
-	this.window.close();
-};
-
-PopupWin.prototype.addButtons = function() {
-	var self = this;
-	var div = this.doc.createElement("div");
-	this.content.appendChild(div);
-	div.className = "buttons";
-	for (var i = 0; i < arguments.length; ++i) {
-		var btn = arguments[i];
-		var button = this.doc.createElement("button");
-		div.appendChild(button);
-		button.innerHTML = HTMLArea.I18N.buttons[btn];
-		switch (btn) {
-		    case "ok":
-			button.onclick = function() {
-				self.callHandler();
-				self.close();
-				return false;
-			};
-			break;
-		    case "cancel":
-			button.onclick = function() {
-				self.close();
-				return false;
-			};
-			break;
-		}
-	}
-};
-
-PopupWin.prototype.showAtElement = function() {
-	var self = this;
-	// Mozilla needs some time to realize what's goin' on..
-	setTimeout(function() {
-		var w = self.content.offsetWidth + 4;
-		var h = self.content.offsetHeight + 4;
-		// size to content -- that's fuckin' buggy in all fuckin' browsers!!!
-		// so that we set a larger size for the dialog window and then center
-		// the element inside... phuck!
-
-		// center...
-		var el = self.content;
-		var s = el.style;
-		// s.width = el.offsetWidth + "px";
-		// s.height = el.offsetHeight + "px";
-		s.position = "absolute";
-		s.left = (w - el.offsetWidth) / 2 + "px";
-		s.top = (h - el.offsetHeight) / 2 + "px";
-		if (HTMLArea.is_gecko) {
-			self.window.innerWidth = w;
-			self.window.innerHeight = h;
-		} else {
-			self.window.resizeTo(w + 8, h + 35);
-		}
-	}, 25);
-};
diff -ruN 6171/e107_handlers/htmlarea/reference.html 75/e107_handlers/htmlarea/reference.html
--- 6171/e107_handlers/htmlarea/reference.html	2004-03-16 02:22:52.000000000 -0600
+++ 75/e107_handlers/htmlarea/reference.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,523 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
-<html> <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<title>HTMLArea-3.0 Reference</title>
-
-<style type="text/css">
-  @import url(htmlarea.css);
-  body { font: 14px verdana,sans-serif; background: #fff; color: #000; }
-  h1, h2 { font-family:tahoma,sans-serif; }
-  h1 { border-bottom: 2px solid #000; }
-  h2 { border-bottom: 1px solid #aaa; }
-  h3, h4 { margin-bottom: 0px; font-family: Georgia,serif; font-style: italic; }
-  h4 { font-size: 90%; margin-left: 1em; }
-  acronym { border-bottom: 1px dotted #063; color: #063; }
-  p { margin-left: 2em; margin-top: 0.3em; }
-  li p { margin-left: 0px; }
-  .abstract { padding: 5px; margin: 0px 10em; font-size: 90%; border: 1px dashed #aaa; background: #eee;}
-  li { margin-left: 2em; }
-  em { color: #042; }
-  a { color: #00f; }
-  a:hover { color: #f00; }
-  a:active { color: #f80; }
-  span.browser { font-weight: bold; color: #864; }
-  .fixme { font-size: 20px; font-weight: bold; color: red; background: #fab;
-padding: 5px; text-align: center; }
-  .code {
-   background: #e4efff; padding: 5px; border: 1px dashed #abc; margin-left: 2em; margin-right: 2em;
-   font-family: fixed,"lucidux mono","andale mono","courier new",monospace;
-  }
-  .note, .warning { font-weight: bold; color: #0a0; font-variant: small-caps; }
-  .warning { color: #a00; }
-
-.string {
-  color: #06c;
-} /* font-lock-string-face */
-.comment {
-  color: #840;
-} /* font-lock-comment-face */
-.variable-name {
-  color: #000;
-} /* font-lock-variable-name-face */
-.type {
-  color: #008;
-  font-weight: bold;
-} /* font-lock-type-face */
-.reference {
-  color: #048;
-} /* font-lock-reference-face */
-.preprocessor {
-  color: #808;
-} /* font-lock-preprocessor-face */
-.keyword {
-  color: #00f;
-  font-weight: bold;
-} /* font-lock-keyword-face */
-.function-name {
-  color: #044;
-} /* font-lock-function-name-face */
-.html-tag {
-  font-weight: bold;
-} /* html-tag-face */
-.html-helper-italic {
-  font-style: italic;
-} /* html-helper-italic-face */
-.html-helper-bold {
-  font-weight: bold;
-} /* html-helper-bold-face */
-
-</style>
-
-<script type="text/javascript">
-  _editor_url = './';
-  _editor_lang = 'en';
-</script>
-<script type="text/javascript" src="htmlarea.js"></script>
-<script type="text/javascript" src="dialog.js"></script>
-<script tyle="text/javascript" src="lang/en.js"></script>
-
-</head>
-
-<body onload="HTMLArea.replace('TA')">
-
-
-<h1>HTMLArea-3.0 Documentation</h1>
-
-<div class="abstract" style="color: red; font-weight: bold">
-
-      This documentation contains valid information, but is outdated in the
-      terms that it does not covers all the features of HTMLArea.  A new
-      documentation project will be started, based on LaTeX.
-
-</div>
-
-
-<h2>Introduction</h2>
-
-<h3>What is HTMLArea?</h3>
-
-<p>HTMLArea is a free <acronym title="What You See Is What You Get"
->WYSIWYG</acronym> editor replacement for <code>&lt;textarea&gt;</code>
-fields.  By adding a few simple lines of JavaScript code to your web page
-you can replace a regular textarea with a rich text editor that lets your
-users do the following:</p>
-
-<ul>
-  <li>Format text to be bold, italicized, or underlined.</li>
-  <li>Change the face, size, style and color.</li>
-  <li>Left, center, or right-justify paragraphs.</li>
-  <li>Make bulleted or numbered lists.</li>
-  <li>Indent or un-indent paragraphs.</li>
-  <li>Insert a horizontal line.</li>
-  <li>Insert hyperlinks and images.</li>
-  <li>View the raw HTML source of what they're editing.</li>
-  <li>and much more...</li>
-</ul>
-
-<p>Some of the interesting features of HTMLArea that set's it apart from
-other web based WYSIWYG editors are as follows:</p>
-
-<ul>
-  <li>It's lightweight, fast loading and can transform a regular textarea
-  into a rich-text editor with a single line of JavaScript.</li>
-  <li>Generates clean, valid HTML.</li>
-  <li>It degrades gracefully to older or non-supported browsers
-  (they get the original textarea field).</li>
-  <li>It's free and can be incorporated into any free or commercial
-  program.</li>
-  <li>It works with any server-side languages (ASP, PHP, Perl, Java,
-  etc).</li>
-  <li>It's written in JavaScript and can be easily viewed, modified or
-  extended.</li>
-  <li>It remembers entered content when a user navigates away and then hits
-  "back" in their browser.</li>
-  <li>Since it replaces existing textareas it doesn't require a lot of code
-  to add it to your pages (just one line).</li>
-  <li>Did we mention it was free? ;-)</li>
-</ul>
-
-<h3>Is it really free?  What's the catch?</h3>
-
-<p>Yes! It's really free. You can use it, modify it, distribute it with your
-software, or do just about anything you like with it.</p>
-
-<h3>What are the browser requirements?</h3>
-
-<p>HTMLArea requires <span class="browser"><a
-href="http://www.microsoft.com/ie">Internet Explorer</a> &gt;= 5.5</span>
-(Windows only), or <span class="browser"><a
-href="http://mozilla.org">Mozilla</a> &gt;= 1.3-Beta</span> on any platform.
-Any browser based on <a href="http://mozilla.org/newlayout">Gecko</a> will
-also work, provided that Gecko version is at least the one included in
-Mozilla-1.3-Beta (for example, <a
-href="http://galeon.sf.net">Galeon-1.2.8</a>).  However, it degrades
-gracefully to other browsers. They will get a regular textarea field
-instead of a WYSIWYG editor.</p>
-
-<h3>Can I see an example of what it looks like?</h3>
-
-<p>Just make sure you're using one of the browsers mentioned above and see
-below.</p>
-
-<form onsubmit="return false;">
-<textarea id="TA" style="width: 100%; height: 15em;">
-<p>Here is some sample text in textarea that's been transformed with <font
-color="#0000CC"><b>HTMLArea</b></font>.<br />
-You can make things <b>bold</b>, <i>italic</i>, <u>underline</u>.  You can change the
-<font size="3">size</font> and <b><font color="#0000CC">c</font><font color="#00CC00">o</font><font color="#00CCCC">l</font><font color="#CC0000">o</font><font color="#CC00CC">r</font><font color="#CCCC00">s</font><font color="#CCCCCC">!</font></b>
-And lots more...</p>
-
-<p align="center"><font size="4" color="#ff0000"><b><u>Try HTMLArea
-today!</u></b></font><br /></p>
-</textarea>
-</form>
-
-<h3>Where can I find out more info, download the latest version and talk to
-other HTMLArea users?</h3>
-
-<p>You can find out more about HTMLArea and download the latest version on
-the <a href="http://dynarch.com/htmlarea/">HTMLArea
-homepage</a> and you can talk to other HTMLArea users and post any comments
-or suggestions you have in the <a
-href="http://www.interactivetools.com/iforum/Open_Source_C3/htmlArea_v3.0_-_Alpha_Release_F14/"
->HTMLArea forum</a>.</p>
-
-<h2>Keyboard shortcuts</h2>
-
-<p>The editor provides the following key combinations:</p>
-
-<ul>
-  <li>CTRL-A -- select all</li>
-  <li>CTRL-B -- bold</li>
-  <li>CTRL-I -- italic</li>
-  <li>CTRL-U -- underline</li>
-  <li>CTRL-S -- strikethrough</li>
-  <li>CTRL-L -- justify left</li>
-  <li>CTRL-E -- justify center</li>
-  <li>CTRL-R -- justify right</li>
-  <li>CTRL-J -- justify full</li>
-  <li>CTRL-1 .. CTRL-6 -- headings (&lt;h1&gt; .. &lt;h6&gt;)</li>
-  <li>CTRL-0 (zero) -- clean content pasted from Word</li>
-</ul>
-
-<h2>Installation</h2>
-
-<h3>How do I add HTMLArea to my web page?</h3>
-
-<p>It's easy.  First you need to upload HTMLArea files to your website.
-Just follow these steps.</p>
-
-<ol>
-  <li>Download the latest version from the <a
-  href="http://www.interactivetools.com/products/htmlarea/">htmlArea
-  homepage</a>.</li>
-  <li>Unzip the files onto your local computer (making sure to maintain the
-  directory structure contained in the zip).</li>
-  <li>Create a new folder on your website called /htmlarea/ (make sure it's
-  NOT inside the cgi-bin).</li>
-  <li>Transfer all the HTMLArea files from your local computer into the
-  /htmlarea/ folder on your website.</li>
-  <li>Open the example page /htmlarea/examples/core.html with your browser to make
-  sure everything works.</li>
-</ol>
-
-<p>Once htmlArea is on your website all you need to do is add some
-JavaScript to any pages that you want to add WYSIWYG editors to.  Here's how
-to do that.</p>
-
-<ol>
-
-  <li>Define some global variables.  "_editor_url" has to be the absolute
-  URL where HTMLArea resides within your
-  website; as we discussed, this would be “/htmlarea/”.  "_editor_lang" must
-  be the language code in which you want HTMLArea to appear.  This defaults
-  to "en" (English); for a list of supported languages, please look into
-  the "lang" subdirectory in the distribution.
-  <pre class="code"
-  ><span class="function-name">&lt;</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">&quot;text/javascript&quot;</span><span class="function-name">&gt;</span>
-   _editor_url = <span class="string">&quot;/htmlarea/&quot;</span>;
-   _editor_lang = <span class="string">&quot;en&quot;</span>;
-<span class="function-name">&lt;</span><span class="html-tag">/script</span><span class="function-name">&gt;</span></pre>
-
-  <li>Include the "htmlarea.js" script:
-  <pre class="code"
-  ><span class="function-name">&lt;</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">&quot;text/javascript&quot;</span> <span class="variable-name">src=</span><span class="string">&quot;/htmlarea/htmlarea.js&quot;</span><span class="function-name">&gt;</span><span class="paren-face-match">&lt;</span><span class="html-tag">/script</span><span class="paren-face-match">&gt;</span></pre>
-  </li>
-
-  <li><p>If you want to change all your &lt;textarea&gt;-s into
-  HTMLArea-s then you can use the simplest way to create HTMLArea:</p>
-  <pre class="code"
-  ><span class="function-name">&lt;</span><span class="html-tag">script</span> <span class="variable-name">type=</span><span class="string">&quot;text/javascript&quot;</span> <span class="variable-name">defer=</span><span class="string">&quot;1&quot;</span><span class="function-name">&gt;</span>
-    HTMLArea.replaceAll<span class="function-name">()</span>;
-<span class="paren-face-match">&lt;</span><span class="html-tag">/script</span><span class="paren-face-match">&gt;</span></pre>
-  <p><span class="note">Note:</span> you can also add the
-  <code>HTMLArea.replaceAll()</code> code to the <code>onload</code>
-  event handler for the <code>body</code> element, if you find it more appropriate.</p>
-
-  <p>A different approach, if you have more than one textarea and only want
-  to change one of them, is to use <code>HTMLArea.replace("id")</code> --
-  pass the <code>id</code> of your textarea.  Do not use the
-  <code>name</code> attribute anymore, it's not a standard solution!</p>
-
-</ol>
-
-<p>This section applies to HTMLArea-3.0 release candidate 1 or later; prior
-to this version, one needed to include more files; however, now HTMLArea is
-able to include other files too (such as stylesheet, language definition
-file, etc.) so you only need to define the editor path and load
-"htmlarea.js".  Nice, eh? ;-)</p>
-
-<h3>I want to change the editor settings, how do I do that?</h3>
-
-<p>While it's true that all you need is one line of JavaScript to create an
-htmlArea WYSIWYG editor, you can also specify more config settings in the
-code to control how the editor works and looks.  Here's an example of some of
-the available settings:</p>
-
-<pre class="code"
-><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config(); <span class="comment">// create a new configuration object
-</span>                                    <span class="comment">// having all the default values
-</span>config.width = '<span class="string">90%</span>';
-config.height = '<span class="string">200px</span>';
-
-<span class="comment">// the following sets a style for the page body (black text on yellow page)
-// and makes all paragraphs be bold by default
-</span>config.pageStyle =
-  '<span class="string">body { background-color: yellow; color: black; font-family: verdana,sans-serif } </span>' +
-  '<span class="string">p { font-width: bold; } </span>';
-
-<span class="comment">// the following replaces the textarea with the given id with a new
-// HTMLArea object having the specified configuration
-</span>HTMLArea.replace('<span class="string">id</span>', config);</pre>
-
-<p><span class="warning">Important:</span> It's recommended that you add
-custom features and configuration to a separate file.  This will ensure you
-that when we release a new official version of HTMLArea you'll have less
-trouble upgrading it.</p>
-
-<h3>How do I customize the toolbar?</h3>
-
-<p>Using the configuration object introduced above allows you to completely
-control what the toolbar contains.  Following is an example of a one-line,
-customized toolbar, much simpler than the default one:</p>
-
-<pre class="code"
-><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
-config.toolbar = [
-  ['<span class="string">fontname</span>', '<span class="string">space</span>',
-   '<span class="string">fontsize</span>', '<span class="string">space</span>',
-   '<span class="string">formatblock</span>', '<span class="string">space</span>',
-   '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>']
-];
-HTMLArea.replace('<span class="string">id</span>', config);</pre>
-
-<p>The toolbar is an Array of Array objects.  Each array in the toolbar
-defines a new line.  The default toolbar looks like this:</p>
-
-<pre class="code"
->config.toolbar = [
-[ &quot;<span class="string">fontname</span>&quot;, &quot;<span class="string">space</span>&quot;,
-  &quot;<span class="string">fontsize</span>&quot;, &quot;<span class="string">space</span>&quot;,
-  &quot;<span class="string">formatblock</span>&quot;, &quot;<span class="string">space</span>&quot;,
-  &quot;<span class="string">bold</span>&quot;, &quot;<span class="string">italic</span>&quot;, &quot;<span class="string">underline</span>&quot;, &quot;<span class="string">separator</span>&quot;,
-  &quot;<span class="string">strikethrough</span>&quot;, &quot;<span class="string">subscript</span>&quot;, &quot;<span class="string">superscript</span>&quot;, &quot;<span class="string">separator</span>&quot;,
-  &quot;<span class="string">copy</span>&quot;, &quot;<span class="string">cut</span>&quot;, &quot;<span class="string">paste</span>&quot;, &quot;<span class="string">space</span>&quot;, &quot;<span class="string">undo</span>&quot;, &quot;<span class="string">redo</span>&quot; ],
-		
-[ &quot;<span class="string">justifyleft</span>&quot;, &quot;<span class="string">justifycenter</span>&quot;, &quot;<span class="string">justifyright</span>&quot;, &quot;<span class="string">justifyfull</span>&quot;, &quot;<span class="string">separator</span>&quot;,
-  &quot;<span class="string">insertorderedlist</span>&quot;, &quot;<span class="string">insertunorderedlist</span>&quot;, &quot;<span class="string">outdent</span>&quot;, &quot;<span class="string">indent</span>&quot;, &quot;<span class="string">separator</span>&quot;,
-  &quot;<span class="string">forecolor</span>&quot;, &quot;<span class="string">hilitecolor</span>&quot;, &quot;<span class="string">textindicator</span>&quot;, &quot;<span class="string">separator</span>&quot;,
-  &quot;<span class="string">inserthorizontalrule</span>&quot;, &quot;<span class="string">createlink</span>&quot;, &quot;<span class="string">insertimage</span>&quot;, &quot;<span class="string">inserttable</span>&quot;, &quot;<span class="string">htmlmode</span>&quot;, &quot;<span class="string">separator</span>&quot;,
-  &quot;<span class="string">popupeditor</span>&quot;, &quot;<span class="string">separator</span>&quot;, &quot;<span class="string">showhelp</span>&quot;, &quot;<span class="string">about</span>&quot; ]
-];</pre>
-
-<p>Except three strings, all others in the examples above need to be defined
-in the <code>config.btnList</code> object (detailed a bit later in this
-document).  The three exceptions are: 'space', 'separator' and 'linebreak'.
-These three have the following meaning, and need not be present in
-<code>btnList</code>:</p>
-
-<ul>
-  <li>'space' -- Inserts a space of 5 pixels (the width is configurable by external
-  <acronym title="Cascading Style Sheets">CSS</acronym>) at the current
-  position in the toolbar.</li>
-  <li>'separator' -- Inserts a small vertical separator, for visually grouping related
-  buttons.</li>
-  <li>'linebreak' -- Starts a new line in the toolbar.  Subsequent controls will be
-  inserted on the new line.</li>
-</ul>
-
-<p><span class="warning">Important:</span> It's recommended that you add
-custom features and configuration to a separate file.  This will ensure you
-that when we release a new official version of HTMLArea you'll have less
-trouble upgrading it.</p>
-
-<h3>How do I create custom buttons?</h3>
-
-<p>By design, the toolbar is easily extensible.  For adding a custom button
-one needs to follow two steps.</p>
-
-<h4 id="regbtn">1. Register the button in <code>config.btnList</code>.</h4>
-
-<p>For each button in the toolbar, HTMLArea needs to know the following
-information:</p>
-<ul>
-  <li>a name for it (we call it the ID of the button);</li>
-  <li>the path to an image to be displayed in the toolbar;</li>
-  <li>a tooltip for it;</li>
-  <li>whether the button is enabled or not in text mode;</li>
-  <li>what to do when the button is clicked;</li>
-</ul>
-<p>You need to provide all this information for registering a new button
-too.  The button ID can be any string identifier and it's used when
-defining the toolbar, as you saw above.  We recommend starting
-it with "my-" so that it won't clash with the standard ID-s (those from
-the default toolbar).</p>
-
-<p class="note">Register button example #1</p>
-
-<pre class="code"
-><span class="comment">// get a default configuration
-</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
-<span class="comment">// register the new button using Config.registerButton.
-// parameters:        button ID,   tooltip,          image,           textMode,
-</span>config.registerButton(&quot;<span class="string">my-hilite</span>&quot;, &quot;<span class="string">Highlight text</span>&quot;, &quot;<span class="string">my-hilite.gif</span>&quot;, <span class="keyword">false</span>,
-<span class="comment">// function that gets called when the button is clicked
-</span>  <span class="keyword">function</span>(editor, id) {
-    editor.surroundHTML('<span class="string">&lt;span class=&quot;hilite&quot;&gt;</span>', '<span class="string">&lt;/span&gt;</span>');
-  }
-);</pre>
-
-<p>An alternate way of calling registerButton is exemplified above.  Though
-the code might be a little bit larger, using this form makes your code more
-maintainable.  It doesn't even needs comments as it's pretty clear.</p>
-
-<p class="note">Register button example #2</p>
-
-<pre class="code"
-><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
-config.registerButton({
-  id        : &quot;<span class="string">my-hilite</span>&quot;,
-  tooltip   : &quot;<span class="string">Highlight text</span>&quot;,
-  image     : &quot;<span class="string">my-hilite.gif</span>&quot;,
-  textMode  : <span class="keyword">false</span>,
-  action    : <span class="keyword">function</span>(editor, id) {
-                editor.surroundHTML('<span class="string">&lt;span class=&quot;hilite&quot;&gt;</span>', '<span class="string">&lt;/span&gt;</span>');
-              }
-});</pre>
-
-<p>You might notice that the "action" function receives two parameters:
-<b>editor</b> and <b>id</b>.  In the examples above we only used the
-<b>editor</b> parameter.  But it could be helpful for you to understand
-both:</p>
-
-<ul>
-  <li><b>editor</b> is a reference to the HTMLArea object.  Since our entire
-  code now has an <acronym title="Object Oriented Programming">OOP</acronym>-like
-  design, you need to have a reference to
-  the editor object in order to do things with it.  In previous versions of
-  HTMLArea, in order to identify the object an ID was used -- the ID of the
-  HTML element.  In this version ID-s are no longer necessary.</li>
-
-  <li><b>id</b> is the button ID.  Wondering why is this useful?  Well, you
-  could use the same handler function (presuming that it's not an anonymous
-  function like in the examples above) for more buttons.  You can <a
-  href="#btnex">see an example</a> a bit later in this document.</li>
-</ul>
-
-<h4>2. Inserting it into the toolbar</h4>
-
-<p>At this step you need to specify where in the toolbar to insert the
-button, or just create the whole toolbar again as you saw in the previous
-section.  You use the button ID, as shown in the examples of customizing the
-toolbar in the previous section.</p>
-
-<p>For the sake of completion, following there are another examples.</p>
-
-<p class="note">Append your button to the default toolbar</p>
-
-<pre class="code"
->config.toolbar.push([ &quot;<span class="string">my-hilite</span>&quot; ]);</pre>
-
-<p class="note">Customized toolbar</p>
-
-<pre class="code"
->config.toolbar = [
-  ['<span class="string">fontname</span>', '<span class="string">space</span>',
-   '<span class="string">fontsize</span>', '<span class="string">space</span>',
-   '<span class="string">formatblock</span>', '<span class="string">space</span>',
-   '<span class="string">separator</span>', '<span class="string">my-hilite</span>', '<span class="string">separator</span>', '<span class="string">space</span>', <span class="comment">// here's your button
-</span>   '<span class="string">bold</span>', '<span class="string">italic</span>', '<span class="string">underline</span>', '<span class="string">space</span>']
-];</pre>
-
-<p><span class="note">Note:</span> in the example above our new button is
-between two vertical separators.  But this is by no means required.  You can
-put it wherever you like.  Once registered in the btnList (<a
-href="#regbtn">step 1</a>) your custom button behaves just like a default
-button.</p>
-
-<p><span class="warning">Important:</span> It's recommended that you add
-custom features and configuration to a separate file.  This will ensure you
-that when we release a new official version of HTMLArea you'll have less
-trouble upgrading it.</p>
-
-<h4 id="btnex">A complete example</h4>
-
-<p>Please note that it is by no means necessary to include the following
-code into the htmlarea.js file.  On the contrary, it might not work there.
-The configuration system is designed such that you can always customize the
-editor <em>from outside files</em>, thus keeping the htmlarea.js file
-intact.  This will make it easy for you to upgrade your HTMLArea when we
-release a new official version.  OK, I promise it's the last time I said
-this. ;)</p>
-
-<pre class="code"
-><span class="comment">// All our custom buttons will call this function when clicked.
-// We use the <b>buttonId</b> parameter to determine what button
-// triggered the call.
-</span><span class="keyword">function</span> <span class="function-name">clickHandler</span>(editor, buttonId) {
-  <span class="keyword">switch</span> (buttonId) {
-    <span class="keyword">case</span> &quot;<span class="string">my-toc</span>&quot;:
-      editor.insertHTML(&quot;<span class="string">&lt;h1&gt;Table Of Contents&lt;/h1&gt;</span>&quot;);
-      <span class="keyword">break</span>;
-    <span class="keyword">case</span> &quot;<span class="string">my-date</span>&quot;:
-      editor.insertHTML((<span class="keyword">new</span> Date()).toString());
-      <span class="keyword">break</span>;
-    <span class="keyword">case</span> &quot;<span class="string">my-bold</span>&quot;:
-      editor.execCommand(&quot;<span class="string">bold</span>&quot;);
-      editor.execCommand(&quot;<span class="string">italic</span>&quot;);
-      <span class="keyword">break</span>;
-    <span class="keyword">case</span> &quot;<span class="string">my-hilite</span>&quot;:
-      editor.surroundHTML(&quot;<span class="string">&lt;span class=\&quot;hilite\&quot;&gt;</span>&quot;, &quot;<span class="string">&lt;/span&gt;</span>&quot;);
-      <span class="keyword">break</span>;
-  }
-};
-
-<span class="comment">// Create a new configuration object
-</span><span class="keyword">var</span> <span class="variable-name">config</span> = <span class="keyword">new</span> HTMLArea.Config();
-
-<span class="comment">// Register our custom buttons
-</span>config.registerButton(&quot;<span class="string">my-toc</span>&quot;,  &quot;<span class="string">Insert TOC</span>&quot;, &quot;<span class="string">my-toc.gif</span>&quot;, <span class="keyword">false</span>, clickHandler);
-config.registerButton(&quot;<span class="string">my-date</span>&quot;, &quot;<span class="string">Insert date/time</span>&quot;, &quot;<span class="string">my-date.gif</span>&quot;, <span class="keyword">false</span>, clickHandler);
-config.registerButton(&quot;<span class="string">my-bold</span>&quot;, &quot;<span class="string">Toggle bold/italic</span>&quot;, &quot;<span class="string">my-bold.gif</span>&quot;, <span class="keyword">false</span>, clickHandler);
-config.registerButton(&quot;<span class="string">my-hilite</span>&quot;, &quot;<span class="string">Hilite selection</span>&quot;, &quot;<span class="string">my-hilite.gif</span>&quot;, <span class="keyword">false</span>, clickHandler);
-
-<span class="comment">// Append the buttons to the default toolbar
-</span>config.toolbar.push([&quot;<span class="string">linebreak</span>&quot;, &quot;<span class="string">my-toc</span>&quot;, &quot;<span class="string">my-date</span>&quot;, &quot;<span class="string">my-bold</span>&quot;, &quot;<span class="string">my-hilite</span>&quot;]);
-
-<span class="comment">// Replace an existing textarea with an HTMLArea object having the above config.
-</span>HTMLArea.replace(&quot;<span class="string">textAreaID</span>&quot;, config);</pre>
-
-
-<hr />
-<address>&copy; <a href="http://interactivetools.com" title="Visit our website"
->InteractiveTools.com</a> 2002-2004.
-<br />
-© <a href="http://dynarch.com">dynarch.com</a> 2003-2004<br />
-HTMLArea v3.0 developed by <a
-href="http://dynarch.com/mishoo/">Mihai Bazon</a>.
-<br />
-Documentation written by Mihai Bazon.
-</address>
-<!-- hhmts start --> Last modified: Wed Jan 28 12:18:23 EET 2004 <!-- hhmts end -->
-<!-- doc-lang: English -->
-</body> </html>
diff -ruN 6171/e107_handlers/htmlarea/release-notes.html 75/e107_handlers/htmlarea/release-notes.html
--- 6171/e107_handlers/htmlarea/release-notes.html	2004-08-11 04:26:36.000000000 -0500
+++ 75/e107_handlers/htmlarea/release-notes.html	1969-12-31 18:00:00.000000000 -0600
@@ -1,209 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.2//EN">
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-    <title><% $basename %> release notes</title>
-    <style>
-      .fixme { color: red; }
-    </style>
-  </head>
-
-  <body>
-
-    <h1><% $basename %> release notes</h1>
-
-    <p>This release was compiled on <% $time %>.</p>
-
-    <h2>3.0-rc1</h2>
-
-    <p>Changes since 3.0-Beta:</p>
-
-    <ul>
-      <li>
-        <b>New plugins</b>
-        <ul>
-          <li>
-            ContextMenu plugin (provides a nice context menu with common
-            operations, including table ops, link ops, etc.)
-          </li>
-          <li>
-            CSS plugin (provides an easy way to insert/change CSS classes)
-          </li>
-          <li>
-            FullPage plugin (allows HTMLArea to edit a whole HTML file,
-            not only the content within &lt;body&gt;.)
-          </li>
-        </ul>
-      </li>
-      <li>
-        <b>Changes in the SpellChecker plugin</b>
-        <ul>
-          <li>
-            Many bugfixes: now it works ;-)  Fully Unicode-safe.
-          </li>
-          <li>
-            Speed and bandwidth optimization: reports the list of
-            suggestions only once for each mispelled word; this helps
-            in cases where you have, for instance, the word “HTMLArea”
-            in 10 places all over the document; the list of
-            suggestions for it--which is kind of huge--will only be
-            included <em>once</em>.
-          </li>
-          <li>
-            User interface improvements: the highlighted word will
-            remain in view; in cases where it's normally outside, the
-            window will be scrolled to it.
-          </li>
-          <li>
-            Added a "Revert" button for those that change their minds ;-)
-          </li>
-          <li>
-            Added a "Info" button which reports information about the
-            document, retrieved by the server-side spell checker:
-            total number of words, total number of mispelled words,
-            number of suggestions made, spell check time, etc.  More
-            can be easily added.  <span class="fixme">FIXME: this part
-            is not yet internationalized.</span>
-          </li>
-          <li>
-            The server-side spell checker now uses XML::DOM instead of
-            HTML::Parser, which means that it will be unable to parse
-            “tag-soup” HTML.  It needs valid code.  Usually HTMLArea
-            generates valid code, but on rare occasions it might fail
-            and the spell checker will report a gross error message.
-            This gonna have to be fixed, but instead of making the
-            spell checker accept invalid HTML I prefer to make
-            HTMLArea generate valid code, so changes are to be done in
-            other places ;-)
-          </li>
-        </ul>
-      </li>
-      <li>
-        <b>Changes in the core editor</b>
-        <ul>
-          <li>
-            Easier to setup: you only need to load
-            <tt>htmlarea.js</tt>; other scripts will be loaded
-            automatically.  <a href="reference.html">Documentation</a>
-            and <a href="examples/">examples</a> updated.
-          </li>
-          <li>
-            Better plugin support (they register information about
-            themselves with the editor; can register event handlers for
-            the editor, etc.)
-          </li>
-          <li>
-            New about box; check it out, it's cool ;-)
-          </li>
-          <li>
-            Word cleaner (can be enabled to automatically kill Word crap
-            on paste (see Config.killWordOnPaste); otherwise accessible by
-            pressing CTRL-0 in the editor; a toolbar button will come up
-            soon)
-          </li>
-          <li>
-            Image preview in "insert image" dialog.  Also allows
-            modification of current image, if selected.
-          </li>
-          <li>
-            New "insert link" dialog, allows target and title
-            specification, allows editing links.
-          </li>
-          <li>
-            Implemented support for text direction (left-to-right or
-            right-to-left).
-          </li>
-          <li>
-            Lots of bug fixes!  ... and more, I guess ;-) an
-            automatically generated <a href="ChangeLog">change log</a>
-            is now available.
-          </li>
-        </ul>
-      </li>
-    </ul>
-
-    <p>I don't have the power to go through the <a
-href="http://sourceforge.net/tracker/?atid=525656&group_id=69750&func=browse">bug
-system</a> at SourceForge
-    now.  Some of the bugs reported there may be fixed; I'll update
-    their status, some other time.  If you reported bugs there and now
-    find them to be fixed, please let me know.</p>
-
-    <h2>3.0-Beta</h2>
-
-    <p>Changes since 3.0-Alpha:</p>
-
-    <ul>
-
-      <li>Performance improvements.</li>
-
-      <li>Many bugs fixed.</li>
-
-      <li>Plugin infrastructure.</li>
-
-      <li>TableOperations plugin.</li>
-
-      <li>SpellChecker plugin.</li>
-
-      <li>Status bar.</li>
-
-      <li>API for registering custom buttons and drop-down boxes in the
-        toolbar.</li>
-
-      <li>Toolbar can contain text labels.</li>
-
-      <li>Cut, copy, paste, undo, redo buttons.</li>
-
-    </ul>
-<%doc>
-    <h2>Rationale for Beta</h2>
-
-    <p>Why was this released as "Beta"?  The code is quite stable and it
-    didn't deserve a "Beta" qualification.  However, there are some things
-    left to do for the real 3.0 version.  These things will not affect the
-    API to work with HTMLArea, in other words, you can install the Beta
-    right now and then install the final release without modifying your
-    code.  That's if you don't modify HTMLArea itself.  ;-)</p>
-
-    <h2>To-Do before 3.0 final</h2>
-
-    <ol>
-
-      <li>We should use a single popup interface.  Currently there are two:
-      dialog.js and popupwin.js; dialog.js emulates modal dialogs, which
-      sucks when you want to open "select-color" from another popup and not
-      from the editor itself.  Very buggy in IE.  We should probably use only
-      modeless dialogs (that is, popupwin.js).</li>
-
-      <li>Internationalization for the SpellChecker plugin.</li>
-
-      <li>Internationalization for the TableOperations plugin.</li>
-
-      <li>People who sent translations are invited to re-iterate through
-        their work and make it up-to-date with lang/en.js which is the main
-        lang file for HTMLArea-3.0.  Some things have changed but not all
-        translations are updated.</li>
-
-      <li><strong>Documentation</strong>.</li>
-
-    </ol>
-</%doc>
-    <hr />
-    <address><a href="http://dynarch.com/mishoo/">Mihai Bazon</a></address>
-<!-- Created: Sun Aug  3 16:55:08 EEST 2003 -->
-<!-- hhmts start --> Last modified: Wed Mar 31 19:18:26 EEST 2004 <!-- hhmts end -->
-<!-- doc-lang: English -->
-  </body>
-</html>
-
-<%ARGS>
-  $project => 'HTMLArea'
-  $version => '3.0'
-  $release => 'rc1'
-  $basename => 'HTMLArea-3.0-rc1'
-</%ARGS>
-
-<%INIT>;
-use POSIX qw(strftime);
-my $time = strftime '%b %e, %Y [%H:%M] GMT', gmtime;
-</%INIT>
diff -ruN 6171/e107_handlers/htmlarea/test.css 75/e107_handlers/htmlarea/test.css
--- 6171/e107_handlers/htmlarea/test.css	2004-03-15 16:35:56.000000000 -0600
+++ 75/e107_handlers/htmlarea/test.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,79 +0,0 @@
-
-body{
-	background-color: #CCCCFF;
-	font-family: Verdana, Arial, Helvetica, sans-serif;
-	font-size: x-small;
-	color: #333366;
-	text-decoration: none;
-		line-height: 150%;
-}
-
-.greenTab {
-	background-color: #99CC00;
-}
-
-.orangeTab {
-	background-color: #FFB039;
-}
-
-.blueTab {
-	background-color: #3399CC;
-}
-
-.centerBox {
-	background-color: #CCCCFF;
-	width: 700px;
-	border-left-width: 2px;
-	border-right-style: solid;
-	border-left-style: solid;
-	border-right-color: #666699;
-	border-left-color: #666699;
-	border-right-width: 2px;
-}
-
-
-.topNav {
-	width: 90%;
-	border-bottom-width: 1px;
-	border-bottom-style: solid;
-	border-bottom-color: #FFFFFF;
-	font-size: medium;
-	padding-top: 3px;
-	padding-bottom: 3px;
-}
-
-.boxContents {
-	font-size: xx-small;
-	padding-top: 5px;
-	line-height: 125%;
-	font-weight: normal;
-	text-decoration: none;
-}
-
-.quoteFloat {
-	width: 200px;
-	font-size: xx-small;
-	font-weight: bold;
-	line-height: 175%;
-	background-color: #FFFFCC;
-	padding: 10px;
-	margin: 10px;
-	border: 1px solid #9999CC;
-	float: right;
-}
-.quoteSource {
-	font-size: 10px;
-	font-weight: normal;
-	text-decoration: none;
-	clear: left;
-	text-align: right;
-	margin-top: 10px;
-}
-
-.mainHeading {
-	font-size: medium;
-	font-weight: bold;
-	color: #333366;
-	margin-top: 10px;
-	margin-bottom: 20px;
-}
diff -ruN 6171/e107_handlers/input_class.php 75/e107_handlers/input_class.php
--- 6171/e107_handlers/input_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/input_class.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,78 @@
+<?php
+
+/**
++-------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/input_class.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++-------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/**
+* User input cleaning class
+*
+* @package e107
+* @version $Revision: 1.10 $
+* @author $Author: sweetas $
+*/
+class einput {
+
+	// new, better function.. docs soon :)
+	function escape($string, $gpc_data = true) {
+		// Stripslashes if needed
+		if ($gpc_data == true && get_magic_quotes_gpc()) {
+			$string = stripslashes($string);
+		}
+		// Replace new lines (quick / dirty fix to issues caused by real_escape)
+		$string = str_replace(array("\r", "\n"), array("--#R--", "--#N--"), $string);
+		// Escape data
+		$string = mysql_real_escape_string($string);
+		// Put back new lines
+		$string = str_replace(array("--#R--", "--#N--"), array("\r", "\n"), $string);
+		return $string;
+	}
+
+	/**
+	 * Escape SQL data to help prevent injections
+	 *
+	 * @param string $string [dirty input data]
+	 * @return string [escaped data]
+	 */
+	function sql_escape_string($string = "") {
+		// Replace new lines (quick / dirty fix to issues caused by real_escape)
+		$string = str_replace(array("\r", "\n"), array("--#R--", "--#N--"), $string);
+		// Escape data
+		$string = mysql_real_escape_string($string);
+		// Put back new lines
+		$string = str_replace(array("--#R--", "--#N--"), array("\r", "\n"), $string);
+		return $string;
+	}
+
+	/**
+	 * Strip slashes from string, for use before escaping data for sql queries - takes into account magic_quotes_gpc setting, i.e. only stips if it's on - or the second arg is true
+	 *
+	 * @param string $string [input string]
+	 * @param bool $ignore_magic_quotes_gpc [overide magic_quotes_gpc setting, i.e. always strip slashes
+	 * @return string
+	 */
+	function strip_input($string = "", $ignore_magic_quotes_gpc = false) {
+		if(get_magic_quotes_gpc() == true || $ignore_magic_quotes_gpc == true) {
+			$string = stripslashes($string);
+		}
+		return $string;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/javascript/sitemap.php 75/e107_handlers/javascript/sitemap.php
--- 6171/e107_handlers/javascript/sitemap.php	2004-06-04 05:44:32.000000000 -0500
+++ 75/e107_handlers/javascript/sitemap.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,50 +0,0 @@
-<?php
-echo "
-var ejs_func_todo='view';\n
-function ejs_expandall(ejs_cl_name,ejs_func_todo,ejs_cl_name2){\n
-	tot_object = document.getElementsByTagName('p').length;\n
-	for(i=0;i<tot_object;i++){\n
-		sp = document.getElementsByTagName('span').item(i);\n
-		p = document.getElementsByTagName('p').item(i);\n
-		if(p.id!=''){\n
-			if(p.className==ejs_cl_name){\n
-				if(ejs_func_todo=='view'){\n
-					if(p!=0)p.style.display='block';\n
-				}else if(ejs_func_todo=='hide'){\n
-					if(p!=0)p.style.display='none';\n
-				}\n
-			}\n
-		}else if(sp){\n
-			if(sp.className==ejs_cl_name || (ejs_cl_name2!='undefined' && sp.className==ejs_cl_name2)){\n
-				if(ejs_func_todo=='view'){\n
-					if(sp!=0)sp.style.display='block';\n
-				}else if(ejs_func_todo=='hide'){\n
-					if(sp!=0)sp.style.display='none';\n
-				}\n
-			}\n
-		}\n
-	}\n
-	if(ejs_func_todo=='hide'){ejs_func_todo='view';}else{ejs_func_todo='hide';}\n
-	ejs_expandpics('icoexp',ejs_func_todo2,'".SM_ICO_URL."','".SM_ICO_URL2."');\n
-	return ejs_func_todo;\n
-}\n\n
-
-var ejs_func_todo2='hide';\n
-function ejs_expandpics(ejs_cl_name,ejs_func_todo2,src1,src2){\n
-	tot_object2 = document.getElementsByTagName('img').length;\n\n
-	for(i=0;i<tot_object2;i++){\n
-		im = document.getElementsByTagName('img').item(i);\n
-		if(im.className==ejs_cl_name){\n
-				if(ejs_func_todo2=='view'){\n
-					im.src=src1;\n
-				}else if(ejs_func_todo2=='hide'){\n
-					im.src=src2;\n
-				}\n
-		}\n
-	}\n
-	if(ejs_func_todo2=='hide'){ejs_func_todo2='view';}else{ejs_func_todo2='hide';}\n
-	return ejs_func_todo2;\n
-}\n
-";
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/level_handler.php 75/e107_handlers/level_handler.php
--- 6171/e107_handlers/level_handler.php	2004-05-11 10:06:12.000000000 -0500
+++ 75/e107_handlers/level_handler.php	2006-04-28 20:27:03.000000000 -0500
@@ -1,102 +1,119 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/np_class.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-function get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref){
-
-	if(!$user_id){ return FALSE; }
-
-	if($user_admin){
-		if($user_perms == "0"){
-			$data[0] = IMAGE_rank_main_admin_image."<br />";
-			return($data);
-		}else{
-			if(preg_match("/(^|\s)".preg_quote($user_name)."/", $forum_moderators) && getperms("A", $user_perms)){
-				$data[0] = "<div class='spacer'>".IMAGE_rank_moderator_image."</div>";
-				return($data);
-			}else{
-				$data[0] = "<div class='spacer'>".IMAGE_rank_admin_image."</div>";
-				return($data);
-			}
-		}
-	}else if(preg_match("/(^|\s)".preg_quote($user_name)."/", $forum_moderators) && getperms("A", $user_perms)){
-		$data[0] = IMAGE_rank_moderator_image."<br />";
-	}else{
-		$data[0] = "<span class='smalltext'>".LAN_195." #".$user_id."<br />";
-	}
-
-	$level_thresholds = ($pref['forum_thresholds'] ? explode(",", $pref['forum_thresholds']) : array(20, 100, 250, 410, 580, 760, 950, 1150, 1370, 1600));
-
-	if(!$pref['forum_images']){
-		if($pref['forum_levels']){
-			$level_images = explode(",", $pref['forum_levels']);
-			$rank_type = "text";
-		}else{
-			$level_images = array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png");
-			$rank_type = "image";
-		}
-	}else{
-		$level_images = explode(",", $pref['forum_images']);
-		if(!$level_images[0]){
-			if($pref['forum_levels']){
-				$level_images = explode(",", $pref['forum_levels']);
-				$rank_type = "text";
-			}else{
-				$level_images = array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png");
-				$rank_type = "image";
-			}
-		}else{
-			$rank_type = "image";
-		}
-	}
-
-	$daysregged = max(1, round((time() - $user_join)/86400))."days";
-	$level = ceil((($user_forums*5) + ($user_comments*5) + ($user_chats*2) + $user_visits)/4);
-	$ltmp = $level;
-
-	if($level <= $level_thresholds[0]){
-		$rank = 0; 
-	}else if($level >= ($level_thresholds[0]+1) && $level <= $level_thresholds[1]){
-		$rank = 1;
-	}else if($level >= ($level_thresholds[1]+1) && $level <= $level_thresholds[2]){
-		$rank = 2;
-	}else if($level >= ($level_thresholds[2]+1) && $level <= $level_thresholds[3]){
-		$rank = 3;
-	}else if($level >= ($level_thresholds[3]+1) && $level <= $level_thresholds[4]){
-		$rank = 4;
-	}else if($level >= ($level_thresholds[4]+1) && $level <= $level_thresholds[5]){
-		$rank = 5;
-	}else if($level >= ($level_thresholds[5]+1) && $level <= $level_thresholds[6]){
-		$rank = 6;
-	}else if($level >= ($level_thresholds[6]+1) && $level <= $level_thresholds[7]){
-		$rank = 7;
-	}else if($level >= ($level_thresholds[7]+1) && $level <= $level_thresholds[8]){
-		$rank = 8;
-	}else if($level >= ($level_thresholds[8]+1) && $level <= $level_thresholds[9]){
-		$rank = 9;
-	}else if($level >= ($level_thresholds[9]+1)){
-		$rank = 10;
-	}
-	if($rank_type == "image"){
-		(file_exists(THEME."forum/".$level_images[$rank]) ? $pic_lev = THEME."forum/".$level_images[$rank] : $pic_lev = e_IMAGE."forum/".$level_images[$rank]);
-	}
-	$data[1] = "<div class='spacer'>
-	".($rank_type == "image" ? "<img src='".$pic_lev."' alt='' />" : "[ ".trim(chop($level_images[$rank]))." ]")."
-	</div>";
-	return ($data);
-}
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/level_handler.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/04/29 01:27:03 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+function get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref, $fmod = "")
+{
+	 
+	global $tp;
+
+	if (!$user_id) {
+		return FALSE;
+	}
+	if($fmod === TRUE)
+	{
+		$data['special'] = "<div class='spacer'>".IMAGE_rank_moderator_image."</div>";
+		$data[0] = "<div class='spacer'>".IMAGE_rank_moderator_image."</div>";
+	}
+	if ($user_admin)
+	{
+		if ($user_perms == "0")
+		{
+			$data['special'] = IMAGE_rank_main_admin_image."<br />";
+			$data[0] = IMAGE_rank_main_admin_image."<br />";
+		}
+		else
+		{
+			$data['special'] = IMAGE_rank_admin_image."<br />";
+			$data[0] = IMAGE_rank_admin_image."<br />";
+		}
+	}
+	$data[0] = "<span class='smalltext'>".LAN_195." #".$user_id."<br />";
+	$data['userid'] = "<span class='smalltext'>".LAN_195." #".$user_id."<br />";
+ 
+	$level_thresholds = ($pref['forum_thresholds'] ? explode(",", $pref['forum_thresholds']) : array(20, 100, 250, 410, 580, 760, 950, 1150, 1370, 1600));
+ 
+	$level_images = explode(",", $pref['forum_images']);
+	$level_names = explode(",", $pref['forum_levels']);
+	if(!$pref['forum_images'])
+	{
+		if(!$level_names[0])
+		{
+			$level_images = array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png");
+		}
+	}
+
+	$daysregged = max(1, round((time() - $user_join) / 86400))."days";
+	$level = ceil((($user_forums * 5) + ($user_comments * 5) + ($user_chats * 2) + $user_visits)/4);
+	$ltmp = $level;
+	 
+	if ($level <= $level_thresholds[0]) {
+		$rank = 0;
+	}
+	else if($level >= ($level_thresholds[0]+1) && $level <= $level_thresholds[1]) {
+		$rank = 1;
+	}
+	else if($level >= ($level_thresholds[1]+1) && $level <= $level_thresholds[2]) {
+		$rank = 2;
+	}
+	else if($level >= ($level_thresholds[2]+1) && $level <= $level_thresholds[3]) {
+		$rank = 3;
+	}
+	else if($level >= ($level_thresholds[3]+1) && $level <= $level_thresholds[4]) {
+		$rank = 4;
+	}
+	else if($level >= ($level_thresholds[4]+1) && $level <= $level_thresholds[5]) {
+		$rank = 5;
+	}
+	else if($level >= ($level_thresholds[5]+1) && $level <= $level_thresholds[6]) {
+		$rank = 6;
+	}
+	else if($level >= ($level_thresholds[6]+1) && $level <= $level_thresholds[7]) {
+		$rank = 7;
+	}
+	else if($level >= ($level_thresholds[7]+1) && $level <= $level_thresholds[8]) {
+		$rank = 8;
+	}
+	else if($level >= ($level_thresholds[8]+1)) {
+		$rank = 9;
+	}
+
+	$data['pic'] = (file_exists(THEME."forum/".$level_images[$rank]) ? THEME."forum/".$level_images[$rank] : e_IMAGE."rate/".IMODE."/".$level_images[$rank]);
+	$data['name'] = "[ ".$tp->toHTML($level_names[$rank], FALSE, 'defs')." ]";
+
+	if($level_names[$rank])
+	{
+		$data[1] = "<div class='spacer'>{$data['name']}</div>";
+		$img_title = "title='{$data['name']}'";
+		$data['pic'] = "<img src='".$data['pic']."' alt='' {$img_title} />";
+	}
+	else
+	{
+		$data['pic'] = "<img src='".$data['pic']."' alt='' />";
+		$data[1] = "<div class='spacer'>{$data['pic']}</div>";
+	}
+
+	if($data['special']) { $data[0] = $data['special'];}
+	return ($data);
+}
+	
+	
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/login.php 75/e107_handlers/login.php
--- 6171/e107_handlers/login.php	2004-05-05 08:03:52.000000000 -0500
+++ 75/e107_handlers/login.php	2006-02-24 12:36:35.000000000 -0600
@@ -1,87 +1,174 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/mysql_class.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-@include(e_LANGUAGEDIR.e_LANGUAGE."/lan_login.php");
-@include(e_LANGUAGEDIR."English/lan_login.php");
-class userlogin{
-	function userlogin($username, $userpass, $autologin){
-		/* Constructor
-		# Class called when user attempts to log in
-		#
-		# - parameters #1:		string $username, $_POSTED user name
-		# - parameters #2:		string $userpass, $_POSTED user password
-		# - return				boolean
-		# - scope					public
-		*/
-		global $pref;
-		$sql = new db;
-
-		if($pref['auth_method'] && $pref['auth_method'] != "e107"){
-			$auth_file=e_PLUGIN."alt_auth/".$pref['auth_method']."_auth.php";
-			if(file_exists($auth_file)){
-				require_once(e_PLUGIN."alt_auth/alt_auth_login_class.php");
-				$result = new alt_login($pref['auth_method'],$username, $userpass);
-			}
-		}
-
-		if($pref['logcode'] && extension_loaded("gd")){
-			require_once(e_HANDLER."secure_img_handler.php");
-			$sec_img = new secure_image;
-			if(!$sec_img -> verify_code($_POST['rand_num'],$_POST['code_verify'])){
-				define("LOGINMESSAGE", LAN_303."<br /><br />");
-				return FALSE;
-			}
-		}
-		if($username != "" && $userpass != ""){
-			$username = ereg_replace("\sOR\s|\=|\#", "", $username);
-			$userpass = md5($userpass);
-			if(!$sql -> db_Select("user",  "*", "user_name='$username' ")){
-				define("LOGINMESSAGE", LAN_300."<br /><br />");
-				return FALSE;
-			}else if(!$sql -> db_Select("user", "*", "user_name='$username' AND user_password='$userpass'")){
-				define("LOGINMESSAGE", LAN_301."<br /><br />");
-				return FALSE;
-			}else if(!$sql -> db_Select("user", "*", "user_name='$username' AND user_password='$userpass' AND user_ban!=2 ")){
-				define("LOGINMESSAGE", LAN_302."<br /><br />");
-				return FALSE;
-			}else{
-				list($user_id) = $sql-> db_Fetch();
-
-				$cookieval = $user_id.".".md5($userpass);
-
-				if($pref['user_tracking'] == "session"){
-					$_SESSION[$pref['cookie_name']] = $cookieval;
-				}else{
-					if($autologin == 1){
-						cookie($pref['cookie_name'], $cookieval, ( time()+3600*24*30));
-					}else{
-						cookie($pref['cookie_name'], $cookieval, ( time()+3600*3));
-					}
-				}
-
-				$redir = (e_QUERY ? e_SELF."?".e_QUERY : e_SELF);
-				if(strstr($_SERVER['SERVER_SOFTWARE'], "Apache")){
-					header("Location: ".$redir);
-					exit;
-				}else{
-					echo "<script type='text/javascript'>document.location.href='$redir'</script>\n";
-				}
-			}
-		}else{
-			define("LOGINMESSAGE", LAN_27."<br /><br />");
-			return FALSE;
-		}
-	}
-}
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ?Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/login.php,v $
+|     $Revision: 1.36 $
+|     $Date: 2006/02/24 18:36:35 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if(is_readable(e_LANGUAGEDIR.e_LANGUAGE."/lan_login.php")){
+	@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_login.php");
+}else{
+	@include_once(e_LANGUAGEDIR."English/lan_login.php");
+}
+
+class userlogin {
+	function userlogin($username, $userpass, $autologin) {
+		/* Constructor
+		# Class called when user attempts to log in
+		#
+		# - parameters #1:                string $username, $_POSTED user name
+		# - parameters #2:                string $userpass, $_POSTED user password
+		# - return                                boolean
+		# - scope                                        public
+		*/
+		global $pref, $e_event, $sql, $e107, $tp;
+		$sql = new db;
+
+		$fip = $e107->getip();
+		if($sql -> db_Select("banlist", "*", "banlist_ip='{$fip}' ")) {
+			exit;
+		}
+
+		$autologin = intval($autologin);
+
+		if ($pref['auth_method'] && $pref['auth_method'] != "e107") {
+			$auth_file = e_PLUGIN."alt_auth/".$pref['auth_method']."_auth.php";
+			if (file_exists($auth_file)) {
+				require_once(e_PLUGIN."alt_auth/alt_auth_login_class.php");
+				$result = new alt_login($pref['auth_method'], $username, $userpass);
+			}
+		}
+
+		if ($pref['logcode'] && extension_loaded("gd")) {
+			require_once(e_HANDLER."secure_img_handler.php");
+			$sec_img = new secure_image;
+			if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify'])) {
+				define("LOGINMESSAGE", LAN_303."<br /><br />");
+				return FALSE;
+			}
+		}
+		if ($username != "" && $userpass != "") {
+			$username = preg_replace("/\sOR\s|\=|\#/", "", $username);
+			$ouserpass = $userpass;
+			$userpass = md5($ouserpass);
+
+			$username = substr($username, 0, 30);
+
+			// This is only required for upgrades and only for those not using utf-8 to begin with..
+			if(isset($pref['utf-compatmode']) && (CHARSET == "utf-8" || CHARSET == "UTF-8")){
+				$username = utf8_decode($username);
+				$userpass = md5(utf8_decode($ouserpass));
+			}
+
+			if (!$sql->db_Select("user", "*", "user_loginname = '".$tp -> toDB($username)."'")) {
+				define("LOGINMESSAGE", LAN_300."<br /><br />");
+				$sql -> db_Insert("generic", "0, 'failed_login', '".time()."', 0, '{$fip}', 0, '".LAN_LOGIN_14." ::: ".LAN_LOGIN_1.": ".$tp -> toDB($username)."'");
+				$this -> checkibr($fip);
+				return FALSE;
+			}
+			else if(!$sql->db_Select("user", "*", "user_loginname = '".$tp -> toDB($username)."' AND user_password = '{$userpass}'")) {
+				define("LOGINMESSAGE", LAN_300."<br /><br />");
+				return FALSE;
+			}
+			else if(!$sql->db_Select("user", "*", "user_loginname = '".$tp -> toDB($username)."' AND user_password = '{$userpass}' AND user_ban!=2 ")) {
+				define("LOGINMESSAGE", LAN_302."<br /><br />");
+                	$sql -> db_Insert("generic", "0, 'failed_login', '".time()."', 0, '{$fip}', 0, '".LAN_LOGIN_15." ::: ".LAN_LOGIN_1.": ".$tp -> toDB($username)."'");
+					$this -> checkibr($fip);
+				return FALSE;
+			} else {
+				$ret = $e_event->trigger("preuserlogin", $username);
+				if ($ret!='') {
+					define("LOGINMESSAGE", $ret."<br /><br />");
+					return FALSE;
+				} else {
+					$lode = $sql -> db_Fetch();
+					$user_id = $lode['user_id'];
+					$user_name = $lode['user_name'];
+					$user_xup = $lode['user_xup'];
+
+					/* restrict more than one person logging in using same us/pw */
+					if($pref['disallowMultiLogin']) {
+						if($sql -> db_Select("online", "online_ip", "online_user_id='".$user_id.".".$user_name."'")) {
+							define("LOGINMESSAGE", LAN_304."<br /><br />");
+							$sql -> db_Insert("generic", "0, 'failed_login', '".time()."', 0, '$fip', '$user_id', '".LAN_LOGIN_16." ::: ".LAN_LOGIN_1.": ".$tp -> toDB($username).", ".LAN_LOGIN_17.": ".md5($ouserpass)."' ");
+							$this -> checkibr($fip);
+							return FALSE;
+						}
+					}
+
+					$cookieval = $user_id.".".md5($userpass);
+					if($user_xup) {
+						$this->update_xup($user_id, $user_xup);
+					}
+
+					if ($pref['user_tracking'] == "session") {
+						$_SESSION[$pref['cookie_name']] = $cookieval;
+					} else {
+						if ($autologin == 1) {
+							cookie($pref['cookie_name'], $cookieval, (time() + 3600 * 24 * 30));
+						} else {
+							cookie($pref['cookie_name'], $cookieval);
+						}
+					}
+					$edata_li = array("user_id" => $user_id, "user_name" => $username);
+					$e_event->trigger("login", $edata_li);
+					$redir = (e_QUERY ? e_SELF."?".e_QUERY : e_SELF);
+					if (strstr($_SERVER['SERVER_SOFTWARE'], "Apache")) {
+						header("Location: ".$redir);
+						exit;
+					} else {
+						echo "<script type='text/javascript'>document.location.href='{$redir}'</script>\n";
+					}
+				}
+			}
+		} else {
+			define("LOGINMESSAGE", LAN_27."<br /><br />");
+			return FALSE;
+		}
+	}
+
+	function checkibr($fip) {
+		global $sql, $pref, $tp;
+		if($pref['autoban'] == 1 || $pref['autoban'] == 3){ // Flood + Login or Login Only.
+	   		$fails = $sql -> db_Count("generic", "(*)", "WHERE gen_ip='$fip' AND gen_type='failed_login' ");
+			if($fails > 10) {
+				$sql -> db_Insert("banlist", "'$fip', '1', '".LAN_LOGIN_18."' ");
+		   		$sql -> db_Insert("generic", "0, 'auto_banned', '".time()."', 0, '$fip', '$user_id', '".LAN_LOGIN_20.": ".$tp -> toDB($username).", ".LAN_LOGIN_17.": ".md5($ouserpass)."' ");
+			}
+		}
+	}
+
+	function update_xup($user_id, $user_xup = "") {
+		global $sql, $tp;
+		if($user_xup) {
+			require_once(e_HANDLER."xml_class.php");
+			$xml = new parseXml;
+			if($rawData = $xml -> getRemoteXmlFile($user_xup)) {
+				preg_match_all("#\<meta name=\"(.*?)\" content=\"(.*?)\" \/\>#si", $rawData, $match);
+				$count = 0;
+				foreach($match[1] as $value) {
+					$$value = $tp -> toDB($match[2][$count]);
+					$count++;
+				}
+				$sql -> db_Update("user", "user_login='{$FN}', user_homepage='{$URL}', user_icq='{$ICQ}', user_aim='{$AIM}', user_msn='{$MSN}', user_location='{$GEO}', user_birthday='{$BDAY}', user_signature='{$SIG}', user_sess='{$PHOTO}', user_image='{$AV}', user_timezone='{$TZ}' WHERE user_id='".intval($user_id)."'");
+			}
+		}
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/magpie_rss.php 75/e107_handlers/magpie_rss.php
--- 6171/e107_handlers/magpie_rss.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/magpie_rss.php	2006-02-07 06:58:26.000000000 -0600
@@ -0,0 +1,630 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+/**
+* Project:     MagpieRSS: a simple RSS integration tool
+* File:        rss_parse.inc  - parse an RSS or Atom feed
+*               return as a simple object.
+*
+* Handles RSS 0.9x, RSS 2.0, RSS 1.0, and Atom 0.3
+*
+* The lastest version of MagpieRSS can be obtained from:
+* http://magpierss.sourceforge.net
+*
+* For questions, help, comments, discussion, etc., please join the
+* Magpie mailing list:
+* magpierss-general@lists.sourceforge.net
+*
+* @author           Kellan Elliott-McCrea <kellan@protest.net>
+* @version          0.7a
+* @license          GPL
+*
+*/
+
+define('RSS', 'RSS');
+define('ATOM', 'Atom');
+
+/**
+* Hybrid parser, and object, takes RSS as a string and returns a simple object.
+*
+* see: rss_fetch.inc for a simpler interface with integrated caching support
+*
+*/
+class MagpieRSS {
+    var $parser;
+    
+    var $current_item   = array();  // item currently being parsed
+    var $items          = array();  // collection of parsed items
+    var $channel        = array();  // hash of channel fields
+    var $textinput      = array();
+    var $image          = array();
+    var $feed_type;
+    var $feed_version;
+    var $encoding       = '';       // output encoding of parsed rss
+    
+    var $_source_encoding = '';     // only set if we have to parse xml prolog
+    
+    var $ERROR = "";
+    var $WARNING = "";
+    
+    // define some constants
+    
+    var $_CONTENT_CONSTRUCTS = array('content', 'summary', 'info', 'title', 'tagline', 'copyright');
+    var $_KNOWN_ENCODINGS    = array('UTF-8', 'US-ASCII', 'ISO-8859-1');
+
+    // parser variables, useless if you're not a parser, treat as private
+    var $stack              = array(); // parser stack
+    var $inchannel          = false;
+    var $initem             = false;
+    var $incontent          = false; // if in Atom <content mode="xml"> field 
+    var $intextinput        = false;
+    var $inimage            = false;
+    var $current_field      = '';
+    var $current_namespace  = false;
+    
+
+    /**
+     *  Set up XML parser, parse source, and return populated RSS object..
+     *   
+     *  @param string $source           string containing the RSS to be parsed
+     *
+     *  NOTE:  Probably a good idea to leave the encoding options alone unless
+     *         you know what you're doing as PHP's character set support is
+     *         a little weird.
+     *
+     *  NOTE:  A lot of this is unnecessary but harmless with PHP5 
+     *
+     *
+     *  @param string $output_encoding  output the parsed RSS in this character 
+     *                                  set defaults to ISO-8859-1 as this is PHP's
+     *                                  default.
+     *
+     *                                  NOTE: might be changed to UTF-8 in future
+     *                                  versions.
+     *                               
+     *  @param string $input_encoding   the character set of the incoming RSS source. 
+     *                                  Leave blank and Magpie will try to figure it
+     *                                  out.
+     *                                  
+     *                                   
+     *  @param bool   $detect_encoding  if false Magpie won't attempt to detect
+     *                                  source encoding. (caveat emptor)
+     *
+     */
+    function MagpieRSS ($source, $output_encoding = CHARSET, 
+                        $input_encoding=null, $detect_encoding = true) 
+    {   
+        # if PHP xml isn't compiled in, die
+        #
+        if (!function_exists('xml_parser_create')) {
+            $this->error( "Failed to load PHP's XML Extension. " . 
+                          "http://www.php.net/manual/en/ref.xml.php",
+                           E_USER_ERROR );
+        }
+        
+        list($parser, $source) = $this->create_parser($source, 
+                $output_encoding, $input_encoding, $detect_encoding);
+        
+        
+        if (!is_resource($parser)) {
+            $this->error( "Failed to create an instance of PHP's XML parser. " .
+                          "http://www.php.net/manual/en/ref.xml.php",
+                          E_USER_ERROR );
+        }
+
+        
+        $this->parser = $parser;
+        
+        # pass in parser, and a reference to this object
+        # setup handlers
+        #
+        xml_set_object( $this->parser, $this );
+        xml_set_element_handler($this->parser, 
+                'feed_start_element', 'feed_end_element' );
+                        
+        xml_set_character_data_handler( $this->parser, 'feed_cdata' ); 
+    
+        $status = xml_parse( $this->parser, $source );
+        
+        if (! $status ) {
+            $errorcode = xml_get_error_code( $this->parser );
+            if ( $errorcode != XML_ERROR_NONE ) {
+                $xml_error = xml_error_string( $errorcode );
+                $error_line = xml_get_current_line_number($this->parser);
+                $error_col = xml_get_current_column_number($this->parser);
+                $errormsg = "{$xml_error} at line {$error_line}, column {$error_col}";
+
+                $this->error( $errormsg );
+            }
+        }
+        
+        xml_parser_free( $this->parser );
+
+        $this->normalize();
+    }
+    
+    function feed_start_element($p, $element, &$attrs) {
+        $el = $element = strtolower($element);
+        $attrs = array_change_key_case($attrs, CASE_LOWER);
+        
+        // check for a namespace, and split if found
+        $ns = false;
+        if ( strpos( $element, ':' ) ) {
+            list($ns, $el) = split( ':', $element, 2); 
+        }
+        if ( $ns and $ns != 'rdf' ) {
+            $this->current_namespace = $ns;
+        }
+            
+        # if feed type isn't set, then this is first element of feed
+        # identify feed from root element
+        #
+        if (!isset($this->feed_type) ) {
+            if ( $el == 'rdf' ) {
+                $this->feed_type = RSS;
+                $this->feed_version = '1.0';
+            }
+            elseif ( $el == 'rss' ) {
+                $this->feed_type = RSS;
+                $this->feed_version = $attrs['version'];
+            }
+            elseif ( $el == 'feed' ) {
+                $this->feed_type = ATOM;
+                $this->feed_version = $attrs['version'];
+                $this->inchannel = true;
+            }
+            return;
+        }
+    
+        if ( $el == 'channel' ) 
+        {
+            $this->inchannel = true;
+        }
+        elseif ($el == 'item' or $el == 'entry' ) 
+        {
+            $this->initem = true;
+            if ( isset($attrs['rdf:about']) ) {
+                $this->current_item['about'] = $attrs['rdf:about']; 
+            }
+        }
+        
+        // if we're in the default namespace of an RSS feed,
+        //  record textinput or image fields
+        elseif ( 
+            $this->feed_type == RSS and 
+            $this->current_namespace == '' and 
+            $el == 'textinput' ) 
+        {
+            $this->intextinput = true;
+        }
+        
+        elseif (
+            $this->feed_type == RSS and 
+            $this->current_namespace == '' and 
+            $el == 'image' ) 
+        {
+            $this->inimage = true;
+        }
+        
+        # handle atom content constructs
+        elseif ( $this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
+        {
+            // avoid clashing w/ RSS mod_content
+            if ($el == 'content' ) {
+                $el = 'atom_content';
+            }
+            
+            $this->incontent = $el;
+            
+            
+        }
+        
+        // if inside an Atom content construct (e.g. content or summary) field treat tags as text
+        elseif ($this->feed_type == ATOM and $this->incontent ) 
+        {
+            // if tags are inlined, then flatten
+            $attrs_str = join(' ', 
+                    array_map('map_attrs', 
+                    array_keys($attrs), 
+                    array_values($attrs) ) );
+            
+            $this->append_content( "<{$element} {$attrs_str}>"  );
+                    
+            array_unshift( $this->stack, $el );
+        }
+        
+        // Atom support many links per containging element.
+        // Magpie treats link elements of type rel='alternate'
+        // as being equivalent to RSS's simple link element.
+        //
+        elseif ($this->feed_type == ATOM and $el == 'link' ) 
+        {
+            if ( isset($attrs['rel']) and $attrs['rel'] == 'alternate' ) 
+            {
+                $link_el = 'link';
+            }
+            else {
+                $link_el = 'link_' . $attrs['rel'];
+            }
+            
+            $this->append($link_el, $attrs['href']);
+        }
+        // set stack[0] to current element
+        else {
+            array_unshift($this->stack, $el);
+        }
+    }
+    
+
+    
+    function feed_cdata ($p, $text) {
+        
+        if ($this->feed_type == ATOM and $this->incontent) 
+        {
+            $this->append_content( $text );
+        }
+        else {
+            $current_el = join('_', array_reverse($this->stack));
+            $this->append($current_el, $text);
+        }
+    }
+    
+    function feed_end_element ($p, $el) {
+        $el = strtolower($el);
+        
+        if ( $el == 'item' or $el == 'entry' ) 
+        {
+            $this->items[] = $this->current_item;
+            $this->current_item = array();
+            $this->initem = false;
+        }
+        elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' ) 
+        {
+            $this->intextinput = false;
+        }
+        elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'image' ) 
+        {
+            $this->inimage = false;
+        }
+        elseif ($this->feed_type == ATOM and in_array($el, $this->_CONTENT_CONSTRUCTS) )
+        {   
+            $this->incontent = false;
+        }
+        elseif ($el == 'channel' or $el == 'feed' ) 
+        {
+            $this->inchannel = false;
+        }
+        elseif ($this->feed_type == ATOM and $this->incontent  ) {
+            // balance tags properly
+            // note:  i don't think this is actually neccessary
+            if ( $this->stack[0] == $el ) 
+            {
+                $this->append_content("</{$el}>");
+            }
+            else {
+                $this->append_content("<{$el} />");
+            }
+
+            array_shift( $this->stack );
+        }
+        else {
+            array_shift( $this->stack );
+        }
+        
+        $this->current_namespace = false;
+    }
+    
+    function concat (&$str1, $str2 = "") {
+        if (!isset($str1) ) {
+            $str1 = "";
+        }
+        $str1 .= $str2;
+    }
+    
+    
+    
+    function append_content($text) {
+        if ( $this->initem ) {
+            $this->concat( $this->current_item[ $this->incontent ], $text );
+        }
+        elseif ( $this->inchannel ) {
+            $this->concat( $this->channel[ $this->incontent ], $text );
+        }
+    }
+    
+    // smart append - field and namespace aware
+    function append($el, $text) {
+        if (!$el) {
+            return;
+        }
+        if ( $this->current_namespace ) 
+        {
+            if ( $this->initem ) {
+                $this->concat(
+                    $this->current_item[ $this->current_namespace ][ $el ], $text);
+            }
+            elseif ($this->inchannel) {
+                $this->concat(
+                    $this->channel[ $this->current_namespace][ $el ], $text );
+            }
+            elseif ($this->intextinput) {
+                $this->concat(
+                    $this->textinput[ $this->current_namespace][ $el ], $text );
+            }
+            elseif ($this->inimage) {
+                $this->concat(
+                    $this->image[ $this->current_namespace ][ $el ], $text );
+            }
+        }
+        else {
+            if ( $this->initem ) {
+                $this->concat(
+                    $this->current_item[ $el ], $text);
+            }
+            elseif ($this->intextinput) {
+                $this->concat(
+                    $this->textinput[ $el ], $text );
+            }
+            elseif ($this->inimage) {
+                $this->concat(
+                    $this->image[ $el ], $text );
+            }
+            elseif ($this->inchannel) {
+                $this->concat(
+                    $this->channel[ $el ], $text );
+            }
+            
+        }
+    }
+    
+    function normalize () {
+        // if atom populate rss fields
+        if ( $this->is_atom() ) {
+            $this->channel['description'] = $this->channel['tagline'];
+            for ( $i = 0; $i < count($this->items); $i++) {
+                $item = $this->items[$i];
+                if ( isset($item['summary']) )
+                    $item['description'] = $item['summary'];
+                if ( isset($item['atom_content']))
+                    $item['content']['encoded'] = $item['atom_content'];
+                
+                $atom_date = (isset($item['issued']) ) ? $item['issued'] : $item['modified'];
+                if ( $atom_date ) {
+                    $epoch = @parse_w3cdtf($item['modified']);
+                    if ($epoch and $epoch > 0) {
+                        $item['date_timestamp'] = $epoch;
+                    }
+                }
+                
+                $this->items[$i] = $item;
+            }       
+        }
+        elseif ( $this->is_rss() ) {
+            $this->channel['tagline'] = $this->channel['description'];
+            for ( $i = 0; $i < count($this->items); $i++) {
+                $item = $this->items[$i];
+                if ( isset($item['description']))
+                    $item['summary'] = $item['description'];
+                if ( isset($item['content']['encoded'] ) )
+                    $item['atom_content'] = $item['content']['encoded'];
+                
+                if ( $this->is_rss() == '1.0' and isset($item['dc']['date']) ) {
+                    $epoch = @parse_w3cdtf($item['dc']['date']);
+                    if ($epoch and $epoch > 0) {
+                        $item['date_timestamp'] = $epoch;
+                    }
+                }
+                elseif ( isset($item['pubdate']) ) {
+                    $epoch = @strtotime($item['pubdate']);
+                    if ($epoch > 0) {
+                        $item['date_timestamp'] = $epoch;
+                    }
+                }
+                
+                $this->items[$i] = $item;
+            }
+        }
+    }
+    
+    
+    function is_rss () {
+        if ( $this->feed_type == RSS ) {
+            return $this->feed_version; 
+        }
+        else {
+            return false;
+        }
+    }
+    
+    function is_atom() {
+        if ( $this->feed_type == ATOM ) {
+            return $this->feed_version;
+        }
+        else {
+            return false;
+        }
+    }
+
+    /**
+    * return XML parser, and possibly re-encoded source
+    *
+    */
+    function create_parser($source, $out_enc, $in_enc, $detect) {
+        if ( substr(phpversion(), 0, 1) == 5) {
+            $parser = $this->php5_create_parser($in_enc, $detect);
+        }
+        else {
+            list($parser, $source) = $this->php4_create_parser($source, $in_enc, $detect);
+        }
+        if ($out_enc) {
+            $this->encoding = $out_enc;
+            xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $out_enc);
+        }
+        
+        return array($parser, $source);
+    }
+    
+    /**
+    * Instantiate an XML parser under PHP5
+    *
+    * PHP5 will do a fine job of detecting input encoding
+    * if passed an empty string as the encoding. 
+    *
+    * All hail libxml2!
+    *
+    */
+    function php5_create_parser($in_enc, $detect) {
+        // by default php5 does a fine job of detecting input encodings
+        if(!$detect && $in_enc) {
+            return xml_parser_create($in_enc);
+        }
+        else {
+            return xml_parser_create('');
+        }
+    }
+    
+    /**
+    * Instaniate an XML parser under PHP4
+    *
+    * Unfortunately PHP4's support for character encodings
+    * and especially XML and character encodings sucks.  As
+    * long as the documents you parse only contain characters
+    * from the ISO-8859-1 character set (a superset of ASCII,
+    * and a subset of UTF-8) you're fine.  However once you
+    * step out of that comfy little world things get mad, bad,
+    * and dangerous to know.
+    *
+    * The following code is based on SJM's work with FoF
+    * @see http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss
+    *
+    */
+    function php4_create_parser($source, $in_enc, $detect) {
+        if ( !$detect ) {
+            return array(xml_parser_create($in_enc), $source);
+        }
+        
+        if (!$in_enc) {
+            if (preg_match('/<?xml.*encoding=[\'"](.*?)[\'"].*?>/m', $source, $m)) {
+                $in_enc = strtoupper($m[1]);
+                $this->source_encoding = $in_enc;
+            }
+            else {
+                $in_enc = 'UTF-8';
+            }
+        }
+        
+        if ($this->known_encoding($in_enc)) {
+            return array(xml_parser_create($in_enc), $source);
+        }
+        
+        // the dectected encoding is not one of the simple encodings PHP knows
+        
+        // attempt to use the iconv extension to
+        // cast the XML to a known encoding
+        // @see http://php.net/iconv
+       
+        if (function_exists('iconv'))  {
+            $encoded_source = iconv($in_enc,'UTF-8', $source);
+            if ($encoded_source) {
+                return array(xml_parser_create('UTF-8'), $encoded_source);
+            }
+        }
+        
+        // iconv didn't work, try mb_convert_encoding
+        // @see http://php.net/mbstring
+        if(function_exists('mb_convert_encoding')) {
+            $encoded_source = mb_convert_encoding($source, 'UTF-8', $in_enc );
+            if ($encoded_source) {
+                return array(xml_parser_create('UTF-8'), $encoded_source);
+            }
+        }
+        
+        // else 
+        $this->error("Feed is in an unsupported character encoding. ({$in_enc}) " .
+                     "You may see strange artifacts, and mangled characters.",
+                     E_USER_NOTICE);
+            
+        return array(xml_parser_create(), $source);
+    }
+    
+    function known_encoding($enc) {
+        $enc = strtoupper($enc);
+        if ( in_array($enc, $this->_KNOWN_ENCODINGS) ) {
+            return $enc;
+        }
+        else {
+            return false;
+        }
+    }
+
+    function error ($errormsg, $lvl=E_USER_WARNING) {
+        // append PHP's error message if track_errors enabled
+        if ( $php_errormsg ) { 
+            $errormsg .= " ({$php_errormsg})";
+        }
+        if ( MAGPIE_DEBUG ) {
+            trigger_error( $errormsg, $lvl);        
+        }
+        else {
+            error_log( $errormsg, 0);
+        }
+        
+        $notices = E_USER_NOTICE|E_NOTICE;
+        if ( $lvl&$notices ) {
+            $this->WARNING = $errormsg;
+        } else {
+            $this->ERROR = $errormsg;
+        }
+    }
+    
+    
+} // end class RSS
+
+function map_attrs($k, $v) {
+    return "$k=\"$v\"";
+}
+
+function parse_w3cdtf ( $date_str ) {
+    
+    # regex to match wc3dtf
+    $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/";
+    
+    if ( preg_match( $pat, $date_str, $match ) ) {
+        list( $year, $month, $day, $hours, $minutes, $seconds) = 
+            array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]);
+        
+        # calc epoch for current date assuming GMT
+        $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year);
+        
+        $offset = 0;
+        if ( $match[10] == 'Z' ) {
+            # zulu time, aka GMT
+        }
+        else {
+            list( $tz_mod, $tz_hour, $tz_min ) =
+                array( $match[8], $match[9], $match[10]);
+            
+            # zero out the variables
+            if ( ! $tz_hour ) { $tz_hour = 0; }
+            if ( ! $tz_min ) { $tz_min = 0; }
+        
+            $offset_secs = (($tz_hour * 60) + $tz_min) * 60;
+            
+            # is timezone ahead of GMT?  then subtract offset
+            #
+            if ( $tz_mod == '+' ) {
+                $offset_secs = $offset_secs * -1;
+            }
+            
+            $offset = $offset_secs; 
+        }
+        $epoch = $epoch + $offset;
+        return $epoch;
+    }
+    else {
+        return -1;
+    }
+}
+
+?>
diff -ruN 6171/e107_handlers/mail.php 75/e107_handlers/mail.php
--- 6171/e107_handlers/mail.php	2004-07-28 18:27:48.000000000 -0500
+++ 75/e107_handlers/mail.php	2006-05-12 17:50:40.000000000 -0500
@@ -1,188 +1,166 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /classes/mail.php
-|        updated by Cameron.
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-/*
-Please note that mailed attachments have been found to be corrupted using php 4.3.3
-php 4.3.6 does NOT have this problem.
-*/
-// Comment out the line below if you have trouble with some people not receiving emails.
-// ini_set(sendmail_path, "/usr/sbin/sendmail -t -f ".$pref['siteadminemail']);
-
-
-function sendemail($send_to, $subject, $message,$to_name,$send_from,$from_name,$attachments,$Cc,$Bcc,$returnpath,$returnreceipt){
-        global $pref;
-        $lb = "\n";
-        // Clean up the HTML. ==
-
-        if(preg_match('/<(html|font|br|a|img)/i', $message)){
-        $Html = $message;
-        }else{
-        $Html = preg_replace("/\n/","<br />",$message);
-        $Html = eregi_replace('(((f|ht){1}t(p|ps)://)[-a-zA-Z0-9@:%_\+.~#?&//=]+)',    '<a href="\\1">\\1</a>', $Html);
-        $Html = eregi_replace('([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&//=]+)',    '\\1<a href="http://\\2">\\2</a>', $Html);
-        $Html = eregi_replace('([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})',    '<a href="mailto:\\1">\\1</a>', $Html);
-        }
-
-        $text = strip_tags(preg_replace("<br>","/\n/",$message));
-        $OB="----=_OuterBoundary_000". md5(uniqid(mt_rand(), 1));
-        $IB="----=_InnerBoundery_001" . md5(uniqid(mt_rand(), 1));
-
-        $send_from = ($send_from)?$send_from:$pref['siteadminemail'];
-        $from_name = ($from_name)?$from_name:$pref['siteadmin'];
-        $to_name = ($to_name)?$to_name:$send_to;
-    //    $send_to = $to_name." <".$send_to.">\n";
-
-        $headers = "Date: ".date("r")."\n";
-        $headers.= "MIME-Version: 1.0\n";
-        $headers.= "From: ".$from_name." <".$send_from.">\n";
-        $headers.= "Reply-To: ".$from_name." <".$send_from.">\n";
-        $headers.= ($returnreceipt !="")? "Return-Receipt: $returnreceipt\n":"Return-Receipt: ".$pref['siteadminemail']."\n";
-        $headers.= "X-Sender: ".$send_from."\n";
-        $headers.= "X-Mailer: PHP Mailer\n";
-        $headers.= "X-MimeOLE: Produced By e107 website system\n";
-        $headers.= "X-Priority: 3\n";
-        if ($Cc) {$headers .= "Cc: $Cc\n";}
-        if ($Bcc) {$headers .= "Bcc: $Bcc\n";}
-        $headers.="Content-Type: multipart/mixed;\n\tboundary=\"".$OB."\"\n";
-
-        // Insert Body with text and HTML.
-        $body ="This is a multi-part message in MIME format.\n";
-        $body.="\n--".$OB."\n";
-        $body.="Content-Type:multipart/alternative;\n\tboundary=\"".$IB."\"\n\n";
-
-        //plaintext section
-        $body.="\n--".$IB."\n";
-        $body.="Content-Type: text/plain;\n\tcharset=".CHARSET."\n";
-        $body.="Content-Transfer-Encoding: quoted-printable\n\n";
-        // plaintext goes here
-        $body.=$text."\n\n";
-
-        // html section
-        $body.="\n--".$IB."\n";
-        $body.="Content-Type: text/html;\n\tcharset=".CHARSET."\n";
-        $body.="Content-Transfer-Encoding: base64\n\n";
-        $body.= chunk_split(base64_encode($Html))."\n\n";
-        $body.="\n--".$IB."--\n";
-
-// attachments ================
-        if($attachments){
-        if(!is_array($attachments)){
-        $AttmFiles[] = $attachments;
-        }else{
-        $AttmFiles = $attachments;
-        }
-
-         foreach($AttmFiles as $AttmFile){
-           if(is_file($AttmFile)){
-                $patharray = explode ("/", $AttmFile);
-                $mime = is_callable("mime_content_type")? mime_content_type($AttmFile):"application/octetstream";
-                $FileName=$patharray[count($patharray)-1];
-                $body.= "\n--".$OB."\n";
-                $body.="Content-Type: $mime;\n\tname=\"".$FileName."\"\n";
-                $body.="Content-Transfer-Encoding: base64\n";
-                $body.="Content-length:\"".filesize($AttmFile)."\"\n";
-                $body.="Content-Disposition: attachment;\n\tfilename=\"".$FileName."\"\n\n";
-                $fd=fopen($AttmFile, "r");
-                $FileContent=fread($fd,filesize($AttmFile));
-                fclose($fd);
-                $FileContent=chunk_split(base64_encode($FileContent));
-                $body.=$FileContent; $body.= "\n";
-                }
-           }
-        }
-        $body.= "\n--".$OB."--\n";
-
-
-
-        if($pref['smtp_enable']){
-                require_once(e_HANDLER."smtp.php");
-                if(smtpmail($send_to, $subject, $body, $headers)){
-                        return TRUE;
-                }else{
-                        return FALSE;
-                }
-        }else{
-                $headers.= ($returnpath !="")? "Return-Path: <".$returnpath.">\n":"Return-Path: <".$pref['siteadminemail'].">\n";
-                if(@mail($send_to, $subject, $body, $headers)){
-                        return TRUE;
-                }else{
-                        return FALSE;
-                }
-        }
-
-}
-
-
-function validatemail($Email) {
-    global $HTTP_HOST;
-    $result = array(); ;
-
-    if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)) {
-        $result[0]=false;
-        $result[1]="$Email is not properly formatted";
-        return $result;
-    }
-
-    list ( $Username, $Domain ) = split ("@",$Email);
-
-    if (getmxrr($Domain, $MXHost)){
-        $ConnectAddress = $MXHost[0];
-    } else {
-        $ConnectAddress = $Domain;
-    }
-
-    $Connect = fsockopen ( $ConnectAddress, 25 );
-
-    if ($Connect){
-
-        if (ereg("^220", $Out = fgets($Connect, 1024))) {
-
-           fputs ($Connect, "HELO $HTTP_HOST\r\n");
-           $Out = fgets ( $Connect, 1024 );
-           fputs ($Connect, "MAIL FROM: <{$Email}>\r\n");
-           $From = fgets ( $Connect, 1024 );
-           fputs ($Connect, "RCPT TO: <{$Email}>\r\n");
-           $To = fgets ($Connect, 1024);
-           fputs ($Connect, "QUIT\r\n");
-           fclose($Connect);
-            if (!ereg ("^250", $From) ||
-            !ereg ( "^250", $To )) {
-               $result[0]=false;
-               $result[1]="Server rejected address";
-               $result[2] = $From;
-               return $result;
-            }
-            } else {
-            $result[0] = false;
-            $result[1] = "No response from server";
-            $result[2] = $From;
-            return $result;
-          }
-
-    }  else {
-
-        $result[0]=false;
-        $result[1]="Cannot find E-Mail server.";
-        $result[2] = $From;
-        return $result;
-    }
-  $result[0]=true;
-    $result[1]="$Email appears to be valid.";
-    $result[2] = $From;
-    return $result;
-} // end of function
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/mail.php,v $
+|     $Revision: 1.32 $
+|     $Date: 2006/05/12 22:50:40 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/*
+Please note that mailed attachments have been found to be corrupted using php 4.3.3
+php 4.3.6 does NOT have this problem.
+*/
+// Comment out the line below if you have trouble with some people not receiving emails.
+// ini_set(sendmail_path, "/usr/sbin/sendmail -t -f ".$pref['siteadminemail']);
+
+function sendemail($send_to, $subject, $message, $to_name, $send_from, $from_name, $attachments, $Cc, $Bcc, $returnpath, $returnreceipt,$inline ="") {
+	global $pref,$mailheader_e107id;
+
+	require_once(e_HANDLER."phpmailer/class.phpmailer.php");
+
+	$mail = new PHPMailer();
+
+    if($mailheader_e107id){
+		$mail->AddCustomHeader("X-e107-id: {$mailheader_e107id}");
+    }
+
+	if ($pref['mailer']== 'smtp') {
+		$mail->Mailer = "smtp";
+	 	$mail->SMTPKeepAlive = FALSE;
+		$mail->Host = $pref['smtp_server'];
+		if($pref['smtp_username'] && $pref['smtp_password']){
+			$mail->SMTPAuth = TRUE;
+			$mail->Username = $pref['smtp_username'];
+			$mail->Password = $pref['smtp_password'];
+			$mail->PluginDir = e_HANDLER."phpmailer/";
+		}
+
+	} elseif ($pref['mailer']== 'sendmail'){
+		$mail->Mailer = "sendmail";
+		$mail->Sendmail = ($pref['sendmail']) ? $pref['sendmail'] : "/usr/sbin/sendmail -t -i -r ".$pref['siteadminemail'];
+	} else {
+        $mail->Mailer = "mail";
+	}
+
+	$to_name = ($to_name) ? $to_name: $send_to;
+
+	$mail->CharSet = CHARSET;
+	$mail->From = ($send_from)? $send_from: $pref['siteadminemail'];
+	$mail->FromName = ($from_name)? $from_name:	$pref['siteadmin'];
+	$mail->Host = $pref['smtp_server'];
+	$mail->Subject = $subject;
+	$mail->SetLanguage("en",e_HANDLER."phpmailer/language/");
+
+	$lb = "\n";
+	// Clean up the HTML. ==
+
+	if (preg_match('/<(font|br|a|img|b)/i', $message)) {
+		$Html = $message; // Assume html if it begins with one of these tags
+	} else {
+		$Html = htmlspecialchars($message);
+		$Html = preg_replace('%(http|ftp|https)(://\S+)%', '<a href="\1\2">\1\2</a>', $Html);
+		$Html = preg_replace('/([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i', '\\1<a href="http://\\2">\\2</a>', $Html);
+		$Html = preg_replace('/([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})/i', '<a href="mailto:\\1">\\1</a>', $Html);
+		$Html = str_replace("\n", "<br>\n", $Html);
+	}
+	if (strpos($message,"</style>") !== FALSE){
+    	$text = strstr($message,"</style>");
+	}else{
+    	$text = $message;
+	}
+    $text = str_replace("<br />", "\n", $text);
+  	$text = strip_tags(str_replace("<br>", "\n", $text));
+
+	$mail->Body = $Html; //Main message is HTML
+	$mail->IsHTML(TRUE);
+ 	$mail->AltBody = $text; //Include regular plaintext as well
+	$mail->AddAddress($send_to, $to_name);
+
+		if ($attachments){
+			if (is_array($attachments))	{
+				foreach($attachments as $attach){
+                    if(is_readable($attach)){
+						$mail->AddAttachment($attach, basename($attach),"base64",mime_content_type($attach));
+                    }
+				}
+			}else{
+				if(is_readable($attachments)){
+					$mail->AddAttachment($attachments, basename($attachments),"base64",mime_content_type($attachments));
+                }
+			}
+		}
+
+		if($inline){
+			$tmp = explode(",",$inline);
+			foreach($tmp as $inline_img){
+				if(is_readable($inline_img) && !is_dir($inline_img)){
+					$mail->AddEmbeddedImage($inline_img, md5($inline_img), basename($inline_img),"base64",mime_content_type($inline_img));
+				}
+			}
+		}
+
+
+	if($Cc){
+        if($mail->Mailer == "mail"){
+			$mail->AddCustomHeader("Cc: {$Cc}");
+		}else{
+        	$tmp = explode(",",$Cc);
+			foreach($tmp as $addc){
+		  		$mail->AddCC("Cc", $addc);
+        	}
+		}
+	}
+
+	if($Bcc){
+		if($mail->Mailer == "mail"){
+			$mail->AddCustomHeader("Bcc: {$Bcc}");
+		}else{
+        	$tmp = explode(",",$Bcc);
+	   		foreach($tmp as $addbc){
+				$mail->AddBCC($addbc);
+        	}
+		}
+	}
+
+	if($pref['mail_bounce_email'] !=''){
+		$mail->Sender = $pref['mail_bounce_email'];
+    }
+
+	if (!$mail->Send()) {
+		// echo "There has been a mail error sending to " . $row["email"] . "<br>";
+		return FALSE;
+		// Clear all addresses and attachments for next loop
+		$mail->ClearAddresses();
+		$mail->ClearAttachments();
+	} else {
+		// Clear all addresses and attachments for next loop
+		$mail->ClearAddresses();
+		$mail->ClearAttachments();
+		return TRUE;
+	}
+
+}
+
+/*  Deprecated.
+ Use mail_validation_class.php instead.
+function validatemail($Email) {
+
+}
+*/
+
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/mail_validation_class.php 75/e107_handlers/mail_validation_class.php
--- 6171/e107_handlers/mail_validation_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/mail_validation_class.php	2006-03-14 11:29:08.000000000 -0600
@@ -0,0 +1,232 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+/* Manuel Lemos's PHP E-mail validation class
+ * http://freshmeat.net/projects/emailaddressvalidationcomponent/
+ * email_validation.php
+ *
+ * @(#) $Header: /cvsroot/e107/e107_0.7/e107_handlers/mail_validation_class.php,v 1.1 2006/03/14 17:29:08 e107coders Exp $
+ *
+ */
+
+class email_validation_class
+{
+	var $email_regular_expression="^([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,6}\$";
+	var $timeout=0;
+	var $data_timeout=0;
+	var $localhost="";
+	var $localuser="";
+	var $debug=0;
+	var $html_debug=0;
+	var $exclude_address="";
+	var $getmxrr="GetMXRR";
+
+	var $next_token="";
+	var $preg;
+	var $last_code="";
+
+	Function Tokenize($string,$separator="")
+	{
+		if(!strcmp($separator,""))
+		{
+			$separator=$string;
+			$string=$this->next_token;
+		}
+		for($character=0;$character<strlen($separator);$character++)
+		{
+			if(GetType($position=strpos($string,$separator[$character]))=="integer")
+				$found=(IsSet($found) ? min($found,$position) : $position);
+		}
+		if(IsSet($found))
+		{
+			$this->next_token=substr($string,$found+1);
+			return(substr($string,0,$found));
+		}
+		else
+		{
+			$this->next_token="";
+			return($string);
+		}
+	}
+
+	Function OutputDebug($message)
+	{
+		$message.="\n";
+		if($this->html_debug)
+			$message=str_replace("\n","<br />\n",HtmlEntities($message));
+		echo $message;
+		flush();
+	}
+
+	Function GetLine($connection)
+	{
+		for($line="";;)
+		{
+			if(feof($connection))
+				return(0);
+			$line.=fgets($connection,100);
+			$length=strlen($line);
+			if($length>=2
+			&& substr($line,$length-2,2)=="\r\n")
+			{
+				$line=substr($line,0,$length-2);
+				if($this->debug)
+					$this->OutputDebug("S $line");
+				return($line);
+			}
+		}
+	}
+
+	Function PutLine($connection,$line)
+	{
+		if($this->debug)
+			$this->OutputDebug("C $line");
+		return(fputs($connection,"$line\r\n"));
+	}
+
+	Function ValidateEmailAddress($email)
+	{
+		if(IsSet($this->preg))
+		{
+			if(strlen($this->preg))
+				return(preg_match($this->preg,$email));
+		}
+		else
+		{
+			$this->preg=(function_exists("preg_match") ? "/".str_replace("/", "\\/", $this->email_regular_expression)."/" : "");
+			return($this->ValidateEmailAddress($email));
+		}
+		return(eregi($this->email_regular_expression,$email)!=0);
+	}
+
+	Function ValidateEmailHost($email,&$hosts)
+	{
+		if(!$this->ValidateEmailAddress($email))
+			return(0);
+		$user=$this->Tokenize($email,"@");
+		$domain=$this->Tokenize("");
+		$hosts=$weights=array();
+		$getmxrr=$this->getmxrr;
+		if(function_exists($getmxrr)
+		&& $getmxrr($domain,$hosts,$weights))
+		{
+			$mxhosts=array();
+			for($host=0;$host<count($hosts);$host++)
+				$mxhosts[$weights[$host]]=$hosts[$host];
+			KSort($mxhosts);
+			for(Reset($mxhosts),$host=0;$host<count($mxhosts);Next($mxhosts),$host++)
+				$hosts[$host]=$mxhosts[Key($mxhosts)];
+		}
+		else
+		{
+			if(strcmp($ip=@gethostbyname($domain),$domain)
+			&& (strlen($this->exclude_address)==0
+			|| strcmp(@gethostbyname($this->exclude_address),$ip)))
+				$hosts[]=$domain;
+		}
+		return(count($hosts)!=0);
+	}
+
+	Function VerifyResultLines($connection,$code)
+	{
+		while(($line=$this->GetLine($connection)))
+		{
+			$this->last_code=$this->Tokenize($line," -");
+			if(strcmp($this->last_code,$code))
+				return(0);
+			if(!strcmp(substr($line, strlen($this->last_code), 1)," "))
+				return(1);
+		}
+		return(-1);
+	}
+
+	Function ValidateEmailBox($email)
+	{
+		if(!$this->ValidateEmailHost($email,$hosts))
+			return(0);
+		if(!strcmp($localhost=$this->localhost,"")
+		&& !strcmp($localhost=getenv("SERVER_NAME"),"")
+		&& !strcmp($localhost=getenv("HOST"),""))
+		   $localhost="localhost";
+		if(!strcmp($localuser=$this->localuser,"")
+		&& !strcmp($localuser=getenv("USERNAME"),"")
+		&& !strcmp($localuser=getenv("USER"),""))
+		   $localuser="root";
+		for($host=0;$host<count($hosts);$host++)
+		{
+			$domain=$hosts[$host];
+			if(ereg('^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$',$domain))
+				$ip=$domain;
+			else
+			{
+				if($this->debug)
+					$this->OutputDebug("Resolving host name \"".$hosts[$host]."\"...");
+				if(!strcmp($ip=@gethostbyname($domain),$domain))
+				{
+					if($this->debug)
+						$this->OutputDebug("Could not resolve host name \"".$hosts[$host]."\".");
+					continue;
+				}
+			}
+			if(strlen($this->exclude_address)
+			&& !strcmp(@gethostbyname($this->exclude_address),$ip))
+			{
+				if($this->debug)
+					$this->OutputDebug("Host address of \"".$hosts[$host]."\" is the exclude address");
+				continue;
+			}
+			if($this->debug)
+				$this->OutputDebug("Connecting to host address \"".$ip."\"...");
+			if(($connection=($this->timeout ? @fsockopen($ip,25,$errno,$error,$this->timeout) : @fsockopen($ip,25))))
+			{
+				$timeout=($this->data_timeout ? $this->data_timeout : $this->timeout);
+				if($timeout
+				&& function_exists("socket_set_timeout"))
+					socket_set_timeout($connection,$timeout,0);
+				if($this->debug)
+					$this->OutputDebug("Connected.");
+				if($this->VerifyResultLines($connection,"220")>0
+				&& $this->PutLine($connection,"HELO $localhost")
+				&& $this->VerifyResultLines($connection,"250")>0
+				&& $this->PutLine($connection,"MAIL FROM: <$localuser@$localhost>")
+				&& $this->VerifyResultLines($connection,"250")>0
+				&& $this->PutLine($connection,"RCPT TO: <$email>")
+				&& ($result=$this->VerifyResultLines($connection,"250"))>=0)
+				{
+					if($result)
+					{
+						if($this->PutLine($connection,"DATA"))
+							$result=($this->VerifyResultLines($connection,"354")!=0);
+					}
+					else
+					{
+						if(strlen($this->last_code)
+						&& !strcmp($this->last_code[0],"4"))
+							$result=-1;
+					}
+					if($this->debug)
+						$this->OutputDebug("This host states that the address is ".($result ? ($result>0 ? "valid" : "undetermined") : "not valid").".");
+                    $this->PutLine($connection,"QUIT");
+					fclose($connection);
+					if($this->debug)
+						$this->OutputDebug("Disconnected.");
+					return($result);
+				}
+				if($this->debug)
+					$this->OutputDebug("Unable to validate the address with this host.");
+				fclose($connection);
+				if($this->debug)
+					$this->OutputDebug("Disconnected.");
+			}
+			else
+			{
+				if($this->debug)
+					$this->OutputDebug("Failed.");
+			}
+		}
+		return(-1);
+	}
+};
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/message_handler.php 75/e107_handlers/message_handler.php
--- 6171/e107_handlers/message_handler.php	2004-09-04 13:41:36.000000000 -0500
+++ 75/e107_handlers/message_handler.php	2006-01-14 16:01:34.000000000 -0600
@@ -1,62 +1,91 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/e107_handlers/message_handler.php,v $
-|     $Revision: 1.8 $
-|     $Date: 2004/09/04 18:41:36 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-
-$emessage[1] = "<b>[1]: Unable to read core settings from database - Core settings exist but cannot be unserialized. Attempting to restore core backup ...</b>";
-$emessage[2] = "<b>[2]: Unable to read core settings from database - non-existant core settings.</b>";
-$emessage[3] = "<b>[3]: Core settings saved - backup made active.</b>";
-$emessage[4] = "<b>[4]: No core backup found. Please run the <a href='".e_FILE."resetcore.php'>Reset_Core</a> utility to rebuild your core settings. <br />After rebuilding your core please save a backup from the admin/sql screen.</b>";
-$emessage[5] = "[5]: Field(s) have been left blank. Please resubmit the form and fill in the required fields.";
-$emessage[6] = "<b>[6]: Unable to form a valid connection to mySQL. Please check that your e107_config.php contains the correct information.</b>";
-$emessage[7] = "<b>[7]: mySQL is running but database ($mySQLdefaultdb) couldn't be connected to.<br />Please check it exists and that your e107_config.php contains the correct information.</b>";
-
-
-function message_handler($mode, $message, $line=0, $file=""){
-        global $emessage;
-        if(class_exists('e107table'))
-        {
-                $ns = new e107table;
-        }
-        switch($mode){
-                case "CRITICAL_ERROR":
-                        $message = is_numeric($message) ? $emessage[$message] : $message;
-                        echo "<div style='text-align:center; font: 11px verdana, tahoma, arial, helvetica, sans-serif;'><b>CRITICAL_ERROR: </b><br />Line $line $file<br /><br />Error reported as: ".$message."</div>";
-                break;
-                
-                case "MESSAGE":
-                        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-                break;
-
-                case "ADMIN_MESSAGE":
-                        $ns -> tablerender("Admin Message", "<div style='text-align:center'><b>".$message."</b></div>");
-                break;
-
-                case "ALERT":
-                        @require_once(e_HANDLER."textparse/basic.php");
-                        $etp = new e107_basicparse;
-                        echo "<script type='text/javascript'>alert(\"".$etp->unentity($emessage[$message])."\"); window.history.go(-1); </script>\n";
-                break;
-
-                case "P_ALERT":
-                        @require_once(e_HANDLER."textparse/basic.php");
-                        $etp = new e107_basicparse;
-                        echo "<script type='text/javascript'>alert(\"".$etp->unentity($message)."\"); </script>\n";
-                break;
-        }
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/message_handler.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2006/01/14 22:01:34 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+function show_emessage($mode, $message, $line = 0, $file = "") {
+	global $tp;
+	$emessage[1] = "<b>[1]: Unable to read core settings from database - Core settings exist but cannot be unserialized. Attempting to restore core backup ...</b>";
+	$emessage[2] = "<b>[2]: Unable to read core settings from database - non-existant core settings.</b>";
+	$emessage[3] = "<b>[3]: Core settings saved - backup made active.</b>";
+	$emessage[4] = "<b>[4]: No core backup found. Please run the <a href='".e_FILE."resetcore/resetcore.php'>Reset_Core</a> utility to rebuild your core settings. <br />After rebuilding your core please save a backup from the admin/sql screen.</b>";
+	$emessage[5] = "[5]: Field(s) have been left blank. Please resubmit the form and fill in the required fields.";
+	$emessage[6] = "<b>[6]: Unable to form a valid connection to mySQL. Please check that your e107_config.php contains the correct information.</b>";
+	$emessage[7] = "<b>[7]: mySQL is running but database ({$mySQLdefaultdb}) couldn't be connected to.<br />Please check it exists and that your e107_config.php contains the correct information.</b>";
+	$emessage[8] = "
+		<div style='text-align:center; font: 12px Verdana, Tahoma'><b>To complete the upgrade, copy the following text into your e107_config.php file: </b><br /><br />
+		".chr(36)."ADMIN_DIRECTORY = \"e107_admin/\";<br />
+		".chr(36)."FILES_DIRECTORY = \"e107_files/\";<br />
+		".chr(36)."IMAGES_DIRECTORY = \"e107_images/\"; <br />
+		".chr(36)."THEMES_DIRECTORY = \"e107_themes/\"; <br />
+		".chr(36)."PLUGINS_DIRECTORY = \"e107_plugins/\"; <br />
+		".chr(36)."HANDLERS_DIRECTORY = \"e107_handlers/\"; <br />
+		".chr(36)."LANGUAGES_DIRECTORY = \"e107_languages/\"; <br />
+		".chr(36)."HELP_DIRECTORY = \"e107_docs/help/\";  <br />
+		".chr(36)."DOWNLOADS_DIRECTORY =  \"e107_files/downloads/\";\n
+		</div>";
+
+	if (class_exists('e107table')) {
+		$ns = new e107table;
+	}
+	switch($mode) {
+		case "CRITICAL_ERROR":
+		$message = $emessage[$message] ? $emessage[$message] : $message;
+		echo "<div style='text-align:center; font: 11px verdana, tahoma, arial, helvetica, sans-serif;'><b>CRITICAL_ERROR: </b><br />Line $line $file<br /><br />Error reported as: ".$message."</div>";
+		break;
+
+		case "MESSAGE":
+		if(strstr(e_SELF, "forum_post.php"))
+		{
+			return;
+		}
+		$ns->tablerender("", "<div style='text-align:center'><b>{$message}</b></div>");
+		break;
+
+		case "ADMIN_MESSAGE":
+		$ns->tablerender("Admin Message", "<div style='text-align:center'><b>{$message}</b></div>");
+		break;
+
+		case "ALERT":
+		$message = $emessage[$message] ? $emessage[$message] : $message;
+		echo "<noscript>$message</noscript><script type='text/javascript'>alert(\"".$tp->toJS($message)."\"); window.history.go(-1); </script>\n"; exit;
+		break;
+
+		case "P_ALERT":
+		echo "<script type='text/javascript'>alert(\"".$tp->toJS($message)."\"); </script>\n";
+		break;
+
+		case "POPUP":
+
+		$mtext = "<html><head><title>Message</title><link rel=stylesheet href=" . THEME . "style.css></head><body style=padding-left:2px;padding-right:2px;padding:2px;padding-bottom:2px;margin:0px;align;center marginheight=0 marginleft=0 topmargin=0 leftmargin=0><table width=100% align=center style=width:100%;height:99%padding-bottom:2px class=bodytable height=99% ><tr><td width=100% ><center><b>--- Message ---</b><br /><br />".$message."<br /><br /><form><input class=button type=submit onclick=self.close() value = ok /></form></center></td></tr></table></body></html> ";
+
+		echo "
+		<script type='text/javascript'>
+		winl=(screen.width-200)/2;
+		wint = (screen.height-100)/2;
+		winProp = 'width=200,height=100,left='+winl+',top='+wint+',scrollbars=no';
+		window.open('javascript:document.write(\"".$mtext."\");', \"message\", winProp);
+		</script >";
+
+		break;
+
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/mysql_class.php 75/e107_handlers/mysql_class.php
--- 6171/e107_handlers/mysql_class.php	2004-06-20 22:01:44.000000000 -0500
+++ 75/e107_handlers/mysql_class.php	2006-04-26 01:02:13.000000000 -0500
@@ -1,329 +1,700 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/mysql_class.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-class db{
-
-	//	 global variables
-	var $mySQLserver;
-	var $mySQLuser;
-	var $mySQLpassword;
-	var $mySQLdefaultdb;
-	var $mySQLaccess;
-	var $mySQLresult;
-	var $mySQLrows;
-	var $mySQLerror;
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb){
-		/*
-		# Connect to mySQL server and select database
-		#
-		# - parameters #1:		string $mySQLserver, mySQL server
-		# - parameters #2:		string $mySQLuser, mySQL username
-		# - parameters #3:		string $mySQLpassword, mySQL password
-		# - parameters #4:		string mySQLdefaultdb, mySQL default database
-		# - return				error if encountered
-		# - scope					public
-		*/
-
-		$this->mySQLserver = $mySQLserver;
-		$this->mySQLuser = $mySQLuser;
-		$this->mySQLpassword = $mySQLpassword;
-		$this->mySQLdefaultdb = $mySQLdefaultdb;
-		$temp = $this->mySQLerror;
-		$this->mySQLerror = FALSE;
-		if(!$this->mySQL_access = @mysql_connect($this->mySQLserver, $this->mySQLuser, $this->mySQLpassword)){
-			return "e1";
-		}else{
-			if(!@mysql_select_db($this->mySQLdefaultdb)){
-				return "e2";
-			}else{
-				$this->dbError("dbConnect/SelectDB");
-			}
-		}
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_Select($table, $fields="*", $arg="", $mode="default", $debug=FALSE){
-		/*
-		# Select with args
-		#
-		# - parameter #1:	string $table, table name
-		# - parameter #2:	string $fields, table fields to be retrieved, default *
-		# - parameter #3:	string $arg, query arguaments, default null
-		# - parameter #4:	string $mode, arguament has WHERE or not, default=default (WHERE)
-		# - return				affected rows
-		# - scope					public
-		*/
-		global $dbq;
-		$dbq++;
-
-		if($arg != "" && $mode=="default"){
-			if($debug){ echo "SELECT ".$fields." FROM ".MPREFIX.$table." WHERE ".$arg."<br />"; }
-			if($this->mySQLresult = @mysql_query("SELECT ".$fields." FROM ".MPREFIX.$table." WHERE ".$arg)){
-				$this->dbError("dbQuery");
-				return $this->db_Rows();
-			}else{
-				$this->dbError("db_Select (SELECT $fields FROM ".MPREFIX."$table WHERE $arg)");
-				return FALSE;
-			}
-		}else if($arg != "" && $mode != "default"){
-			if($debug){ echo "@@SELECT ".$fields." FROM ".MPREFIX.$table." ".$arg."<br />"; }
-			if($this->mySQLresult = @mysql_query("SELECT ".$fields." FROM ".MPREFIX.$table." ".$arg)){
-				$this->dbError("dbQuery");
-				return $this->db_Rows();
-			}else{
-				$this->dbError("db_Select (SELECT $fields FROM ".MPREFIX."$table $arg)");
-				return FALSE;
-			}
-		}else{
-			if($debug){ echo "SELECT ".$fields." FROM ".MPREFIX.$table."<br />"; }
-			if($this->mySQLresult = @mysql_query("SELECT ".$fields." FROM ".MPREFIX.$table)){
-				$this->dbError("dbQuery");
-				return $this->db_Rows();
-			}else{
-				$this->dbError("db_Select (SELECT $fields FROM ".MPREFIX."$table)");
-				return FALSE;
-			}		
-		}
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_Insert($table, $arg, $debug=FALSE){
-		/*
-		# Insert with args
-		#
-		# - parameter #1:	string $table, table name
-		# - parameter #2:	string $arg, insert string
-		# - return				sql identifier, or error if (error reporting = on, error occured, boolean)
-		# - scope					public
-		*/
-
-		if($debug){
-			echo "INSERT INTO ".MPREFIX.$table." VALUES (".htmlentities($arg).")";
-		}
-
-//		if(!ANON && !USER && $table != "user"){ return FALSE; }
-
-		if($result = $this->mySQLresult = @mysql_query("INSERT INTO ".MPREFIX.$table." VALUES (".$arg.")" )){
-			$tmp = mysql_insert_id();
-
-			if(strstr(e_SELF, ADMINDIR) && $table != "online"){
-				mysql_query("INSERT INTO ".MPREFIX."tmp VALUES ('adminlog', '".time()."', '<br /><b>Insert</b> - <b>$table</b> table (field id <b>$tmp</b>)<br />by <b>".USERNAME."</b>') ");
-			}
-			return $tmp;
-		}else{
-			$this->dbError("db_Insert ($query)");
-			return FALSE;
-		}
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_Update($table, $arg, $debug=FALSE){
-		/*
-		# Update with args
-		#
-		# - parameter #1:	string $table, table name
-		# - parameter #2:	string $arg, update string
-		# - return				sql identifier, or error if (error reporting = on, error occured, boolean)
-		# - scope					public
-		*/
-		global $dbq;
-		$dbq++;
-		if($debug){ echo "UPDATE ".MPREFIX.$table." SET ".$arg."<br />"; }	
-		if($result = $this->mySQLresult = @mysql_query("UPDATE ".MPREFIX.$table." SET ".$arg)){
-			$result = mysql_affected_rows();
-			if(strstr(e_SELF, ADMINDIR) && $table != "online"){
-				if(!strstr($arg, "link_order")){
-					$str = addslashes(str_replace("WHERE", "", substr($arg, strpos($arg, "WHERE"))));
-					mysql_query("INSERT INTO ".MPREFIX."tmp VALUES ('adminlog', '".time()."', '<br /><b>Update</b> - <b>$table</b> table (string: <b>$str</b>)<br />by <b>".USERNAME."</b>') ");
-				}
-			}
-			return $result;
-		}else{
-			$this->dbError("db_Update ($query)");
-			return FALSE;
-		}
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_Fetch($mode = "strip"){
-		/*
-		# Retrieve table row
-		#
-		# - parameters		none
-		# - return				result array, or error if (error reporting = on, error occured, boolean)
-		# - scope					public
-		*/
-		if($row = @mysql_fetch_array($this->mySQLresult)){
-			if($mode == strip){
-				while (list($key,$val) = each($row)){
-					$row[$key] = stripslashes($val);
-				}
-			}
-			$this->dbError("db_Fetch");
-			return $row;
-		}else{
-			$this->dbError("db_Fetch");
-			return FALSE;
-		}
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_Count($table, $fields="(*)", $arg=""){
-		/*
-		# Retrieve result count
-		#
-		# - parameter #1:	string $table, table name
-		# - parameter #2:	string $fields, count fields, default (*)
-		# - parameter #3:	string $arg, count string, default null
-		# - return				result array, or error if (error reporting = on, error occured, boolean)
-		# - scope					public
-		*/
-//		echo "SELECT COUNT".$fields." FROM ".MPREFIX.$table." ".$arg;
-
-		global $dbq;
-		$dbq++;
-		if($fields == "generic"){
-			if($this->mySQLresult = @mysql_query($table)){
-				$rows = $this->mySQLrows = @mysql_fetch_array($this->mySQLresult);
-				return $rows[0];
-			}else{
-				$this->dbError("dbCount ($query)");
-			}
-		}
-
-		if($this->mySQLresult = @mysql_query("SELECT COUNT".$fields." FROM ".MPREFIX.$table." ".$arg)){
-			$rows = $this->mySQLrows = @mysql_fetch_array($this->mySQLresult);
-			return $rows[0];
-		}else{
-			$this->dbError("dbCount ($query)");
-		}
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_Close(){
-		/*
-		# Close mySQL server connection
-		#
-		# - parameters		none
-		# - return				null
-		# - scope					public
-		*/
-		mysql_close();
-		$this->dbError("dbClose");
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_Delete($table, $arg=""){
-		/*
-		# Delete with args
-		#
-		# - parameter #1:	string $table, table name
-		# - parameter #2:	string $arg, delete string
-		# - return				result array, or error if (error reporting = on, error occured, boolean)
-		# - scope					public
-		*/
-		if($table == "user"){
-	//		echo "DELETE FROM ".MPREFIX.$table." WHERE ".$arg."<br />";			// debug
-		}
-		if(!$arg){
-			if($result = $this->mySQLresult = @mysql_query("DELETE FROM ".MPREFIX.$table)){
-				if(strstr(e_SELF, ADMINDIR) && $table != "online" && $table != "tmp"){
-					$str = addslashes(str_replace("WHERE", "", substr($arg, strpos($arg, "WHERE"))));
-
-					if($table == "cache"){
-						$string = "<br /><b>Delete</b> - <b>$table</b> table (routine tidy-up)<br />by <b>e107</b>";
-					}else{
-						$string = "<br /><b>Delete</b> - <b>$table</b> table (all entries deleted)<br />by <b>".USERNAME."</b>";
-					}
-
-					mysql_query("INSERT INTO ".MPREFIX."tmp VALUES ('adminlog', '".time()."', '$string') ");
-				}
-				return $result;
-			}else{
-				$this->dbError("db_Delete ($arg)");
-				return FALSE;
-			}
-		}else{
-			if($result = $this->mySQLresult = @mysql_query("DELETE FROM ".MPREFIX.$table." WHERE ".$arg)){
-				$tmp = mysql_affected_rows();
-				if(strstr(e_SELF, ADMINDIR) && $table != "online" && $table != "tmp"){
-					$str = addslashes(str_replace("WHERE", "", substr($arg, strpos($arg, "WHERE"))));
-					mysql_query("INSERT INTO ".MPREFIX."tmp VALUES ('adminlog', '".time()."', '<b>Delete</b> - <b>$table</b> table (string: <b>$str</b>) by <b>".USERNAME."</b>') ");
-				}
-				return $tmp;
-			}else{
-				$this->dbError("db_Delete ($arg)");
-				return FALSE;
-			}
-		}
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_Rows(){
-		/*
-		# Return affected rows
-		#
-		# - parameters		none
-		# - return				affected rows, or error if (error reporting = on, error occured, boolean)
-		# - scope					public
-		*/
-		$rows = $this->mySQLrows = @mysql_num_rows($this->mySQLresult);
-		return $rows;
-		$this->dbError("db_Rows");
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function dbError($from){
-		/*
-		# Return affected rows
-		#
-		# - parameter #1		string $from, routine that called this function
-		# - return				error message on mySQL error
-		# - scope					private
-		*/
-		if($error_message = @mysql_error()){
-			if($this->mySQLerror == TRUE){
-				message_handler("ADMIN_MESSAGE", "<b>mySQL Error!</b> Function: $from. [".@mysql_errno()." - $error_message]",  __LINE__, __FILE__);
-				return $error_message;
-			}
-		}
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function db_SetErrorReporting($mode){
-		$this->mySQLerror = $mode;
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-	function db_Select_gen($arg){
-		global $dbq;
-		$dbq++;
-		//echo "\mysql_query($arg)";
-		if($this->mySQLresult = @mysql_query($arg)){
-			$this->dbError("db_Select_gen");
-			return $this->db_Rows();
-		}else{
-			$this->dbError("dbQuery ($query)");
-			return FALSE;
-		}
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-	function db_Fieldname($offset){
-
-		$result = @mysql_field_name($this->mySQLresult, $offset);
-		return $result;
-	}
-
-	function db_Num_fields(){
-		$result = @mysql_num_fields($this->mySQLresult);
-		return $result;
-	}
-
-
-}
+<?php
+
+/*
++---------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/mysql_class.php,v $
+|     $Revision: 1.57 $
+|     $Date: 2006/04/26 06:02:13 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$db_time = 0.0;				// Global total time spent in all db object queries
+$db_mySQLQueryCount = 0;	// Global total number of db object queries (all db's)
+
+/**
+* MySQL Abstraction class
+*
+* @package e107
+* @version $Revision: 1.57 $
+* @author $Author: sweetas $
+*/
+class db {
+
+	var $mySQLserver;
+	var $mySQLuser;
+	var $mySQLpassword;
+	var $mySQLdefaultdb;
+	var $mySQLaccess;
+	var $mySQLresult;
+	var $mySQLrows;
+	var $mySQLerror;
+	var $mySQLcurTable;
+	var $mySQLlanguage;
+	var $mySQLinfo;
+	var $tabset;
+
+	/**
+	* @return db
+	* @desc db constructor gets language options from the cookie or session
+	* @access public
+	*/
+	function db() {
+		global $pref, $eTraffic;
+		$eTraffic->BumpWho('Create db object', 1);
+		$langid = 'e107language_'.$pref['cookie_name'];
+		if ($pref['user_tracking'] == 'session') {
+			if (!isset($_SESSION[$langid])) { return; }
+			$this->mySQLlanguage = $_SESSION[$langid];
+		} else {
+			if (!isset($_COOKIE[$langid])) { return; }
+			$this->mySQLlanguage = $_COOKIE[$langid];
+		}
+	}
+
+	/**
+	* @return null or string error code
+	* @param string $mySQLserver IP Or hostname of the MySQL server
+	* @param string $mySQLuser MySQL username
+	* @param string $mySQLpassword MySQL Password
+	* @param string $mySQLdefaultdb The database schema to connect to
+	* @desc Connects to mySQL server and selects database - generally not required if your table is in the main DB.<br />
+	* <br />
+	* Example using e107 database with variables defined in config.php:<br />
+	* <code>$sql = new db;
+	* $sql->db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);</code>
+	* <br />
+	* OR to connect an other database:<br />
+	* <code>$sql = new db;
+	* $sql->db_Connect('url_server_database', 'user_database', 'password_database', 'name_of_database');</code>
+	*
+	* @access public
+	*/
+	function db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb) {
+
+		$this->mySQLserver = $mySQLserver;
+		$this->mySQLuser = $mySQLuser;
+		$this->mySQLpassword = $mySQLpassword;
+		$this->mySQLdefaultdb = $mySQLdefaultdb;
+
+		$temp = $this->mySQLerror;
+		$this->mySQLerror = FALSE;
+		if(defined("USE_PERSISTANT_DB") && USE_PERSISTANT_DB == true){
+			if (!$this->mySQLaccess = @mysql_pconnect($this->mySQLserver, $this->mySQLuser, $this->mySQLpassword)) {
+				return 'e1';
+			} else {
+				if (!@mysql_select_db($this->mySQLdefaultdb)) {
+					return 'e2';
+				} else {
+					$this->dbError('dbConnect/SelectDB');
+				}
+			}
+		} else {
+			if (!$this->mySQLaccess = @mysql_connect($this->mySQLserver, $this->mySQLuser, $this->mySQLpassword)) {
+				return 'e1';
+			} else {
+				if (!@mysql_select_db($this->mySQLdefaultdb)) {
+					return 'e2';
+				} else {
+					$this->dbError('dbConnect/SelectDB');
+				}
+			}
+		}
+	}
+
+	/**
+	* @return void
+	* @param unknown $sMarker
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_Mark_Time($sMarker) {
+		if (E107_DEBUG_LEVEL > 0) {
+			global $db_debug;
+			$db_debug->Mark_Time($sMarker);
+		}
+	}
+
+	/**
+	* @return void
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_Show_Performance() {
+		return $db_debug->Show_Performance();
+	}
+
+	/**
+	* @return void
+	* @desc add query to dblog table
+	* @access private
+	*/
+	function db_Write_log($log_type = '', $log_remark = '', $log_query = '') {
+		global $tp, $e107;
+		$d = time();
+		$uid = (USER === FALSE) ? USERID : '0';
+		$ip = $e107->getip();
+		$qry = $tp->toDB($log_query);
+		$this->db_Insert('dblog', "0, '{$log_type}', {$d}, {$uid}, '{$ip}', '{$qry}', '{$log_remark}'", 2);
+	}
+
+	/**
+	* @return unknown
+	* @param unknown $query
+	* @param unknown $rli
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_Query($query, $rli = NULL, $qry_from = '', $debug = FALSE, $log_type = '', $log_remark = '') {
+		global $db_time,$db_mySQLQueryCount,$queryinfo, $eTraffic;
+		$db_mySQLQueryCount++;
+
+		if ($debug == 'now') {
+			echo "** $query";
+		}
+		if ($debug !== FALSE || strstr(e_QUERY, 'showsql'))
+		{
+			$queryinfo[] = "<b>{$qry_from}</b>: $query";
+		}
+		if ($log_type != '') {
+			$this->db_Write_log($log_type, $log_remark, $query);
+		}
+
+		$b = microtime();
+		$sQryRes = is_null($rli) ? @mysql_query($query) : @mysql_query($query, $rli);
+		$e = microtime();
+
+		$eTraffic->Bump('db_Query', $b, $e);
+		$mytime = $eTraffic->TimeDelta($b,$e);
+		$db_time += $mytime;
+		$this->mySQLresult = $sQryRes;
+		if (E107_DEBUG_LEVEL) {
+			global $db_debug;
+			$aTrace = debug_backtrace();
+			$pTable = $this->mySQLcurTable;
+			if (!strlen($pTable)) {
+				$pTable = '(complex query)';
+			} else {
+				$this->mySQLcurTable = ''; // clear before next query
+			}
+			if(is_object($db_debug)) {
+				$nFields = $db_debug->Mark_Query($query, $rli, $sQryRes, $aTrace, $mytime, $pTable);
+			} else {
+				echo "what happened to db_debug??!!<br />";
+			}
+		}
+		return $sQryRes;
+	}
+
+	/**
+	* @return int Number of rows or false on error
+	*
+	* @param string $table Table name to select data from
+	* @param string $fields Table fields to be retrieved, default * (all in table)
+	* @param string $arg Query arguments, default null
+	* @param string $mode Argument has WHERE or not, default=default (WHERE)
+	*
+	* @param bool $debug Debug mode on or off
+	*
+	* @desc Perform a mysql_query() using the arguments suplied by calling db::db_Query()<br />
+	* <br />
+	* If you need more requests think to call the class.<br />
+	* <br />
+	* Example using a unique connection to database:<br />
+	* <code>$sql->db_Select("comments", "*", "comment_item_id = '$id' AND comment_type = '1' ORDER BY comment_datestamp");</code><br />
+	* <br />
+	* OR as second connection:<br />
+	* <code>$sql2 = new db;
+	* $sql2->db_Select("chatbox", "*", "ORDER BY cb_datestamp DESC LIMIT $from, ".$view, 'no_where');</code>
+	*
+	* @access public
+	*/
+	function db_Select($table, $fields = '*', $arg = '', $mode = 'default', $debug = FALSE, $log_type = '', $log_remark = '') {
+		global $db_mySQLQueryCount;
+		$table = $this->db_IsLang($table);
+		$this->mySQLcurTable = $table;
+		if ($arg != '' && $mode == 'default')
+		{
+			if ($this->mySQLresult = $this->db_Query('SELECT '.$fields.' FROM '.MPREFIX.$table.' WHERE '.$arg, NULL, 'db_Select', $debug, $log_type, $log_remark)) {
+				$this->dbError('dbQuery');
+				return $this->db_Rows();
+			} else {
+				$this->dbError("db_Select (SELECT $fields FROM ".MPREFIX."{$table} WHERE {$arg})");
+				return FALSE;
+			}
+		} elseif ($arg != '' && $mode != 'default') {
+			if ($this->mySQLresult = $this->db_Query('SELECT '.$fields.' FROM '.MPREFIX.$table.' '.$arg, NULL, 'db_Select', $debug, $log_type, $log_remark)) {
+				$this->dbError('dbQuery');
+				return $this->db_Rows();
+			} else {
+				$this->dbError("db_Select (SELECT {$fields} FROM ".MPREFIX."{$table} {$arg})");
+				return FALSE;
+			}
+		} else {
+			if ($this->mySQLresult = $this->db_Query('SELECT '.$fields.' FROM '.MPREFIX.$table, NULL, 'db_Select', $debug, $log_type, $log_remark)) {
+				$this->dbError('dbQuery');
+				return $this->db_Rows();
+			} else {
+				$this->dbError("db_Select (SELECT {$fields} FROM ".MPREFIX."{$table})");
+				return FALSE;
+			}
+		}
+	}
+
+	/**
+	* @return int Last insert ID or false on error
+	* @param string $table
+	* @param string $arg
+	* @param string $debug
+	* @desc Insert a row into the table<br />
+	* <br />
+	* Example:<br />
+	* <code>$sql->db_Insert("links", "0, 'News', 'news.php', '', '', 1, 0, 0, 0");</code>
+	*
+	* @access public
+	*/
+	function db_Insert($table, $arg, $debug = FALSE, $log_type = '', $log_remark = '') {
+		$table = $this->db_IsLang($table);
+		$this->mySQLcurTable = $table;
+		if(is_array($arg))
+		{
+			foreach($arg as $k => $v)
+			{
+				$keyList .= ($keyList ? ",`{$k}`" : "`{$k}`");
+				$valList .= ($valList ? ",'{$v}'" : "'{$v}'");
+			}
+			$query = "INSERT INTO `".MPREFIX."{$table}` ({$keyList}) VALUES ({$valList})";
+		}
+		else
+		{
+			$query = 'INSERT INTO '.MPREFIX."{$table} VALUES ({$arg})";
+		}
+
+		if ($result = $this->mySQLresult = $this->db_Query($query, NULL, 'db_Insert', $debug, $log_type, $log_remark )) {
+			$tmp = mysql_insert_id();
+			return $tmp;
+		} else {
+			$this->dbError("db_Insert ($query)");
+			return FALSE;
+		}
+	}
+
+	/**
+	* @return int number of affected rows, or false on error
+	* @param string $table
+	* @param string $arg
+	* @param bool $debug
+	* @desc Update fields in ONE table of the database corresponding to your $arg variable<br />
+	* <br />
+	* Think to call it if you need to do an update while retrieving data.<br />
+	* <br />
+	* Example using a unique connection to database:<br />
+	* <code>$sql->db_Update("user", "user_viewed='$u_new' WHERE user_id='".USERID."' ");</code>
+	* <br />
+	* OR as second connection<br />
+	* <code>$sql2 = new db;
+	* $sql2->db_Update("user", "user_viewed = '$u_new' WHERE user_id = '".USERID."' ");</code><br />
+	*
+	* @access public
+	*/
+	function db_Update($table, $arg, $debug = FALSE, $log_type = '', $log_remark = '') {
+		$table = $this->db_IsLang($table);
+		$this->mySQLcurTable = $table;
+		if ($result = $this->mySQLresult = $this->db_Query('UPDATE '.MPREFIX.$table.' SET '.$arg, NULL, 'db_Update', $debug, $log_type, $log_remark)) {
+			$result = mysql_affected_rows();
+			return $result;
+		} else {
+			$this->dbError("db_Update ($query)");
+			return FALSE;
+		}
+	}
+
+	/**
+	* @return array MySQL row
+	* @param string $mode
+	* @desc Fetch an array containing row data (see PHP's mysql_fetch_array() docs)<br />
+	* <br />
+	* Example :<br />
+	* <code>while($row = $sql->db_Fetch()){
+	*  $text .= $row['username'];
+	* }</code>
+	*
+	* @access public
+	*/
+	function db_Fetch() {
+		global $eTraffic;
+		$b = microtime();
+		$row = @mysql_fetch_array($this->mySQLresult);
+		$eTraffic->Bump('db_Fetch', $b);
+		if ($row) {
+			$this->dbError('db_Fetch');
+			return $row;
+		} else {
+			$this->dbError('db_Fetch');
+			return FALSE;
+
+		}
+	}
+
+	/**
+	* @return int number of affected rows or false on error
+	* @param string $table
+	* @param string $fields
+	* @param string $arg
+	* @desc Count the number of rows in a select<br />
+	* <br />
+	* Example:<br />
+	* <code>$topics = $sql->db_Count("forum_t", "(*)", " WHERE thread_forum_id='".$forum_id."' AND thread_parent='0' ");</code>
+	*
+	* @access public
+	*/
+	function db_Count($table, $fields = '(*)', $arg = '', $debug = FALSE, $log_type = '', $log_remark = '') {
+		$table = $this->db_IsLang($table);
+
+		if ($fields == 'generic') {
+			$query=$table;
+			if ($this->mySQLresult = $this->db_Query($query, NULL, 'db_Count', $debug, $log_type, $log_remark)) {
+				$rows = $this->mySQLrows = @mysql_fetch_array($this->mySQLresult);
+				return $rows['COUNT(*)'];
+			} else {
+				$this->dbError("dbCount ($query)");
+				return FALSE;
+			}
+		}
+
+		$this->mySQLcurTable = $table;
+		$query='SELECT COUNT'.$fields.' FROM '.MPREFIX.$table.' '.$arg;
+		if ($this->mySQLresult = $this->db_Query($query, NULL, 'db_Count', $debug, $log_type, $log_remark)) {
+			$rows = $this->mySQLrows = @mysql_fetch_array($this->mySQLresult);
+			return $rows[0];
+		} else {
+			$this->dbError("dbCount ($query)");
+			return FALSE;
+		}
+	}
+
+	/**
+	* @return void
+	* @desc Closes the mySQL server connection.<br />
+	* <br />
+	* Only required if you open a second connection.<br />
+	* Native e107 connection is closed in the footer.php file<br />
+	* <br />
+	* Example :<br />
+	* <code>$sql->db_Close();</code>
+	*
+	* @access public
+	*/
+	function db_Close() {
+		mysql_close();
+		$this->dbError('dbClose');
+	}
+
+	/**
+	* @return int number of affected rows, or false on error
+	* @param string $table
+	* @param string $arg
+	* @desc Delete rows from a table<br />
+	* <br />
+	* Example:
+	* <code>$sql->db_Delete("tmp", "tmp_ip='$ip'");</code><br />
+	* <br />
+	* @access public
+	*/
+	function db_Delete($table, $arg = '', $debug = FALSE, $log_type = '', $log_remark = '') {
+		$table = $this->db_IsLang($table);
+		$this->mySQLcurTable = $table;
+		if (!$arg) {
+			if ($result = $this->mySQLresult = $this->db_Query('DELETE FROM '.MPREFIX.$table, NULL, 'db_Delete', $debug, $log_type, $log_remark)) {
+				return $result;
+			} else {
+				$this->dbError("db_Delete ($arg)");
+				return FALSE;
+			}
+		} else {
+			if ($result = $this->mySQLresult = $this->db_Query('DELETE FROM '.MPREFIX.$table.' WHERE '.$arg, NULL, 'db_Delete', $debug, $log_type, $log_remark)) {
+				$tmp = mysql_affected_rows();
+				return $tmp;
+			} else {
+				$this->dbError('db_Delete ('.$arg.')');
+				return FALSE;
+			}
+		}
+	}
+
+	/**
+	* @return unknown
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_Rows() {
+		$rows = $this->mySQLrows = @mysql_num_rows($this->mySQLresult);
+		return $rows;
+		$this->dbError('db_Rows');
+	}
+
+	/**
+	* @return unknown
+	* @param unknown $from
+	* @desc Enter description here...
+	* @access private
+	*/
+	function dbError($from) {
+		if ($error_message = @mysql_error()) {
+			if ($this->mySQLerror == TRUE) {
+				message_handler('ADMIN_MESSAGE', '<b>mySQL Error!</b> Function: '.$from.'. ['.@mysql_errno().' - '.$error_message.']', __LINE__, __FILE__);
+				return $error_message;
+			}
+		}
+	}
+
+	/**
+	* @return void
+	* @param unknown $mode
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_SetErrorReporting($mode) {
+		$this->mySQLerror = $mode;
+	}
+
+
+	/**
+	* @return unknown
+	* @param unknown $arg
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_Select_gen($query, $debug = FALSE, $log_type = '', $log_remark = '') {
+
+		/*
+		changes by jalist 19/01/05:
+		added string replace on table prefix to tidy up long database queries
+		usage: instead of sending "SELECT * FROM ".MPREFIX."table", do "SELECT * FROM #table"
+		*/
+
+		$this->tabset = FALSE;
+		if(strpos($query,'#') !== FALSE) {
+			$query = preg_replace_callback("/\s#([\w]*?)\W/", array($this, 'ml_check'), $query);
+		}
+		if ($this->mySQLresult = $this->db_Query($query, NULL, 'db_Select_gen', $debug, $log_type, $log_remark)) {
+			$this->dbError('db_Select_gen');
+			return $this->db_Rows();
+		} else {
+			$this->dbError('dbQuery ('.$query.')');
+			return FALSE;
+		}
+	}
+
+	function ml_check($matches) {
+		$table = $this->db_IsLang($matches[1]);
+		if($this->tabset == false) {
+			$this->mySQLcurTable = $table;
+			$this->tabset = true;
+		}
+		return " ".MPREFIX.$table.substr($matches[0],-1);
+	}
+
+	/**
+	* @return unknown
+	* @param unknown $offset
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_Fieldname($offset) {
+		$result = @mysql_field_name($this->mySQLresult, $offset);
+		return $result;
+	}
+
+	/**
+	* @return unknown
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_Field_info() {
+		$result = @mysql_fetch_field($this->mySQLresult);
+		return $result;
+	}
+
+	/**
+	* @return unknown
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_Num_fields() {
+		$result = @mysql_num_fields($this->mySQLresult);
+		return $result;
+	}
+
+	/**
+	* @return unknown
+	* @param unknown $table
+	* @desc Enter description here...
+	* @access private
+	*/
+	function db_IsLang($table,$multiple=FALSE) {
+		global $pref, $mySQLtablelist;
+		if ((!$this->mySQLlanguage || !$pref['multilanguage']) && $multiple==FALSE) {
+		  	return $table;
+		}
+
+		if (!$mySQLtablelist) {
+			$tablist = mysql_list_tables($this->mySQLdefaultdb);
+			while (list($temp) = mysql_fetch_array($tablist)) {
+				$mySQLtablelist[] = $temp;
+			}
+		}
+
+		$mltable = "lan_".strtolower($this->mySQLlanguage.'_'.$table);
+
+	// ---- Find all multi-language tables.
+
+		if($multiple == TRUE){ // return an array of all matching language tables. eg [french]->e107_lan_news
+			if(!is_array($table)){
+				$table = array($table);
+			}
+
+			foreach($mySQLtablelist as $tab){
+ 				if(stristr($tab, MPREFIX."lan_") !== FALSE){
+					$tmp = explode("_",str_replace(MPREFIX."lan_","",$tab));
+			   		$lng = $tmp[0];
+                    foreach($table as $t){
+                    	if(eregi($t."$",$tab)){
+							$lanlist[$lng][MPREFIX.$t] = $tab;
+						}
+					}
+			  	}
+			}
+			return ($lanlist) ? $lanlist : FALSE;
+		}
+	// -------------------------
+
+		if (in_array(MPREFIX.$mltable, $mySQLtablelist)) {
+			return $mltable;
+		}
+	 	return $table;
+	}
+
+	/**
+	* @return array
+	* @param string fields to retrieve
+	* @desc returns fields as structured array
+	* @access public
+	*/
+	function db_getList($fields = 'ALL', $amount = FALSE, $maximum = FALSE, $ordermode=FALSE) {
+		$list = array();
+		$counter = 1;
+		while ($row = $this->db_Fetch()) {
+			foreach($row as $key => $value) {
+				if (is_string($key)) {
+					if (strtoupper($fields) == 'ALL' || in_array ($key, $fields)) {
+
+						if(!$ordermode)
+						{
+							$list[$counter][$key] = $value;
+						}
+						else
+						{
+							$list[$row[$ordermode]][$key] = $value;
+						}
+					}
+				}
+			}
+			if ($amount && $amount == $counter || ($maximum && $counter > $maximum)) {
+				break;
+			}
+			$counter++;
+		}
+		return $list;
+	}
+
+	/**
+	* @return integer
+	* @desc returns total number of queries made so far
+	* @access public
+	*/
+	function db_QueryCount() {
+		global $db_mySQLQueryCount;
+		return $db_mySQLQueryCount;
+	}
+
+
+    /*
+    	Multi-language Query Function.
+	*/
+
+
+	function db_Query_all($query,$debug=""){
+        $error = "";
+
+		$query = str_replace("#",MPREFIX,$query);
+
+        if(!$this->db_Query($query)){  // run query on the default language first.
+        	$error .= $query. " failed";
+		}
+
+        $tmp = explode(" ",$query);
+      	foreach($tmp as $val){
+   			if(strpos($val,MPREFIX) !== FALSE){
+    			$table[] = str_replace(MPREFIX,"",$val);
+				$search[] = $val;
+			}
+		}
+
+     // Loop thru relevant language tables and replace each tablename within the query.
+        if($tablist = $this->db_IsLang($table,TRUE)){
+			foreach($tablist as $key=>$tab){
+				$querylan = $query;
+                foreach($search as $find){
+                    $lang = $key;
+					$replace = ($tab[$find] !="") ? $tab[$find] : $find;
+               	  	$querylan = str_replace($find,$replace,$querylan);
+				}
+
+				if(!$this->db_Query($querylan)){ // run query on other language tables.
+					$error .= $qrylan." failed for language";
+				}
+			 	if($debug){ echo "<br />** lang= ".$querylan; }
+			}
+		}
+
+
+		return ($error)? FALSE : TRUE;
+	}
+
+    function db_Field($table,$fieldid=""){
+		if(!$this->mySQLdefaultdb){
+			global $mySQLdefaultdb;
+			$this->mySQLdefaultdb = $mySQLdefaultdb;
+		}
+		$fields = mysql_list_fields($this->mySQLdefaultdb, MPREFIX.$table);
+		return mysql_field_name($fields, $fieldid);
+
+	}
+
+	/**
+	 * A pointer to mysql_real_escape_string() - see http://www.php.net/mysql_real_escape_string
+	 *
+	 * @param string $data
+	 * @return string
+	 */
+	function escape($data, $strip = true) {
+		if ($strip) {
+			$data = strip_if_magic($data);
+		}
+		return mysql_real_escape_string($data);
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/news_class.php 75/e107_handlers/news_class.php
--- 6171/e107_handlers/news_class.php	2004-08-14 21:31:14.000000000 -0500
+++ 75/e107_handlers/news_class.php	2006-04-12 09:58:12.000000000 -0500
@@ -1,338 +1,200 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/classes/news_class.php
-|
-|	Steve Dunstan 2001-2002
-|	http://jalist.com
-|	stevedunstan@jalist.com
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).	
-|
-| $Source: /cvsroot/e107/e107/e107_handlers/news_class.php,v $
-| $Revision: 1.16 $
-| $Date: 2004/08/15 02:31:14 $
-| $Author: mcfly_e107 $ 
-+---------------------------------------------------------------+
-*/
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-class news{
-
-	
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function submit_item($news){
-		
-		if(!is_object($aj)) $aj = new textparse;
-		if(!is_object($sql)) $sql = new db;
-		extract($news);
-		if($news_id){
-			$news_title = $aj -> formtpa($news_title);
-			$news_body = $aj -> formtpa($data);
-			$news_extended = $aj -> formtpa($news_extended);
-			$vals = $update_datestamp ? "news_datestamp = ".time().", " : "";
-			$vals .= " news_title='$news_title', news_body='$news_body', news_extended='$news_extended', news_category='$cat_id', news_allow_comments='$news_allow_comments', news_start='$active_start', news_end='$active_end', news_class='$news_class', news_render_type='$news_rendertype' WHERE news_id='$news_id' ";
-			if($sql -> db_Update("news",$vals)){
-				$message = "News updated in database.";
-             clear_cache("news.php");
-			}else{
-				$message = "<strong>Error! - Was unable to update news item into database!</strong>";
-			}
-		}else{
-			$news_title = $aj -> formtpa($news_title);
-			$news_body = $aj -> formtpa($data);
-			$news_extended = $aj -> formtpa($news_extended);
-			if($sql -> db_Insert("news", "0, '$news_title', '$news_body', '$news_extended', ".time().", ".USERID.", $cat_id, $news_allow_comments, $active_start, $active_end, '$news_class', '$news_rendertype' ")){
-				$message = "News entered into database.";
-             clear_cache("news.php");
-			}else{
-				$message = "<strong>Error! - Was unable to enter news item into database!</strong>";
-			}
-		}
-		$this -> create_rss();
-		return $message;
-	}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-	function render_newsitem($news, $mode="default", $n_restrict=""){
-    if($n_restrict=="userclass"){
-      $news['news_id'] = 0;
-      $news['news_title'] = LAN_NEWS_1;
-      $news['data'] = LAN_NEWS_2;
-      $news['news_extended'] = "";
-      $news['news_allow_comments'] = 1;
-      $news['news_start'] = 0;
-      $news['news_end'] = 0;
-      $news['news_rendertype'] = 0;
-      $news['comment_total'] = 0;
-    }
-		if(function_exists("theme_render_newsitem")){
-			$result = call_user_func("theme_render_newsitem",$news);
-			if($result == "return"){return;}
-		}
-		global $NEWSSTYLE, $NEWSLISTSTYLE;
-		if(!is_object($aj)) $aj = new textparse;
-		if(!is_object($sql)) $sql = new db;
-		extract($news);
-
-		define("IMAGE_nonew_small", (file_exists(THEME."generic/nonew_comments.png") ? "<img src='".THEME."generic/nonew_comments.png' alt=''  /> " : "<img src='".e_IMAGE."generic/nonew_comments.png' alt=''  />"));
-		define("IMAGE_new_small", (file_exists(THEME."generic/new_comments.png") ? "<img src='".THEME."generic/new_comments.png' alt=''  /> " : "<img src='".e_IMAGE."generic/new_comments.png' alt=''  /> "));
-
-		if(!$NEWSLISTSTYLE){
-			$NEWSLISTSTYLE = "
-<img src='".THEME."images/bullet2.gif' alt='bullet' /> 
-<b>
-{NEWSTITLE}
-</b>
-<div class='smalltext'>
-{NEWSAUTHOR}
-on
-{NEWSDATE}
-{NEWSCOMMENTS}
-</div>
-<hr />
-";
-	}
-
-		$news_title = $aj -> tpa($news_title, "off", "admin");
-		$highlight_search = FALSE;
-		if(IsSet($_POST['highlight_search'])){
-			$highlight_search = TRUE;
-		}
-		$news_body = $aj -> tpa($data, "off", "admin", $highlight_search);
-		$news_extended = trim(chop($aj -> tpa($news_extended, "off", "admin")));
-
-		if(!$comment_total) $comment_total = "0";
-		$con = new convert;
-		$datestamp = $con -> convert_date($news_datestamp, "long");
-
-		$titleonly = (substr($news_body, 0, 6) == "&nbsp;" && $NEWSLISTSTYLE ? TRUE : FALSE);
-
-		if($news_title == "Welcome to e107"){
-			$admin_name = "e107";
-			$admin_email = "e107@jalist.com";
-			$category_name = "e107 welcome message";
-			$category_id = 0;
-			$category_icon = (strstr(SITEBUTTON, "http") ? SITEBUTTON : e_IMAGE.SITEBUTTON);
-		}else{
-			$category_icon = str_replace("../", "", $category_icon);
-			if(strstr("images", $category_icon)){
-				$category_icon = THEME.$category_icon;
-			}else{
-				$category_icon = e_IMAGE."newsicons/".$category_icon;
-			}
-		}
-
-		$active_start = ($active_start ? str_replace(" - 00:00:00", "", $con -> convert_date($active_start, "long")) : "Now");
-		$active_end = ($active_end ?  " to ".str_replace(" - 00:00:00", "", $con -> convert_date($active_end, "long")) : "");
-		$info = "<div class='smalltext'><br /><br /><b>Info:</b><br />";
-		$info .= ($titleonly ? "Title only is set - <b>only the news title will be shown</b><br />" : "");
-		$info .= ($news_class==255 ? "This news post is <b>inactive</b> (It will be not shown on front page). " : "This news post is <b>active</b> (it will be shown on front page). ");
-		$info .= ($news_allow_comments ? "Comments are turned <b>off</b>. " : "Comments are turned <b>on</b>. ");
-		$info .= "<br />Activation period: ".$active_start.$active_end."<br />";
-		$info .= "Body length: ".strlen($news_body)."b. Extended length: ".strlen($news_extended)."b.<br /><br /></div>";
-
-		$sql -> db_Select("comments", "comment_datestamp", "comment_item_id='".$news['news_id']."' AND comment_type='0' ORDER BY comment_datestamp DESC LIMIT 0,1");
-		list($comments['comment_datestamp']) = $sql -> db_Fetch();
-		$latest_comment = $comments['comment_datestamp'];
-		if($latest_comment > USERLV ){
-				$NEWIMAGE = IMAGE_new_small;
-		}else{
-				$NEWIMAGE = IMAGE_nonew_small;
-		}
-
-		$news_category = "<a href='".e_BASE."news.php?cat.".$category_id."'>".$category_name."</a>";
-		$news_author = "<a href='".e_BASE."user.php?id.".$admin_id."'>".$admin_name."</a>";
-		
-		require_once(e_HANDLER."emailprint_class.php");
-		$ep = new emailprint;
-		$textemail = $ep -> render_emailprint("news",$news_id, 1);
-		$textprint = $ep -> render_emailprint("news",$news_id, 2);
-		
-		/*
-		$etext = " <a href='".e_BASE."email.php?news.".$news_id."'><img src='".e_IMAGE."generic/friend.gif' style='border:0' alt='email to someone' title='email to someone'/></a>";
-		$ptext = " <a href='".e_BASE."print.php?news.".$news_id."'><img src='".e_IMAGE."generic/printer.gif' style='border:0' alt='printer friendly' title='printer friendly'/></a>";
-		*/
-		if(ADMIN && getperms("H")){
-			$adminoptions .= "<a href='".e_BASE.e_ADMIN."newspost.php?create.edit.".$news_id."'><img src='".e_IMAGE."generic/newsedit.png' alt='' style='border:0' /></a>\n";
-		}
-
-		$search[0] = "/\{NEWSTITLE\}(.*?)/si";
-		$replace[0] = ($news_rendertype == 1 ? "<a href='".e_BASE."news.php?item.$news_id'>".$news_title."</a>" : $news_title);
-
-		$search[13] = "/\{CAPTIONCLASS\}(.*?)/si";
-		$replace[13] = "<div class='category".$category_id."'>".($titleonly ? "&nbsp;<a href='".e_BASE."comment.php?comment.news.$news_id'>".$news_title."</a>" : "&nbsp;".$news_title)."</div>";
-
-		$search[14] = "/\{ADMINCAPTION\}(.*?)/si";
-		$replace[14] = "<div class='$admin_name'>".($titleonly ? "&nbsp;<a href='".e_BASE."comment.php?comment.news.$news_id'>".$news_title."</a>" : "&nbsp;".$news_title)."</div>";
-
-		$search[15] = "/\{ADMINBODY\}(.*?)/si";
-		$replace[15] = "<div class='$admin_name'>".(strstr(e_QUERY, "extend") ? $news_body."<br /><br />".$news_extended : $news_body)."</div>";
-
-		$search[1] = "/\{NEWSBODY\}(.*?)/si";
-		$replace[1] = (strstr(e_QUERY, "extend") ? $news_body."<br /><br />".$news_extended : $news_body);
-		$search[2] = "/\{NEWSICON\}(.*?)/si";
-		$replace[2] = "<a href='".e_BASE."news.php?cat.$category_id'><img style='".ICONSTYLE."'  src='$category_icon' alt='' /></a>";
-		$search[3] = "/\{NEWSHEADER\}(.*?)/si";
-		$replace[3] = $category_icon;
-		$search[4] = "/\{NEWSCATEGORY\}(.*?)/si";
-		$replace[4] = "<a href='".e_BASE."news.php?cat.$category_id'>".$category_name."</a>";
-		$search[5] = "/\{NEWSAUTHOR\}(.*?)/si";
-		$replace[5] = $news_author;
-		$search[6] = "/\{NEWSDATE\}(.*?)/si";
-		$replace[6] = $datestamp;
-		$search[7] = "/\{NEWSCOMMENTS\}(.*?)/si";
-		$replace[7] = ($news_allow_comments ? COMMENTOFFSTRING : "".$NEWIMAGE." <a href='".e_BASE."comment.php?comment.news.$news_id'>".COMMENTLINK.$comment_total."</a>");
-		$search[8] = "/\{EMAILICON\}(.*?)/si";
-		$replace[8] = $textemail;
-		$search[9] = "/\{PRINTICON\}(.*?)/si";
-		$replace[9] = $textprint;
-		$search[10] = "/\{NEWSID\}(.*?)/si";
-		$replace[10] = $news_id;
-
-		$search[11] = "/\{ADMINOPTIONS\}(.*?)/si";
-		$replace[11] = $adminoptions;
-
-		$search[12] = "/\{EXTENDED\}(.*?)/si";
-
-		if($preview == "Preview" && $news_extended && !strstr(e_QUERY, "extend")){
-			if(defined("PRE_EXTENDEDSTRING")){ $es1 = PRE_EXTENDEDSTRING; }
-			if(defined("POST_EXTENDEDSTRING")){ $es2 = POST_EXTENDEDSTRING; }
-			$replace[12] = $es1.EXTENDEDSTRING.$es2."<br />".$news_extended;
-		}else if($news_extended && !strstr(e_QUERY, "extend")){
-			if(defined("PRE_EXTENDEDSTRING")){ $es1 = PRE_EXTENDEDSTRING; }
-			if(defined("POST_EXTENDEDSTRING")){ $es2 = POST_EXTENDEDSTRING; }
-			$replace[12] = $es1."<a href='".e_BASE."news.php?extend.".$news_id."'>".EXTENDEDSTRING."</a>".$es2;
-		}
-		
-		$text = preg_replace($search, $replace, ($news_rendertype == 1 && strstr(e_SELF, "news.php") ? $NEWSLISTSTYLE : $NEWSSTYLE));
-		echo $text;
-		if($preview == "Preview"){ echo $info; }
-
-		return TRUE;
-	}
-	
-function make_xml_compatible($original){
-	global $aj;
-  if(!is_object($aj)) $aj = new textparse;
-  $original = $aj -> tpa($original);
-  // remove html-only entities
-  $original = str_replace('&pound', '&amp;#163;', $original);
-  $original = str_replace('&copy;', '(c)', $original);
-	// encode rest
-  return htmlspecialchars($original);
-}
-
-function create_rss(){
-                /*
-                # rss create
-                # - parameters                none
-                # - return                                null
-                # - scope                                        public
-                */
-                global $sql;
-  							global $aj;
-								if(!is_object($aj)) $aj = new textparse;
-                setlocale (LC_TIME, CORE_LC);
-                $pubdate = strftime("%a, %d %b %Y %I:%M:00 GMT", time());
-                $sitebutton = (strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON);
-                $sitedisclaimer = ereg_replace("<br />|\n", "", SITEDISCLAIMER);
-
-        $rss = "<?xml version=\"1.0\" encoding=\"".CHARSET."\"?>
-<rss version=\"2.0\">
-<channel>
-  <title>".$this->make_xml_compatible(SITENAME)."</title>
-  <link>http://".$_SERVER['HTTP_HOST'].e_HTTP."index.php</link>
-  <description>".$this->make_xml_compatible(SITEDESCRIPTION)."</description>
-  <language>".CORE_LC."-".CORE_LC2."</language>
-  <copyright>".$this->make_xml_compatible($sitedisclaimer)."</copyright>
-  <managingEditor>".$this->make_xml_compatible(SITEADMIN)." - ".SITEADMINEMAIL."</managingEditor>
-  <webMaster>".SITEADMINEMAIL."</webMaster>
-  <pubDate>$pubdate</pubDate>
-  <lastBuildDate>$pubdate</lastBuildDate>
-  <docs>http://backend.userland.com/rss</docs>
-  <generator>e107 website system (http://e107.org)</generator>
-  <ttl>60</ttl>
-
-  <image>
-    <title>".$this->make_xml_compatible(SITENAME)."</title>
-    <url>".$sitebutton."</url>
-    <link>http://".$_SERVER['HTTP_HOST'].e_HTTP."index.php</link>
-    <width>88</width>
-    <height>31</height>
-    <description>".$this->make_xml_compatible(SITETAG)."</description>
-  </image>
-
-  <textInput>
-    <title>Search</title>
-    <description>Search ".$this->make_xml_compatible(SITENAME)."</description>
-    <name>query</name>
-    <link>".SITEURL.(substr(SITEURL, -1) == "/" ? "" : "/")."search.php</link>
-  </textInput>
-  ";
-
-        $sql2 = new db;
-
-        $sql -> db_Select("news", "*", "news_class=0 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ORDER BY news_datestamp DESC LIMIT 0, 10");
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                $sql2 -> db_Select("news_category", "*",  "category_id='$news_category' ");
-                $row = $sql2 -> db_Fetch(); extract($row);
-                $sql2 -> db_Select("user", "user_name, user_email", "user_id=$news_author");
-                $row = $sql2 -> db_Fetch(); extract($row);
-                $tmp = explode(" ", $news_body);
-                unset($nb);
-                for($a=0; $a<=100; $a++){
-                        $nb .= $tmp[$a]." ";
-                }
-                if($tmp[($a-2)]){ $nb .= " [more ...]"; }
-                //$nb = $this->make_xml_compatible($nb);
-                // Code from Lisa
-                //$search = array();
-                //$replace = array();
-                //$search[0] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
-                //$replace[0] = '\\2';
-                //$search[1] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
-                //$replace[1] = '\\2';
-                //$search[2] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
-                //$replace[2] = '\\2';
-                //$search[3] = "/\<a href=&quot;(.*?)&quot;>(.*?)<\/a>/si";
-                //$replace[3] = '\\2';
-                //$news_title = preg_replace($search, $replace, $news_title);
-                // End of code from Lisa
-                $wlog .= strip_tags($aj -> tpa($news_title))."\n".SITEURL."comment.php?comment.news.".$news_id."\n\n";
-                $itemdate = strftime("%a, %d %b %Y %I:%M:00 GMT", $news_datestamp);
-
-  $rss .= "<item>
-    <title>".$this->make_xml_compatible(strip_tags($aj -> tpa($news_title)))."</title>
-    <link>http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</link>
-    <description>".$this->make_xml_compatible($nb)."</description>
-    <category domain=\"".SITEURL."\">$category_name</category>
-    <comments>http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</comments>
-    <author>".$this->make_xml_compatible($user_name)." - $user_email</author>
-    <pubDate>$itemdate</pubDate>
-    <guid isPermaLink=\"true\">http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id."</guid>
-  </item>
-  ";
-
-        }
-
-
-        $rss .= "</channel>
-</rss>";
-        $rss = str_replace("&nbsp;", " ", $rss);
-        $fp = fopen(e_FILE."backend/news.xml","w");
-        @fwrite($fp, $rss);
-        fclose($fp);
-        $fp = fopen(e_FILE."backend/news.txt","w");
-        @fwrite($fp, $wlog);
-        fclose($fp);
-        if(!fwrite){
-                $text = "<div style='text-align:center'>".LAN_19."</div>";
-                $ns -> tablerender("<div style='text-align:center'>".LAN_20."</div>", $text);
-        }
-}
-
-	
-}
+<?php
+/*
++---------------------------------------------------------------+
+| e107 website system
+| /classes/news_class.php
+|
+| Steve Dunstan 2001-2002
+| http://jalist.com
+| stevedunstan@jalist.com
+|
+| Released under the terms and conditions of the
+| GNU General Public License (http://gnu.org).
+|
+| $Source: /cvsroot/e107/e107_0.7/e107_handlers/news_class.php,v $
+| $Revision: 1.71 $
+| $Date: 2006/04/12 14:58:12 $
+| $Author: sweetas $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class news {
+	
+	function submit_item($news) {
+		global $sql, $tp, $e107cache, $e_event, $pref;
+		if (!is_object($tp)) $tp = new e_parse;
+		if (!is_object($sql)) $sql = new db;
+
+		$news['news_title'] = $tp->toDB($news['news_title']);
+		$news['news_body'] = $tp->toDB($news['data']);
+		$news['news_extended'] = $tp->toDB($news['news_extended']);
+		$news['news_summary'] = $tp->toDB($news['news_summary']);
+		if(!isset($news['news_sticky'])) {$news['news_sticky'] = 0;}
+		$author_insert = ($news['news_author'] == 0) ? "news_author = '".USERID."'," : "";
+
+		if ($news['news_id']) {
+			$vals = "news_datestamp = '".intval($news['news_datestamp'])."', ".$author_insert." news_title='".$news['news_title']."', news_body='".$news['news_body']."', news_extended='".$news['news_extended']."', news_category='".intval($news['cat_id'])."', news_allow_comments='".intval($news['news_allow_comments'])."', news_start='".intval($news['news_start'])."', news_end='".intval($news['news_end'])."', news_class='".$tp->toDB($news['news_class'])."', news_render_type='".intval($news['news_rendertype'])."' , news_summary='".$news['news_summary']."', news_thumbnail='".$tp->toDB($news['news_thumbnail'])."', news_sticky='".intval($news['news_sticky'])."' WHERE news_id='".intval($news['news_id'])."' ";
+			if ($sql -> db_Update('news', $vals)) {
+				$e_event -> trigger('newsupd', $news);
+				$message = LAN_NEWS_21;
+				$e107cache -> clear('news.php');
+			} else {
+				$message = "<strong>".(!mysql_errno() ? LAN_NEWS_46 : LAN_NEWS_5)."</strong>";
+			}
+		} else {
+			if ($sql ->db_Insert('news', "0, '".$news['news_title']."', '".$news['news_body']."', '".$news['news_extended']."', ".intval($news['news_datestamp']).", ".USERID.", '".intval($news['cat_id'])."', '".intval($news['news_allow_comments'])."', '".intval($news['news_start'])."', '".intval($news['news_end'])."', '".$tp->toDB($news['news_class'])."', '".intval($news['news_rendertype'])."', '0' , '".$news['news_summary']."', '".$tp->toDB($news['news_thumbnail'])."', '".intval($news['news_sticky'])."' ")) {
+				$e_event -> trigger('newspost', $news);
+				$message = LAN_NEWS_6;
+				$e107cache -> clear('news.php');
+			} else {
+				$message = "<strong>".LAN_NEWS_7."</strong>";
+			}
+		}
+
+		/* trackback	*/
+		if($pref['trackbackEnabled'])
+		{
+			$excerpt = substr($news['news_body'], 0, 100)."...";
+			$id=mysql_insert_id();
+			$permLink = $e107->base_path."comment.php?comment.news.{$id}";
+
+			require_once(e_PLUGIN."trackback/trackbackClass.php");
+			$trackback = new trackbackClass();
+
+			if($_POST['trackback_urls'])
+			{
+				$urlArray = explode("\n", $_POST['trackback_urls']);
+				foreach($urlArray as $pingurl) {
+					if(!$error = $trackback -> sendTrackback($permLink, $pingurl, $news['news_title'], $excerpt))
+					{
+						$message .= "<br />successfully pinged {$pingurl}.";
+					} else {
+						$message .= "<br />was unable to ping {$pingurl}<br />[ Error message returned was : '{$error}'. ]";
+					}
+				}
+			}
+
+			if(isset($_POST['pingback_urls']))
+			{
+				if ($urlArray = $trackback -> getPingUrls($news['news_body']))
+				{
+					foreach($urlArray as $pingurl)
+					{
+
+						if ($trackback -> sendTrackback($permLink, $pingurl, $news['news_title'], $excerpt))
+						{
+	 						$message .= "<br />successfully pinged {$pingurl}.";
+						}
+						else
+						{
+							$message .= "Pingback to {$pingurl} failed ...";
+						}
+					}
+				}
+				else
+				{
+					$message .= "<br />No pingback addresses were discovered";
+				}
+			}
+		}
+
+		/* end trackback */
+
+		return $message;
+	}
+
+	function render_newsitem($news, $mode = 'default', $n_restrict = '', $NEWS_TEMPLATE = '', $param='') {
+		global $tp, $sql, $override, $pref, $ns, $NEWSSTYLE, $NEWSLISTSTYLE, $news_shortcodes;
+		if ($override_newsitem = $override -> override_check('render_newsitem')) {
+			$result = call_user_func($override_newsitem, $news, $mode, $n_restrict, $NEWS_TEMPLATE, $param);
+			if ($result == 'return') {
+				return;
+			}
+		}
+		if (!is_object($tp)) $tp = new e_parse;
+
+		if ($n_restrict == 'userclass') {
+			$news['news_id'] = 0;
+			$news['news_title'] = LAN_NEWS_1;
+			$news['data'] = LAN_NEWS_2;
+			$news['news_extended'] = "";
+			$news['news_allow_comments'] = 1;
+			$news['news_start'] = 0;
+			$news['news_end'] = 0;
+			$news['news_render_type'] = 0;
+			$news['comment_total'] = 0;
+		}
+
+		if (!$param) {
+			if (!defined("IMAGE_nonew_small")){
+				define("IMAGE_nonew_small", (file_exists(THEME."generic/nonew_comments.png") ? "<img src='".THEME_ABS."generic/nonew_comments.png' alt=''  /> " : "<img src='".e_IMAGE_ABS."generic/".IMODE."/nonew_comments.png' alt=''  />"));
+			}
+			if (!defined("IMAGE_new_small"))	{
+				define("IMAGE_new_small", (file_exists(THEME."generic/new_comments.png") ? "<img src='".THEME_ABS."generic/new_comments.png' alt=''  /> " : "<img src='".e_IMAGE_ABS."generic/".IMODE."/new_comments.png' alt=''  /> "));
+			}
+			if (!defined("IMAGE_sticky")){
+				define("IMAGE_sticky", (file_exists(THEME."images/sticky.png") ? "<img src='".THEME_ABS."images/sticky.png' alt=''  /> " : "<img src='".e_IMAGE_ABS."generic/".IMODE."/sticky.png' alt='' style='width: 14px; height: 14px; vertical-align: bottom' /> "));
+			}
+
+			$param['image_nonew_small'] = IMAGE_nonew_small;
+			$param['image_new_small'] = IMAGE_new_small;
+			$param['image_sticky'] = IMAGE_sticky;
+			$param['caticon'] = ICONSTYLE;
+			$param['commentoffstring'] = COMMENTOFFSTRING;
+			$param['commentlink'] = COMMENTLINK;
+			$param['trackbackstring'] = (defined("TRACKBACKSTRING") ? TRACKBACKSTRING : "");
+			$param['trackbackbeforestring'] = (defined("TRACKBACKBEFORESTRING") ? TRACKBACKBEFORESTRING : "");
+			$param['trackbackafterstring'] = (defined("TRACKBACKAFTERSTRING") ? TRACKBACKAFTERSTRING : "");
+			$param['itemlink'] = (defined("NEWSLIST_ITEMLINK")) ? NEWSLIST_ITEMLINK : "";
+			$param['thumbnail'] =(defined("NEWSLIST_THUMB")) ? NEWSLIST_THUMB : "border:0px";
+			$param['catlink']  = (defined("NEWSLIST_CATLINK")) ? NEWSLIST_CATLINK : "";
+			$param['caticon'] =  (defined("NEWSLIST_CATICON")) ? NEWSLIST_CATICON : ICONSTYLE;
+		}
+		
+		cachevars('current_news_item', $news);
+		cachevars('current_news_param', $param);
+
+		if ($news['news_render_type'] == 1 && $mode != "extend") {
+			if (function_exists("news_list")) {
+				$NEWS_PARSE = news_list($news);
+			} else if ($NEWSLISTSTYLE) {
+				$NEWS_PARSE = $NEWSLISTSTYLE;
+			} else {
+				$NEWS_PARSE = "{NEWSICON}&nbsp;<b>{NEWSTITLELINK}</b><div class='smalltext'>{NEWSAUTHOR} ".LAN_100." {NEWSDATE} | {NEWSCOMMENTS}</div>";
+			}
+		} else {
+			if ($NEWS_TEMPLATE) {
+				$NEWS_PARSE = $NEWS_TEMPLATE;
+			} else {
+				if (function_exists("news_style")) {
+					$NEWS_PARSE = news_style($news);
+				} else {
+					$NEWS_PARSE = $NEWSSTYLE;
+				}
+			}
+		}
+
+		require_once(e_FILE.'shortcode/batch/news_shortcodes.php');
+		$text = $tp -> parseTemplate($NEWS_PARSE, FALSE, $news_shortcodes);
+
+		if ($mode == 'return') {
+			return $text;
+		} else {
+			echo $text;
+			return TRUE;
+		}		
+	}
+
+	function make_xml_compatible($original) {
+		global $tp, $ml;
+		if (!is_object($tp)) $tp = new e_parse;
+		$original = $tp->toHTML($original, TRUE);
+		$original = str_replace('&pound', '&amp;#163;', $original);
+		$original = str_replace('&copy;', '(c)', $original);
+		return htmlspecialchars($original);
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/notify_class.php 75/e107_handlers/notify_class.php
--- 6171/e107_handlers/notify_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/notify_class.php	2006-04-10 20:43:42.000000000 -0500
@@ -0,0 +1,134 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/notify_class.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2006/04/11 01:43:42 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class notify {
+	
+	var $notify_prefs;
+	
+	function notify() {
+		global $sysprefs, $e_event, $eArrayStorage;
+		$this -> notify_prefs = $sysprefs -> get('notify_prefs');
+		$this -> notify_prefs = $eArrayStorage -> ReadArray($this -> notify_prefs);
+		foreach ($this -> notify_prefs['event'] as $id => $status) {
+			if ($status['type'] != 'off') {
+				$e_event -> register($id, 'notify_'.$id);
+			}
+		}
+		
+		if(defined("e_LANGUAGE") && is_readable(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php')) {
+			include_once(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php');
+		} else {
+			include_once(e_LANGUAGEDIR.'English/lan_notify.php');
+		}
+	}
+	
+	function send($id, $subject, $message) {
+		global $sql;
+		e107_require_once(e_HANDLER.'mail.php');
+		$subject = SITENAME.': '.$subject;
+		if ($this -> notify_prefs['event'][$id]['type'] == 'main') {
+			sendemail(SITEADMINEMAIL, $subject, $message);
+		} else if ($this -> notify_prefs['event'][$id]['type'] == 'class') {
+			if ($this -> notify_prefs['event'][$id]['class'] == '254') {
+				$sql -> db_Select('user', 'user_email', "user_admin = 1");
+			} else if ($this -> notify_prefs['event'][$id]['class'] == '253') {
+				$sql -> db_Select('user', 'user_email');
+			} else {
+				$sql -> db_Select('user', 'user_email', "user_class REGEXP '(^|,)(".$this -> notify_prefs['event'][$id]['class'].")(,|$)'");
+			}
+			while ($email = $sql -> db_Fetch()) {
+				sendemail($email['user_email'], $subject, $message);
+			}
+		} else if ($this -> notify_prefs['event'][$id]['type'] == 'email') {
+			sendemail($this -> notify_prefs['event'][$id]['email'], $subject, $message);
+		}
+	}
+}
+
+global $nt;
+$nt = new notify;
+
+function notify_usersup($data) {
+	global $nt;
+	foreach ($data as $key => $value) {
+		$message .= $key.': '.$value.'<br />';
+	}
+	$nt -> send('usersup', NT_LAN_US_1, $message);
+}
+
+function notify_userveri($data) {
+	global $nt, $e107;
+	$msgtext = NT_LAN_UV_2.$data['user_id']."\n";
+	$msgtext .= NT_LAN_UV_3.$data['user_loginname']."\n";
+	$msgtext .= NT_LAN_UV_2.$e107->getip();
+	$nt -> send('userveri', NT_LAN_UV_1, $msgtext);
+}
+
+function notify_login($data) {
+	global $nt;
+	foreach ($data as $key => $value) {
+		$message .= $key.': '.$value.'<br />';
+	}
+	$nt -> send('login', NT_LAN_LI_1, $message);
+}
+
+function notify_logout() {
+	global $nt;
+	$nt -> send('logout', NT_LAN_LO_1, USERID.'. '.USERNAME.' '.NT_LAN_LO_2);
+}
+
+function notify_flood($data) {
+	global $nt;
+	$nt -> send('flood', NT_LAN_FL_1, NT_LAN_FL_2.': '.$data);
+}
+
+function notify_subnews($data) {
+	global $nt;
+	foreach ($data as $key => $value) {
+		$message .= $key.': '.$value.'<br />';
+	}
+	$nt -> send('subnews', NT_LAN_SN_1, $message);
+}
+
+function notify_newspost($data) {
+	global $nt;
+	$message = '<b>'.$data['news_title'].'</b><br /><br />'.$data['news_summary'].'<br /><br />'.$data['data'].'<br /><br />'.$data['news_extended'];
+	$nt -> send('newspost', $data['news_title'], $message);
+}
+
+function notify_newsupd($data) {
+	global $nt;
+	$message = '<b>'.$data['news_title'].'</b><br /><br />'.$data['news_summary'].'<br /><br />'.$data['data'].'<br /><br />'.$data['news_extended'];
+	$nt -> send('newsupd', NT_LAN_NU_1.': '.$data['news_title'], $message);
+}
+
+function notify_newsdel($data) {
+	global $nt;
+	$nt -> send('newsdel', NT_LAN_ND_1, NT_LAN_ND_2.': '.$data);
+}
+
+if (isset($nt -> notify_prefs['plugins'])) {
+	foreach ($nt -> notify_prefs['plugins'] as $plugin_id => $plugin_settings) {
+		require_once(e_PLUGIN.$plugin_id.'/e_notify.php');
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/np_class.php 75/e107_handlers/np_class.php
--- 6171/e107_handlers/np_class.php	2004-04-07 13:50:02.000000000 -0500
+++ 75/e107_handlers/np_class.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,132 +1,101 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/np_class.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-@include(e_LANGUAGEDIR.e_LANGUAGE."/lan_np.php");
-@include(e_LANGUAGEDIR."English/lan_np.php");
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-class nextprev{
-	function nextprev($url, $from, $view, $total, $td, $qs=""){
-		/*
-		# Next previous pages
-		# - parameter #1:		string $url, refer url
-		# - parameter #2:		int $from, start figure
-		# - parameter #3:		int $view, items per page
-		# - parameter #4:		int $total, total items
-		# - parameter #5:		string $td, comfort text
-		# - parameter #6:		string $qs, QUERY_STRIING, default null
-		# - return				null
-		# - scope					public
-		*/
-
-
-		//	alternative next_prev, uncomment to use -------------------------------------------------------------------------------------------------
-		
-
-		if($total > $view){
-			$a = $total/$view;
-			$r = explode(".", $a);
-			if($r[1] != 0 ? $pages = ($r[0]+1) : $pages = $r[0]);
-		}else{
-			$pages = FALSE;
-		}
-
-		if($pages){
-			$nppage= NP_3." ";
-			if($pages > 10){
-				$current = ($from/$view)+1;
-
-				for($c=0; $c<=2; $c++){
-					$nppage .= ($view*$c == $from ? "[<span style='text-decoration:underline'>".($c+1)."</span>] " : "<a href='$url?".($view*$c).($qs ? ".".$qs : "")."'>".($c+1)."</a> ");
-				}
-
-				if($current >=3 && $current <= 5){
-					for($c=3; $c<=$current; $c++){
-						$nppage .= ($view*$c == $from ? "[<span style='text-decoration:underline'>".($c+1)."</span>] " : "<a href='$url?".($view*$c).($qs ? ".".$qs : "")."'>".($c+1)."</a> ");
-					}
-				}else if($current >= 6 && $current <= ($pages-5)){
-					$nppage .= " ... ";
-					for($c=($current-2); $c<=$current; $c++){
-						$nppage .= ($view*$c == $from ? "[<span style='text-decoration:underline'>".($c+1)."</span>] " : "<a href='$url?".($view*$c).($qs ? ".".$qs : "")."'>".($c+1)."</a> ");
-					}
-				}
-				$nppage .= " ... ";
-				
-
-				if(($current+5) > $pages && $current != $pages){
-					$tmp = ($current-2);
-				}else{
-					$tmp = $pages-3;
-				}
-
-				for($c=$tmp; $c<=($pages-1); $c++){
-					$nppage .= ($view*$c == $from ? "[<span style='text-decoration:underline'>".($c+1)."</span>] " : "<a href='$url?".($view*$c).($qs ? ".".$qs : "")."'>".($c+1)."</a> ");
-				}
-
-			}else{
-				for($c=0; $c < $pages; $c++){
-					if($view*$c == $from ? $nppage .= "[<span style='text-decoration:underline'>".($c+1)."</span>] " : $nppage .= "<a href='$url?".($view*$c).($qs ? ".".$qs : "")."'>".($c+1)."</a> ");
-				}
-			}
-			$text = "<div style='text-align:right'><div class='nextprev'><span class='smalltext'>".$nppage."</span></div></div><br /><br />";
-			echo $text;
-		}
-		
-	}
-		//	end alternative next_prev ------------------------------------------------------------------------------------------------------------------------
-
-		
-	
-/*
-		if($total == 0){ return;}
-		$ns = new e107table;
-		echo "<table style='width:100%'>\n<tr>\n";
-		if($from > 1){
-			$s = $from-$view;
-			echo "<td style='width:33%' class='nextprev'>";
-			if($qs){
-				$text = "<div style='text-align:left'><span class='smalltext'><a href='".$url."?".$s.".".$qs."'>".NP_1."</a></span></div>";
-			}else{
-				$text = "<div style='text-align:left'><span class='smalltext'><a href='".$url."?".$s."'>".NP_1."</a></span></div>";
-			}
-			echo $text;
-		}else{
-			echo "<td style='width:33%'>&nbsp;";
-		}
-	 
-		echo "</td>\n<td style='width:34%' class='nextprev'>\n";
-		$start = $from+1;
-		$finish = $from+$view;
-		if($finish>$total){ $finish = $total; }
-		$text = "<div style='text-align:center'><span class='smalltext'>$td $start - $finish of $total</span></div>";
-		echo $text;
-	 
-		$s = $from+$view;
-		if($s < $total){
-			echo "</td><td style='width:33%' class='nextprev'>";
-			if($qs != ""){
-				$text = "<div style='text-align:right'><span class='smalltext'><a href='".$url."?".$s.".".$qs."'>".NP_2."</a></span></div></td>";
-			}else{
-				$text = "<div style='text-align:right'><span class='smalltext'><a href='".$url."?".$s."'>".NP_2."</a></span></div></td>";
-			}
-			echo $text;
-		}else{
-			echo "</td><td style='width:33%'>&nbsp;</td>";
-		}
-		echo "</tr>\n</table>";
-
-	}
-	*/
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/np_class.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_np.php");
+@include_once(e_LANGUAGEDIR."English/lan_np.php");
+
+/**
+ * Next / Previous handling class
+ *
+ */
+class nextprev {
+	
+	/**
+	 * Generate next / previous pages and appropriate links (
+	 *
+	 * @param string $url, refer url
+	 * @param int $from, start figure
+	 * @param int $view, items per page
+	 * @param int $total, total items
+	 * @param string $td, comfort text
+	 * @param string $qs, QUERY_STRING, default null
+	 * @param bool $return, Output onto page or return the links
+	 * @return nextprev string
+	 */
+	function nextprev($url, $from, $view, $total, $td, $qs = "", $return = false) {
+		if ($total > $view) {
+			$a = $total / $view;
+			$r = explode(".", $a);
+			if (isset($r[1]) && $r[1] != 0 ? $pages = ($r[0] + 1) : $pages = $r[0]);
+		} else {
+			$pages = FALSE;
+		}
+
+		if ($pages) {
+			$nppage = NP_3." ";
+			if ($pages > 10) {
+				$current = ($from/$view)+1;
+
+				for($c = 0; $c <= 2; $c++) {
+					$nppage .= ($view * $c == $from ? "[<span style='text-decoration:underline'>".($c + 1)."</span>] " : "<a href='{$url}?".($view * $c).($qs ? ".{$qs}" : "")."'>".($c + 1)."</a> ");
+				}
+
+				if ($current >= 3 && $current <= 5) {
+					for($c = 3; $c <= $current; $c++) {
+						$nppage .= ($view * $c == $from ? "[<span style='text-decoration:underline'>".($c+1)."</span>] " : "<a href='{$url}?".($view * $c).($qs ? ".{$qs}" : "")."'>".($c + 1)."</a> ");
+					}
+				}
+				else if($current >= 6 && $current <= ($pages-5)) {
+					$nppage .= " ... ";
+					for($c = ($current-2); $c <= $current; $c++) {
+						$nppage .= ($view * $c == $from ? "[<span style='text-decoration:underline'>".($c+1)."</span>] " : "<a href='{$url}?".($view * $c).($qs ? ".{$qs}" : "")."'>".($c + 1)."</a> ");
+					}
+				}
+				$nppage .= " ... ";
+
+
+				if (($current + 5) > $pages && $current != $pages) {
+					$tmp = ($current-2);
+				} else {
+					$tmp = $pages-3;
+				}
+
+				for($c = $tmp; $c <= ($pages-1); $c++) {
+					$nppage .= ($view * $c == $from ? "[<span style='text-decoration:underline'>".($c + 1)."</span>] " : "<a href='{$url}?".($view * $c).($qs ? ".{$qs}" : "")."'>".($c + 1)."</a> ");
+				}
+
+			} else {
+				for($c = 0; $c < $pages; $c++) {
+					if ($view * $c == $from ? $nppage .= "[<span style='text-decoration:underline'>".($c + 1)."</span>] " : $nppage .= "<a href='{$url}?".($view * $c).($qs ? ".{$qs}" : "")."'>".($c + 1)."</a> ");
+				}
+			}
+			$text = "<div style='text-align:right'><div class='nextprev'><span class='smalltext'>{$nppage}</span></div></div>\n<br /><br />\n";
+			if($return == true){
+				return $text;
+			} else {
+				echo $text;
+				return null;
+			}
+		}
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/override_class.php 75/e107_handlers/override_class.php
--- 6171/e107_handlers/override_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/override_class.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,52 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/override_class.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+class override {
+	var $functions = array();
+	var $includes = array();
+	 
+	function override_function($override, $function, $include) {
+		if ($include) {
+			$this->includes[$override] = $include;
+		}
+		else if (isset($this->includes[$override])) {
+			unset($this->includes[$override]);
+		}
+		$this->functions[$override] = $function;
+	}
+	 
+	function override_check($override) {
+		if (isset($this->includes[$override])) {
+			if (file_exists($this->includes[$override])) {
+				include_once($this->includes[$override]);
+			}
+			if (function_exists($this->functions[$override])) {
+				return $this->functions[$override];
+			} else {
+				return false;
+			}
+		} else {
+			return false;
+		}
+	}
+}
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/parse/parse_avatar.php 75/e107_handlers/parse/parse_avatar.php
--- 6171/e107_handlers/parse/parse_avatar.php	2004-05-14 17:37:54.000000000 -0500
+++ 75/e107_handlers/parse/parse_avatar.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,25 +0,0 @@
-<?php
-function parse_avatar($match,$referrer){
-	$m = explode(".",$match[1]);
-	if(is_numeric($m[2])){
-		if($m[2] == USERID){
-			$image = USERIMAGE;
-		} else {
-			$sql2 = new db;
-			$sql2 -> db_Select("user","user_image","user_id = '{$m[2]}'");
-			$row = $sql2 -> db_Fetch();
-			$image=$row['user_image'];
-		}
-	} elseif($m[2]) {
-		$image=$m[2];
-	} else {
-		$image = USERIMAGE;
-	}
-	if($image){
-		require_once(e_HANDLER."avatar_handler.php");
-		return "<img src='".avatar($image)."' alt='' />";
-	} else {
-		return "";
-	}
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/parse/parse_emailto.php 75/e107_handlers/parse/parse_emailto.php
--- 6171/e107_handlers/parse/parse_emailto.php	2004-05-14 17:37:54.000000000 -0500
+++ 75/e107_handlers/parse/parse_emailto.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,13 +0,0 @@
-<?php
-function parse_emailto($match,$referrer){
-	global $pref;
-	$image = (file_exists(THEME."forum/email.png")) ? "<img src='".THEME."forum/email.png' alt='' style='border:0' />" : "<img src='".e_IMAGE."forum/email.png' alt='' style='border:0' />";
-	$m = explode(".",$match[1],3);
-	if(is_numeric($m[2])){
-		if(!$pref['emailusers']){return "";}
-		return "<a href='".e_BASE."emailmember.php?id.{$match[2]}'>{$image}</a>";
-	} else {
-		return "<a href='mailto:{$m[2]}'>{$image}</a>";
-	}
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/parse/parse_menu.php 75/e107_handlers/parse/parse_menu.php
--- 6171/e107_handlers/parse/parse_menu.php	2004-05-14 21:25:02.000000000 -0500
+++ 75/e107_handlers/parse/parse_menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,18 +0,0 @@
-<?php
-function parse_menu($match,$referrer){
-	if($referrer != 'admin'){return "";}
-	global $pref,$ns,$menu_pref,$sql,$aj;
-	$m = explode(".",$match[1]);
-	$fname = e_PLUGIN."{$m[2]}/{$m[2]}.php";
-   @include_once(e_PLUGIN."{$m[2]}/languages/".e_LANGUAGE.".php");
-	@include_once(e_PLUGIN."{$m[2]}/languages/English.php");
-	if(file_exists($fname)){
-		ob_end_flush();
-		ob_start();
-		require($fname);
-		$ret = ob_get_contents();
-		ob_end_clean();
-		return $ret;
-	}
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/parse/parse_picture.php 75/e107_handlers/parse/parse_picture.php
--- 6171/e107_handlers/parse/parse_picture.php	2004-05-14 17:37:54.000000000 -0500
+++ 75/e107_handlers/parse/parse_picture.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,24 +0,0 @@
-<?php
-function parse_picture($match,$referrer){
-	$m = explode(".",$match[1]);
-	if(is_numeric($m[2])){
-		if($m[2] == USERID){
-			$image = USERSESS;
-		} else {
-			$sql2 = new db;
-			$sql2 -> db_Select("user","user_sess","user_id = '{$m[2]}'");
-			$row = $sql2 -> db_Fetch();
-			$image=$row['user_sess'];
-		}
-	} elseif($m[2]) {
-		$image=$m[2];
-	} else {
-		$image = USERSESS;
-	}
-	if($image && file_exists(e_FILE."public/avatars/".$image)){
-		return "<img src='".e_FILE."public/avatars/{$image}' alt='' />";
-	} else {
-		return "";
-	}
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/parse/parse_profile.php 75/e107_handlers/parse/parse_profile.php
--- 6171/e107_handlers/parse/parse_profile.php	2004-05-14 17:37:54.000000000 -0500
+++ 75/e107_handlers/parse/parse_profile.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,8 +0,0 @@
-<?php
-function parse_profile($match,$referrer){
-	$m = explode(".",$match[1]);
-	$id = ($m[2]) ? $m[2] : USERID;
-	$image = (file_exists(THEME."forum/profile.png")) ? "<img src='".THEME."forum/profile.png' alt='' style='border:0' />" : "<img src='".e_IMAGE."forum/profile.png' alt='' style='border:0' />";
-	return "<a href='".e_BASE."user.php?id.{$id}'>{$image}</a>";
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/parse/parse_username.php 75/e107_handlers/parse/parse_username.php
--- 6171/e107_handlers/parse/parse_username.php	2004-05-14 17:37:54.000000000 -0500
+++ 75/e107_handlers/parse/parse_username.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,5 +0,0 @@
-<?php
-function parse_username($match,$referrer){
-	return (USER) ? USERNAME : LAN_GUEST;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/parser_functions.php 75/e107_handlers/parser_functions.php
--- 6171/e107_handlers/parser_functions.php	2004-05-14 17:37:52.000000000 -0500
+++ 75/e107_handlers/parser_functions.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,17 +1,28 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107_handlers/parser_functions.php
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-@include(e_LANGUAGEDIR.e_LAN."/lan_parser_functions.php");
-@include(e_LANGUAGEDIR."English/lan_parser_functions.php");
-function e107core_parse($match,$referrer){
-	global $pref;
-}
-
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/parser_functions.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LAN."/lan_parser_functions.php");
+@include_once(e_LANGUAGEDIR."English/lan_parser_functions.php");
+function e107core_parse($match, $referrer) {
+	global $pref;
+}
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/parser_handler.php 75/e107_handlers/parser_handler.php
--- 6171/e107_handlers/parser_handler.php	2004-04-06 22:07:14.000000000 -0500
+++ 75/e107_handlers/parser_handler.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,61 +1,69 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107_handlers/parser_class.php
-|
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-
-function register_parser($plugin_name,$regexp) {
-	if($plugin_name != '' OR $regexp != '') {
-		if(file_exists(e_PLUGIN."{$plugin_name}/parser.php")) {
-			require_once(e_PLUGIN."{$plugin_name}/parser.php");
-			if(function_exists($plugin_name.'_parse')) {
-				if(IsRegExp($regexp)) {
-					$oursql = new db;
-					$oursql -> db_Select("parser", "*", "parser_pluginname='".$plugin_name."' AND parser_regexp='".$regexp."'");
-					if ($row = $oursql -> db_Fetch()) {
-						// Already exists, handle error if needed.
-					} else {
-						$regexp = str_replace("\\" , "\\\\", $regexp);
-						$oursql -> db_Insert("parser", "0, '".$plugin_name."', '".$regexp."'");
-						return 1;
-					}
-				} else {
-					// handle error if wanted to - not a valid regexp
-				}
-			} else {
-				// handle error if wanted to - function does not exist
-			}
-		} else {
-			// handle error if wanted to - Unable to include file
-		}
-	} else {
-		// handle error if wanted to - plugin name or regexp value empty
-	}
-}
-
-function IsRegExp($sREGEXP) {
-	$sPREVIOUSHANDLER = Set_Error_Handler("TrapError");
-	Preg_Match ($sREGEXP, "");
-	Restore_Error_Handler ($sPREVIOUSHANDLER);
-	Return !TrapError ();
-}
-
-function TrapError () {
-	Static $iERRORES;
-	if(!Func_Num_Args())  {
-		$iRETORNO = $iERRORES;
-		$iERRORES = 0;
-		return $iRETORNO;
-	} else {
-		$iERRORES++;
-	}
-}
-
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/parser_handler.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+function register_parser($plugin_name, $regexp) {
+	if ($plugin_name != '' OR $regexp != '') {
+		if (file_exists(e_PLUGIN."{$plugin_name}/parser.php")) {
+			require_once(e_PLUGIN."{$plugin_name}/parser.php");
+			if (function_exists($plugin_name.'_parse')) {
+				if (IsRegExp($regexp)) {
+					$oursql = new db;
+					$oursql->db_Select("parser", "*", "parser_pluginname = '{$plugin_name}' AND parser_regexp = '{$regexp}'");
+					if ($row = $oursql->db_Fetch()) {
+						// Already exists, handle error if needed.
+					} else {
+						$regexp = str_replace("\\" , "\\\\", $regexp);
+						$oursql->db_Insert("parser", "0, '{$plugin_name}', '{$regexp}'");
+						return 1;
+					}
+				} else {
+					// handle error if wanted to - not a valid regexp
+				}
+			} else {
+				// handle error if wanted to - function does not exist
+			}
+		} else {
+			// handle error if wanted to - Unable to include file
+		}
+	} else {
+		// handle error if wanted to - plugin name or regexp value empty
+	}
+}
+	
+function IsRegExp($sREGEXP) {
+	$sPREVIOUSHANDLER = Set_Error_Handler("TrapError");
+	Preg_Match ($sREGEXP, "");
+	Restore_Error_Handler ($sPREVIOUSHANDLER);
+	Return !TrapError ();
+}
+	
+function TrapError () {
+	Static $iERRORES;
+	if (!Func_Num_Args()) {
+		$iRETORNO = $iERRORES;
+		$iERRORES = 0;
+		return $iRETORNO;
+	} else {
+		$iERRORES++;
+	}
+}
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/pclerror.lib.php 75/e107_handlers/pclerror.lib.php
--- 6171/e107_handlers/pclerror.lib.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/pclerror.lib.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,134 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+// --------------------------------------------------------------------------------
+// PhpConcept Library (PCL) Error 1.0
+// --------------------------------------------------------------------------------
+// License GNU/GPL - Vincent Blavet - Mars 2001
+// http://www.phpconcept.net & http://phpconcept.free.fr
+// --------------------------------------------------------------------------------
+// Franais :
+//   La description de l'usage de la librairie PCL Error 1.0 n'est pas encore
+//   disponible. Celle-ci n'est pour le moment distribue qu'avec les
+//   dveloppements applicatifs de PhpConcept.
+//   Une version indpendante sera bientot disponible sur http://www.phpconcept.net
+//
+// English :
+//   The PCL Error 1.0 library description is not available yet. This library is
+//   released only with PhpConcept application and libraries.
+//   An independant release will be soon available on http://www.phpconcept.net
+//
+// --------------------------------------------------------------------------------
+//
+//   * Avertissement :
+//
+//   Cette librairie a t cre de faon non professionnelle.
+//   Son usage est au risque et pril de celui qui l'utilise, en aucun cas l'auteur
+//   de ce code ne pourra tre tenu pour responsable des ventuels dgats qu'il pourrait
+//   engendrer.
+//   Il est entendu cependant que l'auteur a ralis ce code par plaisir et n'y a
+//   cach aucun virus, ni malveillance.
+//   Cette libairie est distribue sous la license GNU/GPL (http://www.gnu.org)
+//
+//   * Auteur :
+//
+//   Ce code a t crit par Vincent Blavet (vincent@blavet.net) sur son temps
+//   de loisir.
+//
+// --------------------------------------------------------------------------------
+
+// ----- Look for double include
+if (!defined("PCLERROR_LIB"))
+{
+  define( "PCLERROR_LIB", 1 );
+
+  // ----- Version
+  $g_pcl_error_version = "1.0";
+
+  // ----- Internal variables
+  // These values must only be change by PclError library functions
+  $g_pcl_error_string = "";
+  $g_pcl_error_code = 1;
+
+
+  // --------------------------------------------------------------------------------
+  // Function : PclErrorLog()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function PclErrorLog($p_error_code=0, $p_error_string = "")
+  {
+    global $g_pcl_error_string;
+    global $g_pcl_error_code;
+
+    $g_pcl_error_code = $p_error_code;
+    $g_pcl_error_string = $p_error_string;
+
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclErrorFatal()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function PclErrorFatal($p_file, $p_line, $p_error_string = "")
+  {
+    global $g_pcl_error_string;
+    global $g_pcl_error_code;
+
+    $v_message =  "<html><body>";
+    $v_message .= "<p align=center><font color=red bgcolor=white><b>PclError Library has detected a fatal error on file '{$p_file}', line {$p_line}</b></font></p>";
+    $v_message .= "<p align=center><font color=red bgcolor=white><b>{$p_error_string}</b></font></p>";
+    $v_message .= "</body></html>";
+    die($v_message);
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclErrorReset()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function PclErrorReset()
+  {
+    global $g_pcl_error_string;
+    global $g_pcl_error_code;
+
+    $g_pcl_error_code = 1;
+    $g_pcl_error_string = "";
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclErrorCode()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function PclErrorCode()
+  {
+    global $g_pcl_error_string;
+    global $g_pcl_error_code;
+    
+    return($g_pcl_error_code);
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclErrorString()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function PclErrorString()
+  {
+    global $g_pcl_error_string;
+    global $g_pcl_error_code;
+
+    return($g_pcl_error_string." [code {$g_pcl_error_code}]");
+  }
+  // --------------------------------------------------------------------------------
+
+
+// ----- End of double include look
+}
+?>
diff -ruN 6171/e107_handlers/pcltar.lib.php 75/e107_handlers/pcltar.lib.php
--- 6171/e107_handlers/pcltar.lib.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/pcltar.lib.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,3559 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+// --------------------------------------------------------------------------------
+// PhpConcept Library - Tar Module 1.3
+// --------------------------------------------------------------------------------
+// License GNU/GPL - Vincent Blavet - August 2001
+// http://www.phpconcept.net
+// --------------------------------------------------------------------------------
+//
+// Presentation :
+//   PclTar is a library that allow you to create a GNU TAR + GNU ZIP archive,
+//   to add files or directories, to extract all the archive or a part of it.
+//   So far tests show that the files generated by PclTar are readable by
+//   gzip tools and WinZip application.
+//
+// Description :
+//   See readme.txt (English & Franais) and http://www.phpconcept.net
+//
+// Warning :
+//   This library and the associated files are non commercial, non professional
+//   work.
+//   It should not have unexpected results. However if any damage is caused by
+//   this software the author can not be responsible.
+//   The use of this software is at the risk of the user.
+//
+// --------------------------------------------------------------------------------
+
+// ----- Look for double include
+if (!defined("PCL_TAR"))
+{
+  define( "PCL_TAR", 1 );
+
+  // ----- Configuration variable
+  // Theses values may be changed by the user of PclTar library
+  if (!isset($g_pcltar_lib_dir))
+    $g_pcltar_lib_dir = e_PLUGIN;
+
+  // ----- Error codes
+  //   -1 : Unable to open file in binary write mode
+  //   -2 : Unable to open file in binary read mode
+  //   -3 : Invalid parameters
+  //   -4 : File does not exist
+  //   -5 : Filename is too long (max. 99)
+  //   -6 : Not a valid tar file
+  //   -7 : Invalid extracted file size
+  //   -8 : Unable to create directory
+  //   -9 : Invalid archive extension
+  //  -10 : Invalid archive format
+  //  -11 : Unable to delete file (unlink)
+  //  -12 : Unable to rename file (rename)
+  //  -13 : Invalid header checksum
+
+
+// --------------------------------------------------------------------------------
+// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED *****
+// --------------------------------------------------------------------------------
+
+  // ----- Global variables
+  $g_pcltar_version = "1.3";
+
+  // ----- Extract extension type (.php3/.php/...)
+  $g_pcltar_extension = substr(strrchr(basename($PATH_TRANSLATED), '.'), 1);
+
+  // ----- Include other libraries
+  // This library should be called by each script before the include of PhpZip
+  // Library in order to limit the potential 'lib' directory path problem.
+  if (!defined("PCLERROR_LIB"))
+  {
+    include_once("pclerror.lib.php");
+  }
+  if (!defined("PCLTRACE_LIB"))
+  {
+    include_once("pcltrace.lib.php");
+  }
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarCreate()
+  // Description :
+  //   Creates a new archive with name $p_tarname containing the files and/or
+  //   directories indicated in $p_list. If the tar filename extension is
+  //   ".tar", the file will not be compressed. If it is ".tar.gz" or ".tgz"
+  //   it will be a gzip compressed tar archive.
+  //   If you want to use an other extension, you must indicate the mode in
+  //   $p_mode ("tar" or "tgz").
+  //   $p_add_dir and $p_remove_dir give you the ability to store a path
+  //   which is not the real path of the files.
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file
+  //   $p_filelist : An array containing file or directory names, or
+  //                 a string containing one filename or directory name, or
+  //                 a string containing a list of filenames and/or directory
+  //                 names separated by spaces.
+  //   $p_mode : "tar" for normal tar archive, "tgz" for gzipped tar archive,
+  //             if $p_mode is not specified, it will be determined by the extension.
+  //   $p_add_dir : Path to add in the filename path archived
+  //   $p_remove_dir : Path to remove in the filename path archived
+  // Return Values :
+  //   1 on success, or an error code (see table at the beginning).
+  // --------------------------------------------------------------------------------
+  function PclTarCreate($p_tarname, $p_filelist = "", $p_mode = "", $p_add_dir = "", $p_remove_dir = "")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarCreate", "tar={$p_tarname}, file='{$p_filelist}', mode={$p_mode}, add_dir='{$p_add_dir}', remove_dir='{$p_remove_dir}'");
+    $v_result=1;
+
+    // ----- Look for default mode
+    if (($p_mode == "") || (($p_mode != "tar") && ($p_mode != "tgz")))
+    {
+      // ----- Extract the tar format from the extension
+      if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Trace
+      TrFctMessage(__FILE__, __LINE__, 1, "Auto mode selected : found {$p_mode}");
+    }
+
+    // ----- Look if the $p_filelist is really an array
+    if (is_array($p_filelist))
+    {
+      // ----- Call the create fct
+      $v_result = PclTarHandleCreate($p_tarname, $p_filelist, $p_mode, $p_add_dir, $p_remove_dir);
+    }
+
+    // ----- Look if the $p_filelist is a string
+    else if (is_string($p_filelist))
+    {
+      // ----- Create a list with the elements from the string
+      $v_list = explode(" ", $p_filelist);
+
+      // ----- Call the create fct
+      $v_result = PclTarHandleCreate($p_tarname, $v_list, $p_mode, $p_add_dir, $p_remove_dir);
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid variable type p_filelist");
+      $v_result = -3;
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarAdd()
+  // Description :
+  //   PLEASE DO NOT USE ANY MORE THIS FUNCTION. Use PclTarAddList().
+  //
+  //   This function is maintained only for compatibility reason
+  //
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file
+  //   $p_filelist : An array containing file or directory names, or
+  //                 a string containing one filename or directory name, or
+  //                 a string containing a list of filenames and/or directory
+  //                 names separated by spaces.
+  // Return Values :
+  //   1 on success,
+  //   Or an error code (see list on top).
+  // --------------------------------------------------------------------------------
+  function PclTarAdd($p_tarname, $p_filelist)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarAdd", "tar={$p_tarname}, file={$p_filelist}");
+    $v_result=1;
+    $v_list_detail = array();
+
+    // ----- Extract the tar format from the extension
+    if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+    {
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Look if the $p_filelist is really an array
+    if (is_array($p_filelist))
+    {
+      // ----- Call the add fct
+      $v_result = PclTarHandleAppend($p_tarname, $p_filelist, $p_mode, $v_list_detail, "", "");
+    }
+
+    // ----- Look if the $p_filelist is a string
+    else if (is_string($p_filelist))
+    {
+      // ----- Create a list with the elements from the string
+      $v_list = explode(" ", $p_filelist);
+
+      // ----- Call the add fct
+      $v_result = PclTarHandleAppend($p_tarname, $v_list, $p_mode, $v_list_detail, "", "");
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid variable type p_filelist");
+      $v_result = -3;
+    }
+
+    // ----- Cleaning
+    unset($v_list_detail);
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarAddList()
+  // Description :
+  //   Add a list of files or directories ($p_filelist) in the tar archive $p_tarname.
+  //   The list can be an array of file/directory names or a string with names
+  //   separated by one space.
+  //   $p_add_dir and $p_remove_dir will give the ability to memorize a path which is
+  //   different from the real path of the file. This is usefull if you want to have PclTar
+  //   running in any directory, and memorize relative path from an other directory.
+  //   If $p_mode is not set it will be automatically computed from the $p_tarname
+  //   extension (.tar, .tar.gz or .tgz).
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file
+  //   $p_filelist : An array containing file or directory names, or
+  //                 a string containing one filename or directory name, or
+  //                 a string containing a list of filenames and/or directory
+  //                 names separated by spaces.
+  //   $p_add_dir : Path to add in the filename path archived
+  //   $p_remove_dir : Path to remove in the filename path archived
+  //   $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension
+  // Return Values :
+  //   1 on success,
+  //   Or an error code (see list on top).
+  // --------------------------------------------------------------------------------
+  function PclTarAddList($p_tarname, $p_filelist, $p_add_dir="", $p_remove_dir="", $p_mode="")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarAddList", "tar={$p_tarname}, file={$p_filelist}, p_add_dir='{$p_add_dir}', p_remove_dir='{$p_remove_dir}', mode={$p_mode}");
+    $v_result=1;
+    $p_list_detail = array();
+
+    // ----- Extract the tar format from the extension
+    if (($p_mode == "") || (($p_mode != "tar") && ($p_mode != "tgz")))
+    {
+      if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+    }
+
+    // ----- Look if the $p_filelist is really an array
+    if (is_array($p_filelist))
+    {
+      // ----- Call the add fct
+      $v_result = PclTarHandleAppend($p_tarname, $p_filelist, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir);
+    }
+
+    // ----- Look if the $p_filelist is a string
+    else if (is_string($p_filelist))
+    {
+      // ----- Create a list with the elements from the string
+      $v_list = explode(" ", $p_filelist);
+
+      // ----- Call the add fct
+      $v_result = PclTarHandleAppend($p_tarname, $v_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir);
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid variable type p_filelist");
+      $v_result = -3;
+    }
+
+    // ----- Return
+    if ($v_result != 1)
+    {
+      TrFctEnd(__FILE__, __LINE__, 0);
+      return 0;
+    }
+    TrFctEnd(__FILE__, __LINE__, $p_list_detail);
+    return $p_list_detail;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarList()
+  // Description :
+  //   Gives the list of all the files present in the tar archive $p_tarname.
+  //   The list is the function result, it will be 0 on error.
+  //   Depending on the $p_tarname extension (.tar, .tar.gz or .tgz) the
+  //   function will determine the type of the archive.
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file
+  //   $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension
+  // Return Values :
+  //  0 on error (Use PclErrorCode() and PclErrorString() for more info)
+  //  or
+  //  An array containing file properties. Each file properties is an array of
+  //  properties.
+  //  The properties (array field names) are :
+  //    filename, size, mode, uid, gid, mtime, typeflag, status
+  //  Exemple : $v_list = PclTarList("my.tar");
+  //            for ($i=0; $i<sizeof($v_list); $i++)
+  //              echo "Filename :'".$v_list[$i][filename]."'<br>";
+  // --------------------------------------------------------------------------------
+  function PclTarList($p_tarname, $p_mode="")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarList", "tar={$p_tarname}, mode='{$p_mode}'");
+    $v_result=1;
+
+    // ----- Extract the tar format from the extension
+    if (($p_mode == "") || (($p_mode != "tar") && ($p_mode != "tgz")))
+    {
+      if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return 0;
+      }
+    }
+
+    // ----- Call the extracting fct
+    $p_list = array();
+    if (($v_result = PclTarHandleExtract($p_tarname, 0, $p_list, "list", "", $p_mode, "")) != 1)
+    {
+      unset($p_list);
+      TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+      return(0);
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarExtract()
+  // Description :
+  //   Extract all the files present in the archive $p_tarname, in the directory
+  //   $p_path. The relative path of the archived files are keep and become
+  //   relative to $p_path.
+  //   If a file with the same name already exists it will be replaced.
+  //   If the path to the file does not exist, it will be created.
+  //   Depending on the $p_tarname extension (.tar, .tar.gz or .tgz) the
+  //   function will determine the type of the archive.
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file.
+  //   $p_path : Path where the files will be extracted. The files will use
+  //             their memorized path from $p_path.
+  //             If $p_path is "", files will be extracted in "./".
+  //   $p_remove_path : Path to remove (from the file memorized path) while writing the
+  //                    extracted files. If the path does not match the file path,
+  //                    the file is extracted with its memorized path.
+  //                    $p_path and $p_remove_path are commulative.
+  //   $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension
+  // Return Values :
+  //   Same as PclTarList()
+  // --------------------------------------------------------------------------------
+  function PclTarExtract($p_tarname, $p_path="./", $p_remove_path="", $p_mode="")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarExtract", "tar='{$p_tarname}', path='{$p_path}', remove_path='{$p_remove_path}', mode='{$p_mode}'");
+    $v_result=1;
+
+    // ----- Extract the tar format from the extension
+    if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz")))
+    {
+      if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return 0;
+      }
+    }
+
+    // ----- Call the extracting fct
+    if (($v_result = PclTarHandleExtract($p_tarname, 0, &$p_list, "complete", $p_path, $v_tar_mode, $p_remove_path)) != 1)
+    {
+      TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+      return(0);
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarExtractList()
+  // Description :
+  //   Extract the files present in the archive $p_tarname and specified in
+  //   $p_filelist, in the directory
+  //   $p_path. The relative path of the archived files are keep and become
+  //   relative to $p_path.
+  //   If a directory is spcified in the list, all the files from this directory
+  //   will be extracted.
+  //   If a file with the same name already exists it will be replaced.
+  //   If the path to the file does not exist, it will be created.
+  //   Depending on the $p_tarname extension (.tar, .tar.gz or .tgz) the
+  //   function will determine the type of the archive.
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file
+  //   $p_filelist : An array containing file or directory names, or
+  //                 a string containing one filename or directory name, or
+  //                 a string containing a list of filenames and/or directory
+  //                 names separated by spaces.
+  //   $p_path : Path where the files will be extracted. The files will use
+  //             their memorized path from $p_path.
+  //             If $p_path is "", files will be extracted in "./".
+  //   $p_remove_path : Path to remove (from the file memorized path) while writing the
+  //                    extracted files. If the path does not match the file path,
+  //                    the file is extracted with its memorized path.
+  //                    $p_path and $p_remove_path are commulative.
+  //   $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension
+  // Return Values :
+  //   Same as PclTarList()
+  // --------------------------------------------------------------------------------
+  function PclTarExtractList($p_tarname, $p_filelist, $p_path="./", $p_remove_path="", $p_mode="")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarExtractList", "tar={$p_tarname}, list, path={$p_path}, remove_path='{$p_remove_path}', mode='{$p_mode}'");
+    $v_result=1;
+
+    // ----- Extract the tar format from the extension
+    if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz")))
+    {
+      if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return 0;
+      }
+    }
+
+    // ----- Look if the $p_filelist is really an array
+    if (is_array($p_filelist))
+    {
+      // ----- Call the extracting fct
+      if (($v_result = PclTarHandleExtract($p_tarname, $p_filelist, &$p_list, "partial", $p_path, $v_tar_mode, $p_remove_path)) != 1)
+      {
+        TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+        return(0);
+      }
+    }
+
+    // ----- Look if the $p_filelist is a string
+    else if (is_string($p_filelist))
+    {
+      // ----- Create a list with the elements from the string
+      $v_list = explode(" ", $p_filelist);
+
+      // ----- Call the extracting fct
+      if (($v_result = PclTarHandleExtract($p_tarname, $v_list, &$p_list, "partial", $p_path, $v_tar_mode, $p_remove_path)) != 1)
+      {
+        TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+        return(0);
+      }
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid variable type p_filelist");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return 0;
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarExtractIndex()
+  // Description :
+  //   Extract the files present in the archive $p_tarname and specified at
+  //   the indexes in $p_index, in the directory
+  //   $p_path. The relative path of the archived files are keep and become
+  //   relative to $p_path.
+  //   If a directory is specified in the list, the directory only is created. All
+  //   the file stored in this archive for this directory
+  //   are not extracted.
+  //   If a file with the same name already exists it will be replaced.
+  //   If the path to the file does not exist, it will be created.
+  //   Depending on the $p_tarname extension (.tar, .tar.gz or .tgz) the
+  //   function will determine the type of the archive.
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file
+  //   $p_index : A single index (integer) or a string of indexes of files to
+  //              extract. The form of the string is "0,4-6,8-12" with only numbers
+  //              and '-' for range or ',' to separate ranges. No spaces or ';'
+  //              are allowed.
+  //   $p_path : Path where the files will be extracted. The files will use
+  //             their memorized path from $p_path.
+  //             If $p_path is "", files will be extracted in "./".
+  //   $p_remove_path : Path to remove (from the file memorized path) while writing the
+  //                    extracted files. If the path does not match the file path,
+  //                    the file is extracted with its memorized path.
+  //                    $p_path and $p_remove_path are commulative.
+  //   $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension
+  // Return Values :
+  //   Same as PclTarList()
+  // --------------------------------------------------------------------------------
+  function PclTarExtractIndex($p_tarname, $p_index, $p_path="./", $p_remove_path="", $p_mode="")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarExtractIndex", "tar={$p_tarname}, index='{$p_index}', path={$p_path}, remove_path='{$p_remove_path}', mode='{$p_mode}'");
+    $v_result=1;
+
+    // ----- Extract the tar format from the extension
+    if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz")))
+    {
+      if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return 0;
+      }
+    }
+
+    // ----- Look if the $p_index is really an integer
+    if (is_integer($p_index))
+    {
+      // ----- Call the extracting fct
+      if (($v_result = PclTarHandleExtractByIndexList($p_tarname, $p_index, &$p_list, $p_path, $p_remove_path, $v_tar_mode)) != 1)
+      {
+        TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+        return(0);
+      }
+    }
+
+    // ----- Look if the $p_filelist is a string
+    else if (is_string($p_index))
+    {
+      // ----- Call the extracting fct
+      if (($v_result = PclTarHandleExtractByIndexList($p_tarname, $p_index, &$p_list, $p_path, $p_remove_path, $v_tar_mode)) != 1)
+      {
+        TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+        return(0);
+      }
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid variable type {$p_index}");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return 0;
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarDelete()
+  // Description :
+  //   This function deletes from the archive $p_tarname the files which are listed
+  //   in $p_filelist. $p_filelist can be a string with file names separated by
+  //   spaces, or an array containing the file names.
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file
+  //   $p_filelist : An array or a string containing file names to remove from the
+  //                 archive.
+  //   $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension
+  // Return Values :
+  //   List of the files which are kept in the archive (same format as PclTarList())
+  // --------------------------------------------------------------------------------
+  function PclTarDelete($p_tarname, $p_filelist, $p_mode="")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarDelete", "tar='{$p_tarname}', list='{$p_filelist}', mode='{$p_mode}'");
+    $v_result=1;
+
+    // ----- Extract the tar format from the extension
+    if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz")))
+    {
+      if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return 0;
+      }
+    }
+
+    // ----- Look if the $p_filelist is really an array
+    if (is_array($p_filelist))
+    {
+      // ----- Call the extracting fct
+      if (($v_result = PclTarHandleDelete($p_tarname, $p_filelist, &$p_list, $p_mode)) != 1)
+      {
+        TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+        return(0);
+      }
+    }
+
+    // ----- Look if the $p_filelist is a string
+    else if (is_string($p_filelist))
+    {
+      // ----- Create a list with the elements from the string
+      $v_list = explode(" ", $p_filelist);
+
+      // ----- Call the extracting fct
+      if (($v_result = PclTarHandleDelete($p_tarname, $v_list, &$p_list, $p_mode)) != 1)
+      {
+        TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+        return(0);
+      }
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid variable type p_filelist");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return 0;
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarUpdate()
+  // Description :
+  //   This function updates the files in $p_filelist which are already in the
+  //   $p_tarname archive with an older last modified date. If the file does not
+  //   exist, it is added at the end of the archive.
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file
+  //   $p_filelist : An array or a string containing file names to update from the
+  //                 archive.
+  //   $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension
+  // Return Values :
+  //   List of the files contained in the archive. The field status contains
+  //   "updated", "not_updated", "added" or "ok" for the files not concerned.
+  // --------------------------------------------------------------------------------
+  function PclTarUpdate($p_tarname, $p_filelist, $p_mode="", $p_add_dir="", $p_remove_dir="")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarUpdate", "tar='{$p_tarname}', list='{$p_filelist}', mode='{$p_mode}'");
+    $v_result=1;
+
+    // ----- Extract the tar format from the extension
+    if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz")))
+    {
+      if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return 0;
+      }
+    }
+
+    // ----- Look if the $p_filelist is really an array
+    if (is_array($p_filelist))
+    {
+      // ----- Call the extracting fct
+      if (($v_result = PclTarHandleUpdate($p_tarname, $p_filelist, &$p_list, $p_mode, $p_add_dir, $p_remove_dir)) != 1)
+      {
+        TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+        return(0);
+      }
+    }
+
+    // ----- Look if the $p_filelist is a string
+    else if (is_string($p_filelist))
+    {
+      // ----- Create a list with the elements from the string
+      $v_list = explode(" ", $p_filelist);
+
+      // ----- Call the extracting fct
+      if (($v_result = PclTarHandleUpdate($p_tarname, $v_list, &$p_list, $p_mode, $p_add_dir, $p_remove_dir)) != 1)
+      {
+        TrFctEnd(__FILE__, __LINE__, 0, PclErrorString());
+        return(0);
+      }
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid variable type p_filelist");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return 0;
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarMerge()
+  // Description :
+  //   This function add the content of $p_tarname_add at the end of $p_tarname.
+  // Parameters :
+  //   $p_tarname : Name of an existing tar file
+  //   $p_tarname_add : Name of an existing tar file taht will be added at the end
+  //                    of $p_tarname.
+  //   $p_mode : 'tar' or 'tgz', if not set, will be determined by $p_tarname extension
+  //   $p_mode_add : 'tar' or 'tgz', if not set, will be determined by $p_tarname_add
+  //                 extension
+  // Return Values :
+  //   List of the files contained in the archive. The field status contains
+  //   "updated", "not_updated", "added" or "ok" for the files not concerned.
+  // --------------------------------------------------------------------------------
+  function PclTarMerge($p_tarname, $p_tarname_add, $p_mode="", $p_mode_add="")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarMerge", "tar='{$p_tarname}', tar_add='{$p_tarname_add}', mode='{$p_mode}', mode_add='{$p_mode_add}'");
+    $v_result=1;
+
+    // ----- Check the parameters
+    if (($p_tarname == "") || ($p_tarname_add == ""))
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid empty archive name");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Extract the tar format from the extension
+    if (($p_mode == "") || (($p_mode!="tar") && ($p_mode!="tgz")))
+    {
+      if (($p_mode = PclTarHandleExtension($p_tarname)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return 0;
+      }
+    }
+    if (($p_mode_add == "") || (($p_mode_add!="tar") && ($p_mode_add!="tgz")))
+    {
+      if (($p_mode_add = PclTarHandleExtension($p_tarname_add)) == "")
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return 0;
+      }
+    }
+
+    // ----- Clear filecache
+    clearstatcache();
+
+    // ----- Check the file size
+    if ((!is_file($p_tarname)) ||
+        (((($v_size = filesize($p_tarname)) % 512) != 0) && ($p_mode=="tar")))
+    {
+      // ----- Error log
+      if (!is_file($p_tarname))
+        PclErrorLog(-4, "Archive '$p_tarname' does not exist");
+      else
+        PclErrorLog(-6, "Archive '$p_tarname' has invalid size ".filesize($p_tarname)."(not a 512 block multiple)");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+    if ((!is_file($p_tarname_add)) ||
+        (((($v_size_add = filesize($p_tarname_add)) % 512) != 0) && ($p_mode_add=="tar")))
+    {
+      // ----- Error log
+      if (!is_file($p_tarname_add))
+        PclErrorLog(-4, "Archive '$p_tarname_add' does not exist");
+      else
+        PclErrorLog(-6, "Archive '$p_tarname_add' has invalid size ".filesize($p_tarname_add)."(not a 512 block multiple)");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Look for compressed archive
+    if ($p_mode == "tgz")
+    {
+      // ----- Open the file in read mode
+      if (($p_tar = @gzopen($p_tarname, "rb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Open a temporary file in write mode
+      $v_temp_tarname = uniqid("pcltar-").".tmp";
+      TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname");
+      if (($v_temp_tar = @gzopen($v_temp_tarname, "wb")) == 0)
+      {
+        // ----- Close tar file
+        gzclose($p_tar);
+
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Read the first 512 bytes block
+      $v_buffer = gzread($p_tar, 512);
+
+      // ----- Read the following blocks but not the last one
+      if (!gzeof($p_tar))
+      {
+        TrFctMessage(__FILE__, __LINE__, 3, "More than one 512 block file");
+        $i=1;
+
+        // ----- Read new 512 block and write the already read
+        do{
+          // ----- Write the already read block
+          $v_binary_data = pack("a512", "$v_buffer");
+          gzputs($v_temp_tar, $v_binary_data);
+
+          $i++;
+          TrFctMessage(__FILE__, __LINE__, 3, "Reading block $i");
+
+          // ----- Read next block
+          $v_buffer = gzread($p_tar, 512);
+
+        } while (!gzeof($p_tar));
+
+        TrFctMessage(__FILE__, __LINE__, 3, "$i 512 bytes blocks");
+      }
+    }
+
+    // ----- Look for uncompressed tar file
+    else if ($p_mode=="tar")
+    {
+      // ----- Open the tar file
+      if (($p_tar = fopen($p_tarname, "r+b")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file '$p_tarname' in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Go to the beginning of last block
+      TrFctMessage(__FILE__, __LINE__, 4, "Position before :".($p_mode=="tar"?ftell($p_tar):gztell($p_tar)));
+      fseek($p_tar, $v_size-512);
+      TrFctMessage(__FILE__, __LINE__, 4, "Position after :".($p_mode=="tar"?ftell($p_tar):gztell($p_tar)));
+    }
+
+    // ----- Look for unknown type
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid tar mode $p_mode");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Look for type of archive to add
+    if ($p_mode_add == "tgz")
+    {
+      TrFctMessage(__FILE__, __LINE__, 4, "Opening file $p_tarname_add");
+
+      // ----- Open the file in read mode
+      if (($p_tar_add = @gzopen($p_tarname_add, "rb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-2, "Unable to open file '$p_tarname_add' in binary read mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Read the first 512 bytes block
+      $v_buffer = gzread($p_tar_add, 512);
+
+      // ----- Read the following blocks but not the last one
+      if (!gzeof($p_tar_add))
+      {
+        TrFctMessage(__FILE__, __LINE__, 3, "More than one 512 block file");
+        $i=1;
+
+        // ----- Read new 512 block and write the already read
+        do{
+          // ----- Write the already read block
+          $v_binary_data = pack("a512", "$v_buffer");
+          if ($p_mode=="tar")
+            fputs($p_tar, $v_binary_data);
+          else
+            gzputs($v_temp_tar, $v_binary_data);
+
+          $i++;
+          TrFctMessage(__FILE__, __LINE__, 3, "Reading block $i");
+
+          // ----- Read next block
+          $v_buffer = gzread($p_tar_add, 512);
+
+        } while (!gzeof($p_tar_add));
+
+        TrFctMessage(__FILE__, __LINE__, 3, "$i 512 bytes blocks");
+      }
+
+      // ----- Close the files
+      gzclose($p_tar_add);
+    }
+
+    // ----- Look for uncompressed tar file
+    else if ($p_mode=="tar")
+    {
+      // ----- Open the file in read mode
+      if (($p_tar_add = @fopen($p_tarname_add, "rb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-2, "Unable to open file '$p_tarname_add' in binary read mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Read the first 512 bytes block
+      $v_buffer = fread($p_tar_add, 512);
+
+      // ----- Read the following blocks but not the last one
+      if (!feof($p_tar_add))
+      {
+        TrFctMessage(__FILE__, __LINE__, 3, "More than one 512 block file");
+        $i=1;
+
+        // ----- Read new 512 block and write the already read
+        do{
+          // ----- Write the already read block
+          $v_binary_data = pack("a512", "$v_buffer");
+          if ($p_mode=="tar")
+            fputs($p_tar, $v_binary_data);
+          else
+            gzputs($v_temp_tar, $v_binary_data);
+
+          $i++;
+          TrFctMessage(__FILE__, __LINE__, 3, "Reading block $i");
+
+          // ----- Read next block
+          $v_buffer = fread($p_tar_add, 512);
+
+        } while (!feof($p_tar_add));
+
+        TrFctMessage(__FILE__, __LINE__, 3, "$i 512 bytes blocks");
+      }
+
+      // ----- Close the files
+      fclose($p_tar_add);
+    }
+
+    // ----- Call the footer of the tar archive
+    $v_result = PclTarHandleFooter($p_tar, $p_mode);
+
+    // ----- Look for closing compressed archive
+    if ($p_mode == "tgz")
+    {
+      // ----- Close the files
+      gzclose($p_tar);
+      gzclose($v_temp_tar);
+
+      // ----- Unlink tar file
+      if (!@unlink($p_tarname))
+      {
+        // ----- Error log
+        PclErrorLog(-11, "Error while deleting archive name $p_tarname");
+      }
+
+      // ----- Rename tar file
+      if (!@rename($v_temp_tarname, $p_tarname))
+      {
+        // ----- Error log
+        PclErrorLog(-12, "Error while renaming temporary file $v_temp_tarname to archive name $p_tarname");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Look for closing uncompressed tar file
+    else if ($p_mode=="tar")
+    {
+      // ----- Close the tarfile
+      fclose($p_tar);
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+
+// --------------------------------------------------------------------------------
+// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS *****
+// *****                                                        *****
+// *****       THESES FUNCTIONS MUST NOT BE USED DIRECTLY       *****
+// --------------------------------------------------------------------------------
+
+
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleCreate()
+  // Description :
+  // Parameters :
+  //   $p_tarname : Name of the tar file
+  //   $p_list : An array containing the file or directory names to add in the tar
+  //   $p_mode : "tar" for normal tar archive, "tgz" for gzipped tar archive
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleCreate($p_tarname, $p_list, $p_mode, $p_add_dir="", $p_remove_dir="")
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleCreate", "tar=$p_tarname, list, mode=$p_mode, add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
+    $v_result=1;
+    $v_list_detail = array();
+
+    // ----- Check the parameters
+    if (($p_tarname == "") || (($p_mode != "tar") && ($p_mode != "tgz")))
+    {
+      // ----- Error log
+      if ($p_tarname == "")
+        PclErrorLog(-3, "Invalid empty archive name");
+      else
+        PclErrorLog(-3, "Unknown mode '$p_mode'");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Look for tar file
+    if ($p_mode == "tar")
+    {
+      // ----- Open the tar file
+      if (($p_tar = fopen($p_tarname, "wb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file [$p_tarname] in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Call the adding fct inside the tar
+      if (($v_result = PclTarHandleAddList($p_tar, $p_list, $p_mode, $v_list_detail, $p_add_dir, $p_remove_dir)) == 1)
+      {
+        // ----- Call the footer of the tar archive
+        $v_result = PclTarHandleFooter($p_tar, $p_mode);
+      }
+
+      // ----- Close the tarfile
+      fclose($p_tar);
+    }
+    // ----- Look for tgz file
+    else
+    {
+      // ----- Open the tar file
+      if (($p_tar = @gzopen($p_tarname, "wb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file [$p_tarname] in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Call the adding fct inside the tar
+      if (($v_result = PclTarHandleAddList($p_tar, $p_list, $p_mode, $v_list_detail, $p_add_dir, $p_remove_dir)) == 1)
+      {
+        // ----- Call the footer of the tar archive
+        $v_result = PclTarHandleFooter($p_tar, $p_mode);
+      }
+
+      // ----- Close the tarfile
+      gzclose($p_tar);
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleAppend()
+  // Description :
+  // Parameters :
+  //   $p_tarname : Name of the tar file
+  //   $p_list : An array containing the file or directory names to add in the tar
+  //   $p_mode : "tar" for normal tar archive, "tgz" for gzipped tar archive
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleAppend($p_tarname, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleAppend", "tar=$p_tarname, list, mode=$p_mode");
+    $v_result=1;
+
+    // ----- Check the parameters
+    if ($p_tarname == "")
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid empty archive name");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    clearstatcache();
+
+    // ----- Check the file size
+    if ((!is_file($p_tarname)) ||
+        (((($v_size = filesize($p_tarname)) % 512) != 0) && ($p_mode=="tar")))
+    {
+      // ----- Error log
+      if (!is_file($p_tarname))
+        PclErrorLog(-4, "Archive '$p_tarname' does not exist");
+      else
+        PclErrorLog(-6, "Archive '$p_tarname' has invalid size ".filesize($p_tarname)."(not a 512 block multiple)");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Look for compressed archive
+    if ($p_mode == "tgz")
+    {
+      // ----- Open the file in read mode
+      if (($p_tar = @gzopen($p_tarname, "rb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Open a temporary file in write mode
+      $v_temp_tarname = uniqid("pcltar-").".tmp";
+      TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname");
+      if (($v_temp_tar = @gzopen($v_temp_tarname, "wb")) == 0)
+      {
+        // ----- Close tar file
+        gzclose($p_tar);
+
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Read the first 512 bytes block
+      $v_buffer = gzread($p_tar, 512);
+
+      // ----- Read the following blocks but not the last one
+      if (!gzeof($p_tar))
+      {
+        TrFctMessage(__FILE__, __LINE__, 3, "More than one 512 block file");
+        $i=1;
+
+        // ----- Read new 512 block and write the already read
+        do{
+          // ----- Write the already read block
+          $v_binary_data = pack("a512", "$v_buffer");
+          gzputs($v_temp_tar, $v_binary_data);
+
+          $i++;
+          TrFctMessage(__FILE__, __LINE__, 3, "Reading block $i");
+
+          // ----- Read next block
+          $v_buffer = gzread($p_tar, 512);
+
+        } while (!gzeof($p_tar));
+
+        TrFctMessage(__FILE__, __LINE__, 3, "$i 512 bytes blocks");
+      }
+
+      // ----- Call the adding fct inside the tar
+      if (($v_result = PclTarHandleAddList($v_temp_tar, $p_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir)) == 1)
+      {
+        // ----- Call the footer of the tar archive
+        $v_result = PclTarHandleFooter($v_temp_tar, $p_mode);
+      }
+
+      // ----- Close the files
+      gzclose($p_tar);
+      gzclose($v_temp_tar);
+
+      // ----- Unlink tar file
+      if (!@unlink($p_tarname))
+      {
+        // ----- Error log
+        PclErrorLog(-11, "Error while deleting archive name $p_tarname");
+      }
+
+      // ----- Rename tar file
+      if (!@rename($v_temp_tarname, $p_tarname))
+      {
+        // ----- Error log
+        PclErrorLog(-12, "Error while renaming temporary file $v_temp_tarname to archive name $p_tarname");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Look for uncompressed tar file
+    else if ($p_mode=="tar")
+    {
+      // ----- Open the tar file
+      if (($p_tar = fopen($p_tarname, "r+b")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file '$p_tarname' in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Go to the beginning of last block
+      TrFctMessage(__FILE__, __LINE__, 4, "Position before :".($p_mode=="tar"?ftell($p_tar):gztell($p_tar)));
+      fseek($p_tar, $v_size-512);
+      TrFctMessage(__FILE__, __LINE__, 4, "Position after :".($p_mode=="tar"?ftell($p_tar):gztell($p_tar)));
+
+      // ----- Call the adding fct inside the tar
+      if (($v_result = PclTarHandleAddList($p_tar, $p_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir)) == 1)
+      {
+        // ----- Call the footer of the tar archive
+        $v_result = PclTarHandleFooter($p_tar, $p_mode);
+      }
+
+      // ----- Close the tarfile
+      fclose($p_tar);
+    }
+
+    // ----- Look for unknown type
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid tar mode $p_mode");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleAddList()
+  // Description :
+  //   $p_add_dir and $p_remove_dir will give the ability to memorize a path which is
+  //   different from the real path of the file. This is usefull if you want to have PclTar
+  //   running in any directory, and memorize relative path from an other directory.
+  // Parameters :
+  //   $p_tar : File descriptor of the tar archive
+  //   $p_list : An array containing the file or directory names to add in the tar
+  //   $p_mode : "tar" for normal tar archive, "tgz" for gzipped tar archive
+  //   $p_list_detail : list of added files with their properties (specially the status field)
+  //   $p_add_dir : Path to add in the filename path archived
+  //   $p_remove_dir : Path to remove in the filename path archived
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleAddList($p_tar, $p_list, $p_mode, &$p_list_detail, $p_add_dir, $p_remove_dir)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleAddList", "tar='$p_tar', list, mode='$p_mode', add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
+    $v_result=1;
+    $v_header = array();
+
+    // ----- Recuperate the current number of elt in list
+    $v_nb = sizeof($p_list_detail);
+
+    // ----- Check the parameters
+    if ($p_tar == 0)
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid file descriptor in file ".__FILE__.", line ".__LINE__);
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Check the arguments
+    if (sizeof($p_list) == 0)
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid file list parameter (invalid or empty list)");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Loop on the files
+    for ($j=0; ($j<count($p_list)) && ($v_result==1); $j++)
+    {
+      // ----- Recuperate the filename
+      $p_filename = $p_list[$j];
+
+      TrFctMessage(__FILE__, __LINE__, 2, "Looking for file [$p_filename]");
+
+      // ----- Skip empty file names
+      if ($p_filename == "")
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Skip empty filename");
+        continue;
+      }
+
+      // ----- Check the filename
+      if (!file_exists($p_filename))
+      {
+        // ----- Error log
+        TrFctMessage(__FILE__, __LINE__, 2, "File '$p_filename' does not exists");
+        PclErrorLog(-4, "File '$p_filename' does not exists");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Check the path length
+      if (strlen($p_filename) > 99)
+      {
+        // ----- Error log
+        PclErrorLog(-5, "File name is too long (max. 99) : '$p_filename'");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      TrFctMessage(__FILE__, __LINE__, 4, "File position before header =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar)));
+
+      // ----- Add the file
+      if (($v_result = PclTarHandleAddFile($p_tar, $p_filename, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1)
+      {
+        // ----- Return status
+        TrFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      // ----- Store the file infos
+      $p_list_detail[$v_nb++] = $v_header;
+
+      // ----- Look for directory
+      if (is_dir($p_filename))
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "$p_filename is a directory");
+
+        // ----- Look for path
+        if ($p_filename != ".")
+          $v_path = $p_filename."/";
+        else
+          $v_path = "";
+
+        // ----- Read the directory for files and sub-directories
+        $p_hdir = opendir($p_filename);
+        $p_hitem = readdir($p_hdir); // '.' directory
+        $p_hitem = readdir($p_hdir); // '..' directory
+        while ($p_hitem = readdir($p_hdir))
+        {
+          // ----- Look for a file
+          if (is_file($v_path.$p_hitem))
+          {
+            TrFctMessage(__FILE__, __LINE__, 4, "Add the file '".$v_path.$p_hitem."'");
+
+            // ----- Add the file
+            if (($v_result = PclTarHandleAddFile($p_tar, $v_path.$p_hitem, $p_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1)
+            {
+              // ----- Return status
+              TrFctEnd(__FILE__, __LINE__, $v_result);
+              return $v_result;
+            }
+
+            // ----- Store the file infos
+            $p_list_detail[$v_nb++] = $v_header;
+          }
+
+          // ----- Recursive call to PclTarHandleAddFile()
+          else
+          {
+            TrFctMessage(__FILE__, __LINE__, 4, "'".$v_path.$p_hitem."' is a directory");
+
+            // ----- Need an array as parameter
+            $p_temp_list[0] = $v_path.$p_hitem;
+            $v_result = PclTarHandleAddList($p_tar, $p_temp_list, $p_mode, $p_list_detail, $p_add_dir, $p_remove_dir);
+          }
+        }
+
+        // ----- Free memory for the recursive loop
+        unset($p_temp_list);
+        unset($p_hdir);
+        unset($p_hitem);
+      }
+      else
+      {
+        TrFctMessage(__FILE__, __LINE__, 4, "File position after blocks =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar)));
+      }
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleAddFile()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleAddFile($p_tar, $p_filename, $p_mode, &$p_header, $p_add_dir, $p_remove_dir)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleAddFile", "tar='$p_tar', filename='$p_filename', p_mode='$p_mode', add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
+    $v_result=1;
+
+    // ----- Check the parameters
+    if ($p_tar == 0)
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid file descriptor in file ".__FILE__.", line ".__LINE__);
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Skip empty file names
+    if ($p_filename == "")
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid file list parameter (invalid or empty list)");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Calculate the stored filename
+    $v_stored_filename = $p_filename;
+    if ($p_remove_dir != "")
+    {
+      if (substr($p_remove_dir, -1) != '/')
+        $p_remove_dir .= "/";
+
+      if ((substr($p_filename, 0, 2) == "./") || (substr($p_remove_dir, 0, 2) == "./"))
+      {
+        if ((substr($p_filename, 0, 2) == "./") && (substr($p_remove_dir, 0, 2) != "./"))
+          $p_remove_dir = "./".$p_remove_dir;
+        if ((substr($p_filename, 0, 2) != "./") && (substr($p_remove_dir, 0, 2) == "./"))
+          $p_remove_dir = substr($p_remove_dir, 2);
+      }
+
+      if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir)
+      {
+        $v_stored_filename = substr($p_filename, strlen($p_remove_dir));
+        TrFctMessage(__FILE__, __LINE__, 3, "Remove path '$p_remove_dir' in file '$p_filename' = '$v_stored_filename'");
+      }
+    }
+    if ($p_add_dir != "")
+    {
+      if (substr($p_add_dir, -1) == "/")
+        $v_stored_filename = $p_add_dir.$v_stored_filename;
+      else
+        $v_stored_filename = $p_add_dir."/".$v_stored_filename;
+      TrFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'");
+    }
+
+    // ----- Check the path length
+    if (strlen($v_stored_filename) > 99)
+    {
+      // ----- Error log
+      PclErrorLog(-5, "Stored file name is too long (max. 99) : '$v_stored_filename'");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Look for a file
+    if (is_file($p_filename))
+    {
+      // ----- Open the source file
+      if (($v_file = fopen($p_filename, "rb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-2, "Unable to open file '$p_filename' in binary read mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Call the header generation
+      if (($v_result = PclTarHandleHeader($p_tar, $p_filename, $p_mode, $p_header, $v_stored_filename)) != 1)
+      {
+        // ----- Return status
+        TrFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      TrFctMessage(__FILE__, __LINE__, 4, "File position after header =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar)));
+
+      // ----- Read the file by 512 octets blocks
+      $i=0;
+      while (($v_buffer = fread($v_file, 512)) != "")
+      {
+        $v_binary_data = pack("a512", "$v_buffer");
+        if ($p_mode == "tar")
+          fputs($p_tar, $v_binary_data);
+        else
+          gzputs($p_tar, $v_binary_data);
+        $i++;
+      }
+      TrFctMessage(__FILE__, __LINE__, 2, "$i 512 bytes blocks");
+
+      // ----- Close the file
+      fclose($v_file);
+
+      TrFctMessage(__FILE__, __LINE__, 4, "File position after blocks =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar)));
+    }
+
+    // ----- Look for a directory
+    else
+    {
+      // ----- Call the header generation
+      if (($v_result = PclTarHandleHeader($p_tar, $p_filename, $p_mode, $p_header, $v_stored_filename)) != 1)
+      {
+        // ----- Return status
+        TrFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      TrFctMessage(__FILE__, __LINE__, 4, "File position after header =".($p_mode=="tar"?ftell($p_tar):gztell($p_tar)));
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleHeader()
+  // Description :
+  //   This function creates in the TAR $p_tar, the TAR header for the file
+  //   $p_filename.
+  //
+  //   1. The informations needed to compose the header are recuperated and formatted
+  //   2. Two binary strings are composed for the first part of the header, before
+  //      and after checksum field.
+  //   3. The checksum is calculated from the two binary strings
+  //   4. The header is write in the tar file (first binary string, binary string
+  //      for checksum and last binary string).
+  // Parameters :
+  //   $p_tar : a valid file descriptor, opened in write mode,
+  //   $p_filename : The name of the file the header is for,
+  //   $p_mode : The mode of the archive ("tar" or "tgz").
+  //   $p_header : A pointer to a array where will be set the file properties
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleHeader($p_tar, $p_filename, $p_mode, &$p_header, $p_stored_filename)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleHeader", "tar=$p_tar, file='$p_filename', mode='$p_mode', stored_filename='$p_stored_filename'");
+    $v_result=1;
+
+    // ----- Check the parameters
+    if (($p_tar == 0) || ($p_filename == ""))
+    {
+      // ----- Error log
+      PclErrorLog(-3, "Invalid file descriptor in file ".__FILE__.", line ".__LINE__);
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Filename (reduce the path of stored name)
+    if ($p_stored_filename == "")
+      $p_stored_filename = $p_filename;
+    $v_reduce_filename = PclTarHandlePathReduction($p_stored_filename);
+    TrFctMessage(__FILE__, __LINE__, 2, "Filename (reduced) '$v_reduce_filename', strlen ".strlen($v_reduce_filename));
+
+    // ----- Get file info
+    $v_info = stat($p_filename);
+    $v_uid = sprintf("%6s ", DecOct($v_info[4]));
+    $v_gid = sprintf("%6s ", DecOct($v_info[5]));
+    TrFctMessage(__FILE__, __LINE__, 3, "uid=$v_uid, gid=$v_gid");
+    $v_perms = sprintf("%6s ", DecOct(fileperms($p_filename)));
+    TrFctMessage(__FILE__, __LINE__, 3, "file permissions $v_perms");
+
+    // ----- File mtime
+    $v_mtime_data = filemtime($p_filename);
+    TrFctMessage(__FILE__, __LINE__, 2, "File mtime : $v_mtime_data");
+    $v_mtime = sprintf("%11s", DecOct($v_mtime_data));
+
+    // ----- File typeflag
+    // '0' or '\0' is the code for regular file
+    // '5' is directory
+    if (is_dir($p_filename))
+    {
+      $v_typeflag = "5";
+      $v_size = 0;
+    }
+    else
+    {
+      $v_typeflag = "";
+
+      // ----- Get the file size
+      clearstatcache();
+      $v_size = filesize($p_filename);
+    }
+
+    TrFctMessage(__FILE__, __LINE__, 2, "File size : $v_size");
+    $v_size = sprintf("%11s ", DecOct($v_size));
+
+    TrFctMessage(__FILE__, __LINE__, 2, "File typeflag : $v_typeflag");
+
+    // ----- Linkname
+    $v_linkname = "";
+
+    // ----- Magic
+    $v_magic = "";
+
+    // ----- Version
+    $v_version = "";
+
+    // ----- uname
+    $v_uname = "";
+
+    // ----- gname
+    $v_gname = "";
+
+    // ----- devmajor
+    $v_devmajor = "";
+
+    // ----- devminor
+    $v_devminor = "";
+
+    // ----- prefix
+    $v_prefix = "";
+
+    // ----- Compose the binary string of the header in two parts arround the checksum position
+    $v_binary_data_first = pack("a100a8a8a8a12A12", $v_reduce_filename, $v_perms, $v_uid, $v_gid, $v_size, $v_mtime);
+    $v_binary_data_last = pack("a1a100a6a2a32a32a8a8a155a12", $v_typeflag, $v_linkname, $v_magic, $v_version, $v_uname, $v_gname, $v_devmajor, $v_devminor, $v_prefix, "");
+
+    // ----- Calculate the checksum
+    $v_checksum = 0;
+    // ..... First part of the header
+    for ($i=0; $i<148; $i++)
+    {
+      $v_checksum += ord(substr($v_binary_data_first,$i,1));
+    }
+    // ..... Ignore the checksum value and replace it by ' ' (space)
+    for ($i=148; $i<156; $i++)
+    {
+      $v_checksum += ord(' ');
+    }
+    // ..... Last part of the header
+    for ($i=156, $j=0; $i<512; $i++, $j++)
+    {
+      $v_checksum += ord(substr($v_binary_data_last,$j,1));
+    }
+    TrFctMessage(__FILE__, __LINE__, 3, "Calculated checksum : $v_checksum");
+
+    // ----- Write the first 148 bytes of the header in the archive
+    if ($p_mode == "tar")
+      fputs($p_tar, $v_binary_data_first, 148);
+    else
+      gzputs($p_tar, $v_binary_data_first, 148);
+
+    // ----- Write the calculated checksum
+    $v_checksum = sprintf("%6s ", DecOct($v_checksum));
+    $v_binary_data = pack("a8", $v_checksum);
+    if ($p_mode == "tar")
+      fputs($p_tar, $v_binary_data, 8);
+    else
+      gzputs($p_tar, $v_binary_data, 8);
+
+    // ----- Write the last 356 bytes of the header in the archive
+    if ($p_mode == "tar")
+      fputs($p_tar, $v_binary_data_last, 356);
+    else
+      gzputs($p_tar, $v_binary_data_last, 356);
+
+    // ----- Set the properties in the header "structure"
+    $p_header[filename] = $v_reduce_filename;
+    $p_header[mode] = $v_perms;
+    $p_header[uid] = $v_uid;
+    $p_header[gid] = $v_gid;
+    $p_header[size] = $v_size;
+    $p_header[mtime] = $v_mtime;
+    $p_header[typeflag] = $v_typeflag;
+    $p_header[status] = "added";
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleFooter()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleFooter($p_tar, $p_mode)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleFooter", "tar='$p_tar', p_mode=$p_mode");
+    $v_result=1;
+
+    // ----- Write the last 0 filled block for end of archive
+    $v_binary_data = pack("a512", "");
+    if ($p_mode == "tar")
+      fputs($p_tar, $v_binary_data);
+    else
+      gzputs($p_tar, $v_binary_data);
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleExtract()
+  // Description :
+  // Parameters :
+  //   $p_tarname : Filename of the tar (or tgz) archive
+  //   $p_file_list : An array which contains the list of files to extract, this
+  //                  array may be empty when $p_mode is 'complete'
+  //   $p_list_detail : An array where will be placed the properties of  each extracted/listed file
+  //   $p_mode : 'complete' will extract all files from the archive,
+  //             'partial' will look for files in $p_file_list
+  //             'list' will only list the files from the archive without any extract
+  //   $p_path : Path to add while writing the extracted files
+  //   $p_tar_mode : 'tar' for GNU TAR archive, 'tgz' for compressed archive
+  //   $p_remove_path : Path to remove (from the file memorized path) while writing the
+  //                    extracted files. If the path does not match the file path,
+  //                    the file is extracted with its memorized path.
+  //                    $p_remove_path does not apply to 'list' mode.
+  //                    $p_path and $p_remove_path are commulative.
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleExtract($p_tarname, $p_file_list, &$p_list_detail, $p_mode, $p_path, $p_tar_mode, $p_remove_path)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleExtract", "archive='$p_tarname', list, mode=$p_mode, path=$p_path, tar_mode=$p_tar_mode, remove_path='$p_remove_path'");
+    $v_result=1;
+    $v_nb = 0;
+    $v_extract_all = TRUE;
+    $v_listing = FALSE;
+
+    // ----- Check the path
+    if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../")))
+      $p_path = "./".$p_path;
+
+    // ----- Look for path to remove format (should end by /)
+    if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/'))
+    {
+      $p_remove_path .= '/';
+    }
+    $p_remove_path_size = strlen($p_remove_path);
+
+    // ----- Study the mode
+    switch ($p_mode) {
+      case "complete" :
+        // ----- Flag extract of all files
+        $v_extract_all = TRUE;
+        $v_listing = FALSE;
+      break;
+      case "partial" :
+          // ----- Flag extract of specific files
+          $v_extract_all = FALSE;
+          $v_listing = FALSE;
+      break;
+      case "list" :
+          // ----- Flag list of all files
+          $v_extract_all = FALSE;
+          $v_listing = TRUE;
+      break;
+      default :
+        // ----- Error log
+        PclErrorLog(-3, "Invalid extract mode ($p_mode)");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+    }
+
+    // ----- Open the tar file
+    if ($p_tar_mode == "tar")
+    {
+      TrFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+      $v_tar = fopen($p_tarname, "rb");
+    }
+    else
+    {
+      TrFctMessage(__FILE__, __LINE__, 3, "Open file in gzip binary read mode");
+      $v_tar = @gzopen($p_tarname, "rb");
+    }
+
+    // ----- Check that the archive is open
+    if ($v_tar == 0)
+    {
+      // ----- Error log
+      PclErrorLog(-2, "Unable to open archive '$p_tarname' in binary read mode");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Read the blocks
+    While (!($v_end_of_file = ($p_tar_mode == "tar"?feof($v_tar):gzeof($v_tar))))
+    {
+      TrFctMessage(__FILE__, __LINE__, 3, "Looking for next header ...");
+
+      // ----- Clear cache of file infos
+      clearstatcache();
+
+      // ----- Reset extract tag
+      $v_extract_file = FALSE;
+      $v_extraction_stopped = 0;
+
+      // ----- Read the 512 bytes header
+      if ($p_tar_mode == "tar")
+        $v_binary_data = fread($v_tar, 512);
+      else
+        $v_binary_data = gzread($v_tar, 512);
+
+      // ----- Read the header properties
+      if (($v_result = PclTarHandleReadHeader($v_binary_data, $v_header)) != 1)
+      {
+        // ----- Close the archive file
+        if ($p_tar_mode == "tar")
+          fclose($v_tar);
+        else
+          gzclose($v_tar);
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      // ----- Look for empty blocks to skip
+      if ($v_header[filename] == "")
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Empty block found. End of archive ?");
+        continue;
+      }
+
+      TrFctMessage(__FILE__, __LINE__, 2, "Found file '$v_header[filename]', size '$v_header[size]'");
+
+      // ----- Look for partial extract
+      if ((!$v_extract_all) && (is_array($p_file_list)))
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Look if the file '$v_header[filename]' need to be extracted");
+
+        // ----- By default no unzip if the file is not found
+        $v_extract_file = FALSE;
+
+        // ----- Look into the file list
+        for ($i=0; $i<sizeof($p_file_list); $i++)
+        {
+          TrFctMessage(__FILE__, __LINE__, 2, "Compare archived file '$v_header[filename]' from asked list file '".$p_file_list[$i]."'");
+
+          // ----- Look if it is a directory
+          if (substr($p_file_list[$i], -1) == "/")
+          {
+            TrFctMessage(__FILE__, __LINE__, 3, "Compare file '$v_header[filename]' with directory '$p_file_list[$i]'");
+
+            // ----- Look if the directory is in the filename path
+            if ((strlen($v_header[filename]) > strlen($p_file_list[$i])) && (substr($v_header[filename], 0, strlen($p_file_list[$i])) == $p_file_list[$i]))
+            {
+              // ----- The file is in the directory, so extract it
+              TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' is in directory '$p_file_list[$i]' : extract it");
+              $v_extract_file = TRUE;
+
+              // ----- End of loop
+              break;
+            }
+          }
+
+          // ----- It is a file, so compare the file names
+          else if ($p_file_list[$i] == $v_header[filename])
+          {
+            // ----- File found
+            TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' should be extracted");
+            $v_extract_file = TRUE;
+
+            // ----- End of loop
+            break;
+          }
+        }
+
+        // ----- Trace
+        if (!$v_extract_file)
+        {
+          TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' should not be extracted");
+        }
+      }
+      else
+      {
+        // ----- All files need to be extracted
+        $v_extract_file = TRUE;
+      }
+
+      // ----- Look if this file need to be extracted
+      if (($v_extract_file) && (!$v_listing))
+      {
+        // ----- Look for path to remove
+        if (($p_remove_path != "")
+            && (substr($v_header[filename], 0, $p_remove_path_size) == $p_remove_path))
+        {
+          TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '$v_header[filename]'");
+          // ----- Remove the path
+          $v_header[filename] = substr($v_header[filename], $p_remove_path_size);
+          TrFctMessage(__FILE__, __LINE__, 3, "Reslting file is '$v_header[filename]'");
+        }
+
+        // ----- Add the path to the file
+        if (($p_path != "./") && ($p_path != "/"))
+        {
+          // ----- Look for the path end '/'
+          while (substr($p_path, -1) == "/")
+          {
+            TrFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'");
+            $p_path = substr($p_path, 0, strlen($p_path)-1);
+            TrFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]");
+          }
+
+          // ----- Add the path
+          if (substr($v_header[filename], 0, 1) == "/")
+              $v_header[filename] = $p_path.$v_header[filename];
+          else
+            $v_header[filename] = $p_path."/".$v_header[filename];
+        }
+
+        // ----- Trace
+        TrFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '$v_header[filename]', size '$v_header[size]'");
+
+        // ----- Check that the file does not exists
+        if (file_exists($v_header[filename]))
+        {
+          TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' already exists");
+
+          // ----- Look if file is a directory
+          if (is_dir($v_header[filename]))
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is a directory");
+
+            // ----- Change the file status
+            $v_header[status] = "already_a_directory";
+
+            // ----- Skip the extract
+            $v_extraction_stopped = 1;
+            $v_extract_file = 0;
+          }
+          // ----- Look if file is write protected
+          else if (!is_writeable($v_header[filename]))
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is write protected");
+
+            // ----- Change the file status
+            $v_header[status] = "write_protected";
+
+            // ----- Skip the extract
+            $v_extraction_stopped = 1;
+            $v_extract_file = 0;
+          }
+          // ----- Look if the extracted file is older
+          else if (filemtime($v_header[filename]) > $v_header[mtime])
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is newer (".date("l dS of F Y h:i:s A", filemtime($v_header[filename])).") than the extracted file (".date("l dS of F Y h:i:s A", $v_header[mtime]).")");
+
+            // ----- Change the file status
+            $v_header[status] = "newer_exist";
+
+            // ----- Skip the extract
+            $v_extraction_stopped = 1;
+            $v_extract_file = 0;
+          }
+        }
+
+        // ----- Check the directory availability and create it if necessary
+        else
+        {
+          if ($v_header[typeflag]=="5")
+            $v_dir_to_check = $v_header[filename];
+          else if (!strstr($v_header[filename], "/"))
+            $v_dir_to_check = "";
+          else
+            $v_dir_to_check = dirname($v_header[filename]);
+
+          if (($v_result = PclTarHandlerDirCheck($v_dir_to_check)) != 1)
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '$v_header[filename]'");
+
+            // ----- Change the file status
+            $v_header[status] = "path_creation_fail";
+
+            // ----- Skip the extract
+            $v_extraction_stopped = 1;
+            $v_extract_file = 0;
+          }
+        }
+
+        // ----- Do the extraction
+        if (($v_extract_file) && ($v_header[typeflag]!="5"))
+        {
+          // ----- Open the destination file in write mode
+          if (($v_dest_file = @fopen($v_header[filename], "wb")) == 0)
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Error while opening '$v_header[filename]' in write binary mode");
+
+            // ----- Change the file status
+            $v_header[status] = "write_error";
+
+            // ----- Jump to next file
+            TrFctMessage(__FILE__, __LINE__, 2, "Jump to next file");
+            if ($p_tar_mode == "tar")
+              fseek($v_tar, ftell($v_tar)+(ceil(($v_header[size]/512))*512));
+            else
+              gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512));
+          }
+          else
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Start extraction of '$v_header[filename]'");
+
+            // ----- Read data
+            $n = floor($v_header[size]/512);
+            for ($i=0; $i<$n; $i++)
+            {
+              TrFctMessage(__FILE__, __LINE__, 3, "Read complete 512 bytes block number ".($i+1));
+              if ($p_tar_mode == "tar")
+                $v_content = fread($v_tar, 512);
+              else
+                $v_content = gzread($v_tar, 512);
+              fwrite($v_dest_file, $v_content, 512);
+            }
+            if (($v_header[size] % 512) != 0)
+            {
+              TrFctMessage(__FILE__, __LINE__, 3, "Read last ".($v_header[size] % 512)." bytes in a 512 block");
+              if ($p_tar_mode == "tar")
+                $v_content = fread($v_tar, 512);
+              else
+                $v_content = gzread($v_tar, 512);
+              fwrite($v_dest_file, $v_content, ($v_header[size] % 512));
+            }
+
+            // ----- Close the destination file
+            fclose($v_dest_file);
+
+            // ----- Change the file mode, mtime
+            touch($v_header[filename], $v_header[mtime]);
+            //chmod($v_header[filename], DecOct($v_header[mode]));
+          }
+
+          // ----- Check the file size
+          clearstatcache();
+          if (filesize($v_header[filename]) != $v_header[size])
+          {
+            // ----- Close the archive file
+            if ($p_tar_mode == "tar")
+              fclose($v_tar);
+            else
+              gzclose($v_tar);
+
+            // ----- Error log
+            PclErrorLog(-7, "Extracted file '$v_header[filename]' does not have the correct file size '".filesize($v_filename)."' ('$v_header[size]' expected). Archive may be corrupted.");
+
+            // ----- Return
+            TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+            return PclErrorCode();
+          }
+
+          // ----- Trace
+          TrFctMessage(__FILE__, __LINE__, 2, "Extraction done");
+        }
+
+        else
+        {
+          TrFctMessage(__FILE__, __LINE__, 2, "Extraction of file '$v_header[filename]' skipped.");
+
+          // ----- Jump to next file
+          TrFctMessage(__FILE__, __LINE__, 2, "Jump to next file");
+          if ($p_tar_mode == "tar")
+            fseek($v_tar, ftell($v_tar)+(ceil(($v_header[size]/512))*512));
+          else
+            gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512));
+        }
+      }
+
+      // ----- Look for file that is not to be unzipped
+      else
+      {
+        // ----- Trace
+        TrFctMessage(__FILE__, __LINE__, 2, "Jump file '$v_header[filename]'");
+        TrFctMessage(__FILE__, __LINE__, 4, "Position avant jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]");
+
+        // ----- Jump to next file
+        if ($p_tar_mode == "tar")
+          fseek($v_tar, ($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))+(ceil(($v_header[size]/512))*512));
+        else
+          gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512));
+
+        TrFctMessage(__FILE__, __LINE__, 4, "Position aprs jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]");
+      }
+
+      if ($p_tar_mode == "tar")
+        $v_end_of_file = feof($v_tar);
+      else
+        $v_end_of_file = gzeof($v_tar);
+
+      // ----- File name and properties are logged if listing mode or file is extracted
+      if ($v_listing || $v_extract_file || $v_extraction_stopped)
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Memorize info about file '$v_header[filename]'");
+
+        // ----- Log extracted files
+        if (($v_file_dir = dirname($v_header[filename])) == $v_header[filename])
+          $v_file_dir = "";
+        if ((substr($v_header[filename], 0, 1) == "/") && ($v_file_dir == ""))
+          $v_file_dir = "/";
+
+        // ----- Add the array describing the file into the list
+        $p_list_detail[$v_nb] = $v_header;
+
+        // ----- Increment
+        $v_nb++;
+      }
+    }
+
+    // ----- Close the tarfile
+    if ($p_tar_mode == "tar")
+      fclose($v_tar);
+    else
+      gzclose($v_tar);
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleExtractByIndexList()
+  // Description :
+  //   Extract the files which are at the indexes specified. If the 'file' at the
+  //   index is a directory, the directory only is created, not all the files stored
+  //   for that directory.
+  // Parameters :
+  //   $p_index_string : String of indexes of files to extract. The form of the
+  //                     string is "0,4-6,8-12" with only numbers and '-' for
+  //                     for range, and ',' to separate ranges. No spaces or ';'
+  //                     are allowed.
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleExtractByIndexList($p_tarname, $p_index_string, &$p_list_detail, $p_path, $p_remove_path, $p_tar_mode)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleExtractByIndexList", "archive='$p_tarname', index_string='$p_index_string', list, path=$p_path, remove_path='$p_remove_path', tar_mode=$p_tar_mode");
+    $v_result=1;
+    $v_nb = 0;
+
+    // ----- TBC : I should check the string by a regexp
+
+    // ----- Check the path
+    if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../") && (substr($p_path, 0, 2) != "./")))
+      $p_path = "./".$p_path;
+
+    // ----- Look for path to remove format (should end by /)
+    if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/'))
+    {
+      $p_remove_path .= '/';
+    }
+    $p_remove_path_size = strlen($p_remove_path);
+
+    // ----- Open the tar file
+    if ($p_tar_mode == "tar")
+    {
+      TrFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+      $v_tar = @fopen($p_tarname, "rb");
+    }
+    else
+    {
+      TrFctMessage(__FILE__, __LINE__, 3, "Open file in gzip binary read mode");
+      $v_tar = @gzopen($p_tarname, "rb");
+    }
+
+    // ----- Check that the archive is open
+    if ($v_tar == 0)
+    {
+      // ----- Error log
+      PclErrorLog(-2, "Unable to open archive '$p_tarname' in binary read mode");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Manipulate the index list
+    $v_list = explode(",", $p_index_string);
+    sort($v_list);
+
+    // ----- Loop on the index list
+    $v_index=0;
+    for ($i=0; ($i<sizeof($v_list)) && ($v_result); $i++)
+    {
+      TrFctMessage(__FILE__, __LINE__, 3, "Looking for index part '$v_list[$i]'");
+
+      // ----- Extract range
+      $v_index_list = explode("-", $v_list[$i]);
+      $v_size_index_list = sizeof($v_index_list);
+      if ($v_size_index_list == 1)
+      {
+        TrFctMessage(__FILE__, __LINE__, 3, "Only one index '$v_index_list[0]'");
+
+        // ----- Do the extraction
+        $v_result = PclTarHandleExtractByIndex($v_tar, $v_index, $v_index_list[0], $v_index_list[0], $p_list_detail, $p_path, $p_remove_path, $p_tar_mode);
+      }
+      else if ($v_size_index_list == 2)
+      {
+        TrFctMessage(__FILE__, __LINE__, 3, "Two indexes '$v_index_list[0]' and '$v_index_list[1]'");
+
+        // ----- Do the extraction
+        $v_result = PclTarHandleExtractByIndex($v_tar, $v_index, $v_index_list[0], $v_index_list[1], $p_list_detail, $p_path, $p_remove_path, $p_tar_mode);
+      }
+    }
+
+    // ----- Close the tarfile
+    if ($p_tar_mode == "tar")
+      fclose($v_tar);
+    else
+      gzclose($v_tar);
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleExtractByIndex()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleExtractByIndex($p_tar, &$p_index_current, $p_index_start, $p_index_stop, &$p_list_detail, $p_path, $p_remove_path, $p_tar_mode)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleExtractByIndex", "archive_descr='$p_tar', index_current=$p_index_current, index_start='$p_index_start', index_stop='$p_index_stop', list, path=$p_path, remove_path='$p_remove_path', tar_mode=$p_tar_mode");
+    $v_result=1;
+    $v_nb = 0;
+
+    // TBC : I should replace all $v_tar by $p_tar in this function ....
+    $v_tar = $p_tar;
+
+    // ----- Look the number of elements already in $p_list_detail
+    $v_nb = sizeof($p_list_detail);
+
+    // ----- Read the blocks
+    While (!($v_end_of_file = ($p_tar_mode == "tar"?feof($v_tar):gzeof($v_tar))))
+    {
+      TrFctMessage(__FILE__, __LINE__, 3, "Looking for next file ...");
+      TrFctMessage(__FILE__, __LINE__, 3, "Index current=$p_index_current, range=[$p_index_start, $p_index_stop])");
+
+      if ($p_index_current > $p_index_stop)
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Stop extraction, past stop index");
+        break;
+      }
+
+      // ----- Clear cache of file infos
+      clearstatcache();
+
+      // ----- Reset extract tag
+      $v_extract_file = FALSE;
+      $v_extraction_stopped = 0;
+
+      // ----- Read the 512 bytes header
+      if ($p_tar_mode == "tar")
+        $v_binary_data = fread($v_tar, 512);
+      else
+        $v_binary_data = gzread($v_tar, 512);
+
+      // ----- Read the header properties
+      if (($v_result = PclTarHandleReadHeader($v_binary_data, $v_header)) != 1)
+      {
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      // ----- Look for empty blocks to skip
+      if ($v_header[filename] == "")
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Empty block found. End of archive ?");
+        continue;
+      }
+
+      TrFctMessage(__FILE__, __LINE__, 2, "Found file '$v_header[filename]', size '$v_header[size]'");
+
+      // ----- Look if file is in the range to be extracted
+      if (($p_index_current >= $p_index_start) && ($p_index_current <= $p_index_stop))
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' is in the range to be extracted");
+        $v_extract_file = TRUE;
+      }
+      else
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' is out of the range");
+        $v_extract_file = FALSE;
+      }
+
+      // ----- Look if this file need to be extracted
+      if ($v_extract_file)
+      {
+        if (($v_result = PclTarHandleExtractFile($v_tar, $v_header, $p_path, $p_remove_path, $p_tar_mode)) != 1)
+        {
+          // ----- Return
+          TrFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+      }
+
+      // ----- Look for file that is not to be extracted
+      else
+      {
+        // ----- Trace
+        TrFctMessage(__FILE__, __LINE__, 2, "Jump file '$v_header[filename]'");
+        TrFctMessage(__FILE__, __LINE__, 4, "Position avant jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]");
+
+        // ----- Jump to next file
+        if ($p_tar_mode == "tar")
+          fseek($v_tar, ($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))+(ceil(($v_header[size]/512))*512));
+        else
+          gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512));
+
+        TrFctMessage(__FILE__, __LINE__, 4, "Position aprs jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]");
+      }
+
+      if ($p_tar_mode == "tar")
+        $v_end_of_file = feof($v_tar);
+      else
+        $v_end_of_file = gzeof($v_tar);
+
+      // ----- File name and properties are logged if listing mode or file is extracted
+      if ($v_extract_file)
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Memorize info about file '$v_header[filename]'");
+
+        // ----- Log extracted files
+        if (($v_file_dir = dirname($v_header[filename])) == $v_header[filename])
+          $v_file_dir = "";
+        if ((substr($v_header[filename], 0, 1) == "/") && ($v_file_dir == ""))
+          $v_file_dir = "/";
+
+        // ----- Add the array describing the file into the list
+        $p_list_detail[$v_nb] = $v_header;
+
+        // ----- Increment
+        $v_nb++;
+      }
+
+      // ----- Increment the current file index
+      $p_index_current++;
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleExtractFile()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleExtractFile($p_tar, &$v_header, $p_path, $p_remove_path, $p_tar_mode)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleExtractFile", "archive_descr='$p_tar', path=$p_path, remove_path='$p_remove_path', tar_mode=$p_tar_mode");
+    $v_result=1;
+
+    // TBC : I should replace all $v_tar by $p_tar in this function ....
+    $v_tar = $p_tar;
+    $v_extract_file = 1;
+
+    $p_remove_path_size = strlen($p_remove_path);
+
+        // ----- Look for path to remove
+        if (($p_remove_path != "")
+            && (substr($v_header[filename], 0, $p_remove_path_size) == $p_remove_path))
+        {
+          TrFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '$v_header[filename]'");
+          // ----- Remove the path
+          $v_header[filename] = substr($v_header[filename], $p_remove_path_size);
+          TrFctMessage(__FILE__, __LINE__, 3, "Resulting file is '$v_header[filename]'");
+        }
+
+        // ----- Add the path to the file
+        if (($p_path != "./") && ($p_path != "/"))
+        {
+          // ----- Look for the path end '/'
+          while (substr($p_path, -1) == "/")
+          {
+            TrFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'");
+            $p_path = substr($p_path, 0, strlen($p_path)-1);
+            TrFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]");
+          }
+
+          // ----- Add the path
+          if (substr($v_header[filename], 0, 1) == "/")
+              $v_header[filename] = $p_path.$v_header[filename];
+          else
+            $v_header[filename] = $p_path."/".$v_header[filename];
+        }
+
+        // ----- Trace
+        TrFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '$v_header[filename]', size '$v_header[size]'");
+
+        // ----- Check that the file does not exists
+        if (file_exists($v_header[filename]))
+        {
+          TrFctMessage(__FILE__, __LINE__, 2, "File '$v_header[filename]' already exists");
+
+          // ----- Look if file is a directory
+          if (is_dir($v_header[filename]))
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is a directory");
+
+            // ----- Change the file status
+            $v_header[status] = "already_a_directory";
+
+            // ----- Skip the extract
+            $v_extraction_stopped = 1;
+            $v_extract_file = 0;
+          }
+          // ----- Look if file is write protected
+          else if (!is_writeable($v_header[filename]))
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is write protected");
+
+            // ----- Change the file status
+            $v_header[status] = "write_protected";
+
+            // ----- Skip the extract
+            $v_extraction_stopped = 1;
+            $v_extract_file = 0;
+          }
+          // ----- Look if the extracted file is older
+          else if (filemtime($v_header[filename]) > $v_header[mtime])
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Existing file '$v_header[filename]' is newer (".date("l dS of F Y h:i:s A", filemtime($v_header[filename])).") than the extracted file (".date("l dS of F Y h:i:s A", $v_header[mtime]).")");
+
+            // ----- Change the file status
+            $v_header[status] = "newer_exist";
+
+            // ----- Skip the extract
+            $v_extraction_stopped = 1;
+            $v_extract_file = 0;
+          }
+        }
+
+        // ----- Check the directory availability and create it if necessary
+        else
+        {
+          if ($v_header[typeflag]=="5")
+            $v_dir_to_check = $v_header[filename];
+          else if (!strstr($v_header[filename], "/"))
+            $v_dir_to_check = "";
+          else
+            $v_dir_to_check = dirname($v_header[filename]);
+
+          if (($v_result = PclTarHandlerDirCheck($v_dir_to_check)) != 1)
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '$v_header[filename]'");
+
+            // ----- Change the file status
+            $v_header[status] = "path_creation_fail";
+
+            // ----- Skip the extract
+            $v_extraction_stopped = 1;
+            $v_extract_file = 0;
+          }
+        }
+
+        // ----- Do the real bytes extraction (if not a directory)
+        if (($v_extract_file) && ($v_header[typeflag]!="5"))
+        {
+          // ----- Open the destination file in write mode
+          if (($v_dest_file = @fopen($v_header[filename], "wb")) == 0)
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Error while opening '$v_header[filename]' in write binary mode");
+
+            // ----- Change the file status
+            $v_header[status] = "write_error";
+
+            // ----- Jump to next file
+            TrFctMessage(__FILE__, __LINE__, 2, "Jump to next file");
+            if ($p_tar_mode == "tar")
+              fseek($v_tar, ftell($v_tar)+(ceil(($v_header[size]/512))*512));
+            else
+              gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512));
+          }
+          else
+          {
+            TrFctMessage(__FILE__, __LINE__, 2, "Start extraction of '$v_header[filename]'");
+
+            // ----- Read data
+            $n = floor($v_header[size]/512);
+            for ($i=0; $i<$n; $i++)
+            {
+              TrFctMessage(__FILE__, __LINE__, 3, "Read complete 512 bytes block number ".($i+1));
+              if ($p_tar_mode == "tar")
+                $v_content = fread($v_tar, 512);
+              else
+                $v_content = gzread($v_tar, 512);
+              fwrite($v_dest_file, $v_content, 512);
+            }
+            if (($v_header[size] % 512) != 0)
+            {
+              TrFctMessage(__FILE__, __LINE__, 3, "Read last ".($v_header[size] % 512)." bytes in a 512 block");
+              if ($p_tar_mode == "tar")
+                $v_content = fread($v_tar, 512);
+              else
+                $v_content = gzread($v_tar, 512);
+              fwrite($v_dest_file, $v_content, ($v_header[size] % 512));
+            }
+
+            // ----- Close the destination file
+            fclose($v_dest_file);
+
+            // ----- Change the file mode, mtime
+            touch($v_header[filename], $v_header[mtime]);
+            //chmod($v_header[filename], DecOct($v_header[mode]));
+          }
+
+          // ----- Check the file size
+          clearstatcache();
+          if (filesize($v_header[filename]) != $v_header[size])
+          {
+            // ----- Error log
+            PclErrorLog(-7, "Extracted file '$v_header[filename]' does not have the correct file size '".filesize($v_filename)."' ('$v_header[size]' expected). Archive may be corrupted.");
+
+            // ----- Return
+            TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+            return PclErrorCode();
+          }
+
+          // ----- Trace
+          TrFctMessage(__FILE__, __LINE__, 2, "Extraction done");
+        }
+        else
+        {
+          TrFctMessage(__FILE__, __LINE__, 2, "Extraction of file '$v_header[filename]' skipped.");
+
+          // ----- Jump to next file
+          TrFctMessage(__FILE__, __LINE__, 2, "Jump to next file");
+          if ($p_tar_mode == "tar")
+            fseek($v_tar, ftell($v_tar)+(ceil(($v_header[size]/512))*512));
+          else
+            gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512));
+        }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleDelete()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleDelete($p_tarname, $p_file_list, &$p_list_detail, $p_tar_mode)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleDelete", "archive='$p_tarname', list, tar_mode=$p_tar_mode");
+    $v_result=1;
+    $v_nb=0;
+
+    // ----- Look for regular tar file
+    if ($p_tar_mode == "tar")
+    {
+      // ----- Open file
+      TrFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+      if (($v_tar = @fopen($p_tarname, "rb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Open a temporary file in write mode
+      $v_temp_tarname = uniqid("pcltar-").".tmp";
+      TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname");
+      if (($v_temp_tar = @fopen($v_temp_tarname, "wb")) == 0)
+      {
+        // ----- Close tar file
+        fclose($v_tar);
+
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+    }
+
+    // ----- Look for compressed tar file
+    else
+    {
+      // ----- Open the file in read mode
+      TrFctMessage(__FILE__, __LINE__, 3, "Open file in gzip binary read mode");
+      if (($v_tar = @gzopen($p_tarname, "rb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Open a temporary file in write mode
+      $v_temp_tarname = uniqid("pcltar-").".tmp";
+      TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname");
+      if (($v_temp_tar = @gzopen($v_temp_tarname, "wb")) == 0)
+      {
+        // ----- Close tar file
+        gzclose($v_tar);
+
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+    }
+
+    // ----- Read the blocks
+    While (!($v_end_of_file = ($p_tar_mode == "tar"?feof($v_tar):gzeof($v_tar))))
+    {
+      TrFctMessage(__FILE__, __LINE__, 3, "Looking for next header ...");
+
+      // ----- Clear cache of file infos
+      clearstatcache();
+
+      // ----- Reset delete tag
+      $v_delete_file = FALSE;
+
+      // ----- Read the first 512 block header
+      if ($p_tar_mode == "tar")
+        $v_binary_data = fread($v_tar, 512);
+      else
+        $v_binary_data = gzread($v_tar, 512);
+
+      // ----- Read the header properties
+      if (($v_result = PclTarHandleReadHeader($v_binary_data, &$v_header)) != 1)
+      {
+        // ----- Close the archive file
+        if ($p_tar_mode == "tar")
+        {
+          fclose($v_tar);
+          fclose($v_temp_tar);
+        }
+        else
+        {
+          gzclose($v_tar);
+          gzclose($v_temp_tar);
+        }
+        @unlink($v_temp_tarname);
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      // ----- Look for empty blocks to skip
+      if ($v_header[filename] == "")
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Empty block found. End of archive ?");
+        continue;
+      }
+
+      TrFctMessage(__FILE__, __LINE__, 2, "Found file '$v_header[filename]', size '$v_header[size]'");
+
+      // ----- Look for filenames to delete
+      for ($i=0, $v_delete_file=FALSE; ($i<sizeof($p_file_list)) && (!$v_delete_file); $i++)
+      {
+        // ----- Compare the file names
+//        if ($p_file_list[$i] == $v_header[filename])
+        if (($v_len = strcmp($p_file_list[$i], $v_header[filename])) <= 0)
+        {
+          if ($v_len==0)
+          {
+            TrFctMessage(__FILE__, __LINE__, 3, "Found that '$v_header[filename]' need to be deleted");
+            $v_delete_file = TRUE;
+          }
+          else
+          {
+            TrFctMessage(__FILE__, __LINE__, 3, "Look if '$v_header[filename]' is a file in $p_file_list[$i]");
+            if (substr($v_header[filename], strlen($p_file_list[$i]), 1) == "/")
+            {
+              TrFctMessage(__FILE__, __LINE__, 3, "'$v_header[filename]' is a file in $p_file_list[$i]");
+              $v_delete_file = TRUE;
+            }
+          }
+        }
+      }
+
+      // ----- Copy files that do not need to be deleted
+      if (!$v_delete_file)
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Keep file '$v_header[filename]'");
+
+        // ----- Write the file header
+        if ($p_tar_mode == "tar")
+        {
+          fputs($v_temp_tar, $v_binary_data, 512);
+        }
+        else
+        {
+          gzputs($v_temp_tar, $v_binary_data, 512);
+        }
+
+        // ----- Write the file data
+        $n = ceil($v_header[size]/512);
+        for ($i=0; $i<$n; $i++)
+        {
+          TrFctMessage(__FILE__, __LINE__, 3, "Read complete 512 bytes block number ".($i+1));
+          if ($p_tar_mode == "tar")
+          {
+            $v_content = fread($v_tar, 512);
+            fwrite($v_temp_tar, $v_content, 512);
+          }
+          else
+          {
+            $v_content = gzread($v_tar, 512);
+            gzwrite($v_temp_tar, $v_content, 512);
+          }
+        }
+
+        // ----- File name and properties are logged if listing mode or file is extracted
+        TrFctMessage(__FILE__, __LINE__, 2, "Memorize info about file '$v_header[filename]'");
+
+        // ----- Add the array describing the file into the list
+        $p_list_detail[$v_nb] = $v_header;
+        $p_list_detail[$v_nb][status] = "ok";
+
+        // ----- Increment
+        $v_nb++;
+      }
+
+      // ----- Look for file that is to be deleted
+      else
+      {
+        // ----- Trace
+        TrFctMessage(__FILE__, __LINE__, 2, "Start deletion of '$v_header[filename]'");
+        TrFctMessage(__FILE__, __LINE__, 4, "Position avant jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]");
+
+        // ----- Jump to next file
+        if ($p_tar_mode == "tar")
+          fseek($v_tar, ftell($v_tar)+(ceil(($v_header[size]/512))*512));
+        else
+          gzseek($v_tar, gztell($v_tar)+(ceil(($v_header[size]/512))*512));
+
+        TrFctMessage(__FILE__, __LINE__, 4, "Position aprs jump [".($p_tar_mode=="tar"?ftell($v_tar):gztell($v_tar))."]");
+      }
+
+      // ----- Look for end of file
+      if ($p_tar_mode == "tar")
+        $v_end_of_file = feof($v_tar);
+      else
+        $v_end_of_file = gzeof($v_tar);
+    }
+
+    // ----- Write the last empty buffer
+    PclTarHandleFooter($v_temp_tar, $p_tar_mode);
+
+    // ----- Close the tarfile
+    if ($p_tar_mode == "tar")
+    {
+      fclose($v_tar);
+      fclose($v_temp_tar);
+    }
+    else
+    {
+      gzclose($v_tar);
+      gzclose($v_temp_tar);
+    }
+
+    // ----- Unlink tar file
+    if (!@unlink($p_tarname))
+    {
+      // ----- Error log
+      PclErrorLog(-11, "Error while deleting archive name $p_tarname");
+    }
+
+
+    // ----- Rename tar file
+    if (!@rename($v_temp_tarname, $p_tarname))
+    {
+      // ----- Error log
+      PclErrorLog(-12, "Error while renaming temporary file $v_temp_tarname to archive name $p_tarname");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleUpdate()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleUpdate($p_tarname, $p_file_list, &$p_list_detail, $p_tar_mode, $p_add_dir, $p_remove_dir)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleUpdate", "archive='$p_tarname', list, tar_mode=$p_tar_mode");
+    $v_result=1;
+    $v_nb=0;
+    $v_found_list = array();
+
+    // ----- Look for regular tar file
+    if ($p_tar_mode == "tar")
+    {
+      // ----- Open file
+      TrFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+      if (($v_tar = @fopen($p_tarname, "rb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Open a temporary file in write mode
+      $v_temp_tarname = uniqid("pcltar-").".tmp";
+      TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname");
+      if (($v_temp_tar = @fopen($v_temp_tarname, "wb")) == 0)
+      {
+        // ----- Close tar file
+        fclose($v_tar);
+
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+    }
+
+    // ----- Look for compressed tar file
+    else
+    {
+      // ----- Open the file in read mode
+      TrFctMessage(__FILE__, __LINE__, 3, "Open file in gzip binary read mode");
+      if (($v_tar = @gzopen($p_tarname, "rb")) == 0)
+      {
+        // ----- Error log
+        PclErrorLog(-2, "Unable to open file '$p_tarname' in binary read mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+
+      // ----- Open a temporary file in write mode
+      $v_temp_tarname = uniqid("pcltar-").".tmp";
+      TrFctMessage(__FILE__, __LINE__, 2, "Creating temporary archive file $v_temp_tarname");
+      if (($v_temp_tar = @gzopen($v_temp_tarname, "wb")) == 0)
+      {
+        // ----- Close tar file
+        gzclose($v_tar);
+
+        // ----- Error log
+        PclErrorLog(-1, "Unable to open file '$v_temp_tarname' in binary write mode");
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+        return PclErrorCode();
+      }
+    }
+
+    // ----- Prepare the list of files
+    for ($i=0; $i<sizeof($p_file_list); $i++)
+    {
+      // ----- Reset the found list
+      $v_found_list[$i] = 0;
+
+    // ----- Calculate the stored filename
+    $v_stored_list[$i] = $p_file_list[$i];
+    if ($p_remove_dir != "")
+    {
+      if (substr($p_file_list[$i], -1) != '/')
+        $p_remove_dir .= "/";
+
+      if (substr($p_file_list[$i], 0, strlen($p_remove_dir)) == $p_remove_dir)
+      {
+        $v_stored_list[$i] = substr($p_file_list[$i], strlen($p_remove_dir));
+        TrFctMessage(__FILE__, __LINE__, 3, "Remove path '$p_remove_dir' in file '$p_file_list[$i]' = '$v_stored_list[$i]'");
+      }
+    }
+    if ($p_add_dir != "")
+    {
+      if (substr($p_add_dir, -1) == "/")
+        $v_stored_list[$i] = $p_add_dir.$v_stored_list[$i];
+      else
+        $v_stored_list[$i] = $p_add_dir."/".$v_stored_list[$i];
+      TrFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_file_list[$i]' = '$v_stored_list[$i]'");
+    }
+    $v_stored_list[$i] = PclTarHandlePathReduction($v_stored_list[$i]);
+      TrFctMessage(__FILE__, __LINE__, 3, "After reduction '$v_stored_list[$i]'");
+    }
+
+
+    // ----- Update file cache
+    clearstatcache();
+
+    // ----- Read the blocks
+    While (!($v_end_of_file = ($p_tar_mode == "tar"?feof($v_tar):gzeof($v_tar))))
+    {
+      TrFctMessage(__FILE__, __LINE__, 3, "Looking for next header ...");
+
+      // ----- Clear cache of file infos
+      clearstatcache();
+
+      // ----- Reset current found filename
+      $v_current_filename = "";
+
+      // ----- Reset delete tag
+      $v_delete_file = FALSE;
+
+      // ----- Read the first 512 block header
+      if ($p_tar_mode == "tar")
+        $v_binary_data = fread($v_tar, 512);
+      else
+        $v_binary_data = gzread($v_tar, 512);
+
+      // ----- Read the header properties
+      if (($v_result = PclTarHandleReadHeader($v_binary_data, &$v_header)) != 1)
+      {
+        // ----- Close the archive file
+        if ($p_tar_mode == "tar")
+        {
+          fclose($v_tar);
+          fclose($v_temp_tar);
+        }
+        else
+        {
+          gzclose($v_tar);
+          gzclose($v_temp_tar);
+        }
+        @unlink($v_temp_tarname);
+
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      // ----- Look for empty blocks to skip
+      if ($v_header[filename] == "")
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Empty block found. End of archive ?");
+        continue;
+      }
+
+      TrFctMessage(__FILE__, __LINE__, 2, "Found file '$v_header[filename]', size '$v_header[size]'");
+
+      // ----- Look for filenames to update
+      for ($i=0, $v_update_file=FALSE, $v_found_file=FALSE; ($i<sizeof($v_stored_list)) && (!$v_update_file); $i++)
+      {
+        TrFctMessage(__FILE__, __LINE__, 4, "Compare with file '$v_stored_list[$i]'");
+
+        // ----- Compare the file names
+        if ($v_stored_list[$i] == $v_header[filename])
+        {
+          TrFctMessage(__FILE__, __LINE__, 3, "File '$v_stored_list[$i]' is present in archive");
+          TrFctMessage(__FILE__, __LINE__, 3, "File '$v_stored_list[$i]' mtime=".filemtime($p_file_list[$i])." ".date("l dS of F Y h:i:s A", filemtime($p_file_list[$i])));
+          TrFctMessage(__FILE__, __LINE__, 3, "Archived mtime=".$v_header[mtime]." ".date("l dS of F Y h:i:s A", $v_header[mtime]));
+
+          // ----- Store found informations
+          $v_found_file = TRUE;
+          $v_current_filename = $p_file_list[$i];
+
+          // ----- Look if the file need to be updated
+          if (filemtime($p_file_list[$i]) > $v_header[mtime])
+          {
+            TrFctMessage(__FILE__, __LINE__, 3, "File '$p_file_list[$i]' need to be updated");
+            $v_update_file = TRUE;
+          }
+          else
+          {
+            TrFctMessage(__FILE__, __LINE__, 3, "File '$p_file_list[$i]' does not need to be updated");
+            $v_update_file = FALSE;
+          }
+
+          // ----- Flag the name in order not to add the file at the end
+          $v_found_list[$i] = 1;
+        }
+        else
+        {
+          TrFctMessage(__FILE__, __LINE__, 4, "File '$p_file_list[$i]' is not '$v_header[filename]'");
+        }
+      }
+
+      // ----- Copy files that do not need to be updated
+      if (!$v_update_file)
+      {
+        TrFctMessage(__FILE__, __LINE__, 2, "Keep file '$v_header[filename]'");
+
+        // ----- Write the file header
+        if ($p_tar_mode == "tar")
+        {
+          fputs($v_temp_tar, $v_binary_data, 512);
+        }
+        else
+        {
+          gzputs($v_temp_tar, $v_binary_data, 512);
+        }
+
+        // ----- Write the file data
+        $n = ceil($v_header[size]/512);
+        for ($j=0; $j<$n; $j++)
+        {
+          TrFctMessage(__FILE__, __LINE__, 3, "Read complete 512 bytes block number ".($j+1));
+          if ($p_tar_mode == "tar")
+          {
+            $v_content = fread($v_tar, 512);
+            fwrite($v_temp_tar, $v_content, 512);
+          }
+          else
+          {
+            $v_content = gzread($v_tar, 512);
+            gzwrite($v_temp_tar, $v_content, 512);
+          }
+        }
+
+        // ----- File name and properties are logged if listing mode or file is extracted
+        TrFctMessage(__FILE__, __LINE__, 2, "Memorize info about file '$v_header[filename]'");
+
+        // ----- Add the array describing the file into the list
+        $p_list_detail[$v_nb] = $v_header;
+        $p_list_detail[$v_nb][status] = ($v_found_file?"not_updated":"ok");
+
+        // ----- Increment
+        $v_nb++;
+      }
+
+      // ----- Look for file that need to be updated
+      else
+      {
+        // ----- Trace
+        TrFctMessage(__FILE__, __LINE__, 2, "Start update of file '$v_current_filename'");
+
+        // ----- Store the old file size
+        $v_old_size = $v_header[size];
+
+        // ----- Add the file
+        if (($v_result = PclTarHandleAddFile($v_temp_tar, $v_current_filename, $p_tar_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1)
+        {
+          // ----- Close the tarfile
+          if ($p_tar_mode == "tar")
+          {
+            fclose($v_tar);
+            fclose($v_temp_tar);
+          }
+          else
+          {
+            gzclose($v_tar);
+            gzclose($v_temp_tar);
+          }
+          @unlink($p_temp_tarname);
+
+          // ----- Return status
+          TrFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+
+        // ----- Trace
+        TrFctMessage(__FILE__, __LINE__, 2, "Skip old file '$v_header[filename]'");
+
+        // ----- Jump to next file
+        if ($p_tar_mode == "tar")
+          fseek($v_tar, ftell($v_tar)+(ceil(($v_old_size/512))*512));
+        else
+          gzseek($v_tar, gztell($v_tar)+(ceil(($v_old_size/512))*512));
+
+        // ----- Add the array describing the file into the list
+        $p_list_detail[$v_nb] = $v_header;
+        $p_list_detail[$v_nb][status] = "updated";
+
+        // ----- Increment
+        $v_nb++;
+      }
+
+      // ----- Look for end of file
+      if ($p_tar_mode == "tar")
+        $v_end_of_file = feof($v_tar);
+      else
+        $v_end_of_file = gzeof($v_tar);
+    }
+
+    // ----- Look for files that does not exists in the archive and need to be added
+    for ($i=0; $i<sizeof($p_file_list); $i++)
+    {
+      // ----- Look if file not found in the archive
+      if (!$v_found_list[$i])
+      {
+        TrFctMessage(__FILE__, __LINE__, 3, "File '$p_file_list[$i]' need to be added");
+
+        // ----- Add the file
+        if (($v_result = PclTarHandleAddFile($v_temp_tar, $p_file_list[$i], $p_tar_mode, $v_header, $p_add_dir, $p_remove_dir)) != 1)
+        {
+          // ----- Close the tarfile
+          if ($p_tar_mode == "tar")
+          {
+            fclose($v_tar);
+            fclose($v_temp_tar);
+          }
+          else
+          {
+            gzclose($v_tar);
+            gzclose($v_temp_tar);
+          }
+          @unlink($p_temp_tarname);
+
+          // ----- Return status
+          TrFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+
+        // ----- Add the array describing the file into the list
+        $p_list_detail[$v_nb] = $v_header;
+        $p_list_detail[$v_nb][status] = "added";
+
+        // ----- Increment
+        $v_nb++;
+      }
+      else
+      {
+        TrFctMessage(__FILE__, __LINE__, 3, "File '$p_file_list[$i]' was already updated if needed");
+      }
+    }
+
+    // ----- Write the last empty buffer
+    PclTarHandleFooter($v_temp_tar, $p_tar_mode);
+
+    // ----- Close the tarfile
+    if ($p_tar_mode == "tar")
+    {
+      fclose($v_tar);
+      fclose($v_temp_tar);
+    }
+    else
+    {
+      gzclose($v_tar);
+      gzclose($v_temp_tar);
+    }
+
+    // ----- Unlink tar file
+    if (!@unlink($p_tarname))
+    {
+      // ----- Error log
+      PclErrorLog(-11, "Error while deleting archive name $p_tarname");
+    }
+
+
+    // ----- Rename tar file
+    if (!@rename($v_temp_tarname, $p_tarname))
+    {
+      // ----- Error log
+      PclErrorLog(-12, "Error while renaming temporary file $v_temp_tarname to archive name $p_tarname");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleReadHeader()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleReadHeader($v_binary_data, &$v_header)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleReadHeader", "");
+    $v_result=1;
+
+    // ----- Read the 512 bytes header
+    /*
+    if ($p_tar_mode == "tar")
+      $v_binary_data = fread($p_tar, 512);
+    else
+      $v_binary_data = gzread($p_tar, 512);
+    */
+
+    // ----- Look for no more block
+    if (strlen($v_binary_data)==0)
+    {
+      $v_header[filename] = "";
+      $v_header[status] = "empty";
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, $v_result, "End of archive found");
+      return $v_result;
+    }
+
+    // ----- Look for invalid block size
+    if (strlen($v_binary_data) != 512)
+    {
+      $v_header[filename] = "";
+      $v_header[status] = "invalid_header";
+      TrFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data));
+
+      // ----- Error log
+      PclErrorLog(-10, "Invalid block size : ".strlen($v_binary_data));
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Calculate the checksum
+    $v_checksum = 0;
+    // ..... First part of the header
+    for ($i=0; $i<148; $i++)
+    {
+      $v_checksum+=ord(substr($v_binary_data,$i,1));
+    }
+    // ..... Ignore the checksum value and replace it by ' ' (space)
+    for ($i=148; $i<156; $i++)
+    {
+      $v_checksum += ord(' ');
+    }
+    // ..... Last part of the header
+    for ($i=156; $i<512; $i++)
+    {
+      $v_checksum+=ord(substr($v_binary_data,$i,1));
+    }
+    TrFctMessage(__FILE__, __LINE__, 3, "Calculated checksum : $v_checksum");
+
+    // ----- Extract the values
+    TrFctMessage(__FILE__, __LINE__, 2, "Header : '$v_binary_data'");
+    $v_data = unpack("a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor", $v_binary_data);
+
+    // ----- Extract the checksum for check
+    $v_header[checksum] = OctDec(trim($v_data[checksum]));
+    TrFctMessage(__FILE__, __LINE__, 3, "File checksum : $v_header[checksum]");
+    if ($v_header[checksum] != $v_checksum)
+    {
+      TrFctMessage(__FILE__, __LINE__, 2, "File checksum is invalid : $v_checksum calculated, $v_header[checksum] expected");
+
+      $v_header[filename] = "";
+      $v_header[status] = "invalid_header";
+
+      // ----- Look for last block (empty block)
+      if (($v_checksum == 256) && ($v_header[checksum] == 0))
+      {
+        $v_header[status] = "empty";
+        // ----- Return
+        TrFctEnd(__FILE__, __LINE__, $v_result, "End of archive found");
+        return $v_result;
+      }
+
+      // ----- Error log
+      PclErrorLog(-13, "Invalid checksum : $v_checksum calculated, $v_header[checksum] expected");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+    TrFctMessage(__FILE__, __LINE__, 2, "File checksum is valid ($v_checksum)");
+
+    // ----- Extract the properties
+    $v_header[filename] = trim($v_data[filename]);
+    TrFctMessage(__FILE__, __LINE__, 2, "Name : '$v_header[filename]'");
+    $v_header[mode] = OctDec(trim($v_data[mode]));
+    TrFctMessage(__FILE__, __LINE__, 2, "Mode : '".DecOct($v_header[mode])."'");
+    $v_header[uid] = OctDec(trim($v_data[uid]));
+    TrFctMessage(__FILE__, __LINE__, 2, "Uid : '$v_header[uid]'");
+    $v_header[gid] = OctDec(trim($v_data[gid]));
+    TrFctMessage(__FILE__, __LINE__, 2, "Gid : '$v_header[gid]'");
+    $v_header[size] = OctDec(trim($v_data[size]));
+    TrFctMessage(__FILE__, __LINE__, 2, "Size : '$v_header[size]'");
+    $v_header[mtime] = OctDec(trim($v_data[mtime]));
+    TrFctMessage(__FILE__, __LINE__, 2, "Date : ".date("l dS of F Y h:i:s A", $v_header[mtime]));
+    if (($v_header[typeflag] = $v_data[typeflag]) == "5")
+    {
+      $v_header[size] = 0;
+      TrFctMessage(__FILE__, __LINE__, 2, "Size (folder) : '$v_header[size]'");
+    }
+    TrFctMessage(__FILE__, __LINE__, 2, "File typeflag : $v_header[typeflag]");
+    /* ----- All these fields are removed form the header because they do not carry interesting info
+    $v_header[link] = trim($v_data[link]);
+    TrFctMessage(__FILE__, __LINE__, 2, "Linkname : $v_header[linkname]");
+    $v_header[magic] = trim($v_data[magic]);
+    TrFctMessage(__FILE__, __LINE__, 2, "Magic : $v_header[magic]");
+    $v_header[version] = trim($v_data[version]);
+    TrFctMessage(__FILE__, __LINE__, 2, "Version : $v_header[version]");
+    $v_header[uname] = trim($v_data[uname]);
+    TrFctMessage(__FILE__, __LINE__, 2, "Uname : $v_header[uname]");
+    $v_header[gname] = trim($v_data[gname]);
+    TrFctMessage(__FILE__, __LINE__, 2, "Gname : $v_header[gname]");
+    $v_header[devmajor] = trim($v_data[devmajor]);
+    TrFctMessage(__FILE__, __LINE__, 2, "Devmajor : $v_header[devmajor]");
+    $v_header[devminor] = trim($v_data[devminor]);
+    TrFctMessage(__FILE__, __LINE__, 2, "Devminor : $v_header[devminor]");
+    */
+
+    // ----- Set the status field
+    $v_header[status] = "ok";
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandlerDirCheck()
+  // Description :
+  //   Check if a directory exists, if not it creates it and all the parents directory
+  //   which may be useful.
+  // Parameters :
+  //   $p_dir : Directory path to check (without / at the end).
+  // Return Values :
+  //    1 : OK
+  //   -1 : Unable to create directory
+  // --------------------------------------------------------------------------------
+  function PclTarHandlerDirCheck($p_dir)
+  {
+    $v_result = 1;
+
+    TrFctStart(__FILE__, __LINE__, "PclTarHandlerDirCheck", "$p_dir");
+
+    // ----- Check the directory availability
+    if ((is_dir($p_dir)) || ($p_dir == ""))
+    {
+      TrFctEnd(__FILE__, __LINE__, "'$p_dir' is a directory");
+      return 1;
+    }
+
+    // ----- Look for file alone
+    /*
+    if (!strstr("$p_dir", "/"))
+    {
+      TrFctEnd(__FILE__, __LINE__,  "'$p_dir' is a file with no directory");
+      return 1;
+    }
+    */
+
+    // ----- Extract parent directory
+    $p_parent_dir = dirname($p_dir);
+    TrFctMessage(__FILE__, __LINE__, 3, "Parent directory is '$p_parent_dir'");
+
+    // ----- Just a check
+    if ($p_parent_dir != $p_dir)
+    {
+      // ----- Look for parent directory
+      if ($p_parent_dir != "")
+      {
+        if (($v_result = PclTarHandlerDirCheck($p_parent_dir)) != 1)
+        {
+          TrFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+      }
+    }
+
+    // ----- Create the directory
+    TrFctMessage(__FILE__, __LINE__, 3, "Create directory '$p_dir'");
+    if (!@mkdir($p_dir, 0777))
+    {
+      // ----- Error log
+      PclErrorLog(-8, "Unable to create directory '$p_dir'");
+
+      // ----- Return
+      TrFctEnd(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+      return PclErrorCode();
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result, "Directory '$p_dir' created");
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandleExtension()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandleExtension($p_tarname)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandleExtension", "tar=$p_tarname");
+
+    // ----- Look for file extension
+    if ((substr($p_tarname, -7) == ".tar.gz") || (substr($p_tarname, -4) == ".tgz"))
+    {
+      TrFctMessage(__FILE__, __LINE__, 2, "Archive is a gzip tar");
+      $v_tar_mode = "tgz";
+    }
+    else if (substr($p_tarname, -4) == ".tar")
+    {
+      TrFctMessage(__FILE__, __LINE__, 2, "Archive is a tar");
+      $v_tar_mode = "tar";
+    }
+    else
+    {
+      // ----- Error log
+      PclErrorLog(-9, "Invalid archive extension");
+
+      TrFctMessage(__FILE__, __LINE__, PclErrorCode(), PclErrorString());
+
+      $v_tar_mode = "";
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_tar_mode);
+    return $v_tar_mode;
+  }
+  // --------------------------------------------------------------------------------
+
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTarHandlePathReduction()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclTarHandlePathReduction($p_dir)
+  {
+    TrFctStart(__FILE__, __LINE__, "PclTarHandlePathReduction", "dir='$p_dir'");
+    $v_result = "";
+
+    // ----- Look for not empty path
+    if ($p_dir != "")
+    {
+      // ----- Explode path by directory names
+      $v_list = explode("/", $p_dir);
+
+      // ----- Study directories from last to first
+      for ($i=sizeof($v_list)-1; $i>=0; $i--)
+      {
+        // ----- Look for current path
+        if ($v_list[$i] == ".")
+        {
+          // ----- Ignore this directory
+          // Should be the first $i=0, but no check is done
+        }
+        else if ($v_list[$i] == "..")
+        {
+          // ----- Ignore it and ignore the $i-1
+          $i--;
+        }
+        else if (($v_list[$i] == "") && ($i!=(sizeof($v_list)-1)) && ($i!=0))
+        {
+          // ----- Ignore only the double '//' in path,
+          // but not the first and last '/'
+        }
+        else
+        {
+          $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:"");
+        }
+      }
+    }
+
+    // ----- Return
+    TrFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+
+// ----- End of double include look
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/pcltrace.lib.php 75/e107_handlers/pcltrace.lib.php
--- 6171/e107_handlers/pcltrace.lib.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/pcltrace.lib.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,456 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+// --------------------------------------------------------------------------------
+// PhpConcept Library (PCL) Trace 1.0
+// --------------------------------------------------------------------------------
+// License GNU/GPL - Vincent Blavet - Janvier 2001
+// http://www.phpconcept.net & http://phpconcept.free.fr
+// --------------------------------------------------------------------------------
+// Franais :
+//   La description de l'usage de la librairie PCL Trace 1.0 n'est pas encore
+//   disponible. Celle-ci n'est pour le moment distribue qu'avec l'application
+//   et la librairie PhpZip.
+//   Une version indpendante sera bientot disponible sur http://www.phpconcept.net
+//
+// English :
+//   The PCL Trace 1.0 library description is not available yet. This library is
+//   released only with PhpZip application and library.
+//   An independant release will be soon available on http://www.phpconcept.net
+//
+// --------------------------------------------------------------------------------
+//
+//   * Avertissement :
+//
+//   Cette librairie a t cre de faon non professionnelle.
+//   Son usage est au risque et pril de celui qui l'utilise, en aucun cas l'auteur
+//   de ce code ne pourra tre tenu pour responsable des ventuels dgats qu'il pourrait
+//   engendrer.
+//   Il est entendu cependant que l'auteur a ralis ce code par plaisir et n'y a
+//   cach aucun virus, ni malveillance.
+//   Cette libairie est distribue sous la license GNU/GPL (http://www.gnu.org)
+//
+//   * Auteur :
+//
+//   Ce code a t crit par Vincent Blavet (vincent@blavet.net) sur son temps
+//   de loisir.
+//
+// --------------------------------------------------------------------------------
+
+// ----- Look for double include
+if (!defined("PCLTRACE_LIB"))
+{
+  define( "PCLTRACE_LIB", 1 );
+
+  // ----- Version
+  $g_pcl_trace_version = "1.0";
+
+  // ----- Internal variables
+  // These values must be change by PclTrace library functions
+  $g_pcl_trace_mode = "memory";
+  $g_pcl_trace_filename = "trace.txt";
+  $g_pcl_trace_name = array();
+  $g_pcl_trace_index = 0;
+  $g_pcl_trace_level = 0;
+  //$g_pcl_trace_entries = array();
+
+
+  // --------------------------------------------------------------------------------
+  // Function : TrOn($p_level, $p_mode, $p_filename)
+  // Description :
+  // Parameters :
+  //   $p_level : Trace level
+  //   $p_mode : Mode of trace displaying :
+  //             'normal' : messages are displayed at function call
+  //             'memory' : messages are memorized in a table and can be display by
+  //                        TrDisplay() function. (default)
+  //             'log'    : messages are writed in the file $p_filename
+  // --------------------------------------------------------------------------------
+  function TrOn($p_level=1, $p_mode="memory", $p_filename="trace.txt")
+  {
+    global $g_pcl_trace_level;
+    global $g_pcl_trace_mode;
+    global $g_pcl_trace_filename;
+    global $g_pcl_trace_name;
+    global $g_pcl_trace_index;
+    global $g_pcl_trace_entries;
+
+    // ----- Enable trace mode
+    $g_pcl_trace_level = $p_level;
+
+    // ----- Memorize mode and filename
+    switch ($p_mode) {
+      case "normal" :
+      case "memory" :
+      case "log" :
+        $g_pcl_trace_mode = $p_mode;
+      break;
+      default :
+        $g_pcl_trace_mode = "logged";
+    }
+
+    // ----- Memorize filename
+    $g_pcl_trace_filename = $p_filename;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : IsTrOn()
+  // Description :
+  // Return value :
+  //   The trace level (0 for disable).
+  // --------------------------------------------------------------------------------
+  function IsTrOn()
+  {
+    global $g_pcl_trace_level;
+
+    return($g_pcl_trace_level);
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : TrOff()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function TrOff()
+  {
+    global $g_pcl_trace_level;
+    global $g_pcl_trace_mode;
+    global $g_pcl_trace_filename;
+    global $g_pcl_trace_name;
+    global $g_pcl_trace_index;
+
+    // ----- Clean
+    $g_pcl_trace_mode = "memory";
+    unset($g_pcl_trace_entries);
+    unset($g_pcl_trace_name);
+    unset($g_pcl_trace_index);
+
+    // ----- Switch off trace
+    $g_pcl_trace_level = 0;
+  }
+  // --------------------------------------------------------------------------------
+
+
+  // --------------------------------------------------------------------------------
+  // Function : TrFctStart()
+  // Description :
+  //   Just a trace function for debbugging purpose before I use a better tool !!!!
+  //   Start and stop of this function is by $g_pcl_trace_level global variable.
+  // Parameters :
+  //   $p_level : Level of trace required.
+  // --------------------------------------------------------------------------------
+  function TrFctStart($p_file, $p_line, $p_name, $p_param="", $p_message="")
+  {
+    global $g_pcl_trace_level;
+    global $g_pcl_trace_mode;
+    global $g_pcl_trace_filename;
+    global $g_pcl_trace_name;
+    global $g_pcl_trace_index;
+    global $g_pcl_trace_entries;
+
+    // ----- Look for disabled trace
+    if ($g_pcl_trace_level < 1)
+      return;
+
+    // ----- Add the function name in the list
+    if (!isset($g_pcl_trace_name))
+      $g_pcl_trace_name = $p_name;
+    else
+      $g_pcl_trace_name .= ",".$p_name;
+
+    // ----- Update the function entry
+    $i = sizeof($g_pcl_trace_entries);
+    $g_pcl_trace_entries[$i][name] = $p_name;
+    $g_pcl_trace_entries[$i][param] = $p_param;
+    $g_pcl_trace_entries[$i][message] = "";
+    $g_pcl_trace_entries[$i][file] = $p_file;
+    $g_pcl_trace_entries[$i][line] = $p_line;
+    $g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
+    $g_pcl_trace_entries[$i][type] = "1"; // means start of function
+
+    // ----- Update the message entry
+    if ($p_message != "")
+    {
+    $i = sizeof($g_pcl_trace_entries);
+    $g_pcl_trace_entries[$i][name] = "";
+    $g_pcl_trace_entries[$i][param] = "";
+    $g_pcl_trace_entries[$i][message] = $p_message;
+    $g_pcl_trace_entries[$i][file] = $p_file;
+    $g_pcl_trace_entries[$i][line] = $p_line;
+    $g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
+    $g_pcl_trace_entries[$i][type] = "3"; // means message
+    }
+
+    // ----- Action depending on mode
+    PclTraceAction($g_pcl_trace_entries[$i]);
+
+    // ----- Increment the index
+    $g_pcl_trace_index++;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : TrFctEnd()
+  // Description :
+  //   Just a trace function for debbugging purpose before I use a better tool !!!!
+  //   Start and stop of this function is by $g_pcl_trace_level global variable.
+  // Parameters :
+  //   $p_level : Level of trace required.
+  // --------------------------------------------------------------------------------
+  function TrFctEnd($p_file, $p_line, $p_return=1, $p_message="")
+  {
+    global $g_pcl_trace_level;
+    global $g_pcl_trace_mode;
+    global $g_pcl_trace_filename;
+    global $g_pcl_trace_name;
+    global $g_pcl_trace_index;
+    global $g_pcl_trace_entries;
+
+    // ----- Look for disabled trace
+    if ($g_pcl_trace_level < 1)
+      return;
+
+    // ----- Extract the function name in the list
+    // ----- Remove the function name in the list
+    if (!($v_name = strrchr($g_pcl_trace_name, ",")))
+    {
+      $v_name = $g_pcl_trace_name;
+      $g_pcl_trace_name = "";
+    }
+    else
+    {
+      $g_pcl_trace_name = substr($g_pcl_trace_name, 0, strlen($g_pcl_trace_name)-strlen($v_name));
+      $v_name = substr($v_name, -strlen($v_name)+1);
+    }
+
+    // ----- Decrement the index
+    $g_pcl_trace_index--;
+
+    // ----- Update the message entry
+    if ($p_message != "")
+    {
+    $i = sizeof($g_pcl_trace_entries);
+    $g_pcl_trace_entries[$i][name] = "";
+    $g_pcl_trace_entries[$i][param] = "";
+    $g_pcl_trace_entries[$i][message] = $p_message;
+    $g_pcl_trace_entries[$i][file] = $p_file;
+    $g_pcl_trace_entries[$i][line] = $p_line;
+    $g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
+    $g_pcl_trace_entries[$i][type] = "3"; // means message
+    }
+
+    // ----- Update the function entry
+    $i = sizeof($g_pcl_trace_entries);
+    $g_pcl_trace_entries[$i][name] = $v_name;
+    $g_pcl_trace_entries[$i][param] = $p_return;
+    $g_pcl_trace_entries[$i][message] = "";
+    $g_pcl_trace_entries[$i][file] = $p_file;
+    $g_pcl_trace_entries[$i][line] = $p_line;
+    $g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
+    $g_pcl_trace_entries[$i][type] = "2"; // means end of function
+
+    // ----- Action depending on mode
+    PclTraceAction($g_pcl_trace_entries[$i]);
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : TrFctMessage()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function TrFctMessage($p_file, $p_line, $p_level, $p_message="")
+  {
+    global $g_pcl_trace_level;
+    global $g_pcl_trace_mode;
+    global $g_pcl_trace_filename;
+    global $g_pcl_trace_name;
+    global $g_pcl_trace_index;
+    global $g_pcl_trace_entries;
+
+    // ----- Look for disabled trace
+    if ($g_pcl_trace_level < $p_level)
+      return;
+
+    // ----- Update the entry
+    $i = sizeof($g_pcl_trace_entries);
+    $g_pcl_trace_entries[$i][name] = "";
+    $g_pcl_trace_entries[$i][param] = "";
+    $g_pcl_trace_entries[$i][message] = $p_message;
+    $g_pcl_trace_entries[$i][file] = $p_file;
+    $g_pcl_trace_entries[$i][line] = $p_line;
+    $g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
+    $g_pcl_trace_entries[$i][type] = "3"; // means message of function
+
+    // ----- Action depending on mode
+    PclTraceAction($g_pcl_trace_entries[$i]);
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : TrMessage()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function TrMessage($p_file, $p_line, $p_level, $p_message="")
+  {
+    global $g_pcl_trace_level;
+    global $g_pcl_trace_mode;
+    global $g_pcl_trace_filename;
+    global $g_pcl_trace_name;
+    global $g_pcl_trace_index;
+    global $g_pcl_trace_entries;
+
+    // ----- Look for disabled trace
+    if ($g_pcl_trace_level < $p_level)
+      return;
+
+    // ----- Update the entry
+    $i = sizeof($g_pcl_trace_entries);
+    $g_pcl_trace_entries[$i][name] = "";
+    $g_pcl_trace_entries[$i][param] = "";
+    $g_pcl_trace_entries[$i][message] = $p_message;
+    $g_pcl_trace_entries[$i][file] = $p_file;
+    $g_pcl_trace_entries[$i][line] = $p_line;
+    $g_pcl_trace_entries[$i][index] = $g_pcl_trace_index;
+    $g_pcl_trace_entries[$i][type] = "4"; // means simple message
+
+    // ----- Action depending on mode
+    PclTraceAction($g_pcl_trace_entries[$i]);
+  }
+  // --------------------------------------------------------------------------------
+
+
+  // --------------------------------------------------------------------------------
+  // Function : TrDisplay()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function TrDisplay()
+  {
+    global $g_pcl_trace_level;
+    global $g_pcl_trace_mode;
+    global $g_pcl_trace_filename;
+    global $g_pcl_trace_name;
+    global $g_pcl_trace_index;
+    global $g_pcl_trace_entries;
+
+    // ----- Look for disabled trace
+    if (($g_pcl_trace_level <= 0) || ($g_pcl_trace_mode != "memory"))
+      return;
+
+    $v_font = "\"Verdana, Arial, Helvetica, sans-serif\"";
+
+    // ----- Trace Header
+    echo "<table width=100% border=0 cellspacing=0 cellpadding=0>";
+    echo "<tr bgcolor=#0000CC>";
+    echo "<td bgcolor=#0000CC width=1>";
+    echo "</td>";
+    echo "<td><div align=center><font size=3 color=#FFFFFF face=$v_font>Trace</font></div></td>";
+    echo "</tr>";
+    echo "<tr>";
+    echo "<td bgcolor=#0000CC width=1>";
+    echo "</td>";
+    echo "<td>";
+
+    // ----- Content header
+    echo "<table width=100% border=0 cellspacing=0 cellpadding=0>";
+
+    // ----- Display
+    $v_again=0;
+    for ($i=0; $i<sizeof($g_pcl_trace_entries); $i++)
+    {
+      // ---- Row header
+      echo "<tr>";
+      echo "<td><table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
+      $n = ($g_pcl_trace_entries[$i][index]+1)*10;
+      echo "<td width=".$n."><table width=100% border=0 cellspacing=0 cellpadding=0><tr>";
+
+      for ($j=0; $j<=$g_pcl_trace_entries[$i][index]; $j++)
+      {
+        if ($j==$g_pcl_trace_entries[$i][index])
+        {
+          if (($g_pcl_trace_entries[$i][type] == 1) || ($g_pcl_trace_entries[$i][type] == 2))
+          echo "<td width=10><div align=center><font size=2 face=$v_font>+</font></div></td>";
+        }
+        else
+          echo "<td width=10><div align=center><font size=2 face=$v_font>|</font></div></td>";
+      }
+      //echo "<td>&nbsp</td>";
+      echo "</tr></table></td>";
+
+      echo "<td width=2></td>";
+      switch ($g_pcl_trace_entries[$i][type]) {
+        case 1:
+          echo "<td><font size=2 face=$v_font>".$g_pcl_trace_entries[$i][name]."(".$g_pcl_trace_entries[$i][param].")</font></td>";
+        break;
+        case 2:
+          echo "<td><font size=2 face=$v_font>".$g_pcl_trace_entries[$i][name]."()=".$g_pcl_trace_entries[$i][param]."</font></td>";
+        break;
+        case 3:
+        case 4:
+          echo "<td><table width=100% border=0 cellspacing=0 cellpadding=0><td width=20></td><td>";
+          echo "<font size=2 face=$v_font>".$g_pcl_trace_entries[$i][message]."</font>";
+          echo "</td></table></td>";
+        break;
+        default:
+        echo "<td><font size=2 face=$v_font>".$g_pcl_trace_entries[$i][name]."(".$g_pcl_trace_entries[$i][param].")</font></td>";
+      }
+      echo "</tr></table></td>";
+      echo "<td width=5></td>";
+      echo "<td><font size=1 face=$v_font>".basename($g_pcl_trace_entries[$i][file])."</font></td>";
+      echo "<td width=5></td>";
+      echo "<td><font size=1 face=$v_font>".$g_pcl_trace_entries[$i][line]."</font></td>";
+      echo "</tr>";
+    }
+
+    // ----- Content footer
+    echo "</table>";
+
+    // ----- Trace footer
+    echo "</td>";
+    echo "<td bgcolor=#0000CC width=1>";
+    echo "</td>";
+    echo "</tr>";
+    echo "<tr bgcolor=#0000CC>";
+    echo "<td bgcolor=#0000CC width=1>";
+    echo "</td>";
+    echo "<td><div align=center><font color=#FFFFFF face=$v_font>&nbsp</font></div></td>";
+    echo "</tr>";
+    echo "</table>";
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclTraceAction()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function PclTraceAction($p_entry)
+  {
+    global $g_pcl_trace_level;
+    global $g_pcl_trace_mode;
+    global $g_pcl_trace_filename;
+    global $g_pcl_trace_name;
+    global $g_pcl_trace_index;
+    global $g_pcl_trace_entries;
+
+    if ($g_pcl_trace_mode == "normal")
+    {
+      for ($i=0; $i<$p_entry[index]; $i++)
+        echo "---";
+      if ($p_entry[type] == 1)
+        echo "<b>".$p_entry[name]."</b>(".$p_entry[param].") : ".$p_entry[message]." [".$p_entry[file].", ".$p_entry[line]."]<br>";
+      else if ($p_entry[type] == 2)
+        echo "<b>".$p_entry[name]."</b>()=".$p_entry[param]." : ".$p_entry[message]." [".$p_entry[file].", ".$p_entry[line]."]<br>";
+      else
+        echo $p_entry[message]." [".$p_entry[file].", ".$p_entry[line]."]<br>";
+    }
+  }
+  // --------------------------------------------------------------------------------
+
+// ----- End of double include look
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/pclzip.lib.php 75/e107_handlers/pclzip.lib.php
--- 6171/e107_handlers/pclzip.lib.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/pclzip.lib.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,5209 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+// --------------------------------------------------------------------------------
+// PhpConcept Library - Zip Module 2.3
+// --------------------------------------------------------------------------------
+// License GNU/LGPL - Vincent Blavet - November 2004
+// http://www.phpconcept.net
+// --------------------------------------------------------------------------------
+//
+// Presentation :
+//   PclZip is a PHP library that manage ZIP archives.
+//   So far tests show that archives generated by PclZip are readable by
+//   WinZip application and other tools.
+//
+// Description :
+//   See readme.txt and http://www.phpconcept.net
+//
+// Warning :
+//   This library and the associated files are non commercial, non professional
+//   work.
+//   It should not have unexpected results. However if any damage is caused by
+//   this software the author can not be responsible.
+//   The use of this software is at the risk of the user.
+//
+// --------------------------------------------------------------------------------
+// $Id: pclzip.lib.php,v 1.2 2005/12/14 17:37:34 sweetas Exp $
+// --------------------------------------------------------------------------------
+
+  // ----- Constants
+  define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );
+  
+  // ----- File list separator
+  // In version 1.x of PclZip, the separator for file list is a space
+  // (which is not a very smart choice, specifically for windows paths !).
+  // A better separator should be a comma (,). This constant gives you the
+  // abilty to change that.
+  // However notice that changing this value, may have impact on existing
+  // scripts, using space separated filenames.
+  // Recommanded values for compatibility with older versions :
+  //define( 'PCLZIP_SEPARATOR', ' ' );
+  // Recommanded values for smart separation of filenames.
+  define( 'PCLZIP_SEPARATOR', ',' );
+
+  // ----- Error configuration
+  // 0 : PclZip Class integrated error handling
+  // 1 : PclError external library error handling. By enabling this
+  //     you must ensure that you have included PclError library.
+  // [2,...] : reserved for futur use
+  define( 'PCLZIP_ERROR_EXTERNAL', 0 );
+
+  // ----- Optional static temporary directory
+  //       By default temporary files are generated in the script current
+  //       path.
+  //       If defined :
+  //       - MUST BE terminated by a '/'.
+  //       - MUST be a valid, already created directory
+  //       Samples :
+  // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' );
+  // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' );
+  define( 'PCLZIP_TEMPORARY_DIR', '' );
+
+// --------------------------------------------------------------------------------
+// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED *****
+// --------------------------------------------------------------------------------
+
+  // ----- Global variables
+  $g_pclzip_version = "2.3";
+
+  // ----- Error codes
+  //   -1 : Unable to open file in binary write mode
+  //   -2 : Unable to open file in binary read mode
+  //   -3 : Invalid parameters
+  //   -4 : File does not exist
+  //   -5 : Filename is too long (max. 255)
+  //   -6 : Not a valid zip file
+  //   -7 : Invalid extracted file size
+  //   -8 : Unable to create directory
+  //   -9 : Invalid archive extension
+  //  -10 : Invalid archive format
+  //  -11 : Unable to delete file (unlink)
+  //  -12 : Unable to rename file (rename)
+  //  -13 : Invalid header checksum
+  //  -14 : Invalid archive size
+  define( 'PCLZIP_ERR_USER_ABORTED', 2 );
+  define( 'PCLZIP_ERR_NO_ERROR', 0 );
+  define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 );
+  define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 );
+  define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 );
+  define( 'PCLZIP_ERR_MISSING_FILE', -4 );
+  define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 );
+  define( 'PCLZIP_ERR_INVALID_ZIP', -6 );
+  define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 );
+  define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 );
+  define( 'PCLZIP_ERR_BAD_EXTENSION', -9 );
+  define( 'PCLZIP_ERR_BAD_FORMAT', -10 );
+  define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 );
+  define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 );
+  define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 );
+  define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 );
+  define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 );
+  define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 );
+  define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 );
+  define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 );
+  define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 );
+
+  // ----- Options values
+  define( 'PCLZIP_OPT_PATH', 77001 );
+  define( 'PCLZIP_OPT_ADD_PATH', 77002 );
+  define( 'PCLZIP_OPT_REMOVE_PATH', 77003 );
+  define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 );
+  define( 'PCLZIP_OPT_SET_CHMOD', 77005 );
+  define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 );
+  define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 );
+  define( 'PCLZIP_OPT_BY_NAME', 77008 );
+  define( 'PCLZIP_OPT_BY_INDEX', 77009 );
+  define( 'PCLZIP_OPT_BY_EREG', 77010 );
+  define( 'PCLZIP_OPT_BY_PREG', 77011 );
+  define( 'PCLZIP_OPT_COMMENT', 77012 );
+  define( 'PCLZIP_OPT_ADD_COMMENT', 77013 );
+  define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 );
+  define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 );
+  define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 );
+  define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 );
+  // Having big trouble with crypt. Need to multiply 2 long int
+  // which is not correctly supported by PHP ...
+  //define( 'PCLZIP_OPT_CRYPT', 77018 );
+
+  // ----- Call backs values
+  define( 'PCLZIP_CB_PRE_EXTRACT', 78001 );
+  define( 'PCLZIP_CB_POST_EXTRACT', 78002 );
+  define( 'PCLZIP_CB_PRE_ADD', 78003 );
+  define( 'PCLZIP_CB_POST_ADD', 78004 );
+  /* For futur use
+  define( 'PCLZIP_CB_PRE_LIST', 78005 );
+  define( 'PCLZIP_CB_POST_LIST', 78006 );
+  define( 'PCLZIP_CB_PRE_DELETE', 78007 );
+  define( 'PCLZIP_CB_POST_DELETE', 78008 );
+  */
+
+  // --------------------------------------------------------------------------------
+  // Class : PclZip
+  // Description :
+  //   PclZip is the class that represent a Zip archive.
+  //   The public methods allow the manipulation of the archive.
+  // Attributes :
+  //   Attributes must not be accessed directly.
+  // Methods :
+  //   PclZip() : Object creator
+  //   create() : Creates the Zip archive
+  //   listContent() : List the content of the Zip archive
+  //   extract() : Extract the content of the archive
+  //   properties() : List the properties of the archive
+  // --------------------------------------------------------------------------------
+   class PclZip
+  {
+    // ----- Filename of the zip file
+    var $zipname = '';
+
+    // ----- File descriptor of the zip file
+    var $zip_fd = 0;
+
+    // ----- Internal error handling
+    var $error_code = 1;
+    var $error_string = '';
+
+  // --------------------------------------------------------------------------------
+  // Function : PclZip()
+  // Description :
+  //   Creates a PclZip object and set the name of the associated Zip archive
+  //   filename.
+  //   Note that no real action is taken, if the archive does not exist it is not
+  //   created. Use create() for that.
+  // --------------------------------------------------------------------------------
+  function PclZip($p_zipname)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::PclZip', "zipname=$p_zipname");
+
+    // ----- Tests the zlib
+    if (!function_exists('gzopen'))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 1, "zlib extension seems to be missing");
+      die('Abort '.basename(__FILE__).' : Missing zlib extensions');
+    }
+
+    // ----- Set the attributes
+    $this->zipname = $p_zipname;
+    $this->zip_fd = 0;
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 1);
+    return;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function :
+  //   create($p_filelist, $p_add_dir="", $p_remove_dir="")
+  //   create($p_filelist, $p_option, $p_option_value, ...)
+  // Description :
+  //   This method supports two different synopsis. The first one is historical.
+  //   This method creates a Zip Archive. The Zip file is created in the
+  //   filesystem. The files and directories indicated in $p_filelist
+  //   are added in the archive. See the parameters description for the
+  //   supported format of $p_filelist.
+  //   When a directory is in the list, the directory and its content is added
+  //   in the archive.
+  //   In this synopsis, the function takes an optional variable list of
+  //   options. See bellow the supported options.
+  // Parameters :
+  //   $p_filelist : An array containing file or directory names, or
+  //                 a string containing one filename or one directory name, or
+  //                 a string containing a list of filenames and/or directory
+  //                 names separated by spaces.
+  //   $p_add_dir : A path to add before the real path of the archived file,
+  //                in order to have it memorized in the archive.
+  //   $p_remove_dir : A path to remove from the real path of the file to archive,
+  //                   in order to have a shorter path memorized in the archive.
+  //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir
+  //                   is removed first, before $p_add_dir is added.
+  // Options :
+  //   PCLZIP_OPT_ADD_PATH :
+  //   PCLZIP_OPT_REMOVE_PATH :
+  //   PCLZIP_OPT_REMOVE_ALL_PATH :
+  //   PCLZIP_OPT_COMMENT :
+  //   PCLZIP_CB_PRE_ADD :
+  //   PCLZIP_CB_POST_ADD :
+  // Return Values :
+  //   0 on failure,
+  //   The list of the added files, with a status of the add action.
+  //   (see PclZip::listContent() for list entry format)
+  // --------------------------------------------------------------------------------
+//  function create($p_filelist, $p_add_dir="", $p_remove_dir="")
+  function create($p_filelist /*, options */)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::create', "filelist='$p_filelist', ...");
+    $v_result=1;
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Set default values
+    $v_options = array();
+    $v_add_path = "";
+    $v_remove_path = "";
+    $v_remove_all_path = false;
+    $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;
+
+    // ----- Look for variable options arguments
+    $v_size = func_num_args();
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
+
+    // ----- Look for arguments
+    if ($v_size > 1) {
+      // ----- Get the arguments
+      $v_arg_list = &func_get_args();
+
+      // ----- Remove form the options list the first argument
+      array_shift($v_arg_list);
+      $v_size--;
+
+      // ----- Look for first arg
+      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected");
+
+        // ----- Parse the options
+        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+                                            array (PCLZIP_OPT_REMOVE_PATH => 'optional',
+                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
+                                                   PCLZIP_OPT_ADD_PATH => 'optional',
+                                                   PCLZIP_CB_PRE_ADD => 'optional',
+                                                   PCLZIP_CB_POST_ADD => 'optional',
+                                                   PCLZIP_OPT_NO_COMPRESSION => 'optional',
+                                                   PCLZIP_OPT_COMMENT => 'optional'
+                                                   //, PCLZIP_OPT_CRYPT => 'optional'
+												   ));
+        if ($v_result != 1) {
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+          return 0;
+        }
+
+        // ----- Set the arguments
+        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
+          $v_add_path = $v_options[PCLZIP_OPT_ADD_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
+          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
+          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
+        }
+      }
+
+      // ----- Look for 2 args
+      // Here we need to support the first historic synopsis of the
+      // method.
+      else {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");
+
+        // ----- Get the first argument
+        $v_add_path = $v_arg_list[0];
+
+        // ----- Look for the optional second argument
+        if ($v_size == 2) {
+          $v_remove_path = $v_arg_list[1];
+        }
+        else if ($v_size > 2) {
+          // ----- Error log
+          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
+		                       "Invalid number / type of arguments");
+
+          // ----- Return
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+          return 0;
+        }
+      }
+    }
+
+    // ----- Trace
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "add_path='$v_add_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_all_path?'true':'false')."'");
+
+    // ----- Look if the $p_filelist is really an array
+    $p_result_list = array();
+    if (is_array($p_filelist))
+    {
+      // ----- Call the create fct
+      $v_result = $this->privCreate($p_filelist, $p_result_list, $v_add_path, $v_remove_path, $v_remove_all_path, $v_options);
+    }
+
+    // ----- Look if the $p_filelist is a string
+    else if (is_string($p_filelist))
+    {
+      // ----- Create a list with the elements from the string
+      $v_list = explode(PCLZIP_SEPARATOR, $p_filelist);
+
+      // ----- Call the create fct
+      $v_result = $this->privCreate($v_list, $p_result_list, $v_add_path, $v_remove_path, $v_remove_all_path, $v_options);
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist");
+      $v_result = PCLZIP_ERR_INVALID_PARAMETER;
+    }
+
+    if ($v_result != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+      return 0;
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list);
+    return $p_result_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function :
+  //   add($p_filelist, $p_add_dir="", $p_remove_dir="")
+  //   add($p_filelist, $p_option, $p_option_value, ...)
+  // Description :
+  //   This method supports two synopsis. The first one is historical.
+  //   This methods add the list of files in an existing archive.
+  //   If a file with the same name already exists, it is added at the end of the
+  //   archive, the first one is still present.
+  //   If the archive does not exist, it is created.
+  // Parameters :
+  //   $p_filelist : An array containing file or directory names, or
+  //                 a string containing one filename or one directory name, or
+  //                 a string containing a list of filenames and/or directory
+  //                 names separated by spaces.
+  //   $p_add_dir : A path to add before the real path of the archived file,
+  //                in order to have it memorized in the archive.
+  //   $p_remove_dir : A path to remove from the real path of the file to archive,
+  //                   in order to have a shorter path memorized in the archive.
+  //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir
+  //                   is removed first, before $p_add_dir is added.
+  // Options :
+  //   PCLZIP_OPT_ADD_PATH :
+  //   PCLZIP_OPT_REMOVE_PATH :
+  //   PCLZIP_OPT_REMOVE_ALL_PATH :
+  //   PCLZIP_OPT_COMMENT :
+  //   PCLZIP_OPT_ADD_COMMENT :
+  //   PCLZIP_OPT_PREPEND_COMMENT :
+  //   PCLZIP_CB_PRE_ADD :
+  //   PCLZIP_CB_POST_ADD :
+  // Return Values :
+  //   0 on failure,
+  //   The list of the added files, with a status of the add action.
+  //   (see PclZip::listContent() for list entry format)
+  // --------------------------------------------------------------------------------
+//  function add($p_filelist, $p_add_dir="", $p_remove_dir="")
+  function add($p_filelist /* options */)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::add', "filelist='$p_filelist', ...");
+    $v_result=1;
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Set default values
+    $v_options = array();
+    $v_add_path = "";
+    $v_remove_path = "";
+    $v_remove_all_path = false;
+    $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;
+
+    // ----- Look for variable options arguments
+    $v_size = func_num_args();
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
+
+    // ----- Look for arguments
+    if ($v_size > 1) {
+      // ----- Get the arguments
+      $v_arg_list = &func_get_args();
+
+      // ----- Remove form the options list the first argument
+      array_shift($v_arg_list);
+      $v_size--;
+
+      // ----- Look for first arg
+      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options detected");
+
+        // ----- Parse the options
+        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+                                            array (PCLZIP_OPT_REMOVE_PATH => 'optional',
+                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
+                                                   PCLZIP_OPT_ADD_PATH => 'optional',
+                                                   PCLZIP_CB_PRE_ADD => 'optional',
+                                                   PCLZIP_CB_POST_ADD => 'optional',
+                                                   PCLZIP_OPT_NO_COMPRESSION => 'optional',
+                                                   PCLZIP_OPT_COMMENT => 'optional',
+                                                   PCLZIP_OPT_ADD_COMMENT => 'optional',
+                                                   PCLZIP_OPT_PREPEND_COMMENT => 'optional'
+                                                   //, PCLZIP_OPT_CRYPT => 'optional'
+												   ));
+        if ($v_result != 1) {
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+          return 0;
+        }
+
+        // ----- Set the arguments
+        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
+          $v_add_path = $v_options[PCLZIP_OPT_ADD_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
+          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
+          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
+        }
+      }
+
+      // ----- Look for 2 args
+      // Here we need to support the first historic synopsis of the
+      // method.
+      else {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");
+
+        // ----- Get the first argument
+        $v_add_path = $v_arg_list[0];
+
+        // ----- Look for the optional second argument
+        if ($v_size == 2) {
+          $v_remove_path = $v_arg_list[1];
+        }
+        else if ($v_size > 2) {
+          // ----- Error log
+          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
+
+          // ----- Return
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+          return 0;
+        }
+      }
+    }
+
+    // ----- Trace
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "add_path='$v_add_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_all_path?'true':'false')."'");
+
+    // ----- Look if the $p_filelist is really an array
+    $p_result_list = array();
+    if (is_array($p_filelist))
+    {
+      // ----- Call the create fct
+      $v_result = $this->privAdd($p_filelist, $p_result_list, $v_add_path, $v_remove_path, $v_remove_all_path, $v_options);
+    }
+
+    // ----- Look if the $p_filelist is a string
+    else if (is_string($p_filelist))
+    {
+      // ----- Create a list with the elements from the string
+      $v_list = explode(PCLZIP_SEPARATOR, $p_filelist);
+
+      // ----- Call the create fct
+      $v_result = $this->privAdd($v_list, $p_result_list, $v_add_path, $v_remove_path, $v_remove_all_path, $v_options);
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist");
+      $v_result = PCLZIP_ERR_INVALID_PARAMETER;
+    }
+
+    if ($v_result != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+      return 0;
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_result_list);
+    return $p_result_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : listContent()
+  // Description :
+  //   This public method, gives the list of the files and directories, with their
+  //   properties.
+  //   The properties of each entries in the list are (used also in other functions) :
+  //     filename : Name of the file. For a create or add action it is the filename
+  //                given by the user. For an extract function it is the filename
+  //                of the extracted file.
+  //     stored_filename : Name of the file / directory stored in the archive.
+  //     size : Size of the stored file.
+  //     compressed_size : Size of the file's data compressed in the archive
+  //                       (without the headers overhead)
+  //     mtime : Last known modification date of the file (UNIX timestamp)
+  //     comment : Comment associated with the file
+  //     folder : true | false
+  //     index : index of the file in the archive
+  //     status : status of the action (depending of the action) :
+  //              Values are :
+  //                ok : OK !
+  //                filtered : the file / dir is not extracted (filtered by user)
+  //                already_a_directory : the file can not be extracted because a
+  //                                      directory with the same name already exists
+  //                write_protected : the file can not be extracted because a file
+  //                                  with the same name already exists and is
+  //                                  write protected
+  //                newer_exist : the file was not extracted because a newer file exists
+  //                path_creation_fail : the file is not extracted because the folder
+  //                                     does not exists and can not be created
+  //                write_error : the file was not extracted because there was a
+  //                              error while writing the file
+  //                read_error : the file was not extracted because there was a error
+  //                             while reading the file
+  //                invalid_header : the file was not extracted because of an archive
+  //                                 format error (bad file header)
+  //   Note that each time a method can continue operating when there
+  //   is an action error on a file, the error is only logged in the file status.
+  // Return Values :
+  //   0 on an unrecoverable failure,
+  //   The list of the files in the archive.
+  // --------------------------------------------------------------------------------
+  function listContent()
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::listContent', "");
+    $v_result=1;
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Check archive
+    if (!$this->privCheckFormat()) {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+      return(0);
+    }
+
+    // ----- Call the extracting fct
+    $p_list = array();
+    if (($v_result = $this->privList($p_list)) != 1)
+    {
+      unset($p_list);
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
+      return(0);
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function :
+  //   extract($p_path="./", $p_remove_path="")
+  //   extract([$p_option, $p_option_value, ...])
+  // Description :
+  //   This method supports two synopsis. The first one is historical.
+  //   This method extract all the files / directories from the archive to the
+  //   folder indicated in $p_path.
+  //   If you want to ignore the 'root' part of path of the memorized files
+  //   you can indicate this in the optional $p_remove_path parameter.
+  //   By default, if a newer file with the same name already exists, the
+  //   file is not extracted.
+  //
+  //   If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions
+  //   are used, the path indicated in PCLZIP_OPT_ADD_PATH is append
+  //   at the end of the path value of PCLZIP_OPT_PATH.
+  // Parameters :
+  //   $p_path : Path where the files and directories are to be extracted
+  //   $p_remove_path : First part ('root' part) of the memorized path
+  //                    (if any similar) to remove while extracting.
+  // Options :
+  //   PCLZIP_OPT_PATH :
+  //   PCLZIP_OPT_ADD_PATH :
+  //   PCLZIP_OPT_REMOVE_PATH :
+  //   PCLZIP_OPT_REMOVE_ALL_PATH :
+  //   PCLZIP_CB_PRE_EXTRACT :
+  //   PCLZIP_CB_POST_EXTRACT :
+  // Return Values :
+  //   0 or a negative value on failure,
+  //   The list of the extracted files, with a status of the action.
+  //   (see PclZip::listContent() for list entry format)
+  // --------------------------------------------------------------------------------
+  //function extract($p_path="./", $p_remove_path="")
+  function extract(/* options */)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extract", "");
+    $v_result=1;
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Check archive
+    if (!$this->privCheckFormat()) {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+      return(0);
+    }
+
+    // ----- Set default values
+    $v_options = array();
+    $v_path = "./";
+    $v_remove_path = "";
+    $v_remove_all_path = false;
+
+    // ----- Look for variable options arguments
+    $v_size = func_num_args();
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
+
+    // ----- Default values for option
+    $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
+
+    // ----- Look for arguments
+    if ($v_size > 0) {
+      // ----- Get the arguments
+      $v_arg_list = &func_get_args();
+
+      // ----- Look for first arg
+      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options");
+
+        // ----- Parse the options
+        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+                                            array (PCLZIP_OPT_PATH => 'optional',
+                                                   PCLZIP_OPT_REMOVE_PATH => 'optional',
+                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
+                                                   PCLZIP_OPT_ADD_PATH => 'optional',
+                                                   PCLZIP_CB_PRE_EXTRACT => 'optional',
+                                                   PCLZIP_CB_POST_EXTRACT => 'optional',
+                                                   PCLZIP_OPT_SET_CHMOD => 'optional',
+                                                   PCLZIP_OPT_BY_NAME => 'optional',
+                                                   PCLZIP_OPT_BY_EREG => 'optional',
+                                                   PCLZIP_OPT_BY_PREG => 'optional',
+                                                   PCLZIP_OPT_BY_INDEX => 'optional',
+                                                   PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
+                                                   PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',
+                                                   PCLZIP_OPT_REPLACE_NEWER => 'optional'
+                                                   ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
+												    ));
+        if ($v_result != 1) {
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+          return 0;
+        }
+
+        // ----- Set the arguments
+        if (isset($v_options[PCLZIP_OPT_PATH])) {
+          $v_path = $v_options[PCLZIP_OPT_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
+          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
+          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
+          // ----- Check for '/' in last path char
+          if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
+            $v_path .= '/';
+          }
+          $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
+        }
+      }
+
+      // ----- Look for 2 args
+      // Here we need to support the first historic synopsis of the
+      // method.
+      else {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");
+
+        // ----- Get the first argument
+        $v_path = $v_arg_list[0];
+
+        // ----- Look for the optional second argument
+        if ($v_size == 2) {
+          $v_remove_path = $v_arg_list[1];
+        }
+        else if ($v_size > 2) {
+          // ----- Error log
+          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
+
+          // ----- Return
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
+          return 0;
+        }
+      }
+    }
+
+    // ----- Trace
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'");
+
+    // ----- Call the extracting fct
+    $p_list = array();
+    $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path,
+	                                     $v_remove_all_path, $v_options);
+    if ($v_result < 1) {
+      unset($p_list);
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
+      return(0);
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+
+  // --------------------------------------------------------------------------------
+  // Function :
+  //   extractByIndex($p_index, $p_path="./", $p_remove_path="")
+  //   extractByIndex($p_index, [$p_option, $p_option_value, ...])
+  // Description :
+  //   This method supports two synopsis. The first one is historical.
+  //   This method is doing a partial extract of the archive.
+  //   The extracted files or folders are identified by their index in the
+  //   archive (from 0 to n).
+  //   Note that if the index identify a folder, only the folder entry is
+  //   extracted, not all the files included in the archive.
+  // Parameters :
+  //   $p_index : A single index (integer) or a string of indexes of files to
+  //              extract. The form of the string is "0,4-6,8-12" with only numbers
+  //              and '-' for range or ',' to separate ranges. No spaces or ';'
+  //              are allowed.
+  //   $p_path : Path where the files and directories are to be extracted
+  //   $p_remove_path : First part ('root' part) of the memorized path
+  //                    (if any similar) to remove while extracting.
+  // Options :
+  //   PCLZIP_OPT_PATH :
+  //   PCLZIP_OPT_ADD_PATH :
+  //   PCLZIP_OPT_REMOVE_PATH :
+  //   PCLZIP_OPT_REMOVE_ALL_PATH :
+  //   PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and
+  //     not as files.
+  //     The resulting content is in a new field 'content' in the file
+  //     structure.
+  //     This option must be used alone (any other options are ignored).
+  //   PCLZIP_CB_PRE_EXTRACT :
+  //   PCLZIP_CB_POST_EXTRACT :
+  // Return Values :
+  //   0 on failure,
+  //   The list of the extracted files, with a status of the action.
+  //   (see PclZip::listContent() for list entry format)
+  // --------------------------------------------------------------------------------
+  function extractByIndex($p_index /* $options */)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::extractByIndex", "index='$p_index', ...");
+    $v_result=1;
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Check archive
+    if (!$this->privCheckFormat()) {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+      return(0);
+    }
+
+    // ----- Set default values
+    $v_options = array();
+    $v_path = "./";
+    $v_remove_path = "";
+    $v_remove_all_path = false;
+
+    // ----- Look for variable options arguments
+    $v_size = func_num_args();
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
+
+    // ----- Default values for option
+    $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
+
+    // ----- Look for arguments
+    if ($v_size > 1) {
+      // ----- Get the arguments
+      $v_arg_list = &func_get_args();
+
+      // ----- Remove form the options list the first argument
+      array_shift($v_arg_list);
+      $v_size--;
+
+      // ----- Look for first arg
+      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Variable list of options");
+
+        // ----- Parse the options
+        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+                                            array (PCLZIP_OPT_PATH => 'optional',
+                                                   PCLZIP_OPT_REMOVE_PATH => 'optional',
+                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
+                                                   PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
+                                                   PCLZIP_OPT_ADD_PATH => 'optional',
+                                                   PCLZIP_CB_PRE_EXTRACT => 'optional',
+                                                   PCLZIP_CB_POST_EXTRACT => 'optional',
+                                                   PCLZIP_OPT_SET_CHMOD => 'optional',
+                                                   PCLZIP_OPT_REPLACE_NEWER => 'optional'
+                                                   ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
+												   ));
+        if ($v_result != 1) {
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+          return 0;
+        }
+
+        // ----- Set the arguments
+        if (isset($v_options[PCLZIP_OPT_PATH])) {
+          $v_path = $v_options[PCLZIP_OPT_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
+          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
+          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
+        }
+        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
+          // ----- Check for '/' in last path char
+          if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
+            $v_path .= '/';
+          }
+          $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
+        }
+        if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {
+          $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING not set.");
+        }
+        else {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Option PCLZIP_OPT_EXTRACT_AS_STRING set.");
+        }
+      }
+
+      // ----- Look for 2 args
+      // Here we need to support the first historic synopsis of the
+      // method.
+      else {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Static synopsis");
+
+        // ----- Get the first argument
+        $v_path = $v_arg_list[0];
+
+        // ----- Look for the optional second argument
+        if ($v_size == 2) {
+          $v_remove_path = $v_arg_list[1];
+        }
+        else if ($v_size > 2) {
+          // ----- Error log
+          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
+
+          // ----- Return
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+          return 0;
+        }
+      }
+    }
+
+    // ----- Trace
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "index='$p_index', path='$v_path', remove_path='$v_remove_path', remove_all_path='".($v_remove_path?'true':'false')."'");
+
+    // ----- Trick
+    // Here I want to reuse extractByRule(), so I need to parse the $p_index
+    // with privParseOptions()
+    $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index);
+    $v_options_trick = array();
+    $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick,
+                                        array (PCLZIP_OPT_BY_INDEX => 'optional' ));
+    if ($v_result != 1) {
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+        return 0;
+    }
+    $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX];
+
+    // ----- Call the extracting fct
+    if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) {
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
+        return(0);
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function :
+  //   delete([$p_option, $p_option_value, ...])
+  // Description :
+  // Parameters :
+  //   None
+  // Options :
+  //   PCLZIP_OPT_BY_INDEX :
+  // Return Values :
+  //   0 on failure,
+  //   The list of the files which are still present in the archive.
+  //   (see PclZip::listContent() for list entry format)
+  // --------------------------------------------------------------------------------
+  function delete(/* options */)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::delete", "");
+    $v_result=1;
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Check archive
+    if (!$this->privCheckFormat()) {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+      return(0);
+    }
+
+    // ----- Set default values
+    $v_options = array();
+
+    // ----- Look for variable options arguments
+    $v_size = func_num_args();
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "$v_size arguments passed to the method");
+
+    // ----- Look for no arguments
+    if ($v_size <= 0) {
+        // ----- Error log
+        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing arguments");
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
+        return 0;
+    }
+
+    // ----- Get the arguments
+    $v_arg_list = &func_get_args();
+
+    // ----- Parse the options
+    $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
+                                        array (PCLZIP_OPT_BY_NAME => 'optional',
+                                               PCLZIP_OPT_BY_EREG => 'optional',
+                                               PCLZIP_OPT_BY_PREG => 'optional',
+                                               PCLZIP_OPT_BY_INDEX => 'optional' ));
+    if ($v_result != 1) {
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+        return 0;
+    }
+
+    // ----- Check that at least one rule is set
+    if (   (!isset($v_options[PCLZIP_OPT_BY_NAME]))
+        && (!isset($v_options[PCLZIP_OPT_BY_EREG]))
+        && (!isset($v_options[PCLZIP_OPT_BY_PREG]))
+        && (!isset($v_options[PCLZIP_OPT_BY_INDEX]))) {
+        // ----- Error log
+        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "At least one filtering rule must be set");
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
+        return 0;
+    }
+
+    // ----- Call the delete fct
+    $v_list = array();
+    if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1)
+    {
+      unset($v_list);
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0, PclZip::errorInfo());
+      return(0);
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_list);
+    return $v_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : deleteByIndex()
+  // Description :
+  //   ***** Deprecated *****
+  //   delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered.
+  // --------------------------------------------------------------------------------
+  function deleteByIndex($p_index)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::deleteByIndex", "index='$p_index'");
+    
+    $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $p_list);
+    return $p_list;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : properties()
+  // Description :
+  //   This method gives the properties of the archive.
+  //   The properties are :
+  //     nb : Number of files in the archive
+  //     comment : Comment associated with the archive file
+  //     status : not_exist, ok
+  // Parameters :
+  //   None
+  // Return Values :
+  //   0 on failure,
+  //   An array with the archive properties.
+  // --------------------------------------------------------------------------------
+  function properties()
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::properties", "");
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Check archive
+    if (!$this->privCheckFormat()) {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+      return(0);
+    }
+
+    // ----- Default properties
+    $v_prop = array();
+    $v_prop['comment'] = '';
+    $v_prop['nb'] = 0;
+    $v_prop['status'] = 'not_exist';
+
+    // ----- Look if file exists
+    if (@is_file($this->zipname))
+    {
+      // ----- Open the zip file
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+      if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
+      {
+        // ----- Error log
+        PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), 0);
+        return 0;
+      }
+
+      // ----- Read the central directory informations
+      $v_central_dir = array();
+      if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+        return 0;
+      }
+
+      // ----- Close the zip file
+      $this->privCloseFd();
+
+      // ----- Set the user attributes
+      $v_prop['comment'] = $v_central_dir['comment'];
+      $v_prop['nb'] = $v_central_dir['entries'];
+      $v_prop['status'] = 'ok';
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_prop);
+    return $v_prop;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : duplicate()
+  // Description :
+  //   This method creates an archive by copying the content of an other one. If
+  //   the archive already exist, it is replaced by the new one without any warning.
+  // Parameters :
+  //   $p_archive : The filename of a valid archive, or
+  //                a valid PclZip object.
+  // Return Values :
+  //   1 on success.
+  //   0 or a negative value on error (error code).
+  // --------------------------------------------------------------------------------
+  function duplicate($p_archive)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::duplicate", "");
+    $v_result = 1;
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Look if the $p_archive is a PclZip object
+    if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip'))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is valid PclZip object '".$p_archive->zipname."'");
+
+      // ----- Duplicate the archive
+      $v_result = $this->privDuplicate($p_archive->zipname);
+    }
+
+    // ----- Look if the $p_archive is a string (so a filename)
+    else if (is_string($p_archive))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The parameter is a filename '$p_archive'");
+
+      // ----- Check that $p_archive is a valid zip file
+      // TBC : Should also check the archive format
+      if (!is_file($p_archive)) {
+        // ----- Error log
+        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'");
+        $v_result = PCLZIP_ERR_MISSING_FILE;
+      }
+      else {
+        // ----- Duplicate the archive
+        $v_result = $this->privDuplicate($p_archive);
+      }
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
+      $v_result = PCLZIP_ERR_INVALID_PARAMETER;
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : merge()
+  // Description :
+  //   This method merge the $p_archive_to_add archive at the end of the current
+  //   one ($this).
+  //   If the archive ($this) does not exist, the merge becomes a duplicate.
+  //   If the $p_archive_to_add archive does not exist, the merge is a success.
+  // Parameters :
+  //   $p_archive_to_add : It can be directly the filename of a valid zip archive,
+  //                       or a PclZip object archive.
+  // Return Values :
+  //   1 on success,
+  //   0 or negative values on error (see below).
+  // --------------------------------------------------------------------------------
+  function merge($p_archive_to_add)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::merge", "");
+    $v_result = 1;
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Check archive
+    if (!$this->privCheckFormat()) {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, 0);
+      return(0);
+    }
+
+    // ----- Look if the $p_archive_to_add is a PclZip object
+    if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip'))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is valid PclZip object");
+
+      // ----- Merge the archive
+      $v_result = $this->privMerge($p_archive_to_add);
+    }
+
+    // ----- Look if the $p_archive_to_add is a string (so a filename)
+    else if (is_string($p_archive_to_add))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The parameter is a filename");
+
+      // ----- Create a temporary archive
+      $v_object_archive = new PclZip($p_archive_to_add);
+
+      // ----- Merge the archive
+      $v_result = $this->privMerge($v_object_archive);
+    }
+
+    // ----- Invalid variable
+    else
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
+      $v_result = PCLZIP_ERR_INVALID_PARAMETER;
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+
+
+  // --------------------------------------------------------------------------------
+  // Function : errorCode()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function errorCode()
+  {
+    if (PCLZIP_ERROR_EXTERNAL == 1) {
+      return(PclErrorCode());
+    }
+    else {
+      return($this->error_code);
+    }
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : errorName()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function errorName($p_with_code=false)
+  {
+    $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR',
+                      PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL',
+                      PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL',
+                      PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER',
+                      PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE',
+                      PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG',
+                      PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP',
+                      PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE',
+                      PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL',
+                      PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION',
+                      PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT',
+                      PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL',
+                      PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL',
+                      PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM',
+                      PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP',
+                      PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE',
+                      PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE',
+                      PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION',
+                      PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' );
+
+    if (isset($v_name[$this->error_code])) {
+      $v_value = $v_name[$this->error_code];
+    }
+    else {
+      $v_value = 'NoName';
+    }
+
+    if ($p_with_code) {
+      return($v_value.' ('.$this->error_code.')');
+    }
+    else {
+      return($v_value);
+    }
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : errorInfo()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function errorInfo($p_full=false)
+  {
+    if (PCLZIP_ERROR_EXTERNAL == 1) {
+      return(PclErrorString());
+    }
+    else {
+      if ($p_full) {
+        return($this->errorName(true)." : ".$this->error_string);
+      }
+      else {
+        return($this->error_string." [code ".$this->error_code."]");
+      }
+    }
+  }
+  // --------------------------------------------------------------------------------
+
+
+// --------------------------------------------------------------------------------
+// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS *****
+// *****                                                        *****
+// *****       THESES FUNCTIONS MUST NOT BE USED DIRECTLY       *****
+// --------------------------------------------------------------------------------
+
+
+
+  // --------------------------------------------------------------------------------
+  // Function : privCheckFormat()
+  // Description :
+  //   This method check that the archive exists and is a valid zip archive.
+  //   Several level of check exists. (futur)
+  // Parameters :
+  //   $p_level : Level of check. Default 0.
+  //              0 : Check the first bytes (magic codes) (default value))
+  //              1 : 0 + Check the central directory (futur)
+  //              2 : 1 + Check each file header (futur)
+  // Return Values :
+  //   true on success,
+  //   false on error, the error code is set.
+  // --------------------------------------------------------------------------------
+  function privCheckFormat($p_level=0)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFormat", "");
+    $v_result = true;
+
+	// ----- Reset the file system cache
+    clearstatcache();
+
+    // ----- Reset the error handler
+    $this->privErrorReset();
+
+    // ----- Look if the file exits
+    if (!is_file($this->zipname)) {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'");
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo());
+      return(false);
+    }
+
+    // ----- Check that the file is readeable
+    if (!is_readable($this->zipname)) {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'");
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, false, PclZip::errorInfo());
+      return(false);
+    }
+
+    // ----- Check the magic code
+    // TBC
+
+    // ----- Check the central header
+    // TBC
+
+    // ----- Check each file header
+    // TBC
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privParseOptions()
+  // Description :
+  //   This internal methods reads the variable list of arguments ($p_options_list,
+  //   $p_size) and generate an array with the options and values ($v_result_list).
+  //   $v_requested_options contains the options that can be present and those that
+  //   must be present.
+  //   $v_requested_options is an array, with the option value as key, and 'optional',
+  //   or 'mandatory' as value.
+  // Parameters :
+  //   See above.
+  // Return Values :
+  //   1 on success.
+  //   0 on failure.
+  // --------------------------------------------------------------------------------
+  function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privParseOptions", "");
+    $v_result=1;
+
+    // ----- Read the options
+    $i=0;
+    while ($i<$p_size) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Looking for table index $i, option = '".PclZipUtilOptionText($p_options_list[$i])."(".$p_options_list[$i].")'");
+
+      // ----- Check if the option is requested
+      if (!isset($v_requested_options[$p_options_list[$i]])) {
+        // ----- Error log
+        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method");
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+        return PclZip::errorCode();
+      }
+
+      // ----- Look for next option
+      switch ($p_options_list[$i]) {
+        // ----- Look for options that request a path value
+        case PCLZIP_OPT_PATH :
+        case PCLZIP_OPT_REMOVE_PATH :
+        case PCLZIP_OPT_ADD_PATH :
+          // ----- Check the number of parameters
+          if (($i+1) >= $p_size) {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+
+          // ----- Get the value
+          $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false);
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
+          $i++;
+        break;
+
+        // ----- Look for options that request an array of string for value
+        case PCLZIP_OPT_BY_NAME :
+          // ----- Check the number of parameters
+          if (($i+1) >= $p_size) {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+
+          // ----- Get the value
+          if (is_string($p_options_list[$i+1])) {
+              $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1];
+          }
+          else if (is_array($p_options_list[$i+1])) {
+              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
+          }
+          else {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+          ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
+          $i++;
+        break;
+
+        // ----- Look for options that request an EREG or PREG expression
+        case PCLZIP_OPT_BY_EREG :
+        case PCLZIP_OPT_BY_PREG :
+        //case PCLZIP_OPT_CRYPT :
+          // ----- Check the number of parameters
+          if (($i+1) >= $p_size) {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+
+          // ----- Get the value
+          if (is_string($p_options_list[$i+1])) {
+              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
+          }
+          else {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
+          $i++;
+        break;
+
+        // ----- Look for options that takes a string
+        case PCLZIP_OPT_COMMENT :
+        case PCLZIP_OPT_ADD_COMMENT :
+        case PCLZIP_OPT_PREPEND_COMMENT :
+          // ----- Check the number of parameters
+          if (($i+1) >= $p_size) {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE,
+			                     "Missing parameter value for option '"
+								 .PclZipUtilOptionText($p_options_list[$i])
+								 ."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+
+          // ----- Get the value
+          if (is_string($p_options_list[$i+1])) {
+              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
+          }
+          else {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE,
+			                     "Wrong parameter value for option '"
+								 .PclZipUtilOptionText($p_options_list[$i])
+								 ."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
+          $i++;
+        break;
+
+        // ----- Look for options that request an array of index
+        case PCLZIP_OPT_BY_INDEX :
+          // ----- Check the number of parameters
+          if (($i+1) >= $p_size) {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+
+          // ----- Get the value
+          $v_work_list = array();
+          if (is_string($p_options_list[$i+1])) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is a string '".$p_options_list[$i+1]."'");
+
+              // ----- Remove spaces
+              $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', '');
+
+              // ----- Parse items
+              $v_work_list = explode(",", $p_options_list[$i+1]);
+          }
+          else if (is_integer($p_options_list[$i+1])) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an integer '".$p_options_list[$i+1]."'");
+              $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];
+          }
+          else if (is_array($p_options_list[$i+1])) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Index value is an array");
+              $v_work_list = $p_options_list[$i+1];
+          }
+          else {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+          
+          // ----- Reduce the index list
+          // each index item in the list must be a couple with a start and
+          // an end value : [0,3], [5-5], [8-10], ...
+          // ----- Check the format of each item
+          $v_sort_flag=false;
+          $v_sort_value=0;
+          for ($j=0; $j<sizeof($v_work_list); $j++) {
+              // ----- Explode the item
+              $v_item_list = explode("-", $v_work_list[$j]);
+              $v_size_item_list = sizeof($v_item_list);
+              
+              // ----- TBC : Here we might check that each item is a
+              // real integer ...
+              
+              // ----- Look for single value
+              if ($v_size_item_list == 1) {
+                  // ----- Set the option value
+                  $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
+                  $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[0];
+              }
+              elseif ($v_size_item_list == 2) {
+                  // ----- Set the option value
+                  $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
+                  $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[1];
+              }
+              else {
+                  // ----- Error log
+                  PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+                  // ----- Return
+                  //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+                  return PclZip::errorCode();
+              }
+
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extracted index item = [".$v_result_list[$p_options_list[$i]][$j]['start'].",".$v_result_list[$p_options_list[$i]][$j]['end']."]");
+
+              // ----- Look for list sort
+              if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The list should be sorted ...");
+                  $v_sort_flag=true;
+
+                  // ----- TBC : An automatic sort should be writen ...
+                  // ----- Error log
+                  PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Invalid order of index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+                  // ----- Return
+                  //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+                  return PclZip::errorCode();
+              }
+              $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];
+          }
+          
+          // ----- Sort the items
+          if ($v_sort_flag) {
+              // TBC : To Be Completed
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "List sorting is not yet write ...");
+          }
+
+          // ----- Next option
+          $i++;
+        break;
+
+        // ----- Look for options that request no value
+        case PCLZIP_OPT_REMOVE_ALL_PATH :
+        case PCLZIP_OPT_EXTRACT_AS_STRING :
+        case PCLZIP_OPT_NO_COMPRESSION :
+        case PCLZIP_OPT_EXTRACT_IN_OUTPUT :
+        case PCLZIP_OPT_REPLACE_NEWER :
+        case PCLZIP_OPT_STOP_ON_ERROR :
+          $v_result_list[$p_options_list[$i]] = true;
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
+        break;
+
+        // ----- Look for options that request an octal value
+        case PCLZIP_OPT_SET_CHMOD :
+          // ----- Check the number of parameters
+          if (($i+1) >= $p_size) {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+
+          // ----- Get the value
+          $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "".PclZipUtilOptionText($p_options_list[$i])." = '".$v_result_list[$p_options_list[$i]]."'");
+          $i++;
+        break;
+
+        // ----- Look for options that request a call-back
+        case PCLZIP_CB_PRE_EXTRACT :
+        case PCLZIP_CB_POST_EXTRACT :
+        case PCLZIP_CB_PRE_ADD :
+        case PCLZIP_CB_POST_ADD :
+        /* for futur use
+        case PCLZIP_CB_PRE_DELETE :
+        case PCLZIP_CB_POST_DELETE :
+        case PCLZIP_CB_PRE_LIST :
+        case PCLZIP_CB_POST_LIST :
+        */
+          // ----- Check the number of parameters
+          if (($i+1) >= $p_size) {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+
+          // ----- Get the value
+          $v_function_name = $p_options_list[$i+1];
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "call-back ".PclZipUtilOptionText($p_options_list[$i])." = '".$v_function_name."'");
+
+          // ----- Check that the value is a valid existing function
+          if (!function_exists($v_function_name)) {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+
+          // ----- Set the attribute
+          $v_result_list[$p_options_list[$i]] = $v_function_name;
+          $i++;
+        break;
+
+        default :
+          // ----- Error log
+          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
+		                       "Unknown parameter '"
+							   .$p_options_list[$i]."'");
+
+          // ----- Return
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+          return PclZip::errorCode();
+      }
+
+      // ----- Next options
+      $i++;
+    }
+
+    // ----- Look for mandatory options
+    if ($v_requested_options !== false) {
+      for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
+        // ----- Look for mandatory option
+        if ($v_requested_options[$key] == 'mandatory') {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Detect a mandatory option : ".PclZipUtilOptionText($key)."(".$key.")");
+          // ----- Look if present
+          if (!isset($v_result_list[$key])) {
+            // ----- Error log
+            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+          }
+        }
+      }
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privCreate()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privCreate($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCreate", "list, result_list, add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
+    $v_result=1;
+    $v_list_detail = array();
+
+    // ----- Open the file in write mode
+    if (($v_result = $this->privOpenFd('wb')) != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Add the list of files
+    $v_result = $this->privAddList($p_list, $p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options);
+
+    // ----- Close
+    $this->privCloseFd();
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privAdd()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privAdd($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAdd", "list, result_list, add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
+    $v_result=1;
+    $v_list_detail = array();
+
+    // ----- Look if the archive exists or is empty
+    if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, or is empty, create it.");
+
+      // ----- Do a create
+      $v_result = $this->privCreate($p_list, $p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options);
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Open the zip file
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+    if (($v_result=$this->privOpenFd('rb')) != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Read the central directory informations
+    $v_central_dir = array();
+    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+    {
+      $this->privCloseFd();
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Go to beginning of File
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
+    @rewind($this->zip_fd);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
+
+    // ----- Creates a temporay file
+    $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
+
+    // ----- Open the temporary file in write mode
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+    if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
+    {
+      $this->privCloseFd();
+
+      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Copy the files from the archive to the temporary file
+    // TBC : Here I should better append the file and go back to erase the central dir
+    $v_size = $v_central_dir['offset'];
+    while ($v_size != 0)
+    {
+      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+      $v_buffer = fread($this->zip_fd, $v_read_size);
+      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+      $v_size -= $v_read_size;
+    }
+
+    // ----- Swap the file descriptor
+    // Here is a trick : I swap the temporary fd with the zip fd, in order to use
+    // the following methods on the temporary fil and not the real archive
+    $v_swap = $this->zip_fd;
+    $this->zip_fd = $v_zip_temp_fd;
+    $v_zip_temp_fd = $v_swap;
+
+    // ----- Add the files
+    $v_header_list = array();
+    if (($v_result = $this->privAddFileList($p_list, $v_header_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options)) != 1)
+    {
+      fclose($v_zip_temp_fd);
+      $this->privCloseFd();
+      @unlink($v_zip_temp_name);
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Store the offset of the central dir
+    $v_offset = @ftell($this->zip_fd);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset");
+
+    // ----- Copy the block of file headers from the old archive
+    $v_size = $v_central_dir['size'];
+    while ($v_size != 0)
+    {
+      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+      $v_buffer = @fread($v_zip_temp_fd, $v_read_size);
+      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
+      $v_size -= $v_read_size;
+    }
+
+    // ----- Create the Central Dir files header
+    for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)
+    {
+      // ----- Create the file header
+      if ($v_header_list[$i]['status'] == 'ok') {
+        if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
+          fclose($v_zip_temp_fd);
+          $this->privCloseFd();
+          @unlink($v_zip_temp_name);
+
+          // ----- Return
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+        $v_count++;
+      }
+
+      // ----- Transform the header to a 'usable' info
+      $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
+    }
+
+    // ----- Zip file comment
+    $v_comment = $v_central_dir['comment'];
+    if (isset($p_options[PCLZIP_OPT_COMMENT])) {
+      $v_comment = $p_options[PCLZIP_OPT_COMMENT];
+    }
+    if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) {
+      $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT];
+    }
+    if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) {
+      $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment;
+    }
+
+    // ----- Calculate the size of the central header
+    $v_size = @ftell($this->zip_fd)-$v_offset;
+
+    // ----- Create the central dir footer
+    if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1)
+    {
+      // ----- Reset the file list
+      unset($v_header_list);
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Swap back the file descriptor
+    $v_swap = $this->zip_fd;
+    $this->zip_fd = $v_zip_temp_fd;
+    $v_zip_temp_fd = $v_swap;
+
+    // ----- Close
+    $this->privCloseFd();
+
+    // ----- Close the temporary file
+    @fclose($v_zip_temp_fd);
+
+    // ----- Delete the zip file
+    // TBC : I should test the result ...
+    @unlink($this->zipname);
+
+    // ----- Rename the temporary file
+    // TBC : I should test the result ...
+    //@rename($v_zip_temp_name, $this->zipname);
+    PclZipUtilRename($v_zip_temp_name, $this->zipname);
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privOpenFd()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function privOpenFd($p_mode)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privOpenFd", 'mode='.$p_mode);
+    $v_result=1;
+
+    // ----- Look if already open
+    if ($this->zip_fd != 0)
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Open the zip file
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Open file in '.$p_mode.' mode');
+    if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0)
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privCloseFd()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function privCloseFd()
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCloseFd", "");
+    $v_result=1;
+
+    if ($this->zip_fd != 0)
+      @fclose($this->zip_fd);
+    $this->zip_fd = 0;
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privAddList()
+  // Description :
+  //   $p_add_dir and $p_remove_dir will give the ability to memorize a path which is
+  //   different from the real path of the file. This is usefull if you want to have PclTar
+  //   running in any directory, and memorize relative path from an other directory.
+  // Parameters :
+  //   $p_list : An array containing the file or directory names to add in the tar
+  //   $p_result_list : list of added files with their properties (specially the status field)
+  //   $p_add_dir : Path to add in the filename path archived
+  //   $p_remove_dir : Path to remove in the filename path archived
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddList", "list, add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
+    $v_result=1;
+
+    // ----- Add the files
+    $v_header_list = array();
+    if (($v_result = $this->privAddFileList($p_list, $v_header_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options)) != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Store the offset of the central dir
+    $v_offset = @ftell($this->zip_fd);
+
+    // ----- Create the Central Dir files header
+    for ($i=0,$v_count=0; $i<sizeof($v_header_list); $i++)
+    {
+      // ----- Create the file header
+      if ($v_header_list[$i]['status'] == 'ok') {
+        if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
+          // ----- Return
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+        $v_count++;
+      }
+
+      // ----- Transform the header to a 'usable' info
+      $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
+    }
+
+    // ----- Zip file comment
+    $v_comment = '';
+    if (isset($p_options[PCLZIP_OPT_COMMENT])) {
+      $v_comment = $p_options[PCLZIP_OPT_COMMENT];
+    }
+
+    // ----- Calculate the size of the central header
+    $v_size = @ftell($this->zip_fd)-$v_offset;
+
+    // ----- Create the central dir footer
+    if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1)
+    {
+      // ----- Reset the file list
+      unset($v_header_list);
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privAddFileList()
+  // Description :
+  //   $p_add_dir and $p_remove_dir will give the ability to memorize a path which is
+  //   different from the real path of the file. This is usefull if you want to
+  //   run the lib in any directory, and memorize relative path from an other directory.
+  // Parameters :
+  //   $p_list : An array containing the file or directory names to add in the tar
+  //   $p_result_list : list of added files with their properties (specially the status field)
+  //   $p_add_dir : Path to add in the filename path archived
+  //   $p_remove_dir : Path to remove in the filename path archived
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privAddFileList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFileList", "list, add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
+    $v_result=1;
+    $v_header = array();
+
+    // ----- Recuperate the current number of elt in list
+    $v_nb = sizeof($p_result_list);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Before add, list have $v_nb elements");
+
+    // ----- Loop on the files
+    for ($j=0; ($j<count($p_list)) && ($v_result==1); $j++)
+    {
+      // ----- Recuperate the filename
+      $p_filename = PclZipUtilTranslateWinPath($p_list[$j], false);
+
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for file [$p_filename]");
+
+      // ----- Skip empty file names
+      if ($p_filename == "")
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Skip empty filename");
+        continue;
+      }
+
+      // ----- Check the filename
+      if (!file_exists($p_filename))
+      {
+        // ----- Error log
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '$p_filename' does not exists");
+        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '$p_filename' does not exists");
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+        return PclZip::errorCode();
+      }
+
+      /* This test is done later
+      // ----- Check the path length
+      if (strlen($p_filename) > 0xFF)
+      {
+        // ----- Error log
+        PclZip::privErrorLog(-5, "File name is too long (max. 255) : '$p_filename'");
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+        return PclZip::errorCode();
+      }
+      */
+
+      // ----- Look if it is a file or a dir with no all pathnre move
+      if ((is_file($p_filename)) || ((is_dir($p_filename)) && !$p_remove_all_dir)) {
+        // ----- Add the file
+        if (($v_result = $this->privAddFile($p_filename, $v_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options)) != 1)
+        {
+          // ----- Return status
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+
+        // ----- Store the file infos
+        $p_result_list[$v_nb++] = $v_header;
+      }
+
+      // ----- Look for directory
+      if (@is_dir($p_filename))
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "$p_filename is a directory");
+
+        // ----- Look for path
+        if ($p_filename != ".")
+          $v_path = $p_filename."/";
+        else
+          $v_path = "";
+
+        // ----- Read the directory for files and sub-directories
+        if ($p_hdir = @opendir($p_filename)) {
+          $p_hitem = @readdir($p_hdir); // '.' directory
+          $p_hitem = @readdir($p_hdir); // '..' directory
+          while (($p_hitem = @readdir($p_hdir)) !== false) {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Looking for $p_hitem in the directory");
+
+            // ----- Look for a file
+            if (is_file($v_path.$p_hitem)) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Add the file '".$v_path.$p_hitem."'");
+
+              // ----- Add the file
+              if (($v_result = $this->privAddFile($v_path.$p_hitem, $v_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options)) != 1) {
+                // ----- Return status
+                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+                return $v_result;
+              }
+
+              // ----- Store the file infos
+              $p_result_list[$v_nb++] = $v_header;
+            }
+
+            // ----- Recursive call to privAddFileList()
+            else {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Add the directory '".$v_path.$p_hitem."'");
+
+              // ----- Need an array as parameter
+              $p_temp_list[0] = $v_path.$p_hitem;
+              $v_result = $this->privAddFileList($p_temp_list, $p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, $p_options);
+
+              // ----- Update the number of elements of the list
+              $v_nb = sizeof($p_result_list);
+            }
+          }
+        }
+
+        // ----- Free memory for the recursive loop
+        unset($p_temp_list);
+        unset($p_hdir);
+        unset($p_hitem);
+      }
+    }
+
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "After add, list have $v_nb elements");
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privAddFile()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privAddFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privAddFile", "filename='$p_filename', add_dir='$p_add_dir', remove_dir='$p_remove_dir'");
+    $v_result=1;
+
+    if ($p_filename == "")
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)");
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Calculate the stored filename
+    $v_stored_filename = $p_filename;
+
+    // ----- Look for all path to remove
+    if ($p_remove_all_dir) {
+      $v_stored_filename = basename($p_filename);
+    }
+    // ----- Look for partial path remove
+    else if ($p_remove_dir != "")
+    {
+      if (substr($p_remove_dir, -1) != '/')
+        $p_remove_dir .= "/";
+
+      if ((substr($p_filename, 0, 2) == "./") || (substr($p_remove_dir, 0, 2) == "./"))
+      {
+        if ((substr($p_filename, 0, 2) == "./") && (substr($p_remove_dir, 0, 2) != "./"))
+          $p_remove_dir = "./".$p_remove_dir;
+        if ((substr($p_filename, 0, 2) != "./") && (substr($p_remove_dir, 0, 2) == "./"))
+          $p_remove_dir = substr($p_remove_dir, 2);
+      }
+
+      $v_compare = PclZipUtilPathInclusion($p_remove_dir, $p_filename);
+      if ($v_compare > 0)
+//      if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir)
+      {
+
+        if ($v_compare == 2) {
+          $v_stored_filename = "";
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Path to remove is the current folder");
+        }
+        else {
+          $v_stored_filename = substr($p_filename, strlen($p_remove_dir));
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Remove path '$p_remove_dir' in file '$p_filename' = '$v_stored_filename'");
+        }
+      }
+    }
+    // ----- Look for path to add
+    if ($p_add_dir != "")
+    {
+      if (substr($p_add_dir, -1) == "/")
+        $v_stored_filename = $p_add_dir.$v_stored_filename;
+      else
+        $v_stored_filename = $p_add_dir."/".$v_stored_filename;
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Add path '$p_add_dir' in file '$p_filename' = '$v_stored_filename'");
+    }
+
+    // ----- Filename (reduce the path of stored name)
+    $v_stored_filename = PclZipUtilPathReduction($v_stored_filename);
+
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Filename (reduced) '$v_stored_filename', strlen ".strlen($v_stored_filename));
+
+    // ----- Set the file properties
+    clearstatcache();
+    $p_header['version'] = 20;
+    $p_header['version_extracted'] = 10;
+    $p_header['flag'] = 0;
+    $p_header['compression'] = 0;
+    $p_header['mtime'] = filemtime($p_filename);
+    $p_header['crc'] = 0;
+    $p_header['compressed_size'] = 0;
+    $p_header['size'] = filesize($p_filename);
+    $p_header['filename_len'] = strlen($p_filename);
+    $p_header['extra_len'] = 0;
+    $p_header['comment_len'] = 0;
+    $p_header['disk'] = 0;
+    $p_header['internal'] = 0;
+//    $p_header['external'] = (is_file($p_filename)?0xFE49FFE0:0x41FF0010);
+    $p_header['external'] = (is_file($p_filename)?0x00000000:0x00000010);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header external extension '".sprintf("0x%X",$p_header['external'])."'");
+    $p_header['offset'] = 0;
+    $p_header['filename'] = $p_filename;
+    $p_header['stored_filename'] = $v_stored_filename;
+    $p_header['extra'] = '';
+    $p_header['comment'] = '';
+    $p_header['status'] = 'ok';
+    $p_header['index'] = -1;
+
+
+    // ----- Look for pre-add callback
+    if (isset($p_options[PCLZIP_CB_PRE_ADD])) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_ADD]."()') is defined for the extraction");
+
+      // ----- Generate a local information
+      $v_local_header = array();
+      $this->privConvertHeader2FileInfo($p_header, $v_local_header);
+
+      // ----- Call the callback
+      // Here I do not use call_user_func() because I need to send a reference to the
+      // header.
+      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);');
+      if ($v_result == 0) {
+        // ----- Change the file status
+        $p_header['status'] = "skipped";
+        $v_result = 1;
+      }
+
+      // ----- Update the informations
+      // Only some fields can be modified
+      if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {
+        $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New stored filename is '".$p_header['stored_filename']."'");
+      }
+    }
+
+    // ----- Look for empty stored filename
+    if ($p_header['stored_filename'] == "") {
+      $p_header['status'] = "filtered";
+    }
+    
+    // ----- Check the path length
+    if (strlen($p_header['stored_filename']) > 0xFF) {
+      $p_header['status'] = 'filename_too_long';
+    }
+
+    // ----- Look if no error, or file not skipped
+    if ($p_header['status'] == 'ok') {
+
+      // ----- Look for a file
+      if (is_file($p_filename))
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a file");
+        // ----- Open the source file
+        if (($v_file = @fopen($p_filename, "rb")) == 0) {
+          PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+          return PclZip::errorCode();
+        }
+
+        if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be compressed");
+          // ----- Read the file content
+          $v_content_compressed = @fread($v_file, $p_header['size']);
+
+          // ----- Calculate the CRC
+          $p_header['crc'] = @crc32($v_content_compressed);
+
+          // ----- Set header parameters
+          $p_header['compressed_size'] = $p_header['size'];
+          $p_header['compression'] = 0;
+        }
+        else {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will be compressed");
+          // ----- Read the file content
+          $v_content = @fread($v_file, $p_header['size']);
+
+          // ----- Calculate the CRC
+          $p_header['crc'] = @crc32($v_content);
+
+          // ----- Compress the file
+          $v_content_compressed = @gzdeflate($v_content);
+
+          // ----- Set header parameters
+          $p_header['compressed_size'] = strlen($v_content_compressed);
+          $p_header['compression'] = 8;
+        }
+        
+        // ----- Look for encryption
+        /*
+        if ((isset($p_options[PCLZIP_OPT_CRYPT]))
+		    && ($p_options[PCLZIP_OPT_CRYPT] != "")) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File need to be crypted ....");
+          
+          // Should be a random header
+          $v_header = 'xxxxxxxxxxxx';
+	      $v_content_compressed = PclZipUtilZipEncrypt($v_content_compressed,
+		                                           $p_header['compressed_size'],
+	                                               $v_header,
+												   $p_header['crc'],
+												   "test");
+												   
+          $p_header['compressed_size'] += 12;
+          $p_header['flag'] = 1;
+          
+          // ----- Add the header to the data
+          $v_content_compressed = $v_header.$v_content_compressed;
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size after header : ".strlen($v_content_compressed)."");
+        }
+        */
+
+        // ----- Call the header generation
+        if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
+          @fclose($v_file);
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+
+        // ----- Write the compressed (or not) content
+        $v_binary_data = pack('a'.$p_header['compressed_size'],
+		                      $v_content_compressed);
+        @fwrite($this->zip_fd, $v_binary_data, $p_header['compressed_size']);
+        
+        // ----- Close the file
+        @fclose($v_file);
+      }
+
+      // ----- Look for a directory
+      else {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "'".$p_filename."' is a folder");
+        // ----- Look for directory last '/'
+        if (@substr($p_header['stored_filename'], -1) != '/') {
+          $p_header['stored_filename'] .= '/';
+        }
+
+        // ----- Set the file properties
+        $p_header['size'] = 0;
+        //$p_header['external'] = 0x41FF0010;   // Value for a folder : to be checked
+        $p_header['external'] = 0x00000010;   // Value for a folder : to be checked
+
+        // ----- Call the header generation
+        if (($v_result = $this->privWriteFileHeader($p_header)) != 1)
+        {
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+      }
+    }
+
+    // ----- Look for pre-add callback
+    if (isset($p_options[PCLZIP_CB_POST_ADD])) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_ADD]."()') is defined for the extraction");
+
+      // ----- Generate a local information
+      $v_local_header = array();
+      $this->privConvertHeader2FileInfo($p_header, $v_local_header);
+
+      // ----- Call the callback
+      // Here I do not use call_user_func() because I need to send a reference to the
+      // header.
+      eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);');
+      if ($v_result == 0) {
+        // ----- Ignored
+        $v_result = 1;
+      }
+
+      // ----- Update the informations
+      // Nothing can be modified
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privWriteFileHeader()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privWriteFileHeader(&$p_header)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"');
+    $v_result=1;
+
+    // TBC
+    //for(reset($p_header); $key = key($p_header); next($p_header)) {
+    //  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "header[$key] = ".$p_header[$key]);
+    //}
+
+    // ----- Store the offset position of the file
+    $p_header['offset'] = ftell($this->zip_fd);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, 'File offset of the header :'.$p_header['offset']);
+
+    // ----- Transform UNIX mtime to DOS format mdate/mtime
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
+    $v_date = getdate($p_header['mtime']);
+    $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
+    $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];
+
+    // ----- Packed data
+    $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50,
+	                      $p_header['version_extracted'], $p_header['flag'],
+                          $p_header['compression'], $v_mtime, $v_mdate,
+                          $p_header['crc'], $p_header['compressed_size'],
+						  $p_header['size'],
+                          strlen($p_header['stored_filename']),
+						  $p_header['extra_len']);
+
+    // ----- Write the first 148 bytes of the header in the archive
+    fputs($this->zip_fd, $v_binary_data, 30);
+
+    // ----- Write the variable fields
+    if (strlen($p_header['stored_filename']) != 0)
+    {
+      fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
+    }
+    if ($p_header['extra_len'] != 0)
+    {
+      fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privWriteCentralFileHeader()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privWriteCentralFileHeader(&$p_header)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralFileHeader", 'file="'.$p_header['filename'].'", stored as "'.$p_header['stored_filename'].'"');
+    $v_result=1;
+
+    // TBC
+    //for(reset($p_header); $key = key($p_header); next($p_header)) {
+    //  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "header[$key] = ".$p_header[$key]);
+    //}
+
+    // ----- Transform UNIX mtime to DOS format mdate/mtime
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
+    $v_date = getdate($p_header['mtime']);
+    $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
+    $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];
+
+    // ----- Packed data
+    $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50,
+	                      $p_header['version'], $p_header['version_extracted'],
+                          $p_header['flag'], $p_header['compression'],
+						  $v_mtime, $v_mdate, $p_header['crc'],
+                          $p_header['compressed_size'], $p_header['size'],
+                          strlen($p_header['stored_filename']),
+						  $p_header['extra_len'], $p_header['comment_len'],
+                          $p_header['disk'], $p_header['internal'],
+						  $p_header['external'], $p_header['offset']);
+
+    // ----- Write the 42 bytes of the header in the zip file
+    fputs($this->zip_fd, $v_binary_data, 46);
+
+    // ----- Write the variable fields
+    if (strlen($p_header['stored_filename']) != 0)
+    {
+      fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
+    }
+    if ($p_header['extra_len'] != 0)
+    {
+      fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
+    }
+    if ($p_header['comment_len'] != 0)
+    {
+      fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privWriteCentralHeader()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privWriteCentralHeader", 'nb_entries='.$p_nb_entries.', size='.$p_size.', offset='.$p_offset.', comment="'.$p_comment.'"');
+    $v_result=1;
+
+    // ----- Packed data
+    $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries,
+	                      $p_nb_entries, $p_size,
+						  $p_offset, strlen($p_comment));
+
+    // ----- Write the 22 bytes of the header in the zip file
+    fputs($this->zip_fd, $v_binary_data, 22);
+
+    // ----- Write the variable fields
+    if (strlen($p_comment) != 0)
+    {
+      fputs($this->zip_fd, $p_comment, strlen($p_comment));
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privList()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privList(&$p_list)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privList", "list");
+    $v_result=1;
+
+    // ----- Open the zip file
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+    if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Read the central directory informations
+    $v_central_dir = array();
+    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Go to beginning of Central Dir
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Offset : ".$v_central_dir['offset']."'");
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'");
+    @rewind($this->zip_fd);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'");
+    if (@fseek($this->zip_fd, $v_central_dir['offset']))
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position in file : ".ftell($this->zip_fd)."'");
+
+    // ----- Read each entry
+    for ($i=0; $i<$v_central_dir['entries']; $i++)
+    {
+      // ----- Read the file header
+      if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+      $v_header['index'] = $i;
+
+      // ----- Get the only interesting attributes
+      $this->privConvertHeader2FileInfo($v_header, $p_list[$i]);
+      unset($v_header);
+    }
+
+    // ----- Close the zip file
+    $this->privCloseFd();
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privConvertHeader2FileInfo()
+  // Description :
+  //   This function takes the file informations from the central directory
+  //   entries and extract the interesting parameters that will be given back.
+  //   The resulting file infos are set in the array $p_info
+  //     $p_info['filename'] : Filename with full path. Given by user (add),
+  //                           extracted in the filesystem (extract).
+  //     $p_info['stored_filename'] : Stored filename in the archive.
+  //     $p_info['size'] = Size of the file.
+  //     $p_info['compressed_size'] = Compressed size of the file.
+  //     $p_info['mtime'] = Last modification date of the file.
+  //     $p_info['comment'] = Comment associated with the file.
+  //     $p_info['folder'] = true/false : indicates if the entry is a folder or not.
+  //     $p_info['status'] = status of the action on the file.
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privConvertHeader2FileInfo($p_header, &$p_info)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privConvertHeader2FileInfo", "Filename='".$p_header['filename']."'");
+    $v_result=1;
+
+    // ----- Get the interesting attributes
+    $p_info['filename'] = $p_header['filename'];
+    $p_info['stored_filename'] = $p_header['stored_filename'];
+    $p_info['size'] = $p_header['size'];
+    $p_info['compressed_size'] = $p_header['compressed_size'];
+    $p_info['mtime'] = $p_header['mtime'];
+    $p_info['comment'] = $p_header['comment'];
+    $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010);
+    $p_info['index'] = $p_header['index'];
+    $p_info['status'] = $p_header['status'];
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privExtractByRule()
+  // Description :
+  //   Extract a file or directory depending of rules (by index, by name, ...)
+  // Parameters :
+  //   $p_file_list : An array where will be placed the properties of each
+  //                  extracted file
+  //   $p_path : Path to add while writing the extracted files
+  //   $p_remove_path : Path to remove (from the file memorized path) while writing the
+  //                    extracted files. If the path does not match the file path,
+  //                    the file is extracted with its memorized path.
+  //                    $p_remove_path does not apply to 'list' mode.
+  //                    $p_path and $p_remove_path are commulative.
+  // Return Values :
+  //   1 on success,0 or less on error (see error code list)
+  // --------------------------------------------------------------------------------
+  function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privExtractByRule", "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'");
+    $v_result=1;
+
+    // ----- Check the path
+    if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../") && (substr($p_path,1,2)!=":/")))
+      $p_path = "./".$p_path;
+
+    // ----- Reduce the path last (and duplicated) '/'
+    if (($p_path != "./") && ($p_path != "/"))
+    {
+      // ----- Look for the path end '/'
+      while (substr($p_path, -1) == "/")
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Destination path [$p_path] ends by '/'");
+        $p_path = substr($p_path, 0, strlen($p_path)-1);
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Modified to [$p_path]");
+      }
+    }
+
+    // ----- Look for path to remove format (should end by /)
+    if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/'))
+    {
+      $p_remove_path .= '/';
+    }
+    $p_remove_path_size = strlen($p_remove_path);
+
+    // ----- Open the zip file
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+    if (($v_result = $this->privOpenFd('rb')) != 1)
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Read the central directory informations
+    $v_central_dir = array();
+    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+    {
+      // ----- Close the zip file
+      $this->privCloseFd();
+
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Start at beginning of Central Dir
+    $v_pos_entry = $v_central_dir['offset'];
+
+    // ----- Read each entry
+    $j_start = 0;
+    for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry : '$i'");
+
+      // ----- Read next Central dir entry
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position before rewind : ".ftell($this->zip_fd)."'");
+      @rewind($this->zip_fd);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Position after rewind : ".ftell($this->zip_fd)."'");
+      if (@fseek($this->zip_fd, $v_pos_entry))
+      {
+        // ----- Close the zip file
+        $this->privCloseFd();
+
+        // ----- Error log
+        PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+        return PclZip::errorCode();
+      }
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Position after fseek : ".ftell($this->zip_fd)."'");
+
+      // ----- Read the file header
+      $v_header = array();
+      if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)
+      {
+        // ----- Close the zip file
+        $this->privCloseFd();
+
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      // ----- Store the index
+      $v_header['index'] = $i;
+
+      // ----- Store the file position
+      $v_pos_entry = ftell($this->zip_fd);
+
+      // ----- Look for the specific extract rules
+      $v_extract = false;
+
+      // ----- Look for extract by name rule
+      if (   (isset($p_options[PCLZIP_OPT_BY_NAME]))
+          && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'");
+
+          // ----- Look if the filename is in the list
+          for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Compare with file '".$p_options[PCLZIP_OPT_BY_NAME][$j]."'");
+
+              // ----- Look for a directory
+              if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The searched item is a directory");
+
+                  // ----- Look if the directory is in the filename path
+                  if (   (strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
+                      && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
+                      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path");
+                      $v_extract = true;
+                  }
+              }
+              // ----- Look for a filename
+              elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one.");
+                  $v_extract = true;
+              }
+          }
+      }
+
+      // ----- Look for extract by ereg rule
+      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))
+               && ($p_options[PCLZIP_OPT_BY_EREG] != "")) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'");
+
+          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
+              $v_extract = true;
+          }
+      }
+
+      // ----- Look for extract by preg rule
+      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))
+               && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'");
+
+          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
+              $v_extract = true;
+          }
+      }
+
+      // ----- Look for extract by index rule
+      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))
+               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'");
+          
+          // ----- Look if the index is in the list
+          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look if index '$i' is in [".$p_options[PCLZIP_OPT_BY_INDEX][$j]['start'].",".$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']."]");
+
+              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range");
+                  $v_extract = true;
+              }
+              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop");
+                  $j_start = $j+1;
+              }
+
+              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop");
+                  break;
+              }
+          }
+      }
+
+      // ----- Look for no rule, which means extract all the archive
+      else {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with no rule (extract all)");
+          $v_extract = true;
+      }
+
+	  // ----- Check compression method
+	  if (   ($v_extract)
+	      && (   ($v_header['compression'] != 8)
+		      && ($v_header['compression'] != 0))) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported compression method (".$v_header['compression'].")");
+          $v_header['status'] = 'unsupported_compression';
+
+          // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+          if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+		      && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
+
+              PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION,
+			                       "Filename '".$v_header['stored_filename']."' is "
+				  	    	  	   ."compressed by an unsupported compression "
+				  	    	  	   ."method (".$v_header['compression'].") ");
+
+              //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+              return PclZip::errorCode();
+		  }
+	  }
+	  
+	  // ----- Check encrypted files
+	  if (($v_extract) && (($v_header['flag'] & 1) == 1)) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unsupported file encryption");
+          $v_header['status'] = 'unsupported_encryption';
+
+          // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+          if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+		      && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
+
+              PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION,
+			                       "Unsupported encryption for "
+				  	    	  	   ." filename '".$v_header['stored_filename']
+								   ."'");
+
+              //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+              return PclZip::errorCode();
+		  }
+	  }
+
+      // ----- Look for real extraction
+      if (($v_extract) && ($v_header['status'] != 'ok')) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "No need for extract");
+          $v_result = $this->privConvertHeader2FileInfo($v_header,
+		                                        $p_file_list[$v_nb_extracted++]);
+          if ($v_result != 1) {
+              $this->privCloseFd();
+              //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+              return $v_result;
+          }
+
+          $v_extract = false;
+      }
+      
+      // ----- Look for real extraction
+      if ($v_extract)
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file '".$v_header['filename']."', index '$i'");
+
+        // ----- Go to the file position
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'");
+        @rewind($this->zip_fd);
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'");
+        if (@fseek($this->zip_fd, $v_header['offset']))
+        {
+          // ----- Close the zip file
+          $this->privCloseFd();
+
+          // ----- Error log
+          PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+          // ----- Return
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+          return PclZip::errorCode();
+        }
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'");
+
+        // ----- Look for extraction as string
+        if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) {
+
+          // ----- Extracting the file
+          $v_result1 = $this->privExtractFileAsString($v_header, $v_string);
+          if ($v_result1 < 1) {
+            $this->privCloseFd();
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1);
+            return $v_result1;
+          }
+
+          // ----- Get the only interesting attributes
+          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1)
+          {
+            // ----- Close the zip file
+            $this->privCloseFd();
+
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+            return $v_result;
+          }
+
+          // ----- Set the file content
+          $p_file_list[$v_nb_extracted]['content'] = $v_string;
+
+          // ----- Next extracted file
+          $v_nb_extracted++;
+          
+          // ----- Look for user callback abort
+          if ($v_result1 == 2) {
+          	break;
+          }
+        }
+        // ----- Look for extraction in standard output
+        elseif (   (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT]))
+		        && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) {
+          // ----- Extracting the file in standard output
+          $v_result1 = $this->privExtractFileInOutput($v_header, $p_options);
+          if ($v_result1 < 1) {
+            $this->privCloseFd();
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1);
+            return $v_result1;
+          }
+
+          // ----- Get the only interesting attributes
+          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) {
+            $this->privCloseFd();
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+            return $v_result;
+          }
+
+          // ----- Look for user callback abort
+          if ($v_result1 == 2) {
+          	break;
+          }
+        }
+        // ----- Look for normal extraction
+        else {
+          // ----- Extracting the file
+          $v_result1 = $this->privExtractFile($v_header,
+		                                      $p_path, $p_remove_path,
+											  $p_remove_all_path,
+											  $p_options);
+          if ($v_result1 < 1) {
+            $this->privCloseFd();
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result1);
+            return $v_result1;
+          }
+
+          // ----- Get the only interesting attributes
+          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1)
+          {
+            // ----- Close the zip file
+            $this->privCloseFd();
+
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+            return $v_result;
+          }
+
+          // ----- Look for user callback abort
+          if ($v_result1 == 2) {
+          	break;
+          }
+        }
+      }
+    }
+
+    // ----- Close the zip file
+    $this->privCloseFd();
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privExtractFile()
+  // Description :
+  // Parameters :
+  // Return Values :
+  //
+  // 1 : ... ?
+  // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback
+  // --------------------------------------------------------------------------------
+  function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFile', "path='$p_path', remove_path='$p_remove_path', remove_all_path='".($p_remove_all_path?'true':'false')."'");
+    $v_result=1;
+
+    // ----- Read the file header
+    if (($v_result = $this->privReadFileHeader($v_header)) != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'");
+
+    // ----- Check that the file header is coherent with $p_entry info
+    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
+        // TBC
+    }
+
+    // ----- Look for all path to remove
+    if ($p_remove_all_path == true) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "All path is removed");
+        // ----- Get the basename of the path
+        $p_entry['filename'] = basename($p_entry['filename']);
+    }
+
+    // ----- Look for path to remove
+    else if ($p_remove_path != "")
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look for some path to remove");
+      if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2)
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The folder is the same as the removed path '".$p_entry['filename']."'");
+
+        // ----- Change the file status
+        $p_entry['status'] = "filtered";
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      $p_remove_path_size = strlen($p_remove_path);
+      if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path)
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found path '$p_remove_path' to remove in file '".$p_entry['filename']."'");
+
+        // ----- Remove the path
+        $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);
+
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Resulting file is '".$p_entry['filename']."'");
+      }
+    }
+
+    // ----- Add the path
+    if ($p_path != '')
+    {
+      $p_entry['filename'] = $p_path."/".$p_entry['filename'];
+    }
+
+    // ----- Look for pre-extract callback
+    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction");
+
+      // ----- Generate a local information
+      $v_local_header = array();
+      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+      // ----- Call the callback
+      // Here I do not use call_user_func() because I need to send a reference to the
+      // header.
+      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
+      if ($v_result == 0) {
+        // ----- Change the file status
+        $p_entry['status'] = "skipped";
+        $v_result = 1;
+      }
+      
+      // ----- Look for abort result
+      if ($v_result == 2) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
+        // ----- This status is internal and will be changed in 'skipped'
+        $p_entry['status'] = "aborted";
+      	$v_result = PCLZIP_ERR_USER_ABORTED;
+      }
+
+      // ----- Update the informations
+      // Only some fields can be modified
+      $p_entry['filename'] = $v_local_header['filename'];
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'");
+    }
+
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'");
+
+    // ----- Look if extraction should be done
+    if ($p_entry['status'] == 'ok') {
+
+    // ----- Look for specific actions while the file exist
+    if (file_exists($p_entry['filename']))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$p_entry['filename']."' already exists");
+
+      // ----- Look if file is a directory
+      if (is_dir($p_entry['filename']))
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is a directory");
+
+        // ----- Change the file status
+        $p_entry['status'] = "already_a_directory";
+        
+        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+        // For historical reason first PclZip implementation does not stop
+        // when this kind of error occurs.
+        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+		    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
+
+            PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY,
+			                     "Filename '".$p_entry['filename']."' is "
+								 ."already used by an existing directory");
+
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+		}
+      }
+      // ----- Look if file is write protected
+      else if (!is_writeable($p_entry['filename']))
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is write protected");
+
+        // ----- Change the file status
+        $p_entry['status'] = "write_protected";
+
+        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+        // For historical reason first PclZip implementation does not stop
+        // when this kind of error occurs.
+        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+		    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
+
+            PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
+			                     "Filename '".$p_entry['filename']."' exists "
+								 ."and is write protected");
+
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+            return PclZip::errorCode();
+		}
+      }
+
+      // ----- Look if the extracted file is older
+      else if (filemtime($p_entry['filename']) > $p_entry['mtime'])
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is newer (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")");
+        // ----- Change the file status
+        if (   (isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))
+		    && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_REPLACE_NEWER is selected, file will be replaced");
+		}
+		else {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File will not be replaced");
+            $p_entry['status'] = "newer_exist";
+
+            // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
+            // For historical reason first PclZip implementation does not stop
+            // when this kind of error occurs.
+            if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
+		        && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
+                //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "PCLZIP_OPT_STOP_ON_ERROR is selected, extraction will be stopped");
+
+                PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
+			             "Newer version of '".$p_entry['filename']."' exists "
+					    ."and option PCLZIP_OPT_REPLACE_NEWER is not selected");
+
+                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+                return PclZip::errorCode();
+		    }
+		}
+      }
+      else {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Existing file '".$p_entry['filename']."' is older than the extrated one - will be replaced by the extracted one (".date("l dS of F Y h:i:s A", filemtime($p_entry['filename'])).") than the extracted file (".date("l dS of F Y h:i:s A", $p_entry['mtime']).")");
+      }
+    }
+
+    // ----- Check the directory availability and create it if necessary
+    else {
+      if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/'))
+        $v_dir_to_check = $p_entry['filename'];
+      else if (!strstr($p_entry['filename'], "/"))
+        $v_dir_to_check = "";
+      else
+        $v_dir_to_check = dirname($p_entry['filename']);
+
+      if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to create path for '".$p_entry['filename']."'");
+
+        // ----- Change the file status
+        $p_entry['status'] = "path_creation_fail";
+
+        // ----- Return
+        ////--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+        //return $v_result;
+        $v_result = 1;
+      }
+    }
+    }
+
+    // ----- Look if extraction should be done
+    if ($p_entry['status'] == 'ok') {
+
+      // ----- Do the extraction (if not a folder)
+      if (!(($p_entry['external']&0x00000010)==0x00000010))
+      {
+        // ----- Look for not compressed file
+        if ($p_entry['compression'] == 0) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file");
+
+		  // ----- Opening destination file
+          if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0)
+          {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");
+
+            // ----- Change the file status
+            $p_entry['status'] = "write_error";
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+            return $v_result;
+          }
+
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read '".$p_entry['size']."' bytes");
+
+          // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
+          $v_size = $p_entry['compressed_size'];
+          while ($v_size != 0)
+          {
+            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Read $v_read_size bytes");
+            $v_buffer = fread($this->zip_fd, $v_read_size);
+            $v_binary_data = pack('a'.$v_read_size, $v_buffer);
+            @fwrite($v_dest_file, $v_binary_data, $v_read_size);
+            $v_size -= $v_read_size;
+          }
+
+          // ----- Closing the destination file
+          fclose($v_dest_file);
+
+          // ----- Change the file mtime
+          touch($p_entry['filename'], $p_entry['mtime']);
+          
+
+        }
+        else {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file (Compression method ".$p_entry['compression'].")");
+          // ----- TBC
+          // Need to be finished
+          if (($p_entry['flag'] & 1) == 1) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File is encrypted");
+            /*
+              // ----- Read the encryption header
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read 12 encryption header bytes");
+              $v_encryption_header = @fread($this->zip_fd, 12);
+              
+              // ----- Read the encrypted & compressed file in a buffer
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".($p_entry['compressed_size']-12)."' compressed & encrypted bytes");
+              $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']-12);
+              
+              // ----- Decrypt the buffer
+              $this->privDecrypt($v_encryption_header, $v_buffer,
+			                     $p_entry['compressed_size']-12, $p_entry['crc']);
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Buffer is '".$v_buffer."'");
+              */
+          }
+          else {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read '".$p_entry['compressed_size']."' compressed bytes");
+              // ----- Read the compressed file in a buffer (one shot)
+              $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
+          }
+          
+          // ----- Decompress the file
+          $v_file_content = @gzinflate($v_buffer);
+          unset($v_buffer);
+          if ($v_file_content === FALSE) {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to inflate compressed file");
+
+            // ----- Change the file status
+            // TBC
+            $p_entry['status'] = "error";
+            
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+            return $v_result;
+          }
+          
+          // ----- Opening destination file
+          if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Error while opening '".$p_entry['filename']."' in write binary mode");
+
+            // ----- Change the file status
+            $p_entry['status'] = "write_error";
+
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+            return $v_result;
+          }
+
+          // ----- Write the uncompressed data
+          @fwrite($v_dest_file, $v_file_content, $p_entry['size']);
+          unset($v_file_content);
+
+          // ----- Closing the destination file
+          @fclose($v_dest_file);
+
+          // ----- Change the file mtime
+          @touch($p_entry['filename'], $p_entry['mtime']);
+        }
+
+        // ----- Look for chmod option
+        if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "chmod option activated '".$p_options[PCLZIP_OPT_SET_CHMOD]."'");
+
+          // ----- Change the mode of the file
+          @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);
+        }
+
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done");
+      }
+    }
+
+	// ----- Change abort status
+	if ($p_entry['status'] == "aborted") {
+      $p_entry['status'] = "skipped";
+	}
+	
+    // ----- Look for post-extract callback
+    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction");
+
+      // ----- Generate a local information
+      $v_local_header = array();
+      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+      // ----- Call the callback
+      // Here I do not use call_user_func() because I need to send a reference to the
+      // header.
+      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
+
+      // ----- Look for abort result
+      if ($v_result == 2) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
+      	$v_result = PCLZIP_ERR_USER_ABORTED;
+      }
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privExtractFileInOutput()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privExtractFileInOutput(&$p_entry, &$p_options)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileInOutput', "");
+    $v_result=1;
+
+    // ----- Read the file header
+    if (($v_result = $this->privReadFileHeader($v_header)) != 1) {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'");
+
+    // ----- Check that the file header is coherent with $p_entry info
+    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
+        // TBC
+    }
+
+    // ----- Look for pre-extract callback
+    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A pre-callback '".$p_options[PCLZIP_CB_PRE_EXTRACT]."()') is defined for the extraction");
+
+      // ----- Generate a local information
+      $v_local_header = array();
+      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+      // ----- Call the callback
+      // Here I do not use call_user_func() because I need to send a reference to the
+      // header.
+      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
+      if ($v_result == 0) {
+        // ----- Change the file status
+        $p_entry['status'] = "skipped";
+        $v_result = 1;
+      }
+
+      // ----- Look for abort result
+      if ($v_result == 2) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
+        // ----- This status is internal and will be changed in 'skipped'
+        $p_entry['status'] = "aborted";
+      	$v_result = PCLZIP_ERR_USER_ABORTED;
+      }
+
+      // ----- Update the informations
+      // Only some fields can be modified
+      $p_entry['filename'] = $v_local_header['filename'];
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "New filename is '".$p_entry['filename']."'");
+    }
+
+    // ----- Trace
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file (with path) '".$p_entry['filename']."', size '$v_header[size]'");
+
+    // ----- Look if extraction should be done
+    if ($p_entry['status'] == 'ok') {
+
+      // ----- Do the extraction (if not a folder)
+      if (!(($p_entry['external']&0x00000010)==0x00000010)) {
+        // ----- Look for not compressed file
+        if ($p_entry['compressed_size'] == $p_entry['size']) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file");
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes");
+
+          // ----- Read the file in a buffer (one shot)
+          $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
+
+          // ----- Send the file to the output
+          echo $v_buffer;
+          unset($v_buffer);
+        }
+        else {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file");
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Reading '".$p_entry['size']."' bytes");
+
+          // ----- Read the compressed file in a buffer (one shot)
+          $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
+          
+          // ----- Decompress the file
+          $v_file_content = gzinflate($v_buffer);
+          unset($v_buffer);
+
+          // ----- Send the file to the output
+          echo $v_file_content;
+          unset($v_file_content);
+        }
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done");
+      }
+    }
+
+	// ----- Change abort status
+	if ($p_entry['status'] == "aborted") {
+      $p_entry['status'] = "skipped";
+	}
+
+    // ----- Look for post-extract callback
+    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "A post-callback '".$p_options[PCLZIP_CB_POST_EXTRACT]."()') is defined for the extraction");
+
+      // ----- Generate a local information
+      $v_local_header = array();
+      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
+
+      // ----- Call the callback
+      // Here I do not use call_user_func() because I need to send a reference to the
+      // header.
+      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
+
+      // ----- Look for abort result
+      if ($v_result == 2) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "User callback abort the extraction");
+      	$v_result = PCLZIP_ERR_USER_ABORTED;
+      }
+    }
+
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privExtractFileAsString()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privExtractFileAsString(&$p_entry, &$p_string)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privExtractFileAsString', "p_entry['filename']='".$p_entry['filename']."'");
+    $v_result=1;
+
+    // ----- Read the file header
+    $v_header = array();
+    if (($v_result = $this->privReadFileHeader($v_header)) != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found file '".$v_header['filename']."', size '".$v_header['size']."'");
+
+    // ----- Check that the file header is coherent with $p_entry info
+    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
+        // TBC
+    }
+
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting file in string (with path) '".$p_entry['filename']."', size '$v_header[size]'");
+
+    // ----- Do the extraction (if not a folder)
+    if (!(($p_entry['external']&0x00000010)==0x00000010))
+    {
+      // ----- Look for not compressed file
+      if ($p_entry['compressed_size'] == $p_entry['size'])
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting an un-compressed file");
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Reading '".$p_entry['size']."' bytes");
+
+        // ----- Reading the file
+        $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
+      }
+      else
+      {
+        // ----- Trace
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extracting a compressed file");
+
+        // ----- Reading the file
+        $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
+        
+        // ----- Decompress the file
+        if (($p_string = @gzinflate($v_data)) === FALSE) {
+            // TBC
+        }
+      }
+
+      // ----- Trace
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Extraction done");
+    }
+    else {
+        // TBC : error : can not extract a folder in a string
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privReadFileHeader()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privReadFileHeader(&$p_header)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadFileHeader", "");
+    $v_result=1;
+
+    // ----- Read the 4 bytes signature
+    $v_binary_data = @fread($this->zip_fd, 4);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'");
+    $v_data = unpack('Vid', $v_binary_data);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'");
+
+    // ----- Check signature
+    if ($v_data['id'] != 0x04034b50)
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid File header");
+
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Read the first 42 bytes of the header
+    $v_binary_data = fread($this->zip_fd, 26);
+
+    // ----- Look for invalid block size
+    if (strlen($v_binary_data) != 26)
+    {
+      $p_header['filename'] = "";
+      $p_header['status'] = "invalid_header";
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data));
+
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Extract the values
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header : '".$v_binary_data."'");
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Header (Hex) : '".bin2hex($v_binary_data)."'");
+    $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data);
+
+    // ----- Get filename
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "File name length : ".$v_data['filename_len']);
+    $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Filename : \''.$p_header['filename'].'\'');
+
+    // ----- Get extra_fields
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extra field length : ".$v_data['extra_len']);
+    if ($v_data['extra_len'] != 0) {
+      $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);
+    }
+    else {
+      $p_header['extra'] = '';
+    }
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Extra field : \''.bin2hex($p_header['extra']).'\'');
+
+    // ----- Extract properties
+    $p_header['version_extracted'] = $v_data['version'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : ('.$p_header['version_extracted'].') \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\'');
+    $p_header['compression'] = $v_data['compression'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compression method : \''.$p_header['compression'].'\'');
+    $p_header['size'] = $v_data['size'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_header['size'].'\'');
+    $p_header['compressed_size'] = $v_data['compressed_size'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_header['compressed_size'].'\'');
+    $p_header['crc'] = $v_data['crc'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\'');
+    $p_header['flag'] = $v_data['flag'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Flag : \''.$p_header['flag'].'\'');
+
+    // ----- Recuperate date in UNIX format
+    $p_header['mdate'] = $v_data['mdate'];
+    $p_header['mtime'] = $v_data['mtime'];
+    if ($p_header['mdate'] && $p_header['mtime'])
+    {
+      // ----- Extract time
+      $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
+      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
+      $v_seconde = ($p_header['mtime'] & 0x001F)*2;
+
+      // ----- Extract date
+      $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
+      $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
+      $v_day = $p_header['mdate'] & 0x001F;
+
+      // ----- Get UNIX date format
+      $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
+
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
+    }
+    else
+    {
+      $p_header['mtime'] = time();
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
+    }
+
+    // TBC
+    //for(reset($v_data); $key = key($v_data); next($v_data)) {
+    //  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Attribut[$key] = ".$v_data[$key]);
+    //}
+
+    // ----- Set the stored filename
+    $p_header['stored_filename'] = $p_header['filename'];
+
+    // ----- Set the status field
+    $p_header['status'] = "ok";
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privReadCentralFileHeader()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privReadCentralFileHeader(&$p_header)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadCentralFileHeader", "");
+    $v_result=1;
+
+    // ----- Read the 4 bytes signature
+    $v_binary_data = @fread($this->zip_fd, 4);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary data is : '".sprintf("%08x", $v_binary_data)."'");
+    $v_data = unpack('Vid', $v_binary_data);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'");
+
+    // ----- Check signature
+    if ($v_data['id'] != 0x02014b50)
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Invalid Central Dir File signature");
+
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Read the first 42 bytes of the header
+    $v_binary_data = fread($this->zip_fd, 42);
+
+    // ----- Look for invalid block size
+    if (strlen($v_binary_data) != 42)
+    {
+      $p_header['filename'] = "";
+      $p_header['status'] = "invalid_header";
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid block size : ".strlen($v_binary_data));
+
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Extract the values
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header : '".$v_binary_data."'");
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Header (Hex) : '".bin2hex($v_binary_data)."'");
+    $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data);
+
+    // ----- Get filename
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "File name length : ".$p_header['filename_len']);
+    if ($p_header['filename_len'] != 0)
+      $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
+    else
+      $p_header['filename'] = '';
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Filename : \''.$p_header['filename'].'\'');
+
+    // ----- Get extra
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Extra length : ".$p_header['extra_len']);
+    if ($p_header['extra_len'] != 0)
+      $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);
+    else
+      $p_header['extra'] = '';
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Extra : \''.$p_header['extra'].'\'');
+
+    // ----- Get comment
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Comment length : ".$p_header['comment_len']);
+    if ($p_header['comment_len'] != 0)
+      $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
+    else
+      $p_header['comment'] = '';
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Comment : \''.$p_header['comment'].'\'');
+
+    // ----- Extract properties
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version : \''.($p_header['version']/10).'.'.($p_header['version']%10).'\'');
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Version need to extract : \''.($p_header['version_extracted']/10).'.'.($p_header['version_extracted']%10).'\'');
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Size : \''.$p_header['size'].'\'');
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Compressed Size : \''.$p_header['compressed_size'].'\'');
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'CRC : \''.sprintf("0x%X", $p_header['crc']).'\'');
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Flag : \''.$p_header['flag'].'\'');
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Offset : \''.$p_header['offset'].'\'');
+
+    // ----- Recuperate date in UNIX format
+    if ($p_header['mdate'] && $p_header['mtime'])
+    {
+      // ----- Extract time
+      $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
+      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
+      $v_seconde = ($p_header['mtime'] & 0x001F)*2;
+
+      // ----- Extract date
+      $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
+      $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
+      $v_day = $p_header['mdate'] & 0x001F;
+
+      // ----- Get UNIX date format
+      $p_header['mtime'] = mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
+
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
+    }
+    else
+    {
+      $p_header['mtime'] = time();
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Date is actual : \''.date("d/m/y H:i:s", $p_header['mtime']).'\'');
+    }
+
+    // ----- Set the stored filename
+    $p_header['stored_filename'] = $p_header['filename'];
+
+    // ----- Set default status to ok
+    $p_header['status'] = 'ok';
+
+    // ----- Look if it is a directory
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Internal (Hex) : '".sprintf("Ox%04X", $p_header['internal'])."'");
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "External (Hex) : '".sprintf("Ox%04X", $p_header['external'])."' (".(($p_header['external']&0x00000010)==0x00000010?'is a folder':'is a file').')');
+    if (substr($p_header['filename'], -1) == '/') {
+      //$p_header['external'] = 0x41FF0010;
+      $p_header['external'] = 0x00000010;
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Force folder external : \''.sprintf("Ox%04X", $p_header['external']).'\'');
+    }
+
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Header of filename : \''.$p_header['filename'].'\'');
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privCheckFileHeaders()
+  // Description :
+  // Parameters :
+  // Return Values :
+  //   1 on success,
+  //   0 on error;
+  // --------------------------------------------------------------------------------
+  function privCheckFileHeaders(&$p_local_header, &$p_central_header)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privCheckFileHeaders", "");
+    $v_result=1;
+
+	// ----- Check the static values
+	// TBC
+	if ($p_local_header['filename'] != $p_central_header['filename']) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename" : TBC To Be Completed');
+	}
+	if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "version_extracted" : TBC To Be Completed');
+	}
+	if ($p_local_header['flag'] != $p_central_header['flag']) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "flag" : TBC To Be Completed');
+	}
+	if ($p_local_header['compression'] != $p_central_header['compression']) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "compression" : TBC To Be Completed');
+	}
+	if ($p_local_header['mtime'] != $p_central_header['mtime']) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "mtime" : TBC To Be Completed');
+	}
+	if ($p_local_header['filename_len'] != $p_central_header['filename_len']) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Bad check "filename_len" : TBC To Be Completed');
+	}
+
+	// ----- Look for flag bit 3
+	if (($p_local_header['flag'] & 8) == 8) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Purpose bit flag bit 3 set !');
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'File size, compression size and crc found in central header');
+        $p_local_header['size'] = $p_central_header['size'];
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size : \''.$p_local_header['size'].'\'');
+        $p_local_header['compressed_size'] = $p_central_header['compressed_size'];
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Compressed Size : \''.$p_local_header['compressed_size'].'\'');
+        $p_local_header['crc'] = $p_central_header['crc'];
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'CRC : \''.sprintf("0x%X", $p_local_header['crc']).'\'');
+	}
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privReadEndCentralDir()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privReadEndCentralDir(&$p_central_dir)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privReadEndCentralDir", "");
+    $v_result=1;
+
+    // ----- Go to the end of the zip file
+    $v_size = filesize($this->zipname);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Size of the file :$v_size");
+    @fseek($this->zip_fd, $v_size);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position at end of zip file : \''.ftell($this->zip_fd).'\'');
+    if (@ftell($this->zip_fd) != $v_size)
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\'');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- First try : look if this is an archive with no commentaries (most of the time)
+    // in this case the end of central dir is at 22 bytes of the file end
+    $v_found = 0;
+    if ($v_size > 26) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Look for central dir with no comment');
+      @fseek($this->zip_fd, $v_size-22);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after min central position : \''.ftell($this->zip_fd).'\'');
+      if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))
+      {
+        // ----- Error log
+        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+        return PclZip::errorCode();
+      }
+
+      // ----- Read for bytes
+      $v_binary_data = @fread($this->zip_fd, 4);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Binary data is : '".sprintf("%08x", $v_binary_data)."'");
+      $v_data = @unpack('Vid', $v_binary_data);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Binary signature is : '".sprintf("0x%08x", $v_data['id'])."'");
+
+      // ----- Check signature
+      if ($v_data['id'] == 0x06054b50) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Found central dir at the default position.");
+        $v_found = 1;
+      }
+
+      $v_pos = ftell($this->zip_fd);
+    }
+
+    // ----- Go back to the maximum possible size of the Central Dir End Record
+    if (!$v_found) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Start extended search of end central dir');
+      $v_maximum_size = 65557; // 0xFFFF + 22;
+      if ($v_maximum_size > $v_size)
+        $v_maximum_size = $v_size;
+      @fseek($this->zip_fd, $v_size-$v_maximum_size);
+      if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))
+      {
+        // ----- Error log
+        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+        return PclZip::errorCode();
+      }
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Position after max central position : \''.ftell($this->zip_fd).'\'');
+
+      // ----- Read byte per byte in order to find the signature
+      $v_pos = ftell($this->zip_fd);
+      $v_bytes = 0x00000000;
+      while ($v_pos < $v_size)
+      {
+        // ----- Read a byte
+        $v_byte = @fread($this->zip_fd, 1);
+
+        // -----  Add the byte
+        $v_bytes = ($v_bytes << 8) | Ord($v_byte);
+
+        // ----- Compare the bytes
+        if ($v_bytes == 0x504b0506)
+        {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, 'Found End Central Dir signature at position : \''.ftell($this->zip_fd).'\'');
+          $v_pos++;
+          break;
+        }
+
+        $v_pos++;
+      }
+
+      // ----- Look if not found end of central dir
+      if ($v_pos == $v_size)
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Unable to find End of Central Dir Record signature");
+
+        // ----- Error log
+        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature");
+
+        // ----- Return
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+        return PclZip::errorCode();
+      }
+    }
+
+    // ----- Read the first 18 bytes of the header
+    $v_binary_data = fread($this->zip_fd, 18);
+
+    // ----- Look for invalid block size
+    if (strlen($v_binary_data) != 18)
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));
+
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Extract the values
+    ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record : '".$v_binary_data."'");
+    ////--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Central Dir Record (Hex) : '".bin2hex($v_binary_data)."'");
+    $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);
+
+    // ----- Check the global size
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Comment length : ".$v_data['comment_size']);
+    if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "The central dir is not at the end of the archive. Some trailing bytes exists after the archive.");
+
+	  // ----- Removed in release 2.2 see readme file
+	  // The check of the file size is a little too strict.
+	  // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.
+	  // While decrypted, zip has training 0 bytes
+	  if (0) {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT,
+	                       'The central dir is not at the end of the archive.'
+						   .' Some trailing bytes exists after the archive.');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+	  }
+    }
+
+    // ----- Get comment
+    if ($v_data['comment_size'] != 0)
+      $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);
+    else
+      $p_central_dir['comment'] = '';
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Comment : \''.$p_central_dir['comment'].'\'');
+
+    $p_central_dir['entries'] = $v_data['entries'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries : \''.$p_central_dir['entries'].'\'');
+    $p_central_dir['disk_entries'] = $v_data['disk_entries'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Nb of entries for this disk : \''.$p_central_dir['disk_entries'].'\'');
+    $p_central_dir['offset'] = $v_data['offset'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Offset of Central Dir : \''.$p_central_dir['offset'].'\'');
+    $p_central_dir['size'] = $v_data['size'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Size of Central Dir : \''.$p_central_dir['size'].'\'');
+    $p_central_dir['disk'] = $v_data['disk'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Disk number : \''.$p_central_dir['disk'].'\'');
+    $p_central_dir['disk_start'] = $v_data['disk_start'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, 'Start disk number : \''.$p_central_dir['disk_start'].'\'');
+
+    // TBC
+    //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {
+    //  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "central_dir[$key] = ".$p_central_dir[$key]);
+    //}
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privDeleteByRule()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privDeleteByRule(&$p_result_list, &$p_options)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDeleteByRule", "");
+    $v_result=1;
+    $v_list_detail = array();
+
+    // ----- Open the zip file
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+    if (($v_result=$this->privOpenFd('rb')) != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Read the central directory informations
+    $v_central_dir = array();
+    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+    {
+      $this->privCloseFd();
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Go to beginning of File
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
+    @rewind($this->zip_fd);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in file : ".ftell($this->zip_fd)."'");
+
+    // ----- Scan all the files
+    // ----- Start at beginning of Central Dir
+    $v_pos_entry = $v_central_dir['offset'];
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'");
+    @rewind($this->zip_fd);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'");
+    if (@fseek($this->zip_fd, $v_pos_entry))
+    {
+      // ----- Close the zip file
+      $this->privCloseFd();
+
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'");
+
+    // ----- Read each entry
+    $v_header_list = array();
+    $j_start = 0;
+    for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Read next file header entry (index '$i')");
+
+      // ----- Read the file header
+      $v_header_list[$v_nb_extracted] = array();
+      if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1)
+      {
+        // ----- Close the zip file
+        $this->privCloseFd();
+
+        //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+        return $v_result;
+      }
+
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename (index '$i') : '".$v_header_list[$v_nb_extracted]['stored_filename']."'");
+
+      // ----- Store the index
+      $v_header_list[$v_nb_extracted]['index'] = $i;
+
+      // ----- Look for the specific extract rules
+      $v_found = false;
+
+      // ----- Look for extract by name rule
+      if (   (isset($p_options[PCLZIP_OPT_BY_NAME]))
+          && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByName'");
+
+          // ----- Look if the filename is in the list
+          for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Compare with file '".$p_options[PCLZIP_OPT_BY_NAME][$j]."'");
+
+              // ----- Look for a directory
+              if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The searched item is a directory");
+
+                  // ----- Look if the directory is in the filename path
+                  if (   (strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
+                      && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
+                      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The directory is in the file path");
+                      $v_found = true;
+                  }
+                  elseif (   (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */
+                          && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
+                      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The entry is the searched directory");
+                      $v_found = true;
+                  }
+              }
+              // ----- Look for a filename
+              elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "The file is the right one.");
+                  $v_found = true;
+              }
+          }
+      }
+
+      // ----- Look for extract by ereg rule
+      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))
+               && ($p_options[PCLZIP_OPT_BY_EREG] != "")) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract by ereg '".$p_options[PCLZIP_OPT_BY_EREG]."'");
+
+          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
+              $v_found = true;
+          }
+      }
+
+      // ----- Look for extract by preg rule
+      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))
+               && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByEreg'");
+
+          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Filename match the regular expression");
+              $v_found = true;
+          }
+      }
+
+      // ----- Look for extract by index rule
+      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))
+               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
+          //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Extract with rule 'ByIndex'");
+
+          // ----- Look if the index is in the list
+          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) {
+              //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Look if index '$i' is in [".$p_options[PCLZIP_OPT_BY_INDEX][$j]['start'].",".$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']."]");
+
+              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Found as part of an index range");
+                  $v_found = true;
+              }
+              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Do not look this index range for next loop");
+                  $j_start = $j+1;
+              }
+
+              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
+                  //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Index range is greater than index, stop loop");
+                  break;
+              }
+          }
+      }
+
+      // ----- Look for deletion
+      if ($v_found)
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' need to be deleted");
+        unset($v_header_list[$v_nb_extracted]);
+      }
+      else
+      {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 2, "File '".$v_header_list[$v_nb_extracted]['stored_filename']."', index '$i' will not be deleted");
+        $v_nb_extracted++;
+      }
+    }
+
+    // ----- Look if something need to be deleted
+    if ($v_nb_extracted > 0) {
+
+        // ----- Creates a temporay file
+        $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
+
+        // ----- Creates a temporary zip archive
+        $v_temp_zip = new PclZip($v_zip_temp_name);
+
+        // ----- Open the temporary zip file in write mode
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary write mode");
+        if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) {
+            $this->privCloseFd();
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+            return $v_result;
+        }
+
+        // ----- Look which file need to be kept
+        for ($i=0; $i<sizeof($v_header_list); $i++) {
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Keep entry index '$i' : '".$v_header_list[$i]['filename']."'");
+
+            // ----- Calculate the position of the header
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset='". $v_header_list[$i]['offset']."'");
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position before rewind : ".ftell($this->zip_fd)."'");
+            @rewind($this->zip_fd);
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after rewind : ".ftell($this->zip_fd)."'");
+            if (@fseek($this->zip_fd,  $v_header_list[$i]['offset'])) {
+                // ----- Close the zip file
+                $this->privCloseFd();
+                $v_temp_zip->privCloseFd();
+                @unlink($v_zip_temp_name);
+
+                // ----- Error log
+                PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
+
+                // ----- Return
+                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+                return PclZip::errorCode();
+            }
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position after fseek : ".ftell($this->zip_fd)."'");
+
+            // ----- Read the file header
+            $v_local_header = array();
+            if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) {
+                // ----- Close the zip file
+                $this->privCloseFd();
+                $v_temp_zip->privCloseFd();
+                @unlink($v_zip_temp_name);
+
+                // ----- Return
+                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+                return $v_result;
+            }
+            
+            // ----- Check that local file header is same as central file header
+            if ($this->privCheckFileHeaders($v_local_header,
+			                                $v_header_list[$i]) != 1) {
+                // TBC
+            }
+            unset($v_local_header);
+
+            // ----- Write the file header
+            if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) {
+                // ----- Close the zip file
+                $this->privCloseFd();
+                $v_temp_zip->privCloseFd();
+                @unlink($v_zip_temp_name);
+
+                // ----- Return
+                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+                return $v_result;
+            }
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset for this file is '".$v_header_list[$i]['offset']."'");
+
+            // ----- Read/write the data block
+            if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) {
+                // ----- Close the zip file
+                $this->privCloseFd();
+                $v_temp_zip->privCloseFd();
+                @unlink($v_zip_temp_name);
+
+                // ----- Return
+                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+                return $v_result;
+            }
+        }
+
+        // ----- Store the offset of the central dir
+        $v_offset = @ftell($v_temp_zip->zip_fd);
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "New offset of central dir : $v_offset");
+
+        // ----- Re-Create the Central Dir files header
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the new central directory");
+        for ($i=0; $i<sizeof($v_header_list); $i++) {
+            // ----- Create the file header
+            //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Offset of file : ".$v_header_list[$i]['offset']);
+            if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
+                $v_temp_zip->privCloseFd();
+                $this->privCloseFd();
+                @unlink($v_zip_temp_name);
+
+                // ----- Return
+                //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+                return $v_result;
+            }
+
+            // ----- Transform the header to a 'usable' info
+            $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
+        }
+
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Creates the central directory footer");
+
+        // ----- Zip file comment
+        $v_comment = '';
+        if (isset($p_options[PCLZIP_OPT_COMMENT])) {
+          $v_comment = $p_options[PCLZIP_OPT_COMMENT];
+        }
+
+        // ----- Calculate the size of the central header
+        $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset;
+
+        // ----- Create the central dir footer
+        if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) {
+            // ----- Reset the file list
+            unset($v_header_list);
+            $v_temp_zip->privCloseFd();
+            $this->privCloseFd();
+            @unlink($v_zip_temp_name);
+
+            // ----- Return
+            //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+            return $v_result;
+        }
+
+        // ----- Close
+        $v_temp_zip->privCloseFd();
+        $this->privCloseFd();
+
+        // ----- Delete the zip file
+        // TBC : I should test the result ...
+        @unlink($this->zipname);
+
+        // ----- Rename the temporary file
+        // TBC : I should test the result ...
+        //@rename($v_zip_temp_name, $this->zipname);
+        PclZipUtilRename($v_zip_temp_name, $this->zipname);
+    
+        // ----- Destroy the temporary archive
+        unset($v_temp_zip);
+    }
+    
+    // ----- Remove every files : reset the file
+    else if ($v_central_dir['entries'] != 0) {
+        $this->privCloseFd();
+
+        if (($v_result = $this->privOpenFd('wb')) != 1) {
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+
+        if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) {
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+
+        $this->privCloseFd();
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privDirCheck()
+  // Description :
+  //   Check if a directory exists, if not it creates it and all the parents directory
+  //   which may be useful.
+  // Parameters :
+  //   $p_dir : Directory path to check.
+  // Return Values :
+  //    1 : OK
+  //   -1 : Unable to create directory
+  // --------------------------------------------------------------------------------
+  function privDirCheck($p_dir, $p_is_dir=false)
+  {
+    $v_result = 1;
+
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDirCheck", "entry='$p_dir', is_dir='".($p_is_dir?"true":"false")."'");
+
+    // ----- Remove the final '/'
+    if (($p_is_dir) && (substr($p_dir, -1)=='/'))
+    {
+      $p_dir = substr($p_dir, 0, strlen($p_dir)-1);
+    }
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Looking for entry '$p_dir'");
+
+    // ----- Check the directory availability
+    if ((is_dir($p_dir)) || ($p_dir == ""))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, "'$p_dir' is a directory");
+      return 1;
+    }
+
+    // ----- Extract parent directory
+    $p_parent_dir = dirname($p_dir);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Parent directory is '$p_parent_dir'");
+
+    // ----- Just a check
+    if ($p_parent_dir != $p_dir)
+    {
+      // ----- Look for parent directory
+      if ($p_parent_dir != "")
+      {
+        if (($v_result = $this->privDirCheck($p_parent_dir)) != 1)
+        {
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+          return $v_result;
+        }
+      }
+    }
+
+    // ----- Create the directory
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Create directory '$p_dir'");
+    if (!@mkdir($p_dir, 0777))
+    {
+      // ----- Error log
+      PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'");
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result, "Directory '$p_dir' created");
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privMerge()
+  // Description :
+  //   If $p_archive_to_add does not exist, the function exit with a success result.
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privMerge(&$p_archive_to_add)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privMerge", "archive='".$p_archive_to_add->zipname."'");
+    $v_result=1;
+
+    // ----- Look if the archive_to_add exists
+    if (!is_file($p_archive_to_add->zipname))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to add does not exist. End of merge.");
+
+      // ----- Nothing to merge, so merge is a success
+      $v_result = 1;
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Look if the archive exists
+    if (!is_file($this->zipname))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive does not exist, duplicate the archive_to_add.");
+
+      // ----- Do a duplicate
+      $v_result = $this->privDuplicate($p_archive_to_add->zipname);
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Open the zip file
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+    if (($v_result=$this->privOpenFd('rb')) != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Read the central directory informations
+    $v_central_dir = array();
+    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
+    {
+      $this->privCloseFd();
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Go to beginning of File
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'");
+    @rewind($this->zip_fd);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in zip : ".ftell($this->zip_fd)."'");
+
+    // ----- Open the archive_to_add file
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open archive_to_add in binary read mode");
+    if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1)
+    {
+      $this->privCloseFd();
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Read the central directory informations
+    $v_central_dir_to_add = array();
+    if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1)
+    {
+      $this->privCloseFd();
+      $p_archive_to_add->privCloseFd();
+
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Go to beginning of File
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'");
+    @rewind($p_archive_to_add->zip_fd);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Position in archive_to_add : ".ftell($p_archive_to_add->zip_fd)."'");
+
+    // ----- Creates a temporay file
+    $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
+
+    // ----- Open the temporary file in write mode
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+    if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
+    {
+      $this->privCloseFd();
+      $p_archive_to_add->privCloseFd();
+
+      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Copy the files from the archive to the temporary file
+    // TBC : Here I should better append the file and go back to erase the central dir
+    $v_size = $v_central_dir['offset'];
+    while ($v_size != 0)
+    {
+      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+      $v_buffer = fread($this->zip_fd, $v_read_size);
+      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+      $v_size -= $v_read_size;
+    }
+
+    // ----- Copy the files from the archive_to_add into the temporary file
+    $v_size = $v_central_dir_to_add['offset'];
+    while ($v_size != 0)
+    {
+      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+      $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size);
+      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+      $v_size -= $v_read_size;
+    }
+
+    // ----- Store the offset of the central dir
+    $v_offset = @ftell($v_zip_temp_fd);
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "New offset of central dir : $v_offset");
+
+    // ----- Copy the block of file headers from the old archive
+    $v_size = $v_central_dir['size'];
+    while ($v_size != 0)
+    {
+      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+      $v_buffer = @fread($this->zip_fd, $v_read_size);
+      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+      $v_size -= $v_read_size;
+    }
+
+    // ----- Copy the block of file headers from the archive_to_add
+    $v_size = $v_central_dir_to_add['size'];
+    while ($v_size != 0)
+    {
+      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+      $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);
+      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
+      $v_size -= $v_read_size;
+    }
+
+    // ----- Merge the file comments
+    $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];
+
+    // ----- Calculate the size of the (new) central header
+    $v_size = @ftell($v_zip_temp_fd)-$v_offset;
+
+    // ----- Swap the file descriptor
+    // Here is a trick : I swap the temporary fd with the zip fd, in order to use
+    // the following methods on the temporary fil and not the real archive fd
+    $v_swap = $this->zip_fd;
+    $this->zip_fd = $v_zip_temp_fd;
+    $v_zip_temp_fd = $v_swap;
+
+    // ----- Create the central dir footer
+    if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1)
+    {
+      $this->privCloseFd();
+      $p_archive_to_add->privCloseFd();
+      @fclose($v_zip_temp_fd);
+      $this->zip_fd = null;
+
+      // ----- Reset the file list
+      unset($v_header_list);
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Swap back the file descriptor
+    $v_swap = $this->zip_fd;
+    $this->zip_fd = $v_zip_temp_fd;
+    $v_zip_temp_fd = $v_swap;
+
+    // ----- Close
+    $this->privCloseFd();
+    $p_archive_to_add->privCloseFd();
+
+    // ----- Close the temporary file
+    @fclose($v_zip_temp_fd);
+
+    // ----- Delete the zip file
+    // TBC : I should test the result ...
+    @unlink($this->zipname);
+
+    // ----- Rename the temporary file
+    // TBC : I should test the result ...
+    //@rename($v_zip_temp_name, $this->zipname);
+    PclZipUtilRename($v_zip_temp_name, $this->zipname);
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privDuplicate()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privDuplicate($p_archive_filename)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZip::privDuplicate", "archive_filename='$p_archive_filename'");
+    $v_result=1;
+
+    // ----- Look if the $p_archive_filename exists
+    if (!is_file($p_archive_filename))
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Archive to duplicate does not exist. End of duplicate.");
+
+      // ----- Nothing to duplicate, so duplicate is a success.
+      $v_result = 1;
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Open the zip file
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+    if (($v_result=$this->privOpenFd('wb')) != 1)
+    {
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+      return $v_result;
+    }
+
+    // ----- Open the temporary file in write mode
+    //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 3, "Open file in binary read mode");
+    if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0)
+    {
+      $this->privCloseFd();
+
+      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode');
+
+      // ----- Return
+      //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, PclZip::errorCode(), PclZip::errorInfo());
+      return PclZip::errorCode();
+    }
+
+    // ----- Copy the files from the archive to the temporary file
+    // TBC : Here I should better append the file and go back to erase the central dir
+    $v_size = filesize($p_archive_filename);
+    while ($v_size != 0)
+    {
+      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Read $v_read_size bytes");
+      $v_buffer = fread($v_zip_temp_fd, $v_read_size);
+      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
+      $v_size -= $v_read_size;
+    }
+
+    // ----- Close
+    $this->privCloseFd();
+
+    // ----- Close the temporary file
+    @fclose($v_zip_temp_fd);
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privErrorLog()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function privErrorLog($p_error_code=0, $p_error_string='')
+  {
+    if (PCLZIP_ERROR_EXTERNAL == 1) {
+      PclError($p_error_code, $p_error_string);
+    }
+    else {
+      $this->error_code = $p_error_code;
+      $this->error_string = $p_error_string;
+    }
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privErrorReset()
+  // Description :
+  // Parameters :
+  // --------------------------------------------------------------------------------
+  function privErrorReset()
+  {
+    if (PCLZIP_ERROR_EXTERNAL == 1) {
+      PclErrorReset();
+    }
+    else {
+      $this->error_code = 0;
+      $this->error_string = '';
+    }
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : privDecrypt()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function privDecrypt($p_encryption_header, &$p_buffer, $p_size, $p_crc)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, 'PclZip::privDecrypt', "size=".$p_size."");
+    $v_result=1;
+    
+    // ----- To Be Modified ;-)
+    $v_pwd = "test";
+    
+    $p_buffer = PclZipUtilZipDecrypt($p_buffer, $p_size, $p_encryption_header,
+	                                 $p_crc, $v_pwd);
+    
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  }
+  // End of class
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclZipUtilPathReduction()
+  // Description :
+  // Parameters :
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclZipUtilPathReduction($p_dir)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathReduction", "dir='$p_dir'");
+    $v_result = "";
+
+    // ----- Look for not empty path
+    if ($p_dir != "")
+    {
+      // ----- Explode path by directory names
+      $v_list = explode("/", $p_dir);
+
+      // ----- Study directories from last to first
+      for ($i=sizeof($v_list)-1; $i>=0; $i--)
+      {
+        // ----- Look for current path
+        if ($v_list[$i] == ".")
+        {
+          // ----- Ignore this directory
+          // Should be the first $i=0, but no check is done
+        }
+        else if ($v_list[$i] == "..")
+        {
+          // ----- Ignore it and ignore the $i-1
+          $i--;
+        }
+        else if (($v_list[$i] == "") && ($i!=(sizeof($v_list)-1)) && ($i!=0))
+        {
+          // ----- Ignore only the double '//' in path,
+          // but not the first and last '/'
+        }
+        else
+        {
+          $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:"");
+        }
+      }
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclZipUtilPathInclusion()
+  // Description :
+  //   This function indicates if the path $p_path is under the $p_dir tree. Or,
+  //   said in an other way, if the file or sub-dir $p_path is inside the dir
+  //   $p_dir.
+  //   The function indicates also if the path is exactly the same as the dir.
+  //   This function supports path with duplicated '/' like '//', but does not
+  //   support '.' or '..' statements.
+  // Parameters :
+  // Return Values :
+  //   0 if $p_path is not inside directory $p_dir
+  //   1 if $p_path is inside directory $p_dir
+  //   2 if $p_path is exactly the same as $p_dir
+  // --------------------------------------------------------------------------------
+  function PclZipUtilPathInclusion($p_dir, $p_path)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilPathInclusion", "dir='$p_dir', path='$p_path'");
+    $v_result = 1;
+
+    // ----- Explode dir and path by directory separator
+    $v_list_dir = explode("/", $p_dir);
+    $v_list_dir_size = sizeof($v_list_dir);
+    $v_list_path = explode("/", $p_path);
+    $v_list_path_size = sizeof($v_list_path);
+
+    // ----- Study directories paths
+    $i = 0;
+    $j = 0;
+    while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Working on dir($i)='".$v_list_dir[$i]."' and path($j)='".$v_list_path[$j]."'");
+
+      // ----- Look for empty dir (path reduction)
+      if ($v_list_dir[$i] == '') {
+        $i++;
+        continue;
+      }
+      if ($v_list_path[$j] == '') {
+        $j++;
+        continue;
+      }
+
+      // ----- Compare the items
+      if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != ''))  {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Items ($i,$j) are different");
+        $v_result = 0;
+      }
+
+      // ----- Next items
+      $i++;
+      $j++;
+    }
+
+    // ----- Look if everything seems to be the same
+    if ($v_result) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Look for tie break");
+      // ----- Skip all the empty items
+      while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++;
+      while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++;
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Looking on dir($i)='".($i < $v_list_dir_size?$v_list_dir[$i]:'')."' and path($j)='".($j < $v_list_path_size?$v_list_path[$j]:'')."'");
+
+      if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {
+        // ----- There are exactly the same
+        $v_result = 2;
+      }
+      else if ($i < $v_list_dir_size) {
+        // ----- The path is shorter than the dir
+        $v_result = 0;
+      }
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclZipUtilCopyBlock()
+  // Description :
+  // Parameters :
+  //   $p_mode : read/write compression mode
+  //             0 : src & dest normal
+  //             1 : src gzip, dest normal
+  //             2 : src normal, dest gzip
+  //             3 : src & dest gzip
+  // Return Values :
+  // --------------------------------------------------------------------------------
+  function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilCopyBlock", "size=$p_size, mode=$p_mode");
+    $v_result = 1;
+
+    if ($p_mode==0)
+    {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset before read :".(@ftell($p_src)));
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset before write :".(@ftell($p_dest)));
+      while ($p_size != 0)
+      {
+        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+        $v_buffer = @fread($p_src, $v_read_size);
+        @fwrite($p_dest, $v_buffer, $v_read_size);
+        $p_size -= $v_read_size;
+      }
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Src offset after read :".(@ftell($p_src)));
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Dest offset after write :".(@ftell($p_dest)));
+    }
+    else if ($p_mode==1)
+    {
+      while ($p_size != 0)
+      {
+        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+        $v_buffer = @gzread($p_src, $v_read_size);
+        @fwrite($p_dest, $v_buffer, $v_read_size);
+        $p_size -= $v_read_size;
+      }
+    }
+    else if ($p_mode==2)
+    {
+      while ($p_size != 0)
+      {
+        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+        $v_buffer = @fread($p_src, $v_read_size);
+        @gzwrite($p_dest, $v_buffer, $v_read_size);
+        $p_size -= $v_read_size;
+      }
+    }
+    else if ($p_mode==3)
+    {
+      while ($p_size != 0)
+      {
+        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 4, "Read $v_read_size bytes");
+        $v_buffer = @gzread($p_src, $v_read_size);
+        @gzwrite($p_dest, $v_buffer, $v_read_size);
+        $p_size -= $v_read_size;
+      }
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclZipUtilRename()
+  // Description :
+  //   This function tries to do a simple rename() function. If it fails, it
+  //   tries to copy the $p_src file in a new $p_dest file and then unlink the
+  //   first one.
+  // Parameters :
+  //   $p_src : Old filename
+  //   $p_dest : New filename
+  // Return Values :
+  //   1 on success, 0 on failure.
+  // --------------------------------------------------------------------------------
+  function PclZipUtilRename($p_src, $p_dest)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilRename", "source=$p_src, destination=$p_dest");
+    $v_result = 1;
+
+    // ----- Try to rename the files
+    if (!@rename($p_src, $p_dest)) {
+      //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to rename file, try copy+unlink");
+
+      // ----- Try to copy & unlink the src
+      if (!@copy($p_src, $p_dest)) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to copy file");
+        $v_result = 0;
+      }
+      else if (!@unlink($p_src)) {
+        //--(MAGIC-PclTrace)--//PclTraceFctMessage(__FILE__, __LINE__, 5, "Fail to unlink old filename");
+        $v_result = 0;
+      }
+    }
+
+    // ----- Return
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclZipUtilOptionText()
+  // Description :
+  //   Translate option value in text. Mainly for debug purpose.
+  // Parameters :
+  //   $p_option : the option value.
+  // Return Values :
+  //   The option text value.
+  // --------------------------------------------------------------------------------
+  function PclZipUtilOptionText($p_option)
+  {
+    //--(MAGIC-PclTrace)--//PclTraceFctStart(__FILE__, __LINE__, "PclZipUtilOptionText", "option='".$p_option."'");
+    
+    $v_list = get_defined_constants();
+    for (reset($v_list); $v_key = key($v_list); next($v_list)) {
+	  $v_prefix = substr($v_key, 0, 10);
+	  if ((($v_prefix == 'PCLZIP_OPT') || ($v_prefix == 'PCLZIP_CB_'))
+	      && ($v_list[$v_key] == $p_option)) {
+          //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_key);
+          return $v_key;
+	    }
+    }
+    
+    $v_result = 'Unknown';
+
+    //--(MAGIC-PclTrace)--//PclTraceFctEnd(__FILE__, __LINE__, $v_result);
+    return $v_result;
+  }
+  // --------------------------------------------------------------------------------
+
+  // --------------------------------------------------------------------------------
+  // Function : PclZipUtilTranslateWinPath()
+  // Description :
+  //   Translate windows path by replacing '\' by '/' and optionally removing
+  //   drive letter.
+  // Parameters :
+  //   $p_path : path to translate.
+  //   $p_remove_disk_letter : true | false
+  // Return Values :
+  //   The path translated.
+  // --------------------------------------------------------------------------------
+  function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true)
+  {
+    if (stristr(php_uname(), 'windows')) {
+      // ----- Look for potential disk letter
+      if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {
+          $p_path = substr($p_path, $v_position+1);
+      }
+      // ----- Change potential windows directory separator
+      if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) {
+          $p_path = strtr($p_path, '\\', '/');
+      }
+    }
+    return $p_path;
+  }
+  // --------------------------------------------------------------------------------
+
+
+?>
diff -ruN 6171/e107_handlers/php_compatibility_handler.php 75/e107_handlers/php_compatibility_handler.php
--- 6171/e107_handlers/php_compatibility_handler.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/php_compatibility_handler.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,79 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+// e107 requires PHP > 4.3.0, all functions that are used in e107, introduced in newer
+// versions than that should be recreated in here for compatabilty reasons..
+
+if (!function_exists('file_put_contents')) {
+	/**
+	* @return int
+	* @param string $filename
+	* @param mixed $data
+	* @desc Write a string to a file
+	*/
+	function file_put_contents($filename, $data) {
+		if (($h = @fopen($filename, 'w+')) === false) {
+			return false;
+		}
+		if (($bytes = @fwrite($h, $data)) === false) {
+			return false;
+		}
+		fclose($h);
+		return $bytes;
+	}
+}
+
+if (!function_exists('stripos')) {
+	function stripos($haystack, $needle) {
+		$parts = explode(strtolower($needle), strtolower($haystack), 2);
+		if (count($parts) == 1) {
+			return false;
+		}
+		return strlen($parts[0]);
+	}
+}
+
+
+
+if(!function_exists("mime_content_type")){
+	function mime_content_type($filename){
+
+		$filename = basename($filename);
+
+		$mime[".zip"] = "application/x-zip-compressed";
+		$mime[".gif"] = "image/gif";
+		$mime[".png"] = "image/x-png";
+		$mime[".jpg"] = "image/jpeg";
+		$mime[".jpeg"] = "image/jpeg";
+		$mime[".tif"] = "image/tiff";
+		$mime[".tiff"] = "image/tiff";
+		$mime[".pdf"] = "application/pdf";
+		$mime[".hqx"] = "application/mac-binhex40";
+		$mime[".doc"] = "application/msword";
+		$mime[".dot"] = "application/msword";
+		$mime[".exe"] = "application/octet-stream";
+		$mime[".au"] = "audio/basic";
+		$mime[".snd"] = "audio/basic";
+		$mime[".mid"] = "audio/mid";
+		$mime[".mp3"] = "audio/mpeg";
+		$mime[".aif"] = "audio/x-aiff";
+		$mime[".ra"] = "audio/x-pn-realaudio";
+		$mime[".ram"] = "audio/x-pn-realaudio";
+		$mime[".wav"] = "audio/x-wav";
+		$mime[".bmp"] = "image/bmp";
+		$mime[".ra"] = "audio/x-pn-realaudio";
+		$mime[".htm"] = "text/html";
+		$mime[".html"] = "text/html";
+		$mime[".css"] = "text/css";
+		$mime[".txt"] = "text/plain";
+		$mime[".mov"] = "video/quicktime";
+		$mime[".mpg"] = "video/mpeg";
+		$mime[".asx"] = "video/x-ms-asf";
+		$mime[".avi"] = "video/x-msvideo";
+
+		$ext = strrchr($filename, '.');
+		return $mime[$ext];
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/phpmailer/class.phpmailer.php 75/e107_handlers/phpmailer/class.phpmailer.php
--- 6171/e107_handlers/phpmailer/class.phpmailer.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/phpmailer/class.phpmailer.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,1598 @@
+<?php
+
+////////////////////////////////////////////////////
+// PHPMailer - PHP email class
+//
+// Class for sending email using either
+// sendmail, PHP mail(), or SMTP.  Methods are
+// based upon the standard AspEmail(tm) classes.
+//
+// Copyright (C) 2001 - 2003  Brent R. Matzelle
+//
+// License: LGPL, see LICENSE
+////////////////////////////////////////////////////
+
+// --------------------------------------------------------------
+// BUGFIX
+//
+// handles embedded images correctly
+// also handles multipart/alternative (->altBody('text'))
+// messages correctly, even with embedded images
+// and on top of it all, handles attachments correctly
+// EVEN when you have embedded images, and/or used ->altBody()
+//
+// Fix (c) by Csaba Kiss (ironclad@freemail.hu), 2004-April-30
+// --------------------------------------------------------------
+
+
+/**
+ * PHPMailer - PHP email transport class
+ * @package PHPMailer
+ * @author Brent R. Matzelle
+ * @copyright 2001 - 2003 Brent R. Matzelle
+ */
+class PHPMailer
+{
+    /////////////////////////////////////////////////
+    // PUBLIC VARIABLES
+    /////////////////////////////////////////////////
+
+    /**
+     * Email priority (1 = High, 3 = Normal, 5 = low).
+     * @var int
+     */
+    var $Priority          = 3;
+
+    /**
+     * Sets the CharSet of the message.
+     * @var string
+     */
+    var $CharSet           = CHARSET;
+
+    /**
+     * Sets the Content-type of the message.
+     * @var string
+     */
+    var $ContentType        = "text/plain";
+
+    /**
+     * Sets the Encoding of the message. Options for this are "8bit",
+     * "7bit", "binary", "base64", and "quoted-printable".
+     * @var string
+     */
+    var $Encoding          = "8bit";
+
+    /**
+     * Holds the most recent mailer error message.
+     * @var string
+     */
+    var $ErrorInfo         = "";
+
+    /**
+     * Sets the From email address for the message.
+     * @var string
+     */
+    var $From               = "root@localhost";
+
+    /**
+     * Sets the From name of the message.
+     * @var string
+     */
+    var $FromName           = "Root User";
+
+    /**
+     * Sets the Sender email (Return-Path) of the message.  If not empty,
+     * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.
+     * @var string
+     */
+    var $Sender            = "";
+
+    /**
+     * Sets the Subject of the message.
+     * @var string
+     */
+    var $Subject           = "";
+
+    /**
+     * Sets the Body of the message.  This can be either an HTML or text body.
+     * If HTML then run IsHTML(true).
+     * @var string
+     */
+    var $Body               = "";
+
+    /**
+     * Sets the text-only body of the message.  This automatically sets the
+     * email to multipart/alternative.  This body can be read by mail
+     * clients that do not have HTML email capability such as mutt. Clients
+     * that can read HTML will view the normal Body.
+     * @var string
+     */
+    var $AltBody           = "";
+
+    /**
+     * Sets word wrapping on the body of the message to a given number of
+     * characters.
+     * @var int
+     */
+    var $WordWrap          = 0;
+
+    /**
+     * Method to send mail: ("mail", "sendmail", or "smtp").
+     * @var string
+     */
+    var $Mailer            = "mail";
+
+    /**
+     * Sets the path of the sendmail program.
+     * @var string
+     */
+    var $Sendmail          = "/usr/sbin/sendmail";
+
+    /**
+     * Path to PHPMailer plugins.  This is now only useful if the SMTP class
+     * is in a different directory than the PHP include path.
+     * @var string
+     */
+    var $PluginDir         = "";
+
+    /**
+     *  Holds PHPMailer version.
+     *  @var string
+     */
+    var $Version           = "1.71";
+
+    /**
+     * Sets the email address that a reading confirmation will be sent.
+     * @var string
+     */
+    var $ConfirmReadingTo  = "";
+
+    /**
+     *  Sets the hostname to use in Message-Id and Received headers
+     *  and as default HELO string. If empty, the value returned
+     *  by SERVER_NAME is used or 'localhost.localdomain'.
+     *  @var string
+     */
+    var $Hostname          = "";
+
+
+    /////////////////////////////////////////////////
+    // SMTP VARIABLES
+    /////////////////////////////////////////////////
+
+    /**
+     *  Sets the SMTP hosts.  All hosts must be separated by a
+     *  semicolon.  You can also specify a different port
+     *  for each host by using this format: [hostname:port]
+     *  (e.g. "smtp1.example.com:25;smtp2.example.com").
+     *  Hosts will be tried in order.
+     *  @var string
+     */
+    var $Host        = "localhost";
+
+    /**
+     *  Sets the default SMTP server port.
+     *  @var int
+     */
+    var $Port        = 25;
+
+    /**
+     *  Sets the SMTP HELO of the message (Default is $Hostname).
+     *  @var string
+     */
+    var $Helo        = "";
+
+    /**
+     *  Sets SMTP authentication. Utilizes the Username and Password variables.
+     *  @var bool
+     */
+    var $SMTPAuth     = false;
+
+    /**
+     *  Sets SMTP username.
+     *  @var string
+     */
+    var $Username     = "";
+
+    /**
+     *  Sets SMTP password.
+     *  @var string
+     */
+    var $Password     = "";
+
+    /**
+     *  Sets the SMTP server timeout in seconds. This function will not
+     *  work with the win32 version.
+     *  @var int
+     */
+    var $Timeout      = 10;
+
+    /**
+     *  Sets SMTP class debugging on or off.
+     *  @var bool
+     */
+    var $SMTPDebug    = false;
+
+    /**
+     * Prevents the SMTP connection from being closed after each mail
+     * sending.  If this is set to true then to close the connection
+     * requires an explicit call to SmtpClose().
+     * @var bool
+     */
+    var $SMTPKeepAlive = false;
+
+    /**#@+
+     * @access private
+     */
+    var $smtp            = NULL;
+    var $to              = array();
+    var $cc              = array();
+    var $bcc             = array();
+    var $ReplyTo         = array();
+    var $attachment      = array();
+    var $CustomHeader    = array();
+    var $message_type    = "";
+    var $boundary        = array();
+    var $language        = array();
+    var $error_count     = 0;
+    var $LE              = "\n";
+    /**#@-*/
+
+    /////////////////////////////////////////////////
+    // VARIABLE METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Sets message type to HTML.
+     * @param bool $bool
+     * @return void
+     */
+    function IsHTML($bool) {
+        if($bool == true)
+            $this->ContentType = "text/html";
+        else
+            $this->ContentType = "text/plain";
+    }
+
+    /**
+     * Sets Mailer to send message using SMTP.
+     * @return void
+     */
+    function IsSMTP() {
+        $this->Mailer = "smtp";
+    }
+
+    /**
+     * Sets Mailer to send message using PHP mail() function.
+     * @return void
+     */
+    function IsMail() {
+        $this->Mailer = "mail";
+    }
+
+    /**
+     * Sets Mailer to send message using the $Sendmail program.
+     * @return void
+     */
+    function IsSendmail() {
+        $this->Mailer = "sendmail";
+    }
+
+    /**
+     * Sets Mailer to send message using the qmail MTA.
+     * @return void
+     */
+    function IsQmail() {
+        $this->Sendmail = "/var/qmail/bin/sendmail";
+        $this->Mailer = "sendmail";
+    }
+
+
+    /////////////////////////////////////////////////
+    // RECIPIENT METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Adds a "To" address.
+     * @param string $address
+     * @param string $name
+     * @return void
+     */
+    function AddAddress($address, $name = "") {
+        $cur = count($this->to);
+        $this->to[$cur][0] = trim($address);
+        $this->to[$cur][1] = $name;
+    }
+
+    /**
+     * Adds a "Cc" address. Note: this function works
+     * with the SMTP mailer on win32, not with the "mail"
+     * mailer.
+     * @param string $address
+     * @param string $name
+     * @return void
+    */
+    function AddCC($address, $name = "") {
+        $cur = count($this->cc);
+        $this->cc[$cur][0] = trim($address);
+        $this->cc[$cur][1] = $name;
+    }
+
+    /**
+     * Adds a "Bcc" address. Note: this function works
+     * with the SMTP mailer on win32, not with the "mail"
+     * mailer.
+     * @param string $address
+     * @param string $name
+     * @return void
+     */
+    function AddBCC($address, $name = "") {
+        $cur = count($this->bcc);
+        $this->bcc[$cur][0] = trim($address);
+        $this->bcc[$cur][1] = $name;
+    }
+
+    /**
+     * Adds a "Reply-to" address.
+     * @param string $address
+     * @param string $name
+     * @return void
+     */
+    function AddReplyTo($address, $name = "") {
+        $cur = count($this->ReplyTo);
+        $this->ReplyTo[$cur][0] = trim($address);
+        $this->ReplyTo[$cur][1] = $name;
+    }
+
+
+    /////////////////////////////////////////////////
+    // MAIL SENDING METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Creates message and assigns Mailer. If the message is
+     * not sent successfully then it returns false.  Use the ErrorInfo
+     * variable to view description of the error.
+     * @return bool
+     */
+    function Send() {
+        $header = "";
+        $body = "";
+
+        if((count($this->to) + count($this->cc) + count($this->bcc)) < 1)       {
+            $this->SetError($this->Lang("provide_address"));
+            return false;
+        }
+
+        // Set whether the message is multipart/alternative
+        if(!empty($this->AltBody))
+            $this->ContentType = "multipart/alternative";
+
+        $this->SetMessageType();
+        $header .= $this->CreateHeader();
+        $body = $this->CreateBody();
+
+        if($body == "") { 
+return false;
+ }
+
+        // Choose the mailer
+        if($this->Mailer == "sendmail")     {
+          if(!$this->SendmailSend($header, $body))
+              return false;
+        }
+        elseif($this->Mailer == "mail")        {
+          if(!$this->MailSend($header, $body))
+              return false;
+        }
+        elseif($this->Mailer == "smtp")        {
+          if(!$this->SmtpSend($header, $body))
+              return false;
+        }        else        {
+            $this->SetError($this->Mailer . $this->Lang("mailer_not_supported"));
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Sends mail using the $Sendmail program.
+     * @access private
+     * @return bool
+     */
+    function SendmailSend($header, $body) {
+        if ($this->Sender != "")
+            $sendmail = sprintf("%s -oi -f %s -t", $this->Sendmail, $this->Sender);
+        else
+            $sendmail = sprintf("%s -oi -t", $this->Sendmail);
+
+        if(!@$mail = popen($sendmail, "w"))        {
+            $this->SetError($this->Lang("execute") . $this->Sendmail);
+            return false;
+        }
+
+        fputs($mail, $header);
+        fputs($mail, $body);
+
+        $result = pclose($mail) >> 8 & 0xFF;
+        if($result != 0)        {
+            $this->SetError($this->Lang("execute") . $this->Sendmail);
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Sends mail using the PHP mail() function.
+     * @access private
+     * @return bool
+     */
+    function MailSend($header, $body) {
+        $to = "";
+        for($i = 0; $i < count($this->to); $i++)        {
+            if($i != 0) { 
+$to .= ", "; 
+}
+            $to .= $this->to[$i][0];
+        }
+
+        if ($this->Sender != "" && strlen(ini_get("safe_mode"))< 1)        {
+            $old_from = ini_get("sendmail_from");
+            ini_set("sendmail_from", $this->Sender);
+            $params = sprintf("-oi -f %s", $this->Sender);
+            $rt = @mail($to, $this->EncodeHeader($this->Subject), $body,
+                        $header, $params);
+        }
+        else
+            $rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
+
+        if (isset($old_from))
+            ini_set("sendmail_from", $old_from);
+
+        if(!$rt)        {
+            $this->SetError($this->Lang("instantiate"));
+            return false;
+        }
+
+        return true;
+    }
+
+    /**
+     * Sends mail via SMTP using PhpSMTP (Author:
+     * Chris Ryan).  Returns bool.  Returns false if there is a
+     * bad MAIL FROM, RCPT, or DATA input.
+     * @access private
+     * @return bool
+     */
+    function SmtpSend($header, $body) {
+        include_once($this->PluginDir . "class.smtp.php");
+        $error = "";
+        $bad_rcpt = array();
+
+        if(!$this->SmtpConnect())
+            return false;
+
+        $smtp_from = ($this->Sender == "") ? $this->From : $this->Sender;
+        if(!$this->smtp->Mail($smtp_from))        {
+            $error = $this->Lang("from_failed") . $smtp_from;
+            $this->SetError($error);
+            $this->smtp->Reset();
+            return false;
+        }
+
+        // Attempt to send attach all recipients
+        for($i = 0; $i < count($this->to); $i++)        {
+            if(!$this->smtp->Recipient($this->to[$i][0]))
+                $bad_rcpt[] = $this->to[$i][0];
+        }
+        for($i = 0; $i < count($this->cc); $i++)        {
+            if(!$this->smtp->Recipient($this->cc[$i][0]))
+                $bad_rcpt[] = $this->cc[$i][0];
+        }
+        for($i = 0; $i < count($this->bcc); $i++)        {
+            if(!$this->smtp->Recipient($this->bcc[$i][0]))
+                $bad_rcpt[] = $this->bcc[$i][0];
+        }
+
+        if(count($bad_rcpt) > 0) // Create error message
+        {
+            for($i = 0; $i < count($bad_rcpt); $i++)            {
+                if($i != 0) {
+ $error .= ", "; 
+}
+                $error .= $bad_rcpt[$i];
+            }
+            $error = $this->Lang("recipients_failed") . $error;
+            $this->SetError($error);
+            $this->smtp->Reset();
+            return false;
+        }
+
+        if(!$this->smtp->Data($header . $body))        {
+            $this->SetError($this->Lang("data_not_accepted"));
+            $this->smtp->Reset();
+            return false;
+        }
+        if($this->SMTPKeepAlive == true)
+            $this->smtp->Reset();
+        else
+            $this->SmtpClose();
+
+        return true;
+    }
+
+    /**
+     * Initiates a connection to an SMTP server.  Returns false if the
+     * operation failed.
+     * @access private
+     * @return bool
+     */
+    function SmtpConnect() {
+        if($this->smtp == NULL) { 
+$this->smtp = new SMTP();
+ }
+
+        $this->smtp->do_debug = $this->SMTPDebug;
+        $hosts = explode(";", $this->Host);
+        $index = 0;
+        $connection = ($this->smtp->Connected());
+
+        // Retry while there is no connection
+        while($index < count($hosts) && $connection == false) {
+            if(strstr($hosts[$index], ":"))
+                list($host, $port) = explode(":", $hosts[$index]);
+            else
+            {
+                $host = $hosts[$index];
+                $port = $this->Port;
+            }
+
+            if($this->smtp->Connect($host, $port, $this->Timeout)) {
+                if ($this->Helo != '')
+                    $this->smtp->Hello($this->Helo);
+                else
+                    $this->smtp->Hello($this->ServerHostname());
+
+                if($this->SMTPAuth)                {
+                    if(!$this->smtp->Authenticate($this->Username,
+                                                  $this->Password))  {
+                        $this->SetError($this->Lang("authenticate"));
+                        $this->smtp->Reset();
+                        $connection = false;
+                    }
+                }
+                $connection = true;
+            }
+            $index++;
+        }
+        if(!$connection)
+            $this->SetError($this->Lang("connect_host"));
+
+        return $connection;
+    }
+
+    /**
+     * Closes the active SMTP session if one exists.
+     * @return void
+     */
+    function SmtpClose() {
+        if($this->smtp != NULL)        {
+            if($this->smtp->Connected())            {
+                $this->smtp->Quit();
+                $this->smtp->Close();
+            }
+        }
+    }
+
+    /**
+     * Sets the language for all class error messages.  Returns false
+     * if it cannot load the language file.  The default language type
+     * is English.
+     * @param string $lang_type Type of language (e.g. Portuguese: "br")
+     * @param string $lang_path Path to the language file directory
+     * @access public
+     * @return bool
+     */
+    function SetLanguage($lang_type, $lang_path = "language/") {
+        if(file_exists($lang_path.'phpmailer.lang-'.$lang_type.'.php'))
+            include($lang_path.'phpmailer.lang-'.$lang_type.'.php');
+        else if(file_exists($lang_path.'phpmailer.lang-en.php'))
+            include($lang_path.'phpmailer.lang-en.php');
+        else
+        {
+            $this->SetError("Could not load language file");
+            return false;
+        }
+        $this->language = $PHPMAILER_LANG;
+
+        return true;
+    }
+
+    /////////////////////////////////////////////////
+    // MESSAGE CREATION METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Creates recipient headers.
+     * @access private
+     * @return string
+     */
+    function AddrAppend($type, $addr) {
+        $addr_str = $type . ": ";
+        $addr_str .= $this->AddrFormat($addr[0]);
+        if(count($addr) > 1)        {
+            for($i = 1; $i < count($addr); $i++)
+                $addr_str .= ", " . $this->AddrFormat($addr[$i]);
+        }
+        $addr_str .= $this->LE;
+
+        return $addr_str;
+    }
+
+    /**
+     * Formats an address correctly.
+     * @access private
+     * @return string
+     */
+    function AddrFormat($addr) {
+        if(empty($addr[1]))
+            $formatted = $addr[0];
+        else
+        {
+            $formatted = $this->EncodeHeader($addr[1], 'phrase') . " <" .  $addr[0] . ">";
+        }
+
+        return $formatted;
+    }
+
+    /**
+     * Wraps message for use with mailers that do not
+     * automatically perform wrapping and for quoted-printable.
+     * Original written by philippe.
+     * @access private
+     * @return string
+     */
+    function WrapText($message, $length, $qp_mode = false) {
+        $soft_break = ($qp_mode) ? sprintf(" =%s", $this->LE) :
+ $this->LE;
+
+        $message = $this->FixEOL($message);
+        if (substr($message, -1) == $this->LE)
+            $message = substr($message, 0, -1);
+
+        $line = explode($this->LE, $message);
+        $message = "";
+        for ($i=0 ;$i < count($line); $i++)        {
+          $line_part = explode(" ", $line[$i]);
+          $buf = "";
+          for ($e = 0; $e<count($line_part); $e++)          {
+              $word = $line_part[$e];
+              if ($qp_mode and (strlen($word) > $length))              {
+                $space_left = $length - strlen($buf) - 1;
+                if ($e != 0)                {
+                    if ($space_left > 20)                    {
+                        $len = $space_left;
+                        if (substr($word, $len - 1, 1) == "=")
+                          $len--;
+                        elseif (substr($word, $len - 2, 1) == "=")
+                          $len -= 2;
+                        $part = substr($word, 0, $len);
+                        $word = substr($word, $len);
+                        $buf .= " " . $part;
+                        $message .= $buf . sprintf("=%s", $this->LE);
+                    }                    else                    {
+                        $message .= $buf . $soft_break;
+                    }
+                    $buf = "";
+                }
+                while (strlen($word) > 0)                {
+                    $len = $length;
+                    if (substr($word, $len - 1, 1) == "=")
+                        $len--;
+                    elseif (substr($word, $len - 2, 1) == "=")
+                        $len -= 2;
+                    $part = substr($word, 0, $len);
+                    $word = substr($word, $len);
+
+                    if (strlen($word) > 0)
+                        $message .= $part . sprintf("=%s", $this->LE);
+                    else
+                        $buf = $part;
+                }
+              }              else              {
+                $buf_o = $buf;
+                $buf .= ($e == 0) ? $word : (" " . $word);
+
+                if (strlen($buf) > $length and $buf_o != "")                {
+                    $message .= $buf_o . $soft_break;
+                    $buf = $word;
+                }
+              }
+          }
+          $message .= $buf . $this->LE;
+        }
+
+        return $message;
+    }
+
+    /**
+     * Set the body wrapping.
+     * @access private
+     * @return void
+     */
+    function SetWordWrap() {
+        if($this->WordWrap < 1)
+            return;
+
+        switch($this->message_type)        {
+           case "alt":
+              // fall through
+           case "alt_attachment":
+              $this->AltBody = $this->WrapText($this->AltBody, $this->WordWrap);
+              break;
+           default:
+              $this->Body = $this->WrapText($this->Body, $this->WordWrap);
+              break;
+        }
+    }
+
+    /**
+     * Assembles message header.
+     * @access private
+     * @return string
+     */
+    function CreateHeader() {
+        $result = "";
+
+        // Set the boundaries
+        $uniq_id = substr(md5(uniqid(time())),0,16).'_PORKOLT';
+        $this->boundary[1] = "B1grr_" . $uniq_id;
+        $this->boundary[2] = "B2grr_" . $uniq_id;
+        $this->boundary[3] = "B3grr_" . $uniq_id; // added by Csaba Kiss (fix) used if alternative, and inline + normal atts exist
+
+        $result .= $this->Received();
+        $result .= $this->HeaderLine("Date", $this->RFCDate());
+        if($this->Sender == "")
+            $result .= $this->HeaderLine("Return-Path", trim($this->From));
+        else
+            $result .= $this->HeaderLine("Return-Path", trim($this->Sender));
+
+        // To be created automatically by mail()
+        if($this->Mailer != "mail")        {
+            if(count($this->to) > 0)
+                $result .= $this->AddrAppend("To", $this->to);
+            else if (count($this->cc) == 0)
+                $result .= $this->HeaderLine("To", "undisclosed-recipients:;");
+            if(count($this->cc) > 0)
+                $result .= $this->AddrAppend("Cc", $this->cc);
+        }
+
+        $from = array();
+        $from[0][0] = trim($this->From);
+        $from[0][1] = $this->FromName;
+        $result .= $this->AddrAppend("From", $from);
+
+        // sendmail and mail() extract Bcc from the header before sending
+        if((($this->Mailer == "sendmail") || ($this->Mailer == "mail")) && (count($this->bcc) > 0))
+            $result .= $this->AddrAppend("Bcc", $this->bcc);
+
+        if(count($this->ReplyTo) > 0)
+            $result .= $this->AddrAppend("Reply-to", $this->ReplyTo);
+
+        // mail() sets the subject itself
+        if($this->Mailer != "mail")
+            $result .= $this->HeaderLine("Subject", $this->EncodeHeader(trim($this->Subject)));
+
+        $result .= sprintf("Message-ID: <%s@%s>%s", $uniq_id, $this->ServerHostname(), $this->LE);
+        $result .= $this->HeaderLine("X-Priority", $this->Priority);
+        $result .= $this->HeaderLine("X-Mailer", "PHPMailer BugFix 1.71+ (C)KCS for AES [version " . $this->Version . "]");
+
+        if($this->ConfirmReadingTo != "")   {
+            $result .= $this->HeaderLine("Disposition-Notification-To",
+                       "<" . trim($this->ConfirmReadingTo) . ">");
+        }
+
+        // Add custom headers
+        for($index = 0; $index < count($this->CustomHeader); $index++)        {
+            $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]),
+                       $this->EncodeHeader(trim($this->CustomHeader[$index][1])));
+        }
+        $result .= $this->HeaderLine("MIME-Version", "1.0");
+
+        switch($this->message_type)        {
+            case "plain":
+                $result .= $this->HeaderLine("Content-Transfer-Encoding", $this->Encoding);
+                $result .= sprintf("Content-Type: %s; charset=\"%s\"",
+                                    $this->ContentType, $this->CharSet);
+                break;
+            case "attachments":
+                // fall through
+            case "alt_attachments":
+                if($this->InlineImageExists() && $this->AttachmentNotInlineExists())               {
+                    // BUGFIX! if alternative, and attached images exist as well
+                    // then type must be multipart/alternative NOT text/html (c) Csaba Kiss
+                    $result .= $this->HeaderLine("Content-Type", "multipart/mixed;");
+                    $result .= $this->TextLine("\tboundary=\"" . $this->boundary[3] . '"');
+                    $result .= $this->TextLine("This is a multipart message in MIME format. :-)");
+
+                    if($this->message_type=='alt_attachments')
+						$alt = 'multipart/alternative';
+					else
+						$alt = 'text/html';
+
+					$result .= $this->LE;
+		            $result .= sprintf("--%s%s", $this->boundary[3], $this->LE);  // add mixed start
+                   	$result .= sprintf("Content-Type: %s;%s\ttype=\"{$alt}\";%s\tboundary=\"%s\"%s",
+                                    "multipart/related", $this->LE, $this->LE,
+                                    $this->boundary[1], $this->LE);
+                	$result .= $this->LE;
+                }
+				else if($this->InlineImageExists())
+				{
+					if($this->message_type=='alt_attachments')
+						$alt = 'multipart/alternative';
+					else
+						$alt = 'text/html';
+                    $result .= sprintf("Content-Type: %s;%s\ttype=\"{$alt}\";%s\tboundary=\"%s\"%s",
+                                    "multipart/related", $this->LE, $this->LE,
+                                    $this->boundary[1], $this->LE);
+
+				}
+                else
+                {
+                    // attachment(not inline) exists
+                    $result .= $this->HeaderLine("Content-Type", "multipart/mixed;");
+                    $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+                    $result .= $this->TextLine("This is a multipart message in MIME format. :-)");
+                }
+                break;
+            case "alt":
+                $result .= $this->HeaderLine("Content-Type", "multipart/alternative;");
+                $result .= $this->TextLine("\tboundary=\"" . $this->boundary[1] . '"');
+                break;
+        }
+
+        if($this->Mailer != "mail")
+            $result .= $this->LE.$this->LE;
+
+        return $result;
+    }
+
+    /**
+     * Assembles the message body.  Returns an empty string on failure.
+     * @access private
+     * @return string
+     */
+    function CreateBody() {
+        $result = "";
+
+        $this->SetWordWrap();
+
+        switch($this->message_type)   {
+            case "alt":
+                $result .= $this->GetBoundary($this->boundary[1], "",
+                                              "text/plain", "");
+                $result .= $this->EncodeString($this->AltBody, $this->Encoding);
+                $result .= $this->LE.$this->LE;
+                $result .= $this->GetBoundary($this->boundary[1], "",
+                                              "text/html", "");
+
+                $result .= $this->EncodeString($this->Body, $this->Encoding);
+                $result .= $this->LE.$this->LE;
+
+                $result .= $this->EndBoundary($this->boundary[1]);
+                break;
+            case "plain":
+                $result .= $this->EncodeString($this->Body, $this->Encoding);
+                break;
+            case "attachments":
+                if($this->InlineImageExists() && $this->AttachmentNotInlineExists()) {
+						// first attach inline then other attachments
+						// other attachments will go with multipart/mixed
+						// not multipart/related!  - fix by Csaba Kiss, 2004-april-30
+                       	$result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
+	        	        $result .= $this->GetBoundary($this->boundary[1], "", "", "");
+    	        	    $result .= $this->EncodeString($this->Body, $this->Encoding);
+		                $result .= $this->LE.$this->LE;
+                        $result .= $this->AttachAll('inline', $this->boundary[1]); // ends boundary
+                        $result .= $this->LE;
+                        $result .= $this->AttachAll('attachment', $this->boundary[3]);
+                		}
+				else {
+        	        $result .= $this->GetBoundary($this->boundary[1], "", "", "");
+    	       	    $result .= $this->EncodeString($this->Body, $this->Encoding);
+		            $result .= $this->LE;
+                    $result .= $this->AttachAll();
+                    }
+                break;
+            case "alt_attachments":
+                if($this->InlineImageExists() && $this->AttachmentNotInlineExists()) {
+                  	$result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
+    	            $result .= sprintf("Content-Type: %s;%s" .
+        	                           "\tboundary=\"%s\"%s",
+            	                       "multipart/alternative", $this->LE,
+                	                   $this->boundary[2], $this->LE.$this->LE);
+    	            // Create text body
+	                $result .= $this->GetBoundary($this->boundary[2], "",
+            	                                  "text/plain", "") . $this->LE;
+        	        $result .= $this->EncodeString($this->AltBody, $this->Encoding);
+    	            $result .= $this->LE.$this->LE;
+	                // Create the HTML body
+            	    $result .= $this->GetBoundary($this->boundary[2], "",
+                	                              "text/html", "") . $this->LE;
+        	        $result .= $this->EncodeString($this->Body, $this->Encoding);
+    	            $result .= $this->LE.$this->LE;
+	                $result .= $this->EndBoundary($this->boundary[2]);
+	                $result .= $this->LE;
+                	$result .= $this->AttachAll('inline', $this->boundary[1]); //multipart/related END
+                	$result .= $this->LE;
+                	$result .= $this->AttachAll('attachment', $this->boundary[3]); // multipart/mixed END
+                }
+                else {
+	                $result .= sprintf("--%s%s", $this->boundary[1], $this->LE);
+    	            $result .= sprintf("Content-Type: %s;%s" .
+        	                           "\tboundary=\"%s\"%s",
+            	                       "multipart/alternative", $this->LE,
+                	                   $this->boundary[2], $this->LE.$this->LE);
+
+    	            // Create text body
+	                $result .= $this->GetBoundary($this->boundary[2], "",
+            	                                  "text/plain", "") . $this->LE;
+        	        $result .= $this->EncodeString($this->AltBody, $this->Encoding);
+    	            $result .= $this->LE.$this->LE;
+	                // Create the HTML body
+            	    $result .= $this->GetBoundary($this->boundary[2], "",
+                	                              "text/html", "") . $this->LE;
+        	        $result .= $this->EncodeString($this->Body, $this->Encoding);
+    	            $result .= $this->LE.$this->LE;
+	                $result .= $this->EndBoundary($this->boundary[2]);
+                	$result .= $this->AttachAll();
+                }
+                break;
+        }
+        if($this->IsError())
+            $result = "";
+
+        return $result;
+    }
+
+    /**
+     * Returns the start of a message boundary.
+     * @access private
+     */
+    function GetBoundary($boundary, $charSet, $contentType, $encoding) {
+        $result = "";
+        if($charSet == "") { $charSet = $this->CharSet; }
+        if($contentType == "") { $contentType = $this->ContentType; }
+        if($encoding == "") { $encoding = $this->Encoding; }
+
+        $result .= $this->TextLine("--" . $boundary);
+        $result .= sprintf("Content-Type: %s; charset = \"%s\"",
+                            $contentType, $charSet);
+        $result .= $this->LE;
+        $result .= $this->HeaderLine("Content-Transfer-Encoding", $encoding);
+        $result .= $this->LE;
+
+        return $result;
+    }
+
+    /**
+     * Returns the end of a message boundary.
+     * @access private
+     */
+    function EndBoundary($boundary) {
+        return $this->LE . "--" . $boundary . "--" . $this->LE;
+    }
+
+    /**
+     * Sets the message type.
+     * @access private
+     * @return void
+     */
+    function SetMessageType() {
+        if(count($this->attachment) < 1 && strlen($this->AltBody) < 1)
+            $this->message_type = "plain";
+        else
+        {
+            if(count($this->attachment) > 0)
+                $this->message_type = "attachments";
+            if(strlen($this->AltBody) > 0 && count($this->attachment) < 1)
+                $this->message_type = "alt";
+            if(strlen($this->AltBody) > 0 && count($this->attachment) > 0)
+                $this->message_type = "alt_attachments";
+        }
+    }
+
+    /**
+     * Returns a formatted header line.
+     * @access private
+     * @return string
+     */
+    function HeaderLine($name, $value) {
+        return $name . ": " . $value . $this->LE;
+    }
+
+    /**
+     * Returns a formatted mail line.
+     * @access private
+     * @return string
+     */
+    function TextLine($value) {
+        return $value . $this->LE;
+    }
+
+    /////////////////////////////////////////////////
+    // ATTACHMENT METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Adds an attachment from a path on the filesystem.
+     * Returns false if the file could not be found
+     * or accessed.
+     * @param string $path Path to the attachment.
+     * @param string $name Overrides the attachment name.
+     * @param string $encoding File encoding (see $Encoding).
+     * @param string $type File extension (MIME) type.
+     * @return bool
+     */
+    function AddAttachment($path, $name = "", $encoding = "base64",
+                           $type = "application/octet-stream") {
+        if(!@is_file($path))        {
+            $this->SetError($this->Lang("file_access") . $path);
+            return false;
+        }
+
+        $filename = basename($path);
+        if($name == "")
+            $name = $filename;
+
+        $cur = count($this->attachment);
+        $this->attachment[$cur][0] = $path;
+        $this->attachment[$cur][1] = $filename;
+        $this->attachment[$cur][2] = $name;
+        $this->attachment[$cur][3] = $encoding;
+        $this->attachment[$cur][4] = $type;
+        $this->attachment[$cur][5] = false; // isStringAttachment
+        $this->attachment[$cur][6] = "attachment";
+        $this->attachment[$cur][7] = 0;
+
+        return true;
+    }
+
+    /**
+     * Attaches all fs, string, and binary attachments to the message.
+     * Returns an empty string on failure.
+     * @access private
+     * @return string
+	 * @comment modified by KCS, you can call it to add only 'inline'/'attachment' attachments with a specific boundary
+     */
+    function AttachAll($type_to_add=false, $boundary=false) {
+        // Return text of body
+		if(!$boundary)
+				$boundary = $this->boundary[1];
+        $mime = array();
+
+        // Add all attachments
+        for($i = 0; $i < count($this->attachment); $i++)
+        {
+
+            $filename    = $this->attachment[$i][1];
+            $name        = $this->attachment[$i][2];
+            $encoding    = $this->attachment[$i][3];
+            $type        = $this->attachment[$i][4];
+            $disposition = $this->attachment[$i][6];
+            $cid         = $this->attachment[$i][7];
+
+			// nothing spec.
+			if($type_to_add!==false) {
+                // skip, not inline or not attachment desired to add
+	            if(0<>strcmp($type_to_add, $disposition))
+    	        	continue;
+            	}
+
+            // Check for string attachment
+            $bString = $this->attachment[$i][5];
+            if ($bString)
+                $string = $this->attachment[$i][0];
+            else
+                $path = $this->attachment[$i][0];
+
+            $mime[] = sprintf("--%s%s", $boundary, $this->LE);
+            $mime[] = sprintf("Content-Type: %s; name=\"%s\"%s", $type, $name, $this->LE);
+            $mime[] = sprintf("Content-Transfer-Encoding: %s%s", $encoding, $this->LE);
+
+            if($disposition == "inline")
+                $mime[] = sprintf("Content-ID: <%s>%s", $cid, $this->LE);
+
+            $mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s",
+                              $disposition, $name, $this->LE.$this->LE);
+
+            // Encode as string attachment
+            if($bString)
+            {
+                $mime[] = $this->EncodeString($string, $encoding);
+                if($this->IsError()) { return ""; }
+                $mime[] = $this->LE.$this->LE;
+            }
+            else
+            {
+                $mime[] = $this->EncodeFile($path, $encoding);
+                if($this->IsError()) { return ""; }
+                $mime[] = $this->LE.$this->LE;
+            }
+        }
+
+        $mime[] = sprintf("--%s--%s", $boundary, $this->LE);
+
+        return join("", $mime);
+    }
+
+    /**
+     * Encodes attachment in requested format.  Returns an
+     * empty string on failure.
+     * @access private
+     * @return string
+     */
+    function EncodeFile ($path, $encoding = "base64") {
+        if(!@$fd = fopen($path, "rb"))        {
+            $this->SetError($this->Lang("file_open") . $path);
+            return "";
+        }
+        $file_buffer = fread($fd, filesize($path));
+        $file_buffer = $this->EncodeString($file_buffer, $encoding);
+        fclose($fd);
+
+        return $file_buffer;
+    }
+
+    /**
+     * Encodes string to requested format. Returns an
+     * empty string on failure.
+     * @access private
+     * @return string
+     */
+    function EncodeString ($str, $encoding = "base64") {
+        $encoded = "";
+        switch(strtolower($encoding)) {
+          case "base64":
+              // chunk_split is found in PHP >= 3.0.6
+              $encoded = chunk_split(base64_encode($str), 76, $this->LE);
+              break;
+          case "7bit":
+          case "8bit":
+              $encoded = $this->FixEOL($str);
+              if (substr($encoded, -(strlen($this->LE))) != $this->LE)
+                $encoded .= $this->LE;
+              break;
+          case "binary":
+              $encoded = $str;
+              break;
+          case "quoted-printable":
+              $encoded = $this->EncodeQP($str);
+              break;
+          default:
+              $this->SetError($this->Lang("encoding") . $encoding);
+              break;
+        }
+        return $encoded;
+    }
+
+    /**
+     * Encode a header string to best of Q, B, quoted or none.
+     * @access private
+     * @return string
+     */
+    function EncodeHeader ($str, $position = 'text') {
+      $x = 0;
+
+      switch (strtolower($position)) {
+        case 'phrase':
+          if (!preg_match('/[\200-\377]/', $str)) {
+            // Can't use addslashes as we don't know what value has magic_quotes_sybase.
+            $encoded = addcslashes($str, "\0..\37\177\\\"");
+
+            if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str))
+              return ($encoded);
+            else
+              return ("\"$encoded\"");
+          }
+          $x = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches);
+          break;
+        case 'comment':
+          $x = preg_match_all('/[()"]/', $str, $matches);
+          // Fall-through
+        case 'text':
+        default:
+          $x += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches);
+          break;
+      }
+
+      if ($x == 0)
+        return ($str);
+
+      $maxlen = 75 - 7 - strlen($this->CharSet);
+      // Try to select the encoding which should produce the shortest output
+      if (strlen($str)/3 < $x) {
+        $encoding = 'B';
+        $encoded = base64_encode($str);
+        $maxlen -= $maxlen % 4;
+        $encoded = trim(chunk_split($encoded, $maxlen, "\n"));
+      } else {
+        $encoding = 'Q';
+        $encoded = $this->EncodeQ($str, $position);
+        $encoded = $this->WrapText($encoded, $maxlen, true);
+        $encoded = str_replace("=".$this->LE, "\n", trim($encoded));
+      }
+
+      $encoded = preg_replace('/^(.*)$/m', " =?".$this->CharSet."?$encoding?\\1?=", $encoded);
+      $encoded = trim(str_replace("\n", $this->LE, $encoded));
+
+      return $encoded;
+    }
+
+    /**
+     * Encode string to quoted-printable.
+     * @access private
+     * @return string
+     */
+    function EncodeQP ($str) {
+        $encoded = $this->FixEOL($str);
+        if (substr($encoded, -(strlen($this->LE))) != $this->LE)
+            $encoded .= $this->LE;
+
+        // Replace every high ascii, control and = characters
+        $encoded = preg_replace('/([\000-\010\013\014\016-\037\075\177-\377])/e',
+                  "'='.sprintf('%02X', ord('\\1'))", $encoded);
+        // Replace every spaces and tabs when it's the last character on a line
+        $encoded = preg_replace("/([\011\040])".$this->LE."/e",
+                  "'='.sprintf('%02X', ord('\\1')).'".$this->LE."'", $encoded);
+
+        // Maximum line length of 76 characters before CRLF (74 + space + '=')
+        $encoded = $this->WrapText($encoded, 74, true);
+
+        return $encoded;
+    }
+
+    /**
+     * Encode string to q encoding.
+     * @access private
+     * @return string
+     */
+    function EncodeQ ($str, $position = "text") {
+        // There should not be any EOL in the string
+        $encoded = preg_replace("[\r\n]", "", $str);
+
+        switch (strtolower($position)) {
+          case "phrase":
+            $encoded = preg_replace("/([^A-Za-z0-9!*+\/ -])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+            break;
+          case "comment":
+            $encoded = preg_replace("/([\(\)\"])/e", "'='.sprintf('%02X', ord('\\1'))", $encoded);
+          case "text":
+          default:
+            // Replace every high ascii, control =, ? and _ characters
+            $encoded = preg_replace('/([\000-\011\013\014\016-\037\075\077\137\177-\377])/e',
+                  "'='.sprintf('%02X', ord('\\1'))", $encoded);
+            break;
+        }
+
+        // Replace every spaces to _ (more readable than =20)
+        $encoded = str_replace(" ", "_", $encoded);
+
+        return $encoded;
+    }
+
+    /**
+     * Adds a string or binary attachment (non-filesystem) to the list.
+     * This method can be used to attach ascii or binary data,
+     * such as a BLOB record from a database.
+     * @param string $string String attachment data.
+     * @param string $filename Name of the attachment.
+     * @param string $encoding File encoding (see $Encoding).
+     * @param string $type File extension (MIME) type.
+     * @return void
+     */
+    function AddStringAttachment($string, $filename, $encoding = "base64",
+                                 $type = "application/octet-stream") {
+        // Append to $attachment array
+        $cur = count($this->attachment);
+        $this->attachment[$cur][0] = $string;
+        $this->attachment[$cur][1] = $filename;
+        $this->attachment[$cur][2] = $filename;
+        $this->attachment[$cur][3] = $encoding;
+        $this->attachment[$cur][4] = $type;
+        $this->attachment[$cur][5] = true; // isString
+        $this->attachment[$cur][6] = "attachment";
+        $this->attachment[$cur][7] = 0;
+    }
+
+    /**
+     * Adds an embedded attachment.  This can include images, sounds, and
+     * just about any other document.  Make sure to set the $type to an
+     * image type.  For JPEG images use "image/jpeg" and for GIF images
+     * use "image/gif".
+     * @param string $path Path to the attachment.
+     * @param string $cid Content ID of the attachment.  Use this to identify
+     *        the Id for accessing the image in an HTML form.
+     * @param string $name Overrides the attachment name.
+     * @param string $encoding File encoding (see $Encoding).
+     * @param string $type File extension (MIME) type.
+     * @return bool
+     */
+    function AddEmbeddedImage($path, $cid, $name = "", $encoding = "base64",
+                              $type = "application/octet-stream") {
+
+        if(!@is_file($path))        {
+            $this->SetError($this->Lang("file_access") . $path);
+            return false;
+        }
+
+        $filename = basename($path);
+        if($name == "")
+            $name = $filename;
+
+        // Append to $attachment array
+        $cur = count($this->attachment);
+        $this->attachment[$cur][0] = $path;
+        $this->attachment[$cur][1] = $filename;
+        $this->attachment[$cur][2] = $name;
+        $this->attachment[$cur][3] = $encoding;
+        $this->attachment[$cur][4] = $type;
+        $this->attachment[$cur][5] = false; // isStringAttachment
+        $this->attachment[$cur][6] = "inline";
+        $this->attachment[$cur][7] = $cid;
+
+        return true;
+    }
+
+    /**
+     * Returns true if an inline attachment is present.
+     * @access private
+     * @return bool
+     */
+    function InlineImageExists() {
+        $result = false;
+        for($i = 0; $i < count($this->attachment); $i++)
+        {
+            if($this->attachment[$i][6] == "inline")
+            {
+                $result = true;
+                break;
+            }
+        }
+
+        return $result;
+    }
+
+    /**
+     * Returns true if a normal attachment is present.
+     * @access private
+     * @return bool
+     * @comment modification added by KCS2004-04-30
+     */
+    function AttachmentNotInlineExists() {
+        $result = false;
+        for($i = 0; $i < count($this->attachment); $i++)
+        {
+            if($this->attachment[$i][6] == "attachment")
+            {
+                $result = true;
+                break;
+            }
+        }
+
+        return $result;
+    }
+
+
+    /////////////////////////////////////////////////
+    // MESSAGE RESET METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Clears all recipients assigned in the TO array.  Returns void.
+     * @return void
+     */
+    function ClearAddresses() {
+        $this->to = array();
+    }
+
+    /**
+     * Clears all recipients assigned in the CC array.  Returns void.
+     * @return void
+     */
+    function ClearCCs() {
+        $this->cc = array();
+    }
+
+    /**
+     * Clears all recipients assigned in the BCC array.  Returns void.
+     * @return void
+     */
+    function ClearBCCs() {
+        $this->bcc = array();
+    }
+
+    /**
+     * Clears all recipients assigned in the ReplyTo array.  Returns void.
+     * @return void
+     */
+    function ClearReplyTos() {
+        $this->ReplyTo = array();
+    }
+
+    /**
+     * Clears all recipients assigned in the TO, CC and BCC
+     * array.  Returns void.
+     * @return void
+     */
+    function ClearAllRecipients() {
+        $this->to = array();
+        $this->cc = array();
+        $this->bcc = array();
+    }
+
+    /**
+     * Clears all previously set filesystem, string, and binary
+     * attachments.  Returns void.
+     * @return void
+     */
+    function ClearAttachments() {
+        $this->attachment = array();
+    }
+
+    /**
+     * Clears all custom headers.  Returns void.
+     * @return void
+     */
+    function ClearCustomHeaders() {
+        $this->CustomHeader = array();
+    }
+
+
+    /////////////////////////////////////////////////
+    // MISCELLANEOUS METHODS
+    /////////////////////////////////////////////////
+
+    /**
+     * Adds the error message to the error container.
+     * Returns void.
+     * @access private
+     * @return void
+     */
+    function SetError($msg) {
+        $this->error_count++;
+        $this->ErrorInfo = $msg;
+    }
+
+    /**
+     * Returns the proper RFC 822 formatted date.
+     * @access private
+     * @return string
+     */
+    function RFCDate() {
+        $tz = date("Z");
+        $tzs = ($tz < 0) ? "-" : "+";
+        $tz = abs($tz);
+        $tz = ($tz/3600)*100 + ($tz%3600)/60;
+        $result = sprintf("%s %s%04d", date("D, j M Y H:i:s"), $tzs, $tz);
+
+        return $result;
+    }
+
+    /**
+     * Returns Received header for message tracing.
+     * @access private
+     * @return string
+     */
+    function Received() {
+        if ($this->ServerVar('SERVER_NAME') != '')
+        {
+            $protocol = ($this->ServerVar('HTTPS') == 'on') ? 'HTTPS' : 'HTTP';
+            $remote = $this->ServerVar('REMOTE_HOST');
+            if($remote == "")
+                $remote = 'phpmailer';
+            $remote .= ' (['.$this->ServerVar('REMOTE_ADDR').'])';
+        }
+        else
+        {
+            $protocol = 'local';
+            $remote = $this->ServerVar('USER');
+            if($remote == '')
+                $remote = 'phpmailer';
+        }
+
+        $result = sprintf("Received: from %s %s\tby %s " .
+                          "with %s (PHPMailer);%s\t%s%s", $remote, $this->LE,
+                          $this->ServerHostname(), $protocol, $this->LE,
+                          $this->RFCDate(), $this->LE);
+
+        return $result;
+    }
+
+    /**
+     * Returns the appropriate server variable.  Should work with both
+     * PHP 4.1.0+ as well as older versions.  Returns an empty string
+     * if nothing is found.
+     * @access private
+     * @return mixed
+     */
+    function ServerVar($varName) {
+        global $HTTP_SERVER_VARS;
+        global $HTTP_ENV_VARS;
+
+        if(!isset($_SERVER))        {
+            $_SERVER = $HTTP_SERVER_VARS;
+            if(!isset($_SERVER["REMOTE_ADDR"]))
+                $_SERVER = $HTTP_ENV_VARS; // must be Apache
+        }
+
+        if(isset($_SERVER[$varName]))
+            return $_SERVER[$varName];
+        else
+            return "";
+    }
+
+    /**
+     * Returns the server hostname or 'localhost.localdomain' if unknown.
+     * @access private
+     * @return string
+     */
+    function ServerHostname() {
+        if ($this->Hostname != "")
+            $result = $this->Hostname;
+        elseif ($this->ServerVar('SERVER_NAME') != "")
+            $result = $this->ServerVar('SERVER_NAME');
+        else
+            $result = "localhost.localdomain";
+
+        return $result;
+    }
+
+    /**
+     * Returns a message in the appropriate language.
+     * @access private
+     * @return string
+     */
+    function Lang($key) {
+        if(count($this->language) < 1)
+            $this->SetLanguage("en"); // set the default language
+
+        if(isset($this->language[$key]))
+            return $this->language[$key];
+        else
+            return "Language string failed to load: " . $key;
+    }
+
+    /**
+     * Returns true if an error occurred.
+     * @return bool
+     */
+    function IsError() {
+        return ($this->error_count > 0);
+    }
+
+    /**
+     * Changes every end of line from CR or LF to CRLF.
+     * @access private
+     * @return string
+     */
+    function FixEOL($str) {
+        $str = str_replace("\r\n", "\n", $str);
+        $str = str_replace("\r", "\n", $str);
+        $str = str_replace("\n", $this->LE, $str);
+        return $str;
+    }
+
+    /**
+     * Adds a custom header.
+     * @return void
+     */
+    function AddCustomHeader($custom_header) {
+        $this->CustomHeader[] = explode(":", $custom_header, 2);
+    }
+}
+
+?>
diff -ruN 6171/e107_handlers/phpmailer/class.smtp.php 75/e107_handlers/phpmailer/class.smtp.php
--- 6171/e107_handlers/phpmailer/class.smtp.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/phpmailer/class.smtp.php	2005-01-27 13:52:30.000000000 -0600
@@ -0,0 +1,1019 @@
+<?php
+////////////////////////////////////////////////////
+// SMTP - PHP SMTP class
+//
+// Version 1.02
+//
+// Define an SMTP class that can be used to connect
+// and communicate with any SMTP server. It implements
+// all the SMTP functions defined in RFC821 except TURN.
+//
+// Author: Chris Ryan
+//
+// License: LGPL, see LICENSE
+////////////////////////////////////////////////////
+	
+/**
+* SMTP is rfc 821 compliant and implements all the rfc 821 SMTP
+* commands except TURN which will always return a not implemented
+* error. SMTP also provides some utility methods for sending mail
+* to an SMTP server.
+* @package PHPMailer
+* @author Chris Ryan
+*/
+class SMTP {
+	/**
+	*  SMTP server port
+	*  @var int
+	*/
+	var $SMTP_PORT = 25;
+	 
+	/**
+	*  SMTP reply line ending
+	*  @var string
+	*/
+	var $CRLF = "\r\n";
+	 
+	/**
+	*  Sets whether debugging is turned on
+	*  @var bool
+	*/
+	var $do_debug;
+	# the level of debug to perform
+	 
+	/**#@+
+	* @access private
+	*/
+	var $smtp_conn;
+	# the socket to the server
+	var $error;
+	# error if any on the last call
+	var $helo_rply;
+	# the reply the server sent to us for HELO
+	/**#@-*/
+	 
+	/**
+	* Initialize the class so that the data is in a known state.
+	* @access public
+	* @return void
+	*/
+	function SMTP() {
+		$this->smtp_conn = 0;
+		$this->error = null;
+		$this->helo_rply = null;
+		 
+		$this->do_debug = 0;
+	}
+	 
+	/*************************************************************
+	*                    CONNECTION FUNCTIONS                  *
+	***********************************************************/
+	 
+	/**
+	* Connect to the server specified on the port specified.
+	* If the port is not specified use the default SMTP_PORT.
+	* If tval is specified then a connection will try and be
+	* established with the server for that number of seconds.
+	* If tval is not specified the default is 30 seconds to
+	* try on the connection.
+	*
+	* SMTP CODE SUCCESS: 220
+	* SMTP CODE FAILURE: 421
+	* @access public
+	* @return bool
+	*/
+	function Connect($host, $port = 0, $tval = 30) {
+		# set the error val to null so there is no confusion
+		$this->error = null;
+		 
+		# make sure we are __not__ connected
+		if ($this->connected()) {
+			# ok we are connected! what should we do?
+			# for now we will just give an error saying we
+			# are already connected
+			$this->error = array("error" => "Already connected to a server");
+			return false;
+		}
+		 
+		if (empty($port)) {
+			$port = $this->SMTP_PORT;
+		}
+		 
+		#connect to the smtp server
+		$this->smtp_conn = fsockopen($host, # the host of the server
+		$port, # the port to use
+		$errno, # error number if any
+		$errstr, # error message if any
+		$tval); # give up after ? secs
+		# verify we connected properly
+		if (empty($this->smtp_conn)) {
+			$this->error = array("error" => "Failed to connect to server",
+				"errno" => $errno,
+				"errstr" => $errstr);
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF;
+			}
+			return false;
+		}
+		 
+		# sometimes the SMTP server takes a little longer to respond
+		# so we will give it a longer timeout for the first read
+		// Windows still does not have support for this timeout function
+		if (substr(PHP_OS, 0, 3) != "WIN")
+		socket_set_timeout($this->smtp_conn, $tval, 0);
+		 
+		# get any announcement stuff
+		$announce = $this->get_lines();
+		 
+		# set the timeout  of any socket functions at 1/10 of a second
+		//if(function_exists("socket_set_timeout"))
+		//   socket_set_timeout($this->smtp_conn, 0, 100000);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $announce;
+		}
+		 
+		return true;
+	}
+	 
+	/**
+	* Performs SMTP authentication.  Must be run after running the
+	* Hello() method.  Returns true if successfully authenticated.
+	* @access public
+	* @return bool
+	*/
+	function Authenticate($username, $password) {
+		// Start authentication
+		fputs($this->smtp_conn, "AUTH LOGIN" . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($code != 334) {
+			$this->error = array("error" => "AUTH not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		 
+		// Send encoded username
+		fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($code != 334) {
+			$this->error = array("error" => "Username not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		 
+		// Send encoded password
+		fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($code != 235) {
+			$this->error = array("error" => "Password not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		 
+		return true;
+	}
+	 
+	/**
+	* Returns true if connected to a server otherwise false
+	* @access private
+	* @return bool
+	*/
+	function Connected() {
+		if (!empty($this->smtp_conn)) {
+			$sock_status = socket_get_status($this->smtp_conn);
+			if ($sock_status["eof"]) {
+				# hmm this is an odd situation... the socket is
+				# valid but we aren't connected anymore
+				if ($this->do_debug >= 1) {
+					echo "SMTP->NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
+				}
+				$this->Close();
+				return false;
+			}
+			return true;
+			# everything looks good
+		}
+		return false;
+	}
+	 
+	/**
+	* Closes the socket and cleans up the state of the class.
+	* It is not considered good to use this function without
+	* first trying to use QUIT.
+	* @access public
+	* @return void
+	*/
+	function Close() {
+		$this->error = null;
+		# so there is no confusion
+		$this->helo_rply = null;
+		if (!empty($this->smtp_conn)) {
+			# close the connection and cleanup
+			fclose($this->smtp_conn);
+			$this->smtp_conn = 0;
+		}
+	}
+	 
+	 
+	/***************************************************************
+	*                        SMTP COMMANDS                       *
+	*************************************************************/
+	 
+	/**
+	* Issues a data command and sends the msg_data to the server
+	* finializing the mail transaction. $msg_data is the message
+	* that is to be send with the headers. Each header needs to be
+	* on a single line followed by a <CRLF> with the message headers
+	* and the message body being seperated by and additional <CRLF>.
+	*
+	* Implements rfc 821: DATA <CRLF>
+	*
+	* SMTP CODE INTERMEDIATE: 354
+	*     [data]
+	*     <CRLF>.<CRLF>
+	*     SMTP CODE SUCCESS: 250
+	*     SMTP CODE FAILURE: 552,554,451,452
+	* SMTP CODE FAILURE: 451,554
+	* SMTP CODE ERROR  : 500,501,503,421
+	* @access public
+	* @return bool
+	*/
+	function Data($msg_data) {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Data() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "DATA" . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 354) {
+			$this->error = array("error" => "DATA command not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		 
+		# the server is ready to accept data!
+		# according to rfc 821 we should not send more than 1000
+		# including the CRLF
+		# characters on a single line so we will break the data up
+		# into lines by \r and/or \n then if needed we will break
+		# each of those into smaller lines to fit within the limit.
+		# in addition we will be looking for lines that start with
+		# a period '.' and append and additional period '.' to that
+		# line. NOTE: this does not count towards are limit.
+		 
+		# normalize the line breaks so we know the explode works
+		$msg_data = str_replace("\r\n", "\n", $msg_data);
+		$msg_data = str_replace("\r", "\n", $msg_data);
+		$lines = explode("\n", $msg_data);
+		 
+		# we need to find a good way to determine is headers are
+		# in the msg_data or if it is a straight msg body
+		# currently I'm assuming rfc 822 definitions of msg headers
+		# and if the first field of the first line (':' sperated)
+		# does not contain a space then it _should_ be a header
+		# and we can process all lines before a blank "" line as
+		# headers.
+		$field = substr($lines[0], 0, strpos($lines[0], ":"));
+		$in_headers = false;
+		if (!empty($field) && !strstr($field, " ")) {
+			$in_headers = true;
+		}
+		 
+		$max_line_length = 998;
+		# used below; set here for ease in change
+		 
+		while (list(, $line) = @each($lines)) {
+			$lines_out = null;
+			if ($line == "" && $in_headers) {
+				$in_headers = false;
+			}
+			# ok we need to break this line up into several
+			# smaller lines
+			while (strlen($line) > $max_line_length) {
+				$pos = strrpos(substr($line, 0, $max_line_length), " ");
+				$lines_out[] = substr($line, 0, $pos);
+				$line = substr($line, $pos + 1);
+				# if we are processing headers we need to
+				# add a LWSP-char to the front of the new line
+				# rfc 822 on long msg headers
+				if ($in_headers) {
+					$line = "\t" . $line;
+				}
+			}
+			$lines_out[] = $line;
+			 
+			# now send the lines to the server
+			while (list(, $line_out) = @each($lines_out)) {
+				if (strlen($line_out) > 0) {
+					if (substr($line_out, 0, 1) == ".") {
+						$line_out = "." . $line_out;
+					}
+				}
+				fputs($this->smtp_conn, $line_out . $this->CRLF);
+			}
+		}
+		 
+		# ok all the message data has been sent so lets get this
+		# over with aleady
+		fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250) {
+			$this->error = array("error" => "DATA not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		return true;
+	}
+	 
+	/**
+	* Expand takes the name and asks the server to list all the
+	* people who are members of the _list_. Expand will return
+	* back and array of the result or false if an error occurs.
+	* Each value in the array returned has the format of:
+	*     [ <full-name> <sp> ] <path>
+	* The definition of <path> is defined in rfc 821
+	*
+	* Implements rfc 821: EXPN <SP> <string> <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250
+	* SMTP CODE FAILURE: 550
+	* SMTP CODE ERROR  : 500,501,502,504,421
+	* @access public
+	* @return string array
+	*/
+	function Expand($name) {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Expand() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "EXPN " . $name . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250) {
+			$this->error = array("error" => "EXPN not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		 
+		# parse the reply and place in our array to return to user
+		$entries = explode($this->CRLF, $rply);
+		while (list(, $l) = @each($entries)) {
+			$list[] = substr($l, 4);
+		}
+		 
+		return $list;
+	}
+	 
+	/**
+	* Sends the HELO command to the smtp server.
+	* This makes sure that we and the server are in
+	* the same known state.
+	*
+	* Implements from rfc 821: HELO <SP> <domain> <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250
+	* SMTP CODE ERROR  : 500, 501, 504, 421
+	* @access public
+	* @return bool
+	*/
+	function Hello($host = "") {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Hello() without being connected");
+			return false;
+		}
+		 
+		# if a hostname for the HELO wasn't specified determine
+		# a suitable one to send
+		if (empty($host)) {
+			# we need to determine some sort of appopiate default
+			# to send to the server
+			$host = "localhost";
+		}
+		 
+		// Send extended hello first (RFC 2821)
+		if (!$this->SendHello("EHLO", $host)) {
+			if (!$this->SendHello("HELO", $host))
+			return false;
+		}
+		 
+		return true;
+	}
+	 
+	/**
+	* Sends a HELO/EHLO command.
+	* @access private
+	* @return bool
+	*/
+	function SendHello($hello, $host) {
+		fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER: " . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250) {
+			$this->error = array("error" => $hello . " not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		 
+		$this->helo_rply = $rply;
+		 
+		return true;
+	}
+	 
+	/**
+	* Gets help information on the keyword specified. If the keyword
+	* is not specified then returns generic help, ussually contianing
+	* A list of keywords that help is available on. This function
+	* returns the results back to the user. It is up to the user to
+	* handle the returned data. If an error occurs then false is
+	* returned with $this->error set appropiately.
+	*
+	* Implements rfc 821: HELP [ <SP> <string> ] <CRLF>
+	*
+	* SMTP CODE SUCCESS: 211,214
+	* SMTP CODE ERROR  : 500,501,502,504,421
+	* @access public
+	* @return string
+	*/
+	function Help($keyword = "") {
+		$this->error = null;
+		# to avoid confusion
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Help() without being connected");
+			return false;
+		}
+		 
+		$extra = "";
+		if (!empty($keyword)) {
+			$extra = " " . $keyword;
+		}
+		 
+		fputs($this->smtp_conn, "HELP" . $extra . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 211 && $code != 214) {
+			$this->error = array("error" => "HELP not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		 
+		return $rply;
+	}
+	 
+	/**
+	* Starts a mail transaction from the email address specified in
+	* $from. Returns true if successful or false otherwise. If True
+	* the mail transaction is started and then one or more Recipient
+	* commands may be called followed by a Data command.
+	*
+	* Implements rfc 821: MAIL <SP> FROM:<reverse-path> <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250
+	* SMTP CODE SUCCESS: 552,451,452
+	* SMTP CODE SUCCESS: 500,501,421
+	* @access public
+	* @return bool
+	*/
+	function Mail($from) {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Mail() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "MAIL FROM:<" . $from . ">" . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250) {
+			$this->error = array("error" => "MAIL not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		return true;
+	}
+	 
+	/**
+	* Sends the command NOOP to the SMTP server.
+	*
+	* Implements from rfc 821: NOOP <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250
+	* SMTP CODE ERROR  : 500, 421
+	* @access public
+	* @return bool
+	*/
+	function Noop() {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Noop() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "NOOP" . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250) {
+			$this->error = array("error" => "NOOP not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		return true;
+	}
+	 
+	/**
+	* Sends the quit command to the server and then closes the socket
+	* if there is no error or the $close_on_error argument is true.
+	*
+	* Implements from rfc 821: QUIT <CRLF>
+	*
+	* SMTP CODE SUCCESS: 221
+	* SMTP CODE ERROR  : 500
+	* @access public
+	* @return bool
+	*/
+	function Quit($close_on_error = true) {
+		$this->error = null;
+		# so there is no confusion
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Quit() without being connected");
+			return false;
+		}
+		 
+		# send the quit command to the server
+		fputs($this->smtp_conn, "quit" . $this->CRLF);
+		 
+		# get any good-bye messages
+		$byemsg = $this->get_lines();
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $byemsg;
+		}
+		 
+		$rval = true;
+		$e = null;
+		 
+		$code = substr($byemsg, 0, 3);
+		if ($code != 221) {
+			# use e as a tmp var cause Close will overwrite $this->error
+			$e = array("error" => "SMTP server rejected quit command",
+				"smtp_code" => $code,
+				"smtp_rply" => substr($byemsg, 4));
+			$rval = false;
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF;
+			}
+		}
+		 
+		if (empty($e) || $close_on_error) {
+			$this->Close();
+		}
+		 
+		return $rval;
+	}
+	 
+	/**
+	* Sends the command RCPT to the SMTP server with the TO: argument of $to.
+	* Returns true if the recipient was accepted false if it was rejected.
+	*
+	* Implements from rfc 821: RCPT <SP> TO:<forward-path> <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250,251
+	* SMTP CODE FAILURE: 550,551,552,553,450,451,452
+	* SMTP CODE ERROR  : 500,501,503,421
+	* @access public
+	* @return bool
+	*/
+	function Recipient($to) {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Recipient() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "RCPT TO:<" . $to . ">" . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250 && $code != 251) {
+			$this->error = array("error" => "RCPT not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		return true;
+	}
+	 
+	/**
+	* Sends the RSET command to abort and transaction that is
+	* currently in progress. Returns true if successful false
+	* otherwise.
+	*
+	* Implements rfc 821: RSET <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250
+	* SMTP CODE ERROR  : 500,501,504,421
+	* @access public
+	* @return bool
+	*/
+	function Reset() {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Reset() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "RSET" . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250) {
+			$this->error = array("error" => "RSET failed",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		 
+		return true;
+	}
+	 
+	/**
+	* Starts a mail transaction from the email address specified in
+	* $from. Returns true if successful or false otherwise. If True
+	* the mail transaction is started and then one or more Recipient
+	* commands may be called followed by a Data command. This command
+	* will send the message to the users terminal if they are logged
+	* in.
+	*
+	* Implements rfc 821: SEND <SP> FROM:<reverse-path> <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250
+	* SMTP CODE SUCCESS: 552,451,452
+	* SMTP CODE SUCCESS: 500,501,502,421
+	* @access public
+	* @return bool
+	*/
+	function Send($from) {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Send() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "SEND FROM:" . $from . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250) {
+			$this->error = array("error" => "SEND not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		return true;
+	}
+	 
+	/**
+	* Starts a mail transaction from the email address specified in
+	* $from. Returns true if successful or false otherwise. If True
+	* the mail transaction is started and then one or more Recipient
+	* commands may be called followed by a Data command. This command
+	* will send the message to the users terminal if they are logged
+	* in and send them an email.
+	*
+	* Implements rfc 821: SAML <SP> FROM:<reverse-path> <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250
+	* SMTP CODE SUCCESS: 552,451,452
+	* SMTP CODE SUCCESS: 500,501,502,421
+	* @access public
+	* @return bool
+	*/
+	function SendAndMail($from) {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called SendAndMail() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "SAML FROM:" . $from . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250) {
+			$this->error = array("error" => "SAML not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		return true;
+	}
+	 
+	/**
+	* Starts a mail transaction from the email address specified in
+	* $from. Returns true if successful or false otherwise. If True
+	* the mail transaction is started and then one or more Recipient
+	* commands may be called followed by a Data command. This command
+	* will send the message to the users terminal if they are logged
+	* in or mail it to them if they are not.
+	*
+	* Implements rfc 821: SOML <SP> FROM:<reverse-path> <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250
+	* SMTP CODE SUCCESS: 552,451,452
+	* SMTP CODE SUCCESS: 500,501,502,421
+	* @access public
+	* @return bool
+	*/
+	function SendOrMail($from) {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called SendOrMail() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "SOML FROM:" . $from . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250) {
+			$this->error = array("error" => "SOML not accepted from server",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		return true;
+	}
+	 
+	/**
+	* This is an optional command for SMTP that this class does not
+	* support. This method is here to make the RFC821 Definition
+	* complete for this class and __may__ be implimented in the future
+	*
+	* Implements from rfc 821: TURN <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250
+	* SMTP CODE FAILURE: 502
+	* SMTP CODE ERROR  : 500, 503
+	* @access public
+	* @return bool
+	*/
+	function Turn() {
+		$this->error = array("error" => "This method, TURN, of the SMTP ". "is not implemented");
+		if ($this->do_debug >= 1) {
+			echo "SMTP->NOTICE: " . $this->error["error"] . $this->CRLF;
+		}
+		return false;
+	}
+	 
+	/**
+	* Verifies that the name is recognized by the server.
+	* Returns false if the name could not be verified otherwise
+	* the response from the server is returned.
+	*
+	* Implements rfc 821: VRFY <SP> <string> <CRLF>
+	*
+	* SMTP CODE SUCCESS: 250,251
+	* SMTP CODE FAILURE: 550,551,553
+	* SMTP CODE ERROR  : 500,501,502,421
+	* @access public
+	* @return int
+	*/
+	function Verify($name) {
+		$this->error = null;
+		# so no confusion is caused
+		 
+		if (!$this->connected()) {
+			$this->error = array(
+			"error" => "Called Verify() without being connected");
+			return false;
+		}
+		 
+		fputs($this->smtp_conn, "VRFY " . $name . $this->CRLF);
+		 
+		$rply = $this->get_lines();
+		$code = substr($rply, 0, 3);
+		 
+		if ($this->do_debug >= 2) {
+			echo "SMTP->FROM SERVER:" . $this->CRLF . $rply;
+		}
+		 
+		if ($code != 250 && $code != 251) {
+			$this->error = array("error" => "VRFY failed on name '$name'",
+				"smtp_code" => $code,
+				"smtp_msg" => substr($rply, 4));
+			if ($this->do_debug >= 1) {
+				echo "SMTP->ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF;
+			}
+			return false;
+		}
+		return $rply;
+	}
+	 
+	/*******************************************************************
+	*                       INTERNAL FUNCTIONS                       *
+	******************************************************************/
+	 
+	/**
+	* Read in as many lines as possible
+	* either before eof or socket timeout occurs on the operation.
+	* With SMTP we can tell if we have more lines to read if the
+	* 4th character is '-' symbol. If it is a space then we don't
+	* need to read anything else.
+	* @access private
+	* @return string
+	*/
+	function get_lines() {
+		$data = "";
+		while ($str = fgets($this->smtp_conn, 515)) {
+			if ($this->do_debug >= 4) {
+				echo "SMTP->get_lines(): \$data was \"$data\"" . $this->CRLF;
+				echo "SMTP->get_lines(): \$str is \"$str\"" . $this->CRLF;
+			}
+			$data .= $str;
+			if ($this->do_debug >= 4) {
+				echo "SMTP->get_lines(): \$data is \"$data\"" . $this->CRLF;
+			}
+			# if the 4th character is a space then we are done reading
+			# so just break the loop
+			if (substr($str, 3, 1) == " ") {
+				break;
+			}
+		}
+		return $data;
+	}
+	 
+}
+	
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/phpmailer/e107.htaccess 75/e107_handlers/phpmailer/e107.htaccess
--- 6171/e107_handlers/phpmailer/e107.htaccess	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/phpmailer/e107.htaccess	2005-09-23 14:32:34.000000000 -0500
@@ -0,0 +1 @@
+mod_gzip_on Off
\ No newline at end of file
diff -ruN 6171/e107_handlers/phpmailer/language/phpmailer.lang-en.php 75/e107_handlers/phpmailer/language/phpmailer.lang-en.php
--- 6171/e107_handlers/phpmailer/language/phpmailer.lang-en.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/phpmailer/language/phpmailer.lang-en.php	2005-01-27 13:52:30.000000000 -0600
@@ -0,0 +1,21 @@
+<?php
+/**
+* PHPMailer language file.
+* English Version
+*/
+	
+$PHPMAILER_LANG = array();
+	
+$PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' . 'recipient email address.';
+$PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
+$PHPMAILER_LANG["execute"] = 'Could not execute: ';
+$PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';
+$PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';
+$PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';
+$PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' . 'recipients failed: ';
+$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';
+$PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';
+$PHPMAILER_LANG["file_access"] = 'Could not access file: ';
+$PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';
+$PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/phpmailer/mailout_process.php 75/e107_handlers/phpmailer/mailout_process.php
--- 6171/e107_handlers/phpmailer/mailout_process.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/phpmailer/mailout_process.php	2006-05-12 17:50:40.000000000 -0500
@@ -0,0 +1,337 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ©Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/phpmailer/mailout_process.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/05/12 22:50:40 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if(!getperms("W")){ header("location:".e_BASE."index.php"); }
+
+$HEADER = "";
+$FOOTER = "";
+define("e_PAGETITLE","Mailing...");
+require_once(HEADERF);
+set_time_limit(18000);
+session_write_close();
+
+
+if($_POST['cancel_emails']){
+	$sql -> db_Delete("generic", "gen_datestamp='".intval($_POST['mail_id'])."' ");
+
+    $text = "<div style='text-align:center;width:220px'><br />Cancelled Successfully";
+    $text .= "<div style='text-align:center;margin-left:auto;margin-right:auto;position:absolute;left:10px;top:110px'>
+	<br /><input type='button' class='button' name='close' value='Close' onclick=\"window.close()\" />
+     </div></div>";
+
+    $ns -> tablerender("Mailing Progress", $text);
+	echo "</body></html>";
+
+	exit;
+}
+
+    ob_implicit_flush();
+/*
+	if (ob_get_level() == 0) {
+	   ob_start();
+	 }
+*/
+
+// -------------------- Configure PHP Mailer ------------------------------>
+
+	require(e_HANDLER."phpmailer/class.phpmailer.php");
+
+	$mail = new PHPMailer();
+
+	$mail->From = ($_POST['email_from_email'])? $_POST['email_from_email']:	$pref['siteadminemail'];
+	$mail->FromName = ($_POST['email_from_name'])? $_POST['email_from_name']: $pref['siteadmin'];
+	//  $mail->Host     = "smtp1.site.com;smtp2.site.com";
+	if ($pref['mailer']== 'smtp') {
+		$mail->Mailer = "smtp";
+		$mail->SMTPKeepAlive = TRUE;
+		$mail->Host = $pref['smtp_server'];
+		if($pref['smtp_username'] && $pref['smtp_password']){
+			$mail->SMTPAuth = TRUE;
+			$mail->Username = $pref['smtp_username'];
+			$mail->Password = $pref['smtp_password'];
+			$mail->PluginDir = e_HANDLER."phpmailer/";
+        }
+    } elseif ($pref['mailer']== 'sendmail'){
+		$mail->Mailer = "sendmail";
+		$mail->Sendmail = ($pref['sendmail']) ? $pref['sendmail'] : "/usr/sbin/sendmail -t -i -r ".$pref['siteadminemail'];
+	} else {
+        $mail->Mailer = "mail";
+	}
+
+	$mail->AddCC = ($_POST['email_cc']);
+	$mail->WordWrap = 50;
+	$mail->Charset = CHARSET;
+	$mail->Subject = $_POST['email_subject'];
+	$mail->IsHTML(TRUE);
+	$mail->SMTPDebug = False;
+
+	if($_POST['email_cc']){
+        $tmp = explode(",",$_POST['email_cc']);
+		foreach($tmp as $addc){
+			$mail->AddCC($addc);
+        }
+	}
+
+	if($_POST['email_bcc']){
+        $tmp = explode(",",$_POST['email_bcc']);
+		foreach($tmp as $addbc){
+			$mail->AddBCC($addbc);
+        }
+	}
+
+	if($pref['mail_bounce_email'] !=''){
+		$mail->Sender = $pref['mail_bounce_email'];
+	}
+
+	$attach = chop($_POST['email_attachment']);
+
+	if(is_readable(e_DOWNLOAD.$attach))	{
+		$attach_link = e_DOWNLOAD.$attach;
+	}else{
+		$attach_link = e_FILE.'public/'.$attach;
+	}
+
+	if ($attach != "" && !$mail->AddAttachment($attach_link, $attach)){
+		$mss = "There is a problem with the attachment<br />$attach_link";
+		$ns->tablerender("Error", $mss);
+		require_once(e_ADMIN."footer.php");
+		exit;
+	}
+
+
+
+// ---------------------------- Setup the Email ----------------------------->
+
+
+	$message_subject = stripslashes($tp -> toHTML($_POST['email_subject']));
+
+	$mail_head = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
+	$mail_head .= "<html xmlns='http://www.w3.org/1999/xhtml' >\n";
+	$mail_head .= "<head><meta http-equiv='content-type' content='text/html; charset=utf-8' />\n";
+
+	if (isset($_POST['use_theme'])) {
+		$theme = $THEMES_DIRECTORY.$pref['sitetheme']."/";
+   	//	$mail_head .= "<link rel=\"stylesheet\" href=\"".SITEURL.$theme."style.css\" type=\"text/css\" />\n";
+        $style_css = file_get_contents(e_THEME.$pref['sitetheme']."/style.css");
+      	$mail_head .= "<style>\n".$style_css."\n</style>";
+
+		$message_body = $mail_head;
+		$message_body .= "</head>\n<body>\n";
+		$message_body .= "<div style='padding:10px;width:97%'><div class='forumheader3'>\n";
+		$message_body .= $tp -> toHTML($_POST['email_body'],TRUE)."</div></div></body></html>";
+	}else{
+		$message_body = $mail_head;
+		$message_body .= "</head>\n<body>\n";
+		$message_body .= $tp -> toHTML($_POST['email_body'],TRUE)."</body></html>";
+		$message_body = str_replace("&quot;", '"', $message_body);
+		$message_body = str_replace('src="', 'src="'.SITEURL, $message_body);
+    }
+
+	$message_body = stripslashes($message_body);
+
+
+
+// ----------------  Display Progress and Send Emails. ----------------------->
+
+
+    echo "<div class='fcaption'>&nbsp;Mailing Progress</div>";
+    $qry = "SELECT g.*,u.* FROM #generic AS g LEFT JOIN #user AS u ON g.gen_user_id = u.user_id WHERE g.gen_type='sendmail' and g.gen_datestamp = '".intval($_POST['mail_id'])."' ";
+    $count = $sql -> db_Select_gen($qry);
+
+	if(!$count){
+		echo "<div style='text-align:center;width:200px'><br />There are no remaining emails to be sent.</div>";
+		echo "</body></html>";
+        echo "<div style='text-align:center;margin-left:auto;margin-right:auto;position:absolute;left:10px;top:110px'>
+			<input type='button' class='button' name='close' value='Close' onclick=\"window.close()\" />
+    		 </div>";
+		exit;
+	}
+
+
+	$c = 0; $d=0;
+	$pause_count = 1;
+	$pause_amount = ($pref['mail_pause']) ? $pref['mail_pause'] : 10;
+	$pause_time = ($pref['mail_pausetime']) ? $pref['mail_pausetime'] : 1;
+	$sent = array();
+	$failed = array();
+	$unit = (1/$count)* 100;
+	echo "<div class='blocks' style='text-align:left;width:199px'><div id='bar' class='bar' style='border:0px;;width:".$cur."%' >&nbsp;</div></div>";
+
+	stopwatch();
+
+    while($row = $sql-> db_Fetch()){
+
+
+// ---------------------- Mailing Part. -------------------------------------->
+
+		$activator = (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$row['user_id'].".".$row['user_sess'] : SITEURL."/signup.php?activate.".$row['user_id'].".".$row['user_sess']);
+        $signup_link = ($row['user_sess']) ? "<a href='$activator'>$activator</a>" : "";
+
+		$search = array("{USERNAME}","{USERID}","{SIGNUP_LINK}");
+		$replace = array($row['user_name'],$row['user_id'],$signup_link);
+
+        $mes_body = str_replace($search,$replace,$message_body);
+		$alt_body = str_replace($search,$replace,stripslashes($tp->toText($_POST['email_body'])));
+
+		$mail->Body = $mes_body;
+		$mail->AltBody = $alt_body;
+
+		$mail->AddAddress($row['user_email'], $row['user_name']);
+        $mail->AddCustomHeader("X-e107-id: ".$row['user_id']);
+
+
+		if ($mail->Send()) {
+			$sent[] = $row['user_id'];
+		} else {
+			$failed[] = $row['user_id'];
+		}
+
+		$mail->ClearAddresses();
+
+
+// --------- End of the mailing. --------------------------------------------->
+
+		$cur = round((($c / $count) * 100) + $unit);
+		echo str_pad(' ',4096)."<br />\n";
+
+		$d = ($c==0) ? 10 : round($width + $d);
+
+		echo "<div class='percents'>".($c+1)." / ".$count." (" . $cur . "%) &nbsp;complete</div>";
+
+		if($cur != $prev){
+			echo "<script type='text/javascript'>inc('".$cur."%');</script>\n";
+		}
+        $prev = $cur;
+		ob_flush();
+		flush();
+
+		if($pause_count > $pause_amount){
+			sleep($pause_time);
+            $pause_count = 1;
+        }
+
+		// Default sleep to reduce server-load: 1 second.
+		sleep(1);
+
+		$c++;
+		$pause_count++;
+	}
+	ob_end_flush();
+
+	echo "<div style='position:absolute;left:10px;top:50px'><br />";
+	echo count($sent)." emails were sent.<br />";
+	echo count($failed)." emails failed.<br />";
+	echo "Total time elapsed: ".stopwatch()." seconds<br />";
+	echo "</div>";
+
+	$message = $sql -> db_Delete("generic", "gen_datestamp='".intval($_POST['mail_id'])."' ") ? "deleted" : "deleted_failed";
+
+	$mail->ClearAttachments();
+	if ($pref['mailer']== 'smtp') {
+			$mail->SmtpClose();
+	}
+
+echo "<div style='text-align:center;margin-left:auto;margin-right:auto;position:absolute;left:10px;top:110px'>
+	<br /><input type='button' class='button' name='close' value='Close' onclick=\"window.close()\" />
+     </div>";
+echo "</body></html>";
+
+
+
+
+
+
+function headerjs(){
+    $text = "
+	<style type='text/css'><!--
+	div.percents div.blocks img.blocks{
+	margin: 1px;
+	height: 20px;
+	padding: 1px;
+	border: 1px solid #000;
+	width: 199px;
+	background: #fff;
+	color: #000;
+	float: left;
+	clear: right;
+	z-index: 9;
+	position:relative;
+	}
+	.percents {
+	background: #FFF;
+	border: 1px solid #CCC;
+	margin: 1px;
+	height: 20px;
+	position:absolute;
+	vertical-align:middle;
+	width:199px;
+	z-index:10;
+	left: 10px;
+	top: 38px;
+	text-align: center;
+	color:black;
+	}
+	.blocks {
+
+	margin-top: 1px;
+	height: 21px;
+	position: absolute;
+	z-index:11;
+	left: 12px;
+	top: 38px;
+
+	}
+
+	.bar {
+	background: #EEE;
+	background-color:red;
+	filter: alpha(opacity=50);
+	height:21px;
+	-moz-opacity: 0.5;
+	opacity: 0.5;
+	-khtml-opacity: .5
+	}
+	-->
+	</style>";
+
+$text .= "
+	<script type='text/javascript'>
+	function inc(amount){
+		document.getElementById('bar').style.width= amount;
+	}
+</script>";
+
+	return $text;
+}
+
+
+function stopwatch(){
+  static $mt_previous = 0;
+  list($usec, $sec) = explode(" ",microtime());
+  $mt_current = (float)$usec + (float)$sec;
+  if (!$mt_previous) {
+     $mt_previous = $mt_current;
+     return "";
+  } else {
+     $mt_diff = ($mt_current - $mt_previous);
+     $mt_previous = $mt_current;
+     return round(sprintf('%.16f',$mt_diff),2);
+  }
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/plugin_class.php 75/e107_handlers/plugin_class.php
--- 6171/e107_handlers/plugin_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/plugin_class.php	2006-03-19 17:43:28.000000000 -0600
@@ -0,0 +1,468 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/plugin_class.php,v $
+|     $Revision: 1.41 $
+|     $Date: 2006/03/19 23:43:28 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e107plugin
+{
+
+	/**
+	 * Returns an array containing details of all plugins in the plugin table - should noramlly use e107plugin::update_plugins_table() first to make sure the table is up to date.
+	 *
+	 * @return array plugin details
+	 */
+	function getall($flag)
+	{
+		global $sql;
+		if ($sql->db_Select("plugin","*","plugin_installflag = '".intval($flag)."' ORDER BY plugin_name ASC"))
+		{
+			$ret = $sql->db_getList();
+ 		}
+		return ($ret) ? $ret : FALSE;
+	}
+
+	/**
+	 * Check for new plugins, create entry in plugin table and remove deleted plugins
+	 *
+	 */
+	function update_plugins_table() {
+		global $sql, $mySQLprefix, $menu_pref, $tp;
+
+		require_once(e_HANDLER.'file_class.php');
+
+		$fl = new e_file;
+		$pluginList = $fl->get_files(e_PLUGIN, "^plugin\.php$", "standard", 1);
+
+		foreach($pluginList as $p)
+		{
+			foreach($defined_vars as $varname) {
+				if (substr($varname, 0, 6) == 'eplug_' || substr($varname, 0, 8) == 'upgrade_') {
+					unset($$varname);
+				}
+			}
+
+		 	include_once("{$p['path']}{$p['fname']}");
+			$plugin_path = substr(str_replace(e_PLUGIN,"",$p['path']),0,-1);
+			if ((!$sql->db_Select("plugin", "plugin_id", "plugin_path = '".$tp -> toDB($plugin_path, true)."'")) && $eplug_name){
+				if (!$eplug_link_url && !$eplug_link && !$eplug_prefs && !$eplug_table_names && !$eplug_user_prefs && !$eplug_sc && !$eplug_userclass && !$eplug_module && !$eplug_bb && !$eplug_latest && !$eplug_status){
+					if(is_array($eplug_rss)){
+                    	foreach($eplug_rss as $key=>$val){
+                        	$feeds[] = $key;
+						}
+						$plugin_rss = implode(",",$feeds);
+					}
+					// new plugin, assign entry in plugin table, install is not necessary so mark it as intalled
+					$sql->db_Insert("plugin", "0, '".$tp -> toDB($eplug_name, true)."', '".$tp -> toDB($eplug_version, true)."', '".$tp -> toDB($eplug_folder, true)."', 1, '".$tp -> toDB($plugin_rss, true)."' ");
+				}
+				else
+				{
+					// new plugin, assign entry in plugin table, install is necessary
+					$sql->db_Insert("plugin", "0, '".$tp -> toDB($eplug_name, true)."', '".$tp -> toDB($eplug_version, true)."', '".$tp -> toDB($eplug_folder, true)."', 0, '' ");
+				}
+			}
+		}
+
+		$sql->db_Select("plugin");
+		while ($row = $sql->db_fetch()) {
+			if (!is_dir(e_PLUGIN.$row['plugin_path'])) {
+				$sql->db_Delete('plugin', "plugin_path = '{$row['plugin_path']}'");
+			}
+		}
+	}
+
+	/**
+	 * Returns deatils of a plugin from the plugin table from it's ID
+	 *
+	 * @param int $id
+	 * @return array plugin info
+	 */
+	function getinfo($id) {
+		global $sql;
+		$id = intval($id);
+		if ($sql->db_Select('plugin', '*', "plugin_id = {$id}")) {
+			return $sql->db_Fetch();
+		}
+	}
+
+	function manage_userclass($action, $class_name, $class_description) {
+		global $sql, $tp;
+		$class_name = $tp -> toDB($class_name, true);
+		$class_description = $tp -> toDB($class_description, true);
+		if ($action == 'add') {
+			$i = 1;
+			while ($sql->db_Select('userclass_classes', '*', "userclass_id='{$i}' ") && $i < e_UC_READONLY) {
+				$i++;
+			}
+			if ($i < e_UC_READONLY) {
+				return $sql->db_Insert('userclass_classes', "{$i},'".strip_tags(strtoupper($class_name))."', '{$class_description}' ,".e_UC_PUBLIC);
+			} else {
+				return FALSE;
+			}
+		}
+		if ($action == 'remove') {
+			if ($sql->db_Select('userclass_classes', 'userclass_id', "userclass_name = '{$class_name}'")) {
+				$row = $sql->db_Fetch();
+				$class_id = $row['userclass_id'];
+				if ($sql->db_Delete('userclass_classes', "userclass_id = '{$class_id}'")) {
+					if ($sql->db_Select('user', 'user_id, user_class', "user_class REGEXP('^{$class_id}\.') OR user_class REGEXP('\.{$class_id}\.') OR user_class REGEXP('\.{$class_id}$')")) {
+						$sql2 = new db;
+						while ($row = $sql->db_Fetch()) {
+							$classes = explode(".", $row['user_class']);
+							unset($classes[$class_id]);
+							foreach($classes as $k => $v) {
+								if ($v = '') {
+									unset($classes[$k]);
+								}
+							}
+							$newclass = '.'.implode('.', $classes).'.';
+							$sql2->db_Update('user', "user_class = '{$newclass}' WHERE user_id = '{$row['user_id']}");
+						}
+					}
+				}
+			}
+		}
+	}
+
+	function manage_link($action, $link_url, $link_name,$link_class=0) {
+		global $sql, $tp;
+		$link_url = $tp -> toDB($link_url, true);
+		$link_name = $tp -> toDB($link_name, true);
+		if ($action == 'add') {
+			$path = str_replace("../", "", $link_url);
+			$link_t = $sql->db_Count('links');
+			if (!$sql->db_Count('links', '(*)', "link_name = '{$link_name}'")) {
+				return $sql->db_Insert('links', "0, '{$link_name}', '{$path}', '', '', '1', '".($link_t + 1)."', '0', '0', '{$link_class}' ");
+			} else {
+				return FALSE;
+			}
+		}
+		if ($action == 'remove') {
+			if ($sql->db_Select('links', 'link_order', "link_name = '{$link_name}'")) {
+				$row = $sql->db_Fetch();
+				$sql->db_Update('links', "link_order = link_order - 1 WHERE link_order > {$row['link_order']}");
+				return $sql->db_Delete('links', "link_name = '{$link_name}'");
+			}
+		}
+	}
+
+	function manage_prefs($action, $var) {
+		global $pref;
+		if (is_array($var)) {
+			if ($action == 'add') {
+				foreach($var as $k => $v) {
+					$pref[$k] = $v;
+				}
+			}
+			if ($action == 'remove') {
+				foreach($var as $k => $v) {
+					unset($pref[$k]);
+				}
+			}
+			save_prefs();
+		}
+	}
+
+
+	function manage_comments($action,$comment_id){
+		global $sql, $tp;
+    	if($action == 'remove'){
+			foreach($comment_id as $com){
+            	$tmp[] = "comment_type='".$tp -> toDB($com, true)."'";
+			}
+			$qry = implode(" OR ",$tmp);
+   			return $sql->db_Delete('comments',$qry);
+   		}
+	}
+
+
+	function manage_tables($action, $var) {
+		global $sql;
+		if ($action == 'add') {
+			if (is_array($var)) {
+				foreach($var as $tab) {
+					if (!$sql->db_Query($tab)) {
+						return FALSE;
+					}
+				}
+				return TRUE;
+			}
+			return TRUE;
+		}
+        if ($action == 'upgrade') {
+			if (is_array($var)) {
+				foreach($var as $tab) {
+					if (!$sql->db_Query_all($tab)) {
+						return FALSE;
+					}
+				}
+				return TRUE;
+			}
+			return TRUE;
+		}
+		if ($action == 'remove') {
+			if (is_array($var)) {
+				foreach($var as $tab) {
+					$qry = 'DROP TABLE '.MPREFIX.$tab;
+					if (!$sql->db_Query_all($qry)) {
+						return $tab;
+					}
+				}
+				return TRUE;
+			}
+			return TRUE;
+		}
+	}
+
+	function manage_plugin_prefs($action, $prefname, $plugin_folder, $varArray = '') {
+		global $pref;
+		if ($prefname == 'plug_sc' || $prefname == 'plug_bb') {
+			foreach($varArray as $code) {
+				$prefvals[] = "$code:$plugin_folder";
+			}
+		} else {
+			$prefvals[] = $plugin_folder;
+		}
+		$curvals = explode(',', $pref[$prefname]);
+
+		if ($action == 'add') {
+			$newvals = array_merge($curvals, $prefvals);
+		}
+		if ($action == 'remove') {
+			foreach($prefvals as $v) {
+				if (($i = array_search($v, $curvals)) !== FALSE) {
+					unset($curvals[$i]);
+				}
+			}
+			// $newvals = explode(',', $curvals);
+			$newvals = $curvals;
+		}
+		$newvals = array_unique($newvals);
+		if(count($newvals) < 2)
+		{
+			$pref[$prefname] = $newvals[0];
+		}
+		else
+		{
+			$pref[$prefname] = implode(',', $newvals);
+		}
+		if(substr($pref[$prefname], 0, 1) == ",")
+		{
+			$pref[$prefname] = substr($pref[$prefname], 1);
+		}
+		save_prefs();
+	}
+
+
+
+
+
+
+	function manage_search($action, $eplug_folder) {
+		global $sql, $sysprefs;
+		$search_prefs = $sysprefs -> getArray('search_prefs');
+		$default = file_exists(e_PLUGIN.$eplug_folder.'/e_search.php') ? TRUE : FALSE;
+		$comments = file_exists(e_PLUGIN.$eplug_folder.'/search/search_comments.php') ? TRUE : FALSE;
+		if ($action == 'add'){
+			$install_default = $default ? TRUE : FALSE;
+			$install_comments = $comments ? TRUE : FALSE;
+		} else if ($action == 'remove'){
+			$uninstall_default = isset($search_prefs['plug_handlers'][$eplug_folder]) ? TRUE : FALSE;
+			$uninstall_comments = isset($search_prefs['comments_handlers'][$eplug_folder]) ? TRUE : FALSE;
+		} else if ($action == 'upgrade'){
+			if (isset($search_prefs['plug_handlers'][$eplug_folder])) {
+				$uninstall_default = $default ? FALSE : TRUE;
+			} else {
+				$install_default = $default ? TRUE : FALSE;
+			}
+			if (isset($search_prefs['comments_handlers'][$eplug_folder])) {
+				$uninstall_comments = $comments ? FALSE : TRUE;
+			} else {
+				$install_comments = $comments ? TRUE : FALSE;
+			}
+		}
+		if ($install_default) {
+			$search_prefs['plug_handlers'][$eplug_folder] = array('class' => 0, 'pre_title' => 1, 'pre_title_alt' => '', 'chars' => 150, 'results' => 10);
+		} else if ($uninstall_default) {
+			unset($search_prefs['plug_handlers'][$eplug_folder]);
+		}
+		if ($install_comments) {
+			require_once(e_PLUGIN.$eplug_folder.'/search/search_comments.php');
+			$search_prefs['comments_handlers'][$eplug_folder] = array('id' => $comments_type_id, 'class' => 0, 'dir' => $eplug_folder);
+		} else if ($uninstall_comments) {
+			unset($search_prefs['comments_handlers'][$eplug_folder]);
+		}
+		$tmp = addslashes(serialize($search_prefs));
+		$sql->db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = 'search_prefs' ");
+	}
+
+	function manage_notify($action, $eplug_folder) {
+		global $sql, $sysprefs, $eArrayStorage, $tp;
+		$notify_prefs = $sysprefs -> get('notify_prefs');
+		$notify_prefs = $eArrayStorage -> ReadArray($notify_prefs);
+		$e_notify = file_exists(e_PLUGIN.$eplug_folder.'/e_notify.php') ? TRUE : FALSE;
+		if ($action == 'add'){
+			$install_notify = $e_notify ? TRUE : FALSE;
+		} else if ($action == 'remove'){
+			$uninstall_notify = isset($notify_prefs['plugins'][$eplug_folder]) ? TRUE : FALSE;
+		} else if ($action == 'upgrade'){
+			if (isset($notify_prefs['plugins'][$eplug_folder])) {
+				$uninstall_notify = $e_notify ? FALSE : TRUE;
+			} else {
+				$install_notify = $e_notify ? TRUE : FALSE;
+			}
+		}
+		if ($install_notify) {
+			$notify_prefs['plugins'][$eplug_folder] = TRUE;
+			require_once(e_PLUGIN.$eplug_folder.'/e_notify.php');
+			foreach ($config_events as $event_id => $event_text) {
+				$notify_prefs['event'][$event_id] = array('type' => 'off', 'class' => '254', 'email' => '');
+			}
+		} else if ($uninstall_notify) {
+			unset($notify_prefs['plugins'][$eplug_folder]);
+			require_once(e_PLUGIN.$eplug_folder.'/e_notify.php');
+			foreach ($config_events as $event_id => $event_text) {
+				unset($notify_prefs['event'][$event_id]);
+			}
+		}
+		$s_prefs = $tp -> toDB($notify_prefs);
+		$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
+		$sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'");
+	}
+
+	/**
+	 * Installs a plugin by ID
+	 *
+	 * @param int $id
+	 */
+	function install_plugin($id) {
+		global $sql, $ns, $sysprefs,$mySQLprefix, $tp;
+
+		// install plugin ...
+		$plug = $this->getinfo($id);
+
+		if ($plug['plugin_installflag'] == FALSE) {
+			include_once(e_PLUGIN.$plug['plugin_path'].'/plugin.php');
+
+			$func = $eplug_folder.'_install';
+			if (function_exists($func)) {
+				$text .= call_user_func($func);
+			}
+
+			if (is_array($eplug_tables)) {
+				$result = $this->manage_tables('add', $eplug_tables);
+				if ($result === TRUE) {
+					$text .= EPL_ADLAN_19.'<br />';
+					//success
+				} else {
+					$text .= EPL_ADLAN_18.'<br />';
+					//fail
+				}
+			}
+
+
+
+			if (is_array($eplug_prefs)) {
+				$this->manage_prefs('add', $eplug_prefs);
+				$text .= EPL_ADLAN_20.'<br />';
+			}
+
+			if ($eplug_module === TRUE) {
+				$this->manage_plugin_prefs('add', 'modules', $eplug_folder);
+			}
+
+			if ($eplug_status === TRUE) {
+				$this->manage_plugin_prefs('add', 'plug_status', $eplug_folder);
+			}
+
+			if ($eplug_latest === TRUE) {
+				$this->manage_plugin_prefs('add', 'plug_latest', $eplug_folder);
+			}
+
+			if (is_array($eplug_array_pref)){
+				foreach($eplug_array_pref as $key => $val){
+					$this->manage_plugin_prefs('add', $key, $val);
+				}
+			}
+
+			if (is_array($eplug_sc)) {
+				$this->manage_plugin_prefs('add', 'plug_sc', $eplug_folder, $eplug_sc);
+			}
+
+			if (is_array($eplug_bb)) {
+				$this->manage_plugin_prefs('add', 'plug_bb', $eplug_folder, $eplug_bb);
+			}
+
+			if (is_array($eplug_user_prefs)) {
+				$sql->db_Select("core", " e107_value", " e107_name = 'user_entended'");
+				$row = $sql->db_Fetch();
+				$user_entended = unserialize($row[0]);
+				while (list($e_user_pref, $default_value) = each($eplug_user_prefs)) {
+					$user_entended[] = $e_user_pref;
+					$user_pref['$e_user_pref'] = $default_value;
+				}
+				save_prefs("user");
+				$tmp = addslashes(serialize($user_entended));
+				if ($sql->db_Select("core", "e107_value", " e107_name = 'user_entended'")) {
+					$sql->db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = 'user_entended' ");
+				} else {
+					$sql->db_Insert("core", "'user_entended', '{$tmp}' ");
+				}
+				$text .= EPL_ADLAN_20."<br />";
+			}
+
+			if ($eplug_link === TRUE && $eplug_link_url != '' && $eplug_link_name != '') {
+                $plug_perm['everyone'] = e_UC_PUBLIC;
+				$plug_perm['guest'] = e_UC_GUEST;
+				$plug_perm['member'] = e_UC_MEMBER;
+				$plug_perm['admin'] = e_UC_ADMIN;
+				$plug_perm['nobody'] = e_UC_NOBODY;
+				$eplug_link_perms = strtolower($eplug_link_perms);
+                $linkperm = ($plug_perm[$eplug_link_perms]) ? $plug_perm[$eplug_link_perms] : e_UC_PUBLIC;
+				$this->manage_link('add', $eplug_link_url, $eplug_link_name,$linkperm);
+			}
+
+			if ($eplug_userclass) {
+				$this->manage_userclass('add', $eplug_userclass, $eplug_userclass_description);
+			}
+
+			$this -> manage_search('add', $eplug_folder);
+
+			$this -> manage_notify('add', $eplug_folder);
+
+			if(is_array($eplug_rss)){
+				foreach($eplug_rss as $key=>$values){
+					$rssfeeds[] = $tp -> toDB($key);
+                	$tmp = serialize($values);
+					$rssmess .= EPL_ADLAN_46 . ". ($key)<br />";
+                }
+				$feeds = implode(",",$rssfeeds);
+			}
+            $plugin_rss = ($feeds) ? $feeds : "";
+			$sql->db_Update('plugin', "plugin_installflag = 1, plugin_rss = '$plugin_rss' WHERE plugin_id = '".intval($id)."'");
+            if($rssmess){ $text .= $rssmess; }
+			$text .= ($eplug_done ? "<br />{$eplug_done}" : "");
+		} else {
+			$text = EPL_ADLAN_21;
+		}
+		if($eplug_conffile){ $text .= "&nbsp;<a href='".e_PLUGIN."$eplug_folder/$eplug_conffile'>[".EPL_CONFIGURE."]</a>"; }
+		$ns->tablerender(EPL_ADLAN_33, $text);
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/poll_class.php 75/e107_handlers/poll_class.php
--- 6171/e107_handlers/poll_class.php	2004-06-06 02:51:32.000000000 -0500
+++ 75/e107_handlers/poll_class.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,162 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/classes/poll_class.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-@include(e_PLUGIN."poll_menu/languages/".e_LANGUAGE.".php");
-@include(e_PLUGIN."poll_menu/languages/English.php");
-class poll{	
-
-	function delete_poll($existing){
-		$cls = new db;
-		if($cls -> db_Delete("poll", " poll_id='".$existing."' ")){
-			return  "Poll deleted.";
-		}
-	}
-
-	function submit_poll($poll_id, $poll_name, $poll_option, $activate, $poll_comment, $id=0, $ref="menu"){
-		$aj = new textparse;
-		$poll_name = $aj -> formtpa($poll_name, "admin");
-		foreach($poll_option as $key => $value){
-			$poll_option[$key] = $aj -> formtpa($poll_option[$key], "admin");
-		}
-
-		$datestamp = time();
-		$cls = new db;
-		if($activate && $ref == "menu"){
-			$cls -> db_Update("poll", "poll_active='0', poll_end_datestamp='$datestamp' WHERE poll_active='1' OR poll_active='2' ");
-		}
-		if($poll_id){
-			$cls -> db_Update("poll", "poll_title='$poll_name', poll_option_1='".$poll_option[0]."', poll_option_2='".$poll_option[1]."', poll_option_3='".$poll_option[2]."', poll_option_4='".$poll_option[3]."', poll_option_5='".$poll_option[4]."', poll_option_6='".$poll_option[5]."', poll_option_7='".$poll_option[6]."', poll_option_8='".$poll_option[7]."', poll_option_9='".$poll_option[8]."', poll_option_10='".$poll_option[9]."', poll_active='$activate', poll_comment='$poll_comment' WHERE poll_id='$poll_id' ");
-			$message = POLL_11;
-		}else{
-			if($id){
-				$datestamp = $id;
-			}
-			$cls -> db_Insert("poll", "'0', '$datestamp', '0', '".ADMINID."', '$poll_name', '".$poll_option[0]."', '".$poll_option[1]."', '".$poll_option[2]."', '".$poll_option[3]."', '".$poll_option[4]."', '".$poll_option[5]."', '".$poll_option[6]."', '".$poll_option[7]."', '".$poll_option[8]."', '".$poll_option[9]."', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '^', '$activate', '$poll_comment' ");
-		}
-		unset($_POST['poll_id']);
-		return $message;
-	}
-
-	function render_poll($poll_id, $poll_question, $poll_option, $votes, $mode, $type="menu", $poll_comment){
-
-		global $POLLSTYLE, $sql;
-		if(!$POLLSTYLE){
-			$POLLSTYLE = "<div style='text-align:center'>\n<br />\n<b><i>{QUESTION}</i></b>\n<hr />\n</div>\n<br />\n{OPTIONS=<b>OPTION</b><br />BAR<br /><span class='smalltext'>PERCENTAGE VOTES</span><br /><br />}\n<br />\n<div style='text-align:center' class='smalltext'>{VOTE_TOTAL} {COMMENTS}\n<br />\n{OLDPOLLS}\n</div>";
-		}
-		$vote_total = array_sum($votes);
-		foreach($poll_option as $key => $value){
-			if(empty($value)){
-				unset($poll_option[$key]);
-			}
-		}
-		$options = count($poll_option);
-		for($count=0; $count<=$options; $count++){
-			$poll_option[$count] = (IsSet($poll_option[$count]) ? stripslashes($poll_option[$count]) : "");
-			if($vote_total){
-				$percentage[$count] = round(($votes[$count]/$vote_total)*100,2);
-			}
-		}
-
-		if($mode == "preview"){
-			$text = "<div style='text-align:center'>\n<table style='width:350px'>\n<tr>\n<td>";
-			$mode = "notvoted";
-			$preview = TRUE;
-		}else if($type == "forum"){
-			$text = "<div style='text-align:center'>\n<table style='width:350px' class='fborder'>\n<tr>\n<td class='forumheader3'>";
-			$preview = TRUE;
-		}
-
-		$sql -> db_Select("poll", "poll_admin_id", "poll_id='$poll_id' ");
-		$row = $sql -> db_Fetch(); extract($row);
-		$sql -> db_Select("user", "user_name", "user_id=".$poll_admin_id);
-		$row = $sql -> db_Fetch(); extract($row);
-
-		$sql = new db;
-		$comment_total = $sql -> db_Select("comments", "*",  "comment_item_id='$poll_id' AND comment_type='4'");
-		
-		$search[0] = "/\{QUESTION\}(.*?)/si";
-		$replace[0] = stripslashes($poll_question);
-
-		$search[1] = "/\{VOTE_TOTAL\}(.*?)/si";
-		$replace[1] = POLL_164.$vote_total;
-
-		$search[2] = "/\{COMMENTS\}(.*?)/si";
-		$replace[2] = ($type == "menu" && $poll_comment == 1 ? " <a href=\"".e_BASE."comment.php?comment.poll.".$poll_id."\">".POLL_500.": ".$comment_total."</a>" : "");
-
-		$search[3] = "/\{OLDPOLLS\}(.*?)/si";
-		$replace[3] = ($type == "menu" ? "<a href=\"".e_BASE."oldpolls.php\">".POLL_165."</a>" : "");
-
-		$search[4] = "/\{AUTHOR\}(.*?)/si";
-		$replace[4] = POLL_12."<a href='".e_BASE."user.php?id.$poll_admin_id'>$user_name</a>";
-
-		$p_style = preg_replace($search, $replace, $POLLSTYLE);
-
-		preg_match("/\{OPTIONS=(.*?)\}/si", $POLLSTYLE, $res);
-		$optionstring = $res[1];
-
-		if($mode == "notvoted"){
-			$opt = "<form method='post' action='".e_SELF;
-			if(e_QUERY){ $opt .= "?".e_QUERY; }
-			$opt .= "'><p>";
-		}
-
-		for($count=0; $count<=($options-1); $count++){	
-
-			if($votes[$count] == 0){
-				$vt = POLL_6;
-			}else if($votes[$count] == 1){
-				$vt = POLL_7;
-			}else{
-				$vt = $votes[$count].POLL_8;
-			}
-
-			if($mode == "voted"){
-				$search = array("OPTION", "BAR", "PERCENTAGE", "VOTES");
-				$replace = array($poll_option[$count], "<img src='".THEME."images/bar.jpg' height='12' width='".($percentage[$count])."%' style='border : 1px solid Black' alt='' />",  $percentage[$count]."% ", "[".$vt."]");
-			}else if($mode == "notvoted"){
-				$search = array("OPTION", "BAR", "PERCENTAGE", "VOTES", "<br /><br />");
-				$replace = array("<input type='radio' name='votea' value='".($count+1)."' /> ".$poll_option[$count], "", "", "", "<br />");
-			}else if($mode == "disallowed"){
-				$search = array("OPTION", "BAR", "PERCENTAGE", "VOTES");
-				$replace = array("<img src='".THEME."images/bullet2.gif' alt='bullet' /> <b>".$poll_option[$count], "", "", "");
-			}
-
-			$opt .= str_replace($search, $replace, $optionstring);
-		}
-
-		if($mode == "notvoted"){
-			$opt .= ($type == "forum" ? "\n<br /></p><div style='text-align:center'>\n<p><input class='button' type='submit' name='pollvote' value='".POLL_4."' /></p></div>\n<p><input type='hidden' name='pollid' value='".$poll_id."' /></p></form>" : "\n<br /></p><div style='text-align:center'>\n<p><input class='button' type='submit' name='vote' value='".POLL_163."' /></p></div>\n<p><input type='hidden' name='pollid' value='".$poll_id."' /></p></form>");
-		}
-
-		$text .= preg_replace("/\{OPTIONS=.*\}/si", $opt, $p_style);
-
-
-		if(MODERATOR && $type == "forum"){
-			$qs = explode(".", e_QUERY);
-			$forum_id = $qs[0];
-			$thread_id = $qs[1];
-			$text .= "<br /><div style='text-align:right' class='smallblacktext'>[ ".POLL_9." - <a href='".e_ADMIN."forum_conf.php?delete_poll.".$forum_id.".".$thread_id.".".$poll_id."'>".POLL_10."</a> ]</div>";
-		}
-
-		$ns = new e107table;
-
-		$caption = (file_exists(THEME."images/poll_menu.png") ? "<img src='".THEME."images/poll_menu.png' alt='' /> ".POLL_184 : POLL_184);
-		if(!$preview && $type != "forum"){
-			$ns -> tablerender($caption, $text);
-		}else{
-			return $text."</td></tr></table></div>";
-		}
-	}
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/pop3_class.php 75/e107_handlers/pop3_class.php
--- 6171/e107_handlers/pop3_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/pop3_class.php	2006-05-12 17:50:40.000000000 -0500
@@ -0,0 +1,173 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+// $Id: pop3_class.php,v 1.1 2006/05/12 22:50:40 e107coders Exp $ 
+// Main ReciveMail Class File - Version 1.0 (01-03-2006)
+/*
+ * File: recivemail.class.php
+ * Description: Reciving mail With Attechment
+ * Version: 1.0
+ * Created: 01-03-2006
+ * Author: Mitul Koradia
+ * Email: mitulkoradia@gmail.com
+ * Cell : +91 9879697592
+ */
+class receiveMail
+{
+	var $server='';
+	var $username='';
+	var $password='';
+
+	var $marubox='';
+
+	var $email='';
+
+	function receiveMail($username,$password,$EmailAddress,$mailserver='localhost',$servertype='pop',$port='110') //Constructure
+	{
+		if($servertype=='imap')
+		{
+			if($port=='') $port='143';
+			$strConnect='{'.$mailserver.':'.$port. '}INBOX';
+		}
+		else
+		{
+			$strConnect='{'.$mailserver.':'.$port. '/pop3}INBOX';
+		}
+		$this->server			=	$strConnect;
+		$this->username			=	$username;
+		$this->password			=	$password;
+		$this->email			=	$EmailAddress;
+	}
+	function connect() //Connect To the Mail Box
+	{
+		$this->marubox=imap_open($this->server,$this->username,$this->password);
+	}
+
+	function getHeaders($mid) // Get Header info
+	{
+		$mail_header=imap_header($this->marubox,$mid);
+		$sender=$mail_header->from[0];
+		$sender_replyto=$mail_header->reply_to[0];
+		$stat = (strtolower($sender->mailbox)!='mailer-daemon' && strtolower($sender->mailbox)!='postmaster') ? FALSE : TRUE;
+
+			$mail_details=array(
+					'from'=>strtolower($sender->mailbox).'@'.$sender->host,
+					'fromName'=>$sender->personal,
+					'toOth'=>strtolower($sender_replyto->mailbox).'@'.$sender_replyto->host,
+					'toNameOth'=>$sender_replyto->personal,
+					'subject'=>$mail_header->subject,
+					'to'=>strtolower($mail_header->toaddress),
+					'bounce'=>$stat
+				);
+
+		return $mail_details;
+	}
+	function get_mime_type(&$structure) //Get Mime type Internal Private Use
+	{
+		$primary_mime_type = array("TEXT", "MULTIPART", "MESSAGE", "APPLICATION", "AUDIO", "IMAGE", "VIDEO", "OTHER");
+
+		if($structure->subtype) {
+			return $primary_mime_type[(int) $structure->type] . '/' . $structure->subtype;
+		}
+		return "TEXT/PLAIN";
+	}
+	function get_part($stream, $msg_number, $mime_type, $structure = false, $part_number = false) //Get Part Of Message Internal Private Use
+	{
+		if(!$structure) {
+			$structure = imap_fetchstructure($stream, $msg_number);
+		}
+		if($structure) {
+			if($mime_type == $this->get_mime_type($structure))
+			{
+				if(!$part_number)
+				{
+					$part_number = "1";
+				}
+				$text = imap_fetchbody($stream, $msg_number, $part_number);
+				if($structure->encoding == 3)
+				{
+					return imap_base64($text);
+				}
+				else if($structure->encoding == 4)
+				{
+					return imap_qprint($text);
+				}
+				else
+				{
+					return $text;
+				}
+			}
+			if($structure->type == 1) /* multipart */
+			{
+				while(list($index, $sub_structure) = each($structure->parts))
+				{
+					if($part_number)
+					{
+						$prefix = $part_number . '.';
+					}
+					$data = $this->get_part($stream, $msg_number, $mime_type, $sub_structure, $prefix . ($index + 1));
+					if($data)
+					{
+						return $data;
+					}
+				}
+			}
+		}
+		return false;
+	}
+	function getTotalMails() //Get Total Number off Unread Email In Mailbox
+	{
+		$headers=imap_headers($this->marubox);
+		return count($headers);
+	}
+	function GetAttech($mid,$path) // Get Atteced File from Mail
+	{
+		$struckture = imap_fetchstructure($this->marubox,$mid);
+		$ar="";
+		foreach($struckture->parts as $key => $value)
+		{
+			$enc=$struckture->parts[$key]->encoding;
+			if($struckture->parts[$key]->ifdparameters)
+			{
+				$name=$struckture->parts[$key]->dparameters[0]->value;
+				$message = imap_fetchbody($this->marubox,$mid,$key+1);
+				if ($enc == 0)
+					$message = imap_8bit($message);
+				if ($enc == 1)
+					$message = imap_8bit ($message);
+				if ($enc == 2)
+					$message = imap_binary ($message);
+				if ($enc == 3)
+					$message = imap_base64 ($message);
+				if ($enc == 4)
+					$message = quoted_printable_decode($message);
+				if ($enc == 5)
+					$message = $message;
+				$fp=fopen($path.$name,"w");
+				fwrite($fp,$message);
+				fclose($fp);
+				$ar=$ar.$name.",";
+			}
+		}
+		$ar=substr($ar,0,(strlen($ar)-1));
+		return $ar;
+	}
+	function getBody($mid) // Get Message Body
+	{
+		$body = $this->get_part($this->marubox, $mid, "TEXT/HTML");
+		if ($body == "")
+			$body = $this->get_part($this->marubox, $mid, "TEXT/PLAIN");
+		if ($body == "") {
+			return "";
+		}
+		return $body;
+	}
+	function deleteMails($mid) // Delete That Mail
+	{
+		imap_delete($this->marubox,$mid);
+	}
+	function close_mailbox() //Close Mail Box
+	{
+		imap_close($this->marubox,CL_EXPUNGE);
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/popup_handler.php 75/e107_handlers/popup_handler.php
--- 6171/e107_handlers/popup_handler.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/popup_handler.php	2006-01-11 03:26:39.000000000 -0600
@@ -0,0 +1,93 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_handlers/popup_handler.php,v $
+|		$Revision: 1.4 $
+|		$Date: 2006/01/11 09:26:39 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+define("POPUP_LAN_1", "click to enlarge image");
+
+class popup{
+
+	// usage:
+	// you need to add the following call to popup.js in a headerjs function
+	//
+	// function headerjs(){
+	// echo "<script type='text/javascript' src='".e_FILE."popup.js'></script>\n";
+	// }
+	// on the page where you want to popup image to appear,
+	// you need to include this class and create a new object for it:
+	// require_once(e_HANDLER."popup_handler.php");
+	// $pp = new popup;
+	// then you need to prepare the right paramater in the function call.
+	// the function returns the image with the popup link as a href on it
+	// clicking the popup will use the js functions in the included js file to popup the image
+	// $pp -> popup($oSrc, $oSrcThumb, $oIconWidth, $oMaxWidth, $oTitle, $oText)
+
+	function popup($image, $thumb, $iconwidth='100', $maxwidth='', $title, $text){
+			global $tp;
+			//$image	:	full path to the large image you want to popup
+			//$thumb	:	full path to the small image to show on screen
+			//$maxwidth	:	the maximum size (width or height) an image may be popup'ed
+			//$title	:	the window title of the popup
+			//$text		:	the additional text to add into the popup
+
+			if(file_exists($image)){
+				
+				//use $image if $thumb doesn't exist
+				if(!file_exists($thumb)){
+					$thumb = $image;
+				}
+				$imagearray = getimagesize(trim($image));
+				//$imagearray holds width and height parameters of the image
+				//$imagearray[0] is width - $imagearray[1] is height
+
+				if($imagearray[1] > $imagearray[0]){
+					if(isset($maxwidth) && $maxwidth!='' && $imagearray[1] > $maxwidth){
+						$width		= round(($maxwidth*$imagearray[0])/$imagearray[1],0);
+						$height		= $maxwidth;
+					}else{
+						$width		= $imagearray[0];
+						$height		= $imagearray[1];
+					}
+				}else{
+					if(isset($maxwidth) && $maxwidth!='' && $imagearray[0] > $maxwidth){
+						$width		= $maxwidth;
+						$height		= round(($maxwidth*$imagearray[1])/$imagearray[0],0);
+					}else{
+						$width		= $imagearray[0];
+						$height		= $imagearray[1];
+					}
+				}
+				$iconwidth = ($title == "help" ? "" : ($iconwidth ? "width:".intval($iconwidth)."px;" : "width:100px;") );
+
+				$width		= intval($width);
+				$search		= array("'", '$', '"', '&#036;','&#039;', '&#092;');
+				$replace	= array("\'", '\$', '&quot;', '\$', "\'", '\\');
+				$title		= str_replace($search, $replace, $title);
+				$text		= str_replace($search, $replace, $text);
+
+				$popup = "<a href='javascript:void(0);' onclick=\"javascript:openPerfectPopup('".$image."',".$width.",'".$title."','".$text."')\" style='cursor:pointer;' onmouseover=\"window.status='".POPUP_LAN_1."'; return true;\" onmouseout=\"window.status=''; return true;\" ><img src='".$thumb."' style='border:1px solid #000; ".$iconwidth."' alt='' /></a><br /><br />";
+
+			}else{
+				$popup = "";
+			}
+			return $popup;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/pref_class.php 75/e107_handlers/pref_class.php
--- 6171/e107_handlers/pref_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/pref_class.php	2006-01-10 13:19:19.000000000 -0600
@@ -0,0 +1,188 @@
+<?php
+/*
++---------------------------------------------------------------+
+| e107 website system
+| /e107_handlers/pref_class.php
+|
+| Steve Dunstan 2001-2002
+| http://e107.org
+| jalist@e107.org
+|
+| Released under the terms and conditions of the
+| GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+//
+// Simple functionality:
+// Grab all prefs once, in one DB query. Reuse them throughout the session.
+//
+// get/set methods serve/consume strings (with slashes taken care of)
+// getArray/setArray methods serve/consume entire arrays (since most prefs are such!)
+//
+// NOTE: Use of this class is VALUABLE (efficient) yet not NECESSARY (i.e. the system
+//       will not break if it is ignored)... AS LONG AS there is no path consisting of:
+//             - modify pref value(s) IGNORING this class
+//  - retrieve pref value(s) USING this class
+//       (while processing a single web page)
+//  Just to be safe I have changed a number of menu_pref edits to use setArray().
+//
+
+class prefs {
+	var $prefVals;
+	var $prefArrays;
+
+	// List of rows that shouldn't be automatically extracted (delimeted by '|')
+	var $DefaultRows = "e107_name='e107' OR e107_name='menu_pref' OR e107_name='notify_prefs'";
+
+	function ExtractPrefs($RowList = "", $use_default = FALSE) {
+		global $sql;
+		$Args = '';
+		if($use_default)
+		{
+			$Args = $this->DefaultRows;
+		}
+		if(is_array($RowList))
+		{
+			foreach($RowList as $v)
+			{
+				$Args .= ($Args ? " OR e107_name='{$v}'" : "e107_name='{$v}'");
+			}
+		}
+		$sql->db_Select('core', '*', $Args, 'default');
+		while ($row = $sql->db_Fetch())
+		{
+			$this->prefVals['core'][$row['e107_name']] = $row['e107_value'];
+		}
+	}
+
+	/**
+	* Return current pref string $name from $table (only core for now)
+	*
+	* - @param  string $name -- name of pref row
+	* - @param  string $table -- "core"
+	* - @return  string pref value, slashes already stripped
+	* - @access  public
+	*/
+	function get($Name) {
+		$get_sql = new db; // required so sql loops don't break using $tp->toHTML(). 
+		if(isset($this->prefVals['core'][$Name])){
+			if($this->prefVals['core'][$Name] != '### ROW CACHE FALSE ###'){
+				return $this->prefVals['core'][$Name];
+			} else {
+				return false;
+			}
+		} elseif($get_sql->db_Select('core', '*', "`e107_name` = '{$Name}'", 'default')) {
+			$row = $get_sql->db_Fetch();
+			$this->prefVals['core'][$Name] = $row['e107_value'];
+			return $this->prefVals['core'][$Name];
+		} else {
+			$this->prefVals['core'][$Name] = '### ROW CACHE FALSE ###';
+			return false;
+		}
+	}
+
+	/**
+	* Return current array from pref string $name in $table (core only for now)
+	*
+	* - @param:  string $name -- name of pref row
+	* - @param  string $table -- "core" only now
+	* - @return  array pref values
+	* - @access     public
+	*/
+	// retrieve prefs as an array of values
+	function getArray($name) {
+		return unserialize($this->get($name));
+	}
+
+
+	/**
+	* Update pref set and cache
+	*
+	* @param  string val -- pre-serialized string
+	* @param  string $name -- name of pref row
+	* @param  string $table -- "core" or "user"
+	* @global  $$name
+	* @access  public
+	*
+	* set("val")    == 'core', 'pref'
+	* set("val","rowname")   == 'core', rowname
+	* set("val","","user")   == 'user', 'user_pref' for current user
+	* set("val","","user",uid)   == 'user', 'user_pref' for user uid
+	* set("val","fieldname","user")  == 'user', fieldname
+	*
+	*/
+	function set($val, $name = "", $table = "core", $uid = USERID) {
+		global $sql;
+		if (!strlen($name)) {
+			switch ($table) {
+				case 'core':
+				$name = "pref";
+				break;
+				case 'user':
+				$name = "user_pref";
+				break;
+			}
+		}
+		$val = addslashes($val);
+
+		switch ($table ) {
+			case 'core':
+			if(!$sql->db_Update($table, "e107_value='$val' WHERE e107_name='$name'"))
+			{
+				$sql->db_Insert($table, "'{$name}', '{$val}'");
+			}
+			$this->prefVals[$table][$name] = $val;
+			unset($this->prefArrays[$table][$name]);
+			break;
+			case 'user':
+			$sql->db_Update($table, "user_prefs='$val' WHERE user_id=$uid");
+			break;
+		}
+	}
+
+
+	/**
+	* Update pref set and cache
+	*
+	* - @param  string $name -- name of pref row
+	* - @param  string $table -- "core" or "user"
+	* - @global  $$name
+	* - @access  public
+	*
+	* set()    == core, pref
+	* set("rowname")   == core, rowname
+	* set("","user")   == user, user_pref for current user
+	* set("","user",uid)   == user, user_pref for user uid
+	* set("fieldname","user")  == user, fieldname
+	*
+	* all pref sets other than menu_pref get toDB()
+	*/
+	function setArray($name = "", $table = "core", $uid = USERID) {
+		global $tp;
+
+		if (!strlen($name)) {
+			switch ($table) {
+				case 'core':
+				$name = "pref";
+				break;
+				case 'user':
+				$name = "user_pref";
+				break;
+			}
+		}
+
+		global $$name;
+		if ($name != "menu_pref") {
+			foreach($$name as $key => $prefvalue) {
+				$$name[$key] = $tp->toDB($prefvalue);
+			}
+		}
+
+		$tmp = serialize($$name);
+		$this->set($tmp, $name, $table, $uid);
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/preset_class.php 75/e107_handlers/preset_class.php
--- 6171/e107_handlers/preset_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/preset_class.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,80 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|		e107 website system
+|
+|		Steve Dunstan 2001-2002
+|		http://e107.org
+|		jalist@e107.org
+|
+|		Released under the terms and conditions of the
+|		GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_handlers/preset_class.php,v $
+|		$Revision: 1.6 $
+|		$Date: 2005/12/14 17:37:34 $
+|		$Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e_preset {
+
+	var $form;
+	var $page;
+	var $id;
+
+	function save_preset(){
+	global $sql,$tp,$ns;
+	$qry = explode(".",e_QUERY);
+	$unique_id = is_array($this->id) ? $this->id : array($this->id);
+	$uid = $qry[1];
+
+		if($_POST && $qry[0] =="savepreset"){
+			foreach($_POST as $key => $value){
+				$value = $tp->toDB($value);
+			if ($sql -> db_Update("preset", "preset_value='$value'  WHERE preset_name ='".$unique_id[$uid]."' AND preset_field ='$key' ")){
+
+			} elseif ($value !="" && !$sql -> db_Select("preset","*","preset_name ='".$unique_id[$uid]."' AND preset_field ='$key' ")){
+				$sql -> db_Insert("preset", "0, '".$unique_id[$uid]."', '$key', '$value' ");
+			}
+
+			if($value == ""){
+				$sql -> db_Delete("preset", "preset_field ='".$key."' ");
+			}
+
+			}
+			$ns -> tablerender(LAN_SAVED, LAN_PRESET_SAVED);
+		}
+
+		if ($_POST['delete_preset'] && e_QUERY=="clr_preset"){
+			$del = $_POST['del_id'];
+			$text = ($sql -> db_Delete("preset", "preset_name ='".$unique_id[$del]."' ")) ? LAN_DELETED : LAN_DELETED_FAILED;
+			$ns -> tablerender($text, LAN_PRESET_DELETED);
+		}
+
+	}
+
+// ------------------------------------------------------------------------
+
+	function read_preset($unique_id){
+		global $sql,$tp;
+		if (!$_POST){
+			if ($sql -> db_Select("preset", "*", "preset_name ='$unique_id' ")){
+				while ($row = $sql-> db_Fetch()){
+					extract($row);
+					$val[$preset_field] = $tp->toForm($preset_value);
+					$_POST[$preset_field] = $tp->toForm($preset_value);
+				}
+				return $val;
+			}
+		}
+	}
+
+// ---------------------------------------------------
+
+
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/profanity_filter.php 75/e107_handlers/profanity_filter.php
--- 6171/e107_handlers/profanity_filter.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/profanity_filter.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,66 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/profanity_filter.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e_profanityFilter {
+	var $profanityList;
+	 
+	function e_profanityFilter() {
+		global $pref;
+
+		$words = explode(",", $pref['profanity_words']);
+		
+		foreach($words as $word) {
+			$word = trim($word);
+			if($word != "")
+			{
+				$word_array[] = $word;
+			}
+		}
+		$this->profanityList = implode("\b|\b", $word_array);
+		unset($words);
+		return TRUE;
+	}
+	 
+	function filterProfanities($text) {
+		global $pref;
+		if (!$this->profanityList) {
+			return $text;
+		}
+		if ($pref['profanity_replace']) {
+			return preg_replace("#\b".$this->profanityList."\b#is", $pref['profanity_replace'], $text);
+		} else {
+			return preg_replace_callback("#\b".$this->profanityList."\b#is", array($this, 'replaceProfanities'), $text);
+		}
+	}
+	 
+	function replaceProfanities($matches) {
+		/*!
+		@function replaceProfanities callback
+		@abstract replaces vowels in profanity words with stars
+		@param text string - text string to be filtered
+		@result filtered text
+		*/
+		 
+		return preg_replace("#a|e|i|o|u#i", "*" , $matches[0]);
+	}
+}
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/rate_class.php 75/e107_handlers/rate_class.php
--- 6171/e107_handlers/rate_class.php	2004-05-11 15:11:08.000000000 -0500
+++ 75/e107_handlers/rate_class.php	2006-05-13 13:18:43.000000000 -0500
@@ -1,85 +1,227 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /classes/rate_class.php
-|
-|        Steve Dunstan 2001-2002
-|        http://jalist.com
-|        stevedunstan@jalist.com
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-class rater{
-        function rateselect($text, $table, $id){
-                $self = $_SERVER['PHP_SELF'];
-                if($_SERVER['QUERY_STRING']){
-                        $self .= "?".$_SERVER['QUERY_STRING'];
-                }
-
-                $str = $text."
-                <select name=\"rateindex\" onchange=\"urljump(this.options[selectedIndex].value)\" class=\"tbox\">
-                <option selected='selected'  value=\"0\">Rate</option>
-                <option value=\"rate.php?$table^$id^$self^1\">1</option>
-                <option value=\"rate.php?$table^$id^$self^2\">2</option>
-                <option value=\"rate.php?$table^$id^$self^3\">3</option>
-                <option value=\"rate.php?$table^$id^$self^4\">4</option>
-                <option value=\"rate.php?$table^$id^$self^5\">5</option>
-                <option value=\"rate.php?$table^$id^$self^6\">6</option>
-                <option value=\"rate.php?$table^$id^$self^7\">7</option>
-                <option value=\"rate.php?$table^$id^$self^8\">8</option>
-                <option value=\"rate.php?$table^$id^$self^9\">9</option>
-                <option value=\"rate.php?$table^$id^$self^10\">10</option>
-                </select>";
-                return $str;
-        }
-
-        function rateradio($table, $id){
-                $str = "
-                <input type=\"radio\" value=\"1\" />1
-                <input type=\"radio\" value=\"2\" />2&nbsp;
-                <input type=\"radio\" value=\"3\" />3&nbsp;
-                <input type=\"radio\" value=\"4\" />4&nbsp;
-                <input type=\"radio\" value=\"5\" />5&nbsp;
-                <input type=\"radio\" value=\"6\" />6&nbsp;
-                <input type=\"radio\" value=\"7\" />7&nbsp;
-                <input type=\"radio\" value=\"8\" />8&nbsp;
-                <input type=\"radio\" value=\"9\" />9&nbsp;
-                <input type=\"radio\" value=\"10\" />10";
-                return $str;
-        }
-
-        function checkrated($table, $id){
-                $sql = new db;
-                if(!$sql -> db_Select("rate", "*", "rate_table='$table' AND rate_itemid='$id' ")){
-                        return FALSE;
-                }else{
-                        $row = $sql -> db_Fetch();
-                        extract($row);
-                        if(ereg("\.".USERID."\.", $rate_voters)){
-                                return TRUE;
-                        }else{
-                                return FALSE;
-                        }
-                }
-        }
-
-        function getrating($table, $id){
-                $sql = new db;
-                if(!$sql -> db_Select("rate", "*", "rate_table='$table' AND rate_itemid='$id' ")){
-                        return FALSE;
-                }else{
-                        $row = $sql -> db_Fetch();
-                        extract($row);
-                        $rating[0] = $rate_votes; // $rating[0] == number of votes
-                        $tmp = $rate_rating / $rate_votes;
-                        $tmp = explode(".", $tmp);
-                        $rating[1] = $tmp[0];        // $ratomg[1] = main result
-                        $rating[2] = substr($tmp[1],0,1);        //        $rating[2] == remainder
-                        return $rating;
-                }
-        }
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/rate_class.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2006/05/13 18:18:43 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_rate.php");
+@include_once(e_LANGUAGEDIR."English/lan_rate.php");
+class rater {
+	function rateselect($text, $table, $id, $mode=FALSE) {
+		//$mode	: if mode is set, no urljump will be used (used in combined comments+rating system)
+
+		$table = preg_replace('/\W/', '', $table);
+		$id = intval($id);
+
+		$self = $_SERVER['PHP_SELF'];
+		if ($_SERVER['QUERY_STRING']) {
+			$self .= "?".$_SERVER['QUERY_STRING'];
+		}
+		
+		$jump = "";
+		$url = "";
+		if($mode==FALSE){
+			$jump = "onchange='urljump(this.options[selectedIndex].value)'";
+			$url = e_BASE."rate.php?";
+		}
+		
+		$str = $text."
+			<select name='rateindex' ".$jump." class='tbox'>
+			<option selected='selected'  value='0'>".RATELAN_5."</option>
+			<option value='".$url."{$table}^{$id}^{$self}^1'>1</option>
+			<option value='".$url."{$table}^{$id}^{$self}^2'>2</option>
+			<option value='".$url."{$table}^{$id}^{$self}^3'>3</option>
+			<option value='".$url."{$table}^{$id}^{$self}^4'>4</option>
+			<option value='".$url."{$table}^{$id}^{$self}^5'>5</option>
+			<option value='".$url."{$table}^{$id}^{$self}^6'>6</option>
+			<option value='".$url."{$table}^{$id}^{$self}^7'>7</option>
+			<option value='".$url."{$table}^{$id}^{$self}^8'>8</option>
+			<option value='".$url."{$table}^{$id}^{$self}^9'>9</option>
+			<option value='".$url."{$table}^{$id}^{$self}^10'>10</option>
+			</select>";
+		return $str;
+	}
+
+	function rateradio($table, $id) {
+
+		$table = preg_replace('/\W/', '', $table);
+		$id = intval($id);
+
+		$str = "
+			<input type='radio' value='1' />1
+			<input type='radio' value='2' />2&nbsp;
+			<input type='radio' value='3' />3&nbsp;
+			<input type='radio' value='4' />4&nbsp;
+			<input type='radio' value='5' />5&nbsp;
+			<input type='radio' value='6' />6&nbsp;
+			<input type='radio' value='7' />7&nbsp;
+			<input type='radio' value='8' />8&nbsp;
+			<input type='radio' value='9' />9&nbsp;
+			<input type='radio' value='10' />10";
+		return $str;
+	}
+
+	function checkrated($table, $id) {
+
+		$table = preg_replace('/\W/', '', $table);
+		$id = intval($id);
+
+		$sql = new db;
+		if (!$sql->db_Select("rate", "*", "rate_table = '{$table}' AND rate_itemid = '{$id}' ")) {
+			return FALSE;
+		} else {
+			$row = $sql->db_Fetch();
+
+			if (preg_match("/\.".USERID."\./", $row['rate_voters'])) {
+				return TRUE;
+			//added option to split an individual users rating
+			}else if (preg_match("/\.".USERID.chr(1)."([0-9]{1,2})\./", $row['rate_voters'])) {
+				return TRUE;
+			} else {
+				return FALSE;
+			}
+		}
+	}
+
+	function getrating($table, $id, $userid=FALSE) {
+		//userid	: boolean, get rating for a single user, or get general total rating of the item
+
+		$table = preg_replace('/\W/', '', $table);
+		$id = intval($id);
+
+		$sql = new db;
+		if (!$sql->db_Select("rate", "*", "rate_table = '{$table}' AND rate_itemid = '{$id}' ")) {
+			return FALSE;
+		} else {
+			$rowgr = $sql->db_Fetch();
+			if($userid==TRUE){
+				$rating = "";
+				$rateusers = explode(".", $rowgr['rate_voters']);
+				for($i=0;$i<count($rateusers);$i++){
+					if(strpos($rateusers[$i], chr(1))){
+						$rateuserinfo[$i] = explode(chr(1), $rateusers[$i]);
+						if($userid == $rateuserinfo[$i][0]){
+							$rating[0] = 0;						//number of votes, not relevant in users rating
+							$rating[1] = $rateuserinfo[$i][1];	//the rating by this user
+							$rating[2] = 0;						//no remainder is present, because we have a single users rating
+							break;
+						}
+					}else{
+						$rating[0] = 0;		//number of votes, not relevant in users rating
+						$rating[1] = 0;		//the rating by this user
+						$rating[2] = 0;		//no remainder is present, because we have a single users rating							
+					}
+				}
+			}else{
+				$rating[0] = $rowgr['rate_votes']; // $rating[0] == number of votes
+				$tmp = $rowgr['rate_rating'] / $rowgr['rate_votes'];
+				$tmp = explode(".", $tmp);
+				$rating[1] = $tmp[0];
+				if(isset($tmp[1])){
+					$rating[2] = substr($tmp[1], 0, 1);
+				}else{
+					$rating[2] = "0";
+				}
+			}
+
+			return $rating;
+		}
+	}
+
+	function enterrating($rateindex){
+		global $sql, $tp;
+
+		$qs = explode("^", $rateindex);
+			
+		if (!$qs[0] || USER == FALSE || $qs[3] > 10 || $qs[3] < 1) {
+			header("location:".e_BASE."index.php");
+			exit;
+		}
+			
+		$table = $tp -> toDB($qs[0], true);
+		$itemid = intval($qs[1]);
+		$rate = intval($qs[3]);
+
+		//rating is now stored as userid-rating (to retain individual users rating)
+		//$sep = "^";
+		$sep = chr(1);
+		$voter = USERID.$sep.intval($qs[3]);
+
+		if ($sql->db_Select("rate", "*", "rate_table='$table' AND rate_itemid='$itemid' ")) {
+			$row = $sql->db_Fetch();
+			$rate_voters = $row['rate_voters'].".".$voter.".";
+			$sql->db_Update("rate", "rate_votes=rate_votes+1, rate_rating=rate_rating+'$rate', rate_voters='$rate_voters' WHERE rate_itemid='$itemid' ");
+		} else {
+			$sql->db_Insert("rate", " 0, '$table', '$itemid', '$rate', '1', '.".$voter.".' ");
+		}
+	}
+
+	function composerating($table, $id, $enter=TRUE, $userid=FALSE, $nojump=FALSE){
+		//enter		: boolean to show (rateselect box + textual info) or not
+		//userid	: used to calculate a users given rating
+		//nojump	: boolean, if present no urljump will be used (needed in comment_rating system)
+
+		$rate = "";
+		if($ratearray = $this -> getrating($table, $id, $userid)){
+			if($ratearray[1] > 0){
+				for($c=1; $c<= $ratearray[1]; $c++){
+					$rate .= "<img src='".e_IMAGE."rate/box.png' alt='' style='height:8px; vertical-align:middle' />";
+				}
+				if($ratearray[1] < 10){
+					for($c=9; $c>=$ratearray[1]; $c--){
+						$rate .= "<img src='".e_IMAGE."rate/empty.png' alt='' style='height:8px; vertical-align:middle' />";
+					}
+				}
+				$rate .= "<img src='".e_IMAGE."rate/boxend.png' alt='' style='height:8px; vertical-align:middle' />";
+				if($ratearray[2] == ""){ $ratearray[2] = 0; }
+				$rate .= "&nbsp;".$ratearray[1].".".$ratearray[2];
+				if(!$userid){
+					$rate .= " - ".$ratearray[0]."&nbsp;";
+					$rate .= ($ratearray[0] == 1 ? RATELAN_0 : RATELAN_1);
+				}
+			}
+		}else{
+			if($enter===TRUE){
+				$rate .= RATELAN_4;
+			}
+		}
+		if($enter===TRUE){
+			if(!isset($ratearray[1]) || $ratearray[1] > 0){
+				$rate .= " - ";
+			}
+			if(!$this -> checkrated($table, $id) && USER){
+				$rate .= $this -> rateselect(RATELAN_2, $table, $id, $nojump);
+				
+			}else if(USER){
+				$rate .= RATELAN_3;
+			}
+		}
+
+		return $rate;
+
+	}
+
+	function delete_ratings($table, $id)
+	{
+		global $tp, $sql;
+		$table = $tp->toDB($table, true);
+		$id = intval($id);
+		return $sql -> db_Delete("rate", "rate_itemid='{$id}' AND rate_table='{$table}'");
+	}
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/ren_help.php 75/e107_handlers/ren_help.php
--- 6171/e107_handlers/ren_help.php	2004-05-23 10:09:42.000000000 -0500
+++ 75/e107_handlers/ren_help.php	2006-05-13 21:08:13.000000000 -0500
@@ -1,65 +1,384 @@
-<?php
-@include(e_LANGUAGEDIR.e_LANGUAGE."/lan_ren_help.php");
-@include(e_LANGUAGEDIR."English/lan_ren_help.php");
-function ren_help($mode=1,$addtextfunc="addtext",$helpfunc="help"){
-
-        //        $mode == TRUE : fontsize and colour dialogs are rendered
-        //        $mode == 2 : no helpbox
-
-        if(strstr(e_SELF, "article")){
-                $code[0] = array("newpage", "[newpage]", LANHELP_34);
-        }
-        $code[1] = array("link", "[link=".LANHELP_35."][/link]", LANHELP_23);
-        $code[2] = array("b", "[b][/b]", LANHELP_24);
-        $code[3] = array("i", "[i][/i]", LANHELP_25);
-        $code[4] = array("u", "[u][/u]", LANHELP_26);
-        $code[5] = array("img", "[img][/img]", LANHELP_27);
-        $code[6] = array("center", "[center][/center]", LANHELP_28);
-        $code[7] = array("left", "[left][/left]", LANHELP_29);
-        $code[8] = array("right", "[right][/right]", LANHELP_30);
-        $code[9] = array("bq", "[blockquote][/blockquote]", LANHELP_31);
-        $code[10] = array("code", "[code][/code]",LANHELP_32 );
-        if(ADMIN){
-                $code[11] = array("html", "[html][/html]", LANHELP_33);
-        }
-
-        $colours[0] = array("black", LANHELP_1);
-        $colours[1] = array("blue", LANHELP_2);
-        $colours[2] = array("brown", LANHELP_3);
-        $colours[3] = array("cyan", LANHELP_4);
-        $colours[4] = array("darkblue", LANHELP_5);
-        $colours[5] = array("darkred", LANHELP_6);
-        $colours[6] = array("green", LANHELP_7);
-        $colours[7] = array("indigo", LANHELP_8);
-        $colours[8] = array("olive", LANHELP_9);
-        $colours[9] = array("orange", LANHELP_10);
-        $colours[10] = array("red", LANHELP_11);
-        $colours[11] = array("violet", LANHELP_12);
-        $colours[12] = array("white", LANHELP_13);
-        $colours[13] = array("yellow", LANHELP_14);
-
-        $fontsizes[0] = array("7", LANHELP_15);
-        $fontsizes[1] = array("9", LANHELP_16);
-        $fontsizes[2] = array("11", LANHELP_17);
-        $fontsizes[3] = array("16", LANHELP_18);
-        $fontsizes[4] = array("20", LANHELP_19);
-        $fontsizes[5] = array("28", LANHELP_20);
-
-        while(list($key, $bbcode) = each($code)){
-                $string .= "<input class=\"button\" type=\"button\" value=\"".$bbcode[0]."\" onclick=\"{$addtextfunc}('".$bbcode[1]."')\" ".($mode != 2 ? "onmouseout=\"{$helpfunc}('')\" onmouseover=\"{$helpfunc}('".$bbcode[2]."')\"" : "" ).($bbcode[3] ? " style='".$bbcode[3]."'" : "")." />\n";
-        }
-        if($mode){
-                $string .= "<br />\n<select class=\"tbox\" name=\"fontcol\" onchange=\"{$addtextfunc}('[color=' + this.options[this.selectedIndex].value + '][/color]');this.selectedIndex=0;\"".($mode != 2 ? " onmouseover=\"{$helpfunc}('Font Color: [color]Blue[/color]')\" onmouseout=\"{$helpfunc}('')\"" : "")." >\n<option value=\"\">".LANHELP_21."</option>\n";
-                while(list($key, $bbcode) = each($colours)){
-                        $string .= "<option style=\"color:".strtolower($bbcode[0])."\" value=\"".strtolower($bbcode[0])."\">".$bbcode[1]."</option>\n";
-                }
-                $string .= "</select>\n<select class=\"tbox\" name=\"fontsiz\" onchange=\"{$addtextfunc}('[size=' + this.options[this.selectedIndex].value + '][/size]');this.selectedIndex=0;\"".($mode != 2 ? " onmouseover=\"{$helpfunc}('Font Size: [size]Big[/size]')\" onmouseout=\"{$helpfunc}('')\"" : "" )." >\n<option>".LANHELP_22."</option>\n";
-
-                while(list($key, $bbcode) = each($fontsizes)){
-                        $string .= "<option value=\"".$bbcode[0]."\">".$bbcode[1]."</option>\n";
-                }
-                $string .= "</select>";
-        }
-        return $string;
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/ren_help.php,v $
+|     $Revision: 1.43 $
+|     $Date: 2006/05/14 02:08:13 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_ren_help.php");
+@include_once(e_LANGUAGEDIR."English/lan_ren_help.php");
+function ren_help($mode = 1, $addtextfunc = "addtext", $helpfunc = "help") {
+
+	//        $mode == TRUE : fontsize and colour dialogs are rendered
+	//        $mode == 2 : no helpbox
+
+	$rand = rand(1000,9999);
+
+	if (strstr(e_SELF, "content") || strstr(e_SELF, "cpage")) {
+		$code[0] = array("newpage", "[newpage]", LANHELP_34);
+	}
+	$code[1] = array("link", "[link=".LANHELP_35."][/link]", LANHELP_23);
+	$code[2] = array("b", "[b][/b]", LANHELP_24);
+	$code[3] = array("i", "[i][/i]", LANHELP_25);
+	$code[4] = array("u", "[u][/u]", LANHELP_26);
+	$code[5] = array("img", "[img][/img]", LANHELP_27);
+	$code[6] = array("center", "[center][/center]", LANHELP_28);
+	$code[7] = array("left", "[left][/left]", LANHELP_29);
+	$code[8] = array("right", "[right][/right]", LANHELP_30);
+	$code[9] = array("bq", "[blockquote][/blockquote]", LANHELP_31);
+	$code[10] = array("code", "[code][/code]", LANHELP_32 );
+	$code[11] = array("list", "[list][/list]", LANHELP_36);
+	$code[12] = array("fontcol", "[color][/color]", LANHELP_21);
+	$code[13] = array("fontsize", "[size][/size]", LANHELP_22);
+
+	$img[0] = "newpage.png";
+	$img[1] = "link.png";
+	$img[2] = "bold.png";
+	$img[3] = "italic.png";
+	$img[4] = "underline.png";
+	$img[5] = "image.png";
+	$img[6] = "center.png";
+	$img[7] = "left.png";
+	$img[8] = "right.png";
+	$img[9] = "blockquote.png";
+	$img[10] = "code.png";
+	$img[11] = "list.png";
+	$img[12] = "fontcol.png";
+	$img[13] = "fontsize.png";
+
+	$imgpath = (file_exists(THEME."bbcode/bold.png") ? THEME."bbcode/" : e_IMAGE."generic/bbcode/");
+
+	$text = "";
+	foreach($code as $key=>$bbcode){
+		if($key == 12){
+			$text .= "<img class='bbcode' src='".$imgpath.$img[$key]."' alt='' title='".$bbcode[2]."' onclick=\"expandit('col_selector_".$rand."')\" ".($mode != 2 ? "onmouseout=\"{$helpfunc}('')\" onmouseover=\"{$helpfunc}('".$bbcode[2]."')\"" : "" )." />\n";
+		}else if($key == 13){
+			$text .= "<img class='bbcode' src='".$imgpath.$img[$key]."' alt='' title='".$bbcode[2]."' onclick=\"expandit('size_selector_".$rand."')\" ".($mode != 2 ? "onmouseout=\"{$helpfunc}('')\" onmouseover=\"{$helpfunc}('".$bbcode[2]."')\"" : "" )." />\n";
+		}else{
+		  $text .= "<img class='bbcode' src='".$imgpath.$img[$key]."' alt='' title='".$bbcode[2]."' onclick=\"{$addtextfunc}('".$bbcode[1]."')\" ".($mode != 2 ? "onmouseout=\"{$helpfunc}('')\" onmouseover=\"{$helpfunc}('".$bbcode[2]."')\"" : "" )." />\n";
+		}
+	}
+
+
+	$text .= Size_Select('size_selector_'.$rand);
+	$text .= Color_Select('col_selector_'.$rand);
+	return $text;
+}
+
+// New Function - display_help() [ ren_help() is deprecated. ]
+
+function display_help($tagid="helpb", $mode = 1, $addtextfunc = "addtext", $helpfunc = "help") {
+
+	global $pref;
+	//        $mode == TRUE : fontsize and colour dialogs are rendered
+	//        $mode == 2 : no helpbox
+	//        $mode == 'news' : preuploaded news images dialog is rendered
+	$rand = rand(1000,9999);
+	if (strstr(e_SELF, "content") || strstr(e_SELF, "cpage")) {
+		$code[0] = array("newpage", "[newpage]", LANHELP_34);
+	}
+	$code[1] = array("link", "[link=".LANHELP_35."][/link]", LANHELP_23);
+	$code[2] = array("b", "[b][/b]", LANHELP_24);
+	$code[3] = array("i", "[i][/i]", LANHELP_25);
+	$code[4] = array("u", "[u][/u]", LANHELP_26);
+	$code[5] = array("img", "[img][/img]", LANHELP_27);
+	$code[6] = array("center", "[center][/center]", LANHELP_28);
+	$code[7] = array("left", "[left][/left]", LANHELP_29);
+	$code[8] = array("right", "[right][/right]", LANHELP_30);
+	$code[9] = array("bq", "[blockquote][/blockquote]", LANHELP_31);
+	$code[10] = array("code", "[code][/code]", LANHELP_32 );
+	$code[11] = array("list", "[list][/list]", LANHELP_36);
+	$code[12] = array("fontcol", "[color][/color]", LANHELP_21);
+	$code[13] = array("fontsize", "[size][/size]", LANHELP_22);
+	if ($mode == 'news') {
+		$code[14] = array("preimage", "[img][/img]", LANHELP_37);
+		$code[15] = array("prefile", "[file][/file]", LANHELP_39);
+	}
+
+	$img[0] = "newpage.png";
+	$img[1] = "link.png";
+	$img[2] = "bold.png";
+	$img[3] = "italic.png";
+	$img[4] = "underline.png";
+	$img[5] = "image.png";
+	$img[6] = "center.png";
+	$img[7] = "left.png";
+	$img[8] = "right.png";
+	$img[9] = "blockquote.png";
+	$img[10] = "code.png";
+	$img[11] = "list.png";
+	$img[12] = "fontcol.png";
+	$img[13] = "fontsize.png";
+	if ($mode == 'news') {
+		$img[14] = "preimage.png";
+		$img[15] = "prefile.png";
+	}
+
+	$imgpath = (file_exists(THEME."bbcode/bold.png") ? THEME."bbcode/" : e_IMAGE."generic/bbcode/");
+
+	$text = "";
+	foreach($code as $key=>$bbcode){
+		if($key == 12){
+			$text .= "<img class='bbcode' src='".$imgpath.$img[$key]."' alt='' title='".$bbcode[2]."' onclick=\"expandit('col_selector_".$rand."')\" ".($mode != 2 ? "onmouseout=\"{$helpfunc}('')\" onmouseover=\"{$helpfunc}('".$bbcode[2]."')\"" : "" )." />\n";
+		}else if($key == 13){
+			$text .= "<img class='bbcode' src='".$imgpath.$img[$key]."' alt='' title='".$bbcode[2]."' onclick=\"expandit('size_selector_".$rand."')\" ".($mode != 2 ? "onmouseout=\"{$helpfunc}('')\" onmouseover=\"{$helpfunc}('".$bbcode[2]."')\"" : "" )." />\n";
+		}else if($key == 14){
+			$text .= "<img class='bbcode' src='".$imgpath.$img[$key]."' alt='' title='".$bbcode[2]."' onclick=\"expandit('preimage_selector_".$rand."')\" ".($mode != 2 ? "onmouseout=\"{$helpfunc}('')\" onmouseover=\"{$helpfunc}('".$bbcode[2]."')\"" : "" )." />\n";
+		}else if($key == 15){
+			$text .= "<img class='bbcode' src='".$imgpath.$img[$key]."' alt='' title='".$bbcode[2]."' onclick=\"expandit('prefile_selector_".$rand."')\" ".($mode != 2 ? "onmouseout=\"{$helpfunc}('')\" onmouseover=\"{$helpfunc}('".$bbcode[2]."')\"" : "" )." />\n";
+		}else{
+		  $text .= "<img class='bbcode' src='".$imgpath.$img[$key]."' alt='' title='".$bbcode[2]."' onclick=\"{$addtextfunc}('".$bbcode[1]."')\" ".($mode != 2 ? "onmouseout=\"{$helpfunc}('')\" onmouseover=\"{$helpfunc}('".$bbcode[2]."')\"" : "" )." />\n";
+		}
+	}
+
+
+/*
+	if(file_exists(e_PLUGIN."sphpell/spellcheckpageinc.php"))
+	{
+		require_once(e_PLUGIN."sphpell/spellcheckpageinc.php");
+		$string .= "<input type='button' value='Check Spelling' onclick=\"DoSpellCheck('top.opener.parent.document.dataform.data')\">";
+	}
+*/
+
+
+	if ($mode) {
+		$text .= Size_Select('size_selector_'.$rand);
+		$text .= Color_Select('col_selector_'.$rand);
+		if ($mode == 'news') {
+			$text .= PreImage_Select('preimage_selector_'.$rand);
+			$text .= PreFile_Select('prefile_selector_'.$rand);
+		}
+	}
+
+	return $text;
+}
+
+function Color_Select($formid='col_selector') {
+
+	$text = "<!-- Start of Color selector -->
+	<div style='margin-left: 0px; margin-right: 0px; width: 221px; position: relative; z-index: 1000; float: right; display: none' id='{$formid}' onclick=\"this.style.display='none'\">
+	<div style='position: absolute; bottom: 30px; right: 145px; width: 221px'>";
+
+	$text .= "<script type='text/javascript'>
+	//<![CDATA[
+	var maxtd = 18;
+	var maxtddiv = -1;
+	var coloursrgb = new Array('00', '33', '66', '99', 'cc', 'ff');
+	var coloursgrey = new Array('000000', '333333', '666666', '999999', 'cccccc', 'ffffff');
+	var colourssol = new Array('ff0000', '00ff00', '0000ff', 'ffff00', '00ffff', 'ff00ff');
+	var rowswitch = 0;
+	var rowline = '';
+	var rows1 = '';
+	var rows2 = '';
+	var notr = 0;
+	var tdblk = '<td style=\'background-color: #000000; cursor: default; height: 10px; width: 10px;\'><\/td>';
+	var g = 1;
+	var s = 0;
+
+	function td_render(color) {
+		return '<td style=\'background-color: #' + color + '; height: 10px; width: 10px;\' onmousedown=\"addtext(\'[color=#' + color + '][/color]\')\"><\/td>';
+	}
+
+	for (i=0; i < coloursrgb.length; i++) {
+		for (j=0; j < coloursrgb.length; j++) {
+			for (k=0; k < coloursrgb.length; k++) {
+				maxtddiv++;
+				if (maxtddiv % maxtd == 0) {
+					if (rowswitch) {
+						if (notr < 5){
+							rows1 += '<\/tr><tr>' + td_render(coloursgrey[g]) + tdblk;
+							g++;
+						}
+						rowswitch = 0;
+						notr++;
+					}else{
+						rows2 += '<\/tr><tr>' + td_render(colourssol[s]) + tdblk;
+						s++;
+						rowswitch = 1;
+					}
+					maxtddiv = 0;
+				}
+				rowline = td_render(coloursrgb[j] + coloursrgb[k] + coloursrgb[i]);
+				if (rowswitch) {
+					rows1 += rowline;
+				}else{
+					rows2 += rowline;
+				}
+			}
+		}
+	}
+	document.write('<table cellspacing=\'1\' cellpadding=\'0\' style=\'cursor: hand; cursor: pointer; background-color: #000; width: 100%; border: 0px\'><tr>');
+	document.write(td_render(coloursgrey[0]) + tdblk + rows1 + rows2);
+	document.write('<\/tr><\/table>');
+	//]]>
+	</script>";
+
+	$text .="</div>
+	</div>
+	<!-- End of Color selector -->";
+
+	return $text;
+}
+
+
+function Size_Select($formid='size_selector') {
+	$text ="<!-- Start of Size selector -->
+	<div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}'>";
+	$text .="<div style='position:absolute; bottom:30px; right:125px'>";
+	$text .= "<table class='fborder' style='background-color: #fff'>
+	<tr><td class='forumheader3'>
+	<select class='tbox' name='preimageselect' onchange=\"addtext(this.value); expandit('{$formid}')\">
+	<option value=''>".LANHELP_41."</option>";
+
+	$sizes = array(7,8,9,10,11,12,14,15,18,20,22,24,26,28,30,36);
+	foreach($sizes as $s){
+		$text .= "<option value='[size=".$s."][/size]'>".$s."px</option>\n";
+	}
+	$text .="</select></td></tr>	\n </table></div>
+	</div>\n<!-- End of Size selector -->";
+	return $text;
+}
+
+function PreImage_Select($formid='preimage_selector') {
+
+	global $IMAGES_DIRECTORY, $fl;
+	if(!is_object($fl)){
+        require_once(e_HANDLER."file_class.php");
+		$fl = new e_file;
+	}
+
+	$rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*');
+	$imagelist = $fl->get_files(e_IMAGE."newspost_images/","",$rejecthumb);
+    sort($imagelist);
+	$text ="<!-- Start of PreImage selector -->
+	<div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}'>";
+	$text .="<div style='position:absolute; bottom:30px; right:100px'>";
+	$text .= "<table class='fborder' style='background-color: #fff'>
+	<tr><td class='forumheader3' style='white-space: nowrap'>";
+
+	if(!count($imagelist))
+			{
+				$text .= LAN_NEWS_43;
+			}
+			else
+			{
+				$text .= "<select class='tbox' name='preimageselect' onchange=\"addtext(this.value); expandit('{$formid}')\">
+				<option value=''>".LANHELP_42."</option>";
+				foreach($imagelist as $image)
+				{
+					if(strstr($image['fname'], "thumb"))
+					{
+						$fi = str_replace("thumb_", "", $image['fname']);
+						if(file_exists(e_IMAGE."newspost_images/".$fi))
+						{
+							// thumb and main image found
+							$text .= "<option value=\"[link=".$IMAGES_DIRECTORY."newspost_images/".$fi."][img]{E_IMAGE}newspost_images/".$image['fname']."[/img][/link]\">".$image['fname']." (".LANHELP_38.")</option>\n
+							";
+						}
+						else
+						{
+							$text .= "<option value=\"[img]{E_IMAGE}newspost_images/".$image['fname']."[/img]\">".$image['fname']."</option>\n
+							";
+						}
+					}
+					else
+					{
+						$text .= "<option value=\"[img]{E_IMAGE}newspost_images/".$image['fname']."[/img]\">".$image['fname']."</option>\n
+						";
+					}
+				}
+				$text .="</select>";
+			}
+	$text .="</td></tr>	\n </table></div>
+	</div>\n<!-- End of PreImage selector -->\n";
+	return $text;
+}
+
+function PreFile_Select($formid='prefile_selector') {
+	global $IMAGES_DIRECTORY, $fl, $sql;
+		$rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*');
+		$imagelist = $fl->get_files(e_IMAGE."newspost_images/","",$rejecthumb);
+		sort($imagelist); 
+		$filelist = array();
+		$downloadList = array();
+
+		$sql->db_Select("download", "*", "download_class != ".e_UC_NOBODY);
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			if($download_url)
+			{
+				$filelist[] = array("id" => $download_id, "name" => $download_name, "url" => $download_url, "class" => $download_class);
+				$downloadList[] = $download_url;
+			}
+		}
+
+		$tmp = $fl->get_files(e_FILE."downloads/","",$rejecthumb);
+		foreach($tmp as $value)
+		{
+			if(!in_array($value['fname'], $downloadList))
+			{
+				$filelist[] = array("id" => 0, "name" => $value['fname'], "url" => $value['fname']);
+			}
+		}
+	$text ="<!-- Start of PreFile selector -->
+	<div style='margin-left:0px;margin-right:0px; position:relative;z-index:1000;float:right;display:none' id='{$formid}'>";
+	$text .="<div style='position:absolute; bottom:30px; right:75px'>";
+	$text .= "<table class='fborder' style='background-color: #fff'>
+	<tr><td class='forumheader3' style='white-space: nowrap'>";
+
+
+	if(!count($filelist))
+	{
+		$text .= LANHELP_40;
+	}
+	else
+	{
+		$text .= "<select class='tbox' name='prefileselect' onchange=\"addtext(this.value); expandit('{$formid}')\">
+				<option value=''>".LANHELP_43."</option>";
+		foreach($filelist as $file)
+		{
+					if(isset($file['class']))
+					{
+						$ucinfo = "^".$file['class'];
+						$ucname = r_userclass_name($file['class']);
+					}
+					else
+					{
+						$ucinfo = "";
+						$ucname = r_userclass_name(0);
+					}
+
+					if($file['id'])
+					{
+						$text .= "<option value=\"[file=request.php?".$file['id']."{$cinfo}]".$file['name']."[/file]\">".$file['name']." - $ucname</option>\n";
+											}
+					else
+					{
+						$text .= "<option value=\"[file=request.php?".$file['url']."{$cinfo}]".$file['name']."[/file]\">".$file['name']." - $ucname</option>\n";
+					}
+
+		}
+		$text .="</select>";
+	}
+
+	$text .="</td></tr>	\n </table></div>
+	</div>\n<!-- End of PreFile selector -->\n";
+	return $text;
+}
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/resize_handler.php 75/e107_handlers/resize_handler.php
--- 6171/e107_handlers/resize_handler.php	2004-06-16 22:22:36.000000000 -0500
+++ 75/e107_handlers/resize_handler.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,138 +1,155 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/sitelinks_handler.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-|
-+---------------------------------------------------------------+
-*/
-/* 07-04-2004 - unknown: removed source/destination file rewriting, this should not break existing code */
-/* 09-04-2004 - unknown: source/destination file should be quoted, otherwise files with spaces can't be handled */
-function resize_image($source_file, $destination_file, $type = "upload", $model=""){
-
-	global $pref;
-
-	$new_height=0;
-	$mode = ($pref['resize_method'] ? $pref['resize_method'] : "gd2");
-	if($type == "upload"){
-		$new_size = ($pref['im_width'] ? $pref['im_width'] : 400);
-	}else if(is_numeric($type)){
-		$new_size = $type;
-	}else{
-		$new_size = ($pref['im_width'] ? $pref['im_width'] : 120);	//avatar
-		$new_height = ($pref['im_height'] ? $pref['im_height'] : 100);	//avatar
-	}
-
-	$im_quality = ($pref['im_quality'] ? $pref['im_quality'] : 99);
-
-	$image_stats = getimagesize($source_file);
-
-    if($image_stats[0] <= $type && is_numeric($type)){return false;}
-	
-if($image_stats == null){ echo "<b>DEBUG</b> image_stats are null<br />"; return false; }
-
-	if ($image_stats[2] != 1 && $image_stats[2] != 2 && $image_stats[2] != 3 && ($mode == 'gd1' || $mode == 'gd2')){
-		echo "<b>DEBUG</b> Wrong image type<br />";
-		return FALSE;
-	}
-	$imagewidth = $image_stats[0];
-	$imageheight = $image_stats[1];
-	if($imagewidth <= $new_size && ($imageheight <= $new_height || $new_height == 0)){ return TRUE; }
-	$ratio = ($imagewidth / $new_size);
-	$new_imageheight = round($imageheight / $ratio);
-	if(($new_height <= $new_imageheight) && $new_height > 0){
-		$ratio = $new_imageheight / $new_height;
-		$new_imageheight = $new_height;
-		$new_size = round($new_size / $ratio);
-		
-	}
-	if($mode == "ImageMagick"){
-		if ($destination_file == "stdout") {
-			/* if destination is stdout, output directly to the browser */
-			$destination_file = "jpg:-";
-			header("Content-type: image/jpeg");
-			passthru ($pref['im_path']."convert -quality ".$im_quality." -antialias -geometry ".$new_size."x".$new_imageheight." '".$source_file."' '".$destination_file."'");
-		}else{
-			/* otherwise output to file */
-			if($model == "copy"){
-				$name = substr($destination_file, (strrpos($destination_file, "/")+1));
-				$name2 = "thumb_".$name;
-				$destination_file = str_replace($name, $name2, $destination_file);
-			}
-			exec ($pref['im_path']."convert -quality ".$im_quality." -antialias -geometry ".$new_size."x".$new_imageheight." '".$source_file."' '".$destination_file."'");
-
-		}
-	}else if($mode == "gd1"){
-		if($image_stats[2] == 2)
-			$src_img = imagecreatefromjpeg($source_file);
-		else
-			$src_img = imagecreatefrompng($source_file);
-		if(!$src_img){
-			return FALSE;
-		}
-		$dst_img = imagecreate($new_size, $new_imageheight);
-		imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_size, $new_imageheight, $imagewidth, $imageheight);
-		if($model == "copy"){
-			$name = substr($destination_file, (strrpos($destination_file, "/")+1));
-			$name2 = "thumb_".$name;
-			$destination_file = str_replace($name, $name2, $destination_file);
-		}
-
-		if($destination_file == "stdout"){
-			header("Content-type: image/jpeg");
-			imagejpeg($dst_img, '', $im_quality);
-		}else{
-			imagejpeg($dst_img, $destination_file, $im_quality);
-			imagedestroy($src_img);
-			imagedestroy($dst_img);
-		}
-
-	}else if($mode == "gd2"){
-
-		if ($image_stats[2] == 2)
-			$src_img = imagecreatefromjpeg($source_file);
-		else
-			$src_img = imagecreatefrompng($source_file);
-		if (!$src_img){
-			return FALSE;
-		}
-
-		$dst_img = imagecreatetruecolor($new_size, $new_imageheight);
-		imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_size, $new_imageheight, $imagewidth, $imageheight);
-
-		if($model == "copy"){
-			$name = substr($destination_file, (strrpos($destination_file, "/")+1));
-			$name2 = "thumb_".$name;
-			$destination_file = str_replace($name, $name2, $destination_file);
-		}
-		if($destination_file == "stdout"){
-			header("Content-type: image/jpeg");
-			imagejpeg($dst_img, '', $im_quality);
-		}else{
-			imagejpeg($dst_img, $destination_file, $im_quality);
-			imagedestroy($src_img);
-			imagedestroy($dst_img);
-		}		
-	}
-
-	@chmod($destination_file, 0644);
-	if($pref['image_owner']){
-		@chown($destination_file, $pref['image_owner']);
-	}
-
-	$image_stats = getimagesize($destination_file);
-	if($image_stats == null){
-//		@unlink($source_file);
-		return FALSE;
-	}else{
-		return TRUE;
-	}
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/resize_handler.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+/* 07-04-2004 - unknown: removed source/destination file rewriting, this should not break existing code */
+/* 09-04-2004 - unknown: source/destination file should be quoted, otherwise files with spaces can't be handled */
+function resize_image($source_file, $destination_file, $type = "upload", $model = "") {
+	 
+	global $pref;
+	 
+	$new_height = 0;
+	$mode = ($pref['resize_method'] ? $pref['resize_method'] : "gd2");
+	if ($type == "upload") {
+		$new_size = ($pref['im_width'] ? $pref['im_width'] : 400);
+	}
+	else if(is_numeric($type)) {
+		$new_size = $type;
+	} else {
+		$new_size = ($pref['im_width'] ? $pref['im_width'] : 120);
+		//avatar
+		$new_height = ($pref['im_height'] ? $pref['im_height'] : 100);
+		//avatar
+	}
+	 
+	$im_quality = ($pref['im_quality'] ? $pref['im_quality'] : 99);
+	 
+	$image_stats = getimagesize($source_file);
+	 
+	if ($image_stats[0] <= $type && is_numeric($type)) {
+		return false;
+	}
+	 
+	if ($image_stats == null) {
+		echo "<b>DEBUG</b> image_stats are null<br />";
+		return false;
+	}
+	 
+	if ($image_stats[2] != 1 && $image_stats[2] != 2 && $image_stats[2] != 3 && ($mode == 'gd1' || $mode == 'gd2')) {
+		echo "<b>DEBUG</b> Wrong image type<br />";
+		return FALSE;
+	}
+	$imagewidth = $image_stats[0];
+	$imageheight = $image_stats[1];
+	if ($imagewidth <= $new_size && ($imageheight <= $new_height || $new_height == 0)) {
+		return TRUE;
+	}
+	$ratio = ($imagewidth / $new_size);
+	$new_imageheight = round($imageheight / $ratio);
+	if (($new_height <= $new_imageheight) && $new_height > 0) {
+		$ratio = $new_imageheight / $new_height;
+		$new_imageheight = $new_height;
+		$new_size = round($new_size / $ratio);
+		 
+	}
+	if ($mode == "ImageMagick") {
+		if ($destination_file == "stdout") {
+			/* if destination is stdout, output directly to the browser */
+			$destination_file = "jpg:-";
+			header("Content-type: image/jpeg");
+			passthru ($pref['im_path']."convert -quality ".$im_quality." -antialias -geometry ".$new_size."x".$new_imageheight." ".escapeshellarg($source_file)." '".$destination_file."'");
+		} else {
+			/* otherwise output to file */
+			if ($model == "copy") {
+				$name = substr($destination_file, (strrpos($destination_file, "/")+1));
+				$name2 = "thumb_".$name;
+				$destination_file = str_replace($name, $name2, $destination_file);
+			}
+			exec ($pref['im_path']."convert -quality ".$im_quality." -antialias -geometry ".$new_size."x".$new_imageheight." ".escapeshellarg($source_file)." '".$destination_file."'");
+			 
+		}
+	}
+	else if($mode == "gd1") {
+		if ($image_stats[2] == 2)
+		$src_img = imagecreatefromjpeg($source_file);
+		else
+			$src_img = imagecreatefrompng($source_file);
+		if (!$src_img) {
+			return FALSE;
+		}
+		$dst_img = imagecreate($new_size, $new_imageheight);
+		imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $new_size, $new_imageheight, $imagewidth, $imageheight);
+		if ($model == "copy") {
+			$name = substr($destination_file, (strrpos($destination_file, "/")+1));
+			$name2 = "thumb_".$name;
+			$destination_file = str_replace($name, $name2, $destination_file);
+		}
+		 
+		if ($destination_file == "stdout") {
+			header("Content-type: image/jpeg");
+			imagejpeg($dst_img, '', $im_quality);
+		} else {
+			imagejpeg($dst_img, $destination_file, $im_quality);
+			imagedestroy($src_img);
+			imagedestroy($dst_img);
+		}
+		 
+	}
+	else if($mode == "gd2") {
+		 
+		if ($image_stats[2] == 2)
+			$src_img = imagecreatefromjpeg($source_file);
+		else
+			$src_img = imagecreatefrompng($source_file);
+		if (!$src_img) {
+			return FALSE;
+		}
+		 
+		$dst_img = imagecreatetruecolor($new_size, $new_imageheight);
+		imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $new_size, $new_imageheight, $imagewidth, $imageheight);
+		 
+		if ($model == "copy") {
+			$name = substr($destination_file, (strrpos($destination_file, "/")+1));
+			$name2 = "thumb_".$name;
+			$destination_file = str_replace($name, $name2, $destination_file);
+		}
+		if ($destination_file == "stdout") {
+			header("Content-type: image/jpeg");
+			imagejpeg($dst_img, '', $im_quality);
+		} else {
+			imagejpeg($dst_img, $destination_file, $im_quality);
+			imagedestroy($src_img);
+			imagedestroy($dst_img);
+		}
+	}
+	 
+	@chmod($destination_file, 0644);
+	if ($pref['image_owner']) {
+		@chown($destination_file, $pref['image_owner']);
+	}
+	 
+	$image_stats = getimagesize($destination_file);
+	if ($image_stats == null) {
+		//                @unlink($source_file);
+		return FALSE;
+	} else {
+		return TRUE;
+	}
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/advanced_comment.php 75/e107_handlers/search/advanced_comment.php
--- 6171/e107_handlers/search/advanced_comment.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/advanced_comment.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,44 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/advanced_comment.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$advanced['type']['type'] = 'dropdown';
+$advanced['type']['text'] = LAN_SEARCH_57.':';
+$advanced['type']['list'][] = array('id' => 'all', 'title' => LAN_SEARCH_58);
+
+$advanced_caption['id'] = 'type';
+$advanced_caption['title']['all'] = LAN_SEARCH_59;
+
+foreach ($search_prefs['comments_handlers'] as $h_key => $value) {
+	if (check_class($value['class'])) {
+		$path = ($value['dir'] == 'core') ? e_HANDLER.'search/comments_'.$h_key.'.php' : e_PLUGIN.$value['dir'].'/search/search_comments.php';
+		require_once($path);
+		$advanced['type']['list'][] = array('id' => 's_'.$value['id'], 'title' => $comments_title);
+		$advanced_caption['title']['s_'.$value['id']] = LAN_SEARCH_60.' '.$comments_title;
+	}
+}
+
+$advanced['date']['type'] = 'date';
+$advanced['date']['text'] = LAN_SEARCH_50.':';
+
+$advanced['author']['type'] = 'author';
+$advanced['author']['text'] = LAN_SEARCH_61.':';
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/advanced_download.php 75/e107_handlers/search/advanced_download.php
--- 6171/e107_handlers/search/advanced_download.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/advanced_download.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,47 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/advanced_download.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$advanced['cat']['type'] = 'dropdown';
+$advanced['cat']['text'] = LAN_SEARCH_63.':';
+$advanced['cat']['list'][] = array('id' => 'all', 'title' => LAN_SEARCH_51);
+
+$advanced_caption['id'] = 'cat';
+$advanced_caption['title']['all'] = LAN_SEARCH_64;
+
+if ($sql -> db_Select_gen("SELECT download_category_id, download_category_name FROM #download_category WHERE download_category_parent != 0 AND download_category_class IN (".USERCLASS_LIST.")")) {
+	while ($row = $sql -> db_Fetch()) {
+		$advanced['cat']['list'][] = array('id' => $row['download_category_id'], 'title' => $row['download_category_name']);
+		$advanced_caption['title'][$row['download_category_id']] = LAN_SEARCH_65.' -> '.$row['download_category_name'];
+	}
+}
+
+$advanced['date']['type'] = 'date';
+$advanced['date']['text'] = LAN_SEARCH_66.':';
+
+$advanced['author']['type'] = 'author';
+$advanced['author']['text'] = LAN_SEARCH_61.':';
+
+$advanced['match']['type'] = 'dropdown';
+$advanced['match']['text'] = LAN_SEARCH_52.':';
+$advanced['match']['list'][] = array('id' => 0, 'title' => LAN_SEARCH_67);
+$advanced['match']['list'][] = array('id' => 1, 'title' => LAN_SEARCH_54);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/advanced_news.php 75/e107_handlers/search/advanced_news.php
--- 6171/e107_handlers/search/advanced_news.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/advanced_news.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,44 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/advanced_news.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$advanced['cat']['type'] = 'dropdown';
+$advanced['cat']['text'] = LAN_SEARCH_55.':';
+$advanced['cat']['list'][] = array('id' => 'all', 'title' => LAN_SEARCH_51);
+
+$advanced_caption['id'] = 'cat';
+$advanced_caption['title']['all'] = LAN_SEARCH_56;
+
+if ($sql -> db_Select("news_category", "category_id, category_name")) {
+	while($row = $sql -> db_Fetch()) {
+		$advanced['cat']['list'][] = array('id' => $row['category_id'], 'title' => $row['category_name']);
+		$advanced_caption['title'][$row['category_id']] = 'News -> '.$row['category_name'];
+	}
+}
+
+$advanced['date']['type'] = 'date';
+$advanced['date']['text'] = LAN_SEARCH_50.':';
+
+$advanced['match']['type'] = 'dropdown';
+$advanced['match']['text'] = LAN_SEARCH_52.':';
+$advanced['match']['list'][] = array('id' => 0, 'title' => LAN_SEARCH_53);
+$advanced['match']['list'][] = array('id' => 1, 'title' => LAN_SEARCH_54);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/advanced_pages.php 75/e107_handlers/search/advanced_pages.php
--- 6171/e107_handlers/search/advanced_pages.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/advanced_pages.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,25 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/advanced_pages.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$advanced['date']['type'] = 'date';
+$advanced['date']['text'] = LAN_SEARCH_68.':';
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/advanced_user.php 75/e107_handlers/search/advanced_user.php
--- 6171/e107_handlers/search/advanced_user.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/advanced_user.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,25 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/advanced_user.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$advanced['date']['type'] = 'date';
+$advanced['date']['text'] = LAN_SEARCH_62.':';
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/comments_download.php 75/e107_handlers/search/comments_download.php
--- 6171/e107_handlers/search/comments_download.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/comments_download.php	2005-12-28 08:47:20.000000000 -0600
@@ -0,0 +1,38 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/comments_download.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/28 14:47:20 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$comments_title = LAN_197;
+$comments_type_id = '2';
+$comments_return['download'] = "d.download_id, d.download_name";
+$comments_table['download'] = "LEFT JOIN #download AS d ON c.comment_type=2 AND d.download_id = c.comment_item_id";
+function com_search_2($row) {
+	global $con;
+	$datestamp = $con -> convert_date($row['comment_datestamp'], "long");
+	$res['link'] = "download.php?view.".$row['download_id'];
+	$res['pre_title'] = $row['download_name'] ? LAN_SEARCH_70.": " : "";
+	$res['title'] = $row['download_name'] ? $row['download_name'] : LAN_SEARCH_9;
+	$res['summary'] = $row['comment_comment'];
+	preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user);
+	$res['detail'] = LAN_SEARCH_7."<a href='user.php?id.".$user[1]."'>".$user[2]."</a>".LAN_SEARCH_8.$datestamp;
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/comments_news.php 75/e107_handlers/search/comments_news.php
--- 6171/e107_handlers/search/comments_news.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/comments_news.php	2005-12-28 08:47:20.000000000 -0600
@@ -0,0 +1,38 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/comments_news.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/28 14:47:20 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$comments_title = LAN_98;
+$comments_type_id = 0;
+$comments_return['news'] = "n.news_title";
+$comments_table['news'] = "LEFT JOIN #news AS n ON c.comment_type=0 AND n.news_id = c.comment_item_id";
+function com_search_0($row) {
+	global $con;
+	$datestamp = $con -> convert_date($row['comment_datestamp'], "long");
+	$res['link'] = "comment.php?comment.news.".$row['comment_item_id'];
+	$res['pre_title'] = $row['news_title'] ? LAN_SEARCH_71.": " : "";
+	$res['title'] = $row['news_title'] ? $row['news_title'] : LAN_SEARCH_9;
+	$res['summary'] = $row['comment_comment'];
+	preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user);
+	$res['detail'] = LAN_SEARCH_7."<a href='user.php?id.".$user[1]."'>".$user[2]."</a>".LAN_SEARCH_8.$datestamp;
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/comments_page.php 75/e107_handlers/search/comments_page.php
--- 6171/e107_handlers/search/comments_page.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/comments_page.php	2005-12-28 08:47:20.000000000 -0600
@@ -0,0 +1,38 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/comments_page.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/28 14:47:20 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$comments_title = LAN_418;
+$comments_type_id = 'page';
+$comments_return['page'] = "cp.page_id, cp.page_title";
+$comments_table['page'] = "LEFT JOIN #page AS cp ON c.comment_type='page' AND cp.page_id = c.comment_item_id";
+function com_search_page($row) {
+	global $con;
+	$datestamp = $con -> convert_date($row['comment_datestamp'], "long");
+	$res['link'] = "page.php?".$row['page_id'];
+	$res['pre_title'] = LAN_SEARCH_76.": ";
+	$res['title'] = $row['page_title'];
+	$res['summary'] = $row['comment_comment'];
+	preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user);
+	$res['detail'] = LAN_SEARCH_7."<a href='user.php?id.".$user[1]."'>".$user[2]."</a>".LAN_SEARCH_8.$datestamp;
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/comments_user.php 75/e107_handlers/search/comments_user.php
--- 6171/e107_handlers/search/comments_user.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/comments_user.php	2005-12-28 08:47:20.000000000 -0600
@@ -0,0 +1,38 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/comments_user.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/28 14:47:20 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$comments_title = LAN_98;
+$comments_type_id = 'profile';
+$comments_return['user'] = "u.user_name";
+$comments_table['user'] = "LEFT JOIN #user AS u ON c.comment_type='profile' AND u.user_id = c.comment_item_id";
+function com_search_profile($row) {
+	global $con;
+	$datestamp = $con -> convert_date($row['comment_datestamp'], "long");
+	$res['link'] = "user.php?id.".$row['comment_item_id'];
+	$res['pre_title'] = LAN_SEARCH_77.": ";
+	$res['title'] = $row['user_name'];
+	$res['summary'] = $row['comment_comment'];
+	preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user);
+	$res['detail'] = LAN_SEARCH_7."<a href='user.php?id.".$user[1]."'>".$user[2]."</a>".LAN_SEARCH_8.$datestamp;
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_article.php 75/e107_handlers/search/search_article.php
--- 6171/e107_handlers/search/search_article.php	2004-05-24 17:01:04.000000000 -0500
+++ 75/e107_handlers/search/search_article.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,25 +0,0 @@
-<?php
-// search module for articles.
-
-$c = 0;
-if($results = $sql -> db_Select("content", "*", "content_type=0 AND content_class!=255 AND (content_heading REGEXP('".$query."') OR content_summary REGEXP('".$query."')
- OR content_subheading REGEXP('".$query."') OR content_content REGEXP('".$query."')) ")){
-	while(list($content_id, $content_heading, $content_subheading, $content_content, $content_datestamp, $content_author, $content_comment) = $sql -> db_Fetch()){
-		$c ++ ;
-		$content_heading_ = parsesearch($content_heading, $query);
-		if(!$content_heading_){
-			$content_heading_ = $content_heading;
-		}
-		$content_subheading_ = parsesearch($content_subheading, $query);
-		if(!$content_subheading_){
-			$content_subheading_ = $content_subheading_;
-		}
-		$content_content_ = parsesearch($content_content, $query);
-		$action = "content.php?article.".$content_id."";
-		$text .= "\n<br /><form method='post' action='$action' id='article_".$c."'>
-				\n<input type='hidden' name='highlight_search' value='1' /><input type='hidden' name='search_query' value='$query' /><img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" /> <b><a href='javascript:document.getElementById(\"article_".$c."\").submit()'>".$content_heading_."</a></b> </form><br />".$content_subheading_.$content_content_;
-	}
-}else{
-	$text .= LAN_198;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_chatbox.php 75/e107_handlers/search/search_chatbox.php
--- 6171/e107_handlers/search/search_chatbox.php	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_handlers/search/search_chatbox.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,21 +0,0 @@
-<?php
-// search module for Chatbox search.
-
-if($results = $sql -> db_Select("chatbox", "*", "(cb_nick REGEXP('".$query."') OR cb_message REGEXP('".$query."')) AND cb_blocked='0' ")){
-	while(list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip) = $sql -> db_Fetch()){
-		$cb_nick = eregi_replace("[0-9]+\.", "", $cb_nick);
-
-		$cb_nick_ = parsesearch($cb_nick, $query);
-		$cb_message_ = parsesearch($cb_message, $query);
-		if(!$cb_nick_){
-			$cb_nick_ = $cb_nick;
-		}
-		if(!$cb_message_){
-			$cb_message_ = $cb_message;
-		}
-		$text .= "<img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" /> <a href=\"chat.php?".$cb_id.".fs\">$cb_nick_</a><br />$cb_message_<br /><br />";
-	}
-}else{
-	$text .= LAN_198;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_comment.php 75/e107_handlers/search/search_comment.php
--- 6171/e107_handlers/search/search_comment.php	2004-08-16 12:14:40.000000000 -0500
+++ 75/e107_handlers/search/search_comment.php	2005-12-28 08:50:24.000000000 -0600
@@ -1,31 +1,65 @@
-<?php
-// search module for comments.
-
-	$sql2 = new db;
-	$results = $sql -> db_Select("comments", "*", "comment_comment REGEXP('".$query."') OR comment_author REGEXP('".$query."') ");
-		while(list($comment_id, $comment_pid, $comment_item_id, $comment_subject, $comment_author, $comment_author_email, $comment_datestamp, $comment_comment, $comment_blocked, $comment_ip, $comment_type) = $sql -> db_Fetch()){
-			$c = 0;
-			$nick = eregi_replace("[0-9]+\.", "", $comment_author);
-			$datestamp = $con -> convert_date($comment_datestamp, "long");
-			if($comment_type == 6){	// bugtracker comment
-				$comment_comment = parsesearch($comment_comment, $query);
-				$sql2 -> db_Select("bugtrack", "*", "bugtrack_id='$comment_item_id'");
-				$row = $sql2 -> db_Fetch(); extract($row);
-				$text .= "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <b><a href='".e_PLUGIN."bugtracker/bugtracker.php?show.".$bugtrack_id."'>".$bugtrack_summary."</a></b><br />\n<span class='smalltext'>".LAN_SEARCH_7.$nick.LAN_SEARCH_8.$datestamp."</span><br />".$comment_comment."<br /><br />";
-			}else{
-				if($sql2 -> db_Select("news", "*", "news_id='$comment_item_id'")){
-					list($news_id, $news_title, $news_body, $news_datestamp, $news_author, $news_source, $news_url, $news_category, $news_allow_comments) = $sql2 -> db_Fetch();
-					if($news_allow_comments == 0){
-						$comment_comment = parsesearch($comment_comment, $query);
-						$text .= "<form method='post' action='comment.php?comment.news.".$news_id."' id='news_comment".$c."'>
-				\n<input type='hidden' name='highlight_search' value='1' /><input type='hidden' name='search_query' value='$query' /><img src='".THEME."images/bullet2.gif' alt='bullet' /> <b><a href='javascript:document.getElementById(\"news_comment".$c."\").submit()'>".($news_title ? $news_title : LAN_SEARCH_9)."</a></form></b><br />\n<span class='smalltext'>".LAN_SEARCH_7.$nick.LAN_SEARCH_8.$datestamp."</span><br />".$comment_comment."<br /><br />";
-					}else{
-						$results = $results -1;
-					}
-				}
-			}
-		}
-	if(!$results){
-		$text .= LAN_198;
-	}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/search_comment.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/28 14:50:24 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// advanced 
+$advanced_where = "";
+if (isset($_GET['type']) && $_GET['type'] != 'all') {
+	$advanced_where .= " c.comment_type='".(str_replace('s_', '', $tp -> toDB($_GET['type'])))."' AND";
+}
+
+if (isset($_GET['time']) && is_numeric($_GET['time'])) {
+	$advanced_where .= " c.comment_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
+}
+
+if (isset($_GET['author']) && $_GET['author'] != '') {
+	$advanced_where .= " c.comment_author LIKE '%".$tp -> toDB($_GET['author'])."%' AND";
+}
+
+//basic
+$return_fields = 'c.comment_item_id, c.comment_author, c.comment_datestamp, c.comment_comment, c.comment_type';
+
+foreach ($search_prefs['comments_handlers'] as $h_key => $value) {
+	if (check_class($value['class'])) {
+		$path = ($value['dir'] == 'core') ? e_HANDLER.'search/comments_'.$h_key.'.php' : e_PLUGIN.$value['dir'].'/search/search_comments.php';
+		require_once($path);
+		$in[] = "'".$value['id']."'";
+		$join[] = $comments_table[$h_key];
+		$return_fields .= ', '.$comments_return[$h_key];
+	}
+}
+
+$search_fields = array('c.comment_comment', 'c.comment_author');
+$weights = array('1.2', '0.6');
+$no_results = LAN_198;
+$where = "comment_type IN (".implode(',', $in).") AND".$advanced_where;
+$order = array('comment_datestamp' => DESC);
+$table = "comments AS c ".implode(' ', $join);
+
+$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_comment', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_comment($row) {	
+	$res = call_user_func('com_search_'.$row['comment_type'], $row);
+	return $res;
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_content.php 75/e107_handlers/search/search_content.php
--- 6171/e107_handlers/search/search_content.php	2004-05-24 17:01:04.000000000 -0500
+++ 75/e107_handlers/search/search_content.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,23 +0,0 @@
-<?php
-// search module for articles.
-
-$c = 0;
-if($results = $sql -> db_Select("content", "*", "content_type=1 AND content_class!=255 AND (content_heading REGEXP('".$query."') OR content_subheading REGEXP('".$query."') OR content_content REGEXP('".$query."')) ")){
-	while(list($content_id, $content_heading, $content_subheading, $content_content, $content_datestamp, $content_author, $content_comment) = $sql -> db_Fetch()){
-		$c ++ ;
-		$content_heading_ = parsesearch($content_heading, $query);
-		if(!$content_heading_){
-			$content_heading_ = $content_heading;
-		}
-		$content_subheading_ = parsesearch($content_subheading, $query);
-		if(!$content_subheading_){
-			$content_subheading_ = $content_subheading_;
-		}
-		$content_content_ = parsesearch($content_content, $query);
-		$text .= "<br /><form method='post' action='content.php?content.".$content_id."' id='content_".$c."'>
-				<input type='hidden' name='highlight_search' value='1' /><input type='hidden' name='search_query' value='$query' /><img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" /> <b><a href='javascript:document.getElementById(\"content_".$c."\").submit()'>".$content_heading_."</a></b></form> <br />".$content_subheading_.$content_content_;
-	}
-}else{
-	$text .= LAN_198;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_download.php 75/e107_handlers/search/search_download.php
--- 6171/e107_handlers/search/search_download.php	2004-05-24 17:01:04.000000000 -0500
+++ 75/e107_handlers/search/search_download.php	2006-02-18 12:08:16.000000000 -0600
@@ -1,25 +1,66 @@
-<?php
-// search module for User.
-$c = 0;
-if($results = $sql -> db_Select("download", "download_id, download_category, download_name, download_author, download_description, download_author_website", "download_name REGEXP('".$query."') OR download_author REGEXP('".$query."') OR download_description  REGEXP('".$query."') OR download_author_website REGEXP('".$query."') ")){
-        while(list($download_id, $download_category, $download_name, $download_author, $download_description, $download_author_website) = $sql -> db_Fetch()){
-
-                $download_name = parsesearch($download_name, $query);
-
-                $download_author = parsesearch($download_author, $query);
-
-                $download_description = parsesearch($download_description , $query);
-
-                $download_author_website = parsesearch($download_author_website, $query);
-
-
-				$action = "download.php?view.".$download_id."";
-				$text .= "<form method='post' action='$action' id='download_".$c."'>
-				<input type='hidden' name='highlight_search' value='1' /><input type='hidden' name='search_query' value='$query' /><img src='".THEME."images/bullet2.gif' alt='bullet' /> <b><a href='javascript:document.getElementById(\"download_".$c."\").submit()'>$download_name</a></b></form><br />$download_description<br /><br />";
-				$c ++;
-
-        }
-}else{
-        $text .= LAN_198;
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/search_download.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2006/02/18 18:08:16 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// advanced 
+$advanced_where = "";
+if (isset($_GET['cat']) && is_numeric($_GET['cat'])) {
+	$advanced_where .= " d.download_category='".$_GET['cat']."' AND";
+}
+
+if (isset($_GET['time']) && is_numeric($_GET['time'])) {
+	$advanced_where .= " d.download_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
+}
+
+if (isset($_GET['author']) && $_GET['author'] != '') {
+	$advanced_where .= " (d.download_author = '".$tp -> toDB($_GET['author'])."') AND";
+}
+
+if (isset($_GET['match']) && $_GET['match']) {
+	$search_fields = array('d.download_name');
+} else {
+	$search_fields = array('d.download_name', 'd.download_url', 'd.download_description', 'd.download_author', 'd.download_author_website');
+}
+
+// basic
+$return_fields = 'd.download_id, d.download_category, download_category_id, d.download_name, d.download_description, d.download_author, d.download_author_website, d.download_datestamp, d.download_class, c.download_category_name, c.download_category_class';
+$weights = array('1.2', '0.9', '0.6', '0.6', '0.4');
+$no_results = LAN_198;
+$where = "download_active = '1' AND d.download_class IN (".USERCLASS_LIST.") AND c.download_category_class IN (".USERCLASS_LIST.") AND".$advanced_where;
+$order = array('download_datestamp' => DESC);
+$table = "download AS d LEFT JOIN #download_category AS c ON d.download_category = c.download_category_id";
+
+$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_downloads', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_downloads($row) {
+	global $con;
+	$datestamp = $con -> convert_date($row['download_datestamp'], "long");
+	$res['link'] = "download.php?view.".$row['download_id'];
+	$res['pre_title'] = $row['download_category_name']." | ";
+	$res['title'] = $row['download_name'];
+	$res['pre_summary'] = "<div class='smalltext'><a href='download.php'>".LAN_197."</a> -> <a href='download.php?list.".$row['download_category_id']."'>".$row['download_category_name']."</a></div>";
+	$res['summary'] = $row['download_description'];
+	$res['detail'] = LAN_SEARCH_15." ".$row['download_author']." | ".LAN_SEARCH_66.": ".$datestamp;
+	return $res;
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_event.php 75/e107_handlers/search/search_event.php
--- 6171/e107_handlers/search/search_event.php	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_handlers/search/search_event.php	2005-12-28 08:50:24.000000000 -0600
@@ -1,47 +1,66 @@
-<?php
-// search module for Event calendar.
-
-	$results = $sql -> db_Select("event", "*", "event_stake REGEXP('".$query."') OR event_ward REGEXP('".$query."') OR event_organisation REGEXP('".$query."') OR event_title REGEXP('".$query."') 
-                     OR event_location REGEXP('".$query."') OR event_details REGEXP('".$query."') OR event_thread REGEXP('".$query."') ");
-	while(list($event_id, $event_stake, $event_ward, $event_organisation, $event_start, $event_end, $event_allday,,, $event_title, $event_location, $event_details, $event_author, $event_contact, $event_category, $event_url ) = $sql -> db_Fetch()){
-
-	$sql2 -> db_select("event_cat", "event_cat_name, event_cat_icon", "event_cat_id='".$event_category."' ");
-	list($event_cat_name, $event_cat_icon ) = $sql2 -> db_Fetch();
-
-		$event_stake_ = parsesearch($event_stake, $query);
-		if(!$event_stake_){
-			$event_stake_ = $event_stake;
-		}
-
-		$event_ward_ = parsesearch($event_ward, $query);
-		if(!$event_ward_){
-			$event_ward_ = $event_ward;
-		}
-
-		$event_organisation_ = parsesearch($event_organisation, $query);
-		if(!$event_organisation_){
-			$event_organisation_ = $event_organisation;
-		}
-
-		$event_title_ = parsesearch($event_title, $query);
-		if(!$event_title_){
-			$event_title_ = $event_title;
-		}
-
-		$event_details_ = parsesearch($event_details, $query);
-		if(!$event_details_){
-			$event_details_ = $event_details;
-		}
-
-		$event_cat_name_ = parsesearch($event_cat_name, $query);
-		if(!$event_cat_name_){
-			$event_cat_name_ = $event_cat_name;
-		}
-		$event_threat_ = parsesearch($event_threat, $query);
-		if(!$event_url_){
-			$event_threat_ = $event_threat;
-		}
-		$text .= "<img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" /> <a href=\"event.php?".$event_start."\">$event_title</a>$event_details<br />";
-	}
-	$qtype = LAN_911;
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/search_event.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/28 14:50:24 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+$query = $tp -> toDB($query);
+$results = $sql->db_Select("event", "*", "event_stake REGEXP('".$query."') OR event_ward REGEXP('".$query."') OR event_organisation REGEXP('".$query."') OR event_title REGEXP('".$query."')
+	OR event_location REGEXP('".$query."') OR event_details REGEXP('".$query."') OR event_thread REGEXP('".$query."') ");
+while (list($event_id, $event_stake, $event_ward, $event_organisation, $event_start, $event_end, $event_allday, , , $event_title, $event_location, $event_details, $event_author, $event_contact, $event_category, $event_url ) = $sql->db_Fetch()) {
+	 
+	$sql2->db_select("event_cat", "event_cat_name, event_cat_icon", "event_cat_id='".$event_category."' ");
+	list($event_cat_name, $event_cat_icon ) = $sql2->db_Fetch();
+	 
+	$event_stake_ = parsesearch($event_stake, $query);
+	if (!$event_stake_) {
+		$event_stake_ = $event_stake;
+	}
+	 
+	$event_ward_ = parsesearch($event_ward, $query);
+	if (!$event_ward_) {
+		$event_ward_ = $event_ward;
+	}
+	 
+	$event_organisation_ = parsesearch($event_organisation, $query);
+	if (!$event_organisation_) {
+		$event_organisation_ = $event_organisation;
+	}
+	 
+	$event_title_ = parsesearch($event_title, $query);
+	if (!$event_title_) {
+		$event_title_ = $event_title;
+	}
+	 
+	$event_details_ = parsesearch($event_details, $query);
+	if (!$event_details_) {
+		$event_details_ = $event_details;
+	}
+	 
+	$event_cat_name_ = parsesearch($event_cat_name, $query);
+	if (!$event_cat_name_) {
+		$event_cat_name_ = $event_cat_name;
+	}
+	$event_threat_ = parsesearch($event_threat, $query);
+	if (!$event_url_) {
+		$event_threat_ = $event_threat;
+	}
+	$text .= "<img src='".THEME_ABS."images/bullet2.gif' alt='bullet' /> <a href=\"event.php?".$event_start."\">{$event_title}</a>{$event_details}<br />";
+}
+$qtype = LAN_911;
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_forum.php 75/e107_handlers/search/search_forum.php
--- 6171/e107_handlers/search/search_forum.php	2004-05-24 17:01:04.000000000 -0500
+++ 75/e107_handlers/search/search_forum.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,41 +0,0 @@
-<?php
-// search module for Forum.
-
-if($results = $sql -> db_Select("forum_t", "*", "thread_name REGEXP('".$query."') OR thread_thread REGEXP('".$query."')")){
-	$c = 0;
-	$sql2 = new db;
-	while(list($thread_id, $thread_name, $thread_thread, $thread_forum_id, $thread_datestamp, $thread_parent, $thread_user, $thread_views, $thread_active, $thread_lastpost, $thread_s) = $sql -> db_Fetch()){
-
-		$sql2 -> db_Select("forum", "*", "forum_id='$thread_forum_id' ");
-		$row = $sql2 -> db_Fetch();
-		@extract($row);
-		if(check_class($forum_class)){
-	
-			if($thread_parent){
-				$sql3 = new db;
-				$sql3 -> db_Select("forum_t", "thread_name", "thread_id='$thread_parent'");
-				list($forum_t['thread_name']) = $sql3 -> db_Fetch();
-				$thread_name = parsesearch($forum_t['thread_name'], $query);
-			}else{
-				$thread_name = parsesearch($thread_name, $query);
-			}
-
-			$thread_thread = parsesearch($thread_thread, $query);
-		
-			if($thread_parent != 0){
-				$tmp = $thread_parent;
-			}else{
-				$tmp = $thread_id;
-			}
-			$action = "forum_viewtopic.php?".$thread_forum_id.".".$tmp."";
-			$text .= "<form method='post' action='$action' id='forum_".$c."'>
-				<input type='hidden' name='highlight_search' value='1' /><input type='hidden' name='search_query' value='$query' /><img src='".THEME."images/bullet2.gif' alt='bullet' /> <b><a href='javascript:document.getElementById(\"forum_".$c."\").submit()'>$thread_name</a></b></form><br />$thread_thread<br /><br />";
-				$c ++;
-		}else{
-			$results = $results -1;
-		}
-	}
-}else{
-	$text .= LAN_198;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_links.php 75/e107_handlers/search/search_links.php
--- 6171/e107_handlers/search/search_links.php	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_handlers/search/search_links.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,15 +0,0 @@
-<?php
-// search module for Links.
-
-if($results = $sql -> db_Select("links", "*", "link_name REGEXP('".$query."') OR link_description REGEXP('".$query."') ")){
-	while(list($link_id, $link_name, $link_url, $link_desciption, $link_button, $link_category, $link_refer) = $sql -> db_Fetch()){
-		$link_name_ = parsesearch($link_name, $query);
-		if(!$link_name_){
-			$link_name_ = $link_name;
-		}
-		$text .= "<img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" /> <a href=\"".$link_url."\">".$link_name."</a><br />";
-	}
-}else{
-	$text .= LAN_198;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_news.php 75/e107_handlers/search/search_news.php
--- 6171/e107_handlers/search/search_news.php	2004-08-16 12:14:40.000000000 -0500
+++ 75/e107_handlers/search/search_news.php	2005-12-28 08:50:24.000000000 -0600
@@ -1,30 +1,62 @@
-<?php
-// search module for news.
-$c = 0;
-$results = $sql -> db_Select("news", "*", "(news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().")  AND (news_title REGEXP('".$query."') OR news_body REGEXP('".$query."') OR news_extended REGEXP('".$query."')) ORDER BY news_id DESC ");
-	while($row = $sql -> db_Fetch()){
-		extract($row);$c ++;
-		if(check_class($news_class)){
-			$link = ($news_allow_comments ? "news.php?item.$news_id" : "comment.php?comment.news.$news_id");
-			$datestamp = $con -> convert_date($news_datestamp, "long");
-			if(eregi($query, $news_title)){
-				$resmain = parsesearch($news_title, $query);
-				$text .= "<form method='post' action='$link' id='news_title_".$c."'>
-				<input type='hidden' name='highlight_search' value='1' /><input type='hidden' name='search_query' value='$query' /><img src='".THEME."images/bullet2.gif' alt='bullet' /> <b><a href='javascript: document.getElementById(\"news_title_".$c."\").submit();'>".$resmain."</a></b></form><br /><span class='smalltext'>".LAN_SEARCH_3.$datestamp." - ".LAN_SEARCH_4."</span><br /><br />";
-			}else if(eregi($query, $news_body)){
-				$resmain = parsesearch($news_body, $query);
-				$text .= "<form method='post' action='$link' id='news_news_".$c."'>
-				<input type='hidden' name='highlight_search' value='1' /><input type='hidden' name='search_query' value='$query' /><img src='".THEME."images/bullet2.gif' alt='bullet' /> <b><a  href='javascript:document.getElementById(\"news_news_".$c."\").submit()'>".$news_title."</a></b></form><br /><span class='smalltext'>".LAN_SEARCH_3.$datestamp." - ".LAN_SEARCH_5."</span><br />".$resmain."<br /><br />";
-			}else if(eregi($query, $news_extended)){
-				$resmain = parsesearch($news_extended, $query);
-				$text .= "<form method='post' action='$link' id='news_extended_".$c."'>
-				<input type='hidden' name='highlight_search' value='1' /><input type='hidden' name='search_query' value='$query' /><img src='".THEME."images/bullet2.gif' alt='bullet' /> <b><a href='javascript:document.getElementById(\"news_extended_".$c."\").submit()'>".$news_title."</a></b></form><br /><span class='smalltext'>".LAN_SEARCH_3.$datestamp." - ".LAN_SEARCH_6."</span><br />".$resmain."<br /><br />";
-			}
-		}else{
-			$results = $results -1;
-		}
-	}
-if(!$results){
-	$text .= LAN_198;
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/search_news.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2005/12/28 14:50:24 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// advanced 
+$advanced_where = "";
+if (isset($_GET['cat']) && $_GET['cat'] != 'all') {
+	$advanced_where .= " c.category_id='".intval($_GET['cat'])."' AND";
+}
+
+if (isset($_GET['time']) && is_numeric($_GET['time'])) {
+	$advanced_where .= " n.news_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
+}
+
+if (isset($_GET['match']) && $_GET['match']) {
+	$search_fields = array('news_title');
+} else {
+	$search_fields = array('news_title', 'news_body', 'news_extended');
+}
+
+// basic
+$return_fields = 'n.news_id, n.news_title, n.news_body, n.news_extended, n.news_allow_comments, n.news_datestamp, n.news_category, c.category_name';
+$weights = array('1.2', '0.6', '0.6');
+$no_results = LAN_198;
+$time = time();
+
+$where = "(news_start < ".$time.") AND (news_end=0 OR news_end > ".$time.") AND news_class IN (".USERCLASS_LIST.") AND".$advanced_where;
+$order = array('news_datestamp' => DESC);
+$table = "news AS n LEFT JOIN #news_category AS c ON n.news_category = c.category_id";
+
+$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_news', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_news($row) {
+	global $con;
+	$res['link'] = $row['news_allow_comments'] ? "news.php?item.".$row['news_id'] : "comment.php?comment.news.".$row['news_id'];
+	$res['pre_title'] = $row['category_name']." | ";
+	$res['title'] = $row['news_title'];
+	$res['summary'] = $row['news_body'].' '.$row['news_extended'];
+	$res['detail'] = LAN_SEARCH_3.$con -> convert_date($row['news_datestamp'], "long");
+	return $res;
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_pages.php 75/e107_handlers/search/search_pages.php
--- 6171/e107_handlers/search/search_pages.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search/search_pages.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,52 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/search_pages.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// advanced 
+$advanced_where = "";
+if (isset($_GET['time']) && is_numeric($_GET['time'])) {
+	$advanced_where .= " page_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
+}
+
+// basic
+$return_fields = 'page_id, page_title, page_text, page_datestamp';
+$search_fields = array('page_title', 'page_text');
+$weights = array('1.2', '0.6');
+$no_results = LAN_198;
+
+$where = "page_class IN (".USERCLASS_LIST.") AND".$advanced_where;
+$order = array('page_datestamp' => DESC);
+$table = "page";
+
+$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_pages', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_pages($row) {
+	global $con;
+	$res['link'] = "page.php?".$row['page_id'];
+	$res['pre_title'] = "";
+	$res['title'] = $row['page_title'];
+	$res['summary'] = $row['page_text'];
+	$res['detail'] = LAN_SEARCH_3.$con -> convert_date($row['page_datestamp'], "long");
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_review.php 75/e107_handlers/search/search_review.php
--- 6171/e107_handlers/search/search_review.php	2004-05-24 17:01:04.000000000 -0500
+++ 75/e107_handlers/search/search_review.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,23 +0,0 @@
-<?php
-// search module for articles.
-
-$c = 0;
-if($results = $sql -> db_Select("content", "*", "content_type=3 AND content_class!=255 AND (content_heading REGEXP('".$query."') OR content_subheading REGEXP('".$query."') OR content_content REGEXP('".$query."')) ")){
-	while(list($content_id, $content_heading, $content_subheading, $content_content, $content_datestamp, $content_author, $content_comment) = $sql -> db_Fetch()){
-		$c ++ ;
-		$content_heading_ = parsesearch($content_heading, $query);
-		if(!$content_heading_){
-			$content_heading_ = $content_heading;
-		}
-		$content_subheading_ = parsesearch($content_subheading, $query);
-		if(!$content_subheading_){
-			$content_subheading_ = $content_subheading_;
-		}
-		$content_content_ = parsesearch($content_content, $query);
-		$text .= "\n<br /><form method='post' action='content.php?review.".$content_id."' id='review_".$c."'>
-				\n<input type='hidden' name='highlight_search' value='1' /><input type='hidden' name='search_query' value='$query' /><img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" /> <b><a href='javascript:document.getElementById(\"review_".$c."\").submit()'>".$content_heading_."</a></b> </form><br />".$content_subheading_.$content_content_;
-	}
-}else{
-	$text .= LAN_198;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search/search_user.php 75/e107_handlers/search/search_user.php
--- 6171/e107_handlers/search/search_user.php	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_handlers/search/search_user.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,16 +1,50 @@
-<?php
-// search module for User.
-
-if($results = $sql -> db_Select("user", "user_id, user_name, user_email, user_homepage, user_location, user_signature", "user_name REGEXP('".$query."') OR user_email REGEXP('".$query."') OR user_homepage  REGEXP('".$query."') OR user_location REGEXP('".$query."') OR user_signature REGEXP('".$query."') ")){
-	while(list($user_id, $user_name, $user_email, $user_homepage, $user_location, $user_signature) = $sql -> db_Fetch()){
-		$user_name = parsesearch($user_name, $query);
-		$user_email = parsesearch($user_email, $query);
-		$user_homepage = parsesearch($user_homepage , $query);
-		$user_signature = parsesearch($user_signature, $query);
-		$user_location = parsesearch($user_location, $query);
-		$text .= "<img src=\"".THEME."images/bullet2.gif\" alt=\"bullet\" /> <a href=\"user.php?id.".$user_id."\">".$user_name."</a><br />";
-	}
-}else{
-	$text .= LAN_198;
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search/search_user.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// advanced 
+$advanced_where = "";
+if (isset($_GET['time']) && is_numeric($_GET['time'])) {
+	$advanced_where .= " user_join ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
+}
+
+// basic
+$return_fields = 'user_id, user_name, user_email, user_signature, user_join';
+$search_fields = array('user_name', 'user_email', 'user_signature');
+$weights = array('1.2', '0.6', '0.6', '0.6', '0.6');
+$no_results = LAN_198;
+$where = $advanced_where;
+$order = array('user_join' => DESC);
+
+$ps = $sch -> parsesearch('user', $return_fields, $search_fields, $weights, 'search_user', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_user($row) {
+	global $con;
+	$res['link'] = "user.php?id.".$row['user_id'];
+	$res['pre_title'] = $row['user_id']." | ";
+	$res['title'] = $row['user_name'];
+	$res['summary'] = $row['user_signature'] ?  LAN_SEARCH_72.": ".$row['user_signature'] : LAN_SEARCH_73;
+	$res['detail'] = LAN_SEARCH_74.": ".$con -> convert_date($row['user_join'], "long");
+	return $res;
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/search_class.php 75/e107_handlers/search_class.php
--- 6171/e107_handlers/search_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/search_class.php	2006-04-13 19:28:13.000000000 -0500
@@ -0,0 +1,307 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/search_class.php,v $
+|     $Revision: 1.36 $
+|     $Date: 2006/04/14 00:28:13 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e_search {
+	
+	var $query;
+	var $text;
+	var $pos;
+	var $bullet;
+	var $keywords;
+	var $stopwords_php = "|a|about|an|and|are|as|at|be|by|com|edu|for|from|how|i|in|is|it|of|on|or|that|the|this|to|was|what|when|where|who|will|with|the|www|";
+	var $stopwords_mysql = "|a|a's|able|about|above|according|accordingly|across|actually|after|afterwards|again|against|ain't|all|allow|allows|almost|alone|along|already|also|although|always|am|among|amongst|an|and|another|any|anybody|anyhow|anyone|anything|anyway|anyways|anywhere|apart|appear|appreciate|appropriate|are|aren't|around|as|aside|ask|asking|associated|at|available|away|awfully|be|became|because|become|becomes|becoming|been|before|beforehand|behind|being|believe|below|beside|besides|best|better|between|beyond|both|brief|but|by|c'mon|c's|came|can|can't|cannot|cant|cause|causes|certain|certainly|changes|clearly|co|com|come|comes|concerning|consequently|consider|considering|contain|containing|contains|corresponding|could|couldn't|course|currently|definitely|described|despite|did|didn't|different|do|does|doesn't|doing|don't|done|down|downwards|during|each|edu|eg|eight|either|else|elsewhere|enough|entirely|especially|et|etc|even|ever|every|everybody|everyone|everything|everywhere|ex|exactly|example|except|far|few|fifth|first|five|followed|following|follows|for|former|formerly|forth|four|from|further|furthermore|get|gets|getting|given|gives|go|goes|going|gone|got|gotten|greetings|had|hadn't|happens|hardly|has|hasn't|have|haven't|having|he|he's|hello|help|hence|her|here|here's|hereafter|hereby|herein|hereupon|hers|herself|hi|him|himself|his|hither|hopefully|how|howbeit|however|i|i'd|i'll|i'm|i've|ie|if|ignored|immediate|in|inasmuch|inc|indeed|indicate|indicated|indicates|inner|insofar|instead|into|inward|is|isn't|it|it'd|it'll|it's|its|itself|just|keep|keeps|kept|know|knows|known|last|lately|later|latter|latterly|least|less|lest|let|let's|like|liked|likely|little|look|looking|looks|ltd|mainly|many|may|maybe|me|mean|meanwhile|merely|might|more|moreover|most|mostly|much|must|my|myself|name|namely|nd|near|nearly|necessary|need|needs|neither|never|nevertheless|new|next|nine|no|nobody|non|none|noone|nor|normally|not|nothing|novel|now|nowhere|obviously|of|off|often|oh|ok|okay|old|on|once|one|ones|only|onto|or|other|others|otherwise|ought|our|ours|ourselves|out|outside|over|overall|own|particular|particularly|per|perhaps|php|placed|please|plus|possible|presumably|probably|provides|que|quite|qv|rather|rd|re|really|reasonably|regarding|regardless|regards|relatively|respectively|right|said|same|saw|say|saying|says|second|secondly|see|seeing|seem|seemed|seeming|seems|seen|self|selves|sensible|sent|serious|seriously|seven|several|shall|she|should|shouldn't|since|six|so|some|somebody|somehow|someone|something|sometime|sometimes|somewhat|somewhere|soon|sorry|specified|specify|specifying|still|sub|such|sup|sure|t's|take|taken|tell|tends|th|than|thank|thanks|thanx|that|that's|thats|the|their|theirs|them|themselves|then|thence|there|there's|thereafter|thereby|therefore|therein|theres|thereupon|these|they|they'd|they'll|they're|they've|think|third|this|thorough|thoroughly|those|though|three|through|throughout|thru|thus|to|together|too|took|toward|towards|tried|tries|truly|try|trying|twice|two|un|under|unfortunately|unless|unlikely|until|unto|up|upon|us|use|used|useful|uses|using|usually|value|various|very|via|viz|vs|want|wants|was|wasn't|way|we|we'd|we'll|we're|we've|welcome|well|went|were|weren't|what|what's|whatever|when|whence|whenever|where|where's|whereafter|whereas|whereby|wherein|whereupon|wherever|whether|which|while|whither|who|who's|whoever|whole|whom|whose|why|will|willing|wish|with|within|without|won't|wonder|would|would|wouldn't|yes|yet|you|you'd|you'll|you're|you've|your|yours|yourself|yourselves|zero|";
+	
+	function e_search() {
+		global $query, $tp;
+		$this -> query = $query;
+		$this -> bullet = (defined("BULLET") ? "<img src='".THEME."images/".BULLET."' alt='' style='vertical-align: middle' />" : "<img src='".THEME."images/bullet2.gif' alt='' style='vertical-align: middle' />");
+		preg_match_all('/(\W?".*?")|(.*?)(\s|$)/', $this -> query, $boolean_keys);
+		sort($this -> keywords['split'] = array_unique(array_filter(str_replace('"', '', array_merge($boolean_keys[1], $boolean_keys[2])))));
+		foreach ($this -> keywords['split'] as $k_key => $key) {
+			if (!$this -> stopword($key)) {
+				if ($key{(strlen($key) - 1)} == '*') {
+					$this -> keywords['wildcard'][$k_key] = TRUE;
+					$key = substr($key, 0, -1);
+				} else {
+					$this -> keywords['wildcard'][$k_key] = FALSE;
+				}
+				if ($key{0} == '+') {
+					$this -> keywords['boolean'][$k_key] = '+';
+					$this -> keywords['match'][$k_key] = substr($key, 1);
+				} else if ($key{0} == '-') {
+					$this -> keywords['boolean'][$k_key] = '-';
+					$this -> keywords['match'][$k_key] = substr($key, 1);
+				} else {
+					$this -> keywords['boolean'][$k_key] = FALSE;
+					$this -> keywords['match'][$k_key] = $key;
+				}
+				$this -> keywords['exact'][$k_key] = (strpos($key, ' ') !== FALSE) ? TRUE : FALSE;
+				$this -> keywords['match'][$k_key] = $tp -> toDB($this -> keywords['match'][$k_key]);
+			} else {
+				unset ($this -> keywords['split'][$k_key]);
+			}
+		}
+	}
+
+	function parsesearch($table, $return_fields, $search_fields, $weights, $handler, $no_results, $where, $order) {
+		global $sql, $query, $tp, $search_prefs, $pre_title, $search_chars, $search_res, $result_flag;
+		$this -> query = $tp -> toDB($query);
+		if (!$search_prefs['mysql_sort']) {
+			$field_operator = 'AND ';
+			foreach ($this -> keywords['match'] as $k_key => $key) {
+				$boolean_regex = '';
+				if ($this -> keywords['boolean'][$k_key] == '+') {
+					$key_operator = 'OR ';
+					$break = TRUE;
+					$no_exact = TRUE;
+				} else if ($this -> keywords['boolean'][$k_key] == '-') {
+					foreach ($this -> keywords as $unset_key => $unset_value) {
+						unset($this -> keywords[$unset_key][$k_key]);
+					}
+					$key_operator = 'AND ';
+					$boolean_regex = 'NOT';
+					$no_exact = TRUE;
+				} else if (!isset($break)) {
+					$key_operator = 'OR ';
+					if (isset($switch)) {
+						$field_operator = 'OR ';
+					}
+					$switch = TRUE;
+				} else {
+					break;
+				}
+				$match_query .= isset($uninitial_field) ? " ".$field_operator." (" : "(";
+				$uninitial_field = TRUE;
+				if ($this -> keywords['wildcard'][$k_key] || !$search_prefs['boundary']) {
+					$wildcard = '';
+				} else {
+					$wildcard = '[[:>:]]';
+				}
+				$key_count = 1;
+				foreach ($search_fields as $field) {
+					$regexp = $search_prefs['boundary'] ? "[[:<:]]".$key.$wildcard : $key;
+					$match_query .= " ".$field." ".$boolean_regex." REGEXP '".$regexp."' ";
+					if ($key_count != count($search_fields)) {
+						$match_query .= $key_operator;
+					}
+					$key_count++;
+				}
+				$match_query .= ")";
+			}
+			if ($order) {
+				$sql_order = 'ORDER BY ';
+				$order_count = count($order);
+				$i = 1;
+				foreach ($order as $sort_key => $sort_value) {
+					$sql_order .= $sort_key.' '.$sort_value;
+					if ($i != $order_count) {
+						$sql_order .= ', ';
+					}
+					$i++;
+				}
+			} else {
+				$sql_order = '';
+			}
+			$limit = $search_prefs['php_limit'] ? ' LIMIT 0,'.$search_prefs['php_limit'] : '';
+			$sql_query = "SELECT ".$return_fields." FROM #".$table." WHERE ".$where." (".$match_query.") ".$sql_order.$limit.";";
+			if ((($keycount = count($this -> keywords['split'])) > 1) && (strpos($query, '"') === FALSE) && (!isset($no_exact))) {
+				$exact_query[] = $query;
+				$this -> keywords['split'] = array_merge($exact_query, $this -> keywords['split']);
+			}
+		} else {
+			$this -> query = str_replace('&quot;', '"', $this -> query);
+			$field_query = implode(',', $search_fields);
+			foreach ($search_fields as $field_key => $field) {
+				$search_query[] = "(".$weights[$field_key]." * (MATCH(".$field.") AGAINST ('".$this -> query."' IN BOOLEAN MODE)))";
+			}
+			$match_query = implode(' + ', $search_query);
+			$sql_order = '';
+			foreach ($order as $sort_key => $sort_value) {
+				$sql_order .= ', '.$sort_key.' '.$sort_value;
+			}
+			$limit = " LIMIT ".$result_flag.",".$search_res;
+			$sql_query = "SELECT SQL_CALC_FOUND_ROWS ".$return_fields.", (".$match_query.") AS relevance FROM #".$table." WHERE ".$where." ( MATCH(".$field_query.") AGAINST ('".$this -> query."' IN BOOLEAN MODE) ) HAVING relevance > 0 ORDER BY relevance DESC ".$sql_order.$limit.";";
+		}
+
+		if ($ps['results'] = $sql -> db_Select_gen($sql_query)) {
+			if (!$search_prefs['mysql_sort']) {
+				$x = 0;
+				foreach ($search_fields as $field_key => $field) {
+					$crop_fields[] = preg_replace('/(.*?)\./', '', $field);
+				}
+				while ($row = $sql -> db_Fetch()) {
+					$weight = 0;
+					foreach ($crop_fields as $field_key => $field) {
+						$this -> text = $row[$field];
+						foreach ($this -> keywords['match'] as $k_key => $this -> query) {
+							if (stristr($this -> text, $this -> query) !== FALSE) {
+								if ($this -> keywords['exact'][$k_key] || $this -> keywords['boolean'][$k_key]) {
+									$weight += (($weights[$field_key] * 2) * ($keycount));
+									$endweight = TRUE;
+								} else if (!$endweight) {
+									$weight += $weights[$field_key];
+								}
+							}
+						}
+						$endweight = FALSE;
+						
+					}
+					foreach ($row as $r_key => $r_value) {
+						$qrow[$x][$r_key] = $r_value;
+						$qrow[$x]['relevance'] = $weight;
+						$qrow[$x]['search_id'] = $x;
+					}
+					$x++;
+				}
+	
+				foreach($qrow as $info) {
+					$sortarr[] = $info['relevance'];
+				}
+				array_multisort($sortarr, SORT_DESC, $qrow, SORT_DESC);
+				
+				$result_number = ($x < ($result_flag + $search_res)) ? $x : $result_flag + $search_res;
+				for ($i = $result_flag; $i < $result_number; $i++) {
+					$display_row[] = $qrow[$i];
+				}
+
+			} else {
+				$x = 0;
+				while ($row = $sql -> db_Fetch()) {
+					$display_row[] = $row;
+					$x++;
+				}
+			}
+
+			foreach ($display_row as $row) {
+				$res = call_user_func($handler, $row);
+				if (!$res['omit_result']) {
+					$matches = array($res['title'], $res['summary']);
+					$endcrop = FALSE;
+					$output = '';
+					$title = TRUE;
+					foreach ($matches as $this -> text) {
+						$this -> text = nl2br($this -> text);
+						$t_search = $tp -> search;
+						$t_replace = $tp -> replace;
+						$s_search = array('<br />', '[', ']');
+						$s_replace = array(' ', '<', '>');
+						$search = array_merge($t_search, $s_search);
+						$replace = array_merge($t_replace, $s_replace);
+						$this -> text = strip_tags(str_replace($search, $replace, $this -> text));
+						foreach ($this -> keywords['match'] as $match_id => $this -> query) {
+							$boundary = $search_prefs['boundary'] ? '\b' : '';
+							if ($this -> keywords['wildcard'][$match_id]) {
+								$regex_append = ".*?".$boundary.")";
+							} else {
+								$regex_append = $boundary.")";	
+							}
+							if (($match_start = stristr($this -> text, $this -> query)) !== FALSE) {
+								$this -> pos = strlen($this -> text) - strlen($match_start);
+								if (!$endcrop && !$title) {
+									$this -> parsesearch_crop();
+									$endcrop = TRUE;
+								}
+								$key = substr($this -> text, $this -> pos, strlen($this -> query));
+								$this -> text = preg_replace("#(".$boundary.$this -> query.$regex_append."#i", "<span class='searchhighlight'>\\1</span>", $this -> text);
+							}
+						}
+						if ($title) {
+							if ($pre_title == 0) {
+								$pre_title_output = "";
+							} else if ($pre_title == 1) {
+								$pre_title_output = $res['pre_title'];
+							} else if ($pre_title == 2) {
+								$pre_title_output = $pre_title;
+							}
+							$this -> text = $this -> bullet." <b><a class='visit' href='".$res['link']."'>".$pre_title_output.$this -> text."</a></b><br />".$res['pre_summary'];
+						} else if (!$endcrop) {
+							$this -> parsesearch_crop();
+						}
+						$output .= $this -> text;
+						$title = FALSE;
+					}
+					$display_rel = $search_prefs['relevance'] ? " | ".LAN_SEARCH_69.": ".round($row['relevance'], 1) : "";
+					$output_array['text'][] = $output.$res['post_summary']."<br /><span class='smalltext'>".$res['detail'].$display_rel."</span><br /><br />";
+				} else {
+					$ps['results']--;
+					$res['omit_result'] = FALSE;
+				}
+			}
+			$ps_limit = $output_array['text'];
+			$result_number = ($x < $search_res) ? $x : $search_res;
+			for ($i = 0; $i < $result_number; $i++) {
+				$ps['text'] .= $ps_limit[$i];
+			}
+		} else {
+			$ps['text'] = $no_results;
+		}
+		if ($search_prefs['mysql_sort']) {
+			$sql -> db_Query("SELECT FOUND_ROWS()");
+			$frows = $sql -> db_Fetch();
+			$ps['results'] = $frows[0];
+		}
+		return $ps;
+	}
+	
+	function parsesearch_crop() {
+		global $search_chars;
+		if (strlen($this -> text) > $search_chars) {
+			if ($this -> pos < ($search_chars - strlen($this -> query))) {
+				$this -> text = substr($this -> text, 0, $search_chars)."...";
+			} else if ($this -> pos > (strlen($this -> text) - ($search_chars - strlen($this -> query)))) {
+				$this -> text = "...".substr($this -> text, (strlen($this -> text) - ($search_chars - strlen($this -> query))));
+			} else {
+				$this -> text = "...".substr($this -> text, ($this -> pos - round(($search_chars / 3))), $search_chars)."...";
+			}
+			$match_start = stristr($this -> text, $this -> query);
+			$this -> pos = strlen($this -> text) - strlen($match_start);
+		}
+	}
+	
+	function stopword($key) {
+		global $search_prefs;
+		if ($search_prefs['mysql_sort'] && ($key{0} == '+')) {
+			$key = substr($key, 1);
+		}
+		if (($key{(strlen($key) - 1)} != '*') && ($key{0} != '+')) {
+			if (strlen($key) > 2) {
+				if ($search_prefs['mysql_sort']) {
+					$stopword_list = $this -> stopwords_mysql;
+				} else {
+					$stopword_list = $this -> stopwords_php;
+				}
+				if (strpos($stopword_list, '|'.$key.'|') !== FALSE) {
+					$this -> stop_keys[] = $key;
+					return TRUE;
+				} else {
+					return FALSE;
+				}
+			} else {
+				$this -> stop_keys[] = $key;
+				return TRUE;
+			}
+		} else {
+			return FALSE;
+		}
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/secure_img_handler.php 75/e107_handlers/secure_img_handler.php
--- 6171/e107_handlers/secure_img_handler.php	2004-07-01 19:49:16.000000000 -0500
+++ 75/e107_handlers/secure_img_handler.php	2005-12-28 14:01:21.000000000 -0600
@@ -1,60 +1,69 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107_handlers/secure_img_handler.php
-|
-|	http://e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-class secure_image 
-{
-	var $random_number;
-
-	function secure_image() 
-  {
-		list($usec, $sec) = explode(" ", microtime());
-		$this -> random_number = str_replace(".","",$sec.$usec);
-	}
-	
-	function create_code()
-  {
-		global $pref, $sql, $IMAGES_DIRECTORY;
-		$imgp = SITEURL.$IMAGES_DIRECTORY;
-		mt_srand ((double)microtime()*1000000);
-		$maxran = 1000000;
-		$rand_num = mt_rand(0, $maxran);
-		$datekey = date("r");
-		$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . serialize($pref). $rand_num . $datekey));
-		$code = substr($rcode, 2, 6);
-		$recnum = $this -> random_number;
-		$del_time = time()+1200;
-		$sql -> db_Insert("tmp","'{$recnum}',{$del_time},'{$code},{$imgp}'");
-		return $recnum;
-	}
-
-	function verify_code($rec_num,$checkstr)
-  {
-		global $sql;
-		if($sql -> db_Select("tmp","tmp_info","tmp_ip = '{$rec_num}'"))
-    {
-			$row = $sql -> db_Fetch();
-			$sql -> db_Delete("tmp","tmp_ip = '{$rec_num}'");
-			list($code,$path) = explode(",",$row[0]);
-			return ($checkstr == $code);
-		}
-		return FALSE;
-	}
-
-	function r_image()
-  {
-		global $HANDLERS_DIRECTORY;
-		$code = $this -> create_code();
-		return "<img src='".e_BASE.$HANDLERS_DIRECTORY."secure_img_render.php?{$code}' alt='' />";
-	}
-}
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/secure_img_handler.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/28 20:01:21 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+class secure_image {
+	var $random_number;
+	 
+	function secure_image() {
+		list($usec, $sec) = explode(" ", microtime());
+		$this->random_number = str_replace(".", "", $sec.$usec);
+	}
+	 
+	function create_code() {
+		global $pref, $sql, $IMAGES_DIRECTORY, $HANDLERS_DIRECTORY;
+
+		require_once('e107_class.php');
+		$e107 = new e107(false, false);
+		$e107->set_paths();
+
+		$imgpy = str_replace($HANDLERS_DIRECTORY, "", $e107->file_path);
+
+		$imgp = $imgpy.$IMAGES_DIRECTORY;
+		mt_srand ((double)microtime() * 1000000);
+		$maxran = 1000000;
+		$rand_num = mt_rand(0, $maxran);
+		$datekey = date("r");
+		$rcode = hexdec(md5($_SERVER[HTTP_USER_AGENT] . serialize($pref). $rand_num . $datekey));
+		$code = substr($rcode, 2, 6);
+		$recnum = $this->random_number;
+		$del_time = time()+1200;
+		$sql->db_Insert("tmp", "'{$recnum}',{$del_time},'{$code},{$imgp}'");
+		return $recnum;
+	}
+	 
+	function verify_code($rec_num, $checkstr) {
+		global $sql, $tp;
+		if ($sql->db_Select("tmp", "tmp_info", "tmp_ip = '".$tp -> toDB($rec_num)."'")) {
+			$row = $sql->db_Fetch();
+			$sql->db_Delete("tmp", "tmp_ip = '".$tp -> toDB($rec_num)."'");
+			list($code, $path) = explode(",", $row[0]);
+			return ($checkstr == $code);
+		}
+		return FALSE;
+	}
+	 
+	function r_image() {
+		global $HANDLERS_DIRECTORY;
+		$code = $this->create_code();
+		return "<img src='".e_BASE.$HANDLERS_DIRECTORY."secure_img_render.php?{$code}' alt='' />";
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/secure_img_render.php 75/e107_handlers/secure_img_render.php
--- 6171/e107_handlers/secure_img_render.php	2004-07-01 19:37:10.000000000 -0500
+++ 75/e107_handlers/secure_img_render.php	2005-12-17 10:04:20.000000000 -0600
@@ -1,86 +1,98 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107_handlers/secure_img_render.php
-|
-|	http://e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-while (list($global) = each($GLOBALS))
-{
-	if (!preg_match('/^(_SERVER|GLOBALS)$/', $global))
-  {
-		unset($$global);
-	}
-}
-unset($global);
-$imgtypes=array("jpeg", "png", "gif");
-
-define("e_QUERY", eregi_replace("&|/?PHPSESSID.*", "", $_SERVER['QUERY_STRING']));
-$recnum = preg_replace("#\D#","",e_QUERY);
-if(!$recnum)
-{
-  exit;
-}
-@include("e107_config.php");
-$a=0;
-$p="";
-
-while(!$mySQLserver && $a<5)
-{
-	$a++;
-	$p.="../";
-	@include($p."e107_config.php");
-}
-mysql_connect($mySQLserver, $mySQLuser, $mySQLpassword);
-mysql_select_db($mySQLdefaultdb);
-$result = mysql_query("SELECT tmp_info FROM {$mySQLprefix}tmp WHERE tmp_ip = '{$recnum}'");
-if(!$row = mysql_fetch_array($result))
-{
-  exit;
-}
-
-list($code,$url) = explode(",",$row['tmp_info']);
-$type="none";
-foreach($imgtypes as $t)
-{
-	if(function_exists("imagecreatefrom".$t)){
-		$type = $t;
-		break;
-	}
-}
-switch($type)
-{
-	case "jpeg":
-		$image = ImageCreateFromJPEG($url."generic/code_bg.jpg");
-		break;
-	case "png":
-		$image = ImageCreateFromPNG($url."generic/code_bg.png");
-		break;
-	case "gif":
-		$image = ImageCreateFromGIF($url."generic/code_bg.gif");
-		break;
-}
-$text_color = ImageColorAllocate($image, 80, 80, 80);
-ob_clean();
-Header("Content-type: image/{$type}");
-ImageString ($image, 5, 12, 2, $code, $text_color);
-switch($type)
-{
-	case "jpeg":
-		ImageJPEG($image,'',75);
-		break;
-	case "png":
-		ImagePNG($image,'',75);
-		break;
-	case "gif":
-		ImageGIF($image,'',75);
-		break;
-}
-ImageDestroy($image);
-die();
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/secure_img_render.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2005/12/17 16:04:20 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+
+while (list($global) = each($GLOBALS))
+{
+	if (!preg_match('/^(_SERVER|GLOBALS)$/', $global)) {
+		unset($$global);
+	}
+}
+unset($global);
+$imgtypes = array("jpeg", "png", "gif");
+
+define("e_QUERY", preg_replace("#&|/?PHPSESSID.*#i", "", $_SERVER['QUERY_STRING']));
+$recnum = preg_replace("#\D#", "", e_QUERY);
+if (!$recnum) {
+	exit;
+}
+
+$mySQLserver = "";
+
+@include_once(dirname(__FILE__)."e107_config.php");
+$a = 0;
+$p = "";
+
+while (!$mySQLserver && $a < 5) {
+	$a++;
+	$p .= "../";
+	@include_once($p."e107_config.php");
+}
+mysql_connect($mySQLserver, $mySQLuser, $mySQLpassword);
+mysql_select_db($mySQLdefaultdb);
+$result = mysql_query("SELECT tmp_info FROM {$mySQLprefix}tmp WHERE tmp_ip = '{$recnum}'");
+if (!$row = mysql_fetch_array($result)) {
+	exit;
+}
+
+list($code, $url) = explode(",", $row['tmp_info']);
+$type = "none";
+foreach($imgtypes as $t)
+{
+	if (function_exists("imagecreatefrom".$t))
+	{
+		$type = $t;
+		break;
+	}
+}
+
+$path = realpath(dirname(__FILE__)."/../")."/".$IMAGES_DIRECTORY;
+
+switch($type)
+{
+	case "jpeg":
+		$image = ImageCreateFromJPEG($path."generic/code_bg.jpg");
+		break;
+	case "png":
+		$image = ImageCreateFromPNG($path."generic/code_bg.png");
+		break;
+	case "gif":
+		$image = ImageCreateFromGIF($path."generic/code_bg.gif");
+		break;
+}
+$text_color = ImageColorAllocate($image, 80, 80, 80);
+//ob_clean();
+
+header("Content-type: image/".$type);
+ImageString ($image, 5, 12, 2, $code, $text_color);
+switch($type)
+{
+	case "jpeg":
+		ImageJPEG($image, '', 75);
+		break;
+	case "png":
+		ImagePNG($image, '', 75);
+		break;
+	case "gif":
+		ImageGIF($image, '', 75);
+		break;
+}
+ImageDestroy($image);
+die();
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/security_handler.php 75/e107_handlers/security_handler.php
--- 6171/e107_handlers/security_handler.php	2004-03-30 16:39:56.000000000 -0600
+++ 75/e107_handlers/security_handler.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,248 +0,0 @@
-<?php
-
-#############################################################################
-#
-# Cafe CounterIntelligence SoapCMS Core Security Class
-# Copyright 2004 Mike Parniak
-# www.cafecounterintelligence.com
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# Purpose: Base flood, XSS and SQL Injection protection
-#
-# Requires: Nothing.
-#
-# Usage: create an instance of the soapSecurity object at the beginning of
-#                 any publically accessible scripts.  GET, POST, and COOKIE variables
-#                 that are strictly numeric should begin with "n_".
-#
-#############################################################################
-// example usage in class2.php:
-// require_once(e_HANDLER."security_handler.php");
-// $mysecurity = new soapSecurity();
-
-
-
-class soapSecurity {
-
-  var $ip;
-  var $csUn                        = "Soap";
-  var $vkeyname;
-  var $vhash;
-  var $vsession;
-  var $vsesscook;
-
-  // Initialization function
-
-  function soapSecurity($dosanitize = 1) {
-
-    ini_set("session.use_only_cookies","1");
-    ini_set("session.use_trans_sid","0");
-
-    $ip = $_SERVER["REMOTE_ADDR"];
-    $vkeyname = md5($_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_HOST"] . $_SERVER["DOCUMENT_ROOT"] . $csUn);
-    $vhash = md5($_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_USER_AGENT"] .
-                                                $_SERVER["HTTP_HOST"] . $_SERVER["DOCUMENT_ROOT"] .
-                                                $_SERVER["SERVER_SOFTWARE"] . $_SERVER["PATH"] . $csUn);
-         $vsession = md5($_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_HOST"] . $csUn);
-         $vsesscook = md5($_SERVER["REMOTE_ADDR"] . $_SERVER["DOCUMENT_ROOT"] . $_SERVER["HTTP_HOST"]);
-
-          srand(time());
-        session_name($vhash);
-        session_id($vsession);        // Begin data-specific session
-    session_start();
-
-    if ((!isset($_SESSION["soapsec-rtg"])) || ($_SESSION["soapsec-rtg"]<1)) {
-            $_SESSION["soapsec-rtg"] = rand(3,5);
-      $_SESSION["soapsec-romps"] = 0;
-      $_SESSION["soapsec-ourl"] = $_SERVER["REQUEST_URI"];
-      $_SESSION["soapsec-rcode"] = md5($_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_USER_AGENT"] .
-                                $_SERVER["HTTP_HOST"] . $_SERVER["DOCUMENT_ROOT"] .
-                                $_SERVER["SERVER_SOFTWARE"] . $_SERVER["PATH"] . $_SESSION["soapsec-romps"] . time());
-    }
-
-    if (($_SESSION["soapsec-rtg"]>0) && ($_SESSION["soapsec-romps"]<$_SESSION["soapsec-rtg"])) {
-      if (($_GET[$vkeyname] == $_SESSION["soapsec-rcode"]) && ($_GET[$vkeyname] != "")) {
-        $_SESSION["soapsec-romps"]++;
-      } else $_SESSION["soapsec-errors"]+=2;
-      if ($_SESSION["soapsec-romps"] < $_SESSION["soapsec-rtg"]) {
-        $_SESSION["soapsec-rcode"] = md5($_SERVER["REMOTE_ADDR"] . $_SERVER["HTTP_USER_AGENT"] .
-                        $_SERVER["HTTP_HOST"] . $_SERVER["DOCUMENT_ROOT"] .
-                        $_SERVER["SERVER_SOFTWARE"] . $_SERVER["PATH"] . $_SESSION["soapsec-romps"] . time());
-                $numromps = $_SESSION["soapsec-romps"];
-        session_write_close();
-        $thisurl = $_SERVER["REQUEST_URI"];
-        $thisurl = eregi_replace("\?.*","",$thisurl);
-        $thisurl = "http://" . $_SERVER["HTTP_HOST"] . $thisurl . "?";
-        $outkey = $vkeyname . "=" . $_SESSION["soapsec-rcode"];
-
-            // First romp is less CPU intensive, in cases of weak automated requesters.
-
-        if ($numromps==1) {
-          header("Location: " . $thisurl . $outkey);
-          exit();
-        }
-
-        // Subsequent romps are tricky, using hard-to-parse javascript.
-
-            $rnu = rand(8,15);
-            $ran = array();
-            $jsout = "<SCRIPT LANGUAGE=\"JavaScript\">\n";
-            for ($i = 0;$i < $rnu;$i++) {
-                $ran[$i] = rand(-65,65);
-          $jsout .= "var " . chr(97+$i) . " = " . $ran[$i] . "; ";
-        }
-
-        $outlen = strlen($outkey);
-
-        $jsout .= "var z = new Array(); ";
-        $myvars = array();
-
-        $onvar = 0;
-        for ($i = 0;$i < $outlen;$i++) {
-          if ($onvar >= $rnu) $onvar = 0;
-          $thediff = $i - $ran[$onvar];
-                $myvars[$i] = "z[" . chr(97+$onvar);
-          if ($thediff>0) $myvars[$i].= "+";
-          if ($thediff<>0) $myvars[$i] .= $thediff;
-          $myvars[$i] .= "] = \"" . $outkey[$i] . "\"; ";
-          $onvar++;
-        }
-        shuffle($myvars);
-        $jsout .= implode('',$myvars);
-        $jsout .= "var x = z.join(\"\"); ";
-        $jsout .= "location.replace(\"" . $thisurl . "\" + x);</SCRIPT><noscript>You must enable Javascript in order to view this webpage.</noscript>";
-        echo $jsout;
-      } else {
-        $thisurl = "http://" . $_SERVER["HTTP_HOST"] . $_SESSION["soapsec-ourl"];
-        echo "<SCRIPT LANGUAGE=\"JavaScript\">location.replace(\"$thisurl\");</SCRIPT><noscript>You must enable Javascript in order to view this webpage.</noscript>";
-      }
-      exit();
-    }
-
-    if ($dosanitize) {
-
-      $getvariables = array_keys($_GET);
-      $count = 0;
-      while($count < count($getvariables)) {
-        $_GET[$getvariables[$count]] = $this -> sanitize($_GET[$getvariables[$count]],(strpos($getvariables[$count],"n_")===0));
-        $count++;
-      }
-      $getvariables = array_keys($_POST);
-      $count = 0;
-      while($count < count($getvariables)) {
-        $_POST[$getvariables[$count]] = $this -> sanitize($_POST[$getvariables[$count]],(strpos($getvariables[$count],"n_")===0));
-        $count++;
-      }
-      $getvariables = array_keys($_COOKIE);
-      $count = 0;
-      while($count < count($getvariables)) {
-        $_COOKIE[$getvariables[$count]] = $this -> sanitize($_COOKIE[$getvariables[$count]],(strpos($getvariables[$count],"n_")===0));
-        $count++;
-      }
-    }
-
-    // If server has automatic global creation, destroy automatically created variables.
-    // but... make sure that the variable's value matches the request variable's value before destroying it.
-
-    $getvariables = array_keys($_REQUEST);
-    $count = 0;
-    while($count < count($getvariables)) {
-      if ((isset($getvariables[$count])) && ($GLOBALS[$getvariables[$count]] == $_REQUEST[$getvariables[$count]])) {
-        unset($GLOBALS[$getvariables[$count]]);
-      }
-      $count++;
-    }
-
-    // Remove our session and initiate or restore the user session.
-
-    if (isset($_COOKIE["$vsesscook"])) {
-      session_write_close();
-      session_name($vsesscook);
-          session_id($_COOKIE["$vsesscook"]);
-      session_start();
-      if (!isset($_SESSION["soap-flag"])) {
-        setcookie($vsesscook,"",0,"/");
-        session_unset();
-        session_destroy();
-        unset($_COOKIE["$vsesscook"]);
-        Header("Location: http://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
-        exit();
-      }
-    } else {
-      if ((time()-120)<$_SESSION["soapsec-lastsess"]) {
-        if ($_SESSION["soapsec-fastsess"]>2) {
-          $_SESSION["soapsec-lastsess"] = time();
-          exit();
-        }
-      } else $_SESSION["soapsec-fastsess"] = 0;
-
-      $_SESSION["soapsec-lastsess"] = time();
-      $_SESSION["soapsec-fastsess"]++;
-      session_write_close;
-      session_name($vsesscook);
-      session_id(md5(uniqid(time())));
-      session_start();
-      setcookie($vsesscook,session_id(),0,"/");
-      $_SESSION["soap-flag"] = 1;
-    }
-
-    if ($this -> floodcheck("fastaccess",3,6)) exit();
-
-    return;
-  }
-
-  // Removes potentially hazardous material from a string (anti-XSS, anti-Injection)
-  // Reliable anti-injection requires cgi variables use the n_ naming convention for any
-  // variable that is strictly numeric and possibly used in a query.
-
-  function sanitize($tosanitize,$numonly=FALSE) {
-    if ($numonly) {
-      $tosanitize = eregi_replace("[^0-9\.\-]","",$tosanitize);
-    } else {
-      $tosanitize = htmlspecialchars($tosanitize);
-      $tosanitize = eregi_replace("javascript:","java&#00;script:",$tosanitize);
-      if (!get_magic_quotes_gpc()) $tosanitize = addslashes($tosanitize);
-    }
-    return $tosanitize;
-  }
-
-  // Generic flood checking routine
-
-  function floodcheck($identifier,$interval,$threshold=1) {
-    $myresult = 0;
-    if (isset($_SESSION["soapsec-" . $identifier])) {
-      if ($_SESSION["soapsec-" . $identifier] > (time()-$interval)) {
-        if ($threshold<2) {
-          $myresult = 1;
-        } else {
-          if (!isset($_SESSION["soapsec-" . $identifier . "-counter"])) {
-            $_SESSION["soapsec-" . $identifier . "-counter"] = 1;
-          } else {
-            $_SESSION["soapsec-" . $identifier . "-counter"]++;
-            if ($_SESSION["soapsec-" . $identifier . "-counter"] >= $threshold) {
-              $myresult = 1;
-            }
-          }
-        }
-      } else $_SESSION["soapsec-" . $identifier . "-counter"] = 1;
-    }
-    $_SESSION["soapsec-" . $identifier] = time();
-    return $myresult;
-  }
-
-
-
-}
\ No newline at end of file
diff -ruN 6171/e107_handlers/session_handler.php 75/e107_handlers/session_handler.php
--- 6171/e107_handlers/session_handler.php	2004-03-03 12:23:48.000000000 -0600
+++ 75/e107_handlers/session_handler.php	2006-01-03 09:53:12.000000000 -0600
@@ -1,111 +1,118 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/classes/session_handler..php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-function sess_open($save_path, $session_name){
-	global $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $mySQLprefix, $session_connection;
-	$session_connection = mysql_pconnect($mySQLserver, $mySQLuser, $mySQLpassword);
-	mysql_select_db($mySQLdefaultdb, $session_connection);
-	return true;
-}
-
-function sess_close(){
-	return true;
-}
-
-
-function sess_read($session_id){
-	global $session_connection, $session_lifetime, $mySQLprefix, $session_read;
-	if($result = mysql_query("SELECT * FROM ".$mySQLprefix."session WHERE session_id = '$session_id' AND session_expire > " . time(), $session_connection)){
-		$session_read = mysql_fetch_assoc($result);
-		return $session_read['session_data'];
-	}else{
-		return FALSE;
-	}
-}
-
-function sess_write($session_id, $session_data){
-	if(!$session_data){ return FALSE; }
-	global $session_connection, $session_lifetime, $mySQLprefix, $session_read;
-	$expiry = time() + $session_lifetime;
-	if($session_read && $session_read['session_ip'] != get_full_ip()){
-		session_destroy();
-        die("Invalid session ID");
-	}
-	if(version_compare(phpversion(), "4.3.0", "<")){
-        $_session_data = mysql_escape_string($session_data);
-    }else{
-        $_session_data = mysql_real_escape_string($session_data);
-    }
-
-	if($session_read){
-		$query = "UPDATE ".$mySQLprefix."session SET session_expire = $expiry, session_data = '$_session_data' WHERE session_id = '$session_id' AND session_expire > " . time();
-		$result = mysql_query($query, $session_connection);
-	}else{
-		$query = "INSERT INTO ".$mySQLprefix."session VALUES ('$session_id', $expiry, ".time().", '".get_full_ip()."', '$_session_data')";
-		$result= mysql_query($query, $session_connection);
-	}
-	return TRUE;
-}
-
-function sess_destroy($session_id){
-	global $session_connection, $mySQLprefix;
-	$query = "DELETE FROM ".$mySQLprefix."session WHERE session_id = '$session_id'";
-	$result = mysql_query($query, $session_connection);
-	return TRUE;
-}
-
-function sess_gc($session_lifetime){
-	global $session_connection, $mySQLprefix;
-	$query = "DELETE FROM ".$mySQLprefix."session WHERE session_expire < " . time();
-	$result = mysql_query($query, $session_connection);
-//	Uncomment the foolowing lines if you want garbage collection logged ...
-//	$fp =fopen('gc.txt',ab);
-//	fwrite ($fp,"DELETE FROM ".$mySQLprefix."session WHERE session_expire < " .time()."\n");
-//	fclose($fp);
-	return mysql_affected_rows($session_connection);
-}
-
-function get_full_ip(){
-	$ip_addr = getip();
-	$tmp = $_SERVER['REMOTE_ADDR'];
-	$ip_resolved = gethostbyaddr($tmp);
-	$tmp2 = ($tmp != $ip_resolved && $ip_resolved ? $tmp." - ". $ip_resolved : $tmp2 = $tmp);
-	$full_ip = ($ip_addr != $tmp ? "$ip_addr | $tmp2" : $tmp2);
-	return $full_ip;
-}
-
-session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc");
-
-ini_set ( "session.save_handler", "user" );
-$session_cookie_lifetime = 0;
-$session_cookie_path = '/';
-$session_cookie_domain = '';
-$session_cache_expire = 60*24*30;
-//$session_lifetime = ini_get("session.gc_maxlifetime");
-$session_lifetime = 60*24*30;
-session_name("PHPSESSID");
-if($_SERVER["HTTPS"] == "on"){ $session_cookie_secure = true; }
-session_set_cookie_params($session_cookie_lifetime, $session_cookie_path, $session_cookie_domain, $session_cookie_secure);
-if(version_compare(phpversion(), "4.3.0", ">=")) ini_set ( "session.use_only_cookies", $session_use_only_cookies );
-if(version_compare(phpversion(), "4.2.0", ">=")) session_cache_expire ($session_cache_expire);
-ini_set ("session.url_rewriter.tags", 'a=href,area=href,frame=src,input=src,form=fakeentry');
-
-if($sql -> db_Select("session", "session_id", "session_ip='".get_full_ip()."' ")){
-	$row = $sql -> db_Fetch();
-	session_id($row['session_id']);
-}
-
-session_start();
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/session_handler.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2006/01/03 15:53:12 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+function sess_open($save_path, $session_name) {
+	global $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $mySQLprefix, $session_connection;
+	if(defined("USE_PERSISTANT_DB") && USE_PERSISTANT_DB == true){
+		$session_connection = mysql_pconnect($mySQLserver, $mySQLuser, $mySQLpassword);
+	} else {
+		$session_connection = mysql_connect($mySQLserver, $mySQLuser, $mySQLpassword);
+	}
+	mysql_select_db($mySQLdefaultdb, $session_connection);
+	return true;
+}
+
+function sess_close() {
+	return true;
+}
+
+
+function sess_read($session_id) {
+	global $session_connection, $session_lifetime, $mySQLprefix, $session_read;
+	if ($result = mysql_query("SELECT * FROM ".$mySQLprefix."session WHERE session_id = '$session_id' AND session_expire > " . time(), $session_connection)) {
+		$session_read = mysql_fetch_assoc($result);
+		return $session_read['session_data'];
+	} else {
+		return FALSE;
+	}
+}
+
+function sess_write($session_id, $session_data) {
+	if (!$session_data) {
+		return FALSE;
+	}
+	global $session_connection, $session_lifetime, $mySQLprefix, $session_read;
+	$expiry = time() + $session_lifetime;
+	if ($session_read && $session_read['session_ip'] != get_full_ip()) {
+		session_destroy();
+		die("Invalid session ID");
+	}
+	$_session_data = mysql_real_escape_string($session_data);
+	if ($session_read) {
+		$query = "UPDATE ".$mySQLprefix."session SET session_expire = $expiry, session_data = '$_session_data' WHERE session_id = '$session_id' AND session_expire > " . time();
+		$result = mysql_query($query, $session_connection);
+	} else {
+		$query = "INSERT INTO ".$mySQLprefix."session VALUES ('$session_id', $expiry, ".time().", '".get_full_ip()."', '$_session_data')";
+		$result = mysql_query($query, $session_connection);
+	}
+	return TRUE;
+}
+
+function sess_destroy($session_id) {
+	global $session_connection, $mySQLprefix;
+	$query = "DELETE FROM ".$mySQLprefix."session WHERE session_id = '$session_id'";
+	$result = mysql_query($query, $session_connection);
+	return TRUE;
+}
+
+function sess_gc($session_lifetime) {
+	global $session_connection, $mySQLprefix;
+	$query = "DELETE FROM ".$mySQLprefix."session WHERE session_expire < " . time();
+	$result = mysql_query($query, $session_connection);
+	return mysql_affected_rows($session_connection);
+}
+
+function get_full_ip() {
+	global $e107;
+	$ip_addr = $e107->getip();
+	$tmp = $_SERVER['REMOTE_ADDR'];
+	$ip_resolved = $e107->get_host_name($tmp);
+	$tmp2 = ($tmp != $ip_resolved && $ip_resolved ? $tmp." - ". $ip_resolved : $tmp2 = $tmp);
+	$full_ip = ($ip_addr != $tmp ? "$ip_addr | $tmp2" : $tmp2);
+	return $full_ip;
+}
+
+session_set_save_handler("sess_open", "sess_close", "sess_read", "sess_write", "sess_destroy", "sess_gc");
+
+ini_set ("session.save_handler", "user" );
+$session_cookie_lifetime = 0;
+$session_cookie_path = '/';
+$session_cookie_domain = '';
+$session_cache_expire = 60 * 24 * 30;
+//$session_lifetime = ini_get("session.gc_maxlifetime");
+$session_lifetime = 60 * 24 * 30;
+session_name("PHPSESSID");
+if ($_SERVER["HTTPS"] == "on") {
+	$session_cookie_secure = true;
+}
+session_set_cookie_params($session_cookie_lifetime, $session_cookie_path, $session_cookie_domain, $session_cookie_secure);
+if (version_compare(phpversion(), "4.3.0", ">=")) ini_set ("session.use_only_cookies", $session_use_only_cookies );
+if (version_compare(phpversion(), "4.2.0", ">=")) session_cache_expire ($session_cache_expire);
+ini_set ("session.url_rewriter.tags", 'a=href,area=href,frame=src,input=src,form=fakeentry');
+
+if ($sql->db_Select("session", "session_id", "session_ip='".get_full_ip()."' ")) {
+	$row = $sql->db_Fetch();
+	session_id($row['session_id']);
+}
+
+session_start();
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/shortcode_handler.php 75/e107_handlers/shortcode_handler.php
--- 6171/e107_handlers/shortcode_handler.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/shortcode_handler.php	2006-02-17 10:20:42.000000000 -0600
@@ -0,0 +1,192 @@
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+| e107 website system
+|
+| Steve Dunstan 2001-2002
+| http://e107.org
+| jalist@e107.org
+|
+| Released under the terms and conditions of the
+| GNU General Public License (http://gnu.org).
+|
+| $Source: /cvsroot/e107/e107_0.7/e107_handlers/shortcode_handler.php,v $
+| $Revision: 1.29 $
+| $Date: 2006/02/17 16:20:42 $
+| $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if (!isset($tp) || !is_object($tp -> e_sc)) {
+	$tp->e_sc = new e_shortcode;
+}
+
+class e_shortcode {
+	var $scList;
+	var $parseSCFiles;
+	var $addedCodes;
+	var $registered_codes;
+
+	function e_shortcode()
+	{
+		global $pref, $register_sc;
+		if($pref['plug_sc'] != '')
+		{
+			$tmp = explode(',',$pref['plug_sc']);
+			foreach($tmp as $val)
+			{
+				list($code, $path) = explode(':',$val);
+				$this->registered_codes[$code]['type'] = 'plugin';
+				$this->registered_codes[$code]['path'] = $path;
+			}
+		}
+		if(isset($register_sc) && is_array($register_sc))
+		{
+			foreach($register_sc as $code)
+			{
+				$this->registered_codes[$code]['type'] = 'theme';
+			}
+		}
+	}
+
+	function parseCodes($text, $useSCFiles = TRUE, $extraCodes = '') {
+		$this->parseSCFiles = $useSCFiles;
+		$ret = '';
+		if (is_array($extraCodes)) {
+			foreach($extraCodes as $sc => $code) {
+				$this->scList[$sc] = $code;
+			}
+		}
+		$tmp = explode("\n", $text);
+		foreach($tmp as $line) {
+			if (preg_match("/{.+?}/", $line, $match)) {
+				$ret .= preg_replace_callback("/\{(.*?)\}/", array($this, 'doCode'), $line);
+			} else {
+				$ret .= $line;
+			}
+		}
+		return $ret;
+	}
+
+	function doCode($matches)
+	{
+		global $pref, $e107cache, $menu_pref, $sc_style, $parm;
+		if (strpos($matches[1], '='))
+		{
+			list($code, $parm) = explode("=", $matches[1], 2);
+		}
+		else
+		{
+			$code = $matches[1];
+			$parm = '';
+		}
+		$parm = trim($parm);
+
+		if (E107_DEBUG_LEVEL)
+		{
+			global $db_debug;
+			$db_debug->logCode(2, $code, $parm, "");
+		}
+
+		if (is_array($this->scList) && array_key_exists($code, $this->scList))
+		{
+			$shortcode = $this->scList[$code];
+		}
+		else
+		{
+			if ($this->parseSCFiles == TRUE)
+			{
+				if (is_array($this -> registered_codes) && array_key_exists($code, $this->registered_codes))
+				{
+					if($this->registered_codes[$code]['type'] == 'plugin')
+					{
+						$scFile = e_PLUGIN.strtolower($this->registered_codes[$code]['path']).'/'.strtolower($code).'.sc';
+					}
+					else
+					{
+						$scFile = THEME.strtolower($code).'.sc';
+					}
+				}
+				else
+				{
+						$scFile = e_FILE."shortcode/".strtolower($code).".sc";
+				}
+				if (file_exists($scFile)) {
+					$shortcode = file_get_contents($scFile);
+					$this->scList[$code] = $shortcode;
+				}
+			}
+		}
+
+        if(E107_DEBUG_LEVEL == 5){
+			echo " sc= ".str_replace(e_FILE."shortcode/","",$scFile)."<br />";
+		}
+
+		global $e107_debug;
+		if($e107_debug)
+		{
+			trigger_error("starting shortcode {".$code."}", E_USER_ERROR);
+		}
+		$ret = (isset($shortcode) ? eval($shortcode) : "");
+
+		if($ret != '')
+		{
+			if(isset($sc_style) && is_array($sc_style) && array_key_exists($code,$sc_style))
+			{
+				if(isset($sc_style[$code]['pre']))
+				{
+					$ret = $sc_style[$code]['pre'].$ret;
+				}
+				if(isset($sc_style[$code]['post']))
+				{
+					$ret = $ret.$sc_style[$code]['post'];
+				}
+			}
+		}
+		return $ret;
+	}
+
+	function parse_scbatch($fname, $type = 'file') {
+		$ret = array();
+		if($type == 'file')
+		{
+			$sc_batch = file($fname);
+		}
+		else
+		{
+			$sc_batch = $fname;
+		}
+		$cur_sc = '';
+		foreach($sc_batch as $line) {
+			if (trim($line) == 'SC_END') {
+				$cur_sc = '';
+			}
+			if ($cur_sc && !$override) {
+				$ret[$cur_sc] .= $line;
+			}
+			if (preg_match("#^SC_BEGIN (\w*).*#", $line, $matches)) {
+				$cur_sc = $matches[1];
+				$ret[$cur_sc]='';
+				if (is_array($this -> registered_codes) && array_key_exists($cur_sc, $this -> registered_codes)) {
+					if ($this -> registered_codes[$cur_sc]['type'] == 'plugin') {
+						$scFile = e_PLUGIN.strtolower($this -> registered_codes[$cur_sc]['path']).'/'.strtolower($cur_sc).'.sc';
+					} else {
+						$scFile = THEME.strtolower($cur_sc).'.sc';
+					}
+					if (is_readable($scFile)) {
+						$ret[$cur_sc] = file_get_contents($scFile);
+					}
+					$override = TRUE;
+				} else {
+					$override = FALSE;
+				}
+			}
+		}
+		return $ret;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitelinks_class.php 75/e107_handlers/sitelinks_class.php
--- 6171/e107_handlers/sitelinks_class.php	2005-05-12 23:16:14.000000000 -0500
+++ 75/e107_handlers/sitelinks_class.php	2006-04-22 23:54:09.000000000 -0500
@@ -1,162 +1,331 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /sitelinks_class.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-@include(e_LANGUAGEDIR.e_LAN."/lan_sitelinks.php");
-@include(e_LANGUAGEDIR."English/lan_sitelinks.php");
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-function sitelinks(){
-	/*
-	# Render style links
-	# - parameters                none
-	# - return                                parsed text
-	# - scope                                        null
-	*/
-	global $pref,$ns;
-
-	if($cache = retrieve_cache("sitelinks")){
-		$aj = new textparse;
-		echo $aj -> formtparev($cache);
-		return;
-	}
-	ob_start();
-
-
-	if(LINKDISPLAY == 4){
-		require_once(e_PLUGIN."ypslide_menu/ypslide_menu.php");
-		return;
-	}
-
-	define(PRELINKTITLE, "");
-	define(POSTLINKTITLE, "");
-	$menu_count=0;
-	$text = PRELINK;
-	if(defined("LINKCLASS")){
-		$linkadd = " class='".LINKCLASS."' ";
-	}
-	/*
-	if(ADMIN == TRUE){
-	$linkstart = (file_exists(e_IMAGE."link_icons/admin.png") ? preg_replace("/\<img.*\>/si", "", LINKSTART)." " : LINKSTART);
-	if(LINKDISPLAY != 3) {
-	$text .= $linkstart.(file_exists(e_IMAGE."link_icons/admin.png") ? "<img src='".e_IMAGE."link_icons/admin.png' alt='' style='vertical-align:middle' /> " : "")."<a".$linkadd." href=\"".e_ADMIN.(!$pref['adminstyle'] || $pref['adminstyle'] == "default" ? "admin.php" : $pref['adminstyle'].".php")."\">".LAN_502."</a>".LINKEND."\n";
-	} else {
-	$menu_main .= $linkstart.(file_exists(e_IMAGE."link_icons/admin.png") ? "<img src='".e_IMAGE."link_icons/admin.png' alt='' style='vertical-align:middle' /> " : "")."<a".$linkadd." href=\"".e_ADMIN.(!$pref['adminstyle'] || $pref['adminstyle'] == "default" ? "admin.php" : $pref['adminstyle'].".php")."\">".LAN_502."</a>".LINKEND."\n";
-	}
-	}
-	*/
-	$sql = new db; $sql2 = new db;
-	$sql -> db_Select("links", "*", "link_category='1' && link_name NOT REGEXP('submenu') ORDER BY link_order ASC");
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		if(!$link_class || check_class($link_class))
-		{
-			if(!preg_match("#(http:|mailto:|ftp:)#",$link_url)){ $link_url = e_BASE.$link_url; }
-			$linkstart = ($link_button ? preg_replace("/\<img.*\>/si", "", LINKSTART) : LINKSTART);
-			switch ($link_open) {
-				case 1:
-				$link_append = " rel='external'";
-				break;
-				case 2:
-				$link_append = "";
-				break;
-				case 3:
-				$link_append = "";
-				break;
-				default:
-				unset($link_append);
-			}
-
-			if($link_open == 4){
-				$_link =  $linkstart.($link_button ? "<img src='".e_IMAGE."link_icons/$link_button' alt='' style='vertical-align:middle' /> " : "").($link_url ? "<a".$linkadd.($pref['linkpage_screentip'] ? " title = '$link_description' " : "")." href=\"javascript:open_window('".$link_url."')\">".$link_name."</a>" : $link_name)."\n";
-			}else{
-			$_link =  $linkstart.($link_button ? "<img src='".e_IMAGE."link_icons/$link_button' alt='' style='vertical-align:middle' /> " : "").($link_url ? "<a".$linkadd.($pref['linkpage_screentip'] ? " title = '$link_description' " : "")." href=\"".$link_url."\"".$link_append.">".$link_name."</a>" : $link_name)."\n";
-		}
-		if(LINKDISPLAY == 3){
-			$menu_title=$link_name;
-		} else {
-			$text .= $_link.LINKEND;
-		}
-
-		if($sql2 -> db_Select("links", "*", "link_name REGEXP('submenu.".$link_name."') ORDER BY link_order ASC") && !HIDESUBSECTIONS){
-			$menu_count++;
-			$main_linkname = $link_name;
-			while($row = $sql2 -> db_Fetch()){
-				extract($row);
-				$link_name = str_replace("submenu.".$main_linkname.".", "", $link_name);
-				if(check_class($link_class))
-				{
-					$linkstart = ($link_button ? preg_replace("/\<img.*\>/si", "", LINKSTART)." " : LINKSTART);
-					switch ($link_open) {
-						case 1:
-						$link_append = "rel='external'";
-
-						break;
-						case 2:
-						$link_append = "";
-						break;
-						case 3:
-						$link_append = "";
-						break;
-						default:
-						unset($link_append);
-					}
-
-					if(!preg_match("#(http:|mailto:|ftp:)#",$link_url)){ $link_url = e_BASE.$link_url; }
-					$indent=(LINKDISPLAY == 3) ? "" : "&nbsp;&nbsp;";
-					if($link_open == 4){
-						$_link =  $linkstart.$indent.($link_button ? "<img src='".e_IMAGE."link_icons/$link_button' alt='' style='vertical-align:middle' /> " : "")."<a".$linkadd." href=\"javascript:open_window('".$link_url."')\">".$link_name."</a>".LINKEND."\n";
-					} else {
-						$_link =  $linkstart.$indent.($link_button ? "<img src='".e_IMAGE."link_icons/$link_button' alt='' style='vertical-align:middle' /> " : "")."<a".$linkadd." href=\"".$link_url."\"".$link_append.">".$link_name."</a>".LINKEND."\n";
-					}
-					if(LINKDISPLAY == 3){
-						$menu_text .= $_link;
-					} else {
-						$text .= $_link;
-					}
-				}
-			}
-			if(LINKDISPLAY == 3 && $menu_title){
-				$link_menu[]= $ns -> tablerender(PRELINKTITLE.$menu_title.POSTLINKTITLE,$menu_text,"",TRUE);
-				$menu_title="";
-				$menu_text="";
-			}
-		} else {
-			if(LINKDISPLAY == 3){$menu_main .= $_link.LINKEND;        }
-		}
-	}
-
-}
-$text .= POSTLINK;
-
-if(LINKDISPLAY == 2){
-	$ns = new e107table;
-	$ns -> tablerender(LAN_183, $text);
-} else {
-	if(LINKDISPLAY != 3) {echo $text;}
-}
-if(LINKDISPLAY == 3){
-	$ns -> tablerender(LAN_183,$menu_main);
-	foreach($link_menu as $m){
-		echo $m;
-	}
-}
-
-if($pref['cachestatus']){
-	$aj = new textparse;
-	$cache = $aj -> formtpa(ob_get_contents(), "admin");
-	set_cache("sitelinks", $cache);
-}
-
-
-}
+<?php
+/*
++---------------------------------------------------------------+
+|     e107 website system
+|     /sitelinks_class.php
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/sitelinks_class.php,v $
+|     $Revision: 1.87 $
+|     $Date: 2006/04/23 04:54:09 $
+|     $Author: e107coders $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_sitelinks.php");
+@include_once(e_LANGUAGEDIR."English/lan_sitelinks.php");
+
+/**
+* @return void
+* @desc Outputs sitelinks
+*/
+
+class sitelinks
+{
+
+	var $eLinkList;
+
+	function getlinks($cat=1)
+	{
+
+		global $sql;
+		if ($sql->db_Select('links', '*', "link_category = ".intval($cat)." and link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC")){
+			while ($row = $sql->db_Fetch())
+			{
+			//	if (substr($row['link_name'], 0, 8) == 'submenu.'){
+			//		$tmp=explode('.', $row['link_name'], 3);
+			 //		$this->eLinkList[$tmp[1]][]=$row;
+				if (isset($row['link_parent']) && $row['link_parent'] != 0){
+					$this->eLinkList['sub_'.$row['link_parent']][]=$row;
+				}else{
+					$this->eLinkList['head_menu'][] = $row;
+				}
+			}
+		}
+
+	}
+
+	function get($cat=1, $style='', $css_class = false)
+	{
+		global $pref, $ns, $e107cache;
+
+		if (($data = $e107cache->retrieve('sitelinks_'.md5($cat.e_PAGE.e_QUERY))) && !strpos(e_SELF,e_ADMIN) ) {
+			return $data;
+		}
+
+		if (LINKDISPLAY == 4) {
+			require_once(e_PLUGIN.'ypslide_menu/ypslide_menu.php');
+			return;
+		}
+
+		$this->getlinks($cat);
+
+		// are these defines used at all ?
+
+		if(!defined('PRELINKTITLE')){
+			define('PRELINKTITLE', '');
+		}
+		if(!defined('PRELINKTITLE')){
+			define('POSTLINKTITLE', '');
+		}
+		// -----------------------------
+
+		// where did link alignment go?
+		if (!defined('LINKALIGN')) { define(LINKALIGN, ''); }
+
+		if(!$style){
+			$style['prelink'] = defined('PRELINK') ? PRELINK : '';
+			$style['postlink'] = defined('POSTLINK') ? POSTLINK : '';
+			$style['linkclass'] = defined('LINKCLASS') ? LINKCLASS : "";
+			$style['linkclass_hilite'] = defined('LINKCLASS_HILITE') ? LINKCLASS_HILITE : "";
+			$style['linkstart_hilite'] = defined('LINKSTART_HILITE') ? LINKSTART_HILITE : "";
+			$style['linkstart'] = defined('LINKSTART') ? LINKSTART : '';
+			$style['linkdisplay'] = defined('LINKDISPLAY') ? LINKDISPLAY : '';
+			$style['linkend'] = defined('LINKEND') ? LINKEND : '';
+			$style['linkseparator'] = defined('LINKSEPARATOR') ? LINKSEPARATOR : '';
+		}
+
+    // Sublink styles.- replacing the tree-menu.
+        if(isset($style['sublinkdisplay']) || isset($style['subindent']) || isset($style['sublinkclass']) || isset($style['sublinkstart']) || isset($style['sublinkend']) || isset($style['subpostlink'])){
+			foreach($style as $key=>$val){
+			  	$substyle[$key] = ($style["sub".$key]) ? $style["sub".$key] : $style[$key];
+			}
+        }else{
+				$style['subindent'] = "&nbsp;&nbsp;";
+				$substyle = $style;
+		}
+
+		$text = "\n\n\n<!-- Sitelinks ($cat) -->\n\n\n".$style['prelink'];
+
+		if ($style['linkdisplay'] != 3)	{
+			foreach ($this->eLinkList['head_menu'] as $key => $link){
+				$main_linkid = "sub_".$link['link_id'];
+
+				$link['link_expand'] = (isset($pref['sitelinks_expandsub']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ?  TRUE : FALSE;
+
+				$render_link[$key] = $this->makeLink($link,'', $style, $css_class);
+
+				if(!defined("LINKSRENDERONLYMAIN"))	/* if this is defined in theme.php only main links will be rendered */
+				{
+
+					// if there's a submenu. :
+					if (isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])){
+						$substyle = (strpos(e_SELF, $link['link_url']) !== FALSE || strpos(e_SELF, $link['link_name']) !== FALSE || $link['link_expand'] == FALSE) ? "visible" : "none";   // expanding sub-menus.
+						$render_link[$key] .= "\n\n<div id='{$main_linkid}' style='display:$substyle'>\n";
+						foreach ($this->eLinkList[$main_linkid] as $sub){
+							$render_link[$key] .= $this->makeLink($sub, TRUE, $style, $css_class);
+						}
+						$render_link[$key] .= "\n</div>\n\n";
+					}
+				}
+			}
+			$text .= implode($style['linkseparator'], $render_link);
+			$text .= $style['postlink'];
+			if ($style['linkdisplay'] == 2)	{
+				$text = $ns->tablerender(LAN_183, $text, 'sitelinks', TRUE);
+			}
+		}
+		else
+		{
+			foreach($this->eLinkList['head_menu'] as $link)
+			{
+				if (!count($this->eLinkList['sub_'.$link['link_id']]))
+				{
+					$text .= $this->makeLink($link,'', $style, $css_class);
+				}
+				$text .= $style['postlink'];
+			}
+			$text = $ns->tablerender(LAN_183, $text, 'sitelinks_main', TRUE);
+			foreach(array_keys($this->eLinkList) as $k)
+			{
+				$mnu = $style['prelink'];
+				foreach($this->eLinkList[$k] as $link)
+				{
+					if ($k != 'head_menu')
+					{
+						$mnu .= $this->makeLink($link, TRUE, $style, $css_class);
+					}
+				}
+				$mnu .= $style['postlink'];
+				$text .= $ns->tablerender($k, $mnu, 'sitelinks_sub', TRUE);
+			}
+		}
+		$text .= "\n\n\n<!--- end Site Links -->\n\n\n";
+		$e107cache->set('sitelinks_'.$cat.md5(e_PAGE.e_QUERY), $text);
+	 	return $text;
+	}
+
+	function makeLink($linkInfo, $submenu = FALSE, $style='', $css_class = false)
+	{
+		global $pref,$tp;
+
+		// Start with an empty link
+		$linkstart = $indent = $linkadd = $screentip = $href = $link_append = '';
+
+		// If submenu: Fix Name, Add Indentation.
+		if ($submenu == TRUE) {
+			if(substr($linkInfo['link_name'],0,8) == "submenu."){
+				$tmp = explode('.', $linkInfo['link_name'], 3);
+				$linkInfo['link_name'] = $tmp[2];
+			}
+			$indent = ($style['linkdisplay'] != 3) ? $style['subindent'] : "";
+		}
+
+		// By default links are not highlighted.
+		$linkstart = $style['linkstart'];
+		$linkadd = ($style['linkclass']) ? " class='".$style['linkclass']."'" : "";
+		$linkadd = ($css_class) ? " class='".$css_class."'" : $linkadd;
+
+		// Check for screentip regardless of URL.
+		if (isset($pref['linkpage_screentip']) && $pref['linkpage_screentip'] && $linkInfo['link_description']){
+			$screentip = " title = '".$tp->toHTML($linkInfo['link_description'],"","emotes_off defs no_hook")."'";
+		}
+
+		// Check if its expandable first. It should override its URL.
+		if (isset($linkInfo['link_expand']) && $linkInfo['link_expand']){
+			$href = " href=\"javascript:expandit('sub_".$linkInfo['link_id']."')\"";
+		} elseif ($linkInfo['link_url']){
+
+			// Only add the e_BASE if it actually has an URL.
+			$linkInfo['link_url'] = (strpos($linkInfo['link_url'], '://') === FALSE && strpos($linkInfo['link_url'], 'mailto:') !== 0 ? e_HTTP.$linkInfo['link_url'] : $linkInfo['link_url']);
+
+			// Only check if its highlighted if it has an URL
+			if ($this->hilite($linkInfo['link_url'], $style['linkstart_hilite'])== TRUE) {
+				$linkstart = $style['linkstart_hilite'];
+			}
+			if ($this->hilite($linkInfo['link_url'], $style['linkclass_hilite'])== TRUE) {
+				$linkadd = " class='".$style['linkclass_hilite']."'";
+			}
+
+			if ($linkInfo['link_open'] == 4 || $linkInfo['link_open'] == 5){
+				$dimen = ($linkInfo['link_open'] == 4) ? "600,400" : "800,600";
+				$href = " href=\"javascript:open_window('".$tp -> replaceConstants($linkInfo['link_url'])."',{$dimen})\"";
+			} else {
+				$href = " href='".$tp -> replaceConstants($linkInfo['link_url'])."'";
+			}
+
+			// Open link in a new window.  (equivalent of target='_blank' )
+			$link_append = ($linkInfo['link_open'] == 1) ? " rel='external'" : "";
+		}
+
+		// Remove default images if its a button and add new image at the start.
+		if ($linkInfo['link_button']){
+			$linkstart = preg_replace('/\<img.*\>/si', '', $linkstart);
+			$linkstart .= "<img src='".e_IMAGE_ABS."icons/".$linkInfo['link_button']."' alt='' style='vertical-align:middle' />";
+		}
+
+		// If its a link.. make a link
+		$_link = "";
+		if (!empty($href)){
+			$_link .= "<a".$linkadd.$screentip.$href.$link_append.">".$tp->toHTML($linkInfo['link_name'],"","emotes_off defs no_hook")."</a>";
+		// If its not a link, but has a class or screentip do span:
+		}elseif (!empty($linkadd) || !empty($screentip)){
+			$_link .= "<span".$linkadd.$screentip.">".$tp->toHTML($linkInfo['link_name'],"","emotes_off defs no_hook")."</span>";
+			// Else just the name:
+		}else {
+			$_link .= $tp->toHTML($linkInfo['link_name'],"","emotes_off defs no_hook");
+		}
+
+		$_link = $linkstart.$indent.$_link."\n";
+
+		return $_link.$style['linkend'];
+	}
+
+
+
+
+
+function hilite($link,$enabled=''){
+	global $PLUGINS_DIRECTORY,$tp,$pref;
+    if(!$enabled){ return FALSE; }
+
+	$tmp = explode("?",$link);
+
+// ----------- highlight overriding - set the link matching in the page itself.
+
+	if(defined("HILITE")){
+		if(strpos($link,HILITE)){
+        	return TRUE;
+		}
+	}
+
+
+// --------------- highlighting for 'HOME'. ----------------
+	global $pref;
+	list($fp,$fp_q) = explode("?",$pref['frontpage']['all']);
+	if(strpos(e_SELF,"/".$pref['frontpage']['all'])!== FALSE && $fp_q == $tmp[1] && $link == e_HTTP."index.php"){
+	  	return TRUE;
+	}
+
+// --------------- highlighting for plugins. ----------------
+		if(stristr($link, $PLUGINS_DIRECTORY) !== FALSE && stristr($link, "custompages") === FALSE){
+			if(str_replace("?","",$link)){  // plugin links with queries
+                $subq = explode("?",$link);
+
+				if(strpos(e_SELF,$subq[0]) && e_QUERY == $subq[1]){
+			   		return TRUE;
+				}else{
+					return FALSE;
+				}
+			}else{  // plugin links without queries
+				$link = str_replace("../", "", $link);
+		   		if(stristr(dirname(e_SELF), dirname($link)) !== FALSE){
+ 			 		return TRUE;
+				}
+
+			}
+            return FALSE;
+		}
+
+// --------------- highlight for news items.----------------
+// eg. news.php?list.1 or news.php?cat.2 etc
+
+		if (strpos($link, "news.php?") !== FALSE && strpos(e_SELF,"/news.php")) {
+
+			$lnk = explode(".",$tmp[1]); // link queries.
+			$qry = explode(".",e_QUERY); // current page queries.
+
+			if($qry[0] == "item"){
+				return ($qry[2] == $lnk[1]) ? TRUE : FALSE;
+     		}
+
+			if($lnk[0] == $qry[0] && $lnk[1] == $qry[1]){
+            	return TRUE;
+			}
+
+		}
+// --------------- highlight for Custom Pages.----------------
+// eg. page.php?1
+
+		if (strpos($link, "page.php?") !== FALSE && strpos(e_SELF,"/page.php")) {
+			$tmp = explode("?",$link);
+			if(e_QUERY == $tmp[1]){
+            	return TRUE;
+			}
+		}
+
+// --------------- highlight default ----------------
+		if(strpos($link, "?") !== FALSE){
+			$subq = explode("?",$link);
+			$linkq = $subq[1];
+			$thelink = str_replace("../", "", $link);
+			if((strpos(e_SELF,$thelink) !== false) && (strpos(e_QUERY,$linkq) !== false)){
+		   		return true;
+			}
+		}
+		if(!preg_match("/all|item|cat|list/", e_QUERY) && (strpos(e_SELF, str_replace("../", "",$link)) !== false)){
+		  	return true;
+		}
+
+		return false;
+	}
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_articles.php 75/e107_handlers/sitemap/sitemap_articles.php
--- 6171/e107_handlers/sitemap/sitemap_articles.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_articles.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,64 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_articles(){
-	$sql = new db;
-	$sql2 = new db;
-	$aj = new textparse;
-	$texto .= "<p class='caption2' style='text-align: left;' >\n
-	<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('articles_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"content.php?article\" >".LANSM_14."</a> <b class='smalltext' >".LANSM_15."</b>\n
-	</p><br />\n";
-	
-	if($sql -> db_Select("content","content_id, content_heading, content_type, content_class","content_parent='0' AND (content_type='0' OR content_type='6') ORDER BY content_heading ASC")){
-		$texto .= "<p class='cats' id='articles_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-		<b>".LANSM_23."</b><br />\n";
-		$nbr_articles_cat = 0;
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$row[1] = $aj -> tpa($row[1]);
-			if(check_class($row[3]) && $row[2]=="0"){
-				$texto .= "<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('articles_subcats2_".$row[0]."');ejs_func_todo='view'\" class='smalltext' >".SM_ICO_EXP."</a> <a  href='content.php?article.cat.0' >".LANSM_40."</a>\n";
-				$nbr_articles_cat++;
-				if($sql2 -> db_Select("content","content_id, content_heading, content_class","content_parent='0' AND content_type='0' ORDER BY content_heading ASC")){
-						$texto .= "<br /><br /><span class='subcats' id='articles_subcats2_".$row[0]."' style='display:none;' ><div style='margin: 0px 0px 0px 30px;' >\n
-					<b>".LANSM_38."</b><br />";
-						while($row2 = $sql2 -> db_Fetch()){
-							extract($row2);
-							$row2[1] = $aj -> tpa($row2[1]);
-							if(check_class($row2[2])){
-								$texto .= "<a href=\"content.php?item.".$row2[0]."\" >".$row2[1]."</a><br />\n";
-							}
-						}
-						$texto .= "<br /><br /></div></span>\n";
-				}else{
-					$texto .= "<br /><br />";
-				}
-			}else if(check_class($row[3])){
-				$texto .= "<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('articles_subcats_".$row[0]."');ejs_func_todo='view'\" class='smalltext' >".SM_ICO_EXP."</a> <a  href='content.php?article.cat.".$row[0]."' >".$row[1]."</a>\n";
-				$nbr_articles_cat++;
-				if($sql2 -> db_Select("content","content_id, content_heading, content_class","content_parent='".$row[0]."' ORDER BY content_heading ASC")){
-						$texto .= "<br /><br /><span class='subcats' id='articles_subcats_".$row[0]."' style='display:none;' ><div style='margin: 0px 0px 0px 30px;' >\n
-					<b>".LANSM_38."</b><br />";
-						while($row2 = $sql2 -> db_Fetch()){
-							extract($row2);
-							if(check_class($row2[2])){
-								$texto .= "<a href=\"content.php?item.".$row2[0]."\" >".$row2[1]."</a><br />\n";
-							}
-						}
-						$texto .= "<br /><br /></div></span>\n";
-				}else{
-					$texto .= "<br /><br />";
-				}
-			}
-		}
-		$texto .= "</p>";
-		
-	}
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_content.php 75/e107_handlers/sitemap/sitemap_content.php
--- 6171/e107_handlers/sitemap/sitemap_content.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_content.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,34 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_content(){
-	$sql = new db;
-	$sql2 = new db;
-	$aj = new textparse;
-	$texto .= "<p class='caption2' style='text-align: left;' >\n
-	<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('contents_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"content.php\" >".LANSM_4."</a> <b class='smalltext' >".LANSM_36."</b>\n
-	</p><br />\n";
-	
-	if($sql -> db_Select("content","content_id, content_heading, content_type, content_class","content_type='1' ORDER BY content_heading ASC")){
-		$texto .= "<p class='cats' id='contents_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-		<b>".LANSM_38."</b><br />\n";
-		$nbr_contents_cat = 0;
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$row[1] = $aj -> tpa($row[1]);
-			if(check_class($row[3])){
-				$texto .= "<a  href='content.php?content.".$row[0]."' >".$row[1]."</a><br />\n";
-				$nbr_contents_cat++;
-			}
-		}
-		$texto .= "<br /></p>";
-		
-	}
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_custom.php 75/e107_handlers/sitemap/sitemap_custom.php
--- 6171/e107_handlers/sitemap/sitemap_custom.php	2004-09-13 08:38:28.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_custom.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,64 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-
-//////////////////////
-// To custom this file for your site
-// Uncomment from line 30 in this file and add your links
-/////////////////////
-
-function sm_custom(){
-	$sql = new db;
-	$texto = "<p class='caption2' style='text-align: left;' >\n
-	<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('custom_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('custom_cats');ejs_func_todo='view'\" >".LANSM_44."</a>\n
-	</p><br />\n";
-		
-	$texto .= "<p class='cats' id='custom_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-	\n";
-	
-	// Other e107 pages (don't edit this part)
-	// Search
-	if(USER || $pref['search_restrict']!=1){
-		$texto .= "<a href=\"search.php\" >".LANSM_47."</a><br />\n";
-	}
-	// Submit news
-	$texto .= "<a href=\"submitnews.php\" >".LANSM_48."</a><br />\n";
-
-	// Submit content
-	$texto .= "<a href=\"subcontent.php?article\" >".LANSM_49."</a><br />\n";
-	
-	// Submit links
-	$texto .= "<a href=\"links.php?submit\" >".LANSM_51."</a><br />\n";
-	
-	// Top Posters
-	$texto .= "<a href=\"top.php\" >".LANSM_50."</a><br />\n";
-
-	// Chat
-	$sql -> db_Select("menus", "*", "menu_name='chatbox_menu'");
-	$row = $sql -> db_Fetch(); extract($row);
-	if(check_class($menu_class)){
-		$texto .= "<a href=\"chat.php\" >".LANSM_42."</a> <b class='smalltext' >".LANSM_43."</b><br />\n";
-	}
-	// Polls
-	$texto .= "<a href=\"oldpolls.php\" >".LANSM_28."</a><br />\n";
-	
-//////////////////////	
-	/* Uncomment to add your links...
-	// See next line for an example with multilanguage (e107_langauges/your_languages/lan_sitemap.php to edit... check the end of the file)
-	$texto .= "<a  href='test.php' >".LANSM_Custom_1."</a>\n";
-	// See next lines for normal links without multilanguage.
-	$texto .= "<a  href='http://e107.org' >e107.org</a> (Site partenaire...)<br />\n";
-	$texto .= "<a  href='http://etalkers.org' >etalkers.org</a> (Site partenaire...)<br />\n";
-	*/ 
-//////////////////////
-	
-	$texto .= "</p>";
-
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_downloads.php 75/e107_handlers/sitemap/sitemap_downloads.php
--- 6171/e107_handlers/sitemap/sitemap_downloads.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_downloads.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,50 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_downloads(){
-	$sql = new db;
-	$sql2 = new db;
-	$aj = new textparse;
-	$texto .= "<p class='caption2' style='text-align: left;' >\n
-	<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('downloads_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"download.php\" >".LANSM_12."</a> <b class='smalltext' >".LANSM_13."</b>\n
-	</p><br />\n";
-	
-	if($sql -> db_Select("download_category","*","download_category_parent='0' ORDER BY download_category_name ASC")){
-		$texto .= "<p class='cats' id='downloads_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-		<b>".LANSM_23."</b><br />\n";
-		$nbr_downloads_cat = 0;
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$row[1] = $aj -> tpa($row[1]);
-			$row[2] = $aj -> tpa($row[2]);
-			if(check_class($row[5])){
-				$texto .= "<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('downloads_subcats_".$row[0]."');ejs_func_todo='view'\" class='smalltext' >".SM_ICO_EXP."</a> ".( $row[3]!="" ? "<img src='".e_IMAGE."download_icons/".$row[3]."' alt='bullet' /> " : "" )."<a  href='download.php?' >".$row[1]."</a>\n";
-				$nbr_downloads_cat++;
-				if($sql2 -> db_Select("download_category","*","download_category_parent='".$row[0]."' ORDER BY download_category_name ASC")){
-						$texto .= "<br /><br /><span class='subcats' id='downloads_subcats_".$row[0]."' style='display:none;' ><div style='margin: 0px 0px 0px 30px;' >\n
-						<b>".LANSM_37."</b><br />";
-						while($row2 = $sql2 -> db_Fetch()){
-							extract($row2);
-							$row2[1] = $aj -> tpa($row2[1]);
-							$row2[1] = $aj -> tpa($row2[1]);
-							if(check_class($row2[5])){
-								$texto .= ( $row2[3]!="" ? "<img src='".e_IMAGE."download_icons/".$row2[3]."' alt='bullet' /> " : "" )."<a href=\"download.php?list.".$row2[0]."\" >".$row2[1]."</a><br />\n";
-							}
-						}
-						$texto .= "<br /><br /></div></span>\n";
-				}else{
-					$texto .= "<br /><br />";
-				}
-			}
-		}
-		$texto .= "</p>";
-		
-	}
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_forums.php 75/e107_handlers/sitemap/sitemap_forums.php
--- 6171/e107_handlers/sitemap/sitemap_forums.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_forums.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,48 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_forums(){
-	$sql = new db;
-	$sql2 = new db;
-	$aj = new textparse;
-	$texto .= "<p class='caption2' style='text-align: left;' >
-	<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('forum_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"forum.php\" >".LANSM_10."</a> <b class='smalltext' >".LANSM_11."</b>\n
-	</p><br />\n";
-	
-	if($sql -> db_Select("forum","forum_id, forum_name, forum_class","forum_parent='0' ORDER BY forum_order")){
-		$texto .= "<p class='cats' id='forum_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-		<b>".LANSM_23."</b><br />\n";
-		$nbr_forum_cat = 0;
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$row[1] = $aj -> tpa($row[1]);
-			if(check_class($row[2])){
-				$texto .= "<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('forum_subcats_".$row[0]."');ejs_func_todo='view'\" class='smalltext' >".SM_ICO_EXP."</a> <a href=\"forum.php\" class='smalltext' >".$row[1]."</a>\n";
-				$nbr_forum_cat++;
-				if($sql2 -> db_Select("forum","forum_id, forum_name, forum_threads, forum_replies, forum_class","forum_parent='".$row[0]."' ORDER BY forum_order ASC")){
-						$texto .= "<br /><br /><span class='subcats' id='forum_subcats_".$row[0]."' style='display:none;' ><div style='margin: 0px 0px 0px 30px;' >\n
-						<b>".LANSM_10."</b><br />";
-						while($row2 = $sql2 -> db_Fetch()){
-							extract($row2);
-							$row2[1] = $aj -> tpa($row2[1]);
-							if(check_class($row2[4])){
-								$texto .= "<a href=\"forum_viewforum.php?".$row2[0]."\" >".$row2[1]."</a> ".LANSM_39.": ".$row2[2]."/".$row2[3].")<br />\n";
-							}
-						}
-						$texto .= "<br /><br /></div></span>\n";
-				}else{
-					$texto .= "<br /><br />";
-				}
-			}
-		}
-		$texto .= "</p>";
-		
-	}
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_links.php 75/e107_handlers/sitemap/sitemap_links.php
--- 6171/e107_handlers/sitemap/sitemap_links.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_links.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,49 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_links(){
-	$sql = new db;
-	$sql2 = new db;
-	$aj = new textparse;
-	if($sql -> db_Select("news","news_id")){
-		$texto .= "<p class='caption2' style='text-align: left;' >\n
-		<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('link_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"links.php\" >".LANSM_8."</a> <b class='smalltext' >".LANSM_9."</b>\n
-		</p><br />\n";
-		
-		if($sql -> db_Select("link_category","*","link_category_id!='1' ORDER BY link_category_name")){
-			$texto .= "<p class='cats' id='link_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-			<b>".LANSM_23."</b><br />\n";
-			$nbr_link_cat = 0;
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				$row[1] = $aj -> tpa($row[1]);
-				$row[2] = $aj -> tpa($row[2]);
-				$texto .= "<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('link_subcats_".$row[0]."');ejs_func_todo='view'\" class='smalltext' >".SM_ICO_EXP."</a> ".($row[3]!="" ? "<img src='".e_IMAGE."link_icons/".$row[3]."' alt='bullet' /> " : "")."<a  href='links.php?cat.".$row[0]."' >".$row[1]."</a>\n";
-				$nbr_link_cat++;
-				if($sql2 -> db_Select("links","link_id, link_name, link_url, link_class","link_category='".$row[0]."' ORDER BY link_name DESC")){
-					$texto .= "<br /><br /><span class='subcats' id='link_subcats_".$row[0]."' style='display:none;' ><div style='margin: 0px 0px 0px 30px;' >\n
-					<b>".LANSM_8."</b><br />";
-					while($row2 = $sql2 -> db_Fetch()){
-						extract($row2);
-						$row2[1] = $aj -> tpa($row2[1]);
-						if(check_class($row2[3])){
-							$texto .= "<a href=\"".$row2[2]."\" >".$row2[1]."</a><br />";
-						}
-					}
-					$texto .= "<br /><br /></div></span>";
-				}else{
-					$texto .= "<br /><br />";
-				}
-				
-			}
-			$texto .= "</p>";
-		}
-	}
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_members.php 75/e107_handlers/sitemap/sitemap_members.php
--- 6171/e107_handlers/sitemap/sitemap_members.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_members.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,29 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_members(){
-	$texto = "<p class='caption2' style='text-align: left;' >\n
-	<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('members_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('members_cats');ejs_func_todo='view'\" >".LANSM_19."</a> <b class='smalltext' >".LANSM_41."</b>\n
-	</p><br />\n";
-		
-	$texto .= "<p class='cats' id='members_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-	\n";
-	
-	// Links for guests
-	if(!USER){$texto .= "<a href=\"signup.php\" >".LANSM_45."</a><br /><br />\n";}
-	// Links for members
-	if(USER){$texto .= "<a href=\"user.php\" >".LANSM_32."</a><br />\n";
-	$texto .= "<a href=\"usersettings.php?".USERID."\" >".LANSM_21."</a><br />\n";
-	$texto .= "<a href=\"userposts.php?0.comments.".USERID."\" >".LANSM_52."</a> <b class=\"smalltext\" >".LANSM_53."</b><br />\n";
-	$texto .= "<a href=\"fpw.php\" >".LANSM_46."</a><br /><br />\n";
-	}
-	$texto .= "</p>";
-
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_news.php 75/e107_handlers/sitemap/sitemap_news.php
--- 6171/e107_handlers/sitemap/sitemap_news.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_news.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,54 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_news(){
-	$sql = new db;
-	$sql2 = new db;
-	$aj = new textparse;
-	if($sql -> db_Select("news","news_id")){
-		//$texto = "<p class='caption2' style='text-align: left;' >\n
-		//<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('news_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"news.php\" >".LANSM_5."</a> <b class='smalltext' >".LANSM_6."</b>\n
-		//</p><br />\n";
-		$texto = "<p class='caption2' style='text-align: left;' >\n
-		<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('news_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"news.php\" >".LANSM_5."</a> <b class='smalltext' >".LANSM_6."</b>\n
-		</p><br />\n";
-		
-		if($sql -> db_Select("news_category","*","category_id!='-1' ORDER BY category_name")){
-			$texto .= "<p class='cats' id='news_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-			<b>".LANSM_23."</b><br />\n";
-			$nbr_news_cat = 0;
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				$row[1] = $aj -> tpa($row[1]);
-				$texto .= "<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('news_subcats_".$row[0]."');ejs_func_todo='view';\" class='smalltext' >".SM_ICO_EXP."</a> <img src='".e_IMAGE."link_icons/".$row[2]."' alt='bullet' /> <a  href='news.php?cat.".$row[0]."' >".$row[1]."</a>\n";
-				$nbr_news_cat++;
-				if($sql2 -> db_Select("news","news_id, news_title, news_datestamp, news_class","news_category='".$row[0]."' ORDER BY news_datestamp DESC")){
-						$texto .= "<br /><br /><span class='subcats' id='news_subcats_".$row[0]."' style='display:none;' ><div style='margin: 0px 0px 0px 30px;' >\n
-					<b>".LANSM_38."</b><br />";
-						while($row2 = $sql2 -> db_Fetch()){
-							extract($row2);
-							$row2[1] = $aj -> tpa($row2[1]);
-							if(check_class($row2[3])){
-								$news_date = new convert;
-								$news_date = $news_date->convert_date($row2[2], "short");
-								$texto .= "<a href=\"news.php?item.".$row2[0]."\" >".$row2[1]."</a> ".$news_date."<br />\n";
-							}
-						}
-						$texto .= "<br /><br /></div></span>\n";
-				}else{
-					$texto .= "<br /><br />";
-				}
-				
-			}
-			$texto .= "</p>";
-			
-		}
-	}
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_plugin.php 75/e107_handlers/sitemap/sitemap_plugin.php
--- 6171/e107_handlers/sitemap/sitemap_plugin.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_plugin.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,35 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_plugins(){
-	$texto = "";
-	$nb_sm_plugin = 0;
-	$handle=opendir(e_PLUGIN);
-	while(false !== ($file = readdir($handle))){
-		if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)){
-			$plugin_handle=opendir(e_PLUGIN.$file."/");
-			while(false !== ($file2 = readdir($plugin_handle))){
-				if($file2 == "sitemap.php"){
-					require_once(e_PLUGIN.$file."/".$file2);
-				}
-			}
-		}
-	}
-
-	$textostart = "<p class='caption2' style='text-align: left;' >\n
-	<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('plugin_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('plugin_cats');ejs_func_todo='view'\" >".LANSM_25."</a>\n
-	</p><br />\n";
-		
-	$textostart .= "<p class='cats' id='plugin_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-	\n";
-	
-	$textoend = "</p>";
-	if($texto != ""){$texto = $textostart.$texto.$textoend;}
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_reviews.php 75/e107_handlers/sitemap/sitemap_reviews.php
--- 6171/e107_handlers/sitemap/sitemap_reviews.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_reviews.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,64 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_reviews(){
-	$sql = new db;
-	$sql2 = new db;
-	$aj = new textparse;
-	$texto .= "<p class='caption2' style='text-align: left;' >\n
-	<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('reviews_cats');ejs_func_todo='view'\" >".SM_ICO_EXP."</a> <img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"content.php?review\" >".LANSM_16."</a> <b class='smalltext' >".LANSM_17."</b>\n
-	</p><br />\n";
-	
-	if($sql -> db_Select("content","content_id, content_heading, content_type, content_class","content_parent='0' AND (content_type='3' OR content_type='10') ORDER BY content_heading ASC")){
-		$texto .= "<p class='cats' id='reviews_cats' style='display:none; margin: 0px 0px 0px 10px;' >\n
-		<b>".LANSM_23."</b><br />\n";
-		$nbr_reviews_cat = 0;
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$row[1] = $aj -> tpa($row[1]);
-			if(check_class($row[3]) && $row[2]=="3"){
-				$texto .= "<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('reviews_subcats2_".$row[0]."');ejs_func_todo='view'\" class='smalltext' >".SM_ICO_EXP."</a> <a  href='content.php?review.cat.0' >".LANSM_40."</a>\n";
-				$nbr_reviews_cat++;
-				if($sql2 -> db_Select("content","content_id, content_heading, content_class","content_parent='0' AND content_type='3' ORDER BY content_heading ASC")){
-						$texto .= "<br /><br /><span class='subcats' id='reviews_subcats2_".$row[0]."' style='display:none;' ><div style='margin: 0px 0px 0px 30px;' >\n
-					<b>".LANSM_38."</b><br />";
-						while($row2 = $sql2 -> db_Fetch()){
-							extract($row2);
-							$row2[1] = $aj -> tpa($row2[1]);
-							if(check_class($row2[2])){
-								$texto .= "<a href=\"content.php?item.".$row2[0]."\" >".$row2[1]."</a><br />\n";
-							}
-						}
-						$texto .= "<br /><br /></div></span>\n";
-				}else{
-					$texto .= "<br /><br />";
-				}
-			}else if(check_class($row[3])){
-				$texto .= "<a href=\"javascript:void(0);\" onfocus=\"this.blur;\" onclick=\"expandit('reviews_subcats_".$row[0]."');ejs_func_todo='view'\" class='smalltext' >".SM_ICO_EXP."</a> <a  href='content.php?review.cat.".$row[0]."' >".$row[1]."</a>\n";
-				$nbr_reviews_cat++;
-				if($sql2 -> db_Select("content","content_id, content_heading, content_class","content_parent='".$row[0]."' ORDER BY content_heading ASC")){
-						$texto .= "<br /><br /><span class='subcats' id='reviews_subcats_".$row[0]."' style='display:none;' ><div style='margin: 0px 0px 0px 30px;' >\n
-					<b>".LANSM_38."</b><br />";
-						while($row2 = $sql2 -> db_Fetch()){
-							extract($row2);
-							if(check_class($row2[2])){
-								$texto .= "<a href=\"content.php?item.".$row2[0]."\" >".$row2[1]."</a><br />\n";
-							}
-						}
-						$texto .= "<br /><br /></div></span>\n";
-				}else{
-					$texto .= "<br /><br />";
-				}
-			}
-		}
-		$texto .= "</p>";
-		
-	}
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/sitemap/sitemap_stats.php 75/e107_handlers/sitemap/sitemap_stats.php
--- 6171/e107_handlers/sitemap/sitemap_stats.php	2004-06-04 05:36:46.000000000 -0500
+++ 75/e107_handlers/sitemap/sitemap_stats.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,17 +0,0 @@
-<?php
-/*
-|	Lolo Irie 2001-2004 (e107 Dev Team)
-|	http://etalkers.org
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org) for the e107 project.
-*/
-function sm_stats(){
-	$texto = "<p class='caption2' style='text-align: left;' >\n
-	<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\"  href=\"stats.php\" >".LANSM_20."</a> <b class='smalltext' >".LANSM_33."</b>\n
-	</p><br />\n";
-
-
-	return $texto;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/smtp.php 75/e107_handlers/smtp.php
--- 6171/e107_handlers/smtp.php	2004-09-02 22:36:36.000000000 -0500
+++ 75/e107_handlers/smtp.php	2005-12-14 11:37:34.000000000 -0600
@@ -1,231 +1,210 @@
-<?php
-/***************************************************************************
- *                              smtp.php
- *                       -------------------
- *   begin                : Wed May 09 2001
- *   copyright            : (C) 2001 The phpBB Group
- *   email                : support@phpbb.com
- *
- *   $Id: smtp.php,v 1.4 2004/09/03 03:36:35 mcfly_e107 Exp $
- *
- ***************************************************************************/
-
-/***************************************************************************
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- ***************************************************************************/
-
- /***************************************************************************
- *
- *   modified for use with e107 website system
- *   http://e107.org
- *
- ***************************************************************************/
-
-//
-// This function has been modified as provided
-// by SirSir to allow multiline responses when 
-// using SMTP Extensions
-//
-function server_parse($socket, $response) 
-{ 
-   while ( substr($server_response,3,1) != ' ' ) 
-   { 
-      if( !( $server_response = fgets($socket, 256) ) ) 
-      { 
-         print("Couldn't get mail server response codes".  __LINE__."&nbsp;".__FILE__);
-		return FALSE;
-      } 
-   } 
-
-   if( !( substr($server_response, 0, 3) == $response ) ) 
-   { 
-    // echo ("Ran into problems sending Mail. Response: $server_response "); 
-	 return FALSE;
-   } 
-} 
-
-/****************************************************************************
-*	Function: 		smtpmail
-*	Description: 	This is a functional replacement for php's builtin mail
-*						function, that uses smtp.
-*	Usage:			The usage for this function is identical to that of php's
-*						built in mail function.
-****************************************************************************/
-function smtpmail($mail_to, $subject, $message, $headers = "")
-{
-	// For now I'm using an array based $smtp_vars to hold the smtp server
-	// info, but it should probably change to $board_config...
-	// then the relevant info would be $board_config['smtp_host'] and
-	// $board_config['smtp_port'].
-	global $pref;
-	//
-	// Fix any bare linefeeds in the message to make it RFC821 Compliant.
-	//
-	$message = preg_replace("/(?<!\r)\n/si", "\r\n", $message);
-
-	if ($headers != "")
-	{
-		if(is_array($headers))
-		{
-			if(sizeof($headers) > 1)
-			{
-				$headers = join("\r\n", $headers);
-			}
-			else
-			{
-				$headers = $headers[0];
-			}
-		}
-		$headers = chop($headers);
-
-		//
-		// Make sure there are no bare linefeeds in the headers
-		//
-		$headers = preg_replace("/(?<!\r)\n/si", "\r\n", $headers);
-		//
-		// Ok this is rather confusing all things considered,
-		// but we have to grab bcc and cc headers and treat them differently
-		// Something we really didn't take into consideration originally
-		//
-		$header_array = explode("\r\n", $headers);
-		@reset($header_array);
-		$headers = "";
-		while( list(, $header) = each($header_array) )
-		{
-			if( preg_match("/^cc:/si", $header) )
-			{
-				$cc = preg_replace("/^cc:(.*)/si", "\\1", $header);
-			}
-			else if( preg_match("/^bcc:/si", $header ))
-			{
-				$bcc = preg_replace("/^bcc:(.*)/si", "\\1", $header);
-				$header = "";
-			}
-			$headers .= $header . "\r\n";
-		}
-		$headers = chop($headers);
-		$cc = explode(",", $cc);
-		$bcc = explode(",", $bcc);
-	}
-	
-	$mail_to_array = explode(",", $mail_to);
-
-	//
-	// Ok we have error checked as much as we can to this point let's get on
-	// it already.
-	//
-	if( !$socket = fsockopen($pref['smtp_server'], 25, $errno, $errstr, 20) )
-	{
-		print ("Could not connect to smtp host. <br />$errno: $errstr");
-		return FALSE;
-	}
-	server_parse($socket, "220");
-	$myIP = gethostbyname ($_SERVER['SERVER_NAME']);
-	$myServer = gethostbyaddr($myIP);
-
-	if( !empty($pref['smtp_username']) && !empty($pref['smtp_password']) )
-	{ 
-		// Send the RFC2554 specified EHLO. 
-		// This improved as provided by SirSir to accomodate
-		// both SMTP AND ESMTP capable servers
-		fputs($socket, "EHLO " . $myServer . "\r\n"); 
-		server_parse($socket, "250"); 
-
-		fputs($socket, "AUTH LOGIN\r\n"); 
-		server_parse($socket, "334"); 
-		fputs($socket, base64_encode($pref['smtp_username']) . "\r\n"); 
-		server_parse($socket, "334"); 
-		fputs($socket, base64_encode($pref['smtp_password']) . "\r\n"); 
-		server_parse($socket, "235"); 
-	} 
-	else 
-	{ 
-		// Send the RFC821 specified HELO. 
-		fputs($socket, "HELO " . $myServer . "\r\n"); 
-		server_parse($socket, "250"); 
-	}
-
-	// From this point onward most server response codes should be 250
-	// Specify who the mail is from....
-	fputs($socket, "MAIL FROM: <" . $pref['siteadminemail'] . ">\r\n");
-	server_parse($socket, "250");
-
-	// Specify each user to send to and build to header.
-	$to_header = "To: ";
-	@reset( $mail_to_array );
-	while( list( , $mail_to_address ) = each( $mail_to_array ))
-	{
-		//
-		// Add an additional bit of error checking to the To field.
-		//
-		$mail_to_address = trim($mail_to_address);
-		if ( preg_match('/[^ ]+\@[^ ]+/', $mail_to_address) )
-		{
-			fputs( $socket, "RCPT TO: <$mail_to_address>\r\n" );
-			server_parse( $socket, "250" );
-		}
-		$to_header .= "<$mail_to_address>";
-	}
-	// Ok now do the CC and BCC fields...
-	@reset( $bcc );
-	while( list( , $bcc_address ) = each( $bcc ))
-	{
-		//
-		// Add an additional bit of error checking to bcc header...
-		//
-		$bcc_address = trim( $bcc_address );
-		if ( preg_match('/[^ ]+\@[^ ]+/', $bcc_address) )
-		{
-			fputs( $socket, "RCPT TO: <$bcc_address>\r\n" );
-			server_parse( $socket, "250" );
-		}
-	}
-	@reset( $cc );
-	while( list( , $cc_address ) = each( $cc ))
-	{
-		//
-		// Add an additional bit of error checking to cc header
-		//
-		$cc_address = trim( $cc_address );
-		if ( preg_match('/[^ ]+\@[^ ]+/', $cc_address) )
-		{
-			fputs($socket, "RCPT TO: <$cc_address>\r\n");
-			server_parse($socket, "250");
-		}
-	}
-	// Ok now we tell the server we are ready to start sending data
-	fputs($socket, "DATA\r\n");
-
-	// This is the last response code we look for until the end of the message.
-	server_parse($socket, "354");
-
-	// Send the Subject Line...
-	fputs($socket, "Subject: $subject\r\n");
-
-	// Now the To Header.
-	fputs($socket, "$to_header\r\n");
-
-	// Now any custom headers....
-	fputs($socket, "$headers\r\n\r\n");
-
-	// Ok now we are ready for the message...
-	fputs($socket, "$message\r\n");
-
-	// Ok the all the ingredients are mixed in let's cook this puppy...
-	fputs($socket, ".\r\n");
-	server_parse($socket, "250");
-
-	// Now tell the server we are done and close the socket...
-	fputs($socket, "QUIT\r\n");
-	fclose($socket);
-
-	return TRUE;
-
-}
-
-?>
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+/***************************************************************************
+*                              smtp.php
+*                       -------------------
+*   begin                : Wed May 09 2001
+*   copyright            : (C) 2001 The phpBB Group
+*   email                : support@phpbb.com
+*
+*   $Id: smtp.php,v 1.4 2005/12/14 17:37:34 sweetas Exp $
+*
+***************************************************************************/
+	
+/***************************************************************************
+*
+*   This program is free software; you can redistribute it and/or modify
+*   it under the terms of the GNU General Public License as published by
+*   the Free Software Foundation; either version 2 of the License, or
+*   (at your option) any later version.
+*
+***************************************************************************/
+	
+/***************************************************************************
+*
+*   modified for use with e107 website system
+*   http://e107.org
+*
+***************************************************************************/
+	
+//
+// This function has been modified as provided
+// by SirSir to allow multiline responses when
+// using SMTP Extensions
+//
+function server_parse($socket, $response) {
+	while (substr($server_response, 3, 1) != ' ' ) {
+		if (!($server_response = fgets($socket, 256) ) ) {
+			print("Couldn't get mail server response codes". __LINE__."&nbsp;".__FILE__);
+			return FALSE;
+		}
+	}
+	 
+	if (!(substr($server_response, 0, 3) == $response ) ) {
+		// echo ("Ran into problems sending Mail. Response: $server_response ");
+		return FALSE;
+	}
+}
+	
+/****************************************************************************
+* Function:   smtpmail
+* Description:  This is a functional replacement for php's builtin mail
+*      function, that uses smtp.
+* Usage:   The usage for this function is identical to that of php's
+*      built in mail function.
+****************************************************************************/
+function smtpmail($mail_to, $subject, $message, $headers = "") {
+	// For now I'm using an array based $smtp_vars to hold the smtp server
+	// info, but it should probably change to $board_config...
+	// then the relevant info would be $board_config['smtp_host'] and
+	// $board_config['smtp_port'].
+	global $pref, $e107;
+	//
+	// Fix any bare linefeeds in the message to make it RFC821 Compliant.
+	//
+	$message = preg_replace("/(?<!\r)\n/si", "\r\n", $message);
+	 
+	if ($headers != "") {
+		if (is_array($headers)) {
+			if (sizeof($headers) > 1) {
+				$headers = join("\r\n", $headers);
+			} else {
+				$headers = $headers[0];
+			}
+		}
+		$headers = chop($headers);
+		 
+		//
+		// Make sure there are no bare linefeeds in the headers
+		//
+		$headers = preg_replace("/(?<!\r)\n/si", "\r\n", $headers);
+		//
+		// Ok this is rather confusing all things considered,
+		// but we have to grab bcc and cc headers and treat them differently
+		// Something we really didn't take into consideration originally
+		//
+		$header_array = explode("\r\n", $headers);
+		@reset($header_array);
+		$headers = "";
+		while (list(, $header) = each($header_array) ) {
+			if (preg_match("/^cc:/si", $header) ) {
+				$cc = preg_replace("/^cc:(.*)/si", "\\1", $header);
+			}
+			else if(preg_match("/^bcc:/si", $header )) {
+				$bcc = preg_replace("/^bcc:(.*)/si", "\\1", $header);
+				$header = "";
+			}
+			$headers .= $header . "\r\n";
+		}
+		$headers = chop($headers);
+		$cc = explode(",", $cc);
+		$bcc = explode(",", $bcc);
+	}
+	 
+	$mail_to_array = explode(",", $mail_to);
+	 
+	//
+	// Ok we have error checked as much as we can to this point let's get on
+	// it already.
+	//
+	if (!$socket = fsockopen($pref['smtp_server'], 25, $errno, $errstr, 20) ) {
+		print ("Could not connect to smtp host. <br />$errno: $errstr");
+		return FALSE;
+	}
+	server_parse($socket, "220");
+	$myIP = gethostbyname ($_SERVER['SERVER_NAME']);
+	$myServer = $e107->get_host_name($myIP);
+	 
+	if (!empty($pref['smtp_username']) && !empty($pref['smtp_password']) ) {
+		// Send the RFC2554 specified EHLO.
+		// This improved as provided by SirSir to accomodate
+		// both SMTP AND ESMTP capable servers
+		fputs($socket, "EHLO " . $myServer . "\r\n");
+		server_parse($socket, "250");
+		 
+		fputs($socket, "AUTH LOGIN\r\n");
+		server_parse($socket, "334");
+		fputs($socket, base64_encode($pref['smtp_username']) . "\r\n");
+		server_parse($socket, "334");
+		fputs($socket, base64_encode($pref['smtp_password']) . "\r\n");
+		server_parse($socket, "235");
+	} else {
+		// Send the RFC821 specified HELO.
+		fputs($socket, "HELO " . $myServer . "\r\n");
+		server_parse($socket, "250");
+	}
+	 
+	// From this point onward most server response codes should be 250
+	// Specify who the mail is from....
+	fputs($socket, "MAIL FROM: <" . $pref['siteadminemail'] . ">\r\n");
+	server_parse($socket, "250");
+	 
+	// Specify each user to send to and build to header.
+	$to_header = "To: ";
+	@reset($mail_to_array );
+	while (list(, $mail_to_address ) = each($mail_to_array )) {
+		//
+		// Add an additional bit of error checking to the To field.
+		//
+		$mail_to_address = trim($mail_to_address);
+		if (preg_match('/[^ ]+\@[^ ]+/', $mail_to_address) ) {
+			fputs($socket, "RCPT TO: <$mail_to_address>\r\n" );
+			server_parse($socket, "250" );
+		}
+		$to_header .= "<$mail_to_address>";
+	}
+	// Ok now do the CC and BCC fields...
+	@reset($bcc );
+	while (list(, $bcc_address ) = each($bcc )) {
+		//
+		// Add an additional bit of error checking to bcc header...
+		//
+		$bcc_address = trim($bcc_address );
+		if (preg_match('/[^ ]+\@[^ ]+/', $bcc_address) ) {
+			fputs($socket, "RCPT TO: <$bcc_address>\r\n" );
+			server_parse($socket, "250" );
+		}
+	}
+	@reset($cc );
+	while (list(, $cc_address ) = each($cc )) {
+		//
+		// Add an additional bit of error checking to cc header
+		//
+		$cc_address = trim($cc_address );
+		if (preg_match('/[^ ]+\@[^ ]+/', $cc_address) ) {
+			fputs($socket, "RCPT TO: <$cc_address>\r\n");
+			server_parse($socket, "250");
+		}
+	}
+	// Ok now we tell the server we are ready to start sending data
+	fputs($socket, "DATA\r\n");
+	 
+	// This is the last response code we look for until the end of the message.
+	server_parse($socket, "354");
+	 
+	// Send the Subject Line...
+	fputs($socket, "Subject: $subject\r\n");
+	 
+	// Now the To Header.
+	fputs($socket, "$to_header\r\n");
+	 
+	// Now any custom headers....
+	fputs($socket, "$headers\r\n\r\n");
+	 
+	// Ok now we are ready for the message...
+	fputs($socket, "$message\r\n");
+	 
+	// Ok the all the ingredients are mixed in let's cook this puppy...
+	fputs($socket, ".\r\n");
+	server_parse($socket, "250");
+	 
+	// Now tell the server we are done and close the socket...
+	fputs($socket, "QUIT\r\n");
+	fclose($socket);
+	 
+	return TRUE;
+	 
+}
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/submenus_handler.php 75/e107_handlers/submenus_handler.php
--- 6171/e107_handlers/submenus_handler.php	2004-03-30 09:08:54.000000000 -0600
+++ 75/e107_handlers/submenus_handler.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,119 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/classes/submenus_handler.php
-|
-|	Lolo Irie (e107 Core Team) 2004
-|	http://touchatou.org
-|	lolo_irie@touchatou.org
-|	http://e107.org (Jalist Website)
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-
-// Function to create automatically submenu links
-// Return message
-function create_submenu(){
-	global $sub_url,$sub_name,$sub_getcat,$sub_getcatfield,$sub_getcatsql,$sub_suburl;
-	$sql = new db;
-	$sql2 = new db;
-	// Check main link
-	$mess= "";
-	if(!$sql -> db_Select("links", "link_id,link_name,link_url", "link_category='1' AND link_name NOT REGEXP('submenu') AND (link_url='".$sub_url."' OR link_url='".SITEURL.$sub_url."')")){
-		$sql2 -> db_Insert("links", "0, '".$sub_name."', '".$sub_url."', '', '', '1', '1', '0', '0', '0'");
-		$mainlinkname = $sub_name;
-		$mess .= LAN_MENGEN_25."<b>".$sub_name."</b><br />";
-	}else{
-		$row = $sql -> db_Fetch();
-		$mess .= LAN_MENGEN_26."<b>".$row[1]."</b>".LAN_MENGEN_27."<br />";
-		$mainlinkname = $row[1];
-	}
-	// Get news categories
-	$sql -> db_Select($sub_getcat, $sub_getcatfield, $sub_getcatsql);
-	$cnt_lc = 0;
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		$id_news[] = $row[0];
-		$label_news[] = $row[1];
-		$cnt_lc++;
-	}
-	$mess .= "<br />";
-	// Upgrade existing links
-	if($sql -> db_Select("links", "link_id, link_name, link_url", "link_category='1' AND link_name NOT REGEXP('submenu') AND link_url LIKE '%news.php?cat%'")){
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$sql2->db_Update("links", "link_name='submenu.".$mainlinkname.".".$row[1]."' WHERE link_id='".$row[0]."'");
-			$mess .= LAN_MENGEN_26."<b>".$row[1]."</b>".LAN_MENGEN_28.$mainlinkname."<br />";
-		}
-	}
-	
-	$mess .= "<br />";
-	// Create new links
-	for($i=0;$i<$cnt_lc;$i++){
-		if($sql->db_Select("links", "link_id,link_name,link_url", "link_category='1' AND link_name REGEXP('submenu') AND link_url LIKE'%".$sub_suburl.$id_news[$i]."%' ORDER BY link_order")){
-			while($row = $sql->db_Fetch()){
-				extract($row);
-				//$mess = LAN_MENGEN_10;
-				$namelink = explode(".",$row[1]);
-				$name_link = str_replace("submenu.".$namelink[1].".","",$row[1]);
-				$mess .= "<b>".$name_link."</b>".LAN_MENGEN_29."<br />";
-			}
-		}
-		else{
-			$sql2 -> db_Insert("links", "0, 'submenu.".$mainlinkname.".".$label_news[$i]."', '".$sub_suburl.$id_news[$i]."', '', '', '1', '".$i."', '0', '0', '0'");
-			$mess .= LAN_MENGEN_26."<b>".$label_news[$i]."</b>".LAN_MENGEN_30."<b>".$mainlinkname."</b>.".LAN_MENGEN_31."<br />";
-		}
-	}
-	$mess .= "<br /><br /><hr />";
-	return $mess;
-}
-
-// Function to create specific submenu links
-// Return message
-function create_customsubmenu(){
-	
-}
-
-// Function to delete submenu links
-// Return message
-function delete_submenu(){
-	global $sub_suburl, $sub_delall;
-	$sql = new db;
-	$sql2 = new db;
-	$mess= "";
-	if($sub_delall==1){
-		if($sql -> db_Select("links", "link_id, link_name", "link_category='1' AND link_name REGEXP('submenu')")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				$namelink = explode(".",$row[1]);
-				$name_link = str_replace("submenu.".$namelink[1].".","",$row[1]);
-				$sql2 -> db_Delete("links", "link_id='".$row[0]."'");
-				$mess .= LAN_MENGEN_26."<b>".$name_link."</b>".LAN_MENGEN_32."<br />";
-			}
-		}else{
-			$mess .= LAN_MENGEN_33;
-		}
-	}
-	else{
-		if($sql -> db_Select("links", "link_id, link_name", "link_category='1' AND link_name REGEXP('submenu') AND link_url LIKE'%".$sub_suburl."%'")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				$namelink = explode(".",$row[1]);
-				$name_link = str_replace("submenu.".$namelink[1].".","",$row[1]);
-				$sql2 -> db_Delete("links", "link_id='".$row[0]."'");
-				$mess .= LAN_MENGEN_26."<b>".$name_link."</b>".LAN_MENGEN_32."<br />";
-			}
-		}else{
-			$mess .= LAN_MENGEN_33;
-		}
-	}
-	$mess .= "<br /><br /><hr />";
-	return $mess;
-}
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/textparse/basic.php 75/e107_handlers/textparse/basic.php
--- 6171/e107_handlers/textparse/basic.php	2004-08-31 08:47:18.000000000 -0500
+++ 75/e107_handlers/textparse/basic.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,33 +0,0 @@
-<?php
-
-// Basic textparse function for flat files
-// Copyright: e107Dev Team (http://e107.org)
-
-class e107_basicparse{
-  
-  function e107in_basic($text){
-    $search = array("\"");
-    $replace = array("&quot;");
-    $text = str_replace($search, $replace, stripslashes($text));
-    
-    return $text;
-  }
-  
-  function e107out_basic($text){
-    $search = array("&quot;");
-    $replace = array("\"");
-    $text = str_replace($search, $replace, $text);
-    //$text = addslashes($text);
-    return $text;
-  }
-
-  // From the official php help
-  function unentity ($stringarray){
-      $trans_tbl = get_html_translation_table (HTML_ENTITIES);
-      $trans_tbl = array_flip ($trans_tbl);
-      return strtr ($stringarray, $trans_tbl);
-  }
-  
-}
-
-?>
diff -ruN 6171/e107_handlers/theme_handler.php 75/e107_handlers/theme_handler.php
--- 6171/e107_handlers/theme_handler.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/theme_handler.php	2006-04-29 01:29:37.000000000 -0500
@@ -0,0 +1,470 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/theme_handler.php,v $
+|     $Revision: 1.30 $
+|     $Date: 2006/04/29 06:29:37 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class themeHandler{
+
+	var $themeArray;
+	var $action;
+	var $id;
+
+	/* constructor */
+
+	function themeHandler() {
+
+		if (isset($_POST['upload'])) {
+			$this -> themeUpload();
+		}
+
+		$this -> themeArray = $this -> getThemes();
+
+		foreach($_POST as $key => $post)
+		{
+			if(strstr($key,"preview"))
+			{
+				$this -> id = str_replace("preview_", "", $key);
+				$this -> themePreview();
+			}
+			if(strstr($key,"selectmain"))
+			{
+				$this -> id = str_replace("selectmain_", "", $key);
+				$this -> setTheme();
+			}
+
+			if(strstr($key,"selectadmin"))
+			{
+				$this -> id = str_replace("selectadmin_", "", $key);
+				$this -> setAdminTheme();
+			}
+		}
+
+		if(isset($_POST['submit_adminstyle']))
+		{
+			$this -> setAdminStyle();
+		}
+
+		if(isset($_POST['submit_style']))
+		{
+			$this -> setStyle();
+		}
+
+	}
+
+	function getThemes($mode=FALSE)
+	{
+		$themeArray = array();
+		$tloop = 1;
+		$handle = opendir(e_THEME);
+		while (false !== ($file = readdir($handle))) {
+			if ($file != "." && $file != ".." && $file != "CVS" && $file != "templates" && is_dir(e_THEME.$file) && file_exists(e_THEME.$file."/theme.php")) {
+				if($mode == "id") {
+					$themeArray[$tloop] = $file;
+				} else {
+					$themeArray[$file]['id'] = $tloop;
+				}
+				$tloop++;
+				$STYLESHEET = FALSE;
+				if(!$mode) {
+					$handle2 = opendir(e_THEME.$file."/");
+					while (false !== ($file2 = readdir($handle2))) {
+						if ($file2 != "." && $file2 != ".." && $file != "CVS" && !is_dir(e_THEME.$file."/".$file2)) {
+							$themeArray[$file]['files'][] = $file2;
+							if(strstr($file2, "preview.")) {
+								$themeArray[$file]['preview'] = e_THEME.$file."/".$file2;
+							}
+							if(strstr($file2, "css") && !strstr($file2, "menu.css") && strpos($file2, "e_") !== 0 && strpos($file2, "admin_") !== 0)
+							{
+								/* get information string */
+								$fp=fopen(e_THEME.$file."/".$file2, "r");
+								$cssContents = fread ($fp, filesize(e_THEME.$file."/".$file2));
+								fclose($fp);
+								$nonadmin = preg_match('/\* Non-Admin(.*?)\*\//', $cssContents) ? true : false;
+								preg_match('/\* info:(.*?)\*\//', $cssContents, $match);
+								$themeArray[$file]['css'][] = array("name" => $file2, "info" => $match[1], "nonadmin" => $nonadmin);
+								if($STYLESHEET)
+								{
+									$themeArray[$file]['multipleStylesheets'] = TRUE;
+								}
+								else
+								{
+									$STYLESHEET = TRUE;
+								}
+								
+							}
+						}
+						$fp=fopen(e_THEME.$file."/theme.php", "r");
+						$themeContents = fread ($fp, filesize(e_THEME.$file."/theme.php"));
+						fclose($fp);
+						preg_match('/themename(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
+						$themeArray[$file]['name'] = $match[3];
+						preg_match('/themeversion(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
+						$themeArray[$file]['version'] = $match[3];
+						preg_match('/themeauthor(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
+						$themeArray[$file]['author'] = $match[3];
+						preg_match('/themeemail(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
+						$themeArray[$file]['email'] = $match[3];
+						preg_match('/themewebsite(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
+						$themeArray[$file]['website'] = $match[3];
+						preg_match('/themedate(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
+						$themeArray[$file]['date'] = $match[3];
+						preg_match('/themeinfo(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match);
+						$themeArray[$file]['info'] = $match[3];
+
+						preg_match('/xhtmlcompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match);
+						$xhtml = strtolower($match[2]);
+						$themeArray[$file]['xhtmlcompliant'] = ($xhtml == "true" ? true : false);
+
+						preg_match('/csscompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match);
+						$css = strtolower($match[2]);
+						$themeArray[$file]['csscompliant'] = ($css == "true" ? true : false);
+
+						if (!$themeArray[$file]['name'])
+						{
+							unset($themeArray[$file]);
+						}
+					}
+					closedir($handle2);
+				}
+			}
+		}
+		closedir($handle);
+		return $themeArray;
+	}
+
+	function themeUpload()
+	{
+		if (!$_POST['ac'] == md5(ADMINPWCHANGE)) {
+			exit;
+		}
+		global $ns;
+		extract($_FILES);
+		if(!is_writable(e_THEME)) {
+			$ns->tablerender(TPVLAN_16, TPVLAN_20);
+		} else {
+			require_once(e_HANDLER."upload_handler.php");
+			$fileName = $file_userfile['name'][0];
+			$fileSize = $file_userfile['size'][0];
+			$fileType = $file_userfile['type'][0];
+
+			if(strstr($file_userfile['type'][0], "gzip")) {
+				$fileType = "tar";
+			} else if (strstr($file_userfile['type'][0], "zip")) {
+				$fileType = "zip";
+			} else {
+				$ns->tablerender(TPVLAN_16, TPVLAN_17);
+				require_once("footer.php");
+				exit;
+			}
+
+			if ($fileSize) {
+
+				$uploaded = file_upload(e_THEME);
+
+				$archiveName = $uploaded[0]['name'];
+
+
+				if($fileType == "zip") {
+					require_once(e_HANDLER."pclzip.lib.php");
+					$archive = new PclZip(e_THEME.$archiveName);
+					$unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_THEME));
+					$unarc = ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_THEME, PCLZIP_OPT_SET_CHMOD, 0666));
+				} else {
+					require_once(e_HANDLER."pcltar.lib.php");
+					$unarc = ($fileList = PclTarExtract($archiveName, e_THEME));
+				}
+
+				if(!$unarc) {
+					if($fileType == "zip") {
+						$error = "PCLZIP extract error: '".$archive -> errorName(TRUE)."'";
+					} else {
+						$error = "PCLTAR extract error: ".PclErrorString().", code: ".intval(PclErrorCode());
+					}
+					$ns->tablerender(TPVLAN_16, TPVLAN_18." ".$archiveName." ".$error);
+					require_once("footer.php");
+					exit;
+				}
+
+				$folderName = substr($fileList[0]['stored_filename'], 0, (strpos($fileList[0]['stored_filename'], "/")));
+				$ns->tablerender(TPVLAN_16, "<div class='center'>".TPVLAN_19."</div>");
+
+				@unlink(e_THEME.$archiveName);
+			}
+		}
+	}
+
+	function showThemes()
+	{
+		global $ns, $pref;
+		echo "<div class='center'>
+		<form enctype='multipart/form-data' method='post' action='".e_SELF."'>\n";
+
+		foreach($this -> themeArray as $key => $theme)
+		{
+			if($key == $pref['sitetheme'])
+			{
+				$text = $this -> renderTheme(1, $theme);
+			}
+		}
+
+		$ns->tablerender(TPVLAN_26." :: ".TPVLAN_33, $text);
+
+		foreach($this -> themeArray as $key => $theme)
+		{
+			if($key == $pref['admintheme'])
+			{
+				$text = $this -> renderTheme(2, $theme);
+			}
+		}
+		$ns->tablerender(TPVLAN_26." :: ".TPVLAN_34, $text);
+
+
+		if(!is_writable(e_THEME)) {
+			$ns->tablerender(TPVLAN_16, TPVLAN_15);
+			$text = "";
+		} else {
+			$text = "<div style='text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td class='forumheader3' style='width: 50%;'>".TPVLAN_13."</td>
+			<td class='forumheader3' style='width: 50%;'>
+			<input type='hidden' name='MAX_FILE_SIZE' value='1000000' />
+			<input type='hidden' name='ac' value='".md5(ADMINPWCHANGE)."' />
+			<input class='tbox' type='file' name='file_userfile[]' size='50' />
+			</td>
+			</tr>
+			<tr>
+			<td colspan='2' style='text-align:center' class='forumheader'>
+			<input class='button' type='submit' name='upload' value='".TPVLAN_14."' />
+			</td>
+			</tr>
+			</table>
+			<br /></div>\n";
+		}
+
+		$ns->tablerender(TPVLAN_26." :: ".TPVLAN_38, $text);
+		$text = "";
+		foreach($this -> themeArray as $key => $theme)
+		{
+			if($key != $pref['admintheme'] && $key != $pref['sitetheme'])
+			{
+				$text .= $this -> renderTheme(FALSE, $theme);
+			}
+		}
+
+
+
+		$ns->tablerender(TPVLAN_26." :: ".TPVLAN_39, $text);
+		echo "</form>\n</div>\n";
+	}
+
+
+
+
+	function renderTheme($mode=FALSE, $theme)
+	{
+
+		/*
+		mode = 0 :: normal
+		mode = 1 :: selected site theme
+		mode = 2 :: selected admin theme
+		*/
+
+		global $ns, $pref;
+
+		$author = ($theme['email'] ? "<a href='mailto:".$theme['email']."' title='".$theme['email']."'>".$theme['author']."</a>" : $theme['author']);
+		$website = ($theme['website'] ? "<a href='".$theme['website']."' rel='external'>".$theme['website']."</a>" : "");
+		$preview = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >".($theme['preview'] ? "<img src='".$theme['preview']."' style='border: 1px solid #000;width:200px' alt='' />" : "<img src='".e_IMAGE."admin_images/nopreview.png' style='border:0px' title='".TPVLAN_12."' alt='' />")."</a>";
+		$selectmainbutton = ($mode != 1 ? "<input class='button' type='submit' name='selectmain_".$theme['id']."' value='".TPVLAN_10."' />" : "");
+		$selectadminbutton = ($mode != 2 ? "<input class='button' type='submit' name='selectadmin_".$theme['id']."' value='".TPVLAN_32."' />" : "");
+		$previewbutton = (!$mode ? "<input class='button' type='submit' name='preview_".$theme['id']."' value='".TPVLAN_9."' /> " : "");
+
+		$text = "<div style='text-align:center;margin-left:auto;margin-right:auto'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td class='forumheader3' style='width:202px; text-align:center; vertical-align:top'>$preview
+		<br />
+		<br />
+		<b><span class='mediumtext'>".$theme['name']."</span></b><br />".TPVLAN_11." ".$theme['version']."
+		<br />
+		</td>
+		<td class='forumheader3' style='vertical-align:top'>";
+		
+		$itext .= $author ? "<tr><td style='vertical-align:top; width:24%'><b>".TPVLAN_4."</b>:</td><td style='vertical-align:top'>".$author."</td></tr>" : "";
+		$itext .= $website ? "<tr><td style='vertical-align:top; width:24%'><b>".TPVLAN_5."</b>:</td><td style='vertical-align:top'>".$website."</td></tr>" : "";
+		$itext .= $theme['date'] ? "<tr><td style='vertical-align:top; width:24%'><b>".TPVLAN_6."</b>:</td><td style='vertical-align:top'>".$theme['date']."</td></tr>" : "";
+		$itext .= $theme['info'] ? "<tr><td style='vertical-align:top; width:24%'><b>".TPVLAN_7."</b>:</td><td style='vertical-align:top'>".$theme['info']."</td></tr>" : "";
+		$itext .= !$mode ? "<tr><td style='vertical-align:top'><b>".TPVLAN_8."</b>:</td><td style='vertical-align:top'>".$previewbutton.$selectmainbutton.$selectadminbutton."</td></tr>" : "";
+		if ($itext) {
+			$text .= "<table cellspacing='3' style='width:97%'>".$itext."</table>";
+		}
+
+		if(array_key_exists("multipleStylesheets", $theme))
+		{
+			if($mode)
+			{
+				$text .= "<table cellspacing='3' style='width:97%'>
+				<tr><td style='vertical-align:top; width:50%;'><b>".TPVLAN_27.":</b></td><td style='vertical-align:top width:50%;'>\n";
+				foreach($theme['css'] as $css)
+				{
+
+					if($mode == 2)
+					{
+						if (!$css['nonadmin']) {
+							$text .= "
+							<input type='radio' name='admincss' value='".$css['name']."' ".($pref['admincss'] == $css['name'] || (!$pref['admincss'] && $css['name'] == "style.css") ? " checked='checked'" : "")." /><b>".$css['name'].":</b><br />".($css['info'] ? $css['info'] : ($css['name'] == "style.css" ? TPVLAN_23 : TPVLAN_24))."<br />\n";
+						}
+					}
+
+					if($mode == 1)
+					{
+						$text .= "
+						<input type='radio' name='themecss' value='".$css['name']."' ".($pref['themecss'] == $css['name'] || (!$pref['themecss'] && $css['name'] == "style.css") ? " checked='checked'" : "")." /><b>".$css['name'].":</b><br />".($css['info'] ? $css['info'] : ($css['name'] == "style.css" ? TPVLAN_23 : TPVLAN_24))."<br />\n";
+					}
+				}
+				$text .= "</td></tr></table>";
+
+			}
+			else
+			{
+				$text .= "<br /><br /><b>".TPVLAN_22.": </b><br />";
+				foreach($theme['css'] as $css)
+				{
+					$text .= "<b>".$css['name'].":</b> ".($css['info'] ? $css['info'] : ($css['name'] == "style.css" ? TPVLAN_23 : TPVLAN_24))."<br />";
+				}
+			}
+		}
+
+			if($mode == 1)
+			{
+				$text .= "<table cellspacing='3' style='width:97%'>
+
+				<tr>
+				<td style='vertical-align:top; width:50%;'><b>".TPVLAN_30."</b></td><td style='vertical-align:top width:50%;'>
+				<input type='radio' name='image_preload' value='1'".($pref['image_preload'] ? " checked='checked'" : "")." /> ".TPVLAN_28."&nbsp;&nbsp;
+				<input type='radio' name='image_preload' value='0'".(!$pref['image_preload'] ? " checked='checked'" : "")." /> ".TPVLAN_29."
+				</td>
+				</tr>
+				<tr>
+				<td colspan='2' class='center'>
+				<input class='button' type='submit' name='submit_style' value='".TPVLAN_35."' /> ".$selectadminbutton."
+				</td></tr></table>";
+			}
+
+		if($mode == 2)
+		{
+
+			$astext = "";
+			require_once(e_HANDLER."file_class.php");
+			$file = new e_file;
+
+			$adminstyles = $file -> get_files(e_ADMIN."includes");
+
+			$astext = "<select name='adminstyle' class='tbox'>\n";
+
+			foreach($adminstyles as $as)
+			{
+				$style = str_replace(".php", "", $as['fname']);
+				$astext .= "<option".($pref['adminstyle'] == $style ? " selected='selected'" : "").">".$style."</option>\n";
+			}
+			$astext .= "</select>";
+
+			$text .= "<br /><br /><table cellspacing='3' style='width:97%'>
+			<tr><td style='vertical-align:top; width:50%;'><b>".TPVLAN_41.":</b></td><td style='vertical-align:top width:50%;'>$astext</td></tr>
+			<td colspan='2' class='center'>
+			<input class='button' type='submit' name='submit_adminstyle' value='".TPVLAN_42."' /> ".$selectmainbutton."
+			</td>
+			</table>\n";
+		}
+
+
+		if($theme['xhtmlcompliant'])
+		{
+			$text .= "<img src='".e_IMAGE."generic/valid-xhtml11_small.png' alt='' style='border: 0;' /> ";
+		}
+
+		if($theme['csscompliant'])
+		{
+			$text .= "<img src='".e_IMAGE."generic/vcss_small.png' alt='' style='border: 0;' /> ";
+		}
+
+
+		$text .= "</td></tr></table></div>\n";
+		return $text;
+
+	}
+
+	function themePreview()
+	{
+		echo "<script type='text/javascript'>document.location.href='".e_BASE."news.php?themepreview.".$this -> id."'</script>\n";
+		exit;
+	}
+
+	function showPreview()
+	{
+		@include_once(e_LANGUAGE."admin/lan_theme.php");
+		@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_theme.php");
+		$text = "<br /><div class='indent'>".TPVLAN_1.".</div><br />";
+		global $ns;
+		$ns->tablerender(TPVLAN_2, $text);
+	}
+
+	function setTheme()
+	{
+		global $pref, $e107cache, $ns;
+		$themeArray = $this -> getThemes("id");
+		$pref['sitetheme'] = $themeArray[$this -> id];
+		$pref['themecss'] ='style.css';
+		$e107cache->clear();
+		save_prefs();
+		$ns->tablerender("Admin Message", "<br /><div style='text-align:center;'>".TPVLAN_3." <b>'".$themeArray[$this -> id]."'</b>.</div><br />");
+	}
+
+	function setAdminTheme()
+	{
+		global $pref, $e107cache, $ns;
+		$themeArray = $this -> getThemes("id");
+		$pref['admintheme'] = $themeArray[$this -> id];
+		$pref['admincss'] = file_exists(THEME.'admin_style.css') ? 'admin_style.css' : 'style.css';
+		$e107cache->clear();
+		save_prefs();
+		$ns->tablerender("Admin Message", "<br /><div style='text-align:center;'>".TPVLAN_40." <b>'".$themeArray[$this -> id]."'</b>.</div><br />");
+	}
+
+	function setStyle()
+	{
+		global $pref, $e107cache, $ns;
+		$pref['themecss'] = $_POST['themecss'];
+		$pref['image_preload'] = $_POST['image_preload'];
+		$e107cache->clear();
+		save_prefs();
+		$ns->tablerender(TPVLAN_36, "<br /><div style='text-align:center;'>".TPVLAN_37.".</div><br />");
+	}
+
+	function setAdminStyle()
+	{
+		global $pref, $e107cache, $ns;
+		$pref['admincss'] = $_POST['admincss'];
+		$pref['adminstyle'] = $_POST['adminstyle'];
+		$e107cache->clear();
+		save_prefs();
+		$ns->tablerender(TPVLAN_36, "<br /><div style='text-align:center;'>".TPVLAN_43.".</div><br />");
+	}
+
+}
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/blank.htm 75/e107_handlers/tiny_mce/blank.htm
--- 6171/e107_handlers/tiny_mce/blank.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/blank.htm	2005-09-07 08:32:50.000000000 -0500
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>blank_page</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+</head>
+<body class="mceContentBody">
+
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/filelist.php 75/e107_handlers/tiny_mce/filelist.php
--- 6171/e107_handlers/tiny_mce/filelist.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/filelist.php	2006-04-04 23:55:34.000000000 -0500
@@ -0,0 +1,33 @@
+<?php
+require_once("../../class2.php");
+require_once(e_HANDLER."file_class.php");
+if(!ADMIN){
+exit;
+}
+// $fl = new e_file;
+
+// $rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$',"thumb_", 'index');
+// $imagelist = $fl->get_files(e_IMAGE."newspost_images/","",$rejecthumb);
+
+$sql->db_Select("download");
+		$c = 0;
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			$filelist['id'][$c] = $download_id;
+			$filelist['url'][$c] = $download_url;
+			$filelist['name'][$c] = $download_name;
+			$c++;
+		}
+
+echo "var tinyMCELinkList = new Array(";
+for ($i=0; $i<count($filelist['id']); $i++) {
+echo "['".$filelist['name'][$i]."', '".SITEURL."request.php?".$filelist['id'][$i]."']\n\n";
+echo ($i != (count($filelist['id'])-1)) ? "," : "";
+};
+
+echo ");";
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/langs/en.js 75/e107_handlers/tiny_mce/langs/en.js
--- 6171/e107_handlers/tiny_mce/langs/en.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/langs/en.js	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,41 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+bold_desc : 'Bold (Ctrl+B)',
+italic_desc : 'Italic (Ctrl+I)',
+underline_desc : 'Underline (Ctrl+U)',
+striketrough_desc : 'Strikethrough',
+justifyleft_desc : 'Align left',
+justifycenter_desc : 'Align center',
+justifyright_desc : 'Align right',
+justifyfull_desc : 'Align full',
+bullist_desc : 'Unordered list',
+numlist_desc : 'Ordered list',
+outdent_desc : 'Outdent',
+indent_desc : 'Indent',
+undo_desc : 'Undo (Ctrl+Z)',
+redo_desc : 'Redo (Ctrl+Y)',
+link_desc : 'Insert/edit link',
+unlink_desc : 'Unlink',
+image_desc : 'Insert/edit image',
+cleanup_desc : 'Cleanup messy code',
+focus_alert : 'A editor instance must be focused before using this command.',
+edit_confirm : 'Do you want to use the WYSIWYG mode for this textarea?',
+insert_link_title : 'Insert/edit link',
+insert : 'Insert',
+update : 'Update',
+cancel : 'Cancel',
+insert_link_url : 'Link URL',
+insert_link_target : 'Target',
+insert_link_target_same : 'Open link in the same window',
+insert_link_target_blank : 'Open link in a new window',
+insert_image_title : 'Insert/edit image',
+insert_image_src : 'Image URL',
+insert_image_alt : 'Image description',
+help_desc : 'Help',
+bold_img : "bold.gif",
+italic_img : "italic.gif",
+underline_img : "underline.gif",
+clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
+popup_blocked : 'Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.'
+});
diff -ruN 6171/e107_handlers/tiny_mce/plugins/contextmenu/contextmenu.css 75/e107_handlers/tiny_mce/plugins/contextmenu/contextmenu.css
--- 6171/e107_handlers/tiny_mce/plugins/contextmenu/contextmenu.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/contextmenu/contextmenu.css	2005-05-28 07:04:37.000000000 -0500
@@ -0,0 +1,60 @@
+.contextMenuIEPopup {
+	padding: 0px;
+	margin: 0px;
+	border: 0px;
+	overflow: hidden;
+}
+
+.contextMenu {
+	position: absolute;
+	cursor: default;
+	z-index: 1000;
+	border: 1px solid #D4D0C8;
+	background-color: #FFFFFF;
+}
+
+.contextMenuItem, .contextMenuItemOver {
+}
+
+.contextMenuItemOver {
+	background-color: #B6BDD2;
+}
+
+.contextMenuSeparator {
+	width: 100%;
+	background-color: #D4D0C8;
+	border: 0px;
+}
+
+.contextMenuImage, .contextMenuItemDisabled {
+	border: 0px;
+}
+
+.contextMenuIcon {
+	background-color: #F0F0EE;
+}
+
+.contextMenuItemOver .contextMenuIcon {
+	background-color: #B6BDD2;
+}
+
+.contextMenuIcon {
+	background-color: #F0F0EE;
+}
+
+.contextMenuItemDisabled img {
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+	-moz-opacity:0.3;
+	opacity: 0.3;
+}
+
+.contextMenuText {
+	font-family: Tahoma, Verdana, Arial, Helvetica;
+	font-size: 11px;
+	margin-left: 5px;
+	margin-right: 10px;
+}
+
+.contextMenuItemDisabled {
+	color: #AAAAAA;
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/contextmenu/css/contextmenu.css 75/e107_handlers/tiny_mce/plugins/contextmenu/css/contextmenu.css
--- 6171/e107_handlers/tiny_mce/plugins/contextmenu/css/contextmenu.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/contextmenu/css/contextmenu.css	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,74 @@
+.contextMenuIEPopup {
+	padding: 0;
+	margin: 0;
+	border: 0;
+	overflow: hidden;
+}
+
+.contextMenu {
+	position: absolute;
+	cursor: default;
+	z-index: 1000;
+	border: 1px solid #D4D0C8;
+	background-color: #FFFFFF;
+}
+
+.contextMenuItem, .contextMenuItemOver {
+}
+
+.contextMenuSeparator {
+	width: 100%;
+	background-color: #D4D0C8;
+	border: 0;
+}
+
+.contextMenuImage, .contextMenuItemDisabled {
+	border: 0;
+}
+
+.contextMenuIcon {
+	background-color: #F0F0EE;
+}
+
+.contextMenuItemOver .contextMenuIcon {
+	background-color: #B6BDD2;
+}
+
+.contextMenuIcon {
+	background-color: #F0F0EE;
+}
+
+.contextMenuItemDisabled img {
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+	-moz-opacity:0.3;
+	opacity: 0.3;
+}
+
+.contextMenuText {
+	font-family: Tahoma, Verdana, Arial, Helvetica;
+	font-size: 11px;
+	line-height: 20px;
+}
+
+.contextMenuItemDisabled {
+	color: #AAAAAA;
+}
+
+.contextMenuText a {
+	display: block;
+	line-height: 20px;
+	width: 100%;
+	text-decoration: none;
+	color: black;
+	font-weight: normal;
+	margin: 0;
+	padding: 0;
+}
+
+.contextMenuText a:hover {
+	background-color: #B6BDD2;
+	text-decoration: none !important;
+	font-weight: normal;
+	margin: 0;
+	padding: 0;
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin.js 75/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin.js
--- 6171/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1 @@
+if(!tinyMCE.settings['contextmenu_skip_plugin_css']){tinyMCE.loadCSS(tinyMCE.baseURL+"/plugins/contextmenu/css/contextmenu.css");}var TinyMCE_ContextMenuPlugin={_contextMenu:null,getInfo:function(){return{longname:'Context menus',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isMSIE5_0&&tinyMCE.isOpera)return;TinyMCE_ContextMenuPlugin._contextMenu=new TinyMCE_ContextMenu({commandhandler:"TinyMCE_ContextMenuPlugin._commandHandler",spacer_image:tinyMCE.baseURL+"/plugins/contextmenu/images/spacer.gif"});tinyMCE.addEvent(inst.getDoc(),"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"contextmenu",function(e){TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?inst.contentWindow.event:e,inst);});}else tinyMCE.addEvent(inst.getDoc(),"contextmenu",TinyMCE_ContextMenuPlugin._onContextMenu);},_onContextMenu:function(e){var elm=tinyMCE.isMSIE?e.srcElement:e.target;var targetInst,body;if((body=tinyMCE.getParentElement(elm,"body"))!=null){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(body==inst.getBody()){targetInst=inst;break;}}return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?targetInst.contentWindow.event:e,targetInst);}},_showContextMenu:function(e,inst){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}var x,y,elm,contextMenu;var pos=tinyMCE.getAbsPosition(inst.iframeElement);x=tinyMCE.isMSIE?e.screenX:pos.absLeft+(e.pageX-inst.getBody().scrollLeft);y=tinyMCE.isMSIE?e.screenY:pos.absTop+(e.pageY-inst.getBody().scrollTop);elm=tinyMCE.isMSIE?e.srcElement:e.target;contextMenu=this._contextMenu;contextMenu.inst=inst;window.setTimeout(function(){var theme=tinyMCE.getParam("theme");contextMenu.clearAll();var sel=inst.selection.getSelectedText().length!=0||elm.nodeName=="IMG";contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_cut_desc","Cut","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_copy_desc","Copy","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_paste_desc","Paste","",false);if(sel||(elm?(elm.nodeName=='A')||(elm.nodeName=='IMG'):false)){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/link.gif","$lang_link_desc",inst.hasPlugin("advlink")?"mceAdvLink":"mceLink");contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/unlink.gif","$lang_unlink_desc","unlink","",(elm?(elm.nodeName!='A')&&(elm.nodeName!='IMG'):true));}elm=tinyMCE.getParentElement(elm,"img,table,td"+(inst.hasPlugin("advhr")?',hr':''));if(elm){switch(elm.nodeName){case"IMG":contextMenu.addSeparator();if(tinyMCE.getAttrib(elm,'class').indexOf('mceItemFlash')!=-1)contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_flash_props","mceFlash");else contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/image.gif","$lang_image_props_desc",inst.hasPlugin("advimage")?"mceAdvImage":"mceImage");break;case"HR":contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/advhr/images/advhr.gif","$lang_insert_advhr_desc","mceAdvancedHr");break;case"TABLE":case"TD":if(inst.hasPlugin("table")){var colspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"colspan");var rowspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_table_cut_row_desc","mceTableCutRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_table_copy_row_desc","mceTableCopyRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_before_desc","mceTablePasteRowBefore","",inst.tableRowClipboard==null);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_after_desc","mceTablePasteRowAfter","",inst.tableRowClipboard==null);contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_props_desc","mceInsertTable");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_cell_props.gif","$lang_table_cell_desc","mceTableCellProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete.gif","$lang_table_del","mceTableDelete");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_row_props.gif","$lang_table_row_desc","mceTableRowProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_before.gif","$lang_table_row_before_desc","mceTableInsertRowBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_after.gif","$lang_table_row_after_desc","mceTableInsertRowAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_row.gif","$lang_table_delete_row_desc","mceTableDeleteRow");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_before.gif","$lang_table_col_before_desc","mceTableInsertColBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_after.gif","$lang_table_col_after_desc","mceTableInsertColAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_col.gif","$lang_table_delete_col_desc","mceTableDeleteCol");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_split_cells.gif","$lang_table_split_cells_desc","mceTableSplitCells","",(colspan=="1"&&rowspan=="1"));contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_merge_cells.gif","$lang_table_merge_cells_desc","mceTableMergeCells","",false);}break;}}else{if(inst.hasPlugin("table")){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");}}contextMenu.show(x,y);},10);tinyMCE.cancelEvent(e);return false;},_hideContextMenu:function(){if(TinyMCE_ContextMenuPlugin._contextMenu)TinyMCE_ContextMenuPlugin._contextMenu.hide();},_commandHandler:function(command,value){var cm=TinyMCE_ContextMenuPlugin._contextMenu;cm.hide();var ui=false;if(command=="mceInsertTable"||command=="mceTableCellProps"||command=="mceTableRowProps"||command=="mceTableMergeCells")ui=true;if(command=="Paste")value=null;if(tinyMCE.getParam("dialog_type")=="modal"&&tinyMCE.isMSIE){window.setTimeout(function(){cm.inst.execCommand(command,ui,value);},100);}else cm.inst.execCommand(command,ui,value);}};tinyMCE.addPlugin("contextmenu",TinyMCE_ContextMenuPlugin);function TinyMCE_ContextMenu(settings){function defParam(key,def_val){settings[key]=typeof(settings[key])!="undefined"?settings[key]:def_val;}var self=this;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="contextMenu";this.contextMenuDiv.setAttribute("class","contextMenu");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position='absolute';this.contextMenuDiv.style.zindex=1000;this.contextMenuDiv.style.left='0';this.contextMenuDiv.style.top='0';this.contextMenuDiv.unselectable="on";document.body.appendChild(this.contextMenuDiv);defParam("commandhandler","");defParam("spacer_image","images/spacer.gif");this.items=new Array();this.settings=settings;this.html="";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop=window.createPopup();doc=this.pop.document;doc.open();doc.write('<html><head><link href="'+tinyMCE.baseURL+'/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');doc.close();}};TinyMCE_ContextMenu.prototype={clearAll:function(){this.html="";this.contextMenuDiv.innerHTML="";},addSeparator:function(){this.html+='<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="'+this.settings['spacer_image']+'" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="'+this.settings['spacer_image']+'" /></td></tr>';},addItem:function(icon,title,command,value,disabled){if(title.charAt(0)=='$')title=tinyMCE.getLang(title.substring(1));var onMouseDown='';var html='';if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)onMouseDown='contextMenu.execCommand(\''+command+'\', \''+value+'\');return false;';else onMouseDown=this.settings['commandhandler']+'(\''+command+'\', \''+value+'\');return false;';if(icon=="")icon=this.settings['spacer_image'];if(!disabled)html+='<tr class="contextMenuItem">';else html+='<tr class="contextMenuItemDisabled">';html+='<td class="contextMenuIcon"><img src="'+icon+'" width="20" height="20" class="contextMenuImage" /></td>';html+='<td><div class="contextMenuText">';html+='<a href="javascript:void(0);" onclick="'+onMouseDown+'" onmousedown="return false;">&#160;';html+=title;html+='&#160;</a>';html+='</div></td>';html+='</tr>';this.html+=html;},show:function(x,y){var vp,width,height;if(this.html=="")return;var html='';html+='<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';html+=this.html;html+='</table>';this.contextMenuDiv.innerHTML=html;this.contextMenuDiv.style.display="block";width=this.contextMenuDiv.offsetWidth;height=this.contextMenuDiv.offsetHeight;this.contextMenuDiv.style.display="none";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop.document.body.innerHTML='<div class="contextMenu">'+html+"</div>";this.pop.document.tinyMCE=tinyMCE;this.pop.document.contextMenu=this;this.pop.show(x,y,width,height);}else{vp=this.getViewPort();this.contextMenuDiv.style.left=(x>vp.width-width?vp.width-width:x)+'px';this.contextMenuDiv.style.top=(y>vp.height-height?vp.height-height:y)+'px';this.contextMenuDiv.style.display="block";}},getViewPort:function(){return{width:document.documentElement.offsetWidth||document.body.offsetWidth,height:self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight};},hide:function(){if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera)this.pop.hide();else this.contextMenuDiv.style.display="none";},execCommand:function(command,value){eval(this.settings['commandhandler']+"(command, value);");}};
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin_src.js 75/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin_src.js
--- 6171/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin_src.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/contextmenu/editor_plugin_src.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,356 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.8 $
+ * $Date: 2006/05/06 03:05:15 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+//tinyMCE.importPluginLanguagePack('contextmenu', 'en,tr,zh_cn,cs,fa,fr_ca,fr,de,nb');
+if (!tinyMCE.settings['contextmenu_skip_plugin_css']) {
+	tinyMCE.loadCSS(tinyMCE.baseURL + "/plugins/contextmenu/css/contextmenu.css");
+}
+
+var TinyMCE_ContextMenuPlugin = {
+	// Private fields
+	_contextMenu : null,
+
+	getInfo : function() {
+		return {
+			longname : 'Context menus',
+			author : 'Moxiecode Systems',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	initInstance : function(inst) {
+		// Is not working on MSIE 5.0 or Opera no contextmenu event
+		if (tinyMCE.isMSIE5_0 && tinyMCE.isOpera)
+			return;
+
+		TinyMCE_ContextMenuPlugin._contextMenu = new TinyMCE_ContextMenu({
+			commandhandler : "TinyMCE_ContextMenuPlugin._commandHandler",
+			spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif"
+		});
+
+		// Add hide event handles
+		tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
+		tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
+		tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
+		tinyMCE.addEvent(document, "click", TinyMCE_ContextMenuPlugin._hideContextMenu);
+		tinyMCE.addEvent(document, "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu);
+		tinyMCE.addEvent(document, "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu);
+
+		// Attach contextmenu event
+		if (tinyMCE.isGecko) {
+			tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);});
+		} else
+			tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_ContextMenuPlugin._onContextMenu);
+	},
+
+	// Private plugin internal methods
+
+	_onContextMenu : function(e) {
+		var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
+		var targetInst, body;
+
+		// Find instance
+		if ((body = tinyMCE.getParentElement(elm, "body")) != null) {
+			for (var n in tinyMCE.instances) {
+				var inst = tinyMCE.instances[n];
+				if (!tinyMCE.isInstance(inst))
+					continue;
+
+				if (body == inst.getBody()) {
+					targetInst = inst;
+					break;
+				}
+			}
+
+			return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst);
+		}
+	},
+
+	_showContextMenu : function(e, inst) {
+		function getAttrib(elm, name) {
+			return elm.getAttribute(name) ? elm.getAttribute(name) : "";
+		}
+
+		var x, y, elm, contextMenu;
+		var pos = tinyMCE.getAbsPosition(inst.iframeElement);
+
+		x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft);
+		y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop);
+		elm = tinyMCE.isMSIE ? e.srcElement : e.target;
+
+		contextMenu = this._contextMenu;
+		contextMenu.inst = inst;
+
+		// Mozilla needs some time
+		window.setTimeout(function () {
+			var theme = tinyMCE.getParam("theme");
+
+			contextMenu.clearAll();
+			var sel = inst.selection.getSelectedText().length != 0 || elm.nodeName == "IMG";
+
+			// Default items
+			contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel);
+			contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel);
+			contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false);
+
+			if (sel || (elm ? (elm.nodeName == 'A') || (elm.nodeName == 'IMG') : false)) {
+				contextMenu.addSeparator();
+				contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/link.gif", "$lang_link_desc", inst.hasPlugin("advlink") ? "mceAdvLink" : "mceLink");
+				contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/unlink.gif", "$lang_unlink_desc", "unlink", "", (elm ? (elm.nodeName != 'A') && (elm.nodeName != 'IMG') : true));
+			}
+
+			// Get element
+			elm = tinyMCE.getParentElement(elm, "img,table,td" + (inst.hasPlugin("advhr") ? ',hr' : ''));
+			if (elm) {
+				switch (elm.nodeName) {
+					case "IMG":
+						contextMenu.addSeparator();
+
+						// If flash
+						if (tinyMCE.getAttrib(elm, 'class').indexOf('mceItemFlash') != -1)
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash");
+						else
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", inst.hasPlugin("advimage") ? "mceAdvImage" : "mceImage");
+						break;
+
+					case "HR":
+						contextMenu.addSeparator();
+						contextMenu.addItem(tinyMCE.baseURL + "/plugins/advhr/images/advhr.gif", "$lang_insert_advhr_desc", "mceAdvancedHr");
+						break;
+
+					case "TABLE":
+					case "TD":
+						// Is table plugin loaded
+						if (inst.hasPlugin("table")) {
+							var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan");
+							var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan");
+
+							colspan = colspan == "" ? "1" : colspan;
+							rowspan = rowspan == "" ? "1" : rowspan;
+
+							contextMenu.addSeparator();
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow");
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow");
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null);
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null);
+
+	/*						contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyleft.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false);
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifycenter.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false);
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyright.gif", "$lang_justifyright_desc", "JustifyRight", "", false);
+							contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyfull.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/
+							contextMenu.addSeparator();
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable");
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps");
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete.gif", "$lang_table_del", "mceTableDelete");
+							contextMenu.addSeparator();
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps");
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_row_before_desc", "mceTableInsertRowBefore");
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_row_after_desc", "mceTableInsertRowAfter");
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow");
+							contextMenu.addSeparator();
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_col_before_desc", "mceTableInsertColBefore");
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_col_after_desc", "mceTableInsertColAfter");
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol");
+							contextMenu.addSeparator();
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1"));
+							contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false);
+						}
+						break;
+				}
+			}  else {
+				// Add table specific
+				if (inst.hasPlugin("table")) {
+					contextMenu.addSeparator();
+					contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert");
+				}
+			}
+
+			contextMenu.show(x, y);
+		}, 10);
+
+		// Cancel default handeling
+		tinyMCE.cancelEvent(e);
+		return false;
+	},
+
+	_hideContextMenu : function() {
+		if (TinyMCE_ContextMenuPlugin._contextMenu)
+			TinyMCE_ContextMenuPlugin._contextMenu.hide();
+	},
+
+	_commandHandler : function(command, value) {
+		var cm = TinyMCE_ContextMenuPlugin._contextMenu;
+
+		cm.hide();
+
+		// UI must be true on these
+		var ui = false;
+		if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells")
+			ui = true;
+
+		if (command == "Paste")
+			value = null;
+
+		if (tinyMCE.getParam("dialog_type") == "modal" && tinyMCE.isMSIE) {
+			// Cell properties will generate access denied error is this isn't done?!
+			window.setTimeout(function() {
+				cm.inst.execCommand(command, ui, value);
+			}, 100);
+		} else
+			cm.inst.execCommand(command, ui, value);
+	}
+};
+
+tinyMCE.addPlugin("contextmenu", TinyMCE_ContextMenuPlugin);
+
+// Context menu class
+
+function TinyMCE_ContextMenu(settings) {
+	// Default value function
+	function defParam(key, def_val) {
+		settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val;
+	}
+
+	var self = this;
+
+	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+
+	// Setup contextmenu div
+	this.contextMenuDiv = document.createElement("div");
+	this.contextMenuDiv.className = "contextMenu";
+	this.contextMenuDiv.setAttribute("class", "contextMenu");
+	this.contextMenuDiv.style.display = "none";
+	this.contextMenuDiv.style.position = 'absolute';
+	this.contextMenuDiv.style.zindex = 1000;
+	this.contextMenuDiv.style.left = '0';
+	this.contextMenuDiv.style.top = '0';
+	this.contextMenuDiv.unselectable = "on";
+
+	document.body.appendChild(this.contextMenuDiv);
+
+	// Setup default values
+	defParam("commandhandler", "");
+	defParam("spacer_image", "images/spacer.gif");
+
+	this.items = new Array();
+	this.settings = settings;
+	this.html = "";
+
+	// IE Popup
+	if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
+		this.pop = window.createPopup();
+		doc = this.pop.document;
+		doc.open();
+		doc.write('<html><head><link href="' + tinyMCE.baseURL + '/plugins/contextmenu/css/contextmenu.css" rel="stylesheet" type="text/css" /></head><body unselectable="yes" class="contextMenuIEPopup"></body></html>');
+		doc.close();
+	}
+};
+
+TinyMCE_ContextMenu.prototype = {
+	clearAll : function() {
+		this.html = "";
+		this.contextMenuDiv.innerHTML = "";
+	},
+
+	addSeparator : function() {
+		this.html += '<tr class="contextMenuItem"><td class="contextMenuIcon"><img src="' + this.settings['spacer_image'] + '" width="20" height="1" class="contextMenuImage" /></td><td><img class="contextMenuSeparator" width="1" height="1" src="' + this.settings['spacer_image'] + '" /></td></tr>';
+	},
+
+	addItem : function(icon, title, command, value, disabled) {
+		if (title.charAt(0) == '$')
+			title = tinyMCE.getLang(title.substring(1));
+
+		var onMouseDown = '';
+		var html = '';
+
+		if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0)
+			onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;';
+		else
+			onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;';
+
+		if (icon == "")
+			icon = this.settings['spacer_image'];
+
+		if (!disabled)
+			html += '<tr class="contextMenuItem">';
+		else
+			html += '<tr class="contextMenuItemDisabled">';
+
+		html += '<td class="contextMenuIcon"><img src="' + icon + '" width="20" height="20" class="contextMenuImage" /></td>';
+		html += '<td><div class="contextMenuText">';
+		html += '<a href="javascript:void(0);" onclick="' + onMouseDown + '" onmousedown="return false;">&#160;';
+
+		// Add text
+		html += title;
+
+		html += '&#160;</a>';
+		html += '</div></td>';
+		html += '</tr>';
+
+		// Add to main
+		this.html += html;
+	},
+
+	show : function(x, y) {
+		var vp, width, height;
+
+		if (this.html == "")
+			return;
+
+		var html = '';
+
+		html += '<a href="#"></a><table border="0" cellpadding="0" cellspacing="0">';
+		html += this.html;
+		html += '</table>';
+
+		this.contextMenuDiv.innerHTML = html;
+
+		// Get dimensions
+		this.contextMenuDiv.style.display = "block";
+		width = this.contextMenuDiv.offsetWidth;
+		height = this.contextMenuDiv.offsetHeight;
+		this.contextMenuDiv.style.display = "none";
+
+		if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) {
+			// Setup popup and show
+			this.pop.document.body.innerHTML = '<div class="contextMenu">' + html + "</div>";
+			this.pop.document.tinyMCE = tinyMCE;
+			this.pop.document.contextMenu = this;
+			this.pop.show(x, y, width, height);
+		} else {
+			vp = this.getViewPort();
+
+			this.contextMenuDiv.style.left = (x > vp.width - width ? vp.width - width : x) + 'px';
+			this.contextMenuDiv.style.top = (y > vp.height - height ? vp.height - height : y) + 'px';
+			this.contextMenuDiv.style.display = "block";
+		}
+	},
+
+	getViewPort : function() {
+		return {
+			width : document.documentElement.offsetWidth || document.body.offsetWidth,
+			height : self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight
+		};
+	},
+
+	hide : function() {
+		if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera)
+			this.pop.hide();
+		else
+			this.contextMenuDiv.style.display = "none";
+	},
+
+	execCommand : function(command, value) {
+		eval(this.settings['commandhandler'] + "(command, value);");
+	}
+};
Files 6171/e107_handlers/tiny_mce/plugins/contextmenu/images/spacer.gif and 75/e107_handlers/tiny_mce/plugins/contextmenu/images/spacer.gif differ
diff -ruN 6171/e107_handlers/tiny_mce/plugins/emoticons/editor_plugin.js 75/e107_handlers/tiny_mce/plugins/emoticons/editor_plugin.js
--- 6171/e107_handlers/tiny_mce/plugins/emoticons/editor_plugin.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/emoticons/editor_plugin.js	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,56 @@
+
+tinyMCE.importPluginLanguagePack('emoticons', 'en');
+
+// Plucin static class
+var TinyMCE_emoticonsPlugin = {
+	getInfo : function() {
+		return {
+			longname : 'emoticons',
+			author : 'CaMer0n',
+			authorurl : 'http://e107coders.org',
+			infourl : 'http://www.e107.org',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	/**
+	 * Returns the HTML contents of the emoticons control.
+	 */
+	getControlHTML : function(cn) {
+		switch (cn) {
+			case "emoticons":
+				return tinyMCE.getButtonHTML(cn, 'lang_emoticons_desc', '{$pluginurl}/images/emoticons.png', 'mceEmotion');
+		}
+
+		return "";
+	},
+
+	/**
+	 * Executes the mceEmotion command.
+	 */
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		// Handle commands
+		switch (command) {
+			case "mceEmotion":
+				var template = new Array();
+
+				template['file'] = '../../plugins/emoticons/emoticons.php'; // Relative to theme
+				template['width'] = 200;
+				template['height'] = 200;
+
+				// Language specific width and height addons
+				template['width'] += tinyMCE.getLang('lang_emoticons_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_emoticons_delta_height', 0);
+
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+
+				return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	}
+};
+
+// Register plugin
+tinyMCE.addPlugin('emoticons', TinyMCE_emoticonsPlugin);
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/plugins/emoticons/emoticons.php 75/e107_handlers/tiny_mce/plugins/emoticons/emoticons.php
--- 6171/e107_handlers/tiny_mce/plugins/emoticons/emoticons.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/emoticons/emoticons.php	2006-03-07 12:27:44.000000000 -0600
@@ -0,0 +1,48 @@
+<?php
+require_once("../../../../class2.php");
+if(!USER || check_class($pref['post_html']) == FALSE){
+exit;
+}
+$HEADER = "";
+require_once(HEADERF);
+
+
+	$emotes = $sysprefs->getArray("emote_".$pref['emotepack']);
+	$str = "<div class='spacer' style='white-space:wrap;width:130px;text-align:center'>";
+    foreach($emotes as $key => $value){
+		$key = str_replace("!", ".", $key);
+		$key = preg_replace("#_(\w{3})$#", ".\\1", $key);
+		$value2 = substr($value, 0, strpos($value, " "));
+		$value = ($value2 ? $value2 : $value);
+		$str .= "\n<a href='javascript:void(0);' onmousedown=\"javascript:insertEmotion('$key')\"><img src=\"".e_IMAGE_ABS."emotes/" . $pref['emotepack'] . "/$key\" style=\"border:0; padding-top:2px;\" alt=\"\" /></a> ";
+	}
+
+	$str .= "</div>";
+
+ echo $str;
+
+function headerjs(){
+	global $pref;
+	$js = "<script type='text/javascript' src='../../tiny_mce_popup.js'></script>";
+	$js .= " <script type='text/javascript'>
+
+    function init() {
+		tinyMCEPopup.resizeToInnerSize();
+	}
+
+	function insertEmotion(file_name, title) {
+		var html = '<img src=\'".e_IMAGE_ABS."emotes/".$pref['emotepack']."/' + file_name + '\' style=\'border:0px\' alt=\'' + file_name + '\' />';
+		tinyMCE.execCommand('mceInsertContent', false, html);
+		tinyMCEPopup.close();
+	}
+	";
+
+	$js .= "</script>";
+	return $js;
+
+}
+
+echo "</body></html>";
+
+
+?>
\ No newline at end of file
Files 6171/e107_handlers/tiny_mce/plugins/emoticons/images/emoticons.png and 75/e107_handlers/tiny_mce/plugins/emoticons/images/emoticons.png differ
diff -ruN 6171/e107_handlers/tiny_mce/plugins/emoticons/langs/en.js 75/e107_handlers/tiny_mce/plugins/emoticons/langs/en.js
--- 6171/e107_handlers/tiny_mce/plugins/emoticons/langs/en.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/emoticons/langs/en.js	2005-09-24 10:21:57.000000000 -0500
@@ -0,0 +1,5 @@
+// UK lang variables
+
+tinyMCELang['lang_insert_emotions_title'] = 'Insert emotion';
+tinyMCELang['lang_emotions_desc'] = 'Emotions';
+
diff -ruN 6171/e107_handlers/tiny_mce/plugins/flash/css/content.css 75/e107_handlers/tiny_mce/plugins/flash/css/content.css
--- 6171/e107_handlers/tiny_mce/plugins/flash/css/content.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/flash/css/content.css	2005-09-24 10:21:57.000000000 -0500
@@ -0,0 +1,7 @@
+.mceItemFlash {
+	border: 1px dotted #cc0000;
+	background-image: url('../images/flash.gif');
+	background-position: center;
+	background-repeat: no-repeat;
+	background-color: #ffffcc;
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/flash/css/flash.css 75/e107_handlers/tiny_mce/plugins/flash/css/flash.css
--- 6171/e107_handlers/tiny_mce/plugins/flash/css/flash.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/flash/css/flash.css	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,11 @@
+.panel_wrapper div.current {
+	height: 100px;
+}
+
+#width, #height {
+	width: 50px;
+}
+
+#file {
+	width: 250px;
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/flash/editor_plugin.js 75/e107_handlers/tiny_mce/plugins/flash/editor_plugin.js
--- 6171/e107_handlers/tiny_mce/plugins/flash/editor_plugin.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/flash/editor_plugin.js	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('flash','en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk,pt_br');var TinyMCE_FlashPlugin={getInfo:function(){return{longname:'Flash',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_flash.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(!tinyMCE.settings['flash_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/flash/css/content.css");},getControlHTML:function(cn){switch(cn){case"flash":return tinyMCE.getButtonHTML(cn,'lang_flash_desc','{$pluginurl}/images/flash.gif','mceFlash');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceFlash":var name="",swffile="",swfwidth="",swfheight="",action="insert";var template=new Array();var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();template['file']='../../plugins/flash/flash.htm';template['width']=430;template['height']=175;template['width']+=tinyMCE.getLang('lang_flash_delta_width',0);template['height']+=tinyMCE.getLang('lang_flash_delta_height',0);if(focusElm!=null&&focusElm.nodeName.toLowerCase()=="img"){name=tinyMCE.getAttrib(focusElm,'class');if(name.indexOf('mceItemFlash')==-1)return true;swffile=tinyMCE.getAttrib(focusElm,'alt');if(tinyMCE.getParam('convert_urls'))swffile=eval(tinyMCE.settings['urlconverter_callback']+"(swffile, null, true);");swfwidth=tinyMCE.getAttrib(focusElm,'width');swfheight=tinyMCE.getAttrib(focusElm,'height');action="update";}tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",swffile:swffile,swfwidth:swfwidth,swfheight:swfheight,action:action});return true;}return false;},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":if(tinyMCE.getParam('convert_urls')){var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){if(tinyMCE.getAttrib(imgs[i],"class")=="mceItemFlash"){var src=tinyMCE.getAttrib(imgs[i],"alt");if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('alt',src);imgs[i].setAttribute('title',src);}}}break;case"get_from_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){if(tinyMCE.getAttrib(imgs[i],"class")=="mceItemFlash"){var src=tinyMCE.getAttrib(imgs[i],"alt");if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, null, true);");imgs[i].setAttribute('alt',src);imgs[i].setAttribute('title',src);}}break;case"insert_to_editor":var startPos=0;var embedList=new Array();content=content.replace(new RegExp('<[ ]*embed','gi'),'<embed');content=content.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');content=content.replace(new RegExp('<[ ]*object','gi'),'<object');content=content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');while((startPos=content.indexOf('<embed',startPos+1))!=-1){var endPos=content.indexOf('>',startPos);var attribs=TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos+6,endPos));embedList[embedList.length]=attribs;}var index=0;while((startPos=content.indexOf('<object',startPos))!=-1){if(index>=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('</object>',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+='<img width="'+attribs["width"]+'" height="'+attribs["height"]+'"';content+=' src="'+(tinyMCE.getParam("theme_href")+'/images/spacer.gif')+'" title="'+attribs["src"]+'"';content+=' alt="'+attribs["src"]+'" class="mceItemFlash" />'+content.substring(endPos);content+=contentAfter;index++;startPos++;}var index=0;while((startPos=content.indexOf('<embed',startPos))!=-1){if(index>=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('>',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+='<img width="'+attribs["width"]+'" height="'+attribs["height"]+'"';content+=' src="'+(tinyMCE.getParam("theme_href")+'/images/spacer.gif')+'" title="'+attribs["src"]+'"';content+=' alt="'+attribs["src"]+'" class="mceItemFlash" />'+content.substring(endPos);content+=contentAfter;index++;startPos++;}break;case"get_from_editor":var startPos=-1;while((startPos=content.indexOf('<img',startPos+1))!=-1){var endPos=content.indexOf('/>',startPos);var attribs=TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos+4,endPos));if(attribs['class']!="mceItemFlash")continue;endPos+=2;var embedHTML='';var wmode=tinyMCE.getParam("flash_wmode","");var quality=tinyMCE.getParam("flash_quality","high");var menu=tinyMCE.getParam("flash_menu","false");embedHTML+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';embedHTML+=' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';embedHTML+=' width="'+attribs["width"]+'" height="'+attribs["height"]+'">';embedHTML+='<param name="movie" value="'+attribs["title"]+'" />';embedHTML+='<param name="quality" value="'+quality+'" />';embedHTML+='<param name="menu" value="'+menu+'" />';embedHTML+='<param name="wmode" value="'+wmode+'" />';embedHTML+='<embed src="'+attribs["title"]+'" wmode="'+wmode+'" quality="'+quality+'" menu="'+menu+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+attribs["width"]+'" height="'+attribs["height"]+'"></embed></object>';chunkBefore=content.substring(0,startPos);chunkAfter=content.substring(endPos);content=chunkBefore+embedHTML+chunkAfter;}break;}return content;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&tinyMCE.getAttrib(node,'class').indexOf('mceItemFlash')==0){tinyMCE.switchClass(editor_id+'_flash','mceButtonSelected');return true;}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_flash','mceButtonNormal');return true;},_parseAttributes:function(attribute_string){var attributeName="";var attributeValue="";var withInName;var withInValue;var attributes=new Array();var whiteSpaceRegExp=new RegExp('^[ \n\r\t]+','g');if(attribute_string==null||attribute_string.length<2)return null;withInName=withInValue=false;for(var i=0;i<attribute_string.length;i++){var chr=attribute_string.charAt(i);if((chr=='"'||chr=="'")&&!withInValue)withInValue=true;else if((chr=='"'||chr=="'")&&withInValue){withInValue=false;var pos=attributeName.lastIndexOf(' ');if(pos!=-1)attributeName=attributeName.substring(pos+1);attributes[attributeName.toLowerCase()]=attributeValue.substring(1);attributeName="";attributeValue="";}else if(!whiteSpaceRegExp.test(chr)&&!withInName&&!withInValue)withInName=true;if(chr=='='&&withInName)withInName=false;if(withInName)attributeName+=chr;if(withInValue)attributeValue+=chr;}return attributes;}};tinyMCE.addPlugin("flash",TinyMCE_FlashPlugin);
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/plugins/flash/editor_plugin_src.js 75/e107_handlers/tiny_mce/plugins/flash/editor_plugin_src.js
--- 6171/e107_handlers/tiny_mce/plugins/flash/editor_plugin_src.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/flash/editor_plugin_src.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,287 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.14 $
+ * $Date: 2006/05/06 03:05:15 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('flash', 'en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk,pt_br');
+
+var TinyMCE_FlashPlugin = {
+	getInfo : function() {
+		return {
+			longname : 'Flash',
+			author : 'Moxiecode Systems',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_flash.html',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	initInstance : function(inst) {
+		if (!tinyMCE.settings['flash_skip_plugin_css'])
+			tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/flash/css/content.css");
+	},
+
+	getControlHTML : function(cn) {
+		switch (cn) {
+			case "flash":
+				return tinyMCE.getButtonHTML(cn, 'lang_flash_desc', '{$pluginurl}/images/flash.gif', 'mceFlash');
+		}
+
+		return "";
+	},
+
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		// Handle commands
+		switch (command) {
+			case "mceFlash":
+				var name = "", swffile = "", swfwidth = "", swfheight = "", action = "insert";
+				var template = new Array();
+				var inst = tinyMCE.getInstanceById(editor_id);
+				var focusElm = inst.getFocusElement();
+
+				template['file']   = '../../plugins/flash/flash.htm'; // Relative to theme
+				template['width']  = 430;
+				template['height'] = 175;
+
+				template['width'] += tinyMCE.getLang('lang_flash_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_flash_delta_height', 0);
+
+				// Is selection a image
+				if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
+					name = tinyMCE.getAttrib(focusElm, 'class');
+
+					if (name.indexOf('mceItemFlash') == -1) // Not a Flash
+						return true;
+
+					// Get rest of Flash items
+					swffile = tinyMCE.getAttrib(focusElm, 'alt');
+
+					if (tinyMCE.getParam('convert_urls'))
+						swffile = eval(tinyMCE.settings['urlconverter_callback'] + "(swffile, null, true);");
+
+					swfwidth = tinyMCE.getAttrib(focusElm, 'width');
+					swfheight = tinyMCE.getAttrib(focusElm, 'height');
+					action = "update";
+				}
+
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", swffile : swffile, swfwidth : swfwidth, swfheight : swfheight, action : action});
+			return true;
+	   }
+
+	   // Pass to next handler in chain
+	   return false;
+	},
+
+	cleanup : function(type, content) {
+		switch (type) {
+			case "insert_to_editor_dom":
+				// Force relative/absolute
+				if (tinyMCE.getParam('convert_urls')) {
+					var imgs = content.getElementsByTagName("img");
+					for (var i=0; i<imgs.length; i++) {
+						if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
+							var src = tinyMCE.getAttrib(imgs[i], "alt");
+
+							if (tinyMCE.getParam('convert_urls'))
+								src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
+
+							imgs[i].setAttribute('alt', src);
+							imgs[i].setAttribute('title', src);
+						}
+					}
+				}
+				break;
+
+			case "get_from_editor_dom":
+				var imgs = content.getElementsByTagName("img");
+				for (var i=0; i<imgs.length; i++) {
+					if (tinyMCE.getAttrib(imgs[i], "class") == "mceItemFlash") {
+						var src = tinyMCE.getAttrib(imgs[i], "alt");
+
+						if (tinyMCE.getParam('convert_urls'))
+							src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);");
+
+						imgs[i].setAttribute('alt', src);
+						imgs[i].setAttribute('title', src);
+					}
+				}
+				break;
+
+			case "insert_to_editor":
+				var startPos = 0;
+				var embedList = new Array();
+
+				// Fix the embed and object elements
+				content = content.replace(new RegExp('<[ ]*embed','gi'),'<embed');
+				content = content.replace(new RegExp('<[ ]*/embed[ ]*>','gi'),'</embed>');
+				content = content.replace(new RegExp('<[ ]*object','gi'),'<object');
+				content = content.replace(new RegExp('<[ ]*/object[ ]*>','gi'),'</object>');
+
+				// Parse all embed tags
+				while ((startPos = content.indexOf('<embed', startPos+1)) != -1) {
+					var endPos = content.indexOf('>', startPos);
+					var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 6, endPos));
+					embedList[embedList.length] = attribs;
+				}
+
+				// Parse all object tags and replace them with images from the embed data
+				var index = 0;
+				while ((startPos = content.indexOf('<object', startPos)) != -1) {
+					if (index >= embedList.length)
+						break;
+
+					var attribs = embedList[index];
+
+					// Find end of object
+					endPos = content.indexOf('</object>', startPos);
+					endPos += 9;
+
+					// Insert image
+					var contentAfter = content.substring(endPos);
+					content = content.substring(0, startPos);
+					content += '<img width="' + attribs["width"] + '" height="' + attribs["height"] + '"';
+					content += ' src="' + (tinyMCE.getParam("theme_href") + '/images/spacer.gif') + '" title="' + attribs["src"] + '"';
+					content += ' alt="' + attribs["src"] + '" class="mceItemFlash" />' + content.substring(endPos);
+					content += contentAfter;
+					index++;
+
+					startPos++;
+				}
+
+				// Parse all embed tags and replace them with images from the embed data
+				var index = 0;
+				while ((startPos = content.indexOf('<embed', startPos)) != -1) {
+					if (index >= embedList.length)
+						break;
+
+					var attribs = embedList[index];
+
+					// Find end of embed
+					endPos = content.indexOf('>', startPos);
+					endPos += 9;
+
+					// Insert image
+					var contentAfter = content.substring(endPos);
+					content = content.substring(0, startPos);
+					content += '<img width="' + attribs["width"] + '" height="' + attribs["height"] + '"';
+					content += ' src="' + (tinyMCE.getParam("theme_href") + '/images/spacer.gif') + '" title="' + attribs["src"] + '"';
+					content += ' alt="' + attribs["src"] + '" class="mceItemFlash" />' + content.substring(endPos);
+					content += contentAfter;
+					index++;
+
+					startPos++;
+				}
+
+				break;
+
+			case "get_from_editor":
+				// Parse all img tags and replace them with object+embed
+				var startPos = -1;
+
+				while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
+					var endPos = content.indexOf('/>', startPos);
+					var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 4, endPos));
+
+					// Is not flash, skip it
+					if (attribs['class'] != "mceItemFlash")
+						continue;
+
+					endPos += 2;
+
+					var embedHTML = '';
+					var wmode = tinyMCE.getParam("flash_wmode", "");
+					var quality = tinyMCE.getParam("flash_quality", "high");
+					var menu = tinyMCE.getParam("flash_menu", "false");
+
+					// Insert object + embed
+					embedHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
+					embedHTML += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"';
+					embedHTML += ' width="' + attribs["width"] + '" height="' + attribs["height"] + '">';
+					embedHTML += '<param name="movie" value="' + attribs["title"] + '" />';
+					embedHTML += '<param name="quality" value="' + quality + '" />';
+					embedHTML += '<param name="menu" value="' + menu + '" />';
+					embedHTML += '<param name="wmode" value="' + wmode + '" />';
+					embedHTML += '<embed src="' + attribs["title"] + '" wmode="' + wmode + '" quality="' + quality + '" menu="' + menu + '" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + attribs["width"] + '" height="' + attribs["height"] + '"></embed></object>';
+
+					// Insert embed/object chunk
+					chunkBefore = content.substring(0, startPos);
+					chunkAfter = content.substring(endPos);
+					content = chunkBefore + embedHTML + chunkAfter;
+				}
+				break;
+		}
+
+		// Pass through to next handler in chain
+		return content;
+	},
+
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+		if (node == null)
+			return;
+
+		do {
+			if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItemFlash') == 0) {
+				tinyMCE.switchClass(editor_id + '_flash', 'mceButtonSelected');
+				return true;
+			}
+		} while ((node = node.parentNode));
+
+		tinyMCE.switchClass(editor_id + '_flash', 'mceButtonNormal');
+
+		return true;
+	},
+
+	// Private plugin internal functions
+
+	_parseAttributes : function(attribute_string) {
+		var attributeName = "";
+		var attributeValue = "";
+		var withInName;
+		var withInValue;
+		var attributes = new Array();
+		var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
+
+		if (attribute_string == null || attribute_string.length < 2)
+			return null;
+
+		withInName = withInValue = false;
+
+		for (var i=0; i<attribute_string.length; i++) {
+			var chr = attribute_string.charAt(i);
+
+			if ((chr == '"' || chr == "'") && !withInValue)
+				withInValue = true;
+			else if ((chr == '"' || chr == "'") && withInValue) {
+				withInValue = false;
+
+				var pos = attributeName.lastIndexOf(' ');
+				if (pos != -1)
+					attributeName = attributeName.substring(pos+1);
+
+				attributes[attributeName.toLowerCase()] = attributeValue.substring(1);
+
+				attributeName = "";
+				attributeValue = "";
+			} else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
+				withInName = true;
+
+			if (chr == '=' && withInName)
+				withInName = false;
+
+			if (withInName)
+				attributeName += chr;
+
+			if (withInValue)
+				attributeValue += chr;
+		}
+
+		return attributes;
+	}
+};
+
+tinyMCE.addPlugin("flash", TinyMCE_FlashPlugin);
diff -ruN 6171/e107_handlers/tiny_mce/plugins/flash/flash.css 75/e107_handlers/tiny_mce/plugins/flash/flash.css
--- 6171/e107_handlers/tiny_mce/plugins/flash/flash.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/flash/flash.css	2005-06-11 14:48:42.000000000 -0500
@@ -0,0 +1,7 @@
+.mce_plugin_flash {
+	border: 1px dotted #cc0000;
+	background-image: url(images/flash.gif);
+	background-position: center;
+	background-repeat: no-repeat;
+	background-color: #ffffcc;
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/flash/flash.htm 75/e107_handlers/tiny_mce/plugins/flash/flash.htm
--- 6171/e107_handlers/tiny_mce/plugins/flash/flash.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/flash/flash.htm	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,70 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_flash_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/flash.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<link href="css/flash.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+    <form onsubmit="insertFlash();return false;" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_flash_general}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{$lang_flash_general}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+							<tr>
+							<td nowrap="nowrap"><label for="file">{$lang_flash_file}</label></td>
+							  <td nowrap="nowrap">
+									<table border="0" cellspacing="0" cellpadding="0">
+									  <tr>
+										<td><input id="file" name="file" type="text" value="" onfocus="this.select();" /></td>
+										<td id="filebrowsercontainer">&nbsp;</td>
+									  </tr>
+									</table>
+								</td>
+							</tr>
+							<tr id="linklistrow">
+								<td><label for="linklist">{$lang_flash_list}</label></td>
+								<td id="linklistcontainer">&nbsp;</td>
+							</tr>
+							<tr>
+								<td nowrap="nowrap"><label>{$lang_flash_size}</label></td>
+								<td nowrap="nowrap">
+									<input type="text" id="width" name="width" value="" onfocus="this.select();" />
+									<select name="width2" id="width2" style="width: 50px">
+										<option value="">px</option>
+										<option value="%">%</option>
+									</select>&nbsp;x&nbsp;<input id="height" name="height" type="text"  value="" onfocus="this.select();" />
+									<select name="height2" id="height2" style="width: 50px">
+										<option value="">px</option>
+										<option value="%">%</option>
+									</select>
+								</td>
+							</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertFlash();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
Files 6171/e107_handlers/tiny_mce/plugins/flash/images/flash.gif and 75/e107_handlers/tiny_mce/plugins/flash/images/flash.gif differ
diff -ruN 6171/e107_handlers/tiny_mce/plugins/flash/jscripts/flash.js 75/e107_handlers/tiny_mce/plugins/flash/jscripts/flash.js
--- 6171/e107_handlers/tiny_mce/plugins/flash/jscripts/flash.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/flash/jscripts/flash.js	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,107 @@
+var url = tinyMCE.getParam("flash_external_list_url");
+if (url != null) {
+	// Fix relative
+	if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+		url = tinyMCE.documentBasePath + "/" + url;
+
+	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+}
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById("filebrowsercontainer").innerHTML = getBrowserHTML('filebrowser','file','flash','flash');
+
+	// Image list outsrc
+	var html = getFlashListHTML('filebrowser','file','flash','flash');
+	if (html == "")
+		document.getElementById("linklistrow").style.display = 'none';
+	else
+		document.getElementById("linklistcontainer").innerHTML = html;
+
+	var formObj = document.forms[0];
+	var swffile   = tinyMCE.getWindowArg('swffile');
+	var swfwidth  = '' + tinyMCE.getWindowArg('swfwidth');
+	var swfheight = '' + tinyMCE.getWindowArg('swfheight');
+
+	if (swfwidth.indexOf('%')!=-1) {
+		formObj.width2.value = "%";
+		formObj.width.value  = swfwidth.substring(0,swfwidth.length-1);
+	} else {
+		formObj.width2.value = "px";
+		formObj.width.value  = swfwidth;
+	}
+
+	if (swfheight.indexOf('%')!=-1) {
+		formObj.height2.value = "%";
+		formObj.height.value  = swfheight.substring(0,swfheight.length-1);
+	} else {
+		formObj.height2.value = "px";
+		formObj.height.value  = swfheight;
+	}
+
+	formObj.file.value = swffile;
+	formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true);
+
+	selectByValue(formObj, 'linklist', swffile);
+
+	// Handle file browser
+	if (isVisible('filebrowser'))
+		document.getElementById('file').style.width = '230px';
+
+	// Auto select flash in list
+	if (typeof(tinyMCEFlashList) != "undefined" && tinyMCEFlashList.length > 0) {
+		for (var i=0; i<formObj.linklist.length; i++) {
+			if (formObj.linklist.options[i].value == tinyMCE.getWindowArg('swffile'))
+				formObj.linklist.options[i].selected = true;
+		}
+	}
+}
+
+function getFlashListHTML() {
+	if (typeof(tinyMCEFlashList) != "undefined" && tinyMCEFlashList.length > 0) {
+		var html = "";
+
+		html += '<select id="linklist" name="linklist" style="width: 250px" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="this.form.file.value=this.options[this.selectedIndex].value;">';
+		html += '<option value="">---</option>';
+
+		for (var i=0; i<tinyMCEFlashList.length; i++)
+			html += '<option value="' + tinyMCEFlashList[i][1] + '">' + tinyMCEFlashList[i][0] + '</option>';
+
+		html += '</select>';
+
+		return html;
+	}
+
+	return "";
+}
+
+function insertFlash() {
+	var formObj = document.forms[0];
+	var html      = '';
+	var file      = formObj.file.value;
+	var width     = formObj.width.value;
+	var height    = formObj.height.value;
+	if (formObj.width2.value=='%') {
+		width = width + '%';
+	}
+	if (formObj.height2.value=='%') {
+		height = height + '%';
+	}
+
+	if (width == "")
+		width = 100;
+
+	if (height == "")
+		height = 100;
+
+	html += ''
+		+ '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" mce_src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '
+		+ 'width="' + width + '" height="' + height + '" '
+		+ 'border="0" alt="' + file + '" title="' + file + '" class="mceItemFlash" />';
+
+	tinyMCEPopup.execCommand("mceInsertContent", true, html);
+	tinyMCE.selectedInstance.repaint();
+
+	tinyMCEPopup.close();
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/flash/langs/en.js 75/e107_handlers/tiny_mce/plugins/flash/langs/en.js
--- 6171/e107_handlers/tiny_mce/plugins/flash/langs/en.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/flash/langs/en.js	2005-09-07 08:32:50.000000000 -0500
@@ -0,0 +1,11 @@
+// UK lang variables
+
+tinyMCE.addToLang('flash',{
+title : 'Insert / edit Flash Movie',
+desc : 'Insert / edit Flash Movie',
+file : 'Flash-File (.swf)',
+size : 'Size',
+list : 'Flash files',
+props : 'Flash properties',
+general : 'General'
+});
diff -ruN 6171/e107_handlers/tiny_mce/plugins/ibrowser/config.php 75/e107_handlers/tiny_mce/plugins/ibrowser/config.php
--- 6171/e107_handlers/tiny_mce/plugins/ibrowser/config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/ibrowser/config.php	2005-09-05 15:25:38.000000000 -0500
@@ -0,0 +1,55 @@
+<?php
+// ================================================
+// tinymce PHP WYSIWYG editor control
+// ================================================
+// Configuration file
+// ================================================
+// Developed: j-cons.com, mail@j-cons.com
+// Copyright: j-cons (c)2004 All rights reserved.
+// ------------------------------------------------
+//                                   www.j-cons.com
+// ================================================
+// v.1.0, 2004-10-04
+// ================================================
+
+// directory where tinymce files are located
+// $tinyMCE_dir = "/e107_0.7/e107_handlers/tiny_mce/";
+
+// base url for images
+$tinyMCE_base_url = SITEURL;
+
+// allowed extentions for uploaded image files
+$tinyMCE_valid_imgs = array('gif', 'jpg', 'jpeg', 'png');
+
+// allow upload in image library
+$tinyMCE_upload_allowed = false;
+
+// allow delete in image library
+$tinyMCE_img_delete_allowed = false;
+
+// image libraries
+$tinyMCE_imglibs = array(
+  array(
+    'value'   => $IMAGES_DIRECTORY,
+    'text'    => 'Images Root',
+  ),
+  array(
+    'value'   => $IMAGES_DIRECTORY."newspost_images/",
+    'text'    => 'Newspost Images',
+  ),
+  array(
+    'value'   => $IMAGES_DIRECTORY."icons/",
+    'text'    => 'Icons',
+  ),
+  array(
+    'value'   => $IMAGES_DIRECTORY."banners/",
+    'text'    => 'Banners',
+  ),
+  array(
+    'value'   => $IMAGES_DIRECTORY."generic/",
+    'text'    => 'Generic',
+  ),
+);
+// file to include in img_library.php (useful for setting $tinyMCE_imglibs dynamically
+// $tinyMCE_imglib_include = '';
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js 75/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js
--- 6171/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js	2006-04-05 00:37:10.000000000 -0500
@@ -0,0 +1,92 @@
+// Import theme specific language pack
+// $Source: /cvsroot/e107/e107_0.7/e107_handlers/tiny_mce/plugins/ibrowser/editor_plugin.js,v $
+// $Revision: 1.3 $
+// $Date: 2006/04/05 05:37:10 $
+// $Author: e107coders $
+
+tinyMCE.importPluginLanguagePack('ibrowser', 'en,es,da,de,fr,nl,pl,sv');
+
+// Returns the HTML contents of the ibrowser control.
+
+var TinyMCE_ibrowserPlugin = {
+	getInfo : function() {
+		return {
+			longname : 'ibrowser',
+			author : 'Your name',
+			authorurl : '',
+			infourl : '',
+			version : "1.1"
+		};
+	},
+
+	getControlHTML : function(cn) {
+		switch (cn) {
+			case "ibrowser":
+				return tinyMCE.getButtonHTML(cn, 'lang_ibrowser_desc', '{$pluginurl}/images/ibrowser.gif', 'mceBrowseImage', true);
+		}
+
+		return "";
+	},
+
+
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		// Handle commands
+		switch (command) {
+		case "mceBrowseImage":
+			var template = new Array();
+
+			template['file'] = '../../plugins/ibrowser/ibrowser.php'; // Relative to theme location
+			template['width'] = 480;
+			template['height'] = 670;
+
+			var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "";
+            var margin_left = "";
+			var margin_right = "";
+			var margin_top = "";
+			var margin_bottom = "";
+
+			if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
+				tinyMCE.imgElement = tinyMCE.selectedElement;
+
+            if (tinyMCE.imgElement) {
+                src = tinyMCE.imgElement.getAttribute('src') ? tinyMCE.imgElement.getAttribute('src') : "";
+                alt = tinyMCE.imgElement.getAttribute('alt') ? tinyMCE.imgElement.getAttribute('alt') : "";
+			}
+            /*
+
+                border = tinyMCE.imgElement.style.border ? tinyMCE.imgElement.style.border : "";
+                hspace = tinyMCE.imgElement.getAttribute('hspace') ? tinyMCE.imgElement.getAttribute('hspace') : "";
+                vspace = tinyMCE.imgElement.getAttribute('vspace') ? tinyMCE.imgElement.getAttribute('vspace') : "";
+                width = tinyMCE.imgElement.style.width ? tinyMCE.imgElement.style.width.replace('px','') : "";
+                height = tinyMCE.imgElement.style.height ? tinyMCE.imgElement.style.height.replace('px','') : "";
+                align = tinyMCE.imgElement.getAttribute('align') ? tinyMCE.imgElement.getAttribute('align') : "";
+
+                margin_left = tinyMCE.imgElement.style.marginLeft ? tinyMCE.imgElement.style.marginLeft.replace('px','') : "";
+                margin_right = tinyMCE.imgElement.style.marginRight ? tinyMCE.imgElement.style.marginRight.replace('px','') : "";
+                margin_top = tinyMCE.imgElement.style.marginTop ? tinyMCE.imgElement.style.marginTop.replace('px','') : "";
+                margin_bottom = tinyMCE.imgElement.style.marginBottom ? tinyMCE.imgElement.style.marginBottom.replace('px','') : "";
+
+                // Fix for drag-drop/copy paste bug in Mozilla
+                mceRealSrc = tinyMCE.imgElement.getAttribute('mce_real_src') ? tinyMCE.imgElement.getAttribute('mce_real_src') : "";
+                if (mceRealSrc != "")
+                    src = mceRealSrc;
+
+           //       src = eval(tinyMCE.settings['urlconvertor_callback'] + "(src, tinyMCE.imgElement, true);");
+            }
+*/
+				tinyMCE.openWindow(template, {editor_id : editor_id, src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align});
+				return true;
+	}
+
+   		// Pass to next handler in chain
+		return false;
+	}
+
+};
+
+
+tinyMCE.addPlugin("ibrowser", TinyMCE_ibrowserPlugin);
+
+
+
+
diff -ruN 6171/e107_handlers/tiny_mce/plugins/ibrowser/ibrowser.php 75/e107_handlers/tiny_mce/plugins/ibrowser/ibrowser.php
--- 6171/e107_handlers/tiny_mce/plugins/ibrowser/ibrowser.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/ibrowser/ibrowser.php	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,599 @@
+<?php
+// ================================================
+// tinymce PHP WYSIWYG editor control
+// ================================================
+// Image library dialog
+// ================================================
+// Developed: j-cons.com, mail@j-cons.com
+// Copyright: j-cons (c)2004 All rights reserved.
+// ------------------------------------------------
+//                                   www.j-cons.com
+// ================================================
+// $Revision: 1.4 $Date: 2004/10/04
+// ================================================
+//
+// $Source: /cvsroot/e107/e107_0.7/e107_handlers/tiny_mce/plugins/ibrowser/ibrowser.php,v $
+// $Revision: 1.4 $
+// $Date: 2006/03/03 05:07:12 $
+// $Author: e107coders $
+// +----------------------------------------------------------------------------+
+// Major Re-work by CaMer0n
+
+
+// unset $tinyMCE_imglib_include
+require_once("../../../../class2.php");
+if (!defined('e107_INIT')) { exit; }
+unset($tinyMCE_imglib_include);
+
+// include image library config settings
+include 'config.php';
+
+$request_uri = urldecode(empty($HTTP_POST_VARS['request_uri'])?(empty($HTTP_GET_VARS['request_uri'])?'':$HTTP_GET_VARS['request_uri']):$HTTP_POST_VARS['request_uri']);
+
+// if set include file specified in $tinyMCE_imglib_include
+if (!empty($tinyMCE_imglib_include))
+{
+  include $tinyMCE_imglib_include;
+}
+
+
+$imglib = isset($HTTP_POST_VARS['lib'])?$HTTP_POST_VARS['lib']:'';
+if (empty($imglib) && isset($HTTP_GET_VARS['lib'])) $imglib = $HTTP_GET_VARS['lib'];
+
+$value_found = false;
+// callback function for preventing listing of non-library directory
+function is_array_value($value, $key, $_imglib)
+{
+  global $value_found;
+  if (is_array($value)) array_walk($value, 'is_array_value',$_imglib);
+  if ($value == $_imglib){
+    $value_found=true;
+  }
+}
+array_walk($tinyMCE_imglibs, 'is_array_value',$imglib);
+
+if (!$value_found || empty($imglib))
+{
+  $imglib = $tinyMCE_imglibs[0]['value'];
+}
+$lib_options = liboptions($tinyMCE_imglibs,'',$imglib);
+
+
+$img = isset($HTTP_POST_VARS['imglist'])?$HTTP_POST_VARS['imglist']:'';
+
+$preview = '';
+
+$errors = array();
+if (isset($HTTP_POST_FILES['img_file']['size']) && $HTTP_POST_FILES['img_file']['size']>0)
+{
+  if ($img = uploadImg('img_file'))
+  {
+    $preview = $tinyMCE_base_url.$imglib.$img;
+  }
+}
+
+// delete image
+if ($tinyMCE_img_delete_allowed && isset($HTTP_POST_VARS['lib_action'])
+	&& ($HTTP_POST_VARS['lib_action']=='delete') && !empty($img)) {
+  deleteImg();
+}
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>{$lang_ibrowser_title}</title>
+<script type="text/javaScript" src="../../tiny_mce_popup.js"></script>
+<meta http-equiv="Pragma" content="no-cache">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<script type="text/javascript">
+	// click ok - select picture or save changes
+	function selectClick() {
+
+	 //	if (validateParams()) {
+			if (document.forms[0].src.value !='') {
+
+				var src = document.forms[0].src.value;
+				var alt = document.forms[0].alt.value;
+		 		var border = document.forms[0].border.value;
+		 		var width = document.forms[0].width.value;
+		 		var height = document.forms[0].height.value;
+
+				var margleft = document.forms[0].margin_left.value;
+                var margright = document.forms[0].margin_right.value;
+                var margtop = document.forms[0].margin_top.value;
+                var margbottom = document.forms[0].margin_bottom.value;
+
+		  		var cssfloat = document.forms[0].align.options[document.forms[0].align.selectedIndex].value;
+				var css_style = "";
+
+               	css_style = 'width:' + width + 'px; height:' + height + 'px; border:' + border + 'px solid black; ';
+                css_style = (cssfloat) ? css_style + 'float: ' + cssfloat + '; ' : css_style;
+				css_style = (margleft != 0) ? css_style + 'margin-left:' + margleft + 'px; ' : css_style;
+				css_style = (margright != 0) ? css_style + 'margin-right:' + margright + 'px; ' : css_style;
+				css_style = (margtop != 0) ? css_style + 'margin-top:' + margtop + 'px; ' : css_style;
+				css_style = (margbottom != 0) ? css_style + 'margin-bottom:' + margbottom + 'px; ' : css_style;
+
+				var html = '<img src=\''+ src +'\' alt=\''+ alt +'\'  style=\'' + css_style + '\'  />';
+
+  //				alert(html);
+			  	tinyMCE.execCommand('mceInsertContent',false,html);
+		   		tinyMCEPopup.close();
+
+			} else {
+			alert(tinyMCE.getLang('lang_ibrowser_error')+ ' : '+ tinyMCE.getLang('lang_ibrowser_errornoimg'));}
+      	}
+  //	}
+
+	// validate input values
+	function validateParams() {
+    	// check numeric values for attributes
+    	if (isNaN(parseInt(document.getElementById("width").value)) && document.getElementById("width").value != '') {
+ 				alert(tinyMCE.getLang('lang_ibrowser_error')+ ' : '+ tinyMCE.getLang('lang_ibrowser_error_width_nan'));
+ 				document.getElementById("width").focus();
+      		return false;}
+
+    	if (isNaN(parseInt(document.getElementById("height").value)) && document.getElementById("height").value != '') {
+ 				alert(tinyMCE.getLang('lang_ibrowser_error')+ ' : '+ tinyMCE.getLang('lang_ibrowser_error_height_nan'));
+      		document.getElementById("height").focus();
+     		return false;}
+
+    	if (isNaN(parseInt(document.getElementById("border").value)) && document.getElementById("border").value != '') {
+			alert(tinyMCE.getLang('lang_ibrowser_error')+ ' : '+ tinyMCE.getLang('lang_ibrowser_error_border_nan'));
+      		document.getElementById("border").focus();
+      		return false;}
+
+    	if (isNaN(parseInt(document.getElementById("hspace").value)) && document.getElementById("hspace").value != '') {
+			alert(tinyMCE.getLang('lang_ibrowser_error')+ ' : '+ tinyMCE.getLang('lang_ibrowser_error_hspace_nan'));
+			document.getElementById("hspace").focus();
+      		return false;}
+
+		if (isNaN(parseInt(document.getElementById("vspace").value)) && document.getElementById("vspace").value != '') {
+			alert(tinyMCE.getLang('lang_ibrowser_error')+ ' : '+ tinyMCE.getLang('lang_ibrowser_error_vspace_nan'));
+      		document.getElementById("vspace").focus();
+      		return false;}
+
+	return true;
+
+	}
+
+	// delete image
+	function deleteClick()
+	{
+		if (document.libbrowser.imglist.selectedIndex>=0)
+	  	{
+			if (confirm(tinyMCE.getLang('lang_ibrowser_confirmdelete')))
+			{
+				document.libbrowser.lib_action.value = 'delete';
+				document.libbrowser.submit();
+			}
+	  	}
+	}
+
+// set picture attributes on change
+	function selectChange(obj)
+	{
+		var formObj = document.forms[0];
+//		formObj.src.value = '<?php echo $tinyMCE_base_url.$imglib?>'+obj.options[obj.selectedIndex].value;
+//		formObj.width.value = obj.options[obj.selectedIndex].img_width;
+//		formObj.height.value = obj.options[obj.selectedIndex].img_height;
+//		formObj.size.value = obj.options[obj.selectedIndex].f_size;
+//		formObj.alt.value = obj.options[obj.selectedIndex].value;
+		var splitvar = obj.options[obj.selectedIndex].value.split("|");
+		formObj.src.value = '<?php echo $tinyMCE_base_url.$imglib?>'+splitvar[3];
+		formObj.width.value = splitvar[0];
+		formObj.height.value = splitvar[1];
+		formObj.size.value = splitvar[2];
+		formObj.alt.value = splitvar[3];
+
+		owidth = eval(formObj.width.value);
+		oheight = eval(formObj.height.value);
+		updateStyle()
+	}
+
+	// init functions
+	function init()
+	{
+		// if existing image (image properties)
+		if (tinyMCE.getWindowArg('src') != '') {
+
+			var formObj = document.forms[0];
+			for (var i=0; i<document.forms[0].align.options.length; i++) {
+				if (document.forms[0].align.options[i].value == tinyMCE.imgElement.style.cssFloat)
+				document.forms[0].align.options.selectedIndex = i;
+			}
+
+			formObj.src.value = tinyMCE.getWindowArg('src');
+			formObj.alt.value = tinyMCE.imgElement.alt;
+			formObj.border.value = tinyMCE.imgElement.style.borderLeftWidth.replace('px','');
+        	formObj.width.value = tinyMCE.imgElement.style.width.replace('px','');
+			formObj.height.value = tinyMCE.imgElement.style.height.replace('px','');
+			formObj.margin_left.value = tinyMCE.imgElement.style.marginLeft.replace('px','');
+			formObj.margin_right.value = tinyMCE.imgElement.style.marginRight.replace('px','');
+			formObj.margin_top.value = tinyMCE.imgElement.style.marginTop.replace('px','');
+			formObj.margin_bottom.value = tinyMCE.imgElement.style.marginBottom.replace('px','');
+
+			formObj.size.value = 'n/a';
+			owidth = eval(formObj.width.value);
+			oheight = eval(formObj.height.value);
+
+			frameID = "imgpreview";
+			//document.all(frameID).src = tinyMCE.getWindowArg('src');
+			document.getElementById("imgpreview").src = tinyMCE.getWindowArg('src');
+			updateStyle();
+		}
+
+		window.focus();
+	}
+
+	// updates style settings
+	function updateStyle() {
+	 //	if (validateParams()) {
+		  //	alert('val=' + document.getElementById('wrap').style.marginLeft);
+
+
+			document.getElementById('wrap').style.marginLeft = document.libbrowser.margin_left.value;
+			document.getElementById('wrap').style.marginRight = document.libbrowser.margin_right.value;
+			document.getElementById('wrap').style.marginTop = document.libbrowser.margin_top.value;
+			document.getElementById('wrap').style.marginBottom = document.libbrowser.margin_bottom.value;
+            document.getElementById('wrap').style.cssFloat = document.libbrowser.align.value;
+			document.getElementById('wrap').style.borderWidth = document.libbrowser.border.value;
+			document.getElementById('wrap').alt = document.libbrowser.alt.value;
+	 //	}
+	}
+
+	// change picture dimensions
+	var oheight; // original width
+	var owidth;  // original height
+
+	function changeDim(sel) {
+		var formObj = document.forms[0];
+		if (formObj.src.value!=''){
+			f=oheight/owidth;
+			if (sel==0){
+				formObj.width.value = Math.round(formObj.height.value/f);
+			} else {
+				formObj.height.value= Math.round(formObj.width.value*f);}
+		}
+	}
+
+	function resetDim() {
+ 		var formObj = document.forms[0];
+		formObj.width.value = owidth;
+		formObj.height.value = oheight;
+	}
+	function show_image(obj) {
+		var formObj = document.forms[0];
+		var splitvar = obj.options[obj.selectedIndex].value.split("|");
+		formObj.src.value = splitvar[3];
+	  // 	alert('<?php echo $tinyMCE_base_url.$imglib?>' + formObj.src.value);
+		if (splitvar[3]) imgpreview.location.href = '<?php echo $tinyMCE_base_url.$imglib?>' + formObj.src.value;
+	}
+</script>
+</head>
+<body onLoad="init();">
+<script type="text/javascript">
+    window.name = 'imglibrary';
+</script>
+<form name="libbrowser" method="post" action="ibrowser.php?request_uri=<?php echo $HTTP_GET_VARS['request_uri']?>" enctype="multipart/form-data" target="imglibrary">
+  <input type="hidden" name="request_uri" value="<?php echo urlencode($request_uri)?>">
+  <input type="hidden" name="lib_action" value="">
+  <fieldset style= "padding: 5 5 5 5; margin-top: -5px;">
+  <legend>{$lang_ibrowser_img_sel}</legend>
+  <table width="440" border="0" cellspacing="0" cellpadding="0">
+    <tr>
+      <td><table width="100%"  border="0" cellpadding="2" cellspacing="0">
+          <tr>
+            <td width="210"><strong>{$lang_ibrowser_library}:</strong></td>
+            <td width="5">&nbsp;</td>
+            <td width="210"><strong>{$lang_ibrowser_preview}:</strong></td>
+          </tr>
+          <tr>
+            <td><select name="lib" size="1" style="width: 100%;" onChange="libbrowser.submit();">
+                <?php echo $lib_options?>
+              </select></td>
+            <td>&nbsp;</td>
+            <td width="210" rowspan="3" align="left" valign="top"><iframe name="imgpreview" id="imgpreview" class="previewWindow" src="<?php echo $preview?>" style="width: 100%; height: 100%;" scrolling="Auto" marginheight="0" marginwidth="0" frameborder="0"></iframe>
+            </td>
+          </tr>
+          <tr>
+            <td><strong>{$lang_ibrowser_images}:</strong></td>
+            <td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td><?php
+    if (!preg_match('#/$#', $HTTP_SERVER_VARS['DOCUMENT_ROOT'])){
+    //  $_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'].'/';
+		$_root = e_BASE;
+   } else {
+   //   $_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
+      $_root = e_BASE;
+	}
+  //  $d = @dir($_root.$imglib);
+  //	echo "<Br >dir=".$_root.$imglib;
+	$d = @dir(e_BASE.$imglib);
+
+  ?>
+          <select name="imglist" size="15" style="width: 100%;"
+    onChange="show_image(this);selectChange(this);" ondblclick="selectClick();">
+            <?php
+    	if ($d)
+    {
+	  $i = 0;
+      while (false !== ($entry = $d->read())) {
+        $ext = strtolower(substr(strrchr($entry,'.'), 1));
+        if (is_file($_root.$imglib.$entry) && in_array($ext,$tinyMCE_valid_imgs))
+        {
+			$arr_tinyMCE_image_files[$i][file_name] = $entry;
+			$i++;
+        }
+      }
+      $d->close();
+	  // sort the list of image filenames alphabetically.
+	  sort($arr_tinyMCE_image_files);
+	  for($k=0; $k<count($arr_tinyMCE_image_files); $k++){
+      $entry = $arr_tinyMCE_image_files[$k][file_name];
+	  $size = getimagesize($tinyMCE_base_url.$imglib.$entry);
+	  $fsize = filesize($_root.$imglib.$entry);
+   ?>
+            <option img_width="<?php echo $size[0]; ?>" img_height="<?php echo $size[1]; ?>" f_size="<?php echo filesize_h($fsize,2); ?>" value="<?php echo $size[0]; ?>|<?php echo $size[1]; ?>|<?php echo filesize_h($fsize,2); ?>|<?php echo $entry?>" <?php echo ($entry == $img)?'selected':''?>><?php echo $entry?></option>
+            <?php
+	  }
+    }
+    else
+    {
+      $errors[] = '{$lang_ibrowser_errornodir}';
+    }
+  ?>
+          </select></td>
+            <td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td colspan="3"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td width="40%"><?php if ($tinyMCE_img_delete_allowed) { ?>
+                    <input type="button" value="{$lang_ibrowser_delete}" class="bt" onClick="deleteClick();">
+                    <?php } ?></td>
+                  <td align="right"><input type="button" name="selectbt" value="{$lang_ibrowser_select}" class="bt" onClick="selectClick();">
+                    <input type="button" value="{$lang_ibrowser_cancel}" class="bt" onClick="window.close();"></td>
+                </tr>
+              </table></td>
+          </tr>
+        </table></td>
+    </tr>
+  </table>
+  </fieldset>
+  <fieldset style= "padding: 5 5 5 5; margin-top: 10px;">
+  <legend>{$lang_ibrowser_img_info}</legend>
+  <table style='width:440px;border:0px' cellspacing="0" cellpadding="0">
+    <tr>
+      <td><table style='width:440px;border:0px' cellpadding="2" cellspacing="0">
+          <tr>
+            <td style='width:80px'>{$lang_ibrowser_src}:</td>
+            <td colspan="5"><input name="src" type="text" id="src" value="" style="width: 100%;" readonly="true"></td>
+          </tr>
+          <tr>
+            <td>{$lang_ibrowser_alt}:</td>
+            <td colspan="5"><input name="alt" type="text" id="alt" value="" style="width: 100%;" onChange="updateStyle()"></td>
+          </tr>
+          <tr>
+            <td>{$lang_ibrowser_align}:</td>
+            <td colspan="3"><select name="align" style="width: 100%;" onChange="updateStyle()">
+                <option value="">{$lang_insert_image_align_default}</option>
+                <option value="left">{$lang_insert_image_align_left}</option>
+                <option value="right">{$lang_insert_image_align_right}</option>
+              </select></td>
+            <td width="5">&nbsp;</td>
+            <td rowspan="8" align="left" valign="top" style='width:210px;overflow:hidden'>
+			<div id="stylepreview" style="padding:10px; width: 200px; height:100%; overflow:hidden; background-color:#ffffff; font-size:8px" class="previewWindow">
+                <p><img id="wrap" src="images/textflow.gif" width="45" height="45" align="" alt="" hspace="" vspace="" border="" style="float:right; margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px" />Lorem
+                  ipsum, Dolor sit amet, consectetuer adipiscing loreum ipsum
+                  edipiscing elit, sed diam nonummy nibh euismod tincidunt ut
+                  laoreet dolore magna aliquam erat volutpat.Loreum ipsum edipiscing
+                  elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore
+                  magna aliquam erat volutpat. Ut wisi enim ad minim veniam,
+                  quis nostrud exercitation ullamcorper suscipit. Lorem ipsum,
+                  Dolor sit amet, consectetuer adipiscing loreum ipsum edipiscing
+                  elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore
+                  magna aliquam erat volutpat.</p>
+              </div>
+			</td>
+          </tr>
+          <tr>
+            <td>{$lang_ibrowser_size}:</td>
+            <td colspan="3"><input name="size" type="text" id="size" value="" readonly="true" style="width: 100%;"></td>
+            <td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td>{$lang_ibrowser_height}:</td>
+            <td width="40"><input name="height" type="text" id="height" value="" size="5" maxlength="4" style="text-align: right;" onChange="changeDim(0)"></td>
+            <td width="25" rowspan="2" align="left" valign="middle"><a href="#" onClick="resetDim();" ><img src="images/constrain.gif" alt="{$lang_ibrowser_reset}" width="22" height="29" border="0"></a></td>
+            <td rowspan="2">&nbsp;</td>
+            <td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td>{$lang_ibrowser_width}:</td>
+            <td><input name="width" type="text" id="width" value="" size="5" maxlength="4" style="text-align: right;" onChange="changeDim(1)"></td>
+            <td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td>{$lang_ibrowser_border}:</td>
+            <td colspan="3">
+			<input name="border" type="text" id="border" value="0" size="5" maxlength="4" style="text-align: right;" onchange="updateStyle()" />px
+			</td>
+            <td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td>Margin-left:</td>
+            <td colspan="3"><input name="margin_left" type="text" id="margin_left" value="0" size="5" maxlength="4" style="text-align: right;" onchange="updateStyle()" />px
+			</td>
+            <td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td>Margin-Right:</td>
+            <td colspan="3"><input name="margin_right" type="text" id="margin_right" value="0" size="5" maxlength="4" style="text-align: right;" onchange="updateStyle()" />px
+			</td>
+            <td>&nbsp;</td>
+          </tr>
+
+          <tr>
+            <td>Margin-Top:</td>
+            <td colspan="3"><input name="margin_top" type="text" id="margin_top" value="0" size="5" maxlength="4" style="text-align: right;" onchange="updateStyle()" />px
+			</td>
+            <td>&nbsp;</td>
+          </tr>
+          <tr>
+            <td>Margin-Bottom:</td>
+            <td colspan="3"><input name="margin_bottom" type="text" id="margin_bottom" value="0" size="5" maxlength="4" style="text-align: right;" onchange="updateStyle()" />px
+			</td>
+            <td>&nbsp;</td>
+          </tr>
+
+        </table></td>
+    </tr>
+  </table>
+  </fieldset>
+  <?php  if ($tinyMCE_upload_allowed) { ?>
+  <fieldset style= "padding: 5 5 5 5; margin-top: 10px;">
+  <legend>{$lang_ibrowser_img_upload}</legend>
+  <table width="440" border="0" cellpadding="0" cellspacing="0">
+    <tr>
+      <td><?php
+    if (!empty($errors))
+    {
+      echo '<span class="error">';
+      foreach ($errors as $err)
+      {
+        echo $err.'<br />';
+      }
+      echo '</span>';
+    }
+    ?>
+        <?php
+  if ($d) {
+  ?>
+        <table width="440" border="0" cellpadding="2" cellspacing="0">
+          <tr>
+            <td width="80">{$lang_ibrowser_uploadtxt}:</td>
+            <td colspan="2"><input type="file" name="img_file" style="width: 100%;"></td>
+          </tr>
+          <tr>
+            <td colspan="3"><input type="submit" name="btnupload" class="bt" value="{$lang_ibrowser_uploadbt}"></td>
+          </tr>
+        </table>
+        <?php
+  }
+  ?>
+      </td>
+    </tr>
+  </table>
+  </fieldset>
+  <?php  } ?>
+</form>
+</body>
+</html>
+<?php
+function liboptions($arr, $prefix = '', $sel = '')
+{
+  $buf = '';
+  foreach($arr as $lib) {
+    $buf .= '<option value="'.$lib['value'].'"'.(($lib['value'] == $sel)?' selected':'').'>'.$prefix.$lib['text'].'</option>'."\n";
+  }
+  return $buf;
+}
+// upload image
+function uploadImg($img) {
+
+  global $HTTP_POST_FILES;
+  global $HTTP_SERVER_VARS;
+  global $tinyMCE_valid_imgs;
+  global $imglib;
+  global $errors;
+  global $l;
+  global $tinyMCE_upload_allowed;
+
+  if (!$tinyMCE_upload_allowed) return false;
+
+  if (!preg_match('#/$#', $HTTP_SERVER_VARS['DOCUMENT_ROOT'])){
+	$_root = e_BASE;
+  } else {
+  	$_root = e_BASE;
+  }
+  if ($HTTP_POST_FILES[$img]['size']>0) {
+    $data['type'] = $HTTP_POST_FILES[$img]['type'];
+    $data['name'] = $HTTP_POST_FILES[$img]['name'];
+    $data['size'] = $HTTP_POST_FILES[$img]['size'];
+    $data['tmp_name'] = $HTTP_POST_FILES[$img]['tmp_name'];
+
+    // get file extension
+    $ext = strtolower(substr(strrchr($data['name'],'.'), 1));
+    if (in_array($ext,$tinyMCE_valid_imgs)) {
+      $dir_name = $_root.$imglib;
+
+      $img_name = $data['name'];
+      $i = 1;
+      while (file_exists($dir_name.$img_name)) {
+        $img_name = preg_replace('#(.*)(\.[a-zA-Z]+)$#', '\\1_'.$i.'\\2', $data['name']);
+        $i++;
+      }
+      if (!move_uploaded_file($data['tmp_name'], $dir_name.$img_name)) {
+        $errors[] = '{lang_ibrowser_errorupload}';
+        return false;
+      }
+
+      return $img_name;
+    }
+    else
+    {
+      $errors[] = '{$lang_ibrowser_errortype}';
+    }
+  }
+  return false;
+}
+
+function deleteImg()
+{
+  global $HTTP_SERVER_VARS;
+  global $imglib;
+  global $img;
+  global $tinyMCE_img_delete_allowed;
+  global $errors;
+  global $l;
+
+  if (!$tinyMCE_img_delete_allowed) return false;
+
+  if (!preg_match('#/$#', $HTTP_SERVER_VARS['DOCUMENT_ROOT']))
+    $_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'].'/';
+  else
+    $_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
+
+  $full_img_name = $_root.$imglib.$img;
+
+  if (@unlink($full_img_name)) {
+  	return true;
+  }
+  else
+  {
+  	$errors[] = '{$lang_ibrowser_errordelete}';
+	return false;
+  }
+}
+
+// Return the human readable size of a file
+// @param int $size a file size
+// @param int $dec a number of decimal places
+
+function filesize_h($size, $dec = 1)
+{
+	$sizes = array('byte(s)', 'kb', 'mb', 'gb');
+	$count = count($sizes);
+	$i = 0;
+
+	while ($size >= 1024 && ($i < $count - 1)) {
+		$size /= 1024;
+		$i++;
+	}
+
+	return round($size, $dec) . ' ' . $sizes[$i];
+}
+
+?>
\ No newline at end of file
Files 6171/e107_handlers/tiny_mce/plugins/ibrowser/images/constrain.gif and 75/e107_handlers/tiny_mce/plugins/ibrowser/images/constrain.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/ibrowser/images/ibrowser.gif and 75/e107_handlers/tiny_mce/plugins/ibrowser/images/ibrowser.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/ibrowser/images/textflow.gif and 75/e107_handlers/tiny_mce/plugins/ibrowser/images/textflow.gif differ
diff -ruN 6171/e107_handlers/tiny_mce/plugins/ibrowser/langs/en.js 75/e107_handlers/tiny_mce/plugins/ibrowser/langs/en.js
--- 6171/e107_handlers/tiny_mce/plugins/ibrowser/langs/en.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/ibrowser/langs/en.js	2005-02-19 06:12:48.000000000 -0600
@@ -0,0 +1,38 @@
+// UK lang variables
+
+tinyMCELang['lang_ibrowser_title'] = 'Insert / Edit Image';
+tinyMCELang['lang_ibrowser_desc'] = 'Insert / Edit Image';
+tinyMCELang['lang_ibrowser_library'] = 'Library';
+tinyMCELang['lang_ibrowser_preview'] = 'Preview';
+tinyMCELang['lang_ibrowser_img_sel'] = 'Image selection';
+tinyMCELang['lang_ibrowser_img_info'] = 'Image information';
+tinyMCELang['lang_ibrowser_img_upload'] = 'Image upload';
+tinyMCELang['lang_ibrowser_images'] = 'Images';
+tinyMCELang['lang_ibrowser_src'] = 'Source';
+tinyMCELang['lang_ibrowser_alt'] = 'Description';
+tinyMCELang['lang_ibrowser_size'] = 'Size';
+tinyMCELang['lang_ibrowser_align'] = 'Text flow';
+tinyMCELang['lang_ibrowser_height'] = 'Height';
+tinyMCELang['lang_ibrowser_width'] = 'Width';
+tinyMCELang['lang_ibrowser_reset'] = 'Reset Dimensions';
+tinyMCELang['lang_ibrowser_border'] = 'Border';
+tinyMCELang['lang_ibrowser_hspace'] = 'HSpace';
+tinyMCELang['lang_ibrowser_vspace'] = 'VSpace';
+tinyMCELang['lang_ibrowser_select'] = 'Save';
+tinyMCELang['lang_ibrowser_delete'] = 'Delete';
+tinyMCELang['lang_ibrowser_cancel'] = 'Cancel';
+tinyMCELang['lang_ibrowser_uploadtxt'] = 'File';
+tinyMCELang['lang_ibrowser_uploadbt'] = 'Upload';
+// error messages
+tinyMCELang['lang_ibrowser_error'] = 'Error';
+tinyMCELang['lang_ibrowser_errornoimg'] = 'Please select an image';
+tinyMCELang['lang_ibrowser_errornodir'] = 'Library doesn\'t physically exist';
+tinyMCELang['lang_ibrowser_errorupload'] = 'An error occured while handling the file upload.\nPlease try again later';
+tinyMCELang['lang_ibrowser_errortype'] = 'Wrong image file type';
+tinyMCELang['lang_ibrowser_errordelete'] = 'Delete failed';
+tinyMCELang['lang_ibrowser_confirmdelete'] = 'Click OK to delete image!';
+tinyMCELang['lang_ibrowser_error_width_nan'] = 'Width is not a number!';
+tinyMCELang['lang_ibrowser_error_height_nan'] = 'Height is not a number!';
+tinyMCELang['lang_ibrowser_error_border_nan'] = 'Border is not a number!';
+tinyMCELang['lang_ibrowser_error_hspace_nan'] = 'Horizontal space is not a number!';
+tinyMCELang['lang_ibrowser_error_vspace_nan'] = 'Vertical space is not a number!';	
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/plugins/iespell/editor_plugin.js 75/e107_handlers/tiny_mce/plugins/iespell/editor_plugin.js
--- 6171/e107_handlers/tiny_mce/plugins/iespell/editor_plugin.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/iespell/editor_plugin.js	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('iespell','en,tr,cs,el,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl,da,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_IESpellPlugin={getInfo:function(){return{longname:'IESpell (MSIE Only)',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){if(cn=="iespell"&&(tinyMCE.isMSIE&&!tinyMCE.isOpera))return tinyMCE.getButtonHTML(cn,'lang_iespell_desc','{$pluginurl}/images/iespell.gif','mceIESpell');return"";},execCommand:function(editor_id,element,command,user_interface,value){if(command=="mceIESpell"){try{var ieSpell=new ActiveXObject("ieSpell.ieSpellExtension");ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);}catch(e){if(e.number==-2146827859){if(confirm(tinyMCE.getLang("lang_iespell_download","",true)))window.open('http://www.iespell.com/download.php','ieSpellDownload','');}else alert("Error Loading ieSpell: Exception "+e.number);}return true;}return false;}};tinyMCE.addPlugin("iespell",TinyMCE_IESpellPlugin);
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/plugins/iespell/editor_plugin_src.js 75/e107_handlers/tiny_mce/plugins/iespell/editor_plugin_src.js
--- 6171/e107_handlers/tiny_mce/plugins/iespell/editor_plugin_src.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/iespell/editor_plugin_src.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,60 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.8 $
+ * $Date: 2006/05/06 03:05:15 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('iespell', 'en,tr,cs,el,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl,da,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');
+
+var TinyMCE_IESpellPlugin = {
+	getInfo : function() {
+		return {
+			longname : 'IESpell (MSIE Only)',
+			author : 'Moxiecode Systems',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	/**
+	 * Returns the HTML contents of the iespell control.
+	 */
+	getControlHTML : function(cn) {
+		// Is it the iespell control and is the brower MSIE.
+		if (cn == "iespell" && (tinyMCE.isMSIE && !tinyMCE.isOpera))
+			return tinyMCE.getButtonHTML(cn, 'lang_iespell_desc', '{$pluginurl}/images/iespell.gif', 'mceIESpell');
+
+		return "";
+	},
+
+	/**
+	 * Executes the mceIESpell command.
+	 */
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		// Handle ieSpellCommand
+		if (command == "mceIESpell") {
+			try {
+				var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension");
+				ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);
+			} catch (e) {
+				if (e.number == -2146827859) {
+					if (confirm(tinyMCE.getLang("lang_iespell_download", "", true)))
+						window.open('http://www.iespell.com/download.php', 'ieSpellDownload', '');
+				} else
+					alert("Error Loading ieSpell: Exception " + e.number);
+			}
+
+			return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	}
+};
+
+tinyMCE.addPlugin("iespell", TinyMCE_IESpellPlugin);
Files 6171/e107_handlers/tiny_mce/plugins/iespell/images/iespell.gif and 75/e107_handlers/tiny_mce/plugins/iespell/images/iespell.gif differ
diff -ruN 6171/e107_handlers/tiny_mce/plugins/iespell/langs/en.js 75/e107_handlers/tiny_mce/plugins/iespell/langs/en.js
--- 6171/e107_handlers/tiny_mce/plugins/iespell/langs/en.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/iespell/langs/en.js	2005-09-07 08:32:50.000000000 -0500
@@ -0,0 +1,7 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+iespell_desc : 'Run spell checking',
+iespell_download : "ieSpell not detected. Click OK to go to download page."
+});
+
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/cell.htm 75/e107_handlers/tiny_mce/plugins/table/cell.htm
--- 6171/e107_handlers/tiny_mce/plugins/table/cell.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/cell.htm	2006-04-16 02:02:35.000000000 -0500
@@ -0,0 +1,182 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_table_cell_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/cell.js"></script>
+	<link href="css/cell.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="tablecell" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+	<form onsubmit="updateAction();return false;" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{$lang_table_general_props}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td><label for="align">{$lang_table_align}</label></td>
+							<td>
+								<select id="align" name="align">
+									<option value="">{$lang_not_set}</option>
+									<option value="center">{$lang_table_align_middle}</option>
+									<option value="left">{$lang_table_align_left}</option>
+									<option value="right">{$lang_table_align_right}</option>
+								</select>
+							</td>
+		
+							<td><label for="celltype">{$lang_table_cell_type}</label></td>
+							<td>
+								<select id="celltype" name="celltype">
+									<option value="td">{$lang_table_td}</option>
+									<option value="th">{$lang_table_th}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="valign">{$lang_table_valign}</label></td>
+							<td>
+								<select id="valign" name="valign">
+									<option value="">{$lang_not_set}</option>
+									<option value="top">{$lang_table_align_top}</option>
+									<option value="middle">{$lang_table_align_middle}</option>
+									<option value="bottom">{$lang_table_align_bottom}</option>
+								</select>
+							</td>
+
+							<td><label for="scope">{$lang_table_scope}</label></td>
+							<td>
+								<select id="scope" name="scope">
+									<option value="">{$lang_not_set}</option>
+									<option value="col">{$lang_table_col}</option>
+									<option value="row">{$lang_table_row}</option>
+									<option value="rowgroup">{$lang_table_rowgroup}</option>
+									<option value="colgroup">{$lang_table_colgroup}</option>
+								</select>
+							</td>
+
+						</tr>
+
+						<tr>
+							<td><label for="width">{$lang_table_width}</label></td>
+							<td><input id="width" name="width" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+
+							<td><label for="height">{$lang_table_height}</label></td>
+							<td><input id="height" name="height" type="text" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+						</tr>
+
+						<tr id="styleSelectRow">
+							<td><label for="class">{$lang_class_name}</label></td>
+							<td colspan="3">
+								<select id="class" name="class">
+									<option value="" selected="selected">{$lang_not_set}</option>
+								</select>
+							</td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{$lang_table_advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="id">{$lang_table_id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="style">{$lang_table_style}</label></td>
+							<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" style="width: 200px"> 
+										<option value="">{$lang_not_set}</option> 
+										<option value="ltr">{$lang_table_ltr}</option> 
+										<option value="rtl">{$lang_table_rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="lang">{$lang_table_langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" style="width: 200px" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
+										<td id="backgroundimagebrowsercontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
+										<td id="bordercolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+										<td id="bgcolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div>
+				<select id="action" name="action">
+					<option value="cell">{$lang_table_cell_cell}</option>
+					<option value="row">{$lang_table_cell_row}</option>
+					<option value="all">{$lang_table_cell_all}</option>
+				</select>
+			</div>
+
+			<div style="float: left">
+				<div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/css/cell.css 75/e107_handlers/tiny_mce/plugins/table/css/cell.css
--- 6171/e107_handlers/tiny_mce/plugins/table/css/cell.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/css/cell.css	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,17 @@
+/* CSS file for cell dialog in the table plugin */
+
+.panel_wrapper div.current {
+	height: 200px;
+}
+
+.advfield {
+	width: 200px;
+}
+
+#action {
+	margin-bottom: 3px;
+}
+
+#class {
+	width: 150px;
+}
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/css/row.css 75/e107_handlers/tiny_mce/plugins/table/css/row.css
--- 6171/e107_handlers/tiny_mce/plugins/table/css/row.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/css/row.css	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,25 @@
+/* CSS file for row dialog in the table plugin */
+
+.panel_wrapper div.current {
+	height: 200px;
+}
+
+.advfield {
+	width: 200px;
+}
+
+#action {
+	margin-bottom: 3px;
+}
+
+#rowtype,#align,#valign,#class,#height {
+	width: 150px;
+}
+
+#height {
+	width: 50px;	
+}
+
+.col2 {
+	padding-left: 20px;
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/css/table.css 75/e107_handlers/tiny_mce/plugins/table/css/table.css
--- 6171/e107_handlers/tiny_mce/plugins/table/css/table.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/css/table.css	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,13 @@
+/* CSS file for table dialog in the table plugin */
+
+.panel_wrapper div.current {
+	height: 220px;
+}
+
+.advfield {
+	width: 200px;
+}
+
+#class {
+	width: 150px;
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/editor_plugin.js 75/e107_handlers/tiny_mce/plugins/table/editor_plugin.js
--- 6171/e107_handlers/tiny_mce/plugins/table/editor_plugin.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/editor_plugin.js	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1 @@
+tinyMCE.importPluginLanguagePack('table','en,tr,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_TablePlugin={getInfo:function(){return{longname:'Tables',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isGecko){var doc=inst.getDoc();tinyMCE.addEvent(doc,"mouseup",TinyMCE_TablePlugin._mouseDownHandler);}inst.tableRowClipboard=null;},getControlHTML:function(control_name){var controls=new Array(['table','table.gif','lang_table_desc','mceInsertTable',true],['delete_col','table_delete_col.gif','lang_table_delete_col_desc','mceTableDeleteCol'],['delete_row','table_delete_row.gif','lang_table_delete_row_desc','mceTableDeleteRow'],['col_after','table_insert_col_after.gif','lang_table_col_after_desc','mceTableInsertColAfter'],['col_before','table_insert_col_before.gif','lang_table_col_before_desc','mceTableInsertColBefore'],['row_after','table_insert_row_after.gif','lang_table_row_after_desc','mceTableInsertRowAfter'],['row_before','table_insert_row_before.gif','lang_table_row_before_desc','mceTableInsertRowBefore'],['row_props','table_row_props.gif','lang_table_row_desc','mceTableRowProps',true],['cell_props','table_cell_props.gif','lang_table_cell_desc','mceTableCellProps',true],['split_cells','table_split_cells.gif','lang_table_split_cells_desc','mceTableSplitCells',true],['merge_cells','table_merge_cells.gif','lang_table_merge_cells_desc','mceTableMergeCells',true]);for(var i=0;i<controls.length;i++){var but=controls[i];var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\', '+(but.length>4?but[4]:false)+(but.length>5?', \''+but[5]+'\'':'')+');return false;';if(but[0]==control_name)return tinyMCE.getButtonHTML(control_name,but[2],'{$pluginurl}/images/'+but[1],but[3],(but.length>4?but[4]:false));}if(control_name=="tablecontrols"){var html="";html+=tinyMCE.getControlHTML("table");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_props");html+=tinyMCE.getControlHTML("cell_props");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("row_before");html+=tinyMCE.getControlHTML("row_after");html+=tinyMCE.getControlHTML("delete_row");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("col_before");html+=tinyMCE.getControlHTML("col_after");html+=tinyMCE.getControlHTML("delete_col");html+=tinyMCE.getControlHTML("separator");html+=tinyMCE.getControlHTML("split_cells");html+=tinyMCE.getControlHTML("merge_cells");return html;}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceInsertTable":case"mceTableRowProps":case"mceTableCellProps":case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":case"mceTableDelete":var inst=tinyMCE.getInstanceById(editor_id);inst.execCommand('mceBeginUndoLevel');TinyMCE_TablePlugin._doExecCommand(editor_id,element,command,user_interface,value);inst.execCommand('mceEndUndoLevel');return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){var colspan="1",rowspan="1";var inst=tinyMCE.getInstanceById(editor_id);tinyMCE.switchClass(editor_id+'_table','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_cell_props','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_row_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_before','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_col_after','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_split_cells','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonDisabled');if(tdElm=tinyMCE.getParentElement(node,"td,th")){tinyMCE.switchClass(editor_id+'_cell_props','mceButtonSelected');tinyMCE.switchClass(editor_id+'_row_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_row_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_row','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_before','mceButtonNormal');tinyMCE.switchClass(editor_id+'_col_after','mceButtonNormal');tinyMCE.switchClass(editor_id+'_delete_col','mceButtonNormal');colspan=tinyMCE.getAttrib(tdElm,"colspan");rowspan=tinyMCE.getAttrib(tdElm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;if(colspan!="1"||rowspan!="1")tinyMCE.switchClass(editor_id+'_split_cells','mceButtonNormal');}if(tinyMCE.getParentElement(node,"tr"))tinyMCE.switchClass(editor_id+'_row_props','mceButtonSelected');if(tinyMCE.getParentElement(node,"table")){tinyMCE.switchClass(editor_id+'_table','mceButtonSelected');tinyMCE.switchClass(editor_id+'_merge_cells','mceButtonNormal');}},_mouseDownHandler:function(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var focusElm=tinyMCE.selectedInstance.getFocusElement();if(elm.nodeName=="BODY"&&(focusElm.nodeName=="TD"||focusElm.nodeName=="TH"||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TD")||(focusElm.parentNode&&focusElm.parentNode.nodeName=="TH"))){window.setTimeout(function(){var tableElm=tinyMCE.getParentElement(focusElm,"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);},10);}},_doExecCommand:function(editor_id,element,command,user_interface,value){var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var trElm=tinyMCE.getParentElement(focusElm,"tr");var tdElm=tinyMCE.getParentElement(focusElm,"td,th");var tableElm=tinyMCE.getParentElement(focusElm,"table");var doc=inst.contentWindow.document;var tableBorder=tableElm?tableElm.getAttribute("border"):"";if(trElm&&tdElm==null)tdElm=trElm.cells[0];function inArray(ar,v){for(var i=0;i<ar.length;i++){if(ar[i].length>0&&inArray(ar[i],v))return true;if(ar[i]==v)return true;}return false;}function makeTD(){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";}function getColRowSpan(td){var colspan=tinyMCE.getAttrib(td,"colspan");var rowspan=tinyMCE.getAttrib(td,"rowspan");colspan=colspan==""?1:parseInt(colspan);rowspan=rowspan==""?1:parseInt(rowspan);return{colspan:colspan,rowspan:rowspan};}function getCellPos(grid,td){for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){if(grid[y][x]==td)return{cellindex:x,rowindex:y};}}return null;}function getCell(grid,row,col){if(grid[row]&&grid[row][col])return grid[row][col];return null;}function getTableGrid(table){var grid=new Array();var rows=table.rows;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].cells.length;x++){var td=rows[y].cells[x];var sd=getColRowSpan(td);for(xstart=x;grid[y]&&grid[y][xstart];xstart++);for(var y2=y;y2<y+sd['rowspan'];y2++){if(!grid[y2])grid[y2]=new Array();for(var x2=xstart;x2<xstart+sd['colspan'];x2++){grid[y2][x2]=td;}}}}return grid;}function trimRow(table,tr,td,new_tr){var grid=getTableGrid(table);var cpos=getCellPos(grid,td);if(new_tr.cells.length!=tr.childNodes.length){var cells=tr.childNodes;var lastElm=null;for(var x=0;td=getCell(grid,cpos.rowindex,x);x++){var remove=true;var sd=getColRowSpan(td);if(inArray(cells,td)){new_tr.childNodes[x]._delete=true;}else if((lastElm==null||td!=lastElm)&&sd.colspan>1){for(var i=x;i<x+td.colSpan;i++)new_tr.childNodes[i]._delete=true;}if((lastElm==null||td!=lastElm)&&sd.rowspan>1)td.rowSpan=sd.rowspan+1;lastElm=td;}deleteMarked(tableElm);}}function prevElm(node,name){while((node=node.previousSibling)!=null){if(node.nodeName==name)return node;}return null;}function nextElm(node,names){var namesAr=names.split(',');while((node=node.nextSibling)!=null){for(var i=0;i<namesAr.length;i++){if(node.nodeName.toLowerCase()==namesAr[i].toLowerCase())return node;}}return null;}function deleteMarked(tbl){if(tbl.rows==0)return;var tr=tbl.rows[0];do{var next=nextElm(tr,"TR");if(tr._delete){tr.parentNode.removeChild(tr);continue;}var td=tr.cells[0];if(td.cells>1){do{var nexttd=nextElm(td,"TD,TH");if(td._delete)td.parentNode.removeChild(td);}while((td=nexttd)!=null);}}while((tr=next)!=null);}function addRows(td_elm,tr_elm,rowspan){td_elm.rowSpan=1;var trNext=nextElm(tr_elm,"TR");for(var i=1;i<rowspan&&trNext;i++){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";if(tinyMCE.isMSIE)trNext.insertBefore(newTD,trNext.cells(td_elm.cellIndex));else trNext.insertBefore(newTD,trNext.cells[td_elm.cellIndex]);trNext=nextElm(trNext,"TR");}}function copyRow(doc,table,tr){var grid=getTableGrid(table);var newTR=tr.cloneNode(false);var cpos=getCellPos(grid,tr.cells[0]);var lastCell=null;var tableBorder=tinyMCE.getAttrib(table,"border");var tdElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){var newTD=null;if(lastCell!=tdElm){for(var i=0;i<tr.cells.length;i++){if(tdElm==tr.cells[i]){newTD=tdElm.cloneNode(true);break;}}}if(newTD==null){newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";}newTD.colSpan=1;newTD.rowSpan=1;newTR.appendChild(newTD);lastCell=tdElm;}return newTR;}switch(command){case"mceTableRowProps":if(trElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/row.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_rowprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_rowprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"});}return true;case"mceTableCellProps":if(tdElm==null)return true;if(user_interface){var template=new Array();template['file']='../../plugins/table/cell.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_cellprops_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_cellprops_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes"});}return true;case"mceInsertTable":if(user_interface){var template=new Array();template['file']='../../plugins/table/table.htm';template['width']=380;template['height']=295;template['width']+=tinyMCE.getLang('lang_table_table_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_table_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:value});}return true;case"mceTableDelete":var table=tinyMCE.getParentElement(inst.getFocusElement(),"table");if(table){table.parentNode.removeChild(table);inst.repaint();}return true;case"mceTableSplitCells":case"mceTableMergeCells":case"mceTableInsertRowBefore":case"mceTableInsertRowAfter":case"mceTableDeleteRow":case"mceTableInsertColBefore":case"mceTableInsertColAfter":case"mceTableDeleteCol":case"mceTableCutRow":case"mceTableCopyRow":case"mceTablePasteRowBefore":case"mceTablePasteRowAfter":if(!tableElm)return true;if(tableElm!=trElm.parentNode)tableElm=trElm.parentNode;if(tableElm&&trElm){switch(command){case"mceTableInsertRowBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTableCutRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);inst.execCommand("mceTableDeleteRow");break;case"mceTableCopyRow":if(!trElm||!tdElm)return true;inst.tableRowClipboard=copyRow(doc,tableElm,trElm);break;case"mceTablePasteRowBefore":if(!trElm||!tdElm)return true;var newTR=inst.tableRowClipboard.cloneNode(true);var prevTR=prevElm(trElm,"TR");if(prevTR!=null)trimRow(tableElm,prevTR,prevTR.cells[0],newTR);trElm.parentNode.insertBefore(newTR,trElm);break;case"mceTablePasteRowAfter":if(!trElm||!tdElm)return true;var nextTR=nextElm(trElm,"TR");var newTR=inst.tableRowClipboard.cloneNode(true);trimRow(tableElm,trElm,tdElm,newTR);if(nextTR==null)trElm.parentNode.appendChild(newTR);else nextTR.parentNode.insertBefore(newTR,nextTR);break;case"mceTableInsertRowAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var newTR=doc.createElement("tr");var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['rowspan']==1){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";newTD.colSpan=tdElm.colSpan;newTR.appendChild(newTD);}else tdElm.rowSpan=sd['rowspan']+1;lastTDElm=tdElm;}}if(newTR.hasChildNodes()){var nextTR=nextElm(trElm,"TR");if(nextTR)nextTR.parentNode.insertBefore(newTR,nextTR);else tableElm.appendChild(newTR);}break;case"mceTableDeleteRow":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);if(grid.length==1){tableElm.parentNode.removeChild(tableElm);return true;}var cells=trElm.cells;var nextTR=nextElm(trElm,"TR");for(var x=0;x<cells.length;x++){if(cells[x].rowSpan>1){var newTD=cells[x].cloneNode(true);var sd=getColRowSpan(cells[x]);newTD.rowSpan=sd.rowspan-1;var nextTD=nextTR.cells[x];if(nextTD==null)nextTR.appendChild(newTD);else nextTR.insertBefore(newTD,nextTD);}}var lastTDElm=null;for(var x=0;tdElm=getCell(grid,cpos.rowindex,x);x++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd.rowspan>1){tdElm.rowSpan=sd.rowspan-1;}else{trElm=tdElm.parentNode;if(trElm.parentNode)trElm._delete=true;}lastTDElm=tdElm;}}deleteMarked(tableElm);cpos.rowindex--;if(cpos.rowindex<0)cpos.rowindex=0;inst.selection.selectNode(getCell(grid,cpos.rowindex,0),true,true);break;case"mceTableInsertColBefore":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML="&nbsp;";newTD.rowSpan=tdElm.rowSpan;tdElm.parentNode.insertBefore(newTD,tdElm);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case"mceTableInsertColAfter":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']==1){var newTD=doc.createElement(tdElm.nodeName);newTD.innerHTML="&nbsp;";newTD.rowSpan=tdElm.rowSpan;var nextTD=nextElm(tdElm,"TD,TH");if(nextTD==null)tdElm.parentNode.appendChild(newTD);else nextTD.parentNode.insertBefore(newTD,nextTD);}else tdElm.colSpan++;lastTDElm=tdElm;}}break;case"mceTableDeleteCol":if(!trElm||!tdElm)return true;var grid=getTableGrid(tableElm);var cpos=getCellPos(grid,tdElm);var lastTDElm=null;if(grid.length>1&&grid[0].length<=1){tableElm.parentNode.removeChild(tableElm);return true;}for(var y=0;tdElm=getCell(grid,y,cpos.cellindex);y++){if(tdElm!=lastTDElm){var sd=getColRowSpan(tdElm);if(sd['colspan']>1)tdElm.colSpan=sd['colspan']-1;else{if(tdElm.parentNode)tdElm.parentNode.removeChild(tdElm);}lastTDElm=tdElm;}}cpos.cellindex--;if(cpos.cellindex<0)cpos.cellindex=0;inst.selection.selectNode(getCell(grid,0,cpos.cellindex),true,true);break;case"mceTableSplitCells":if(!trElm||!tdElm)return true;var spandata=getColRowSpan(tdElm);var colspan=spandata["colspan"];var rowspan=spandata["rowspan"];if(colspan>1||rowspan>1){tdElm.colSpan=1;for(var i=1;i<colspan;i++){var newTD=doc.createElement("td");newTD.innerHTML="&nbsp;";trElm.insertBefore(newTD,nextElm(tdElm,"TD,TH"));if(rowspan>1)addRows(newTD,trElm,rowspan);}addRows(tdElm,trElm,rowspan);}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");break;case"mceTableMergeCells":var rows=new Array();var sel=inst.getSel();var grid=getTableGrid(tableElm);if(tinyMCE.isMSIE||sel.rangeCount==1){if(user_interface){var template=new Array();var sp=getColRowSpan(tdElm);template['file']='../../plugins/table/merge_cells.htm';template['width']=250;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_table_merge_cells_delta_width',0);template['height']+=tinyMCE.getLang('lang_table_merge_cells_delta_height',0);tinyMCE.openWindow(template,{editor_id:inst.editorId,inline:"yes",action:"update",numcols:sp.colspan,numrows:sp.rowspan});return true;}else{var numRows=parseInt(value['numrows']);var numCols=parseInt(value['numcols']);var cpos=getCellPos(grid,tdElm);if((""+numRows)=="NaN")numRows=1;if((""+numCols)=="NaN")numCols=1;var tRows=tableElm.rows;for(var y=cpos.rowindex;y<grid.length;y++){var rowCells=new Array();for(var x=cpos.cellindex;x<grid[y].length;x++){var td=getCell(grid,y,x);if(td&&!inArray(rows,td)&&!inArray(rowCells,td)){var cp=getCellPos(grid,td);if(cp.cellindex<cpos.cellindex+numCols&&cp.rowindex<cpos.rowindex+numRows)rowCells[rowCells.length]=td;}}if(rowCells.length>0)rows[rows.length]=rowCells;}}}else{var cells=new Array();var sel=inst.getSel();var lastTR=null;var curRow=null;var x1=-1,y1=-1,x2,y2;if(sel.rangeCount<2)return true;for(var i=0;i<sel.rangeCount;i++){var rng=sel.getRangeAt(i);var tdElm=rng.startContainer.childNodes[rng.startOffset];if(!tdElm)break;if(tdElm.nodeName=="TD")cells[cells.length]=tdElm;}var tRows=tableElm.rows;for(var y=0;y<tRows.length;y++){var rowCells=new Array();for(var x=0;x<tRows[y].cells.length;x++){var td=tRows[y].cells[x];for(var i=0;i<cells.length;i++){if(td==cells[i]){rowCells[rowCells.length]=td;}}}if(rowCells.length>0)rows[rows.length]=rowCells;}var curRow=new Array();var lastTR=null;for(var y=0;y<grid.length;y++){for(var x=0;x<grid[y].length;x++){grid[y][x]._selected=false;for(var i=0;i<cells.length;i++){if(grid[y][x]==cells[i]){if(x1==-1){x1=x;y1=y;}x2=x;y2=y;grid[y][x]._selected=true;}}}}for(var y=y1;y<=y2;y++){for(var x=x1;x<=x2;x++){if(!grid[y][x]._selected){alert("Invalid selection for merge.");return true;}}}}var rowSpan=1,colSpan=1;var lastRowSpan=-1;for(var y=0;y<rows.length;y++){var rowColSpan=0;for(var x=0;x<rows[y].length;x++){var sd=getColRowSpan(rows[y][x]);rowColSpan+=sd['colspan'];if(lastRowSpan!=-1&&sd['rowspan']!=lastRowSpan){alert("Invalid selection for merge.");return true;}lastRowSpan=sd['rowspan'];}if(rowColSpan>colSpan)colSpan=rowColSpan;lastRowSpan=-1;}var lastColSpan=-1;for(var x=0;x<rows[0].length;x++){var colRowSpan=0;for(var y=0;y<rows.length;y++){var sd=getColRowSpan(rows[y][x]);colRowSpan+=sd['rowspan'];if(lastColSpan!=-1&&sd['colspan']!=lastColSpan){alert("Invalid selection for merge.");return true;}lastColSpan=sd['colspan'];}if(colRowSpan>rowSpan)rowSpan=colRowSpan;lastColSpan=-1;}tdElm=rows[0][0];tdElm.rowSpan=rowSpan;tdElm.colSpan=colSpan;for(var y=0;y<rows.length;y++){for(var x=0;x<rows[y].length;x++){var html=rows[y][x].innerHTML;var chk=tinyMCE.regexpReplace(html,"[ \t\r\n]","");if(chk!="<br/>"&&chk!="<br>"&&chk!="&nbsp;"&&(x+y>0))tdElm.innerHTML+=html;if(rows[y][x]!=tdElm&&!rows[y][x]._deleted){var cpos=getCellPos(grid,rows[y][x]);var tr=rows[y][x].parentNode;tr.removeChild(rows[y][x]);rows[y][x]._deleted=true;if(!tr.hasChildNodes()){tr.parentNode.removeChild(tr);var lastCell=null;for(var x=0;cellElm=getCell(grid,cpos.rowindex,x);x++){if(cellElm!=lastCell&&cellElm.rowSpan>1)cellElm.rowSpan--;lastCell=cellElm;}if(tdElm.rowSpan>1)tdElm.rowSpan--;}}}}break;}tableElm=tinyMCE.getParentElement(inst.getFocusElement(),"table");tinyMCE.handleVisualAid(tableElm,true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);tinyMCE.triggerNodeChange();inst.repaint();}return true;}return false;}};tinyMCE.addPlugin("table",TinyMCE_TablePlugin);
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/editor_plugin_src.js 75/e107_handlers/tiny_mce/plugins/table/editor_plugin_src.js
--- 6171/e107_handlers/tiny_mce/plugins/table/editor_plugin_src.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/editor_plugin_src.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,1054 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.10 $
+ * $Date: 2006/05/06 03:05:15 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('table', 'en,tr,ar,cs,da,de,el,es,fi,fr_ca,hu,it,ja,ko,nl,nb,pl,pt,pt_br,sv,tw,zh_cn,fr,de,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,is,zh_tw,zh_tw_utf8,sk');
+
+var TinyMCE_TablePlugin = {
+	getInfo : function() {
+		return {
+			longname : 'Tables',
+			author : 'Moxiecode Systems',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_table.html',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	initInstance : function(inst) {
+		if (tinyMCE.isGecko) {
+			var doc = inst.getDoc();
+			tinyMCE.addEvent(doc, "mouseup", TinyMCE_TablePlugin._mouseDownHandler);
+		}
+
+		inst.tableRowClipboard = null;
+	},
+
+	/**
+	 * Returns the HTML contents of the table control.
+	 */
+	getControlHTML : function(control_name) {
+		var controls = new Array(
+			['table', 'table.gif', 'lang_table_desc', 'mceInsertTable', true],
+			['delete_col', 'table_delete_col.gif', 'lang_table_delete_col_desc', 'mceTableDeleteCol'],
+			['delete_row', 'table_delete_row.gif', 'lang_table_delete_row_desc', 'mceTableDeleteRow'],
+			['col_after', 'table_insert_col_after.gif', 'lang_table_col_after_desc', 'mceTableInsertColAfter'],
+			['col_before', 'table_insert_col_before.gif', 'lang_table_col_before_desc', 'mceTableInsertColBefore'],
+			['row_after', 'table_insert_row_after.gif', 'lang_table_row_after_desc', 'mceTableInsertRowAfter'],
+			['row_before', 'table_insert_row_before.gif', 'lang_table_row_before_desc', 'mceTableInsertRowBefore'],
+			['row_props', 'table_row_props.gif', 'lang_table_row_desc', 'mceTableRowProps', true],
+			['cell_props', 'table_cell_props.gif', 'lang_table_cell_desc', 'mceTableCellProps', true],
+			['split_cells', 'table_split_cells.gif', 'lang_table_split_cells_desc', 'mceTableSplitCells', true],
+			['merge_cells', 'table_merge_cells.gif', 'lang_table_merge_cells_desc', 'mceTableMergeCells', true]);
+
+		// Render table control
+		for (var i=0; i<controls.length; i++) {
+			var but = controls[i];
+			var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + but[3] + '\', ' + (but.length > 4 ? but[4] : false) + (but.length > 5 ? ', \'' + but[5] + '\'' : '') + ');return false;';
+
+			if (but[0] == control_name)
+				return tinyMCE.getButtonHTML(control_name, but[2], '{$pluginurl}/images/'+ but[1], but[3], (but.length > 4 ? but[4] : false));
+		}
+
+		// Special tablecontrols
+		if (control_name == "tablecontrols") {
+			var html = "";
+
+			html += tinyMCE.getControlHTML("table");
+			html += tinyMCE.getControlHTML("separator");
+			html += tinyMCE.getControlHTML("row_props");
+			html += tinyMCE.getControlHTML("cell_props");
+			html += tinyMCE.getControlHTML("separator");
+			html += tinyMCE.getControlHTML("row_before");
+			html += tinyMCE.getControlHTML("row_after");
+			html += tinyMCE.getControlHTML("delete_row");
+			html += tinyMCE.getControlHTML("separator");
+			html += tinyMCE.getControlHTML("col_before");
+			html += tinyMCE.getControlHTML("col_after");
+			html += tinyMCE.getControlHTML("delete_col");
+			html += tinyMCE.getControlHTML("separator");
+			html += tinyMCE.getControlHTML("split_cells");
+			html += tinyMCE.getControlHTML("merge_cells");
+
+			return html;
+		}
+
+		return "";
+	},
+
+	/**
+	 * Executes the table commands.
+	 */
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		// Is table command
+		switch (command) {
+			case "mceInsertTable":
+			case "mceTableRowProps":
+			case "mceTableCellProps":
+			case "mceTableSplitCells":
+			case "mceTableMergeCells":
+			case "mceTableInsertRowBefore":
+			case "mceTableInsertRowAfter":
+			case "mceTableDeleteRow":
+			case "mceTableInsertColBefore":
+			case "mceTableInsertColAfter":
+			case "mceTableDeleteCol":
+			case "mceTableCutRow":
+			case "mceTableCopyRow":
+			case "mceTablePasteRowBefore":
+			case "mceTablePasteRowAfter":
+			case "mceTableDelete":
+				var inst = tinyMCE.getInstanceById(editor_id);
+
+				inst.execCommand('mceBeginUndoLevel');
+				TinyMCE_TablePlugin._doExecCommand(editor_id, element, command, user_interface, value);
+				inst.execCommand('mceEndUndoLevel');
+
+				return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	},
+
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
+		var colspan = "1", rowspan = "1";
+
+		var inst = tinyMCE.getInstanceById(editor_id);
+
+		// Reset table controls
+		tinyMCE.switchClass(editor_id + '_table', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonDisabled');
+
+		// Within a td element
+		if (tdElm = tinyMCE.getParentElement(node, "td,th")) {
+			tinyMCE.switchClass(editor_id + '_cell_props', 'mceButtonSelected');
+			tinyMCE.switchClass(editor_id + '_row_before', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_row_after', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_delete_row', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_col_before', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_col_after', 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_delete_col', 'mceButtonNormal');
+
+			colspan = tinyMCE.getAttrib(tdElm, "colspan");
+			rowspan = tinyMCE.getAttrib(tdElm, "rowspan");
+
+			colspan = colspan == "" ? "1" : colspan;
+			rowspan = rowspan == "" ? "1" : rowspan;
+
+			if (colspan != "1" || rowspan != "1")
+				tinyMCE.switchClass(editor_id + '_split_cells', 'mceButtonNormal');
+		}
+
+		// Within a tr element
+		if (tinyMCE.getParentElement(node, "tr"))
+			tinyMCE.switchClass(editor_id + '_row_props', 'mceButtonSelected');
+
+		// Within table
+		if (tinyMCE.getParentElement(node, "table")) {
+			tinyMCE.switchClass(editor_id + '_table', 'mceButtonSelected');
+			tinyMCE.switchClass(editor_id + '_merge_cells', 'mceButtonNormal');
+		}
+	},
+
+	// Private plugin internal methods
+
+	_mouseDownHandler : function(e) {
+		var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
+		var focusElm = tinyMCE.selectedInstance.getFocusElement();
+
+		// If press on special Mozilla create TD/TR thingie
+		if (elm.nodeName == "BODY" && (focusElm.nodeName == "TD" || focusElm.nodeName == "TH" || (focusElm.parentNode && focusElm.parentNode.nodeName == "TD") ||(focusElm.parentNode && focusElm.parentNode.nodeName == "TH") )) {
+			window.setTimeout(function() {
+				var tableElm = tinyMCE.getParentElement(focusElm, "table");
+				tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
+			}, 10);
+		}
+	},
+
+	/**
+	 * Executes the table commands.
+	 */
+	_doExecCommand : function(editor_id, element, command, user_interface, value) {
+		var inst = tinyMCE.getInstanceById(editor_id);
+		var focusElm = inst.getFocusElement();
+		var trElm = tinyMCE.getParentElement(focusElm, "tr");
+		var tdElm = tinyMCE.getParentElement(focusElm, "td,th");
+		var tableElm = tinyMCE.getParentElement(focusElm, "table");
+		var doc = inst.contentWindow.document;
+		var tableBorder = tableElm ? tableElm.getAttribute("border") : "";
+
+		// Get first TD if no TD found
+		if (trElm && tdElm == null)
+			tdElm = trElm.cells[0];
+
+		// ------- Inner functions ---------
+		function inArray(ar, v) {
+			for (var i=0; i<ar.length; i++) {
+				// Is array
+				if (ar[i].length > 0 && inArray(ar[i], v))
+					return true;
+
+				// Found value
+				if (ar[i] == v)
+					return true;
+			}
+
+			return false;
+		}
+
+		function makeTD() {
+			var newTD = doc.createElement("td");
+			newTD.innerHTML = "&nbsp;";
+		}
+
+		function getColRowSpan(td) {
+			var colspan = tinyMCE.getAttrib(td, "colspan");
+			var rowspan = tinyMCE.getAttrib(td, "rowspan");
+
+			colspan = colspan == "" ? 1 : parseInt(colspan);
+			rowspan = rowspan == "" ? 1 : parseInt(rowspan);
+
+			return {colspan : colspan, rowspan : rowspan};
+		}
+
+		function getCellPos(grid, td) {
+			for (var y=0; y<grid.length; y++) {
+				for (var x=0; x<grid[y].length; x++) {
+					if (grid[y][x] == td)
+						return {cellindex : x, rowindex : y};
+				}
+			}
+
+			return null;
+		}
+
+		function getCell(grid, row, col) {
+			if (grid[row] && grid[row][col])
+				return grid[row][col];
+
+			return null;
+		}
+
+		function getTableGrid(table) {
+			var grid = new Array();
+			var rows = table.rows;
+
+			for (var y=0; y<rows.length; y++) {
+				for (var x=0; x<rows[y].cells.length; x++) {
+					var td = rows[y].cells[x];
+					var sd = getColRowSpan(td);
+
+					// All ready filled
+					for (xstart = x; grid[y] && grid[y][xstart]; xstart++) ;
+
+					// Fill box
+					for (var y2=y; y2<y+sd['rowspan']; y2++) {
+						if (!grid[y2])
+							grid[y2] = new Array();
+
+						for (var x2=xstart; x2<xstart+sd['colspan']; x2++) {
+							grid[y2][x2] = td;
+						}
+					}
+				}
+			}
+
+			return grid;
+		}
+
+		function trimRow(table, tr, td, new_tr) {
+			var grid = getTableGrid(table);
+			var cpos = getCellPos(grid, td);
+
+			// Time to crop away some
+			if (new_tr.cells.length != tr.childNodes.length) {
+				var cells = tr.childNodes;
+				var lastElm = null;
+
+				for (var x=0; td = getCell(grid, cpos.rowindex, x); x++) {
+					var remove = true;
+					var sd = getColRowSpan(td);
+
+					// Remove due to rowspan
+					if (inArray(cells, td)) {
+						new_tr.childNodes[x]._delete = true;
+					} else if ((lastElm == null || td != lastElm) && sd.colspan > 1) { // Remove due to colspan
+						for (var i=x; i<x+td.colSpan; i++)
+							new_tr.childNodes[i]._delete = true;
+					}
+
+					if ((lastElm == null || td != lastElm) && sd.rowspan > 1)
+						td.rowSpan = sd.rowspan + 1;
+
+					lastElm = td;
+				}
+
+				deleteMarked(tableElm);
+			}
+		}
+
+		function prevElm(node, name) {
+			while ((node = node.previousSibling) != null) {
+				if (node.nodeName == name)
+					return node;
+			}
+
+			return null;
+		}
+
+		function nextElm(node, names) {
+			var namesAr = names.split(',');
+
+			while ((node = node.nextSibling) != null) {
+				for (var i=0; i<namesAr.length; i++) {
+					if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() )
+						return node;
+				}
+			}
+
+			return null;
+		}
+
+		function deleteMarked(tbl) {
+			if (tbl.rows == 0)
+				return;
+
+			var tr = tbl.rows[0];
+			do {
+				var next = nextElm(tr, "TR");
+
+				// Delete row
+				if (tr._delete) {
+					tr.parentNode.removeChild(tr);
+					continue;
+				}
+
+				// Delete cells
+				var td = tr.cells[0];
+				if (td.cells > 1) {
+					do {
+						var nexttd = nextElm(td, "TD,TH");
+
+						if (td._delete)
+							td.parentNode.removeChild(td);
+					} while ((td = nexttd) != null);
+				}
+			} while ((tr = next) != null);
+		}
+
+		function addRows(td_elm, tr_elm, rowspan) {
+			// Add rows
+			td_elm.rowSpan = 1;
+			var trNext = nextElm(tr_elm, "TR");
+			for (var i=1; i<rowspan && trNext; i++) {
+				var newTD = doc.createElement("td");
+				newTD.innerHTML = "&nbsp;";
+
+				if (tinyMCE.isMSIE)
+					trNext.insertBefore(newTD, trNext.cells(td_elm.cellIndex));
+				else
+					trNext.insertBefore(newTD, trNext.cells[td_elm.cellIndex]);
+
+				trNext = nextElm(trNext, "TR");
+			}
+		}
+
+		function copyRow(doc, table, tr) {
+			var grid = getTableGrid(table);
+			var newTR = tr.cloneNode(false);
+			var cpos = getCellPos(grid, tr.cells[0]);
+			var lastCell = null;
+			var tableBorder = tinyMCE.getAttrib(table, "border");
+			var tdElm = null;
+
+			for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+				var newTD = null;
+
+				if (lastCell != tdElm) {
+					for (var i=0; i<tr.cells.length; i++) {
+						if (tdElm == tr.cells[i]) {
+							newTD = tdElm.cloneNode(true);
+							break;
+						}
+					}
+				}
+
+				if (newTD == null) {
+					newTD = doc.createElement("td");
+					newTD.innerHTML = "&nbsp;";
+				}
+
+				// Reset col/row span
+				newTD.colSpan = 1;
+				newTD.rowSpan = 1;
+
+				newTR.appendChild(newTD);
+
+				lastCell = tdElm;
+			}
+
+			return newTR;
+		}
+
+		// ---- Commands -----
+
+		// Handle commands
+		switch (command) {
+			case "mceTableRowProps":
+				if (trElm == null)
+					return true;
+
+				if (user_interface) {
+					// Setup template
+					var template = new Array();
+
+					template['file'] = '../../plugins/table/row.htm';
+					template['width'] = 380;
+					template['height'] = 295;
+
+					// Language specific width and height addons
+					template['width'] += tinyMCE.getLang('lang_table_rowprops_delta_width', 0);
+					template['height'] += tinyMCE.getLang('lang_table_rowprops_delta_height', 0);
+
+					// Open window
+					tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
+				}
+
+				return true;
+
+			case "mceTableCellProps":
+				if (tdElm == null)
+					return true;
+
+				if (user_interface) {
+					// Setup template
+					var template = new Array();
+
+					template['file'] = '../../plugins/table/cell.htm';
+					template['width'] = 380;
+					template['height'] = 295;
+
+					// Language specific width and height addons
+					template['width'] += tinyMCE.getLang('lang_table_cellprops_delta_width', 0);
+					template['height'] += tinyMCE.getLang('lang_table_cellprops_delta_height', 0);
+
+					// Open window
+					tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes"});
+				}
+
+				return true;
+
+			case "mceInsertTable":
+				if (user_interface) {
+					// Setup template
+					var template = new Array();
+
+					template['file'] = '../../plugins/table/table.htm';
+					template['width'] = 380;
+					template['height'] = 295;
+
+					// Language specific width and height addons
+					template['width'] += tinyMCE.getLang('lang_table_table_delta_width', 0);
+					template['height'] += tinyMCE.getLang('lang_table_table_delta_height', 0);
+
+					// Open window
+					tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : value});
+				}
+
+				return true;
+
+			case "mceTableDelete":
+				var table = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+				if (table) {
+					table.parentNode.removeChild(table);
+					inst.repaint();
+				}
+				return true;
+
+			case "mceTableSplitCells":
+			case "mceTableMergeCells":
+			case "mceTableInsertRowBefore":
+			case "mceTableInsertRowAfter":
+			case "mceTableDeleteRow":
+			case "mceTableInsertColBefore":
+			case "mceTableInsertColAfter":
+			case "mceTableDeleteCol":
+			case "mceTableCutRow":
+			case "mceTableCopyRow":
+			case "mceTablePasteRowBefore":
+			case "mceTablePasteRowAfter":
+				// No table just return (invalid command)
+				if (!tableElm)
+					return true;
+
+				// Table has a tbody use that reference
+				// Changed logic by ApTest 2005.07.12 (www.aptest.com)
+				// Now lookk at the focused element and take its parentNode.  That will be a tbody or a table.
+				if (tableElm != trElm.parentNode)
+					tableElm = trElm.parentNode;
+
+				if (tableElm && trElm) {
+					switch (command) {
+						case "mceTableInsertRowBefore":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var newTR = doc.createElement("tr");
+							var lastTDElm = null;
+
+							cpos.rowindex--;
+							if (cpos.rowindex < 0)
+								cpos.rowindex = 0;
+
+							// Create cells
+							for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['rowspan'] == 1) {
+										var newTD = doc.createElement("td");
+
+										newTD.innerHTML = "&nbsp;";
+										newTD.colSpan = tdElm.colSpan;
+
+										newTR.appendChild(newTD);
+									} else
+										tdElm.rowSpan = sd['rowspan'] + 1;
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							trElm.parentNode.insertBefore(newTR, trElm);
+						break;
+
+						case "mceTableCutRow":
+							if (!trElm || !tdElm)
+								return true;
+
+							inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
+							inst.execCommand("mceTableDeleteRow");
+							break;
+
+						case "mceTableCopyRow":
+							if (!trElm || !tdElm)
+								return true;
+
+							inst.tableRowClipboard = copyRow(doc, tableElm, trElm);
+							break;
+
+						case "mceTablePasteRowBefore":
+							if (!trElm || !tdElm)
+								return true;
+
+							var newTR = inst.tableRowClipboard.cloneNode(true);
+
+							var prevTR = prevElm(trElm, "TR");
+							if (prevTR != null)
+								trimRow(tableElm, prevTR, prevTR.cells[0], newTR);
+
+							trElm.parentNode.insertBefore(newTR, trElm);
+							break;
+
+						case "mceTablePasteRowAfter":
+							if (!trElm || !tdElm)
+								return true;
+							
+							var nextTR = nextElm(trElm, "TR");
+							var newTR = inst.tableRowClipboard.cloneNode(true);
+
+							trimRow(tableElm, trElm, tdElm, newTR);
+
+							if (nextTR == null)
+								trElm.parentNode.appendChild(newTR);
+							else
+								nextTR.parentNode.insertBefore(newTR, nextTR);
+
+							break;
+
+						case "mceTableInsertRowAfter":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var newTR = doc.createElement("tr");
+							var lastTDElm = null;
+
+							// Create cells
+							for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['rowspan'] == 1) {
+										var newTD = doc.createElement("td");
+
+										newTD.innerHTML = "&nbsp;";
+										newTD.colSpan = tdElm.colSpan;
+
+										newTR.appendChild(newTD);
+									} else
+										tdElm.rowSpan = sd['rowspan'] + 1;
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							if (newTR.hasChildNodes()) {
+								var nextTR = nextElm(trElm, "TR");
+								if (nextTR)
+									nextTR.parentNode.insertBefore(newTR, nextTR);
+								else
+									tableElm.appendChild(newTR);
+							}
+						break;
+
+						case "mceTableDeleteRow":
+							if (!trElm || !tdElm)
+								return true;
+		
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+
+							// Only one row, remove whole table
+							if (grid.length == 1) {
+								tableElm.parentNode.removeChild(tableElm);
+								return true;
+							}
+
+							// Move down row spanned cells
+							var cells = trElm.cells;
+							var nextTR = nextElm(trElm, "TR");
+							for (var x=0; x<cells.length; x++) {
+								if (cells[x].rowSpan > 1) {
+									var newTD = cells[x].cloneNode(true);
+									var sd = getColRowSpan(cells[x]);
+
+									newTD.rowSpan = sd.rowspan - 1;
+
+									var nextTD = nextTR.cells[x];
+
+									if (nextTD == null)
+										nextTR.appendChild(newTD);
+									else
+										nextTR.insertBefore(newTD, nextTD);
+								}
+							}
+
+							// Delete cells
+							var lastTDElm = null;
+							for (var x=0; tdElm = getCell(grid, cpos.rowindex, x); x++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd.rowspan > 1) {
+										tdElm.rowSpan = sd.rowspan - 1;
+									} else {
+										trElm = tdElm.parentNode;
+
+										if (trElm.parentNode)
+											trElm._delete = true;
+									}
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							deleteMarked(tableElm);
+
+							cpos.rowindex--;
+							if (cpos.rowindex < 0)
+								cpos.rowindex = 0;
+
+							inst.selection.selectNode(getCell(grid, cpos.rowindex, 0), true, true);
+						break;
+
+						case "mceTableInsertColBefore":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var lastTDElm = null;
+
+							for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['colspan'] == 1) {
+										var newTD = doc.createElement(tdElm.nodeName);
+
+										newTD.innerHTML = "&nbsp;";
+										newTD.rowSpan = tdElm.rowSpan;
+
+										tdElm.parentNode.insertBefore(newTD, tdElm);
+									} else
+										tdElm.colSpan++;
+
+									lastTDElm = tdElm;
+								}
+							}
+						break;
+
+						case "mceTableInsertColAfter":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var lastTDElm = null;
+
+							for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['colspan'] == 1) {
+										var newTD = doc.createElement(tdElm.nodeName);
+
+										newTD.innerHTML = "&nbsp;";
+										newTD.rowSpan = tdElm.rowSpan;
+
+										var nextTD = nextElm(tdElm, "TD,TH");
+										if (nextTD == null)
+											tdElm.parentNode.appendChild(newTD);
+										else
+											nextTD.parentNode.insertBefore(newTD, nextTD);
+									} else
+										tdElm.colSpan++;
+
+									lastTDElm = tdElm;
+								}
+							}
+						break;
+
+						case "mceTableDeleteCol":
+							if (!trElm || !tdElm)
+								return true;
+
+							var grid = getTableGrid(tableElm);
+							var cpos = getCellPos(grid, tdElm);
+							var lastTDElm = null;
+
+							// Only one col, remove whole table
+							if (grid.length > 1 && grid[0].length <= 1) {
+								tableElm.parentNode.removeChild(tableElm);
+								return true;
+							}
+
+							// Delete cells
+							for (var y=0; tdElm = getCell(grid, y, cpos.cellindex); y++) {
+								if (tdElm != lastTDElm) {
+									var sd = getColRowSpan(tdElm);
+
+									if (sd['colspan'] > 1)
+										tdElm.colSpan = sd['colspan'] - 1;
+									else {
+										if (tdElm.parentNode)
+											tdElm.parentNode.removeChild(tdElm);
+									}
+
+									lastTDElm = tdElm;
+								}
+							}
+
+							cpos.cellindex--;
+							if (cpos.cellindex < 0)
+								cpos.cellindex = 0;
+
+							inst.selection.selectNode(getCell(grid, 0, cpos.cellindex), true, true);
+						break;
+
+					case "mceTableSplitCells":
+						if (!trElm || !tdElm)
+							return true;
+
+						var spandata = getColRowSpan(tdElm);
+
+						var colspan = spandata["colspan"];
+						var rowspan = spandata["rowspan"];
+
+						// Needs splitting
+						if (colspan > 1 || rowspan > 1) {
+							// Generate cols
+							tdElm.colSpan = 1;
+							for (var i=1; i<colspan; i++) {
+								var newTD = doc.createElement("td");
+
+								newTD.innerHTML = "&nbsp;";
+
+								trElm.insertBefore(newTD, nextElm(tdElm, "TD,TH"));
+
+								if (rowspan > 1)
+									addRows(newTD, trElm, rowspan);
+							}
+
+							addRows(tdElm, trElm, rowspan);
+						}
+
+						// Apply visual aids
+						tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+						break;
+
+					case "mceTableMergeCells":
+						var rows = new Array();
+						var sel = inst.getSel();
+						var grid = getTableGrid(tableElm);
+
+						if (tinyMCE.isMSIE || sel.rangeCount == 1) {
+							if (user_interface) {
+								// Setup template
+								var template = new Array();
+								var sp = getColRowSpan(tdElm);
+
+								template['file'] = '../../plugins/table/merge_cells.htm';
+								template['width'] = 250;
+								template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0);
+
+								// Language specific width and height addons
+								template['width'] += tinyMCE.getLang('lang_table_merge_cells_delta_width', 0);
+								template['height'] += tinyMCE.getLang('lang_table_merge_cells_delta_height', 0);
+
+								// Open window
+								tinyMCE.openWindow(template, {editor_id : inst.editorId, inline : "yes", action : "update", numcols : sp.colspan, numrows : sp.rowspan});
+
+								return true;
+							} else {
+								var numRows = parseInt(value['numrows']);
+								var numCols = parseInt(value['numcols']);
+								var cpos = getCellPos(grid, tdElm);
+
+								if (("" + numRows) == "NaN")
+									numRows = 1;
+
+								if (("" + numCols) == "NaN")
+									numCols = 1;
+
+								// Get rows and cells
+								var tRows = tableElm.rows;
+								for (var y=cpos.rowindex; y<grid.length; y++) {
+									var rowCells = new Array();
+
+									for (var x=cpos.cellindex; x<grid[y].length; x++) {
+										var td = getCell(grid, y, x);
+
+										if (td && !inArray(rows, td) && !inArray(rowCells, td)) {
+											var cp = getCellPos(grid, td);
+
+											// Within range
+											if (cp.cellindex < cpos.cellindex+numCols && cp.rowindex < cpos.rowindex+numRows)
+												rowCells[rowCells.length] = td;
+										}
+									}
+
+									if (rowCells.length > 0)
+										rows[rows.length] = rowCells;
+								}
+
+								//return true;
+							}
+						} else {
+							var cells = new Array();
+							var sel = inst.getSel();
+							var lastTR = null;
+							var curRow = null;
+							var x1 = -1, y1 = -1, x2, y2;
+
+							// Only one cell selected, whats the point?
+							if (sel.rangeCount < 2)
+								return true;
+
+							// Get all selected cells
+							for (var i=0; i<sel.rangeCount; i++) {
+								var rng = sel.getRangeAt(i);
+								var tdElm = rng.startContainer.childNodes[rng.startOffset];
+
+								if (!tdElm)
+									break;
+
+								if (tdElm.nodeName == "TD")
+									cells[cells.length] = tdElm;
+							}
+
+							// Get rows and cells
+							var tRows = tableElm.rows;
+							for (var y=0; y<tRows.length; y++) {
+								var rowCells = new Array();
+
+								for (var x=0; x<tRows[y].cells.length; x++) {
+									var td = tRows[y].cells[x];
+
+									for (var i=0; i<cells.length; i++) {
+										if (td == cells[i]) {
+											rowCells[rowCells.length] = td;
+										}
+									}
+								}
+
+								if (rowCells.length > 0)
+									rows[rows.length] = rowCells;
+							}
+
+							// Find selected cells in grid and box
+							var curRow = new Array();
+							var lastTR = null;
+							for (var y=0; y<grid.length; y++) {
+								for (var x=0; x<grid[y].length; x++) {
+									grid[y][x]._selected = false;
+
+									for (var i=0; i<cells.length; i++) {
+										if (grid[y][x] == cells[i]) {
+											// Get start pos
+											if (x1 == -1) {
+												x1 = x;
+												y1 = y;
+											}
+
+											// Get end pos
+											x2 = x;
+											y2 = y;
+
+											grid[y][x]._selected = true;
+										}
+									}
+								}
+							}
+
+							// Is there gaps, if so deny
+							for (var y=y1; y<=y2; y++) {
+								for (var x=x1; x<=x2; x++) {
+									if (!grid[y][x]._selected) {
+										alert("Invalid selection for merge.");
+										return true;
+									}
+								}
+							}
+						}
+
+						// Validate selection and get total rowspan and colspan
+						var rowSpan = 1, colSpan = 1;
+
+						// Validate horizontal and get total colspan
+						var lastRowSpan = -1;
+						for (var y=0; y<rows.length; y++) {
+							var rowColSpan = 0;
+
+							for (var x=0; x<rows[y].length; x++) {
+								var sd = getColRowSpan(rows[y][x]);
+
+								rowColSpan += sd['colspan'];
+
+								if (lastRowSpan != -1 && sd['rowspan'] != lastRowSpan) {
+									alert("Invalid selection for merge.");
+									return true;
+								}
+
+								lastRowSpan = sd['rowspan'];
+							}
+
+							if (rowColSpan > colSpan)
+								colSpan = rowColSpan;
+
+							lastRowSpan = -1;
+						}
+
+						// Validate vertical and get total rowspan
+						var lastColSpan = -1;
+						for (var x=0; x<rows[0].length; x++) {
+							var colRowSpan = 0;
+
+							for (var y=0; y<rows.length; y++) {
+								var sd = getColRowSpan(rows[y][x]);
+
+								colRowSpan += sd['rowspan'];
+
+								if (lastColSpan != -1 && sd['colspan'] != lastColSpan) {
+									alert("Invalid selection for merge.");
+									return true;
+								}
+
+								lastColSpan = sd['colspan'];
+							}
+
+							if (colRowSpan > rowSpan)
+								rowSpan = colRowSpan;
+
+							lastColSpan = -1;
+						}
+
+						// Setup td
+						tdElm = rows[0][0];
+						tdElm.rowSpan = rowSpan;
+						tdElm.colSpan = colSpan;
+
+						// Merge cells
+						for (var y=0; y<rows.length; y++) {
+							for (var x=0; x<rows[y].length; x++) {
+								var html = rows[y][x].innerHTML;
+								var chk = tinyMCE.regexpReplace(html, "[ \t\r\n]", "");
+
+								if (chk != "<br/>" && chk != "<br>" && chk != "&nbsp;" && (x+y > 0))
+									tdElm.innerHTML += html;
+
+								// Not current cell
+								if (rows[y][x] != tdElm && !rows[y][x]._deleted) {
+									var cpos = getCellPos(grid, rows[y][x]);
+									var tr = rows[y][x].parentNode;
+
+									tr.removeChild(rows[y][x]);
+									rows[y][x]._deleted = true;
+
+									// Empty TR, remove it
+									if (!tr.hasChildNodes()) {
+										tr.parentNode.removeChild(tr);
+
+										var lastCell = null;
+										for (var x=0; cellElm = getCell(grid, cpos.rowindex, x); x++) {
+											if (cellElm != lastCell && cellElm.rowSpan > 1)
+												cellElm.rowSpan--;
+
+											lastCell = cellElm;
+										}
+
+										if (tdElm.rowSpan > 1)
+											tdElm.rowSpan--;
+									}
+								}
+							}
+						}
+
+						break;
+					}
+
+					tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+					tinyMCE.handleVisualAid(tableElm, true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
+					tinyMCE.triggerNodeChange();
+					inst.repaint();
+				}
+
+			return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	}
+};
+
+tinyMCE.addPlugin("table", TinyMCE_TablePlugin);
Files 6171/e107_handlers/tiny_mce/plugins/table/images/buttons.gif and 75/e107_handlers/tiny_mce/plugins/table/images/buttons.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_cell_props.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_cell_props.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_delete_col.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_delete_col.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_delete.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_delete.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_delete_row.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_delete_row.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_after.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_after.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_before.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_insert_col_before.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_after.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_after.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_before.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_insert_row_before.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_merge_cells.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_merge_cells.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_row_props.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_row_props.gif differ
Files 6171/e107_handlers/tiny_mce/plugins/table/images/table_split_cells.gif and 75/e107_handlers/tiny_mce/plugins/table/images/table_split_cells.gif differ
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/jscripts/cell.js 75/e107_handlers/tiny_mce/plugins/table/jscripts/cell.js
--- 6171/e107_handlers/tiny_mce/plugins/table/jscripts/cell.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/jscripts/cell.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,249 @@
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor')
+
+	var inst = tinyMCE.selectedInstance;
+	var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(tinyMCE.getAttrib(tdElm, "style"));
+
+	// Get table cell data
+	var celltype = tdElm.nodeName.toLowerCase();
+	var align = tinyMCE.getAttrib(tdElm, 'align');
+	var valign = tinyMCE.getAttrib(tdElm, 'valign');
+	var width = trimSize(getStyle(tdElm, 'width', 'width'));
+	var height = trimSize(getStyle(tdElm, 'height', 'height'));
+	var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
+	var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor'));
+	var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tdElm, 'class'), false);
+	var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
+	var id = tinyMCE.getAttrib(tdElm, 'id');
+	var lang = tinyMCE.getAttrib(tdElm, 'lang');
+	var dir = tinyMCE.getAttrib(tdElm, 'dir');
+	var scope = tinyMCE.getAttrib(tdElm, 'scope');
+
+	// Setup form
+	addClassesToList('class', 'table_cell_styles');
+	formObj.bordercolor.value = bordercolor;
+	formObj.bgcolor.value = bgcolor;
+	formObj.backgroundimage.value = backgroundimage;
+	formObj.width.value = width;
+	formObj.height.value = height;
+	formObj.id.value = id;
+	formObj.lang.value = lang;
+	formObj.style.value = tinyMCE.serializeStyle(st);
+	selectByValue(formObj, 'align', align);
+	selectByValue(formObj, 'valign', valign);
+	selectByValue(formObj, 'class', className);
+	selectByValue(formObj, 'celltype', celltype);
+	selectByValue(formObj, 'dir', dir);
+	selectByValue(formObj, 'scope', scope);
+
+	// Resize some elements
+	if (isVisible('backgroundimagebrowser'))
+		document.getElementById('backgroundimage').style.width = '180px';
+
+	updateColor('bordercolor_pick', 'bordercolor');
+	updateColor('bgcolor_pick', 'bgcolor');
+}
+
+function updateAction() {
+	tinyMCEPopup.restoreSelection();
+
+	var inst = tinyMCE.selectedInstance;
+	var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th");
+	var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
+	var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+	var formObj = document.forms[0];
+
+	inst.execCommand('mceBeginUndoLevel');
+
+	switch (getSelectValue(formObj, 'action')) {
+		case "cell":
+			var celltype = getSelectValue(formObj, 'celltype');
+			var scope = getSelectValue(formObj, 'scope');
+
+			if (tinyMCE.getParam("accessibility_warnings")) {
+				if (celltype == "th" && scope == "")
+					var answer = confirm(tinyMCE.getLang('lang_table_missing_scope', '', true));
+				else
+					var answer = true;
+
+				if (!answer)
+					return;
+			}
+
+			updateCell(tdElm);
+			break;
+
+		case "row":
+			var cell = trElm.firstChild;
+
+			if (cell.nodeName != "TD" && cell.nodeName != "TH")
+				cell = nextCell(cell);
+
+			do {
+				cell = updateCell(cell, true);
+			} while ((cell = nextCell(cell)) != null);
+
+			break;
+
+		case "all":
+			var rows = tableElm.getElementsByTagName("tr");
+
+			for (var i=0; i<rows.length; i++) {
+				var cell = rows[i].firstChild;
+
+				if (cell.nodeName != "TD" && cell.nodeName != "TH")
+					cell = nextCell(cell);
+
+				do {
+					cell = updateCell(cell, true);
+				} while ((cell = nextCell(cell)) != null);
+			}
+
+			break;
+	}
+
+	tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+	tinyMCE.triggerNodeChange();
+	inst.execCommand('mceEndUndoLevel');
+	tinyMCEPopup.close();
+}
+
+function nextCell(elm) {
+	while ((elm = elm.nextSibling) != null) {
+		if (elm.nodeName == "TD" || elm.nodeName == "TH")
+			return elm;
+	}
+
+	return null;
+}
+
+function updateCell(td, skip_id) {
+	var inst = tinyMCE.selectedInstance;
+	var formObj = document.forms[0];
+	var curCellType = td.nodeName.toLowerCase();
+	var celltype = getSelectValue(formObj, 'celltype');
+	var doc = inst.getDoc();
+
+	if (!skip_id)
+		td.setAttribute('id', formObj.id.value);
+
+	td.setAttribute('align', formObj.align.value);
+	td.setAttribute('vAlign', formObj.valign.value);
+	td.setAttribute('lang', formObj.lang.value);
+	td.setAttribute('dir', getSelectValue(formObj, 'dir'));
+	td.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
+	td.setAttribute('scope', formObj.scope.value);
+	tinyMCE.setAttrib(td, 'class', getSelectValue(formObj, 'class'));
+
+	// Clear deprecated attributes
+	tinyMCE.setAttrib(td, 'width', '');
+	tinyMCE.setAttrib(td, 'height', '');
+	tinyMCE.setAttrib(td, 'bgColor', '');
+	tinyMCE.setAttrib(td, 'borderColor', '');
+	tinyMCE.setAttrib(td, 'background', '');
+
+	// Set styles
+	td.style.width = getCSSSize(formObj.width.value);
+	td.style.height = getCSSSize(formObj.height.value);
+	if (formObj.bordercolor.value != "") {
+		td.style.borderColor = formObj.bordercolor.value;
+		td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
+		td.style.borderWidth = td.style.borderWidth == "" ? "1px" : td.style.borderWidth;
+	} else
+		td.style.borderColor = '';
+
+	td.style.backgroundColor = formObj.bgcolor.value;
+
+	if (formObj.backgroundimage.value != "")
+		td.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
+	else
+		td.style.backgroundImage = '';
+
+	if (curCellType != celltype) {
+		// changing to a different node type
+		var newCell = doc.createElement(celltype);
+
+		for (var c=0; c<td.childNodes.length; c++)
+			newCell.appendChild(td.childNodes[c].cloneNode(1));
+
+		for (var a=0; a<td.attributes.length; a++) {
+			var attr = td.attributes[a];
+			newCell.setAttribute(attr.name, attr.value);
+		}
+
+		td.parentNode.replaceChild(newCell, td);
+		td = newCell;
+	}
+
+	return td;
+}
+
+function changedBackgroundImage() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedSize() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	var width = formObj.width.value;
+	if (width != "")
+		st['width'] = getCSSSize(width);
+	else
+		st['width'] = "";
+
+	var height = formObj.height.value;
+	if (height != "")
+		st['height'] = getCSSSize(height);
+	else
+		st['height'] = "";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedColor() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-color'] = formObj.bgcolor.value;
+	st['border-color'] = formObj.bordercolor.value;
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedStyle() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	if (st['background-image'])
+		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	else
+		formObj.backgroundimage.value = '';
+
+	if (st['width'])
+		formObj.width.value = trimSize(st['width']);
+
+	if (st['height'])
+		formObj.height.value = trimSize(st['height']);
+
+	if (st['background-color']) {
+		formObj.bgcolor.value = st['background-color'];
+		updateColor('bgcolor_pick','bgcolor');
+	}
+
+	if (st['border-color']) {
+		formObj.bordercolor.value = st['border-color'];
+		updateColor('bordercolor_pick','bordercolor');
+	}
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/jscripts/merge_cells.js 75/e107_handlers/tiny_mce/plugins/table/jscripts/merge_cells.js
--- 6171/e107_handlers/tiny_mce/plugins/table/jscripts/merge_cells.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/jscripts/merge_cells.js	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,19 @@
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	var formObj = document.forms[0];
+
+	formObj.numcols.value = tinyMCE.getWindowArg('numcols', 1);
+	formObj.numrows.value = tinyMCE.getWindowArg('numrows', 1);
+}
+
+function mergeCells() {
+	var args = new Array();
+	var formObj = document.forms[0];
+
+	args["numcols"] = formObj.numcols.value;
+	args["numrows"] = formObj.numrows.value;
+
+	tinyMCEPopup.execCommand("mceTableMergeCells", false, args);
+	tinyMCEPopup.close();
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/jscripts/row.js 75/e107_handlers/tiny_mce/plugins/table/jscripts/row.js
--- 6171/e107_handlers/tiny_mce/plugins/table/jscripts/row.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/jscripts/row.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,200 @@
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+	var inst = tinyMCE.selectedInstance;
+	var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(tinyMCE.getAttrib(trElm, "style"));
+
+	// Get table row data
+	var rowtype = trElm.parentNode.nodeName.toLowerCase();
+	var align = tinyMCE.getAttrib(trElm, 'align');
+	var valign = tinyMCE.getAttrib(trElm, 'valign');
+	var height = trimSize(getStyle(trElm, 'height', 'height'));
+	var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(trElm, 'class'), false);
+	var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
+	var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");;
+	var id = tinyMCE.getAttrib(trElm, 'id');
+	var lang = tinyMCE.getAttrib(trElm, 'lang');
+	var dir = tinyMCE.getAttrib(trElm, 'dir');
+
+	// Setup form
+	addClassesToList('class', 'table_row_styles');
+	formObj.bgcolor.value = bgcolor;
+	formObj.backgroundimage.value = backgroundimage;
+	formObj.height.value = height;
+	formObj.id.value = id;
+	formObj.lang.value = lang;
+	formObj.style.value = tinyMCE.serializeStyle(st);
+	selectByValue(formObj, 'align', align);
+	selectByValue(formObj, 'valign', valign);
+	selectByValue(formObj, 'class', className);
+	selectByValue(formObj, 'rowtype', rowtype);
+	selectByValue(formObj, 'dir', dir);
+
+	// Resize some elements
+	if (isVisible('backgroundimagebrowser'))
+		document.getElementById('backgroundimage').style.width = '180px';
+
+	updateColor('bgcolor_pick', 'bgcolor');
+}
+
+function updateAction() {
+	tinyMCEPopup.restoreSelection();
+
+	var inst = tinyMCE.selectedInstance;
+	var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr");
+	var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+	var formObj = document.forms[0];
+	var action = getSelectValue(formObj, 'action');
+
+	inst.execCommand('mceBeginUndoLevel');
+
+	switch (action) {
+		case "row":
+			updateRow(trElm);
+			break;
+
+		case "all":
+			var rows = tableElm.getElementsByTagName("tr");
+
+			for (var i=0; i<rows.length; i++)
+				updateRow(rows[i], true);
+
+			break;
+
+		case "odd":
+		case "even":
+			var rows = tableElm.getElementsByTagName("tr");
+
+			for (var i=0; i<rows.length; i++) {
+				if ((i % 2 == 0 && action == "odd") || (i % 2 != 0 && action == "even"))
+					updateRow(rows[i], true, true);
+			}
+
+			break;
+	}
+
+	tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+	tinyMCE.triggerNodeChange();
+	inst.execCommand('mceEndUndoLevel');
+	tinyMCEPopup.close();
+}
+
+function updateRow(tr_elm, skip_id, skip_parent) {
+	var inst = tinyMCE.selectedInstance;
+	var formObj = document.forms[0];
+	var curRowType = tr_elm.parentNode.nodeName.toLowerCase();
+	var rowtype = getSelectValue(formObj, 'rowtype');
+	var doc = inst.getDoc();
+
+	// Update row element
+	if (!skip_id)
+		tr_elm.setAttribute('id', formObj.id.value);
+
+	tr_elm.setAttribute('align', getSelectValue(formObj, 'align'));
+	tr_elm.setAttribute('vAlign', getSelectValue(formObj, 'valign'));
+	tr_elm.setAttribute('lang', formObj.lang.value);
+	tr_elm.setAttribute('dir', getSelectValue(formObj, 'dir'));
+	tr_elm.setAttribute('style', tinyMCE.serializeStyle(tinyMCE.parseStyle(formObj.style.value)));
+	tinyMCE.setAttrib(tr_elm, 'class', getSelectValue(formObj, 'class'));
+
+	// Clear deprecated attributes
+	tr_elm.setAttribute('background', '');
+	tr_elm.setAttribute('bgColor', '');
+	tr_elm.setAttribute('height', '');
+
+	// Set styles
+	tr_elm.style.height = getCSSSize(formObj.height.value);
+	tr_elm.style.backgroundColor = formObj.bgcolor.value;
+
+	if (formObj.backgroundimage.value != "")
+		tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
+	else
+		tr_elm.style.backgroundImage = '';
+
+	// Setup new rowtype
+	if (curRowType != rowtype && !skip_parent) {
+		// first, clone the node we are working on
+		var newRow = tr_elm.cloneNode(1);
+
+		// next, find the parent of its new destination (creating it if necessary)
+		var theTable = tinyMCE.getParentElement(tr_elm, "table");
+		var dest = rowtype;
+		var newParent = null;
+		for (var i = 0; i < theTable.childNodes.length; i++) {
+			if (theTable.childNodes[i].nodeName.toLowerCase() == dest)
+				newParent = theTable.childNodes[i];
+		}
+
+		if (newParent == null) {
+			newParent = doc.createElement(dest);
+
+			if (dest == "thead")
+				theTable.insertBefore(newParent, theTable.firstChild);
+			else
+				theTable.appendChild(newParent);
+		}
+
+		// append the row to the new parent
+		newParent.appendChild(newRow);
+
+		// remove the original
+		tr_elm.parentNode.removeChild(tr_elm);
+
+		// set tr_elm to the new node
+		tr_elm = newRow;
+	}
+}
+
+function changedBackgroundImage() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedStyle() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	if (st['background-image'])
+		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	else
+		formObj.backgroundimage.value = '';
+
+	if (st['height'])
+		formObj.height.value = trimSize(st['height']);
+
+	if (st['background-color']) {
+		formObj.bgcolor.value = st['background-color'];
+		updateColor('bgcolor_pick','bgcolor');
+	}
+}
+
+function changedSize() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	var height = formObj.height.value;
+	if (height != "")
+		st['height'] = getCSSSize(height);
+	else
+		st['height'] = "";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedColor() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-color'] = formObj.bgcolor.value;
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/jscripts/table.js 75/e107_handlers/tiny_mce/plugins/table/jscripts/table.js
--- 6171/e107_handlers/tiny_mce/plugins/table/jscripts/table.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/jscripts/table.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,344 @@
+var action, orgTableWidth, orgTableHeight;
+
+function insertTable() {
+	var formObj = document.forms[0];
+	var inst = tinyMCE.selectedInstance;
+	var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className;
+	var html = '';
+	var elm = tinyMCE.tableElm;
+	var cellLimit, rowLimit, colLimit;
+
+	tinyMCEPopup.restoreSelection();
+
+	// Get form data
+	cols = formObj.elements['cols'].value;
+	rows = formObj.elements['rows'].value;
+	border = formObj.elements['border'].value != "" ? formObj.elements['border'].value  : 0;
+	cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : "";
+	cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : "";
+	align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value;
+	width = formObj.elements['width'].value;
+	height = formObj.elements['height'].value;
+	bordercolor = formObj.elements['bordercolor'].value;
+	bgcolor = formObj.elements['bgcolor'].value;
+	className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value;
+	id = formObj.elements['id'].value;
+	summary = formObj.elements['summary'].value;
+	style = formObj.elements['style'].value;
+	dir = formObj.elements['dir'].value;
+	lang = formObj.elements['lang'].value;
+	background = formObj.elements['backgroundimage'].value;
+
+	cellLimit = tinyMCE.getParam('table_cell_limit', false);
+	rowLimit = tinyMCE.getParam('table_row_limit', false);
+	colLimit = tinyMCE.getParam('table_col_limit', false);
+
+	// Validate table size
+	if (colLimit && cols > colLimit) {
+		alert(tinyMCE.getLang('lang_table_col_limit', '', true, {cols : colLimit}));
+		return false;
+	} else if (rowLimit && rows > rowLimit) {
+		alert(tinyMCE.getLang('lang_table_row_limit', '', true, {rows : rowLimit}));
+		return false;
+	} else if (cellLimit && cols * rows > cellLimit) {
+		alert(tinyMCE.getLang('lang_table_cell_limit', '', true, {cells : cellLimit}));
+		return false;
+	}
+
+	// Update table
+	if (action == "update") {
+		inst.execCommand('mceBeginUndoLevel');
+
+		tinyMCE.setAttrib(elm, 'cellPadding', cellpadding, true);
+		tinyMCE.setAttrib(elm, 'cellSpacing', cellspacing, true);
+		tinyMCE.setAttrib(elm, 'border', border, true);
+		tinyMCE.setAttrib(elm, 'align', align);
+		tinyMCE.setAttrib(elm, 'class', className);
+		tinyMCE.setAttrib(elm, 'style', style);
+		tinyMCE.setAttrib(elm, 'id', id);
+		tinyMCE.setAttrib(elm, 'summary', summary);
+		tinyMCE.setAttrib(elm, 'dir', dir);
+		tinyMCE.setAttrib(elm, 'lang', lang);
+
+		// Not inline styles
+		if (!tinyMCE.getParam("inline_styles"))
+			tinyMCE.setAttrib(elm, 'width', width, true);
+
+		// Remove these since they are not valid XHTML
+		tinyMCE.setAttrib(elm, 'borderColor', '');
+		tinyMCE.setAttrib(elm, 'bgColor', '');
+		tinyMCE.setAttrib(elm, 'background', '');
+		tinyMCE.setAttrib(elm, 'height', '');
+
+		if (background != '')
+			elm.style.backgroundImage = "url('" + background + "')";
+		else
+			elm.style.backgroundImage = '';
+
+		if (tinyMCE.getParam("inline_styles"))
+			elm.style.borderWidth = border + "px";
+
+		if (tinyMCE.getParam("inline_styles")) {
+			if (width != '')
+				elm.style.width = getCSSSize(width);
+		}
+
+		if (bordercolor != "") {
+			elm.style.borderColor = bordercolor;
+			elm.style.borderStyle = elm.style.borderStyle == "" ? "solid" : elm.style.borderStyle;
+			elm.style.borderWidth = border == "" ? "1px" : border;
+		} else
+			elm.style.borderColor = '';
+
+		elm.style.backgroundColor = bgcolor;
+		elm.style.height = getCSSSize(height);
+
+		tinyMCE.handleVisualAid(tinyMCE.tableElm, false, inst.visualAid, inst);
+
+		// Fix for stange MSIE align bug
+		tinyMCE.tableElm.outerHTML = tinyMCE.tableElm.outerHTML;
+
+		tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+		tinyMCE.triggerNodeChange();
+		inst.execCommand('mceEndUndoLevel');
+
+		// Repaint if dimensions changed
+		if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight)
+			inst.repaint();
+
+		tinyMCEPopup.close();
+		return true;
+	}
+
+	// Create new table
+	html += '<table';
+
+	html += makeAttrib('id', id);
+	html += makeAttrib('border', border);
+	html += makeAttrib('cellpadding', cellpadding);
+	html += makeAttrib('cellspacing', cellspacing);
+	html += makeAttrib('width', width);
+	//html += makeAttrib('height', height);
+	//html += makeAttrib('bordercolor', bordercolor);
+	//html += makeAttrib('bgcolor', bgcolor);
+	html += makeAttrib('align', align);
+	html += makeAttrib('class', tinyMCE.getVisualAidClass(className, border == 0));
+	html += makeAttrib('style', style);
+	html += makeAttrib('summary', summary);
+	html += makeAttrib('dir', dir);
+	html += makeAttrib('lang', lang);
+
+	html += '>';
+
+	for (var y=0; y<rows; y++) {
+		html += "<tr>";
+
+		for (var x=0; x<cols; x++)
+			html += '<td>&nbsp;</td>';
+
+		html += "</tr>";
+	}
+
+	html += "</table>";
+
+	inst.execCommand('mceBeginUndoLevel');
+	inst.execCommand('mceInsertContent', false, html);
+	tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual']);
+	inst.execCommand('mceEndUndoLevel');
+
+	tinyMCEPopup.close();
+}
+
+function makeAttrib(attrib, value) {
+	var formObj = document.forms[0];
+	var valueElm = formObj.elements[attrib];
+
+	if (typeof(value) == "undefined" || value == null) {
+		value = "";
+
+		if (valueElm)
+			value = valueElm.value;
+	}
+
+	if (value == "")
+		return "";
+
+	// XML encode it
+	value = value.replace(/&/g, '&amp;');
+	value = value.replace(/\"/g, '&quot;');
+	value = value.replace(/</g, '&lt;');
+	value = value.replace(/>/g, '&gt;');
+
+	return ' ' + attrib + '="' + value + '"';
+}
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table');
+	document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor');
+	document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor');
+
+	var cols = 2, rows = 2, border = 0, cellpadding = "", cellspacing = "";
+	var align = "", width = "", height = "", bordercolor = "", bgcolor = "", className = "";
+	var id = "", summary = "", style = "", dir = "", lang = "", background = "", bgcolor = "", bordercolor = "";
+	var inst = tinyMCE.selectedInstance;
+	var formObj = document.forms[0];
+	var elm = tinyMCE.getParentElement(inst.getFocusElement(), "table");
+
+	tinyMCE.tableElm = elm;
+	action = tinyMCE.getWindowArg('action');
+	if (action == null)
+		action = tinyMCE.tableElm ? "update" : "insert";
+
+	if (tinyMCE.tableElm && action != "insert") {
+		var rowsAr = tinyMCE.tableElm.rows;
+		var cols = 0;
+		for (var i=0; i<rowsAr.length; i++)
+			if (rowsAr[i].cells.length > cols)
+				cols = rowsAr[i].cells.length;
+
+		cols = cols;
+		rows = rowsAr.length;
+
+		st = tinyMCE.parseStyle(tinyMCE.getAttrib(tinyMCE.tableElm, "style"));
+		border = trimSize(getStyle(elm, 'border', 'borderWidth'));
+		cellpadding = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellpadding', "");
+		cellspacing = tinyMCE.getAttrib(tinyMCE.tableElm, 'cellspacing', "");
+		width = trimSize(getStyle(elm, 'width', 'width'));
+		height = trimSize(getStyle(elm, 'height', 'height'));
+		bordercolor = convertRGBToHex(getStyle(elm, 'bordercolor', 'borderLeftColor'));
+		bgcolor = convertRGBToHex(getStyle(elm, 'bgcolor', 'backgroundColor'));
+		align = tinyMCE.getAttrib(tinyMCE.tableElm, 'align', align);
+		className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tinyMCE.tableElm, 'class'), false);
+		id = tinyMCE.getAttrib(tinyMCE.tableElm, 'id');
+		summary = tinyMCE.getAttrib(tinyMCE.tableElm, 'summary');
+		style = tinyMCE.serializeStyle(st);
+		dir = tinyMCE.getAttrib(tinyMCE.tableElm, 'dir');
+		lang = tinyMCE.getAttrib(tinyMCE.tableElm, 'lang');
+		background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+
+		orgTableWidth = width;
+		orgTableHeight = height;
+
+		action = "update";
+	}
+
+	addClassesToList('class', "table_styles");
+
+	// Update form
+	selectByValue(formObj, 'align', align);
+	selectByValue(formObj, 'class', className);
+	formObj.cols.value = cols;
+	formObj.rows.value = rows;
+	formObj.border.value = border;
+	formObj.cellpadding.value = cellpadding;
+	formObj.cellspacing.value = cellspacing;
+	formObj.width.value = width;
+	formObj.height.value = height;
+	formObj.bordercolor.value = bordercolor;
+	formObj.bgcolor.value = bgcolor;
+	formObj.id.value = id;
+	formObj.summary.value = summary;
+	formObj.style.value = style;
+	formObj.dir.value = dir;
+	formObj.lang.value = lang;
+	formObj.backgroundimage.value = background;
+	formObj.insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true); 
+
+	updateColor('bordercolor_pick', 'bordercolor');
+	updateColor('bgcolor_pick', 'bgcolor');
+
+	// Resize some elements
+	if (isVisible('backgroundimagebrowser'))
+		document.getElementById('backgroundimage').style.width = '180px';
+
+	// Disable some fields in update mode
+	if (action == "update") {
+		formObj.cols.disabled = true;
+		formObj.rows.disabled = true;
+	}
+}
+
+function changedSize() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	var width = formObj.width.value;
+	if (width != "")
+		st['width'] = tinyMCE.getParam("inline_styles") ? getCSSSize(width) : "";
+	else
+		st['width'] = "";
+
+	var height = formObj.height.value;
+	if (height != "")
+		st['height'] = getCSSSize(height);
+	else
+		st['height'] = "";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedBackgroundImage() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-image'] = "url('" + formObj.backgroundimage.value + "')";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedBorder() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	// Update border width if the element has a color
+	if (formObj.border.value != "" && formObj.bordercolor.value != "")
+		st['border-width'] = formObj.border.value + "px";
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedColor() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	st['background-color'] = formObj.bgcolor.value;
+
+	if (formObj.bordercolor.value != "") {
+		st['border-color'] = formObj.bordercolor.value;
+
+		// Add border-width if it's missing
+		if (!st['border-width'])
+			st['border-width'] = formObj.border.value == "" ? "1px" : formObj.border.value + "px";
+	}
+
+	formObj.style.value = tinyMCE.serializeStyle(st);
+}
+
+function changedStyle() {
+	var formObj = document.forms[0];
+	var st = tinyMCE.parseStyle(formObj.style.value);
+
+	if (st['background-image'])
+		formObj.backgroundimage.value = st['background-image'].replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+	else
+		formObj.backgroundimage.value = '';
+
+	if (st['width'])
+		formObj.width.value = trimSize(st['width']);
+
+	if (st['height'])
+		formObj.height.value = trimSize(st['height']);
+
+	if (st['background-color']) {
+		formObj.bgcolor.value = st['background-color'];
+		updateColor('bgcolor_pick','bgcolor');
+	}
+
+	if (st['border-color']) {
+		formObj.bordercolor.value = st['border-color'];
+		updateColor('bordercolor_pick','bordercolor');
+	}
+}
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/langs/en.js 75/e107_handlers/tiny_mce/plugins/table/langs/en.js
--- 6171/e107_handlers/tiny_mce/plugins/table/langs/en.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/langs/en.js	2006-04-16 02:02:35.000000000 -0500
@@ -0,0 +1,78 @@
+// UK lang variables
+
+tinyMCE.addToLang('table',{
+general_tab : 'General',
+advanced_tab : 'Advanced',
+general_props : 'General properties',
+advanced_props : 'Advanced properties',
+desc : 'Inserts a new table',
+row_before_desc : 'Insert row before',
+row_after_desc : 'Insert row after',
+delete_row_desc : 'Delete row',
+col_before_desc : 'Insert column before',
+col_after_desc : 'Insert column after',
+delete_col_desc : 'Remove column',
+rowtype : 'Row in table part',
+title : 'Insert/Modify table',
+width : 'Width',
+height : 'Height',
+cols : 'Columns',
+rows : 'Rows',
+cellspacing : 'Cellspacing',
+cellpadding : 'Cellpadding',
+border : 'Border',
+align : 'Alignment',
+align_default : 'Default',
+align_left : 'Left',
+align_right : 'Right',
+align_middle : 'Center',
+row_title : 'Table row properties',
+cell_title : 'Table cell properties',
+cell_type : 'Cell type',
+row_desc : 'Table row properties',
+cell_desc : 'Table cell properties',
+valign : 'Vertical alignment',
+align_top : 'Top',
+align_bottom : 'Bottom',
+props_desc : 'Table properties',
+bordercolor : 'Border color',
+bgcolor : 'Background color',
+merge_cells_title : 'Merge table cells',
+split_cells_desc : 'Split table cells',
+merge_cells_desc : 'Merge table cells',
+cut_row_desc : 'Cut table row',
+copy_row_desc : 'Copy table row',
+paste_row_before_desc : 'Paste table row before',
+paste_row_after_desc : 'Paste table row after',
+id : 'Id',
+style: 'Style',
+langdir : 'Language direction',
+langcode : 'Language code',
+mime : 'Target MIME type',
+ltr : 'Left to right',
+rtl : 'Right to left',
+bgimage : 'Background image',
+summary : 'Summary',
+td : "Data",
+th : "Header",
+cell_cell : 'Update current cell',
+cell_row : 'Update all cells in row',
+cell_all : 'Update all cells in table',
+row_row : 'Update current row',
+row_odd : 'Update odd rows in table',
+row_even : 'Update even rows in table',
+row_all : 'Update all rows in table',
+thead : 'Table Head',
+tbody : 'Table Body',
+tfoot : 'Table Foot',
+del : 'Delete table',
+scope : 'Scope',
+row : 'Row',
+col : 'Col',
+rowgroup : 'Row Group',
+colgroup : 'Col Group',
+col_limit : 'You\'ve exceeded the maximum number of columns of {$cols}.',
+row_limit : 'You\'ve exceeded the maximum number of rows of {$rows}.',
+cell_limit : 'You\'ve exceeded the maximum number of cells of {$cells}.',
+missing_scope: 'Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.'
+});
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/merge_cells.htm 75/e107_handlers/tiny_mce/plugins/table/merge_cells.htm
--- 6171/e107_handlers/tiny_mce/plugins/table/merge_cells.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/merge_cells.htm	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,37 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_table_merge_cells_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/merge_cells.js"></script>
+	<base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="margin: 8px" style="display: none">
+<form onsubmit="insertTable();return false;" action="#">
+	<fieldset>
+		<legend>{$lang_table_merge_cells_title}</legend>
+		  <table border="0" cellpadding="0" cellspacing="3" width="100%">
+			  <tr>
+				<td>{$lang_table_cols}:</td>
+				<td align="right"><input type="text" name="numcols" value="" style="width: 30px" /></td>
+				<td>
+			  </tr>
+			  <tr>
+				<td>{$lang_table_rows}:</td>
+				<td align="right"><input type="text" name="numrows" value="" style="width: 30px" /></td>
+			  </tr>
+		  </table>
+	</fieldset>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="mergeCells();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/row.htm 75/e107_handlers/tiny_mce/plugins/table/row.htm
--- 6171/e107_handlers/tiny_mce/plugins/table/row.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/row.htm	2006-04-16 02:02:35.000000000 -0500
@@ -0,0 +1,159 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_table_row_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/row.js"></script>
+	<link href="css/row.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="tablerow" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+	<form onsubmit="updateAction();return false;">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{$lang_table_general_props}</legend>
+
+					<table border="0" cellpadding="4" cellspacing="0">
+						<tr>
+							<td><label for="rowtype">{$lang_table_rowtype}</label></td>
+							<td class="col2">
+								<select id="rowtype" name="rowtype">
+									<option value="thead">{$lang_table_thead}</option>
+									<option value="tbody">{$lang_table_tbody}</option>
+									<option value="tfoot">{$lang_table_tfoot}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="align">{$lang_table_align}</label></td>
+							<td class="col2">
+								<select id="align" name="align">
+									<option value="">{$lang_not_set}</option>
+									<option value="center">{$lang_table_align_middle}</option>
+									<option value="left">{$lang_table_align_left}</option>
+									<option value="right">{$lang_table_align_right}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="valign">{$lang_table_valign}</label></td>
+							<td class="col2">
+								<select id="valign" name="valign">
+									<option value="">{$lang_not_set}</option>
+									<option value="top">{$lang_table_align_top}</option>
+									<option value="middle">{$lang_table_align_middle}</option>
+									<option value="bottom">{$lang_table_align_bottom}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr id="styleSelectRow">
+							<td><label for="class">{$lang_class_name}</label></td>
+							<td class="col2">
+								<select id="class" name="class">
+									<option value="" selected="selected">{$lang_not_set}</option>
+								</select>
+							</td>
+						</tr>
+
+						<tr>
+							<td><label for="height">{$lang_table_height}</label></td>
+							<td class="col2"><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{$lang_table_advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="id">{$lang_table_id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" style="width: 200px" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="style">{$lang_table_style}</label></td>
+							<td><input type="text" id="style" name="style" value="" style="width: 200px;" onchange="changedStyle();" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" style="width: 200px"> 
+										<option value="">{$lang_not_set}</option> 
+										<option value="ltr">{$lang_table_ltr}</option> 
+										<option value="rtl">{$lang_table_rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="lang">{$lang_table_langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" style="width: 200px" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" style="width: 200px" onchange="changedBackgroundImage();" /></td>
+										<td id="backgroundimagebrowsercontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+										<td id="bgcolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div>
+				<select id="action" name="action">
+					<option value="row">{$lang_table_row_row}</option>
+					<option value="odd">{$lang_table_row_odd}</option>
+					<option value="even">{$lang_table_row_even}</option>
+					<option value="all">{$lang_table_row_all}</option>
+				</select>
+			</div>
+
+			<div style="float: left">
+				<div><input type="button" id="insert" name="insert" value="{$lang_update}" onclick="updateAction();" /></div>
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/plugins/table/table.htm 75/e107_handlers/tiny_mce/plugins/table/table.htm
--- 6171/e107_handlers/tiny_mce/plugins/table/table.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/table/table.htm	2006-04-16 02:02:35.000000000 -0500
@@ -0,0 +1,155 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_table_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/table.js"></script>
+	<link href="css/table.css" rel="stylesheet" type="text/css" />
+	<base target="_self" />
+</head>
+<body id="table" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+	<form onsubmit="insertTable();return false;" action="#">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_table_general_tab}</a></span></li>
+				<li id="advanced_tab"><span><a href="javascript:mcTabs.displayTab('advanced_tab','advanced_panel');" onmousedown="return false;">{$lang_table_advanced_tab}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<fieldset>
+					<legend>{$lang_table_general_props}</legend>
+
+					  <table border="0" cellpadding="4" cellspacing="0" width="100%">
+							  <tr>
+								<td><label id="colslabel" for="cols">{$lang_table_cols}</label></td>
+								<td><input id="cols" name="cols" type="text" value="" size="3" maxlength="3" /></td>
+								<td><label id="rowslabel" for="rows">{$lang_table_rows}</label></td>
+								<td><input id="rows" name="rows" type="text" value="" size="3" maxlength="3" /></td>
+							  </tr>
+							  <tr>
+								<td><label id="cellpaddinglabel" for="cellpadding">{$lang_table_cellpadding}</label></td>
+								<td><input id="cellpadding" name="cellpadding" type="text" value="" size="3" maxlength="3" /></td>
+								<td><label id="cellspacinglabel" for="cellspacing">{$lang_table_cellspacing}</label></td>
+								<td><input id="cellspacing" name="cellspacing" type="text" value="" size="3" maxlength="3" /></td>
+							  </tr>
+							  <tr>
+								<td><label id="alignlabel" for="align">{$lang_table_align}</label></td>
+								<td><select id="align" name="align">
+									<option value="">{$lang_not_set}</option>
+									<option value="center">{$lang_table_align_middle}</option>
+									<option value="left">{$lang_table_align_left}</option>
+									<option value="right">{$lang_table_align_right}</option>
+								  </select></td>
+								<td><label id="borderlabel" for="border">{$lang_table_border}</label></td>
+								<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="changedBorder();" /></td>
+							  </tr>
+							  <tr>
+								<td><label id="widthlabel" for="width">{$lang_table_width}</label></td>
+								<td><input name="width" type="text" id="width" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+								<td><label id="heightlabel" for="height">{$lang_table_height}</label></td>
+								<td><input name="height" type="text" id="height" value="" size="4" maxlength="4" onchange="changedSize();" /></td>
+							  </tr>
+							  <tr id="styleSelectRow">
+								<td><label id="classlabel" for="class">{$lang_class_name}</label></td>
+								<td colspan="3">
+								 <select id="class" name="class">
+									<option value="" selected>{$lang_not_set}</option>
+								 </select></td>
+							  </tr>
+							</table>
+				</fieldset>
+			</div>
+
+			<div id="advanced_panel" class="panel">
+				<fieldset>
+					<legend>{$lang_table_advanced_props}</legend>
+
+					<table border="0" cellpadding="0" cellspacing="4">
+						<tr>
+							<td class="column1"><label for="id">{$lang_table_id}</label></td> 
+							<td><input id="id" name="id" type="text" value="" class="advfield" /></td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="summary">{$lang_table_summary}</label></td> 
+							<td><input id="summary" name="summary" type="text" value="" class="advfield" /></td> 
+						</tr>
+
+						<tr>
+							<td><label for="style">{$lang_table_style}</label></td>
+							<td><input type="text" id="style" name="style" value="" class="advfield" onchange="changedStyle();" /></td>
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="dir">{$lang_table_langdir}</label></td> 
+							<td>
+								<select id="dir" name="dir" class="advfield"> 
+										<option value="">{$lang_not_set}</option> 
+										<option value="ltr">{$lang_table_ltr}</option> 
+										<option value="rtl">{$lang_table_rtl}</option> 
+								</select>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label id="langlabel" for="lang">{$lang_table_langcode}</label></td> 
+							<td>
+								<input id="lang" name="lang" type="text" value="" class="advfield" />
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="backgroundimage">{$lang_table_bgimage}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="backgroundimage" name="backgroundimage" type="text" value="" class="advfield" onchange="changedBackgroundImage();" /></td>
+										<td id="backgroundimagebrowsercontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bordercolor">{$lang_table_bordercolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bordercolor" name="bordercolor" type="text" value="" size="9" onchange="updateColor('bordercolor_pick','bordercolor');changedColor();" /></td>
+										<td id="bordercolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+
+						<tr>
+							<td class="column1"><label for="bgcolor">{$lang_table_bgcolor}</label></td> 
+							<td>
+								<table border="0" cellpadding="0" cellspacing="0">
+									<tr>
+										<td><input id="bgcolor" name="bgcolor" type="text" value="" size="9" onchange="updateColor('bgcolor_pick','bgcolor');changedColor();" /></td>
+										<td id="bgcolor_pickcontainer">&nbsp;</td>
+									</tr>
+								</table>
+							</td> 
+						</tr>
+					</table>
+				</fieldset>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertTable();" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/plugins/zoom/editor_plugin.js 75/e107_handlers/tiny_mce/plugins/zoom/editor_plugin.js
--- 6171/e107_handlers/tiny_mce/plugins/zoom/editor_plugin.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/zoom/editor_plugin.js	2006-05-06 21:50:09.000000000 -0500
@@ -0,0 +1 @@
+var TinyMCE_ZoomPlugin={getInfo:function(){return{longname:'Zoom',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(control_name){if(!tinyMCE.isMSIE||tinyMCE.isMSIE5_0||tinyMCE.isOpera)return"";switch(control_name){case"zoom":return'<select id="{$editor_id}_zoomSelect" name="{$editor_id}_zoomSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceZoom\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+'<option value="100%">+ 100%</option>'+'<option value="150%">+ 150%</option>'+'<option value="200%">+ 200%</option>'+'<option value="250%">+ 250%</option>'+'</select>';}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceZoom":tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom=value;tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom=value;return true;}return false;}};tinyMCE.addPlugin("zoom",TinyMCE_ZoomPlugin);
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/plugins/zoom/editor_plugin_src.js 75/e107_handlers/tiny_mce/plugins/zoom/editor_plugin_src.js
--- 6171/e107_handlers/tiny_mce/plugins/zoom/editor_plugin_src.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/plugins/zoom/editor_plugin_src.js	2006-05-06 21:50:09.000000000 -0500
@@ -0,0 +1,58 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.1 $
+ * $Date: 2006/05/07 02:50:09 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+var TinyMCE_ZoomPlugin = {
+	getInfo : function() {
+		return {
+			longname : 'Zoom',
+			author : 'Moxiecode Systems',
+			authorurl : 'http://tinymce.moxiecode.com',
+			infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',
+			version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+		};
+	},
+
+	/**
+	 * Returns the HTML contents of the zoom control.
+	 */
+	getControlHTML : function(control_name) {
+		if (!tinyMCE.isMSIE || tinyMCE.isMSIE5_0 || tinyMCE.isOpera)
+			return "";
+
+		switch (control_name) {
+			case "zoom":
+				return '<select id="{$editor_id}_zoomSelect" name="{$editor_id}_zoomSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceZoom\',false,this.options[this.selectedIndex].value);" class="mceSelectList">' + 
+						'<option value="100%">+ 100%</option>' + 
+						'<option value="150%">+ 150%</option>' + 
+						'<option value="200%">+ 200%</option>' + 
+						'<option value="250%">+ 250%</option>' + 
+						'</select>';
+		}
+
+		return "";
+	},
+
+	/**
+	 * Executes the mceZoom command.
+	 */
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		// Handle commands
+		switch (command) {
+			case "mceZoom":
+				tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom = value;
+				tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom = value;
+				return true;
+		}
+
+		// Pass to next handler in chain
+		return false;
+	}
+};
+
+tinyMCE.addPlugin("zoom", TinyMCE_ZoomPlugin);
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/about.htm 75/e107_handlers/tiny_mce/themes/advanced/about.htm
--- 6171/e107_handlers/tiny_mce/themes/advanced/about.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/about.htm	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,52 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_about_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/about.js"></script>
+	<base target="_self" />
+</head>
+<body id="about" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_about}</a></span></li>
+				<li id="help_tab"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{$lang_help}</a></span></li>
+				<li id="plugins_tab"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{$lang_plugins}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<h3>{$lang_about_title}</h3>
+				<p>Version: {$tinymce_version} ({$tinymce_releasedate})</p>
+				<p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>
+				by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>
+				<p>Copyright &copy; 2003-2006, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>
+				<p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>
+
+				<div id="buttoncontainer"></div>
+			</div>
+
+			<div id="plugins_panel" class="panel">
+				<div id="pluginscontainer">
+					<h3>{$lang_loaded_plugins}</h3>
+
+					<div id="plugintablecontainer">
+					</div>
+
+					<p>&nbsp;</p>
+				</div>
+			</div>
+
+			<div id="help_panel" class="panel noscroll" style="overflow: visible;">
+				<div id="iframecontainer"></div>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<div style="float: right">
+				<input type="button" id="cancel" name="cancel" value="{$lang_close}" onclick="tinyMCEPopup.close();" />
+			</div>
+		</div>
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/anchor.htm 75/e107_handlers/tiny_mce/themes/advanced/anchor.htm
--- 6171/e107_handlers/tiny_mce/themes/advanced/anchor.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/anchor.htm	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,33 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_insert_anchor_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/anchor.js"></script>
+	<base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<form onsubmit="insertAnchor();return false;" action="#">
+
+	<table border="0" cellpadding="4" cellspacing="0">
+		<tr>
+			<td colspan="2" class="title">{$lang_insert_anchor_title}</td>
+		</tr>
+		<tr>
+			<td nowrap="nowrap">{$lang_insert_anchor_name}:</td>
+			<td><input name="anchorName" type="text" id="anchorName" value="" style="width: 200px" /></td>
+		</tr>
+	</table>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{$lang_update}" onclick="insertAnchor();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+
+</form>
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/charmap.htm 75/e107_handlers/tiny_mce/themes/advanced/charmap.htm
--- 6171/e107_handlers/tiny_mce/themes/advanced/charmap.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/charmap.htm	2005-12-23 18:09:57.000000000 -0600
@@ -0,0 +1,53 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_theme_charmap_title}</title>
+	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/charmap.js"></script>
+	<base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<table align="center" border="0" cellspacing="0" cellpadding="2">
+    <tr>
+        <td colspan="2" class="title">{$lang_theme_charmap_title}</td>
+    </tr>
+    <tr>
+        <td rowspan="2" align="left" valign="top">
+            <script language="javascript" type="text/javascript">renderCharMapHTML();</script>
+        </td>
+        <td width="100" align="center" valign="top">
+            <table border="0" cellpadding="0" cellspacing="0" width="100" style="height: 100px">
+                <tr>
+                    <td class="charmapOver" style="font-size: 40px; height:80px;" id="codeV">&nbsp;</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 10px; font-family: Arial, Helvetica, sans-serif; text-align:center;" id="codeN">&nbsp;</td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+    <tr>
+        <td valign="bottom" style="padding-bottom: 3px;">
+            <table width="100" align="center" border="0" cellpadding="2" cellspacing="0">
+                <tr>
+                    <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">HTML-Code</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center">&nbsp;</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 1px;">&nbsp;</td>
+                </tr>
+                <tr>
+                    <td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;">NUM-Code</td>
+                </tr>
+                <tr>
+                    <td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center">&nbsp;</td>
+                </tr>
+            </table>
+        </td>
+    </tr>
+</table>
+
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/color_picker.htm 75/e107_handlers/tiny_mce/themes/advanced/color_picker.htm
--- 6171/e107_handlers/tiny_mce/themes/advanced/color_picker.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/color_picker.htm	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,13 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_theme_colorpicker_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/color_picker.js"></script>
+	<base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('init();');" style="margin: 3px; display: none">
+	<div align="center">
+	   <script language="javascript" type="text/javascript">renderColorMap();</script>
+	</div>
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/css/editor_content.css 75/e107_handlers/tiny_mce/themes/advanced/css/editor_content.css
--- 6171/e107_handlers/tiny_mce/themes/advanced/css/editor_content.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/css/editor_content.css	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,58 @@
+/* This file contains the CSS data for the editable area(iframe) of TinyMCE */
+/* You can extend this CSS by adding your own CSS file with the the content_css option */
+
+body, td, pre {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+body {
+	background-color: #FFFFFF;
+}
+
+.mceVisualAid {
+	border: 1px dashed #BBBBBB !important;
+}
+
+div.mceVisualAid {
+	background-image:url('../images/spacer.gif');
+	visibility: visible !important;
+}
+
+.mceItemAnchor {
+	width: 12px;
+	line-height: 6px;
+	overflow: hidden;
+	padding-left: 12px;
+	background-image: url('../images/anchor_symbol.gif');
+	background-position: bottom;
+	background-repeat: no-repeat;
+}
+
+/* Important is needed in Gecko browsers inorder to style links */
+/*
+a {
+	color: green !important;
+}
+*/
+
+/* Style selection range colors in Gecko browsers */
+/*
+::-moz-selection {
+	background-color: red;
+	color: green;
+}
+*/
+
+/* MSIE specific */
+
+* html body {
+	scrollbar-3dlight-color: #F0F0EE;
+	scrollbar-arrow-color: #676662;
+	scrollbar-base-color: #F0F0EE;
+	scrollbar-darkshadow-color: #DDDDDD;
+	scrollbar-face-color: #E0E0DD;
+	scrollbar-highlight-color: #F0F0EE;
+	scrollbar-shadow-color: #F0F0EE;
+	scrollbar-track-color: #F5F5F5;
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/css/editor_popup.css 75/e107_handlers/tiny_mce/themes/advanced/css/editor_popup.css
--- 6171/e107_handlers/tiny_mce/themes/advanced/css/editor_popup.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/css/editor_popup.css	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,327 @@
+/* This file contains the CSS data for all popups in TinyMCE */
+
+body {
+	background-color: #F0F0EE;
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 11px;
+	scrollbar-3dlight-color: #F0F0EE;
+	scrollbar-arrow-color: #676662;
+	scrollbar-base-color: #F0F0EE;
+	scrollbar-darkshadow-color: #DDDDDD;
+	scrollbar-face-color: #E0E0DD;
+	scrollbar-highlight-color: #F0F0EE;
+	scrollbar-shadow-color: #F0F0EE;
+	scrollbar-track-color: #F5F5F5;
+	margin: 8px;
+}
+
+td {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 11px;
+}
+
+input {
+	background: #FFFFFF;
+	border: 1px solid #cccccc;
+}
+
+td, input, select, textarea {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+input, select, textarea {
+	border: 1px solid #808080;
+}
+
+.input_noborder {
+	border: 0;
+}
+
+#insert, .updateButton {
+   font-weight: bold;
+   width: 90px;
+   height: 21px;
+   border: 0;
+   background-image: url('../images/insert_button_bg.gif');
+   cursor: pointer;
+}
+
+#cancel {
+   font-weight: bold;
+   width: 90px;
+   height: 21px;
+   border: 0;
+   background-image: url('../images/cancel_button_bg.gif');
+   cursor: pointer;
+}
+
+/* Mozilla only style */
+html>body #insert, html>body #cancel {
+	padding-bottom: 2px;
+}
+
+.title {
+	font-size: 12px;
+	font-weight: bold;
+	color: #2B6FB6;
+}
+
+table.charmap {
+	border-style: solid;
+	border-width: 1px;
+	border-color: #AAAAAA;
+}
+
+td.charmap, td.charmapOver {
+	color: #000000;
+	border-color: #AAAAAA;
+	border-style: solid;
+	border-width: 1px;
+	text-align: center;
+	font-size: 12px;
+}
+
+td.charmapOver {
+	background-color: #CCCCCC;
+	cursor: default;
+}
+
+a.charmap {
+	color: #000000;
+	text-decoration: none
+}
+
+.wordWrapCode {
+	vertical-align: middle;
+	border: 1px none #000000;
+	background-color: transparent;
+}
+
+input.radio {
+	border: 1px none #000000;
+	background-color: transparent;
+	vertical-align: middle;
+}
+
+input.checkbox {
+	border: 1px none #000000;
+	background-color: transparent;
+	vertical-align: middle;
+}
+
+.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected {
+	margin-left: 1px;
+}
+
+.mceButtonNormal {
+	border-top: 1px solid;
+	border-left: 1px solid;
+	border-bottom: 1px solid;
+	border-right: 1px solid;
+	border-color: #F0F0EE;
+	cursor: default;
+}
+
+.mceButtonOver {
+	border: 1px solid #0A246A;
+	cursor: default;
+	background-color: #B6BDD2;
+}
+
+.mceButtonDown {
+	cursor: default;
+	border: 1px solid #0A246A;
+	background-color: #8592B5;
+}
+
+.mceButtonDisabled {
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+	-moz-opacity:0.3;
+	opacity: 0.3;
+	border-top: 1px solid;
+	border-left: 1px solid;
+	border-bottom: 1px solid;
+	border-right: 1px solid;
+	border-color: #F0F0EE;
+	cursor: default;
+}
+
+.mceActionPanel {
+	margin-top: 5px;
+}
+
+/* Tabs classes */
+
+.tabs {
+	float: left;
+	width: 100%;
+	line-height: normal;
+	background-image: url("../images/xp/tabs_bg.gif");
+}
+
+.tabs ul {
+	margin: 0;
+	padding: 0 0 0;
+	list-style: none;
+}
+
+.tabs li {
+	float: left;
+	background: url("../images/xp/tab_bg.gif") no-repeat left top;
+	margin: 0;
+	margin-left: 0;
+	margin-right: 2px;
+	padding: 0 0 0 10px;
+	line-height: 18px;
+}
+
+.tabs li.current {
+	background: url("../images/xp/tab_sel_bg.gif") no-repeat left top;
+	margin-right: 2px;
+}
+
+.tabs span {
+	float: left;
+	display: block;
+	background: url("../images/xp/tab_end.gif") no-repeat right top;
+	padding: 0px 10px 0 0;
+}
+
+.tabs .current span {
+	background: url("../images/xp/tab_sel_end.gif") no-repeat right top;
+}
+
+.tabs a {
+	text-decoration: none;
+	font-family: Verdana, Arial;
+	font-size: 10px;
+}
+
+.tabs a:link, .tabs a:visited, .tabs a:hover {
+	color: black;
+}
+
+.tabs a:hover {
+}
+
+.tabs .current {
+}
+
+.tabs .current a, .tabs .current a:link, .tabs .current a:visited {
+}
+
+.panel_wrapper div.panel {
+	display: none;
+}
+
+.panel_wrapper div.current {
+	display: block;
+	width: 100%;
+	height: 300px;
+	overflow: visible; /* Should be auto but that breaks Safari */
+}
+
+.panel_wrapper {
+	border: 1px solid #919B9C;
+	border-top: 0px;
+	padding: 10px;
+	padding-top: 5px;
+	clear: both;
+	background-color: white;
+}
+
+fieldset {
+	border: 1px solid #919B9C;
+	font-family: Verdana, Arial;
+	font-size: 10px;
+	padding: 0;
+	margin: 0;
+	padding: 4px;
+}
+
+legend {
+	color: #2B6FB6;
+	font-weight: bold;
+}
+
+.properties {
+	width: 100%;
+}
+
+.properties .column1 {
+}
+
+.properties .column2 {
+	text-align: left;
+}
+
+a:link, a:visited {
+	color: black;
+}
+
+a:hover {
+	color: #2B6FB6;
+}
+
+#plugintable thead {
+	font-weight: bold;
+	background-color: #DDDDDD;
+}
+
+#plugintable, #about #plugintable td {
+	border: 1px solid #919B9C;
+}
+
+#plugintable {
+	width: 99%;
+	margin-top: 10px;
+}
+
+#pluginscontainer {
+	height: 290px;
+	overflow: auto;
+}
+
+/* MSIE Specific styles */
+
+* html .panel_wrapper {
+	width: 100%;
+}
+
+.column {
+	float: left;
+}
+
+h1, h2, h3, h4 {
+	color: #2B6FB6;
+	margin: 0;
+	padding: 0;
+	padding-top: 5px;
+}
+
+h3 {
+	font-size: 14px;
+}
+
+#link .panel_wrapper, #link div.current {
+	height: 125px;
+}
+
+#image .panel_wrapper, #image div.current {
+	height: 190px;
+}
+
+/* Disables the advanced tab in the table plugin. */
+/*
+#table #advanced_tab {
+	display: none;
+}
+*/
+
+/* Disables the border input field and label in the table plugin. */
+/*
+#table #border, #table #borderlabel {
+	display: none;
+}
+*/
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/css/editor_ui.css 75/e107_handlers/tiny_mce/themes/advanced/css/editor_ui.css
--- 6171/e107_handlers/tiny_mce/themes/advanced/css/editor_ui.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/css/editor_ui.css	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,353 @@
+/* This file contains the CSS data for the editor UI of TinyMCE instances */
+
+.mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover {
+	border: 0; margin: 0; padding: 0; background: transparent;
+}
+
+.mceSeparatorLine {
+	border: 0;
+	padding: 0;
+	margin-left: 4px;
+	margin-right: 2px;
+}
+
+.mceSelectList {
+	font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+	font-size: 7pt !important;
+	font-weight: normal;
+	margin-top: 3px;
+	padding: 0;
+	display: inline;
+	vertical-align: top;
+	background-color: #F0F0EE;
+}
+
+.mceLabel, .mceLabelDisabled {
+	font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+	font-size: 9pt;
+}
+
+.mceLabel {
+	color: #000000;
+}
+
+.mceLabelDisabled {
+	cursor: text;
+	color: #999999;
+}
+
+.mceEditor {
+	background: #F0F0EE;
+	border: 1px solid #cccccc;
+	padding: 0;
+	margin: 0;
+}
+
+.mceEditorArea {
+	font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+	background: #FFFFFF;
+	padding: 0;
+	margin: 0;
+}
+
+.mceToolbarTop, .mceToolbarBottom {
+	background: #F0F0EE;
+	line-height: 1px;
+	font-size: 1px;
+}
+
+.mceToolbarTop {
+	border-bottom: 1px solid #cccccc;
+	padding-bottom: 1px;
+}
+
+.mceToolbarBottom {
+	border-top: 1px solid #cccccc;
+}
+
+.mceStatusbarTop, .mceStatusbarBottom, .mceStatusbar {
+	height: 20px;
+}
+
+.mceStatusbarTop .mceStatusbarPathText, .mceStatusbarBottom .mceStatusbarPathText, .mceStatusbar .mceStatusbarPathText {
+	font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+	font-size: 9pt;
+	padding: 2px;
+	line-height: 16px;
+	overflow: visible;
+}
+
+.mceStatusbarTop {
+	border-bottom: 1px solid #cccccc;
+}
+
+.mceStatusbarBottom {
+	border-top: 1px solid #cccccc;
+}
+
+.mceStatusbar {
+	border-bottom: 1px solid #cccccc;
+}
+
+.mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover {
+	text-decoration: none;
+	font-family: 'MS Sans Serif', sans-serif, Verdana, Arial;
+	font-size: 9pt;
+	color: #000000;
+}
+
+.mcePathItem:hover {
+	text-decoration: underline;
+}
+
+.mceStatusbarPathText {
+	float: left;
+}
+
+.mceStatusbarResize {
+	float: right;
+	background-image: url('../images/statusbar_resize.gif');
+	background-repeat: no-repeat;
+	width: 11px;
+	height: 20px;
+	cursor: se-resize;
+}
+
+.mceResizeBox {
+	width: 10px;
+	height: 10px;
+	display: none;
+	border: 1px dotted gray;
+	margin: 0;
+	padding: 0;
+}
+
+.mceEditorIframe {
+	border: 0;
+}
+
+/* Button CSS rules */
+
+a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img {
+	width: 20px;
+	height: 20px;
+	cursor: default;
+	margin-top: 1px;
+	margin-left: 1px;
+}
+
+a.mceButtonDisabled img {
+	border: 0 !important;
+}
+
+a.mceButtonNormal img, a.mceButtonSelected img {
+	border: 1px solid #F0F0EE !important;
+}
+
+a.mceButtonSelected img {
+	border: 1px solid #6779AA !important;
+	background-color: #D4D5D8;
+}
+
+a.mceButtonNormal img:hover, a.mceButtonSelected img:hover {
+	border: 1px solid #0A246A !important;
+	cursor: default;
+	background-color: #B6BDD2;
+}
+
+a.mceButtonDisabled img {
+	-moz-opacity:0.3;
+	opacity: 0.3;
+	border: 1px solid #F0F0EE !important;
+	cursor: default;
+}
+
+a.mceTiledButton img {
+	background-image: url('../images/buttons.gif');
+	background-repeat: no-repeat;
+}
+
+/* MSIE specific rules */
+
+* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img {
+	border: 0 !important;
+	margin-top: 2px;
+	margin-bottom: 1px;
+}
+
+* html a.mceButtonDisabled img {
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+	border: 0 !important;
+}
+
+* html a.mceButtonDisabled {
+	border: 1px solid #F0F0EE !important;
+}
+
+* html a.mceButtonNormal, * html a.mceButtonSelected {
+	border: 1px solid #F0F0EE !important;
+	cursor: default;
+}
+
+* html a.mceButtonSelected {
+	border: 1px solid #6779AA !important;
+	background-color: #D4D5D8;
+}
+
+* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover {
+	border: 1px solid #0A246A !important;
+	cursor: default;
+	background-color: #B6BDD2;
+}
+
+* html .mceSelectList {
+	margin-top: 2px;
+}
+
+/* Menu button CSS rules */
+
+span.mceMenuButton img, span.mceMenuButtonSelected img {
+	border: 1px solid #F0F0EE;
+	margin-left: 1px;
+}
+
+span.mceMenuButtonSelected img {
+	border: 1px solid #6779AA;
+	background-color: #B6BDD2;
+}
+
+span.mceMenuButtonSelected img.mceMenuButton {
+	border: 1px solid #F0F0EE;
+	background-color: transparent;
+}
+
+span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton {
+	border-left: 0;
+	margin-left: 0;
+}
+
+span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img {
+	border: 1px solid #0A246A;
+	background-color: #B6BDD2;
+}
+
+span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton {
+	border-left: 0;
+}
+
+span.mceMenuButtonFocus img {
+	border: 1px solid gray;
+	border-right: 0;
+	margin-left: 1px;
+	background-color: #F5F4F2;
+}
+
+span.mceMenuButtonFocus img.mceMenuButton {
+	border: 1px solid gray;
+	border-left: 1px solid #F5F4F2;
+	margin-left: 0;
+}
+
+/* Menu button MSIE specific rules */
+
+* html span.mceMenuButton, * html span.mceMenuButtonFocus {
+	position: relative;
+	left: 0;
+	top: 0;
+}
+
+* html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img {
+	position: relative;
+	top: 1px;
+}
+
+* html span.mceMenuHover img {
+	border: 1px solid #0A246A;
+	background-color: #B6BDD2;
+}
+
+* html span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton {
+	border: 1px solid #0A246A;
+	background-color: #B6BDD2;
+	border-left: 0;
+}
+
+/* Menu */
+
+.mceMenu {
+	position: absolute;
+	left: 0;
+	top: 0;
+	display: none;
+	z-index: 100;
+	background-color: white;
+	border: 1px solid gray;
+	font-weight: normal;
+}
+
+.mceMenu a, .mceMenuTitle, .mceMenuDisabled {
+	display: block;
+	width: 100%;
+	text-decoration: none;
+	background-color: white;
+	font-family: Tahoma, Verdana, Arial, Helvetica;
+	font-size: 11px;
+	line-height: 20px;
+	color: black;
+}
+
+.mceMenu a:hover {
+	background-color: #B6BDD2;
+	color: black;
+	text-decoration: none !important;
+}
+
+.mceMenu span {
+	padding-left: 10px;
+	padding-right: 10px;
+	display: block;
+	line-height: 20px;
+}
+
+.mceMenuSeparator {
+	border-bottom: 1px solid gray;
+	background-color: gray;
+	height: 1px;
+}
+
+.mceMenuTitle span {
+	padding-left: 5px;
+}
+
+.mceMenuTitle {
+	background-color: #DDDDDD;
+	font-weight: bold;
+}
+
+.mceMenuDisabled {
+	color: gray;
+}
+
+span.mceMenuSelectedItem {
+	background-image: url('../images/menu_check.gif');
+	background-repeat: no-repeat;
+	background-position: 5px 8px;
+	padding-left: 20px;
+}
+
+span.mceMenuCheckItem {
+	padding-left: 20px;
+}
+
+span.mceMenuLine {
+	display: block;
+	position: absolute;
+	left: 0;
+	top: -1px;
+	background-color: #F5F4F2;
+	width: 30px;
+	height: 1px;
+	overflow: hidden;
+	padding-left: 0;
+	padding-right: 0;
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/editor_content.css 75/e107_handlers/tiny_mce/themes/advanced/editor_content.css
--- 6171/e107_handlers/tiny_mce/themes/advanced/editor_content.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/editor_content.css	2005-05-28 07:05:27.000000000 -0500
@@ -0,0 +1,27 @@
+body {
+	background-color: #FFFFFF;
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+	scrollbar-3dlight-color: #F0F0EE;
+	scrollbar-arrow-color: #676662;
+	scrollbar-base-color: #F0F0EE;
+	scrollbar-darkshadow-color: #DDDDDD;
+	scrollbar-face-color: #E0E0DD;
+	scrollbar-highlight-color: #F0F0EE;
+	scrollbar-shadow-color: #F0F0EE;
+	scrollbar-track-color: #F5F5F5;
+}
+
+td {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+pre {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+.mceVisualAid {
+	border: 1px dashed #BBBBBB;
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/editor_popup.css 75/e107_handlers/tiny_mce/themes/advanced/editor_popup.css
--- 6171/e107_handlers/tiny_mce/themes/advanced/editor_popup.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/editor_popup.css	2005-05-28 07:05:27.000000000 -0500
@@ -0,0 +1,121 @@
+body {
+	background-color: #F0F0EE;
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 11px;
+	scrollbar-3dlight-color: #F0F0EE;
+	scrollbar-arrow-color: #676662;
+	scrollbar-base-color: #F0F0EE;
+	scrollbar-darkshadow-color: #DDDDDD;
+	scrollbar-face-color: #E0E0DD;
+	scrollbar-highlight-color: #F0F0EE;
+	scrollbar-shadow-color: #F0F0EE;
+	scrollbar-track-color: #F5F5F5;
+}
+
+td {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 11px;
+}
+
+input {
+	background: #FFFFFF;
+	border: 1px solid #cccccc;
+}
+
+td, input, select, textarea {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+input, select, textarea {
+	border: 1px solid #808080;
+}
+
+.input_noborder {
+	border: 0px solid #808080;
+}
+
+#insert {
+   font-weight: bold;
+}
+
+#cancel {
+   font-weight: bold;
+}
+
+.title {
+	font-size: 12px;
+	font-weight: bold;
+}
+
+table.charmap {
+	border-style: solid;
+	border-width: 1px;
+	border-color: #AAAAAA;
+}
+
+td.charmap, td.charmapOver {
+	color: #000000;
+	border-color: #AAAAAA;
+	border-style: solid;
+	border-width: 1px;
+	text-align: center;
+	font-size: 12px;
+}
+
+td.charmapOver {
+	background-color: #CCCCCC;
+	cursor: arrow;
+}
+
+a.charmap {
+	color: #000000;
+	text-decoration: none
+}
+
+.wordWrapCode {
+	vertical-align: middle;
+	border: 1px none #000000;
+	background-color: transparent;
+}
+
+input.radio {
+	border: 1px none #000000;
+	background-color: transparent;
+	vertical-align: middle;
+}
+
+input.checkbox {
+	border: 1px none #000000;
+	background-color: transparent;
+	vertical-align: middle;
+}
+
+.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected {
+	margin-left: 1px;
+}
+
+.mceButtonNormal {
+	border-top: 1px solid;
+	border-left: 1px solid;
+	border-bottom: 1px solid;
+	border-right: 1px solid;
+	border-color: #F0F0EE;
+	cursor: arrow;
+}
+
+.mceButtonOver {
+	border: 1px solid #0A246A;
+	cursor: arrow;
+	background-color: #B6BDD2;
+}
+
+.mceButtonDown {
+	cursor: arrow;
+	border: 1px solid #0A246A;
+	background-color: #8592B5;
+}
+
+legend {
+	font-weight: bold;
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/editor_template.js 75/e107_handlers/tiny_mce/themes/advanced/editor_template.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/editor_template.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/editor_template.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1 @@
+tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_AdvancedTheme={_autoImportCSSClasses:true,_resizer:{},_buttons:[['bold','{$lang_bold_img}','lang_bold_desc','Bold'],['italic','{$lang_italic_img}','lang_italic_desc','Italic'],['underline','{$lang_underline_img}','lang_underline_desc','Underline'],['strikethrough','strikethrough.gif','lang_striketrough_desc','Strikethrough'],['justifyleft','justifyleft.gif','lang_justifyleft_desc','JustifyLeft'],['justifycenter','justifycenter.gif','lang_justifycenter_desc','JustifyCenter'],['justifyright','justifyright.gif','lang_justifyright_desc','JustifyRight'],['justifyfull','justifyfull.gif','lang_justifyfull_desc','JustifyFull'],['bullist','bullist.gif','lang_bullist_desc','InsertUnorderedList'],['numlist','numlist.gif','lang_numlist_desc','InsertOrderedList'],['outdent','outdent.gif','lang_outdent_desc','Outdent'],['indent','indent.gif','lang_indent_desc','Indent'],['cut','cut.gif','lang_cut_desc','Cut'],['copy','copy.gif','lang_copy_desc','Copy'],['paste','paste.gif','lang_paste_desc','Paste'],['undo','undo.gif','lang_undo_desc','Undo'],['redo','redo.gif','lang_redo_desc','Redo'],['link','link.gif','lang_link_desc','mceLink',true],['unlink','unlink.gif','lang_unlink_desc','unlink'],['image','image.gif','lang_image_desc','mceImage',true],['cleanup','cleanup.gif','lang_cleanup_desc','mceCleanup'],['help','help.gif','lang_help_desc','mceHelp'],['code','code.gif','lang_theme_code_desc','mceCodeEditor'],['hr','hr.gif','lang_theme_hr_desc','inserthorizontalrule'],['removeformat','removeformat.gif','lang_theme_removeformat_desc','removeformat'],['sub','sub.gif','lang_theme_sub_desc','subscript'],['sup','sup.gif','lang_theme_sup_desc','superscript'],['forecolor','forecolor.gif','lang_theme_forecolor_desc','mceForeColor',true],['backcolor','backcolor.gif','lang_theme_backcolor_desc','mceBackColor',true],['charmap','charmap.gif','lang_theme_charmap_desc','mceCharMap'],['visualaid','visualaid.gif','lang_theme_visualaid_desc','mceToggleVisualAid'],['anchor','anchor.gif','lang_theme_anchor_desc','mceInsertAnchor'],['newdocument','newdocument.gif','lang_newdocument_desc','mceNewDocument']],_buttonMap:'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells',getControlHTML:function(button_name){var i,x;for(i=0;i<TinyMCE_AdvancedTheme._buttons.length;i++){var but=TinyMCE_AdvancedTheme._buttons[i];if(but[0]==button_name)return tinyMCE.getButtonHTML(but[0],but[2],'{$themeurl}/images/'+but[1],but[3],(but.length>4?but[4]:false),(but.length>5?but[5]:null));}switch(button_name){case"formatselect":var html='<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}'],['div','{$lang_theme_div}'],['blockquote','{$lang_theme_blockquote}'],['code','{$lang_theme_code}'],['dt','{$lang_theme_dt}'],['dd','{$lang_theme_dd}'],['samp','{$lang_theme_samp}']];html+='<option value="">{$lang_theme_block}</option>';for(var i=0;i<formats.length;i++){for(var x=0;x<lookup.length;x++){if(formats[i]==lookup[x][0])html+='<option value="&lt;'+lookup[x][0]+'&gt;">'+lookup[x][1]+'</option>';}}html+='</select>';return html;case"styleselect":return'<select id="{$editor_id}_styleSelect" onmousedown="tinyMCE.themes.advanced._setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event,this,window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';case"fontselect":var fontHTML='<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';var iFonts='Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';var nFonts='Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';var fonts=tinyMCE.getParam("theme_advanced_fonts",nFonts).split(';');for(i=0;i<fonts.length;i++){if(fonts[i]!=''){var parts=fonts[i].split('=');fontHTML+='<option value="'+parts[1]+'">'+parts[0]+'</option>';}}fontHTML+='</select>';return fontHTML;case"fontsizeselect":return'<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+'<option value="0">{$lang_theme_font_size}</option>'+'<option value="1">1 (8 pt)</option>'+'<option value="2">2 (10 pt)</option>'+'<option value="3">3 (12 pt)</option>'+'<option value="4">4 (14 pt)</option>'+'<option value="5">5 (18 pt)</option>'+'<option value="6">6 (24 pt)</option>'+'<option value="7">7 (36 pt)</option>'+'</select>';case"|":case"separator":return'<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';case"spacer":return'<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" />';case"rowseparator":return'<br />';}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceLink":var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text;}else selectedText=inst.getSel().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return true;}var href="",target="",title="",onclick="",action="insert",style_class="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement!=null&&tinyMCE.getAttrib(tinyMCE.linkElement,'href')=="")tinyMCE.linkElement=null;if(tinyMCE.linkElement){href=tinyMCE.getAttrib(tinyMCE.linkElement,'href');target=tinyMCE.getAttrib(tinyMCE.linkElement,'target');title=tinyMCE.getAttrib(tinyMCE.linkElement,'title');onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');style_class=tinyMCE.getAttrib(tinyMCE.linkElement,'class');if(onclick=="")onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');onclick=tinyMCE.cleanupEventStr(onclick);href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");mceRealHref=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_href');if(mceRealHref!=""){href=mceRealHref;if(tinyMCE.getParam('convert_urls'))href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");}action="update";}var template=new Array();template['file']='link.htm';template['width']=310;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);if(inst.settings['insertlink_callback']){var returnVal=eval(inst.settings['insertlink_callback']+"(href, target, title, onclick, action, style_class);");if(returnVal&&returnVal['href'])TinyMCE_AdvancedTheme._insertLink(returnVal['href'],returnVal['target'],returnVal['title'],returnVal['onclick'],returnVal['style_class']);}else{tinyMCE.openWindow(template,{href:href,target:target,title:title,onclick:onclick,action:action,className:style_class,inline:"yes"});}return true;case"mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";var title="",onmouseover="",onmouseout="",action="insert";var img=tinyMCE.imgElement;var inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){img=tinyMCE.selectedElement;tinyMCE.imgElement=img;}if(img){if(tinyMCE.getAttrib(img,'name').indexOf('mce_')==0)return true;src=tinyMCE.getAttrib(img,'src');alt=tinyMCE.getAttrib(img,'alt');if(alt=="")alt=tinyMCE.getAttrib(img,'title');if(tinyMCE.isGecko){var w=img.style.width;if(w!=null&&w!="")img.setAttribute("width",w);var h=img.style.height;if(h!=null&&h!="")img.setAttribute("height",h);}border=tinyMCE.getAttrib(img,'border');hspace=tinyMCE.getAttrib(img,'hspace');vspace=tinyMCE.getAttrib(img,'vspace');width=tinyMCE.getAttrib(img,'width');height=tinyMCE.getAttrib(img,'height');align=tinyMCE.getAttrib(img,'align');onmouseover=tinyMCE.getAttrib(img,'onmouseover');onmouseout=tinyMCE.getAttrib(img,'onmouseout');title=tinyMCE.getAttrib(img,'title');if(tinyMCE.isMSIE){width=img.attributes['width'].specified?width:"";height=img.attributes['height'].specified?height:"";}src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");mceRealSrc=tinyMCE.getAttrib(img,'mce_src');if(mceRealSrc!=""){src=mceRealSrc;if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");}action="update";}var template=new Array();template['file']='image.htm?src={$src}';template['width']=355;template['height']=265+(tinyMCE.isMSIE?25:0);template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);if(inst.settings['insertimage_callback']){var returnVal=eval(inst.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");if(returnVal&&returnVal['src'])TinyMCE_AdvancedTheme._insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align'],returnVal['title'],returnVal['onmouseover'],returnVal['onmouseout']);}else tinyMCE.openWindow(template,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout,action:action,inline:"yes"});return true;case"mceForeColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=tinyMCE.getAttrib(elm,"color");if(inputColor=='')inputColor=elm.style.color;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"forecolor",input_color:inputColor});return true;case"mceBackColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=elm.style.backgroundColor;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;template['width']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"HiliteColor",input_color:inputColor});return true;case"mceColorPicker":if(user_interface){var template=new Array();var inputColor=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=220;template['height']=190;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:inputColor});}else{var savedVal=tinyMCE.lastColorPickerValue;var elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;if(elm.onchange!=null&&elm.onchange!='')eval('elm.onchange();');}return true;case"mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",720));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",580));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case"mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceNewDocument":if(confirm(tinyMCE.getLang('lang_newdocument')))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,' ');return true;}return false;},getEditorTemplate:function(settings,editorId){function removeFromArray(in_array,remove_array){var outArray=new Array();for(var i=0;i<in_array.length;i++){skip=false;for(var j=0;j<remove_array.length;j++){if(in_array[i]==remove_array[j]){skip=true;}}if(!skip){outArray[outArray.length]=in_array[i];}}return outArray;}function addToArray(in_array,add_array){for(var i=0;i<add_array.length;i++){in_array[in_array.length]=add_array[i];}return in_array;}var template=new Array();var deltaHeight=0;var resizing=tinyMCE.getParam("theme_advanced_resizing",false);var path=tinyMCE.getParam("theme_advanced_path",true);var statusbarHTML='<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: '+(path?"block":"none")+'">&#160;</div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: '+(resizing?"block":"none")+'" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='<option value="">{$lang_theme_style_select}</option>';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i<stylesAr.length;i++){var key,value;key=stylesAr[i].split('=')[0];value=stylesAr[i].split('=')[1];styleSelectHTML+='<option value="'+value+'">'+key+'</option>';}TinyMCE_AdvancedTheme._autoImportCSSClasses=false;}switch(layoutManager){case"SimpleLayout":var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var toolbarAlign=tinyMCE.getParam("theme_advanced_toolbar_align","center");var pathLocation=tinyMCE.getParam("theme_advanced_path_location","none");var statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};toolbarHTML+='<a href="#" accesskey="q" title="'+tinyMCE.getLang("lang_toolbar_focus")+'"';if(!tinyMCE.getParam("accessibility_focus"))toolbarHTML+=' onfocus="tinyMCE.getInstanceById(\''+editorId+'\').getWin().focus();"';toolbarHTML+='></a>';for(var i=1;i<100;i++){var def=defVals["theme_advanced_buttons"+i];var buttons=tinyMCE.getParam("theme_advanced_buttons"+i,def==null?'':def,true,',');if(buttons.length==0)break;buttons=removeFromArray(buttons,tinyMCE.getParam("theme_advanced_disable","",true,','));buttons=addToArray(buttons,tinyMCE.getParam("theme_advanced_buttons"+i+"_add","",true,','));buttons=addToArray(tinyMCE.getParam("theme_advanced_buttons"+i+"_add_before","",true,','),buttons);for(var b=0;b<buttons.length;b++)toolbarHTML+=tinyMCE.getControlHTML(buttons[b]);if(buttons.length>0){toolbarHTML+="<br />";deltaHeight-=23;}}toolbarHTML+='<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\''+editorId+'\').getWin().focus();"></a>';template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';if(toolbarLocation=="top"){template['html']+='<tr><td class="mceToolbarTop" align="'+toolbarAlign+'" height="1" nowrap="nowrap">'+toolbarHTML+'</td></tr>';}if(statusbarLocation=="top"){template['html']+='<tr><td class="mceStatusbarTop" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23;}template['html']+='<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';if(toolbarLocation=="bottom"){template['html']+='<tr><td class="mceToolbarBottom" align="'+toolbarAlign+'" height="1">'+toolbarHTML+'</td></tr>';}if(toolbarLocation=="external"){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.applyTemplate(toolbarHTML,{editor_id:editorId});elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='<table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table>';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null;}if(statusbarLocation=="bottom"){template['html']+='<tr><td class="mceStatusbarBottom" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23;}template['html']+='</tbody></table>';break;case"RowLayout":template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';var containers=tinyMCE.getParam("theme_advanced_containers","",true,",");var defaultContainerCSS=tinyMCE.getParam("theme_advanced_containers_default_class","container");var defaultContainerAlign=tinyMCE.getParam("theme_advanced_containers_default_align","center");for(var i=0;i<containers.length;i++){if(containers[i]=="mceEditor")template['html']+='<tr><td align="center" class="mceEditor_border"><span id="{$editor_id}"></span></td></tr>';else if(containers[i]=="mceElementpath"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom";}else if(i==0){pathClass="mceStatusbar";}else{deltaHeight-=2;}template['html']+='<tr><td class="'+pathClass+'" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=22;}else{var curContainer=tinyMCE.getParam("theme_advanced_container_"+containers[i],"",true,',');var curContainerHTML="";var curAlign=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align",defaultContainerAlign);var curCSS=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class",defaultContainerCSS);for(var j=0;j<curContainer.length;j++){curContainerHTML+=tinyMCE.getControlHTML(curContainer[j]);}if(curContainer.length>0){curContainerHTML+="<br />";deltaHeight-=23;}template['html']+='<tr><td class="'+curCSS+'" align="'+curAlign+'" height="1">'+curContainerHTML+'</td></tr>';}}template['html']+='</tbody></table>';break;case"CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);");}break;}if(resizing)template['html']+='<span id="{$editor_id}_resize_box" class="mceResizeBox"></span>';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=deltaHeight;return template;},initInstance:function(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_AdvancedTheme._resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true));}}inst.addShortcut('ctrl','k','lang_link_desc','mceLink');},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection,setup_content){function selectByValue(select_elm,value,first_index){first_index=typeof(first_index)=="undefined"?false:true;if(select_elm){for(var i=0;i<select_elm.options.length;i++){var ov=""+select_elm.options[i].value;if(first_index&&ov.toLowerCase().indexOf(value.toLowerCase())==0){select_elm.selectedIndex=i;return true;}if(ov==value){select_elm.selectedIndex=i;return true;}}}return false;};function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";};if(node==null)return;var pathElm=document.getElementById(editor_id+"_path");var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();if(pathElm){var parentNode=node;var path=new Array();while(parentNode!=null){if(parentNode.nodeName.toUpperCase()=="BODY"){break;}if(parentNode.nodeType==1&&tinyMCE.getAttrib(parentNode,"class").indexOf('mceItemHidden')==-1){path[path.length]=parentNode;}parentNode=parentNode.parentNode;}var html="";for(var i=path.length-1;i>=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName=="b"){nodeName="strong";}if(nodeName=="i"){nodeName="em";}if(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+st+" ";}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+face+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="size: "+size+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+color+" ";}if(getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" ";}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(getAttrib(path[i],'src')!=""){var src=tinyMCE.getAttrib(path[i],"mce_src");if(src=="")src=tinyMCE.getAttrib(path[i],"src");nodeData+="src: "+src+" ";}if(getAttrib(path[i],'href')!=""){var href=tinyMCE.getAttrib(path[i],"mce_href");if(href=="")href=tinyMCE.getAttrib(path[i],"href");nodeData+="href: "+href+" ";}if(nodeName=="img"&&tinyMCE.getAttrib(path[i],"class").indexOf('mceItemFlash')!=-1){nodeName="flash";nodeData="src: "+path[i].getAttribute('title');}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+anchor;nodeData="";}if(getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className;}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+='<a title="'+nodeData+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" target="_self" class="mcePathItem">'+nodeName+'</a>';if(i>0){html+=" &raquo; ";}}pathElm.innerHTML='<a href="#" accesskey="x"></a>'+tinyMCE.getLang('lang_theme_path')+": "+html+'&#160;';}tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClass(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClass(editor_id+'_link','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_unlink','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_outdent','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_image','mceButtonNormal');tinyMCE.switchClass(editor_id+'_hr','mceButtonNormal');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)tinyMCE.switchClass(editor_id+'_anchor','mceButtonSelected');var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClass(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal');tinyMCE.switchClass(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal');}tinyMCE.switchClass(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal');if(undo_levels!=-1){tinyMCE.switchClass(editor_id+'_undo','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_redo','mceButtonDisabled');}if(tinyMCE.getParentElement(node,"li,blockquote"))tinyMCE.switchClass(editor_id+'_outdent','mceButtonNormal');if(undo_index!=-1&&(undo_index<undo_levels-1&&undo_levels>0))tinyMCE.switchClass(editor_id+'_redo','mceButtonNormal');if(undo_index!=-1&&(undo_index>0&&undo_levels>0))tinyMCE.switchClass(editor_id+'_undo','mceButtonNormal');var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);classNode=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i<selectElm.options.length;i++){if(selectElm.options[i].value==classNode.className){index=i;breakOut=true;break;}}}}while(!breakOut&&classNode!=null&&(classNode=classNode.parentNode)!=null);selectElm.selectedIndex=index;}var selectElm=document.getElementById(editor_id+"_formatSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"p,div,h1,h2,h3,h4,h5,h6,pre,address");if(elm)selectByValue(selectElm,"<"+elm.nodeName.toLowerCase()+">");else selectByValue(selectElm,"");}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=inst.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="");}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(selectElm,family,family!=""))selectByValue(selectElm,"");}else selectByValue(selectElm,"");}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=inst.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size);}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i<sizes.length;i++){if((''+sizes[i])==size){size=i;break;}}}if(!selectByValue(selectElm,size))selectByValue(selectElm,"");}else selectByValue(selectElm,"0");}}alignNode=node;breakOut=false;do{if(!alignNode.getAttribute||!alignNode.getAttribute('align'))continue;switch(alignNode.getAttribute('align').toLowerCase()){case"left":tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonSelected');breakOut=true;break;case"right":tinyMCE.switchClass(editor_id+'_justifyright','mceButtonSelected');breakOut=true;break;case"middle":case"center":tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonSelected');breakOut=true;break;case"justify":tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonSelected');breakOut=true;break;}}while(!breakOut&&(alignNode=alignNode.parentNode)!=null);var div=tinyMCE.getParentElement(node,"div");if(div&&div.style.textAlign=="center")tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonSelected');if(!setup_content){var ar=new Array("Bold","_bold","Italic","_italic","Strikethrough","_strikethrough","superscript","_sup","subscript","_sub");for(var i=0;i<ar.length;i+=2){if(inst.queryCommandState(ar[i]))tinyMCE.switchClass(editor_id+ar[i+1],'mceButtonSelected');}if(inst.queryCommandState("Underline")&&(node.parentNode==null||node.parentNode.nodeName!="A"))tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected');}do{switch(node.nodeName){case"UL":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"OL":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break;case"HR":tinyMCE.switchClass(editor_id+'_hr','mceButtonSelected');break;case"IMG":if(getAttrib(node,'name').indexOf('mce_')!=0){tinyMCE.switchClass(editor_id+'_image','mceButtonSelected');}break;}}while((node=node.parentNode)!=null);},_setupCSSClasses:function(editor_id){var i,selectElm;if(!TinyMCE_AdvancedTheme._autoImportCSSClasses)return;selectElm=document.getElementById(editor_id+'_styleSelect');if(selectElm&&selectElm.getAttribute('cssImported')!='true'){var csses=tinyMCE.getCSSClasses(editor_id);if(csses&&selectElm){for(i=0;i<csses.length;i++)selectElm.options[selectElm.options.length]=new Option(csses[i],csses[i]);}if(csses!=null&&csses.length>0)selectElm.setAttribute('cssImported','true');}},_setCookie:function(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie;},_getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end));},_resizeTo:function(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0;}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2;}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;w=w<1?30:w;h=h<1?30:h;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;iw=iw<1?30:iw;ih=ih<1?30:ih;if(tinyMCE.isGecko){iw-=2;ih-=2;}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth<minIframeWidth){dx=minIframeWidth-inst.iframeElement.clientWidth;inst.iframeElement.style.width=(iw+dx)+"px";}}},_resizeEventHandler:function(e){var resizer=TinyMCE_AdvancedTheme._resizer;if(!resizer.resizing)return;e=typeof(e)=="undefined"?window.event:e;var dx=e.screenX-resizer.downX;var dy=e.screenY-resizer.downY;var resizeBox=resizer.resizeBox;var editorId=resizer.editorId;switch(e.type){case"mousemove":var w,h;w=resizer.width+dx;h=resizer.height+dy;w=w<1?1:w;h=h<1?1:h;if(resizer.horizontal)resizeBox.style.width=w+"px";resizeBox.style.height=h+"px";break;case"mouseup":TinyMCE_AdvancedTheme._setResizing(e,editorId,false);TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId),resizer.width+dx,resizer.height+dy,resizer.horizontal);if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var expires=new Date();expires.setTime(expires.getTime()+3600000*24*30);TinyMCE_AdvancedTheme._setCookie("TinyMCE_"+editorId+"_width",""+(resizer.horizontal?resizer.width+dx:""),expires);TinyMCE_AdvancedTheme._setCookie("TinyMCE_"+editorId+"_height",""+(resizer.height+dy),expires);}break;}},_setResizing:function(e,editor_id,state){e=typeof(e)=="undefined"?window.event:e;var resizer=TinyMCE_AdvancedTheme._resizer;var editorContainer=document.getElementById(editor_id+'_parent');var editorArea=document.getElementById(editor_id+'_parent').firstChild;var resizeBox=document.getElementById(editor_id+'_resize_box');var inst=tinyMCE.getInstanceById(editor_id);if(state){var width=editorArea.clientWidth;var height=editorArea.clientHeight;resizeBox.style.width=width+"px";resizeBox.style.height=height+"px";resizer.iframeWidth=inst.iframeElement.clientWidth;resizer.iframeHeight=inst.iframeElement.clientHeight;editorArea.style.display="none";resizeBox.style.display="block";if(!resizer.eventHandlers){if(tinyMCE.isMSIE)tinyMCE.addEvent(document,"mousemove",TinyMCE_AdvancedTheme._resizeEventHandler);else tinyMCE.addEvent(window,"mousemove",TinyMCE_AdvancedTheme._resizeEventHandler);tinyMCE.addEvent(document,"mouseup",TinyMCE_AdvancedTheme._resizeEventHandler);resizer.eventHandlers=true;}resizer.resizing=true;resizer.downX=e.screenX;resizer.downY=e.screenY;resizer.width=parseInt(resizeBox.style.width);resizer.height=parseInt(resizeBox.style.height);resizer.editorId=editor_id;resizer.resizeBox=resizeBox;resizer.horizontal=tinyMCE.getParam("theme_advanced_resize_horizontal",true);}else{resizer.resizing=false;resizeBox.style.display="none";editorArea.style.display=tinyMCE.isMSIE&&!tinyMCE.isOpera?"block":"table";tinyMCE.execCommand('mceResetDesignMode');}},_insertImage:function(src,alt,border,hspace,vspace,width,height,align,title,onmouseover,onmouseout){tinyMCE.execCommand('mceBeginUndoLevel');if(src=="")return;if(!tinyMCE.imgElement&&tinyMCE.isSafari){var html="";html+='<img src="'+src+'" alt="'+alt+'"';html+=' border="'+border+'" hspace="'+hspace+'"';html+=' vspace="'+vspace+'" width="'+width+'"';html+=' height="'+height+'" align="'+align+'" title="'+title+'" onmouseover="'+onmouseover+'" onmouseout="'+onmouseout+'" />';tinyMCE.execCommand("mceInsertContent",false,html);}else{if(!tinyMCE.imgElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari)tinyMCE.execCommand("mceInsertContent",false,'<img src="'+tinyMCE.uniqueURL+'" />');else tinyMCE.selectedInstance.contentDocument.execCommand("insertimage",false,tinyMCE.uniqueURL);tinyMCE.imgElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"img","src",tinyMCE.uniqueURL);}}if(tinyMCE.imgElement){var needsRepaint=false;var msrc=src;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, tinyMCE.imgElement);");if(tinyMCE.getParam('convert_urls'))msrc=src;if(onmouseover&&onmouseover!="")onmouseover="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseover, tinyMCE.imgElement);")+"';";if(onmouseout&&onmouseout!="")onmouseout="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseout, tinyMCE.imgElement);")+"';";if(typeof(title)=="undefined")title=alt;if(width!=tinyMCE.imgElement.getAttribute("width")||height!=tinyMCE.imgElement.getAttribute("height")||align!=tinyMCE.imgElement.getAttribute("align"))needsRepaint=true;tinyMCE.setAttrib(tinyMCE.imgElement,'src',src);tinyMCE.setAttrib(tinyMCE.imgElement,'mce_src',msrc);tinyMCE.setAttrib(tinyMCE.imgElement,'alt',alt);tinyMCE.setAttrib(tinyMCE.imgElement,'title',title);tinyMCE.setAttrib(tinyMCE.imgElement,'align',align);tinyMCE.setAttrib(tinyMCE.imgElement,'border',border,true);tinyMCE.setAttrib(tinyMCE.imgElement,'hspace',hspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'vspace',vspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'width',width,true);tinyMCE.setAttrib(tinyMCE.imgElement,'height',height,true);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseover',onmouseover);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseout',onmouseout);if(width&&width!="")tinyMCE.imgElement.style.pixelWidth=width;if(height&&height!="")tinyMCE.imgElement.style.pixelHeight=height;if(needsRepaint)tinyMCE.selectedInstance.repaint();}tinyMCE.execCommand('mceEndUndoLevel');},_insertLink:function(href,target,title,onclick,style_class){tinyMCE.execCommand('mceBeginUndoLevel');if(tinyMCE.selectedInstance&&tinyMCE.selectedElement&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){var doc=tinyMCE.selectedInstance.getDoc();var linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");var newLink=false;if(!linkElement){linkElement=doc.createElement("a");newLink=true;}var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(linkElement,'href',thref);tinyMCE.setAttrib(linkElement,'mce_href',mhref);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',title);tinyMCE.setAttrib(linkElement,'onclick',onclick);tinyMCE.setAttrib(linkElement,'class',style_class);if(newLink){linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));tinyMCE.selectedElement.parentNode.replaceChild(linkElement,tinyMCE.selectedElement);}return;}if(!tinyMCE.linkElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari){tinyMCE.execCommand("mceInsertContent",false,'<a href="'+tinyMCE.uniqueURL+'">'+tinyMCE.selectedInstance.selection.getSelectedHTML()+'</a>');}else tinyMCE.selectedInstance.contentDocument.execCommand("createlink",false,tinyMCE.uniqueURL);tinyMCE.linkElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);var elementArray=tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);for(var i=0;i<elementArray.length;i++){var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, elementArray[i]);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(elementArray[i],'href',thref);tinyMCE.setAttrib(elementArray[i],'mce_href',mhref);tinyMCE.setAttrib(elementArray[i],'target',target);tinyMCE.setAttrib(elementArray[i],'title',title);tinyMCE.setAttrib(elementArray[i],'onclick',onclick);tinyMCE.setAttrib(elementArray[i],'class',style_class);}tinyMCE.linkElement=elementArray[0];}if(tinyMCE.linkElement){var mhref=href;href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(tinyMCE.linkElement,'href',href);tinyMCE.setAttrib(tinyMCE.linkElement,'mce_href',mhref);tinyMCE.setAttrib(tinyMCE.linkElement,'target',target);tinyMCE.setAttrib(tinyMCE.linkElement,'title',title);tinyMCE.setAttrib(tinyMCE.linkElement,'onclick',onclick);tinyMCE.setAttrib(tinyMCE.linkElement,'class',style_class);}tinyMCE.execCommand('mceEndUndoLevel');}};tinyMCE.addTheme("advanced",TinyMCE_AdvancedTheme);tinyMCE.addButtonMap(TinyMCE_AdvancedTheme._buttonMap);
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/editor_template_src.js 75/e107_handlers/tiny_mce/themes/advanced/editor_template_src.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/editor_template_src.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/editor_template_src.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,1411 @@
+/**
+ * $RCSfile: editor_template_src.js,v $
+ * $Revision: 1.12 $
+ * $Date: 2006/05/06 03:05:15 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import theme specific language pack */
+tinyMCE.importThemeLanguagePack('advanced');
+
+var TinyMCE_AdvancedTheme = {
+	// Private theme fields
+	_autoImportCSSClasses : true,
+	_resizer : {},
+	_buttons : [
+		// Control id, button img, button title, command, user_interface, value
+		['bold', '{$lang_bold_img}', 'lang_bold_desc', 'Bold'],
+		['italic', '{$lang_italic_img}', 'lang_italic_desc', 'Italic'],
+		['underline', '{$lang_underline_img}', 'lang_underline_desc', 'Underline'],
+		['strikethrough', 'strikethrough.gif', 'lang_striketrough_desc', 'Strikethrough'],
+		['justifyleft', 'justifyleft.gif', 'lang_justifyleft_desc', 'JustifyLeft'],
+		['justifycenter', 'justifycenter.gif', 'lang_justifycenter_desc', 'JustifyCenter'],
+		['justifyright', 'justifyright.gif', 'lang_justifyright_desc', 'JustifyRight'],
+		['justifyfull', 'justifyfull.gif', 'lang_justifyfull_desc', 'JustifyFull'],
+		['bullist', 'bullist.gif', 'lang_bullist_desc', 'InsertUnorderedList'],
+		['numlist', 'numlist.gif', 'lang_numlist_desc', 'InsertOrderedList'],
+		['outdent', 'outdent.gif', 'lang_outdent_desc', 'Outdent'],
+		['indent', 'indent.gif', 'lang_indent_desc', 'Indent'],
+		['cut', 'cut.gif', 'lang_cut_desc', 'Cut'],
+		['copy', 'copy.gif', 'lang_copy_desc', 'Copy'],
+		['paste', 'paste.gif', 'lang_paste_desc', 'Paste'],
+		['undo', 'undo.gif', 'lang_undo_desc', 'Undo'],
+		['redo', 'redo.gif', 'lang_redo_desc', 'Redo'],
+		['link', 'link.gif', 'lang_link_desc', 'mceLink', true],
+		['unlink', 'unlink.gif', 'lang_unlink_desc', 'unlink'],
+		['image', 'image.gif', 'lang_image_desc', 'mceImage', true],
+		['cleanup', 'cleanup.gif', 'lang_cleanup_desc', 'mceCleanup'],
+		['help', 'help.gif', 'lang_help_desc', 'mceHelp'],
+		['code', 'code.gif', 'lang_theme_code_desc', 'mceCodeEditor'],
+		['hr', 'hr.gif', 'lang_theme_hr_desc', 'inserthorizontalrule'],
+		['removeformat', 'removeformat.gif', 'lang_theme_removeformat_desc', 'removeformat'],
+		['sub', 'sub.gif', 'lang_theme_sub_desc', 'subscript'],
+		['sup', 'sup.gif', 'lang_theme_sup_desc', 'superscript'],
+		['forecolor', 'forecolor.gif', 'lang_theme_forecolor_desc', 'mceForeColor', true],
+		['backcolor', 'backcolor.gif', 'lang_theme_backcolor_desc', 'mceBackColor', true],
+		['charmap', 'charmap.gif', 'lang_theme_charmap_desc', 'mceCharMap'],
+		['visualaid', 'visualaid.gif', 'lang_theme_visualaid_desc', 'mceToggleVisualAid'],
+		['anchor', 'anchor.gif', 'lang_theme_anchor_desc', 'mceInsertAnchor'],
+		['newdocument', 'newdocument.gif', 'lang_newdocument_desc', 'mceNewDocument']
+	],
+
+	_buttonMap : 'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells',
+
+	/**
+	 * Returns HTML code for the specificed control.
+	 */
+	getControlHTML : function(button_name) {
+		var i, x;
+
+		// Lookup button in button list
+		for (i=0; i<TinyMCE_AdvancedTheme._buttons.length; i++) {
+			var but = TinyMCE_AdvancedTheme._buttons[i];
+
+			if (but[0] == button_name)
+				return tinyMCE.getButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null));
+		}
+
+		// Custom controlls other than buttons
+		switch (button_name) {
+			case "formatselect":
+				var html = '<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';
+				var formats = tinyMCE.getParam("theme_advanced_blockformats", "p,address,pre,h1,h2,h3,h4,h5,h6", true).split(',');
+				var lookup = [
+					['p', '{$lang_theme_paragraph}'],
+					['address', '{$lang_theme_address}'],
+					['pre', '{$lang_theme_pre}'],
+					['h1', '{$lang_theme_h1}'],
+					['h2', '{$lang_theme_h2}'],
+					['h3', '{$lang_theme_h3}'],
+					['h4', '{$lang_theme_h4}'],
+					['h5', '{$lang_theme_h5}'],
+					['h6', '{$lang_theme_h6}'],
+					['div', '{$lang_theme_div}'],
+					['blockquote', '{$lang_theme_blockquote}'],
+					['code', '{$lang_theme_code}'],
+					['dt', '{$lang_theme_dt}'],
+					['dd', '{$lang_theme_dd}'],
+					['samp', '{$lang_theme_samp}']
+				];
+
+				html += '<option value="">{$lang_theme_block}</option>';
+
+				// Build format select
+				for (var i=0; i<formats.length; i++) {
+					for (var x=0; x<lookup.length; x++) {
+						if (formats[i] == lookup[x][0])
+							html += '<option value="&lt;' + lookup[x][0] + '&gt;">' + lookup[x][1] + '</option>';
+					}
+				}
+
+				html += '</select>';
+
+				return html;
+
+			case "styleselect":
+				return '<select id="{$editor_id}_styleSelect" onmousedown="tinyMCE.themes.advanced._setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event,this,window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';
+
+			case "fontselect":
+				var fontHTML = '<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';
+				var iFonts = 'Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';
+				var nFonts = 'Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';
+				var fonts = tinyMCE.getParam("theme_advanced_fonts", nFonts).split(';');
+				for (i=0; i<fonts.length; i++) {
+					if (fonts[i] != '') {
+						var parts = fonts[i].split('=');
+						fontHTML += '<option value="' + parts[1] + '">' + parts[0] + '</option>';
+					}
+				}
+
+				fontHTML += '</select>';
+				return fontHTML;
+
+			case "fontsizeselect":
+				return '<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">'+
+						'<option value="0">{$lang_theme_font_size}</option>'+
+						'<option value="1">1 (8 pt)</option>'+
+						'<option value="2">2 (10 pt)</option>'+
+						'<option value="3">3 (12 pt)</option>'+
+						'<option value="4">4 (14 pt)</option>'+
+						'<option value="5">5 (18 pt)</option>'+
+						'<option value="6">6 (24 pt)</option>'+
+						'<option value="7">7 (36 pt)</option>'+
+						'</select>';
+
+			case "|":
+			case "separator":
+				return '<img src="{$themeurl}/images/separator.gif" width="2" height="20" class="mceSeparatorLine" />';
+
+			case "spacer":
+				return '<img src="{$themeurl}/images/separator.gif" width="2" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" />';
+
+			case "rowseparator":
+				return '<br />';
+		}
+
+		return "";
+	},
+
+	/**
+	 * Theme specific execcommand handling.
+	 */
+	execCommand : function(editor_id, element, command, user_interface, value) {
+		switch (command) {
+			case "mceLink":
+				var inst = tinyMCE.getInstanceById(editor_id);
+				var doc = inst.getDoc();
+				var selectedText = "";
+
+				if (tinyMCE.isMSIE) {
+					var rng = doc.selection.createRange();
+					selectedText = rng.text;
+				} else
+					selectedText = inst.getSel().toString();
+
+				if (!tinyMCE.linkElement) {
+					if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0))
+						return true;
+				}
+
+				var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
+
+				if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
+					tinyMCE.linkElement = tinyMCE.selectedElement;
+
+				// Is anchor not a link
+				if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
+					tinyMCE.linkElement = null;
+
+				if (tinyMCE.linkElement) {
+					href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');
+					target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');
+					title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');
+					onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
+					style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
+
+					// Try old onclick to if copy/pasted content
+					if (onclick == "")
+						onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
+
+					onclick = tinyMCE.cleanupEventStr(onclick);
+
+					href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
+
+					// Use mce_href if defined
+					mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
+					if (mceRealHref != "") {
+						href = mceRealHref;
+
+						if (tinyMCE.getParam('convert_urls'))
+							href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
+					}
+
+					action = "update";
+				}
+
+				var template = new Array();
+
+				template['file'] = 'link.htm';
+				template['width'] = 310;
+				template['height'] = 200;
+
+				// Language specific width and height addons
+				template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0);
+
+				if (inst.settings['insertlink_callback']) {
+					var returnVal = eval(inst.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);");
+					if (returnVal && returnVal['href'])
+						TinyMCE_AdvancedTheme._insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']);
+				} else {
+					tinyMCE.openWindow(template, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes"});
+				}
+
+				return true;
+
+			case "mceImage":
+				var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "";
+				var title = "", onmouseover = "", onmouseout = "", action = "insert";
+				var img = tinyMCE.imgElement;
+				var inst = tinyMCE.getInstanceById(editor_id);
+
+				if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {
+					img = tinyMCE.selectedElement;
+					tinyMCE.imgElement = img;
+				}
+
+				if (img) {
+					// Is it a internal MCE visual aid image, then skip this one.
+					if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)
+						return true;
+
+					src = tinyMCE.getAttrib(img, 'src');
+					alt = tinyMCE.getAttrib(img, 'alt');
+
+					// Try polling out the title
+					if (alt == "")
+						alt = tinyMCE.getAttrib(img, 'title');
+
+					// Fix width/height attributes if the styles is specified
+					if (tinyMCE.isGecko) {
+						var w = img.style.width;
+						if (w != null && w != "")
+							img.setAttribute("width", w);
+
+						var h = img.style.height;
+						if (h != null && h != "")
+							img.setAttribute("height", h);
+					}
+
+					border = tinyMCE.getAttrib(img, 'border');
+					hspace = tinyMCE.getAttrib(img, 'hspace');
+					vspace = tinyMCE.getAttrib(img, 'vspace');
+					width = tinyMCE.getAttrib(img, 'width');
+					height = tinyMCE.getAttrib(img, 'height');
+					align = tinyMCE.getAttrib(img, 'align');
+					onmouseover = tinyMCE.getAttrib(img, 'onmouseover');
+					onmouseout = tinyMCE.getAttrib(img, 'onmouseout');
+					title = tinyMCE.getAttrib(img, 'title');
+
+					// Is realy specified?
+					if (tinyMCE.isMSIE) {
+						width = img.attributes['width'].specified ? width : "";
+						height = img.attributes['height'].specified ? height : "";
+					}
+
+					//onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));
+					//onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));
+
+					src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
+
+					// Use mce_src if defined
+					mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');
+					if (mceRealSrc != "") {
+						src = mceRealSrc;
+
+						if (tinyMCE.getParam('convert_urls'))
+							src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
+					}
+
+					//if (onmouseover != "")
+					//	onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);");
+
+					//if (onmouseout != "")
+					//	onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);");
+
+					action = "update";
+				}
+
+				var template = new Array();
+
+				template['file'] = 'image.htm?src={$src}';
+				template['width'] = 355;
+				template['height'] = 265 + (tinyMCE.isMSIE ? 25 : 0);
+
+				// Language specific width and height addons
+				template['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0);
+
+				if (inst.settings['insertimage_callback']) {
+					var returnVal = eval(inst.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");
+					if (returnVal && returnVal['src'])
+						TinyMCE_AdvancedTheme._insertImage(returnVal['src'], returnVal['alt'], returnVal['border'], returnVal['hspace'], returnVal['vspace'], returnVal['width'], returnVal['height'], returnVal['align'], returnVal['title'], returnVal['onmouseover'], returnVal['onmouseout']);
+				} else
+					tinyMCE.openWindow(template, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"});
+
+				return true;
+
+			case "mceForeColor":
+				var template = new Array();
+				var elm = tinyMCE.selectedInstance.getFocusElement();
+				var inputColor = tinyMCE.getAttrib(elm, "color");
+
+				if (inputColor == '')
+					inputColor = elm.style.color;
+
+				if (!inputColor)
+					inputColor = "#000000";
+
+				template['file'] = 'color_picker.htm';
+				template['width'] = 220;
+				template['height'] = 190;
+
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "forecolor", input_color : inputColor});
+			return true;
+
+			case "mceBackColor":
+				var template = new Array();
+				var elm = tinyMCE.selectedInstance.getFocusElement();
+				var inputColor = elm.style.backgroundColor;
+
+				if (!inputColor)
+					inputColor = "#000000";
+
+				template['file'] = 'color_picker.htm';
+				template['width'] = 220;
+				template['height'] = 190;
+
+				template['width'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height', 0);
+
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "HiliteColor", input_color : inputColor});
+				//mceBackColor
+			return true;
+
+			case "mceColorPicker":
+				if (user_interface) {
+					var template = new Array();
+					var inputColor = value['document'].getElementById(value['element_id']).value;
+
+					template['file'] = 'color_picker.htm';
+					template['width'] = 220;
+					template['height'] = 190;
+					template['close_previous'] = "no";
+
+					template['width'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width', 0);
+					template['height'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height', 0);
+
+					if (typeof(value['store_selection']) == "undefined")
+						value['store_selection'] = true;
+
+					tinyMCE.lastColorPickerValue = value;
+					tinyMCE.openWindow(template, {editor_id : editor_id, mce_store_selection : value['store_selection'], inline : "yes", command : "mceColorPicker", input_color : inputColor});
+				} else {
+					var savedVal = tinyMCE.lastColorPickerValue;
+					var elm = savedVal['document'].getElementById(savedVal['element_id']);
+					elm.value = value;
+
+					if (elm.onchange != null && elm.onchange != '')
+						eval('elm.onchange();');
+				}
+			return true;
+
+			case "mceCodeEditor":
+				var template = new Array();
+
+				template['file'] = 'source_editor.htm';
+				template['width'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_width", 720));
+				template['height'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_height", 580));
+
+				tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no", inline : "yes"});
+				return true;
+
+			case "mceCharMap":
+				var template = new Array();
+
+				template['file'] = 'charmap.htm';
+				template['width'] = 550 + (tinyMCE.isOpera ? 40 : 0);
+				template['height'] = 250;
+
+				template['width'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_height', 0);
+
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+				return true;
+
+			case "mceInsertAnchor":
+				var template = new Array();
+
+				template['file'] = 'anchor.htm';
+				template['width'] = 320;
+				template['height'] = 90 + (tinyMCE.isNS7 ? 30 : 0);
+
+				template['width'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_width', 0);
+				template['height'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_height', 0);
+
+				tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"});
+				return true;
+
+			case "mceNewDocument":
+				if (confirm(tinyMCE.getLang('lang_newdocument')))
+					tinyMCE.execInstanceCommand(editor_id, 'mceSetContent', false, ' ');
+
+				return true;
+		}
+
+		return false;
+	},
+
+	/**
+	 * Editor instance template function.
+	 */
+	getEditorTemplate : function(settings, editorId) {
+		function removeFromArray(in_array, remove_array) {
+			var outArray = new Array();
+			
+			for (var i=0; i<in_array.length; i++) {
+				skip = false;
+
+				for (var j=0; j<remove_array.length; j++) {
+					if (in_array[i] == remove_array[j]) {
+						skip = true;
+					}
+				}
+
+				if (!skip) {
+					outArray[outArray.length] = in_array[i];
+				}
+			}
+
+			return outArray;
+		}
+
+		function addToArray(in_array, add_array) {
+			for (var i=0; i<add_array.length; i++) {
+				in_array[in_array.length] = add_array[i];
+			}
+
+			return in_array;
+		}
+
+		var template = new Array();
+		var deltaHeight = 0;
+		var resizing = tinyMCE.getParam("theme_advanced_resizing", false);
+		var path = tinyMCE.getParam("theme_advanced_path", true);
+		var statusbarHTML = '<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: ' + (path ? "block" : "none") + '">&#160;</div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: ' + (resizing ? "block" : "none") + '" onmousedown="tinyMCE.themes.advanced._setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';
+		var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout");
+
+		// Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY!
+		var styleSelectHTML = '<option value="">{$lang_theme_style_select}</option>';
+		if (settings['theme_advanced_styles']) {
+			var stylesAr = settings['theme_advanced_styles'].split(';');
+			
+			for (var i=0; i<stylesAr.length; i++) {
+				var key, value;
+
+				key = stylesAr[i].split('=')[0];
+				value = stylesAr[i].split('=')[1];
+
+				styleSelectHTML += '<option value="' + value + '">' + key + '</option>';
+			}
+
+			TinyMCE_AdvancedTheme._autoImportCSSClasses = false;
+		}
+
+		switch(layoutManager) {
+			case "SimpleLayout" : //the default TinyMCE Layout (for backwards compatibility)...
+				var toolbarHTML = "";
+				var toolbarLocation = tinyMCE.getParam("theme_advanced_toolbar_location", "bottom");
+				var toolbarAlign = tinyMCE.getParam("theme_advanced_toolbar_align", "center");
+				var pathLocation = tinyMCE.getParam("theme_advanced_path_location", "none"); // Compatiblity
+				var statusbarLocation = tinyMCE.getParam("theme_advanced_statusbar_location", pathLocation);
+				var defVals = {
+					theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",
+					theme_advanced_buttons2 : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",
+					theme_advanced_buttons3 : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap"
+				};
+
+				// Add accessibility control
+				toolbarHTML += '<a href="#" accesskey="q" title="' + tinyMCE.getLang("lang_toolbar_focus") + '"';
+
+				if (!tinyMCE.getParam("accessibility_focus"))
+					toolbarHTML += ' onfocus="tinyMCE.getInstanceById(\'' + editorId + '\').getWin().focus();"';
+
+				toolbarHTML += '></a>';
+
+				// Render rows
+				for (var i=1; i<100; i++) {
+					var def = defVals["theme_advanced_buttons" + i];
+
+					var buttons = tinyMCE.getParam("theme_advanced_buttons" + i, def == null ? '' : def, true, ',');
+					if (buttons.length == 0)
+						break;
+
+					buttons = removeFromArray(buttons, tinyMCE.getParam("theme_advanced_disable", "", true, ','));
+					buttons = addToArray(buttons, tinyMCE.getParam("theme_advanced_buttons" + i + "_add", "", true, ','));
+					buttons = addToArray(tinyMCE.getParam("theme_advanced_buttons" + i + "_add_before", "", true, ','), buttons);
+
+					for (var b=0; b<buttons.length; b++)
+						toolbarHTML += tinyMCE.getControlHTML(buttons[b]);
+
+					if (buttons.length > 0) {
+						toolbarHTML += "<br />";
+						deltaHeight -= 23;
+					}
+				}
+
+				// Add accessibility control
+				toolbarHTML += '<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\'' + editorId + '\').getWin().focus();"></a>';
+
+				// Setup template html
+				template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';
+
+				if (toolbarLocation == "top") {
+					template['html'] += '<tr><td class="mceToolbarTop" align="' + toolbarAlign + '" height="1" nowrap="nowrap">' + toolbarHTML + '</td></tr>';
+				}
+
+				if (statusbarLocation == "top") {
+					template['html'] += '<tr><td class="mceStatusbarTop" height="1">' + statusbarHTML + '</td></tr>';
+					deltaHeight -= 23;
+				}
+
+				template['html'] += '<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';
+
+				if (toolbarLocation == "bottom") {
+					template['html'] += '<tr><td class="mceToolbarBottom" align="' + toolbarAlign + '" height="1">' + toolbarHTML + '</td></tr>';
+				}
+
+				// External toolbar changes
+				if (toolbarLocation == "external") {
+					var bod = document.body;
+					var elm = document.createElement ("div");
+
+					toolbarHTML = tinyMCE.replaceVar(toolbarHTML, 'style_select_options', styleSelectHTML);
+					toolbarHTML = tinyMCE.applyTemplate(toolbarHTML, {editor_id : editorId});
+
+					elm.className = "mceToolbarExternal";
+					elm.id = editorId+"_toolbar";
+					elm.innerHTML = '<table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table>';
+					bod.appendChild (elm);
+					// bod.style.marginTop = elm.offsetHeight + "px";
+
+					deltaHeight = 0;
+					tinyMCE.getInstanceById(editorId).toolbarElement = elm;
+
+					//template['html'] = '<div id="mceExternalToolbar" align="center" class="mceToolbarExternal"><table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table></div>' + template["html"];
+				} else {
+					tinyMCE.getInstanceById(editorId).toolbarElement = null;
+				}
+
+				if (statusbarLocation == "bottom") {
+					template['html'] += '<tr><td class="mceStatusbarBottom" height="1">' + statusbarHTML + '</td></tr>';
+					deltaHeight -= 23;
+				}
+
+				template['html'] += '</tbody></table>';
+				//"SimpleLayout"
+			break;
+
+			case "RowLayout" : //Container Layout - containers defined in "theme_advanced_containers" are rendered from top to bottom.
+				template['html'] = '<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';
+
+				var containers = tinyMCE.getParam("theme_advanced_containers", "", true, ",");
+				var defaultContainerCSS = tinyMCE.getParam("theme_advanced_containers_default_class", "container");
+				var defaultContainerAlign = tinyMCE.getParam("theme_advanced_containers_default_align", "center");
+
+				//Render Containers:
+				for (var i = 0; i < containers.length; i++)
+				{
+					if (containers[i] == "mceEditor") //Exceptions for mceEditor and ...
+						template['html'] += '<tr><td align="center" class="mceEditor_border"><span id="{$editor_id}"></span></td></tr>';
+					else if (containers[i] == "mceElementpath" || containers[i] == "mceStatusbar") // ... mceElementpath:
+					{
+						var pathClass = "mceStatusbar";
+
+						if (i == containers.length-1)
+						{
+							pathClass = "mceStatusbarBottom";
+						}
+						else if (i == 0)
+						{
+							pathClass = "mceStatusbar";
+						}
+						else
+						{
+							deltaHeight-=2;
+						}
+
+						template['html'] += '<tr><td class="' + pathClass + '" height="1">' + statusbarHTML + '</td></tr>';
+						deltaHeight -= 22;
+					} else { // Render normal Container
+						var curContainer = tinyMCE.getParam("theme_advanced_container_"+containers[i], "", true, ',');
+						var curContainerHTML = "";
+						var curAlign = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align", defaultContainerAlign);
+						var curCSS = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class", defaultContainerCSS);
+
+						for (var j=0; j<curContainer.length; j++) {
+							curContainerHTML += tinyMCE.getControlHTML(curContainer[j]);
+						}
+
+						if (curContainer.length > 0) {
+							curContainerHTML += "<br />";
+							deltaHeight -= 23;
+						}
+
+						template['html'] += '<tr><td class="' + curCSS + '" align="' + curAlign + '" height="1">' + curContainerHTML + '</td></tr>';
+					}
+				}
+
+				template['html'] += '</tbody></table>';
+				//RowLayout
+			break;
+
+			case "CustomLayout" : //User defined layout callback...
+				var customLayout = tinyMCE.getParam("theme_advanced_custom_layout","");
+
+				if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined") {
+					template = eval(customLayout + "(template);");
+				}
+			break;
+		}
+
+		if (resizing)
+			template['html'] += '<span id="{$editor_id}_resize_box" class="mceResizeBox"></span>';
+
+		template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML);
+		template['delta_width'] = 0;
+		template['delta_height'] = deltaHeight;
+
+		return template;
+	},
+
+	initInstance : function(inst) {
+		if (tinyMCE.getParam("theme_advanced_resizing", false)) {
+			if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
+				var w = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_width");
+				var h = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_height");
+
+				TinyMCE_AdvancedTheme._resizeTo(inst, w, h, tinyMCE.getParam("theme_advanced_resize_horizontal", true));
+			}
+		}
+
+		inst.addShortcut('ctrl', 'k', 'lang_link_desc', 'mceLink');
+	},
+
+	/**
+	 * Node change handler.
+	 */
+	handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) {
+		function selectByValue(select_elm, value, first_index) {
+			first_index = typeof(first_index) == "undefined" ? false : true;
+
+			if (select_elm) {
+				for (var i=0; i<select_elm.options.length; i++) {
+					var ov = "" + select_elm.options[i].value;
+
+					if (first_index && ov.toLowerCase().indexOf(value.toLowerCase()) == 0) {
+						select_elm.selectedIndex = i;
+						return true;
+					}
+
+					if (ov == value) {
+						select_elm.selectedIndex = i;
+						return true;
+					}
+				}
+			}
+
+			return false;
+		};
+
+		function getAttrib(elm, name) {
+			return elm.getAttribute(name) ? elm.getAttribute(name) : "";
+		};
+
+		// No node provided
+		if (node == null)
+			return;
+
+		// Update path
+		var pathElm = document.getElementById(editor_id + "_path");
+		var inst = tinyMCE.getInstanceById(editor_id);
+		var doc = inst.getDoc();
+
+		if (pathElm) {
+			// Get node path
+			var parentNode = node;
+			var path = new Array();
+			
+			while (parentNode != null) {
+				if (parentNode.nodeName.toUpperCase() == "BODY") {
+					break;
+				}
+
+				// Only append element nodes to path
+				if (parentNode.nodeType == 1 && tinyMCE.getAttrib(parentNode, "class").indexOf('mceItemHidden') == -1) {
+					path[path.length] = parentNode;
+				}
+
+				parentNode = parentNode.parentNode;
+			}
+
+			// Setup HTML
+			var html = "";
+			for (var i=path.length-1; i>=0; i--) {
+				var nodeName = path[i].nodeName.toLowerCase();
+				var nodeData = "";
+
+				if (nodeName == "b") {
+					nodeName = "strong";
+				}
+
+				if (nodeName == "i") {
+					nodeName = "em";
+				}
+
+				if (nodeName == "span") {
+					var cn = tinyMCE.getAttrib(path[i], "class");
+					if (cn != "" && cn.indexOf('mceItem') == -1)
+						nodeData += "class: " + cn + " ";
+
+					var st = tinyMCE.getAttrib(path[i], "style");
+					if (st != "") {
+						st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st));
+						nodeData += "style: " + st + " ";
+					}
+				}
+
+				if (nodeName == "font") {
+					if (tinyMCE.getParam("convert_fonts_to_spans"))
+						nodeName = "span";
+
+					var face = tinyMCE.getAttrib(path[i], "face");
+					if (face != "")
+						nodeData += "font: " + face + " ";
+
+					var size = tinyMCE.getAttrib(path[i], "size");
+					if (size != "")
+						nodeData += "size: " + size + " ";
+
+					var color = tinyMCE.getAttrib(path[i], "color");
+					if (color != "")
+						nodeData += "color: " + color + " ";
+				}
+
+				if (getAttrib(path[i], 'id') != "") {
+					nodeData += "id: " + path[i].getAttribute('id') + " ";
+				}
+
+				var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
+				if (className != "" && className.indexOf('mceItem') == -1)
+					nodeData += "class: " + className + " ";
+
+				if (getAttrib(path[i], 'src') != "") {
+					var src = tinyMCE.getAttrib(path[i], "mce_src");
+
+					if (src == "")
+						 src = tinyMCE.getAttrib(path[i], "src");
+
+					nodeData += "src: " + src + " ";
+				}
+
+				if (getAttrib(path[i], 'href') != "") {
+					var href = tinyMCE.getAttrib(path[i], "mce_href");
+
+					if (href == "")
+						 href = tinyMCE.getAttrib(path[i], "href");
+
+					nodeData += "href: " + href + " ";
+				}
+
+				if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) {
+					nodeName = "flash";
+					nodeData = "src: " + path[i].getAttribute('title');
+				}
+
+				if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") {
+					nodeName = "a";
+					nodeName += "#" + anchor;
+					nodeData = "";
+				}
+
+				if (getAttrib(path[i], 'name').indexOf("mce_") != 0) {
+					var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false);
+					if (className != "" && className.indexOf('mceItem') == -1) {
+						nodeName += "." + className;
+					}
+				}
+
+				var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');';
+				html += '<a title="' + nodeData + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" target="_self" class="mcePathItem">' + nodeName + '</a>';
+
+				if (i > 0) {
+					html += " &raquo; ";
+				}
+			}
+
+			pathElm.innerHTML = '<a href="#" accesskey="x"></a>' + tinyMCE.getLang('lang_theme_path') + ": " + html + '&#160;';
+		}
+
+		// Reset old states
+		tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled');
+		tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal');
+		tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal');
+
+		if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1)
+			tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected');
+
+		// Get link
+		var anchorLink = tinyMCE.getParentElement(node, "a", "href");
+
+		if (anchorLink || any_selection) {
+			tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
+			tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal');
+		}
+
+		// Handle visual aid
+		tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal');
+
+		if (undo_levels != -1) {
+			tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled');
+			tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled');
+		}
+
+		// Within li, blockquote
+		if (tinyMCE.getParentElement(node, "li,blockquote"))
+			tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal');
+
+		// Has redo levels
+		if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0))
+			tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal');
+
+		// Has undo levels
+		if (undo_index != -1 && (undo_index > 0 && undo_levels > 0))
+			tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal');
+
+		// Select class in select box
+		var selectElm = document.getElementById(editor_id + "_styleSelect");
+		
+		if (selectElm) {
+			TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);
+
+			classNode = node;
+			breakOut = false;
+			var index = 0;
+
+			do {
+				if (classNode && classNode.className) {
+					for (var i=0; i<selectElm.options.length; i++) {
+						if (selectElm.options[i].value == classNode.className) {
+							index = i;
+							breakOut = true;
+							break;
+						}
+					}
+				}
+			} while (!breakOut && classNode != null && (classNode = classNode.parentNode) != null);
+
+			selectElm.selectedIndex = index;
+		}
+
+		// Select formatblock
+		var selectElm = document.getElementById(editor_id + "_formatSelect");
+		if (selectElm) {
+			var elm = tinyMCE.getParentElement(node, "p,div,h1,h2,h3,h4,h5,h6,pre,address");
+
+			if (elm)
+				selectByValue(selectElm, "<" + elm.nodeName.toLowerCase() + ">");
+			else
+				selectByValue(selectElm, "");
+		}
+
+		// Select fontselect
+		var selectElm = document.getElementById(editor_id + "_fontNameSelect");
+		if (selectElm) {
+			if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) {
+				var face = inst.queryCommandValue('FontName');
+
+				face = face == null || face == "" ? "" : face;
+
+				selectByValue(selectElm, face, face != "");
+			} else {
+				var elm = tinyMCE.getParentElement(node, "font", "face");
+
+				if (elm) {
+					var family = tinyMCE.getAttrib(elm, "face");
+
+					if (family == '')
+						family = '' + elm.style.fontFamily;
+
+					if (!selectByValue(selectElm, family, family != ""))
+						selectByValue(selectElm, "");
+				} else
+					selectByValue(selectElm, "");
+			}
+		}
+
+		// Select fontsize
+		var selectElm = document.getElementById(editor_id + "_fontSizeSelect");
+		if (selectElm) {
+			if (!tinyMCE.isSafari && !tinyMCE.isOpera) {
+				var size = inst.queryCommandValue('FontSize');
+				selectByValue(selectElm, size == null || size == "" ? "0" : size);
+			} else {
+				var elm = tinyMCE.getParentElement(node, "font", "size");
+				if (elm) {
+					var size = tinyMCE.getAttrib(elm, "size");
+
+					if (size == '') {
+						var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px');
+
+						size = '' + elm.style.fontSize;
+
+						for (var i=0; i<sizes.length; i++) {
+							if (('' + sizes[i]) == size) {
+								size = i;
+								break;
+							}
+						}
+					}
+
+					if (!selectByValue(selectElm, size))
+						selectByValue(selectElm, "");
+				} else
+					selectByValue(selectElm, "0");
+			}
+		}
+
+		// Handle align attributes
+		alignNode = node;
+		breakOut = false;
+		do {
+			if (!alignNode.getAttribute || !alignNode.getAttribute('align'))
+				continue;
+
+			switch (alignNode.getAttribute('align').toLowerCase()) {
+				case "left":
+					tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonSelected');
+					breakOut = true;
+				break;
+
+				case "right":
+					tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonSelected');
+					breakOut = true;
+				break;
+
+				case "middle":
+				case "center":
+					tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected');
+					breakOut = true;
+				break;
+
+				case "justify":
+					tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonSelected');
+					breakOut = true;
+				break;
+			}
+		} while (!breakOut && (alignNode = alignNode.parentNode) != null);
+
+		// Div justification
+		var div = tinyMCE.getParentElement(node, "div");
+		if (div && div.style.textAlign == "center")
+			tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonSelected');
+
+		// Do special text
+		if (!setup_content) {
+			// , "JustifyLeft", "_justifyleft", "JustifyCenter", "justifycenter", "JustifyRight", "justifyright", "JustifyFull", "justifyfull", "InsertUnorderedList", "bullist", "InsertOrderedList", "numlist", "InsertUnorderedList", "bullist", "Outdent", "outdent", "Indent", "indent", "subscript", "sub"
+			var ar = new Array("Bold", "_bold", "Italic", "_italic", "Strikethrough", "_strikethrough", "superscript", "_sup", "subscript", "_sub");
+			for (var i=0; i<ar.length; i+=2) {
+				if (inst.queryCommandState(ar[i]))
+					tinyMCE.switchClass(editor_id + ar[i+1], 'mceButtonSelected');
+			}
+
+			if (inst.queryCommandState("Underline") && (node.parentNode == null || node.parentNode.nodeName != "A"))
+				tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected');
+		}
+
+		// Handle elements
+		do {
+			switch (node.nodeName) {
+				case "UL":
+					tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected');
+				break;
+
+				case "OL":
+					tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected');
+				break;
+
+				case "HR":
+					 tinyMCE.switchClass(editor_id + '_hr', 'mceButtonSelected');
+				break;
+
+				case "IMG":
+				if (getAttrib(node, 'name').indexOf('mce_') != 0) {
+					tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected');
+				}
+				break;
+			}
+		} while ((node = node.parentNode) != null);
+	},
+
+	// Private theme internal functions
+
+	// This function auto imports CSS classes into the class selection droplist
+	_setupCSSClasses : function(editor_id) {
+		var i, selectElm;
+
+		if (!TinyMCE_AdvancedTheme._autoImportCSSClasses)
+			return;
+
+		selectElm = document.getElementById(editor_id + '_styleSelect');
+
+		if (selectElm && selectElm.getAttribute('cssImported') != 'true') {
+			var csses = tinyMCE.getCSSClasses(editor_id);
+			if (csses && selectElm)	{
+				for (i=0; i<csses.length; i++)
+					selectElm.options[selectElm.options.length] = new Option(csses[i], csses[i]);
+			}
+
+			// Only do this once
+			if (csses != null && csses.length > 0)
+				selectElm.setAttribute('cssImported', 'true');
+		}
+	},
+
+	_setCookie : function(name, value, expires, path, domain, secure) {
+		var curCookie = name + "=" + escape(value) +
+			((expires) ? "; expires=" + expires.toGMTString() : "") +
+			((path) ? "; path=" + escape(path) : "") +
+			((domain) ? "; domain=" + domain : "") +
+			((secure) ? "; secure" : "");
+
+		document.cookie = curCookie;
+	},
+
+	_getCookie : function(name) {
+		var dc = document.cookie;
+		var prefix = name + "=";
+		var begin = dc.indexOf("; " + prefix);
+
+		if (begin == -1) {
+			begin = dc.indexOf(prefix);
+
+			if (begin != 0)
+				return null;
+		} else
+			begin += 2;
+
+		var end = document.cookie.indexOf(";", begin);
+
+		if (end == -1)
+			end = dc.length;
+
+		return unescape(dc.substring(begin + prefix.length, end));
+	},
+
+	_resizeTo : function(inst, w, h, set_w) {
+		var editorContainer = document.getElementById(inst.editorId + '_parent');
+		var tableElm = editorContainer.firstChild;
+		var iframe = inst.iframeElement;
+
+		if (w == null || w == "null") {
+			set_w = false;
+			w = 0;
+		}
+
+		if (h == null || h == "null")
+			return;
+
+		w = parseInt(w);
+		h = parseInt(h);
+
+		if (tinyMCE.isGecko) {
+			w += 2;
+			h += 2;
+		}
+
+		var dx = w - tableElm.clientWidth;
+		var dy = h - tableElm.clientHeight;
+
+		w = w < 1 ? 30 : w;
+		h = h < 1 ? 30 : h;
+
+		if (set_w)
+			tableElm.style.width = w + "px";
+
+		tableElm.style.height = h + "px";
+
+		iw = iframe.clientWidth + dx;
+		ih = iframe.clientHeight + dy;
+
+		iw = iw < 1 ? 30 : iw;
+		ih = ih < 1 ? 30 : ih;
+
+		if (tinyMCE.isGecko) {
+			iw -= 2;
+			ih -= 2;
+		}
+
+		if (set_w)
+			iframe.style.width = iw + "px";
+
+		iframe.style.height = ih + "px";
+
+		// Is it to small, make it bigger again
+		if (set_w) {
+			var tableBodyElm = tableElm.firstChild;
+			var minIframeWidth = tableBodyElm.scrollWidth;
+			if (inst.iframeElement.clientWidth < minIframeWidth) {
+				dx = minIframeWidth - inst.iframeElement.clientWidth;
+
+				inst.iframeElement.style.width = (iw + dx) + "px";
+			}
+		}
+	},
+
+	/**
+	 * Handles resizing events.
+	 */
+	_resizeEventHandler : function(e) {
+		var resizer = TinyMCE_AdvancedTheme._resizer;
+
+		// Do nothing
+		if (!resizer.resizing)
+			return;
+
+		e = typeof(e) == "undefined" ? window.event : e;
+
+		var dx = e.screenX - resizer.downX;
+		var dy = e.screenY - resizer.downY;
+		var resizeBox = resizer.resizeBox;
+		var editorId = resizer.editorId;
+
+		switch (e.type) {
+			case "mousemove":
+				var w, h;
+
+				w = resizer.width + dx;
+				h = resizer.height + dy;
+
+				w = w < 1 ? 1 : w;
+				h = h < 1 ? 1 : h;
+
+				if (resizer.horizontal)
+					resizeBox.style.width = w + "px";
+
+				resizeBox.style.height = h + "px";
+				break;
+
+			case "mouseup":
+				TinyMCE_AdvancedTheme._setResizing(e, editorId, false);
+				TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId), resizer.width + dx, resizer.height + dy, resizer.horizontal);
+
+				// Expire in a month
+				if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) {
+					var expires = new Date();
+					expires.setTime(expires.getTime() + 3600000 * 24 * 30);
+
+					// Set the cookies
+					TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_width", "" + (resizer.horizontal ? resizer.width + dx : ""), expires);
+					TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_height", "" + (resizer.height + dy), expires);
+				}
+				break;
+		}
+	},
+
+	/**
+	 * Starts/stops the editor resizing.
+	 */
+	_setResizing : function(e, editor_id, state) {
+		e = typeof(e) == "undefined" ? window.event : e;
+
+		var resizer = TinyMCE_AdvancedTheme._resizer;
+		var editorContainer = document.getElementById(editor_id + '_parent');
+		var editorArea = document.getElementById(editor_id + '_parent').firstChild;
+		var resizeBox = document.getElementById(editor_id + '_resize_box');
+		var inst = tinyMCE.getInstanceById(editor_id);
+
+		if (state) {
+			// Place box over editor area
+			var width = editorArea.clientWidth;
+			var height = editorArea.clientHeight;
+
+			resizeBox.style.width = width + "px";
+			resizeBox.style.height = height + "px";
+
+			resizer.iframeWidth = inst.iframeElement.clientWidth;
+			resizer.iframeHeight = inst.iframeElement.clientHeight;
+
+			// Hide editor and show resize box
+			editorArea.style.display = "none";
+			resizeBox.style.display = "block";
+
+			// Add event handlers, only once
+			if (!resizer.eventHandlers) {
+				if (tinyMCE.isMSIE)
+					tinyMCE.addEvent(document, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
+				else
+					tinyMCE.addEvent(window, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler);
+
+				tinyMCE.addEvent(document, "mouseup", TinyMCE_AdvancedTheme._resizeEventHandler);
+
+				resizer.eventHandlers = true;
+			}
+
+			resizer.resizing = true;
+			resizer.downX = e.screenX;
+			resizer.downY = e.screenY;
+			resizer.width = parseInt(resizeBox.style.width);
+			resizer.height = parseInt(resizeBox.style.height);
+			resizer.editorId = editor_id;
+			resizer.resizeBox = resizeBox;
+			resizer.horizontal = tinyMCE.getParam("theme_advanced_resize_horizontal", true);
+		} else {
+			resizer.resizing = false;
+			resizeBox.style.display = "none";
+			editorArea.style.display = tinyMCE.isMSIE && !tinyMCE.isOpera ? "block" : "table";
+			tinyMCE.execCommand('mceResetDesignMode');
+		}
+	},
+
+	_insertImage : function(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout) {
+		tinyMCE.execCommand('mceBeginUndoLevel');
+
+		if (src == "")
+			return;
+
+		if (!tinyMCE.imgElement && tinyMCE.isSafari) {
+			var html = "";
+
+			html += '<img src="' + src + '" alt="' + alt + '"';
+			html += ' border="' + border + '" hspace="' + hspace + '"';
+			html += ' vspace="' + vspace + '" width="' + width + '"';
+			html += ' height="' + height + '" align="' + align + '" title="' + title + '" onmouseover="' + onmouseover + '" onmouseout="' + onmouseout + '" />';
+
+			tinyMCE.execCommand("mceInsertContent", false, html);
+		} else {
+			if (!tinyMCE.imgElement && tinyMCE.selectedInstance) {
+				if (tinyMCE.isSafari)
+					tinyMCE.execCommand("mceInsertContent", false, '<img src="' + tinyMCE.uniqueURL + '" />');
+				else
+					tinyMCE.selectedInstance.contentDocument.execCommand("insertimage", false, tinyMCE.uniqueURL);
+
+				tinyMCE.imgElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "img", "src", tinyMCE.uniqueURL);
+			}
+		}
+
+		if (tinyMCE.imgElement) {
+			var needsRepaint = false;
+			var msrc = src;
+
+			src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, tinyMCE.imgElement);");
+
+			if (tinyMCE.getParam('convert_urls'))
+				msrc = src;
+
+			if (onmouseover && onmouseover != "")
+				onmouseover = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, tinyMCE.imgElement);") + "';";
+
+			if (onmouseout && onmouseout != "")
+				onmouseout = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, tinyMCE.imgElement);") + "';";
+
+			// Use alt as title if it's undefined
+			if (typeof(title) == "undefined")
+				title = alt;
+
+			if (width != tinyMCE.imgElement.getAttribute("width") || height != tinyMCE.imgElement.getAttribute("height") || align != tinyMCE.imgElement.getAttribute("align"))
+				needsRepaint = true;
+
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'src', src);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'mce_src', msrc);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'alt', alt);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'title', title);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'align', align);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'border', border, true);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'hspace', hspace, true);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'vspace', vspace, true);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'width', width, true);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'height', height, true);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseover', onmouseover);
+			tinyMCE.setAttrib(tinyMCE.imgElement, 'onmouseout', onmouseout);
+
+			// Fix for bug #989846 - Image resize bug
+			if (width && width != "")
+				tinyMCE.imgElement.style.pixelWidth = width;
+
+			if (height && height != "")
+				tinyMCE.imgElement.style.pixelHeight = height;
+
+			if (needsRepaint)
+				tinyMCE.selectedInstance.repaint();
+		}
+
+		tinyMCE.execCommand('mceEndUndoLevel');
+	},
+
+	_insertLink : function(href, target, title, onclick, style_class) {
+		tinyMCE.execCommand('mceBeginUndoLevel');
+
+		if (tinyMCE.selectedInstance && tinyMCE.selectedElement && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {
+			var doc = tinyMCE.selectedInstance.getDoc();
+			var linkElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");
+			var newLink = false;
+
+			if (!linkElement) {
+				linkElement = doc.createElement("a");
+				newLink = true;
+			}
+
+			var mhref = href;
+			var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, linkElement);");
+			mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
+
+			tinyMCE.setAttrib(linkElement, 'href', thref);
+			tinyMCE.setAttrib(linkElement, 'mce_href', mhref);
+			tinyMCE.setAttrib(linkElement, 'target', target);
+			tinyMCE.setAttrib(linkElement, 'title', title);
+			tinyMCE.setAttrib(linkElement, 'onclick', onclick);
+			tinyMCE.setAttrib(linkElement, 'class', style_class);
+
+			if (newLink) {
+				linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));
+				tinyMCE.selectedElement.parentNode.replaceChild(linkElement, tinyMCE.selectedElement);
+			}
+
+			return;
+		}
+
+		if (!tinyMCE.linkElement && tinyMCE.selectedInstance) {
+			if (tinyMCE.isSafari) {
+				tinyMCE.execCommand("mceInsertContent", false, '<a href="' + tinyMCE.uniqueURL + '">' + tinyMCE.selectedInstance.selection.getSelectedHTML() + '</a>');
+			} else
+				tinyMCE.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL);
+
+			tinyMCE.linkElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
+
+			var elementArray = tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);
+
+			for (var i=0; i<elementArray.length; i++) {
+				var mhref = href;
+				var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, elementArray[i]);");
+				mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
+
+				tinyMCE.setAttrib(elementArray[i], 'href', thref);
+				tinyMCE.setAttrib(elementArray[i], 'mce_href', mhref);
+				tinyMCE.setAttrib(elementArray[i], 'target', target);
+				tinyMCE.setAttrib(elementArray[i], 'title', title);
+				tinyMCE.setAttrib(elementArray[i], 'onclick', onclick);
+				tinyMCE.setAttrib(elementArray[i], 'class', style_class);
+			}
+
+			tinyMCE.linkElement = elementArray[0];
+		}
+
+		if (tinyMCE.linkElement) {
+			var mhref = href;
+			href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement);");
+			mhref = tinyMCE.getParam('convert_urls') ? href : mhref;
+
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'href', href);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'mce_href', mhref);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'target', target);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'title', title);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'onclick', onclick);
+			tinyMCE.setAttrib(tinyMCE.linkElement, 'class', style_class);
+		}
+
+		tinyMCE.execCommand('mceEndUndoLevel');
+	}
+};
+
+tinyMCE.addTheme("advanced", TinyMCE_AdvancedTheme);
+
+// Add default buttons maps for advanced theme and all internal plugins
+tinyMCE.addButtonMap(TinyMCE_AdvancedTheme._buttonMap);
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/editor_ui.css 75/e107_handlers/tiny_mce/themes/advanced/editor_ui.css
--- 6171/e107_handlers/tiny_mce/themes/advanced/editor_ui.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/editor_ui.css	2005-06-25 18:45:25.000000000 -0500
@@ -0,0 +1,199 @@
+.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected {
+	margin-top: 1px;
+	margin-left: 1px;
+}
+
+.mceButtonNormal {
+	border-top: 1px solid;
+	border-left: 1px solid;
+	border-bottom: 1px solid;
+	border-right: 1px solid;
+	border-color: #F0F0EE;
+	cursor: arrow;
+}
+
+.mceButtonOver {
+/*	border-top: 1px solid buttonhighlight;
+	border-left: 1px solid buttonhighlight;
+	border-bottom: 1px solid buttonshadow;
+	border-right: 1px solid buttonshadow;*/
+	border: 1px solid #0A246A;
+	cursor: arrow;
+	background-color: #B6BDD2;
+}
+
+.mceButtonDown {
+/*	border-bottom: 1px solid buttonhighlight;
+	border-right: 1px solid buttonhighlight;
+	border-top: 1px solid buttonshadow;
+	border-left: 1px solid buttonshadow;*/
+	cursor: arrow;
+	border: 1px solid #0A246A;
+	background-color: #8592B5;
+}
+
+.mceButtonSelected {
+	border: 1px solid;
+	border-color: #C0C0BB;
+	cursor: arrow;
+}
+
+.mceButtonDisabled {
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+	-moz-opacity:0.3;
+	opacity: 0.3;
+	border-top: 1px solid;
+	border-left: 1px solid;
+	border-bottom: 1px solid;
+	border-right: 1px solid;
+	border-color: #F0F0EE;
+	cursor: arrow;
+}
+
+.mceSeparator {
+	border-top: 1px solid buttonhighlight;
+	border-left: 1px solid buttonhighlight;
+	border-bottom: 1px solid buttonshadow;
+	border-right: 1px solid buttonshadow;
+	margin-right: 2px;
+	margin-left: 2px;
+}
+
+.mceSeparatorLine {
+	margin:2px;
+	margin-left: 4px;
+	background-color: #F0F0EE;
+	border-top: 1px solid buttonshadow;
+	border-left: 1px solid buttonshadow;
+	border-bottom: 1px solid buttonhighlight;
+	border-right: 1px solid buttonhighlight;
+	width: 0px;
+	height: 15px;
+}
+
+.mceSelectList {
+	font-family: "MS Sans Serif";
+	font-size: 7pt;
+	font-weight: normal;
+	margin-top: 3px;
+	padding: 0px;
+	display: inline;
+	vertical-align: top;
+	background-color: #F0F0EE
+}
+
+.mceLabel, .mceLabelDisabled {
+	font-family: "MS Sans Serif";
+	font-size: 9pt;
+}
+
+.mceLabel {
+	color: #000000;
+}
+
+.mceLabelDisabled {
+	cursor: text;
+	color: #999999;
+}
+
+.mceEditor {
+	background: #F0F0EE;
+	border: 1px solid #cccccc;
+}
+
+.mceEditorArea {
+	font-family: "MS Sans Serif";
+	background: #FFFFFF;
+}
+
+.mceToolbarTop, .mceToolbarBottom {
+	background: #F0F0EE;
+}
+
+.mceToolbarTop {
+	border-bottom: 1px solid #cccccc;
+}
+
+.mceToolbarBottom {
+	border-top: 1px solid #cccccc;
+}
+
+.mcePathTop, .mcePathBottom, .mcePath {
+	font-family: "MS Sans Serif";
+	font-size: 9pt;
+	padding: 2px;
+	height: 20px;
+}
+
+.mcePathTop {
+	border-bottom: 1px solid #cccccc;
+}
+
+.mcePathBottom {
+	border-top: 1px solid #cccccc;
+}
+
+.mcePathItem, .mcePathItem:link, .mcePathItem:visited, .mcePathItem:hover {
+	text-decoration: none;
+	font-family: "MS Sans Serif";
+	font-size: 9pt;
+	color: #000000;
+}
+
+.mcePathItem:hover {
+	text-decoration: underline;
+}
+
+.mcePath {
+	border-bottom: 1px solid #cccccc;
+}
+
+.mceDialog {
+	position: absolute;
+	left: 100px;
+	top: 100px;
+	z-index: 1000;
+}
+
+.mceDialogHeader {
+	background: #F0F0EE;
+	width: 100%;
+	height: 16px;
+	margin: 0px;
+	padding: 0px;
+	border: 1px solid black;
+	border-bottom: 0px;
+}
+
+.mceDialogTitle {
+	float: left;
+	font-family: "MS Sans Serif";
+	font-size: 9pt;
+	height: 14px;
+}
+
+.mceDialogClose {
+	float: right;
+	width: 16px;
+	height: 16px;
+	background-image: url('images/close.gif');
+	background-repeat: no-repeat;
+	background-position: 0px 1px;
+	margin: 0px;
+	padding: 0px;
+}
+
+.mceDialogClose a {
+	width: 16px;
+	height: 14px;
+	display: block;
+	font-family: "MS Sans Serif";
+	font-size: 9pt;
+	margin: 0px;
+	padding: 0px;
+}
+
+.mceDialogIFrameWrapper {
+	border: 1px solid black;
+	clear: both;
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/image.htm 75/e107_handlers/tiny_mce/themes/advanced/image.htm
--- 6171/e107_handlers/tiny_mce/themes/advanced/image.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/image.htm	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,100 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_insert_image_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/image.js"></script>
+	<base target="_self" />
+</head>
+<body id="image" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<form onsubmit="insertImage();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_image_title}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+     <table border="0" cellpadding="4" cellspacing="0">
+          <tr>
+            <td nowrap="nowrap"><label for="src">{$lang_insert_image_src}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0">
+                <tr>
+                  <td><input id="src" name="src" type="text" value="" style="width: 200px" onchange="getImageData();"></td>
+                  <td id="srcbrowsercontainer">&nbsp;</td>
+                </tr>
+              </table></td>
+          </tr>
+		  <!-- Image list -->
+		  <script language="javascript">
+			if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
+				var html = "";
+
+				html += '<tr><td><label for="image_list">{$lang_image_list}</label></td>';
+				html += '<td><select id="image_list" name="image_list" style="width: 200px" onchange="this.form.src.value=this.options[this.selectedIndex].value;resetImageData();getImageData();">';
+				html += '<option value="">---</option>';
+
+				for (var i=0; i<tinyMCEImageList.length; i++)
+					html += '<option value="' + tinyMCEImageList[i][1] + '">' + tinyMCEImageList[i][0] + '</option>';
+
+				html += '</select></td></tr>';
+
+				document.write(html);
+			}
+		  </script>
+		  <!-- /Image list -->
+          <tr>
+            <td nowrap="nowrap"><label for="alt">{$lang_insert_image_alt}</label></td>
+            <td><input id="alt" name="alt" type="text" value="" style="width: 200px"></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="align">{$lang_insert_image_align}</label></td>
+            <td><select id="align" name="align">
+                <option value="">{$lang_insert_image_align_default}</option>
+                <option value="baseline">{$lang_insert_image_align_baseline}</option>
+                <option value="top">{$lang_insert_image_align_top}</option>
+                <option value="middle">{$lang_insert_image_align_middle}</option>
+                <option value="bottom">{$lang_insert_image_align_bottom}</option>
+                <option value="texttop">{$lang_insert_image_align_texttop}</option>
+                <option value="absmiddle">{$lang_insert_image_align_absmiddle}</option>
+                <option value="absbottom">{$lang_insert_image_align_absbottom}</option>
+                <option value="left">{$lang_insert_image_align_left}</option>
+                <option value="right">{$lang_insert_image_align_right}</option>
+              </select></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="width">{$lang_insert_image_dimensions}</label></td>
+            <td><input id="width" name="width" type="text" value="" size="3" maxlength="3">
+              x
+              <input id="height" name="height" type="text" value="" size="3" maxlength="3"></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="border">{$lang_insert_image_border}</label></td>
+            <td><input id="border" name="border" type="text" value="" size="3" maxlength="3"></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="vspace">{$lang_insert_image_vspace}</label></td>
+            <td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3"></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="hspace">{$lang_insert_image_hspace}</label></td>
+            <td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3"></td>
+          </tr>
+        </table>
+		</div>
+	</div>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertImage();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/anchor.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/anchor.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/anchor_symbol.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/anchor_symbol.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/backcolor.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/backcolor.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/bold_de_se.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/bold_de_se.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/bold_es.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/bold_es.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/bold_fr.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/bold_fr.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/bold.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/bold.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/bold_ru.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/bold_ru.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/browse.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/browse.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/bullist.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/bullist.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/button_menu.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/button_menu.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/buttons.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/buttons.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/cancel_button_bg.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/cancel_button_bg.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/center.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/center.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/charmap.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/charmap.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/cleanup.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/cleanup.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/close.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/close.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/code.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/code.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/color.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/color.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/copy.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/copy.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/custom_1.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/custom_1.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/cut.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/cut.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/ecode.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/ecode.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/forecolor.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/forecolor.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/full.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/full.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/help.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/help.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/hr.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/hr.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/image.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/image.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/indent.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/indent.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/insert_button_bg.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/insert_button_bg.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/italic_de_se.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/italic_de_se.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/italic_es.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/italic_es.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/italic.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/italic.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/italic_ru.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/italic_ru.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/justifycenter.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/justifycenter.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/justifyfull.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/justifyfull.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/justifyleft.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/justifyleft.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/justifyright.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/justifyright.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/left.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/left.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/link.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/link.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/menu_check.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/menu_check.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/newdocument.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/newdocument.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/numlist.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/numlist.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/opacity.png and 75/e107_handlers/tiny_mce/themes/advanced/images/opacity.png differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/outdent.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/outdent.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/paste.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/paste.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/quote.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/quote.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/redo.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/redo.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/removeformat.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/removeformat.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/right.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/right.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/separator.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/separator.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/spacer.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/spacer.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/statusbar_resize.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/statusbar_resize.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/strikethrough.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/strikethrough.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/sub.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/sub.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/sup.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/sup.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/table_delete_col.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/table_delete_col.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/table_delete_row.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/table_delete_row.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/table.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/table.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_after.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_after.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_before.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/table_insert_col_before.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_after.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_after.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_before.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/table_insert_row_before.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/underline_es.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/underline_es.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/underline_fr.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/underline_fr.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/underline.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/underline.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/underline_ru.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/underline_ru.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/undo.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/undo.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/unlink.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/unlink.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/visualaid.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/visualaid.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_bg.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_bg.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_end.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_end.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/xp/tabs_bg.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/xp/tabs_bg.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_bg.gif differ
Files 6171/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif and 75/e107_handlers/tiny_mce/themes/advanced/images/xp/tab_sel_end.gif differ
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/about.js 75/e107_handlers/tiny_mce/themes/advanced/jscripts/about.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/about.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/jscripts/about.js	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,75 @@
+function init() {
+	var inst;
+
+	tinyMCEPopup.resizeToInnerSize();
+	inst = tinyMCE.selectedInstance;
+
+	// Give FF some time
+	window.setTimeout('insertHelpIFrame();', 10);
+
+	var tcont = document.getElementById('plugintablecontainer');
+	var plugins = tinyMCE.getParam('plugins', '', true, ',');
+	if (plugins.length == 0)
+		document.getElementById('plugins_tab').style.display = 'none';
+
+	var html = "";
+	html += '<table id="plugintable">';
+	html += '<thead>';
+	html += '<tr>';
+	html += '<td>' + tinyMCE.getLang('lang_plugin') + '</td>';
+	html += '<td>' + tinyMCE.getLang('lang_author') + '</td>';
+	html += '<td>' + tinyMCE.getLang('lang_version') + '</td>';
+	html += '</tr>';
+	html += '</thead>';
+	html += '<tbody>';
+
+	for (var i=0; i<inst.plugins.length; i++) {
+		var info = getPluginInfo(inst.plugins[i]);
+
+		html += '<tr>';
+
+		if (info.infourl != null && info.infourl != '')
+			html += '<td width="50%" title="' + plugins[i] + '"><a href="' + info.infourl + '" target="mceplugin">' + info.longname + '</a></td>';
+		else
+			html += '<td width="50%" title="' + plugins[i] + '">' + info.longname + '</td>';
+
+		if (info.authorurl != null && info.authorurl != '')
+			html += '<td width="35%"><a href="' + info.authorurl + '" target="mceplugin">' + info.author + '</a></td>';
+		else
+			html += '<td width="35%">' + info.author + '</td>';
+
+		html += '<td width="15%">' + info.version + '</td>';
+		html += '</tr>';
+	}
+
+	html += '</tbody>';
+	html += '</table>';
+
+	tcont.innerHTML = html;
+}
+
+function getPluginInfo(name) {
+	if (tinyMCE.plugins[name].getInfo)
+		return tinyMCE.plugins[name].getInfo();
+
+	return {
+		longname : name,
+		authorurl : '',
+		infourl : '',
+		author : '--',
+		version : '--'
+	};
+}
+
+function insertHelpIFrame() {
+	var html = '<iframe width="100%" height="300" src="' + tinyMCE.themeURL + "/docs/" + tinyMCE.settings['docs_language'] + "/index.htm" + '"></iframe>';
+
+	document.getElementById('iframecontainer').innerHTML = html;
+
+	html = '';
+	html += '<a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a> ';
+	html += '<a href="http://sourceforge.net/projects/tinymce/" target="_blank"><img src="http://sourceforge.net/sflogo.php?group_id=103281" alt="Hosted By Sourceforge" border="0" /></a> ';
+	html += '<a href="http://www.freshmeat.net/projects/tinymce" target="_blank"><img src="http://tinymce.moxiecode.com/images/fm.gif" alt="Also on freshmeat" border="0" /></a> ';
+
+	document.getElementById('buttoncontainer').innerHTML = html;
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/anchor.js 75/e107_handlers/tiny_mce/themes/advanced/jscripts/anchor.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/anchor.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/jscripts/anchor.js	2006-04-16 02:02:35.000000000 -0500
@@ -0,0 +1,74 @@
+var action, element;
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+	var anchor = tinyMCE.getParentElement(inst.getFocusElement(), "a", "name");
+	var img = inst.getFocusElement();
+	action = 'insert';
+
+	if (anchor != null) {
+		element = anchor;
+		action = "update";
+	}
+
+	if (tinyMCE.getAttrib(img, "class") == "mceItemAnchor") {
+		element = img;
+		action = "update";
+	}
+
+	if (action == "update")
+		document.forms[0].anchorName.value = element.nodeName == "IMG" ? element.getAttribute("title") : element.getAttribute("name");
+
+	document.forms[0].insert.value = tinyMCE.getLang('lang_' + action, 'Insert', true);
+}
+
+function insertAnchor() {
+	var inst = tinyMCE.getInstanceById(tinyMCE.getWindowArg('editor_id'));
+	var name = document.forms[0].anchorName.value, e;
+
+	tinyMCEPopup.execCommand("mceBeginUndoLevel");
+
+	if (action == "update") {
+		if (element.nodeName == "IMG")
+			element.setAttribute("title", name);
+		else
+			element.setAttribute("name", name);
+	} else {
+		var rng = inst.getRng();
+
+		if (rng.collapse)
+			rng.collapse(false);
+
+		name = name.replace(/&/g, '&amp;');
+		name = name.replace(/\"/g, '&quot;');
+		name = name.replace(/</g, '&lt;');
+		name = name.replace(/>/g, '&gt;');
+
+		// Fix for bug #1447335
+		if (tinyMCE.isGecko)
+			html = '<a id="mceNewAnchor" name="' + name + '"></a>';
+		else
+			html = '<a name="' + name + '"></a>';
+
+		tinyMCEPopup.execCommand("mceInsertContent", false, html);
+
+		// Fix for bug #1447335 force cursor after the anchor element
+		if (tinyMCE.isGecko) {
+			e = inst.getDoc().getElementById('mceNewAnchor');
+
+			if (e) {
+				inst.selection.selectNode(e, true, false, false);
+				e.removeAttribute('id');
+			}
+		}
+
+		tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst);
+	}
+
+	tinyMCEPopup.execCommand("mceEndUndoLevel");
+
+	tinyMCE.triggerNodeChange();
+	tinyMCEPopup.close();
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/charmap.js 75/e107_handlers/tiny_mce/themes/advanced/jscripts/charmap.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/charmap.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/jscripts/charmap.js	2006-04-16 02:02:36.000000000 -0500
@@ -0,0 +1,326 @@
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+}
+
+var charmap = new Array();
+
+// for mor details please see w3c.org
+// now here is the complete list ;)
+
+charmap = [
+	['&nbsp;',    '&#160;',  true, 'no-break space'],
+	['&amp;',     '&#38;',   true, 'ampersand'],
+	['&quot;',    '&#34;',   true, 'quotation mark'],
+// finance
+	['&cent;',    '&#162;',  true, 'cent sign'],
+	['&euro;',    '&#8364;', true, 'euro sign'],
+	['&pound;',   '&#163;',  true, 'pound sign'],
+	['&yen;',     '&#165;',  true, 'yen sign'],
+// signs
+	['&copy;',    '&#169;',  true, 'copyright sign'],
+	['&reg;',     '&#174;',  true, 'registered sign'],
+	['&trade;',   '&#8482;', true, 'trade mark sign'],
+	['&permil;',  '&#8240;', true, 'per mille sign'],
+	['&micro;',   '&#181;',  true, 'micro sign'],
+	['&middot;',  '&#183;',  true, 'middle dot'],
+	['&bull;',    '&#8226;', true, 'bullet'],
+	['&hellip;',  '&#8230;', true, 'three dot leader'],
+	['&prime;',   '&#8242;', true, 'minutes / feet'],
+	['&Prime;',   '&#8243;', true, 'seconds / inches'],
+	['&sect;',    '&#167;',  true, 'section sign'],
+	['&para;',    '&#182;',  true, 'paragraph sign'],
+	['&szlig;',   '&#223;',  true, 'sharp s / ess-zed'],
+// quotations
+	['&lsaquo;',  '&#8249;', true, 'single left-pointing angle quotation mark'],
+	['&rsaquo;',  '&#8250;', true, 'single right-pointing angle quotation mark'],
+	['&laquo;',   '&#171;',  true, 'left pointing guillemet'],
+	['&raquo;',   '&#187;',  true, 'right pointing guillemet'],
+	['&lsquo;',   '&#8216;', true, 'left single quotation mark'],
+	['&rsquo;',   '&#8217;', true, 'right single quotation mark'],
+	['&ldquo;',   '&#8220;', true, 'left double quotation mark'],
+	['&rdquo;',   '&#8221;', true, 'right double quotation mark'],
+	['&sbquo;',   '&#8218;', true, 'single low-9 quotation mark'],
+	['&bdquo;',   '&#8222;', true, 'double low-9 quotation mark'],
+	['&lt;',      '&#60;',   true, 'less-than sign'],
+	['&gt;',      '&#62;',   true, 'greater-than sign'],
+	['&le;',      '&#8804;', true, 'less-than or equal to'],
+	['&ge;',      '&#8805;', true, 'greater-than or equal to'],
+	['&ndash;',   '&#8211;', true, 'en dash'],
+	['&mdash;',   '&#8212;', true, 'em dash'],
+	['&macr;',    '&#175;',  true, 'macron'],
+	['&oline;',   '&#8254;', true, 'overline'],
+	['&curren;',  '&#164;',  true, 'currency sign'],
+	['&brvbar;',  '&#166;',  true, 'broken bar'],
+	['&uml;',     '&#168;',  true, 'diaeresis'],
+	['&iexcl;',   '&#161;',  true, 'inverted exclamation mark'],
+	['&iquest;',  '&#191;',  true, 'turned question mark'],
+	['&circ;',    '&#710;',  true, 'circumflex accent'],
+	['&tilde;',   '&#732;',  true, 'small tilde'],
+	['&deg;',     '&#176;',  true, 'degree sign'],
+	['&minus;',   '&#8722;', true, 'minus sign'],
+	['&plusmn;',  '&#177;',  true, 'plus-minus sign'],
+	['&divide;',  '&#247;',  true, 'division sign'],
+	['&frasl;',   '&#8260;', true, 'fraction slash'],
+	['&times;',   '&#215;',  true, 'multiplication sign'],
+	['&sup1;',    '&#185;',  true, 'superscript one'],
+	['&sup2;',    '&#178;',  true, 'superscript two'],
+	['&sup3;',    '&#179;',  true, 'superscript three'],
+	['&frac14;',  '&#188;',  true, 'fraction one quarter'],
+	['&frac12;',  '&#189;',  true, 'fraction one half'],
+	['&frac34;',  '&#190;',  true, 'fraction three quarters'],
+// math / logical
+	['&fnof;',    '&#402;',  true, 'function / florin'],
+	['&int;',     '&#8747;', true, 'integral'],
+	['&sum;',     '&#8721;', true, 'n-ary sumation'],
+	['&infin;',   '&#8734;', true, 'infinity'],
+	['&radic;',   '&#8730;', true, 'square root'],
+	['&sim;',     '&#8764;', false,'similar to'],
+	['&cong;',    '&#8773;', false,'approximately equal to'],
+	['&asymp;',   '&#8776;', true, 'almost equal to'],
+	['&ne;',      '&#8800;', true, 'not equal to'],
+	['&equiv;',   '&#8801;', true, 'identical to'],
+	['&isin;',    '&#8712;', false,'element of'],
+	['&notin;',   '&#8713;', false,'not an element of'],
+	['&ni;',      '&#8715;', false,'contains as member'],
+	['&prod;',    '&#8719;', true, 'n-ary product'],
+	['&and;',     '&#8743;', false,'logical and'],
+	['&or;',      '&#8744;', false,'logical or'],
+	['&not;',     '&#172;',  true, 'not sign'],
+	['&cap;',     '&#8745;', true, 'intersection'],
+	['&cup;',     '&#8746;', false,'union'],
+	['&part;',    '&#8706;', true, 'partial differential'],
+	['&forall;',  '&#8704;', false,'for all'],
+	['&exist;',   '&#8707;', false,'there exists'],
+	['&empty;',   '&#8709;', false,'diameter'],
+	['&nabla;',   '&#8711;', false,'backward difference'],
+	['&lowast;',  '&#8727;', false,'asterisk operator'],
+	['&prop;',    '&#8733;', false,'proportional to'],
+	['&ang;',     '&#8736;', false,'angle'],
+// undefined
+	['&acute;',   '&#180;',  true, 'acute accent'],
+	['&cedil;',   '&#184;',  true, 'cedilla'],
+	['&ordf;',    '&#170;',  true, 'feminine ordinal indicator'],
+	['&ordm;',    '&#186;',  true, 'masculine ordinal indicator'],
+	['&dagger;',  '&#8224;', true, 'dagger'],
+	['&Dagger;',  '&#8225;', true, 'double dagger'],
+// alphabetical special chars
+	['&Agrave;',  '&#192;',  true, 'A - grave'],
+	['&Aacute;',  '&#193;',  true, 'A - acute'],
+	['&Acirc;',   '&#194;',  true, 'A - circumflex'],
+	['&Atilde;',  '&#195;',  true, 'A - tilde'],
+	['&Auml;',    '&#196;',  true, 'A - diaeresis'],
+	['&Aring;',   '&#197;',  true, 'A - ring above'],
+	['&AElig;',   '&#198;',  true, 'ligature AE'],
+	['&Ccedil;',  '&#199;',  true, 'C - cedilla'],
+	['&Egrave;',  '&#200;',  true, 'E - grave'],
+	['&Eacute;',  '&#201;',  true, 'E - acute'],
+	['&Ecirc;',   '&#202;',  true, 'E - circumflex'],
+	['&Euml;',    '&#203;',  true, 'E - diaeresis'],
+	['&Igrave;',  '&#204;',  true, 'I - grave'],
+	['&Iacute;',  '&#205;',  true, 'I - acute'],
+	['&Icirc;',   '&#206;',  true, 'I - circumflex'],
+	['&Iuml;',    '&#207;',  true, 'I - diaeresis'],
+	['&ETH;',     '&#208;',  true, 'ETH'],
+	['&Ntilde;',  '&#209;',  true, 'N - tilde'],
+	['&Ograve;',  '&#210;',  true, 'O - grave'],
+	['&Oacute;',  '&#211;',  true, 'O - acute'],
+	['&Ocirc;',   '&#212;',  true, 'O - circumflex'],
+	['&Otilde;',  '&#213;',  true, 'O - tilde'],
+	['&Ouml;',    '&#214;',  true, 'O - diaeresis'],
+	['&Oslash;',  '&#216;',  true, 'O - slash'],
+	['&OElig;',   '&#338;',  true, 'ligature OE'],
+	['&Scaron;',  '&#352;',  true, 'S - caron'],
+	['&Ugrave;',  '&#217;',  true, 'U - grave'],
+	['&Uacute;',  '&#218;',  true, 'U - acute'],
+	['&Ucirc;',   '&#219;',  true, 'U - circumflex'],
+	['&Uuml;',    '&#220;',  true, 'U - diaeresis'],
+	['&Yacute;',  '&#221;',  true, 'Y - acute'],
+	['&Yuml;',    '&#376;',  true, 'Y - diaeresis'],
+	['&THORN;',   '&#222;',  true, 'THORN'],
+	['&agrave;',  '&#224;',  true, 'a - grave'],
+	['&aacute;',  '&#225;',  true, 'a - acute'],
+	['&acirc;',   '&#226;',  true, 'a - circumflex'],
+	['&atilde;',  '&#227;',  true, 'a - tilde'],
+	['&auml;',    '&#228;',  true, 'a - diaeresis'],
+	['&aring;',   '&#229;',  true, 'a - ring above'],
+	['&aelig;',   '&#230;',  true, 'ligature ae'],
+	['&ccedil;',  '&#231;',  true, 'c - cedilla'],
+	['&egrave;',  '&#232;',  true, 'e - grave'],
+	['&eacute;',  '&#233;',  true, 'e - acute'],
+	['&ecirc;',   '&#234;',  true, 'e - circumflex'],
+	['&euml;',    '&#235;',  true, 'e - diaeresis'],
+	['&igrave;',  '&#236;',  true, 'i - grave'],
+	['&iacute;',  '&#237;',  true, 'i - acute'],
+	['&icirc;',   '&#238;',  true, 'i - circumflex'],
+	['&iuml;',    '&#239;',  true, 'i - diaeresis'],
+	['&eth;',     '&#240;',  true, 'eth'],
+	['&ntilde;',  '&#241;',  true, 'n - tilde'],
+	['&ograve;',  '&#242;',  true, 'o - grave'],
+	['&oacute;',  '&#243;',  true, 'o - acute'],
+	['&ocirc;',   '&#244;',  true, 'o - circumflex'],
+	['&otilde;',  '&#245;',  true, 'o - tilde'],
+	['&ouml;',    '&#246;',  true, 'o - diaeresis'],
+	['&oslash;',  '&#248;',  true, 'o slash'],
+	['&oelig;',   '&#339;',  true, 'ligature oe'],
+	['&scaron;',  '&#353;',  true, 's - caron'],
+	['&ugrave;',  '&#249;',  true, 'u - grave'],
+	['&uacute;',  '&#250;',  true, 'u - acute'],
+	['&ucirc;',   '&#251;',  true, 'u - circumflex'],
+	['&uuml;',    '&#252;',  true, 'u - diaeresis'],
+	['&yacute;',  '&#253;',  true, 'y - acute'],
+	['&thorn;',   '&#254;',  true, 'thorn'],
+	['&yuml;',    '&#255;',  true, 'y - diaeresis'],
+    ['&Alpha;',   '&#913;',  true, 'Alpha'],
+	['&Beta;',    '&#914;',  true, 'Beta'],
+	['&Gamma;',   '&#915;',  true, 'Gamma'],
+	['&Delta;',   '&#916;',  true, 'Delta'],
+	['&Epsilon;', '&#917;',  true, 'Epsilon'],
+	['&Zeta;',    '&#918;',  true, 'Zeta'],
+	['&Eta;',     '&#919;',  true, 'Eta'],
+	['&Theta;',   '&#920;',  true, 'Theta'],
+	['&Iota;',    '&#921;',  true, 'Iota'],
+	['&Kappa;',   '&#922;',  true, 'Kappa'],
+	['&Lambda;',  '&#923;',  true, 'Lambda'],
+	['&Mu;',      '&#924;',  true, 'Mu'],
+	['&Nu;',      '&#925;',  true, 'Nu'],
+	['&Xi;',      '&#926;',  true, 'Xi'],
+	['&Omicron;', '&#927;',  true, 'Omicron'],
+	['&Pi;',      '&#928;',  true, 'Pi'],
+	['&Rho;',     '&#929;',  true, 'Rho'],
+	['&Sigma;',   '&#931;',  true, 'Sigma'],
+	['&Tau;',     '&#932;',  true, 'Tau'],
+	['&Upsilon;', '&#933;',  true, 'Upsilon'],
+	['&Phi;',     '&#934;',  true, 'Phi'],
+	['&Chi;',     '&#935;',  true, 'Chi'],
+	['&Psi;',     '&#936;',  true, 'Psi'],
+	['&Omega;',   '&#937;',  true, 'Omega'],
+	['&alpha;',   '&#945;',  true, 'alpha'],
+	['&beta;',    '&#946;',  true, 'beta'],
+	['&gamma;',   '&#947;',  true, 'gamma'],
+	['&delta;',   '&#948;',  true, 'delta'],
+	['&epsilon;', '&#949;',  true, 'epsilon'],
+	['&zeta;',    '&#950;',  true, 'zeta'],
+	['&eta;',     '&#951;',  true, 'eta'],
+	['&theta;',   '&#952;',  true, 'theta'],
+	['&iota;',    '&#953;',  true, 'iota'],
+	['&kappa;',   '&#954;',  true, 'kappa'],
+	['&lambda;',  '&#955;',  true, 'lambda'],
+	['&mu;',      '&#956;',  true, 'mu'],
+	['&nu;',      '&#957;',  true, 'nu'],
+	['&xi;',      '&#958;',  true, 'xi'],
+	['&omicron;', '&#959;',  true, 'omicron'],
+	['&pi;',      '&#960;',  true, 'pi'],
+	['&rho;',     '&#961;',  true, 'rho'],
+	['&sigmaf;',  '&#962;',  true, 'final sigma'],
+	['&sigma;',   '&#963;',  true, 'sigma'],
+	['&tau;',     '&#964;',  true, 'tau'],
+	['&upsilon;', '&#965;',  true, 'upsilon'],
+	['&phi;',     '&#966;',  true, 'phi'],
+	['&chi;',     '&#967;',  true, 'chi'],
+	['&psi;',     '&#968;',  true, 'psi'],
+	['&omega;',   '&#969;',  true, 'omega'],
+// symbols
+	['&alefsym;', '&#8501;', false,'alef symbol'],
+	['&piv;',     '&#982;',  false,'pi symbol'],
+	['&real;',    '&#8476;', false,'real part symbol'],
+	['&thetasym;','&#977;',  false,'theta symbol'],
+	['&upsih;',   '&#978;',  false,'upsilon - hook symbol'],
+	['&weierp;',  '&#8472;', false,'Weierstrass p'],
+	['&image;',   '&#8465;', false,'imaginary part'],
+// arrows
+	['&larr;',    '&#8592;', true, 'leftwards arrow'],
+	['&uarr;',    '&#8593;', true, 'upwards arrow'],
+	['&rarr;',    '&#8594;', true, 'rightwards arrow'],
+	['&darr;',    '&#8595;', true, 'downwards arrow'],
+	['&harr;',    '&#8596;', true, 'left right arrow'],
+	['&crarr;',   '&#8629;', false,'carriage return'],
+	['&lArr;',    '&#8656;', false,'leftwards double arrow'],
+	['&uArr;',    '&#8657;', false,'upwards double arrow'],
+	['&rArr;',    '&#8658;', false,'rightwards double arrow'],
+	['&dArr;',    '&#8659;', false,'downwards double arrow'],
+	['&hArr;',    '&#8660;', false,'left right double arrow'],
+	['&there4;',  '&#8756;', false,'therefore'],
+	['&sub;',     '&#8834;', false,'subset of'],
+	['&sup;',     '&#8835;', false,'superset of'],
+	['&nsub;',    '&#8836;', false,'not a subset of'],
+	['&sube;',    '&#8838;', false,'subset of or equal to'],
+	['&supe;',    '&#8839;', false,'superset of or equal to'],
+	['&oplus;',   '&#8853;', false,'circled plus'],
+	['&otimes;',  '&#8855;', false,'circled times'],
+	['&perp;',    '&#8869;', false,'perpendicular'],
+	['&sdot;',    '&#8901;', false,'dot operator'],
+	['&lceil;',   '&#8968;', false,'left ceiling'],
+	['&rceil;',   '&#8969;', false,'right ceiling'],
+	['&lfloor;',  '&#8970;', false,'left floor'],
+	['&rfloor;',  '&#8971;', false,'right floor'],
+	['&lang;',    '&#9001;', false,'left-pointing angle bracket'],
+	['&rang;',    '&#9002;', false,'right-pointing angle bracket'],
+	['&loz;',     '&#9674;', true,'lozenge'],
+	['&spades;',  '&#9824;', false,'black spade suit'],
+	['&clubs;',   '&#9827;', true, 'black club suit'],
+	['&hearts;',  '&#9829;', true, 'black heart suit'],
+	['&diams;',   '&#9830;', true, 'black diamond suit'],
+	['&ensp;',    '&#8194;', false,'en space'],
+	['&emsp;',    '&#8195;', false,'em space'],
+	['&thinsp;',  '&#8201;', false,'thin space'],
+	['&zwnj;',    '&#8204;', false,'zero width non-joiner'],
+	['&zwj;',     '&#8205;', false,'zero width joiner'],
+	['&lrm;',     '&#8206;', false,'left-to-right mark'],
+	['&rlm;',     '&#8207;', false,'right-to-left mark'],
+	['&shy;',     '&#173;',  false,'soft hyphen']
+];
+
+function renderCharMapHTML() {
+	var charsPerRow = 20, tdWidth=20, tdHeight=20;
+	var html = '<table border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + '"><tr height="' + tdHeight + '">';
+	var cols=-1;
+	for (var i=0; i<charmap.length; i++) {
+		if (charmap[i][2]==true) {
+			cols++;
+			html += ''
+				+ '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap"'
+				+ ' onmouseover="this.className=\'charmapOver\';'
+				+ 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');"'
+				+ ' onmouseout="this.className=\'charmap\';"'
+				+ ' nowrap="nowrap" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');"><a style="text-decoration: none;" onfocus="previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');" href="javascript:insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
+				+ charmap[i][1]
+				+ '</a></td>';
+			if ((cols+1) % charsPerRow == 0)
+				html += '</tr><tr height="' + tdHeight + '">';
+		}
+	 }
+	if (cols % charsPerRow > 0) {
+		var padd = charsPerRow - (cols % charsPerRow);
+		for (var i=0; i<padd-1; i++)
+			html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap">&nbsp;</td>';
+	}
+	html += '</tr></table>';
+	document.write(html);
+}
+
+function insertChar(chr) {
+	tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');
+
+	// Refocus in window
+	if (tinyMCEPopup.isWindow)
+		window.focus();
+
+	tinyMCEPopup.close();
+}
+
+function previewChar(codeA, codeB, codeN) {
+	var elmA = document.getElementById('codeA');
+	var elmB = document.getElementById('codeB');
+	var elmV = document.getElementById('codeV');
+	var elmN = document.getElementById('codeN');
+
+	if (codeA=='#160;') {
+		elmV.innerHTML = '__';
+	} else {
+		elmV.innerHTML = '&' + codeA;
+	}
+
+	elmB.innerHTML = '&amp;' + codeA;
+	elmA.innerHTML = '&amp;' + codeB;
+	elmN.innerHTML = codeN;
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/color_picker.js 75/e107_handlers/tiny_mce/themes/advanced/jscripts/color_picker.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/color_picker.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/jscripts/color_picker.js	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,108 @@
+function init() {
+	if (tinyMCE.isMSIE)
+		tinyMCEPopup.resizeToInnerSize();
+}
+
+function selectColor() {
+	var color = document.getElementById("selectedColorBox").value;
+
+	tinyMCEPopup.execCommand(tinyMCE.getWindowArg('command'), false, color);
+	tinyMCEPopup.close();
+}
+
+function showColor(color) {
+	document.getElementById("selectedColor").style.backgroundColor = color;
+	document.getElementById("selectedColorBox").value = color;
+}
+
+var colors = new Array(
+	"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
+	"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
+	"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
+	"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
+	"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
+	"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
+	"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
+	"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
+	"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
+	"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
+	"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
+	"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
+	"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
+	"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
+	"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
+	"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
+	"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
+	"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
+	"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
+	"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
+	"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
+	"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
+	"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
+	"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
+	"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
+	"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
+	"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
+);
+
+function convertRGBToHex(col) {
+	var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+	var rgb = col.replace(re, "$1,$2,$3").split(',');
+	if (rgb.length == 3) {
+		r = parseInt(rgb[0]).toString(16);
+		g = parseInt(rgb[1]).toString(16);
+		b = parseInt(rgb[2]).toString(16);
+
+		r = r.length == 1 ? '0' + r : r;
+		g = g.length == 1 ? '0' + g : g;
+		b = b.length == 1 ? '0' + b : b;
+
+		return "#" + r + g + b;
+	}
+
+	return col;
+}
+
+function convertHexToRGB(col) {
+	if (col.indexOf('#') != -1) {
+		col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+		r = parseInt(col.substring(0, 2), 16);
+		g = parseInt(col.substring(2, 4), 16);
+		b = parseInt(col.substring(4, 6), 16);
+
+		return "rgb(" + r + "," + g + "," + b + ")";
+	}
+
+	return col;
+}
+
+function renderColorMap() {
+	var html = "";
+	var inputColor = convertRGBToHex(tinyMCE.getWindowArg('input_color'));
+
+	html += '<table border="0" cellspacing="1" cellpadding="0">'
+		+ '<tr>';
+	for (var i=0; i<colors.length; i++) {
+		html += '<td bgcolor="' + colors[i] + '">'
+			+ '<a href="javascript:selectColor();" onfocus="showColor(\'' + colors[i] +  '\');" onmouseover="showColor(\'' + colors[i] +  '\');">'
+			+ '<img border="0" src="images/spacer.gif" width="10" height="10" title="' + colors[i] +  '" alt="' + colors[i] +  '" /></a></td>';
+		if ((i+1) % 18 == 0)
+			html += '</tr><tr>';
+	}
+	html += '<tr><td colspan="18">'
+		+ '<table width="100%" border="0" cellspacing="0" cellpadding="0">'
+		+ '<tr><td>'
+		+ '<img id="selectedColor" style="background-color:' + tinyMCE.getWindowArg('input_color') + '" border="0" src="images/spacer.gif" width="80" height="16" />'
+		+ '</td><td align="right">'
+		+ '<input id="selectedColorBox" name="selectedColorBox" type="text" size="7" maxlength="7" style="width:65px" value="' + inputColor + '" />'
+		+ '</td></tr>'
+		+ '</table>'
+		+ '<div style="float: left"><input type="button" id="insert" name="insert" value="{$lang_theme_colorpicker_apply}" style="margin-top:3px" onclick="selectColor();"></div>'
+		+ '<div style="float: right"><input type="button" name="cancel" value="{$lang_cancel}" style="margin-top:3px" onclick="tinyMCEPopup.close();" id="cancel" /></div>'
+		+ '</td></tr>'
+		+ '</table>';
+
+	document.write(html);
+}
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/image.js 75/e107_handlers/tiny_mce/themes/advanced/jscripts/image.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/image.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/jscripts/image.js	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,81 @@
+var url = tinyMCE.getParam("external_image_list_url");
+if (url != null) {
+	// Fix relative
+	if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+		url = tinyMCE.documentBasePath + "/" + url;
+
+	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+}
+
+function insertImage() {
+	var src = document.forms[0].src.value;
+	var alt = document.forms[0].alt.value;
+	var border = document.forms[0].border.value;
+	var vspace = document.forms[0].vspace.value;
+	var hspace = document.forms[0].hspace.value;
+	var width = document.forms[0].width.value;
+	var height = document.forms[0].height.value;
+	var align = document.forms[0].align.options[document.forms[0].align.selectedIndex].value;
+
+	tinyMCEPopup.restoreSelection();
+	tinyMCE.themes['advanced']._insertImage(src, alt, border, hspace, vspace, width, height, align);
+	tinyMCEPopup.close();
+}
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
+
+	var formObj = document.forms[0];
+
+	for (var i=0; i<document.forms[0].align.options.length; i++) {
+		if (document.forms[0].align.options[i].value == tinyMCE.getWindowArg('align'))
+			document.forms[0].align.options.selectedIndex = i;
+	}
+
+	formObj.src.value = tinyMCE.getWindowArg('src');
+	formObj.alt.value = tinyMCE.getWindowArg('alt');
+	formObj.border.value = tinyMCE.getWindowArg('border');
+	formObj.vspace.value = tinyMCE.getWindowArg('vspace');
+	formObj.hspace.value = tinyMCE.getWindowArg('hspace');
+	formObj.width.value = tinyMCE.getWindowArg('width');
+	formObj.height.value = tinyMCE.getWindowArg('height');
+	formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); 
+
+	// Handle file browser
+	if (isVisible('srcbrowser'))
+		document.getElementById('src').style.width = '180px';
+
+	// Auto select image in list
+	if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
+		for (var i=0; i<formObj.image_list.length; i++) {
+			if (formObj.image_list.options[i].value == tinyMCE.getWindowArg('src'))
+				formObj.image_list.options[i].selected = true;
+		}
+	}
+}
+
+var preloadImg = new Image();
+
+function resetImageData() {
+	var formObj = document.forms[0];
+	formObj.width.value = formObj.height.value = "";	
+}
+
+function updateImageData() {
+	var formObj = document.forms[0];
+
+	if (formObj.width.value == "")
+		formObj.width.value = preloadImg.width;
+
+	if (formObj.height.value == "")
+		formObj.height.value = preloadImg.height;
+}
+
+function getImageData() {
+	preloadImg = new Image();
+	tinyMCE.addEvent(preloadImg, "load", updateImageData);
+	tinyMCE.addEvent(preloadImg, "error", function () {var formObj = document.forms[0];formObj.width.value = formObj.height.value = "";});
+	preloadImg.src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], document.forms[0].src.value);
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/link.js 75/e107_handlers/tiny_mce/themes/advanced/jscripts/link.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/link.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/jscripts/link.js	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,70 @@
+var url = tinyMCE.getParam("external_link_list_url");
+if (url != null) {
+	// Fix relative
+	if (url.charAt(0) != '/' && url.indexOf('://') == -1)
+		url = tinyMCE.documentBasePath + "/" + url;
+
+	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></sc'+'ript>');
+}
+
+function init() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','theme_advanced_link');
+
+	// Handle file browser
+	if (isVisible('hrefbrowser'))
+		document.getElementById('href').style.width = '180px';
+
+	var formObj = document.forms[0];
+
+	for (var i=0; i<document.forms[0].target.options.length; i++) {
+		var option = document.forms[0].target.options[i];
+
+		if (option.value == tinyMCE.getWindowArg('target'))
+			option.selected = true;
+	}
+
+	document.forms[0].href.value = tinyMCE.getWindowArg('href');
+	document.forms[0].linktitle.value = tinyMCE.getWindowArg('title');
+	document.forms[0].insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('action'), 'Insert', true); 
+
+	addClassesToList('styleSelect', 'theme_advanced_link_styles');
+	selectByValue(formObj, 'styleSelect', tinyMCE.getWindowArg('className'), true);
+
+	// Hide css select row if no CSS classes
+	if (formObj.styleSelect && formObj.styleSelect.options.length <= 1) {
+		var sr = document.getElementById('styleSelectRow');
+		sr.style.display = 'none';
+		sr.parentNode.removeChild(sr);
+	}
+
+	// Auto select link in list
+	if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0) {
+		var formObj = document.forms[0];
+
+		for (var i=0; i<formObj.link_list.length; i++) {
+			if (formObj.link_list.options[i].value == tinyMCE.getWindowArg('href'))
+				formObj.link_list.options[i].selected = true;
+		}
+	}
+}
+
+function insertLink() {
+	var href = document.forms[0].href.value;
+	var target = document.forms[0].target.options[document.forms[0].target.selectedIndex].value;
+	var title = document.forms[0].linktitle.value;
+	var style_class = document.forms[0].styleSelect ? document.forms[0].styleSelect.value : "";
+	var dummy;
+
+	// Make anchors absolute
+	if (href.charAt(0) == '#')
+		href = tinyMCE.settings['document_base_url'] + href;
+
+	if (target == '_self')
+		target = '';
+
+	tinyMCEPopup.restoreSelection();
+	tinyMCE.themes['advanced']._insertLink(href, target, title, dummy, style_class);
+	tinyMCEPopup.close();
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/source_editor.js 75/e107_handlers/tiny_mce/themes/advanced/jscripts/source_editor.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/jscripts/source_editor.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/jscripts/source_editor.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,66 @@
+function saveContent() {
+	tinyMCE.setContent(document.getElementById('htmlSource').value);
+	tinyMCE.closeWindow(window);
+}
+
+// Fixes some charcode issues
+function fixContent(html) {
+/*	html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1');
+	html = html.replace(new RegExp('<\/(p|ol|ul|li|table|tr|td|blockquote|object)>', 'gi'),'</$1>\n');
+	html = tinyMCE.regexpReplace(html, '<br />','<br />\n','gi');
+	html = tinyMCE.regexpReplace(html, '\n\n','\n','gi');*/
+	return html;
+}
+
+function onLoadInit() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	document.forms[0].htmlSource.value = fixContent(tinyMCE.getContent(tinyMCE.getWindowArg('editor_id')));
+	resizeInputs();
+
+	if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) {
+		setWrap('soft');
+		document.forms[0].wraped.checked = true;
+	}
+}
+
+function setWrap(val) {
+	var s = document.forms[0].htmlSource;
+
+	s.wrap = val;
+
+	if (tinyMCE.isGecko) {
+		var v = s.value;
+		var n = s.cloneNode(false);
+		n.setAttribute("wrap", val);
+		s.parentNode.replaceChild(n, s);
+		n.value = v;
+	}
+}
+
+function toggleWordWrap(elm) {
+	if (elm.checked)
+		setWrap('soft');
+	else
+		setWrap('off');
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function resizeInputs() {
+	if (!tinyMCE.isMSIE) {
+		 wHeight = self.innerHeight-80;
+		 wWidth = self.innerWidth-16;
+	} else {
+		 wHeight = document.body.clientHeight - 80;
+		 wWidth = document.body.clientWidth - 16;
+	}
+
+	document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
+	document.forms[0].htmlSource.style.width  = Math.abs(wWidth) + 'px';
+}
+
+function renderWordWrap() {
+	if (tinyMCE.isMSIE || tinyMCE.isGecko)
+		document.write('<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{$lang_theme_code_wordwrap}</label>');
+}
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/langs/en.js 75/e107_handlers/tiny_mce/themes/advanced/langs/en.js
--- 6171/e107_handlers/tiny_mce/themes/advanced/langs/en.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/langs/en.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,81 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+theme_style_select : '-- Styles --',
+theme_code_desc : 'Edit HTML Source',
+theme_code_title : 'HTML Source Editor',
+theme_code_wordwrap : 'Word wrap',
+theme_sub_desc : 'Subscript',
+theme_sup_desc : 'Superscript',
+theme_hr_desc : 'Insert horizontal ruler',
+theme_removeformat_desc : 'Remove formatting',
+theme_custom1_desc : 'Your custom description here',
+insert_image_border : 'Border',
+insert_image_dimensions : 'Dimensions',
+insert_image_vspace : 'Vertical space',
+insert_image_hspace : 'Horizontal space',
+insert_image_align : 'Alignment',
+insert_image_align_default : '-- Not set --',
+insert_image_align_baseline : 'Baseline',
+insert_image_align_top : 'Top',
+insert_image_align_middle : 'Middle',
+insert_image_align_bottom : 'Bottom',
+insert_image_align_texttop : 'TextTop',
+insert_image_align_absmiddle : 'Absolute Middle',
+insert_image_align_absbottom : 'Absolute Bottom',
+insert_image_align_left : 'Left',
+insert_image_align_right : 'Right',
+theme_font_size : '-- Font size --',
+theme_fontdefault : '-- Font family --',
+theme_block : '-- Format --',
+theme_paragraph : 'Paragraph',
+theme_div : 'Div',
+theme_address : 'Address',
+theme_pre : 'Preformatted',
+theme_h1 : 'Heading 1',
+theme_h2 : 'Heading 2',
+theme_h3 : 'Heading 3',
+theme_h4 : 'Heading 4',
+theme_h5 : 'Heading 5',
+theme_h6 : 'Heading 6',
+theme_blockquote : 'Blockquote',
+theme_code : 'Code',
+theme_samp : 'Code sample',
+theme_dt : 'Definition term ',
+theme_dd : 'Definition description',
+theme_colorpicker_title : 'Select a color',
+theme_colorpicker_apply : 'Apply',
+theme_forecolor_desc : 'Select text color',
+theme_backcolor_desc : 'Select background color',
+theme_charmap_title : 'Select custom character',
+theme_charmap_desc : 'Insert custom character',
+theme_visualaid_desc : 'Toggle guidelines/invisible elements',
+insert_anchor_title : 'Insert/edit anchor',
+insert_anchor_name : 'Anchor name',
+theme_anchor_desc : 'Insert/edit anchor',
+theme_insert_link_titlefield : 'Title',
+theme_clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
+theme_path : 'Path',
+cut_desc : 'Cut',
+copy_desc : 'Copy',
+paste_desc : 'Paste',
+link_list : 'Link list',
+image_list : 'Image list',
+browse : 'Browse',
+image_props_desc : 'Image properties',
+newdocument_desc : 'New document',
+class_name : 'Class',
+newdocument : 'Are you sure you want clear all contents?',
+about_title : 'About TinyMCE',
+about : 'About',
+license : 'License',
+plugins : 'Plugins',
+plugin : 'Plugin',
+author : 'Author',
+version : 'Version',
+loaded_plugins : 'Loaded plugins',
+help : 'Help',
+not_set : '-- Not set --',
+close : 'Close',
+toolbar_focus : 'Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X'
+});
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/link.htm 75/e107_handlers/tiny_mce/themes/advanced/link.htm
--- 6171/e107_handlers/tiny_mce/themes/advanced/link.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/link.htm	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,100 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{$lang_insert_link_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script language="javascript" type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/link.js"></script>
+	<base target="_self" />
+</head>
+<body id="link" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
+<form onsubmit="insertLink();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{$lang_insert_link_title}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+
+		<table border="0" cellpadding="4" cellspacing="0">
+          <tr>
+            <td nowrap="nowrap"><label for="href">{$lang_insert_link_url}</label></td>
+            <td><table border="0" cellspacing="0" cellpadding="0"> 
+				  <tr> 
+					<td><input id="href" name="href" type="text" value="" style="width: 200px" /></td> 
+					<td id="hrefbrowsercontainer">&nbsp;</td>
+				  </tr> 
+				</table></td>
+          </tr>
+		  <!-- Link list -->
+		  <script language="javascript">
+			if (typeof(tinyMCELinkList) != "undefined" && tinyMCELinkList.length > 0) {
+				var html = "";
+
+				html += '<tr><td><label for="link_list">{$lang_link_list}</label></td>';
+				html += '<td><select id="link_list" name="link_list" style="width: 200px" onchange="this.form.href.value=this.options[this.selectedIndex].value;">';
+				html += '<option value="">---</option>';
+
+				for (var i=0; i<tinyMCELinkList.length; i++)
+					html += '<option value="' + tinyMCELinkList[i][1] + '">' + tinyMCELinkList[i][0] + '</option>';
+
+				html += '</select></td></tr>';
+
+				document.write(html);
+			}
+		  </script>
+		  <!-- /Link list -->
+          <tr>
+            <td nowrap="nowrap"><label for="target">{$lang_insert_link_target}</label></td>
+            <td><select id="target" name="target" style="width: 200px">
+                <option value="_self">{$lang_insert_link_target_same}</option>
+                <option value="_blank">{$lang_insert_link_target_blank}</option>
+				<script language="javascript">
+					var html = "";
+					var targets = tinyMCE.getParam('theme_advanced_link_targets', '').split(';');
+
+					for (var i=0; i<targets.length; i++) {
+						var key, value;
+
+						if (targets[i] == "")
+							continue;
+
+						key = targets[i].split('=')[0];
+						value = targets[i].split('=')[1];
+
+						html += '<option value="' + value + '">' + key + '</option>';
+					}
+
+					document.write(html);
+				</script>
+            </select></td>
+          </tr>
+          <tr>
+            <td nowrap="nowrap"><label for="linktitle">{$lang_theme_insert_link_titlefield}</label></td>
+            <td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px"></td>
+          </tr>
+          <tr id="styleSelectRow">
+            <td><label for="styleSelect">{$lang_class_name}</label></td>
+            <td>
+			 <select id="styleSelect" name="styleSelect">
+                <option value="" selected>{$lang_theme_style_select}</option>
+             </select></td>
+          </tr>
+        </table>
+		</div>
+	</div>
+
+	<div class="mceActionPanel">
+		<div style="float: left">
+			<input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="insertLink();" />
+		</div>
+
+		<div style="float: right">
+			<input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/themes/advanced/source_editor.htm 75/e107_handlers/tiny_mce/themes/advanced/source_editor.htm
--- 6171/e107_handlers/tiny_mce/themes/advanced/source_editor.htm	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/themes/advanced/source_editor.htm	2006-03-02 23:07:12.000000000 -0600
@@ -0,0 +1,30 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+	<title>{$lang_theme_code_title}</title>
+	<script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script language="javascript" type="text/javascript" src="jscripts/source_editor.js"></script>
+	<base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('onLoadInit();');" onresize="resizeInputs();" style="display: none">
+	<form name="source" onsubmit="saveContent();" action="#">
+		<div style="float: left" class="title">{$lang_theme_code_title}</div>
+
+		<div style="float: right">
+			<script language="javascript" type="text/javascript">renderWordWrap();</script>
+		</div>
+
+		<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px" dir="ltr" wrap="off"></textarea>
+
+		<div class="mceActionPanel">
+			<div style="float: left">
+				<input type="button" name="insert" value="{$lang_update}" onclick="saveContent();" id="insert" />
+			</div>
+
+			<div style="float: right">
+				<input type="button" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+			</div>
+		</div>
+	</form>
+</body>
+</html>
diff -ruN 6171/e107_handlers/tiny_mce/tiny_mce_gzip.php 75/e107_handlers/tiny_mce/tiny_mce_gzip.php
--- 6171/e107_handlers/tiny_mce/tiny_mce_gzip.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/tiny_mce_gzip.php	2006-03-02 23:07:11.000000000 -0600
@@ -0,0 +1,229 @@
+<?php
+/**
+ * $RCSfile: tiny_mce_gzip.php,v $
+ * $Revision: 1.2 $
+ * $Date: 2006/03/03 05:07:11 $
+ *
+ * @version 1.07
+ * @author Moxiecode
+ * @copyright Copyright  20052006, Moxiecode Systems AB, All rights reserved.
+ *
+ * This file compresses the TinyMCE JavaScript using GZip and
+ * enables the browser to do two requests instead of one for each .js file.
+ * Notice: This script defaults the button_tile_map option to true for extra performance.
+ */
+
+// General options
+$suffix = "";							// Set to "_src" to use source version
+$expiresOffset = 3600 * 24 * 10;		// 10 days util client cache expires
+$diskCache = false;						// If you enable this option gzip files will be cached on disk.
+$cacheDir = realpath(".");				// Absolute directory path to where cached gz files will be stored
+$debug = false;							// Enable this option if you need debuging info
+
+// Headers
+header("Content-type: text/javascript; charset: UTF-8");
+// header("Cache-Control: must-revalidate");
+header("Vary: Accept-Encoding"); // Handle proxies
+header("Expires: " . gmdate("D, d M Y H:i:s", time() + $expiresOffset) . " GMT");
+
+// Get data to load
+$theme = isset($_GET['theme']) ? TinyMCE_cleanInput($_GET['theme']) : "";
+$language = isset($_GET['language']) ? TinyMCE_cleanInput($_GET['language']) : "";
+$plugins = isset($_GET['plugins']) ? TinyMCE_cleanInput($_GET['plugins']) : "";
+$lang = isset($_GET['lang']) ? TinyMCE_cleanInput($_GET['lang']) : "en";
+$index = isset($_GET['index']) ? TinyMCE_cleanInput($_GET['index']) : -1;
+$cacheKey = md5($theme . $language . $plugins . $lang . $index . $debug);
+$cacheFile = $cacheDir == "" ? "" : $cacheDir . "/" . "tinymce_" .  $cacheKey . ".gz";
+$cacheData = "";
+
+// Patch older versions of PHP < 4.3.0
+if (!function_exists('file_get_contents')) {
+	function file_get_contents($filename) {
+		$fd = fopen($filename, 'rb');
+		$content = fread($fd, filesize($filename));
+		fclose($fd);
+		return $content;
+	}
+}
+
+// Security check function, can only contain a-z 0-9 , _ - and whitespace.
+function TinyMCE_cleanInput($str) {
+	return preg_replace("/[^0-9a-z\-_,]+/i", "", $str); // Remove anything but 0-9,a-z,-_
+}
+
+function TinyMCE_echo($str) {
+	global $cacheData, $diskCache;
+
+	if ($diskCache)
+		$cacheData .= $str;
+	else
+		echo $str;
+}
+
+// Only gzip the contents if clients and server support it
+$encodings = array();
+
+if (isset($_SERVER['HTTP_ACCEPT_ENCODING']))
+	$encodings = explode(',', strtolower(preg_replace("/\s+/", "", $_SERVER['HTTP_ACCEPT_ENCODING'])));
+
+// Check for gzip header or northon internet securities
+if ((in_array('gzip', $encodings) || isset($_SERVER['---------------'])) && function_exists('ob_gzhandler') && !ini_get('zlib.output_compression')) {
+	// Use cached file if it exists but not in debug mode
+	if (file_exists($cacheFile) && !$debug) {
+		header("Content-Encoding: gzip");
+		echo file_get_contents($cacheFile);
+		die;
+	}
+
+	if (!$diskCache)
+		ob_start("ob_gzhandler");
+} else
+	$diskCache = false;
+
+if ($index > -1) {
+	// Write main script and patch some things
+	if ($index == 0) {
+		TinyMCE_echo(file_get_contents(realpath("tiny_mce" . $suffix . ".js")));
+		TinyMCE_echo('TinyMCE.prototype.loadScript = function() {};var realTinyMCE = tinyMCE;');
+	} else
+		TinyMCE_echo('tinyMCE = realTinyMCE;');
+
+	// Do init based on index
+	TinyMCE_echo("tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);");
+
+	// Load theme, language pack and theme language packs
+	if ($theme) {
+		TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/editor_template" . $suffix . ".js")));
+		TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/langs/" . $lang . ".js")));
+	}
+
+	if ($language)
+		TinyMCE_echo(file_get_contents(realpath("langs/" . $language . ".js")));
+
+	// Load all plugins and their language packs
+	$plugins = explode(",", $plugins);
+	foreach ($plugins as $plugin) {
+		$pluginFile = realpath("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js");
+		$languageFile = realpath("plugins/" . $plugin . "/langs/" . $lang . ".js");
+
+		if ($pluginFile)
+			TinyMCE_echo(file_get_contents($pluginFile));
+
+		if ($languageFile)
+			TinyMCE_echo(file_get_contents($languageFile));
+	}
+
+	// Reset tinyMCE compressor engine
+	TinyMCE_echo("tinyMCE = tinyMCECompressed;");
+
+	// Write to cache
+	if ($diskCache) {
+		// Calculate compression ratio and debug target output path
+		if ($debug) {
+			$ratio = round(100 - strlen(gzencode($cacheData, 9, FORCE_GZIP)) / strlen($cacheData) * 100.0);
+			TinyMCE_echo("alert('TinyMCE was compressed by " . $ratio . "%.\\nOutput cache file: " . $cacheFile . "');");
+		}
+
+		$cacheData = gzencode($cacheData, 9, FORCE_GZIP);
+
+		// Write to file if possible
+		$fp = @fopen($cacheFile, "wb");
+		if ($fp) {
+			fwrite($fp, $cacheData);
+			fclose($fp);
+		}
+
+		// Output
+		header("Content-Encoding: gzip");
+		echo $cacheData;
+	}
+
+	die;
+}
+?>
+
+function TinyMCECompressed() {
+	this.configs = new Array();
+	this.loadedFiles = new Array();
+	this.loadAdded = false;
+	this.isLoaded = false;
+}
+
+TinyMCECompressed.prototype.init = function(settings) {
+	var elements = document.getElementsByTagName('script');
+	var scriptURL = "";
+
+	for (var i=0; i<elements.length; i++) {
+		if (elements[i].src && elements[i].src.indexOf("tiny_mce_gzip.php") != -1) {
+			scriptURL = elements[i].src;
+			break;
+		}
+	}
+
+	settings["theme"] = typeof(settings["theme"]) != "undefined" ? settings["theme"] : "default";
+	settings["plugins"] = typeof(settings["plugins"]) != "undefined" ? settings["plugins"] : "";
+	settings["language"] = typeof(settings["language"]) != "undefined" ? settings["language"] : "en";
+	settings["button_tile_map"] = typeof(settings["button_tile_map"]) != "undefined" ? settings["button_tile_map"] : true;
+	this.configs[this.configs.length] = settings;
+	this.settings = settings;
+
+	scriptURL += "?theme=" + escape(this.getOnce(settings["theme"])) + "&language=" + escape(this.getOnce(settings["language"])) + "&plugins=" + escape(this.getOnce(settings["plugins"])) + "&lang=" + settings["language"] + "&index=" + escape(this.configs.length-1);
+	document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + scriptURL + '"></script>');
+
+	if (!this.loadAdded) {
+		tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCECompressed.prototype.onLoad);
+		tinyMCE.addEvent(window, "load", TinyMCECompressed.prototype.onLoad);
+		this.loadAdded = true;
+	}
+}
+
+TinyMCECompressed.prototype.onLoad = function() {
+	if (tinyMCE.isLoaded)
+		return true;
+
+	tinyMCE = realTinyMCE;
+	TinyMCE_Engine.prototype.onLoad();
+	tinyMCE._addUnloadEvents();
+	tinyMCE.isLoaded = true;
+}
+
+TinyMCECompressed.prototype.addEvent = function(o, n, h) {
+	if (o.attachEvent)
+		o.attachEvent("on" + n, h);
+	else
+		o.addEventListener(n, h, false);
+}
+
+TinyMCECompressed.prototype.getOnce = function(str) {
+	var ar = str.split(',');
+
+	for (var i=0; i<ar.length; i++) {
+		if (ar[i] == '')
+			continue;
+
+		// Skip load
+		for (var x=0; x<this.loadedFiles.length; x++) {
+			if (this.loadedFiles[x] == ar[i])
+				ar[i] = null;
+		}
+
+		this.loadedFiles[this.loadedFiles.length] = ar[i];
+	}
+
+	// Glue
+	str = "";
+	for (var i=0; i<ar.length; i++) {
+		if (ar[i] == null)
+			continue;
+
+		str += ar[i];
+
+		if (i != ar.length-1)
+			str += ",";
+	}
+
+	return str;
+}
+
+var tinyMCE = new TinyMCECompressed();
+var tinyMCECompressed = tinyMCE;
diff -ruN 6171/e107_handlers/tiny_mce/tiny_mce.js 75/e107_handlers/tiny_mce/tiny_mce.js
--- 6171/e107_handlers/tiny_mce/tiny_mce.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/tiny_mce.js	2006-05-05 22:05:14.000000000 -0500
@@ -0,0 +1 @@
+function TinyMCE_Engine(){this.majorVersion="2";this.minorVersion="0.6.1";this.releaseDate="2006-05-04";this.instances=new Array();this.switchClassCache=new Array();this.windowArgs=new Array();this.loadedFiles=new Array();this.pendingFiles=new Array();this.loadingIndex=0;this.configs=new Array();this.currentConfig=0;this.eventHandlers=new Array();var ua=navigator.userAgent;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(ua.indexOf('MSIE 5')!=-1);this.isMSIE5_0=this.isMSIE&&(ua.indexOf('MSIE 5.0')!=-1);this.isGecko=ua.indexOf('Gecko')!=-1;this.isSafari=ua.indexOf('Safari')!=-1;this.isOpera=ua.indexOf('Opera')!=-1;this.isMac=ua.indexOf('Mac')!=-1;this.isNS7=ua.indexOf('Netscape/7')!=-1;this.isNS71=ua.indexOf('Netscape/7.1')!=-1;this.dialogCounter=0;this.plugins=new Array();this.themes=new Array();this.menus=new Array();this.loadedPlugins=new Array();this.buttonMap=new Array();this.isLoaded=false;if(this.isOpera){this.isMSIE=true;this.isGecko=false;this.isSafari=false;}this.idCounter=0;};TinyMCE_Engine.prototype={init:function(settings){var theme;this.settings=settings;if(typeof(document.execCommand)=='undefined')return;if(!tinyMCE.baseURL){var elements=document.getElementsByTagName('script');for(var i=0;i<elements.length;i++){if(elements[i].src&&(elements[i].src.indexOf("tiny_mce.js")!=-1||elements[i].src.indexOf("tiny_mce_dev.js")!=-1||elements[i].src.indexOf("tiny_mce_src.js")!=-1||elements[i].src.indexOf("tiny_mce_gzip")!=-1)){var src=elements[i].src;tinyMCE.srcMode=(src.indexOf('_src')!=-1||src.indexOf('_dev')!=-1)?'_src':'';tinyMCE.gzipMode=src.indexOf('_gzip')!=-1;src=src.substring(0,src.lastIndexOf('/'));if(settings.exec_mode=="src"||settings.exec_mode=="normal")tinyMCE.srcMode=settings.exec_mode=="src"?'_src':'';tinyMCE.baseURL=src;break;}}}this.documentBasePath=document.location.href;if(this.documentBasePath.indexOf('?')!=-1)this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.indexOf('?'));this.documentURL=this.documentBasePath;this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.lastIndexOf('/'));if(tinyMCE.baseURL.indexOf('://')==-1&&tinyMCE.baseURL.charAt(0)!='/'){tinyMCE.baseURL=this.documentBasePath+"/"+tinyMCE.baseURL;}this._def("mode","none");this._def("theme","advanced");this._def("plugins","",true);this._def("language","en");this._def("docs_language",this.settings['language']);this._def("elements","");this._def("textarea_trigger","mce_editable");this._def("editor_selector","");this._def("editor_deselector","mceNoEditor");this._def("valid_elements","+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang]");this._def("extended_valid_elements","");this._def("invalid_elements","");this._def("encoding","");this._def("urlconverter_callback",tinyMCE.getParam("urlconvertor_callback","TinyMCE_Engine.prototype.convertURL"));this._def("save_callback","");this._def("debug",false);this._def("force_br_newlines",false);this._def("force_p_newlines",true);this._def("add_form_submit_trigger",true);this._def("relative_urls",true);this._def("remove_script_host",true);this._def("focus_alert",true);this._def("document_base_url",this.documentURL);this._def("visual",true);this._def("visual_table_class","mceVisualAid");this._def("setupcontent_callback","");this._def("fix_content_duplication",true);this._def("custom_undo_redo",true);this._def("custom_undo_redo_levels",-1);this._def("custom_undo_redo_keyboard_shortcuts",true);this._def("custom_undo_redo_restore_selection",true);this._def("verify_html",true);this._def("apply_source_formatting",false);this._def("directionality","ltr");this._def("cleanup_on_startup",false);this._def("inline_styles",false);this._def("convert_newlines_to_brs",false);this._def("auto_reset_designmode",true);this._def("entities","39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",true);this._def("entity_encoding","named");this._def("cleanup_callback","");this._def("add_unload_trigger",true);this._def("ask",false);this._def("nowrap",false);this._def("auto_resize",false);this._def("auto_focus",false);this._def("cleanup",true);this._def("remove_linebreaks",true);this._def("button_tile_map",false);this._def("submit_patch",true);this._def("browsers","msie,safari,gecko,opera",true);this._def("dialog_type","window");this._def("accessibility_warnings",true);this._def("accessibility_focus",true);this._def("merge_styles_invalid_parents","");this._def("force_hex_style_colors",true);this._def("trim_span_elements",true);this._def("convert_fonts_to_spans",false);this._def("doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');this._def("font_size_classes",'');this._def("font_size_style_values",'xx-small,x-small,small,medium,large,x-large,xx-large',true);this._def("event_elements",'a,img',true);this._def("convert_urls",true);this._def("table_inline_editing",false);this._def("object_resizing",true);this._def("custom_shortcuts",true);this._def("convert_on_click",false);this._def("content_css",'');this._def("fix_list_elements",false);this._def("fix_table_elements",false);this._def("strict_loading_mode",document.contentType=='application/xhtml+xml');this._def("hidden_tab_class",'');this._def("display_tab_class",'');if(this.isMSIE&&!this.isOpera)this.settings.strict_loading_mode=false;if(this.isMSIE&&this.settings['browsers'].indexOf('msie')==-1)return;if(this.isGecko&&this.settings['browsers'].indexOf('gecko')==-1)return;if(this.isSafari&&this.settings['browsers'].indexOf('safari')==-1)return;if(this.isOpera&&this.settings['browsers'].indexOf('opera')==-1)return;var baseHREF=tinyMCE.settings['document_base_url'];var h=document.location.href;var p=h.indexOf('://');if(p>0&&document.location.protocol!="file:"){p=h.indexOf('/',p+3);h=h.substring(0,p);if(baseHREF.indexOf('://')==-1)baseHREF=h+baseHREF;tinyMCE.settings['document_base_url']=baseHREF;tinyMCE.settings['document_base_prefix']=h;}if(baseHREF.indexOf('?')!=-1)baseHREF=baseHREF.substring(0,baseHREF.indexOf('?'));this.settings['base_href']=baseHREF.substring(0,baseHREF.lastIndexOf('/'))+"/";theme=this.settings['theme'];this.blockRegExp=new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dt|dd|dir|fieldset|form|noscript|noframes|menu|isindex|samp)$","i");this.posKeyCodes=new Array(13,45,36,35,33,34,37,38,39,40);this.uniqueURL='javascript:TINYMCE_UNIQUEURL();';this.uniqueTag='<div id="mceTMPElement" style="display: none">TMP</div>';this.callbacks=new Array('onInit','getInfo','getEditorTemplate','setupContent','onChange','onPageLoad','handleNodeChange','initInstance','execCommand','getControlHTML','handleEvent','cleanup');this.settings['theme_href']=tinyMCE.baseURL+"/themes/"+theme;if(!tinyMCE.isMSIE)this.settings['force_br_newlines']=false;if(tinyMCE.getParam("popups_css",false)){var cssPath=tinyMCE.getParam("popups_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['popups_css']=this.documentBasePath+"/"+cssPath;else this.settings['popups_css']=cssPath;}else this.settings['popups_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_popup.css";if(tinyMCE.getParam("editor_css",false)){var cssPath=tinyMCE.getParam("editor_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['editor_css']=this.documentBasePath+"/"+cssPath;else this.settings['editor_css']=cssPath;}else this.settings['editor_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_ui.css";if(tinyMCE.settings['debug']){var msg="Debug: \n";msg+="baseURL: "+this.baseURL+"\n";msg+="documentBasePath: "+this.documentBasePath+"\n";msg+="content_css: "+this.settings['content_css']+"\n";msg+="popups_css: "+this.settings['popups_css']+"\n";msg+="editor_css: "+this.settings['editor_css']+"\n";alert(msg);}if(this.configs.length==0){if(this.isSafari&&this.getParam('safari_warning',false))alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false");if(typeof(TinyMCECompressed)=="undefined"){tinyMCE.addEvent(window,"DOMContentLoaded",TinyMCE_Engine.prototype.onLoad);if(tinyMCE.isMSIE&&!tinyMCE.isOpera){if(document.body)tinyMCE.addEvent(document.body,"readystatechange",TinyMCE_Engine.prototype.onLoad);else tinyMCE.addEvent(document,"readystatechange",TinyMCE_Engine.prototype.onLoad);}tinyMCE.addEvent(window,"load",TinyMCE_Engine.prototype.onLoad);tinyMCE._addUnloadEvents();}}this.loadScript(tinyMCE.baseURL+'/themes/'+this.settings['theme']+'/editor_template'+tinyMCE.srcMode+'.js');this.loadScript(tinyMCE.baseURL+'/langs/'+this.settings['language']+'.js');this.loadCSS(this.settings['editor_css']);var p=tinyMCE.getParam('plugins','',true,',');if(p.length>0){for(var i=0;i<p.length;i++){if(p[i].charAt(0)!='-')this.loadScript(tinyMCE.baseURL+'/plugins/'+p[i]+'/editor_plugin'+tinyMCE.srcMode+'.js');}}settings['cleanup_entities']=new Array();var entities=tinyMCE.getParam('entities','',true,',');for(var i=0;i<entities.length;i+=2)settings['cleanup_entities']['c'+entities[i]]=entities[i+1];settings['index']=this.configs.length;this.configs[this.configs.length]=settings;this.loadNextScript();},_addUnloadEvents:function(){if(tinyMCE.isMSIE){if(tinyMCE.settings['add_unload_trigger']){tinyMCE.addEvent(window,"unload",TinyMCE_Engine.prototype.unloadHandler);tinyMCE.addEvent(window.document,"beforeunload",TinyMCE_Engine.prototype.unloadHandler);}}else{if(tinyMCE.settings['add_unload_trigger'])tinyMCE.addEvent(window,"unload",function(){tinyMCE.triggerSave(true,true);});}},_def:function(key,def_val,t){var v=tinyMCE.getParam(key,def_val);v=t?v.replace(/\s+/g,""):v;this.settings[key]=v;},hasPlugin:function(n){return typeof(this.plugins[n])!="undefined"&&this.plugins[n]!=null;},addPlugin:function(n,p){var op=this.plugins[n];p.baseURL=op?op.baseURL:tinyMCE.baseURL+"/plugins/"+n;this.plugins[n]=p;this.loadNextScript();},setPluginBaseURL:function(n,u){var op=this.plugins[n];if(op)op.baseURL=u;else this.plugins[n]={baseURL:u};},loadPlugin:function(n,u){u=u.indexOf('.js')!=-1?u.substring(0,u.lastIndexOf('/')):u;u=u.charAt(u.length-1)=='/'?u.substring(0,u.length-1):u;this.plugins[n]={baseURL:u};this.loadScript(u+"/editor_plugin"+(tinyMCE.srcMode?'_src':'')+".js");},hasTheme:function(n){return typeof(this.themes[n])!="undefined"&&this.themes[n]!=null;},addTheme:function(n,t){this.themes[n]=t;this.loadNextScript();},addMenu:function(n,m){this.menus[n]=m;},hasMenu:function(n){return typeof(this.plugins[n])!="undefined"&&this.plugins[n]!=null;},loadScript:function(url){var i;for(i=0;i<this.loadedFiles.length;i++){if(this.loadedFiles[i]==url)return;}if(tinyMCE.settings.strict_loading_mode)this.pendingFiles[this.pendingFiles.length]=url;else document.write('<sc'+'ript language="javascript" type="text/javascript" src="'+url+'"></script>');this.loadedFiles[this.loadedFiles.length]=url;},loadNextScript:function(){var d=document,se;if(!tinyMCE.settings.strict_loading_mode)return;if(this.loadingIndex<this.pendingFiles.length){se=d.createElementNS('http://www.w3.org/1999/xhtml','script');se.setAttribute('language','javascript');se.setAttribute('type','text/javascript');se.setAttribute('src',this.pendingFiles[this.loadingIndex++]);d.getElementsByTagName("head")[0].appendChild(se);}else this.loadingIndex=-1;},loadCSS:function(url){var ar=url.replace(/\s+/,'').split(',');var lflen=0,csslen=0;var skip=false;var x=0,i=0,nl,le;for(x=0,csslen=ar.length;x<csslen;x++){ignore_css=false;if(ar[x]!=null&&ar[x]!='null'&&ar[x].length>0){for(i=0,lflen=this.loadedFiles.length;i<lflen;i++){if(this.loadedFiles[i]==ar[x]){skip=true;break;}}if(!skip){if(tinyMCE.settings.strict_loading_mode){nl=document.getElementsByTagName("head");le=document.createElement('link');le.setAttribute('href',ar[x]);le.setAttribute('rel','stylesheet');le.setAttribute('type','text/css');nl[0].appendChild(le);}else document.write('<link href="'+ar[x]+'" rel="stylesheet" type="text/css" />');this.loadedFiles[this.loadedFiles.length]=ar[x];}}}},importCSS:function(doc,css){var css_ary=css.replace(/\s+/,'').split(',');var csslen,elm,headArr,x,css_file;for(x=0,csslen=css_ary.length;x<csslen;x++){css_file=css_ary[x];if(css_file!=null&&css_file!='null'&&css_file.length>0){if(css_file.indexOf('://')==-1&&css_file.charAt(0)!='/')css_file=this.documentBasePath+"/"+css_file;if(typeof(doc.createStyleSheet)=="undefined"){elm=doc.createElement("link");elm.rel="stylesheet";elm.href=css_file;if((headArr=doc.getElementsByTagName("head"))!=null&&headArr.length>0)headArr[0].appendChild(elm);}else doc.createStyleSheet(css_file);}}},confirmAdd:function(e,settings){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var elementId=elm.name?elm.name:elm.id;tinyMCE.settings=settings;if(tinyMCE.settings['convert_on_click']||(!elm.getAttribute('mce_noask')&&confirm(tinyMCELang['lang_edit_confirm'])))tinyMCE.addMCEControl(elm,elementId);elm.setAttribute('mce_noask','true');},updateContent:function(form_element_name){var formElement=document.getElementById(form_element_name);for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();if(inst.formElement==formElement){var doc=inst.getDoc();tinyMCE._setHTML(doc,inst.formElement.value);if(!tinyMCE.isMSIE)doc.body.innerHTML=tinyMCE._cleanupHTML(inst,doc,this.settings,doc.body,inst.visualAid);}}},addMCEControl:function(replace_element,form_element_name,target_document){var id="mce_editor_"+tinyMCE.idCounter++;var inst=new TinyMCE_Control(tinyMCE.settings);inst.editorId=id;this.instances[id]=inst;inst._onAdd(replace_element,form_element_name,target_document);},removeMCEControl:function(editor_id){var inst=tinyMCE.getInstanceById(editor_id);if(inst){inst.switchSettings();editor_id=inst.editorId;var html=tinyMCE.getContent(editor_id);var tmpInstances=new Array();for(var instanceName in tinyMCE.instances){var instance=tinyMCE.instances[instanceName];if(!tinyMCE.isInstance(instance))continue;if(instanceName!=editor_id)tmpInstances[instanceName]=instance;}tinyMCE.instances=tmpInstances;tinyMCE.selectedElement=null;tinyMCE.selectedInstance=null;var replaceElement=document.getElementById(editor_id+"_parent");var oldTargetElement=inst.oldTargetElement;var targetName=oldTargetElement.nodeName.toLowerCase();if(targetName=="textarea"||targetName=="input"){replaceElement.parentNode.removeChild(replaceElement);oldTargetElement.style.display="inline";oldTargetElement.value=html;}else{oldTargetElement.innerHTML=html;oldTargetElement.style.display='block';replaceElement.parentNode.insertBefore(oldTargetElement,replaceElement);replaceElement.parentNode.removeChild(replaceElement);}}},triggerSave:function(skip_cleanup,skip_callback){var inst,n;if(typeof(skip_cleanup)=="undefined")skip_cleanup=false;if(typeof(skip_callback)=="undefined")skip_callback=false;for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.triggerSave(skip_cleanup,skip_callback);}},resetForm:function(form_index){var i,inst,n,formObj=document.forms[form_index];for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();for(i=0;i<formObj.elements.length;i++){if(inst.formTargetElementId==formObj.elements[i].name)inst.getBody().innerHTML=inst.startContent;}}},execInstanceCommand:function(editor_id,command,user_interface,value,focus){var inst=tinyMCE.getInstanceById(editor_id);if(inst){if(typeof(focus)=="undefined")focus=true;if(focus)inst.contentWindow.focus();inst.autoResetDesignMode();this.selectedElement=inst.getFocusElement();this.selectedInstance=inst;tinyMCE.execCommand(command,user_interface,value);if(tinyMCE.isMSIE&&window.event!=null)tinyMCE.cancelEvent(window.event);}},execCommand:function(command,user_interface,value){user_interface=user_interface?user_interface:false;value=value?value:null;if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();switch(command){case'mceHelp':tinyMCE.openWindow({file:'about.htm',width:480,height:380},{tinymce_version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion,tinymce_releasedate:tinyMCE.releaseDate,inline:"yes"});return;case'mceFocus':var inst=tinyMCE.getInstanceById(value);if(inst)inst.contentWindow.focus();return;case"mceAddControl":case"mceAddEditor":tinyMCE.addMCEControl(tinyMCE._getElementById(value),value);return;case"mceAddFrameControl":tinyMCE.addMCEControl(tinyMCE._getElementById(value['element'],value['document']),value['element'],value['document']);return;case"mceRemoveControl":case"mceRemoveEditor":tinyMCE.removeMCEControl(value);return;case"mceResetDesignMode":if(!tinyMCE.isMSIE){for(var n in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[n]))continue;try{tinyMCE.instances[n].getDoc().designMode="on";}catch(e){}}}return;}if(this.selectedInstance){this.selectedInstance.execCommand(command,user_interface,value);}else if(tinyMCE.settings['focus_alert'])alert(tinyMCELang['lang_focus_alert']);},_createIFrame:function(replace_element,doc,win){var iframe,id=replace_element.getAttribute("id");var aw,ah;if(typeof(doc)=="undefined")doc=document;if(typeof(win)=="undefined")win=window;iframe=doc.createElement("iframe");aw=""+tinyMCE.settings['area_width'];ah=""+tinyMCE.settings['area_height'];if(aw.indexOf('%')==-1){aw=parseInt(aw);aw=aw<0?300:aw;aw=aw+"px";}if(ah.indexOf('%')==-1){ah=parseInt(ah);ah=ah<0?240:ah;ah=ah+"px";}iframe.setAttribute("id",id);iframe.setAttribute("class","mceEditorIframe");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMargin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",aw);iframe.setAttribute("height",ah);iframe.setAttribute("allowtransparency","true");iframe.className='mceEditorIframe';if(tinyMCE.settings["auto_resize"])iframe.setAttribute("scrolling","no");if(tinyMCE.isMSIE&&!tinyMCE.isOpera)iframe.setAttribute("src",this.settings['default_document']);iframe.style.width=aw;iframe.style.height=ah;if(tinyMCE.settings.strict_loading_mode)iframe.style.marginBottom='-5px';if(tinyMCE.isMSIE&&!tinyMCE.isOpera)replace_element.outerHTML=iframe.outerHTML;else replace_element.parentNode.replaceChild(iframe,replace_element);if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return win.frames[id];else return iframe;},setupContent:function(editor_id){var inst=tinyMCE.instances[editor_id];var doc=inst.getDoc();var head=doc.getElementsByTagName('head').item(0);var content=inst.startContent;if(tinyMCE.settings.strict_loading_mode){content=content.replace(/&lt;/g,'<');content=content.replace(/&gt;/g,'>');content=content.replace(/&quot;/g,'"');content=content.replace(/&amp;/g,'&');}inst.switchSettings();if(!tinyMCE.isMSIE&&tinyMCE.getParam("setupcontent_reload",false)&&doc.title!="blank_page"){try{doc.location.href=tinyMCE.baseURL+"/blank.htm";}catch(ex){}window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",1000);return;}if(!head){window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",10);return;}tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/themes/"+inst.settings['theme']+"/css/editor_content.css");tinyMCE.importCSS(inst.getDoc(),inst.settings['content_css']);tinyMCE.dispatchCallback(inst,'init_instance_callback','initInstance',inst);if(tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')){inst.addShortcut('ctrl','z','lang_undo_desc','Undo');inst.addShortcut('ctrl','y','lang_redo_desc','Redo');}if(tinyMCE.isGecko){inst.addShortcut('ctrl','b','lang_bold_desc','Bold');inst.addShortcut('ctrl','i','lang_italic_desc','Italic');inst.addShortcut('ctrl','u','lang_underline_desc','Underline');}if(tinyMCE.getParam("convert_fonts_to_spans"))inst.getDoc().body.setAttribute('id','mceSpanFonts');if(tinyMCE.settings['nowrap'])doc.body.style.whiteSpace="nowrap";doc.body.dir=this.settings['directionality'];doc.editorId=editor_id;if(!tinyMCE.isMSIE)doc.documentElement.editorId=editor_id;inst.setBaseHREF(tinyMCE.settings['base_href']);if(tinyMCE.settings['convert_newlines_to_brs']){content=tinyMCE.regexpReplace(content,"\r\n","<br />","gi");content=tinyMCE.regexpReplace(content,"\r","<br />","gi");content=tinyMCE.regexpReplace(content,"\n","<br />","gi");}content=tinyMCE.storeAwayURLs(content);content=tinyMCE._customCleanup(inst,"insert_to_editor",content);if(tinyMCE.isMSIE){window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["'+editor_id+'"].getDoc(), "'+editor_id+'");}catch(e){}',500);if(tinyMCE.settings["force_br_newlines"])doc.styleSheets[0].addRule("p","margin: 0;");var body=inst.getBody();body.editorId=editor_id;}content=tinyMCE.cleanupHTMLCode(content);if(!tinyMCE.isMSIE){var contentElement=inst.getDoc().createElement("body");var doc=inst.getDoc();contentElement.innerHTML=content;if(tinyMCE.isGecko&&tinyMCE.settings['remove_lt_gt'])content=content.replace(new RegExp('&lt;&gt;','g'),"");if(tinyMCE.settings['cleanup_on_startup'])tinyMCE.setInnerHTML(inst.getBody(),tinyMCE._cleanupHTML(inst,doc,this.settings,contentElement));else{content=tinyMCE.regexpReplace(content,"<strong","<b","gi");content=tinyMCE.regexpReplace(content,"<em(/?)>","<i$1>","gi");content=tinyMCE.regexpReplace(content,"<em ","<i ","gi");content=tinyMCE.regexpReplace(content,"</strong>","</b>","gi");content=tinyMCE.regexpReplace(content,"</em>","</i>","gi");tinyMCE.setInnerHTML(inst.getBody(),content);}tinyMCE.convertAllRelativeURLs(inst.getBody());}else{if(tinyMCE.settings['cleanup_on_startup']){tinyMCE._setHTML(inst.getDoc(),content);eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}');}else tinyMCE._setHTML(inst.getDoc(),content);}var parentElm=inst.targetDoc.getElementById(inst.editorId+'_parent');inst.formElement=tinyMCE.isGecko?parentElm.previousSibling:parentElm.nextSibling;tinyMCE.handleVisualAid(inst.getBody(),true,tinyMCE.settings['visual'],inst);tinyMCE.dispatchCallback(inst,'setupcontent_callback','setupContent',editor_id,inst.getBody(),inst.getDoc());if(!tinyMCE.isMSIE)tinyMCE.addEventHandlers(inst);if(tinyMCE.isMSIE){tinyMCE.addEvent(inst.getBody(),"blur",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(inst.getBody(),"beforedeactivate",TinyMCE_Engine.prototype._eventPatch);if(!tinyMCE.isOpera){tinyMCE.addEvent(doc.body,"mousemove",TinyMCE_Engine.prototype.onMouseMove);tinyMCE.addEvent(doc.body,"beforepaste",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc.body,"drop",TinyMCE_Engine.prototype._eventPatch);}}tinyMCE.selectedInstance=inst;tinyMCE.selectedElement=inst.contentWindow.document.body;tinyMCE._customCleanup(inst,"insert_to_editor_dom",inst.getBody());tinyMCE._customCleanup(inst,"setup_content_dom",inst.getBody());tinyMCE._setEventsEnabled(inst.getBody(),false);tinyMCE.cleanupAnchors(inst.getDoc());if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(inst.getDoc());inst.startContent=tinyMCE.trim(inst.getBody().innerHTML);inst.undoRedo.add({content:inst.startContent});if(tinyMCE.isGecko){tinyMCE.selectNodes(inst.getBody(),function(n){if(n.nodeType==3||n.nodeType==8){n.nodeValue=n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"','gi'),"");n.nodeValue=n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"','gi'),"");}return false;});}tinyMCE._removeInternal(inst.getBody());tinyMCE.selectedInstance=inst;tinyMCE.triggerNodeChange(false,true);},storeAwayURLs:function(s){if(!s.match(/(mce_src|mce_href)/gi,s)){s=s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"','gi'),'src="$1" mce_src="$1"');s=s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"','gi'),'href="$1" mce_href="$1"');}return s;},_removeInternal:function(n){if(tinyMCE.isGecko){tinyMCE.selectNodes(n,function(n){if(n.nodeType==3||n.nodeType==8){n.nodeValue=n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"','gi'),"");n.nodeValue=n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"','gi'),"");}return false;});}},removeTinyMCEFormElements:function(form_obj){if(typeof(form_obj)=="undefined"||form_obj==null)return;if(form_obj.nodeName!="FORM"){if(form_obj.form)form_obj=form_obj.form;else form_obj=tinyMCE.getParentElement(form_obj,"form");}if(form_obj==null)return;for(var i=0;i<form_obj.elements.length;i++){var elementId=form_obj.elements[i].name?form_obj.elements[i].name:form_obj.elements[i].id;if(elementId.indexOf('mce_editor_')==0)form_obj.elements[i].disabled=true;}},handleEvent:function(e){var inst=tinyMCE.selectedInstance;if(typeof(tinyMCE)=="undefined")return true;if(tinyMCE.executeCallback(tinyMCE.selectedInstance,'handle_event_callback','handleEvent',e))return false;switch(e.type){case"beforedeactivate":case"blur":if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.execCommand('mceEndTyping');tinyMCE.hideMenus();return;case"drop":case"beforepaste":if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.setBaseHREF(null);if(tinyMCE.isMSIE&&!tinyMCE.isOpera){var ife=tinyMCE.selectedInstance.iframeElement;if(ife.style.height.indexOf('%')!=-1){ife._oldHeight=ife.style.height;ife.style.height=ife.clientHeight;}}window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings['base_href']);tinyMCE._resetIframeHeight();",1);return;case"submit":tinyMCE.removeTinyMCEFormElements(tinyMCE.isMSIE?window.event.srcElement:e.target);tinyMCE.triggerSave();tinyMCE.isNotDirty=true;return;case"reset":var formObj=tinyMCE.isMSIE?window.event.srcElement:e.target;for(var i=0;i<document.forms.length;i++){if(document.forms[i]==formObj)window.setTimeout('tinyMCE.resetForm('+i+');',10);}return;case"keypress":if(inst&&inst.handleShortcut(e))return false;if(e.target.editorId){tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];}else{if(e.target.ownerDocument.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.ownerDocument.editorId];}if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&e.keyCode==13&&!e.shiftKey){if(TinyMCE_ForceParagraphs._insertPara(tinyMCE.selectedInstance,e)){tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.cancelEvent(e);return false;}}if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance,e.type)){tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.cancelEvent(e);return false;}}if(tinyMCE.isMSIE&&tinyMCE.settings['force_br_newlines']&&e.keyCode==13){if(e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];if(tinyMCE.selectedInstance){var sel=tinyMCE.selectedInstance.getDoc().selection;var rng=sel.createRange();if(tinyMCE.getParentElement(rng.parentElement(),"li")!=null)return false;e.returnValue=false;e.cancelBubble=true;rng.pasteHTML("<br />");rng.collapse(false);rng.select();tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.triggerNodeChange(false);return false;}}if(e.keyCode==8||e.keyCode==46){tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(e.target,"a");tinyMCE.imgElement=tinyMCE.getParentElement(e.target,"img");tinyMCE.triggerNodeChange(false);}return false;break;case"keyup":case"keydown":tinyMCE.hideMenus();tinyMCE.hasMouseMoved=false;if(inst&&inst.handleShortcut(e))return false;if(e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];else return;if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();var inst=tinyMCE.selectedInstance;if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance,e.type)){tinyMCE.execCommand("mceAddUndoLevel");e.preventDefault();return false;}}tinyMCE.selectedElement=null;tinyMCE.selectedNode=null;var elm=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(elm,"a");tinyMCE.imgElement=tinyMCE.getParentElement(elm,"img");tinyMCE.selectedElement=elm;if(tinyMCE.isGecko&&e.type=="keyup"&&e.keyCode==9)tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(),true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);if(tinyMCE.isMSIE&&e.type=="keydown"&&e.keyCode==13)tinyMCE.enterKeyElement=tinyMCE.selectedInstance.getFocusElement();if(tinyMCE.isMSIE&&e.type=="keyup"&&e.keyCode==13){var elm=tinyMCE.enterKeyElement;if(elm){var re=new RegExp('^HR|IMG|BR$','g');var dre=new RegExp('^H[1-6]$','g');if(!elm.hasChildNodes()&&!re.test(elm.nodeName)){if(dre.test(elm.nodeName))elm.innerHTML="&nbsp;&nbsp;";else elm.innerHTML="&nbsp;";}}}var keys=tinyMCE.posKeyCodes;var posKey=false;for(var i=0;i<keys.length;i++){if(keys[i]==e.keyCode){posKey=true;break;}}if(tinyMCE.isMSIE&&tinyMCE.settings['custom_undo_redo']){var keys=new Array(8,46);for(var i=0;i<keys.length;i++){if(keys[i]==e.keyCode){if(e.type=="keyup")tinyMCE.triggerNodeChange(false);}}}if(e.keyCode==17)return true;if(!posKey&&e.type=="keyup")tinyMCE.execCommand("mceStartTyping");if(e.type=="keydown"&&(posKey||e.ctrlKey)&&inst)inst.undoBookmark=inst.selection.getBookmark();if(e.type=="keyup"&&(posKey||e.ctrlKey))tinyMCE.execCommand("mceEndTyping");if(posKey&&e.type=="keyup")tinyMCE.triggerNodeChange(false);if(tinyMCE.isMSIE&&e.ctrlKey)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);break;case"mousedown":case"mouseup":case"click":case"focus":tinyMCE.hideMenus();if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.switchSettings();tinyMCE.selectedInstance.isFocused=true;}var targetBody=tinyMCE.getParentElement(e.target,"body");for(var instanceName in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[instanceName]))continue;var inst=tinyMCE.instances[instanceName];inst.autoResetDesignMode();if(inst.getBody()==targetBody){tinyMCE.selectedInstance=inst;tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");tinyMCE.imgElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"img");break;}}if(!tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark)tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark=tinyMCE.selectedInstance.selection.getBookmark();if(tinyMCE.isSafari){tinyMCE.selectedInstance.lastSafariSelection=tinyMCE.selectedInstance.selection.getBookmark();tinyMCE.selectedInstance.lastSafariSelectedElement=tinyMCE.selectedElement;var lnk=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");if(lnk&&e.type=="mousedown"){lnk.setAttribute("mce_real_href",lnk.getAttribute("href"));lnk.setAttribute("href","javascript:void(0);");}if(lnk&&e.type=="click"){window.setTimeout(function(){lnk.setAttribute("href",lnk.getAttribute("mce_real_href"));lnk.removeAttribute("mce_real_href");},10);}}if(e.type!="focus")tinyMCE.selectedNode=null;tinyMCE.triggerNodeChange(false);tinyMCE.execCommand("mceEndTyping");if(e.type=="mouseup")tinyMCE.execCommand("mceAddUndoLevel");if(!tinyMCE.selectedInstance&&e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];return false;break;}},getButtonHTML:function(id,lang,img,cmd,ui,val){var h='',m,x;cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+cmd+'\'';if(typeof(ui)!="undefined"&&ui!=null)cmd+=','+ui;if(typeof(val)!="undefined"&&val!=null)cmd+=",'"+val+"'";cmd+=');';if(tinyMCE.getParam('button_tile_map')&&(!tinyMCE.isMSIE||tinyMCE.isOpera)&&(m=this.buttonMap[id])!=null&&(tinyMCE.getParam("language")=="en"||img.indexOf('$lang')==-1)){x=0-(m*20)==0?'0':0-(m*20);h+='<a id="{$editor_id}_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" class="mceTiledButton mceButtonNormal" target="_self">';h+='<img src="{$themeurl}/images/spacer.gif" style="background-position: '+x+'px 0" title="{$'+lang+'}" />';h+='</a>';}else{h+='<a id="{$editor_id}_'+id+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" class="mceButtonNormal" target="_self">';h+='<img src="'+img+'" title="{$'+lang+'}" />';h+='</a>';}return h;},addButtonMap:function(m){var i,a=m.replace(/\s+/,'').split(',');for(i=0;i<a.length;i++)this.buttonMap[a[i]]=i;},submitPatch:function(){tinyMCE.removeTinyMCEFormElements(this);tinyMCE.triggerSave();this.mceOldSubmit();tinyMCE.isNotDirty=true;},onLoad:function(){if(tinyMCE.settings.strict_loading_mode&&this.loadingIndex!=-1){window.setTimeout('tinyMCE.onLoad();',1);return;}if(tinyMCE.isMSIE&&!tinyMCE.isOpera&&window.event.type=="readystatechange"&&document.readyState!="complete")return true;if(tinyMCE.isLoaded)return true;tinyMCE.isLoaded=true;tinyMCE.dispatchCallback(null,'onpageload','onPageLoad');for(var c=0;c<tinyMCE.configs.length;c++){tinyMCE.settings=tinyMCE.configs[c];var selector=tinyMCE.getParam("editor_selector");var deselector=tinyMCE.getParam("editor_deselector");var elementRefAr=new Array();if(document.forms&&tinyMCE.settings['add_form_submit_trigger']&&!tinyMCE.submitTriggers){for(var i=0;i<document.forms.length;i++){var form=document.forms[i];tinyMCE.addEvent(form,"submit",TinyMCE_Engine.prototype.handleEvent);tinyMCE.addEvent(form,"reset",TinyMCE_Engine.prototype.handleEvent);tinyMCE.submitTriggers=true;if(tinyMCE.settings['submit_patch']){try{form.mceOldSubmit=form.submit;form.submit=TinyMCE_Engine.prototype.submitPatch;}catch(e){}}}}var mode=tinyMCE.settings['mode'];switch(mode){case"exact":var elements=tinyMCE.getParam('elements','',true,',');for(var i=0;i<elements.length;i++){var element=tinyMCE._getElementById(elements[i]);var trigger=element?element.getAttribute(tinyMCE.settings['textarea_trigger']):"";if(tinyMCE.getAttrib(element,"class").indexOf(deselector)!=-1)continue;if(trigger=="false")continue;if((tinyMCE.settings['ask']||tinyMCE.settings['convert_on_click'])&&element){elementRefAr[elementRefAr.length]=element;continue;}if(element)tinyMCE.addMCEControl(element,elements[i]);else if(tinyMCE.settings['debug'])alert("Error: Could not find element by id or name: "+elements[i]);}break;case"specific_textareas":case"textareas":var nodeList=document.getElementsByTagName("textarea");for(var i=0;i<nodeList.length;i++){var elm=nodeList.item(i);var trigger=elm.getAttribute(tinyMCE.settings['textarea_trigger']);if(selector!=''&&tinyMCE.getAttrib(elm,"class").indexOf(selector)==-1)continue;if(selector!='')trigger=selector!=""?"true":"";if(tinyMCE.getAttrib(elm,"class").indexOf(deselector)!=-1)continue;if((mode=="specific_textareas"&&trigger=="true")||(mode=="textareas"&&trigger!="false"))elementRefAr[elementRefAr.length]=elm;}break;}for(var i=0;i<elementRefAr.length;i++){var element=elementRefAr[i];var elementId=element.name?element.name:element.id;if(tinyMCE.settings['ask']||tinyMCE.settings['convert_on_click']){if(tinyMCE.isGecko){var settings=tinyMCE.settings;tinyMCE.addEvent(element,"focus",function(e){window.setTimeout(function(){TinyMCE_Engine.prototype.confirmAdd(e,settings);},10);});if(element.nodeName!="TEXTAREA"&&element.nodeName!="INPUT")tinyMCE.addEvent(element,"click",function(e){window.setTimeout(function(){TinyMCE_Engine.prototype.confirmAdd(e,settings);},10);});}else{var settings=tinyMCE.settings;tinyMCE.addEvent(element,"focus",function(){TinyMCE_Engine.prototype.confirmAdd(null,settings);});tinyMCE.addEvent(element,"click",function(){TinyMCE_Engine.prototype.confirmAdd(null,settings);});}}else tinyMCE.addMCEControl(element,elementId);}if(tinyMCE.settings['auto_focus']){window.setTimeout(function(){var inst=tinyMCE.getInstanceById(tinyMCE.settings['auto_focus']);inst.selection.selectNode(inst.getBody(),true,true);inst.contentWindow.focus();},10);}tinyMCE.dispatchCallback(null,'oninit','onInit');}},isInstance:function(o){return o!=null&&typeof(o)=="object"&&o.isTinyMCE_Control;},getParam:function(name,default_value,strip_whitespace,split_chr){var value=(typeof(this.settings[name])=="undefined")?default_value:this.settings[name];if(value=="true"||value=="false")return(value=="true");if(strip_whitespace)value=tinyMCE.regexpReplace(value,"[ \t\r\n]","");if(typeof(split_chr)!="undefined"&&split_chr!=null){value=value.split(split_chr);var outArray=new Array();for(var i=0;i<value.length;i++){if(value[i]&&value[i]!="")outArray[outArray.length]=value[i];}value=outArray;}return value;},getLang:function(name,default_value,parse_entities,va){var v=(typeof(tinyMCELang[name])=="undefined")?default_value:tinyMCELang[name],n;if(parse_entities)v=tinyMCE.entityDecode(v);if(va){for(n in va)v=this.replaceVar(v,n,va[n]);}return v;},entityDecode:function(s){var e=document.createElement("div");e.innerHTML=s;return e.innerHTML;},addToLang:function(prefix,ar){for(var key in ar){if(typeof(ar[key])=='function')continue;tinyMCELang[(key.indexOf('lang_')==-1?'lang_':'')+(prefix!=''?(prefix+"_"):'')+key]=ar[key];}this.loadNextScript();},triggerNodeChange:function(focus,setup_content){if(tinyMCE.selectedInstance){var inst=tinyMCE.selectedInstance;var editorId=inst.editorId;var elm=(typeof(setup_content)!="undefined"&&setup_content)?tinyMCE.selectedElement:inst.getFocusElement();var undoIndex=-1;var undoLevels=-1;var anySelection=false;var selectedText=inst.selection.getSelectedText();if(setup_content&&tinyMCE.isGecko&&inst.isHidden())elm=inst.getBody();inst.switchSettings();if(tinyMCE.settings["auto_resize"]){var doc=inst.getDoc();inst.iframeElement.style.width=doc.body.offsetWidth+"px";inst.iframeElement.style.height=doc.body.offsetHeight+"px";}if(tinyMCE.selectedElement)anySelection=(tinyMCE.selectedElement.nodeName.toLowerCase()=="img")||(selectedText&&selectedText.length>0);if(tinyMCE.settings['custom_undo_redo']){undoIndex=inst.undoRedo.undoIndex;undoLevels=inst.undoRedo.undoLevels.length;}tinyMCE.dispatchCallback(inst,'handle_node_change_callback','handleNodeChange',editorId,elm,undoIndex,undoLevels,inst.visualAid,anySelection,setup_content);}if(this.selectedInstance&&(typeof(focus)=="undefined"||focus))this.selectedInstance.contentWindow.focus();},_customCleanup:function(inst,type,content){var pl,po,i;var customCleanup=tinyMCE.settings['cleanup_callback'];if(customCleanup!=""&&eval("typeof("+customCleanup+")")!="undefined")content=eval(customCleanup+"(type, content, inst);");pl=inst.plugins;for(i=0;i<pl.length;i++){po=tinyMCE.plugins[pl[i]];if(po&&po.cleanup)content=po.cleanup(type,content,inst);}return content;},setContent:function(h){if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.execCommand('mceSetContent',false,h);tinyMCE.selectedInstance.repaint();}},importThemeLanguagePack:function(name){if(typeof(name)=="undefined")name=tinyMCE.settings['theme'];tinyMCE.loadScript(tinyMCE.baseURL+'/themes/'+name+'/langs/'+tinyMCE.settings['language']+'.js');},importPluginLanguagePack:function(name,valid_languages){var lang="en",b=tinyMCE.baseURL+'/plugins/'+name;valid_languages=valid_languages.split(',');for(var i=0;i<valid_languages.length;i++){if(tinyMCE.settings['language']==valid_languages[i])lang=tinyMCE.settings['language'];}if(this.plugins[name])b=this.plugins[name].baseURL;tinyMCE.loadScript(b+'/langs/'+lang+'.js');},applyTemplate:function(h,as){var i,s,ar=h.match(new RegExp('\\{\\$[a-z0-9_]+\\}','gi'));if(ar&&ar.length>0){for(i=ar.length-1;i>=0;i--){s=ar[i].substring(2,ar[i].length-1);if(s.indexOf('lang_')==0&&tinyMCELang[s])h=tinyMCE.replaceVar(h,s,tinyMCELang[s]);else if(as&&as[s])h=tinyMCE.replaceVar(h,s,as[s]);else if(tinyMCE.settings[s])h=tinyMCE.replaceVar(h,s,tinyMCE.settings[s]);}}h=tinyMCE.replaceVar(h,"themeurl",tinyMCE.themeURL);return h;},replaceVar:function(h,r,v){return h.replace(new RegExp('{\\\$'+r+'}','g'),v);},openWindow:function(template,args){var html,width,height,x,y,resizable,scrollbars,url;args['mce_template_file']=template['file'];args['mce_width']=template['width'];args['mce_height']=template['height'];tinyMCE.windowArgs=args;html=template['html'];if(!(width=parseInt(template['width'])))width=320;if(!(height=parseInt(template['height'])))height=200;if(tinyMCE.isMSIE)height+=40;else height+=20;x=parseInt(screen.width/2.0)-(width/2.0);y=parseInt(screen.height/2.0)-(height/2.0);resizable=(args&&args['resizable'])?args['resizable']:"no";scrollbars=(args&&args['scrollbars'])?args['scrollbars']:"no";if(template['file'].charAt(0)!='/'&&template['file'].indexOf('://')==-1)url=tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/"+template['file'];else url=template['file'];for(var name in args){if(typeof(args[name])=='function')continue;url=tinyMCE.replaceVar(url,name,escape(args[name]));}if(html){html=tinyMCE.replaceVar(html,"css",this.settings['popups_css']);html=tinyMCE.applyTemplate(html,args);var win=window.open("","mcePopup"+new Date().getTime(),"top="+y+",left="+x+",scrollbars="+scrollbars+",dialog=yes,minimizable="+resizable+",modal=yes,width="+width+",height="+height+",resizable="+resizable);if(win==null){alert(tinyMCELang['lang_popup_blocked']);return;}win.document.write(html);win.document.close();win.resizeTo(width,height);win.focus();}else{if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&resizable!='yes'&&tinyMCE.settings["dialog_type"]=="modal"){height+=10;var features="resizable:"+resizable+";scroll:"+scrollbars+";status:yes;center:yes;help:no;dialogWidth:"+width+"px;dialogHeight:"+height+"px;";window.showModalDialog(url,window,features);}else{var modal=(resizable=="yes")?"no":"yes";if(tinyMCE.isGecko&&tinyMCE.isMac)modal="no";if(template['close_previous']!="no")try{tinyMCE.lastWindow.close();}catch(ex){}var win=window.open(url,"mcePopup"+new Date().getTime(),"top="+y+",left="+x+",scrollbars="+scrollbars+",dialog="+modal+",minimizable="+resizable+",modal="+modal+",width="+width+",height="+height+",resizable="+resizable);if(win==null){alert(tinyMCELang['lang_popup_blocked']);return;}if(template['close_previous']!="no")tinyMCE.lastWindow=win;eval('try { win.resizeTo(width, height); } catch(e) { }');if(tinyMCE.isGecko){if(win.document.defaultView.statusbar.visible)win.resizeBy(0,tinyMCE.isMac?10:24);}win.focus();}}},closeWindow:function(win){win.close();},getVisualAidClass:function(class_name,state){var aidClass=tinyMCE.settings['visual_table_class'];if(typeof(state)=="undefined")state=tinyMCE.settings['visual'];var classNames=new Array();var ar=class_name.split(' ');for(var i=0;i<ar.length;i++){if(ar[i]==aidClass)ar[i]="";if(ar[i]!="")classNames[classNames.length]=ar[i];}if(state)classNames[classNames.length]=aidClass;var className="";for(var i=0;i<classNames.length;i++){if(i>0)className+=" ";className+=classNames[i];}return className;},handleVisualAid:function(el,deep,state,inst,skip_dispatch){if(!el)return;if(!skip_dispatch)tinyMCE.dispatchCallback(inst,'handle_visual_aid_callback','handleVisualAid',el,deep,state,inst);var tableElement=null;switch(el.nodeName){case"TABLE":var oldW=el.style.width;var oldH=el.style.height;var bo=tinyMCE.getAttrib(el,"border");bo=bo==""||bo=="0"?true:false;tinyMCE.setAttrib(el,"class",tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el,"class"),state&&bo));el.style.width=oldW;el.style.height=oldH;for(var y=0;y<el.rows.length;y++){for(var x=0;x<el.rows[y].cells.length;x++){var cn=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el.rows[y].cells[x],"class"),state&&bo);tinyMCE.setAttrib(el.rows[y].cells[x],"class",cn);}}break;case"A":var anchorName=tinyMCE.getAttrib(el,"name");if(anchorName!=''&&state){el.title=anchorName;el.className='mceItemAnchor';}else if(anchorName!=''&&!state)el.className='';break;}if(deep&&el.hasChildNodes()){for(var i=0;i<el.childNodes.length;i++)tinyMCE.handleVisualAid(el.childNodes[i],deep,state,inst,true);}},fixGeckoBaseHREFBug:function(m,e,h){var nl,i,a,n,xsrc,xhref,el;if(tinyMCE.isGecko){if(m==1){h=h.replace(/\ssrc=/gi," mce_tsrc=");h=h.replace(/\shref=/gi," mce_thref=");return h;}else{el=new Array('a','img','select','area','iframe','base','input','script','embed','object','link');for(a=0;a<el.length;a++){n=e.getElementsByTagName(el[a]);for(i=0;i<n.length;i++){xsrc=tinyMCE.getAttrib(n[i],"mce_tsrc");xhref=tinyMCE.getAttrib(n[i],"mce_thref");if(xsrc!=""){try{n[i].src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],xsrc);}catch(e){}n[i].removeAttribute("mce_tsrc");}if(xhref!=""){try{n[i].href=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],xhref);}catch(e){}n[i].removeAttribute("mce_thref");}}}el=tinyMCE.selectNodes(e,function(n){if(n.nodeType==3||n.nodeType==8){n.nodeValue=n.nodeValue.replace(/\smce_tsrc=/gi," src=");n.nodeValue=n.nodeValue.replace(/\smce_thref=/gi," href=");}return false;});}}return h;},_setHTML:function(doc,html_content){html_content=tinyMCE.cleanupHTMLCode(html_content);try{tinyMCE.setInnerHTML(doc.body,html_content);}catch(e){if(this.isMSIE)doc.body.createTextRange().pasteHTML(html_content);}if(tinyMCE.isMSIE&&tinyMCE.settings['fix_content_duplication']){var paras=doc.getElementsByTagName("P");for(var i=0;i<paras.length;i++){var node=paras[i];while((node=node.parentNode)!=null){if(node.nodeName=="P")node.outerHTML=node.innerHTML;}}var html=doc.body.innerHTML;tinyMCE.setInnerHTML(doc.body,html);}tinyMCE.cleanupAnchors(doc);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);},getEditorId:function(form_element){var inst=this.getInstanceById(form_element);if(!inst)return null;return inst.editorId;},getInstanceById:function(editor_id){var inst=this.instances[editor_id];if(!inst){for(var n in tinyMCE.instances){var instance=tinyMCE.instances[n];if(!tinyMCE.isInstance(instance))continue;if(instance.formTargetElementId==editor_id){inst=instance;break;}}}return inst;},queryInstanceCommandValue:function(editor_id,command){var inst=tinyMCE.getInstanceById(editor_id);if(inst)return inst.queryCommandValue(command);return false;},queryInstanceCommandState:function(editor_id,command){var inst=tinyMCE.getInstanceById(editor_id);if(inst)return inst.queryCommandState(command);return null;},setWindowArg:function(n,v){this.windowArgs[n]=v;},getWindowArg:function(n,d){return(typeof(this.windowArgs[n])=="undefined")?d:this.windowArgs[n];},getCSSClasses:function(editor_id,doc){var output=new Array();if(typeof(tinyMCE.cssClasses)!="undefined")return tinyMCE.cssClasses;if(typeof(editor_id)=="undefined"&&typeof(doc)=="undefined"){var instance;for(var instanceName in tinyMCE.instances){instance=tinyMCE.instances[instanceName];if(!tinyMCE.isInstance(instance))continue;break;}doc=instance.getDoc();}if(typeof(doc)=="undefined"){var instance=tinyMCE.getInstanceById(editor_id);doc=instance.getDoc();}if(doc){var styles=doc.styleSheets;if(styles&&styles.length>0){for(var x=0;x<styles.length;x++){var csses=null;eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets("+x+").rules : styles["+x+"].cssRules;} catch(e) {}");if(!csses)return new Array();for(var i=0;i<csses.length;i++){var selectorText=csses[i].selectorText;if(selectorText){var rules=selectorText.split(',');for(var c=0;c<rules.length;c++){var rule=rules[c];while(rule.indexOf(' ')==0)rule=rule.substring(1);if(rule.indexOf(' ')!=-1||rule.indexOf(':')!=-1||rule.indexOf('mceItem')!=-1)continue;if(rule.indexOf(tinyMCE.settings['visual_table_class'])!=-1||rule.indexOf('mceEditable')!=-1||rule.indexOf('mceNonEditable')!=-1)continue;if(rule.indexOf('.')!=-1){var cssClass=rule.substring(rule.indexOf('.')+1);var addClass=true;for(var p=0;p<output.length&&addClass;p++){if(output[p]==cssClass)addClass=false;}if(addClass)output[output.length]=cssClass;}}}}}}}if(output.length>0)tinyMCE.cssClasses=output;return output;},regexpReplace:function(in_str,reg_exp,replace_str,opts){if(in_str==null)return in_str;if(typeof(opts)=="undefined")opts='g';var re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str);},trim:function(s){return s.replace(/^\s*|\s*$/g,"");},cleanupEventStr:function(s){s=""+s;s=s.replace('function anonymous()\n{\n','');s=s.replace('\n}','');s=s.replace(/^return true;/gi,'');return s;},getControlHTML:function(c){var i,l,n,o,v;l=tinyMCE.plugins;for(n in l){o=l[n];if(o.getControlHTML&&(v=o.getControlHTML(c))!='')return tinyMCE.replaceVar(v,"pluginurl",o.baseURL);}o=tinyMCE.themes[tinyMCE.settings['theme']];if(o.getControlHTML&&(v=o.getControlHTML(c))!='')return v;return'';},evalFunc:function(f,idx,a){var s='(',i;for(i=idx;i<a.length;i++){s+='a['+i+']';if(i<a.length-1)s+=',';}s+=');';return eval("f"+s);},dispatchCallback:function(i,p,n){return this.callFunc(i,p,n,0,this.dispatchCallback.arguments);},executeCallback:function(i,p,n){return this.callFunc(i,p,n,1,this.executeCallback.arguments);},execCommandCallback:function(i,p,n){return this.callFunc(i,p,n,2,this.execCommandCallback.arguments);},callFunc:function(ins,p,n,m,a){var l,i,on,o,s,v;s=m==2;l=tinyMCE.getParam(p,'');if(l!=''&&(v=tinyMCE.evalFunc(typeof(l)=="function"?l:eval(l),3,a))==s&&m>0)return true;if(ins!=null){for(i=0,l=ins.plugins;i<l.length;i++){o=tinyMCE.plugins[l[i]];if(o[n]&&(v=tinyMCE.evalFunc(o[n],3,a))==s&&m>0)return true;}}l=tinyMCE.themes;for(on in l){o=l[on];if(o[n]&&(v=tinyMCE.evalFunc(o[n],3,a))==s&&m>0)return true;}return false;},xmlEncode:function(s){s=""+s;s=s.replace(/&/g,'&amp;');s=s.replace(new RegExp('"','g'),'&quot;');s=s.replace(/\'/g,'&#39;');s=s.replace(/</g,'&lt;');s=s.replace(/>/g,'&gt;');return s;},extend:function(p,np){var o={};o.parent=p;for(n in p)o[n]=p[n];for(n in np)o[n]=np[n];return o;},hideMenus:function(){var e=tinyMCE.lastSelectedMenuBtn;if(tinyMCE.lastMenu){tinyMCE.lastMenu.hide();tinyMCE.lastMenu=null;}if(e){tinyMCE.switchClass(e,tinyMCE.lastMenuBtnClass);tinyMCE.lastSelectedMenuBtn=null;}},explode:function(d,s){var ar=s.split(d),oar=new Array(),i;for(i=0;i<ar.length;i++){if(ar[i]!="")oar[oar.length]=ar[i];}return oar;}};var TinyMCE=TinyMCE_Engine;var tinyMCE=new TinyMCE_Engine();var tinyMCELang={};function TinyMCE_Control(settings){var t,i,to,fu,p,x,fn,fu,pn,s=settings;this.undoRedoLevel=true;this.isTinyMCE_Control=true;this.settings=s;this.settings['theme']=tinyMCE.getParam("theme","default");this.settings['width']=tinyMCE.getParam("width",-1);this.settings['height']=tinyMCE.getParam("height",-1);this.selection=new TinyMCE_Selection(this);this.undoRedo=new TinyMCE_UndoRedo(this);this.cleanup=new TinyMCE_Cleanup();this.shortcuts=new Array();this.hasMouseMoved=false;this.cleanup.init({valid_elements:s.valid_elements,extended_valid_elements:s.extended_valid_elements,entities:s.entities,entity_encoding:s.entity_encoding,debug:s.cleanup_debug,url_converter:'TinyMCE_Cleanup.prototype._urlConverter',indent:s.apply_source_formatting,invalid_elements:s.invalid_elements,verify_html:s.verify_html,fix_content_duplication:s.fix_content_duplication});t=this.settings['theme'];if(!tinyMCE.hasTheme(t)){fn=tinyMCE.callbacks;to={};for(i=0;i<fn.length;i++){if((fu=window['TinyMCE_'+t+"_"+fn[i]]))to[fn[i]]=fu;}tinyMCE.addTheme(t,to);}this.plugins=new Array();p=tinyMCE.getParam('plugins','',true,',');if(p.length>0){for(i=0;i<p.length;i++){pn=p[i];if(pn.charAt(0)=='-')pn=pn.substring(1);if(!tinyMCE.hasPlugin(pn)){fn=tinyMCE.callbacks;to={};for(x=0;x<fn.length;x++){if((fu=window['TinyMCE_'+pn+"_"+fn[x]]))to[fn[x]]=fu;}tinyMCE.addPlugin(pn,to);}this.plugins[this.plugins.length]=pn;}}};TinyMCE_Control.prototype={hasPlugin:function(n){var i;for(i=0;i<this.plugins.length;i++){if(this.plugins[i]==n)return true;}return false;},addPlugin:function(n,p){if(!this.hasPlugin(n)){tinyMCE.addPlugin(n,p);this.plugins[this.plugins.length]=n;}},repaint:function(){if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return;try{var s=this.selection;var b=s.getBookmark(true);this.getBody().style.display='none';this.getDoc().execCommand('selectall',false,null);this.getSel().collapseToStart();this.getBody().style.display='block';s.moveToBookmark(b);}catch(ex){}},switchSettings:function(){if(tinyMCE.configs.length>1&&tinyMCE.currentConfig!=this.settings['index']){tinyMCE.settings=this.settings;tinyMCE.currentConfig=this.settings['index'];}},getBody:function(){return this.getDoc().body;},getDoc:function(){return this.contentWindow.document;},getWin:function(){return this.contentWindow;},addShortcut:function(m,k,d,cmd,ui,va){var n=typeof(k)=="number",ie=tinyMCE.isMSIE,c,sc,i;var scl=this.shortcuts;if(!tinyMCE.getParam('custom_shortcuts'))return false;m=m.toLowerCase();k=ie&&!n?k.toUpperCase():k;c=n?null:k.charCodeAt(0);d=d&&d.indexOf('lang_')==0?tinyMCE.getLang(d):d;sc={alt:m.indexOf('alt')!=-1,ctrl:m.indexOf('ctrl')!=-1,shift:m.indexOf('shift')!=-1,charCode:c,keyCode:n?k:(ie?c:null),desc:d,cmd:cmd,ui:ui,val:va};for(i=0;i<scl.length;i++){if(sc.alt==scl[i].alt&&sc.ctrl==scl[i].ctrl&&sc.shift==scl[i].shift&&sc.charCode==scl[i].charCode&&sc.keyCode==scl[i].keyCode){return false;}}scl[scl.length]=sc;return true;},handleShortcut:function(e){var i,s=this.shortcuts,o;for(i=0;i<s.length;i++){o=s[i];if(o.alt==e.altKey&&o.ctrl==e.ctrlKey&&(o.keyCode==e.keyCode||o.charCode==e.charCode)){if(o.cmd&&(e.type=="keydown"||(e.type=="keypress"&&!tinyMCE.isOpera)))tinyMCE.execCommand(o.cmd,o.ui,o.val);tinyMCE.cancelEvent(e);return true;}}return false;},autoResetDesignMode:function(){if(!tinyMCE.isMSIE&&this.isHidden()&&tinyMCE.getParam('auto_reset_designmode'))eval('try { this.getDoc().designMode = "On"; } catch(e) {}');},isHidden:function(){if(tinyMCE.isMSIE)return false;var s=this.getSel();return(!s||!s.rangeCount||s.rangeCount==0);},isDirty:function(){return this.startContent!=tinyMCE.trim(this.getBody().innerHTML)&&!tinyMCE.isNotDirty;},_mergeElements:function(scmd,pa,ch,override){if(scmd=="removeformat"){pa.className="";pa.style.cssText="";ch.className="";ch.style.cssText="";return;}var st=tinyMCE.parseStyle(tinyMCE.getAttrib(pa,"style"));var stc=tinyMCE.parseStyle(tinyMCE.getAttrib(ch,"style"));var className=tinyMCE.getAttrib(pa,"class");className+=" "+tinyMCE.getAttrib(ch,"class");if(override){for(var n in st){if(typeof(st[n])=='function')continue;stc[n]=st[n];}}else{for(var n in stc){if(typeof(stc[n])=='function')continue;st[n]=stc[n];}}tinyMCE.setAttrib(pa,"style",tinyMCE.serializeStyle(st));tinyMCE.setAttrib(pa,"class",tinyMCE.trim(className));ch.className="";ch.style.cssText="";ch.removeAttribute("class");ch.removeAttribute("style");},_setUseCSS:function(b){var d=this.getDoc();try{d.execCommand("useCSS",false,!b);}catch(ex){}try{d.execCommand("styleWithCSS",false,b);}catch(ex){}if(!tinyMCE.getParam("table_inline_editing"))try{d.execCommand('enableInlineTableEditing',false,"false");}catch(ex){}if(!tinyMCE.getParam("object_resizing"))try{d.execCommand('enableObjectResizing',false,"false");}catch(ex){}},execCommand:function(command,user_interface,value){var doc=this.getDoc();var win=this.getWin();var focusElm=this.getFocusElement();if(!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel','gi').test(command))this.undoBookmark=null;if(this.lastSafariSelection&&!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel','gi').test(command)){this.selection.moveToBookmark(this.lastSafariSelection);tinyMCE.selectedElement=this.lastSafariSelectedElement;}if(!tinyMCE.isMSIE&&!this.useCSS){this._setUseCSS(false);this.useCSS=true;}this.contentDocument=doc;if(tinyMCE.execCommandCallback(this,'execcommand_callback','execCommand',this.editorId,this.getBody(),command,user_interface,value))return;if(focusElm&&focusElm.nodeName=="IMG"){var align=focusElm.getAttribute('align');var img=command=="JustifyCenter"?focusElm.cloneNode(false):focusElm;switch(command){case"JustifyLeft":if(align=='left')img.removeAttribute('align');else img.setAttribute('align','left');var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case"JustifyCenter":img.removeAttribute('align');var div=tinyMCE.getParentElement(focusElm,"div");if(div&&div.style.textAlign=="center"){if(div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);}else{var div=this.getDoc().createElement("div");div.style.textAlign='center';div.appendChild(img);focusElm.parentNode.replaceChild(div,focusElm);}this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case"JustifyRight":if(align=='right')img.removeAttribute('align');else img.setAttribute('align','right');var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;}}if(tinyMCE.settings['force_br_newlines']){var alignValue="";if(doc.selection.type!="Control"){switch(command){case"JustifyLeft":alignValue="left";break;case"JustifyCenter":alignValue="center";break;case"JustifyFull":alignValue="justify";break;case"JustifyRight":alignValue="right";break;}if(alignValue!=""){var rng=doc.selection.createRange();if((divElm=tinyMCE.getParentElement(rng.parentElement(),"div"))!=null)divElm.setAttribute("align",alignValue);else if(rng.pasteHTML&&rng.htmlText.length>0)rng.pasteHTML('<div align="'+alignValue+'">'+rng.htmlText+"</div>");tinyMCE.triggerNodeChange();return;}}}switch(command){case"mceRepaint":this.repaint();return true;case"InsertUnorderedList":case"InsertOrderedList":var tag=(command=="InsertUnorderedList")?"ul":"ol";if(tinyMCE.isSafari)this.execCommand("mceInsertContent",false,"<"+tag+"><li>&nbsp;</li><"+tag+">");else this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"Strikethrough":if(tinyMCE.isSafari)this.execCommand("mceInsertContent",false,"<strike>"+this.selection.getSelectedHTML()+"</strike>");else this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"mceSelectNode":this.selection.selectNode(value);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=value;break;case"FormatBlock":if(value==null||value==""){var elm=tinyMCE.getParentElement(this.getFocusElement(),"p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");if(elm)this.execCommand("mceRemoveNode",false,elm);}else{if(tinyMCE.isGecko&&new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>','gi').test(value))value=value.replace(/[^a-z]/gi,'');if(tinyMCE.isMSIE&&new RegExp('blockquote|code|samp','gi').test(value)){var b=this.selection.getBookmark();this.getDoc().execCommand("FormatBlock",false,'<p>');tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()),value);this.selection.moveToBookmark(b);}else this.getDoc().execCommand("FormatBlock",false,value);}tinyMCE.triggerNodeChange();break;case"mceRemoveNode":if(!value)value=tinyMCE.getParentElement(this.getFocusElement());if(tinyMCE.isMSIE){value.outerHTML=value.innerHTML;}else{var rng=value.ownerDocument.createRange();rng.setStartBefore(value);rng.setEndAfter(value);rng.deleteContents();rng.insertNode(rng.createContextualFragment(value.innerHTML));}tinyMCE.triggerNodeChange();break;case"mceSelectNodeDepth":var parentNode=this.getFocusElement();for(var i=0;parentNode;i++){if(parentNode.nodeName.toLowerCase()=="body")break;if(parentNode.nodeName.toLowerCase()=="#text"){i--;parentNode=parentNode.parentNode;continue;}if(i==value){this.selection.selectNode(parentNode,false);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=parentNode;return;}parentNode=parentNode.parentNode;}break;case"SetStyleInfo":var rng=this.getRng();var sel=this.getSel();var scmd=value['command'];var sname=value['name'];var svalue=value['value']==null?'':value['value'];var wrapper=value['wrapper']?value['wrapper']:"span";var parentElm=null;var invalidRe=new RegExp("^BODY|HTML$","g");var invalidParentsRe=tinyMCE.settings['merge_styles_invalid_parents']!=''?new RegExp(tinyMCE.settings['merge_styles_invalid_parents'],"gi"):null;if(tinyMCE.isMSIE){if(rng.item)parentElm=rng.item(0);else{var pelm=rng.parentElement();var prng=doc.selection.createRange();prng.moveToElementText(pelm);if(rng.htmlText==prng.htmlText||rng.boundingWidth==0){if(invalidParentsRe==null||!invalidParentsRe.test(pelm.nodeName))parentElm=pelm;}}}else{var felm=this.getFocusElement();if(sel.isCollapsed||(new RegExp('td|tr|tbody|table','gi').test(felm.nodeName)&&sel.anchorNode==felm.parentNode))parentElm=felm;}if(parentElm&&!invalidRe.test(parentElm.nodeName)){if(scmd=="setstyle")tinyMCE.setStyleAttrib(parentElm,sname,svalue);if(scmd=="setattrib")tinyMCE.setAttrib(parentElm,sname,svalue);if(scmd=="removeformat"){parentElm.style.cssText='';tinyMCE.setAttrib(parentElm,'class','');}var ch=tinyMCE.getNodeTree(parentElm,new Array(),1);for(var z=0;z<ch.length;z++){if(ch[z]==parentElm)continue;if(scmd=="setstyle")tinyMCE.setStyleAttrib(ch[z],sname,'');if(scmd=="setattrib")tinyMCE.setAttrib(ch[z],sname,'');if(scmd=="removeformat"){ch[z].style.cssText='';tinyMCE.setAttrib(ch[z],'class','');}}}else{this._setUseCSS(false);doc.execCommand("FontName",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.getBody(),"font","face","#mce_temp_font#");for(var x=0;x<elementArray.length;x++){elm=elementArray[x];if(elm){var spanElm=doc.createElement(wrapper);if(scmd=="setstyle")tinyMCE.setStyleAttrib(spanElm,sname,svalue);if(scmd=="setattrib")tinyMCE.setAttrib(spanElm,sname,svalue);if(scmd=="removeformat"){spanElm.style.cssText='';tinyMCE.setAttrib(spanElm,'class','');}if(elm.hasChildNodes()){for(var i=0;i<elm.childNodes.length;i++)spanElm.appendChild(elm.childNodes[i].cloneNode(true));}spanElm.setAttribute("mce_new","true");elm.parentNode.replaceChild(spanElm,elm);var ch=tinyMCE.getNodeTree(spanElm,new Array(),1);for(var z=0;z<ch.length;z++){if(ch[z]==spanElm)continue;if(scmd=="setstyle")tinyMCE.setStyleAttrib(ch[z],sname,'');if(scmd=="setattrib")tinyMCE.setAttrib(ch[z],sname,'');if(scmd=="removeformat"){ch[z].style.cssText='';tinyMCE.setAttrib(ch[z],'class','');}}}}}var nodes=doc.getElementsByTagName(wrapper);for(var i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isNew=tinyMCE.getAttrib(elm,"mce_new")=="true";elm.removeAttribute("mce_new");if(elm.childNodes&&elm.childNodes.length==1&&elm.childNodes[0].nodeType==1){this._mergeElements(scmd,elm,elm.childNodes[0],isNew);continue;}if(elm.parentNode.childNodes.length==1&&!invalidRe.test(elm.nodeName)&&!invalidRe.test(elm.parentNode.nodeName)){if(invalidParentsRe==null||!invalidParentsRe.test(elm.parentNode.nodeName))this._mergeElements(scmd,elm.parentNode,elm,false);}}var nodes=doc.getElementsByTagName(wrapper);for(var i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isEmpty=true;var tmp=doc.createElement("body");tmp.appendChild(elm.cloneNode(false));tmp.innerHTML=tmp.innerHTML.replace(new RegExp('style=""|class=""','gi'),'');if(new RegExp('<span>','gi').test(tmp.innerHTML)){for(var x=0;x<elm.childNodes.length;x++){if(elm.parentNode!=null)elm.parentNode.insertBefore(elm.childNodes[x].cloneNode(true),elm);}elm.parentNode.removeChild(elm);}}if(scmd=="removeformat")tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE.triggerNodeChange();break;case"FontName":if(value==null){var s=this.getSel();if(tinyMCE.isGecko&&s.isCollapsed){var f=tinyMCE.getParentElement(this.getFocusElement(),"font");if(f!=null)this.selection.selectNode(f,false);}this.getDoc().execCommand("RemoveFormat",false,null);if(f!=null&&tinyMCE.isGecko){var r=this.getRng().cloneRange();r.collapse(true);s.removeAllRanges();s.addRange(r);}}else this.getDoc().execCommand('FontName',false,value);if(tinyMCE.isGecko)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);return;case"FontSize":this.getDoc().execCommand('FontSize',false,value);if(tinyMCE.isGecko)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);return;case"forecolor":this.getDoc().execCommand('forecolor',false,value);break;case"HiliteColor":if(tinyMCE.isGecko){this._setUseCSS(true);this.getDoc().execCommand('hilitecolor',false,value);this._setUseCSS(false);}else this.getDoc().execCommand('BackColor',false,value);break;case"Cut":case"Copy":case"Paste":var cmdFailed=false;eval('try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}');if(tinyMCE.isOpera&&cmdFailed)alert('Currently not supported by your browser, use keyboard shortcuts instead.');if(tinyMCE.isGecko&&cmdFailed){if(confirm(tinyMCE.entityDecode(tinyMCE.getLang('lang_clipboard_msg'))))window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html','mceExternal');return;}else tinyMCE.triggerNodeChange();break;case"mceSetContent":if(!value)value="";value=tinyMCE.storeAwayURLs(value);value=tinyMCE._customCleanup(this,"insert_to_editor",value);tinyMCE._setHTML(doc,value);tinyMCE.setInnerHTML(doc.body,tinyMCE._cleanupHTML(this,doc,tinyMCE.settings,doc.body));tinyMCE.convertAllRelativeURLs(doc.body);tinyMCE._removeInternal(this.getBody());if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);tinyMCE.handleVisualAid(doc.body,true,this.visualAid,this);tinyMCE._setEventsEnabled(doc.body,false);return true;case"mceCleanup":var b=this.selection.getBookmark();tinyMCE._setHTML(this.contentDocument,this.getBody().innerHTML);tinyMCE.setInnerHTML(this.getBody(),tinyMCE._cleanupHTML(this,this.contentDocument,this.settings,this.getBody(),this.visualAid));tinyMCE.convertAllRelativeURLs(doc.body);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE._setEventsEnabled(this.getBody(),false);this.repaint();this.selection.moveToBookmark(b);tinyMCE.triggerNodeChange();break;case"mceReplaceContent":if(!value)value='';this.getWin().focus();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text;}else selectedText=this.getSel().toString();if(selectedText.length>0){value=tinyMCE.replaceVar(value,"selection",selectedText);tinyMCE.execCommand('mceInsertContent',false,value);}tinyMCE.triggerNodeChange();break;case"mceSetAttribute":if(typeof(value)=='object'){var targetElms=(typeof(value['targets'])=="undefined")?"p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address":value['targets'];var targetNode=tinyMCE.getParentElement(this.getFocusElement(),targetElms);if(targetNode){targetNode.setAttribute(value['name'],value['value']);tinyMCE.triggerNodeChange();}}break;case"mceSetCSSClass":this.execCommand("SetStyleInfo",false,{command:"setattrib",name:"class",value:value});break;case"mceInsertRawHTML":var key='tiny_mce_marker';this.execCommand('mceBeginUndoLevel');this.execCommand('mceInsertContent',false,key);var scrollX=this.getDoc().body.scrollLeft+this.getDoc().documentElement.scrollLeft;var scrollY=this.getDoc().body.scrollTop+this.getDoc().documentElement.scrollTop;var html=this.getBody().innerHTML;if((pos=html.indexOf(key))!=-1)tinyMCE.setInnerHTML(this.getBody(),html.substring(0,pos)+value+html.substring(pos+key.length));this.contentWindow.scrollTo(scrollX,scrollY);this.execCommand('mceEndUndoLevel');break;case"mceInsertContent":if(!value)value='';var insertHTMLFailed=false;this.getWin().focus();if(tinyMCE.isGecko||tinyMCE.isOpera){try{if(value.indexOf('<')==-1&&!value.match(/(&#38;|&#160;|&#60;|&#62;)/g)){var r=this.getRng();var n=this.getDoc().createTextNode(tinyMCE.entityDecode(value));var s=this.getSel();var r2=r.cloneRange();s.removeAllRanges();r.deleteContents();r.insertNode(n);r2.selectNode(n);r2.collapse(false);s.removeAllRanges();s.addRange(r2);}else{value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);this.getDoc().execCommand('inserthtml',false,value);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value);}}catch(ex){insertHTMLFailed=true;}if(!insertHTMLFailed){tinyMCE.triggerNodeChange();return;}}if(tinyMCE.isOpera&&insertHTMLFailed){this.getDoc().execCommand("insertimage",false,tinyMCE.uniqueURL);var ar=tinyMCE.getElementsByAttributeValue(this.getBody(),"img","src",tinyMCE.uniqueURL);ar[0].outerHTML=value;return;}if(!tinyMCE.isMSIE){var isHTML=value.indexOf('<')!=-1;var sel=this.getSel();var rng=this.getRng();if(isHTML){if(tinyMCE.isSafari){var tmpRng=this.getDoc().createRange();tmpRng.setStart(this.getBody(),0);tmpRng.setEnd(this.getBody(),0);value=tmpRng.createContextualFragment(value);}else value=rng.createContextualFragment(value);}else{var el=document.createElement("div");el.innerHTML=value;value=el.firstChild.nodeValue;value=doc.createTextNode(value);}if(tinyMCE.isSafari&&!isHTML){this.execCommand('InsertText',false,value.nodeValue);tinyMCE.triggerNodeChange();return true;}else if(tinyMCE.isSafari&&isHTML){rng.deleteContents();rng.insertNode(value);tinyMCE.triggerNodeChange();return true;}rng.deleteContents();if(rng.startContainer.nodeType==3){var node=rng.startContainer.splitText(rng.startOffset);node.parentNode.insertBefore(value,node);}else rng.insertNode(value);if(!isHTML){sel.selectAllChildren(doc.body);sel.removeAllRanges();var rng=doc.createRange();rng.selectNode(value);rng.collapse(false);sel.addRange(rng);}else rng.collapse(false);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value);}else{var rng=doc.selection.createRange();var c=value.indexOf('<!--')!=-1;if(c)value=tinyMCE.uniqueTag+value;if(rng.item)rng.item(0).outerHTML=value;else rng.pasteHTML(value);if(c){var e=this.getDoc().getElementById('mceTMPElement');e.parentNode.removeChild(e);}}tinyMCE.triggerNodeChange();break;case"mceStartTyping":if(tinyMCE.settings['custom_undo_redo']&&this.undoRedo.typingUndoIndex==-1){this.undoRedo.typingUndoIndex=this.undoRedo.undoIndex;this.execCommand('mceAddUndoLevel');}break;case"mceEndTyping":if(tinyMCE.settings['custom_undo_redo']&&this.undoRedo.typingUndoIndex!=-1){this.execCommand('mceAddUndoLevel');this.undoRedo.typingUndoIndex=-1;}break;case"mceBeginUndoLevel":this.undoRedoLevel=false;break;case"mceEndUndoLevel":this.undoRedoLevel=true;this.execCommand('mceAddUndoLevel');break;case"mceAddUndoLevel":if(tinyMCE.settings['custom_undo_redo']&&this.undoRedoLevel){if(this.undoRedo.add())tinyMCE.triggerNodeChange(false);}break;case"Undo":if(tinyMCE.settings['custom_undo_redo']){tinyMCE.execCommand("mceEndTyping");this.undoRedo.undo();tinyMCE.triggerNodeChange();}else this.getDoc().execCommand(command,user_interface,value);break;case"Redo":if(tinyMCE.settings['custom_undo_redo']){tinyMCE.execCommand("mceEndTyping");this.undoRedo.redo();tinyMCE.triggerNodeChange();}else this.getDoc().execCommand(command,user_interface,value);break;case"mceToggleVisualAid":this.visualAid=!this.visualAid;tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE.triggerNodeChange();break;case"Indent":this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();if(tinyMCE.isMSIE){var n=tinyMCE.getParentElement(this.getFocusElement(),"blockquote");do{if(n&&n.nodeName=="BLOCKQUOTE"){n.removeAttribute("dir");n.removeAttribute("style");}}while(n!=null&&(n=n.parentNode)!=null);}break;case"removeformat":var text=this.selection.getSelectedText();if(tinyMCE.isOpera){this.getDoc().execCommand("RemoveFormat",false,null);return;}if(tinyMCE.isMSIE){try{var rng=doc.selection.createRange();rng.execCommand("RemoveFormat",false,null);}catch(e){}this.execCommand("SetStyleInfo",false,{command:"removeformat"});}else{this.getDoc().execCommand(command,user_interface,value);this.execCommand("SetStyleInfo",false,{command:"removeformat"});}if(text.length==0)this.execCommand("mceSetCSSClass",false,"");tinyMCE.triggerNodeChange();break;default:this.getDoc().execCommand(command,user_interface,value);if(tinyMCE.isGecko)window.setTimeout('tinyMCE.triggerNodeChange(false);',1);else tinyMCE.triggerNodeChange();}if(command!="mceAddUndoLevel"&&command!="Undo"&&command!="Redo"&&command!="mceStartTyping"&&command!="mceEndTyping")tinyMCE.execCommand("mceAddUndoLevel");},queryCommandValue:function(c){try{return this.getDoc().queryCommandValue(c);}catch(e){return null;}},queryCommandState:function(c){return this.getDoc().queryCommandState(c);},_onAdd:function(replace_element,form_element_name,target_document){var hc,th,to,editorTemplate;th=this.settings['theme'];to=tinyMCE.themes[th];var targetDoc=target_document?target_document:document;this.targetDoc=targetDoc;tinyMCE.themeURL=tinyMCE.baseURL+"/themes/"+this.settings['theme'];this.settings['themeurl']=tinyMCE.themeURL;if(!replace_element){alert("Error: Could not find the target element.");return false;}if(to.getEditorTemplate)editorTemplate=to.getEditorTemplate(this.settings,this.editorId);var deltaWidth=editorTemplate['delta_width']?editorTemplate['delta_width']:0;var deltaHeight=editorTemplate['delta_height']?editorTemplate['delta_height']:0;var html='<span id="'+this.editorId+'_parent" class="mceEditorContainer">'+editorTemplate['html'];html=tinyMCE.replaceVar(html,"editor_id",this.editorId);this.settings['default_document']=tinyMCE.baseURL+"/blank.htm";this.settings['old_width']=this.settings['width'];this.settings['old_height']=this.settings['height'];if(this.settings['width']==-1)this.settings['width']=replace_element.offsetWidth;if(this.settings['height']==-1)this.settings['height']=replace_element.offsetHeight;if(this.settings['width']==0)this.settings['width']=replace_element.style.width;if(this.settings['height']==0)this.settings['height']=replace_element.style.height;if(this.settings['width']==0)this.settings['width']=320;if(this.settings['height']==0)this.settings['height']=240;this.settings['area_width']=parseInt(this.settings['width']);this.settings['area_height']=parseInt(this.settings['height']);this.settings['area_width']+=deltaWidth;this.settings['area_height']+=deltaHeight;if((""+this.settings['width']).indexOf('%')!=-1)this.settings['area_width']="100%";if((""+this.settings['height']).indexOf('%')!=-1)this.settings['area_height']="100%";if((""+replace_element.style.width).indexOf('%')!=-1){this.settings['width']=replace_element.style.width;this.settings['area_width']="100%";}if((""+replace_element.style.height).indexOf('%')!=-1){this.settings['height']=replace_element.style.height;this.settings['area_height']="100%";}html=tinyMCE.applyTemplate(html);this.settings['width']=this.settings['old_width'];this.settings['height']=this.settings['old_height'];this.visualAid=this.settings['visual'];this.formTargetElementId=form_element_name;if(replace_element.nodeName=="TEXTAREA"||replace_element.nodeName=="INPUT")this.startContent=replace_element.value;else this.startContent=replace_element.innerHTML;if(replace_element.nodeName!="TEXTAREA"&&replace_element.nodeName!="INPUT"){this.oldTargetElement=replace_element;if(tinyMCE.settings['debug']){hc='<textarea wrap="off" id="'+form_element_name+'" name="'+form_element_name+'" cols="100" rows="15"></textarea>';}else{hc='<input type="hidden" id="'+form_element_name+'" name="'+form_element_name+'" />';this.oldTargetElement.style.display="none";}html+='</span>';if(tinyMCE.isGecko)html=hc+html;else html+=hc;if(tinyMCE.isGecko){var rng=replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);var fragment=rng.createContextualFragment(html);tinyMCE.insertAfter(fragment,replace_element);}else replace_element.insertAdjacentHTML("beforeBegin",html);}else{html+='</span>';this.oldTargetElement=replace_element;if(!tinyMCE.settings['debug'])this.oldTargetElement.style.display="none";if(tinyMCE.isGecko){var rng=replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);var fragment=rng.createContextualFragment(html);tinyMCE.insertAfter(fragment,replace_element);}else replace_element.insertAdjacentHTML("beforeBegin",html);}var dynamicIFrame=false;var tElm=targetDoc.getElementById(this.editorId);if(!tinyMCE.isMSIE){if(tElm&&(tElm.nodeName=="SPAN"||tElm.nodeName=="span")){tElm=tinyMCE._createIFrame(tElm,targetDoc);dynamicIFrame=true;}this.targetElement=tElm;this.iframeElement=tElm;this.contentDocument=tElm.contentDocument;this.contentWindow=tElm.contentWindow;}else{if(tElm&&tElm.nodeName=="SPAN")tElm=tinyMCE._createIFrame(tElm,targetDoc,targetDoc.parentWindow);else tElm=targetDoc.frames[this.editorId];this.targetElement=tElm;this.iframeElement=targetDoc.getElementById(this.editorId);if(tinyMCE.isOpera){this.contentDocument=this.iframeElement.contentDocument;this.contentWindow=this.iframeElement.contentWindow;dynamicIFrame=true;}else{this.contentDocument=tElm.window.document;this.contentWindow=tElm.window;}this.getDoc().designMode="on";}var doc=this.contentDocument;if(dynamicIFrame){var html=tinyMCE.getParam('doctype')+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+tinyMCE.settings['base_href']+'" /><title>blank_page</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body class="mceContentBody"></body></html>';try{if(!this.isHidden())this.getDoc().designMode="on";doc.open();doc.write(html);doc.close();}catch(e){this.getDoc().location.href=tinyMCE.baseURL+"/blank.htm";}}if(tinyMCE.isMSIE)window.setTimeout("tinyMCE.addEventHandlers(tinyMCE.instances[\""+this.editorId+"\"]);",1);tinyMCE.setupContent(this.editorId,true);return true;},setBaseHREF:function(u){var h,b,d,nl;d=this.getDoc();nl=d.getElementsByTagName("base");b=nl.length>0?nl[0]:null;if(!b){nl=d.getElementsByTagName("head");h=nl.length>0?nl[0]:null;b=d.createElement("base");b.setAttribute('href',u);h.appendChild(b);}else{if(u==""||u==null)b.parentNode.removeChild(b);else b.setAttribute('href',u);}},getFocusElement:function(){return this.selection.getFocusElement();},getSel:function(){return this.selection.getSel();},getRng:function(){return this.selection.getRng();},triggerSave:function(skip_cleanup,skip_callback){var e,nl=new Array(),i,s;this.switchSettings();s=tinyMCE.settings;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){e=this.iframeElement;do{if(e.style&&e.style.display=='none'){e.style.display='block';nl[nl.length]={elm:e,type:'style'};}if(e.style&&s.hidden_tab_class.length>0&&e.className.indexOf(s.hidden_tab_class)!=-1){e.className=s.display_tab_class;nl[nl.length]={elm:e,type:'class'};}}while((e=e.parentNode)!=null)}tinyMCE.settings['preformatted']=false;if(typeof(skip_cleanup)=="undefined")skip_cleanup=false;if(typeof(skip_callback)=="undefined")skip_callback=false;tinyMCE._setHTML(this.getDoc(),this.getBody().innerHTML);if(this.settings['cleanup']==false){tinyMCE.handleVisualAid(this.getBody(),true,false,this);tinyMCE._setEventsEnabled(this.getBody(),true);}tinyMCE._customCleanup(this,"submit_content_dom",this.contentWindow.document.body);var htm=skip_cleanup?this.getBody().innerHTML:tinyMCE._cleanupHTML(this,this.getDoc(),this.settings,this.getBody(),tinyMCE.visualAid,true,true);htm=tinyMCE._customCleanup(this,"submit_content",htm);if(!skip_callback&&tinyMCE.settings['save_callback']!="")var content=eval(tinyMCE.settings['save_callback']+"(this.formTargetElementId,htm,this.getBody());");if((typeof(content)!="undefined")&&content!=null)htm=content;htm=tinyMCE.regexpReplace(htm,"&#40;","(","gi");htm=tinyMCE.regexpReplace(htm,"&#41;",")","gi");htm=tinyMCE.regexpReplace(htm,"&#59;",";","gi");htm=tinyMCE.regexpReplace(htm,"&#34;","&quot;","gi");htm=tinyMCE.regexpReplace(htm,"&#94;","^","gi");if(this.formElement)this.formElement.value=htm;if(tinyMCE.isSafari&&this.formElement)this.formElement.innerText=htm;for(i=0;i<nl.length;i++){if(nl[i].type=='style')nl[i].elm.style.display='none';else nl[i].elm.className=s.hidden_tab_class;}}};TinyMCE_Engine.prototype.cleanupHTMLCode=function(s){s=s.replace(new RegExp('<p \\/>','gi'),'<p>&nbsp;</p>');s=s.replace(new RegExp('<p>\\s*<\\/p>','gi'),'<p>&nbsp;</p>');s=s.replace(new RegExp('<br>\\s*<\\/br>','gi'),'<br />');s=s.replace(new RegExp('<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\\\|>]*)\\/>','gi'),'<$1$2$3></$1$2>');s=s.replace(new RegExp('\\s+></','gi'),'></');s=s.replace(new RegExp('<(img|br|hr)([^>]*)><\\/(img|br|hr)>','gi'),'<$1$2 />');if(tinyMCE.isMSIE)s=s.replace(new RegExp('<p><hr \\/><\\/p>','gi'),"<hr>");if(tinyMCE.getParam('convert_urls'))s=s.replace(new RegExp('(href=\"{0,1})(\\s*#)','gi'),'$1'+tinyMCE.settings['document_base_url']+"#");return s;};TinyMCE_Engine.prototype.parseStyle=function(str){var ar=new Array();if(str==null)return ar;var st=str.split(';');tinyMCE.clearArray(ar);for(var i=0;i<st.length;i++){if(st[i]=='')continue;var re=new RegExp('^\\s*([^:]*):\\s*(.*)\\s*$');var pa=st[i].replace(re,'$1||$2').split('||');if(pa.length==2)ar[pa[0].toLowerCase()]=pa[1];}return ar;};TinyMCE_Engine.prototype.compressStyle=function(ar,pr,sf,res){var box=new Array();box[0]=ar[pr+'-top'+sf];box[1]=ar[pr+'-left'+sf];box[2]=ar[pr+'-right'+sf];box[3]=ar[pr+'-bottom'+sf];for(var i=0;i<box.length;i++){if(box[i]==null)return;for(var a=0;a<box.length;a++){if(box[a]!=box[i])return;}}ar[res]=box[0];ar[pr+'-top'+sf]=null;ar[pr+'-left'+sf]=null;ar[pr+'-right'+sf]=null;ar[pr+'-bottom'+sf]=null;};TinyMCE_Engine.prototype.serializeStyle=function(ar){var str="";tinyMCE.compressStyle(ar,"border","","border");tinyMCE.compressStyle(ar,"border","-width","border-width");tinyMCE.compressStyle(ar,"border","-color","border-color");tinyMCE.compressStyle(ar,"border","-style","border-style");tinyMCE.compressStyle(ar,"padding","","padding");tinyMCE.compressStyle(ar,"margin","","margin");for(var key in ar){var val=ar[key];if(typeof(val)=='function')continue;if(key.indexOf('mso-')==0)continue;if(val!=null&&val!=''){val=''+val;val=val.replace(new RegExp("url\\(\\'?([^\\']*)\\'?\\)",'gi'),"url('$1')");if(val.indexOf('url(')!=-1&&tinyMCE.getParam('convert_urls')){var m=new RegExp("url\\('(.*?)'\\)").exec(val);if(m.length>1)val="url('"+eval(tinyMCE.getParam('urlconverter_callback')+"(m[1], null, true);")+"')";}if(tinyMCE.getParam("force_hex_style_colors"))val=tinyMCE.convertRGBToHex(val,true);if(val!="url('')")str+=key.toLowerCase()+": "+val+"; ";}}if(new RegExp('; $').test(str))str=str.substring(0,str.length-2);return str;};TinyMCE_Engine.prototype.convertRGBToHex=function(s,k){if(s.toLowerCase().indexOf('rgb')!=-1){var re=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi");var rgb=s.replace(re,"$1,$2,$3,$4,$5").split(',');if(rgb.length==5){r=parseInt(rgb[1]).toString(16);g=parseInt(rgb[2]).toString(16);b=parseInt(rgb[3]).toString(16);r=r.length==1?'0'+r:r;g=g.length==1?'0'+g:g;b=b.length==1?'0'+b:b;s="#"+r+g+b;if(k)s=rgb[0]+s+rgb[4];}}return s;};TinyMCE_Engine.prototype.convertHexToRGB=function(s){if(s.indexOf('#')!=-1){s=s.replace(new RegExp('[^0-9A-F]','gi'),'');return"rgb("+parseInt(s.substring(0,2),16)+","+parseInt(s.substring(2,4),16)+","+parseInt(s.substring(4,6),16)+")";}return s;};TinyMCE_Engine.prototype.convertSpansToFonts=function(doc){var sizes=tinyMCE.getParam('font_size_style_values').replace(/\s+/,'').split(',');var h=doc.body.innerHTML;h=h.replace(/<span/gi,'<font');h=h.replace(/<\/span/gi,'</font');doc.body.innerHTML=h;var s=doc.getElementsByTagName("font");for(var i=0;i<s.length;i++){var size=tinyMCE.trim(s[i].style.fontSize).toLowerCase();var fSize=0;for(var x=0;x<sizes.length;x++){if(sizes[x]==size){fSize=x+1;break;}}if(fSize>0){tinyMCE.setAttrib(s[i],'size',fSize);s[i].style.fontSize='';}var fFace=s[i].style.fontFamily;if(fFace!=null&&fFace!=""){tinyMCE.setAttrib(s[i],'face',fFace);s[i].style.fontFamily='';}var fColor=s[i].style.color;if(fColor!=null&&fColor!=""){tinyMCE.setAttrib(s[i],'color',tinyMCE.convertRGBToHex(fColor));s[i].style.color='';}}};TinyMCE_Engine.prototype.convertFontsToSpans=function(doc){var sizes=tinyMCE.getParam('font_size_style_values').replace(/\s+/,'').split(',');var h=doc.body.innerHTML;h=h.replace(/<font/gi,'<span');h=h.replace(/<\/font/gi,'</span');doc.body.innerHTML=h;var fsClasses=tinyMCE.getParam('font_size_classes');if(fsClasses!='')fsClasses=fsClasses.replace(/\s+/,'').split(',');else fsClasses=null;var s=doc.getElementsByTagName("span");for(var i=0;i<s.length;i++){var fSize,fFace,fColor;fSize=tinyMCE.getAttrib(s[i],'size');fFace=tinyMCE.getAttrib(s[i],'face');fColor=tinyMCE.getAttrib(s[i],'color');if(fSize!=""){fSize=parseInt(fSize);if(fSize>0&&fSize<8){if(fsClasses!=null)tinyMCE.setAttrib(s[i],'class',fsClasses[fSize-1]);else s[i].style.fontSize=sizes[fSize-1];}s[i].removeAttribute('size');}if(fFace!=""){s[i].style.fontFamily=fFace;s[i].removeAttribute('face');}if(fColor!=""){s[i].style.color=fColor;s[i].removeAttribute('color');}}};TinyMCE_Engine.prototype.cleanupAnchors=function(doc){var i,cn,x,an=doc.getElementsByTagName("a");for(i=an.length-1;i>=0;i--){if(tinyMCE.getAttrib(an[i],"name")!=""&&tinyMCE.getAttrib(an[i],"href")==""){cn=an[i].childNodes;for(x=cn.length-1;x>=0;x--)tinyMCE.insertAfter(cn[x],an[i]);}}};TinyMCE_Engine.prototype.getContent=function(editor_id){var h;if(typeof(editor_id)!="undefined")tinyMCE.selectedInstance=tinyMCE.getInstanceById(editor_id);if(tinyMCE.selectedInstance){h=tinyMCE._cleanupHTML(this.selectedInstance,this.selectedInstance.getDoc(),tinyMCE.settings,this.selectedInstance.getBody(),false,true);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(this.selectedInstance.getDoc());return h;}return null;};TinyMCE_Engine.prototype._fixListElements=function(d){var nl,x,a=['ol','ul'],i,n,p,r=new RegExp('^(OL|UL)$'),np;for(x=0;x<a.length;x++){nl=d.getElementsByTagName(a[x]);for(i=0;i<nl.length;i++){n=nl[i];p=n.parentNode;if(r.test(p.nodeName)){np=tinyMCE.prevNode(n,'LI');if(!np){np=d.createElement('li');np.innerHTML='&nbsp;';np.appendChild(n);p.insertBefore(np,p.firstChild);}else np.appendChild(n);}}}};TinyMCE_Engine.prototype._fixTables=function(d){var nl,i,n,p,np,x,t;nl=d.getElementsByTagName('table');for(i=0;i<nl.length;i++){n=nl[i];if((p=tinyMCE.getParentElement(n,'p,div,h1,h2,h3,h4,h5,h6'))!=null){np=p.cloneNode(false);np.removeAttribute('id');t=n;while((n=n.nextSibling))np.appendChild(n);tinyMCE.insertAfter(np,p);tinyMCE.insertAfter(t,p);}}};TinyMCE_Engine.prototype._cleanupHTML=function(inst,doc,config,elm,visual,on_save,on_submit){var h,d,t1,t2,t3,t4,t5,c,s;if(!tinyMCE.getParam('cleanup'))return elm.innerHTML;on_save=typeof(on_save)=='undefined'?false:on_save;c=inst.cleanup;s=inst.settings;d=c.settings.debug;if(d)t1=new Date().getTime();if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertFontsToSpans(doc);if(tinyMCE.getParam("fix_list_elements"))tinyMCE._fixListElements(doc);if(tinyMCE.getParam("fix_table_elements"))tinyMCE._fixTables(doc);tinyMCE._customCleanup(inst,on_save?"get_from_editor_dom":"insert_to_editor_dom",doc.body);if(d)t2=new Date().getTime();c.settings.on_save=on_save;c.idCount=0;c.serializationId++;c.serializedNodes=new Array();c.sourceIndex=-1;if(s.cleanup_serializer=="xml")h=c.serializeNodeAsXML(elm);else h=c.serializeNodeAsHTML(elm);if(d)t3=new Date().getTime();h=h.replace(/<\/?(body|head|html)[^>]*>/gi,'');h=h.replace(new RegExp(' (rowspan="1"|colspan="1")','g'),'');h=h.replace(/<p><hr \/><\/p>/g,'<hr />');h=h.replace(/<p>(&nbsp;|&#160;)<\/p><hr \/><p>(&nbsp;|&#160;)<\/p>/g,'<hr />');h=h.replace(/<td>\s*<br \/>\s*<\/td>/g,'<td>&nbsp;</td>');h=h.replace(/<p>\s*<br \/>\s*<\/p>/g,'<p>&nbsp;</p>');h=h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*(&nbsp;|&#160;)\s*<\/p>/g,'<p>&nbsp;</p>');h=h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*<\/p>/g,'<p>&nbsp;</p>');h=h.replace(/<p>\s*<br \/>\s*&nbsp;\s*<\/p>/g,'<p>&nbsp;</p>');h=h.replace(new RegExp('<a>(.*?)<\\/a>','g'),'$1');h=h.replace(/<p([^>]*)>\s*<\/p>/g,'<p$1>&nbsp;</p>');if(/^\s*(<br \/>|<p>&nbsp;<\/p>|<p>&#160;<\/p>|<p><\/p>)\s*$/.test(h))h='';if(s.preformatted){h=h.replace(/^<pre>/,'');h=h.replace(/<\/pre>$/,'');h='<pre>'+h+'</pre>';}if(tinyMCE.isGecko){h=h.replace(/<o:p _moz-userdefined="" \/>/g,'');h=h.replace(/<td([^>]*)>\s*<br \/>\s*<\/td>/g,'<td$1>&nbsp;</td>');}if(s.force_br_newlines)h=h.replace(/<p>(&nbsp;|&#160;)<\/p>/g,'<br />');h=tinyMCE._customCleanup(inst,on_save?"get_from_editor":"insert_to_editor",h);if(on_save){h=h.replace(new RegExp(' ?(mceItem[a-zA-Z0-9]*|'+s.visual_table_class+')','g'),'');h=h.replace(new RegExp(' ?class=""','g'),'');}if(s.remove_linebreaks&&!c.settings.indent)h=h.replace(/\n|\r/g,' ');if(d)t4=new Date().getTime();if(on_save&&c.settings.indent)h=c.formatHTML(h);if(on_submit&&(s.encoding=="xml"||s.encoding=="html"))h=c.xmlEncode(h);if(d)t5=new Date().getTime();if(c.settings.debug)tinyMCE.debug("Cleanup in ms: Pre="+(t2-t1)+", Serialize: "+(t3-t2)+", Post: "+(t4-t3)+", Format: "+(t5-t4)+", Sum: "+(t5-t1)+".");return h;};function TinyMCE_Cleanup(){this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.rules=tinyMCE.clearArray(new Array());this.settings={indent_elements:'head,table,tbody,thead,tfoot,form,tr,ul,ol,blockquote,object',newline_before_elements:'h1,h2,h3,h4,h5,h6,pre,address,div,ul,ol,li,meta,option,area,title,link,base,script,td',newline_after_elements:'br,hr,p,pre,address,div,ul,ol,meta,option,area,link,base,script',newline_before_after_elements:'html,head,body,table,thead,tbody,tfoot,tr,form,ul,ol,blockquote,p,object,param,hr,div',indent_char:'\t',indent_levels:1,entity_encoding:'raw',valid_elements:'*[*]',entities:'',url_converter:'',invalid_elements:'',verify_html:false};this.vElements=tinyMCE.clearArray(new Array());this.vElementsRe='';this.closeElementsRe=/^(IMG|BR|HR|LINK|META|BASE|INPUT|BUTTON|AREA)$/;this.codeElementsRe=/^(SCRIPT|STYLE)$/;this.serializationId=0;this.mceAttribs={href:'mce_href',src:'mce_src',type:'mce_type'};}TinyMCE_Cleanup.prototype={init:function(s){var n,a,i,ir,or,st;for(n in s)this.settings[n]=s[n];s=this.settings;this.inRe=this._arrayToRe(s.indent_elements.split(','),'','^<(',')[^>]*');this.ouRe=this._arrayToRe(s.indent_elements.split(','),'','^<\\/(',')[^>]*');this.nlBeforeRe=this._arrayToRe(s.newline_before_elements.split(','),'gi','<(',')([^>]*)>');this.nlAfterRe=this._arrayToRe(s.newline_after_elements.split(','),'gi','<(',')([^>]*)>');this.nlBeforeAfterRe=this._arrayToRe(s.newline_before_after_elements.split(','),'gi','<(\\/?)(',')([^>]*)>');if(s.invalid_elements!='')this.iveRe=this._arrayToRe(s.invalid_elements.toUpperCase().split(','),'g','^(',')$');else this.iveRe=null;st='';for(i=0;i<s.indent_levels;i++)st+=s.indent_char;this.inStr=st;if(!s.verify_html){s.valid_elements='*[*]';s.extended_valid_elements='';}this.fillStr=s.entity_encoding=="named"?"&nbsp;":"&#160;";this.idCount=0;},addRuleStr:function(s){var r=this.parseRuleStr(s);var n;for(n in r){if(r[n])this.rules[n]=r[n];}this.vElements=tinyMCE.clearArray(new Array());for(n in this.rules){if(this.rules[n])this.vElements[this.vElements.length]=this.rules[n].tag;}this.vElementsRe=this._arrayToRe(this.vElements,'');},parseRuleStr:function(s){var ta,p,r,a,i,x,px,t,tn,y,av,or=tinyMCE.clearArray(new Array()),dv;if(s==null||s.length==0)return or;ta=s.split(',');for(x=0;x<ta.length;x++){s=ta[x];if(s.length==0)continue;p=this.split(/\[|\]/,s);if(p==null||p.length<1)t=s.toUpperCase();else t=p[0].toUpperCase();tn=this.split('/',t);for(y=0;y<tn.length;y++){r={};r.tag=tn[y];r.forceAttribs=null;r.defaultAttribs=null;r.validAttribValues=null;px=r.tag.charAt(0);r.forceOpen=px=='+';r.removeEmpty=px=='-';r.fill=px=='#';r.tag=r.tag.replace(/\+|-|#/g,'');r.oTagName=tn[0].replace(/\+|-|#/g,'').toLowerCase();r.isWild=new RegExp('\\*|\\?|\\+','g').test(r.tag);r.validRe=new RegExp(this._wildcardToRe('^'+r.tag+'$'));if(p.length>1){r.vAttribsRe='^(';a=this.split(/\|/,p[1]);for(i=0;i<a.length;i++){t=a[i];av=new RegExp('(=|:|<)(.*?)$').exec(t);t=t.replace(new RegExp('(=|:|<).*?$'),'');if(av&&av.length>0){if(av[0].charAt(0)==':'){if(!r.forceAttribs)r.forceAttribs=tinyMCE.clearArray(new Array());r.forceAttribs[t.toLowerCase()]=av[0].substring(1);}else if(av[0].charAt(0)=='='){if(!r.defaultAttribs)r.defaultAttribs=tinyMCE.clearArray(new Array());dv=av[0].substring(1);r.defaultAttribs[t.toLowerCase()]=dv==""?"mce_empty":dv;}else if(av[0].charAt(0)=='<'){if(!r.validAttribValues)r.validAttribValues=tinyMCE.clearArray(new Array());r.validAttribValues[t.toLowerCase()]=this._arrayToRe(this.split('?',av[0].substring(1)),'');}}r.vAttribsRe+=''+t.toLowerCase()+(i!=a.length-1?'|':'');a[i]=t.toLowerCase();}r.vAttribsRe+=')$';r.vAttribsRe=this._wildcardToRe(r.vAttribsRe);r.vAttribsReIsWild=new RegExp('\\*|\\?|\\+','g').test(r.vAttribsRe);r.vAttribsRe=new RegExp(r.vAttribsRe);r.vAttribs=a.reverse();}else{r.vAttribsRe='';r.vAttribs=tinyMCE.clearArray(new Array());r.vAttribsReIsWild=false;}or[r.tag]=r;}}return or;},serializeNodeAsXML:function(n){var s,b;if(!this.xmlDoc){if(this.isMSIE){try{this.xmlDoc=new ActiveXObject('MSXML2.DOMDocument');}catch(e){}if(!this.xmlDoc)try{this.xmlDoc=new ActiveXObject('Microsoft.XmlDom');}catch(e){}}else this.xmlDoc=document.implementation.createDocument('','',null);if(!this.xmlDoc)alert("Error XML Parser could not be found.");}if(this.xmlDoc.firstChild)this.xmlDoc.removeChild(this.xmlDoc.firstChild);b=this.xmlDoc.createElement("html");b=this.xmlDoc.appendChild(b);this._convertToXML(n,b);if(this.isMSIE)return this.xmlDoc.xml;else return new XMLSerializer().serializeToString(this.xmlDoc);},_convertToXML:function(n,xn){var xd,el,i,l,cn,at,no,hc=false;if(this._isDuplicate(n))return;xd=this.xmlDoc;switch(n.nodeType){case 1:hc=n.hasChildNodes();el=xd.createElement(n.nodeName.toLowerCase());at=n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified&&no.nodeValue)el.setAttribute(no.nodeName.toLowerCase(),no.nodeValue);}if(!hc&&!this.closeElementsRe.test(n.nodeName))el.appendChild(xd.createTextNode(""));xn=xn.appendChild(el);break;case 3:xn.appendChild(xd.createTextNode(n.nodeValue));return;case 8:xn.appendChild(xd.createComment(n.nodeValue));return;}if(hc){cn=n.childNodes;for(i=0,l=cn.length;i<l;i++)this._convertToXML(cn[i],xn);}},serializeNodeAsHTML:function(n){var en,no,h='',i,l,r,cn,va=false,f=false,at,hc;this._setupRules();if(this._isDuplicate(n))return'';switch(n.nodeType){case 1:hc=n.hasChildNodes();if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&n.nodeName.indexOf('/')!=-1)break;if(this.vElementsRe.test(n.nodeName)&&(!this.iveRe||!this.iveRe.test(n.nodeName))){va=true;r=this.rules[n.nodeName];if(!r){at=this.rules;for(no in at){if(at[no]&&at[no].validRe.test(n.nodeName)){r=at[no];break;}}}en=r.isWild?n.nodeName.toLowerCase():r.oTagName;f=r.fill;if(r.removeEmpty&&!hc)return"";h+='<'+en;if(r.vAttribsReIsWild){at=n.attributes;for(i=at.length-1;i>-1;i--){no=at[i];if(no.specified&&r.vAttribsRe.test(no.nodeName))h+=this._serializeAttribute(n,r,no.nodeName);}}else{for(i=r.vAttribs.length-1;i>-1;i--)h+=this._serializeAttribute(n,r,r.vAttribs[i]);}if(!this.settings.on_save){at=this.mceAttribs;for(no in at){if(at[no])h+=this._serializeAttribute(n,r,at[no]);}}if(this.closeElementsRe.test(n.nodeName))return h+' />';h+='>';if(this.isMSIE&&this.codeElementsRe.test(n.nodeName))h+=n.innerHTML;}break;case 3:if(n.parentNode&&this.codeElementsRe.test(n.parentNode.nodeName))return this.isMSIE?'':n.nodeValue;return this.xmlEncode(n.nodeValue);case 8:return"<!--"+this._trimComment(n.nodeValue)+"-->";}if(hc){cn=n.childNodes;for(i=0,l=cn.length;i<l;i++)h+=this.serializeNodeAsHTML(cn[i]);}if(f&&!hc)h+=this.fillStr;if(va)h+='</'+en+'>';return h;},_serializeAttribute:function(n,r,an){var av='',t,os=this.settings.on_save;if(os&&(an.indexOf('mce_')==0||an.indexOf('_moz')==0))return'';if(os&&this.mceAttribs[an])av=this._getAttrib(n,this.mceAttribs[an]);if(av.length==0)av=this._getAttrib(n,an);if(av.length==0&&r.defaultAttribs&&(t=r.defaultAttribs[an])){av=t;if(av=="mce_empty")return" "+an+'=""';}if(r.forceAttribs&&(t=r.forceAttribs[an]))av=t;if(os&&av.length!=0&&this.settings.url_converter.length!=0&&/^(src|href|longdesc)$/.test(an))av=eval(this.settings.url_converter+'(this, n, av)');if(av.length!=0&&r.validAttribValues&&r.validAttribValues[an]&&!r.validAttribValues[an].test(av))return"";if(av.length!=0&&av=="{$uid}")av="uid_"+(this.idCount++);if(av.length!=0)return" "+an+"="+'"'+this.xmlEncode(av)+'"';return"";},formatHTML:function(h){var s=this.settings,p='',i=0,li=0,o='',l;h=h.replace(/\r/g,'');h='\n'+h;h=h.replace(new RegExp('\\n\\s+','gi'),'\n');h=h.replace(this.nlBeforeRe,'\n<$1$2>');h=h.replace(this.nlAfterRe,'<$1$2>\n');h=h.replace(this.nlBeforeAfterRe,'\n<$1$2$3>\n');h+='\n';while((i=h.indexOf('\n',i+1))!=-1){if((l=h.substring(li+1,i)).length!=0){if(this.ouRe.test(l)&&p.length>=s.indent_levels)p=p.substring(s.indent_levels);o+=p+l+'\n';if(this.inRe.test(l))p+=this.inStr;}li=i;}return o;},xmlEncode:function(s){var i,l,e,o='',c;this._setupEntities();switch(this.settings.entity_encoding){case"raw":return tinyMCE.xmlEncode(s);case"named":for(i=0,l=s.length;i<l;i++){c=s.charCodeAt(i);e=this.entities[c];if(e&&e!='')o+='&'+e+';';else o+=String.fromCharCode(c);}return o;case"numeric":for(i=0,l=s.length;i<l;i++){c=s.charCodeAt(i);if(c>127||c==60||c==62||c==38||c==39||c==34)o+='&#'+c+";";else o+=String.fromCharCode(c);}return o;}return s;},split:function(re,s){var c=s.split(re);var i,l,o=new Array();for(i=0,l=c.length;i<l;i++){if(c[i]!='')o[i]=c[i];}return o;},_trimComment:function(s){s=s.replace(new RegExp('\\smce_src=\"[^\"]*\"','gi'),"");s=s.replace(new RegExp('\\smce_href=\"[^\"]*\"','gi'),"");return s;},_getAttrib:function(e,n,d){if(typeof(d)=="undefined")d="";if(!e||e.nodeType!=1)return d;var v=e.getAttribute(n,0);if(n=="class"&&!v)v=e.className;if(this.isMSIE&&n=="http-equiv")v=e.httpEquiv;if(this.isMSIE&&e.nodeName=="FORM"&&n=="enctype"&&v=="application/x-www-form-urlencoded")v="";if(this.isMSIE&&e.nodeName=="INPUT"&&n=="size"&&v=="20")v="";if(this.isMSIE&&e.nodeName=="INPUT"&&n=="maxlength"&&v=="2147483647")v="";if(n=="style"&&!tinyMCE.isOpera)v=e.style.cssText;if(n=='style')v=tinyMCE.serializeStyle(tinyMCE.parseStyle(v));if(this.settings.on_save&&n.indexOf('on')!=-1&&this.settings.on_save&&v&&v!="")v=tinyMCE.cleanupEventStr(v);return(v&&v!="")?''+v:d;},_urlConverter:function(c,n,v){if(!c.settings.on_save)return tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,v);else if(tinyMCE.getParam('convert_urls'))return eval(tinyMCE.settings.urlconverter_callback+"(v, n, true);");return v;},_arrayToRe:function(a,op,be,af){var i,r;op=typeof(op)=="undefined"?"gi":op;be=typeof(be)=="undefined"?"^(":be;af=typeof(af)=="undefined"?")$":af;r=be;for(i=0;i<a.length;i++)r+=this._wildcardToRe(a[i])+(i!=a.length-1?"|":"");r+=af;return new RegExp(r,op);},_wildcardToRe:function(s){s=s.replace(/\?/g,'(\\S?)');s=s.replace(/\+/g,'(\\S+)');s=s.replace(/\*/g,'(\\S*)');return s;},_setupEntities:function(){var n,a,i,s=this.settings;if(!this.entitiesDone){if(s.entity_encoding=="named"){n=tinyMCE.clearArray(new Array());a=this.split(',',s.entities);for(i=0;i<a.length;i+=2)n[a[i]]=a[i+1];this.entities=n;}this.entitiesDone=true;}},_setupRules:function(){var s=this.settings;if(!this.rulesDone){this.addRuleStr(s.valid_elements);this.addRuleStr(s.extended_valid_elements);this.rulesDone=true;}},_isDuplicate:function(n){var i;if(!this.settings.fix_content_duplication)return false;if(tinyMCE.isMSIE&&!tinyMCE.isOpera&&n.nodeType==1){if(n.mce_serialized==this.serializationId)return true;n.setAttribute('mce_serialized',this.serializationId);}else{for(i=0;i<this.serializedNodes.length;i++){if(this.serializedNodes[i]==n)return true;}this.serializedNodes[this.serializedNodes.length]=n;}return false;}};TinyMCE_Engine.prototype.getElementByAttributeValue=function(n,e,a,v){return(n=this.getElementsByAttributeValue(n,e,a,v)).length==0?null:n[0];};TinyMCE_Engine.prototype.getElementsByAttributeValue=function(n,e,a,v){var i,nl=n.getElementsByTagName(e),o=new Array();for(i=0;i<nl.length;i++){if(tinyMCE.getAttrib(nl[i],a).indexOf(v)!=-1)o[o.length]=nl[i];}return o;};TinyMCE_Engine.prototype.isBlockElement=function(n){return n!=null&&n.nodeType==1&&this.blockRegExp.test(n.nodeName);};TinyMCE_Engine.prototype.getParentBlockElement=function(n){while(n){if(this.isBlockElement(n))return n;n=n.parentNode;}return null;};TinyMCE_Engine.prototype.insertAfter=function(n,r){if(r.nextSibling)r.parentNode.insertBefore(n,r.nextSibling);else r.parentNode.appendChild(n);};TinyMCE_Engine.prototype.setInnerHTML=function(e,h){var i,nl,n;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){h=h.replace(/\s\/>/g,'>');h=h.replace(/<p([^>]*)>\u00A0?<\/p>/gi,'<p$1 mce_keep="true">&nbsp;</p>');h=h.replace(/<p([^>]*)>\s*&nbsp;\s*<\/p>/gi,'<p$1 mce_keep="true">&nbsp;</p>');h=h.replace(/<p([^>]*)>\s+<\/p>/gi,'<p$1 mce_keep="true">&nbsp;</p>');e.innerHTML=tinyMCE.uniqueTag+h;e.firstChild.removeNode(true);nl=e.getElementsByTagName("p");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.nodeName=='P'&&!n.hasChildNodes()&&!n.mce_keep)n.parentNode.removeChild(n);}}else{h=this.fixGeckoBaseHREFBug(1,e,h);e.innerHTML=h;this.fixGeckoBaseHREFBug(2,e,h);}};TinyMCE_Engine.prototype.getOuterHTML=function(e){if(tinyMCE.isMSIE)return e.outerHTML;var d=e.ownerDocument.createElement("body");d.appendChild(e);return d.innerHTML;};TinyMCE_Engine.prototype.setOuterHTML=function(e,h){if(tinyMCE.isMSIE){e.outerHTML=h;return;}var d=e.ownerDocument.createElement("body");d.innerHTML=h;e.parentNode.replaceChild(d.firstChild,e);};TinyMCE_Engine.prototype._getElementById=function(id,d){var e,i,j,f;if(typeof(d)=="undefined")d=document;e=d.getElementById(id);if(!e){f=d.forms;for(i=0;i<f.length;i++){for(j=0;j<f[i].elements.length;j++){if(f[i].elements[j].name==id){e=f[i].elements[j];break;}}}}return e;};TinyMCE_Engine.prototype.getNodeTree=function(n,na,t,nn){var i;if(typeof(t)=="undefined"||n.nodeType==t&&(typeof(nn)=="undefined"||n.nodeName==nn))na[na.length]=n;if(n.hasChildNodes()){for(i=0;i<n.childNodes.length;i++)tinyMCE.getNodeTree(n.childNodes[i],na,t,nn);}return na;};TinyMCE_Engine.prototype.getParentElement=function(node,names,attrib_name,attrib_value){if(typeof(names)=="undefined"){if(node.nodeType==1)return node;while((node=node.parentNode)!=null&&node.nodeType!=1);return node;}if(node==null)return null;var namesAr=names.toUpperCase().split(',');do{for(var i=0;i<namesAr.length;i++){if(node.nodeName==namesAr[i]||names=="*"){if(typeof(attrib_name)=="undefined")return node;else if(node.getAttribute(attrib_name)){if(typeof(attrib_value)=="undefined"){if(node.getAttribute(attrib_name)!="")return node;}else if(node.getAttribute(attrib_name)==attrib_value)return node;}}}}while((node=node.parentNode)!=null);return null;};TinyMCE_Engine.prototype.getParentNode=function(n,f){while(n){if(f(n))return n;n=n.parentNode;}return null;};TinyMCE_Engine.prototype.getAttrib=function(elm,name,default_value){if(typeof(default_value)=="undefined")default_value="";if(!elm||elm.nodeType!=1)return default_value;var v=elm.getAttribute(name);if(name=="class"&&!v)v=elm.className;if(tinyMCE.isGecko&&name=="src"&&elm.src!=null&&elm.src!="")v=elm.src;if(tinyMCE.isGecko&&name=="href"&&elm.href!=null&&elm.href!="")v=elm.href;if(name=="http-equiv"&&tinyMCE.isMSIE)v=elm.httpEquiv;if(name=="style"&&!tinyMCE.isOpera)v=elm.style.cssText;return(v&&v!="")?v:default_value;};TinyMCE_Engine.prototype.setAttrib=function(element,name,value,fix_value){if(typeof(value)=="number"&&value!=null)value=""+value;if(fix_value){if(value==null)value="";var re=new RegExp('[^0-9%]','g');value=value.replace(re,'');}if(name=="style")element.style.cssText=value;if(name=="class")element.className=value;if(value!=null&&value!=""&&value!=-1)element.setAttribute(name,value);else element.removeAttribute(name);};TinyMCE_Engine.prototype.setStyleAttrib=function(elm,name,value){eval('elm.style.'+name+'=value;');if(tinyMCE.isMSIE&&value==null||value==''){var str=tinyMCE.serializeStyle(tinyMCE.parseStyle(elm.style.cssText));elm.style.cssText=str;elm.setAttribute("style",str);}};TinyMCE_Engine.prototype.switchClass=function(ei,c){var e;if(tinyMCE.switchClassCache[ei])e=tinyMCE.switchClassCache[ei];else e=tinyMCE.switchClassCache[ei]=document.getElementById(ei);if(e){if(tinyMCE.settings.button_tile_map&&e.className&&e.className.indexOf('mceTiledButton')==0)c='mceTiledButton '+c;e.className=c;}};TinyMCE_Engine.prototype.getAbsPosition=function(n){var p={absLeft:0,absTop:0};while(n){p.absLeft+=n.offsetLeft;p.absTop+=n.offsetTop;n=n.offsetParent;}return p;};TinyMCE_Engine.prototype.prevNode=function(e,n){var a=n.split(','),i;while((e=e.previousSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};TinyMCE_Engine.prototype.nextNode=function(e,n){var a=n.split(','),i;while((e=e.nextSibling)!=null){for(i=0;i<a.length;i++){if(e.nodeName==a[i])return e;}}return null;};TinyMCE_Engine.prototype.selectNodes=function(n,f,a){var i;if(!a)a=new Array();if(f(n))a[a.length]=n;if(n.hasChildNodes()){for(i=0;i<n.childNodes.length;i++)tinyMCE.selectNodes(n.childNodes[i],f,a);}return a;};TinyMCE_Engine.prototype.addCSSClass=function(e,c,b){var o=this.removeCSSClass(e,c);return e.className=b?c+(o!=''?(' '+o):''):(o!=''?(o+' '):'')+c;};TinyMCE_Engine.prototype.removeCSSClass=function(e,c){var a=this.explode(' ',e.className),i;for(i=0;i<a.length;i++){if(a[i]==c)a[i]='';}return e.className=a.join(' ');};TinyMCE_Engine.prototype.renameElement=function(e,n,d){var ne,i,ar;d=typeof(d)=="undefined"?tinyMCE.selectedInstance.getDoc():d;if(e){ne=d.createElement(n);ar=e.attributes;for(i=ar.length-1;i>-1;i--){if(ar[i].specified&&ar[i].nodeValue)ne.setAttribute(ar[i].nodeName.toLowerCase(),ar[i].nodeValue);}ar=e.childNodes;for(i=0;i<ar.length;i++)ne.appendChild(ar[i].cloneNode(true));e.parentNode.replaceChild(ne,e);}};TinyMCE_Engine.prototype.parseURL=function(url_str){var urlParts=new Array();if(url_str){var pos,lastPos;pos=url_str.indexOf('://');if(pos!=-1){urlParts['protocol']=url_str.substring(0,pos);lastPos=pos+3;}for(var i=lastPos;i<url_str.length;i++){var chr=url_str.charAt(i);if(chr==':')break;if(chr=='/')break;}pos=i;urlParts['host']=url_str.substring(lastPos,pos);urlParts['port']="";lastPos=pos;if(url_str.charAt(pos)==':'){pos=url_str.indexOf('/',lastPos);urlParts['port']=url_str.substring(lastPos+1,pos);}lastPos=pos;pos=url_str.indexOf('?',lastPos);if(pos==-1)pos=url_str.indexOf('#',lastPos);if(pos==-1)pos=url_str.length;urlParts['path']=url_str.substring(lastPos,pos);lastPos=pos;if(url_str.charAt(pos)=='?'){pos=url_str.indexOf('#');pos=(pos==-1)?url_str.length:pos;urlParts['query']=url_str.substring(lastPos+1,pos);}lastPos=pos;if(url_str.charAt(pos)=='#'){pos=url_str.length;urlParts['anchor']=url_str.substring(lastPos+1,pos);}}return urlParts;};TinyMCE_Engine.prototype.serializeURL=function(up){var o="";if(up['protocol'])o+=up['protocol']+"://";if(up['host'])o+=up['host'];if(up['port'])o+=":"+up['port'];if(up['path'])o+=up['path'];if(up['query'])o+="?"+up['query'];if(up['anchor'])o+="#"+up['anchor'];return o;};TinyMCE_Engine.prototype.convertAbsoluteURLToRelativeURL=function(base_url,url_to_relative){var baseURL=this.parseURL(base_url);var targetURL=this.parseURL(url_to_relative);var strTok1;var strTok2;var breakPoint=0;var outPath="";var forceSlash=false;if(targetURL.path=="")targetURL.path="/";else forceSlash=true;base_url=baseURL.path.substring(0,baseURL.path.lastIndexOf('/'));strTok1=base_url.split('/');strTok2=targetURL.path.split('/');if(strTok1.length>=strTok2.length){for(var i=0;i<strTok1.length;i++){if(i>=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(strTok1.length<strTok2.length){for(var i=0;i<strTok2.length;i++){if(i>=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(breakPoint==1)return targetURL.path;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outPath+="../";for(var i=breakPoint-1;i<strTok2.length;i++){if(i!=(breakPoint-1))outPath+="/"+strTok2[i];else outPath+=strTok2[i];}targetURL.protocol=null;targetURL.host=null;targetURL.port=null;targetURL.path=outPath==""&&forceSlash?"/":outPath;var fileName=baseURL.path;var pos;if((pos=fileName.lastIndexOf('/'))!=-1)fileName=fileName.substring(pos+1);if(fileName==targetURL.path&&targetURL.anchor!="")targetURL.path="";if(targetURL.path==""&&!targetURL.anchor)targetURL.path=fileName!=""?fileName:"/";return this.serializeURL(targetURL);};TinyMCE_Engine.prototype.convertRelativeToAbsoluteURL=function(base_url,relative_url){var baseURL=this.parseURL(base_url);var relURL=this.parseURL(relative_url);if(relative_url==""||relative_url.charAt(0)=='/'||relative_url.indexOf('://')!=-1||relative_url.indexOf('mailto:')!=-1||relative_url.indexOf('javascript:')!=-1)return relative_url;baseURLParts=baseURL['path'].split('/');relURLParts=relURL['path'].split('/');var newBaseURLParts=new Array();for(var i=baseURLParts.length-1;i>=0;i--){if(baseURLParts[i].length==0)continue;newBaseURLParts[newBaseURLParts.length]=baseURLParts[i];}baseURLParts=newBaseURLParts.reverse();var newRelURLParts=new Array();var numBack=0;for(var i=relURLParts.length-1;i>=0;i--){if(relURLParts[i].length==0||relURLParts[i]==".")continue;if(relURLParts[i]=='..'){numBack++;continue;}if(numBack>0){numBack--;continue;}newRelURLParts[newRelURLParts.length]=relURLParts[i];}relURLParts=newRelURLParts.reverse();var len=baseURLParts.length-numBack;var absPath=(len<=0?"":"/")+baseURLParts.slice(0,len).join('/')+"/"+relURLParts.join('/');var start="",end="";relURL.protocol=baseURL.protocol;relURL.host=baseURL.host;relURL.port=baseURL.port;if(relURL.path.charAt(relURL.path.length-1)=="/")absPath+="/";relURL.path=absPath;return this.serializeURL(relURL);};TinyMCE_Engine.prototype.convertURL=function(url,node,on_save){var prot=document.location.protocol;var host=document.location.hostname;var port=document.location.port;if(prot=="file:")return url;url=tinyMCE.regexpReplace(url,'(http|https):///','/');if(url.indexOf('mailto:')!=-1||url.indexOf('javascript:')!=-1||tinyMCE.regexpReplace(url,'[ \t\r\n\+]|%20','').charAt(0)=="#")return url;if(!tinyMCE.isMSIE&&!on_save&&url.indexOf("://")==-1&&url.charAt(0)!='/')return tinyMCE.settings['base_href']+url;if(on_save&&tinyMCE.getParam('relative_urls')){var curl=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(curl.charAt(0)=='/')curl=tinyMCE.settings['document_base_prefix']+curl;var urlParts=tinyMCE.parseURL(curl);var tmpUrlParts=tinyMCE.parseURL(tinyMCE.settings['document_base_url']);if(urlParts['host']==tmpUrlParts['host']&&(urlParts['port']==tmpUrlParts['port']))return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings['document_base_url'],curl);}if(!tinyMCE.getParam('relative_urls')){var urlParts=tinyMCE.parseURL(url);var baseUrlParts=tinyMCE.parseURL(tinyMCE.settings['base_href']);url=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(urlParts['anchor']&&urlParts['path']==baseUrlParts['path'])return"#"+urlParts['anchor'];}if(tinyMCE.getParam('remove_script_host')){var start="",portPart="";if(port!="")portPart=":"+port;start=prot+"//"+host+portPart+"/";if(url.indexOf(start)==0)url=url.substring(start.length-1);}return url;};TinyMCE_Engine.prototype.convertAllRelativeURLs=function(body){var elms=body.getElementsByTagName("img");for(var i=0;i<elms.length;i++){var src=tinyMCE.getAttrib(elms[i],'src');var msrc=tinyMCE.getAttrib(elms[i],'mce_src');if(msrc!="")src=msrc;if(src!=""){src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],src);elms[i].setAttribute("src",src);}}var elms=body.getElementsByTagName("a");for(var i=0;i<elms.length;i++){var href=tinyMCE.getAttrib(elms[i],'href');var mhref=tinyMCE.getAttrib(elms[i],'mce_href');if(mhref!="")href=mhref;if(href&&href!=""){href=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],href);elms[i].setAttribute("href",href);}}};TinyMCE_Engine.prototype.clearArray=function(a){for(var k in a)a[k]=null;return a;};TinyMCE_Engine.prototype._setEventsEnabled=function(node,state){var events=new Array('onfocus','onblur','onclick','ondblclick','onmousedown','onmouseup','onmouseover','onmousemove','onmouseout','onkeypress','onkeydown','onkeydown','onkeyup');var evs=tinyMCE.settings['event_elements'].split(',');for(var y=0;y<evs.length;y++){var elms=node.getElementsByTagName(evs[y]);for(var i=0;i<elms.length;i++){var event="";for(var x=0;x<events.length;x++){if((event=tinyMCE.getAttrib(elms[i],events[x]))!=''){event=tinyMCE.cleanupEventStr(""+event);if(!state)event="return true;"+event;else event=event.replace(/^return true;/gi,'');elms[i].removeAttribute(events[x]);elms[i].setAttribute(events[x],event);}}}}};TinyMCE_Engine.prototype._eventPatch=function(editor_id){var n,inst,win,e;if(typeof(tinyMCE)=="undefined")return true;try{if(tinyMCE.selectedInstance){win=tinyMCE.selectedInstance.getWin();if(win&&win.event){e=win.event;if(!e.target)e.target=e.srcElement;TinyMCE_Engine.prototype.handleEvent(e);return;}}for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;tinyMCE.selectedInstance=inst;win=inst.getWin();if(win&&win.event){e=win.event;if(!e.target)e.target=e.srcElement;TinyMCE_Engine.prototype.handleEvent(e);return;}}}catch(ex){}};TinyMCE_Engine.prototype.unloadHandler=function(){tinyMCE.triggerSave(true,true);};TinyMCE_Engine.prototype.addEventHandlers=function(inst){var doc=inst.getDoc();inst.switchSettings();if(tinyMCE.isMSIE){tinyMCE.addEvent(doc,"keypress",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"keyup",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"keydown",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"mouseup",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"mousedown",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc,"click",TinyMCE_Engine.prototype._eventPatch);}else{tinyMCE.addEvent(doc,"keypress",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"keydown",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"keyup",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"click",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"mouseup",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"mousedown",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"focus",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"blur",tinyMCE.handleEvent);eval('try { doc.designMode = "On"; } catch(e) {}');}};TinyMCE_Engine.prototype.onMouseMove=function(){var inst;if(!tinyMCE.hasMouseMoved){inst=tinyMCE.selectedInstance;if(inst.isFocused){inst.undoBookmark=inst.selection.getBookmark();tinyMCE.hasMouseMoved=true;}}};TinyMCE_Engine.prototype.cancelEvent=function(e){if(tinyMCE.isMSIE){e.returnValue=false;e.cancelBubble=true;}else e.preventDefault();};TinyMCE_Engine.prototype.addEvent=function(o,n,h){if(o.attachEvent)o.attachEvent("on"+n,h);else o.addEventListener(n,h,false);};TinyMCE_Engine.prototype.addSelectAccessibility=function(e,s,w){if(!s._isAccessible){s.onkeydown=tinyMCE.accessibleEventHandler;s.onblur=tinyMCE.accessibleEventHandler;s._isAccessible=true;s._win=w;}return false;};TinyMCE_Engine.prototype.accessibleEventHandler=function(e){var win=this._win;e=tinyMCE.isMSIE?win.event:e;var elm=tinyMCE.isMSIE?e.srcElement:e.target;if(e.type=="blur"){if(elm.oldonchange){elm.onchange=elm.oldonchange;elm.oldonchange=null;}return true;}if(elm.nodeName=="SELECT"&&!elm.oldonchange){elm.oldonchange=elm.onchange;elm.onchange=null;}if(e.keyCode==13||e.keyCode==32){elm.onchange=elm.oldonchange;elm.onchange();elm.oldonchange=null;tinyMCE.cancelEvent(e);return false;}return true;};TinyMCE_Engine.prototype._resetIframeHeight=function(){var ife;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){ife=tinyMCE.selectedInstance.iframeElement;if(ife._oldHeight){ife.style.height=ife._oldHeight;ife.height=ife._oldHeight;}}};function TinyMCE_Selection(inst){this.instance=inst;};TinyMCE_Selection.prototype={getSelectedHTML:function(){var inst=this.instance;var e,r=this.getRng(),h;if(tinyMCE.isSafari){return r.toString();}e=document.createElement("body");if(tinyMCE.isGecko)e.appendChild(r.cloneContents());else e.innerHTML=r.item?r.item(0).outerHTML:r.htmlText;h=tinyMCE._cleanupHTML(inst,inst.contentDocument,inst.settings,e,e,false,true,false);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(inst.getDoc());return h;},getSelectedText:function(){var inst=this.instance;var d,r,s,t;if(tinyMCE.isMSIE){d=inst.getDoc();if(d.selection.type=="Text"){r=d.selection.createRange();t=r.text;}else t='';}else{s=this.getSel();if(s&&s.toString)t=s.toString();else t='';}return t;},getBookmark:function(simple){var rng=this.getRng();var doc=this.instance.getDoc();var sp,le,s,e,nl,i,si,ei;var trng,sx,sy,xx=-999999999;if(tinyMCE.isOpera)return null;sx=doc.body.scrollLeft+doc.documentElement.scrollLeft;sy=doc.body.scrollTop+doc.documentElement.scrollTop;if(tinyMCE.isSafari||tinyMCE.isGecko)return{rng:rng,scrollX:sx,scrollY:sy};if(tinyMCE.isMSIE){if(simple)return{rng:rng};if(rng.item){e=rng.item(0);nl=doc.getElementsByTagName(e.nodeName);for(i=0;i<nl.length;i++){if(e==nl[i]){sp=i;break;}}return{tag:e.nodeName,index:sp,scrollX:sx,scrollY:sy};}else{trng=rng.duplicate();trng.collapse(true);sp=Math.abs(trng.move('character',xx));trng=rng.duplicate();trng.collapse(false);le=Math.abs(trng.move('character',xx))-sp;return{start:sp,length:le,scrollX:sx,scrollY:sy};}}if(tinyMCE.isGecko){s=tinyMCE.getParentElement(rng.startContainer);for(si=0;si<s.childNodes.length&&s.childNodes[si]!=rng.startContainer;si++);nl=doc.getElementsByTagName(s.nodeName);for(i=0;i<nl.length;i++){if(s==nl[i]){sp=i;break;}}e=tinyMCE.getParentElement(rng.endContainer);for(ei=0;ei<e.childNodes.length&&e.childNodes[ei]!=rng.endContainer;ei++);nl=doc.getElementsByTagName(e.nodeName);for(i=0;i<nl.length;i++){if(e==nl[i]){le=i;break;}}return{startTag:s.nodeName,start:sp,startIndex:si,endTag:e.nodeName,end:le,endIndex:ei,startOffset:rng.startOffset,endOffset:rng.endOffset,scrollX:sx,scrollY:sy};}return null;},moveToBookmark:function(bookmark){var rng,nl,i;var inst=this.instance;var doc=inst.getDoc();var win=inst.getWin();var sel=this.getSel();if(!bookmark)return false;if(tinyMCE.isSafari){sel.setBaseAndExtent(bookmark.startContainer,bookmark.startOffset,bookmark.endContainer,bookmark.endOffset);return true;}if(tinyMCE.isMSIE){if(bookmark.rng){bookmark.rng.select();return true;}win.focus();if(bookmark.tag){rng=inst.getBody().createControlRange();nl=doc.getElementsByTagName(bookmark.tag);if(nl.length>bookmark.index){try{rng.addElement(nl[bookmark.index]);}catch(ex){}}}else{rng=inst.getSel().createRange();rng.moveToElementText(inst.getBody());rng.collapse(true);rng.moveStart('character',bookmark.start);rng.moveEnd('character',bookmark.length);}rng.select();win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}if(tinyMCE.isGecko&&bookmark.rng){sel.removeAllRanges();sel.addRange(bookmark.rng);win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}if(tinyMCE.isGecko){rng=doc.createRange();nl=doc.getElementsByTagName(bookmark.startTag);if(nl.length>bookmark.start)rng.setStart(nl[bookmark.start].childNodes[bookmark.startIndex],bookmark.startOffset);nl=doc.getElementsByTagName(bookmark.endTag);if(nl.length>bookmark.end)rng.setEnd(nl[bookmark.end].childNodes[bookmark.endIndex],bookmark.endOffset);sel.removeAllRanges();sel.addRange(rng);win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}return false;},selectNode:function(node,collapse,select_text_node,to_start){var inst=this.instance,sel,rng,nodes;if(!node)return;if(typeof(collapse)=="undefined")collapse=true;if(typeof(select_text_node)=="undefined")select_text_node=false;if(typeof(to_start)=="undefined")to_start=true;if(tinyMCE.isMSIE){rng=inst.getBody().createTextRange();try{rng.moveToElementText(node);if(collapse)rng.collapse(to_start);rng.select();}catch(e){}}else{sel=this.getSel();if(!sel)return;if(tinyMCE.isSafari){sel.setBaseAndExtent(node,0,node,node.innerText.length);if(collapse){if(to_start)sel.collapseToStart();else sel.collapseToEnd();}this.scrollToNode(node);return;}rng=inst.getDoc().createRange();if(select_text_node){nodes=tinyMCE.getNodeTree(node,new Array(),3);if(nodes.length>0)rng.selectNodeContents(nodes[0]);else rng.selectNodeContents(node);}else rng.selectNode(node);if(collapse){if(!to_start&&node.nodeType==3){rng.setStart(node,node.nodeValue.length);rng.setEnd(node,node.nodeValue.length);}else rng.collapse(to_start);}sel.removeAllRanges();sel.addRange(rng);}this.scrollToNode(node);tinyMCE.selectedElement=null;if(node.nodeType==1)tinyMCE.selectedElement=node;},scrollToNode:function(node){var inst=this.instance;var pos,doc,scrollX,scrollY,height;pos=tinyMCE.getAbsPosition(node);doc=inst.getDoc();scrollX=doc.body.scrollLeft+doc.documentElement.scrollLeft;scrollY=doc.body.scrollTop+doc.documentElement.scrollTop;height=tinyMCE.isMSIE?document.getElementById(inst.editorId).style.pixelHeight:inst.targetElement.clientHeight;if(!tinyMCE.settings['auto_resize']&&!(pos.absTop>scrollY&&pos.absTop<(scrollY-25+height)))inst.contentWindow.scrollTo(pos.absLeft,pos.absTop-height+25);},getSel:function(){var inst=this.instance;if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return inst.getDoc().selection;return inst.contentWindow.getSelection();},getRng:function(){var inst=this.instance;var sel=this.getSel();if(sel==null)return null;if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return sel.createRange();if(tinyMCE.isSafari&&!sel.getRangeAt)return''+window.getSelection();return sel.getRangeAt(0);},getFocusElement:function(){var inst=this.instance;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){var doc=inst.getDoc();var rng=doc.selection.createRange();var elm=rng.item?rng.item(0):rng.parentElement();}else{if(inst.isHidden())return inst.getBody();var sel=this.getSel();var rng=this.getRng();if(!sel||!rng)return null;var elm=rng.commonAncestorContainer;if(!rng.collapsed){if(rng.startContainer==rng.endContainer){if(rng.startOffset-rng.endOffset<2){if(rng.startContainer.hasChildNodes())elm=rng.startContainer.childNodes[rng.startOffset];}}}elm=tinyMCE.getParentElement(elm);}return elm;}};function TinyMCE_UndoRedo(inst){this.instance=inst;this.undoLevels=new Array();this.undoIndex=0;this.typingUndoIndex=-1;this.undoRedo=true;};TinyMCE_UndoRedo.prototype={add:function(l){var b;if(l){this.undoLevels[this.undoLevels.length]=l;return true;}var inst=this.instance;if(this.typingUndoIndex!=-1){this.undoIndex=this.typingUndoIndex;}var newHTML=tinyMCE.trim(inst.getBody().innerHTML);if(this.undoLevels[this.undoIndex]&&newHTML!=this.undoLevels[this.undoIndex].content){tinyMCE.dispatchCallback(inst,'onchange_callback','onChange',inst);var customUndoLevels=tinyMCE.settings['custom_undo_redo_levels'];if(customUndoLevels!=-1&&this.undoLevels.length>customUndoLevels){for(var i=0;i<this.undoLevels.length-1;i++){this.undoLevels[i]=this.undoLevels[i+1];}this.undoLevels.length--;this.undoIndex--;}b=inst.undoBookmark;if(!b)b=inst.selection.getBookmark();this.undoIndex++;this.undoLevels[this.undoIndex]={content:newHTML,bookmark:b};this.undoLevels.length=this.undoIndex+1;return true;}return false;},undo:function(){var inst=this.instance;if(this.undoIndex>0){this.undoIndex--;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);}},redo:function(){var inst=this.instance;tinyMCE.execCommand("mceEndTyping");if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);}tinyMCE.triggerNodeChange();}};var TinyMCE_ForceParagraphs={_insertPara:function(inst,e){function isEmpty(para){function isEmptyHTML(html){return html.replace(new RegExp('[ \t\r\n]+','g'),'').toLowerCase()=="";}if(para.getElementsByTagName("img").length>0)return false;if(para.getElementsByTagName("table").length>0)return false;if(para.getElementsByTagName("hr").length>0)return false;var nodes=tinyMCE.getNodeTree(para,new Array(),3);for(var i=0;i<nodes.length;i++){if(!isEmptyHTML(nodes[i].nodeValue))return false;}return true;}var doc=inst.getDoc();var sel=inst.getSel();var win=inst.contentWindow;var rng=sel.getRangeAt(0);var body=doc.body;var rootElm=doc.documentElement;var blockName="P";var rngBefore=doc.createRange();rngBefore.setStart(sel.anchorNode,sel.anchorOffset);rngBefore.collapse(true);var rngAfter=doc.createRange();rngAfter.setStart(sel.focusNode,sel.focusOffset);rngAfter.collapse(true);var direct=rngBefore.compareBoundaryPoints(rngBefore.START_TO_END,rngAfter)<0;var startNode=direct?sel.anchorNode:sel.focusNode;var startOffset=direct?sel.anchorOffset:sel.focusOffset;var endNode=direct?sel.focusNode:sel.anchorNode;var endOffset=direct?sel.focusOffset:sel.anchorOffset;startNode=startNode.nodeName=="BODY"?startNode.firstChild:startNode;endNode=endNode.nodeName=="BODY"?endNode.firstChild:endNode;var startBlock=tinyMCE.getParentBlockElement(startNode);var endBlock=tinyMCE.getParentBlockElement(endNode);if(startBlock&&new RegExp('absolute|relative|static','gi').test(startBlock.style.position))startBlock=null;if(endBlock&&new RegExp('absolute|relative|static','gi').test(endBlock.style.position))endBlock=null;if(startBlock!=null){blockName=startBlock.nodeName;if(blockName=="TD"||blockName=="TABLE"||(blockName=="DIV"&&new RegExp('left|right','gi').test(startBlock.style.cssFloat)))blockName="P";}if(tinyMCE.getParentElement(startBlock,"OL,UL")!=null)return false;if((startBlock!=null&&startBlock.nodeName=="TABLE")||(endBlock!=null&&endBlock.nodeName=="TABLE"))startBlock=endBlock=null;var paraBefore=(startBlock!=null&&startBlock.nodeName==blockName)?startBlock.cloneNode(false):doc.createElement(blockName);var paraAfter=(endBlock!=null&&endBlock.nodeName==blockName)?endBlock.cloneNode(false):doc.createElement(blockName);if(/^(H[1-6])$/.test(blockName))paraAfter=doc.createElement("p");var startChop=startNode;var endChop=endNode;node=startChop;do{if(node==body||node.nodeType==9||tinyMCE.isBlockElement(node))break;startChop=node;}while((node=node.previousSibling?node.previousSibling:node.parentNode));node=endChop;do{if(node==body||node.nodeType==9||tinyMCE.isBlockElement(node))break;endChop=node;}while((node=node.nextSibling?node.nextSibling:node.parentNode));if(startChop.nodeName=="TD")startChop=startChop.firstChild;if(endChop.nodeName=="TD")endChop=endChop.lastChild;if(startBlock==null){rng.deleteContents();sel.removeAllRanges();if(startChop!=rootElm&&endChop!=rootElm){rngBefore=rng.cloneRange();if(startChop==body)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);paraBefore.appendChild(rngBefore.cloneContents());if(endChop.parentNode.nodeName==blockName)endChop=endChop.parentNode;rng.setEndAfter(endChop);if(endChop.nodeName!="#text"&&endChop.nodeName!="BODY")rngBefore.setEndAfter(endChop);var contents=rng.cloneContents();if(contents.firstChild&&(contents.firstChild.nodeName==blockName||contents.firstChild.nodeName=="BODY"))paraAfter.innerHTML=contents.firstChild.innerHTML;else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML="&nbsp;";if(isEmpty(paraAfter))paraAfter.innerHTML="&nbsp;";rng.deleteContents();rngAfter.deleteContents();rngBefore.deleteContents();paraAfter.normalize();rngBefore.insertNode(paraAfter);paraBefore.normalize();rngBefore.insertNode(paraBefore);}else{body.innerHTML="<"+blockName+">&nbsp;</"+blockName+"><"+blockName+">&nbsp;</"+blockName+">";paraAfter=body.childNodes[1];}inst.selection.selectNode(paraAfter,true,true);return true;}if(startChop.nodeName==blockName)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);rngBefore.setEnd(startNode,startOffset);paraBefore.appendChild(rngBefore.cloneContents());rngAfter.setEndAfter(endChop);rngAfter.setStart(endNode,endOffset);var contents=rngAfter.cloneContents();if(contents.firstChild&&contents.firstChild.nodeName==blockName){paraAfter.innerHTML=contents.firstChild.innerHTML;}else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML="&nbsp;";if(isEmpty(paraAfter))paraAfter.innerHTML="&nbsp;";var rng=doc.createRange();if(!startChop.previousSibling&&startChop.parentNode.nodeName.toUpperCase()==blockName){rng.setStartBefore(startChop.parentNode);}else{if(rngBefore.startContainer.nodeName.toUpperCase()==blockName&&rngBefore.startOffset==0)rng.setStartBefore(rngBefore.startContainer);else rng.setStart(rngBefore.startContainer,rngBefore.startOffset);}if(!endChop.nextSibling&&endChop.parentNode.nodeName.toUpperCase()==blockName)rng.setEndAfter(endChop.parentNode);else rng.setEnd(rngAfter.endContainer,rngAfter.endOffset);rng.deleteContents();rng.insertNode(paraAfter);rng.insertNode(paraBefore);paraAfter.normalize();paraBefore.normalize();inst.selection.selectNode(paraAfter,true,true);return true;},_handleBackSpace:function(inst){var r=inst.getRng(),sn=r.startContainer,nv,s=false;if(sn&&sn.nextSibling&&sn.nextSibling.nodeName=="BR"){nv=sn.nodeValue;if(nv!=null&&nv.length>=r.startOffset&&nv.charAt(r.startOffset-1)==' ')s=true;if(nv!=null&&r.startOffset==nv.length)sn.nextSibling.parentNode.removeChild(sn.nextSibling);}return s;}};function TinyMCE_Layer(id,bm){this.id=id;this.blockerElement=null;this.events=false;this.element=null;this.blockMode=typeof(bm)!='undefined'?bm:true;this.doc=document;};TinyMCE_Layer.prototype={moveRelativeTo:function(re,p){var rep=this.getAbsPosition(re);var w=parseInt(re.offsetWidth);var h=parseInt(re.offsetHeight);var e=this.getElement();var ew=parseInt(e.offsetWidth);var eh=parseInt(e.offsetHeight);var x,y;switch(p){case"tl":x=rep.absLeft;y=rep.absTop;break;case"tr":x=rep.absLeft+w;y=rep.absTop;break;case"bl":x=rep.absLeft;y=rep.absTop+h;break;case"br":x=rep.absLeft+w;y=rep.absTop+h;break;case"cc":x=rep.absLeft+(w/2)-(ew/2);y=rep.absTop+(h/2)-(eh/2);break;}this.moveTo(x,y);},moveBy:function(x,y){var e=this.getElement();this.moveTo(parseInt(e.style.left)+x,parseInt(e.style.top)+y);},moveTo:function(x,y){var e=this.getElement();e.style.left=x+"px";e.style.top=y+"px";this.updateBlocker();},resizeBy:function(w,h){var e=this.getElement();this.resizeTo(parseInt(e.style.width)+w,parseInt(e.style.height)+h);},resizeTo:function(w,h){var e=this.getElement();if(w!=null)e.style.width=w+"px";if(h!=null)e.style.height=h+"px";this.updateBlocker();},show:function(){this.getElement().style.display='block';this.updateBlocker();},hide:function(){this.getElement().style.display='none';this.updateBlocker();},isVisible:function(){return this.getElement().style.display=='block';},getElement:function(){if(!this.element)this.element=this.doc.getElementById(this.id);return this.element;},setBlockMode:function(s){this.blockMode=s;},updateBlocker:function(){var e,b,x,y,w,h;b=this.getBlocker();if(b){if(this.blockMode){e=this.getElement();x=this.parseInt(e.style.left);y=this.parseInt(e.style.top);w=this.parseInt(e.offsetWidth);h=this.parseInt(e.offsetHeight);b.style.left=x+'px';b.style.top=y+'px';b.style.width=w+'px';b.style.height=h+'px';b.style.display=e.style.display;}else b.style.display='none';}},getBlocker:function(){var d,b;if(!this.blockerElement&&this.blockMode){d=this.doc;b=d.createElement("iframe");b.style.cssText='display: none; position: absolute; left: 0; top: 0';b.src='javascript:false;';b.frameBorder='0';b.scrolling='no';d.body.appendChild(b);this.blockerElement=b;}return this.blockerElement;},getAbsPosition:function(n){var p={absLeft:0,absTop:0};while(n){p.absLeft+=n.offsetLeft;p.absTop+=n.offsetTop;n=n.offsetParent;}return p;},create:function(n,c,p){var d=this.doc,e=d.createElement(n);e.setAttribute('id',this.id);if(c)e.className=c;if(!p)p=d.body;p.appendChild(e);return this.element=e;},parseInt:function(s){if(s==null||s=='')return 0;return parseInt(s);}};function TinyMCE_Menu(){var id;if(typeof(tinyMCE.menuCounter)=="undefined")tinyMCE.menuCounter=0;id="mc_menu_"+tinyMCE.menuCounter++;TinyMCE_Layer.call(this,id,true);this.id=id;this.items=new Array();this.needsUpdate=true;};TinyMCE_Menu.prototype=tinyMCE.extend(TinyMCE_Layer.prototype,{init:function(s){var n;this.settings={separator_class:'mceMenuSeparator',title_class:'mceMenuTitle',disabled_class:'mceMenuDisabled',menu_class:'mceMenu',drop_menu:true};for(n in s)this.settings[n]=s[n];this.create('div',this.settings.menu_class);},clear:function(){this.items=new Array();},addTitle:function(t){this.add({type:'title',text:t});},addDisabled:function(t){this.add({type:'disabled',text:t});},addSeparator:function(){this.add({type:'separator'});},addItem:function(t,js){this.add({text:t,js:js});},add:function(mi){this.items[this.items.length]=mi;this.needsUpdate=true;},update:function(){var e=this.getElement(),h='',i,t,m=this.items,s=this.settings;if(this.settings.drop_menu)h+='<span class="mceMenuLine"></span>';h+='<table border="0" cellpadding="0" cellspacing="0">';for(i=0;i<m.length;i++){t=tinyMCE.xmlEncode(m[i].text);c=m[i].class_name?' class="'+m[i].class_name+'"':'';switch(m[i].type){case'separator':h+='<tr class="'+s.separator_class+'"><td>';break;case'title':h+='<tr class="'+s.title_class+'"><td><span'+c+'>'+t+'</span>';break;case'disabled':h+='<tr class="'+s.disabled_class+'"><td><span'+c+'>'+t+'</span>';break;default:h+='<tr><td><a href="javascript:void(0);" onmousedown="'+tinyMCE.xmlEncode(m[i].js)+';return false;"><span'+c+'>'+t+'</span></a>';}h+='</td></tr>';}h+='</table>';e.innerHTML=h;this.needsUpdate=false;this.updateBlocker();},show:function(){var nl,i;if(tinyMCE.lastMenu==this)return;if(this.needsUpdate)this.update();if(tinyMCE.lastMenu&&tinyMCE.lastMenu!=this)tinyMCE.lastMenu.hide();TinyMCE_Layer.prototype.show.call(this);if(!tinyMCE.isOpera){}tinyMCE.lastMenu=this;}});TinyMCE_Engine.prototype.debug=function(){var m="",e,a,i;e=document.getElementById("tinymce_debug");if(!e){var d=document.createElement("div");d.setAttribute("className","debugger");d.className="debugger";d.innerHTML='Debug output:<textarea id="tinymce_debug" style="width: 100%; height: 300px" wrap="nowrap" mce_editable="false"></textarea>';document.body.appendChild(d);e=document.getElementById("tinymce_debug");}a=this.debug.arguments;for(i=0;i<a.length;i++){m+=a[i];if(i<a.length-1)m+=', ';}e.value+=m+"\n";};
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/tiny_mce_popup.js 75/e107_handlers/tiny_mce/tiny_mce_popup.js
--- 6171/e107_handlers/tiny_mce/tiny_mce_popup.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/tiny_mce_popup.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,272 @@
+
+
+// Some global instances, this will be filled later
+var tinyMCE = null, tinyMCELang = null;
+
+
+function TinyMCE_Popup() {
+};
+
+
+TinyMCE_Popup.prototype.init = function() {
+	var win = window.opener ? window.opener : window.dialogArguments;
+	var inst;
+
+	if (!win) {
+		// Try parent
+		win = parent.parent;
+
+		// Try top
+		if (typeof(win.tinyMCE) == "undefined")
+			win = top;
+	}
+
+	window.opener = win;
+	this.windowOpener = win;
+	this.onLoadEval = "";
+
+	// Setup parent references
+	tinyMCE = win.tinyMCE;
+	tinyMCELang = win.tinyMCELang;
+
+	if (!tinyMCE) {
+		alert("tinyMCE object reference not found from popup.");
+		return;
+	}
+
+	inst = tinyMCE.selectedInstance;
+	this.isWindow = tinyMCE.getWindowArg('mce_inside_iframe', false) == false;
+	this.storeSelection = (tinyMCE.isMSIE && !tinyMCE.isOpera) && !this.isWindow && tinyMCE.getWindowArg('mce_store_selection', true);
+
+	if (this.isWindow)
+		window.focus();
+
+	// Store selection
+	if (this.storeSelection)
+		inst.selectionBookmark = inst.selection.getBookmark(true);
+
+	// Setup dir
+	if (tinyMCELang['lang_dir'])
+		document.dir = tinyMCELang['lang_dir'];
+
+	// Setup title
+	var re = new RegExp('{|\\\$|}', 'g');
+	var title = document.title.replace(re, "");
+	if (typeof tinyMCELang[title] != "undefined") {
+		var divElm = document.createElement("div");
+		divElm.innerHTML = tinyMCELang[title];
+		document.title = divElm.innerHTML;
+
+		if (tinyMCE.setWindowTitle != null)
+			tinyMCE.setWindowTitle(window, divElm.innerHTML);
+	}
+
+	// Output Popup CSS class
+	document.write('<link href="' + tinyMCE.getParam("popups_css") + '" rel="stylesheet" type="text/css">');
+
+	tinyMCE.addEvent(window, "load", this.onLoad);
+};
+
+
+TinyMCE_Popup.prototype.onLoad = function() {
+	var dir, i, elms, body = document.body;
+
+	if (tinyMCE.getWindowArg('mce_replacevariables', true))
+		body.innerHTML = tinyMCE.applyTemplate(body.innerHTML, tinyMCE.windowArgs);
+
+	dir = tinyMCE.selectedInstance.settings['directionality'];
+	if (dir == "rtl" && document.forms && document.forms.length > 0) {
+		elms = document.forms[0].elements;
+		for (i=0; i<elms.length; i++) {
+			if ((elms[i].type == "text" || elms[i].type == "textarea") && elms[i].getAttribute("dir") != "ltr")
+				elms[i].dir = dir;
+		}
+	}
+
+	if (body.style.display == 'none')
+		body.style.display = 'block';
+
+	// Execute real onload (Opera fix)
+	if (tinyMCEPopup.onLoadEval != "")
+		eval(tinyMCEPopup.onLoadEval);
+};
+
+
+TinyMCE_Popup.prototype.executeOnLoad = function(str) {
+	if (tinyMCE.isOpera)
+		this.onLoadEval = str;
+	else
+		eval(str);
+};
+
+
+TinyMCE_Popup.prototype.resizeToInnerSize = function() {
+	// Netscape 7.1 workaround
+	if (this.isWindow && tinyMCE.isNS71) {
+		window.resizeBy(0, 10);
+		return;
+	}
+
+	if (this.isWindow) {
+		var doc = document;
+		var body = doc.body;
+		var oldMargin, wrapper, iframe, nodes, dx, dy;
+
+		if (body.style.display == 'none')
+			body.style.display = 'block';
+
+		// Remove margin
+		oldMargin = body.style.margin;
+		body.style.margin = '0';
+
+		// Create wrapper
+		wrapper = doc.createElement("div");
+		wrapper.id = 'mcBodyWrapper';
+		wrapper.style.display = 'none';
+		wrapper.style.margin = '0';
+
+		// Wrap body elements
+		nodes = doc.body.childNodes;
+		for (var i=nodes.length-1; i>=0; i--) {
+			if (wrapper.hasChildNodes())
+				wrapper.insertBefore(nodes[i].cloneNode(true), wrapper.firstChild);
+			else
+				wrapper.appendChild(nodes[i].cloneNode(true));
+
+			nodes[i].parentNode.removeChild(nodes[i]);
+		}
+
+		// Add wrapper
+		doc.body.appendChild(wrapper);
+
+		// Create iframe
+		iframe = document.createElement("iframe");
+		iframe.id = "mcWinIframe";
+		iframe.src = document.location.href.toLowerCase().indexOf('https') == -1 ? "about:blank" : tinyMCE.settings['default_document'];
+		iframe.width = "100%";
+		iframe.height = "100%";
+		iframe.style.margin = '0';
+
+		// Add iframe
+		doc.body.appendChild(iframe);
+
+		// Measure iframe
+		iframe = document.getElementById('mcWinIframe');
+		dx = tinyMCE.getWindowArg('mce_width') - iframe.clientWidth;
+		dy = tinyMCE.getWindowArg('mce_height') - iframe.clientHeight;
+
+		// Resize window
+		// tinyMCE.debug(tinyMCE.getWindowArg('mce_width') + "," + tinyMCE.getWindowArg('mce_height') + " - " + dx + "," + dy);
+		window.resizeBy(dx, dy);
+
+		// Hide iframe and show wrapper
+		body.style.margin = oldMargin;
+		iframe.style.display = 'none';
+		wrapper.style.display = 'block';
+	}
+};
+
+
+TinyMCE_Popup.prototype.resizeToContent = function() {
+	var isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+	var isOpera = (navigator.userAgent.indexOf("Opera") != -1);
+
+	if (isOpera)
+		return;
+
+	if (isMSIE) {
+		try { window.resizeTo(10, 10); } catch (e) {}
+
+		var elm = document.body;
+		var width = elm.offsetWidth;
+		var height = elm.offsetHeight;
+		var dx = (elm.scrollWidth - width) + 4;
+		var dy = elm.scrollHeight - height;
+
+		try { window.resizeBy(dx, dy); } catch (e) {}
+	} else {
+		window.scrollBy(1000, 1000);
+		if (window.scrollX > 0 || window.scrollY > 0) {
+			window.resizeBy(window.innerWidth * 2, window.innerHeight * 2);
+			window.sizeToContent();
+			window.scrollTo(0, 0);
+			var x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0);
+			var y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0);
+			window.moveTo(x, y);
+		}
+	}
+};
+
+
+TinyMCE_Popup.prototype.getWindowArg = function(name, default_value) {
+	return tinyMCE.getWindowArg(name, default_value);
+};
+
+
+TinyMCE_Popup.prototype.restoreSelection = function() {
+	if (this.storeSelection) {
+		var inst = tinyMCE.selectedInstance;
+
+		inst.getWin().focus();
+
+		if (inst.selectionBookmark)
+			inst.selection.moveToBookmark(inst.selectionBookmark);
+	}
+};
+
+
+TinyMCE_Popup.prototype.execCommand = function(command, user_interface, value) {
+	var inst = tinyMCE.selectedInstance;
+
+	this.restoreSelection();
+	inst.execCommand(command, user_interface, value);
+
+	// Store selection
+	if (this.storeSelection)
+		inst.selectionBookmark = inst.selection.getBookmark(true);
+};
+
+
+TinyMCE_Popup.prototype.close = function() {
+	tinyMCE.closeWindow(window);
+};
+
+
+TinyMCE_Popup.prototype.pickColor = function(e, element_id) {
+	tinyMCE.selectedInstance.execCommand('mceColorPicker', true, {
+		element_id : element_id,
+		document : document,
+		window : window,
+		store_selection : false
+	});
+};
+
+
+TinyMCE_Popup.prototype.openBrowser = function(element_id, type, option) {
+	var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
+	var url = document.getElementById(element_id).value;
+
+	tinyMCE.setWindowArg("window", window);
+	tinyMCE.setWindowArg("document", document);
+
+	// Call to external callback
+	if (eval('typeof(tinyMCEPopup.windowOpener.' + cb + ')') == "undefined")
+		alert("Callback function: " + cb + " could not be found.");
+	else
+		eval("tinyMCEPopup.windowOpener." + cb + "(element_id, url, type, window);");
+};
+
+
+TinyMCE_Popup.prototype.importClass = function(c) {
+	window[c] = function() {};
+
+	for (var n in window.opener[c].prototype)
+		window[c].prototype[n] = window.opener[c].prototype[n];
+
+	window[c].constructor = window.opener[c].constructor;
+};
+
+// Setup global instance
+var tinyMCEPopup = new TinyMCE_Popup();
+
+tinyMCEPopup.init();
diff -ruN 6171/e107_handlers/tiny_mce/tiny_mce_src.js 75/e107_handlers/tiny_mce/tiny_mce_src.js
--- 6171/e107_handlers/tiny_mce/tiny_mce_src.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/tiny_mce_src.js	2006-05-05 22:05:15.000000000 -0500
@@ -0,0 +1,6719 @@
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Engine.class.js */
+
+function TinyMCE_Engine() {
+	this.majorVersion = "2";
+	this.minorVersion = "0.6.1";
+	this.releaseDate = "2006-05-04";
+
+	this.instances = new Array();
+	this.switchClassCache = new Array();
+	this.windowArgs = new Array();
+	this.loadedFiles = new Array();
+	this.pendingFiles = new Array();
+	this.loadingIndex = 0;
+	this.configs = new Array();
+	this.currentConfig = 0;
+	this.eventHandlers = new Array();
+
+	// Browser check
+	var ua = navigator.userAgent;
+	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+	this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1);
+	this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1);
+	this.isGecko = ua.indexOf('Gecko') != -1;
+	this.isSafari = ua.indexOf('Safari') != -1;
+	this.isOpera = ua.indexOf('Opera') != -1;
+	this.isMac = ua.indexOf('Mac') != -1;
+	this.isNS7 = ua.indexOf('Netscape/7') != -1;
+	this.isNS71 = ua.indexOf('Netscape/7.1') != -1;
+	this.dialogCounter = 0;
+	this.plugins = new Array();
+	this.themes = new Array();
+	this.menus = new Array();
+	this.loadedPlugins = new Array();
+	this.buttonMap = new Array();
+	this.isLoaded = false;
+
+	// Fake MSIE on Opera and if Opera fakes IE, Gecko or Safari cancel those
+	if (this.isOpera) {
+		this.isMSIE = true;
+		this.isGecko = false;
+		this.isSafari =  false;
+	}
+
+	// TinyMCE editor id instance counter
+	this.idCounter = 0;
+};
+
+TinyMCE_Engine.prototype = {
+	init : function(settings) {
+		var theme;
+
+		this.settings = settings;
+
+		// Check if valid browser has execcommand support
+		if (typeof(document.execCommand) == 'undefined')
+			return;
+
+		// Get script base path
+		if (!tinyMCE.baseURL) {
+			var elements = document.getElementsByTagName('script');
+
+			for (var i=0; i<elements.length; i++) {
+				if (elements[i].src && (elements[i].src.indexOf("tiny_mce.js") != -1 || elements[i].src.indexOf("tiny_mce_dev.js") != -1 || elements[i].src.indexOf("tiny_mce_src.js") != -1 || elements[i].src.indexOf("tiny_mce_gzip") != -1)) {
+					var src = elements[i].src;
+
+					tinyMCE.srcMode = (src.indexOf('_src') != -1 || src.indexOf('_dev') != -1) ? '_src' : '';
+					tinyMCE.gzipMode = src.indexOf('_gzip') != -1;
+					src = src.substring(0, src.lastIndexOf('/'));
+
+					if (settings.exec_mode == "src" || settings.exec_mode == "normal")
+						tinyMCE.srcMode = settings.exec_mode == "src" ? '_src' : '';
+
+					tinyMCE.baseURL = src;
+					break;
+				}
+			}
+		}
+
+		// Get document base path
+		this.documentBasePath = document.location.href;
+		if (this.documentBasePath.indexOf('?') != -1)
+			this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.indexOf('?'));
+		this.documentURL = this.documentBasePath;
+		this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.lastIndexOf('/'));
+
+		// If not HTTP absolute
+		if (tinyMCE.baseURL.indexOf('://') == -1 && tinyMCE.baseURL.charAt(0) != '/') {
+			// If site absolute
+			tinyMCE.baseURL = this.documentBasePath + "/" + tinyMCE.baseURL;
+		}
+
+		// Set default values on settings
+		this._def("mode", "none");
+		this._def("theme", "advanced");
+		this._def("plugins", "", true);
+		this._def("language", "en");
+		this._def("docs_language", this.settings['language']);
+		this._def("elements", "");
+		this._def("textarea_trigger", "mce_editable");
+		this._def("editor_selector", "");
+		this._def("editor_deselector", "mceNoEditor");
+		this._def("valid_elements", "+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang]");
+		this._def("extended_valid_elements", "");
+		this._def("invalid_elements", "");
+		this._def("encoding", "");
+		this._def("urlconverter_callback", tinyMCE.getParam("urlconvertor_callback", "TinyMCE_Engine.prototype.convertURL"));
+		this._def("save_callback", "");
+		this._def("debug", false);
+		this._def("force_br_newlines", false);
+		this._def("force_p_newlines", true);
+		this._def("add_form_submit_trigger", true);
+		this._def("relative_urls", true);
+		this._def("remove_script_host", true);
+		this._def("focus_alert", true);
+		this._def("document_base_url", this.documentURL);
+		this._def("visual", true);
+		this._def("visual_table_class", "mceVisualAid");
+		this._def("setupcontent_callback", "");
+		this._def("fix_content_duplication", true);
+		this._def("custom_undo_redo", true);
+		this._def("custom_undo_redo_levels", -1);
+		this._def("custom_undo_redo_keyboard_shortcuts", true);
+		this._def("custom_undo_redo_restore_selection", true);
+		this._def("verify_html", true);
+		this._def("apply_source_formatting", false);
+		this._def("directionality", "ltr");
+		this._def("cleanup_on_startup", false);
+		this._def("inline_styles", false);
+		this._def("convert_newlines_to_brs", false);
+		this._def("auto_reset_designmode", true);
+		this._def("entities", "39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro", true);
+		this._def("entity_encoding", "named");
+		this._def("cleanup_callback", "");
+		this._def("add_unload_trigger", true);
+		this._def("ask", false);
+		this._def("nowrap", false);
+		this._def("auto_resize", false);
+		this._def("auto_focus", false);
+		this._def("cleanup", true);
+		this._def("remove_linebreaks", true);
+		this._def("button_tile_map", false);
+		this._def("submit_patch", true);
+		this._def("browsers", "msie,safari,gecko,opera", true);
+		this._def("dialog_type", "window");
+		this._def("accessibility_warnings", true);
+		this._def("accessibility_focus", true);
+		this._def("merge_styles_invalid_parents", "");
+		this._def("force_hex_style_colors", true);
+		this._def("trim_span_elements", true);
+		this._def("convert_fonts_to_spans", false);
+		this._def("doctype", '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');
+		this._def("font_size_classes", '');
+		this._def("font_size_style_values", 'xx-small,x-small,small,medium,large,x-large,xx-large', true);
+		this._def("event_elements", 'a,img', true);
+		this._def("convert_urls", true);
+		this._def("table_inline_editing", false);
+		this._def("object_resizing", true);
+		this._def("custom_shortcuts", true);
+		this._def("convert_on_click", false);
+		this._def("content_css", '');
+		this._def("fix_list_elements", false);
+		this._def("fix_table_elements", false);
+		this._def("strict_loading_mode", document.contentType == 'application/xhtml+xml');
+		this._def("hidden_tab_class", '');
+		this._def("display_tab_class", '');
+
+		// Force strict loading mode to false on non Gecko browsers
+		if (this.isMSIE && !this.isOpera)
+			this.settings.strict_loading_mode = false;
+
+		// Browser check IE
+		if (this.isMSIE && this.settings['browsers'].indexOf('msie') == -1)
+			return;
+
+		// Browser check Gecko
+		if (this.isGecko && this.settings['browsers'].indexOf('gecko') == -1)
+			return;
+
+		// Browser check Safari
+		if (this.isSafari && this.settings['browsers'].indexOf('safari') == -1)
+			return;
+
+		// Browser check Opera
+		if (this.isOpera && this.settings['browsers'].indexOf('opera') == -1)
+			return;
+
+		// If not super absolute make it so
+		var baseHREF = tinyMCE.settings['document_base_url'];
+		var h = document.location.href;
+		var p = h.indexOf('://');
+		if (p > 0 && document.location.protocol != "file:") {
+			p = h.indexOf('/', p + 3);
+			h = h.substring(0, p);
+
+			if (baseHREF.indexOf('://') == -1)
+				baseHREF = h + baseHREF;
+
+			tinyMCE.settings['document_base_url'] = baseHREF;
+			tinyMCE.settings['document_base_prefix'] = h;
+		}
+
+		// Trim away query part
+		if (baseHREF.indexOf('?') != -1)
+			baseHREF = baseHREF.substring(0, baseHREF.indexOf('?'));
+
+		this.settings['base_href'] = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/";
+
+		theme = this.settings['theme'];
+		this.blockRegExp = new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dt|dd|dir|fieldset|form|noscript|noframes|menu|isindex|samp)$", "i");
+		this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40);
+		this.uniqueURL = 'javascript:TINYMCE_UNIQUEURL();'; // Make unique URL non real URL
+		this.uniqueTag = '<div id="mceTMPElement" style="display: none">TMP</div>';
+		this.callbacks = new Array('onInit', 'getInfo', 'getEditorTemplate', 'setupContent', 'onChange', 'onPageLoad', 'handleNodeChange', 'initInstance', 'execCommand', 'getControlHTML', 'handleEvent', 'cleanup');
+
+		// Theme url
+		this.settings['theme_href'] = tinyMCE.baseURL + "/themes/" + theme;
+
+		if (!tinyMCE.isMSIE)
+			this.settings['force_br_newlines'] = false;
+
+		if (tinyMCE.getParam("popups_css", false)) {
+			var cssPath = tinyMCE.getParam("popups_css", "");
+
+			// Is relative
+			if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
+				this.settings['popups_css'] = this.documentBasePath + "/" + cssPath;
+			else
+				this.settings['popups_css'] = cssPath;
+		} else
+			this.settings['popups_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_popup.css";
+
+		if (tinyMCE.getParam("editor_css", false)) {
+			var cssPath = tinyMCE.getParam("editor_css", "");
+
+			// Is relative
+			if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/')
+				this.settings['editor_css'] = this.documentBasePath + "/" + cssPath;
+			else
+				this.settings['editor_css'] = cssPath;
+		} else
+			this.settings['editor_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css";
+
+		if (tinyMCE.settings['debug']) {
+			var msg = "Debug: \n";
+
+			msg += "baseURL: " + this.baseURL + "\n";
+			msg += "documentBasePath: " + this.documentBasePath + "\n";
+			msg += "content_css: " + this.settings['content_css'] + "\n";
+			msg += "popups_css: " + this.settings['popups_css'] + "\n";
+			msg += "editor_css: " + this.settings['editor_css'] + "\n";
+
+			alert(msg);
+		}
+
+		// Only do this once
+		if (this.configs.length == 0) {
+			// Is Safari enabled
+			if (this.isSafari && this.getParam('safari_warning', false))
+				alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false");
+
+			if (typeof(TinyMCECompressed) == "undefined") {
+				tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCE_Engine.prototype.onLoad);
+
+				if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+					if (document.body)
+						tinyMCE.addEvent(document.body, "readystatechange", TinyMCE_Engine.prototype.onLoad);
+					else
+						tinyMCE.addEvent(document, "readystatechange", TinyMCE_Engine.prototype.onLoad);
+				}
+
+				tinyMCE.addEvent(window, "load", TinyMCE_Engine.prototype.onLoad);
+				tinyMCE._addUnloadEvents();
+			}
+		}
+
+		this.loadScript(tinyMCE.baseURL + '/themes/' + this.settings['theme'] + '/editor_template' + tinyMCE.srcMode + '.js');
+		this.loadScript(tinyMCE.baseURL + '/langs/' + this.settings['language'] +  '.js');
+		this.loadCSS(this.settings['editor_css']);
+
+		// Add plugins
+		var p = tinyMCE.getParam('plugins', '', true, ',');
+		if (p.length > 0) {
+			for (var i=0; i<p.length; i++) {
+				if (p[i].charAt(0) != '-')
+					this.loadScript(tinyMCE.baseURL + '/plugins/' + p[i] + '/editor_plugin' + tinyMCE.srcMode + '.js');
+			}
+		}
+
+		// Setup entities
+		settings['cleanup_entities'] = new Array();
+		var entities = tinyMCE.getParam('entities', '', true, ',');
+		for (var i=0; i<entities.length; i+=2)
+			settings['cleanup_entities']['c' + entities[i]] = entities[i+1];
+
+		// Save away this config
+		settings['index'] = this.configs.length;
+		this.configs[this.configs.length] = settings;
+
+		// Start loading first one in chain
+		this.loadNextScript();
+	},
+
+	_addUnloadEvents : function() {
+		if (tinyMCE.isMSIE) {
+			if (tinyMCE.settings['add_unload_trigger']) {
+				tinyMCE.addEvent(window, "unload", TinyMCE_Engine.prototype.unloadHandler);
+				tinyMCE.addEvent(window.document, "beforeunload", TinyMCE_Engine.prototype.unloadHandler);
+			}
+		} else {
+			if (tinyMCE.settings['add_unload_trigger'])
+				tinyMCE.addEvent(window, "unload", function () {tinyMCE.triggerSave(true, true);});
+		}
+	},
+
+	_def : function(key, def_val, t) {
+		var v = tinyMCE.getParam(key, def_val);
+
+		v = t ? v.replace(/\s+/g,"") : v;
+
+		this.settings[key] = v;
+	},
+
+	hasPlugin : function(n) {
+		return typeof(this.plugins[n]) != "undefined" && this.plugins[n] != null;
+	},
+
+	addPlugin : function(n, p) {
+		var op = this.plugins[n];
+
+		// Use the previous plugin object base URL used when loading external plugins
+		p.baseURL = op ? op.baseURL : tinyMCE.baseURL + "/plugins/" + n;
+		this.plugins[n] = p;
+
+		this.loadNextScript();
+	},
+
+	setPluginBaseURL : function(n, u) {
+		var op = this.plugins[n];
+
+		if (op)
+			op.baseURL = u;
+		else
+			this.plugins[n] = {baseURL : u};
+	},
+
+	loadPlugin : function(n, u) {
+		u = u.indexOf('.js') != -1 ? u.substring(0, u.lastIndexOf('/')) : u;
+		u = u.charAt(u.length-1) == '/' ? u.substring(0, u.length-1) : u;
+		this.plugins[n] = {baseURL : u};
+		this.loadScript(u + "/editor_plugin" + (tinyMCE.srcMode ? '_src' : '') + ".js");
+	},
+
+	hasTheme : function(n) {
+		return typeof(this.themes[n]) != "undefined" && this.themes[n] != null;
+	},
+
+	addTheme : function(n, t) {
+		this.themes[n] = t;
+
+		this.loadNextScript();
+	},
+
+	addMenu : function(n, m) {
+		this.menus[n] = m;
+	},
+
+	hasMenu : function(n) {
+		return typeof(this.plugins[n]) != "undefined" && this.plugins[n] != null;
+	},
+
+	loadScript : function(url) {
+		var i;
+
+		for (i=0; i<this.loadedFiles.length; i++) {
+			if (this.loadedFiles[i] == url)
+				return;
+		}
+
+		if (tinyMCE.settings.strict_loading_mode)
+			this.pendingFiles[this.pendingFiles.length] = url;
+		else
+			document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></script>');
+
+		this.loadedFiles[this.loadedFiles.length] = url;
+	},
+
+	loadNextScript : function() {
+		var d = document, se;
+
+		if (!tinyMCE.settings.strict_loading_mode)
+			return;
+
+		if (this.loadingIndex < this.pendingFiles.length) {
+			se = d.createElementNS('http://www.w3.org/1999/xhtml', 'script');
+			se.setAttribute('language', 'javascript');
+			se.setAttribute('type', 'text/javascript');
+			se.setAttribute('src', this.pendingFiles[this.loadingIndex++]);
+
+			d.getElementsByTagName("head")[0].appendChild(se);
+		} else
+			this.loadingIndex = -1; // Done with loading
+	},
+
+	loadCSS : function(url) {
+		var ar = url.replace(/\s+/, '').split(',');
+		var lflen = 0, csslen = 0;
+		var skip = false;
+		var x = 0, i = 0, nl, le;
+
+		for (x = 0,csslen = ar.length; x<csslen; x++) {
+			ignore_css = false;
+
+			if (ar[x] != null && ar[x] != 'null' && ar[x].length > 0) {
+				/* Make sure it doesn't exist. */
+				for (i=0, lflen=this.loadedFiles.length; i<lflen; i++) {
+					if (this.loadedFiles[i] == ar[x]) {
+						skip = true;
+						break;
+					}
+				}
+
+				if (!skip) {
+					if (tinyMCE.settings.strict_loading_mode) {
+						nl = document.getElementsByTagName("head");
+
+						le = document.createElement('link');
+						le.setAttribute('href', ar[x]);
+						le.setAttribute('rel', 'stylesheet');
+						le.setAttribute('type', 'text/css');
+
+						nl[0].appendChild(le);			
+					} else
+						document.write('<link href="' + ar[x] + '" rel="stylesheet" type="text/css" />');
+
+					this.loadedFiles[this.loadedFiles.length] = ar[x];
+				}
+			}
+		}
+	},
+
+	importCSS : function(doc, css) {
+		var css_ary = css.replace(/\s+/, '').split(',');
+		var csslen, elm, headArr, x, css_file;
+
+		for (x = 0, csslen = css_ary.length; x<csslen; x++) {
+			css_file = css_ary[x];
+
+			if (css_file != null && css_file != 'null' && css_file.length > 0) {
+				// Is relative, make absolute
+				if (css_file.indexOf('://') == -1 && css_file.charAt(0) != '/')
+					css_file = this.documentBasePath + "/" + css_file;
+
+				if (typeof(doc.createStyleSheet) == "undefined") {
+					elm = doc.createElement("link");
+
+					elm.rel = "stylesheet";
+					elm.href = css_file;
+
+					if ((headArr = doc.getElementsByTagName("head")) != null && headArr.length > 0)
+						headArr[0].appendChild(elm);
+				} else
+					doc.createStyleSheet(css_file);
+			}
+		}
+	},
+
+	confirmAdd : function(e, settings) {
+		var elm = tinyMCE.isMSIE ? event.srcElement : e.target;
+		var elementId = elm.name ? elm.name : elm.id;
+
+		tinyMCE.settings = settings;
+
+		if (tinyMCE.settings['convert_on_click'] || (!elm.getAttribute('mce_noask') && confirm(tinyMCELang['lang_edit_confirm'])))
+			tinyMCE.addMCEControl(elm, elementId);
+
+		elm.setAttribute('mce_noask', 'true');
+	},
+
+	updateContent : function(form_element_name) {
+		// Find MCE instance linked to given form element and copy it's value
+		var formElement = document.getElementById(form_element_name);
+		for (var n in tinyMCE.instances) {
+			var inst = tinyMCE.instances[n];
+			if (!tinyMCE.isInstance(inst))
+				continue;
+
+			inst.switchSettings();
+
+			if (inst.formElement == formElement) {
+				var doc = inst.getDoc();
+		
+				tinyMCE._setHTML(doc, inst.formElement.value);
+
+				if (!tinyMCE.isMSIE)
+					doc.body.innerHTML = tinyMCE._cleanupHTML(inst, doc, this.settings, doc.body, inst.visualAid);
+			}
+		}
+	},
+
+	addMCEControl : function(replace_element, form_element_name, target_document) {
+		var id = "mce_editor_" + tinyMCE.idCounter++;
+		var inst = new TinyMCE_Control(tinyMCE.settings);
+
+		inst.editorId = id;
+		this.instances[id] = inst;
+
+		inst._onAdd(replace_element, form_element_name, target_document);
+	},
+
+	removeMCEControl : function(editor_id) {
+		var inst = tinyMCE.getInstanceById(editor_id);
+
+		if (inst) {
+			inst.switchSettings();
+
+			editor_id = inst.editorId;
+			var html = tinyMCE.getContent(editor_id);
+
+			// Remove editor instance from instances array
+			var tmpInstances = new Array();
+			for (var instanceName in tinyMCE.instances) {
+				var instance = tinyMCE.instances[instanceName];
+				if (!tinyMCE.isInstance(instance))
+					continue;
+
+				if (instanceName != editor_id)
+						tmpInstances[instanceName] = instance;
+			}
+			tinyMCE.instances = tmpInstances;
+
+			tinyMCE.selectedElement = null;
+			tinyMCE.selectedInstance = null;
+
+			// Remove element
+			var replaceElement = document.getElementById(editor_id + "_parent");
+			var oldTargetElement = inst.oldTargetElement;
+			var targetName = oldTargetElement.nodeName.toLowerCase();
+
+			if (targetName == "textarea" || targetName == "input") {
+				// Just show the old text area
+				replaceElement.parentNode.removeChild(replaceElement);
+				oldTargetElement.style.display = "inline";
+				oldTargetElement.value = html;
+			} else {
+				oldTargetElement.innerHTML = html;
+				oldTargetElement.style.display = 'block';
+
+				replaceElement.parentNode.insertBefore(oldTargetElement, replaceElement);
+				replaceElement.parentNode.removeChild(replaceElement);
+			}
+		}
+	},
+
+	triggerSave : function(skip_cleanup, skip_callback) {
+		var inst, n;
+
+		// Default to false
+		if (typeof(skip_cleanup) == "undefined")
+			skip_cleanup = false;
+
+		// Default to false
+		if (typeof(skip_callback) == "undefined")
+			skip_callback = false;
+
+		// Cleanup and set all form fields
+		for (n in tinyMCE.instances) {
+			inst = tinyMCE.instances[n];
+
+			if (!tinyMCE.isInstance(inst))
+				continue;
+
+			inst.triggerSave(skip_cleanup, skip_callback);
+		}
+	},
+
+	resetForm : function(form_index) {
+		var i, inst, n, formObj = document.forms[form_index];
+
+		for (n in tinyMCE.instances) {
+			inst = tinyMCE.instances[n];
+
+			if (!tinyMCE.isInstance(inst))
+				continue;
+
+			inst.switchSettings();
+
+			for (i=0; i<formObj.elements.length; i++) {
+				if (inst.formTargetElementId == formObj.elements[i].name)
+					inst.getBody().innerHTML = inst.startContent;
+			}
+		}
+	},
+
+	execInstanceCommand : function(editor_id, command, user_interface, value, focus) {
+		var inst = tinyMCE.getInstanceById(editor_id);
+		if (inst) {
+			if (typeof(focus) == "undefined")
+				focus = true;
+
+			if (focus)
+				inst.contentWindow.focus();
+
+			// Reset design mode if lost
+			inst.autoResetDesignMode();
+
+			this.selectedElement = inst.getFocusElement();
+			this.selectedInstance = inst;
+			tinyMCE.execCommand(command, user_interface, value);
+
+			// Cancel event so it doesn't call onbeforeonunlaod
+			if (tinyMCE.isMSIE && window.event != null)
+				tinyMCE.cancelEvent(window.event);
+		}
+	},
+
+	execCommand : function(command, user_interface, value) {
+		// Default input
+		user_interface = user_interface ? user_interface : false;
+		value = value ? value : null;
+
+		if (tinyMCE.selectedInstance)
+			tinyMCE.selectedInstance.switchSettings();
+
+		switch (command) {
+			case 'mceHelp':
+				tinyMCE.openWindow({
+					file : 'about.htm',
+					width : 480,
+					height : 380
+				}, {
+					tinymce_version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion,
+					tinymce_releasedate : tinyMCE.releaseDate,
+					inline : "yes"
+				});
+			return;
+
+			case 'mceFocus':
+				var inst = tinyMCE.getInstanceById(value);
+				if (inst)
+					inst.contentWindow.focus();
+			return;
+
+			case "mceAddControl":
+			case "mceAddEditor":
+				tinyMCE.addMCEControl(tinyMCE._getElementById(value), value);
+				return;
+
+			case "mceAddFrameControl":
+				tinyMCE.addMCEControl(tinyMCE._getElementById(value['element'], value['document']), value['element'], value['document']);
+				return;
+
+			case "mceRemoveControl":
+			case "mceRemoveEditor":
+				tinyMCE.removeMCEControl(value);
+				return;
+
+			case "mceResetDesignMode":
+				// Resets the designmode state of the editors in Gecko
+				if (!tinyMCE.isMSIE) {
+					for (var n in tinyMCE.instances) {
+						if (!tinyMCE.isInstance(tinyMCE.instances[n]))
+							continue;
+
+						try {
+							tinyMCE.instances[n].getDoc().designMode = "on";
+						} catch (e) {
+							// Ignore any errors
+						}
+					}
+				}
+
+				return;
+		}
+
+		if (this.selectedInstance) {
+			this.selectedInstance.execCommand(command, user_interface, value);
+		} else if (tinyMCE.settings['focus_alert'])
+			alert(tinyMCELang['lang_focus_alert']);
+	},
+
+	_createIFrame : function(replace_element, doc, win) {
+		var iframe, id = replace_element.getAttribute("id");
+		var aw, ah;
+
+		if (typeof(doc) == "undefined")
+			doc = document;
+
+		if (typeof(win) == "undefined")
+			win = window;
+
+		iframe = doc.createElement("iframe");
+
+		aw = "" + tinyMCE.settings['area_width'];
+		ah = "" + tinyMCE.settings['area_height'];
+
+		if (aw.indexOf('%') == -1) {
+			aw = parseInt(aw);
+			aw = aw < 0 ? 300 : aw;
+			aw = aw + "px";
+		}
+
+		if (ah.indexOf('%') == -1) {
+			ah = parseInt(ah);
+			ah = ah < 0 ? 240 : ah;
+			ah = ah + "px";
+		}
+
+		iframe.setAttribute("id", id);
+		iframe.setAttribute("class", "mceEditorIframe");
+		iframe.setAttribute("border", "0");
+		iframe.setAttribute("frameBorder", "0");
+		iframe.setAttribute("marginWidth", "0");
+		iframe.setAttribute("marginHeight", "0");
+		iframe.setAttribute("leftMargin", "0");
+		iframe.setAttribute("topMargin", "0");
+		iframe.setAttribute("width", aw);
+		iframe.setAttribute("height", ah);
+		iframe.setAttribute("allowtransparency", "true");
+		iframe.className = 'mceEditorIframe';
+
+		if (tinyMCE.settings["auto_resize"])
+			iframe.setAttribute("scrolling", "no");
+
+		// Must have a src element in MSIE HTTPs breaks aswell as absoute URLs
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+			iframe.setAttribute("src", this.settings['default_document']);
+
+		iframe.style.width = aw;
+		iframe.style.height = ah;
+
+		// Ugly hack for Gecko problem in strict mode
+		if (tinyMCE.settings.strict_loading_mode)
+			iframe.style.marginBottom = '-5px';
+
+		// MSIE 5.0 issue
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+			replace_element.outerHTML = iframe.outerHTML;
+		else
+			replace_element.parentNode.replaceChild(iframe, replace_element);
+
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+			return win.frames[id];
+		else
+			return iframe;
+	},
+
+	setupContent : function(editor_id) {
+		var inst = tinyMCE.instances[editor_id];
+		var doc = inst.getDoc();
+		var head = doc.getElementsByTagName('head').item(0);
+		var content = inst.startContent;
+
+		// HTML values get XML encoded in strict mode
+		if (tinyMCE.settings.strict_loading_mode) {
+			content = content.replace(/&lt;/g, '<');
+			content = content.replace(/&gt;/g, '>');
+			content = content.replace(/&quot;/g, '"');
+			content = content.replace(/&amp;/g, '&');
+		}
+
+		inst.switchSettings();
+
+		// Not loaded correctly hit it again, Mozilla bug #997860
+		if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") {
+			// This part will remove the designMode status
+			// Failes first time in Firefox 1.5b2 on Mac
+			try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {}
+			window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000);
+			return;
+		}
+
+		if (!head) {
+			window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10);
+			return;
+		}
+
+		// Import theme specific content CSS the user specific
+		tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css");
+		tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']);
+		tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst);
+
+		// Setup keyboard shortcuts
+		if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) {
+			inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo');
+			inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo');
+		}
+
+		// Add default shortcuts for gecko
+		if (tinyMCE.isGecko) {
+			inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold');
+			inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic');
+			inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline');
+		}
+
+		// Setup span styles
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			inst.getDoc().body.setAttribute('id', 'mceSpanFonts');
+
+		if (tinyMCE.settings['nowrap'])
+			doc.body.style.whiteSpace = "nowrap";
+
+		doc.body.dir = this.settings['directionality'];
+		doc.editorId = editor_id;
+
+		// Add on document element in Mozilla
+		if (!tinyMCE.isMSIE)
+			doc.documentElement.editorId = editor_id;
+
+		inst.setBaseHREF(tinyMCE.settings['base_href']);
+
+		// Replace new line characters to BRs
+		if (tinyMCE.settings['convert_newlines_to_brs']) {
+			content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi");
+			content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi");
+			content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi");
+		}
+
+		// Open closed anchors
+	//	content = content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>');
+
+		// Call custom cleanup code
+		content = tinyMCE.storeAwayURLs(content);
+		content = tinyMCE._customCleanup(inst, "insert_to_editor", content);
+
+		if (tinyMCE.isMSIE) {
+			// Ugly!!!
+			window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500);
+
+			if (tinyMCE.settings["force_br_newlines"])
+				doc.styleSheets[0].addRule("p", "margin: 0;");
+
+			var body = inst.getBody();
+			body.editorId = editor_id;
+		}
+
+		content = tinyMCE.cleanupHTMLCode(content);
+
+		// Fix for bug #958637
+		if (!tinyMCE.isMSIE) {
+			var contentElement = inst.getDoc().createElement("body");
+			var doc = inst.getDoc();
+
+			contentElement.innerHTML = content;
+
+			// Remove weridness!
+			if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt'])
+				content = content.replace(new RegExp('&lt;&gt;', 'g'), "");
+
+			if (tinyMCE.settings['cleanup_on_startup'])
+				tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement));
+			else {
+				// Convert all strong/em to b/i
+				content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi");
+				content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi");
+				content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi");
+				content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi");
+				content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi");
+				tinyMCE.setInnerHTML(inst.getBody(), content);
+			}
+
+			tinyMCE.convertAllRelativeURLs(inst.getBody());
+		} else {
+			if (tinyMCE.settings['cleanup_on_startup']) {
+				tinyMCE._setHTML(inst.getDoc(), content);
+
+				// Produces permission denied error in MSIE 5.5
+				eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}');
+			} else
+				tinyMCE._setHTML(inst.getDoc(), content);
+		}
+
+		// Fix for bug #957681
+		//inst.getDoc().designMode = inst.getDoc().designMode;
+
+		// Setup element references
+		var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent');
+		inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling;
+
+		tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst);
+		tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc());
+
+		// Re-add design mode on mozilla
+		if (!tinyMCE.isMSIE)
+			tinyMCE.addEventHandlers(inst);
+
+		// Add blur handler
+		if (tinyMCE.isMSIE) {
+			tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch);
+			tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953
+
+			// Workaround for drag drop/copy paste base href bug
+			if (!tinyMCE.isOpera) {
+				tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove);
+				tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch);
+				tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch);
+			}
+		}
+
+		// Trigger node change, this call locks buttons for tables and so forth
+		tinyMCE.selectedInstance = inst;
+		tinyMCE.selectedElement = inst.contentWindow.document.body;
+
+		// Call custom DOM cleanup
+		tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody());
+		tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody());
+		tinyMCE._setEventsEnabled(inst.getBody(), false);
+		tinyMCE.cleanupAnchors(inst.getDoc());
+
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			tinyMCE.convertSpansToFonts(inst.getDoc());
+
+		inst.startContent = tinyMCE.trim(inst.getBody().innerHTML);
+		inst.undoRedo.add({ content : inst.startContent });
+
+		// Cleanup any mess left from storyAwayURLs
+		if (tinyMCE.isGecko) {
+			// Remove mce_src from textnodes and comments
+			tinyMCE.selectNodes(inst.getBody(), function(n) {
+				if (n.nodeType == 3 || n.nodeType == 8) {
+					n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
+					n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
+				}
+
+				return false;
+			});
+		}
+
+		// Cleanup any mess left from storyAwayURLs
+		tinyMCE._removeInternal(inst.getBody());
+
+		tinyMCE.selectedInstance = inst;
+		tinyMCE.triggerNodeChange(false, true);
+	},
+
+	storeAwayURLs : function(s) {
+		// Remove all mce_src, mce_href and replace them with new ones
+	//	s = s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
+	//	s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');
+
+		if (!s.match(/(mce_src|mce_href)/gi, s)) {
+			s = s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'src="$1" mce_src="$1"');
+			s = s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'href="$1" mce_href="$1"');
+		}
+
+		return s;
+	},
+
+	_removeInternal : function(n) {
+		if (tinyMCE.isGecko) {
+			// Remove mce_src from textnodes and comments
+			tinyMCE.selectNodes(n, function(n) {
+				if (n.nodeType == 3 || n.nodeType == 8) {
+					n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
+					n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
+				}
+
+				return false;
+			});
+		}
+	},
+
+	removeTinyMCEFormElements : function(form_obj) {
+		// Check if form is valid
+		if (typeof(form_obj) == "undefined" || form_obj == null)
+			return;
+
+		// If not a form, find the form
+		if (form_obj.nodeName != "FORM") {
+			if (form_obj.form)
+				form_obj = form_obj.form;
+			else
+				form_obj = tinyMCE.getParentElement(form_obj, "form");
+		}
+
+		// Still nothing
+		if (form_obj == null)
+			return;
+
+		// Disable all UI form elements that TinyMCE created
+		for (var i=0; i<form_obj.elements.length; i++) {
+			var elementId = form_obj.elements[i].name ? form_obj.elements[i].name : form_obj.elements[i].id;
+
+			if (elementId.indexOf('mce_editor_') == 0)
+				form_obj.elements[i].disabled = true;
+		}
+	},
+
+	handleEvent : function(e) {
+		var inst = tinyMCE.selectedInstance;
+
+		// Remove odd, error
+		if (typeof(tinyMCE) == "undefined")
+			return true;
+
+		//tinyMCE.debug(e.type + " " + e.target.nodeName + " " + (e.relatedTarget ? e.relatedTarget.nodeName : ""));
+
+		if (tinyMCE.executeCallback(tinyMCE.selectedInstance, 'handle_event_callback', 'handleEvent', e))
+			return false;
+
+		switch (e.type) {
+			case "beforedeactivate": // Was added due to bug #1439953
+			case "blur":
+				if (tinyMCE.selectedInstance)
+					tinyMCE.selectedInstance.execCommand('mceEndTyping');
+
+				tinyMCE.hideMenus();
+
+				return;
+
+			// Workaround for drag drop/copy paste base href bug
+			case "drop":
+			case "beforepaste":
+				if (tinyMCE.selectedInstance)
+					tinyMCE.selectedInstance.setBaseHREF(null);
+
+				// Fixes odd MSIE bug where drag/droping elements in a iframe with height 100% breaks
+				// This logic forces the width/height to be in pixels while the user is drag/dropping
+				if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+					var ife = tinyMCE.selectedInstance.iframeElement;
+
+					/*if (ife.style.width.indexOf('%') != -1) {
+						ife._oldWidth = ife.width.height;
+						ife.style.width = ife.clientWidth;
+					}*/
+
+					if (ife.style.height.indexOf('%') != -1) {
+						ife._oldHeight = ife.style.height;
+						ife.style.height = ife.clientHeight;
+					}
+				}
+
+				window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings['base_href']);tinyMCE._resetIframeHeight();", 1);
+				return;
+
+			case "submit":
+				tinyMCE.removeTinyMCEFormElements(tinyMCE.isMSIE ? window.event.srcElement : e.target);
+				tinyMCE.triggerSave();
+				tinyMCE.isNotDirty = true;
+				return;
+
+			case "reset":
+				var formObj = tinyMCE.isMSIE ? window.event.srcElement : e.target;
+
+				for (var i=0; i<document.forms.length; i++) {
+					if (document.forms[i] == formObj)
+						window.setTimeout('tinyMCE.resetForm(' + i + ');', 10);
+				}
+
+				return;
+
+			case "keypress":
+				if (inst && inst.handleShortcut(e))
+					return false;
+
+				if (e.target.editorId) {
+					tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
+				} else {
+					if (e.target.ownerDocument.editorId)
+						tinyMCE.selectedInstance = tinyMCE.instances[e.target.ownerDocument.editorId];
+				}
+
+				if (tinyMCE.selectedInstance)
+					tinyMCE.selectedInstance.switchSettings();
+
+				// Insert P element
+				if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && e.keyCode == 13 && !e.shiftKey) {
+					// Insert P element instead of BR
+					if (TinyMCE_ForceParagraphs._insertPara(tinyMCE.selectedInstance, e)) {
+						// Cancel event
+						tinyMCE.execCommand("mceAddUndoLevel");
+						tinyMCE.cancelEvent(e);
+						return false;
+					}
+				}
+
+				// Handle backspace
+				if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {
+					// Insert P element instead of BR
+					if (TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance, e.type)) {
+						// Cancel event
+						tinyMCE.execCommand("mceAddUndoLevel");
+						tinyMCE.cancelEvent(e);
+						return false;
+					}
+				}
+
+				// Return key pressed
+				if (tinyMCE.isMSIE && tinyMCE.settings['force_br_newlines'] && e.keyCode == 13) {
+					if (e.target.editorId)
+						tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
+
+					if (tinyMCE.selectedInstance) {
+						var sel = tinyMCE.selectedInstance.getDoc().selection;
+						var rng = sel.createRange();
+
+						if (tinyMCE.getParentElement(rng.parentElement(), "li") != null)
+							return false;
+
+						// Cancel event
+						e.returnValue = false;
+						e.cancelBubble = true;
+
+						// Insert BR element
+						rng.pasteHTML("<br />");
+						rng.collapse(false);
+						rng.select();
+
+						tinyMCE.execCommand("mceAddUndoLevel");
+						tinyMCE.triggerNodeChange(false);
+						return false;
+					}
+				}
+
+				// Backspace or delete
+				if (e.keyCode == 8 || e.keyCode == 46) {
+					tinyMCE.selectedElement = e.target;
+					tinyMCE.linkElement = tinyMCE.getParentElement(e.target, "a");
+					tinyMCE.imgElement = tinyMCE.getParentElement(e.target, "img");
+					tinyMCE.triggerNodeChange(false);
+				}
+
+				return false;
+			break;
+
+			case "keyup":
+			case "keydown":
+				tinyMCE.hideMenus();
+				tinyMCE.hasMouseMoved = false;
+
+				if (inst && inst.handleShortcut(e))
+					return false;
+
+				if (e.target.editorId)
+					tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
+				else
+					return;
+
+				if (tinyMCE.selectedInstance)
+					tinyMCE.selectedInstance.switchSettings();
+
+				var inst = tinyMCE.selectedInstance;
+
+				// Handle backspace
+				if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {
+					// Insert P element instead of BR
+					if (TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance, e.type)) {
+						// Cancel event
+						tinyMCE.execCommand("mceAddUndoLevel");
+						e.preventDefault();
+						return false;
+					}
+				}
+
+				tinyMCE.selectedElement = null;
+				tinyMCE.selectedNode = null;
+				var elm = tinyMCE.selectedInstance.getFocusElement();
+				tinyMCE.linkElement = tinyMCE.getParentElement(elm, "a");
+				tinyMCE.imgElement = tinyMCE.getParentElement(elm, "img");
+				tinyMCE.selectedElement = elm;
+
+				// Update visualaids on tabs
+				if (tinyMCE.isGecko && e.type == "keyup" && e.keyCode == 9)
+					tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(), true, tinyMCE.settings['visual'], tinyMCE.selectedInstance);
+
+				// Fix empty elements on return/enter, check where enter occured
+				if (tinyMCE.isMSIE && e.type == "keydown" && e.keyCode == 13)
+					tinyMCE.enterKeyElement = tinyMCE.selectedInstance.getFocusElement();
+
+				// Fix empty elements on return/enter
+				if (tinyMCE.isMSIE && e.type == "keyup" && e.keyCode == 13) {
+					var elm = tinyMCE.enterKeyElement;
+					if (elm) {
+						var re = new RegExp('^HR|IMG|BR$','g'); // Skip these
+						var dre = new RegExp('^H[1-6]$','g'); // Add double on these
+
+						if (!elm.hasChildNodes() && !re.test(elm.nodeName)) {
+							if (dre.test(elm.nodeName))
+								elm.innerHTML = "&nbsp;&nbsp;";
+							else
+								elm.innerHTML = "&nbsp;";
+						}
+					}
+				}
+
+				// Check if it's a position key
+				var keys = tinyMCE.posKeyCodes;
+				var posKey = false;
+				for (var i=0; i<keys.length; i++) {
+					if (keys[i] == e.keyCode) {
+						posKey = true;
+						break;
+					}
+				}
+
+				// MSIE custom key handling
+				if (tinyMCE.isMSIE && tinyMCE.settings['custom_undo_redo']) {
+					var keys = new Array(8,46); // Backspace,Delete
+					for (var i=0; i<keys.length; i++) {
+						if (keys[i] == e.keyCode) {
+							if (e.type == "keyup")
+								tinyMCE.triggerNodeChange(false);
+						}
+					}
+				}
+
+				// If Ctrl key
+				if (e.keyCode == 17)
+					return true;
+
+				// Handle Undo/Redo when typing content
+
+				// Start typing (non position key)
+				if (!posKey && e.type == "keyup")
+					tinyMCE.execCommand("mceStartTyping");
+
+				// Store undo bookmark
+				if (e.type == "keydown" && (posKey || e.ctrlKey) && inst)
+					inst.undoBookmark = inst.selection.getBookmark();
+
+				// End typing (position key) or some Ctrl event
+				if (e.type == "keyup" && (posKey || e.ctrlKey))
+					tinyMCE.execCommand("mceEndTyping");
+
+				if (posKey && e.type == "keyup")
+					tinyMCE.triggerNodeChange(false);
+
+				if (tinyMCE.isMSIE && e.ctrlKey)
+					window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+			break;
+
+			case "mousedown":
+			case "mouseup":
+			case "click":
+			case "focus":
+				tinyMCE.hideMenus();
+
+				if (tinyMCE.selectedInstance) {
+					tinyMCE.selectedInstance.switchSettings();
+					tinyMCE.selectedInstance.isFocused = true;
+				}
+
+				// Check instance event trigged on
+				var targetBody = tinyMCE.getParentElement(e.target, "body");
+				for (var instanceName in tinyMCE.instances) {
+					if (!tinyMCE.isInstance(tinyMCE.instances[instanceName]))
+						continue;
+
+					var inst = tinyMCE.instances[instanceName];
+
+					// Reset design mode if lost (on everything just in case)
+					inst.autoResetDesignMode();
+
+					if (inst.getBody() == targetBody) {
+						tinyMCE.selectedInstance = inst;
+						tinyMCE.selectedElement = e.target;
+						tinyMCE.linkElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");
+						tinyMCE.imgElement = tinyMCE.getParentElement(tinyMCE.selectedElement, "img");
+						break;
+					}
+				}
+
+				// Add first bookmark location
+				if (!tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark)
+					tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark = tinyMCE.selectedInstance.selection.getBookmark();
+
+				if (tinyMCE.isSafari) {
+					tinyMCE.selectedInstance.lastSafariSelection = tinyMCE.selectedInstance.selection.getBookmark();
+					tinyMCE.selectedInstance.lastSafariSelectedElement = tinyMCE.selectedElement;
+
+					var lnk = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");
+
+					// Patch the darned link
+					if (lnk && e.type == "mousedown") {
+						lnk.setAttribute("mce_real_href", lnk.getAttribute("href"));
+						lnk.setAttribute("href", "javascript:void(0);");
+					}
+
+					// Patch back
+					if (lnk && e.type == "click") {
+						window.setTimeout(function() {
+							lnk.setAttribute("href", lnk.getAttribute("mce_real_href"));
+							lnk.removeAttribute("mce_real_href");
+						}, 10);
+					}
+				}
+
+				// Reset selected node
+				if (e.type != "focus")
+					tinyMCE.selectedNode = null;
+
+				tinyMCE.triggerNodeChange(false);
+				tinyMCE.execCommand("mceEndTyping");
+
+				if (e.type == "mouseup")
+					tinyMCE.execCommand("mceAddUndoLevel");
+
+				// Just in case
+				if (!tinyMCE.selectedInstance && e.target.editorId)
+					tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];
+
+				return false;
+			break;
+		}
+	},
+
+	getButtonHTML : function(id, lang, img, cmd, ui, val) {
+		var h = '', m, x;
+
+		cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + cmd + '\'';
+
+		if (typeof(ui) != "undefined" && ui != null)
+			cmd += ',' + ui;
+
+		if (typeof(val) != "undefined" && val != null)
+			cmd += ",'" + val + "'";
+
+		cmd += ');';
+
+		// Use tilemaps when enabled and found and never in MSIE since it loads the tile each time from cache if cahce is disabled
+		if (tinyMCE.getParam('button_tile_map') && (!tinyMCE.isMSIE || tinyMCE.isOpera) && (m = this.buttonMap[id]) != null && (tinyMCE.getParam("language") == "en" || img.indexOf('$lang') == -1)) {
+			// Tiled button
+			x = 0 - (m * 20) == 0 ? '0' : 0 - (m * 20);
+			h += '<a id="{$editor_id}_' + id + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceTiledButton mceButtonNormal" target="_self">';
+			h += '<img src="{$themeurl}/images/spacer.gif" style="background-position: ' + x + 'px 0" title="{$' + lang + '}" />';
+			h += '</a>';
+		} else {
+			// Normal button
+			h += '<a id="{$editor_id}_' + id + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceButtonNormal" target="_self">';
+			h += '<img src="' + img + '" title="{$' + lang + '}" />';
+			h += '</a>';
+		}
+
+		return h;
+	},
+
+	addButtonMap : function(m) {
+		var i, a = m.replace(/\s+/, '').split(',');
+
+		for (i=0; i<a.length; i++)
+			this.buttonMap[a[i]] = i;
+	},
+
+	submitPatch : function() {
+		tinyMCE.removeTinyMCEFormElements(this);
+		tinyMCE.triggerSave();
+		this.mceOldSubmit();
+		tinyMCE.isNotDirty = true;
+	},
+
+	onLoad : function() {
+		// Wait for everything to be loaded first
+		if (tinyMCE.settings.strict_loading_mode && this.loadingIndex != -1) {
+			window.setTimeout('tinyMCE.onLoad();', 1);
+			return;
+		}
+
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera && window.event.type == "readystatechange" && document.readyState != "complete")
+			return true;
+
+		if (tinyMCE.isLoaded)
+			return true;
+
+		tinyMCE.isLoaded = true;
+
+		tinyMCE.dispatchCallback(null, 'onpageload', 'onPageLoad');
+
+		for (var c=0; c<tinyMCE.configs.length; c++) {
+			tinyMCE.settings = tinyMCE.configs[c];
+
+			var selector = tinyMCE.getParam("editor_selector");
+			var deselector = tinyMCE.getParam("editor_deselector");
+			var elementRefAr = new Array();
+
+			// Add submit triggers
+			if (document.forms && tinyMCE.settings['add_form_submit_trigger'] && !tinyMCE.submitTriggers) {
+				for (var i=0; i<document.forms.length; i++) {
+					var form = document.forms[i];
+
+					tinyMCE.addEvent(form, "submit", TinyMCE_Engine.prototype.handleEvent);
+					tinyMCE.addEvent(form, "reset", TinyMCE_Engine.prototype.handleEvent);
+					tinyMCE.submitTriggers = true; // Do it only once
+
+					// Patch the form.submit function
+					if (tinyMCE.settings['submit_patch']) {
+						try {
+							form.mceOldSubmit = form.submit;
+							form.submit = TinyMCE_Engine.prototype.submitPatch;
+						} catch (e) {
+							// Do nothing
+						}
+					}
+				}
+			}
+
+			// Add editor instances based on mode
+			var mode = tinyMCE.settings['mode'];
+			switch (mode) {
+				case "exact":
+					var elements = tinyMCE.getParam('elements', '', true, ',');
+
+					for (var i=0; i<elements.length; i++) {
+						var element = tinyMCE._getElementById(elements[i]);
+						var trigger = element ? element.getAttribute(tinyMCE.settings['textarea_trigger']) : "";
+
+						if (tinyMCE.getAttrib(element, "class").indexOf(deselector) != -1)
+							continue;
+
+						if (trigger == "false")
+							continue;
+
+						if ((tinyMCE.settings['ask'] || tinyMCE.settings['convert_on_click']) && element) {
+							elementRefAr[elementRefAr.length] = element;
+							continue;
+						}
+
+						if (element)
+							tinyMCE.addMCEControl(element, elements[i]);
+						else if (tinyMCE.settings['debug'])
+							alert("Error: Could not find element by id or name: " + elements[i]);
+					}
+				break;
+
+				case "specific_textareas":
+				case "textareas":
+					var nodeList = document.getElementsByTagName("textarea");
+
+					for (var i=0; i<nodeList.length; i++) {
+						var elm = nodeList.item(i);
+						var trigger = elm.getAttribute(tinyMCE.settings['textarea_trigger']);
+
+						if (selector != '' && tinyMCE.getAttrib(elm, "class").indexOf(selector) == -1)
+							continue;
+
+						if (selector != '')
+							trigger = selector != "" ? "true" : "";
+
+						if (tinyMCE.getAttrib(elm, "class").indexOf(deselector) != -1)
+							continue;
+
+						if ((mode == "specific_textareas" && trigger == "true") || (mode == "textareas" && trigger != "false"))
+							elementRefAr[elementRefAr.length] = elm;
+					}
+				break;
+			}
+
+			for (var i=0; i<elementRefAr.length; i++) {
+				var element = elementRefAr[i];
+				var elementId = element.name ? element.name : element.id;
+
+				if (tinyMCE.settings['ask'] || tinyMCE.settings['convert_on_click']) {
+					// Focus breaks in Mozilla
+					if (tinyMCE.isGecko) {
+						var settings = tinyMCE.settings;
+
+						tinyMCE.addEvent(element, "focus", function (e) {window.setTimeout(function() {TinyMCE_Engine.prototype.confirmAdd(e, settings);}, 10);});
+
+						if (element.nodeName != "TEXTAREA" && element.nodeName != "INPUT")
+							tinyMCE.addEvent(element, "click", function (e) {window.setTimeout(function() {TinyMCE_Engine.prototype.confirmAdd(e, settings);}, 10);});
+						// tinyMCE.addEvent(element, "mouseover", function (e) {window.setTimeout(function() {TinyMCE_Engine.prototype.confirmAdd(e, settings);}, 10);});
+					} else {
+						var settings = tinyMCE.settings;
+
+						tinyMCE.addEvent(element, "focus", function () { TinyMCE_Engine.prototype.confirmAdd(null, settings); });
+						tinyMCE.addEvent(element, "click", function () { TinyMCE_Engine.prototype.confirmAdd(null, settings); });
+						// tinyMCE.addEvent(element, "mouseenter", function () { TinyMCE_Engine.prototype.confirmAdd(null, settings); });
+					}
+				} else
+					tinyMCE.addMCEControl(element, elementId);
+			}
+
+			// Handle auto focus
+			if (tinyMCE.settings['auto_focus']) {
+				window.setTimeout(function () {
+					var inst = tinyMCE.getInstanceById(tinyMCE.settings['auto_focus']);
+					inst.selection.selectNode(inst.getBody(), true, true);
+					inst.contentWindow.focus();
+				}, 10);
+			}
+
+			tinyMCE.dispatchCallback(null, 'oninit', 'onInit');
+		}
+	},
+
+	isInstance : function(o) {
+		return o != null && typeof(o) == "object" && o.isTinyMCE_Control;
+	},
+
+	getParam : function(name, default_value, strip_whitespace, split_chr) {
+		var value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
+
+		// Fix bool values
+		if (value == "true" || value == "false")
+			return (value == "true");
+
+		if (strip_whitespace)
+			value = tinyMCE.regexpReplace(value, "[ \t\r\n]", "");
+
+		if (typeof(split_chr) != "undefined" && split_chr != null) {
+			value = value.split(split_chr);
+			var outArray = new Array();
+
+			for (var i=0; i<value.length; i++) {
+				if (value[i] && value[i] != "")
+					outArray[outArray.length] = value[i];
+			}
+
+			value = outArray;
+		}
+
+		return value;
+	},
+
+	getLang : function(name, default_value, parse_entities, va) {
+		var v = (typeof(tinyMCELang[name]) == "undefined") ? default_value : tinyMCELang[name], n;
+
+		if (parse_entities)
+			v = tinyMCE.entityDecode(v);
+
+		if (va) {
+			for (n in va)
+				v = this.replaceVar(v, n, va[n]);
+		}
+
+		return v;
+	},
+
+	entityDecode : function(s) {
+		var e = document.createElement("div");
+		e.innerHTML = s;
+		return e.innerHTML;
+	},
+
+	addToLang : function(prefix, ar) {
+		for (var key in ar) {
+			if (typeof(ar[key]) == 'function')
+				continue;
+
+			tinyMCELang[(key.indexOf('lang_') == -1 ? 'lang_' : '') + (prefix != '' ? (prefix + "_") : '') + key] = ar[key];
+		}
+
+		this.loadNextScript();
+
+	//	for (var key in ar)
+	//		tinyMCELang[(key.indexOf('lang_') == -1 ? 'lang_' : '') + (prefix != '' ? (prefix + "_") : '') + key] = "|" + ar[key] + "|";
+	},
+
+	triggerNodeChange : function(focus, setup_content) {
+		if (tinyMCE.selectedInstance) {
+			var inst = tinyMCE.selectedInstance;
+			var editorId = inst.editorId;
+			var elm = (typeof(setup_content) != "undefined" && setup_content) ? tinyMCE.selectedElement : inst.getFocusElement();
+			var undoIndex = -1;
+			var undoLevels = -1;
+			var anySelection = false;
+			var selectedText = inst.selection.getSelectedText();
+
+			if (setup_content && tinyMCE.isGecko && inst.isHidden())
+				elm = inst.getBody();
+
+			inst.switchSettings();
+
+			if (tinyMCE.settings["auto_resize"]) {
+				var doc = inst.getDoc();
+
+				inst.iframeElement.style.width = doc.body.offsetWidth + "px";
+				inst.iframeElement.style.height = doc.body.offsetHeight + "px";
+			}
+
+			if (tinyMCE.selectedElement)
+				anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);
+
+			if (tinyMCE.settings['custom_undo_redo']) {
+				undoIndex = inst.undoRedo.undoIndex;
+				undoLevels = inst.undoRedo.undoLevels.length;
+			}
+
+			tinyMCE.dispatchCallback(inst, 'handle_node_change_callback', 'handleNodeChange', editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection, setup_content);
+		}
+
+		if (this.selectedInstance && (typeof(focus) == "undefined" || focus))
+			this.selectedInstance.contentWindow.focus();
+	},
+
+	_customCleanup : function(inst, type, content) {
+		var pl, po, i;
+
+		// Call custom cleanup
+		var customCleanup = tinyMCE.settings['cleanup_callback'];
+		if (customCleanup != "" && eval("typeof(" + customCleanup + ")") != "undefined")
+			content = eval(customCleanup + "(type, content, inst);");
+
+		// Trigger plugin cleanups
+		pl = inst.plugins;
+		for (i=0; i<pl.length; i++) {
+			po = tinyMCE.plugins[pl[i]];
+
+			if (po && po.cleanup)
+				content = po.cleanup(type, content, inst);
+		}
+
+		return content;
+	},
+
+	setContent : function(h) {
+		if (tinyMCE.selectedInstance) {
+			tinyMCE.selectedInstance.execCommand('mceSetContent', false, h);
+			tinyMCE.selectedInstance.repaint();
+		}
+	},
+
+	importThemeLanguagePack : function(name) {
+		if (typeof(name) == "undefined")
+			name = tinyMCE.settings['theme'];
+
+		tinyMCE.loadScript(tinyMCE.baseURL + '/themes/' + name + '/langs/' + tinyMCE.settings['language'] + '.js');
+	},
+
+	importPluginLanguagePack : function(name, valid_languages) {
+		var lang = "en", b = tinyMCE.baseURL + '/plugins/' + name;
+
+		valid_languages = valid_languages.split(',');
+		for (var i=0; i<valid_languages.length; i++) {
+			if (tinyMCE.settings['language'] == valid_languages[i])
+				lang = tinyMCE.settings['language'];
+		}
+
+		if (this.plugins[name])
+			b = this.plugins[name].baseURL;
+
+		tinyMCE.loadScript(b + '/langs/' + lang +  '.js');
+	},
+
+	applyTemplate : function(h, as) {
+		var i, s, ar = h.match(new RegExp('\\{\\$[a-z0-9_]+\\}', 'gi'));
+
+		if (ar && ar.length > 0) {
+			for (i=ar.length-1; i>=0; i--) {
+				s = ar[i].substring(2, ar[i].length-1);
+
+				if (s.indexOf('lang_') == 0 && tinyMCELang[s])
+					h = tinyMCE.replaceVar(h, s, tinyMCELang[s]);
+				else if (as && as[s])
+					h = tinyMCE.replaceVar(h, s, as[s]);
+				else if (tinyMCE.settings[s])
+					h = tinyMCE.replaceVar(h, s, tinyMCE.settings[s]);
+			}
+		}
+
+		h = tinyMCE.replaceVar(h, "themeurl", tinyMCE.themeURL);
+
+		return h;
+	},
+
+	replaceVar : function(h, r, v) {
+		return h.replace(new RegExp('{\\\$' + r + '}', 'g'), v);
+	},
+
+	openWindow : function(template, args) {
+		var html, width, height, x, y, resizable, scrollbars, url;
+
+		args['mce_template_file'] = template['file'];
+		args['mce_width'] = template['width'];
+		args['mce_height'] = template['height'];
+		tinyMCE.windowArgs = args;
+
+		html = template['html'];
+		if (!(width = parseInt(template['width'])))
+			width = 320;
+
+		if (!(height = parseInt(template['height'])))
+			height = 200;
+
+		// Add to height in M$ due to SP2 WHY DON'T YOU GUYS IMPLEMENT innerWidth of windows!!
+		if (tinyMCE.isMSIE)
+			height += 40;
+		else
+			height += 20;
+
+		x = parseInt(screen.width / 2.0) - (width / 2.0);
+		y = parseInt(screen.height / 2.0) - (height / 2.0);
+
+		resizable = (args && args['resizable']) ? args['resizable'] : "no";
+		scrollbars = (args && args['scrollbars']) ? args['scrollbars'] : "no";
+
+		if (template['file'].charAt(0) != '/' && template['file'].indexOf('://') == -1)
+			url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template['file'];
+		else
+			url = template['file'];
+
+		// Replace all args as variables in URL
+		for (var name in args) {
+			if (typeof(args[name]) == 'function')
+				continue;
+
+			url = tinyMCE.replaceVar(url, name, escape(args[name]));
+		}
+
+		if (html) {
+			html = tinyMCE.replaceVar(html, "css", this.settings['popups_css']);
+			html = tinyMCE.applyTemplate(html, args);
+
+			var win = window.open("", "mcePopup" + new Date().getTime(), "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=yes,minimizable=" + resizable + ",modal=yes,width=" + width + ",height=" + height + ",resizable=" + resizable);
+			if (win == null) {
+				alert(tinyMCELang['lang_popup_blocked']);
+				return;
+			}
+
+			win.document.write(html);
+			win.document.close();
+			win.resizeTo(width, height);
+			win.focus();
+		} else {
+			if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && resizable != 'yes' && tinyMCE.settings["dialog_type"] == "modal") {
+				height += 10;
+
+				var features = "resizable:" + resizable 
+					+ ";scroll:"
+					+ scrollbars + ";status:yes;center:yes;help:no;dialogWidth:"
+					+ width + "px;dialogHeight:" + height + "px;";
+
+				window.showModalDialog(url, window, features);
+			} else {
+				var modal = (resizable == "yes") ? "no" : "yes";
+
+				if (tinyMCE.isGecko && tinyMCE.isMac)
+					modal = "no";
+
+				if (template['close_previous'] != "no")
+					try {tinyMCE.lastWindow.close();} catch (ex) {}
+
+				var win = window.open(url, "mcePopup" + new Date().getTime(), "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=" + modal + ",minimizable=" + resizable + ",modal=" + modal + ",width=" + width + ",height=" + height + ",resizable=" + resizable);
+				if (win == null) {
+					alert(tinyMCELang['lang_popup_blocked']);
+					return;
+				}
+
+				if (template['close_previous'] != "no")
+					tinyMCE.lastWindow = win;
+
+				eval('try { win.resizeTo(width, height); } catch(e) { }');
+
+				// Make it bigger if statusbar is forced
+				if (tinyMCE.isGecko) {
+					if (win.document.defaultView.statusbar.visible)
+						win.resizeBy(0, tinyMCE.isMac ? 10 : 24);
+				}
+
+				win.focus();
+			}
+		}
+	},
+
+	closeWindow : function(win) {
+		win.close();
+	},
+
+	getVisualAidClass : function(class_name, state) {
+		var aidClass = tinyMCE.settings['visual_table_class'];
+
+		if (typeof(state) == "undefined")
+			state = tinyMCE.settings['visual'];
+
+		// Split
+		var classNames = new Array();
+		var ar = class_name.split(' ');
+		for (var i=0; i<ar.length; i++) {
+			if (ar[i] == aidClass)
+				ar[i] = "";
+
+			if (ar[i] != "")
+				classNames[classNames.length] = ar[i];
+		}
+
+		if (state)
+			classNames[classNames.length] = aidClass;
+
+		// Glue
+		var className = "";
+		for (var i=0; i<classNames.length; i++) {
+			if (i > 0)
+				className += " ";
+
+			className += classNames[i];
+		}
+
+		return className;
+	},
+
+	handleVisualAid : function(el, deep, state, inst, skip_dispatch) {
+		if (!el)
+			return;
+
+		if (!skip_dispatch)
+			tinyMCE.dispatchCallback(inst, 'handle_visual_aid_callback', 'handleVisualAid', el, deep, state, inst);
+
+		var tableElement = null;
+
+		switch (el.nodeName) {
+			case "TABLE":
+				var oldW = el.style.width;
+				var oldH = el.style.height;
+				var bo = tinyMCE.getAttrib(el, "border");
+
+				bo = bo == "" || bo == "0" ? true : false;
+
+				tinyMCE.setAttrib(el, "class", tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el, "class"), state && bo));
+
+				el.style.width = oldW;
+				el.style.height = oldH;
+
+				for (var y=0; y<el.rows.length; y++) {
+					for (var x=0; x<el.rows[y].cells.length; x++) {
+						var cn = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el.rows[y].cells[x], "class"), state && bo);
+						tinyMCE.setAttrib(el.rows[y].cells[x], "class", cn);
+					}
+				}
+
+				break;
+
+			case "A":
+				var anchorName = tinyMCE.getAttrib(el, "name");
+
+				if (anchorName != '' && state) {
+					el.title = anchorName;
+					el.className = 'mceItemAnchor';
+				} else if (anchorName != '' && !state)
+					el.className = '';
+
+				break;
+		}
+
+		if (deep && el.hasChildNodes()) {
+			for (var i=0; i<el.childNodes.length; i++)
+				tinyMCE.handleVisualAid(el.childNodes[i], deep, state, inst, true);
+		}
+	},
+
+	/*
+	applyClassesToFonts : function(doc, size) {
+		var f = doc.getElementsByTagName("font");
+		for (var i=0; i<f.length; i++) {
+			var s = tinyMCE.getAttrib(f[i], "size");
+
+			if (s != "")
+				tinyMCE.setAttrib(f[i], 'class', "mceItemFont" + s);
+		}
+
+		if (typeof(size) != "undefined") {
+			var css = "";
+
+			for (var x=0; x<doc.styleSheets.length; x++) {
+				for (var i=0; i<doc.styleSheets[x].rules.length; i++) {
+					if (doc.styleSheets[x].rules[i].selectorText == '#mceSpanFonts .mceItemFont' + size) {
+						css = doc.styleSheets[x].rules[i].style.cssText;
+						break;
+					}
+				}
+
+				if (css != "")
+					break;
+			}
+
+			if (doc.styleSheets[0].rules[0].selectorText == "FONT")
+				doc.styleSheets[0].removeRule(0);
+
+			doc.styleSheets[0].addRule("FONT", css, 0);
+		}
+	},
+	*/
+
+	fixGeckoBaseHREFBug : function(m, e, h) {
+		var nl, i, a, n, xsrc, xhref, el;
+
+		if (tinyMCE.isGecko) {
+			if (m == 1) {
+				h = h.replace(/\ssrc=/gi, " mce_tsrc=");
+				h = h.replace(/\shref=/gi, " mce_thref=");
+
+				return h;
+			} else {
+				el = new Array('a','img','select','area','iframe','base','input','script','embed','object','link');
+
+				for (a=0; a<el.length; a++) {
+					n = e.getElementsByTagName(el[a]);
+
+					for (i=0; i<n.length; i++) {
+						xsrc = tinyMCE.getAttrib(n[i], "mce_tsrc");
+						xhref = tinyMCE.getAttrib(n[i], "mce_thref");
+
+						if (xsrc != "") {
+							try {
+								n[i].src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xsrc);
+							} catch (e) {
+								// Ignore, Firefox cast exception if local file wasn't found
+							}
+
+							n[i].removeAttribute("mce_tsrc");
+						}
+
+						if (xhref != "") {
+							try {
+								n[i].href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xhref);
+							} catch (e) {
+								// Ignore, Firefox cast exception if local file wasn't found
+							}
+
+							n[i].removeAttribute("mce_thref");
+						}
+					}
+				}
+
+				el = tinyMCE.selectNodes(e, function(n) {
+					if (n.nodeType == 3 || n.nodeType == 8) {
+						n.nodeValue = n.nodeValue.replace(/\smce_tsrc=/gi, " src=");
+						n.nodeValue = n.nodeValue.replace(/\smce_thref=/gi, " href=");
+					}
+
+					return false;
+				});
+			}
+		}
+
+		return h;
+	},
+
+	_setHTML : function(doc, html_content) {
+		// Force closed anchors open
+		//html_content = html_content.replace(new RegExp('<a(.*?)/>', 'gi'), '<a$1></a>');
+
+		html_content = tinyMCE.cleanupHTMLCode(html_content);
+
+		// Try innerHTML if it fails use pasteHTML in MSIE
+		try {
+			tinyMCE.setInnerHTML(doc.body, html_content);
+		} catch (e) {
+			if (this.isMSIE)
+				doc.body.createTextRange().pasteHTML(html_content);
+		}
+
+		// Content duplication bug fix
+		if (tinyMCE.isMSIE && tinyMCE.settings['fix_content_duplication']) {
+			// Remove P elements in P elements
+			var paras = doc.getElementsByTagName("P");
+			for (var i=0; i<paras.length; i++) {
+				var node = paras[i];
+				while ((node = node.parentNode) != null) {
+					if (node.nodeName == "P")
+						node.outerHTML = node.innerHTML;
+				}
+			}
+
+			// Content duplication bug fix (Seems to be word crap)
+			var html = doc.body.innerHTML;
+/*
+			if (html.indexOf('="mso') != -1) {
+				for (var i=0; i<doc.body.all.length; i++) {
+					var el = doc.body.all[i];
+					el.removeAttribute("className","",0);
+					el.removeAttribute("style","",0);
+				}
+
+				html = doc.body.innerHTML;
+				html = tinyMCE.regexpReplace(html, "<o:p><\/o:p>", "<br />");
+				html = tinyMCE.regexpReplace(html, "<o:p>&nbsp;<\/o:p>", "");
+				html = tinyMCE.regexpReplace(html, "<st1:.*?>", "");
+				html = tinyMCE.regexpReplace(html, "<p><\/p>", "");
+				html = tinyMCE.regexpReplace(html, "<p><\/p>\r\n<p><\/p>", "");
+				html = tinyMCE.regexpReplace(html, "<p>&nbsp;<\/p>", "<br />");
+				html = tinyMCE.regexpReplace(html, "<p>\s*(<p>\s*)?", "<p>");
+				html = tinyMCE.regexpReplace(html, "<\/p>\s*(<\/p>\s*)?", "</p>");
+			}*/
+
+			// Always set the htmlText output
+			tinyMCE.setInnerHTML(doc.body, html);
+		}
+
+		tinyMCE.cleanupAnchors(doc);
+
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			tinyMCE.convertSpansToFonts(doc);
+	},
+
+	getEditorId : function(form_element) {
+		var inst = this.getInstanceById(form_element);
+		if (!inst)
+			return null;
+
+		return inst.editorId;
+	},
+
+	getInstanceById : function(editor_id) {
+		var inst = this.instances[editor_id];
+		if (!inst) {
+			for (var n in tinyMCE.instances) {
+				var instance = tinyMCE.instances[n];
+				if (!tinyMCE.isInstance(instance))
+					continue;
+
+				if (instance.formTargetElementId == editor_id) {
+					inst = instance;
+					break;
+				}
+			}
+		}
+
+		return inst;
+	},
+
+	queryInstanceCommandValue : function(editor_id, command) {
+		var inst = tinyMCE.getInstanceById(editor_id);
+		if (inst)
+			return inst.queryCommandValue(command);
+
+		return false;
+	},
+
+	queryInstanceCommandState : function(editor_id, command) {
+		var inst = tinyMCE.getInstanceById(editor_id);
+		if (inst)
+			return inst.queryCommandState(command);
+
+		return null;
+	},
+
+	setWindowArg : function(n, v) {
+		this.windowArgs[n] = v;
+	},
+
+	getWindowArg : function(n, d) {
+		return (typeof(this.windowArgs[n]) == "undefined") ? d : this.windowArgs[n];
+	},
+
+	getCSSClasses : function(editor_id, doc) {
+		var output = new Array();
+
+		// Is cached, use that
+		if (typeof(tinyMCE.cssClasses) != "undefined")
+			return tinyMCE.cssClasses;
+
+		if (typeof(editor_id) == "undefined" && typeof(doc) == "undefined") {
+			var instance;
+
+			for (var instanceName in tinyMCE.instances) {
+				instance = tinyMCE.instances[instanceName];
+				if (!tinyMCE.isInstance(instance))
+					continue;
+
+				break;
+			}
+
+			doc = instance.getDoc();
+		}
+
+		if (typeof(doc) == "undefined") {
+			var instance = tinyMCE.getInstanceById(editor_id);
+			doc = instance.getDoc();
+		}
+
+		if (doc) {
+			var styles = doc.styleSheets;
+
+			if (styles && styles.length > 0) {
+				for (var x=0; x<styles.length; x++) {
+					var csses = null;
+
+					// Just ignore any errors
+					eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets(" + x + ").rules : styles[" + x + "].cssRules;} catch(e) {}");
+					if (!csses)
+						return new Array();
+
+					for (var i=0; i<csses.length; i++) {
+						var selectorText = csses[i].selectorText;
+
+						// Can be multiple rules per selector
+						if (selectorText) {
+							var rules = selectorText.split(',');
+							for (var c=0; c<rules.length; c++) {
+								var rule = rules[c];
+
+								// Strip spaces between selectors
+								while (rule.indexOf(' ') == 0)
+									rule = rule.substring(1);
+
+								// Invalid rule
+								if (rule.indexOf(' ') != -1 || rule.indexOf(':') != -1 || rule.indexOf('mceItem') != -1)
+									continue;
+
+								if (rule.indexOf(tinyMCE.settings['visual_table_class']) != -1 || rule.indexOf('mceEditable') != -1 || rule.indexOf('mceNonEditable') != -1)
+									continue;
+
+								// Is class rule
+								if (rule.indexOf('.') != -1) {
+									var cssClass = rule.substring(rule.indexOf('.') + 1);
+									var addClass = true;
+
+									for (var p=0; p<output.length && addClass; p++) {
+										if (output[p] == cssClass)
+											addClass = false;
+									}
+
+									if (addClass)
+										output[output.length] = cssClass;
+								}
+							}
+						}
+					}
+				}
+			}
+		}
+
+		// Cache em
+		if (output.length > 0)
+			tinyMCE.cssClasses = output;
+
+		return output;
+	},
+
+	regexpReplace : function(in_str, reg_exp, replace_str, opts) {
+		if (in_str == null)
+			return in_str;
+
+		if (typeof(opts) == "undefined")
+			opts = 'g';
+
+		var re = new RegExp(reg_exp, opts);
+		return in_str.replace(re, replace_str);
+	},
+
+	trim : function(s) {
+		return s.replace(/^\s*|\s*$/g, "");
+	},
+
+	cleanupEventStr : function(s) {
+		s = "" + s;
+		s = s.replace('function anonymous()\n{\n', '');
+		s = s.replace('\n}', '');
+		s = s.replace(/^return true;/gi, ''); // Remove event blocker
+
+		return s;
+	},
+
+	getControlHTML : function(c) {
+		var i, l, n, o, v;
+
+		l = tinyMCE.plugins;
+		for (n in l) {
+			o = l[n];
+
+			if (o.getControlHTML && (v = o.getControlHTML(c)) != '')
+				return tinyMCE.replaceVar(v, "pluginurl", o.baseURL);
+		}
+
+		o = tinyMCE.themes[tinyMCE.settings['theme']];
+		if (o.getControlHTML && (v = o.getControlHTML(c)) != '')
+			return v;
+
+		return '';
+	},
+
+	evalFunc : function(f, idx, a) {
+		var s = '(', i;
+
+		for (i=idx; i<a.length; i++) {
+			s += 'a[' + i + ']';
+
+			if (i < a.length-1)
+				s += ',';
+		}
+
+		s += ');';
+
+		return eval("f" + s);
+	},
+
+	dispatchCallback : function(i, p, n) {
+		return this.callFunc(i, p, n, 0, this.dispatchCallback.arguments);
+	},
+
+	executeCallback : function(i, p, n) {
+		return this.callFunc(i, p, n, 1, this.executeCallback.arguments);
+	},
+
+	execCommandCallback : function(i, p, n) {
+		return this.callFunc(i, p, n, 2, this.execCommandCallback.arguments);
+	},
+
+	callFunc : function(ins, p, n, m, a) {
+		var l, i, on, o, s, v;
+
+		s = m == 2;
+
+		l = tinyMCE.getParam(p, '');
+
+		if (l != '' && (v = tinyMCE.evalFunc(typeof(l) == "function" ? l : eval(l), 3, a)) == s && m > 0)
+			return true;
+
+		if (ins != null) {
+			for (i=0, l = ins.plugins; i<l.length; i++) {
+				o = tinyMCE.plugins[l[i]];
+
+				if (o[n] && (v = tinyMCE.evalFunc(o[n], 3, a)) == s && m > 0)
+					return true;
+			}
+		}
+
+		l = tinyMCE.themes;
+		for (on in l) {
+			o = l[on];
+
+			if (o[n] && (v = tinyMCE.evalFunc(o[n], 3, a)) == s && m > 0)
+				return true;
+		}
+
+		return false;
+	},
+
+	xmlEncode : function(s) {
+		s = "" + s;
+		s = s.replace(/&/g, '&amp;');
+		s = s.replace(new RegExp('"', 'g'), '&quot;');
+		s = s.replace(/\'/g, '&#39;'); // &apos; is not working in MSIE
+		s = s.replace(/</g, '&lt;');
+		s = s.replace(/>/g, '&gt;');
+
+		return s;
+	},
+
+	extend : function(p, np) {
+		var o = {};
+
+		o.parent = p;
+
+		for (n in p)
+			o[n] = p[n];
+
+		for (n in np)
+			o[n] = np[n];
+
+		return o;
+	},
+
+	hideMenus : function() {
+		var e = tinyMCE.lastSelectedMenuBtn;
+
+		if (tinyMCE.lastMenu) {
+			tinyMCE.lastMenu.hide();
+			tinyMCE.lastMenu = null;
+		}
+
+		if (e) {
+			tinyMCE.switchClass(e, tinyMCE.lastMenuBtnClass);
+			tinyMCE.lastSelectedMenuBtn = null;
+		}
+	},
+
+	explode : function(d, s) {
+		var ar = s.split(d), oar = new Array(), i;
+	
+		for (i = 0; i<ar.length; i++) {
+			if (ar[i] != "")
+				oar[oar.length] = ar[i];
+		}
+	
+		return oar;
+	}
+};
+
+// Global instances
+var TinyMCE = TinyMCE_Engine; // Compatiblity with gzip compressors
+var tinyMCE = new TinyMCE_Engine();
+var tinyMCELang = {};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Control.class.js */
+
+function TinyMCE_Control(settings) {
+	var t, i, to, fu, p, x, fn, fu, pn, s = settings;
+
+	this.undoRedoLevel = true;
+	this.isTinyMCE_Control = true;
+
+	// Default settings
+	this.settings = s;
+	this.settings['theme'] = tinyMCE.getParam("theme", "default");
+	this.settings['width'] = tinyMCE.getParam("width", -1);
+	this.settings['height'] = tinyMCE.getParam("height", -1);
+	this.selection = new TinyMCE_Selection(this);
+	this.undoRedo = new TinyMCE_UndoRedo(this);
+	this.cleanup = new TinyMCE_Cleanup();
+	this.shortcuts = new Array();
+	this.hasMouseMoved = false;
+
+	this.cleanup.init({
+		valid_elements : s.valid_elements,
+		extended_valid_elements : s.extended_valid_elements,
+		entities : s.entities,
+		entity_encoding : s.entity_encoding,
+		debug : s.cleanup_debug,
+		url_converter : 'TinyMCE_Cleanup.prototype._urlConverter',
+		indent : s.apply_source_formatting,
+		invalid_elements : s.invalid_elements,
+		verify_html : s.verify_html,
+		fix_content_duplication : s.fix_content_duplication
+	});
+
+	// Wrap old theme
+	t = this.settings['theme'];
+	if (!tinyMCE.hasTheme(t)) {
+		fn = tinyMCE.callbacks;
+		to = {};
+
+		for (i=0; i<fn.length; i++) {
+			if ((fu = window['TinyMCE_' + t + "_" + fn[i]]))
+				to[fn[i]] = fu;
+		}
+
+		tinyMCE.addTheme(t, to);
+	}
+
+	// Wrap old plugins
+	this.plugins = new Array();
+	p = tinyMCE.getParam('plugins', '', true, ',');
+	if (p.length > 0) {
+		for (i=0; i<p.length; i++) {
+			pn = p[i];
+
+			if (pn.charAt(0) == '-')
+				pn = pn.substring(1);
+
+			if (!tinyMCE.hasPlugin(pn)) {
+				fn = tinyMCE.callbacks;
+				to = {};
+
+				for (x=0; x<fn.length; x++) {
+					if ((fu = window['TinyMCE_' + pn + "_" + fn[x]]))
+						to[fn[x]] = fu;
+				}
+
+				tinyMCE.addPlugin(pn, to);
+			}
+
+			this.plugins[this.plugins.length] = pn; 
+		}
+	}
+};
+
+TinyMCE_Control.prototype = {
+	hasPlugin : function(n) {
+		var i;
+
+		for (i=0; i<this.plugins.length; i++) {
+			if (this.plugins[i] == n)
+				return true;
+		}
+
+		return false;
+	},
+
+	addPlugin : function(n, p) {
+		if (!this.hasPlugin(n)) {
+			tinyMCE.addPlugin(n, p);
+			this.plugins[this.plugins.length] = n;
+		}
+	},
+
+	repaint : function() {
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+			return;
+
+		try {
+			var s = this.selection;
+			var b = s.getBookmark(true);
+			this.getBody().style.display = 'none';
+			this.getDoc().execCommand('selectall', false, null);
+			this.getSel().collapseToStart();
+			this.getBody().style.display = 'block';
+			s.moveToBookmark(b);
+		} catch (ex) {
+			// Ignore
+		}
+	},
+
+	switchSettings : function() {
+		if (tinyMCE.configs.length > 1 && tinyMCE.currentConfig != this.settings['index']) {
+			tinyMCE.settings = this.settings;
+			tinyMCE.currentConfig = this.settings['index'];
+		}
+	},
+
+	getBody : function() {
+		return this.getDoc().body;
+	},
+
+	getDoc : function() {
+		return this.contentWindow.document;
+	},
+
+	getWin : function() {
+		return this.contentWindow;
+	},
+
+	addShortcut : function(m, k, d, cmd, ui, va) {
+		var n = typeof(k) == "number", ie = tinyMCE.isMSIE, c, sc, i;
+		var scl = this.shortcuts;
+
+		if (!tinyMCE.getParam('custom_shortcuts'))
+			return false;
+
+		m = m.toLowerCase();
+		k = ie && !n ? k.toUpperCase() : k;
+		c = n ? null : k.charCodeAt(0);
+		d = d && d.indexOf('lang_') == 0 ? tinyMCE.getLang(d) : d;
+
+		sc = {
+			alt : m.indexOf('alt') != -1,
+			ctrl : m.indexOf('ctrl') != -1,
+			shift : m.indexOf('shift') != -1,
+			charCode : c,
+			keyCode : n ? k : (ie ? c : null),
+			desc : d,
+			cmd : cmd,
+			ui : ui,
+			val : va
+		};
+
+		for (i=0; i<scl.length; i++) {
+			if (sc.alt == scl[i].alt && sc.ctrl == scl[i].ctrl && sc.shift == scl[i].shift
+				&& sc.charCode == scl[i].charCode && sc.keyCode == scl[i].keyCode) {
+				return false;
+			}
+		}
+
+		scl[scl.length] = sc;
+
+		return true;
+	},
+
+	handleShortcut : function(e) {
+		var i, s = this.shortcuts, o;
+
+		for (i=0; i<s.length; i++) {
+			o = s[i];
+			if (o.alt == e.altKey && o.ctrl == e.ctrlKey && (o.keyCode == e.keyCode || o.charCode == e.charCode)) {
+				if (o.cmd && (e.type == "keydown" || (e.type == "keypress" && !tinyMCE.isOpera)))
+					tinyMCE.execCommand(o.cmd, o.ui, o.val);
+
+				tinyMCE.cancelEvent(e);
+				return true;
+			}
+		}
+
+		return false;
+	},
+
+	autoResetDesignMode : function() {
+		// Add fix for tab/style.display none/block problems in Gecko
+		if (!tinyMCE.isMSIE && this.isHidden() && tinyMCE.getParam('auto_reset_designmode'))
+			eval('try { this.getDoc().designMode = "On"; } catch(e) {}');
+	},
+
+	isHidden : function() {
+		if (tinyMCE.isMSIE)
+			return false;
+
+		var s = this.getSel();
+
+		// Weird, wheres that cursor selection?
+		return (!s || !s.rangeCount || s.rangeCount == 0);
+	},
+
+	isDirty : function() {
+		// Is content modified and not in a submit procedure
+		return this.startContent != tinyMCE.trim(this.getBody().innerHTML) && !tinyMCE.isNotDirty;
+	},
+
+	_mergeElements : function(scmd, pa, ch, override) {
+		if (scmd == "removeformat") {
+			pa.className = "";
+			pa.style.cssText = "";
+			ch.className = "";
+			ch.style.cssText = "";
+			return;
+		}
+
+		var st = tinyMCE.parseStyle(tinyMCE.getAttrib(pa, "style"));
+		var stc = tinyMCE.parseStyle(tinyMCE.getAttrib(ch, "style"));
+		var className = tinyMCE.getAttrib(pa, "class");
+
+		className += " " + tinyMCE.getAttrib(ch, "class");
+
+		if (override) {
+			for (var n in st) {
+				if (typeof(st[n]) == 'function')
+					continue;
+
+				stc[n] = st[n];
+			}
+		} else {
+			for (var n in stc) {
+				if (typeof(stc[n]) == 'function')
+					continue;
+
+				st[n] = stc[n];
+			}
+		}
+
+		tinyMCE.setAttrib(pa, "style", tinyMCE.serializeStyle(st));
+		tinyMCE.setAttrib(pa, "class", tinyMCE.trim(className));
+		ch.className = "";
+		ch.style.cssText = "";
+		ch.removeAttribute("class");
+		ch.removeAttribute("style");
+	},
+
+	_setUseCSS : function(b) {
+		var d = this.getDoc();
+
+		try {d.execCommand("useCSS", false, !b);} catch (ex) {}
+		try {d.execCommand("styleWithCSS", false, b);} catch (ex) {}
+
+		if (!tinyMCE.getParam("table_inline_editing"))
+			try {d.execCommand('enableInlineTableEditing', false, "false");} catch (ex) {}
+
+		if (!tinyMCE.getParam("object_resizing"))
+			try {d.execCommand('enableObjectResizing', false, "false");} catch (ex) {}
+	},
+
+	execCommand : function(command, user_interface, value) {
+		var doc = this.getDoc();
+		var win = this.getWin();
+		var focusElm = this.getFocusElement();
+
+		// Is non udno specific command
+		if (!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel', 'gi').test(command))
+			this.undoBookmark = null;
+
+		if (this.lastSafariSelection && !new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel', 'gi').test(command)) {
+			this.selection.moveToBookmark(this.lastSafariSelection);
+			tinyMCE.selectedElement = this.lastSafariSelectedElement;
+		}
+
+		// Mozilla issue
+		if (!tinyMCE.isMSIE && !this.useCSS) {
+			this._setUseCSS(false);
+			this.useCSS = true;
+		}
+
+		//debug("command: " + command + ", user_interface: " + user_interface + ", value: " + value);
+		this.contentDocument = doc; // <-- Strange, unless this is applied Mozilla 1.3 breaks
+
+		if (tinyMCE.execCommandCallback(this, 'execcommand_callback', 'execCommand', this.editorId, this.getBody(), command, user_interface, value))
+			return;
+
+		// Fix align on images
+		if (focusElm && focusElm.nodeName == "IMG") {
+			var align = focusElm.getAttribute('align');
+			var img = command == "JustifyCenter" ? focusElm.cloneNode(false) : focusElm;
+
+			switch (command) {
+				case "JustifyLeft":
+					if (align == 'left')
+						img.removeAttribute('align');
+					else
+						img.setAttribute('align', 'left');
+
+					// Remove the div
+					var div = focusElm.parentNode;
+					if (div && div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+						div.parentNode.replaceChild(img, div);
+
+					this.selection.selectNode(img);
+					this.repaint();
+					tinyMCE.triggerNodeChange();
+					return;
+
+				case "JustifyCenter":
+					img.removeAttribute('align');
+
+					// Is centered
+					var div = tinyMCE.getParentElement(focusElm, "div");
+					if (div && div.style.textAlign == "center") {
+						// Remove div
+						if (div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+							div.parentNode.replaceChild(img, div);
+					} else {
+						// Add div
+						var div = this.getDoc().createElement("div");
+						div.style.textAlign = 'center';
+						div.appendChild(img);
+						focusElm.parentNode.replaceChild(div, focusElm);
+					}
+
+					this.selection.selectNode(img);
+					this.repaint();
+					tinyMCE.triggerNodeChange();
+					return;
+
+				case "JustifyRight":
+					if (align == 'right')
+						img.removeAttribute('align');
+					else
+						img.setAttribute('align', 'right');
+
+					// Remove the div
+					var div = focusElm.parentNode;
+					if (div && div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode)
+						div.parentNode.replaceChild(img, div);
+
+					this.selection.selectNode(img);
+					this.repaint();
+					tinyMCE.triggerNodeChange();
+					return;
+			}
+		}
+
+		if (tinyMCE.settings['force_br_newlines']) {
+			var alignValue = "";
+
+			if (doc.selection.type != "Control") {
+				switch (command) {
+						case "JustifyLeft":
+							alignValue = "left";
+							break;
+
+						case "JustifyCenter":
+							alignValue = "center";
+							break;
+
+						case "JustifyFull":
+							alignValue = "justify";
+							break;
+
+						case "JustifyRight":
+							alignValue = "right";
+							break;
+				}
+
+				if (alignValue != "") {
+					var rng = doc.selection.createRange();
+
+					if ((divElm = tinyMCE.getParentElement(rng.parentElement(), "div")) != null)
+						divElm.setAttribute("align", alignValue);
+					else if (rng.pasteHTML && rng.htmlText.length > 0)
+						rng.pasteHTML('<div align="' + alignValue + '">' + rng.htmlText + "</div>");
+
+					tinyMCE.triggerNodeChange();
+					return;
+				}
+			}
+		}
+
+		switch (command) {
+			case "mceRepaint":
+				this.repaint();
+				return true;
+
+			case "InsertUnorderedList":
+			case "InsertOrderedList":
+				var tag = (command == "InsertUnorderedList") ? "ul" : "ol";
+
+				if (tinyMCE.isSafari)
+					this.execCommand("mceInsertContent", false, "<" + tag + "><li>&nbsp;</li><" + tag + ">");
+				else
+					this.getDoc().execCommand(command, user_interface, value);
+
+				tinyMCE.triggerNodeChange();
+				break;
+
+			case "Strikethrough":
+				if (tinyMCE.isSafari)
+					this.execCommand("mceInsertContent", false, "<strike>" + this.selection.getSelectedHTML() + "</strike>");
+				else
+					this.getDoc().execCommand(command, user_interface, value);
+
+				tinyMCE.triggerNodeChange();
+				break;
+
+			case "mceSelectNode":
+				this.selection.selectNode(value);
+				tinyMCE.triggerNodeChange();
+				tinyMCE.selectedNode = value;
+				break;
+
+			case "FormatBlock":
+				if (value == null || value == "") {
+					var elm = tinyMCE.getParentElement(this.getFocusElement(), "p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");
+
+					if (elm)
+						this.execCommand("mceRemoveNode", false, elm);
+				} else {
+					if (tinyMCE.isGecko && new RegExp('<(div|blockquote|code|dt|dd|dl|samp)>', 'gi').test(value))
+						value = value.replace(/[^a-z]/gi, '');
+
+					if (tinyMCE.isMSIE && new RegExp('blockquote|code|samp', 'gi').test(value)) {
+						var b = this.selection.getBookmark();
+						this.getDoc().execCommand("FormatBlock", false, '<p>');
+						tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()), value);
+						this.selection.moveToBookmark(b);
+					} else
+						this.getDoc().execCommand("FormatBlock", false, value);
+				}
+
+				tinyMCE.triggerNodeChange();
+
+				break;
+
+			case "mceRemoveNode":
+				if (!value)
+					value = tinyMCE.getParentElement(this.getFocusElement());
+
+				if (tinyMCE.isMSIE) {
+					value.outerHTML = value.innerHTML;
+				} else {
+					var rng = value.ownerDocument.createRange();
+					rng.setStartBefore(value);
+					rng.setEndAfter(value);
+					rng.deleteContents();
+					rng.insertNode(rng.createContextualFragment(value.innerHTML));
+				}
+
+				tinyMCE.triggerNodeChange();
+
+				break;
+
+			case "mceSelectNodeDepth":
+				var parentNode = this.getFocusElement();
+				for (var i=0; parentNode; i++) {
+					if (parentNode.nodeName.toLowerCase() == "body")
+						break;
+
+					if (parentNode.nodeName.toLowerCase() == "#text") {
+						i--;
+						parentNode = parentNode.parentNode;
+						continue;
+					}
+
+					if (i == value) {
+						this.selection.selectNode(parentNode, false);
+						tinyMCE.triggerNodeChange();
+						tinyMCE.selectedNode = parentNode;
+						return;
+					}
+
+					parentNode = parentNode.parentNode;
+				}
+
+				break;
+
+			case "SetStyleInfo":
+				var rng = this.getRng();
+				var sel = this.getSel();
+				var scmd = value['command'];
+				var sname = value['name'];
+				var svalue = value['value'] == null ? '' : value['value'];
+				//var svalue = value['value'] == null ? '' : value['value'];
+				var wrapper = value['wrapper'] ? value['wrapper'] : "span";
+				var parentElm = null;
+				var invalidRe = new RegExp("^BODY|HTML$", "g");
+				var invalidParentsRe = tinyMCE.settings['merge_styles_invalid_parents'] != '' ? new RegExp(tinyMCE.settings['merge_styles_invalid_parents'], "gi") : null;
+
+				// Whole element selected check
+				if (tinyMCE.isMSIE) {
+					// Control range
+					if (rng.item)
+						parentElm = rng.item(0);
+					else {
+						var pelm = rng.parentElement();
+						var prng = doc.selection.createRange();
+						prng.moveToElementText(pelm);
+
+						if (rng.htmlText == prng.htmlText || rng.boundingWidth == 0) {
+							if (invalidParentsRe == null || !invalidParentsRe.test(pelm.nodeName))
+								parentElm = pelm;
+						}
+					}
+				} else {
+					var felm = this.getFocusElement();
+					if (sel.isCollapsed || (new RegExp('td|tr|tbody|table', 'gi').test(felm.nodeName) && sel.anchorNode == felm.parentNode))
+						parentElm = felm;
+				}
+
+				// Whole element selected
+				if (parentElm && !invalidRe.test(parentElm.nodeName)) {
+					if (scmd == "setstyle")
+						tinyMCE.setStyleAttrib(parentElm, sname, svalue);
+
+					if (scmd == "setattrib")
+						tinyMCE.setAttrib(parentElm, sname, svalue);
+
+					if (scmd == "removeformat") {
+						parentElm.style.cssText = '';
+						tinyMCE.setAttrib(parentElm, 'class', '');
+					}
+
+					// Remove style/attribs from all children
+					var ch = tinyMCE.getNodeTree(parentElm, new Array(), 1);
+					for (var z=0; z<ch.length; z++) {
+						if (ch[z] == parentElm)
+							continue;
+
+						if (scmd == "setstyle")
+							tinyMCE.setStyleAttrib(ch[z], sname, '');
+
+						if (scmd == "setattrib")
+							tinyMCE.setAttrib(ch[z], sname, '');
+
+						if (scmd == "removeformat") {
+							ch[z].style.cssText = '';
+							tinyMCE.setAttrib(ch[z], 'class', '');
+						}
+					}
+				} else {
+					this._setUseCSS(false); // Bug in FF when running in fullscreen
+					doc.execCommand("FontName", false, "#mce_temp_font#");
+					var elementArray = tinyMCE.getElementsByAttributeValue(this.getBody(), "font", "face", "#mce_temp_font#");
+
+					// Change them all
+					for (var x=0; x<elementArray.length; x++) {
+						elm = elementArray[x];
+						if (elm) {
+							var spanElm = doc.createElement(wrapper);
+
+							if (scmd == "setstyle")
+								tinyMCE.setStyleAttrib(spanElm, sname, svalue);
+
+							if (scmd == "setattrib")
+								tinyMCE.setAttrib(spanElm, sname, svalue);
+
+							if (scmd == "removeformat") {
+								spanElm.style.cssText = '';
+								tinyMCE.setAttrib(spanElm, 'class', '');
+							}
+
+							if (elm.hasChildNodes()) {
+								for (var i=0; i<elm.childNodes.length; i++)
+									spanElm.appendChild(elm.childNodes[i].cloneNode(true));
+							}
+
+							spanElm.setAttribute("mce_new", "true");
+							elm.parentNode.replaceChild(spanElm, elm);
+
+							// Remove style/attribs from all children
+							var ch = tinyMCE.getNodeTree(spanElm, new Array(), 1);
+							for (var z=0; z<ch.length; z++) {
+								if (ch[z] == spanElm)
+									continue;
+
+								if (scmd == "setstyle")
+									tinyMCE.setStyleAttrib(ch[z], sname, '');
+
+								if (scmd == "setattrib")
+									tinyMCE.setAttrib(ch[z], sname, '');
+
+								if (scmd == "removeformat") {
+									ch[z].style.cssText = '';
+									tinyMCE.setAttrib(ch[z], 'class', '');
+								}
+							}
+						}
+					}
+				}
+
+				// Cleaup wrappers
+				var nodes = doc.getElementsByTagName(wrapper);
+				for (var i=nodes.length-1; i>=0; i--) {
+					var elm = nodes[i];
+					var isNew = tinyMCE.getAttrib(elm, "mce_new") == "true";
+
+					elm.removeAttribute("mce_new");
+
+					// Is only child a element
+					if (elm.childNodes && elm.childNodes.length == 1 && elm.childNodes[0].nodeType == 1) {
+						//tinyMCE.debug("merge1" + isNew);
+						this._mergeElements(scmd, elm, elm.childNodes[0], isNew);
+						continue;
+					}
+
+					// Is I the only child
+					if (elm.parentNode.childNodes.length == 1 && !invalidRe.test(elm.nodeName) && !invalidRe.test(elm.parentNode.nodeName)) {
+						//tinyMCE.debug("merge2" + isNew + "," + elm.nodeName + "," + elm.parentNode.nodeName);
+						if (invalidParentsRe == null || !invalidParentsRe.test(elm.parentNode.nodeName))
+							this._mergeElements(scmd, elm.parentNode, elm, false);
+					}
+				}
+
+				// Remove empty wrappers
+				var nodes = doc.getElementsByTagName(wrapper);
+				for (var i=nodes.length-1; i>=0; i--) {
+					var elm = nodes[i];
+					var isEmpty = true;
+
+					// Check if it has any attribs
+					var tmp = doc.createElement("body");
+					tmp.appendChild(elm.cloneNode(false));
+
+					// Is empty span, remove it
+					tmp.innerHTML = tmp.innerHTML.replace(new RegExp('style=""|class=""', 'gi'), '');
+					//tinyMCE.debug(tmp.innerHTML);
+					if (new RegExp('<span>', 'gi').test(tmp.innerHTML)) {
+						for (var x=0; x<elm.childNodes.length; x++) {
+							if (elm.parentNode != null)
+								elm.parentNode.insertBefore(elm.childNodes[x].cloneNode(true), elm);
+						}
+
+						elm.parentNode.removeChild(elm);
+					}
+				}
+
+				// Re add the visual aids
+				if (scmd == "removeformat")
+					tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+
+				tinyMCE.triggerNodeChange();
+
+				break;
+
+			case "FontName":
+				if (value == null) {
+					var s = this.getSel();
+
+					// Find font and select it
+					if (tinyMCE.isGecko && s.isCollapsed) {
+						var f = tinyMCE.getParentElement(this.getFocusElement(), "font");
+
+						if (f != null)
+							this.selection.selectNode(f, false);
+					}
+
+					// Remove format
+					this.getDoc().execCommand("RemoveFormat", false, null);
+
+					// Collapse range if font was found
+					if (f != null && tinyMCE.isGecko) {
+						var r = this.getRng().cloneRange();
+						r.collapse(true);
+						s.removeAllRanges();
+						s.addRange(r);
+					}
+				} else
+					this.getDoc().execCommand('FontName', false, value);
+
+				if (tinyMCE.isGecko)
+					window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+
+				return;
+
+			case "FontSize":
+				this.getDoc().execCommand('FontSize', false, value);
+
+				if (tinyMCE.isGecko)
+					window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+
+				return;
+
+			case "forecolor":
+				this.getDoc().execCommand('forecolor', false, value);
+				break;
+
+			case "HiliteColor":
+				if (tinyMCE.isGecko) {
+					this._setUseCSS(true);
+					this.getDoc().execCommand('hilitecolor', false, value);
+					this._setUseCSS(false);
+				} else
+					this.getDoc().execCommand('BackColor', false, value);
+				break;
+
+			case "Cut":
+			case "Copy":
+			case "Paste":
+				var cmdFailed = false;
+
+				// Try executing command
+				eval('try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}');
+
+				if (tinyMCE.isOpera && cmdFailed)
+					alert('Currently not supported by your browser, use keyboard shortcuts instead.');
+
+				// Alert error in gecko if command failed
+				if (tinyMCE.isGecko && cmdFailed) {
+					// Confirm more info
+					if (confirm(tinyMCE.entityDecode(tinyMCE.getLang('lang_clipboard_msg'))))
+						window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', 'mceExternal');
+
+					return;
+				} else
+					tinyMCE.triggerNodeChange();
+			break;
+
+			case "mceSetContent":
+				if (!value)
+					value = "";
+
+				// Call custom cleanup code
+				value = tinyMCE.storeAwayURLs(value);
+				value = tinyMCE._customCleanup(this, "insert_to_editor", value);
+				tinyMCE._setHTML(doc, value);
+				tinyMCE.setInnerHTML(doc.body, tinyMCE._cleanupHTML(this, doc, tinyMCE.settings, doc.body));
+				tinyMCE.convertAllRelativeURLs(doc.body);
+
+				// Cleanup any mess left from storyAwayURLs
+				tinyMCE._removeInternal(this.getBody());
+
+				// When editing always use fonts internaly
+				if (tinyMCE.getParam("convert_fonts_to_spans"))
+					tinyMCE.convertSpansToFonts(doc);
+
+				tinyMCE.handleVisualAid(doc.body, true, this.visualAid, this);
+				tinyMCE._setEventsEnabled(doc.body, false);
+				return true;
+
+			case "mceCleanup":
+				var b = this.selection.getBookmark();
+				tinyMCE._setHTML(this.contentDocument, this.getBody().innerHTML);
+				tinyMCE.setInnerHTML(this.getBody(), tinyMCE._cleanupHTML(this, this.contentDocument, this.settings, this.getBody(), this.visualAid));
+				tinyMCE.convertAllRelativeURLs(doc.body);
+
+				// When editing always use fonts internaly
+				if (tinyMCE.getParam("convert_fonts_to_spans"))
+					tinyMCE.convertSpansToFonts(doc);
+
+				tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+				tinyMCE._setEventsEnabled(this.getBody(), false);
+				this.repaint();
+				this.selection.moveToBookmark(b);
+				tinyMCE.triggerNodeChange();
+			break;
+
+			case "mceReplaceContent":
+				// Force empty string
+				if (!value)
+					value = '';
+
+				this.getWin().focus();
+
+				var selectedText = "";
+
+				if (tinyMCE.isMSIE) {
+					var rng = doc.selection.createRange();
+					selectedText = rng.text;
+				} else
+					selectedText = this.getSel().toString();
+
+				if (selectedText.length > 0) {
+					value = tinyMCE.replaceVar(value, "selection", selectedText);
+					tinyMCE.execCommand('mceInsertContent', false, value);
+				}
+
+				tinyMCE.triggerNodeChange();
+			break;
+
+			case "mceSetAttribute":
+				if (typeof(value) == 'object') {
+					var targetElms = (typeof(value['targets']) == "undefined") ? "p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address" : value['targets'];
+					var targetNode = tinyMCE.getParentElement(this.getFocusElement(), targetElms);
+
+					if (targetNode) {
+						targetNode.setAttribute(value['name'], value['value']);
+						tinyMCE.triggerNodeChange();
+					}
+				}
+			break;
+
+			case "mceSetCSSClass":
+				this.execCommand("SetStyleInfo", false, {command : "setattrib", name : "class", value : value});
+			break;
+
+			case "mceInsertRawHTML":
+				var key = 'tiny_mce_marker';
+
+				this.execCommand('mceBeginUndoLevel');
+
+				// Insert marker key
+				this.execCommand('mceInsertContent', false, key);
+
+				// Store away scroll pos
+				var scrollX = this.getDoc().body.scrollLeft + this.getDoc().documentElement.scrollLeft;
+				var scrollY = this.getDoc().body.scrollTop + this.getDoc().documentElement.scrollTop;
+
+				// Find marker and replace with RAW HTML
+				var html = this.getBody().innerHTML;
+				if ((pos = html.indexOf(key)) != -1)
+					tinyMCE.setInnerHTML(this.getBody(), html.substring(0, pos) + value + html.substring(pos + key.length));
+
+				// Restore scoll pos
+				this.contentWindow.scrollTo(scrollX, scrollY);
+
+				this.execCommand('mceEndUndoLevel');
+
+				break;
+
+			case "mceInsertContent":
+				// Force empty string
+				if (!value)
+					value = '';
+
+				var insertHTMLFailed = false;
+				this.getWin().focus();
+
+				if (tinyMCE.isGecko || tinyMCE.isOpera) {
+					try {
+						// Is plain text or HTML, &amp;, &nbsp; etc will be encoded wrong in FF
+						if (value.indexOf('<') == -1 && !value.match(/(&#38;|&#160;|&#60;|&#62;)/g)) {
+							var r = this.getRng();
+							var n = this.getDoc().createTextNode(tinyMCE.entityDecode(value));
+							var s = this.getSel();
+							var r2 = r.cloneRange();
+
+							// Insert text at cursor position
+							s.removeAllRanges();
+							r.deleteContents();
+							r.insertNode(n);
+
+							// Move the cursor to the end of text
+							r2.selectNode(n);
+							r2.collapse(false);
+							s.removeAllRanges();
+							s.addRange(r2);
+						} else {
+							value = tinyMCE.fixGeckoBaseHREFBug(1, this.getDoc(), value);
+							this.getDoc().execCommand('inserthtml', false, value);
+							tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value);
+						}
+					} catch (ex) {
+						insertHTMLFailed = true;
+					}
+
+					if (!insertHTMLFailed) {
+						tinyMCE.triggerNodeChange();
+						return;
+					}
+				}
+
+				// Ugly hack in Opera due to non working "inserthtml"
+				if (tinyMCE.isOpera && insertHTMLFailed) {
+					this.getDoc().execCommand("insertimage", false, tinyMCE.uniqueURL);
+					var ar = tinyMCE.getElementsByAttributeValue(this.getBody(), "img", "src", tinyMCE.uniqueURL);
+					ar[0].outerHTML = value;
+					return;
+				}
+
+				if (!tinyMCE.isMSIE) {
+					var isHTML = value.indexOf('<') != -1;
+					var sel = this.getSel();
+					var rng = this.getRng();
+
+					if (isHTML) {
+						if (tinyMCE.isSafari) {
+							var tmpRng = this.getDoc().createRange();
+
+							tmpRng.setStart(this.getBody(), 0);
+							tmpRng.setEnd(this.getBody(), 0);
+
+							value = tmpRng.createContextualFragment(value);
+						} else
+							value = rng.createContextualFragment(value);
+					} else {
+						// Setup text node
+						var el = document.createElement("div");
+						el.innerHTML = value;
+						value = el.firstChild.nodeValue;
+						value = doc.createTextNode(value);
+					}
+
+					// Insert plain text in Safari
+					if (tinyMCE.isSafari && !isHTML) {
+						this.execCommand('InsertText', false, value.nodeValue);
+						tinyMCE.triggerNodeChange();
+						return true;
+					} else if (tinyMCE.isSafari && isHTML) {
+						rng.deleteContents();
+						rng.insertNode(value);
+						tinyMCE.triggerNodeChange();
+						return true;
+					}
+
+					rng.deleteContents();
+
+					// If target node is text do special treatment, (Mozilla 1.3 fix)
+					if (rng.startContainer.nodeType == 3) {
+						var node = rng.startContainer.splitText(rng.startOffset);
+						node.parentNode.insertBefore(value, node); 
+					} else
+						rng.insertNode(value);
+
+					if (!isHTML) {
+						// Removes weird selection trails
+						sel.selectAllChildren(doc.body);
+						sel.removeAllRanges();
+
+						// Move cursor to end of content
+						var rng = doc.createRange();
+
+						rng.selectNode(value);
+						rng.collapse(false);
+
+						sel.addRange(rng);
+					} else
+						rng.collapse(false);
+
+					tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value);
+				} else {
+					var rng = doc.selection.createRange();
+					var c = value.indexOf('<!--') != -1;
+
+					// Fix comment bug, add tag before comments
+					if (c)
+						value = tinyMCE.uniqueTag + value;
+
+					if (rng.item)
+						rng.item(0).outerHTML = value;
+					else
+						rng.pasteHTML(value);
+
+					// Remove unique tag
+					if (c) {
+						var e = this.getDoc().getElementById('mceTMPElement');
+						e.parentNode.removeChild(e);
+					}
+				}
+
+				tinyMCE.triggerNodeChange();
+			break;
+
+			case "mceStartTyping":
+				if (tinyMCE.settings['custom_undo_redo'] && this.undoRedo.typingUndoIndex == -1) {
+					this.undoRedo.typingUndoIndex = this.undoRedo.undoIndex;
+					this.execCommand('mceAddUndoLevel');
+					//tinyMCE.debug("mceStartTyping");
+				}
+				break;
+
+			case "mceEndTyping":
+				if (tinyMCE.settings['custom_undo_redo'] && this.undoRedo.typingUndoIndex != -1) {
+					this.execCommand('mceAddUndoLevel');
+					this.undoRedo.typingUndoIndex = -1;
+					//tinyMCE.debug("mceEndTyping");
+				}
+				break;
+
+			case "mceBeginUndoLevel":
+				this.undoRedoLevel = false;
+				break;
+
+			case "mceEndUndoLevel":
+				this.undoRedoLevel = true;
+				this.execCommand('mceAddUndoLevel');
+				break;
+
+			case "mceAddUndoLevel":
+				if (tinyMCE.settings['custom_undo_redo'] && this.undoRedoLevel) {
+					if (this.undoRedo.add())
+						tinyMCE.triggerNodeChange(false);
+				}
+				break;
+
+			case "Undo":
+				if (tinyMCE.settings['custom_undo_redo']) {
+					tinyMCE.execCommand("mceEndTyping");
+					this.undoRedo.undo();
+					tinyMCE.triggerNodeChange();
+				} else
+					this.getDoc().execCommand(command, user_interface, value);
+				break;
+
+			case "Redo":
+				if (tinyMCE.settings['custom_undo_redo']) {
+					tinyMCE.execCommand("mceEndTyping");
+					this.undoRedo.redo();
+					tinyMCE.triggerNodeChange();
+				} else
+					this.getDoc().execCommand(command, user_interface, value);
+				break;
+
+			case "mceToggleVisualAid":
+				this.visualAid = !this.visualAid;
+				tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);
+				tinyMCE.triggerNodeChange();
+				break;
+
+			case "Indent":
+				this.getDoc().execCommand(command, user_interface, value);
+				tinyMCE.triggerNodeChange();
+				if (tinyMCE.isMSIE) {
+					var n = tinyMCE.getParentElement(this.getFocusElement(), "blockquote");
+					do {
+						if (n && n.nodeName == "BLOCKQUOTE") {
+							n.removeAttribute("dir");
+							n.removeAttribute("style");
+						}
+					} while (n != null && (n = n.parentNode) != null);
+				}
+				break;
+
+			case "removeformat":
+				var text = this.selection.getSelectedText();
+
+				if (tinyMCE.isOpera) {
+					this.getDoc().execCommand("RemoveFormat", false, null);
+					return;
+				}
+
+				if (tinyMCE.isMSIE) {
+					try {
+						var rng = doc.selection.createRange();
+						rng.execCommand("RemoveFormat", false, null);
+					} catch (e) {
+						// Do nothing
+					}
+
+					this.execCommand("SetStyleInfo", false, {command : "removeformat"});
+				} else {
+					this.getDoc().execCommand(command, user_interface, value);
+
+					this.execCommand("SetStyleInfo", false, {command : "removeformat"});
+				}
+
+				// Remove class
+				if (text.length == 0)
+					this.execCommand("mceSetCSSClass", false, "");
+
+				tinyMCE.triggerNodeChange();
+				break;
+
+			default:
+				this.getDoc().execCommand(command, user_interface, value);
+
+				if (tinyMCE.isGecko)
+					window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);
+				else
+					tinyMCE.triggerNodeChange();
+		}
+
+		// Add undo level after modification
+		if (command != "mceAddUndoLevel" && command != "Undo" && command != "Redo" && command != "mceStartTyping" && command != "mceEndTyping")
+			tinyMCE.execCommand("mceAddUndoLevel");
+	},
+
+	queryCommandValue : function(c) {
+		try {
+			return this.getDoc().queryCommandValue(c);
+		} catch (e) {
+			return null;
+		}
+	},
+
+	queryCommandState : function(c) {
+		return this.getDoc().queryCommandState(c);
+	},
+
+	_onAdd : function(replace_element, form_element_name, target_document) {
+		var hc, th, to, editorTemplate;
+
+		th = this.settings['theme'];
+		to = tinyMCE.themes[th];
+
+		var targetDoc = target_document ? target_document : document;
+
+		this.targetDoc = targetDoc;
+
+		tinyMCE.themeURL = tinyMCE.baseURL + "/themes/" + this.settings['theme'];
+		this.settings['themeurl'] = tinyMCE.themeURL;
+
+		if (!replace_element) {
+			alert("Error: Could not find the target element.");
+			return false;
+		}
+
+		if (to.getEditorTemplate)
+			editorTemplate = to.getEditorTemplate(this.settings, this.editorId);
+
+		var deltaWidth = editorTemplate['delta_width'] ? editorTemplate['delta_width'] : 0;
+		var deltaHeight = editorTemplate['delta_height'] ? editorTemplate['delta_height'] : 0;
+		var html = '<span id="' + this.editorId + '_parent" class="mceEditorContainer">' + editorTemplate['html'];
+
+		html = tinyMCE.replaceVar(html, "editor_id", this.editorId);
+		this.settings['default_document'] = tinyMCE.baseURL + "/blank.htm";
+
+		this.settings['old_width'] = this.settings['width'];
+		this.settings['old_height'] = this.settings['height'];
+
+		// Set default width, height
+		if (this.settings['width'] == -1)
+			this.settings['width'] = replace_element.offsetWidth;
+
+		if (this.settings['height'] == -1)
+			this.settings['height'] = replace_element.offsetHeight;
+
+		// Try the style width
+		if (this.settings['width'] == 0)
+			this.settings['width'] = replace_element.style.width;
+
+		// Try the style height
+		if (this.settings['height'] == 0)
+			this.settings['height'] = replace_element.style.height; 
+
+		// If no width/height then default to 320x240, better than nothing
+		if (this.settings['width'] == 0)
+			this.settings['width'] = 320;
+
+		if (this.settings['height'] == 0)
+			this.settings['height'] = 240;
+
+		this.settings['area_width'] = parseInt(this.settings['width']);
+		this.settings['area_height'] = parseInt(this.settings['height']);
+		this.settings['area_width'] += deltaWidth;
+		this.settings['area_height'] += deltaHeight;
+
+		// Special % handling
+		if (("" + this.settings['width']).indexOf('%') != -1)
+			this.settings['area_width'] = "100%";
+
+		if (("" + this.settings['height']).indexOf('%') != -1)
+			this.settings['area_height'] = "100%";
+
+		if (("" + replace_element.style.width).indexOf('%') != -1) {
+			this.settings['width'] = replace_element.style.width;
+			this.settings['area_width'] = "100%";
+		}
+
+		if (("" + replace_element.style.height).indexOf('%') != -1) {
+			this.settings['height'] = replace_element.style.height;
+			this.settings['area_height'] = "100%";
+		}
+
+		html = tinyMCE.applyTemplate(html);
+
+		this.settings['width'] = this.settings['old_width'];
+		this.settings['height'] = this.settings['old_height'];
+
+		this.visualAid = this.settings['visual'];
+		this.formTargetElementId = form_element_name;
+
+		// Get replace_element contents
+		if (replace_element.nodeName == "TEXTAREA" || replace_element.nodeName == "INPUT")
+			this.startContent = replace_element.value;
+		else
+			this.startContent = replace_element.innerHTML;
+
+		// If not text area or input
+		if (replace_element.nodeName != "TEXTAREA" && replace_element.nodeName != "INPUT") {
+			this.oldTargetElement = replace_element;
+
+			// Debug mode
+			if (tinyMCE.settings['debug']) {
+				hc = '<textarea wrap="off" id="' + form_element_name + '" name="' + form_element_name + '" cols="100" rows="15"></textarea>';
+			} else {
+				hc = '<input type="hidden" id="' + form_element_name + '" name="' + form_element_name + '" />';
+				this.oldTargetElement.style.display = "none";
+			}
+
+			html += '</span>';
+
+			if (tinyMCE.isGecko)
+				html = hc + html;
+			else
+				html += hc;
+
+			// Output HTML and set editable
+			if (tinyMCE.isGecko) {
+				var rng = replace_element.ownerDocument.createRange();
+				rng.setStartBefore(replace_element);
+
+				var fragment = rng.createContextualFragment(html);
+				tinyMCE.insertAfter(fragment, replace_element);
+			} else
+				replace_element.insertAdjacentHTML("beforeBegin", html);
+		} else {
+			html += '</span>';
+
+			// Just hide the textarea element
+			this.oldTargetElement = replace_element;
+
+			if (!tinyMCE.settings['debug'])
+				this.oldTargetElement.style.display = "none";
+
+			// Output HTML and set editable
+			if (tinyMCE.isGecko) {
+				var rng = replace_element.ownerDocument.createRange();
+				rng.setStartBefore(replace_element);
+
+				var fragment = rng.createContextualFragment(html);
+				tinyMCE.insertAfter(fragment, replace_element);
+			} else
+				replace_element.insertAdjacentHTML("beforeBegin", html);
+		}
+
+		// Setup iframe
+		var dynamicIFrame = false;
+		var tElm = targetDoc.getElementById(this.editorId);
+
+		if (!tinyMCE.isMSIE) {
+			// Node case is preserved in XML strict mode
+			if (tElm && (tElm.nodeName == "SPAN" || tElm.nodeName == "span")) {
+				tElm = tinyMCE._createIFrame(tElm, targetDoc);
+				dynamicIFrame = true;
+			}
+
+			this.targetElement = tElm;
+			this.iframeElement = tElm;
+			this.contentDocument = tElm.contentDocument;
+			this.contentWindow = tElm.contentWindow;
+
+			//this.getDoc().designMode = "on";
+		} else {
+			if (tElm && tElm.nodeName == "SPAN")
+				tElm = tinyMCE._createIFrame(tElm, targetDoc, targetDoc.parentWindow);
+			else
+				tElm = targetDoc.frames[this.editorId];
+
+			this.targetElement = tElm;
+			this.iframeElement = targetDoc.getElementById(this.editorId);
+
+			if (tinyMCE.isOpera) {
+				this.contentDocument = this.iframeElement.contentDocument;
+				this.contentWindow = this.iframeElement.contentWindow;
+				dynamicIFrame = true;
+			} else {
+				this.contentDocument = tElm.window.document;
+				this.contentWindow = tElm.window;
+			}
+
+			this.getDoc().designMode = "on";
+		}
+
+		// Setup base HTML
+		var doc = this.contentDocument;
+		if (dynamicIFrame) {
+			var html = tinyMCE.getParam('doctype') + '<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="' + tinyMCE.settings['base_href'] + '" /><title>blank_page</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body class="mceContentBody"></body></html>';
+
+			try {
+				if (!this.isHidden())
+					this.getDoc().designMode = "on";
+
+				doc.open();
+				doc.write(html);
+				doc.close();
+			} catch (e) {
+				// Failed Mozilla 1.3
+				this.getDoc().location.href = tinyMCE.baseURL + "/blank.htm";
+			}
+		}
+
+		// This timeout is needed in MSIE 5.5 for some odd reason
+		// it seems that the document.frames isn't initialized yet?
+		if (tinyMCE.isMSIE)
+			window.setTimeout("tinyMCE.addEventHandlers(tinyMCE.instances[\"" + this.editorId + "\"]);", 1);
+
+		tinyMCE.setupContent(this.editorId, true);
+
+		return true;
+	},
+
+	setBaseHREF : function(u) {
+		var h, b, d, nl;
+
+		d = this.getDoc();
+		nl = d.getElementsByTagName("base");
+		b = nl.length > 0 ? nl[0] : null;
+
+		if (!b) {
+			nl = d.getElementsByTagName("head");
+			h = nl.length > 0 ? nl[0] : null;
+
+			b = d.createElement("base");
+			b.setAttribute('href', u);
+			h.appendChild(b);
+		} else {
+			if (u == "" || u == null)
+				b.parentNode.removeChild(b);
+			else
+				b.setAttribute('href', u);
+		}
+	},
+
+	getFocusElement : function() {
+		return this.selection.getFocusElement();
+	},
+
+	getSel : function() {
+		return this.selection.getSel();
+	},
+
+	getRng : function() {
+		return this.selection.getRng();
+	},
+
+	triggerSave : function(skip_cleanup, skip_callback) {
+		var e, nl = new Array(), i, s;
+
+		this.switchSettings();
+		s = tinyMCE.settings;
+
+		// Force hidden tabs visible while serializing
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+			e = this.iframeElement;
+
+			do {
+				if (e.style && e.style.display == 'none') {
+					e.style.display = 'block';
+					nl[nl.length] = {elm : e, type : 'style'};
+				}
+
+				if (e.style && s.hidden_tab_class.length > 0 && e.className.indexOf(s.hidden_tab_class) != -1) {
+					e.className = s.display_tab_class;
+					nl[nl.length] = {elm : e, type : 'class'};
+				}
+			} while ((e = e.parentNode) != null)
+		}
+
+		tinyMCE.settings['preformatted'] = false;
+
+		// Default to false
+		if (typeof(skip_cleanup) == "undefined")
+			skip_cleanup = false;
+
+		// Default to false
+		if (typeof(skip_callback) == "undefined")
+			skip_callback = false;
+
+		tinyMCE._setHTML(this.getDoc(), this.getBody().innerHTML);
+
+		// Remove visual aids when cleanup is disabled
+		if (this.settings['cleanup'] == false) {
+			tinyMCE.handleVisualAid(this.getBody(), true, false, this);
+			tinyMCE._setEventsEnabled(this.getBody(), true);
+		}
+
+		tinyMCE._customCleanup(this, "submit_content_dom", this.contentWindow.document.body);
+		var htm = skip_cleanup ? this.getBody().innerHTML : tinyMCE._cleanupHTML(this, this.getDoc(), this.settings, this.getBody(), tinyMCE.visualAid, true, true);
+		htm = tinyMCE._customCleanup(this, "submit_content", htm);
+
+		if (!skip_callback && tinyMCE.settings['save_callback'] != "")
+			var content = eval(tinyMCE.settings['save_callback'] + "(this.formTargetElementId,htm,this.getBody());");
+
+		// Use callback content if available
+		if ((typeof(content) != "undefined") && content != null)
+			htm = content;
+
+		// Replace some weird entities (Bug: #1056343)
+		htm = tinyMCE.regexpReplace(htm, "&#40;", "(", "gi");
+		htm = tinyMCE.regexpReplace(htm, "&#41;", ")", "gi");
+		htm = tinyMCE.regexpReplace(htm, "&#59;", ";", "gi");
+		htm = tinyMCE.regexpReplace(htm, "&#34;", "&quot;", "gi");
+		htm = tinyMCE.regexpReplace(htm, "&#94;", "^", "gi");
+
+		if (this.formElement)
+			this.formElement.value = htm;
+
+		if (tinyMCE.isSafari && this.formElement)
+			this.formElement.innerText = htm;
+
+		// Hide them again (tabs in MSIE)
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].type == 'style')
+				nl[i].elm.style.display = 'none';
+			else
+				nl[i].elm.className = s.hidden_tab_class;
+		}
+	}
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Cleanup.class.js */
+
+TinyMCE_Engine.prototype.cleanupHTMLCode = function(s) {
+	s = s.replace(new RegExp('<p \\/>', 'gi'), '<p>&nbsp;</p>');
+	s = s.replace(new RegExp('<p>\\s*<\\/p>', 'gi'), '<p>&nbsp;</p>');
+
+	// Fix close BR elements
+	s = s.replace(new RegExp('<br>\\s*<\\/br>', 'gi'), '<br />');
+
+	// Open closed tags like <b/> to <b></b>
+	s = s.replace(new RegExp('<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\\\|>]*)\\/>', 'gi'), '<$1$2$3></$1$2>');
+
+	// Remove trailing space <b > to <b>
+	s = s.replace(new RegExp('\\s+></', 'gi'), '></');
+
+	// Close tags <img></img> to <img/>
+	s = s.replace(new RegExp('<(img|br|hr)([^>]*)><\\/(img|br|hr)>', 'gi'), '<$1$2 />');
+
+	// Weird MSIE bug, <p><hr /></p> breaks runtime?
+	if (tinyMCE.isMSIE)
+		s = s.replace(new RegExp('<p><hr \\/><\\/p>', 'gi'), "<hr>");
+
+	// Convert relative anchors to absolute URLs ex: #something to file.htm#something
+	if (tinyMCE.getParam('convert_urls'))
+		s = s.replace(new RegExp('(href=\"{0,1})(\\s*#)', 'gi'), '$1' + tinyMCE.settings['document_base_url'] + "#");
+
+	return s;
+};
+
+TinyMCE_Engine.prototype.parseStyle = function(str) {
+	var ar = new Array();
+
+	if (str == null)
+		return ar;
+
+	var st = str.split(';');
+
+	tinyMCE.clearArray(ar);
+
+	for (var i=0; i<st.length; i++) {
+		if (st[i] == '')
+			continue;
+
+		var re = new RegExp('^\\s*([^:]*):\\s*(.*)\\s*$');
+		var pa = st[i].replace(re, '$1||$2').split('||');
+//tinyMCE.debug(str, pa[0] + "=" + pa[1], st[i].replace(re, '$1||$2'));
+		if (pa.length == 2)
+			ar[pa[0].toLowerCase()] = pa[1];
+	}
+
+	return ar;
+};
+
+TinyMCE_Engine.prototype.compressStyle = function(ar, pr, sf, res) {
+	var box = new Array();
+
+	box[0] = ar[pr + '-top' + sf];
+	box[1] = ar[pr + '-left' + sf];
+	box[2] = ar[pr + '-right' + sf];
+	box[3] = ar[pr + '-bottom' + sf];
+
+	for (var i=0; i<box.length; i++) {
+		if (box[i] == null)
+			return;
+
+		for (var a=0; a<box.length; a++) {
+			if (box[a] != box[i])
+				return;
+		}
+	}
+
+	// They are all the same
+	ar[res] = box[0];
+	ar[pr + '-top' + sf] = null;
+	ar[pr + '-left' + sf] = null;
+	ar[pr + '-right' + sf] = null;
+	ar[pr + '-bottom' + sf] = null;
+};
+
+TinyMCE_Engine.prototype.serializeStyle = function(ar) {
+	var str = "";
+
+	// Compress box
+	tinyMCE.compressStyle(ar, "border", "", "border");
+	tinyMCE.compressStyle(ar, "border", "-width", "border-width");
+	tinyMCE.compressStyle(ar, "border", "-color", "border-color");
+	tinyMCE.compressStyle(ar, "border", "-style", "border-style");
+	tinyMCE.compressStyle(ar, "padding", "", "padding");
+	tinyMCE.compressStyle(ar, "margin", "", "margin");
+
+	for (var key in ar) {
+		var val = ar[key];
+
+		if (typeof(val) == 'function')
+			continue;
+
+		if (key.indexOf('mso-') == 0)
+			continue;
+
+		if (val != null && val != '') {
+			val = '' + val; // Force string
+
+			// Fix style URL
+			val = val.replace(new RegExp("url\\(\\'?([^\\']*)\\'?\\)", 'gi'), "url('$1')");
+
+			// Convert URL
+			if (val.indexOf('url(') != -1 && tinyMCE.getParam('convert_urls')) {
+				var m = new RegExp("url\\('(.*?)'\\)").exec(val);
+
+				if (m.length > 1)
+					val = "url('" + eval(tinyMCE.getParam('urlconverter_callback') + "(m[1], null, true);") + "')";
+			}
+
+			// Force HEX colors
+			if (tinyMCE.getParam("force_hex_style_colors"))
+				val = tinyMCE.convertRGBToHex(val, true);
+
+			if (val != "url('')")
+				str += key.toLowerCase() + ": " + val + "; ";
+		}
+	}
+
+	if (new RegExp('; $').test(str))
+		str = str.substring(0, str.length - 2);
+
+	return str;
+};
+
+TinyMCE_Engine.prototype.convertRGBToHex = function(s, k) {
+	if (s.toLowerCase().indexOf('rgb') != -1) {
+		var re = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");
+		var rgb = s.replace(re, "$1,$2,$3,$4,$5").split(',');
+		if (rgb.length == 5) {
+			r = parseInt(rgb[1]).toString(16);
+			g = parseInt(rgb[2]).toString(16);
+			b = parseInt(rgb[3]).toString(16);
+
+			r = r.length == 1 ? '0' + r : r;
+			g = g.length == 1 ? '0' + g : g;
+			b = b.length == 1 ? '0' + b : b;
+
+			s = "#" + r + g + b;
+
+			if (k)
+				s = rgb[0] + s + rgb[4];
+		}
+	}
+
+	return s;
+};
+
+TinyMCE_Engine.prototype.convertHexToRGB = function(s) {
+	if (s.indexOf('#') != -1) {
+		s = s.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+		return "rgb(" + parseInt(s.substring(0, 2), 16) + "," + parseInt(s.substring(2, 4), 16) + "," + parseInt(s.substring(4, 6), 16) + ")";
+	}
+
+	return s;
+};
+
+TinyMCE_Engine.prototype.convertSpansToFonts = function(doc) {
+	var sizes = tinyMCE.getParam('font_size_style_values').replace(/\s+/, '').split(',');
+
+	var h = doc.body.innerHTML;
+	h = h.replace(/<span/gi, '<font');
+	h = h.replace(/<\/span/gi, '</font');
+	doc.body.innerHTML = h;
+
+	var s = doc.getElementsByTagName("font");
+	for (var i=0; i<s.length; i++) {
+		var size = tinyMCE.trim(s[i].style.fontSize).toLowerCase();
+		var fSize = 0;
+
+		for (var x=0; x<sizes.length; x++) {
+			if (sizes[x] == size) {
+				fSize = x + 1;
+				break;
+			}
+		}
+
+		if (fSize > 0) {
+			tinyMCE.setAttrib(s[i], 'size', fSize);
+			s[i].style.fontSize = '';
+		}
+
+		var fFace = s[i].style.fontFamily;
+		if (fFace != null && fFace != "") {
+			tinyMCE.setAttrib(s[i], 'face', fFace);
+			s[i].style.fontFamily = '';
+		}
+
+		var fColor = s[i].style.color;
+		if (fColor != null && fColor != "") {
+			tinyMCE.setAttrib(s[i], 'color', tinyMCE.convertRGBToHex(fColor));
+			s[i].style.color = '';
+		}
+	}
+};
+
+TinyMCE_Engine.prototype.convertFontsToSpans = function(doc) {
+	var sizes = tinyMCE.getParam('font_size_style_values').replace(/\s+/, '').split(',');
+
+	var h = doc.body.innerHTML;
+	h = h.replace(/<font/gi, '<span');
+	h = h.replace(/<\/font/gi, '</span');
+	doc.body.innerHTML = h;
+
+	var fsClasses = tinyMCE.getParam('font_size_classes');
+	if (fsClasses != '')
+		fsClasses = fsClasses.replace(/\s+/, '').split(',');
+	else
+		fsClasses = null;
+
+	var s = doc.getElementsByTagName("span");
+	for (var i=0; i<s.length; i++) {
+		var fSize, fFace, fColor;
+
+		fSize = tinyMCE.getAttrib(s[i], 'size');
+		fFace = tinyMCE.getAttrib(s[i], 'face');
+		fColor = tinyMCE.getAttrib(s[i], 'color');
+
+		if (fSize != "") {
+			fSize = parseInt(fSize);
+
+			if (fSize > 0 && fSize < 8) {
+				if (fsClasses != null)
+					tinyMCE.setAttrib(s[i], 'class', fsClasses[fSize-1]);
+				else
+					s[i].style.fontSize = sizes[fSize-1];
+			}
+
+			s[i].removeAttribute('size');
+		}
+
+		if (fFace != "") {
+			s[i].style.fontFamily = fFace;
+			s[i].removeAttribute('face');
+		}
+
+		if (fColor != "") {
+			s[i].style.color = fColor;
+			s[i].removeAttribute('color');
+		}
+	}
+};
+
+TinyMCE_Engine.prototype.cleanupAnchors = function(doc) {
+	var i, cn, x, an = doc.getElementsByTagName("a");
+
+	// Loops backwards due to bug #1467987
+	for (i=an.length-1; i>=0; i--) {
+		if (tinyMCE.getAttrib(an[i], "name") != "" && tinyMCE.getAttrib(an[i], "href") == "") {
+			cn = an[i].childNodes;
+
+			for (x=cn.length-1; x>=0; x--)
+				tinyMCE.insertAfter(cn[x], an[i]);
+		}
+	}
+};
+
+TinyMCE_Engine.prototype.getContent = function(editor_id) {
+	var h;
+
+	if (typeof(editor_id) != "undefined")
+		tinyMCE.selectedInstance = tinyMCE.getInstanceById(editor_id);
+
+	if (tinyMCE.selectedInstance) {
+		h = tinyMCE._cleanupHTML(this.selectedInstance, this.selectedInstance.getDoc(), tinyMCE.settings, this.selectedInstance.getBody(), false, true);
+
+		// When editing always use fonts internaly
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			tinyMCE.convertSpansToFonts(this.selectedInstance.getDoc());
+
+		return h;
+	}
+
+	return null;
+};
+
+TinyMCE_Engine.prototype._fixListElements = function(d) {
+	var nl, x, a = ['ol', 'ul'], i, n, p, r = new RegExp('^(OL|UL)$'), np;
+
+	for (x=0; x<a.length; x++) {
+		nl = d.getElementsByTagName(a[x]);
+
+		for (i=0; i<nl.length; i++) {
+			n = nl[i];
+			p = n.parentNode;
+
+			if (r.test(p.nodeName)) {
+				np = tinyMCE.prevNode(n, 'LI');
+
+				if (!np) {
+					np = d.createElement('li');
+					np.innerHTML = '&nbsp;';
+					np.appendChild(n);
+					p.insertBefore(np, p.firstChild);
+				} else
+					np.appendChild(n);
+			}
+		}
+	}
+};
+
+TinyMCE_Engine.prototype._fixTables = function(d) {
+	var nl, i, n, p, np, x, t;
+
+	nl = d.getElementsByTagName('table');
+	for (i=0; i<nl.length; i++) {
+		n = nl[i];
+
+		if ((p = tinyMCE.getParentElement(n, 'p,div,h1,h2,h3,h4,h5,h6')) != null) {
+			np = p.cloneNode(false);
+			np.removeAttribute('id');
+
+			t = n;
+
+			while ((n = n.nextSibling))
+				np.appendChild(n);
+
+			tinyMCE.insertAfter(np, p);
+			tinyMCE.insertAfter(t, p);
+		}
+	}
+};
+
+TinyMCE_Engine.prototype._cleanupHTML = function(inst, doc, config, elm, visual, on_save, on_submit) {
+	var h, d, t1, t2, t3, t4, t5, c, s;
+
+	if (!tinyMCE.getParam('cleanup'))
+		return elm.innerHTML;
+
+	on_save = typeof(on_save) == 'undefined' ? false : on_save;
+
+	c = inst.cleanup;
+	s = inst.settings;
+	d = c.settings.debug;
+
+	if (d)
+		t1 = new Date().getTime();
+
+	if (tinyMCE.getParam("convert_fonts_to_spans"))
+		tinyMCE.convertFontsToSpans(doc);
+
+	if (tinyMCE.getParam("fix_list_elements"))
+		tinyMCE._fixListElements(doc);
+
+	if (tinyMCE.getParam("fix_table_elements"))
+		tinyMCE._fixTables(doc);
+
+	// Call custom cleanup code
+	tinyMCE._customCleanup(inst, on_save ? "get_from_editor_dom" : "insert_to_editor_dom", doc.body);
+
+	if (d)
+		t2 = new Date().getTime();
+
+	c.settings.on_save = on_save;
+	//for (var i=0; i<100; i++)
+
+	c.idCount = 0;
+	c.serializationId++;
+	c.serializedNodes = new Array();
+	c.sourceIndex = -1;
+
+	if (s.cleanup_serializer == "xml")
+		h = c.serializeNodeAsXML(elm);
+	else
+		h = c.serializeNodeAsHTML(elm);
+
+	if (d)
+		t3 = new Date().getTime();
+
+	// Post processing
+	h = h.replace(/<\/?(body|head|html)[^>]*>/gi, '');
+	h = h.replace(new RegExp(' (rowspan="1"|colspan="1")', 'g'), '');
+	h = h.replace(/<p><hr \/><\/p>/g, '<hr />');
+	h = h.replace(/<p>(&nbsp;|&#160;)<\/p><hr \/><p>(&nbsp;|&#160;)<\/p>/g, '<hr />');
+	h = h.replace(/<td>\s*<br \/>\s*<\/td>/g, '<td>&nbsp;</td>');
+	h = h.replace(/<p>\s*<br \/>\s*<\/p>/g, '<p>&nbsp;</p>');
+	h = h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*(&nbsp;|&#160;)\s*<\/p>/g, '<p>&nbsp;</p>');
+	h = h.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*<\/p>/g, '<p>&nbsp;</p>');
+	h = h.replace(/<p>\s*<br \/>\s*&nbsp;\s*<\/p>/g, '<p>&nbsp;</p>');
+	h = h.replace(new RegExp('<a>(.*?)<\\/a>', 'g'), '$1');
+	h = h.replace(/<p([^>]*)>\s*<\/p>/g, '<p$1>&nbsp;</p>');
+
+	// Clean body
+	if (/^\s*(<br \/>|<p>&nbsp;<\/p>|<p>&#160;<\/p>|<p><\/p>)\s*$/.test(h))
+		h = '';
+
+	// If preformatted
+	if (s.preformatted) {
+		h = h.replace(/^<pre>/, '');
+		h = h.replace(/<\/pre>$/, '');
+		h = '<pre>' + h + '</pre>';
+	}
+
+	// Gecko specific processing
+	if (tinyMCE.isGecko) {
+		h = h.replace(/<o:p _moz-userdefined="" \/>/g, '');
+		h = h.replace(/<td([^>]*)>\s*<br \/>\s*<\/td>/g, '<td$1>&nbsp;</td>');
+	}
+
+	if (s.force_br_newlines)
+		h = h.replace(/<p>(&nbsp;|&#160;)<\/p>/g, '<br />');
+
+	// Call custom cleanup code
+	h = tinyMCE._customCleanup(inst, on_save ? "get_from_editor" : "insert_to_editor", h);
+
+	// Remove internal classes
+	if (on_save) {
+		h = h.replace(new RegExp(' ?(mceItem[a-zA-Z0-9]*|' + s.visual_table_class + ')', 'g'), '');
+		h = h.replace(new RegExp(' ?class=""', 'g'), '');
+	}
+
+	if (s.remove_linebreaks && !c.settings.indent)
+		h = h.replace(/\n|\r/g, ' ');
+
+	if (d)
+		t4 = new Date().getTime();
+
+	if (on_save && c.settings.indent)
+		h = c.formatHTML(h);
+
+	// If encoding (not recommended option)
+	if (on_submit && (s.encoding == "xml" || s.encoding == "html"))
+		h = c.xmlEncode(h);
+
+	if (d)
+		t5 = new Date().getTime();
+
+	if (c.settings.debug)
+		tinyMCE.debug("Cleanup in ms: Pre=" + (t2-t1) + ", Serialize: " + (t3-t2) + ", Post: " + (t4-t3) + ", Format: " + (t5-t4) + ", Sum: " + (t5-t1) + ".");
+
+	return h;
+};
+
+function TinyMCE_Cleanup() {
+	this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");
+	this.rules = tinyMCE.clearArray(new Array());
+
+	// Default config
+	this.settings = {
+		indent_elements : 'head,table,tbody,thead,tfoot,form,tr,ul,ol,blockquote,object',
+		newline_before_elements : 'h1,h2,h3,h4,h5,h6,pre,address,div,ul,ol,li,meta,option,area,title,link,base,script,td',
+		newline_after_elements : 'br,hr,p,pre,address,div,ul,ol,meta,option,area,link,base,script',
+		newline_before_after_elements : 'html,head,body,table,thead,tbody,tfoot,tr,form,ul,ol,blockquote,p,object,param,hr,div',
+		indent_char : '\t',
+		indent_levels : 1,
+		entity_encoding : 'raw',
+		valid_elements : '*[*]',
+		entities : '',
+		url_converter : '',
+		invalid_elements : '',
+		verify_html : false
+	};
+
+	this.vElements = tinyMCE.clearArray(new Array());
+	this.vElementsRe = '';
+	this.closeElementsRe = /^(IMG|BR|HR|LINK|META|BASE|INPUT|BUTTON|AREA)$/;
+	this.codeElementsRe = /^(SCRIPT|STYLE)$/;
+	this.serializationId = 0;
+	this.mceAttribs = {
+		href : 'mce_href',
+		src : 'mce_src',
+		type : 'mce_type'
+	};
+}
+
+TinyMCE_Cleanup.prototype = {
+	init : function(s) {
+		var n, a, i, ir, or, st;
+
+		for (n in s)
+			this.settings[n] = s[n];
+
+		// Setup code formating
+		s = this.settings;
+
+		// Setup regexps
+		this.inRe = this._arrayToRe(s.indent_elements.split(','), '', '^<(', ')[^>]*');
+		this.ouRe = this._arrayToRe(s.indent_elements.split(','), '', '^<\\/(', ')[^>]*');
+		this.nlBeforeRe = this._arrayToRe(s.newline_before_elements.split(','), 'gi', '<(',  ')([^>]*)>');
+		this.nlAfterRe = this._arrayToRe(s.newline_after_elements.split(','), 'gi', '<(',  ')([^>]*)>');
+		this.nlBeforeAfterRe = this._arrayToRe(s.newline_before_after_elements.split(','), 'gi', '<(\\/?)(', ')([^>]*)>');
+
+		if (s.invalid_elements != '')
+			this.iveRe = this._arrayToRe(s.invalid_elements.toUpperCase().split(','), 'g', '^(', ')$');
+		else
+			this.iveRe = null;
+
+		// Setup separator
+		st = '';
+		for (i=0; i<s.indent_levels; i++)
+			st += s.indent_char;
+
+		this.inStr = st;
+
+		// If verify_html if false force *[*]
+		if (!s.verify_html) {
+			s.valid_elements = '*[*]';
+			s.extended_valid_elements = '';
+		}
+
+		this.fillStr = s.entity_encoding == "named" ? "&nbsp;" : "&#160;";
+		this.idCount = 0;
+	},
+
+	addRuleStr : function(s) {
+		var r = this.parseRuleStr(s);
+		var n;
+
+		for (n in r) {
+			if (r[n])
+				this.rules[n] = r[n];
+		}
+
+		this.vElements = tinyMCE.clearArray(new Array());
+
+		for (n in this.rules) {
+			if (this.rules[n])
+				this.vElements[this.vElements.length] = this.rules[n].tag;
+		}
+
+		this.vElementsRe = this._arrayToRe(this.vElements, '');
+	},
+
+	parseRuleStr : function(s) {
+		var ta, p, r, a, i, x, px, t, tn, y, av, or = tinyMCE.clearArray(new Array()), dv;
+
+		if (s == null || s.length == 0)
+			return or;
+
+		ta = s.split(',');
+		for (x=0; x<ta.length; x++) {
+			s = ta[x];
+			if (s.length == 0)
+				continue;
+
+			// Split tag/attrs
+			p = this.split(/\[|\]/, s);
+			if (p == null || p.length < 1)
+				t = s.toUpperCase();
+			else
+				t = p[0].toUpperCase();
+
+			// Handle all tag names
+			tn = this.split('/', t);
+			for (y=0; y<tn.length; y++) {
+				r = {};
+
+				r.tag = tn[y];
+				r.forceAttribs = null;
+				r.defaultAttribs = null;
+				r.validAttribValues = null;
+
+				// Handle prefixes
+				px = r.tag.charAt(0);
+				r.forceOpen = px == '+';
+				r.removeEmpty = px == '-';
+				r.fill = px == '#';
+				r.tag = r.tag.replace(/\+|-|#/g, '');
+				r.oTagName = tn[0].replace(/\+|-|#/g, '').toLowerCase();
+				r.isWild = new RegExp('\\*|\\?|\\+', 'g').test(r.tag);
+				r.validRe = new RegExp(this._wildcardToRe('^' + r.tag + '$'));
+
+				// Setup valid attributes
+				if (p.length > 1) {
+					r.vAttribsRe = '^(';
+					a = this.split(/\|/, p[1]);
+
+					for (i=0; i<a.length; i++) {
+						t = a[i];
+
+						av = new RegExp('(=|:|<)(.*?)$').exec(t);
+						t = t.replace(new RegExp('(=|:|<).*?$'), '');
+						if (av && av.length > 0) {
+							if (av[0].charAt(0) == ':') {
+								if (!r.forceAttribs)
+									r.forceAttribs = tinyMCE.clearArray(new Array());
+
+								r.forceAttribs[t.toLowerCase()] = av[0].substring(1);
+							} else if (av[0].charAt(0) == '=') {
+								if (!r.defaultAttribs)
+									r.defaultAttribs = tinyMCE.clearArray(new Array());
+
+								dv = av[0].substring(1);
+
+								r.defaultAttribs[t.toLowerCase()] = dv == "" ? "mce_empty" : dv;
+							} else if (av[0].charAt(0) == '<') {
+								if (!r.validAttribValues)
+									r.validAttribValues = tinyMCE.clearArray(new Array());
+
+								r.validAttribValues[t.toLowerCase()] = this._arrayToRe(this.split('?', av[0].substring(1)), '');
+							}
+						}
+
+						r.vAttribsRe += '' + t.toLowerCase() + (i != a.length - 1 ? '|' : '');
+
+						a[i] = t.toLowerCase();
+					}
+
+					r.vAttribsRe += ')$';
+					r.vAttribsRe = this._wildcardToRe(r.vAttribsRe);
+					r.vAttribsReIsWild = new RegExp('\\*|\\?|\\+', 'g').test(r.vAttribsRe);
+					r.vAttribsRe = new RegExp(r.vAttribsRe);
+					r.vAttribs = a.reverse();
+
+					//tinyMCE.debug(r.tag, r.oTagName, r.vAttribsRe, r.vAttribsReWC);
+				} else {
+					r.vAttribsRe = '';
+					r.vAttribs = tinyMCE.clearArray(new Array());
+					r.vAttribsReIsWild = false;
+				}
+
+				or[r.tag] = r;
+			}
+		}
+
+		return or;
+	},
+
+	serializeNodeAsXML : function(n) {
+		var s, b;
+
+		if (!this.xmlDoc) {
+			if (this.isMSIE) {
+				try {this.xmlDoc = new ActiveXObject('MSXML2.DOMDocument');} catch (e) {}
+
+				if (!this.xmlDoc)
+					try {this.xmlDoc = new ActiveXObject('Microsoft.XmlDom');} catch (e) {}
+			} else
+				this.xmlDoc = document.implementation.createDocument('', '', null);
+
+			if (!this.xmlDoc)
+				alert("Error XML Parser could not be found.");
+		}
+
+		if (this.xmlDoc.firstChild)
+			this.xmlDoc.removeChild(this.xmlDoc.firstChild);
+
+		b = this.xmlDoc.createElement("html");
+		b = this.xmlDoc.appendChild(b);
+
+		this._convertToXML(n, b);
+
+		if (this.isMSIE)
+			return this.xmlDoc.xml;
+		else
+			return new XMLSerializer().serializeToString(this.xmlDoc);
+	},
+
+	_convertToXML : function(n, xn) {
+		var xd, el, i, l, cn, at, no, hc = false;
+
+		if (this._isDuplicate(n))
+			return;
+
+		xd = this.xmlDoc;
+
+		switch (n.nodeType) {
+			case 1: // Element
+				hc = n.hasChildNodes();
+
+				el = xd.createElement(n.nodeName.toLowerCase());
+
+				at = n.attributes;
+				for (i=at.length-1; i>-1; i--) {
+					no = at[i];
+
+					if (no.specified && no.nodeValue)
+						el.setAttribute(no.nodeName.toLowerCase(), no.nodeValue);
+				}
+
+				if (!hc && !this.closeElementsRe.test(n.nodeName))
+					el.appendChild(xd.createTextNode(""));
+
+				xn = xn.appendChild(el);
+				break;
+
+			case 3: // Text
+				xn.appendChild(xd.createTextNode(n.nodeValue));
+				return;
+
+			case 8: // Comment
+				xn.appendChild(xd.createComment(n.nodeValue));
+				return;
+		}
+
+		if (hc) {
+			cn = n.childNodes;
+
+			for (i=0, l=cn.length; i<l; i++)
+				this._convertToXML(cn[i], xn);
+		}
+	},
+
+	serializeNodeAsHTML : function(n) {
+		var en, no, h = '', i, l, r, cn, va = false, f = false, at, hc;
+
+		this._setupRules(); // Will initialize cleanup rules
+
+		if (this._isDuplicate(n))
+			return '';
+
+		switch (n.nodeType) {
+			case 1: // Element
+				hc = n.hasChildNodes();
+
+				// MSIE sometimes produces <//tag>
+				if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && n.nodeName.indexOf('/') != -1)
+					break;
+
+				if (this.vElementsRe.test(n.nodeName) && (!this.iveRe || !this.iveRe.test(n.nodeName))) {
+					va = true;
+
+					r = this.rules[n.nodeName];
+					if (!r) {
+						at = this.rules;
+						for (no in at) {
+							if (at[no] && at[no].validRe.test(n.nodeName)) {
+								r = at[no];
+								break;
+							}
+						}
+					}
+
+					en = r.isWild ? n.nodeName.toLowerCase() : r.oTagName;
+					f = r.fill;
+
+					if (r.removeEmpty && !hc)
+						return "";
+
+					h += '<' + en;
+
+					if (r.vAttribsReIsWild) {
+						// Serialize wildcard attributes
+						at = n.attributes;
+						for (i=at.length-1; i>-1; i--) {
+							no = at[i];
+							if (no.specified && r.vAttribsRe.test(no.nodeName))
+								h += this._serializeAttribute(n, r, no.nodeName);
+						}
+					} else {
+						// Serialize specific attributes
+						for (i=r.vAttribs.length-1; i>-1; i--)
+							h += this._serializeAttribute(n, r, r.vAttribs[i]);
+					}
+
+					// Serialize mce_ atts
+					if (!this.settings.on_save) {
+						at = this.mceAttribs;
+
+						for (no in at) {
+							if (at[no])
+								h += this._serializeAttribute(n, r, at[no]);
+						}
+					}
+
+					// Close these
+					if (this.closeElementsRe.test(n.nodeName))
+						return h + ' />';
+
+					h += '>';
+
+					if (this.isMSIE && this.codeElementsRe.test(n.nodeName))
+						h += n.innerHTML;
+				}
+			break;
+
+			case 3: // Text
+				if (n.parentNode && this.codeElementsRe.test(n.parentNode.nodeName))
+					return this.isMSIE ? '' : n.nodeValue;
+
+				return this.xmlEncode(n.nodeValue);
+
+			case 8: // Comment
+				return "<!--" + this._trimComment(n.nodeValue) + "-->";
+		}
+
+		if (hc) {
+			cn = n.childNodes;
+
+			for (i=0, l=cn.length; i<l; i++)
+				h += this.serializeNodeAsHTML(cn[i]);
+		}
+
+		// Fill empty nodes
+		if (f && !hc)
+			h += this.fillStr;
+
+		// End element
+		if (va)
+			h += '</' + en + '>';
+
+		return h;
+	},
+
+	_serializeAttribute : function(n, r, an) {
+		var av = '', t, os = this.settings.on_save;
+
+		if (os && (an.indexOf('mce_') == 0 || an.indexOf('_moz') == 0))
+			return '';
+
+		if (os && this.mceAttribs[an])
+			av = this._getAttrib(n, this.mceAttribs[an]);
+
+		if (av.length == 0)
+			av = this._getAttrib(n, an);
+
+		if (av.length == 0 && r.defaultAttribs && (t = r.defaultAttribs[an])) {
+			av = t;
+
+			if (av == "mce_empty")
+				return " " + an + '=""';
+		}
+
+		if (r.forceAttribs && (t = r.forceAttribs[an]))
+			av = t;
+
+		if (os && av.length != 0 && this.settings.url_converter.length != 0 && /^(src|href|longdesc)$/.test(an))
+			av = eval(this.settings.url_converter + '(this, n, av)');
+
+		if (av.length != 0 && r.validAttribValues && r.validAttribValues[an] && !r.validAttribValues[an].test(av))
+			return "";
+
+		if (av.length != 0 && av == "{$uid}")
+			av = "uid_" + (this.idCount++);
+
+		if (av.length != 0)
+			return " " + an + "=" + '"' + this.xmlEncode(av) + '"';
+
+		return "";
+	},
+
+	formatHTML : function(h) {
+		var s = this.settings, p = '', i = 0, li = 0, o = '', l;
+
+		h = h.replace(/\r/g, ''); // Windows sux, isn't carriage return a thing of the past :)
+		h = '\n' + h;
+		h = h.replace(new RegExp('\\n\\s+', 'gi'), '\n'); // Remove previous formatting
+		h = h.replace(this.nlBeforeRe, '\n<$1$2>');
+		h = h.replace(this.nlAfterRe, '<$1$2>\n');
+		h = h.replace(this.nlBeforeAfterRe, '\n<$1$2$3>\n');
+		h += '\n';
+
+		//tinyMCE.debug(h);
+
+		while ((i = h.indexOf('\n', i + 1)) != -1) {
+			if ((l = h.substring(li + 1, i)).length != 0) {
+				if (this.ouRe.test(l) && p.length >= s.indent_levels)
+					p = p.substring(s.indent_levels);
+
+				o += p + l + '\n';
+	
+				if (this.inRe.test(l))
+					p += this.inStr;
+			}
+
+			li = i;
+		}
+
+		//tinyMCE.debug(h);
+
+		return o;
+	},
+
+	xmlEncode : function(s) {
+		var i, l, e, o = '', c;
+
+		this._setupEntities(); // Will intialize lookup table
+
+		switch (this.settings.entity_encoding) {
+			case "raw":
+				return tinyMCE.xmlEncode(s);
+
+			case "named":
+				for (i=0, l=s.length; i<l; i++) {
+					c = s.charCodeAt(i);
+					e = this.entities[c];
+
+					if (e && e != '')
+						o += '&' + e + ';';
+					else
+						o += String.fromCharCode(c);
+				}
+
+				return o;
+
+			case "numeric":
+				for (i=0, l=s.length; i<l; i++) {
+					c = s.charCodeAt(i);
+
+					if (c > 127 || c == 60 || c == 62 || c == 38 || c == 39 || c == 34)
+						o += '&#' + c + ";";
+					else
+						o += String.fromCharCode(c);
+				}
+
+				return o;
+		}
+
+		return s;
+	},
+
+	split : function(re, s) {
+		var c = s.split(re);
+		var i, l, o = new Array();
+
+		for (i=0, l=c.length; i<l; i++) {
+			if (c[i] != '')
+				o[i] = c[i];
+		}
+
+		return o;
+	},
+
+	_trimComment : function(s) {
+		// Remove mce_src, mce_href
+		s = s.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), "");
+		s = s.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), "");
+
+		return s;
+	},
+
+	_getAttrib : function(e, n, d) {
+		if (typeof(d) == "undefined")
+			d = "";
+
+		if (!e || e.nodeType != 1)
+			return d;
+
+		var v = e.getAttribute(n, 0);
+
+		if (n == "class" && !v)
+			v = e.className;
+
+		if (this.isMSIE && n == "http-equiv")
+			v = e.httpEquiv;
+
+		if (this.isMSIE && e.nodeName == "FORM" && n == "enctype" && v == "application/x-www-form-urlencoded")
+			v = "";
+
+		if (this.isMSIE && e.nodeName == "INPUT" && n == "size" && v == "20")
+			v = "";
+
+		if (this.isMSIE && e.nodeName == "INPUT" && n == "maxlength" && v == "2147483647")
+			v = "";
+
+		if (n == "style" && !tinyMCE.isOpera)
+			v = e.style.cssText;
+
+		if (n == 'style')
+			v = tinyMCE.serializeStyle(tinyMCE.parseStyle(v));
+
+		if (this.settings.on_save && n.indexOf('on') != -1 && this.settings.on_save && v && v != "")
+			v = tinyMCE.cleanupEventStr(v);
+
+		return (v && v != "") ? '' + v : d;
+	},
+
+	_urlConverter : function(c, n, v) {
+		if (!c.settings.on_save)
+			return tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href, v);
+		else if (tinyMCE.getParam('convert_urls'))
+			return eval(tinyMCE.settings.urlconverter_callback + "(v, n, true);");
+
+		return v;
+	},
+
+	_arrayToRe : function(a, op, be, af) {
+		var i, r;
+
+		op = typeof(op) == "undefined" ? "gi" : op;
+		be = typeof(be) == "undefined" ? "^(" : be;
+		af = typeof(af) == "undefined" ? ")$" : af;
+
+		r = be;
+
+		for (i=0; i<a.length; i++)
+			r += this._wildcardToRe(a[i]) + (i != a.length-1 ? "|" : "");
+
+		r += af;
+
+		return new RegExp(r, op);
+	},
+
+	_wildcardToRe : function(s) {
+		s = s.replace(/\?/g, '(\\S?)');
+		s = s.replace(/\+/g, '(\\S+)');
+		s = s.replace(/\*/g, '(\\S*)');
+
+		return s;
+	},
+
+	_setupEntities : function() {
+		var n, a, i, s = this.settings;
+
+		// Setup entities
+		if (!this.entitiesDone) {
+			if (s.entity_encoding == "named") {
+				n = tinyMCE.clearArray(new Array());
+				a = this.split(',', s.entities);
+				for (i=0; i<a.length; i+=2)
+					n[a[i]] = a[i+1];
+
+				this.entities = n;
+			}
+
+			this.entitiesDone = true;
+		}
+	},
+
+	_setupRules : function() {
+		var s = this.settings;
+
+		// Setup default rule
+		if (!this.rulesDone) {
+			this.addRuleStr(s.valid_elements);
+			this.addRuleStr(s.extended_valid_elements);
+
+			this.rulesDone = true;
+		}
+	},
+
+	_isDuplicate : function(n) {
+		var i;
+
+		if (!this.settings.fix_content_duplication)
+			return false;
+
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera && n.nodeType == 1) {
+			// Mark elements
+			if (n.mce_serialized == this.serializationId)
+				return true;
+
+			n.setAttribute('mce_serialized', this.serializationId);
+		} else {
+			// Search lookup table for text nodes  and comments
+			for (i=0; i<this.serializedNodes.length; i++) {
+				if (this.serializedNodes[i] == n)
+					return true;
+			}
+
+			this.serializedNodes[this.serializedNodes.length] = n;
+		}
+
+		return false;
+	}
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_DOMUtils.class.js */
+
+TinyMCE_Engine.prototype.getElementByAttributeValue = function(n, e, a, v) {
+	return (n = this.getElementsByAttributeValue(n, e, a, v)).length == 0 ? null : n[0];
+};
+
+TinyMCE_Engine.prototype.getElementsByAttributeValue = function(n, e, a, v) {
+	var i, nl = n.getElementsByTagName(e), o = new Array();
+
+	for (i=0; i<nl.length; i++) {
+		if (tinyMCE.getAttrib(nl[i], a).indexOf(v) != -1)
+			o[o.length] = nl[i];
+	}
+
+	return o;
+};
+
+TinyMCE_Engine.prototype.isBlockElement = function(n) {
+	return n != null && n.nodeType == 1 && this.blockRegExp.test(n.nodeName);
+};
+
+TinyMCE_Engine.prototype.getParentBlockElement = function(n) {
+	while (n) {
+		if (this.isBlockElement(n))
+			return n;
+
+		n = n.parentNode;
+	}
+
+	return null;
+};
+
+TinyMCE_Engine.prototype.insertAfter = function(n, r){
+	if (r.nextSibling)
+		r.parentNode.insertBefore(n, r.nextSibling);
+	else
+		r.parentNode.appendChild(n);
+};
+
+TinyMCE_Engine.prototype.setInnerHTML = function(e, h) {
+	var i, nl, n;
+
+	if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+		// Since MSIE handles invalid HTML better that valid XHTML we
+		// need to make some things invalid. <hr /> gets converted to <hr>.
+		h = h.replace(/\s\/>/g, '>');
+
+		// Since MSIE auto generated emtpy P tags some times we must tell it to keep the real ones
+		h = h.replace(/<p([^>]*)>\u00A0?<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
+		h = h.replace(/<p([^>]*)>\s*&nbsp;\s*<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
+		h = h.replace(/<p([^>]*)>\s+<\/p>/gi, '<p$1 mce_keep="true">&nbsp;</p>'); // Keep empty paragraphs
+
+		// Remove first comment
+		e.innerHTML = tinyMCE.uniqueTag + h;
+		e.firstChild.removeNode(true);
+
+		// Remove weird auto generated empty paragraphs unless it's supposed to be there
+		nl = e.getElementsByTagName("p");
+		for (i=nl.length-1; i>=0; i--) {
+			n = nl[i];
+
+			if (n.nodeName == 'P' && !n.hasChildNodes() && !n.mce_keep)
+				n.parentNode.removeChild(n);
+		}
+	} else {
+		h = this.fixGeckoBaseHREFBug(1, e, h);
+		e.innerHTML = h;
+		this.fixGeckoBaseHREFBug(2, e, h);
+	}
+};
+
+TinyMCE_Engine.prototype.getOuterHTML = function(e) {
+	if (tinyMCE.isMSIE)
+		return e.outerHTML;
+
+	var d = e.ownerDocument.createElement("body");
+	d.appendChild(e);
+	return d.innerHTML;
+};
+
+TinyMCE_Engine.prototype.setOuterHTML = function(e, h) {
+	if (tinyMCE.isMSIE) {
+		e.outerHTML = h;
+		return;
+	}
+
+	var d = e.ownerDocument.createElement("body");
+	d.innerHTML = h;
+	e.parentNode.replaceChild(d.firstChild, e);
+};
+
+TinyMCE_Engine.prototype._getElementById = function(id, d) {
+	var e, i, j, f;
+
+	if (typeof(d) == "undefined")
+		d = document;
+
+	e = d.getElementById(id);
+	if (!e) {
+		f = d.forms;
+
+		for (i=0; i<f.length; i++) {
+			for (j=0; j<f[i].elements.length; j++) {
+				if (f[i].elements[j].name == id) {
+					e = f[i].elements[j];
+					break;
+				}
+			}
+		}
+	}
+
+	return e;
+};
+
+TinyMCE_Engine.prototype.getNodeTree = function(n, na, t, nn) {
+	var i;
+
+	if (typeof(t) == "undefined" || n.nodeType == t && (typeof(nn) == "undefined" || n.nodeName == nn))
+		na[na.length] = n;
+
+	if (n.hasChildNodes()) {
+		for (i=0; i<n.childNodes.length; i++)
+			tinyMCE.getNodeTree(n.childNodes[i], na, t, nn);
+	}
+
+	return na;
+};
+
+TinyMCE_Engine.prototype.getParentElement = function(node, names, attrib_name, attrib_value) {
+	if (typeof(names) == "undefined") {
+		if (node.nodeType == 1)
+			return node;
+
+		// Find parent node that is a element
+		while ((node = node.parentNode) != null && node.nodeType != 1) ;
+
+		return node;
+	}
+
+	if (node == null)
+		return null;
+
+	var namesAr = names.toUpperCase().split(',');
+
+	do {
+		for (var i=0; i<namesAr.length; i++) {
+			if (node.nodeName == namesAr[i] || names == "*") {
+				if (typeof(attrib_name) == "undefined")
+					return node;
+				else if (node.getAttribute(attrib_name)) {
+					if (typeof(attrib_value) == "undefined") {
+						if (node.getAttribute(attrib_name) != "")
+							return node;
+					} else if (node.getAttribute(attrib_name) == attrib_value)
+						return node;
+				}
+			}
+		}
+	} while ((node = node.parentNode) != null);
+
+	return null;
+};
+
+TinyMCE_Engine.prototype.getParentNode = function(n, f) {
+	while (n) {
+		if (f(n))
+			return n;
+
+		n = n.parentNode;
+	}
+
+	return null;
+};
+
+TinyMCE_Engine.prototype.getAttrib = function(elm, name, default_value) {
+	if (typeof(default_value) == "undefined")
+		default_value = "";
+
+	// Not a element
+	if (!elm || elm.nodeType != 1)
+		return default_value;
+
+	var v = elm.getAttribute(name);
+
+	// Try className for class attrib
+	if (name == "class" && !v)
+		v = elm.className;
+
+	// Workaround for a issue with Firefox 1.5rc2+
+	if (tinyMCE.isGecko && name == "src" && elm.src != null && elm.src != "")
+		v = elm.src;
+
+	// Workaround for a issue with Firefox 1.5rc2+
+	if (tinyMCE.isGecko && name == "href" && elm.href != null && elm.href != "")
+		v = elm.href;
+
+	if (name == "http-equiv" && tinyMCE.isMSIE)
+		v = elm.httpEquiv;
+
+	if (name == "style" && !tinyMCE.isOpera)
+		v = elm.style.cssText;
+
+	return (v && v != "") ? v : default_value;
+};
+
+TinyMCE_Engine.prototype.setAttrib = function(element, name, value, fix_value) {
+	if (typeof(value) == "number" && value != null)
+		value = "" + value;
+
+	if (fix_value) {
+		if (value == null)
+			value = "";
+
+		var re = new RegExp('[^0-9%]', 'g');
+		value = value.replace(re, '');
+	}
+
+	if (name == "style")
+		element.style.cssText = value;
+
+	if (name == "class")
+		element.className = value;
+
+	if (value != null && value != "" && value != -1)
+		element.setAttribute(name, value);
+	else
+		element.removeAttribute(name);
+};
+
+TinyMCE_Engine.prototype.setStyleAttrib = function(elm, name, value) {
+	eval('elm.style.' + name + '=value;');
+
+	// Style attrib deleted
+	if (tinyMCE.isMSIE && value == null || value == '') {
+		var str = tinyMCE.serializeStyle(tinyMCE.parseStyle(elm.style.cssText));
+		elm.style.cssText = str;
+		elm.setAttribute("style", str);
+	}
+};
+
+TinyMCE_Engine.prototype.switchClass = function(ei, c) {
+	var e;
+
+	if (tinyMCE.switchClassCache[ei])
+		e = tinyMCE.switchClassCache[ei];
+	else
+		e = tinyMCE.switchClassCache[ei] = document.getElementById(ei);
+
+	if (e) {
+		// Keep tile mode
+		if (tinyMCE.settings.button_tile_map && e.className && e.className.indexOf('mceTiledButton') == 0)
+			c = 'mceTiledButton ' + c;
+
+		e.className = c;
+	}
+};
+
+TinyMCE_Engine.prototype.getAbsPosition = function(n) {
+	var p = {absLeft : 0, absTop : 0};
+
+	while (n) {
+		p.absLeft += n.offsetLeft;
+		p.absTop += n.offsetTop;
+		n = n.offsetParent;
+	}
+
+	return p;
+};
+
+TinyMCE_Engine.prototype.prevNode = function(e, n) {
+	var a = n.split(','), i;
+
+	while ((e = e.previousSibling) != null) {
+		for (i=0; i<a.length; i++) {
+			if (e.nodeName == a[i])
+				return e;
+		}
+	}
+
+	return null;
+};
+
+TinyMCE_Engine.prototype.nextNode = function(e, n) {
+	var a = n.split(','), i;
+
+	while ((e = e.nextSibling) != null) {
+		for (i=0; i<a.length; i++) {
+			if (e.nodeName == a[i])
+				return e;
+		}
+	}
+
+	return null;
+};
+
+TinyMCE_Engine.prototype.selectNodes = function(n, f, a) {
+	var i;
+
+	if (!a)
+		a = new Array();
+
+	if (f(n))
+		a[a.length] = n;
+
+	if (n.hasChildNodes()) {
+		for (i=0; i<n.childNodes.length; i++)
+			tinyMCE.selectNodes(n.childNodes[i], f, a);
+	}
+
+	return a;
+};
+
+TinyMCE_Engine.prototype.addCSSClass = function(e, c, b) {
+	var o = this.removeCSSClass(e, c);
+
+	return e.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
+};
+
+TinyMCE_Engine.prototype.removeCSSClass = function(e, c) {
+	var a = this.explode(' ', e.className), i;
+
+	for (i=0; i<a.length; i++) {
+		if (a[i] == c)
+			a[i] = '';
+	}
+
+	return e.className = a.join(' ');
+};
+
+TinyMCE_Engine.prototype.renameElement = function(e, n, d) {
+	var ne, i, ar;
+
+	d = typeof(d) == "undefined" ? tinyMCE.selectedInstance.getDoc() : d;
+
+	if (e) {
+		ne = d.createElement(n);
+
+		ar = e.attributes;
+		for (i=ar.length-1; i>-1; i--) {
+			if (ar[i].specified && ar[i].nodeValue)
+				ne.setAttribute(ar[i].nodeName.toLowerCase(), ar[i].nodeValue);
+		}
+
+		ar = e.childNodes;
+		for (i=0; i<ar.length; i++)
+			ne.appendChild(ar[i].cloneNode(true));
+
+		e.parentNode.replaceChild(ne, e);
+	}
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_URL.class.js */
+
+TinyMCE_Engine.prototype.parseURL = function(url_str) {
+	var urlParts = new Array();
+
+	if (url_str) {
+		var pos, lastPos;
+
+		// Parse protocol part
+		pos = url_str.indexOf('://');
+		if (pos != -1) {
+			urlParts['protocol'] = url_str.substring(0, pos);
+			lastPos = pos + 3;
+		}
+
+		// Find port or path start
+		for (var i=lastPos; i<url_str.length; i++) {
+			var chr = url_str.charAt(i);
+
+			if (chr == ':')
+				break;
+
+			if (chr == '/')
+				break;
+		}
+		pos = i;
+
+		// Get host
+		urlParts['host'] = url_str.substring(lastPos, pos);
+
+		// Get port
+		urlParts['port'] = "";
+		lastPos = pos;
+		if (url_str.charAt(pos) == ':') {
+			pos = url_str.indexOf('/', lastPos);
+			urlParts['port'] = url_str.substring(lastPos+1, pos);
+		}
+
+		// Get path
+		lastPos = pos;
+		pos = url_str.indexOf('?', lastPos);
+
+		if (pos == -1)
+			pos = url_str.indexOf('#', lastPos);
+
+		if (pos == -1)
+			pos = url_str.length;
+
+		urlParts['path'] = url_str.substring(lastPos, pos);
+
+		// Get query
+		lastPos = pos;
+		if (url_str.charAt(pos) == '?') {
+			pos = url_str.indexOf('#');
+			pos = (pos == -1) ? url_str.length : pos;
+			urlParts['query'] = url_str.substring(lastPos+1, pos);
+		}
+
+		// Get anchor
+		lastPos = pos;
+		if (url_str.charAt(pos) == '#') {
+			pos = url_str.length;
+			urlParts['anchor'] = url_str.substring(lastPos+1, pos);
+		}
+	}
+
+	return urlParts;
+};
+
+TinyMCE_Engine.prototype.serializeURL = function(up) {
+	var o = "";
+
+	if (up['protocol'])
+		o += up['protocol'] + "://";
+
+	if (up['host'])
+		o += up['host'];
+
+	if (up['port'])
+		o += ":" + up['port'];
+
+	if (up['path'])
+		o += up['path'];
+
+	if (up['query'])
+		o += "?" + up['query'];
+
+	if (up['anchor'])
+		o += "#" + up['anchor'];
+
+	return o;
+};
+
+TinyMCE_Engine.prototype.convertAbsoluteURLToRelativeURL = function(base_url, url_to_relative) {
+	var baseURL = this.parseURL(base_url);
+	var targetURL = this.parseURL(url_to_relative);
+	var strTok1;
+	var strTok2;
+	var breakPoint = 0;
+	var outPath = "";
+	var forceSlash = false;
+
+	if (targetURL.path == "")
+		targetURL.path = "/";
+	else
+		forceSlash = true;
+
+	// Crop away last path part
+	base_url = baseURL.path.substring(0, baseURL.path.lastIndexOf('/'));
+	strTok1 = base_url.split('/');
+	strTok2 = targetURL.path.split('/');
+
+	if (strTok1.length >= strTok2.length) {
+		for (var i=0; i<strTok1.length; i++) {
+			if (i >= strTok2.length || strTok1[i] != strTok2[i]) {
+				breakPoint = i + 1;
+				break;
+			}
+		}
+	}
+
+	if (strTok1.length < strTok2.length) {
+		for (var i=0; i<strTok2.length; i++) {
+			if (i >= strTok1.length || strTok1[i] != strTok2[i]) {
+				breakPoint = i + 1;
+				break;
+			}
+		}
+	}
+
+	if (breakPoint == 1)
+		return targetURL.path;
+
+	for (var i=0; i<(strTok1.length-(breakPoint-1)); i++)
+		outPath += "../";
+
+	for (var i=breakPoint-1; i<strTok2.length; i++) {
+		if (i != (breakPoint-1))
+			outPath += "/" + strTok2[i];
+		else
+			outPath += strTok2[i];
+	}
+
+	targetURL.protocol = null;
+	targetURL.host = null;
+	targetURL.port = null;
+	targetURL.path = outPath == "" && forceSlash ? "/" : outPath;
+
+	// Remove document prefix from local anchors
+	var fileName = baseURL.path;
+	var pos;
+
+	if ((pos = fileName.lastIndexOf('/')) != -1)
+		fileName = fileName.substring(pos + 1);
+
+	// Is local anchor
+	if (fileName == targetURL.path && targetURL.anchor != "")
+		targetURL.path = "";
+
+	// If empty and not local anchor force filename or slash
+	if (targetURL.path == "" && !targetURL.anchor)
+		targetURL.path = fileName != "" ? fileName : "/";
+
+	return this.serializeURL(targetURL);
+};
+
+TinyMCE_Engine.prototype.convertRelativeToAbsoluteURL = function(base_url, relative_url) {
+	var baseURL = this.parseURL(base_url);
+	var relURL = this.parseURL(relative_url);
+
+	if (relative_url == "" || relative_url.charAt(0) == '/' || relative_url.indexOf('://') != -1 || relative_url.indexOf('mailto:') != -1 || relative_url.indexOf('javascript:') != -1)
+		return relative_url;
+
+	// Split parts
+	baseURLParts = baseURL['path'].split('/');
+	relURLParts = relURL['path'].split('/');
+
+	// Remove empty chunks
+	var newBaseURLParts = new Array();
+	for (var i=baseURLParts.length-1; i>=0; i--) {
+		if (baseURLParts[i].length == 0)
+			continue;
+
+		newBaseURLParts[newBaseURLParts.length] = baseURLParts[i];
+	}
+	baseURLParts = newBaseURLParts.reverse();
+
+	// Merge relURLParts chunks
+	var newRelURLParts = new Array();
+	var numBack = 0;
+	for (var i=relURLParts.length-1; i>=0; i--) {
+		if (relURLParts[i].length == 0 || relURLParts[i] == ".")
+			continue;
+
+		if (relURLParts[i] == '..') {
+			numBack++;
+			continue;
+		}
+
+		if (numBack > 0) {
+			numBack--;
+			continue;
+		}
+
+		newRelURLParts[newRelURLParts.length] = relURLParts[i];
+	}
+
+	relURLParts = newRelURLParts.reverse();
+
+	// Remove end from absolute path
+	var len = baseURLParts.length-numBack;
+	var absPath = (len <= 0 ? "" : "/") + baseURLParts.slice(0, len).join('/') + "/" + relURLParts.join('/');
+	var start = "", end = "";
+
+	// Build output URL
+	relURL.protocol = baseURL.protocol;
+	relURL.host = baseURL.host;
+	relURL.port = baseURL.port;
+
+	// Re-add trailing slash if it's removed
+	if (relURL.path.charAt(relURL.path.length-1) == "/")
+		absPath += "/";
+
+	relURL.path = absPath;
+
+	return this.serializeURL(relURL);
+};
+
+TinyMCE_Engine.prototype.convertURL = function(url, node, on_save) {
+	var prot = document.location.protocol;
+	var host = document.location.hostname;
+	var port = document.location.port;
+
+	// Pass through file protocol
+	if (prot == "file:")
+		return url;
+
+	// Something is wrong, remove weirdness
+	url = tinyMCE.regexpReplace(url, '(http|https):///', '/');
+
+	// Mailto link or anchor (Pass through)
+	if (url.indexOf('mailto:') != -1 || url.indexOf('javascript:') != -1 || tinyMCE.regexpReplace(url,'[ \t\r\n\+]|%20','').charAt(0) == "#")
+		return url;
+
+	// Fix relative/Mozilla
+	if (!tinyMCE.isMSIE && !on_save && url.indexOf("://") == -1 && url.charAt(0) != '/')
+		return tinyMCE.settings['base_href'] + url;
+
+	// Handle relative URLs
+	if (on_save && tinyMCE.getParam('relative_urls')) {
+		var curl = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], url);
+		if (curl.charAt(0) == '/')
+			curl = tinyMCE.settings['document_base_prefix'] + curl;
+
+		var urlParts = tinyMCE.parseURL(curl);
+		var tmpUrlParts = tinyMCE.parseURL(tinyMCE.settings['document_base_url']);
+
+		// Force relative
+		if (urlParts['host'] == tmpUrlParts['host'] && (urlParts['port'] == tmpUrlParts['port']))
+			return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings['document_base_url'], curl);
+	}
+
+	// Handle absolute URLs
+	if (!tinyMCE.getParam('relative_urls')) {
+		var urlParts = tinyMCE.parseURL(url);
+		var baseUrlParts = tinyMCE.parseURL(tinyMCE.settings['base_href']);
+
+		// Force absolute URLs from relative URLs
+		url = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], url);
+
+		// If anchor and path is the same page
+		if (urlParts['anchor'] && urlParts['path'] == baseUrlParts['path'])
+			return "#" + urlParts['anchor'];
+	}
+
+	// Remove current domain
+	if (tinyMCE.getParam('remove_script_host')) {
+		var start = "", portPart = "";
+
+		if (port != "")
+			portPart = ":" + port;
+
+		start = prot + "//" + host + portPart + "/";
+
+		if (url.indexOf(start) == 0)
+			url = url.substring(start.length-1);
+	}
+
+	return url;
+};
+
+TinyMCE_Engine.prototype.convertAllRelativeURLs = function(body) {
+	// Convert all image URL:s to absolute URL
+	var elms = body.getElementsByTagName("img");
+	for (var i=0; i<elms.length; i++) {
+		var src = tinyMCE.getAttrib(elms[i], 'src');
+
+		var msrc = tinyMCE.getAttrib(elms[i], 'mce_src');
+		if (msrc != "")
+			src = msrc;
+
+		if (src != "") {
+			src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);
+			elms[i].setAttribute("src", src);
+		}
+	}
+
+	// Convert all link URL:s to absolute URL
+	var elms = body.getElementsByTagName("a");
+	for (var i=0; i<elms.length; i++) {
+		var href = tinyMCE.getAttrib(elms[i], 'href');
+
+		var mhref = tinyMCE.getAttrib(elms[i], 'mce_href');
+		if (mhref != "")
+			href = mhref;
+
+		if (href && href != "") {
+			href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], href);
+			elms[i].setAttribute("href", href);
+		}
+	}
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Array.class.js */
+
+TinyMCE_Engine.prototype.clearArray = function(a) {
+	for (var k in a)
+		a[k] = null;
+
+	return a;
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Event.class.js */
+
+TinyMCE_Engine.prototype._setEventsEnabled = function(node, state) {
+	var events = new Array('onfocus','onblur','onclick','ondblclick',
+				'onmousedown','onmouseup','onmouseover','onmousemove',
+				'onmouseout','onkeypress','onkeydown','onkeydown','onkeyup');
+
+	var evs = tinyMCE.settings['event_elements'].split(',');
+	for (var y=0; y<evs.length; y++){
+		var elms = node.getElementsByTagName(evs[y]);
+		for (var i=0; i<elms.length; i++) {
+			var event = "";
+
+			for (var x=0; x<events.length; x++) {
+				if ((event = tinyMCE.getAttrib(elms[i], events[x])) != '') {
+					event = tinyMCE.cleanupEventStr("" + event);
+
+					if (!state)
+						event = "return true;" + event;
+					else
+						event = event.replace(/^return true;/gi, '');
+
+					elms[i].removeAttribute(events[x]);
+					elms[i].setAttribute(events[x], event);
+				}
+			}
+		}
+	}
+};
+
+TinyMCE_Engine.prototype._eventPatch = function(editor_id) {
+	var n, inst, win, e;
+
+	// Remove odd, error
+	if (typeof(tinyMCE) == "undefined")
+		return true;
+
+	try {
+		// Try selected instance first
+		if (tinyMCE.selectedInstance) {
+			win = tinyMCE.selectedInstance.getWin();
+
+			if (win && win.event) {
+				e = win.event;
+
+				if (!e.target)
+					e.target = e.srcElement;
+
+				TinyMCE_Engine.prototype.handleEvent(e);
+				return;
+			}
+		}
+
+		// Search for it
+		for (n in tinyMCE.instances) {
+			inst = tinyMCE.instances[n];
+
+			if (!tinyMCE.isInstance(inst))
+				continue;
+
+			tinyMCE.selectedInstance = inst;
+			win = inst.getWin();
+
+			if (win && win.event) {
+				e = win.event;
+
+				if (!e.target)
+					e.target = e.srcElement;
+
+				TinyMCE_Engine.prototype.handleEvent(e);
+				return;
+			}
+		}
+	} catch (ex) {
+		// Ignore error if iframe is pointing to external URL
+	}
+};
+
+TinyMCE_Engine.prototype.unloadHandler = function() {
+	tinyMCE.triggerSave(true, true);
+};
+
+TinyMCE_Engine.prototype.addEventHandlers = function(inst) {
+	var doc = inst.getDoc();
+
+	inst.switchSettings();
+
+	if (tinyMCE.isMSIE) {
+		tinyMCE.addEvent(doc, "keypress", TinyMCE_Engine.prototype._eventPatch);
+		tinyMCE.addEvent(doc, "keyup", TinyMCE_Engine.prototype._eventPatch);
+		tinyMCE.addEvent(doc, "keydown", TinyMCE_Engine.prototype._eventPatch);
+		tinyMCE.addEvent(doc, "mouseup", TinyMCE_Engine.prototype._eventPatch);
+		tinyMCE.addEvent(doc, "mousedown", TinyMCE_Engine.prototype._eventPatch);
+		tinyMCE.addEvent(doc, "click", TinyMCE_Engine.prototype._eventPatch);
+	} else {
+		tinyMCE.addEvent(doc, "keypress", tinyMCE.handleEvent);
+		tinyMCE.addEvent(doc, "keydown", tinyMCE.handleEvent);
+		tinyMCE.addEvent(doc, "keyup", tinyMCE.handleEvent);
+		tinyMCE.addEvent(doc, "click", tinyMCE.handleEvent);
+		tinyMCE.addEvent(doc, "mouseup", tinyMCE.handleEvent);
+		tinyMCE.addEvent(doc, "mousedown", tinyMCE.handleEvent);
+		tinyMCE.addEvent(doc, "focus", tinyMCE.handleEvent);
+		tinyMCE.addEvent(doc, "blur", tinyMCE.handleEvent);
+
+		eval('try { doc.designMode = "On"; } catch(e) {}'); // Force designmode
+	}
+};
+
+TinyMCE_Engine.prototype.onMouseMove = function() {
+	var inst;
+
+	if (!tinyMCE.hasMouseMoved) {
+		inst = tinyMCE.selectedInstance;
+
+		// Workaround for bug #1437457 (Odd MSIE bug)
+		if (inst.isFocused) {
+			inst.undoBookmark = inst.selection.getBookmark();
+			tinyMCE.hasMouseMoved = true;
+		}
+	}
+
+//	tinyMCE.cancelEvent(inst.getWin().event);
+//	return false;
+};
+
+TinyMCE_Engine.prototype.cancelEvent = function(e) {
+	if (tinyMCE.isMSIE) {
+		e.returnValue = false;
+		e.cancelBubble = true;
+	} else
+		e.preventDefault();
+};
+
+TinyMCE_Engine.prototype.addEvent = function(o, n, h) {
+	if (o.attachEvent)
+		o.attachEvent("on" + n, h);
+	else
+		o.addEventListener(n, h, false);
+};
+
+TinyMCE_Engine.prototype.addSelectAccessibility = function(e, s, w) {
+	// Add event handlers 
+	if (!s._isAccessible) {
+		s.onkeydown = tinyMCE.accessibleEventHandler;
+		s.onblur = tinyMCE.accessibleEventHandler;
+		s._isAccessible = true;
+		s._win = w;
+	}
+
+	return false;
+};
+
+TinyMCE_Engine.prototype.accessibleEventHandler = function(e) {
+	var win = this._win;
+	e = tinyMCE.isMSIE ? win.event : e;
+	var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
+
+	// Unpiggyback onchange on blur
+	if (e.type == "blur") {
+		if (elm.oldonchange) {
+			elm.onchange = elm.oldonchange;
+			elm.oldonchange = null;
+		}
+
+		return true;
+	}
+
+	// Piggyback onchange
+	if (elm.nodeName == "SELECT" && !elm.oldonchange) {
+		elm.oldonchange = elm.onchange;
+		elm.onchange = null;
+	}
+
+	// Execute onchange and remove piggyback
+	if (e.keyCode == 13 || e.keyCode == 32) {
+		elm.onchange = elm.oldonchange;
+		elm.onchange();
+		elm.oldonchange = null;
+
+		tinyMCE.cancelEvent(e);
+		return false;
+	}
+
+	return true;
+};
+
+TinyMCE_Engine.prototype._resetIframeHeight = function() {
+	var ife;
+
+	if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+		ife = tinyMCE.selectedInstance.iframeElement;
+
+/*		if (ife._oldWidth) {
+			ife.style.width = ife._oldWidth;
+			ife.width = ife._oldWidth;
+		}*/
+
+		if (ife._oldHeight) {
+			ife.style.height = ife._oldHeight;
+			ife.height = ife._oldHeight;
+		}
+	}
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Selection.class.js */
+
+function TinyMCE_Selection(inst) {
+	this.instance = inst;
+};
+
+TinyMCE_Selection.prototype = {
+	getSelectedHTML : function() {
+		var inst = this.instance;
+		var e, r = this.getRng(), h;
+
+		if (tinyMCE.isSafari) {
+			// Not realy perfect!!
+			return r.toString();
+		}
+
+		e = document.createElement("body");
+
+		if (tinyMCE.isGecko)
+			e.appendChild(r.cloneContents());
+		else 
+			e.innerHTML = r.item ? r.item(0).outerHTML : r.htmlText;
+
+		h = tinyMCE._cleanupHTML(inst, inst.contentDocument, inst.settings, e, e, false, true, false);
+
+		// When editing always use fonts internaly
+		if (tinyMCE.getParam("convert_fonts_to_spans"))
+			tinyMCE.convertSpansToFonts(inst.getDoc());
+
+		return h;
+	},
+
+	getSelectedText : function() {
+		var inst = this.instance;
+		var d, r, s, t;
+
+		if (tinyMCE.isMSIE) {
+			d = inst.getDoc();
+
+			if (d.selection.type == "Text") {
+				r = d.selection.createRange();
+				t = r.text;
+			} else
+				t = '';
+		} else {
+			s = this.getSel();
+
+			if (s && s.toString)
+				t = s.toString();
+			else
+				t = '';
+		}
+
+		return t;
+	},
+
+	getBookmark : function(simple) {
+		var rng = this.getRng();
+		var doc = this.instance.getDoc();
+		var sp, le, s, e, nl, i, si, ei;
+		var trng, sx, sy, xx = -999999999;
+
+		// Skip Opera for now
+		if (tinyMCE.isOpera)
+			return null;
+
+		sx = doc.body.scrollLeft + doc.documentElement.scrollLeft;
+		sy = doc.body.scrollTop + doc.documentElement.scrollTop;
+
+		if (tinyMCE.isSafari || tinyMCE.isGecko)
+			return {rng : rng, scrollX : sx, scrollY : sy};
+
+		if (tinyMCE.isMSIE) {
+			if (simple)
+				return {rng : rng};
+
+			if (rng.item) {
+				e = rng.item(0);
+
+				nl = doc.getElementsByTagName(e.nodeName);
+				for (i=0; i<nl.length; i++) {
+					if (e == nl[i]) {
+						sp = i;
+						break;
+					}
+				}
+
+				return {
+					tag : e.nodeName,
+					index : sp,
+					scrollX : sx,
+					scrollY : sy
+				};
+			} else {
+				trng = rng.duplicate();
+				trng.collapse(true);
+				sp = Math.abs(trng.move('character', xx));
+
+				trng = rng.duplicate();
+				trng.collapse(false);
+				le = Math.abs(trng.move('character', xx)) - sp;
+
+				return {
+					start : sp,
+					length : le,
+					scrollX : sx,
+					scrollY : sy
+				};
+			}
+		}
+
+		if (tinyMCE.isGecko) {
+			s = tinyMCE.getParentElement(rng.startContainer);
+			for (si=0; si<s.childNodes.length && s.childNodes[si] != rng.startContainer; si++) ;
+
+			nl = doc.getElementsByTagName(s.nodeName);
+			for (i=0; i<nl.length; i++) {
+					if (s == nl[i]) {
+						sp = i;
+						break;
+					}
+			}
+
+			e = tinyMCE.getParentElement(rng.endContainer);
+			for (ei=0; ei<e.childNodes.length && e.childNodes[ei] != rng.endContainer; ei++) ;
+
+			nl = doc.getElementsByTagName(e.nodeName);
+			for (i=0; i<nl.length; i++) {
+					if (e == nl[i]) {
+						le = i;
+						break;
+					}
+			}
+
+			//tinyMCE.debug(s.nodeName, sp, rng.startOffset, '-' , e.nodeName, le, rng.endOffset);
+			//tinyMCE.debug(sx, sy);
+
+			return {
+				startTag : s.nodeName,
+				start : sp,
+				startIndex : si,
+				endTag : e.nodeName,
+				end : le,
+				endIndex : ei,
+				startOffset : rng.startOffset,
+				endOffset : rng.endOffset,
+				scrollX : sx,
+				scrollY : sy
+			};
+		}
+
+		return null;
+	},
+
+	moveToBookmark : function(bookmark) {
+		var rng, nl, i;
+		var inst = this.instance;
+		var doc = inst.getDoc();
+		var win = inst.getWin();
+		var sel = this.getSel();
+
+		if (!bookmark)
+			return false;
+
+		if (tinyMCE.isSafari) {
+			sel.setBaseAndExtent(bookmark.startContainer, bookmark.startOffset, bookmark.endContainer, bookmark.endOffset);
+			return true;
+		}
+
+		if (tinyMCE.isMSIE) {
+			if (bookmark.rng) {
+				bookmark.rng.select();
+				return true;
+			}
+
+			win.focus();
+
+			if (bookmark.tag) {
+				rng = inst.getBody().createControlRange();
+
+				nl = doc.getElementsByTagName(bookmark.tag);
+
+				if (nl.length > bookmark.index) {
+					try {
+						rng.addElement(nl[bookmark.index]);
+					} catch (ex) {
+						// Might be thrown if the node no longer exists
+					}
+				}
+			} else {
+				rng = inst.getSel().createRange();
+				rng.moveToElementText(inst.getBody());
+				rng.collapse(true);
+				rng.moveStart('character', bookmark.start);
+				rng.moveEnd('character', bookmark.length);
+			}
+
+			rng.select();
+
+			win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+			return true;
+		}
+
+		if (tinyMCE.isGecko && bookmark.rng) {
+			sel.removeAllRanges();
+			sel.addRange(bookmark.rng);
+			win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+			return true;
+		}
+
+		if (tinyMCE.isGecko) {
+	//		try {
+				rng = doc.createRange();
+
+				nl = doc.getElementsByTagName(bookmark.startTag);
+				if (nl.length > bookmark.start)
+					rng.setStart(nl[bookmark.start].childNodes[bookmark.startIndex], bookmark.startOffset);
+
+				nl = doc.getElementsByTagName(bookmark.endTag);
+				if (nl.length > bookmark.end)
+					rng.setEnd(nl[bookmark.end].childNodes[bookmark.endIndex], bookmark.endOffset);
+
+				sel.removeAllRanges();
+				sel.addRange(rng);
+	/*		} catch {
+				// Ignore
+			}*/
+
+			win.scrollTo(bookmark.scrollX, bookmark.scrollY);
+			return true;
+		}
+
+		return false;
+	},
+
+	selectNode : function(node, collapse, select_text_node, to_start) {
+		var inst = this.instance, sel, rng, nodes;
+
+		if (!node)
+			return;
+
+		if (typeof(collapse) == "undefined")
+			collapse = true;
+
+		if (typeof(select_text_node) == "undefined")
+			select_text_node = false;
+
+		if (typeof(to_start) == "undefined")
+			to_start = true;
+
+		if (tinyMCE.isMSIE) {
+			rng = inst.getBody().createTextRange();
+
+			try {
+				rng.moveToElementText(node);
+
+				if (collapse)
+					rng.collapse(to_start);
+
+				rng.select();
+			} catch (e) {
+				// Throws illigal agrument in MSIE some times
+			}
+		} else {
+			sel = this.getSel();
+
+			if (!sel)
+				return;
+
+			if (tinyMCE.isSafari) {
+				sel.setBaseAndExtent(node, 0, node, node.innerText.length);
+
+				if (collapse) {
+					if (to_start)
+						sel.collapseToStart();
+					else
+						sel.collapseToEnd();
+				}
+
+				this.scrollToNode(node);
+
+				return;
+			}
+
+			rng = inst.getDoc().createRange();
+
+			if (select_text_node) {
+				// Find first textnode in tree
+				nodes = tinyMCE.getNodeTree(node, new Array(), 3);
+				if (nodes.length > 0)
+					rng.selectNodeContents(nodes[0]);
+				else
+					rng.selectNodeContents(node);
+			} else
+				rng.selectNode(node);
+
+			if (collapse) {
+				// Special treatment of textnode collapse
+				if (!to_start && node.nodeType == 3) {
+					rng.setStart(node, node.nodeValue.length);
+					rng.setEnd(node, node.nodeValue.length);
+				} else
+					rng.collapse(to_start);
+			}
+
+			sel.removeAllRanges();
+			sel.addRange(rng);
+		}
+
+		this.scrollToNode(node);
+
+		// Set selected element
+		tinyMCE.selectedElement = null;
+		if (node.nodeType == 1)
+			tinyMCE.selectedElement = node;
+	},
+
+	scrollToNode : function(node) {
+		var inst = this.instance;
+		var pos, doc, scrollX, scrollY, height;
+
+		// Scroll to node position
+		pos = tinyMCE.getAbsPosition(node);
+		doc = inst.getDoc();
+		scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft;
+		scrollY = doc.body.scrollTop + doc.documentElement.scrollTop;
+		height = tinyMCE.isMSIE ? document.getElementById(inst.editorId).style.pixelHeight : inst.targetElement.clientHeight;
+
+		// Only scroll if out of visible area
+		if (!tinyMCE.settings['auto_resize'] && !(pos.absTop > scrollY && pos.absTop < (scrollY - 25 + height)))
+			inst.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); 
+	},
+
+	getSel : function() {
+		var inst = this.instance;
+
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+			return inst.getDoc().selection;
+
+		return inst.contentWindow.getSelection();
+	},
+
+	getRng : function() {
+		var inst = this.instance;
+		var sel = this.getSel();
+
+		if (sel == null)
+			return null;
+
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+			return sel.createRange();
+
+		if (tinyMCE.isSafari && !sel.getRangeAt)
+			return '' + window.getSelection();
+
+		return sel.getRangeAt(0);
+	},
+
+	getFocusElement : function() {
+		var inst = this.instance;
+
+		if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+			var doc = inst.getDoc();
+			var rng = doc.selection.createRange();
+
+	//		if (rng.collapse)
+	//			rng.collapse(true);
+
+			var elm = rng.item ? rng.item(0) : rng.parentElement();
+		} else {
+			if (inst.isHidden())
+				return inst.getBody();
+
+			var sel = this.getSel();
+			var rng = this.getRng();
+
+			if (!sel || !rng)
+				return null;
+
+			var elm = rng.commonAncestorContainer;
+			//var elm = (sel && sel.anchorNode) ? sel.anchorNode : null;
+
+			// Handle selection a image or other control like element such as anchors
+			if (!rng.collapsed) {
+				// Is selection small
+				if (rng.startContainer == rng.endContainer) {
+					if (rng.startOffset - rng.endOffset < 2) {
+						if (rng.startContainer.hasChildNodes())
+							elm = rng.startContainer.childNodes[rng.startOffset];
+					}
+				}
+			}
+
+			// Get the element parent of the node
+			elm = tinyMCE.getParentElement(elm);
+
+			//if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
+			//	elm = tinyMCE.selectedElement;
+		}
+
+		return elm;
+	}
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_UndoRedo.class.js */
+
+function TinyMCE_UndoRedo(inst) {
+	this.instance = inst;
+	this.undoLevels = new Array();
+	this.undoIndex = 0;
+	this.typingUndoIndex = -1;
+	this.undoRedo = true;
+};
+
+TinyMCE_UndoRedo.prototype = {
+	add : function(l) {
+		var b;
+
+		if (l) {
+			this.undoLevels[this.undoLevels.length] = l;
+			return true;
+		}
+
+		var inst = this.instance;
+
+		if (this.typingUndoIndex != -1) {
+			this.undoIndex = this.typingUndoIndex;
+			// tinyMCE.debug("Override: " + this.undoIndex);
+		}
+
+		var newHTML = tinyMCE.trim(inst.getBody().innerHTML);
+		if (this.undoLevels[this.undoIndex] && newHTML != this.undoLevels[this.undoIndex].content) {
+			//tinyMCE.debug(newHTML, this.undoLevels[this.undoIndex]);
+
+			tinyMCE.dispatchCallback(inst, 'onchange_callback', 'onChange', inst);
+
+			// Time to compress
+			var customUndoLevels = tinyMCE.settings['custom_undo_redo_levels'];
+			if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) {
+				for (var i=0; i<this.undoLevels.length-1; i++) {
+					//tinyMCE.debug(this.undoLevels[i] + "=" + this.undoLevels[i+1]);
+					this.undoLevels[i] = this.undoLevels[i+1];
+				}
+
+				this.undoLevels.length--;
+				this.undoIndex--;
+			}
+
+			b = inst.undoBookmark;
+			if (!b)
+				b = inst.selection.getBookmark();
+
+			this.undoIndex++;
+			this.undoLevels[this.undoIndex] = {
+				content : newHTML,
+				bookmark : b
+			};
+
+			this.undoLevels.length = this.undoIndex + 1;
+
+			//tinyMCE.debug("level added" + this.undoIndex);
+			return true;
+
+			// tinyMCE.debug(this.undoIndex + "," + (this.undoLevels.length-1));
+		}
+
+		return false;
+	},
+
+	undo : function() {
+		var inst = this.instance;
+
+		// Do undo
+		if (this.undoIndex > 0) {
+			this.undoIndex--;
+			tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content);
+			inst.repaint();
+			if (inst.settings.custom_undo_redo_restore_selection)
+				inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);
+		}
+
+		// tinyMCE.debug("Undo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex);
+	},
+
+	redo : function() {
+		var inst = this.instance;
+
+		tinyMCE.execCommand("mceEndTyping");
+
+		if (this.undoIndex < (this.undoLevels.length-1)) {
+			this.undoIndex++;
+			tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content);
+			inst.repaint();
+//					if (this.undoIndex > 0)
+//						inst.selection.moveToBookmark(this.undoLevels[this.undoIndex-1].bookmark);
+			if (inst.settings.custom_undo_redo_restore_selection)
+				inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);
+			// tinyMCE.debug("Redo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex);
+		}
+
+		tinyMCE.triggerNodeChange();
+	}
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_ForceParagraphs.class.js */
+
+var TinyMCE_ForceParagraphs = {
+	_insertPara : function(inst, e) {
+		function isEmpty(para) {
+			function isEmptyHTML(html) {
+				return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == "";
+			}
+
+			// Check for images
+			if (para.getElementsByTagName("img").length > 0)
+				return false;
+
+			// Check for tables
+			if (para.getElementsByTagName("table").length > 0)
+				return false;
+
+			// Check for HRs
+			if (para.getElementsByTagName("hr").length > 0)
+				return false;
+
+			// Check all textnodes
+			var nodes = tinyMCE.getNodeTree(para, new Array(), 3);
+			for (var i=0; i<nodes.length; i++) {
+				if (!isEmptyHTML(nodes[i].nodeValue))
+					return false;
+			}
+
+			// No images, no tables, no hrs, no text content then it's empty
+			return true;
+		}
+
+		var doc = inst.getDoc();
+		var sel = inst.getSel();
+		var win = inst.contentWindow;
+		var rng = sel.getRangeAt(0);
+		var body = doc.body;
+		var rootElm = doc.documentElement;
+		var blockName = "P";
+
+	//	tinyMCE.debug(body.innerHTML);
+
+	//	debug(e.target, sel.anchorNode.nodeName, sel.focusNode.nodeName, rng.startContainer, rng.endContainer, rng.commonAncestorContainer, sel.anchorOffset, sel.focusOffset, rng.toString());
+
+		// Setup before range
+		var rngBefore = doc.createRange();
+		rngBefore.setStart(sel.anchorNode, sel.anchorOffset);
+		rngBefore.collapse(true);
+
+		// Setup after range
+		var rngAfter = doc.createRange();
+		rngAfter.setStart(sel.focusNode, sel.focusOffset);
+		rngAfter.collapse(true);
+
+		// Setup start/end points
+		var direct = rngBefore.compareBoundaryPoints(rngBefore.START_TO_END, rngAfter) < 0;
+		var startNode = direct ? sel.anchorNode : sel.focusNode;
+		var startOffset = direct ? sel.anchorOffset : sel.focusOffset;
+		var endNode = direct ? sel.focusNode : sel.anchorNode;
+		var endOffset = direct ? sel.focusOffset : sel.anchorOffset;
+
+		startNode = startNode.nodeName == "BODY" ? startNode.firstChild : startNode;
+		endNode = endNode.nodeName == "BODY" ? endNode.firstChild : endNode;
+
+		// tinyMCE.debug(startNode, endNode);
+
+		// Get block elements
+		var startBlock = tinyMCE.getParentBlockElement(startNode);
+		var endBlock = tinyMCE.getParentBlockElement(endNode);
+
+		// If absolute force paragraph generation within
+		if (startBlock && new RegExp('absolute|relative|static', 'gi').test(startBlock.style.position))
+			startBlock = null;
+
+		if (endBlock && new RegExp('absolute|relative|static', 'gi').test(endBlock.style.position))
+			endBlock = null;
+
+		// Use current block name
+		if (startBlock != null) {
+			blockName = startBlock.nodeName;
+
+			// Use P instead
+			if (blockName == "TD" || blockName == "TABLE" || (blockName == "DIV" && new RegExp('left|right', 'gi').test(startBlock.style.cssFloat)))
+				blockName = "P";
+		}
+
+		// Within a list use normal behaviour
+		if (tinyMCE.getParentElement(startBlock, "OL,UL") != null)
+			return false;
+
+		// Within a table create new paragraphs
+		if ((startBlock != null && startBlock.nodeName == "TABLE") || (endBlock != null && endBlock.nodeName == "TABLE"))
+			startBlock = endBlock = null;
+
+		// Setup new paragraphs
+		var paraBefore = (startBlock != null && startBlock.nodeName == blockName) ? startBlock.cloneNode(false) : doc.createElement(blockName);
+		var paraAfter = (endBlock != null && endBlock.nodeName == blockName) ? endBlock.cloneNode(false) : doc.createElement(blockName);
+
+		// Is header, then force paragraph under
+		if (/^(H[1-6])$/.test(blockName))
+			paraAfter = doc.createElement("p");
+
+		// Setup chop nodes
+		var startChop = startNode;
+		var endChop = endNode;
+
+		// Get startChop node
+		node = startChop;
+		do {
+			if (node == body || node.nodeType == 9 || tinyMCE.isBlockElement(node))
+				break;
+
+			startChop = node;
+		} while ((node = node.previousSibling ? node.previousSibling : node.parentNode));
+
+		// Get endChop node
+		node = endChop;
+		do {
+			if (node == body || node.nodeType == 9 || tinyMCE.isBlockElement(node))
+				break;
+
+			endChop = node;
+		} while ((node = node.nextSibling ? node.nextSibling : node.parentNode));
+
+		// Fix when only a image is within the TD
+		if (startChop.nodeName == "TD")
+			startChop = startChop.firstChild;
+
+		if (endChop.nodeName == "TD")
+			endChop = endChop.lastChild;
+
+		// If not in a block element
+		if (startBlock == null) {
+			// Delete selection
+			rng.deleteContents();
+			sel.removeAllRanges();
+
+			if (startChop != rootElm && endChop != rootElm) {
+				// Insert paragraph before
+				rngBefore = rng.cloneRange();
+
+				if (startChop == body)
+					rngBefore.setStart(startChop, 0);
+				else
+					rngBefore.setStartBefore(startChop);
+
+				paraBefore.appendChild(rngBefore.cloneContents());
+
+				// Insert paragraph after
+				if (endChop.parentNode.nodeName == blockName)
+					endChop = endChop.parentNode;
+
+				// If not after image
+				//if (rng.startContainer.nodeName != "BODY" && rng.endContainer.nodeName != "BODY")
+					rng.setEndAfter(endChop);
+
+				if (endChop.nodeName != "#text" && endChop.nodeName != "BODY")
+					rngBefore.setEndAfter(endChop);
+
+				var contents = rng.cloneContents();
+				if (contents.firstChild && (contents.firstChild.nodeName == blockName || contents.firstChild.nodeName == "BODY"))
+					paraAfter.innerHTML = contents.firstChild.innerHTML;
+				else
+					paraAfter.appendChild(contents);
+
+				// Check if it's a empty paragraph
+				if (isEmpty(paraBefore))
+					paraBefore.innerHTML = "&nbsp;";
+
+				// Check if it's a empty paragraph
+				if (isEmpty(paraAfter))
+					paraAfter.innerHTML = "&nbsp;";
+
+				// Delete old contents
+				rng.deleteContents();
+				rngAfter.deleteContents();
+				rngBefore.deleteContents();
+
+				// Insert new paragraphs
+				paraAfter.normalize();
+				rngBefore.insertNode(paraAfter);
+				paraBefore.normalize();
+				rngBefore.insertNode(paraBefore);
+
+				// tinyMCE.debug("1: ", paraBefore.innerHTML, paraAfter.innerHTML);
+			} else {
+				body.innerHTML = "<" + blockName + ">&nbsp;</" + blockName + "><" + blockName + ">&nbsp;</" + blockName + ">";
+				paraAfter = body.childNodes[1];
+			}
+
+			inst.selection.selectNode(paraAfter, true, true);
+
+			return true;
+		}
+
+		// Place first part within new paragraph
+		if (startChop.nodeName == blockName)
+			rngBefore.setStart(startChop, 0);
+		else
+			rngBefore.setStartBefore(startChop);
+
+		rngBefore.setEnd(startNode, startOffset);
+		paraBefore.appendChild(rngBefore.cloneContents());
+
+		// Place secound part within new paragraph
+		rngAfter.setEndAfter(endChop);
+		rngAfter.setStart(endNode, endOffset);
+		var contents = rngAfter.cloneContents();
+
+		if (contents.firstChild && contents.firstChild.nodeName == blockName) {
+	/*		var nodes = contents.firstChild.childNodes;
+			for (var i=0; i<nodes.length; i++) {
+				//tinyMCE.debug(nodes[i].nodeName);
+				if (nodes[i].nodeName != "BODY")
+					paraAfter.appendChild(nodes[i]);
+			}
+	*/
+			paraAfter.innerHTML = contents.firstChild.innerHTML;
+		} else
+			paraAfter.appendChild(contents);
+
+		// Check if it's a empty paragraph
+		if (isEmpty(paraBefore))
+			paraBefore.innerHTML = "&nbsp;";
+
+		// Check if it's a empty paragraph
+		if (isEmpty(paraAfter))
+			paraAfter.innerHTML = "&nbsp;";
+
+		// Create a range around everything
+		var rng = doc.createRange();
+
+		if (!startChop.previousSibling && startChop.parentNode.nodeName.toUpperCase() == blockName) {
+			rng.setStartBefore(startChop.parentNode);
+		} else {
+			if (rngBefore.startContainer.nodeName.toUpperCase() == blockName && rngBefore.startOffset == 0)
+				rng.setStartBefore(rngBefore.startContainer);
+			else
+				rng.setStart(rngBefore.startContainer, rngBefore.startOffset);
+		}
+
+		if (!endChop.nextSibling && endChop.parentNode.nodeName.toUpperCase() == blockName)
+			rng.setEndAfter(endChop.parentNode);
+		else
+			rng.setEnd(rngAfter.endContainer, rngAfter.endOffset);
+
+		// Delete all contents and insert new paragraphs
+		rng.deleteContents();
+		rng.insertNode(paraAfter);
+		rng.insertNode(paraBefore);
+		//tinyMCE.debug("2", paraBefore.innerHTML, paraAfter.innerHTML);
+
+		// Normalize
+		paraAfter.normalize();
+		paraBefore.normalize();
+
+		inst.selection.selectNode(paraAfter, true, true);
+
+		return true;
+	},
+
+	_handleBackSpace : function(inst) {
+		var r = inst.getRng(), sn = r.startContainer, nv, s = false;
+
+		if (sn && sn.nextSibling && sn.nextSibling.nodeName == "BR") {
+			nv = sn.nodeValue;
+
+			// Handle if a backspace is pressed after a space character #bug 1466054
+			if (nv != null && nv.length >= r.startOffset && nv.charAt(r.startOffset - 1) == ' ')
+				s = true;
+
+			// Only remove BRs if we are at the end of line #bug 1464152
+			if (nv != null && r.startOffset == nv.length)
+				sn.nextSibling.parentNode.removeChild(sn.nextSibling);
+		}
+
+		return s;
+	}
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Layer.class.js */
+
+function TinyMCE_Layer(id, bm) {
+	this.id = id;
+	this.blockerElement = null;
+	this.events = false;
+	this.element = null;
+	this.blockMode = typeof(bm) != 'undefined' ? bm : true;
+	this.doc = document;
+};
+
+TinyMCE_Layer.prototype = {
+	moveRelativeTo : function(re, p) {
+		var rep = this.getAbsPosition(re);
+		var w = parseInt(re.offsetWidth);
+		var h = parseInt(re.offsetHeight);
+		var e = this.getElement();
+		var ew = parseInt(e.offsetWidth);
+		var eh = parseInt(e.offsetHeight);
+		var x, y;
+
+		switch (p) {
+			case "tl":
+				x = rep.absLeft;
+				y = rep.absTop;
+				break;
+
+			case "tr":
+				x = rep.absLeft + w;
+				y = rep.absTop;
+				break;
+
+			case "bl":
+				x = rep.absLeft;
+				y = rep.absTop + h;
+				break;
+
+			case "br":
+				x = rep.absLeft + w;
+				y = rep.absTop + h;
+				break;
+
+			case "cc":
+				x = rep.absLeft + (w / 2) - (ew / 2);
+				y = rep.absTop + (h / 2) - (eh / 2);
+				break;
+		}
+
+		this.moveTo(x, y);
+	},
+
+	moveBy : function(x, y) {
+		var e = this.getElement();
+		this.moveTo(parseInt(e.style.left) + x, parseInt(e.style.top) + y);
+	},
+
+	moveTo : function(x, y) {
+		var e = this.getElement();
+
+		e.style.left = x + "px";
+		e.style.top = y + "px";
+
+		this.updateBlocker();
+	},
+
+	resizeBy : function(w, h) {
+		var e = this.getElement();
+		this.resizeTo(parseInt(e.style.width) + w, parseInt(e.style.height) + h);
+	},
+
+	resizeTo : function(w, h) {
+		var e = this.getElement();
+
+		if (w != null)
+			e.style.width = w + "px";
+
+		if (h != null)
+			e.style.height = h + "px";
+
+		this.updateBlocker();
+	},
+
+	show : function() {
+		this.getElement().style.display = 'block';
+		this.updateBlocker();
+	},
+
+	hide : function() {
+		this.getElement().style.display = 'none';
+		this.updateBlocker();
+	},
+
+	isVisible : function() {
+		return this.getElement().style.display == 'block';
+	},
+
+	getElement : function() {
+		if (!this.element)
+			this.element = this.doc.getElementById(this.id);
+
+		return this.element;
+	},
+
+	setBlockMode : function(s) {
+		this.blockMode = s;
+	},
+
+	updateBlocker : function() {
+		var e, b, x, y, w, h;
+
+		b = this.getBlocker();
+		if (b) {
+			if (this.blockMode) {
+				e = this.getElement();
+				x = this.parseInt(e.style.left);
+				y = this.parseInt(e.style.top);
+				w = this.parseInt(e.offsetWidth);
+				h = this.parseInt(e.offsetHeight);
+
+				b.style.left = x + 'px';
+				b.style.top = y + 'px';
+				b.style.width = w + 'px';
+				b.style.height = h + 'px';
+				b.style.display = e.style.display;
+			} else
+				b.style.display = 'none';
+		}
+	},
+
+	getBlocker : function() {
+		var d, b;
+
+		if (!this.blockerElement && this.blockMode) {
+			d = this.doc;
+			b = d.createElement("iframe");
+
+			b.style.cssText = 'display: none; position: absolute; left: 0; top: 0';
+			b.src = 'javascript:false;';
+			b.frameBorder = '0';
+			b.scrolling = 'no';
+
+			d.body.appendChild(b);
+			this.blockerElement = b;
+		}
+
+		return this.blockerElement;
+	},
+
+	getAbsPosition : function(n) {
+		var p = {absLeft : 0, absTop : 0};
+
+		while (n) {
+			p.absLeft += n.offsetLeft;
+			p.absTop += n.offsetTop;
+			n = n.offsetParent;
+		}
+
+		return p;
+	},
+
+	create : function(n, c, p) {
+		var d = this.doc, e = d.createElement(n);
+
+		e.setAttribute('id', this.id);
+
+		if (c)
+			e.className = c;
+
+		if (!p)
+			p = d.body;
+
+		p.appendChild(e);
+
+		return this.element = e;
+	},
+
+	parseInt : function(s) {
+		if (s == null || s == '')
+			return 0;
+
+		return parseInt(s);
+	}
+};
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Menu.class.js */
+
+function TinyMCE_Menu() {
+	var id;
+
+	if (typeof(tinyMCE.menuCounter) == "undefined")
+		tinyMCE.menuCounter = 0;
+
+	id = "mc_menu_" + tinyMCE.menuCounter++;
+
+	TinyMCE_Layer.call(this, id, true);
+
+	this.id = id;
+	this.items = new Array();
+	this.needsUpdate = true;
+};
+
+// Extends the TinyMCE_Layer class
+TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, {
+	init : function(s) {
+		var n;
+
+		// Default params
+		this.settings = {
+			separator_class : 'mceMenuSeparator',
+			title_class : 'mceMenuTitle',
+			disabled_class : 'mceMenuDisabled',
+			menu_class : 'mceMenu',
+			drop_menu : true
+		};
+
+		for (n in s)
+			this.settings[n] = s[n];
+
+		this.create('div', this.settings.menu_class);
+	},
+
+	clear : function() {
+		this.items = new Array();
+	},
+
+	addTitle : function(t) {
+		this.add({type : 'title', text : t});
+	},
+
+	addDisabled : function(t) {
+		this.add({type : 'disabled', text : t});
+	},
+
+	addSeparator : function() {
+		this.add({type : 'separator'});
+	},
+
+	addItem : function(t, js) {
+		this.add({text : t, js : js});
+	},
+
+	add : function(mi) {
+		this.items[this.items.length] = mi;
+		this.needsUpdate = true;
+	},
+
+	update : function() {
+		var e = this.getElement(), h = '', i, t, m = this.items, s = this.settings;
+
+		if (this.settings.drop_menu)
+			h += '<span class="mceMenuLine"></span>';
+
+		h += '<table border="0" cellpadding="0" cellspacing="0">';
+
+		for (i=0; i<m.length; i++) {
+			t = tinyMCE.xmlEncode(m[i].text);
+			c = m[i].class_name ? ' class="' + m[i].class_name + '"' : '';
+
+			switch (m[i].type) {
+				case 'separator':
+					h += '<tr class="' + s.separator_class + '"><td>';
+					break;
+
+				case 'title':
+					h += '<tr class="' + s.title_class + '"><td><span' + c +'>' + t + '</span>';
+					break;
+
+				case 'disabled':
+					h += '<tr class="' + s.disabled_class + '"><td><span' + c +'>' + t + '</span>';
+					break;
+
+				default:
+					h += '<tr><td><a href="javascript:void(0);" onmousedown="' + tinyMCE.xmlEncode(m[i].js) + ';return false;"><span' + c +'>' + t + '</span></a>';
+			}
+
+			h += '</td></tr>';
+		}
+
+		h += '</table>';
+
+		e.innerHTML = h;
+
+		this.needsUpdate = false;
+		this.updateBlocker();
+	},
+
+	show : function() {
+		var nl, i;
+
+		if (tinyMCE.lastMenu == this)
+			return;
+
+		if (this.needsUpdate)
+			this.update();
+
+		if (tinyMCE.lastMenu && tinyMCE.lastMenu != this)
+			tinyMCE.lastMenu.hide();
+
+		TinyMCE_Layer.prototype.show.call(this);
+
+		if (!tinyMCE.isOpera) {
+			// Accessibility stuff
+/*			nl = this.getElement().getElementsByTagName("a");
+			if (nl.length > 0)
+				nl[0].focus();*/
+		}
+
+		tinyMCE.lastMenu = this;
+	}
+});
+
+/* file:jscripts/tiny_mce/classes/TinyMCE_Debug.class.js */
+
+TinyMCE_Engine.prototype.debug = function() {
+	var m = "", e, a, i;
+
+	e = document.getElementById("tinymce_debug");
+	if (!e) {
+		var d = document.createElement("div");
+		d.setAttribute("className", "debugger");
+		d.className = "debugger";
+		d.innerHTML = 'Debug output:<textarea id="tinymce_debug" style="width: 100%; height: 300px" wrap="nowrap" mce_editable="false"></textarea>';
+
+		document.body.appendChild(d);
+		e = document.getElementById("tinymce_debug");
+	}
+
+	a = this.debug.arguments;
+	for (i=0; i<a.length; i++) {
+		m += a[i];
+		if (i<a.length-1)
+			m += ', ';
+	}
+
+	e.value += m + "\n";
+};
diff -ruN 6171/e107_handlers/tiny_mce/utils/editable_selects.js 75/e107_handlers/tiny_mce/utils/editable_selects.js
--- 6171/e107_handlers/tiny_mce/utils/editable_selects.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/utils/editable_selects.js	2006-05-05 22:05:16.000000000 -0500
@@ -0,0 +1,63 @@
+/**
+ * $RCSfile: editable_selects.js,v $
+ * $Revision: 1.1 $
+ * $Date: 2006/05/06 03:05:16 $
+ *
+ * Makes select boxes editable.
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+var TinyMCE_EditableSelects = {
+	editSelectElm : null,
+
+	init : function() {
+		var nl = document.getElementsByTagName("select"), i, d = document, o;
+
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].className.indexOf('mceEditableSelect') != -1) {
+				o = new Option('(value)', '__mce_add_custom__');
+
+				o.className = 'mceAddSelectValue';
+
+				nl[i].options[nl[i].options.length] = o;
+				nl[i].setAttribute('onchange', 'TinyMCE_EditableSelects.onChangeEditableSelect(this);');
+			}
+		}
+	},
+
+	onChangeEditableSelect : function(se) {
+		var d = document, ne;
+
+		if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
+			ne = d.createElement("input");
+			ne.id = se.id + "_custom";
+			ne.name = se.name + "_custom";
+			ne.type = "text";
+
+			ne.style.width = se.clientWidth;
+			se.parentNode.insertBefore(ne, se);
+			se.style.display = 'none';
+			ne.focus();
+			ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
+			TinyMCE_EditableSelects.editSelectElm = se;
+		}
+	},
+
+	onBlurEditableSelectInput : function() {
+		var se = TinyMCE_EditableSelects.editSelectElm;
+
+		if (se) {
+			if (se.previousSibling.value != '') {
+				addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
+				selectByValue(document.forms[0], se.id, se.previousSibling.value);
+			} else
+				selectByValue(document.forms[0], se.id, '');
+
+			se.style.display = 'inline';
+			se.parentNode.removeChild(se.previousSibling);
+			TinyMCE_EditableSelects.editSelectElm = null;
+		}
+	}
+};
diff -ruN 6171/e107_handlers/tiny_mce/utils/form_utils.js 75/e107_handlers/tiny_mce/utils/form_utils.js
--- 6171/e107_handlers/tiny_mce/utils/form_utils.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/utils/form_utils.js	2006-05-05 22:05:16.000000000 -0500
@@ -0,0 +1,210 @@
+/**
+ * $RCSfile: form_utils.js,v $
+ * $Revision: 1.5 $
+ * $Date: 2006/05/06 03:05:16 $
+ *
+ * Various form utilitiy functions.
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function getColorPickerHTML(id, target_form_element) {
+	var html = "";
+
+	html += '<a id="' + id + '_link" href="javascript:void(0);" onkeydown="pickColor(event,\'' + target_form_element +'\');" onmousedown="pickColor(event,\'' + target_form_element +'\');return false;">';
+	html += '<img id="' + id + '" src="../../themes/' + tinyMCE.getParam("theme") + '/images/color.gif"';
+	html += ' onmouseover="this.className=\'mceButtonOver\'"';
+	html += ' onmouseout="this.className=\'mceButtonNormal\'"';
+	html += ' onmousedown="this.className=\'mceButtonDown\'"';
+	html += ' width="20" height="16" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
+	html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
+
+	return html;
+}
+
+function pickColor(e, target_form_element) {
+	if ((e.keyCode == 32 || e.keyCode == 13) || e.type == "mousedown")
+		tinyMCEPopup.pickColor(e, target_form_element);
+}
+
+function updateColor(img_id, form_element_id) {
+	document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
+}
+
+function setBrowserDisabled(id, state) {
+	var img = document.getElementById(id);
+	var lnk = document.getElementById(id + "_link");
+
+	if (lnk) {
+		if (state) {
+			lnk.setAttribute("realhref", lnk.getAttribute("href"));
+			lnk.removeAttribute("href");
+			tinyMCE.switchClass(img, 'mceButtonDisabled', true);
+		} else {
+			lnk.setAttribute("href", lnk.getAttribute("realhref"));
+			tinyMCE.switchClass(img, 'mceButtonNormal', false);
+		}
+	}
+}
+
+function getBrowserHTML(id, target_form_element, type, prefix) {
+	var option = prefix + "_" + type + "_browser_callback";
+	var cb = tinyMCE.getParam(option, tinyMCE.getParam("file_browser_callback"));
+	if (cb == null)
+		return "";
+
+	var html = "";
+
+	html += '<a id="' + id + '_link" href="javascript:openBrower(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;">';
+	html += '<img id="' + id + '" src="../../themes/' + tinyMCE.getParam("theme") + '/images/browse.gif"';
+	html += ' onmouseover="this.className=\'mceButtonOver\';"';
+	html += ' onmouseout="this.className=\'mceButtonNormal\';"';
+	html += ' onmousedown="this.className=\'mceButtonDown\';"';
+	html += ' width="20" height="18" border="0" title="' + tinyMCE.getLang('lang_browse') + '"';
+	html += ' class="mceButtonNormal" alt="' + tinyMCE.getLang('lang_browse') + '" /></a>';
+
+	return html;
+}
+
+function openBrower(img_id, target_form_element, type, option) {
+	var img = document.getElementById(img_id);
+
+	if (img.className != "mceButtonDisabled")
+		tinyMCEPopup.openBrowser(target_form_element, type, option);
+}
+
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
+	if (!form_obj || !form_obj.elements[field_name])
+		return;
+
+	var sel = form_obj.elements[field_name];
+
+	var found = false;
+	for (var i=0; i<sel.options.length; i++) {
+		var option = sel.options[i];
+
+		if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
+			option.selected = true;
+			found = true;
+		} else
+			option.selected = false;
+	}
+
+	if (!found && add_custom && value != '') {
+		var option = new Option(value, value);
+		option.selected = true;
+		sel.options[sel.options.length] = option;
+		sel.selectedIndex = sel.options.length - 1;
+	}
+
+	return found;
+}
+
+function getSelectValue(form_obj, field_name) {
+	var elm = form_obj.elements[field_name];
+
+	if (elm == null || elm.options == null)
+		return "";
+
+	return elm.options[elm.selectedIndex].value;
+}
+
+function addSelectValue(form_obj, field_name, name, value) {
+	var s = form_obj.elements[field_name];
+	var o = new Option(name, value);
+	s.options[s.options.length] = o;
+}
+
+function addClassesToList(list_id, specific_option) {
+	// Setup class droplist
+	var styleSelectElm = document.getElementById(list_id);
+	var styles = tinyMCE.getParam('theme_advanced_styles', false);
+	styles = tinyMCE.getParam(specific_option, styles);
+
+	if (styles) {
+		var stylesAr = styles.split(';');
+
+		for (var i=0; i<stylesAr.length; i++) {
+			if (stylesAr != "") {
+				var key, value;
+
+				key = stylesAr[i].split('=')[0];
+				value = stylesAr[i].split('=')[1];
+
+				styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
+			}
+		}
+	} else {
+		// Use auto impored classes
+		var csses = tinyMCE.getCSSClasses(tinyMCE.getWindowArg('editor_id'));
+		for (var i=0; i<csses.length; i++)
+			styleSelectElm.options[styleSelectElm.length] = new Option(csses[i], csses[i]);
+	}
+}
+
+function isVisible(element_id) {
+	var elm = document.getElementById(element_id);
+
+	return elm && elm.style.display != "none";
+}
+
+function convertRGBToHex(col) {
+	var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+	var rgb = col.replace(re, "$1,$2,$3").split(',');
+	if (rgb.length == 3) {
+		r = parseInt(rgb[0]).toString(16);
+		g = parseInt(rgb[1]).toString(16);
+		b = parseInt(rgb[2]).toString(16);
+
+		r = r.length == 1 ? '0' + r : r;
+		g = g.length == 1 ? '0' + g : g;
+		b = b.length == 1 ? '0' + b : b;
+
+		return "#" + r + g + b;
+	}
+
+	return col;
+}
+
+function convertHexToRGB(col) {
+	if (col.indexOf('#') != -1) {
+		col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+		r = parseInt(col.substring(0, 2), 16);
+		g = parseInt(col.substring(2, 4), 16);
+		b = parseInt(col.substring(4, 6), 16);
+
+		return "rgb(" + r + "," + g + "," + b + ")";
+	}
+
+	return col;
+}
+
+function trimSize(size) {
+	return size.replace(new RegExp('[^0-9%]', 'gi'), '');
+}
+
+function getCSSSize(size) {
+	size = trimSize(size);
+
+	if (size == "")
+		return "";
+
+	return size.indexOf('%') != -1 ? size : size + "px";
+}
+
+function getStyle(elm, attrib, style) {
+	var val = tinyMCE.getAttrib(elm, attrib);
+
+	if (val != '')
+		return '' + val;
+
+	if (typeof(style) == 'undefined')
+		style = attrib;
+
+	val = eval('elm.style.' + style);
+
+	return val == null ? '' : '' + val;
+}
diff -ruN 6171/e107_handlers/tiny_mce/utils/mclayer.js 75/e107_handlers/tiny_mce/utils/mclayer.js
--- 6171/e107_handlers/tiny_mce/utils/mclayer.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/utils/mclayer.js	2006-05-05 22:05:16.000000000 -0500
@@ -0,0 +1,212 @@
+/**
+ * $RCSfile: mclayer.js,v $
+ * $Revision: 1.3 $
+ * $Date: 2006/05/06 03:05:16 $
+ *
+ * Moxiecode floating layer script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCLayer(id) {
+	this.id = id;
+	this.settings = new Array();
+	this.blockerElement = null;
+	this.isMSIE = navigator.appName == "Microsoft Internet Explorer";
+	this.events = false;
+	this.autoHideCallback = null;
+}
+
+MCLayer.prototype = {
+	moveRelativeTo : function(re, p, a) {
+		var rep = this.getAbsPosition(re);
+		var w = parseInt(re.offsetWidth);
+		var h = parseInt(re.offsetHeight);
+		var x, y;
+
+		switch (p) {
+			case "tl":
+				break;
+
+			case "tr":
+				x = rep.absLeft + w;
+				y = rep.absTop;
+				break;
+
+			case "bl":
+				break;
+
+			case "br":
+				break;
+		}
+
+		this.moveTo(x, y);
+	},
+
+	moveBy : function(dx, dy) {
+		var e = this.getElement();
+		var x = parseInt(e.style.left);
+		var y = parseInt(e.style.top);
+
+		e.style.left = (x + dx) + "px";
+		e.style.top = (y + dy) + "px";
+
+		this.updateBlocker();
+	},
+
+	moveTo : function(x, y) {
+		var e = this.getElement();
+
+		e.style.left = x + "px";
+		e.style.top = y + "px";
+
+		this.updateBlocker();
+	},
+
+	show : function() {
+		MCLayer.visibleLayer = this;
+
+		this.getElement().style.display = 'block';
+		this.updateBlocker();
+	},
+
+	hide : function() {
+		this.getElement().style.display = 'none';
+		this.updateBlocker();
+	},
+
+	setAutoHide : function(s, cb) {
+		this.autoHideCallback = cb;
+		this.registerEventHandlers();
+	},
+
+	getElement : function() {
+		return document.getElementById(this.id);
+	},
+
+	updateBlocker : function() {
+		if (!this.isMSIE)
+			return;
+
+		var e = this.getElement();
+		var b = this.getBlocker();
+		var x = this.parseInt(e.style.left);
+		var y = this.parseInt(e.style.top);
+		var w = this.parseInt(e.offsetWidth);
+		var h = this.parseInt(e.offsetHeight);
+
+		b.style.left = x + 'px';
+		b.style.top = y + 'px';
+		b.style.width = w + 'px';
+		b.style.height = h + 'px';
+		b.style.display = e.style.display;
+	},
+
+	getBlocker : function() {
+		if (!this.blockerElement) {
+			var d = document, b = d.createElement("iframe");
+
+			b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0';
+			b.src = 'javascript:false;';
+			b.frameBorder = '0';
+			b.scrolling = 'no';
+
+			d.body.appendChild(b);
+			this.blockerElement = b;
+		}
+
+		return this.blockerElement;
+	},
+
+	getAbsPosition : function(n) {
+		var p = {absLeft : 0, absTop : 0};
+
+		while (n) {
+			p.absLeft += n.offsetLeft;
+			p.absTop += n.offsetTop;
+			n = n.offsetParent;
+		}
+
+		return p;
+	},
+
+	registerEventHandlers : function() {
+		if (!this.events) {
+			var d = document;
+
+			this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown);
+
+			this.events = true;
+		}
+	},
+
+	addEvent : function(o, n, h) {
+		if (o.attachEvent)
+			o.attachEvent("on" + n, h);
+		else
+			o.addEventListener(n, h, false);
+	},
+
+	onMouseDown : function(e) {
+		e = typeof(e) == "undefined" ? window.event : e;
+		var b = document.body;
+		var l = MCLayer.visibleLayer;
+
+		if (l) {
+			var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX;
+			var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY;
+			var el = l.getElement();
+			var x = parseInt(el.style.left);
+			var y = parseInt(el.style.top);
+			var w = parseInt(el.offsetWidth);
+			var h = parseInt(el.offsetHeight);
+
+			if (!(mx > x && mx < x + w && my > y && my < y + h)) {
+				MCLayer.visibleLayer = null;
+
+				if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))
+					return true;
+
+				l.hide();
+			}
+		}
+	},
+
+	addCSSClass : function(e, c) {
+		this.removeCSSClass(e, c);
+		var a = this.explode(' ', e.className);
+		a[a.length] = c;
+		e.className = a.join(' ');
+	},
+
+	removeCSSClass : function(e, c) {
+		var a = this.explode(' ', e.className), i;
+
+		for (i=0; i<a.length; i++) {
+			if (a[i] == c)
+				a[i] = '';
+		}
+
+		e.className = a.join(' ');
+	},
+
+	explode : function(d, s) {
+		var ar = s.split(d);
+		var oar = new Array();
+
+		for (var i = 0; i<ar.length; i++) {
+			if (ar[i] != "")
+				oar[oar.length] = ar[i];
+		}
+
+		return oar;
+	},
+
+	parseInt : function(s) {
+		if (s == null || s == '')
+			return 0;
+
+		return parseInt(s);
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_handlers/tiny_mce/utils/mctabs.js 75/e107_handlers/tiny_mce/utils/mctabs.js
--- 6171/e107_handlers/tiny_mce/utils/mctabs.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/utils/mctabs.js	2006-05-05 22:05:16.000000000 -0500
@@ -0,0 +1,76 @@
+/**
+ * $RCSfile: mctabs.js,v $
+ * $Revision: 1.5 $
+ * $Date: 2006/05/06 03:05:16 $
+ *
+ * Moxiecode DHTML Tabs script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCTabs() {
+	this.settings = new Array();
+};
+
+MCTabs.prototype.init = function(settings) {
+	this.settings = settings;
+};
+
+MCTabs.prototype.getParam = function(name, default_value) {
+	var value = null;
+
+	value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
+
+	// Fix bool values
+	if (value == "true" || value == "false")
+		return (value == "true");
+
+	return value;
+};
+
+MCTabs.prototype.displayTab = function(tab_id, panel_id) {
+	var panelElm = document.getElementById(panel_id);
+	var panelContainerElm = panelElm ? panelElm.parentNode : null;
+	var tabElm = document.getElementById(tab_id);
+	var tabContainerElm = tabElm ? tabElm.parentNode : null;
+	var selectionClass = this.getParam('selection_class', 'current');
+
+	if (tabElm && tabContainerElm) {
+		var nodes = tabContainerElm.childNodes;
+
+		// Hide all other tabs
+		for (var i=0; i<nodes.length; i++) {
+			if (nodes[i].nodeName == "LI")
+				nodes[i].className = '';
+		}
+
+		// Show selected tab
+		tabElm.className = 'current';
+	}
+
+	if (panelElm && panelContainerElm) {
+		var nodes = panelContainerElm.childNodes;
+
+		// Hide all other panels
+		for (var i=0; i<nodes.length; i++) {
+			if (nodes[i].nodeName == "DIV")
+				nodes[i].className = 'panel';
+		}
+
+		// Show selected panel
+		panelElm.className = 'current';
+	}
+};
+
+MCTabs.prototype.getAnchor = function() {
+	var pos, url = document.location.href;
+
+	if ((pos = url.lastIndexOf('#')) != -1)
+		return url.substring(pos + 1);
+
+	return "";
+};
+
+// Global instance
+var mcTabs = new MCTabs();
diff -ruN 6171/e107_handlers/tiny_mce/utils/validate.js 75/e107_handlers/tiny_mce/utils/validate.js
--- 6171/e107_handlers/tiny_mce/utils/validate.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/utils/validate.js	2006-05-05 22:05:16.000000000 -0500
@@ -0,0 +1,50 @@
+/**
+ * $RCSfile: validate.js,v $
+ * $Revision: 1.5 $
+ * $Date: 2006/05/06 03:05:16 $
+ *
+ * Various form validation methods.
+ *
+ * @author Moxiecode
+ * @copyright Copyright  2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function testRegExp(form_name, element_name, re) {
+	return new RegExp(re).test(document.forms[form_name].elements[element_name].value);
+}
+
+function validateString(form_name, element_name) {
+	return (document.forms[form_name].elements[element_name].value.length > 0);
+}
+
+function validateSelection(form_name, element_name) {
+	return (document.forms[form_name].elements[element_name].selectedIndex > 0);
+}
+
+function validateCheckBox(form_name, element_name) {
+	return document.forms[form_name].elements[element_name].checked;
+}
+
+function validateCleanString(form_name, element_name) {
+	return testRegExp(form_name, element_name, '^[A-Za-z0-9_]+$');
+}
+
+function validateEmail(form_name, element_name) {
+	return testRegExp(form_name, element_name, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
+}
+
+function validateAbsUrl(form_name, element_name) {
+	return testRegExp(form_name, element_name, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+$');
+}
+
+function validateNumber(form_name, element_name, allow_blank) {
+	return (!allow_blank && value == '') ? false : testRegExp(form_name, element_name, '^-?[0-9]*\\.?[0-9]*$');
+}
+
+function validateSize(form_name, element_name,) {
+	return testRegExp(form_name, element_name, '^[0-9]+(px|%)?$');
+}
+
+function validateID(form_name, element_name,) {
+	return testRegExp(form_name, element_name, '^[A-Za-z_]([A-Za-z0-9_])*$');
+}
diff -ruN 6171/e107_handlers/tiny_mce/wysiwyg.php 75/e107_handlers/tiny_mce/wysiwyg.php
--- 6171/e107_handlers/tiny_mce/wysiwyg.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/tiny_mce/wysiwyg.php	2006-04-30 18:06:43.000000000 -0500
@@ -0,0 +1,139 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Tiny MCE controller file.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/tiny_mce/wysiwyg.php,v $
+|     $Revision: 1.24 $
+|     $Date: 2006/04/30 23:06:43 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+function wysiwyg($formids){
+define("ADMIN","");
+global $pref,$HANDLERS_DIRECTORY;
+$lang = e_LANGUAGE;
+$tinylang = array(
+	"Arabic" => "ar",
+	"Danish" => "da",
+	"Dutch" => "nl",
+	"English" => "en",
+	"Farsi" => "fa",
+	"French" => "fr",
+	"Greek" => "el",
+	"Hebrew" => " ",
+	"Hungarian" => "hu",
+	"Italian" => "it",
+	"Japanese" => "ja",
+	"Korean" => "ko",
+	"Norwegian" => "nb",
+	"Polish" => "pl",
+	"Russian" => "ru",
+	"Slovak" => "sk",
+	"Spanish" => "es",
+	"Swedish" => "sv"
+);
+
+if(!$tinylang[$lang]){
+ $tinylang[$lang] = "en";
+}
+
+$thescript = (strpos($_SERVER['SERVER_SOFTWARE'],"mod_gzip")) ? "tiny_mce_gzip.php" : "tiny_mce.js";
+
+$text = "<script type='text/javascript' src='".e_HANDLER."tiny_mce/".$thescript."'></script>\n";
+
+$text .= "<script type='text/javascript'>\n	tinyMCE.init({\n";
+
+$text .= "language : '".$tinylang[$lang]."',\n";
+$text .= "mode : 'exact',\n";
+$text .= "elements : '".$formids."',\n";
+$text .= "theme : 'advanced'\n";
+$text .= ",plugins : 'table,contextmenu";
+
+$text .= ($pref['smiley_activate']) ? ",emoticons" : "";
+$text .= (ADMIN) ? ",ibrowser" : ",image";
+$text .= ",iespell,zoom,flash,forecolor";
+$text .= "'\n"; // end of plugins list.
+
+$text .= ",theme_advanced_buttons1 : 'fontsizeselect,separator,bold,italic,underline,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,outdent, indent,separator, forecolor,cut,copy,paste'";
+
+$text .= ",theme_advanced_buttons2   : 'tablecontrols,separator,undo,redo,separator,link,unlink";
+$text .= ($pref['smiley_activate']) ? ",emoticons" : "";
+$text .= ",charmap,iespell,flash";
+$text .= (ADMIN) ? ",ibrowser," : ",image";
+$text .= (ADMIN) ? ",code" : "";
+$text .= "'"; // end of buttons 2
+
+$text .= ",theme_advanced_buttons3 : ''";
+$text .= ",theme_advanced_toolbar_location : 'top'";
+$text .= ",extended_valid_elements : 'p[style],a[name|href|target|rel|title|style],img[class|src|style|alt|title|name],hr[class],span[class|style],div[class|style],table[class|style|cellpadding|cellspacing]'";
+$text .= ",invalid_elements: 'p,font,align,script,applet,iframe'\n";
+// $text .= ",auto_cleanup_word: true\n";
+$text .= ",convert_fonts_to_spans : true\n";
+$text .= ",trim_span_elements: true\n";
+$text .= ",inline_styles: true\n";
+$text .= ",debug: false\n";
+$text .= ",force_br_newlines: true\n";
+$text .= ",force_p_newlines: false\n";
+$text .= ",entity_encoding: \"raw\" \n";
+$text .= ",convert_fonts_to_styles: true\n";
+$text .= ",remove_script_host : true\n";
+$text .= ",relative_urls: false\n";
+$text .= ",document_base_url: '".SITEURL."'\n";
+$text .= ",theme_advanced_styles: 'border=border;fborder=fborder;tbox=tbox;caption=caption;fcaption=fcaption;forumheader=forumheader;forumheader3=forumheader3'\n";
+$text .= ",popup_css: '".THEME."style.css'\n";
+$text .= ",verify_css_classes : false\n";
+$text .= ",cleanup_callback : \"tinymce_html_bbcode_control\" \n";
+$text .= (ADMIN) ? "\n, external_link_list_url: '../".$HANDLERS_DIRECTORY."tiny_mce/filelist.php'\n" : "";
+
+$text .= "
+
+	});
+
+function tinymce_html_bbcode_control(type, value) {
+
+	switch (type) {
+
+		case 'get_from_editor':
+
+			value = value.replace(/target=\"_blank\"/, 'rel=\"external\"');
+			value = value.replace(/^\s*|\s*$/g,'');
+			if(value != '')
+			{
+				value = '[html]\\n' + value + '\\n[/html]';
+			}
+
+			break;
+
+		case 'insert_to_editor':
+
+			value = value.replace(/rel=\"external\"/, 'target=\"_blank\"');
+
+			html_bbcode_check = value.slice(0,6);
+
+			if (html_bbcode_check == '[html]') {
+				value = value.slice(6);
+			}
+
+			html_bbcode_check = value.slice(-7);
+
+			if (html_bbcode_check == '[/html]') {
+				value = value.slice(0, -7);
+			}
+
+			break;
+	}
+
+	return value;
+}
+
+</script>\n
+";
+
+return $text;
+
+}
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/traffic_class_display.php 75/e107_handlers/traffic_class_display.php
--- 6171/e107_handlers/traffic_class_display.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/traffic_class_display.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,121 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/traffic_class_display.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+//
+// This is the content-code for e107_traffic::Display()
+// It is separated out to avoid parsing when not in debug mode
+//
+// See traffic_class.php
+//
+
+        if (count($this->aTraffic)) { // Simple counts
+            $text .= "\n<table class='fborder'>\n";
+            $text .= "<tr><td class='fcaption' style='width:15%'>Item</td>
+                    <td class='fcaption' style='text-align:right;width:15%'>Count&nbsp;</td>
+                    <td class='fcaption'>&nbsp;</td>
+                    </tr>\n";
+            foreach ($this->aTraffic as $key=>$aVals) {
+                $text .= "<tr>
+                        <td class='forumheader3'>".
+                    $key."</td>
+                        <td class='forumheader3' style='text-align:right;width:20%'>".
+                    $aVals['Count']."&nbsp;</td><td class='forumheader3'>&nbsp;</td></tr>\n";
+                    
+                if (isset($this->aTrafficWho[$key])) {
+                    $text .= "<tr><td class='forumheader3' valign='top'>Callers:</td>
+                            <td class='forumheader3' colspan='2'>";
+                    $bFirst=TRUE;
+                    foreach ($this->aTrafficWho[$key] as $sWho) {
+                        if ($bFirst ) {
+                            $bFirst = FALSE;
+                        } else {
+                            $text .= "<br />\n";
+                        }
+                        $text .= $sWho;
+                    }
+                    $text .= "</td></tr>\n";
+                }
+                        
+            }
+            $text .="</table><br />\n";
+        }
+        //
+        // Fancy timed counts
+        //
+        if (count($this->aTrafficTimed)) {
+            $text .= "\n<table class='fborder'>\n";
+            $text .= "<tr><td class='fcaption'>Item</td><td class='fcaption'>Count&nbsp;</td>
+                    <td class='fcaption'>Tot Time (ms)&nbsp;</td>
+                    <td class='fcaption'>Avg Time (us)&nbsp;</td>
+                    <td class='fcaption'>Min Time (us)&nbsp;</td>
+                    <td class='fcaption'>Max Time (us)&nbsp;</td>
+                    </tr>\n";
+            foreach ($this->aTrafficTimed as $key=>$aVals) {
+                if (substr($key,0,8)=='TRAF_CAL') continue;
+                $text .= "<tr>
+                        <td class='forumheader3'>".
+                    $key."</td>
+                        <td class='forumheader3' style='text-align:right'>".
+                    $aVals['Count']."&nbsp;</td>";
+                if ($aVals['Count'] && isset($aVals['Time']) && $aVals['Time']) {
+                    $sTot = number_format($aVals['Time']*1000.0,4);
+                    $sAvg = number_format($aVals['Time']*1000000.0/$aVals['Count'],1);
+                    $sMin = number_format($aVals['Min']*1000000.0,1);
+                    $sMax = number_format($aVals['Max']*1000000.0,1);
+                } else {
+                    $sTot = $sAvg = $sMin = $sMax = '';
+                }
+                $text .= "<td class='forumheader3' style='text-align:right'>".
+                    $sTot."&nbsp;</td>
+                        <td class='forumheader3' style='text-align:right'>".
+                    $sAvg."&nbsp;</td>
+                        <td class='forumheader3' style='text-align:right'>".
+                    $sMin."&nbsp;</td>
+                        <td class='forumheader3' style='text-align:right'>".
+                    $sMax."&nbsp;</td>
+                    </tr>\n";
+                    
+                if (isset($this->aTrafficWho[$key])) {
+                    $text .= "<tr><td class='forumheader3' valign='top'>Callers:</td>
+                            <td class='forumheader3' colspan='5'>";
+                    $bFirst=TRUE;
+                    foreach ($this->aTrafficWho[$key] as $sWho) {
+                        if ($bFirst ) {
+                            $bFirst = FALSE;
+                        } else {
+                            $text .= "<br />\n";
+                        }
+                        $text .= $sWho;
+                    }
+                    $text .= "</td></tr>\n";
+                }
+                        
+            }
+            $cal1 = number_format($this->calPassOne*1000000.0,1);
+            $cal2 = number_format($this->calPassBoth*1000000.0,1);
+            $cTot = number_format($this->calTime*1000.0,4);
+
+            $text .="<tr><td class='forumheader3' colspan='6'>
+            <b>Note:</b> These times have been decreased by the calibration offset:<br/>
+            $cal2 usec per call(start,stop); $cal1 usec per call(start). Total adjustment: $cTot msec.</td></tr>\n";
+            $text .="</table><br />\n";
+        }
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/traffic_class.php 75/e107_handlers/traffic_class.php
--- 6171/e107_handlers/traffic_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/traffic_class.php	2005-12-28 14:44:18.000000000 -0600
@@ -0,0 +1,206 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/traffic_class.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/28 20:44:18 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e107_traffic {
+	var $aTraffic=array();      // Overall system traffic counters
+	var $aTrafficTimed=array(); // Timed traffic counters
+	var $aTrafficWho=array();   // Overall system traffic source tracking
+	var $calPassBoth=0.0;       // Calibration offset when both parameters are passed
+	var $calPassOne=0.0;        // Calibration offset when only one parameter is passed
+	var $calTime=0.0;           // Total time spent in overhead, based on calibration
+	var $qTimeOn=0;					// Quick Timer: when it started
+	var $qTimeTotal=0.0;			// Quick Timer: Accumulated time
+
+	//   function e107_traffic() {
+	// No dynamic initializers needed, so no constructor
+	//   }
+
+	/**
+	* @return float         Time difference
+	* @param time $tStart   Start time - unexploded microtime result
+	* @param time $tStop    Finish time - unexploded microtime result
+	* @desc Calculate time difference between to microtimes
+	* @access public
+	*/
+	function TimeDelta($tStart, $tFinish ) {
+		$tFrom = explode(' ', $tStart);
+		$tTo = explode(' ', $tFinish);
+		$tTot = ((float)$tTo[0] + (float)$tTo[1]) - ((float)$tFrom[0] + (float)$tFrom[1]);
+		return $tTot;
+	}
+
+	/**
+	* @return float         Absolute time from microtime
+	* @param time $tStart   time - unexploded microtime result
+	* @desc Return absolute time
+	* @access public
+	*/
+	function TimeAbs($tStart ) {
+		$tFrom = explode(' ', $tStart);
+		return (float)$tFrom[0] + (float)$tFrom[1];
+	}
+
+	/**
+	* @return void
+	* @param string $sWhat  what to count
+	* @param time $tStart Start time - unexploded microtime result
+	* @param time $tStop  Finish time - unexploded microtime result
+	* @desc Count one of anything, optionally with time used
+	* @access public
+	*/
+	function Bump($sWhat, $tStart = 0, $tFinish = 0) {
+		$x = microtime(); // on my system:
+		// 0        err: $e=microtime(); $eTraffic->Bump('foo',$b,$e);
+		// ~15 usec err: $eTraffic->Bump('foo',$b,microtime());
+		// ~25 usec err: $eTraffic->Bump('foo',$b);
+
+		if (!defined("E107_DBG_TRAFFIC")) {
+			return;
+		}
+
+		if ($tStart) {
+			$vName = 'aTrafficTimed';
+			$bTimed = TRUE;
+		} else {
+			$vName = 'aTraffic';
+			$bTimed = FALSE;
+		}
+		if (!isset($this->{$vName}[$sWhat])) {
+			$this->{$vName}[$sWhat] = array();
+			$t = & $this->{$vName}[$sWhat];
+			$t['Count'] = 0;
+			if ($bTimed) {
+				$t['Time'] = 0.0;
+				$t['Min'] = 999999999.0;
+				$t['Max'] = 0.0;
+			}
+		}
+
+		$this->{$vName}[$sWhat]['Count']++;
+
+		if ($bTimed) {
+			$t = & $this->aTrafficTimed[$sWhat];
+			if (!$tFinish) {
+				$tFinish = $x;
+				$offset = $this->calPassOne;
+			} else {
+				$offset = $this->calPassBoth;
+			}
+			$time = $this->TimeDelta($tStart, $tFinish ) - $offset;
+			$this->calTime += $offset;
+			$t['Time'] += $time;
+			if ($time < $t['Min']) $t['Min'] = $time;
+			if ($time > $t['Max']) $t['Max'] = $time;
+		}
+	}
+
+	/**
+	* @return void
+	* @param string $sWhat  what to count
+	* @param int  $level  who to record: default caller. 1-999=N levels up the call tree
+	* @param time $tStart Start time - unexploded microtime result
+	* @param time $tStop  Finish time - unexploded microtime result
+	* @desc Count one of anything, optionally with time used.
+	* @access public
+	*/
+	function BumpWho($sWhat, $level = 0, $tStart = 0, $tFinish = 0) {
+		$x = microtime();
+		if (!defined("E107_DBG_TRAFFIC")) {
+			return;
+		}
+
+		$this->Bump($sWhat, $tStart, ($tFinish? $tFinish : $x));
+
+		if (!isset($this->aTrafficWho[$sWhat])) {
+			$this->aTrafficWho[$sWhat] = array();
+		}
+		$aTrace = debug_backtrace();
+		if ($level >= count($aTrace)) {
+			$level = count($aTrace)-1;
+		}
+		$sFile = $aTrace[$level]['file'];
+		$sLine = $aTrace[$level]['line'];
+
+		$this->aTrafficWho[$sWhat][] = "$sFile($sLine)";
+	}
+
+	function Calibrate($tObject, $count = 10 ) {
+		if (!defined("E107_DBG_TRAFFIC")) {
+			return;
+		}
+		if ($tObject != $this) {
+			message_handler("CRITICAL_ERROR", "Bad traffic object", __LINE__-2, __FILE__);
+		}
+		if ($count <= 0) return;    // no calibration
+
+		$this->calPassBoth = $this->calPassOne = 0.0;
+
+		for ($i = 0; $i < $count; $i++) {
+			$b = microtime();
+			$e = microtime();
+			$tObject->Bump('TRAF_CAL1', $b, $e); // emulate the normal non-insider call
+			$b = microtime();
+			$tObject->Bump('TRAF_CAL2', $b);
+		}
+		$t = $tObject->aTrafficTimed['TRAF_CAL1'];
+		$this->calPassBoth = $t['Time']/$t['Count'];
+		$t = $tObject->aTrafficTimed['TRAF_CAL2'];
+		$this->calPassOne = $t['Time']/$t['Count'];
+	}
+
+	function Display() {
+		if (!E107_DBG_TRAFFIC) return '';
+
+		$text = '';
+		@include_once(e_HANDLER.'traffic_class_display.php');
+		return $text;
+	}
+}
+
+
+//
+// This is a set of quick-n-simple tools to measure ONE bit of render time,
+// without any need for debug to be working. You can copy to somewhere else if needed
+// such as before this class has been loaded
+
+if (!isset($qTimeOn)) {
+	$qTimeOn=0;
+	$qTimeTotal=0;
+	function eQTimeOn() {
+		$GLOBALS['qTimeOn']=explode(' ',microtime());
+	}
+	function eQTimeOff() {
+		$e=explode(' ',microtime());
+		$diff=((float)$e[0] + (float)$e[1]) - ((float)$qTimeOn[0] + (float)$qTimeOn[1]);
+		$GLOBALS['qTimeTotal'] += $diff;
+	}
+	function eQTimeElapsed() {
+		// return elapsed time so far, as text in microseconds, or blank if zero
+		if ($GLOBALS['qTimeTotal']) {
+			return number_format($GLOBALS['qTimeTotal']*1000000.0,1);
+		} else {
+			return '';
+		}
+	}
+
+}
+
+?>
diff -ruN 6171/e107_handlers/upload_handler.php 75/e107_handlers/upload_handler.php
--- 6171/e107_handlers/upload_handler.php	2005-05-12 22:59:10.000000000 -0500
+++ 75/e107_handlers/upload_handler.php	2005-12-28 08:03:36.000000000 -0600
@@ -1,145 +1,202 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /classes/upload_class.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|   $Source: /cvsroot/e107/e107/e107_handlers/upload_handler.php,v $
-|   $Revision: 1.5 $
-|   $Date: 2004/08/20 01:00:57 $
-|   $Author: mcfly_e107 $
-+---------------------------------------------------------------+
-*/
-
-@include(e_LANGUAGEDIR.e_LANGUAGE."/lan_upload_handler.php");
-@include(e_LANGUAGEDIR."English/lan_upload_handler.php");
-
-function file_upload($uploaddir, $avatar = FALSE)
-{
-
-	if(!$uploaddir) $uploaddir=e_FILE."public/";
-	global $pref, $sql;
-
-	$allowed_filetypes = ($pref['upload_allowedfiletype'] ? explode("\n", $pref['upload_allowedfiletype']) : array(".zip", ".gz", ".jpg", ".png", ".gif", ".txt"));
-
-	$a=0;
-	foreach($allowed_filetypes as $v) {
-		$allowed_filetypes[$a] = trim(chop($v));
-		$a++;
-	}
-
-	if($pref['upload_storagetype'] == "2" && $avatar == FALSE){
-		for($c=0; $c<=1; $c++){
-			if($_FILES['file_userfile']['tmp_name'][$c]){
-				$fileext1 = substr(strrchr($_FILES['file_userfile']['name'][$c], "."), 1);
-				$fileext2 = substr(strrchr($_FILES['file_userfile']['name'][$c], "."), 0); // in case user has left off the . in allowed_filetypes
-				if(!in_array($fileext1, $allowed_filetypes) && !in_array(strtolower($fileext1), $allowed_filetypes) && !in_array(strtolower($_FILES['file_userfile']['type'][$c]), $allowed_filetypes)){
-					if(!in_array($fileext2, $allowed_filetypes) && !in_array(strtolower($fileext2), $allowed_filetypes) && !in_array(strtolower($_FILES['file_userfile']['type'][$c]), $allowed_filetypes)){
-						require_once(e_HANDLER."message_handler.php");
-						message_handler("MESSAGE", "".LANUPLOAD_1." '".$_FILES['file_userfile']['type'][$c]."' ".LANUPLOAD_2."");
-						return FALSE;
-						require_once(FOOTERF);
-						exit;
-					}
-				}
-				set_magic_quotes_runtime(0);
-				$data = mysql_escape_string(fread(fopen($_FILES['file_userfile']['tmp_name'][$c], "rb"), filesize($_FILES['file_userfile']['tmp_name'][$c])));
-				set_magic_quotes_runtime(get_magic_quotes_gpc());
-				$file_name = ereg_replace("[^a-z0-9._]", "", str_replace(" ", "_", str_replace("%20", "_", strtolower($_FILES['file_userfile']['name'][$c]))));
-				$sql -> db_Insert("rbinary", "0, '$file_name', '".$_FILES['file_userfile']['type'][$c]."', '$data' ");
-				$uploaded[$c]['name'] = "Binary ".mysql_insert_id()."/".$file_name;
-				$uploaded[$c]['type'] = $_FILES['file_userfile']['type'][$c];
-				$uploaded[$c]['size'] = $_FILES['file_userfile']['size'][$c];
-			}
-		}
-		return $uploaded;
-	}
-	/*
-	if(ini_get('open_basedir') != ''){
-	require_once(e_HANDLER."message_handler.php");
-	message_handler("MESSAGE", "'open_basedir' restriction is in effect, unable to move uploaded file, deleting ...", __LINE__, __FILE__);
-	return FALSE;
-	}
-	*/
-
-	$files = $_FILES['file_userfile'];
-	if(!is_array($files)){ return FALSE; }
-	$c=0;
-	foreach($files['name'] as $key => $name){
-
-		if($files['size'][$key]){
-			$filesize[] = $files['size'][$key];
-			$name = ereg_replace("[^a-z0-9._]", "", str_replace(" ", "_", str_replace("%20", "_", strtolower($name))));
-			if($avatar == "attachment"){$name = USERID."_".$name;}
-			$destination_file  = getcwd()."/".$uploaddir."/".$name;
-			if(file_exists($destination_file))
-			{
-				require_once(e_HANDLER."message_handler.php");
-				message_handler("MESSAGE", "".LANUPLOAD_10, __LINE__, __FILE__);
-				return FALSE;
-				require_once(FOOTERF);
-				exit;
-			}
-			$uploadfile = $files['tmp_name'][$key];
-			$fileext1 = substr(strrchr($files['name'][$key], "."), 1);
-			$fileext2 = substr(strrchr($files['name'][$key], "."), 0);
-			if(!in_array($fileext1, $allowed_filetypes) && !in_array(strtolower($fileext1), $allowed_filetypes) && !in_array(strtolower($files['type'][$c]), $allowed_filetypes)){
-				if(!in_array($fileext2, $allowed_filetypes) && !in_array(strtolower($fileext2), $allowed_filetypes) && !in_array(strtolower($files['type'][$c]), $allowed_filetypes)){
-					require_once(e_HANDLER."message_handler.php");
-					message_handler("MESSAGE", "".LANUPLOAD_1." ".$files['type'][$key]." ".LANUPLOAD_2.".", __LINE__, __FILE__);
-					return FALSE;
-					require_once(FOOTERF);
-					exit;
-				}
-			}
-
-			$uploaded[$c]['name'] = $name;
-			$uploaded[$c]['type'] = $files['type'][$key];
-			$uploaded[$c]['size'] = $files['size'][$key];
-
-			$method = (OPEN_BASEDIR == FALSE ? "copy" : "move_uploaded_file");
-
-			if(@$method($uploadfile, $destination_file)){
-				@chmod($destination_file, 0644);
-				$fext  = array_pop(explode('.', $name));
-				$fname = basename($name, '.'.$fext);
-				$tmp = pathinfo($name);
-				$rename = substr($fname, 0, 15).".".time().".".$fext;
-				if(@rename(e_FILE."public/avatars/".$name, e_FILE."public/avatars/".$rename)){
-					$uploaded[$c]['name'] = $rename;
-				}
-
-				if($method == "copy"){
-					@unlink($uploadfile);
-				}
-
-				require_once(e_HANDLER."message_handler.php");
-				message_handler("MESSAGE", "".LANUPLOAD_3." '".$files['name'][$key]."'", __LINE__, __FILE__);
-				$message .= "".LANUPLOAD_3." '".$files['name'][$key]."'.<br />";
-				$uploaded[$c]['size'] = $files['size'][$key];
-			}else{
-			switch ($files['error'][$key]){
-				case 0: $error = LANUPLOAD_4; break;
-				case 1: $error = LANUPLOAD_5; break;
-				case 2: $error = LANUPLOAD_6; break;
-				case 3: $error = LANUPLOAD_7; break;
-				case 4: $error = LANUPLOAD_8; break;
-				case 5: $error = LANUPLOAD_9; break;
-			}
-			require_once(e_HANDLER."message_handler.php");
-			message_handler("MESSAGE", LANUPLOAD_11." '".$files['name'][$key]."' - ".LANUPLOAD_12.":".$error, __LINE__, __FILE__);
-			return FALSE;
-		}
-	}
-	$c++;
-}
-return $uploaded;
-}
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        /classes/upload_class.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|   $Source: /cvsroot/e107/e107_0.7/e107_handlers/upload_handler.php,v $
+|   $Revision: 1.20 $
+|   $Date: 2005/12/28 14:03:36 $
+|   $Author: sweetas $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_upload_handler.php");
+@include_once(e_LANGUAGEDIR."English/lan_upload_handler.php");
+function file_upload($uploaddir, $avatar = FALSE, $fileinfo = "")
+{
+
+	global $pref, $sql, $tp;
+
+	if (!$uploaddir) {$uploaddir = e_FILE."public/";}
+	if($uploaddir == e_THEME) {$pref['upload_storagetype'] = 1;}
+	
+	if (is_readable(e_ADMIN.'filetypes.php')) {
+		$a_filetypes = trim(file_get_contents(e_ADMIN.'filetypes.php'));
+		$a_filetypes = explode(',', $a_filetypes);
+		foreach ($a_filetypes as $ftype) {
+			$allowed_filetypes[] = '.'.trim(str_replace('.', '', $ftype));
+		}
+	}
+
+	if ($pref['upload_storagetype'] == "2" && $avatar == FALSE)
+	{
+		extract($_FILES);
+		for($c = 0; $c <= 1; $c++)
+		{
+			if ($file_userfile['tmp_name'][$c])
+			{
+				$fileext1 = substr(strrchr($file_userfile['name'][$c], "."), 1);
+				$fileext2 = substr(strrchr($file_userfile['name'][$c], "."), 0); // in case user has left off the . in allowed_filetypes
+				if (!in_array($fileext1, $allowed_filetypes) && !in_array(strtolower($fileext1), $allowed_filetypes) && !in_array(strtolower($file_userfile['type'][$c]), $allowed_filetypes))
+				{
+					if (!in_array($fileext2, $allowed_filetypes) && !in_array(strtolower($fileext2), $allowed_filetypes) && !in_array(strtolower($file_userfile['type'][$c]), $allowed_filetypes))
+					{
+						require_once(e_HANDLER."message_handler.php");
+						message_handler("MESSAGE", "".LANUPLOAD_1." '".$file_userfile['type'][$c]."' ".LANUPLOAD_2."");
+						return FALSE;
+						require_once(FOOTERF);
+						exit;
+					}
+				}
+				set_magic_quotes_runtime(0);
+				$data = mysql_escape_string(fread(fopen($file_userfile['tmp_name'][$c], "rb"), filesize($file_userfile['tmp_name'][$c])));
+				set_magic_quotes_runtime(get_magic_quotes_gpc());
+				$file_name = preg_replace("/[^a-z0-9._]/", "", str_replace(" ", "_", str_replace("%20", "_", strtolower($file_userfile['name'][$c]))));
+				$sql->db_Insert("rbinary", "0, '".$tp -> toDB($file_name, true)."', '".$tp -> toDB($file_userfile['type'][$c], true)."', '$data' ");
+				$uploaded[$c]['name'] = "Binary ".mysql_insert_id()."/".$file_name;
+				$uploaded[$c]['type'] = $file_userfile['type'][$c];
+				$uploaded[$c]['size'] = $file_userfile['size'][$c];
+			}
+		}
+		return $uploaded;
+	}
+	/*
+	if (ini_get('open_basedir') != ''){
+	require_once(e_HANDLER."message_handler.php");
+	message_handler("MESSAGE", "'open_basedir' restriction is in effect, unable to move uploaded file, deleting ...", __LINE__, __FILE__);
+	return FALSE;
+	}
+	*/
+
+	//	echo "<pre>"; print_r($_FILES); echo "</pre>"; exit;
+
+	$files = $_FILES['file_userfile'];
+	if (!is_array($files))
+	{
+		return FALSE;
+	}
+
+	$c = 0;
+	foreach($files['name'] as $key => $name)
+	{
+
+		if ($files['size'][$key])
+		{
+			$filesize[] = $files['size'][$key];
+			$name = preg_replace("/[^a-z0-9._]/", "", str_replace(" ", "_", str_replace("%20", "_", strtolower($name))));
+			if ($avatar == "attachment") {
+				$name = time()."_".USERID."_".$fileinfo.$name;
+			}
+			
+			$destination_file = getcwd()."/".$uploaddir."/".$name;
+			if ($avatar == "unique" && file_exists($destination_file))
+			{
+				$name = time()."_".$name;
+				$destination_file = getcwd()."/".$uploaddir."/".$name;
+			}
+			if (file_exists($destination_file))
+			{
+				require_once(e_HANDLER."message_handler.php");
+				message_handler("MESSAGE", LANUPLOAD_10, __LINE__, __FILE__); // duplicate file
+				$f_message .= LANUPLOAD_10 . __LINE__ .  __FILE__;
+				$dupe_found = TRUE;
+			}
+			else
+			{
+				$uploadfile = $files['tmp_name'][$key];
+				$fileext1 = substr(strrchr($files['name'][$key], "."), 1);
+				$fileext2 = substr(strrchr($files['name'][$key], "."), 0);
+				if (!in_array($fileext1, $allowed_filetypes) && !in_array(strtolower($fileext1), $allowed_filetypes) && !in_array(strtolower($files['type'][$c]), $allowed_filetypes))
+				{
+					if (!in_array($fileext2, $allowed_filetypes) && !in_array(strtolower($fileext2), $allowed_filetypes) && !in_array(strtolower($files['type'][$c]), $allowed_filetypes))
+					{
+						require_once(e_HANDLER."message_handler.php");
+						message_handler("MESSAGE", LANUPLOAD_1." ".$files['type'][$key]." ".LANUPLOAD_2.".", __LINE__, __FILE__);
+						$f_message .= LANUPLOAD_1." ".$files['type'][$key]." ".LANUPLOAD_2."." . __LINE__ .  __FILE__;
+						return FALSE;
+						require_once(FOOTERF);
+						exit;
+					}
+				}
+
+				$uploaded[$c]['name'] = $name;
+				$uploaded[$c]['type'] = $files['type'][$key];
+				$uploaded[$c]['size'] = 0;
+
+				$method = (OPEN_BASEDIR == FALSE ? "copy" : "move_uploaded_file");
+
+				if (@$method($uploadfile, $destination_file))
+				{
+					@chmod($destination_file, 0644);
+					$_tmp = explode('.', $name);
+					$fext = array_pop($_tmp);
+					$fname = basename($name, '.'.$fext);
+					$tmp = pathinfo($name);
+					$rename = substr($fname, 0, 15).".".time().".".$fext;
+					if (@rename(e_FILE."public/avatars/".$name, e_FILE."public/avatars/".$rename))
+					{
+						$uploaded[$c]['name'] = $rename;
+					}
+
+					if ($method == "copy")
+					{
+						@unlink($uploadfile);
+					}
+
+					if(!$dupe_found)
+					{   // don't display 'success message' when duplicate file found.
+						require_once(e_HANDLER."message_handler.php");
+						message_handler("MESSAGE", "".LANUPLOAD_3." '".$files['name'][$key]."'", __LINE__, __FILE__);
+						$f_message .= "".LANUPLOAD_3." '".$files['name'][$key]."'.<br />";
+					}
+					$uploaded[$c]['size'] = $files['size'][$key];
+
+				}
+				else
+				{
+					$uploaded[$c]['error'] = $files['error'][$key];
+					switch ($files['error'][$key])
+					{
+						case 0:
+						$error = LANUPLOAD_4." [".str_replace("../", "", $uploaddir)."]";
+						break;
+						case 1:
+						$error = LANUPLOAD_5;
+						break;
+						case 2:
+						$error = LANUPLOAD_6;
+						break;
+						case 3:
+						$error = LANUPLOAD_7;
+						break;
+						case 4:
+						$error = LANUPLOAD_8;
+						break;
+						case 5:
+						$error = LANUPLOAD_9;
+						break;
+					}
+					require_once(e_HANDLER."message_handler.php");
+					message_handler("MESSAGE", LANUPLOAD_11." '".$files['name'][$key]."' <br />".LANUPLOAD_12.": ".$error, __LINE__, __FILE__);
+					$f_message .= LANUPLOAD_11." '".$files['name'][$key]."' <br />".LANUPLOAD_12.": ".$error . __LINE__ . __FILE__;
+
+				}
+			}
+		}
+		$c++;
+	}
+	define("F_MESSAGE", "<br />".$f_message);
+
+	return $uploaded;
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/userclass_class.php 75/e107_handlers/userclass_class.php
--- 6171/e107_handlers/userclass_class.php	2004-05-23 13:57:06.000000000 -0500
+++ 75/e107_handlers/userclass_class.php	2006-01-05 13:38:57.000000000 -0600
@@ -1,106 +1,319 @@
-<?php
-
-@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_userclass.php");
-@include_once(e_LANGUAGEDIR."English/lan_userclass.php");
-
-/*
-With $optlist you can now specify which classes are shown in the dropdown.
-All or none can be included, separated by comma (or whatever).
-Valid options are:
-public
-guest
-nobody
-member
-readonly
-admin
-classes - shows all classes
-matchclass - if 'classes' is set, this option will only show the classes that the user is a member of
-*/
-
-function r_userclass($fieldname, $curval=0, $mode="off",$optlist=""){
-	$sql = new db;
-	$text="<select class='tbox' name='{$fieldname}'>\n";
-	if(!$optlist || preg_match("#public#",$optlist)){
-		($curval==e_UC_PUBLIC) ? $s=" selected='selected'" : $s="";
-		$text.="<option  value='".e_UC_PUBLIC."' ".$s.">".UC_LAN_0."</option>\n";
-	}
-
-	if(!$optlist || preg_match("#guest#",$optlist)){
-		($curval==e_UC_GUEST) ? $s=" selected='selected'" : $s="";
-		$text.="<option  value='".e_UC_GUEST."' ".$s.">".UC_LAN_1."</option>\n";
-	}
-	if(!$optlist || preg_match("#nobody#",$optlist)){
-		($curval==e_UC_NOBODY) ? $s=" selected='selected'" : $s="";
-		$text.="<option value='".e_UC_NOBODY."' ".$s.">".UC_LAN_2."</option>\n";
-	}
-	if(!$optlist || preg_match("#member#",$optlist)){
-		($curval==e_UC_MEMBER) ? $s=" selected='selected'" : $s="";
-		$text.="<option value='".e_UC_MEMBER."' ".$s.">".UC_LAN_3."</option>\n";
-	}
-	if(!$optlist || preg_match("#classes#",$optlist)){
-		if($sql -> db_Select("userclass_classes")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				if(!preg_match("#matchclass#",$optlist) || getperms("0") || check_class($userclass_id)){
-					($userclass_id==$curval) ? $s=" selected='selected'" : $s="";
-					$text .= "<option value='$userclass_id' ".$s.">".$userclass_name ."</option>\n";
-				}
-			}
-		}
-	}
-	if($mode != "off" || preg_match("#readonly#",$optlist)){
-		($curval==e_UC_READONLY) ? $s=" selected='selected'" : $s="";
-		$text.="<option  value='".e_UC_READONLY."' ".$s.">".UC_LAN_4."</option>\n";
-	}
-	if($mode != "off" || preg_match("#admin#",$optlist)){
-		($curval==e_UC_ADMIN) ? $s=" selected='selected'" : $s="";
-		$text.="<option  value='".e_UC_ADMIN."' ".$s.">".UC_LAN_5."</option>\n";
-	}
-	$text.="</select>\n";
-	return $text;
-}
-
-function r_userclass_radio($fieldname,$curval=0){
-        $sql = new db;
-        ($curval==e_UC_PUBLIC) ? $c=" checked" : $c="";
-        $text="<input type='radio' name='{$fieldname}' value='".e_UC_PUBLIC."' ".$c." />".UC_LAN_0."<br />";
-        ($curval==e_UC_NOBODY) ? $c=" checked" : $c="";
-        $text.="<input type='radio' name='{$fieldname}' value='".e_UC_NOBODY."' ".$c." />".UC_LAN_2."<br />";
-        ($curval==e_UC_GUEST) ? $c=" checked" : $c="";
-        $text.="<input type='radio' name='{$fieldname}' value='".e_UC_GUEST."' ".$c." />".UC_LAN_1."<br />";
-        ($curval==e_UC_MEMBER) ? $c=" checked" : $c="";
-        $text.="<input type='radio' name='{$fieldname}' value='".e_UC_MEMBER."' ".$c." />".UC_LAN_3."<br />";
-        if($sql -> db_Select("userclass_classes")){
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        ($userclass_id==$curval) ? $c=" checked" : $c="";
-                        $text .= "<input type='radio' name='{$fieldname}' value='$userclass_id' ".$c." />".$userclass_name ."<br />";
-                }
-        }
-        return $text;
-}
-
-function r_userclass_name($id){
-        $sql = new db;
-        if($sql -> db_Select("userclass_classes", "userclass_name", "userclass_id=$id")){
-                extract($row = $sql -> db_Fetch());
-                return $userclass_name;
-        }else{
-                switch ($id){
-                        case e_UC_PUBLIC:
-                                return UC_LAN_0;
-                        case e_UC_GUEST:
-                                return UC_LAN_1;
-                        case e_UC_NOBODY:
-                                return UC_LAN_2;
-                        case e_UC_MEMBER:
-                                return UC_LAN_3;
-                        case e_UC_READONLY:
-                                return UC_LAN_4;
-                        case e_UC_ADMIN:
-                                return UC_LAN_5;
-                }
-        }
-
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/userclass_class.php,v $
+|     $Revision: 1.17 $
+|     $Date: 2006/01/05 19:38:57 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_userclass.php");
+@include_once(e_LANGUAGEDIR."English/lan_userclass.php");
+
+/*
+With $optlist you can now specify which classes are shown in the dropdown.
+All or none can be included, separated by comma (or whatever).
+Valid options are:
+public
+guest
+nobody
+member
+readonly
+admin
+classes - shows all classes
+matchclass - if 'classes' is set, this option will only show the classes that the user is a member of
+language - list of languages.
+
+*/
+
+function r_userclass($fieldname, $curval = 0, $mode = "off", $optlist = "") {
+	$sql = new db;
+	global $pref;
+
+	$text = "<select class='tbox' name='{$fieldname}'>\n";
+	if (!$optlist || strpos($optlist, "public") !== FALSE) {
+		($curval == e_UC_PUBLIC) ? $s = " selected='selected'" : $s = "";
+		$text .= "<option  value='".e_UC_PUBLIC."' ".$s.">".UC_LAN_0."</option>\n";
+	}
+
+	if (!$optlist || strpos($optlist, "guest") !== FALSE) {
+		($curval == e_UC_GUEST) ? $s = " selected='selected'" : $s = "";
+		$text .= "<option  value='".e_UC_GUEST."' ".$s.">".UC_LAN_1."</option>\n";
+	}
+	if (!$optlist || strpos($optlist, "nobody") !== FALSE) {
+		($curval == e_UC_NOBODY) ? $s = " selected='selected'" : $s = "";
+		$text .= "<option value='".e_UC_NOBODY."' ".$s.">".UC_LAN_2."</option>\n";
+	}
+	if (!$optlist || strpos($optlist, "member") !== FALSE) {
+		($curval == e_UC_MEMBER) ? $s = " selected='selected'" : $s = "";
+		$text .= "<option value='".e_UC_MEMBER."' ".$s.">".UC_LAN_3."</option>\n";
+	}
+	if ($mode != "off" || strpos($optlist, "admin") !== FALSE)
+	{
+		($curval == e_UC_ADMIN) ? $s = " selected='selected'" : $s = "";
+		$text .= "<option  value='".e_UC_ADMIN."' ".$s.">".UC_LAN_5."</option>\n";
+	}
+	if (!$optlist || strpos($optlist, "classes") !== FALSE)
+	{
+		$classList = get_userclass_list();
+		foreach($classList as $row)
+		{
+			extract($row);
+			if (strpos($optlist, "matchclass") === FALSE || getperms("0") || check_class($userclass_id))
+			{
+				($userclass_id == $curval) ? $s = " selected='selected'" :
+				 $s = "";
+				$text .= "<option value='$userclass_id' ".$s.">".$userclass_name ."</option>\n";
+			}
+		}
+	}
+	if (($mode != "off" && $mode != "admin") || strpos($optlist, "readonly") !== FALSE)
+	{
+		($curval == e_UC_READONLY) ? $s = " selected='selected'" :
+		 $s = "";
+		$text .= "<option  value='".e_UC_READONLY."' ".$s.">".UC_LAN_4."</option>\n";
+	}
+
+	if (strpos($optlist, "language") !== FALSE && $pref['multilanguage']) {
+			$text .= "<option value=''> ------ </option>\n";
+		$tmpl = explode(",",e_LANLIST);
+        foreach($tmpl as $lang){
+			$s = ($curval == $lang) ?  " selected='selected'" : "";
+        	$text .= "<option  value='$lang' ".$s.">".$lang."</option>\n";
+		}
+	}
+
+
+	$text .= "</select>\n";
+	return $text;
+}
+
+function r_userclass_radio($fieldname, $curval = '')
+{
+	$sql = new db;
+	($curval == e_UC_PUBLIC) ? $c = " checked" : $c = "";
+	$text = "<input type='radio' name='{$fieldname}' value='".e_UC_PUBLIC."' ".$c." />".UC_LAN_0."<br />";
+	($curval == e_UC_NOBODY) ? $c = " checked" : $c = "";
+	$text .= "<input type='radio' name='{$fieldname}' value='".e_UC_NOBODY."' ".$c." />".UC_LAN_2."<br />";
+	($curval == e_UC_GUEST) ? $c = " checked" : $c = "";
+	$text .= "<input type='radio' name='{$fieldname}' value='".e_UC_GUEST."' ".$c." />".UC_LAN_1."<br />";
+	($curval == e_UC_MEMBER) ? $c = " checked" : $c = "";
+	$text .= "<input type='radio' name='{$fieldname}' value='".e_UC_MEMBER."' ".$c." />".UC_LAN_3."<br />";
+	$classList = get_userclass_list();
+	foreach($classList as $row)
+	{
+		extract($row);
+		($row['userclass_id'] == $curval) ? $c = " checked" : $c = "";
+		$text .= "<input type='radio' name='{$fieldname}' value='{$row['userclass_id']}' ".$c." />{$row['userclass_name']}<br />";
+	}
+	return $text;
+}
+
+function r_userclass_check($fieldname, $curval = '', $optlist = "")
+{
+	global $pref;
+	$sql = new db;
+	$curArray = explode(",", $curval);
+	$ret = "";
+	$ret .= "<div class='tbox' style='margin-left:0px;margin-right:auto;width:60%;height:58px;overflow:auto'>";
+	if (!$optlist || strpos($optlist, "public") !== FALSE)
+	{
+		$c = (in_array(e_UC_PUBLIC, $curArray)) ? " checked='checked' " : "";
+		$ret .= "<label><input type='checkbox' name='{$fieldname}[".e_UC_PUBLIC."]' value='1' {$c} /> ".UC_LAN_0."</label><br />";
+	}
+
+	if (!$optlist || strpos($optlist, "guest") !== FALSE)
+	{
+		$c = (in_array(e_UC_GUEST, $curArray)) ? " checked='checked' " : "";
+		$ret .= "<label><input type='checkbox' name='{$fieldname}[".e_UC_GUEST."]' value='1' {$c} /> ".UC_LAN_1."</label><br />";
+	}
+
+	if (!$optlist || strpos($optlist, "nobody") !== FALSE)
+	{
+		$c = (in_array(e_UC_NOBODY, $curArray)) ? " checked='checked' " : "";
+		$ret .= "<label><input type='checkbox' name='{$fieldname}[".e_UC_NOBODY."]' value='1' {$c} /> ".UC_LAN_2."</label><br />";
+	}
+
+	if (!$optlist || strpos($optlist, "member") !== FALSE)
+	{
+		$c = (in_array(e_UC_MEMBER, $curArray)) ? " checked='checked' " : "";
+		$ret .= "<label><input type='checkbox' name='{$fieldname}[".e_UC_MEMBER."]' value='1' {$c} /> ".UC_LAN_3."</label><br />";
+	}
+
+	if (!$optlist || strpos($optlist, "admin") !== FALSE)
+	{
+		$c = (in_array(e_UC_ADMIN, $curArray)) ? " checked='checked' " : "";
+		$ret .= "<label><input type='checkbox' name='{$fieldname}[".e_UC_ADMIN."]' value='1' {$c} /> ".UC_LAN_5."</label><br />";
+	}
+
+	if (!$optlist || strpos($optlist, "readonly") !== FALSE)
+	{
+		$c = (in_array(e_UC_READONLY, $curArray)) ? " checked='checked' " : "";
+		$ret .= "<label><input type='checkbox' name='{$fieldname}[".e_UC_READONLY."]' value='1' {$c} /> ".UC_LAN_4."</label><br />";
+	}
+
+	if (!$optlist || strpos($optlist, "classes") !== FALSE)
+	{
+		$classList = get_userclass_list();
+		foreach($classList as $row)
+		{
+			if (strpos($optlist, "matchclass") === FALSE || getperms("0") || check_class($row['userclass_id'])) {
+				$c = (in_array($row['userclass_id'], $curArray)) ? " checked='checked' " : "";
+				$ret .= "<label><input type='checkbox' name='{$fieldname}[{$row['userclass_id']}]' value='1' {$c} /> {$row['userclass_name']}</label><br />";
+			}
+		}
+	}
+
+	if (strpos($optlist, "language") !== FALSE && $pref['multilanguage']) {
+			$ret .= "<hr />\n";
+		$tmpl = explode(",",e_LANLIST);
+        foreach($tmpl as $lang){
+				$c = (in_array($lang, $curArray)) ? " checked='checked' " : "";
+        		$ret .= "<label><input type='checkbox' name='{$fieldname}[{$lang}]'  value='1' {$c} /> {$lang}</label><br />";
+		}
+	}
+
+
+
+	$ret .= "</div>";
+	return $ret;
+}
+
+function get_userclass_list()
+{
+	global $sql;
+	if($classList = getcachedvars('uclass_list'))
+	{
+		return $classList;
+	}
+	else
+	{
+		$sql->db_Select('userclass_classes');
+		$classList = $sql->db_getList();
+		cachevars('uclass_list', $classList);
+		return $classList;
+	}
+}
+
+function r_userclass_name($id) {
+	$sql = new db;
+	$class_names = getcachedvars('userclass_names');
+	if(!is_array($class_names))
+	{
+		$class_names[e_UC_PUBLIC] = UC_LAN_0;
+		$class_names[e_UC_GUEST] = UC_LAN_1;
+		$class_names[e_UC_NOBODY] = UC_LAN_2;
+		$class_names[e_UC_MEMBER] = UC_LAN_3;
+		$class_names[e_UC_READONLY] = UC_LAN_4;
+		$class_names[e_UC_ADMIN] = UC_LAN_5;
+		if ($sql->db_Select("userclass_classes", "userclass_id, userclass_name"))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				$class_names[$row['userclass_id']] = $row['userclass_name'];
+			}
+		}
+		cachevars('userclass_names', $class_names);
+	}
+	return $class_names[$id];
+}
+
+class e_userclass {
+	function class_add($cid, $uinfoArray)
+	{
+		global $tp;
+		$sql2 = new db;
+		foreach($uinfoArray as $uid => $curclass)
+		{
+			if ($curclass)
+			{
+				$newarray = array_unique(array_merge(explode(',', $curclass), array($cid)));
+				$new_userclass = implode(',', $newarray);
+			}
+			else
+			{
+				$new_userclass = $cid;
+			}
+			$sql2->db_Update('user', "user_class='".$tp -> toDB($new_userclass, true)."' WHERE user_id=".intval($uid));
+		}
+	}
+
+	function class_remove($cid, $uinfoArray)
+	{
+		global $tp;
+		$sql2 = new db;
+		foreach($uinfoArray as $uid => $curclass)
+		{
+			$newarray = array_diff(explode(',', $curclass), array('', $cid));
+			if (count($newarray) > 1)
+			{
+				$new_userclass = implode(',', $newarray);
+			}
+			else
+			{
+				$new_userclass = $newarray[0];
+			}
+			$sql2->db_Update('user', "user_class='".$tp -> toDB($new_userclass, true)."' WHERE user_id=".intval($uid));
+		}
+	}
+
+	function class_create($ulist, $class_prefix = "NEW_CLASS_", $num = 0)
+	{
+		global $sql;
+		$varname = "uc_".$ulist;
+		if($ret = getcachedvars($varname))
+		{
+			return $ret;
+		}
+		$ul = explode(",", $ulist);
+		array_walk($ul, array($this, 'munge'));
+		$qry = "
+		SELECT user_id, user_class from #user AS u
+		WHERE user_name = ".implode(" OR user_name = ", $ul);
+		if($sql->db_Select_gen($qry))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				$idList[$row['user_id']] = $row['user_class'];
+
+			}
+			while($sql->db_Count("userclass_classes","(*)","WHERE userclass_name = '".strtoupper($class_prefix.$num)."'"))
+			{
+				$num++;
+			}
+			$newname = strtoupper($class_prefix.$num);
+			$i = 1;
+			while ($sql->db_Select('userclass_classes', '*', "userclass_id='".intval($i)."' ") && $i < 255)
+			{
+				$i++;
+			}
+			if ($i < 255)
+			{
+				$sql->db_Insert("userclass_classes", "{$i}, '{$newname}', 'Auto_created_class', 254");
+				$this->class_add($i, $idList);
+				cachevars($varname, $i);
+				return $i;
+			}
+		}
+
+	}
+
+	function munge(&$value, &$key)
+	{
+		$value = "'".trim($value)."'";
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/user_extended_class.php 75/e107_handlers/user_extended_class.php
--- 6171/e107_handlers/user_extended_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/user_extended_class.php	2006-03-11 15:08:26.000000000 -0600
@@ -0,0 +1,470 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/user_extended_class.php,v $
+|     $Revision: 1.37 $
+|     $Date: 2006/03/11 21:08:26 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/*
+
+User_extended rewrite for version 0.7
+
+this code uses two tables,
+user_extended
+user_extended_struct
+to store its data and structural information.
+
+*/
+
+if (is_readable(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_extended.php")) {
+	@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_extended.php");
+} else {
+	@include_once(e_LANGUAGEDIR."English/lan_user_extended.php");
+}
+
+class e107_user_extended
+{
+	var $user_extended_types;
+	var $extended_xml;
+	var $typeArray;
+
+	function e107_user_extended()
+	{
+		//		1 = text
+		//		2 = radio
+		//		3 = dropdown
+		//		4 = db field
+		//		5 = textarea
+		//		6 = integer
+		//		7 = date
+		//		8 = language
+
+		$this->typeArray = array(
+			'text' => 1,
+			'radio' => 2,
+			'dropdown' => 3,
+			'db field' => 4,
+			'textarea' => 5,
+			'integer' => 6,
+			'date' => 7,
+			'language' => 8
+		);
+		$this->user_extended_types = array(
+		1 => UE_LAN_1,
+		2 => UE_LAN_2,
+		3 => UE_LAN_3,
+		4 => UE_LAN_4,
+		5 => UE_LAN_5,
+		6 => UE_LAN_6,
+		7 => UE_LAN_7,
+		8 => UE_LAN_8
+		);
+	}
+
+	function user_extended_get_categories($byID = TRUE)
+	{
+		global $sql;
+		if($sql->db_Select("user_extended_struct", "*", "user_extended_struct_type = 0 ORDER BY user_extended_struct_order ASC"))
+		{
+
+			if($byID == TRUE)
+			{
+				while($row = $sql->db_Fetch())
+				{
+					$ret[$row['user_extended_struct_id']][] = $row;
+				}
+			}
+			else
+			{
+				$ret = $sql->db_getList();
+			}
+		}
+		return $ret;
+	}
+
+	function user_extended_get_fields($cat = "")
+	{
+		global $sql;
+		$more = ($cat) ? " AND user_extended_struct_parent = ".intval($cat)." " : "";
+		if($sql->db_Select("user_extended_struct", "*", "user_extended_struct_type > 0 {$more} ORDER BY user_extended_struct_order ASC"))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				$ret[$row['user_extended_struct_parent']][] = $row;
+			}
+		}
+		return $ret;
+	}
+
+	function user_extended_get_fieldList()
+	{
+		global $sql;
+		$more = ($cat) ? " AND user_extended_struct_parent = ".intval($cat)." " : "";
+		if($sql->db_Select("user_extended_struct", "*", "user_extended_struct_type > 0 {$more} ORDER BY user_extended_struct_order ASC"))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				$ret[$row['user_extended_struct_id']] = $row;
+			}
+		}
+		return $ret;
+	}
+
+	function user_extended_type_text($type, $default)
+	{
+		global $tp;
+		switch ($type)
+		{
+
+			case 6:
+				// integer,
+				$db_type = 'INT(11)';
+				break;
+
+			case 7:
+				// date,
+				$db_type = 'DATE NOT NULL';
+				break;
+
+			case 1:
+			case 2:
+			case 3:
+			case 4:
+			case 8:
+				//text, dropdown, radio, db_field, language
+				$db_type = 'VARCHAR(255)';
+				break;
+
+			case 5:
+				//textarea
+				$db_type = 'TEXT';
+				break;
+		}
+		if($type != 4 && $default != '')
+		{
+			$default_text = " DEFAULT '".$tp -> toDB($default, true)."'";
+		}
+		else
+		{
+			$default_text = '';
+		}
+		return $db_type.$default_text;
+	}
+
+	function user_extended_field_exist($name)
+	{
+		global $sql, $tp;
+		return $sql->db_Count('user_extended_struct','(*)', "WHERE user_extended_struct_name = '".$tp -> toDB($name, true)."'");
+	}
+
+	function user_extended_add($name, $text, $type, $parms, $values, $default, $required, $read, $write, $applicable, $order='', $parent)
+	{
+		global $sql, $tp;
+		if(is_array($name))
+		{
+			extract($name);
+		}
+		if(!is_numeric($type))
+		{
+			$type = $this->typeArray[$type];
+		}
+		if (!($this->user_extended_field_exist($name)))
+		{
+			$field_info = $this->user_extended_type_text($type, $default);
+			if($order === '')
+			{
+				if($sql->db_Select("user_extended_struct","MAX(user_extended_struct_order) as maxorder","1"))
+				{
+					$row = $sql->db_Fetch();
+					if(is_numeric($row['maxorder']))
+					{
+						$order = $row['maxorder']+1;
+					}
+				}
+			}
+			$sql->db_Select_gen("ALTER TABLE #user_extended ADD user_".$tp -> toDB($name, true)." ".$field_info);
+			$sql->db_Insert("user_extended_struct","0,'".$tp -> toDB($name, true)."','".$tp -> toDB($text, true)."','".intval($type)."','".$tp -> toDB($parms, true)."','".$tp -> toDB($values, true)."', '".$tp -> toDB($default, true)."', '".intval($read)."', '".intval($write)."', '".intval($required)."', '0', '".intval($applicable)."', '".intval($order)."', '".intval($parent)."'");
+			if ($this->user_extended_field_exist($name))
+			{
+				return TRUE;
+			}
+		}
+		return FALSE;
+	}
+
+	function user_extended_modify($id, $name, $text, $type, $parms, $values, $default, $required, $read, $write, $applicable, $parent)
+	{
+		global $sql, $tp;
+		if ($this->user_extended_field_exist($name))
+		{
+			$field_info = $this->user_extended_type_text($type, $default);
+			$sql->db_Select_gen("ALTER TABLE #user_extended MODIFY user_".$tp -> toDB($name, true)." ".$field_info);
+			$newfield_info = "
+			user_extended_struct_text = '".$tp -> toDB($text, true)."',
+			user_extended_struct_type = '".intval($type)."',
+			user_extended_struct_parms = '".$tp -> toDB($parms, true)."',
+			user_extended_struct_values = '".$tp -> toDB($values, true)."',
+			user_extended_struct_default = '".$tp -> toDB($default, true)."',
+			user_extended_struct_required = '".intval($required)."',
+			user_extended_struct_read = '".intval($read)."',
+			user_extended_struct_write = '".intval($write)."',
+			user_extended_struct_applicable = '".intval($applicable)."',
+			user_extended_struct_parent = '".intval($parent)."'
+			WHERE user_extended_struct_id = '".intval($id)."'
+			";
+			return $sql->db_Update("user_extended_struct", $newfield_info);
+		}
+	}
+
+	function user_extended_remove($id, $name)
+	{
+		global $sql, $tp;
+		if ($this->user_extended_field_exist($name))
+		{
+			$sql->db_Select_gen("ALTER TABLE #user_extended DROP user_".$tp -> toDB($name, true));
+			if(is_numeric($id))
+			{
+				$sql->db_Delete("user_extended_struct", "user_extended_struct_id = '".intval($id)."' ");
+			}
+			else
+			{
+				$sql->db_Delete("user_extended_struct", "user_extended_struct_name = '".$tp -> toDB($id, true)."' ");
+			}
+			return !($this->user_extended_field_exist($name));
+		}
+	}
+
+	function user_extended_hide($struct, $curval)
+	{
+		$chk = ($curval) ? " checked='checked' " : "";
+		$name = "hide[user_".$struct['user_extended_struct_name']."]";
+		return "<input type='checkbox' {$chk} value='1' name='{$name}' />&nbsp;".UE_LAN_HIDE;
+	}
+
+	function user_extended_edit($struct, $curval)
+	{
+		global $cal, $tp;
+		$choices = explode(",",$struct['user_extended_struct_values']);
+		if(trim($curval) == "" && $struct['user_extended_struct_default'] != "")
+		{
+			$curval = $struct['user_extended_struct_default'];
+		}
+		foreach($choices as $k => $v)
+		{
+			$choices[$k] = str_replace("[E_COMMA]", ",", $choices[$k]);
+		}
+		$parms = explode("^,^",$struct['user_extended_struct_parms']);
+		$include = preg_replace("/\n/", " ", $tp->toText($parms[0]));
+		$regex = $tp->toText($parms[1]);
+		$regexfail = $tp->toText($parms[2]);
+		$fname = "ue[user_".$struct['user_extended_struct_name']."]";
+		if(strpos($include, 'class') === FALSE)	{
+			$include .= " class='tbox' ";
+		}
+
+		switch($struct['user_extended_struct_type'])
+		{
+			case 1:  //textbox
+			case 6:  //integer
+				$ret = "<input name='{$fname}' value='{$curval}' {$include} />";
+				return $ret;
+				break;
+
+			case 2: //radio
+				foreach($choices as $choice)
+				{
+					$choice = trim($choice);
+					$chk = ($curval == $choice)? " checked='checked' " : "";
+					$ret .= "<input {$include} type='radio' name='{$fname}' value='{$choice}' {$chk} /> {$choice}";
+				}
+				return $ret;
+				break;
+
+			case 3: //dropdown
+				$ret = "<select {$include} name='{$fname}'>\n";
+				$ret .= "<option value=''>&nbsp;</option>\n";  // ensures that the user chose it.
+				foreach($choices as $choice)
+				{
+					$choice = trim($choice);
+					$sel = ($curval == $choice) ? " selected='selected' " : "";
+					$ret .= "<option value='{$choice}' {$sel}>{$choice}</option>\n";
+				}
+				$ret .= "</select>\n";
+				return $ret;
+				break;
+
+			case 4: //db_field
+				global $sql;
+				$order = ($choices[3]) ? "ORDER BY ".$tp -> toDB($choices[3], true) : "";
+
+				if($sql->db_Select($tp -> toDB($choices[0], true), $tp -> toDB($choices[1], true).",".$tp -> toDB($choices[2], true), "1 $order")){
+					$choiceList = $sql->db_getList('ALL',FALSE,300);
+					$ret = "<select {$include} name='{$fname}'  >\n";
+					$ret .= "<option value=''>&nbsp;</option>\n";  // ensures that the user chose it.
+					foreach($choiceList as $cArray)
+					{
+						$cID = trim($cArray[$choices[1]]);
+						$cText = trim($cArray[$choices[2]]);
+						$sel = ($curval == $cID) ? " selected='selected' " : "";
+						$ret .= "<option value='{$cID}' {$sel}>{$cText}</option>\n";
+					}
+					$ret .= "</select>\n";
+					return $ret;
+				} else {
+					return "";
+				}
+				break;
+
+			case 5: //textarea
+				return "<textarea {$include} name='{$fname}' >{$curval}</textarea>";
+				break;
+
+			case 7: //date
+				return $cal->make_input_field(
+				array(
+               'ifFormat' => '%Y-%m-%d'
+               ),
+				array(
+					'class' => 'tbox',
+					'name' => $fname,
+					'value' => $curval
+					)
+				);
+				break;
+
+			case 8: // language
+				require_once(e_HANDLER."file_class.php");
+				$fl = new e_file;
+				$lanlist = $fl->get_dirs(e_LANGUAGEDIR);
+				sort($lanlist);
+            $ret = "<select {$include} name='{$fname}'>\n";
+				$ret .= "<option value=''></option>\n";  // ensures that the user chose it.
+				foreach($lanlist as $choice)
+				{
+					$choice = trim($choice);
+					$sel = ($curval == $choice || (!USER && $choice == e_LANGUAGE))? " selected='selected' " : "";
+					$ret .= "<option value='{$choice}' {$sel}>{$choice}</option>\n";
+				}
+				$ret .= "</select>\n";
+           	break;
+
+		}
+
+		return $ret;
+	}
+
+	function user_extended_getStruct($orderby="user_extended_struct_order")
+	{
+		if($ueStruct = getcachedvars('ue_struct'))
+		{
+			return $ueStruct;
+		}
+		global $sql, $tp;
+		$ret = array();
+		$parms = "";
+		if($orderby != "")
+		{
+			$parms = "1 ORDER BY ".$tp -> toDB($orderby, true);
+		}
+		if($sql->db_Select('user_extended_struct','*',$parms))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				$ret['user_'.$row['user_extended_struct_name']] = $row;
+			}
+		}
+		cachevars('ue_struct',$ret);
+		return $ret;
+	}
+
+	function parse_extended_xml($contents, $no_cache = FALSE)
+	{
+		if($no_cache == FALSE && $this->extended_xml)
+		{
+			return $this->extended_xml;
+		}
+
+		require_once(e_HANDLER."xml_class.php");
+		$xml = new CXml;
+		if("getfile" == $contents)
+		{
+			$contents = file_get_contents(e_FILE."cache/user_extended.xml");
+		}
+		$xml->Set_XML_data($contents);
+		$data = $xml->obj_data->e107_extended_user_fields[0];
+		$ret['version'] = $data->version;
+		unset($info);
+		foreach($data->item as $item)
+		{
+			$info = array(
+								"name" 			=> $item->name,
+								"text" 			=> "UE_LAN_".strtoupper($item->name),
+								"type" 			=> $item->type[0],
+								"values" 		=> $item->values[0],
+								"default" 		=> $item->default[0],
+								"required" 		=> $item->required[0],
+								"read" 			=> $item->read[0],
+								"write" 			=> $item->write[0],
+								"applicable" 	=> $item->applicable[0],
+								"include_text"	=> $item->include_text[0],
+								"parms"			=> $item->include_text[0],
+								"regex" 			=> $item->regex[0]
+							 );
+			if(is_array($item->default) && $item->default[0] == '')
+			{
+				$info['default'] = 0;
+			}
+			if($item->regex[0])
+			{
+				$info['parms'] .= $item->include_text[0]."^,^".$item->regex[0]."^,^LAN_UE_FAIL_".strtoupper($item->name);
+			}
+			$ret[$item->name] = $info;
+		}
+		$this->extended_xml = $ret;
+		return $this->extended_xml;
+	}
+
+	function convert_old_fields()
+	{
+		global $sql;
+		$preList = $this->parse_extended_xml('getfile');
+		$flist = array('user_aim', 'user_birthday', 'user_homepage', 'user_icq', 'user_msn', 'user_location');
+		foreach($flist as $f)
+		{
+			$f = substr($f, 5);
+			$preList[$f]['parms'] = addslashes($preList[$f]['parms']);
+			$this->user_extended_add($preList[$f]);
+		}
+		$sql->db_Select_gen("INSERT IGNORE INTO #user_extended (user_extended_id) SELECT user_id FROM #user ");
+		$qry = "
+		UPDATE #user_extended AS ue , #user as u SET
+		ue.user_aim = u.user_aim,
+		ue.user_birthday = u.user_birthday,
+		ue.user_homepage = u.user_homepage,
+		ue.user_icq = u.user_icq,
+		ue.user_msn = u.user_msn,
+		ue.user_location = u.user_location
+		WHERE ue.user_extended_id = u.user_id
+		";
+		$sql->db_Select_gen($qry);
+		$dlist = implode(", DROP ", $flist);
+		$dlist = "DROP ".$dlist;
+		$qry = "ALTER TABLE #user ".$dlist;
+		$sql->db_Select_gen($qry);
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/user_extended.php 75/e107_handlers/user_extended.php
--- 6171/e107_handlers/user_extended.php	2004-09-13 14:56:24.000000000 -0500
+++ 75/e107_handlers/user_extended.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,131 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/e107_handlers/user_extended.php,v $
-|     $Revision: 1.7 $
-|     $Date: 2004/09/13 19:56:24 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-
-// $form_ext_name = extended-user-field string
-// Usage of $form_ext_name - "Name|type|values|default|applicable to|visible to"
-//
-//  default is the default value
-//        applicable to refers to who will see it in the userpref screen
-//  visible to refers to who will see it in the user screen (ie able to hide certain fields)
-//  applicable to and visible to are the class id (a number)
-//
-// eg.      myfield|radio|$value1,$value2,$value3|$value3|0|255
-// eg.      myfield|dropdown|$value1,$value2,$value3
-// eg.      myfield|text|$size
-// eg.      myfield|table|$db_table,$dbfield_value,$dbfield_displayname.
-//          eg. User|table|db_user,user_id,user_name
-// $tdclass = table style class  eg. forumheader3.
-// $alignit = alignment of form element. left,right,center.
-
-
-function user_extended_name($extended){
-    // strips out the other information to just reveal the extended user-field name.
-                        $ut = explode("|",$extended);
-                        $ret = ($ut[0] != "") ? str_replace("_"," ",$ut[0]) : trim($extended);
-                        return $ret;
-                        }
-
-
-function user_extended_edit($u_fieldnum,$form_ext_name,$tdclass="",$alignit="left"){
-
-        global $pref,$key,$sql,$user_pref,$signup_ext,$_POST;
-        $ut = explode("|",$form_ext_name);
-        $u_name = ($ut[0] != "") ? str_replace("_"," ",$ut[0]) : trim($form_ext_name);
-        $u_type = trim($ut[1]);
-        $u_value = $ut[2];
-        $v_default = $ut[3];
-        $u_visible = $ut[4];
-        if($ut[4] && check_class($ut[4])==FALSE){ return; }
-        $ufield_name="ue_{$u_fieldnum}";
-
-        $ret ="<tr><td class='".$tdclass."' style='vertical-align:top'>".$u_name.req($pref[$signup_ext])."</td>\n";
-        $ret .="<td class='".$tdclass."' style='text-align:".$alignit."'><div style='text-align:left;width:10%;white-space:nowrap'>";
-        $tmp = explode(",",$u_value);
-
-        switch ($u_type) {
-                case "radio":
-
-                for ($i=0; $i<count($tmp); $i++) {
-                        $checked = ($tmp[$i] == $user_pref[$ufield_name] || ($tmp[$i] == $v_default && !$user_pref[$ufield_name])) ? " checked='checked'" : "";
-                        if(!USER || $_POST[$ufield_name]){ $checked = ($_POST[$ufield_name] == $tmp[$i] || ($tmp[$i] == $v_default && !$_POST[$ufield_name]))? " checked='checked'" : ""; }
-                        $ret .="<input  type='radio' name='".$ufield_name."'  value='".$tmp[$i]."' $checked /> $tmp[$i] ";
-                        $ret .= ($pref['signup_ext_req'.$key] && $i==0 && (!USER))? "<span style='font-size:15px; color:red'> *</span>":"";
-                        $ret .="<br />";
-                };
-                $ret .="</div>";
-                $ret .="</td></tr>\n\n";
-                break;
-
-                case "dropdown":
-                $ret .= "\n<select class='tbox' style='width:200px'  name='".$ufield_name."'><option></option>\n";
-                for ($i=0; $i<count($tmp); $i++) {
-                        $selected = ($user_pref[$ufield_name] == "$tmp[$i]" || $_POST[$ufield_name] == $tmp[$i])? " selected='selected'" :  "";
-                        $ret .="<option value=\"".$tmp[$i]."\" ".$selected." >". $tmp[$i] ."</option>\n";
-                };
-                $ret .="</select>";
-                $ret .= ($pref['signup_ext_req'.$key] && (!USER))? "<span style='font-size:15px; color:red'> *</span>":"";
-                $ret .= "</div></td></tr>\n\n";
-
-                break;
-
-                case "text":
-                if($u_value == ""){$u_value = "40";};
-                $valuehere = ($_POST[$ufield_name])? $_POST[$ufield_name] : ($user_pref[$ufield_name])? $user_pref[$ufield_name] : $v_default;
-                if(!USER || $_POST[$ufield_name]){ $valuehere = $_POST[$ufield_name];}
-                $ret .="<input class='tbox' type='text' name='".$ufield_name."' size='".$u_value."' value='".$valuehere."' maxlength='200' />";
-                $ret .= ($pref['signup_ext_req'.$key] && (!USER))? "<span style='font-size:15px; color:red'> *</span>":"";
-                $ret .="</div></td></tr>\n\n";
-                break;
-
-                case "table":
-                $ret .="
-                <select class='tbox' style='width:200px'  name='".$ufield_name."'><option></option>";
-
-                $tmp = explode(",",$u_value);
-                $fieldid = $row[$tmp[1]];
-                $fieldvalue = $row[$tmp[2]];
-                $sql -> db_Select($tmp[0],"*","$tmp[1] !='' ORDER BY $tmp[2]");
-                while($row = $sql-> db_Fetch()){
-                        $fieldid = $row[$tmp[1]];
-                        $fieldvalue = $row[$tmp[2]];
-                        $checked = ($fieldid == $user_pref[$ufield_name] || ($fieldid == $v_default && !$user_pref[$ufield_name]))? " selected='selected'" : "";
-                        if(!USER || $_POST[$ufield_name]){ $checked = ($_POST[$ufield_name] == $fieldid)? " selected='selected'" : ($fieldid == $v_default)? " selected='selected'" : "";}
-                        $ret .="<option value='".$fieldid."' $checked > $fieldvalue </option>";
-                }
-                $ret .="</select>";
-                $ret .= ($pref['signup_ext_req'.$key] && e_PAGE =="customsignup.php")? "<span style='font-size:15px; color:red'> *</span>":"";
-                $ret .="</div></td></tr>";
-                break;
-
-                default:
-                //    $ret = "<tr>
-                //    <td style='width:20%' class='".$tdclass."'>".$form_ext_name."</td>
-                //    <td style='width:80%; text-align:".$alignit."' class='".$tdclass."' nowrap>";
-                $valuehere = ($_POST[$ufield_name])? $_POST[$ufield_name] : ($user_pref[$ufield_name])? $user_pref[$ufield_name] : $v_defualt;
-                if(!USER || $_POST[$ufield_name]){ $valuehere = $_POST[$ufield_name];}
-                $ret .="<input class='tbox' type='text' name='".$ufield_name."' size='40' value='".$valuehere."' maxlength='200' />";
-                $ret .= ($pref['signup_ext_req'.$key])? "<span style='font-size:15px; color:red'> *</span>":"";
-                $ret .= "</div></td></tr>";
-                break;
-        }
-
-        return $ret;
-}
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/user_func.php 75/e107_handlers/user_func.php
--- 6171/e107_handlers/user_func.php	2004-08-10 22:33:04.000000000 -0500
+++ 75/e107_handlers/user_func.php	2005-12-28 08:03:36.000000000 -0600
@@ -1,38 +1,51 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107_handlers/user_func.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-function e107_userGetuserclass($user_id){
-	global $cachevar;
-	$key = 'userclass_'.$user_id;
-	$val = getcachedvars($key);
-	if($val)
-	{
-		return $cachevar[$key];
-	}
-	else
-	{
-		$uc_sql = new db;
-		if($uc_sql -> db_Select("user","user_class","user_id={$user_id}"))
-		{
-			$row = $uc_sql -> db_Fetch();
-			return $row['user_class'];
-		}
-		else 
-		{
-			return "";
-		}
-	}
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/user_func.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/12/28 14:03:36 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+function e107_userGetuserclass($user_id)
+{
+	global $cachevar;
+	$key = 'userclass_'.$user_id;
+	$val = getcachedvars($key);
+	if ($val)
+	{
+		return $cachevar[$key];
+	}
+	else
+	{
+		$uc_sql = new db;
+		if ($uc_sql->db_Select("user", "user_class, user_admin", "user_id=".intval($user_id)))
+		{
+			$row = $uc_sql->db_Fetch();
+			$uc = $row['user_class'];
+			$uc .= ",".e_UC_MEMBER;
+			if($row['user_admin'])
+			{
+				$uc .= ",".e_UC_ADMIN;
+			}
+			return $uc;
+		}
+		else
+		{
+			return "";
+		}
+	}
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/user_select_class.php 75/e107_handlers/user_select_class.php
--- 6171/e107_handlers/user_select_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/user_select_class.php	2005-12-28 08:03:36.000000000 -0600
@@ -0,0 +1,226 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/user_select_class.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/28 14:03:36 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined("e_THEME")) {
+	require_once('../class2.php');
+	include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php");
+	$us = new user_select;
+	$us -> popup();
+}
+
+include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php");
+
+class user_select {
+
+	function user_list($class, $form_name) {
+		global $pref, $sql, $tp;
+		if($class === FALSE) { $class = e_UC_MEMBER;}
+		switch ($class)
+		{
+			case e_UC_ADMIN:
+				$where = "user_admin = 1";
+				break;
+
+			case e_UC_MEMBER:
+				$where = "1";
+				break;
+				
+			case e_UC_NOBODY:
+				return "";
+				break;
+				
+			default:
+				$where = "user_class REGEXP '(^|,)(".$tp -> toDB($class, true).")(,|$)'";
+				break;
+		}
+				
+		$text = "<select class='tbox' id='user' name='user' onchange=\"uc_switch('class')\">";
+		$text .= "<option value=''>".US_LAN_1."</option>";
+		$sql -> db_Select("user", "user_name", $where." ORDER BY user_name");
+		while ($row = $sql -> db_Fetch()) {
+			$text .= "<option value='".$row['user_name']."'>".$row['user_name']."</option>";
+		}
+		$text .= "</select>";
+		return $text;
+	}
+	
+	function class_list($class, $form_name) {
+		global $pref, $sql;
+		$text = "<select class='tbox' id='class' name='class' onchange=\"uc_switch('user')\">";
+		$text .= "<option value=''>".US_LAN_2."</option>";
+		if (ADMINPERMS == '0' && $class == e_UC_MEMBER) {
+			$text .= "<option value='all'>".US_LAN_3."</option>";
+		}
+		if ($class == e_UC_MEMBER) {
+			$sql -> db_Select("userclass_classes", "userclass_id, userclass_name", "ORDER BY userclass_name", "nowhere");
+			while ($row = $sql -> db_Fetch()) {
+				if (check_class($row['userclass_id']) || ADMINPERMS == '0') {
+					$text .= "<option value='".$row['userclass_id'].":".$row['userclass_name']."'>".$row['userclass_name']."</option>";
+				}
+			}
+		} else {
+			$sql -> db_Select("userclass_classes", "userclass_id, userclass_name", "userclass_id='".intval($class)."' ORDER BY userclass_name");
+			while ($row = $sql -> db_Fetch()) {
+				$text .= "<option value='".$row['userclass_id'].":".$row['userclass_name']."'>".$row['userclass_name']."</option>";
+			}
+		}
+		return $text;
+	}
+	
+	function select_form($type, $user_form, $user_value = '', $class_form = false, $class_value = '', $class = false) {
+		$text .= "<script type='text/javascript'>
+		<!--
+		function uc_switch(uctype) {
+			document.getElementById(uctype).value = '';
+		}
+		//-->
+		</script>";
+
+		list($form_type, $form_id) = explode(".", $user_form);
+		if($form_id == "") { $form_id = $form_type; }
+
+		if ($type == 'list') {
+			$text .= $this -> user_list($class, 'user');
+		} 
+		else if ($type == 'popup')
+		{
+			if($form_type == 'textarea')
+			{
+				$text .= "<textarea class='tbox' name='".$form_id."' id='".$form_id."' cols='50' rows='4'>{$user_value}</textarea>&nbsp;";
+			}
+			else
+			{
+				$text .= "<input class='tbox' type='text' name='".$form_id."' id='".$form_id."' size='25' maxlength='30' value='".$user_value."'>&nbsp;";
+			}
+			$text .= "<img src='".e_IMAGE_ABS."generic/".IMODE."/user_select.png' 
+			style='width: 16px; height: 16px; vertical-align: top' alt='".US_LAN_4."...' 
+			title='".US_LAN_4."...' onclick=\"window.open('".e_HANDLER_ABS."user_select_class.php?".$user_form."','user_search', 'toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=300,height=200,left=100,top=100'); return false;\" />";
+		}
+		
+		if ($class !== false) {
+			if (($class < e_UC_NOBODY && USERCLASS) || ADMINPERMS == '0') {
+				$text .= ' '.$this -> class_list($class, 'class');
+			}
+		}
+		
+		return $text;
+	}
+	
+	function real_name($_id) {
+		global $sql;
+		$sql -> db_Select("user", "user_name", "user_id='".intval($_id)."' ");
+		if ($row = $sql -> db_Fetch()) {
+			return $row['user_name'];
+		}
+	}
+	
+	function popup() {
+		global $ns;
+		list($elementType, $elementID) = explode(".", e_QUERY);
+		if($elementType == 'textarea')
+		{
+			$job = "
+			curval = parent.opener.document.getElementById('{$elementID}').value;
+			lastchr = curval.substring(curval.length-1, curval.length);
+			if(lastchr != '\\n' && curval.length > 0)
+			{
+				curval = curval+'\\n';
+			}
+			parent.opener.document.getElementById('{$elementID}').value = curval+d+'\\n';";
+		}
+		else
+		{
+			if($elementID == "")
+			{
+				$elementID = $elementType;
+			}
+			$job = "parent.opener.document.getElementById('{$elementID}').value = d;";
+		}
+		echo "<link rel=stylesheet href='".THEME_ABS."style.css'>
+		<script language='JavaScript' type='text/javascript'>
+		<!--
+		function SelectUser() {
+		var d = window.document.results.usersel.value;
+		{$job}
+		this.close();
+		}
+		//-->
+		</script>
+		";
+
+		$text = "<form action='".e_SELF."?".e_QUERY."' method='POST'>
+			<table style='width:100%' class='fborder'>
+			<tr>
+			<td class='forumheader3' style='text-align: center'><input type='text' name='srch' class='tbox' value='".$_POST['srch']."' size='40'>
+			<input class='button' type='submit' name='dosrch' class='tbox' value='".US_LAN_6."'></td>
+			</tr>
+			</table>
+			</form>
+			";
+	
+		if ($_POST['dosrch']) {
+			$userlist = $this -> findusers($_POST['srch']);
+			if($userlist == FALSE)
+			{
+				$fcount= 0;
+			}
+			else
+			{
+				$fcount = count($userlist);
+			}
+			$text .= "<br /><form name='results' action='".e_SELF."?".e_QUERY."' method='POST'>
+			<table style='width:100%' class='fborder'>
+			<tr><td class='fcaption'>{$fcount} ".US_LAN_5."</td></tr>
+			<tr>
+			<td class='forumheader3'>
+			<select class='tbox' name='usersel' width='60' ondblclick='SelectUser()'>
+			";
+			foreach($userlist as $u) {
+				$text .= "<option value='{$u}'>{$u}";
+			}
+			$text .= "
+			</select>
+			<input type='button' class='button' value='".US_LAN_1."' onClick='SelectUser()'>
+			</td>
+		 
+			</tr>
+			</table>
+			</form>
+			";
+		}
+	
+		$ns -> tablerender(US_LAN_4, $text);
+	}
+	
+	function findusers($s) {
+		global $sql, $tp;
+		if ($sql->db_Select("user", "*", "user_name LIKE '%".$tp -> toDB($s)."%' ")) {
+			while ($row = $sql -> db_Fetch()) {
+				$ret[strtolower($row['user_name'])] = $row['user_name'];
+			}
+			ksort($ret);
+		} else {
+			$ret = FALSE;
+		}
+		return $ret;
+	}
+
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/usersession_class.php 75/e107_handlers/usersession_class.php
--- 6171/e107_handlers/usersession_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/usersession_class.php	2005-12-28 08:03:36.000000000 -0600
@@ -0,0 +1,243 @@
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/usersession_class.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/28 14:03:36 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class eUserSession {
+
+	var $_UserTrackingType;
+	var $_CookieName;
+	var $_SessionID;
+	var $_SessionName;
+	var $_LoginResult;
+
+	var $UserDetails = array();
+	var $UserTimes = array();
+	var $UserPrefs = array();
+	var $UserIsAdmin = false;
+	var $_RawPermissions;
+	var $_Permissions = array();
+	var $SuperAdmin = false;
+	var $SessionData = array();
+	var $IsUser = false;
+
+	var $UserIP;
+
+	function eUserSession() {
+		global $pref;
+
+		// Login types operators
+		define('USERLOGIN_TYPE_COOKIE', 0);
+		define('USERLOGIN_TYPE_SESSION', 1);
+		define('USERLOGIN_TYPE_POST', 2);
+
+		// badlogin operators
+		define('LOGINRESULT_OK', 0);
+		define('LOGINRESULT_INVALIDCOOKIE', 1);
+		define('LOGINRESULT_INVALIDSESSION', 2);
+		define('LOGINRESULT_INVALIDSESSIONCOOKIE', 3);
+		define('LOGINRESULT_BADUSERPASS', 4);
+		define('LOGINRESULT_NOTLOGGEDIN', 5);
+
+		// Session handler options - adjust to taste
+		ini_set('session.auto_start', 0);
+		ini_set('session.serialize_handler', 'php');
+		ini_set('session.cookie_lifetime', 0);
+		ini_set('session.use_cookies', 1);
+		ini_set('session.use_only_cookies', 1);
+		ini_set('url_rewriter.tags', '');
+		ini_set('session.use_trans_sid', 0);
+
+		$this->_SessionName = session_name();
+		$this->_UserTrackingType = $pref['user_tracking'];
+		$this->_CookieName = $pref['cookie_name'];
+		
+		global $e107;
+		$e107->getip;
+	}
+
+	function UserSessionStart() {
+		print_r($_POST);
+
+		if ($_POST['username'] && $_POST['userpass']) {
+			if (ini_get('magic_quotes_gpc' != 1)) {
+				$_POST['username'] = addslashes($_POST['username']);
+				$_POST['userpass'] = addslashes($_POST['userpass']);
+			}
+			$_POST['autologin'] = intval($_POST['autologin']);
+			$this->LoginUser(USERLOGIN_TYPE_POST, $_POST['username'], $_POST['userpass'], false, $_POST['autologin']);
+		} elseif ($this->_UserTrackingType == 'session' && $_COOKIE[$this->$_SessionName]) {
+		} elseif ($this->_UserTrackingType == 'cookie' && isset($_COOKIE[$this->_CookieName])) {
+			$Cookie = explode('.', $_COOKIE[$this->_CookieName]);
+			if (count($Cookie) != 2) {
+				$this->_LoginResult = LOGINRESULT_INVALIDCOOKIE;
+			} elseif(preg_match('/^[A-Fa-f0-9]{32}$/', $Cookie[1]) && intval($Cookie[0]) > 0) {
+				$this->LoginUser(USERLOGIN_TYPE_COOKIE, false, $Cookie[1], $Cookie[0]);
+			} else {
+				$this->_LoginResult = LOGINRESULT_INVALIDCOOKIE;
+			}
+		} else {
+			$this->AnonUser();
+			$this->_LoginResult = LOGINRESULT_NOTLOGGEDIN;
+		}
+		if ($this->_LoginResult != LOGINRESULT_OK) {
+			$this->AnonUser();
+		}
+		$this->CompatabiltyMode();
+	}
+
+	function LoginUser($LoginType = false, $UserName = false, $UserPassword = false, $UserID = false, $AutoLogin = false) {
+		global $sql, $tp;
+		switch ($LoginType) {
+			case USERLOGIN_TYPE_COOKIE:
+			if (!$sql->db_Select('user', '*', "user_id = '".intval($UserID)."' AND md5(`user_password`) = '".$tp -> toDB($UserPassword)."'")){
+				$this->_LoginResult = LOGINRESULT_INVALIDCOOKIE;
+			} else {
+				$row = $sql->db_Fetch();
+				$this->ExtractDetails($row);
+				$this->IsUser = true;
+				$this->_LoginResult = LOGINRESULT_OK;
+			}
+			break;
+			case USERLOGIN_TYPE_SESSION:
+			echo "Session Handling Not Fully Implemented Yet!";
+			break;
+			case USERLOGIN_TYPE_POST:
+			$UserPassword = md5($UserPassword);
+			if (!$sql->db_Select('user', '*', "user_name = '".$tp -> toDB($UserName)."' AND user_password = '".$tp -> toDB($UserPassword)."'", 'default', true)) {
+				$this->_LoginResult = LOGINRESULT_BADUSERPASS;
+			} else {
+				$row = $sql->db_Fetch();
+				$this->IsUser = true;
+				$this->_LoginResult = LOGINRESULT_OK;
+				$this->ExtractDetails($row);
+				if ($AutoLogin == true) {
+					header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
+					setcookie($this->_CookieName, $row['user_id'].'.'.md5($UserPassword), (time() + 3600 * 24 * 30));
+					$_COOKIE[$this->_CookieName] = $row['user_id'].'.'.md5($UserPassword);
+				} else {
+					header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
+					setcookie($this->_CookieName, $row['user_id'].'.'.$UserPassword);
+					$_COOKIE[$this->_CookieName] = $row['user_id'].'.'.md5($UserPassword);
+				}
+				if ($this->_UserTrackingType == 'session') {
+					session_start();
+				}
+			}
+			break;
+			if ($this->_LoginResult == LOGINRESULT_INVALIDCOOKIE) {
+				header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"');
+				setcookie($pref['cookie_name'], '', (time()-2592000));
+				unset($_COOKIE[$this->_CookieName]);
+			}
+		}
+	}
+
+	function ExtractDetails($MySQL_Row) {
+		global $user_pref, $pref;
+		if ($MySQL_Row['user_ban'] == 1) {
+			exit();
+		}
+		$this->UserDetails['Name'] = $MySQL_Row['user_name'];
+		$this->UserDetails['ID'] = $MySQL_Row['user_id'];
+		$this->UserDetails['Email'] = $MySQL_Row['user_email'];
+		$this->UserDetails['Class'] = $MySQL_Row['user_class'];
+		$this->UserDetails['Viewed'] = $MySQL_Row['user_viewed'];
+		$this->UserDetails['Image'] = $MySQL_Row['user_image'];
+		$this->UserTimes['PasswordChange'] = $MySQL_Row['user_pwchange'];
+		$this->UserTimes['LastVisit'] = $MySQL_Row['user_lastvisit'];
+		$this->UserTimes['CurrentVisit'] = $MySQL_Row['user_currentvisit'];
+		$this->UserTimes['Join'] = $MySQL_Row['user_join'];
+		$this->UserTimes['Lastpost'] = $MySQL_Row['user_lastpost'];
+		$this->UserPrefs = unserialize($MySQL_Row['user_prefs']);
+		$this->_UserSession = $MySQL_Row['user_sess'];
+		if ($MySQL_Row['user_admin'] == 1) {
+			$this->UserIsAdmin = true;
+			$this->_RawPermissions = $MySQL_Row['user_perms'];
+			$Perms = explode('.', $MySQL_Row['user_perms']);
+			$pTotal = count($Perms) - 1;
+			if ($Perms[$pTotal] == '') {
+				unset($Perms[$pTotal]);
+			}
+			if ($Perms[0] == '0') {
+				$this->SuperAdmin = true;
+			} else {
+				$this->_Permissions = $Perms;
+			}
+		}
+		if ($this->UserTimes['CurrentVisit'] + 3600 < time()) {
+			$this->UserTimes['LastVisit'] = $this->UserTimes['CurrentVisit'];
+			$this->UserTimes['CurrentVisit'] = time();
+			$sql->db_Update('user', "user_visits = user_visits + 1, user_lastvisit = '{$this->UserTimes['LastVisit']}', user_currentvisit='{$this->UserTimes['CurrentVisit']}', user_viewed='' WHERE user_id='{$this->UserDetails['ID']}'");
+		}
+		if (isset($_POST['settheme'])) {
+			$this->UserPrefs['sitetheme'] = ($pref['sitetheme'] == $_POST['sitetheme'] ? '' : $_POST['sitetheme']);
+			$user_pref = $this->UserPrefs;
+			save_prefs('user', $this->UserDetails['ID']);
+		}
+		$user_pref = $this->UserPrefs;
+	}
+
+	function AnonUser() {
+		$this->UserDetails['Name'] = 'Anonymous';
+		$this->UserDetails['ID'] = 0;
+		$this->UserDetails['Email'] = '';
+		$this->UserTimes['LastVisit'] = time();
+		$this->UserTimes['CurrentVisit'] = time();
+		$this->UserTimes['Join'] = time();
+		$this->UserTimes['Lastpost'] = time();
+		$this->UserPrefs = array();
+		$this->UserIsAdmin = false;
+		$this->SuperAdmin = false;
+		$this->_Permissions = array();
+	}
+
+	function CompatabiltyMode() {
+		if ($this->IsUser == true) {
+			define("USERID", $this->UserDetails['ID']);
+			define("USERNAME", $this->UserDetails['Name']);
+			define("USER", TRUE);
+			define("USERCLASS", $this->UserDetails['Class']);
+			define("USERVIEWED", $this->UserDetails['Viewed']);
+			define("USERIMAGE", $this->UserDetails['Image']);
+			define("USERSESS", $this->_UserSession);
+
+			define("USERTHEME", ($this->UserPrefs['sitetheme'] && file_exists(e_THEME.$this->UserPrefs['sitetheme'].'/theme.php') ? $this->UserPrefs['sitetheme'] : false));
+
+			if ($this->UserIsAdmin == true) {
+				define("ADMIN", TRUE);
+				define("ADMINID", $this->UserDetails['ID']);
+				define("ADMINNAME", $this->UserDetails['Name']);
+				define("ADMINPERMS", $this->_RawPermissions);
+				define("ADMINEMAIL", $this->UserDetails['Email']);
+				define("ADMINPWCHANGE", $this->UserTimes['PasswordChange']);
+			} else {
+				define("ADMIN", FALSE);
+			}
+		} else {
+			define("USER", FALSE);
+			define("USERTHEME", FALSE);
+			define("ADMIN", FALSE);
+			define("GUEST", TRUE);
+		}
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_handlers/xml_class.php 75/e107_handlers/xml_class.php
--- 6171/e107_handlers/xml_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_handlers/xml_class.php	2005-12-14 11:37:34.000000000 -0600
@@ -0,0 +1,238 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_handlers/xml_class.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 17:37:34 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class parseXml {
+
+	var $parser;
+	var $error;
+	var $current_tag;
+	var $start_tag;
+	var $xmlData = array();
+	var $counterArray = array();
+	var $data;
+	var $xmlFileContents;
+
+
+	function getRemoteXmlFile($address)
+	{
+		if(function_exists("curl_init"))
+		{
+			$cu = curl_init (); 
+			curl_setopt($cu, CURLOPT_URL, $address);
+			curl_setopt($cu, CURLOPT_RETURNTRANSFER, 1);
+			curl_setopt ($cu, CURLOPT_HEADER, 0);
+			curl_setopt ($cu, CURLOPT_TIMEOUT, 10);
+			$this -> xmlFileContents = curl_exec($cu);
+			if (curl_error($cu))
+			{
+				$this -> error =  "Error: ".curl_errno($cu).", ".curl_error($cu);
+				return FALSE;
+			}
+			curl_close ($cu);
+			return $this -> xmlFileContents;
+		}
+
+		if(ini_get("allow_url_fopen"))
+		{
+			if(!$remote = @fopen ($address, "r"))
+			{
+				$this -> error = "Unable to open remote XML file.";
+				return FALSE;
+			}
+		}
+		else
+		{
+			$tmp = parse_url($address);
+			if(!$remote = fsockopen ($tmp['host'], 80 ,$errno, $errstr, 10))
+			{
+				$this -> error = "Unable to open remote XML file.";
+				return FALSE;
+			}
+			else
+			{
+				socket_set_timeout($remote, 10);
+				fputs($remote, "GET ".$headline_url." HTTP/1.0\r\n\r\n");
+			}
+		}
+
+		$this -> xmlFileContents = "";
+		while (!feof($remote))
+		{
+			$this -> xmlFileContents .= fgets ($remote, 4096);
+		}
+		fclose ($remote);
+		return $this -> xmlFileContents;
+	}
+
+
+	function parseXmlContents ()
+	{
+		foreach($this -> xmlData as $key => $value)
+		{
+			unset($this -> xmlData[$key]);
+		}
+		foreach($this -> counterArray as $key => $value)
+		{
+			unset($this -> counterArray[$key]);
+		}
+
+		if(!function_exists('xml_parser_create'))
+		{
+			$this->error = "XML library not available.";
+			return FALSE;
+		}
+
+		if(!$this -> xmlFileContents)
+        {
+            $this->error = "No XML source specified";
+            return FALSE;
+        }
+
+		$this->parser = xml_parser_create('');
+		xml_set_object($this->parser, $this);
+		xml_set_element_handler($this->parser, 'startElement', 'endElement');
+		xml_set_character_data_handler( $this->parser, 'characterData' );
+
+		$array = explode("\n", $this -> xmlFileContents);
+
+		foreach($array as $data)
+		{
+
+			if(strlen($data == 4096))
+			{
+				$this -> error = "The XML cannot be parsed as it is badly formed.";
+				return FALSE;
+			}
+
+            if (!xml_parse($this->parser, $data))
+            {
+				$this->error = sprintf('XML error: %s at line %d, column %d', xml_error_string(xml_get_error_code($this->parser)), xml_get_current_line_number($this->parser),xml_get_current_column_number($this->parser));
+				return FALSE;
+            }
+        }
+		xml_parser_free( $this->parser );
+		return $this -> xmlData;
+	}
+
+	function startElement ($p, $element, &$attrs)
+	{
+		$this -> start_tag = $element;
+		$this -> current_tag = strtolower($element);
+		if(!array_key_exists($this -> current_tag, $this -> counterArray))
+		{
+			$this -> counterArray[$this -> current_tag] = 0;
+			$this -> xmlData[$this -> current_tag][$this -> counterArray[$this -> current_tag]] = "";
+		}
+	}
+
+	function endElement ($p, $element)
+	{
+		if($this -> start_tag == $element)
+		{
+			$this -> counterArray[$this -> current_tag] ++;
+		}
+	}
+
+	function characterData ($p, $data)
+	{
+		$data = trim ( chop ( $data ));
+		$data = preg_replace('/&(?!amp;)/', '&amp;', $data);
+		if(!array_key_exists($this -> current_tag, $this -> xmlData))
+		{
+			$this -> xmlData [$this -> current_tag] = array();
+		}
+		if(array_key_exists($this -> counterArray[$this -> current_tag], $this -> xmlData [$this -> current_tag]))
+		{
+			$this -> xmlData [$this -> current_tag] [$this -> counterArray[$this -> current_tag]] .= $data;
+		}
+		else
+		{
+			$this -> xmlData [$this -> current_tag] [$this -> counterArray[$this -> current_tag]] = $data;
+		}
+	}
+}
+
+//CXml class code found on php.net
+class CXml
+{
+   var $xml_data;
+   var $obj_data;
+   var $pointer;
+
+   function CXml() { }
+  
+   function Set_xml_data( &$xml_data )
+   {
+       $this->index = 0;
+       $this->pointer[] = &$this->obj_data;
+  
+       //strip white space between tags
+       $this->xml_data = preg_replace("/>[[:space:]]+</i", "><", $xml_data);
+       $this->xml_parser = xml_parser_create( "UTF-8" );
+  
+       xml_parser_set_option( $this->xml_parser, XML_OPTION_CASE_FOLDING, false );
+       xml_set_object( $this->xml_parser, &$this );
+       xml_set_element_handler( $this->xml_parser, "_startElement", "_endElement");
+       xml_set_character_data_handler( $this->xml_parser, "_cData" );
+      
+       xml_parse( $this->xml_parser, $this->xml_data, true );
+       xml_parser_free( $this->xml_parser );
+   }
+  
+   function _startElement( $parser, $tag, $attributeList )
+   {
+       foreach( $attributeList as $name => $value )
+       {
+           $value = $this->_cleanString( $value );
+           $object->$name = $value;
+       }
+       //replaces the special characters with the underscore (_) in tag name
+       $tag = preg_replace("/[:\-\. ]/", "_", $tag);
+       eval( "\$this->pointer[\$this->index]->" . $tag . "[] = \$object;" );
+       eval( "\$size = sizeof( \$this->pointer[\$this->index]->" . $tag . " );" );
+       eval( "\$this->pointer[] = &\$this->pointer[\$this->index]->" . $tag . "[\$size-1];" );
+          
+       $this->index++;
+   }
+
+   function _endElement( $parser, $tag )
+   {
+       array_pop( $this->pointer );
+       $this->index--;
+   }
+  
+   function _cData( $parser, $data )
+   {
+       if (empty($this->pointer[$this->index])) {
+           if (rtrim($data, "\n"))
+               $this->pointer[$this->index] = $data;
+       } else {
+           $this->pointer[$this->index] .= $data;
+       }
+   }
+
+   function _cleanString( $string )
+   {
+       return utf8_decode( trim( $string ) );
+   }
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107.htaccess 75/e107.htaccess
--- 6171/e107.htaccess	2004-03-03 12:23:42.000000000 -0600
+++ 75/e107.htaccess	2004-09-21 14:09:30.000000000 -0500
@@ -1,5 +1,5 @@
-ErrorDocument 400 /error.php?400
-ErrorDocument 401 /error.php?401
-ErrorDocument 403 /error.php?403
-ErrorDocument 404 /error.php?404
+ErrorDocument 400 /error.php?400
+ErrorDocument 401 /error.php?401
+ErrorDocument 403 /error.php?403
+ErrorDocument 404 /error.php?404
 ErrorDocument 500 /error.php?500
\ No newline at end of file
Files 6171/e107_images/admin_images/adminlogs_16.png and 75/e107_images/admin_images/adminlogs_16.png differ
Files 6171/e107_images/admin_images/adminlogs_32.png and 75/e107_images/admin_images/adminlogs_32.png differ
Files 6171/e107_images/admin_images/adminpass_16.png and 75/e107_images/admin_images/adminpass_16.png differ
Files 6171/e107_images/admin_images/adminpass_32.png and 75/e107_images/admin_images/adminpass_32.png differ
Files 6171/e107_images/admin_images/admins_16.png and 75/e107_images/admin_images/admins_16.png differ
Files 6171/e107_images/admin_images/admins_32.png and 75/e107_images/admin_images/admins_32.png differ
Files 6171/e107_images/admin_images/arrow_16.png and 75/e107_images/admin_images/arrow_16.png differ
Files 6171/e107_images/admin_images/arrow_32.png and 75/e107_images/admin_images/arrow_32.png differ
Files 6171/e107_images/admin_images/arrow_over_16.png and 75/e107_images/admin_images/arrow_over_16.png differ
Files 6171/e107_images/admin_images/arrow_over_32.png and 75/e107_images/admin_images/arrow_over_32.png differ
Files 6171/e107_images/admin_images/articles_16.png and 75/e107_images/admin_images/articles_16.png differ
Files 6171/e107_images/admin_images/articles_32.png and 75/e107_images/admin_images/articles_32.png differ
Files 6171/e107_images/admin_images/banlist_16.png and 75/e107_images/admin_images/banlist_16.png differ
Files 6171/e107_images/admin_images/banlist_32.png and 75/e107_images/admin_images/banlist_32.png differ
Files 6171/e107_images/admin_images/banners_16.png and 75/e107_images/admin_images/banners_16.png differ
Files 6171/e107_images/admin_images/banners_32.png and 75/e107_images/admin_images/banners_32.png differ
Files 6171/e107_images/admin_images/blocked.png and 75/e107_images/admin_images/blocked.png differ
Files 6171/e107_images/admin_images/cache_16.png and 75/e107_images/admin_images/cache_16.png differ
Files 6171/e107_images/admin_images/cache_32.png and 75/e107_images/admin_images/cache_32.png differ
Files 6171/e107_images/admin_images/cat_content_16.png and 75/e107_images/admin_images/cat_content_16.png differ
Files 6171/e107_images/admin_images/cat_content_32.png and 75/e107_images/admin_images/cat_content_32.png differ
Files 6171/e107_images/admin_images/cat_files_16.png and 75/e107_images/admin_images/cat_files_16.png differ
Files 6171/e107_images/admin_images/cat_files_32.png and 75/e107_images/admin_images/cat_files_32.png differ
Files 6171/e107_images/admin_images/cat_plugins_16.png and 75/e107_images/admin_images/cat_plugins_16.png differ
Files 6171/e107_images/admin_images/cat_plugins_32.png and 75/e107_images/admin_images/cat_plugins_32.png differ
Files 6171/e107_images/admin_images/cat_settings_16.png and 75/e107_images/admin_images/cat_settings_16.png differ
Files 6171/e107_images/admin_images/cat_settings_32.png and 75/e107_images/admin_images/cat_settings_32.png differ
Files 6171/e107_images/admin_images/cat_tools_16.png and 75/e107_images/admin_images/cat_tools_16.png differ
Files 6171/e107_images/admin_images/cat_tools_32.png and 75/e107_images/admin_images/cat_tools_32.png differ
Files 6171/e107_images/admin_images/cat_users_16.png and 75/e107_images/admin_images/cat_users_16.png differ
Files 6171/e107_images/admin_images/cat_users_32.png and 75/e107_images/admin_images/cat_users_32.png differ
Files 6171/e107_images/admin_images/chatbox_16.png and 75/e107_images/admin_images/chatbox_16.png differ
Files 6171/e107_images/admin_images/chatbox_32.png and 75/e107_images/admin_images/chatbox_32.png differ
Files 6171/e107_images/admin_images/comments_16.png and 75/e107_images/admin_images/comments_16.png differ
Files 6171/e107_images/admin_images/comments_32.png and 75/e107_images/admin_images/comments_32.png differ
Files 6171/e107_images/admin_images/content_16.png and 75/e107_images/admin_images/content_16.png differ
Files 6171/e107_images/admin_images/content_32.png and 75/e107_images/admin_images/content_32.png differ
Files 6171/e107_images/admin_images/credits_16.png and 75/e107_images/admin_images/credits_16.png differ
Files 6171/e107_images/admin_images/credits_32.png and 75/e107_images/admin_images/credits_32.png differ
Files 6171/e107_images/admin_images/custom_16.png and 75/e107_images/admin_images/custom_16.png differ
Files 6171/e107_images/admin_images/custom_32.png and 75/e107_images/admin_images/custom_32.png differ
Files 6171/e107_images/admin_images/database_16.png and 75/e107_images/admin_images/database_16.png differ
Files 6171/e107_images/admin_images/database_32.png and 75/e107_images/admin_images/database_32.png differ
Files 6171/e107_images/admin_images/delete_16.png and 75/e107_images/admin_images/delete_16.png differ
Files 6171/e107_images/admin_images/delete_32.png and 75/e107_images/admin_images/delete_32.png differ
Files 6171/e107_images/admin_images/docs_16.png and 75/e107_images/admin_images/docs_16.png differ
Files 6171/e107_images/admin_images/docs_32.png and 75/e107_images/admin_images/docs_32.png differ
Files 6171/e107_images/admin_images/downloads_16.png and 75/e107_images/admin_images/downloads_16.png differ
Files 6171/e107_images/admin_images/downloads_32.png and 75/e107_images/admin_images/downloads_32.png differ
Files 6171/e107_images/admin_images/down.png and 75/e107_images/admin_images/down.png differ
Files 6171/e107_images/admin_images/edit_16.png and 75/e107_images/admin_images/edit_16.png differ
Files 6171/e107_images/admin_images/edit_32.png and 75/e107_images/admin_images/edit_32.png differ
Files 6171/e107_images/admin_images/emoticons_16.png and 75/e107_images/admin_images/emoticons_16.png differ
Files 6171/e107_images/admin_images/emoticons_32.png and 75/e107_images/admin_images/emoticons_32.png differ
Files 6171/e107_images/admin_images/extended_16.png and 75/e107_images/admin_images/extended_16.png differ
Files 6171/e107_images/admin_images/extended_32.png and 75/e107_images/admin_images/extended_32.png differ
Files 6171/e107_images/admin_images/failedlogin_16.png and 75/e107_images/admin_images/failedlogin_16.png differ
Files 6171/e107_images/admin_images/fileinspector_16.png and 75/e107_images/admin_images/fileinspector_16.png differ
Files 6171/e107_images/admin_images/fileinspector_32.png and 75/e107_images/admin_images/fileinspector_32.png differ
Files 6171/e107_images/admin_images/filemanager_16.png and 75/e107_images/admin_images/filemanager_16.png differ
Files 6171/e107_images/admin_images/filemanager_32.png and 75/e107_images/admin_images/filemanager_32.png differ
Files 6171/e107_images/admin_images/forums_16.png and 75/e107_images/admin_images/forums_16.png differ
Files 6171/e107_images/admin_images/forums_32.png and 75/e107_images/admin_images/forums_32.png differ
Files 6171/e107_images/admin_images/frontpage_16.png and 75/e107_images/admin_images/frontpage_16.png differ
Files 6171/e107_images/admin_images/frontpage_32.png and 75/e107_images/admin_images/frontpage_32.png differ
Files 6171/e107_images/admin_images/images_16.png and 75/e107_images/admin_images/images_16.png differ
Files 6171/e107_images/admin_images/images_32.png and 75/e107_images/admin_images/images_32.png differ
Files 6171/e107_images/admin_images/installed.png and 75/e107_images/admin_images/installed.png differ
Files 6171/e107_images/admin_images/language_16.png and 75/e107_images/admin_images/language_16.png differ
Files 6171/e107_images/admin_images/language_32.png and 75/e107_images/admin_images/language_32.png differ
Files 6171/e107_images/admin_images/leave_16.png and 75/e107_images/admin_images/leave_16.png differ
Files 6171/e107_images/admin_images/leave_32.png and 75/e107_images/admin_images/leave_32.png differ
Files 6171/e107_images/admin_images/links_16.png and 75/e107_images/admin_images/links_16.png differ
Files 6171/e107_images/admin_images/links_32.png and 75/e107_images/admin_images/links_32.png differ
Files 6171/e107_images/admin_images/logout_16.png and 75/e107_images/admin_images/logout_16.png differ
Files 6171/e107_images/admin_images/logout_32.png and 75/e107_images/admin_images/logout_32.png differ
Files 6171/e107_images/admin_images/mail_16.png and 75/e107_images/admin_images/mail_16.png differ
Files 6171/e107_images/admin_images/mail_32.png and 75/e107_images/admin_images/mail_32.png differ
Files 6171/e107_images/admin_images/main_16.png and 75/e107_images/admin_images/main_16.png differ
Files 6171/e107_images/admin_images/main_32.png and 75/e107_images/admin_images/main_32.png differ
Files 6171/e107_images/admin_images/maintain_16.png and 75/e107_images/admin_images/maintain_16.png differ
Files 6171/e107_images/admin_images/maintain_32.png and 75/e107_images/admin_images/maintain_32.png differ
Files 6171/e107_images/admin_images/menus_16.png and 75/e107_images/admin_images/menus_16.png differ
Files 6171/e107_images/admin_images/menus_32.png and 75/e107_images/admin_images/menus_32.png differ
Files 6171/e107_images/admin_images/meta_16.png and 75/e107_images/admin_images/meta_16.png differ
Files 6171/e107_images/admin_images/meta_32.png and 75/e107_images/admin_images/meta_32.png differ
Files 6171/e107_images/admin_images/news_16.png and 75/e107_images/admin_images/news_16.png differ
Files 6171/e107_images/admin_images/news_32.png and 75/e107_images/admin_images/news_32.png differ
Files 6171/e107_images/admin_images/newsfeeds_16.png and 75/e107_images/admin_images/newsfeeds_16.png differ
Files 6171/e107_images/admin_images/newsfeeds_32.png and 75/e107_images/admin_images/newsfeeds_32.png differ
Files 6171/e107_images/admin_images/noinstall.png and 75/e107_images/admin_images/noinstall.png differ
Files 6171/e107_images/admin_images/nopreview.png and 75/e107_images/admin_images/nopreview.png differ
Files 6171/e107_images/admin_images/notify_16.png and 75/e107_images/admin_images/notify_16.png differ
Files 6171/e107_images/admin_images/notify_32.png and 75/e107_images/admin_images/notify_32.png differ
Files 6171/e107_images/admin_images/phpinfo_16.png and 75/e107_images/admin_images/phpinfo_16.png differ
Files 6171/e107_images/admin_images/phpinfo_32.png and 75/e107_images/admin_images/phpinfo_32.png differ
Files 6171/e107_images/admin_images/plugins_16.png and 75/e107_images/admin_images/plugins_16.png differ
Files 6171/e107_images/admin_images/plugins_32.png and 75/e107_images/admin_images/plugins_32.png differ
Files 6171/e107_images/admin_images/plugmanager_16.png and 75/e107_images/admin_images/plugmanager_16.png differ
Files 6171/e107_images/admin_images/plugmanager_32.png and 75/e107_images/admin_images/plugmanager_32.png differ
Files 6171/e107_images/admin_images/polls_16.png and 75/e107_images/admin_images/polls_16.png differ
Files 6171/e107_images/admin_images/polls_32.png and 75/e107_images/admin_images/polls_32.png differ
Files 6171/e107_images/admin_images/prefs_16.png and 75/e107_images/admin_images/prefs_16.png differ
Files 6171/e107_images/admin_images/prefs_32.png and 75/e107_images/admin_images/prefs_32.png differ
Files 6171/e107_images/admin_images/reviews_16.png and 75/e107_images/admin_images/reviews_16.png differ
Files 6171/e107_images/admin_images/reviews_32.png and 75/e107_images/admin_images/reviews_32.png differ
Files 6171/e107_images/admin_images/search_16.png and 75/e107_images/admin_images/search_16.png differ
Files 6171/e107_images/admin_images/search_32.png and 75/e107_images/admin_images/search_32.png differ
Files 6171/e107_images/admin_images/stats_16.png and 75/e107_images/admin_images/stats_16.png differ
Files 6171/e107_images/admin_images/stats_32.png and 75/e107_images/admin_images/stats_32.png differ
Files 6171/e107_images/admin_images/sub_forums_16.png and 75/e107_images/admin_images/sub_forums_16.png differ
Files 6171/e107_images/admin_images/sublink_16.png and 75/e107_images/admin_images/sublink_16.png differ
Files 6171/e107_images/admin_images/sublink.png and 75/e107_images/admin_images/sublink.png differ
Files 6171/e107_images/admin_images/themes_16.png and 75/e107_images/admin_images/themes_16.png differ
Files 6171/e107_images/admin_images/themes_32.png and 75/e107_images/admin_images/themes_32.png differ
Files 6171/e107_images/admin_images/uninstalled.png and 75/e107_images/admin_images/uninstalled.png differ
Files 6171/e107_images/admin_images/upgrade.png and 75/e107_images/admin_images/upgrade.png differ
Files 6171/e107_images/admin_images/uploads_16.png and 75/e107_images/admin_images/uploads_16.png differ
Files 6171/e107_images/admin_images/uploads_32.png and 75/e107_images/admin_images/uploads_32.png differ
Files 6171/e107_images/admin_images/up.png and 75/e107_images/admin_images/up.png differ
Files 6171/e107_images/admin_images/userclass_16.png and 75/e107_images/admin_images/userclass_16.png differ
Files 6171/e107_images/admin_images/userclass_32.png and 75/e107_images/admin_images/userclass_32.png differ
Files 6171/e107_images/admin_images/users_16.png and 75/e107_images/admin_images/users_16.png differ
Files 6171/e107_images/admin_images/users_32.png and 75/e107_images/admin_images/users_32.png differ
Files 6171/e107_images/admin_images/welcome_16.png and 75/e107_images/admin_images/welcome_16.png differ
Files 6171/e107_images/admin_images/welcome_32.png and 75/e107_images/admin_images/welcome_32.png differ
Files 6171/e107_images/adminlogo.png and 75/e107_images/adminlogo.png differ
Files 6171/e107_images/advanced.png and 75/e107_images/advanced.png differ
Files 6171/e107_images/avatars/avatar_1.png and 75/e107_images/avatars/avatar_1.png differ
Files 6171/e107_images/banners/banner1.png and 75/e107_images/banners/banner1.png differ
Files 6171/e107_images/banners/banner2.png and 75/e107_images/banners/banner2.png differ
Files 6171/e107_images/banners/banner3.png and 75/e107_images/banners/banner3.png differ
Files 6171/e107_images/banners/e107.jpg and 75/e107_images/banners/e107.jpg differ
Files 6171/e107_images/button.png and 75/e107_images/button.png differ
Files 6171/e107_images/download_icons/admin.png and 75/e107_images/download_icons/admin.png differ
Files 6171/e107_images/download_icons/icon1.png and 75/e107_images/download_icons/icon1.png differ
Files 6171/e107_images/download_icons/icon2.png and 75/e107_images/download_icons/icon2.png differ
Files 6171/e107_images/download_icons/icon3.png and 75/e107_images/download_icons/icon3.png differ
Files 6171/e107_images/download_icons/icon4.png and 75/e107_images/download_icons/icon4.png differ
Files 6171/e107_images/download_icons/icon5.png and 75/e107_images/download_icons/icon5.png differ
Files 6171/e107_images/download_icons/star2.gif and 75/e107_images/download_icons/star2.gif differ
Files 6171/e107_images/download_icons/star4.gif and 75/e107_images/download_icons/star4.gif differ
Files 6171/e107_images/e107_icon_16.png and 75/e107_images/e107_icon_16.png differ
Files 6171/e107_images/e107_icon_32.png and 75/e107_images/e107_icon_32.png differ
Files 6171/e107_images/emotes/default/alien.png and 75/e107_images/emotes/default/alien.png differ
Files 6171/e107_images/emotes/default/amazed.png and 75/e107_images/emotes/default/amazed.png differ
Files 6171/e107_images/emotes/default/angry.png and 75/e107_images/emotes/default/angry.png differ
Files 6171/e107_images/emotes/default/biglaugh.png and 75/e107_images/emotes/default/biglaugh.png differ
Files 6171/e107_images/emotes/default/cheesey.png and 75/e107_images/emotes/default/cheesey.png differ
Files 6171/e107_images/emotes/default/confused.png and 75/e107_images/emotes/default/confused.png differ
Files 6171/e107_images/emotes/default/cry.png and 75/e107_images/emotes/default/cry.png differ
Files 6171/e107_images/emotes/default/dead.png and 75/e107_images/emotes/default/dead.png differ
Files 6171/e107_images/emotes/default/dodge.png and 75/e107_images/emotes/default/dodge.png differ
Files 6171/e107_images/emotes/default/frown.png and 75/e107_images/emotes/default/frown.png differ
Files 6171/e107_images/emotes/default/gah.png and 75/e107_images/emotes/default/gah.png differ
Files 6171/e107_images/emotes/default/grin.png and 75/e107_images/emotes/default/grin.png differ
Files 6171/e107_images/emotes/default/heart.png and 75/e107_images/emotes/default/heart.png differ
Files 6171/e107_images/emotes/default/idea.png and 75/e107_images/emotes/default/idea.png differ
Files 6171/e107_images/emotes/default/ill.png and 75/e107_images/emotes/default/ill.png differ
Files 6171/e107_images/emotes/default/mad.png and 75/e107_images/emotes/default/mad.png differ
Files 6171/e107_images/emotes/default/mistrust.png and 75/e107_images/emotes/default/mistrust.png differ
Files 6171/e107_images/emotes/default/neutral.png and 75/e107_images/emotes/default/neutral.png differ
Files 6171/e107_images/emotes/default/question.png and 75/e107_images/emotes/default/question.png differ
Files 6171/e107_images/emotes/default/rolleyes.png and 75/e107_images/emotes/default/rolleyes.png differ
Files 6171/e107_images/emotes/default/sad.png and 75/e107_images/emotes/default/sad.png differ
Files 6171/e107_images/emotes/default/shades.png and 75/e107_images/emotes/default/shades.png differ
Files 6171/e107_images/emotes/default/shy.png and 75/e107_images/emotes/default/shy.png differ
Files 6171/e107_images/emotes/default/smile.png and 75/e107_images/emotes/default/smile.png differ
Files 6171/e107_images/emotes/default/special.png and 75/e107_images/emotes/default/special.png differ
Files 6171/e107_images/emotes/default/suprised.png and 75/e107_images/emotes/default/suprised.png differ
Files 6171/e107_images/emotes/default/tongue.png and 75/e107_images/emotes/default/tongue.png differ
Files 6171/e107_images/emotes/default/wink.png and 75/e107_images/emotes/default/wink.png differ
Files 6171/e107_images/emoticons/alien.png and 75/e107_images/emoticons/alien.png differ
Files 6171/e107_images/emoticons/amazed.png and 75/e107_images/emoticons/amazed.png differ
Files 6171/e107_images/emoticons/angry.png and 75/e107_images/emoticons/angry.png differ
Files 6171/e107_images/emoticons/biglaugh.png and 75/e107_images/emoticons/biglaugh.png differ
Files 6171/e107_images/emoticons/cheesey.png and 75/e107_images/emoticons/cheesey.png differ
Files 6171/e107_images/emoticons/confused.png and 75/e107_images/emoticons/confused.png differ
Files 6171/e107_images/emoticons/cry.png and 75/e107_images/emoticons/cry.png differ
Files 6171/e107_images/emoticons/dead.png and 75/e107_images/emoticons/dead.png differ
Files 6171/e107_images/emoticons/dodge.png and 75/e107_images/emoticons/dodge.png differ
Files 6171/e107_images/emoticons/frown.png and 75/e107_images/emoticons/frown.png differ
Files 6171/e107_images/emoticons/gah.png and 75/e107_images/emoticons/gah.png differ
Files 6171/e107_images/emoticons/grin.png and 75/e107_images/emoticons/grin.png differ
Files 6171/e107_images/emoticons/heart.png and 75/e107_images/emoticons/heart.png differ
Files 6171/e107_images/emoticons/idea.png and 75/e107_images/emoticons/idea.png differ
Files 6171/e107_images/emoticons/ill.png and 75/e107_images/emoticons/ill.png differ
Files 6171/e107_images/emoticons/mad.png and 75/e107_images/emoticons/mad.png differ
Files 6171/e107_images/emoticons/mistrust.png and 75/e107_images/emoticons/mistrust.png differ
Files 6171/e107_images/emoticons/neutral.png and 75/e107_images/emoticons/neutral.png differ
Files 6171/e107_images/emoticons/question.png and 75/e107_images/emoticons/question.png differ
Files 6171/e107_images/emoticons/rolleyes.png and 75/e107_images/emoticons/rolleyes.png differ
Files 6171/e107_images/emoticons/sad.png and 75/e107_images/emoticons/sad.png differ
Files 6171/e107_images/emoticons/shades.png and 75/e107_images/emoticons/shades.png differ
Files 6171/e107_images/emoticons/shy.png and 75/e107_images/emoticons/shy.png differ
Files 6171/e107_images/emoticons/smile.png and 75/e107_images/emoticons/smile.png differ
Files 6171/e107_images/emoticons/special.png and 75/e107_images/emoticons/special.png differ
Files 6171/e107_images/emoticons/suprised.png and 75/e107_images/emoticons/suprised.png differ
Files 6171/e107_images/emoticons/template1.png and 75/e107_images/emoticons/template1.png differ
Files 6171/e107_images/emoticons/template2.png and 75/e107_images/emoticons/template2.png differ
Files 6171/e107_images/emoticons/template.png and 75/e107_images/emoticons/template.png differ
Files 6171/e107_images/emoticons/tongue.png and 75/e107_images/emoticons/tongue.png differ
Files 6171/e107_images/emoticons/wink.png and 75/e107_images/emoticons/wink.png differ
Files 6171/e107_images/fileinspector/blank.png and 75/e107_images/fileinspector/blank.png differ
Files 6171/e107_images/fileinspector/close.png and 75/e107_images/fileinspector/close.png differ
Files 6171/e107_images/fileinspector/contract.png and 75/e107_images/fileinspector/contract.png differ
Files 6171/e107_images/fileinspector/expand.png and 75/e107_images/fileinspector/expand.png differ
Files 6171/e107_images/fileinspector/file_check.png and 75/e107_images/fileinspector/file_check.png differ
Files 6171/e107_images/fileinspector/file_core.png and 75/e107_images/fileinspector/file_core.png differ
Files 6171/e107_images/fileinspector/file_fail.png and 75/e107_images/fileinspector/file_fail.png differ
Files 6171/e107_images/fileinspector/fileinspector.png and 75/e107_images/fileinspector/fileinspector.png differ
Files 6171/e107_images/fileinspector/file_missing.png and 75/e107_images/fileinspector/file_missing.png differ
Files 6171/e107_images/fileinspector/file_old.png and 75/e107_images/fileinspector/file_old.png differ
Files 6171/e107_images/fileinspector/file.png and 75/e107_images/fileinspector/file.png differ
Files 6171/e107_images/fileinspector/file_uncalc.png and 75/e107_images/fileinspector/file_uncalc.png differ
Files 6171/e107_images/fileinspector/file_unknown.png and 75/e107_images/fileinspector/file_unknown.png differ
Files 6171/e107_images/fileinspector/file_warning.png and 75/e107_images/fileinspector/file_warning.png differ
Files 6171/e107_images/fileinspector/folder_check.png and 75/e107_images/fileinspector/folder_check.png differ
Files 6171/e107_images/fileinspector/folder_core.png and 75/e107_images/fileinspector/folder_core.png differ
Files 6171/e107_images/fileinspector/folder_fail.png and 75/e107_images/fileinspector/folder_fail.png differ
Files 6171/e107_images/fileinspector/folder_missing.png and 75/e107_images/fileinspector/folder_missing.png differ
Files 6171/e107_images/fileinspector/folder_old_dir.png and 75/e107_images/fileinspector/folder_old_dir.png differ
Files 6171/e107_images/fileinspector/folder_old.png and 75/e107_images/fileinspector/folder_old.png differ
Files 6171/e107_images/fileinspector/folder.png and 75/e107_images/fileinspector/folder.png differ
Files 6171/e107_images/fileinspector/folder_root.png and 75/e107_images/fileinspector/folder_root.png differ
Files 6171/e107_images/fileinspector/folder_unknown.png and 75/e107_images/fileinspector/folder_unknown.png differ
Files 6171/e107_images/fileinspector/folder_up.png and 75/e107_images/fileinspector/folder_up.png differ
Files 6171/e107_images/fileinspector/folder_warning.png and 75/e107_images/fileinspector/folder_warning.png differ
Files 6171/e107_images/fileinspector/forward.png and 75/e107_images/fileinspector/forward.png differ
Files 6171/e107_images/fileinspector/info.png and 75/e107_images/fileinspector/info.png differ
Files 6171/e107_images/fileinspector/integrity_fail.png and 75/e107_images/fileinspector/integrity_fail.png differ
Files 6171/e107_images/fileinspector/integrity_pass.png and 75/e107_images/fileinspector/integrity_pass.png differ
Files 6171/e107_images/fileinspector/warning.png and 75/e107_images/fileinspector/warning.png differ
Files 6171/e107_images/filemanager/css.png and 75/e107_images/filemanager/css.png differ
Files 6171/e107_images/filemanager/default.png and 75/e107_images/filemanager/default.png differ
Files 6171/e107_images/filemanager/def.png and 75/e107_images/filemanager/def.png differ
Files 6171/e107_images/filemanager/del.png and 75/e107_images/filemanager/del.png differ
Files 6171/e107_images/filemanager/exe.png and 75/e107_images/filemanager/exe.png differ
Files 6171/e107_images/filemanager/folder.png and 75/e107_images/filemanager/folder.png differ
Files 6171/e107_images/filemanager/gif.png and 75/e107_images/filemanager/gif.png differ
Files 6171/e107_images/filemanager/home.png and 75/e107_images/filemanager/home.png differ
Files 6171/e107_images/filemanager/htm.png and 75/e107_images/filemanager/htm.png differ
Files 6171/e107_images/filemanager/jpg.png and 75/e107_images/filemanager/jpg.png differ
Files 6171/e107_images/filemanager/js.png and 75/e107_images/filemanager/js.png differ
Files 6171/e107_images/filemanager/link.png and 75/e107_images/filemanager/link.png differ
Files 6171/e107_images/filemanager/mp3.png and 75/e107_images/filemanager/mp3.png differ
Files 6171/e107_images/filemanager/pdf.png and 75/e107_images/filemanager/pdf.png differ
Files 6171/e107_images/filemanager/php.png and 75/e107_images/filemanager/php.png differ
Files 6171/e107_images/filemanager/png.png and 75/e107_images/filemanager/png.png differ
Files 6171/e107_images/filemanager/txt.png and 75/e107_images/filemanager/txt.png differ
Files 6171/e107_images/filemanager/updir.png and 75/e107_images/filemanager/updir.png differ
Files 6171/e107_images/filemanager/xml.png and 75/e107_images/filemanager/xml.png differ
Files 6171/e107_images/filemanager/zip.png and 75/e107_images/filemanager/zip.png differ
Files 6171/e107_images/forum/admin_delete.png and 75/e107_images/forum/admin_delete.png differ
Files 6171/e107_images/forum/admin_edit.png and 75/e107_images/forum/admin_edit.png differ
Files 6171/e107_images/forum/admin_lock.png and 75/e107_images/forum/admin_lock.png differ
Files 6171/e107_images/forum/admin_move.png and 75/e107_images/forum/admin_move.png differ
Files 6171/e107_images/forum/admin.png and 75/e107_images/forum/admin.png differ
Files 6171/e107_images/forum/admin_stick.png and 75/e107_images/forum/admin_stick.png differ
Files 6171/e107_images/forum/admin_unlock.png and 75/e107_images/forum/admin_unlock.png differ
Files 6171/e107_images/forum/admin_unstick.png and 75/e107_images/forum/admin_unstick.png differ
Files 6171/e107_images/forum/aim.png and 75/e107_images/forum/aim.png differ
Files 6171/e107_images/forum/announce.png and 75/e107_images/forum/announce.png differ
Files 6171/e107_images/forum/closed_small.png and 75/e107_images/forum/closed_small.png differ
Files 6171/e107_images/forum/delete.png and 75/e107_images/forum/delete.png differ
Files 6171/e107_images/forum/edit.png and 75/e107_images/forum/edit.png differ
Files 6171/e107_images/forum/email.png and 75/e107_images/forum/email.png differ
Files 6171/e107_images/forum/e.png and 75/e107_images/forum/e.png differ
Files 6171/e107_images/forum/fcap2.png and 75/e107_images/forum/fcap2.png differ
Files 6171/e107_images/forum/fcap.png and 75/e107_images/forum/fcap.png differ
Files 6171/e107_images/forum/finfobar.png and 75/e107_images/forum/finfobar.png differ
Files 6171/e107_images/forum/icq.png and 75/e107_images/forum/icq.png differ
Files 6171/e107_images/forum/lev10.png and 75/e107_images/forum/lev10.png differ
Files 6171/e107_images/forum/lev1.png and 75/e107_images/forum/lev1.png differ
Files 6171/e107_images/forum/lev2.png and 75/e107_images/forum/lev2.png differ
Files 6171/e107_images/forum/lev3.png and 75/e107_images/forum/lev3.png differ
Files 6171/e107_images/forum/lev4.png and 75/e107_images/forum/lev4.png differ
Files 6171/e107_images/forum/lev5.png and 75/e107_images/forum/lev5.png differ
Files 6171/e107_images/forum/lev6.png and 75/e107_images/forum/lev6.png differ
Files 6171/e107_images/forum/lev7.png and 75/e107_images/forum/lev7.png differ
Files 6171/e107_images/forum/lev8.png and 75/e107_images/forum/lev8.png differ
Files 6171/e107_images/forum/lev9.png and 75/e107_images/forum/lev9.png differ
Files 6171/e107_images/forum/main_admin.png and 75/e107_images/forum/main_admin.png differ
Files 6171/e107_images/forum/moderator.png and 75/e107_images/forum/moderator.png differ
Files 6171/e107_images/forum/msn.png and 75/e107_images/forum/msn.png differ
Files 6171/e107_images/forum/new.png and 75/e107_images/forum/new.png differ
Files 6171/e107_images/forum/new_popular.gif and 75/e107_images/forum/new_popular.gif differ
Files 6171/e107_images/forum/new_small.png and 75/e107_images/forum/new_small.png differ
Files 6171/e107_images/forum/newthread_alt.png and 75/e107_images/forum/newthread_alt.png differ
Files 6171/e107_images/forum/newthread.png and 75/e107_images/forum/newthread.png differ
Files 6171/e107_images/forum/nonew.png and 75/e107_images/forum/nonew.png differ
Files 6171/e107_images/forum/nonew_popular.gif and 75/e107_images/forum/nonew_popular.gif differ
Files 6171/e107_images/forum/nonew_small.png and 75/e107_images/forum/nonew_small.png differ
Files 6171/e107_images/forum/pm.png and 75/e107_images/forum/pm.png differ
Files 6171/e107_images/forum/post2.png and 75/e107_images/forum/post2.png differ
Files 6171/e107_images/forum/post.png and 75/e107_images/forum/post.png differ
Files 6171/e107_images/forum/profile.png and 75/e107_images/forum/profile.png differ
Files 6171/e107_images/forum/quote.png and 75/e107_images/forum/quote.png differ
Files 6171/e107_images/forum/reply_alt.png and 75/e107_images/forum/reply_alt.png differ
Files 6171/e107_images/forum/reply.png and 75/e107_images/forum/reply.png differ
Files 6171/e107_images/forum/report.png and 75/e107_images/forum/report.png differ
Files 6171/e107_images/forum/stickyclosed.png and 75/e107_images/forum/stickyclosed.png differ
Files 6171/e107_images/forum/sticky.png and 75/e107_images/forum/sticky.png differ
Files 6171/e107_images/forum/template1.png and 75/e107_images/forum/template1.png differ
Files 6171/e107_images/forum/template2.png and 75/e107_images/forum/template2.png differ
Files 6171/e107_images/forum/template3.png and 75/e107_images/forum/template3.png differ
Files 6171/e107_images/forum/template4.png and 75/e107_images/forum/template4.png differ
Files 6171/e107_images/forum/template5.png and 75/e107_images/forum/template5.png differ
Files 6171/e107_images/forum/template6.png and 75/e107_images/forum/template6.png differ
Files 6171/e107_images/forum/template7.png and 75/e107_images/forum/template7.png differ
Files 6171/e107_images/forum/website.png and 75/e107_images/forum/website.png differ
Files 6171/e107_images/generic/access.png and 75/e107_images/generic/access.png differ
Files 6171/e107_images/generic/admin.gif and 75/e107_images/generic/admin.gif differ
Files 6171/e107_images/generic/aim.png and 75/e107_images/generic/aim.png differ
Files 6171/e107_images/generic/article.png and 75/e107_images/generic/article.png differ
Files 6171/e107_images/generic/attach1.png and 75/e107_images/generic/attach1.png differ
Files 6171/e107_images/generic/banned.gif and 75/e107_images/generic/banned.gif differ
Files 6171/e107_images/generic/bar.png and 75/e107_images/generic/bar.png differ
Files 6171/e107_images/generic/bbcode/blockquote.png and 75/e107_images/generic/bbcode/blockquote.png differ
Files 6171/e107_images/generic/bbcode/bold.png and 75/e107_images/generic/bbcode/bold.png differ
Files 6171/e107_images/generic/bbcode/center.png and 75/e107_images/generic/bbcode/center.png differ
Files 6171/e107_images/generic/bbcode/code.png and 75/e107_images/generic/bbcode/code.png differ
Files 6171/e107_images/generic/bbcode/fontcol.png and 75/e107_images/generic/bbcode/fontcol.png differ
Files 6171/e107_images/generic/bbcode/fontsize.png and 75/e107_images/generic/bbcode/fontsize.png differ
Files 6171/e107_images/generic/bbcode/image.png and 75/e107_images/generic/bbcode/image.png differ
Files 6171/e107_images/generic/bbcode/italic.png and 75/e107_images/generic/bbcode/italic.png differ
Files 6171/e107_images/generic/bbcode/left.png and 75/e107_images/generic/bbcode/left.png differ
Files 6171/e107_images/generic/bbcode/link.png and 75/e107_images/generic/bbcode/link.png differ
Files 6171/e107_images/generic/bbcode/list.png and 75/e107_images/generic/bbcode/list.png differ
Files 6171/e107_images/generic/bbcode/newpage.png and 75/e107_images/generic/bbcode/newpage.png differ
Files 6171/e107_images/generic/bbcode/prefile.png and 75/e107_images/generic/bbcode/prefile.png differ
Files 6171/e107_images/generic/bbcode/preimage.png and 75/e107_images/generic/bbcode/preimage.png differ
Files 6171/e107_images/generic/bbcode/right.png and 75/e107_images/generic/bbcode/right.png differ
Files 6171/e107_images/generic/bbcode/template.png and 75/e107_images/generic/bbcode/template.png differ
Files 6171/e107_images/generic/bbcode/underline.png and 75/e107_images/generic/bbcode/underline.png differ
Files 6171/e107_images/generic/bday.png and 75/e107_images/generic/bday.png differ
Files 6171/e107_images/generic/blankbutton.png and 75/e107_images/generic/blankbutton.png differ
Files 6171/e107_images/generic/blank.gif and 75/e107_images/generic/blank.gif differ
Files 6171/e107_images/generic/blocked.png and 75/e107_images/generic/blocked.png differ
Files 6171/e107_images/generic/broken.png and 75/e107_images/generic/broken.png differ
Files 6171/e107_images/generic/chatlink.png and 75/e107_images/generic/chatlink.png differ
Files 6171/e107_images/generic/code_bg.png and 75/e107_images/generic/code_bg.png differ
Files 6171/e107_images/generic/cred.png and 75/e107_images/generic/cred.png differ
Files 6171/e107_images/generic/dark/answer.png and 75/e107_images/generic/dark/answer.png differ
Files 6171/e107_images/generic/dark/arrow.png and 75/e107_images/generic/dark/arrow.png differ
Files 6171/e107_images/generic/dark/download.png and 75/e107_images/generic/dark/download.png differ
Files 6171/e107_images/generic/dark/edit.png and 75/e107_images/generic/dark/edit.png differ
Files 6171/e107_images/generic/dark/email.png and 75/e107_images/generic/dark/email.png differ
Files 6171/e107_images/generic/dark/file.png and 75/e107_images/generic/dark/file.png differ
Files 6171/e107_images/generic/dark/image.png and 75/e107_images/generic/dark/image.png differ
Files 6171/e107_images/generic/dark/new_comments.png and 75/e107_images/generic/dark/new_comments.png differ
Files 6171/e107_images/generic/dark/new.png and 75/e107_images/generic/dark/new.png differ
Files 6171/e107_images/generic/dark/newsedit.png and 75/e107_images/generic/dark/newsedit.png differ
Files 6171/e107_images/generic/dark/nonew_comments.png and 75/e107_images/generic/dark/nonew_comments.png differ
Files 6171/e107_images/generic/dark/password.png and 75/e107_images/generic/dark/password.png differ
Files 6171/e107_images/generic/dark/printer.png and 75/e107_images/generic/dark/printer.png differ
Files 6171/e107_images/generic/dark/question.png and 75/e107_images/generic/dark/question.png differ
Files 6171/e107_images/generic/dark/search_advanced.png and 75/e107_images/generic/dark/search_advanced.png differ
Files 6171/e107_images/generic/dark/search_basic.png and 75/e107_images/generic/dark/search_basic.png differ
Files 6171/e107_images/generic/dark/search_enhanced.png and 75/e107_images/generic/dark/search_enhanced.png differ
Files 6171/e107_images/generic/dark/sticky.png and 75/e107_images/generic/dark/sticky.png differ
Files 6171/e107_images/generic/dark/user_select.png and 75/e107_images/generic/dark/user_select.png differ
Files 6171/e107_images/generic/delete.png and 75/e107_images/generic/delete.png differ
Files 6171/e107_images/generic/down.gif and 75/e107_images/generic/down.gif differ
Files 6171/e107_images/generic/download2.png and 75/e107_images/generic/download2.png differ
Files 6171/e107_images/generic/download.png and 75/e107_images/generic/download.png differ
Files 6171/e107_images/generic/down.png and 75/e107_images/generic/down.png differ
Files 6171/e107_images/generic/e107.gif and 75/e107_images/generic/e107.gif differ
Files 6171/e107_images/generic/e107.png and 75/e107_images/generic/e107.png differ
Files 6171/e107_images/generic/edit.png and 75/e107_images/generic/edit.png differ
Files 6171/e107_images/generic/email.png and 75/e107_images/generic/email.png differ
Files 6171/e107_images/generic/English/but_create.png and 75/e107_images/generic/English/but_create.png differ
Files 6171/e107_images/generic/English/but_delete.png and 75/e107_images/generic/English/but_delete.png differ
Files 6171/e107_images/generic/extand2_ico.png and 75/e107_images/generic/extand2_ico.png differ
Files 6171/e107_images/generic/extand_ico.png and 75/e107_images/generic/extand_ico.png differ
Files 6171/e107_images/generic/friend.gif and 75/e107_images/generic/friend.gif differ
Files 6171/e107_images/generic/hme2.png and 75/e107_images/generic/hme2.png differ
Files 6171/e107_images/generic/hme.png and 75/e107_images/generic/hme.png differ
Files 6171/e107_images/generic/icq.png and 75/e107_images/generic/icq.png differ
Files 6171/e107_images/generic/installed.png and 75/e107_images/generic/installed.png differ
Files 6171/e107_images/generic/left.gif and 75/e107_images/generic/left.gif differ
Files 6171/e107_images/generic/link.png and 75/e107_images/generic/link.png differ
Files 6171/e107_images/generic/lite/answer.png and 75/e107_images/generic/lite/answer.png differ
Files 6171/e107_images/generic/lite/arrow.png and 75/e107_images/generic/lite/arrow.png differ
Files 6171/e107_images/generic/lite/download.png and 75/e107_images/generic/lite/download.png differ
Files 6171/e107_images/generic/lite/edit.png and 75/e107_images/generic/lite/edit.png differ
Files 6171/e107_images/generic/lite/email.png and 75/e107_images/generic/lite/email.png differ
Files 6171/e107_images/generic/lite/file.png and 75/e107_images/generic/lite/file.png differ
Files 6171/e107_images/generic/lite/image.png and 75/e107_images/generic/lite/image.png differ
Files 6171/e107_images/generic/lite/new_comments.png and 75/e107_images/generic/lite/new_comments.png differ
Files 6171/e107_images/generic/lite/new.png and 75/e107_images/generic/lite/new.png differ
Files 6171/e107_images/generic/lite/newsedit.png and 75/e107_images/generic/lite/newsedit.png differ
Files 6171/e107_images/generic/lite/nonew_comments.png and 75/e107_images/generic/lite/nonew_comments.png differ
Files 6171/e107_images/generic/lite/password.png and 75/e107_images/generic/lite/password.png differ
Files 6171/e107_images/generic/lite/printer.png and 75/e107_images/generic/lite/printer.png differ
Files 6171/e107_images/generic/lite/question.png and 75/e107_images/generic/lite/question.png differ
Files 6171/e107_images/generic/lite/search_advanced.png and 75/e107_images/generic/lite/search_advanced.png differ
Files 6171/e107_images/generic/lite/search_basic.png and 75/e107_images/generic/lite/search_basic.png differ
Files 6171/e107_images/generic/lite/search_enhanced.png and 75/e107_images/generic/lite/search_enhanced.png differ
Files 6171/e107_images/generic/lite/sticky.png and 75/e107_images/generic/lite/sticky.png differ
Files 6171/e107_images/generic/lite/user_select.png and 75/e107_images/generic/lite/user_select.png differ
Files 6171/e107_images/generic/location.png and 75/e107_images/generic/location.png differ
Files 6171/e107_images/generic/mainadmin.gif and 75/e107_images/generic/mainadmin.gif differ
Files 6171/e107_images/generic/move.png and 75/e107_images/generic/move.png differ
Files 6171/e107_images/generic/msn.png and 75/e107_images/generic/msn.png differ
Files 6171/e107_images/generic/new_comments.png and 75/e107_images/generic/new_comments.png differ
Files 6171/e107_images/generic/new.png and 75/e107_images/generic/new.png differ
Files 6171/e107_images/generic/newsdelete.png and 75/e107_images/generic/newsdelete.png differ
Files 6171/e107_images/generic/newsedit.png and 75/e107_images/generic/newsedit.png differ
Files 6171/e107_images/generic/noaccess.png and 75/e107_images/generic/noaccess.png differ
Files 6171/e107_images/generic/noinstall.png and 75/e107_images/generic/noinstall.png differ
Files 6171/e107_images/generic/nonew_comments.png and 75/e107_images/generic/nonew_comments.png differ
Files 6171/e107_images/generic/not_verified.gif and 75/e107_images/generic/not_verified.gif differ
Files 6171/e107_images/generic/off.gif and 75/e107_images/generic/off.gif differ
Files 6171/e107_images/generic/off.png and 75/e107_images/generic/off.png differ
Files 6171/e107_images/generic/php-small-trans-light.gif and 75/e107_images/generic/php-small-trans-light.gif differ
Files 6171/e107_images/generic/placeholder.png and 75/e107_images/generic/placeholder.png differ
Files 6171/e107_images/generic/plugin.png and 75/e107_images/generic/plugin.png differ
Files 6171/e107_images/generic/poweredbymysql-88.png and 75/e107_images/generic/poweredbymysql-88.png differ
Files 6171/e107_images/generic/printer.gif and 75/e107_images/generic/printer.gif differ
Files 6171/e107_images/generic/right.gif and 75/e107_images/generic/right.gif differ
Files 6171/e107_images/generic/rname.png and 75/e107_images/generic/rname.png differ
Files 6171/e107_images/generic/star1.gif and 75/e107_images/generic/star1.gif differ
Files 6171/e107_images/generic/star2.gif and 75/e107_images/generic/star2.gif differ
Files 6171/e107_images/generic/star3.gif and 75/e107_images/generic/star3.gif differ
Files 6171/e107_images/generic/star4.gif and 75/e107_images/generic/star4.gif differ
Files 6171/e107_images/generic/uninstalled.png and 75/e107_images/generic/uninstalled.png differ
Files 6171/e107_images/generic/up.gif and 75/e107_images/generic/up.gif differ
Files 6171/e107_images/generic/upgrade.png and 75/e107_images/generic/upgrade.png differ
Files 6171/e107_images/generic/up.png and 75/e107_images/generic/up.png differ
Files 6171/e107_images/generic/user.png and 75/e107_images/generic/user.png differ
Files 6171/e107_images/generic/valid-xhtml11.png and 75/e107_images/generic/valid-xhtml11.png differ
Files 6171/e107_images/generic/valid-xhtml11_small.png and 75/e107_images/generic/valid-xhtml11_small.png differ
Files 6171/e107_images/generic/vcss.png and 75/e107_images/generic/vcss.png differ
Files 6171/e107_images/generic/vcss_small.png and 75/e107_images/generic/vcss_small.png differ
Files 6171/e107_images/icons/download_32.png and 75/e107_images/icons/download_32.png differ
Files 6171/e107_images/icons/folder_32.png and 75/e107_images/icons/folder_32.png differ
Files 6171/e107_images/icons/folder.png and 75/e107_images/icons/folder.png differ
Files 6171/e107_images/icons/folderx_32.png and 75/e107_images/icons/folderx_32.png differ
Files 6171/e107_images/icons/folderx.png and 75/e107_images/icons/folderx.png differ
Files 6171/e107_images/icons/html.png and 75/e107_images/icons/html.png differ
Files 6171/e107_images/icons/icon10.png and 75/e107_images/icons/icon10.png differ
Files 6171/e107_images/icons/icon11.png and 75/e107_images/icons/icon11.png differ
Files 6171/e107_images/icons/icon12.png and 75/e107_images/icons/icon12.png differ
Files 6171/e107_images/icons/icon13.png and 75/e107_images/icons/icon13.png differ
Files 6171/e107_images/icons/icon14.png and 75/e107_images/icons/icon14.png differ
Files 6171/e107_images/icons/icon15.png and 75/e107_images/icons/icon15.png differ
Files 6171/e107_images/icons/icon16.png and 75/e107_images/icons/icon16.png differ
Files 6171/e107_images/icons/icon17.png and 75/e107_images/icons/icon17.png differ
Files 6171/e107_images/icons/icon18.png and 75/e107_images/icons/icon18.png differ
Files 6171/e107_images/icons/icon19.png and 75/e107_images/icons/icon19.png differ
Files 6171/e107_images/icons/icon1.png and 75/e107_images/icons/icon1.png differ
Files 6171/e107_images/icons/icon20.png and 75/e107_images/icons/icon20.png differ
Files 6171/e107_images/icons/icon21.png and 75/e107_images/icons/icon21.png differ
Files 6171/e107_images/icons/icon22.png and 75/e107_images/icons/icon22.png differ
Files 6171/e107_images/icons/icon23.png and 75/e107_images/icons/icon23.png differ
Files 6171/e107_images/icons/icon24.png and 75/e107_images/icons/icon24.png differ
Files 6171/e107_images/icons/icon25.png and 75/e107_images/icons/icon25.png differ
Files 6171/e107_images/icons/icon26.png and 75/e107_images/icons/icon26.png differ
Files 6171/e107_images/icons/icon2.png and 75/e107_images/icons/icon2.png differ
Files 6171/e107_images/icons/icon3.png and 75/e107_images/icons/icon3.png differ
Files 6171/e107_images/icons/icon4.png and 75/e107_images/icons/icon4.png differ
Files 6171/e107_images/icons/icon5.png and 75/e107_images/icons/icon5.png differ
Files 6171/e107_images/icons/icon6.png and 75/e107_images/icons/icon6.png differ
Files 6171/e107_images/icons/icon7.png and 75/e107_images/icons/icon7.png differ
Files 6171/e107_images/icons/icon8.png and 75/e107_images/icons/icon8.png differ
Files 6171/e107_images/icons/icon9.png and 75/e107_images/icons/icon9.png differ
Files 6171/e107_images/install/install1.png and 75/e107_images/install/install1.png differ
Files 6171/e107_images/install/install2.png and 75/e107_images/install/install2.png differ
Files 6171/e107_images/link_icons/admin.png and 75/e107_images/link_icons/admin.png differ
Files 6171/e107_images/link_icons/bullet2.gif and 75/e107_images/link_icons/bullet2.gif differ
Files 6171/e107_images/link_icons/icon1.png and 75/e107_images/link_icons/icon1.png differ
Files 6171/e107_images/link_icons/icon2.png and 75/e107_images/link_icons/icon2.png differ
Files 6171/e107_images/link_icons/icon3.png and 75/e107_images/link_icons/icon3.png differ
Files 6171/e107_images/link_icons/icon4.png and 75/e107_images/link_icons/icon4.png differ
Files 6171/e107_images/link_icons/icon5.png and 75/e107_images/link_icons/icon5.png differ
Files 6171/e107_images/link_icons/star2.gif and 75/e107_images/link_icons/star2.gif differ
Files 6171/e107_images/link_icons/star4.gif and 75/e107_images/link_icons/star4.gif differ
Files 6171/e107_images/log/beos.png and 75/e107_images/log/beos.png differ
Files 6171/e107_images/log/explorer.png and 75/e107_images/log/explorer.png differ
Files 6171/e107_images/log/firebird.png and 75/e107_images/log/firebird.png differ
Files 6171/e107_images/log/firefox.png and 75/e107_images/log/firefox.png differ
Files 6171/e107_images/log/freebsd.png and 75/e107_images/log/freebsd.png differ
Files 6171/e107_images/log/konqueror.png and 75/e107_images/log/konqueror.png differ
Files 6171/e107_images/log/linux.png and 75/e107_images/log/linux.png differ
Files 6171/e107_images/log/lynx.png and 75/e107_images/log/lynx.png differ
Files 6171/e107_images/log/mac.png and 75/e107_images/log/mac.png differ
Files 6171/e107_images/log/mozilla.png and 75/e107_images/log/mozilla.png differ
Files 6171/e107_images/log/netbsd.png and 75/e107_images/log/netbsd.png differ
Files 6171/e107_images/log/netcaptor.png and 75/e107_images/log/netcaptor.png differ
Files 6171/e107_images/log/netscape.png and 75/e107_images/log/netscape.png differ
Files 6171/e107_images/log/openbsd.png and 75/e107_images/log/openbsd.png differ
Files 6171/e107_images/log/opera.png and 75/e107_images/log/opera.png differ
Files 6171/e107_images/log/robot.png and 75/e107_images/log/robot.png differ
Files 6171/e107_images/log/spiders.png and 75/e107_images/log/spiders.png differ
Files 6171/e107_images/log/sunos.png and 75/e107_images/log/sunos.png differ
Files 6171/e107_images/log/unix.png and 75/e107_images/log/unix.png differ
Files 6171/e107_images/log/unknown.png and 75/e107_images/log/unknown.png differ
Files 6171/e107_images/log/unspecified.png and 75/e107_images/log/unspecified.png differ
Files 6171/e107_images/log/web%20indexing%20robot.png and 75/e107_images/log/web%20indexing%20robot.png differ
Files 6171/e107_images/log/windows.png and 75/e107_images/log/windows.png differ
Files 6171/e107_images/logo3.png and 75/e107_images/logo3.png differ
Files 6171/e107_images/logo.png and 75/e107_images/logo.png differ
Files 6171/e107_images/logo_template_large.png and 75/e107_images/logo_template_large.png differ
Files 6171/e107_images/logo_template.png and 75/e107_images/logo_template.png differ
Files 6171/e107_images/newsicons/admin.png and 75/e107_images/newsicons/admin.png differ
Files 6171/e107_images/newsicons/icon1.png and 75/e107_images/newsicons/icon1.png differ
Files 6171/e107_images/newsicons/icon2.png and 75/e107_images/newsicons/icon2.png differ
Files 6171/e107_images/newsicons/icon3.png and 75/e107_images/newsicons/icon3.png differ
Files 6171/e107_images/newsicons/icon4.png and 75/e107_images/newsicons/icon4.png differ
Files 6171/e107_images/newsicons/icon5.png and 75/e107_images/newsicons/icon5.png differ
Files 6171/e107_images/newspost_images/welcome.png and 75/e107_images/newspost_images/welcome.png differ
Files 6171/e107_images/pcmag.png and 75/e107_images/pcmag.png differ
Files 6171/e107_images/rate/1.png and 75/e107_images/rate/1.png differ
Files 6171/e107_images/rate/2.png and 75/e107_images/rate/2.png differ
Files 6171/e107_images/rate/3.png and 75/e107_images/rate/3.png differ
Files 6171/e107_images/rate/4.png and 75/e107_images/rate/4.png differ
Files 6171/e107_images/rate/5.png and 75/e107_images/rate/5.png differ
Files 6171/e107_images/rate/6.png and 75/e107_images/rate/6.png differ
Files 6171/e107_images/rate/7.png and 75/e107_images/rate/7.png differ
Files 6171/e107_images/rate/8.png and 75/e107_images/rate/8.png differ
Files 6171/e107_images/rate/9.png and 75/e107_images/rate/9.png differ
Files 6171/e107_images/rate/box/box10.png and 75/e107_images/rate/box/box10.png differ
Files 6171/e107_images/rate/box/box1.png and 75/e107_images/rate/box/box1.png differ
Files 6171/e107_images/rate/box/box2.png and 75/e107_images/rate/box/box2.png differ
Files 6171/e107_images/rate/box/box3.png and 75/e107_images/rate/box/box3.png differ
Files 6171/e107_images/rate/box/box4.png and 75/e107_images/rate/box/box4.png differ
Files 6171/e107_images/rate/box/box5.png and 75/e107_images/rate/box/box5.png differ
Files 6171/e107_images/rate/box/box6.png and 75/e107_images/rate/box/box6.png differ
Files 6171/e107_images/rate/box/box7.png and 75/e107_images/rate/box/box7.png differ
Files 6171/e107_images/rate/box/box8.png and 75/e107_images/rate/box/box8.png differ
Files 6171/e107_images/rate/box/box9.png and 75/e107_images/rate/box/box9.png differ
Files 6171/e107_images/rate/boxend.png and 75/e107_images/rate/boxend.png differ
Files 6171/e107_images/rate/box.png and 75/e107_images/rate/box.png differ
Files 6171/e107_images/rate/dark/1.png and 75/e107_images/rate/dark/1.png differ
Files 6171/e107_images/rate/dark/2.png and 75/e107_images/rate/dark/2.png differ
Files 6171/e107_images/rate/dark/3.png and 75/e107_images/rate/dark/3.png differ
Files 6171/e107_images/rate/dark/4.png and 75/e107_images/rate/dark/4.png differ
Files 6171/e107_images/rate/dark/5.png and 75/e107_images/rate/dark/5.png differ
Files 6171/e107_images/rate/dark/6.png and 75/e107_images/rate/dark/6.png differ
Files 6171/e107_images/rate/dark/7.png and 75/e107_images/rate/dark/7.png differ
Files 6171/e107_images/rate/dark/8.png and 75/e107_images/rate/dark/8.png differ
Files 6171/e107_images/rate/dark/9.png and 75/e107_images/rate/dark/9.png differ
Files 6171/e107_images/rate/dark/lev10.png and 75/e107_images/rate/dark/lev10.png differ
Files 6171/e107_images/rate/dark/lev1.png and 75/e107_images/rate/dark/lev1.png differ
Files 6171/e107_images/rate/dark/lev2.png and 75/e107_images/rate/dark/lev2.png differ
Files 6171/e107_images/rate/dark/lev3.png and 75/e107_images/rate/dark/lev3.png differ
Files 6171/e107_images/rate/dark/lev4.png and 75/e107_images/rate/dark/lev4.png differ
Files 6171/e107_images/rate/dark/lev5.png and 75/e107_images/rate/dark/lev5.png differ
Files 6171/e107_images/rate/dark/lev6.png and 75/e107_images/rate/dark/lev6.png differ
Files 6171/e107_images/rate/dark/lev7.png and 75/e107_images/rate/dark/lev7.png differ
Files 6171/e107_images/rate/dark/lev8.png and 75/e107_images/rate/dark/lev8.png differ
Files 6171/e107_images/rate/dark/lev9.png and 75/e107_images/rate/dark/lev9.png differ
Files 6171/e107_images/rate/dark/star.png and 75/e107_images/rate/dark/star.png differ
Files 6171/e107_images/rate/empty.png and 75/e107_images/rate/empty.png differ
Files 6171/e107_images/rate/lite/1.png and 75/e107_images/rate/lite/1.png differ
Files 6171/e107_images/rate/lite/2.png and 75/e107_images/rate/lite/2.png differ
Files 6171/e107_images/rate/lite/3.png and 75/e107_images/rate/lite/3.png differ
Files 6171/e107_images/rate/lite/4.png and 75/e107_images/rate/lite/4.png differ
Files 6171/e107_images/rate/lite/5.png and 75/e107_images/rate/lite/5.png differ
Files 6171/e107_images/rate/lite/6.png and 75/e107_images/rate/lite/6.png differ
Files 6171/e107_images/rate/lite/7.png and 75/e107_images/rate/lite/7.png differ
Files 6171/e107_images/rate/lite/8.png and 75/e107_images/rate/lite/8.png differ
Files 6171/e107_images/rate/lite/9.png and 75/e107_images/rate/lite/9.png differ
Files 6171/e107_images/rate/lite/lev10.png and 75/e107_images/rate/lite/lev10.png differ
Files 6171/e107_images/rate/lite/lev1.png and 75/e107_images/rate/lite/lev1.png differ
Files 6171/e107_images/rate/lite/lev2.png and 75/e107_images/rate/lite/lev2.png differ
Files 6171/e107_images/rate/lite/lev3.png and 75/e107_images/rate/lite/lev3.png differ
Files 6171/e107_images/rate/lite/lev4.png and 75/e107_images/rate/lite/lev4.png differ
Files 6171/e107_images/rate/lite/lev5.png and 75/e107_images/rate/lite/lev5.png differ
Files 6171/e107_images/rate/lite/lev6.png and 75/e107_images/rate/lite/lev6.png differ
Files 6171/e107_images/rate/lite/lev7.png and 75/e107_images/rate/lite/lev7.png differ
Files 6171/e107_images/rate/lite/lev8.png and 75/e107_images/rate/lite/lev8.png differ
Files 6171/e107_images/rate/lite/lev9.png and 75/e107_images/rate/lite/lev9.png differ
Files 6171/e107_images/rate/lite/star.png and 75/e107_images/rate/lite/star.png differ
Files 6171/e107_images/rate/star.png and 75/e107_images/rate/star.png differ
Files 6171/e107_images/splash.jpg and 75/e107_images/splash.jpg differ
diff -ruN 6171/e107_images/thumb.php 75/e107_images/thumb.php
--- 6171/e107_images/thumb.php	2004-04-27 12:16:52.000000000 -0500
+++ 75/e107_images/thumb.php	2005-08-23 04:36:30.000000000 -0500
@@ -1,29 +1,63 @@
-<?php
-
-/*
- Usage: simply replace your <img src='filename.jpg'
- with
- <img src='".e_IMAGE."thumb.php?filename.jpg+size"' />
- or
- <img src='".e_IMAGE."thumb.php?<full path to file>/filename.jpg+size"' />
- eg <img src='".e_IMAGE."thumb.php?home/images/myfilename.jpg+100)"' />
-
-*/
-
-require_once("../class2.php");
-require_once(e_HANDLER."resize_handler.php");
-
-    if (e_QUERY){
-        $tmp = explode("+",rawurldecode(e_QUERY));
-        if(preg_match("#^/#",$tmp[0]) || preg_match("#.:#",$tmp[0])){
-            $source = $tmp[0];
-        }else{
-            $source = "../".str_replace("../","",$tmp[0]);
-        }
-
-        $newsize = $tmp[1];
-        if(!resize_image($source, "stdout", $newsize)){
-            echo "Couldn't find: ".$source;
-        }
-    }
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_images/thumb.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/08/23 09:36:30 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+/*
+ Usage: simply replace your <img src='filename.jpg'
+ with
+ <img src='".e_IMAGE."thumb.php?filename.jpg+size"' />
+ or
+ <img src='".e_IMAGE."thumb.php?<full path to file>/filename.jpg+size"' />
+ eg <img src='".e_IMAGE."thumb.php?home/images/myfilename.jpg+100)"' />
+
+*/
+
+require_once("../class2.php");
+require_once(e_HANDLER."resize_handler.php");
+
+// var 3.
+// 1= newspost images/preview
+// 2= 
+
+	if (e_QUERY){
+		$tmp = explode("+",rawurldecode(e_QUERY));
+		if(strpos($tmp[0], "/") === 0 || strpos($tmp[0], ":") >= 1){
+			$source = $tmp[0];
+		}else{
+			$source = "../".str_replace("../","",$tmp[0]);
+		}
+
+
+
+
+		$newsize = $tmp[1];
+		if(!file_exists(e_IMAGE."newspost_images/preview/preview_".basename($source))){
+
+		  	if(!resize_image($source, e_IMAGE."newspost_images/preview/preview_".basename($source), $newsize)){
+		  		echo "Couldn't find: ".$source;
+		  	}
+		}
+
+
+		header("Content-type: image/jpg");
+		$imagedata = file_get_contents(e_IMAGE."newspost_images/preview/preview_".basename($source));
+		echo $imagedata;
+		exit;
+
+
+	}
 ?>
\ No newline at end of file
Files 6171/e107_images/user_icons/realname_dark.png and 75/e107_images/user_icons/realname_dark.png differ
Files 6171/e107_images/user_icons/realname_lite.png and 75/e107_images/user_icons/realname_lite.png differ
Files 6171/e107_images/user_icons/user_aim.png and 75/e107_images/user_icons/user_aim.png differ
Files 6171/e107_images/user_icons/user_birthday_dark.png and 75/e107_images/user_icons/user_birthday_dark.png differ
Files 6171/e107_images/user_icons/user_birthday_lite.png and 75/e107_images/user_icons/user_birthday_lite.png differ
Files 6171/e107_images/user_icons/user_dark.png and 75/e107_images/user_icons/user_dark.png differ
Files 6171/e107_images/user_icons/user_homepage.png and 75/e107_images/user_icons/user_homepage.png differ
Files 6171/e107_images/user_icons/user_icq.png and 75/e107_images/user_icons/user_icq.png differ
Files 6171/e107_images/user_icons/user_lite.png and 75/e107_images/user_icons/user_lite.png differ
Files 6171/e107_images/user_icons/user_location.png and 75/e107_images/user_icons/user_location.png differ
Files 6171/e107_images/user_icons/user_msn.png and 75/e107_images/user_icons/user_msn.png differ
Files 6171/e107_images/user_icons/user_realname_dark.png and 75/e107_images/user_icons/user_realname_dark.png differ
Files 6171/e107_images/user_icons/user_realname_lite.png and 75/e107_images/user_icons/user_realname_lite.png differ
Files 6171/e107_images/user_icons/user_star_dark.png and 75/e107_images/user_icons/user_star_dark.png differ
Files 6171/e107_images/user_icons/user_star_lite.png and 75/e107_images/user_icons/user_star_lite.png differ
Files 6171/e107_install/images/blank.gif and 75/e107_install/images/blank.gif differ
Files 6171/e107_install/images/bottomleft.png and 75/e107_install/images/bottomleft.png differ
Files 6171/e107_install/images/bottom.png and 75/e107_install/images/bottom.png differ
Files 6171/e107_install/images/bottomright.png and 75/e107_install/images/bottomright.png differ
Files 6171/e107_install/images/button.png and 75/e107_install/images/button.png differ
Files 6171/e107_install/images/capdark.png and 75/e107_install/images/capdark.png differ
Files 6171/e107_install/images/capleft.png and 75/e107_install/images/capleft.png differ
Files 6171/e107_install/images/caplight.png and 75/e107_install/images/caplight.png differ
Files 6171/e107_install/images/capright.png and 75/e107_install/images/capright.png differ
Files 6171/e107_install/images/captransition.png and 75/e107_install/images/captransition.png differ
Files 6171/e107_install/images/left.png and 75/e107_install/images/left.png differ
Files 6171/e107_install/images/pspbrwse.jbf and 75/e107_install/images/pspbrwse.jbf differ
Files 6171/e107_install/images/right.png and 75/e107_install/images/right.png differ
Files 6171/e107_install/images/topleft.png and 75/e107_install/images/topleft.png differ
Files 6171/e107_install/images/top.png and 75/e107_install/images/top.png differ
Files 6171/e107_install/images/topright.png and 75/e107_install/images/topright.png differ
diff -ruN 6171/e107_install/style.css 75/e107_install/style.css
--- 6171/e107_install/style.css	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_install/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,384 +0,0 @@
-body {
-	font-size: 12px;
-	color: #000;
-	font-family: tahoma, verdana, arial, sans-serif;
-	background-color: #E9EAF5;
-	margin:50px; text-align:left;
-}
-a {
-	color: #716d6d;
-	text-decoration: underline;
-}
-a:hover {
-	color: #2a3236;
-	text-decoration: underline;
-}
-
-.smalltext {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#5d6e75;
-
-}
-.smallblacktext {
-	font: normal 11px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#000;
-}
-
-.indent{
-	padding: 3px 3px 3px 3px;
-	margin: 5px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #000060;
-	border: 1px solid;
-	background-color: #E3E2D7;
-	border-bottom: #FFFFFF 1px solid;
-	border-left: #000 1px solid;
-	border-right: #FFFFFF 1px solid;
-	border-top: #000 1px solid;
-}
-
-.defaulttext {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color:#000;
-}
-
-td {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 12px;
-	font-style: normal;
-	color:#000;
-	padding-bottom: 0px;
-	padding-left: 0px;
-	padding-right: 0px;
-	padding-top: 0px;
-	text-align:left;
-}
-
-blockquote {
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-style: italic;
-	color:#7e96ac;
-}
-.mediumtext {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 12px;
-	font-style: normal;
-	color:#000;
-}
-.captiontext {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 18px;
-	font-style: italic;
-	color:#000;
-}
-.tbox{
-	background-color: #fff;
-	border-bottom: #5e5d63 1px solid;
-	border-left: #5e5d63 1px solid;
-	border-right: #5e5d63 1px solid;
-	border-top: #5e5d63 1px solid;
-	padding-left: 2px;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-}
-.nextprev{
-	background-color: #eaeef2;
-	border: 1px solid #696C6C;
-	color: #000;
-	font: normal 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	padding : 2px, 2px, 2px, 2px;
-	background-image : url(images/button.png);
-}
-.button{
-	background-color: #eaeef2;
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	text-align:center;
-	background-image : url(images/button.png);
-}
-
-.np{
-	background-color: #eaeef2;
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 9px;
-	text-align:center;
-	padding-bottom : 2px;
-	padding-left : 2px;
-	padding-right : 2px;
-	padding-top : 2px;
-}
-
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding-bottom : 2px;
-	padding-left : 0px;
-	padding-right : 0px;
-	padding-top : 2px;
-}
-hr {
-	border-top: #666 1px solid;
-	border-bottom: #eee 1px solid;
-	height: 2px;
-	width: 92%;
-	text-align:center;
-}
-.border {
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	background-color: transparent;
-}
-
-.border2 {
-	border-bottom: #D5D5D5 1px solid;
-	border-left: #D5D5D5 1px solid;
-	border-right: #D5D5D5 1px solid;
-	border-top: #D5D5D5 1px solid;
-	background-color: transparent;
-}
-
-.border3 {
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	background-color: transparent;
-}
-.helpbox {
-	border: transparent;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
-
-.caption {
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	border-bottom: #363A44 1px solid;
-	border-left: #8A96B3 1px solid;
-	border-right: #363A44 1px solid;
-	border-top: #8A96B3 1px solid;
-	background-color: #E1DFDF;
-	color: #000;
-	font-family: tahoma, arial, verdana, helvetica, sans-serif;
-	font-size: 13px;
-	background-image : url(images/cap1.png);
-}
-
-.caption2 {
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	background-color: transparent;
-	color: #243B3B;
-	font-family: tahoma, arial, verdana, helvetica, sans-serif;
-	font-size: 15px;
-	text-align:center;
-}
-.caption3 {
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	border-bottom: #C7C3C3 1px solid;
-	border-left: #fff 1px solid;
-	border-right: transparent;
-	border-top: #fff 1px solid;
-	background-color: #D5D5D5;
-	color: #000;
-	font-family: tahoma, arial, verdana, helvetica, sans-serif;
-	font-size: 13px;
-}
-
-.bodytable {
-	background-color: transparent;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color: #000;
-}
-
-.bodytable2 {
-	background-color: transparent;
-	border-bottom: #D5D5D5 1px solid;
-	border-left: #D5D5D5 1px solid;
-	border-right: #D5D5D5 1px solid;
-	border-top: #D5D5D5 1px solid;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color: #000;
-}
-
-.bodytable3 {
-	background-color: transparent;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color: #000;
-}
-
-p {
-	margin-top: 0px;
-	margin-bottom: 0px
-}
-
-.fborder {
-	border-bottom: #000000 1px solid;
-	border-left: #000000 1px solid;
-	border-right: #000000 1px solid;
-	border-top: #000000 1px solid;
-	background-color: #fff;
-	
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#000;
-	padding: 4px;
-	background-image : url(images/cap1.png);
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader2{
-	background-color: #EFEFEF;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader3{
-	background-color: #E3E1E1;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.forumborder{
-	border-bottom: #000080 1px solid;
-	border-left: #000080 1px solid;
-	border-right: #000080 1px solid;
-	border-top: #000080 1px solid;
-	background-color: transparent;
-}
-
-.fcaption {
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(images/fcap.png);
-	font-size: 12px;
-	color:#fff;
-}
-
-.captiontopleft{ width: 21px; background-image: url(images/topleft.png); }
-.captiontopmiddle{ width: 100%; background-repeat: repeat-x; background-image: url(images/top.png); }
-.captiontopright{ width: 8px; background-image: url(images/topright.png); }
-
-
-
-.captionleft{ width: 24px; background-image: url(images/capleft.png); }
-.captionbar{ background-repeat: repeat-x; padding-left: 4px; padding-right:6px; font-size: 10px; color: #fff; font-family: verdana, tahoma, arial, sans-serif; background-image: url(images/capdark.png);}
-.captionend{ width: 12px; background-image: url(images/captransition.png); }
-.captionmain{ width: 100%; background-repeat: repeat-x; background-image: url(images/caplight.png); }
-.captionright{ width: 11px; background-image: url(images/capright.png); }
-
-.bodyleft{ width: 3px; background-repeat: repeat-y; background-image: url(images/left.png); }
-.bodymain{ width: 100%; background: #F6F8F3; padding: 0px 0px 0px 0px; font-size: 12px; color: #000; font-family: verdana, tahoma, arial, sans-serif; vertical-align:top; }
-.bodyright{ width: 3px; background-repeat: repeat-y; background-image: url(images/right.png); }
-
-.bottomleft{ width: 12px; background-image: url(images/bottomleft.png); }
-.bottommain{ width: 100%; background-repeat: repeat-x; background-image: url(images/bottom.png);}
-.bottomright{ width: 12px; background-image: url(images/bottomright.png); }
-
-
-.installcaplarge{ font: 20px verdana, tahoma, arial, sans-serif; color:#fff; vertical-align:top }
-.installcapsmall{ font: 10px verdana, tahoma, arial, sans-serif; color:#fff; vertical-align:top }
-
-.install { font: 14px verdana, tahoma, arial, sans-serif; color:#000; vertical-align:top }
-.installpass { font: 14px verdana, tahoma, arial, sans-serif; color:#0000C0; vertical-align:top }
-.installfail { font: 14px verdana, tahoma, arial, sans-serif; color:#FF0000; vertical-align:top }
-
-.installbox1 { background-color: #E4E7F0; border: #C1C7DB 1px solid; font: 12px verdana, tahoma, arial, sans-serif; color:#000; vertical-align:middle }
-.installbox2 { background-color: #E4E7F0; border: #C1C7DB 1px solid; text-align:center; vertical-align:middle }
-.installboxpass { background-color: #E4E7F0; border: #C1C7DB 1px solid; text-align:center; vertical-align:top; font: 12px verdana, tahoma, arial, sans-serif; color:#0000C0 }
-.installboxfail { background-color: #E4E7F0; border: #C1C7DB 1px solid; text-align:center; vertical-align:middle; font: 12px verdana, tahoma, arial, sans-serif; color:#FF0000 }
-.installboxgeneric { background-color: #E4E7F0; border: #C1C7DB 1px solid; text-align:center; vertical-align:middle }
-
-
-.finfobar{
-	background-color: #CCC8C8;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-	background-image : url(forum/finfobar.png);
-}
-
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
-
-.topborder {
-	border-bottom: #000 1px solid;
-}
-
-.bottomborder {
-	border-top: #000 1px solid;
-	border-bottom: #000 1px solid;
-}
-
-.alttd{
-	background-color: #ECE0D8;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
\ No newline at end of file
diff -ruN 6171/e107_languages/Danish/lan_install.php 75/e107_languages/Danish/lan_install.php
--- 6171/e107_languages/Danish/lan_install.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/Danish/lan_install.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,77 +0,0 @@
-<?php
-
-/*
-Danish Translation File
-Author: Jan Ole laugesen
-Email: e107@tommerup.net
-*/
-
-define("INSLAN1", "Installations Fase");
-define("INSLAN2", "PHP / mySQL versions kontrol / fil tilladelses tjek");
-define("INSLAN3", "PHP Version");
-define("INSLAN4", "Fejl");
-define("INSLAN5", "<b>Du kre en version af PHP som ikke er kompatibel med e107<br />(e107 krver mindst version 4.1.0).</b><br /><br />Hvis du bruger en lokal server p din egen computer, bliver du nd til at at opgradere din<br />version of PHP for at fortstte, Se venligst <a href='http://php.net'>php.net</a> for yderligere instruktioner. Hvis du<br />forsger at installerer e107 p en hosted server skal du kontakte din udbyder<br />og bede dem om en opgradering af PHP for dig.<br />Frst herefter kan du vende tilbage til denne installation, efter en opgradering af din PHP version.");
-define("INSLAN6", "Script er stoppet.");
-define("INSLAN7", "Godkendt");
-define("INSLAN8", "mySQL Version");
-define("INSLAN9", "<b>e107 er ikke i stand til at fastsl hvilket mySQL version nummer du bruger.</b><br /><br /> Dette kan betyde at mySQL ikke er installeret, er oppe, eller <br />at der bruges en version som ikke tilbagegiver en korrekt information<br />nummer (v5.x er kendt for at have dette problem). Hvis det nste trin i denne installation<br />fejler, skal du tjekke din mySQL status.");
-define("INSLAN10", "Fil tilladelse");
-define("INSLAN11", "er skrivebeskyttet");
-define("INSLAN12", "mappen er skrivebeskyttet");
-define("INSLAN13", "Vr sikker p at rettighederne, er sat korrekt p de filer som er vist herover.<br />Tilladelser, kaldet chmod, br sttes til 777. For at stte de korrekte<br />betingelser, hjreklik p filen i dit FTP program og vlge Chmod eller<br />St skriverettigheder, derp skriv 777, hvis der kommer en dialog med bokse<br />da afmrk alle bokse.<br /><br />vr venlig igen at teste efter at indstillinger er ndret.");
-define("INSLAN14", "e107 installering");
-define("INSLAN15", "ALVORLIG FEJL");
-define("INSLAN16", "I hele processen var det ikke muligt at fastsl status p din mySQL installation,<br />Fortst venligst til nste trin.");
-define("INSLAN17", "Fortst");
-define("INSLAN18", "Test fil tilladelserne igen");
-define("INSLAN19", "Alle server test er gennemfrt uden problemer, Klik p knappen for at fortstte til nste trin");
-define("INSLAN20", "mySQL information");
-define("INSLAN21", "Angiv dine mySQL indstillinger her.<br />Hvis du har rettigheder til at lave ny database, kan du gre dette ved at afmrke boksen, hvis ikke skal du<br />oprette en database eller anvende en pre-instaleret database. <br />Hvis du kun har en database, brug da et foranstillet unikt navn, sledes at andre scripts kan bruge samme database.<br />Hvis du ikke kender dine mySQL oplysninger kontakt da din web udbyder.");
-define("INSLAN22", "mySQL Server");
-define("INSLAN23", "mySQL Brugernavn");
-define("INSLAN24", "mySQL Password");
-define("INSLAN25", "mySQL Database");
-define("INSLAN26", "Tabel unikt navn");
-define("INSLAN27", "Fejl");
-define("INSLAN28", "Fejl opstod tilfldigt");
-define("INSLAN29", "Du efterlod nskede felter blanke, udfyld venligst den manglende mySQL information");
-define("INSLAN30", "e107 var ikke i stand til at etablerer kontakt til mySQL, ved brug af de informationer du opgav.<br />G venligst tilbage til foregende side og kontrollerer at alle oplysninger er korrekt angivet.");
-define("INSLAN31", "mySQL kontrol");
-define("INSLAN32", "Forbindelse til mySQL er oprettet og godkendt.");
-define("INSLAN33", "Forsger at oprette database");
-define("INSLAN34", "Umuligt at oprette database, kontrollerer venligst at du har ret til at oprette database.");
-define("INSLAN35", "Databasen er oprettet.");
-define("INSLAN36", "Klik p knappen for at fortstte til nste trin.");
-
-
-define("INSLAN37", "Tilbage til foregende side");
-define("INSLAN38", "Administrator information");
-define("INSLAN39", "Angiv din hoved administrator brugernavn, password og e-mail adresse.<br />disse oplysninger vil blive brugt til at opn adgang til administration af systemet.<br />Husk at gemme oplysninger p et sikkert sted, gr disse tabt<br />kan de IKKE hentes igen.");
-define("INSLAN40", "Admin Navn");
-define("INSLAN41", "Admin Password");
-define("INSLAN42", "Bekrft Password");
-define("INSLAN43", "Admin E-mail Adresse");
-define("INSLAN44", "Du efterlod et nsket felt blankt, udfyld alle admin informationer.");
-define("INSLAN45", "De to passwords er ikke ens, prv igen.");
-define("INSLAN46", "det alder ikke til at vre en gyldig e-mail adresse, prv igen.");
-define("INSLAN47", "Alt er klar!");
-define("INSLAN48", "e107 har nu opsamlet alle informationer som er krvet for at frdiggre installationen.<br />Klik p knappen for at oprette database tabeller og indstte informationerne.");
-define("INSLAN49", "e107 Vr ude af stand til at gemme hoved konfigurations filen p din server <br />Kontrollerer at <b>e107_config.php</b> filen har de korrekte tilladelser ");
-define("INSLAN50", "Installation Udfrt!");
-define("INSLAN51", "Alt er udfrt");
-define("INSLAN52", "e107 er blevet oprettet og installeret!<br />Af sikkerheds hensyn br du nu stte fil rettigheder p<br /><b>e107_config.php</b> tilbage til 644.<br />Samt slette  /install.php fra din server, efter du har klikket p knappen herunder");
-define("INSLAN53", "Klik her for at g til din nye website!");
-define("INSLAN54", "Ej muligt at lse sql datafilen<br /><br />Vr sikker p at  <b>core_sql.php</b> er tilstede i <b>/e107_admin/sql</b> mappen.");
-define("INSLAN55", "e107 var ikke I stand til at oprette alle de ndvendige database tabeller.<br />Ryd op i databasen og ret alle problemer fr du prver igen.");
-define("INSLAN56", "Velkommen til din nye webside!");
-
-define("INSLAN57", "e107 er installeret og er nu klar til at blive brugt.<br />Din administration af siden er <a href='e107_admin/admin.php'>placeret her</a>, klik for at g til siden nu. Du skal bruge navn og password som du angav under installationsprocessen.");
-define("INSLAN58", "du finder FAQ og dokumentation her.");
-define("INSLAN59", "Tak fordi du bruger e107, vi hber det vil tilfredsstille dine website nsker og krav.\n(Du kan slette denne besked fra din administrationssektion.)");
-define("INSLAN60", "Afmrk for at oprette");
-define("INSLAN61", "mappe");
-define("INSLAN62", "eller");
-define("INSLAN63", "Fil tilladelses fejl");
-define("INSLAN64", "Denne fil er oprettet af installationssystemet.");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/Dutch/lan_install.php 75/e107_languages/Dutch/lan_install.php
--- 6171/e107_languages/Dutch/lan_install.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/Dutch/lan_install.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,77 +0,0 @@
-<?php
-
-/*
-Dutch Translation File
-Author: Eric Vanderfeesten (aka lisa)
-Email: lisa@eindhovenseschool.net
-*/
-
-define("INSLAN1", "Installatie Stadium");
-define("INSLAN2", "PHP / mySQL versie controle / bestandsrechten controle");
-define("INSLAN3", "PHP Versie");
-define("INSLAN4", "Mislukt");
-define("INSLAN5", "<b>U draait een versie van PHP die niet in combinatie met e107 draait<br />(e107 vereist minimaal versie 4.1.0).</b><br /><br />Indien u een lokale server op uw computer gebruikt, zal u uw versie van PHP<br />moeten vernieuwen om verder te gaan, zie <a href='http://php.net'>php.net</a> voor instructies. Indien u e107 probeert te installeren op een hosted server, zal u de<br />beheerders van de server moeten benaderen en vragen of zij de versie van PHP voor u willen vernieuwen.<br />Doorloop dit script opnieuw nadat u de versie van PHP heeft vernieuwd.");
-define("INSLAN6", "Script gepauseerd.");
-define("INSLAN7", "Geslaagd");
-define("INSLAN8", "mySQL Versie");
-define("INSLAN9", "<b>e107 was niet in staat het mySQL versie nummer te achterhalen.</b><br /><br />Dit kan betekenen dat mySQL niet is genstalleerd of niet draait, of<br />u kan een versie draaien die het versie nummer niet correct toont<br />(v5.x heeft dit probleem). Indien de volgende stap van de installatie<br />mislukt, dient u de status van mySQL te controleren.");
-define("INSLAN10", "Bestandsrechten");
-define("INSLAN11", "is niet beschrijfbaar");
-define("INSLAN12", "mappen zijn niet beschrijfbaar");
-define("INSLAN13", "Maak zeker dat de rechten voor de bestanden zoals hierboven getoond correct op de server<br />zijn ingesteld, de rechten dienen als 777 ingesteld te worden. Om de rechten<br /> in te stellen, kunt u rechtsklikken op het bestand in uw FTP programma en kiezen voor Chmod of<br />Zet bestandsrechten, typ dan 777 in, indien het dialoog dat verschijnt vinkhokjes heeft,<br />vink alle hokjes aan.<br /><br />Probeer het nogmaals na het correct instellen van de bestandsrechten.");
-define("INSLAN14", "e107 installeren");
-define("INSLAN15", "FATAAL PROBLEEM");
-define("INSLAN16", "Ondanks dat het niet mogelijk was de status van uw mySQL installatie te achterhalen,<br />kunt u door naar de volgende stap.");
-define("INSLAN17", "Ga door");
-define("INSLAN18", "Herhaal controle bestandsrechten");
-define("INSLAN19", "Alle server testen zijn geslaagd, klik op de knop om verder te gaan naar het volgende stadium");
-define("INSLAN20", "mySQL informatie");
-define("INSLAN21", "Vul uw mySQL instellingen hier in.<br />Indien u root rechten heeft, kunt u een nieuwe database aanmaken door het hokje aan te vinken, anders moet u een database maken of een reeds bestaande database gebruiken. <br />Indien u slechts n database heeft dient u een voorvoegsel te gebruiken zodat andere scripts dezelfde database kunnen delen.<br />Indien u uw mySQL instellingen niet weet, dient u uw webbeheerder te benaderen.");
-define("INSLAN22", "mySQL Server");
-define("INSLAN23", "mySQL Gebruikersnaam");
-define("INSLAN24", "mySQL Password");
-define("INSLAN25", "mySQL Database");
-define("INSLAN26", "Tabel voorvoegsel");
-define("INSLAN27", "Probleem");
-define("INSLAN28", "Probleem ontdekt");
-
-define("INSLAN29", "U heeft vereiste velden niet ingevuld, vul opnieuw alle mySQL gegevens in");
-define("INSLAN30", "e107 was niet in staat een connectie te maken met mySQL volgens de ingestelde gegevens.<br />Keer terug naar de vorige pagina and controleer of de gegevens correct zijn");
-define("INSLAN31", "mySQL controle");
-define("INSLAN32", "Connectie met mySQL gemaakt en gecontroleerd.");
-define("INSLAN33", "Poging de database aan te maken");
-define("INSLAN34", "Niet in staat de database te maken, controleer of u de juiste rechten heeft om databases op uw server aan te maken.");
-define("INSLAN35", "Database succesvol aangemaakt.");
-define("INSLAN36", "Klik op de knop om verder te gaan naar het volgende stadium.");
-
-define("INSLAN37", "Terug naar laatste pagina");
-define("INSLAN38", "Beheerdersinformatie");
-define("INSLAN39", "Vul de gebruikersnaam, het password en het email adres van uw hoofdbeheerder in.<br />Deze gegevens zullen gebruikt worden om toegang te krijgen tot het beheerdersgedeelte van uw website.<br />Let op dat u uw gebruikersnaam en password opschrijft en op een veilige plaats bewaart, aangezien deze niet meer zijn te achterhalen wanneer u deze kwijtraakt.");
-define("INSLAN40", "Naam Beheerder");
-define("INSLAN41", "Password Beheerder");
-define("INSLAN42", "Bevestig Password");
-define("INSLAN43", "Email Adres Beheerder");
-define("INSLAN44", "U heeft vereiste velden niet ingevuld, vul de gegevens opnieuw in.");
-define("INSLAN45", "De twee passworden zijn niet gelijk, vul deze opnieuw in.");
-define("INSLAN46", "is geen geldig email adres, vul deze opnieuw in.");
-define("INSLAN47", "Alles ingesteld!");
-
-define("INSLAN48", "e107 heeft nu alle informatie om de installatie af te maken.<br />klik op de knop om de tabellen van de database te maken en alle instellingen op te slaan.");
-define("INSLAN49", "e107 was niet in staat het hoofd configuratiebestand op uw server te bewaren<br />Controleer of het <b>e107_config.php</b> bestand de juiste bestandsrechten heeft");
-define("INSLAN50", "Installatie Voltooid!");
-define("INSLAN51", "Alles voltooid");
-define("INSLAN52", "e107 is succesvol genstalleerd!<br />Voor veiligheidsredenen dient u de bestandsrechten van het<br /><b>e107_config.php</b> bestand terug te zetten naar 644.<br />Tevens  dient u het /install.php bestand van uw server te verwijderen nadat u op de onderstaande knop heeft geklikt");
-define("INSLAN53", "Klik hier om uw nieuwe website te bekijken!");
-define("INSLAN54", "Niet in staat het sql databestand te lezen<br /><br />Controleer of het bestand <b>core_sql.php</b> bestaat in de <b>/e107_admin/sql</b> map.");
-define("INSLAN55", "e107 was niet in staat alle vereiste tabellen te creren.<br />Maak de database leeg en herstel de problemen voordat u het opnieuw probeert.");
-define("INSLAN56", "Welkom op uw nieuwe website!");
-define("INSLAN57", "e107 is succesvol genstalleerd en is nu klaar om inhoud te verkrijgen.<br />Uw beheerdersgedeelte is <a href='e107_admin/admin.php'>hier</a>, klik om er nu heen te gaan. U dient hier in te loggen met de gebruikersnaam en het password dat u heeft gegeven tijdens de installatie");
-define("INSLAN58", "U kunt de FAQ en documentatie hier vinden.");
-define("INSLAN59", "Bedankt dat u e107 wilt gebruiken, wij hopen dat het de behoefte voor uw website vervult\n(U kunt dit bericht verwijderen in het beheerdersgedeelte.)");
-define("INSLAN60", "aanvinken om te maken");
-define("INSLAN61", "map");
-define("INSLAN62", "of");
-define("INSLAN63", "Bestandsrechten probleem");
-define("INSLAN64", "Dit bestand is gegenereerd door het installatie script.");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/administrator.php 75/e107_languages/English/admin/help/administrator.php
--- 6171/e107_languages/English/admin/help/administrator.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/administrator.php	2006-01-09 11:02:46.000000000 -0600
@@ -1,5 +1,26 @@
-<?php
-$caption = "Site Admin Help";
-$text = "Use this page to enter new, or delete site administrators. The administrator will only have permission to access the features that are ticked.";
-$ns -> tablerender($caption, $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/administrator.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/01/09 17:02:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$caption = "Site Admin Help";
+$text = "Use this page to edit the preferences for, or delete site administrators. The administrator will only have permission to access the features that are ticked.<br /><br />
+To create a new admin go to the user config page and update an existing user to admin status.";
+$ns -> tablerender($caption, $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/article.php 75/e107_languages/English/admin/help/article.php
--- 6171/e107_languages/English/admin/help/article.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/article.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,7 +1,27 @@
-<?php
-$text = "From this page you can add single or multi-page articles.<br />
- For a multi-page article seperate each page with the text [newpage], ie <br /><code>Test1 [newpage] Test2</code><br /> would create a two page article with 'Test1' on page 1 and 'Test2' on page 2.
-<br /><br />
-If your article contains HTML tags that you wish to preserve, enclose the code with [html] [/html]. For example, if you entered the text '&lt;table>&lt;tr>&lt;td>Hello &lt;/td>&lt;/tr>&lt;/table>' in your article, a table would be shown containing the word hello. If you entered '[html]&lt;table>&lt;tr>&lt;td>Hello &lt;/td>&lt;/tr>&lt;/table>[/html]' the code as you entered it would be shown and not the table that the code generates.";
-$ns -> tablerender("Article Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/article.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "From this page you can add single or multi-page articles.<br />
+ For a multi-page article seperate each page with the text [newpage], ie <br /><code>Test1 [newpage] Test2</code><br /> would create a two page article with 'Test1' on page 1 and 'Test2' on page 2.
+<br /><br />
+If your article contains HTML tags that you wish to preserve, enclose the code with [html] [/html]. For example, if you entered the text '&lt;table>&lt;tr>&lt;td>Hello &lt;/td>&lt;/tr>&lt;/table>' in your article, a table would be shown containing the word hello. If you entered '[html]&lt;table>&lt;tr>&lt;td>Hello &lt;/td>&lt;/tr>&lt;/table>[/html]' the code as you entered it would be shown and not the table that the code generates.";
+$ns -> tablerender("Article Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/banlist.php 75/e107_languages/English/admin/help/banlist.php
--- 6171/e107_languages/English/admin/help/banlist.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/banlist.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,12 +1,32 @@
-<?php
-$caption = "Banning users from your site";
-$text = "You can ban users from your site at this screen.<br />
-Either enter their full IP address or use a wildcard to ban a range of IP addresses. You can also enter an email address to stop a user registering as a member on your site.<br /><br />
-<b>Banning by IP address:</b><br />
-Entering the IP address 123.123.123.123 will stop the user with that address visiting your site.<br />
-Entering the IP address 123.123.123.* will stop anyone in that IP range from visiting your site.<br /><br />
-<b>Banning by email address</b><br />
-Entering the email address foo@bar.com will stop anyone using that email address from registering as a member on your site.<br />
-Entering the email address *@bar.com will stop anyone using that email domain from registering as a member on your site.";
-$ns -> tablerender($caption, $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/banlist.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$caption = "Banning users from your site";
+$text = "You can ban users from your site at this screen.<br />
+Either enter their full IP address or use a wildcard to ban a range of IP addresses. You can also enter an email address to stop a user registering as a member on your site.<br /><br />
+<b>Banning by IP address:</b><br />
+Entering the IP address 123.123.123.123 will stop the user with that address visiting your site.<br />
+Entering the IP address 123.123.123.* will stop anyone in that IP range from visiting your site.<br /><br />
+<b>Banning by email address</b><br />
+Entering the email address foo@bar.com will stop anyone using that email address from registering as a member on your site.<br />
+Entering the email address *@bar.com will stop anyone using that email domain from registering as a member on your site.";
+$ns -> tablerender($caption, $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/cache.php 75/e107_languages/English/admin/help/cache.php
--- 6171/e107_languages/English/admin/help/cache.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/cache.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,5 +1,25 @@
-<?php
-$caption = "Caching";
-$text = "If you have caching turned on it will vastly improve speed on your site and minimize the amount of calls to the sql database.<br /><br /><b>IMPORTANT! If you are making your own theme turn caching off as any changes you make will not be reflected.</b>";
-$ns -> tablerender($caption, $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/cache.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$caption = "Caching";
+$text = "If you have caching turned on it will vastly improve speed on your site and minimize the amount of calls to the sql database.<br /><br /><b>IMPORTANT! If you are making your own theme turn caching off as any changes you make will not be reflected.</b>";
+$ns -> tablerender($caption, $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/chatbox.php 75/e107_languages/English/admin/help/chatbox.php
--- 6171/e107_languages/English/admin/help/chatbox.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/chatbox.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,6 +1,25 @@
-<?php
-
-$text = "Set your chatbox preferences from here.<br />If the replace link box is ticked, any links entered will be replaced by the text you enter in the textbox, this stops long links causing display problems. Wordwrap will auto wrap text that is longer than the length specified here.";
-
-$ns -> tablerender("Chatbox", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/chatbox.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Set your chatbox preferences from here.<br />If the replace link box is ticked, any links entered will be replaced by the text you enter in the textbox, this stops long links causing display problems. Wordwrap will auto wrap text that is longer than the length specified here.";
+
+$ns -> tablerender("Chatbox", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/content.php 75/e107_languages/English/admin/help/content.php
--- 6171/e107_languages/English/admin/help/content.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/content.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,6 +1,25 @@
-<?php
-
-$text = "You can add a normal page to your site using this feature. A link to the new page will be created in your main site navigation box. For example if you create a new page with the Link Name 'Test', a link called 'Test' will appear in your links box after submitting the new page.<br />
-If you want your content page to have a caption, enter it in the Page Heading box.";
-$ns -> tablerender("Content Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/content.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "You can add a normal page to your site using this feature. A link to the new page will be created in your main site navigation box. For example if you create a new page with the Link Name 'Test', a link called 'Test' will appear in your links box after submitting the new page.<br />
+If you want your content page to have a caption, enter it in the Page Heading box.";
+$ns -> tablerender("Content Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/cpage.php 75/e107_languages/English/admin/help/cpage.php
--- 6171/e107_languages/English/admin/help/cpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/cpage.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,26 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/cpage.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "From this screen you can create custom menus or custom pages with your own content in them.<br /><br />
+Please see <a href='http://docs.e107.org/Using Custom Pages and Custom Menus'>http://docs.e107.org/Using Custom Pages and Custom Menus</a> for an explanation of all the features.";
+
+$ns -> tablerender(CUSLAN_18, $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/custommenu.php 75/e107_languages/English/admin/help/custommenu.php
--- 6171/e107_languages/English/admin/help/custommenu.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/custommenu.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,13 +1,26 @@
-<?php
-$text = "From this screen you can create custom menus or custom pages with your own content in them.<br /><br /><b>Important Notes</b><br />
-- to use this feature you will need to CHMOD your /e107_plugins/custom/ and /e107_plugins/custompages/ directories to 777.
-<br />
-- you can use HTML code using ' for HTML attributes !!! (Using \" for HTML attributes will crash your menu/page)
-<br /><br />
-<i>Menu/Page Filename</i>: The name of your custom menu or custom page, the menu will be saved as 'this name.php' in the ".e_PLUGIN."custom/ directory<br />
-the page will be saved as this 'name.php' in the ".e_PLUGIN."custompages/ directory<br /><br />
-<i>Menu/Page Caption Title</i>: The text displayed in the captionbar of the menu item or the title of the page<br /><br />
-<i>Menu/Page Text</i>: The actual data that is displayed in the menu body or as normal page (For advanced users: no need to add lines to call the class2.php file or to display HEADER or FOOTER... will be automatically added), can be text, images etc";
-
-$ns -> tablerender(CUSLAN_18, $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/custommenu.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "From this screen you can create custom menus or custom pages with your own content in them.<br /><br />
+Please see <a href='http://docs.e107.org?Custom Pages'>http://docs.e107.org?Custom Pages</a>";
+
+$ns -> tablerender(CUSLAN_18, $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/db.php 75/e107_languages/English/admin/help/db.php
--- 6171/e107_languages/English/admin/help/db.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/db.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/db.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "This collection of tools allows you to manage your database.";
+$ns -> tablerender("Database Tools", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/download.php 75/e107_languages/English/admin/help/download.php
--- 6171/e107_languages/English/admin/help/download.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/download.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,6 +1,26 @@
-<?php
-$text = "Please upload your files into the ".e_FILE."downloads folder, your images into the ".e_FILE."downloadimages folder and thumbnail images into the ".e_FILE."downloadthumbs folder.
-<br /><br />
-To submit a download, first create a parent, then create a category under that parent, you will then be able to make the download available.";
-$ns -> tablerender("Download Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/download.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Please upload your files into the ".e_FILE."downloads folder, your images into the ".e_FILE."downloadimages folder and thumbnail images into the ".e_FILE."downloadthumbs folder.
+<br /><br />
+To submit a download, first create a parent, then create a category under that parent, you will then be able to make the download available.";
+$ns -> tablerender("Download Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/emoticon.php 75/e107_languages/English/admin/help/emoticon.php
--- 6171/e107_languages/English/admin/help/emoticon.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/emoticon.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,7 +1,26 @@
-<?php
-
-$text = "Tick the box to have text emoticons replaced by image emoticons.<br /><br />
-Type any updates you require in the textboxes, and click update to save your settings. Use the form at the foot of the page to add new emotes.";
-
-$ns -> tablerender("Emoticon Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/emoticon.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "With emoticons activated, standard smiley text strings will be replaced by their 
+respective emoticon images throughout the content in your site.";
+
+$ns -> tablerender("Emoticon Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/fileinspector.php 75/e107_languages/English/admin/help/fileinspector.php
--- 6171/e107_languages/English/admin/help/fileinspector.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/fileinspector.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,51 @@
+ <?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/fileinspector.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "<div style='margin-left: 0px; margin-bottom: 1px; margin-top: 2px; vertical-align: top; white-space: nowrap'>
+<img src='".e_IMAGE."fileinspector/file_core.png' alt='".$dir."' style='margin-left: 3px; width: 16px; height: 16px' />&nbsp;Core File</div>
+<div style='margin-left: 0px; margin-bottom: 1px; margin-top: 2px; vertical-align: top; white-space: nowrap'>
+<img src='".e_IMAGE."fileinspector/file_warning.png' alt='".$dir."' style='margin-left: 3px; width: 16px; height: 16px' />&nbsp;Known Insecurity</div>
+<div style='margin-left: 0px; margin-bottom: 1px; margin-top: 2px; vertical-align: top; white-space: nowrap'>
+<img src='".e_IMAGE."fileinspector/file_check.png' alt='".$dir."' style='margin-left: 3px; width: 16px; height: 16px' />&nbsp;Core File (Integrity Pass)</div>
+<div style='margin-left: 0px; margin-bottom: 1px; margin-top: 2px; vertical-align: top; white-space: nowrap'>
+<img src='".e_IMAGE."fileinspector/file_fail.png' alt='".$dir."' style='margin-left: 3px; width: 16px; height: 16px' />&nbsp;Core File (Integrity Fail)</div>
+<div style='margin-left: 0px; margin-bottom: 1px; margin-top: 2px; vertical-align: top; white-space: nowrap'>
+<img src='".e_IMAGE."fileinspector/file_uncalc.png' alt='".$dir."' style='margin-left: 3px; width: 16px; height: 16px' />&nbsp;Core File (Uncalculable)</div>
+<div style='margin-left: 0px; margin-bottom: 1px; margin-top: 2px; vertical-align: top; white-space: nowrap'>
+<img src='".e_IMAGE."fileinspector/file_missing.png' alt='".$dir."' style='margin-left: 3px; width: 16px; height: 16px' />&nbsp;Missing Core File</div>
+<div style='margin-left: 0px; margin-bottom: 1px; margin-top: 2px; vertical-align: top; white-space: nowrap'>
+<img src='".e_IMAGE."fileinspector/file_old.png' alt='".$dir."' style='margin-left: 3px; width: 16px; height: 16px' />&nbsp;Old Core File</div>
+<div style='margin-left: 0px; margin-bottom: 1px; margin-top: 2px; vertical-align: top; white-space: nowrap'>
+<img src='".e_IMAGE."fileinspector/file_unknown.png' alt='".$dir."' style='margin-left: 3px; width: 16px; height: 16px' />&nbsp;Non Core File</div>";
+$ns -> tablerender("File Key", $text);
+
+$text = "The file inspector scans and analyses the files on your sites server. When the inspector encounters 
+an e107 core file it checks it for file consistency to make sure it isnt corrupted.";
+
+if ($pref['developer']) {
+$text .= "<br /><br />
+The additional string matching tool (developer mode only) enables you to scan the files on your server for text strings 
+using regular expressions. The regex engine in use is PHP's <a href='http://php.net/pcre'>PCRE</a> 
+(the preg_* functions), so enter your query as #pattern#modifiers in the fields provided.";
+}
+
+$ns -> tablerender("File Inspector Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/filemanager.php 75/e107_languages/English/admin/help/filemanager.php
--- 6171/e107_languages/English/admin/help/filemanager.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/filemanager.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,4 +1,24 @@
-<?php
-$text = "You are able to manage the files in your /files directory from this page. If you are getting error message about permissions when uploading please CHMOD the directory you are atempting to upload into to 777.";
-$ns -> tablerender("File Manager Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/filemanager.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "You are able to manage the files in your /files directory from this page. If you are getting error message about permissions when uploading please CHMOD the directory you are atempting to upload into to 777.";
+$ns -> tablerender("File Manager Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/forum.php 75/e107_languages/English/admin/help/forum.php
--- 6171/e107_languages/English/admin/help/forum.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/forum.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,23 +1,43 @@
-<?php
-$caption = "Forum Help";
-$text = "<b>General</b><br />
-Use this screen to create or edit your forums<br />
-<br />
-<b>Parents/Forums</b><br />
-A parent is a heading that other forums are displayed under, this makes layout simpler and makes navigating around your forums much simpler for visitors.
-<br /><br />
-<b>Accessability</b>
-<br />
-You can set your forums to only be accessable to certain visitors. Once you have set the 'class' of the visitors you can tick the 
-class to only allow those visitors access to the forum. You can set parents or individual forums up in this way.
-<br /><br />
-<b>Moderators</b>
-<br />
-Tick the names of the listed administrators to give them moderator status on the forum. The administrator must have forum moderation permissions to be listed here.
-<br /><br />
-<b>Ranks</b>
-<br />
-Set your user ranks from here. If the image fields are filled in, images will be used, to use rank names enter the names and make sure the corrosponding rank image field is blank.<br />The threshold is the number of points the user needs to gain before his level changes.";
-$ns -> tablerender($caption, $text);
-unset($text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/forum.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$caption = "Forum Help";
+$text = "<b>General</b><br />
+Use this screen to create or edit your forums<br />
+<br />
+<b>Parents/Forums</b><br />
+A parent is a heading that other forums are displayed under, this makes layout simpler and makes navigating around your forums much simpler for visitors.
+<br /><br />
+<b>Accessability</b>
+<br />
+You can set your forums to only be accessable to certain visitors. Once you have set the 'class' of the visitors you can tick the 
+class to only allow those visitors access to the forum. You can set parents or individual forums up in this way.
+<br /><br />
+<b>Moderators</b>
+<br />
+Tick the names of the listed administrators to give them moderator status on the forum. The administrator must have forum moderation permissions to be listed here.
+<br /><br />
+<b>Ranks</b>
+<br />
+Set your user ranks from here. If the image fields are filled in, images will be used, to use rank names enter the names and make sure the corrosponding rank image field is blank.<br />The threshold is the number of points the user needs to gain before his level changes.";
+$ns -> tablerender($caption, $text);
+unset($text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/frontpage.php 75/e107_languages/English/admin/help/frontpage.php
--- 6171/e107_languages/English/admin/help/frontpage.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/frontpage.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,5 +1,25 @@
-<?php
-$caption = "Front Page Help";
-$text = "From this screen you can choose what to display on the front page of your site, the default is news. You can also use this page to set up a 'splashscreen', a page that will only display when a visitor first enters your site.";
-$ns -> tablerender($caption, $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/frontpage.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$caption = "Front Page Help";
+$text = "From this screen you can choose what to display as the front page of your site, the default is news.";
+$ns -> tablerender($caption, $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/image.php 75/e107_languages/English/admin/help/image.php
--- 6171/e107_languages/English/admin/help/image.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/image.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/image.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "From here you can allow / disallow the ability for users to post images on the site, set resize method and view uploaded avatars.";
+$ns -> tablerender("Images Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/language.php 75/e107_languages/English/admin/help/language.php
--- 6171/e107_languages/English/admin/help/language.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/language.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/language.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Setting a new language will allow you to have a version of your content in that language on your site.";
+$ns -> tablerender("Language Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/link_category.php 75/e107_languages/English/admin/help/link_category.php
--- 6171/e107_languages/English/admin/help/link_category.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/link_category.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,4 +1,24 @@
-<?php
-$text = "You can seperate your links into different categories, this makes navigating the main Links page much easier and improves layout.<br /><br />Any link entered under the Main category will be displayed in your main navigation menu.";
-$ns -> tablerender("Link Category Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/link_category.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "You can seperate your links into different categories, this makes navigating the main Links page much easier and improves layout.<br /><br />Any link entered under the Main category will be displayed in your main navigation menu.";
+$ns -> tablerender("Link Category Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/links.php 75/e107_languages/English/admin/help/links.php
--- 6171/e107_languages/English/admin/help/links.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/links.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,7 +1,26 @@
-<?php
-$text = "Enter all your site links here. For main site links (the ones displayed in your main navigation bar) set the category to 'Main', any others will be displayed on the Links page. You can seperate these links into different categories.
-<br />
-<br />
-The submenus generator is ONLY usefull for e107 DHTML menus (TreeMenu, UltraTreeMenu, eDynamicMenu, ypSlideMenu...)";
-$ns -> tablerender("Links Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/links.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Enter all your site links here. Links added here will be shown in your main navigation menu, for other links please use the Links Page plugin.
+<br />
+";
+$ns -> tablerender("Links Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/list_menu_conf.php 75/e107_languages/English/admin/help/list_menu_conf.php
--- 6171/e107_languages/English/admin/help/list_menu_conf.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/list_menu_conf.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,10 +1,30 @@
-<?php
-$text = "In this section you can configure 3 menus<br>
-<b> New Articles Menu</b> <br>
-Enter a number for example '5' in the first field to show the first 5 articles, leave empty to see all, You configure what the title of the link should be to the rest of the articles in the second field, when you leave this last option empty it won't create a link, for example: 'All articles'<br>
-<b> Comments/Forum Menu</b> <br>
-The number of comments default to 5, the number of characters default to 10000. The postfix is for if a line is too long it will cut it off and append this postfix to the end, a good choice for this is '...', check original topics if you want to see those in the overview.<br>
-
-";
-$ns -> tablerender("Menu Configuration Help", $text);
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/list_menu_conf.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "In this section you can configure 3 menus<br>
+<b> New Articles Menu</b> <br>
+Enter a number for example '5' in the first field to show the first 5 articles, leave empty to see all, You configure what the title of the link should be to the rest of the articles in the second field, when you leave this last option empty it won't create a link, for example: 'All articles'<br>
+<b> Comments/Forum Menu</b> <br>
+The number of comments default to 5, the number of characters default to 10000. The postfix is for if a line is too long it will cut it off and append this postfix to the end, a good choice for this is '...', check original topics if you want to see those in the overview.<br>
+
+";
+$ns -> tablerender("Menu Configuration Help", $text);
+?>
diff -ruN 6171/e107_languages/English/admin/help/log.php 75/e107_languages/English/admin/help/log.php
--- 6171/e107_languages/English/admin/help/log.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/log.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,4 +1,24 @@
-<?php
-$text = "Activate site stats logging from this page. If you are short of server space tick the domain only box as referer logging, this will only log the domain as opposed to the whole url, ie 'jalist.com' instead of 'http://jalist.com/links.php' ";
-$ns -> tablerender("Logging Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/log.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Activate site stats logging from this page. If you are short of server space tick the domain only box as referer logging, this will only log the domain as opposed to the whole url, ie 'jalist.com' instead of 'http://jalist.com/links.php' ";
+$ns -> tablerender("Logging Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/mailout.php 75/e107_languages/English/admin/help/mailout.php
--- 6171/e107_languages/English/admin/help/mailout.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/mailout.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/mailout.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Use this page to configure your mail settings for site-wide mailing functions. The mail out form also allows you to send out a mail-shot to all your users.";
+$ns -> tablerender("Mail Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/menus2.php 75/e107_languages/English/admin/help/menus2.php
--- 6171/e107_languages/English/admin/help/menus2.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/menus2.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,8 +1,28 @@
-<?php
-$caption = "Menu Help";
-$text .= "You can arrange where and in which order your menu items are displayed from here. Use the arrows to move the menus up and down until you are satisfied with their positioning.<br />
-The menu items in the middle of the screen are de-activated, you can activate these by choosing a location to put them in.
-";
-
-$ns -> tablerender("Menus Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/menus2.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$caption = "Menu Help";
+$text .= "You can arrange where and in which order your menu items are displayed from here. Use the arrows to move the menus up and down until you are satisfied with their positioning.<br />
+The menu items in the middle of the screen are de-activated, you can activate these by choosing a location to put them in.
+";
+
+$ns -> tablerender("Menus Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/menus.php 75/e107_languages/English/admin/help/menus.php
--- 6171/e107_languages/English/admin/help/menus.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/menus.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,36 +1,56 @@
-<?php
-if(IsSet($_POST['reset'])){
-	if(!check_class("FAKE","",TRUE)){
-		$text = "<b>Operation Not allowed</b><br /><br />";
-	} else {
-		for($mc=1;$mc<=5;$mc++){
-			$sql -> db_Select("menus","*", "menu_location='$mc' ORDER BY menu_order");
-			$count = 1;
-			$sql2 = new db;
-			while(list($menu_id, $menu_name, $menu_location, $menu_order) = $sql-> db_Fetch()){
-				$sql2 -> db_Update("menus", "menu_order='$count' WHERE menu_id='$menu_id' ");
-				$count++;
-			}
-			$text = "<b>Menus reset in database</b><br /><br />";
-		}
-	}
-}else{
-	unset($text);
-}
-
-$text .= "
-You can arrange where and in which order your menu items are from here. 
-Use the dropdown menu to move the menus up and down until you are satisfied with their positioning.
-<br />
-<br />
-If you find the menus are not updating properly click on the refresh button.
-<br />
-<form method='post' id='menurefresh' action='".$_SERVER['PHP_SELF']."'>
-<div><input type='submit' class='button' name='reset' value='Refresh' /></div>
-</form>
-<br />
-<div class='indent'><span style='color:red'>*</span> indicates menu visibility has been modified</div>
-";
-
-$ns -> tablerender("Menus Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/menus.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if(!defined('e107_INIT')){ die("Unauthorised Access");}
+if (!getperms("2")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+global $sql;
+if(isset($_POST['reset'])){
+		for($mc=1;$mc<=5;$mc++){
+			$sql -> db_Select("menus","*", "menu_location='".$mc."' ORDER BY menu_order");
+			$count = 1;
+			$sql2 = new db;
+			while(list($menu_id, $menu_name, $menu_location, $menu_order) = $sql-> db_Fetch()){
+				$sql2 -> db_Update("menus", "menu_order='$count' WHERE menu_id='$menu_id' ");
+				$count++;
+			}
+			$text = "<b>Menus reset in database</b><br /><br />";
+		}
+}else{
+	unset($text);
+}
+
+$text .= "
+You can arrange where and in which order your menu items are from here. 
+Use the dropdown menu to move the menus up and down until you are satisfied with their positioning.
+<br />
+<br />
+If you find the menus are not updating properly click on the refresh button.
+<br />
+<form method='post' id='menurefresh' action='".$_SERVER['PHP_SELF']."'>
+<div><input type='submit' class='button' name='reset' value='Refresh' /></div>
+</form>
+<br />
+<div class='indent'><span style='color:red'>*</span> indicates menu visibility has been modified</div>
+";
+
+$ns -> tablerender("Menus Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/meta.php 75/e107_languages/English/admin/help/meta.php
--- 6171/e107_languages/English/admin/help/meta.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/meta.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,5 +1,25 @@
-<?php
-$text = "Any meta tags you enter here will be sent to screen in the right place.";
-
-$ns -> tablerender("Meta Tags", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/meta.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Any meta tags you enter here will be sent to screen in the right place.";
+
+$ns -> tablerender("Meta Tags", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/news_category.php 75/e107_languages/English/admin/help/news_category.php
--- 6171/e107_languages/English/admin/help/news_category.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/news_category.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,4 +1,24 @@
-<?php
-$text = "You can seperate your news items into different categories, and allow visitors to display only the news items in those categories. <br /><br />Upload your news icon images either ".e_THEME."-yourtheme-/images/ or themes/shared/newsicons/.";
-$ns -> tablerender("News Category Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/news_category.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "You can seperate your news items into different categories, and allow visitors to display only the news items in those categories. <br /><br />Upload your news icon images either ".e_THEME."-yourtheme-/images/ or themes/shared/newsicons/.";
+$ns -> tablerender("News Category Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/newsfeed.php 75/e107_languages/English/admin/help/newsfeed.php
--- 6171/e107_languages/English/admin/help/newsfeed.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/newsfeed.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,5 +1,25 @@
-<?php
-$text = "You can retrieve and parse other site's backend RSS news feeds and display them on your own site from here.<br />Enter the full path URL to the backend (ie http://e107.org/news.xml). You can add a path to an image if you don't like the default one, or it isn't defined. You can activate and de-activate the backend if the site goes down for instance.<br /><br />To see the headlines on your site, make sure the  headlines_menu is activated from your menus page.";
-
-$ns -> tablerender("Headlines", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/newsfeed.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "You can retrieve and parse other site's backend RSS news feeds and display them on your own site from here.<br />Enter the full path URL to the backend (ie http://e107.org/news.xml). You can add a path to an image if you don't like the default one, or it isn't defined. You can activate and de-activate the backend if the site goes down for instance.<br /><br />To see the headlines on your site, make sure the  headlines_menu is activated from your menus page.";
+
+$ns -> tablerender("Headlines", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/newspost.php 75/e107_languages/English/admin/help/newspost.php
--- 6171/e107_languages/English/admin/help/newspost.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/newspost.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,16 +1,36 @@
-<?php
-$caption = "Newspost Help";
-$text = "<b>General</b><br />
-Body will be displayed on the main page, extended will be readable by clicking a 'Read More' link.
-<br />
-<br />
-<b>Show title only</b>
-<br />
-Enable this to show the news title only on front page, with clickable link to full story.
-<br /><br />
-<b>Activation</b>
-<br />
-If you set a start and/or end date your news item will only be displayed between these dates.
-";
-$ns -> tablerender($caption, $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/newspost.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$caption = "Newspost Help";
+$text = "<b>General</b><br />
+Body will be displayed on the main page, extended will be readable by clicking a 'Read More' link.
+<br />
+<br />
+<b>Show title only</b>
+<br />
+Enable this to show the news title only on front page, with clickable link to full story.
+<br /><br />
+<b>Activation</b>
+<br />
+If you set a start and/or end date your news item will only be displayed between these dates.
+";
+$ns -> tablerender($caption, $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/notify.php 75/e107_languages/English/admin/help/notify.php
--- 6171/e107_languages/English/admin/help/notify.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/notify.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,31 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/notify.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Notify sends email notifications when e107 events occur.<br /><br />
+For example, set 'IP banned for flooding site' to user class 'Admin' and all admins will be sent an email when your 
+site is being flooded.<br /><br />
+You can also, as another example, set 'News item posted by admin' to user class 'Members' and all your users will be 
+sent news items you post to the site in an email.<br /><br />
+If you would like the email notifications to be sent to an alternative email address - select the 'Email' option and 
+enter in the email address in the field provided.";
+
+$ns -> tablerender("Notify Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/phpinfo.php 75/e107_languages/English/admin/help/phpinfo.php
--- 6171/e107_languages/English/admin/help/phpinfo.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/phpinfo.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/phpinfo.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = " This page displays all your servers PHP configuration settings. ";
+$ns -> tablerender("PHP Info Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/poll.php 75/e107_languages/English/admin/help/poll.php
--- 6171/e107_languages/English/admin/help/poll.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/poll.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,6 +1,26 @@
-<?php
-$text = "You set polls/surveys from this page, just type in the poll title and options, preview it and if all looks ok tick the box to make it active.<br /><br />
-To see the poll, go to your menus page and make sure poll_menu is activated.";
-
-$ns -> tablerender("Polls", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/poll.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "You set polls/surveys from this page, just type in the poll title and options, preview it and if all looks ok tick the box to make it active.<br /><br />
+To see the poll, go to your menus page and make sure poll_menu is activated.";
+
+$ns -> tablerender("Polls", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/prefs.php 75/e107_languages/English/admin/help/prefs.php
--- 6171/e107_languages/English/admin/help/prefs.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/prefs.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/prefs.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Your preferences allow you to specify all the important settings on your site, from site name and description to flood protection and profanity filtering.";
+$ns -> tablerender("Preferences Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/review.php 75/e107_languages/English/admin/help/review.php
--- 6171/e107_languages/English/admin/help/review.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/review.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,5 +1,25 @@
-<?php
-$text = "Reviews are similar to articles but they will be listed in their own menu item.<br />
- For a multi-page review seperate each page with the text [newpage], ie <br /><code>Test1 [newpage] Test2</code><br /> would create a two page review with 'Test1' on page 1 and 'Test2' on page 2.";
-$ns -> tablerender("Review Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/review.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Reviews are similar to articles but they will be listed in their own menu item.<br />
+ For a multi-page review seperate each page with the text [newpage], ie <br /><code>Test1 [newpage] Test2</code><br /> would create a two page review with 'Test1' on page 1 and 'Test2' on page 2.";
+$ns -> tablerender("Review Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/search.php 75/e107_languages/English/admin/help/search.php
--- 6171/e107_languages/English/admin/help/search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/search.php	2006-01-16 09:06:30.000000000 -0600
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/search.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2006/01/16 15:06:30 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "If your MySql server version supports it you can switch 
+to the MySql sort method which is faster than the PHP sort method. See preferences.<br /><br />
+If your site includes Ideographic languages such as Chinese and Japanese you must 
+use the PHP sort method and switch whole word matching off.";
+$ns -> tablerender("Search Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/theme.php 75/e107_languages/English/admin/help/theme.php
--- 6171/e107_languages/English/admin/help/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/theme.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/theme.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "The theme manager allows you to set your site's public theme and your admin areas theme.";
+$ns -> tablerender("Theme Manager Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/ugflag.php 75/e107_languages/English/admin/help/ugflag.php
--- 6171/e107_languages/English/admin/help/ugflag.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/ugflag.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,5 +1,25 @@
-<?php
-$text = "If you are upgrading e107 or just need your site to be offline for a while just tick the maintainance box and your visitors will be redirected to a page explaining the site is down for repair. After you've finished untick the box to return site to normal.";
-
-$ns -> tablerender("Maintainance", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/ugflag.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "If you are upgrading e107 or just need your site to be offline for a while just tick the maintainance box and your visitors will be redirected to a page explaining the site is down for repair. After you've finished untick the box to return site to normal.";
+
+$ns -> tablerender("Maintainance", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/updateadmin.php 75/e107_languages/English/admin/help/updateadmin.php
--- 6171/e107_languages/English/admin/help/updateadmin.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/updateadmin.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,4 +1,24 @@
-<?php
-$text = "Update your password here.";
-$ns -> tablerender("Update Settings Help", $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/updateadmin.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "Update your password here.";
+$ns -> tablerender("Update Settings Help", $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/upload.php 75/e107_languages/English/admin/help/upload.php
--- 6171/e107_languages/English/admin/help/upload.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/upload.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/upload.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "From here you can allow / disallow the ability for users to upload files and manage those files that have been uploaded.";
+$ns -> tablerender("Public Uploads Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/userclass2.php 75/e107_languages/English/admin/help/userclass2.php
--- 6171/e107_languages/English/admin/help/userclass2.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/userclass2.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,5 +1,25 @@
-<?php
-$caption = "Use Class Help";
-$text = "You can create or edit/delete existing classes from this page.<br />This is useful for restricting users to certain parts of your site. For example, you could create a class called TEST, then create a forum which only allowed users in the TEST class to access it.";
-$ns -> tablerender($caption, $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/userclass2.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$caption = "Use Class Help";
+$text = "You can create or edit/delete existing classes from this page.<br />This is useful for restricting users to certain parts of your site. For example, you could create a class called TEST, then create a forum which only allowed users in the TEST class to access it.";
+$ns -> tablerender($caption, $text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/users_extended.php 75/e107_languages/English/admin/help/users_extended.php
--- 6171/e107_languages/English/admin/help/users_extended.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/help/users_extended.php	2005-12-14 11:37:43.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/users_extended.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = " Extended user fields allow you to add additional types of data a user is able to specify as part of their profile.";
+$ns -> tablerender(" Extended User Fields Help", $text);
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/users.php 75/e107_languages/English/admin/help/users.php
--- 6171/e107_languages/English/admin/help/users.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/users.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,5 +1,25 @@
-<?php
-$text = "This page allows you to moderate your registered members. You can update their settings, give them administrator status and set their user class among other things.";
-$ns -> tablerender("Users Help", $text);
-unset($text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/users.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "This page allows you to moderate your registered members. You can update their settings, give them administrator status and set their user class among other things.";
+$ns -> tablerender("Users Help", $text);
+unset($text);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/help/wmessage.php 75/e107_languages/English/admin/help/wmessage.php
--- 6171/e107_languages/English/admin/help/wmessage.php	2004-09-03 16:54:10.000000000 -0500
+++ 75/e107_languages/English/admin/help/wmessage.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,4 +1,24 @@
-<?php
-$text = "This page allows you to set a message that will appear at the top of your front page all the time it's activated. You can set a different message for guests, registered/logged-in members and administrators.";
-$ns -> tablerender("WMessage Help", $text);
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/help/wmessage.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "This page allows you to set a message that will appear at the top of your front page all the time it's activated. You can set a different message for guests, registered/logged-in members and administrators.";
+$ns -> tablerender("WMessage Help", $text);
+?>
diff -ruN 6171/e107_languages/English/admin/lan_administrator.php 75/e107_languages/English/admin/lan_administrator.php
--- 6171/e107_languages/English/admin/lan_administrator.php	2004-06-07 05:24:38.000000000 -0500
+++ 75/e107_languages/English/admin/lan_administrator.php	2005-09-09 15:32:06.000000000 -0500
@@ -1,69 +1,82 @@
-<?php
-
-define("ADMSLAN_0", "New user/admin entry created for");
-define("ADMSLAN_1", "now has admin status.");
-define("ADMSLAN_2", "updated in database.");
-define("ADMSLAN_3", "is the main site administrator and cannot be edited.");
-define("ADMSLAN_4", "Continue");
-define("ADMSLAN_5", "Error!");
-define("ADMSLAN_6", "is the main site administrator and cannot be deleted."); 
-define("ADMSLAN_7", "Please confirm you wish to delete");
-define("ADMSLAN_8", "from the admin database");
-define("ADMSLAN_9", "Cancel");
-define("ADMSLAN_10", "Confirm Delete");
-define("ADMSLAN_11", "Confirm Delete Administrator");
-define("ADMSLAN_12", "Delete cancelled.");
-define("ADMSLAN_13", "Existing Administrators");
-define("ADMSLAN_14", "Delete");
-define("ADMSLAN_15", "Edit");
-define("ADMSLAN_16", "Admin Name");
-define("ADMSLAN_17", "Admin Password");
-define("ADMSLAN_18", "Permissions");
-define("ADMSLAN_19", "Alter site preferences"); 
-define("ADMSLAN_20", "Alter Menus");
-define("ADMSLAN_21", "Add site administrators");
-define("ADMSLAN_22", "Moderate users/bans etc");
-define("ADMSLAN_23", "Create/edit forums");
-define("ADMSLAN_24", "Manage download categories");
-define("ADMSLAN_25", "Upload /manage files");
-define("ADMSLAN_26", "Oversee news categories");
-define("ADMSLAN_27", "Oversee link categories");
-define("ADMSLAN_28", "Take site down for maintenance");
-define("ADMSLAN_29", "Manage banners");
-define("ADMSLAN_30", "Configure news feed headlines");
-define("ADMSLAN_31", "Configure emoticons");
-define("ADMSLAN_32", "Configure front page content");
-define("ADMSLAN_33", "Configure log/stats");
-define("ADMSLAN_34", "Configure meta tags");
-define("ADMSLAN_35", "Configure public file uploads");
-define("ADMSLAN_36", "Moderate forums");
-define("ADMSLAN_37", "Moderate comments");
-define("ADMSLAN_38", "Moderate/configure chatbox");
-define("ADMSLAN_39", "Post news");
-define("ADMSLAN_40", "Post links");
-define("ADMSLAN_41", "Post articles");
-define("ADMSLAN_42", "Post reviews");
-define("ADMSLAN_43", "Post content pages");
-define("ADMSLAN_44", "Post downloads");
-define("ADMSLAN_45", "Post polls");
-define("ADMSLAN_46", "Welcome message");
-define("ADMSLAN_47", "Moderate submitted news");
-define("ADMSLAN_48", "Configure plugins");
-define("ADMSLAN_49", "Check All");
-define("ADMSLAN_51", "Uncheck All");
-define("ADMSLAN_52", "Update administrator");
-define("ADMSLAN_53", "Add administrator");
-define("ADMSLAN_54", "Site Administrators");
-
-define("ADMSLAN_55", "Field(s) left blank");
-
-define("ADMSLAN_56", "Site Administrator");
-define("ADMSLAN_57", "Options");
-define("ADMSLAN_58", "Main Site Administrator");
-define("ADMSLAN_59", "Remove Admin Status");
-define("ADMSLAN_60", "Are you sure you want to remove admin status from");
-define("ADMSLAN_61", "Administrator deleted");
-
-define("ADMSLAN_62", "Plugin Manager");
-define("ADMSLAN_63", "Plugin");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_administrator.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2005/09/09 20:32:06 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("ADMSLAN_0", "New user/admin entry created for");
+define("ADMSLAN_1", "now has admin status.");
+define("ADMSLAN_2", "updated in database.");
+define("ADMSLAN_3", "is the main site administrator and cannot be edited.");
+define("ADMSLAN_4", "Continue");
+define("ADMSLAN_6", "is the main site administrator and cannot be deleted.");
+
+define("ADMSLAN_13", "Existing Administrators");
+
+
+define("ADMSLAN_16", "Admin Name");
+define("ADMSLAN_17", "Admin Password");
+define("ADMSLAN_18", "Permissions");
+define("ADMSLAN_19", "Alter site preferences");
+define("ADMSLAN_20", "Alter Menus");
+define("ADMSLAN_21", "Add site administrators");
+define("ADMSLAN_22", "Moderate users/bans etc");
+define("ADMSLAN_23", "Create/edit custom pages/menus");
+define("ADMSLAN_24", "Manage download categories");
+define("ADMSLAN_25", "Upload /manage files");
+define("ADMSLAN_26", "Oversee news categories");
+define("ADMSLAN_27", "Oversee link categories");
+define("ADMSLAN_28", "Take site down for maintenance");
+define("ADMSLAN_29", "Manage banners");
+define("ADMSLAN_30", "Configure news feed headlines");
+define("ADMSLAN_31", "Configure emoticons");
+define("ADMSLAN_32", "Configure front page content");
+define("ADMSLAN_33", "Configure log/stats");
+define("ADMSLAN_34", "Configure meta tags");
+define("ADMSLAN_35", "Configure public file uploads");
+// define("ADMSLAN_36", "Moderate forums");
+define("ADMSLAN_37", "Moderate comments");
+// define("ADMSLAN_38", "Moderate/configure chatbox");
+define("ADMSLAN_39", "Post news");
+define("ADMSLAN_40", "Post links");
+define("ADMSLAN_41", "Post articles");
+define("ADMSLAN_42", "Post reviews");
+define("ADMSLAN_43", "Post content pages");
+define("ADMSLAN_44", "Post downloads");
+define("ADMSLAN_45", "Post polls");
+define("ADMSLAN_46", "Welcome message");
+define("ADMSLAN_47", "Moderate submitted news");
+
+define("ADMSLAN_49", "Check All");
+define("ADMSLAN_51", "Uncheck All");
+define("ADMSLAN_52", "Update administrator");
+define("ADMSLAN_53", "Add administrator");
+define("ADMSLAN_54", "Site Administrators");
+
+define("ADMSLAN_55", "Field(s) left blank");
+
+define("ADMSLAN_56", "Site Administrator");
+
+define("ADMSLAN_58", "Main Site Administrator");
+define("ADMSLAN_59", "Remove Admin Status");
+define("ADMSLAN_60", "Are you sure you want to remove admin status from");
+define("ADMSLAN_61", "Administrator deleted");
+
+define("ADMSLAN_62", "Plugin Manager");
+
+define("ADMSLAN_64", "Clear the system cache");
+define("ADMSLAN_65", "Configure mail settings and mailout");
+define("ADMSLAN_66", "Configure Search");
+define("ADMSLAN_67", "Scan with file inspector");
+define("ADMSLAN_68", "Configure email notification");
+define("ADMSLAN_69", "is already an administrator and must be edited.");
+
+define("ADMSLAN_70", "Return to Administrator Listing");
+define("ADMSLAN_71", "Click here to display privelages");  
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_admin.php 75/e107_languages/English/admin/lan_admin.php
--- 6171/e107_languages/English/admin/lan_admin.php	2004-09-10 04:41:22.000000000 -0500
+++ 75/e107_languages/English/admin/lan_admin.php	2006-05-13 13:18:43.000000000 -0500
@@ -1,142 +1,253 @@
-<?php
-
-define("ADLAN_0", "News");
-define("ADLAN_1", "Add/edit/delete news items");
-define("ADLAN_2", "News Categories");
-define("ADLAN_3", "Add/edit/delete news categories");
-define("ADLAN_4", "Preferences");
-define("ADLAN_5", "Edit Site Preferences");
-define("ADLAN_6", "Menus"); 
-define("ADLAN_7", "Alter the order of your menus");
-define("ADLAN_8", "Administrators");
-define("ADLAN_9", "Add/delete site administrators");
-define("ADLAN_10", "Admin password");
-define("ADLAN_11", "Change your password");
-define("ADLAN_12", "Forums");
-define("ADLAN_13", "Add/Edit Forums");
-define("ADLAN_14", "Articles");
-define("ADLAN_15", "Add new/edit/delete articles");
-define("ADLAN_16", "Content");
-define("ADLAN_17", "Add new/edit/delete content pages");
-define("ADLAN_18", "Reviews");
-define("ADLAN_19", "Add new/edit/delete reviews"); 
-define("ADLAN_20", "Links");
-define("ADLAN_21", "Add new/edit/delete links");
-define("ADLAN_22", "Link Categories");
-define("ADLAN_23", "Add new/edit/delete link categories");
-define("ADLAN_24", "Downloads");
-define("ADLAN_25", "Manage Downloads");
-define("ADLAN_26", "Download Categories");
-define("ADLAN_27", "Add new/edit/delete download categories");
-define("ADLAN_28", "Welcome Message");
-define("ADLAN_29", "Set static welcome message");
-define("ADLAN_30", "File Manager");
-define("ADLAN_31", "Manage/upload files");
-define("ADLAN_32", "Submitted News");
-define("ADLAN_33", "Review user submitted news items");
-define("ADLAN_34", "Banlist");
-define("ADLAN_35", "Ban visitors");
-define("ADLAN_36", "Users");
-define("ADLAN_37", "Moderate site members");
-define("ADLAN_38", "User Classes");
-define("ADLAN_39", "Create/edit user classes");
-define("ADLAN_40", "Maintenance");
-define("ADLAN_41", "Take site down for maintenance");
-define("ADLAN_42", "Custom Menus/Pages");
-define("ADLAN_43", "Create custom menu items");
-define("ADLAN_44", "Database");
-define("ADLAN_45", "Database utilities");
-define("ADLAN_46", "Logout");
-define("ADLAN_47", "Welcome");
-define("ADLAN_48", "Logged in");
-define("ADLAN_49", "main site administrator");
-define("ADLAN_50", "permissions");
-define("ADLAN_51", "Please log in to gain access to administration area");
-define("ADLAN_52", "Admin Front Page");
-define("ADLAN_53", "Leave Admin Area");
-define("ADLAN_54", "Banners");
-define("ADLAN_55", "Configure banners");
-define("ADLAN_56", "Chatbox");
-define("ADLAN_57", "Configure chatbox");
-define("ADLAN_58", "Emoticons");
-define("ADLAN_59", "Configure emoticons");
-define("ADLAN_60", "Front Page");
-define("ADLAN_61", "Configure front page content");
-define("ADLAN_62", "News Feeds");
-define("ADLAN_63", "Configure news feeds");
-define("ADLAN_64", "Log Stats");
-define("ADLAN_65", "Log stats/counter etc");
-define("ADLAN_66", "Meta Tags");
-define("ADLAN_67", "Add/Edit site meta tags");
-define("ADLAN_68", "PHP Info");
-define("ADLAN_69", "PHPInfo page");
-define("ADLAN_70", "Polls");
-define("ADLAN_71", "Add/Edit Polls");
-define("ADLAN_72", "Public Uploads");
-define("ADLAN_73", "Configure public file uploads");
-define("ADLAN_74", "Cache");
-define("ADLAN_75", "Set cache status");
-define("ADLAN_77", "You have had a news item submitted - please click here to check.");
-define("ADLAN_78", "Edit");
-define("ADLAN_79", "Delete");
-define("ADLAN_80", "tick to confirm");
-define("ADLAN_81", "Update ");
-define("ADLAN_82", "Create ");
-define("ADLAN_83", "Existing ");
-define("ADLAN_84", "Open HTML Editor ");
-define("ADLAN_85", "Submit ");
-define("ADLAN_86", "Incorrect password ");
-define("ADLAN_87", "Administrator name not found in database ");
-define("ADLAN_88", "Unable to login ");
-define("ADLAN_89", "Admin Name ");
-define("ADLAN_90", "Admin Password ");
-define("ADLAN_91", "Log In");
-define("ADLAN_92", "Please log in to proceed to administration area ...");
-define("ADLAN_93", "Show Admin Functions");
-define("ADLAN_94", "Show Installed Plugins");
-define("ADLAN_95", "Plugin Management");
-define("ADLAN_96", "None");
-define("ADLAN_97", "Click here for FAQ");
-define("ADLAN_98", "Plugin Manager");
-define("ADLAN_99", "Install/upgrade etc plugins");
-define("ADLAN_100", "Theme Layout");
-define("ADLAN_101", "Template Creator");
-define("ADLAN_102", "It has been more than 30 days since you changed the main administrator password - ");
-define("ADLAN_103", "Click here to change it now");
-define("ADLAN_104", "Security");
-
-define("ADLAN_105", "Images");
-define("ADLAN_106", "Image Settings");
-
-define("ADLAN_107", "Unchecked submitted news items");
-define("ADLAN_108", "Unchecked file uploads");
-define("ADLAN_109", "Information");
-define("ADLAN_110", "Registered members");
-define("ADLAN_111", "Unverified members");
-define("ADLAN_112", "Banned users");
-define("ADLAN_113", "Forum posts");
-define("ADLAN_114", "Comments");
-define("ADLAN_115", "Chatbox posts");
-define("ADLAN_116", "Admin log ...");
-define("ADLAN_117", "Show all entries");
-define("ADLAN_118", "Clear log");
-
-define("ADLAN_119", "Unchecked submitted links");
-
-define("ADLAN_120", "There is a database update available, please click button to install ...");
-define("ADLAN_121", "Install");
-define("ADLAN_122", "Update");
-
-define("ADLAN_123", "Unchecked submitted articles");
-define("ADLAN_124", "Unchecked submitted reviews");
-
-define("ADLAN_125", "Unchecked reported forum posts");
-
-define("ADLAN_126", "Main Options");
-define("ADLAN_127", "Users");
-define("ADLAN_128", "Content");
-define("ADLAN_129", "Communication");
-define("ADLAN_130", "Files Management");
-define("ADLAN_131", "Other tools");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_admin.php,v $
+|     $Revision: 1.43 $
+|     $Date: 2006/05/13 18:18:43 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("ADLAN_0", "News");
+define("ADLAN_1", "Add/edit/delete news items");
+define("ADLAN_2", "News Categories");
+define("ADLAN_3", "Add/edit/delete news categories");
+define("ADLAN_4", "Preferences");
+define("ADLAN_5", "Edit Site Preferences");
+define("ADLAN_6", "Menus");
+define("ADLAN_7", "Alter the order of your menus");
+define("ADLAN_8", "Administrators");
+define("ADLAN_9", "Add/delete site administrators");
+define("ADLAN_10", "Admin password");
+define("ADLAN_11", "Change your password");
+define("ADLAN_12", "Forums");
+define("ADLAN_13", "Add/Edit Forums");
+define("ADLAN_14", "Articles");
+define("ADLAN_15", "Add new/edit/delete articles");
+define("ADLAN_16", "Content");
+define("ADLAN_17", "Add new/edit/delete content pages");
+define("ADLAN_18", "Reviews");
+define("ADLAN_19", "Add new/edit/delete reviews");
+define("ADLAN_22", "Link Categories");
+define("ADLAN_23", "Add new/edit/delete link categories");
+define("ADLAN_24", "Downloads");
+define("ADLAN_25", "Manage Downloads");
+define("ADLAN_26", "Download Categories");
+define("ADLAN_27", "Add new/edit/delete download categories");
+define("ADLAN_28", "Welcome Message");
+define("ADLAN_29", "Set static welcome message");
+define("ADLAN_30", "File Manager");
+define("ADLAN_31", "Manage/upload files");
+define("ADLAN_32", "Submitted News");
+define("ADLAN_33", "Review user submitted news items");
+define("ADLAN_34", "Banlist");
+define("ADLAN_35", "Ban visitors");
+define("ADLAN_36", "Users");
+define("ADLAN_37", "Moderate site members");
+define("ADLAN_38", "User Classes");
+define("ADLAN_39", "Create/edit user classes");
+define("ADLAN_40", "Maintenance");
+define("ADLAN_41", "Take site down for maintenance");
+define("ADLAN_42", "Custom Menus/Pages");
+define("ADLAN_43", "Create custom menu items");
+define("ADLAN_44", "Database");
+define("ADLAN_45", "Database utilities");
+define("ADLAN_46", "Logout");
+define("ADLAN_47", "Welcome");
+define("ADLAN_48", "Logged in");
+define("ADLAN_49", "main site administrator");
+define("ADLAN_50", "permissions");
+define("ADLAN_51", "Please log in to gain access to administration area");
+define("ADLAN_52", "Admin Front Page");
+define("ADLAN_53", "Leave Admin");
+define("ADLAN_54", "Banners");
+define("ADLAN_55", "Configure banners");
+define("ADLAN_56", "Chatbox");
+define("ADLAN_57", "Configure chatbox");
+define("ADLAN_58", "Emoticons");
+define("ADLAN_59", "Configure emoticons");
+define("ADLAN_60", "Front Page");
+define("ADLAN_61", "Configure front page content");
+define("ADLAN_62", "News Feeds");
+define("ADLAN_63", "Configure news feeds");
+define("ADLAN_64", "Log Stats");
+define("ADLAN_65", "Log stats/counter etc");
+define("ADLAN_66", "Meta Tags");
+define("ADLAN_67", "Add/Edit site meta tags");
+define("ADLAN_68", "PHP Info");
+define("ADLAN_69", "PHPInfo page");
+define("ADLAN_70", "Polls");
+define("ADLAN_71", "Add/Edit Polls");
+define("ADLAN_72", "Public Uploads");
+define("ADLAN_73", "Configure public file uploads");
+define("ADLAN_74", "Cache");
+define("ADLAN_75", "Set cache status");
+define("ADLAN_77", "You have had a news item submitted - please click here to check.");
+define("ADLAN_78", "Extended User Fields");
+define("ADLAN_79", "Edit extended user fields");
+
+
+define("ADLAN_86", "Incorrect password ");
+define("ADLAN_87", "Administrator name not found in database ");
+define("ADLAN_88", "Unable to login ");
+define("ADLAN_89", "Admin Name ");
+define("ADLAN_90", "Admin Password ");
+define("ADLAN_91", "Log In");
+define("ADLAN_92", "Please log in to proceed to administration area ...");
+define("ADLAN_93", "Show Admin Functions");
+define("ADLAN_94", "Show Installed Plugins");
+define("ADLAN_95", "Plugin Management");
+define("ADLAN_96", "None");
+define("ADLAN_97", "Click here for FAQ");
+define("ADLAN_98", "Plugin Manager");
+define("ADLAN_99", "Install/upgrade etc plugins");
+define("ADLAN_100", "Theme Layout");
+define("ADLAN_101", "Template Creator");
+define("ADLAN_102", "It has been more than 30 days since you changed the main administrator password - ");
+define("ADLAN_103", "Click here to change it now");
+define("ADLAN_104", "Security");
+
+define("ADLAN_105", "Images");
+define("ADLAN_106", "Image Settings");
+
+define("ADLAN_107", "Unchecked submitted news items");
+define("ADLAN_108", "Unchecked file uploads");
+define("ADLAN_109", "Information");
+define("ADLAN_110", "Registered members");
+define("ADLAN_111", "Unverified members");
+define("ADLAN_112", "Banned users");
+define("ADLAN_113", "Forum posts");
+define("ADLAN_114", "Comments");
+define("ADLAN_115", "Chatbox posts");
+define("ADLAN_116", "Admin log ...");
+define("ADLAN_117", "Show all entries");
+define("ADLAN_118", "Clear log");
+
+define("ADLAN_119", "Unchecked submitted links");
+
+define("ADLAN_120", "There is a database update available, please click button to install ...");
+define("ADLAN_121", "Install");
+
+
+define("ADLAN_123", "Unchecked submitted articles");
+define("ADLAN_124", "Unchecked submitted reviews");
+
+define("ADLAN_125", "Unchecked reported forum posts");
+
+define("ADLAN_126", "Main Options");
+define("ADLAN_127", "Users");
+define("ADLAN_128", "Content");
+define("ADLAN_129", "Communication");
+define("ADLAN_130", "Files Management");
+define("ADLAN_131", "Other tools");
+
+define("ADLAN_132", "Language");
+define("ADLAN_133", "default");
+
+define("ADLAN_134", "Status");
+define("ADLAN_135", "Admin Log");
+
+define("ADLAN_136", "Mail");
+define("ADLAN_137", "Email Settings And Mailout");
+
+define("ADLAN_138", "Site Links");
+define("ADLAN_139", "Add/edit/delete links");
+
+define("ADLAN_140", "Theme Manager");
+define("ADLAN_141", "Install / set themes etc");
+
+define("ADLAN_142", "Search");
+define("ADLAN_143", "Search Configuration");
+define("ADLAN_144", "You are in simple-view mode, to switch to advanced-view");
+define("ADLAN_145", "click here");
+
+define("ADLAN_146", "Failed login attempts");
+define("ADLAN_147", "File Inspector");
+define("ADLAN_148", "Scan site files");
+
+define("ADLAN_149", "Notify");
+define("ADLAN_150", "Admin Email Notifications");
+
+define("ADLAN_151", "Main");
+define("ADLAN_152", "Enter Code");
+
+define('ADLAN_CL_1', 'Settings');
+define('ADLAN_CL_2', 'Users');
+define('ADLAN_CL_3', 'Content');
+define('ADLAN_CL_4', 'Coms');
+define('ADLAN_CL_5', 'Files');
+define('ADLAN_CL_6', 'Tools');
+define('ADLAN_CL_7', 'Plugins');
+define('ADLAN_CL_8', 'Docs');
+
+define("ADLAN_LAT_1", "Latest");
+
+define("ADLAN_LAT_2", "Submitted news items");
+define("ADLAN_LAT_3", "Submitted articles");
+define("ADLAN_LAT_4", "Submitted reviews");
+define("ADLAN_LAT_5", "Submitted links");
+define("ADLAN_LAT_6", "Reported forum posts");
+define("ADLAN_LAT_7", "File uploads");
+define("ADLAN_LAT_8", "There are unmoderated administrator messages");
+
+define("ADLAN_ERR_1", "Warning!");
+define("ADLAN_ERR_2", "There are files on your server that are known to be exploitable. These must be removed <b>immediately</b>. The files are related to the older 0.6xx branch of e107. Please delete the following directories and all their contents:");
+define("ADLAN_ERR_3", "There are one or more files in your public upload directories that are not in your allowed upload filetypes list. These may have been placed here by an attacker and if so should be removed <b>immediately</b>. You should <b>not</b> open these files as this may execute any malicious code the file might contain. ie. do not open them with your browser.<br /><br />If you recognise these files as being legitimate, it is likely that due to the recent allowed filetypes changes, the filetype you allowed is no longer in the allowed filetypes list and you will need to re-add it (see admin => uploads). You should not allow the upload of .html, .txt, etc as an attacker may upload a file of this type which includes malicious javascript. You should also, of course, not allow the upload of .php files or any other type of executable script.<br /><br />Below is the list of files that could potentially be malicious:");
+
+// Common Terms
+define("LAN_EDIT","Edit");
+define("LAN_DELETE","Delete");
+define("LAN_CREATE","Create");
+define("LAN_UPDATE","Update");
+define("LAN_SAVE","Save");
+define("LAN_SAVED","Saved");
+define("LAN_SETSAVED","Your settings have been saved");
+define("LAN_ERROR","Error");
+define("LAN_CONFIRMDEL","Please confirm you wish to delete");
+define("LAN_OPTIONS","Options");
+define("LAN_PREFS","Preferences");
+define("LAN_DELETED","Successfully deleted");
+define("LAN_UPDATED","Successfully updated");
+define("LAN_CREATED","Successfully created");
+define("LAN_CREATED_FAILED","Creation Unsuccessful");
+define("LAN_DELETED_FAILED","Deletion Unsuccessful");
+define("LAN_UPDATED_FAILED","Update Unsuccessful");
+define("LAN_NO_CHANGE","Update unsuccessful as no changes were made.");
+define("LAN_TRY_AGAIN","Please try again.");
+
+define("LAN_RESET","Reset");
+define("LAN_CLEAR","Clear");
+define("LAN_OK","OK");
+
+define("LAN_PRESET","Preset");
+define("LAN_PRESET_SAVED","Preset saved successfully");
+define("LAN_PRESET_DELETED","Preset successfully deleted");
+define("LAN_PRESET_CONFIRMDEL","Are you sure you want to delete this preset?");
+define("LAN_NOTWRITABLE"," is not writable, you need to CHMOD 777 the folder first.");
+define("LAN_DATE","Date");
+define("LAN_TIME","Time");
+define("LAN_YES","Yes");
+define("LAN_NO","No");
+define("LAN_EMPTY","There are no entries in the database yet");
+define("LAN_EXISTING","Existing Entries");
+
+define("LAN_CANCEL","Cancel");
+define("LAN_CONFDELETE","Confirm Delete");
+define("LAN_PLUGIN","Plugin");
+define("LAN_ORDER","Order");
+
+define("LAN_SELECT","Select ...");
+define("LAN_ADMIN","Admin");
+define("LAN_DISPLAYOPT", "Edit Display Options");
+define("LAN_GOPAGE", "Go to page:");
+define("LAN_DATESTAMP","Datestamp");
+define("LAN_OPTIONAL", "optional");
+define("LAN_INACTIVE","Inactive");
+
+define("LAN_BAN","Ban");
+define("LAN_RATING", "Rating");
+
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_article.php 75/e107_languages/English/admin/lan_article.php
--- 6171/e107_languages/English/admin/lan_article.php	2004-08-13 19:02:14.000000000 -0500
+++ 75/e107_languages/English/admin/lan_article.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,87 +0,0 @@
-<?php
-
-define("ARLAN_0", "Article saved in database.");
-define("ARLAN_1", "Fields left blank.");
-define("ARLAN_2", "Article updated in database.");
-define("ARLAN_3", "Parent added to database.");
-define("ARLAN_4", "Article parent updated in database.");
-define("ARLAN_5", "Article parent deleted.");
-define("ARLAN_6", "Please tick the confirm box to delete the article"); 
-define("ARLAN_7", "Articles");
-define("ARLAN_8", "No parents yet");
-define("ARLAN_9", "Existing Parents");
-define("ARLAN_10", "Parent Title");
-define("ARLAN_11", "Parent Summary");
-define("ARLAN_12", "Parent");
-define("ARLAN_13", "Parents");
-define("ARLAN_14", "No articles");
-define("ARLAN_15", "Articles");
-define("ARLAN_16", "No parent");
-define("ARLAN_17", "Heading");
-define("ARLAN_18", "Sub-Heading");
-define("ARLAN_19", "Summary");
-define("ARLAN_20", "Article");
-define("ARLAN_21", "Allow comments?");
-define("ARLAN_22", "On");
-define("ARLAN_23", "Off");
-define("ARLAN_24", "Add email/print icons?");
-define("ARLAN_25", "Yes");
-define("ARLAN_26", "No");
-define("ARLAN_27", "Preview Again");
-define("ARLAN_28", "Preview");
-define("ARLAN_29", "Please tick the confirm box to delete the article");
-define("ARLAN_30", "Article deleted.");
-define("ARLAN_31", "First letters.");
-define("ARLAN_32", "Please select a letter above.");
-
-
-define("ARLAN_55", "Visible to");
-define("ARLAN_56", "Article Category Saved");
-define("ARLAN_57", "Article Category Updated");
-define("ARLAN_58", "Category deleted");
-define("ARLAN_59", "Category");
-define("ARLAN_60", "Options");
-define("ARLAN_61", "Edit");
-define("ARLAN_62", "Delete");
-define("ARLAN_63", "No article categories");
-define("ARLAN_64", "Existing Article Categories");
-define("ARLAN_65", "Category Name");
-define("ARLAN_66", "Category Icon");
-define("ARLAN_67", "View Images");
-define("ARLAN_68", "Category Summary");
-define("ARLAN_69", "Update Article Category");
-define("ARLAN_70", "Clear Form");
-define("ARLAN_71", "Create Article Category");
-define("ARLAN_72", "Existing Articles");
-define("ARLAN_73", "Open HTML Editor");
-define("ARLAN_74", "Category");
-define("ARLAN_75", "None");
-define("ARLAN_76", "Article Front Page");
-define("ARLAN_77", "Create new Article");
-define("ARLAN_78", "Categories");
-define("ARLAN_79", "Article Options");
-define("ARLAN_80", "Are you sure you want to delete this category?");
-define("ARLAN_81", "Are you sure you want to delete this article?");
-define("ARLAN_82", "Author Details");
-define("ARLAN_83", "leave if article written by you");
-define("ARLAN_84", "author name");
-define("ARLAN_85", "author email address");
-
-define("ARLAN_86", "Allow articles to be submitted");
-define("ARLAN_87", "Allow visitors to submit articles to your site");
-define("ARLAN_88", "Submit articles class");
-define("ARLAN_89", "Select which users can submit articles");
-define("ARLAN_90", "Update Options");
-define("ARLAN_91", "Article Options");
-define("ARLAN_92", "Article options updated");
-define("ARLAN_93", "Submitted Articles");
-define("ARLAN_94", "No submitted articles");
-define("ARLAN_95", "No email address supplied");
-define("ARLAN_96", "Article Heading");
-define("ARLAN_97", "Post");
-define("ARLAN_98", "Post User Submitted Article");
-define("ARLAN_99", "User submitted article saved in database");
-define("ARLAN_100", "Click here to fill author fields");
-
-define("ARLAN_101", "by");
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_banlist.php 75/e107_languages/English/admin/lan_banlist.php
--- 6171/e107_languages/English/admin/lan_banlist.php	2004-06-17 19:48:04.000000000 -0500
+++ 75/e107_languages/English/admin/lan_banlist.php	2005-06-17 01:49:46.000000000 -0500
@@ -1,19 +1,23 @@
-<?php
-
-define("BANLAN_1", "Ban removed.");
-define("BANLAN_2", "No bans.");
-define("BANLAN_3", "Existing Bans");
-define("BANLAN_4", "Remove ban");
-define("BANLAN_5", "Enter IP or Email Address");
-define("BANLAN_6", "Ban by email address"); 
-define("BANLAN_7", "Reason");
-define("BANLAN_8", "Ban User");
-define("BANLAN_9", "Ban users from site");
-
-define("BANLAN_10", "IP / Email / Reason");
-define("BANLAN_11", "Options");
-define("BANLAN_12", "Edit");
-define("BANLAN_13", "Update Ban");
-define("BANLAN_14", "Ban Updated");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_banlist.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/06/17 06:49:46 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+define("BANLAN_1", "Ban removed.");
+define("BANLAN_2", "No bans.");
+define("BANLAN_3", "Existing Bans");
+define("BANLAN_4", "Remove ban");
+define("BANLAN_5", "Enter IP, email address, or host");
+define("BANLAN_7", "Reason");
+define("BANLAN_8", "Ban User");
+define("BANLAN_9", "Ban users from site");
+define("BANLAN_10", "IP / Email / Reason");
+define("BANLAN_11", "Auto-ban: More than 10 failed login attempts");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_banner.php 75/e107_languages/English/admin/lan_banner.php
--- 6171/e107_languages/English/admin/lan_banner.php	2004-03-25 23:35:12.000000000 -0600
+++ 75/e107_languages/English/admin/lan_banner.php	2005-06-22 17:21:37.000000000 -0500
@@ -1,54 +1,74 @@
-<?php
-
-define("BNRLAN_1", "Banner deleted.");
-define("BNRLAN_2", "Please confirm you wish to delete this banner - once deleted it cannot be retrieved");
-define("BNRLAN_3", "Cancel");
-define("BNRLAN_4", "Confirm Delete");
-define("BNRLAN_5", "Confirm Delete Banner");
-define("BNRLAN_6", "Delete cancelled."); 
-define("BNRLAN_7", "Existing Banners");
-define("BNRLAN_8", "Banner ID");
-define("BNRLAN_9", "Client");
-
-define("BNRLAN_10", "Clickthroughs");
-define("BNRLAN_11", "Click %");
-define("BNRLAN_12", "Impressions");
-define("BNRLAN_13", "Impressions Left");
-define("BNRLAN_14", "Options");
-define("BNRLAN_15", "No banners yet.");
-define("BNRLAN_16", "Unlimited");
-define("BNRLAN_17", "None");
-define("BNRLAN_18", "Delete");
-define("BNRLAN_19", "Yes");
-define("BNRLAN_20", "No");
-define("BNRLAN_21", "Ends");
-define("BNRLAN_22", "Update Banner");
-define("BNRLAN_23", "Add New Banner");
-define("BNRLAN_24", "Campaign");
-
-define("BNRLAN_25", "choose existing campaign");
-define("BNRLAN_26", "enter new campaign");
-define("BNRLAN_27", "Client");
-define("BNRLAN_28", "choose existing client");
-define("BNRLAN_29", "enter new client");
-define("BNRLAN_30", "Client Login");
-define("BNRLAN_31", "Client Password");
-define("BNRLAN_32", "Banner Image");
-define("BNRLAN_33", "Click URL");
-define("BNRLAN_34", "Impressions Purchased");
-define("BNRLAN_35", "unlimited");
-define("BNRLAN_36", "Start Date");
-
-define("BNRLAN_37", "End Date");
-define("BNRLAN_38", "blank = no limit");
-define("BNRLAN_39", "Active");
-define("BNRLAN_40", "Update Banner");
-define("BNRLAN_41", "Create New Banner");
-define("BNRLAN_42", "Banner Rotation System");
-
-define("BNRLAN_43", "Choose banner image");
-define("BNRLAN_44", "Edit");
-define("BNRLAN_45", "Starts");
-define("BNRLAN_46", "Code");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_banner.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/06/22 22:21:37 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+define("BNRLAN_1", "Banner deleted.");
+define("BNRLAN_2", "Please confirm you wish to delete this banner - once deleted it cannot be retrieved");
+define("BNRLAN_5", "Confirm Delete Banner");
+define("BNRLAN_6", "Delete cancelled.");
+define("BNRLAN_7", "Existing Banners");
+define("BNRLAN_8", "Banner ID");
+define("BNRLAN_9", "Client");
+define("BNRLAN_10", "Clickthroughs");
+define("BNRLAN_11", "Click %");
+define("BNRLAN_12", "Impressions");
+define("BNRLAN_13", "Impressions Left");
+define("BNRLAN_15", "No banners yet.");
+define("BNRLAN_16", "Unlimited");
+define("BNRLAN_17", "None");
+define("BNRLAN_21", "Ends");
+define("BNRLAN_22", "Update Banner");
+define("BNRLAN_23", "Add New Banner");
+define("BNRLAN_24", "Campaign");
+define("BNRLAN_25", "choose existing campaign");
+define("BNRLAN_26", "enter new campaign");
+define("BNRLAN_27", "Client");
+define("BNRLAN_28", "choose existing client");
+define("BNRLAN_29", "enter new client");
+define("BNRLAN_30", "Client Login");
+define("BNRLAN_31", "Client Password");
+define("BNRLAN_32", "Banner Image");
+define("BNRLAN_33", "Click URL");
+define("BNRLAN_34", "Impressions Purchased");
+define("BNRLAN_35", "unlimited");
+define("BNRLAN_36", "Start Date");
+define("BNRLAN_37", "End Date");
+define("BNRLAN_38", "blank = no limit");
+define("BNRLAN_39", "visibility class");
+define("BNRLAN_40", "Update Banner");
+define("BNRLAN_41", "Create New Banner");
+define("BNRLAN_42", "Banner Rotation System");
+define("BNRLAN_43", "Choose banner image");
+define("BNRLAN_45", "Starts");
+define("BNRLAN_46", "Code");
+define("BNRLAN_58", "banner front page");
+define("BNRLAN_59", "create new banner");
+define("BNRLAN_60", "campaigns");
+define("BNRLAN_61", "banner menu ");
+define("BNRLAN_62", "banner options");
+define("BNRLAN_63", "Banner Created");
+define("BNRLAN_64", "Banner Updated");
+
+define("BANNER_MENU_L1", "Advertisement");
+define("BANNER_MENU_L2", "Banner menu configuration saved");
+
+//v.617
+define("BANNER_MENU_L3", "Caption");
+define("BANNER_MENU_L5", "Banner Configuration"); 
+define("BANNER_MENU_L6", "choose campaigns to show in menu");
+define("BANNER_MENU_L7", "available campaigns");
+define("BANNER_MENU_L8", "selected campaigns");
+define("BANNER_MENU_L9", "remove selection");
+define("BANNER_MENU_L10", "Render type");
+define("BANNER_MENU_L12", "plain");
+define("BANNER_MENU_L13", "in captioned box");
+define("BANNER_MENU_L18", "Update Menu Settings");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_cache.php 75/e107_languages/English/admin/lan_cache.php
--- 6171/e107_languages/English/admin/lan_cache.php	2004-05-11 23:37:08.000000000 -0500
+++ 75/e107_languages/English/admin/lan_cache.php	2005-04-02 15:08:06.000000000 -0600
@@ -1,14 +1,23 @@
-<?php
-
-define("CACLAN_1", "Cache system status");
-define("CACLAN_2", "Set cache status");
-define("CACLAN_3", "Cache System");
-define("CACLAN_4", "Cache status set");
-define("CACLAN_5", "Empty Cache");
-define("CACLAN_6", "Cache Emptied");
-
-define("CACLAN_7", "Cache Disabled");
-define("CACLAN_8", "Cache data saved to MySQL");
-define("CACLAN_9", "Cache data saved to disk file");
-define("CACLAN_10", "The cache directory is not writable. Please ensure this directory is set CHMOD 0777");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_cache.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/04/02 21:08:06 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("CACLAN_1", "Cache System Status");
+define("CACLAN_2", "Set cache status");
+define("CACLAN_3", "Cache System");
+define("CACLAN_4", "Cache status set");
+define("CACLAN_5", "Empty Cache");
+define("CACLAN_6", "Cache Emptied");
+
+define("CACLAN_7", "Cache Disabled");
+// define("CACLAN_8", "Cache data saved to MySQL");
+define("CACLAN_9", "Cache data saved to disk file");
+define("CACLAN_10", "The cache directory is not writable. Please ensure this directory is set CHMOD 0777");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_chatbox.php 75/e107_languages/English/admin/lan_chatbox.php
--- 6171/e107_languages/English/admin/lan_chatbox.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/admin/lan_chatbox.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,37 +0,0 @@
-<?php
-
-define("CHBLAN_1", "Chatbox settings updated.");
-define("CHBLAN_2", "Moderated.");
-define("CHBLAN_3", "No chatbox posts yet.");
-define("CHBLAN_4", "Member");
-define("CHBLAN_5", "Guest");
-define("CHBLAN_6", "unblock");
-define("CHBLAN_7", "block");
-define("CHBLAN_8", "delete");
-define("CHBLAN_9", "Moderate Chatbox");
-define("CHBLAN_10", "Moderate posts");
-define("CHBLAN_11", "Chatbox posts to display");
-define("CHBLAN_12", "amount of posts displayed in chatbox");
-define("CHBLAN_13", "Replace links");
-define("CHBLAN_14", "if ticked, posted links will be replaced by text entered in box below");
-define("CHBLAN_15", "Replace string if activated");
-define("CHBLAN_16", "links will be replaced by this string");
-define("CHBLAN_17", "Wordwrap count");
-define("CHBLAN_18", "words longer than the number you set here will be wrapped");
-define("CHBLAN_19", "Update Chatbox Settings");
-define("CHBLAN_20", "Chatbox Settings");
-define("CHBLAN_21", "Prune");
-define("CHBLAN_22", "Delete posts older than a certain time period");
-define("CHBLAN_23", "Delete posts older than ");
-
-define("CHBLAN_24", "One day");
-define("CHBLAN_25", "One week");
-define("CHBLAN_26", "One month");
-define("CHBLAN_27", "- Delete all posts -");
-define("CHBLAN_28", "Chatbox pruned.");
-
-define("CHBLAN_29", "Display chatbox inside scrolling layer");
-define("CHBLAN_30", "Layer height");
-define("CHBLAN_31", "Show emoticons");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_content.php 75/e107_languages/English/admin/lan_content.php
--- 6171/e107_languages/English/admin/lan_content.php	2004-06-03 19:35:56.000000000 -0500
+++ 75/e107_languages/English/admin/lan_content.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,39 +0,0 @@
-<?php
-
-define("CNTLAN_1", "Fields left blank.");
-define("CNTLAN_2", "Content updated in database.");
-define("CNTLAN_3", "Please tick the confirm box to delete this content page");
-define("CNTLAN_4", "No content pages yet.");
-define("CNTLAN_5", "Existing Content Pages");
-define("CNTLAN_6", "Edit");
-define("CNTLAN_7", "Delete");
-define("CNTLAN_8", "tick to confirm");
-define("CNTLAN_9", "Open HTML Editor");
-define("CNTLAN_10", "Link name");
-define("CNTLAN_11", "Page Heading");
-define("CNTLAN_12", "Content");
-define("CNTLAN_13", "Allow comments");
-define("CNTLAN_14", "On");
-define("CNTLAN_15", "Off");
-define("CNTLAN_16", "Update Content Page");
-define("CNTLAN_17", "Create Content Page");
-define("CNTLAN_18", "Content Pages");
-define("CNTLAN_19", "Visible to");
-define("CNTLAN_20", "Content page deleted.");
-define("CNTLAN_21", "Auto line breaks");
-define("CNTLAN_22", "( if you're posting HTML code you should set this to off )");
-
-define("CNTLAN_23", "Content page added without link - to link to this content page use this url");
-define("CNTLAN_24", "Content page added and link created in Main Navigation menu");
-
-define("CNTLAN_25", "Title");
-define("CNTLAN_26", "Options");
-define("CNTLAN_27", "Are you sure you want to delete this content page?");
-
-//v.617
-
-define("CNTLAN_28", "Add email/print icons?");
-define("CNTLAN_29", "Yes");
-define("CNTLAN_30", "No");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_cpage.php 75/e107_languages/English/admin/lan_cpage.php
--- 6171/e107_languages/English/admin/lan_cpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_cpage.php	2005-06-22 12:08:01.000000000 -0500
@@ -0,0 +1,55 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_cpage.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/06/22 17:08:01 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+define("CUSLAN_1", "Title");
+define("CUSLAN_2", "Type");
+define("CUSLAN_3", "Options");
+define("CUSLAN_4", "Delete this page?");
+define("CUSLAN_5", "Existing Pages");
+define("CUSLAN_7", "Menu Name");
+define("CUSLAN_8", "Title / Caption");
+define("CUSLAN_9", "Text");
+define("CUSLAN_10", "Allow page to be rated");
+define("CUSLAN_11", "Front page");
+define("CUSLAN_12", "Create page");
+define("CUSLAN_13", "Allow comments");
+define("CUSLAN_14", "Password protect page");
+define("CUSLAN_15", "enter password to protect page");
+define("CUSLAN_16", "Create link in main menu");
+define("CUSLAN_17", "enter link name to create");
+define("CUSLAN_18", "Page / link visible to");
+define("CUSLAN_19", "Update Page");
+define("CUSLAN_20", "Create Page");
+define("CUSLAN_21", "Update Menu");
+define("CUSLAN_22", "Create Menu");
+define("CUSLAN_23", "Edit page");
+define("CUSLAN_24", "Create new page");
+define("CUSLAN_25", "Edit menu");
+define("CUSLAN_26", "Create new menu");
+define("CUSLAN_27", "Page saved to database.");
+define("CUSLAN_28", "Page deleted");
+define("CUSLAN_29", "List pages if no page selected");
+define("CUSLAN_30", "Expiry time for cookie (in seconds)");
+define("CUSLAN_31", "Create menu");
+define("CUSLAN_32", "Convert old pages/menus");
+define("CUSLAN_33", "Page Options");
+define("CUSLAN_34", "Beginning conversion");
+define("CUSLAN_35", "Finished custom page update - updated");
+define("CUSLAN_36", "To set your preferences for each page, please return to front page and edit the pages.");
+define("CUSLAN_37", "Custom Page Update");
+define("CUSLAN_38", "on");
+define("CUSLAN_39", "off");
+define("CUSLAN_40", "Save Options");
+
+define("CUSLAN_41", "Display author and date information");
+define("CUSLAN_42", "No pages defined yet");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_credits.php 75/e107_languages/English/admin/lan_credits.php
--- 6171/e107_languages/English/admin/lan_credits.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_credits.php	2005-06-10 10:40:55.000000000 -0500
@@ -0,0 +1,22 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_credits.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/06/10 15:40:55 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+define("CRELAN_1", "Credits");
+define("CRELAN_2", "Here is a list of third-party software / resources used in e107. The e107 development team would like to personally thank the developers of the following for allowing us to redistribute their code with e107, and for releasing their software under the GPL licence.");
+// define("CRELAN_3", "Resource");
+// define("CRELAN_4", "Description");
+// define("CRELAN_5", "Website");
+// define("CRELAN_6", "Permission");
+define("CRELAN_7", "version");
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_custommenu.php 75/e107_languages/English/admin/lan_custommenu.php
--- 6171/e107_languages/English/admin/lan_custommenu.php	2004-09-06 04:55:18.000000000 -0500
+++ 75/e107_languages/English/admin/lan_custommenu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,45 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/admin/lan_custommenu.php,v $
-|     $Revision: 1.4 $
-|     $Date: 2004/09/06 09:55:17 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("CUSLAN_1", "Fields left blank.");
-define("CUSLAN_2", "Unable to create custom menu - please ensure your ");
-define("CUSLAN_3", "custom directory is CHMODDed to 777.");
-define("CUSLAN_4", "Custom menu/page updated.");
-define("CUSLAN_5", "Custom menu successfully created. To activate go to your menus screen.");
-define("CUSLAN_6", "Unable to open menu/page");
-define("CUSLAN_7", "for reading");
-define("CUSLAN_8", "Existing Menus");
-define("CUSLAN_9", "Edit");
-define("CUSLAN_10", "None");
-define("CUSLAN_11", "Menu/Page Filename");
-define("CUSLAN_12", "Menu/Page Caption Title");
-define("CUSLAN_13", "Menu/Page Text");
-define("CUSLAN_14", "Preview Again");
-define("CUSLAN_15", "Preview");
-define("CUSLAN_16", "Update Custom Menu/Page");
-define("CUSLAN_17", "Create Custom Menu/Page");
-define("CUSLAN_18", "Custom Menus/Pages");
-// New for .617
-define("CUSLAN_19", "Existing Pages");
-define("CUSLAN_20", "Unable to create custom page - please ensure your ");
-define("CUSLAN_21", "custompages directory is CHMODDed to 777.");
-define("CUSLAN_22", "Menu");
-define("CUSLAN_23", "Page");
-define("CUSLAN_24", "Custom Page successfully created. The URL will be:");
-define("CUSLAN_25", "Create a link in the main menu ?");
-define("CUSLAN_26", "Link displayed for everybody and opened in the same window !");
-define("CUSLAN_27", "You already have a link in your main menu for this page or with the same name...");
-define("CUSLAN_28", "Link to this page now created !!! Go to your links section to update link properties.");
-
-define("CUSLAN_29", "e107_plugins/custompages/");
-define("CUSLAN_30", "If required edit link properties here ");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_db.php 75/e107_languages/English/admin/lan_db.php
--- 6171/e107_languages/English/admin/lan_db.php	2004-03-31 20:20:42.000000000 -0600
+++ 75/e107_languages/English/admin/lan_db.php	2005-11-24 10:29:02.000000000 -0600
@@ -1,20 +1,29 @@
-<?php
-
-define("DBLAN_1", "Core settings backed up in database.");
-define("DBLAN_2", "Click button to save a backup of your e107 database");
-define("DBLAN_3", "Backup SQL database");
-define("DBLAN_4", "Click button to check validity of e107 database");
-define("DBLAN_5", "Check database validity");
-define("DBLAN_6", "Click button to optimize your e107 database");
-define("DBLAN_7", "Optimize SQL database");
-define("DBLAN_8", "Click button to backup your core settings");
-define("DBLAN_9", "Backup core");
-define("DBLAN_10", "Database Utilities");
-define("DBLAN_11", "mySQL database");
-define("DBLAN_12", "optimized");
-define("DBLAN_13", "Back");
-define("DBLAN_14", "Done");
-define("DBLAN_15", "Click button to check for any available db updates");
-define("DBLAN_16", "Check for Updates");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_db.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/11/24 16:29:02 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+define("DBLAN_1", "Core settings backed up in database.");
+define("DBLAN_2", "Click button to save a backup of your e107 database");
+define("DBLAN_3", "Backup SQL database");
+define("DBLAN_4", "Click button to check validity of e107 database");
+define("DBLAN_5", "Check database validity");
+define("DBLAN_6", "Click button to optimize your e107 database");
+define("DBLAN_7", "Optimize SQL database");
+define("DBLAN_8", "Click button to backup your core settings");
+define("DBLAN_9", "Backup core");
+define("DBLAN_10", "Database Utilities");
+define("DBLAN_11", "MySQL database");
+define("DBLAN_12", "optimized");
+define("DBLAN_13", "Back");
+define("DBLAN_14", "Done");
+define("DBLAN_15", "Click button to check for any available db updates");
+define("DBLAN_16", "Check for Updates");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_db_verify.php 75/e107_languages/English/admin/lan_db_verify.php
--- 6171/e107_languages/English/admin/lan_db_verify.php	2004-03-12 22:38:22.000000000 -0600
+++ 75/e107_languages/English/admin/lan_db_verify.php	2005-04-02 12:29:48.000000000 -0600
@@ -1,22 +1,33 @@
-<?php
-
-define("DBLAN_1", "Unable to read the sql datafile<br /><br />Please ensure the file <b>core_sql.php</b> exists in the <b>/admin/sql</b> directory.");
-define("DBLAN_2", "Verifying all");
-//define("DBLAN_3", "for version");
-define("DBLAN_4", "Table");
-define("DBLAN_5", "Field");
-define("DBLAN_6", "Status");
-define("DBLAN_7", "Notes");
-define("DBLAN_8", "Mismatch");
-define("DBLAN_9", "Currently");
-define("DBLAN_10", "should be");
-define("DBLAN_11", "Field missing");
-define("DBLAN_12", "Extra Field!");
-define("DBLAN_13", "Table missing!");
-define("DBLAN_14", "Choose table(s) to validate");
-define("DBLAN_15", "Start Verify");
-define("DBLAN_16", "SQL Verification");
-define("DBLAN_17", "Back");
-define("DBLAN_18", "tables");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_db_verify.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/04/02 18:29:48 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("DBLAN_1", "Unable to read the sql datafile<br /><br />Please ensure the file <b>core_sql.php</b> exists in the <b>/admin/sql</b> directory.");
+define("DBLAN_2", "Verifying all");
+
+define("DBLAN_4", "Table");
+define("DBLAN_5", "Field");
+define("DBLAN_6", "Status");
+define("DBLAN_7", "Notes");
+define("DBLAN_8", "Mismatch");
+define("DBLAN_9", "Currently");
+define("DBLAN_10", "should be");
+define("DBLAN_11", "Field missing");
+define("DBLAN_12", "Extra Field!");
+define("DBLAN_13", "Table missing!");
+define("DBLAN_14", "Choose table(s) to validate");
+define("DBLAN_15", "Start Verify");
+define("DBLAN_16", "SQL Verification");
+define("DBLAN_17", "Back");
+define("DBLAN_18", "tables");
+define("DBLAN_19", "Attempt to Fix");
+define("DBLAN_20", "Attempting to fix tables");
+define("DBLAN_21", "Fix Selected Items");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_docs.php 75/e107_languages/English/admin/lan_docs.php
--- 6171/e107_languages/English/admin/lan_docs.php	2004-06-08 06:24:34.000000000 -0500
+++ 75/e107_languages/English/admin/lan_docs.php	2004-09-21 14:11:04.000000000 -0500
@@ -1,3 +1,3 @@
-<?php
-
+<?php
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_download.php 75/e107_languages/English/admin/lan_download.php
--- 6171/e107_languages/English/admin/lan_download.php	2004-05-22 21:57:08.000000000 -0500
+++ 75/e107_languages/English/admin/lan_download.php	2006-03-05 00:10:42.000000000 -0600
@@ -1,80 +1,136 @@
-<?php
-
-define("DOWLAN_1", "Download added to database.");
-define("DOWLAN_2", "Download updated in database.");
-define("DOWLAN_3", "Download deleted.");
-define("DOWLAN_4", "Please tick the confirm box to delete the download");
-define("DOWLAN_5", "There are no download categories defined yet, until you define some you cannot enter any downloads.");
-define("DOWLAN_6", "No existing downloads");
-define("DOWLAN_7", "Existing Downloads");
-define("DOWLAN_8", "Edit");
-define("DOWLAN_9", "Delete");
-define("DOWLAN_10", "tick to confirm");
-define("DOWLAN_11", "Category");
-define("DOWLAN_12", "Name");
-define("DOWLAN_13", "File");
-define("DOWLAN_14", "enter url if external file");
-define("DOWLAN_15", "Author");
-define("DOWLAN_16", "Author Email");
-define("DOWLAN_17", "Author Website");
-define("DOWLAN_18", "Description");
-define("DOWLAN_19", "Main image");
-define("DOWLAN_20", "Thumbnail image");
-define("DOWLAN_21", "Active?");
-define("DOWLAN_22", "Yes");
-define("DOWLAN_23", "No");
-define("DOWLAN_24", "Update Download");
-define("DOWLAN_25", "Submit Download");
-define("DOWLAN_26", "Downloads");
-define("DOWLAN_27", "Download");
-define("DOWLAN_28", "Options");
-define("DOWLAN_29", "Downloads Front Page");
-define("DOWLAN_30", "Create Download");
-define("DOWLAN_31", "Categories");
-define("DOWLAN_32", "Downloads Options");
-define("DOWLAN_33", "Are you sure you want to delete this download?");
-define("DOWLAN_34", "Are you sure you want to delete this download category?");
-define("DOWLAN_35", "Download");
-define("DOWLAN_36", "deleted");
-define("DOWLAN_37", "Parent");
-define("DOWLAN_38", "No existing categories");
-define("DOWLAN_39", "Download categories");
-define("DOWLAN_40", "None - main parent");
-define("DOWLAN_41", "Icon");
-define("DOWLAN_42", "View Images");
-define("DOWLAN_43", "Visible to");
-define("DOWLAN_44", "Ticking will make the category visible to only users in that class");
-define("DOWLAN_45", "Create Category");
-define("DOWLAN_46", "Update Category");
-define("DOWLAN_47", "Category created");
-define("DOWLAN_48", "Category Updated");
-define("DOWLAN_49", "Download Category");
-define("DOWLAN_50", "Go to page: ");
-define("DOWLAN_51", "Search downloads");
-define("DOWLAN_52", "Files");
-define("DOWLAN_53", "Subcategory");
-define("DOWLAN_54", "Download Options");
-define("DOWLAN_55", "Number of downloads to display per page");
-define("DOWLAN_56", "Sort by ");
-define("DOWLAN_57", "Downloads");
-define("DOWLAN_58", "Date");
-define("DOWLAN_59", "Filename");
-define("DOWLAN_60", "Author");
-define("DOWLAN_61", "Order ");
-define("DOWLAN_62", "Ascending");
-define("DOWLAN_63", "Descending");
-define("DOWLAN_64", "Update Options");
-define("DOWLAN_65", "Options Updated");
-define("DOWLAN_66", "filesize");
-define("DOWLAN_67", "ID");
-define("DOWLAN_68", "File Missing!");
-
-define("DOWLAN_69", "Downloads handled by PHP");
-define("DOWLAN_70", "Checking this will send all download requests through PHP.");
-
-
-define("DOWLAN_100", "Activate Download Agreement");
-define("DOWLAN_101", "Agreement Text");
-define("DOWLAN_102", "Allow Comments?");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_download.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2006/03/05 06:10:42 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("DOWLAN_1", "Download added to database.");
+define("DOWLAN_2", "Download updated in database.");
+define("DOWLAN_3", "Download deleted.");
+define("DOWLAN_4", "Please tick the confirm box to delete the download");
+define("DOWLAN_5", "There are no download categories defined yet, until you define some you cannot enter any downloads.");
+define("DOWLAN_6", "No existing downloads");
+define("DOWLAN_7", "Existing Downloads");
+
+define("DOWLAN_11", "Category");
+define("DOWLAN_12", "Name");
+define("DOWLAN_13", "File");
+define("DOWLAN_14", "Enter address if download is an external file");
+define("DOWLAN_15", "Author");
+define("DOWLAN_16", "Author Email");
+define("DOWLAN_17", "Author Website");
+define("DOWLAN_18", "Description");
+define("DOWLAN_19", "Main image");
+define("DOWLAN_20", "Thumbnail image");
+define("DOWLAN_21", "Status");
+
+define("DOWLAN_24", "Update Download");
+define("DOWLAN_25", "Submit Download");
+
+define("DOWLAN_27", "Download");
+
+define("DOWLAN_29", "Downloads Front Page");
+define("DOWLAN_30", "Create Download");
+define("DOWLAN_31", "Categories");
+define("DOWLAN_32", "Downloads Options");
+define("DOWLAN_33", "Are you sure you want to delete this download?");
+define("DOWLAN_34", "Are you sure you want to delete this download category?");
+define("DOWLAN_35", "Download");
+define("DOWLAN_36", "deleted");
+define("DOWLAN_37", "Parent");
+define("DOWLAN_38", "No existing categories");
+define("DOWLAN_39", "Download categories");
+define("DOWLAN_40", "None - main parent");
+define("DOWLAN_41", "Icon");
+define("DOWLAN_42", "View Images");
+define("DOWLAN_43", "Visible to");
+define("DOWLAN_44", "Ticking will make the category visible to only users in that class");
+define("DOWLAN_45", "Create Category");
+define("DOWLAN_46", "Update Category");
+define("DOWLAN_47", "Category created");
+define("DOWLAN_48", "Category Updated");
+define("DOWLAN_49", "Download Category");
+
+define("DOWLAN_51", "Search/Refresh downloads");
+define("DOWLAN_52", "Files");
+define("DOWLAN_53", "Subcategory");
+define("DOWLAN_54", "Download Options");
+define("DOWLAN_55", "Number of downloads to display per page");
+define("DOWLAN_56", "Sort by ");
+
+
+define("DOWLAN_59", "Filename");
+define("DOWLAN_60", "Author");
+
+define("DOWLAN_62", "Ascending");
+define("DOWLAN_63", "Descending");
+define("DOWLAN_64", "Update Options");
+define("DOWLAN_65", "Options Updated");
+define("DOWLAN_66", "Enter filesize");
+define("DOWLAN_67", "ID");
+define("DOWLAN_68", "File Missing!");
+define("DOWLAN_69", "Downloads handled by PHP");
+define("DOWLAN_70", "Checking this will send all download requests through PHP.");
+define("DOWLAN_100", "Activate Download Agreement");
+define("DOWLAN_101", "Agreement Text");
+define("DOWLAN_102", "Allow Comments?");
+define("DOWLAN_103", "Remove from Uploads");
+define("DOWLAN_104", "was removed from public uploads");
+define("DOWLAN_105", "Back to Public Uploads");
+define("DOWLAN_106", "May be download by");
+define("DOWLAN_107", "Limit download count");
+define("DOWLAN_108", "Limit download bandwidth");
+define("DOWLAN_109", "every");
+define("DOWLAN_110", "days");
+define("DOWLAN_111", "kb");
+define("DOWLAN_112", "Limits");
+define("DOWLAN_113", "Userclass");
+define("DOWLAN_114", "Add New Limit");
+define("DOWLAN_115", "Update limits");
+define("DOWLAN_116", "Limit for that userclass already exists");
+define("DOWLAN_117", "Limit successfully added");
+define("DOWLAN_118", "Limit not added - unknown error");
+define("DOWLAN_119", "Limit successfully removed");
+define("DOWLAN_120", "Limit not removed - unknown error");
+define("DOWLAN_121", "Limit successfully updated");
+define("DOWLAN_122", "Inactive");
+define("DOWLAN_123", "Active - File is subject to download limits");
+define("DOWLAN_124", "Active - File is NOT subject to download limits");
+define("DOWLAN_125", "Download limits active");
+define("DOWLAN_126", "Activation status updated");
+define("DOWLAN_127", "Only enter filesize if the download is an external file");
+define("DOWLAN_128", "Mirrors");
+define("DOWLAN_129", "leave blank if not using mirrors");
+define("DOWLAN_130", "Add another mirror");
+define("DOWLAN_131", "Select local file");
+define("DOWLAN_132", "Please enter mirror to use, then address to download");
+
+define("DOWLAN_133", "Mirror updated in database");
+define("DOWLAN_134", "Mirror saved in database");
+define("DOWLAN_135", "Mirror deleted");
+define("DOWLAN_136", "image");
+define("DOWLAN_137", "Are you sure you want to delete this mirror?");
+define("DOWLAN_138", "Existing Mirrors");
+define("DOWLAN_139", "Address");
+define("DOWLAN_140", "Upload local images to e107_files/downloadimages to show them here, or enter full address if image is remote");
+define("DOWLAN_141", "Location");
+define("DOWLAN_142", "Update Mirror");
+define("DOWLAN_143", "Create Mirror");
+define("DOWLAN_144", "No mirrors defined in mirror section.");
+
+define("DOWLAN_145", "Download visible to");
+define("DOWLAN_146", "Custom Download-denial message or URL");
+
+
+define("DOWLAN_147", "Icon for empty category");
+define("DOWLAN_148", "Check to update datestamp to current time");
+define("DOWLAN_149", "Or click here to use an external file");
+
+define("DOWLAN_150", "Email admin when broken download reported");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_e107_update.php 75/e107_languages/English/admin/lan_e107_update.php
--- 6171/e107_languages/English/admin/lan_e107_update.php	2004-04-17 09:43:44.000000000 -0500
+++ 75/e107_languages/English/admin/lan_e107_update.php	2005-11-21 10:15:28.000000000 -0600
@@ -1,14 +1,23 @@
-<?php
-
-define("LAN_UPDATE_1", "Update");
-define("LAN_UPDATE_2", "Action");
-define("LAN_UPDATE_3", "Not Needed");
-define("LAN_UPDATE_4", "Update");
-define("LAN_UPDATE_5", "Update available");
-define("LAN_UPDATE_6", "Update all");
-define("LAN_UPDATE_7", "Executed");
-define("LAN_UPDATE_8", "Update from");
-define("LAN_UPDATE_9", "to");
-define("LAN_UPDATE_10", "Available updates");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_e107_update.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/11/21 16:15:28 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_UPDATE_2", "Action");
+define("LAN_UPDATE_3", "Not Needed");
+
+define("LAN_UPDATE_5", "Update available");
+define("LAN_UPDATE_7", "Executed");
+define("LAN_UPDATE_8", "Update from");
+define("LAN_UPDATE_9", "to");
+define("LAN_UPDATE_10", "Available Updates");
+define("LAN_UPDATE_11", ".617 to .7 Update Continued");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_emoticon.php 75/e107_languages/English/admin/lan_emoticon.php
--- 6171/e107_languages/English/admin/lan_emoticon.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/admin/lan_emoticon.php	2006-01-14 19:08:03.000000000 -0600
@@ -1,15 +1,39 @@
-<?php
-
-define("EMOLAN_1", "Emoticon settings updated.");
-define("EMOLAN_2", "Emoticon added.");
-define("EMOLAN_3", "Emoticon deleted.");
-define("EMOLAN_4", "Activate emoticons?");
-define("EMOLAN_5", "Emoticons");
-define("EMOLAN_6", "Delete");
-define("EMOLAN_7", "Update Emoticon Settings");
-define("EMOLAN_8", "Emote code");
-define("EMOLAN_9", "Emote image");
-define("EMOLAN_10", "Add New Emote");
-define("EMOLAN_11", "Emoticon Settings");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_emoticon.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2006/01/15 01:08:03 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+define("EMOLAN_1", "Emote activation");
+define("EMOLAN_2", "Name");
+define("EMOLAN_3", "Emotes");
+define("EMOLAN_4", "Activate emoticons?");
+
+define("EMOLAN_5", "Image");
+define("EMOLAN_6", "Emote Code");
+define("EMOLAN_7", "separate multiple entries with spaces");
+
+define("EMOLAN_8", "Status");
+define("EMOLAN_9", "Options");
+define("EMOLAN_10", "Active");
+define("EMOLAN_11", "Activate pack'");
+
+define("EMOLAN_12", "Edit / configure this pack");
+define("EMOLAN_13", "Installed packs");
+
+define("EMOLAN_14", "Save configuration");
+define("EMOLAN_15", "Edit / configure emotes");
+define("EMOLAN_16", "Emote configuration saved");
+define("EMOLAN_2", "Name");
+define("EMOLAN_2", "Name");
+define("EMOLAN_2", "Name");
+define("EMOLAN_2", "Name");
+define("EMOLAN_2", "Name");
+define("EMOLAN_2", "Name");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_fileinspector.php 75/e107_languages/English/admin/lan_fileinspector.php
--- 6171/e107_languages/English/admin/lan_fileinspector.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_fileinspector.php	2006-01-14 19:08:03.000000000 -0600
@@ -0,0 +1,73 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_fileinspector.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2006/01/15 01:08:03 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+
+define("FC_LAN_1", "File Inspector");
+define("FC_LAN_2", "Scan Options");
+define("FC_LAN_3", "Show");
+define("FC_LAN_4", "All");
+define("FC_LAN_5", "Core Files");
+define("FC_LAN_6", "Integrity Fail Only");
+define("FC_LAN_7", "Non Core Files");
+define("FC_LAN_8", "Check Integrity Of Core Files");
+define("FC_LAN_9", "On");
+define("FC_LAN_10", "Off");
+define("FC_LAN_11", "Scan Now");
+define("FC_LAN_12", "None");
+define("FC_LAN_13", "Missing Core Files");
+define("FC_LAN_14", "Display results as");
+define("FC_LAN_15", "Directory Tree");
+define("FC_LAN_16", "List");
+define("FC_LAN_17", "String Matching");
+define("FC_LAN_18", "Regular expression");
+define("FC_LAN_19", "Show line numbers");
+define("FC_LAN_20", "Show matched lines");
+define("FC_LAN_21", "Old Core Files");
+
+define("FR_LAN_1", "Scanning");
+define("FR_LAN_2", "Scan Results");
+define("FR_LAN_3", "Overview");
+define("FR_LAN_4", "Core files");
+define("FR_LAN_5", "Non core files");
+define("FR_LAN_6", "Total files");
+define("FR_LAN_7", "Integrity Check");
+define("FR_LAN_8", "Core files passed");
+define("FR_LAN_9", "Core files failed");
+define("FR_LAN_10", "Possible reasons for files to fail");
+define("FR_LAN_11", "The file is corrupted");
+define("FR_LAN_12", "This could be for a number of reasons such as the file being corrupted in the zip, got corrupted during 
+extraction or got corrupted during file upload via FTP. You should try reuploading the file to your server 
+and re-run the scan to see if this resolves the error.");
+define("FR_LAN_13", "The file is out of date");
+define("FR_LAN_14", "If the file is from an older release of e107 to the version you are 
+running then it will fail the integrity check. Make sure you have uploaded the newest version of this file.");
+define("FR_LAN_15", "The file has been edited");
+define("FR_LAN_16", "If you have edited this file in any way it will not pass the integrity check. If you
+intentionally edited this file then you need not worry and can ignore this integrity check fail. If however
+the file was edited by someone else without authorisation you may want to re-upload the proper version of
+this file from the e107 zip.");
+define("FR_LAN_17", "If you are a CVS user");
+define("FR_LAN_18", "If you run checkouts of the e107 CVS on your site instead of the official e107 stable 
+releases, then you will discover files have failed integrity check because they have been edited by a dev 
+after the latest core image snapshot was created.");
+define("FR_LAN_19", "files failed");
+define("FR_LAN_20", "All files passed");
+define("FR_LAN_21", "none");
+define("FR_LAN_22", "Missing core files");
+define("FR_LAN_23", "No matches found.");
+define("FR_LAN_24", "Old core files");
+define("FR_LAN_25", "Integrity uncalculable");
+
+define("FR_LAN_26", "Warning! Known Insecurity Detected!");
+define("FR_LAN_27", "There are files on your server that are known to be exploitable and must be removed immediately.");
+define("FR_LAN_28", "Known insecure files");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_filemanager.php 75/e107_languages/English/admin/lan_filemanager.php
--- 6171/e107_languages/English/admin/lan_filemanager.php	2004-09-10 05:13:22.000000000 -0500
+++ 75/e107_languages/English/admin/lan_filemanager.php	2005-06-14 18:35:15.000000000 -0500
@@ -1,43 +1,67 @@
-<?php
-
-define("FMLAN_1", "Uploaded");
-define("FMLAN_2", "to");
-define("FMLAN_3", "directory");
-define("FMLAN_4", "The uploaded file exceeds the upload_max_filesize directive in php.ini.");
-define("FMLAN_5", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form.");
-define("FMLAN_6", "The uploaded file was only partially uploaded.");
-define("FMLAN_7", "No file was uploaded.");
-define("FMLAN_8", "Uploaded file size 0 bytes");
-define("FMLAN_9", "The file did not upload. Filename");
-define("FMLAN_10", "Error");
-define("FMLAN_11", "Probably incorrect permissions on upload directory.");
-define("FMLAN_12", "file");
-define("FMLAN_13", "files");
-define("FMLAN_14", "directory");
-define("FMLAN_15", "directories");
-define("FMLAN_16", "Root directory");
-define("FMLAN_17", "Name");
-define("FMLAN_18", "Size");
-define("FMLAN_19", "Last Modified");
-define("FMLAN_20", "Options");
-define("FMLAN_21", "Upload file to this dir");
-define("FMLAN_22", "Upload");
-define("FMLAN_23", "Delete");
-define("FMLAN_24", "tick to confirm");
-define("FMLAN_25", "e107 Filemanager");
-
-define("FMLAN_26", "Deleted");
-define("FMLAN_27", "successfully");
-define("FMLAN_28", "Unable to delete");
-define("FMLAN_29", "Path");
-define("FMLAN_30", "Up level");
-define("FMLAN_31", "folder");
-
-define("FMLAN_32", "Select Directory");
-define("FMLAN_33", "Select");
-define("FMLAN_34", "Directory Choice");
-define("FMLAN_35", "Files Directory");
-
-define("FMLAN_36", "Custom Menus Directory");
-define("FMLAN_37", "Custom Pages Directory");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_filemanager.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/06/14 23:35:15 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("FMLAN_1", "Uploaded");
+define("FMLAN_2", "to");
+define("FMLAN_3", "directory");
+define("FMLAN_4", "The uploaded file exceeds the upload_max_filesize directive in php.ini.");
+// define("FMLAN_5", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form.");
+// define("FMLAN_6", "The uploaded file was only partially uploaded.");
+// define("FMLAN_7", "No file was uploaded.");
+// define("FMLAN_8", "Uploaded file size 0 bytes");
+// define("FMLAN_9", "The file did not upload. Filename");
+// define("FMLAN_10", "Error");
+// define("FMLAN_11", "Probably incorrect permissions on upload directory.");
+define("FMLAN_12", "file");
+define("FMLAN_13", "files");
+define("FMLAN_14", "directory");
+define("FMLAN_15", "directories");
+define("FMLAN_16", "Root directory");
+define("FMLAN_17", "Name");
+define("FMLAN_18", "Size");
+define("FMLAN_19", "Last Modified");
+
+define("FMLAN_21", "Upload file to this dir");
+define("FMLAN_22", "Upload");
+
+define("FMLAN_26", "Deleted");
+define("FMLAN_27", "successfully");
+define("FMLAN_28", "Unable to delete");
+define("FMLAN_29", "Path");
+define("FMLAN_30", "Up level");
+define("FMLAN_31", "folder");
+
+define("FMLAN_32", "Select Directory");
+define("FMLAN_33", "Select");
+define("FMLAN_34", "Directory Choice");
+define("FMLAN_35", "Files Directory");
+
+define("FMLAN_36", "Custom Menus Directory");
+define("FMLAN_37", "Custom Pages Directory");
+
+define("FMLAN_38", "Successfully moved file to");
+define("FMLAN_39", "Unable to move file to");
+define("FMLAN_40", "Newspost-Images Directory");
+
+
+define("FMLAN_43", "Delete selected files");
+
+
+define("FMLAN_46", "Please confirm that you wish to DELETE the selected files.");
+define("FMLAN_47", "User Uploads");
+
+define("FMLAN_48", "Move selected to");
+define("FMLAN_49", "Please confirm you wish to move the selected files.");
+define("FMLAN_50", "Move");
+
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_fla.php 75/e107_languages/English/admin/lan_fla.php
--- 6171/e107_languages/English/admin/lan_fla.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_fla.php	2005-06-17 02:51:40.000000000 -0500
@@ -0,0 +1,30 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_fla.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/06/17 07:51:40 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+define("FLALAN_1", "Failed login attempts");
+define("FLALAN_2", "No failed login attempts have been logged");
+define("FLALAN_3", "Attempt(s) deleted");
+define("FLALAN_4", "User attempted to login using incorrect username/password");
+define("FLALAN_5", "IP(s) banned");
+define("FLALAN_6", "Date");
+define("FLALAN_7", "Data");
+define("FLALAN_8", "IP address/ Host");
+define("FLALAN_9", "Options");
+define("FLALAN_10", "Delete / Ban checked entries");
+define("FLALAN_11", "check all delete checkboxes");
+define("FLALAN_12", "uncheck all delete checkboxes");
+define("FLALAN_13", "check all ban checkboxes");
+define("FLALAN_14", "uncheck all ban checkboxes");
+define("FLALAN_15", "The following IP address(es) have been auto-banned - user attempted more than ten failed logins");
+define("FLALAN_16", "delete this auto ban list");
+define("FLALAN_17", "Auto-ban list deleted");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_footer.php 75/e107_languages/English/admin/lan_footer.php
--- 6171/e107_languages/English/admin/lan_footer.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/admin/lan_footer.php	2005-11-24 10:29:02.000000000 -0600
@@ -1,20 +1,30 @@
-<?php
-
-define("FOOTLAN_1", "Site");
-define("FOOTLAN_2", "Head Admin");
-define("FOOTLAN_3", "Version");
-define("FOOTLAN_4", "build");
-define("FOOTLAN_5", "Theme");
-define("FOOTLAN_6", "by");
-define("FOOTLAN_7", "Info");
-define("FOOTLAN_8", "Install date");
-define("FOOTLAN_9", "Server");
-define("FOOTLAN_10", "host");
-define("FOOTLAN_11", "PHP Version");
-define("FOOTLAN_12", "mySQL");
-define("FOOTLAN_13", "Site Info");
-define("FOOTLAN_14", "Show Docs");
-define("FOOTLAN_15", "Documentation");
-define("FOOTLAN_16", "Database");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_footer.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/11/24 16:29:02 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+define("FOOTLAN_1", "Site");
+define("FOOTLAN_2", "Head Admin");
+define("FOOTLAN_3", "Version");
+define("FOOTLAN_4", "build");
+define("FOOTLAN_5", "Theme");
+define("FOOTLAN_6", "by");
+define("FOOTLAN_7", "Info");
+define("FOOTLAN_8", "Install date");
+define("FOOTLAN_9", "Server");
+define("FOOTLAN_10", "host");
+define("FOOTLAN_11", "PHP Version");
+define("FOOTLAN_12", "MySQL");
+define("FOOTLAN_13", "Site Info");
+define("FOOTLAN_14", "Show Docs");
+define("FOOTLAN_15", "Documentation");
+define("FOOTLAN_16", "Database");
+define("FOOTLAN_17", "Charset");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_forum_conf.php 75/e107_languages/English/admin/lan_forum_conf.php
--- 6171/e107_languages/English/admin/lan_forum_conf.php	2004-08-14 21:03:52.000000000 -0500
+++ 75/e107_languages/English/admin/lan_forum_conf.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,28 +0,0 @@
-<?php
-
-define("FORLAN_5", "Poll deleted.");
-define("FORLAN_6", "Thread deleted");
-define("FORLAN_7", "replies deleted");
-define("FORLAN_8", "Delete cancelled.");
-define("FORLAN_9", "Thread moved.");
-define("FORLAN_10", "Move cancelled.");
-define("FORLAN_11", "Back To Forums");
-define("FORLAN_12", "Forum Configuration");
-define("FORLAN_13", "Are you absolutely certain you want to delete this poll?<br />Once deleted it <b><u>cannot</u></b> be retreived.");
-define("FORLAN_14", "Cancel");
-define("FORLAN_15", "Confirm Delete Forum Post");
-define("FORLAN_16", "Confirm Delete Poll");
-define("FORLAN_17", "posted by");
-define("FORLAN_18", "Are you absolutely certain you want to delete this forum");
-define("FORLAN_19", "thread and it's related posts?");
-define("FORLAN_20", "the poll will also be deleted");
-define("FORLAN_21", "Once deleted they");
-define("FORLAN_22", "post?<br />Once deleted it");
-define("FORLAN_23", "cannot</u></b> be retreived");
-define("FORLAN_24", "Move thread  to forum");
-define("FORLAN_25", "Move Thread");
-define("FORLAN_26", "Reply deleted");
-
-define("FORLAN_27", "moved");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_forum.php 75/e107_languages/English/admin/lan_forum.php
--- 6171/e107_languages/English/admin/lan_forum.php	2004-09-06 04:55:18.000000000 -0500
+++ 75/e107_languages/English/admin/lan_forum.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,162 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/admin/lan_forum.php,v $
-|     $Revision: 1.12 $
-|     $Date: 2004/09/06 09:55:17 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("FORLAN_1", "You must enter the number of days you wish to prune.");
-define("FORLAN_2", "Please select to either delete pruned posts completely, or make them inactive (not deleted but not visible in forums)");
-define("FORLAN_3", "delete");
-define("FORLAN_4", "Make inactive");
-define("FORLAN_5", "Carry Out Prune");
-define("FORLAN_6", "Cancel");
-define("FORLAN_7", "Forum Options");
-define("FORLAN_8", "Forums pruned.");
-define("FORLAN_9", "Prune not required.");
-define("FORLAN_10", "Options Saved");
-define("FORLAN_11", "Forum created");
-define("FORLAN_12", "Forum updated");
-define("FORLAN_13", "Parent created");
-define("FORLAN_14", "Forum parent updated");
-define("FORLAN_15", "Please tick the confirm box to delete the forum");
-define("FORLAN_16", "Forums");
-define("FORLAN_17", "No parents yet");
-define("FORLAN_18", "Existing Parents");
-define("FORLAN_19", "Edit");
-define("FORLAN_20", "Delete");
-define("FORLAN_21", "tick to confirm");
-define("FORLAN_22", "Parent");
-define("FORLAN_23", "Accessable to?");
-define("FORLAN_24", "tick to make accessable to users in the ticked class");
-define("FORLAN_25", "Update Parent");
-define("FORLAN_26", "Create Parent");
-define("FORLAN_27", "You need to define at least one forum parent before creating a forum.");
-define("FORLAN_28", "Forums");
-define("FORLAN_29", "No forums yet.");
-define("FORLAN_30", "Existing Forums");
-define("FORLAN_31", "Name");
-define("FORLAN_32", "Description");
-define("FORLAN_33", "Moderators");
-define("FORLAN_34", "tick to make active on this forum");
-define("FORLAN_35", "Update Forum");
-define("FORLAN_36", "Create Forum");
-define("FORLAN_37", "Order");
-define("FORLAN_38", "Closed");
-define("FORLAN_39", "Members Only");
-define("FORLAN_40", "Restricted");
-define("FORLAN_41", "move up");
-define("FORLAN_42", "move down");
-define("FORLAN_43", "Preview / Forum Order");
-define("FORLAN_44", "Enclose tables");
-define("FORLAN_45", "Tick this to render the forum within theme table");
-define("FORLAN_46", "Title displayed in caption if enclose tables is ticked");
-define("FORLAN_47", "Enable email nofication");
-define("FORLAN_48", "Tick this to allow your users to have the option of receiving an email when somebody replies to their post");
-define("FORLAN_49", "Enable polls");
-define("FORLAN_50", "Tick this to allow your users to set polls in the forums");
-define("FORLAN_51", "Enable tracking");
-define("FORLAN_52", "Tick this to allow your users to track threads and be emailed when the thread is replied to");
-define("FORLAN_53", "Email prefix");
-define("FORLAN_54", "The text you enter will prefix the subject on any emails sent through the forum");
-define("FORLAN_55", "Popular thread threshold");
-define("FORLAN_56", "Number of posts made to a thread before it is marked as popular");
-define("FORLAN_57", "Posts per page");
-define("FORLAN_58", "Number of posts displayed per page");
-define("FORLAN_59", "Prune");
-define("FORLAN_60", "This will delete all threads that have not received a reply in the number of days you enter. <br /><b>Please be careful using this function!</b>");
-define("FORLAN_61", "Update Options");
-define("FORLAN_62", "Forum Options");
-define("FORLAN_63", "Ranks");
-define("FORLAN_64", "Enter your levels here, if left blank generic stars will be used to denote level. Seperate levels with comma. Maximum of 10 levels, lowest first.");
-define("FORLAN_65", "Forum Title");
-
-define("FORLAN_68", "Enable HTML post");
-define("FORLAN_69", "Allow public users to post HTML code, this will apply sitewide (comments, chatbox etc)");
-
-define("FORLAN_70", "Enable file / image attachments");
-define("FORLAN_71", "Allow users to upload file or image with their forum post,");
-define("FORLAN_72", "Update Order");
-define("FORLAN_73", "Order Updated");
-
-define("FORLAN_75", "Parents");
-define("FORLAN_76", "Forums Front Page");
-define("FORLAN_77", "Create Forums");
-define("FORLAN_78", "Forum Order");
-define("FORLAN_79", "Preferences");
-define("FORLAN_80", "Options");
-define("FORLAN_81", "Are you sure you want to delete this parent? - forums of this parent will also be deleted");
-define("FORLAN_82", "Are you sure you want to delete this forum?");
-define("FORLAN_83", "Create Parents");
-define("FORLAN_84", "Members Only");
-define("FORLAN_85", "Read Only");
-define("FORLAN_86", "Admin Only");
-define("FORLAN_87", "Prune topics with no replies in this many days:");
-
-define("FORLAN_88", "Prune topics with no replies in this many days:");
-
-define("FORLAN_89", "Delete posts completely");
-define("FORLAN_90", "Make posts inactive");
-
-define("FORLAN_91", "post(s) made inactive");
-define("FORLAN_92", "thread(s) deleted");
-define("FORLAN_93", "reply (replies) deleted");
-
-define("FORLAN_94", "Set Ranks");
-define("FORLAN_95", "Ranks saved");
-define("FORLAN_96", "Forum deleted");
-define("FORLAN_97", "Parent deleted");
-
-define("FORLAN_98", "Rank Name");
-define("FORLAN_99", "number of points before level change");
-define("FORLAN_100", "upload images to e107_themes/Your_Theme/forum/");
-define("FORLAN_101", "Main Site Admin");
-define("FORLAN_102", "Threshold");
-define("FORLAN_103", "Site Admin");
-define("FORLAN_104", "Rank Image");
-define("FORLAN_105", "Forum Moderator");
-
-
-define("FORLAN_106", "Prune Type:");
-define("FORLAN_107", "Forum");
-define("FORLAN_108", " deleted");
-define("FORLAN_109", "days:");
-define("FORLAN_110", "Prune");
-define("FORLAN_111", "deactivate");
-
-define("FORLAN_112", "Enable Redirect");
-define("FORLAN_113", "Tick this to make browser redirect to forum page after replying");
-define("FORLAN_114", "User Custom Title");
-define("FORLAN_115", "Tick this to allow users to change their Custom Title");
-define("FORLAN_116", "Reported Posts");
-define("FORLAN_117", "This will delete the record of the reported post. Not the post itself.");
-define("FORLAN_118", "Reported post deleted");
-define("FORLAN_119", "Clicking links will open forum in a new window.");
-define("FORLAN_120", "Tick this to allow users to change their Custom Title");
-define("FORLAN_121", "No reported posts");
-define("FORLAN_122", "Click here to email admin when someone reports a forum post");
-define("FORLAN_123", "Forum Rules");
-define("WMGLAN_1", "Rules for Guests");
-define("WMGLAN_2", "Rules for Members");
-define("WMGLAN_3", "Rules for Administrators");
-define("WMGLAN_4", "Submit");
-define("WMGLAN_5", "Set Forum Rules");
-define("WMGLAN_6", "Activate?");
-define("FORLAN_124", "Links in new window");
-define("FORLAN_125", "Tick here to make all links open in a new window (<i>this will apply sitewide</i>). ");
-
-//v.617
-define("FORLAN_126", "Show Tooltips");
-define("FORLAN_127", "Tick here to show a tooltip containing the first post of the thread when mouse hovers over thread name. ");
-define("FORLAN_128", "Length of tooltip");
-define("FORLAN_129", "This will determine the number of characters to display in the tooltip. ");
-define("FORLAN_130", "click here");
-define("FORLAN_131", "to set max file size, allowed types etc");
-
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_frontpage.php 75/e107_languages/English/admin/lan_frontpage.php
--- 6171/e107_languages/English/admin/lan_frontpage.php	2004-03-24 23:17:12.000000000 -0600
+++ 75/e107_languages/English/admin/lan_frontpage.php	2005-06-02 01:14:20.000000000 -0500
@@ -1,20 +1,40 @@
-<?php
-
-define("FRTLAN_1", "Front Page settings updated.");
-define("FRTLAN_2", "Display");
-define("FRTLAN_3", "News (default)");
-define("FRTLAN_4", "Forum");
-define("FRTLAN_5", "Downloads");
-define("FRTLAN_6", "Links");
-define("FRTLAN_7", "Content Page");
-define("FRTLAN_8", "Other");
-define("FRTLAN_9", "Type");
-define("FRTLAN_10", "Always front page");
-define("FRTLAN_11", "Splashscreen only");
-define("FRTLAN_12", "Update Front Page Settings");
-define("FRTLAN_13", "Front Page Settings");
-
-define("FRTLAN_14", "(type full URL or integer for article)");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_frontpage.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/06/02 06:14:20 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("FRTLAN_1", "Front Page settings updated.");
+define("FRTLAN_2", "Set front page for");
+define("FRTLAN_6", "Links");
+// define("FRTLAN_7", "Content Page");
+define("FRTLAN_12", "Update Front Page Settings");
+define("FRTLAN_13", "Front Page Settings");
+define("FRTLAN_15", "Other (enter url):");
+define("FRTLAN_16", "error: no content main parent selected");
+define("FRTLAN_17", "error: no content sub category selected");
+define("FRTLAN_18", "error: no content item selected");
+define("FRTLAN_19", "content main parent");
+define("FRTLAN_20", "content category");
+define("FRTLAN_21", "content item");
+// define("FRTLAN_22", "");
+// define("FRTLAN_23", "");
+// define("FRTLAN_24", "");
+// define("FRTLAN_25", "");
+
+define("FRTLAN_26", "all users");
+define("FRTLAN_27", "Guests");
+define("FRTLAN_28", "Members");
+define("FRTLAN_29", "Administrators");
+define("FRTLAN_31", "All Users");
+define("FRTLAN_32", "User Class");
+define("FRTLAN_33", "Current Settings");
+define("FRTLAN_34", "Page");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_header.php 75/e107_languages/English/admin/lan_header.php
--- 6171/e107_languages/English/admin/lan_header.php	2004-05-06 12:57:48.000000000 -0500
+++ 75/e107_languages/English/admin/lan_header.php	2004-10-25 11:11:40.000000000 -0500
@@ -1,10 +1,21 @@
-<?php
-
-define("LAN_head_1", "Admin Navigation");
-define("LAN_head_2", "Your server does not allow HTTP file uploads so it will not be possible for your users to uploads avatars/files etc. To rectify this set file_uploads to On in your php.ini and restart your server. If you dont have access to your php.ini contact your hosts.");
-define("LAN_head_3", "Your server is running with a basedir restriction in effect. This disallows usage of any file outside of your home directory and as such could affect certain scripts such as the filemanager.");
-
-
-define("LAN_head_4", "Admin Area");
-
-?>
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_header.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2004/10/25 16:11:40 $
+|     $Author: loloirie $
++----------------------------------------------------------------------------+
+*/
+define("LAN_head_1", "Admin Navigation");
+define("LAN_head_2", "Your server does not allow HTTP file uploads so it will not be possible for your users to uploads avatars/files etc. To rectify this set file_uploads to On in your php.ini and restart your server. If you dont have access to your php.ini contact your hosts.");
+define("LAN_head_3", "Your server is running with a basedir restriction in effect. This disallows usage of any file outside of your home directory and as such could affect certain scripts such as the filemanager.");
+
+define("LAN_head_4", "Admin Area");
+
+define("LAN_head_5", "language displayed in admin area: ");
+define("LAN_head_6", "Plugins info");
+
+?>
diff -ruN 6171/e107_languages/English/admin/lan_image.php 75/e107_languages/English/admin/lan_image.php
--- 6171/e107_languages/English/admin/lan_image.php	2004-03-23 08:31:26.000000000 -0600
+++ 75/e107_languages/English/admin/lan_image.php	2005-05-19 15:41:08.000000000 -0500
@@ -1,47 +1,47 @@
-<?php
-
-define("IMALAN_1", "Enable image posting");
-define("IMALAN_2", "Display images, this will apply sitewide (comments, chatbox etc)");
-define("IMALAN_3", "Resize method");
-define("IMALAN_4", "Method used to resize images, either GD1/2 library, or ImageMagick");
-define("IMALAN_5", "Path to ImageMagick (if selected)");
-define("IMALAN_6", "Full path to ImageMagick Convert utility");
-
-define("IMALAN_7", "Image Settings");
-define("IMALAN_8", "Update Image Settings");
-define("IMALAN_9", "Image settings updated");
-
-define("IMALAN_10", "Image posting class");
-define("IMALAN_11", "Restrict users who can post images (if enabled above)");
-
-
-define("IMALAN_12", "Disabled image method");
-define("IMALAN_13", "What to do with posted images if image posting is disabled");
-
-define("IMALAN_14", "Show image URL");
-define("IMALAN_15", "Show nothing");
-
-define("IMALAN_16", "Show uploaded avatars");
-define("IMALAN_17", "Click here");
-
-define("IMALAN_18", "Uploaded images");
-define("IMALAN_19", "Image name");
-define("IMALAN_20", "Image");
-define("IMALAN_21", "Used by");
-define("IMALAN_22", "Image not in use");
-
-define("IMALAN_23", "Avatar");
-define("IMALAN_24", "Photograph");
-define("IMALAN_25", "Click here to delete all unused images");
-define("IMALAN_26", "image(s) deleted");
-define("IMALAN_27", "delete");
-define("IMALAN_28", "deleted");
-define("IMALAN_29", "No images");
-
-define("IMALAN_30", "Everyone (public)");
-define("IMALAN_31", "Guests only");
-define("IMALAN_32", "Members only");
-define("IMALAN_33", "Admin only");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_image.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/05/19 20:41:08 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+define("IMALAN_1", "Enable image posting");
+define("IMALAN_2", "Display images, this will apply sitewide (comments, chatbox etc)");
+define("IMALAN_3", "Resize method");
+define("IMALAN_4", "Method used to resize images, either GD1/2 library, or ImageMagick");
+define("IMALAN_5", "Path to ImageMagick (if selected)");
+define("IMALAN_6", "Full path to ImageMagick Convert utility");
+define("IMALAN_7", "Image Settings");
+define("IMALAN_8", "Update Image Settings");
+define("IMALAN_9", "Image settings updated");
+define("IMALAN_10", "Image posting class");
+define("IMALAN_11", "Restrict users who can post images (if enabled above)");
+define("IMALAN_12", "Disabled image method");
+define("IMALAN_13", "What to do with posted images if image posting is disabled");
+define("IMALAN_14", "Show image URL");
+define("IMALAN_15", "Show nothing");
+define("IMALAN_16", "Show uploaded avatars");
+define("IMALAN_17", "Click here");
+define("IMALAN_18", "Uploaded images");
+
+define("IMALAN_21", "Used by");
+define("IMALAN_22", "Image not in use");
+define("IMALAN_23", "Avatar");
+define("IMALAN_24", "Photograph");
+define("IMALAN_25", "Click here to delete all unused images");
+define("IMALAN_26", "image(s) deleted");
+
+define("IMALAN_28", "deleted");
+define("IMALAN_29", "No images");
+define("IMALAN_30", "Everyone (public)");
+define("IMALAN_31", "Guests only");
+define("IMALAN_32", "Members only");
+define("IMALAN_33", "Admin only");
+define("IMALAN_34", "Enable Sleight");
+define("IMALAN_35", "Fixes transparent PNG-24's with alpha transparency in IE 5 / 6 (Applies Sitewide)");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_lancheck.php 75/e107_languages/English/admin/lan_lancheck.php
--- 6171/e107_languages/English/admin/lan_lancheck.php	2004-04-21 21:16:32.000000000 -0500
+++ 75/e107_languages/English/admin/lan_lancheck.php	2004-10-10 16:31:57.000000000 -0500
@@ -1,11 +1,28 @@
-<?php
-
-define("LAN_CHECK_1", "Select Language to verify");
-define("LAN_CHECK_2", "Begin Verify");
-define("LAN_CHECK_3", "Verification of");
-define("LAN_CHECK_4", "File missing!");
-define("LAN_CHECK_5", "Phrase missing!");
-define("LAN_CHECK_6", "OK");
-define("LAN_CHECK_7", "phrase");
-
-?>
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_lancheck.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2004/10/10 21:31:57 $
+|     $Author: loloirie $
++----------------------------------------------------------------------------+
+*/
+define("LAN_CHECK_1", "Select Language to verify");
+define("LAN_CHECK_2", "Begin Verify");
+define("LAN_CHECK_3", "Verification of");
+define("LAN_CHECK_4", "File missing!");
+define("LAN_CHECK_5", "Phrase missing!");
+define("LAN_CHECK_6", "OK");
+define("LAN_CHECK_7", "phrase");
+
+define("LAN_CHECK_8", "A file is missing...");
+define("LAN_CHECK_9", " files are missing...");
+define("LAN_CHECK_10", "Critical error: ");
+define("LAN_CHECK_11", "No file missing !");
+define("LAN_CHECK_12", "A file is wrong...");
+define("LAN_CHECK_13", " files are wrong...");
+define("LAN_CHECK_14", "All existing files are valid !");
+
+?>
diff -ruN 6171/e107_languages/English/admin/lan_language.php 75/e107_languages/English/admin/lan_language.php
--- 6171/e107_languages/English/admin/lan_language.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_language.php	2006-04-17 09:52:38.000000000 -0500
@@ -0,0 +1,30 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_language.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2006/04/17 14:52:38 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+define("LANG_LAN_00","could not be created.(already exists)");
+define("LANG_LAN_01","was deleted(if existing) and created.");
+define("LANG_LAN_02","couldn't be deleted");
+define("LANG_LAN_03","Tables");
+
+define("LANG_LAN_05","Not Installed");
+define("LANG_LAN_06", "Create tables");
+define("LANG_LAN_07", "Drop existing tables?");
+define("LANG_LAN_08", "Replace existing tables (data will be lost).");
+define("LANG_LAN_10", "Confirm delete");
+define("LANG_LAN_11", "Delete unchecked tables above (if they exist).");
+define("LANG_LAN_12", "Enable Multi-Language Tables");
+define("LANG_LAN_13", "Language Preferences");
+define("LANG_LAN_14", "Default Site Language");
+define("LANG_LAN_15", "Tick to copy data from the default language.(useful for links, news-categories etc) ");
+define("LANG_LAN_16", "Multi-language Database Usage"); 
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_links.php 75/e107_languages/English/admin/lan_links.php
--- 6171/e107_languages/English/admin/lan_links.php	2004-05-07 22:33:02.000000000 -0500
+++ 75/e107_languages/English/admin/lan_links.php	2005-11-23 12:08:28.000000000 -0600
@@ -1,82 +1,67 @@
-<?php
-
-define("LCLAN_1", "Options Saved");
-define("LCLAN_2", "Link saved to database.");
-define("LCLAN_3", "Link updated in database.");
-define("LCLAN_4", "Link deleted.");
-define("LCLAN_6", "Order updated.");
-define("LCLAN_8", "Existing Links");
-define("LCLAN_9", "Edit");
-define("LCLAN_10", "Delete");
-define("LCLAN_12", "Link Category");
-define("LCLAN_13", "Cannot edit the main category.");
-define("LCLAN_14", "Post");
-define("LCLAN_15", "Link Name");
-define("LCLAN_16", "Link URL");
-define("LCLAN_17", "Link Description");
-define("LCLAN_18", "Link Button / Icon");
-define("LCLAN_19", "Link Open Type");
-define("LCLAN_20", "Opens in same window");
-//define("LCLAN_21", "target=_blank");
-//define("LCLAN_22", "target=_parent");
-define("LCLAN_23", "Opens in new window");
-define("LCLAN_24", "Opens in 600x400 miniwindow");
-define("LCLAN_25", "Link Class");
-define("LCLAN_26", "Ticking will make the link visible to only users in that class");
-define("LCLAN_27", "Update Link");
-define("LCLAN_28", "Create link");
-define("LCLAN_29", "Links");
-define("LCLAN_30", "move up");
-define("LCLAN_31", "move down");
-define("LCLAN_32", "Update Order");
-define("LCLAN_33", "Link Order");
-define("LCLAN_34", "Tick this to allow have the links page show only the link categories. Helpful if you have a lot of links.");
-define("LCLAN_35", "Update Options");
-define("LCLAN_36", "Link Page Options");
-
-define("LCLAN_39", "View Images");
-define("LCLAN_40", "Show only link categories");
-define("LCLAN_41", "Allow links to be submitted");
-define("LCLAN_42", "Allow visitors to submit links to your site");
-define("LCLAN_43", "Submit links class");
-define("LCLAN_44", "Select which users can submit links");
-define("LCLAN_45", "Submitted by");
-define("LCLAN_51", "Link Category Saved");
-define("LCLAN_52", "Link Category Updated");
-define("LCLAN_53", "Link");
-define("LCLAN_54", "deleted");
-define("LCLAN_55", "Link Category");
-define("LCLAN_56", "Are you sure you want to delete this category?");
-define("LCLAN_57", "Are you sure you want to delete this submitted link?");
-define("LCLAN_58", "Are you sure you want to delete this link?");
-define("LCLAN_59", "Category");
-define("LCLAN_60", "Options");
-define("LCLAN_61", "No links");
-define("LCLAN_62", "Links Front Page");
-define("LCLAN_63", "Create New Link");
-define("LCLAN_64", "Set Link Order");
-define("LCLAN_65", "Categories");
-define("LCLAN_66", "Submitted Links");
-define("LCLAN_67", "Options");
-define("LCLAN_68", "Links Options");
-define("LCLAN_69", "No link categories");
-define("LCLAN_70", "Existing Link Categories");
-define("LCLAN_71", "Category Name");
-define("LCLAN_72", "Category Description");
-define("LCLAN_73", "Category Icon");
-define("LCLAN_74", "Update Link Category");
-define("LCLAN_75", "Create Link Category");
-define("LCLAN_76", "No submitted links");
-
-define("LCLAN_77", "Submitted link deleted");
-
-define("LCLAN_78", "Show Description as Screen-Tip");
-define("LCLAN_79", "Description will be shown when the mouse hovers over the link");
-
-define("LCLAN_80", "View Images");
-define("LCLAN_81", "Clear Form");
-
-
-define("LCLAN_82", "Submitted by");
-define("LCLAN_83", "Submenus Generator");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_links.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2005/11/23 18:08:28 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("LCLAN_1", "Options Saved");
+define("LCLAN_2", "Link saved to database.");
+define("LCLAN_3", "Link updated in database.");
+// define("LCLAN_4", "Link deleted.");
+define("LCLAN_6", "Order updated.");
+define("LCLAN_8", "Existing Links");
+define("LCLAN_12", "Link Rendertype");
+define("LCLAN_15", "Link Name");
+define("LCLAN_16", "Link URL");
+define("LCLAN_17", "Link Description");
+define("LCLAN_18", "Link Button / Icon");
+define("LCLAN_19", "Link Open Type");
+define("LCLAN_20", "Opens in same window");
+define("LCLAN_23", "Opens in new window");
+define("LCLAN_24", "Opens in 600x400 miniwindow");
+define("LCLAN_25", "Link Class");
+define("LCLAN_26", "Ticking will make the link visible to only users in that class");
+define("LCLAN_27", "Update Link");
+define("LCLAN_28", "Create link");
+define("LCLAN_29", "Links");
+define("LCLAN_30", "move up");
+define("LCLAN_31", "move down");
+define("LCLAN_39", "View Images");
+define("LCLAN_53", "Link");
+define("LCLAN_54", "deleted");
+define("LCLAN_58", "Are you sure you want to delete this link?");
+define("LCLAN_61", "No links");
+define("LCLAN_62", "Links Front Page");
+define("LCLAN_63", "Create New Link");
+define("LCLAN_68", "Links Options");
+define("LCLAN_78", "Show Description as Screen-Tip");
+define("LCLAN_79", "Description will be shown when the mouse hovers over the link");
+define("LCLAN_80", "Activate expanding sub-menus");
+define("LCLAN_81", "Sub-menus will display only after clicking their parent. (Link parent is disabled)");
+define("LCLAN_83", "Submenus Generator");
+define("LCLAN_88", "Site Links Options");
+define("LCLAN_89", "Image");
+define("LCLAN_90", "Link Name");
+define("LCLAN_91", "Move");
+define("LCLAN_95", "Class");
+
+define("LCLAN_96", "Shown in your theme as");
+
+
+define("LINKLAN_1", "Opens in 800x600 window");
+define("LINKLAN_2", "Parent");
+define("LINKLAN_3", "No Parent (Normal Link)");
+define("LINKLAN_4", "Sublink Generator");
+define("LINKLAN_5", "Generate Sublinks");
+define("LINKLAN_6", "Create sublinks from:");
+define("LINKLAN_7", "Create sublinks under which link?");
+define("LINKLAN_8", "News Categories");
+define("LINKLAN_9", "Download Categories");
+define("LINKLAN_10", "Create Sublink");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_log.php 75/e107_languages/English/admin/lan_log.php
--- 6171/e107_languages/English/admin/lan_log.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/admin/lan_log.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,17 +0,0 @@
-<?php
-
-define("LOGLAN_1", "Logging settings updated.");
-define("LOGLAN_2", "Stats table(s) emptied.");
-define("LOGLAN_3", "Activate Logging/Counter?");
-define("LOGLAN_4", "Refer log type");
-define("LOGLAN_5", "Domain only");
-define("LOGLAN_6", "Complete URL");
-define("LOGLAN_7", "Count how many last visitors?");
-define("LOGLAN_8", "Clear stats tables");
-define("LOGLAN_9", "Tick to clear information stats");
-define("LOGLAN_10", "Tick to clear counter stats");
-define("LOGLAN_11", "Clear!");
-define("LOGLAN_12", "Update Logger Settings");
-define("LOGLAN_13", "Logger/Counter Settings");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_mailout.php 75/e107_languages/English/admin/lan_mailout.php
--- 6171/e107_languages/English/admin/lan_mailout.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_mailout.php	2006-05-12 17:50:40.000000000 -0500
@@ -0,0 +1,65 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_mailout.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2006/05/12 22:50:40 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("PRFLAN_52", "Save Changes");
+define("PRFLAN_63", "Send test email");
+define("PRFLAN_64", "Clicking button will send test email to main admin email address");
+define("PRFLAN_65", "Click to send email to");
+define("PRFLAN_66", "Test email from");
+define("PRFLAN_67", "This is a test email, it appears that your email settings are working ok!\n\nRegards\nfrom the e107 website system.");
+define("PRFLAN_68", "The email could not be sent. It appears that your server is not correctly configured to send emails, please try again using SMTP, or contact your hosts and ask them to check their sendmail / email server settings.");
+define("PRFLAN_69", "The email has been successfully sent, please check your inbox.");
+define("PRFLAN_70", "Emailing method");
+define("PRFLAN_71", "If unsure, leave as php");
+define("PRFLAN_72", "SMTP Server");
+define("PRFLAN_73", "SMTP Username");
+define("PRFLAN_74", "SMTP Password");
+define("PRFLAN_75", "The email could not be sent. Please review your SMTP settings, or disable SMTP and try again.");
+
+define("MAILAN_01","From Name");
+define("MAILAN_02","From Email");
+define("MAILAN_03","To");
+define("MAILAN_04","Cc");
+define("MAILAN_05","Bcc");
+define("MAILAN_06","Subject");
+define("MAILAN_07","Attachment");
+define("MAILAN_08","Send Email");
+define("MAILAN_09","Use Theme Style");
+define("MAILAN_10","User Subscribed");
+define("MAILAN_11","Insert Variables");
+define("MAILAN_12","All Members");
+define("MAILAN_13","All Unverified Members ");
+define("MAILAN_14","It is recommended that you enable SMTP for sending large numbers of emails - set in preferences below.");
+define("MAILAN_15","Mail-Out");
+
+define("MAILAN_16","username");
+define("MAILAN_17","signup link");
+define("MAILAN_18","user id");
+define("MAILAN_19","There is no email address for site-admin. Please check your preferences and try again.");
+define("MAILAN_20","Sendmail-path");
+define("MAILAN_21","Mass-Mail Entries");
+define("MAILAN_22","There are currently no saved entries");
+define("MAILAN_23","userclass: ");
+define("MAILAN_24", "email(s) are ready to be sent");
+
+define("MAILAN_25", "Pause");
+define("MAILAN_26", "Pause mass-mailing every");
+define("MAILAN_27", "emails");
+define("MAILAN_28", "Pause Length");
+define("MAILAN_29", "seconds");
+define("MAILAN_30", "More than 30 seconds may cause the browser to time-out");
+define("MAILAN_31", "Bounced Email Processing");
+define("MAILAN_32", "Email address");
+define("MAILAN_33", "Incoming Mail");
+define("MAILAN_34", "Account Name");
+define("MAILAN_35", "Password");
+define("MAILAN_36", "Delete Bounced Mails after checking");  
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_menus.php 75/e107_languages/English/admin/lan_menus.php
--- 6171/e107_languages/English/admin/lan_menus.php	2004-08-19 22:59:24.000000000 -0500
+++ 75/e107_languages/English/admin/lan_menus.php	2006-04-27 20:08:57.000000000 -0500
@@ -1,35 +1,56 @@
-<?php
-
-define("MENLAN_1", "Visible to all");
-define("MENLAN_2", "Visible to members only");
-define("MENLAN_3", "Visible to administrators only");
-define("MENLAN_4", "Only visible to:");
-define("MENLAN_5", "class");
-define("MENLAN_6", "Save visibility options");
-define("MENLAN_7", "Configure visibility options for");
-define("MENLAN_8", "Visibility options updated");
-define("MENLAN_9", "New custom menu installed");
-define("MENLAN_10", "New menu installed");
-define("MENLAN_11", "Menu removed");
-define("MENLAN_12", "Activate this menu - choose location");
-define("MENLAN_13", "Activate in Area");
-define("MENLAN_14", "Area");
-define("MENLAN_15", "Deactivate");
-define("MENLAN_16", "Configure");
-define("MENLAN_17", "Move Up");
-define("MENLAN_18", "Move Down");
-define("MENLAN_19", "Move to Area");
-define("MENLAN_20", "Visibility");
-
-define("MENLAN_21", "Visible to Guests only");
-define("MENLAN_22", "Inactive Menus");
-
-define("MENLAN_23", "Move to bottom");
-define("MENLAN_24", "Move to top");
-define("MENLAN_25", "Function ...");
-
-define("MENLAN_26", "This menu will only be <strong>SHOWN</strong> on the following pages");
-define("MENLAN_27", "This menu will only be <strong>HIDDEN</strong> on the following pages");
-define("MENLAN_28", "Enter one page per line, enter enough of the url to distinguish it properly");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_menus.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2006/04/28 01:08:57 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("MENLAN_1", "Visible to all");
+define("MENLAN_2", "Visible to members only");
+define("MENLAN_3", "Visible to administrators only");
+define("MENLAN_4", "Only visible to:");
+// define("MENLAN_5", "class");
+define("MENLAN_6", "Save visibility options");
+define("MENLAN_7", "Configure visibility options for");
+define("MENLAN_8", "Visibility options updated");
+define("MENLAN_9", "New custom menu installed");
+define("MENLAN_10", "New menu installed");
+define("MENLAN_11", "Menu removed");
+define("MENLAN_12", "Activate: choose area");
+define("MENLAN_13", "Activate in Area");
+define("MENLAN_14", "Area");
+define("MENLAN_15", "Deactivate");
+define("MENLAN_16", "Configure");
+define("MENLAN_17", "Move Up");
+define("MENLAN_18", "Move Down");
+define("MENLAN_19", "Move to Area");
+define("MENLAN_20", "Visibility");
+
+// define("MENLAN_21", "Visible to Guests only");
+define("MENLAN_22", "Inactive Menus");
+
+define("MENLAN_23", "Move to bottom");
+define("MENLAN_24", "Move to top");
+define("MENLAN_25", "Function ...");
+
+define("MENLAN_26", "This menu will only be <strong>SHOWN</strong> on the following pages");
+define("MENLAN_27", "This menu will only be <strong>HIDDEN</strong> on the following pages");
+define("MENLAN_28", "Enter one page per line, enter enough of the url to distinguish it properly.  If you need the ending of the url to match exactly, use a ! at the end of the page name <br />For example: <strong>page.php?1!</strong>");
+
+define("MENLAN_29", "Select Layout");
+define("MENLAN_30", "To see the menu areas and their positions for custom layouts, select the custom layout here:");
+define("MENLAN_31", "Default Layout");
+define("MENLAN_32", "Newsheader Layout");
+define("MENLAN_33", "Custom Layout");
+define("MENLAN_34", "Embedded");
+define("MENLAN_35", "Configure Menus");
+define("MENLAN_36", "Choose the menu(s) to activate");
+define("MENLAN_37", "and where to activate them.");
+define("MENLAN_38", "Hold down CTRL to select multiple menus.");
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_message.php 75/e107_languages/English/admin/lan_message.php
--- 6171/e107_languages/English/admin/lan_message.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_message.php	2005-02-08 15:33:07.000000000 -0600
@@ -0,0 +1,28 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_message.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/02/08 21:33:07 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+define("MESSLAN_1", "Received messages");
+define("MESSLAN_2", "Delete Message");
+define("MESSLAN_3", "Message Deleted.");
+define("MESSLAN_4", "Delete All Messages");
+define("MESSLAN_5", "Confirm");
+define("MESSLAN_6", "All messages deleted.");
+define("MESSLAN_7", "No messages.");
+define("MESSLAN_8", "Message type");
+define("MESSLAN_9", "Reported on");
+
+define("MESSLAN_10", "Submitted by");
+define("MESSLAN_11", "opens in new window");
+define("MESSLAN_12", "Message");
+define("MESSLAN_13", "Link");
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_meta.php 75/e107_languages/English/admin/lan_meta.php
--- 6171/e107_languages/English/admin/lan_meta.php	2004-03-23 10:41:32.000000000 -0600
+++ 75/e107_languages/English/admin/lan_meta.php	2005-09-06 14:34:04.000000000 -0500
@@ -1,13 +1,25 @@
-<?php
-
-define("METLAN_1", "Meta tags updated in database");
-define("METLAN_2", "Enter meta-tags");
-define("METLAN_3", "Enter new meta tag settings");
-define("METLAN_4", "Updated");
-define("METLAN_5", "type your description here");
-define("METLAN_6", "type, a, list, of, your, keywords, here");
-define("METLAN_7", "type your copyright info here");
-define("METLAN_8", "Meta Tags");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_meta.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/09/06 19:34:04 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("METLAN_1", "Meta tags updated in database");
+define("METLAN_2", "Enter additional meta-tags");
+define("METLAN_3", "Enter new meta tag settings");
+define("METLAN_4", "Updated");
+define("METLAN_5", "type your description here");
+define("METLAN_6", "type, a, list, of, your, keywords, here");
+define("METLAN_7", "type your copyright info here");
+define("METLAN_8", "Meta Tags");
+
+define("METLAN_9", "Description");
+define("METLAN_10", "Keywords");
+define("METLAN_11", "Copyright");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_modcomment.php 75/e107_languages/English/admin/lan_modcomment.php
--- 6171/e107_languages/English/admin/lan_modcomment.php	2004-04-25 23:37:38.000000000 -0500
+++ 75/e107_languages/English/admin/lan_modcomment.php	2005-06-30 09:18:21.000000000 -0500
@@ -1,13 +1,34 @@
-<?php
-
-define("MDCLAN_1", "Moderated.");
-define("MDCLAN_2", "No comments for this item");
-define("MDCLAN_3", "Member");
-define("MDCLAN_4", "Guest");
-define("MDCLAN_5", "unblock");
-define("MDCLAN_6", "block");
-define("MDCLAN_7", "delete");
-define("MDCLAN_8", "Moderate Comments");
-define("MDCLAN_9", "Warning! Deleting Parent comments will also delete all replies!");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_modcomment.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/06/30 14:18:21 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+define("MDCLAN_1", "Moderated.");
+define("MDCLAN_2", "No comments for this item");
+define("MDCLAN_3", "Member");
+define("MDCLAN_4", "Guest");
+define("MDCLAN_5", "unblock");
+define("MDCLAN_6", "block");
+
+define("MDCLAN_8", "Moderate Comments");
+define("MDCLAN_9", "Warning! Deleting Parent comments will also delete all replies!");
+
+define("MDCLAN_10", "options");
+define("MDCLAN_11", "comment");
+define("MDCLAN_12", "comments");
+define("MDCLAN_13", "blocked");
+define("MDCLAN_14", "lock comments");
+define("MDCLAN_15", "open");
+define("MDCLAN_16", "locked");
+define("MDCLAN_17", "");
+define("MDCLAN_18", "");
+define("MDCLAN_19", "");
+define("MDCLAN_20", "");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_newsfeed.php 75/e107_languages/English/admin/lan_newsfeed.php
--- 6171/e107_languages/English/admin/lan_newsfeed.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/admin/lan_newsfeed.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,24 +0,0 @@
-<?php
-
-define("NWFLAN_1", "Newsfeed added to database.");
-define("NWFLAN_2", "Newsfeed updated in database.");
-define("NWFLAN_3", "Newsfeed deleted.");
-define("NWFLAN_4", "Please tick the confirm box to delete the newsfeed.");
-define("NWFLAN_5", "No newsfeeds yet.");
-define("NWFLAN_6", "Existing Newsfeeds");
-define("NWFLAN_7", "Edit");
-define("NWFLAN_8", "Delete");
-define("NWFLAN_9", "tick to confirm");
-define("NWFLAN_10", "Backend URL");
-define("NWFLAN_11", "Path to image");
-define("NWFLAN_12", "Display Tagline?");
-define("NWFLAN_13", "Display Description?");
-define("NWFLAN_14", "Display Webmaster?");
-define("NWFLAN_15", "Display Copyright?");
-define("NWFLAN_16", "Activate?");
-define("NWFLAN_17", "Update Newsfeed");
-define("NWFLAN_18", "Add Newsfeed");
-define("NWFLAN_19", "Newsfeeds");
-define("NWFLAN_20", "No URL entered.");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_newspost.php 75/e107_languages/English/admin/lan_newspost.php
--- 6171/e107_languages/English/admin/lan_newspost.php	2004-09-14 01:51:32.000000000 -0500
+++ 75/e107_languages/English/admin/lan_newspost.php	2006-04-13 18:43:16.000000000 -0500
@@ -1,121 +1,172 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/admin/lan_newspost.php,v $
-|     $Revision: 1.13 $
-|     $Date: 2004/09/14 06:51:31 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("NWSLAN_1", "News story deleted.");
-define("NWSLAN_2", "Please tick the confirm box to delete this news item.");
-define("NWSLAN_3", "No news items yet.");
-define("NWSLAN_4", "Existing News");
-define("NWSLAN_5", "Open HTML Editor");
-define("NWSLAN_6", "Category");
-define("NWSLAN_7", "Edit");
-define("NWSLAN_8", "Delete");
-define("NWSLAN_9", "tick to confirm");
-define("NWSLAN_10", "No news categories");
-define("NWSLAN_11", "Add/Edit Categories");
-define("NWSLAN_12", "Title");
-define("NWSLAN_13", "Body");
-define("NWSLAN_14", "Extended");
-define("NWSLAN_15", "Comments");
-define("NWSLAN_16", "Enabled");
-define("NWSLAN_17", "Disabled");
-define("NWSLAN_18", "Allow comments to be posted to this news item");
-define("NWSLAN_19", "Activation");
-define("NWSLAN_20", "Leave blank to disable auto-activation");
-define("NWSLAN_21", "Activate between");
-define("NWSLAN_22", "Visibility");
-define("NWSLAN_23", "Ticking will make the news item visible to only users in that class");
-define("NWSLAN_24", "Preview again");
-define("NWSLAN_25", "Update news in database");
-define("NWSLAN_26", "Post news to database");
-define("NWSLAN_27", "Preview");
-define("NWSLAN_28", "New story");
-define("NWSLAN_29", "News Post");
-define("NWSLAN_30", "Show title only");
-define("NWSLAN_31", "News item");
-define("NWSLAN_32", "deleted");
-define("NWSLAN_33", "News Category");
-define("NWSLAN_34", "Submitted news item");
-define("NWSLAN_35", "News Category Saved");
-define("NWSLAN_36", "News Category Updated");
-define("NWSLAN_37", "Are you sure you want to delete this category?");
-define("NWSLAN_38", "Are you sure you want to delete this submitted news item?");
-define("NWSLAN_39", "Are you sure you want to delete this news item?");
-define("NWSLAN_40", "Title");
-define("NWSLAN_41", "Options");
-define("NWSLAN_42", "Untitled");
-define("NWSLAN_43", "No news items");
-define("NWSLAN_44", "News Front Page");
-define("NWSLAN_45", "Create News Item");
-define("NWSLAN_46", "Categories");
-define("NWSLAN_47", "Submitted News");
-define("NWSLAN_48", "News Options");
-define("NWSLAN_49", "Submitted by");
-define("NWSLAN_50", "Insert image: Upload images to");
-
-define("NWSLAN_51", "Existing News Categories");
-define("NWSLAN_52", "Category Name");
-define("NWSLAN_53", "Category Icon");
-define("NWSLAN_54", "View Images");
-define("NWSLAN_55", "Update News Category");
-define("NWSLAN_56", "Create News Category");
-define("NWSLAN_57", "Item");
-define("NWSLAN_58", "Post");
-define("NWSLAN_59", "No submitted news");
-define("NWSLAN_60", "Submitted News");
-define("NWSLAN_61", "deleted");
-
-define("NWSLAN_62", "Go to page: ");
-define("NWSLAN_63", "Search newsposts");
-
-
-define("NWSLAN_64", "Insert download: Upload files to e107_files/downloads");
-define("NWSLAN_65", "if image, tick to create thumbnail");
-define("NWSLAN_66", "Upload");
-define("NWSLAN_67", "Image");
-define("NWSLAN_68", "File");
-define("NWSLAN_69", "Upload an image or file for use in the news item");
-define("NWSLAN_70", "The e107_files/downloads folder is not writable, you need to CHMOD 777 the folder before uploading");
-define("NWSLAN_71", "The folder");
-define("NWSLAN_72", "Only show news item between certain dates");
-define("NWSLAN_73", "Render type");
-define("NWSLAN_74", "Select how and where news item is posted");
-define("NWSLAN_75", "Default - post to front page");
-define("NWSLAN_76", "Title only - post to front page");
-define("NWSLAN_77", "Post to other news menu");
-
-define("NWSLAN_78", "This option is disabled as file uploading is not enabled on your server");
-define("NWSLAN_79","Clear Form");
-define("NWSLAN_80","Insert thumbnail");
-define("NWSLAN_81","Insert Image");
-define("NWSLAN_82","Insert download");
-define("NWSLAN_83","Extended news post");
-define("NWSLAN_83","and");
-define("NWSLAN_84","Choose which visitors will see news item");
-define("NWSLAN_85", "submitted by");
-
-define("NWSLAN_86", "Show News-Category Footer Menu");
-define("NWSLAN_87", "News Category Columns?");
-define("NWSLAN_88", "News posts to display per page?");
-define("NWSLAN_89", "Save News Preferences");
-define("NWSLAN_90", "News Preferences");
-define("NWSLAN_100", "Enable Image uploading on Submit News page");
-define("NWSLAN_101", "Automatic resizing of submitted image");
-define("NWSLAN_102", "width in pixels<br /> or leave blank to disable.");
-define("NWSLAN_103", "re-Post");
-define("NWSLAN_104", "by");
-define("NWSLAN_105", "Check box to update datestamp of news item to current time");
-define("NWSLAN_106", "Submit-News maybe accessed by:");
-define("NWSLAN_107", "Enable HtmlArea on Submit-News page.");
-
-define("NWSLAN_108","Display messages instead not allowed news");
-define("NWSLAN_109","Check the box if you want to display a standard message for visitors not allowed to see a news (userclass restriction) instead the news itself.");
-define("NWSLAN_110","is not writable, you need to CHMOD 777 the folder before uploading");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_newspost.php,v $
+|     $Revision: 1.26 $
+|     $Date: 2006/04/13 23:43:16 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+define("NWSLAN_1", "News story deleted.");
+define("NWSLAN_2", "Please tick the confirm box to delete this news item.");
+define("NWSLAN_3", "No news items yet.");
+define("NWSLAN_4", "Existing News");
+define("NWSLAN_5", "Open HTML Editor");
+define("NWSLAN_6", "Category");
+
+define("NWSLAN_9", "tick to confirm");
+define("NWSLAN_10", "No news categories");
+define("NWSLAN_11", "Add/Edit Categories");
+define("NWSLAN_12", "Title");
+define("NWSLAN_13", "Body");
+define("NWSLAN_14", "Extended");
+define("NWSLAN_15", "Comments");
+define("NWSLAN_16", "Enabled");
+define("NWSLAN_17", "Disabled");
+define("NWSLAN_18", "Allow comments to be posted to this news item");
+define("NWSLAN_19", "Activation");
+
+define("NWSLAN_21", "Activate between");
+define("NWSLAN_22", "Visibility");
+
+define("NWSLAN_24", "Preview again");
+define("NWSLAN_25", "Update news in database");
+define("NWSLAN_26", "Post news to database");
+define("NWSLAN_27", "Preview");
+
+define("NWSLAN_29", "News Post");
+
+define("NWSLAN_31", "News item");
+define("NWSLAN_32", "deleted");
+define("NWSLAN_33", "News Category");
+define("NWSLAN_34", "Submitted news item");
+define("NWSLAN_35", "News Category Saved");
+define("NWSLAN_36", "News Category Updated");
+define("NWSLAN_37", "Are you sure you want to delete this category?");
+define("NWSLAN_38", "Are you sure you want to delete this submitted news item?");
+define("NWSLAN_39", "Are you sure you want to delete this news item?");
+define("NWSLAN_40", "Title");
+
+define("NWSLAN_42", "Untitled");
+define("NWSLAN_43", "No news items");
+define("NWSLAN_44", "News Front Page");
+define("NWSLAN_45", "Create News Item");
+define("NWSLAN_46", "Categories");
+define("NWSLAN_47", "Submitted News");
+define("NWSLAN_48", "News Options");
+define("NWSLAN_49", "Submitted by");
+
+define("NWSLAN_51", "Existing News Categories");
+define("NWSLAN_52", "Category Name");
+define("NWSLAN_53", "Category Icon");
+define("NWSLAN_54", "View Images");
+define("NWSLAN_55", "Update News Category");
+define("NWSLAN_56", "Create News Category");
+define("NWSLAN_57", "Item");
+define("NWSLAN_58", "Post");
+define("NWSLAN_59", "No submitted news");
+define("NWSLAN_60", "Submitted News");
+
+define("NWSLAN_62", "Go to page: ");
+define("NWSLAN_63", "Search newsposts");
+
+define("NWSLAN_66", "Upload");
+define("NWSLAN_67", "Image");
+define("NWSLAN_68", "File");
+define("NWSLAN_69", "Upload an image or file for use in the news item");
+define("NWSLAN_70", "The ".e_FILE."downloads folder is not writable, you need to CHMOD 777 the folder before uploading and files.");
+define("NWSLAN_71", "The ".e_IMAGE."newspost_images folder is not writable.  You need to CHMOD 777 the folder before uploading any images.");
+define("NWSLAN_72", "Only show news item between certain dates");
+define("NWSLAN_73", "Render type");
+define("NWSLAN_74", "Select how and where news item is posted");
+define("NWSLAN_75", "Default - post to front page");
+define("NWSLAN_76", "Title only - post to front page");
+define("NWSLAN_77", "Post to other news menu");
+
+define("NWSLAN_78", "This option is disabled as file uploading is not enabled on your server");
+define("NWSLAN_79","Clear Form");
+
+define("NWSLAN_83","Extended news post");
+define("NWSLAN_84","Choose which visitors will see news item");
+
+define("NWSLAN_86", "Show News-Category Footer Menu");
+define("NWSLAN_87", "News Category Columns?");
+define("NWSLAN_88", "News posts to display per page?");
+define("NWSLAN_89", "Save News Preferences");
+define("NWSLAN_90", "News Preferences");
+define("NWSLAN_100", "Enable Image uploading on Submit News page");
+define("NWSLAN_101", "Automatic resizing of submitted image");
+define("NWSLAN_102", "width in pixels<br /> or leave blank to disable.");
+define("NWSLAN_103", "re-Post");
+define("NWSLAN_104", "by");
+define("NWSLAN_105", "Check box to update datestamp of news item to current time");
+define("NWSLAN_106", "Submit-News maybe accessed by:");
+define("NWSLAN_107", "Enable WYSIWYG editor on Submit-News page.");
+
+define("NWSLAN_111", "Show new date header");
+define("NWSLAN_112", "If this box is ticked, a box containing the date will be displayed above news items posted on a new day, useful for distinguishing posts on different days");
+
+define("NWSLAN_113", "Use non-standard template for news layout");
+define("NWSLAN_114", "if the theme you're using has a news layout template, use this instead of the generic layout");
+
+define("NWSLAN_115", "News posts to display in archive ?");
+define("NWSLAN_116", "First update the preferences with the changed display per page setting, then update again after setting the newsarchive preference. (0 is un-activated)");
+define("NWSLAN_117", "set the title for the newsarchive");
+define("NWSLAN_118", "View Images");
+define("NWSLAN_119", "Settings Saved");
+define("NWSLAN_120", "Text to show at the top of Submit News");
+
+define("LAN_NEWS_5", "Error! - Was unable to update news item into database!");
+define("LAN_NEWS_6", "News entered into database.");
+define("LAN_NEWS_7", "Error! - Was unable to enter news item into database!");
+define("LAN_NEWS_9", "Title only is set - <b>only the news title will be shown</b>");
+define("LAN_NEWS_10", "This news post is <b>inactive</b> (It will be not shown on front page). ");
+define("LAN_NEWS_11", "This news post is <b>active</b> (it will be shown on front page). ");
+define("LAN_NEWS_12", "Comments are turned <b>on</b>.");
+define("LAN_NEWS_13", "Comments are turned <b>off</b>.");
+define("LAN_NEWS_14", "<br />Activation period: ");
+define("LAN_NEWS_15", "Body length: ");
+define("LAN_NEWS_16", "b. Extended length: ");
+define("LAN_NEWS_17", "b.");
+define("LAN_NEWS_18", "Info");
+define("LAN_NEWS_19",  "Now");
+define("LAN_NEWS_21", "News updated in database.");
+
+define("LAN_NEWS_22", "Thumbnail");
+define("LAN_NEWS_23", "Choose an image for this news item");
+define("LAN_NEWS_24", "Image + Auto-Thumbnail");
+define("LAN_NEWS_25", "Auto-Thumbnail size");
+define("LAN_NEWS_26", "add new upload");
+define("LAN_NEWS_27", "Summary");
+
+define("LAN_NEWS_28", "Sticky");
+define("LAN_NEWS_29", "Select if news item will be sticky");
+define("LAN_NEWS_30", "If selected, news item will appear above all others");
+define("LAN_NEWS_31", "This news post is <b>sticky</b> (it will be shown above all other items). ");
+define("LAN_NEWS_32", "Datestamp");
+define("LAN_NEWS_33", "Set the datestamp for the current news item");
+
+define("LAN_NEWS_34", "Trackback");
+define("LAN_NEWS_35", "Add trackback url's");
+define("LAN_NEWS_36", "<b>Pingback</b> (send a pingback to all url's in this post)");
+define("LAN_NEWS_37", "<b>Trackback url's:</b> (one url per line)");
+define("LAN_NEWS_38", "Insert images");
+
+define("LAN_NEWS_39", "click on file to insert at cursor position");
+define("LAN_NEWS_40", "Insert download links");
+
+define("LAN_NEWS_42", "Files");
+define("LAN_NEWS_43", "(no images in /e107_images/newspost_images)");
+define("LAN_NEWS_44", "Trackback not enabled.");
+
+define("LAN_NEWS_45", "ID");
+
+define("LAN_NEWS_46", "News item not updated as no changes were made.");
+define("LAN_NEWS_47", "Image");
+define("LAN_NEWS_48", "No Image");
+
+define("LAN_NEWS_49", "Render-type");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_notify.php 75/e107_languages/English/admin/lan_notify.php
--- 6171/e107_languages/English/admin/lan_notify.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_notify.php	2005-05-29 13:19:25.000000000 -0500
@@ -0,0 +1,35 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_notify.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/05/29 18:19:25 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("NT_LAN_1", "Notify");
+define("NT_LAN_2", "Receive email notification on");
+define("NT_LAN_3", "Off");
+define("NT_LAN_4", "Head admin");
+define("NT_LAN_5", "Class");
+define("NT_LAN_6", "Email");
+
+define("NU_LAN_1", "User Events");
+define("NU_LAN_2", "User sign up");
+define("NU_LAN_3", "User account verification");
+define("NU_LAN_4", "User login");
+define("NU_LAN_5", "User logout");
+
+define("NS_LAN_1", "Security Events");
+define("NS_LAN_2", "IP banned for flooding site");
+
+define("NN_LAN_1", "News Events");
+define("NN_LAN_2", "News item submitted by user");
+define("NN_LAN_3", "News item posted by admin");
+define("NN_LAN_4", "News item edited by admin");
+define("NN_LAN_5", "News item deleted by admin");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_plugin.php 75/e107_languages/English/admin/lan_plugin.php
--- 6171/e107_languages/English/admin/lan_plugin.php	2004-03-27 22:12:14.000000000 -0600
+++ 75/e107_languages/English/admin/lan_plugin.php	2006-03-16 09:58:14.000000000 -0600
@@ -1,53 +1,98 @@
-<?php
-
-define("EPL_ADLAN_0", "Install");
-define("EPL_ADLAN_1", "Uninstall");
-define("EPL_ADLAN_2", "Are you certain you want to uninstall this plugin?");
-define("EPL_ADLAN_3", "Confirm uninstall");
-define("EPL_ADLAN_4", "Uninstall cancelled.");
-define("EPL_ADLAN_5", "The install procedure will create new preference entries.");
-define("EPL_ADLAN_6", "... then click here to begin install procedure"); 
-define("EPL_ADLAN_7", "Database tables successfully upgraded.");
-define("EPL_ADLAN_8", "Preference settings successfully created.");
-define("EPL_ADLAN_9", "Unable to successfully create table(s) for this plugin.");
-define("EPL_ADLAN_10", "Name ");
-define("EPL_ADLAN_11", "Version ");
-define("EPL_ADLAN_12", "Author ");
-define("EPL_ADLAN_13", "Compatible ");
-define("EPL_ADLAN_14", "Description ");
-define("EPL_ADLAN_15", "Read the README file for more information");
-define("EPL_ADLAN_16", "Plugin Information");
-define("EPL_ADLAN_17", "More info...");
-define("EPL_ADLAN_18", "Unable to successfully create table(s) for this plugin.");
-define("EPL_ADLAN_19", "Database tables successfully created.");
-define("EPL_ADLAN_20", "Preference settings successfully created.");
-
-define("EPL_ADLAN_21", "Plugin is already installed.");
-define("EPL_ADLAN_22", "Installed");
-define("EPL_ADLAN_23", "Not installed");
-define("EPL_ADLAN_24", "Upgrade available");
-define("EPL_ADLAN_25", "No install required");
-define("EPL_ADLAN_26", "... then click here to begin uninstall procedure"); 
-define("EPL_ADLAN_27", "Unable to successfully delete ");
-define("EPL_ADLAN_28", "Database tables successfully deleted.");
-define("EPL_ADLAN_29", "Preference settings successfully deleted.");
-define("EPL_ADLAN_30", "please delete it manually.");
-define("EPL_ADLAN_31", "Please now delete the folder ");
-define("EPL_ADLAN_32", "and all files inside it to complete the uninstall process.");
-define("EPL_ADLAN_33", "Plugin successfully installed.");
-define("EPL_ADLAN_34", "Plugin successfully updated.");
-define("EPL_ADLAN_35", "Parser settings successfully added.");
-define("EPL_ADLAN_36", "Parser code insert failed, incorrectly formatted.");
-
-define("EPL_CANCEL", "Cancel");
-define("EPL_EMAIL", "email");
-define("EPL_WEBSITE", "website");
-define("EPL_OPTIONS", "Options");
-define("EPL_NOINSTALL", "No install required, just activate from your menus screen. To uninstall, delete the ");
-define("EPL_DIRECTORY", "directory.");
-define("EPL_NOINSTALL_1", "No install required, to remove delete the ");
-define("EPL_UPGRADE", "Upgrade");
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_plugin.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2006/03/16 15:58:14 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+define("EPL_ADLAN_0", "Install");
+define("EPL_ADLAN_1", "Uninstall");
+define("EPL_ADLAN_2", "Are you certain you want to uninstall this plugin?");
+define("EPL_ADLAN_3", "Confirm uninstall");
+define("EPL_ADLAN_4", "Uninstall cancelled.");
+define("EPL_ADLAN_5", "The install procedure will create new preference entries.");
+define("EPL_ADLAN_6", "... then click here to begin install procedure");
+define("EPL_ADLAN_7", "Database tables successfully upgraded.");
+define("EPL_ADLAN_8", "Preference settings successfully created.");
+define("EPL_ADLAN_9", "SQL commands failed. Check to be sure all upgrade changes are ok.");
+define("EPL_ADLAN_10", "Name");
+define("EPL_ADLAN_11", "Version");
+define("EPL_ADLAN_12", "Author");
+define("EPL_ADLAN_13", "Compatible");
+define("EPL_ADLAN_14", "Description");
+define("EPL_ADLAN_15", "Read the README file for more information");
+define("EPL_ADLAN_16", "Plugin Information");
+define("EPL_ADLAN_17", "More info...");
+define("EPL_ADLAN_18", "Unable to successfully create table(s) for this plugin.");
+define("EPL_ADLAN_19", "Database tables successfully created.");
+define("EPL_ADLAN_20", "Preference settings successfully created.");
+
+define("EPL_ADLAN_21", "Plugin is already installed.");
+define("EPL_ADLAN_22", "Installed");
+define("EPL_ADLAN_23", "Not installed");
+define("EPL_ADLAN_24", "Upgrade available");
+define("EPL_ADLAN_25", "No install required");
+define("EPL_ADLAN_26", "... then click here to begin uninstall procedure");
+define("EPL_ADLAN_27", "Unable to successfully delete ");
+define("EPL_ADLAN_28", "Database tables successfully deleted.");
+define("EPL_ADLAN_29", "Preference settings successfully deleted.");
+define("EPL_ADLAN_30", "please delete it manually.");
+define("EPL_ADLAN_31", "Please now delete the folder ");
+define("EPL_ADLAN_32", "and all files inside it to complete the uninstall process.");
+define("EPL_ADLAN_33", "Plugin successfully installed.");
+define("EPL_ADLAN_34", "Plugin successfully updated.");
+define("EPL_ADLAN_35", "Parser settings successfully added.");
+define("EPL_ADLAN_36", "Parser code insert failed, incorrectly formatted.");
+
+define("EPL_ADLAN_37", "Upload plugin (.zip or .tar.gz format)");
+define("EPL_ADLAN_38", "Upload Plugin");
+define("EPL_ADLAN_39", "The file could not be uploaded as the ".e_PLUGIN." folder does not have the correct permissions - please CHMOD to 777 and reupload the file.");
+define("EPL_ADLAN_40", "Admin Message");
+define("EPL_ADLAN_41", "That file does not appear to be a valid .zip or .tar archive.");
+define("EPL_ADLAN_42", "An error has occurred, unable to un-archive the file");
+define("EPL_ADLAN_43", "Your plugin has been uploaded and unzipped, please scroll down to see your plugin in the list.");
+define("EPL_ADLAN_44", "Auto plugin upload and extraction is disabled as your plugins folder does not have the correct permissions - please CHMOD your e107_plugins folder to 777.");
+define("EPL_ADLAN_45", "Your menu item has been uploaded and unzipped, to activate go to <a href='".e_ADMIN."menus.php'>your menus page</a>.");
+
+// define("EPL_CANCEL", "Cancel"); use LAN_CANCEL instead !!
+// define("EPL_EMAIL", "email");
+define("EPL_WEBSITE", "Website");
+// define("EPL_OPTIONS", "Options"); use LAN_OPTIONS instead!
+define("EPL_NOINSTALL", "No install required, just activate from your menus screen. To uninstall, delete the ");
+define("EPL_DIRECTORY", "directory.");
+define("EPL_NOINSTALL_1", "No install required, to remove delete the ");
+define("EPL_UPGRADE", "Upgrade");
+define("EPL_CONFIGURE", "Configure");
+
+define("EPL_ADLAN_46", "RSS settings successfully created");
+define("EPL_ADLAN_47", "RSS settings successfully deleted");
+define("EPL_ADLAN_48", "Unable to successfully create RSS settings");
+define("EPL_ADLAN_49", "Unable to successfully delete RSS settings");
+
+define("EPL_ADLAN_50", "Comments successfully deleted");
+
+define("EPL_ADLAN_51", "No");
+define("EPL_ADLAN_52", "Yes");
+define("EPL_ADLAN_53", "Directory not writable");
+define("EPL_ADLAN_54", "Please select the option for uninstalling the plugin:");
+define("EPL_ADLAN_55", "Uninstall plugin");
+define("EPL_ADLAN_56", "Yes");
+define("EPL_ADLAN_57", "Delete plugin tables");
+define("EPL_ADLAN_58", "If the tables are not removed, the plugin can be reinstalled with no data loss.  The creation of tables during the reinstall will fail. Tables will have to be manually deleted to remove.");
+define("EPL_ADLAN_59", "Delete plugin files");
+define("EPL_ADLAN_60", "e107 will attempt to remove all plugin related files.");
+define("EPL_ADLAN_61", "Confirm uninstall");
+define("EPL_ADLAN_62", "Cancel uninstall");
+define("EPL_ADLAN_63", "Uninstall:");
+define("EPL_ADLAN_64", "");
+define("EPL_ADLAN_65", "");
+define("EPL_ADLAN_66", "");
+define("EPL_ADLAN_67", "");
+define("EPL_ADLAN_68", "");
+define("EPL_ADLAN_69", "");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_poll.php 75/e107_languages/English/admin/lan_poll.php
--- 6171/e107_languages/English/admin/lan_poll.php	2004-06-06 02:51:32.000000000 -0500
+++ 75/e107_languages/English/admin/lan_poll.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,33 +0,0 @@
-<?php
-
-define("POLLAN_1", "Delete cancelled.");
-define("POLLAN_2", "No polls set yet");
-define("POLLAN_3", "Existing Polls");
-define("POLLAN_4", "Edit");
-define("POLLAN_5", "Delete");
-define("POLLAN_6", "tick to confirm");
-define("POLLAN_7", "Poll Question");
-define("POLLAN_8", "Option");
-define("POLLAN_9", "Add another option");
-define("POLLAN_10", "Poll status");
-define("POLLAN_11", "Inactive");
-define("POLLAN_12", "Active - allow votes from all");
-define("POLLAN_13", "Active - allow votes from members only");
-define("POLLAN_14", "Preview again");
-define("POLLAN_15", "Update poll in database");
-define("POLLAN_16", "Post poll to database");
-define("POLLAN_17", "Preview");
-define("POLLAN_18", "Clear Form");
-define("POLLAN_19", "Polls");
-
-define("POLLAN_20", "Options");
-define("POLLAN_21", "Are you sure you want to delete this poll?");
-
-define("POLLAN_22", "No polls");
-define("POLLAN_23", "Poll Preview");
-
-//v.617
-define("POLLAN_24", "Allow comments for this poll? ");
-define("POLLAN_25", "Yes");
-define("POLLAN_26", "No");
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_prefs.php 75/e107_languages/English/admin/lan_prefs.php
--- 6171/e107_languages/English/admin/lan_prefs.php	2004-09-06 04:55:18.000000000 -0500
+++ 75/e107_languages/English/admin/lan_prefs.php	2006-05-01 19:00:04.000000000 -0500
@@ -1,132 +1,180 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/admin/lan_prefs.php,v $
-|     $Revision: 1.17 $
-|     $Date: 2004/09/06 09:55:17 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PRFLAN_1", "Site Information");
-define("PRFLAN_2", "Site Name");
-define("PRFLAN_3", "Site URL");
-define("PRFLAN_4", "Site Link Button");
-define("PRFLAN_5", "Site Tagline");
-define("PRFLAN_6", "Site Description");
-define("PRFLAN_7", "Main site admin");
-define("PRFLAN_8", "Main site admin email");
-define("PRFLAN_9", "Site Disclaimer");
-define("PRFLAN_10", "Theme");
-define("PRFLAN_11", "Site Theme");
-define("PRFLAN_12", "Click here to preview themes");
-define("PRFLAN_13", "Display Information");
-define("PRFLAN_14", "Display theme information?");
-define("PRFLAN_15", "Display render time?");
-define("PRFLAN_16", "Display sql queries?");
-define("PRFLAN_17", "Language");
-define("PRFLAN_18", "Site Language");
-define("PRFLAN_19", "Signup Page Options");
-define("PRFLAN_20", "News posts to display per page?");
-define("PRFLAN_21", "Date display options");
-define("PRFLAN_22", "Short date format");
-define("PRFLAN_23", "Long date format");
-define("PRFLAN_24", "Forum date format");
-define("PRFLAN_25", "For more information on date formats see the");
-define("PRFLAN_26", "Time offset");
-define("PRFLAN_27", "Example, if you set this to +2, all times on your site will have two hours added to them");
-define("PRFLAN_28", "User registration/posting");
-define("PRFLAN_29", "Activate user registration system?");
-define("PRFLAN_30", "allow users to register as members on your site");
-define("PRFLAN_31", "Use email verification for signups?");
-define("PRFLAN_32", "Allow anonymous posting?");
-define("PRFLAN_33", "if left unchecked only registered members can post comments etc");
-define("PRFLAN_34", "Security");
-define("PRFLAN_35", "Enable flood protection?");
-define("PRFLAN_36", "Flood timeout");
-define("PRFLAN_37", "Auto Ban");
-define("PRFLAN_38", "Time required in seconds between 2 posts for areas where users can post (chatbox, forums...). if a user post too fast, he will be redirected to the homepage");
-define("PRFLAN_39", "Protection of minors options");
-define("PRFLAN_40", "Filter profanities?");
-define("PRFLAN_41", "if checked swearing will be replaced with string below");
-define("PRFLAN_42", "Replace string");
-define("PRFLAN_43", "Filter words");
-define("PRFLAN_44", "words to censor, seperate with a comma");
-define("PRFLAN_45", "Use COPPA on signup page?");
-define("PRFLAN_46", "for more info on COPPA see");
-define("PRFLAN_47", "Security &amp; Protection");
-define("PRFLAN_48", "User Tracking method");
-define("PRFLAN_49", "Cookies");
-define("PRFLAN_50", "Sessions");
-define("PRFLAN_51", "Click here to visit the homepage of e107");
-define("PRFLAN_52", "Save Changes");
-define("PRFLAN_53", "Site Preferences");
-define("PRFLAN_54", "Admin Area Theme");
-define("PRFLAN_55", "Cookie name (if cookies selected)");
-define("PRFLAN_56", "Timezone");
-define("PRFLAN_57", "Admin Front Page Style");
-
-define("PRFLAN_58", "Restrict website to member's only");
-define("PRFLAN_59", "Ticking will restrict all areas apart from the front page and signup page to members only");
-define("PRFLAN_60", "Enable SSL");
-
-define("PRFLAN_61", "Only enable SSL if <b>you are sure you know what you are doing!</b>");
-
-define("PRFLAN_62", "Email Settings");
-define("PRFLAN_63", "Send test email");
-define("PRFLAN_64", "Clicking button will send test email to main admin email address");
-define("PRFLAN_65", "Click to send email to");
-define("PRFLAN_66", "Test email from");
-define("PRFLAN_67", "This is a test email, it appears that your email settings are working ok!\n\nRegards\nfrom the e107 website system.");
-define("PRFLAN_68", "The email could not be sent. It appears that your server is not correctly configured to send emails, please try again using SMTP, or contact your hosts and ask them to check their sendmail / email server settings.");
-define("PRFLAN_69", "The email has been successfully sent, please check your inbox.");
-define("PRFLAN_70", "Enable SMTP");
-define("PRFLAN_71", "Ticking will attempt to use SMTP server to send emails");
-define("PRFLAN_72", "SMTP Server");
-define("PRFLAN_73", "SMTP Username");
-define("PRFLAN_74", "SMTP Password");
-define("PRFLAN_75", "The email could not be sent. Please review your SMTP settings, or disable SMTP and try again.");
-
-define("PRFLAN_76", "Enable Image-code verification during signup.");
-define("PRFLAN_77", "Admin Display Options ");
-define("PRFLAN_78", "Leave blank to disable");
-define("PRFLAN_79", "Use HtmlArea for admin text-areas");
-define("PRFLAN_80", "Click here to view");
-define("PRFLAN_81", "Enable Image-code verification during login.");
-define("PRFLAN_82", "Restrict Search page to members");
-
-define("PRFLAN_83", "example");
-define("PRFLAN_85", "If a theme does not show up make sure it was uploaded correctly and read permissions are assigned.");
-define("PRFLAN_86", "Click here to verify language files");
-
-
-define("PRFLAN_87", "Comments");
-define("PRFLAN_88", "Click here to view nested comments");
-
-define("CUSTSIG_1", "Settings Saved!");
-define("CUSTSIG_2", "Real Name:");
-define("CUSTSIG_3", "Website:");
-define("CUSTSIG_4", "Birthday:");
-define("CUSTSIG_5", "Location:");
-define("CUSTSIG_6", "Signature:");
-define("CUSTSIG_7", "Avatar");
-define("CUSTSIG_8", "Time-Zone:");
-define("CUSTSIG_9", "Update Signup Settings");
-define("CUSTSIG_10", "Custom-Signup Page Options");
-define("CUSTSIG_11", "Check-All");
-define("CUSTSIG_12", "Hide");
-define("CUSTSIG_13", "Fields");
-define("CUSTSIG_14", "Display");
-define("CUSTSIG_15", "Required");
-define("CUSTSIG_16", "Minimum Length for Passwords");
-
-
-define("PRFLAN_89", "Site Header:");
-define("PRFLAN_90", "Click here to force Internet Explorer to use standards mode. Default is quirks mode.");
-define("PRFLAN_91", "If someone is attacking your site by multiple requests to your server, his IP will be automatically banned ! Don't replace a correct server config !!!");
-define("PRFLAN_92", "Secure signup verification -- hide password in email?");
-
-define("PRFLAN_93", "strftime function page at php.net");
-define("PRFLAN_94", "here");
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|    	Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_prefs.php,v $
+|     $Revision: 1.53 $
+|     $Date: 2006/05/02 00:00:04 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+define("PRFLAN_1", "Site Information");
+define("PRFLAN_2", "Site Name");
+define("PRFLAN_3", "Site URL");
+define("PRFLAN_4", "Site Link Button");
+define("PRFLAN_5", "Site Tagline");
+define("PRFLAN_6", "Site Description");
+define("PRFLAN_7", "Main site admin");
+define("PRFLAN_8", "Main site admin email");
+define("PRFLAN_9", "Site Disclaimer");
+define("PRFLAN_10", "Theme");
+define("PRFLAN_11", "Site Theme");
+define("PRFLAN_12", "Click here to preview themes");
+define("PRFLAN_13", "Display Information");
+define("PRFLAN_14", "Display theme information?");
+define("PRFLAN_15", "Display render time?");
+define("PRFLAN_16", "Display sql queries?");
+define("PRFLAN_17", "Compress Site Output Using gzip");
+define("PRFLAN_19", "Signup Page Options");
+define("PRFLAN_21", "Date display options");
+define("PRFLAN_22", "Short date format");
+define("PRFLAN_23", "Long date format");
+define("PRFLAN_24", "Forum date format");
+define("PRFLAN_25", "For more information on date formats see the");
+define("PRFLAN_26", "Time offset");
+define("PRFLAN_27", "Example, if you set this to +2, all times on your site will have two hours added to them");
+define("PRFLAN_28", "User registration/posting");
+define("PRFLAN_29", "Activate user registration system?");
+define("PRFLAN_30", "allow users to register as members on your site");
+//define("PRFLAN_31", "Use email verification for signups?");
+define("PRFLAN_32", "Allow anonymous posting?");
+define("PRFLAN_33", "switch this off to allow only registered members to post comments etc");
+define("PRFLAN_35", "Enable flood protection?");
+define("PRFLAN_36", "Flood timeout");
+define("PRFLAN_37", "Auto Ban");
+define("PRFLAN_38", "Time required in seconds between 2 posts for areas where users can post (chatbox, forums...). if a user post too fast, he will be redirected to the homepage");
+define("PRFLAN_40", "Filter profanities?");
+define("PRFLAN_41", "if checked swearing will be replaced with string below");
+define("PRFLAN_42", "Replace string");
+define("PRFLAN_43", "Filter words");
+define("PRFLAN_44", "words to censor, seperate with a comma");
+define("PRFLAN_45", "Use COPPA on signup page?");
+define("PRFLAN_46", "for more info on COPPA see");
+define("PRFLAN_47", "Security &amp; Protection");
+define("PRFLAN_48", "User Tracking method");
+define("PRFLAN_49", "Cookies");
+define("PRFLAN_50", "Sessions");
+define("PRFLAN_52", "Save Changes");
+define("PRFLAN_53", "Site Preferences");
+define("PRFLAN_55", "Cookie name (if cookies selected)");
+define("PRFLAN_56", "Timezone");
+define("PRFLAN_58", "Restrict website to members only");
+define("PRFLAN_59", "ticking will restrict all areas apart from the front page and signup page to members only");
+define("PRFLAN_60", "Enable SSL");
+define("PRFLAN_61", "Only enable SSL if <b>you are sure you know what you are doing!</b>");
+define("PRFLAN_76", "Enable Image-code verification during signup.");
+define("PRFLAN_77", "Admin Display Options ");
+define("PRFLAN_78", "Leave blank to disable");
+define("PRFLAN_80", "Click here to view");
+define("PRFLAN_81", "Enable Image-code verification during login.");
+define("PRFLAN_83", "example");
+define("PRFLAN_87", "Comments");
+define("PRFLAN_88", "Turn on nested comments");
+define("PRFLAN_89", "Display new comment icon");
+define("PRFLAN_90", "Allow posters to edit their comments");
+
+define("CUSTSIG_1", "Settings Saved!");
+define("CUSTSIG_2", "Real Name:");
+define("CUSTSIG_3", "Website:");
+define("CUSTSIG_4", "Birthday:");
+define("CUSTSIG_5", "Location:");
+define("CUSTSIG_6", "Signature:");
+define("CUSTSIG_7", "Avatar:");
+define("CUSTSIG_8", "Time-Zone:");
+define("CUSTSIG_12", "Hide");
+define("CUSTSIG_13", "Fields");
+define("CUSTSIG_14", "Display");
+define("CUSTSIG_15", "Required");
+define("CUSTSIG_16", "Minimum Length for Passwords");
+define("CUSTSIG_17", "Subscribe to content/mailouts");
+define("CUSTSIG_18", "Disallow usernames");
+define("CUSTSIG_19", "usernames containing the following text will be rejected, seperate entries by commas");
+
+define("PRFLAN_91", "If someone is attacking your site by multiple requests to your server, his IP will be automatically banned ! Don't replace a correct server config !!!");
+define("PRFLAN_92", "Secure signup verification -- hide password in email?");
+define("PRFLAN_93", "strftime function page at php.net");
+define("PRFLAN_94", "here");
+define("PRFLAN_95", "Display plugins info:");
+define("PRFLAN_96", "Will display info on all admin pages for each plugin supporting this type of feature");
+define("PRFLAN_97", "Unique 'Plugins info' menu:");
+define("PRFLAN_98", "If unchecked, each plugin will display its own info in an individual menu. If checked all info will be displayed in one menu.");
+define("PRFLAN_101", "Text rendering");
+define("PRFLAN_102", "Replace links");
+define("PRFLAN_103", "If ticked, posted links will be replaced by the text entered in the textbox below, will stop very long links breaking layout");
+define("PRFLAN_104", "Link replace text");
+define("PRFLAN_105", "text to replace links with, image can be used by using &lt;img tag, with full path to image");
+define("PRFLAN_106", "Core preferences saved to database.");
+define("PRFLAN_107", "Email link replace text");
+define("PRFLAN_108", "text to replace email links with, image can be used by using &lt;img tag, with full path to image");
+define("PRFLAN_109", "Wrap long words in main text");
+define("PRFLAN_110", "words longer than the length entered will be wrapped onto a new line");
+define("PRFLAN_111", "Wrap long words in menu text");
+define("PRFLAN_112", "On");
+define("PRFLAN_113", "Off");
+define("PRFLAN_116", "Allow HTML posting");
+define("PRFLAN_117", "This will allow users to post HTML code anywhere on the site, select the userclass to allow this.");
+define("PRFLAN_118", "Use Geshi for syntax highlighting");
+define("PRFLAN_119", "Geshi is an open source multi-language syntax highlighter, see http://qbnz.com/highlighter/ for more information");
+define("PRFLAN_120", "Default Geshi syntax language");
+define("PRFLAN_121", "if no language is specified in the code bbtag, this language will be used for highlighting");
+define("PRFLAN_122", "Enable WYSIWYG textareas");
+define("PRFLAN_123", "Will display a what-you-see-is-what-you-get editor in textareas when available. Applies only to Admins and Users that are allowed to post HTML.");
+define("PRFLAN_124", "Use 'classic' nextprev look");
+define("PRFLAN_125", "Turning this on will show the nextprev pages as 1 2 3 ... 21 22 23, instead of the new look with the dropdown.");
+define("PRFLAN_126", "Text to display on signup page");
+define("PRFLAN_127", "Make posted links clickable");
+define("PRFLAN_128", "Turning this on will convert posted links to hyperlinks");
+define("PRFLAN_129", "Disallow multiple logins");
+define("PRFLAN_130", "Activating this will prevent more than one person logging in with the same username/password (login detail sharing)");
+define("PRFLAN_131", "Activate use of [php] bbcode");
+define("PRFLAN_132", "Activating this will allow authorized users to post [php] code in certain areas");
+define("PRFLAN_133", "GD extension required, not found");
+define("PRFLAN_134", "Redirect all requests to site URL");
+define("PRFLAN_135", "for example, if your site URL above is set http://foo.com, anyone requesting http://www.foo.com will be redirected to http://foo.com");
+define("PRFLAN_136", "Maximum Signups permitted from the same IP address.");
+define("PRFLAN_137", "Display Memory Usage");
+define("PRFLAN_138", "Enable Image-code verification during forgotten password.");
+define("PRFLAN_139", "Display warning when main administrator password hasnt changed for at least 30 days");
+define("PRFLAN_140", "Text to display after signup form has been submitted.");
+define("PRFLAN_141", "Allow registration using XML User Profiles");
+define("PRFLAN_142", "Flood Only");
+define("PRFLAN_143", "Failed Login Only");
+define("PRFLAN_144", "Flood &amp; Failed Login");
+define("PRFLAN_145", "Links in new window");
+define("PRFLAN_146", "Tick here to make all links open in a new window (<i>this will apply sitewide</i>). ");
+define("PRFLAN_147", "Developer Mode");
+define("PRFLAN_148", "Activate developer functions. This is for developers only. Do not use on production sites for security reasons.");
+define("PRFLAN_149", "Advanced Features");
+define("PRFLAN_150", "Select e107 authentication method");
+define("PRFLAN_151", "e107 - No alternate authentication methods installed");
+
+define("PRFLAN_31", "Email Verification");
+define("PRFLAN_152", "No Verification");
+define("PRFLAN_153", "Admin Approval");
+define("PRFLAN_154", "New user verification method <br />If 'Admin Approval' is selected, it is recommended that you enable email notification on user signup <a href='".e_ADMIN."notify.php'>here</a>.");
+
+define("PRFLAN_155", "Display Name available to");
+define("PRFLAN_156", "Reset ALL Display Names");
+define("PRFLAN_157", "All Display Names have been reset to the Login Name");
+define("PRFLAN_158", "Display Name maximum length");
+define("PRFLAN_159", "viewing this page with");
+
+define("PRFLAN_160", "Check remote servers when validating email addresses.");
+define("PRFLAN_161", "Disable all comments on the site");
+
+define("PRFLAN_162", "Site Contact Information");
+define("PRFLAN_163", "eg. Company Name, Address, Phone etc.");
+
+define("PRFLAN_164", "Allow users to email copy of contact email to self");
+define("PRFLAN_165", "Possible opening for allowing spam, use with caution");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_review.php 75/e107_languages/English/admin/lan_review.php
--- 6171/e107_languages/English/admin/lan_review.php	2004-04-26 00:35:16.000000000 -0500
+++ 75/e107_languages/English/admin/lan_review.php	2004-09-21 14:11:55.000000000 -0500
@@ -1,83 +1,92 @@
-<?php
-
-define("REVLAN_1", "Review added to database.");
-define("REVLAN_2", "Fields left blank.");
-define("REVLAN_3", "Review updated in database.");
-define("REVLAN_4", "Review deleted.");
-define("REVLAN_5", "Please tick the confirm box to delete this review");
-define("REVLAN_6", "No reviews yet.");
-define("REVLAN_7", "Existing Reviews");
-define("REVLAN_8", "Edit");
-define("REVLAN_9", "Delete");
-define("REVLAN_10", "tick to confirm");
-define("REVLAN_11", "Open HTML Editor");
-define("REVLAN_12", "Heading");
-define("REVLAN_13", "Sub-Heading");
-define("REVLAN_14", "Summary");
-define("REVLAN_15", "Review");
-define("REVLAN_16", "Rating");
-define("REVLAN_17", "Please select rating");
-define("REVLAN_18", "Allow comments?");
-define("REVLAN_19", "On");
-define("REVLAN_20", "Off");
-define("REVLAN_21", "Visible to");
-define("REVLAN_22", "Update Review");
-define("REVLAN_23", "Submit Review");
-define("REVLAN_24", "Reviews");
-
-
-
-
-define("REVLAN_25", "Review Category Saved");
-define("REVLAN_26", "Review Category Updated");
-define("REVLAN_27", "Category deleted");
-define("REVLAN_28", "Category");
-define("REVLAN_29", "Options");
-define("REVLAN_30", "Edit");
-define("REVLAN_31", "Delete");
-define("REVLAN_32", "No review categories");
-define("REVLAN_33", "Existing Review Categories");
-define("REVLAN_34", "Category Name");
-define("REVLAN_35", "Category Icon");
-define("REVLAN_36", "View Images");
-define("REVLAN_37", "Category Summary");
-define("REVLAN_38", "Update Review Category");
-define("REVLAN_39", "Create Review Category");
-define("REVLAN_40", "No reviews");
-define("REVLAN_41", "Existing Reviews");
-define("REVLAN_42", "Open HTML Editor");
-define("REVLAN_43", "Category");
-define("REVLAN_44", "None");
-define("REVLAN_45", "Review Front Page");
-define("REVLAN_46", "Create new Review");
-define("REVLAN_47", "Categories");
-define("REVLAN_48", "Review Options");
-define("REVLAN_49", "Are you sure you want to delete this category?");
-define("REVLAN_50", "Are you sure you want to delete this review?");
-define("REVLAN_51", "Author Details");
-define("REVLAN_52", "leave if review written by you");
-define("REVLAN_53", "author name");
-define("REVLAN_54", "author email address");
-
-define("REVLAN_55", "Allow reviews to be submitted");
-define("REVLAN_56", "Allow visitors to submit reviews to your site");
-define("REVLAN_57", "Submit review class");
-define("REVLAN_58", "Select which users can submit reviews");
-define("REVLAN_59", "Update Options");
-define("REVLAN_60", "Review Options");
-define("REVLAN_61", "Review options updated");
-
-define("REVLAN_62", "Submitted Reviews");
-define("REVLAN_63", "No submitted reviews");
-define("REVLAN_64", "No email address supplied");
-define("REVLAN_65", "Review Heading");
-define("REVLAN_66", "Post");
-define("REVLAN_67", "Post User Submitted Article");
-define("REVLAN_68", "User submitted review saved in database");
-
-define("REVLAN_69", "Clear Form");
-define("REVLAN_70", "Click here to fill author fields");
-define("REVLAN_71", "Add email/print icons?");
-define("REVLAN_72", "Yes");
-define("REVLAN_73", "No");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_review.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:55 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("REVLAN_1", "Review added to database.");
+define("REVLAN_2", "Fields left blank.");
+define("REVLAN_3", "Review updated in database.");
+define("REVLAN_4", "Review deleted.");
+define("REVLAN_5", "Please tick the confirm box to delete this review");
+define("REVLAN_6", "No reviews yet.");
+define("REVLAN_7", "Existing Reviews");
+define("REVLAN_8", "Edit");
+define("REVLAN_9", "Delete");
+define("REVLAN_10", "tick to confirm");
+define("REVLAN_11", "Open HTML Editor");
+define("REVLAN_12", "Heading");
+define("REVLAN_13", "Sub-Heading");
+define("REVLAN_14", "Summary");
+define("REVLAN_15", "Review");
+define("REVLAN_16", "Rating");
+define("REVLAN_17", "Please select rating");
+define("REVLAN_18", "Allow comments?");
+define("REVLAN_19", "On");
+define("REVLAN_20", "Off");
+define("REVLAN_21", "Visible to");
+define("REVLAN_22", "Update Review");
+define("REVLAN_23", "Submit Review");
+define("REVLAN_24", "Reviews");
+
+
+
+
+define("REVLAN_25", "Review Category Saved");
+define("REVLAN_26", "Review Category Updated");
+define("REVLAN_27", "Category deleted");
+define("REVLAN_28", "Category");
+define("REVLAN_29", "Options");
+define("REVLAN_30", "Edit");
+define("REVLAN_31", "Delete");
+define("REVLAN_32", "No review categories");
+define("REVLAN_33", "Existing Review Categories");
+define("REVLAN_34", "Category Name");
+define("REVLAN_35", "Category Icon");
+define("REVLAN_36", "View Images");
+define("REVLAN_37", "Category Summary");
+define("REVLAN_38", "Update Review Category");
+define("REVLAN_39", "Create Review Category");
+define("REVLAN_40", "No reviews");
+define("REVLAN_41", "Existing Reviews");
+define("REVLAN_42", "Open HTML Editor");
+define("REVLAN_43", "Category");
+define("REVLAN_44", "None");
+define("REVLAN_45", "Review Front Page");
+define("REVLAN_46", "Create new Review");
+define("REVLAN_47", "Categories");
+define("REVLAN_48", "Review Options");
+define("REVLAN_49", "Are you sure you want to delete this category?");
+define("REVLAN_50", "Are you sure you want to delete this review?");
+define("REVLAN_51", "Author Details");
+define("REVLAN_52", "leave if review written by you");
+define("REVLAN_53", "author name");
+define("REVLAN_54", "author email address");
+
+define("REVLAN_55", "Allow reviews to be submitted");
+define("REVLAN_56", "Allow visitors to submit reviews to your site");
+define("REVLAN_57", "Submit review class");
+define("REVLAN_58", "Select which users can submit reviews");
+define("REVLAN_59", "Update Options");
+define("REVLAN_60", "Review Options");
+define("REVLAN_61", "Review options updated");
+
+define("REVLAN_62", "Submitted Reviews");
+define("REVLAN_63", "No submitted reviews");
+define("REVLAN_64", "No email address supplied");
+define("REVLAN_65", "Review Heading");
+define("REVLAN_66", "Post");
+define("REVLAN_67", "Post User Submitted Article");
+define("REVLAN_68", "User submitted review saved in database");
+
+define("REVLAN_69", "Clear Form");
+define("REVLAN_70", "Click here to fill author fields");
+define("REVLAN_71", "Add email/print icons?");
+define("REVLAN_72", "Yes");
+define("REVLAN_73", "No");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_search.php 75/e107_languages/English/admin/lan_search.php
--- 6171/e107_languages/English/admin/lan_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_search.php	2006-01-16 09:06:30.000000000 -0600
@@ -0,0 +1,63 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_search.php,v $
+|     $Revision: 1.23 $
+|     $Date: 2006/01/16 15:06:30 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+define("SEALAN_1", "Search Configuration");
+define("SEALAN_2", "Number of characters displayed in search result summary:");
+define("SEALAN_3", "Search sort method:");
+define("SEALAN_6", "Comments");
+define("SEALAN_7", "Registered Members");
+define("SEALAN_10", "Display relevance value:");
+define("SEALAN_11", "Allow user to select searchable areas:");
+define("SEALAN_12", "Restrict time allowed between searches (max 5 mins):");
+define("SEALAN_13", "Restrict to one search every");
+define("SEALAN_14", "seconds");
+define("SEALAN_15", "Search page accessible to user class");
+define("SEALAN_16", "On");
+define("SEALAN_17", "Off");
+define("SEALAN_18", "Searchable Comments Areas (when comments search is activated)");
+define("SEALAN_19", "Allow users to search more than one area at a time:");
+define("SEALAN_20", "General Settings");
+define("SEALAN_21", "Searchable Areas");
+define("SEALAN_22", "Default");
+define("SEALAN_23", "Alternative:");
+define("SEALAN_24", "Type");
+define("SEALAN_25", "User Class");
+define("SEALAN_26", "Pre-Title Text");
+define("SEALAN_30", "Highlight keywords on referred to page:");
+define("SEALAN_31", "PHP limited to");
+define("SEALAN_32", "results (leave blank for no limit)");
+define("SEALAN_33", "Could not switch to MySql sort method as this requires at least version 4.0.1 of MySql.");
+define("SEALAN_34", "Your version is currently");
+define("SEALAN_35", "Searchable areas selection method:");
+define("SEALAN_36", "Dropdown");
+define("SEALAN_37", "Checkbox");
+define("SEALAN_38", "Radio");
+define("SEALAN_39", "Custom Pages");
+
+define("LAN_98", "News");
+define("LAN_197", "Downloads");
+define("LAN_418", "Custom Pages");
+
+define("SEALAN_40", "Search Options");
+define("SEALAN_41", "Main Page");
+define("SEALAN_42", "Preferences");
+
+define("SEALAN_43", "Edit search settings for");
+define("SEALAN_44", "User class allowed to search this area");
+define("SEALAN_45", "Number of results displayed per page");
+define("SEALAN_46", "Number of characters in search result summary");
+
+define("SEALAN_47", "Only match whole words:");
+define("SEALAN_48", "This setting only applies when the search sort method is PHP. If your site includes Ideographic languages such as Chinese and Japanese you must have this set to off.");
+define("SEALAN_49", "If your site includes Ideographic languages such as Chinese and Japanese you must use the PHP sort method.");
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_submenusgen.php 75/e107_languages/English/admin/lan_submenusgen.php
--- 6171/e107_languages/English/admin/lan_submenusgen.php	2004-09-06 04:55:18.000000000 -0500
+++ 75/e107_languages/English/admin/lan_submenusgen.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,55 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/admin/lan_submenusgen.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/06 09:55:17 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("LAN_MENGEN_1","Manage links for your main menu");
-define("LAN_MENGEN_2","Automatic Menu Generator");
-define("LAN_MENGEN_3","Add links in a submenu for :");
-define("LAN_MENGEN_4","News");
-define("LAN_MENGEN_5","Forum");
-define("LAN_MENGEN_6","Articles");
-define("LAN_MENGEN_7","Downloads");
-define("LAN_MENGEN_8","For each category of news, a new link will be displayed in the submenu to access directly to this category");
-define("LAN_MENGEN_9","For each existing forum a new link will be displayed in the submenu to access directly to this forum.");
-define("LAN_MENGEN_10","All required links were successfully created.");
-define("LAN_MENGEN_11","For each existing category of articles a new link will be displayed in the submenu to access directly to the list of articles for this category.");
-define("LAN_MENGEN_12","For each download category a new link will be displayed in the submenu to access directly to this category");
-define("LAN_MENGEN_13","Create");
-define("LAN_MENGEN_14","All links in submenus");
-define("LAN_MENGEN_15","Message");
-define("LAN_MENGEN_16","All links displayed in submenus were deleted.");
-define("LAN_MENGEN_17","All links displayed in ALL submenus will be deleted (NOT ONLY submenus for");
-define("LAN_MENGEN_18","Delete");
-define("LAN_MENGEN_19","Clean Main Menu");
-define("LAN_MENGEN_20","Delete links in a submenu for");
-define("LAN_MENGEN_21","All links displayed in the");
-define("LAN_MENGEN_22","&nbsp;submenu will be deleted.");
-define("LAN_MENGEN_23","Main links are NOT deleted. If you need to delete them, please go to your");
-define("LAN_MENGEN_24","links section");
-define("LAN_MENGEN_25","Main link created: ");
-define("LAN_MENGEN_26","Link called: ");
-define("LAN_MENGEN_27"," is the MAIN link.");
-define("LAN_MENGEN_28"," is now displayed in the submenu of ");
-define("LAN_MENGEN_29"," already exists. No modification done.");
-define("LAN_MENGEN_30"," was created in the submenu of ");
-define("LAN_MENGEN_31"," To configure in your links section.");
-define("LAN_MENGEN_32"," was deleted ! ");
-define("LAN_MENGEN_33","No link to delete...");
-define("LAN_MENGEN_34","Other main links:");
-define("LAN_MENGEN_35","Submenu links names and URLs");
-define("LAN_MENGEN_36","Add links in submenus for:");
-define("LAN_MENGEN_37","Name: ");
-define("LAN_MENGEN_38","You can submit from 1 to 5 links for this main link, but... if required, you can re-use this tool to submit more links. Or use PHPMyAdmin if you have too much links to insert...");
-define("LAN_MENGEN_39","URL:");
-define("LAN_MENGEN_40"," can NOT be created, URL is missing...");
-define("LAN_MENGEN_41","Links");
-define("LAN_MENGEN_42","For each category of links, a new link will be displayed in the submenu to access directly to this category");
-define("LAN_MENGEN_43","All links displayed in the Links submenu will be deleted.");
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_theme.php 75/e107_languages/English/admin/lan_theme.php
--- 6171/e107_languages/English/admin/lan_theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_theme.php	2005-03-15 06:09:30.000000000 -0600
@@ -0,0 +1,62 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_theme.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/03/15 12:09:30 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+define("TPVLAN_1", "You are looking at a preview of the <b>'".PREVIEWTHEMENAME."'</b> theme. It has not been set as the main theme for your site, it has been activated to provide a preview of how the theme looks.<br />To set this theme as your site theme, <a href='".e_ADMIN."theme.php'>return to your theme manager</a> and select 'Set As Site Theme'.<br />To preview more themes please <a href='".e_ADMIN."theme.php'>click here</a>");
+define("TPVLAN_2", "Theme Preview");
+define("TPVLAN_3", "Main site theme set to");
+define("TPVLAN_4", "Author");
+define("TPVLAN_5", "Website");
+define("TPVLAN_6", "Release date");
+define("TPVLAN_7", "Information");
+define("TPVLAN_8", "Options");
+define("TPVLAN_9", "Preview Theme");
+define("TPVLAN_10", "Set As Site Theme");
+define("TPVLAN_11", "Version");
+define("TPVLAN_12", "No preview available");
+
+define("TPVLAN_13", "Upload theme (.zip or .tar.gz format)");
+define("TPVLAN_14", "Upload Theme");
+define("TPVLAN_15", "The file could not be uploaded as the ".e_THEME." folder does not have the correct permissions - please CHMOD to 777 and reupload the file.");
+define("TPVLAN_16", "Admin Message");
+define("TPVLAN_17", "That file does not appear to be a valid .zip or .tar archive.");
+define("TPVLAN_18", "An error has occurred, unable to un-archive the file");
+define("TPVLAN_19", "Your theme has been uploaded and unzipped, please scroll down to see your theme in the list.");
+define("TPVLAN_20", "Auto theme upload and extraction is disabled as your themes folder does not have the correct permissions - please CHMOD your e107_themes folder to 777.");
+
+define("TPVLAN_21", "This is the currently selected site theme");
+
+define("TPVLAN_22", "this theme has multiple stylesheets");
+define("TPVLAN_23", "default stylesheet");
+define("TPVLAN_24", "no information");
+define("TPVLAN_25", "To choose which stylesheet to use, please go to <a href='".e_ADMIN."prefs.php'>preferences</a> and click on 'Theme'.");
+
+define("TPVLAN_26", "Theme Manager");
+define("TPVLAN_27", "Please select stylesheet to use");
+define("TPVLAN_28", "on");
+define("TPVLAN_29", "off");
+define("TPVLAN_30", "Preload Theme Images:");
+
+define("TPVLAN_31", "This is the currently selected admin theme");
+define("TPVLAN_32", "Set As Admin Theme");
+
+define("TPVLAN_33", "Current Site Theme");
+define("TPVLAN_34", "Current Admin Theme");
+define("TPVLAN_35", "Save options");
+define("TPVLAN_36", "Admin Message");
+define("TPVLAN_37", "Theme options saved");
+define("TPVLAN_38", "Upload Theme");
+define("TPVLAN_39", "Available Themes");
+define("TPVLAN_40", "Admin theme set to");
+
+define("TPVLAN_41", "Please select admin layout style to use");
+define("TPVLAN_42", "Save admin options");
+define("TPVLAN_43", "Admin options saved");
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_theme_prev.php 75/e107_languages/English/admin/lan_theme_prev.php
--- 6171/e107_languages/English/admin/lan_theme_prev.php	2004-06-01 16:37:02.000000000 -0500
+++ 75/e107_languages/English/admin/lan_theme_prev.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,18 +0,0 @@
-<?php
-
-define("TPVLAN_1", "This is a Theme Test Page");
-define("TPVLAN_2", "This theme is active for this page only. Links below will not work.");
-define("TPVLAN_3", "Preferences");
-define("TPVLAN_4", "Preview More Themes");
-define("TPVLAN_5", "Preview Site Themes");
-define("TPVLAN_6", "Preview");
-define("TPVLAN_7", "Preview Theme");
-define("TPVLAN_8", "This theme is active for this page only. Links below will not work.");
-define("TPVLAN_9", "Preview More Themes");
-define("TPVLAN_10", "Click Submit to set as site theme. ");
-define("TPVLAN_11", "info");
-define("TPVLAN_12", "Theme preferences saved.");
-define("TPVLAN_13", "Theme");
-define("TPVLAN_15", "Submit");
-define("TPVLAN_14", "If a theme does not show up make sure it was uploaded correctly and read permissions are assigned.");
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_theme_prev.phpOLD 75/e107_languages/English/admin/lan_theme_prev.phpOLD
--- 6171/e107_languages/English/admin/lan_theme_prev.phpOLD	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/admin/lan_theme_prev.phpOLD	1969-12-31 18:00:00.000000000 -0600
@@ -1,11 +0,0 @@
-<?php
-
-define("TPVLAN_1", "This is a Theme Test Page");
-define("TPVLAN_2", "This theme is active for this page only. To set it as your site theme go to");
-define("TPVLAN_3", "Preferences");
-define("TPVLAN_4", "Preview More Themes");
-define("TPVLAN_5", "Preview Site Themes");
-define("TPVLAN_6", "Preview");
-define("TPVLAN_7", "Preview Theme");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_ugflag.php 75/e107_languages/English/admin/lan_ugflag.php
--- 6171/e107_languages/English/admin/lan_ugflag.php	2004-03-18 09:37:10.000000000 -0600
+++ 75/e107_languages/English/admin/lan_ugflag.php	2004-09-21 14:11:55.000000000 -0500
@@ -1,11 +1,20 @@
-<?php
-
-define("UGFLAN_1", "maintenance setting updated");
-define("UGFLAN_2", "Activate maintenance flag");
-define("UGFLAN_3", "Update Maintenance Setting");
-define("UGFLAN_4", "Maintenance Setting");
-
-define("UGFLAN_5", "Text to display when site down");
-define("UGFLAN_6", "Leave blank to display default message");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_ugflag.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:55 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("UGFLAN_1", "maintenance setting updated");
+define("UGFLAN_2", "Activate maintenance flag");
+define("UGFLAN_3", "Update Maintenance Setting");
+define("UGFLAN_4", "Maintenance Setting");
+
+define("UGFLAN_5", "Text to display when site down");
+define("UGFLAN_6", "Leave blank to display default message");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_updateadmin.php 75/e107_languages/English/admin/lan_updateadmin.php
--- 6171/e107_languages/English/admin/lan_updateadmin.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/admin/lan_updateadmin.php	2004-09-21 14:11:55.000000000 -0500
@@ -1,12 +1,21 @@
-<?php
-
-define("UDALAN_1", "Error - please re-submit");
-define("UDALAN_2", "Settings updated");
-define("UDALAN_3", "Settings Updated for");
-define("UDALAN_4", "Name");
-define("UDALAN_5", "Password");
-define("UDALAN_6", "Re-type Password");
-define("UDALAN_7", "Change Password");
-define("UDALAN_8", "Password Update for");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_updateadmin.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:55 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("UDALAN_1", "Error - please re-submit");
+define("UDALAN_2", "Settings updated");
+define("UDALAN_3", "Settings Updated for");
+define("UDALAN_4", "Name");
+define("UDALAN_5", "Password");
+define("UDALAN_6", "Re-type Password");
+define("UDALAN_7", "Change Password");
+define("UDALAN_8", "Password Update for");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_upload.php 75/e107_languages/English/admin/lan_upload.php
--- 6171/e107_languages/English/admin/lan_upload.php	2005-05-12 23:18:39.000000000 -0500
+++ 75/e107_languages/English/admin/lan_upload.php	2005-12-21 11:03:51.000000000 -0600
@@ -1,70 +1,72 @@
-<?php
-
-define("UPLLAN_1", "Upload removed from list.");
-define("UPLLAN_2", "Settings saved in database");
-define("UPLLAN_3", "Upload ID");
-define("UPLLAN_4", "Date");
-define("UPLLAN_5", "Poster");
-define("UPLLAN_6", "Email");
-define("UPLLAN_7", "Website");
-define("UPLLAN_8", "File Name");
-
-define("UPLLAN_9", "Version");
-define("UPLLAN_10", "File");
-define("UPLLAN_11", "File Size");
-define("UPLLAN_12", "Screenshot");
-define("UPLLAN_13", "Description");
-define("UPLLAN_14", "Demo");
-define("UPLLAN_15", "Options");
-define("UPLLAN_16", "copy to newspost");
-define("UPLLAN_17", "remove upload from list");
-define("UPLLAN_18", "View details");
-define("UPLLAN_19", "There are no unmoderated public uploads");
-define("UPLLAN_20", "There");
-define("UPLLAN_21", "unmoderated public upload");
-define("UPLLAN_22", "ID");
-define("UPLLAN_23", "Name");
-define("UPLLAN_24", "Filetype");
-define("UPLLAN_25", "Uploads Enabled?");
-define("UPLLAN_26", "No public uploads will be permitted if disabled");
-define("UPLLAN_27", "Yes");
-define("UPLLAN_28", "No");
-
-define("UPLLAN_29", "Storage type");
-define("UPLLAN_30", "Choose how to store uploaded files, either as normal files on server or as binary info in database<br /><b>Note</b> binary is only suitable for smaller files under approximately 500kb");
-define("UPLLAN_31", "Flatfile");
-define("UPLLAN_32", "Binary");
-define("UPLLAN_33", "Maximum file size");
-define("UPLLAN_34", "Maximum upload size in bytes - leave blank to conform to php.ini setting ( php.ini setting is");
-define("UPLLAN_35", "Allowed file types");
-define("UPLLAN_36", "Please enter one type per line");
-define("UPLLAN_37", "Permission");
-define("UPLLAN_38", "Select to allow only certain users to upload");
-define("UPLLAN_39", "Submit");
-define("UPLLAN_40", "Options");
-define("UPLLAN_41", "Please note - file uploads are disabled from your php.ini, it will not be possible to upload files until you set it to On.");
-
-define("UPLLAN_42", "Actions");
-define("UPLLAN_43", "Uploads");
-define("UPLLAN_44", "Upload");
-
-define("UPLAN_COPYTODLM", "copy to download manager");
-define("UPLAN_IS", "is ");
-define("UPLAN_ARE", "are ");
-define("UPLAN_COPYTODLS", "Copy to Downloads");
-
-
-define("ADLAN_52", "Admin Front Page");
-define("ADLAN_53", "Leave Admin Area");
-define("ADLAN_93", "Show Admin Functions");
-define("ADLAN_95", "Plugin Management");
-define("ADLAN_45", "Database utilities");
-define("ADLAN_46", "Logout");
-define("ADLAN_47", "Welcome");
-define("ADLAN_102", "It has been more than 30 days since you changed the main administrator password - ");
-define("ADLAN_103", "Click here to change it now");
-define("ADLAN_104", "Security");
-define("UPLLAN_45", "Remove upload");
-define("UPLLAN_46", "Confirm");
-define("UPLLAN_47", "Cancel");  
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_upload.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/21 17:03:51 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+define("UPLLAN_1", "Upload removed from list.");
+define("UPLLAN_2", "Settings saved in database");
+define("UPLLAN_3", "Upload ID");
+
+define("UPLLAN_5", "Poster");
+define("UPLLAN_6", "Email");
+define("UPLLAN_7", "Website");
+define("UPLLAN_8", "File Name");
+
+define("UPLLAN_9", "Version");
+define("UPLLAN_10", "File");
+define("UPLLAN_11", "File Size");
+define("UPLLAN_12", "Screenshot");
+define("UPLLAN_13", "Description");
+define("UPLLAN_14", "Demo");
+
+define("UPLLAN_16", "copy to newspost");
+define("UPLLAN_17", "remove upload from list");
+define("UPLLAN_18", "View details");
+define("UPLLAN_19", "There are no unmoderated public uploads");
+define("UPLLAN_20", "There");
+define("UPLLAN_21", "unmoderated public upload");
+define("UPLLAN_22", "ID");
+define("UPLLAN_23", "Name");
+define("UPLLAN_24", "Filetype");
+define("UPLLAN_25", "Uploads Enabled?");
+define("UPLLAN_26", "No public uploads will be permitted if disabled");
+
+define("UPLLAN_29", "Storage type");
+define("UPLLAN_30", "Choose how to store uploaded files, either as normal files on server or as binary info in database<br /><b>Note</b> binary is only suitable for smaller files under approximately 500kb");
+define("UPLLAN_31", "Flatfile");
+define("UPLLAN_32", "Binary");
+define("UPLLAN_33", "Maximum file size");
+define("UPLLAN_34", "Maximum upload size in bytes - leave blank to conform to php.ini setting ( php.ini setting is");
+define("UPLLAN_35", "Allowed file types");
+define("UPLLAN_36", "Please enter one type per line");
+define("UPLLAN_37", "Permission");
+define("UPLLAN_38", "Select to allow only certain users to upload");
+define("UPLLAN_39", "Submit");
+
+define("UPLLAN_41", "Please note - file uploads are disabled from your php.ini, it will not be possible to upload files until you set it to On.");
+
+define("UPLLAN_42", "Actions");
+define("UPLLAN_43", "Uploads");
+define("UPLLAN_44", "Upload");
+
+define("UPLLAN_45", "Are you sure you want to delete the following file...");
+
+define("UPLAN_COPYTODLM", "copy to download manager");
+define("UPLAN_IS", "is ");
+define("UPLAN_ARE", "are ");
+define("UPLAN_COPYTODLS", "Copy to Downloads");
+
+define("UPLLAN_48", "For security reasons allowed file types has been moved out of the database into a 
+flatfile located in your admin directory. To use, rename the file e107_admin/filetypes_.php to e107_admin/filetypes.php 
+and add a comma delimited list of file type extensions to it. You should not allow the upload of .html, .txt, etc 
+as an attacker may upload a file of this type which includes malicious javascript. You should also, of course, not allow 
+the upload of .php files or any other type of executable script.");
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_userclass2.php 75/e107_languages/English/admin/lan_userclass2.php
--- 6171/e107_languages/English/admin/lan_userclass2.php	2004-05-23 13:57:06.000000000 -0500
+++ 75/e107_languages/English/admin/lan_userclass2.php	2005-04-02 15:08:06.000000000 -0600
@@ -1,32 +1,41 @@
-<?php
-
-define("UCSLAN_1", "Cleared all users from class.");
-define("UCSLAN_2", "Class users updated.");
-define("UCSLAN_3", "Class deleted.");
-define("UCSLAN_4", "Please tick the confirm box to delete this user class");
-define("UCSLAN_5", "Class updated.");
-define("UCSLAN_6", "Class saved to database.");
-define("UCSLAN_7", "No user classes yet.");
-define("UCSLAN_8", "Existing Classes");
-
-define("UCSLAN_9", "Edit");
-define("UCSLAN_10", "Delete");
-define("UCSLAN_11", "tick to confirm");
-define("UCSLAN_12", "Class Name");
-define("UCSLAN_13", "Class Description");
-define("UCSLAN_14", "Update User Class");
-define("UCSLAN_15", "Create New Class");
-define("UCSLAN_16", "Assign users to class");
-define("UCSLAN_17", "Remove");
-define("UCSLAN_18", "Clear Class");
-define("UCSLAN_19", "Assign users to");
-define("UCSLAN_20", "class");
-define("UCSLAN_21", "User Class Settings");
-
-define("UCSLAN_22", "Users - click to move ...");
-define("UCSLAN_23", "Users in this class ...");
-
-define("UCSLAN_24", "Who can manage class");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_userclass2.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/04/02 21:08:06 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("UCSLAN_1", "Cleared all users from class.");
+define("UCSLAN_2", "Class users updated.");
+define("UCSLAN_3", "Class deleted.");
+define("UCSLAN_4", "Please tick the confirm box to delete this user class");
+define("UCSLAN_5", "Class updated.");
+define("UCSLAN_6", "Class saved to database.");
+define("UCSLAN_7", "No user classes yet.");
+define("UCSLAN_8", "Existing Classes");
+
+// define("UCSLAN_9", "Edit");
+// define("UCSLAN_10", "Delete");
+define("UCSLAN_11", "tick to confirm");
+define("UCSLAN_12", "Class Name");
+define("UCSLAN_13", "Class Description");
+define("UCSLAN_14", "Update User Class");
+define("UCSLAN_15", "Create New Class");
+define("UCSLAN_16", "Assign users to class");
+define("UCSLAN_17", "Remove");
+define("UCSLAN_18", "Clear Class");
+define("UCSLAN_19", "Assign users to");
+define("UCSLAN_20", "class");
+define("UCSLAN_21", "User Class Settings");
+
+define("UCSLAN_22", "Users - click to move ...");
+define("UCSLAN_23", "Users in this class ...");
+
+define("UCSLAN_24", "Who can manage class");
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_userclass.php 75/e107_languages/English/admin/lan_userclass.php
--- 6171/e107_languages/English/admin/lan_userclass.php	2004-03-26 00:17:16.000000000 -0600
+++ 75/e107_languages/English/admin/lan_userclass.php	2004-10-03 10:57:25.000000000 -0500
@@ -1,14 +1,24 @@
-<?php
-
-define("UCSLAN_1", "Sending notification email to");
-define("UCSLAN_2", "Updated Privelages");
-define("UCSLAN_3", "Dear");
-define("UCSLAN_4", "Your privelages have been updated at");
-define("UCSLAN_5", "You now have access to the following area(s)");
-define("UCSLAN_6", "Set class for user");
-define("UCSLAN_7", "Set Classes");
-define("UCSLAN_8", "Notify User");
-define("UCSLAN_8", "Classes Updated.");
-define("UCSLAN_9", "Regards");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_userclass.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2004/10/03 15:57:25 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+define("UCSLAN_1", "Sending notification email to");
+define("UCSLAN_2", "Updated Privileges");
+define("UCSLAN_3", "Dear");
+define("UCSLAN_4", "Your privileges have been updated at");
+define("UCSLAN_5", "You now have access to the following area(s)");
+define("UCSLAN_6", "Set class for user");
+define("UCSLAN_7", "Set Classes");
+define("UCSLAN_8", "Notify User");
+define("UCSLAN_9", "Classes Updated.");
+define("UCSLAN_10", "Regards,");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_userinfo.php 75/e107_languages/English/admin/lan_userinfo.php
--- 6171/e107_languages/English/admin/lan_userinfo.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/admin/lan_userinfo.php	2005-04-02 15:08:06.000000000 -0600
@@ -1,11 +1,20 @@
-<?php
-
-define("USFLAN_1", "Unable to find poster's IP address - no information is available.");
-define("USFLAN_2", "Error");
-define("USFLAN_3", "Messages posted from IP address");
-define("USFLAN_4", "Host");
-define("USFLAN_5", "Click here to transfer IP address to admin ban page");
-define("USFLAN_6", "UserID");
-define("USFLAN_7", "User Information");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_userinfo.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/04/02 21:08:06 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("USFLAN_1", "Unable to find poster's IP address - no information is available.");
+// define("USFLAN_2", "Error");
+define("USFLAN_3", "Messages posted from IP address");
+define("USFLAN_4", "Host");
+define("USFLAN_5", "Click here to transfer IP address to admin ban page");
+define("USFLAN_6", "UserID");
+define("USFLAN_7", "User Information");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_users_extended.php 75/e107_languages/English/admin/lan_users_extended.php
--- 6171/e107_languages/English/admin/lan_users_extended.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/admin/lan_users_extended.php	2006-01-14 19:08:04.000000000 -0600
@@ -0,0 +1,99 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_users_extended.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/01/15 01:08:04 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+define("EXTLAN_1", "Name");
+define("EXTLAN_2", "Preview");
+define("EXTLAN_3", "Values");
+define("EXTLAN_4", "Req'd");
+define("EXTLAN_5", "Applicable");
+define("EXTLAN_6", "Read access");
+define("EXTLAN_7", "Write access");
+define("EXTLAN_8", "Action");
+define("EXTLAN_9", "Extended User Fields");
+
+define("EXTLAN_10", "Field name");
+define("EXTLAN_11", "This is the name of the field as stored in the table, it must be unique from any other");
+define("EXTLAN_12", "Field text");
+define("EXTLAN_13", "This is the displayed name of the field in rendered pages");
+define("EXTLAN_14", "Field Type");
+define("EXTLAN_15", "Field include text");
+define("EXTLAN_16", "Default Value");
+define("EXTLAN_17", "Enter each possible value on each line <br /> For DB table see help.");
+define("EXTLAN_18", "Required");
+define("EXTLAN_19", "Users will be required to enter a value in this field when updating their settings.");
+define("EXTLAN_20", "Determines which users this field will apply to.");
+define("EXTLAN_21", "This will determine who will see this field in their usersettings.");
+define("EXTLAN_22", "This will determine who can see the value in the user page <br />NOTE: Setting this to 'Read Only' will make it visible to Admin and the member only.");
+define("EXTLAN_23", "Add Extended Field");
+define("EXTLAN_24", "Update Extended Field");
+define("EXTLAN_25", "move down");
+define("EXTLAN_26", "move up");
+define("EXTLAN_27", "Confirm Delete");
+define("EXTLAN_28", "No extended fields defined");
+define("EXTLAN_29", "Extended user fields saved.");
+define("EXTLAN_30", "Extended field deleted");
+// define("EXTLAN_31", "Extended Field Menu");
+// define("EXTLAN_32", "Extended front page");
+define("EXTLAN_33", "Cancel Edit");
+define("EXTLAN_34", "Extended Fields");
+define("EXTLAN_35", "Categories");
+define("EXTLAN_36", "No assigned Category");
+define("EXTLAN_37", "No categories defined");
+define("EXTLAN_38", "Category name");
+define("EXTLAN_39", "Add category");
+define("EXTLAN_40", "Category created");
+define("EXTLAN_41", "Category deleted");
+define("EXTLAN_42", "Update Category");
+define("EXTLAN_43", "Category Updated");
+define("EXTLAN_44", "Category");
+define("EXTLAN_45", "Add New Field");
+define("EXTLAN_46", "Help");
+define("EXTLAN_47", "Add new parameter");
+define("EXTLAN_48", "Add new value");
+define("EXTLAN_49", "Allow user to hide");
+define("EXTLAN_50", "Setting this to yes will allow the user to hide this value from non-admins");
+define("EXTLAN_51", "Any valid w3c parameter may be entered here<br />ie <i><b>class='tbox' size='40' maxlength='80'</i></b>");
+define("EXTLAN_52", "regex validation code");
+define("EXTLAN_53", "Enter the regex code that will need to be matched to make it a valid entry <br />**regex delimiters are required**");
+define("EXTLAN_54", "regex failure text");
+define("EXTLAN_55", "Enter the error message that will be shown if the regex validation fails.");
+define("EXTLAN_56", "Predefined Fields");
+define("EXTLAN_57", "Activated");
+define("EXTLAN_58", "Not Activated");
+define("EXTLAN_59", "Activate");
+define("EXTLAN_60", "Deactivate");
+define("EXTLAN_61", "None");
+
+define("EXTLAN_62", "Table");
+define("EXTLAN_63", "Field Id");
+define("EXTLAN_64", "Display Value");
+
+define("EXTLAN_65", "No - Will not show on signup page");
+define("EXTLAN_66", "Yes - Will show on signup page");
+define("EXTLAN_67", "No - Show on signup page");
+
+
+//textbox
+define("EXTLAN_HELP_1", "<b><i>Parameters:</i></b><br />size - size of field<br />maxlength - max length of field<br /><br />class - css class of field<br />style - css style string<br /><br />regex - regex valiation code<br />regexfail - validation fail text");
+//radio buttons
+define("EXTLAN_HELP_2", "This will be the radio buttons help text");
+//dropdown
+define("EXTLAN_HELP_3", "This will be the dropdown help text");
+//db field
+define("EXTLAN_HELP_4", "<b><i>Values:</i></b><br />There should be three values given ALWAYS:<br /><ol><li>dbtable</li><li>field containing id</li><li>field containing value</li></ol><br />");
+//textarea
+define("EXTLAN_HELP_5", "This will be the Textarea help text");
+//integer
+define("EXTLAN_HELP_6", "This will be the Integer help text");
+//date
+define("EXTLAN_HELP_7", "This will be the date help text");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_users.php 75/e107_languages/English/admin/lan_users.php
--- 6171/e107_languages/English/admin/lan_users.php	2004-09-09 04:31:42.000000000 -0500
+++ 75/e107_languages/English/admin/lan_users.php	2006-05-12 17:50:40.000000000 -0500
@@ -1,144 +1,190 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/admin/lan_users.php,v $
-|     $Revision: 1.10 $
-|     $Date: 2004/09/09 09:31:42 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("USRLAN_1", "Options Saved.");
-define("USRLAN_2", "Extended user fields saved.");
-define("USRLAN_3", "now listed an Administrator - to set permissions please go to the");
-define("USRLAN_4", "Administrator page");
-define("USRLAN_5", "You cannot remove admin status of main site admin");
-define("USRLAN_6", "has had Administrator status removed.");
-define("USRLAN_7", "You cannot ban the main site administrator");
-define("USRLAN_8", "User banned.");
-define("USRLAN_9", "User unbanned.");
-define("USRLAN_10", "User deleted.");
-define("USRLAN_11", "Delete cancelled.");
-define("USRLAN_12", "You cannot delete the main site administrator.");
-define("USRLAN_13", "Please confirm you wish to delete this member");
-define("USRLAN_14", "once deleted the record cannot be retrieved");
-define("USRLAN_15", "Cancel");
-define("USRLAN_16", "Confirm Delete");
-define("USRLAN_17", "Confirm Delete User");
-define("USRLAN_18", "User activated.");
-define("USRLAN_19", "Search");
-define("USRLAN_20", "Order by");
-define("USRLAN_21", "User ID");
-define("USRLAN_22", "User name");
-define("USRLAN_23", "Visits to site");
-define("USRLAN_24", "Admin status");
-define("USRLAN_25", "Status");
-define("USRLAN_26", "Descending");
-define("USRLAN_27", "Ascending");
-define("USRLAN_28", "Sort");
-define("USRLAN_29", "Delete");
-define("USRLAN_30", "Ban");
-define("USRLAN_31", "Ban -unactivated-");
-define("USRLAN_32", "Activate");
-define("USRLAN_33", "Unban");
-define("USRLAN_34", "Remove admin status");
-define("USRLAN_35", "Make admin");
-define("USRLAN_36", "Set Class");
-define("USRLAN_37", "Members");
-define("USRLAN_38", "Search returned");
-define("USRLAN_39", "result(s)");
-define("USRLAN_40", "None defined");
-define("USRLAN_41", "Field name");
-define("USRLAN_42", "Add Extended Field");
-define("USRLAN_43", "Extended User Fields");
-define("USRLAN_44", "Allow members to upload an avatar?");
-define("USRLAN_45", "Yes");
-define("USRLAN_46", "No");
-define("USRLAN_47", "Maximum avatar width (in pixels)");
-define("USRLAN_48", "default is 120");
-define("USRLAN_49", "Maximum avatar height (in pixels)");
-define("USRLAN_50", "default is 100");
-define("USRLAN_51", "Update Options");
-define("USRLAN_52", "Member Options");
-define("USRLAN_53", "Allow members to upload a photograph?");
-define("USRLAN_54", "Click here to delete all un-activated users");
-define("USRLAN_55", "Prune");
-define("USRLAN_56", "Deleted");
-define("USRLAN_57", "Deleting un-activated members ...");
-define("USRLAN_58", "file uploads are disabled in php.ini");
-define("USRLAN_59", "Quick add user");
-define("USRLAN_60", "Add user");
-define("USRLAN_61", "Username");
-define("USRLAN_62", "Password");
-define("USRLAN_63", "Re-type Password");
-define("USRLAN_64", "Email Address");
-define("USRLAN_65", "That user name cannot be accepted as valid, please choose a different user name");
-define("USRLAN_66", "That user name already exists in the database, please choose a different user name");
-define("USRLAN_67", "The two passwords do not match");
-define("USRLAN_68", "You left required field(s) blank");
-define("USRLAN_69", "That doesn't appear to be a valid email address");
-define("USRLAN_70", "User created");
-define("USRLAN_71", "Users Front Page");
-define("USRLAN_72", "Quick Add User");
-define("USRLAN_73", "Prune Users");
-define("USRLAN_74", "Extended User Fields");
-define("USRLAN_75", "Options");
-define("USRLAN_76", "User Options");
-define("USRLAN_77", "Existing Users");
-define("USRLAN_78", "User Name");
-define("USRLAN_79", "Status");
-define("USRLAN_80", "Info");
-define("USRLAN_81", "Edit");
-define("USRLAN_82", "Are you sure you want to delete this user?");
-define("USRLAN_83", "Extended field deleted");
-define("USRLAN_84", "There are");
-define("USRLAN_85", "users who haven't activated their account - click below to delete.");
-define("USRLAN_86", "User verified");
-define("USRLAN_87", "User settings updated");
-define("USRLAN_88", "User classes updated");
-define("USRLAN_89", "Go to page:");
-define("USRLAN_90", "Search Users");
-define("USRLAN_91", "Class");
-define("USRLAN_92", "Invalid characters in username");
-
-define("USRLAN_93", "Delete unverified users");
-define("USRLAN_94", "Delete signups if unverified after this amount of time - leave blank to not use this option");
-define("USRLAN_95", "minutes");
-
-define("USRLAN_96", "Name");
-define("USRLAN_97", "Type");
-define("USRLAN_98", "Values");
-define("USRLAN_99", "Default");
-define("USRLAN_100", "Applicable to");
-define("USRLAN_101", "Visible to");
-define("USRLAN_102", "Action");
-
-define("USRLAN_103", "Field Type");
-define("USRLAN_104", "Default Value");
-define("USRLAN_105", "Enter values seperated by commas eg. value1,value2 etc <br /> For DB table use the format: dbtable,field-value,field-name.");
-define("USRLAN_106", "This will determine who will see this field in their usersettings.");
-define("USRLAN_107", "This will determine who can see the value in the user page.");
-
-define("USRLAN_108", "Text Box");
-define("USRLAN_109", "Radio Buttons");
-define("USRLAN_110", "Drop-Down Menu");
-define("USRLAN_111", "DB Table Field");
-
-define("USRLAN_112", "Resend Email");
-define("USRLAN_113", "Registration details for");
-define("USRLAN_114", "Dear");
-define("USRLAN_115", "Thanks for your registration.");
-define("USRLAN_116", "Please confirm that you wish to resend a confirmation email to:");
-define("USRLAN_117", "Click the button below to test the following email:");
-define("USRLAN_118", "Test Email");
-
-define("USRLAN_119", "Update Extended Field");
-define("USRLAN_120", "Set Classes");
-define("USRLAN_121", "Mailing");
-define("USRLAN_122", "Welcome to");
-define("USRLAN_123", "Your registration has been received and created.");
-define("USRLAN_124", "Your account is currently marked as being inactive, to activate your account please go to the following link");
-define("USRLAN_125", "From");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_users.php,v $
+|     $Revision: 1.23 $
+|     $Date: 2006/05/12 22:50:40 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("USRLAN_1", "Options Saved.");
+define("USRLAN_3", "now listed an Administrator - to set permissions please go to the");
+define("USRLAN_4", "Administrator page");
+define("USRLAN_5", "You cannot remove admin status of main site admin");
+define("USRLAN_6", "has had Administrator status removed.");
+define("USRLAN_7", "You cannot ban the main site administrator");
+define("USRLAN_8", "User banned.");
+define("USRLAN_9", "User unbanned.");
+define("USRLAN_10", "User deleted.");
+define("USRLAN_11", "Delete cancelled.");
+define("USRLAN_12", "You cannot delete the main site administrator.");
+define("USRLAN_13", "Please confirm you wish to delete this member");
+// define("USRLAN_14", "once deleted the record cannot be retrieved");
+// define("USRLAN_15", "Cancel");
+define("USRLAN_16", "Confirm Delete");
+define("USRLAN_17", "Confirm Delete User");
+// define("USRLAN_18", "User activated.");
+// define("USRLAN_19", "Search");
+// define("USRLAN_20", "Order by");
+// define("USRLAN_21", "User ID");
+// define("USRLAN_22", "User name");
+// define("USRLAN_23", "Visits to site");
+// define("USRLAN_24", "Admin status");
+// define("USRLAN_25", "Status");
+// define("USRLAN_26", "Descending");
+// define("USRLAN_27", "Ascending");
+// define("USRLAN_28", "Sort");
+
+define("USRLAN_30", "Ban");
+// define("USRLAN_31", "Ban -unactivated-");
+define("USRLAN_32", "Activate");
+define("USRLAN_33", "Unban");
+define("USRLAN_34", "Remove admin status");
+define("USRLAN_35", "Make admin");
+define("USRLAN_36", "Set Class");
+
+// define("USRLAN_37", "Members");
+// define("USRLAN_38", "Search returned");
+// define("USRLAN_39", "result(s)");
+// define("USRLAN_40", "None defined");
+
+define("USRLAN_44", "Allow members to upload an avatar?");
+
+define("USRLAN_47", "Maximum avatar width (in pixels)");
+define("USRLAN_48", "default is 120");
+define("USRLAN_49", "Maximum avatar height (in pixels)");
+define("USRLAN_50", "default is 100");
+define("USRLAN_51", "Update Options");
+define("USRLAN_52", "Member Options");
+define("USRLAN_53", "Allow members to upload a photograph?");
+define("USRLAN_54", "Click here to delete all un-activated users");
+define("USRLAN_55", "Prune");
+define("USRLAN_56", "Deleted");
+define("USRLAN_57", "Deleting un-activated members ...");
+define("USRLAN_58", "file uploads are disabled in php.ini");
+define("USRLAN_59", "Quick add user");
+define("USRLAN_60", "Add user");
+define("USRLAN_61", "Display name");
+define("USRLAN_62", "Password");
+define("USRLAN_63", "Re-type Password");
+define("USRLAN_64", "Email Address");
+define("USRLAN_65", "That user name cannot be accepted as valid, please choose a different user name");
+define("USRLAN_66", "That user name already exists in the database, please choose a different user name");
+define("USRLAN_67", "The two passwords do not match");
+define("USRLAN_68", "You left required field(s) blank");
+define("USRLAN_69", "That doesn't appear to be a valid email address");
+define("USRLAN_70", "User created");
+define("USRLAN_71", "Users Front Page");
+define("USRLAN_72", "Quick Add User");
+define("USRLAN_73", "Prune Users");
+// define("USRLAN_75", "Options");
+define("USRLAN_76", "User Options");
+define("USRLAN_77", "Existing Users");
+define("USRLAN_78", "User Name");
+define("USRLAN_79", "Status");
+define("USRLAN_80", "Info");
+
+// define("USRLAN_82", "Are you sure you want to delete this user?");
+define("USRLAN_84", "There are");
+define("USRLAN_85", "users who haven't activated their account - click below to delete.");
+define("USRLAN_86", "User verified");
+define("USRLAN_87", "User settings updated");
+define("USRLAN_88", "User classes updated");
+
+define("USRLAN_90", "Search/Refresh");
+define("USRLAN_91", "Class");
+define("USRLAN_92", "Invalid characters in username");
+
+define("USRLAN_93", "Delete unverified users");
+define("USRLAN_94", "Delete signups if unverified after this amount of time - leave blank to not use this option <br />This option is ignored if user signups are admin moderated");
+define("USRLAN_95", "minutes");
+
+
+define("USRLAN_112", "Resend Email");
+define("USRLAN_113", "Registration details for");
+define("USRLAN_114", "Dear");
+define("USRLAN_115", "Thanks for your registration.");
+define("USRLAN_116", "Please confirm that you wish to resend a confirmation email to:");
+define("USRLAN_117", "Click the button below to test the following email:");
+define("USRLAN_118", "Test Email");
+
+define("USRLAN_120", "Set Classes");
+define("USRLAN_121", "Mailing");
+define("USRLAN_122", "Welcome to");
+define("USRLAN_123", "Your registration has been received and created.");
+define("USRLAN_124", "Your account is currently marked as being inactive, to activate your account please go to the following link");
+define("USRLAN_125", "From");
+
+define("USRLAN_126", "Allow users to rate users");
+define("USRLAN_127", "Allow comments in user profile");
+
+define("USRLAN_128", "Login name");
+
+define("USRLAN_130", "Enable online user tracking");
+define("USRLAN_131", "You must enable this option to use online user tracking options, like online.php, forum online info and online menus");
+define("USRLAN_132", "Enable");
+
+define("USRLAN_133", "Force user to update settings");
+define("USRLAN_134", "Enabling this option will automatically send the user to their user-settings if a required user field is not filled.");
+
+define("USRLAN_135", "No IP address found in user's info, IP not banned");
+define("USRLAN_136", "Multiple users found with IP address of {IP}, IP not banned.");
+define("USRLAN_137", "Users IP address of {IP} banned.");
+
+define("LAN_MAINADMIN","Main Admin");
+define("LAN_ADMIN","Admin");
+define("LAN_NOTVERIFIED","Not Verified");
+define("LAN_BANNED","Banned");
+
+define("DUSRLAN_1", "ID");
+define("DUSRLAN_2", "Display Name");
+define("DUSRLAN_3", "Username");
+define("DUSRLAN_4", "Custom Title");
+define("DUSRLAN_5", "Password");
+define("DUSRLAN_6", "Session");
+define("DUSRLAN_7", "Email");
+define("DUSRLAN_8", "Website");
+define("DUSRLAN_9", "ICQ");
+define("DUSRLAN_10", "AIM");
+define("DUSRLAN_11", "MSN");
+define("DUSRLAN_12", "Location");
+define("DUSRLAN_13", "Birthday");
+define("DUSRLAN_14", "Signature");
+define("DUSRLAN_15", "Image");
+define("DUSRLAN_16", "Timezone");
+define("DUSRLAN_17", "Hide Email");
+define("DUSRLAN_18", "Join Date");
+define("DUSRLAN_19", "Last Visit");
+define("DUSRLAN_20", "Current Visit");
+define("DUSRLAN_21", "Last Post");
+define("DUSRLAN_22", "Chatbox Posts");
+define("DUSRLAN_23", "Comments");
+define("DUSRLAN_24", "Forum Posts");
+define("DUSRLAN_25", "IP");
+define("DUSRLAN_26", "Ban");
+define("DUSRLAN_27", "Prefs");
+define("DUSRLAN_28", "New");
+define("DUSRLAN_29", "Viewed");
+define("DUSRLAN_30", "Visits");
+define("DUSRLAN_31", "Admin");
+define("DUSRLAN_32", "Real Name");
+define("DUSRLAN_33", "User Class");
+define("DUSRLAN_34", "Perms");
+define("DUSRLAN_35", "Picture");
+define("DUSRLAN_36", "Password Change");
+define("DUSRLAN_37", "XUP");
+
+define("USRLAN_138", "Unverified users");
+define("USRLAN_139", "Your account has been activated.\n\nYou can visit {SITEURL} and log into the site using the login information you provided.");
+
+define("USRLAN_140", "Email Re-sent to");
+define("USRLAN_141", "Failed to Re-send email to");
+define("USRLAN_142", "with the following activation link");
+
+define("LAN_BOUNCED","Bounced");
+define("USRLAN_143", "Check For Bounces");
+define("USRLAN_144", "Resend Confirmation Email to All");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/admin/lan_wmessage.php 75/e107_languages/English/admin/lan_wmessage.php
--- 6171/e107_languages/English/admin/lan_wmessage.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/admin/lan_wmessage.php	2006-04-22 14:30:47.000000000 -0500
@@ -1,10 +1,34 @@
-<?php
-
-define("WMGLAN_1", "Message for Guests");
-define("WMGLAN_2", "Message for Members");
-define("WMGLAN_3", "Message for Administrators");
-define("WMGLAN_4", "Submit");
-define("WMGLAN_5", "Set Welcome Message");
-define("WMGLAN_6", "Activate?");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/admin/lan_wmessage.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2006/04/22 19:30:47 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+// define("WMGLAN_1", "Message for Guests");
+// define("WMGLAN_2", "Message for Members");
+// define("WMGLAN_3", "Message for Administrators");
+// define("WMGLAN_4", "Submit");
+// define("WMGLAN_5", "Set Welcome Message");
+// define("WMGLAN_6", "Activate?");
+// define("WMGLAN_7", "Welcome message settings updated.");
+
+define("WMLAN_00","Welcome Messages");
+define("WMLAN_01","Create New Message");
+define("WMLAN_02","Message");
+define("WMLAN_03","Visibility");
+define("WMLAN_04","Message Text");
+
+define("WMLAN_05","Enclose");
+define("WMLAN_06","If ticked, the message will be rendered inside box");
+define("WMLAN_07","Override standard system to use {WMESSAGE} shortcode:");
+// define("WMLAN_08","Preferences");
+
+define("WMLAN_09","No welcome messages set yet");
+define("WMLAN_10","Message Caption");    
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/English.php 75/e107_languages/English/English.php
--- 6171/e107_languages/English/English.php	2004-09-13 04:46:12.000000000 -0500
+++ 75/e107_languages/English/English.php	2006-04-17 20:33:36.000000000 -0500
@@ -1,12 +1,26 @@
-<?php
-
-setlocale(LC_ALL, 'en');
-define("CORE_LC", 'en');
-define("CORE_LC2", 'gb');
-define("CHARSET", "iso-8859-1");
-define("CORE_LAN1","Error : theme is missing.\\n\\nChange the used themes in your preferences (admin area) or upload files of the current theme on the server.");
-
-//v.616
-define("CORE_LAN2"," \\1 wrote:");// "\\1" represents the username.
-define("CORE_LAN3","file attachment disabled");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/English.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2006/04/18 01:33:36 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+setlocale(LC_ALL, 'en');
+define("CORE_LC", 'en');
+define("CORE_LC2", 'gb');
+// define("TEXTDIRECTION","rtl");
+define("CHARSET", "utf-8");  // for a true multi-language site. :)
+define("CORE_LAN1","Error : theme is missing.\\n\\nChange the used themes in your preferences (admin area) or upload files of the current theme on the server.");
+
+//v.616
+define("CORE_LAN2"," \\1 wrote:");// "\\1" represents the username.
+define("CORE_LAN3","file attachment disabled");
+
+//v0.7+
+define("CORE_LAN4", "Please delete install.php from your server");
+define("CORE_LAN5", "if you do not there is a potential security risk to your website");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_banner.php 75/e107_languages/English/lan_banner.php
--- 6171/e107_languages/English/lan_banner.php	2004-03-25 03:58:38.000000000 -0600
+++ 75/e107_languages/English/lan_banner.php	2005-01-14 06:57:27.000000000 -0600
@@ -1,28 +1,38 @@
-<?php
-
-define("PAGE_NAME", "Banner"); 
-
-define("LAN_16", "Username: ");
-define("LAN_17", "Password: ");
-define("LAN_18", "Continue");
-define("LAN_19", "Please enter your client login and password to continue");
-define("LAN_20", "Sorry, unable to find those details in the database. Please contact the site administrator for details.");
-define("LAN_21", "Banners Statistics");
-define("LAN_22", "Client");
-define("LAN_23", "Banner ID");
-define("LAN_24", "Clickthroughs");
-define("LAN_25", "Click %");
-define("LAN_26", "Impressions");
-define("LAN_27", "Impressions Purchased");
-define("LAN_28", "Impressions Left");
-define("LAN_29", "No banners");
-define("LAN_30", "Unlimited");
-define("LAN_31", "Not applicable");
-define("LAN_32", "Yes");
-define("LAN_33", "No");
-define("LAN_34", "Ends");
-define("LAN_35", "Clickthrough IP addresses");
-define("LAN_36", "Active:");
-define("LAN_37", "Starts:");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_banner.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/14 12:57:27 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Banner");
+
+define("LAN_16", "Username: ");
+define("LAN_17", "Password: ");
+define("LAN_18", "Continue");
+define("LAN_19", "Please enter your client login and password to continue");
+define("LAN_20", "Sorry, unable to find those details in the database. Please contact the site administrator for details.");
+define("LAN_21", "Banners Statistics");
+define("LAN_22", "Client");
+define("LAN_23", "Banner ID");
+define("LAN_24", "Clickthroughs");
+define("LAN_25", "Click %");
+define("LAN_26", "Impressions");
+define("LAN_27", "Impressions Purchased");
+define("LAN_28", "Impressions Left");
+define("LAN_29", "No banners");
+define("LAN_30", "Unlimited");
+define("LAN_31", "Not applicable");
+define("LAN_32", "Yes");
+define("LAN_33", "No");
+define("LAN_34", "Ends:");
+define("LAN_35", "Clickthrough IP addresses");
+define("LAN_36", "Active:");
+define("LAN_37", "Starts:");
+define("LAN_38", "Error");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_chat.php 75/e107_languages/English/lan_chat.php
--- 6171/e107_languages/English/lan_chat.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/lan_chat.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,14 +0,0 @@
-<?php
-
-define("PAGE_NAME", "Chatbox"); 
-
-define("LAN_11", "Chatbox (all posts)");
-define("LAN_12", "Chat Posts");
-define("LAN_13", "on");
-
-define("LAN_14", "Error!");
-define("LAN_15", "You do not have the correct permissions to view this page.");
-
-define("LAN_16", "[ this post has been blocked by admin ]");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_comment.php 75/e107_languages/English/lan_comment.php
--- 6171/e107_languages/English/lan_comment.php	2004-09-06 02:52:00.000000000 -0500
+++ 75/e107_languages/English/lan_comment.php	2005-06-30 09:18:21.000000000 -0500
@@ -1,37 +1,59 @@
-<?php
-
-define("PAGE_NAME", "Comments");
-
-define("LAN_0", "[blocked by admin]");
-define("LAN_1", "Unblock");
-define("LAN_2", "Block");
-define("LAN_3", "Delete");
-define("LAN_4", "Info");
-define("LAN_5", "Comments ...");
-define("LAN_6", "You must be logged in to post comments on this site - please either log in or if you are not registered click");
-define("LAN_7", "Main site administrator");
-define("LAN_8", "Comment");
-define("LAN_9", "Submit comment");
-define("LAN_10", "Administrator");
-define("LAN_11", "Was unable to enter your comment into the database - please retype leaving out any non-standard characters.");
-define("LAN_16", "Username: ");
-define("LAN_99", "Comments");
-define("LAN_100", "News");
-define("LAN_101", "Poll");
-define("LAN_102", "Replying to: ");
-define("LAN_103", "Article");
-define("LAN_104", "Review");
-define("LAN_105", "Content");
-define("LAN_145", "Registered: ");
-define("LAN_194", "Guest");
-define("LAN_195", "Registered member");
-define("LAN_310", "Unable to accept post as that username is registered - if it is your username please login to post.");
-define("LAN_312", "Duplicate post - unable to accept.");
-define("LAN_313", "Location");
-define("LAN_314", "moderate comments");
-define("COMLAN_1", "here");
-define("COMLAN_2", "to signup");
-define("COMLAN_3", "Error!");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_comment.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/06/30 14:18:21 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+define("PAGE_NAME", "Comments");
+
+define("LAN_0", "[blocked by admin]");
+define("LAN_1", "Unblock");
+define("LAN_2", "Block");
+define("LAN_3", "Delete");
+define("LAN_4", "Info");
+define("LAN_5", "Comments ...");
+define("LAN_6", "You must be logged in to post comments on this site - please either log in or if you are not registered click");
+define("LAN_7", "Main site administrator");
+define("LAN_8", "Comment");
+define("LAN_9", "Submit comment");
+define("LAN_10", "Administrator");
+define("LAN_11", "Was unable to enter your comment into the database - please retype leaving out any non-standard characters.");
+define("LAN_16", "Username: ");
+define("LAN_99", "Comments");
+define("LAN_100", "News");
+define("LAN_101", "Poll");
+define("LAN_102", "Replying to: ");
+define("LAN_103", "Article");
+define("LAN_104", "Review");
+define("LAN_105", "Content");
+define("LAN_145", "Registered: ");
+define("LAN_194", "Guest");
+define("LAN_195", "Registered member");
+define("LAN_310", "Unable to accept post as that username is registered - if it is your username please login to post.");
+define("LAN_312", "Duplicate post - unable to accept.");
+define("LAN_313", "Location");
+define("LAN_314", "moderate comments");
+define("COMLAN_1", "here");
+define("COMLAN_2", "to signup");
+define("COMLAN_3", "Error!");
+define("COMLAN_4", 'Subject');
+define("COMLAN_5", 'Re:');
+define("COMLAN_6", 'Reply to this');
+define("COMLAN_7", 'Rating');
+define("COMLAN_8", 'Comments are locked');
+
+define("LAN_315", "Trackbacks");
+define("LAN_316", "No trackbacks for this newspost.");
+define("LAN_317", "Moderate trackbacks");
+
+define("LAN_318", "Edit comment");
+define("LAN_319", "edited");
+define("LAN_320", "Update comment");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_contact.php 75/e107_languages/English/lan_contact.php
--- 6171/e107_languages/English/lan_contact.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_contact.php	2006-04-25 13:01:18.000000000 -0500
@@ -0,0 +1,32 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_contact.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2006/04/25 18:01:18 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+define("LANCONTACT_01", "Contact Details");
+define("LANCONTACT_02", "Contact Form");
+define("LANCONTACT_03", "Enter your name:");
+define("LANCONTACT_04", "E-mail address:");
+define("LANCONTACT_05", "Message subject:");
+define("LANCONTACT_06", "Enter your message:");
+define("LANCONTACT_07", "Email a copy of this message to your own address ");
+define("LANCONTACT_08", "Send");
+define("LANCONTACT_09", "Your message was sent.");
+define("LANCONTACT_10", "There was a problem sending your message.");
+define("LANCONTACT_11", "Your email address doesn't appear to be valid.\\nPlease check it and try again.");
+define("LANCONTACT_12", "Your message is too short.");
+define("LANCONTACT_13", "Please include a subject."); 
+
+
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_content.php 75/e107_languages/English/lan_content.php
--- 6171/e107_languages/English/lan_content.php	2004-04-21 21:19:54.000000000 -0500
+++ 75/e107_languages/English/lan_content.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,57 +0,0 @@
-<?php
-
-define("PAGE_NAME", "Article/Review");
-
-define("LAN_1", "Article");
-define("LAN_2", "Review");
-define("LAN_3", "Category");
-
-
-define("LAN_25", "Previous Page");
-define("LAN_26", "Next Page");
-define("LAN_27", "List reviews in this category");
-define("LAN_28", "Back to reviews front page");
-define("LAN_29", "moderate comments");
-define("LAN_30", "Back to reviews front page");
-define("LAN_31", "No matches");
-define("LAN_32", "Recent Reviews");
-define("LAN_33", "reviews");
-define("LAN_34", "review");
-define("LAN_35", "Review Categories");
-define("LAN_36", "List articles in this category");
-define("LAN_37", "Back to articles front page");
-
-
-define("LAN_38", "vote");
-define("LAN_39", "votes");
-define("LAN_40", "How would you rate this article?");
-define("LAN_41", "thanks for submitting your rating");
-define("LAN_42", "Rating");
-define("LAN_43", "by ");
-define("LAN_44", " on ");
-define("LAN_45", "No articles in this category");
-define("LAN_46", "Archive");
-define("LAN_47", "Recent Articles");
-
-define("LAN_48", "articles");
-define("LAN_49", "article");
-define("LAN_50", "Article Categories");
-define("LAN_51", "This article cannot be viewed.");
-define("LAN_52", "Error");
-define("LAN_53", "This review cannot be viewed.");
-define("LAN_54", "This page cannot be viewed.");
-
-define("LAN_55", "No reviews yet.");
-define("LAN_56", "No articles yet.");
-define("LAN_57", "Articles");
-define("LAN_58", "Reviews");
-define("LAN_59", "View");
-define("LAN_60", "Content");
-
-define("LAN_61", "Uncategorized");
-define("LAN_62", "Archive");
-define("LAN_63", "page");
-define("LAN_64", "This article has been rated: ");
-define("LAN_65", "Not rated");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_date.php 75/e107_languages/English/lan_date.php
--- 6171/e107_languages/English/lan_date.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_date.php	2005-06-24 06:23:45.000000000 -0500
@@ -0,0 +1,35 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_date.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/06/24 11:23:45 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+define("LANDT_01", "year");
+define("LANDT_02", "month");
+define("LANDT_03", "week");
+define("LANDT_04", "day");
+define("LANDT_05", "hour");
+define("LANDT_06", "minute");
+define("LANDT_07", "second");
+define("LANDT_01s", "years");
+define("LANDT_02s", "months");
+define("LANDT_03s", "weeks");
+define("LANDT_04s", "days");
+define("LANDT_05s", "hours");
+define("LANDT_06s", "minutes");
+define("LANDT_07s", "seconds");
+
+define("LANDT_08", "min");
+define("LANDT_08s", "mins");
+define("LANDT_09", "sec");
+define("LANDT_09s", "secs");
+define("LANDT_AGO", "ago");
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_download.php 75/e107_languages/English/lan_download.php
--- 6171/e107_languages/English/lan_download.php	2004-03-23 16:18:08.000000000 -0600
+++ 75/e107_languages/English/lan_download.php	2006-01-15 20:37:30.000000000 -0600
@@ -1,53 +1,100 @@
-<?php
-
-define("PAGE_NAME", "Downloads"); 
-
-define("LAN_dl_1", "(Restricted)");
-define("LAN_dl_2", "No downloads yet, please check back soon");
-define("LAN_dl_3", "No downloads in this category yet");
-define("LAN_dl_4", "Files available: ");
-define("LAN_dl_5", "Total size of files: ");
-define("LAN_dl_6", "Files downloaded: ");
-define("LAN_dl_7", "Description");
-define("LAN_dl_8", "Get");
-define("LAN_dl_9", "Return to Category List");
-define("LAN_dl_10", "Filesize");
-define("LAN_dl_11", "Image");
-define("LAN_dl_12", "Rating");
-define("LAN_dl_13", "Not rated");
-define("LAN_dl_14", "Rate this download");
-define("LAN_dl_15", "Thanks for rating");
-define("LAN_dl_16", "download(s) from");
-define("LAN_dl_17", "files");
-define("LAN_dl_18", "Downloads");
-define("LAN_dl_19", "Category");
-define("LAN_dl_20", "Files");
-define("LAN_dl_21", "Size");
-define("LAN_dl_22", "Date");
-define("LAN_dl_23", "Filename");
-define("LAN_dl_24", "Author");
-define("LAN_dl_25", "Ascending");
-define("LAN_dl_26", "Descending");
-define("LAN_dl_27", "Go");
-define("LAN_dl_28", "Name");
-define("LAN_dl_29", "DL's");
-define("LAN_dl_30", "Author email");
-define("LAN_dl_31", "Author website");
-define("LAN_dl_32", "Download");
-define("LAN_dl_33", "Previous");
-define("LAN_dl_34", "Next");
-define("LAN_dl_35", "Back to list");
-define("LAN_dl_36", "New downloads");
-
-define("LAN_dl_37", "View");
-define("LAN_dl_38", "Order by");
-define("LAN_dl_39", "Sort");
-
-define("LAN_dl_40", "Click here for screenshot");
-define("LAN_dl_41", "Search Downloads");
-
-define("LAN_dl_42", "Sub-categories");
-define("LAN_dl_43", "vote");
-define("LAN_dl_44", "votes");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_download.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2006/01/16 02:37:30 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Downloads");
+
+define("LAN_dl_1", "(Restricted)");
+define("LAN_dl_2", "No downloads yet, please check back soon");
+define("LAN_dl_3", "No downloads in this category yet");
+define("LAN_dl_4", "Files available: ");
+define("LAN_dl_5", "Total size of files: ");
+define("LAN_dl_6", "Files downloaded: ");
+define("LAN_dl_7", "Description");
+define("LAN_dl_8", "Get");
+define("LAN_dl_9", "Return to Category List");
+define("LAN_dl_10", "Filesize");
+define("LAN_dl_11", "Image");
+define("LAN_dl_12", "Rating");
+define("LAN_dl_13", "Not rated");
+define("LAN_dl_14", "Rate this download");
+define("LAN_dl_15", "Thanks for rating");
+define("LAN_dl_16", "download(s) from");
+define("LAN_dl_17", "files");
+define("LAN_dl_18", "Downloads");
+define("LAN_dl_19", "Category");
+define("LAN_dl_20", "Files");
+define("LAN_dl_21", "Size");
+define("LAN_dl_22", "Date");
+define("LAN_dl_23", "Filename");
+define("LAN_dl_24", "Author");
+define("LAN_dl_25", "Ascending");
+define("LAN_dl_26", "Descending");
+define("LAN_dl_27", "Go");
+define("LAN_dl_28", "Name");
+define("LAN_dl_29", "DL's");
+define("LAN_dl_30", "Author email");
+define("LAN_dl_31", "Author website");
+define("LAN_dl_32", "Download");
+define("LAN_dl_33", "Previous");
+define("LAN_dl_34", "Next");
+define("LAN_dl_35", "Back to list");
+define("LAN_dl_36", "New downloads");
+
+define("LAN_dl_37", "View");
+define("LAN_dl_38", "Order by");
+define("LAN_dl_39", "Sort");
+
+define("LAN_dl_40", "Click here for screenshot");
+define("LAN_dl_41", "Search Downloads");
+
+define("LAN_dl_42", "Sub-category");
+define("LAN_dl_43", "vote");
+define("LAN_dl_44", "votes");
+define("LAN_dl_45", "Report broken download");
+define("LAN_dl_46", "click here to download");
+
+define("LAN_dl_47", "Post has been reported");
+define("LAN_dl_48", "Download has been reported to administrator.<br />Thank You.");
+define("LAN_dl_49", "Click here to return to download");
+define("LAN_dl_50", "Report broken download to an administrator");
+define("LAN_dl_51", "Reporting download: ");
+define("LAN_dl_52", "Guest");
+define("LAN_dl_53", "Click to view download");
+define("LAN_dl_54", "An administrator will be made aware of this download, please leave a message if you feel it necessary.");
+define("LAN_dl_55", "<b>Do not</b> use this form to contact the admin for any other reason.");
+define("LAN_dl_56", "Report broken download");
+define("LAN_dl_57", "reported by");
+define("LAN_dl_58", "The following download has been reported as broken from site");
+define("LAN_dl_59", "Reported by: ");
+define("LAN_dl_60", "Broken download report from");
+
+define("LAN_dl_61", "Download Error");
+define("LAN_dl_62", "You have been prevented from downloading this file, you have exceeded your download quota");
+define("LAN_dl_63", "You do not have the correct permissions to download this file.");
+define("LAN_dl_64", "Back");
+define("LAN_dl_65", "Not Found");
+
+define("LAN_dl_66", "Select download mirror");
+
+define("LAN_dl_67", "Please select mirror to use ...");
+define("LAN_dl_68", "Mirror Host");
+// define("LAN_dl_69", "Download"); // duplicate
+define("LAN_dl_70", "Location");
+define("LAN_dl_71", "About");
+
+define("LAN_dl_72", "Requesting file: ");
+define("LAN_dl_73", "Downloads from this mirror: ");
+define("LAN_dl_74", "Total downloads from this mirror: ");
+
+define("LAN_dl_75", "no image available ");
+define("LAN_dl_76", "Go to page");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_email.php 75/e107_languages/English/lan_email.php
--- 6171/e107_languages/English/lan_email.php	2004-03-23 03:41:06.000000000 -0600
+++ 75/e107_languages/English/lan_email.php	2006-02-17 17:49:04.000000000 -0600
@@ -1,25 +1,39 @@
-<?php
-
-define("PAGE_NAME", "Email"); 
-
-define("LAN_5", "Email article to a friend");
-define("LAN_6", "Email news_item to a friend");
-define("LAN_7", "Login Name: ");
-define("LAN_8", "Comment");
-define("LAN_9", "Sorry - unable to send email");
-define("LAN_10", "Mail sent to");
-define("LAN_11", "Email sent");
-define("LAN_12", "Error");
-define("LAN_106", "That doesn't appear to be a valid email address");
-define("LAN_185", "Send Article");
-define("LAN_186", "Send News Item");
-define("LAN_187", "Email address to send to");
-define("LAN_188", "I thought you might be interested in this news story from");
-define("LAN_189", "I thought you might be interested in this article from");
-
-define("LAN_email_1", "From:");
-define("LAN_email_2", "IP address of sender:");
-define("LAN_email_3", "News item from ");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_email.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/02/17 23:49:04 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Email");
+
+define("LAN_5", "Email article to a friend");
+define("LAN_6", "Email news_item to a friend");
+define("LAN_7", "Login Name: ");
+define("LAN_8", "Comment");
+define("LAN_9", "Sorry - unable to send email");
+define("LAN_10", "Mail sent to");
+define("LAN_11", "Email sent");
+define("LAN_12", "Error");
+define("LAN_106", "That doesn't appear to be a valid email address");
+define("LAN_185", "Send Article");
+define("LAN_186", "Send News Item");
+define("LAN_187", "Email address to send to");
+define("LAN_188", "I thought you might be interested in this news story from");
+define("LAN_189", "I thought you might be interested in this article from");
+
+define("LAN_email_1", "From:");
+define("LAN_email_2", "IP address of sender:");
+define("LAN_email_3", "Emailed item from ");
+define("LAN_email_4", "Send Email");
+define("LAN_email_5", "Email item to a friend");
+define("LAN_email_6", "I thought you might be interested in this item from");
+define("LAN_email_7", "email to someone");
+
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_equery_secure.php 75/e107_languages/English/lan_equery_secure.php
--- 6171/e107_languages/English/lan_equery_secure.php	2004-07-13 09:22:22.000000000 -0500
+++ 75/e107_languages/English/lan_equery_secure.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,10 +1,19 @@
-<?php
-
-define("EQSEC_LAN1", "You are being redirected to an admin function, possible database modifications could occur");
-define("EQSEC_LAN2", "Please confirm this action:");
-define("EQSEC_LAN3", "No referer");
-define("EQSEC_LAN4", "Action from:");
-define("EQSEC_LAN5", "Action to:");
-define("EQSEC_LAN6", "Confirm action");
-define("EQSEC_LAN7", "Or cancel");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_equery_secure.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("EQSEC_LAN1", "You are being redirected to an admin function, possible database modifications could occur");
+define("EQSEC_LAN2", "Please confirm this action:");
+define("EQSEC_LAN3", "No referer");
+define("EQSEC_LAN4", "Action from:");
+define("EQSEC_LAN5", "Action to:");
+define("EQSEC_LAN6", "Confirm action");
+define("EQSEC_LAN7", "Or cancel");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_error.php 75/e107_languages/English/lan_error.php
--- 6171/e107_languages/English/lan_error.php	2004-09-09 21:58:00.000000000 -0500
+++ 75/e107_languages/English/lan_error.php	2005-06-28 07:10:30.000000000 -0500
@@ -1,32 +1,39 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_error.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/10 02:58:00 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Error");
-
-define("LAN_1", "Error 401 - Permission Denied");
-define("LAN_2", "You do not have permission to retrieve the URL or link you requested.");
-define("LAN_3", "Please inform the administrator of the referring page if you think this error page has been shown by mistake.");
-define("LAN_4", "Error 403 - Authentication Failed");
-define("LAN_5", "The URL you've requested requires a correct username and password. Either you entered an incorrect username/password, or your browser doesn't support this feature.");
-define("LAN_6", "Please inform the administrator of the referring page if you think this error page has been shown by mistake.");
-define("LAN_7", "Error 404 - Document Not Found");
-define("LAN_8", "The requested URL could not be found on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to allow access to it.");
-define("LAN_9", "Please inform the administrator of the referring page if you think this error page has been shown by mistake.");
-define("LAN_10", "Error 500 - Malformed Header");
-define("LAN_11", "The server encountered an internal error or misconfiguration and was unable to complete your request");
-define("LAN_12", "Please inform the administrator of the referring page if you think this error page has been shown by mistake.");
-define("LAN_13", "Error - Unknown");
-define("LAN_14", "The server encountered an error");
-define("LAN_15", "Please inform the administrator of the referring page if you think this error page has been shown by mistake.");
-
-define("LAN_20", "Please click here to return to the front page");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_error.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/06/28 12:10:30 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Error");
+
+define("LAN_1", "Error 401 - Permission Denied");
+define("LAN_2", "You do not have permission to retrieve the URL or link you requested.");
+define("LAN_3", "Please inform the administrator of the referring page if you think this error page has been shown by mistake.");
+define("LAN_4", "Error 403 - Authentication Failed");
+define("LAN_5", "The URL you've requested requires a correct username and password. Either you entered an incorrect username/password, or your browser doesn't support this feature.");
+define("LAN_6", "Please inform the administrator of the referring page if you think this error page has been shown by mistake.");
+define("LAN_7", "Error 404 - Document Not Found");
+define("LAN_9", "Please inform the administrator of the referring page if you think this error message has been shown by mistake.");
+define("LAN_10", "Error 500 - Malformed Header");
+define("LAN_11", "The server encountered an internal error or misconfiguration and was unable to complete your request");
+define("LAN_12", "Please inform the administrator of the referring page if you think this error page has been shown by mistake.");
+define("LAN_13", "Error - Unknown");
+define("LAN_14", "The server encountered an error");
+define("LAN_15", "Please inform the administrator of the referring page if you think this error page has been shown by mistake.");
+define("LAN_16", "Your unsuccessful attempt to access");
+define("LAN_17", "has been recorded.");
+define("LAN_18", "Apparently, you were referred here by");
+define("LAN_19", "Unfortunately, there's an obsolete link at that address.");
+define("LAN_20", "Please click here to go to this site's home page");
+
+define("LAN_ERROR_01", "The requested URL could not be found on this server. The link you followed is probably outdated.");
+define("LAN_ERROR_02", "Please click here to go to this site's search page");
+define("LAN_ERROR_03", "Your attempt to access ");
+define("LAN_ERROR_04", " was unsuccessful.");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_forum.php 75/e107_languages/English/lan_forum.php
--- 6171/e107_languages/English/lan_forum.php	2004-09-06 04:55:18.000000000 -0500
+++ 75/e107_languages/English/lan_forum.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,107 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_forum.php,v $
-|     $Revision: 1.7 $
-|     $Date: 2004/09/06 09:55:17 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Forum");
-
-define("LAN_30", "Welcome");
-define("LAN_31", "There are no new posts ");
-define("LAN_32", "There is 1 new post ");
-define("LAN_33", "There are");
-define("LAN_34", "new posts");
-define("LAN_35", "since your last visit.");
-define("LAN_36", "You last visited at ");
-define("LAN_37", "It is now ");
-define("LAN_38", ", all times are ");
-define("LAN_41", "Newest member: ");
-define("LAN_42", "Registered members: ");
-define("LAN_44", "These forums can be used by non-registered users, but please be aware that your IP Address will be logged if you make a post.<br />To access the full features of this forum  you will need to");
-define("LAN_45", "These forums can only be posted to by registered and logged in members, please click");
-define("LAN_46", "Forum");
-define("LAN_47", "Threads");
-define("LAN_48", "Replies");
-define("LAN_49", "Last Post");
-define("LAN_51", "No forums yet, please check back soon.");
-define("LAN_52", "No forums in this section yet, please check back soon.");
-define("LAN_79", "New posts");
-define("LAN_80", " No new posts");
-define("LAN_81", "Closed thread");
-define("LAN_100", "articles");
-define("LAN_180", "Search");
-define("LAN_191", "Information");
-define("LAN_192", "The users of this forum have made a total of ");
-define("LAN_196", "You have read ");
-define("LAN_197", " of these posts.");
-define("LAN_198", " All new posts have been read.");
-define("LAN_199", "Mark all posts as read");
-define("LAN_204", "You <b>can</b> start new threads");
-define("LAN_205", "You <b>cannot</b> start new threads");
-define("LAN_206", "You <b>can</b> post replies");
-define("LAN_207", "You <b>cannot</b> post replies");
-define("LAN_208", "You <b>can</b> edit your posts");
-define("LAN_209", "You <b>cannot</b> edit your posts");
-define("LAN_392", "stop tracking this thread");
-define("LAN_393", "List tracked threads");
-define("LAN_394", "Closed forum");
-define("LAN_397", "Tracked threads");
-define("LAN_398", "Closed");
-define("LAN_399", "Restricted");
-define("LAN_400", "This forum can only be browsed by registered members");
-define("LAN_401", "Members only");
-
-define("LAN_402", "This forum is read only");
-
-define("LAN_403", "No posts yet");
-define("LAN_404", "posts");
-define("LAN_405", "Read Only");
-
-define("LAN_406", "This forum is restricted to administrators only");
-define("LAN_407", "This forum is restricted to members only");
-define("LAN_408", "This is a read-only forum");
-define("LAN_409", "This is a class restricted forum");
-define("LAN_410", "Welcome guest");
-
-define("LAN_411", "thread");
-define("LAN_412", "reply");
-define("LAN_413", "threads");
-define("LAN_414", "replies");
-define("LAN_415", "user is browsing the forums at the moment");
-define("LAN_416", "users are browsing the forums at the moment");
-
-define("LAN_417", "member");
-define("LAN_418", "guest");
-define("LAN_419", "members");
-define("LAN_420", "guests");
-
-define("LAN_421", "Show new posts");
-define("LAN_422", "New posts since your last visit");
-define("LAN_423", "Posted by");
-define("LAN_424", "New threads");
-define("LAN_425", "Re:");
-
-//v.616
-define("LAN_426", "Who's Online: ");
-define("LAN_427", "View detailed list.");
-define("LAN_428", "Re:");
-define("LAN_429", "Top Posters");
-define("LAN_430", "Most Active Threads");
-define("LAN_431", "My Posts");
-define("LAN_432", "My Settings");
-define("LAN_433", "Forum Rules");
-define("LAN_434", "Return to forums");
-define("LAN_435", "My Profile");
-define("LAN_436", " (Will open a new window.)");
-
-define("LAN_437", "register");
-define("LAN_438", "and login.");
-define("LAN_439", "here");
-define("LAN_440", "to go to the registration page.");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_forum_post.php 75/e107_languages/English/lan_forum_post.php
--- 6171/e107_languages/English/lan_forum_post.php	2004-09-06 04:55:18.000000000 -0500
+++ 75/e107_languages/English/lan_forum_post.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,101 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_forum_post.php,v $
-|     $Revision: 1.7 $
-|     $Date: 2004/09/06 09:55:18 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Forum");
-
-define("LAN_01", "Forums");
-define("LAN_02", "Replying to: ");
-define("LAN_03", "New Thread");
-define("LAN_1", "Normal");
-define("LAN_2", "Sticky");
-define("LAN_3", "Announcement");
-define("LAN_4", "Post Poll");
-define("LAN_5", "Poll Question:");
-define("LAN_6", "Add another option");
-define("LAN_7", "Vote option:");
-define("LAN_8", "Allow votes from all");
-define("LAN_9", "Allow votes from members only");
-define("LAN_10", "Login");
-define("LAN_11", "Remember me");
-define("LAN_16", "Username: ");
-define("LAN_17", "Password: ");
-define("LAN_20", "Error");
-define("LAN_27", "You left required field(s) blank");
-define("LAN_28", "You didn't post anything ..");
-define("LAN_29", "Edited");
-define("LAN_45", "These forums can only be posted to by registered and logged in members, please click");
-define("LAN_60", "Start New Thread");
-define("LAN_61", "Your Name: ");
-define("LAN_62", "Subject: ");
-define("LAN_63", "Post: ");
-define("LAN_64", "Submit new thread");
-define("LAN_73", "Reply: ");
-define("LAN_74", "Reply to  thread");
-define("LAN_77", "Update Thread");
-define("LAN_78", "Update Reply");
-define("LAN_94", "Posted by");
-define("LAN_95", "Unauthorised");
-define("LAN_96", "You are not authorised to edit this forum post.");
-define("LAN_100", "Thread Topic");
-define("LAN_101", "Latest ");
-define("LAN_102", " replies");
-define("LAN_103", "Review complete thread. (Will open a new window.)");
-define("LAN_133", "Thankyou");
-define("LAN_174", "Signup");
-define("LAN_175", "Login");
-define("LAN_212", "Forgot password?");
-define("LAN_310", "Unable to accept post as that username is registered - if it is your username please login to post.");
-define("LAN_311", "Anonymous");
-define("LAN_322", "Posted: ");
-define("LAN_323", "Preview");
-define("LAN_324", "Your message has been successfully posted.");
-define("LAN_325", "Click Here to view your message");
-define("LAN_326", "Click here to return to the forum");
-define("LAN_327", "Review");
-define("LAN_380", "If you wish to be notified by email when a reply is posted to your thread please tick the box ");
-define("LAN_381", "Forum reply from ");
-define("LAN_382", "Post made: ");
-define("LAN_383", "Please click the following link to view the full thread ...");
-define("LAN_384", "Forum reply at ");
-define("LAN_385", "Post: ");
-define("LAN_386", "If you do not wish to add a poll to your thread leave the fields blank ");
-define("LAN_387", "Go");
-define("LAN_388", "Back to top");
-define("LAN_389", "Duplicate post, redirecting ...");
-define("LAN_390", "Attach file / image");
-define("LAN_391", "Option");
-define("LAN_392", "File to attach");
-define("LAN_393", "<b>Please note</b><br />Allowed filetypes:");
-define("LAN_394", "Any other filetypes uploaded will be instantly deleted.");
-define("LAN_395", "Maximum file size");
-define("LAN_396", "bytes");
-define("LAN_397", "This thread is locked.");
-define("LAN_398", "This forum is read only");
-define("LAN_399", "You are not authorized to post to this forum.");
-define("LAN_400", "post thread as");
-define("LAN_401", "Jump");
-
-define("LAN_402", "poll");
-define("LAN_403", "announcement");
-define("LAN_404", "sticky");
-define("LAN_405", "Forums");
-define("LAN_406", "Re:");
-
-//v.616
-define("LAN_407", "Redirect");
-define("LAN_408", "If your browser does not support meta redirection please click");
-define("LAN_409", "HERE");
-define("LAN_410", "to be redirected");
-define("LAN_411", "here");
-define("LAN_412", "to go to the registration page.");
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_forum_viewforum.php 75/e107_languages/English/lan_forum_viewforum.php
--- 6171/e107_languages/English/lan_forum_viewforum.php	2004-09-08 07:02:28.000000000 -0500
+++ 75/e107_languages/English/lan_forum_viewforum.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,84 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_forum_viewforum.php,v $
-|     $Revision: 1.8 $
-|     $Date: 2004/09/08 12:02:28 $
-|     $Author: mcfly_e107 $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Forum");
-
-define("LAN_01", "Forums");
-define("LAN_02", "Back to top");
-define("LAN_03", "Go");
-define("LAN_53", "Thread");
-define("LAN_54", "Starter");
-define("LAN_55", "Replies");
-define("LAN_56", "Views");
-define("LAN_57", "Lastpost");
-define("LAN_58", "There are no topics in this forum yet.");
-define("LAN_59", "You must be a registered member and logged in to post on this forum. Click on signup or login from the login menu.");
-define("LAN_79", "New posts");
-define("LAN_80", " No new posts");
-define("LAN_81", "Closed thread");
-define("LAN_180", "Search");
-define("LAN_202", "Sticky");
-define("LAN_203", "Sticky/Closed");
-define("LAN_204", "You <b>can</b> start new threads");
-define("LAN_205", "You <b>cannot</b> start new threads");
-define("LAN_206", "You <b>can</b> post replies");
-define("LAN_207", "You <b>cannot</b> post replies");
-define("LAN_208", "You <b>can</b> edit your posts");
-define("LAN_209", "You <b>cannot</b> edit your posts");
-define("LAN_316", "Goto page");
-define("LAN_317", "None");
-define("LAN_321", "Moderators: ");
-define("LAN_395", "[popular]");
-define("LAN_396", "Announcement");
-
-define("LAN_397", "This forum is read only");
-
-define("LAN_398", "Unstick thread");
-define("LAN_399", "Lock thread");
-define("LAN_400", "Unlock thread");
-define("LAN_401", "Stick thread");
-define("LAN_402", "Move thread");
-define("LAN_403", "Jump to forum");
-define("LAN_404", "This forum is moderated by");
-
-define("LAN_405", "user is browsing this forum at the moment");
-define("LAN_406", "users are browsing this forum at the moment");
-define("LAN_407", "member");
-define("LAN_408", "guest");
-define("LAN_409", "members");
-define("LAN_410", "guests");
-
-//v.616
-define("LAN_411", "Important Threads");
-define("LAN_412", "Forum Threads");
-
-//v.617
-define("FORLAN_CLOSE", "Thread closed.");
-define("FORLAN_OPEN", "Thread reopened.");
-define("FORLAN_STICK", "Thread made sticky.");
-define("FORLAN_UNSTICK", "Thread unstuck.");
-define("FORLAN_6", "Thread deleted");
-define("FORLAN_7", "replies deleted");
-define("FORLAN_8", "here");
-define("FORLAN_9", "to sign up or login from the login menu.");
-
-define("FORLAN_10","Begin New Thread");
-define("FORLAN_11","New Posts");
-define("FORLAN_12","No New Posts");
-define("FORLAN_13","New Posts on Popular Thread");
-define("FORLAN_14","No New Posts on Popular Thread");
-define("FORLAN_15","Sticky Thread");
-define("FORLAN_16","Closed Sticky Thread");
-define("FORLAN_17","Announcement Thread");
-define("FORLAN_18","Closed Thread");
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_forum_viewtopic.php 75/e107_languages/English/lan_forum_viewtopic.php
--- 6171/e107_languages/English/lan_forum_viewtopic.php	2004-08-08 10:13:26.000000000 -0500
+++ 75/e107_languages/English/lan_forum_viewtopic.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,72 +0,0 @@
-<?php
-
-define("PAGE_NAME", "Forum"); 
-
-define("LAN_01", "Forums");
-define("LAN_02", "Go to page");
-define("LAN_03", "Go");
-define("LAN_04", "Previous");
-define("LAN_05", "Next");
-define("LAN_06", "Joined");
-define("LAN_07", "Location");
-define("LAN_08", "Website");
-define("LAN_09", "Visits to site since registration");
-define("LAN_10", "Back to top");
-define("LAN_65", "Jump");
-define("LAN_66", "This thread is now closed");
-define("LAN_67", "posts");
-define("LAN_194", "Guest");
-define("LAN_195", "Registered Member");
-define("LAN_321", "Moderators: ");
-define("LAN_389", "Previous thread");
-define("LAN_390", "Next thread");
-define("LAN_391", "track this thread");
-define("LAN_392", "stop tracking this thread");
-define("LAN_393", "Quick Reply");
-define("LAN_394", "Preview");
-define("LAN_395", "Reply To Thread");
-define("LAN_396", "Website");
-define("LAN_397", "Email");
-define("LAN_398", "Profile");
-define("LAN_399", "Private Message");
-define("LAN_400", "Edit");
-define("LAN_401", "Quote");
-
-define("LAN_402", "Author");
-define("LAN_403", "Post");
-define("LAN_404", "No previous thread");
-define("LAN_405", "No next thread");
-
-define("LAN_406", "Moderator: Edit");
-define("LAN_407", "Moderator: Delete");
-define("LAN_408", "Moderator: Move");
-define("LAN_409", "Are you sure you want to delete this thread and any replies?");
-define("LAN_410", "Are you sure you want to delete this reply?");
-define("LAN_411", "posted by ");
-
-//v.616
-define("LAN_412", "Title");
-define("LAN_413", "Report");
-define("LAN_414", "Report this thread to a moderator");
-define("LAN_415", "Thread title");
-define("LAN_416", "Enter your report");
-define("LAN_417", "The admin will be made aware of this thread. You may post a message explaining what you found to be objectionable.");
-define("LAN_418", "<b>Do not</b> use this form to contact the admin for any other reason.");
-define("LAN_419", "Send Report");
-define("LAN_420", "Click to view post");
-define("LAN_421", "Forum thread report from");
-define("LAN_422", "This post has been reported from site ");
-define("LAN_423", "Message could not be sent. ");
-define("LAN_424", "Post has been reported to moderator.<br />Thank You.");
-define("LAN_425", "Message from: ");
-define("LAN_426", "Reporting post in topic: ");
-define("LAN_427", "Error sending mail");
-define("LAN_428", "Post has been reported");
-define("LAN_429", "Click here to return to forum");
-
-
-define("LAN_430", "poll");
-
-define("FORLAN_26", "Reply deleted");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_fpw.php 75/e107_languages/English/lan_fpw.php
--- 6171/e107_languages/English/lan_fpw.php	2004-09-09 04:31:42.000000000 -0500
+++ 75/e107_languages/English/lan_fpw.php	2006-03-26 23:01:53.000000000 -0600
@@ -1,50 +1,48 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_fpw.php,v $
-|     $Revision: 1.5 $
-|     $Date: 2004/09/09 09:31:42 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Password Reset");
-
-define("LAN_02", "Sorry, unable to send email - please contact the main site administrator.");
-define("LAN_03", "Password Reset");
-define("LAN_05", "To reset your password please enter the following information");
-define("LAN_06", "Attempted password reset");
-define("LAN_07", "Someone with ip address ");
-define("LAN_08", "attempted to reset the main admin password.");
-define("LAN_09", "Password reset from ");
-define("LAN_112", "Email Address used when signing up ");
-define("LAN_156", "Submit");
-define("LAN_213", "That username/email address was not found in database.");
-define("LAN_214", "Unable to reset password");
-define("LAN_216", "To validate your new password please go to the following URL ...");
-define("LAN_217", "Your new password is now validated, you may now login using your new password.");
-define("LAN_218", "Your username is:");
-define("LAN_219", "The password associated with that email address has already been reset and cannot be reset again. Please contact the site administrator for more details.");
-define("LAN_FPW1","User Name");
-define("LAN_FPW2","Enter code");
-define("LAN_FPW3","Incorrect code entered");
-define("LAN_FPW4","A request has already been sent to reset this password, if you did not receive the email, please contact the site administrator for help.");
-define("LAN_FPW5","A request to reset your password for");
-define("LAN_FPW6","An email has been sent to you with a link that will allow you to reset your password.");
-define("LAN_FPW7","This is not a valid link to reset your password.<br />Please contact the site administrator for more details.");
-define("LAN_FPW8","The password for username");
-define("LAN_FPW9","has been successfully changed.<br /><br />The new password is:");
-define("LAN_FPW10","Please");
-define("LAN_FPW11","log in now");
-define("LAN_FPW12","and immediately change your password, for security purposes.");
-
-define("LAN_FPW13", "please follow the instructions in the email to validate your password.");
-define("LAN_FPW14", "has been submitted by someone with the IP of");
-define("LAN_FPW15", "This does not mean your password has yet been reset.  You must navigate to the link shown below to complete the reset process.");
-define("LAN_FPW16", "If it was not you the requested the password be reset and you do NOT want it reset, you can simply ignore this email");
-define("LAN_FPW17", "The link below will be valid for 48 hours.");
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_fpw.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2006/03/27 05:01:53 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Password Reset");
+
+define("LAN_02", "Sorry, unable to send email - please contact the main site administrator.");
+define("LAN_03", "Password Reset");
+define("LAN_05", "To reset your password please enter the following information");
+define("LAN_06", "Attempted password reset");
+define("LAN_07", "Someone with ip address ");
+define("LAN_08", "attempted to reset the main admin password.");
+define("LAN_09", "Password reset from ");
+define("LAN_112", "Email address used when signing up");
+define("LAN_156", "Submit");
+define("LAN_213", "That username/email address was not found in database.");
+define("LAN_214", "Unable to reset password");
+define("LAN_216", "To validate your new password please go to the following URL ...");
+define("LAN_217", "Your new password is now validated, you may now login using your new password.");
+define("LAN_218", "Your username is:");
+define("LAN_219", "The password associated with that email address has already been reset and cannot be reset again. Please contact the site administrator for more details.");
+define("LAN_FPW1","Username");
+define("LAN_FPW2","Enter code");
+define("LAN_FPW3","Incorrect code entered");
+define("LAN_FPW4","A request has already been sent to reset this password, if you did not receive the email, please contact the site administrator for help.");
+define("LAN_FPW5","A request to reset your password for");
+define("LAN_FPW6","An email has been sent to you with a link that will allow you to reset your password.");
+define("LAN_FPW7","This is not a valid link to reset your password.<br />Please contact the site administrator for more details.");
+define("LAN_FPW8","The password for username");
+define("LAN_FPW9","has been successfully changed.<br /><br />The new password is:");
+define("LAN_FPW10","Please");
+define("LAN_FPW11","log in now");
+define("LAN_FPW12","and immediately change your password, for security purposes.");
+
+define("LAN_FPW13", "please follow the instructions in the email to validate your password.");
+define("LAN_FPW14", "has been submitted by someone with the IP of");
+define("LAN_FPW15", "This does not mean your password has yet been reset.  You must navigate to the link shown below to complete the reset process.");
+define("LAN_FPW16", "If you did not request to have your password reset and you do NOT want it reset, you may simply ignore this email");
+define("LAN_FPW17", "The link below will be valid for 48 hours.");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_installer.php 75/e107_languages/English/lan_installer.php
--- 6171/e107_languages/English/lan_installer.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_installer.php	2006-02-09 09:05:51.000000000 -0600
@@ -0,0 +1,124 @@
+<?php
+
+define("LANINS_001", "e107 Installation");
+
+
+define("LANINS_002", "Stage ");
+define("LANINS_003", "1");
+define("LANINS_004", "Language Selection");
+define("LANINS_005", "Please choose language to use during installation procedure");
+define("LANINS_006", "Set Language");
+define("LANINS_007", "4");
+define("LANINS_008", "PHP &amp; MySQL Versions Check / File Permissions Check");
+define("LANINS_009", "Retest File Permissions");
+define("LANINS_010", "File not writable: ");
+define("LANINS_010a", "Folder not writable: ");
+define("LANINS_011", "Error");
+define("LANINS_012", "MySQL Functions don't seem to exist. This probably means that either the MySQL PHP Extension isn't installed or your PHP installation wasn't compiled with MySQL support."); // help for 012
+define("LANINS_013", "Couldn't determine your MySQL version number. This is a non fatal error, so please continue installing, but be aware that e107 requires MySQL >= 3.23 to function correctly.");
+define("LANINS_014", "File Permissions");
+define("LANINS_015", "PHP Version");
+define("LANINS_016", "MySQL");
+define("LANINS_017", "PASS");
+define("LANINS_018", "Ensure all the listed files exist and are writable by the server. This normally involves CHMODing them 777, but environments vary - contact your host if you have any problems.");
+define("LANINS_019", "The version of PHP installed on your server isn't capable of running e107. e107 requires a PHP version of at least 4.3.0 to run correctly. Either upgrade your PHP version, or contact your host for an upgrade.");
+define("LANINS_020", "Continue Installation");
+define("LANINS_021", "2");
+define("LANINS_022", "MySQL Server Details");
+define("LANINS_023", "Please enter your MySQL settings here.
+
+If you have root permissions you can create a new database by ticking the box, if not you must create a database or use a pre-existing one.
+
+If you have only one database use a prefix so that other scripts can share the same database.
+If you do not know your MySQL details contact your web host.");
+define("LANINS_024", "MySQL Server:");
+define("LANINS_025", "MySQL Username:");
+define("LANINS_026", "MySQL Password:");
+define("LANINS_027", "MySQL Database:");
+define("LANINS_028", "Create Database?");
+define("LANINS_029", "Table prefix:");
+define("LANINS_030", "The MySQL server you would like e107 to use. It can also include a port number. e.g. \"hostname:port\" or a path to a local socket e.g. \":/path/to/socket\" for the localhost.");
+define("LANINS_031", "The username you wish e107 to use for connecting to your MySQL server");
+define("LANINS_032", "The Password for the user you just entered");
+define("LANINS_033", "The MySQL database you wish e107 to reside in, sometimes referred to as a schema. If the user has database create permissions you can opt to create the database automatically if it doesn't already exist.");
+define("LANINS_034", "The prefix you wish e107 to use when creating the e107 tables. Useful for multiple installs of e107 in one database schema.");
+define("LANINS_035", "Continue");
+define("LANINS_036", "3");
+define("LANINS_037", "MySQL Connection Verification");
+define("LANINS_038", " and Database Creation");
+define("LANINS_039", "Please make sure you fill in all fields, most importantly, MySQL Server, MySQL Username and MySQL Database (These are always required by the MySQL Server)");
+define("LANINS_040", "Errors");
+define("LANINS_041", "e107 was unable to establish a connection to the MySQL server using the information you entered. Please return to the last page and ensure the information is correct.");
+define("LANINS_042", "Connection to the MySQL server established and verified.");
+define("LANINS_043", "Unable to create database, please ensure you have the correct permissions to create databases on your server.");
+define("LANINS_044", "Successfully created database.");
+define("LANINS_045", "Please click on the button to proceed to next stage.");
+define("LANINS_046", "5");
+define("LANINS_047", "Administrator Details");
+define("LANINS_048", "Go Back To Last Step");
+define("LANINS_049", "The two passwords you entered are not the same. Please go back and try again.");
+define("LANINS_050", "XML Extension");
+define("LANINS_051", "Installed");
+define("LANINS_052", "Not Installed");
+define("LANINS_053", "e107 .700 requires the PHP XML Extension to be installed. Please contact your host or read the information at ");
+define("LANINS_054", " before continuing");
+define("LANINS_055", "Install Confirmation");
+define("LANINS_056", "6");
+define("LANINS_057", " e107 now has all the information it needs to complete the installation.
+
+Please click the button to create the database tables and save all your settings.
+
+");
+define("LANINS_058", "7");
+define("LANINS_060", "Unable to read the sql datafile
+
+Please ensure the file <b>core_sql.php</b> exists in the <b>/e107_admin/sql</b> directory.");
+define("LANINS_061", "e107 was unable to create all of the required database tables.
+Please clear the database and rectify any problems before trying again.");
+
+define("LANINS_062", "[b]Welcome to your new website![/b]
+e107 has installed successfully and is now ready to accept content.<br />Your administration section is [link=e107_admin/admin.php]located here[/link], click to go there now. You will have to login using the name and password you entered during the installation process.
+
+[b]Support[/b]
+e107 Homepage: [link=http://e107.org]http://e107.org[/link], you will find the FAQ and documentation here.
+Forums: [link=http://e107.org/e107_plugins/forum/forum.php]http://e107.org/e107_plugins/forum/forum.php[/link]
+
+[b]Downloads[/b]
+Plugins: [link=http://e107coders.org]http://e107coders.org[/link]
+Themes: [link=http://e107styles.org]http://e107styles.org[/link] | [link=http://e107themes.org]http://e107themes.org[/link]
+
+Thankyou for trying e107, we hope it fulfills your website needs.
+(You can delete this message from your admin section.)");
+
+define("LANINS_063", "Welcome to e107");
+
+define("LANINS_069", "e107 has been successfully installed!
+
+For security reasons you should now set the file permissions on the <b>e107_config.php</b> file back to 644.
+
+Also please delete install.php and the e107_install directory from your server after you have clicked the button below
+");
+define("LANINS_070", "e107 was unable to save the main config file to your server.
+
+Please ensure the <b>e107_config.php</b> file has the correct permissions");
+define("LANINS_071", "Finalising Installation");
+
+define("LANINS_072", "Admin Username");
+define("LANINS_073", "This is the name you will use to login into the site. If you wish to use this as your display name also");
+define("LANINS_074", "Admin Display Name");
+define("LANINS_075", "This is the name that you wish your users to see displayed in your profile, forums and other areas. If you wish to use the same as your login name then leave this blank.");
+define("LANINS_076", "Admin Password");
+define("LANINS_077", "Please type the admin password you wish to use here");
+define("LANINS_078", "Admin Password Confirmation");
+define("LANINS_079", "Please type the admin password again for confirmation");
+define("LANINS_080", "Admin Email");
+define("LANINS_081", "Enter your email address");
+
+define("LANINS_082", "user@yoursite.com");
+
+// Better table creation error reporting
+define("LANINS_083", "MySQL Reported Error:");
+define("LANINS_084", "The installer could not establish a connection to the database");
+define("LANINS_085", "The installer could not select database:");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_install.php 75/e107_languages/English/lan_install.php
--- 6171/e107_languages/English/lan_install.php	2004-09-09 21:58:00.000000000 -0500
+++ 75/e107_languages/English/lan_install.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,99 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_install.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/10 02:58:00 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-
-define("INSLAN1", "Installation Stage");
-define("INSLAN2", "PHP / mySQL version check / file permissions check");
-define("INSLAN3", "PHP Version");
-define("INSLAN4", "Fail");
-define("INSLAN5", "You are running a version of PHP that is not compatible with e107");
-define("INSLAN6", "Script halted.");
-define("INSLAN7", "Pass");
-define("INSLAN8", "mySQL Version");
-define("INSLAN9", "e107 was unable to determine the mySQL version number.");
-define("INSLAN10", "File permissions");
-define("INSLAN11", "is not writable");
-define("INSLAN12", "folder are not writable");
-define("INSLAN13", "Please ensure the permissions for the files shown above have been set<br />correctly on your server, the permissions should be set to 777. To set the<br />permissions, right click on the file in your FTP client and choose Chmod or<br />Set File Permissions, then type in 777, if the dialog that appears has boxes<br />then tick all the boxes.<br /><br />Please retest after setting the file permissions.");
-define("INSLAN14", "e107 installing");
-define("INSLAN15", "FATAL ERROR");
-define("INSLAN16", "Although it was not possible to determine the status of your mySQL installation,<br />please continue to next stage.");
-define("INSLAN17", "Continue");
-define("INSLAN18", "Retest File Permissions");
-define("INSLAN19", "All server tests have been passed, please click on the button to proceed to next stage");
-define("INSLAN20", "mySQL information");
-define("INSLAN21", "Please enter your mySQL settings here.<br />If you have root permissions you can create a new database by ticking the box, if not you must<br />create a database or use a pre-existing one. <br />If you have only one database use a prefix so that other scripts can share the same database.<br />If you do not know your mySQL details contact your web host.");
-define("INSLAN22", "mySQL Server");
-define("INSLAN23", "mySQL Username");
-define("INSLAN24", "mySQL Password");
-define("INSLAN25", "mySQL Database");
-define("INSLAN26", "Table prefix");
-define("INSLAN27", "Error");
-define("INSLAN28", "Error encountered");
-define("INSLAN29", "You left required fields blank, please re-enter mySQL information");
-define("INSLAN30", "e107 was unable to establish a connection to mySQL using the information you entered.<br />Please return to the last page and ensure the information is correct.");
-define("INSLAN31", "mySQL check");
-define("INSLAN32", "Connection to mySQL established and verified.");
-define("INSLAN33", "Attempting to create database");
-define("INSLAN34", "Unable to create database, please ensure you have the correct permissions to create databases on your server.");
-define("INSLAN35", "Successfully created database.");
-define("INSLAN36", "Please click on the button to proceed to next stage.");
-
-
-define("INSLAN37", "Back to last page");
-define("INSLAN38", "Administrator information");
-define("INSLAN39", "Please enter your main administrator username, password and email address here.<br />These details will be used to gain access to the administration area of your website.<br />Please make sure you write your username and password down in a safe place as if they are lost they<br />cannot be retrieved.");
-define("INSLAN40", "Admin Name");
-define("INSLAN41", "Admin Password");
-define("INSLAN42", "Confirm Password");
-define("INSLAN43", "Admin Email Address");
-define("INSLAN44", "You left required fields blank, please re-enter admin information.");
-define("INSLAN45", "The two passwords do not match, please re-enter.");
-define("INSLAN46", "doesn't appear to be a valid email address, please re-enter.");
-define("INSLAN47", "All set!");
-define("INSLAN48", "e107 now has all the information it needs to complete the installation.<br />Please click the button to create the database tables and save all your settings.");
-define("INSLAN49", "e107 was unable to save the main config file to your server<br />Please ensure the <b>e107_config.php</b> file has the correct permissions");
-define("INSLAN50", "Installation Completed!");
-define("INSLAN51", "All done");
-define("INSLAN52", "e107 has been successfully installed!<br />For security reasons you should now set the file permissions on the<br /><b>e107_config.php</b> file back to 644.<br />Also please delete /install.php from your server after you have clicked the button below");
-define("INSLAN53", "Click here to go to your new website!");
-define("INSLAN54", "Unable to read the sql datafile<br /><br />Please ensure the file <b>core_sql.php</b> exists in the <b>/e107_admin/sql</b> directory.");
-define("INSLAN55", "e107 was unable to create all of the required database tables.<br />Please clear the database and rectify any problems before trying again.");
-define("INSLAN56", "Welcome to your new website!");
-
-define("INSLAN57", "e107 has installed successfully and is now ready to accept content.");
-define("INSLAN58", "you will find the FAQ and documentation here.");
-define("INSLAN59", "Thankyou for trying e107, we hope it fulfills your website needs.\n(You can delete this message from your admin section.)");
-define("INSLAN60", "tick to create");
-define("INSLAN61", "folder");
-define("INSLAN62", "or");
-define("INSLAN63", "File permission error");
-define("INSLAN64", "This file has been generated by the installation script.");
-
-define("INSLAN65", "e107 requires at least version 4.1.0");
-define("INSLAN66", "If you are using a local server on your computer you will need to upgrade your");
-define("INSLAN67", "version of PHP to continue, please see");
-define("INSLAN68", "for instructions. If you are");
-define("INSLAN69", "attempting to install e107 on a hosted server you will need to contact the");
-define("INSLAN70", "server administrators and ask them  to upgrade PHP for you.");
-define("INSLAN71", "Please rerun this script after upgrading your PHP version.");
-
-define("INSLAN72", "This could mean that mySQL is not installed or not currently running, or");
-define("INSLAN73", "you could be running a version that doesn't correctly report the version");
-define("INSLAN74", "number (v5.x is known to have this problem). If the next step of the installation");
-define("INSLAN75", "fails you will need to check your mySQL status.");
-
-define("INSLAN76", "Your administration section is");
-define("INSLAN77", "located here");
-define("INSLAN78", "click to go there now. You will have to login using the name and password you entered during the installation process.");
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_links.php 75/e107_languages/English/lan_links.php
--- 6171/e107_languages/English/lan_links.php	2004-08-27 16:40:14.000000000 -0500
+++ 75/e107_languages/English/lan_links.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,41 +1,50 @@
-<?php
-
-define("PAGE_NAME", "Links");
-
-define("LAN_61", "Link Categories");
-define("LAN_62", "categories");
-define("LAN_63", "category");
-define("LAN_64", "in this category");
-define("LAN_65", "link");
-define("LAN_66", "links");
-define("LAN_67", "Show All Links");
-define("LAN_68", "edit");
-define("LAN_69", "delete");
-define("LAN_86", "Category:");
-define("LAN_88", "Referrals:");
-define("LAN_89", "Admin: ");
-define("LAN_90", "add new link in this category");
-define("LAN_91", "add new category");
-
-define("LAN_92", "Submit a link");
-define("LAN_93", "After submitting your link it will be reviewed by a site admin and if appropriate it will be added to the main links page.");
-define("LAN_94", "Link Name:");
-define("LAN_95", "Link URL:");
-define("LAN_96", "Link Description:");
-define("LAN_97", "URL to link button:");
-define("LAN_98", "Submit Link");
-
-define("LAN_99", "Thankyou");
-define("LAN_100", "Your link has been saved and will be reviewed by a site administrator.");
-define("LAN_101", "Please click here to submit a link");
-
-define("LAN_102", "There");
-define("LAN_103", "is");
-define("LAN_104", "are");
-define("LAN_105", "total in");
-define("LAN_106", "Underlined fields are required.");
-
-define("LAN_Links_1", "Total links");
-define("LAN_Links_2", "Total links activated");
-define("LAN_LINKS_3", "Anonymous");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_links.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Links");
+
+define("LAN_61", "Link Categories");
+define("LAN_62", "categories");
+define("LAN_63", "category");
+define("LAN_64", "in this category");
+define("LAN_65", "link");
+define("LAN_66", "links");
+define("LAN_67", "Show All Links");
+define("LAN_68", "edit");
+define("LAN_69", "delete");
+define("LAN_86", "Category:");
+define("LAN_88", "Referrals:");
+define("LAN_89", "Admin: ");
+define("LAN_90", "add new link in this category");
+define("LAN_91", "add new category");
+
+define("LAN_92", "Submit a link");
+define("LAN_93", "After submitting your link it will be reviewed by a site admin and if appropriate it will be added to the main links page.");
+define("LAN_94", "Link Name:");
+define("LAN_95", "Link URL:");
+define("LAN_96", "Link Description:");
+define("LAN_97", "URL to link button:");
+define("LAN_98", "Submit Link");
+
+define("LAN_99", "Thankyou");
+define("LAN_100", "Your link has been saved and will be reviewed by a site administrator.");
+define("LAN_101", "Please click here to submit a link");
+
+define("LAN_102", "There");
+define("LAN_103", "is");
+define("LAN_104", "are");
+define("LAN_105", "total in");
+define("LAN_106", "Underlined fields are required.");
+
+define("LAN_Links_1", "Total links");
+define("LAN_Links_2", "Total links activated");
+define("LAN_LINKS_3", "Anonymous");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_login.php 75/e107_languages/English/lan_login.php
--- 6171/e107_languages/English/lan_login.php	2004-05-04 17:45:20.000000000 -0500
+++ 75/e107_languages/English/lan_login.php	2006-03-01 20:29:17.000000000 -0600
@@ -1,16 +1,38 @@
-<?php
-
-define("LAN_27", "You left required field(s) blank");
-define("LAN_300", "That username was not found in the database.");
-define("LAN_301", "Incorrect password.");
-define("LAN_302", "You have not activated your account. You should have received an email with instructions on how to confirm your account, if not please contact a site administrator.");
-define("LAN_303", "Incorrect code entered.");
-define("LAN_LOGIN_1", "User name");
-define("LAN_LOGIN_2", "User password");
-define("LAN_LOGIN_3", "Protected server");
-define("LAN_LOGIN_4", "Please enter your details to gain access.");
-define("LAN_LOGIN_5", "Click here to Sign-Up");
-define("LAN_LOGIN_6", "Not accepting new members at this time");
-define("LAN_LOGIN_7", "Enter visible code");
-define("LAN_LOGIN_8", "Remember Me");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_login.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2006/03/02 02:29:17 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("LAN_27", "You left required field(s) blank");
+define("LAN_300", "Incorrect login. The entered data doesn't match to a registered user. Check if you have the CAPS-LOCK key activated as logins on this site are case sensitive");
+define("LAN_302", "You have not activated your account. You should have received an email with instructions on how to confirm your account. If not, please click <a href='".e_BASE."signup.php?resend'>here</a>.");
+define("LAN_303", "Incorrect code entered.");
+define("LAN_304", "That username/password combination is already in use.");
+define("LAN_LOGIN_1", "User name");
+define("LAN_LOGIN_2", "User password");
+define("LAN_LOGIN_3", "Protected server");
+define("LAN_LOGIN_4", "Please enter your details to gain access.");
+define("LAN_LOGIN_5", "Click here to Sign-Up");
+define("LAN_LOGIN_6", "Not accepting new members at this time");
+define("LAN_LOGIN_7", "Enter visible code");
+define("LAN_LOGIN_8", "Remember Me");
+define("LAN_LOGIN_9", "Log In");
+define("LAN_LOGIN_10", "Click to login");
+define("LAN_LOGIN_11", "Register as a New User");
+define("LAN_LOGIN_12", "Forgot Password");
+define("LAN_LOGIN_13", "Please enter text in image");
+
+define("LAN_LOGIN_14", "User attempted to login with unrecognised user name");
+define("LAN_LOGIN_15", "User attempted to login with incorrect password");
+define("LAN_LOGIN_16", "User attempted to login with username/password combination that was already in use");
+define("LAN_LOGIN_17", "User password (hashed)");
+define("LAN_LOGIN_18", "Auto-ban: More than 10 failed login attempts");
+define("LAN_LOGIN_19", "> 10 failed login attempts");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_mail_handler.php 75/e107_languages/English/lan_mail_handler.php
--- 6171/e107_languages/English/lan_mail_handler.php	2004-09-09 21:58:00.000000000 -0500
+++ 75/e107_languages/English/lan_mail_handler.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,21 +1,21 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_mail_handler.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/10 02:58:00 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("LANMAILH_1", "Produced By e107 website system");
-define("LANMAILH_2", "This is a multi-part message in MIME format.");
-define("LANMAILH_3", " is not properly formatted");
-define("LANMAILH_4", "Server rejected address");
-define("LANMAILH_5", "No response from server");
-define("LANMAILH_6", "Cannot find E-Mail server.");
-define("LANMAILH_7", " appears to be valid.");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_mail_handler.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("LANMAILH_1", "Produced By e107 website system");
+define("LANMAILH_2", "This is a multi-part message in MIME format.");
+define("LANMAILH_3", " is not properly formatted");
+define("LANMAILH_4", "Server rejected address");
+define("LANMAILH_5", "No response from server");
+define("LANMAILH_6", "Cannot find E-Mail server.");
+define("LANMAILH_7", " appears to be valid.");
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_membersonly.php 75/e107_languages/English/lan_membersonly.php
--- 6171/e107_languages/English/lan_membersonly.php	2004-09-09 21:58:00.000000000 -0500
+++ 75/e107_languages/English/lan_membersonly.php	2006-01-06 12:11:26.000000000 -0600
@@ -1,20 +1,21 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_membersonly.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/10 02:58:00 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Members Only");
-
-define("LAN_MEMBERS_0", "restricted area");
-define("LAN_MEMBERS_1", "This is a restricted area");
-define("LAN_MEMBERS_2","to access it either log in or");
-define("LAN_MEMBERS_3","register as a member");
-define("LAN_MEMBERS_4","Click here to return to front page");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_membersonly.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/01/06 18:11:26 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Members Only");
+
+define("LAN_MEMBERS_0", "restricted area");
+define("LAN_MEMBERS_1", "This is a restricted area.");
+define("LAN_MEMBERS_2","For access please <a href='".e_LOGIN."'>log in</a>");
+define("LAN_MEMBERS_3","or <a href='".e_SIGNUP."'>register</a> as a member");
+define("LAN_MEMBERS_4","Click here to return to front page");
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_news.php 75/e107_languages/English/lan_news.php
--- 6171/e107_languages/English/lan_news.php	2004-09-09 05:02:34.000000000 -0500
+++ 75/e107_languages/English/lan_news.php	2006-04-17 20:33:36.000000000 -0500
@@ -1,25 +1,48 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_news.php,v $
-|     $Revision: 1.3 $
-|     $Date: 2004/09/09 10:02:33 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "News");
-
-define("LAN_82", "News - Category");
-define("LAN_83", "No news items yet - please check back soon.");
-define("LAN_84", "News Items");
-define("LAN_99", "Comments");
-define("LAN_100", "On");
-define("LAN_307", "Total posts in this category: ");
-
-define("LAN_NEWS_1", "News for specific members only");
-define("LAN_NEWS_2", "You are not allowed to see this news");
-define("LAN_NEWS_3", "Please delete install.php from your server");
-define("LAN_NEWS_4", "if you do not there is a potential security risk to your website");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_news.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2006/04/18 01:33:36 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "News");
+
+define("LAN_82", "News - Category");
+define("LAN_83", "No news items at the moment - please check back soon.");
+define("LAN_84", "News Items");
+define("LAN_99", "Comments");
+define("LAN_100", "On");
+define("LAN_307", "Total posts in this category: ");
+
+define("LAN_NEWS_1", "News for specific members only");
+define("LAN_NEWS_2", "You are not allowed to see this news");
+//define("LAN_NEWS_3", "Please delete install.php from your server");
+//define("LAN_NEWS_4", "if you do not there is a potential security risk to your website");
+
+define("LAN_NEWS_5", "<b>Error!</b> Was unable to update news item into database!</b>");
+define("LAN_NEWS_6", "News entered into database.");
+define("LAN_NEWS_7", "<b>Error!</b> Was unable to enter news item into database!</b>");
+define("LAN_NEWS_8", "News entered into database for all languages. ID: ");
+define("LAN_NEWS_9", "Title only is set - <b>only the news title will be shown</b><br />");
+define("LAN_NEWS_10", "This news post is <b>inactive</b> (It will be not shown on front page). ");
+define("LAN_NEWS_11", "This news post is <b>active</b> (it will be shown on front page). ");
+define("LAN_NEWS_12", "Comments are turned <b>on</b>. ");
+define("LAN_NEWS_13", "Comments are turned <b>off</b>. ");
+define("LAN_NEWS_14", "<br />Activation period: ");
+define("LAN_NEWS_15", "Body length: ");
+define("LAN_NEWS_16", "b. Extended length: ");
+define("LAN_NEWS_17", "b.");
+define("LAN_NEWS_18", "Info:");
+define("LAN_NEWS_19", "Now");
+define("LAN_NEWS_20", "News updated in database for the following language: ");
+define("LAN_NEWS_21", "News updated in database.");
+// define("LAN_NEWS_22", "Go to page: ");
+define("LAN_NEWS_23", "News Categories");
+define("LAN_NEWS_24", "create pdf of this news item");
+define("LAN_462", "No news items for specified month");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_newspost.php 75/e107_languages/English/lan_newspost.php
--- 6171/e107_languages/English/lan_newspost.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/lan_newspost.php	2006-01-14 19:08:03.000000000 -0600
@@ -1,35 +1,44 @@
-<?php
-
-define("NWSLAN_1", "News story deleted.");
-define("NWSLAN_2", "Please tick the confirm box to delete this news item.");
-define("NWSLAN_3", "No news items yet.");
-define("NWSLAN_4", "Existing News");
-define("NWSLAN_5", "Open HTML Editor");
-define("NWSLAN_6", "Category");
-define("NWSLAN_7", "Edit");
-define("NWSLAN_8", "Delete");
-define("NWSLAN_9", "tick to confirm");
-define("NWSLAN_10", "No categories set yet.");
-define("NWSLAN_11", "Add/Edit Categories");
-define("NWSLAN_12", "Title");
-define("NWSLAN_13", "Body");
-define("NWSLAN_14", "Extended");
-define("NWSLAN_15", "Comments");
-define("NWSLAN_16", "Enabled");
-define("NWSLAN_17", "Disabled");
-define("NWSLAN_18", "Allow comments to be posted to this news item");
-define("NWSLAN_19", "Activation");
-define("NWSLAN_20", "Leave blank to disable auto-activation");
-define("NWSLAN_21", "Activate between");
-define("NWSLAN_22", "Visibility");
-define("NWSLAN_23", "Ticking will make the news item visible to only users in that class");
-define("NWSLAN_24", "Preview again");
-define("NWSLAN_25", "Update news in database");
-define("NWSLAN_26", "Post news to database");
-define("NWSLAN_27", "Preview");
-define("NWSLAN_28", "New story");
-define("NWSLAN_29", "News Post");
-
-define("NWSLAN_30", "Show title only");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_newspost.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2006/01/15 01:08:03 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+define("NWSLAN_1", "News story deleted.");
+define("NWSLAN_2", "Please tick the confirm box to delete this news item.");
+define("NWSLAN_3", "No news items yet.");
+define("NWSLAN_4", "Existing News");
+define("NWSLAN_5", "Open HTML Editor");
+define("NWSLAN_6", "Category");
+define("NWSLAN_7", "Edit");
+define("NWSLAN_8", "Delete");
+define("NWSLAN_9", "tick to confirm");
+define("NWSLAN_10", "No categories set yet.");
+define("NWSLAN_11", "Add/Edit Categories");
+define("NWSLAN_12", "Title");
+define("NWSLAN_13", "Body");
+define("NWSLAN_14", "Extended");
+define("NWSLAN_15", "Comments");
+define("NWSLAN_16", "Enabled");
+define("NWSLAN_17", "Disabled");
+define("NWSLAN_18", "Allow comments to be posted to this news item");
+define("NWSLAN_19", "Activation");
+define("NWSLAN_20", "Leave blank to disable auto-activation");
+define("NWSLAN_21", "Activate between");
+define("NWSLAN_22", "Visibility");
+define("NWSLAN_23", "Ticking will make the news item visible only to users in that class");
+define("NWSLAN_24", "Preview again");
+define("NWSLAN_25", "Update news in database");
+define("NWSLAN_26", "Post news to database");
+define("NWSLAN_27", "Preview");
+define("NWSLAN_28", "New story");
+define("NWSLAN_29", "News Post");
+
+define("NWSLAN_30", "Show title only");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_notify.php 75/e107_languages/English/lan_notify.php
--- 6171/e107_languages/English/lan_notify.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_notify.php	2006-04-10 20:43:42.000000000 -0500
@@ -0,0 +1,36 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_notify.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/04/11 01:43:42 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+define("NT_LAN_US_1", "User Signup");
+
+define("NT_LAN_UV_1", "User Signup Verified");
+define("NT_LAN_UV_2", "User ID: ");
+define("NT_LAN_UV_3", "User Login Name: ");
+define("NT_LAN_UV_4", "User IP: ");
+
+
+define("NT_LAN_LI_1", "User Logged In");
+
+define("NT_LAN_LO_1", "User Logged Out");
+define("NT_LAN_LO_2", " logged out of site");
+
+define("NT_LAN_FL_1", "Flood Ban");
+define("NT_LAN_FL_2", "IP address banned for flooding");
+
+define("NT_LAN_SN_1", "News Item Submitted");
+
+define("NT_LAN_NU_1", "Updated");
+
+define("NT_LAN_ND_1", "News Item Deleted");
+define("NT_LAN_ND_2", "Deleted news item id");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_np.php 75/e107_languages/English/lan_np.php
--- 6171/e107_languages/English/lan_np.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/lan_np.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,7 +1,16 @@
-<?php
-
-define("NP_1", "Previous page");
-define("NP_2", "Next page");
-define("NP_3", "Go to page");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_np.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("NP_1", "Previous page");
+define("NP_2", "Next page");
+define("NP_3", "Go to page");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_oldpolls.php 75/e107_languages/English/lan_oldpolls.php
--- 6171/e107_languages/English/lan_oldpolls.php	2004-03-23 16:18:08.000000000 -0600
+++ 75/e107_languages/English/lan_oldpolls.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,16 +0,0 @@
-<?php
-
-define("PAGE_NAME", "Old Surveys");
-
-define("LAN_92", "Old Surveys");
-define("LAN_93", "No old polls yet.");
-define("LAN_94", "Posted by");
-define("LAN_95", "Total votes:");
-define("LAN_96", "Polls");
-define("LAN_97", "Show Comments");
-
-define("LAN_98", "Poll");
-define("LAN_99", "Active from ");
-define("LAN_100", " to ");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_online.php 75/e107_languages/English/lan_online.php
--- 6171/e107_languages/English/lan_online.php	2004-05-22 18:43:26.000000000 -0500
+++ 75/e107_languages/English/lan_online.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,66 +1,64 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-//v.616
-define("ONLINE_EL1", "Guests: ");
-define("ONLINE_EL2", "Members: ");
-define("ONLINE_EL3", "On this page: ");
-define("ONLINE_EL4", "Online");
-define("ONLINE_EL5", "Members");
-define("ONLINE_EL6", "Newest member");
-define("ONLINE_EL7", "viewing");
-define("ONLINE_EL8", "most ever online: ");
-define("ONLINE_EL9", "on");
-define("ONLINE_EL10", "Member Name");
-define("ONLINE_EL11", "Viewing Page");
-define("ONLINE_EL12", "Replying to");
-define("ONLINE_EL13", "Forum");
-define("ONLINE_EL14", "Thread");
-define("ONLINE_EL15", "Page");
-define("CLASSRESTRICTED", "Class Restricted Page");
-define("ARTICLEPAGE", "Article/Review");
-define("CHAT", "Chat");
-define("COMMENT", "Comments");
-define("DOWNLOAD", "Downloads");
-define("EMAIL", "email.php");
-define("FORUM", "Main Forum Index");
-define("LINKS", "Links");
-define("NEWS", "News");
-define("OLDPOLLS", "Old Polls");
-define("POLLCOMMENT", "Poll");
-define("PRINTPAGE", "Print");
-define("LOGIN", "Logging In");
-define("SEARCH", "Searching");
-define("STATS", "Site Stats");
-define("SUBMITNEWS", "Submit News");
-define("UPLOAD", "Uploads");
-define("USERPAGE", "User Profiles");
-define("USERSETTINGS", "User Settings");
-define("ONLINE", "Online Users");
-define("LISTNEW", "List New Items");
-define("USERPOSTS", "User Posts");
-define("SUBCONTENT", "Submit Article/Review");
-define("TOP", "Top Posters/Most Active Threads");
-define("ADMINAREA", "Admin Area");
-define("BUGTRACKER", "Bugtracker");
-define("EVENT", "Events List");
-define("CALENDAR", "Events Calendar");
-define("FAQ", "Faq");
-define("PM", "Private Messaging");
-define("SURVEY", "Survey");
-define("ARTICLE", "Article");
-define("CONTENT", "Content Page");
-define("REVIEW", "Review");
-
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_online.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+//v.616
+define("ONLINE_EL1", "Guests: ");
+define("ONLINE_EL2", "Members: ");
+define("ONLINE_EL3", "On this page: ");
+define("ONLINE_EL4", "Online");
+define("ONLINE_EL5", "Members");
+define("ONLINE_EL6", "Newest member");
+define("ONLINE_EL7", "viewing");
+define("ONLINE_EL8", "most ever online: ");
+define("ONLINE_EL9", "on");
+define("ONLINE_EL10", "Member Name");
+define("ONLINE_EL11", "Viewing Page");
+define("ONLINE_EL12", "Replying to");
+define("ONLINE_EL13", "Forum");
+define("ONLINE_EL14", "Thread");
+define("ONLINE_EL15", "Page");
+define("CLASSRESTRICTED", "Class Restricted Page");
+define("ARTICLEPAGE", "Article/Review");
+define("CHAT", "Chat");
+define("COMMENT", "Comments");
+define("DOWNLOAD", "Downloads");
+define("EMAIL", "email.php");
+define("FORUM", "Main Forum Index");
+define("LINKS", "Links");
+define("NEWS", "News");
+define("OLDPOLLS", "Old Polls");
+define("POLLCOMMENT", "Poll");
+define("PRINTPAGE", "Print");
+define("LOGIN", "Logging In");
+define("SEARCH", "Searching");
+define("STATS", "Site Stats");
+define("SUBMITNEWS", "Submit News");
+define("UPLOAD", "Uploads");
+define("USERPAGE", "User Profiles");
+define("USERSETTINGS", "User Settings");
+define("ONLINE", "Online Users");
+define("LISTNEW", "List New Items");
+define("USERPOSTS", "User Posts");
+define("SUBCONTENT", "Submit Article/Review");
+define("TOP", "Top Posters/Most Active Threads");
+define("ADMINAREA", "Admin Area");
+define("BUGTRACKER", "Bugtracker");
+define("EVENT", "Events List");
+define("CALENDAR", "Events Calendar");
+define("FAQ", "Faq");
+define("PM", "Private Messaging");
+define("SURVEY", "Survey");
+define("ARTICLE", "Article");
+define("CONTENT", "Content Page");
+define("REVIEW", "Review");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_page.php 75/e107_languages/English/lan_page.php
--- 6171/e107_languages/English/lan_page.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_page.php	2006-02-28 17:02:59.000000000 -0600
@@ -0,0 +1,25 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_page.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2006/02/28 23:02:59 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_PAGE_1", "Page listing is turned off");
+define("LAN_PAGE_2", "There are no pages");
+define("LAN_PAGE_3", "Requested page does not exist");
+define("LAN_PAGE_4", "Rate this page");
+define("LAN_PAGE_5", "Thankyou for rating this page");
+define("LAN_PAGE_6", "You do not have permission to view this page");
+define("LAN_PAGE_7", "Incorrect password");
+define("LAN_PAGE_8", "Password Protected Page");
+define("LAN_PAGE_9", "Password");
+define("LAN_PAGE_10", "Submit");
+define("LAN_PAGE_11", "Page List");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_parser_functions.php 75/e107_languages/English/lan_parser_functions.php
--- 6171/e107_languages/English/lan_parser_functions.php	2004-05-10 04:03:00.000000000 -0500
+++ 75/e107_languages/English/lan_parser_functions.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,5 +1,14 @@
-<?php
-
-define("LAN_GUEST", "Guest"); 
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_parser_functions.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("LAN_GUEST", "Guest");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_prefs.php 75/e107_languages/English/lan_prefs.php
--- 6171/e107_languages/English/lan_prefs.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_prefs.php	2006-04-04 18:13:42.000000000 -0500
@@ -0,0 +1,19 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_prefs.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/04/04 23:13:42 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_PREF_1", "e107 Powered Website");
+define("LAN_PREF_2", "e107 Website System");
+define("LAN_PREF_3", "This site is powered by <a href=&quot;http://e107.org/&quot; rel=&quot;external&quot;>e107</a>, which is released under the terms of the <a href=&quot;http://www.gnu.org/&quot; rel=&quot;external&quot;>GNU</a> GPL License.");
+define("LAN_PREF_4", "censored");
+define("LAN_PREF_5", "Forums");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_print.php 75/e107_languages/English/lan_print.php
--- 6171/e107_languages/English/lan_print.php	2004-03-23 23:28:16.000000000 -0600
+++ 75/e107_languages/English/lan_print.php	2006-02-17 17:49:04.000000000 -0600
@@ -1,15 +1,27 @@
-<?php
-
-define("PAGE_NAME", "Printer Friendly");
-
-define("LAN_86", "Category:");
-define("LAN_87", "by ");
-define("LAN_94", "Posted by");
-define("LAN_135", "News Item: ");
-define("LAN_303", "This news item is from ");
-define("LAN_304", "Article Title: ");
-define("LAN_305", "Subheading: ");
-define("LAN_306", "This article is from ");
-define("LAN_307", "Print this page");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_print.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/02/17 23:49:04 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Printer Friendly");
+
+define("LAN_86", "Category:");
+define("LAN_87", "by ");
+define("LAN_94", "Posted by");
+define("LAN_135", "News Item: ");
+define("LAN_303", "This news item is from ");
+define("LAN_304", "Title: ");
+define("LAN_305", "Subheading: ");
+define("LAN_306", "This is from: ");
+define("LAN_307", "Print this page");
+
+define("LAN_PRINT_1", "printer friendly");
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_rate.php 75/e107_languages/English/lan_rate.php
--- 6171/e107_languages/English/lan_rate.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_rate.php	2005-06-27 06:45:50.000000000 -0500
@@ -0,0 +1,20 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_rate.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/06/27 11:45:50 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+define("RATELAN_0", "vote");
+define("RATELAN_1", "votes");
+define("RATELAN_2", "how do you rate this item?");
+define("RATELAN_3", "thank you for your vote");
+define("RATELAN_4", "not rated");
+define("RATELAN_5", "Rate");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_ren_help.php 75/e107_languages/English/lan_ren_help.php
--- 6171/e107_languages/English/lan_ren_help.php	2004-05-23 10:09:42.000000000 -0500
+++ 75/e107_languages/English/lan_ren_help.php	2006-04-13 18:43:16.000000000 -0500
@@ -1,43 +1,62 @@
-<?php
-
-define("LANHELP_1", "Black");
-define("LANHELP_2", "Blue");
-define("LANHELP_3", "Brown");
-define("LANHELP_4", "Cyan");
-define("LANHELP_5", "Dark Blue");
-define("LANHELP_6", "Dark Red");
-define("LANHELP_7", "Green");
-define("LANHELP_8", "Indigo");
-define("LANHELP_9", "Olive");
-define("LANHELP_10", "Orange");
-define("LANHELP_11", "Red");
-define("LANHELP_12", "Violet");
-define("LANHELP_13", "White");
-define("LANHELP_14", "Yellow");
-
-define("LANHELP_15", "Tiny");
-define("LANHELP_16", "Small");
-define("LANHELP_17", "Normal");
-define("LANHELP_18", "Large");
-define("LANHELP_19", "Larger");
-define("LANHELP_20", "Massive");
-
-define("LANHELP_21", "Color ..");
-define("LANHELP_22", "Size ..");
-
-define("LANHELP_23", "Insert link: [link]http://mysite.com[/link] or  [link=http://yoursite.com]Visit My Site[/link]");
-define("LANHELP_24", "Bold text: [b]This text will be bold[/b]", "font-weight:bold; width: 20px");
-define("LANHELP_25", "Italic text: [i]This text will be italicised[/i]", "font-style:italic; width: 20px");
-define("LANHELP_26", "Underline text: [u]This text will be underlined[/u]", "text-decoration: underline; width: 20px");
-define("LANHELP_27", "Insert image: [img]mypicture.jpg[/img]");
-define("LANHELP_28", "Center align: [center]This text will be centered[/center]");
-define("LANHELP_29", "Left align: [left]This text will be left aligned[/left]");
-define("LANHELP_30", "Right align: [right]This text will be right aligned[/right]");
-define("LANHELP_31", "Blockquote text: [blockquote]This text will be blockquoted (indented)[/blockquote]");
-define("LANHELP_32", "Code - preformatted text: [code]\$foo = bah;[/code]");
-define("LANHELP_33", "HTML - removes linebreaks from text: [html]&lt;table&gt;&lt;tr&gt;&lt;td&gt; etc[/html]");
-define("LANHELP_34", "Insert newpage tag, splits article into more than one page");
-
-define("LANHELP_35", "hyperlink url");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_ren_help.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/04/13 23:43:16 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+define("LANHELP_1", "Black");
+define("LANHELP_2", "Blue");
+define("LANHELP_3", "Brown");
+define("LANHELP_4", "Cyan");
+define("LANHELP_5", "Dark Blue");
+define("LANHELP_6", "Dark Red");
+define("LANHELP_7", "Green");
+define("LANHELP_8", "Indigo");
+define("LANHELP_9", "Olive");
+define("LANHELP_10", "Orange");
+define("LANHELP_11", "Red");
+define("LANHELP_12", "Violet");
+define("LANHELP_13", "White");
+define("LANHELP_14", "Yellow");
+
+define("LANHELP_15", "Tiny");
+define("LANHELP_16", "Small");
+define("LANHELP_17", "Normal");
+define("LANHELP_18", "Large");
+define("LANHELP_19", "Larger");
+define("LANHELP_20", "Massive");
+
+define("LANHELP_21", "Click to open color dialog ...");
+define("LANHELP_22", "Click to open size dialog ...");
+
+define("LANHELP_23", "Insert link: [link]http://mysite.com[/link] or  [link=http://yoursite.com]Visit My Site[/link]");
+define("LANHELP_24", "Bold text: [b]This text will be bold[/b]", "font-weight:bold; width: 20px");
+define("LANHELP_25", "Italic text: [i]This text will be italicised[/i]", "font-style:italic; width: 20px");
+define("LANHELP_26", "Underline text: [u]This text will be underlined[/u]", "text-decoration: underline; width: 20px");
+define("LANHELP_27", "Insert image: [img]mypicture.jpg[/img]");
+define("LANHELP_28", "Center align: [center]This text will be centered[/center]");
+define("LANHELP_29", "Left align: [left]This text will be left aligned[/left]");
+define("LANHELP_30", "Right align: [right]This text will be right aligned[/right]");
+define("LANHELP_31", "Blockquote text: [blockquote]This text will be blockquoted (indented)[/blockquote]");
+define("LANHELP_32", "Code - preformatted text: [code]\$foo = bah;[/code]");
+define("LANHELP_33", "HTML - removes linebreaks from text: [html]&lt;table&gt;&lt;tr&gt;&lt;td&gt; etc[/html]");
+define("LANHELP_34", "[newpage] or [newpage=title] Insert newpage tag, splits article into more than one page");
+define("LANHELP_35", "hyperlink url");
+define("LANHELP_36", "Unordered: [list]line1*line2*line3[/list] Ordered: [list=type]line1*line2*line3[/list]");
+
+define("LANHELP_37", "Insert image from e107_images/newspost_images/ directory");
+define("LANHELP_38", "link to full image will be generated");
+
+define("LANHELP_39", "Insert download link from existing downloads");
+define("LANHELP_40", "There are currently no existing downloads");
+
+define("LANHELP_41", "Font Size...");
+define("LANHELP_42", "Select Image...");
+define("LANHELP_43", "Select Download File...");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_request.php 75/e107_languages/English/lan_request.php
--- 6171/e107_languages/English/lan_request.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_request.php	2005-06-09 10:38:12.000000000 -0500
@@ -0,0 +1,19 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_request.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/06/09 15:38:12 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_dl_61", "Download Error");
+define("LAN_dl_62", "You have been prevented from downloading this file, you have exceeded your download quota");
+define("LAN_dl_63", "You do not have the correct permissions to download this file.");
+define("LAN_dl_64", "Back");
+define("LAN_dl_65", "File Not Found");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_search.php 75/e107_languages/English/lan_search.php
--- 6171/e107_languages/English/lan_search.php	2004-08-16 12:11:24.000000000 -0500
+++ 75/e107_languages/English/lan_search.php	2005-09-19 17:09:06.000000000 -0500
@@ -1,47 +1,119 @@
-<?php
-
-define("PAGE_NAME", "Search");
-
-define("LAN_20", "Error");
-define("LAN_98", "News Items");
-define("LAN_99", "Comments");
-define("LAN_100", "Articles");
-define("LAN_101", "Chatbox");
-define("LAN_102", "Links");
-define("LAN_103", "Forum");
-define("LAN_140", "Registered members");
-define("LAN_180", "Search");
-define("LAN_190", "Reviews");
-define("LAN_191", "Content");
-define("LAN_192", "All categories");
-define("LAN_193", "Event Calendar");
-define("LAN_194", "All Categories");
-define("LAN_195", "Searching");
-define("LAN_196", "matches");
-
-define("LAN_197", "Downloads");
-define("LAN_198", "No matches found");
-define("LAN_199", "Search for:");
-define("LAN_200", "Categories:");
-
-define("LAN_201", "Please redefine your search query");
-define("LAN_416", "You must be logged in to access this page");
-define("LAN_417", "Search terms must be at least 3 characters.");
-
-define("LAN_SEARCH_1", "Check All");
-define("LAN_SEARCH_2", "Uncheck All");
-define("LAN_SEARCH_3", "item posted on ");
-define("LAN_SEARCH_4", "Match found in news title");
-define("LAN_SEARCH_5", "Match found in news text");
-define("LAN_SEARCH_6", "Match found in extended news text");
-define("LAN_SEARCH_7", "posted by ");
-define("LAN_SEARCH_8", " on ");
-define("LAN_SEARCH_9", "Untitled");
-
-
-
-
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_search.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2005/09/19 22:09:06 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("PAGE_NAME", "Search");
+
+define("LAN_98", "News");
+define("LAN_99", "Comments");
+define("LAN_140", "Members");
+define("LAN_180", "Search");
+define("LAN_192", "All categories");
+define("LAN_193", "Event Calendar");
+define("LAN_194", "All Categories");
+define("LAN_195", "Searching");
+define("LAN_196", "matches");
+
+define("LAN_197", "Downloads");
+define("LAN_198", "No matches found");
+define("LAN_199", "Search For:");
+define("LAN_200", "Categories:");
+
+define("LAN_201", "Please redefine your search query");
+define("LAN_416", "You must be logged in to access this page");
+define("LAN_417", "Search terms must be at least 3 characters.");
+
+define("LAN_418", "Other Pages");
+
+define("LAN_SEARCH_1", "Check All");
+define("LAN_SEARCH_2", "Uncheck All");
+define("LAN_SEARCH_3", "Posted on ");
+define("LAN_SEARCH_4", "Match found in news title");
+define("LAN_SEARCH_5", "Match found in news text");
+define("LAN_SEARCH_6", "Match found in extended news text");
+define("LAN_SEARCH_7", "Posted by ");
+define("LAN_SEARCH_8", " on ");
+define("LAN_SEARCH_9", "Untitled");
+define("LAN_SEARCH_10", "Go to page:");
+define("LAN_SEARCH_11", "Results");
+define("LAN_SEARCH_12", " of ");
+define("LAN_SEARCH_13", " in ");
+define("LAN_SEARCH_14", "Category:");
+define("LAN_SEARCH_15", "Author:");
+define("LAN_SEARCH_17", "Sorry, search is restricted to one search every ");
+define("LAN_SEARCH_18", " seconds.");
+define("LAN_SEARCH_19", "Search In:");
+define("LAN_SEARCH_20", "Authorisation Required");
+define("LAN_SEARCH_21", "You are not authorised to view this page.");
+
+
+
+define("LAN_SEARCH_22", "All Areas");
+define("LAN_SEARCH_23", "Enhanced Query Form");
+define("LAN_SEARCH_24", "Must contain word(s)");
+define("LAN_SEARCH_25", "Must not contain word(s)");
+define("LAN_SEARCH_26", "Exact Phrase");
+define("LAN_SEARCH_27", "Word(s) beginning with");
+define("LAN_SEARCH_28", "All Has No Advanced Search");
+define("LAN_SEARCH_29", "Basic");
+define("LAN_SEARCH_30", "Advanced");
+define("LAN_SEARCH_31", "Has No Advanced Search");
+define("LAN_SEARCH_32", "The following words were excluded from the search");
+define("LAN_SEARCH_33", "The following word was excluded from the search");
+define("LAN_SEARCH_34", "Newer than");
+define("LAN_SEARCH_35", "Older than");
+define("LAN_SEARCH_36", "Any time");
+define("LAN_SEARCH_37", "One day");
+define("LAN_SEARCH_38", "Two days");
+define("LAN_SEARCH_39", "Three days");
+define("LAN_SEARCH_40", "One week");
+define("LAN_SEARCH_41", "Two weeks");
+define("LAN_SEARCH_42", "Three weeks");
+define("LAN_SEARCH_43", "One month");
+define("LAN_SEARCH_44", "Two months");
+define("LAN_SEARCH_45", "Three months");
+define("LAN_SEARCH_46", "Half a year");
+define("LAN_SEARCH_47", "One year");
+define("LAN_SEARCH_48", "Two years");
+define("LAN_SEARCH_49", "Three Years");
+
+define("LAN_SEARCH_50", "Date posted");
+define("LAN_SEARCH_51", "All categories");
+define("LAN_SEARCH_52", "Match in");
+define("LAN_SEARCH_53", "Whole item");
+define("LAN_SEARCH_54", "Title only");
+define("LAN_SEARCH_55", "Search in news category");
+define("LAN_SEARCH_56", "All News Categories");
+define("LAN_SEARCH_57", "Comments posted to");
+define("LAN_SEARCH_58", "All Areas");
+define("LAN_SEARCH_59", "All Comments");
+define("LAN_SEARCH_60", "Comments posted to");
+define("LAN_SEARCH_61", "By author");
+define("LAN_SEARCH_62", "Date joined");
+define("LAN_SEARCH_63", "Search in category");
+define("LAN_SEARCH_64", "All Download Categories");
+define("LAN_SEARCH_65", "Downloads");
+define("LAN_SEARCH_66", "Date added");
+define("LAN_SEARCH_67", "All downloads details");
+define("LAN_SEARCH_68", "Date");
+define("LAN_SEARCH_69", "Relevance");
+
+define("LAN_SEARCH_70", "Posted to download item");
+define("LAN_SEARCH_71", "Posted in reply to news item");
+define("LAN_SEARCH_72", "Signature");
+define("LAN_SEARCH_73", "No Signature.");
+define("LAN_SEARCH_74", "Joined on");
+
+define("LAN_SEARCH_75", "Search type");
+define("LAN_SEARCH_76", "Posted on page");
+define("LAN_SEARCH_77", "Posted on profile page of");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_signup.php 75/e107_languages/English/lan_signup.php
--- 6171/e107_languages/English/lan_signup.php	2004-09-06 06:09:32.000000000 -0500
+++ 75/e107_languages/English/lan_signup.php	2006-01-05 10:21:07.000000000 -0600
@@ -1,73 +1,101 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_signup.php,v $
-|     $Revision: 1.8 $
-|     $Date: 2004/09/06 11:09:31 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Register");
-
-define("LAN_7", "Login Name: ");
-define("LAN_17", "Password: ");
-define("LAN_103", "That user name cannot be accepted as valid, please choose a different user name");
-define("LAN_104", "That user name already exists in the database, please choose a different user name");
-define("LAN_105", "The two passwords do not match");
-define("LAN_106", "That doesn't appear to be a valid email address");
-define("LAN_107", "Thankyou! You are now a registered member of");
-define("LAN_108", "Registration complete");
-define("LAN_109", "This site complies with The Children's Online Privacy Protection Act of 1998 (COPPA) and as such cannot accept registrations from users under the age of 13 without a written permission document from their parent or guardian. For more information you can read the legislation");
-define("LAN_110", "Registration");
-define("LAN_111", "Re-type Password: ");
-define("LAN_112", "Email Address: ");
-define("LAN_113", "Hide email address?: ");
-define("LAN_114", "This will prevent your email address from being displayed on site");
-define("LAN_123", "Register");
-define("LAN_185", "You left required field(s) blank");
-define("LAN_201", "Yes");
-define("LAN_200", "No");
-define("LAN_202", "Registration failed");
-define("LAN_309", "Please enter your details below - <b>a verification email will be sent to the email address you enter here so it must be valid, </b>if you do not wish to display your email address on this site please tick the hide email address box.");
-define("LAN_399", "Continue");
-define("LAN_400", "Usernames and passwords are <b>case-sensitive</b>");
-define("LAN_401", "Your account has now been activated, please");
-define("LAN_402", "Registration activated");
-define("LAN_403", "Welcome to");
-define("LAN_404", "Registration details for");
-define("LAN_405", "This stage of registation is complete, you will be receiving a confirmation email containing your login details, please follow the link in the email to complete the signup process and activate your account.");
-define("LAN_406", "Thankyou!");
-define("LAN_407", "\n\nPlease keep this email for your own information as your password has been encrypted and cannot be retrieved if you misplace or forget it. You can however request a new password if this happens.\n\nThanks for your registration.\n\nFrom");
-define("LAN_408", "A user with that email address already exists. Please use the forgot password screen to retrieve your password.");
-define("LAN_SIGNUP_1", "Min.");
-define("LAN_SIGNUP_2", "chars.");
-define("LAN_SIGNUP_3", "Code verification failed.");
-define("LAN_SIGNUP_4", "Your password must be at least ");
-define("LAN_SIGNUP_5", " characters long.");
-define("LAN_SIGNUP_6", "Your ");
-define("LAN_SIGNUP_7", " is required");
-define("LAN_SIGNUP_8", "Thankyou!");
-define("LAN_SIGNUP_9", "Unable to proceed.");
-define("LAN_SIGNUP_10", "Yes");
-define("LAN_SIGNUP_11", ".");
-
-define("LAN_409", "Invalid characters in username");
-define("LAN_410", "Enter code visible in the image");
-
-define("LAN_SIGNUP_12", "please keep your username and password written down in a safe place as if lost they cannot be retrieved.");
-define("LAN_SIGNUP_13", "You can now login from the Login box.");
-define("LAN_SIGNUP_14", "here");
-define("LAN_SIGNUP_15", "Please contact the main site admin");
-define("LAN_SIGNUP_16", "if you require assistance.");
-define("LAN_SIGNUP_17", "Please certify you are 13 or over the age of 13.");
-define("LAN_SIGNUP_18", "Your registration has been received and created with the following login information ...");
-define("LAN_SIGNUP_19", "Username:");
-define("LAN_SIGNUP_20", "Password:");
-define("LAN_SIGNUP_21", "Your account is currently marked as being inactive, to activate your account please go to the following link ...");
-define("LAN_SIGNUP_22", "click here");
-define("LAN_SIGNUP_23", "to login.");
-define("LAN_SIGNUP_24", "Thankyou for registering at");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_signup.php,v $
+|     $Revision: 1.17 $
+|     $Date: 2006/01/05 16:21:07 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Register");
+define("LAN_7", "Display Name: ");
+define("LAN_8", "the name that will be displayed on site");
+define("LAN_9", "Login Name: ");
+define("LAN_10", "the name that you use to login");
+define("LAN_17", "Password: ");
+define("LAN_103", "That user name cannot be accepted as valid, please choose a different user name");
+define("LAN_104", "That login name already exists in the database, please choose a different login name");
+define("LAN_105", "The two passwords do not match");
+define("LAN_106", "That doesn't appear to be a valid email address");
+define("LAN_107", "Thankyou! You are now a registered member of");
+define("LAN_108", "Registration complete");
+define("LAN_109", "This site complies with The Children's Online Privacy Protection Act of 1998 (COPPA) and as such cannot accept registrations from users under the age of 13 without a written permission document from their parent or guardian. For more information you can read the legislation");
+define("LAN_110", "Registration");
+define("LAN_111", "Re-type Password: ");
+define("LAN_112", "Email Address: ");
+define("LAN_113", "Hide email address?: ");
+define("LAN_114", "This will prevent your email address from being displayed on site");
+define("LAN_123", "Register");
+define("LAN_185", "You left required field(s) blank");
+define("LAN_201", "Yes");
+define("LAN_200", "No");
+define("LAN_202", "You already have an account. If you have forgotten your password, please click the \'forgot password\' link.");
+define("LAN_309", "Please enter your details below.");
+define("LAN_399", "Continue");
+define("LAN_400", "Usernames and passwords are <b>case-sensitive</b>");
+define("LAN_401", "Your account has now been activated, please");
+define("LAN_402", "Registration activated");
+define("LAN_403", "Welcome to");
+define("LAN_404", "Registration details for");
+define("LAN_405", "This stage of registation is complete. You will receive a confirmation email containing your login details. Please follow the link in the email to complete the signup process and activate your account.");
+define("LAN_406", "Thankyou!");
+define("LAN_407", "Please keep this email for your own information. Your password has been encrypted and cannot be retrieved if you misplace or forget it. You can however request a new password if this happens.\n\nThanks for your registration.\n\nFrom");
+define("LAN_408", "A user with that email address already exists. Please use the 'forgot password' screen to retrieve your password.");
+define("LAN_SIGNUP_1", "Min.");
+define("LAN_SIGNUP_2", "chars.");
+define("LAN_SIGNUP_3", "Code verification failed.");
+define("LAN_SIGNUP_4", "Your password must be at least ");
+define("LAN_SIGNUP_5", " characters long.");
+define("LAN_SIGNUP_6", "Your ");
+define("LAN_SIGNUP_7", " is required");
+define("LAN_SIGNUP_8", "Thankyou!");
+define("LAN_SIGNUP_9", "Unable to proceed.");
+define("LAN_SIGNUP_10", "Yes");
+define("LAN_SIGNUP_11", ".");
+
+define("LAN_409", "Invalid characters in username");
+define("LAN_410", "Enter code visible in the image");
+define("LAN_411", "That display name already exists in the database, please choose a different display name");
+
+
+define("LAN_SIGNUP_12", "please keep your username and password written down in a safe place as if lost they cannot be retrieved.");
+define("LAN_SIGNUP_13", "You can now log in from the Login box, or from <a href='".e_BASE."login.php'>here</a>.");
+define("LAN_SIGNUP_14", "here");
+define("LAN_SIGNUP_15", "Please contact the main site admin");
+define("LAN_SIGNUP_16", "if you require assistance.");
+define("LAN_SIGNUP_17", "Please certify you are 13 or over the age of 13.");
+define("LAN_SIGNUP_18", "Your registration has been received and created with the following login information ...");
+define("LAN_SIGNUP_19", "Username:");
+define("LAN_SIGNUP_20", "Password:");
+define("LAN_SIGNUP_21", "Your account is currently marked as being inactive, to activate your account please go to the following link ...");
+define("LAN_SIGNUP_22", "click here");
+define("LAN_SIGNUP_23", "to login.");
+define("LAN_SIGNUP_24", "Thankyou for registering at");
+define("LAN_SIGNUP_25", "Upload your avatar");
+define("LAN_SIGNUP_26", "Upload your photograph");
+define("LAN_SIGNUP_27", "Show");
+define("LAN_SIGNUP_28", "choice of Content/Mail-lists");
+define("LAN_SIGNUP_29", "A verification email will be sent to the email address you enter here so it must be valid.");
+define("LAN_SIGNUP_30", "If you do not wish to display your email address on this site, please tick the 'hide email address' box.");
+
+define("LAN_SIGNUP_31", "URL to your XUP file");
+define("LAN_SIGNUP_32", "What's an XUP file?");
+define("LAN_SIGNUP_33", "Type path or choose avatar");
+define("LAN_SIGNUP_34", "Please note: Any image uploaded to this server that is deemed inappropriate by the administrators will be deleted immediately.");
+define("LAN_SIGNUP_35", "Click here to register using an XUP file");
+define("LAN_SIGNUP_36", "An error has occured creating your user information, please contact the site admin");
+
+define("LAN_LOGINNAME", "Login Name");
+define("LAN_PASSWORD", "Password");
+define("LAN_USERNAME", "Display Name");
+define("LAN_EMAIL_01", "Dear");
+define("LAN_EMAIL_04", "Please keep this email for your own information.");
+define("LAN_EMAIL_05", "Your password has been encrypted and cannot be retrieved if you misplace or forget it. You can however request a new password if this happens.");
+define("LAN_EMAIL_06", "Thanks for your registration.");
+
+define("LAN_SIGNUP_37", "This stage of registation is complete. The site admin will need to approve your membership.  Once this has been done you will receive a confirmation email alerting you that your membership has been approved.");
+define("LAN_SIGNUP_38", "You entered two different email addresses. Please enter a valid email address in the two fields provided");
+define("LAN_SIGNUP_39", "Re-type Email Address:");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_sitedown.php 75/e107_languages/English/lan_sitedown.php
--- 6171/e107_languages/English/lan_sitedown.php	2004-09-09 21:58:00.000000000 -0500
+++ 75/e107_languages/English/lan_sitedown.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,15 +1,15 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_sitedown.php,v $
-|     $Revision: 1.4 $
-|     $Date: 2004/09/10 02:58:00 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Site temporarily closed");
-define("LAN_00", "is temporarily closed");
-define("LAN_01", "We have temporarily closed the site for some essential maintainance. This shouldn't take too long - please check back soon, apologies for the inconvenience.");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_sitedown.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Site temporarily closed");
+define("LAN_00", "is temporarily closed");
+define("LAN_01", "We have temporarily closed the site for some essential maintainance. This shouldn't take too long - please check back soon, apologies for the inconvenience.");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_sitelinks.php 75/e107_languages/English/lan_sitelinks.php
--- 6171/e107_languages/English/lan_sitelinks.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/lan_sitelinks.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,6 +1,15 @@
-<?php
-
-define("LAN_183", "Main Menu");
-define("LAN_502", "Admin Area");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_sitelinks.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("LAN_183", "Main Menu");
+define("LAN_502", "Admin Area");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_sitemap.php 75/e107_languages/English/lan_sitemap.php
--- 6171/e107_languages/English/lan_sitemap.php	2004-09-09 04:31:42.000000000 -0500
+++ 75/e107_languages/English/lan_sitemap.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,68 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_sitemap.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/09 09:31:42 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Sitemap");
-
-define("LANSM_1", "Sitemap of");
-define("LANSM_2", "Home");
-define("LANSM_3", "(Index Page)");
-define("LANSM_4", "Content");
-define("LANSM_5", "News");
-define("LANSM_6", "(News categories)");
-define("LANSM_7", "Click here to show/hide the full sitemap");
-define("LANSM_8", "Links");
-define("LANSM_9", "(links categories)");
-define("LANSM_10", "Forums");
-define("LANSM_11", "(Forums list)");
-define("LANSM_12", "Downloads");
-define("LANSM_13", "(Downloads categories)");
-define("LANSM_14", "Articles");
-define("LANSM_15", "(Articles categories)");
-define("LANSM_16", "Reviews");
-define("LANSM_17", "(Reviews categories)");
-define("LANSM_18", "Frontpage");
-define("LANSM_19", "Members");
-define("LANSM_20", "Stats");
-define("LANSM_21", "User Settings");
-define("LANSM_22", "Profile");
-define("LANSM_23", "Categories:");
-define("LANSM_24", "Main features");
-define("LANSM_25", "Plugins");
-define("LANSM_26", "Chatbox messages");
-define("LANSM_27", "Headines");
-define("LANSM_28", "Old Polls");
-define("LANSM_29", "Content");
-define("LANSM_30", "(List of content pages)");
-define("LANSM_31", "or click on");
-define("LANSM_32", "List of registred users");
-define("LANSM_33", "(Statistics of this site)");
-define("LANSM_34", "(Info about a member)");
-define("LANSM_35", "(Setup info member)");
-define("LANSM_36", "(Other content pages)");
-define("LANSM_37", "Subcategories:");
-define("LANSM_38", "Pages");
-define("LANSM_39", "(threads/replies");
-define("LANSM_40", "Uncategorized");
-define("LANSM_41", "to expand/hide a subcategory");
-define("LANSM_42", "Chat");
-define("LANSM_43", "(All messages posted in the chatbox menu)");
-define("LANSM_44", "Other pages");
-define("LANSM_45", "Signup");
-define("LANSM_46", "Password forgot?");
-define("LANSM_47", "Search");
-define("LANSM_48", "Submit news");
-define("LANSM_49", "Submit content");
-define("LANSM_50", "Top posters");
-define("LANSM_51", "Submit links");
-define("LANSM_52", "User Posts");
-define("LANSM_53", "(Check comments from a specific users on the site)");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_stats.php 75/e107_languages/English/lan_stats.php
--- 6171/e107_languages/English/lan_stats.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/English/lan_stats.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,29 +0,0 @@
-<?php
-
-define("PAGE_NAME", "Statistics");
-
-define("LAN_124", "Total unique site views: ");
-define("LAN_125", "Total site views: ");
-define("LAN_126", "Unique views by page: ");
-define("LAN_127", "Total views by page: ");
-define("LAN_128", "Browser: ");
-define("LAN_129", "Operating system: ");
-define("LAN_130", "Countries/Domains visited from: ");
-define("LAN_131", "Referers: ");
-define("LAN_132", "Site Statistics");
-define("LAN_371", "Logging is not activated, to activate go to your admin section, click on Logger and tick the Activate Logging/Counter checkbox.");
-define("LAN_372", "The features on this page have been disabled.");
-define("LAN_373", "No stats yet.");
-define("LAN_374", "Logging began:");
-define("LAN_375", "View all");
-define("LAN_376", "Last 10 unique visitors");
-define("LAN_377", "all");
-define("LAN_378", "top 10");
-define("LAN_379", "Screen resolutions");
-define("LAN_418", "days ago");
-define("LAN_419", "Daily average");
-define("LAN_420", "Weekly average");
-define("LAN_421", "Monthly average");
-define("LAN_422", "Not calculable yet");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_subcontent.php 75/e107_languages/English/lan_subcontent.php
--- 6171/e107_languages/English/lan_subcontent.php	2004-05-01 19:36:08.000000000 -0500
+++ 75/e107_languages/English/lan_subcontent.php	2004-10-08 22:32:07.000000000 -0500
@@ -1,43 +1,62 @@
-<?php
-
-define("ARLAN_0", "Thank you, your article has been saved and will be reviewed by a site administrator in due course.");
-define("ARLAN_1", "Fields left blank.");
-define("ARLAN_2", "Thankyou, your review has been saved and will be reviewed by a site administrator in due course.");
-define("ARLAN_15", "Submit Article");
-define("ARLAN_17", "Heading");
-define("ARLAN_18", "Sub-Heading");
-define("ARLAN_19", "Summary");
-define("ARLAN_20", "Article");
-define("ARLAN_21", "Allow comments?");
-define("ARLAN_22", "On");
-define("ARLAN_23", "Off");
-define("ARLAN_24", "Add email/print icons?");
-define("ARLAN_25", "Yes");
-define("ARLAN_26", "No");
-define("ARLAN_27", "Submit Article");
-define("ARLAN_28", "Preview");
-define("ARLAN_55", "Visible to");
-define("ARLAN_73", "Open HTML Editor");
-define("ARLAN_74", "Category");
-define("ARLAN_75", "None");
-define("ARLAN_82", "Author Details");
-define("ARLAN_84", "author name");
-define("ARLAN_85", "author email address");
-define("ARLAN_86", "Review");
-define("ARLAN_87", "Rating");
-define("ARLAN_88", "Please select rating");
-define("ARLAN_89", "Submit Review");
-
-define("ARLAN_90", "Fields left blank, please press the back button in your browser and confirm all fields are filled in.");
-define("ARLAN_91", "Preview again");
-define("ARLAN_92", "Please enter your name/email address");
-
-
-define("ARLAN_93", "article");
-define("ARLAN_94", "review");
-define("ARLAN_95", "User submission of Articles is currently disabled");
-define("ARLAN_96", "User submission of Reviews is currently disabled");
-define("ARLAN_97", "You do not have enough privileges to Submit Articles");
-define("ARLAN_98", "You do not have enough privileges to Submit Reviews");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_subcontent.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2004/10/09 03:32:07 $
+|     $Author: chavo $
++----------------------------------------------------------------------------+
+*/
+define("ARLAN_0", "Thank you, your article has been saved and will be reviewed by a site administrator in due course.");
+define("ARLAN_1", "Fields left blank.");
+define("ARLAN_2", "Thankyou, your review has been saved and will be reviewed by a site administrator in due course.");
+define("ARLAN_15", "Submit Article");
+define("ARLAN_17", "Heading");
+define("ARLAN_18", "Sub-Heading");
+define("ARLAN_19", "Summary");
+define("ARLAN_20", "Article");
+define("ARLAN_21", "Allow comments?");
+define("ARLAN_22", "On");
+define("ARLAN_23", "Off");
+define("ARLAN_24", "Add email/print icons?");
+define("ARLAN_25", "Yes");
+define("ARLAN_26", "No");
+define("ARLAN_27", "Submit Article");
+define("ARLAN_28", "Preview");
+define("ARLAN_55", "Visible to");
+define("ARLAN_73", "Open HTML Editor");
+define("ARLAN_74", "Category");
+define("ARLAN_75", "None");
+define("ARLAN_82", "Author Details");
+define("ARLAN_84", "author name");
+define("ARLAN_85", "author email address");
+define("ARLAN_86", "Review");
+define("ARLAN_87", "Rating");
+define("ARLAN_88", "Please select rating");
+define("ARLAN_89", "Submit Review");
+
+define("ARLAN_90", "Fields left blank, please press the back button in your browser and confirm all fields are filled in.");
+define("ARLAN_91", "Preview again");
+define("ARLAN_92", "Please enter your name/email address");
+
+
+define("ARLAN_93", "article");
+define("ARLAN_94", "review");
+define("ARLAN_95", "User submission of Articles is currently disabled");
+define("ARLAN_96", "User submission of Reviews is currently disabled");
+define("ARLAN_97", "You do not have enough privileges to Submit Articles");
+define("ARLAN_98", "You do not have enough privileges to Submit Reviews");
+
+
+define("ARLAN_99", "What would you like to submit?");
+define("ARLAN_100", "News");
+define("ARLAN_101", " Event");
+define("ARLAN_102", "Article");
+define("ARLAN_103", "Review");
+define("ARLAN_104", "Link");
+define("ARLAN_105", "Download");
+define("ARLAN_106", "Submit Item");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_submitnews.php 75/e107_languages/English/lan_submitnews.php
--- 6171/e107_languages/English/lan_submitnews.php	2004-09-07 05:11:08.000000000 -0500
+++ 75/e107_languages/English/lan_submitnews.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,32 +1,32 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_submitnews.php,v $
-|     $Revision: 1.6 $
-|     $Date: 2004/09/07 10:11:07 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Submit News");
-define("LAN_7", "Login Name: ");
-define("LAN_62", "Subject: ");
-define("LAN_112", "Email Address: ");
-define("LAN_133", "Thankyou");
-define("LAN_134", "Your item has been submitted and will be reviewed by one of the site administrators in due course.");
-define("LAN_135", "News Item: ");
-define("LAN_136", "Submit News Item");
-define("NWSLAN_6", "Category");
-define("NWSLAN_10", "No news categories");
-define("NWSLAN_11", "You don't have access to this area.");
-define("NWSLAN_12", "Access Denied.");
-
-define("SUBNEWSLAN_1", "You must include a title.\\n");
-define("SUBNEWSLAN_2", "You must include some text in the news item.\\n");
-define("SUBNEWSLAN_3", "Your attachment must be either a jpg, gif or png file");
-define("SUBNEWSLAN_4", "File too Large");
-define("SUBNEWSLAN_5", "Image File");
-define("SUBNEWSLAN_6", "(jpg, gif or png)");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_submitnews.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Submit News");
+define("LAN_7", "Login Name: ");
+define("LAN_62", "Subject: ");
+define("LAN_112", "Email Address: ");
+define("LAN_133", "Thankyou");
+define("LAN_134", "Your item has been submitted and will be reviewed by one of the site administrators in due course.");
+define("LAN_135", "News Item: ");
+define("LAN_136", "Submit News Item");
+define("NWSLAN_6", "Category");
+define("NWSLAN_10", "No news categories");
+define("NWSLAN_11", "You don't have access to this area.");
+define("NWSLAN_12", "Access Denied.");
+
+define("SUBNEWSLAN_1", "You must include a title.\\n");
+define("SUBNEWSLAN_2", "You must include some text in the news item.\\n");
+define("SUBNEWSLAN_3", "Your attachment must be either a jpg, gif or png file");
+define("SUBNEWSLAN_4", "File too Large");
+define("SUBNEWSLAN_5", "Image File");
+define("SUBNEWSLAN_6", "(jpg, gif or png)");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_top.php 75/e107_languages/English/lan_top.php
--- 6171/e107_languages/English/lan_top.php	2004-05-22 18:43:26.000000000 -0500
+++ 75/e107_languages/English/lan_top.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,23 +1,32 @@
-<?php
-
-
-define("TOP_LAN_0", "Top Forum Posters");
-define("TOP_LAN_1", "User Name");
-define("TOP_LAN_2", "Posts");
-define("TOP_LAN_3", "Top Comment Posters");
-define("TOP_LAN_4", "Comments");
-define("TOP_LAN_5", "Top Chatbox Posters");
-define("TOP_LAN_6", "Site Rating");
-
-//v.616
-define("LAN_1", "Thread");
-define("LAN_2", "Poster");
-define("LAN_3", "Views");
-define("LAN_4", "Replies");
-define("LAN_5", "Lastpost");
-define("LAN_6", "Threads");
-define("LAN_7", "Most Active Threads");
-define("LAN_8", "Top Posters");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_top.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+define("TOP_LAN_0", "Top Forum Posters");
+define("TOP_LAN_1", "User Name");
+define("TOP_LAN_2", "Posts");
+define("TOP_LAN_3", "Top Comment Posters");
+define("TOP_LAN_4", "Comments");
+define("TOP_LAN_5", "Top Chatbox Posters");
+define("TOP_LAN_6", "Site Rating");
+
+//v.616
+define("LAN_1", "Thread");
+define("LAN_2", "Poster");
+define("LAN_3", "Views");
+define("LAN_4", "Replies");
+define("LAN_5", "Lastpost");
+define("LAN_6", "Threads");
+define("LAN_7", "Most Active Threads");
+define("LAN_8", "Top Posters");
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_upload_handler.php 75/e107_languages/English/lan_upload_handler.php
--- 6171/e107_languages/English/lan_upload_handler.php	2004-08-19 20:01:08.000000000 -0500
+++ 75/e107_languages/English/lan_upload_handler.php	2005-06-05 01:58:21.000000000 -0500
@@ -1,16 +1,25 @@
-<?php
-
-define("LANUPLOAD_1", "The filetype");
-define("LANUPLOAD_2", "is not allowed and has been deleted.");
-define("LANUPLOAD_3", "Successfully uploaded");
-define("LANUPLOAD_4", "Either destination folder does not exist or is not writable.");
-define("LANUPLOAD_5", "The uploaded file exceeds the upload_max_filesize directive in php.ini.");
-define("LANUPLOAD_6", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form.");
-define("LANUPLOAD_7", "The uploaded file was only partially uploaded.");
-define("LANUPLOAD_8", "No file was uploaded.");
-define("LANUPLOAD_9", "Uploaded file size 0 bytes");
-define("LANUPLOAD_10", "Upload failed [Duplicate filename] - A file with the same name already exits.");
-define("LANUPLOAD_11", "The file did not upload. Filename: ");
-define("LANUPLOAD_12", "Error");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_upload_handler.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/06/05 06:58:21 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+define("LANUPLOAD_1", "The filetype");
+define("LANUPLOAD_2", "is not allowed and has been deleted.");
+define("LANUPLOAD_3", "Successfully uploaded");
+define("LANUPLOAD_4", "Either destination folder does not exist or is not writable. (chmod 777)");
+define("LANUPLOAD_5", "The uploaded file exceeds the upload_max_filesize directive in php.ini.");
+define("LANUPLOAD_6", "The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the html form.");
+define("LANUPLOAD_7", "The uploaded file was only partially uploaded.");
+define("LANUPLOAD_8", "No file was uploaded.");
+define("LANUPLOAD_9", "Uploaded file size 0 bytes");
+define("LANUPLOAD_10", "Upload failed [Duplicate filename] - A file with the same name already exits.");
+define("LANUPLOAD_11", "The file did not upload. Filename: ");
+define("LANUPLOAD_12", "Error");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_upload.php 75/e107_languages/English/lan_upload.php
--- 6171/e107_languages/English/lan_upload.php	2004-09-09 21:58:00.000000000 -0500
+++ 75/e107_languages/English/lan_upload.php	2004-09-21 14:11:56.000000000 -0500
@@ -1,41 +1,41 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system - Language File.
-|
-|     $Source: /cvsroot/e107/e107/e107_languages/English/lan_upload.php,v $
-|     $Revision: 1.6 $
-|     $Date: 2004/09/10 02:58:00 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-define("PAGE_NAME", "Upload");
-
-define("LAN_20", "Error");
-define("LAN_61", "Your Name: ");
-define("LAN_112", "Email Address: ");
-define("LAN_144", "Website URL: ");
-define("LAN_402", "You must be a registered member to upload files to this server.");
-define("LAN_403", "You do not have the correct permissions to upload files to this server.");
-define("LAN_404", "Thank you. Your upload will be reviewed by an administrator and posted to the site if appropriate.");
-define("LAN_405", "File exceeds specified maximum size limit - deleted.");
-define("LAN_406", "Please note");
-define("LAN_407", "Any other filetypes uploaded will be instantly deleted.");
-define("LAN_408", "Underlined");
-define("LAN_409", "Name of file");
-define("LAN_410", "Version");
-define("LAN_411", "File");
-define("LAN_412", "Screenshot");
-define("LAN_413", "Description");
-define("LAN_414", "Working demo");
-define("LAN_415", "enter URL to site where demo can be viewed");
-define("LAN_416", "Submit and Upload");
-define("LAN_417", "Upload File");
-define("LAN_418", "Maximum file size: ");
-define("DOWLAN_11", "Category");
-define("LAN_419", "Allowed filetypes");
-define("LAN_420", "fields are required");
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_upload.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2004/09/21 19:11:56 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Upload");
+
+define("LAN_20", "Error");
+define("LAN_61", "Your Name: ");
+define("LAN_112", "Email Address: ");
+define("LAN_144", "Website URL: ");
+define("LAN_402", "You must be a registered member to upload files to this server.");
+define("LAN_403", "You do not have the correct permissions to upload files to this server.");
+define("LAN_404", "Thank you. Your upload will be reviewed by an administrator and posted to the site if appropriate.");
+define("LAN_405", "File exceeds specified maximum size limit - deleted.");
+define("LAN_406", "Please note");
+define("LAN_407", "Any other filetypes uploaded will be instantly deleted.");
+define("LAN_408", "Underlined");
+define("LAN_409", "Name of file");
+define("LAN_410", "Version");
+define("LAN_411", "File");
+define("LAN_412", "Screenshot");
+define("LAN_413", "Description");
+define("LAN_414", "Working demo");
+define("LAN_415", "enter URL to site where demo can be viewed");
+define("LAN_416", "Submit and Upload");
+define("LAN_417", "Upload File");
+define("LAN_418", "Maximum file size: ");
+define("DOWLAN_11", "Category");
+define("LAN_419", "Allowed filetypes");
+define("LAN_420", "fields are required");
+
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_userclass.php 75/e107_languages/English/lan_userclass.php
--- 6171/e107_languages/English/lan_userclass.php	2004-03-15 21:36:52.000000000 -0600
+++ 75/e107_languages/English/lan_userclass.php	2005-05-12 20:03:35.000000000 -0500
@@ -1,8 +1,18 @@
-<?php
-define("UC_LAN_0", "Everyone (public)");
-define("UC_LAN_1", "Guest Only");
-define("UC_LAN_2", "No One (inactive)");
-define("UC_LAN_3", "Members Only");
-define("UC_LAN_4", "Read Only");
-define("UC_LAN_5", "Admin Only");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_userclass.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/05/13 01:03:35 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("UC_LAN_0", "Everyone (public)");
+define("UC_LAN_1", "Guests");
+define("UC_LAN_2", "No One (inactive)");
+define("UC_LAN_3", "Members");
+define("UC_LAN_4", "Read Only");
+define("UC_LAN_5", "Admin");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_user_extended.php 75/e107_languages/English/lan_user_extended.php
--- 6171/e107_languages/English/lan_user_extended.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_user_extended.php	2006-04-29 01:45:38.000000000 -0500
@@ -0,0 +1,46 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_user_extended.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2006/04/29 06:45:38 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("UE_LAN_1", "Text Box");
+define("UE_LAN_2", "Radio Buttons");
+define("UE_LAN_3", "Drop-Down Menu");
+define("UE_LAN_4", "DB Table Field");
+define("UE_LAN_5", "Textarea");
+define("UE_LAN_6", "Integer");
+define("UE_LAN_7", "Date");
+define("UE_LAN_8", "Language");
+
+define("UE_LAN_9", "Name");
+define("UE_LAN_10", "Type");
+define("UE_LAN_11", "Use");
+
+define("UE_LAN_HIDE", "Hide from users");
+
+define("UE_LAN_LOCATION", "Location");
+define("UE_LAN_LOCATION_DESC", "User location");
+define("UE_LAN_AIM", "AIM Address");
+define("UE_LAN_AIM_DESC", "AIM Address");
+define("UE_LAN_ICQ", "ICQ Number");
+define("UE_LAN_ICQ_DESC", "ICQ Number");
+define("UE_LAN_YAHOO", "Yahoo! Address");
+define("UE_LAN_YAHOO_DESC", "Yahoo! Address");
+define("UE_LAN_MSN", "MSN");
+define("UE_LAN_MSN_DESC", "MSN Address");
+define("UE_LAN_HOMEPAGE", "Homepage");
+define("UE_LAN_HOMEPAGE_DESC", "User homepage (url)");
+define("UE_LAN_BIRTHDAY", "Birthday");
+define("UE_LAN_BIRTHDAY_DESC", "Birthday");
+define("UE_LAN_LANGUAGE", "Language");
+define("UE_LAN_LANGUAGE_DESC", "User Language");
+define("UE_LAN_COUNTRY", "Country");
+define("UE_LAN_COUNTRY_DESC", "User Country (includes db table)");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_user.php 75/e107_languages/English/lan_user.php
--- 6171/e107_languages/English/lan_user.php	2004-05-27 01:46:52.000000000 -0500
+++ 75/e107_languages/English/lan_user.php	2005-04-05 22:53:00.000000000 -0500
@@ -1,58 +1,66 @@
-<?php
-
-define("PAGE_NAME", "Members");
-
-define("LAN_20", "Error");
-define("LAN_112", "Email Address");
-define("LAN_115", "ICQ Number");
-define("LAN_116", "AIM Address");
-define("LAN_117", "MSN Messenger");
-define("LAN_118", "Birthday");
-define("LAN_119", "Location");
-define("LAN_120", "Signature");
-define("LAN_137", "There is no information for that user as they are not registered at");
-define("LAN_138", "Registered members: ");
-define("LAN_139", "Order: ");
-define("LAN_140", "Registered members");
-define("LAN_141", "No registered members yet.");
-define("LAN_142", "Member");
-define("LAN_143", "[hidden by request]");
-define("LAN_144", "Website URL");
-define("LAN_145", "Joined");
-define("LAN_146", "Visits to site since registration");
-define("LAN_147", "Chatbox posts");
-define("LAN_148", "Comments posted");
-define("LAN_149", "Forum posts");
-define("LAN_308", "Real Name");
-define("LAN_400", "That is not a valid user.");
-define("LAN_401", "no information");
-define("LAN_402", "Member Profile");
-define("LAN_403", "Site Stats");
-define("LAN_404", "Last visited site");
-define("LAN_405", "days ago");
-define("LAN_406", "Rating");
-define("LAN_407", "none");
-define("LAN_408", "no photo");
-define("LAN_409", "points");
-define("LAN_410", "Miscellaneous");
-define("LAN_411", "Click here to update your information");
-define("LAN_412", "Click here to edit this user's information");
-define("LAN_413", "delete photo");
-define("LAN_414", "previous member");
-define("LAN_415", "next member");
-define("LAN_416", "You must be logged in to access this page");
-define("LAN_417", "Main site administrator");
-define("LAN_418", "Site administrator");
-
-define("LAN_419", "Show");
-define("LAN_420", "DESC");
-define("LAN_421", "ASC");
-define("LAN_422", "Go");
-define("LAN_423", "Click here to View User Comments");
-define("LAN_424", "Click here to View Forum Posts");
-
-
-define("LAN_425", "Send Private Message");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_user.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/04/06 03:53:00 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Members");
+
+define("LAN_20", "Error");
+define("LAN_112", "Email Address");
+define("LAN_115", "ICQ Number");
+define("LAN_116", "AIM Address");
+define("LAN_117", "MSN Messenger");
+define("LAN_118", "Birthday");
+define("LAN_119", "Location");
+define("LAN_120", "Signature");
+define("LAN_137", "There is no information for that user as they are not registered at");
+define("LAN_138", "Registered members: ");
+define("LAN_139", "Order: ");
+define("LAN_140", "Registered members");
+define("LAN_141", "No registered members yet.");
+define("LAN_142", "Member");
+define("LAN_143", "[hidden by request]");
+define("LAN_144", "Website URL");
+define("LAN_145", "Joined");
+define("LAN_146", "Visits to site since registration");
+define("LAN_147", "Chatbox posts");
+define("LAN_148", "Comments posted");
+define("LAN_149", "Forum posts");
+define("LAN_308", "Real Name");
+define("LAN_400", "That is not a valid user.");
+define("LAN_401", "no information");
+define("LAN_402", "Member Profile");
+define("LAN_403", "Site Stats");
+define("LAN_404", "Last visit");
+define("LAN_405", "days ago");
+define("LAN_406", "Rating");
+define("LAN_407", "none");
+define("LAN_408", "no photo");
+define("LAN_409", "points");
+define("LAN_410", "Miscellaneous");
+define("LAN_411", "Click here to update your information");
+define("LAN_412", "Click here to edit this user's information");
+define("LAN_413", "delete photo");
+define("LAN_414", "previous member");
+define("LAN_415", "next member");
+define("LAN_416", "You must be logged in to access this page");
+define("LAN_417", "Main site administrator");
+define("LAN_418", "Site administrator");
+define("LAN_419", "Show");
+define("LAN_420", "DESC");
+define("LAN_421", "ASC");
+define("LAN_422", "Go");
+define("LAN_423", "Click here to View User Comments");
+define("LAN_424", "Click here to View Forum Posts");
+define("LAN_425", "Send Private Message");
+define("LAN_426", "ago");
+
+define("USERLAN_1", "Peer Rating");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_userposts.php 75/e107_languages/English/lan_userposts.php
--- 6171/e107_languages/English/lan_userposts.php	2004-04-01 17:07:06.000000000 -0600
+++ 75/e107_languages/English/lan_userposts.php	2005-11-30 13:36:50.000000000 -0600
@@ -1,18 +1,31 @@
-<?php
-
-define("PAGE_NAME", "User Posts"); 
-
-define("UP_LAN_0", "All Forum Posts for ");
-define("UP_LAN_1", "All Comments for ");
-define("UP_LAN_2", "Thread");
-define("UP_LAN_3", "Views");
-define("UP_LAN_4", "Replies");
-define("UP_LAN_5", "Lastpost");
-define("UP_LAN_6", "Threads");
-define("UP_LAN_7", "No Comments");
-define("UP_LAN_8", "No Posts");
-define("UP_LAN_9", " on ");
-define("UP_LAN_10", "Re");
-define("UP_LAN_11", "Posted on: ");
-define("UP_LAN_12", "Search");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_userposts.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/11/30 19:36:50 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "User Posts");
+
+define("UP_LAN_0", "All Forum Posts for ");
+define("UP_LAN_1", "All Comments for ");
+define("UP_LAN_2", "Thread");
+define("UP_LAN_3", "Views");
+define("UP_LAN_4", "Replies");
+define("UP_LAN_5", "Lastpost");
+define("UP_LAN_6", "Threads");
+define("UP_LAN_7", "No Comments");
+define("UP_LAN_8", "No Posts");
+define("UP_LAN_9", " on ");
+define("UP_LAN_10", "Re");
+define("UP_LAN_11", "Posted on");
+define("UP_LAN_12", "Search");
+define("UP_LAN_13", "Comments");
+define("UP_LAN_14", "Forum Posts");
+define("UP_LAN_15", "Re");
+define("UP_LAN_16", "IP Address");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_user_select.php 75/e107_languages/English/lan_user_select.php
--- 6171/e107_languages/English/lan_user_select.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_languages/English/lan_user_select.php	2005-12-09 14:59:02.000000000 -0600
@@ -0,0 +1,18 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_user_select.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/09 20:59:02 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("US_LAN_1", "Select user");
+define("US_LAN_2", "Select user class");
+define("US_LAN_3", "All users");
+define("US_LAN_4", "Find username");
+define("US_LAN_5", "User(s) found");
+define("US_LAN_6", "Search");
+?>
\ No newline at end of file
diff -ruN 6171/e107_languages/English/lan_usersettings.php 75/e107_languages/English/lan_usersettings.php
--- 6171/e107_languages/English/lan_usersettings.php	2004-06-17 19:50:20.000000000 -0500
+++ 75/e107_languages/English/lan_usersettings.php	2005-12-29 14:00:56.000000000 -0600
@@ -1,83 +1,110 @@
-<?php
-
-define("PAGE_NAME", "User Settings");
-
-define("LAN_7", "Login Name: ");
-define("LAN_20", "Error");
-define("LAN_105", "The two passwords do not match");
-define("LAN_106", "That doesn't appear to be a valid email address");
-define("LAN_112", "Email Address: ");
-define("LAN_113", "Hide email address?: ");
-define("LAN_114", "This will prevent your email address from being displayed on site");
-define("LAN_115", "ICQ Number: ");
-define("LAN_116", "AIM Address: ");
-define("LAN_117", "MSN Messenger: ");
-define("LAN_118", "Birthday: ");
-define("LAN_119", "Location: ");
-define("LAN_120", "Signature: ");
-define("LAN_121", "Avatar: ");
-define("LAN_122", "Timezone:");
-define("LAN_144", "Website URL: ");
-define("LAN_150", "Settings updated and saved into database.");
-define("LAN_151", "OK");
-define("LAN_152", "New Password: ");
-define("LAN_153", "Re-type New Password: ");
-define("LAN_154", "Save Settings");
-define("LAN_155", "Update User Settings");
-define("LAN_185", "You left the password field blank ");
-define("LAN_308", "Real Name: ");
-define("LAN_401", "Leave blank to keep existing password");
-define("LAN_402", "Type path or choose avatar");
-define("LAN_403", "Choose avatar");
-define("LAN_404", "Please note: Any image uploaded to this server which is deemed inappropriate by the administrators will be deleted immediately.");
-
-define("LAN_410", "Settings for");
-define("LAN_411", "Update Your Settings");
-define("LAN_412", "Change Your Password");
-define("LAN_413", "Choose An Avatar");
-define("LAN_414", "Upload Your Photograph");
-define("LAN_415", "Upload your Avatar");
-
-define("LAN_416", "Yes");
-define("LAN_417", "No");
-
-define("LAN_418", "Registration Information");
-define("LAN_419", "Personal / Contact Information");
-define("LAN_420", "Avatar");
-define("LAN_421", "Choose site-stored avatar");
-define("LAN_422", "Use remote avatar");
-define("LAN_423", "Please type full address to image");
-define("LAN_424", "Click button to see avatars stored on this site");
-define("LAN_425", "Photograph");
-define("LAN_426", "This will be shown on your profile page");
-define("LAN_427", "Submit ...");
-define("LAN_428", "News Item");
-define("LAN_429", "Link");
-define("LAN_430", "Download");
-define("LAN_431", "Article");
-define("LAN_432", "Review");
-
-define("LAN_SIGNUP_1", "Min.");
-define("LAN_SIGNUP_2", "chars.");
-define("LAN_SIGNUP_4", "Your password must be at least ");
-define("LAN_SIGNUP_5", " characters long.");
-define("LAN_SIGNUP_6", "Your ");
-define("LAN_SIGNUP_7", " is required");
-
-define("LAN_USET_1", "Your avatar width is too large");
-define("LAN_USET_2", "Maximum allowable width is");
-define("LAN_USET_3", "Your avatar height is too large");
-define("LAN_USET_4", "Maximum allowable height is");
-
-// v.616
-define("LAN_CUSTOMTITLE", "Custom Title");
-define("LAN_ICQNUMBER", "ICQ number must contain only numbers");
-
-//v.617
-define("LAN_408", "A user with that email address already exists. ");
-define("MAX_AVWIDTH", "Maximum avatar width is ");
-define("MAX_AVHEIGHT", "Maximum avatar height is ");
-define("GIF_RESIZE", "Please resize gif image or convert to different format");
-define("RESIZE_NOT_SUPPORTED", "Resize method not supported by this server. Please resize image or choose another. File has been deleted.");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_languages/English/lan_usersettings.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/29 20:00:56 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "User Settings");
+
+define("LAN_7", "Display Name: ");
+define("LAN_8", "the name displayed on site");
+define("LAN_9", "Login Name: ");
+define("LAN_10", "the name you use to login to the site");
+define("LAN_11", "the name you use to login to the site - this cannot be changed, please contact an administrator if it needs to be changed for security purposes");
+
+define("LAN_20", "Error");
+define("LAN_105", "The two passwords do not match");
+define("LAN_106", "That doesn't appear to be a valid email address");
+define("LAN_112", "Email Address: ");
+define("LAN_113", "Hide email address?: ");
+define("LAN_114", "This will prevent your email address from being displayed on site");
+define("LAN_115", "ICQ Number: ");
+define("LAN_116", "AIM Address: ");
+define("LAN_117", "MSN Messenger: ");
+define("LAN_118", "Birthday: ");
+define("LAN_119", "Location: ");
+define("LAN_120", "Signature: ");
+define("LAN_121", "Avatar: ");
+define("LAN_122", "Timezone:");
+define("LAN_144", "Website URL: ");
+define("LAN_150", "Settings updated and saved into database.");
+define("LAN_151", "OK");
+define("LAN_152", "New Password: ");
+define("LAN_153", "Re-type New Password: ");
+define("LAN_154", "Save Settings");
+define("LAN_155", "Update User Settings");
+define("LAN_185", "You left the password field blank ");
+define("LAN_308", "Real Name: ");
+define("LAN_401", "Leave blank to keep existing password");
+define("LAN_402", "Type path or choose avatar");
+define("LAN_403", "Choose avatar");
+define("LAN_404", "Please note: Any image uploaded to this server that is deemed inappropriate by the administrators will be deleted immediately.");
+
+define("LAN_410", "Settings for");
+define("LAN_411", "Update Your Settings");
+define("LAN_412", "Change Your Password");
+define("LAN_413", "Choose An Avatar");
+define("LAN_414", "Upload Your Photograph");
+define("LAN_415", "Upload your Avatar");
+
+define("LAN_416", "Yes");
+define("LAN_417", "No");
+
+define("LAN_418", "Registration Information");
+define("LAN_419", "Personal / Contact Information");
+define("LAN_420", "Avatar");
+define("LAN_421", "Choose site-stored avatar");
+define("LAN_422", "Use remote avatar");
+define("LAN_423", "Please type full address to image");
+define("LAN_424", "Click button to see avatars stored on this site");
+define("LAN_425", "Photograph");
+define("LAN_426", "This will be shown on your profile page");
+define("LAN_427", "Submit ...");
+define("LAN_428", "News Item");
+define("LAN_429", "Link");
+define("LAN_430", "Download");
+define("LAN_431", "Article");
+define("LAN_432", "Review");
+
+define("LAN_433", "URL to your XUP file");
+define("LAN_434", "what's this?");
+define("LAN_435", "XML User Protocol file");
+
+define("LAN_SIGNUP_1", "Min.");
+define("LAN_SIGNUP_2", "chars.");
+define("LAN_SIGNUP_4", "Your password must be at least ");
+define("LAN_SIGNUP_5", " characters long.");
+define("LAN_SIGNUP_6", "Your ");
+define("LAN_SIGNUP_7", " is required");
+
+define("LAN_USET_1", "Your avatar is too wide");
+define("LAN_USET_2", "Maximum allowable width is");
+define("LAN_USET_3", "Your avatar is too high");
+define("LAN_USET_4", "Maximum allowable height is");
+
+// v.616
+define("LAN_CUSTOMTITLE", "Custom Title");
+define("LAN_ICQNUMBER", "ICQ number must contain only numbers");
+
+//v.617
+define("LAN_408", "A user with that email address already exists. ");
+define("MAX_AVWIDTH", "Maximum avatar size (wxh) is ");
+define("MAX_AVHEIGHT", " x ");
+define("GIF_RESIZE", "Please resize gif image or convert to different format");
+define("RESIZE_NOT_SUPPORTED", "Resize method not supported by this server. Please resize image or choose another. File has been deleted.");
+
+// v0.7
+define("LAN_USET_5", "Subscribed to");
+define("LAN_USET_6", "Subscribe to our mailing-list(s) and/or sections of this site.");
+define("LAN_USET_7", "Miscellaneous");
+define("LAN_USET_8", "Signature / Timezone");
+define("LAN_USET_9", "Some of the required fields (marked with a *) are missing from your settings.");
+define("LAN_USET_10","Please update your settings now, in order to proceed.");
+define("LAN_USET_11", "That user name cannot be accepted as valid, please choose a different user name");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_languages/Finnish/lan_install.php 75/e107_languages/Finnish/lan_install.php
--- 6171/e107_languages/Finnish/lan_install.php	2004-09-09 21:58:10.000000000 -0500
+++ 75/e107_languages/Finnish/lan_install.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,82 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        lan_install.php Finnish language file
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("INSLAN1", "Asennusvaihe-cool");
-define("INSLAN2", "PHP / mySQL -versioiden sek&auml; tiedosto-oikeuksien tarkistus");
-define("INSLAN3", "PHP-versio");
-define("INSLAN4", "Hyl&auml;tty");
-define("INSLAN5", "&lt;b&gt;K&auml;ytt&auml;m&auml;si PHP:n versio ei ole yhteensopiva e107:n kanssa.&lt;br /&gt;(e107 vaatii v&auml;hint&auml;&auml;n version 4.1.0).&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Jos k&auml;yt&auml;t paikallista palvelinta omalla koneellasi, sinun t&auml;ytyy p&auml;ivitt&auml;&auml;&lt;br /&gt;PHP uudempaan versioon jatkaaksesi, lis&auml;ohjeita l&ouml;yd&auml;t &lt;a href=\'http://php.net\'&gt;php.net&lt;/a&gt;:st&auml;. Mik&auml;li yrit&auml;t&lt;br /&gt;asentaa e107:n muulle palvelimelle, ota yhteytt&auml;&lt;br /&gt;palvelimen yll&auml;pit&auml;j&auml;&auml;n ja pyyd&auml; heit&auml; p&auml;ivitt&auml;m&auml;&auml;n PHP.&lt;br /&gt;Aja t&auml;m&auml; skripti uudelleen PHP:n p&auml;ivityksen j&auml;lkeen.");
-define("INSLAN6", "Skripti pys&auml;ytetty.");
-define("INSLAN7", "Hyv&auml;ksytty");
-define("INSLAN8", "mySQL-versio");
-define("INSLAN9", "&lt;b&gt;e107 ei kyennyt m&auml;&auml;ritt&auml;m&auml;&auml;n MySQL:n versiota.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;T&auml;m&auml; voi tarkoittaa ett&auml; MySQL ei ole asennettu, se ei ole k&auml;ynniss&auml; tai&lt;br /&gt;k&auml;ytt&auml;m&auml;si versio ei ilmoita oikein versionumeroaan&lt;br /&gt;(tunnettu ongelma versiossa v5.x ). Jos asennuksen seuraava vaihe ep&auml;onnistuu,&lt;br /&gt;tarkista MySQL-tilanne.");
-define("INSLAN10", "Tiedostojen oikeudet");
-define("INSLAN11", "kirjoitus estetty");
-define("INSLAN12", "hakemistoihin kirjoitus estetty");
-define("INSLAN13", "Ole hyv&auml; ja varmista ett&auml; yll&auml;mainittujen kirjoitusoikeudet on asetettu&lt;br /&gt;oikein palvelimellasi. Oikeuksien pit&auml;isi olla 777. &lt;br /&gt;Muuttaaksesi oikeudet, klikkaa tiedostoa oikealla napilla FTP-ohjelmassasi ja valitse Chmod tai&lt;br /&gt;Set File Permissions, avautuvaan ikkunaan sy&ouml;t&auml; 777 tai jos valittavana on vain rasteja,&lt;br /&gt;rastita kaikki.&lt;br /&gt;&lt;br /&gt;Suorita testi uudestaan muutettuasi oikeudet.");
-define("INSLAN14", "e107 asentuu");
-define("INSLAN15", "KRIITTINEN VIRHE");
-define("INSLAN16", "Vaikka MySQL:n versiom&auml;&auml;ritys ei onnistunut, jatka seuraavaan vaiheeseen.");
-define("INSLAN17", "Jatka");
-define("INSLAN18", "Testaa tiedosto-oikeudet uudestaan");
-define("INSLAN19", "Kaikki palvelintestit suoritettu hyv&auml;ksytysti, klikkaa nappia jatkaaksesi");
-define("INSLAN20", "mySQL info");
-define("INSLAN21", "Sy&ouml;t&auml; MySQL asetuksesi t&auml;h&auml;n.&lt;br /&gt;Jos sinulla on root-oikeudet, voit luoda uuden tietokannan valitsemalla oikean rastin. Jos et ole,&lt;br /&gt;sinun t&auml;ytyy luoda tietokanta tai k&auml;ytt&auml;&auml; vanhaa kantaa. &lt;br /&gt;Jos sinulla on vain yksi tietokanta k&auml;yt&ouml;ss&auml;si, valitse etuliite jotta muutkin skriptit voivat k&auml;ytt&auml;&auml; samaa kantaa.&lt;br /&gt;Jos et tied&auml; MySQL tietojasi, ota yhteys palveluntarjoajaasi.");
-define("INSLAN22", "MySQL-palvelin");
-define("INSLAN23", "MySQL-k&auml;ytt&auml;j&auml;tunnus");
-define("INSLAN24", "MySQL-salasana");
-define("INSLAN25", "MySQL-tietokanta");
-define("INSLAN26", "Tiedostojen etuliite");
-define("INSLAN27", "Virhe");
-define("INSLAN28", "Tapahtui virhe");
-define("INSLAN29", "J&auml;tit vaaditun kent&auml;n tyhj&auml;ksi, sy&ouml;t&auml; MySQL-tietosi uudelleen");
-define("INSLAN30", "e107 ei saanut yhteytt&auml; MySQL-palvelimeen antamillasi tiedoilla.&lt;br /&gt;Ole hyv&auml; ja palaa edelliselle sivulle tarkistamaan ovatko sy&ouml;tt&auml;m&auml;si tiedot oikein.");
-define("INSLAN31", "MySQL-tarkistus");
-define("INSLAN32", "Yhteys MySQL-palvelimeen saatu ja varmistettu.");
-define("INSLAN33", "Yritet&auml;&auml;n luoda tietokanta");
-define("INSLAN34", "Tietokannan luonti ep&auml;onnistui, varmista ett&auml; sinulla on oikeudet tietokannan luomiseen palvelimella.");
-define("INSLAN35", "Tietokanta luotu.");
-define("INSLAN36", "Klikkaa nappia jatkaaksesi.");
-define("INSLAN37", "Edelliselle sivulle");
-define("INSLAN38", "Yll&auml;pit&auml;j&auml;n tiedot");
-define("INSLAN39", "Sy&ouml;t&auml; yll&auml;pit&auml;j&auml;n tunnus, salasana ja s&auml;hk&ouml;posti.&lt;br /&gt;N&auml;it&auml; tietoja tarvitaan sivuston yll&auml;pitoalueelle p&auml;&auml;semiseen.&lt;br /&gt;Pid&auml; tunnus ja salasana turvassa, sill&auml; niit&auml; ei voida palauttaa mik&auml;li unohdat ne.");
-define("INSLAN40", "Yll&auml;pit&auml;j&auml;n tunnus");
-define("INSLAN41", "Yll&auml;pit&auml;j&auml;n salasana");
-define("INSLAN42", "Vahvista salasana");
-define("INSLAN43", "Yll&auml;pit&auml;j&auml;n s&auml;hk&ouml;posti");
-define("INSLAN44", "J&auml;tit vaaditun kent&auml;n tyhj&auml;ksi, sy&ouml;t&auml; tiedot uudelleen.");
-define("INSLAN45", "Salasanat eiv&auml;t olleet samoja, sy&ouml;t&auml; tiedot uudelleen.");
-define("INSLAN46", "ei ole oikea s&auml;hk&ouml;postiosoite, sy&ouml;t&auml; tiedot uudelleen.");
-define("INSLAN47", "Kaikki valmista!");
-define("INSLAN48", "e107 on nyt ker&auml;nnyt tarvittavat tiedot asennuksen loppuunviemiseksi.&lt;br /&gt;Klikkaa nappia luodaksesi taulut tietokantaan ja tallentaaksesi asetukset.");
-define("INSLAN49", "Asetusten tallentaminen palvelimelle ei onnistunut.&lt;br /&gt;Varmista ett&auml; tiedostolla &lt;b&gt;e107_config.php&lt;/b&gt; on oikeat oikeudet");
-define("INSLAN50", "Asennus valmis!");
-define("INSLAN51", "Kaikki tehty");
-define("INSLAN52", "e107 on onnistuneesti asennettu!&lt;br /&gt;Tietoturvasyist&auml; muuta tiedoston &lt;br /&gt;&lt;b&gt;e107_config.php&lt;/b&gt; oikeudet takaisin 644.&lt;br /&gt;Poista my&ouml;s tiedosto /install.php palvelimeltasi kun olet painanut allaolevaa nappia");
-define("INSLAN53", "Klikkaa t&auml;st&auml; menn&auml;ksesi uudelle webbisivullesi!");
-define("INSLAN54", "Sql-tiedoston luku ep&auml;onnistui&lt;br /&gt;&lt;br /&gt;Tarkista ett&auml; tiedosto &lt;b&gt;core_sql.php&lt;/b&gt; on &lt;b&gt;/e107_admin/sql&lt;/b&gt; hakemistossa.");
-define("INSLAN55", "e107 ei onnistunut luomaan kaikkia tietokannan tauluja.&lt;br /&gt;Puhdista tietokanta ja korjaa mahdolliset ongelmat ennenkuin yrit&auml;t uudelleen.");
-define("INSLAN56", "Tervetuloa uudelle webbisivullesi!");
-define("INSLAN57", "e107 on asennettu onnistuneesti ja on valmis sis&auml;ll&ouml;n vastaanottamiseen.&lt;br /&gt;Yll&auml;pitoalueesi l&ouml;ytyy &lt;a href=\'e107_admin/admin.php\'&gt;t&auml;&auml;lt&auml;&lt;/a&gt;, klikkaa menn&auml;ksesi sinne nyt. Sinun t&auml;ytyy loggautua samoilla tunnuksilla jotka annoit asennusvaiheessa.");
-define("INSLAN58", "UKK ja ohjeet l&ouml;ytyv&auml;t t&auml;&auml;lt&auml;.");
-define("INSLAN59", "Kiitos kun kokeilet e107:aa, Toivomme ett&auml; se t&auml;ytt&auml;&auml; tarpeesi.n(Voit poistaa t&auml;m&auml;n viestin yll&auml;pitoalueelta.)");
-define("INSLAN60", "rastita luodaksesi");
-define("INSLAN61", "hakemisto");
-define("INSLAN62", "tai");
-define("INSLAN63", "Tiedosto-oikeusvirhe");
-define("INSLAN64", "T&auml;m&auml;n tiedoston loi asennusskripti.");
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/French/lan_install.php 75/e107_languages/French/lan_install.php
--- 6171/e107_languages/French/lan_install.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/French/lan_install.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,77 +0,0 @@
-<?php
-
-/*
-French Translation File
-Author: marj
-Email: mar.j@free.fr
-*/
-
-define("INSLAN1", "Phase d\'Installation");
-define("INSLAN2", "PHP / mySQL vrification de version / vrification des permissions fichiers");
-define("INSLAN3", "Version PHP");
-define("INSLAN4", "chou");
-define("INSLAN5", "<b>Votre version PHP n\'est pas compatible avec e107<br />(e107 ncessite au moins la version 4.1.0).</b><br /><br />Si vous utilisez un serveur local sur votre ordinateur vous devrez mettre  jour votre<br />version de PHP pour continuer. Voyez <a href='http://php.net'>php.net</a> pour les instructions. Si vous tentez <br />d\'install e107 sur serveur distant vous devrez contacter les<br />administrateurs et leur demander de mettre PHP  jour pour vous.<br />Relancez ce script une fois la mise  jour effectue.");
-define("INSLAN6", "Script arrt.");
-define("INSLAN7", "Pass");
-define("INSLAN8", "Version mySQL");
-define("INSLAN9", "<b>e107 n\'a pas pu dterminer le numro de votre version mySQL.</b><br /><br /> Ceci peut signifier que mySQL n\'est pas install ou non en cours d\'excution, ou<br />vous utulisez peut tre une version dont le numro n\'est pas correctement restitu<br />(v5.x sont connues pour avoir ce genre de problme). Si la prochaine tape de l\'installation<br />choue vous devrez vrifier les status mySQL.");
-define("INSLAN10", "Permissions Fichiers");
-define("INSLAN11", "n\'est pas accesible en criture");
-define("INSLAN12", "le rpertoire n\'est pas accesible en criture");
-define("INSLAN13", "Assurez vous que les permissions pour  les fichiers ci-dessus sont positionnes<br />correctemment sur votre serveur, les permissions doivent tre misent  777. Pour positionner les<br />permissions, cliquez le bouton droit sur le fichier situ dans votre client FTP et choisissez Chmod ou<br />Set File Permissions, puis entrez 777, si la boite de dialogue comporte des cases  cocher<br />alors cochez toutes les cases.<br /><br />Retestez aprs la configuration des permissions fichiers.");
-define("INSLAN14", "Installation de e107");
-define("INSLAN15", "ERREUR FATALE");
-define("INSLAN16", "Bien quil ne soit pas possible de dterminer les status de votre mySQL,<br />continuez  l\'tape suivante.");
-define("INSLAN17", "Continuer");
-define("INSLAN18", "Retester les Permissions Fichiers");
-define("INSLAN19", "Tous les tests serveurs ont aboutis avec succs, cliquez sur le bouton afin de procder  la phase suivante");
-define("INSLAN20", "information mySQL");
-define("INSLAN21", "Entrez vos paramtres mySQL ici.<br />Si vous avez les permissions root vous pouvez crer une nouvelle base de donnes en cochant la case, sinon vous devez<br />crer une base de donnes ou en utliser une pr-existante. <br />Si vous n\'avez qu\'une seule base de donnes utilis un prfixe afin que les autres scripts partagent la mme base.<br />Si vous ne connaissez pas les dtails de votre mySQL contactez votre fournisseur d\'accs.");
-define("INSLAN22", "Serveur mySQL");
-define("INSLAN23", "Nom Utilisateur mySQL");
-define("INSLAN24", "Mot de Passe mySQL");
-define("INSLAN25", "Base de Donnes mySQL");
-define("INSLAN26", "Prfixe de Table");
-define("INSLAN27", "Erreur");
-define("INSLAN28", "Erreur rencontre");
-define("INSLAN29", "Vous avez laissez des champs ncessaires en blanc. R-entrez les informations mySQL");
-define("INSLAN30", "e107 n\'a pas pus tablir la connection avec mySQL en utilisant les informations que vous avez fourni.<br />Retournez  la dernire page et assurez vous queles informations sont correctes.");
-define("INSLAN31", "vrification de mySQL");
-define("INSLAN32", "Connection  mySQL tabliee et vrifie.");
-define("INSLAN33", "Cration de la base de donne");
-define("INSLAN34", "Impossible de crer la base de donne, assurez vous que vous avez les permissions de cration de bases sur votre serveur.");
-define("INSLAN35", "La base de donne  t cre avec succs.");
-define("INSLAN36", "Cliquer sur le bouton afin de procder  la phase suivante.");
-
-
-define("INSLAN37", "Retour  la dernire page");
-define("INSLAN38", "Informations Administrateur");
-define("INSLAN39", "Entrez le Nom utilisateur, le Mot de passe et l\'email devotre Administrateur principal ici.<br />Ces dtails seront utiliss pour accder  l\'espace d\'administration de votre site web.<br />Assurez vous de conserver une trace du Nom utilisateur et du Mot de passe dans un endroit sr<br />car si vous les oubli ils ne  pourront pas tre retrouvs.");
-define("INSLAN40", "Nom Admin");
-define("INSLAN41", "Mot de passe Admin");
-define("INSLAN42", "Confirmez le Mot de passe");
-define("INSLAN43", "Addresse Email Admin");
-define("INSLAN44", "Vous avez laiss des champs vides. R-entrez les informations admin SVP.");
-define("INSLAN45", "Les deux mots de passes ne  correspondent pas. Veuillez les r-entrer.");
-define("INSLAN46", "semble ne pas tre une adresse valide. Veuillez la r-entrer.");
-define("INSLAN47", "Tout est paramtr!");
-define("INSLAN48", "e107 a maintenat toute les informations ncessaires pour finir l\'installation.<br />Cliquer sur le bouton pour crer les tables de la base de donnes et enregistrer vos paramtres.");
-define("INSLAN49", "e107 n\'a pas pu sauvegard le fichier de configuration principale sur votre serveur<br />Assurez vous que le fichier <b>e107_config.php</b> possde les permissions correctes");
-define("INSLAN50", "Installation Complte!");
-define("INSLAN51", "Termin");
-define("INSLAN52", "e107 a t correctement install!<br />Pour des raison de scurit vous devez maintenant mettre les permissions du fichier<br /><b>e107_config.php</b>  644.<br />Effacez galement /install.php de votre serveur aprs avoir cliqu le bouton ci-dessous");
-define("INSLAN53", "Cliquer ici pour aller sur votre site web!");
-define("INSLAN54", "Impssible de lire le fichier de donnes sql<br /><br />Assurez vous que le fichier <b>core_sql.php</b> existe dans le rpertoire <b>/e107_admin/sql</b>.");
-define("INSLAN55", "e107 n\'apas pu crer toutes les tables dans la base de donnes.<br />Effacez la base et corrigez les problmes avant de ressayer.");
-define("INSLAN56", "Bienvenue sur votre nouveau site web!");
-
-define("INSLAN57", "e107 a t install avec succs et est maintenant prs  recevoir un contenu.<br />Votre section d\'administration est situe <a href='e107_admin/admin.php'>ici</a>, cliquez maintenant pour y allez. Pour vous connecter vous devrez utiliser le Nom utilisateur et le Mot de passe que vous avez entr durant la procdure d\'installation.");
-define("INSLAN58", "vous trouverez la FAQ et la documentation ici.");
-define("INSLAN59", "Merci d\'essayer e107, nous esprons qu\'il rpondra  vos attentes pour votre site web.\n(Vous pouvez effacer ce message de votre section admin.)");
-define("INSLAN60", "cochez pour crer");
-define("INSLAN61", "dossier");
-define("INSLAN62", "ou");
-define("INSLAN63", "Erreur de permission fichier");
-define("INSLAN64", "Ce fichier a t gnr par le script d\'installation.");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/German/lan_install.php 75/e107_languages/German/lan_install.php
--- 6171/e107_languages/German/lan_install.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/German/lan_install.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,77 +0,0 @@
-<?php
-
-/*
-German Translation File
-Author: Hendrik Mundt
-Email: hexol@emulemods.de
-*/
-
-define("INSLAN1", "Installations-Schritt");
-define("INSLAN2", "PHP / Prfung der mySQL-Version / Prfung der Datei-Berechtigungen");
-define("INSLAN3", "PHP-Version");
-define("INSLAN4", "Fehler");
-define("INSLAN5", "<b>Sie benutzen eine PHP-Version, die nicht kompatibel mit e107 ist<br />(e107 bentigt mindestens Version 4.1.0).</b><br /><br />Wenn Sie einen lokalen Server auf Ihrem Rechner verwenden, mssen Sie Ihre PHP-Version<br />aktualisieren, um fortzufahren. Siehe <a href='http://php.net'>php.net</a> fr Informationen. Wenn Sie ver-<br />suchen, e107 auf einem gehosteten Server zu installieren, mssen Sie<br />den Server-Administrators bitten, die PHP-Installation fr Sie zu aktualisieren.<br />Bitte fhren Sie dieses Skript erneut aus, nachdem Sie Ihre PHP-Version erneuert haben.");
-define("INSLAN6", "Skript angehalten.");
-define("INSLAN7", "OK");
-define("INSLAN8", "mySQL-Version");
-define("INSLAN9", "<b>e107 konnte die mySQL-Version nicht ermitteln.</b><br /><br /> Das knnte bedeuten, dass mySQL nicht installiert ist, momentan nicht ausgefhrt wird,<br />oder dass die ausgefhrte Version die Versions-Nummer nicht korrekt zurckliefert<br />(v5.x ist bekannt fr dieses Problem). Wenn der nchste Installationsschritt<br />fehlschlgt, mssen Sie den Status Ihrer mySQL-Installation berprfen.");
-define("INSLAN10", "Datei-Berechtigungen");
-define("INSLAN11", "hat keine Schreibrechte");
-define("INSLAN12", "Verzeichnis hat keine Schreibrechte");
-define("INSLAN13", "Bitte vergewissern Sie sich, dass die Berechtigungen fr die o.g. Dateien auf<br />Ihrem Server richtig gesetzt sind, die Berechtigungen sollten auf 777 gesetzt sein.<br />Um die Berechtigungen zu setzen, rechtsklicken Sie auf die Datei in Ihrem FTP-Client<br />und whlen Sie <i>Chmod</i> oder <i>Set File Permissions</i>, dann geben Sie <i>777</i> ein.<br />Wenn das nun erscheinende Dialogfenster Checkboxen besitzt, dann aktivieren Sie alle.<br /><br />Bitte testen Sie nach dem Setzen der Datei-Berechtigungen diese erneut.");
-define("INSLAN14", "e107 wird installiert");
-define("INSLAN15", "SCHWERWIEGENDER FEHLER");
-define("INSLAN16", "Obwohl es nicht mglich war, den Zustand Ihrer mySQL-Installation festzustellen,<br />fahren Sie bitte mit dem nchsten Installations-Schritt fort.");
-define("INSLAN17", "Weiter");
-define("INSLAN18", "Berechtigungen erneut prfen");
-define("INSLAN19", "Alle Server-Tests wurden durchgefhrt. Bitte klicken Sie auf den Knopf, um mit der Installation fortzufahren");
-define("INSLAN20", "mySQL-Informationen");
-define("INSLAN21", "Bitte geben Sie hier Ihre mySQL-Einstellungen an.<br />Falls Sie Root-Rechte besitzen, knnen Sie eine neue Datenbank anlegen, indem Sie die Checkbox aktivieren,<br />falls nicht, mssen Sie eine neue Datenbank anlegen oder eine vorhandene verwenden.<br />Sollten Sie nur eine Datenbank besitzen, dann benutzen Sie das Tabellen-Prfix, damit auch andere<br />Skripte die Datenbank verwenden knnen.<br />Wenn Sie Ihre mySQL-Daten nicht kennen, dann wenden Sie sich bitte an Ihren Hoster.");
-define("INSLAN22", "mySQL-Server");
-define("INSLAN23", "mySQL-Benutzer");
-define("INSLAN24", "mySQL-Passwort");
-define("INSLAN25", "mySQL-Datenbank");
-define("INSLAN26", "Tabellen-Prfix");
-define("INSLAN27", "Fehler");
-define("INSLAN28", "Fehler aufgetreten");
-define("INSLAN29", "Sie haben bentigte Felder frei gelassen - bitte geben Sie die mySQL-Informationen erneut ein.");
-define("INSLAN30", "e107 konnte mit den von Ihnen angegebenen Daten keine Verbindung zu mySQL herstellen.<br />Bitte kehren Sie zur letzten Seite zurck ud vergewissern Sie sich, dass die Daten korrekt sind.");
-define("INSLAN31", "mySQL-Prfung");
-define("INSLAN32", "Verbindung zu mySQL wurde hergestellt und berprft.");
-define("INSLAN33", "Versuche Datenbank anzulegen");
-define("INSLAN34", "Datenbank konnte nicht angelegt werden. Bitte vergewissern Sie sich,<br />dass Sie ausreichende Rechte zum Erstellen von Datenbanken auf Ihrem Server haben.");
-define("INSLAN35", "Datenbank erfolgreich angelegt.");
-define("INSLAN36", "Bitte klicken Sie auf den Knopf, um mit der Installation fortzufahren.");
-
-
-define("INSLAN37", "zurck zur letzten Seite");
-define("INSLAN38", "Administrator Informationen");
-define("INSLAN39", "Bitte geben Sie fr den Haupt-Administrator (main administrator) einen Benutzernamen, ein Passwort <br />und eine Email-Adresse an. Diese Angaben werden dazu verwendet, Zugriff auf den Administrations-Bereich<br />Ihrer Website zu gewhren. Bitte bewahren Sie Benutzername und Passwort an einem sicheren Ort auf, da Sie<br />bei Verlust nicht wiederhergestellt werden knnen.");
-define("INSLAN40", "Admin Benutzername");
-define("INSLAN41", "Admin Passwort");
-define("INSLAN42", "Passwort wiederholen");
-define("INSLAN43", "Admin Email-Adresse");
-define("INSLAN44", "Sie haben bentigte Felder frei gelassen - bitte geben Sie die Administrator-Informationen erneut ein.");
-define("INSLAN45", "Die beiden Passwort-Eingaben stimmen nicht berein - bitte erneut eingeben.");
-define("INSLAN46", "scheint keine gltige Email-Adresse zu sein - bitte erneut eingeben.");
-define("INSLAN47", "Alles gesetzt!");
-define("INSLAN48", "e107 hat nun alle Informationen zum Fertigstellen der Installation gesammelt.<br />Bitte klicken Sie auf den Knopf, um die Datenbank-Tabellen anzulegen und Ihre Einstellungen zu speichern.");
-define("INSLAN49", "e107 konnte die Haupt-Konfigurations-Datei nicht auf Ihrem Server speichern.<br />Bitte vergewissern Sie sich, dass die Datei <b>e107_config.php</b> die richtigen Berechtigungen besitzt.");
-define("INSLAN50", "Installation fertiggestellt!");
-define("INSLAN51", "Alles erledigt");
-define("INSLAN52", "e107 wurde erfolgreich installiert!<br />Aus Sicherheitsgrunden sollten Sie jetzt die Berechtigungen der Datei <br /><b>e107_config.php</b> zurck auf <i>644</i> setzen.<br />Bitte lschen Sie auch die Datei <b>/install.php</b> von Ihrem Server, nachdem Sie den Knopf unten geklickt haben.");
-define("INSLAN53", "Klicken Sie hier, um zu Ihrer neuen Website zu gelangen!");
-define("INSLAN54", "Konnte SQL datafile nicht lesen<br /><br />Bitte vergewissern Sie sich, dass die Datei <b>core_sql.php</b> im Verzeichnis <b>/e107_admin/sql</b> existiert.");
-define("INSLAN55", "e107 konnte nicht alle bentigten Datenbank-Tabellen anlegen.<br />Bitte leeren Sie die Datenbank und beheben Sie alle Probleme bevor Sie es erneut versuchen.");
-define("INSLAN56", "Willkommen auf Ihrer neuen Website!");
-
-define("INSLAN57", "e107 wurde erfolgreich installiert und ist nun bereit, Inhalte aufzunehmen.<br />Ihr Administrations-Bereich befindet sich <a href='e107_admin/admin.php'>hier</a>. Zum einloggen mssen Sie Benutzernamen und Passwort verwenden, die Sie whrend der Installation angegeben haben.");
-define("INSLAN58", "FAQ und Dokumentation finden Sie hier.");
-define("INSLAN59", "Danke, dass Sie e107 ausprobieren, wir hoffen, dass es den Anforderungen Ihrer Website gerecht wird.\n(Diese Nachricht knnen Sie im Admin-Bereich lschen.)");
-define("INSLAN60", "neu anlegen");
-define("INSLAN61", "Verzeichnis");
-define("INSLAN62", "oder");
-define("INSLAN63", "Fehler bei Datei-Berechtigungen");
-define("INSLAN64", "Diese Datei wurde vom Installations-Skript erstellt.");
-
-?>
diff -ruN 6171/e107_languages/Hebrew/lan_install.php 75/e107_languages/Hebrew/lan_install.php
--- 6171/e107_languages/Hebrew/lan_install.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/Hebrew/lan_install.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,77 +0,0 @@
-<?php
-
-/*
-Hebrew Translation File
-Author: yarivot
-Email: yarivot26@walla.co.il
-*/
-
-define("INSLAN1", " ");
-define("INSLAN2", "  mySQl PHP /   ");
-define("INSLAN3", " PHP");
-define("INSLAN4", "");
-define("INSLAN5", "<b>    PHP     e107<br />(e107     4.1.0).</b><br /><br />           <br />  PHP ,   <a href='http://php.net'>php.net</a>   .  <br />   e107        <br />       PHP  <br />     ."); 
-define("INSLAN6", " .");
-define("INSLAN7", "");
-define("INSLAN8", " MYSQL");
-define("INSLAN9", "<b>e107         .</b><br /><br />            , <br />         <br />  (v5.x     ).      <br />       .");
-define("INSLAN10", " ");
-define("INSLAN11", "  ");
-define("INSLAN12", "   ");
-define("INSLAN13", "       <br />  ,     777.    <br />,     FTP  chmod  <br />set file permissions,    777,      <br />   .<br /><br />      .");
-define("INSLAN14", " e107");
-define("INSLAN15", " ");
-define("INSLAN16", "         , <br />   .");
-define("INSLAN17", "");
-define("INSLAN18", "    ");
-define("INSLAN19", "     ,      ");
-define("INSLAN20", "   ");
-define("INSLAN21", "       .<br />           ,    <br />        . <br />             .<br />            .");
-define("INSLAN22", " MYSQL");
-define("INSLAN23", " ");
-define("INSLAN24", "");
-define("INSLAN25", "  ");
-define("INSLAN26", " ");
-define("INSLAN27", "");
-define("INSLAN28", " ");
-define("INSLAN29", "    ,       ");
-define("INSLAN30", "e107        .<br />       .");
-define("INSLAN31", "  ");
-define("INSLAN32", "    .");
-define("INSLAN33", "   ");
-define("INSLAN34", "    ,              .");
-define("INSLAN35", "   .");
-define("INSLAN36", "       .");
-
-
-define("INSLAN37", "  ");
-define("INSLAN38", "   ");
-define("INSLAN39", "    ,        .<br />           .<br />             <br />    .");
-define("INSLAN40", " ");
-define("INSLAN41", "");
-define("INSLAN42", " ");
-define("INSLAN43", " ");
-define("INSLAN44", "   ,        .");;
-define("INSLAN45", "   ,    .");
-define("INSLAN46", "     ,   .");
-define("INSLAN47", " !");
-define("INSLAN48", "e107           .<br />               .");
-define("INSLAN49", "e107      config.php  <br />  <b>e107_config.php</b> ");
-define("INSLAN50", " !");
-define("INSLAN51", " ");
-define("INSLAN52", "e107  !<br />        <br /><b>e107_config.php</a>  644.<br />      install.php      ");
-define("INSLAN53", "     !");
-define("INSLAN54", "        <br /><br />   <b>core_sql.php</a>   <b>/e107_admin/sql</b>.");
-define("INSLAN55", "e107         .<br />         .");
-define("INSLAN56", "   !");
-
-define("INSLAN57", "e107      .<br />     <a href='e107_admin/admin.php'><a>     ,          ."); 
-define("INSLAN58", "       .");
-define("INSLAN59", "    e107,          .\n(        .)");
-define("INSLAN60", "  ");
-define("INSLAN61", "");
-define("INSLAN62", "");
-define("INSLAN63", "  ");
-define("INSLAN64", "      .");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/Portugese/lan_install.php 75/e107_languages/Portugese/lan_install.php
--- 6171/e107_languages/Portugese/lan_install.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/Portugese/lan_install.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,77 +0,0 @@
-<?php
-
-/*
-Portuguese Translation File
-Author: Deodato A A Carmo
-Email: deodato.carmo.2@netvisao.pt
-*/
-
-define("INSLAN1", "Processo de Instalao");
-define("INSLAN2", "A testar o PHP / mySQL / e as permisses de ficheiros");
-define("INSLAN3", "Verso de PHP");
-define("INSLAN4", "Falhou");
-define("INSLAN5", "<b>Est a correr uma verso de PHP que no  compatvel com e107<br />(e107 requer pelo menos a verso 4.1.0).</b><br /><br />Se est a usar um servidor local no seu computador vai ter actualizar a sua<br />verso de PHP para continuar, por favor consulte <a href='http://php.net'>php.net</a> para mais instrues. Se est <br />a  tentar instalar e107 num servidor remoto, tem de contactar o<br />administrador do servidor e pedir que seja feita a actualizao do PHP para si.<br />Por favor tente a instalao deste script depois da actualizar a verso do PHP.");
-define("INSLAN6", "Script parado.");
-define("INSLAN7", "Passou");
-define("INSLAN8", "Verso do mySQL");
-define("INSLAN9", "<b>O e107 no conseguiu determinar a sua verso de mySQL.</b><br /><br /> Isto pode querer dizer que o mySQL no est instalado, no est instalado correctamente ou no est a ser executado, ou<br />est a executar uma verso que no mostra correctamente o numero da verso a que se refere<br /> (v5.x  conhecida por ter este problema). Se o prximo passo da instalao<br />falhar, tem de verificar o estado do mySQL.");
-define("INSLAN10", "Permisses de ficheiros");
-define("INSLAN11", "no tem permisso de escrever");
-define("INSLAN12", "a pasta no tem permisso de escrita");
-define("INSLAN13", "Assegure-se que os privilgios sobre os ficheiros mostrados abaixo foram correctamente<br />mudados no seu servidor, as permisses devem ser alteradas para 777. Para alterar as permisses<br />, clique com o boto direito no ficheiro, no seu cliente de FTP e escolha Chmod ou<br />Set File Permissions, e escreva 777, se a caixa de dialogo que aparecer tiver caixas<br />ento clique em todas as caixas.<br /><br />Por favor confirme de novo depois de alterar as permisses nos ficheiros.");
-define("INSLAN14", "a instalar e107");
-define("INSLAN15", "ERRO FATAL ");
-define("INSLAN16", "Apesar de tudo, no foi possvel determinar o estado da sua instalao do mySQL,<br />por favor, continue para a prxima pgina etapa.");
-define("INSLAN17", "Continuar");
-define("INSLAN18", "Testar de novo os privilgios de ficheiros");
-define("INSLAN19", "Todos os testes ao servidor foram efectuados com sucesso, clique no boto para avanar para a prxima etapa");
-define("INSLAN20", "informao mySQL");
-define("INSLAN21", "Indique aqui os detalhes do seu mySQL.<br />Se tem privilgios de 'root' pode criar uma nova base de dados ticando na caixa, caso contrrio<br />crie a base de dados ou use uma pr-existente. <br />Se s tem uma base de dados use um prefixo de forma a que outros scripts possam partilhar a mesma base de dados.<br />Se no sabe os seus dados de mySQL contacte o fornecedor de alojamento onde aloja o seu site.");
-define("INSLAN22", "Servidor mySQL");
-define("INSLAN23", "Nome de utilizador 'username' de mySQL");
-define("INSLAN24", "Password de mySQL");
-define("INSLAN25", "Base de dados de 'database' mySQL");
-define("INSLAN26", "Prefixo da(s) Tabela(s)");
-define("INSLAN27", "Erro");
-define("INSLAN28", "Foi encontrado um ERRO");
-define("INSLAN29", "Deixou campos obrigatrios em branco, por favor reentre as informaes do mySQL");
-define("INSLAN30", "O software e107 no conseguiu estabelecer ligao com o mySQL usando a informao que indicou.<br />Volte  pgina anterior e assegure-se que a informao indicada est correcta.");
-define("INSLAN31", "Teste do mySQL");
-define("INSLAN32", "Ligao com o mySQL estabelecida e verificada.");
-define("INSLAN33", "A tentar criar da base de dados");
-define("INSLAN34", "Impossvel criar a base de dados, assegure-se que tem os privilgios correctos para criar a base de dados no seu servidor.");
-define("INSLAN35", "Base de dados criada com sucesso.");
-define("INSLAN36", "Por favor clique no boto para avanar para a prxima etapa.");
-
-
-define("INSLAN37", "Voltar  pgina anterior");
-define("INSLAN38", "Informao sobre o Administrador");
-define("INSLAN39", "Por favor indique o seu nome de utilizador 'username', password e endereo email aqui.<br />Estes dados sero usados para obter acesso  rea de administrao de seu site.<br />Assegure-se de que guarda o seu nome de utilizador e password num local seguro, se os mesmos desaparecem<br />NO PODEM SER RECUPERADOS !!!.");
-define("INSLAN40", "Nome ou nick do Admin.");
-define("INSLAN41", "Password do Admin.");
-define("INSLAN42", "Confirme a Password");
-define("INSLAN43", "Endereo Email do Admin.");
-define("INSLAN44", "Deixou campos obrigatrios em branco, por favor reentre a informao do administrador.");
-define("INSLAN45", "As duas passwords no coincidem, por favor reentre a password.");
-define("INSLAN46", "Aparentemente no indicou um endereo de email vlido, por favor indique de novo.");
-define("INSLAN47", "Tudo pronto !!!");
-define("INSLAN48", "O software e107 tem agora toda a informao que necessita para completar o processo de instalao.<br />Clique no boto para criar as tabelas da base de dados e gravar todos os seus dados.");
-define("INSLAN49", "O software e107 no conseguiu gravar o ficheiro principal da configurao no seu servidor<br />Por favor assegure-se que o ficheiro <b>e107_config.php</b> tem a permisses correctas");
-define("INSLAN50", "Instalao Concluda !!!");
-define("INSLAN51", "Tudo pronto !!!");
-define("INSLAN52", "O software e107 foi instalado com sucesso!<br />Por razes de segurana deve agora configurar o privilgios do ficheiro <br /><b>e107_config.php</b> para 644.<br />Deve tambm APAGAR o ficheiro /install.php do seu servidor, depois de ter clicado no boto abaixo");
-define("INSLAN53", "Clique aqui para ir directamente para o seu novo website!!!");
-define("INSLAN54", "Impossvel ler o sql datafile<br /><br />Por favor assegure-se de que o ficheiro <b>core_sql.php</b> existe na pasta <b>/e107_admin/sql</b>.");
-define("INSLAN55", "O software e107 no conseguiu criar todas as tabelas necessrias  base de dados.<br />Por favor limpe a base de dados e rectifique algum problema antes de tentar de novo.");
-define("INSLAN56", "Bem vindo ao seu novo website !!!");
-
-define("INSLAN57", "O software e107 foi instalado com sucesso e est pronto para receber contedo.<br />A sua seco de administrao est localizada aqui <a href='e107_admin/admin.php'></a>, clique para ir at l agora. Vai ter de fazer login usando o nome de utilizador e a password que indicou durante o processo de instalao.");
-define("INSLAN58", "vai encontrar a documentao e as FAQ aqui.");
-define("INSLAN59", "Muito obrigado por experimentar o e107, esperamos que preencha os requisitos que o seu website precisa.\n(Pode apagar esta mensagem na seco de administrao.)");
-define("INSLAN60", "tique para criar");
-define("INSLAN61", "pasta");
-define("INSLAN62", "ou");
-define("INSLAN63", "erro no privilgio de ficheiros");
-define("INSLAN64", "Este ficheiro foi criado pelo script de instalao.");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_languages/Russian/lan_install.php 75/e107_languages/Russian/lan_install.php
--- 6171/e107_languages/Russian/lan_install.php	2004-03-03 12:23:50.000000000 -0600
+++ 75/e107_languages/Russian/lan_install.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,77 +0,0 @@
-<?php
-
-/*
-Russian Translation File (first release)
-Author: Alexei Yakovlev
-Email: alexei_y@mail.ru or admin@xproject.net.ru
-*/
-
-define("INSLAN1", " ");
-define("INSLAN2", "  PHP / mySQL /   ");
-define("INSLAN3", " PHP");
-define("INSLAN4", "");
-define("INSLAN5", "<b>  PHP    e107<br />(e107     4.1.0).</b><br /><br />           <br /> PHP,   ,  <a href='http://php.net'>php.net</a>.  <br />  e107      <br />         PHP  .<br />        PHP.");
-define("INSLAN6", " ");
-define("INSLAN7", "");
-define("INSLAN8", " mySQL ");
-define("INSLAN9", "<b>e107     mySQL.</b><br /><br />     mySQL     , <br />        <br />( v5.x   ).    <br /> ,     mySQL.");
-define("INSLAN10", "   ");
-define("INSLAN11", " ");
-define("INSLAN12", "  ");
-define("INSLAN13", ", ,       <br />   ,       777.  <br /> ,         FTP    Chmod <br />Set File Permissions,    777,      <br />   .<br /><br />       .");
-define("INSLAN14", " e107 ");
-define("INSLAN15", " ");
-define("INSLAN16", "   MySQL,<br />,    .");
-define("INSLAN17", "");
-define("INSLAN18", "  ");
-define("INSLAN19", "   , ,        ");
-define("INSLAN20", "  mySQL");
-define("INSLAN21", ",      .<br />            ,    <br />     . <br />         ,           .");
-define("INSLAN22", "mySQL ");
-define("INSLAN23", "mySQL  ");
-define("INSLAN24", "mySQL ");
-define("INSLAN25", "mySQL  ");
-define("INSLAN26", " ");
-define("INSLAN27", "");
-define("INSLAN28", "  ");
-define("INSLAN29", "      , ,        .");
-define("INSLAN30", "e107      mySQL  ,   .<br />         .");
-define("INSLAN31", " mySQL");
-define("INSLAN32", "  mySQL   .");
-define("INSLAN33", "   ");
-define("INSLAN34", "   , ,   ,            .");
-define("INSLAN35", "   .");
-define("INSLAN36", ",   ,     .");
-
-
-define("INSLAN37", "   ");
-define("INSLAN38", "  ");
-define("INSLAN39", ",        ,     .<br/> ,  ,        . <br/>  ,           ,    ,  <br/>  .");
-define("INSLAN40", " ");
-define("INSLAN41", " ");
-define("INSLAN42", " ");
-define("INSLAN43", "   ");
-define("INSLAN44", "      , ,      .");
-define("INSLAN45", "  , ,   .");
-define("INSLAN46", ",      , ,   .");
-define("INSLAN47", " !");
-define("INSLAN48", "      .<br />   ,           .");
-define("INSLAN49", "e107         <br />     <b>e107_config.php</b>    ");
-define("INSLAN50", " !");
-define("INSLAN51", " ");
-define("INSLAN52", "e107  !<br />          <br /><b>e107_config.php</b>   644.<br /> ---  /install.php          ");
-define("INSLAN53", " ,      !");
-define("INSLAN54", "    sql<br /><br />,    <b>core_sql.php</b>    <b>/e107_admin/sql</b>.");
-define("INSLAN55", "e107        .<br />,             .");
-define("INSLAN56", "     !");
-
-define("INSLAN57", "e107       .<br />  <a href='e107_admin/admin.php'> </a>, ,    .             .");
-define("INSLAN58", "  FAQ   .");
-define("INSLAN59", ",    e107,        .\n(       .)");
-define("INSLAN60", ",  ");
-define("INSLAN61", "");
-define("INSLAN62", "");
-define("INSLAN63", "    ");
-define("INSLAN64", "    .");
-
-?>
diff -ruN 6171/e107_plugins/admin_menu/admin_menu.php 75/e107_plugins/admin_menu/admin_menu.php
--- 6171/e107_plugins/admin_menu/admin_menu.php	2004-04-17 15:43:08.000000000 -0500
+++ 75/e107_plugins/admin_menu/admin_menu.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,47 +1,61 @@
-<?php
-
-require_once(e_HANDLER."userclass_class.php");
-
-$lan_file=e_PLUGIN."admin_menu/languages/".e_LANGUAGE.".php";
-if(file_exists($lan_file)){
-	require_once($lan_file);
-} else {
-	require_once(e_PLUGIN."admin_menu/languages/English.php");
-}
-if(ADMIN == TRUE){
-	$amtext = "<div style='text-align:center'>
-	<select name='activate' onChange='urljump(this.options[selectedIndex].value)' class='tbox'>
-	<option>".ADMIN_MENU_L1."</option>\n";
-	$amtext .= wad(e_ADMIN."newspost.php", ADMIN_MENU_L3, "H");
-	$amtext .= wad(e_ADMIN."newspost.php?cat", ADMIN_MENU_L4, "7");
-	$amtext .= wad(e_ADMIN."prefs.php", ADMIN_MENU_L5, "Site Prefs", "1");
-	$amtext .= wad(e_ADMIN."menus.php", ADMIN_MENU_L6, "2");
-	$amtext .= wad(e_ADMIN."administrator.php", ADMIN_MENU_L7, "3");
-
-	$amtext .= wad(e_ADMIN."updateadmin.php", ADMIN_MENU_L8, "");
-	$amtext .= wad(e_ADMIN."forum.php", ADMIN_MENU_L9, "5");
-	$amtext .= wad(e_ADMIN."article.php", ADMIN_MENU_L10, "J");
-	$amtext .= wad(e_ADMIN."content.php", ADMIN_MENU_L11, "L");
-	$amtext .= wad(e_ADMIN."review.php", ADMIN_MENU_L12, "K");
-
-	$amtext .= wad(e_ADMIN."links.php", ADMIN_MENU_L13, "I");
-	$amtext .= wad(e_ADMIN."links.php?cat", ADMIN_MENU_L14, "8");
-	$amtext .= wad(e_ADMIN."wmessage.php", ADMIN_MENU_L15, "M");
-	$amtext .= wad(e_ADMIN."upload.php", ADMIN_MENU_L16, "6");
-	$amtext .= wad(e_ADMIN."submitnews.php", ADMIN_MENU_L17, "N");
-
-	$amtext .= wad(e_ADMIN."banlist.php", ADMIN_MENU_L18, "4");
-	$amtext .= wad(e_ADMIN."users.php", ADMIN_MENU_L19, "4");
-	$amtext .= wad(e_ADMIN."ugflag.php", ADMIN_MENU_L20, "9");
-	$amtext .= wad(e_ADMIN."admin.php?logout", ADMIN_MENU_L21, "");
-	$amtext .= "</select>
-	</div>";
-	$ns -> tablerender(ADMIN_MENU_L2, $amtext);
-}
-function wad($url, $urlname, $perms){
-	global $amtext;
-	if(getperms($perms)){
-		return "<option value='".$url."'>".$urlname."</option>";
-	}
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/admin_menu/admin_menu.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if (ADMIN == TRUE) {
+	@include(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php");
+	@include(e_LANGUAGEDIR."English/admin/lan_admin.php");
+	
+	require_once(e_HANDLER."userclass_class.php");
+	require_once(e_ADMIN."ad_links.php");
+	require_once(e_HANDLER.'admin_handler.php');
+	
+	$array_functions[] = array(e_ADMIN."plugin.php", ADLAN_98, ADLAN_99, "Z");
+	
+	if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) {
+		while ($row = $sql->db_Fetch()) {
+			include(e_PLUGIN.$row['plugin_path']."/plugin.php");
+			if ($eplug_conffile) {
+				$array_functions[] = array(e_PLUGIN.$row['plugin_path']."/".$eplug_conffile, $eplug_name, "P".$row['plugin_id']);
+			}
+			unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
+		}
+	}
+
+	$array_functions = asortbyindex($array_functions, 1);
+
+	$amtext = "<div style='text-align:center'>
+	<select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox'>
+	<option>".LAN_SELECT."</option>\n";
+	foreach ($array_functions as $link_value) {
+		$amtext .= render_admin_links($link_value[0], $link_value[1], $link_value[3]);
+	}
+
+	$amtext .= "</select>
+	</div>";
+	$ns->tablerender(LAN_ADMIN, $amtext, 'admin_menu');
+}
+
+function render_admin_links($link, $title, $perms) {
+	if (getperms($perms)) {
+		return "<option value='".$link."'>".$title."</option>";
+	}
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/admin_menu/languages/English.php 75/e107_plugins/admin_menu/languages/English.php
--- 6171/e107_plugins/admin_menu/languages/English.php	2004-04-16 03:55:04.000000000 -0500
+++ 75/e107_plugins/admin_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,41 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("ADMIN_MENU_L1", "Select ...");
-define("ADMIN_MENU_L2", "Admin");
-
-define("ADMIN_MENU_L3", "News");
-define("ADMIN_MENU_L4", "Catgories News");
-define("ADMIN_MENU_L5", "Preferences");
-define("ADMIN_MENU_L6", "Menus");
-define("ADMIN_MENU_L7", "Administrators");
-
-define("ADMIN_MENU_L8", "Admin settings");
-define("ADMIN_MENU_L9", "Forums");
-define("ADMIN_MENU_L10", "Articles");
-define("ADMIN_MENU_L11", "Content");
-define("ADMIN_MENU_L12", "Reviews");
-
-define("ADMIN_MENU_L13", "Links");
-define("ADMIN_MENU_L14", "Link Categories");
-define("ADMIN_MENU_L15", "Welcome Message");
-define("ADMIN_MENU_L16", "Upload");
-define("ADMIN_MENU_L17", "Submitted News");
-
-define("ADMIN_MENU_L18", "Banlist");
-define("ADMIN_MENU_L19", "Users");
-define("ADMIN_MENU_L20", "Maintainance");
-define("ADMIN_MENU_L21", "Logout");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/alt_auth/alt_auth_conf.php 75/e107_plugins/alt_auth/alt_auth_conf.php
--- 6171/e107_plugins/alt_auth/alt_auth_conf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/alt_auth/alt_auth_conf.php	2006-02-11 15:17:11.000000000 -0600
@@ -0,0 +1,106 @@
+<?php
+$eplug_admin = true;
+require_once("../../class2.php");
+if(!getperms("P")){header("location:".e_BASE."index.php"); exit; }
+require_once(e_HANDLER."form_handler.php");
+require_once(e_ADMIN."auth.php");
+include_lan(e_PLUGIN."alt_auth/languages/".e_LANGUAGE."/lan_alt_auth_conf.php");
+
+if(isset($_POST['updateprefs']))
+{
+	$pref['auth_method'] = $_POST['auth_method'];
+	$pref['auth_noconn'] = intval($_POST['auth_noconn']);
+	$pref['auth_nouser'] = intval($_POST['auth_nouser']);
+	save_prefs();
+	header("location:".e_SELF);
+	exit;
+}
+
+$authlist[] = "e107";
+$handle=opendir(e_PLUGIN."alt_auth");
+while ($file = readdir($handle))
+{
+	if(preg_match("/^(.*)_auth\.php/",$file,$match))
+	{
+		$authlist[] = $match[1];
+	}
+}
+closedir($handle);
+
+$auth_dropdown = "<select class='tbox' name='auth_method'>\n";
+foreach($authlist as $a)
+{
+	$s = ($pref['auth_method'] == $a) ? " SELECTED" : "";
+	$auth_dropdown .= "<option {$s}>".$a."</option>\n";
+}
+$auth_dropdown .= "</select>\n";
+
+if(isset($message))
+{
+	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+$text = "
+<div style='text-align:center'>
+<form method='post' action='".e_SELF."'>
+<table style='width:95%' class='fborder' cellspacing='1' cellpadding='0'>
+
+<tr>
+<td style='width:70%' class='forumheader3'>".LAN_ALT_1.": </td>
+<td style='width:30%; text-align:right;' class='forumheader3'>".
+$auth_dropdown."
+</td>
+</tr>
+
+<tr>
+<td style='width:70%' class='forumheader3'>".LAN_ALT_6.":<br />
+<div class='smalltext'>".LAN_ALT_7."</div>
+</td>
+<td style='width:30%; text-align:right;' class='forumheader3'>
+<select class='tbox' name='auth_noconn'>";
+$sel = (isset($pref['auth_noconn']) && $pref['auth_noconn'] ? "" : " selected = 'selected' ");
+$text .= "<option value='0' {$sel} >".LAN_ALT_FAIL."</option>";
+$sel = (isset($pref['auth_noconn']) && $pref['auth_noconn'] ? " selected = 'selected' " : "");
+$text .= "<option value='1' {$sel} >".LAN_ALT_FALLBACK."</option>
+</select>
+</td>
+</tr>
+
+<tr>
+<td style='width:70%' class='forumheader3'>".LAN_ALT_8.":<br />
+<div class='smalltext'>".LAN_ALT_9."</div>
+</td>
+<td style='width:30%; text-align:right;' class='forumheader3'>
+<select class='tbox' name='auth_nouser'>";
+$sel = (isset($pref['auth_nouser']) && $pref['auth_nouser'] ? "" : " selected = 'selected' ");
+$text .= "<option value='0' {$sel} >".LAN_ALT_FAIL."</option>";
+$sel = (isset($pref['auth_nouser']) && $pref['auth_nouser'] ? " selected = 'selected' " : "");
+$text .= "<option value='1' {$sel} >".LAN_ALT_FALLBACK."</option>
+</select>
+</td>
+</tr>
+
+<tr style='vertical-align:top'> 
+<td colspan='2'  style='text-align:center' class='forumheader3'>
+<br />
+<input class='button' type='submit' name='updateprefs' value='".LAN_ALT_2."' />
+</td>
+</tr>
+
+</table>
+</form>
+</div>";
+
+$ns -> tablerender("<div style='text-align:center'>".LAN_ALT_3."</div>", $text);
+
+$text="";
+foreach($authlist as $a){
+	if($a != 'e107'){
+		$text .= LAN_ALT_4." <a href='".e_PLUGIN."alt_auth/{$a}_conf.php'>{$a}</a><br />";
+	}
+}
+
+$ns -> tablerender("<div style='text-align:center'>".LAN_ALT_5."</div>", $text);
+
+require_once(e_ADMIN."footer.php");
+?>	
\ No newline at end of file
diff -ruN 6171/e107_plugins/alt_auth/alt_auth_login_class.php 75/e107_plugins/alt_auth/alt_auth_login_class.php
--- 6171/e107_plugins/alt_auth/alt_auth_login_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/alt_auth/alt_auth_login_class.php	2006-03-20 15:02:15.000000000 -0600
@@ -0,0 +1,63 @@
+<?php
+class alt_login
+{
+	function alt_login($method, &$username, &$userpass)
+	{
+		global $pref;
+		$newvals=array();
+		define("AUTH_SUCCESS", -1);
+		define("AUTH_NOUSER", 1);
+		define("AUTH_BADPASSWORD", 2);
+		define("AUTH_NOCONNECT", 3);
+		require_once(e_PLUGIN."alt_auth/".$method."_auth.php");
+		$_login = new auth_login;
+
+		if($_login->Available === FALSE)
+		{
+			return false;
+		}
+
+		$login_result = $_login -> login($username, $userpass, $newvals);
+		
+		if($login_result === AUTH_SUCCESS )
+		{
+			$sql = new db;
+			if(!$sql -> db_Select("user","*","user_loginname='{$username}' "))
+			{
+				// User not found in e107 database - add it now.
+				$qry = "INSERT INTO #user (user_id, user_loginname, user_name, user_join) VALUES ('0','{$username}','{$username}',".time().")";
+				$sql -> db_Select_gen($qry);
+			}
+			// Set password and any other applicable fields
+			$qry="user_password='".md5($userpass)."'";
+			foreach($newvals as $key => $val)
+			{
+				$qry .= " ,user_{$key}='{$val}' ";
+			}
+			$qry.=" WHERE user_loginname='{$username}' ";
+			$sql -> db_Update("user", $qry);
+		}
+		else
+		{
+			switch($login_result)
+			{
+				case AUTH_NOUSER:
+					if(!isset($pref['auth_nouser']) || !$pref['auth_nouser'])
+					{
+						$username=md5("xx_nouser_xx");
+					}
+					break;
+				case AUTH_NOCONNECT:
+					if(!isset($pref['auth_noconn']) || !$pref['auth_noconn'])
+					{
+						$username=md5("xx_noconn_xx");
+					}
+					break;
+				case AUTH_BADPASSWORD:
+					$userpass=md5("xx_badpassword_xx");
+					break;
+			}
+		} 
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/alt_auth/alt_auth_readme.txt 75/e107_plugins/alt_auth/alt_auth_readme.txt
--- 6171/e107_plugins/alt_auth/alt_auth_readme.txt	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/alt_auth/alt_auth_readme.txt	2006-02-07 09:13:53.000000000 -0600
@@ -0,0 +1,52 @@
+/* 
+|  Copyright (C) 2003 Thom Michelbrink
+|
+|  Author:  Thom Michelbrink     mcfly@e107.org
+|
+*/
+
+Purpose:
+
+  This is a plugin for the E107 CMS system (e107.org).
+  This plugin will enable Alternate authorization functionality to your site.
+    
+Requirements:
+
+  This plugin requires e107 Verion 0.600+
+
+############## INSTALLATION ####################### 
+
+1) Upload all files to your e107_plugins directory on your server, retaining directory structure.
+2) Go to the admin section of the website, go the to plugin manager and install the Alt auth.
+3) Go to the admin section of the website and configure the Alternate Authorization setting.
+
+Until this is integrated into the e107 core. the following lines need to be added to the e107_handlers\login.php file.  They need to be inserted into the userlogin() function, just after the 'global $pref;' line:
+
+		if($pref['auth_method'] && $pref['auth_method'] != "e107"){
+			$auth_file=e_PLUGIN."alt_auth/".$pref['auth_method']."_auth.php";
+			if(file_exists($auth_file)){
+				require_once(e_PLUGIN."alt_auth/alt_auth_login_class.php");
+				$result = new alt_login($pref['auth_method'],$username, $userpass);
+			}
+		}
+
+
+--- AUTHORIZATION TYPES --
+This version currently supports Active Directory and LDAP authorization types.  Others could easily 
+be added though.
+
+The requirements to add a new auth type are:
+
+xxx_auth.php - Actual file the performs the authorization based on user input of uname / passwd.
+xxx_conf.php - The file used to edit any configuration option for your auth type.
+
+The xxx_auth.php must contain a class named auth_login(), the class must contain a function named login($uname,$passwd).  The login() function must return values of:
+AUTH_SUCCESS - valid login
+AUTH_NOUSER - User not found
+AUTH_BADPASSWORD - Password is incorrect
+-----------------------------------------------------------------------------
+
+Version history:
+
+11/11/2003 - Initial beta release 
+ 
diff -ruN 6171/e107_plugins/alt_auth/alt_login_class.php 75/e107_plugins/alt_auth/alt_login_class.php
--- 6171/e107_plugins/alt_auth/alt_login_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/alt_auth/alt_login_class.php	2006-03-20 15:02:15.000000000 -0600
@@ -0,0 +1,39 @@
+<?php
+
+class alt_login{
+	function alt_login($method,&$username,&$userpass){
+		$newvals=array();
+		define("AUTH_SUCCESS",-1);
+		define("AUTH_NOUSER",1);
+		define("AUTH_BADPASSWORD",2);
+		require_once(e_PLUGIN."auth_".$method."/auth_".$method.".php");
+		$xx = new auth_login;
+		$login_result = $xx -> login($username,$userpass,$newvals);
+		
+		if($login_result === AUTH_SUCCESS ){
+			$sql = new db;
+			if(!$sql -> db_Select("user","*","user_loginname='{$username}' ")){
+				// User not found in e107 database - add it now.
+				$qry = "INSERT INTO ".MPREFIX."user (user_id, user_loginname, user_name, user_join) VALUES ('0', '{$username}', '{$username}', ".time().")";
+				$sql -> db_Select_gen($qry);
+			}
+			// Set password and any other applicable fields
+			$qry="user_password='".md5($userpass)."'";
+			foreach($newvals as $key => $val){
+				$qry .= " ,user_{$key}='{$val}' ";
+			}
+			$qry.=" WHERE user_loginname='{$username}' ";
+			$sql -> db_Update("user",$qry);
+		} else {
+			switch($login_result){
+				case AUTH_NOUSER:
+					$username=md5("xx_nouser_xx");
+					break;
+				case AUTH_BADPASSWORD:
+					$userpass=md5("xx_badpassword_xx");
+					break;
+			}
+		} 
+	}
+}
+?>
\ No newline at end of file
Files 6171/e107_plugins/alt_auth/images/icon_ldap.png and 75/e107_plugins/alt_auth/images/icon_ldap.png differ
diff -ruN 6171/e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php 75/e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php
--- 6171/e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/alt_auth/languages/English/lan_alt_auth_conf.php	2006-02-11 15:17:11.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+define("LAN_ALT_1", "Current authorization type");
+define("LAN_ALT_2", "Update settings");
+define("LAN_ALT_3", "Choose Alternate Authorizaion Type");
+define("LAN_ALT_4", "Configure parameters for");
+define("LAN_ALT_5", "Configure authorization parameters");
+define("LAN_ALT_6", "Failed connection action");
+define("LAN_ALT_7", "If connection to the alternate method fails, how should that be handled?");
+define("LAN_ALT_8", "User not found action");
+define("LAN_ALT_9", "If username is not found using alternate method, how should that be handled?");
+
+define("LAN_ALT_FALLBACK", "Use e107 user table");
+define("LAN_ALT_FAIL", "Failed login");
+
+?>
diff -ruN 6171/e107_plugins/alt_auth/languages/English/lan_ldap_auth.php 75/e107_plugins/alt_auth/languages/English/lan_ldap_auth.php
--- 6171/e107_plugins/alt_auth/languages/English/lan_ldap_auth.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/alt_auth/languages/English/lan_ldap_auth.php	2006-02-11 15:17:11.000000000 -0600
@@ -0,0 +1,8 @@
+<?php
+define("LDAPLAN_1", "Server address");
+define("LDAPLAN_2", "Base DN or Domain<br />If LDAP - Enter BaseDN<br />If AD - Enter domain");
+define("LDAPLAN_3", "LDAP Browsing user<br />Full context of the user who is able to search the directory.");
+define("LDAPLAN_4", "LDAP Browsing password<br />Password for the LDAP Browsing user.");
+define("LDAPLAN_5", "LDAP Version");
+define("LDAPLAN_6", "Configure LDAP auth");
+?>
diff -ruN 6171/e107_plugins/alt_auth/ldap_auth.php 75/e107_plugins/alt_auth/ldap_auth.php
--- 6171/e107_plugins/alt_auth/ldap_auth.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/alt_auth/ldap_auth.php	2006-02-11 15:17:11.000000000 -0600
@@ -0,0 +1,165 @@
+<?php
+
+class auth_login
+{
+
+	var $server;
+	var $dn;
+	var $usr;
+	var $pwd;
+	var $serverType;
+	var $ldapErrorCode;
+	var $ldapErrorText;
+	var $connection;
+	var $result;
+	var $ldapVersion;
+	var $Available;
+
+	function auth_login()
+	{
+		$sql = new db;
+		$sql -> db_Select("alt_auth", "*", "auth_type = 'ldap' ");
+		while($row = $sql -> db_Fetch())
+		{
+			$ldap[$row['auth_parmname']]=$row['auth_parmval'];
+		}
+
+		$this->server = explode(",", $ldap['ldap_server']);
+		$this->serverType = $ldap['ldap_servertype'];
+		$this->dn = $ldap['ldap_basedn'];
+		$this->usr = $ldap['ldap_user'];
+		$this->pwd = $ldap['ldap_passwd'];
+		$this->ldapVersion = $ldap['ldap_version'];
+
+		if(!function_exists('ldap_connect'))
+		{
+			$this->Available = FALSE;
+			return false;
+		}
+
+		if(!$this -> connect())
+		{
+			return AUTH_NOCONNECT;
+		}
+	}
+
+	function connect()
+	{
+		foreach ($this->server as $key => $host)
+		{
+			$this->connection = ldap_connect($host);
+			if ( $this->connection) {
+				if($this -> ldapVersion == 3 || $this->serverType == "ActiveDirectory")
+				{
+					@ldap_set_option( $this -> connection, LDAP_OPT_PROTOCOL_VERSION, 3 );
+				}
+				return true;
+			}
+		}
+		
+		$this->ldapErrorCode = -1;
+		$this->ldapErrorText = "Unable to connect to any server";
+		return false;
+	}
+
+	function close()
+	{
+		if ( !@ldap_close( $this->connection))
+		{
+			$this->ldapErrorCode = ldap_errno( $this->connection);
+			$this->ldapErrorText = ldap_error( $this->connection);
+			return false;
+		}
+		else
+		{
+			return true;
+		}
+	}
+
+	function login($uname, $pass)
+	{
+		/* Construct the full DN, eg:-
+		** "uid=username, ou=People, dc=orgname,dc=com"
+		*/
+		if ($this->serverType == "ActiveDirectory")
+		{
+			$checkDn = "$uname@$this->dn";
+		}
+		else
+		{
+			if ($this -> usr != '' && $this -> pwd != '')
+			{
+				$this -> result = ldap_bind($this -> connection, $this -> usr, $this -> pwd);
+			}
+			else
+			{
+				$this -> result = ldap_bind($this -> connection);
+			}
+			
+//			In ldap_auth.php, should look like this instead for eDirectory 
+//			$query = ldap_search($this -> connection, $this -> dn, "cn=".$uname);
+
+			if($this->serverType == "eDirectory")
+			{
+				$query = ldap_search($this->connection, $this->dn, "cn=".$uname);
+			}
+			else
+			{
+				$query = ldap_search($this->connection, $this->dn, "uid=".$uname);
+			}
+
+			if ($query == false)
+			{
+//				Could not perform query to LDAP directory
+				return AUTH_NOCONNECT;
+			}
+			else
+			{
+				$query_result = ldap_get_entries($this -> connection, $query);
+
+				if ($query_result["count"] != 1)
+				{
+					return AUTH_NOUSER;
+				}
+				else
+				{
+					$checkDn = $query_result[0]["dn"];
+					$this -> close();
+					$this -> connect();
+				}
+			}
+		}
+		// Try and connect...
+		$this->result = ldap_bind($this -> connection, $checkDn, $pass);
+		if ( $this->result)
+		{
+			// Connected OK - login credentials are fine!
+			return AUTH_SUCCESS;
+		}
+		else
+		{
+			/* Login failed. Return false, together with the error code and text from
+			** the LDAP server. The common error codes and reasons are listed below :
+			** (for iPlanet, other servers may differ)
+			** 19 - Account locked out (too many invalid login attempts)
+			** 32 - User does not exist
+			** 49 - Wrong password
+			** 53 - Account inactive (manually locked out by administrator)
+			*/
+			$this->ldapErrorCode = ldap_errno( $this->connection);
+			$this->ldapErrorText = ldap_error( $this->connection);
+
+			if($this -> ldapErrorCode == 32)
+			{
+				return AUTH_NOUSER;
+			}
+			if($this -> ldapErrorCode == 49)
+			{
+				return AUTH_BADPASSWORD;
+			}
+			// return error code as if it never connected, maybe change that in the future
+			return AUTH_NOCONNECT;  
+		}
+	}
+}
+?>
diff -ruN 6171/e107_plugins/alt_auth/ldap_conf.php 75/e107_plugins/alt_auth/ldap_conf.php
--- 6171/e107_plugins/alt_auth/ldap_conf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/alt_auth/ldap_conf.php	2006-02-13 07:28:04.000000000 -0600
@@ -0,0 +1,110 @@
+<?php
+/*
++---------------------------------------------------------------+
+|	e107 website system
+|	/ldap_conf.php
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).	
++---------------------------------------------------------------+
+*/
+$eplug_admin = true;
+require_once("../../class2.php");
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."form_handler.php");
+include_lan("languages/".e_LANGUAGE."/lan_ldap_auth.php");
+
+$server_types[1]="LDAP";
+$server_types[2]="ActiveDirectory";
+$server_types[3]="eDirectory";
+
+$ldap_ver[1]="2";
+$ldap_ver[2]="3";
+
+if($_POST['update'])
+{
+	foreach($_POST as $k => $v)
+	{
+		if(preg_match("/ldap_/", $k))
+		{
+			if($sql -> db_Select("alt_auth", "*", "auth_type='ldap' AND auth_parmname='{$k}' "))
+			{
+				$sql -> db_Update("alt_auth", "auth_parmval='{$v}' WHERE  auth_type='ldap' AND auth_parmname='{$k}' ");
+			}
+			else
+			{
+				$sql -> db_Insert("alt_auth", "'ldap','{$k}','{$v}' ");
+			}
+		}
+	}
+	$message = "Settings Updated";
+}
+
+if(!function_exists('ldap_connect'))
+{
+	$message = "<div style='color:#f00; font-weight:bold'>WARNING:  It appears as if the ldap module is not currently available, setting your auth method to LDAP will probably not work!</div>";
+}
+
+if($message)
+{
+	$ns->tablerender("","<div style='text-align:center;'>".$message."</div>");
+}
+
+$sql -> db_Select("alt_auth", "*", "auth_type = 'ldap' ");
+while($row = $sql->db_Fetch())
+{
+	$ldap[$row['auth_parmname']] = $row['auth_parmval'];
+}
+
+$frm = new form;
+$text = $frm -> form_open("POST",e_SELF);
+$text .= "<table style='width:96%'>";
+$text .= "<tr><td class='forumheader3'>Server Type</td><td class='forumheader3'>";
+$text .= $frm -> form_select_open("ldap_servertype");
+foreach($server_types as $v)
+{
+	$sel = ($ldap['ldap_servertype'] == $v) ? " Selected" : "";
+	$text .= $frm -> form_option($v, $sel, $v);
+}
+$text .= $frm -> form_select_close();
+$text .= "</td></tr>";
+
+$text .= "<tr><td class='forumheader3'>".LDAPLAN_1."</td><td class='forumheader3'>";
+$text .= $frm -> form_text("ldap_server", 35, $ldap['ldap_server'], 60);
+$text .= "</td></tr>";
+
+$text .= "<tr><td class='forumheader3'>".LDAPLAN_2."</td><td class='forumheader3'>";
+$text .= $frm -> form_text("ldap_basedn", 35, $ldap['ldap_basedn'], 60);
+$text .= "</td></tr>";
+
+$text .= "<tr><td class='forumheader3'>".LDAPLAN_3."</td><td class='forumheader3'>";
+$text .= $frm -> form_text("ldap_user", 35, $ldap['ldap_user'], 60);
+$text .= "</td></tr>";
+
+$text .= "<tr><td class='forumheader3'>".LDAPLAN_4."</td><td class='forumheader3'>";
+$text .= $frm -> form_text("ldap_passwd", 35, $ldap['ldap_passwd'], 60);
+$text .= "</td></tr>";
+
+$text .= "<tr><td class='forumheader3'>".LDAPLAN_5."</td><td class='forumheader3'>";
+$text .= $frm -> form_select_open("ldap_version");
+
+foreach($ldap_ver as $v)
+{
+	$sel = ($ldap['ldap_version'] == $v) ? " Selected" : "";
+	$text .= $frm -> form_option($v, $sel, $v);
+}
+
+$text .= $frm -> form_select_close();
+$text .= "</td></tr>";
+
+$text .= "<tr><td class='forumheader' colspan='2' style='text-align:center;'>";
+$text .= $frm -> form_button("submit", "update", "Update settings");
+$text .= "</td></tr>";
+
+$text .= "</table>";
+$text .= $frm -> form_close();
+
+$ns -> tablerender(LDAPLAN_6,$text);
+$ns -> tablerender(" ","<div style='text-align:center'><a href='".e_PLUGIN."alt_auth/alt_auth_conf.php'>Return to main alt_auth config</a></div>");
+require_once(e_ADMIN."footer.php");
+?>
diff -ruN 6171/e107_plugins/alt_auth/plugin.php 75/e107_plugins/alt_auth/plugin.php
--- 6171/e107_plugins/alt_auth/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/alt_auth/plugin.php	2006-02-07 09:13:53.000000000 -0600
@@ -0,0 +1,69 @@
+<?php
+/*
++---------------------------------------------------------------+
+|	e107 website system
+|
+|	Steve Dunstan 2001-2002
+|	http://e107.org
+|	jalist@e107.org
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = "Alternate Authentication";
+$eplug_version = "0.3";
+$eplug_author = "McFly";
+$eplug_logo = "/images/icon_ldap.png";
+$eplug_url = "";
+$eplug_email = "mcfly@e107.org";
+$eplug_description = "This plugin allows for alternate authentication methods.";
+$eplug_compatible = "e107v7+";
+$eplug_readme = "";	// leave blank if no readme file
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "alt_auth";
+
+// Mane of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "alt_auth";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "alt_auth_conf.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/icon_ldap.png";
+$eplug_caption =  "Configure Alt auth";
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = "";
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array(
+	"alt_auth"
+);
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+
+
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."alt_auth (
+  auth_type varchar(20) NOT NULL default '',
+  auth_parmname varchar(30) NOT NULL default '',
+  auth_parmval varchar(60) NOT NULL default ''
+) TYPE=MyISAM;");
+
+
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$eplug_link_url = "";
+
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = "Alt auth service is now set up.  You will now need to configure your preferred method.";
+
+?>	
diff -ruN 6171/e107_plugins/alt_news/alt_news.php 75/e107_plugins/alt_news/alt_news.php
--- 6171/e107_plugins/alt_news/alt_news.php	2004-06-15 06:30:16.000000000 -0500
+++ 75/e107_plugins/alt_news/alt_news.php	2005-12-28 10:12:59.000000000 -0600
@@ -1,106 +1,118 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/alt_news.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once(e_HANDLER."news_class.php");
-
-function alt_news($news_category){
-	global $sql, $aj, $ns;
-	$ix = new news;
-
-	if(strstr(e_QUERY, "cat")){
-	$category = $news_category;
-	if($category != 0){
-		$gen = new convert;
-		$sql2 = new db;
-		$sql -> db_Select("news_category", "*", "category_id='$category'");
-		list($category_id, $category_name, $category_icon) = $sql-> db_Fetch();
-		$category_name = $aj -> tpa($category_name);
-		if(strstr($category_icon, "../")){
-			$category_icon = str_replace("../", "", e_BASE.$category_icon);
-		}else{
-			$category_icon = THEME.$category_icon;
-		}
-		if($count = $sql -> db_Select("news", "*",  "news_category='$category' ORDER BY news_datestamp DESC")){
-			while($row = $sql-> db_Fetch()){
-				extract($row);
-				if($news_title == ""){ $news_title = "Untitled"; }
-				$datestamp = $gen->convert_date($news_datestamp, "short");
-				$news_body = strip_tags(substr($news_body, 0, 100))." ...";
-				$comment_total = $sql2 -> db_Count("comments", "(*)",  "WHERE comment_item_id='$news_id' AND comment_type='0' ");
-				$text .= "<div class='mediumtext'>
-				<img src='".THEME."images/bullet2.gif' alt='bullet' /> ";
-
-				if($news_allow_comments){
-					$text .= "<a href='news.php?extend.".$news_id."'>".$news_title."</a>";
-				}else{
-					$text .= "<a href='comment.php?comment.news.".$news_id."'>".$news_title."</a>";
-				}
-				$text .= "<br />
-				".LAN_100." ".$datestamp." (".LAN_99.": ";
-				if($news_allow_comments){
-					$text .= COMMENTOFFSTRING.")";
-				}else{
-					$text .= $comment_total.")";
-				}
-				$text .= "</div>
-				".$news_body."
-				<br /><br />\n";
-			}
-			$text = "<img src='$category_icon' alt='' /><br />".
-			LAN_307.$count."
-			<br /><br />".$text;
-			$ns -> tablerender(LAN_82." '".$category_name."'", $text);
-		}
-	}
-	return TRUE;
-}
-
-
-	if($sql -> db_Select("news", "*", "news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_category='$news_category' ORDER BY news_datestamp DESC LIMIT 0,".ITEMVIEW)){
-		$sql2 = new db;
-		while(list($news['news_id'], $news['news_title'], $news['data'], $news['news_extended'], $news['news_datestamp'], $news['admin_id'], $news_category, $news['news_allow_comments'],  $news['news_start'], $news['news_end'], $news['news_class']) = $sql -> db_Fetch()){
-
-			if(check_class($news['news_class']) || !$news['news_class']){
-
-				if($news['admin_id'] == 1 && $pref['siteadmin']){
-					$news['admin_name'] = $pref['siteadmin'];
-				}else if(!$news['admin_name'] = getcachedvars($news['admin_id'])){
-					$sql2 -> db_Select("user", "user_name", "user_id='".$news['admin_id']."' ");
-					list($news['admin_name']) = $sql2 -> db_Fetch();
-					cachevars($news['admin_id'], $news['admin_name']);
-				}
-				$sql2 -> db_Select("news_category", "*",  "category_id='$news_category' ");
-				list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2-> db_Fetch();
-				$news['comment_total'] = $sql2 -> db_Count("comments", "(*)",  "WHERE comment_item_id='".$news['news_id']."' AND comment_type='0' ");
-				$ix -> render_newsitem($news);
-			}
-      else{
-        if($pref['subnews_hide_news']==1){
-          if($news['admin_id'] == 1 && $pref['siteadmin']){
-                  $news['admin_name'] = $pref['siteadmin'];
-          }else if(!$news['admin_name'] = getcachedvars($news['admin_id'])){
-                  $sql2 -> db_Select("user", "user_name", "user_id='".$news['admin_id']."' ");
-                  list($news['admin_name']) = $sql2 -> db_Fetch();
-                  cachevars($news['admin_id'], $news['admin_name']);
-          }
-          $sql2 -> db_Select("news_category", "*",  "category_id='$news_category' ");
-  				list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2-> db_Fetch();
-          $ix -> render_newsitem($news,"","userclass");
-        }
-      }
-		}
-	}
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/alt_news/alt_news.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/28 16:12:59 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+require_once(e_HANDLER."news_class.php");
+
+function alt_news($news_category) {
+	global $ml, $sql, $aj, $ns;
+	$ix = new news;
+	if (strstr(e_QUERY, "cat")) {
+		$category = $news_category;
+		if ($category != 0) {
+			$gen = new convert;
+			$sql2 = new db;
+			$sql->db_Select("news_category", "*", "category_id='".intval($category)."'");
+			list($category_id, $category_name, $category_icon) = $sql->db_Fetch();
+			$category_name = $aj->tpa($category_name);
+			if (strstr($category_icon, "../")) {
+				$category_icon = str_replace("../", "", e_BASE.$category_icon);
+			} else {
+				$category_icon = THEME.$category_icon;
+			}
+
+			if ($count = $sql->db_Select("news", "*", "news_category='".intval($category)."' ORDER BY news_datestamp DESC")) {
+				while ($row = $sql->db_Fetch()) {
+					extract($row);
+					if ($news_title == "") {
+						$news_title = "Untitled";
+					}
+					$datestamp = $gen->convert_date($news_datestamp, "short");
+					$news_body = strip_tags(substr($news_body, 0, 100))." ...";
+					$comment_total = $sql2->db_Count("comments", "(*)", "WHERE comment_item_id='".intval($news_id)."' AND comment_type='0' ");
+					$text .= "<div class='mediumtext'>
+						<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='bullet' /> ";
+
+					if ($news_allow_comments) {
+						$text .= "<a href='news.php?extend.".$news_id."'>".$news_title."</a>";
+					} else {
+						$text .= "<a href='comment.php?comment.news.".$news_id."'>".$news_title."</a>";
+					}
+					$text .= "<br />
+						".LAN_100." ".$datestamp." (".LAN_99.": ";
+					if ($news_allow_comments) {
+						$text .= COMMENTOFFSTRING.")";
+					} else {
+						$text .= $comment_total.")";
+					}
+					$text .= "</div>
+						".$news_body."
+						<br /><br />\n";
+				}
+				$text = "<img src='$category_icon' alt='' /><br />". LAN_307.$count."
+					<br /><br />".$text;
+				$ns->tablerender(LAN_82." '".$category_name."'", $text, 'alt_news');
+			}
+		}
+		return TRUE;
+	}
+
+	if ($sql->db_Select("news", "*", "news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_category='".intval($news_category)."' ORDER BY news_datestamp DESC LIMIT 0,".ITEMVIEW)) {
+		$sql2 = new db;
+		while (list($news['news_id'], $news['news_title'], $news['data'], $news['news_extended'], $news['news_datestamp'], $news['admin_id'], $news_category, $news['news_allow_comments'], $news['news_start'], $news['news_end'], $news['news_class']) = $sql->db_Fetch()) {
+
+			if (check_class($news['news_class']) || !$news['news_class']) {
+
+				if ($news['admin_id'] == 1 && $pref['siteadmin']) {
+					$news['admin_name'] = $pref['siteadmin'];
+				}
+				else if(!$news['admin_name'] = getcachedvars($news['admin_id'])) {
+					$sql2->db_Select("user", "user_name", "user_id='".intval($news['admin_id'])."' ");
+					list($news['admin_name']) = $sql2->db_Fetch();
+					cachevars($news['admin_id'], $news['admin_name']);
+				}
+
+					$sql2->db_Select("news_category", "*", "category_id='".intval($news_category)."' ");
+
+				list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2->db_Fetch();
+				$news['comment_total'] = $sql2->db_Count("comments", "(*)", "WHERE comment_item_id='".intval($news['news_id'])."' AND comment_type='0' ");
+				$ix->render_newsitem($news);
+			} else {
+				if ($pref['subnews_hide_news'] == 1) {
+					if ($news['admin_id'] == 1 && $pref['siteadmin']) {
+						$news['admin_name'] = $pref['siteadmin'];
+					}
+					else if(!$news['admin_name'] = getcachedvars($news['admin_id'])) {
+						$sql2->db_Select("user", "user_name", "user_id='".intval($news['admin_id'])."' ");
+						list($news['admin_name']) = $sql2->db_Fetch();
+						cachevars($news['admin_id'], $news['admin_name']);
+					}
+
+					$sql2->db_Select("news_category", "*", "category_id='".intval($news_category)."' ");
+
+					list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2->db_Fetch();
+					$ix->render_newsitem($news, "", "userclass");
+				}
+			}
+		}
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/articles_menu/articles_menu.php 75/e107_plugins/articles_menu/articles_menu.php
--- 6171/e107_plugins/articles_menu/articles_menu.php	2004-05-12 16:19:32.000000000 -0500
+++ 75/e107_plugins/articles_menu/articles_menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,89 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/articles_menu.php
-|
-|	Edwin van der Wal 2003
-|	http://e107.org
-|	evdwal@xs4all.nl
-|	Based on the articles_menu.php
-|
-|	Released under the terms and conditions of the	
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-if($cache = retrieve_cache("article_menu")){
-	$aj = new textparse;
-	$cache = str_replace("e107_themes/", e_THEME, $cache);
-	$cache = str_replace("<a href=&#39;", "<a href=&#39;".e_BASE, $cache);
-	echo $aj -> formtparev($cache);
-}else{
-	ob_start();
-	$text = ($menu_pref['articles_mainlink'] ? "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."content.php?article'> ".($menu_pref['articles_mainlink'] ? $menu_pref['articles_mainlink'] : ARTICLE_MENU_L1)."</a><br/>" : "");
-
-	$sql2=new db;
-
-	if($menu_pref['articles_parents']){
-		$text.="<br />";
-		if($i = $sql -> db_Select("content", "*", "content_type='0' AND content_parent='0' ")){
-			$text .= "<img src='".THEME."images/bullet2.gif' alt='' /> <a href='".e_BASE."content.php?article.cat.0'>".ARTICLE_MENU_L2."</a> (".$i.")<br />";
-		}
-
-		if($sql -> db_Select("content", "*", "content_type='6' ORDER BY content_heading ASC")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				if(check_class($content_class)){
-				$i = $sql2 -> db_Select("content", "content_class", "content_type='0' AND content_parent='".$content_id."' ");
-					if($i){
-						while($row2 = $sql2 -> db_Fetch()){
-							extract($row2);
-							if(!check_class($content_class)){
-								$i = $i - 1;
-							}
-						}
-						$text .= "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."content.php?article.cat.".$content_id."'>".$content_heading."</a> (".$i.")<br />";
-					}
-				}
-			}
-		}
-		$text.="<br />";
-	}
-		
-	if($sql -> db_Select("content", "*", "content_type='0' ORDER BY content_datestamp DESC limit 0, ".$menu_pref['articles_display'])){
-		while($row = $sql-> db_Fetch()){
-			extract($row);
-			if(check_class($content_class)){
-				$ok=0;
-				if($content_parent==0){
-					$ok=1;
-				} else {
-					if($sql2 -> db_Select("content","content_class","content_id = '{$content_parent}'")){
-						$row2 = $sql2 -> db_Fetch();
-						if(check_class($row2['content_class'])){
-							$ok=1;
-						}
-					}
-				}
-				if($ok){
-					$text .= "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."content.php?article.".$content_id."'>".$content_heading."</a><br />";
-				}
-			}
-		}
-
-	if($menu_pref['articles_submitlink'] && check_class($pref['article_submit_class'])){
-		$text .= "<br /><img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."subcontent.php?article'> ".ARTICLE_MENU_L11."</a>";
-	}
-		$caption = (file_exists(THEME."images/article_menu.png") ? "<img src='".THEME."images/article_menu.png' alt='' style='vertical-align:middle' /> ".$menu_pref['article_caption'] : $menu_pref['article_caption']);
-
-		$ns -> tablerender($caption, $text);
-	}
-
-	if($pref['cachestatus']){
-		$aj = new textparse;
-		$cache = $aj -> formtpa(ob_get_contents(), "admin");
-		set_cache("article_menu", $cache);
-	}
-}
-
-?>
diff -ruN 6171/e107_plugins/articles_menu/config.php 75/e107_plugins/articles_menu/config.php
--- 6171/e107_plugins/articles_menu/config.php	2004-07-01 21:13:42.000000000 -0500
+++ 75/e107_plugins/articles_menu/config.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,95 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/menu_conf/articles_conf.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-|
-|	Based on code by Edwin van der Wal (evdwal@xs4all.nl), Multilanguage by Juan
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-require_once(e_HANDLER."userclass_class.php");
-
-@require_once(e_PLUGIN."articles_menu/languages/".e_LANGUAGE.".php");
-@require_once(e_PLUGIN."articles_menu/languages/English.php");
-
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
-require_once(e_ADMIN."auth.php");
-
-if(IsSet($_POST['update_menu']))
-{
-  clear_cache("article_menu");
-	while(list($key, $value) = each($_POST))
-  {
-		if($key=="articles_parents"){$value="1"; $found=1;}
-		if($key=="articles_submitlink"){$value="1"; $found1=1;}
-		if($value != ARTICLE_MENU_L8)
-    { 
-			$menu_pref[$key] = $value; 
-		}
-	}
-	if(!$found){unset($menu_pref['articles_parents']);}
-	if(!$found1){unset($menu_pref['articles_submitlink']);}
-	$tmp = addslashes(serialize($menu_pref));
-	$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
-	$ns -> tablerender("", "<div style='text-align:center'><b>".ARTICLE_MENU_L9."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
-<table style='width:85%' class='fborder' >
-
-<tr>
-<td style='width:40%' class='forumheader3'>".ARTICLE_MENU_L3.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='article_caption' size='20' value='".$menu_pref['article_caption']."' maxlength='100' />
-</td>
-</tr>
-
-
-<tr>
-<td style='width:40%' class='forumheader3'>".ARTICLE_MENU_L4.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='articles_display' size='6' value='".$menu_pref['articles_display']."' maxlength='3' />
-</td>
-</tr>
-
-<tr>
-<td style='width:40%' class='forumheader3'>".ARTICLE_MENU_L5.":</td>
-<td style='width:60%' class='forumheader3'>
-<input type='checkbox' name='articles_parents' value='".$menu_pref['articles_parents']."' ".($menu_pref['articles_parents'] ? "checked" : "")." />
-</td>
-</tr>
-
-<tr>
-<td style='width:40%' class='forumheader3'>".ARTICLE_MENU_L6.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='articles_mainlink' size='30' value='".$menu_pref['articles_mainlink']."' maxlength='200' />
-</td>
-</tr>
-
-
-<tr>
-<td style='width:40%' class='forumheader3'>".ARTICLE_MENU_L10.":</td>
-<td style='width:60%' class='forumheader3'>
-<input type='checkbox' name='articles_submitlink' value='".$menu_pref['articles_submitlink']."' ".($menu_pref['articles_submitlink'] ? "checked" : "")." />
-</td>
-</tr>
-
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='".ARTICLE_MENU_L8."' /></td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender("".ARTICLE_MENU_L7."", $text);
-
-require_once(e_ADMIN."footer.php");
-?>
diff -ruN 6171/e107_plugins/articles_menu/languages/English.php 75/e107_plugins/articles_menu/languages/English.php
--- 6171/e107_plugins/articles_menu/languages/English.php	2004-04-18 20:00:00.000000000 -0500
+++ 75/e107_plugins/articles_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,29 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("ARTICLE_MENU_L1", "Articles Front Page");
-define("ARTICLE_MENU_L2", "Uncategorized");
-
-define("ARTICLE_MENU_L3", "Caption");
-define("ARTICLE_MENU_L4", "Number of articles to display");
-define("ARTICLE_MENU_L5", "Show article categories in menu?");
-define("ARTICLE_MENU_L6", "Title for articles list page:");
-define("ARTICLE_MENU_L7", "Articles Menu Configuration");
-define("ARTICLE_MENU_L8", "Update Menu Settings");
-define("ARTICLE_MENU_L9", "Articles menu configuration saved");
-define("ARTICLE_MENU_L10", "Show link to Submit Article");
-define("ARTICLE_MENU_L11", "Submit Article");
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/backend_menu/backend_menu.php 75/e107_plugins/backend_menu/backend_menu.php
--- 6171/e107_plugins/backend_menu/backend_menu.php	2004-05-24 18:47:54.000000000 -0500
+++ 75/e107_plugins/backend_menu/backend_menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,11 +0,0 @@
-<?php
-global $FILES_DIRECTORY;
-$text = "<div style='text-align:center' class='smalltext'>
-".BACKEND_MENU_L1."<br />
-<a href='".SITEURL.$FILES_DIRECTORY."backend/news.xml'>news.xml</a> - <a href='".SITEURL.$FILES_DIRECTORY."backend/news.txt'>news.txt</a>
-</div>";
-
-$caption = (file_exists(THEME."images/backend_menu.png") ? "<img src='".THEME."images/backend_menu.png' alt='' style='vertical-align:middle' /> ".BACKEND_MENU_L2 : BACKEND_MENU_L2);
-
-$ns -> tablerender($caption, $text);
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/backend_menu/languages/English.php 75/e107_plugins/backend_menu/languages/English.php
--- 6171/e107_plugins/backend_menu/languages/English.php	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/backend_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,18 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("BACKEND_MENU_L1", "Our headlines can be syndicated by using either our rss or text feeds.");
-define("BACKEND_MENU_L2", "Backend");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/banner_menu/banner_menu.php 75/e107_plugins/banner_menu/banner_menu.php
--- 6171/e107_plugins/banner_menu/banner_menu.php	2004-05-09 20:40:58.000000000 -0500
+++ 75/e107_plugins/banner_menu/banner_menu.php	2005-12-14 11:37:43.000000000 -0600
@@ -1,30 +1,64 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/banner_menu.php.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-mt_srand ((double) microtime() * 1000000);
-$seed = mt_rand(1,2000000000);
-
-if($menu_pref['banner_campaign']){
-	$query = "banner_active=1 AND (banner_startdate=0 OR banner_startdate<=".time().") AND (banner_enddate=0 OR banner_enddate>".time().") AND (banner_impurchased=0 OR banner_impressions<=banner_impurchased) AND banner_campaign='".$menu_pref['banner_campaign']."' ORDER BY RAND($seed)";
-}else{
-	$query = "banner_active=1 AND (banner_startdate=0 OR banner_startdate<=".time().") AND (banner_enddate=0 OR banner_enddate>".time().") AND (banner_impurchased=0 OR banner_impressions<=banner_impurchased) ORDER BY RAND($seed)";
-}
-$sql -> db_Select("banner", "*", $query);
-$row = $sql -> db_Fetch(); extract($row);
-$text = "<div style='text-align:center'><a href='".e_BASE."banner.php?".$banner_id."'  rel='external'><img src='".e_IMAGE."banners/".$banner_image."' alt='".$banner_clickurl."' style='border:0' /></a></div>";
-$sql -> db_Update("banner", "banner_impressions=banner_impressions+1 WHERE banner_id='$banner_id' ");
-
-
-$ns -> tablerender($menu_pref['banner_caption'], $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/banner_menu/banner_menu.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2005/12/14 17:37:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/*
+To define your own banner to use here ...
+
+1. Go to admin -> banners and create a campaign, then add your banner to it
+2. Add this line to this file ...
+
+	$campaign = NAME_OF_YOUR_CAMPAIGN
+
+3. Save file
+*/
+
+
+if(!isset($campaign))
+{
+	if (isset($menu_pref['banner_campaign']) && $menu_pref['banner_campaign'])
+	{
+		if(strstr($menu_pref['banner_campaign'], "|"))
+		{
+			$campaignlist = explode("|", $menu_pref['banner_campaign']);
+			$campaignlist = array_slice($campaignlist, 0, -1);
+			$parm = $campaignlist[0];
+		}
+		else
+		{
+			$parm = $menu_pref['banner_campaign'];
+		}
+	}
+}
+
+$bannersccode = file_get_contents(e_FILE."shortcode/banner.sc");
+$text = eval($bannersccode);
+
+if (isset($menu_pref['banner_rendertype']) && $menu_pref['banner_rendertype'] == 2)
+{
+	$ns->tablerender($menu_pref['banner_caption'], $text);
+}
+else
+{
+	echo $text;
+}
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/banner_menu/config.php 75/e107_plugins/banner_menu/config.php
--- 6171/e107_plugins/banner_menu/config.php	2004-06-07 17:18:16.000000000 -0500
+++ 75/e107_plugins/banner_menu/config.php	2005-10-30 07:58:48.000000000 -0600
@@ -1,66 +1,259 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-|
-|	Based on code by Edwin van der Wal (evdwal@xs4all.nl)
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
-require_once(e_ADMIN."auth.php");
-
-@include_once(e_PLUGIN."banner_menu/languages/".e_LANGUAGE.".php");
-@include_once(e_PLUGIN."banner_menu/languages/English.php");
-
-if(IsSet($_POST['update_menu'])){
-	foreach($_POST as $k => $v){
-		if(preg_match("#^banner_#",$k)){
-			$menu_pref[$k] = $v;
-		}
-	}
-	$tmp = addslashes(serialize($menu_pref));
-	$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
-	$ns -> tablerender("", "<div style='text-align:center'><b>".BANNER_MENU_L2."</b></div>");
-}
-
-if(!$menu_pref['banner_caption']){
-	$menu_pref['banner2_caption'] = BANNER_MENU_L1;
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
-<table style='width:85%' class='fborder' >
-
-<tr>
-<td style='width:40%' class='forumheader3'>".BANNER_MENU_L3.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='banner_caption' size='20' value='".$menu_pref['banner_caption']."' maxlength='100' />
-</td>
-</tr>
-
-
-<tr>
-<td style='width:40%' class='forumheader3'>".BANNER_MENU_L4.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='banner_campaign' size='30' value='".$menu_pref['banner_campaign']."' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='Update Menu Settings' /></td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender(BANNER_MENU_L5, $text);
-
-require_once(e_ADMIN."footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/banner_menu/config.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/10/30 13:58:48 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+$eplug_admin = TRUE;
+require_once("../../class2.php");
+if (!getperms("1")) {
+	header("location:".e_BASE."index.php");
+	 exit ;
+}
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+	
+@include_once(e_PLUGIN."banner_menu/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."banner_menu/languages/English.php");
+	
+$lan_file = e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php";
+include(file_exists($lan_file) ? $lan_file : e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php");
+	
+if (e_QUERY) {
+	$tmp = explode(".", e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	$id = $tmp[2];
+	unset($tmp);
+}
+	
+if (isset($_POST['update_menu'])) {
+	foreach($_POST as $k => $v) {
+		if (strpos($k, "banner_") === 0) {
+			$menu_pref[$k] = $v;
+		}
+	}
+	 
+	if (isset($_POST['catid'])) {
+		$array_cat = explode("-", $_POST['catid']);
+		for($i = 0; $i < count($array_cat); $i++) {
+			$cat .= $array_cat[$i]."|";
+		}
+		$cat = substr($cat, 0, -1);
+		$menu_pref['banner_campaign'] = $cat;
+	}
+	 
+	$sysprefs->setArray('menu_pref');
+	$ns->tablerender("", "<div style='text-align:center'><b>".BANNER_MENU_L2."</b></div>");
+}
+	
+if (!$menu_pref['banner_caption']) {
+	$menu_pref['banner2_caption'] = BANNER_MENU_L1;
+}
+	
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."' name='menu_conf_form'>
+	<table style='width:85%' class='fborder' >
+	 
+	<tr>
+	<td style='width:40%' class='forumheader3'>".BANNER_MENU_L3.": </td>
+	<td style='width:60%' class='forumheader3'>
+	<input class='tbox' type='text' name='banner_caption' size='20' value='".$menu_pref['banner_caption']."' maxlength='100' />
+	</td>
+	</tr>";
+	
+$array_cat_in = explode("|", $menu_pref['banner_campaign']);
+	
+$c = 0;
+ $d = 0;
+$sql2 = new db;
+$category_total = $sql2->db_Select("banner", "DISTINCT(SUBSTRING_INDEX(banner_campaign, '^', 1)) as banner_campaign", "ORDER BY banner_campaign", "mode=no_where");
+while ($row = $sql2->db_Fetch()) {
+	extract($row);
+	if (in_array($banner_campaign, $array_cat_in)) {
+		$in_catname[$c] = $banner_campaign;
+		$c++;
+	} else {
+		$out_catname[$d] = $banner_campaign;
+		$d++;
+	}
+}
+	
+$text .= "
+	<tr>
+	<td style='width:40%' class='forumheader3'>".BANNER_MENU_L6."</td>
+	<td style='width:60%' class='forumheader3'>
+	 
+	<table style='width:90%'>
+	<tr>
+	<td style='width:45%; vertical-align:top'>".BANNER_MENU_L7."<br />
+	<select class='tbox' id='catout' name='catout' size='10' style='width:180px' multiple='multiple' onchange='moveOver();'>";
+for($a = 0; $a <= ($d-1); $a++) {
+	$text .= "<option value='".$out_catname[$a]."'>".$out_catname[$a]."</option>";
+}
+$text .= "</select>
+	</td>
+	<td style='width:45%; vertical-align:top'>".BANNER_MENU_L8."<br />
+	<select class='tbox' id='catin' name='catin' size='10' style='width:180px' multiple='multiple'>";
+for($a = 0; $a <= ($c-1); $a++) {
+	$catidvalues .= $in_catname[$a]."-";
+	$text .= "<option value='".$in_catname[$a]."'>".$in_catname[$a]."</option>";
+}
+$catidvalues = substr($catidvalues, 0, -1);
+$text .= "</select><br /><br />
+	<input class='button' type='button' value='".BANNER_MENU_L9."' onclick='removeMe();' />
+	<input type='hidden' name='catid' id='catid' value='".$catidvalues."'>
+	</td>
+	</tr>
+	</table>
+	 
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:40%' class='forumheader3'>".BANNER_MENU_L10."</td>
+	<td style='width:60%' class='forumheader3'>
+	<select class='tbox' id='banner_rendertype' name='banner_rendertype' size='1'  >
+	".$rs->form_option(BANNER_MENU_L11, (!$menu_pref['banner_rendertype'] || $menu_pref['banner_rendertype'] == "0" ? "1" : "0"), 0)."
+	".$rs->form_option("1 - ".BANNER_MENU_L12."", ($menu_pref['banner_rendertype'] == "1" ? "1" : "0"), 1)."
+	".$rs->form_option("2 - ".BANNER_MENU_L13."", ($menu_pref['banner_rendertype'] == "2" ? "1" : "0"), 2)."
+	".$rs->form_option("3 - ".BANNER_MENU_L14."", ($menu_pref['banner_rendertype'] == "3" ? "1" : "0"), 3)."
+	".$rs->form_select_close()."
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:40%' class='forumheader3'>".BANNER_MENU_L15."<br /><span class='smalltext' style='font-style:italic;'>".BANNER_MENU_L16."</span></td>
+	<td style='width:60%' class='forumheader3'>
+	<select class='tbox' id='banner_amount' name='banner_amount' size='1'  >
+	".$rs->form_option(BANNER_MENU_L17, (!$menu_pref['banner_amount'] ? "1" : "0"), 0);
+for($b = 1; $b < 6; $b++) {
+	$text .= $rs->form_option($b, ($menu_pref['banner_amount'] == $b ? "1" : "0"), $b);
+}
+$text .= $rs->form_select_close()."
+	</td>
+	</tr>
+	 
+	<tr>
+	<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='".BANNER_MENU_L18."' /></td>
+	</tr>
+	 
+	</table>
+	</form>
+	</div>";
+	
+$ns->tablerender(BANNER_MENU_L5, $text);
+	
+	
+require_once(e_ADMIN."footer.php");
+	
+function headerjs() {
+	 
+	$script_js = "<script type=\"text/javascript\">
+		//<!--
+		//<!-- Adapted from original:  Kathi O'Shea (Kathi.O'Shea@internet.com) -->
+		 
+		function moveOver(){
+		var boxLength = document.getElementById('catin').length;
+		var selectedItem = document.getElementById('catout').selectedIndex;
+		var selectedText = document.getElementById('catout').options[selectedItem].text;
+		var selectedValue = document.getElementById('catout').options[selectedItem].value;
+		 
+		var i;
+		var isNew = true;
+		if (boxLength != 0) {
+		for (i = 0; i < boxLength; i++) {
+		thisitem = document.getElementById('catin').options[i].text;
+		if (thisitem == selectedText) {
+		isNew = false;
+		break;
+		}
+		}
+		}
+		if (isNew) {
+		newoption = new Option(selectedText, selectedValue, false, false);
+		document.getElementById('catin').options[boxLength] = newoption;
+		document.getElementById('catout').options[selectedItem].text = '';
+		}
+		document.getElementById('catout').selectedIndex=-1;
+		 
+		saveMe();
+		}
+		 
+		function removeMe() {
+		var boxLength = document.getElementById('catin').length;
+		var boxLength2 = document.getElementById('catout').length;
+		arrSelected = new Array();
+		var count = 0;
+		for (i = 0; i < boxLength; i++) {
+		if (document.getElementById('catin').options[i].selected) {
+		arrSelected[count] = document.getElementById('catin').options[i].value;
+		var valname = document.getElementById('catin').options[i].text;
+		for (j = 0; j < boxLength2; j++) {
+		if (document.getElementById('catout').options[j].value == arrSelected[count]){
+		document.getElementById('catout').options[j].text = valname;
+		}
+		}
+		}
+		count++;
+		}
+		var x;
+		for (i = 0; i < boxLength; i++) {
+		for (x = 0; x < arrSelected.length; x++) {
+		if (document.getElementById('catin').options[i].value == arrSelected[x]) {
+		document.getElementById('catin').options[i] = null;
+		}
+		}
+		boxLength = document.getElementById('catin').length;
+		}
+		 
+		saveMe();
+		}
+		 
+		//function clearMe(clid){
+		// location.href = document.location + \"?clear.\" + clid;
+		//}
+		 
+		function saveMe(clid) {
+		var strValues = \"\";
+		var boxLength = document.getElementById('catin').length;
+		var count = 0;
+		if (boxLength != 0) {
+		for (i = 0; i < boxLength; i++) {
+		if (count == 0) {
+		strValues = document.getElementById('catin').options[i].value;
+		}
+		else {
+		strValues = strValues + \"-\" + document.getElementById('catin').options[i].value;
+		}
+		count++;
+		}
+		}
+		if (strValues.length == 0) {
+		//alert(\"You have not made any selections\");
+		document.getElementById('catid').value = \"\";
+		}
+		else {
+		document.getElementById('catid').value = strValues;
+		}
+		}
+		 
+		// -->
+		</script>\n";
+	return $script_js;
+}
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/banner_menu/languages/English.php 75/e107_plugins/banner_menu/languages/English.php
--- 6171/e107_plugins/banner_menu/languages/English.php	2004-06-07 17:18:20.000000000 -0500
+++ 75/e107_plugins/banner_menu/languages/English.php	2005-01-27 13:52:35.000000000 -0600
@@ -1,23 +1,34 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("BANNER_MENU_L1", "Advertisement");
-define("BANNER_MENU_L2", "Banner menu configuration saved");
-
-//v.617
-define("BANNER_MENU_L3", "Caption");
-define("BANNER_MENU_L4", "Campaign");
-define("BANNER_MENU_L5", "Banner Menu Configuration");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/banner_menu/languages/English.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/01/27 19:52:35 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+	
+define("BANNER_MENU_L1", "Advertisement");
+define("BANNER_MENU_L2", "Banner menu configuration saved");
+	
+//v.617
+define("BANNER_MENU_L3", "Caption");
+define("BANNER_MENU_L4", "Campaign");
+define("BANNER_MENU_L5", "Banner Menu Configuration");
+define("BANNER_MENU_L6", "choose campaigns to show in menu");
+define("BANNER_MENU_L7", "available campaigns");
+define("BANNER_MENU_L8", "selected campaigns");
+define("BANNER_MENU_L9", "remove selection");
+define("BANNER_MENU_L10", "how should the selected campaigns be shown ?");
+define("BANNER_MENU_L11", "choose render type ...");
+define("BANNER_MENU_L12", "one campaign in single menu");
+define("BANNER_MENU_L13", "all selected campaigns in single menu");
+define("BANNER_MENU_L14", "all selected campaigns in seperate menus");
+define("BANNER_MENU_L15", "how many banners should be shown ?");
+define("BANNER_MENU_L16", "this setting will only be used with options 2 and 3.<br />if less banners are present the maximum available amount will be used.");
+define("BANNER_MENU_L17", "set amount ...");
+define("BANNER_MENU_L18", "Update Menu Settings");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/blogcalendar_menu/archive.php 75/e107_plugins/blogcalendar_menu/archive.php
--- 6171/e107_plugins/blogcalendar_menu/archive.php	2004-09-03 13:31:42.000000000 -0500
+++ 75/e107_plugins/blogcalendar_menu/archive.php	2005-12-28 10:12:59.000000000 -0600
@@ -1,125 +1,135 @@
-<?php
-/******************************************************************\
- *                                                                *
- *  :: e107 blogcal addon ::                                      *
- *                                                                *
- *  file:   archive.php                                           *
- *  author: Thomas Bouve                                          *
- *  email:  crahan@gmx.net                                        *
- *  date:   2004-02-08                                            *
- *                                                                *
-\******************************************************************/
-require_once("../../class2.php");
-require_once(e_HANDLER."userclass_class.php");
-
-$lan_file=e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php";
-if(file_exists($lan_file)){
-        require_once($lan_file);
-} else {
-        require_once(e_PLUGIN."blogcalendar_menu/languages/English.php");
-};
-require_once("calendar.php");
-require_once("functions.php");
-require_once(HEADERF);
-
-// ---------------------
-// initialize some cruft
-// ---------------------
-$sql = new db;
-$prefix = e_PLUGIN."blogcalendar_menu";
-$marray = array(BLOGCAL_M1,BLOGCAL_M2,BLOGCAL_M3,BLOGCAL_M4,
-                BLOGCAL_M5,BLOGCAL_M6,BLOGCAL_M7,BLOGCAL_M8,
-                BLOGCAL_M9,BLOGCAL_M10,BLOGCAL_M11,BLOGCAL_M12);
-// if nr of rows per month is not set, default to 3
-$months_per_row = $pref['blogcal_mpr']?$pref['blogcal_mpr']:"3";
-$pref['blogcal_ws'] = "monday";
-
-// -------------------------------------
-// what year are we supposed to display?
-// -------------------------------------
-$cur_year = date("Y");
-$cur_month = date("n");
-$cur_day = date("j");
-if(strstr(e_QUERY, "year")){
-    $tmp = explode(".", e_QUERY);
-    $req_year = $tmp[1];
-}else{
-    $req_year = $cur_year;
-}
-
-
-// --------------------------------
-// look for the first and last year
-// --------------------------------
-$sql -> db_Select_gen("SELECT news_id, news_datestamp from ".MPREFIX."news ORDER BY news_datestamp LIMIT 0,1");
-$first_post = $sql -> db_Fetch();
-$start_year = date("Y", $first_post['news_datestamp']);
-$end_year = $cur_year;
-
-
-// ----------------------
-// build the yearselector
-// ----------------------
-$year_selector = "<div class='forumheader' style='text-align: center; margin-bottom: 2px;'>";
-$year_selector .= "".BLOGCAL_ARCHIV1.": <select name='activate' onChange='urljump(this.options[selectedIndex].value)' class='tbox'>";
-
-for($i=$start_year; $i<=$end_year; $i++){
-    $start = mktime(0,0,0,1,1,$req_year);
-    $end = mktime(23,59,59,12,31,$req_year);
-    if($sql -> db_Select("news", "news_id, news_datestamp, news_class","news_datestamp > $start AND news_datestamp < $end")){
-        // create the option entry
-        $year_link=$prefix."/archive.php?year.".$i;
-        $year_selector .= "<option value='".$year_link."'";
-
-        if($i == $req_year){
-            $year_selector .= " selected";
-            while($news = $sql -> db_Fetch()){
-                                if(check_class($news['news_class'])){
-                                        list($xmonth, $xday) = explode(" ",date("n j",$news['news_datestamp']));
-                                        if(!$day_links[$xmonth][$xday]){
-                                                $day_links[$xmonth][$xday]=e_BASE."news.php?day.".formatdate($req_year,$xmonth,$xday);
-                                        }
-                                }
-            }
-        }
-        $year_selector .= ">".$i."</option>";
-    }
-}
-
-$year_selector .= "</select>";
-
-
-// --------------------------
-// create the archive display
-// --------------------------
-$newline = 0;
-$archive = "<div style='text-align:center'><table border='0' cellspacing='7'><tr>";
-$archive .= "<td colspan='$months_per_row'><div>$year_selector</div></td></tr><tr>";
-for($i=1; $i<=12; $i++){
-    if(++$newline == $months_per_row+1){
-        $archive .= "</tr><tr>";
-        $newline = 1;
-    }
-    $archive .= "<td style='vertical-align:top'>";
-    $archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>";
-
-    // href the current month regardless of newsposts or any month with news
-    if(($req_year == $cur_year && $i == $cur_month) || $day_links[$i]){
-        $archive .= "<a class='forumlink' href='".e_BASE."news.php?month.".formatDate($req_year,$i)."'>".$marray[$i-1]."</a>";
-    }else{
-        $archive .= $marray[$i-1];
-    }
-
-    $archive .= "</div>";
-    if(($req_year == $cur_year) && ($i == $cur_month)){
-        $req_day = $cur_day;
-    }else{
-        $req_day = "";
-    }
-    $archive .= "<div>".calendar($req_day, $i, $req_year, $day_links[$i], $pref['blogcal_ws'])."</div></td>\n";
-}
-$archive .= "</tr></table></div>";
-$ns -> tablerender(BLOGCAL_L2 ."&nbsp;$req_year", $archive);
-
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/blogcalendar_menu/archive.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/28 16:12:59 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+| Based on code by: Thomas Bouve (crahan@gmx.net)
+*/
+	
+require_once("../../class2.php");
+require_once(e_HANDLER."userclass_class.php");
+	
+$lan_file = e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php";
+if (file_exists($lan_file)) {
+	require_once($lan_file);
+} else {
+	require_once(e_PLUGIN."blogcalendar_menu/languages/English.php");
+};
+require_once("calendar.php");
+require_once("functions.php");
+require_once(HEADERF);
+	
+// ---------------------
+// initialize some cruft
+// ---------------------
+$sql = new db;
+$prefix = e_PLUGIN."blogcalendar_menu";
+$marray = array(BLOGCAL_M1, BLOGCAL_M2, BLOGCAL_M3, BLOGCAL_M4,
+	BLOGCAL_M5, BLOGCAL_M6, BLOGCAL_M7, BLOGCAL_M8,
+	BLOGCAL_M9, BLOGCAL_M10, BLOGCAL_M11, BLOGCAL_M12);
+// if nr of rows per month is not set, default to 3
+$months_per_row = $pref['blogcal_mpr']?$pref['blogcal_mpr']:
+"3";
+$pref['blogcal_ws'] = "monday";
+	
+// -------------------------------------
+// what year are we supposed to display?
+// -------------------------------------
+$cur_year = date("Y");
+$cur_month = date("n");
+$cur_day = date("j");
+if (strstr(e_QUERY, "year")) {
+	$tmp = explode(".", e_QUERY);
+	$req_year = $tmp[1];
+} else {
+	$req_year = $cur_year;
+}
+	
+	
+// --------------------------------
+// look for the first and last year
+// --------------------------------
+$sql->db_Select_gen("SELECT news_id, news_datestamp from ".MPREFIX."news ORDER BY news_datestamp LIMIT 0,1");
+$first_post = $sql->db_Fetch();
+$start_year = date("Y", $first_post['news_datestamp']);
+$end_year = $cur_year;
+	
+	
+// ----------------------
+// build the yearselector
+// ----------------------
+$year_selector = "<div class='forumheader' style='text-align: center; margin-bottom: 2px;'>";
+$year_selector .= "".BLOGCAL_ARCHIV1.": <select name='activate' onChange='urljump(this.options[selectedIndex].value)' class='tbox'>";
+	
+for($i = $start_year; $i <= $end_year; $i++) {
+	$start = mktime(0, 0, 0, 1, 1, intval($req_year));
+	$end = mktime(23, 59, 59, 12, 31, intval($req_year));
+	if ($sql->db_Select("news", "news_id, news_datestamp, news_class", "news_datestamp > $start AND news_datestamp < $end")) {
+		// create the option entry
+		$year_link = $prefix."/archive.php?year.".$i;
+		$year_selector .= "<option value='".$year_link."'";
+		 
+		if ($i == $req_year) {
+			$year_selector .= " selected";
+			while ($news = $sql->db_Fetch()) {
+				if (check_class($news['news_class'])) {
+					list($xmonth, $xday) = explode(" ", date("n j", $news['news_datestamp']));
+					if (!$day_links[$xmonth][$xday]) {
+						$day_links[$xmonth][$xday] = e_BASE."news.php?day.".formatdate($req_year, $xmonth, $xday);
+					}
+				}
+			}
+		}
+		$year_selector .= ">".$i."</option>";
+	}
+}
+	
+$year_selector .= "</select>";
+	
+	
+// --------------------------
+// create the archive display
+// --------------------------
+$newline = 0;
+$archive = "<div style='text-align:center'><table border='0' cellspacing='7'><tr>";
+$archive .= "<td colspan='$months_per_row'><div>$year_selector</div></td></tr><tr>";
+for($i = 1; $i <= 12; $i++) {
+	if (++$newline == $months_per_row+1) {
+		$archive .= "</tr><tr>";
+		$newline = 1;
+	}
+	$archive .= "<td style='vertical-align:top'>";
+	$archive .= "<div class='fcaption' style='text-align:center; margin-bottom:2px;'>";
+	 
+	// href the current month regardless of newsposts or any month with news
+	if (($req_year == $cur_year && $i == $cur_month) || $day_links[$i]) {
+		$archive .= "<a class='forumlink' href='".e_BASE."news.php?month.".formatDate($req_year, $i)."'>".$marray[$i-1]."</a>";
+	} else {
+		$archive .= $marray[$i-1];
+	}
+	 
+	$archive .= "</div>";
+	if (($req_year == $cur_year) && ($i == $cur_month)) {
+		$req_day = $cur_day;
+	} else {
+		$req_day = "";
+	}
+	$archive .= "<div>".calendar($req_day, $i, $req_year, $day_links[$i], $pref['blogcal_ws'])."</div></td>\n";
+}
+$archive .= "</tr></table></div>";
+$ns->tablerender(BLOGCAL_L2 ."&nbsp;$req_year", $archive);
+	
+require_once(FOOTERF);
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/blogcalendar_menu/blogcalendar_menu.php 75/e107_plugins/blogcalendar_menu/blogcalendar_menu.php
--- 6171/e107_plugins/blogcalendar_menu/blogcalendar_menu.php	2004-04-16 06:16:02.000000000 -0500
+++ 75/e107_plugins/blogcalendar_menu/blogcalendar_menu.php	2005-12-28 10:12:59.000000000 -0600
@@ -1,122 +1,131 @@
-<?php
-/******************************************************************\
- *                                                                *
- *  :: e107 blogcal addon ::                                      *                            
- *                                                                *
- *  file:   blogcalendar_menu.php                                 *
- *  author: Thomas Bouve                                          *
- *  email:  crahan@gmx.net                                        *
- *  date:   2004-02-08                                            *
- *                                                                *
-\******************************************************************/
-require_once(e_PLUGIN."blogcalendar_menu/calendar.php");
-require_once(e_PLUGIN."blogcalendar_menu/functions.php");
-
-// ------------------------------
-// initialization + fetch options
-// ------------------------------
-$sql = new db;
-$prefix = e_PLUGIN."blogcalendar_menu"; 
-$marray = array(BLOGCAL_M1,BLOGCAL_M2,BLOGCAL_M3,BLOGCAL_M4,
-	        BLOGCAL_M5,BLOGCAL_M6,BLOGCAL_M7,BLOGCAL_M8,
-		BLOGCAL_M9,BLOGCAL_M10,BLOGCAL_M11,BLOGCAL_M12);
-$pref['blogcal_ws'] = "monday";
-
-// ----------------------------------------------
-// get the requested and current date information
-// ----------------------------------------------
-list($cur_year, $cur_month, $cur_day) = explode(" ",date("Y n j"));
-if(strstr(e_QUERY, "day")){
-  $tmp = explode(".", e_QUERY);
-  $item = $tmp[1];
-  $req_year = substr($item, 0, 4);
-  $req_month = substr($item, 4, 2);
-  // decide on the behaviour here, do we highlight
-  // the day being viewed? or only 'today'?
-  //$req_day = substr($item, 6, 2);
-  // if the requested year and month are the current, then add
-  // the current day to the mix so the calendar highlights it
-  if(($req_year == $cur_year) && ($req_month == $cur_month)){
-    $req_day = $cur_day;
-  }else{
-    $req_day = "";
-  }
-}else if(strstr(e_QUERY, "month")){
-  $tmp = explode(".", e_QUERY);
-  $item = $tmp[1];
-  $req_year = substr($item, 0, 4);
-  $req_month = substr($item, 4, 2);
-  // if the requested year and month are the current, then add
-  // the current day to the mix so the calendar highlights it
-  if(($req_year == $cur_year) && ($req_month == $cur_month)){
-    $req_day = $cur_day;
-  }else{
-    $req_day = "";
-  }
-}else{
-  $req_year = $cur_year;
-  $req_month = $cur_month;
-  $req_day = $cur_day;
-}
-
-
-// -------------------------------------------
-// get links to all newsitems in current month
-// -------------------------------------------
-$start = mktime(0,0,0,$req_month,1,$req_year);
-$lastday = date("t", $start);
-$end = mktime(23,59,59,$req_month,$lastday,$req_year);
-$sql -> db_Select("news", "news_id, news_datestamp, news_class","news_datestamp > $start AND news_datestamp < $end");
-while($news =  $sql -> db_Fetch()){
-	if(check_class($news['news_class'])){
-		$xday = date("j",$news['news_datestamp']);
-		if(!$day_links[$xday]){
-			$day_links[$xday]=e_BASE."news.php?day.".formatDate($req_year,$req_month,$xday);
-		}
-	}
-}
-
-
-// -------------------------------
-// create the month selection item
-// -------------------------------
-$month_selector =  "<div class='forumheader' style='text-align: center; margin-bottom: 2px;'>";
-$month_selector .= "<select name='activate' onChange='urljump(this.options[selectedIndex].value)' class='tbox'>";
-
-// get all newsposts since the beginning of the year till now
-$start = mktime(0,0,0,1,1,$req_year);
-$end= time();
-$sql -> db_Select("news", "news_id, news_datestamp", "news_datestamp > $start AND news_datestamp < $end");
-while($news =  $sql -> db_Fetch()){
-   $xmonth = date("n",$news['news_datestamp']);
-   if(!$month_links[$xmonth]){
-      $month_links[$xmonth]=e_BASE."news.php?month.".formatDate($req_year,$xmonth);
-   }
-}
-
-// if we're listing the current year, add the current month to the list regardless of posts
-if($req_year == $cur_year){
-    $month_links[$cur_month]=e_BASE."news.php?month.".formatDate($cur_year,$cur_month);
-}
-
-// go over the link array and create the option fields
-foreach($month_links as $index => $val){
-    $month_selector .= "<option value='".$val."'";
-    $month_selector .= ($index == $req_month)?" selected":"";
-    $month_selector .= ">".$marray[$index-1]."</option>";
-}
-
-// close the select item
-$month_selector .= "</select></div>";
-
-
-// ------------------------
-// create and show calendar
-// ------------------------
-$menu = "<div style='text-align: center;'><table border='0' cellspacing='7'>";
-$menu .= "<tr><td>$month_selector";
-$menu .= "<div style='text-align:center'>".calendar($req_day, $req_month, $req_year, $day_links, $pref['blogcal_ws'])."</div>";
-$menu .= "<div class='forumheader' style='text-align: center; margin-top:2px;'><span class='smalltext'><a href='$prefix/archive.php'>".BLOGCAL_L2."</a></span></div></td></tr>";
-$menu .= "</table></div>";
-$ns -> tablerender(BLOGCAL_L1." ".$req_year, $menu);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/blogcalendar_menu/blogcalendar_menu.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/28 16:12:59 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+| Based on code by: Thomas Bouve (crahan@gmx.net)
+*/
+if (!defined('e107_INIT')) { exit; }
+
+require_once(e_PLUGIN."blogcalendar_menu/calendar.php");
+require_once(e_PLUGIN."blogcalendar_menu/functions.php");
+	
+// ------------------------------
+// initialization + fetch options
+// ------------------------------
+$prefix = e_PLUGIN."blogcalendar_menu";
+$marray = array(BLOGCAL_M1, BLOGCAL_M2, BLOGCAL_M3, BLOGCAL_M4,
+	BLOGCAL_M5, BLOGCAL_M6, BLOGCAL_M7, BLOGCAL_M8,
+	BLOGCAL_M9, BLOGCAL_M10, BLOGCAL_M11, BLOGCAL_M12);
+$pref['blogcal_ws'] = "monday";
+	
+// ----------------------------------------------
+// get the requested and current date information
+// ----------------------------------------------
+list($cur_year, $cur_month, $cur_day) = explode(" ", date("Y n j"));
+if (strstr(e_QUERY, "day")) {
+	$tmp = explode(".", e_QUERY);
+	$item = $tmp[1];
+	$req_year = substr($item, 0, 4);
+	$req_month = substr($item, 4, 2);
+	// decide on the behaviour here, do we highlight
+	// the day being viewed? or only 'today'?
+	//$req_day = substr($item, 6, 2);
+	// if the requested year and month are the current, then add
+	// the current day to the mix so the calendar highlights it
+	if (($req_year == $cur_year) && ($req_month == $cur_month)) {
+		$req_day = $cur_day;
+	} else {
+		$req_day = "";
+	}
+}
+else if(strstr(e_QUERY, "month")) {
+	$tmp = explode(".", e_QUERY);
+	$item = $tmp[1];
+	$req_year = substr($item, 0, 4);
+	$req_month = substr($item, 4, 2);
+	// if the requested year and month are the current, then add
+	// the current day to the mix so the calendar highlights it
+	if (($req_year == $cur_year) && ($req_month == $cur_month)) {
+		$req_day = $cur_day;
+	} else {
+		$req_day = "";
+	}
+} else {
+	$req_year = $cur_year;
+	$req_month = $cur_month;
+	$req_day = $cur_day;
+}
+	
+// -------------------------------
+// create the month selection item
+// -------------------------------
+$month_selector = "<div class='forumheader' style='text-align: center; margin-bottom: 2px;'>";
+$month_selector .= "<select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox'>";
+
+// get all newsposts since the beginning of the year till now
+// -------------------------------------------
+// get links to all newsitems in current month
+// -------------------------------------------
+$month_start = mktime(0, 0, 0, $req_month, 1, $req_year);
+$lastday = date("t", $month_start);
+$month_end = mktime(23, 59, 59, $req_month, $lastday, $req_year);
+$start = mktime(0, 0, 0, 1, 1, $req_year);
+$end = time();
+$sql->db_Select("news", "news_id, news_datestamp", "news_class IN (".USERCLASS_LIST.") AND news_datestamp > ".intval($start)." AND news_datestamp < ".intval($end));
+while ($news = $sql->db_Fetch())
+{
+	$xmonth = date("n", $news['news_datestamp']);
+	if (!isset($month_links[$xmonth]) || !$month_links[$xmonth])
+	{
+		$month_links[$xmonth] = e_BASE."news.php?month.".formatDate($req_year, $xmonth);
+	}
+	if($news['news_datestamp'] >= $month_start AND $news['news_datestamp'] <= $month_end)
+	{
+		$xday = date("j", $news['news_datestamp']);
+		if (!isset($day_links[$xday]) || !$day_links[$xday])
+		{
+			$day_links[$xday] = e_BASE."news.php?day.".formatDate($req_year, $req_month, $xday);
+		}
+	}
+}
+
+// if we're listing the current year, add the current month to the list regardless of posts
+if ($req_year == $cur_year) {
+	$month_links[$cur_month] = e_BASE."news.php?month.".formatDate($cur_year, $cur_month);
+}
+	
+// go over the link array and create the option fields
+foreach($month_links as $index => $val) {
+	$month_selector .= "<option value='".$val."'";
+	$month_selector .= ($index == $req_month)?" selected='selected'":
+	"";
+	$month_selector .= ">".$marray[$index-1]."</option>";
+}
+	
+// close the select item
+$month_selector .= "</select></div>";
+	
+	
+// ------------------------
+// create and show calendar
+// ------------------------
+$menu = "<div style='text-align: center;'><table border='0' cellspacing='7'>";
+$menu .= "<tr><td>$month_selector";
+$menu .= "<div style='text-align:center'>".calendar($req_day, $req_month, $req_year, $day_links, $pref['blogcal_ws'])."</div>";
+$menu .= "<div class='forumheader' style='text-align: center; margin-top:2px;'><span class='smalltext'><a href='$prefix/archive.php'>".BLOGCAL_L2."</a></span></div></td></tr>";
+$menu .= "</table></div>";
+$ns->tablerender(BLOGCAL_L1." ".$req_year, $menu, 'blog_calender');
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/blogcalendar_menu/calendar.php 75/e107_plugins/blogcalendar_menu/calendar.php
--- 6171/e107_plugins/blogcalendar_menu/calendar.php	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/blogcalendar_menu/calendar.php	2005-12-14 13:28:43.000000000 -0600
@@ -1,88 +1,102 @@
-<?php
-/******************************************************************\
- *                                                                *
- *  :: e107 blogcal addon ::                                      *                            
- *                                                                *
- *  file:     calendar.php                                        *
- *  author:   Thomas Bouve                                        *
- *  email:    crahan@gmx.net                                      *
- *  Date:     2004-02-08                                          *
- *  Based on: PHP Calendar by Keith Devens                        *
- *            http://www.keithdevens.com/software/php_calendar/   *
- *                                                                *
-\******************************************************************/
-function calendar($req_day, $req_month, $req_year, $links = NULL, $ws = "sunday"){
-    // get access to the preferences
-    global $pref;
-    
-    // prepare the day array
-    $darray = array(BLOGCAL_D1,BLOGCAL_D2,BLOGCAL_D3,BLOGCAL_D4,
-		    BLOGCAL_D5,BLOGCAL_D6,BLOGCAL_D7);
-
-    // what day does the week start on?
-    switch($ws){
-        case "monday": $ws="1"; break;
-        case "sunday": array_unshift($darray, array_pop($darray));
-		       $ws="0";
-    }
-    
-    // what's the padding we should use for the cells?
-    $padding = $pref['blogcal_padding']?$pref['blogcal_padding']:"2";
-
-    $date = mktime(0,0,0,$req_month,1,$req_year);
-    $last_day = date('t',$date);
-    $date_info = getdate($date);
-    $day_of_week = $date_info['wday'];
-    if($ws && $day_of_week==0) $day_of_week = 7;
-
-    // print the daynames
-    $calendar = "<table class='fborder'>";
-    $calendar .= '<tr>';
-    foreach($darray as $dheader){
-	$calendar .= "<td class='forumheader' style='padding: ".$padding."px;'><span class='smalltext'>$dheader</span></td>";
-    }
-    $calendar .= "</tr>";
-    $calendar .= '<tr>';
-
-    $day_of_month = 1;
-    $tablerow = 1;
-
-    // take care of the first "empty" days of the month
-    if($day_of_week-$ws > 0){
-        $calendar .= "<td colspan='";
-        $calendar .= $day_of_week-$ws;
-        $calendar .= "'>&nbsp;</td>";
-    }
-
-    // print the days of the month (take the $ws into account)
-    while ($day_of_month <= $last_day){
-        if($day_of_week-$ws == 7){ #start a new week
-	    $calendar .= "</tr><tr>";
-	    $day_of_week = 0+$ws;
-            $tablerow++;
-	}
-        if($day_of_month == $req_day){
-            $day_style = ($links[$day_of_month] ? "indent" : "forumheader3");  
-        }else{
-            $day_style =  ($links[$day_of_month] ? "indent" : "forumheader3");
-        }
-        $calendar .= "<td class='$day_style' style='padding: ".$padding."px;'><span class='smalltext'>";		          
-	$calendar .= ($links[$day_of_month]? "<a href='".$links[$day_of_month]."'>":""); 
-        $calendar .= $day_of_month;
-        $calendar .= ($links[$day_of_month]? "</a>":"");
-        $calendar .= "</span></td>";
-	$day_of_month++;
-	$day_of_week++;
-    }
-    if($day_of_week-$ws != 7){
-	$calendar .= '<td colspan="' . (7 - $day_of_week+$ws) . '">&nbsp;</td>';
-    }
-    $calendar .= "</tr>";
-    if($tablerow != 6){
-        $calendar .= "<tr><td style='padding: ".$padding."px;' colspan='6'>&nbsp;</td></tr>";
-    }
-   
-    $calendar .= "</table>";
-    return $calendar;
-}
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/blogcalendar_menu/calendar.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 19:28:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+| Based on code by: Thomas Bouve (crahan@gmx.net) and
+| and Based on: PHP Calendar by Keith Devens http://www.keithdevens.com/software/php_calendar/
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+function calendar($req_day, $req_month, $req_year, $links = NULL, $ws = "sunday") {
+	// get access to the preferences
+	global $pref;
+	 
+	// prepare the day array
+	$darray = array(BLOGCAL_D1, BLOGCAL_D2, BLOGCAL_D3, BLOGCAL_D4,
+		BLOGCAL_D5, BLOGCAL_D6, BLOGCAL_D7);
+	 
+	// what day does the week start on?
+	switch($ws) {
+		case "monday":
+		$ws = "1";
+		 break;
+		case "sunday":
+		 array_unshift($darray, array_pop($darray));
+		$ws = "0";
+	}
+	 
+	// what's the padding we should use for the cells?
+	$padding = (isset($pref['blogcal_padding']) && $pref['blogcal_padding']) ? $pref['blogcal_padding']: "2";
+	 
+	$date = mktime(0, 0, 0, $req_month, 1, $req_year);
+	$last_day = date('t', $date);
+	$date_info = getdate($date);
+	$day_of_week = $date_info['wday'];
+	if ($ws && $day_of_week == 0) $day_of_week = 7;
+	 
+	// print the daynames
+	$calendar = "<table class='fborder'>";
+	$calendar .= '<tr>';
+	foreach($darray as $dheader) {
+		$calendar .= "<td class='forumheader' style='padding: ".$padding."px;'><span class='smalltext'>$dheader</span></td>";
+	}
+	$calendar .= "</tr>";
+	$calendar .= '<tr>';
+	 
+	$day_of_month = 1;
+	$tablerow = 1;
+	 
+	// take care of the first "empty" days of the month
+	if ($day_of_week-$ws > 0) {
+		$calendar .= "<td colspan='";
+		$calendar .= $day_of_week-$ws;
+		$calendar .= "'>&nbsp;</td>";
+	}
+	 
+	// print the days of the month (take the $ws into account)
+	while ($day_of_month <= $last_day) {
+		if ($day_of_week-$ws == 7) {
+			#start a new week
+			$calendar .= "</tr><tr>";
+			$day_of_week = 0+$ws;
+			$tablerow++;
+		}
+		if ($day_of_month == $req_day) {
+			$day_style = isset($links[$day_of_month]) ? "indent" : "forumheader3";
+		} else {
+			$day_style = isset($links[$day_of_month]) ? "indent" : "forumheader3";
+		}
+		$calendar .= "<td class='$day_style' style='padding: ".$padding."px;'><span class='smalltext'>";
+		$calendar .= isset($links[$day_of_month]) ? "<a href='".$links[$day_of_month]."'>":"";
+		$calendar .= $day_of_month;
+		$calendar .= isset($links[$day_of_month]) ? "</a>" : "";
+		$calendar .= "</span></td>";
+		$day_of_month++;
+		$day_of_week++;
+	}
+	if ($day_of_week-$ws != 7) {
+		$calendar .= '<td colspan="' . (7 - $day_of_week+$ws) . '">&nbsp;</td>';
+	}
+	$calendar .= "</tr>";
+	if ($tablerow != 6) {
+		$calendar .= "<tr><td style='padding: ".$padding."px;' colspan='6'>&nbsp;</td></tr>";
+	}
+	 
+	$calendar .= "</table>";
+	return $calendar;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/blogcalendar_menu/config.php 75/e107_plugins/blogcalendar_menu/config.php
--- 6171/e107_plugins/blogcalendar_menu/config.php	2004-04-16 06:16:02.000000000 -0500
+++ 75/e107_plugins/blogcalendar_menu/config.php	2005-05-25 04:43:25.000000000 -0500
@@ -1,78 +1,91 @@
-<?php
-/******************************************************************\
- *                                                                *
- *  :: e107 blogcal addon ::   									  *
- *                                                                *
- *  file:     config.php                                          *
- *  author:   Thomas Bouve                                        *
- *  email:    crahan@gmx.net                                      *
- *  Date:     2004-02-08                                          *
- *                                                                *
- * Multilanguage by Juan
-\******************************************************************/
-require_once("../../class2.php");
-require_once(e_HANDLER."userclass_class.php");
-
-$lan_file=e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php";
-if(file_exists($lan_file)){
-	require_once($lan_file);
-} else {
-	require_once(e_PLUGIN."blogcalendar_menu/languages/English.php");
-}
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
-require_once(e_ADMIN."auth.php");
-
-if(IsSet($_POST['update_menu'])){
-    while(list($key, $value) = each($_POST)){
-        if($value != BLOGCAL_CONF3){ 
-            $pref[$key] = $value;
-        }
-    }
-    save_prefs();
-    $ns -> tablerender("", "<div style='text-align:center'><b>".BLOGCAL_CONF5."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
-<table style='width:85%' class='fborder' >
-
-<tr>
-<td style='width:40%' class='forumheader3'>".BLOGCAL_CONF1.": </td>
-<td style='width:60%' class='forumheader3'>
-<select class='tbox' name='blogcal_mpr'>";
-
-// if the nr of months per row is undefined, default to 3
-$months_per_row = $pref['blogcal_mpr']?$pref['blogcal_mpr']:"3";
-for($i=1; $i<=12; $i++){
-   $text .= "<option value='$i'";
-   $text .= $months_per_row==$i?"selected":"";
-   $text .= ">$i</option>";
-} 
-
-$text .= "</select>
-</td>
-</tr>
-
-<tr>
-<td style='width:40%' class='forumheader3'>".BLOGCAL_CONF2.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='blogcal_padding' size='20' value='";
-// if the cellpadding isn't defined
-$padding = $pref['blogcal_padding']?$pref['blogcal_padding']:"2";
-$text .= $padding;
-$text.= "' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'>
-    <input class='button' type='submit' name='update_menu' value='".BLOGCAL_CONF3."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender(BLOGCAL_CONF4, $text);
-
-require_once(e_ADMIN."footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/blogcalendar_menu/config.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/05/25 09:43:25 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+$eplug_admin = TRUE;
+require_once("../../class2.php");
+require_once(e_HANDLER."userclass_class.php");
+	
+$lan_file = e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php";
+if (file_exists($lan_file)) {
+	require_once($lan_file);
+} else {
+	require_once(e_PLUGIN."blogcalendar_menu/languages/English.php");
+}
+if (!getperms("1")) {
+	header("location:".e_BASE."index.php");
+	 exit ;
+}
+require_once(e_ADMIN."auth.php");
+	
+if (isset($_POST['update_menu'])) {
+	while (list($key, $value) = each($_POST)) {
+		if ($value != BLOGCAL_CONF3) {
+			$pref[$key] = $value;
+		}
+	}
+	save_prefs();
+	$ns->tablerender("", "<div style='text-align:center'><b>".BLOGCAL_CONF5."</b></div>");
+}
+	
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
+	<table style='width:85%' class='fborder' >
+	 
+	<tr>
+	<td style='width:40%' class='forumheader3'>".BLOGCAL_CONF1.": </td>
+	<td style='width:60%' class='forumheader3'>
+	<select class='tbox' name='blogcal_mpr'>";
+	
+// if the nr of months per row is undefined, default to 3
+$months_per_row = $pref['blogcal_mpr']?$pref['blogcal_mpr']:
+"3";
+for($i = 1; $i <= 12; $i++) {
+	$text .= "<option value='$i'";
+	$text .= $months_per_row == $i?"selected":
+	"";
+	$text .= ">$i</option>";
+}
+	
+$text .= "</select>
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:40%' class='forumheader3'>".BLOGCAL_CONF2.": </td>
+	<td style='width:60%' class='forumheader3'>
+	<input class='tbox' type='text' name='blogcal_padding' size='20' value='";
+// if the cellpadding isn't defined
+$padding = $pref['blogcal_padding']?$pref['blogcal_padding']:
+"2";
+$text .= $padding;
+$text .= "' maxlength='100' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td colspan='2' class='forumheader' style='text-align:center'>
+	<input class='button' type='submit' name='update_menu' value='".BLOGCAL_CONF3."' />
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+$ns->tablerender(BLOGCAL_CONF4, $text);
+	
+require_once(e_ADMIN."footer.php");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/blogcalendar_menu/functions.php 75/e107_plugins/blogcalendar_menu/functions.php
--- 6171/e107_plugins/blogcalendar_menu/functions.php	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/blogcalendar_menu/functions.php	2005-12-14 13:28:43.000000000 -0600
@@ -1,20 +1,31 @@
-<?php
-/******************************************************************\   
- *                                                                *
- *  :: e107 blogcal addon ::                                      *                            
- *                                                                *   
- *  file:     functions.php                                       *   
- *  author:   Thomas Bouve                                        *   
- *  email:    crahan@gmx.net                                      *   
- *  Date:     2004-02-02                                          *     
- *                                                                *   
-\******************************************************************/   
-
-// format a date as yyyymmdd
-function formatDate($year,$month,$day=""){  
-    $date = $year;   
-    $date .= (strlen($month)<2)?"0".$month:$month;  
-    $date .= (strlen($day)<2 && $day != "")?"0".$day:$day;
-    return $date;
-}  
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/blogcalendar_menu/functions.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+// format a date as yyyymmdd
+function formatDate($year, $month, $day = "") {
+	$date = $year;
+	$date .= (strlen($month) < 2)?"0".$month:
+	$month;
+	$date .= (strlen($day) < 2 && $day != "")?"0".$day:
+	$day;
+	return $date;
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/blogcalendar_menu/languages/Dutch.php 75/e107_plugins/blogcalendar_menu/languages/Dutch.php
--- 6171/e107_plugins/blogcalendar_menu/languages/Dutch.php	2004-04-16 06:16:04.000000000 -0500
+++ 75/e107_plugins/blogcalendar_menu/languages/Dutch.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,49 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("BLOGCAL_L1", "Nieuws voor ");
-define("BLOGCAL_L2", "Archive");
-
-define("BLOGCAL_D1", "ma");
-define("BLOGCAL_D2", "di");
-define("BLOGCAL_D3", "wo");
-define("BLOGCAL_D4", "do");
-define("BLOGCAL_D5", "vr");
-define("BLOGCAL_D6", "za");
-define("BLOGCAL_D7", "zo");
-
-define("BLOGCAL_M1", "januari");
-define("BLOGCAL_M2", "februari");
-define("BLOGCAL_M3", "maart");
-define("BLOGCAL_M4", "april");
-define("BLOGCAL_M5", "mei");
-define("BLOGCAL_M6", "juni");
-define("BLOGCAL_M7", "juli");
-define("BLOGCAL_M8", "augustus");
-define("BLOGCAL_M9", "september");
-define("BLOGCAL_M10", "oktober");
-define("BLOGCAL_M11", "november");
-define("BLOGCAL_M12", "december");
-
-define("BLOGCAL_1", "Nieuws items");
-
-define("BLOGCAL_CONF1", "Maanden/rij");
-define("BLOGCAL_CONF2", "Cellpadding");
-define("BLOGCAL_CONF3", "De Montages van het Menu van de update");
-define("BLOGCAL_CONF4", "BlogCal Menu Configuration");
-define("BLOGCAL_CONF5", "BlogCal menu configuration saved");
-
-define("BLOGCAL_ARCHIV1", "Select Archive");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/blogcalendar_menu/languages/English.php 75/e107_plugins/blogcalendar_menu/languages/English.php
--- 6171/e107_plugins/blogcalendar_menu/languages/English.php	2004-04-16 06:16:04.000000000 -0500
+++ 75/e107_plugins/blogcalendar_menu/languages/English.php	2005-01-27 13:52:36.000000000 -0600
@@ -1,49 +1,49 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("BLOGCAL_L1", "News for ");
-define("BLOGCAL_L2", "Archive");
-
-define("BLOGCAL_D1", "Mo");
-define("BLOGCAL_D2", "Tu");
-define("BLOGCAL_D3", "We");
-define("BLOGCAL_D4", "Th");
-define("BLOGCAL_D5", "Fr");
-define("BLOGCAL_D6", "Sa");
-define("BLOGCAL_D7", "Su");
-
-define("BLOGCAL_M1", "January");
-define("BLOGCAL_M2", "February");
-define("BLOGCAL_M3", "March");
-define("BLOGCAL_M4", "April");
-define("BLOGCAL_M5", "May");
-define("BLOGCAL_M6", "June");
-define("BLOGCAL_M7", "July");
-define("BLOGCAL_M8", "August");
-define("BLOGCAL_M9", "September");
-define("BLOGCAL_M10", "October");
-define("BLOGCAL_M11", "November");
-define("BLOGCAL_M12", "December");
-
-define("BLOGCAL_1", "News Items");
-
-define("BLOGCAL_CONF1", "Months/row");
-define("BLOGCAL_CONF2", "Cellpadding");
-define("BLOGCAL_CONF3", "Update Menu Settings");
-define("BLOGCAL_CONF4", "BlogCal Menu Configuration");
-define("BLOGCAL_CONF5", "BlogCal menu configuration saved");
-
-define("BLOGCAL_ARCHIV1", "Select Archive");
-
+<?php
+/*
++---------------------------------------------------------------+
+| e107 website system
+|
+| Steve Dunstan 2001-2002
+| http://e107.org
+| jalist@e107.org
+|
+| Released under the terms and conditions of the
+| GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+	
+define("BLOGCAL_L1", "News for ");
+define("BLOGCAL_L2", "Archive");
+	
+define("BLOGCAL_D1", "Mo");
+define("BLOGCAL_D2", "Tu");
+define("BLOGCAL_D3", "We");
+define("BLOGCAL_D4", "Th");
+define("BLOGCAL_D5", "Fr");
+define("BLOGCAL_D6", "Sa");
+define("BLOGCAL_D7", "Su");
+	
+define("BLOGCAL_M1", "January");
+define("BLOGCAL_M2", "February");
+define("BLOGCAL_M3", "March");
+define("BLOGCAL_M4", "April");
+define("BLOGCAL_M5", "May");
+define("BLOGCAL_M6", "June");
+define("BLOGCAL_M7", "July");
+define("BLOGCAL_M8", "August");
+define("BLOGCAL_M9", "September");
+define("BLOGCAL_M10", "October");
+define("BLOGCAL_M11", "November");
+define("BLOGCAL_M12", "December");
+	
+define("BLOGCAL_1", "News Items");
+	
+define("BLOGCAL_CONF1", "Months/row");
+define("BLOGCAL_CONF2", "Cellpadding");
+define("BLOGCAL_CONF3", "Update Menu Settings");
+define("BLOGCAL_CONF4", "BlogCal Menu Configuration");
+define("BLOGCAL_CONF5", "BlogCal menu configuration saved");
+	
+define("BLOGCAL_ARCHIV1", "Select Archive");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/blogcalendar_menu/styles.php 75/e107_plugins/blogcalendar_menu/styles.php
--- 6171/e107_plugins/blogcalendar_menu/styles.php	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/blogcalendar_menu/styles.php	2005-12-14 13:28:43.000000000 -0600
@@ -1,31 +1,49 @@
-<?php
-// -----------------------
-// blogcal menu style vars
-// -----------------------
-$bc_menu_wrapper = ;
-$menu_header = ;
-$menu_body = ;
-$menu_footer = ;
-
-
-// --------------------------
-// calendar object style vars
-// --------------------------
-$cal_header_cell = ;
-$cal_blank_cell
-$cal_cell = ;
-$cal_linked_cell = ;
-$cal_hl_cell = ;
-$cal_hl_linked_cell = ;
-
-
-// --------------------------
-// archive section style vars
-// --------------------------
-$arch_wrapper = ;
-$arch_header = ;
-$arch_cell = ;
-$arch_cell_header = ;
-$arch_cell_body = ;
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/blogcalendar_menu/styles.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// -----------------------
+// blogcal menu style vars
+// -----------------------
+$bc_menu_wrapper = ;
+$menu_header = ;
+$menu_body = ;
+$menu_footer = ;
+	
+	
+// --------------------------
+// calendar object style vars
+// --------------------------
+$cal_header_cell = ;
+$cal_blank_cell $cal_cell = ;
+$cal_linked_cell = ;
+$cal_hl_cell = ;
+$cal_hl_linked_cell = ;
+	
+	
+// --------------------------
+// archive section style vars
+// --------------------------
+$arch_wrapper = ;
+$arch_header = ;
+$arch_cell = ;
+$arch_cell_header = ;
+$arch_cell_body = ;
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/admin_config.php 75/e107_plugins/calendar_menu/admin_config.php
--- 6171/e107_plugins/calendar_menu/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/admin_config.php	2006-04-07 10:31:47.000000000 -0500
@@ -0,0 +1,414 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/admin_config.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2006/04/07 15:31:47 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+require_once(e_HANDLER."userclass_class.php");
+if (!getperms("P")) {
+	header("location:".e_BASE."index.php");
+}
+	
+$lan_file = e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
+
+if (isset($_POST['updatesettings'])) {
+	$pref['eventpost_admin'] = $_POST['eventpost_admin'];
+	$pref['eventpost_headercss'] = $_POST['eventpost_headercss'];
+	$pref['eventpost_daycss'] = $_POST['eventpost_daycss'];
+	$pref['eventpost_todaycss'] = $_POST['eventpost_todaycss'];
+	$pref['eventpost_evtoday'] = $_POST['eventpost_evtoday'];	
+	$pref['eventpost_addcat'] = $_POST['eventpost_addcat'];
+	$pref['eventpost_forum'] = $_POST['eventpost_forum'];	
+	$pref['eventpost_super'] = $_POST['eventpost_super'];
+	$pref['eventpost_dateformat'] = $_POST['eventpost_dateformat'];	
+	$pref['eventpost_weekstart'] = $_POST['eventpost_weekstart'];
+	$pref['eventpost_lenday'] = $_POST['eventpost_lenday'];			
+	$pref['eventpost_mailsubject'] = $_POST['eventpost_mailsubject'];			
+	$pref['eventpost_mailfrom'] = $_POST['eventpost_mailfrom'];		
+	$pref['eventpost_mailaddress'] = $_POST['eventpost_mailaddress'];
+	$pref['eventpost_asubs'] = $_POST['eventpost_asubs'];
+	save_prefs();
+	$message = EC_LAN_75; // "Calendar settings updated.";
+}
+	
+require_once(e_ADMIN."auth.php");
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>$message</b></div>");
+}
+
+if (e_QUERY) {
+	$qs = explode(".", e_QUERY);
+}
+
+//category
+if(isset($qs[0]) && $qs[0] == "cat"){
+	$calendarmenu_db = new DB;
+	$calendarmenu_action = $_POST['calendarmenu_action'];
+	$calendarmenu_edit = FALSE;
+	// * If we are updating then update or insert the record
+	if ($calendarmenu_action == 'update'){
+		$calendarmenu_id = $_POST['calendarmenu_id'];
+		if ($calendarmenu_id == 0){ 
+			// New record so add it
+			$calendarmenu_args = "
+			'0',
+			'".$_POST['event_cat_name']."',
+			'".$_POST['ne_new_category_icon']."',
+			'".intval($_POST['event_cat_class'])."',
+			'".intval($_POST['event_cat_subs'])."',
+			'".intval($_POST['event_cat_force'])."',
+			'".intval($_POST['event_cat_ahead'])."',
+			'".$_POST['event_cat_msg1']."',
+			'".$_POST['event_cat_msg2']."',
+			'".intval($_POST['event_cat_notify'])."',
+			'0','0','".time()."',
+			'".intval($_POST['event_cat_addclass'])."'";
+			if ($calendarmenu_db->db_Insert("event_cat", $calendarmenu_args)){
+				$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A26."</strong></td></tr>";
+			}else{
+				$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A27."</strong></td></tr>";
+			} 
+		}else{ 
+			// Update existing
+			$calendarmenu_args = "
+			event_cat_name='".$_POST['event_cat_name']."',
+			event_cat_class='".intval($_POST['event_cat_class'])."',
+			event_cat_icon='".$_POST['ne_new_category_icon']."',
+			event_cat_subs='".intval($_POST['event_cat_subs'])."',
+			event_cat_force='".intval($_POST['event_cat_force'])."',
+			event_cat_ahead='".intval($_POST['event_cat_ahead'])."',
+			event_cat_msg1='".$_POST['event_cat_msg1']."',
+			event_cat_msg2='".$_POST['event_cat_msg2']."',
+			event_cat_notify='".intval($_POST['event_cat_notify'])."',
+			event_cat_addclass='".intval($_POST['event_cat_addclass'])."',
+			event_cat_lastupdate='".time()."'		
+			where event_cat_id='$calendarmenu_id'";
+			if ($calendarmenu_db->db_Update("event_cat", $calendarmenu_args)){ 
+				// Changes saved
+				$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A28."</b></td></tr>";
+			}else{
+				$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><b>".EC_ADLAN_A29."</b></td></tr>";
+			} 
+		} 
+	} 
+	// We are creating, editing or deleting a record
+	if ($calendarmenu_action == 'dothings'){
+		$calendarmenu_id = $_POST['calendarmenu_selcat'];
+		$calendarmenu_do = $_POST['calendarmenu_recdel'];
+		$calendarmenu_dodel = false;
+
+		switch ($calendarmenu_do){
+			case '1': // Edit existing record
+				{
+					// We edit the record
+					$calendarmenu_db->db_Select("event_cat", "*", "event_cat_id='$calendarmenu_id'");
+					$calendarmenu_row = $calendarmenu_db->db_Fetch() ;
+					extract($calendarmenu_row);
+					$calendarmenu_cap1 = EC_ADLAN_A24;
+					$calendarmenu_edit = TRUE;
+					break;
+				} 
+			case '2': // New category
+				{
+					// Create new record
+					$calendarmenu_id = 0; 
+					// set all fields to zero/blank
+					$calendar_category_name = "";
+					$calendar_category_description = "";
+					$calendarmenu_cap1 = EC_ADLAN_A23;
+					$calendarmenu_edit = TRUE;
+					break;
+				} 
+			case '3':
+				{ 
+					// delete the record
+					if ($_POST['calendarmenu_okdel'] == '1'){
+						if ($calendarmenu_db->db_Select("event", "event_id", " where event_category='$calendarmenu_id'", "nowhere")){
+							$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A59."</strong></td></tr>";
+						}else{
+							if ($calendarmenu_db->db_Delete("event_cat", " event_cat_id='$calendarmenu_id'")){
+								$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A30."</strong></td></tr>";
+							}else{
+								$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A32."</strong></td></tr>";
+							} 
+						} 
+					}else{
+						$calendarmenu_msg .= "<tr><td class='forumheader3' colspan='2'><strong>".EC_ADLAN_A31."</strong></td></tr>";
+					} 
+					$calendarmenu_dodel = TRUE;
+					$calendarmenu_edit = FALSE;
+				} 
+		} 
+
+		if (!$calendarmenu_dodel){
+			require_once(e_HANDLER."file_class.php");
+			
+			
+			$calendarmenu_text .= "
+			<form id='calformupdate' method='post' action='".e_SELF."?cat'>
+			<table style='width:97%;' class='fborder'>
+			<tr>
+				<td colspan='2' class='fcaption'>$calendarmenu_cap1
+					<input type='hidden' value='$calendarmenu_id' name='calendarmenu_id' />
+					<input type='hidden' value='update' name='calendarmenu_action' />
+				</td>
+			</tr>
+			$calendarmenu_msg
+			<tr>
+				<td style='width:20%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A21."</td>
+				<td class='forumheader3'><input type='text' class='tbox' name='event_cat_name' value='$event_cat_name' /></td>
+			</tr>
+			<tr>
+				<td style='width:20%' class='forumheader3'>".EC_ADLAN_A80."</td>
+				<td style='width:80%' class='forumheader3'>".r_userclass("event_cat_class", $event_cat_class, "off", 'public, nobody, member, admin, classes')."</td>
+			</tr>	
+			<tr>
+				<td style='width:20%' class='forumheader3'>".EC_ADLAN_A94."</td>
+				<td style='width:80%' class='forumheader3'>".r_userclass("event_cat_addclass", $event_cat_addclass, "off", 'public, nobody, member, admin, classes')."</td>
+			</tr>			
+			<tr>
+				<td class='forumheader3' style='width:20%'>".EC_LAN_55."</td><td class='forumheader3' >
+					<input class='tbox' style='width:150px' id='caticon' type='text' name='ne_new_category_icon' value='".$event_cat_icon."' />
+					<input class='button' type='button' style='width: 45px; cursor:hand;' value='".EC_LAN_90."' onclick='expandit(\"cat_icons\")' />
+					<div style='display:none' id='cat_icons'>";
+					$fi = new e_file;
+					$imagelist = $fi->get_files(e_PLUGIN."calendar_menu/images", "\.\w{3}$");
+					foreach($imagelist as $img){
+						if ($img['fname']){
+							$calendarmenu_text .= "<a href='javascript:insertext(\"{$img['fname']}\", \"caticon\", \"cat_icons\")'><img src='".e_PLUGIN."calendar_menu/images/".$img['fname']."' style='border:0px' alt='' /></a> ";
+						} 
+					}
+					$calendarmenu_text .= "
+					</div>
+				</td>
+			</tr>
+			<tr>
+				<td class='forumheader3' style='width:20%'>".EC_ADLAN_A81."</td>
+				<td class='forumheader3'><input type='checkbox' class='tbox' name='event_cat_subs' value='1' ".($event_cat_subs > 0?"checked='checked'":"")." /></td>
+			</tr>
+			<tr>
+				<td class='forumheader3' style='width:20%'>".EC_ADLAN_A86."</td>
+				<td class='forumheader3'><select class='tbox' name='event_cat_notify'>
+				<option value='0' ".($event_cat_notify == 0?" selected='selected'":"")." >".EC_ADLAN_A87."</option>
+				<option value='1' ".($event_cat_notify == 1?" selected='selected'":"")." >".EC_ADLAN_A88."</option>
+				<option value='2' ".($event_cat_notify == 2?" selected='selected'":"")." >".EC_ADLAN_A89."</option>
+				<option value='3' ".($event_cat_notify == 3?" selected='selected'":"")." >".EC_ADLAN_A90."</option>
+				</select>		
+				</td>
+			</tr>
+			<tr>
+				<td class='forumheader3' style='width:20%'>".EC_ADLAN_A82."</td>
+				<td class='forumheader3'><input type='checkbox' class='tbox' name='event_cat_force' value='1' ".($event_cat_force > 0?"checked='checked'":"")." />
+				<br /><em>".EC_ADLAN_A97."</em></td>
+			</tr>
+			<tr>
+				<td class='forumheader3' style='width:20%'>".EC_ADLAN_A83."</td>
+				<td class='forumheader3'><input type='text' size='4' maxlength='5' class='tbox' name='event_cat_ahead' value='$event_cat_ahead'  /></td>
+			</tr>
+			<tr>
+				<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A84."</td>
+				<td class='forumheader3'><textarea rows='5' cols='60' class='tbox' name='event_cat_msg1' >".$event_cat_msg1."</textarea></td>
+			</tr>
+			<tr>
+				<td class='forumheader3' style='width:20%;vertical-align:top;'>".EC_ADLAN_A85."</td>
+				<td class='forumheader3'><textarea rows='5' cols='60' class='tbox' name='event_cat_msg2' >".$event_cat_msg2."</textarea></td>
+			</tr>			
+			<tr><td colspan='2' class='fcaption'><input type='submit' name='submits' value='".EC_ADLAN_A25."' class='tbox' /></td></tr>
+			</table>
+			</form>";
+		} 
+	} 
+	if (!$calendarmenu_edit){ 
+		// Get the category names to display in combo box then display actions available
+		$calendarmenu2_db = new DB;
+		if ($calendarmenu2_db->db_Select("event_cat", "event_cat_id,event_cat_name", " order by event_cat_name", "nowhere")){
+			while ($row = $calendarmenu2_db->db_Fetch()){
+				//extract($calendarmenu_row);
+				$calendarmenu_catopt .= "<option value='".$row['event_cat_id']."' ".($calendarmenu_id == $row['event_cat_id'] ?" selected='selected'":"")." >".$row['event_cat_name']."</option>";
+			} 
+		}else{
+			$calendarmenu_catopt .= "<option value=0'>".EC_ADLAN_A33."</option>";
+		} 
+
+		$calendarmenu_text .= "
+		<form id='calform' method='post' action='".e_SELF."?cat'>
+		
+		<table width='97%' class='fborder'>
+		<tr>
+			<td colspan='2' class='fcaption'>".EC_ADLAN_A11."<input type='hidden' value='dothings' name='calendarmenu_action' /></td>
+		</tr>
+		$calendarmenu_msg
+		<tr>
+			<td style='width:20%' class='forumheader3'>".EC_ADLAN_A11."</td>
+			<td class='forumheader3'><select name='calendarmenu_selcat' class='tbox'>$calendarmenu_catopt</select></td>
+		</tr>
+		<tr>
+			<td style='width:20%' class='forumheader3'>".EC_ADLAN_A18."</td>
+			<td class='forumheader3'>
+				<input type='radio' name='calendarmenu_recdel' value='1' checked='checked' /> ".EC_ADLAN_A13."<br />
+				<input type='radio' name='calendarmenu_recdel' value='2' /> ".EC_ADLAN_A14."<br />
+				<input type='radio' name='calendarmenu_recdel' value='3' /> ".EC_ADLAN_A15."
+				<input type='checkbox' name='calendarmenu_okdel' value='1' />".EC_ADLAN_A16."
+			</td>
+		</tr>
+		<tr>
+			<td colspan='2' class='fcaption'><input type='submit' name='submits' value='".EC_ADLAN_A17."' class='tbox' /></td>
+		</tr>
+		</table>
+		</form>";
+	}
+	if(isset($calendarmenu_text)){
+		$ns->tablerender(EC_ADLAN_A19, $calendarmenu_text);
+	}
+}
+
+
+
+if(!isset($qs[0]) || (isset($qs[0]) && $qs[0] == "config")){
+	$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>
+	<table style='width:97%' class='fborder'>
+	<tr><td style='vertical-align:top;' colspan='2' class='fcaption'>".EC_LAN_78." </td></tr>
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_76." </td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'>". r_userclass("eventpost_admin", $pref['eventpost_admin'], "off", 'public, nobody, member, admin, classes')."
+		</td>
+	</tr>
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_100." </td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'>". r_userclass("eventpost_addcat", $pref['eventpost_addcat'], "off",  'public, nobody, member, admin, classes')."
+		<br /><em>".EC_LAN_101."</em>
+		</td>
+	</tr>
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_104." </td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'>". r_userclass("eventpost_super", $pref['eventpost_super'], "off",  'public, nobody, member, admin, classes')."
+		</td>
+	</tr>
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_84."<br /><span class='smalltext'><em>".EC_LAN_85."</em></span></td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_headercss' size='20' value='".$pref['eventpost_headercss']."' maxlength='100' />
+		</td>
+	</tr>
+
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_86."<br /><span class='smalltext'><em>".EC_LAN_87."</em></span></td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_daycss' size='20' value='".$pref['eventpost_daycss']."' maxlength='100' />
+		</td>
+	</tr>
+
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_88."<br /><span class='smalltext'><em>".EC_LAN_89."</em></span></td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_todaycss' size='20' value='".$pref['eventpost_todaycss']."' maxlength='100' />
+		</td>
+	</tr>
+
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_122."<br /><span class='smalltext'><em>".EC_LAN_89."</em></span></td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_evtoday' size='20' value='".$pref['eventpost_evtoday']."' maxlength='100' />
+		</td>
+	</tr>
+
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_102."<br /><span class='smalltext'><em>".EC_LAN_103."</em></span></td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_forum' value='1' ".($pref['eventpost_forum']==1?" checked='checked' ":"")." /></td>
+	</tr>
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_114."</td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'>
+			<select name='eventpost_weekstart' class='tbox'>
+			<option value='sun' ".($pref['eventpost_weekstart']=='sun'?" selected='selected' ":"")." >".EC_LAN_115."</option>
+			<option value='mon' ".($pref['eventpost_weekstart']=='mon'?" selected='selected' ":"")." >".EC_LAN_116."</option>
+			</select>
+		</td>
+	</tr>
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_117."<br /></td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'>
+			<select name='eventpost_lenday' class='tbox'>
+			<option value='1' ".($pref['eventpost_lenday']=='1'?" selected='selected' ":"")." > 1 </option>
+			<option value='2' ".($pref['eventpost_lenday']=='2'?" selected='selected' ":"")." > 2 </option>
+			<option value='3' ".($pref['eventpost_lenday']=='3'?" selected='selected' ":"")." > 3 </option>
+			</select>
+		</td>
+	</tr>
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_LAN_118."<br /></td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'>
+			<select name='eventpost_dateformat' class='tbox'>
+			<option value='my' ".($pref['eventpost_dateformat']=='my'?" selected='selected' ":"")." >".EC_LAN_119."</option>
+			<option value='ym' ".($pref['eventpost_dateformat']=='ym'?" selected='selected' ":"")." >".EC_LAN_120."</option>
+			</select>
+		</td>
+	</tr>
+	
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A95."</td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='checkbox' name='eventpost_asubs' value='1' ".($pref['eventpost_asubs']==1?" checked='checked' ":"")." /><br /><span class='smalltext'><em>".EC_ADLAN_A96."</em></span>
+		</td>
+	</tr>
+	
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A92."</td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailfrom' size='40' value='".$pref['eventpost_mailfrom']."' maxlength='100' />
+		</td>
+	</tr>  
+
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A91."</td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailsubject' size='40' value='".$pref['eventpost_mailsubject']."' maxlength='100' />
+		</td>
+	</tr>  
+
+	<tr>
+		<td style='width:40%;vertical-align:top;' class='forumheader3'>".EC_ADLAN_A93."</td>
+		<td style='width:60%;vertical-align:top;' class='forumheader3'><input class='tbox' type='text' name='eventpost_mailaddress' size='40' value='".$pref['eventpost_mailaddress']."' maxlength='100' />
+		</td>
+	</tr>  
+
+	<tr><td colspan='2'  style='text-align:left' class='fcaption'><input class='button' type='submit' name='updatesettings' value='".EC_LAN_77."' /></td></tr>
+	</table>
+	</form>
+	</div>";
+	
+	$ns->tablerender("<div style='text-align:center'>".EC_LAN_78."</div>", $text);
+}
+
+
+function admin_config_adminmenu(){
+		if (e_QUERY) {
+			$tmp = explode(".", e_QUERY);
+			$action = $tmp[0];
+		}
+		if ($action == "") {
+			$action = "config";
+		}
+		$var['config']['text'] = EC_ADLAN_A10;
+		$var['config']['link'] = "admin_config.php";
+			
+		$var['cat']['text'] = EC_ADLAN_A11;
+		//$var['cat']['link'] ="admin_cat.php?cat";
+		$var['cat']['link'] ="admin_config.php?cat";
+
+		show_admin_menu(EC_ADLAN_A12, $action, $var);
+}
+
+
+require_once(e_ADMIN."footer.php");
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/calendar_menu/calendar_menu.crc.gz and 75/e107_plugins/calendar_menu/calendar_menu.crc.gz differ
diff -ruN 6171/e107_plugins/calendar_menu/calendar_menu.php 75/e107_plugins/calendar_menu/calendar_menu.php
--- 6171/e107_plugins/calendar_menu/calendar_menu.php	2004-09-01 21:56:10.000000000 -0500
+++ 75/e107_plugins/calendar_menu/calendar_menu.php	2005-12-14 13:28:43.000000000 -0600
@@ -1,116 +1,215 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-$ec_dir = e_PLUGIN."calendar_menu/";
-$lan_file = $ec_dir."languages/".e_LANGUAGE.".php";
-include(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
-
-$datearray = getdate();
-$current_day = $datearray['mday'];
-$current_month = $datearray['mon'];
-$current_year = $datearray['year'];
-
-// get first and last days of month in unix format---------------------------------------------------
-$monthstart= mktime(0,0,0,$current_month,1,$current_year);
-$firstdayarray = getdate($monthstart);
-$monthend = mktime(0,0,0,$current_month+1,0,$current_year);
-$lastdayarray = getdate($monthend);
-// ----------------------------------------------------------------------------------------------------------
-
-// get events from current month----------------------------------------------------------------------
-
-$sql -> db_Select("event", "*", "(event_start>='$monthstart' AND event_start<= '$monthend') OR (event_rec_y='$current_month')");
-$events = $sql -> db_Rows();
-while($row = $sql -> db_Fetch()){
-        extract($row);
-        $evf = getdate($event_start);
-        $tmp = $evf['mday'];
-        $event_true[$tmp] = $event_category;
-}
-// -----------------------------------------------------------------------------------------------------------
-
-// set up arrays for calender display ------------------------------------------------------------------
-$week = Array(EC_LAN_25,EC_LAN_19,EC_LAN_20,EC_LAN_21,EC_LAN_22,EC_LAN_23,EC_LAN_24);
-$months = Array(EC_LAN_0,EC_LAN_1,EC_LAN_2,EC_LAN_3,EC_LAN_4,EC_LAN_5,EC_LAN_6,EC_LAN_7,EC_LAN_8,EC_LAN_9,EC_LAN_10,EC_LAN_11);
-$calendar_title = "<a class='forumlink' href='".$ec_dir."calendar.php'>".$months[$datearray[mon]-1]." ".$current_year."</a>";
-// -----------------------------------------------------------------------------------------------------------
-
-$text = "<div style='text-align:center'>";
-if($events){
-        $text .= EC_LAN_26 . ": ".$events;
-}else{
-        $text .= EC_LAN_27;
-}
-
-$start = $monthstart;
-
-$text .= "<br /><br />
-<table cellpadding='0' cellspacing='1' style='width:95%' class='fborder'><tr>";
-
-foreach($week as $day){
-        $text .= "<td class='forumheader' style='text-align:center'><span class='smalltext'>".$day."</span></td>";
-}
-$text .= "</tr><tr >";
-
-$thismonth = $datearray['mon'];
-$thisday = $datearray['mday'];
-
-for($c=0; $c<$firstdayarray['wday']; $c++){
-                $text .= "<td class='forumheader3' style='text-align:center'><br /></td>";
-}
-$loop = $firstdayarray['wday'];
-for($c=1; $c<=31; $c++){
-
-        $dayarray = getdate($start+(($c-1)*86400));
-
-        if($dayarray['mon'] == $thismonth){
-                if($thisday == $c){
-                        $text .=  "<td class='indent' style='text-align:center'>";
-                }else{
-                        $text .="<td class='forumheader3' style='text-align:center'>";
-                }
-
-                if($event_true[($c)]){
-                        $sql -> db_Select("event_cat", "*", "event_cat_id='".$event_true[($c)]."' ");
-                        $icon = $sql -> db_Fetch();
-                        extract($icon);
-                        $img = "<img style='border:0' src='".$ec_dir."images/".$event_cat_icon."' alt='' height='10' width='10'/>";
-                }else{
-					$img = $c;
-				}
-
-                $linkut = mktime(0 ,0 ,0 ,$dayarray['mon'], $c, $datearray['year']);
-
-                $text .="<a href='".$ec_dir."event.php?".$linkut.".one'>$img</a>";
-
-                if($thisday == $c){
-                }
-
-                $text .= "</td>\n";
-
-                $loop++;
-                if($loop == 7){
-                        $loop = 0;
-                        $text .= "</tr><tr>";
-                }
-        }
-}
-
-for($a=($loop+1); $a<=7; $a++){
-	$text .="<td>&nbsp;</td>";
-}
-
-$text .= "</tr></table></div>";
-$ns -> tablerender($calendar_title, $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/calendar_menu.php,v $
+|     $Revision: 1.19 $
+|     $Date: 2005/12/14 19:28:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$ec_dir		= e_PLUGIN . "calendar_menu/";
+$lan_file	= e_PLUGIN . "calendar_menu/languages/" . e_LANGUAGE . ".php";
+require_once((file_exists($lan_file) ? $lan_file : e_PLUGIN . "calendar_menu/languages/English.php"));
+
+$cal_datearray		= getdate();
+$cal_current_day	= $cal_datearray['mday'];
+$cal_current_month	= $cal_datearray['mon'];
+$cal_current_year	= $cal_datearray['year'];
+
+$cal_monthstart		= mktime(0, 0, 0, $cal_current_month, 1, $cal_current_year);
+$cal_firstdayarray	= getdate($cal_monthstart);
+$cal_monthend		= mktime(0, 0, 0, $cal_current_month + 1, 1, $cal_current_year) -1;
+$cal_lastdayarray	= getdate($cal_monthend); 
+
+if (USER)
+{
+    $cal_class = "0,253," . USERCLASS;
+} 
+else
+{
+    $cal_class = "0,252";
+} 
+
+if (check_class($pref['eventpost_super']))
+{ 
+    $cal_qry = "SELECT e.event_rec_m, e.event_rec_y, e.event_start, e.event_end, ec.*
+	FROM #event as e LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
+	WHERE (e.event_start >= {$cal_monthstart} AND e.event_start <= {$cal_monthend}) OR (e.event_end >= {$cal_monthstart} AND e.event_end <= {$cal_monthend}) OR e.event_rec_y = {$cal_current_month} order by e.event_start";
+} 
+else
+{ 
+    $cal_qry = "SELECT e.event_rec_m, e.event_rec_y, e.event_start, e.event_end, ec.*
+	FROM #event as e LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
+	WHERE (e.event_start >= {$cal_monthstart} AND e.event_start <= {$cal_monthend}) OR (e.event_end >= {$cal_monthstart} AND e.event_end <= {$cal_monthend}) OR e.event_rec_y = {$cal_current_month}
+	and find_in_set(event_cat_class,'" . $cal_class . "') order by e.event_start";
+} 
+
+$cal_events = array();
+
+$cal_totev = 0;
+if ($cal_totev = $sql->db_Select_gen($cal_qry))
+{
+    while ($cal_row = $sql->db_Fetch())
+    {
+        if ($cal_row['event_rec_y'] == $cal_current_month)
+        {
+            $cal_events[$cal_row['event_rec_m']][] = $cal_row;
+        } 
+        else
+        {
+            $cal_tmp = getdate($cal_row['event_start']);
+            if ($cal_tmp['year'] == $cal_current_year)
+            {
+                $cal_start_day = $cal_tmp['mday'];
+            } 
+            else
+            {
+                $cal_start_day = 1;
+            } 
+            $cal_tmp = getdate($cal_row['event_end']);
+            if ($cal_tmp['year'] == $cal_current_year)
+            {
+                $cal_end_day = $cal_tmp['mday'];
+            } 
+            else
+            {
+                $cal_end_day = 31;
+            } 
+            // Mark each day the event occurs
+			$cal_events[$cal_start_day] = $cal_row['event_cat_icon'];
+        }
+    } 
+} 
+
+
+if ($pref['eventpost_weekstart'] == 'sun'){
+    $cal_week	= Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
+	}else{
+    $cal_week	= Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
+} 
+
+$cal_months		= Array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11); 
+if ($pref['eventpost_dateformat'] == 'my'){
+    $calendar_title = "<a class='forumlink' href='" . e_PLUGIN . "calendar_menu/event.php' >" . $cal_months[$cal_datearray['mon']-1] . " " . $cal_current_year . "</a>";
+	}else{
+    $calendar_title = "<a class='forumlink' href='" . e_PLUGIN . "calendar_menu/event.php' >" . $cal_current_year . " " . $cal_months[$cal_datearray['mon']-1] . "</a>";
+} 
+
+$cal_text = "<div style='text-align:center'>"; 
+
+if ($cal_totev){
+    $cal_text .= EC_LAN_26 . ": " . $cal_totev;
+	}else{
+    $cal_text .= EC_LAN_27;
+} 
+
+$cal_headercss	= (isset($pref['eventpost_headercss']) && $pref['eventpost_headercss']) ? $pref['eventpost_headercss'] : "forumheader";
+$cal_daycss		= (isset($pref['eventpost_daycss']) && $pref['eventpost_daycss']) ? $pref['eventpost_daycss'] : "forumheader3";
+$cal_todaycss	= (isset($pref['eventpost_todaycss']) && $pref['eventpost_todaycss']) ? $pref['eventpost_todaycss'] : "indent";
+$cal_evtoday	= (isset($pref['eventpost_evtoday']) && $pref['eventpost_evtoday']) ? $pref['eventpost_evtoday'] : "indent";
+$cal_start		= $cal_monthstart;
+//added hardcoded padding
+//cause eg. indent uses a large padding in standard themes
+//which caused overflow
+$padding		= "padding:1px;";
+
+$cal_text .= "<br /><br />
+<table cellpadding='0' cellspacing='1' style='width:100%' class='fborder'><tr>";
+foreach($cal_week as $cal_day)
+{
+    $cal_text .= "<td class='$cal_headercss' style='text-align:center'><span class='smalltext'>" . substr($cal_day, 0, $pref['eventpost_lenday']) . "</span></td>";
+} 
+$cal_text .= "</tr><tr >";
+
+$cal_thismonth	= $cal_datearray['mon'];
+$cal_thisday	= $cal_datearray['mday']; 
+
+if ($pref['eventpost_weekstart'] == 'mon'){
+    $firstdayoffset = ($cal_firstdayarray['wday'] == 0 ? $cal_firstdayarray['wday'] + 6 : $cal_firstdayarray['wday']-1);
+	}else{
+    $firstdayoffset = $cal_firstdayarray['wday'] ;
+} 
+for($cal_c = 0; $cal_c < $firstdayoffset; $cal_c++){
+    $cal_text .= "<td class='$cal_daycss' style='".$padding." text-align:center'><br /></td>";
+} 
+$cal_loop = $firstdayoffset; 
+
+for($cal_c = 1; $cal_c <= 31; $cal_c++)
+{
+    $cal_dayarray = getdate($cal_start + (($cal_c-1) * 86400));
+    if ($cal_dayarray['mon'] == $cal_thismonth)
+    {
+        if ($cal_thisday == $cal_c)
+        {
+            $cal_text .= "<td class='$cal_todaycss' style='".$padding." width: 14.28%; text-align:center; '>";
+        } 
+        else
+        {
+			$cal_text .= "<td class='".(array_key_exists($cal_c, $cal_events) ? $cal_evtoday : $cal_daycss)."' style='".$padding." width: 14.28%; text-align:center; '>";
+        } 
+
+        if (array_key_exists($cal_c, $cal_events))
+        {
+            $cal_event_icon = e_PLUGIN . "calendar_menu/images/" . $cal_events[$cal_c];
+            $cal_event_count = count($cal_events[$cal_c]); 
+            // *BK* Check if empty because file_exist will return true if icon name is blank, because it finds that the directory exists
+            // *BK* It then tries to put in the icon which doesn't exist
+            if (!empty($cal_events[$cal_c]) && file_exists($cal_event_icon))
+            {
+                $cal_img = "<img style='border:0' src='{$cal_event_icon}' alt='' />";
+				//height='10' width='10'
+            } 
+            else
+            {
+                $cal_img = $cal_c;
+            } 
+        } 
+        else
+        {
+            $cal_img = $cal_c;
+            $cal_event_count = 0;
+        } 
+
+        $cal_linkut = mktime(0 , 0 , 0 , $cal_dayarray['mon'], $cal_c, $cal_datearray['year']);
+        if ($cal_event_count > 0)
+        {
+            $title = " title='{$cal_event_count} " . EC_LAN_106 . "' ";
+        } 
+        else
+        { 
+            // *BK* Set title to blank (or you can set to 0 events if you wish otherwise it remembers the last value
+            $title = "";
+        } 
+        $cal_text .= "<a {$title} href='" . $ec_dir . "event.php?" . $cal_linkut . ".one'>$cal_img</a>";
+        $cal_text .= "</td>\n";
+        $cal_loop++;
+        if ($cal_loop == 7)
+        {
+            $cal_loop = 0;
+            $cal_text .= "</tr><tr>";
+        } 
+    } 
+} 
+
+for($cal_a = ($cal_loop + 1); $cal_a <= 7; $cal_a++)
+{ 
+    // *BK* Add class so that empty cells display in the menu
+    $cal_text .= "<td class='$cal_daycss' >&nbsp;</td>";
+} 
+
+$cal_text .= "</tr></table></div>";
+$ns->tablerender($calendar_title, $cal_text, 'calender_menu');
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/calendar.php 75/e107_plugins/calendar_menu/calendar.php
--- 6171/e107_plugins/calendar_menu/calendar.php	2004-09-03 13:32:10.000000000 -0500
+++ 75/e107_plugins/calendar_menu/calendar.php	2006-01-14 06:02:10.000000000 -0600
@@ -1,327 +1,282 @@
-<?
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /e_PLUGIN."calnder.php
-|
-|        Steve Dunstan 2001-2002
-|        http://jalist.com
-|        stevedunstan@jalist.com
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-| $Source: /cvsroot/e107/e107/e107_plugins/calendar_menu/calendar.php,v $
-| $Revision: 1.6 $
-| $Date: 2004/09/03 18:32:10 $
-| $Author: e107coders $
-+---------------------------------------------------------------+
-*/
-
-// get current date information ---------------------------------------------------------------------
-define("PAGE_NAME", "Show Calendar");
-require_once("../../class2.php");
-require_once(HEADERF);
-$num = $_POST['num'];
-
-if(IsSet($_POST['viewallevents'])){
-Header("Location: ".e_PLUGIN."calendar_menu/event.php?".$_POST['enter_new_val']);
-}
-
-if(IsSet($_POST['doit'])){
-Header("Location: ".e_PLUGIN."calendar_menu/event.php?ne.".$_POST['enter_new_val']);
-}
-
-
-
-$ec_dir = e_PLUGIN."calendar_menu/";
-$lan_file = $ec_dir."languages/".e_LANGUAGE.".php";
-include(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
- // new part by cam.
-   $qs = explode(".", e_QUERY);
-    $action = $qs[0];
-    if ($action == "") {
-        $datearray = getdate();
-        $month = $datearray['mon'];
-        $year = $datearray['year'];
-        $day = $datearray['day'];
-    } else {
-        $datearray = getdate($action);
-        $month = $datearray['mon'];
-        $year = $datearray['year'];
-    }
-
-
-
-// set up arrays for calender display ------------------------------------------------------------------
-$week = Array('S','M','T','W','T','F','S');
-$months = Array(EC_LAN_0,EC_LAN_1,EC_LAN_2,EC_LAN_3,EC_LAN_4,EC_LAN_5,EC_LAN_6,EC_LAN_7,EC_LAN_8,EC_LAN_9,EC_LAN_10,EC_LAN_11);
-$monthabb = Array(EC_LAN_JAN,EC_LAN_FEB,EC_LAN_MAR,EC_LAN_APR,EC_LAN_MAY,EC_LAN_JUN,EC_LAN_JUL,EC_LAN_AUG,EC_LAN_SEP,EC_LAN_OCT,EC_LAN_NOV,EC_LAN_DEC);
-$calendar_title = "<a href='".e_PLUGIN."calendar_menu/event.php' class='mmenu'>".$months[$datearray[mon]-1]." ".$current_year."</a>";
-// -----------------------------------------------------------------------------------------------------------
-
-// ----------------------------------------------------------------------------------------------------------
-
-// show events-------------------------------------------------------------------------------------------
-// get first and last days of month in unix format---------------------------------------------------
-$monthstart= mktime(0,0,0,$month,1,$year);
-$firstdayarray = getdate($monthstart);
-$monthend = mktime(0,0,0,$month+1,1,$year);
-$lastdayarray = getdate($monthend);
-// ----------------------------------------------------------------------------------------------------------
-
-
-// echo current month with links to previous/next months ----------------------------------------
-
-$prevmonth = ($month-1);
-$prevyear = $year;
-if ($prevmonth == 0) {
-    $prevmonth = 12;
-    $prevyear = ($year-1);
-}
-$previous = mktime(0,0,0,$prevmonth,1, $prevyear);
-
-$nextmonth = ($month+1);
-$nextyear = $year;
-if ($nextmonth == 13) {
-    $nextmonth = 1;
-    $nextyear = ($year+1);
-}
-$next = mktime(0,0,0,$nextmonth,1, $nextyear);
-$py = $year-1;
-$prevlink = mktime(0,0,0,$month,1, $py);
-$ny = $year+1;
-$nextlink = mktime(0,0,0,$month,1, $ny);
-$cal_text = "<table style='width:100%' class='fborder'>
-<tr>
-  <td class='forumheader' style='width:18%; text-align:left'><span class='defaulttext'><a href='".e_SELF."?".$previous."'>&lt;&lt; ".$months[($prevmonth-1)]."</a></span></td>
-  <td class='fcaption' style='width:64%; text-align:center'><b>".$months[($month-1)]." ".$year."</b></td>
-  <td class='forumheader' style='width:185%; text-align:right'><span class='defaulttext'><a href='".e_SELF."?".$next."'> ".$months[($nextmonth-1)]." &gt;&gt;</a></span> </td>
-</tr>
-<tr>
-  <td class='forumheader3' style='text-align:left'><a href='calendar.php?".$prevlink."'>&lt;&lt; ".$py."</a></td>
-  <td class='fcaption' style='text-align:center; vertical-align:middle'>";
-for ($ii = 0; $ii < 13; $ii++){
-        $m = $ii+1;
-        $monthjump= mktime(0,0,0,$m,1,$year);
-        $cal_text .=  "<a class='forumlink' href=\"calendar.php?".$monthjump."\">".$monthabb[$ii]."</a> ";
-}
-$cal_text .=
- "</td>
-  <td class='forumheader3' style='text-align:right'>
-    <a href='calendar.php?".$nextlink."'>".$ny." &gt;&gt;</a>
-  </td>
-</tr>
-</table>";
-
-
-$cal_text .= "<div style='text-align:center'>
-";
-
-
-$prop = mktime(0,0,0,$month, 1, $year);
-
-$nowarray = getdate();
-$nowmonth = $nowarray['mon'];
-$nowyear = $nowarray['year'];
-$nowday = $nowarray['mday'];
-$current = mktime(0,0,0,$nowmonth, 1, $nowyear);
-
-##### Check for access.
-
-
-//------------ Navigation Buttons. ------------------------------------------------------
-
-$nav_text = "<br />
-             <form method='post' action='".e_SELF."?".e_QUERY."'>
-             <table border='0' cellpadding='2' cellspacing='3' class='forumheader3'>
-               <tr>
-                 <td align='right'>
-                   <select name='event_cat_ids' class='tbox' style='width:140px;'>
-                   <option value='all'>All</option>";
-
- $event_cat_id = !isset($_POST['event_cat_ids'])? NULL : $_POST['event_cat_ids'];
-        $sql -> db_Select("event_cat");
-
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                if($event_cat_id == $_POST['event_cat_ids']){
-           //if($event_cat_id == $qs[1]){
-                        $nav_text .= "<option value='$event_cat_id' selected>".$event_cat_name."</option>";
-                }else{
-                        $nav_text .= "<option value='$event_cat_id'>".$event_cat_name."</option>";
-                }
-        }
-$nav_text .=      "</select>
-                 </td>
-                 <td align='center'>
-                   <input class='button' type='submit' style='width:140px;' name='viewallevents' value='View Events List' />
-                 </td>
-               </tr>
-               <tr>
-                 <td align='right'>
-                   <input type='hidden' name='do' value='vc' />
-                   <input class='button' type='submit' style='width:140px;' name='viewcat' value='View Category' />
-                 </td>
-                 <td align='center'>
-                   <input type='hidden' name='enter_new_val' value='".$prop."' /> ";
-
-if(check_class($pref['eventpost_admin']) || getperms('0')){  // start no admin preference
-        $nav_text .=    "<input class='button' type='submit' style='width:140px;' name='doit' value='Enter New Event' />";
-}     // end admin preference activated.
-
-$nav_text .=    "</td>
-               </tr>
-             </table>
-             </form>
-             <br />";
-
-//--------------------------------------------------------------------------------
-
-
-if ($month != $nowmonth || $year != $nowyear) {
-    $nav_text .= " <span class='button' style='width:120px; '><a href='".e_SELF."?$current'>".EC_LAN_40."</a></span>";
-}
-
-$nav_text .= "</div><br />";
-
-
-// get events from current month----------------------------------------------------------------------
-$sql -> db_Select("event", "*", "(event_start>='$monthstart' AND event_start<= '$monthend')   ORDER BY event_start ASC");
-
-while ($row = $sql -> db_Fetch()) {
-    extract($row);
-    $evf = getdate($event_start);
-    $tmp = $evf['mday'];
-    $eve = getdate($event_end);
-    $tmp2 = $eve['mday'];
-    $cevent_title[$tmp] =  $event_title;
-    $event_true[$tmp] = $event_start;
-    for ($i=($tmp+1); $i<($tmp2+1); $i++) {
-      $event_true_end[$i] = $i != $tmp2 ? 1:2;
-      $cevent_title[$i] =  $event_title;
-    }
-
-}
-// -----------------------------------------------------------------------------------------------------------
-
-$start = $monthstart;
-$text .= "<div style='text-align:center'>
-<table cellpadding='0' cellspacing='1' class='fborder' style='background-color:#DDDDDD; width:580px'><tr>";
-
-
-foreach($week as $day){
-    $text .= "<td class='fcaption' style='z-index: -1;background-color:black; width:90px;height:20px;text-align:center'>
-                    <strong>".$day."</strong>
-                <img src='".THEME."images/blank.gif' alt='' height='12%' width='14%' />
-              </td>";
-}
-$text .= "</tr><tr>";
-$calmonth = $datearray['mon'];
-$calday = $datearray['mday'];
-$calyear = $datearray['year'];
-
-for ($c=0; $c<$firstdayarray['wday']; $c++) {
-    $text .= "<td style=' width:90px;height:60px;'></td>";
-}
-$loop = $firstdayarray['wday'];
-for ($c=1; $c<=31; $c++) {
-$dayarray = getdate($start+(($c-1)*86400));
-
-
-        $stopp = mktime(24,0,0,$calmonth,$c,$calyear);
-        $startt = mktime(0,0,0,$calmonth,$c,$calyear);
-
-        $sql2 = new db;
-        $sql2 -> db_Select("event_cat", "*", "event_cat_id!='' ");
-
-            while($event_cat = $sql2-> db_Fetch()){
-            extract($event_cat);
-            $category_icon[$event_cat_id]= $event_cat_icon;
-            $category_title[$event_cat_id]= $event_cat_name;
-
-            }
-
-
-        $sql -> db_Select("event", "*", "event_start>='$startt' AND event_start<='$stopp' ORDER BY event_start");
-        $events = $sql -> db_Rows();
-
-     // Highlight the current day.
-    if ($dayarray['mon'] == $calmonth) {
-        if ($nowday == $c && $calmonth == $nowmonth && $calyear == $nowyear && !$event_true[($c)]&& !$event_true_end[($c)]) {
-            $text .="<td  class='forumheader3' style='vertical-align:top; width:90px;height:90px;padding-bottom:0px;padding-right:0px; margin-right:0px'>";
-            $text .="<div style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>
-                           <b>
-                         <a href='".e_PLUGIN."calendar_menu/event.php?".$startt.".one'>".$c."</a>
-                       </b>
-                           <span class='smalltext'>[today]</span>
-                     </div>";
-        } elseif($event_true[($c)] || $event_true_end[($c)]) {
-            $text .="<td class='forumheader3' style='z-index: 1;vertical-align:top;  width:90px;height:90px;padding-bottom:0px;padding-right:0px; margin-right:0px'>";
-            $text .="<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>
-                           <a href='".e_PLUGIN."calendar_menu/event.php?".$startt.".one'>
-                         <strong>".$c."</strong>
-                       </a>
-                     </span>";
-        }else {
-            $text .="<td class='forumheader2 ' style='z-index: 1;vertical-align:top;  width:90px;height:90px;padding-bottom:0px;padding-right:0px; margin-right:0px'>";
-            $text .="<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>
-                           <a href='".e_PLUGIN."calendar_menu/event.php?".$startt.".one'>
-                         <strong>".$c."</strong>
-                       </a>
-                     </span>";
-        }
-
-        if ($event_true_end[($c)]) {
-            $indicat = $event_true_end[($c)]==1? "->":"|";
-            $text .="<br /><img style='border:0' src='".$ec_dir."images/".$category_icon[$event_category]."' alt='' height='8' width='8' />&nbsp;<a href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".one'><span class='smalltext' style='color:black' >".$cevent_title[$c]."</span></a>".$indicat;
-            }
-
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-
-                $event_title = $cevent_title[$c];
-                if (strlen($event_title) > 9){
-                        $oevent_title = substr($event_title,0,10)."<br />".substr($event_title,10,9);
-                        if (strlen($event_title) > 15){
-                                $oevent_title .= "..";
-                        }
-                } else {
-                        $oevent_title = $event_title;
-                }
-
-                if ($event_true[($c)]) {
-                    $linkut = mktime(0 ,0 ,0 ,$datearray['mon'], $c, $datearray['year']);
-                    if(($_POST['do'] == NULL || $_POST['event_cat_ids'] == "all") || ($_POST['event_cat_ids'] == $event_cat_id)){
-
-                        $text .="<br />
-                                     <img style='border:0' src='".$ec_dir."images/".$category_icon[$event_category]."' alt='' height='8' width='8' />
-                                 &nbsp;
-                                 <a href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".one'>
-                                   <span class='smalltext' style='color:black' >".$oevent_title."</span>
-                                 </a>";
-                    }
-
-
-                }
-
-        }
-
-        $text .= '</td>';
-    }
-
-    $loop++;
-    if ($loop == 7) {
-        $loop = 0;
-        $text .= '</tr><tr>';
-    }
-}
-
-
-$text .= "</tr></table></div>";
-$caption = EC_LAN_79; // "Calendar View";
-$nav = $cal_text .$nav_text. $text;
- $ns -> tablerender($caption, $nav);
-// echo $text;
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/calendar.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2006/01/14 12:02:10 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/ 
+
+
+require_once("../../class2.php");
+require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
+if (isset($_POST['viewallevents']))
+{
+    Header("Location: " . e_PLUGIN . "calendar_menu/event.php?" . $_POST['enter_new_val']);
+} 
+if (isset($_POST['doit']))
+{
+    Header("Location: " . e_PLUGIN . "calendar_menu/event.php?ne." . $_POST['enter_new_val']);
+}
+if (isset($_POST['subs']))
+{
+    Header("Location: " . e_PLUGIN . "calendar_menu/subscribe.php");
+} 
+
+$ec_dir		= e_PLUGIN . "calendar_menu/";
+$lan_file	= $ec_dir . "languages/" . e_LANGUAGE . ".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN . "calendar_menu/languages/English.php");
+define("PAGE_NAME", EC_LAN_121);
+
+if (is_readable(THEME."calendar_template.php")) {
+	require_once(THEME."calendar_template.php");
+	} else {
+	require_once(e_PLUGIN."calendar_menu/calendar_template.php");
+}
+
+$cal_super	= check_class($pref['eventpost_super']);
+$num		= (isset($_POST['num']) && $_POST['num'] ? $_POST['num'] : "");
+
+require_once(HEADERF);
+
+// get current date information ---------------------------------------------------------------------
+$qs = explode(".", e_QUERY);
+if($qs[0] == "")
+{
+    $datearray	= getdate();
+    $month		= $datearray['mon'];
+    $year		= $datearray['year'];
+    $day		= $datearray['mday'];
+} 
+else
+{
+    $datearray	= getdate($qs[0]);
+    $month		= $datearray['mon'];
+    $year		= $datearray['year'];
+}
+
+// set up arrays for calender display ------------------------------------------------------------------
+if($pref['eventpost_weekstart'] == 'sun') {
+	$week	= Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
+	} else {
+	$week	= Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
+}	
+$months		= Array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
+$monthabb	= Array(EC_LAN_JAN, EC_LAN_FEB, EC_LAN_MAR, EC_LAN_APR, EC_LAN_MAY, EC_LAN_JUN, EC_LAN_JUL, EC_LAN_AUG, EC_LAN_SEP, EC_LAN_OCT, EC_LAN_NOV, EC_LAN_DEC);
+
+$days = array(EC_LAN_DAY_1, EC_LAN_DAY_2, EC_LAN_DAY_3, EC_LAN_DAY_4, EC_LAN_DAY_5, EC_LAN_DAY_6, EC_LAN_DAY_7, EC_LAN_DAY_8, EC_LAN_DAY_9, EC_LAN_DAY_10, EC_LAN_DAY_11, EC_LAN_DAY_12, EC_LAN_DAY_13, EC_LAN_DAY_14, EC_LAN_DAY_15, EC_LAN_DAY_16, EC_LAN_DAY_17, EC_LAN_DAY_18, EC_LAN_DAY_19, EC_LAN_DAY_20, EC_LAN_DAY_21, EC_LAN_DAY_22, EC_LAN_DAY_23, EC_LAN_DAY_24, EC_LAN_DAY_25, EC_LAN_DAY_26, EC_LAN_DAY_27, EC_LAN_DAY_28, EC_LAN_DAY_29, EC_LAN_DAY_30, EC_LAN_DAY_31);
+
+// show events-------------------------------------------------------------------------------------------
+$monthstart		= mktime(0, 0, 0, $month, 1, $year);
+$firstdayarray	= getdate($monthstart);
+$monthend		= mktime(0, 0, 0, $month + 1, 1, $year) - 1;
+$lastdayarray	= getdate($monthend);
+
+$prevmonth		= ($month-1);
+$prevyear		= $year;
+if ($prevmonth == 0)
+{
+    $prevmonth	= 12;
+    $prevyear	= ($year-1);
+} 
+$previous = mktime(0, 0, 0, $prevmonth, 1, $prevyear);
+
+$nextmonth		= ($month + 1);
+$nextyear		= $year;
+if ($nextmonth == 13)
+{
+    $nextmonth	= 1;
+    $nextyear	= ($year + 1);
+} 
+$next			= mktime(0, 0, 0, $nextmonth, 1, $nextyear);
+$py				= $year-1;
+$prevlink		= mktime(0, 0, 0, $month, 1, $py);
+$ny				= $year + 1;
+$nextlink		= mktime(0, 0, 0, $month, 1, $ny);
+
+$prop		= mktime(0, 0, 0, $month, 1, $year);
+$nowarray	= getdate();
+$nowmonth	= $nowarray['mon'];
+$nowyear	= $nowarray['year'];
+$nowday		= $nowarray['mday'];
+$current	= mktime(0, 0, 0, $nowmonth, 1, $nowyear); 
+
+// time switch buttons
+$cal_text = $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcodes);
+
+// navigation buttons
+$nav_text = $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shortcodes);
+
+// get events from current month
+if ($cal_super)
+{
+    $qry = "SELECT e.*, ec.*
+			FROM #event as e
+			LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
+			WHERE e.event_id != ''
+			ORDER BY e.event_start";
+} 
+else
+{
+    $qry = "SELECT e.*, ec.*
+			FROM #event as e
+			LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
+			WHERE e.event_id != ''
+			AND find_in_set(event_cat_class,'".USERCLASS_LIST."') 
+			ORDER BY e.event_start";
+} 
+
+if ($sql->db_Select_gen($qry)){
+    while ($row = $sql->db_Fetch()){
+		$evf	= getdate($row['event_start']);
+		$tmp	= $evf['mday'];
+		$eve	= getdate($row['event_end']);
+		$tmp2	= $eve['mday'];
+		$tmp3	= date("t", $monthstart); // number of days in this month
+
+		// check for recurring events in this month
+		if($row['event_recurring']=='1' && $month == $row['event_rec_y']){
+			$row['event_start'] = mktime(0,0,0,$row['event_rec_y'],$row['event_rec_m'],$year);
+		}
+
+		//1) start in month, end in month
+		if(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']<=$monthend){
+			$events[$tmp][] = $row;
+			for ($c=($tmp+1); $c<($tmp2+1); $c++) {
+				$event_true_end[$c][] = ($c!=$tmp2 ? 1 : 2);
+				$events[$c][] = $row;
+			}
+
+		//2) start in month, end after month
+		}elseif(($row['event_start']>=$monthstart && $row['event_start']<=$monthend) && $row['event_end']>=$monthend){
+			$events[$tmp][] = $row;
+			for ($c=($tmp+1); $c<=$tmp3; $c++){
+				$row['event_true_end'] = 1;
+				$events[$c][] = $row;
+			}
+
+		//3) start before month, end in month
+		}elseif($row['event_start']<=$monthstart && ($row['event_end']>=$monthstart && $row['event_end']<=$monthend)){
+			for ($c=1; $c<=$tmp2; $c++){
+				$row['event_true_end'] = ($c!=$tmp2 ? 1 : 2);
+				$events[$c][] = $row;
+			}
+
+		//4) start before month, end after month
+		}elseif($row['event_start']<=$monthstart && $row['event_end']>=$monthend){
+			for ($c=1; $c<=$tmp3; $c++){
+				$row['event_true_end'] = 1;
+				$events[$c][] = $row;
+			}
+		}
+	}
+}
+
+$start		= $monthstart;
+$numberdays	= date("t", $start); // number of days in this month
+
+$text = "";
+$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_START, FALSE, $calendar_shortcodes);
+$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_START, FALSE, $calendar_shortcodes);
+foreach($week as $day)
+{
+	$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER, FALSE, $calendar_shortcodes);
+} 
+$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_HEADER_END, FALSE, $calendar_shortcodes);
+
+$calmonth	= $datearray['mon'];
+$calday		= $datearray['mday'];
+$calyear	= $datearray['year'];
+
+if ($pref['eventpost_weekstart'] == 'mon') {
+	$firstdayoffset = ($firstdayarray['wday'] == 0 ? $firstdayarray['wday']+6 : $firstdayarray['wday']-1);
+	} else {
+	$firstdayoffset = $firstdayarray['wday'] ;
+}
+for ($c=0; $c<$firstdayoffset; $c++) {
+	$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
+}
+$loop = $firstdayoffset;
+
+for ($c = 1; $c <= $numberdays; $c++)
+{
+    $dayarray	= getdate($start + (($c-1) * 86400));
+    $stopp		= mktime(24, 0, 0, $calmonth, $c, $calyear);
+    $startt		= mktime(0, 0, 0, $calmonth, $c, $calyear); 
+    // Highlight the current day.
+    if ($dayarray['mon'] == $calmonth)
+    {
+        if ($nowday == $c && $calmonth == $nowmonth && $calyear == $nowyear)
+        {
+        	//today
+			$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_TODAY, FALSE, $calendar_shortcodes);
+        //}elseif (array_key_exists($c, $events)){
+		}elseif(isset($events[$c]) && is_array($events[$c]) && !empty($events[$c]) && count($events[$c]) > 0){
+			//day has events
+			$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EVENT, FALSE, $calendar_shortcodes);
+        } 
+        else
+        {
+            // no events and not today
+			$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_EMPTY, FALSE, $calendar_shortcodes);
+        } 
+        // if there are events then list them
+        if (array_key_exists($c, $events)){
+            foreach($events[$c] as $ev)
+            {
+				//if ($event_true_end[$c][$a]){
+				if(isset($ev['event_true_end']) && $ev['event_true_end']){
+					//$ev['indicat'] = ($ev['event_true_end']==1 ? "->" : "|");
+					$ev['indicat'] = "";
+					$ev['imagesize'] = "4";
+					$ev['fulltopic'] = FALSE;
+					$ev['startofevent'] = FALSE;
+				}else{
+					$ev['indicat'] = "";
+					$ev['imagesize'] = "8";
+					$ev['fulltopic'] = TRUE;
+					$ev['startofevent'] = TRUE;
+				}
+				
+				if ( ( !isset($_POST['do']) || (isset($_POST['do']) && $_POST['do'] == null)) || (isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] == "all") || (isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] == $ev['event_cat_id']) ){
+					$text .= $tp -> parseTemplate($CALENDAR_SHOWEVENT, FALSE, $calendar_shortcodes);
+				} 
+			} 
+        } 
+		$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_END, FALSE, $calendar_shortcodes);
+    } 
+    $loop++;
+    if ($loop == 7)
+    {
+        $loop = 0;
+		if($numberdays!=$totaldays){
+			$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_WEEKSWITCH, FALSE, $calendar_shortcodes);
+		}
+    } 
+}
+//remainder cells to end the row properly with empty cells
+if($loop!=0){
+	$remainder = 7-$loop;
+	for ($c=0; $c<$remainder; $c++) {
+		$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_DAY_NON, FALSE, $calendar_shortcodes);
+	}
+}
+$text .= $tp -> parseTemplate($CALENDAR_CALENDAR_END, FALSE, $calendar_shortcodes);
+
+$caption	= EC_LAN_79; // "Calendar View";
+$nav		= $cal_text . $nav_text . $text;
+$ns->tablerender($caption, $nav);
+
+require_once(FOOTERF);
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/calendar_shortcodes.php 75/e107_plugins/calendar_menu/calendar_shortcodes.php
--- 6171/e107_plugins/calendar_menu/calendar_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/calendar_shortcodes.php	2006-04-11 06:53:30.000000000 -0500
@@ -0,0 +1,363 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$calendar_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+/*
+// TIME SWITCH BUTTONS ------------------------------------------------
+SC_BEGIN PREV_MONTH
+	global $PREV_MONTH, $previous, $months, $prevmonth;
+	return "<a href='".e_SELF."?".$previous."'>&lt;&lt; ".$months[($prevmonth-1)]."</a>";
+SC_END
+
+SC_BEGIN NEXT_MONTH
+	global $NEXT_MONTH, $next, $months, $nextmonth;
+	return "<a href='".e_SELF."?".$next."'> ".$months[($nextmonth-1)]." &gt;&gt;</a>";
+SC_END
+
+SC_BEGIN CURRENT_MONTH
+	global $CURRENT_MONTH, $pref, $months, $month, $year;
+	if($pref['eventpost_dateformat'] == 'my') {
+		$CURRENT_MONTH = $months[($month-1)]." ".$year;
+	} else {
+		$CURRENT_MONTH = $year." ".$months[($month-1)];
+	}
+	return $CURRENT_MONTH;
+SC_END
+
+SC_BEGIN PREV_YEAR
+	global $PREV_YEAR, $prevlink, $py;
+	return "<a href='".e_SELF."?".$prevlink."'>&lt;&lt; ".$py."</a>";
+SC_END
+
+SC_BEGIN NEXT_YEAR
+	global $NEXT_YEAR, $nextlink, $ny;
+	return "<a href='".e_SELF."?".$nextlink."'>".$ny." &gt;&gt;</a>";
+SC_END
+
+SC_BEGIN MONTH_LIST
+	global $MONTH_LIST, $year, $monthjump, $monthabb;
+	$MONTH_LIST = "";
+	for ($ii = 0; $ii < 12; $ii++)
+	{
+    	$m = $ii + 1;
+    	$monthjump = mktime(0, 0, 0, $m, 1, $year);
+		$MONTH_LIST .= "<a href='".e_SELF."?".$monthjump."'>".$monthabb[$ii]."</a> &nbsp;";
+	}
+	return $MONTH_LIST;
+SC_END
+
+
+
+// NAVIGATION BUTTONS ------------------------------------------------
+SC_BEGIN NAV_BUT_ALLEVENTS
+	global $NAV_BUT_ALLEVENTS;
+	$allevents = (e_PAGE == "event.php" ? EC_LAN_96 : EC_LAN_93);
+	return "<input class='button' type='submit' style='width:140px;' name='viewallevents' value='".$allevents."' title='".$allevents."' />";
+SC_END
+
+SC_BEGIN NAV_BUT_VIEWCAT
+	global $NAV_BUT_VIEWCAT;
+	//return "<input type='hidden' name='do' value='vc' /><input class='button' type='submit' style='width:140px;' name='viewcat' value='".EC_LAN_92."' />";
+	return "<input type='hidden' name='do' value='vc' />";
+SC_END
+
+SC_BEGIN NAV_BUT_SUBSCRIPTION
+	global $NAV_BUT_SUBSCRIPTION, $pref;
+	if ($pref['eventpost_asubs']>0) {
+		$NAV_BUT_SUBSCRIPTION = "<input class='button' type='submit' style='width:140px;' name='subs' value='".EC_LAN_123."' />";
+	}
+	return $NAV_BUT_SUBSCRIPTION;
+SC_END
+
+SC_BEGIN NAV_BUT_ENTEREVENT
+		global $NAV_BUT_ENTEREVENT, $pref, $prop;
+	$NAV_BUT_ENTEREVENT = "<input type='hidden' name='enter_new_val' value='".$prop."' />";
+	if (check_class($pref['eventpost_admin']) || getperms('0')){
+    	// start no admin preference
+    	$NAV_BUT_ENTEREVENT .= "<input class='button' type='submit' style='width:140px;' name='doit' value='".EC_LAN_94."' />";
+	}
+	return $NAV_BUT_ENTEREVENT;
+SC_END
+
+SC_BEGIN NAV_LINKCURRENTMONTH
+	global $NAV_LINKCURRENTMONTH, $month, $nowmonth, $year, $nowyear, $current;
+	$NAV_LINKCURRENTMONTH = "";
+	if ($month != $nowmonth || $year != $nowyear){
+		$NAV_LINKCURRENTMONTH = "<input class='button' type='button' style='width:140px;' name='cur' value='".EC_LAN_40."' onclick=\"javascript:document.location='".e_SELF."?$current'\" />";
+	}
+	return $NAV_LINKCURRENTMONTH;
+SC_END
+
+SC_BEGIN NAV_CATEGORIES
+	global $NAV_CATEGORIES, $sql, $pref, $_POST, $cal_super;
+	$NAV_CATEGORIES = "<select name='event_cat_ids' class='tbox' style='width:140px;' onchange='this.form.submit()' ><option class='tbox' value='all'>".EC_LAN_97."</option>";
+	$event_cat_id = ( isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] ? $_POST['event_cat_ids'] : null);
+
+	$cal_arg = ($cal_super ? "" : " find_in_set(event_cat_class,'".USERCLASS_LIST."') ");
+	$sql->db_Select("event_cat", "*", $cal_arg);
+	while ($row = $sql->db_Fetch()){
+ 	   if ($row['event_cat_id'] == $event_cat_id){
+ 	       $NAV_CATEGORIES .= "<option class='tbox' value='".$row['event_cat_id']."' selected='selected'>".$row['event_cat_name']."</option>";
+  	  }else{
+    	    $NAV_CATEGORIES .= "<option value='".$row['event_cat_id']."'>".$row['event_cat_name']."</option>";
+    	}
+	}
+	$NAV_CATEGORIES .= "</select>";
+	return $NAV_CATEGORIES;
+SC_END
+
+
+
+// CALENDAR SHOWEVENT ------------------------------------------------------------
+SC_BEGIN SHOWEVENT_IMAGE
+	global $SHOWEVENT_IMAGE, $ev;
+	if($ev['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon'])){
+		$img = "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
+	}else{
+		$img = "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='border:0; vertical-align:middle;' />";
+	}
+	return $img;
+	//return "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$ev['event_cat_icon']."' alt='' height='".$ev['imagesize']."' width='".$ev['imagesize']."' />";
+SC_END
+
+SC_BEGIN SHOWEVENT_INDICAT
+	global $SHOWEVENT_INDICAT, $ev;
+	return $ev['indicat'];
+SC_END
+
+SC_BEGIN SHOWEVENT_HEADING
+	global $SHOWEVENT_HEADING, $ev, $datearray, $c;
+	$linkut = mktime(0 , 0 , 0 , $datearray['mon'], $c, $datearray['year']);
+	if(isset($ev['fulltopic']) && $ev['fulltopic']){
+		$show_title = $ev['event_title'];
+	}else{
+		if (strlen($ev['event_title']) > 10){
+			$show_title = substr($ev['event_title'], 0, 10) . "...";
+		}else{
+			$show_title = $ev['event_title'];
+		}
+	}
+	if($ev['startofevent']){
+		return "<b><a title='{$ev['event_title']}' href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".event.".$ev['event_id']."'><span class='mediumtext'>".$show_title."</span></a></b>";
+	}else{
+		return "<a title='{$ev['event_title']}' href='".e_PLUGIN."calendar_menu/event.php?".$linkut.".event.".$ev['event_id']."'><span class='smalltext'>".$show_title."</span></a>";
+	}
+SC_END
+
+
+
+// CALENDAR CALENDAR ------------------------------------------------------------
+SC_BEGIN CALENDAR_CALENDAR_HEADER_DAY
+	global $CALENDAR_CALENDAR_HEADER_DAY, $day, $pref, $week;
+	if(isset($pref['eventpost_lenday']) && $pref['eventpost_lenday']){
+		return "<strong>".substr($day,0,$pref['eventpost_lenday'])."</strong>";
+	}else{
+ 		return "<strong>".$day."</strong>";
+	}
+SC_END
+
+SC_BEGIN CALENDAR_CALENDAR_DAY_TODAY_HEADING
+	global $CALENDAR_CALENDAR_DAY_TODAY_HEADING, $startt, $c, $days;
+	//return "<b><a href='".e_PLUGIN."calendar_menu/event.php?".$startt.".one'>".$days[($c-1)]."</a></b> <span class='smalltext'>[".EC_LAN_TODAY."]</span>";
+	return "<b><a href='".e_PLUGIN."calendar_menu/event.php?".$startt."'>".$days[($c-1)]."</a></b> <span class='smalltext'>[".EC_LAN_TODAY."]</span>";
+SC_END
+
+SC_BEGIN CALENDAR_CALENDAR_DAY_EVENT_HEADING
+	global $CALENDAR_CALENDAR_DAY_EVENT_HEADING, $startt, $c, $days;
+	//return "<a href='".e_PLUGIN."calendar_menu/event.php?".$startt.".one'>".$days[($c-1)]."</a>";
+	return "<a href='".e_PLUGIN."calendar_menu/event.php?".$startt."'>".$days[($c-1)]."</a>";
+SC_END
+
+SC_BEGIN CALENDAR_CALENDAR_DAY_EMPTY_HEADING
+	global $CALENDAR_CALENDAR_DAY_EMPTY_HEADING, $startt, $c, $days;
+	//return "<a href='".e_PLUGIN."calendar_menu/event.php?".$startt.".one'>".$days[($c-1)]."</a>";
+	return "<a href='".e_PLUGIN."calendar_menu/event.php?".$startt."'>".$days[($c-1)]."</a>";
+SC_END
+
+
+// EVENT LIST ------------------------------------------------
+SC_BEGIN EVENTLIST_CAPTION
+	global $EVENTLIST_CAPTION, $ds, $months, $selected_mon, $dayslo, $selected_day, $monthstart;
+	if ($ds == 'one'){
+		$EVENTLIST_CAPTION = EC_LAN_111.$months[$selected_mon-1]." ".$dayslo[$selected_day-1];
+	} elseif ($ds != 'event'){
+		$EVENTLIST_CAPTION = EC_LAN_112.$months[date("m", $monthstart)-1];
+	}
+	return $EVENTLIST_CAPTION;
+SC_END
+
+
+
+// EVENT ARCHIVE ------------------------------------------------------------
+SC_BEGIN EVENTARCHIVE_CAPTION
+	global $EVENTARCHIVE_CAPTION, $num;
+	if($num == 0){
+		$EVENTARCHIVE_CAPTION = str_replace("-NUM-", "", EC_LAN_62);
+	}else{
+		$EVENTARCHIVE_CAPTION = str_replace("-NUM-", $num, EC_LAN_62);
+	}
+	return $EVENTARCHIVE_CAPTION;
+SC_END
+
+SC_BEGIN EVENTARCHIVE_DATE
+	global $EVENTARCHIVE_DATE, $gen, $events;
+	$startds = cal_landate($events['event_start'], $recurring = false, $allday = false);
+	//$startds = $gen->convert_date($events['event_start'], "long");
+	$EVENTARCHIVE_DATE = "<a href='event.php?".$events['event_start'].".event.".$events['event_id']."'>".$startds."</a>";
+	return $EVENTARCHIVE_DATE;
+SC_END
+
+SC_BEGIN EVENTARCHIVE_DETAILS
+	global $EVENTARCHIVE_DETAILS, $events, $tp;
+	$number = 40;
+	$rowtext = $tp->toHTML($events['event_details'], TRUE, "nobreak");
+	$rowtext = strip_tags($rowtext);
+	$words = explode(" ", $rowtext);
+	$EVENTARCHIVE_DETAILS = implode(" ", array_slice($words, 0, $number));
+	if(count($words) > $number){
+		$EVENTARCHIVE_DETAILS .= " ".EC_LAN_133." ";
+	}
+	return $EVENTARCHIVE_DETAILS;
+	//return $events['event_details'];
+SC_END
+
+SC_BEGIN EVENTARCHIVE_EMPTY
+	global $EVENTARCHIVE_EMPTY;
+	return EC_LAN_37;
+SC_END
+
+SC_BEGIN EVENTARCHIVE_HEADING
+	global $EVENTARCHIVE_HEADING, $events;
+	$EVENTARCHIVE_HEADING = "";
+	$EVENTARCHIVE_HEADING = $events['event_title'];
+	return $EVENTARCHIVE_HEADING;
+SC_END
+
+
+
+
+// EVENT SHOWEVENT ------------------------------------------------------------
+SC_BEGIN EVENT_HEADING
+	global $EVENT_HEADING, $thisevent;
+	$EVENT_HEADING = "";
+	if ($thisevent['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon'])){
+		$EVENT_HEADING = "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon']."' alt='' /> ".$thisevent['event_title'] ;
+	}else{
+		//$EVENT_HEADING = EC_LAN_57." ".$thisevent['event_title'];
+		$EVENT_HEADING = $thisevent['event_title'];
+	}
+	return $EVENT_HEADING;
+	//return $thisevent['event_title'];
+SC_END
+
+SC_BEGIN EVENT_DATE_START
+	global $EVENT_DATE_START, $thisevent;
+	if ($thisevent['event_allday'] == 0){
+	if ($thisevent['event_start'] > $thisevent['event_end']){
+	$thisevent['event_end'] = $thisevent['event_start'];
+	}
+	}
+	$startds	= cal_landate($thisevent['event_start'], $thisevent['event_recurring'], $thisevent['event_allday']);
+	$endds		= cal_landate($thisevent['event_end'], $thisevent['event_recurring'], $thisevent['event_allday']);
+	if ($thisevent['event_allday']){
+		$EVENT_DATE_START = "<b>".EC_LAN_68."</b> ".$startds;
+	}else{
+		$EVENT_DATE_START = "<b>".EC_LAN_29."</b> ".$startds;
+	}
+	return $EVENT_DATE_START;
+SC_END
+
+SC_BEGIN EVENT_DATE_END
+	global $EVENT_DATE_END, $thisevent;
+	if ($thisevent['event_allday'] == 0){
+	if ($thisevent['event_start'] > $thisevent['event_end']){
+	$thisevent['event_end'] = $thisevent['event_start'];
+	}
+	}
+	$startds	= cal_landate($thisevent['event_start'], $thisevent['event_recurring'], $thisevent['event_allday']);
+	$endds		= cal_landate($thisevent['event_end'], $thisevent['event_recurring'], $thisevent['event_allday']);
+	if ($thisevent['event_allday'] || $startds == $endds){
+		$EVENT_DATE_END = "";
+	}else{
+		$EVENT_DATE_END = "<b>".EC_LAN_69."</b> ".$endds;
+	}
+	return $EVENT_DATE_END;
+SC_END
+
+SC_BEGIN EVENT_ID
+	global $EVENT_ID, $thisevent;
+	return "calevent".$thisevent['event_id'];
+SC_END
+
+SC_BEGIN EVENT_DISPLAYSTYLE
+	global $EVENT_DISPLAYSTYLE, $ds;
+	if ($ds=="event"){
+		$EVENT_DISPLAYSTYLE = "show";
+	}else{
+		$EVENT_DISPLAYSTYLE = "none";
+	}
+	return $EVENT_DISPLAYSTYLE;
+SC_END
+
+SC_BEGIN EVENT_DETAILS
+	global $EVENT_DETAILS, $thisevent, $tp;
+	return $tp->toHTML($thisevent['event_details'], TRUE);
+SC_END
+
+SC_BEGIN EVENT_CATEGORY
+	global $EVENT_CATEGORY, $thisevent, $tp;
+	if ($thisevent['event_cat_icon'] && file_exists(e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon'])){
+		$EVENT_CATEGORY = "<img style='border:0' src='".e_PLUGIN."calendar_menu/images/".$thisevent['event_cat_icon']."' alt='' /> ".$thisevent['event_cat_name'];
+	}else{
+		$EVENT_CATEGORY = $thisevent['event_cat_name'];
+	}
+	return $EVENT_CATEGORY;
+SC_END
+
+SC_BEGIN EVENT_LOCATION
+	global $EVENT_LOCATION, $thisevent;
+	if ($thisevent['event_location'] == ""){
+		//$EVENT_LOCATION = EC_LAN_38;
+		$EVENT_LOCATION = "";
+	}else{
+		$EVENT_LOCATION = $thisevent['event_location'];
+	}
+	return $EVENT_LOCATION;
+SC_END
+
+SC_BEGIN EVENT_AUTHOR
+	global $EVENT_AUTHOR, $event_author_id, $event_author_name;
+	if(USER){
+		$EVENT_AUTHOR = "<a href='".e_BASE."user.php?id.".$event_author_id."'>".$event_author_name."</a>";
+	}else{
+		$EVENT_AUTHOR = $event_author_name;
+	}
+	return $EVENT_AUTHOR;
+SC_END
+
+SC_BEGIN EVENT_CONTACT
+	global $EVENT_CONTACT, $thisevent,$tp;
+	if ($thisevent['event_contact'] == ""){
+		//$EVENT_CONTACT = EC_LAN_38; // Not Specified ;
+	$EVENT_CONTACT = "";
+	}else{
+		$EVENT_CONTACT = $tp->toHTML($thisevent['event_contact'],"noreplace");
+	}
+	return $EVENT_CONTACT;
+SC_END
+
+SC_BEGIN EVENT_THREAD
+	global $EVENT_THREAD, $thisevent;
+	return ($thisevent['event_thread'] ? "<a href='{$thisevent['event_thread']}'><img src='".e_PLUGIN."forum/images/e.png' alt='' style='border:0; vertical-align:middle;' width='16' height='16' /> ".EC_LAN_39."</a>" : "");
+SC_END
+
+SC_BEGIN EVENT_OPTIONS
+	global $EVENT_OPTIONS, $thisevent, $event_author_name, $cal_super;
+	if (USERNAME == $event_author_name || $cal_super){
+		$EVENT_OPTIONS = "<a href='event.php?ed.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."admin_images/edit_16.png' title='".EC_LAN_35."' alt='".EC_LAN_35 . "'/></a>&nbsp;&nbsp;<a href='".e_PLUGIN."calendar_menu/event.php?de.".$thisevent['event_id']."'><img style='border:0;' src='".e_IMAGE."admin_images/delete_16.png' title='".EC_LAN_36."' alt='".EC_LAN_36."'/></a>";
+	}
+	return $EVENT_OPTIONS;
+SC_END
+
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/calendar_sql.php 75/e107_plugins/calendar_menu/calendar_sql.php
--- 6171/e107_plugins/calendar_menu/calendar_sql.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/calendar_sql.php	2005-04-30 23:37:02.000000000 -0500
@@ -0,0 +1,41 @@
+CREATE TABLE event (
+	event_id int(11) unsigned NOT NULL auto_increment,
+	event_start int(10) NOT NULL default '0',
+	event_end int(10) NOT NULL default '0',
+	event_allday tinyint(1) unsigned NOT NULL default '0',
+	event_recurring tinyint(1) unsigned NOT NULL default '0',
+	event_datestamp int(10) unsigned NOT NULL default '0',
+	event_title varchar(200) NOT NULL default '',
+	event_location text NOT NULL,
+	event_details text NOT NULL,
+	event_author varchar(100) NOT NULL default '',
+	event_contact varchar(200) NOT NULL default '',
+	event_category smallint(5) unsigned NOT NULL default '0',
+	event_thread varchar(100) NOT NULL default '',
+	event_rec_m tinyint(2) unsigned NOT NULL default '0',
+	event_rec_y tinyint(2) unsigned NOT NULL default '0',
+	PRIMARY KEY  (event_id)
+	) TYPE=MyISAM;,
+	CREATE TABLE event_cat (
+	event_cat_id smallint(5) unsigned NOT NULL auto_increment,
+	event_cat_name varchar(100) NOT NULL default '',
+	event_cat_icon varchar(100) NOT NULL default '',
+	event_cat_class int(10) unsigned NOT NULL default '0',
+	event_cat_subs tinyint(3) unsigned NOT NULL default '0',
+	event_cat_force tinyint(3) unsigned NOT NULL default '0',
+	event_cat_ahead tinyint(3) unsigned NOT NULL default '0',
+	event_cat_msg1 text,
+	event_cat_msg2 text,
+	event_cat_notify  tinyint(3) unsigned NOT NULL default '0',
+	event_cat_last int(10) unsigned NOT NULL default '0',
+	event_cat_today int(10) unsigned NOT NULL default '0',
+	event_cat_lastupdate int(10) unsigned NOT NULL default '0',
+	event_cat_addclass int(10) unsigned NOT NULL default '0',
+	PRIMARY KEY  (event_cat_id)
+	) TYPE=MyISAM;,
+	CREATE TABLE event_subs (
+	event_subid int(10) unsigned NOT NULL auto_increment,
+	event_userid  int(10) unsigned NOT NULL default '0',
+	event_cat  int(10) unsigned NOT NULL default '0',
+	PRIMARY KEY  (event_subid)
+	) TYPE=MyISAM;
diff -ruN 6171/e107_plugins/calendar_menu/calendar_template.php 75/e107_plugins/calendar_menu/calendar_template.php
--- 6171/e107_plugins/calendar_menu/calendar_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/calendar_template.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,187 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+// TIME SWITCH BUTTONS ------------------------------------------------------------
+$sc_style['PREV_MONTH']['pre'] = "<span class='defaulttext'>";
+$sc_style['PREV_MONTH']['post'] = "</span>";
+
+$sc_style['CURRENT_MONTH']['pre'] = "<b>";
+$sc_style['CURRENT_MONTH']['post'] = "</b>";
+
+$sc_style['NEXT_MONTH']['pre'] = "<span class='defaulttext'>";
+$sc_style['NEXT_MONTH']['post'] = "</span>";
+
+$sc_style['PREV_YEAR']['pre'] = "";
+$sc_style['PREV_YEAR']['post'] = "";
+
+$sc_style['MONTH_LIST']['pre'] = "";
+$sc_style['MONTH_LIST']['post'] = "";
+
+$sc_style['NEXT_YEAR']['pre'] = "";
+$sc_style['NEXT_YEAR']['post'] = "";
+
+//<table style='width:98%;' class='fborder'>
+
+$CALENDAR_TIME_TABLE = "
+<table cellpadding='0' cellspacing='1' class='fborder' style='width:100%'>
+<tr>
+	<td class='forumheader' style='width:18%; text-align:left'>{PREV_MONTH}</td>
+	<td class='fcaption' style='width:64%; text-align:center'>{CURRENT_MONTH}</td>
+	<td class='forumheader' style='width:18%; text-align:right'>{NEXT_MONTH}</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='text-align:left'>{PREV_YEAR}</td>
+	<td class='fcaption' style='text-align:center; vertical-align:middle'>{MONTH_LIST}</td>
+	<td class='forumheader3' style='text-align:right'>{NEXT_YEAR}</td>
+</tr>
+</table>";
+
+
+
+// NAVIGATION BUTTONS ------------------------------------------------------------
+//$sc_style['NAV_LINKCURRENTMONTH']['pre'] = "<span class='button' style='width:120px; '>";
+//$sc_style['NAV_LINKCURRENTMONTH']['post'] = "</span>";
+$sc_style['NAV_LINKCURRENTMONTH']['pre'] = "";
+$sc_style['NAV_LINKCURRENTMONTH']['post'] = "";
+
+$CALENDAR_NAVIGATION_TABLE = "
+<div style='text-align:center; margin-bottom:20px;'>
+<form method='post' action='" . e_SELF . "?" . e_QUERY . "' id='calform'>
+<table border='0' cellpadding='0' cellspacing='0' style='width:100%;'>
+<tr>
+	<td style='text-align:center;'>{NAV_CATEGORIES} {NAV_BUT_ALLEVENTS} {NAV_BUT_VIEWCAT} {NAV_BUT_ENTEREVENT} {NAV_BUT_SUBSCRIPTION} {NAV_LINKCURRENTMONTH}</td>
+</tr>
+</table>
+</form>
+</div>";
+/*
+	<table border='0' cellpadding='2' cellspacing='3' class='forumheader3' style='width:100%;'>
+	<tr>
+		<td style='text-align:right;'>{NAV_CATEGORIES}</td>
+		<td style='text-align:center;'>{NAV_BUT_ALLEVENTS}</td>
+	</tr>
+	<tr>
+		<td style='text-align:right;'>{NAV_BUT_VIEWCAT}</td>
+		<td style='text-align:center;'>{NAV_BUT_ENTEREVENT}</td>
+	</tr>
+	<tr>
+		<td style='text-align:center;' colspan='2'>{NAV_BUT_SUBSCRIPTION}</td>
+	</tr>
+	</table>
+	*/
+
+
+// EVENT LIST ------------------------------------------------------------
+$sc_style['EVENTLIST_CAPTION']['pre'] = "<tr><td class='fcaption' colspan='2'>";
+$sc_style['EVENTLIST_CAPTION']['post'] = ":<br /><br /></td></tr>";
+
+$EVENT_EVENTLIST_TABLE_START = "<table style='width:100%' class='fborder'>{EVENTLIST_CAPTION}";
+$EVENT_EVENTLIST_TABLE_END = "</table>";
+
+
+
+// EVENT ARCHIVE ------------------------------------------------------------
+$sc_style['EVENTARCHIVE_CAPTION']['pre'] = "<tr><td colspan='2' class='fcaption'>";
+$sc_style['EVENTARCHIVE_CAPTION']['post'] = "</td></tr>";
+
+$EVENT_ARCHIVE_TABLE_START = "<br /><table style='width:100%' class='fborder'>{EVENTARCHIVE_CAPTION}";
+$EVENT_ARCHIVE_TABLE = "
+<tr>
+	<td style='width:35%; vertical-align:top' class='forumheader3'>{EVENTARCHIVE_DATE}</td>
+	<td style='width:65%' class='forumheader3'>{EVENTARCHIVE_HEADING}</td>
+</tr>";
+//<br />{EVENTARCHIVE_DETAILS}
+$EVENT_ARCHIVE_TABLE_EMPTY = "<tr><td colspan='2' class='forumheader3'>{EVENTARCHIVE_EMPTY}</td></tr>";
+$EVENT_ARCHIVE_TABLE_END = "</table>";
+
+
+
+// EVENT SHOW EVENT ------------------------------------------------------------
+$EVENT_EVENT_TABLE_START = "<table style='width:100%' class='fborder' cellspacing='0' cellpadding='0'>";
+$EVENT_EVENT_TABLE_END = "</table>";
+
+$sc_style['EVENT_DETAILS']['pre'] = "<tr><td colspan='2' class='forumheader3'>";
+$sc_style['EVENT_DETAILS']['post'] = "</td></tr>";
+
+$sc_style['EVENT_LOCATION']['pre'] = "<b>".EC_LAN_32."</b> ";
+$sc_style['EVENT_LOCATION']['post'] = "";
+
+$sc_style['EVENT_AUTHOR']['pre'] = "<b>".EC_LAN_31."</b> ";
+$sc_style['EVENT_AUTHOR']['post'] = "&nbsp;";
+
+$sc_style['EVENT_CONTACT']['pre'] = "<b>".EC_LAN_33."</b> ";
+$sc_style['EVENT_CONTACT']['post'] = "&nbsp;";
+
+$sc_style['EVENT_THREAD']['pre'] = "<tr><td colspan='2' class='forumheader3'><span class='smalltext'>";
+$sc_style['EVENT_THREAD']['post'] = "</span></td></tr>";
+
+$sc_style['EVENT_CATEGORY']['pre'] = "<b>".EC_LAN_30."</b> ";
+$sc_style['EVENT_CATEGORY']['post'] = "&nbsp;";
+
+$sc_style['EVENT_DATE_START']['pre'] = "";
+$sc_style['EVENT_DATE_START']['post'] = "";
+
+$sc_style['EVENT_DATE_END']['pre'] = "";
+$sc_style['EVENT_DATE_END']['post'] = "";
+
+$EVENT_EVENT_TABLE = "
+<tr>
+	<td >
+		<div title='".EC_LAN_132."' class='fcaption' style='cursor:pointer; text-align:left; border:0px solid #000;' onclick=\"expandit('{EVENT_ID}')\">{EVENT_HEADING}</div>
+		<div id='{EVENT_ID}' style='display:{EVENT_DISPLAYSTYLE}; padding-top:10px; padding-bottom:10px; text-align:left;'>
+			<table style='width:100%;'  cellspacing='0' cellpadding='0'>
+				<tr><td colspan='2' class='forumheader3'>{EVENT_AUTHOR} {EVENT_CATEGORY} {EVENT_CONTACT} {EVENT_OPTIONS}</td></tr>
+				<tr><td colspan='2' class='forumheader3'>{EVENT_DATE_START} {EVENT_DATE_END}</td></tr>
+				<tr><td colspan='2' class='forumheader3'>{EVENT_LOCATION}</td></tr>
+				{EVENT_DETAILS}
+				{EVENT_THREAD}
+			</table>
+		</div>
+	</td>
+</tr>
+";
+
+
+// CALENDAR SHOW EVENT ------------------------------------------------------------
+$CALENDAR_SHOWEVENT = "<table cellspacing='0' cellpadding='0' style='width:100%;'><tr><td style='vertical-align:top; width:10px;'>{SHOWEVENT_IMAGE}</td><td style='vertical-align:top; width:2%;'>{SHOWEVENT_INDICAT}</td><td style='vertical-align:top;'>{SHOWEVENT_HEADING}</td></tr></table>";
+
+
+
+// CALENDAR CALENDAR ------------------------------------------------------------
+$CALENDAR_CALENDAR_START = "
+<div style='text-align:center'>
+<table cellpadding='0' cellspacing='1' class='fborder' style='background-color:#DDDDDD; width:100%'>";
+
+$CALENDAR_CALENDAR_END = "
+</tr></table></div>";
+
+$CALENDAR_CALENDAR_DAY_NON = "<td style='width:12%;height:60px;'></td>";
+
+//header row
+$CALENDAR_CALENDAR_HEADER_START = "<tr>";
+$CALENDAR_CALENDAR_HEADER = "<td class='fcaption' style='z-index: -1; background-color:#000; color:#FFF; width:90px; height:20px; text-align:center; vertical-align:middle;'>{CALENDAR_CALENDAR_HEADER_DAY}</td>";
+$CALENDAR_CALENDAR_HEADER_END = "</tr><tr>";
+
+
+$CALENDAR_CALENDAR_WEEKSWITCH = "</tr><tr>";
+
+//today
+$CALENDAR_CALENDAR_DAY_TODAY = "
+<td class='forumheader3' style='vertical-align:top; width:14%; height:90px; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
+<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'>{CALENDAR_CALENDAR_DAY_TODAY_HEADING}</span>";
+
+//day has events
+$CALENDAR_CALENDAR_DAY_EVENT = "
+<td class='forumheader3' style='z-index: 1;vertical-align:top; width:14%; height:90px; padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
+<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{CALENDAR_CALENDAR_DAY_EVENT_HEADING}</b></span>";
+
+// no events and not today
+$CALENDAR_CALENDAR_DAY_EMPTY = "
+<td class='forumheader2' style='z-index: 1;vertical-align:top; width:14%; height:90px;padding-bottom:0px;padding-right:0px; margin-right:0px; padding:2px;'>
+<span style='z-index: 2; position:relative; top:1px; height:10px;padding-right:0px'><b>{CALENDAR_CALENDAR_DAY_EMPTY_HEADING}</b></span>";
+
+$CALENDAR_CALENDAR_DAY_END = "</td>";
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/config.php 75/e107_plugins/calendar_menu/config.php
--- 6171/e107_plugins/calendar_menu/config.php	2004-09-03 13:32:10.000000000 -0500
+++ 75/e107_plugins/calendar_menu/config.php	2005-03-17 20:13:57.000000000 -0600
@@ -1,62 +1,25 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system 
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/e107_plugins/calendar_menu/config.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/03 18:32:10 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-require_once(e_HANDLER."userclass_class.php");
-if(!getperms("P")){ header("location:".e_BASE."index.php"); }
-
-$lan_file = e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php";
-include(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
-
-
-if(IsSet($_POST['updatesettings'])){
-        $pref['eventpost_admin'] = $_POST['eventpost_admin'];
-                save_prefs();
-        $message = EC_LAN_75; // "Calendar settings updated.";
-}
-
-require_once(e_ADMIN."auth.php");
-
-if($message){
-        $ns -> tablerender("", "<div style='text-align:center'><b>$message</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<table style='width:85%' class='fborder'>
-<tr>
-<td style='width:40%' class='forumheader3'>".EC_LAN_76." </td>
-<td style='width:60%' class='forumheader3'>".
-r_userclass("eventpost_admin", $pref['eventpost_admin'], $mode="off")
-."
-</td>
-</tr>
-
-<tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='updatesettings' value='".EC_LAN_77."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender("<div style='text-align:center'>".EC_LAN_78."</div>", $text);
-require_once(e_ADMIN."footer.php");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/config.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/03/18 02:13:57 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+// *BK* This relocates to admin_config.php.  This is because to recognise an admin theme the script has to contain the 
+// *BK* word admin in the filename.  However if you do that then the menu manager doesn't recognise the config file 
+// *BK* which has to be called config.php otherwise there is no config option in the menu's combo
+require_once("../../class2.php");
+header("location:".e_PLUGIN."calendar_menu/admin_config.php");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/e_list.php 75/e107_plugins/calendar_menu/e_list.php
--- 6171/e107_plugins/calendar_menu/e_list.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/e_list.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,58 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+	if(!$calendar_install = $sql -> db_Select("plugin", "*", "plugin_path = 'calendar_menu' AND plugin_installflag = '1' ")){
+		return;
+	}
+
+	$LIST_CAPTION = $arr[0];
+	$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+
+	$todayarray		= getdate();
+	$current_day	= $todayarray['mday'];
+	$current_month	= $todayarray['mon'];
+	$current_year	= $todayarray['year'];
+	$current		= mktime(0,0,0,$current_month, $current_day, $current_year);
+
+	if($mode == "new_page" || $mode == "new_menu" ){
+		$lvisit = $this -> getlvisit();
+		$qry = " event_datestamp>".intval($lvisit)." AND ";
+	}else{
+		$qry = "";
+	}
+
+	$bullet = $this -> getBullet($arr[6], $mode);
+
+	$qry = "
+	SELECT e.*, c.event_cat_name
+	FROM #event AS e 
+	LEFT JOIN #event_cat AS c ON c.event_cat_id = e.event_category 
+	WHERE ".$qry." e.event_start>='$current' AND c.event_cat_class REGEXP '".e_CLASS_REGEXP."' 
+	ORDER BY e.event_start ASC LIMIT 0,".intval($arr[7]);
+
+	if(!$event_items = $sql->db_Select_gen($qry)){
+		$LIST_DATA = LIST_CALENDAR_2;
+	}else{
+		while($row = $sql -> db_Fetch()){
+
+			$tmp = explode(".", $row['event_author']);
+			if($tmp[0] == "0"){
+				$AUTHOR = $tmp[1];
+			}elseif(is_numeric($tmp[0]) && $tmp[0] != "0"){
+				$AUTHOR = (USER ? "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$tmp[1]."</a>" : $tmp[1]);
+			}else{
+				$AUTHOR = "";
+			}
+
+			$rowheading	= $this -> parse_heading($row['event_title'], $mode);
+			$ICON		= $bullet;
+			$HEADING	= "<a href='".e_PLUGIN."calendar_menu/event.php?".$row['event_start'].".event.".$row['event_id']."' title='".$row['event_title']."'>".$rowheading."</a>";
+			$CATEGORY	= $row['event_cat_name'];
+			$DATE		= ($arr[5] ? ($row['event_start'] ? $this -> getListDate($row['event_start'], $mode) : "") : "");
+			$INFO		= "";
+			$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+		}
+	}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/e_search.php 75/e107_plugins/calendar_menu/e_search.php
--- 6171/e107_plugins/calendar_menu/e_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/e_search.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,11 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+if (file_exists(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE."_search.php")) {
+	include_once(e_PLUGIN."calendar_menu/languages/".e_LANGUAGE."_search.php");
+} else {
+	include_once(e_PLUGIN."calendar_menu/languages/English_search.php");
+}
+$search_info[] = array('sfile' => e_PLUGIN.'calendar_menu/search/search_parser.php', 'qtype' => CM_SCH_LAN_1, 'refpage' => 'calendar.php');
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/event.php 75/e107_plugins/calendar_menu/event.php
--- 6171/e107_plugins/calendar_menu/event.php	2004-09-03 13:32:10.000000000 -0500
+++ 75/e107_plugins/calendar_menu/event.php	2006-01-12 16:18:29.000000000 -0600
@@ -1,824 +1,818 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /event.php
-|
-|        Steve Dunstan 2001-2002
-|        http://jalist.com
-|        stevedunstan@jalist.com
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-define("PAGE_NAME", "Event List");
-if(IsSet($_POST['viewallevents'])){
-Header("Location: ".e_PLUGIN."calendar_menu/calendar.php?".$_POST['enter_new_val']);
-}
-
-if(IsSet($_POST['doit'])){
-Header("Location: ".e_PLUGIN."calendar_menu/event.php?ne.".$_POST['enter_new_val']);
-}
-
-
-
-$ec_dir = e_PLUGIN."calendar_menu/";
-$lan_file = $ec_dir."languages/".e_LANGUAGE.".php";
-include(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
-
-
-
-$aj = new textparse();
-// enter new category into db ------------------------------------------------------------------------
-
-
-
-if(IsSet($_POST['ne_cat_create'])){
-        if($_POST['ne_new_category'] != "" && $_POST['ne_new_category_icon'] != ""){
-                $sql -> db_Insert("event_cat", " 0, '".$_POST['ne_new_category']."', '".$_POST['ne_new_category_icon']."' ");
-                header("location:event.php?".$_POST['qs'].".m1");
-        }else{
-                header("location:event.php?".$_POST['qs'].".m3");
-        }
-}
-// ----------------------------------------------------------------------------------------------------------
-// enter new event into db ----------------------------------------------------------------------------
-if(IsSet($_POST['ne_insert']) && USER == TRUE){
-        if($_POST['ne_event'] != ""){
-
-                $ev_start = mktime( $_POST['ne_hour'], $_POST['ne_minute'], 0, $_POST['ne_month'], $_POST['ne_day'], $_POST['ne_year']);
-                $ev_end = mktime( $_POST['end_hour'], $_POST['end_minute'], 0, $_POST['end_month'], $_POST['end_day'], $_POST['end_year']);
-
-                $ev_title = $aj -> formtpa($_POST['ne_title']);
-                $ev_location = $aj -> formtpa($_POST['ne_location']);
-                $ev_event = $aj -> formtpa($_POST['ne_event']);
-
-                if($_POST['recurring'] == 1){
-                        $rec_m = $_POST['ne_day'];
-                        $rec_y = $_POST['ne_month'];
-                }else{
-                        $rec_m = "";
-                        $rec_y = "";
-                }
-
-                $sql -> db_Insert("event", " 0, '$ev_start', '$ev_end', '".$_POST['allday']."', '".$_POST['recurring']."', '".time()."', '$ev_title', '$ev_location', '$ev_event', '".USERID.".".USERNAME."', '".$_POST['ne_email']."', '".$_POST['ne_category']."', '".$_POST['ne_thread']."', '$rec_m', '$rec_y' ");
-
-                $qs = eregi_replace("ne.", "", $_POST['qs']);
-
-                header("location:event.php?".$qs.".m4");
-        }else{
-                header("location:event.php?".$ev_start."..m3");
-        }
-}
-// ----------------------------------------------------------------------------------------------------------
-// update event in db ----------------------------------------------------------------------------------
-
-if(IsSet($_POST['ne_update']) && USER == TRUE){
-        if($_POST['ne_event'] != ""){
-
-                $ev_start = mktime( $_POST['ne_hour'], $_POST['ne_minute'], 0, $_POST['ne_month'], $_POST['ne_day'], $_POST['ne_year']);
-                $ev_end = mktime( $_POST['end_hour'], $_POST['end_minute'], 0, $_POST['end_month'], $_POST['end_day'], $_POST['end_year']);
-
-                $ev_title = $aj -> formtpa($_POST['ne_title']);
-                $ev_location = $aj -> formtpa($_POST['ne_location']);
-                $ev_event = $aj -> formtpa($_POST['ne_event']);
-
-                if($_POST['recurring'] == 1){
-                        $rec_m = $_POST['ne_day'];
-                        $rec_y = $_POST['ne_month'];
-                }else{
-                        $rec_m = "";
-                        $rec_y = "";
-                }
-
-                $sql -> db_Update("event", "event_start='$ev_start', event_end='$ev_end', event_allday='".$_POST['allday']."', event_recurring='".$_POST['recurring']."', event_datestamp= '".time()."', event_title= '$ev_title', event_location='$ev_location', event_details='$ev_event', event_contact='".$_POST['ne_email']."', event_category='".$_POST['ne_category']."', event_thread='".$_POST['ne_thread']."', event_rec_m='$rec_m', event_rec_y='$rec_y' WHERE event_id='".$_POST['id']."' ");
-
-                $qs = eregi_replace("ed.", "", $_POST['qs']);
-
-               header("location:event.php?".$ev_start.".".$qs.".m5");
-        }else{
-                header("location:event.php?".$ev_start."..m3");
-        }
-}
-
-
-// ----------------------------------------------------------------------------------------------------------
-
-require_once(HEADERF);
-
-if(IsSet($_POST['jump'])){
-        $smarray = getdate(mktime(0,0,0,$_POST['jumpmonth'], 1, $_POST['jumpyear']));
-        $month = $smarray['mon'];
-        $year = $smarray['year'];
-}else{
-        $qs = explode(".", $_SERVER['QUERY_STRING']);
-        $action = $qs[0];
-        $ds = $qs[1];
-        if($action == ""){
-                $nowarray = getdate();
-                $month = $nowarray['mon'];
-                $year = $nowarray['year'];
-        }else{
-                $smarray = getdate($action);
-                $month = $smarray['mon'];
-                $year = $smarray['year'];
-        }
-}
-
-if(IsSet($_POST['confirm'])){
-        $sql -> db_Delete("event", "event_id='".$_POST['existing']."' ");
-        $message = EC_LAN_51; //Event Deleted
-}
-
-if($action == "de"){
-        $text = "<div style='text-align:center'>
-        <b>".EC_LAN_48."</b>
-<br /><br />
-<form method='post' action='".e_SELF."'>
-<input class='button' type='submit' name='cancel' value='".EC_LAN_49."' />
-<input class='button' type='submit' name='confirm' value='".EC_LAN_50."' />
-<input type='hidden' name='existing' value='".$qs[1]."'>
-</form>
-</div>";
-$ns -> tablerender(EC_LAN_46, $text); // Confirm Delete Event
-
-        require_once(FOOTERF);
-        exit;
-}
-if(IsSet($_POST['cancel'])){
-        $message = EC_LAN_47;  // Delete Cancelled
-}
-
-
-// set up data arrays ----------------------------------------------------------------------------------
-$days = array(EC_LAN_18,EC_LAN_12,EC_LAN_13,EC_LAN_14,EC_LAN_15,EC_LAN_16,EC_LAN_17);
-$dayslo = array('1st', '2nd', '3rd', '4th', '5th', '6th', '7th', '8th', '9th', '10th', '11th', '12th', '13th', '14th', '15th', '16th', '17th', '18th', '19th', '20th', '21st', '22nd', '23rd', '24th', '25th', '26th', '27th', '28th', '29th', '30th', '31st');
-$monthabb = Array(EC_LAN_JAN,EC_LAN_FEB,EC_LAN_MAR,EC_LAN_APR,EC_LAN_MAY,EC_LAN_JUN,EC_LAN_JUL,EC_LAN_AUG,EC_LAN_SEP,EC_LAN_OCT,EC_LAN_NOV,EC_LAN_DEC);
-$months = array(EC_LAN_0,EC_LAN_1,EC_LAN_2,EC_LAN_3,EC_LAN_4,EC_LAN_5,EC_LAN_6,EC_LAN_7,EC_LAN_8,EC_LAN_9,EC_LAN_10,EC_LAN_11);
-// ----------------------------------------------------------------------------------------------------------
-
-if($qs[2] == "m1"){
-        $message = EC_LAN_41; //"New category created.";
-}else if($qs[2] == "m2"){
-        $message = EC_LAN_42; //"Event cannot end before it starts.";
-}else if($qs[2] == "m3"){
-        $message = EC_LAN_43; //"You left required field(s) blank.";
-}else if($qs[2] == "m4"){
-        $message = EC_LAN_44; //"New event created and entered into database.";
-}elseif($qs[2] == "m5"){
-        $message = EC_LAN_45; // "Event updated in database.";
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-}
-
-// enter new event form---------------------------------------------------------------------------------
-if($action == "ne" || $action == "ed"){
-                if(check_class($pref['eventpost_admin']) || getperms('0')){
-        if($action == "ed"){
-                $sql -> db_Select("event", "*", "event_id='".$qs[1]."' ");
-                list($null, $ne_start, $ne_end, $allday, $recurring, $ne_datestamp, $ne_title, $ne_location, $ne_event, $ne_author, $ne_email, $ne_category, $ne_thread) = $sql-> db_Fetch();
-
-                $smarray = getdate($ne_start);
-                $ne_day = $smarray['mday'];
-                $ne_month = $smarray['mon'];
-                $ne_year = $smarray['year'];
-
-                $ne_hour = $smarray['hours'];
-                $ne_minute = $smarray['minutes'];
-
-                $smarray = getdate($ne_end);
-                $end_day = $smarray['mday'];
-                $end_month = $smarray['mon'];
-                $end_year = $smarray['year'];
-
-                $end_hour = $smarray['hours'];
-                $end_minute = $smarray['minutes'];
-
-        }else{
-
-                $smarray = getdate($qs[1]);
-                $month = $smarray['mon'];
-                $year = $smarray['year'];
-
-                $ne_day = $smarray['mday'];
-                $ne_month = $smarray['mon'];
-                $ne_year = $smarray['year'];
-
-                $ne_hour = $smarray['hours'];
-                $ne_minute = $smarray['minutes'];
-                $end_day = $smarray['mday'];
-                $end_month = $smarray['mon'];
-                $end_year = $smarray['year'];
-
-                $end_hour = $smarray['hours'];
-                $end_minute = $smarray['minutes'];
-        }
-
-        $text = "<form method='post' action='".$_SERVER['PHP_SELF']."' name='linkform'>
-        <table style='width:580px' class='fborder' align='center'>";
-
-        if($action == "ed"){
-                $caption = EC_LAN_66;  // edit Event
-        }elseif($action == "ne"){
-                $caption = EC_LAN_28; // Enter New Event
-        }else{
-        $caption = "Calendar";
-        }
-
-        $text .= "
-        <tr>
-
-        <td class='forumheader3' style='width:20%'>".EC_LAN_72." </td>
-        <td class='forumheader3' style='width:80%'>
-
-        ".EC_LAN_67." <select name='ne_day' class='tbox'>";
-        for($count=1; $count<=31; $count++){
-                if($count == $ne_day){
-                        $text .= "<option selected>".$count."</option>";
-                }else{
-                        $text .= "<option>".$count."</option>";
-                }
-        }
-        $text .= "</select>
-        <select name='ne_month' class='tbox'>";
-        for($count=1; $count<=12; $count++){
-                if($count == $ne_month){
-                        $text .= "<option value='$count' selected>".$months[($count-1)]."</option>";
-                }else{
-                        $text .= "<option value='$count'>".$months[($count-1)]."</option>";
-                }
-        }
-        $text .= "</select>
-        <select name='ne_year' class='tbox'>";
-        for($count=2002; $count<=2022; $count++){
-                if($count == $ne_year){
-                        $text .= "<option selected>".$count."</option>";
-                }else{
-                        $text .= "<option>".$count."</option>";
-                }
-        }
-        $text .= "</select></br>&nbsp;&nbsp;".EC_LAN_73."
-        <select name='end_day' class='tbox'>";
-        for($count=1; $count<=31; $count++){
-                if($count == $end_day){
-                        $text .= "<option selected>".$count."</option>";
-                }else{
-                        $text .= "<option>".$count."</option>";
-                }
-        }
-        $text .= "</select>
-        <select name='end_month' class='tbox'>";
-        for($count=1; $count<=12; $count++){
-                if($count == $end_month){
-                        $text .= "<option value='$count' selected>".$months[($count-1)]."</option>";
-                }else{
-                        $text .= "<option value='$count'>".$months[($count-1)]."</option>";
-                }
-        }
-        $text .= "</select>
-        <select name='end_year' class='tbox'>";
-        for($count=2002; $count<=2022; $count++){
-                if($count == $end_year){
-                        $text .= "<option selected>".$count."</option>";
-                }else{
-                        $text .= "<option>".$count."</option>";
-                }
-        }
-        $text .= "</select>
-
-
-
-        </td>
-        </tr>
-
-        <tr>
-        <td class='forumheader3' style='width:20%'>".EC_LAN_71 ." </td>
-        <td class='forumheader3' style='width:80%'>
-
-        ".EC_LAN_67." <select name='ne_hour' class='tbox'>";
-        for($count="00"; $count<="23"; $count++){
-                if($count == $ne_hour){
-                        $text .= "<option selected>".$count."</option>";
-                }else{
-                        $text .= "<option>".$count."</option>";
-                }
-        }
-        $text .= "</select>
-        <select name='ne_minute' class='tbox'>";
-        for($count="00"; $count<="59"; $count++){
-                if($count == $ne_minute){
-                        $text .= "<option selected>".$count."</option>";
-                }else{
-                        $text .= "<option>".$count."</option>";
-                }
-        }
-        $text .= "</select>
-
-        &nbsp;&nbsp;".EC_LAN_73." <select name='end_hour' class='tbox'>";
-        for($count="00"; $count<="23"; $count++){
-                if($count == $end_hour){
-                        $text .= "<option selected>".$count."</option>";
-                }else{
-                        $text .= "<option>".$count."</option>";
-                }
-        }
-        $text .= "</select>
-        <select name='end_minute' class='tbox'>";
-        for($count="00"; $count<="59"; $count++){
-                if($count == $end_minute){
-                        $text .= "<option selected>".$count."</option>";
-                }else{
-                        $text .= "<option>".$count."</option>";
-                }
-        }
-        $text .= "</select>";
-
-        if($allday == 1){
-                $text .= "<br><input type='checkbox' name='allday' value='1'  checked>";
-        }else{
-                $text .= "<br><input type='checkbox' name='allday' value='1'>";
-        }
-
-        $text .= EC_LAN_64."
-
-        </td>
-        </tr>
-
-        <tr>
-        <td class='forumheader3' style='width:20%'>".EC_LAN_65 ."</td>
-        <td class='forumheader3' style='width:80%'>";
-
-        if($recurring == 1){
-                $text .= "<input type='checkbox' name='recurring' value='1'  checked>";
-        }else{
-                $text .= "<input type='checkbox' name='recurring' value='1'>";
-        }
-
-        $text .= EC_LAN_63 . "
-
-        </td>
-        </tr>
-
-        <tr>
-        <td class='forumheader3' style='width:20%'>".EC_LAN_70 ."</td>
-        <td class='forumheader3' style='width:80%'>
-        <input class='tbox' type='text' name='ne_title' size='75' value='$ne_title' maxlength='200' />
-        </td>
-        </tr>
-
-
-        <tr>
-        <td class='forumheader3' style='width:20%'>".EC_LAN_52." </td>
-        <td class='forumheader3' style='width:80%'>
-        <select name='ne_category' class='tbox'>";
-        $sql -> db_Select("event_cat");
-
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                if($ne_category == $event_cat_id){
-                        $text .= "<option value='$event_cat_id' selected>".$event_cat_name."</option>";
-                }else{
-                        $text .= "<option value='$event_cat_id'>".$event_cat_name."</option>";
-                }
-        }
-
-        $text .= "</select>
-        </td>
-        </tr>";
-
-        if(ADMIN == TRUE && $action != "ed"){
-        $imagelist = "";
-        $handle=opendir(e_PLUGIN."calendar_menu/images/");
-        while ($file = readdir($handle)){
-        if($file != "." && $file != ".." && $file != "templates"  && $file != "icon_ec.png" && $file != "shared" && $file != "/"){
-        $imagelist[] = $file;
-        }
-        }
-closedir($handle);
-        $text .="<script type=\"text/javascript\">
-                function addtext(sc){
-                document.linkform.ne_new_category_icon.value = sc;
-                }
-                </script>";
-
-
-                $text .= "<tr>
-        <td class='forumheader3' style='width:20%' rowspan='2'>".EC_LAN_53." </td>
-        <td class='forumheader3' style='width:80%'>".EC_LAN_54." <input class='tbox' type='text' name='ne_new_category' size='30' value='$ne_new_category' maxlength='100' /> ";
-        $text .="</tr><tr><td class='forumheader3' style='width:80%'>".EC_LAN_55;
-        $text .=" <input class='tbox' style='width:150px' type='text' name='ne_new_category_icon' />";
-        $text .=" <input class='button' type ='button' style=''width: 35px'; cursor:hand' size='30' value='Choose' onClick='expandit(this)'>";
-        $text .="<div style='display:none' style=&{head};>";
-
-         while(list($key,$icons) = each($imagelist)){
-        $text .= "<a href='javascript:addtext(\"$icons\")'><img src='".$ec_dir."images/".$icons."' style='border:0px' alt='' /></a> ";
-        }
-
-        /*
-        $text .="<select class='tbox' name='ne_new_category_icon'>";
-                $c=0;
-                while($imagelist[$c]){
-                $text .= "<option>".$imagelist[$c]."</option>";
-                $c++;
-               }
-        $text .="</select>";
-        */
-        $text .= "</div>";
-                $text .="<div style='text-align:center'><input class='button' type='submit' name='ne_cat_create' value='".EC_LAN_56."' /></div>";
-          }
-
-        $text .= "</td>
-        </tr>
-
-        <tr>
-        <td class='forumheader3' style='width:20%'>".EC_LAN_32." </td>
-        <td class='forumheader3' style='width:80%'>
-        <input class='tbox' type='text' name='ne_location' size='60' value='$ne_location' maxlength='200' />
-
-        </td>
-        </tr>
-
-        <tr>
-        <td class='forumheader3' style='width:20%'>".EC_LAN_57." </td>
-        <td class='forumheader3' style='width:80%'>
-        <textarea class='tbox' name='ne_event' cols='59' rows='8'>$ne_event</textarea>
-
-        </td>
-        </tr>
-
-        <tr>
-        <td class='forumheader3' style='width:20%'>".EC_LAN_58." </td>
-        <td class='forumheader3' style='width:80%'>
-        <input class='tbox' type='text' name='ne_thread' size='60' value='$ne_thread' maxlength='100' />
-
-        </td>
-        </tr>
-
-        <tr>
-        <td class='forumheader3' style='width:20%'>".EC_LAN_59." </td>
-        <td class='forumheader3' style='width:80%'>
-        <input class='tbox' type='text' name='ne_email' size='60' value='$ne_email' maxlength='150' />
-
-        </td></tr>
-
-        <tr>
-        <td class='forumheader' colspan='2' style='text-align:center'>";
-        if($action == "ed"){
-                $text .= "<input class='button' type='submit' name='ne_update' value='".EC_LAN_60."' />
-                         <input type='hidden' name='id' value='".$qs[1]."'>";
-        }else{
-
-
-
-
-   $text .= "<input class='button' type='submit' name='ne_insert' value='".EC_LAN_28."' />";
-
-
-        }
-
-        $text .= "</td>
-        </tr>
-        </table>
-        <input type='hidden' name='qs' value='".$_SERVER['QUERY_STRING']."'>
-        <form>";
-   //     echo $text;
-
-        $ns -> tablerender($caption, $text);
-        require_once(FOOTERF);
-        exit;
-                }else{
-                        header("location:".e_PLUGIN."calendar_menu/event.php");
-                        exit;
-                }
-}
-
-
-// ----------------------------------------------------------------------------------------------------------
-
-// show events-------------------------------------------------------------------------------------------
-// get first and last days of month in unix format---------------------------------------------------
-$monthstart= mktime(0,0,0,$month,1,$year);
-$firstdayarray = getdate($monthstart);
-$monthend = mktime(0,0,0,$month+1,0,$year);
-$lastdayarray = getdate($monthend);
-// ----------------------------------------------------------------------------------------------------------
-
-
-// echo current month with links to previous/next months ----------------------------------------
-
-$prevmonth = ($month-1);
-$prevyear = $year;
-if($prevmonth == 0){
-        $prevmonth = 12;
-        $prevyear = ($year-1);
-}
-$previous = mktime(0,0,0,$prevmonth,1, $prevyear);
-
-$nextmonth = ($month+1);
-$nextyear = $year;
-if($nextmonth == 13){
-        $nextmonth = 1;
-        $nextyear = ($year+1);
-}
-$next = mktime(0,0,0,$nextmonth,1, $nextyear);
-
-
-
-
-/*
-echo "<table style='width:100%' class='fborder'>
-<tr>
-<td class='forumheader' style='width:15%; text-align:left'><span class='defaulttext'><a href='event.php?".$previous."'><< ".$months[($prevmonth-1)]."</a></span></td>
-<td class='fcaption' style='width:70%; text-align:center' class='mediumtext'><b>".$months[($month-1)]." ".$year."</b></td>
-<td class='forumheader' style='width:15%; text-align:right'><span class='defaulttext'><a href='event.php?".$next."'> ".$months[($nextmonth-1)]." >></a></span> </td>
-</tr>
-</table>";
-*/
-// added by Cameron
-
-$todayarray = getdate();
-$current_month = $todayarray['mon'];
-$current_year = $todayarray['year'];
-$current = mktime(0,0,0,$current_month, 1, $current_year);
-
-$prop = mktime(0,0,0,$month, 1, $year);
-
-$next = mktime(0,0,0,$nextmonth,1, $nextyear);
-$py = $year-1;
-$prevlink = mktime(0,0,0,$month,1, $py);
-$ny = $year+1;
-$nextlink = mktime(0,0,0,$month,1, $ny);
-
-   $text2 = "<table style='width:100%' class='fborder'>
-<tr>
-<td class='forumheader' style='width:18%; text-align:left'><span class='defaulttext'><a href='".e_SELF."?".$previous."'><< ".$months[($prevmonth-1)]."</a></span></td>
-<td class='fcaption' style='width:64%; text-align:center' class='mediumtext'><b>".$months[($month-1)]." ".$year."</b></td>
-<td class='forumheader' style='width:185%; text-align:right'><span class='defaulttext'><a href='".e_SELF."?".$next."'> ".$months[($nextmonth-1)]." >></a></span> </td>
-</tr><tr><td colspan='3'></td></tr><tr>
-<td class='forumheader' style='text-align:left'><a href='event.php?".$prevlink."'><< ".$py."</a></td>
-<td class='fcaption' style='text-align:center'>";
-for ($ii = 0; $ii < 13; $ii++)
-        {  $m = $ii+1;
-                $monthjump= mktime(0,0,0,$m,1,$year);
-                $text2 .=  "<a class='forumlink' href=\"event.php?".$monthjump."\">".$monthabb[$ii]."</a> &nbsp"; }
-$text2 .= "<td class='forumheader' style='text-align:right'><a href='event.php?".$nextlink."'>".$ny." >></a></td></td></tr></table>";
-
-// ================
-
-
- //------------my test stuff------------------------------------------------------
-
-$text2 .= "<div style='text-align:center'>";
-
-$text2 .= "<br /><table border='0' cellpadding='2' cellspacing='3' class='forumheader3'>
-<tr><td align=right><form method=post action=".e_SELF."?".e_QUERY.">
-<select name='event_cat_ids' class='tbox' style='width:140px; '>
-<option class='tbox' value='all'>All</option>";
-
-$event_cat_id = !isset($_POST['event_cat_ids'])? NULL : $_POST['event_cat_ids'];
-        $sql -> db_Select("event_cat");
-
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                if($event_cat_id == $_POST['event_cat_ids']){
-                        $text2 .= "<option class='tbox' value='$event_cat_id' selected>".$event_cat_name."</option>";
-                }else{
-                        $text2 .= "<option value='$event_cat_id'>".$event_cat_name."</option>";
-                }
-        }
-$text2 .= "</td></select><td align='center'>
-<input class='button' type='submit' style='width:140px;' name='viewallevents' value='View Calendar'>
-</td></tr>
-<tr><td align='right'><input type='hidden' name='do' value='vc'>
-<input class='button' type='submit' style='width:140px;' name='viewcat' value='View Category'>
-</td><td align=center><input type='hidden' name='enter_new_val' value='".$prop."'> ";
-
-    if(check_class($pref['eventpost_admin']) || getperms('0')){  // start no admin preference
-    $text2 .= "<input class='button' type='submit' style='width:140px;' name='doit' value='Enter New Event'>";
-    }
-
-
-$text2 .= "</form></tr></table><br />";
-
-//--------------------------------------------------------------------------------
-
-
-
-
-
-/*
-$text2 .= "
-<form method='post' action='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."'>
-".EC_LAN_34."
-<select name='jumpmonth' class='tbox'>";
-$count = 0;
-while($months[$count]){
-        $text2 .= "<option value='".($count+1)."'>".$months[$count]."</option>";
-        $count++;
-}
-$text2 .= "</select>
-<select name='jumpyear' class='tbox'>";
-for($count=2002; $count<=2022; $count++){
-        $text2 .= "<option>".$count."</option>";
-}
-$text2 .= "</select>
-<input class='button' type='submit' name='jump' value='".EC_LAN_61."' />
-</form>";
-
-
-
-
-         ##### Check for access.
-
-  if($pref['eventpost_admin'][1] == 1 ){    // start admin preference activated.
- if(ADMIN == TRUE){ $text2 .= "<br /><div class='button' style='width:130px; height:15px'>- <a href='event.php?ne.".$prop."'>".EC_LAN_28."</a> -</div>";   }
-   }     // end admin preference activated.
-
-
-
-     if(!$pref['eventpost_admin'][1] == 1 ){  // start no admin preference
-   if(USER == TRUE){ $text2 .= "<br /><span class='button' style='width:130px; height:15px'>- <a href='event.php?ne.".$prop."'>".EC_LAN_28."</a> -</span>";}
-     }    // end no admin preference
-
-if($month != $current_month || $year != $current_year){
-        $text2 .= " <span class='button' style='width:130px; height:15px'>- <a href='event.php?$current'>".EC_LAN_40."</a> -</span>";
-}
-
-$text2 .= "</div><br />";
-*/
-// extra stuff for Category.
-
-$sql2 = new db;
-        $sql2 -> db_Select("event_cat", "*", "event_cat_id='".$event_true[($c)]."' ");
-        $event_cat = $sql2 -> db_Fetch();
-        extract($event_cat);
-
-
-
-
-// get events from current month----------------------------------------------------------------------
-if($_POST['event_cat_ids'] && $_POST['event_cat_ids'] !="all"){
-$evcat_id = $_POST['event_cat_ids'];
-$sql -> db_Select("event", "*", "(event_start>='$monthstart' AND event_start<= '$monthend' AND event_category='$evcat_id') OR (event_rec_y='$month' AND event_category='$evcat_id')  ORDER BY event_start ASC");
-}else{
-$sql -> db_Select("event", "*", "(event_start>='$monthstart' AND event_start<= '$monthend' ) OR (event_rec_y='$month' )  ORDER BY event_start ASC");
-}
-
-
-$events = $sql -> db_Rows();
-//$text2 .= "There are $events event(s) this month<br />";
-$sql2 = new db;
-$text2 .= "<table style='width:620px' class='fborder'>";
-while($row = $sql -> db_Fetch()){
-        extract($row);
-//        $text2 .= $event_id.". ".$event_details;
-        $evf = getdate($event_start);
-        $tmp = $evf['mday'];
-        $event_true[$tmp] = $event_category;
-
-        $sql2 -> db_Select("event_cat", "*", "event_cat_id='".$event_category."' ");
-        $icon = $sql2 -> db_Fetch();
-        extract($icon);
-        if($event_allday == 0){
-                if($event_start > $event_end){
-                        $event_end = $event_start;
-                }
-        }
-
-        $startds =  ereg_replace(" 0", " ", date("l d F Y - H:i:s", $event_start));
-        $endds =  ereg_replace(" 0", " ", date("l d F Y - H:i:s", $event_end));
-
-        if($event_recurring == 1){
-                $tmp = getdate($event_start);
-                $tmpyear = $tmp['year'];
-                $startds =  str_replace("$tmpyear", $year, $startds);
-                $endds =  str_replace("$tmpyear", $year, $endds);
-        }
-
-        $lp = explode(".", $event_author);
-        if(ereg("[0-9]+", $lp[0])){
-                $event_author_id = $lp[0];
-                $event_author_name = $lp[1];
-        }
-
-  ################## Changed by Cameron
-
-  if ($event_cat_icon){
-$text2 .= "<tr>
-<td colspan='2' class='fcaption'><img style='border:0' src='".$ec_dir."images/".$event_cat_icon."' alt='' /> ".$event_title."</td>";
-
- }
-
- else {
-$text2 .= "<tr>
-<td colspan='2' class='fcaption'>".$event_title."</td>";
-       }
- #############   end Change by Cameron.
-
-
-$text2 .=  "</tr>
-<tr>";
-if($event_allday){
-        $text2 .= "<td colspan='2' class='forumheader'><b>".EC_LAN_68."</b>: $startds</td>";
-}else if($startds == $endds){
-        $text2 .= "<td colspan='2' class='forumheader'><b>".EC_LAN_29."</b>: ".$startds."</td>";
-}else{
-        $text2 .= "<td style='width:50%' class='forumheader'><b>".EC_LAN_29."</b>: ".$startds."</td>
-        <td style='width:50%' class='forumheader'><b>".EC_LAN_69."</b>: ".$endds."</td>";
-}
-$text2 .= "</tr>
-<tr>
-<td colspan='2' class='forumheader3'>".
-$event_details."
-</td>
-</tr>
-
-<tr>";
-     ########## Changed by Cameron 2
-
-
-if ($event_cat_icon){
-
-$text2 .= "
-<td style='width:50%' class='forumheader3'><b>".EC_LAN_30."</b> <img style='border:0' src='".$ec_dir."images/".$event_cat_icon."' alt='' width='12' height='12' /> ".$event_cat_name."</td>";
-  }
-
-  else {
- $text2 .= "
-  <td style='width:50%' class='forumheader3'><b>".EC_LAN_30."</b> ".$event_cat_name."</td>";
-
-
-  }
-
-$text2 .= "<td style='width:50%' class='forumheader3'><b>".EC_LAN_32."</b> ";
-if($event_location == ""){
-        $text2 .= EC_LAN_38;
-
-    # End of Changed by Cameron 2.
-
-}else{
-        $text2 .= $event_location."</td>";
-}
-$text2 .= "</tr>
-<tr>
-<td style='width:33%' class='forumheader3'><b>".EC_LAN_31."</b> <a href='".e_BASE."user.php?id.".$event_author_id."'>".$event_author_name."</a></td>
-<td style='width:33%' class='forumheader3'><b>".EC_LAN_33."</b> ";
-if($event_contact == ""){
-        $text2 .= EC_LAN_38; // Not Specified ;
-}else{
-        $text2 .= "<a href='mailto:".$event_contact."'>".$event_contact."</a></td>";
-}
-
-
-
-$text2 .= "</tr>
-<tr>
-<td style='width:50%' class='forumheader'>".
-
-($event_thread ? "<span class='smalltext'><a href='$event_thread'><img src='".e_IMAGE."forum/e.png' alt='' style='border:0' width='16' height='16' align='absmiddle'> ".EC_LAN_39."</a></span>" : "&nbsp;")."
-
-</td>
-<td style='width:50%' class='forumheader' style='text-align:right'>";
-
-if(USERNAME == $event_author_name || (ADMIN == TRUE && ADMINPERMS <= 2)){
-        $text2 .= "<span class='smalltext'>
-        [ <a href='event.php?ed.".$event_id."'>".EC_LAN_35."</a> ] [ <a href='event.php?de.".$event_id."'>".EC_LAN_36."</a> ]
-        </span>";
-}
-
-$text2 .= "</td>
-        </tr>";
-
-}
-$text2 .= "</table>";
-// -----------------------------------------------------------------------------------------------------------
-
-
-$nextmonth = mktime(0,0,0,$month+1,1,$year);
-$sql -> db_Select("event", "*", "event_start>='$nextmonth' ORDER BY event_start ASC LIMIT 0,10");
-$num = $sql -> db_Rows();
-$text2 .= "<br /><table style='width:620px' class='fborder'>
-<tr>
-<td colspan='2' class='forumheader'><span class='defaulttext'>".EC_LAN_62."</span></td>";
-if($num != 0){
-        while($events = $sql -> db_Fetch()){
-                extract($events);
-                $startds =  ereg_replace(" 0", " ", date("l d F Y @ H:i:s", $event_start));
-                $text2 .= "<tr><td style='width:35%; vertical-align:top' class='forumheader3'><a href='event.php?".$event_start."'>".$startds."</a></td>
-                <td style='width:65%' class='forumheader3'>".$event_details."</td></tr>";
-
-        }
-}else{
-        $text2 .= "<tr><td colspan='2' class='forumheader3'>".EC_LAN_37."</td></tr>";
-}
-
-$text2 .= "</table>";
-  $caption = EC_LAN_80; // "Event List";
- $ns -> tablerender($caption, $text2);
-
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dun.an 2001-2002
+|     http://e107.org
+|     jali.@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/event.php,v $
+|     $Revision: 1.24 $
+|     $Date: 2006/01/12 22:18:29 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+require_once(e_PLUGIN."calendar_menu/calendar_shortcodes.php");
+if (isset($_POST['viewallevents']))
+{
+    Header("Location: ".e_PLUGIN."calendar_menu/calendar.php?".$_POST['enter_new_val']);
+} 
+
+if (isset($_POST['doit']))
+{
+    Header("Location: ".e_PLUGIN."calendar_menu/event.php?ne.".$_POST['enter_new_val']);
+} 
+if (isset($_POST['subs']))
+{
+    Header("Location: ".e_PLUGIN."calendar_menu/subscribe.php");
+} 
+
+$ec_dir		= e_PLUGIN."calendar_menu/";
+$lan_file	= $ec_dir."languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
+define("PAGE_NAME", EC_LAN_80);
+
+$cal_super	= check_class($pref['eventpost_super']);
+
+require_once(e_HANDLER."calendar/calendar_class.php");
+$cal = new DHTML_Calendar(true);
+
+// enter new category into db
+if (isset($_POST['ne_cat_create']))
+{
+    if ($_POST['ne_new_category'] != "")
+    {
+        $sql->db_Insert("event_cat", "0, '".$tp->toDB($_POST['ne_new_category'])."', '".$tp->toDB($_POST['ne_new_category_icon'])."', '0', '0', '0', '0', '', '', '0', '0', '0', '".time()."', '0'  ");
+        header("location:event.php?".$_POST['qs'].".m1");
+    } 
+    else
+    {
+        header("location:event.php?".$_POST['qs'].".m3");
+    } 
+} 
+// enter new event into db
+if (isset($_POST['ne_insert']) && USER == true)
+{
+    if ($_POST['ne_event'] == ""){
+		header("location:event.php?".$ev_start.".m3");
+	}else{
+        $tmp			= explode("-", $_POST['start_date']);
+        $ev_start		= mktime($_POST['ne_hour'], $_POST['ne_minute'], 0, $tmp[1], $tmp[2], $tmp[0]);
+        $tmp			= explode("-", $_POST['end_date']);
+        $ev_end			= mktime($_POST['end_hour'], $_POST['end_minute'], 0, $tmp[1], $tmp[2], $tmp[0]);
+        $ev_title		= $tp->toDB($_POST['ne_title']);
+        $ev_location	= $tp->toDB($_POST['ne_location']);
+        $ev_event		= $tp->toDB($_POST['ne_event']);
+
+        if ($_POST['recurring'] == 1){
+			$rec_m = substr($_POST['start_date'], 8,2);
+            $rec_y = substr($_POST['start_date'], 5,2);
+        }else{
+            $rec_m = "";
+            $rec_y = "";
+        } 
+
+        $sql->db_Insert("event", " 0, '".intval($ev_start)."', '".intval($ev_end)."', '".intval($_POST['allday'])."', '".intval($_POST['recurring'])."', '".time()."', '$ev_title', '$ev_location', '$ev_event', '".USERID.".".USERNAME."', '".$tp -> toDB($_POST['ne_email'])."', '".intval($_POST['ne_category'])."', '".$tp -> toDB($_POST['ne_thread'])."', '".intval($rec_m)."', '".intval($rec_y)."' ");
+        $qs = preg_replace("/ne./i", "", $_POST['qs']);
+        header("location:event.php?".$qs.".m4");
+    }
+} 
+
+// update event in db
+if (isset($_POST['ne_update']) && USER == true)
+{
+    if ($_POST['ne_event'] == ""){
+		header("location:event.php?".$_POST['qs'].".m3");
+	}else{
+        $tmp			= explode("-", $_REQUEST['start_date']);
+        $ev_start		= mktime($_POST['ne_hour'], $_POST['ne_minute'], 0, $tmp[1], $tmp[2], $tmp[0]);
+        $tmp			= explode("-", $_POST['end_date']);
+        $ev_end			= mktime($_POST['end_hour'], $_POST['end_minute'], 0, $tmp[1], $tmp[2], $tmp[0]);
+        $ev_title		= $tp->toDB($_POST['ne_title']);
+        $ev_location	= $tp->toDB($_POST['ne_location']);
+        $ev_event		= $tp->toDB($_POST['ne_event']);
+
+        if ($_POST['recurring'] == 1){
+			$rec_m = substr($_POST['start_date'], 8,2);
+            $rec_y = substr($_POST['start_date'], 5,2);
+        }else{
+            $rec_m = "";
+            $rec_y = "";
+        } 
+
+        $sql->db_Update("event", "event_start='".intval($ev_start)."', event_end='".intval($ev_end)."', event_allday='".intval($_POST['allday'])."', event_recurring='".intval($_POST['recurring'])."', event_datestamp= '".time()."', event_title= '$ev_title', event_location='$ev_location', event_details='$ev_event', event_contact='".$tp -> toDB($_POST['ne_email'])."', event_category='".intval($_POST['ne_category'])."', event_thread='".$tp -> toDB($_POST['ne_thread'])."', event_rec_m='".intval($rec_m)."', event_rec_y='".intval($rec_y)."' WHERE event_id='".intval($_POST['id'])."' ");
+        $qs = preg_replace("/ed./i", "", $_POST['qs']);
+
+        header("location:event.php?".$ev_start.".".$qs.".m5");
+    }
+} 
+
+
+require_once(HEADERF);
+
+if (isset($_POST['jump']))
+{
+		$smarray	= getdate(mktime(0, 0, 0, $_POST['jumpmonth'], 1, $_POST['jumpyear']));
+		$month		= $smarray['mon'];
+		$year		= $smarray['year'];
+} 
+else
+{
+    if(e_QUERY){
+		$qs			= explode(".", e_QUERY);
+		$action		= $qs[0];
+		$ds			= (isset($qs[1]) ? $qs[1] : "");
+		$eveid		= (isset($qs[2]) ? $qs[2] : "");
+	}
+    if ($action == "")
+    {
+        $nowarray	= getdate();
+        $month		= $nowarray['mon'];
+        $year		= $nowarray['year'];
+    } 
+    else
+    {
+        $smarray	= getdate($action);
+        $month		= $smarray['mon'];
+        $year		= $smarray['year'];
+    } 
+} 
+
+if (isset($_POST['confirm']))
+{
+    if ($sql->db_Delete("event", "event_id='".intval($_POST['existing'])."' "))
+    {
+        $message = EC_LAN_51; //Event Deleted
+    } 
+    else
+    {
+        $message = EC_LAN_109; //Unable to Delete event for some my.erious reason
+    } 
+} 
+
+if ($action == "de")
+{
+    $text = "<div style='text-align:center'>
+	<b>".EC_LAN_48."</b>
+	<br /><br />
+	<form method='post' action='".e_SELF."' id='calformz' >
+	<input class='button' type='submit' name='cancel' value='".EC_LAN_49."' />
+	<input class='button' type='submit' name='confirm' value='".EC_LAN_50."' />
+	<input type='hidden' name='existing' value='".$qs[1]."' />
+	<input type='hidden' name='subbed' value='no' />
+	</form>
+	</div>";
+    $ns->tablerender(EC_LAN_46, $text); // Confirm Delete Event
+    require_once(FOOTERF);
+    exit;
+} 
+if (isset($_POST['cancel']))
+{
+    $message = EC_LAN_47; 
+    // Delete Cancelled
+}
+
+// set up data arrays ----------------------------------------------------------------------------------
+if ($pref['eventpost_weekstart'] == 'sun')
+{
+    $days	= Array(EC_LAN_25, EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24);
+} 
+else
+{
+    $days	= Array(EC_LAN_19, EC_LAN_20, EC_LAN_21, EC_LAN_22, EC_LAN_23, EC_LAN_24, EC_LAN_25);
+} 
+$dayslo		= array('1.', '2.', '3.', '4.', '5.', '6.', '7.', '8.', '9.', '10.', '11.', '12.', '13.', '14.', '15.', '16.', '17.', '18.', '19.', '20.', '21.', '22.', '23.', '24.', '25.', '26.', '27.', '28.', '29.', '30.', '31.');
+$monthabb	= Array(EC_LAN_JAN, EC_LAN_FEB, EC_LAN_MAR, EC_LAN_APR, EC_LAN_MAY, EC_LAN_JUN, EC_LAN_JUL, EC_LAN_AUG, EC_LAN_SEP, EC_LAN_OCT, EC_LAN_NOV, EC_LAN_DEC);
+$months		= array(EC_LAN_0, EC_LAN_1, EC_LAN_2, EC_LAN_3, EC_LAN_4, EC_LAN_5, EC_LAN_6, EC_LAN_7, EC_LAN_8, EC_LAN_9, EC_LAN_10, EC_LAN_11);
+// ----------------------------------------------------------------------------------------------------------
+
+if (isset($qs[2]) && $qs[2] == "m1")
+{
+    $message = EC_LAN_41; //"New category created.";
+} 
+else if (isset($qs[2]) && $qs[2] == "m2")
+{
+    $message = EC_LAN_42; //"Event cannot end before it starts.";
+} 
+else if (isset($qs[2]) && $qs[2] == "m3")
+{
+    $message = EC_LAN_43; //"You left required field(s) blank.";
+} 
+else if (isset($qs[2]) && $qs[2] == "m4")
+{
+    $message = EC_LAN_44; //"New event created and entered into database.";
+} elseif (isset($qs[2]) && $qs[2] == "m5")
+{
+    $message = EC_LAN_45; //"Event updated in database.";
+} 
+
+if (isset($message))
+{
+    $ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+// enter new event form
+if ($action == "ne" || $action == "ed")
+{
+    if ($cal_super || check_class($pref['eventpost_admin']))
+    {
+        if ($action == "ed")
+        {
+            $sql->db_Select("event", "*", "event_id='".intval($qs[1])."' ");
+            list($null, $ne_start, $ne_end, $allday, $recurring, $ne_datestamp, $ne_title, $ne_location, $ne_event, $ne_author, $ne_email, $ne_category, $ne_thread) = $sql->db_Fetch();
+
+            $smarray = getdate($ne_start);
+            $ne_hour = $smarray['hours'];
+            $ne_minute = $smarray['minutes'];
+            $ne_startdate = date("Y-m-d", $ne_start);
+
+            $smarray = getdate($ne_end);
+            $end_hour = $smarray['hours'];
+            $end_minute = $smarray['minutes'];
+            $ne_enddate = date("Y-m-d", $ne_end);
+        } 
+        else
+        {
+            $smarray = getdate($qs[1]);
+            $month = $smarray['mon'];
+            $year = $smarray['year'];
+            $ne_startdate = date("Y-m-d", $qs[1]);
+
+            $ne_hour = $smarray['hours'];
+            $ne_minute = $smarray['minutes'];
+
+            $end_hour = $smarray['hours'];
+            $end_minute = $smarray['minutes'];
+            $ne_enddate = date("Y-m-d", $qs[1]);
+        } 
+
+        
+		$text = "
+		<script type=\"text/javascript\">
+		<!--
+		function calcheckform(thisform, submitted)
+		{
+			var testresults=true;
+
+			//category create check
+			if(submitted == 'ne_cat_create'){
+				if(thisform.ne_new_category.value == ''){
+					alert('".EC_LAN_134."');
+					return FALSE;
+				}else{
+					return TRUE;
+				}
+			}
+
+			//event check
+			var temp;
+			temp = thisform.start_date.value.split(\"-\");
+			var sdate = temp[0] + temp[1] + temp[2] + thisform.ne_hour.options[thisform.ne_hour.selectedIndex].value + thisform.ne_minute.options[thisform.ne_minute.selectedIndex].value
+			temp = thisform.end_date.value.split(\"-\");
+			var edate = temp[0] + temp[1] + temp[2] + thisform.end_hour.options[thisform.end_hour.selectedIndex].value + thisform.end_minute.options[thisform.end_minute.selectedIndex].value
+
+			testresults=true;
+
+			if (edate <= sdate && !thisform.allday.checked && testresults )
+			{
+				alert('".EC_LAN_99."');
+				testresults=false;
+			}
+			if ((thisform.ne_title.value=='' || thisform.ne_event.value=='') && testresults)
+			{
+				alert('".EC_LAN_98."');
+				testresults=false;
+			}
+
+			if (testresults)
+			{
+				if (thisform.subbed.value=='no')
+				{
+					thisformm.subbed.value='yes';
+					testresults=true;
+				}
+			else
+				{
+					alert('".EC_LAN_113."');
+					return false;
+				}
+			}
+			return testresults;
+		}
+		-->
+		</script>";
+		
+		$text .= "
+		<form method='post' action='".e_SELF."' id='linkform' onsubmit='return calcheckform(this, submitted)'>
+		<table style='width:98%' class='fborder' >";
+
+        if ($action == "ed")
+        {
+            $caption = EC_LAN_66; // edit Event 
+            
+        } elseif ($action == "ne")
+        {
+            $caption = EC_LAN_28; // Enter New Event
+        } 
+        else
+        {
+            $caption = EC_LAN_83;
+        } 
+
+        $text .= "
+		<tr>
+		<td class='forumheader3' style='width:20%'>".EC_LAN_72." </td>
+		<td class='forumheader3' style='width:80%'> ".EC_LAN_67." ";
+
+        unset($cal_options);
+        unset($cal_attrib);
+        $cal_options['firstDay'] = 0;
+        $cal_options['showsTime'] = false;
+        $cal_options['showOthers'] = true;
+        $cal_options['weekNumbers'] = false;
+        $cal_options['ifFormat'] = "%Y-%m-%d";
+        $cal_attrib['class'] = "tbox";
+        $cal_attrib['size'] = "12";
+        $cal_attrib['name'] = "start_date";
+        $cal_attrib['value'] = $ne_startdate;
+        $text .= $cal->make_input_field($cal_options, $cal_attrib);
+
+        $text .= "&nbsp;&nbsp;&nbsp;".EC_LAN_73." ";
+        unset($cal_options);
+        unset($cal_attrib);
+        $cal_options['firstDay'] = 0;
+        $cal_options['showsTime'] = false;
+        $cal_options['showOthers'] = true;
+        $cal_options['weekNumbers'] = false;
+        $cal_options['ifFormat'] = "%Y-%m-%d";
+        $cal_attrib['class'] = "tbox";
+        $cal_attrib['size'] = "12";
+        $cal_attrib['name'] = "end_date";
+        $cal_attrib['value'] = $ne_enddate;
+        $text .= $cal->make_input_field($cal_options, $cal_attrib);
+        $text .= "		
+		</td>
+		</tr>
+		<tr>
+		<td class='forumheader3' style='width:20%'>".EC_LAN_71." </td>
+		<td class='forumheader3' style='width:80%'>
+		".EC_LAN_67." <select name='ne_hour' id='ne_hour' class='tbox'>";
+        for($count = "00"; $count <= "23"; $count++)
+        {
+            $val = sprintf("%02d", $count);
+            $text .= "<option value='{$val}' ".(isset($ne_hour) && $count == $ne_hour ? "selected='selected'" :"")." >".$val."</option>";
+        } 
+        $text .= "</select>
+		<select name='ne_minute' class='tbox'>";
+        for($count = "00"; $count <= "59"; $count++)
+        {
+            $val = sprintf("%02d", $count);
+            $text .= "<option ".(isset($ne_minute) && $count == $ne_minute ? "selected='selected'" :"")." value='{$val}'>".$val."</option>";
+        } 
+        $text .= "</select>
+
+		&nbsp;&nbsp;".EC_LAN_73." <select name='end_hour' class='tbox'>";
+        for($count = "00"; $count <= "23"; $count++)
+        {
+            $val = sprintf("%02d", $count);
+            $text .= "<option ".(isset($end_hour) && $count == $end_hour ? "selected='selected'" :"")." value='{$val}'>".$val."</option>";
+        } 
+        $text .= "</select>
+		<select name='end_minute' class='tbox'>";
+        for($count = "00"; $count <= "59"; $count++)
+        {
+            $val = sprintf("%02d", $count);
+            $text .= "<option ".(isset($end_minute) && $count == $end_minute ? "selected='selected'" :"")." value='{$val}'>".$val."</option>";
+        } 
+        $text .= "</select>";
+		$text .= "<br /><input type='checkbox' name='allday' value='1' ".(isset($allday) && $allday == 1 ? "checked='checked'" :"")." />";
+        $text .= EC_LAN_64."
+		</td>
+		</tr>
+		<tr>
+		<td class='forumheader3' style='width:20%'>".EC_LAN_65."</td>
+		<td class='forumheader3' style='width:80%'>";
+		$text .= "<input type='checkbox' name='recurring' value='1'  ".(isset($recurring) && $recurring == 1 ? "checked='checked'" : "")." />";
+        $text .= EC_LAN_63."
+		</td>
+		</tr>
+		<tr>
+		<td class='forumheader3' style='width:20%'>".EC_LAN_70." *</td>
+		<td class='forumheader3' style='width:80%'>
+		<input class='tbox' type='text' name='ne_title' size='75' value='".(isset($ne_title) ? $ne_title : "")."' maxlength='200' style='width:95%' />
+		</td>
+		</tr>
+		<tr>
+		<td class='forumheader3' style='width:20%'>".EC_LAN_52." </td>
+		<td class='forumheader3' style='width:80%'>
+		<select name='ne_category' class='tbox'>"; 
+        // Check if supervisor, if so get all categories, otherwise ju. get those the user is allowed to see
+		$cal_arg = ($cal_super ? "" : "find_in_set(event_cat_addclass,'".USERCLASS_LIST."')");
+        if ($sql->db_Select("event_cat", "*", $cal_arg)){
+            while ($row = $sql->db_Fetch()){
+				$text .= "<option value='{$row['event_cat_id']}' ".(isset($ne_category) && $ne_category == $row['event_cat_id'] ? "selected='selected'" :"")." >".$row['event_cat_name']."</option>";
+            } 
+        }else{
+            $text .= "<option value=''>".EC_LAN_91."</option>";
+        } 
+        $text .= "</select>
+		</td>
+		</tr>"; 
+        // * *BK* Check if the add class is appropriate for adding new categories
+        // * *BK* It will default to everybody class when created.  Need to go in to admin categories if
+        // * *BK* you want to change read class.
+        if (check_class($pref['eventpost_addcat']) && $action != "ed")
+        {
+            require_once(e_HANDLER."file_class.php");
+            $fi = new e_file;
+            $imagelist = $fi->get_files(e_PLUGIN."calendar_menu/images", "\.\w{3}$");
+            $text .= "<tr>
+			<td class='forumheader3' style='width:20%' rowspan='2'>".EC_LAN_53." </td>
+			<td class='forumheader3' style='width:80%'>".EC_LAN_54."
+			<input class='tbox' type='text' name='ne_new_category' size='30' value='".(isset($ne_new_category) ? $ne_new_category : "")."' maxlength='100' style='width:95%' /> ";
+            $text .= "</td></tr>
+			<tr><td class='forumheader3' style='width:80%'>".EC_LAN_55;
+            $text .= " <input class='tbox' style='width:150px' type='text' id='ne_new_category_icon' name='ne_new_category_icon' />";
+            $text .= " <input class='button' type='button' style='width: 45px; cursor:hand;' value='".EC_LAN_90."' onclick='expandit(\"cat_icons\")' />";
+            $text .= "<div style='display:none' id='cat_icons'>";
+
+            foreach($imagelist as $img){
+                if ($img['fname']){
+                    $text .= "<a href=\"javascript:insertext('".$img['fname']."','ne_new_category_icon','cat_icons')\"><img src='".e_PLUGIN."calendar_menu/images/".$img['fname']."' style='border:0px' alt='' /></a> ";
+                } 
+            } 
+            $text .= "</div>";
+            $text .= "<div style='text-align:center'>
+			<input class='button' type='submit' name='ne_cat_create' value='".EC_LAN_56."' onclick='submitted=this.name' /></div>
+			</td>
+			</tr>";
+        } 
+
+        $text .= "
+		<tr>
+		<td class='forumheader3' style='width:20%'>".EC_LAN_32." </td>
+		<td class='forumheader3' style='width:80%'>
+		<input class='tbox' type='text' name='ne_location' size='60' value='".(isset($ne_location) ? $ne_location : "")."' maxlength='200' style='width:95%' />
+		</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3' style='width:20%'>".EC_LAN_57." *</td>
+		<td class='forumheader3' style='width:80%'>
+		<textarea class='tbox' name='ne_event' cols='59' rows='8' style='width:95%'>".(isset($ne_event) ? $ne_event : "")."</textarea>
+		</td>
+		</tr>"; 
+        // * *BK*
+        // * *BK* Only display for forum thread if it is required.  No point in being in if not wanted
+        // * *BK* or if forums are inactive
+        // * *BK*
+        if (isset($pref['eventpost_forum']) && $pref['eventpost_forum'] == 1)
+        {
+            $text .= "
+			<tr>
+			<td class='forumheader3' style='width:20%'>".EC_LAN_58." </td>
+			<td class='forumheader3' style='width:80%'>
+			<input class='tbox' type='text' name='ne_thread' size='60' value='".(isset($ne_thread) ? $ne_thread : "")."' maxlength='100' style='width:95%' />
+			</td>
+			</tr>";
+        } 
+        // * *BK*
+        // * *BK* If the user is logged in and has their email set plus the field is empty then put in
+        // * *BK* their email address.  They can always take it out if they want, its not a required field
+        if (empty($ne_email) && defined('USEREMAIL'))
+        {
+            $ne_email = USEREMAIL;
+        } 
+        $text .= "
+		<tr>
+		<td class='forumheader3' style='width:20%'>".EC_LAN_59." </td>
+		<td class='forumheader3' style='width:80%'>
+		<input class='tbox' type='text' name='ne_email' size='60' value='$ne_email' maxlength='150' style='width:95%' />
+		</td></tr>
+		<tr>
+		<td class='forumheader3' colspan='2' >".EC_LAN_105." </td>
+		</tr>
+
+		<tr>
+		<td class='forumheader' colspan='2' style='text-align:center'>";
+        if ($action == "ed"){
+            $text .= "<input class='button' type='submit' name='ne_update' value='".EC_LAN_60."' onclick='submitted=this.name' />
+			<input type='hidden' name='id' value='".$qs[1]."' />";
+        }else{
+            $text .= "<input class='button' type='submit' name='ne_insert' value='".EC_LAN_28."' onclick='submitted=this.name' />";
+        } 
+        $text .= "<input type='hidden' name='qs' value='".e_QUERY."' /></td>
+		</tr>
+		</table>
+		</form>";
+
+        $ns->tablerender($caption, $text);
+        require_once(FOOTERF);
+        exit;
+    } 
+    else
+    {
+        header("location:".e_PLUGIN."calendar_menu/event.php");
+        exit;
+    } 
+} 
+
+// show events
+$monthstart		= mktime(0, 0, 0, $month, 1, $year);
+$firstdayarray	= getdate($monthstart);
+$monthend		= mktime(0, 0, 0, $month + 1, 1, $year) -1 ;
+$lastdayarray	= getdate($monthend);
+
+$prevmonth		= ($month-1);
+$prevyear		= $year;
+if ($prevmonth == 0)
+{
+    $prevmonth	= 12;
+    $prevyear	= ($year-1);
+} 
+$previous		= mktime(0, 0, 0, $prevmonth, 1, $prevyear);
+
+$nextmonth		= ($month + 1);
+$nextyear		= $year;
+if ($nextmonth == 13)
+{
+    $nextmonth	= 1;
+    $nextyear	= ($year + 1);
+} 
+$next			= mktime(0, 0, 0, $nextmonth, 1, $nextyear);
+
+//$todayarray		= getdate();
+//$current_month	= $todayarray['mon'];
+//$current_year	= $todayarray['year'];
+//$current		= mktime(0, 0, 0, $current_month, 1, $current_year);
+
+$nowarray		= getdate();
+$nowmonth		= $nowarray['mon'];
+$nowyear		= $nowarray['year'];
+$nowday			= $nowarray['mday'];
+$current		= mktime(0, 0, 0, $nowmonth, 1, $nowyear); 
+
+$prop			= mktime(0, 0, 0, $month, 1, $year);
+$next			= mktime(0, 0, 0, $nextmonth, 1, $nextyear);
+$py				= $year-1;
+$prevlink		= mktime(0, 0, 0, $month, 1, $py);
+$ny				= $year + 1;
+$nextlink		= mktime(0, 0, 0, $month, 1, $ny);
+
+if (is_readable(THEME."calendar_template.php")) {
+	require_once(THEME."calendar_template.php");
+	} else {
+	require_once(e_PLUGIN."calendar_menu/calendar_template.php");
+}
+
+$text2 = "";
+// time switch buttons
+$text2 .= $tp -> parseTemplate($CALENDAR_TIME_TABLE, FALSE, $calendar_shortcodes);
+
+// navigation buttons
+$text2 .= $tp -> parseTemplate($CALENDAR_NAVIGATION_TABLE, FALSE, $calendar_shortcodes);
+
+//$sql2 = new db;
+if ($ds == "event"){ 
+	$qry = "
+	SELECT e.*, ec.*
+	FROM #event as e
+	LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
+	WHERE e.event_id='".intval($eveid)."' 
+	";
+	$sql2->db_Select_gen($qry);
+    $row = $sql2->db_Fetch();
+    $event[] = $row;
+    $next10_start = $event[0]['event_start'];
+	$text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE_START, FALSE, $calendar_shortcodes);
+	$text2 .= show_event($event);
+	$text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE_END, FALSE, $calendar_shortcodes);
+
+}else{
+    //$sql2->db_Select("event_cat", "*", "event_cat_id='".intval($event_true[($c)])."' ");
+    //$event_cat = $sql2->db_Fetch();
+    //extract($event_cat);
+
+    if ($ds == 'one'){
+        $tmp			= getdate($action);
+        $selected_day	= $tmp['mday'];
+        $selected_mon	= $tmp['mon'];
+        $start_time		= $action;
+        $end_time		= $action + 86399;
+        $cap_title		= " - ".$months[$selected_mon-1]." ".$selected_day;
+    }else{
+        $start_time		= $monthstart;
+        $end_time		= $monthend;
+        $cap_title		= '';
+    } 
+    $extra = " OR e.event_rec_y = ".intval($month)." ";
+
+    if ($cal_super) {
+        $qry = "
+		SELECT e.*, ec.*
+		FROM #event as e
+		LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
+		WHERE (e.event_start >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).")
+		OR (e.event_end >= ".intval($start_time)." AND e.event_end <= ".intval($end_time).")
+		OR (e.event_start <= ".intval($start_time)." AND e.event_end >= ".intval($end_time).")
+		{$extra}
+		ORDER BY e.event_start ASC";
+    } else {
+        $qry = "
+		SELECT e.*, ec.*
+		FROM #event as e
+		LEFT JOIN #event_cat as ec ON e.event_category = ec.event_cat_id
+		WHERE find_in_set(event_cat_class,'".USERCLASS_LIST."') AND
+		((e.event_start >= ".intval($start_time)." AND e.event_start <= ".intval($end_time).")
+		OR (e.event_end >= ".intval($start_time)." AND e.event_end <= ".intval($end_time).")
+		OR (e.event_start <= ".intval($start_time)." AND e.event_end >= ".intval($end_time).")
+		{$extra})
+		ORDER BY e.event_start ASC
+		";
+    }
+
+    if ($sql->db_Select_gen($qry)){
+        while ($row = $sql->db_Fetch()){
+            if ($row['event_rec_y'] == $month){
+                if (!in_array($row['event_id'], $idArray)){
+                    $events[$row['event_rec_m']][] = $row;
+                    $idArray[] = $row['event_id'];
+                } 
+            }else{
+                if ($ds == 'one'){
+                    if (!isset($idArray) || !is_array($idArray) || !in_array($row['event_id'], $idArray)){
+                        $events[$selected_day][] = $row;
+                        $idArray[] = $row['event_id'];
+                    } 
+                }else{
+                    $tmp		= getdate($row['event_start']);
+					$start_day	= ($tmp['year'] == $year ? $tmp['mday'] : "1");
+                    $tmp		= getdate($row['event_end']);
+					$end_day	= ($tmp['year'] == $year ? $tmp['mday'] : "31");
+                    for ($i = $start_day; $i <= $end_day; $i++){
+                        if (!isset($idArray) || !is_array($idArray) || !in_array($row['event_id'], $idArray)){
+                            $events[$i][] = $row;
+                            $idArray[] = $row['event_id'];
+                        } 
+                    } 
+                } 
+            } 
+        } 
+    } 
+} 
+
+
+// event list
+if(isset($events) && is_array($events)){
+
+
+//echo "<pre>"; print_r($events); echo "</pre>";
+
+	$text2 .= $tp -> parseTemplate($EVENT_EVENTLIST_TABLE_START, FALSE, $calendar_shortcodes);
+	foreach ($events as $dom => $event){
+		$text2 .= show_event($event);
+	} 
+	$text2 .= $tp -> parseTemplate($EVENT_EVENTLIST_TABLE_END, FALSE, $calendar_shortcodes);
+}
+
+// event archive
+$nextmonth = mktime(0, 0, 0, $month + 1, 1, $year)-1;
+if (!isset($next10_start)){
+    $next10_start = $nextmonth;
+} 
+
+$qry = "
+SELECT e.* FROM #event AS e
+LEFT JOIN #event_cat AS ec ON e.event_category = ec.event_cat_id
+WHERE e.event_start > '".intval($next10_start)."' AND ec.event_cat_class IN (".USERCLASS_LIST.")
+ORDER BY e.event_start ASC 
+LIMIT 0, 10
+";
+$num = $sql->db_Select_gen($qry);
+if ($num != 0){
+	$gen = new convert;
+	$archive_events = "";
+	while ($events = $sql->db_Fetch()){
+		$archive_events .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE, FALSE, $calendar_shortcodes);
+	} 
+}else{
+	$archive_events = $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_EMPTY, FALSE, $calendar_shortcodes);
+} 
+$text2 .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_START, FALSE, $calendar_shortcodes);
+$text2 .= $archive_events;
+$text2 .= $tp -> parseTemplate($EVENT_ARCHIVE_TABLE_END, FALSE, $calendar_shortcodes);
+
+
+$caption = EC_LAN_80; // "Event List";
+$ns->tablerender($caption.(isset($cap_title) ? $cap_title : ""), $text2);
+require_once(FOOTERF);
+
+
+function show_event($day_events)
+{
+	global $tp, $cal_super, $_POST, $ds, $thisevent, $EVENT_ID, $EVENT_EVENT_TABLE, $calendar_shortcodes, $event_author_id, $event_author_name;
+    $text2 = "";
+	foreach($day_events as $event)
+    {
+		$thisevent = $event;
+        $gen = new convert;
+        if ( ( !isset($_POST['do']) || (isset($_POST['do']) && $_POST['do'] == null)) || (isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] == "all") || (isset($_POST['event_cat_ids']) && $_POST['event_cat_ids'] == $thisevent['event_cat_id']) ){
+			
+		//if (($_POST['do'] == null || $_POST['event_cat_ids'] == "all") || ($_POST['event_cat_ids'] == $thisevent['event_cat_id'])){
+            $lp = explode(".", $thisevent['event_author']);
+            if (preg_match("/[0-9]+/", $lp[0]))
+            {
+                $event_author_id = $lp[0];
+                $event_author_name = $lp[1];
+            }
+			$text2 .= $tp -> parseTemplate($EVENT_EVENT_TABLE, FALSE, $calendar_shortcodes);
+        } 
+    }
+    return $text2;
+} 
+
+function cal_landate($dstamp, $recurring = false, $allday = false)
+{
+    $long_month_start = 0;
+    $long_day_start = 12;
+    $now = getdate($dstamp);
+
+    if ($now['wday'] == 0){
+        $now['wday'] = 7;
+    } 
+    $dow = constant("EC_LAN_".($long_day_start + $now['wday']-1));
+    $moy = constant("EC_LAN_".($long_month_start + $now['mon']-1));
+
+    if ($recurring == TRUE){
+        $today = getdate();
+        $now['year'] = $today['year'];
+    } 
+
+    if ($allday == TRUE){
+        return sprintf("%s %02d %s %d", $dow, $now['mday'], $moy, $now['year']);
+    }else{
+		if($now['hours'] == 0 && $now['minutes'] == 0){
+			return sprintf("%s %02d %s %d", $dow, $now['mday'], $moy, $now['year'], 0, 0);
+		}else{
+	        return sprintf("%s %02d %s %d - %02d:%02d", $dow, $now['mday'], $moy, $now['year'], $now['hours'], $now['minutes']);
+		}
+    } 
+} 
+
+function headerjs()
+{
+    global $cal;
+    $script = $cal->load_files();
+/*
+	$script .= "
+	<script type=\"text/javascript\">
+	<!--
+	function calcheckform(thisform)
+	{
+		var testresults=true;
+		var temp;
+		temp = thisform.start_date.value.split(\"-\");
+		var sdate = temp[0] + temp[1] + temp[2] + thisform.ne_hour.options[thisform.ne_hour.selectedIndex].value + thisform.ne_minute.options[thisform.ne_minute.selectedIndex].value
+		temp = thisform.end_date.value.split(\"-\");
+		var edate = temp[0] + temp[1] + temp[2] + thisform.end_hour.options[thisform.end_hour.selectedIndex].value + thisform.end_minute.options[thisform.end_minute.selectedIndex].value
+
+		testresults=true;
+
+		if (edate <= sdate && !thisform.allday.checked && testresults )
+		{
+			alert('".EC_LAN_99."');
+			testresults=false;
+		}
+		if ((thisform.ne_title.value=='' || thisform.ne_event.value=='') && testresults)
+		{
+			alert('".EC_LAN_98."');
+			testresults=false;
+		}
+
+		if (testresults)
+		{
+			if (thisform.subbed.value=='no')
+			{
+				thisformm.subbed.value='yes';
+				testresults=true;
+			}
+		else
+			{
+				alert('".EC_LAN_113."');
+				return false;
+			}
+		}
+		return testresults;
+	}
+	-->
+	</script>";
+*/
+	return $script;
+} 
+
 ?>
\ No newline at end of file
Files 6171/e107_plugins/calendar_menu/images/b10.png and 75/e107_plugins/calendar_menu/images/b10.png differ
Files 6171/e107_plugins/calendar_menu/images/b11.png and 75/e107_plugins/calendar_menu/images/b11.png differ
Files 6171/e107_plugins/calendar_menu/images/b12.png and 75/e107_plugins/calendar_menu/images/b12.png differ
Files 6171/e107_plugins/calendar_menu/images/b13.png and 75/e107_plugins/calendar_menu/images/b13.png differ
Files 6171/e107_plugins/calendar_menu/images/b14.png and 75/e107_plugins/calendar_menu/images/b14.png differ
Files 6171/e107_plugins/calendar_menu/images/b15.png and 75/e107_plugins/calendar_menu/images/b15.png differ
Files 6171/e107_plugins/calendar_menu/images/b16.png and 75/e107_plugins/calendar_menu/images/b16.png differ
Files 6171/e107_plugins/calendar_menu/images/b1.png and 75/e107_plugins/calendar_menu/images/b1.png differ
Files 6171/e107_plugins/calendar_menu/images/b2.png and 75/e107_plugins/calendar_menu/images/b2.png differ
Files 6171/e107_plugins/calendar_menu/images/b3.png and 75/e107_plugins/calendar_menu/images/b3.png differ
Files 6171/e107_plugins/calendar_menu/images/b4.png and 75/e107_plugins/calendar_menu/images/b4.png differ
Files 6171/e107_plugins/calendar_menu/images/b5.png and 75/e107_plugins/calendar_menu/images/b5.png differ
Files 6171/e107_plugins/calendar_menu/images/b6.png and 75/e107_plugins/calendar_menu/images/b6.png differ
Files 6171/e107_plugins/calendar_menu/images/b7.png and 75/e107_plugins/calendar_menu/images/b7.png differ
Files 6171/e107_plugins/calendar_menu/images/b8.png and 75/e107_plugins/calendar_menu/images/b8.png differ
Files 6171/e107_plugins/calendar_menu/images/b9.png and 75/e107_plugins/calendar_menu/images/b9.png differ
Files 6171/e107_plugins/calendar_menu/images/cal1.png and 75/e107_plugins/calendar_menu/images/cal1.png differ
Files 6171/e107_plugins/calendar_menu/images/cal2.png and 75/e107_plugins/calendar_menu/images/cal2.png differ
Files 6171/e107_plugins/calendar_menu/images/cal3.png and 75/e107_plugins/calendar_menu/images/cal3.png differ
Files 6171/e107_plugins/calendar_menu/images/calendar_16.png and 75/e107_plugins/calendar_menu/images/calendar_16.png differ
Files 6171/e107_plugins/calendar_menu/images/calendar_32.png and 75/e107_plugins/calendar_menu/images/calendar_32.png differ
Files 6171/e107_plugins/calendar_menu/images/icon_ec.png and 75/e107_plugins/calendar_menu/images/icon_ec.png differ
Files 6171/e107_plugins/calendar_menu/images/star1.png and 75/e107_plugins/calendar_menu/images/star1.png differ
Files 6171/e107_plugins/calendar_menu/images/star2.png and 75/e107_plugins/calendar_menu/images/star2.png differ
Files 6171/e107_plugins/calendar_menu/images/star3.png and 75/e107_plugins/calendar_menu/images/star3.png differ
Files 6171/e107_plugins/calendar_menu/images/star4.png and 75/e107_plugins/calendar_menu/images/star4.png differ
Files 6171/e107_plugins/calendar_menu/images/star5.png and 75/e107_plugins/calendar_menu/images/star5.png differ
Files 6171/e107_plugins/calendar_menu/images/star6.png and 75/e107_plugins/calendar_menu/images/star6.png differ
Files 6171/e107_plugins/calendar_menu/images/star7.png and 75/e107_plugins/calendar_menu/images/star7.png differ
Files 6171/e107_plugins/calendar_menu/images/star8.png and 75/e107_plugins/calendar_menu/images/star8.png differ
diff -ruN 6171/e107_plugins/calendar_menu/languages/English.php 75/e107_plugins/calendar_menu/languages/English.php
--- 6171/e107_plugins/calendar_menu/languages/English.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/calendar_menu/languages/English.php	2005-07-06 05:04:18.000000000 -0500
@@ -1,138 +1,291 @@
-<?php
-// e107 Language File.
-// $Id: English.php,v 1.2 2004/09/03 18:32:11 e107coders Exp $
-
-
-define(EC_ADLAN_1,"Event Calendar");
-define(EC_ADLAN_2,"Configure Event Calendar");
-define(EC_INSTALL,"Install Event Calendar");
-define(EC_UNINSTALL,"Uninstall Event Calendar");
-define(EC_LAN_0, "January");
-define(EC_LAN_1, "February");
-define(EC_LAN_2, "March");
-define(EC_LAN_3, "April");
-define(EC_LAN_4, "May");
-define(EC_LAN_5, "June");
-define(EC_LAN_6, "July");
-define(EC_LAN_7, "August");
-define(EC_LAN_8, "September");
-define(EC_LAN_9, "October");
-define(EC_LAN_10, "November");
-define(EC_LAN_11, "December");
-define(EC_LAN_JAN, "Jan");
-define(EC_LAN_FEB, "Feb");
-define(EC_LAN_MAR, "Mar");
-define(EC_LAN_APR, "Apr");
-define(EC_LAN_MAY, "May");
-define(EC_LAN_JUN, "Jun");
-define(EC_LAN_JUL, "Jul");
-define(EC_LAN_AUG, "Aug");
-define(EC_LAN_SEP, "Sep");
-define(EC_LAN_OCT, "Oct");
-define(EC_LAN_NOV, "Nov");
-define(EC_LAN_DEC, "Dec");
-define(EC_LAN_12, "Monday");
-define(EC_LAN_13, "Tuesday");
-define(EC_LAN_14, "Wednesday");
-define(EC_LAN_15, "Thursday");
-define(EC_LAN_16, "Friday");
-define(EC_LAN_17, "Saturday");
-define(EC_LAN_18, "Sunday");
-define(EC_LAN_19, "Mo");
-define(EC_LAN_20, "Tu");
-define(EC_LAN_21, "We");
-define(EC_LAN_22, "Th");
-define(EC_LAN_23, "Fr");
-define(EC_LAN_24, "Sa");
-define(EC_LAN_25, "Su");
-define(EC_LAN_26, "Events this Month");
-define(EC_LAN_27, "No events for this month.");
-define(EC_LAN_28, "Enter new event");
-define(EC_LAN_29, "When:");
-define(EC_LAN_30, "Category:");
-define(EC_LAN_31, "Posted by:");
-define(EC_LAN_32, "Location:");
-define(EC_LAN_33, "Contact:");
-define(EC_LAN_34, "Jump to");
-define(EC_LAN_35, "Edit");
-define(EC_LAN_36, "Delete");
-define(EC_LAN_37, "None Listed.");
-define(EC_LAN_38, "Not specified");
-define(EC_LAN_39, "Click here to discuss on forum");
-define(EC_LAN_40, "Current Month");
-define(EC_LAN_41, "New category created.");
-define(EC_LAN_42, "Event cannot end before it starts.");
-define(EC_LAN_43, "You left required field(s) blank.");
-define(EC_LAN_44, "New event created and entered into database.");
-define(EC_LAN_45, "Event updated in database.");
-define(EC_LAN_46, "Confirm Delete Event");
-define(EC_LAN_47, "Delete cancelled.");
-define(EC_LAN_48, "Please confirm you wish to delete this event - once deleted it cannot be retrieved");
-define(EC_LAN_49, "Cancel");
-define(EC_LAN_50, "Confirm Delete");
-define(EC_LAN_51, "Event deleted.");
-define(EC_LAN_52, "Event Category:");
-define(EC_LAN_53, "Create new category?:");
-define(EC_LAN_54, "Name:");
-define(EC_LAN_55, "Icon:");
-define(EC_LAN_56, "Create");
-define(EC_LAN_57, "Event:");
-define(EC_LAN_58, "URL to forum thread:");
-define(EC_LAN_59, "Contact email:");
-define(EC_LAN_60, "Update Event");
-define(EC_LAN_61, "Go");
-define(EC_LAN_62, "Next 10 Events ...");
-define(EC_LAN_63, "Check this if event happens on same day every year, ie birthday");
-define(EC_LAN_64, "Check for an all-day event");
-define(EC_LAN_65, "Recurring:");
-define(EC_LAN_66, "Edit Event");
-define(EC_LAN_67, "Start:");
-define(EC_LAN_68, "All day event");
-define(EC_LAN_69, "Ends");
-define(EC_LAN_70, "Event Title:");
-define(EC_LAN_71, "Event Time:");
-define(EC_LAN_72, "Event Date:");
-define(EC_LAN_73, "End:");
-define(edesc_LAN_0, "Count Down");
-define(edesc_LAN_1, "Still ");
-define(edesc_LAN_2, "before event on ".SITENAME);
-define(edesc_LAN_3, "sec");
-define(edesc_LAN_4, "secs");
-define(edesc_LAN_5, "min");
-define(edesc_LAN_6, "mins");
-define(edesc_LAN_7, "h");
-define(edesc_LAN_8, "h");
-define(edesc_LAN_9, "day");
-define(edesc_LAN_10, "days");
-define(EC_LAN_VIEWCALENDAR, "View Calendar");
-define(EC_LAN_VIEWALLEVENTS, "View all events");
-define(EC_LAN_ALLEVENTS, "All events");
-define(EC_LAN_74, "View Category");
-// ADMIN
-define(EC_LAN_75, "Calendar settings updated.");
-define(EC_LAN_76, "Events can be added by:");
-define(EC_LAN_77, "Update Settings");
-define(EC_LAN_78, "Calendar Settings");
-define(EC_LAN_79, "Calendar View");
-define(EC_LAN_80, "Event List");
-define(EC_LAN_81, "Configure Event Calendar");
-define(EC_LAN_82, "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.");
-define(EC_LAN_83, "Calendar");
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+<?php
+// e107 Language File.
+// $Id: English.php,v 1.11 2005/07/06 10:04:18 lisa_ Exp $
+	
+	
+define('EC_ADLAN_1', "Event Calendar");
+define('EC_ADLAN_2', "Configure Event Calendar");
+define('EC_INSTALL', "Install Event Calendar");
+define('EC_UNINSTALL', "Uninstall Event Calendar");
+define('EC_LAN_TODAY', "today");
+
+define('EC_LAN_DAY_1', "1");
+define('EC_LAN_DAY_2', "2");
+define('EC_LAN_DAY_3', "3");
+define('EC_LAN_DAY_4', "4");
+define('EC_LAN_DAY_5', "5");
+define('EC_LAN_DAY_6', "6");
+define('EC_LAN_DAY_7', "7");
+define('EC_LAN_DAY_8', "8");
+define('EC_LAN_DAY_9', "9");
+define('EC_LAN_DAY_10', "10");
+define('EC_LAN_DAY_11', "11");
+define('EC_LAN_DAY_12', "12");
+define('EC_LAN_DAY_13', "13");
+define('EC_LAN_DAY_14', "14");
+define('EC_LAN_DAY_15', "15");
+define('EC_LAN_DAY_16', "16");
+define('EC_LAN_DAY_17', "17");
+define('EC_LAN_DAY_18', "18");
+define('EC_LAN_DAY_19', "19");
+define('EC_LAN_DAY_20', "20");
+define('EC_LAN_DAY_21', "21");
+define('EC_LAN_DAY_22', "22");
+define('EC_LAN_DAY_23', "23");
+define('EC_LAN_DAY_24', "24");
+define('EC_LAN_DAY_25', "25");
+define('EC_LAN_DAY_26', "26");
+define('EC_LAN_DAY_27', "27");
+define('EC_LAN_DAY_28', "28");
+define('EC_LAN_DAY_29', "29");
+define('EC_LAN_DAY_30', "30");
+define('EC_LAN_DAY_31', "31");
+/*
+define('EC_LAN_DAY_1', "1st");
+define('EC_LAN_DAY_2', "2nd");
+define('EC_LAN_DAY_3', "3rd");
+define('EC_LAN_DAY_4', "4th");
+define('EC_LAN_DAY_5', "5th");
+define('EC_LAN_DAY_6', "6th");
+define('EC_LAN_DAY_7', "7th");
+define('EC_LAN_DAY_8', "8th");
+define('EC_LAN_DAY_9', "9th");
+define('EC_LAN_DAY_10', "10th");
+define('EC_LAN_DAY_11', "11th");
+define('EC_LAN_DAY_12', "12th");
+define('EC_LAN_DAY_13', "13th");
+define('EC_LAN_DAY_14', "14th");
+define('EC_LAN_DAY_15', "15th");
+define('EC_LAN_DAY_16', "16th");
+define('EC_LAN_DAY_17', "17th");
+define('EC_LAN_DAY_18', "18th");
+define('EC_LAN_DAY_19', "19th");
+define('EC_LAN_DAY_20', "20th");
+define('EC_LAN_DAY_21', "21st");
+define('EC_LAN_DAY_22', "22nd");
+define('EC_LAN_DAY_23', "23rd");
+define('EC_LAN_DAY_24', "24th");
+define('EC_LAN_DAY_25', "25th");
+define('EC_LAN_DAY_26', "26th");
+define('EC_LAN_DAY_27', "27th");
+define('EC_LAN_DAY_28', "28th");
+define('EC_LAN_DAY_29', "29th");
+define('EC_LAN_DAY_30', "30th");
+define('EC_LAN_DAY_31', "31st");
+*/
+define('EC_LAN_0', "January");
+define('EC_LAN_1', "February");
+define('EC_LAN_2', "March");
+define('EC_LAN_3', "April");
+define('EC_LAN_4', "May");
+define('EC_LAN_5', "June");
+define('EC_LAN_6', "July");
+define('EC_LAN_7', "August");
+define('EC_LAN_8', "September");
+define('EC_LAN_9', "October");
+define('EC_LAN_10', "November");
+define('EC_LAN_11', "December");
+define('EC_LAN_JAN', "Jan");
+define('EC_LAN_FEB', "Feb");
+define('EC_LAN_MAR', "Mar");
+define('EC_LAN_APR', "Apr");
+define('EC_LAN_MAY', "May");
+define('EC_LAN_JUN', "Jun");
+define('EC_LAN_JUL', "Jul");
+define('EC_LAN_AUG', "Aug");
+define('EC_LAN_SEP', "Sep");
+define('EC_LAN_OCT', "Oct");
+define('EC_LAN_NOV', "Nov");
+define('EC_LAN_DEC', "Dec");
+define('EC_LAN_12', "Monday");
+define('EC_LAN_13', "Tuesday");
+define('EC_LAN_14', "Wednesday");
+define('EC_LAN_15', "Thursday");
+define('EC_LAN_16', "Friday");
+define('EC_LAN_17', "Saturday");
+define('EC_LAN_18', "Sunday");
+define('EC_LAN_19', "Mon");
+define('EC_LAN_20', "Tue");
+define('EC_LAN_21', "Wed");
+define('EC_LAN_22', "Thu");
+define('EC_LAN_23', "Fri");
+define('EC_LAN_24', "Sat");
+define('EC_LAN_25', "Sun");
+define('EC_LAN_26', "Events this Month");
+define('EC_LAN_27', "No events for this month.");
+define('EC_LAN_28', "Enter New Event");
+define('EC_LAN_29', "When:");
+define('EC_LAN_30', "Category:");
+define('EC_LAN_31', "Posted by:");
+define('EC_LAN_32', "Location:");
+define('EC_LAN_33', "Contact:");
+define('EC_LAN_34', "Jump to");
+define('EC_LAN_35', "Edit");
+define('EC_LAN_36', "Delete");
+define('EC_LAN_37', "None Listed.");
+define('EC_LAN_38', "Not specified");
+define('EC_LAN_39', "Click here for more information");
+define('EC_LAN_40', "Current Month");
+define('EC_LAN_41', "New category created.");
+define('EC_LAN_42', "Event cannot end before it starts.");
+define('EC_LAN_43', "You left required field(s) blank.");
+define('EC_LAN_44', "New event created and entered into database.");
+define('EC_LAN_45', "Event updated in database.");
+define('EC_LAN_46', "Confirm Delete Event");
+define('EC_LAN_47', "Delete cancelled.");
+define('EC_LAN_48', "Please confirm you wish to delete this event - once deleted it cannot be retrieved");
+define('EC_LAN_49', "Cancel");
+define('EC_LAN_50', "Confirm Delete");
+define('EC_LAN_51', "Event deleted.");
+define('EC_LAN_52', "Event Category:");
+define('EC_LAN_53', "Create new category?:");
+define('EC_LAN_54', "Name:");
+define('EC_LAN_55', "Icon:");
+define('EC_LAN_56', "Create");
+define('EC_LAN_57', "Event:");
+define('EC_LAN_58', "source info URL:");
+define('EC_LAN_59', "Contact email:");
+define('EC_LAN_60', "Update Event");
+define('EC_LAN_61', "Go");
+define('EC_LAN_62', "Next -NUM- Events ...");
+define('EC_LAN_63', "Check this if event happens on same day every year, ie birthday");
+define('EC_LAN_64', "Check for an all-day event");
+define('EC_LAN_65', "Recurring:");
+define('EC_LAN_66', "Edit Event");
+define('EC_LAN_67', "Start:");
+define('EC_LAN_68', "All day event");
+define('EC_LAN_69', "Ends");
+define('EC_LAN_70', "Event Title:");
+define('EC_LAN_71', "Event Time:");
+define('EC_LAN_72', "Event Date:");
+define('EC_LAN_73', "End:");
+define('edesc_LAN_0', "Count Down");
+define('edesc_LAN_1', "Still ");
+define('edesc_LAN_2', "before event on ".SITENAME);
+define('edesc_LAN_3', "sec");
+define('edesc_LAN_4', "secs");
+define('edesc_LAN_5', "min");
+define('edesc_LAN_6', "mins");
+define('edesc_LAN_7', "h");
+define('edesc_LAN_8', "h");
+define('edesc_LAN_9', "day");
+define('edesc_LAN_10', "days");
+define('EC_LAN_VIEWCALENDAR', "View Calendar");
+define('EC_LAN_VIEWALLEVENTS', "View all events");
+define('EC_LAN_ALLEVENTS', "All events");
+define('EC_LAN_74', "View Category");
+// ADMIN
+define('EC_LAN_75', "Calendar settings updated.");
+define('EC_LAN_76', "Events can be added by:");
+define('EC_LAN_77', "Update Settings");
+define('EC_LAN_78', "Calendar Settings");
+define('EC_LAN_79', "Calendar View");
+define('EC_LAN_80', "Event List");
+define('EC_LAN_81', "Configure Event Calendar");
+define('EC_LAN_82', "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.");
+define('EC_LAN_83', "Calendar");
+	
+	
+define('EC_LAN_84', "Css element to use for day header");
+define('EC_LAN_85', "Default is 'forumheader'");
+define('EC_LAN_86', "Css element to use for day list");
+define('EC_LAN_87', "Default is 'forumheader3'");
+define('EC_LAN_88', "Css element to use for selected day");
+define('EC_LAN_89', "Default is 'indent'");
+
+//  *BK* Corrections to hard coding by Barry 
+define('EC_LAN_90', "Choose");	
+define('EC_LAN_91', "None defined");	
+define('EC_LAN_92', "View Category");		
+define('EC_LAN_93', "View Events List");		
+define('EC_LAN_94', "Enter New Event");			
+define('EC_LAN_95', "Today");	
+define('EC_LAN_96', "View Calendar");	
+define('EC_LAN_97', "All");		
+define('EC_LAN_98', "Required fields left blank");		
+define('EC_LAN_99', "Event must either be an all day event or finish after it starts");			
+define('EC_LAN_100', "Categories can be added by");			
+define('EC_LAN_101', "Set to inactive to disable on the new event form.");	
+define('EC_LAN_102', "Show link to forum thread");	
+define('EC_LAN_103', "On new event entry form.");	
+define('EC_LAN_104', "Calendar Administrator Class");		
+define('EC_LAN_105', "* Required Field");		
+define('EC_LAN_106', "Events");		
+define('EC_LAN_107', "This plugin is a fully featured event calendar with calendar menu.");		
+define('EC_LAN_108', "Event Calendar Upgraded.  Now check the new options.");	
+define('EC_LAN_109', "Unable to delete this event.");	
+define('EC_LAN_110', "Event Number ");	
+define('EC_LAN_111', "All the events on ");	
+define('EC_LAN_112', "All the Events in ");	
+define('EC_LAN_113', "Event form already submitted.");
+define('EC_LAN_114', "Week starts with:");
+define('EC_LAN_115', "Sunday");
+define('EC_LAN_116', "Monday");
+define('EC_LAN_117', "Length of daynames (characters)");
+define('EC_LAN_118', "Date format in calendar header.");
+define('EC_LAN_119', "month/year");
+define('EC_LAN_120', "year/month");
+define('EC_LAN_121', "Show Calendar");	
+define('EC_LAN_122', "Css element to show events on this day (menu)");	
+define('EC_LAN_123', "Subscriptions");
+define('EC_LAN_124', "Calendar Subscriptions");
+define('EC_LAN_125', "Categories available for subscription");
+define('EC_LAN_126', "Subscribed");
+define('EC_LAN_127', "Category");
+define('EC_LAN_128', "No categories available to subscribe to");
+define('EC_LAN_129', "Update");
+define('EC_LAN_130', "Subscriptions updated");
+define('EC_LAN_131', "Return");
+define('EC_LAN_132', "Expand details");
+define('EC_LAN_133', "[read more]");
+define('EC_LAN_134', "You have to provide a category name");
+
+define('EC_ADLAN_A10', "Configuration");
+define('EC_ADLAN_A11', "Categories");
+define('EC_ADLAN_A12', "Calendar");
+define('EC_ADLAN_A13', "Edit");
+define('EC_ADLAN_A14', "New");
+define('EC_ADLAN_A15', "Delete");
+define('EC_ADLAN_A16', "Confirm");
+define('EC_ADLAN_A17', "Proceed");
+define('EC_ADLAN_A18', "Action");
+define('EC_ADLAN_A19', "Administer Categories");
+define('EC_ADLAN_A20', "Calendar Categories");
+define('EC_ADLAN_A21', "Category name");
+
+define('EC_ADLAN_A23', "Create category");
+define('EC_ADLAN_A24', "Edit category");
+define('EC_ADLAN_A25', "Save");
+define('EC_ADLAN_A26', "Category created");
+define('EC_ADLAN_A27', "Unable to create category");
+define('EC_ADLAN_A28', "Changes Saved");
+define('EC_ADLAN_A29', "Unable to save changes");
+
+define('EC_ADLAN_A30', "Category Deleted");
+define('EC_ADLAN_A31', "Tick the confirm box to delete");
+define('EC_ADLAN_A32', "Unable to delete this category");
+define('EC_ADLAN_A33', "None defined");
+define('EC_ADLAN_A34', "Calendar Administrator Class");
+define('EC_ADLAN_A35', "");
+define('EC_ADLAN_A59', "Category is in use. Can not delete.");
+
+define('EC_ADLAN_A80', "Visible to");
+define('EC_ADLAN_A81', "Allow subscription");
+define('EC_ADLAN_A82', "Force notification to this class");
+define('EC_ADLAN_A83', "Days ahead to notify of event");
+define('EC_ADLAN_A84', "Advanced message");
+define('EC_ADLAN_A85', "Message on the day");
+define('EC_ADLAN_A86', "Send email");
+define('EC_ADLAN_A87', "None");
+define('EC_ADLAN_A88', "Only advanced");
+define('EC_ADLAN_A89', "Only on the day");
+define('EC_ADLAN_A90', "Advanced and on the day");
+define('EC_ADLAN_A91', "Email Subject");
+define('EC_ADLAN_A92', "Email from (name)");
+define('EC_ADLAN_A93', "Email from email address");
+define('EC_ADLAN_A94', "Add new event class");
+define('EC_ADLAN_A95', "Enable subscriptions");
+define('EC_ADLAN_A96', "Disabling this removes the subscriptions button and overrides the category subscription setting.");
+define('EC_ADLAN_A97', "If set to force subscriptions this category will not be displayed in the available subscription list for the user.");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/languages/English_search.php 75/e107_plugins/calendar_menu/languages/English_search.php
--- 6171/e107_plugins/calendar_menu/languages/English_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/languages/English_search.php	2005-11-15 16:07:21.000000000 -0600
@@ -0,0 +1,5 @@
+<?php
+
+define("CM_SCH_LAN_1", "Calendar");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/plugin.php 75/e107_plugins/calendar_menu/plugin.php
--- 6171/e107_plugins/calendar_menu/plugin.php	2004-09-03 13:32:10.000000000 -0500
+++ 75/e107_plugins/calendar_menu/plugin.php	2006-01-22 13:53:06.000000000 -0600
@@ -1,105 +1,159 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|        $Id: plugin.php,v 1.3 2004/09/03 18:32:10 e107coders Exp $
-+---------------------------------------------------------------+
-*/
-// Plugin info -------------------------------------------------------------------------------------------------------
-$lan_file = e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php";
-@require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
-$eplug_name = "Event Calendar";
-$eplug_version = "3.2";
-$eplug_author = "jalist / cameron";
-$eplug_logo = "button.png";
-$eplug_url = "http://e107.org";
-$eplug_email = "jalist@e107.org";
-$eplug_description = "This plugin is a fully featured event calendar with calendar menu.";
-$eplug_compatible = "e107v6";
-$eplug_readme = "";        // leave blank if no readme file
-
-// Name of the plugin's folder -------------------------------------------------------------------------------------
-$eplug_folder = "calendar_menu";
-
-// Mane of menu item for plugin ----------------------------------------------------------------------------------
-$eplug_menu_name = "calendar_menu";
-
-// Name of the admin configuration file --------------------------------------------------------------------------
-$eplug_conffile = "config.php";
-
-// Icon image and caption text ------------------------------------------------------------------------------------
-$eplug_icon = $eplug_folder."/images/icon_ec.png";
-$eplug_caption =  EC_LAN_81; // "Configure Event Calendar";
-
-// List of preferences -----------------------------------------------------------------------------------------------
-$eplug_prefs = array(
-        "eventpost_admin" => 0
-);
-
-// List of table names -----------------------------------------------------------------------------------------------
-$eplug_table_names = array(
-        "event",
-        "event_cat"
-);
-
-// List of sql requests to create tables -----------------------------------------------------------------------------
-$eplug_tables = array(
-        "CREATE TABLE ".MPREFIX."event (
-  event_id int(11) unsigned NOT NULL auto_increment,
-  event_start int(10) NOT NULL default '0',
-  event_end int(10) NOT NULL default '0',
-  event_allday tinyint(1) unsigned NOT NULL default '0',
-  event_recurring tinyint(1) unsigned NOT NULL default '0',
-  event_datestamp int(10) unsigned NOT NULL default '0',
-  event_title varchar(200) NOT NULL default '',
-  event_location text NOT NULL,
-  event_details text NOT NULL,
-  event_author varchar(100) NOT NULL default '',
-  event_contact varchar(200) NOT NULL default '',
-  event_category smallint(5) unsigned NOT NULL default '0',
-  event_thread varchar(100) NOT NULL default '',
-  event_rec_m tinyint(2) unsigned NOT NULL default '0',
-  event_rec_y tinyint(2) unsigned NOT NULL default '0',
-  PRIMARY KEY  (event_id)
-) TYPE=MyISAM;",
-        "CREATE TABLE ".MPREFIX."event_cat (
-  event_cat_id smallint(5) unsigned NOT NULL auto_increment,
-  event_cat_name varchar(100) NOT NULL default '',
-  event_cat_icon varchar(100) NOT NULL default '',
-  PRIMARY KEY  (event_cat_id)
-) TYPE=MyISAM;");
-
-
-// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
-$eplug_link = TRUE;
-$eplug_link_name = EC_LAN_83; // "Calendar";
-$ec_dir = e_PLUGIN."calendar_menu/";
-$eplug_link_url = "".$ec_dir."calendar.php";
-
-
-// Text to display after plugin successfully installed ------------------------------------------------------------------
-$eplug_done = EC_LAN_82; // "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.";
-
-
-// upgrading ... //
-
-$upgrade_add_prefs = "";
-
-$upgrade_remove_prefs = "";
-
-$upgrade_alter_tables = "";
-
-$eplug_upgrade_done = "";
-
-
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/plugin.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2006/01/22 19:53:06 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$lan_file = e_PLUGIN."calendar_menu/languages/".e_LANGUAGE.".php";
+@require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
+$eplug_name = "Event Calendar";
+$eplug_version = "3.5";
+$eplug_author = "jalist / cameron / McFly / Barry / Lisa_";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = EC_LAN_107;
+$eplug_compatible = "e107v7";
+$eplug_readme = "readme.rtf";
+// leave blank if no readme file
+$eplug_compliant = TRUE;
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "calendar_menu";
+
+// Mane of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "calendar_menu";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/calendar_32.png";
+$eplug_icon_small = $eplug_folder."/images/calendar_16.png";
+$eplug_caption = EC_LAN_81; // "Configure Event Calendar";
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array(
+"eventpost_admin" => 0,
+"eventpost_headercss" => "forumheader",
+"eventpost_daycss" => "forumheader3",
+"eventpost_todaycss" => "indent",
+"eventpost_addcat" => 0,
+"eventpost_forum" => 1,
+"eventpost_evtoday" => "indent",
+"eventpost_mailsubject" => "Calendar",
+"eventpost_mailfrom" => "e107 Web Site",
+"eventpost_mailaddress" => "calendar@yoursite.com",
+"eventpost_lenday" => 1,
+"eventpost_asubs" => 1,
+"eventpost_weekstart" => "sun" );
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array("event","event_cat","event_subs" );
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."event (
+	event_id int(11) unsigned NOT NULL auto_increment,
+	event_start int(10) NOT NULL default '0',
+	event_end int(10) NOT NULL default '0',
+	event_allday tinyint(1) unsigned NOT NULL default '0',
+	event_recurring tinyint(1) unsigned NOT NULL default '0',
+	event_datestamp int(10) unsigned NOT NULL default '0',
+	event_title varchar(200) NOT NULL default '',
+	event_location text NOT NULL,
+	event_details text NOT NULL,
+	event_author varchar(100) NOT NULL default '',
+	event_contact varchar(200) NOT NULL default '',
+	event_category smallint(5) unsigned NOT NULL default '0',
+	event_thread varchar(100) NOT NULL default '',
+	event_rec_m tinyint(2) unsigned NOT NULL default '0',
+	event_rec_y tinyint(2) unsigned NOT NULL default '0',
+	PRIMARY KEY  (event_id)
+	) TYPE=MyISAM;",
+	"CREATE TABLE ".MPREFIX."event_cat (
+	event_cat_id smallint(5) unsigned NOT NULL auto_increment,
+	event_cat_name varchar(100) NOT NULL default '',
+	event_cat_icon varchar(100) NOT NULL default '',
+	event_cat_class int(10) unsigned NOT NULL default '0',
+	event_cat_subs tinyint(3) unsigned NOT NULL default '0',
+	event_cat_force tinyint(3) unsigned NOT NULL default '0',
+	event_cat_ahead tinyint(3) unsigned NOT NULL default '0',
+	event_cat_msg1 text,
+	event_cat_msg2 text,
+	event_cat_notify  tinyint(3) unsigned NOT NULL default '0',
+	event_cat_last int(10) unsigned NOT NULL default '0',
+	event_cat_today int(10) unsigned NOT NULL default '0',
+	event_cat_lastupdate int(10) unsigned NOT NULL default '0',
+	event_cat_addclass int(10) unsigned NOT NULL default '0',
+	PRIMARY KEY  (event_cat_id)
+	) TYPE=MyISAM;"
+	,
+	"CREATE TABLE ".MPREFIX."event_subs (
+	event_subid int(10) unsigned NOT NULL auto_increment,
+	event_userid  int(10) unsigned NOT NULL default '0',
+	event_cat  int(10) unsigned NOT NULL default '0',
+	PRIMARY KEY  (event_subid)
+	) TYPE=MyISAM;");
+
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$ec_dir = e_PLUGIN."calendar_menu/";
+$eplug_link = TRUE;
+$eplug_link_name = EC_LAN_83; // "Calendar";
+$eplug_link_url = "".$ec_dir."calendar.php";
+$eplug_link_perms = "Everyone"; // Everyone, Guest, Member, Admin 
+
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = EC_LAN_82; // "To activate please go to your menus screen and select the calendar_menu into one of your menu areas.";
+
+
+// upgrading ... //
+
+$upgrade_add_prefs = "";
+
+$upgrade_remove_prefs = "";
+
+$upgrade_alter_tables = array(
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_class int(10) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_subs tinyint(3) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_force tinyint(3) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_ahead tinyint(3) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_msg1 text",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_msg2 text",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_notify  tinyint(3) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_last int(10) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_today int(10) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_lastupdate int(10) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."event_cat ADD event_cat_addclass int(10) unsigned NOT NULL default '0'",
+"CREATE TABLE ".MPREFIX."event_subs (
+	event_subid int(10) unsigned NOT NULL auto_increment,
+	event_userid  int(10) unsigned NOT NULL default '0',
+	event_cat  int(10) unsigned NOT NULL default '0',
+	PRIMARY KEY  (event_subid)
+	) TYPE=MyISAM;"
+);
+
+$eplug_upgrade_done = EC_LAN_108;
+
+
+
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/readme.rtf 75/e107_plugins/calendar_menu/readme.rtf
--- 6171/e107_plugins/calendar_menu/readme.rtf	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/readme.rtf	2005-04-30 23:37:02.000000000 -0500
@@ -0,0 +1,104 @@
+{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang2057\deflangfe2057{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
+{\f36\froman\fcharset238\fprq2 Times New Roman CE;}{\f37\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f39\froman\fcharset161\fprq2 Times New Roman Greek;}{\f40\froman\fcharset162\fprq2 Times New Roman Tur;}
+{\f41\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f42\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f43\froman\fcharset186\fprq2 Times New Roman Baltic;}{\f44\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}
+{\f46\fswiss\fcharset238\fprq2 Arial CE;}{\f47\fswiss\fcharset204\fprq2 Arial Cyr;}{\f49\fswiss\fcharset161\fprq2 Arial Greek;}{\f50\fswiss\fcharset162\fprq2 Arial Tur;}{\f51\fswiss\fcharset177\fprq2 Arial (Hebrew);}
+{\f52\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f53\fswiss\fcharset186\fprq2 Arial Baltic;}{\f54\fswiss\fcharset163\fprq2 Arial (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
+\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
+\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang2057\langfe2057\cgrid\langnp2057\langfenp2057 \snext0 Normal;}{\*\cs10 \additive \ssemihidden Default Paragraph Font;}{\*
+\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv 
+\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\rsidtbl \rsid2174356\rsid3212090\rsid3477726\rsid6832128\rsid8085253\rsid9705426
+\rsid10102401\rsid11629344\rsid12982990}{\*\generator Microsoft Word 10.0.4219;}{\info{\author pssuser}{\operator pssuser}{\creatim\yr2005\mo4\dy26\hr14\min25}{\revtim\yr2005\mo4\dy27\hr9\min20}{\version7}{\edmins38}{\nofpages3}{\nofwords910}
+{\nofchars5193}{\*\company PSS}{\nofcharsws6091}{\vern16469}}\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3
+\jcompress\viewkind4\viewscale100\nolnhtadjtbl\rsidroot6832128 \fet0\sectd \linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3
+\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}
+{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain 
+\ql \li0\ri0\nowidctlpar\faauto\rin0\lin0\itap0 \fs24\lang2057\langfe2057\cgrid\langnp2057\langfenp2057 {\f1\fs20\insrsid2174356 *******************************************************************
+\par *
+\par *\tab }{\b\f1\fs20\insrsid2174356 Calendar Menu
+\par }{\f1\fs20\insrsid2174356 *
+\par *\tab By jalist with extras from Cameron, McFly and Barry and others
+\par *
+\par *\tab Version\tab \tab 3.5
+\par *
+\par *\tab e107 version\tab 0.7+
+\par *
+\par *\tab Compliance\tab XHTML 1.1
+\par *
+\par *******************************************************************
+\par 
+\par }{\b\i\f1\fs20\ul\insrsid2174356 Introduction}{\i\f1\fs20\ul\insrsid2174356 
+\par }{\f1\fs20\insrsid2174356 This is a calendar/event plugin for the e107CMS.  This is provided as a core plugin distributed with the e107.
+\par 
+\par }{\b\i\f1\fs20\ul\insrsid2174356 Upgrading}{\f1\fs20\insrsid2174356 
+\par Copy the contents of this folder to your e107plugins calendar_menu folder.  Go to the plugin manager and run the upgrade.  Then check that the database is correct by running a database validity check from the main admin menu - databases option.
+\par }{\f1\fs20\insrsid6832128 
+\par }{\b\f1\fs20\insrsid10102401 Subscriptions
+\par }{\f1\fs20\insrsid10102401 \line Version 3.5 introduces the facility for a membe
+r to be able to subscribe to event categories though not to individual events.  If they subscribe they will receive email notification to the address they used when registering.  The admin can decide if it is to be an email sent x days before the event or
+ on the day of the event or both.  
+\par 
+\par If you wish to allow them to subscribe to notifications then you need some way of getting your server to }{\f1\fs20\insrsid11629344 check to see if an email is due to be sent.  There are three ways of doing this 
+\par 
+\par 1) as an admin function.  This means that you have to remember to go and run an admin function everyday \endash  not very good.  
+\par }{\f1\fs20\insrsid3477726 
+\par }{\f1\fs20\insrsid11629344 2) as a menu that runs everytime your site is accessed.  We can make this an \'93invisible\'94 menu ie there is not output displayed on the screen and have it check if it 
+is time to send an email.  This is better than the first option but requires that you have at least one site hit per day.  It also adds an extra burden on to the server going and running the menu\rquote s script and a small bit of code to check.}{
+\f1\fs20\insrsid3477726   If you use this method then enable the subs menu but remember you won\rquote t see anything on the screen}{\f1\fs20\insrsid10102401 
+\par }{\f1\fs20\insrsid3477726 
+\par }{\f1\fs20\insrsid11629344 3) as a cron or Windows scheduled task.  This is the best method.  It will run everyday at the same time and so won\rquote t get forgotten.  It is only run once and so doesn\rquote 
+t place unnecessary loads on the server (important if it\rquote s a busy site) but requires that you have access to CRON or Windows scheduler.
+\par 
+\par So which to go for?  Option 3 is the best job and if not that then option 2.  To set up the cron job you should copy th
+e file calcron.php into the top level of your e107 directory (I found that this is the most reliable place to run it from) and create your cron job in the usual manner.  It is beyond the scope of this readme to tell you how to do it or how to trouble shoo
+t it.
+\par 
+\par On my server it is a case of running c:\\php\\cli\\php \endash f  calcron.php in the top level of your e107 site.  I also needed to copy php.ini to the php\\cli directory}{\f1\fs20\insrsid3212090 
+.  You may have to play around with paths to get it to work.}{\f1\fs20\insrsid11629344 
+\par }{\f1\fs20\insrsid12982990 
+\par There are some limitations, people logged in can\rquote t subscribe and you can\rquote t force email standard groups like Admin Only class or Members Only class.}{\f1\fs20\insrsid12982990\charrsid10102401 
+\par }{\b\f1\fs20\insrsid10102401 
+\par }{\b\f1\fs20\insrsid6832128\charrsid6832128 Version 3.5
+\par }{\f1\fs20\insrsid6832128 
+\par This version brings the opportunity to allow members to subscribe to event categories.  Admin can determine if a category is allowed to have subscriptions and if it does then when the user is notified.  For example an email can be sent x days before the e
+vent (with a tailored message) or on the day of the event (again with a message) or on both occasions.  
+\par 
+\par Admin can also configure the calendar to force notifications to a particular user class.  Subscription by the user is not possible in this case they ar
+e automatically included in the mail shot.  This might be useful when it is used in an intranet system and you have a reports deadline userclass.  All the members of that userclass will then be notified when the report is due, they can\rquote 
+t unsubscribe from the emails and so can\rquote t argue they didn\rquote t get notified the report was due.
+\par 
+\par There is a new table created in this version }{\f1\fs20\insrsid2174356 plus changes to one other table so you must run upgrade plug-in from the plug-in manager.  You will also need to set the new settings fo
+r each of the categories you have to allow or disallow subscriptions.}{\f1\fs20\insrsid6832128 
+\par }{\f1\fs20\insrsid10102401 
+\par }{\f1\fs20\insrsid9705426 C}{\f1\fs20\insrsid9705426\charrsid9705426 ategori}{\f1\fs20\insrsid9705426 es can now be made visible to one }{\f1\fs20\insrsid9705426\charrsid9705426 userclass }{\f1\fs20\insrsid9705426 but re
+stricted in who can add events.  This is the add new event class field.  So a whole department can view and subscribe to a category but only department managers can add events.
+\par }{\f1\fs20\insrsid9705426\charrsid9705426 
+\par }{\b\f1\fs20\insrsid6832128\charrsid6832128 Version 3.4
+\par }{\f1\fs20\insrsid6832128 
+\par Some bug fixes and a nice calendar added.
+\par }{\f1\fs20\insrsid2174356 
+\par }{\b\i\f1\fs20\insrsid2174356 Version 3.3
+\par }{\f1\fs20\insrsid2174356 
+\par Enhancements have been made by various people and now is version 0.7+ and xhtml1.1 compatible.  Also added are integrity check file and database validity check file.
+\par 
+\par This version brings userclasses to the categories.  Admin now can control the editing of categories and the userclasses that can access them.  
+\par 
+\par The calendar menu block also respects userclasses; only those events in categories to which the user is entitled to see are displayed.  
+\par 
+\par Validation is now made before submitting the form.  Required fields left empty or incorrect start and end times are flagged with Javascript alert.  
+\par 
+\par If a new event is being created and an email address is available (user logged in for example) then this is prompted in the email adress field.  This can be over ridden by the user.
+\par 
+\par Admin can define if the create new category is shown on create event form
+.  If you don't want users creating new categories then this can be turned off.  Likewise, admin can hide the field for forum link, if you don't want these links ion the events then they can be turned off.
+\par 
+\par Admin can define a "Calendar Supervisor" userclas
+s.  Members of this class can see all categories and events and can edit and delete events from  the event list.  Event administrators don't actually have to be made admins to be able to look after events though normally they would be.  This is more appro
+priate for corporate users using e107 as an intranet.
+\par 
+\par Clicking on an event in calendar view displays just that event, not all the events on that day.  Click on the day number to list all on that day.
+\par 
+\par Javascript to hide the email from spam bots when displaying an event.
+\par 
+\par }{\b\i\f1\fs20\insrsid2174356 Version 3.2 and prior}{\f1\fs20\insrsid2174356 
+\par Substantial rewrite of the code to make it more efficient and to give admin control of the css for the look and feel of the calendar.
+\par }}
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/search/search_parser.php 75/e107_plugins/calendar_menu/search/search_parser.php
--- 6171/e107_plugins/calendar_menu/search/search_parser.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/search/search_parser.php	2005-08-22 13:38:14.000000000 -0500
@@ -0,0 +1,40 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/search/search_parser.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/08/22 18:38:14 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+$return_fields = 'event_id, event_start, event_title, event_location, event_details';
+$search_fields = array('event_title', 'event_location', 'event_details');
+$weights = array('1.2', '0.6', '0.6');
+$no_results = LAN_198;
+$where = "";
+$order = array('event_start' => DESC);
+
+$ps = $sch -> parsesearch('event', $return_fields, $search_fields, $weights, 'search_events', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_events($row) {
+	global $con;
+	$res['link'] = e_PLUGIN."calendar_menu/event.php?".time().".event.".$row['event_id'];
+	$res['title'] = $row['event_title'];
+	$res['summary'] = $row['event_details'];
+	$res['detail'] = $row['event_location']." | ".$con -> convert_date($row['event_start'], "long");
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/subscribe.php 75/e107_plugins/calendar_menu/subscribe.php
--- 6171/e107_plugins/calendar_menu/subscribe.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/subscribe.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,83 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dun.an 2001-2002
+|     http://e107.org
+|     jali.@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/subscribe.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2006/01/05 09:06:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+$ec_dir = e_PLUGIN . "calendar_menu/";
+$lan_file = $ec_dir . "languages/" . e_LANGUAGE . ".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN . "calendar_menu/languages/English.php");
+define("PAGE_NAME", EC_LAN_80);
+require_once(HEADERF);
+$cal_db = new DB;
+
+if (isset($_POST['upsubs']))
+{
+    $cal_cats = $tp -> toDB($_POST['event_list']);
+    $cal_subs =  $tp -> toDB($_POST['event_subd']);
+    $cal_db->db_Delete("event_subs", "event_userid='" . USERID . "'");
+    foreach($cal_cats as $cal_row)
+    {
+        if ($cal_subs[$cal_row])
+        {
+            $cal_inargs = "0,'" . USERID . "','" . $cal_row . "'";
+            $cal_db->db_Insert("event_subs", $cal_inargs);
+        } 
+        // print $cal_row .  $cal_subs[$cal_row] . "<br>";
+    } 
+    $caltext = "<table class='fborder' width='97%'>
+<tr><td class='fcaption' >" . EC_LAN_130 . "</td></tr>
+<tr><td class='forumheader3' ><a href='calendar.php'>" . EC_LAN_131 . "</a></tr>
+<tr><td class='fcaption' >&nbsp;</td></tr></table>";
+} 
+else
+{
+    $caltext = "<form id='calsubs' action='" . e_SELF . "' method='post' >
+<table class='fborder' width='97%'>
+<tr><td class='fcaption' colspan='2'>" . EC_LAN_125 . "</td></tr>
+<tr><td class='forumheader2' >" . EC_LAN_126 . "</td><td class='forumheader2' >" . EC_LAN_127 . "</td></tr>"; 
+    // Get list of currently subscribed
+    $cal_db->db_Select("event_subs", "event_cat", "where event_userid='" . USERID . "'", "nowhere");
+    while ($cal_s = $cal_db->db_Fetch())
+    {
+        extract($cal_s);
+        $cal_array[] = $event_cat;
+    } // while 
+    // Get list of categories that have subscriptions and are visible to this member
+    $cal_args = "select * from " . MPREFIX . "event_cat where event_cat_subs>0 and event_cat_force = 0 and find_in_set(event_cat_class,'".USERCLASS_LIST."') ";
+    if ($cal_db->db_Select_gen($cal_args))
+    { 
+        // print $cal_args;
+        while ($cal_row = $cal_db->db_Fetch())
+        {
+            extract($cal_row);
+            $caltext .= "<tr>
+	<td class='forumheader3' style='width:10%;'><input type='hidden' name='event_list[]' value='" . $event_cat_id . "' />
+	<input type='checkbox' class='tbox' value='1' name='event_subd[$event_cat_id]' " . (in_array($event_cat_id, $cal_array)?"checked='checked' ":"") . " /> </td>
+	<td class='forumheader3'>$event_cat_name</td></tr>";
+        } 
+    } 
+    else
+    {
+        $caltext .= "<tr><td class='forumheader3' colspan='2'>" . EC_LAN_128 . "</td></tr>";
+    } 
+    $caltext .= "<tr><td class='forumheader3' colspan='2'><input class='tbox' type='submit' value='" . EC_LAN_129 . "' name='upsubs' /></td></tr>";
+    $caltext .= "</table></form>";
+} 
+$ns->tablerender(EC_LAN_124, $caltext);
+require_once(FOOTERF);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/calendar_menu/subs_menu.php 75/e107_plugins/calendar_menu/subs_menu.php
--- 6171/e107_plugins/calendar_menu/subs_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/calendar_menu/subs_menu.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,132 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dun.an 2001-2002
+|     http://e107.org
+|     jali.@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/subs_menu.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/01/05 09:06:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// This menu can be called from a cron job - see readme.rtf
+$ec_dir = e_PLUGIN . "calendar_menu/";
+$caldb = new DB;
+$cal_emaildb = new DB;
+// Check if we are going to do the notify
+
+$cal_starttime = mktime(0, 0, 0, date("n"), date("d"), date("Y"));
+// Firstly for dates ahead
+// Do future events
+$cal_args = "select * from " . MPREFIX . "event left join " . MPREFIX . "event_cat on event_category=event_cat_id where event_cat_subs>0 and 
+event_cat_last < " . $cal_starttime . " and 
+event_cat_ahead > 0 and 
+event_start >= (" . $cal_starttime . "+(86400*(event_cat_ahead))) and
+event_start <= (" . $cal_starttime . "+(86400*(event_cat_ahead+1))) and
+find_in_set(event_cat_notify,'1,3')";
+#print $cal_args;
+if ($caldb->db_Select_gen($cal_args))
+{
+    require_once(e_HANDLER . "mail.php");
+
+    while ($cal_row = $caldb->db_Fetch())
+    {
+        extract($cal_row);
+        $cal_emaildb->db_Update("event_cat", "event_cat_last=" . time() . " where event_cat_id=" . intval($event_cat_id)); 
+
+        if ($event_cat_force > 0)
+        { 
+            // Force email to members of this class
+
+            $cal_emilargs = "select * from " . MPREFIX . "user where user_class regexp '^".intval($event_cat_class).",' or user_class regexp ',".intval($event_cat_class).",'  or user_class regexp ',".intval($event_cat_class)."'"; 
+
+            if ($cal_emaildb->db_Select_gen($cal_emilargs)) 
+                {
+                    while ($cal_emrow = $cal_emaildb->db_Fetch())
+                {
+                    extract($cal_emrow);
+                    $cal_msg = $event_title . "\n\n" . $event_cat_msg1;
+                    sendemail($user_email, $pref['eventpost_mailsubject'], $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']); 
+
+                } 
+            } 
+        } 
+        else
+        { 
+            // only subscribers
+            $cal_emilargs = "select * from " . MPREFIX . "user left join " . MPREFIX . "event_subs on user_id=event_userid where " . MPREFIX . "event_subs.event_cat='".intval($event_category)."'";
+#print $cal_emilargs;
+            if ($cal_emaildb->db_Select_gen($cal_emilargs))
+            {
+                while ($cal_emrow = $cal_emaildb->db_Fetch())
+                {
+                    extract($cal_emrow);
+                    $cal_msg = $event_title . "\n\n" . $event_cat_msg1;
+                    sendemail($user_email, $pref['eventpost_mailsubject'], $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']);
+                } 
+            } 
+        } 
+    } // while    
+} 
+// then for today
+// Check if we are going to do the notify
+// Firstly for dates ahead
+$cal_starttime = mktime(0, 0, 0, date("n"), date("d"), date("Y"));
+$cal_args = "select * from " . MPREFIX . "event left join " . MPREFIX . "event_cat on event_category=event_cat_id where event_cat_subs>0 and 
+event_cat_today < " . intval($cal_starttime) . " and 
+event_start >= (" . intval($cal_starttime) . ") and
+event_start <= (86400+" . intval($cal_starttime) . ") and
+find_in_set(event_cat_notify,'2,3')";
+if ($caldb->db_Select_gen($cal_args))
+{
+    require_once(e_HANDLER . "mail.php");
+    while ($cal_row = $caldb->db_Fetch())
+    {
+        extract($cal_row);
+        $cal_emaildb->db_Update("event_cat", "event_cat_today=" . time() . " where event_cat_id=" . intval($event_cat_id));
+        if ($event_cat_force > 0)
+        { 
+            // Force email to members of this class
+
+            $cal_emilargs = "select * from " . MPREFIX . "user where user_class regexp '^".intval($event_cat_class).",' or user_class regexp ',".intval($event_cat_class).",'  or user_class regexp ',".intval($event_cat_class)."'"; 
+
+            if ($cal_emaildb->db_Select_gen($cal_emilargs))
+                {
+                    while ($cal_emrow = $cal_emaildb->db_Fetch())
+                {
+                    extract($cal_emrow);
+                    $cal_msg = $event_title . "\n\n" . $event_cat_msg2;
+                    sendemail($user_email, $pref['eventpost_mailsubject'], $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']); 
+
+                } 
+            } 
+        } 
+        else
+        { 
+            // only subscribers
+            $cal_emilargs = "select * from " . MPREFIX . "user left join " . MPREFIX . "event_subs on user_id=event_userid where " . MPREFIX . "event_subs.event_cat='".intval($event_category)."'";
+            if ($cal_emaildb->db_Select_gen($cal_emilargs))
+            {
+                while ($cal_emrow = $cal_emaildb->db_Fetch())
+                {
+                    extract($cal_emrow);
+                    $cal_msg = $event_title . "\n\n" . $event_cat_msg2;
+                    sendemail($user_email, $pref['eventpost_mailsubject'], $cal_msg, $user_name, $pref['eventpost_mailaddress'], $pref['eventpost_mailfrom']); 
+
+                } 
+            } 
+        } 
+    } // while    
+} 
+#print "done";
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/admin_chatbox.php 75/e107_plugins/chatbox_menu/admin_chatbox.php
--- 6171/e107_plugins/chatbox_menu/admin_chatbox.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/admin_chatbox.php	2006-05-19 17:02:22.000000000 -0500
@@ -0,0 +1,181 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/admin_chatbox.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2006/05/19 22:02:22 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+
+if(!getperms("P")) { header("location:".e_BASE."index.php"); exit; }
+
+@include_once e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE."_config.php";
+@include_once e_PLUGIN."chatbox_menu/languages/English/English_config.php";
+
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."userclass_class.php");
+
+if (isset($_POST['updatesettings'])) {
+
+	$pref['chatbox_posts'] = $_POST['chatbox_posts'];
+	$pref['cb_linkc'] = $tp->toDB($_POST['cb_linkc']);
+	$pref['cb_linkreplace'] = $_POST['cb_linkreplace'];
+	$pref['cb_layer'] = $_POST['cb_layer'];
+	$pref['cb_layer_height'] = ($_POST['cb_layer_height'] ? $_POST['cb_layer_height'] : 200);
+	$pref['cb_emote'] = $_POST['cb_emote'];
+	$pref['cb_mod'] = $_POST['cb_mod'];
+	save_prefs();
+	$e107cache->clear("chatbox");
+	$message = CHBLAN_1;
+}
+
+if (isset($_POST['prune'])) {
+	$chatbox_prune = $_POST['chatbox_prune'];
+	$prunetime = time() - $chatbox_prune;
+
+	$sql->db_Delete("chatbox", "cb_datestamp < '$prunetime' ");
+	$e107cache->clear("chatbox");
+	$message = CHBLAN_28;
+}
+
+if (isset($_POST['recalculate'])) {
+	$sql->db_Update("user", "user_chats = 0");
+	$qry = "SELECT u.user_id AS uid, count(c.cb_nick) AS count FROM #chatbox AS c
+		LEFT JOIN #user AS u on FLOOR(c.cb_nick) = u.user_id
+		WHERE u.user_id > 0
+		GROUP BY uid";
+
+		if ($sql -> db_Select_gen($qry)) {
+			$ret = array();
+			while($row = $sql -> db_Fetch())
+			{
+				$list[$row['uid']] = $row['count'];	
+			}
+		}
+
+		foreach($list as $uid => $cnt)
+		{
+			$sql->db_Update("user", "user_chats = '{$cnt}' WHERE user_id = '{$uid}'");
+		}
+	$message = CHBLAN_33;
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+$chatbox_posts = $pref['chatbox_posts'];
+$cb_linkreplace = $pref['cb_linkreplace'];
+$cb_linkc = $pref['cb_linkc'];
+
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."' id='cbform'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+	<td class='forumheader3' style='width:40%'>".CHBLAN_11.":  <div class='smalltext'>".CHBLAN_12."</div></td>
+	<td class='forumheader3' style='width:60%'>
+	<select name='chatbox_posts' class='tbox'>";
+if ($chatbox_posts == 5) {
+	$text .= "<option selected='selected'>5</option>\n";
+} else {
+	$text .= "<option>5</option>\n";
+}
+if ($chatbox_posts == 10) {
+	$text .= "<option selected='selected'>10</option>\n";
+} else {
+	$text .= "<option>10</option>\n";
+}
+if ($chatbox_posts == 15) {
+	$text .= "<option selected='selected'>15</option>\n";
+} else {
+	$text .= "<option>15</option>\n";
+}
+if ($chatbox_posts == 20) {
+	$text .= "<option selected='selected'>20</option>\n";
+} else {
+	$text .= "<option>20</option>\n";
+}
+if ($chatbox_posts == 25) {
+	$text .= "<option selected='selected'>25</option>\n";
+} else {
+	$text .= "<option>25</option>\n";
+}
+
+if(!isset($pref['cb_mod']))
+{
+	$pref['cb_mod'] = e_UC_ADMIN;
+}
+
+$text .= "</select>
+	</td>
+	</tr>
+
+	<tr><td class='forumheader3' style='width:40%'>".CHBLAN_32.": </td>
+	<td class='forumheader3' style='width:60%'>". r_userclass("cb_mod", $pref['cb_mod'], 'off', "admin, classes")."
+	</td>
+	</tr>
+
+	<tr><td class='forumheader3' style='width:40%'>".CHBLAN_36."</td>
+	<td class='forumheader3' style='width:60%'>". 
+	($pref['cb_layer'] == 0 ? "<input type='radio' name='cb_layer' value='0' checked='checked' />" : "<input type='radio' name='cb_layer' value='0' />")."&nbsp;&nbsp;". CHBLAN_37."<br />".
+	($pref['cb_layer'] == 1 ? "<input type='radio' name='cb_layer' value='1' checked='checked' />" : "<input type='radio' name='cb_layer' value='1' />")."&nbsp;".CHBLAN_29."&nbsp;--&nbsp;". CHBLAN_30.": <input class='tbox' type='text' name='cb_layer_height' size='8' value='".$pref['cb_layer_height']."' maxlength='3' /><br />".
+	($pref['cb_layer'] == 2 ? "<input type='radio' name='cb_layer' value='2' checked='checked' />" : "<input type='radio' name='cb_layer' value='2' />")."&nbsp;&nbsp;". CHBLAN_38."
+	</td>
+	</tr>
+	";
+
+	if($pref['smiley_activate'])
+	{
+		$text .= "<tr><td class='forumheader3' style='width:40%'>".CHBLAN_31."?: </td>
+		<td class='forumheader3' style='width:60%'>". ($pref['cb_emote'] ? "<input type='checkbox' name='cb_emote' value='1' checked='checked' />" : "<input type='checkbox' name='cb_emote' value='1' />")."
+		</td>
+		</tr>
+		";
+	}
+
+	$text .= "<tr>
+	<td class='forumheader3' style='width:40%'>".CHBLAN_21.": <div class='smalltext'>".CHBLAN_22."</div></td>
+	<td class='forumheader3' style='width:60%'>
+	".CHBLAN_23." <select name='chatbox_prune' class='tbox'>
+	<option></option>
+	<option value='86400'>".CHBLAN_24."</option>
+	<option value='604800'>".CHBLAN_25."</option>
+	<option value='2592000'>".CHBLAN_26."</option>
+	<option value='1'>".CHBLAN_27."</option>
+	</select>
+	<input class='button' type='submit' name='prune' value='".CHBLAN_21."' />
+	</td>
+	</tr>";
+	
+	
+	$text .= "<tr>
+	<td class='forumheader3' style='width:40%'>".CHBLAN_34.":</td>
+	<td class='forumheader3' style='width:60%'>
+	<input class='button' type='submit' name='recalculate' value='".CHBLAN_35."' />
+	</td>
+	</tr>";
+
+	$text .= "<tr>
+	<td  class='forumheader' colspan='3' style='text-align:center'>
+	<input class='button' type='submit' name='updatesettings' value='".CHBLAN_19."' />
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+
+$ns->tablerender(CHBLAN_20, $text);
+
+require_once(e_ADMIN."footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/chatbox_menu.php 75/e107_plugins/chatbox_menu/chatbox_menu.php
--- 6171/e107_plugins/chatbox_menu/chatbox_menu.php	2004-09-03 02:32:36.000000000 -0500
+++ 75/e107_plugins/chatbox_menu/chatbox_menu.php	2006-02-27 06:32:24.000000000 -0600
@@ -1,220 +1,266 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/plugins/chatbox.php
-|
-|	Steve Dunstan 2001-2002
-|	http://jalist.com
-|	stevedunstan@jalist.com
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-if(!is_object($aj)){ $aj = new textparse; }
-if(IsSet($_POST['chat_submit']))
-{
-	if(!USER && !$pref['anon_post'])
-	{
-		// disallow post
-	} else
-	{
-		$cmessage = $_POST['cmessage'];
-		$cmessage = htmlentities($cmessage);
-		$nick = trim(chop(preg_replace("/\[.*\]/si", "", $_POST['nick'])));
-		$fp = new floodprotect;
-		if(!$fp -> flood("chatbox", "cb_datestamp"))
-		{
-			header("location:".e_BASE."index.php");
-			exit;
-		} else
-		{
-			if((strlen(trim(chop($cmessage))) < 1000) && trim(chop($cmessage)) != "")
-			{
-				$cmessage = $aj -> formtpa($cmessage, "public");
-				if($sql -> db_Select("chatbox", "*", "cb_message='$cmessage' AND cb_datestamp+84600>".time()))
-				{
-					$emessage = CHATBOX_L17;
-				} else 
-				{
-					$datestamp = time();
-					$ip = getip();
-					if(USER)
-					{
-						$nick = USERID.".".USERNAME;
-						$sql -> db_Update("user", "user_chats=user_chats+1, user_lastpost='".time()."' WHERE user_id='".USERID."' ");
-					} else if(!$nick)
-					{
-						$nick = "0.Anonymous";
-					} else {
-						if($sql -> db_Select("user", "*", "user_name='$nick' ")){
-							$emessage = CHATBOX_L1;
-						}else{
-							$nick = "0.".$aj -> formtpa($nick, "public");
-						}
-					}
-					if(!$emessage){
-						$cmessage = str_replace("<iframe", "&lt;iframe", $cmessage);
-						$sql -> db_Insert("chatbox", "0, '$nick', '$cmessage', '".time()."', '0' , '$ip' ");
-						clear_cache("chatbox");
-					}
-				}
-			}else{
-				$emessage = CHATBOX_L15;
-			}
-		}
-	}
-}
-
-$pref['cb_linkc'] = str_replace("e107_images/", e_IMAGE, $pref['cb_linkc']);
-if(!USER && !$pref['anon_post']){
-	if($pref['user_reg'])
-	{
-		$texta = "<div style='text-align:center'>".CHATBOX_L3."</div><br /><br />";
-	}
-} else 
-{
-	$texta =  "<div style='text-align:center'>".(e_QUERY ? "\n<form id='chatbox' method='post' action='".e_SELF."?".e_QUERY."'><p>" : "\n<form id='chatbox' method='post' action='".e_SELF."'><p>");
-	if(($pref['anon_post'] == "1" && USER == FALSE)){
-		$texta .= "\n<input class='tbox' type='text' name='nick' size='27' value='' maxlength='50' /><br />";
-	}
-	$texta .= "\n<textarea class='tbox' name='cmessage' cols='26' rows='5' style='overflow:hidden'></textarea>\n<br />\n<input class='button' type='submit' name='chat_submit' value='".CHATBOX_L4."' />\n<input class='button' type='reset' name='reset' value='".CHATBOX_L5."' />";
-		
-	if($pref['cb_emote']){
-		$texta .= " \n<input class='button' type ='button' style='cursor:hand; cursor:pointer' size='30' value='".CHATBOX_L14."' onclick='expandit(this)' />\n<span style='display:none;'>".emote()."\n</span>\n";
-	}
-	
-	$texta .="</p>\n</form>\n</div>\n";
-}
-
-if($emessage != ""){
-	$texta .= "<div style='text-align:center'><b>".$emessage."</b></div>";
-}
-
-if(!$text = retrieve_cache("chatbox")){
-
-	$chatbox_posts = $pref['chatbox_posts'];
-	global $nickstore;
-	if($sql -> db_Select("chatbox", "*", "ORDER BY cb_datestamp DESC LIMIT 0, ".$chatbox_posts, $mode="no_where")){
-		$obj2 = new convert;
-		$cb_wordwrap = $pref['cb_wordwrap'];
-		$sql2 = new db;
-		while(list($cb_id, $cb_nick, $cb_message, $cb_datestamp, $cb_blocked, $cb_ip) = $sql-> db_Fetch()){
-
-			// get available vars
-			$cb_nick = eregi_replace("[0-9]+\.", "", $cb_nick);
-			if($cb_nick == "Anonymous"){
-				$cuser_id = 0;
-			}else{
-				if($nickstore[$cb_nick]){
-					$cb_nick = "<a href='".e_BASE."user.php?id.".$nickstore[$cb_nick]."'>".$cb_nick."</a>";
-				}else{
-					if($sql2 -> db_Select("user", "*", "user_name='$cb_nick'")){
-						list($cuser_id, $cuser_name) = $sql2-> db_Fetch();
-						$nickstore[$cb_nick] = $cuser_id;
-						$cb_nick = "<a href='".e_BASE."user.php?id.".$cuser_id."'>".$cb_nick."</a>";
-					}else{
-						$cb_nick = $aj -> tpa($cb_nick);
-					}
-				}
-			}
-			$datestamp = $obj2->convert_date($cb_datestamp, "short");
-
-			$search[0] = "["; $search[1] = "]";
-			$replace[0] = "&lsqb;"; $replace[1] =  "&rsqb;";
-			$cb_message = str_replace($search, $replace, $cb_message);
-
-			if($pref['cb_linkreplace']){
-				$cb_message = " ".$cb_message;
-				$cb_message = preg_replace("#([\t\r\n ])([a-z0-9]+?){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1<a href="\2://\3">'.$pref['cb_linkc'].'</a>', $cb_message);
-				$cb_message = preg_replace("#([\t\r\n ])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1<a href="http://\2.\3">'.$pref['cb_linkc'].'</a>', $cb_message);
-				$cb_message = preg_replace("#([\n ])([a-z0-9\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $cb_message);
-			}
-
-			$cb_message = $aj -> tpa($cb_message);
-
-
-			if(!eregi("<a href|<img|&#", $cb_message)){
-				
-				$message_array = explode(" ", $cb_message);
-				for($i=0; $i<=(count($message_array)-1); $i++){
-					if(strlen($message_array[$i]) > $cb_wordwrap){
-						require_once(e_HANDLER."textparse/basic.php");
-            $etp = new e107_basicparse;
-            $message_array[$i] = wordwrap( $etp->unentity($message_array[$i]), $cb_wordwrap, "<br />", 1);
-					}
-				}
-				$cb_message = implode(" ",$message_array);
-			}
-
-			$replace[0] = "["; $replace[1] = "]";
-			$search[0] = "&lsqb;"; $search[1] =  "&rsqb;";
-			$cb_message = str_replace($search, $replace, $cb_message);
-			
-			global $CHATBOXSTYLE;
-			if(!$CHATBOXSTYLE){
-				// default chatbox style
-				$CHATBOXSTYLE = "<!-- chatbox -->\n<div class='spacer'>
-				<img src='".THEME."images/bullet2.gif' alt='' /> <b>{USERNAME}</b><br /><span class='smalltext'>{TIMEDATE}</span><br /><div class='smallblacktext'>{MESSAGE}</div></div><br />\n";
-			}
-
-			$search[0] = "/\{USERNAME\}(.*?)/si";
-			$replace[0] = $cb_nick;
-			$search[1] = "/\{TIMEDATE\}(.*?)/si";
-			$replace[1] = $datestamp;
-			$search[2] = "/\{MESSAGE\}(.*?)/si";
-			$replace[2] = ($cb_blocked ? CHATBOX_L6 : $cb_message);
-			
-			$text .= preg_replace($search, $replace, $CHATBOXSTYLE);
-//			$text .= $aj -> formtparev($str, "public");
-//			$text .= stripslashes($str);
-
-		}
-
-	}else{
-		$text .= "<span class='mediumtext'>".CHATBOX_L11."</span>";
-	}
-	$total_chats = $sql -> db_Count("chatbox");
-	if($total_chats > $chatbox_posts){
-		$text .= "<br /><div style='text-align:center'><a href='".e_BASE."chat.php'>".CHATBOX_L12."</a> (".$total_chats.")</div>";
-	}
-
-	set_cache("chatbox", $text);
-
-}
-if(ADMIN && getperms("C")){$text .= "<br />[ <a href='".e_ADMIN."chatbox.php'>".CHATBOX_L13."</a> ]";}
-$caption = (file_exists(THEME."images/chatbox_menu.png") ? "<img src='".THEME."images/chatbox_menu.png' alt='' /> ".CHATBOX_L2 : CHATBOX_L2);
-
-
-$text = ($pref['cb_layer'] ? $texta."<div style='border : 0; padding : 4px; width : auto; height : ".$pref['cb_layer_height']."px; overflow : auto; '>".$text."</div>" : $texta.$text);
-
-
-$ns -> tablerender($caption, $text);
-
-function emote(){
-	$sql = new db;
-	$sql -> db_Select("core", "*", "e107_name='emote'");
-	$row = $sql -> db_Fetch(); extract($row);
-	$emote = unserialize($e107_value);
-	$str="<br />";
-	$c=0;
-	while(list($code, $name) = @each($emote[$c])){
-		if(!$orig[$name]){
-			$code = htmlentities($code);
-			$str .= "\n<a href=\"javascript:caddtext(' $code')\"><img src=\"".e_IMAGE."emoticons/$name\" style=\"border:0; padding-top:2px;\" alt=\"\" /></a> ";
-			$orig[$name] = TRUE;
-		}
-		$c++;
-	}
-	return $str;
-}
-
-echo "
-<script type='text/javascript'>
-function caddtext(sc){
-	document.getElementById('chatbox').cmessage.value +=sc;
-}
-</script>";
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/chatbox_menu.php,v $
+|     $Revision: 1.65 $
+|     $Date: 2006/02/27 12:32:24 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+
+global $tp, $e107cache, $e_event, $e107, $pref, $footer_js, $PLUGINS_DIRECTORY;
+
+if($pref['cb_layer'] || isset($_POST['chatbox_ajax']))
+{
+	if(isset($_POST['chat_submit']))
+	{
+		include_once("../../class2.php");
+
+		//Normally the menu.sc file will auto-load the language file, this is needed in case
+		//ajax is turned on and the menu is not loaded from the menu.sc
+		@include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
+		@include_lan(e_PLUGIN."chatbox_menu/languages/English/English.php");
+	}
+	$footer_js[] = e_FILE_ABS.'e_ajax.js';
+}
+
+if(!defined("e_HANDLER")){ exit; }
+require_once(e_HANDLER."emote.php");
+
+$emessage='';
+if(isset($_POST['chat_submit']) && $_POST['cmessage'] != "")
+{
+	if(!USER && !$pref['anon_post'])
+	{
+		// disallow post
+	}
+	else
+	{
+		$nick = trim(preg_replace("#\[.*\]#si", "", $tp -> toDB($_POST['nick'])));
+
+		$cmessage = $_POST['cmessage'];
+		$cmessage = preg_replace("#\[.*?\](.*?)\[/.*?\]#s", "\\1", $cmessage);
+
+		$fp = new floodprotect;
+		if($fp -> flood("chatbox", "cb_datestamp"))
+		{
+			if((strlen(trim($cmessage)) < 1000) && trim($cmessage) != "")
+			{
+				$cmessage = $tp -> toDB($cmessage);
+				if($sql -> db_Select("chatbox", "*", "cb_message='$cmessage' AND cb_datestamp+84600>".time()))
+				{
+					$emessage = CHATBOX_L17;
+				}
+				else
+				{
+					$datestamp = time();
+					$ip = $e107->getip();
+					if(USER)
+					{
+						$nick = USERID.".".USERNAME;
+						$sql -> db_Update("user", "user_chats=user_chats+1, user_lastpost='".time()."' WHERE user_id='".USERID."' ");
+					}
+					else if(!$nick)
+					{
+						$nick = "0.Anonymous";
+					}
+					else
+					{
+						if($sql -> db_Select("user", "*", "user_name='$nick' ")){
+							$emessage = CHATBOX_L1;
+						}
+						else
+						{
+							$nick = "0.".$nick;
+						}
+					}
+					if(!$emessage)
+					{
+						$sql -> db_Insert("chatbox", "0, '$nick', '$cmessage', '".time()."', '0' , '$ip' ");
+						$edata_cb = array("cmessage" => $cmessage, "ip" => $ip);
+						$e_event -> trigger("cboxpost", $edata_cb);
+						$e107cache->clear("chatbox");
+					}
+				}
+			}
+			else
+			{
+				$emessage = CHATBOX_L15;
+			}
+		}
+		else
+		{
+			$emessage = CHATBOX_L19;
+		}
+	}
+}
+
+$pref['cb_linkc'] = str_replace("e107_images/", e_IMAGE, $pref['cb_linkc']);
+if(!USER && !$pref['anon_post']){
+	if($pref['user_reg'])
+	{
+		$texta = "<div style='text-align:center'>".CHATBOX_L3."</div><br /><br />";
+	}
+}
+else
+{
+	$cb_width = (defined("CBWIDTH") ? CBWIDTH : "100%");
+
+	if($pref['cb_layer'] == 2)
+	{
+		$texta =  "\n<form id='chatbox' action='".e_SELF."?".e_QUERY."'  method='post' onsubmit='return(false);'>
+		<div><input type='hidden' id='chatbox_ajax' value='1' /></div>
+		";
+	}
+	else
+	{
+		$texta =  (e_QUERY ? "\n<form id='chatbox' method='post' action='".e_SELF."?".e_QUERY."'>" : "\n<form id='chatbox' method='post' action='".e_SELF."'>");
+	}
+	$texta .= "<div style='text-align:center; width:100%'>";
+
+	if(($pref['anon_post'] == "1" && USER == FALSE))
+	{
+		$texta .= "\n<input class='tbox' type='text' id='nick' name='nick' value='' maxlength='50' style='width: ".$cb_width.";' /><br />";
+	}
+
+	if($pref['cb_layer'] == 2)
+	{
+
+		$oc = "onclick=\"javascript:sendInfo('".SITEURL.$PLUGINS_DIRECTORY."chatbox_menu/chatbox_menu.php', 'chatbox_posts', this.form);\"";
+	}
+	else
+	{
+		$oc = "";
+	}
+	$texta .= "
+	<textarea class='tbox chatbox' id='cmessage' name='cmessage' cols='20' rows='5' style='width:".$cb_width."; overflow: auto' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea>
+	<br />
+	<input class='button' type='submit' id='chat_submit' name='chat_submit' value='".CHATBOX_L4."' {$oc}/>
+	<input class='button' type='reset' name='reset' value='".CHATBOX_L5."' />";
+
+	if($pref['cb_emote'] && $pref['smiley_activate']){
+		$texta .= "
+		<input class='button' type ='button' style='cursor:hand; cursor:pointer' size='30' value='".CHATBOX_L14."' onclick=\"expandit('emote')\" />
+		<div style='display:none' id='emote'>".r_emote()."
+		</div>\n";
+	}
+
+	$texta .="</div>\n</form>\n";
+}
+
+if($emessage != ""){
+	$texta .= "<div style='text-align:center'><b>".$emessage."</b></div>";
+}
+
+if(!$text = $e107cache->retrieve("chatbox"))
+{
+	global $pref,$tp;
+	$pref['chatbox_posts'] = ($pref['chatbox_posts'] ? $pref['chatbox_posts'] : 10);
+	$chatbox_posts = $pref['chatbox_posts'];
+	if(!isset($pref['cb_mod']))
+	{
+		$pref['cb_mod'] = e_UC_ADMIN;
+	}
+	define("CB_MOD", check_class($pref['cb_mod']));
+
+	$qry = "
+	SELECT c.*, u.user_name FROM #chatbox AS c
+	LEFT JOIN #user AS u ON FLOOR(c.cb_nick) = u.user_id
+	ORDER BY c.cb_datestamp DESC LIMIT 0, ".intval($chatbox_posts);
+
+	if($sql -> db_Select_gen($qry))
+	{
+		$obj2 = new convert;
+		$cbpost = $sql -> db_getList();
+		foreach($cbpost as $cb)
+		{
+			// get available vars
+			list($cb_uid, $cb_nick) = explode(".", $cb['cb_nick'], 2);
+			if($cb['user_name'])
+			{
+				$cb_nick = "<a href='".e_BASE."user.php?id.{$cb_uid}'>{$cb['user_name']}</a>";
+			}
+			else
+			{
+				$cb_nick = $tp -> toHTML($cb_nick);
+			}
+
+			$datestamp = $obj2->convert_date($cb['cb_datestamp'], "short");
+			if(!$pref['cb_wordwrap']) { $pref['cb_wordwrap'] = 30; }
+			$emotes_active = $pref['cb_emote'] ? 'emotes_on' : 'emotes_off';
+
+			$cb_message = $tp -> toHTML($cb['cb_message'], FALSE, $emotes_active, $cb['cb_uid'], $pref['menu_wordwrap']);
+
+			$replace[0] = "["; $replace[1] = "]";
+			$search[0] = "&lsqb;"; $search[1] =  "&rsqb;";
+			$cb_message = str_replace($search, $replace, $cb_message);
+
+			global $CHATBOXSTYLE;
+			if(!$CHATBOXSTYLE)
+			{
+				$bullet = (defined("BULLET") ? "<img src='".THEME_ABS."images/".BULLET."' alt='' style='vertical-align: middle;' />" : "<img src='".THEME_ABS."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='vertical-align: middle;' />");
+				// default chatbox style
+				$CHATBOXSTYLE = "<!-- chatbox -->\n<div class='spacer'>
+				$bullet <b>{USERNAME}</b><br /><span class='smalltext'>{TIMEDATE}</span><br /><div class='smallblacktext'>{MESSAGE}</div></div><br />\n";
+			}
+
+			$search[0] = "/\{USERNAME\}(.*?)/si";
+			$replace[0] = $cb_nick;
+			$search[1] = "/\{TIMEDATE\}(.*?)/si";
+			$replace[1] = $datestamp;
+			$search[2] = "/\{MESSAGE\}(.*?)/si";
+			$replace[2] = ($cb['cb_blocked'] ? CHATBOX_L6 : $cb_message);
+
+			$text .= preg_replace($search, $replace, $CHATBOXSTYLE);
+
+		}
+	}
+	else
+	{
+		$text .= "<span class='mediumtext'>".CHATBOX_L11."</span>";
+	}
+	$total_chats = $sql -> db_Count("chatbox");
+	if($total_chats > $chatbox_posts || CB_MOD)
+	{
+		$text .= "<br /><div style='text-align:center'><a href='".e_PLUGIN."chatbox_menu/chat.php'>".(CB_MOD ? CHATBOX_L13 : CHATBOX_L12)."</a> (".$total_chats.")</div>";
+	}
+	$e107cache->set("chatbox", $text);
+}
+
+$caption = (file_exists(THEME."images/chatbox_menu.png") ? "<img src='".THEME_ABS."images/chatbox_menu.png' alt='' /> ".CHATBOX_L2 : CHATBOX_L2);
+
+if($pref['cb_layer'] == 1)
+{
+	$text = $texta."<div style='border : 0; padding : 4px; width : auto; height : ".$pref['cb_layer_height']."px; overflow : auto; '>".$text."</div>";
+	$ns -> tablerender($caption, $text, 'chatbox');
+}
+elseif($pref['cb_layer'] == 2 && isset($_POST['chat_submit']))
+{
+	$text = $texta.$text;
+	$text = str_replace(e_IMAGE, e_IMAGE_ABS, $text);
+	echo $text;
+}
+else
+{
+	$text = $texta.$text;
+	if($pref['cb_layer'] == 2)
+	{
+		$text = "<div id='chatbox_posts'>".$text."</div>";
+	}
+	$ns -> tablerender($caption, $text, 'chatbox');
+}
+
+//$text = ($pref['cb_layer'] ? $texta."<div style='border : 0; padding : 4px; width : auto; height : ".$pref['cb_layer_height']."px; overflow : auto; '>".$text."</div>" : $texta.$text);
+//if(ADMIN && getperms("C")){$text .= "<br /><div style='text-align: center'>[ <a href='".e_PLUGIN."chatbox_menu/admin_chatbox.php'>".CHATBOX_L13."</a> ]</div>";}
+//$ns -> tablerender($caption, $text, 'chatbox');
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/chatbox_sql.php 75/e107_plugins/chatbox_menu/chatbox_sql.php
--- 6171/e107_plugins/chatbox_menu/chatbox_sql.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/chatbox_sql.php	2005-03-29 11:57:17.000000000 -0600
@@ -0,0 +1,9 @@
+CREATE TABLE chatbox (
+	cb_id int(10) unsigned NOT NULL auto_increment,
+	cb_nick varchar(30) NOT NULL default '',
+	cb_message text NOT NULL,
+	cb_datestamp int(10) unsigned NOT NULL default '0',
+	cb_blocked tinyint(3) unsigned NOT NULL default '0',
+	cb_ip varchar(15) NOT NULL default '',
+	PRIMARY KEY  (cb_id)
+	) TYPE=MyISAM;
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/chat.php 75/e107_plugins/chatbox_menu/chat.php
--- 6171/e107_plugins/chatbox_menu/chat.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/chat.php	2006-01-19 18:26:53.000000000 -0600
@@ -0,0 +1,168 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/chat.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2006/01/20 00:26:53 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if (file_exists(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php")) {
+	include_once(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
+} else {
+	include_once(e_PLUGIN."chatbox_menu/languages/English/English.php");
+}
+require_once(HEADERF);
+
+$sql->db_Select("menus", "*", "menu_name='chatbox_menu'");
+$row = $sql->db_Fetch();
+
+if (!check_class($row['menu_class'])) {
+	$ns->tablerender(CHATBOX_L23, "<div style='text-align:center'>".CHATBOX_L24."</div>");
+	require_once(FOOTERF);
+	exit;
+}
+
+if(!isset($pref['cb_mod']))
+{
+	$pref['cb_mod'] = e_UC_ADMIN;
+}
+define("CB_MOD", check_class($pref['cb_mod']));
+
+if($_POST['moderate'] && CB_MOD)
+{
+	if(isset($_POST['block']))
+	{
+		foreach(array_keys($_POST['block']) as $k){ $kk[] = intval($k); }
+		$blocklist = implode(",", $kk);
+		$sql->db_Select_gen("UPDATE #chatbox SET cb_blocked=1 WHERE cb_id IN ({$blocklist})");
+	}
+
+	if(isset($_POST['unblock']))
+	{
+		foreach(array_keys($_POST['unblock']) as $k){ $kk[] = intval($k); }
+		$unblocklist = implode(",", $kk);
+		$sql->db_Select_gen("UPDATE #chatbox SET cb_blocked=0 WHERE cb_id IN ({$unblocklist})");
+	}
+	
+	if(isset($_POST['delete']))
+	{
+		$deletelist = implode(",", array_keys($_POST['delete']));
+		$sql -> db_Select_gen("SELECT c.cb_id, u.user_id FROM #chatbox AS c 
+		LEFT JOIN #user AS u ON FLOOR(c.cb_nick) = u.user_id 
+		WHERE c.cb_id IN (".$deletelist.")");
+		$rowlist = $sql -> db_getList();
+		foreach ($rowlist as $row) {
+			$sql -> db_Select_gen("UPDATE #user SET user_chats=user_chats-1 where user_id = ".intval($row['user_id']));
+		}
+		$sql -> db_Select_gen("DELETE FROM #chatbox WHERE cb_id IN ({$deletelist})");
+	}
+	$e107cache->clear("chatbox");
+	$message = CHATBOX_L18;
+}
+
+// when coming from search.php
+if (strstr(e_QUERY, "fs")) {
+	$cgtm = str_replace(".fs", "", e_QUERY);
+	$fs = TRUE;
+}
+// end search
+
+if (e_QUERY ? $from = e_QUERY : $from = 0);
+
+$chat_total = $sql->db_Count("chatbox");
+
+$qry_where = (CB_MOD ? "1" : "cb_blocked=0");
+
+// when coming from search.php calculate page number
+if ($fs) {
+	$page_count = 0;
+	$row_count = 0;
+	$sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC");
+	while ($row = $sql -> db_Fetch()) {
+		if ($row['cb_id'] == $cgtm) {
+			$from = $page_count;
+			break;
+		}
+		$row_count++;
+		if ($row_count == 30) {
+			$row_count = 0;
+			$page_count += 30;
+		}
+	}
+}
+// end search
+
+$sql->db_Select("chatbox", "*", "{$qry_where} ORDER BY cb_datestamp DESC LIMIT ".intval($from).", 30");
+$obj2 = new convert;
+
+$chatList = $sql->db_getList();
+foreach ($chatList as $row)
+{
+	$CHAT_TABLE_DATESTAMP = $obj2->convert_date($row['cb_datestamp'], "long");
+	$CHAT_TABLE_NICK = preg_replace("/[0-9]+\./", "", $row['cb_nick']);
+	$cb_message = $tp->toHTML($row['cb_message']);
+	if($row['cb_blocked'])
+	{
+		$cb_message .= "<br />".CHATBOX_L25;
+	}
+	if(CB_MOD)
+	{
+		$cb_message .= "<br /><input type='checkbox' name='delete[{$row['cb_id']}]' value='1' />".CHATBOX_L10;
+		if($row['cb_blocked'])
+		{
+			$cb_message .= "&nbsp;&nbsp;&nbsp;<input type='checkbox' name='unblock[{$row['cb_id']}]' value='1' />".CHATBOX_L7;
+		}
+		else
+		{
+			$cb_message .= "&nbsp;&nbsp;&nbsp;<input type='checkbox' name='block[{$row['cb_id']}]' value='1' />".CHATBOX_L9;
+		}
+	}
+	
+	$CHAT_TABLE_MESSAGE = $cb_message;
+	$CHAT_TABLE_FLAG = ($flag ? "forumheader3" : "forumheader4");
+
+	if (!$CHAT_TABLE) {
+		if (file_exists(THEME."chat_template.php"))
+		{
+			require_once(THEME."chat_template.php");
+		}
+		else
+		{
+			require_once(e_PLUGIN."chatbox_menu/chat_template.php");
+		}
+	}
+	$textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $CHAT_TABLE);
+	$flag = (!$flag ? TRUE : FALSE);
+}
+
+$textstart = preg_replace("/\{(.*?)\}/e", '$\1', $CHAT_TABLE_START);
+$textend = preg_replace("/\{(.*?)\}/e", '$\1', $CHAT_TABLE_END);
+$text = $textstart.$textstring.$textend;
+if(CB_MOD)
+{
+	$text = "<form method='post' action='".e_SELF."'>".$text."<input type='submit' class='button' name='moderate' value='".CHATBOX_L13."' /></form>";
+}
+if($message)
+{
+	$ns->tablerender("", $message);
+}
+	
+$ns->tablerender(CHATBOX_L20, $text);
+
+
+require_once(e_HANDLER."np_class.php");
+$ix = new nextprev("chat.php", $from, 30, $chat_total, CHATBOX_L21);
+
+require_once(FOOTERF);
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/chat_template.php 75/e107_plugins/chatbox_menu/chat_template.php
--- 6171/e107_plugins/chatbox_menu/chat_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/chat_template.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,27 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### CHAT TABLE -----------------------------------------------------------------------------
+if(!$CHAT_TABLE_START){
+		$CHAT_TABLE_START = "
+		<br /><table style='width:100%'><tr><td>";
+}
+if(!$CHAT_TABLE){
+		$CHAT_TABLE = "\n
+		<div class='spacer'>
+			<div class='{CHAT_TABLE_FLAG}'>
+				<img src='".THEME."images/bullet2.gif' alt='bullet' /> \n<b>{CHAT_TABLE_NICK}</b> ".CHATBOX_L22." {CHAT_TABLE_DATESTAMP}<br />
+				<div class='defaulttext'><i>{CHAT_TABLE_MESSAGE}</i></div>\n
+			</div>
+		</div>\n";
+
+}
+if(!$CHAT_TABLE_END){
+		$CHAT_TABLE_END = "
+		</td></tr></table>";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/e_list.php 75/e107_plugins/chatbox_menu/e_list.php
--- 6171/e107_plugins/chatbox_menu/e_list.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/e_list.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,41 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+	if(!$chatbox_install = $sql -> db_Select("plugin", "*", "plugin_path = 'chatbox_menu' AND plugin_installflag = '1' ")){
+		return;
+	}
+
+	$LIST_CAPTION = $arr[0];
+	$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+
+	if($mode == "new_page" || $mode == "new_menu" ){
+		$lvisit = $this -> getlvisit();
+		$qry = "cb_datestamp>".$lvisit;
+	}else{
+		$qry = "cb_id != '0' ";
+	}
+	$qry .= " ORDER BY cb_datestamp DESC LIMIT 0,".intval($arr[7]);
+
+	$bullet = $this -> getBullet($arr[6], $mode);
+
+	if(!$chatbox_posts = $sql -> db_Select("chatbox", "*", $qry)){ 
+		$LIST_DATA = LIST_CHATBOX_2;
+	}else{
+		while($row = $sql -> db_Fetch()) {
+
+			$cb_id		= substr($row['cb_nick'] , 0, strpos($row['cb_nick'] , "."));
+			$cb_nick	= substr($row['cb_nick'] , (strpos($row['cb_nick'] , ".")+1));
+			$cb_message	= ($row['cb_blocked'] ? CHATBOX_L6 : str_replace("<br />", " ", $tp -> toHTML($row['cb_message'])));
+			$rowheading	= $this -> parse_heading($cb_message, $mode);
+			$ICON		= $bullet;
+			$HEADING	= $rowheading;
+			$AUTHOR		= ($arr[3] ? ($cb_id != 0 ? "<a href='".e_BASE."user.php?id.$cb_id'>".$cb_nick."</a>" : $cb_nick) : "");
+			$CATEGORY	= "";
+			$DATE		= ($arr[5] ? ($row['cb_datestamp'] ? $this -> getListDate($row['cb_datestamp'], $mode) : "") : "");
+			$INFO		= "";
+			$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+		}
+	}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/e_notify.php 75/e107_plugins/chatbox_menu/e_notify.php
--- 6171/e107_plugins/chatbox_menu/e_notify.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/e_notify.php	2006-02-12 13:14:44.000000000 -0600
@@ -0,0 +1,40 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/e_notify.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/02/12 19:14:44 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if(defined('ADMIN_PAGE') && ADMIN_PAGE === true)
+{
+	include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
+	$config_category = NT_LAN_CB_1;
+	$config_events = array('cboxpost' => NT_LAN_CB_2);
+}
+
+
+if (!function_exists('notify_cboxpost')) {
+	function notify_cboxpost($data) {
+		global $nt;
+		include_lan(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/".e_LANGUAGE.".php");
+		$message = NT_LAN_CB_3.': '.USERNAME.' ('.NT_LAN_CB_4.': '.$data['ip'].' )<br />';
+		$message .= NT_LAN_CB_5.':<br />'.$data['cmessage'].'<br /><br />';
+		$nt -> send('cboxpost', NT_LAN_CB_6, $message);
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/e_search.php 75/e107_plugins/chatbox_menu/e_search.php
--- 6171/e107_plugins/chatbox_menu/e_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/e_search.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,11 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+if (file_exists(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/lan_chatbox_search.php")) {
+	include_once(e_PLUGIN."chatbox_menu/languages/".e_LANGUAGE."/lan_chatbox_search.php");
+} else {
+	include_once(e_PLUGIN."chatbox_menu/languages/English/lan_chatbox_search.php");
+}
+
+$search_info[] = array('sfile' => e_PLUGIN.'chatbox_menu/search/search_parser.php', 'qtype' => CB_SCH_LAN_1, 'refpage' => 'chat.php', 'advanced' => e_PLUGIN.'chatbox_menu/search/search_advanced.php');
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/e_status.php 75/e107_plugins/chatbox_menu/e_status.php
--- 6171/e107_plugins/chatbox_menu/e_status.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/e_status.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,6 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+$chatbox_posts = $sql -> db_Count("chatbox");
+$text .= "<div style='padding-bottom: 2px;'><img src='".e_PLUGIN."chatbox_menu/images/chatbox_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ".ADLAN_115.": ".$chatbox_posts."</div>";
+?>
\ No newline at end of file
Files 6171/e107_plugins/chatbox_menu/images/blocked.png and 75/e107_plugins/chatbox_menu/images/blocked.png differ
Files 6171/e107_plugins/chatbox_menu/images/chatbox_16.png and 75/e107_plugins/chatbox_menu/images/chatbox_16.png differ
Files 6171/e107_plugins/chatbox_menu/images/chatbox_32.png and 75/e107_plugins/chatbox_menu/images/chatbox_32.png differ
diff -ruN 6171/e107_plugins/chatbox_menu/languages/English/English_config.php 75/e107_plugins/chatbox_menu/languages/English/English_config.php
--- 6171/e107_plugins/chatbox_menu/languages/English/English_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/languages/English/English_config.php	2005-12-05 19:06:09.000000000 -0600
@@ -0,0 +1,56 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/languages/English/English_config.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/06 01:06:09 $
+|     $Author: mcfly_e107 $
+|     Encoding:
++----------------------------------------------------------------------------+
+*/
+define("CHBLAN_1", "Chatbox settings updated.");
+define("CHBLAN_2", "Moderated.");
+define("CHBLAN_3", "No chatbox posts yet.");
+define("CHBLAN_4", "Member");
+define("CHBLAN_5", "Guest");
+define("CHBLAN_6", "unblock");
+define("CHBLAN_7", "block");
+define("CHBLAN_8", "delete");
+define("CHBLAN_9", "Moderate Chatbox");
+define("CHBLAN_10", "Moderate posts");
+define("CHBLAN_11", "Chatbox posts to display");
+define("CHBLAN_12", "amount of posts displayed in chatbox");
+define("CHBLAN_13", "Replace links");
+define("CHBLAN_14", "if ticked, posted links will be replaced by text entered in box below");
+define("CHBLAN_15", "Replace string if activated");
+define("CHBLAN_16", "links will be replaced by this string");
+define("CHBLAN_17", "Wordwrap count");
+define("CHBLAN_18", "words longer than the number you set here will be wrapped");
+define("CHBLAN_19", "Update Chatbox Settings");
+define("CHBLAN_20", "Chatbox Settings");
+define("CHBLAN_21", "Prune");
+define("CHBLAN_22", "Delete posts older than a certain time period");
+define("CHBLAN_23", "Delete posts older than ");
+
+define("CHBLAN_24", "One day");
+define("CHBLAN_25", "One week");
+define("CHBLAN_26", "One month");
+define("CHBLAN_27", "- Delete all posts -");
+define("CHBLAN_28", "Chatbox pruned.");
+
+define("CHBLAN_29", "Display chatbox inside scrolling layer");
+define("CHBLAN_30", "Layer height");
+define("CHBLAN_31", "Show emoticons");
+define("CHBLAN_32", "Moderator userclass");
+
+define("CHBLAN_33", "User counts recalculated");
+define("CHBLAN_34", "Recalculate user post counts");
+define("CHBLAN_35", "Recalculate");
+
+define("CHBLAN_36", "Chatbox Display options");
+define("CHBLAN_37", "Normal chatbox");
+define("CHBLAN_38", "Use javascript code to update posts dynamically (AJAX)");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/languages/English/English.php 75/e107_plugins/chatbox_menu/languages/English/English.php
--- 6171/e107_plugins/chatbox_menu/languages/English/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/languages/English/English.php	2005-10-17 23:42:12.000000000 -0500
@@ -0,0 +1,55 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/languages/English/English.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/10/18 04:42:12 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("CHATBOX_L1", "Unable to accept post as that username is registered - if it is your username please login to post.");
+define("CHATBOX_L2", "Chatbox");
+define("CHATBOX_L3", "You must be logged in to post comments on this site - please either log in or if you are not registered click <a href='".e_BASE."signup.php'>here</a> to signup");
+define("CHATBOX_L4", "Submit");
+define("CHATBOX_L5", "Reset");
+define("CHATBOX_L6", "[blocked by admin]");
+define("CHATBOX_L7", "Unblock");
+define("CHATBOX_L8", "Info");
+define("CHATBOX_L9", "Block");
+define("CHATBOX_L10", "Delete");
+define("CHATBOX_L11", "No messages yet.");
+define("CHATBOX_L12", "View all posts");
+define("CHATBOX_L13", "moderate chatbox");
+define("CHATBOX_L14", "Emotes");
+define("CHATBOX_L15", "Post too long, or empty post submitted");
+define("CHATBOX_L16", "Anonymous");
+define("CHATBOX_L17", "Duplicate post");
+define("CHATBOX_L18", "Chatbox messages moderated");
+define("CHATBOX_L19", "You may only post once every ".FLOODTIMEOUT." seconds");
+
+define("CHATBOX_L20", "Chatbox (all posts)");
+define("CHATBOX_L21", "Chat Posts");
+define("CHATBOX_L22", "on");
+define("CHATBOX_L23", "Error!");
+define("CHATBOX_L24", "You do not have the correct permissions to view this page.");
+define("CHATBOX_L25", "[ this post has been blocked by admin ]");
+
+// Notify
+define("NT_LAN_CB_1", "Chatbox Events");
+define("NT_LAN_CB_2", "Message posted");
+define("NT_LAN_CB_3", "Posted by");
+define("NT_LAN_CB_4", "IP Address");
+define("NT_LAN_CB_5", "Message");
+define("NT_LAN_CB_6", "Chatbox Message Posted");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/languages/English/lan_chatbox_search.php 75/e107_plugins/chatbox_menu/languages/English/lan_chatbox_search.php
--- 6171/e107_plugins/chatbox_menu/languages/English/lan_chatbox_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/languages/English/lan_chatbox_search.php	2005-06-19 04:12:53.000000000 -0500
@@ -0,0 +1,15 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/languages/English/lan_chatbox_search.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/06/19 09:12:53 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("CB_SCH_LAN_1", "Chatbox");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/languages/English.php 75/e107_plugins/chatbox_menu/languages/English.php
--- 6171/e107_plugins/chatbox_menu/languages/English.php	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,33 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("CHATBOX_L1", "Unable to accept post as that username is registered - if it is your username please login to post.");
-define("CHATBOX_L2", "Chatbox");
-define("CHATBOX_L3", "You must be logged in to post comments on this site - please either log in or if you are not registered click <a href='".e_BASE."signup.php'>here</a> to signup");
-define("CHATBOX_L4", "Submit");
-define("CHATBOX_L5", "Reset");
-define("CHATBOX_L6", "[blocked by admin]");
-define("CHATBOX_L7", "Unblock");
-define("CHATBOX_L8", "Info");
-define("CHATBOX_L9", "Block");
-define("CHATBOX_L10", "Delete");
-define("CHATBOX_L11", "No messages yet.");
-define("CHATBOX_L12", "View all posts");
-define("CHATBOX_L13", "moderate chatbox");
-define("CHATBOX_L14", "Emotes");
-define("CHATBOX_L15", "Post too long, or empty post submitted");
-define("CHATBOX_L16", "Anonymous");
-define("CHATBOX_L17", "Duplicate post");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/plugin.php 75/e107_plugins/chatbox_menu/plugin.php
--- 6171/e107_plugins/chatbox_menu/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/plugin.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,128 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/plugin.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/01/05 09:06:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = "Chatbox";
+$eplug_version = "1.0";
+$eplug_author = "e107";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = "Chatbox Menu";
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";
+$eplug_status = TRUE;
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "chatbox_menu";
+
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "chatbox_menu";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_chatbox.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/chatbox_32.png";
+$eplug_icon_small = $eplug_folder."/images/chatbox_16.png";
+$eplug_caption = "Configure Chatbox";
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array(
+	'chatbox_posts' => '10',
+	'cb_linkc' => ' -link- ',
+	'cb_wordwrap' => '20',
+	'cb_linkreplace' => '1',
+	'cb_layer' => '0',
+	'cb_layer_height' => '200',
+	'cb_emote' => '0',
+	'cb_mod' => e_UC_ADMIN
+);
+
+
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array(
+	"chatbox"
+);
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+	"CREATE TABLE ".MPREFIX."chatbox (
+	cb_id int(10) unsigned NOT NULL auto_increment,
+	cb_nick varchar(30) NOT NULL default '',
+	cb_message text NOT NULL,
+	cb_datestamp int(10) unsigned NOT NULL default '0',
+	cb_blocked tinyint(3) unsigned NOT NULL default '0',
+	cb_ip varchar(15) NOT NULL default '',
+	PRIMARY KEY  (cb_id)
+	) TYPE=MyISAM;"
+);
+
+$eplug_rss['chatbox'] = array(
+	"id" => "chatbox",
+	"author" => "cb_nick",
+	"link" => $eplug_folder."/chat.php?#",
+	"linkid" => "cb_id",
+	"title" => "",
+	"description" => "cb_message",
+	"query" => "SELECT * FROM #chatbox WHERE cb_blocked=0 ORDER BY cb_datestamp DESC LIMIT 0, 9",
+	"category" => "1",
+	"datestamp" => "cb_datestamp",
+	"enc_url" => "0",
+	"enc_leng" => "0",
+	"enc_type" => "0"
+);
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = '';
+$eplug_link_url = '';
+
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = "Chatbox has successfully installed. To configure, click on the link on the admin front page.";
+
+
+// upgrading ... //
+
+$upgrade_add_prefs = "";
+
+$upgrade_remove_prefs = "";
+
+$upgrade_alter_tables = "";
+
+$eplug_upgrade_done = "";
+
+if (!function_exists('chatbox_menu_uninstall')) {
+	function chatbox_menu_uninstall() {
+		global $sql;
+		$sql -> db_Update("user", "user_chats='0'");
+	}
+}
+
+if (!function_exists('chatbox_menu_install')) {
+	function chatbox_menu_install() {
+		global $sql;
+		$sql -> db_Update("user", "user_chats='0'");
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/search/search_advanced.php 75/e107_plugins/chatbox_menu/search/search_advanced.php
--- 6171/e107_plugins/chatbox_menu/search/search_advanced.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/search/search_advanced.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,28 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/search/search_advanced.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:43 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$advanced['date']['type'] = 'date';
+$advanced['date']['text'] = LAN_SEARCH_50.':';
+
+$advanced['author']['type'] = 'author';
+$advanced['author']['text'] = LAN_SEARCH_61.':';
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/chatbox_menu/search/search_parser.php 75/e107_plugins/chatbox_menu/search/search_parser.php
--- 6171/e107_plugins/chatbox_menu/search/search_parser.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/chatbox_menu/search/search_parser.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,57 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/chatbox_menu/search/search_parser.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/01/05 09:06:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$cb_count =  $sql -> db_Count('chatbox');
+
+// advanced 
+$advanced_where = "";
+if (isset($_GET['time']) && is_numeric($_GET['time'])) {
+	$advanced_where .= " cb_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
+}
+
+if (isset($_GET['author']) && $_GET['author'] != '') {
+	$advanced_where .= " cb_nick LIKE '%".$tp -> toDB($_GET['author'])."%' AND";
+}
+
+// basic
+$return_fields = 'cb_id, cb_nick, cb_message, cb_datestamp';
+$search_fields = array('cb_nick', 'cb_message');
+$weights = array('1', '1');
+$no_results = LAN_198;
+$where = $advanced_where;
+$order = array('cb_datestamp' => DESC);
+
+$ps = $sch -> parsesearch('chatbox', $return_fields, $search_fields, $weights, 'search_chatbox', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_chatbox($row) {
+	global $con, $cb_count;
+	preg_match("/([0-9]+)\.(.*)/", $row['cb_nick'], $user);
+	$res['link'] = e_PLUGIN."chatbox_menu/chat.php?".$row['cb_id'].".fs";
+	$res['pre_title'] = LAN_SEARCH_7;
+	$res['title'] = $user[2];
+	$res['summary'] = $row['cb_message'];
+	$res['detail'] = $con -> convert_date($row['cb_datestamp'], "long");
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/clock_menu/clock.js 75/e107_plugins/clock_menu/clock.js
--- 6171/e107_plugins/clock_menu/clock.js	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/clock_menu/clock.js	2004-10-07 06:09:57.000000000 -0500
@@ -1,60 +1,70 @@
-<!--
-
-function tick() {
-  var hours, minutes, seconds, ap;
-  var intHours, intMinutes, intSeconds;  var today;
-  today = new Date();
-  intDay = today.getDay();
-  intDate = today.getDate();
-  intMonth = today.getMonth();
-  intYear = today.getYear();
-  intHours = today.getHours();
-  intMinutes = today.getMinutes();
-  intSeconds = today.getSeconds();
-  timeString = DayNam[intDay]+" "+intDate;
-  if (intDate == 1 || intDate == 21 || intDate == 31) {
-    timeString= timeString + "st ";
-  } else if (intDate == 2 || intDate == 22) {
-    timeString= timeString + "nd ";
-  } else if (intDate == 3 || intDate == 23) {
-    timeString= timeString + "rd ";
-  } else {
-    timeString = timeString + "th ";
-  } 
-  if (intYear < 2000){
-	intYear += 1900;
-  }
-  timeString = timeString+" of "+MnthNam[intMonth]+" "+intYear;
-  if (intHours == 0) {
-     hours = "12:";
-     ap = "am.";
-  } else if (intHours < 12) { 
-     hours = intHours+":";
-     ap = "am.";
-  } else if (intHours == 12) {
-     hours = "12:";
-     ap = "pm.";
-  } else {
-     intHours = intHours - 12
-     hours = intHours + ":";
-     ap = "pm.";
-  }
-  if (intMinutes < 10) {
-     minutes = "0"+intMinutes;
-  } else {
-     minutes = intMinutes;
-  }
-  if (intSeconds < 10) {
-     seconds = ":0"+intSeconds;
-  } else {
-     seconds = ":"+intSeconds;
-  }
-  timeString = (document.all)? timeString+", "+hours+minutes+seconds+" "+ap:timeString+" "+hours+minutes+" "+ap;
-  var clock = (document.all) ? document.all("Clock") : document.getElementById("Clock");
-  clock.innerHTML = timeString;
-  (document.all)?window.setTimeout("tick();", 1000):window.setTimeout("tick();", 6000);
-}
-
-tick();
-
+<!--
+
+function tick(e107_datepref,e107_dateformat,e107_datesuff1,e107_datesuff2,e107_datesuff3,e107_datesuff4) {
+  if(e107_datepref=='undefined'){e107_datepref = '';}
+  var hours, minutes, seconds, ap;
+  var intHours, intMinutes, intSeconds;  var today;
+  today = new Date();
+  intDay = today.getDay();
+  intDate = today.getDate();
+  intMonth = today.getMonth();
+  intYear = today.getYear();
+  intHours = today.getHours();
+  intMinutes = today.getMinutes();
+  intSeconds = today.getSeconds();
+  timeString = DayNam[intDay]+" "+e107_datepref+" "+intDate;
+  if (intDate == 1 || intDate == 21 || intDate == 31) {
+    timeString= timeString + e107_datesuff1 + " ";
+  } else if (intDate == 2 || intDate == 22) {
+    timeString= timeString  + e107_datesuff2 + " ";
+  } else if (intDate == 3 || intDate == 23) {
+    timeString= timeString  + e107_datesuff3 + " ";
+  } else {
+    timeString = timeString  + e107_datesuff4 + " ";
+  } 
+  if (intYear < 2000){
+	intYear += 1900;
+  }
+  timeString = timeString+" "+MnthNam[intMonth]+" "+intYear;
+  if(e107_dateformat == 1){
+    if (intHours == 0) {
+       hours = "12:";
+       ap = "am.";
+    } else if (intHours < 12) { 
+       hours = intHours+":";
+       ap = "am.";
+    } else if (intHours == 12) {
+       hours = "12:";
+       ap = "pm.";
+    } else {
+       intHours = intHours - 12
+       hours = intHours + ":";
+       ap = "pm.";
+    }
+  }else{
+    if (intHours < 10) {
+       hours = "0" + intHours + ":";
+    } else {
+       hours = intHours + ":";
+    }
+    ap = '';
+  }
+  if (intMinutes < 10) {
+     minutes = "0"+intMinutes;
+  } else {
+     minutes = intMinutes;
+  }
+  if (intSeconds < 10) {
+     seconds = ":0"+intSeconds;
+  } else {
+     seconds = ":"+intSeconds;
+  }
+  timeString = (document.all)? timeString+", "+hours+minutes+seconds+" "+ap:timeString+" "+hours+minutes+" "+ap;
+  var clock = (document.all) ? document.all("Clock") : document.getElementById("Clock");
+  clock.innerHTML = timeString;
+  (document.all)?window.setTimeout("tick('"+e107_datepref+"','"+e107_dateformat+"','"+e107_datesuff1+"','"+e107_datesuff2+"','"+e107_datesuff3+"','"+e107_datesuff4+"');", 1000):window.setTimeout("tick('"+e107_datepref+"','"+e107_dateformat+"','"+e107_datesuff1+"','"+e107_datesuff2+"','"+e107_datesuff3+"','"+e107_datesuff4+"');", 6000);
+}
+
+////tick();
+
 //-->
\ No newline at end of file
diff -ruN 6171/e107_plugins/clock_menu/clock_menu.php 75/e107_plugins/clock_menu/clock_menu.php
--- 6171/e107_plugins/clock_menu/clock_menu.php	2004-04-27 20:29:40.000000000 -0500
+++ 75/e107_plugins/clock_menu/clock_menu.php	2005-12-14 13:28:43.000000000 -0600
@@ -1,40 +1,65 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 Clock Menu
-|	/clock_menu.php
-|
-|	Compatible with the e107 content management system
-|		http://e107.org
-|	
-|	Originally written by jalist, modified for greater 
-|	detail and cross browser compatiblity by Caveman
-|	Last modified 19:11 08/04/2003
-|	
-|	Works with Mozilla 1.x, NS6, NS7, IE5, IE5.5, Opera 7
-|	
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-if(!defined("e_HTTP")){exit;}
-$text = "\n\n<!-- ### clock ### //-->\n<div id='Clock'>&nbsp;</div>\n";
-if(!$clock_flat){
-	$ns -> tablerender($menu_pref['clock_caption'], "<div style='text-align:center'>".$text."</div>");
-}else{
-	echo $text;
-}
-
-?>
-<script type="text/javascript">
-<!--
-var DayNam = new Array(
-"<?php echo isset($LAN_407)?$LAN_407:"Sunday"; ?>","<?php echo isset($LAN_401)?$LAN_401:"Monday"; ?>","<?php echo isset($LAN_402)?$LAN_402:"Tuesday"; ?>","<?php echo isset($LAN_403)?$LAN_403:"Wednesday"; ?>","<?php echo isset($LAN_404)?$LAN_404:"Thursday"; ?>","<?php echo isset($LAN_405)?$LAN_405:"Friday"; ?>","<?php echo isset($LAN_406)?$LAN_406:"Saturday"; ?>");
-var MnthNam = new Array(
-"<?php echo isset($LAN_411)?$LAN_411:"January"; ?>","<?php echo isset($LAN_412)?$LAN_412:"February"; ?>","<?php echo isset($LAN_413)?$LAN_413:"March"; ?>","<?php echo isset($LAN_414)?$LAN_414:"April"; ?>","<?php echo isset($LAN_415)?$LAN_415:"May"; ?>","<?php echo isset($LAN_416)?$LAN_416:"June"; ?>","<?php echo isset($LAN_417)?$LAN_417:"July"; ?>","<?php echo isset($LAN_418)?$LAN_418:"August"; ?>","<?php echo isset($LAN_419)?$LAN_419:"September"; ?>","<?php echo isset($LAN_420)?$LAN_420:"October"; ?>","<?php echo isset($LAN_421)?$LAN_421:"November"; ?>","<?php echo isset($LAN_422)?$LAN_422:"December"; ?>");
-//-->
-</script>
-<?php
-echo "<script type='text/javascript' src='".e_PLUGIN."clock_menu/clock.js'></script>\n<!-- ### end clock ### //-->\n\n";
-
+<?php
+/*
++---------------------------------------------------------------+
+| e107 Clock Menu
+| /clock_menu.php
+|
+| Compatible with the e107 content management system
+|  http://e107.org
+|
+| Originally written by jalist, modified for greater
+| detail and cross browser compatiblity by Caveman
+| Last modified 19:11 08/04/2003
+|
+| Works with Mozilla 1.x, NS6, NS7, IE5, IE5.5, Opera 7
+|
+| Released under the terms and conditions of the
+| GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/clock_menu/clock_menu.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2005/12/14 19:28:43 $
+|     $Author: sweetas $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $menu_pref;
+$indexArray = array('clock_dateprefix','clock_format','clock_datesuffix1','clock_datesuffix2','clock_datesuffix3','clock_datesuffix4');
+foreach($indexArray as $ind)
+{
+	if(!isset($menu_pref[$ind]))
+	{
+		$menu_pref[$ind]='';
+	}
+}
+
+$ec_dir = e_PLUGIN."clock_menu/";
+$lan_file = $ec_dir."languages/".e_LANGUAGE.".php";
+e107_include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."clock_menu/languages/English.php");
+if (!defined("e_HTTP")) {
+	exit;
+}
+$text = "\n\n<!-- ### clock ### //-->\n<div id='Clock'>&nbsp;</div>\n";
+if (!isset($clock_flat) || !$clock_flat) {
+	$ns->tablerender($menu_pref['clock_caption'], "<div style='text-align:center'>".$text."</div>", 'clock');
+} else {
+	echo $text;
+}
+?>
+<script type="text/javascript">
+<!--
+var DayNam = new Array(
+"<?php echo isset($LAN_407)?$LAN_407:"".CLOCK_MENU_L11; ?>","<?php echo isset($LAN_401)?$LAN_401:"".CLOCK_MENU_L5; ?>","<?php echo isset($LAN_402)?$LAN_402:"".CLOCK_MENU_L6; ?>","<?php echo isset($LAN_403)?$LAN_403:"".CLOCK_MENU_L7; ?>","<?php echo isset($LAN_404)?$LAN_404:"".CLOCK_MENU_L8; ?>","<?php echo isset($LAN_405)?$LAN_405:"".CLOCK_MENU_L9; ?>","<?php echo isset($LAN_406)?$LAN_406:"".CLOCK_MENU_L10; ?>");
+var MnthNam = new Array(
+"<?php echo isset($LAN_411)?$LAN_411:"".CLOCK_MENU_L12; ?>","<?php echo isset($LAN_412)?$LAN_412:"".CLOCK_MENU_L13; ?>","<?php echo isset($LAN_413)?$LAN_413:"".CLOCK_MENU_L14; ?>","<?php echo isset($LAN_414)?$LAN_414:"".CLOCK_MENU_L15; ?>","<?php echo isset($LAN_415)?$LAN_415:"".CLOCK_MENU_L16; ?>","<?php echo isset($LAN_416)?$LAN_416:"".CLOCK_MENU_L17; ?>","<?php echo isset($LAN_417)?$LAN_417:"".CLOCK_MENU_L18; ?>","<?php echo isset($LAN_418)?$LAN_418:"".CLOCK_MENU_L19; ?>","<?php echo isset($LAN_419)?$LAN_419:"".CLOCK_MENU_L20; ?>","<?php echo isset($LAN_420)?$LAN_420:"".CLOCK_MENU_L21; ?>","<?php echo isset($LAN_421)?$LAN_421:"".CLOCK_MENU_L22; ?>","<?php echo isset($LAN_422)?$LAN_422:"".CLOCK_MENU_L23; ?>");
+//-->
+</script>
+<?php
+echo "
+<script type='text/javascript' src='".e_PLUGIN."clock_menu/clock.js'></script>
+
+<script type=\"text/javascript\">\nwindow.setTimeout(\"tick('".$menu_pref['clock_dateprefix']."', '".$menu_pref['clock_format']."', '".$menu_pref['clock_datesuffix1']."', '".$menu_pref['clock_datesuffix2']."', '".$menu_pref['clock_datesuffix3']."', '".$menu_pref['clock_datesuffix4']."')\",150);\n</script>
+<!-- ### end clock ### //-->\n\n";
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/clock_menu/config.php 75/e107_plugins/clock_menu/config.php
--- 6171/e107_plugins/clock_menu/config.php	2004-08-25 20:55:46.000000000 -0500
+++ 75/e107_plugins/clock_menu/config.php	2005-06-01 01:40:09.000000000 -0500
@@ -1,52 +1,111 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/menu_conf/comment_conf.php
-|
-|	Edwin van der Wal 2003
-|	http://e107.org
-|	evdwal@xs4all.nl
-|
-|	Released under the terms and conditions of the	
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
-require_once(e_ADMIN."auth.php");
-
-@include_once(e_PLUGIN."clock_menu/languages/".e_LANGUAGE.".php");
-@include_once(e_PLUGIN."clock_menu/languages/English.php");
-
-if(IsSet($_POST['update_menu'])){
-	while(list($key, $value) = each($_POST)){
-		if($key != "update_menu"){ $menu_pref[$key] = $value; }
-	}
-	$tmp = addslashes(serialize($menu_pref));
-	$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
-	$ns -> tablerender("", "<div style=\"text-align:center\"><b>".CLOCK_MENU_L1."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
-<table style=\"width:85%\" class=\"fborder\">
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".CLOCK_MENU_L2.": </td>
-<td style=\"width:60%\" class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"clock_caption\" size=\"20\" value=\"".$menu_pref['clock_caption']."\" maxlength=\"100\" />
-</td>
-</tr>
-
-<tr style=\"vertical-align:top\"> 
-<td colspan=\"2\"  style=\"text-align:center\" class='forumheader'>
-<input class=\"button\" type=\"submit\" name=\"update_menu\" value=\"".CLOCK_MENU_L3."\" />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender(CLOCK_MENU_L4, $text);
-require_once(e_ADMIN."footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/clock_menu/config.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/06/01 06:40:09 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+$eplug_admin = TRUE;
+require_once("../../class2.php");
+if (!getperms("1")) {
+	header("location:".e_BASE."index.php");
+	 exit ;
+}
+require_once(e_ADMIN."auth.php");
+@include_once(e_PLUGIN."clock_menu/languages/admin/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."clock_menu/languages/admin/English.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+	
+if (isset($_POST['update_menu'])) {
+	while (list($key, $value) = each($_POST)) {
+		if ($key != "update_menu") {
+			$menu_pref[$key] = $value;
+		}
+	}
+	if ($_POST['clock_format'] != 1) {
+		$menu_pref['clock_format'] = 0;
+	}
+	$tmp = addslashes(serialize($menu_pref));
+	$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
+	$ns->tablerender("", "<div style=\"text-align:center\"><b>".CLOCK_AD_L1."</b></div>");
+}
+	
+$text = "<div style='text-align:center'>
+	<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
+	<table style=\"width:85%\" class=\"fborder\">";
+	
+//  Title
+$text .= "<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L2.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"clock_caption\" size=\"20\" value=\"".$menu_pref['clock_caption']."\" maxlength=\"100\" />
+	</td>
+	</tr>";
+	
+// Format Time
+$text .= "<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L5.": </td>
+	<td style=\"width:60%\" class='forumheader3'>".($menu_pref['clock_format'] == 1 ? $rs->form_checkbox("clock_format", 1, 1) : $rs->form_checkbox("clock_format", 1, 0) )."
+	<br /><b class='smalltext'>".CLOCK_AD_L6."</b></td>
+	</tr>";
+	
+//  Date Prefix
+$text .= "<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L7.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"clock_dateprefix\" size=\"10\" value=\"".$menu_pref['clock_dateprefix']."\" maxlength=\"50\" />
+	<br /><b class='smalltext'>".CLOCK_AD_L8."</b></td>
+	</tr>";
+	
+//  Date Suffix
+$text .= "<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L9.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	1<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix1\" size=\"10\" value=\"".$menu_pref['clock_datesuffix1']."\" maxlength=\"50\" />
+	<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
+	</tr>";
+	
+$text .= "<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L10.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	2<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix2\" size=\"10\" value=\"".$menu_pref['clock_datesuffix2']."\" maxlength=\"50\" />
+	<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
+	</tr>";
+	
+$text .= "<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L11.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	3<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix3\" size=\"10\" value=\"".$menu_pref['clock_datesuffix3']."\" maxlength=\"50\" />
+	<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
+	</tr>";
+	
+$text .= "<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CLOCK_AD_L12.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	4<input class=\"tbox\" type=\"text\" name=\"clock_datesuffix4\" size=\"10\" value=\"".$menu_pref['clock_datesuffix4']."\" maxlength=\"50\" />
+	<br /><b class='smalltext'>".CLOCK_AD_L13."</b></td>
+	</tr>";
+	
+$text .= "<tr style=\"vertical-align:top\">
+	<td colspan=\"2\"  style=\"text-align:center\" class='forumheader'>
+	<input class=\"button\" type=\"submit\" name=\"update_menu\" value=\"".CLOCK_AD_L3."\" />
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+$ns->tablerender(CLOCK_AD_L4, $text);
+require_once(e_ADMIN."footer.php");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/clock_menu/languages/admin/English.php 75/e107_plugins/clock_menu/languages/admin/English.php
--- 6171/e107_plugins/clock_menu/languages/admin/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/clock_menu/languages/admin/English.php	2005-01-27 13:52:39.000000000 -0600
@@ -0,0 +1,44 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/clock_menu/languages/admin/English.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:52:39 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+	
+define("CLOCK_AD_L1", "Clock menu configuration saved");
+define("CLOCK_AD_L2", "Caption");
+define("CLOCK_AD_L3", "Update Menu Settings");
+define("CLOCK_AD_L4", "Clock Menu Config");
+define("CLOCK_AD_L5", "AM/PM");
+define("CLOCK_AD_L6", "If checked, you will display time with US format (0-12 AM/PM format). Unchecked you will display a 'military' format 0-24 format");
+define("CLOCK_AD_L7", "Date Prefix");
+define("CLOCK_AD_L8", "If your language requires a short word before the date (Example 'le' for french or 'den' for german...), use this field. If not required, let empty.");
+define("CLOCK_AD_L9", "Suffix 1");
+define("CLOCK_AD_L10", "Suffix 2");
+define("CLOCK_AD_L11", "Suffix 3");
+define("CLOCK_AD_L12", "Suffix 4 and more");
+define("CLOCK_AD_L13", "If your language requires to display a suffix just after numbers for date, fill these fields with suffix only (Example: 'st' for 1, 'nd' for 2, 'rd' for 3 and 'th' for 4 and more for english users). If not required let empty.");
+define("CLOCK_AD_L14", "");
+define("CLOCK_AD_L15", "");
+define("CLOCK_AD_L16", "");
+define("CLOCK_AD_L17", "");
+define("CLOCK_AD_L18", "");
+define("CLOCK_AD_L19", "");
+define("CLOCK_AD_L20", "");
+define("CLOCK_AD_L21", "");
+define("CLOCK_AD_L22", "");
+define("CLOCK_AD_L23", "");
+define("CLOCK_AD_L24", "");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/clock_menu/languages/English.php 75/e107_plugins/clock_menu/languages/English.php
--- 6171/e107_plugins/clock_menu/languages/English.php	2004-08-25 20:55:46.000000000 -0500
+++ 75/e107_plugins/clock_menu/languages/English.php	2005-01-27 13:52:38.000000000 -0600
@@ -1,21 +1,44 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107_plugins/clock_menu/languages/English.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define('CLOCK_MENU_L1','Clock menu configuration saved');
-define('CLOCK_MENU_L2','Caption');
-define('CLOCK_MENU_L3','Update Menu Settings');
-define('CLOCK_MENU_L4','Clock Menu Config');
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/clock_menu/languages/English.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/01/27 19:52:38 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+	
+define('CLOCK_MENU_L1', 'Clock menu configuration saved');
+define('CLOCK_MENU_L2', 'Caption');
+define('CLOCK_MENU_L3', 'Update Menu Settings');
+define('CLOCK_MENU_L4', 'Clock Menu Config');
+define('CLOCK_MENU_L5', 'Monday,');
+define('CLOCK_MENU_L6', 'Tuesday,');
+define('CLOCK_MENU_L7', 'Wednesday,');
+define('CLOCK_MENU_L8', 'Thursday,');
+define('CLOCK_MENU_L9', 'Friday,');
+define('CLOCK_MENU_L10', 'Saturday,');
+define('CLOCK_MENU_L11', 'Sunday,');
+define('CLOCK_MENU_L12', 'January');
+define('CLOCK_MENU_L13', 'February');
+define('CLOCK_MENU_L14', 'March');
+define('CLOCK_MENU_L15', 'April');
+define('CLOCK_MENU_L16', 'May');
+define('CLOCK_MENU_L17', 'June');
+define('CLOCK_MENU_L18', 'July');
+define('CLOCK_MENU_L19', 'August');
+define('CLOCK_MENU_L20', 'September');
+define('CLOCK_MENU_L21', 'October');
+define('CLOCK_MENU_L22', 'November');
+define('CLOCK_MENU_L23', 'December');
+define('CLOCK_MENU_L24', '');
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/comment_menu/comment_menu.php 75/e107_plugins/comment_menu/comment_menu.php
--- 6171/e107_plugins/comment_menu/comment_menu.php	2004-04-25 23:37:38.000000000 -0500
+++ 75/e107_plugins/comment_menu/comment_menu.php	2006-04-05 07:19:18.000000000 -0500
@@ -1,100 +1,91 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-if(!is_object($aj)){ $aj = new textparse; }
-if($cache = retrieve_cache("newcomments")){
-	$text = $aj -> formtparev($cache);
-}else{
-
-
-	if(!$sql -> db_Select("comments", "*", "comment_id ORDER BY comment_datestamp DESC LIMIT 0, ".$menu_pref['comment_display'])){
-		$text = "<span class='mediumtext'>".CM_L1."</span>";
-	}else{
-		$text = "<span class='smalltext'>";
-		$sql2 = new db;
-		while($row = $sql-> db_Fetch()){
-			extract($row);
-			
-			$poster = substr($comment_author, (strpos($comment_author, ".")+1));
-			$gen = new convert;
-			$datestamp = $gen->convert_date($comment_datestamp, "short");
-
-			$comment_comment = $aj -> tpa($comment_comment);
-
-			if($pref['cb_linkreplace']){
-				$comment_comment .= " ";
-				$comment_comment = preg_replace("#\>(.*?)\</a\>[\s]#si", ">".$pref['cb_linkc']."</a> ", $comment_comment);
-				$comment_comment = $aj -> tpa(strip_tags($comment_comment));
-			}
-	
-			if(!eregi("<a href|<img|&#", $thread_thread)){
-				$message_array = explode(" ", $comment_comment);
-				for($i=0; $i<=(count($message_array)-1); $i++){
-					if(strlen($message_array[$i]) > 20){
-						$message_array[$i] = preg_replace("/([^\s]{20})/", "$1<br />", $message_array[$i]);
-					}
-				}
-				$comment_comment = implode(" ", $message_array);
-			}
-			if(strlen($comment_comment) > $menu_pref['comment_characters']){
-				$comment_comment = substr($comment_comment, 0, $menu_pref['comment_characters']).$menu_pref['comment_postfix'];
-			}
-			
-			if($comment_type == "0"){
-				$sql2 -> db_Select("news", "news_title, news_class", "news_id = $comment_item_id");
-				$row = $sql2 -> db_Fetch(); extract($row);
-				if(!$news_class){
-					$text .= "<img src='".THEME."images/bullet2.gif' alt='' /> <a href='".e_BASE."comment.php?comment.news.$comment_item_id'><b>".$poster."</b> on ".$datestamp."</a>";
-					if($menu_pref['comment_title']) {
-						$text .= "<br /> [ Re: <i>$news_title</i> ]";
-					}
-					$text .= "<br />".($comment_blocked ? CM_L2 : $comment_comment)."<br /><br />";
-				}
-			}
-			if($comment_type == "1"){
-				$sql2 -> db_Select("content", "*", "content_id=$comment_item_id");
-				$row = $sql2 -> db_Fetch(); extract($row);
-				if($content_type == 0){
-					$tmp = "<img src='".THEME."images/bullet2.gif' alt='' /> <a href='".e_BASE."content.php?article.$comment_item_id'><b>".$poster."</b> on ".$datestamp."</a>";
-				}else if($content_type == 3){
-					$tmp = "<img src='".THEME."images/bullet2.gif' alt='' /> <a href='".e_BASE."content.php?review.$comment_item_id'><b>".$poster."</b> on ".$datestamp."</a>";
-				}else if($content_type == 1){
-					$tmp = "<img src='".THEME."images/bullet2.gif' alt='' /> <a href='".e_BASE."content.php?content.$comment_item_id'><b>".$poster."</b> on ".$datestamp."</a>";
-				}
-				if($menu_pref['comment_title']) {
-					$sql2 -> db_Select("content", "content_heading", "content_id=$comment_item_id");
-					list($article_title) = $sql2->db_Fetch();
-					$tmp .= "<br /> [ Re: <i>$article_title</i> ]";
-				} 
-				$tmp .= "<br />".($comment_blocked ? CM_L2 : $comment_comment)."<br /><br />";
-	
-				if(check_class($content_class)){
-					$text .=$tmp;
-				}
-
-			}
-			if($comment_type_ == "2"){
-					//This code is not tested... [edwin]
-				$text .= "<img src='".THEME."images/bullet2.gif' alt='' /> <a href='".e_BASE."download_comment.php?comment.news.$comment_item_id_.'>download - <b>".$poster."</b> on ".$datestamp."</a><br />".($comment_blocked ? CM_L2 : $comment_comment)."<br /><br />";
-			}
-		}
-
-		$text = "</span>".preg_replace("/\<br \/\>$/", "", $text);
-		if($pref['cachestatus']){
-			$cache = $aj -> formtpa($text, "admin");
-			set_cache("newcomments",$cache);
-		}
-	}
-}
-$ns -> tablerender($menu_pref['comment_caption'], $text);
-?>
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/comment_menu/comment_menu.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2006/04/05 12:19:18 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $tp, $e107;
+$gen = new convert;
+
+$query = "
+SELECT c.*, u.user_id, u.user_name FROM #comments AS c
+LEFT JOIN #user AS u ON FLOOR(c.comment_author) = u.user_id 
+ORDER BY c.comment_datestamp DESC LIMIT 0, ".intval($menu_pref['comment_display']);
+
+$results = $sql->db_Select_gen($query);
+$commentArray = $sql->db_getList();
+
+if(!$results)
+{
+	// no posts yet ..
+	$text = CM_L1;
+}
+else
+{
+	$text = "";
+
+	$bullet_img = THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif");
+	foreach($commentArray as $c)
+	{
+		$datestamp = $gen->convert_date($c['comment_datestamp'], "short");
+		$poster = substr($c['comment_author'], (strpos($c['comment_author'], ".")+1));
+		$comment = strip_tags(preg_replace("/\[.*\]/", "", $c['comment_comment'])); // remove bbcode
+		$comment = $tp->toHTML($comment, FALSE, "", "", $pref['menu_wordwrap']);
+		
+		if (strlen($comment) > $menu_pref['comment_characters'])
+		{
+			$comment = substr($comment, 0, $menu_pref['comment_characters']).$menu_pref['comment_postfix'];
+		}
+
+		$link = "";
+		switch ($c['comment_type']) {
+			case "0":
+				$link = "<img src='{$bullet_img}' alt='' /> <a href='".$e107->base_path."comment.php?comment.news.{$c['comment_item_id']}'><b>".$poster."</b> on ".$datestamp."</a><br />";
+				break;
+			case "4":
+				$link = "<img src='{$bullet_img}' alt='' /> <a href='".$e107->base_path."comment.php?comment.poll.{$c['comment_item_id']}'><b>".$poster."</b> on ".$datestamp."</a><br />";
+				break;
+			case "profile":
+				if(USER)
+				{
+					$link = "<img src='{$bullet_img}' alt='' /> <a href='".$e107->base_path."user.php?id.{$c['comment_item_id']}'><b>".$poster."</b> on ".$datestamp."</a><br />";
+				}
+				break;
+
+			default:
+				// It's probably from a 3rd party plugin so load in the e_comment file to get the URL to use
+				$ecomment = e_PLUGIN.$c['comment_type']."/e_comment.php";
+				if(is_readable($ecomment))
+				{
+					$nid = $c['comment_item_id'];
+					include($ecomment);
+					$link = "<img src='{$bullet_img}' alt='' /> <a href='$reply_location'><b>".$poster."</b> on ".$datestamp."</a><br />";
+				}
+				break;
+		}
+
+		if($link)
+		{
+			$heading = ($menu_pref['comment_title'] ? " [ Re: <i>{$c['comment_subject']}</i> ]<br />" : "");
+			$text .= $link.$heading.$comment."<br /><br />";
+		}
+	}
+}
+
+$ns->tablerender($menu_pref['comment_caption'], $text, 'comment');
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/comment_menu/config.php 75/e107_plugins/comment_menu/config.php
--- 6171/e107_plugins/comment_menu/config.php	2004-04-16 03:36:30.000000000 -0500
+++ 75/e107_plugins/comment_menu/config.php	2005-05-25 04:43:25.000000000 -0500
@@ -1,90 +1,100 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/menu_conf/comment_conf.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-|
-|	Based on code by Edwin van der Wal (evdwal@xs4all.nl), Multilanguage by Juan
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-require_once(e_HANDLER."userclass_class.php");
-
-$lan_file=e_PLUGIN."comment_menu/languages/".e_LANGUAGE.".php";
-if(file_exists($lan_file)){
-	require_once($lan_file);
-} else {
-	require_once(e_PLUGIN."comment_menu/languages/English.php");
-}
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
-require_once(e_ADMIN."auth.php");
-
-if(IsSet($_POST['update_menu'])){
-	while(list($key, $value) = each($_POST)){
-		if($value != CM_L9){ $menu_pref[$key] = $value; }
-	}
-	if(!$_POST['comment_title']){ $menu_pref['comment_title'] = 0; }
-	$tmp = addslashes(serialize($menu_pref));
-	$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
-	$ns -> tablerender("", "<div style=\"text-align:center\"><b>".CM_L10."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
-<table style=\"width:85%\" class=\"fborder\" >
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".CM_L3.": </td>
-<td style=\"width:60%\" class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"comment_caption\" size=\"20\" value=\"".$menu_pref['comment_caption']."\" maxlength=\"100\" />
-</td>
-</tr>
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".CM_L4.": </td>
-<td style=\"width:60%\" class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"comment_display\" size=\"20\" value=\"".$menu_pref['comment_display']."\" maxlength=\"2\" />
-</td>
-</tr>
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".CM_L5.": </td>
-<td style=\"width:60%\" class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"comment_characters\" size=\"20\" value=\"".$menu_pref['comment_characters']."\" maxlength=\"4\" />
-</td>
-</tr>
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".CM_L6.": </td>
-<td style=\"width:60%\" class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"comment_postfix\" size=\"30\" value=\"".$menu_pref['comment_postfix']."\" maxlength=\"200\" />
-</td>
-</tr>
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".CM_L7.": </td>
-<td style=\"width:60%\" class='forumheader3'>
-<input type=\"checkbox\" name=\"comment_title\" value=\"1\"";
-if($menu_pref['comment_title']){
-	$text .= " checked ";
-} 
-$text .= ">
-</td>
-</tr>
-
-<tr>
-<td colspan=\"2\" class='forumheader' style=\"text-align:center\"><input class=\"button\" type=\"submit\" name=\"update_menu\" value=\"".CM_L9."\" /></td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender(CM_L8, $text);
-require_once(e_ADMIN."footer.php");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/comment_menu/config.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/05/25 09:43:25 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+$eplug_admin = TRUE;
+require_once("../../class2.php");
+require_once(e_HANDLER."userclass_class.php");
+	
+$lan_file = e_PLUGIN."comment_menu/languages/".e_LANGUAGE.".php";
+if (file_exists($lan_file)) {
+	require_once($lan_file);
+} else {
+	require_once(e_PLUGIN."comment_menu/languages/English.php");
+}
+if (!getperms("1")) {
+	header("location:".e_BASE."index.php");
+	 exit ;
+}
+require_once(e_ADMIN."auth.php");
+	
+if (isset($_POST['update_menu'])) {
+	while (list($key, $value) = each($_POST)) {
+		if ($value != CM_L9) {
+			$menu_pref[$key] = $value;
+		}
+	}
+	if (!$_POST['comment_title']) {
+		$menu_pref['comment_title'] = 0;
+	}
+	$tmp = addslashes(serialize($menu_pref));
+	$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
+	$ns->tablerender("", "<div style=\"text-align:center\"><b>".CM_L10."</b></div>");
+}
+	
+$text = "<div style='text-align:center'>
+	<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
+	<table style=\"width:85%\" class=\"fborder\" >
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CM_L3.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"comment_caption\" size=\"20\" value=\"".$menu_pref['comment_caption']."\" maxlength=\"100\" />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CM_L4.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"comment_display\" size=\"20\" value=\"".$menu_pref['comment_display']."\" maxlength=\"2\" />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CM_L5.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"comment_characters\" size=\"20\" value=\"".$menu_pref['comment_characters']."\" maxlength=\"4\" />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CM_L6.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"comment_postfix\" size=\"30\" value=\"".$menu_pref['comment_postfix']."\" maxlength=\"200\" />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".CM_L7.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input type=\"checkbox\" name=\"comment_title\" value=\"1\"";
+if ($menu_pref['comment_title']) {
+	$text .= " checked ";
+}
+$text .= ">
+	</td>
+	</tr>
+	 
+	<tr>
+	<td colspan=\"2\" class='forumheader' style=\"text-align:center\"><input class=\"button\" type=\"submit\" name=\"update_menu\" value=\"".CM_L9."\" /></td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+$ns->tablerender(CM_L8, $text);
+require_once(e_ADMIN."footer.php");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/comment_menu/languages/English.php 75/e107_plugins/comment_menu/languages/English.php
--- 6171/e107_plugins/comment_menu/languages/English.php	2004-04-16 03:36:30.000000000 -0500
+++ 75/e107_plugins/comment_menu/languages/English.php	2005-01-27 13:52:40.000000000 -0600
@@ -1,27 +1,27 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("CM_L1", "No comments yet.");
-define("CM_L2", "");
-define("CM_L3", "Caption");
-define("CM_L4", "Number of comments to display?");
-define("CM_L5", "Number of characters to display?");
-define("CM_L6", "Postfix for too long comments?");
-define("CM_L7", "Show original news title in menu?");
-define("CM_L8", "New Comments Menu Configuration");
-define("CM_L9", "Update Menu Settings");
-define("CM_L10", "Comments menu configuration saved");
-
-
+<?php
+/*
++---------------------------------------------------------------+
+| e107 website system
+|
+| Steve Dunstan 2001-2002
+| http://e107.org
+| jalist@e107.org
+|
+| Released under the terms and conditions of the
+| GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+	
+define("CM_L1", "No comments yet.");
+define("CM_L2", "");
+define("CM_L3", "Caption");
+define("CM_L4", "Number of comments to display?");
+define("CM_L5", "Number of characters to display?");
+define("CM_L6", "Postfix for too long comments?");
+define("CM_L7", "Show original news title in menu?");
+define("CM_L8", "New Comments Menu Configuration");
+define("CM_L9", "Update Menu Settings");
+define("CM_L10", "Comments menu configuration saved");
+	
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/compliance_menu/compliance_menu.php 75/e107_plugins/compliance_menu/compliance_menu.php
--- 6171/e107_plugins/compliance_menu/compliance_menu.php	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/compliance_menu/compliance_menu.php	2005-12-14 13:28:43.000000000 -0600
@@ -1,9 +1,12 @@
-<?php
-$text = "<div style='text-align:center'>
-<a href='http://validator.w3.org/check/referer'><img style='border:0' src='http://www.w3.org/Icons/valid-xhtml11' alt='Valid XHTML 1.1!' height='31' width='88' /></a>
-<br />
-<a href='http://jigsaw.w3.org/css-validator/'><img style='border:0' src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' height='31' width='88' /></a>
-</div>";
-$caption = (file_exists(THEME."images/compliance_menu.png") ? "<img src='".THEME."images/compliance_menu.png' alt='' /> ".COMPLIANCE_L1 : COMPLIANCE_L1);
-$ns -> tablerender($caption, $text);
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$text = "<div style='text-align:center'>
+	<a href='http://validator.w3.org/check?uri=".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."'><img style='border:0' src='".e_PLUGIN."compliance_menu/images/valid-xhtml11.png' alt='Valid XHTML 1.1!' height='31' width='88' /></a>
+	<br />
+	<a href='http://jigsaw.w3.org/css-validator/validator?uri=".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."'><img style='border:0' src='".e_PLUGIN."compliance_menu/images/vcss.png' alt='Valid CSS!' height='31' width='88' /></a>
+	</div>";
+$caption = (file_exists(THEME."images/compliance_menu.png") ? "<img src='".THEME."images/compliance_menu.png' alt='' /> ".COMPLIANCE_L1 : COMPLIANCE_L1);
+$ns->tablerender($caption, $text, 'compliance');
 ?>
\ No newline at end of file
Files 6171/e107_plugins/compliance_menu/images/valid-xhtml11.png and 75/e107_plugins/compliance_menu/images/valid-xhtml11.png differ
Files 6171/e107_plugins/compliance_menu/images/vcss.png and 75/e107_plugins/compliance_menu/images/vcss.png differ
diff -ruN 6171/e107_plugins/compliance_menu/languages/English.php 75/e107_plugins/compliance_menu/languages/English.php
--- 6171/e107_plugins/compliance_menu/languages/English.php	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/compliance_menu/languages/English.php	2005-03-22 14:58:14.000000000 -0600
@@ -1,17 +1,15 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("COMPLIANCE_L1", "W3C Compliance");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/compliance_menu/languages/English.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/03/22 20:58:14 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+	
+define("COMPLIANCE_L1", "W3C Compliance");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/admin_content_config.php 75/e107_plugins/content/admin_content_config.php
--- 6171/e107_plugins/content/admin_content_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/admin_content_config.php	2006-02-13 04:13:22.000000000 -0600
@@ -0,0 +1,640 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        /admin/review.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/admin_content_config.php,v $
+|		$Revision: 1.60 $
+|		$Date: 2006/02/13 10:13:22 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+
+if(!getperms("P")){header("location:".e_BASE."index.php"); exit; }
+$e_sub_cat = 'content';
+$e_wysiwyg = "content_text,cat_text";
+$plugindir = e_PLUGIN."content/";
+
+$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php';
+include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_admin.php');
+
+$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php';
+include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.php');
+
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+require_once(e_HANDLER."userclass_class.php");
+require_once($plugindir."handlers/content_class.php");
+$aa = new content;
+require_once($plugindir."handlers/content_db_class.php");
+$adb = new contentdb;
+require_once($plugindir."handlers/content_form_class.php");
+$aform = new contentform;
+require_once(e_HANDLER."file_class.php");
+$fl = new e_file;
+e107_require_once(e_HANDLER.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+
+global $tp;
+$deltest = array_flip($_POST);
+
+// check query
+if(e_QUERY){
+	$qs = explode(".", e_QUERY);
+}
+
+if(isset($_POST['delete']))
+{
+	$tmp = array_pop(array_flip($_POST['delete']));
+	list($delete, $del_id) = explode("_", $tmp);
+}
+
+// ##### DB ---------------------------------------------------------------------------------------
+
+if(isset($delete) && $delete == 'cat'){
+
+	$sql -> db_Select($plugintable, "content_id,content_heading,content_parent", "content_id = '$del_id' ");
+	list($content_id, $content_heading, $content_parent) = $sql -> db_Fetch();
+
+	$checkarray = $aa -> getCategoryTree("", $content_id, TRUE);
+	unset($agc);	//unset the globalised getCategoryTree array
+	$checkvalidparent = implode(",", array_keys($checkarray));
+	$checkqry = " content_parent REGEXP '".$aa -> CONTENTREGEXP($checkvalidparent)."' ";
+
+	//check if subcats present
+	if(count($array) > 1){
+		//subcategories found don't delete
+		$checkermsg .= CONTENT_ADMIN_CAT_LAN_36."<br />";
+		$checksubcat = TRUE;
+	}else{
+		$checkermsg .= CONTENT_ADMIN_CAT_LAN_39."<br />";
+		$checksubcat = FALSE;
+	}
+
+	//check if items present
+	if($sql -> db_Count($plugintable, "(*)", "WHERE ".$checkqry." ")){
+		//items found, don't delete
+		$checkermsg .= CONTENT_ADMIN_CAT_LAN_37."<br />";
+		$checkitems = TRUE;
+	}else{
+		$checkermsg .= CONTENT_ADMIN_CAT_LAN_38."<br />";
+		$checkitems = FALSE;
+	}
+
+	if($checksubcat == FALSE && $checkitems == FALSE){
+		if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){
+			@unlink(e_PLUGIN."content/menus/content_".$content_heading."_menu.php");
+			$message = CONTENT_ADMIN_CAT_LAN_23."<br />";
+		}
+	}else{
+		$message = $checkermsg;
+	}
+}
+
+if(isset($delete) && $delete == 'content'){
+	if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){
+		$e107cache->clear($plugintable);
+		$message = CONTENT_ADMIN_ITEM_LAN_3;
+	}
+}
+
+if(isset($delete) && $delete == 'submitted'){
+	if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){
+		$e107cache->clear($plugintable);
+		$message = CONTENT_ADMIN_SUBMIT_LAN_8;
+	}
+}
+
+if(isset($_POST['updateoptions'])){
+	$content_pref	= $aa -> UpdateContentPref($_POST['options_type']);
+	$message		= CONTENT_ADMIN_CAT_LAN_22."<br /><br />";
+	if($_POST['options_type'] != "0"){
+		$message		.= $aa -> CreateParentMenu($_POST['options_type']);
+	}
+	$e107cache->clear($plugintable);
+}
+
+
+//pre-upload a new category icon in the create/edit category form
+if(isset($_POST['uploadcaticon'])){
+
+	$pref['upload_storagetype'] = "1";
+	require_once(e_HANDLER."upload_handler.php");
+	$pathiconlarge = $_POST['iconpathlarge'];
+	$pathiconsmall = $_POST['iconpathsmall'];	
+	$uploaded = file_upload($pathiconlarge);
+	
+	$icon = "";
+	if($uploaded) {
+		$icon = $uploaded[0]['name'];
+		require_once(e_HANDLER."resize_handler.php");
+		resize_image($pathiconlarge.$icon, $pathiconlarge.$icon, '48', "nocopy");
+		resize_image($pathiconlarge.$icon, $pathiconsmall.$icon, '16', "copy");
+		rename($pathiconsmall."thumb_".$icon , $pathiconsmall.$icon);
+	}
+	$message	= ($icon ? CONTENT_ADMIN_CAT_LAN_58 : CONTENT_ADMIN_CAT_LAN_59);
+	
+}
+
+if(isset($_POST['create_category'])){
+	if($_POST['cat_heading'] && $_POST['parent'] != "none"){
+		$adb -> dbCategory("create");
+	}else{
+		$message	= CONTENT_ADMIN_ITEM_LAN_0;
+	}
+}
+
+if(isset($_POST['update_category'])){
+	if($_POST['cat_heading'] && $_POST['parent'] != "none"){
+		$adb -> dbCategory("update");
+	}else{
+		$message	= CONTENT_ADMIN_ITEM_LAN_0;
+	}
+}
+
+if(isset($_POST['create_content'])){
+	if($_POST['content_text'] && $_POST['content_heading'] && $_POST['content_author_name'] && $_POST['parent'] != "none"){
+		//$adb -> dbContentCreate("admin");
+		$adb -> dbContent("create", "");
+	}else{
+		$message	= CONTENT_ADMIN_ITEM_LAN_0;
+	}
+}
+
+if(isset($_POST['update_content'])){
+	if($_POST['content_text'] && $_POST['content_heading'] && $_POST['content_author_name'] && $_POST['content_heading'] && $_POST['parent'] != "none"){
+		//$adb -> dbContentUpdate("admin");
+		$adb -> dbContent("update", "");
+	}else{
+		$message	= CONTENT_ADMIN_ITEM_LAN_0;
+	}
+}
+
+if(isset($_POST['update_order'])){
+	if(isset($qs[1])){
+		if(isset($qs[2])){
+			$message = $adb -> dbSetOrder("all", "ci", $_POST['order']);
+		}else{
+			$message = $adb -> dbSetOrder("all", "ai", $_POST['order']);
+		}
+	}else{
+		$message = $adb -> dbSetOrder("all", "cc", $_POST['order']);
+	}
+}
+
+if(isset($message)){
+	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+// ##### End --------------------------------------------------------------------------------------
+
+if(!e_QUERY){																//show main categories
+	$aform -> show_manage_content("", "", "");
+	require_once(e_ADMIN."footer.php");
+	exit;
+}else{
+	$qs = explode(".", e_QUERY);
+
+	//manage content items
+	if($qs[0] == "content" && is_numeric($qs[1]) ){
+		$aform -> show_manage_content("", "", "");
+
+	//edit content item
+	}elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){
+		$newqs = array_reverse($qs);
+		if($newqs[0] == "cu"){										//item; update redirect
+			$mainparent = $aa -> getMainParent($qs[2]);
+			$message = CONTENT_ADMIN_ITEM_LAN_2."<br /><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_88." <a href='".e_SELF."?content.create.".$mainparent."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_89." <a href='".e_SELF."?content.".$mainparent."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_91." <a href='".e_SELF."?content.edit.".$qs[2]."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_124." <a href='".e_PLUGIN."content/content.php?content.".$qs[2]."'>".CONTENT_ADMIN_ITEM_LAN_90."</a>";
+			
+			$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+			require_once(e_ADMIN."footer.php");
+			exit;
+		}
+		$aform -> show_create_content("admin", $userid="", $username="");
+
+	//post submitted content item
+	}elseif($qs[0] == "content" && $qs[1] == "sa" && is_numeric($qs[2]) ){
+		$newqs = array_reverse($qs);
+		if($newqs[0] == "cu"){										//item; submit post / update redirect
+			$mainparent = $aa -> getMainParent($qs[2]);
+			$message = CONTENT_ADMIN_ITEM_LAN_117."<br /><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_88." <a href='".e_SELF."?content.create.".$mainparent."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_89." <a href='".e_SELF."?content.".$mainparent."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_91." <a href='".e_SELF."?content.edit.".$qs[2]."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_124." <a href='".e_PLUGIN."content/content.php?content.".$qs[2]."'>".CONTENT_ADMIN_ITEM_LAN_90."</a>";
+			$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+			require_once(e_ADMIN."footer.php");
+			exit;
+		}
+		$aform -> show_create_content("sa", $userid="", $username="");
+
+	//create content item
+	}elseif($qs[0] == "content" && $qs[1] == "create" ){
+		$newqs = array_reverse($qs);
+		if($newqs[0] == "cc"){										//item; create redirect
+			$mainparent = $aa -> getMainParent($qs[2]);
+			$message = CONTENT_ADMIN_ITEM_LAN_1."<br /><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_88." <a href='".e_SELF."?content.create.".$mainparent."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />";
+			$message .= CONTENT_ADMIN_ITEM_LAN_89." <a href='".e_SELF."?content.".$mainparent."'>".CONTENT_ADMIN_ITEM_LAN_90."</a><br />";
+			$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+			require_once(e_ADMIN."footer.php");
+			exit;
+		}
+		$aform -> show_create_content("admin", $userid="", $username="");
+
+
+
+	//order : view categories
+	}elseif($qs[0] == "order" && !isset($qs[1])){
+		$aform -> show_order();
+
+	//order global items of parent='2'
+	}elseif($qs[0] == "order" && is_numeric($qs[1]) && !isset($qs[2]) ){
+		$aform -> show_content_order("ai");
+
+	//increase order of global items
+	}elseif($qs[0] == "order" && is_numeric($qs[1]) && $qs[2] == "inc" && isset($qs[3]) ){
+		$message = $adb -> dbSetOrder("inc", "ai", $qs[3]);
+		$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+		$aform -> show_content_order("ai");
+
+	//decrease order of global items
+	}elseif($qs[0] == "order" && is_numeric($qs[1]) && $qs[2] == "dec" && isset($qs[3]) ){
+		$message = $adb -> dbSetOrder("dec", "ai", $qs[3]);
+		$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+		$aform -> show_content_order("ai");
+
+	//order items with parent=2 or category='5'
+	}elseif($qs[0] == "order" && is_numeric($qs[1]) && is_numeric($qs[2]) && !isset($qs[3]) ){
+		$aform -> show_content_order("ci");
+	
+	//increase order of items in category
+	}elseif($qs[0] == "order" && is_numeric($qs[1]) && is_numeric($qs[2]) && $qs[3] == "inc" && isset($qs[4]) ){
+		$message = $adb -> dbSetOrder("inc", "ci", $qs[4]);
+		$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+		$aform -> show_content_order("ci");
+
+	//decrease order of items in category
+	}elseif($qs[0] == "order" && is_numeric($qs[1]) && is_numeric($qs[2]) && $qs[3] == "dec" && isset($qs[4]) ){
+		$message = $adb -> dbSetOrder("dec", "ci", $qs[4]);
+		$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+		$aform -> show_content_order("ci");
+
+	//increase category order
+	}elseif($qs[0] == "order" && $qs[1] == "inc" && isset($qs[2]) ){
+		$message = $adb -> dbSetOrder("inc", "cc", $qs[2]);
+		$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+		$aform -> show_order("admin");
+
+	//decrease category order
+	}elseif($qs[0] == "order" && $qs[1] == "dec" && isset($qs[2]) ){
+		$message = $adb -> dbSetOrder("dec", "cc", $qs[2]);
+		$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+		$aform -> show_order("admin");
+
+
+
+
+	}elseif($qs[0] == "submitted" && !isset($qs[1]) ){
+		$aform -> show_submitted();
+
+
+
+
+	}elseif($qs[0] == "option" && !isset($qs[1]) ){
+		$aform -> show_options();
+
+	}elseif($qs[0] == "option" && isset($qs[1]) && (is_numeric($qs[1]) || $qs[1] == "default") ){
+		$aform -> show_options_cat();
+
+
+
+
+	//category content manager : choose category
+	}elseif($qs[0] == "manager" && !isset($qs[1]) ){
+		if(!getperms("0")){ header("location:".e_SELF); exit; }
+		//$aform -> show_admin_contentmanager();
+		$aform -> show_manage("manager");
+	
+	//category content manager : view contentmanager
+	}elseif($qs[0] == "manager" && isset($qs[1]) && is_numeric($qs[1]) ){
+		if(!getperms("0")){ header("location:".e_SELF); exit; }
+		if(isset($qs[2])){
+			$message = $adb -> dbAssignAdmins("admin", intval($qs[1]), $qs[2]);
+			$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+		}
+		$aform -> show_admin_contentmanager_category();
+
+
+
+
+	//overview all categories
+	}elseif($qs[0] == "cat" && !isset($qs[1]) ){
+		$aform -> show_manage("category");
+
+	//create category
+	}elseif($qs[0] == "cat" && $qs[1] == "create" ){
+		$newqs = array_reverse($qs);
+		if($newqs[0] == "pc"){									//category; create redirect
+				$message = CONTENT_ADMIN_CAT_LAN_11."<br /><br />";
+				$message .= "<br /><br />".CONTENT_ADMIN_CAT_LAN_50."<br /><br />";
+				$message .= "
+				".CONTENT_ADMIN_CAT_LAN_44." <a href='".e_SELF."?cat.create'>".CONTENT_ADMIN_CAT_LAN_43."</a><br />
+				".CONTENT_ADMIN_CAT_LAN_42." <a href='".e_SELF."?cat.edit.".$qs[2]."'>".CONTENT_ADMIN_CAT_LAN_43."</a><br />
+				";
+				$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+				require_once(e_ADMIN."footer.php");
+				exit;
+		}
+		$aform -> show_create_category();
+
+	//edit category
+	}elseif($qs[0] == "cat" && $qs[1] == "edit" && is_numeric($qs[2]) ){
+		$newqs = array_reverse($qs);
+		if($newqs[0] == "pu"){										//category; update redirect
+				$message = CONTENT_ADMIN_CAT_LAN_12."<br /><br />
+				".CONTENT_ADMIN_CAT_LAN_42." <a href='".e_SELF."?cat.edit.".$qs[2]."'>".CONTENT_ADMIN_CAT_LAN_43."</a><br />
+				".CONTENT_ADMIN_CAT_LAN_53." <a href='".e_SELF."?cat'>".CONTENT_ADMIN_CAT_LAN_43."</a><br />";
+				$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+				require_once(e_ADMIN."footer.php");
+				exit;
+		}
+		$aform -> show_create_category();
+
+
+	}
+}
+
+// ##### End --------------------------------------------------------------------------------------
+
+
+// ##### Display options --------------------------------------------------------------------------
+function admin_content_config_adminmenu(){
+
+                global $sql, $plugintable, $aa;
+
+				if(e_QUERY){
+					$qs		=	explode(".", e_QUERY);
+				}
+
+				if(isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && $qs[1] == "create"){
+					$act	= $qs[0].".".$qs[1];
+
+				}elseif(isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create"){
+					$act	= $qs[0].".".$qs[1];
+
+				}else{
+					$act	= (isset($qs[0]) ? $qs[0] : "");
+				}
+
+                if($act==""){$act="content";}
+
+                $var['content']['text']			= CONTENT_ADMIN_MENU_LAN_0;
+                $var['content']['link']			= e_SELF;
+
+                $var['content.create']['text']	= CONTENT_ADMIN_MENU_LAN_1;
+                $var['content.create']['link']	= e_SELF."?content.create";
+
+                $var['cat']['text']				= CONTENT_ADMIN_MENU_LAN_2;
+                $var['cat']['link']				= e_SELF."?cat";
+
+				$var['cat.create']['text']		= CONTENT_ADMIN_MENU_LAN_3;
+                $var['cat.create']['link']		= e_SELF."?cat.create";
+
+				$var['order']['text']			= CONTENT_ADMIN_MENU_LAN_15;
+                $var['order']['link']			= e_SELF."?order";
+
+				$var['option']['text']			= CONTENT_ADMIN_MENU_LAN_6;
+                $var['option']['link']			= e_SELF."?option";
+
+				$var['manager']['text']			= CONTENT_ADMIN_MENU_LAN_17;
+                $var['manager']['link']			= e_SELF."?manager";
+
+                if($submittedcontents = $sql -> db_Count($plugintable, "(*)", "WHERE content_refer ='sa' ")){
+                        $var['submitted']['text']	= CONTENT_ADMIN_MENU_LAN_4." (".$submittedcontents.")";
+                        $var['submitted']['link']	= e_SELF."?submitted";
+                }
+
+				show_admin_menu(CONTENT_ADMIN_MENU_LAN_6, $act,$var);
+
+				if(isset($qs[0]) && $qs[0] == "option" && isset($qs[1])){
+					unset($var);
+					$var=array();
+					$var['creation']['text']		= CONTENT_ADMIN_MENU_LAN_7;
+					$var['submission']['text']		= CONTENT_ADMIN_MENU_LAN_8;
+					$var['paththeme']['text']		= CONTENT_ADMIN_MENU_LAN_9;
+					$var['general']['text']			= CONTENT_ADMIN_MENU_LAN_10;
+					$var['contentmanager']['text']	= CONTENT_ADMIN_MENU_LAN_19;
+					$var['menu']['text']			= CONTENT_ADMIN_MENU_LAN_14;
+
+					$sql = new db;
+					$category_total			= $sql -> db_Select($plugintable, "content_heading", "content_id='".$qs[1]."' ");
+					list($content_heading)	= $sql -> db_Fetch();
+
+					show_admin_menu(CONTENT_ADMIN_MENU_LAN_6.": ".$content_heading."", $act, $var, TRUE);
+
+					unset($var);
+					$var=array();
+					$var['recentpages']['text']		= CONTENT_ADMIN_MENU_LAN_11;
+					$var['catpages']['text']		= CONTENT_ADMIN_MENU_LAN_12;
+					$var['contentpages']['text']	= CONTENT_ADMIN_MENU_LAN_13;
+					$var['authorpage']['text']		= CONTENT_ADMIN_MENU_LAN_18;
+					$var['archivepage']['text']		= CONTENT_ADMIN_MENU_LAN_16;
+					$var['toppage']['text']			= CONTENT_ADMIN_MENU_LAN_20;
+					$var['scorepage']['text']		= CONTENT_ADMIN_MENU_LAN_22;
+					show_admin_menu(CONTENT_ADMIN_MENU_LAN_21.": ".$content_heading."", $act, $var, TRUE);
+				
+				}else{
+						$sql2 = new db;
+						if($category_total = $sql2 -> db_Select($plugintable, "content_id, content_heading", "content_parent='0' ")){
+							while($row = $sql2 -> db_Fetch()){
+
+								unset($var);
+								$var=array();
+
+								$array		= $aa -> getCategoryTree("", $row['content_id'], FALSE);	//get all categories from each main parent
+								$newarray	= array_merge_recursive($array);
+
+								$newparent=array();
+								for($a=0;$a<count($newarray);$a++){
+									for($b=0;$b<count($newarray[$a]);$b++){
+										$newparent[$newarray[$a][$b]] = $newarray[$a][$b+1];
+										$b++;
+									}
+								}
+
+								foreach($newparent as $key => $value){
+									$var['c'.$key]['text']	= $value;
+									$var['c'.$key]['link']	= e_SELF."?content.".$key;
+								}
+								if( isset($qs[0]) && $qs[0] == "content" && isset($qs[1]) && $qs[1] == "create"){
+									$act = "";
+								}elseif( isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && ($qs[1] == "create" || $qs[1] == "edit") ){
+									$act = "";
+								}elseif( isset($qs[0]) && $qs[0] == "order" ){
+									$act = "";
+								}elseif( isset($qs[0]) && $qs[0] == "manager" ){
+									$act = "";
+								}else{
+									if(isset($qs[0]) && isset($qs[1]) ){
+										$act = "c".$qs[1];
+									}else{
+										$act = "c";
+									}
+								}
+
+								show_admin_menu(CONTENT_ADMIN_MENU_LAN_5." : ".$row['content_heading']."", $act, $var);
+							}
+						}
+				}
+
+}
+// ##### End --------------------------------------------------------------------------------------
+
+
+require_once(e_ADMIN."footer.php");
+
+function headerjs(){
+	global $tp, $plugindir;
+
+	$script = "
+	<script type='text/javascript' src='".$plugindir."content.js'></script>\n
+	<script type=\"text/javascript\">
+
+	function confirm2_(mode, number, name){
+	if(mode == 'image'){
+	var x=confirm(\"".CONTENT_ADMIN_JS_LAN_2." [".CONTENT_ADMIN_JS_LAN_4.": \" + name + \"] \");
+	}
+	if(mode == 'icon'){
+	var x=confirm(\"".CONTENT_ADMIN_JS_LAN_7." [".CONTENT_ADMIN_JS_LAN_8.": \" + name + \"] \");
+	}
+	if(mode == 'file'){
+	var x=confirm(\"".CONTENT_ADMIN_JS_LAN_3." [".CONTENT_ADMIN_JS_LAN_5.": \" + name + \"] \");
+	}
+	var i;
+	var imagemax = 10;
+	if(x){
+	if(mode == 'image'){
+	for (i = 0; i < imagemax; i++){
+	if(number == i){
+	document.getElementById('content_images' + i).value = '';
+	}
+	}
+	}
+	if(mode == 'icon'){
+	document.getElementById('content_icon').value = '';
+	}
+	if(mode == 'file'){
+	for (i = 0; i < imagemax; i++){
+	if(number == i){
+	document.getElementById('content_files' + i).value = '';
+	}
+	}
+	}
+	}
+	}
+	//<![CDATA[
+	// Adapted from original:  Kathi O'Shea (Kathi.O'Shea@internet.com)
+	function moveOver() {
+	var boxLength = document.getElementById('assignclass2').length;
+	var selectedItem = document.getElementById('assignclass1').selectedIndex;
+	var selectedText = document.getElementById('assignclass1').options[selectedItem].text;
+	var selectedValue = document.getElementById('assignclass1').options[selectedItem].value;
+	var i;
+	//var newvalues;
+	var isNew = true;
+	if (boxLength != 0) {
+	for (i = 0; i < boxLength; i++) {
+	thisitem = document.getElementById('assignclass2').options[i].text;
+	if (thisitem == selectedText) {
+	isNew = false;
+	break;
+	}
+	}
+	}
+	if (isNew) {
+	newoption = new Option(selectedText, selectedValue, false, false);
+	document.getElementById('assignclass2').options[boxLength] = newoption;
+	document.getElementById('assignclass1').options[selectedItem].text = '';
+	}
+	document.getElementById('assignclass1').selectedIndex=-1;
+	}
+
+
+	function removeMe() {
+	var boxLength = document.getElementById('assignclass2').length;
+	var boxLength2 = document.getElementById('assignclass1').length;
+	arrSelected = new Array();
+	var count = 0;
+	for (i = 0; i < boxLength; i++) {
+	if (document.getElementById('assignclass2').options[i].selected) {
+	arrSelected[count] = document.getElementById('assignclass2').options[i].value;
+	var valname = document.getElementById('assignclass2').options[i].text;
+	for (j = 0; j < boxLength2; j++) {
+	if (document.getElementById('assignclass1').options[j].value == arrSelected[count]){
+	document.getElementById('assignclass1').options[j].text = valname;
+	}
+	}
+
+	// document.getElementById('assignclass1').options[i].text = valname;
+	}
+	count++;
+	}
+	var x;
+	for (i = 0; i < boxLength; i++) {
+	for (x = 0; x < arrSelected.length; x++) {
+	if (document.getElementById('assignclass2').options[i].value == arrSelected[x]) {
+	document.getElementById('assignclass2').options[i] = null;
+	}
+	}
+	boxLength = document.getElementById('assignclass2').length;
+	}
+	}
+
+	function clearMe(clid) {
+	location.href = document.location + \".clear\";
+	}
+
+	function saveMe(clid) {
+	var strValues = \"\";
+	var boxLength = document.getElementById('assignclass2').length;
+	var count = 0;
+	if (boxLength != 0) {
+	for (i = 0; i < boxLength; i++) {
+	if (count == 0) {
+	strValues = document.getElementById('assignclass2').options[i].value;
+	} else {
+	strValues = strValues + \",\" + document.getElementById('assignclass2').options[i].value;
+	}
+	count++;
+	}
+	}
+	if (strValues.length == 0) {
+	//alert(\"You have not made any selections\");
+	}
+	else {
+	location.href = document.location + \".\" + strValues;
+	}
+	}
+	//]]>
+	</script>";
+
+	return $script;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/content_manager.php 75/e107_plugins/content/content_manager.php
--- 6171/e107_plugins/content/content_manager.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/content_manager.php	2006-02-13 04:13:22.000000000 -0600
@@ -0,0 +1,146 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        /admin/review.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content_manager.php,v $
+|		$Revision: 1.17 $
+|		$Date: 2006/02/13 10:13:22 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+
+$plugindir = e_PLUGIN."content/";
+require_once($plugindir."content_shortcodes.php");
+
+global $tp;
+require_once(e_HANDLER."userclass_class.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+e107_require_once(e_HANDLER.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+require_once(e_HANDLER."file_class.php");
+$fl = new e_file;
+require_once($plugindir."handlers/content_class.php");
+$aa = new content;
+require_once($plugindir."handlers/content_db_class.php");
+$adb = new contentdb;
+require_once($plugindir."handlers/content_form_class.php");
+$aform = new contentform;
+
+$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php';
+include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_admin.php');
+
+$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php';
+include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.php');
+
+$deltest = array_flip($_POST);
+
+if(e_QUERY){
+	$qs = explode(".", e_QUERY);
+}
+
+// define e_pagetitle
+$aa -> setPageTitle();
+
+if(preg_match("#(.*?)_delete_(\d+)#",$deltest[$tp->toJS("delete")],$matches)){
+	$delete = $matches[1];
+	$del_id = $matches[2];
+}
+
+//these have to be set for the tiny_mce wysiwyg
+$WYSIWYG	= true;
+$e_wysiwyg	= "content_text";
+
+// ##### DB ---------------------------------------------------------------------------------------
+
+require_once(HEADERF);
+
+//include js
+function headerjs(){
+	echo "<script type='text/javascript' src='".e_FILE."popup.js'></script>\n";
+}
+
+
+if(isset($_POST['create_content'])){
+	if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none"){
+		$adb -> dbContent("create", "contentmanager");
+	}else{
+		$message = CONTENT_ADMIN_ITEM_LAN_0;
+	}
+}
+
+if(isset($_POST['update_content'])){
+	if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none"){
+		$adb -> dbContent("update", "contentmanager");
+	}else{
+		$message = CONTENT_ADMIN_ITEM_LAN_0;
+	}
+}
+
+if($delete == 'content' && is_numeric($del_id)){
+	if($sql -> db_Delete($plugintable, "content_id='$del_id' ")){
+		$message = CONTENT_ADMIN_ITEM_LAN_3;
+		$e107cache->clear("content");
+	}
+}
+
+if(isset($message)){
+	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+if(!e_QUERY){
+	if(USERID){
+		$aform -> show_contentmanager("edit", USERID, USERNAME);
+		require_once(FOOTERF);
+		exit;
+	}else{
+		header("location:".$plugindir."content.php"); exit;
+	}
+}else{
+
+	if($qs[0] == "c"){
+		$message = CONTENT_ADMIN_ITEM_LAN_1."<br /><br />".CONTENT_ADMIN_ITEM_LAN_55;
+		$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+		require_once(FOOTERF);
+		exit;
+
+	}elseif($qs[0] == "u"){
+		$message = CONTENT_ADMIN_ITEM_LAN_2."<br /><br />".CONTENT_ADMIN_ITEM_LAN_55;
+		$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+		require_once(FOOTERF);
+		exit;
+
+	//show list of items in this category
+	}elseif($qs[0] == "content" && is_numeric($qs[1])){
+		$aform -> show_manage_content("contentmanager", USERID, USERNAME);
+
+	//create new item
+	}elseif($qs[0] == "content" && $qs[1] == "create" && is_numeric($qs[2])){
+		$aform -> show_create_content("contentmanager", USERID, USERNAME);
+
+	//edit item
+	}elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2])){
+		$aform -> show_create_content("contentmanager", USERID, USERNAME);
+
+	}else{
+		header("location:".e_SELF); exit;
+	}
+}
+
+
+require_once(FOOTERF);
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/content.php 75/e107_plugins/content/content.php
--- 6171/e107_plugins/content/content.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/content.php	2006-02-27 15:04:14.000000000 -0600
@@ -0,0 +1,1429 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        /admin/review.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content.php,v $
+|		$Revision: 1.91 $
+|		$Date: 2006/02/27 21:04:14 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+$plugindir = e_PLUGIN."content/";
+require_once($plugindir."content_shortcodes.php");
+require_once(e_HANDLER."emailprint_class.php");
+$ep = new emailprint;
+require_once(e_HANDLER."comment_class.php");
+$cobj = new comment;
+require_once(e_HANDLER."rate_class.php");
+$rater = new rater;
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+require_once($plugindir."handlers/content_class.php");
+$aa = new content;
+e107_require_once(e_HANDLER.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+$lan_file = $plugindir."languages/".e_LANGUAGE."/lan_content.php";
+include_once(file_exists($lan_file) ? $lan_file : $plugindir."languages/English/lan_content.php");
+
+if(e_QUERY){
+	$qs = explode(".", e_QUERY);
+
+	if(is_numeric($qs[0])){
+		$from = array_shift($qs);
+	}else{
+		$from = "0";
+	}
+}
+
+$aa -> setPageTitle();
+
+require_once(HEADERF);
+
+//core_head function to prepare the meta tags
+function core_head(){
+	global $qs, $sql, $tp, $pref, $plugintable, $eArrayStorage;
+
+	if($qs[0] == "content" && isset($qs[1]) && is_numeric($qs[1]) ){
+		if($sql -> db_Select($plugintable, "content_meta", "content_id='".intval($qs[1])."'")){
+			list($row['content_meta']) = $sql -> db_Fetch();
+
+			$exmeta = $row['content_meta'];
+			if($exmeta != ""){
+				$exmeta = str_replace(", ", ",", $exmeta);
+				$exmeta = str_replace(" ", ",", $exmeta);
+				$exmeta = str_replace(",", ", ", $exmeta);
+				$newmeta = "";
+				$checkmeta = preg_match_all("/\<meta name=&#039;(.*?)&#039; content=&#039;(.*?)&#039;>/si", $pref['meta_tag'], $matches);
+
+				if(empty($matches[1])){
+					$newmeta = "<meta name=&#039;keywords&#039; content=&#039;".$exmeta."&#039; />";
+				}else{
+					for($i=0;$i<count($matches[1]);$i++){
+						if($matches[1][$i] == "keywords"){
+							$newmeta .= "<meta name=&#039;".$matches[1][$i]."&#039; content=&#039;".$matches[2][$i].", ".$exmeta."&#039; />";
+						}else{
+							$newmeta .= "<meta name=&#039;".$matches[1][$i]."&#039; content=&#039;".$matches[2][$i]."&#039; />";
+						}
+					}
+				}
+				$pref['meta_tag'] = $tp -> toHTML($newmeta, "admin");
+			}
+		}
+	}
+}
+
+//include js
+function headerjs(){
+	echo "<script type='text/javascript' src='".e_FILE."popup.js'></script>\n";
+}
+
+//post comment
+if(isset($_POST['commentsubmit'])){
+	if(!is_object($sql)){ $sql = new db; }
+	if(!$sql -> db_Select($plugintable, "content_comment", "content_id='".intval($qs[1])."' ")){
+		header("location:".e_BASE."index.php"); exit;
+	}else{
+		$row = $sql -> db_Fetch();
+		if(ANON === TRUE || USER === TRUE){
+			//enter_comment($author_name, $comment, $table, $id, $pid, $subject)
+			$author = ($_POST['author_name'] ? $_POST['author_name'] : USERNAME);
+			$pid = "0";
+			$rated = (isset($_POST['rateindex']) ? $_POST['rateindex'] : "");
+			$cobj -> enter_comment($author, $_POST['comment'], $plugintable, $qs[1], $pid, $_POST['subject'], $rated);
+			if($qs[0] == "content" && is_numeric($qs[1])){
+				if(!isset($qs[2])){ $cacheid = 1; }else{ $cacheid = $qs[2]; }
+				$e107cache->clear("comment.$plugintable.$qs[1].$cacheid");
+				$e107cache->clear("$plugintable.content.$qs[1].$cacheid");
+			}
+			if($qs[0] == "cat" && is_numeric($qs[1])){
+				$e107cache->clear("comment.$plugintable.$qs[1]");
+			}
+			$main = $aa -> getMainParent( (is_numeric($qs[1]) ? $qs[1] : $qs[2]) );
+			$e107cache->clear("$plugintable.recent.$main");
+			$e107cache->clear("$plugintable.cat.list.$main");
+			$e107cache->clear("$plugintable.cat.$main");
+			$e107cache->clear("$plugintable.author.$main");
+			$e107cache->clear("$plugintable.top.$main");
+			$e107cache->clear("$plugintable.score.$main");
+		}
+	}
+}
+
+//check active keyword search
+$resultmenu = FALSE;
+$searchfieldname = "searchfield_page";
+$searchfieldmenuname = "searchfieldmenu_menu";
+if(isset($_POST['searchsubmit']) || isset($_POST[$searchfieldname]) || isset($_POST[$searchfieldmenuname])){		//if active keyword search
+	if(isset($_POST[$searchfieldname]) && $_POST[$searchfieldname] != "" && $_POST[$searchfieldname] != CONTENT_LAN_18){
+		$resultmenu = TRUE;
+		$searchkeyword = $_POST[$searchfieldname];
+	}
+	if(isset($_POST[$searchfieldmenuname]) && $_POST[$searchfieldmenuname] != "" && $_POST[$searchfieldmenuname] != CONTENT_LAN_18){
+		$resultmenu = TRUE;
+		$searchkeyword = $_POST[$searchfieldmenuname];
+	}
+	//show search results
+	if($resultmenu == TRUE){ show_content_search_result($searchkeyword); }
+}
+
+// ##### REDIRECTION MANAGEMENT -------------------------------------------------------
+//parent overview
+if(!e_QUERY){
+	show_content();
+}else{
+	//recent of parent='2'
+	if( $qs[0] == "recent" && is_numeric($qs[1]) && ( !isset($qs[2]) || substr($qs[2],0,5) == "order" ) ){
+		show_content_recent();
+
+	//item
+	}elseif( $qs[0] == "content" && is_numeric($qs[1]) ){
+		show_content_item();
+
+	//all categories of parent='2'
+	}elseif( $qs[0] == "cat" && $qs[1] == "list" && is_numeric($qs[2]) && !isset($qs[3]) ){
+		show_content_cat_all();
+
+	//category of parent='2' and content_id='5'
+	}elseif( $qs[0] == "cat" && is_numeric($qs[1]) && (!isset($qs[2]) || $qs[2] == "comment" || substr($qs[2],0,5) == "order") ){
+		
+		if( isset($qs[2]) && $qs[2] == "comment" ){
+			show_content_cat("comment");
+		}else{
+			show_content_cat();
+		}
+
+	//top rated of parent='2'
+	}elseif( $qs[0] == "top" && is_numeric($qs[1]) && !isset($qs[2]) ){
+		show_content_top();
+
+	//top score of parent='2'
+	}elseif( $qs[0] == "score" && is_numeric($qs[1]) ){
+		// && !isset($qs[2])
+		show_content_score();
+
+	//authorlist of parent='2'
+	}elseif( $qs[0] == "author" && $qs[1] == "list" && is_numeric($qs[2]) && ( !isset($qs[3]) || substr($qs[3],0,5) == "order" ) ){
+		show_content_author_all();
+
+	//authorlist of parent='2' and content_id='5'
+	}elseif( $qs[0] == "author" && is_numeric($qs[1]) && (!isset($qs[2]) || substr($qs[2],0,5) == "order")  ){
+		show_content_author();
+
+	//archive of parent='2'
+	}elseif( $qs[0] == "list" && is_numeric($qs[1])  ){
+		show_content_archive();
+	}else{
+		js_location(e_SELF);
+	}
+}
+// ##### ------------------------------------------------------------------------------
+
+// ##### CONTENT SEARCH MENU ----------------------------
+function show_content_search_menu($mode, $mainparent){
+		global $qs, $plugindir, $content_shortcodes, $tp, $ns, $rs, $aa;
+		global $plugintable, $gen, $content_pref;
+		global $CONTENT_SEARCH_TABLE_SELECT, $CONTENT_SEARCH_TABLE_ORDER, $CONTENT_SEARCH_TABLE_KEYWORD;
+
+		if( (isset($content_pref["content_navigator_{$mode}_{$mainparent}"]) && $content_pref["content_navigator_{$mode}_{$mainparent}"]) || (isset($content_pref["content_search_{$mode}_{$mainparent}"]) && $content_pref["content_search_{$mode}_{$mainparent}"]) || (isset($content_pref["content_ordering_{$mode}_{$mainparent}"]) && $content_pref["content_ordering_{$mode}_{$mainparent}"]) ){
+
+			if(!isset($CONTENT_SEARCH_TABLE)){
+				if(!$content_pref["content_theme_{$mainparent}"]){
+					require_once($plugindir."templates/default/content_search_template.php");
+				}else{
+					if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_search_template.php")){
+						require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_search_template.php");
+					}else{
+						require_once($plugindir."templates/default/content_search_template.php");
+					}
+				}
+			}
+			if(isset($content_pref["content_navigator_{$mode}_{$mainparent}"]) && $content_pref["content_navigator_{$mode}_{$mainparent}"]){
+				$CONTENT_SEARCH_TABLE_SELECT = $aa -> showOptionsSelect("page", $mainparent);
+			}
+			if(isset($content_pref["content_search_{$mode}_{$mainparent}"]) && $content_pref["content_search_{$mode}_{$mainparent}"]){
+				$CONTENT_SEARCH_TABLE_KEYWORD = $aa -> showOptionsSearch("page", $mainparent);
+			}
+			if(isset($content_pref["content_ordering_{$mode}_{$mainparent}"]) && $content_pref["content_ordering_{$mode}_{$mainparent}"]){
+				$CONTENT_SEARCH_TABLE_ORDER = $aa -> showOptionsOrder("page", $mainparent);
+			}
+
+			$text = $tp -> parseTemplate($CONTENT_SEARCH_TABLE, FALSE, $content_shortcodes);
+
+			if($content_pref["content_searchmenu_rendertype_{$mainparent}"] == "2"){
+				$caption = CONTENT_LAN_77;
+				$ns -> tablerender($caption, $text);
+			}else{
+				echo $text;
+			}
+		}
+		return TRUE;
+
+}
+
+function show_content_search_result($searchkeyword){
+		global $row, $qs, $content_shortcodes, $ns, $rs, $tp, $plugindir, $plugintable, $gen, $aa, $content_pref, $datequery, $gen, $mainparent, $content_icon_path;
+
+		$mainparent			= $aa -> getMainParent( (is_numeric($qs[1]) ? $qs[1] : intval($qs[2])) );
+		$content_pref		= $aa -> getContentPref($mainparent);
+		$array				= $aa -> getCategoryTree("", intval($qs[1]), TRUE);
+		$validparent		= implode(",", array_keys($array));
+		$qry				= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+		$searchkeyword		= $tp -> toDB($searchkeyword);
+		$qry				.= " AND (content_heading REGEXP '".$searchkeyword."' OR content_subheading REGEXP '".$searchkeyword."' OR content_summary REGEXP '".$searchkeyword."' OR content_text REGEXP '".$searchkeyword."' ) ";
+		$content_icon_path	= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+
+		$sqlsr = "";
+		if(!is_object($sqlsr)){ $sqlsr = new db; }
+		if(!$sqlsr -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_author, content_icon, content_datestamp", " ".$qry." ".$datequery." ORDER BY content_heading")){
+			$textsr = "<div style='text-align:center;'>".CONTENT_SEARCH_LAN_0."</div>";
+		}else{
+			if(!isset($CONTENT_SEARCHRESULT_TABLE)){
+				if(!$content_pref["content_theme_{$mainparent}"]){
+					require_once($plugindir."templates/default/content_searchresult_template.php");
+				}else{
+					if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_searchresult_template.php")){
+						require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_searchresult_template.php");
+					}else{
+						require_once($plugindir."templates/default/content_searchresult_template.php");
+					}
+				}
+			}
+			$content_searchresult_table_string = "";
+			if(!is_object($gen)){ $gen = new convert; }
+			while($row = $sqlsr -> db_Fetch()){
+				
+				$row['content_heading']		= parsesearch($row['content_heading'], $searchkeyword, "full");
+				$row['content_subheading']	= parsesearch($row['content_subheading'], $searchkeyword, "full");
+				$row['content_text']		= parsesearch($row['content_text'], $searchkeyword, "");
+
+				$content_searchresult_table_string .= $tp -> parseTemplate($CONTENT_SEARCHRESULT_TABLE, FALSE, $content_shortcodes);
+			}
+			$textsr = $CONTENT_SEARCHRESULT_TABLE_START.$content_searchresult_table_string.$CONTENT_SEARCHRESULT_TABLE_END;
+		}
+		$caption = CONTENT_LAN_20;
+		$ns -> tablerender($caption, $textsr);
+		require_once(FOOTERF);
+		exit;
+}
+
+function parsesearch($text, $match, $amount){
+		$text = strip_tags($text);
+		$temp = stristr($text,$match);
+		$pos = strlen($text)-strlen($temp);
+		
+		if($amount == "full"){
+		}else{
+			if($pos < 140){
+					$text = "...".substr($text, 0, 140)."...";
+			}else{
+					$text = "...".substr($text, ($pos-140), 280)."...";
+			}
+		}
+		$text = preg_replace("/".$match."/i", "<span class='searchhighlight' style='color:red;'>$match</span>", $text);
+		return($text);
+}
+
+// ##### CONTENT TYPE LIST ------------------------------
+function show_content(){
+		global $qs, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $content_cat_icon_path_large, $content_cat_icon_path_small, $datequery, $content_icon_path, $eArrayStorage, $contenttotal, $row;
+
+		if(!isset($CONTENT_TYPE_TABLE)){
+			require_once(e_PLUGIN."content/templates/content_type_template.php");
+		}
+
+		$cachestr = "$plugintable.typelist";
+		if($cache = $e107cache->retrieve($cachestr)){
+			echo $cache;
+		}else{
+			ob_start();
+			if(!is_object($sql)){ $sql = new db; }
+			if(!$sql -> db_Select($plugintable, "*", "content_parent = '0' AND content_class REGEXP '".e_CLASS_REGEXP."' ".$datequery." ORDER BY content_heading")){
+				$text .= "<div style='text-align:center;'>".CONTENT_LAN_21."</div>";
+			}else{
+
+				$sql2 = "";
+				$content_type_table_string = "";
+				$plist = $sql->db_getList();
+				foreach($plist as $row)
+				{
+					if(!is_object($sql2)){ $sql2 = new db; }
+
+					//$content_pref = unserialize(stripslashes($row['content_pref']));
+					$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
+					$content_pref["content_cat_icon_path_large_{$row['content_id']}"] = ($content_pref["content_cat_icon_path_large_{$row['content_id']}"] ? $content_pref["content_cat_icon_path_large_{$row['content_id']}"] : "{e_PLUGIN}content/images/cat/48/" );
+					$content_pref["content_cat_icon_path_small_{$row['content_id']}"] = ($content_pref["content_cat_icon_path_small_{$row['content_id']}"] ? $content_pref["content_cat_icon_path_small_{$row['content_id']}"] : "{e_PLUGIN}content/images/cat/16/" );
+					$content_cat_icon_path_large	= $tp->replaceConstants($content_pref["content_cat_icon_path_large_{$row['content_id']}"]);
+					$content_cat_icon_path_small	= $tp->replaceConstants($content_pref["content_cat_icon_path_small_{$row['content_id']}"]);
+					$content_icon_path				= $tp->replaceConstants($content_pref["content_icon_path_{$row['content_id']}"]);
+
+					$array			= $aa -> getCategoryTree("", $row['content_id'], TRUE);
+					$validparent	= implode(",", array_keys($array));
+					$qry			= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+					$contenttotal	= $sql2 -> db_Count($plugintable, "(*)", "WHERE content_refer != 'sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."'" );
+					$content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE, FALSE, $content_shortcodes);
+				}
+
+				$SUBMIT_LINE = FALSE;
+				$submit = FALSE;
+				$sql3 = "";
+				if(!is_object($sql3)){ $sql3 = new db; }
+				if($sql3 -> db_Select($plugintable, "content_id, content_pref", "content_parent = '0' ".$datequery." ORDER BY content_parent")){
+					while($row = $sql3 -> db_Fetch()){
+						if(isset($row['content_pref']) && $row['content_pref']){
+							$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
+						}
+						if($content_pref["content_submit_{$row['content_id']}"] && check_class($content_pref["content_submit_class_{$row['content_id']}"])){
+							$submit = TRUE;
+							break;
+						}
+					}
+					if($submit === TRUE){
+						$content_type_table_string .= $CONTENT_TYPE_TABLE_LINE;
+						$content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE_SUBMIT, FALSE, $content_shortcodes);
+						$SUBMIT_LINE = TRUE;
+					}
+				}
+
+				if(USERID){
+					$personalmanagercheck = FALSE;
+					$array = $aa -> getCategoryTree("", "", TRUE);
+					$catarray = array_keys($array);
+					$qry = "";
+					foreach($catarray as $catid){
+						$qry .= " content_id='".$catid."' || ";
+					}
+					$qry = substr($qry,0,-3);
+					if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " ".$qry." ")){
+						while($row = $sql -> db_Fetch()){
+							if(isset($row['content_pref']) && $row['content_pref']){
+								$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
+							}
+							//assign new preferences
+							if(getperms("0") ){
+								$personalmanagercheck = TRUE;
+								break;
+							}
+							$contentid = $row['content_id'];
+							if(isset($content_pref["content_manager_allowed_{$row['content_id']}"]) ){
+								$pcm = explode(",", $content_pref["content_manager_allowed_{$row['content_id']}"]);
+								if(in_array(USERID, $pcm)){
+									$personalmanagercheck = TRUE;
+									break;
+								}
+							}
+						}
+					}
+					if($personalmanagercheck == TRUE){
+						if($SUBMIT_LINE != TRUE){
+							$content_type_table_string .= $CONTENT_TYPE_TABLE_LINE;
+						}
+						$content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE_MANAGER, FALSE, $content_shortcodes);
+					}
+				}
+				$text = $CONTENT_TYPE_TABLE_START.$content_type_table_string.$CONTENT_TYPE_TABLE_END;
+			}
+			$caption = CONTENT_LAN_22;
+			$ns -> tablerender($caption, $text);
+
+			if($pref['cachestatus']){
+				$cache = ob_get_contents();
+				$e107cache->set($cachestr, $cache);
+			}
+			ob_end_flush(); // dump collected data
+		}
+}
+
+// ##### CONTENT ARCHIVE ------------------------------------------
+function show_content_archive(){
+		global $row, $ns, $plugindir, $plugintable, $sql, $aa, $rs, $e107cache, $tp, $pref, $content_pref, $cobj;
+		global $qs, $searchkeyword, $nextprevquery, $from, $number, $mainparent, $content_shortcodes;
+		global $CONTENT_ARCHIVE_TABLE, $CONTENT_ARCHIVE_TABLE_START, $datequery, $CONTENT_ARCHIVE_TABLE_LETTERS;
+		global $CONTENT_SEARCH_TABLE_SELECT, $CONTENT_SEARCH_TABLE_ORDER, $CONTENT_SEARCH_TABLE_KEYWORD, $CONTENT_ARCHIVE_TABLE_AUTHOR;
+
+		$mainparent		= $aa -> getMainParent(intval($qs[1]));
+		$content_pref	= $aa -> getContentPref($mainparent);
+
+		show_content_search_menu("archive", $mainparent);		//show navigator/search/order menu
+
+		if(!isset($CONTENT_ARCHIVE_TABLE)){
+			if(!$content_pref["content_theme_{$mainparent}"]){
+				require_once($plugindir."templates/default/content_archive_template.php");
+			}else{
+				if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_archive_template.php")){
+					require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_archive_template.php");
+				}else{
+					require_once($plugindir."templates/default/content_archive_template.php");
+				}
+			}
+		}
+
+		$cachestr = "$plugintable.archive.$qs[1]";
+		if($cache = $e107cache->retrieve($cachestr)){
+			echo $cache;
+		}else{
+			ob_start();
+			
+			$text = "";
+			$array			= $aa -> getCategoryTree("", $mainparent, TRUE);
+			$validparent	= implode(",", array_keys($array));
+			$qry			= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+			$number			= (isset($content_pref["content_archive_nextprev_number_{$mainparent}"]) && $content_pref["content_archive_nextprev_number_{$mainparent}"] ? $content_pref["content_archive_nextprev_number_{$mainparent}"] : "30");
+			$order			= $aa -> getOrder();
+			$nextprevquery	= (isset($content_pref["content_archive_nextprev_{$mainparent}"]) && $content_pref["content_archive_nextprev_{$mainparent}"] ? "LIMIT ".intval($from).",".intval($number) : "");
+			$sql1 = new db;
+			
+			if(isset($content_pref["content_archive_letterindex_{$mainparent}"]) && $content_pref["content_archive_letterindex_{$mainparent}"]){
+				$distinctfirstletter = $sql -> db_Select($plugintable, " DISTINCT(content_heading) ", "content_refer != 'sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ORDER BY content_heading ASC ");
+				while($row = $sql -> db_Fetch()){
+					$head = $tp->toHTML($row['content_heading'], TRUE);
+					if(ord($head) < 128) {
+						$head_sub = strtoupper(substr($head,0,1));
+					}else{
+						$head_sub = substr($head,0,2);
+					}
+					$arrletters[] = $head_sub;
+				}
+				$arrletters = array_unique($arrletters);
+				$arrletters = array_values($arrletters);
+				sort($arrletters);
+
+				if ($distinctfirstletter > 1){
+					$CONTENT_ARCHIVE_TABLE_LETTERS = "<form method='post' action='".e_SELF."?list.".$mainparent."'>";
+					for($i=0;$i<count($arrletters);$i++){
+						if($arrletters[$i]!= ""){
+							$CONTENT_ARCHIVE_TABLE_LETTERS .= "<input class='button' style='width:20px' type='submit' name='letter' value='".strtoupper($arrletters[$i])."' onclick=\"document.location='".e_SELF."?list.".$mainparent.".".strtoupper($arrletters[$i])."'\" /> ";
+						}
+					}
+					$CONTENT_ARCHIVE_TABLE_LETTERS .= "<input class='button' style='width:20' type='submit' name='letter' value='all' />";
+					$CONTENT_ARCHIVE_TABLE_LETTERS .= "</form>";
+				}
+				//check posted letter
+				$letter=(isset($_POST['letter']) ? $_POST['letter'] : "");
+				if ($letter != "" && $letter != "all" ) { $qry .= " AND content_heading LIKE '".$tp->toDB($letter)."%' "; }else{ $qry .= ""; }
+			}
+			$CONTENT_ARCHIVE_TABLE_START = $tp -> parseTemplate($CONTENT_ARCHIVE_TABLE_START, FALSE, $content_shortcodes);
+
+			$contenttotal = $sql1 -> db_Count($plugintable, "(*)", "WHERE content_refer !='sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ");
+			if($from > $contenttotal-1){ header("location:".e_SELF); exit; }
+
+			if($item = $sql1 -> db_Select($plugintable, "*", "content_refer !='sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ".$order." ".$nextprevquery )){
+				$content_archive_table_string = "";
+				while($row = $sql1 -> db_Fetch()){
+					$CONTENT_ARCHIVE_TABLE_AUTHOR	= $aa -> prepareAuthor("archive", $row['content_author'], $row['content_id']);
+					$content_archive_table_string .= $tp -> parseTemplate($CONTENT_ARCHIVE_TABLE, FALSE, $content_shortcodes);
+				}
+				$text .= $CONTENT_ARCHIVE_TABLE_START.$content_archive_table_string.$CONTENT_ARCHIVE_TABLE_END;
+			}
+			$text		= $aa -> getCrumbPage("archive", $array, $mainparent).$text;
+			$caption	= CONTENT_LAN_84;
+			$ns->tablerender($caption, $text);
+			$aa -> ShowNextPrev("archive", $from, $number, $contenttotal);
+			if($pref['cachestatus']){
+				$cache = ob_get_contents();
+				$e107cache->set($cachestr, $cache);
+			}
+			ob_end_flush(); // dump collected data
+		}
+}
+
+//this function renders the preview of a content_item
+//used in recent list, view author list, category items list
+function displayPreview($qry){
+		global $qs, $array, $row, $gen, $rater, $aa, $sql2, $tp, $plugintable, $plugindir, $content_shortcodes, $content_pref, $mainparent, $CONTENT_RECENT_TABLE_AUTHORDETAILS;
+		global $CONTENT_RECENT_TABLE_START, $CONTENT_RECENT_TABLE_END, $CONTENT_RECENT_TABLE, $CONTENT_RECENT_TABLE_INFOPRE, $CONTENT_RECENT_TABLE_INFOPOST;
+
+		if(!isset($CONTENT_RECENT_TABLE)){
+			if(!$content_pref["content_theme_{$mainparent}"]){
+				require_once($plugindir."templates/default/content_recent_template.php");
+			}else{
+				if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_recent_template.php")){
+					require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_recent_template.php");
+				}else{
+					require_once($plugindir."templates/default/content_recent_template.php");
+				}
+			}
+		}
+		if($resultitem = $sql2 -> db_Select($plugintable, "*", $qry )){
+			$content_recent_table_string = "";
+			while($row = $sql2 -> db_Fetch()){
+				$rdate	= $tp -> parseTemplate('{CONTENT_RECENT_TABLE_DATE}', FALSE, $content_shortcodes);
+				$rauth	= $tp -> parseTemplate('{CONTENT_RECENT_TABLE_AUTHORDETAILS}', FALSE, $content_shortcodes);
+				$rep	= $tp -> parseTemplate('{CONTENT_RECENT_TABLE_EPICONS}', FALSE, $content_shortcodes);
+				$rpar	= $tp -> parseTemplate('{CONTENT_RECENT_TABLE_PARENT}', FALSE, $content_shortcodes);
+				$redi	= $tp -> parseTemplate('{CONTENT_RECENT_TABLE_EDITICON}', FALSE, $content_shortcodes);
+				$CONTENT_RECENT_TABLE_INFOPRE = FALSE;
+				$CONTENT_RECENT_TABLE_INFOPOST = FALSE;
+				if ($rdate!="" || $rauth!="" || $rep!="" || $rpar!="" || $redi!="" ) {
+					$CONTENT_RECENT_TABLE_INFOPRE = TRUE;
+					$CONTENT_RECENT_TABLE_INFOPOST = TRUE;
+				}
+				$CONTENT_RECENT_TABLE_AUTHORDETAILS = $aa -> prepareAuthor("list", $row['content_author'], $row['content_id']);
+				$content_recent_table_string .= $tp -> parseTemplate($CONTENT_RECENT_TABLE, FALSE, $content_shortcodes);
+			}
+		}
+		$text = $CONTENT_RECENT_TABLE_START.$content_recent_table_string.$CONTENT_RECENT_TABLE_END;
+
+		return $text;
+}
+
+// ##### RECENT LIST ------------------------------------
+function show_content_recent(){
+		global $qs, $sql2, $plugindir, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $cobj;
+		global $nextprevquery, $from, $number, $mainparent, $datequery, $content_icon_path, $CONTENT_RECENT_TABLE;
+
+		$mainparent		= $aa -> getMainParent(intval($qs[1]));
+		$content_pref	= $aa -> getContentPref($mainparent);
+		show_content_search_menu("recent", $mainparent);		//show navigator/search/order menu
+
+		$cachestr = "$plugintable.recent.$qs[1]";
+		if($cache = $e107cache->retrieve($cachestr)){
+			echo $cache;
+		}else{
+			ob_start();
+
+			$content_icon_path	= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+			$array				= $aa -> getCategoryTree("", intval($qs[1]), TRUE);
+			$validparent		= implode(",", array_keys($array));
+			$order				= $aa -> getOrder();
+			$number				= ($content_pref["content_nextprev_number_{$mainparent}"] ? $content_pref["content_nextprev_number_{$mainparent}"] : "5");
+			$nextprevquery		= ($content_pref["content_nextprev_{$mainparent}"] ? "LIMIT ".intval($from).",".intval($number) : "");
+			$qry				= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+
+			$contenttotal = $sql2 -> db_Count($plugintable, "(*)", "WHERE content_refer != 'sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' " );
+
+			if($from > $contenttotal-1){ js_location(e_SELF); }
+			
+			$recentqry			= "content_refer !='sa' AND ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ".$order." ".$nextprevquery;
+			$text				= displayPreview($recentqry);
+			$text				= $aa -> getCrumbPage("recent", $array, $mainparent).$text;
+			$caption			= CONTENT_LAN_23;
+			$ns -> tablerender($caption, $text);
+			$aa -> ShowNextPrev("", $from, $number, $contenttotal);
+			if($pref['cachestatus']){
+				$cache = ob_get_contents();
+				$e107cache->set($cachestr, $cache);
+			}
+			ob_end_flush(); // dump collected data
+		}
+}
+
+// ##### CATEGORY LIST ------------------------------------
+function show_content_cat_all(){
+		global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $aa, $e107cache, $tp, $pref, $content_pref, $totalitems;
+		global $sql, $datequery, $amount, $from, $content_cat_icon_path_large, $content_icon_path, $n, $mainparent, $CONTENT_CAT_TABLE, $CONTENT_CAT_TABLE_AUTHORDETAILS;
+		global $row, $datestamp, $comment_total, $gen, $authordetails, $rater, $crumb;
+		global $CONTENT_CAT_TABLE_INFO_PRE, $CONTENT_CAT_TABLE_INFO_POST, $CONTENT_CAT_LIST_TABLE_INFO_PRE, $CONTENT_CAT_LIST_TABLE_INFO_POST;
+
+		unset($text);
+
+		$mainparent		= $aa -> getMainParent(intval($qs[2]));
+		$content_pref	= $aa -> getContentPref($mainparent);
+		show_content_search_menu("catall", $mainparent);		//show navigator/search/order menu
+
+		if(!isset($CONTENT_CAT_TABLE)){
+			if(!$content_pref["content_theme_{$mainparent}"]){
+				require_once($plugindir."templates/default/content_cat_template.php");
+			}else{
+				if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_cat_template.php")){
+					require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_cat_template.php");
+				}else{
+					require_once($plugindir."templates/default/content_cat_template.php");
+				}
+			}
+		}
+
+		$cachestr = "$plugintable.cat.list.$qs[2]";
+		if($cache = $e107cache->retrieve($cachestr)){
+			echo $cache;
+		}else{
+			ob_start();
+
+			$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$mainparent}"]);
+			$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+			$array							= $aa -> getCategoryTree("", $mainparent, TRUE);
+			$validparent					= implode(",", array_keys($array));
+			$order							= $aa -> getOrder();
+			$number							= (isset($content_pref["content_nextprev_number_{$mainparent}"]) && $content_pref["content_nextprev_number_{$mainparent}"] ? $content_pref["content_nextprev_number_{$mainparent}"] : "5");
+			$nextprevquery					= (isset($content_pref["content_nextprev_{$mainparent}"]) && $content_pref["content_nextprev_{$mainparent}"] ? "LIMIT ".intval($from).",".intval($number) : "");
+			$qry							= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+
+			$content_cat_table_string = "";
+			$newarray = array_merge_recursive($array);
+			for($a=0;$a<count($newarray);$a++){
+				for($b=0;$b<count($newarray[$a]);$b++){
+					$newparent[$newarray[$a][$b]] = $newarray[$a][$b+1];
+					$b++;
+				}
+			}
+			foreach($newparent as $key => $value){
+				$totalitems = $aa -> countCatItems($key);
+				$sql -> db_Select($plugintable, "*", "content_id = '".$key."' ");
+				$row = $sql -> db_Fetch();
+				
+				$date	= $tp -> parseTemplate('{CONTENT_CAT_TABLE_DATE}', FALSE, $content_shortcodes);
+				$auth	= $tp -> parseTemplate('{CONTENT_CAT_TABLE_AUTHORDETAILS}', FALSE, $content_shortcodes);
+				$ep		= $tp -> parseTemplate('{CONTENT_CAT_TABLE_EPICONS}', FALSE, $content_shortcodes);
+				$com	= $tp -> parseTemplate('{CONTENT_CAT_TABLE_COMMENT}', FALSE, $content_shortcodes);
+				$CONTENT_CAT_TABLE_INFO_PRE = FALSE;
+				$CONTENT_CAT_TABLE_INFO_POST = FALSE;
+				if ($date!="" || $auth!="" || $ep!="" || $com!="" ) {
+					$CONTENT_CAT_TABLE_INFO_PRE = TRUE;
+					$CONTENT_CAT_TABLE_INFO_POST = TRUE;
+				}
+				$CONTENT_CAT_TABLE_AUTHORDETAILS = $aa -> prepareAuthor("catall", $row['content_author'], $row['content_id']);
+				$content_cat_table_string .= $tp -> parseTemplate($CONTENT_CAT_TABLE, FALSE, $content_shortcodes);
+
+			}
+			$text		= $CONTENT_CAT_TABLE_START.$content_cat_table_string.$CONTENT_CAT_TABLE_END;
+			$text		= $aa -> getCrumbPage("catall", $array, $mainparent).$text;
+			$caption	= CONTENT_LAN_25;
+			$ns -> tablerender($caption, $text);
+
+			if($pref['cachestatus']){
+				$cache = ob_get_contents();
+				$e107cache->set($cachestr, $cache);
+			}
+			ob_end_flush(); // dump collected data
+		}
+}
+
+function show_content_cat($mode=""){
+		global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $cobj, $datequery, $from;
+		global $CONTENT_RECENT_TABLE, $CONTENT_CAT_LIST_TABLE, $CONTENT_CAT_LISTSUB_TABLE_START, $CONTENT_CAT_LISTSUB_TABLE, $CONTENT_CAT_LISTSUB_TABLE_END, $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS, $CONTENT_CAT_LIST_TABLE_INFO_PRE, $CONTENT_CAT_LIST_TABLE_INFO_POST;
+		global $content_cat_icon_path_small, $content_cat_icon_path_large, $content_icon_path, $mainparent, $totalparent, $totalsubcat;
+		global $row, $datestamp, $comment_total, $gen, $authordetails, $rater, $crumb, $amount;
+
+		$mainparent		= $aa -> getMainParent(intval($qs[1]));
+		$content_pref	= $aa -> getContentPref($mainparent);
+		$array			= $aa -> getCategoryTree("", $mainparent, TRUE);
+		$validparent	= "0,0.".implode(",0.", array_keys($array));
+		$qry			= " content_id = '".intval($qs[1])."' AND content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ";
+
+		show_content_search_menu("cat", $mainparent);		//show navigator/search/order menu
+
+		if(!isset($CONTENT_CAT_LIST_TABLE)){
+			if(!$content_pref["content_theme_{$mainparent}"]){
+				require_once($plugindir."templates/default/content_cat_template.php");
+			}else{
+				if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_cat_template.php")){
+					require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_cat_template.php");
+				}else{
+					require_once($plugindir."templates/default/content_cat_template.php");
+				}
+			}
+		}
+
+		$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$mainparent}"]);
+		$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$mainparent}"]);
+		$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);					
+		$order							= $aa -> getOrder();
+		$number							= (isset($content_pref["content_nextprev_number_{$mainparent}"]) && $content_pref["content_nextprev_number_{$mainparent}"] ? $content_pref["content_nextprev_number_{$mainparent}"] : "5");
+		$nextprevquery					= (isset($content_pref["content_nextprev_{$mainparent}"]) && $content_pref["content_nextprev_{$mainparent}"] ? "LIMIT ".intval($from).",".intval($number) : "");
+		$capqs							= array_reverse($array[$qs[1]]);
+		$caption						= CONTENT_LAN_26." : ".$capqs[0];
+
+		// parent article
+		if(isset($content_pref["content_cat_showparent_{$mainparent}"]) && $content_pref["content_cat_showparent_{$mainparent}"]){
+			if(!$resultparent = $sql -> db_Select($plugintable, "*", $qry )){
+				header("location:".e_SELF."?cat.list.".$mainparent); exit;
+			}else{
+				$row = $sql -> db_Fetch();
+				$date	= $tp -> parseTemplate('{CONTENT_CAT_LIST_TABLE_DATE}', FALSE, $content_shortcodes);
+				$auth	= $tp -> parseTemplate('{CONTENT_CAT_LIST_TABLE_AUTHORDETAILS}', FALSE, $content_shortcodes);
+				$ep		= $tp -> parseTemplate('{CONTENT_CAT_LIST_TABLE_EPICONS}', FALSE, $content_shortcodes);
+				$com	= $tp -> parseTemplate('{CONTENT_CAT_LIST_TABLE_COMMENT}', FALSE, $content_shortcodes);
+				if ($date!="" || $auth!="" || $ep!="" || $com!="" ) {
+					$CONTENT_CAT_LIST_TABLE_INFO_PRE = TRUE;
+					$CONTENT_CAT_LIST_TABLE_INFO_POST = TRUE;
+				}
+				$totalparent = $aa -> countCatItems($row['content_id']);
+				$CONTENT_CAT_LIST_TABLE_AUTHORDETAILS = $aa -> prepareAuthor("cat", $row['content_author'], $row['content_id']);
+				$textparent			= $tp -> parseTemplate($CONTENT_CAT_LIST_TABLE, FALSE, $content_shortcodes);							
+			}
+		}
+
+		$cachestr = "$plugintable.cat.$qs[1]";
+		if($cache = $e107cache->retrieve($cachestr)){
+			echo $cache;
+		}else{
+			ob_start();
+
+			if(!$mode || $mode == ""){
+
+				$check			= (isset($qs[1]) && is_numeric($qs[1]) ? intval($qs[1]) : intval($mainparent));
+				$array1			= $aa -> getCategoryTree("", $check, TRUE);
+				$newarray		= array_merge_recursive($array1);
+				for($a=0;$a<count($newarray);$a++){
+					for($b=0;$b<count($newarray[$a]);$b++){
+						$subparent[$newarray[$a][$b]] = $newarray[$a][$b+1];
+						$b++;
+					}
+				}
+				$subparent		= array_keys($subparent);
+				$validsub		= "0.".implode(",0.", $subparent);
+				$subqry			= " content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validsub)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ";
+
+				//list subcategories
+				if(isset($content_pref["content_cat_showparentsub_{$mainparent}"]) && $content_pref["content_cat_showparentsub_{$mainparent}"]){
+
+					$content_cat_listsub_table_string = "";
+					for($i=0;$i<count($subparent);$i++){
+						if($resultsubparent = $sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_icon, content_parent", " content_id = '".$subparent[$i]."' AND ".$subqry." " )){
+							while($row = $sql -> db_Fetch()){
+								$totalsubcat = $aa -> countCatItems($row['content_id']);
+								$content_cat_listsub_table_string .= $tp -> parseTemplate($CONTENT_CAT_LISTSUB_TABLE, FALSE, $content_shortcodes);
+							}
+							$textsubparent = $CONTENT_CAT_LISTSUB_TABLE_START.$content_cat_listsub_table_string.$CONTENT_CAT_LISTSUB_TABLE_END;
+							$captionsubparent = CONTENT_LAN_28;
+						}
+					}
+				}
+
+				//list all contents within this category
+				unset($text);
+
+				//also show content items of subcategories of this category ?
+				if(isset($content_pref["content_cat_listtype_{$mainparent}"]) && $content_pref["content_cat_listtype_{$mainparent}"]){
+					$validitem		= implode(",", $subparent);
+					$qrycat			= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validitem)."' ";
+				}else{
+					$qrycat			= " content_parent = '".intval($qs[1])."' ";
+				}
+				$qrycat				= " content_refer !='sa' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' AND ".$qrycat." ";
+				$contenttotal		= $sql -> db_Count($plugintable, "(*)", "WHERE ".$qrycat);
+				$childqry			= $qrycat." ".$order." ".$nextprevquery;
+				$textchild			= displayPreview($childqry);
+				$captionchild		= CONTENT_LAN_31;
+
+				if(isset($content_pref["content_nextprev_{$mainparent}"]) && $content_pref["content_nextprev_{$mainparent}"]){
+					require_once(e_HANDLER."np_class.php");
+					$np_querystring = (isset($qs[0]) ? $qs[0] : "").(isset($qs[1]) ? ".".$qs[1] : "").(isset($qs[2]) ? ".".$qs[2] : "").(isset($qs[3]) ? ".".$qs[3] : "").(isset($qs[4]) ? ".".$qs[4] : "");
+				}
+				$crumbpage = $aa -> getCrumbPage("cat", $array, $qs[1]);
+				if(isset($textparent)){ 
+					$textparent = $crumbpage.$textparent;
+				}else{
+					$textchild = $crumbpage.$textchild;
+				}
+				if(isset($content_pref["content_cat_menuorder_{$mainparent}"]) && $content_pref["content_cat_menuorder_{$mainparent}"] == "1"){
+					if(isset($content_pref["content_cat_rendertype_{$mainparent}"]) && $content_pref["content_cat_rendertype_{$mainparent}"] == "1"){
+						if(isset($textparent)){		$ns -> tablerender($caption, $textparent); }
+						if(isset($textsubparent)){	$ns -> tablerender($captionsubparent, $textsubparent); }
+						if(isset($textchild)){		$ns -> tablerender($captionchild, $textchild); }
+					}else{
+						$ns -> tablerender($caption, (isset($textparent) ? $textparent : "").(isset($textsubparent) ? $textsubparent : "").$textchild);
+					}
+					if(isset($content_pref["content_nextprev_{$mainparent}"]) && $content_pref["content_nextprev_{$mainparent}"]){
+						$ix = new nextprev("content.php", $from, $number, $contenttotal, NP_3, ($np_querystring ? $np_querystring : ""));
+					}
+				}else{
+					if(isset($content_pref["content_cat_rendertype_{$mainparent}"]) && $content_pref["content_cat_rendertype_{$mainparent}"] == "1"){
+						if(isset($textchild)){		$ns -> tablerender($captionchild, $textchild); }
+						if(isset($content_pref["content_nextprev_{$mainparent}"]) && $content_pref["content_nextprev_{$mainparent}"]){
+							$ix = new nextprev("content.php", $from, $number, $contenttotal, NP_3, ($np_querystring ? $np_querystring : ""));
+						}
+						if(isset($textparent)){		$ns -> tablerender($caption, $textparent); }
+						if(isset($textsubparent)){	$ns -> tablerender($captionsubparent, $textsubparent); }
+					}else{
+						if(isset($textchild)){		$ns -> tablerender($captionchild, $textchild); }
+						if(isset($content_pref["content_nextprev_{$mainparent}"]) && $content_pref["content_nextprev_{$mainparent}"]){
+							$ix = new nextprev("content.php", $from, $number, $contenttotal, NP_3, ($np_querystring ? $np_querystring : ""));
+						}
+						$ns -> tablerender($caption, (isset($textparent) ? $textparent : "").(isset($textsubparent) ? $textsubparent : ""));
+					}
+				}
+			}
+			if($pref['cachestatus']){
+				$cache = ob_get_contents();
+				$e107cache->set($cachestr, $cache);
+			}
+			ob_end_flush(); // dump collected data
+		}
+
+		if($mode == "comment"){
+			$textparent = $aa -> getCrumbPage("cat", $array, $mainparent).$textparent;
+			if(isset($textparent)){ $ns -> tablerender($captionparent, $textparent); }
+
+			if($resultitem = $sql -> db_Select($plugintable, "*", $qry )){
+				$row = $sql -> db_Fetch();
+				if($row['content_comment']){
+					$cachestr = "comment.$plugintable.$qs[1]";
+					if($cache = $e107cache->retrieve($cachestr)){
+						echo $cache;
+					}else{
+						ob_start();
+						if( (isset($content_pref["content_cat_rating_all_{$mainparent}"]) && $content_pref["content_cat_rating_all_{$mainparent}"]) || (isset($content_pref["content_cat_rating_{$mainparent}"]) && $content_pref["content_cat_rating_{$mainparent}"] && $row['content_rate'])){
+							$showrate = TRUE;
+						}else{
+							$showrate = FALSE;
+						}
+						$cobj->compose_comment($plugintable, "comment", $qs[1], $width, $row['content_heading'], $showrate);
+
+						if($pref['cachestatus']){
+							$cache = ob_get_contents();
+							$e107cache->set($cachestr, $cache);
+						}
+						ob_end_flush(); // dump collected data
+					}
+				}
+			}
+		}
+}
+
+// ##### AUTHOR LIST --------------------------------------
+function show_content_author_all(){
+		global $qs, $plugindir, $ix, $content_shortcodes, $ns, $plugintable, $from, $sql, $aa, $e107cache, $tp, $pref, $mainparent, $content_pref, $cobj, $datequery;
+		global $authordetails, $i, $gen, $totalcontent, $row, $CONTENT_AUTHOR_TABLE, $CONTENT_AUTHOR_TABLE_START, $CONTENT_AUTHOR_TABLE_END, $CONTENT_AUTHOR_TABLE_DATE, $CONTENT_AUTHOR_TABLE_HEADING;
+
+		$mainparent		= $aa -> getMainParent(intval($qs[2]));
+		$content_pref	= $aa -> getContentPref($mainparent);
+		show_content_search_menu("authorall", $mainparent);		//show navigator/search/order menu
+
+		if(!isset($CONTENT_AUTHOR_TABLE)){
+			if(!$content_pref["content_theme_{$mainparent}"]){
+				require_once($plugindir."templates/default/content_author_template.php");
+			}else{
+				if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_author_template.php")){
+					require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_author_template.php");
+				}else{
+					require_once($plugindir."templates/default/content_author_template.php");
+				}
+			}
+		}
+
+		$cachestr = "$plugintable.author.list.$qs[2]";
+		if($cache = $e107cache->retrieve($cachestr)){
+			echo $cache;
+		}else{
+			ob_start();
+
+			$array			= $aa -> getCategoryTree("", $mainparent, TRUE);
+			$validparent	= implode(",", array_keys($array));
+			$number			= (isset($content_pref["content_author_nextprev_number_{$mainparent}"]) && $content_pref["content_author_nextprev_number_{$mainparent}"] ? $content_pref["content_author_nextprev_number_{$mainparent}"] : "5");
+			$nextprevquery	= (isset($content_pref["content_author_nextprev_{$mainparent}"]) && $content_pref["content_author_nextprev_{$mainparent}"] ? "LIMIT ".intval($from).",".intval($number) : "");
+			$qry			= " p.content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+			$dateqry		= "AND p.content_datestamp < ".time()." AND (p.content_enddate=0 || p.content_enddate>".time().")";
+
+			$sql1 = new db; $sql2 = new db;
+			$contenttotal = $sql1 -> db_Select($plugintable." AS p", "DISTINCT(p.content_author)", "p.content_refer !='sa' AND ".$qry." ".$datequery." AND p.content_class REGEXP '".e_CLASS_REGEXP."'");					
+			
+			$qry = "
+			SELECT DISTINCT(p.content_author), p.content_heading, p.content_datestamp, p.content_id, u.user_id, u.user_name, u.user_email, SUBSTRING_INDEX(p.content_author, '^', 0) AS user_name2, COUNT(i.content_id) as amount 
+			FROM #$plugintable AS p
+			LEFT JOIN #$plugintable AS i ON i.content_author = p.content_author  
+			LEFT JOIN #user AS u ON (u.user_id = p.content_author || p.content_author = u.user_name || SUBSTRING_INDEX(p.content_author, '^', 1) REGEXP 'u.user_name') 
+			WHERE p.content_refer !='sa' AND ".$qry." ".$dateqry." AND p.content_class REGEXP '".e_CLASS_REGEXP."' AND i.content_class REGEXP '".e_CLASS_REGEXP."'
+			GROUP BY i.content_id
+			ORDER BY p.content_datestamp ASC, p.content_author
+			";
+
+			$author = array();
+			$options = "";
+			if ($sql1->db_Select_gen($qry)){
+				while($row1 = $sql1 -> db_Fetch()){
+					$row = $row1;
+					
+					if(is_numeric($row['content_author'])){
+						$name = ($row['user_name'] ? $row['user_name'] : CONTENT_LAN_29);
+					}else{
+						if(strpos($row['content_author'], "^")){
+							$tmp = explode("^", $row['content_author']);
+							if(is_numeric($tmp[0])){
+								$name = $tmp[1];
+							}else{
+								$name = $tmp[0];
+							}
+						}else{
+							$name = $row['content_author'];
+						}
+						$name = ($name ? $name : CONTENT_LAN_29);
+					}
+					if(is_array($author)){
+						if(!in_array($name, $author)){
+
+							$display = (strlen($name) > 29 ? substr($name,0,29)."..." : $name);
+							$arrData[] = array($name, $row['content_id'], $row['content_heading'], $row['content_datestamp'], $row['amount']);
+							$author[] = $name;
+						}
+					}
+				}
+
+				function cmp($a, $b)
+				{
+					$posa = strrpos($a[0], " ");
+					if($posa == TRUE){
+						$la = substr($a[0], $posa);
+					}elseif($posa == FALSE){
+						$la = $a[0];
+					}
+
+					$posb = strrpos($b[0], " ");
+					if($posb == TRUE){
+						$lb = substr($b[0], $posb);
+					}elseif($posb == FALSE){
+						$lb = $b[0];
+					}
+
+					if ($la == $lb) {
+						return 0;
+					}
+					return strcasecmp ($la, $lb);
+				}
+				usort($arrData, "cmp");
+
+				$content_author_table_string = "";
+				$max = $from+$number;
+				for($i=$from;$i<$max;$i++){
+					if(is_array($arrData[$i])){
+						$authordetails[$i][1] = $arrData[$i][0];
+						$row['content_id'] = $arrData[$i][1];
+						$row['content_heading'] = $arrData[$i][2];
+						$row['content_datestamp'] = $arrData[$i][3];
+						$totalcontent = $arrData[$i][4];
+						$content_author_table_string .= $tp -> parseTemplate($CONTENT_AUTHOR_TABLE, FALSE, $content_shortcodes);
+					}
+				}
+				$text = $CONTENT_AUTHOR_TABLE_START.$content_author_table_string.$CONTENT_AUTHOR_TABLE_END;
+				$text = $aa -> getCrumbPage("authorall", $array, $mainparent).$text;
+			}
+
+			$caption = CONTENT_LAN_32;
+			$ns -> tablerender($caption, $text);
+			$aa -> ShowNextPrev("author", $from, $number, $contenttotal);
+			if($pref['cachestatus']){
+				$cache = ob_get_contents();
+				$e107cache->set($cachestr, $cache);
+			}
+			ob_end_flush(); // dump collected data
+		}
+}
+
+function show_content_author(){
+		global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $content_pref, $cobj;
+		global $nextprevquery, $from, $number, $content_icon_path;
+		global $CONTENT_RECENT_TABLE, $datequery, $crumb, $mainparent;
+
+		$mainparent		= $aa -> getMainParent(intval($qs[1]));
+		$content_pref	= $aa -> getContentPref($mainparent);
+		show_content_search_menu("author", $mainparent);		//show navigator/search/order menu
+
+		$cachestr = "$plugintable.author.$qs[1]";
+		if($cache = $e107cache->retrieve($cachestr)){
+			echo $cache;
+		}else{
+			ob_start();
+
+			$content_icon_path	= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+			$array				= $aa -> getCategoryTree("", $mainparent, TRUE);
+			if(array_key_exists($qs[1], $array)){
+				$validparent	= "0,0.".implode(",0.", array_keys($array));
+			}else{
+				$validparent	= implode(",", array_keys($array));
+			}
+			$order				= $aa -> getOrder();
+			$number				= (isset($content_pref["content_nextprev_number_{$mainparent}"]) && $content_pref["content_nextprev_number_{$mainparent}"] ? $content_pref["content_nextprev_number_{$mainparent}"] : "5");
+			$nextprevquery		= (isset($content_pref["content_nextprev_{$mainparent}"]) && $content_pref["content_nextprev_{$mainparent}"] ? "LIMIT ".intval($from).",".intval($number) : "");
+			$qry				= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+			$sqla = "";
+			if(!is_object($sqla)){ $sqla = new db; }
+			if(!$author = $sqla -> db_Select($plugintable, "content_author", "content_refer !='sa' AND ".$qry." ".$datequery." AND content_id = '".intval($qs[1])."' AND content_class REGEXP '".e_CLASS_REGEXP."' ")){
+				header("location:".e_SELF."?author.list.".$mainparent); exit;
+			}else{
+				list($content_author)	= $sqla -> db_Fetch();
+				$sqlb = new db;
+				$authordetails	= $aa -> getAuthor($content_author);						
+				$query			= " content_author = '".$authordetails[3]."' || content_author REGEXP '^".$authordetails[1]."^' ".(is_numeric($content_author) ? " || content_author = '".$authordetails[0]."' " : "")." ";
+				$validparent	= implode(",", array_keys($array));
+				$qry			= " content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' AND (".$query.") ";
+				$contenttotal	= $sqlb -> db_Count($plugintable, "(*)", "WHERE ".$qry." ");
+				$authorqry		= $qry." ".$order." ".$nextprevquery;
+				$text			= displayPreview($authorqry);
+				$text			= $aa -> getCrumbPage("author", $array, $mainparent).$text;
+				$caption		= CONTENT_LAN_32." : ".$authordetails[1];
+				$ns -> tablerender($caption, $text);
+				$aa -> ShowNextPrev("", $from, $number, $contenttotal);
+			}
+			if($pref['cachestatus']){
+				$cache = ob_get_contents();
+				$e107cache->set($cachestr, $cache);
+			}
+			ob_end_flush(); // dump collected data
+		}
+}
+
+// ##### TOP RATED LIST -----------------------------------
+function show_content_top(){
+		global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $cobj, $content_icon_path;
+		global $from, $datequery, $content_pref, $mainparent;
+		global $CONTENT_TOP_TABLE_AUTHOR, $authordetails, $row;
+
+		$mainparent		= $aa -> getMainParent(intval($qs[1]));
+		$content_pref	= $aa -> getContentPref($mainparent);
+		show_content_search_menu("top", $mainparent);		//show navigator/search/order menu
+
+		if(!isset($CONTENT_TOP_TABLE)){
+			if(!$content_pref["content_theme_{$mainparent}"]){
+				require_once($plugindir."templates/default/content_top_template.php");
+			}else{
+				if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_top_template.php")){
+					require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_top_template.php");
+				}else{
+					require_once($plugindir."templates/default/content_top_template.php");
+				}
+			}
+		}
+		$cachestr = "$plugintable.top.$qs[1]";
+		if($cache = $e107cache->retrieve($cachestr)){
+			echo $cache;
+		}else{
+			ob_start();
+			$content_icon_path	= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+			$array				= $aa -> getCategoryTree("", intval($qs[1]), TRUE);
+			$validparent		= implode(",", array_keys($array));
+			$datequery1			= " AND p.content_datestamp < ".time()." AND (p.content_enddate=0 || p.content_enddate>".time().") ";
+			$qry				= " p.content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+			$number				= (isset($content_pref["content_nextprev_number_{$mainparent}"]) && $content_pref["content_nextprev_number_{$mainparent}"] ? $content_pref["content_nextprev_number_{$mainparent}"] : "");
+			$np					= ($number ? " LIMIT ".intval($from).", ".intval($number) : "");
+
+			$qry1 = "
+			SELECT p.*, r.*, (r.rate_rating / r.rate_votes) as rate_avg
+			FROM #rate AS r
+			LEFT JOIN #pcontent AS p ON p.content_id = r.rate_itemid 
+			WHERE p.content_refer !='sa' AND ".$qry." ".$datequery1." AND p.content_class REGEXP '".e_CLASS_REGEXP."' AND r.rate_table='pcontent'
+			ORDER BY rate_avg DESC ";
+			$qry2 = $qry1." ".$np;
+
+			if(!is_object($sql)){ $sql = new db; }
+			$total = $sql -> db_Select_gen($qry1);
+			if($sql->db_Select_gen($qry2)){
+				while($row = $sql -> db_Fetch()){
+					$CONTENT_TOP_TABLE_AUTHOR	= $aa -> prepareAuthor("top", $row['content_author'], $row['content_id']);
+					$content_top_table_string	.= $tp -> parseTemplate($CONTENT_TOP_TABLE, FALSE, $content_shortcodes);
+				}
+				$content_top_table_string		= $aa -> getCrumbPage("top", $array, $mainparent).$content_top_table_string;
+				$text		= $CONTENT_TOP_TABLE_START.$content_top_table_string.$CONTENT_TOP_TABLE_END;
+				$caption	= CONTENT_LAN_38;
+				$ns -> tablerender($caption, $text);
+				$aa -> ShowNextPrev("", $from, $number, $total);
+			}
+			if($pref['cachestatus']){
+				$cache = ob_get_contents();
+				$e107cache->set($cachestr, $cache);
+			}
+			ob_end_flush(); // dump collected data
+		}
+		unset($qry, $qry1, $qry2, $array, $validparent, $datequery);
+}
+
+
+// ##### TOP SCORE LIST -----------------------------------
+function show_content_score(){
+		global $qs, $plugindir, $content_shortcodes, $ns, $plugintable, $sql, $aa, $e107cache, $tp, $pref, $cobj, $content_icon_path;
+		global $from, $datequery, $content_pref, $mainparent, $eArrayStorage, $CONTENT_SCORE_TABLE_SCORE, $CONTENT_SCORE_TABLE_AUTHOR, $authordetails, $row, $thisratearray;
+
+		$mainparent		= $aa -> getMainParent(intval($qs[1]));
+		$content_pref	= $aa -> getContentPref($mainparent);
+		show_content_search_menu("score", $mainparent);		//show navigator/search/order menu
+
+		if(!isset($CONTENT_SCORE_TABLE)){
+			if(!$content_pref["content_theme_{$mainparent}"]){
+				require_once($plugindir."templates/default/content_score_template.php");
+			}else{
+				if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_score_template.php")){
+					require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_score_template.php");
+				}else{
+					require_once($plugindir."templates/default/content_score_template.php");
+				}
+			}
+		}
+
+		$cachestr = "$plugintable.score.$qs[1]";
+		if($cache = $e107cache->retrieve($cachestr)){
+			echo $cache;
+		}else{
+			ob_start();
+
+			$content_icon_path	= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+			$array				= $aa -> getCategoryTree("", intval($qs[1]), TRUE);
+			$validparent		= implode(",", array_keys($array));
+			$qry				= " content_score != '0' AND content_score != '' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ";
+			$number				= (isset($content_pref["content_nextprev_number_{$mainparent}"]) && $content_pref["content_nextprev_number_{$mainparent}"] ? $content_pref["content_nextprev_number_{$mainparent}"] : "5");
+
+			if(!is_object($sql)){ $sql = new db; }
+			$contenttotal = $sql -> db_Count($plugintable, "(*)", "WHERE ".$qry." ");
+			if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_author, content_icon, content_score", " ".$qry." ORDER BY content_score DESC LIMIT ".$from.",".$number." ")){
+				$content_score_table_string = CONTENT_LAN_88;
+			}else{
+				while($row = $sql -> db_Fetch()){
+					$CONTENT_SCORE_TABLE_AUTHOR	= $aa -> prepareAuthor("score", $row['content_author'], $row['content_id']);
+					$content_score_table_string	.= $tp -> parseTemplate($CONTENT_SCORE_TABLE, FALSE, $content_shortcodes);
+				}
+			}
+			$content_score_table_string = $aa -> getCrumbPage("score", $array, $mainparent).$content_score_table_string;
+			$text		= $CONTENT_SCORE_TABLE_START.$content_score_table_string.$CONTENT_SCORE_TABLE_END;
+			$caption	= CONTENT_LAN_87;
+			$ns -> tablerender($caption, $text);
+			$aa -> ShowNextPrev("", $from, $number, $contenttotal);
+			if($pref['cachestatus']){
+				$cache = ob_get_contents();
+				$e107cache->set($cachestr, $cache);
+			}
+			ob_end_flush(); // dump collected data
+		}
+}
+
+// ##### CONTENT ITEM ------------------------------------------
+function show_content_item(){
+		global $pref, $content_pref, $content_icon_path, $content_image_path, $content_file_path, $custom, $plugindir, $plugintable, $array, $content_shortcodes, $datequery, $order, $nextprevquery, $from, $number, $row, $qs, $gen, $sql, $aa, $tp, $rs, $cobj, $e107, $e107cache, $eArrayStorage, $ns, $rater, $ep, $row, $authordetails, $mainparent; 
+		global $CONTENT_CONTENT_TABLE_TEXT, $CONTENT_CONTENT_TABLE_PAGENAMES, $CONTENT_CONTENT_TABLE_SUMMARY, $CONTENT_CONTENT_TABLE_CUSTOM_TAGS, $CONTENT_CONTENT_TABLE_PARENT, $CONTENT_CONTENT_TABLE_INFO_PRE, $CONTENT_CONTENT_TABLE_INFO_POST, $CONTENT_CONTENT_TABLE_AUTHORDETAILS, $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA, $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA;
+
+		$mainparent			= $aa -> getMainParent(intval($qs[1]));
+		$content_pref		= $aa -> getContentPref($mainparent);
+		show_content_search_menu("item", $mainparent);		//show navigator/search/order menu
+		$array				= $aa -> getCategoryTree("", $mainparent, TRUE);
+		$validparent		= implode(",", array_keys($array));
+		$qry				= "content_id='".intval($qs[1])."' AND content_refer !='sa' AND  content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' ";
+
+		if(!$resultitem = $sql -> db_Select($plugintable, "*", $qry)){
+			header("location:".e_SELF."?recent.".$mainparent); exit;
+		}else{
+			$row = $sql -> db_Fetch();
+
+			//update refer count outside of cache (count visits ^ count unique ips)
+			if(isset($content_pref["content_log_{$mainparent}"]) && $content_pref["content_log_{$mainparent}"]){
+				$ip			= $e107->getip();
+				$self		= e_SELF;
+				$refertmp	= explode("^", $row['content_refer']);
+				if(strpos($self, "admin") === FALSE){
+					if(strpos($refertmp[1], $ip) === FALSE){
+						$referiplist		= ($refertmp[1] ? $refertmp[1]."-".$ip : $ip );
+						$contentrefernew	= ($refertmp[0]+1)."^".$referiplist;
+					}else{
+						$contentrefernew	= ($refertmp[0]+1)."^".$refertmp[1];
+					}
+					$sql = new db;
+					$sql -> db_Update($plugintable, "content_refer='".$contentrefernew."' WHERE content_id='".intval($qs[1])."' ");
+					
+					$e107cache->clear("$plugintable.content.$qs[1]");
+					$e107cache->clear("$plugintable.recent.$mainparent");
+					$e107cache->clear("$plugintable.cat.list.$mainparent");
+					$e107cache->clear("$plugintable.cat.$mainparent");
+					$e107cache->clear("$plugintable.author.$mainparent");
+					$e107cache->clear("$plugintable.top.$mainparent");
+				}
+			}
+
+			if(!isset($qs[2])){ $cacheid = 1; }else{ $cacheid = $qs[2]; }
+			$cachestr = "$plugintable.content.$qs[1].$cacheid";
+			if($cache = $e107cache->retrieve($cachestr)){
+				echo $cache;
+			}else{
+				ob_start();
+					$content_pref["content_cat_icon_path_large_{$mainparent}"] = ($content_pref["content_cat_icon_path_large_{$mainparent}"] ? $content_pref["content_cat_icon_path_large_{$mainparent}"] : "{e_PLUGIN}content/images/cat/48/" );
+					$content_pref["content_cat_icon_path_small_{$mainparent}"] = ($content_pref["content_cat_icon_path_small_{$mainparent}"] ? $content_pref["content_cat_icon_path_small_{$mainparent}"] : "{e_PLUGIN}content/images/cat/16/" );
+					$content_pref["content_icon_path_{$mainparent}"] = ($content_pref["content_icon_path_{$mainparent}"] ? $content_pref["content_icon_path_{$mainparent}"] : "{e_PLUGIN}content/images/icon/" );
+					$content_pref["content_image_path_{$mainparent}"] = ($content_pref["content_image_path_{$mainparent}"] ? $content_pref["content_image_path_{$mainparent}"] : "{e_PLUGIN}content/images/image/" );
+					$content_pref["content_file_path_{$mainparent}"] = ($content_pref["content_file_path_{$mainparent}"] ? $content_pref["content_file_path_{$mainparent}"] : "{e_PLUGIN}content/images/file/" );
+					$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$mainparent}"]);
+					$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$mainparent}"]);
+					$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+					$content_image_path				= $tp -> replaceConstants($content_pref["content_image_path_{$mainparent}"]);
+					$content_file_path				= $tp -> replaceConstants($content_pref["content_file_path_{$mainparent}"]);
+					$number							= (isset($content_pref["content_nextprev_number_{$mainparent}"]) && $content_pref["content_nextprev_number_{$mainparent}"] ? $content_pref["content_nextprev_number_{$mainparent}"] : "5");
+					$nextprevquery					= (isset($content_pref["content_nextprev_{$mainparent}"]) && $content_pref["content_nextprev_{$mainparent}"] ? "LIMIT ".intval($from).",".intval($number) : "");
+
+					$CONTENT_CONTENT_TABLE_AUTHORDETAILS = $aa -> prepareAuthor("content", $row['content_author'], $row['content_id']);
+					$CONTENT_CONTENT_TABLE_TEXT = $row['content_text'];
+
+					$lastpage = FALSE;		//boolean whether or not the current page is the last page
+					if(preg_match_all("/\[newpage.*?]/si", $row['content_text'], $matches)){
+						$pages = preg_split("/\[newpage.*?]/si", $row['content_text'], -1, PREG_SPLIT_NO_EMPTY);
+						$pages = array_values($pages);
+
+						if(count($pages) == count($matches[0])){
+						}elseif(count($pages) > count($matches[0])){
+							$matches[0] = array_pad($matches[0], -count($pages), "[newpage]");
+						}elseif(count($pages) < count($matches[0])){
+						}
+
+						$CONTENT_CONTENT_TABLE_TEXT = $pages[(!$qs[2] ? 0 : $qs[2]-1)];
+						$options = "";
+						for ($i=0; $i < count($pages); $i++) {
+							if(!isset($qs[2])){ $idp = 1; }else{ $idp = $qs[2]; }
+							if($idp == $i+1){ $pre = " - current"; }else{ $pre = ""; }
+							if($matches[0][$i] == "[newpage]"){
+								$pagename[$i] = CONTENT_LAN_78;
+							}else{
+								$arrpagename = explode("[newpage=", $matches[0][$i]);
+								$pagename[$i] = substr($arrpagename[1],0,-1);
+							}
+							//0:normal links, 1:selectbox
+							//$content_pref["content_content_pagenames_rendertype_{$mainparent}"] = "1";
+							if(isset($content_pref["content_content_pagenames_rendertype_{$mainparent}"]) && $content_pref["content_content_pagenames_rendertype_{$mainparent}"] == "1"){
+								$page = CONTENT_LAN_79." ".($i+1)." ".$pre." ".$pagename[$i];
+								$url = e_SELF."?".$qs[0].".".$qs[1].".".($i+1);
+								$options .= $rs -> form_option($page, ($idp == ($i+1) ? "1" : "0"), $url , "");
+							}else{
+								$options .= CONTENT_LAN_79." ".($i+1)." ".$pre." : <a href='".e_SELF."?".$qs[0].".".$qs[1].".".($i+1)."'>".$pagename[$i]."</a><br />";
+							}
+
+							if($idp==1){
+								$CONTENT_CONTENT_TABLE_SUMMARY = (isset($content_pref["content_content_summary_{$mainparent}"]) && $content_pref["content_content_summary_{$mainparent}"] && $row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "") : "");
+								$CONTENT_CONTENT_TABLE_SUMMARY = $tp -> replaceConstants($CONTENT_CONTENT_TABLE_SUMMARY);
+							}else{
+								$CONTENT_CONTENT_TABLE_SUMMARY = "";
+							}
+							if($idp == count($pages)){
+								$lastpage = TRUE;
+							}
+						}
+						if($content_pref["content_content_pagenames_rendertype_{$mainparent}"] == "1"){
+							$selectjs	= "onchange=\"if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }\"";
+							$CONTENT_CONTENT_TABLE_PAGENAMES = $rs -> form_select_open("pagenames", $selectjs).$rs -> form_option("select page", "1", "none" , "").$options.$rs -> form_select_close();
+						}else{
+							$CONTENT_CONTENT_TABLE_PAGENAMES = $options;
+						}
+
+					}else{
+						$CONTENT_CONTENT_TABLE_SUMMARY	= (isset($content_pref["content_content_summary_{$mainparent}"]) && $content_pref["content_content_summary_{$mainparent}"] && $row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "") : "");
+						$CONTENT_CONTENT_TABLE_SUMMARY	= $tp -> replaceConstants($CONTENT_CONTENT_TABLE_SUMMARY);
+						$lastpage = TRUE;
+					}
+
+					$CONTENT_CONTENT_TABLE_TEXT		= $tp -> replaceConstants($CONTENT_CONTENT_TABLE_TEXT);
+					$CONTENT_CONTENT_TABLE_TEXT		= $tp -> toHTML($CONTENT_CONTENT_TABLE_TEXT, TRUE, "");
+					$custom							= $eArrayStorage->ReadArray($row['content_pref']);
+
+					$date	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_DATE}', FALSE, $content_shortcodes);
+					$auth	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_AUTHORDETAILS}', FALSE, $content_shortcodes);
+					$ep		= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_EPICONS}', FALSE, $content_shortcodes);
+					$edit	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_EDITICON}', FALSE, $content_shortcodes);
+					$par	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_PARENT}', FALSE, $content_shortcodes);
+					$com	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_COMMENT}', FALSE, $content_shortcodes);
+					$score	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_SCORE}', FALSE, $content_shortcodes);
+					$ref	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_REFER}', FALSE, $content_shortcodes);
+					$ico	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_ICON}', FALSE, $content_shortcodes);
+					$sub	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_SUBHEADING}', FALSE, $content_shortcodes);
+					$rat	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_RATING}', FALSE, $content_shortcodes);
+					$fil	= $tp -> parseTemplate('{CONTENT_CONTENT_TABLE_FILE}', FALSE, $content_shortcodes);
+
+					$CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA = FALSE;
+					$CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA = FALSE;
+					$CONTENT_CONTENT_TABLE_INFO_PRE = FALSE;
+					$CONTENT_CONTENT_TABLE_INFO_POST = FALSE;
+					
+					if ($date!="" || $auth!="" || $ep!="" || $edit!="" || $par!="" || $com!="" || $score!="" || $ref!="" || $sub!="" || $rat!="" || $fil!="") {
+						$CONTENT_CONTENT_TABLE_INFO_PRE = TRUE;
+						$CONTENT_CONTENT_TABLE_INFO_POST = TRUE;
+					}
+					if($CONTENT_CONTENT_TABLE_INFO_PRE || $ico==''){
+						$CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA = TRUE;
+						$CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA = TRUE;
+					}
+
+					if(!isset($CONTENT_CONTENT_TABLE)){
+						//if no theme has been set, use default theme
+						if(!$content_pref["content_theme_{$mainparent}"]){
+
+							//if custom layout is set
+							if($row['content_layout']){
+								//if custom layout file exists
+								if(is_readable($plugindir."templates/default/".$row['content_layout'])){
+									require_once($plugindir."templates/default/".$row['content_layout']);
+								}else{
+									require_once($plugindir."templates/default/content_content_template.php");
+								}
+							}else{
+								require_once($plugindir."templates/default/content_content_template.php");
+							}
+						}else{
+							//if custom layout is set
+							if($row['content_layout']){
+								//if custom layout file exists
+								if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/".$row['content_layout'])){
+									require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/".$row['content_layout']);
+								}else{
+									//if default layout from the set theme exists
+									if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_content_template.php")){
+										require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_content_template.php");
+									//else use default theme, default layout
+									}else{
+										require_once($plugindir."templates/default/content_content_template.php");
+									}
+								}
+							//if no custom layout is set
+							}else{
+								//if default layout from the set theme exists
+								if(is_readable($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_content_template.php")){
+									require_once($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_content_template.php");
+								//else use default theme, default layout
+								}else{
+									require_once($plugindir."templates/default/content_content_template.php");
+								}
+							}
+						}
+					}
+
+					$months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
+
+					$CONTENT_CONTENT_TABLE_CUSTOM_TAGS = "";
+					$CUSTOM_TAGS = FALSE;
+					if($lastpage === TRUE && !empty($custom)){
+						$CONTENT_CONTENT_TABLE_CUSTOM_PRE = "";
+						$CONTENT_CONTENT_TABLE_CUSTOM_TAGS = "";
+						//ksort($custom);
+						foreach($custom as $k => $v){
+							if($k == "content_custom_presettags"){
+								if(isset($content_pref["content_content_presettags_{$mainparent}"]) && $content_pref["content_content_presettags_{$mainparent}"]){
+									foreach($v as $ck => $cv){
+										if(is_array($cv)){	//date
+											if(!($cv['day']=="" && $cv['month']=="" && $cv['year']=="")){
+												$vv = $cv['day']." ".$months[($cv['month']-1)]." ".$cv['year'];
+											}
+										}else{
+											$vv = $cv;
+										}
+										if( isset($ck) && $ck != "" && isset($vv) && $vv!="" ){
+											$CUSTOM_TAGS = TRUE;
+											$CONTENT_CONTENT_TABLE_CUSTOM_KEY		= $tp->toHTML($ck, true);
+											$CONTENT_CONTENT_TABLE_CUSTOM_VALUE		= $tp->toHTML($vv, true);
+											$CONTENT_CONTENT_TABLE_CUSTOM_TAGS		.= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_TABLE_CUSTOM);
+										}
+									}
+								}
+							}else{
+								if(isset($content_pref["content_content_customtags_{$mainparent}"]) && $content_pref["content_content_customtags_{$mainparent}"]){
+									$key = substr($k,15);
+									if( isset($key) && $key != "" && isset($v) && $v!="" ){
+										$CUSTOM_TAGS = TRUE;
+										$CONTENT_CONTENT_TABLE_CUSTOM_KEY		= $tp->toHTML($key, true);
+										$CONTENT_CONTENT_TABLE_CUSTOM_VALUE		= $tp->toHTML($v, true);
+										$CONTENT_CONTENT_TABLE_CUSTOM_TAGS		.= preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_TABLE_CUSTOM);
+									}
+								}
+							}
+						}
+						if($CUSTOM_TAGS === TRUE){
+							$CONTENT_CONTENT_TABLE_CUSTOM_TAGS = $CONTENT_CONTENT_TABLE_CUSTOM_START.$CONTENT_CONTENT_TABLE_CUSTOM_TAGS.$CONTENT_CONTENT_TABLE_CUSTOM_END;
+						}
+					}
+					$text		= $tp -> parseTemplate($CONTENT_CONTENT_TABLE, FALSE, $content_shortcodes);
+					$text		= $aa -> getCrumbPage("item", $array, $row['content_parent']).$text;
+					$caption	= $row['content_heading'];
+					$ns -> tablerender($caption, $text);
+
+					if($pref['cachestatus']){
+						$cache = ob_get_contents();
+						$e107cache->set($cachestr, $cache);
+					}
+				ob_end_flush(); // dump collected data
+			}
+
+			//recheck some thing when caching is enabled
+			$pages = preg_split("/\[newpage.*?]/si", $row['content_text'], -1, PREG_SPLIT_NO_EMPTY);
+			$pages = array_values($pages);
+			$cachestr = "comment.$plugintable.$qs[1].$cacheid";
+			if(count($pages) == 0){
+				$lastpage = TRUE;
+			}else{
+				if($cacheid == count($pages)){
+					$lastpage = TRUE;
+				}
+			}
+			if($lastpage && ($row['content_comment'] || (isset($content_pref["content_content_comment_all_{$mainparent}"]) && $content_pref["content_content_comment_all_{$mainparent}"]))){
+				if($cache = $e107cache->retrieve($cachestr)){
+					echo $cache;
+				}else{
+					ob_start();
+						if((isset($content_pref["content_content_rating_{$mainparent}"]) && $content_pref["content_content_rating_{$mainparent}"] && $row['content_rate']) || (isset($content_pref["content_content_rating_all_{$mainparent}"]) && $content_pref["content_content_rating_all_{$mainparent}"]) ){
+							$showrate = TRUE;
+						}else{
+							$showrate = FALSE;
+						}
+						$width = 0;
+						$cobj->compose_comment($plugintable, "comment", $qs[1], $width, $row['content_heading'], $showrate);
+
+						if($pref['cachestatus']){
+							$cache = ob_get_contents();
+							$e107cache->set($cachestr, $cache);
+						}
+					ob_end_flush(); // dump collected data
+				}
+			}
+		} //close sql
+}
+
+require_once(FOOTERF);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/content_shortcodes.php 75/e107_plugins/content/content_shortcodes.php
--- 6171/e107_plugins/content/content_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/content_shortcodes.php	2006-02-13 04:13:22.000000000 -0600
@@ -0,0 +1,980 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$content_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+/*
+// CONTENT_TYPE_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_TYPE_TABLE_TOTAL
+global $contenttotal;
+return $contenttotal." ".($contenttotal == 1 ? CONTENT_LAN_53 : CONTENT_LAN_54);
+SC_END
+
+SC_BEGIN CONTENT_TYPE_TABLE_HEADING
+global $CONTENT_TYPE_TABLE_HEADING, $contenttotal, $row, $tp;
+$row['content_heading'] = $tp -> toHTML($row['content_heading'], TRUE, "");
+return ($contenttotal != "0" ? "<a href='".e_SELF."?recent.".$row['content_id']."'>".$row['content_heading']."</a>" : $row['content_heading'] );
+SC_END
+
+SC_BEGIN CONTENT_TYPE_TABLE_SUBHEADING
+global $CONTENT_TYPE_TABLE_SUBHEADING, $contenttotal, $row, $tp;
+$row['content_subheading'] = $tp -> toHTML($row['content_subheading'], TRUE, "");
+return ($row['content_subheading'] ? $row['content_subheading'] : "");
+SC_END
+
+SC_BEGIN CONTENT_TYPE_TABLE_ICON
+global $CONTENT_TYPE_TABLE_ICON, $contenttotal, $row, $aa, $content_cat_icon_path_large, $content_pref;
+if($contenttotal != "0"){
+	$CONTENT_TYPE_TABLE_ICON = $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "recent.".$row['content_id'], "", $content_pref["content_blank_caticon_{$row['content_id']}"]);
+}else{
+	$CONTENT_TYPE_TABLE_ICON = $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "", "", $content_pref["content_blank_caticon_{$row['content_id']}"]);
+}
+return $CONTENT_TYPE_TABLE_ICON;
+SC_END
+
+// CONTENT_TYPE_TABLE_SUBMIT ------------------------------------------------
+SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_ICON
+global $CONTENT_TYPE_TABLE_SUBMIT_ICON, $plugindir;
+return "<a href='".$plugindir."content_submit.php'>".CONTENT_ICON_SUBMIT."</a>";
+SC_END
+
+SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_HEADING
+global $CONTENT_TYPE_TABLE_SUBMIT_HEADING, $plugindir;
+return "<a href='".$plugindir."content_submit.php'>".CONTENT_LAN_65."</a>";
+SC_END
+
+SC_BEGIN CONTENT_TYPE_TABLE_SUBMIT_SUBHEADING
+global $CONTENT_TYPE_TABLE_SUBMIT_SUBHEADING;
+return CONTENT_LAN_66;
+SC_END
+
+// CONTENT_TYPE_TABLE_MANAGER ------------------------------------------------
+SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_ICON
+global $CONTENT_TYPE_TABLE_MANAGER_ICON, $plugindir;
+return "<a href='".$plugindir."content_manager.php'>".CONTENT_ICON_CONTENTMANAGER."</a>";
+SC_END
+
+SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_HEADING
+global $CONTENT_TYPE_TABLE_MANAGER_HEADING, $plugindir;
+return "<a href='".$plugindir."content_manager.php'>".CONTENT_LAN_67."</a>";
+SC_END
+
+SC_BEGIN CONTENT_TYPE_TABLE_MANAGER_SUBHEADING
+global $CONTENT_TYPE_TABLE_MANAGER_SUBHEADING;
+return CONTENT_LAN_68;
+SC_END
+
+// CONTENT_TOP_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_TOP_TABLE_HEADING
+global $CONTENT_TOP_TABLE_HEADING, $row, $qs;
+return "<a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
+SC_END
+
+SC_BEGIN CONTENT_TOP_TABLE_ICON
+global $CONTENT_TOP_TABLE_ICON, $aa, $row, $content_pref, $content_icon_path, $qs, $mainparent;
+if($content_pref["content_top_icon_{$mainparent}"]){
+$width = (isset($content_pref["content_upload_icon_size_{$mainparent}"]) && $content_pref["content_upload_icon_size_{$mainparent}"] ? $content_pref["content_upload_icon_size_{$mainparent}"] : "100");
+return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon_{$mainparent}"]);
+}
+SC_END
+
+SC_BEGIN CONTENT_TOP_TABLE_AUTHOR
+global $CONTENT_TOP_TABLE_AUTHOR;
+return $CONTENT_TOP_TABLE_AUTHOR;
+SC_END
+
+SC_BEGIN CONTENT_TOP_TABLE_RATING
+global $CONTENT_TOP_TABLE_RATING, $row;
+$row['rate_avg'] = round($row['rate_avg'], 1);
+$row['rate_avg'] = (strlen($row['rate_avg'])>1 ? $row['rate_avg'] : $row['rate_avg'].".0");
+$tmp = explode(".", $row['rate_avg']);
+$rating = "";
+$rating .= $row['rate_avg']." ";
+for($c=1; $c<= $tmp[0]; $c++){
+	$rating .= "<img src='".e_IMAGE."rate/box.png' alt='' style='height:8px; vertical-align:middle' />";
+}
+if($tmp[0] < 10){
+	for($c=9; $c>=$tmp[0]; $c--){
+		$rating .= "<img src='".e_IMAGE."rate/empty.png' alt='' style='height:8px; vertical-align:middle' />";
+	}
+}
+$rating .= "<img src='".e_IMAGE."rate/boxend.png' alt='' style='height:8px; vertical-align:middle' />";
+return $rating;
+SC_END
+
+// CONTENT_SCORE_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_SCORE_TABLE_HEADING
+global $CONTENT_SCORE_TABLE_HEADING, $row, $qs;
+return "<a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
+SC_END
+
+SC_BEGIN CONTENT_SCORE_TABLE_ICON
+global $CONTENT_SCORE_TABLE_ICON, $aa, $row, $content_pref, $content_icon_path, $qs, $mainparent;
+if(isset($content_pref["content_score_icon_{$mainparent}"]) && $content_pref["content_score_icon_{$mainparent}"]){
+$width = (isset($content_pref["content_upload_icon_size_{$mainparent}"]) && $content_pref["content_upload_icon_size_{$mainparent}"] ? $content_pref["content_upload_icon_size_{$mainparent}"] : "100");
+return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon_{$mainparent}"]);
+}
+SC_END
+
+SC_BEGIN CONTENT_SCORE_TABLE_AUTHOR
+global $CONTENT_SCORE_TABLE_AUTHOR;
+return $CONTENT_SCORE_TABLE_AUTHOR;
+SC_END
+
+SC_BEGIN CONTENT_SCORE_TABLE_SCORE
+global $CONTENT_SCORE_TABLE_SCORE, $row;
+$score = $row['content_score'];
+$height = "height:8px;";
+$img = "";
+$img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
+$img .= "<img src='".e_PLUGIN."content/images/score.png' alt='' style='$height width:".$score."px; border:0;' />";
+$img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
+if($score < 100){
+	$empty = 100-$score;
+	$img .= "<img src='".e_PLUGIN."content/images/score_empty.png' alt='' style='$height width:".$empty."px; border:0;' />";
+}
+$img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
+return $score."/100 ".$img;
+SC_END
+
+// CONTENT_SUBMIT_TYPE_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_HEADING
+global $CONTENT_SUBMIT_TYPE_TABLE_HEADING, $row;
+return "<a href='".e_SELF."?content.submit.".$row['content_id']."'>".$row['content_heading']."</a>";
+SC_END
+
+SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING
+global $CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING, $row;
+return ($row['content_subheading'] ? $row['content_subheading'] : "");
+SC_END
+
+SC_BEGIN CONTENT_SUBMIT_TYPE_TABLE_ICON
+global $CONTENT_SUBMIT_TYPE_TABLE_ICON, $aa, $row, $content_cat_icon_path_large, $content_pref;
+return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "content.submit.".$row['content_id'], "", $content_pref["content_blank_caticon_{$row['content_id']}"]);
+SC_END
+
+// CONTENT_CONTENT_TABLEMANAGER ------------------------------------------------
+SC_BEGIN CONTENT_CONTENTMANAGER_ICONNEW
+global $CONTENT_CONTENTMANAGER_ICONNEW, $row;
+return "<a href='".e_SELF."?content.create.".$row['content_id']."'>".CONTENT_ICON_NEW."</a>";
+SC_END
+
+SC_BEGIN CONTENT_CONTENTMANAGER_CATEGORY
+global $CONTENT_CONTENTMANAGER_CATEGORY, $row;
+return "<a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
+SC_END
+
+SC_BEGIN CONTENT_CONTENTMANAGER_ICONEDIT
+global $CONTENT_CONTENTMANAGER_ICONEDIT, $row;
+return "<a href='".e_SELF."?content.".$row['content_id']."'>".CONTENT_ICON_EDIT."</a>";
+SC_END
+
+// CONTENT_AUTHOR_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_AUTHOR_TABLE_NAME
+global $CONTENT_AUTHOR_TABLE_NAME, $authordetails, $i, $qs, $row;
+$name = ($authordetails[$i][1] == "" ? "... ".CONTENT_LAN_29." ..." : $authordetails[$i][1]);
+$authorlink = "<a href='".e_SELF."?author.".$row['content_id']."'>".$name."</a>";
+return $authorlink;
+SC_END
+
+SC_BEGIN CONTENT_AUTHOR_TABLE_ICON
+global $CONTENT_AUTHOR_TABLE_ICON, $qs, $row;
+return "<a href='".e_SELF."?author.".$row['content_id']."'>".CONTENT_ICON_AUTHORLIST."</a>";
+SC_END
+
+SC_BEGIN CONTENT_AUTHOR_TABLE_TOTAL
+global $CONTENT_AUTHOR_TABLE_TOTAL, $totalcontent, $mainparent, $content_pref;
+if($content_pref["content_author_amount_{$mainparent}"]){
+$CONTENT_AUTHOR_TABLE_TOTAL = $totalcontent." ".($totalcontent==1 ? CONTENT_LAN_53 : CONTENT_LAN_54);
+return $CONTENT_AUTHOR_TABLE_TOTAL;
+}
+SC_END
+
+SC_BEGIN CONTENT_AUTHOR_TABLE_LASTITEM
+global $CONTENT_AUTHOR_TABLE_LASTITEM, $gen, $row, $mainparent, $content_pref;
+if($content_pref["content_author_lastitem_{$mainparent}"]){
+if(!is_object($gen)){ $gen = new convert; }
+$CONTENT_AUTHOR_TABLE_LASTITEM = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "short"));
+$CONTENT_AUTHOR_TABLE_LASTITEM .= " : <a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
+return $CONTENT_AUTHOR_TABLE_LASTITEM;
+}
+SC_END
+
+// CONTENT_CAT_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_CAT_TABLE_INFO_PRE
+global $CONTENT_CAT_TABLE_INFO_PRE;
+if($CONTENT_CAT_TABLE_INFO_PRE === TRUE){
+$CONTENT_CAT_TABLE_INFO_PRE = " ";
+return $CONTENT_CAT_TABLE_INFO_PRE;
+}
+SC_END
+SC_BEGIN CONTENT_CAT_TABLE_INFO_POST
+global $CONTENT_CAT_TABLE_INFO_POST;
+if($CONTENT_CAT_TABLE_INFO_POST === TRUE){
+$CONTENT_CAT_TABLE_INFO_POST = " ";
+return $CONTENT_CAT_TABLE_INFO_POST;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_ICON
+global $CONTENT_CAT_TABLE_ICON, $aa, $totalitems, $row, $content_pref, $qs, $content_cat_icon_path_large, $mainparent;
+if(isset($content_pref["content_catall_icon_{$mainparent}"]) && $content_pref["content_catall_icon_{$mainparent}"]){
+	//$qry = ($totalitems > 0 ? "cat.".$row['content_id'] : "");
+	$qry = "cat.".$row['content_id'];
+	return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, $qry, "", $content_pref["content_blank_caticon_{$mainparent}"]);
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_HEADING
+global $CONTENT_CAT_TABLE_HEADING, $row, $totalitems, $tp;
+//return ($totalitems > 0 ? "<a href='".e_SELF."?cat.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>" : $tp -> toHTML($row['content_heading'], TRUE, "") );
+return "<a href='".e_SELF."?cat.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>";
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_AMOUNT
+global $CONTENT_CAT_TABLE_AMOUNT, $aa, $row, $totalitems, $mainparent, $content_pref;
+if(isset($content_pref["content_catall_amount_{$mainparent}"]) && $content_pref["content_catall_amount_{$mainparent}"]){
+$n = $totalitems;
+$CONTENT_CAT_TABLE_AMOUNT = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54);
+return $CONTENT_CAT_TABLE_AMOUNT;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_SUBHEADING
+global $CONTENT_CAT_TABLE_SUBHEADING, $row, $tp, $mainparent, $content_pref;
+if(isset($content_pref["content_catall_subheading_{$mainparent}"]) && $content_pref["content_catall_subheading_{$mainparent}"]){
+return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_DATE
+global $CONTENT_CAT_TABLE_DATE, $gen, $row, $mainparent, $content_pref, $gen;
+if(isset($content_pref["content_catall_date_{$mainparent}"]) && $content_pref["content_catall_date_{$mainparent}"]){
+if(!is_object($gen)){ $gen = new convert; }
+$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long"));
+$DATE = ($datestamp != "" ? $datestamp : "");
+return $DATE;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_AUTHORDETAILS
+global $CONTENT_CAT_TABLE_AUTHORDETAILS;
+return $CONTENT_CAT_TABLE_AUTHORDETAILS;
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_EPICONS
+global $CONTENT_CAT_TABLE_EPICONS, $row, $tp, $mainparent, $content_pref;
+$EPICONS = "";
+if($row['content_pe'] && isset($content_pref["content_catall_peicon_{$mainparent}"]) && $content_pref["content_catall_peicon_{$mainparent}"]){
+	$EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_72."^plugin:content.".$row['content_id']."}");
+	$EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_72."^plugin:content.".$row['content_id']."}");
+	$EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
+return $EPICONS;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_COMMENT
+global $CONTENT_CAT_TABLE_COMMENT, $row, $qs, $comment_total, $mainparent, $content_pref, $plugintable;
+if($row['content_comment'] && isset($content_pref["content_catall_comment_{$mainparent}"]) && $content_pref["content_catall_comment_{$mainparent}"]){
+$sqlc = new db;
+$comment_total = $sqlc -> db_Select("comments", "*",  "comment_item_id='".$row['content_id']."' AND comment_type='".$plugintable."' AND comment_pid='0' ");
+return "<a style='text-decoration:none;' href='".e_SELF."?cat.".$row['content_id'].".comment'>".CONTENT_LAN_57." ".$comment_total."</a>";
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_TEXT
+global $CONTENT_CAT_TABLE_TEXT, $row, $tp, $mainparent, $content_pref;
+if($row['content_text'] && isset($content_pref["content_catall_text_{$mainparent}"]) && $content_pref["content_catall_text_{$mainparent}"] && ($content_pref["content_catall_text_char_{$mainparent}"] > 0 || $content_pref["content_catall_text_char_{$mainparent}"] == 'all')){
+	if($content_pref["content_catall_text_char_{$mainparent}"] == 'all'){
+		$CONTENT_CAT_TABLE_TEXT = $row['content_text'];
+	}else{
+		$rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']);
+		$rowtext = $tp->toHTML($rowtext, TRUE, "nobreak");
+		
+		$rowtext = strip_tags($rowtext);
+		$words = explode(" ", $rowtext);
+		$CONTENT_CAT_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_catall_text_char_{$mainparent}"]));
+		if($content_pref["content_catall_text_link_{$mainparent}"]){
+			$CONTENT_CAT_TABLE_TEXT .= " <a href='".e_SELF."?cat.".$row['content_id']."'>".$content_pref["content_catall_text_post_{$mainparent}"]."</a>";
+		}else{
+			$CONTENT_CAT_TABLE_TEXT .= " ".$content_pref["content_catall_text_post_{$mainparent}"];
+		}
+	}
+return $CONTENT_CAT_TABLE_TEXT;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_TABLE_RATING
+global $CONTENT_CAT_TABLE_RATING, $row, $rater, $mainparent, $content_pref, $plugintable;
+$RATING = "";
+if($row['content_rate'] && isset($content_pref["content_catall_rating_{$mainparent}"]) && $content_pref["content_catall_rating_{$mainparent}"]){
+return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE);
+}
+return $RATING;
+SC_END
+
+// CONTENT_CAT_LIST_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_CAT_LIST_TABLE_INFO_PRE
+global $CONTENT_CAT_LIST_TABLE_INFO_PRE;
+if($CONTENT_CAT_LIST_TABLE_INFO_PRE === TRUE){
+$CONTENT_CAT_LIST_TABLE_INFO_PRE = " ";
+return $CONTENT_CAT_LIST_TABLE_INFO_PRE;
+}
+SC_END
+SC_BEGIN CONTENT_CAT_LIST_TABLE_INFO_POST
+global $CONTENT_CAT_LIST_TABLE_INFO_POST;
+if($CONTENT_CAT_LIST_TABLE_INFO_POST === TRUE){
+$CONTENT_CAT_LIST_TABLE_INFO_POST = " ";
+return $CONTENT_CAT_LIST_TABLE_INFO_POST;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_ICON
+global $CONTENT_CAT_LIST_TABLE_ICON, $aa, $row, $qs, $content_pref, $content_cat_icon_path_large, $mainparent;
+if(isset($content_pref["content_cat_icon_{$mainparent}"]) && $content_pref["content_cat_icon_{$mainparent}"]){
+return $aa -> getIcon("catlarge", $row['content_icon'], $content_cat_icon_path_large, "", "", $content_pref["content_blank_caticon_{$mainparent}"]);;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_HEADING
+global $CONTENT_CAT_LIST_TABLE_HEADING, $tp, $row, $totalparent, $tp;
+return ($totalparent > 0 ? "<a href='".e_SELF."?cat.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>" : $tp -> toHTML($row['content_heading'], TRUE, "") );
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_SUMMARY
+global $CONTENT_CAT_LIST_TABLE_SUMMARY, $tp, $row, $mainparent;
+return ($row['content_summary'] ? $tp -> toHTML($row['content_summary'], TRUE, "") : "");
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_TEXT
+global $CONTENT_CAT_LIST_TABLE_TEXT, $tp, $row, $mainparent, $content_pref;
+if($row['content_text'] && isset($content_pref["content_cat_text_{$mainparent}"]) && $content_pref["content_cat_text_{$mainparent}"] && ($content_pref["content_cat_text_char_{$mainparent}"] > 0 || $content_pref["content_cat_text_char_{$mainparent}"] == 'all')){
+	if($content_pref["content_cat_text_char_{$mainparent}"] == 'all'){
+		//$CONTENT_CAT_LIST_TABLE_TEXT = $row['content_text'];
+		$CONTENT_CAT_LIST_TABLE_TEXT = $tp->toHTML($row['content_text'], TRUE, "constants");
+	}else{
+		$rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']);
+		$rowtext = $tp->toHTML($rowtext, TRUE, "nobreak constants");
+		
+		$rowtext = strip_tags($rowtext);
+		$words = explode(" ", $rowtext);
+		$CONTENT_CAT_LIST_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_cat_text_char_{$mainparent}"]));
+		if($content_pref["content_cat_text_link_{$mainparent}"]){
+			$CONTENT_CAT_LIST_TABLE_TEXT .= " <a href='".e_SELF."?cat.".$row['content_id']."'>".$content_pref["content_cat_text_post_{$mainparent}"]."</a>";
+		}else{
+			$CONTENT_CAT_LIST_TABLE_TEXT .= " ".$content_pref["content_cat_text_post_{$mainparent}"];
+		}
+	}
+return $CONTENT_CAT_LIST_TABLE_TEXT;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_AMOUNT
+global $CONTENT_CAT_LIST_TABLE_AMOUNT, $aa, $row, $mainparent, $content_pref, $totalparent;
+if(isset($content_pref["content_cat_amount_{$mainparent}"]) && $content_pref["content_cat_amount_{$mainparent}"]){
+$n = $totalparent;
+$n = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54);
+return $n;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_SUBHEADING
+global $CONTENT_CAT_LIST_TABLE_SUBHEADING, $tp, $row, $mainparent, $content_pref;
+if(isset($content_pref["content_cat_subheading_{$mainparent}"]) && $content_pref["content_cat_subheading_{$mainparent}"]){
+return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_DATE
+global $CONTENT_CAT_LIST_TABLE_DATE, $row, $gen, $mainparent, $content_pref, $gen;
+if(isset($content_pref["content_cat_date_{$mainparent}"]) && $content_pref["content_cat_date_{$mainparent}"]){
+if(!is_object($gen)){ $gen = new convert; }
+$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long"));
+return ($datestamp != "" ? $datestamp : "");
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_AUTHORDETAILS
+global $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS;
+return $CONTENT_CAT_LIST_TABLE_AUTHORDETAILS;
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_EPICONS
+global $CONTENT_CAT_LIST_TABLE_EPICONS, $row, $tp, $qs, $mainparent, $content_pref;
+$EPICONS = "";
+if( (isset($content_pref["content_cat_peicon_{$mainparent}"]) && $content_pref["content_cat_peicon_{$mainparent}"] && $row['content_pe']) || (isset($content_pref["content_cat_peicon_all_{$mainparent}"]) && $content_pref["content_cat_peicon_all_{$mainparent}"])){
+	$EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_72."^plugin:content.$qs[1]}");
+	$EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_72."^plugin:content.$qs[1]}");
+	$EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.$qs[1]}");
+return $EPICONS;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_COMMENT
+global $CONTENT_CAT_LIST_TABLE_COMMENT, $qs, $row, $comment_total, $mainparent, $content_pref, $sql, $plugintable;
+if($row['content_comment'] && isset($content_pref["content_cat_comment_{$mainparent}"]) && $content_pref["content_cat_comment_{$mainparent}"]){
+	$comment_total = $sql -> db_Count("comments", "(*)",  "WHERE comment_item_id='".intval($qs[1])."' AND comment_type='".$plugintable."' AND comment_pid='0' ");
+	return "<a style='text-decoration:none;' href='".e_SELF."?cat.".$qs[1].".comment'>".CONTENT_LAN_57." ".$comment_total."</a>";
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LIST_TABLE_RATING
+global $CONTENT_CAT_LIST_TABLE_RATING, $row, $rater, $content_pref, $mainparent, $plugintable;
+$RATING = "";
+if( (isset($content_pref["content_cat_rating_all_{$mainparent}"]) && $content_pref["content_cat_rating_all_{$mainparent}"]) || (isset($content_pref["content_cat_rating_{$mainparent}"]) && $content_pref["content_cat_rating_{$mainparent}"] && $row['content_rate'])){
+	return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE);
+}
+return $RATING;
+SC_END
+
+// CONTENT_CAT_LISTSUB ------------------------------------------------
+SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_ICON
+global $CONTENT_CAT_LISTSUB_TABLE_ICON, $aa, $row, $content_pref, $qs, $mainparent, $content_cat_icon_path_small;
+if(isset($content_pref["content_catsub_icon_{$mainparent}"]) && $content_pref["content_catsub_icon_{$mainparent}"]){
+return $aa -> getIcon("catsmall", $row['content_icon'], $content_cat_icon_path_small, "cat.".$row['content_id'], "", $content_pref["content_blank_caticon_{$mainparent}"]);
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_HEADING
+global $CONTENT_CAT_LISTSUB_TABLE_HEADING, $tp, $row, $totalsubcat, $tp;
+return ($totalsubcat > 0 ? "<a href='".e_SELF."?cat.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>" : $tp -> toHTML($row['content_heading'], TRUE, "") );
+SC_END
+
+SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_AMOUNT
+global $CONTENT_CAT_LISTSUB_TABLE_AMOUNT, $aa, $row, $content_pref, $mainparent, $totalsubcat;
+if(isset($content_pref["content_catsub_amount_{$mainparent}"]) && $content_pref["content_catsub_amount_{$mainparent}"]){
+$n = $totalsubcat;
+$n = $n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54);
+return $n;
+}
+SC_END
+
+SC_BEGIN CONTENT_CAT_LISTSUB_TABLE_SUBHEADING
+global $CONTENT_CAT_LISTSUB_TABLE_SUBHEADING, $row, $tp, $content_pref, $mainparent;
+if(isset($content_pref["content_catsub_subheading_{$mainparent}"]) && $content_pref["content_catsub_subheading_{$mainparent}"]){
+return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
+}
+SC_END
+
+// CONTENT_SEARCH_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_SEARCH_TABLE_SELECT
+global $CONTENT_SEARCH_TABLE_SELECT;
+return $CONTENT_SEARCH_TABLE_SELECT;
+SC_END
+
+SC_BEGIN CONTENT_SEARCH_TABLE_ORDER
+global $CONTENT_SEARCH_TABLE_ORDER;
+return $CONTENT_SEARCH_TABLE_ORDER;
+SC_END
+
+SC_BEGIN CONTENT_SEARCH_TABLE_KEYWORD
+global $CONTENT_SEARCH_TABLE_KEYWORD;
+return $CONTENT_SEARCH_TABLE_KEYWORD;
+SC_END
+
+// CONTENT_SEARCHRESULT_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_SEARCHRESULT_TABLE_ICON
+global $CONTENT_SEARCHRESULT_TABLE_ICON, $aa, $row, $content_icon_path, $qs, $content_pref, $mainparent;
+$width = (isset($content_pref["content_upload_icon_size_{$mainparent}"]) && $content_pref["content_upload_icon_size_{$mainparent}"] ? $content_pref["content_upload_icon_size_{$mainparent}"] : "100");
+return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon_{$mainparent}"]);
+SC_END
+
+SC_BEGIN CONTENT_SEARCHRESULT_TABLE_HEADING
+global $CONTENT_SEARCHRESULT_TABLE_HEADING, $row, $qs, $tp;
+return ($row['content_heading'] ? "<a href='".e_SELF."?content.".$row['content_id']."'>".$tp -> toHTML($row['content_heading'], TRUE, "")."</a>" : "");
+SC_END
+
+SC_BEGIN CONTENT_SEARCHRESULT_TABLE_SUBHEADING
+global $CONTENT_SEARCHRESULT_TABLE_SUBHEADING, $row, $tp;
+return ($row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
+SC_END
+
+SC_BEGIN CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS
+global $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS, $qs, $aa, $row;
+$authordetails = $aa -> getAuthor($row['content_author']);
+$CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS = $authordetails[1];
+if(USER){
+	if(is_numeric($authordetails[3])){
+		$CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " <a href='".e_BASE."user.php?id.".$authordetails[0]."' title='".CONTENT_LAN_40."'>".CONTENT_ICON_USER."</a>";
+	}else{
+		$CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " ".CONTENT_ICON_USER;
+	}
+}else{
+	$CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " ".CONTENT_ICON_USER;
+}
+$CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS .= " <a href='".e_SELF."?author.".$row['content_id']."' title='".CONTENT_LAN_39."'>".CONTENT_ICON_AUTHORLIST."</a>";
+return $CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS;
+SC_END
+
+SC_BEGIN CONTENT_SEARCHRESULT_TABLE_DATE
+global $CONTENT_SEARCHRESULT_TABLE_DATE, $gen, $row;
+$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "short"));
+return $datestamp;
+SC_END
+
+SC_BEGIN CONTENT_SEARCHRESULT_TABLE_TEXT
+global $CONTENT_SEARCHRESULT_TABLE_TEXT, $row, $tp;
+return ($row['content_text'] ? $tp -> toHTML($row['content_text'], TRUE, "") : "");
+SC_END
+
+// CONTENT_RECENT_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_RECENT_TABLE_INFOPRE
+global $CONTENT_RECENT_TABLE_INFOPRE;
+if($CONTENT_RECENT_TABLE_INFOPRE === TRUE){
+$CONTENT_RECENT_TABLE_INFOPRE = " ";
+return $CONTENT_RECENT_TABLE_INFOPRE;
+}
+SC_END
+SC_BEGIN CONTENT_RECENT_TABLE_INFOPOST
+global $CONTENT_RECENT_TABLE_INFOPOST;
+if($CONTENT_RECENT_TABLE_INFOPOST === TRUE){
+$CONTENT_RECENT_TABLE_INFOPOST = " ";
+return $CONTENT_RECENT_TABLE_INFOPOST;
+}
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_ICON
+global $CONTENT_RECENT_TABLE_ICON, $aa, $row, $content_icon_path, $content_pref, $mainparent;
+if(isset($content_pref["content_list_icon_{$mainparent}"]) && $content_pref["content_list_icon_{$mainparent}"]){
+$width = (isset($content_pref["content_upload_icon_size_{$mainparent}"]) && $content_pref["content_upload_icon_size_{$mainparent}"] ? $content_pref["content_upload_icon_size_{$mainparent}"] : "100");
+return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "content.".$row['content_id'], $width, $content_pref["content_blank_icon_{$mainparent}"]);
+}
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_HEADING
+global $CONTENT_RECENT_TABLE_HEADING, $row, $tp;
+return ($row['content_heading'] ? "<a href='".e_SELF."?content.".$row['content_id']."'>".$tp->toHTML($row['content_heading'], TRUE, "")."</a>" : "");
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_SUBHEADING
+global $CONTENT_RECENT_TABLE_SUBHEADING, $tp, $content_pref, $qs, $row, $mainparent;
+if (isset($content_pref["content_list_subheading_{$mainparent}"]) && $content_pref["content_list_subheading_{$mainparent}"] && $row['content_subheading'] && $content_pref["content_list_subheading_char_{$mainparent}"] && $content_pref["content_list_subheading_char_{$mainparent}"] != "" && $content_pref["content_list_subheading_char_{$mainparent}"] != "0"){
+	if(strlen($row['content_subheading']) > $content_pref["content_list_subheading_char_{$mainparent}"]) {
+		$row['content_subheading'] = substr($row['content_subheading'], 0, $content_pref["content_list_subheading_char_{$mainparent}"]).$content_pref["content_list_subheading_post_{$mainparent}"];
+	}
+	$CONTENT_RECENT_TABLE_SUBHEADING = ($row['content_subheading'] != "" && $row['content_subheading'] != " " ? $row['content_subheading'] : "");
+}else{
+	$CONTENT_RECENT_TABLE_SUBHEADING = ($row['content_subheading'] ? $row['content_subheading'] : "");
+}
+return $tp->toHTML($CONTENT_RECENT_TABLE_SUBHEADING, TRUE, "");
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_SUMMARY
+global $CONTENT_RECENT_TABLE_SUMMARY, $content_pref, $tp, $qs, $row, $mainparent;
+if (isset($content_pref["content_list_summary_{$mainparent}"]) && $content_pref["content_list_summary_{$mainparent}"]){
+	if($row['content_summary'] && $content_pref["content_list_summary_char_{$mainparent}"] && $content_pref["content_list_summary_char_{$mainparent}"] != "" && $content_pref["content_list_summary_char_{$mainparent}"] != "0"){
+		if(strlen($row['content_summary']) > $content_pref["content_list_summary_char_{$mainparent}"]) {
+			$row['content_summary'] = substr($row['content_summary'], 0, $content_pref["content_list_summary_char_{$mainparent}"]).$content_pref["content_list_summary_post_{$mainparent}"];
+		}
+		$CONTENT_RECENT_TABLE_SUMMARY = ($row['content_summary'] != "" && $row['content_summary'] != " " ? $row['content_summary'] : "");
+	}else{
+		$CONTENT_RECENT_TABLE_SUMMARY = ($row['content_summary'] ? $row['content_summary'] : "");
+	}
+return $tp->toHTML($CONTENT_RECENT_TABLE_SUMMARY, TRUE, "");
+}
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_TEXT
+global $CONTENT_RECENT_TABLE_TEXT, $content_pref, $qs, $row, $mainparent, $tp;
+if(isset($content_pref["content_list_text_{$mainparent}"]) && $content_pref["content_list_text_{$mainparent}"] && $content_pref["content_list_text_char_{$mainparent}"] > 0){
+	$rowtext = preg_replace("/\[newpage.*?]/si", " ", $row['content_text']);
+	//$rowtext = str_replace ("<br />", " ", $rowtext);
+	$rowtext = $tp->toHTML($rowtext, TRUE, "nobreak");
+	$rowtext = strip_tags($rowtext);
+	$words = explode(" ", $rowtext);
+	$CONTENT_RECENT_TABLE_TEXT = implode(" ", array_slice($words, 0, $content_pref["content_list_text_char_{$mainparent}"]));
+	if($CONTENT_RECENT_TABLE_TEXT){
+		if($content_pref["content_list_text_link_{$mainparent}"]){
+			$CONTENT_RECENT_TABLE_TEXT .= " <a href='".e_SELF."?content.".$row['content_id']."'>".$content_pref["content_list_text_post_{$mainparent}"]."</a>";
+		}else{
+			$CONTENT_RECENT_TABLE_TEXT .= " ".$content_pref["content_list_text_post_{$mainparent}"];
+		}
+	}
+}
+return $CONTENT_RECENT_TABLE_TEXT;
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_DATE
+global $CONTENT_RECENT_TABLE_DATE, $content_pref, $qs, $row, $mainparent;
+if(isset($content_pref["content_list_date_{$mainparent}"]) && $content_pref["content_list_date_{$mainparent}"]){
+$datestyle = ($content_pref["content_list_datestyle_{$mainparent}"] ? $content_pref["content_list_datestyle_{$mainparent}"] : "%d %b %Y");
+return strftime($datestyle, $row['content_datestamp']);
+}
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_EPICONS
+global $CONTENT_RECENT_TABLE_EPICONS, $tp, $content_pref, $qs, $row, $mainparent;
+$CONTENT_RECENT_TABLE_EPICONS = "";
+if(isset($content_pref["content_list_peicon_{$mainparent}"]) && $content_pref["content_list_peicon_{$mainparent}"]){
+	if($row['content_pe'] || isset($content_pref["content_list_peicon_all_{$mainparent}"]) && $content_pref["content_list_peicon_all_{$mainparent}"]){
+		$CONTENT_RECENT_TABLE_EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
+		$CONTENT_RECENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
+		$CONTENT_RECENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
+	}
+}
+return $CONTENT_RECENT_TABLE_EPICONS;
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_AUTHORDETAILS
+global $CONTENT_RECENT_TABLE_AUTHORDETAILS;
+return $CONTENT_RECENT_TABLE_AUTHORDETAILS;
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_EDITICON
+global $CONTENT_RECENT_TABLE_EDITICON, $content_pref, $qs, $row, $mainparent, $plugindir;
+if(ADMIN && getperms("P") && isset($content_pref["content_list_editicon_{$mainparent}"]) && $content_pref["content_list_editicon_{$mainparent}"]){
+return $CONTENT_RECENT_TABLE_EDITICON = "<a href='".$plugindir."admin_content_config.php?content.edit.".$row['content_id']."'>".CONTENT_ICON_EDIT."</a>";
+}
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_REFER
+global $CONTENT_RECENT_TABLE_REFER, $content_pref, $qs, $row, $mainparent;
+if($content_pref["content_log_{$mainparent}"] && $content_pref["content_list_refer_{$mainparent}"]){
+	$refercounttmp = explode("^", $row['content_refer']);
+	$CONTENT_RECENT_TABLE_REFER = ($refercounttmp[0] ? $refercounttmp[0] : "0");
+	if($CONTENT_RECENT_TABLE_REFER > 0){
+		return $CONTENT_RECENT_TABLE_REFER;
+	}
+}
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_RATING
+global $CONTENT_RECENT_TABLE_RATING, $rater, $row, $qs, $content_pref, $plugintable, $mainparent;
+if($content_pref["content_list_rating_{$mainparent}"]){
+	if($content_pref["content_list_rating_all_{$mainparent}"] || $row['content_rate']){
+		return $rater->composerating($plugintable, $row['content_id'], $enter=FALSE, $userid=FALSE);
+	}
+}
+SC_END
+
+SC_BEGIN CONTENT_RECENT_TABLE_PARENT
+global $CONTENT_RECENT_TABLE_PARENT, $content_pref, $mainparent, $row, $array, $aa;
+if(isset($content_pref["content_list_parent_{$mainparent}"]) && $content_pref["content_list_parent_{$mainparent}"]){
+return $aa -> getCrumbItem($row['content_parent'], $array);
+}
+SC_END
+
+// CONTENT_ARCHIVE_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_ARCHIVE_TABLE_LETTERS
+global $CONTENT_ARCHIVE_TABLE_LETTERS, $content_pref, $mainparent;
+if($content_pref["content_archive_letterindex_{$mainparent}"]){
+return $CONTENT_ARCHIVE_TABLE_LETTERS;
+}
+SC_END
+
+SC_BEGIN CONTENT_ARCHIVE_TABLE_HEADING
+global $CONTENT_ARCHIVE_TABLE_HEADING, $row, $qs;
+return "<a href='".e_SELF."?content.".$row['content_id']."'>".$row['content_heading']."</a>";
+SC_END
+
+SC_BEGIN CONTENT_ARCHIVE_TABLE_DATE
+global $CONTENT_ARCHIVE_TABLE_DATE, $row, $content_pref, $qs, $mainparent;
+if(isset($content_pref["content_archive_date_{$mainparent}"]) && $content_pref["content_archive_date_{$mainparent}"]){
+$datestyle = ($content_pref["content_archive_datestyle_{$mainparent}"] ? $content_pref["content_archive_datestyle_{$mainparent}"] : "%d %b %Y");
+return strftime($datestyle, $row['content_datestamp']);
+}
+SC_END
+
+SC_BEGIN CONTENT_ARCHIVE_TABLE_AUTHOR
+global $CONTENT_ARCHIVE_TABLE_AUTHOR;
+return $CONTENT_ARCHIVE_TABLE_AUTHOR;
+SC_END
+
+// CONTENT_CONTENT_TABLE ------------------------------------------------
+SC_BEGIN CONTENT_CONTENT_TABLE_INFO_PRE
+global $CONTENT_CONTENT_TABLE_INFO_PRE;
+if($CONTENT_CONTENT_TABLE_INFO_PRE === TRUE){
+$CONTENT_CONTENT_TABLE_INFO_PRE = " ";
+return $CONTENT_CONTENT_TABLE_INFO_PRE;
+}
+SC_END
+SC_BEGIN CONTENT_CONTENT_TABLE_INFO_POST
+global $CONTENT_CONTENT_TABLE_INFO_POST;
+if($CONTENT_CONTENT_TABLE_INFO_POST === TRUE){
+$CONTENT_CONTENT_TABLE_INFO_POST = " ";
+return $CONTENT_CONTENT_TABLE_INFO_POST;
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA
+global $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA;
+if($CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA === TRUE){
+$CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA = " ";
+return $CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA;
+}
+SC_END
+SC_BEGIN CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA
+global $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA;
+if($CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA === TRUE){
+$CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA = " ";
+return $CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA;
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_PARENT
+global $CONTENT_CONTENT_TABLE_PARENT, $aa, $array, $row, $content_pref, $mainparent;
+if(isset($content_pref["content_content_parent_{$mainparent}"]) && $content_pref["content_content_parent_{$mainparent}"]){
+return $aa -> getCrumbItem($row['content_parent'], $array);
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_ICON
+global $CONTENT_CONTENT_TABLE_ICON, $qs, $row, $aa, $content_pref, $content_icon_path, $mainparent;
+if(isset($content_pref["content_content_icon_{$mainparent}"]) && $content_pref["content_content_icon_{$mainparent}"]){
+$width = (isset($content_pref["content_upload_icon_size_{$mainparent}"]) && $content_pref["content_upload_icon_size_{$mainparent}"] ? $content_pref["content_upload_icon_size_{$mainparent}"] : "100");
+return $aa -> getIcon("item", $row['content_icon'], $content_icon_path, "", $width, $content_pref["content_blank_icon_{$mainparent}"]);
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_HEADING
+global $CONTENT_CONTENT_TABLE_HEADING, $row, $tp;
+$CONTENT_CONTENT_TABLE_HEADING = ($row['content_heading'] ? $tp -> toHTML($row['content_heading'], TRUE, "") : "");
+return $CONTENT_CONTENT_TABLE_HEADING;
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_REFER
+global $CONTENT_CONTENT_TABLE_REFER, $sql, $qs, $content_pref, $plugintable, $mainparent;
+if(isset($content_pref["content_content_refer_{$mainparent}"]) && $content_pref["content_content_refer_{$mainparent}"]){
+	$sql -> db_Select($plugintable, "content_refer", "content_id='".intval($qs[1])."' ");
+	list($content_refer) = $sql -> db_Fetch();
+	$refercounttmp = explode("^", $content_refer);
+	$CONTENT_CONTENT_TABLE_REFER = ($refercounttmp[0] ? $refercounttmp[0] : "");
+return $CONTENT_CONTENT_TABLE_REFER;
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_SUBHEADING
+global $CONTENT_CONTENT_TABLE_SUBHEADING, $row, $tp, $content_pref, $qs, $mainparent;
+$CONTENT_CONTENT_TABLE_SUBHEADING = ($content_pref["content_content_subheading_{$mainparent}"] && $row['content_subheading'] ? $tp -> toHTML($row['content_subheading'], TRUE, "") : "");
+return $CONTENT_CONTENT_TABLE_SUBHEADING;
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_COMMENT
+global $CONTENT_CONTENT_TABLE_COMMENT, $cobj, $qs, $content_pref, $mainparent, $row, $plugintable;
+if((isset($content_pref["content_content_comment_{$mainparent}"]) && $content_pref["content_content_comment_{$mainparent}"] && $row['content_comment']) || $content_pref["content_content_comment_all_{$mainparent}"] ){
+return $cobj -> count_comments($plugintable, $qs[1]);
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_DATE
+global $CONTENT_CONTENT_TABLE_DATE, $gen, $row, $qs, $content_pref, $mainparent;
+if(isset($content_pref["content_content_date_{$mainparent}"]) && $content_pref["content_content_date_{$mainparent}"]){
+	$gen = new convert;
+	$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long"));
+	$CONTENT_CONTENT_TABLE_DATE = ($datestamp != "" ? $datestamp : "");
+return $CONTENT_CONTENT_TABLE_DATE;
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_AUTHORDETAILS
+global $CONTENT_CONTENT_TABLE_AUTHORDETAILS;
+return $CONTENT_CONTENT_TABLE_AUTHORDETAILS;
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_EPICONS
+global $CONTENT_CONTENT_TABLE_EPICONS, $content_pref, $qs, $row, $tp, $mainparent;
+$CONTENT_CONTENT_TABLE_EPICONS = "";
+if(($content_pref["content_content_peicon_{$mainparent}"] && $row['content_pe']) || $content_pref["content_content_peicon_all_{$mainparent}"]){
+	$CONTENT_CONTENT_TABLE_EPICONS = $tp -> parseTemplate("{EMAIL_ITEM=".CONTENT_LAN_69." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
+	$CONTENT_CONTENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PRINT_ITEM=".CONTENT_LAN_70." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
+	$CONTENT_CONTENT_TABLE_EPICONS .= " ".$tp -> parseTemplate("{PDF=".CONTENT_LAN_76." ".CONTENT_LAN_71."^plugin:content.".$row['content_id']."}");
+return $CONTENT_CONTENT_TABLE_EPICONS;
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_EDITICON
+global $CONTENT_CONTENT_TABLE_EDITICON, $content_pref, $qs, $row, $plugindir, $mainparent;
+if(ADMIN && getperms("P") && isset($content_pref["content_content_editicon_{$mainparent}"])){
+	$CONTENT_CONTENT_TABLE_EDITICON = "<a href='".$plugindir."admin_content_config.php?content.edit.".$row['content_id']."'>".CONTENT_ICON_EDIT."</a>";
+return $CONTENT_CONTENT_TABLE_EDITICON;
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_RATING
+global $CONTENT_CONTENT_TABLE_RATING, $content_pref, $qs, $row, $rater, $plugintable, $mainparent;
+if(($content_pref["content_content_rating_{$mainparent}"] && $row['content_rate']) || $content_pref["content_content_rating_all_{$mainparent}"] ){
+return $rater->composerating($plugintable, $row['content_id'], $enter=TRUE, $userid=FALSE);
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_FILE
+global $CONTENT_CONTENT_TABLE_FILE, $row, $content_file_path, $content_pref, $mainparent;
+if($content_pref["content_content_attach_{$mainparent}"]){
+$filestmp = explode("[file]", $row['content_file']);
+foreach($filestmp as $key => $value) { 
+	if($value == "") { 
+		unset($filestmp[$key]); 
+	} 
+} 
+$files = array_values($filestmp);
+$content_files_popup_name = str_replace("'", "", $row['content_heading']);
+$file = "";
+$filesexisting = "0";
+for($i=0;$i<count($files);$i++){
+	if(file_exists($content_file_path.$files[$i])){
+		$filesexisting = $filesexisting+1;
+		$file .= "<a href='".$content_file_path.$files[$i]."' rel='external'>".CONTENT_ICON_FILE."</a> ";						
+	}else{
+		$file .= "&nbsp;";
+	}
+}
+$CONTENT_CONTENT_TABLE_FILE = ($filesexisting == "0" ? "" : CONTENT_LAN_41." ".($filesexisting == 1 ? CONTENT_LAN_42 : CONTENT_LAN_43)." ".$file." ");
+return $CONTENT_CONTENT_TABLE_FILE;
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_SCORE
+global $CONTENT_CONTENT_TABLE_SCORE, $row;
+$score = $row['content_score'];
+if($score){
+	$height = "height:8px;";
+	$img = "";
+	$img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
+	$img .= "<img src='".e_PLUGIN."content/images/score.png' alt='' style='$height width:".$score."px; border:0;' />";
+	$img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
+	if($score < 100){
+		$empty = 100-$score;
+		$img .= "<img src='".e_PLUGIN."content/images/score_empty.png' alt='' style='$height width:".$empty."px; border:0;' />";
+	}
+	$img .= "<img src='".e_PLUGIN."content/images/score_end.png' alt='' style='$height width:1px; border:0;' />";
+	return $img." ".$score;
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_SUMMARY
+global $CONTENT_CONTENT_TABLE_SUMMARY;
+return $CONTENT_CONTENT_TABLE_SUMMARY;
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_TEXT
+global $CONTENT_CONTENT_TABLE_TEXT;
+return $CONTENT_CONTENT_TABLE_TEXT;
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_IMAGES
+global $CONTENT_CONTENT_TABLE_IMAGES, $row, $content_image_path, $aa, $tp, $authordetails, $content_pref, $mainparent;
+if($content_pref["content_content_images_{$mainparent}"]){
+$authordetails = $aa -> getAuthor($row['content_author']);
+$imagestmp = explode("[img]", $row['content_image']);
+foreach($imagestmp as $key => $value) { 
+	if($value == "") { 
+		unset($imagestmp[$key]); 
+	} 
+} 
+$images = array_values($imagestmp);
+$content_image_popup_name = $row['content_heading'];
+$CONTENT_CONTENT_TABLE_IMAGES = "";
+require_once(e_HANDLER."popup_handler.php");
+$pp = new popup;
+$gen = new convert;
+$datestamp = preg_replace("# -.*#", "", $gen -> convert_date($row['content_datestamp'], "long"));
+for($i=0;$i<count($images);$i++){		
+	$oSrc = $content_image_path.$images[$i];
+	$oSrcThumb = $content_image_path."thumb_".$images[$i];
+
+	$oIconWidth = (isset($content_pref["content_upload_image_size_thumb_{$mainparent}"]) && $content_pref["content_upload_image_size_thumb_{$mainparent}"] ? $content_pref["content_upload_image_size_thumb_{$mainparent}"] : "100");
+	
+	$oMaxWidth = (isset($content_pref["content_upload_image_size_{$mainparent}"]) && $content_pref["content_upload_image_size_{$mainparent}"] ? $content_pref["content_upload_image_size_{$mainparent}"] : "500");
+	
+	$subheading	= $tp -> toHTML($row['content_subheading'], TRUE);
+	$popupname	= $tp -> toHTML($content_image_popup_name, TRUE);
+	$author		= $tp -> toHTML($authordetails[1], TRUE);
+	$oTitle		= $popupname." ".($i+1);
+	$oText		= $popupname." ".($i+1)."<br />".$subheading."<br />".$author." (".$datestamp.")";
+	$CONTENT_CONTENT_TABLE_IMAGES .= $pp -> popup($oSrc, $oSrcThumb, $oIconWidth, $oMaxWidth, $oTitle, $oText);
+}
+return $CONTENT_CONTENT_TABLE_IMAGES;
+}
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_CUSTOM_TAGS
+global $CONTENT_CONTENT_TABLE_CUSTOM_TAGS;
+return $CONTENT_CONTENT_TABLE_CUSTOM_TAGS;
+SC_END
+
+SC_BEGIN CONTENT_CONTENT_TABLE_PAGENAMES
+global $CONTENT_CONTENT_TABLE_PAGENAMES;
+return $CONTENT_CONTENT_TABLE_PAGENAMES;
+SC_END
+
+
+
+
+
+// PRINT PAGE ------------------------------------------------
+
+//content images (from uploaded area) used in the print page
+SC_BEGIN CONTENT_PRINT_IMAGES
+global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $tp, $content_pref, $mainparent;
+if($content_pref["content_content_images_{$mainparent}"]){
+$imagestmp = explode("[img]", $row['content_image']);
+foreach($imagestmp as $key => $value) { 
+	if($value == "") { 
+		unset($imagestmp[$key]); 
+	} 
+} 
+$images = array_values($imagestmp);
+$CONTENT_PRINT_IMAGES = "";
+for($i=0;$i<count($images);$i++){		
+	$oSrc = $content_image_path.$images[$i];
+	$oSrcThumb = $content_image_path."thumb_".$images[$i];
+
+	$iconwidth = (isset($content_pref["content_upload_image_size_thumb_{$mainparent}"]) && $content_pref["content_upload_image_size_thumb_{$mainparent}"] ? $content_pref["content_upload_image_size_thumb_{$mainparent}"] : "100");
+	if($iconwidth){
+		$iconwidth = "width:".$iconwidth."px;";
+	}
+	
+	//use $image if $thumb doesn't exist
+	if(file_exists($oSrc)){
+		if(!file_exists($oSrcThumb)){
+			$thumb = $oSrc;
+		}else{
+			$thumb = $oSrcThumb;
+		}
+		$CONTENT_PRINT_IMAGES .= "<img src='".$thumb."' style='border:1px solid #000; ".$iconwidth."' alt='' /><br /><br />";
+	}
+}
+return $CONTENT_PRINT_IMAGES;
+}
+SC_END
+
+
+// PDF PAGE ------------------------------------------------
+
+//content images (from uploaded area) used in the pdf creation
+SC_BEGIN CONTENT_PDF_IMAGES
+global $CONTENT_PDF_IMAGES, $row, $content_image_path, $tp, $content_pref, $mainparent;
+if($content_pref["content_content_images_{$mainparent}"]){
+$imagestmp = explode("[img]", $row['content_image']);
+foreach($imagestmp as $key => $value) { 
+	if($value == "") { 
+		unset($imagestmp[$key]); 
+	} 
+} 
+$images = array_values($imagestmp);
+$CONTENT_PDF_IMAGES = "";
+for($i=0;$i<count($images);$i++){		
+	$oSrc = $content_image_path.$images[$i];
+	$oSrcThumb = $content_image_path."thumb_".$images[$i];
+
+	$iconwidth = (isset($content_pref["content_upload_image_size_thumb_{$mainparent}"]) && $content_pref["content_upload_image_size_thumb_{$mainparent}"] ? $content_pref["content_upload_image_size_thumb_{$mainparent}"] : "100");
+	if($iconwidth){
+		$iconwidth = "width:".$iconwidth."px;";
+	}
+	
+	//use $image if $thumb doesn't exist
+	if(file_exists($oSrc)){
+		if(!file_exists($oSrcThumb)){
+			$thumb = $oSrc;
+		}else{
+			$thumb = $oSrcThumb;
+		}
+		$thumb = $oSrc;
+		$CONTENT_PDF_IMAGES .= "<img src='".$thumb."' style='border:1px solid #000; ".$iconwidth."' alt='' />";
+	}
+}
+return $CONTENT_PDF_IMAGES;
+}
+SC_END
+
+*/
+?>
diff -ruN 6171/e107_plugins/content/content_sql.php 75/e107_plugins/content/content_sql.php
--- 6171/e107_plugins/content/content_sql.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/content_sql.php	2005-06-26 02:51:02.000000000 -0500
@@ -0,0 +1,51 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content_sql.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/06/26 07:51:02 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+header("location:../index.php");
+exit;
+?>
+# Table structure for table `content`
+#
+
+CREATE TABLE pcontent (
+  content_id int(10) unsigned NOT NULL auto_increment,
+  content_heading varchar(255) NOT NULL default '',
+  content_subheading varchar(255) NOT NULL default '',
+  content_summary text NOT NULL,
+  content_text longtext NOT NULL,
+  content_author varchar(255) NOT NULL default '',
+  content_icon varchar(255) NOT NULL default '',
+  content_file text NOT NULL,
+  content_image text NOT NULL,
+  content_parent varchar(50) NOT NULL default '',
+  content_comment tinyint(1) unsigned NOT NULL default '0',
+  content_rate tinyint(1) unsigned NOT NULL default '0',
+  content_pe tinyint(1) unsigned NOT NULL default '0',
+  content_refer text NOT NULL,
+  content_datestamp int(10) unsigned NOT NULL default '0',
+  content_enddate int(10) unsigned NOT NULL default '0',
+  content_class varchar(255) NOT NULL default '',
+  content_pref text NOT NULL, 
+  content_order varchar(10) NOT NULL default '0',
+  content_score tinyint(3) unsigned NOT NULL default '0',
+  content_meta text NOT NULL,
+  content_layout varchar(255) NOT NULL default '',
+  PRIMARY KEY  (content_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
diff -ruN 6171/e107_plugins/content/content_submit.php 75/e107_plugins/content/content_submit.php
--- 6171/e107_plugins/content/content_submit.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/content_submit.php	2006-02-13 04:13:22.000000000 -0600
@@ -0,0 +1,134 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        /admin/review.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content_submit.php,v $
+|		$Revision: 1.20 $
+|		$Date: 2006/02/13 10:13:22 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+
+$plugindir = e_PLUGIN."content/";
+
+require_once($plugindir."content_shortcodes.php");
+require_once(e_HANDLER."form_handler.php");
+require_once(e_HANDLER."userclass_class.php");
+$rs = new form;
+require_once($plugindir."handlers/content_class.php");
+$aa = new content;
+require_once($plugindir."handlers/content_db_class.php");
+$adb = new contentdb;
+require_once($plugindir."handlers/content_form_class.php");
+$aform = new contentform;
+require_once(e_HANDLER."file_class.php");
+$fl = new e_file;
+e107_require_once(e_HANDLER.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+
+//these have to be set for the tinymce wysiwyg
+$e_wysiwyg	= "content_text";
+$WYSIWYG	= true;
+
+global $tp;
+
+$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php';
+include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.php');
+
+if(e_QUERY){
+	$qs = explode(".", e_QUERY);
+}
+
+// define e_pagetitle
+$aa -> setPageTitle();
+
+//include js
+//function headerjs(){
+//}
+
+require_once(HEADERF);
+
+if(isset($_POST['create_content'])){
+	if($_POST['content_text'] && $_POST['content_heading'] && $_POST['parent'] != "none" && $_POST['content_author_name'] != "" && $_POST['content_author_email'] != ""){
+		$adb -> dbContent("create", "submit");
+	}else{
+		$message = CONTENT_ADMIN_SUBMIT_LAN_4;
+	}
+}
+
+if(isset($qs[0]) && $qs[0] == "s"){
+	$message = CONTENT_ADMIN_SUBMIT_LAN_2."<br /><br />".CONTENT_ADMIN_SUBMIT_LAN_5;
+	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+	require_once(FOOTERF);
+	exit;
+}
+if(isset($qs[0]) && $qs[0] == "d"){
+	$message = CONTENT_ADMIN_SUBMIT_LAN_3."<br /><br />".CONTENT_ADMIN_SUBMIT_LAN_5;
+	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+	require_once(FOOTERF);
+	exit;
+}
+
+if(isset($message)){
+	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+if(!isset($qs[0])){
+	if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_icon, content_pref", "content_parent = '0' AND content_class REGEXP '".e_CLASS_REGEXP."' ORDER BY content_heading")){
+		$text .= "<div style='text-align:center;'>".CONTENT_ADMIN_SUBMIT_LAN_0."</div>";
+	}else{
+		
+		if(!isset($CONTENT_SUBMIT_TYPE_TABLE)){
+			require_once($plugindir."templates/content_submit_type_template.php");
+		}
+		$sql2 = "";
+		$content_submit_type_table_string = "";
+		$count = "0";
+		while($row = $sql -> db_Fetch()){
+			if(!is_object($sql2)){ $sql2 = new db; }
+
+			$content_pref					= $eArrayStorage->ReadArray($row['content_pref']);
+			$content_pref["content_cat_icon_path_large_{$row['content_id']}"] = ($content_pref["content_cat_icon_path_large_{$row['content_id']}"] ? $content_pref["content_cat_icon_path_large_{$row['content_id']}"] : "{e_PLUGIN}content/images/cat/48/" );
+			$content_pref["content_cat_icon_path_small_{$row['content_id']}"] = ($content_pref["content_cat_icon_path_small_{$row['content_id']}"] ? $content_pref["content_cat_icon_path_small_{$row['content_id']}"] : "{e_PLUGIN}content/images/cat/16/" );
+			$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$row['content_id']}"]);
+			$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$row['content_id']}"]);
+			$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path_{$row['content_id']}"]);
+			if($content_pref["content_submit_{$row['content_id']}"] && check_class($content_pref["content_submit_class_{$row['content_id']}"])){
+				$content_submit_type_table_string .= $tp -> parseTemplate($CONTENT_SUBMIT_TYPE_TABLE, FALSE, $content_shortcodes);
+				$count = $count + 1;
+			}
+		}
+		if($count == "0"){
+			$text .= "<div style='text-align:center;'>".CONTENT_ADMIN_SUBMIT_LAN_0."</div>";
+		}else{
+			$text = $CONTENT_SUBMIT_TYPE_TABLE_START.$content_submit_type_table_string.$CONTENT_SUBMIT_TYPE_TABLE_END;
+		}
+	}
+	$caption = CONTENT_ADMIN_SUBMIT_LAN_1;
+	$ns -> tablerender($caption, $text);
+}
+
+if(isset($qs[0]) && $qs[0]=="content" && $qs[1] == "submit" && is_numeric($qs[2]) && !isset($qs[3])){
+	//check if valid categories exist for this main parent
+	$array			= $aa -> getCategoryTree("", intval($qs[2]), TRUE);
+	$validparent	= implode(",", array_keys($array));
+	$qry			= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+	$sql2			= new db;
+	//$contenttotal	= $sql2 -> db_Count($plugintable, "(*)", "WHERE ".$qry." ".$datequery." AND content_class REGEXP '".e_CLASS_REGEXP."' " );
+	$aform -> show_create_content("submit");
+}
+
+require_once(FOOTERF);
+
+?>
diff -ruN 6171/e107_plugins/content/content_update_check.php 75/e107_plugins/content/content_update_check.php
--- 6171/e107_plugins/content/content_update_check.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/content_update_check.php	2005-12-29 16:19:37.000000000 -0600
@@ -0,0 +1,85 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content_update_check.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/29 22:19:37 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$dbupdatep['content_07'] =  LAN_UPDATE_8." .617 content ".LAN_UPDATE_9." .7 content";
+function update_content_07($type='') 
+{
+	global $sql, $mySQLdefaultdb;
+	if($type == 'do')
+	{
+		if(!isset($_POST['updateall']))
+		{	
+			include_once(e_PLUGIN.'content/content_update.php');
+		}
+	}
+	else
+	{
+		// FALSE = needed, TRUE = not needed.
+		
+		//if not installed, return FALSE = needed
+		if(!$sql->db_Select("plugin", "plugin_version", "plugin_path = 'content'")){
+			return FALSE; //needed
+		}else{
+			$row = $sql->db_Fetch();
+			
+			//if version < 1.21, return FALSE = needed
+			if($row['plugin_version'] < 1.21){
+				return FALSE; //needed
+			}
+
+			$newcontent = $sql -> db_Count("pcontent", "(*)", "");
+			
+			//if no rows in new table && no old content table exists, return FALSE = needed
+			$exists = mysql_query("SELECT 1 FROM ".MPREFIX."content LIMIT 0");
+			if($newcontent == 0 && !$exists){
+				return FALSE; //needed
+			}
+			
+			//if parent value is old style, return FALSE = needed
+			if($newcontent > 0){
+				if($thiscount = $sql -> db_Select("pcontent", "*", "ORDER BY content_id ", "mode=no_where" )){
+					while($row = $sql -> db_Fetch()){
+						if( strpos($row['content_parent'], ".") && substr($row['content_parent'],0,1) != "0"){
+							//if item with old parent value exists, you need to upgrade to 1.1
+							return FALSE; //needed
+						}
+					}
+				}
+			}
+
+			//if added fields are not present, return FALSE = needed
+			$field1 = $sql->db_Field("pcontent",19);
+			$field2 = $sql->db_Field("pcontent",20);
+			$field3 = $sql->db_Field("pcontent",21);
+			if($field1 != "content_score" && $field2 != "content_meta" && $field3 != "content_layout"){
+				return FALSE; //needed
+			}
+
+			//else if passing all above checks, return TRUE = not needed
+			return TRUE;
+		}
+	}
+}
+
+
+
+?>
+			
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/content_update.php 75/e107_plugins/content/content_update.php
--- 6171/e107_plugins/content/content_update.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/content_update.php	2006-01-09 03:56:57.000000000 -0600
@@ -0,0 +1,359 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/content_update.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/01/09 09:56:57 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+
+global $ns, $sql, $pref;
+
+$plugindir		= e_PLUGIN."content/";
+$plugintable	= "pcontent";		//name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)
+
+require_once($plugindir."handlers/content_defines.php");
+require_once($plugindir."handlers/content_class.php");
+$aa = new content;
+require_once($plugindir."handlers/content_convert_class.php");
+$ac = new content_convert;
+
+$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_admin.php';
+include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_admin.php');
+
+if($sql->db_Select("plugin", "plugin_version", "plugin_path = 'content'"))
+{
+	$row = $sql->db_Fetch();
+	$content_version = $row['plugin_version'];
+}
+
+//create table if it doesn't exist
+if(!$sql->db_Query("SHOW COLUMNS FROM ".MPREFIX."pcontent")) {
+	$query = "CREATE TABLE ".MPREFIX."pcontent (
+	content_id int(10) unsigned NOT NULL auto_increment,
+	content_heading varchar(255) NOT NULL default '',
+	content_subheading varchar(255) NOT NULL default '',
+	content_summary text NOT NULL,
+	content_text longtext NOT NULL,
+	content_author varchar(255) NOT NULL default '',
+	content_icon varchar(255) NOT NULL default '',
+	content_file text NOT NULL,
+	content_image text NOT NULL,
+	content_parent varchar(50) NOT NULL default '',
+	content_comment tinyint(1) unsigned NOT NULL default '0',
+	content_rate tinyint(1) unsigned NOT NULL default '0',
+	content_pe tinyint(1) unsigned NOT NULL default '0',
+	content_refer text NOT NULL,
+	content_datestamp int(10) unsigned NOT NULL default '0',
+	content_enddate int(10) unsigned NOT NULL default '0',
+	content_class varchar(255) NOT NULL default '',
+	content_pref text NOT NULL, 
+	content_order varchar(10) NOT NULL default '0',
+	content_score tinyint(3) unsigned NOT NULL default '0',
+	content_meta text NOT NULL,
+	content_layout varchar(255) NOT NULL default '',
+	PRIMARY KEY  (content_id)
+	) TYPE=MyISAM;";
+	
+	$sql->db_Select_gen($query);
+}
+
+$text = "";
+$main_convert = "";
+//main convert
+
+$newcontent = $sql -> db_Count($plugintable, "(*)", "");
+if($newcontent == 0){
+
+	unset($text);
+
+	//possible database values
+	//content page:		$content_parent == "1" && $content_type == "1"	//added at 20051031
+	//content page:		$content_parent == "0" && $content_type == "1"
+	//review category:	$content_parent == "0" && $content_type == "10"
+	//article category:	$content_parent == "0" && $content_type == "6"
+	//review:			$content_type == "3" || $content_type == "16"
+	//article:			$content_type == "0" || $content_type == "15"
+
+	// ##### STAGE 1 : ANALYSE OLD CONTENT --------------------------------------------------------
+	$sql = new db;
+	$totaloldcontentrows		= $sql -> db_Count("content");
+	$totaloldrowscat_article	= $sql -> db_Count("content", "(*)", "WHERE content_parent = '0' AND content_type = '6'");
+	$totaloldrowscat_review		= $sql -> db_Count("content", "(*)", "WHERE content_parent = '0' AND content_type = '10'");
+	$totaloldrowsitem_content	= $sql -> db_Count("content", "(*)", "WHERE (content_parent = '0' || content_parent = '1') AND content_type = '1'");
+	$totaloldrowsitem_review	= $sql -> db_Count("content", "(*)", "WHERE content_type = '3' || content_type = '16'");
+	$totaloldrowsitem_article	= $sql -> db_Count("content", "(*)", "WHERE content_type = '0' || content_type = '15'");
+
+	if($totaloldrowsitem_content == 0 && $totaloldrowsitem_article == 0 && $totaloldrowsitem_review == 0){
+		$totaloldrowsitem_content	= "1";
+		$totaloldrowsitem_article	= "1";
+		$totaloldrowsitem_review	= "1";
+		
+		//if no old records exist, create a few default categories
+		$main_convert = create_defaults();
+	}else{
+
+		//analyse unknown rows
+		$unknown_array				= $ac -> analyse_unknown();
+
+		if($totaloldcontentrows == 0){
+			$totaloldrowsitem_content	= "1";
+			$totaloldrowsitem_article	= "1";
+			$totaloldrowsitem_review	= "1";
+		}
+
+		//create mainparent
+		$content_mainarray			= $ac -> create_mainparent("content", $totaloldrowsitem_content, "1");
+		$article_mainarray			= $ac -> create_mainparent("article", $totaloldrowsitem_article, "2");
+		$review_mainarray			= $ac -> create_mainparent("review", $totaloldrowsitem_review, "3");
+
+		//convert categories
+		$article_cat_array			= $ac -> convert_category("article", "content_parent = '0' AND content_type = '6'", "2");
+		$review_cat_array			= $ac -> convert_category("review", "content_parent = '0' AND content_type = '10'", "3");
+
+		//convert rows
+		$content_array				= $ac -> convert_row("content", "(content_parent = '0' || content_parent = '1') AND content_type = '1'", "1");
+		$article_array				= $ac -> convert_row("article", "content_type = '0' || content_type = '15'", "2");
+		$review_array				= $ac -> convert_row("review", "content_type = '3' || content_type = '16'", "3");
+
+		//convert comments
+		$ac -> convert_comments();
+		
+		//convert rating
+		$ac -> convert_rating();
+
+		$conversion_analyses_rows_total		= $totaloldcontentrows;
+		
+		$conversion_analyses_rows_converted	= (count($article_cat_array[1]) + count($review_cat_array[1]) + count($content_array[2]) + count($article_array[2]) + count($review_array[2]));
+		
+		$conversion_analyses_rows_warning	= (count($content_array[4]) + count($content_array[5]) + count($article_array[4]) + count($article_array[5]) + count($review_array[4]) + count($review_array[5]));
+		
+		$conversion_analyses_rows_failed	= (count($article_cat_array[2]) + count($review_cat_array[2]) + count($content_array[3]) + count($article_array[3]) + count($review_array[3]) + count($unknown_array[1]));
+		
+		
+		//only output detailed information if developer mode is set
+		if ($pref['developer']) {
+			showlink();
+			$SPACER = "<tr><td $stylespacer colspan='2'>&nbsp;</td></tr>";
+			$text = "
+			<table class='fborder' style='width:95%; padding:0px;'>";
+
+			//conversion analysis
+			$text .= "
+			<tr>
+				<td class='forumheader' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_11."</td>
+				<td class='forumheader3'>
+					<a style='cursor: pointer; cursor: hand' onclick=\"expandit('analysisconvert');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+					<div id='analysisconvert' style='display: none;'>
+						".CONTENT_ADMIN_CONVERSION_LAN_12.": ".$conversion_analyses_rows_total."<br />
+						".CONTENT_ADMIN_CONVERSION_LAN_13.": ".$conversion_analyses_rows_converted."<br />
+						".CONTENT_ADMIN_CONVERSION_LAN_14.": ".$conversion_analyses_rows_warning."<br />
+						".CONTENT_ADMIN_CONVERSION_LAN_15.": ".$conversion_analyses_rows_failed."<br />
+					</div>
+				</td>
+			</tr>";
+
+			$text .= $SPACER;
+
+			//old content table : analysis
+			$text .= "
+			<tr>
+				<td class='forumheader' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_16."</td>
+				<td class='forumheader3'>
+					<a style='cursor: pointer; cursor: hand' onclick=\"expandit('analysisold');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+					<div id='analysisold' style='display: none;'>
+						".CONTENT_ADMIN_CONVERSION_LAN_17.": ".$totaloldcontentrows."<br />
+						".CONTENT_ADMIN_CONVERSION_LAN_0." ".CONTENT_ADMIN_CONVERSION_LAN_6.": ".$totaloldrowsitem_content."<br />
+						".CONTENT_ADMIN_CONVERSION_LAN_1." ".CONTENT_ADMIN_CONVERSION_LAN_4.": ".$totaloldrowscat_review."<br />
+						".CONTENT_ADMIN_CONVERSION_LAN_1." ".CONTENT_ADMIN_CONVERSION_LAN_6.": ".$totaloldrowsitem_review."<br />
+						".CONTENT_ADMIN_CONVERSION_LAN_2." ".CONTENT_ADMIN_CONVERSION_LAN_4.": ".$totaloldrowscat_article."<br />
+						".CONTENT_ADMIN_CONVERSION_LAN_2." ".CONTENT_ADMIN_CONVERSION_LAN_6.": ".$totaloldrowsitem_article."<br />";
+
+						$knownrows = $totaloldrowscat_article + $totaloldrowscat_review + $totaloldrowsitem_content + $totaloldrowsitem_review + $totaloldrowsitem_article;
+						if($totaloldcontentrows > $knownrows ){
+							$text .= CONTENT_ADMIN_CONVERSION_LAN_18.": ".($totaloldcontentrows - $knownrows)."<br />";
+						}else{
+							$text .= CONTENT_ADMIN_CONVERSION_LAN_19."<br />";
+						}
+
+					$text .= "
+					</div>
+				</td>
+			</tr>";		
+
+			$text .= $SPACER;
+
+			//unknown rows
+			if(count($unknown_array[0]) > 0){
+				$text .= "<tr><td class='fcaption' colspan='2'>".CONTENT_ADMIN_CONVERSION_LAN_51."</td></tr>";
+				$text .= "
+				<tr>
+					<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ICON_ERROR." ".count($unknown_array[0])." ".CONTENT_ADMIN_CONVERSION_LAN_51."</td>
+					<td class='forumheader3'>
+						<a style='cursor: pointer; cursor: hand' onclick=\"expandit('unknownrows');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+						<div id='unknownrows' style='display: none;'>
+							<table style='width:100%; border:0;'>";
+							for($i=0;$i<count($unknown_array[0]);$i++){
+								$text .= "<tr><td style='width:25%; white-space:nowrap;'>".CONTENT_ICON_ERROR." ".$unknown_array[0][$i]."</td><td>".$unknown_array[2][$i]." ".$rs -> form_hidden("unknownrows[]", $unknown_array[1][$i])."</td></tr>";
+							}
+							$text .= "
+							</table>
+						</div>
+					</td>
+				</tr>";
+			}
+
+			$text .= "
+
+			".$SPACER."
+			
+			".$ac -> results_conversion_mainparent($content_mainarray, $review_mainarray, $article_mainarray)."
+			
+			".$SPACER."			
+			
+			<tr><td class='fcaption' colspan='2'>content : ".CONTENT_ADMIN_CONVERSION_LAN_27."</td></tr>
+			".$ac -> results_conversion_row("content", $content_array, $totaloldrowsitem_content)."
+			
+			".$SPACER."			
+			
+			<tr><td class='fcaption' colspan='2'>review : ".CONTENT_ADMIN_CONVERSION_LAN_27."</td></tr>
+			".$ac -> results_conversion_category("review", $review_cat_array, $totaloldrowscat_review)."
+			".$ac -> results_conversion_row("review", $review_array, $totaloldrowsitem_review)."
+			
+			".$SPACER."			
+			
+			<tr><td class='fcaption' colspan='2'>article : ".CONTENT_ADMIN_CONVERSION_LAN_27."</td></tr>
+			".$ac -> results_conversion_category("article", $article_cat_array, $totaloldrowscat_article)."
+			".$ac -> results_conversion_row("article", $article_array, $totaloldrowsitem_article)."
+			
+			".$SPACER."
+			
+			</table>";
+
+			$main_convert = array($caption, $text);
+		}
+
+	}
+}
+
+$text = "";
+//update to 1.1 parent values to new style
+$upgrade_1_1 = FALSE;
+if($thiscount = $sql -> db_Select("pcontent", "*", "ORDER BY content_id ", "mode=no_where" )){
+	while($row = $sql -> db_Fetch()){
+		if( strpos($row['content_parent'], ".") && substr($row['content_parent'],0,1) != "0"){
+			//if item with old parent value exists, you need to upgrade to 1.1
+			$upgrade_1_1 = TRUE;
+		}
+	}
+}
+if($upgrade_1_1 === TRUE){
+	$text .= $ac -> upgrade_1_1();
+}
+
+//upgrade to 1.2 table structure (add score, meta, layout fields)
+$text .= $ac -> upgrade_1_2();
+
+//upgrade to 1.21 (update content_author fields)
+$text .= $ac -> upgrade_1_21();
+
+//render message
+if(isset($text)){
+	//only output detailed information if developer mode is set
+	if ($pref['developer']) {
+		$caption = CONTENT_ADMIN_CONVERSION_LAN_63;
+		$ns -> tablerender($caption, $text);
+	}
+}
+
+//render primary conversion results
+if(is_array($main_convert)){
+	if(isset($main_convert[1])){
+		//only output detailed information if developer mode is set
+		if ($pref['developer']) {
+			$ns -> tablerender($main_convert[0], $main_convert[1]);
+		}
+	}
+}
+
+//finally set the new content plugin version number
+set_content_version();
+
+
+
+
+//create default mainparent category for content, review and article
+function create_defaults()
+{
+	global $ns, $ac, $plugindir;
+
+	$plugindir		= e_PLUGIN."content/";
+	
+	if(!is_object($ac)){
+		require_once($plugindir."handlers/content_convert_class.php");
+		$ac = new content_convert;
+	}
+
+	$content_mainarray			= $ac -> create_mainparent("content", "1", "1");
+	$article_mainarray			= $ac -> create_mainparent("article", "1", "2");
+	$review_mainarray			= $ac -> create_mainparent("review", "1", "3");
+	
+	$main_convert = '';
+	//only output detailed information if developer mode is set
+	if ($pref['developer']) {
+		showlink();
+	
+		$text = "<table class='fborder' style='width:95%; padding:0px;'>";
+		$text .= $ac -> results_conversion_mainparent($content_mainarray, $review_mainarray, $article_mainarray);
+		$text .= "</table>";
+
+		$main_convert = array(CONTENT_ADMIN_CONVERSION_LAN_52, $text);
+	}
+	return $main_convert;
+}
+
+
+
+//show link to start managing the content management plugin
+function showlink()
+{
+	global $ns, $pref;
+	//only output detailed information if developer mode is set
+	if ($pref['developer']) {
+		$text = "<div style='text-align:center'>".CONTENT_ADMIN_CONVERSION_LAN_46."</div>";
+		$caption = CONTENT_ADMIN_CONVERSION_LAN_47;
+		$ns -> tablerender($caption, $text);
+	}
+}
+
+
+
+//update content plugin version number
+function set_content_version()
+{
+	global $sql, $pref;
+	$new_version = "1.21";
+	$sql->db_Update('plugin',"plugin_version = '{$new_version}' WHERE plugin_path='content'");
+	$text = '';
+	//only output detailed information if developer mode is set
+	if ($pref['developer']) {
+		$text = CONTENT_ADMIN_CONVERSION_LAN_62." $new_version <br />";
+	}
+	return $text;
+}	
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/e_comment.php 75/e107_plugins/content/e_comment.php
--- 6171/e107_plugins/content/e_comment.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/e_comment.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,12 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$e_plug_table = "pcontent"; //This is set to the table name you have decided to use.
+$reply_location= e_PLUGIN."content/content.php?content.$nid"; //This is set to the location you'd like the user to return to after replying to a comment.
+$db_table = "pcontent"; //This is the name of your plugins database table.
+$link_name = "content_heading"; //This is the name of the field in your plugin's db table that corresponds to it's name or title.
+$db_id = "content_id"; // This is the name of the field in your plugin's db table that correspond to it's unique id number.
+$plugin_name = "Content"; // A name for your plugin. It will be used in links to comments, in list_new/new.php.
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/e_emailprint.php 75/e107_plugins/content/e_emailprint.php
--- 6171/e107_plugins/content/e_emailprint.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/e_emailprint.php	2006-01-16 04:55:14.000000000 -0600
@@ -0,0 +1,174 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+function print_item($id)
+{
+		global $tp;
+		global $content_pref, $mainparent, $aa, $row, $content_image_path;
+		$con = new convert;
+
+		require_once(e_PLUGIN."content/handlers/content_class.php");
+		$aa = new content;
+
+		require_once(e_PLUGIN."content/content_shortcodes.php");
+
+		$lan_file = e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content.php";
+		include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."content/languages/English/lan_content.php");
+
+		if(!is_object($sql)){ $sql = new db; }
+		$sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_author, content_image, content_parent, content_datestamp, content_class", "content_id='".intval($id)."' ");
+		$row = $sql -> db_Fetch();
+
+		if(!check_class($row['content_class'])){
+			header("location:".e_PLUGIN."content/content.php"); exit;
+		}
+		$row['content_heading']		= $tp -> toHTML($row['content_heading']);
+		$row['content_subheading']	= $tp -> toHTML($row['content_subheading']);
+		$row['content_text']		= $tp -> replaceConstants($row['content_text']);
+		$row['content_text']		= preg_replace("/\{EMAILPRINT\}|\[newpage\]/", "", $tp -> toHTML($row['content_text'], TRUE));
+		$authordetails				= $aa -> getAuthor($row['content_author']);
+		$row['content_datestamp']	= $con -> convert_date($row['content_datestamp'], "long");
+
+		$mainparent					= $aa -> getMainParent($id);
+		$content_pref				= $aa -> getContentPref($mainparent);
+		$content_icon_path			= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+		$content_image_path			= $tp -> replaceConstants($content_pref["content_image_path_{$mainparent}"]);
+		$img						= $tp -> parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes);
+
+		$text = "
+		<b>".$row['content_heading']."</b>
+		<br />
+		".$row['content_subheading']."
+		<br />
+		".$authordetails[1].", ".$row['content_datestamp']."
+		<br /><br />
+		<div style='float:left; padding-right:10px;'>".$img."</div>
+		".$row['content_text']."
+		<br /><br /><hr />
+		".CONTENT_EMAILPRINT_LAN_1." ".SITENAME."
+		<br />
+		( ".SITEURLBASE.e_PLUGIN_ABS."content/content.php?content.".$row['content_id']." )        
+		";
+
+		require_once(e_HANDLER.'bbcode_handler.php');
+		$e_bb = new e_bbcode;
+		$text = $e_bb->parseBBCodes($text, '');
+
+		return $text;
+}
+
+function email_item($id)
+{
+	$plugintable = "pcontent";
+	if(!is_object($sql)){ $sql = new db; }
+	if($sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_author, content_parent, content_datestamp, content_class", "content_id='".intval($id)."' ")){
+		while($row = $sql -> db_Fetch()){
+			$tmp = explode(".",$row['content_parent']);
+			if(!check_class($row['content_class'])){
+				header("location:".e_PLUGIN."content/content.php"); exit;
+			}
+			$message = SITEURL.e_PLUGIN."content/content.php?content.".$id."\n\n".$row['content_heading']."\n".$row['content_subheading']."\n";
+		}
+		return $message;
+	}
+}
+
+
+function print_item_pdf($id){
+	global $tp, $content_shortcodes;
+	global $CONTENT_PRINT_IMAGES, $row, $content_image_path, $content_pref, $mainparent, $eArrayStorage;
+
+	//in this section you decide what to needs to be output to the pdf file
+	$con = new convert;
+	
+	require_once(e_PLUGIN."content/content_shortcodes.php");
+
+	require_once(e_PLUGIN."content/handlers/content_class.php");
+	$aa = new content;
+	
+	if(!is_object($sql)){ $sql = new db; }
+	$sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_text, content_image, content_author, content_parent, content_datestamp, content_class, content_pref", "content_id='".intval($id)."' ");
+	$row = $sql -> db_Fetch();
+
+	if(!check_class($row['content_class'])){
+		header("location:".e_PLUGIN."content/content.php"); exit;
+	}
+	$authordetails				= $aa -> getAuthor($row['content_author']);
+	$row['content_datestamp']	= $con -> convert_date($row['content_datestamp'], "long");
+	$img						= $tp -> parseTemplate('{CONTENT_PRINT_IMAGES}', FALSE, $content_shortcodes);
+
+	$mainparent					= $aa -> getMainParent(intval($id));
+	$content_pref				= $aa -> getContentPref($mainparent);
+	$content_icon_path			= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+	$content_image_path			= $tp -> replaceConstants($content_pref["content_image_path_{$mainparent}"]);
+	$img						= $tp -> parseTemplate('{CONTENT_PDF_IMAGES}', FALSE, $content_shortcodes);
+
+	//add custom and preset tags if present
+	$custom						= $eArrayStorage->ReadArray($row['content_pref']);
+	$months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
+
+	$CONTENT_CONTENT_TABLE_CUSTOM_TAGS = "";
+	if(!empty($custom)){
+		foreach($custom as $k => $v){
+			if($k == "content_custom_presettags"){
+				if(isset($content_pref["content_content_presettags_{$mainparent}"]) && $content_pref["content_content_presettags_{$mainparent}"]){
+					foreach($v as $ck => $cv){
+						if(is_array($cv)){	//date
+							if(!($cv['day']=="" && $cv['month']=="" && $cv['year']=="")){
+								$vv = $cv['day']." ".$months[($cv['month']-1)]." ".$cv['year'];
+							}
+						}else{
+							$vv = $cv;
+						}
+						if( isset($ck) && $ck != "" && isset($vv) && $vv!="" ){
+							$CUSTOM_TAGS = TRUE;
+							$CONTENT_CONTENT_TABLE_CUSTOM_KEY		= $tp->toHTML($ck, true);
+							$CONTENT_CONTENT_TABLE_CUSTOM_VALUE		= $tp->toHTML($vv, true);
+							$CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY." : ".$CONTENT_CONTENT_TABLE_CUSTOM_VALUE."<br />";
+						}
+					}
+				}
+			}else{
+				if(isset($content_pref["content_content_customtags_{$mainparent}"]) && $content_pref["content_content_customtags_{$mainparent}"]){
+					$key = substr($k,15);
+					if( isset($key) && $key != "" && isset($v) && $v!="" ){
+						$CUSTOM_TAGS = TRUE;
+						$CONTENT_CONTENT_TABLE_CUSTOM_KEY		= $tp->toHTML($key, true);
+						$CONTENT_CONTENT_TABLE_CUSTOM_VALUE		= $tp->toHTML($v, true);
+						$CONTENT_CONTENT_TABLE_CUSTOM_TAGS .= $CONTENT_CONTENT_TABLE_CUSTOM_KEY." : ".$CONTENT_CONTENT_TABLE_CUSTOM_VALUE."<br />";
+					}
+				}
+			}
+		}
+	}
+
+	$text = "
+	<b>".$row['content_heading']."</b><br />
+	".$row['content_subheading']."<br />
+	".$authordetails[1].", ".$row['content_datestamp']."<br />
+	<br />
+	".$row['content_text']."<br />
+	".($CONTENT_CONTENT_TABLE_CUSTOM_TAGS ? $CONTENT_CONTENT_TABLE_CUSTOM_TAGS : "")."
+	<div style='float:left; padding-left:10px;'>".$img."</div>
+	";
+
+	//the following defines are processed in the document properties of the pdf file
+
+	//Do NOT add parser function to the variables, leave them as raw data !
+	//as the pdf methods will handle this !
+	$text		= $text;						//define text
+	$creator	= SITENAME;						//define creator
+	$author		= $authordetails[1];			//define author
+	$title		= $row['content_heading'];		//define title
+	$subject	= $row['content_subheading'];	//define subject
+	$keywords	= "";							//define keywords
+
+	//define url to use in the header of the pdf file
+	$url		= SITEURLBASE.e_PLUGIN_ABS."content/content.php?content.".$row['content_id'];
+
+	//always return an array with the following data:
+	return array($text, $creator, $author, $title, $subject, $keywords, $url);
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/e_frontpage.php 75/e107_plugins/content/e_frontpage.php
--- 6171/e107_plugins/content/e_frontpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/e_frontpage.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,21 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content_frontpage.php');
+@include_once(e_PLUGIN.'content/languages/English/lan_content_frontpage.php');
+
+$sql2 = new db;
+if ($sql2 -> db_Select("pcontent", "content_id, content_heading", "LEFT(content_parent,1)='0'")) {
+	while ($row = $sql2 -> db_Fetch()) {
+		$front_page['content_'.$row['content_id']]['title'] = CONT_FP_1.': '.$row['content_heading'];
+		$front_page['content_'.$row['content_id']]['page'][] = array('page' => $PLUGINS_DIRECTORY.'content/content.php?recent.'.$row['content_id'], 'title' => $row['content_heading'].' '.CONT_FP_2);
+		if ($sql -> db_Select("pcontent", "content_id, content_heading", "content_parent = '".$row['content_id']."' ORDER BY content_heading")){
+			while ($row2 = $sql -> db_Fetch()) {
+				$front_page['content_'.$row['content_id']]['page'][] = array('page' => $PLUGINS_DIRECTORY.'content/content.php?content.'.$row2['content_id'], 'title' => $row2['content_heading']);
+			}
+		}
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/e_latest.php 75/e107_plugins/content/e_latest.php
--- 6171/e107_plugins/content/e_latest.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/e_latest.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,16 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+$plugintable = "pcontent";
+$reported_content = $sql -> db_Count($plugintable, '(*)', "WHERE content_refer='sa' ");
+$text .= "
+<div style='padding-bottom: 2px;'>
+<img src='".e_PLUGIN."content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' />
+";
+if($reported_content) {
+	$text .= " <a href='".e_PLUGIN."content/admin_content_config.php?submitted'>Submitted Content Items: $reported_content</a>";
+} else {
+	$text .= "Submitted Content Items: ".$reported_content;
+}
+$text .= "</div>";
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/e_list.php 75/e107_plugins/content/e_list.php
--- 6171/e107_plugins/content/e_list.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/e_list.php	2006-01-06 19:37:26.000000000 -0600
@@ -0,0 +1,104 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+	if(!$content_install = $sql -> db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){
+		return;
+	}
+
+	require_once(e_PLUGIN."content/handlers/content_class.php");
+	$aa = new content;
+
+	$datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") ";
+
+	global $contentmode;
+	//contentmode : content_144 (content_ + idvalue)
+	if($contentmode){
+		$headingquery = " AND content_id = '".substr($contentmode,8)."' ";
+	}else{
+		$headingquery = "";
+	}
+
+	//get main parent types
+	$sqlm = new db;
+	if(!$mainparents = $sqlm -> db_Select("pcontent", "*", "content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent = '0' ".$datequery." ".$headingquery." ORDER BY content_heading")){
+		$LIST_DATA = "no valid content category";
+	}else{		
+		while($rowm = $sqlm -> db_Fetch()){
+			$ICON = "";
+			$HEADING = "";
+			$AUTHOR = "";
+			$CATEGORY = "";
+			$DATE = "";
+			$INFO = "";
+			$LIST_CAPTION	= $rowm['content_heading'];
+
+			//global var for this main parent
+			$mainparent = $rowm['content_id'];
+
+			//get path variables
+			$content_recent_pref = $aa -> getContentPref($mainparent);
+			$content_recent_pref["content_icon_path_{$mainparent}"] = ($content_recent_pref["content_icon_path_{$mainparent}"] ? $content_recent_pref["content_icon_path_{$mainparent}"] : "{e_PLUGIN}content/images/icon/" );
+			$content_icon_path = $tp -> replaceConstants($content_recent_pref["content_icon_path_{$mainparent}"]);
+
+			//prepare query string
+			$array = $aa -> getCategoryTree("", $mainparent, TRUE);
+			$validparent = implode(",", array_keys($array));
+			$qry = " content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND content_class REGEXP '".e_CLASS_REGEXP."' ";
+
+			//check so only the preferences from the correct content_type (article, content, review etc) are used and rendered
+			if(substr($contentmode,8) == $rowm['content_id']){
+
+				if($mode == "new_page" || $mode == "new_menu" ){
+					$lvisit = $this -> getlvisit();
+					$qry = $qry." AND content_datestamp>".$lvisit;
+				}else{
+					$qry = $qry." ".$datequery;
+				}
+				$qry .= " ORDER BY content_datestamp DESC LIMIT 0,".intval($arr[7]);
+
+				//get recent content for each main parent
+				$sqli = new db;
+				if(!$resultitem = $sqli -> db_Select("pcontent", "*", $qry)){
+					$LIST_DATA = "no items in ".$rowm['content_heading'];
+				}else{
+					$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+
+					while($rowi = $sqli -> db_Fetch()){
+						$rowheading = $this -> parse_heading($rowi['content_heading'], $mode);
+						$HEADING = "<a href='".e_PLUGIN."content/content.php?content.".$rowi['content_id']."' title='".$rowi['content_heading']."'>".$rowheading."</a>";
+						//category
+						if($arr[4]){
+							$crumb = "";
+							if(array_key_exists($rowi['content_parent'], $array)){
+								$newarr = $array[$rowi['content_parent']];
+								$newarr = array_reverse($newarr);
+								$CATEGORY = "<a href='".e_PLUGIN."content/content.php?cat.".$newarr[1]."'>".$newarr[0]."</a>";
+							}
+						}
+
+						$DATE = ($arr[5] ? $this -> getListDate($rowi['content_datestamp'], $mode) : "");
+						$ICON = $this -> getBullet($arr[6], $mode);
+
+						//get author details
+						if($arr[3]){
+							$authordetails = $aa -> getAuthor($rowi['content_author']);
+							if(USER && is_numeric($authordetails[0]) && $authordetails[0] != "0"){
+								$AUTHOR = "<a href='".e_BASE."user.php?id.".$authordetails[0]."' >".$authordetails[1]."</a>";
+							}else{
+								$AUTHOR = $authordetails[1];
+							}
+						}else{
+							$AUTHOR = "";
+						}
+						$INFO = "";
+
+						$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+					}
+				}
+			}
+		}
+	}
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/e_search.php 75/e107_plugins/content/e_search.php
--- 6171/e107_plugins/content/e_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/e_search.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,11 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+if (file_exists(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content_search.php")) {
+	include_once(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content_search.php");
+} else {
+	include_once(e_PLUGIN."content/languages/English/lan_content_search.php");
+}
+$search_info[] = array( 'sfile' => e_PLUGIN.'content/search/search_parser.php', 'qtype' => CONT_SCH_LAN_1, 'refpage' => 'content.php', 'advanced' => e_PLUGIN.'content/search/search_advanced.php');
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/e_status.php 75/e107_plugins/content/e_status.php
--- 6171/e107_plugins/content/e_status.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/e_status.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,18 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+$sql2 = new db;
+$total = $sql -> db_Count("pcontent", "(*)", "WHERE LEFT(content_parent,1) != '0' AND content_refer != 'sa'");
+if($total == 0){
+$text .= "<div style='padding-bottom: 2px;'><img src='".e_PLUGIN."content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> Content: ".$total."</div>";
+}else{
+$text .= "<div style='padding-bottom: 2px;'><a style='cursor: pointer; cursor: hand' onclick=\"expandit('content');\"><img src='".e_PLUGIN."content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> Content: ".$total."</a></div>";
+}
+$maincat = $sql -> db_Select("pcontent", "content_id, content_heading", "LEFT(content_parent,1) = '0' ORDER BY content_heading");
+$text .= "<div id='content' style='display: none;'>";
+while($row = $sql -> db_Fetch()){
+	$count = $sql2 -> db_Count("pcontent", "(*)", "WHERE content_parent = '".$row['content_id']."' AND content_refer != 'sa' ");
+	$text .= "<div style='padding-bottom: 2px;'><img src='".e_PLUGIN."content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ".$row['content_heading'].": ".$count."</div>";
+}
+$text .= "</div>";
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/handlers/content_class.php 75/e107_plugins/content/handlers/content_class.php
--- 6171/e107_plugins/content/handlers/content_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/handlers/content_class.php	2006-01-23 08:17:04.000000000 -0600
@@ -0,0 +1,1376 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        /admin/review.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/handlers/content_class.php,v $
+|		$Revision: 1.88 $
+|		$Date: 2006/01/23 14:17:04 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $plugindir, $plugintable, $datequery;
+$plugindir		= e_PLUGIN."content/";
+$plugintable	= "pcontent";		//name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)
+$datequery		= " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") ";
+
+require_once($plugindir."handlers/content_defines.php");
+
+if(!is_object($sql)){ $sql = new db; }
+
+class content{
+
+		function ContentDefaultPrefs($id){
+			global $tp;
+
+			if(!$id){ $id="0"; }
+
+			//ADMIN CREATE FORM
+			$content_pref["content_admin_icon_{$id}"] = "0";						//should icon be available to add when creating an item
+			$content_pref["content_admin_attach_{$id}"] = "0";						//should file be available to add when creating an item
+			$content_pref["content_admin_images_{$id}"] = "0";						//should image be available to add when creating an item
+			$content_pref["content_admin_comment_{$id}"] = "1";						//should comment be available to add when creating an item
+			$content_pref["content_admin_rating_{$id}"] = "1";						//should rating be available to add when creating an item
+			$content_pref["content_admin_score_{$id}"] = "1";						//should score be available to add when creating an item
+			$content_pref["content_admin_pe_{$id}"] = "1";							//should printemailicons be available to add when creating an item
+			$content_pref["content_admin_visibility_{$id}"] = "1";					//should visibility be available to add when creating an item
+			$content_pref["content_admin_meta_{$id}"] = "0";						//should metatags be available to add when creating an item
+			$content_pref["content_admin_custom_number_{$id}"] = "0";				//how many customtags should be available to add when creating an item
+			$content_pref["content_admin_images_number_{$id}"] = "0";				//how many images should be available to add when creating an item
+			$content_pref["content_admin_files_number_{$id}"] = "0";				//how many files should be available to add when creating an item
+			$content_pref["content_admin_layout_{$id}"] = "0";						//should the option for choosing a layout template be shown
+			$content_pref["content_admin_customtags_{$id}"] = "0";					//should options for adding additional data be shown
+			$content_pref["content_admin_presettags_{$id}"] = "0";					//should preset data tags be shown
+
+			//SUBMIT FORM
+			$content_pref["content_submit_{$id}"] = "0";							//should users be able to submit an item
+			$content_pref["content_submit_class_{$id}"] = "0";						//define which userclass is able to submit an item
+			$content_pref["content_submit_directpost_{$id}"] ="0";					//should submission be direclty posted as an item, or have them validated by admins
+			$content_pref["content_submit_icon_{$id}"] = "0";						//should icon be available to add when submitting an item
+			$content_pref["content_submit_attach_{$id}"] = "0";						//should file be available to add when submitting an item
+			$content_pref["content_submit_images_{$id}"] = "0";						//should image be available to add when submitting an item
+			$content_pref["content_submit_comment_{$id}"] = "0";					//should comment be available to add when submitting an item
+			$content_pref["content_submit_rating_{$id}"] = "0";						//should rating be available to add when submitting an item
+			$content_pref["content_submit_score_{$id}"] = "0";						//should score be available to add when submitting an item
+			$content_pref["content_submit_pe_{$id}"] = "0";							//should printemailicons be available to add when submitting an item
+			$content_pref["content_submit_visibility_{$id}"] = "0";					//should visibility be available to add when submitting an item
+			$content_pref["content_submit_meta_{$id}"] = "0";						//should metatags be available to add when submitting an item
+			$content_pref["content_submit_custom_number_{$id}"] = "0";				//how many customtags should be available to add when submitting an item
+			$content_pref["content_submit_images_number_{$id}"] = "0";				//how many images should be available to add when submitting an item
+			$content_pref["content_submit_files_number_{$id}"] = "0";				//how many files should be available to add when submitting an item
+			$content_pref["content_submit_layout_{$id}"] = "0";						//should the option for choosing a layout template be shown
+			$content_pref["content_submit_customtags_{$id}"] = "0";					//should options for adding additional data be shown
+			$content_pref["content_submit_presettags_{$id}"] = "0";					//should preset data tags be shown
+
+			//PATH THEME CSS
+			$content_pref["content_cat_icon_path_large_{$id}"] = "{e_PLUGIN}content/images/cat/48/";	//default path to large categry icons
+			$content_pref["content_cat_icon_path_small_{$id}"] = "{e_PLUGIN}content/images/cat/16/";	//default path to small category icons
+
+			$content_pref["content_icon_path_{$id}"] = "{e_PLUGIN}content/images/icon/";				//default path to item icons
+			$content_pref["content_icon_path_tmp_{$id}"] = "{e_PLUGIN}content/images/icon/tmp/";		//default tmp path to item icons
+			
+			$content_pref["content_image_path_{$id}"] = "{e_PLUGIN}content/images/image/";				//default path to item images
+			$content_pref["content_image_path_tmp_{$id}"] = "{e_PLUGIN}content/images/image/tmp/";		//default tmp path to item images
+			
+			$content_pref["content_file_path_{$id}"] = "{e_PLUGIN}content/images/file/";				//default path to item file attachments
+			$content_pref["content_file_path_tmp_{$id}"] = "{e_PLUGIN}content/images/file/tmp/";		//default tmp path to item file attachments
+			
+			$content_pref["content_theme_{$id}"] = "default";											//choose theme for main parent
+			$content_pref["content_layout_{$id}"] = "content_content_template.php";						//choose default layout scheme
+
+			//GENERAL
+			$content_pref["content_log_{$id}"] = "0";								//activate log
+			$content_pref["content_blank_icon_{$id}"] = "0";						//use blank icon if no icon present
+			$content_pref["content_blank_caticon_{$id}"] = "0";						//use blank caticon if no caticon present
+			$content_pref["content_breadcrumb_catall_{$id}"] = "0";					//show breadcrumb on all categories page
+			$content_pref["content_breadcrumb_cat_{$id}"] = "0";					//show breadcrumb on single category page
+			$content_pref["content_breadcrumb_authorall_{$id}"] = "0";				//show breadcrumb on all author page
+			$content_pref["content_breadcrumb_author_{$id}"] = "0";					//show breadcrumb on single author page
+			$content_pref["content_breadcrumb_recent_{$id}"] = "0";					//show breadcrumb on recent page
+			$content_pref["content_breadcrumb_item_{$id}"] = "0";					//show breadcrumb on content item page
+			$content_pref["content_breadcrumb_top_{$id}"] = "0";					//show breadcrumb on top rated page
+			$content_pref["content_breadcrumb_archive_{$id}"] = "0";				//show breadcrumb on archive page
+			$content_pref["content_breadcrumb_seperator{$id}"] = ">";				//seperator character between breadcrumb
+			$content_pref["content_breadcrumb_rendertype_{$id}"] = "2";				//how to render the breadcrumb
+			$content_pref["content_navigator_catall_{$id}"] = "0";					//show navigator on all categories page
+			$content_pref["content_navigator_cat_{$id}"] = "0";						//show navigator on single category page
+			$content_pref["content_navigator_authorall_{$id}"] = "0";				//show navigator on all author page
+			$content_pref["content_navigator_author_{$id}"] = "0";					//show navigator on single author page
+			$content_pref["content_navigator_recent_{$id}"] = "0";					//show navigator on recent page
+			$content_pref["content_navigator_item_{$id}"] = "0";					//show navigator on content item page
+			$content_pref["content_navigator_top_{$id}"] = "0";						//show navigator on top rated page
+			$content_pref["content_navigator_archive_{$id}"] = "0";					//show navigator on archive page
+			$content_pref["content_search_catall_{$id}"] = "0";						//show search keyword on all categories page
+			$content_pref["content_search_cat_{$id}"] = "0";						//show search keyword on single category page
+			$content_pref["content_search_authorall_{$id}"] = "0";					//show search keyword on all author page
+			$content_pref["content_search_author_{$id}"] = "0";						//show search keyword on single author page
+			$content_pref["content_search_recent_{$id}"] = "0";						//show search keyword on recent page
+			$content_pref["content_search_item_{$id}"] = "0";						//show search keyword on content item page
+			$content_pref["content_search_top_{$id}"] = "0";						//show search keyword on top rated page
+			$content_pref["content_search_archive_{$id}"] = "0";					//show search keyword on archive page
+			$content_pref["content_ordering_catall_{$id}"] = "0";					//show ordering on all categories page
+			$content_pref["content_ordering_cat_{$id}"] = "0";						//show ordering on single category page
+			$content_pref["content_ordering_authorall_{$id}"] = "0";				//show ordering on all author page
+			$content_pref["content_ordering_author_{$id}"] = "0";					//show ordering on single author page
+			$content_pref["content_ordering_recent_{$id}"] = "0";					//show ordering on recent page
+			$content_pref["content_ordering_item_{$id}"] = "0";						//show ordering on content item page
+			$content_pref["content_ordering_top_{$id}"] = "0";						//show ordering on top rated page
+			$content_pref["content_ordering_archive_{$id}"] = "0";					//show ordering on archive page
+			$content_pref["content_searchmenu_rendertype_{$id}"] = "1";				//rendertype for searchmenu (1=echo, 2=in seperate menu)
+			$content_pref["content_nextprev_{$id}"] = "1";							//use nextprev buttons
+			$content_pref["content_nextprev_number_{$id}"] = "10";					//how many items on a page
+			$content_pref["content_defaultorder_{$id}"] = "orderddate";				//default sort and order method
+			//upload icon/image size handling
+			$content_pref["content_upload_image_size_{$id}"] = "500";				//resize size of uploaded image
+			$content_pref["content_upload_image_size_thumb_{$id}"] = "100";			//resize size of created thumb on uploaded image
+			$content_pref["content_upload_icon_size_{$id}"] = "100";				//resize size of uploaded icon
+
+			//CONTENT ITEM PREVIEW
+			$content_pref["content_list_icon_{$id}"] = "0";							//show icon
+			$content_pref["content_list_subheading_{$id}"] = "1";					//show subheading
+			$content_pref["content_list_summary_{$id}"] = "1";						//show summary
+			$content_pref["content_list_text_{$id}"] = "0";							//show (part of) text
+			$content_pref["content_list_date_{$id}"] = "0";							//show date
+			$content_pref["content_list_authorname_{$id}"] = "0";					//show authorname
+			$content_pref["content_list_authorprofile_{$id}"] = "0";				//show link to author profile
+			$content_pref["content_list_authoremail_{$id}"] = "0";					//show authoremail
+			$content_pref["content_list_authoricon_{$id}"] = "0";					//show link to author list
+			$content_pref["content_list_rating_{$id}"] = "1";						//show rating system
+			$content_pref["content_list_peicon_{$id}"] = "1";						//show printemailicons
+			$content_pref["content_list_parent_{$id}"] = "0";						//show parent cat
+			$content_pref["content_list_refer_{$id}"] = "0";						//show refer count
+			$content_pref["content_list_subheading_char_{$id}"] = "100";			//how many subheading characters
+			$content_pref["content_list_subheading_post_{$id}"] = "[...]";			//use a postfix for too long subheadings
+			$content_pref["content_list_summary_char_{$id}"] = "100";				//how many summary characters
+			$content_pref["content_list_summary_post_{$id}"] = "[...]";				//use a postfix for too long summary
+			$content_pref["content_list_text_char_{$id}"] = "60";					//how many text words
+			$content_pref["content_list_text_post_{$id}"] = "[read more]";			//use a postfix for too long text
+			$content_pref["content_list_text_link_{$id}"] = "1";					//show link to content item on postfix
+			$content_pref["content_list_authoremail_nonmember_{$id}"] = "0";		//show email non member author
+			$content_pref["content_list_peicon_all_{$id}"] = "0";					//override printemail icons
+			$content_pref["content_list_rating_all_{$id}"] = "0";					//override rating system
+			$content_pref["content_list_editicon_{$id}"] = "0";						//show link to admin edit item
+			$content_pref["content_list_datestyle_{$id}"] = "%d %b %Y";				//choose datestyle for given date
+
+			//CATEGORY PAGES
+			//sections of content category in 'view all categories page'
+			$content_pref["content_catall_icon_{$id}"] = "1";						//show icon
+			$content_pref["content_catall_subheading_{$id}"] = "1";					//show subheading
+			$content_pref["content_catall_text_{$id}"] = "0";						//show text
+			$content_pref["content_catall_date_{$id}"] = "0";						//show date
+			$content_pref["content_catall_rating_{$id}"] = "1";						//show rating
+			$content_pref["content_catall_authorname_{$id}"] = "0";					//show author name
+			$content_pref["content_catall_authoremail_{$id}"] = "0";				//show author email
+			$content_pref["content_catall_authorprofile_{$id}"] = "0";				//show link to author profile
+			$content_pref["content_catall_authoricon_{$id}"] = "0";					//show link to author list
+			$content_pref["content_catall_peicon_{$id}"] = "1";						//show pe icons
+			$content_pref["content_catall_comment_{$id}"] = "1";					//show amount of comments
+			$content_pref["content_catall_amount_{$id}"] = "0";						//show amount of items
+			$content_pref["content_catall_text_char_{$id}"] = "65";					//define amount of words of text to display
+			$content_pref["content_catall_text_post_{$id}"] = "[read more]";		//define postfix is text is too long
+			$content_pref["content_catall_text_link_{$id}"] = "1";					//define if link to category should be added on postfix
+			//sections of content category in 'view category' page
+			$content_pref["content_cat_icon_{$id}"] = "1";							//show icon
+			$content_pref["content_cat_subheading_{$id}"] = "1";					//show subheading
+			$content_pref["content_cat_text_{$id}"] = "0";							//show text
+			$content_pref["content_cat_date_{$id}"] = "0";							//show date
+			$content_pref["content_cat_authorname_{$id}"] = "0";					//show author name
+			$content_pref["content_cat_authoremail_{$id}"] = "0";					//show author email
+			$content_pref["content_cat_authorprofile_{$id}"] = "0";					//show link to author profile
+			$content_pref["content_cat_authoricon_{$id}"] = "0";					//show link to author list
+			$content_pref["content_cat_rating_{$id}"] = "1";						//show rating
+			$content_pref["content_cat_peicon_{$id}"] = "1";						//show pe icons
+			$content_pref["content_cat_comment_{$id}"] = "1";						//show amount of comments
+			$content_pref["content_cat_amount_{$id}"] = "1";						//show amount of items
+
+			//sections of subcategories in 'view category page'
+			$content_pref["content_catsub_icon_{$id}"] = "1";						//show icon
+			$content_pref["content_catsub_subheading_{$id}"] = "1";					//show subheading
+			$content_pref["content_catsub_amount_{$id}"] = "1";						//show amount of items
+			$content_pref["content_cat_showparent_{$id}"] = "1";					//show parent item in category page
+			$content_pref["content_cat_showparentsub_{$id}"] = "1";					//show subcategories in category page
+			$content_pref["content_cat_listtype_{$id}"] = "0";						//also show items from subategories
+			$content_pref["content_cat_menuorder_{$id}"] = "1";						//order of parent and child items
+			$content_pref["content_cat_rendertype_{$id}"] = "2";					//render method of the menus
+			$content_pref["content_cat_text_char_{$id}"] = "65";					//define amount of words of text to display
+			$content_pref["content_cat_text_post_{$id}"] = "[read more]";			//define postfix is text is too long
+			$content_pref["content_cat_text_link_{$id}"] = "1";						//define if link to category should be added on postfix
+			$content_pref["content_cat_authoremail_nonmember_{$id}"] = "0";			//define if the email of a non-member will be displayed
+			$content_pref["content_cat_peicon_all_{$id}"] = "0";					//override printemail icons
+			$content_pref["content_cat_rating_all_{$id}"] = "0";					//override rating system
+
+			//CONTENT PAGE
+			$content_pref["content_content_icon_{$id}"] = "0";						//show icon
+			$content_pref["content_content_subheading_{$id}"] = "1";				//show subheading
+			$content_pref["content_content_summary_{$id}"] = "1";					//show summary
+			$content_pref["content_content_date_{$id}"] = "0";						//show date
+			$content_pref["content_content_authorname_{$id}"] = "1";				//show authorname
+			$content_pref["content_content_authorprofile_{$id}"] = "0";				//show link to author profile
+			$content_pref["content_content_authoremail_{$id}"] = "0";				//show suthoremail
+			$content_pref["content_content_authoricon_{$id}"] = "0";				//show link to author list
+			$content_pref["content_content_parent_{$id}"] = "0";					//show parent category
+			$content_pref["content_content_rating_{$id}"] = "1";					//show rating system
+			$content_pref["content_content_peicon_{$id}"] = "1";					//show printemailicons
+			$content_pref["content_content_refer_{$id}"] = "0";						//show refer count
+			$content_pref["content_content_comment_{$id}"] = "0";					//show amount of comments
+			$content_pref["content_content_authoremail_nonmember_{$id}"] = "0";		//show email non member
+			$content_pref["content_content_peicon_all_{$id}"] = "0";				//override printemail icons
+			$content_pref["content_content_rating_all_{$id}"] = "0";				//override rating system
+			$content_pref["content_content_comment_all_{$id}"] = "0";				//override comment system				
+			$content_pref["content_content_editicon_{$id}"] = "0";					//show link in content page to admin edit item
+			$content_pref["content_content_customtags_{$id}"] = "0";				//should additional data be shown
+			$content_pref["content_content_presettags_{$id}"] = "0";				//should preset data tags be shown
+			$content_pref["content_content_attach_{$id}"] = "0";					//show attachments
+			$content_pref["content_content_images_{$id}"] = "0";					//show images
+			$content_pref["content_content_pagenames_rendertype_{$id}"] = "0";		//rendertype for articleindex on multipage content items
+
+			//AUTHOR PAGE
+			$content_pref["content_author_lastitem_{$id}"] = "0";					//show last item reference
+			$content_pref["content_author_amount_{$id}"] = "1";						//show amount of items from this author
+			$content_pref["content_author_nextprev_{$id}"] = "1";					//use next prev buttons
+			$content_pref["content_author_nextprev_number_{$id}"] = "20";			//amount of items per page
+
+			//ARCHIVE PAGE
+			$content_pref["content_archive_nextprev_{$id}"] = "1";					//archive : choose to show next/prev links
+			$content_pref["content_archive_nextprev_number_{$id}"] = "30";			//archive : choose amount to use in next/prev
+			$content_pref["content_archive_letterindex_{$id}"] = "0";				//archive : letter index
+			$content_pref["content_archive_datestyle_{$id}"] = "%d %b %Y";			//archive : choose datestyle for given date
+			$content_pref["content_archive_date_{$id}"] = "1";						//archive : section: show date
+			$content_pref["content_archive_authorname_{$id}"] = "0";				//archive : section: show authorname
+			$content_pref["content_archive_authorprofile_{$id}"] = "0";				//archive : section: show link to author profile
+			$content_pref["content_archive_authoricon_{$id}"] = "0";				//archive : section: show link to author list
+			$content_pref["content_archive_authoremail_{$id}"] = "0";				//archive : section: show author email
+			$content_pref["content_archive_authoremail_nonmember_{$id}"] = "0";		//archive : show link to email of non-member author
+
+			//TOP RATED PAGE
+			$content_pref["content_top_icon_{$id}"] = "0";							//top : section: show icon
+			$content_pref["content_top_authorname_{$id}"] = "0";					//top : section: show authorname
+			$content_pref["content_top_authorprofile_{$id}"] = "0";					//top : section: show link to author profile
+			$content_pref["content_top_authoricon_{$id}"] = "0";					//top : section: show link to author list
+			$content_pref["content_top_authoremail_{$id}"] = "0";					//top : section: show author email
+			$content_pref["content_top_authoremail_nonmember_{$id}"] = "0";			//top : show link to email of non-member author
+
+			//TOP SCORE PAGE
+			$content_pref["content_score_icon_{$id}"] = "0";						//score : section: show icon
+			$content_pref["content_score_authorname_{$id}"] = "0";					//score : section: show authorname
+			$content_pref["content_score_authorprofile_{$id}"] = "0";				//score : section: show link to author profile
+			$content_pref["content_score_authoricon_{$id}"] = "0";					//score : section: show link to author list
+			$content_pref["content_score_authoremail_{$id}"] = "0";					//score : section: show author email
+			$content_pref["content_score_authoremail_nonmember_{$id}"] = "0";		//score : show link to email of non-member author
+
+			//CONTENT MANAGER
+			$content_pref["content_manager_class_{$id}"] = "0";						//contentmanager: class to narrow down the userlist
+
+			//MENU OPTIONS
+			$content_pref["content_menu_caption_{$id}"] = CONTENT_MENU_LAN_0;		//caption of menu
+			$content_pref["content_menu_search_{$id}"] = "0";						//show search keyword
+			$content_pref["content_menu_sort_{$id}"] = "0";							//show sorting methods
+			$content_pref["content_menu_links_{$id}"] = "1";						//show content links
+			$content_pref["content_menu_links_dropdown_{$id}"] = "0";				//rendertype of content links (in dropdown or as normal links)
+			$content_pref["content_menu_links_icon_{$id}"] = "0";					//define icon for content links (only with normallinks)
+			$content_pref["content_menu_links_caption_{$id}"] = CONTENT_MENU_LAN_4;	//define caption for link list (only is normallinks is selected)
+			$content_pref["content_menu_viewallcat_{$id}"] = "1";					//menu: view link to all categories
+			$content_pref["content_menu_viewallauthor_{$id}"] = "1";				//menu: view link to all authors
+			$content_pref["content_menu_viewallitems_{$id}"] = "1";					//menu: view link to all items (archive)
+			$content_pref["content_menu_viewtoprated_{$id}"] = "0";					//menu: view link to top rated items
+			$content_pref["content_menu_viewtopscore_{$id}"] = "0";					//menu: view link to top score items
+			$content_pref["content_menu_viewrecent_{$id}"] = "1";					//menu: view link to recent items
+			$content_pref["content_menu_viewsubmit_{$id}"] = "0";					//view link to submit content item (only if it is allowed)
+			$content_pref["content_menu_viewicon_{$id}"] = "0";						//choose icon to display for links
+			$content_pref["content_menu_cat_{$id}"] = "1";							//view categories
+			$content_pref["content_menu_cat_main_{$id}"] = "1";						//show main parent in the category list				
+			$content_pref["content_menu_cat_number_{$id}"] = "1";					//show number of items in category				
+			$content_pref["content_menu_cat_icon_{$id}"] = "0";						//choose icon to display for categories
+			$content_pref["content_menu_cat_icon_default_{$id}"] = "0";				//choose default icon is no icon present (only if category_icon is selected)
+			$content_pref["content_menu_cat_caption_{$id}"] = CONTENT_MENU_LAN_3;	//define caption for category list
+			$content_pref["content_menu_cat_dropdown_{$id}"] = "0";					//rendertype of categories (in dropdown or as normal links)
+			$content_pref["content_menu_recent_{$id}"] = "1";						//view recent list
+			$content_pref["content_menu_recent_caption_{$id}"] = CONTENT_MENU_LAN_2;	//caption of recent list
+			$content_pref["content_menu_recent_number_{$id}"] = "5";				//number of recent items to show
+			$content_pref["content_menu_recent_date_{$id}"] = "0";					//show date in recent list
+			$content_pref["content_menu_recent_datestyle_{$id}"] = "%d %b %Y";		//choose datestyle for given date
+			$content_pref["content_menu_recent_author_{$id}"] = "0";				//show author in recent list
+			$content_pref["content_menu_recent_subheading_{$id}"] = "0";			//show subheading in recent list
+			$content_pref["content_menu_recent_subheading_char_{$id}"] = "80";		//number of characters of subheading to show
+			$content_pref["content_menu_recent_subheading_post_{$id}"] = "[...]";	//postfix for too long subheadings
+			$content_pref["content_menu_recent_icon_{$id}"] = "0";					//choose icon to display for recent items
+			$content_pref["content_menu_recent_icon_width_{$id}"] = "50";			//specify width of icon (only if content_icon is set)
+
+			return $content_pref;
+		}
+
+
+
+		function getContentPref($id="") {
+			global $sql, $plugintable, $tp, $eArrayStorage;
+
+			$plugintable = "pcontent";
+
+			if($id && $id!="0"){	//if $id; use prefs from content table
+				$id = intval($id);
+				$num_rows = $sql -> db_Select($plugintable, "content_pref", "content_id='$id' ");
+				$row = $sql -> db_Fetch();
+				if (empty($row['content_pref'])) {
+					
+					//if no prefs present yet, get them from core (default preferences)
+					$num_rows = $sql -> db_Select("core", "*", "e107_name='$plugintable' ");
+					//if those are not present, insert the default ones given in this file
+					if ($num_rows == 0) {
+						$content_pref = $this -> ContentDefaultPrefs("0");
+						$tmp = $eArrayStorage->WriteArray($content_pref);
+						$sql -> db_Insert("core", "'$plugintable', '{$tmp}' ");
+						$sql -> db_Select("core", "*", "e107_name='$plugintable' ");
+					}
+					$row = $sql -> db_Fetch();
+					$tmp = $eArrayStorage->ReadArray($row['e107_value']);
+					
+					//create array of custom preset tags
+					foreach($tmp['content_custom_preset_key'] as $ck => $cv){
+						if(!empty($cv)){
+							$string[] = $cv;
+						}
+					}
+					if($string){
+						$content_pref['content_custom_preset_key'] = $string;
+					}
+					//replace the id value for the content_pref
+					foreach($tmp as $k=>$v){
+						if(substr($k,-2) == "_0"){
+							$k = str_replace("_0", "_{$id}", $k);
+						}
+						if(strpos($k, "content_") === 0){
+							$content_pref[$k] = $tp->toDB($v);
+						}
+					}
+					//finally we can store the new default prefs into the db
+					$tmp1 = $eArrayStorage->WriteArray($content_pref);
+					$sql -> db_Update($plugintable, "content_pref='{$tmp1}' WHERE content_id='$id' ");
+					$sql -> db_Select($plugintable, "content_pref", "content_id='$id' ");
+					$row = $sql -> db_Fetch();
+				}
+				$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
+
+			}else{					//if not $id; use prefs from default core table
+				$num_rows = $sql -> db_Select("core", "*", "e107_name='$plugintable' ");
+				if ($num_rows == 0) {
+					$content_pref = $this -> ContentDefaultPrefs("0");
+					$tmp = $eArrayStorage->WriteArray($content_pref);
+					$sql -> db_Insert("core", "'$plugintable', '{$tmp}' ");
+					$sql -> db_Select("core", "*", "e107_name='$plugintable' ");
+				}
+				$row = $sql -> db_Fetch();
+				$content_pref = $eArrayStorage->ReadArray($row['e107_value']);
+			}
+			return $content_pref;
+		}
+
+		//admin
+		function UpdateContentPref($id){
+			global $plugintable, $sql, $tp, $eArrayStorage;
+
+			if(!is_object($sql)){ $sql = new db; }
+
+			//insert default preferences into core
+			if($id == "0"){
+				$num_rows = $sql -> db_Select("core", "*", "e107_name='$plugintable' ");
+				if ($num_rows == 0) {
+					$sql -> db_Insert("core", "'$plugintable', '' ");
+				}else{
+					$row = $sql -> db_Fetch();
+				}
+
+			//insert category preferences into plugintable
+			}else{
+				$sql -> db_Select($plugintable, "content_pref", "content_id='".intval($id)."' ");
+				$row = $sql -> db_Fetch();
+			}
+
+			//create array of custom preset tags
+			foreach($_POST['content_custom_preset_key'] as $ck => $cv){
+				if(!empty($cv)){
+					$string[] = $cv;
+				}
+			}
+			$_POST['content_custom_preset_key'] = $string;
+
+			foreach($_POST as $k => $v){
+				if(strpos($k, "content_") === 0){
+					$content_pref[$k] = $tp->toDB($v);
+				}
+			}
+
+			//create new array of preferences
+			$tmp = $eArrayStorage->WriteArray($content_pref);
+			if($id == "0"){
+				$sql -> db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = '$plugintable' ");
+			}else{
+				$sql -> db_Update($plugintable, "content_pref='{$tmp}' WHERE content_id='".intval($id)."' ");
+			}
+			return $content_pref;
+		}
+
+		function CONTENTREGEXP($var){
+			return "(^|,)(".str_replace(",", "|", $var).")(,|$)";
+		}
+
+		function getCategoryTree($id, $parent, $classcheck=TRUE){
+			//id	:	content_parent of an item
+			global $plugintable, $datequery;
+			global $agc;
+
+			if($parent){
+				$agc = "";
+				$qrygc = " content_id = '".intval($parent)."' ";
+			}else{
+				$qrygc = " content_parent = '0' ";
+			}
+			if($id){
+				$qrygc = " content_parent = '0.".intval($id)."' ";
+			}
+
+			if($classcheck == TRUE){
+				$qrygc .= " AND content_class REGEXP '".e_CLASS_REGEXP."' ";
+			}
+
+			$sqlgetcat = new db;
+			if($sqlgetcat -> db_Select($plugintable, "content_id, content_heading, content_parent", " ".$qrygc." ".$datequery." " )){
+				while($row = $sqlgetcat -> db_Fetch()){
+
+					if($agc){
+						if($row['content_parent'] != "0"){
+							if(array_key_exists(substr($row['content_parent'],2), $agc)){
+								if(is_array($agc[substr($row['content_parent'],2)])){
+									$agc[$row['content_id']] = array_merge_recursive($agc[substr($row['content_parent'],2)], array($row['content_id'], $row['content_heading']));
+								}else{
+									$agc[$row['content_id']] = array($agc[substr($row['content_parent'],2)], array($row['content_id'], $row['content_heading']));
+								}
+
+							}else{
+								$agc[$row['content_id']] = array($row['content_id'], $row['content_heading']);
+							}
+						}else{
+							$agc[$row['content_id']] = array($row['content_id'], $row['content_heading']);
+						}
+					}else{
+						$agc[$row['content_id']] = array($row['content_id'], $row['content_heading']);
+					}
+					$this -> getCategoryTree($row['content_id'], "", $classcheck);
+				}
+			}
+			return $agc;
+		}
+
+
+
+		function getCrumbItem($id, $arr){
+			//$id	:	content_parent of item
+			//$arr	:	array of all categories
+			$crumb = "";
+			if(is_array($arr)){
+				if(array_key_exists($id, $arr)){
+					for($i=0;$i<count($arr[$id]);$i++){
+						$crumb .= "<a href='".e_SELF."?cat.".$arr[$id][$i]."'>".$arr[$id][$i+1]."</a> > ";
+						$i++;
+					}
+					$crumb = substr($crumb,0,-3);
+				}
+			}
+			return $crumb;
+		}
+
+		function ShowNextPrev($mode='', $from='0', $number, $total){
+			global $content_pref, $mainparent, $qs;
+			$modepref = ($mode ? "content_{$mode}_nextprev_{$mainparent}" : "content_nextprev_{$mainparent}");
+			if(isset($content_pref[$modepref]) && $content_pref[$modepref]){
+				require_once(e_HANDLER."np_class.php");
+				$np_querystring = (isset($qs[0]) ? $qs[0] : "").(isset($qs[1]) ? ".".$qs[1] : "").(isset($qs[2]) ? ".".$qs[2] : "").(isset($qs[3]) ? ".".$qs[3] : "").(isset($qs[4]) ? ".".$qs[4] : "");
+				$ix = new nextprev(e_SELF, $from, $number, $total, NP_3, ($np_querystring ? $np_querystring : ""));
+			}
+		}
+
+		function getCrumbPage($mode, $arr, $parent){
+			global $qs, $ns, $content_pref, $mainparent;
+
+			if(isset($content_pref["content_breadcrumb_{$mode}_{$mainparent}"]) && $content_pref["content_breadcrumb_{$mode}_{$mainparent}"]){
+				if(array_key_exists($parent, $arr)){
+					$sep = (isset($content_pref["content_breadcrumb_seperator_{$mainparent}"]) ? $content_pref["content_breadcrumb_seperator_{$mainparent}"] : ">");
+					$crumb = "<a href='".e_BASE."'>".CONTENT_LAN_58."</a> ".$sep." <a href='".e_SELF."'>".CONTENT_LAN_59."</a>";
+					for($i=0;$i<count($arr[$parent]);$i++){
+						$crumb .= " ".$sep." <a href='".e_SELF."?cat.".$arr[$parent][$i]."'>".$arr[$parent][$i+1]."</a>";
+						$i++;
+					}
+				}
+				if($qs[0] == "recent"){
+					$crumb .= " ".$sep." <a href='".e_SELF."?recent.".$arr[$parent][0]."'>".CONTENT_LAN_60."</a>";
+				}
+				if($qs[0] == "author"){
+					$crumb .= " ".$sep." <a href='".e_SELF."?author.list.".$arr[$parent][0]."'>".CONTENT_LAN_85."</a>";
+				}
+				if($qs[0] == "list"){
+					$crumb .= " ".$sep." <a href='".e_SELF."?list.".$arr[$parent][0]."'>list</a>";
+				}
+				if($qs[0] == "top"){
+					$crumb .= " ".$sep." <a href='".e_SELF."?top.".$arr[$parent][0]."'>".CONTENT_LAN_8."</a>";
+				}
+				if($qs[0] == "score"){
+					$crumb .= " ".$sep." <a href='".e_SELF."?score.".$arr[$parent][0]."'>".CONTENT_LAN_12."</a>";
+				}
+
+				$margin = "<br /><br />";
+				if(isset($content_pref["content_breadcrumb_rendertype_{$mainparent}"]) && $content_pref["content_breadcrumb_rendertype_{$mainparent}"] == "1"){
+					echo $crumb.$margin;
+					return "";
+				}elseif(isset($content_pref["content_breadcrumb_rendertype_{$mainparent}"]) && $content_pref["content_breadcrumb_rendertype_{$mainparent}"] == "2"){
+					$ns -> tablerender(CONTENT_LAN_24, $crumb.$margin);
+					return "";
+				}else{
+					return $crumb.$margin;
+				}
+			}else{
+				return "";
+			}
+		}
+
+
+
+		function countCatItems($id){
+			global $sqlcountitemsincat, $plugintable, $datequery;
+			//$id	:	category content_id
+
+			if(!is_object($sqlcountitemsincat)){ $sqlcountitemsincat = new db; }
+			$n = $sqlcountitemsincat -> db_Count($plugintable, "(*)", "WHERE content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent='".intval($id)."' AND content_refer != 'sa' ".$datequery." ");
+
+			return $n;
+		}
+
+
+		function getPageHeading($id){
+			global $plugintable, $sql;
+			$sql -> db_Select($plugintable, "content_heading", "content_id='".intval($id)."' ");
+			$row2 = $sql -> db_Fetch();
+			return $row2['content_heading'];
+		}
+		function setPageTitle(){
+			global $plugintable, $sql, $qs;
+
+			//content page
+			if(e_PAGE == "content.php"){
+				//main parent overview
+				if(!e_QUERY){
+					$page = CONTENT_PAGETITLE_LAN_0;
+				}else{
+					$sql -> db_Select($plugintable, "content_heading", "content_id = '".intval($qs[1])."' ");
+					$row = $sql -> db_Fetch();
+
+					$page = CONTENT_PAGETITLE_LAN_0;
+
+					//recent of parent='2'
+					if($qs[0] == "recent" && is_numeric($qs[1]) && !isset($qs[2])){
+						$page .= " / ".$row['content_heading']." / ".CONTENT_PAGETITLE_LAN_2;
+
+					//item
+					}elseif($qs[0] == "content" && isset($qs[1]) && is_numeric($qs[1]) ){
+						$page .= " / ".$this -> getPageHeading($qs[1]);
+
+					//all categories of parent='2'
+					}elseif($qs[0] == "cat" && $qs[1] == "list" && is_numeric($qs[2])){
+						$page .= " / ".$this -> getPageHeading($qs[2])." / ".CONTENT_PAGETITLE_LAN_13;
+
+					//category of parent='2' and content_id='5'
+					}elseif($qs[0] == "cat" && is_numeric($qs[1]) && !isset($qs[2])){
+						$page .= " / ".CONTENT_PAGETITLE_LAN_3." / ".$row['content_heading'];
+
+					//top rated of parent='2'
+					}elseif($qs[0] == "top" && is_numeric($qs[1]) && !isset($qs[2])){
+						$page .= " / ".$this -> getPageHeading($qs[1])." / ".CONTENT_PAGETITLE_LAN_4;
+
+					//top score of parent='2'
+					}elseif($qs[0] == "score" && is_numeric($qs[1]) && !isset($qs[2])){
+						$page .= " / ".$this -> getPageHeading($qs[1])." / ".CONTENT_PAGETITLE_LAN_15;
+
+					//authorlist of parent='2'
+					}elseif($qs[0] == "author" && $qs[1] == "list" && is_numeric($qs[2])){
+						$page .= " / ".$this -> getPageHeading($qs[2])." / ".CONTENT_PAGETITLE_LAN_14;
+
+					//authorlist of parent='2' and content_id='5'
+					}elseif($qs[0] == "author" && is_numeric($qs[1]) && !isset($qs[2])){
+						$sql -> db_Select($plugintable, "content_author", "content_id='".intval($qs[1])."' ");
+						$row2 = $sql -> db_Fetch();
+						$authordetails = $this -> getAuthor($row2['content_author']);
+						$page .= " / ".CONTENT_PAGETITLE_LAN_5." / ".$authordetails[1];
+
+					//archive of parent='2'
+					}elseif($qs[0] == "list" && is_numeric($qs[1]) && !isset($qs[2])){
+						$page .= " / ".CONTENT_PAGETITLE_LAN_6;
+					}
+				}
+
+			}elseif(e_PAGE == "content_submit.php"){
+				//submit page : view categories
+				if(!e_QUERY){
+					$page = CONTENT_PAGETITLE_LAN_0." / ".CONTENT_PAGETITLE_LAN_7;
+				}else{
+					$page = CONTENT_PAGETITLE_LAN_0;
+
+					//submit page : submit item
+					if($qs[0] == "content" && $qs[1] == "submit" && is_numeric($qs[2]) ){
+						$page = " / ".CONTENT_PAGETITLE_LAN_8;
+					}
+				}
+
+			}elseif(e_PAGE == "content_manager.php"){
+				//manager page : view categories
+				if(!e_QUERY){
+					$page = CONTENT_PAGETITLE_LAN_0." / ".CONTENT_PAGETITLE_LAN_9;
+				}else{
+					$page = CONTENT_PAGETITLE_LAN_0." / ".CONTENT_PAGETITLE_LAN_9;
+
+					//manager page : view items
+					if($qs[0] == "content" && is_numeric($qs[1]) ){
+						$page .= " / ".CONTENT_PAGETITLE_LAN_10;
+
+					//manager page : edit item
+					}elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){
+						$page .= " / ".CONTENT_PAGETITLE_LAN_11;
+
+					//manager page : create new item
+					}elseif($qs[0] == "content" && $qs[1] == "create" && is_numeric($qs[2]) ){
+						$page .= " / ".CONTENT_PAGETITLE_LAN_12;
+					}
+				}
+			}
+			define("e_PAGETITLE", strtolower($page));
+
+		}
+
+
+
+		function getAuthor($content_author) {
+			global $sql, $plugintable, $datequery;
+
+			if(is_numeric($content_author)){
+				if(!$sql -> db_Select("user", "user_id, user_name, user_email", "user_id=$content_author")){
+					$author_id = "0";
+					$author_name = "";
+					$author_email = "";
+				}else{
+					list($author_id, $author_name, $author_email) = $sql -> db_Fetch();
+				}
+				$getauthor = array($author_id, $author_name, $author_email, $content_author);
+			}else{
+				$tmp = explode("^", $content_author);
+				if(isset($tmp[0]) && is_numeric($tmp[0]) ){
+					$author_id		= $tmp[0];
+					$author_name	= (isset($tmp[1]) ? $tmp[1] : "");
+					$author_email	= (isset($tmp[2]) ? $tmp[2] : "");
+				}else{
+					$author_id		= "0";
+					$author_name	= $tmp[0];
+					$author_email	= (isset($tmp[1]) ? $tmp[1] : "");
+				}
+				$getauthor = array($author_id, $author_name, $author_email, $content_author);
+			}
+			return $getauthor;
+		}
+
+
+
+		function getMainParent($id){
+			global $sql, $plugintable;
+
+			$category_total = $sql -> db_Select($plugintable, "content_id, content_parent", "content_id='".intval($id)."' ");
+			$row = $sql -> db_Fetch();
+			if($row['content_parent'] == 0){
+				$mainparent = $row['content_id'];
+			}else{
+				if(strpos($row['content_parent'], ".")){
+					$newid = substr($row['content_parent'],2);
+				}else{
+					$newid = $row['content_parent'];
+				}
+				$mainparent = $this -> getMainParent( $newid );
+			}
+			return ($mainparent ? $mainparent : "0");
+		}
+
+
+
+		//admin
+		function ShowOptionCat($currentparent=""){
+			global $qs, $sql, $rs, $plugintable, $tp, $content_pref, $stylespacer;
+			$string = "";
+
+			if($currentparent == "submit"){
+				$mainparent		= $this -> getMainParent( intval($qs[2]) );
+				$catarray		= $this -> getCategoryTree("", intval($mainparent), FALSE);
+			}else{
+				$catarray		= $this -> getCategoryTree("", "", FALSE);
+			}
+			$array = array_keys($catarray);
+
+			foreach($array as $catid){
+				$category_total = $sql -> db_Select($plugintable, "content_id, content_heading, content_parent", "content_id='".intval($catid)."' ");
+				$row = $sql -> db_Fetch();
+
+				$pre = "";
+				if($row['content_parent'] == "0"){		//main parent level
+				}else{									//sub level
+					for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){
+						$pre .= "&nbsp;&nbsp;";
+					}
+				}
+				$emptystring = "----------------";
+
+				if($qs[0] == "cat"){
+
+					$js			= "";
+					$catstring	= "";
+					$name		= $pre.$row['content_heading'];
+					$selectjs	= "if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }";
+					$label		= $catid;
+					if($row['content_parent'] == 0){
+						$name	= $row['content_heading'];
+						$js		= "style='font-weight:bold;'";
+					}
+					if($qs[1] == "create"){
+						$checkid	= (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : "");
+						$value		= e_SELF."?cat.create.".$catid;
+						$sel		= ($catid == $checkid ? "1" : "0");
+					}elseif($qs[1] == "edit"){
+						$checkid	= ($currentparent ? $currentparent : "");
+						$value		= e_SELF."?cat.edit.".$qs[2].".".$catid;
+						$sel		= ($catid == $checkid ? "1" : "0");
+					}
+
+				//manage items
+				}elseif($qs[0] == "" || $qs[0] == "content"){
+
+					$catstring	= "";
+					$js			= "";
+					$label		= $catid;
+					$selectjs	= "if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }";
+					$name		= $pre.$row['content_heading'];
+					if($row['content_parent'] == 0){
+						$name	= $row['content_heading'];
+						$js		= "style='font-weight:bold;'";
+					}
+					if($qs[1] == "create" || $qs[1] == "submit"){
+						$checkid	= (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : "");
+						$value		= e_SELF."?content.".$qs[1].".".$catid;
+						$sel		= ($catid == $checkid ? "1" : "0");
+					}else{
+						$checkid	= ($currentparent ? $currentparent : "");
+						$sel		= ($catid == $checkid ? "1" : "0");
+						if($qs[1] == "" || is_numeric($qs[1])){
+							$value	= e_SELF."?content.".$catid;
+						}else{
+							$value	= e_SELF."?content.".$qs[1].".".$qs[2].".".$catid;
+						}
+					}
+				}
+				$string	.= $rs -> form_option($name, $sel, $value, ($label ? "label='".$label."'" : "label='none'")." ".$js ).$catstring;
+			}
+			$selectjs	= " onchange=\" document.getElementById('parent').value=this.options[this.selectedIndex].label; ".$selectjs." \"";
+			$text		= $rs -> form_select_open("parent1", $selectjs);
+
+			if(!isset($qs[0])){
+				$text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'");
+			}elseif( $qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){
+				$text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'");
+			}elseif( $qs[0] == "content" && ($qs[1] == "create" || $qs[1] == "submit") ){
+				$text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'");
+			}elseif( $qs[0] == "content" && is_numeric($qs[1]) ){
+				$text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_28, "0", "none", "label='none'");
+			}elseif($qs[0] == "cat" && $qs[1] == "create"){
+				$text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_29."&nbsp;&nbsp;", (isset($qs[2]) ? "0" : "1"), e_SELF."?cat.create", "label='0' style='font-weight:bold;'");
+			}else{
+				$text .= $rs -> form_option(CONTENT_ADMIN_MAIN_LAN_29."&nbsp;&nbsp;", (isset($qs[2]) ? "0" : "1"), e_SELF."?cat.edit.".$qs[2].".0", "label='0' style='font-weight:bold;'");
+			}
+			$text .= $string;
+			$text .= $rs -> form_select_close();
+
+			return $text;
+		}
+
+
+
+		function getOrder(){
+			global $qs, $content_pref;
+
+			if(isset($qs[0]) && substr($qs[0],0,5) == "order"){
+				$orderstring	= $qs[0];
+			}elseif(isset($qs[1]) && substr($qs[1],0,5) == "order"){
+				$orderstring	= $qs[1];
+			}elseif(isset($qs[2]) && substr($qs[2],0,5) == "order"){
+				$orderstring	= $qs[2];
+			}elseif(isset($qs[3]) && substr($qs[3],0,5) == "order"){
+				$orderstring	= $qs[3];
+			}else{
+				$checkmi		= (is_numeric($qs[1]) ? $qs[1] : intval($qs[2]));
+				$checkmp		= $this -> getMainParent($checkmi);
+				$orderstring	= ($content_pref["content_defaultorder_{$checkmp}"] ? $content_pref["content_defaultorder_{$checkmp}"] : "orderddate" );
+			}
+
+			if(substr($orderstring,6) == "heading"){
+				$orderby		= "content_heading";
+				$orderby2		= "";
+			}elseif(substr($orderstring,6) == "date"){
+				$orderby		= "content_datestamp";
+				$orderby2		= ", content_heading ASC";
+			}elseif(substr($orderstring,6) == "parent"){
+				$orderby		= "content_parent";
+				$orderby2		= ", content_heading ASC";
+			}elseif(substr($orderstring,6) == "refer"){
+				$orderby		= "content_refer";
+				$orderby2		= ", content_heading ASC";
+			}elseif(substr($orderstring,6) == "author"){
+
+			}elseif(substr($orderstring,6) == "order"){
+				if($qs[0] == "cat"){
+					$orderby	= "SUBSTRING_INDEX(content_order, '.', 1)+0";
+				}elseif($qs[0] != "cat"){
+					$orderby	= "SUBSTRING_INDEX(content_order, '.', -1)+0";
+				}
+				$orderby2		= ", content_heading ASC";
+			}else{
+				$orderstring	= "orderddate";
+				$orderby		= "content_datestamp";
+				$orderby2		= ", content_heading ASC";
+			}
+			$order = " ORDER BY ".$orderby." ".(substr($orderstring,5,1) == "a" ? "ASC" : "DESC")." ".$orderby2." ";
+			return $order;
+		}
+
+
+
+		function getIcon($mode, $icon, $path="", $linkid="", $width="", $blank=""){
+			global $content_cat_icon_path_small, $content_cat_icon_path_large, $content_icon_path, $content_pref;
+
+			$blank			= (!$blank ? "0" : $blank);
+			$border			= "border:0;";
+			$hrefpre		= ($linkid ? "<a href='".e_SELF."?".$linkid."'>" : "");
+			$hrefpost		= ($linkid ? "</a>" : "");
+
+			if($mode == "item"){
+				$path		= (!$path ? $content_icon_path : $path);
+				$width		= ($width ? "width:".$width."px;" : "");
+				$border		= "border:1px solid #000;";
+				$icon		= ($icon ? $path.$icon : ($blank ? $content_icon_path."blank.gif" : ""));
+
+			}elseif($mode == "catsmall"){
+				$path		= (!$path ? $content_cat_icon_path_small : $path);
+				$icon		= ($icon ? $path.$icon : "");
+
+			}elseif($mode == "catlarge"){
+				$path		= (!$path ? $content_cat_icon_path_large : $path);
+				$icon		= ($icon ? $path.$icon : "");
+			}else{
+				$path		= (!$path ? $content_icon_path : $path);
+				$hrefpre	= "";
+				$hrefpost	= "";
+				$width		= "";
+				$icon		= ($icon ? $path.$icon : ($blank ? $content_icon_path."blank.gif" : ""));
+			}
+
+			if($icon && file_exists($icon)){
+				$iconstring	= $hrefpre."<img src='".$icon."' alt='' style='".$width." ".$border."' />".$hrefpost;
+			}else{
+				$iconstring = "";
+				if($blank){
+					if(file_exists($content_icon_path."blank.gif")){
+						if($mode == "catsmall"){
+							$width = ($width ? "width:".$width."px;" : "width:16px;");
+						}elseif($mode == "catlarge"){
+							$width = ($width ? "width:".$width."px;" : "width:48px;");
+						}
+						$iconstring = $hrefpre."<img src='".$content_icon_path."blank.gif' alt='' style='".$width." ".$border."' />".$hrefpost;
+					}
+				}
+			}
+			return $iconstring;
+		}
+
+		function prepareAuthor($mode, $author, $id){
+			global $aa, $mainparent, $content_pref;
+			if($mode == ''){return;}
+
+			$authorinfo = "";
+			if( (isset($content_pref["content_{$mode}_authorname_{$mainparent}"]) && $content_pref["content_{$mode}_authorname_{$mainparent}"]) || (isset($content_pref["content_{$mode}_authoremail_{$mainparent}"]) && $content_pref["content_{$mode}_authoremail_{$mainparent}"]) || (isset($content_pref["content_{$mode}_authoricon_{$mainparent}"]) && $content_pref["content_{$mode}_authoricon_{$mainparent}"]) || (isset($content_pref["content_{$mode}_authorprofile_{$mainparent}"]) && $content_pref["content_{$mode}_authorprofile_{$mainparent}"]) ){
+				$authordetails = $this -> getAuthor($author);
+				if(isset($content_pref["content_{$mode}_authorname_{$mainparent}"]) && $content_pref["content_{$mode}_authorname_{$mainparent}"]){
+					if(isset($content_pref["content_{$mode}_authoremail_{$mainparent}"]) && $authordetails[2]){
+						if($authordetails[0] == "0"){
+							if(isset($content_pref["content_{$mode}_authoremail_nonmember_{$mainparent}"]) && $content_pref["content_{$mode}_authoremail_nonmember_{$mainparent}"] && strpos($authordetails[2], "@") ){
+								$authorinfo = "<a href='mailto:".$authordetails[2]."'>".$authordetails[1]."</a>";
+							}else{
+								$authorinfo = $authordetails[1];
+							}
+						}else{
+							$authorinfo = "<a href='mailto:".$authordetails[2]."'>".$authordetails[1]."</a>";
+						}
+					}else{
+						$authorinfo = $authordetails[1];
+					}
+					if(USER && is_numeric($authordetails[0]) && $authordetails[0] != "0" && isset($content_pref["content_{$mode}_authorprofile_{$mainparent}"]) && $content_pref["content_{$mode}_authorprofile_{$mainparent}"]){
+						$authorinfo .= " <a href='".e_BASE."user.php?id.".$authordetails[0]."' title='".CONTENT_LAN_40."'>".CONTENT_ICON_USER."</a>";
+					}
+				}
+				if(isset($content_pref["content_{$mode}_authoricon_{$mainparent}"]) && $content_pref["content_{$mode}_authoricon_{$mainparent}"]){
+					$authorinfo .= " <a href='".e_SELF."?author.".$id."' title='".CONTENT_LAN_39."'>".CONTENT_ICON_AUTHORLIST."</a>";
+				}
+			}
+			return $authorinfo;
+		}
+
+
+		//admin
+		function popupHelp($text, $image="", $width="320", $title=""){
+			//$image	:	full path to the image you want to show on screen (uses a default doc image)
+			//$width	:	the width of the popup (uses a default width of 500)
+			//$title	:	the window title of the popup (uses a default title of ...)
+			//$text		:	the help text to show into the popup
+
+			if(!$image || !file_exists($image)){
+				$image = e_IMAGE."admin_images/docs_16.png";
+			}
+			if(!$width){ $width = "320"; }
+			if(!$title){ $title = "content management help area"; }
+
+			$popup = "<a href=\"javascript:openHelpPopup(".$width.",'".$title."','".$text."')\" style='cursor:pointer;' onmouseover=\"window.status='click for help on this page'; return true;\" onmouseout=\"window.status=''; return true;\" ><img src='".$image."' style='border:0;' alt='' /></a>";
+
+			return $popup;
+		}
+
+
+
+		//search by keyword
+		function showOptionsSearch($mode, $searchtypeid=""){
+			global $plugindir, $plugintable, $qs, $rs;
+
+			if(!is_object($rs)){
+				require_once(e_HANDLER."form_handler.php");
+				$rs = new form;
+			}
+			if(!isset($searchtypeid)){
+				$searchtypeid = (is_numeric($qs[1]) ? $qs[1] : $qs[2]);
+			}
+
+			if($mode == "menu"){
+				$CONTENT_SEARCH_TABLE_KEYWORD = $rs -> form_open("post", $plugindir."content.php?recent.$searchtypeid", "contentsearchmenu_{$mode}", "", "enctype='multipart/form-data'")."<input class='tbox' size='20' type='text' id='searchfieldmenu_{$mode}' name='searchfieldmenu_{$mode}' value='".(isset($_POST['searchfieldmenu_{$mode}']) ? $_POST['searchfieldmenu_{$mode}'] : CONTENT_LAN_18)."' maxlength='100' onfocus=\"document.forms['contentsearchmenu_{$mode}'].searchfieldmenu_$mode.value='';\" /> <input class='button' type='submit' name='searchsubmit' value='".CONTENT_LAN_19."' />".$rs -> form_close();
+			}else{
+				$searchfieldname = "searchfield_{$mode}";
+				$CONTENT_SEARCH_TABLE_KEYWORD = $rs -> form_open("post", $plugindir."content.php?recent.$searchtypeid", "contentsearch_{$mode}", "", "enctype='multipart/form-data'")."
+				<input class='tbox' size='27' type='text' id='$searchfieldname' name='$searchfieldname' value='".(isset($_POST[$searchfieldname]) ? $_POST[$searchfieldname] : CONTENT_LAN_18)."' maxlength='100' onfocus=\"document.forms['contentsearch_{$mode}'].$searchfieldname.value='';\" />
+				<input class='button' type='submit' name='searchsubmit' value='".CONTENT_LAN_19."' />
+				".$rs -> form_close();
+			}
+			return $CONTENT_SEARCH_TABLE_KEYWORD;
+		}
+
+
+
+		//redirection links in dropdown
+		function showOptionsSelect($mode, $searchtypeid=""){
+			global $plugindir, $plugintable, $rs, $qs, $content_pref;
+
+			if(!is_object($rs)){
+				require_once(e_HANDLER."form_handler.php");
+				$rs = new form;
+			}
+			if(!isset($searchtypeid)){
+				$searchtypeid = (is_numeric($qs[1]) ? $qs[1] : $qs[2]);
+			}
+			$catarray		= "";
+			$mainparent		= $this -> getMainParent( $searchtypeid );
+			$content_pref	= $this -> getContentPref($mainparent);
+			$parent			= $this -> getCategoryTree("", $mainparent, TRUE);
+			$parent			= array_merge_recursive($parent);
+			for($a=0;$a<count($parent);$a++){
+				for($b=0;$b<count($parent[$a]);$b++){
+					$newparent[$parent[$a][$b]] = $parent[$a][$b+1];
+					$b++;
+				}
+			}
+			if($newparent){
+				$emptystring = "-- categories --";
+				$catarray = $rs -> form_option($emptystring, "0", "none");
+			}
+			foreach($newparent as $key => $value){
+				$n = "";
+				if($mode == "page" || ($mode == "menu" && isset($content_pref["content_menu_cat_number_{$mainparent}"])) ){
+					$n = $this -> countCatItems($key);
+					$n = " (".$n." ".($n == "1" ? CONTENT_LAN_53 : CONTENT_LAN_54).")";
+				}
+				if( ($content_pref["content_menu_cat_main_$mainparent"] && $key == $mainparent) || $key != $mainparent ){
+					$value = (strlen($value) > 25 ? substr($value,0,25)."..." : $value);
+					$catarray .= $rs -> form_option($value.$n, 0, $plugindir."content.php?cat.".$key);
+				}
+			}
+
+			if($mode == "page" || ($mode == "menu" && ($content_pref["content_menu_links_$mainparent"] && $content_pref["content_menu_links_dropdown_$mainparent"]) || ($content_pref["content_menu_cat_$mainparent"] && $content_pref["content_menu_cat_dropdown_$mainparent"]) ) ){
+				if($mode == "menu"){ $style = "style='width:100%;' "; }else{ $style = ""; }
+				$CONTENT_SEARCH_TABLE_SELECT = "
+				".$rs -> form_open("post", $plugindir."content.php".(e_QUERY ? "?".e_QUERY : ""), "contentredirect".$mode, "", "enctype='multipart/form-data'")."				
+				<select id='{$mode}value' name='{$mode}value' class='tbox' $style onchange=\"if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }\">";					
+
+				if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_links_$mainparent"] && $content_pref["content_menu_links_dropdown_$mainparent"]) ){
+					$CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_56, 1, "none").$rs -> form_option("&nbsp;", "0", "none");
+
+					if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewallcat_$mainparent"])){
+					   $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_6, 0, $plugindir."content.php?cat.list.".$mainparent);
+					}
+					if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewallauthor_$mainparent"])){
+					   $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_7, 0, $plugindir."content.php?author.list.".$mainparent);
+					}
+					if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewallitems_$mainparent"])){
+					   $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_83, 0, $plugindir."content.php?list.".$mainparent);
+					}
+					if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewtoprated_$mainparent"])){
+					   $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_8, 0, $plugindir."content.php?top.".$mainparent);
+					}
+					if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewtopscore_$mainparent"])){
+					   $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_12, 0, $plugindir."content.php?score.".$mainparent);
+					}
+					if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewrecent_$mainparent"])){
+					   $CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_61, 0, $plugindir."content.php?recent.".$mainparent);
+					}
+					if( ($mode == "page" || ($mode == "menu" && $content_pref["content_menu_viewsubmit_$mainparent"]) && $content_pref["content_submit_$mainparent"] && check_class($content_pref["content_submit_class_$mainparent"]) ) ){
+						$CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option(CONTENT_LAN_75, 0, $plugindir."content_submit.php");
+					}
+					$CONTENT_SEARCH_TABLE_SELECT .= $rs -> form_option("&nbsp;", "0", "none");
+				}
+				if($mode == "page" || ($mode == "menu" && $content_pref["content_menu_cat_$mainparent"] && $content_pref["content_menu_cat_dropdown_$mainparent"])){
+					$CONTENT_SEARCH_TABLE_SELECT .= $catarray;
+				}
+				$CONTENT_SEARCH_TABLE_SELECT .= "
+				".$rs -> form_select_close()."
+				".$rs -> form_close();
+			}
+			return $CONTENT_SEARCH_TABLE_SELECT;
+		}
+
+
+
+		//ordering in dropdown
+		function showOptionsOrder($mode, $ordertypeid=""){
+			global $plugindir, $rs, $qs;
+
+			if(!is_object($rs)){
+				require_once(e_HANDLER."form_handler.php");
+				$rs = new form;
+			}
+			if(!isset($ordertypeid)){
+				$ordertypeid = (is_numeric($qs[1]) ? $qs[1] : $qs[2]);
+			}
+
+			$text = "";
+			if(strpos(e_SELF, 'content.php') !== FALSE){
+				if(e_QUERY){
+					$check = "";
+					for($i=0;$i<count($qs);$i++){
+						if($qs[$i] && substr($qs[$i],0,5) == "order"){
+							$check = $qs[$i];
+							break;
+						}
+					}
+					$baseurl = $plugindir."content.php";
+					$qry = (isset($qs[0]) && substr($qs[0],0,5) != "order" ? $qs[0] : "").(isset($qs[1]) && substr($qs[1],0,5) != "order" ? ".".$qs[1] : "").(isset($qs[2]) && substr($qs[2],0,5) != "order" ? ".".$qs[2] : "").(isset($qs[3]) && substr($qs[3],0,5) != "order" ? ".".$qs[3] : "");
+					$text = $rs -> form_open("post", $baseurl."?$qs[0].$ordertypeid", "contentsearchorder{$mode}", "", "enctype='multipart/form-data'");
+					$text .= "<select id='ordervalue{$mode}' name='ordervalue{$mode}' class='tbox' onchange=\"if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }\">";
+					$text .= $rs -> form_option(CONTENT_ORDER_LAN_0, 1, "none");
+
+					if($qs[0] == "author" && $qs[1] == "list"){
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_11, ($check == "orderaauthor" ? "1" : "0"), $baseurl."?".$qry.".orderaauthor" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_12, ($check == "orderdauthor" ? "1" : "0"), $baseurl."?".$qry.".orderdauthor" );
+					}else{
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_1, ($check == "orderaheading" ? "1" : "0"), $baseurl."?".$qry.".orderaheading" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_2, ($check == "orderdheading" ? "1" : "0"), $baseurl."?".$qry.".orderdheading" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_3, ($check == "orderadate" ? "1" : "0"), $baseurl."?".$qry.".orderadate" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_4, ($check == "orderddate" ? "1" : "0"), $baseurl."?".$qry.".orderddate" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_5, ($check == "orderarefer" ? "1" : "0"), $baseurl."?".$qry.".orderarefer" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_6, ($check == "orderdrefer" ? "1" : "0"), $baseurl."?".$qry.".orderdrefer" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_7, ($check == "orderaparent" ? "1" : "0"), $baseurl."?".$qry.".orderaparent" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_8, ($check == "orderdparent" ? "1" : "0"), $baseurl."?".$qry.".orderdparent" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_9, ($check == "orderaorder" ? "1" : "0"), $baseurl."?".$qry.".orderaorder" );
+						$text .= $rs -> form_option(CONTENT_ORDER_LAN_10, ($check == "orderdorder" ? "1" : "0"), $baseurl."?".$qry.".orderdorder" );
+					}
+					$text .= $rs -> form_select_close();
+					$text .= $rs -> form_close();
+				}
+			}
+			return $text;
+		}
+
+
+
+		function CreateParentMenu($parentid){
+			global $plugintable, $plugindir, $tp, $datequery;
+
+			if(!is_object($sqlcreatemenu)){ $sqlcreatemenu = new db; }
+			if(!$sqlcreatemenu -> db_Select($plugintable, "*", "content_id='".intval($parentid)."'  ")){
+				return FALSE;
+			}else{
+				$row = $sqlcreatemenu -> db_Fetch();
+			}
+			
+			$content_path_menu			= $plugindir."menus/";
+			if(!is_writable($content_path_menu)){
+				echo "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_path_menu." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
+				return FALSE;
+			}
+
+			$menufile = "content_".$row['content_heading'];
+			$menuname = $row['content_heading'];
+
+			$data = chr(60)."?php\n". chr(47)."*\n+---------------------------------------------------------------+\n|        e107 website system\n|        ".e_PLUGIN."content/menus/".$menufile."_menu.php\n|\n|        Steve Dunstan 2001-2002\n|        http://e107.org\n|        jalist@e107.org\n|\n|        Released under the terms and conditions of the\n|        GNU General Public License (http://gnu.org).\n+---------------------------------------------------------------+\n\nThis file has been generated by ".e_PLUGIN."content/handlers/content_class.php.\n\n*". chr(47)."\n\n";
+			$data .= "\n";
+			$data .= "unset(".chr(36)."text);\n";
+			$data .= chr(36)."text = \"\";\n";
+			$data .= chr(36)."menutypeid		= \"$parentid\";\n";
+			$data .= chr(36)."menuname		= \"$menuname\";\n";
+			$data .= "\n";
+			$data .= chr(36)."plugindir		= e_PLUGIN.'content/';\n";
+			$data .= chr(36)."plugintable	= \"pcontent\";		//name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)\n";
+			$data .= chr(36)."datequery		= \" AND content_datestamp < \".time().\" AND (content_enddate=0 || content_enddate>\".time().\") \";\n";
+			$data .= "\n";
+			$data .= "require_once(e_PLUGIN.'content/handlers/content_class.php');\n";
+			$data .= chr(36)."aa = new content;\n";
+			$data .= "require_once(e_HANDLER.'form_handler.php');\n";
+			$data .= chr(36)."rs = new form;\n";
+			$data .= chr(36)."gen = new convert;\n";
+			$data .= "global ".chr(36)."tp;\n";
+			$data .= "\n";
+			$data .= chr(36)."lan_file = e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content.php';\n";
+			$data .= "include_once(file_exists(".chr(36)."lan_file) ? ".chr(36)."lan_file : e_PLUGIN.'content/languages/English/lan_content.php');\n";
+			$data .= "\n";
+			$data .= chr(36)."content_pref					= ".chr(36)."aa -> getContentPref(".chr(36)."menutypeid);\n";
+			$data .= chr(36)."content_icon_path				= ".chr(36)."tp -> replaceConstants(".chr(36)."content_pref[\"content_icon_path_".chr(36)."menutypeid\"]);\n";
+			$data .= chr(36)."content_cat_icon_path_small	= ".chr(36)."tp -> replaceConstants(".chr(36)."content_pref[\"content_cat_icon_path_small_".chr(36)."menutypeid\"]);\n";
+			$data .= "\n";
+			$data .= "	".chr(36)."break = FALSE;\n";
+			$data .= "//##### SEARCH SELECT ORDER --------------------------------------------------\n";
+			$data .= "//show search box\n";
+			$data .= "if(".chr(36)."content_pref[\"content_menu_search_".chr(36)."menutypeid\"]){\n";
+			$data .= "	".chr(36)."text .= ".chr(36)."aa -> showOptionsSearch(\"menu\", ".chr(36)."menutypeid);\n";
+			$data .= "	".chr(36)."break = TRUE;\n";
+			$data .= "}\n";
+			$data .= "//show select box (with either links to other content pages, to categories, to both, or don't show at all)\n";
+			$data .= "if( (".chr(36)."content_pref[\"content_menu_links_".chr(36)."menutypeid\"] && ".chr(36)."content_pref[\"content_menu_links_dropdown_".chr(36)."menutypeid\"]) || (".chr(36)."content_pref[\"content_menu_cat_".chr(36)."menutypeid\"] && ".chr(36)."content_pref[\"content_menu_cat_dropdown_".chr(36)."menutypeid\"]) ){\n";
+			$data .= "	".chr(36)."text .= ".chr(36)."aa -> showOptionsSelect(\"menu\", ".chr(36)."menutypeid);\n";
+			$data .= "	".chr(36)."break = TRUE;\n";
+			$data .= "}\n";
+			$data .= "//show order box\n";
+			$data .= "if(".chr(36)."content_pref[\"content_menu_sort_".chr(36)."menutypeid\"]){\n";
+			$data .= "	".chr(36)."text .= ".chr(36)."aa -> showOptionsOrder(\"menu\", ".chr(36)."menutypeid);\n";
+			$data .= "	".chr(36)."break = TRUE;\n";
+			$data .= "}\n";
+			$data .= "\n";
+			$data .= "//show links list if chosen so\n";
+			$data .= "if(".chr(36)."content_pref[\"content_menu_links_".chr(36)."menutypeid\"] && !".chr(36)."content_pref[\"content_menu_links_dropdown_".chr(36)."menutypeid\"]){\n";
+			$data .= "	if(".chr(36)."break === TRUE){\n";
+			$data .= "	   ".chr(36)."text .= \"<br />\";\n";
+			$data .= "	}\n";
+			$data .= "	".chr(36)."text .= (".chr(36)."content_pref[\"content_menu_links_caption_".chr(36)."menutypeid\"] != \"\" ? ".chr(36)."content_pref[\"content_menu_links_caption_".chr(36)."menutypeid\"] : CONTENT_MENU_LAN_4).\"<br />\";\n";
+			$data .= "\n";
+			$data .= "	//define icon\n";
+			$data .= "	if(".chr(36)."content_pref[\"content_menu_links_icon_".chr(36)."menutypeid\"] == \"0\"){ ".chr(36)."linksicon = \"\";\n";
+			$data .= "	}elseif(".chr(36)."content_pref[\"content_menu_links_icon_".chr(36)."menutypeid\"] == \"1\"){ ".chr(36)."linksicon = \"<img src='\".THEME.\"images/bullet2.gif' alt='' />\";\n";
+			$data .= "	}elseif(".chr(36)."content_pref[\"content_menu_links_icon_".chr(36)."menutypeid\"] == \"2\"){ ".chr(36)."linksicon = \"&middot\";\n";
+			$data .= "	}elseif(".chr(36)."content_pref[\"content_menu_links_icon_".chr(36)."menutypeid\"] == \"3\"){ ".chr(36)."linksicon = \"&ordm;\";\n";
+			$data .= "	}elseif(".chr(36)."content_pref[\"content_menu_links_icon_".chr(36)."menutypeid\"] == \"4\"){ ".chr(36)."linksicon = \"&raquo;\";\n";
+			$data .= "	}\n";
+			$data .= "\n";
+			$data .= "	if(".chr(36)."content_pref[\"content_menu_viewallcat_".chr(36)."menutypeid\"]){\n";
+			$data .= "		".chr(36)."text .= ".chr(36)."linksicon.\" <a href='\".".chr(36)."plugindir.\"content.php?cat.list.\".".chr(36)."menutypeid.\"'>\".CONTENT_LAN_6.\"</a><br />\";\n";
+			$data .= "	}\n";
+			$data .= "	if(".chr(36)."content_pref[\"content_menu_viewallauthor_".chr(36)."menutypeid\"]){\n";
+			$data .= "		".chr(36)."text .= ".chr(36)."linksicon.\" <a href='\".".chr(36)."plugindir.\"content.php?author.list.\".".chr(36)."menutypeid.\"'>\".CONTENT_LAN_7.\"</a><br />\";\n";
+			$data .= "	}\n";
+			$data .= "	if(".chr(36)."content_pref[\"content_menu_viewallitems_".chr(36)."menutypeid\"]){\n";
+			$data .= "		".chr(36)."text .= ".chr(36)."linksicon.\" <a href='\".".chr(36)."plugindir.\"content.php?list.\".".chr(36)."menutypeid.\"'>\".CONTENT_LAN_83.\"</a><br />\";\n";
+			$data .= "	}\n";
+			$data .= "	if(".chr(36)."content_pref[\"content_menu_viewtoprated_".chr(36)."menutypeid\"]){\n";
+			$data .= "		".chr(36)."text .= ".chr(36)."linksicon.\" <a href='\".".chr(36)."plugindir.\"content.php?top.\".".chr(36)."menutypeid.\"'>\".CONTENT_LAN_8.\"</a><br />\";\n";
+			$data .= "	}\n";
+			$data .= "	if(".chr(36)."content_pref[\"content_menu_viewtopscore_".chr(36)."menutypeid\"]){\n";
+			$data .= "		".chr(36)."text .= ".chr(36)."linksicon.\" <a href='\".".chr(36)."plugindir.\"content.php?score.\".".chr(36)."menutypeid.\"'>\".CONTENT_LAN_12.\"</a><br />\";\n";
+			$data .= "	}\n";
+			$data .= "	if(".chr(36)."content_pref[\"content_menu_viewrecent_".chr(36)."menutypeid\"]){\n";
+			$data .= "		".chr(36)."text .= ".chr(36)."linksicon.\" <a href='\".".chr(36)."plugindir.\"content.php?recent.\".".chr(36)."menutypeid.\"'>\".CONTENT_LAN_61.\"</a><br />\";\n";
+			$data .= "	}\n";
+			$data .= "	if( ".chr(36)."content_pref[\"content_menu_viewsubmit_".chr(36)."menutypeid\"] && ".chr(36)."content_pref[\"content_submit_".chr(36)."menutypeid\"] && check_class(".chr(36)."content_pref[\"content_submit_class_".chr(36)."menutypeid\"]) ){\n";
+			$data .= "		".chr(36)."text .= ".chr(36)."linksicon.\" <a href='\".".chr(36)."plugindir.\"content_submit.php'>\".CONTENT_LAN_75.\"</a><br />\";\n";
+			$data .= "	}\n";
+			$data .= "	".chr(36)."text .= \"<br />\";\n";
+			$data .= "}\n";
+			$data .= "\n";
+			$data .= "//get category array\n";
+			$data .= chr(36)."array = ".chr(36)."aa -> getCategoryTree(\"\", intval(".chr(36)."menutypeid), TRUE);\n";
+			$data .= "\n";
+			$data .= "//##### CATEGORY LIST --------------------------------------------------\n";
+			$data .= "if(!".chr(36)."content_pref[\"content_menu_cat_dropdown_".chr(36)."menutypeid\"]){\n";
+			$data .= "	if(".chr(36)."content_pref[\"content_menu_cat_".chr(36)."menutypeid\"]){\n";
+			$data .= "		".chr(36)."text .= (".chr(36)."content_pref[\"content_menu_cat_caption_".chr(36)."menutypeid\"] != \"\" ? ".chr(36)."content_pref[\"content_menu_cat_caption_".chr(36)."menutypeid\"] : CONTENT_MENU_LAN_3).\"<br />\";\n";
+			$data .= "\n";
+			$data .= "		".chr(36)."newparent = \"\";\n";
+			$data .= "		".chr(36)."checkid = \"\";\n";
+			$data .= "		".chr(36)."newarray = array_merge_recursive(".chr(36)."array);\n";
+			$data .= "		for(".chr(36)."a=0;".chr(36)."a<count(".chr(36)."newarray);".chr(36)."a++){\n";
+			$data .= "			for(".chr(36)."b=0;".chr(36)."b<count(".chr(36)."newarray[".chr(36)."a]);".chr(36)."b++){\n";
+			$data .= "				".chr(36)."newparent[".chr(36)."newarray[".chr(36)."a][".chr(36)."b]] = ".chr(36)."newarray[".chr(36)."a][".chr(36)."b+1];\n";
+			$data .= "				if( (".chr(36)."content_pref[\"content_menu_cat_main_".chr(36)."menutypeid\"] && ".chr(36)."newarray[".chr(36)."a][".chr(36)."b] == ".chr(36)."menutypeid) || ".chr(36)."newarray[".chr(36)."a][".chr(36)."b] != ".chr(36)."menutypeid ){\n";
+			$data .= "					".chr(36)."checkid .= \" content_id = '\".".chr(36)."newarray[".chr(36)."a][".chr(36)."b].\"' OR \";\n";
+			$data .= "				}\n";
+			$data .= "				".chr(36)."b++;\n";
+			$data .= "			}\n";
+			$data .= "		}\n";
+			$data .= "		".chr(36)."checkid = substr(".chr(36)."checkid,0,-3);\n";
+			$data .= "		if(!is_object(".chr(36)."sql)){ ".chr(36)."sql = new db; }\n";
+			
+			$data .= "		if(".chr(36)."sql -> db_Select(".chr(36)."plugintable, \"*\", \" \".".chr(36)."checkid.\" ORDER BY content_order \")){\n";
+			$data .= "			while(".chr(36)."row = ".chr(36)."sql -> db_Fetch()){\n";
+			$data .= "\n";
+			$data .= "				//define icon\n";
+			$data .= "				".chr(36)."ICON = \"\";\n";
+			$data .= "				if(".chr(36)."content_pref[\"content_menu_cat_icon_".chr(36)."menutypeid\"] == \"0\"){ ".chr(36)."ICON = \"\";\n";
+			$data .= "				}elseif(".chr(36)."content_pref[\"content_menu_cat_icon_".chr(36)."menutypeid\"] == \"1\"){ ".chr(36)."ICON = \"<img src='\".THEME.\"images/bullet2.gif' alt='' style='border:0;' />\";\n";
+			$data .= "				}elseif(".chr(36)."content_pref[\"content_menu_cat_icon_".chr(36)."menutypeid\"] == \"2\"){ ".chr(36)."ICON = \"&middot\";\n";
+			$data .= "				}elseif(".chr(36)."content_pref[\"content_menu_cat_icon_".chr(36)."menutypeid\"] == \"3\"){ ".chr(36)."ICON = \"&ordm;\";\n";
+			$data .= "				}elseif(".chr(36)."content_pref[\"content_menu_cat_icon_".chr(36)."menutypeid\"] == \"4\"){ ".chr(36)."ICON = \"&raquo;\";\n";
+			$data .= "				}elseif(".chr(36)."content_pref[\"content_menu_cat_icon_".chr(36)."menutypeid\"] == \"5\"){\n";
+			$data .= "					if(".chr(36)."row['content_icon'] != \"\" && file_exists(".chr(36)."content_cat_icon_path_small.".chr(36)."row['content_icon']) ){\n";
+			$data .= "						".chr(36)."ICON = \"<img src='\".".chr(36)."content_cat_icon_path_small.".chr(36)."row['content_icon'].\"' alt='' style='border:0;' />\";\n";
+			$data .= "					}else{\n";
+			$data .= "						//default category icon\n";
+			$data .= "						if(".chr(36)."content_pref[\"content_menu_cat_icon_default_".chr(36)."menutypeid\"] == \"0\"){ ".chr(36)."ICON = \"\";\n";
+			$data .= "						}elseif(".chr(36)."content_pref[\"content_menu_cat_icon_default_".chr(36)."menutypeid\"] == \"1\"){ ".chr(36)."ICON = \"<img src='\".THEME.\"images/bullet2.gif' alt='' style='border:0;' />\";\n";
+			$data .= "						}elseif(".chr(36)."content_pref[\"content_menu_cat_icon_default_".chr(36)."menutypeid\"] == \"2\"){ ".chr(36)."ICON = \"&middot\";\n";
+			$data .= "						}elseif(".chr(36)."content_pref[\"content_menu_cat_icon_default_".chr(36)."menutypeid\"] == \"3\"){ ".chr(36)."ICON = \"&ordm;\";\n";
+			$data .= "						}elseif(".chr(36)."content_pref[\"content_menu_cat_icon_default_".chr(36)."menutypeid\"] == \"4\"){ ".chr(36)."ICON = \"&raquo;\";\n";
+			$data .= "						}\n";
+			$data .= "					}\n";
+			$data .= "				}\n";
+			$data .= "				//display category list\n";
+			$data .= "				".chr(36)."text .= \"<table style='width:100%; text-align:left; border:0;' cellpadding='0' cellspacing='0'>\";\n";
+			$data .= "				".chr(36)."text .= \"<tr>\";\n";
+			$data .= "				".chr(36)."text .= (".chr(36)."ICON ? \"<td style='width:1%; white-space:nowrap; text-align:left; padding-right:5px;'><a href='\".e_PLUGIN.\"content/content.php?cat.\".".chr(36)."row['content_id'].\"'>\".".chr(36)."ICON.\"</a></td>\" : \"\");\n";
+			$data .= "				".chr(36)."text .= \"<td colspan='2'>\";\n";
+			$data .= "				".chr(36)."text .= \"<a href='\".e_PLUGIN.\"content/content.php?cat.\".".chr(36)."row['content_id'].\"'>\".".chr(36)."row['content_heading'].\"</a>\";\n";
+			$data .= "				".chr(36)."text .= (".chr(36)."content_pref[\"content_menu_cat_number_".chr(36)."menutypeid\"] ? \" <span class='smalltext'>(\".".chr(36)."aa -> countCatItems(".chr(36)."row['content_id']).\")</span>\" : \"\");\n";
+			$data .= "				".chr(36)."text .= \"</td>\";\n";
+			$data .= "				".chr(36)."text .= \"</tr>\";\n";
+			$data .= "				".chr(36)."text .= \"</table>\";\n";
+			$data .= "			}\n";
+			$data .= "		}\n";
+			$data .= "	}\n";
+			$data .= "}\n";
+			$data .= "\n";
+			$data .= "//##### RECENT --------------------------------------------------\n";
+			$data .= "if(".chr(36)."content_pref[\"content_menu_recent_".chr(36)."menutypeid\"]){\n";
+			$data .= chr(36)."text .= \"<br />\";\n";
+			$data .= "\n";
+			$data .= "//prepare query paramaters\n";
+			$data .= chr(36)."validparent = implode(\",\", array_keys(".chr(36)."array));\n";
+			$data .= chr(36)."qry = \" content_parent REGEXP '\".".chr(36)."aa -> CONTENTREGEXP(".chr(36)."validparent).\"' \";\n";
+			$data .= "\n";
+			$data .= chr(36)."sql1 = new db;\n";
+			$data .= chr(36)."contenttotal = ".chr(36)."sql1 -> db_Count(".chr(36)."plugintable, \"(*)\", \"WHERE content_refer != 'sa' AND \".".chr(36)."qry.\" \".".chr(36)."datequery.\" AND content_class REGEXP '\".e_CLASS_REGEXP.\"' \" );\n";
+			$data .= "\n";
+			$data .= "if(".chr(36)."resultitem = ".chr(36)."sql1 -> db_Select(".chr(36)."plugintable, \"*\", \"content_refer !='sa' AND \".".chr(36)."qry.\" \".".chr(36)."datequery.\" AND content_class REGEXP '\".e_CLASS_REGEXP.\"' ORDER BY content_datestamp DESC LIMIT 0,\".".chr(36)."content_pref[\"content_menu_recent_number_".chr(36)."menutypeid\"] )){\n";
+			$data .= "\n";
+			$data .= "	".chr(36)."text .= (".chr(36)."content_pref[\"content_menu_recent_caption_".chr(36)."menutypeid\"] != \"\" ? ".chr(36)."content_pref[\"content_menu_recent_caption_".chr(36)."menutypeid\"] : CONTENT_MENU_LAN_2).\"<br />\";\n";
+			$data .= "	while(".chr(36)."row = ".chr(36)."sql1 -> db_Fetch()){\n";
+			$data .= "\n";
+			$data .= "		".chr(36)."ICON = \"\";\n";
+			$data .= "		".chr(36)."DATE = \"\";\n";
+			$data .= "		".chr(36)."AUTHOR = \"\";\n";
+			$data .= "		".chr(36)."SUBHEADING = \"\";\n";
+			$data .= "\n";
+			$data .= "		if(".chr(36)."content_pref[\"content_menu_recent_date_".chr(36)."menutypeid\"]){\n";
+			$data .= "			".chr(36)."datestyle = (".chr(36)."content_pref[\"content_archive_datestyle_".chr(36)."menutypeid\"] ? ".chr(36)."content_pref[\"content_archive_datestyle_".chr(36)."menutypeid\"] : \"%d %b %Y\");\n";
+			$data .= "			".chr(36)."DATE = strftime(".chr(36)."datestyle, ".chr(36)."row['content_datestamp']);\n";
+			$data .= "		}\n";
+			$data .= "		if(".chr(36)."content_pref[\"content_menu_recent_author_".chr(36)."menutypeid\"]){\n";
+			$data .= "			".chr(36)."authordetails = ".chr(36)."aa -> getAuthor(".chr(36)."row['content_author']);\n";
+			$data .= "			".chr(36)."AUTHOR = ".chr(36)."authordetails[1];\n";
+			$data .= "		}\n";
+			$data .= "\n";
+			$data .= "		//subheading\n";
+			$data .= "		if(".chr(36)."content_pref[\"content_menu_recent_subheading_".chr(36)."menutypeid\"] && ".chr(36)."row['content_subheading']){\n";
+			$data .= "			if(".chr(36)."content_pref[\"content_menu_recent_subheading_char_".chr(36)."menutypeid\"] && ".chr(36)."content_pref[\"content_menu_recent_subheading_char_".chr(36)."menutypeid\"] != \"\" && ".chr(36)."content_pref[\"content_menu_recent_subheading_char_".chr(36)."menutypeid\"] != \"0\"){\n";
+			$data .= "				if(strlen(".chr(36)."row['content_subheading']) > ".chr(36)."content_pref[\"content_menu_recent_subheading_char_".chr(36)."menutypeid\"]) {\n";
+			$data .= "					".chr(36)."row['content_subheading'] = substr(".chr(36)."row['content_subheading'], 0, ".chr(36)."content_pref[\"content_menu_recent_subheading_char_".chr(36)."menutypeid\"]).".chr(36)."content_pref[\"content_menu_recent_subheading_post_".chr(36)."menutypeid\"];\n";
+			$data .= "				}\n";
+			$data .= "			}\n";
+			$data .= "			".chr(36)."SUBHEADING = ".chr(36)."row['content_subheading'];\n";
+			$data .= "		}\n";
+			$data .= "\n";
+			$data .= "		//define icon\n";
+			$data .= "		".chr(36)."recenticonwidth = \"\";\n";
+			$data .= "		if(".chr(36)."content_pref[\"content_menu_recent_icon_".chr(36)."menutypeid\"] == \"0\"){ ".chr(36)."ICON = \"\";\n";
+			$data .= "		}elseif(".chr(36)."content_pref[\"content_menu_recent_icon_".chr(36)."menutypeid\"] == \"1\"){ ".chr(36)."ICON = \"<img src='\".THEME.\"images/bullet2.gif' alt='' style='border:0;' />\";\n";
+			$data .= "		}elseif(".chr(36)."content_pref[\"content_menu_recent_icon_".chr(36)."menutypeid\"] == \"2\"){ ".chr(36)."ICON = \"&middot\";\n";
+			$data .= "		}elseif(".chr(36)."content_pref[\"content_menu_recent_icon_".chr(36)."menutypeid\"] == \"3\"){ ".chr(36)."ICON = \"&ordm;\";\n";
+			$data .= "		}elseif(".chr(36)."content_pref[\"content_menu_recent_icon_".chr(36)."menutypeid\"] == \"4\"){ ".chr(36)."ICON = \"&raquo;\";\n";
+			$data .= "		}elseif(".chr(36)."content_pref[\"content_menu_recent_icon_".chr(36)."menutypeid\"] == \"5\"){\n";
+			$data .= "			if(".chr(36)."content_pref[\"content_menu_recent_icon_".chr(36)."menutypeid\"] == \"5\"){\n";
+			$data .= "				if(".chr(36)."content_pref[\"content_menu_recent_icon_width_".chr(36)."menutypeid\"]){\n";
+			$data .= "					".chr(36)."recenticonwidth = \" width:\".".chr(36)."content_pref[\"content_menu_recent_icon_width_".chr(36)."menutypeid\"].\"px; \";\n";
+			$data .= "				}else{\n";
+			$data .= "					".chr(36)."recenticonwidth = \" width:50px; \";\n";
+			$data .= "				}\n";
+			$data .= "			}\n";
+			$data .= "			if(".chr(36)."content_pref[\"content_menu_recent_icon_".chr(36)."menutypeid\"] == \"5\" && ".chr(36)."row['content_icon'] != \"\" && file_exists(".chr(36)."content_icon_path.".chr(36)."row['content_icon'])){\n";
+			$data .= "				".chr(36)."ICON = \"<img src='\".".chr(36)."content_icon_path.".chr(36)."row['content_icon'].\"' alt='' style='\".".chr(36)."recenticonwidth.\" border:0;' />\";\n";
+			$data .= "			}\n";
+			$data .= "		}\n";
+			$data .= "\n";
+			$data .= "		//display recent list\n";
+			$data .= "		".chr(36)."text .= \"<table style='width:100%; text-align:left; border:0; margin-bottom:10px;' cellpadding='0' cellspacing='0'>\";\n";
+			$data .= "		".chr(36)."text .= \"<tr>\";\n";
+			$data .= "		".chr(36)."text .= (".chr(36)."ICON ? \"<td style='width:1%; white-space:nowrap; vertical-align:top; padding-right:5px;'><a href='\".e_PLUGIN.\"content/content.php?content.\".".chr(36)."row['content_id'].\"'>\".".chr(36)."ICON.\"</a></td>\" : \"\");\n";
+			$data .= "		".chr(36)."text .= \"<td style='width:99%; vertical-align:top;'>\";\n";
+			$data .= "		".chr(36)."text .= \"<a href='\".e_PLUGIN.\"content/content.php?content.\".".chr(36)."row['content_id'].\"'>\".".chr(36)."row['content_heading'].\"</a><br />\";\n";
+			$data .= "		".chr(36)."text .= (".chr(36)."DATE ? ".chr(36)."DATE.\"<br />\" : \"\" );\n";
+			$data .= "		".chr(36)."text .= (".chr(36)."AUTHOR ? ".chr(36)."AUTHOR.\"<br />\" : \"\" );\n";
+			$data .= "		".chr(36)."text .= (".chr(36)."SUBHEADING ? ".chr(36)."SUBHEADING.\"<br />\" : \"\" );\n";
+			$data .= "		".chr(36)."text .= \"</td>\";\n";
+			$data .= "		".chr(36)."text .= \"</tr>\";\n";
+			$data .= "		".chr(36)."text .= \"</table>\";\n";
+			$data .= "	}\n";
+			$data .= "}\n";
+			$data .= "}\n";
+			$data .= "\n";				
+			$data .= "if(!isset(".chr(36)."text)){ ".chr(36)."text = CONTENT_MENU_LAN_1; }\n";
+			$data .= chr(36)."caption = (".chr(36)."content_pref[\"content_menu_caption_".chr(36)."menutypeid\"] != \"\" ? ".chr(36)."content_pref[\"content_menu_caption_".chr(36)."menutypeid\"] : CONTENT_MENU_LAN_0.\" \".".chr(36)."menuname);\n";
+			$data .= chr(36)."ns -> tablerender(".chr(36)."caption, ".chr(36)."text, '$menufile');\n";
+			$data .= "\n";
+			$data .= "?".chr(62);
+				 
+			if(file_exists($plugindir."menus/".$menufile."_menu.php")){
+				$message = "";
+			}else{
+				$fp = @fopen($plugindir."menus/".$menufile."_menu.php", "w");
+				if (!@fwrite($fp, $data)) {
+					$message = CONTENT_ADMIN_CAT_LAN_51;
+				} else {
+					fclose($fp);
+					$message = CONTENT_ADMIN_CAT_LAN_50;
+				}
+			}
+			return $message;
+		}
+}	//close class
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/handlers/content_convert_class.php 75/e107_plugins/content/handlers/content_convert_class.php
--- 6171/e107_plugins/content/handlers/content_convert_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/handlers/content_convert_class.php	2005-12-29 16:19:37.000000000 -0600
@@ -0,0 +1,677 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        content_convert_class.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/handlers/content_convert_class.php,v $
+|		$Revision: 1.16 $
+|		$Date: 2005/12/29 22:19:37 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$plugindir		= e_PLUGIN."content/";
+$plugintable	= "pcontent";		//name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)
+$datequery		= " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") ";
+
+$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content.php';
+include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content.php');
+
+require_once($plugindir."handlers/content_class.php");
+$aa = new content;
+
+class content_convert{
+
+
+		//update content_author
+		function upgrade_1_2(){
+			global $sql;
+
+			$text = "";
+			$field1 = $sql->db_Field("pcontent",19);
+			$field2 = $sql->db_Field("pcontent",20);
+			$field3 = $sql->db_Field("pcontent",21);
+			if($field1 != "content_score" && $field2 != "content_meta" && $field3 != "content_layout"){
+				mysql_query("ALTER TABLE ".MPREFIX."pcontent ADD content_score TINYINT ( 3 ) UNSIGNED NOT NULL DEFAULT '0';");
+				mysql_query("ALTER TABLE ".MPREFIX."pcontent ADD content_meta TEXT NOT NULL;");
+				mysql_query("ALTER TABLE ".MPREFIX."pcontent ADD content_layout VARCHAR ( 255 ) NOT NULL DEFAULT '';");
+				$text = "Content Management Plugin table structure updated<br />";
+			}
+			return $text;
+		}
+
+		//update content_author
+		function upgrade_1_21(){
+			global $sql;
+			$sql = new db; $sql1 = new db;
+			$upgrade = FALSE;
+			if($sql -> db_Select("pcontent", "content_id, content_author", "content_author != '' ")){
+				while($row = $sql -> db_Fetch()){
+					if(is_numeric($row['content_author'])){
+					}else{
+						$upgrade = TRUE;
+						$tmp = explode("^", $row['content_author']);
+						if($tmp[0] == "0"){
+							$newauthor = $tmp[1].($tmp[2] ? "^".$tmp[2] : "");
+							$sql1 -> db_Update("pcontent", " content_author = '".$newauthor."' WHERE content_id='".$row['content_id']."' ");
+						}
+					}
+				}
+			}
+			if($upgrade){
+				return "Content Management Plugin : content_author updated<br />";
+			}else{
+				return FALSE;
+			}
+		}
+
+		//convert rows
+		function upgrade_1_1(){
+				global $sql, $tp, $plugintable, $eArrayStorage;
+				$plugintable	= "pcontent";
+
+				$count = "0";
+				$sql = new db;
+				$thiscount = $sql -> db_Count("pcontent", "(*)");
+				if($thiscount > 0){
+					while($row = $sql -> db_Fetch()){
+
+						//main parent
+						if($row['content_parent'] == "0"){
+							$newparent = "0";
+
+						//subcat
+						}elseif(substr($row['content_parent'],0,2) == "0."){
+							$newparent = "0".strrchr($row['content_parent'], ".");
+
+						//item
+						}elseif( strpos($row['content_parent'], ".") && substr($row['content_parent'],0,1) != "0"){
+							$newparent = substr(strrchr($row['content_parent'], "."),1);
+						}
+
+						$sql -> db_Update("pcontent", " content_parent = '".$newparent."', content_pref='' WHERE content_id='".$row['content_id']."' ");
+					}
+				}
+				return CONTENT_ADMIN_CONVERSION_LAN_58."<br /><br />".CONTENT_ADMIN_CONVERSION_LAN_46."<br />";
+		}
+
+
+
+
+		function show_main_intro(){
+						global $sql, $ns, $rs, $type, $type_id, $action, $sub_action, $id, $plugintable;
+						$plugintable	= "pcontent";
+
+						if(!is_object($sql)){ $sql = new db; }
+						$newcontent = $sql -> db_Count($plugintable, "(*)", "");
+						if($newcontent > 0){
+							return false;
+						}else{
+
+							$text .= "
+							<div style='text-align:center'>
+							<div style='width:70%; text-align:left'>
+							".$rs -> form_open("post", e_SELF, "dataform")."
+							<table class='fborder'>";
+							
+							$oldcontent = $sql -> db_Count("content", "(*)", "");
+							if($oldcontent > 0){
+								$text .= "<tr><td class='forumheader3' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_8." ".CONTENT_ADMIN_MAIN_LAN_9." ".CONTENT_ADMIN_MAIN_LAN_11."</td></tr>";
+
+								$text .= "<tr><td style='height:20px; border:0;' colspan='2'></td></tr>";
+								$text .= "<tr><td class='fcaption' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_18."</td></tr>";
+								$text .= "<tr><td class='forumheader3' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_19."</td></tr>";
+								$text .= "
+								<tr>
+									<td class='forumheader3' style='width:50%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_43."</td>
+									<td class='forumheader3' style='width:50%; white-space:nowrap;'>".$rs -> form_button("submit", "convert_table", CONTENT_ADMIN_CONVERSION_LAN_59)."</td>
+								</tr>";
+
+								$text .= "<tr><td style='height:20px; border:0;' colspan='2'></td></tr>";
+								$text .= "<tr><td class='fcaption' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_22."</td></tr>";
+								$text .= "<tr><td class='forumheader3' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_23."</td></tr>";
+								$text .= "
+								<tr>
+									<td class='forumheader3' style='width:50%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_54."</td>
+									<td class='forumheader3' style='width:50%; white-space:nowrap;'>".$rs -> form_button("submit", "create_default", CONTENT_ADMIN_CONVERSION_LAN_60)."</td>
+								</tr>";
+
+								$text .= "<tr><td style='height:20px; border:0;' colspan='2'></td></tr>";
+								$text .= "<tr><td class='fcaption' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_20."</td></tr>";
+								$text .= "<tr><td class='forumheader3' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_21."</td></tr>";
+								$text .= "
+								<tr>
+									<td class='forumheader3' style='width:50%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_56."</td>
+									<td class='forumheader3' style='width:50%; white-space:nowrap;'>".$rs -> form_button("button", "fresh", CONTENT_ADMIN_CONVERSION_LAN_61, "onclick=\"document.location='".e_PLUGIN."content/admin_content_config.php?type.0.cat.create'\"
+								")."</td>
+								</tr>";
+
+							}else{
+								$text .= "<tr><td class='fcaption' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_8." ".CONTENT_ADMIN_MAIN_LAN_9." ".CONTENT_ADMIN_MAIN_LAN_24."</td></tr>";
+								$text .= "<tr><td class='forumheader3' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_25."</td></tr>";
+								$text .= "
+								<tr>
+									<td class='forumheader3' style='width:50%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_54."</td>
+									<td class='forumheader3' style='width:50%; white-space:nowrap;'>".$rs -> form_button("submit", "create_default", CONTENT_ADMIN_CONVERSION_LAN_60)."</td>
+								</tr>";
+							}
+
+							$text .= "</table>".$rs -> form_close()."
+							</div>
+							</div>";
+
+							$ns -> tablerender(CONTENT_ADMIN_MAIN_LAN_7, $text);
+							return true;
+						}
+		}
+
+		//function to insert default preferences for a main parent
+		function insert_default_prefs($id){
+				global $sql, $aa, $plugintable, $eArrayStorage;
+				$plugintable	= "pcontent";
+				$plugindir		= e_PLUGIN."content/";
+				unset($content_pref, $tmp);
+				
+				if(!is_object($aa)){
+					require_once($plugindir."handlers/content_class.php");
+					$aa = new content;
+				}
+
+				$content_pref = $aa -> ContentDefaultPrefs($id);
+				$tmp = $eArrayStorage->WriteArray($content_pref);
+
+				$sql -> db_Update($plugintable, "content_pref='$tmp' WHERE content_id='$id' ");
+		}
+
+
+		//function to convert comments
+		function convert_comments(){
+				global $plugintable;
+				$plugintable	= "pcontent";
+
+				if(!is_object($sqlcc)){ $sqlcc = new db; }
+				$numc = $sqlcc -> db_Count("comments", "(*)", "WHERE comment_type = '1' ");
+				if($numc > 0){
+					$sqlcc -> db_Update("comments", "comment_type = '".$plugintable."' WHERE comment_type = '1' ");
+				}
+		}
+
+
+		//function to convert rating
+		function convert_rating(){
+				global $plugintable;
+				$plugintable	= "pcontent";
+
+				if(!is_object($sqlcr)){ $sqlcr = new db; }
+				$numr = $sqlcr -> db_Count("rate", "(*)", "WHERE (rate_table = 'article' || rate_table = 'review' || rate_table = 'content') ");
+				if($numr > 0){
+					$sqlcr -> db_Update("rate", "rate_table = '".$plugintable."' WHERE (rate_table = 'article' || rate_table = 'review' || rate_table = 'content') ");
+				}
+		}
+
+
+		//create main parent
+		function create_mainparent($name, $tot, $order){
+				global $sql, $aa, $plugintable, $tp;
+				$plugintable	= "pcontent";
+
+				$sql = new db;
+				$sql -> db_Select("content", "MAX(content_id) as maxcid", "", "mode=no_where");
+				list($maxcid) = $sql -> db_Fetch();
+				$newid = $maxcid + $order;
+
+				// ##### STAGE 4 : INSERT MAIN PARENT FOR ARTICLE ---------------------------------------------
+				$checkinsert = FALSE;
+				if($tot > 0){
+					//if(!is_object($sql)){ $sql = new db; }
+					$sql = new db;
+					if(!$sql -> db_Select($plugintable, "content_heading", "content_heading = '".$name."' AND content_parent = '0' ")){
+						$name = $tp -> toDB($name);
+
+						$sql -> db_Insert($plugintable, "'".$newid."', '".$name."', '', '', '', '1', '', '', '', '0', '0', '0', '0', '', '".time()."', '0', '0', '', '".$order."', '0', '', '' ");
+
+						//check if row is present in the db (is it a valid insert)
+						//if(!is_object($sql2)){ $sql2 = new db; }
+						$sql2 = new db;
+						if(!$sql2 -> db_Select($plugintable, "content_id", "content_heading = '".$name."' ")){
+							$message = CONTENT_ADMIN_CONVERSION_LAN_45;
+						}else{
+							$message = $name." ".CONTENT_ADMIN_CONVERSION_LAN_7."<br />";
+							$checkinsert = TRUE;
+
+							//select main parent id
+							$sql3 = new db;
+							//if(!is_object($sql3)){ $sql3 = new db; }
+							$sql3 -> db_Select($plugintable, "content_id", "content_heading = '".$name."' AND content_parent = '0' ");
+							list($main_id) = $sql3 -> db_Fetch();
+
+							//insert default preferences
+							$this -> insert_default_prefs($main_id);
+
+							//create menu
+							$aa -> CreateParentMenu($main_id);
+
+							$message .= $name." ".CONTENT_ADMIN_CONVERSION_LAN_8."<br />";
+						}
+					}else{
+						$message = CONTENT_ADMIN_CONVERSION_LAN_9." ".$name." ".CONTENT_ADMIN_CONVERSION_LAN_10." : ".CONTENT_ADMIN_CONVERSION_LAN_53."<br />";
+					}
+				}else{
+					$message = CONTENT_ADMIN_CONVERSION_LAN_9." ".$name." ".CONTENT_ADMIN_CONVERSION_LAN_10."<br />";
+				}
+				$create_mainparent = array($checkinsert, $message);		
+				return $create_mainparent;
+		}
+
+
+		//analayse unknown rows
+		function analyse_unknown(){
+				global $sql;
+
+				if(!is_object($sql)){ $sql = new db; }
+				$totaloldrowsunknown = $sql -> db_Select("content", "*", " NOT ( (content_parent = '1' AND content_type = '1') || (content_parent = '0' AND content_type = '1') || (content_parent = '0' AND content_type = '6') || (content_parent = '0' AND content_type = '10') || (content_type = '3' || content_type = '16') || (content_type = '0' || content_type = '15') ) ");
+
+				while($row = $sql -> db_Fetch()){
+					$unknown_bug[]		= $row['content_id']." ".$row['content_heading'];
+					$unknown_bug_id[]	= $row['content_id'];
+					$unknown_bug_type[]	= "parent=".$row['content_parent']." - type=".$row['content_type'];
+				}
+				$analyse_unknown = array($unknown_bug, $unknown_bug_id);
+				return $analyse_unknown;
+		}
+
+
+		//convert categories
+		function convert_category($name, $query, $ordernr){
+				global $sql, $plugintable, $tp;
+				$plugintable	= "pcontent";
+
+				// ##### STAGE 7 : INSERT CATEGORY ----------------------------------------------------
+				if(!is_object($sql)){ $sql = new db; }
+				if(!$sql -> db_Select("content", "*", " ".$query." ORDER BY content_id " )){
+					$cat_present = false;
+				}else{
+					$count = $ordernr;
+					$cat_present = true;
+					while($row = $sql -> db_Fetch()){
+
+						//select main parent id
+						if(!is_object($sql2)){ $sql2 = new db; }
+						$sql2 -> db_Select($plugintable, "content_id", "content_heading = '".$name."' AND content_parent = '0' ");
+						list($main_id) = $sql2 -> db_Fetch();
+
+						//summary can contain link to image in e107_images/link_icons/".$summary." THIS STILL NEEDS TO BE CHECKED
+						$newcontent_heading		= $tp -> toDB($row['content_heading']);
+						$newcontent_subheading	= ($row['content_subheading'] ? $tp -> toDB($row['content_subheading']) : "");
+						$newcontent_summary		= ($row['content_summary'] ? $tp -> toDB($row['content_summary']) : "");
+						$newcontent_text		= $tp -> toDB($row['content_content']);
+						$newcontent_author		= (is_numeric($row['content_author']) ? $row['content_author'] : "0^".$row['content_author']);
+						$newcontent_icon		= "";
+						$newcontent_attach		= "";
+						$newcontent_images		= "";
+						$newcontent_parent		= "0.".$main_id;			//make each category a first level subcat of the main parent
+						$newcontent_comment		= $row['content_comment'];
+						$newcontent_rate		= "0";
+						$newcontent_pe			= $row['content_pe_icon'];
+						$newcontent_refer		= "";
+						$newcontent_starttime	= $row['content_datestamp'];
+						$newcontent_endtime		= "0";
+						$newcontent_class		= $row['content_class'];
+						$newcontent_pref		= "";
+						$newcontent_score		= "0";
+						$newcontent_meta		= "";
+						$newcontent_layout		= "";
+
+						if(!is_object($sql3)){ $sql3 = new db; }
+						$sql3 -> db_Insert($plugintable, "'".$row['content_id']."', '".$newcontent_heading."', '".$newcontent_subheading."', '".$newcontent_summary."', '".$newcontent_text."', '".$newcontent_author."', '".$newcontent_icon."', '".$newcontent_attach."', '".$newcontent_images."', '".$newcontent_parent."', '".$newcontent_comment."', '".$newcontent_rate."', '".$newcontent_pe."', '".$newcontent_refer."', '".$newcontent_starttime."', '".$newcontent_endtime."', '".$newcontent_class."', '".$newcontent_pref."', '".$count."', '".$newcontent_score."', '".$newcontent_meta."', '".$newcontent_layout."' ");
+
+						if(!$sql3 -> db_Select($plugintable, "content_id, content_heading", "content_heading = '".$newcontent_heading."' ")){
+							$bug_cat_insert[]	= $row['content_id']." ".$row['content_heading'];
+						}else{
+							$valid_cat_insert[]	= $row['content_id']." ".$row['content_heading'];
+							$count = $count + 1;
+						}
+					}
+				}
+				$convert_category = array($cat_present, $valid_cat_insert, $bug_cat_insert, $count);
+				return $convert_category;
+		}
+
+
+		//convert rows
+		function convert_row($name, $query, $startorder){
+				global $sql, $tp, $plugintable, $eArrayStorage;
+				$plugintable	= "pcontent";
+
+				// ##### STAGE 8 : INSERT ROW -------------------------------------------------------------
+				if(!is_object($sql)){ $sql = new db; }
+				if(!$thiscount = $sql -> db_Select("content", "*", " ".$query." ORDER BY content_id " )){
+					$check_present = false;
+				}else{
+					$count = $startorder;
+					$check_present = true;
+					while($row = $sql -> db_Fetch()){
+
+						$oldcontentid = $row['content_id'];
+
+						//select main parent id
+						if(!is_object($sql2)){ $sql2 = new db; }
+						$sql2 -> db_Select($plugintable, "content_id", "content_heading = '".$name."' AND content_parent = '0' ");
+						list($main_id) = $sql2 -> db_Fetch();
+
+						//item is in main cat
+						if($row['content_parent'] == "0"){
+							$newcontent_parent = $main_id;
+
+						//item is in sub cat
+						}else{
+							//select old review cat heading
+							if(!is_object($sql3)){ $sql3 = new db; }
+							if(!$sql3 -> db_Select("content", "content_id, content_heading", "content_id = '".$row['content_parent']."' ")){
+								$bug_oldcat[]			= $row['content_id']." ".$row['content_heading'];
+								$newcontent_parent		= $main_id;
+							}else{
+								list($old_cat_id, $old_cat_heading) = $sql3 -> db_Fetch();
+
+								//select new cat id from the cat with the old_cat_heading
+								if(!is_object($sql4)){ $sql4 = new db; }
+								if(!$sql4 -> db_Select($plugintable, "content_id", "content_heading = '".$old_cat_heading."' AND content_parent = '0.".$main_id."' ")){
+									$bug_newcat[]		= $row['content_id']." ".$row['content_heading'];
+									$newcontent_parent	= $main_id;
+								}else{
+									list($new_cat_id) = $sql4 -> db_Fetch();
+									$newcontent_parent	= $new_cat_id;
+								}
+							}
+						}
+						
+						if (strstr($row['content_content'], "{EMAILPRINT}")) {
+							$row['content_content'] = str_replace("{EMAILPRINT}", "", $row['content_content']);
+						}
+
+						$newcontent_heading		= $tp -> toDB($row['content_heading']);
+						$newcontent_subheading	= ($row['content_subheading'] ? $tp -> toDB($row['content_subheading']) : "");
+						//summary can contain link to image in e107_images/link_icons/".$summary." THIS STILL NEEDS TO BE CHECKED
+						$newcontent_summary		= ($row['content_summary'] ? $tp -> toDB($row['content_summary']) : "");
+						$newcontent_text		= $tp -> toDB($row['content_content']);
+						//$newcontent_author	= (is_numeric($row['content_author']) ? $row['content_author'] : "0^".$row['content_author']);
+						$newcontent_author		= $row['content_author'];
+						$newcontent_icon		= "";
+						$newcontent_attach		= "";
+						$newcontent_images		= "";
+						$newcontent_comment		= $row['content_comment'];
+						$newcontent_rate		= "0";
+						$newcontent_pe			= $row['content_pe_icon'];
+						$newcontent_refer		= ($row['content_type'] == "15" || $row['content_type'] == "16" ? "sa" : "");
+						$newcontent_starttime	= $row['content_datestamp'];
+						$newcontent_endtime		= "0";
+						$newcontent_class		= $row['content_class'];
+						$newcontent_pref		= "";
+						$newcontent_score		= ($row['content_review_score'] && $row['content_review_score'] != "none" ? $row['content_review_score'] : "0");
+						$newcontent_meta		= "";
+						$newcontent_layout		= "";
+
+						if(!is_object($sql5)){ $sql5 = new db; }
+						$sql5 -> db_Insert($plugintable, "'".$row['content_id']."', '".$newcontent_heading."', '".$newcontent_subheading."', '".$newcontent_summary."', '".$newcontent_text."', '".$newcontent_author."', '".$newcontent_icon."', '".$newcontent_attach."', '".$newcontent_images."', '".$newcontent_parent."', '".$newcontent_comment."', '".$newcontent_rate."', '".$newcontent_pe."', '".$newcontent_refer."', '".$newcontent_starttime."', '".$newcontent_endtime."', '".$newcontent_class."', '".$newcontent_pref."', '1.".$count."', '".$newcontent_score."', '".$newcontent_meta."', '".$newcontent_layout."' ");
+
+						if(!is_object($sql6)){ $sql6 = new db; }
+						if(!$sql6 -> db_Select($plugintable, "content_id, content_heading", "content_heading = '".$newcontent_heading."' ")){
+							$bug_insert[] = $row['content_id']." ".$row['content_heading'];
+						}else{
+							$valid_insert[] = $row['content_id']." ".$row['content_heading'];
+							$count = $count + 1;
+						}
+					}
+				}
+				$convert_row = array($check_present, $count, $valid_insert, $bug_insert, $bug_oldcat, $bug_newcat);
+				return $convert_row;
+		}
+
+
+		//show output of the category conversion
+		function results_conversion_category($name, $array, $oldrows){
+
+				//no pages present
+				if($array[0] === false){
+					if( !(count($array[1]) > 0 || count($array[2]) > 0) ){
+						$text .= "<tr><td class='forumheader' colspan='2'>".CONTENT_ADMIN_CONVERSION_LAN_34." ".$name." ".CONTENT_ADMIN_CONVERSION_LAN_35."</td></tr>";
+					}
+				
+				//pages present
+				}else{
+				
+					//valid inserts
+					if(count($array[1]) > 0 ){
+						$text .= "
+						<tr>
+							<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_3." : ".count($array[1])." ".CONTENT_ADMIN_CONVERSION_LAN_38."</td>
+							<td class='forumheader3'><a style='cursor:pointer;' onclick=\"expandit('validcat_{$name}');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+								<div id='validcat_{$name}' style='display: none;'>
+									<table style='width:100%; border:0;'>";
+									for($i=0;$i<count($array[1]);$i++){
+										$text .= "
+										<tr>
+											<td style='width:25%; white-space:nowrap;'>".CONTENT_ICON_OK." ".$array[1][$i]."</td>
+											<td>".$name." ".CONTENT_ADMIN_CONVERSION_LAN_3." ".CONTENT_ADMIN_CONVERSION_LAN_26."</td>
+										</tr>";
+									}
+									$text .= "
+									</table>
+								</div>
+							</td>
+						</tr>";
+					}
+
+					//bug inserts
+					if(count($array[2]) > 0 ){
+						$text .= "
+						<tr>
+							<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_3." : ".count($array[2])." ".CONTENT_ADMIN_CONVERSION_LAN_39."</td>
+							<td class='forumheader3'><a style='cursor:pointer;' onclick=\"expandit('failedcat_{$name}');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+								<div id='failedcat_{$name}' style='display: none;'>
+									<table style='width:100%; border:0;'>";
+									for($i=0;$i<count($array[2]);$i++){
+										$text .= "
+										<tr>
+											<td style='width:25%; white-space:nowrap;'>".CONTENT_ICON_ERROR." ".$array[2][$i]."</td>
+											<td>".CONTENT_ADMIN_CONVERSION_LAN_23."</td>
+										</tr>";
+									}
+									$text .= "
+									</table>
+								</div>
+							</td>
+						</tr>";
+					}
+					$text .= "
+					<tr>
+						<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_3." : ".CONTENT_ADMIN_CONVERSION_LAN_27."</td>
+						<td class='forumheader3'>
+							<a style='cursor: pointer; cursor: hand' onclick=\"expandit('analysecat_{$name}');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+							<div id='analysecat_{$name}' style='display: none;'>
+								<table style='width:100%; border:0;'>
+								<tr><td style='width:25%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_28."</td><td>".$oldrows."</td></tr>
+								<tr><td style='width:25%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_29."</td><td>".count($array[1])."</td></tr>
+								<tr><td style='width:25%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_30."</td><td>".count($array[2])."</td></tr>
+								</table>
+							</div>
+						</td>
+					</tr>";
+				}
+				return $text;
+		}
+
+
+		//show output of the item conversion
+		function results_conversion_row($name, $array, $oldrows){
+
+				//no rows present
+				if($array[0] === false){
+					$text .= "<tr><td class='forumheader' colspan='2'>".CONTENT_ADMIN_CONVERSION_LAN_34." ".$name." ".CONTENT_ADMIN_CONVERSION_LAN_36."</td></tr>";
+				
+				//rows present
+				}else{
+				
+					//valid insert
+					if(count($array[2]) > 0 ){
+						$text .= "
+						<tr>
+							<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_6." : ".count($array[2])." ".CONTENT_ADMIN_CONVERSION_LAN_38."</td>
+							<td class='forumheader3'>
+								<a style='cursor:pointer;' onclick=\"expandit('valid_{$name}');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+								<div id='valid_{$name}' style='display: none;'>
+									<table style='width:100%; border:0;'>";
+									for($i=0;$i<count($array[2]);$i++){
+										$text .= "
+										<tr>
+											<td style='width:25%; white-space:nowrap;'>".CONTENT_ICON_OK." ".$array[2][$i]."</td>
+											<td>".$name." ".CONTENT_ADMIN_CONVERSION_LAN_6." ".CONTENT_ADMIN_CONVERSION_LAN_26."</td>
+										</tr>";
+									}
+									$text .= "
+									</table>
+								</div>
+							</td>
+						</tr>";
+					}
+					//bugs : old category
+					if(count($array[4]) > 0 ){
+						$text .= "
+						<tr>
+							<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_6." : ".count($array[4])." ".CONTENT_ADMIN_CONVERSION_LAN_31."</td>
+							<td class='forumheader3'>
+								<a style='cursor:pointer;' onclick=\"expandit('oldcat_{$name}');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+								<div id='oldcat_{$name}' style='display: none;'>
+									<table style='width:100%; border:0;'>";
+									for($i=0;$i<count($array[4]);$i++){
+										$text .= "
+										<tr>
+											<td style='width:25%; white-space:nowrap;'>".CONTENT_ICON_WARNING." ".$array[4][$i]."</td>
+											<td>".CONTENT_ADMIN_CONVERSION_LAN_32."</td>
+										</tr>";
+									}
+									$text .= "
+									</table>
+								</div>
+							</td>
+						</tr>";
+					}
+					//bugs : new category
+					if(count($array[5]) > 0 ){
+						$text .= "
+						<tr>
+							<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_6." : ".count($array[5])." ".CONTENT_ADMIN_CONVERSION_LAN_31."</td>
+							<td class='forumheader3'>
+								<a style='cursor:pointer;' onclick=\"expandit('newcat_{$name}');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+								<div id='newcat_{$name}' style='display: none;'>
+									<table style='width:100%; border:0;'>";
+									for($i=0;$i<count($array[5]);$i++){
+										$text .= "
+										<tr>
+											<td style='width:25%; white-space:nowrap;'>".CONTENT_ICON_WARNING." ".$array[5][$i]."</td>
+											<td>".CONTENT_ADMIN_CONVERSION_LAN_33."</td>
+										</tr>";
+									}
+									$text .= "
+									</table>
+								</div>
+							</td>
+						</tr>";
+					}
+					//bugs : insertion failed
+					if(count($array[3]) > 0 ){
+						$text .= "
+						<tr>
+							<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_6." : ".count($array[3])." ".CONTENT_ADMIN_CONVERSION_LAN_39."</td>
+							<td class='forumheader3'>
+								<a style='cursor: pointer; cursor: hand' onclick=\"expandit('failed_{$name}');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+								<div id='failed_{$name}' style='display: none;'>
+									<table style='width:100%; border:0;'>";
+									for($i=0;$i<count($array[3]);$i++){
+										$text .= "
+										<tr>
+											<td style='width:25%; white-space:nowrap;'>".CONTENT_ICON_ERROR." ".$array[3][$i]."</td>
+											<td>".CONTENT_ADMIN_CONVERSION_LAN_23."</td>
+										</tr>";
+									}
+									$text .= "
+									</table>
+								</div>
+							</td>
+						</tr>";
+					}
+					
+					//analyses
+					$text .= "
+					<tr>
+						<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".CONTENT_ADMIN_CONVERSION_LAN_6." : ".CONTENT_ADMIN_CONVERSION_LAN_27."</td>
+						<td class='forumheader3'>
+							<a style='cursor: pointer; cursor: hand' onclick=\"expandit('analyse_{$name}');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+							<div id='analyse_{$name}' style='display: none;'>
+								<table style='width:100%; border:0;'>
+								<tr><td style='width:25%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_28."</td><td>".$oldrows."</td></tr>
+								<tr><td style='width:25%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_29."</td><td>".count($array[2])."</td></tr>
+								<tr><td style='width:25%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_30."</td><td>".count($array[3])."</td></tr>
+								<tr><td style='width:25%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_31."</td><td>".count($array[4])."</td></tr>
+								<tr><td style='width:25%; white-space:nowrap;'>".CONTENT_ADMIN_CONVERSION_LAN_31."</td><td>".count($array[5])."</td></tr>
+								</table>
+							</div>
+						</td>
+					</tr>";
+				}
+
+
+				return $text;
+		}
+
+
+		//show output of the mainparent conversion
+		function results_conversion_mainparent($content, $review, $article){
+				$text = "<tr><td class='fcaption' colspan='2'>".CONTENT_ADMIN_CONVERSION_LAN_50."</td></tr>";
+				$text .= "
+				<tr>
+					<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".($content[0] == "1" ? CONTENT_ICON_OK : CONTENT_ICON_ERROR)." ".CONTENT_ADMIN_CONVERSION_LAN_20."</td>
+					<td class='forumheader3'>
+						<a style='cursor: pointer; cursor: hand' onclick=\"expandit('contentmain');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+						<div id='contentmain' style='display: none;'>
+							".$content[1]."
+						</div>
+					</td>
+				</tr>
+				<tr>
+					<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".($review[0] == "1" ? CONTENT_ICON_OK : CONTENT_ICON_ERROR)." ".CONTENT_ADMIN_CONVERSION_LAN_21."</td>
+					<td class='forumheader3'>
+						<a style='cursor: pointer; cursor: hand' onclick=\"expandit('reviewmain');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+						<div id='reviewmain' style='display: none;'>
+							".$review[1]."
+						</div>
+					</td>
+				</tr>
+				<tr>
+					<td class='forumheader3' style='width:5%; white-space:nowrap; vertical-align:top;'>".($article[0] == "1" ? CONTENT_ICON_OK : CONTENT_ICON_ERROR)." ".CONTENT_ADMIN_CONVERSION_LAN_22."</td>
+					<td class='forumheader3'>
+						<a style='cursor: pointer; cursor: hand' onclick=\"expandit('articlemain');\">".CONTENT_ADMIN_CONVERSION_LAN_48."</a>
+						<div id='articlemain' style='display: none;'>
+							".$article[1]."
+						</div>
+					</td>
+				</tr>";
+
+							
+
+				return $text;
+		}
+
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/handlers/content_db_class.php 75/e107_plugins/content/handlers/content_db_class.php
--- 6171/e107_plugins/content/handlers/content_db_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/handlers/content_db_class.php	2006-02-13 04:13:22.000000000 -0600
@@ -0,0 +1,509 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        /admin/review.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/handlers/content_db_class.php,v $
+|		$Revision: 1.43 $
+|		$Date: 2006/02/13 10:13:22 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$plugindir		= e_PLUGIN."content/";
+$plugintable	= "pcontent";		//name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)
+$datequery		= " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") ";
+
+if (!defined('ADMIN_WIDTH')) { define("ADMIN_WIDTH", "width:98%;"); }
+
+//icon, file, image upload
+if(isset($_POST['uploadfile'])){
+	
+	if($_POST['uploadtype']){
+		$pref['upload_storagetype'] = "1";
+		require_once(e_HANDLER."upload_handler.php");
+		$mainparent		= $aa -> getMainParent(intval($_POST['parent']));
+		$content_pref	= $aa -> getContentPref($mainparent);
+
+		if($_POST['content_id']){
+			$newpid = $_POST['content_id'];
+		}else{
+			$sql -> db_select("pcontent", "MAX(content_id) as aid", "content_id!='0' ");
+			list($aid) = $sql -> db_Fetch();
+			$newpid = $aid+1;
+		}
+	}
+
+	//icon
+	if($_POST['uploadtype'] == "1"){
+		$pref['upload_storagetype'] = "1";
+		$pathtmp		= $_POST['tmppathicon'];
+		$uploaded		= file_upload($pathtmp);
+		$new = "";
+		if($uploaded){
+			$uporg		= $uploaded[0]['name'];
+			$resize		= (isset($content_pref["content_upload_icon_size_{$mainparent}"]) && $content_pref["content_upload_icon_size_{$mainparent}"] ? $content_pref["content_upload_icon_size_{$mainparent}"] : "100");
+			if($uporg){
+				$new = $newpid."_".$uporg;
+				rename($pathtmp.$uporg, $pathtmp.$new);
+				require_once(e_HANDLER."resize_handler.php");
+				resize_image($pathtmp.$new, $pathtmp.$new, $resize, "nocopy");
+			}
+		}
+		$message = ($new ? CONTENT_ADMIN_ITEM_LAN_106 : CONTENT_ADMIN_ITEM_LAN_107);
+
+	//file
+	}elseif($_POST['uploadtype'] == "2"){
+		$pref['upload_storagetype'] = "1";
+		$pathtmp		= $_POST['tmppathfile'];
+		$uploaded		= file_upload($pathtmp);
+		$new = "";
+		if($uploaded){
+			$uporg		= $uploaded[0]['name'];
+			if($uporg){
+				$new = $newpid."_".$uporg;
+				rename($pathtmp.$uporg, $pathtmp.$new);
+			}
+		}
+		$message = ($new ? CONTENT_ADMIN_ITEM_LAN_108 : CONTENT_ADMIN_ITEM_LAN_109);
+
+	//image
+	}elseif($_POST['uploadtype'] == "3"){
+		$pref['upload_storagetype'] = "1";
+		$pathtmp		= $_POST['tmppathimage'];
+		$uploaded		= file_upload($pathtmp);
+		$new = "";
+		if($uploaded){
+			$uporg		= $uploaded[0]['name'];
+			$resize		= (isset($content_pref["content_upload_image_size_{$mainparent}"]) && $content_pref["content_upload_image_size_{$mainparent}"] ? $content_pref["content_upload_image_size_{$mainparent}"] : "500");
+			$resizethumb	= (isset($content_pref["content_upload_image_size_thumb_{$mainparent}"]) && $content_pref["content_upload_image_size_thumb_{$mainparent}"] ? $content_pref["content_upload_image_size_thumb_{$mainparent}"] : "100");
+			if($uporg){
+				$new = $newpid."_".$uporg;
+				rename($pathtmp.$uporg, $pathtmp.$new);
+				require_once(e_HANDLER."resize_handler.php");
+				resize_image($pathtmp.$new, $pathtmp.$new, $resizethumb, "copy");
+				resize_image($pathtmp.$new, $pathtmp.$new, $resize, "nocopy");
+			}
+		}
+		$message = ($new ? CONTENT_ADMIN_ITEM_LAN_110 : CONTENT_ADMIN_ITEM_LAN_111);
+	}
+}
+
+class contentdb{
+
+		//function dbContentUpdate($mode, $type){
+		function dbContent($mode, $type){
+			//$mode		: create or update
+			//$type		: none(=admin), submit, contentmanager
+			global $pref, $qs, $sql, $ns, $rs, $aa, $tp, $plugintable, $e107cache, $eArrayStorage;
+
+			$_POST['content_heading']		= $tp -> toDB($_POST['content_heading']);
+			$_POST['content_subheading']	= $tp -> toDB($_POST['content_subheading']);
+			$_POST['content_summary']		= $tp -> toDB($_POST['content_summary']);
+			if(e_WYSIWYG){
+				$_POST['content_text']		= $tp->createConstants($_POST['content_text']); // convert e107_images/ to {e_IMAGE} etc.
+			}
+			$_POST['content_text']			= $tp -> toDB($_POST['content_text']);
+			$_POST['parent']				= ($_POST['parent'] ? intval($_POST['parent']) : "0");
+			$_POST['content_class']			= ($_POST['content_class'] ? intval($_POST['content_class']) : "0");
+			$_POST['content_meta']			= $tp -> toDB($_POST['content_meta']);
+
+			if(USER){
+				if($_POST['content_author_id']){
+					if(!($_POST['content_author_id'] == USERID && $_POST['content_author_name'] == USERNAME && $_POST['content_author_email'] == USEREMAIL) ){
+						
+						$author = $_POST['content_author_id'];
+						
+						if($_POST['content_author_name'] != CONTENT_ADMIN_ITEM_LAN_14){
+							$author .= "^".$_POST['content_author_name'];
+						}
+						if($_POST['content_author_email'] != CONTENT_ADMIN_ITEM_LAN_15){
+							$author .= "^".$_POST['content_author_email'];
+						}
+						
+					}else{
+						$author = $_POST['content_author_id'];
+					}
+				}else{
+					$author = $_POST['content_author_name'];
+					if($_POST['content_author_email'] != "" && $_POST['content_author_email'] != CONTENT_ADMIN_ITEM_LAN_15){
+						$author .= "^".$_POST['content_author_email'];
+					}
+				}
+			}else{
+				$author = $_POST['content_author_name'];
+				if($_POST['content_author_email'] != "" && $_POST['content_author_email'] != CONTENT_ADMIN_ITEM_LAN_15){
+					$author .= "^".$_POST['content_author_email'];
+				}
+			}
+
+			$mainparent						= $aa -> getMainParent(intval($_POST['parent']));
+			$content_pref					= $aa -> getContentPref($mainparent);
+			
+			$content_pref["content_icon_path_tmp_{$mainparent}"] = ($content_pref["content_icon_path_tmp_{$mainparent}"] ? $content_pref["content_icon_path_tmp_{$mainparent}"] : $content_pref["content_icon_path_{$mainparent}"]."tmp/");
+			$content_pref["content_file_path_tmp_{$mainparent}"] = ($content_pref["content_file_path_tmp_{$mainparent}"] ? $content_pref["content_file_path_tmp_{$mainparent}"] : $content_pref["content_file_path_{$mainparent}"]."tmp/");
+			$content_pref["content_image_path_tmp_{$mainparent}"] = ($content_pref["content_image_path_tmp_{$mainparent}"] ? $content_pref["content_image_path_tmp_{$mainparent}"] : $content_pref["content_image_path_{$mainparent}"]."tmp/");
+			
+			$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$mainparent}"]);
+			$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$mainparent}"]);
+			$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+			$content_image_path				= $tp -> replaceConstants($content_pref["content_image_path_{$mainparent}"]);
+			$content_file_path				= $tp -> replaceConstants($content_pref["content_file_path_{$mainparent}"]);
+			$content_tmppath_icon			= $tp -> replaceConstants($content_pref["content_icon_path_tmp_{$mainparent}"]);
+			$content_tmppath_file			= $tp -> replaceConstants($content_pref["content_file_path_tmp_{$mainparent}"]);
+			$content_tmppath_image			= $tp -> replaceConstants($content_pref["content_image_path_tmp_{$mainparent}"]);
+
+			//move icon to correct folder
+			if($_POST['content_icon']){
+				$icon = $tp->toDB($_POST['content_icon']);	
+				if($icon && file_exists($content_tmppath_icon.$icon)){
+					rename($content_tmppath_icon.$icon, $content_icon_path.$icon);
+				}
+			}
+
+			$sumf = 0;
+			$sumi = 0;
+			foreach($_POST as $k => $v){
+				if(strpos($k, "content_files") === 0){
+					$sumf = $sumf+1;
+				}
+				if(strpos($k, "content_images") === 0){
+					$sumi = $sumi+1;
+				}
+			}
+			//move attachments to correct folder
+			$totalattach = "";
+			for($i=0;$i<$sumf;$i++){
+				$attach{$i} = $tp->toDB($_POST["content_files{$i}"]);
+				if($attach{$i} && file_exists($content_tmppath_file.$attach{$i})){
+					rename($content_tmppath_file.$attach{$i}, $content_file_path.$attach{$i});
+				}
+				if($attach{$i} && file_exists($content_file_path.$attach{$i})){
+					$totalattach .= "[file]".$attach{$i};
+				}
+			}
+			//move images to correct folder
+			$totalimages = "";
+			for($i=0;$i<$sumi;$i++){
+				$image{$i} = $tp->toDB($_POST["content_images{$i}"]);
+				if($image{$i} && file_exists($content_tmppath_image.$image{$i})){
+					rename($content_tmppath_image.$image{$i}, $content_image_path.$image{$i});
+				}
+				if($image{$i} && file_exists($content_tmppath_image."thumb_".$image{$i})){
+					rename($content_tmppath_image."thumb_".$image{$i}, $content_image_path."thumb_".$image{$i});
+				}
+				if($image{$i} && file_exists($content_image_path.$image{$i})){
+					$totalimages .= "[img]".$image{$i};
+				}
+			}
+
+			if($_POST['update_datestamp']){
+				$starttime = time();
+			}else{
+				if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none"){
+					$newstarttime = mktime( 0, 0, 0, intval($_POST['ne_month']), intval($_POST['ne_day']), intval($_POST['ne_year']));
+				}else{
+					$newstarttime = time();
+				}
+				if(isset($_POST['content_datestamp']) && $_POST['content_datestamp'] != "" && $_POST['content_datestamp'] != "0"){
+					if($newstarttime != $starttime){
+						$starttime = $newstarttime;
+					}else{
+						$starttime = intval($_POST['content_datestamp']);
+					}
+				}else{
+					$starttime = time();
+				}
+			}
+
+			if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none"){
+				$endtime = mktime( 0, 0, 0, intval($_POST['end_month']), intval($_POST['end_day']), intval($_POST['end_year']));
+			}else{
+				$endtime = "0";
+			}
+
+			//custom additional data tags
+			for($i=0;$i<$content_pref["content_admin_custom_number_{$mainparent}"];$i++){
+				if(isset($_POST["content_custom_key_{$i}"]) && isset($_POST["content_custom_value_{$i}"]) && $_POST["content_custom_value_{$i}"] != ""){
+					$keystring = $tp->toDB($_POST["content_custom_key_{$i}"]);
+					$custom["content_custom_{$keystring}"] = $tp->toDB($_POST["content_custom_value_{$i}"]);
+				}
+			}
+			//preset additional data tags
+			if(isset($_POST['content_custom_preset_key']) && $_POST['content_custom_preset_key']){
+				$custom['content_custom_presettags'] = $tp->toDB($_POST['content_custom_preset_key']);
+				$contentprefvalue = $eArrayStorage->WriteArray($custom);
+			}else{
+				$contentprefvalue = "";
+			}
+
+			$_POST['content_layout'] = (!$_POST['content_layout'] || $_POST['content_layout'] == "content_content_template.php" ? "" : $tp->toDB($_POST['content_layout']));
+			
+			//content_order : not added in the sql
+			//content_refer : only added in sql if posting submitted item
+			//$refer = (isset($_POST['content_refer']) && $_POST['content_refer']=='sa' ? ", content_refer='' " : "");
+
+			if($mode == "create"){
+				if($type == "submit"){
+					$refer = ($content_pref["content_submit_directpost_{$mainparent}"] ? "" : "sa");
+				}else{
+					$refer = "";
+				}
+				$sql -> db_Insert($plugintable, "'0', '".$_POST['content_heading']."', '".$_POST['content_subheading']."', '".$_POST['content_summary']."', '".$_POST['content_text']."', '".$tp->toDB($author)."', '".$icon."', '".$totalattach."', '".$totalimages."', '".$_POST['parent']."', '".intval($_POST['content_comment'])."', '".intval($_POST['content_rate'])."', '".intval($_POST['content_pe'])."', '".$refer."', '".$starttime."', '".$endtime."', '".$_POST['content_class']."', '".$contentprefvalue."', '0', '".intval($_POST['content_score'])."', '".$_POST['content_meta']."', '".$_POST['content_layout']."' ");
+
+				$e107cache->clear("$plugintable");
+				if(!$type || $type == "admin"){
+					js_location(e_SELF."?".e_QUERY.".cc");
+				}elseif($type == "contentmanager"){
+					js_location(e_SELF."?c");
+				}elseif($type == "submit"){
+					if($content_pref["content_submit_directpost_{$mainparent}"]){
+						js_location(e_SELF."?s");
+					}else{
+						js_location(e_SELF."?d");
+					}							
+				}
+			}
+
+			if($mode == "update"){
+				if($type == "submit"){
+					if(isset($_POST['content_refer']) && $_POST['content_refer']=='sa'){
+						$refer = ", content_refer='' ";
+					}else{
+						$refer = "";
+					}
+				}else{
+					if(isset($_POST['content_refer']) && $_POST['content_refer']=='sa'){
+						$refer = ", content_refer='' ";
+					}else{
+						$refer = "";
+					}
+				}
+				$sql -> db_Update($plugintable, "content_heading = '".$_POST['content_heading']."', content_subheading = '".$_POST['content_subheading']."', content_summary = '".$_POST['content_summary']."', content_text = '".$_POST['content_text']."', content_author = '".$tp->toDB($author)."', content_icon = '".$icon."', content_file = '".$totalattach."', content_image = '".$totalimages."', content_parent = '".$_POST['parent']."', content_comment = '".intval($_POST['content_comment'])."', content_rate = '".intval($_POST['content_rate'])."', content_pe = '".intval($_POST['content_pe'])."' ".$refer.", content_datestamp = '".$starttime."', content_enddate = '".$endtime."', content_class = '".$_POST['content_class']."', content_pref = '".$contentprefvalue."', content_score='".intval($_POST['content_score'])."', content_meta='".$_POST['content_meta']."', content_layout='".$_POST['content_layout']."' WHERE content_id = '".intval($_POST['content_id'])."' ");
+
+				$e107cache->clear("$plugintable");
+				$e107cache->clear("comment.$plugintable.{$_POST['content_id']}");
+				if(!$type || $type == "admin"){
+					js_location(e_SELF."?".e_QUERY.".cu");
+				}elseif($type == "contentmanager"){
+					js_location(e_SELF."?u");
+				}
+			}
+		}
+
+
+		//function dbCategoryUpdate($mode){
+		function dbCategory($mode){
+			global $pref, $sql, $ns, $rs, $aa, $tp, $plugintable, $e107cache, $content_cat_icon_path_large, $content_cat_icon_path_small;
+
+			$_POST['cat_heading']		= $tp -> toDB($_POST['cat_heading']);
+			$_POST['cat_subheading']	= $tp -> toDB($_POST['cat_subheading']);
+			if(e_WYSIWYG){
+				$_POST['cat_text']		= $tp->createConstants($_POST['cat_text']); // convert e107_images/ to {e_IMAGE} etc.
+			}
+			$_POST['cat_text']			= $tp -> toDB($_POST['cat_text']);
+			$_POST['parent']			= ($_POST['parent'] == "0" ? "0" : "0.".intval($_POST['parent']));
+			$_POST['cat_class']			= ($_POST['cat_class'] ? intval($_POST['cat_class']) : "0");
+
+			if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none"){
+				$starttime = mktime( 0, 0, 0, intval($_POST['ne_month']), intval($_POST['ne_day']), intval($_POST['ne_year']));
+			}else{
+				$starttime = time();
+			}
+			if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none"){
+				$endtime = mktime( 0, 0, 0, intval($_POST['end_month']), intval($_POST['end_day']), intval($_POST['end_year']));
+			}else{
+				$endtime = "0";
+			}
+
+			if($mode == "create"){
+				$sql -> db_Insert($plugintable, "'0', '".$_POST['cat_heading']."', '".$_POST['cat_subheading']."', '', '".$_POST['cat_text']."', '".ADMINID."', '".$tp->toDB($_POST["cat_icon"])."', '', '', '".$_POST['parent']."', '".intval($_POST['cat_comment'])."', '".intval($_POST['cat_rate'])."', '".intval($_POST['cat_pe'])."', '', '".$starttime."', '".$endtime."', '".$_POST['cat_class']."', '', '0', '0', '', '' ");
+
+				// check and insert default pref values if new main parent + create menu file
+				if($_POST['parent'] == "0"){
+					$sql -> db_Select($plugintable, "content_id", "content_parent = '0' ORDER BY content_datestamp DESC LIMIT 1");
+					list($parent_id) = $sql -> db_Fetch();
+					$content_pref = $aa -> getContentPref($parent_id);
+					$aa -> CreateParentMenu($parent_id);
+				}
+				$e107cache->clear("$plugintable");
+				js_location(e_SELF."?".e_QUERY.".pc");
+
+			}elseif($mode == "update"){
+				$sql -> db_Update($plugintable, "content_heading = '".$_POST['cat_heading']."', content_subheading = '".$_POST['cat_subheading']."', content_summary = '', content_text = '".$_POST['cat_text']."', content_author = '".ADMINID."', content_icon = '".$tp->toDB($_POST["cat_icon"])."', content_image = '', content_parent = '".$_POST['parent']."', content_comment = '".intval($_POST['cat_comment'])."', content_rate = '".intval($_POST['cat_rate'])."', content_pe = '".intval($_POST['cat_pe'])."', content_refer = '0', content_datestamp = '".$starttime."', content_enddate = '".$endtime."', content_class = '".intval($_POST['cat_class'])."' WHERE content_id = '".intval($_POST['cat_id'])."' ");
+
+				// check and insert default pref values if new main parent + create menu file
+				if($_POST['parent'] == "0"){
+					@unlink(e_PLUGIN."content/menus/content_".$_POST['menuheading']."_menu.php");
+					$content_pref = $aa -> getContentPref($_POST['cat_id']);
+					$aa -> CreateParentMenu($_POST['cat_id']);
+				}
+				$e107cache->clear("$plugintable");
+				js_location(e_SELF."?".e_QUERY.".pu");
+			}
+		}
+
+
+		function dbAssignAdmins($mode, $id, $value){
+			global $plugintable, $qs, $sql, $eArrayStorage;
+
+			if($mode == "admin"){
+				$id = intval($id);
+				$sql -> db_Select($plugintable, "content_pref", "content_id = '".intval($id)."' ");
+				$row = $sql -> db_Fetch();
+
+				//get current preferences
+				$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
+
+				//assign new preferences
+				if($value == "clear"){
+					$content_pref["content_manager_allowed_{$id}"] = "";
+				}else{
+					$content_pref["content_manager_allowed_{$id}"] = $value;
+				}
+				
+				//create new array of preferences
+				$tmp = $eArrayStorage->WriteArray($content_pref);
+
+				$sql -> db_Update($plugintable, "content_pref = '{$tmp}' WHERE content_id = '".intval($id)."' ");
+
+				$message = CONTENT_ADMIN_CAT_LAN_34;
+				return $message;
+			}else{
+				return FALSE;
+			}
+		}
+
+
+
+		function dbDelete($mode, $cat, $del_id){
+			global $plugintable, $sql, $_POST, $e107cache;
+
+			if($mode == "admin"){
+				if($cat == "cat"){
+					if($sql -> db_Delete($plugintable, "content_id='".intval($del_id)."' ")){
+						$e107cache->clear("$plugintable");
+						$message = CONTENT_ADMIN_CAT_LAN_23;
+						return $message;
+					}
+				}elseif($cat == "content"){
+					if($sql -> db_Delete($plugintable, "content_id='".intval($del_id)."' ")){
+						$e107cache->clear("$plugintable");
+						$message = CONTENT_ADMIN_ITEM_LAN_3;
+						return $message;
+					}
+				}
+			}else{
+				return FALSE;
+			}						
+		}
+
+
+		
+		function dbSetOrder($mode, $type, $order){
+			global $plugintable, $sql, $aa, $qs, $_POST, $e107cache;
+			//$mode		:	all, inc, dec
+			//$type		:	cc (category order), ai (global all items), ci (items in category)
+			//$order	:	posted values or id-currentorder
+
+			if($mode == "all"){
+				foreach ($order as $cid){
+					//each order value in the db has two numbers (a-b) where a = category item order, and b = global item order
+					//146.3.cat		:	category order
+					//35.3.ci.1-0	:	category item order
+					//35.3.ai.1-0	:	global item order
+					
+					$tmp		= explode(".", $cid);
+					$old		= explode("-", $tmp[3]);
+					$old[0]		= ($old[0] == "" ? "0" : $old[0]);
+					$old[1]		= ($old[1] == "" ? "0" : $old[1]);	
+					
+					$tmp[0]		= intval($tmp[0]);
+					$tmp[1]		= intval($tmp[1]);
+					$old[0]		= intval($old[0]);
+					$old[1]		= intval($old[1]);
+
+					if($tmp[2] == "cat"){
+						$sql->db_Update($plugintable, "content_order='".$tmp[1]."' WHERE content_id='".$tmp[0]."' " );
+
+					}elseif($tmp[2] == "ci"){
+						$sql->db_Update($plugintable, "content_order='".$tmp[1].".".$old[1]."' WHERE content_id='".$tmp[0]."' " );
+
+					}elseif($tmp[2] == "ai"){
+						$sql->db_Update($plugintable, "content_order='".$old[0].".".$tmp[1]."' WHERE content_id='".$tmp[0]."' " );
+					}
+					$message = CONTENT_ADMIN_ORDER_LAN_2;
+				}
+
+			}elseif($mode == "inc"){
+
+				$tmp = explode("-", $order);
+				$tmp[0]		= intval($tmp[0]);
+				$tmp[1]		= intval($tmp[1]);
+				$tmp[2]		= intval($tmp[2]);
+
+				if($type == "cc"){
+					$mainparent		= $aa -> getMainParent($tmp[0]);
+					$array			= $aa -> getCategoryTree("", $mainparent, TRUE);
+					$validparent	= implode(",", array_keys($array));
+					$qry			= " content_id REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND content_order='".($tmp[1]-1)."' ";
+					$sql->db_Update($plugintable, "content_order=content_order+1 WHERE ".$qry." " );
+					$sql->db_Update($plugintable, "content_order=content_order-1 WHERE content_id='".$tmp[0]."' " );
+
+				}elseif($type == "ci"){
+					$sql->db_Update($plugintable, "content_order='".$tmp[1].".".$tmp[2]."' WHERE content_parent = '".intval($qs[2])."' AND SUBSTRING_INDEX(content_order, '.', 1) = '".($tmp[1]-1)."' " );
+					$sql->db_Update($plugintable, "content_order='".($tmp[1]-1).".".$tmp[2]."' WHERE content_id='".$tmp[0]."' " );
+
+				}elseif($type == "ai"){
+					$array			= $aa -> getCategoryTree("", intval($qs[1]), TRUE);
+					$validparent	= implode(",", array_keys($array));
+					$qry			= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND SUBSTRING_INDEX(content_order, '.', -1) = '".($tmp[2]-1)."' ";
+					$sql->db_Update($plugintable, " content_order=content_order+0.1 WHERE ".$qry." " );
+					$sql->db_Update($plugintable, "content_order='".$tmp[1].".".($tmp[2]-1)."' WHERE content_id='".$tmp[0]."' " );
+
+				}
+				$message = CONTENT_ADMIN_ORDER_LAN_0;
+
+			}elseif($mode == "dec"){
+
+				$tmp = explode("-", $order);
+				$tmp[0]		= intval($tmp[0]);
+				$tmp[1]		= intval($tmp[1]);
+				$tmp[2]		= intval($tmp[2]);
+				if($type == "cc"){
+					$mainparent		= $aa -> getMainParent($tmp[0]);
+					$array			= $aa -> getCategoryTree("", $mainparent, TRUE);
+					$validparent	= implode(",", array_keys($array));
+					$qry			= " content_id REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND content_order='".($tmp[1]+1)."' ";
+					$sql->db_Update($plugintable, "content_order=content_order-1 WHERE ".$qry." " );
+					$sql->db_Update($plugintable, "content_order=content_order+1 WHERE content_id='".$tmp[0]."' " );
+
+				}elseif($type == "ci"){
+					$sql->db_Update($plugintable, "content_order='".$tmp[1].".".$tmp[2]."' WHERE content_parent = '".intval($qs[2])."' AND SUBSTRING_INDEX(content_order, '.', 1) = '".($tmp[1]+1)."' " );
+					$sql->db_Update($plugintable, "content_order='".($tmp[1]+1).".".$tmp[2]."' WHERE content_id='".$tmp[0]."' " );
+
+				}elseif($type == "ai"){
+					$array			= $aa -> getCategoryTree("", intval($qs[1]), TRUE);
+					$validparent	= implode(",", array_keys($array));
+					$qry			= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND SUBSTRING_INDEX(content_order, '.', -1) = '".($tmp[2]+1)."' ";
+					$sql->db_Update($plugintable, "content_order=content_order-0.1 WHERE ".$qry." " );
+					$sql->db_Update($plugintable, "content_order='".$tmp[1].".".($tmp[2]+1)."' WHERE content_id='".$tmp[0]."' " );
+				}
+				$message = CONTENT_ADMIN_ORDER_LAN_1;
+			}
+			$e107cache->clear("$plugintable");
+			return $message;
+		}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/handlers/content_defines.php 75/e107_plugins/content/handlers/content_defines.php
--- 6171/e107_plugins/content/handlers/content_defines.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/handlers/content_defines.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,32 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+global $plugindir;
+$plugindir = e_PLUGIN."content/";
+$imagedir = e_IMAGE."admin_images/";
+$lan_file = e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content_admin.php';
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN.'content/languages/English/lan_content_admin.php');
+$lan_file = e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content.php';
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN.'content/languages/English/lan_content.php');
+
+if (!defined('CONTENT_ICON_EDIT')) { define("CONTENT_ICON_EDIT", "<img src='".$imagedir."maintain_16.png' alt='".CONTENT_ICON_LAN_0."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_LINK')) { define("CONTENT_ICON_LINK", "<img src='".$imagedir."leave_16.png' alt='".CONTENT_ICON_LAN_15."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_DELETE')) { define("CONTENT_ICON_DELETE", "<img src='".$imagedir."delete_16.png' alt='".CONTENT_ICON_LAN_1."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_DELETE_BASE')) { define("CONTENT_ICON_DELETE_BASE", $imagedir."delete_16.png"); }
+if (!defined('CONTENT_ICON_OPTIONS')) { define("CONTENT_ICON_OPTIONS", "<img src='".$imagedir."cat_settings_16.png' alt='".CONTENT_ICON_LAN_2."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_USER')) { define("CONTENT_ICON_USER", "<img src='".$imagedir."users_16.png' alt='".CONTENT_ICON_LAN_3."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_FILE')) { define("CONTENT_ICON_FILE", "<img src='".$plugindir."images/file_16.png' alt='".CONTENT_ICON_LAN_4."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_NEW')) { define("CONTENT_ICON_NEW", "<img src='".$imagedir."articles_16.png' alt='".CONTENT_ICON_LAN_5."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_SUBMIT')) { define("CONTENT_ICON_SUBMIT", "<img src='".$plugindir."images/redo.png' alt='".CONTENT_ICON_LAN_6."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_AUTHORLIST')) { define("CONTENT_ICON_AUTHORLIST", "<img src='".$plugindir."images/personal.png' alt='".CONTENT_ICON_LAN_7."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_WARNING')) { define("CONTENT_ICON_WARNING", "<img src='".$plugindir."images/warning_16.png' alt='".CONTENT_ICON_LAN_8."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_OK')) { define("CONTENT_ICON_OK", "<img src='".$plugindir."images/ok_16.png' alt='".CONTENT_ICON_LAN_9."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_ERROR')) { define("CONTENT_ICON_ERROR", "<img src='".$plugindir."images/error_16.png' alt='".CONTENT_ICON_LAN_10."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_ORDERCAT')) { define("CONTENT_ICON_ORDERCAT", "<img src='".$plugindir."images/view_remove.png' alt='".CONTENT_ICON_LAN_11."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_ORDERALL')) { define("CONTENT_ICON_ORDERALL", "<img src='".$plugindir."images/window_new.png' alt='".CONTENT_ICON_LAN_12."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_CONTENTMANAGER')) { define("CONTENT_ICON_CONTENTMANAGER", "<img src='".$plugindir."images/manager_48.png' alt='".CONTENT_ICON_LAN_14."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_CONTENTMANAGER_SMALL')) { define("CONTENT_ICON_CONTENTMANAGER_SMALL", "<img src='".$plugindir."images/manager_16.png' alt='".CONTENT_ICON_LAN_13."' style='border:0; cursor:pointer;' />"); }
+if (!defined('CONTENT_ICON_ORDER_UP')) { define("CONTENT_ICON_ORDER_UP", "<img src='".$imagedir."up.png' alt='".CONTENT_ADMIN_ITEM_LAN_63."' />"); }
+if (!defined('CONTENT_ICON_ORDER_DOWN')) { define("CONTENT_ICON_ORDER_DOWN", "<img src='".$imagedir."down.png' alt='".CONTENT_ADMIN_ITEM_LAN_64."' />"); }
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/handlers/content_form_class.php 75/e107_plugins/content/handlers/content_form_class.php
--- 6171/e107_plugins/content/handlers/content_form_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/handlers/content_form_class.php	2006-02-27 10:27:42.000000000 -0600
@@ -0,0 +1,3494 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        /admin/review.php
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/content/handlers/content_form_class.php,v $
+|		$Revision: 1.103 $
+|		$Date: 2006/02/27 16:27:42 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$plugindir		= e_PLUGIN."content/";
+$plugintable	= "pcontent";		//name of the table used in this plugin (never remove this, as it's being used throughout the plugin !!)
+$datequery		= " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") ";
+
+$months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
+
+if (!defined('ADMIN_WIDTH')) { define("ADMIN_WIDTH", "width:98%;"); }
+
+$stylespacer = "style='border:0; height:20px;'";
+
+//only used in admin pages, for normal rows (+ in content_submit.php creation form)
+$TOPIC_ROW_NOEXPAND = "
+<tr>
+	<td class='forumheader3' style='width:20%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
+	<td class='forumheader3'>{TOPIC_FIELD}</td>
+</tr>
+";
+//only used in admin pages, for expanding rows (+ in content_submit.php creation form)
+$TOPIC_ROW = "
+<tr>
+	<td class='forumheader3' style='width:20%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
+	<td class='forumheader3' style='vertical-align:top;'>
+		<a style='cursor: pointer;' onclick='expandit(this);'>{TOPIC_HEADING}</a>
+		<div style='display: none;'>
+			<div class='smalltext'>{TOPIC_HELP}</div><br />
+			{TOPIC_FIELD}
+		</div>
+	</td>
+</tr>";
+
+//only used in admin pages, for a spacer row
+//$TOPIC_ROW_SPACER = "<tr><td $stylespacer colspan='2'></td></tr>";
+$TOPIC_ROW_SPACER = "";
+
+class contentform{
+
+		function ContentItemPreview($_POST){
+				global $ns, $sql, $aa, $qs, $tp, $mainparent;
+
+				$TRPRE = "<tr>";
+				$TRPOST = "</tr>";
+				$TDPRE1 = "<td class='forumheader3' style='white-space:nowrap;vertical-align:top;'>";
+				$TDPRE2 = "<td class='forumheader3' style='vertical-align:top;'>";
+				$TDPOST = "</td>";
+				$CONTENT_CONTENT_PREVIEW = "
+				<table class='fborder' cellpadding='0' cellspacing='0' style='width:90%; text-align:left; margin-bottom:20px;' border='1'>
+					{CONTENT_CONTENT_PREVIEW_CATEGORY}
+					{CONTENT_CONTENT_PREVIEW_HEADING}
+					{CONTENT_CONTENT_PREVIEW_SUBHEADING}
+					{CONTENT_CONTENT_PREVIEW_SUMMARY}
+					{CONTENT_CONTENT_PREVIEW_TEXT}
+					{CONTENT_CONTENT_PREVIEW_AUTHORNAME}
+					{CONTENT_CONTENT_PREVIEW_AUTHOREMAIL}
+					{CONTENT_CONTENT_PREVIEW_STARTDATE}
+					{CONTENT_CONTENT_PREVIEW_ENDDATE}
+					{CONTENT_CONTENT_PREVIEW_COMMENT}
+					{CONTENT_CONTENT_PREVIEW_RATE}
+					{CONTENT_CONTENT_PREVIEW_PE}
+					{CONTENT_CONTENT_PREVIEW_CLASS}
+					{CONTENT_CONTENT_PREVIEW_SCORE}
+					{CONTENT_CONTENT_PREVIEW_META}
+					{CONTENT_CONTENT_PREVIEW_LAYOUT}
+					{CONTENT_CONTENT_PREVIEW_CUSTOM}
+
+					{CONTENT_CONTENT_PREVIEW_PARENT}
+					{CONTENT_CONTENT_PREVIEW_ICON}
+					{CONTENT_CONTENT_PREVIEW_ATTACH}									
+					{CONTENT_CONTENT_PREVIEW_IMAGES}
+					{CONTENT_CONTENT_PREVIEW_PAGENAMES}
+				</table>\n";
+
+				$_POST['parent'] = intval($_POST['parent']);
+				$mainparent						= $aa -> getMainParent( $_POST['parent'] );
+				$content_pref					= $aa -> getContentPref($mainparent);
+				$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$mainparent}"]);
+				$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$mainparent}"]);
+				$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+				$content_image_path				= $tp -> replaceConstants($content_pref["content_image_path_{$mainparent}"]);
+				$content_file_path				= $tp -> replaceConstants($content_pref["content_file_path_{$mainparent}"]);
+				
+				$content_pref["content_icon_path_tmp_{$mainparent}"] = ($content_pref["content_icon_path_tmp_{$mainparent}"] ? $content_pref["content_icon_path_tmp_{$mainparent}"] : $content_pref["content_icon_path_{$mainparent}"]."tmp/");
+				$content_pref["content_file_path_tmp_{$mainparent}"] = ($content_pref["content_file_path_tmp_{$mainparent}"] ? $content_pref["content_file_path_tmp_{$mainparent}"] : $content_pref["content_file_path_{$mainparent}"]."tmp/");
+				$content_pref["content_image_path_tmp_{$mainparent}"] = ($content_pref["content_image_path_tmp_{$mainparent}"] ? $content_pref["content_image_path_tmp_{$mainparent}"] : $content_pref["content_image_path_{$mainparent}"]."tmp/");
+						
+				$content_tmppath_icon			= $tp -> replaceConstants($content_pref["content_icon_path_tmp_{$mainparent}"]);
+				$content_tmppath_file			= $tp -> replaceConstants($content_pref["content_file_path_tmp_{$mainparent}"]);
+				$content_tmppath_image			= $tp -> replaceConstants($content_pref["content_image_path_tmp_{$mainparent}"]);
+
+				if($sql -> db_Select("pcontent", "content_heading", " content_id='".$_POST['parent']."' ")){
+					$row = $sql -> db_Fetch();
+					$PARENT = $row['content_heading'];
+				}
+				$content_heading	= $tp -> post_toHTML($_POST['content_heading']);
+				$content_subheading	= $tp -> post_toHTML($_POST['content_subheading']);
+				$content_summary	= $tp -> post_toHTML($_POST['content_summary']);
+				if(e_WYSIWYG){
+					$_POST['content_text'] = $tp->createConstants($_POST['content_text']); // convert e107_images/ to {e_IMAGE} etc.
+				}
+				$content_text = $tp->post_toHTML($_POST['content_text'],TRUE);
+
+				$CONTENT_CONTENT_PREVIEW_CATEGORY = ($_POST['parent'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_57.$TDPOST.$TDPRE2.$PARENT.$TDPOST.$TRPOST : "");
+				$CONTENT_CONTENT_PREVIEW_HEADING = ($content_heading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_11.$TDPOST.$TDPRE2.$content_heading.$TDPOST.$TRPOST : "");
+				$CONTENT_CONTENT_PREVIEW_SUBHEADING = ($content_subheading ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_16.$TDPOST.$TDPRE2.$content_subheading.$TDPOST.$TRPOST : "");
+				$CONTENT_CONTENT_PREVIEW_SUMMARY = ($content_summary ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_17.$TDPOST.$TDPRE2.$content_summary.$TDPOST.$TRPOST : "");
+				$CONTENT_CONTENT_PREVIEW_TEXT = ($content_text ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_18.$TDPOST.$TDPRE2.$content_text.$TDPOST.$TRPOST : "");
+				$CONTENT_CONTENT_PREVIEW_AUTHORNAME = ($_POST['content_author_name'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_14.$TDPOST.$TDPRE2.$_POST['content_author_name'].$TDPOST.$TRPOST : "");
+				$CONTENT_CONTENT_PREVIEW_AUTHOREMAIL = ($_POST['content_author_email'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_10." ".CONTENT_ADMIN_ITEM_LAN_15.$TDPOST.$TDPRE2.$_POST['content_author_email'].$TDPOST.$TRPOST : "");
+				$CONTENT_CONTENT_PREVIEW_COMMENT = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_36.$TDPOST.$TDPRE2.($_POST['content_comment'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST;
+				$CONTENT_CONTENT_PREVIEW_RATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_37.$TDPOST.$TDPRE2.($_POST['content_rate'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST;
+				$CONTENT_CONTENT_PREVIEW_PE = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_38.$TDPOST.$TDPRE2.($_POST['content_pe'] ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86).$TDPOST.$TRPOST;
+				$CONTENT_CONTENT_PREVIEW_CLASS = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_39.$TDPOST.$TDPRE2.r_userclass_name($_POST['content_class']).$TDPOST.$TRPOST;
+				$CONTENT_CONTENT_PREVIEW_SCORE = ($_POST['content_score'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_40.$TDPOST.$TDPRE2.($_POST['content_score']!="none" ? $_POST['content_score']."/100" : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_40." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : "");
+				$CONTENT_CONTENT_PREVIEW_META = ($_POST['content_meta'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_53.$TDPOST.$TDPRE2.($_POST['content_meta']!="" ? $_POST['content_meta'] : CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_53." ".CONTENT_ADMIN_ITEM_LAN_119).$TDPOST.$TRPOST : "");
+				$CONTENT_CONTENT_PREVIEW_LAYOUT = ($_POST['content_layout'] ? $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_92.$TDPOST.$TDPRE2.($_POST['content_layout'] == "none" || $_POST['content_layout'] =="content_content_template.php" ? CONTENT_ADMIN_ITEM_LAN_120 : substr($_POST['content_layout'],25 ,-4)).$TDPOST.$TRPOST : "");
+
+				//start date
+				if($_POST['ne_day'] != "none" && $_POST['ne_month'] != "none" && $_POST['ne_year'] != "none"){
+				$CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.$_POST['ne_day']." ".$months[($_POST['ne_month']-1)]." ".$_POST['ne_year'].$TDPOST.$TRPOST;
+				}else{
+				$CONTENT_CONTENT_PREVIEW_STARTDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_15.$TDPOST.$TDPRE2.strftime("%d %b %Y", time()).$TDPOST.$TRPOST;
+				}
+				//end date
+				if($_POST['end_day'] != "none" && $_POST['end_month'] != "none" && $_POST['end_year'] != "none"){
+				$CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.$_POST['end_day']." ".$months[($_POST['end_month']-1)]." ".$_POST['end_year'].$TDPOST.$TRPOST;
+				}else{
+				$CONTENT_CONTENT_PREVIEW_ENDDATE = $TRPRE.$TDPRE1.CONTENT_ADMIN_DATE_LAN_16.$TDPOST.$TDPRE2.CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_DATE_LAN_16." ".CONTENT_ADMIN_ITEM_LAN_119.$TDPOST.$TRPOST;
+				}
+				$CONTENT_CONTENT_PREVIEW_CUSTOM = "";
+				
+				//custom tags
+				for($i=0;$i<$content_pref["content_admin_custom_number_{$mainparent}"];$i++){
+				if($_POST["content_custom_key_{$i}"] != "" && $_POST["content_custom_value_{$i}"] != ""){
+				$CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$_POST["content_custom_key_{$i}"].$TDPOST.$TDPRE2.$_POST["content_custom_value_{$i}"].$TDPOST.$TRPOST;
+				}
+				}
+				//custom preset tags
+				foreach($_POST['content_custom_preset_key'] as $k => $v){
+				if($k != "" && $v != ""){
+				$CONTENT_CONTENT_PREVIEW_CUSTOM .= $TRPRE.$TDPRE1.$k.$TDPOST.$TDPRE2.$v.$TDPOST.$TRPOST;
+				}
+				}
+				
+				//icon
+				if($_POST['content_icon'] && file_exists($content_tmppath_icon.$_POST['content_icon'])){
+					$ICON = "<img src='".$content_tmppath_icon.$_POST['content_icon']."' alt='' style='width:100px; border:0;' />";
+				}elseif($_POST['content_icon'] && file_exists($content_icon_path.$_POST['content_icon'])){
+					$ICON = "<img src='".$content_icon_path.$_POST['content_icon']."' alt='' style='width:100px; border:0;' />";
+				}else{
+					$ICON = CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_114." ".CONTENT_ADMIN_ITEM_LAN_119;
+				}
+				$CONTENT_CONTENT_PREVIEW_ICON = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_114.$TDPOST.$TDPRE2.$ICON.$TDPOST.$TRPOST;
+
+				//images and attachments
+				$file	= FALSE;
+				$image	= FALSE;
+				$ATTACH = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_24.$TDPOST.$TDPRE2;
+				$IMAGES = $TRPRE.$TDPRE1.CONTENT_ADMIN_ITEM_LAN_31.$TDPOST.$TDPRE2;
+				foreach($_POST as $k => $v){
+					if(strpos($k, "content_files") === 0){
+						if($v && file_exists($content_tmppath_file.$v)){
+							$ATTACH .= CONTENT_ICON_FILE." ".$v."<br />";
+							$file = TRUE;
+						}elseif($v && file_exists($content_file_path.$v)){
+							$ATTACH .= CONTENT_ICON_FILE." ".$v."<br />";
+							$file = TRUE;
+						}
+					}
+					if(strpos($k, "content_images") === 0){
+						if($v && file_exists($content_tmppath_image.$v)){
+							$IMAGES .= "<img src='".$content_tmppath_image.$v."' alt='' style='width:100px; border:0;' /> ";
+							$image	= TRUE;
+						}elseif($v && file_exists($content_image_path.$v)){
+							$IMAGES .= "<img src='".$content_image_path.$v."' alt='' style='width:100px; border:0;' /> ";
+							$image	= TRUE;
+						}
+					}
+				}
+				if($file !== TRUE){
+					$ATTACH .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_24." ".CONTENT_ADMIN_ITEM_LAN_119;
+				}
+				if($image !== TRUE){
+					$IMAGES .= CONTENT_ADMIN_ITEM_LAN_118." ".CONTENT_ADMIN_ITEM_LAN_31." ".CONTENT_ADMIN_ITEM_LAN_119;
+				}
+				$CONTENT_CONTENT_PREVIEW_ATTACH = $ATTACH.$TDPOST.$TRPOST;
+				$CONTENT_CONTENT_PREVIEW_IMAGES = $IMAGES.$TDPOST.$TRPOST;
+
+				$caption = CONTENT_ADMIN_ITEM_LAN_46." ".$_POST['content_heading'];
+				$preview = preg_replace("/\{(.*?)\}/e", '$\1', $CONTENT_CONTENT_PREVIEW);
+				$ns -> tablerender($caption, $preview);
+		}
+
+		function show_create_content($mode, $userid="", $username=""){
+						global $qs, $sql, $ns, $rs, $aa, $fl, $tp, $plugintable, $plugindir, $pref, $eArrayStorage;
+						global $message, $stylespacer, $TOPIC_ROW_SPACER, $TOPIC_ROW, $TOPIC_ROW_NOEXPAND;
+
+						$months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
+
+						//if create, first show category select (as preferences need to be loaded from the selected category)
+						if( $qs[1] == "create" && !isset($qs[2]) ){
+							$text = "
+							<div style='text-align:center;'>
+							".$rs -> form_open("post", e_SELF."?".e_QUERY."", "dataform", "", "enctype='multipart/form-data'")."
+							<table style='".ADMIN_WIDTH."' class='fborder'>
+							<tr><td class='fcaption' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_2."</td></tr>";
+
+							$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27;
+							$TOPIC_FIELD = $aa -> ShowOptionCat().$rs->form_hidden("parent", "");
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+							$text .= "</table></form></div>";
+							$caption = CONTENT_ADMIN_MAIN_LAN_2;
+							$ns->tablerender($caption, $text);
+							return;
+						}
+
+						if($mode == 'submit' || $mode=='contentmanager'){
+							$border = "border:1px solid #5d6e75;";
+							$padding = "padding:6px;";
+							$tableprop = "border-collapse: collapse; border-spacing:0px;";
+							$TOPIC_ROW_NOEXPAND = "
+							<tr>
+								<td class='forumheader3' style='".$padding." ".$border." width:30%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
+								<td class='forumheader3' style='".$padding." ".$border."'>{TOPIC_FIELD}</td>
+							</tr>";
+
+							$TOPIC_ROW = "
+							<tr>
+								<td class='forumheader3' style='".$padding." ".$border." width:30%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
+								<td class='forumheader3' style='".$padding." ".$border." vertical-align:top;'>
+									<a style='cursor: pointer;' onclick='expandit(this);'>{TOPIC_HEADING}</a>
+									<div style='display: none;'>
+										<div class='smalltext'>{TOPIC_HELP}</div><br />
+										{TOPIC_FIELD}
+									</div>
+								</td>
+							</tr>";
+
+							$TOPIC_TITLE_ROW = "<tr><td colspan='2' class='fcaption'>{TOPIC_CAPTION}</td></tr>";
+							$TOPIC_ROW_SPACER = "<tr><td style='height:20px;' colspan='2'></td></tr>";
+						}else{
+							$tableprop = "";
+							$TOPIC_ROW_SPACER = "";
+						}
+
+						if($mode == "submit"){
+							$mainparent					= $aa -> getMainParent( intval($qs[2]) );
+							$array						= $aa -> getCategoryTree("", $mainparent, FALSE);
+						}else{
+							$array						= $aa -> getCategoryTree("", "", FALSE);
+							$mainparent					= $aa -> getMainParent( (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : intval($qs[2])) );
+						}
+						
+						$content_pref					= $aa -> getContentPref($mainparent);
+						
+						$content_pref["content_icon_path_tmp_{$mainparent}"] = ($content_pref["content_icon_path_tmp_{$mainparent}"] ? $content_pref["content_icon_path_tmp_{$mainparent}"] : $content_pref["content_icon_path_{$mainparent}"]."tmp/");
+						$content_pref["content_file_path_tmp_{$mainparent}"] = ($content_pref["content_file_path_tmp_{$mainparent}"] ? $content_pref["content_file_path_tmp_{$mainparent}"] : $content_pref["content_file_path_{$mainparent}"]."tmp/");
+						$content_pref["content_image_path_tmp_{$mainparent}"] = ($content_pref["content_image_path_tmp_{$mainparent}"] ? $content_pref["content_image_path_tmp_{$mainparent}"] : $content_pref["content_image_path_{$mainparent}"]."tmp/");
+						$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$mainparent}"]);
+						$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$mainparent}"]);
+						$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+						$content_image_path				= $tp -> replaceConstants($content_pref["content_image_path_{$mainparent}"]);
+						$content_file_path				= $tp -> replaceConstants($content_pref["content_file_path_{$mainparent}"]);
+						$content_tmppath_icon			= $tp -> replaceConstants($content_pref["content_icon_path_tmp_{$mainparent}"]);
+						$content_tmppath_file			= $tp -> replaceConstants($content_pref["content_file_path_tmp_{$mainparent}"]);
+						$content_tmppath_image			= $tp -> replaceConstants($content_pref["content_image_path_tmp_{$mainparent}"]);
+
+						if(!is_object($sql)){ $sql = new db; }
+						$sql2 = new db;
+						if($mode == "contentmanager"){
+
+							$personalmanagercheck = FALSE;
+							if($sql -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".intval($qs[2])."' ")){
+								$rowpcm = $sql -> db_Fetch();
+								
+								if( isset($qs[1]) && $qs[1] == "edit" && is_numeric($qs[2]) ){
+									$sql2 -> db_Select($plugintable, "content_id, content_heading, content_parent, content_pref", " content_id='".$rowpcm['content_parent']."' ");
+									$rowpcm2 = $sql2 -> db_Fetch();
+									$pcmcheckpref = $rowpcm2['content_pref'];
+									$p = $rowpcm['content_parent'];
+								}else{
+									$pcmcheckpref = $rowpcm['content_pref'];
+									$p = $qs[2];
+								}
+
+								$pcmcontent_pref = $eArrayStorage->ReadArray($pcmcheckpref);
+
+								//assign new preferences
+								$pcm = explode(",", $pcmcontent_pref["content_manager_allowed_{$p}"]);
+								if(in_array($userid, $pcm) || getperms("0")){
+									$personalmanagercheck = TRUE;
+								}
+							}
+							if($personalmanagercheck == TRUE){
+								if($qs[1] == "edit"){
+									//use user restriction (personal admin)
+									if(isset($userid) && isset($username) ){
+										$userid = intval($userid);
+										$userquery = " AND (content_author = '".$userid."' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' OR SUBSTRING_INDEX(content_author, '^', 2) = '".$userid."^".$username."' OR content_author REGEXP '".$username."' )";
+									}else{
+										$userquery = "";
+									}
+								}
+								
+							}else{
+								header("location:".$plugindir."content_manager.php"); exit;
+							}
+
+						}else{
+							$userquery = "";
+						}
+
+						//get preferences for submit page
+						if($mode == "submit"){
+							$checkicon			= (isset($content_pref["content_submit_icon_{$mainparent}"]) ? $content_pref["content_submit_icon_{$mainparent}"] : "");
+							$checkattach		= (isset($content_pref["content_submit_attach_{$mainparent}"]) ? $content_pref["content_submit_attach_{$mainparent}"] : "");
+							$checkattachnumber	= (isset($content_pref["content_submit_files_number_{$mainparent}"]) ? $content_pref["content_submit_files_number_{$mainparent}"] : "");
+							$checkimages		= (isset($content_pref["content_submit_images_{$mainparent}"]) ? $content_pref["content_submit_images_{$mainparent}"] : "");
+							$checkimagesnumber	= (isset($content_pref["content_submit_images_number_{$mainparent}"]) ? $content_pref["content_submit_images_number_{$mainparent}"] : "");
+							$checkcomment		= (isset($content_pref["content_submit_comment_{$mainparent}"]) ? $content_pref["content_submit_comment_{$mainparent}"] : "");
+							$checkrating		= (isset($content_pref["content_submit_rating_{$mainparent}"]) ? $content_pref["content_submit_rating_{$mainparent}"] : "");
+							$checkscore			= (isset($content_pref["content_submit_score_{$mainparent}"]) ? $content_pref["content_submit_score_{$mainparent}"] : "");
+							$checkpe			= (isset($content_pref["content_submit_pe_{$mainparent}"]) ? $content_pref["content_submit_pe_{$mainparent}"] : "");
+							$checkvisibility	= (isset($content_pref["content_submit_visibility_{$mainparent}"]) ? $content_pref["content_submit_visibility_{$mainparent}"] : "");
+							$checkmeta			= (isset($content_pref["content_submit_meta_{$mainparent}"]) ? $content_pref["content_submit_meta_{$mainparent}"] : "");
+							$checkcustom		= (isset($content_pref["content_submit_customtags_{$mainparent}"]) ? $content_pref["content_submit_customtags_{$mainparent}"] : "");
+							$checkcustomnumber	= (isset($content_pref["content_submit_custom_number_{$mainparent}"]) ? $content_pref["content_submit_custom_number_{$mainparent}"] : "");
+							$checklayout		= (isset($content_pref["content_submit_layout_{$mainparent}"]) ? $content_pref["content_submit_layout_{$mainparent}"] : "");
+							$checkpreset		= (isset($content_pref["content_submit_presettags_{$mainparent}"]) ? $content_pref["content_submit_presettags_{$mainparent}"] : "");
+						
+						//get preferences for admin area; posted submitted item.
+						}elseif($mode == "sa"){
+
+							//show all preferences from the submit options. if submit pref is not set, check if create prefs are set and use those
+							$checkicon = (isset($content_pref["content_submit_icon_{$mainparent}"]) ? $content_pref["content_submit_icon_{$mainparent}"] : (isset($content_pref["content_admin_icon_{$mainparent}"]) ? $content_pref["content_admin_icon_{$mainparent}"] : ""));
+							
+							$checkattach = (isset($content_pref["content_submit_attach_{$mainparent}"]) ? $content_pref["content_submit_attach_{$mainparent}"] : (isset($content_pref["content_admin_attach_{$mainparent}"]) ? $content_pref["content_admin_attach_{$mainparent}"] : ""));
+							
+							$checkattachnumber = (isset($content_pref["content_submit_files_number_{$mainparent}"]) ? $content_pref["content_submit_files_number_{$mainparent}"] : (isset($content_pref["content_admin_files_number_{$mainparent}"]) ? $content_pref["content_admin_files_number_{$mainparent}"] : ""));
+							
+							$checkimages = (isset($content_pref["content_submit_images_{$mainparent}"]) ? $content_pref["content_submit_images_{$mainparent}"] : (isset($content_pref["content_admin_images_{$mainparent}"]) ? $content_pref["content_admin_images_{$mainparent}"] : ""));
+							
+							$checkimagesnumber = (isset($content_pref["content_submit_images_number_{$mainparent}"]) ? $content_pref["content_submit_images_number_{$mainparent}"] : (isset($content_pref["content_admin_images_number_{$mainparent}"]) ? $content_pref["content_admin_images_number_{$mainparent}"] : ""));
+							
+							$checkcomment = (isset($content_pref["content_submit_comment_{$mainparent}"]) ? $content_pref["content_submit_comment_{$mainparent}"] : (isset($content_pref["content_admin_comment_{$mainparent}"]) ? $content_pref["content_admin_comment_{$mainparent}"] : ""));
+							
+							$checkrating = (isset($content_pref["content_submit_rating_{$mainparent}"]) ? $content_pref["content_submit_rating_{$mainparent}"] : (isset($content_pref["content_admin_rating_{$mainparent}"]) ? $content_pref["content_admin_rating_{$mainparent}"] : ""));
+							
+							$checkscore = (isset($content_pref["content_submit_score_{$mainparent}"]) ? $content_pref["content_submit_score_{$mainparent}"] : (isset($content_pref["content_admin_score_{$mainparent}"]) ? $content_pref["content_admin_score_{$mainparent}"] : ""));
+							
+							$checkpe = (isset($content_pref["content_submit_pe_{$mainparent}"]) ? $content_pref["content_submit_pe_{$mainparent}"] : (isset($content_pref["content_admin_pe_{$mainparent}"]) ? $content_pref["content_admin_pe_{$mainparent}"] : ""));
+							
+							$checkvisibility = (isset($content_pref["content_submit_visibility_{$mainparent}"]) ? $content_pref["content_submit_visibility_{$mainparent}"] : (isset($content_pref["content_admin_visibility_{$mainparent}"]) ? $content_pref["content_admin_visibility_{$mainparent}"] : ""));
+							
+							$checkmeta = (isset($content_pref["content_submit_meta_{$mainparent}"]) ? $content_pref["content_submit_meta_{$mainparent}"] : (isset($content_pref["content_admin_meta_{$mainparent}"]) ? $content_pref["content_admin_meta_{$mainparent}"] : ""));
+							
+							$checkcustom = (isset($content_pref["content_submit_customtags_{$mainparent}"]) ? $content_pref["content_submit_customtags_{$mainparent}"] : (isset($content_pref["content_admin_customtags_{$mainparent}"]) ? $content_pref["content_admin_customtags_{$mainparent}"] : ""));
+							
+							$checkcustomnumber = (isset($content_pref["content_submit_custom_number_{$mainparent}"]) && $content_pref["content_submit_custom_number_{$mainparent}"] != "0" ? $content_pref["content_submit_custom_number_{$mainparent}"] : (isset($content_pref["content_admin_custom_number_{$mainparent}"]) ? $content_pref["content_admin_custom_number_{$mainparent}"] : ""));
+							
+							$checklayout = (isset($content_pref["content_submit_layout_{$mainparent}"]) ? $content_pref["content_submit_layout_{$mainparent}"] : (isset($content_pref["content_admin_layout_{$mainparent}"]) ? $content_pref["content_admin_layout_{$mainparent}"] : ""));
+
+							$checkpreset = (isset($content_pref["content_submit_presettags_{$mainparent}"]) ? $content_pref["content_submit_presettags_{$mainparent}"] : (isset($content_pref["content_admin_presettags_{$mainparent}"]) ? $content_pref["content_admin_presettags_{$mainparent}"] : ""));
+
+						//normal admin content create preferences
+						}else{
+							$checkicon			= (isset($content_pref["content_admin_icon_{$mainparent}"]) ? $content_pref["content_admin_icon_{$mainparent}"] : "");
+							$checkattach		= (isset($content_pref["content_admin_attach_{$mainparent}"]) ? $content_pref["content_admin_attach_{$mainparent}"] : "");
+							$checkattachnumber	= (isset($content_pref["content_admin_files_number_{$mainparent}"]) ? $content_pref["content_admin_files_number_{$mainparent}"] : "");
+							$checkimages		= (isset($content_pref["content_admin_images_{$mainparent}"]) ? $content_pref["content_admin_images_{$mainparent}"] : "");
+							$checkimagesnumber	= (isset($content_pref["content_admin_images_number_{$mainparent}"]) ? $content_pref["content_admin_images_number_{$mainparent}"] : "");
+							$checkcomment		= (isset($content_pref["content_admin_comment_{$mainparent}"]) ? $content_pref["content_admin_comment_{$mainparent}"] : "");
+							$checkrating		= (isset($content_pref["content_admin_rating_{$mainparent}"]) ? $content_pref["content_admin_rating_{$mainparent}"] : "");
+							$checkscore			= (isset($content_pref["content_admin_score_{$mainparent}"]) ? $content_pref["content_admin_score_{$mainparent}"] : "");
+							$checkpe			= (isset($content_pref["content_admin_pe_{$mainparent}"]) ? $content_pref["content_admin_pe_{$mainparent}"] : "");
+							$checkvisibility	= (isset($content_pref["content_admin_visibility_{$mainparent}"]) ? $content_pref["content_admin_visibility_{$mainparent}"] : "");
+							$checkmeta			= (isset($content_pref["content_admin_meta_{$mainparent}"]) ? $content_pref["content_admin_meta_{$mainparent}"] : "");
+							$checkcustom		= (isset($content_pref["content_admin_customtags_{$mainparent}"]) ? $content_pref["content_admin_customtags_{$mainparent}"] : "");
+							$checkcustomnumber	= (isset($content_pref["content_admin_custom_number_{$mainparent}"]) ? $content_pref["content_admin_custom_number_{$mainparent}"] : "");
+							$checklayout		= (isset($content_pref["content_admin_layout_{$mainparent}"]) ? $content_pref["content_admin_layout_{$mainparent}"] : "");
+							$checkpreset		= (isset($content_pref["content_admin_presettags_{$mainparent}"]) ? $content_pref["content_admin_presettags_{$mainparent}"] : "");
+						}
+						if($mode == "contentmanager"){ // used in contentmanager
+							$authordetails = $aa -> getAuthor(USERID);
+						}
+						if( !isset($authordetails) ){
+							$authordetails = $aa -> getAuthor(USERID);
+						}
+
+						if( ($qs[1] == "edit" || $qs[1] == "sa") && is_numeric($qs[2]) && !isset($_POST['preview_content']) && !isset($message)){
+							if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ")){
+								header("location:".e_SELF."?content"); exit;
+							}else{
+								$row = $sql -> db_Fetch();
+
+								$row['content_heading']		= $tp -> toForm($row['content_heading']);
+								$row['content_subheading']	= $tp -> toForm($row['content_subheading']);
+								$row['content_summary']		= $tp -> toForm($row['content_summary']);
+								if(e_WYSIWYG){
+									$row['content_text']	= $tp->toHTML($row['content_text'],$parseBB = TRUE); // parse the bbcodes to we can edit as html.
+									$row['content_text']	= $tp->replaceConstants($row['content_text'],TRUE); // eg. replace {e_IMAGE} with e107_images/ and NOT ../e107_images
+								}else{
+									$row['content_text']	= $tp -> toForm($row['content_text']);
+								}
+								$row['content_meta']		= $tp -> toForm($row['content_meta']);
+								$authordetails				= $aa -> getAuthor($row['content_author']);
+							}
+						}
+
+						if(isset($_POST['preview_content'])){
+							$this -> ContentItemPreview($_POST);
+						}
+
+						//re-prepare the posted fields for the form (after preview)
+						if( isset($_POST['preview_content']) || isset($message) ){
+
+								$row['content_parent']				= $_POST['parent'];
+								$row['content_heading']				= $tp -> post_toForm($_POST['content_heading']);
+								$row['content_subheading']			= $tp -> post_toForm($_POST['content_subheading']);
+								$row['content_summary']				= $tp -> post_toForm($_POST['content_summary']);
+								if(e_WYSIWYG){
+									$row['content_text'] = $tp->toHTML($_POST['content_text'],$parseBB = TRUE); // parse the bbcodes to we can edit as html.
+									$row['content_text'] = $tp->replaceConstants($_POST['content_text'],TRUE); // eg. replace {e_IMAGE} with e107_images/ and NOT ../e107_images
+								}else{
+									$row['content_text'] = $_POST['content_text'];
+								}
+								$authordetails[0]					= $_POST['content_author_id'];
+								$authordetails[1]					= $_POST['content_author_name'];
+								$authordetails[2]					= $_POST['content_author_email'];
+								$ne_day								= $_POST['ne_day'];
+								$ne_month							= $_POST['ne_month'];
+								$ne_year							= $_POST['ne_year'];
+								$end_day							= $_POST['end_day'];
+								$end_month							= $_POST['end_month'];
+								$end_year							= $_POST['end_year'];
+								$row['content_comment']				= $_POST['content_comment'];
+								$row['content_rate']				= $_POST['content_rate'];
+								$row['content_pe']					= $_POST['content_pe'];
+								$row['content_class']				= $_POST['content_class'];
+								$row['content_refer']				= $_POST['content_refer'];
+								$row['content_datestamp']			= $_POST['content_datestamp'];
+								$row['content_score']				= $_POST['content_score'];
+								$row['content_meta']				= $_POST['content_meta'];
+								$row['content_layout']				= $_POST['content_layout'];
+								$row['content_icon']				= $_POST['content_icon'];
+
+								//images and attachments
+								foreach($_POST as $k => $v){
+									if(strpos($k, "content_files") === 0){
+										$row['content_file'] .= "[file]".$v;
+									}
+									if(strpos($k, "content_images") === 0){
+										$row['content_image'] .= "[img]".$v;
+									}
+								}
+								//custom tags
+								for($i=0;$i<$content_pref["content_admin_custom_number_{$mainparent}"];$i++){
+									$keystring = $tp -> post_toForm($_POST["content_custom_key_{$i}"]);
+									$custom["content_custom_{$keystring}"] = $tp -> post_toForm($_POST["content_custom_value_{$i}"]);
+								}
+								//preset tags
+								foreach($_POST['content_custom_preset_key'] as $k => $v){
+									$k = $tp -> post_toForm($k);
+									$custom['content_custom_presettags'][$k] = $tp -> post_toForm($v);
+								}
+						}
+
+						$content_author_id		= (isset($authordetails[0]) && $authordetails[0] != "" ? $authordetails[0] : USERID);
+						$content_author_name	= (isset($authordetails[1]) && $authordetails[1] != "" ? $authordetails[1] : USERNAME);
+						$content_author_email	= (isset($authordetails[2]) ? $authordetails[2] : USEREMAIL);
+
+						$formurl = e_SELF."?".e_QUERY;
+						$text = "
+						<div style='text-align:center;'>
+						".$rs -> form_open("post", $formurl, "dataform", "", "enctype='multipart/form-data'")."
+						<table style='".$tableprop." ".ADMIN_WIDTH."' class='fborder'>";
+
+						$hidden = "";
+						if($mode == "contentmanager"){
+							if($qs[1] == "edit"){
+								$hidden = $rs -> form_hidden("parent", $row['content_parent']);
+							}else{
+								$hidden = $rs -> form_hidden("parent", intval($qs[2]));
+							}
+						}else{
+							if($mode == "submit"){
+								$parent = "submit";
+							}else{
+								$parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($row['content_parent']) ? $row['content_parent'] : "") );
+							}
+							//category parent
+							$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27;
+							$TOPIC_FIELD = $aa -> ShowOptionCat($parent).$rs->form_hidden("parent", "");
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+							//$text .= $TOPIC_ROW_SPACER;
+						}
+
+						//heading
+						$row['content_heading'] = (isset($row['content_heading']) ? $row['content_heading'] : "");
+						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_11;
+						$TOPIC_FIELD = $rs -> form_text("content_heading", 74, $row['content_heading'], 250).$hidden;
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+						//subheading
+						$row['content_subheading'] = (isset($row['content_subheading']) ? $row['content_subheading'] : "");
+						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_16;
+						$TOPIC_FIELD = $rs -> form_text("content_subheading", 74, $row['content_subheading'], 250);
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+						
+						//summary
+						$row['content_summary'] = (isset($row['content_summary']) ? $row['content_summary'] : "");
+						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_17;
+						$TOPIC_FIELD = $rs -> form_textarea("content_summary", 74, 5, $row['content_summary']);
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+						//text
+						
+						$row['content_text'] = (isset($row['content_text']) ? $row['content_text'] : "");
+						require_once(e_HANDLER."ren_help.php");
+						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_18;
+						$insertjs = (!$pref['wysiwyg'] ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : "");
+						
+						//$row['content_text'] = str_replace("&#039;", "'", $row['content_text']);
+						$TOPIC_FIELD = $rs -> form_textarea("content_text", 74, 20, $row['content_text'], $insertjs)."<br />";
+						//$TOPIC_FIELD = "<textarea class='tbox' name='content_text' cols='70' rows='10' ".$insertjs." >".$row['content_text']."</textarea>";
+							
+						if (!$pref['wysiwyg']) { $TOPIC_FIELD .= $rs -> form_text("helpb", 90, '', '', "helpbox")."<br />".display_help("helpb"); }
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+						//$text .= $TOPIC_ROW_SPACER;
+
+						//author
+						$content_author_name_value	= ($content_author_name ? $content_author_name : CONTENT_ADMIN_ITEM_LAN_14);
+						$content_author_name_js		= ($content_author_name ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_name.value=='".CONTENT_ADMIN_ITEM_LAN_14."'){document.getElementById('dataform').content_author_name.value='';}\"");
+						$content_author_email_value	= ($content_author_email ? $content_author_email : CONTENT_ADMIN_ITEM_LAN_15);
+						$content_author_email_js	= ($content_author_email ? "" : "onfocus=\"if(document.getElementById('dataform').content_author_email.value=='".CONTENT_ADMIN_ITEM_LAN_15."'){document.getElementById('dataform').content_author_email.value='';}\"");
+
+						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_51;
+						$TOPIC_FIELD = "(".CONTENT_ADMIN_ITEM_LAN_71.")<br />
+							<table style='width:100%; text-align:left;'>
+							<tr><td>".CONTENT_ADMIN_ITEM_LAN_14."</td><td>".$rs -> form_text("content_author_name", 70, $content_author_name_value, 100, "tbox", "", "", $content_author_name_js )."</td></tr>
+							<tr><td>".CONTENT_ADMIN_ITEM_LAN_15."</td><td>".$rs -> form_text("content_author_email", 70, $content_author_email_value, 100, "tbox", "", "", $content_author_email_js )."
+							".$rs -> form_hidden("content_author_id", $content_author_id)."
+							</td></tr></table>";
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+						if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0" && $row['content_datestamp'] != ""){
+							$startdate	= getdate($row['content_datestamp']);
+							$ne_day		= $startdate['mday'];
+							$ne_month	= $startdate['mon'];
+							$ne_year	= $startdate['year'];
+						}else{
+							$ne_day		= (isset($ne_day) ? $ne_day : "0");
+							$ne_month	= (isset($ne_month) ? $ne_month : "0");
+							$ne_year	= (isset($ne_year) ? $ne_year : "0");
+						}
+
+						$smarray = getdate();
+						$current_year = $smarray['year'];
+
+						//start date
+						$TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_15;
+						$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_73;
+						$TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_17;
+						$TOPIC_FIELD = "
+							".$rs -> form_select_open("ne_day")."
+							".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none");
+							for($count=1; $count<=31; $count++){
+								$TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_day) && $ne_day == $count ? "1" : "0"), $count);
+							}
+							$TOPIC_FIELD .= $rs -> form_select_close()."
+							".$rs -> form_select_open("ne_month")."
+							".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none");
+							for($count=1; $count<=12; $count++){
+								$TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($ne_month) && $ne_month == $count ? "1" : "0"), $count);
+							}
+							$TOPIC_FIELD .= $rs -> form_select_close()."
+							".$rs -> form_select_open("ne_year")."
+							".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none");
+							for($count=($current_year-5); $count<=($current_year+1); $count++){
+								$TOPIC_FIELD .= $rs -> form_option($count, (isset($ne_year) && $ne_year == $count ? "1" : "0"), $count);
+							}
+							$TOPIC_FIELD .= $rs -> form_select_close()."
+						";
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+
+						if(isset($row['content_enddate']) && $row['content_enddate'] != "0" && $row['content_enddate'] != ""){
+							$enddate	= getdate($row['content_enddate']);
+							$end_day	= $enddate['mday'];
+							$end_month	= $enddate['mon'];
+							$end_year	= $enddate['year'];
+						}else{
+							$end_day	= (isset($end_day) ? $end_day : "0");
+							$end_month	= (isset($end_month) ? $end_month : "0");
+							$end_year	= (isset($end_year) ? $end_year : "0");
+						}
+
+						//end date
+						$TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_16;
+						$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_74;
+						$TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_18;
+						$TOPIC_FIELD = "
+							".$rs -> form_select_open("end_day")."
+							".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none");
+							for($count=1; $count<=31; $count++){
+								$TOPIC_FIELD .= $rs -> form_option($count, (isset($end_day) && $end_day == $count ? "1" : "0"), $count);
+							}
+							$TOPIC_FIELD .= $rs -> form_select_close()."
+							".$rs -> form_select_open("end_month")."
+							".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none");
+							for($count=1; $count<=12; $count++){
+								$TOPIC_FIELD .= $rs -> form_option($months[($count-1)], (isset($end_month) && $end_month == $count ? "1" : "0"), $count);
+							}
+							$TOPIC_FIELD .= $rs -> form_select_close()."
+							".$rs -> form_select_open("end_year")."
+							".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none");
+							for($count=($current_year-5); $count<=($current_year+1); $count++){
+								$TOPIC_FIELD .= $rs -> form_option($count, (isset($end_year) && $end_year == $count ? "1" : "0"), $count);
+							}
+							$TOPIC_FIELD .= $rs -> form_select_close()."
+						";
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+						//$text .= $TOPIC_ROW_SPACER;
+						if( $checkicon || $checkattach || $checkimages ){
+							//$text .= $TOPIC_ROW_SPACER;
+
+							//upload icon
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_104;
+							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_112;
+							$TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_113;
+							
+							$rejectlist			= array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', 'thumb_*');
+							$iconlist			= $fl->get_files($content_tmppath_icon,"",$rejectlist);
+							$filelist			= $fl->get_files($content_tmppath_file,"",$rejectlist);
+							$imagelist			= $fl->get_files($content_tmppath_image,"",$rejectlist);
+
+							$TOPIC_FIELD = "";
+								if(!FILE_UPLOADS){
+									$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_21."</b>";
+								}else{
+									if(!is_writable($content_tmppath_icon)){
+										$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_icon." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
+									}
+									if(!is_writable($content_tmppath_file)){
+										$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_file." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
+									}
+									if(!is_writable($content_tmppath_image)){
+										$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_tmppath_image." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
+									}
+									$js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" ";
+									$TOPIC_FIELD .= "<br />
+									<input class='tbox' type='file' name='file_userfile[]'  size='36' /> 
+										".$rs -> form_select_open("uploadtype")."
+										".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_114, "0", "1")."
+										".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_115, "0", "2")."
+										".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_116, "0", "3")."
+										".$rs -> form_select_close()."
+									<input type='hidden' name='tmppathicon' value='".$content_tmppath_icon."' />
+									<input type='hidden' name='tmppathfile' value='".$content_tmppath_file."' />
+									<input type='hidden' name='tmppathimage' value='".$content_tmppath_image."' />
+									<input class='button' type='submit' name='uploadfile' value='".CONTENT_ADMIN_ITEM_LAN_104."' $js />";
+								}
+							$TOPIC_FIELD .= "<br />";
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+						}
+
+						if($checkicon){
+							//icon
+							$row['content_icon'] = (isset($row['content_icon']) ? $row['content_icon'] : "");
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_20;
+							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_75;
+							$TOPIC_HELP = "";
+							$TOPIC_FIELD = "
+								".$rs -> form_text("content_icon", 60, $row['content_icon'], 100)."
+								".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divicon')\"")."
+								<div id='divicon' style='{head}; display:none'>";
+								if(empty($iconlist)){
+									$TOPIC_FIELD .= CONTENT_ADMIN_ITEM_LAN_121;
+								}else{
+									foreach($iconlist as $icon){
+										if(file_exists($icon['path']."thumb_".$icon['fname'])){
+											$img = "<img src='".$icon['path']."thumb_".$icon['fname']."' style='width:100px; border:0' alt='' />";
+										}else{
+											$img = "<img src='".$icon['path'].$icon['fname']."' style='width:100px; border:0' alt='' />";
+										}
+										$TOPIC_FIELD .= "<a href=\"javascript:insertext('".$icon['fname']."','content_icon','divicon')\">".$img."</a> ";
+									}
+								}
+								$TOPIC_FIELD .= "</div>";
+
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+						}
+
+						if($checkattach){
+							//file
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_24;
+							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_76;
+							$TOPIC_HELP = "";
+							$TOPIC_FIELD = "";
+							$filetmp = explode("[file]", $row['content_file']);
+							foreach($filetmp as $key => $value) { 
+								if($value == "") { 
+									unset($filetmp[$key]); 
+								} 
+							} 
+							$attachments = array_values($filetmp);
+							for($i=0;$i<$checkattachnumber;$i++){
+								$k=$i+1;
+								$num = (strlen($k) == 1 ? "0".$k : $k);
+								$attachments[$i] = ($attachments[$i] ? $attachments[$i] : "");
+
+								//choose file
+								$TOPIC_FIELD .= "
+								<div style='padding:2px;'>
+								".$num." ".$rs -> form_text("content_files".$i."", 60, $attachments[$i], 100)."
+								".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divfile".$i."')\"")."
+								<div id='divfile".$i."' style='{head}; display:none'>";
+								if(empty($filelist)){
+									$TOPIC_FIELD .= CONTENT_ADMIN_ITEM_LAN_122;
+								}else{
+									foreach($filelist as $file){
+										$TOPIC_FIELD .= CONTENT_ICON_FILE." <a href=\"javascript:insertext('".$file['fname']."','content_files".$i."','divfile".$i."')\">".$file['fname']."</a><br />";
+									}
+								}
+								$TOPIC_FIELD .= "</div></div>";
+							}
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+						}
+
+						if($checkimages){
+							//image
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_31;
+							$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_77;
+							$TOPIC_HELP = "";
+							$TOPIC_FIELD = "";
+							$imagestmp = explode("[img]", $row['content_image']);
+							foreach($imagestmp as $key => $value) { 
+								if($value == "") { 
+									unset($imagestmp[$key]); 
+								} 
+							} 
+							$imagesarray = array_values($imagestmp);
+							for($i=0;$i<$checkimagesnumber;$i++){
+								$k=$i+1;
+								$num = (strlen($k) == 1 ? "0".$k : $k);
+								$imagesarray[$i] = ($imagesarray[$i] ? $imagesarray[$i] : "");
+
+								//choose image
+								$TOPIC_FIELD .= "
+								<div style='padding:2px;'>
+								".$num." ".$rs -> form_text("content_images".$i."", 60, $imagesarray[$i], 100)."
+								".$rs -> form_button("button", '', CONTENT_ADMIN_ITEM_LAN_105, "onclick=\"expandit('divimage".$i."')\"")."
+								<div id='divimage".$i."' style='{head}; display:none'>";
+								if(empty($imagelist)){
+									$TOPIC_FIELD .= CONTENT_ADMIN_ITEM_LAN_123;
+								}else{
+									foreach($imagelist as $image){
+										if(file_exists($image['path']."thumb_".$image['fname'])){
+											$img = "<img src='".$image['path']."thumb_".$image['fname']."' style='width:100px; border:0' alt='' />";
+										}else{
+											$img = "<img src='".$image['path'].$image['fname']."' style='width:100px; border:0' alt='' />";
+										}
+										$TOPIC_FIELD .= "<a href=\"javascript:insertext('".$image['fname']."','content_images".$i."','divimage".$i."')\">".$img."</a> ";
+									}
+								}
+								$TOPIC_FIELD .= "</div></div>";								
+							}
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+						}
+
+						if($checkcomment || $checkrating || $checkpe || $checkvisibility || $checkscore || $checkmeta || $checklayout ){
+							//$text .= $TOPIC_ROW_SPACER;
+						}
+						if($checkcomment){
+							//comment
+							$row['content_comment'] = (isset($row['content_comment']) ? $row['content_comment'] : "");
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_36;
+							$TOPIC_FIELD = "
+							".$rs -> form_radio("content_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
+							".$rs -> form_radio("content_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86."
+							";
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+						}
+
+						if($checkrating){
+							//rating
+							$row['content_rate'] = (isset($row['content_rate']) ? $row['content_rate'] : "");
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_37;
+							$TOPIC_FIELD = "
+							".$rs -> form_radio("content_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
+							".$rs -> form_radio("content_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86."
+							";
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+						}
+
+						if($checkpe){
+							//print/email/pdf icons
+							$row['content_pe'] = (isset($row['content_pe']) ? $row['content_pe'] : "");
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_38;
+							$TOPIC_FIELD = "
+							".$rs -> form_radio("content_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
+							".$rs -> form_radio("content_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86."
+							";
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+						}
+
+						if($checkvisibility){
+							//userclass
+							$row['content_class'] = (isset($row['content_class']) ? $row['content_class'] : "");
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_39;
+							$TOPIC_FIELD = r_userclass("content_class",$row['content_class'], "CLASSES");
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+						}
+
+						if($checkscore){
+							//score
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_40;
+							$TOPIC_FIELD = "
+								".$rs -> form_select_open("content_score")."
+								".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_41, 0, "none");
+								for($a=1; $a<=100; $a++){
+									$TOPIC_FIELD .= $rs -> form_option($a, ($row['content_score'] == $a ? "1" : "0"), $a);
+								}
+								$TOPIC_FIELD .= $rs -> form_select_close();
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+						}
+
+						if($checkmeta){
+							//meta
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_53;
+							$TOPIC_FIELD = CONTENT_ADMIN_ITEM_LAN_70."<br />".$rs -> form_text("content_meta", 74, $row['content_meta'], 250);
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+						}
+
+						if($checklayout){
+							global $fl;
+
+							if(!isset($content_pref["content_theme_{$mainparent}"])){
+								$dir = $plugindir."templates/default";
+							}else{
+								if(file_exists($plugindir."templates/".$content_pref["content_theme_{$mainparent}"]."/content_content_template.php")){
+									$dir = $plugindir."templates/".$content_pref["content_theme_{$mainparent}"];
+								}else{
+									$dir = $plugindir."templates/default";
+								}
+							}
+							//get_files($path, $fmask = '', $omit='standard', $recurse_level = 0, $current_level = 0, $dirs_only = FALSE)
+							$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', '.bak');
+							$templatelist = $fl->get_files($dir,"content_content",$rejectlist);
+
+							//template
+							$check = "";
+							if(isset($row['content_layout']) && $row['content_layout'] != ""){
+								$check = $row['content_layout'];
+							}else{
+								if(isset($content_pref["content_layout_{$mainparent}"])){
+									$check = $content_pref["content_layout_{$mainparent}"];
+								}
+							}
+							$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_92;
+							$TOPIC_FIELD = "
+							".$rs -> form_select_open("content_layout")."
+							".$rs -> form_option(CONTENT_ADMIN_ITEM_LAN_94, 0, "none");
+							foreach($templatelist as $template){
+								$templatename = substr($template['fname'], 25, -4);
+								$templatename = ($template['fname'] == "content_content_template.php" ? "default" : $templatename);
+								$TOPIC_FIELD .= $rs -> form_option($templatename, ($check == $template['fname'] ? "1" : "0"), $template['fname']);
+							}
+							$TOPIC_FIELD .= $rs -> form_select_close();
+							$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+						}else{
+							$hiddenlayout = $rs -> form_hidden("content_layout", $content_pref["content_layout_{$mainparent}"]);
+						}
+
+						if( $checkcustom && $checkcustomnumber ){
+							//$text .= $TOPIC_ROW_SPACER;
+						}
+						
+						if(!(isset($_POST['preview_content']) || isset($message))){
+							if(isset($row['content_pref']) && $row['content_pref']){
+								$custom = $eArrayStorage->ReadArray($row['content_pref']);
+							}
+						}
+
+						//custom data
+						$existing_custom = "0";
+						$TOPIC_TOPIC = CONTENT_ADMIN_ITEM_LAN_54;
+						$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_84;
+						$TOPIC_HELP = CONTENT_ADMIN_ITEM_LAN_68;
+						$TOPIC_CHECK_VALID = FALSE;
+						$TOPIC_FIELD = "";
+						if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD = "<table style='width:100%; border:0;'>"; }
+						if(!empty($custom)){
+							foreach($custom as $k => $v){
+								if(substr($k,0,22) != "content_custom_preset_" && $k != "content_custom_presettags"){
+									$key = substr($k,15);
+
+									$key	= $tp -> post_toForm($key);
+									$v		= $tp -> post_toForm($v);
+
+									if($checkcustom && $checkcustomnumber){
+										$TOPIC_FIELD .= "
+										<tr>
+											<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_key_".$existing_custom."", 20, $key, 100)."</td>
+											<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_value_".$existing_custom."", 70, $v, 250)."</td>
+										</tr>";
+									}else{
+										$TOPIC_FIELD .= "
+										".$rs -> form_hidden("content_custom_key_".$existing_custom, $key)."
+										".$rs -> form_hidden("content_custom_value_".$existing_custom, $v);
+										$TOPIC_CHECK_VALID = TRUE;
+									}
+									$existing_custom = $existing_custom + 1;
+								}
+							}
+						}
+
+						if($checkcustom && $checkcustomnumber){
+							$TOPIC_CHECK_VALID = TRUE;
+							for($i=$existing_custom;$i<$checkcustomnumber;$i++){
+									$TOPIC_FIELD .= "
+									<tr>
+										<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_key_".$i."", 20, "", 100)."</td>
+										<td class='forumheader3' style='border:0;'>".$rs -> form_text("content_custom_value_".$i."", 70, "", 250)."</td>
+									</tr>";
+							}
+						}
+						if($checkcustom && $checkcustomnumber){ $TOPIC_FIELD .= "</table>"; }
+						if($TOPIC_CHECK_VALID){ $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW); }
+						
+						//preset custom data fields
+						if(count($content_pref["content_custom_preset_key"]) > 0){
+							//$text .= $TOPIC_ROW_SPACER;
+						}
+						$hidden = "";
+						for($i=0;$i<count($content_pref["content_custom_preset_key"]);$i++){
+							$value = "";
+							if(!empty($content_pref["content_custom_preset_key"][$i])){
+								if($checkpreset){
+									$text .= $this -> parseCustomPresetTag($content_pref["content_custom_preset_key"][$i], $custom['content_custom_presettags']);
+								}else{
+									$tmp = explode("^", $content_pref["content_custom_preset_key"][$i]);
+									if(is_array($custom['content_custom_presettags'][$tmp[0]])){
+										$tmp[0] = $tp -> post_toForm($tmp[0]);
+										$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][day]", $custom['content_custom_presettags'][$tmp[0]][day]);
+										$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][month]", $custom['content_custom_presettags'][$tmp[0]][month]);
+										$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]][year]", $custom['content_custom_presettags'][$tmp[0]][year]);
+									}else{
+										$tmp[0] = $tp -> post_toForm($tmp[0]);
+										$hidden .= $rs -> form_hidden("content_custom_preset_key[$tmp[0]]", $custom['content_custom_presettags'][$tmp[0]]);
+									}
+								}
+							}
+						}
+
+						$text .= $TOPIC_ROW_SPACER."
+						<tr>
+							<td colspan='2' style='text-align:center' class='forumheader'>".($hidden ? $hidden : "").($hiddenlayout ? $hiddenlayout : "");
+							
+							$js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" ";
+							if($qs[1] == "edit" || $qs[1] == "sa" || isset($_POST['editp']) ){
+								if($qs[1] == "sa"){
+								$text .= $rs -> form_hidden("content_refer", $row['content_refer']);
+								}
+								$text .= $rs -> form_hidden("content_datestamp", $row['content_datestamp']);
+								$text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js);
+								$text .= $rs -> form_button("submit", "update_content", ($qs[1] == "sa" ? CONTENT_ADMIN_ITEM_LAN_43 : CONTENT_ADMIN_ITEM_LAN_45), $js );
+								$text .= $rs -> form_hidden("content_id", $qs[2]);
+								$text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".CONTENT_ADMIN_ITEM_LAN_42;
+							}else{
+								$text .= $rs -> form_button("submit", "preview_content", (isset($_POST['preview_content']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js);
+								$text .= $rs -> form_button("submit", "create_content", CONTENT_ADMIN_ITEM_LAN_44, $js);								
+							}
+							$text .= "
+							</td>
+						</tr>
+
+						</table>
+						</form>
+						</div>";
+
+						$caption = ($qs[1] == "edit" ? CONTENT_ADMIN_ITEM_LAN_45 : CONTENT_ADMIN_ITEM_LAN_44);
+						$ns -> tablerender($caption, $text);
+		}
+
+
+		function parseCustomPresetTag($tag, $values){
+			global $rs, $TOPIC_ROW_NOEXPAND, $months, $tp;
+
+			$tmp = explode("^", $tag);
+
+			$str = "";
+			if($tmp[1] == "text"){
+					$str = $rs -> form_text("content_custom_preset_key[{$tmp[0]}]", $tmp[2], $tp -> post_toForm($values[$tmp[0]]), $tmp[3], "tbox", "", "", "");
+
+			}elseif($tmp[1] == "area"){
+					$str = $rs -> form_textarea("content_custom_preset_key[{$tmp[0]}]", $tmp[2], $tmp[3], $tp -> post_toForm($values[$tmp[0]]), "", "", "", "", "");
+
+			}elseif($tmp[1] == "select"){
+					$str = $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}]", "");
+					$str .= $rs -> form_option($tmp[2], ($values[$tmp[0]] == $tmp[2] ? "1" : "0"), "", "");
+					for($i=3;$i<count($tmp);$i++){
+						$tmp[$i] = $tp -> post_toForm($tmp[$i]);
+						$str .= $rs -> form_option($tmp[$i], ($values[$tmp[0]] == $tmp[$i] ? "1" : "0"), $tmp[$i], "");
+					}				
+					$str .= $rs -> form_select_close();
+				
+			}elseif($tmp[1] == "date"){
+					$str = $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][day]", "")."
+					".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, "0", "");
+					for($i=1;$i<=31;$i++){
+						$str .= $rs -> form_option($i, ($values[$tmp[0]]['day'] == $i ? "1" : "0"), $i, "");
+					}
+					$str .= $rs -> form_select_close();
+
+					$str .= $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][month]", "")."
+					".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, "0", "");
+					for($i=1;$i<=12;$i++){
+						$str .= $rs -> form_option($months[($i-1)], ($values[$tmp[0]]['month'] == $i ? "1" : "0"), $i, "");
+					}
+					$str .= $rs -> form_select_close();
+
+					$str .= $rs -> form_select_open("content_custom_preset_key[{$tmp[0]}][year]", "")."
+					".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, "0", "");
+					for($i=$tmp[2];$i<=$tmp[3];$i++){
+						$str .= $rs -> form_option($i, ($values[$tmp[0]]['year'] == $i ? "1" : "0"), $i, "");
+					}
+					$str .= $rs -> form_select_close();
+			
+			}elseif($tmp[1] == "radio"){
+					for($i=2;$i<count($tmp);$i++){
+						$str .= $rs -> form_radio("content_custom_preset_key[{$tmp[0]}]", $tmp[$i], ($values[$tmp[0]] == $tmp[$i] ? "1" : "0"), "", "")." ".$tmp[$i];
+						$i++;					
+					}
+
+			}elseif($tmp[1] == "checkbox"){
+					$str = $rs -> form_checkbox("content_custom_preset_key[{$tmp[0]}]", $tp -> post_toForm($tmp[2]), ($values[$tmp[0]] == $tmp[2] ? "1" : "0"), "", "");
+			}
+
+			$TOPIC_TOPIC = $tmp[0];
+			$TOPIC_FIELD = $str;
+			$text = preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			return $text;
+		}
+
+
+
+		function show_manage_content($mode, $userid="", $username=""){
+			global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $eArrayStorage;
+
+			if($mode != "contentmanager"){
+				//category parent
+				global $TOPIC_TOPIC, $TOPIC_FIELD, $TOPIC_ROW_NOEXPAND;
+				$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27;
+				$parent = (is_numeric($qs[1]) ? $qs[1] : "");
+				$TOPIC_FIELD = $aa -> ShowOptionCat($parent).$rs->form_hidden("parent", "");
+				$text = "<div style='text-align:center'><table style='".ADMIN_WIDTH."' class='fborder'>
+				<tr><td class='fcaption' colspan='2'>".CONTENT_ADMIN_MAIN_LAN_2."</td></tr>";
+				$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+				$text .= "</table></div>";
+				$caption = CONTENT_ADMIN_MAIN_LAN_2;
+				$ns -> tablerender($caption, $text);
+			}
+			
+			if(!isset($qs[1])){
+				return;
+			}
+
+			$mainparent						= $aa -> getMainParent($qs[1]);
+			$content_pref					= $aa -> getContentPref($mainparent);
+			$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$mainparent}"]);
+			$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$mainparent}"]);
+			$content_icon_path				= $tp -> replaceConstants($content_pref["content_icon_path_{$mainparent}"]);
+			$content_image_path				= $tp -> replaceConstants($content_pref["content_image_path_{$mainparent}"]);
+			$content_file_path				= $tp -> replaceConstants($content_pref["content_file_path_{$mainparent}"]);
+
+			if($mode == "contentmanager"){
+				$personalmanagercheck = FALSE;
+				if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " content_id='".intval($qs[1])."' ")){
+					$rowpcm = $sql -> db_Fetch();
+					$pcmcontent_pref = $eArrayStorage->ReadArray($rowpcm['content_pref']);
+
+					//assign new preferences
+					$pcm = explode(",", $pcmcontent_pref["content_manager_allowed_{$rowpcm['content_id']}"]);
+					if(in_array($userid, $pcm) || getperms("0")){
+						$personalmanagercheck = TRUE;
+					}
+				}
+				if($personalmanagercheck == TRUE){
+					$qryuser = "";
+					if(getperms("0")){
+						$userid = USERID;
+						$username = USERNAME;
+					}else{
+						//use user restriction (personal admin)
+						if(isset($userid) && isset($username) ){
+							$userid = intval($userid);
+							$qryuser = " AND (content_author = '".$userid."' OR SUBSTRING_INDEX(content_author, '^', 1) = '".$userid."' OR SUBSTRING_INDEX(content_author, '^', 2) = '".$userid."^".$username."' OR content_author REGEXP '".$username."' )";
+						}
+					}
+					$formtarget	= $plugindir."content_manager.php?content.".intval($qs[1]);
+					$qrycat		= " content_parent = '".intval($qs[1])."' ";
+					$qryfirst	= " content_parent = '".intval($qs[1])."' ";
+					$qryletter	= "";
+					
+				}else{
+					header("location:".$plugindir."content_manager.php"); exit;
+				}
+			}else{
+				$array			= $aa -> getCategoryTree("", intval($qs[1]), TRUE);
+				$validparent	= implode(",", array_keys($array));
+				$qrycat			= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+				$qryuser = "";
+				if( !(isset($qs[2]) && is_numeric($qs[2])) ){
+					$formtarget	= e_SELF."?content.".intval($qs[1]);
+					$qryfirst	= " ".$qrycat." ";							
+					$qryletter	= "";
+				}
+			}
+			
+			$text = "";
+			// -------- SHOW FIRST LETTERS FIRSTNAMES ------------------------------------
+			if(!is_object($sql)){ $sql = new db; }
+			$distinctfirstletter = $sql -> db_Select($plugintable, " DISTINCT(content_heading) ", "content_refer != 'sa' AND ".$qryfirst." ".$qryuser." ORDER BY content_heading ASC ");
+			while($row = $sql -> db_Fetch()){
+				$head = $tp->toHTML($row['content_heading'], TRUE);
+				if(ord($head) < 128) {
+					$head_sub = strtoupper(substr($head,0,1));
+				}else{
+					$head_sub = substr($head,0,2);
+				}
+				$arrletters[] = $head_sub;
+			}
+			$arrletters = array_unique($arrletters);
+			$arrletters = array_values($arrletters);
+			sort($arrletters);
+
+			if ($distinctfirstletter == 0){
+					$text .= "<div style='text-align:center'>".CONTENT_ADMIN_ITEM_LAN_4."</div>";
+					$ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_5, $text);
+					return;
+
+			}elseif ($distinctfirstletter != 1){
+					
+					$text .= "
+					<div style='text-align:center'>
+					<form method='post' action='".$formtarget."'>
+					<table class='fborder' style='".ADMIN_WIDTH."'>
+					<tr><td colspan='2' class='fcaption'>".CONTENT_ADMIN_ITEM_LAN_6."</td></tr>
+					<tr><td colspan='2' class='forumheader3'>";
+					for($i=0;$i<count($arrletters);$i++){
+						if($arrletters[$i]!= ""){
+							$text .= "<input class='button' style='width:20' type='submit' name='letter' value='".strtoupper($arrletters[$i])."' />";
+						}
+					}
+					$text .= "
+					<input class='button' style='width:20' type='submit' name='letter' value='all' />
+					</td>
+					</tr>
+					</table>
+					</form>
+					</div>";
+			}
+			// ---------------------------------------------------------------------------
+
+			// -------- CHECK FOR FIRST LETTER SUBMISSION --------------------------------
+			$letter=(isset($_POST['letter']) ? $_POST['letter'] : "");
+			if ($letter != "" && $letter != "all" ) { $qryletter .= " AND content_heading LIKE '".$tp->toDB($letter)."%' "; }else{ $qryletter .= ""; }
+			
+			$qryitem = " ".$qrycat." AND content_refer != 'sa' ".$qryletter." ".$qryuser." ORDER BY content_datestamp DESC";
+			// ---------------------------------------------------------------------------
+
+			$sql2 = new db;						
+			if(!$content_total = $sql2 -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_author, content_icon", $qryitem)){
+				$text .= "<div style='text-align:center'>".CONTENT_ADMIN_ITEM_LAN_4."</div>";
+			}else{
+				if($content_total < 50 || isset($letter)){
+					$text .= "
+					<div style='text-align:center'>
+					".$rs -> form_open("post", e_SELF."?".e_QUERY, "deletecontentform","","", "")."
+					<table style='".ADMIN_WIDTH."' class='fborder'>
+					<tr>
+					<td class='fcaption' style='width:5%; text-align:center;'>".CONTENT_ADMIN_ITEM_LAN_8."</td>
+					<td class='fcaption' style='width:5%; text-align:center;'>".CONTENT_ADMIN_ITEM_LAN_9."</td>
+					<td class='fcaption' style='width:10%; text-align:left;'>".CONTENT_ADMIN_ITEM_LAN_10."</td>
+					<td class='fcaption' style='width:70%; text-align:left;'>".CONTENT_ADMIN_ITEM_LAN_11."</td>
+					<td class='fcaption' style='width:10%; text-align:center;'>".CONTENT_ADMIN_ITEM_LAN_12."</td>
+					</tr>";
+					while($row = $sql2 -> db_Fetch()){
+						$delete_heading	= str_replace("&#39;", "\'", $row['content_heading']);
+						$authordetails	= $aa -> getAuthor($row['content_author']);
+						$caticon		= $content_icon_path.$row['content_icon'];
+						$deleteicon		= CONTENT_ICON_DELETE;
+						$cid			= $row['content_id'];
+						$row['content_heading']		= $tp->toHTML($row['content_heading'], TRUE, "");
+						$row['content_subheading']	= $tp->toHTML($row['content_subheading'], TRUE, "");
+						$text .= "
+						<tr>
+						<td class='forumheader3' style='width:5%; text-align:center'>".$cid."</td>
+						<td class='forumheader3' style='width:5%; text-align:center'>".($row['content_icon'] ? "<img src='".$caticon."' alt='' style='width:50px; vertical-align:middle' />" : "&nbsp;")."</td>
+						<td class='forumheader3' style='width:10%; text-align:left'>".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."</td>
+						<td class='forumheader3' style='width:70%; text-align:left;'>
+							<a href='".$plugindir."content.php?content.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+							".$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")."</td>
+						<td class='forumheader3' style='width:10%; text-align:center; white-space:nowrap; vertical-align:top;'>
+							<a href='".e_SELF."?content.edit.".$cid."'>".CONTENT_ICON_EDIT."</a> 
+							<input type='image' title='".CONTENT_ICON_LAN_1."' name='delete[content_{$cid}]' src='".CONTENT_ICON_DELETE_BASE."' onclick=\"return jsconfirm('".$tp->toJS(CONTENT_ADMIN_JS_LAN_1."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$cid." : ".$delete_heading."]")."')\"/>
+						</td>
+						</tr>";
+					}
+					$text .= "</table>
+					".$rs -> form_close()."
+					</div>";
+				} else {
+					$text .= "<br /><div style='text-align:center'>".CONTENT_ADMIN_ITEM_LAN_7."</div>";
+				}
+			}
+			$ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_5, $text);
+		}
+
+
+
+		function show_submitted(){
+			global $qs, $rs, $ns, $aa, $plugintable, $tp;
+
+			if(!is_object($sql)){ $sql = new db; }
+			if(!$content_total = $sql -> db_Select($plugintable, "content_id, content_heading, content_subheading, content_author, content_icon, content_parent", "content_refer = 'sa' ")){
+				$text .= "<div style='text-align:center'>".CONTENT_ADMIN_ITEM_LAN_50."</div>";
+			}else{
+				$array = $aa -> getCategoryTree("", "", FALSE);
+
+				$text = "
+				<div style='text-align:center'>
+				".$rs -> form_open("post", e_SELF, "submittedform","","", "")."
+				<table style='".ADMIN_WIDTH."' class='fborder'>
+				<tr>
+				<td style='width:5%; text-align:center' class='fcaption'>".CONTENT_ADMIN_ITEM_LAN_8."</td>
+				<td style='width:5%; text-align:center' class='fcaption'>".CONTENT_ADMIN_ITEM_LAN_9."</td>
+				<td style='width:15%; text-align:left' class='fcaption'>".CONTENT_ADMIN_ITEM_LAN_48."</td>
+				<td style='width:15%; text-align:left' class='fcaption'>".CONTENT_ADMIN_ITEM_LAN_10."</td>
+				<td style='width:50%; text-align:left' class='fcaption'>".CONTENT_ADMIN_ITEM_LAN_11."</td>
+				<td style='width:10%; text-align:center' class='fcaption'>".CONTENT_ADMIN_ITEM_LAN_12."</td>
+				</tr>";
+				while($row = $sql -> db_Fetch()){
+
+					if(array_key_exists($row['content_parent'], $array)){
+						$mainparent			= $array[$row['content_parent']][0];
+						$mainparentheading	= $array[$row['content_parent']][1]." [".$array[$row['content_parent']][count($array[$row['content_parent']])-1]."]";
+						$content_pref		= $aa -> getContentPref($mainparent);
+						$iconpath			= ($content_pref["content_icon_path_{$mainparent}"] ? $content_pref["content_icon_path_{$mainparent}"] : "{e_PLUGIN}content/images/icon/" );
+						$content_icon_path	= $tp -> replaceConstants($iconpath);
+						$icon				= $content_icon_path.$row['content_icon'];
+					}
+					$delete_heading			= str_replace("&#39;", "\'", $row['content_heading']);										
+					$authordetails			= $aa -> getAuthor($row['content_author']);
+					$delid					= $row['content_id'];
+
+					$row['content_heading']		= $tp->toHTML($row['content_heading'], TRUE, "");
+					$row['content_subheading']	= $tp->toHTML($row['content_subheading'], TRUE, "");
+						
+					$text .= "
+					<tr>
+					<td class='forumheader3' style='width:5%; text-align:center'>".$delid."</td>
+					<td class='forumheader3' style='width:5%; text-align:center'>
+						".($row['content_icon'] ? "<img src='".$icon."' alt='' style='width:50px; vertical-align:middle' />" : "&nbsp;")."
+					</td>
+					<td class='forumheader3' style='width:15%; text-align:left'>".$mainparentheading."</td>
+					<td class='forumheader3' style='width:15%; text-align:left'>
+						".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")."	".$authordetails[1]."
+					</td>
+					<td class='forumheader3' style='width:75%; text-align:left;'>
+						".$row['content_heading']." ".($row['content_subheading'] ? "<br />[".$row['content_subheading']."]" : "")."
+					</td>
+					<td class='forumheader3' style='width:5%; text-align:center; white-space:nowrap;'>
+						<a href='".e_SELF."?content.sa.".$delid."'>".CONTENT_ICON_EDIT."</a>
+						<input type='image' title='".CONTENT_ICON_LAN_1."' name='delete[submitted_{$delid}]' src='".CONTENT_ICON_DELETE_BASE."' onclick=\"return jsconfirm('".$tp->toJS(CONTENT_ADMIN_JS_LAN_10."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$delid." : ".$delete_heading."]")."')\"/>
+					</td>
+					</tr>";
+				}
+				$text .= "</table>
+				".$rs -> form_close()."
+				</div>";
+			}
+			$ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_49, $text);
+		}
+
+
+
+		function show_manage($mode){
+			global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer, $eArrayStorage;
+
+			$catarray	= $aa -> getCategoryTree("", "", FALSE);
+			$array		= array_keys($catarray);
+
+			if(!is_array($array)){
+				$text = "<div style='text-align:center;'>".CONTENT_ADMIN_CAT_LAN_9."</div>";
+			}else{
+				$text = "
+				<div style='text-align:center'>
+				".$rs -> form_open("post", e_SELF."?".$qs[0], "catform","","", "")."
+				<table style='".ADMIN_WIDTH."' class='fborder'>
+				<tr>
+				<td class='fcaption' style='width:5%'>".CONTENT_ADMIN_CAT_LAN_24."</td>
+				<td class='fcaption' style='width:5%'>".CONTENT_ADMIN_CAT_LAN_25."</td>
+				<td class='fcaption' style='width:15%'>".CONTENT_ADMIN_CAT_LAN_18."</td>
+				<td class='fcaption' style='width:65%'>".CONTENT_ADMIN_CAT_LAN_19."</td>
+				<td class='fcaption' style='width:10%; text-align:center'>".CONTENT_ADMIN_CAT_LAN_20."</td>
+				</tr>";
+
+				if(!is_object($sql)){ $sql = new db; }
+				foreach($array as $catid){
+					if(!$category_total = $sql -> db_Select($plugintable, "*", "content_id='".intval($catid)."' ")){
+						$text .= "<div style='text-align:center;'>".CONTENT_ADMIN_CAT_LAN_9."</div>";
+					}else{
+						$row = $sql -> db_Fetch();
+
+						$content_pref					= $aa -> getContentPref($catarray[$catid][0]);
+						$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$catarray[$catid][0]}"]);
+						$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$catarray[$catid][0]}"]);
+						$delete_heading					= str_replace("&#39;", "\'", $row['content_heading']);
+						$authordetails					= $aa -> getAuthor($row['content_author']);
+						$caticon						= $content_cat_icon_path_large.$row['content_icon'];
+
+						$pre = "";
+						if($row['content_parent'] == "0"){		//main parent level
+							$class			= "forumheader";
+							$mainparentid	= $row['content_id'];
+						}else{												//sub level
+							$class = "forumheader3";
+							for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){
+								$pre .= "_";
+							}
+						}
+
+						$pcmusers = "";
+						if($mode == "category"){
+							$options = "<a href='".e_SELF."?cat.edit.".$catid."'>".CONTENT_ICON_EDIT."</a>
+							<input type='image' title='".CONTENT_ICON_LAN_1."' name='delete[cat_{$catid}]' src='".CONTENT_ICON_DELETE_BASE."' onclick=\"return jsconfirm('".$tp->toJS(CONTENT_ADMIN_JS_LAN_9."\\n\\n".CONTENT_ADMIN_JS_LAN_0."\\n\\n[".CONTENT_ADMIN_JS_LAN_6." ".$catid." : ".$delete_heading."]\\n\\n")."')\"/>";
+						
+						}elseif($mode == "manager"){
+							$options = "<a href='".e_SELF."?manager.".intval($catid)."'>".CONTENT_ICON_CONTENTMANAGER_SMALL."</a>";
+							if(isset($row['content_pref'])){
+								$pcmcontent_pref = $eArrayStorage->ReadArray($row['content_pref']);
+							}
+							if(isset($pcmcontent_pref["content_manager_allowed_{$catid}"])){
+								$pcm		= explode(",", $pcmcontent_pref["content_manager_allowed_{$catid}"]);
+								if($pcm[0]==""){ unset($pcm[0]); }
+								$pcmusers	= count($pcm);
+								$options	.= " ".($pcmusers ? "(".$pcmusers." ".($pcmusers == 1 ? CONTENT_ADMIN_CAT_LAN_54 : CONTENT_ADMIN_CAT_LAN_55).")" : "");
+							}
+						}
+						$row['content_heading']		= $tp->toHTML($row['content_heading'], TRUE, "");
+						$row['content_subheading']	= $tp->toHTML($row['content_subheading'], TRUE, "");
+
+						$text .= "
+						".($row['content_parent'] == 0 ? "<tr><td colspan='5' $stylespacer></td></tr>" : "")."
+						<tr>
+						<td class='".$class."' style='width:5%; text-align:left'>".$catid."</td>
+						<td class='".$class."' style='width:5%; text-align:center'>".($row['content_icon'] ? "<img src='".$caticon."' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
+						<td class='".$class."' style='width:15%'>".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."</td>
+						<td class='".$class."' style='width:65%; white-space:nowrap;'>
+							 <a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+							".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")."											
+						</td>
+						<td class='".$class."' style='width:10%; text-align:left; white-space:nowrap;'>
+							".$options."
+						</td>
+						</tr>";
+					}
+				}
+				$text .= "
+				</table>
+				".$rs -> form_close()."
+				</div>";
+			}
+			$ns -> tablerender(CONTENT_ADMIN_CAT_LAN_10, $text);
+			unset($row['content_id'], $row['content_heading'], $row['content_subheading'], $row['content_text'], $row['content_icon']);
+		}
+
+
+
+		function show_create_category(){
+			global $qs, $plugintable, $plugindir, $sql, $ns, $rs, $aa, $fl, $pref, $tp;
+			global $message, $content_parent, $content_heading, $content_subheading, $content_text, $content_icon, $content_comment, $content_rate, $content_pe, $content_class;
+			global $stylespacer, $TOPIC_ROW_SPACER, $TOPIC_ROW, $TOPIC_ROW_NOEXPAND;
+
+			$months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
+
+			if(!is_object($sql)){ $sql = new db; }
+			$formurl = e_SELF."?".e_QUERY;
+			$array							= $aa -> getCategoryTree("", "", FALSE);
+			$mainparent						= $aa -> getMainParent( (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : "0") ) );
+			$content_pref					= $aa -> getContentPref($mainparent);
+			$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$mainparent}"]);
+			$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$mainparent}"]);
+
+			if( $qs[0] == "cat" && $qs[1] == "create" && isset($qs[2]) && is_numeric($qs[2]) ){
+				if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ")){
+					header("location:".e_SELF."?cat"); exit;
+				}
+				$formurl = e_SELF."?".e_QUERY;
+			}
+			if( $qs[0] == "cat" && $qs[1] == "edit" && isset($qs[2]) && is_numeric($qs[2]) ){
+				if(!$sql -> db_Select($plugintable, "*", "content_id='".intval($qs[2])."' ")){
+					header("location:".e_SELF."?cat"); exit;
+				}else{
+					$row = $sql -> db_Fetch();
+					if(substr($row['content_parent'],0,1) != "0"){
+						header("location:".e_SELF."?cat"); exit;
+					}
+					$menuheading = $row['content_heading'];
+				}
+				$formurl = e_SELF."?".e_QUERY;
+			}
+			
+			if(isset($_POST['preview_category'])){
+				$formurl			= e_SELF."?".e_QUERY;
+				$cat_heading		= $tp -> post_toHTML($_POST['cat_heading']);
+				$cat_subheading		= $tp -> post_toHTML($_POST['cat_subheading']);
+				//$cat_text			= $tp -> post_toHTML($_POST['cat_text']);
+				if(e_WYSIWYG){
+					$_POST['cat_text'] = $tp->createConstants($_POST['cat_text']); // convert e107_images/ to {e_IMAGE} etc.
+				}
+				$cat_text = $tp->post_toHTML($_POST['cat_text'],TRUE);
+				
+				$text = "
+				<div style='text-align:center'>
+				<table class='fborder' style='".ADMIN_WIDTH."' border='0'>
+				<tr>
+					<td class='forumheader3' rowspan='3' style='width:5%; white-space:nowrap; vertical-align:top;'><img src='".$content_cat_icon_path_large.$_POST['cat_icon']."' style='border:0' alt='' /></td>
+					<td class='fcaption'>".$cat_heading."</td>
+				</tr>
+				<tr><td class='forumheader3'>".$cat_subheading."</td></tr>
+				<tr><td class='forumheader3'>".$cat_text."</td></tr>
+				<tr><td colspan='2'>&nbsp;</td></tr>
+				<tr><td class='forumheader3'>".CONTENT_ADMIN_DATE_LAN_15."</td><td class='forumheader3'>
+					".($_POST['ne_day'] != "none" ? $_POST['ne_day'] : "")." ".$months[($_POST['ne_month']-1)]." ".($_POST['ne_year'] != "none" ? $_POST['ne_year'] : "")."
+				</td></tr>
+				<tr><td class='forumheader3'>".CONTENT_ADMIN_DATE_LAN_16."</td><td class='forumheader3'>
+					".($_POST['end_day'] != "none" ? $_POST['end_day'] : "")." ".$months[($_POST['end_month']-1)]." ".($_POST['end_year'] != "none" ? $_POST['end_year'] : "")."
+				</td></tr>
+				<tr><td class='forumheader3'>".CONTENT_ADMIN_CAT_LAN_17."</td><td class='forumheader3'>".r_userclass_name($_POST['cat_class'])."</td></tr>
+				<tr><td class='forumheader3'>".CONTENT_ADMIN_CAT_LAN_14."</td><td class='forumheader3'>".($_POST['cat_comment'] == "1" ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86)."</td></tr>
+				<tr><td class='forumheader3'>".CONTENT_ADMIN_CAT_LAN_15."</td><td class='forumheader3'>".($_POST['cat_rate'] == "1" ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86)."</td></tr>
+				<tr><td class='forumheader3'>".CONTENT_ADMIN_CAT_LAN_16."</td><td class='forumheader3'>".($_POST['cat_pe'] == "1" ? CONTENT_ADMIN_ITEM_LAN_85 : CONTENT_ADMIN_ITEM_LAN_86)."</td></tr>
+				</table>
+				</div>";
+					  
+				$ns -> tablerender($cat_heading, $text);
+			}
+
+			if( isset($_POST['preview_category']) || isset($message) || isset($_POST['uploadcaticon']) ){
+				$row['content_heading']		= $tp -> post_toForm($_POST['cat_heading']);
+				$row['content_subheading']	= $tp -> post_toForm($_POST['cat_subheading']);
+				//$row['content_text']		= $tp -> post_toForm($_POST['cat_text']);
+				if(e_WYSIWYG){
+					$_POST['cat_text']		= $tp->toHTML($_POST['cat_text'],$parseBB = TRUE); // parse the bbcodes to we can edit as html.
+					$_POST['cat_text']		= $tp->replaceConstants($_POST['cat_text'],TRUE); // eg. replace {e_IMAGE} with e107_images/ and NOT ../e107_images
+				}
+				$row['content_text']		= $tp -> post_toForm($_POST['cat_text']);
+				$ne_day						= $_POST['ne_day'];
+				$ne_month					= $_POST['ne_month'];
+				$ne_year					= $_POST['ne_year'];
+				$end_day					= $_POST['end_day'];
+				$end_month					= $_POST['end_month'];
+				$end_year					= $_POST['end_year'];
+				$row['content_icon']		= $_POST['cat_icon'];
+				$row['content_comment']		= $_POST['cat_comment'];
+				$row['content_rate']		= $_POST['cat_rate'];
+				$row['content_pe']			= $_POST['cat_pe'];
+				$row['content_class']		= $_POST['cat_class'];
+			}else{
+				if(e_WYSIWYG){
+					$row['content_text']	= $tp->replaceConstants($row['content_text'],TRUE); // eg. replace {e_IMAGE} with e107_images/ and NOT ../e107_images
+				}
+			}
+
+			$text = "
+			<div style='text-align:center'>
+			".$rs -> form_open("post", $formurl, "dataform", "", "enctype='multipart/form-data'")."
+			<table class='fborder' style='".ADMIN_WIDTH."'>";
+			
+			//category parent
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_27;
+			if($qs[1] == "create"){
+				$parent = (isset($qs[3]) && is_numeric($qs[3]) ? $qs[3] : (isset($qs[2]) && is_numeric($qs[2]) ? $qs[2] : "0") );
+			}elseif($qs[1] == "edit"){
+				if(isset($qs[3]) && is_numeric($qs[3])){
+					$parent = $qs[3];
+				}else{
+					$parent	= ( strpos($row['content_parent'], ".") ? substr($row['content_parent'],2) : "");
+				}
+			}
+			$TOPIC_FIELD = $aa -> ShowOptionCat($parent).$rs->form_hidden("parent", "");
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+			$text .= $TOPIC_ROW_SPACER;
+
+			$row['content_heading'] = (isset($row['content_heading']) ? $row['content_heading'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_2;
+			$TOPIC_FIELD = $rs -> form_text("cat_heading", 90, $row['content_heading'], 250);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$row['content_subheading'] = (isset($row['content_subheading']) ? $row['content_subheading'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_3;
+			$TOPIC_FIELD = $rs -> form_text("cat_subheading", 90, $row['content_subheading'], 250);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$row['content_text'] = (isset($row['content_text']) ? $row['content_text'] : "");
+			require_once(e_HANDLER."ren_help.php");
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_4;
+			$insertjs = (!$pref['wysiwyg'] ? "onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : "");
+			$TOPIC_FIELD = $rs -> form_textarea("cat_text", 80, 20, $row['content_text'], $insertjs)."<br />";
+			if (!$pref['wysiwyg']) { $TOPIC_FIELD .= $rs -> form_text("helpb", 90, '', '', "helpbox")."<br />". display_help("helpb"); }
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			if(isset($row['content_datestamp']) && $row['content_datestamp'] != "0"){
+				$startdate = getdate($row['content_datestamp']);
+				$ne_day = $startdate['mday'];
+				$ne_month = $startdate['mon'];
+				$ne_year = $startdate['year'];
+			}else{
+				$ne_day = (isset($ne_day) ? $ne_day : "");
+				$ne_month = (isset($ne_month) ? $ne_month : "");
+				$ne_year = (isset($ne_year) ? $ne_year : "");
+			}
+			if(isset($row['content_enddate']) && $row['content_enddate'] != "0"){
+				$enddate = getdate($row['content_enddate']);
+				$end_day = $enddate['mday'];
+				$end_month = $enddate['mon'];
+				$end_year = $enddate['year'];
+			}else{
+				$end_day = (isset($end_day) ? $end_day : "");
+				$end_month = (isset($end_month) ? $end_month : "");
+				$end_year = (isset($end_year) ? $end_year : "");
+			}
+
+			$smarray = getdate();
+			$current_year = $smarray['year'];
+
+			$text .= $TOPIC_ROW_SPACER;
+
+			$TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_15;
+			$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_73;
+			$TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_17;
+			$TOPIC_FIELD = "
+				".$rs -> form_select_open("ne_day")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 0, "none");
+				for($count=1; $count<=31; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($count, ($ne_day == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+				".$rs -> form_select_open("ne_month")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 0, "none");
+				for($count=1; $count<=12; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($months[($count-1)], ($ne_month == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+				".$rs -> form_select_open("ne_year")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 0, "none");
+				for($count=($current_year-5); $count<=$current_year; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($count, ($ne_year == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+			$TOPIC_TOPIC = CONTENT_ADMIN_DATE_LAN_16;
+			$TOPIC_HEADING = CONTENT_ADMIN_ITEM_LAN_74;
+			$TOPIC_HELP = CONTENT_ADMIN_DATE_LAN_18;
+			$TOPIC_FIELD = "
+				".$rs -> form_select_open("end_day")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, 1, "none");
+				for($count=1; $count<=31; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($count, ($end_day == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+				".$rs -> form_select_open("end_month")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, 1, "none");
+				for($count=1; $count<=12; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($months[($count-1)], ($end_month == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+				".$rs -> form_select_open("end_year")."
+				".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, 1, "none");
+				for($count=($current_year-5); $count<=$current_year; $count++){
+					$TOPIC_FIELD .= $rs -> form_option($count, ($end_year == $count ? "1" : "0"), $count);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+			$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*');
+			$iconlist = $fl->get_files($content_cat_icon_path_large,"",$rejectlist);
+
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_63;
+			$TOPIC_HEADING = CONTENT_ADMIN_CAT_LAN_61;
+			$TOPIC_HELP = "";
+			$TOPIC_FIELD = "";
+				if(!FILE_UPLOADS){
+					$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_21."</b>";
+				}else{
+					if(!is_writable($content_cat_icon_path_large)){
+						$TOPIC_FIELD .= "<b>".CONTENT_ADMIN_ITEM_LAN_22." ".$content_cat_icon_path_large." ".CONTENT_ADMIN_ITEM_LAN_23."</b><br />";
+					}
+					$TOPIC_FIELD .= CONTENT_ADMIN_CAT_LAN_62."
+					<input class='tbox' type='file' name='file_userfile[]'  size='58' /> 
+					<input type='hidden' name='iconpathlarge' value='".$content_cat_icon_path_large."' />
+					<input type='hidden' name='iconpathsmall' value='".$content_cat_icon_path_small."' />
+					<input class='button' type='submit' name='uploadcaticon' value='".CONTENT_ADMIN_CAT_LAN_63."' />";
+				}
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+			$row['content_icon'] = (isset($row['content_icon']) ? $row['content_icon'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_5;
+			$TOPIC_FIELD = "
+				".$rs -> form_text("cat_icon", 60, $row['content_icon'], 100)."
+				".$rs -> form_button("button", '', CONTENT_ADMIN_CAT_LAN_8, "onclick=\"expandit('divcaticon')\"")."
+				<div id='divcaticon' style='{head}; display:none'>";
+				foreach($iconlist as $icon){
+					$TOPIC_FIELD .= "<a href=\"javascript:insertext('".$icon['fname']."','cat_icon','divcaticon')\"><img src='".$icon['path'].$icon['fname']."' style='border:0' alt='' /></a> ";
+				}
+				$TOPIC_FIELD .= "</div>";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$row['content_comment'] = (isset($row['content_comment']) ? $row['content_comment'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_14;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("cat_comment", "1", ($row['content_comment'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
+			".$rs -> form_radio("cat_comment", "0", ($row['content_comment'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$row['content_rate'] = (isset($row['content_rate']) ? $row['content_rate'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_15;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("cat_rate", "1", ($row['content_rate'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
+			".$rs -> form_radio("cat_rate", "0", ($row['content_rate'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$row['content_pe'] = (isset($row['content_pe']) ? $row['content_pe'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_16;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("cat_pe", "1", ($row['content_pe'] ? "1" : "0"), "", "").CONTENT_ADMIN_ITEM_LAN_85."
+			".$rs -> form_radio("cat_pe", "0", ($row['content_pe'] ? "0" : "1"), "", "").CONTENT_ADMIN_ITEM_LAN_86;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$row['content_class'] = (isset($row['content_class']) ? $row['content_class'] : "");
+			$TOPIC_TOPIC = CONTENT_ADMIN_CAT_LAN_17;
+			$TOPIC_FIELD = r_userclass("cat_class",$row['content_class'], "CLASSES");
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_ROW_SPACER;
+			$text .= "
+			<tr>
+				<td class='forumheader' style='text-align:center' colspan='2'>";
+				if($qs[1] == "edit" && is_numeric($qs[2]) ){
+					$js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" ";
+					$text .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js);
+					$text .= $rs -> form_button("submit", "update_category", CONTENT_ADMIN_CAT_LAN_7, $js).$rs -> form_button("submit", "category_clear", CONTENT_ADMIN_CAT_LAN_21).$rs -> form_hidden("cat_id", $qs[2]).$rs -> form_hidden("id", $qs[2]).$rs -> form_hidden("menuheading", $menuheading);
+					
+					$caption = CONTENT_ADMIN_CAT_LAN_1;
+				}else{
+					$js = "onclick=\"document.getElementById('parent').value = document.getElementById('parent1').options[document.getElementById('parent1').selectedIndex].label;\" ";
+					$text .= $rs -> form_button("submit", "preview_category", (isset($_POST['preview_category']) ? CONTENT_ADMIN_MAIN_LAN_27 : CONTENT_ADMIN_MAIN_LAN_26), $js);
+					$text .= $rs -> form_button("submit", "create_category", CONTENT_ADMIN_CAT_LAN_6, $js);
+					$caption = CONTENT_ADMIN_CAT_LAN_0;
+				}
+				$text .= "
+				</td>
+			</tr>
+			</table>
+			".$rs -> form_close()."
+			</div>";
+
+			$ns -> tablerender($caption, $text);
+		}
+
+
+
+		function show_contentmanager($mode, $userid="", $username=""){
+			global $content_shortcodes, $row, $tp, $sql, $ns, $rs, $plugintable, $plugindir, $aa, $eArrayStorage;
+			global $CONTENT_CONTENTMANAGER_CATEGORY, $CONTENT_CONTENTMANAGER_TABLE, $CONTENT_CONTENTMANAGER_TABLE_START, $CONTENT_CONTENTMANAGER_TABLE_END;
+			$personalmanagercheck = FALSE;
+
+			if(!$CONTENT_CONTENTMANAGER_TABLE){
+				require_once($plugindir."templates/content_manager_template.php");
+			}
+			$array		= $aa -> getCategoryTree("", "", TRUE);
+			$catarray	= array_keys($array);
+			$content_contentmanager_table_string = "";
+			foreach($catarray as $catid){
+				if($sql -> db_Select($plugintable, "content_id, content_heading, content_pref", " content_id='".intval($catid)."' ")){
+					$row = $sql -> db_Fetch();
+					$content_pref = $eArrayStorage->ReadArray($row['content_pref']);
+
+					if(isset($content_pref["content_manager_allowed_{$row['content_id']}"])){
+						$pcm = explode(",", $content_pref["content_manager_allowed_{$row['content_id']}"]);
+					}else{
+						$pcm = array();
+					}
+					if(in_array($userid, $pcm) || getperms("0")){
+						$personalmanagercheck = TRUE;
+						$content_contentmanager_table_string .= $tp -> parseTemplate($CONTENT_CONTENTMANAGER_TABLE, FALSE, $content_shortcodes);
+					}
+				}
+			}
+			if($personalmanagercheck == TRUE){
+				$text = $CONTENT_CONTENTMANAGER_TABLE_START.$content_contentmanager_table_string.$CONTENT_CONTENTMANAGER_TABLE_END;
+				$ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_56, $text);
+			}else{
+				header("location:".$plugindir."content.php"); exit;
+			}
+		}
+
+
+
+		function show_order(){
+			global $qs, $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer;
+
+			if(!getperms("0")){ header("location:".e_SELF); exit; }
+
+			$catarray	= $aa -> getCategoryTree("", "", FALSE);
+			$array		= array_keys($catarray);
+
+			if(!is_array($array)){
+				$text = "<div style='text-align:center;'>".CONTENT_ADMIN_CAT_LAN_9."</div>";
+			}else{
+				$text = "
+				<div style='text-align:center'>
+				".$rs -> form_open("post", e_SELF."?order", "orderform")."
+				<table class='fborder' style='".ADMIN_WIDTH."'>							
+				<tr>
+					<td class='fcaption' style='width:5%'>".CONTENT_ADMIN_CAT_LAN_24."</td>
+					<td class='fcaption' style='width:5%'>".CONTENT_ADMIN_CAT_LAN_25."</td>
+					<td class='fcaption' style='width:15%'>".CONTENT_ADMIN_CAT_LAN_18."</td>
+					<td class='fcaption' style='width:50%'>".CONTENT_ADMIN_CAT_LAN_19."</td>
+					<td class='fcaption' style='width:5%; text-align:center; white-space:nowrap;'>".CONTENT_ADMIN_ITEM_LAN_58."</td>
+					<td class='fcaption' style='width:5%; text-align:center; white-space:nowrap;'>".CONTENT_ADMIN_ITEM_LAN_59."</td>
+					<td class='fcaption' style='width:5%; text-align:center; white-space:nowrap;'>".CONTENT_ADMIN_ITEM_LAN_60."</td>
+				</tr>";
+
+				if(!is_object($sql)){ $sql = new db; }
+				foreach($array as $catid){
+					if(!$category_total = $sql -> db_Select($plugintable, "*", "content_id='".intval($catid)."' ")){
+						$text .= "<div style='text-align:center;'>".CONTENT_ADMIN_CAT_LAN_9."</div>";
+					}else{
+						$row = $sql -> db_Fetch();
+
+						$content_pref					= $aa -> getContentPref($catarray[$catid][0]);
+						$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$catarray[$catid][0]}"]);
+						$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$catarray[$catid][0]}"]);
+						$authordetails					= $aa -> getAuthor($row['content_author']);
+						$caticon						= $content_cat_icon_path_large.$row['content_icon'];
+
+						$pre = "";
+						if($row['content_parent'] == "0"){		//main parent level
+							$class = "forumheader";
+						}else{									//sub level
+							$class = "forumheader3";
+							for($b=0;$b<(count($catarray[$catid])/2)-1;$b++){
+								$pre .= "_";
+							}
+						}
+
+						if($row['content_parent'] == 0){
+							$subs		= $aa -> getCategoryTree("", $row['content_id'], FALSE);
+							$ordermax	= count($subs);
+						}
+
+						//count items in category
+						$ordercat = "";
+						$ordercatall = "";
+						$up = "";
+						$down = "";
+						$selectorder = "";
+
+						$sqlc = new db;
+						$n = $sqlc -> db_Count($plugintable, "(*)", "WHERE content_parent='".intval($catid)."' AND content_refer != 'sa' ");
+						if($n > 1){
+							$ordercat = "<a href='".e_SELF."?order.".$catarray[$catid][0].".".$catid."'>".CONTENT_ICON_ORDERCAT."</a>";
+							$ordercatall = ($row['content_parent'] == 0 ? "<a href='".e_SELF."?order.".$catid."'>".CONTENT_ICON_ORDERALL."</a>" : "");
+						}
+						$amount = "(".($n == 1 ? $n." ".CONTENT_ADMIN_CAT_LAN_56 : $n." ".CONTENT_ADMIN_CAT_LAN_57).")";
+						
+						if($ordermax > 1){
+							//up arrow
+							if($row['content_order'] != 1 && $row['content_order'] != 0){
+								$up = "<a href='".e_SELF."?order.inc.".$catid."-".$row['content_order']."'>".CONTENT_ICON_ORDER_UP."</a> ";
+							}else{
+								$up = "&nbsp;&nbsp;&nbsp;";
+							}
+							//down arrow
+							if($row['content_order'] != $ordermax){
+								$down = "<a href='".e_SELF."?order.dec.".$catid."-".$row['content_order']."'>".CONTENT_ICON_ORDER_DOWN."</a>";
+							}else{
+								$down = "&nbsp;&nbsp;&nbsp;";
+							}
+							//select box
+							if($ordermax > 1){
+								$selectorder = "
+								<select name='order[]' class='tbox'>";
+								for($k=1;$k<=$ordermax;$k++){
+									$selectorder .= $rs -> form_option($k, ($row['content_order'] == $k ? "1" : "0"), $catid.".".$k.".cat");
+								}
+								$selectorder .= "</select>";
+							}
+						}
+						$row['content_heading']		= $tp->toHTML($row['content_heading'], TRUE, "");
+						$row['content_subheading']	= $tp->toHTML($row['content_subheading'], TRUE, "");
+
+						$text .= "
+						".($row['content_parent'] == 0 ? "<tr><td colspan='5' $stylespacer></td></tr>" : "")."
+						<tr>
+							<td class='".$class."' style='width:5%; text-align:left'>".$catid."</td>
+							<td class='".$class."' style='width:5%; text-align:center'>".($row['content_icon'] ? "<img src='".$caticon."' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
+							<td class='".$class."' style='width:15%'>".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."</td>
+							<td class='".$class."' style='width:50%; white-space:nowrap;'>
+								<a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+								".$pre.$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")." ".$amount."
+							</td>
+							<td class='".$class."' style='width:5%; text-align:left; white-space:nowrap;'>
+								".$ordercat."
+								".$ordercatall."
+							</td>
+							<td class='".$class."' style='width:5%; text-align:center; white-space:nowrap;'>
+								".$up." 
+								".$down."
+							</td>
+							<td class='".$class."' style='width:5%; text-align:center; white-space:nowrap;'>
+								".$selectorder."
+							</td>
+						</tr>";
+					}
+				}
+				$text .= "
+				<tr><td colspan='7' $stylespacer></td></tr>
+				<tr>
+					<td class='fcaption' colspan='5'>&nbsp;</td>
+					<td class='fcaption' colspan='2' style='text-align:center'>
+						".$rs -> form_button("submit", "update_order", CONTENT_ADMIN_ITEM_LAN_61)."
+					</td>
+				</tr>
+				</table>
+				".$rs -> form_close()."
+				</div>";
+			}
+			$ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_62, $text);
+		}
+
+
+
+		function show_content_order($mode){
+			global $sql, $ns, $rs, $qs, $plugintable, $plugindir, $aa, $tp;
+
+			$allcats = $aa -> getCategoryTree("", "", FALSE);
+			if($mode == "ci"){
+				$formtarget		= e_SELF."?order.".$qs[1].".".$qs[2];
+				$qry			= "content_parent = '".intval($qs[2])."' ";
+				$order			= "SUBSTRING_INDEX(content_order, '.', 1)+0";
+
+			}elseif($mode == "ai"){
+				$array			= $aa -> getCategoryTree("", intval($qs[1]), FALSE);
+				$validparent	= implode(",", array_keys($array));
+				$qry			= " content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' ";
+				$formtarget		= e_SELF."?order.".$qs[1];
+				$order			= "SUBSTRING_INDEX(content_order, '.', -1)+0";
+			}
+			$content_pref		= $aa -> getContentPref($qs[1]);
+			$content_icon_path	= $tp -> replaceConstants($content_pref["content_icon_path_{$qs[1]}"]);
+
+			$sqlo = new db;
+			if(!$content_total = $sqlo -> db_Select($plugintable, "content_id, content_heading, content_author, content_parent, content_order", "content_refer != 'sa' AND ".$qry." ORDER BY ".$order." ASC, content_heading DESC ")){
+				$text = "<div style='text-align:center'>".CONTENT_ADMIN_ITEM_LAN_4."</div>";
+			}else{
+				$text = "
+				<div style='text-align:center'>
+				".$rs -> form_open("post", $formtarget, "orderform")."
+				<table class='fborder' style='".ADMIN_WIDTH."'>
+				<tr><td class='fcaption' colspan='5'>".CONTENT_ADMIN_MAIN_LAN_2."</td></tr>
+				<tr>
+					<td class='forumheader' style='width:5%; text-align:center; white-space:nowrap;'>".CONTENT_ADMIN_ITEM_LAN_8."</td>
+					<td class='forumheader' style='width:15%; text-align:left;'>".CONTENT_ADMIN_ITEM_LAN_10."</td>
+					<td class='forumheader' style='width:70%; text-align:center; white-space:nowrap;'>".CONTENT_ADMIN_ITEM_LAN_11."</td>
+					<td class='forumheader' style='width:5%; text-align:center; white-space:nowrap;'>".CONTENT_ADMIN_ITEM_LAN_59."</td>
+					<td class='forumheader' style='width:5%; text-align:center; white-space:nowrap;'>".CONTENT_ADMIN_ITEM_LAN_60."</td>
+				</tr>";
+
+				while($row = $sqlo -> db_Fetch()){
+						$delete_heading	= str_replace("&#39;", "\'", $row['content_heading']);
+						$authordetails	= $aa -> getAuthor($row['content_author']);
+						$caticon		= (isset($row['content_icon']) ? $content_icon_path.$row['content_icon'] : "");
+						$deleteicon		= CONTENT_ICON_DELETE;
+
+						$tmp = explode(".", $row['content_order']);
+						if(!$tmp[1]){ $tmp[1] = "0"; }
+						$row['content_order'] = $tmp[0]."-".$tmp[1];
+
+						if($mode == "ci"){
+							$ordercheck		= $tmp[0];
+							$ordercheck2	= $tmp[1];
+							$qrystring		= "order.".$qs[1].".".$qs[2];
+						}elseif($mode == "ai"){
+							$ordercheck		= $tmp[1];
+							$ordercheck2	= $tmp[0];
+							$qrystring		= "order.".$qs[1];
+						}
+						$cid	= $row['content_id'];
+						$corder	= $row['content_order'];
+
+						if(array_key_exists($row['content_parent'], $allcats)){
+							$mainparentid = $allcats[$row['content_parent']][0];
+						}
+						//up arrow
+						if($ordercheck != 1 && $ordercheck != 0){
+							$up = "<a href='".e_SELF."?".$qrystring.".inc.".$cid."-".$corder."'>".CONTENT_ICON_ORDER_UP."</a> ";
+						}else{
+							$up = "&nbsp;&nbsp;&nbsp;";
+						}
+						//down arrow
+						if($ordercheck != $content_total){
+							$down = "<a href='".e_SELF."?".$qrystring.".dec.".$cid."-".$corder."'>".CONTENT_ICON_ORDER_DOWN."</a>";
+						}else{
+							$down = "&nbsp;&nbsp;&nbsp;";
+						}
+						$row['content_heading']		= $tp->toHTML($row['content_heading'], TRUE, "");
+
+						$text .= "
+						<tr>
+							<td class='forumheader3' style='width:5%; text-align:center; white-space:nowrap;'>".$cid."</td>
+							<td class='forumheader3' style='width:15%; text-align:left; white-space:nowrap;'>
+								".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."
+							</td>
+							<td class='forumheader3' style='width:70%; text-align:left;'>
+								<a href='".$plugindir."content.php?content.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+								".$row['content_heading']." (".$row['content_order'].")</td>
+							<td class='forumheader3' style='width:5%; text-align:center; white-space:nowrap;'>
+								".$up."
+								".$down."
+							</td>
+							<td class='forumheader3' style='width:5%; text-align:center; white-space:nowrap;'>
+								<select name='order[]' class='tbox'>";
+								for($k=1;$k<=$content_total;$k++){
+									$text .= $rs -> form_option($k, ($ordercheck == $k ? "1" : "0"), $cid.".".$k.".".$mode.".".$corder);
+								}
+								$text .= "</select>
+							</td>
+						</tr>";
+				}
+				$text .= "
+				<tr>
+					<td class='fcaption' colspan='3'>&nbsp;</td>
+					<td class='fcaption' colspan='2' style='text-align:center'>
+						".$rs -> form_button("submit", "update_order", CONTENT_ADMIN_ITEM_LAN_61)."
+					</td>
+				</tr>
+				</table>
+				".$rs -> form_close()."
+				</div>";
+			}
+			$ns -> tablerender(CONTENT_ADMIN_ITEM_LAN_65, $text);
+			return;
+		}
+
+
+
+		function show_admin_contentmanager_category(){
+			global $plugintable, $qs, $sql, $ns, $rs, $aa, $eArrayStorage;
+
+			if(!getperms("0")){ js_location(e_SELF); }
+			if(!is_numeric($qs[1])){ js_location(e_SELF); }
+
+			if(!is_object($sql)){ $sql = new db; }
+			if(!$sql -> db_Select($plugintable, "content_id, content_heading, content_pref", "content_id='".intval($qs[1])."' ")){
+				js_location(e_SELF."?manager");
+			}else{
+				$row = $sql -> db_Fetch();
+				$caption = CONTENT_ADMIN_CAT_LAN_30." : ".$row['content_heading'];
+			}
+			
+			//get current preferences
+			$mainparent			= $aa -> getMainParent( intval($qs[1]) );						
+			if($qs[1] == $mainparent){
+				$content_pref	= $aa -> getContentPref($mainparent);
+			}else{							
+				$content_pref	= $eArrayStorage->ReadArray($row['content_pref']);
+			}
+			$qs[1] = intval($qs[1]);
+			if(isset($content_pref["content_manager_allowed_{$qs[1]}"]) && $content_pref["content_manager_allowed_{$qs[1]}"]){
+				$pcm				= explode(",", $content_pref["content_manager_allowed_{$qs[1]}"]);
+			}else{
+				$pcm = array();
+			}
+
+			$classtocheck = $content_pref["content_manager_class_{$mainparent}"];
+			if($classtocheck==e_UC_PUBLIC || !$content_pref["content_manager_class_{$mainparent}"]){
+				$classqry = '';
+			}else{
+				$classqry = " AND (user_class = '{$classtocheck}' OR user_class REGEXP('^{$classtocheck},') OR user_class REGEXP(',{$classtocheck},') OR user_class REGEXP(',{$classtocheck}$'))";
+			}
+			$sql2 = new db;
+			$c = 0;
+			$d = 0;
+			$sql2->db_Select("user", "user_id, user_name, user_class, user_login", " user_perms != '0' ".$classqry." ORDER BY user_name");
+			while ($row2 = $sql2->db_Fetch()) {
+				if(in_array($row2['user_id'], $pcm)){
+					$in_userid[$c]		= $row2['user_id'];
+					$in_username[$c]	= $row2['user_name'];
+					$in_userlogin[$c]	= $row2['user_login'] ? "(".$row2['user_login'].")" : "";
+					$c++;
+				} else {
+					$out_userid[$d]		= $row2['user_id'];
+					$out_username[$d]	= $row2['user_name'];
+					$out_userlogin[$d]	= $row2['user_login'] ? "(".$row2['user_login'].")" : "";
+					$d++;
+				}
+			}
+			
+			$optionout = "";
+			for ($a = 0; $a <= ($d-1); $a++) {
+				$optionout .= "<option value=".$out_userid[$a].">".$out_username[$a]." ".$out_userlogin[$a]."</option>";
+			}
+			$optionin = "";
+			$class_id = "";
+			for($a = 0; $a <= ($c-1); $a++) {
+				$optionin .= "<option value=".$in_userid[$a].">".$in_username[$a]." ".$in_userlogin[$a]."</option>";
+				$class_id .= $in_userid[$a].".";
+			}
+			
+			$text = "
+			<div style='text-align:center'>
+			".$rs -> form_open("post", e_SELF."?".e_QUERY, "managerform", "", "enctype='multipart/form-data'")."
+			<table class='fborder' style='".ADMIN_WIDTH."'>
+			<tr><td class='forumheader' style='text-align:center;'>".CONTENT_ADMIN_CAT_LAN_28."</td></tr>
+			<tr><td class='forumheader3' style='text-align:center'>
+				<table style='width:98%;'>
+				<tr>
+				<td style='width:50%; vertical-align:top'>".CONTENT_ADMIN_CAT_LAN_29."<br />
+				<select class='tbox' id='assignclass1' name='assignclass1' size='10' style='width:220px' multiple='multiple' onchange='moveOver();'>
+				".$optionout."				 
+				</select>
+				</td>
+				<td style='width:50%; vertical-align:top'>".CONTENT_ADMIN_CAT_LAN_30."<br />
+				<select class='tbox' id='assignclass2' name='assignclass2' size='10' style='width:220px' multiple='multiple'>
+				".$optionin."
+				</select><br /><br />
+				<input class='button' type='button' value='".CONTENT_ADMIN_CAT_LAN_31."' onclick='removeMe();' />
+				<input class='button' type='button' value='".CONTENT_ADMIN_CAT_LAN_32."' onclick='clearMe($qs[1]);' />
+				<input type='hidden' name='class_id' value='".$class_id."' />
+				</td>
+				</tr>
+				</table>
+			</td></tr>
+			<tr><td style='text-align:center' class='forumheader'>						
+			".$rs -> form_button("button", "assign_admins", CONTENT_ADMIN_CAT_LAN_33, "onclick='saveMe($qs[1]);'")."
+			".$rs -> form_hidden("cat_id", $qs[1])."
+			</td>
+			</tr>
+			</table>
+			".$rs -> form_close()."
+			</div>";
+
+			$ns -> tablerender($caption, $text);
+		}
+
+
+
+		function show_options(){
+			global $sql, $ns, $rs, $aa, $plugintable, $plugindir, $tp, $stylespacer;
+
+			$lan_file = $plugindir."languages/".e_LANGUAGE."/lan_content_options.php";
+			include_once(file_exists($lan_file) ? $lan_file : $plugindir."languages/English/lan_content_options.php");
+
+			$sqlo = new db;
+			if(!$category_total = $sqlo -> db_Select($plugintable, "*", "content_parent='0' ")){
+				$text = "<div style='text-align:center;'>".CONTENT_ADMIN_CAT_LAN_9."</div>";
+			}else{
+
+				$text = "
+				<div style='text-align:center'>
+				".$rs -> form_open("post", e_SELF."?options", "optionsform","","", "")."
+				<table style='".ADMIN_WIDTH."' class='fborder'>
+				<tr>
+				<td class='fcaption' style='width:5%'>".CONTENT_ADMIN_CAT_LAN_24."</td>
+				<td class='fcaption' style='width:5%'>".CONTENT_ADMIN_CAT_LAN_25."</td>
+				<td class='fcaption' style='width:15%'>".CONTENT_ADMIN_CAT_LAN_18."</td>
+				<td class='fcaption' style='width:65%'>".CONTENT_ADMIN_CAT_LAN_19."</td>
+				<td class='fcaption' style='width:10%; text-align:center'>".CONTENT_ADMIN_CAT_LAN_20."</td>
+				</tr>";
+
+				$content_pref					= $aa -> getContentPref(0);
+				$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_0"]);
+				$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_0"]);
+				
+				$text .= "
+				<tr><td colspan='5' $stylespacer></td></tr>
+				<tr>
+					<td class='forumheader3' style='width:5%; text-align:left'></td>
+					<td class='forumheader3' style='width:5%; text-align:center'></td>
+					<td class='forumheader3' style='width:15%'></td>
+					<td class='forumheader3' style='width:65%; white-space:nowrap;'>".CONTENT_ADMIN_OPT_LAN_1."</td>
+					<td class='forumheader3' style='width:10%; text-align:center; white-space:nowrap;'>
+						<a href='".e_SELF."?option.default'>".CONTENT_ICON_OPTIONS."</a>
+					</td>
+				</tr>
+				<tr><td colspan='5' $stylespacer></td></tr>";
+
+				while($row = $sqlo -> db_Fetch()){
+
+					$content_pref					= $aa -> getContentPref($row['content_id']);
+					$content_cat_icon_path_large	= $tp -> replaceConstants($content_pref["content_cat_icon_path_large_{$row['content_id']}"]);
+					$content_cat_icon_path_small	= $tp -> replaceConstants($content_pref["content_cat_icon_path_small_{$row['content_id']}"]);
+					$authordetails					= $aa -> getAuthor($row['content_author']);
+					$caticon						= $content_cat_icon_path_large.$row['content_icon'];
+
+					$text .= "								
+					<tr>
+						<td class='forumheader3' style='width:5%; text-align:left'>".$row['content_id']."</td>
+						<td class='forumheader3' style='width:5%; text-align:center'>".($row['content_icon'] ? "<img src='".$caticon."' alt='' style='vertical-align:middle' />" : "&nbsp;")."</td>
+						<td class='forumheader3' style='width:15%'>".($authordetails[0] != "0" ? "<a href='".e_BASE."user.php?id.".$authordetails[0]."'>".CONTENT_ICON_USER."</a>" : "")." ".$authordetails[1]."</td>
+						<td class='forumheader3' style='width:65%; white-space:nowrap;'>
+							<a href='".$plugindir."content.php?cat.".$row['content_id']."'>".CONTENT_ICON_LINK."</a> 
+							".$row['content_heading']." ".($row['content_subheading'] ? "[".$row['content_subheading']."]" : "")."
+						</td>
+						<td class='forumheader3' style='width:10%; text-align:center; white-space:nowrap;'>
+							<a href='".e_SELF."?option.".$row['content_id']."'>".CONTENT_ICON_OPTIONS."</a>
+						</td>
+					</tr>";
+				}
+				$text .= "
+				</table>
+				".$rs -> form_close()."
+				</div>";
+			}
+			$ns -> tablerender(CONTENT_ADMIN_MENU_LAN_6, $text);
+		}
+
+
+
+		function show_options_cat(){
+			global $qs, $id, $sql, $ns, $rs, $aa, $content_pref, $pref, $content_cat_icon_path_large, $content_cat_icon_path_small, $plugintable, $plugindir;
+			global $fl, $stylespacer, $tp;
+
+			if($qs[1] == "default"){
+				$id = "0";
+				$caption = CONTENT_ADMIN_OPT_LAN_0." : ".CONTENT_ADMIN_OPT_LAN_1;
+			}elseif(is_numeric($qs[1])){
+				$id = $qs[1];
+				$sqlo = new db;
+				if(!$sqlo -> db_Select($plugintable, "content_heading", "content_id='".intval($id)."' AND content_parent = '0' ")){
+					header("location:".e_SELF."?option"); exit;
+				}else{
+					while($rowo = $sqlo -> db_Fetch()){
+						$caption = CONTENT_ADMIN_OPT_LAN_0." : ".$rowo['content_heading'];
+					}
+				}
+			}else{
+				header("location:".e_SELF."?option"); exit;
+			}
+			//check prefs two times to insure they are shown, if none present, the first inserts them, the second retrieves them						
+			//$content_pref		= $aa -> getContentPref($id);
+			$content_pref		= $aa -> getContentPref($id);
+
+			//define some variables
+			$TOPIC_TABLE_END	= $this->pref_submit()."</table></div>";
+			$TOPIC_TITLE_ROW	= "<tr><td colspan='2' class='fcaption'>{TOPIC_CAPTION}</td></tr>";
+			$TOPIC_TABLE_START	= "";
+
+			$TOPIC_ROW_NOEXPAND = "
+			<tr>
+				<td class='forumheader3' style='width:35%; vertical-align:top;'>{TOPIC_TOPIC}</td>
+				<td class='forumheader3'>{TOPIC_FIELD}</td>
+			</tr>
+			";
+
+			$TOPIC_ROW = "
+			<tr>
+				<td class='forumheader3' style='width:20%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
+				<td class='forumheader3' style='vertical-align:top;'>
+					<a style='cursor: pointer;' onclick='expandit(this);'>{TOPIC_HEADING}</a>
+					<div style='display: none;'>
+						<div class='smalltext'>{TOPIC_HELP}</div><br />
+						{TOPIC_FIELD}
+					</div>
+				</td>
+			</tr>";
+
+			$text = "
+			<script type=\"text/javascript\">
+			<!--
+			var hideid=\"creation\";
+			function showhideit(showid){
+				if (hideid!=showid){
+					show=document.getElementById(showid).style;
+					hide=document.getElementById(hideid).style;
+					show.display=\"\";
+					hide.display=\"none\";
+					
+					showh=document.getElementById(showid+'help').style;
+					hideh=document.getElementById(hideid+'help').style;
+					showh.display=\"\";
+					hideh.display=\"none\";
+					
+					hideid = showid;
+				}
+			}
+			//-->
+			</script>";
+
+			$text .= "
+			<div style='text-align:center'>
+			<form method='post' name='optform' action='".e_SELF."?".e_QUERY."'>\n
+
+			<div id='creation' style='text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";						
+			
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_3;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_admin_sections
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_admin_icon_{$id}", 1, (isset($content_pref["content_admin_icon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
+			".$rs -> form_checkbox("content_admin_attach_{$id}", 1, (isset($content_pref["content_admin_attach_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_2."<br />
+			".$rs -> form_checkbox("content_admin_images_{$id}", 1, (isset($content_pref["content_admin_images_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_3."<br />
+			".$rs -> form_checkbox("content_admin_comment_{$id}", 1, (isset($content_pref["content_admin_comment_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_4."<br />
+			".$rs -> form_checkbox("content_admin_rating_{$id}", 1, (isset($content_pref["content_admin_rating_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_5."<br />
+			".$rs -> form_checkbox("content_admin_score_{$id}", 1, (isset($content_pref["content_admin_score_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_6."<br />
+			</td><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_admin_pe_{$id}", 1, (isset($content_pref["content_admin_pe_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_20."<br />
+			".$rs -> form_checkbox("content_admin_visibility_{$id}", 1, (isset($content_pref["content_admin_visibility_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_7."<br />
+			".$rs -> form_checkbox("content_admin_meta_{$id}", 1, (isset($content_pref["content_admin_meta_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_8."<br />
+			".$rs -> form_checkbox("content_admin_layout_{$id}", 1, (isset($content_pref["content_admin_layout_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_9."<br />
+			".$rs -> form_checkbox("content_admin_customtags_{$id}", 1, (isset($content_pref["content_admin_customtags_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_10."<br />
+			".$rs -> form_checkbox("content_admin_presettags_{$id}", 1, (isset($content_pref["content_admin_presettags_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_11."<br />
+			</td></tr></table>
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_admin_images_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_3;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_admin_images_number_{$id}");
+			$content_pref["content_admin_images_number_{$id}"] = ($content_pref["content_admin_images_number_{$id}"] ? $content_pref["content_admin_images_number_{$id}"] : "10");
+			for($i=1;$i<16;$i++){
+				$k=$i*2;
+				$TOPIC_FIELD .= $rs -> form_option($k, ($content_pref["content_admin_images_number_{$id}"] == $k ? "1" : "0"), $k);
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_admin_files_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_4;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_admin_files_number_{$id}");
+			$content_pref["content_admin_files_number_{$id}"] = ($content_pref["content_admin_files_number_{$id}"] ? $content_pref["content_admin_files_number_{$id}"] : "1");
+			for($i=1;$i<6;$i++){
+				$TOPIC_FIELD .= $rs -> form_option($i, ($content_pref["content_admin_files_number_{$id}"] == $i ? "1" : "0"), $i);
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_admin_custom_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_5;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_admin_custom_number_{$id}");
+			for($i=0;$i<11;$i++){
+				$TOPIC_FIELD .= $rs -> form_option($i, ($content_pref["content_admin_custom_number_{$id}"] == $i ? "1" : "0"), $i);
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_admin_custom_preset_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_6;
+			$TOPIC_HEADING = CONTENT_ADMIN_OPT_LAN_7;
+			$TOPIC_HELP = "";
+			$i=0;
+			$existing = 0;
+			$TOPIC_FIELD = "
+			<div id='div_content_custom_preset' style='width:80%;'>";						
+			for($i=0;$i<count($content_pref["content_custom_preset_key"]);$i++){
+				if(!empty($content_pref["content_custom_preset_key"][$i])){
+					$TOPIC_FIELD .= "
+					<span style='white-space:nowrap;'>
+					".$rs -> form_text("content_custom_preset_key[$existing]", 50, $content_pref["content_custom_preset_key"][$existing], 100)."
+					".$rs -> form_button("button", "x", "x", "onclick=\"document.getElementById('content_custom_preset_key[$existing]').value='';\"", "", "")."	
+					</span>";
+					$existing++;
+				}
+			}
+			$TOPIC_FIELD .= "
+			<br />
+			<span id='upline_new' style='white-space:nowrap;'></span><br />
+			</div><br />";
+
+			$url = e_PLUGIN."content/handlers/content_preset.php";
+			$selectjs	= "onchange=\"if(this.options[this.selectedIndex].value != 'none'){ return window.open(this.options[this.selectedIndex].value, 'myWindow', 'status = 1, height = 400, width = 400, resizable = 1'); }\"";
+			$TOPIC_FIELD .= "
+			<div id='upline_type' style='white-space:nowrap;'>
+				".$rs -> form_select_open("type", $selectjs)."
+				".$rs -> form_option(CONTENT_PRESET_LAN_25, "1", "none", "")."
+				".$rs -> form_option(CONTENT_PRESET_LAN_26, "", $url."?text", "")."
+				".$rs -> form_option(CONTENT_PRESET_LAN_27, "", $url."?area", "")."
+				".$rs -> form_option(CONTENT_PRESET_LAN_28, "", $url."?select", "")."
+				".$rs -> form_option(CONTENT_PRESET_LAN_29, "", $url."?date", "")."
+				".$rs -> form_option(CONTENT_PRESET_LAN_30, "", $url."?checkbox", "")."
+				".$rs -> form_option(CONTENT_PRESET_LAN_31, "", $url."?radio", "")."
+				".$rs -> form_select_close()."
+			</div><br />";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='submission' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_4;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+			
+			//content_submit_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_9;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_submit_{$id}", "1", ($content_pref["content_submit_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_submit_{$id}", "0", ($content_pref["content_submit_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_submit_class_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_10;
+			$TOPIC_FIELD = r_userclass("content_submit_class_{$id}", $content_pref["content_submit_class_{$id}"], "CLASSES");
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_submit_directpost_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_11;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_submit_directpost_{$id}", "1", ($content_pref["content_submit_directpost_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_submit_directpost_{$id}", "0", ($content_pref["content_submit_directpost_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_submit_sections
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_submit_icon_{$id}", 1, (isset($content_pref["content_submit_icon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
+			".$rs -> form_checkbox("content_submit_attach_{$id}", 1, (isset($content_pref["content_submit_attach_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_2."<br />
+			".$rs -> form_checkbox("content_submit_images_{$id}", 1, (isset($content_pref["content_submit_images_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_3."<br />
+			".$rs -> form_checkbox("content_submit_comment_{$id}", 1, (isset($content_pref["content_submit_comment_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_4."<br />
+			".$rs -> form_checkbox("content_submit_rating_{$id}", 1, (isset($content_pref["content_submit_rating_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_5."<br />
+			".$rs -> form_checkbox("content_submit_score_{$id}", 1, (isset($content_pref["content_submit_score_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_6."<br />
+			</td><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_submit_pe_{$id}", 1, (isset($content_pref["content_submit_pe_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_20."<br />
+			".$rs -> form_checkbox("content_submit_visibility_{$id}", 1, (isset($content_pref["content_submit_visibility_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_7."<br />
+			".$rs -> form_checkbox("content_submit_meta_{$id}", 1, (isset($content_pref["content_submit_meta_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_8."<br />
+			".$rs -> form_checkbox("content_submit_layout_{$id}", 1, (isset($content_pref["content_submit_layout_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_9."<br />
+			".$rs -> form_checkbox("content_submit_customtags_{$id}", 1, (isset($content_pref["content_submit_customtags_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_10."<br />
+			".$rs -> form_checkbox("content_submit_presettags_{$id}", 1, (isset($content_pref["content_submit_presettags_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_11."<br />
+			</td></tr></table>
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_submit_custom_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_5;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_submit_custom_number_{$id}");
+			for($i=0;$i<11;$i++){
+				$TOPIC_FIELD .= $rs -> form_option($i, ($content_pref["content_submit_custom_number_{$id}"] == $i ? "1" : "0"), $i);
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_submit_images_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_3;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_submit_images_number_{$id}");
+			for($i=1;$i<16;$i++){
+				$k=$i*2;
+				$TOPIC_FIELD .= $rs -> form_option($k, ($content_pref["content_submit_images_number_{$id}"] == $k ? "1" : "0"), $k);
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_submit_files_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_4;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_submit_files_number_{$id}");
+			for($i=1;$i<6;$i++){
+				$TOPIC_FIELD .= $rs -> form_option($i, ($content_pref["content_submit_files_number_{$id}"] == $i ? "1" : "0"), $i);
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='paththeme' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_5;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_13;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_cat_icon_path_large_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_15;
+			$TOPIC_FIELD = $rs -> form_text("content_cat_icon_path_large_{$id}", 60, $content_pref["content_cat_icon_path_large_{$id}"], 100);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_icon_path_small_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_16;
+			$TOPIC_FIELD = $rs -> form_text("content_cat_icon_path_small_{$id}", 60, $content_pref["content_cat_icon_path_small_{$id}"], 100);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= "<tr><td style='border:0; height:20px;' colspan='2'></td></tr>";
+			
+			//content_icon_path_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_17;
+			$TOPIC_FIELD = $rs -> form_text("content_icon_path_{$id}", 60, $content_pref["content_icon_path_{$id}"], 100);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_icon_path_tmp_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_38." ".CONTENT_ADMIN_OPT_LAN_17;
+			$TOPIC_FIELD = $rs -> form_text("content_icon_path_tmp_{$id}", 60, $content_pref["content_icon_path_tmp_{$id}"], 100);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= "<tr><td style='border:0; height:20px;' colspan='2'></td></tr>";
+			
+			//content_image_path_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_18;
+			$TOPIC_FIELD = $rs -> form_text("content_image_path_{$id}", 60, $content_pref["content_image_path_{$id}"], 100);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_image_path_tmp_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_38." ".CONTENT_ADMIN_OPT_LAN_18;
+			$TOPIC_FIELD = $rs -> form_text("content_image_path_tmp_{$id}", 60, $content_pref["content_image_path_tmp_{$id}"], 100);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= "<tr><td style='border:0; height:20px;' colspan='2'></td></tr>";
+			
+			//content_file_path_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_19;
+			$TOPIC_FIELD = $rs -> form_text("content_file_path_{$id}", 60, $content_pref["content_file_path_{$id}"], 100);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_file_path_tmp_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_38." ".CONTENT_ADMIN_OPT_LAN_19;
+			$TOPIC_FIELD = $rs -> form_text("content_file_path_tmp_{$id}", 60, $content_pref["content_file_path_tmp_{$id}"], 100);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= "<tr><td style='border:0; height:20px;' colspan='2'></td></tr>";
+
+			//content_theme_
+			$dirlist = $fl->get_dirs($plugindir."templates/");
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_20;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_theme_{$id}");
+			$counter = 0;
+			foreach($dirlist as $themedir){
+				$TOPIC_FIELD .= $rs -> form_option($themedir, ($themedir == $content_pref["content_theme_{$id}"] ? "1" : "0"), $themedir);
+				$counter++;
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_layoutscheme_
+			if(!isset($content_pref["content_theme_{$id}"])){
+				$dir = $plugindir."templates/default";
+			}else{
+				if(file_exists($plugindir."templates/".$content_pref["content_theme_{$id}"]."/content_content_template.php")){
+					$dir = $plugindir."templates/".$content_pref["content_theme_{$id}"];
+				}else{
+					$dir = $plugindir."templates/default";
+				}
+			}
+			//get_files($path, $fmask = '', $omit='standard', $recurse_level = 0, $current_level = 0, $dirs_only = FALSE)
+			$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', '.bak');
+			$templatelist = $fl->get_files($dir,"content_content_",$rejectlist);
+
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_21;
+			$TOPIC_FIELD = "
+				".$rs -> form_select_open("content_layout_{$id}")."
+				".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_25, 0, "none");
+				foreach($templatelist as $template){
+					$templatename = substr($template['fname'], 25, -4);
+					$templatename = ($template['fname'] == "content_content_template.php" ? "default" : $templatename);
+					$TOPIC_FIELD .= $rs -> form_option($templatename, ($content_pref["content_layout_{$id}"] == $template['fname'] ? "1" : "0"), $template['fname']);
+				}
+				$TOPIC_FIELD .= $rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+			
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='general' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_6;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_log_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_22;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_log_{$id}", "1", ($content_pref["content_log_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_log_{$id}", "0", ($content_pref["content_log_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_blank_icon_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_23;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_blank_icon_{$id}", "1", ($content_pref["content_blank_icon_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_blank_icon_{$id}", "0", ($content_pref["content_blank_icon_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_blank_caticon_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_24;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_blank_caticon_{$id}", "1", ($content_pref["content_blank_caticon_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_blank_caticon_{$id}", "0", ($content_pref["content_blank_caticon_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_breadcrumb_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_26;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_breadcrumb_catall_{$id}", 1, ($content_pref["content_breadcrumb_catall_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_27."<br />
+			".$rs -> form_checkbox("content_breadcrumb_cat_{$id}", 1, ($content_pref["content_breadcrumb_cat_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_28."<br />
+			".$rs -> form_checkbox("content_breadcrumb_authorall_{$id}", 1, ($content_pref["content_breadcrumb_authorall_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_29."<br />
+			".$rs -> form_checkbox("content_breadcrumb_author_{$id}", 1, ($content_pref["content_breadcrumb_author_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_30."<br />
+			".$rs -> form_checkbox("content_breadcrumb_recent_{$id}", 1, ($content_pref["content_breadcrumb_recent_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_31."<br />
+			</td><td style='white-space:nowrap; vertical-align:top;'>
+			".$rs -> form_checkbox("content_breadcrumb_item_{$id}", 1, ($content_pref["content_breadcrumb_item_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_32."<br />
+			".$rs -> form_checkbox("content_breadcrumb_archive_{$id}", 1, ($content_pref["content_breadcrumb_archive_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_34."<br />
+			".$rs -> form_checkbox("content_breadcrumb_top_{$id}", 1, ($content_pref["content_breadcrumb_top_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_33."<br />
+			".$rs -> form_checkbox("content_breadcrumb_score_{$id}", 1, ($content_pref["content_breadcrumb_score_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_35."<br />
+			</td></tr></table>";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_breadcrumb_seperator
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_36;
+			$TOPIC_FIELD = $rs -> form_text("content_breadcrumb_seperator{$id}", 10, $content_pref["content_breadcrumb_seperator{$id}"], 3);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_breadcrumb_rendertype_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_37;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_breadcrumb_rendertype_{$id}")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_39, ($content_pref["content_breadcrumb_rendertype_{$id}"] == "1" ? "1" : "0"), "1")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_40, ($content_pref["content_breadcrumb_rendertype_{$id}"] == "2" ? "1" : "0"), "2")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_41, ($content_pref["content_breadcrumb_rendertype_{$id}"] == "3" ? "1" : "0"), "3")."
+			".$rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_navigator_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_43;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_navigator_catall_{$id}", 1, ($content_pref["content_navigator_catall_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_27."<br />
+			".$rs -> form_checkbox("content_navigator_cat_{$id}", 1, ($content_pref["content_navigator_cat_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_28."<br />
+			".$rs -> form_checkbox("content_navigator_authorall_{$id}", 1, ($content_pref["content_navigator_authorall_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_29."<br />
+			".$rs -> form_checkbox("content_navigator_author_{$id}", 1, ($content_pref["content_navigator_author_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_30."<br />
+			".$rs -> form_checkbox("content_navigator_recent_{$id}", 1, ($content_pref["content_navigator_recent_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_31."<br />
+			</td><td style='white-space:nowrap; vertical-align:top;'>
+			".$rs -> form_checkbox("content_navigator_item_{$id}", 1, ($content_pref["content_navigator_item_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_32."<br />
+			".$rs -> form_checkbox("content_navigator_archive_{$id}", 1, ($content_pref["content_navigator_archive_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_34."<br />
+			".$rs -> form_checkbox("content_navigator_top_{$id}", 1, ($content_pref["content_navigator_top_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_33."<br />
+			".$rs -> form_checkbox("content_navigator_score_{$id}", 1, ($content_pref["content_navigator_score_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_35."<br />
+			</td></tr></table>";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_search_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_44;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_search_catall_{$id}", 1, ($content_pref["content_search_catall_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_27."<br />
+			".$rs -> form_checkbox("content_search_cat_{$id}", 1, ($content_pref["content_search_cat_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_28."<br />
+			".$rs -> form_checkbox("content_search_authorall_{$id}", 1, ($content_pref["content_search_authorall_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_29."<br />
+			".$rs -> form_checkbox("content_search_author_{$id}", 1, ($content_pref["content_search_author_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_30."<br />
+			".$rs -> form_checkbox("content_search_recent_{$id}", 1, ($content_pref["content_search_recent_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_31."<br />
+			</td><td style='white-space:nowrap; vertical-align:top;'>
+			".$rs -> form_checkbox("content_search_item_{$id}", 1, ($content_pref["content_search_item_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_32."<br />
+			".$rs -> form_checkbox("content_search_archive_{$id}", 1, ($content_pref["content_search_archive_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_34."<br />
+			".$rs -> form_checkbox("content_search_top_{$id}", 1, ($content_pref["content_search_top_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_33."<br />
+			".$rs -> form_checkbox("content_search_score_{$id}", 1, ($content_pref["content_search_score_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_35."<br />
+			</td></tr></table>";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_ordering_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_46;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_ordering_cat_{$id}", 1, ($content_pref["content_ordering_cat_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_28."<br />
+			".$rs -> form_checkbox("content_ordering_authorall_{$id}", 1, ($content_pref["content_ordering_authorall_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_29."<br />
+			".$rs -> form_checkbox("content_ordering_author_{$id}", 1, ($content_pref["content_ordering_author_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_30."<br />
+			</td><td style='white-space:nowrap; vertical-align:top;'>
+			".$rs -> form_checkbox("content_ordering_recent_{$id}", 1, ($content_pref["content_ordering_recent_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_31."<br />
+			".$rs -> form_checkbox("content_ordering_item_{$id}", 1, ($content_pref["content_ordering_item_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_32."<br />
+			".$rs -> form_checkbox("content_ordering_archive_{$id}", 1, ($content_pref["content_ordering_archive_{$id}"] ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_34."<br />			</td></tr></table>
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_searchmenu_rendertype_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_48;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_searchmenu_rendertype_{$id}")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_39, ($content_pref["content_searchmenu_rendertype_{$id}"] == "1" ? "1" : "0"), "1")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_40, ($content_pref["content_searchmenu_rendertype_{$id}"] == "2" ? "1" : "0"), "2")."
+			".$rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_nextprev_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_49;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_nextprev_{$id}", "1", ($content_pref["content_nextprev_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_nextprev_{$id}", "0", ($content_pref["content_nextprev_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_nextprev_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_50;
+			$TOPIC_FIELD = $rs -> form_select_open("content_nextprev_number_{$id}");
+			for($i=1;$i<21;$i++){
+				$TOPIC_FIELD .= $rs -> form_option($i, ($content_pref["content_nextprev_number_{$id}"] == $i ? "1" : "0"), $i);
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_defaultorder_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_51;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_defaultorder_{$id}")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_1, ($content_pref["content_defaultorder_{$id}"] == "orderaheading" ? "1" : "0"), "orderaheading")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_2, ($content_pref["content_defaultorder_{$id}"] == "orderdheading" ? "1" : "0"), "orderdheading")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_3, ($content_pref["content_defaultorder_{$id}"] == "orderadate" ? "1" : "0"), "orderadate")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_4, ($content_pref["content_defaultorder_{$id}"] == "orderddate" ? "1" : "0"), "orderddate")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_5, ($content_pref["content_defaultorder_{$id}"] == "orderarefer" ? "1" : "0"), "orderarefer")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_6, ($content_pref["content_defaultorder_{$id}"] == "orderdrefer" ? "1" : "0"), "orderdrefer")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_7, ($content_pref["content_defaultorder_{$id}"] == "orderaparent" ? "1" : "0"), "orderaparent")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_8, ($content_pref["content_defaultorder_{$id}"] == "orderdparent" ? "1" : "0"), "orderdparent")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_9, ($content_pref["content_defaultorder_{$id}"] == "orderaorder" ? "1" : "0"), "orderaorder")."
+			".$rs -> form_option(CONTENT_ORDER_LAN_10, ($content_pref["content_defaultorder_{$id}"] == "orderdorder" ? "1" : "0"), "orderdorder")."
+			".$rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_upload_image_size_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_52;
+			$TOPIC_HEADING = CONTENT_ADMIN_OPT_LAN_53;
+			$TOPIC_HELP = CONTENT_ADMIN_OPT_LAN_54;
+			$TOPIC_FIELD = $rs -> form_text("content_upload_image_size_{$id}", 10, $content_pref["content_upload_image_size_{$id}"], 3)." ".CONTENT_ADMIN_OPT_LAN_61;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+			//content_upload_image_size_thumb_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_55;
+			$TOPIC_HEADING = CONTENT_ADMIN_OPT_LAN_56;
+			$TOPIC_HELP = CONTENT_ADMIN_OPT_LAN_57;
+			$TOPIC_FIELD = $rs -> form_text("content_upload_image_size_thumb_{$id}", 10, $content_pref["content_upload_image_size_thumb_{$id}"], 3)." ".CONTENT_ADMIN_OPT_LAN_61;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+			//content_upload_icon_size_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_58;
+			$TOPIC_HEADING = CONTENT_ADMIN_OPT_LAN_59;
+			$TOPIC_HELP = CONTENT_ADMIN_OPT_LAN_60;
+			$TOPIC_FIELD = $rs -> form_text("content_upload_icon_size_{$id}", 10, $content_pref["content_upload_icon_size_{$id}"], 3)." ".CONTENT_ADMIN_OPT_LAN_61;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='contentmanager' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_7;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+			
+			//content_manager_class_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_62;
+			$TOPIC_FIELD = r_userclass("content_manager_class_{$id}", $content_pref["content_manager_class_{$id}"], 'off', "public,classes").$rs -> form_hidden("content_manager_allowed_{$id}", $content_pref["content_manager_allowed_{$id}"]);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='recentpages' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_9;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_list sections
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_list_icon_{$id}", 1, (isset($content_pref["content_list_icon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
+			".$rs -> form_checkbox("content_list_subheading_{$id}", 1, (isset($content_pref["content_list_subheading_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_12."<br />
+			".$rs -> form_checkbox("content_list_summary_{$id}", 1, (isset($content_pref["content_list_summary_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_13."<br />
+			".$rs -> form_checkbox("content_list_text_{$id}", 1, (isset($content_pref["content_list_text_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_14."<br />
+			".$rs -> form_checkbox("content_list_date_{$id}", 1, (isset($content_pref["content_list_date_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_15."<br />
+			".$rs -> form_checkbox("content_list_parent_{$id}", 1, (isset($content_pref["content_list_parent_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_21."<br />
+			".$rs -> form_checkbox("content_list_refer_{$id}", 1, (isset($content_pref["content_list_refer_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_22."<br />
+			</td><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_list_authorname_{$id}", 1, (isset($content_pref["content_list_authorname_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_16."<br />
+			".$rs -> form_checkbox("content_list_authoremail_{$id}", 1, (isset($content_pref["content_list_authoremail_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_17."<br />
+			".$rs -> form_checkbox("content_list_authorprofile_{$id}", 1, (isset($content_pref["content_list_authorprofile_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_18."<br />
+			".$rs -> form_checkbox("content_list_authoricon_{$id}", 1, (isset($content_pref["content_list_authoricon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_19."<br />
+			".$rs -> form_checkbox("content_list_rating_{$id}", 1, (isset($content_pref["content_list_rating_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_5."<br />
+			".$rs -> form_checkbox("content_list_peicon_{$id}", 1, (isset($content_pref["content_list_peicon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_20."<br />
+			".$rs -> form_checkbox("content_list_editicon_{$id}", 1, (isset($content_pref["content_list_editicon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_26."<br />
+			</td></tr></table>
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_subheading_char_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_12."<br />".CONTENT_ADMIN_OPT_LAN_77;
+			$TOPIC_FIELD = $rs -> form_text("content_list_subheading_char_{$id}", 10, $content_pref["content_list_subheading_char_{$id}"], 3)." (".CONTENT_ADMIN_OPT_LAN_79.")";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_subheading_post_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_12."<br />".CONTENT_ADMIN_OPT_LAN_78;
+			$TOPIC_FIELD = $rs -> form_text("content_list_subheading_post_{$id}", 10, $tp->toHTML($content_pref["content_list_subheading_post_{$id}"],"","defs"), 20);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_summary_char_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_13."<br />".CONTENT_ADMIN_OPT_LAN_77;
+			$TOPIC_FIELD = $rs -> form_text("content_list_summary_char_{$id}", 10, $content_pref["content_list_summary_char_{$id}"], 3)." (".CONTENT_ADMIN_OPT_LAN_79.")";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_summary_post_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_13."<br />".CONTENT_ADMIN_OPT_LAN_78;
+			$TOPIC_FIELD = $rs -> form_text("content_list_summary_post_{$id}", 10, $tp->toHTML($content_pref["content_list_summary_post_{$id}"],"","defs"), 20);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_text_char_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_82." : ".CONTENT_ADMIN_OPT_LAN_81;
+			$TOPIC_FIELD = $rs -> form_text("content_list_text_char_{$id}", 10, $content_pref["content_list_text_char_{$id}"], 3)." (".CONTENT_ADMIN_OPT_LAN_80.")";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_text_post_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_82." : ".CONTENT_ADMIN_OPT_LAN_78;
+			$TOPIC_FIELD = $rs -> form_text("content_list_text_post_{$id}", 10, $tp->toHTML($content_pref["content_list_text_post_{$id}"],"","defs"), 20);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_text_link_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_82." : ".CONTENT_ADMIN_OPT_LAN_83;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_list_text_link_{$id}", "1", ($content_pref["content_list_text_link_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_list_text_link_{$id}", "0", ($content_pref["content_list_text_link_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+			
+			//content_list_authoremail_nonmember_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_64;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_list_authoremail_nonmember_{$id}", "1", ($content_pref["content_list_authoremail_nonmember_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_list_authoremail_nonmember_{$id}", "0", ($content_pref["content_list_authoremail_nonmember_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_peicon_all_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_69;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_list_peicon_all_{$id}", "1", ($content_pref["content_list_peicon_all_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_list_peicon_all_{$id}", "0", ($content_pref["content_list_peicon_all_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_rating_all_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_70;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_list_rating_all_{$id}", "1", ($content_pref["content_list_rating_all_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_list_rating_all_{$id}", "0", ($content_pref["content_list_rating_all_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+			
+			//content_list_datestyle_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_67;
+			$TOPIC_FIELD = $rs -> form_text("content_list_datestyle_{$id}", 15, $content_pref["content_list_datestyle_{$id}"], 50);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='catpages' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_10;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			$text .= $TOPIC_ROW_SPACER;
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_16;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_cat_sections_allcats (view all categories)
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_catall_icon_{$id}", 1, (isset($content_pref["content_catall_icon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
+			".$rs -> form_checkbox("content_catall_subheading_{$id}", 1, (isset($content_pref["content_catall_subheading_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_12."<br />
+			".$rs -> form_checkbox("content_catall_text_{$id}", 1, (isset($content_pref["content_catall_text_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_14."<br />
+			".$rs -> form_checkbox("content_catall_date_{$id}", 1, (isset($content_pref["content_catall_date_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_15."<br />
+			".$rs -> form_checkbox("content_catall_rating_{$id}", 1, (isset($content_pref["content_catall_rating_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_5."<br />
+			".$rs -> form_checkbox("content_catall_peicon_{$id}", 1, (isset($content_pref["content_catall_peicon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_20."<br />
+			</td><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_catall_authorname_{$id}", 1, (isset($content_pref["content_catall_authorname_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_16."<br />
+			".$rs -> form_checkbox("content_catall_authoremail_{$id}", 1, (isset($content_pref["content_catall_authoremail_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_17."<br />
+			".$rs -> form_checkbox("content_catall_authorprofile_{$id}", 1, (isset($content_pref["content_catall_authorprofile_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_18."<br />
+			".$rs -> form_checkbox("content_catall_authoricon_{$id}", 1, (isset($content_pref["content_catall_authoricon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_19."<br />
+			".$rs -> form_checkbox("content_catall_comment_{$id}", 1, (isset($content_pref["content_catall_comment_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_4."<br />
+			".$rs -> form_checkbox("content_catall_amount_{$id}", 1, (isset($content_pref["content_catall_amount_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_23."<br />
+			</td></tr></table>";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_text_char_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_82." : ".CONTENT_ADMIN_OPT_LAN_81;
+			$TOPIC_FIELD = $rs -> form_text("content_catall_text_char_{$id}", 10, $content_pref["content_catall_text_char_{$id}"], 3)." (".CONTENT_ADMIN_OPT_LAN_80.")";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_text_post_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_82." : ".CONTENT_ADMIN_OPT_LAN_78;
+			$TOPIC_FIELD = $rs -> form_text("content_catall_text_post_{$id}", 10, $tp->toHTML($content_pref["content_catall_text_post_{$id}"],"","defs"), 20);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_text_link_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_82." : ".CONTENT_ADMIN_OPT_LAN_83;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_catall_text_link_{$id}", "1", ($content_pref["content_catall_text_link_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_catall_text_link_{$id}", "0", ($content_pref["content_catall_text_link_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_ROW_SPACER;
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_17;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_cat_sections (view category)
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1." ".CONTENT_ADMIN_OPT_LAN_SECTION_28;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_cat_icon_{$id}", 1, (isset($content_pref["content_cat_icon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
+			".$rs -> form_checkbox("content_cat_subheading_{$id}", 1, (isset($content_pref["content_cat_subheading_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_12."<br />
+			".$rs -> form_checkbox("content_cat_text_{$id}", 1, (isset($content_pref["content_cat_text_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_14."<br />
+			".$rs -> form_checkbox("content_cat_date_{$id}", 1, (isset($content_pref["content_cat_date_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_15."<br />
+			".$rs -> form_checkbox("content_cat_rating_{$id}", 1, (isset($content_pref["content_cat_rating_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_5."<br />
+			".$rs -> form_checkbox("content_cat_peicon_{$id}", 1, (isset($content_pref["content_cat_peicon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_20."<br />
+			</td><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_cat_authorname_{$id}", 1, (isset($content_pref["content_cat_authorname_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_16."<br />
+			".$rs -> form_checkbox("content_cat_authoremail_{$id}", 1, (isset($content_pref["content_cat_authoremail_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_17."<br />
+			".$rs -> form_checkbox("content_cat_authorprofile_{$id}", 1, (isset($content_pref["content_cat_authorprofile_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_18."<br />
+			".$rs -> form_checkbox("content_cat_authoricon_{$id}", 1, (isset($content_pref["content_cat_authoricon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_19."<br />
+			".$rs -> form_checkbox("content_cat_comment_{$id}", 1, (isset($content_pref["content_cat_comment_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_4."<br />
+			".$rs -> form_checkbox("content_cat_amount_{$id}", 1, (isset($content_pref["content_cat_amount_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_23."<br />
+			</td></tr></table>";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_sections_subcategory_list (view category)
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1." ".CONTENT_ADMIN_OPT_LAN_SECTION_29;
+			$TOPIC_FIELD = "
+			".$rs -> form_checkbox("content_catsub_icon_{$id}", 1, (isset($content_pref["content_catsub_icon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
+			".$rs -> form_checkbox("content_catsub_subheading_{$id}", 1, (isset($content_pref["content_catsub_subheading_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_12."<br />
+			".$rs -> form_checkbox("content_catsub_amount_{$id}", 1, (isset($content_pref["content_catsub_amount_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_23."<br />
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_text_char_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_82." : ".CONTENT_ADMIN_OPT_LAN_81;
+			$TOPIC_FIELD = $rs -> form_text("content_cat_text_char_{$id}", 10, $content_pref["content_cat_text_char_{$id}"], 3)." (".CONTENT_ADMIN_OPT_LAN_80.")";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_text_post_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_82." : ".CONTENT_ADMIN_OPT_LAN_78;
+			$TOPIC_FIELD = $rs -> form_text("content_cat_text_post_{$id}", 10, $tp->toHTML($content_pref["content_cat_text_post_{$id}"],"","defs"), 20);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_text_link_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_82." : ".CONTENT_ADMIN_OPT_LAN_83;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_cat_text_link_{$id}", "1", ($content_pref["content_cat_text_link_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_cat_text_link_{$id}", "0", ($content_pref["content_cat_text_link_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+			
+			//content_cat_authoremail_nonmember_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_64;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_cat_authoremail_nonmember_{$id}", "1", ($content_pref["content_cat_authoremail_nonmember_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_cat_authoremail_nonmember_{$id}", "0", ($content_pref["content_cat_authoremail_nonmember_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_peicon_all_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_69;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_cat_peicon_all_{$id}", "1", ($content_pref["content_cat_peicon_all_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_cat_peicon_all_{$id}", "0", ($content_pref["content_cat_peicon_all_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_list_rating_all_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_70;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_cat_rating_all_{$id}", "1", ($content_pref["content_cat_rating_all_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_cat_rating_all_{$id}", "0", ($content_pref["content_cat_rating_all_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_showparent_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_84;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_cat_showparent_{$id}", "1", ($content_pref["content_cat_showparent_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_cat_showparent_{$id}", "0", ($content_pref["content_cat_showparent_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_showparentsub_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_85;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_cat_showparentsub_{$id}", "1", ($content_pref["content_cat_showparentsub_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_cat_showparentsub_{$id}", "0", ($content_pref["content_cat_showparentsub_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_listtype_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_86;
+			$TOPIC_FIELD = CONTENT_ADMIN_OPT_LAN_87."<br /><br />
+			".$rs -> form_radio("content_cat_listtype_{$id}", "1", ($content_pref["content_cat_listtype_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_cat_listtype_{$id}", "0", ($content_pref["content_cat_listtype_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_menuorder_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_88;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_cat_menuorder_{$id}")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_89, ($content_pref["content_cat_menuorder_{$id}"] == "1" ? "1" : "0"), "1")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_90, ($content_pref["content_cat_menuorder_{$id}"] == "2" ? "1" : "0"), "2")."
+			".$rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_cat_rendertype_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_91;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_cat_rendertype_{$id}")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_92, ($content_pref["content_cat_rendertype_{$id}"] == "1" ? "1" : "0"), "1")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_41, ($content_pref["content_cat_rendertype_{$id}"] == "2" ? "1" : "0"), "2")."
+			".$rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='contentpages' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_11;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_content_sections
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
+			$TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_content_icon_{$id}", 1, (isset($content_pref["content_content_icon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
+			".$rs -> form_checkbox("content_content_attach_{$id}", 1, (isset($content_pref["content_content_attach_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_2."<br />
+			".$rs -> form_checkbox("content_content_images_{$id}", 1, (isset($content_pref["content_content_images_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_3."<br />
+			".$rs -> form_checkbox("content_content_subheading_{$id}", 1, (isset($content_pref["content_content_subheading_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_12."<br />
+			".$rs -> form_checkbox("content_content_summary_{$id}", 1, (isset($content_pref["content_content_summary_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_13."<br />
+			".$rs -> form_checkbox("content_content_authorname_{$id}", 1, (isset($content_pref["content_content_authorname_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_16."<br />
+			".$rs -> form_checkbox("content_content_authoremail_{$id}", 1, (isset($content_pref["content_content_authoremail_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_17."<br />
+			".$rs -> form_checkbox("content_content_authorprofile_{$id}", 1, (isset($content_pref["content_content_authorprofile_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_18."<br />
+			".$rs -> form_checkbox("content_content_authoricon_{$id}", 1, (isset($content_pref["content_content_authoricon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_19."<br />
+			</td><td style='white-space:nowrap;'>
+			".$rs -> form_checkbox("content_content_date_{$id}", 1, (isset($content_pref["content_content_date_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_15."<br />
+			".$rs -> form_checkbox("content_content_parent_{$id}", 1, (isset($content_pref["content_content_parent_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_21."<br />
+			".$rs -> form_checkbox("content_content_refer_{$id}", 1, (isset($content_pref["content_content_refer_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_22."<br />
+			".$rs -> form_checkbox("content_content_rating_{$id}", 1, (isset($content_pref["content_content_rating_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_5."<br />
+			".$rs -> form_checkbox("content_content_peicon_{$id}", 1, (isset($content_pref["content_content_peicon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_20."<br />
+			".$rs -> form_checkbox("content_content_comment_{$id}", 1, (isset($content_pref["content_content_comment_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_4."<br />
+			".$rs -> form_checkbox("content_content_editicon_{$id}", 1, (isset($content_pref["content_content_editicon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_26."<br />
+			".$rs -> form_checkbox("content_content_customtags_{$id}", 1, (isset($content_pref["content_content_customtags_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_10."<br />
+			".$rs -> form_checkbox("content_content_presettags_{$id}", 1, (isset($content_pref["content_content_presettags_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_11."<br />
+			</td></tr></table>
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_content_authoremail_nonmember_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_64;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_content_authoremail_nonmember_{$id}", "1", ($content_pref["content_content_authoremail_nonmember_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_content_authoremail_nonmember_{$id}", "0", ($content_pref["content_content_authoremail_nonmember_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_content_peicon_all_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_69;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_content_peicon_all_{$id}", "1", ($content_pref["content_content_peicon_all_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_content_peicon_all_{$id}", "0", ($content_pref["content_content_peicon_all_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_content_rating_all_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_70;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_content_rating_all_{$id}", "1", ($content_pref["content_content_rating_all_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_content_rating_all_{$id}", "0", ($content_pref["content_content_rating_all_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_content_comment_all_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_71;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_content_comment_all_{$id}", "1", ($content_pref["content_content_comment_all_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_content_comment_all_{$id}", "0", ($content_pref["content_content_comment_all_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_content_pagenames_rendertype_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_73;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_content_pagenames_rendertype_{$id}", "0", ($content_pref["content_content_pagenames_rendertype_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_75."
+			".$rs -> form_radio("content_content_pagenames_rendertype_{$id}", "1", ($content_pref["content_content_pagenames_rendertype_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_76."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='authorpage' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_12;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_author_sections
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
+			$TOPIC_FIELD = "
+			".$rs -> form_checkbox("content_author_lastitem_{$id}", 1, (isset($content_pref["content_author_lastitem_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_24."<br />
+			".$rs -> form_checkbox("content_author_amount_{$id}", 1, (isset($content_pref["content_author_amount_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_25."<br />
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+			
+			//content_author_nextprev_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_49;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_author_nextprev_{$id}", "1", ($content_pref["content_author_nextprev_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_author_nextprev_{$id}", "0", ($content_pref["content_author_nextprev_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_author_nextprev_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_50;
+			$TOPIC_FIELD = $rs -> form_select_open("content_author_nextprev_number_{$id}");
+			for($i=2;$i<63;$i++){
+				$TOPIC_FIELD .= $rs -> form_option($i, ($content_pref["content_author_nextprev_number_{$id}"] == $i ? "1" : "0"), $i);
+				$i++;
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='archivepage' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_13;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_archive_sections
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
+			$TOPIC_FIELD = "
+			".$rs -> form_checkbox("content_archive_date_{$id}", 1, (isset($content_pref["content_archive_date_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_15."<br />
+			".$rs -> form_checkbox("content_archive_authorname_{$id}", 1, (isset($content_pref["content_archive_authorname_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_16."<br />
+			".$rs -> form_checkbox("content_archive_authoremail_{$id}", 1, (isset($content_pref["content_archive_authoremail_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_17."<br />
+			".$rs -> form_checkbox("content_archive_authorprofile_{$id}", 1, (isset($content_pref["content_archive_authorprofile_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_18."<br />
+			".$rs -> form_checkbox("content_archive_authoricon_{$id}", 1, (isset($content_pref["content_archive_authoricon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_19."<br />
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_archive_authoremail_nonmember_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_64;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_archive_authoremail_nonmember_{$id}", "1", ($content_pref["content_archive_authoremail_nonmember_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_archive_authoremail_nonmember_{$id}", "0", ($content_pref["content_archive_authoremail_nonmember_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+			
+			//content_archive_nextprev_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_49;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_archive_nextprev_{$id}", "1", ($content_pref["content_archive_nextprev_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_archive_nextprev_{$id}", "0", ($content_pref["content_archive_nextprev_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_nextprev_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_50;
+			$TOPIC_FIELD = $rs -> form_select_open("content_archive_nextprev_number_{$id}");
+			for($i=2;$i<63;$i++){
+				$TOPIC_FIELD .= $rs -> form_option($i, ($content_pref["content_archive_nextprev_number_{$id}"] == $i ? "1" : "0"), $i);
+				$i++;
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_archive_letterindex_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_65;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_archive_letterindex_{$id}", "1", ($content_pref["content_archive_letterindex_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_archive_letterindex_{$id}", "0", ($content_pref["content_archive_letterindex_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_archive_datestyle_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_67;
+			$TOPIC_FIELD = $rs -> form_text("content_archive_datestyle_{$id}", 15, $content_pref["content_archive_datestyle_{$id}"], 50);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='toppage' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_14;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_top_sections
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
+			$TOPIC_FIELD = "
+			".$rs -> form_checkbox("content_top_icon_{$id}", 1, (isset($content_pref["content_top_icon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
+			".$rs -> form_checkbox("content_top_authorname_{$id}", 1, (isset($content_pref["content_top_authorname_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_16."<br />
+			".$rs -> form_checkbox("content_top_authoremail_{$id}", 1, (isset($content_pref["content_top_authoremail_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_17."<br />
+			".$rs -> form_checkbox("content_top_authorprofile_{$id}", 1, (isset($content_pref["content_top_authorprofile_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_18."<br />
+			".$rs -> form_checkbox("content_top_authoricon_{$id}", 1, (isset($content_pref["content_top_authoricon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_19."<br />
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_top_authoremail_nonmember_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_64;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_top_authoremail_nonmember_{$id}", "1", ($content_pref["content_top_authoremail_nonmember_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_top_authoremail_nonmember_{$id}", "0", ($content_pref["content_top_authoremail_nonmember_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='scorepage' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_15;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_score_sections
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_SECTION_1;
+			$TOPIC_FIELD = "
+			".$rs -> form_checkbox("content_score_icon_{$id}", 1, (isset($content_pref["content_score_icon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_27."<br />
+			".$rs -> form_checkbox("content_score_authorname_{$id}", 1, (isset($content_pref["content_score_authorname_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_16."<br />
+			".$rs -> form_checkbox("content_score_authoremail_{$id}", 1, (isset($content_pref["content_score_authoremail_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_17."<br />
+			".$rs -> form_checkbox("content_score_authorprofile_{$id}", 1, (isset($content_pref["content_score_authorprofile_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_18."<br />
+			".$rs -> form_checkbox("content_score_authoricon_{$id}", 1, (isset($content_pref["content_score_authoricon_{$id}"]) ? "1" : "0"))." ".CONTENT_ADMIN_OPT_LAN_SECTION_19."<br />
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_score_authoremail_nonmember_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_64;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_score_authoremail_nonmember_{$id}", "1", ($content_pref["content_score_authoremail_nonmember_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_score_authoremail_nonmember_{$id}", "0", ($content_pref["content_score_authoremail_nonmember_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			<div id='menu' style='display:none; text-align:center'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_8;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_menu_caption_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_93;
+			$TOPIC_FIELD = $rs -> form_text("content_menu_caption_{$id}", 15, $tp->toHTML($content_pref["content_menu_caption_{$id}"],"","defs"), 50);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_search_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_94;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_search_{$id}", "1", ($content_pref["content_menu_search_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_search_{$id}", "0", ($content_pref["content_menu_search_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_sort_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_95;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_sort_{$id}", "1", ($content_pref["content_menu_sort_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_sort_{$id}", "0", ($content_pref["content_menu_sort_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_ROW_SPACER;
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_20;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_menu_links_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_96;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_links_{$id}", "1", ($content_pref["content_menu_links_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_links_{$id}", "0", ($content_pref["content_menu_links_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31." (".CONTENT_ADMIN_OPT_LAN_97.")
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+			
+			//content_menu_viewallcat_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_98;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_viewallcat_{$id}", "1", ($content_pref["content_menu_viewallcat_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_viewallcat_{$id}", "0", ($content_pref["content_menu_viewallcat_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_viewallauthor_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_99;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_viewallauthor_{$id}", "1", ($content_pref["content_menu_viewallauthor_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_viewallauthor_{$id}", "0", ($content_pref["content_menu_viewallauthor_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_viewallitems_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_100;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_viewallitems_{$id}", "1", ($content_pref["content_menu_viewallitems_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_viewallitems_{$id}", "0", ($content_pref["content_menu_viewallitems_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_viewtoprated_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_101;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_viewtoprated_{$id}", "1", ($content_pref["content_menu_viewtoprated_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_viewtoprated_{$id}", "0", ($content_pref["content_menu_viewtoprated_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_viewtopscore_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_102;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_viewtopscore_{$id}", "1", ($content_pref["content_menu_viewtopscore_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_viewtopscore_{$id}", "0", ($content_pref["content_menu_viewtopscore_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_viewrecent_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_103;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_viewrecent_{$id}", "1", ($content_pref["content_menu_viewrecent_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_viewrecent_{$id}", "0", ($content_pref["content_menu_viewrecent_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_viewsubmit_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_104;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_viewsubmit_{$id}", "1", ($content_pref["content_menu_viewsubmit_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_viewsubmit_{$id}", "0", ($content_pref["content_menu_viewsubmit_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_links_icon_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_105;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_menu_links_icon_{$id}")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_107, ($content_pref["content_menu_links_icon_{$id}"] == "0" ? "1" : "0"), 0)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_108, ($content_pref["content_menu_links_icon_{$id}"] == "1" ? "1" : "0"), 1)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_109, ($content_pref["content_menu_links_icon_{$id}"] == "2" ? "1" : "0"), 2)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_110, ($content_pref["content_menu_links_icon_{$id}"] == "3" ? "1" : "0"), 3)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_111, ($content_pref["content_menu_links_icon_{$id}"] == "4" ? "1" : "0"), 4)."
+			".$rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_links_dropdown_ (rendertype)
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_114;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_links_dropdown_{$id}", "1", ($content_pref["content_menu_links_dropdown_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_76."
+			".$rs -> form_radio("content_menu_links_dropdown_{$id}", "0", ($content_pref["content_menu_links_dropdown_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_75."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_links_caption_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_115;
+			$TOPIC_FIELD = $rs -> form_text("content_menu_links_caption_{$id}", 15, $tp->toHTML($content_pref["content_menu_links_caption_{$id}"],"","defs"), 50)." (".CONTENT_ADMIN_OPT_LAN_116.")";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_ROW_SPACER;
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_18;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_menu_cat_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_117;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_cat_{$id}", "1", ($content_pref["content_menu_cat_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_cat_{$id}", "0", ($content_pref["content_menu_cat_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_cat_main_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_118;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_cat_main_{$id}", "1", ($content_pref["content_menu_cat_main_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_cat_main_{$id}", "0", ($content_pref["content_menu_cat_main_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_cat_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_120;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_cat_number_{$id}", "1", ($content_pref["content_menu_cat_number_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_cat_number_{$id}", "0", ($content_pref["content_menu_cat_number_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_cat_icon_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_121;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_menu_cat_icon_{$id}")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_107, ($content_pref["content_menu_cat_icon_{$id}"] == "0" ? "1" : "0"), 0)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_108, ($content_pref["content_menu_cat_icon_{$id}"] == "1" ? "1" : "0"), 1)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_109, ($content_pref["content_menu_cat_icon_{$id}"] == "2" ? "1" : "0"), 2)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_110, ($content_pref["content_menu_cat_icon_{$id}"] == "3" ? "1" : "0"), 3)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_111, ($content_pref["content_menu_cat_icon_{$id}"] == "4" ? "1" : "0"), 4)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_112, ($content_pref["content_menu_cat_icon_{$id}"] == "5" ? "1" : "0"), 5)."
+			".$rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_cat_icon_default_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_122;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_menu_cat_icon_default_{$id}")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_107, ($content_pref["content_menu_cat_icon_default_{$id}"] == "0" ? "1" : "0"), 0)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_108, ($content_pref["content_menu_cat_icon_default_{$id}"] == "1" ? "1" : "0"), 1)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_109, ($content_pref["content_menu_cat_icon_default_{$id}"] == "2" ? "1" : "0"), 2)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_110, ($content_pref["content_menu_cat_icon_default_{$id}"] == "3" ? "1" : "0"), 3)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_111, ($content_pref["content_menu_cat_icon_default_{$id}"] == "4" ? "1" : "0"), 4)."
+			".$rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_cat_dropdown_ (rendertype)
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_123;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_cat_dropdown_{$id}", "1", ($content_pref["content_menu_cat_dropdown_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_76."
+			".$rs -> form_radio("content_menu_cat_dropdown_{$id}", "0", ($content_pref["content_menu_cat_dropdown_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_75."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_cat_caption_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_124;
+			$TOPIC_FIELD = $rs -> form_text("content_menu_cat_caption_{$id}", 15, $tp->toHTML($content_pref["content_menu_cat_caption_{$id}"],"","defs"), 50);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_ROW_SPACER;
+
+			$TOPIC_CAPTION = CONTENT_ADMIN_OPT_LAN_MENU_19;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+			//content_menu_recent_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_125;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_recent_{$id}", "1", ($content_pref["content_menu_recent_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_recent_{$id}", "0", ($content_pref["content_menu_recent_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_date_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_126;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_recent_date_{$id}", "1", ($content_pref["content_menu_recent_date_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_recent_date_{$id}", "0", ($content_pref["content_menu_recent_date_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_datestyle_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_67;
+			$TOPIC_FIELD = $rs -> form_text("content_menu_recent_datestyle_{$id}", 15, $content_pref["content_menu_recent_datestyle_{$id}"], 50);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_author_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_127;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_recent_author_{$id}", "1", ($content_pref["content_menu_recent_author_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_recent_author_{$id}", "0", ($content_pref["content_menu_recent_author_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_subheading_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_128;
+			$TOPIC_FIELD = "
+			".$rs -> form_radio("content_menu_recent_subheading_{$id}", "1", ($content_pref["content_menu_recent_subheading_{$id}"] ? "1" : "0"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_30."
+			".$rs -> form_radio("content_menu_recent_subheading_{$id}", "0", ($content_pref["content_menu_recent_subheading_{$id}"] ? "0" : "1"), "", "").CONTENT_ADMIN_OPT_LAN_SECTION_31."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_subheading_char_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_129;
+			$TOPIC_FIELD = $rs -> form_text("content_menu_recent_subheading_char_{$id}", 10, $content_pref["content_menu_recent_subheading_char_{$id}"], 3);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_subheading_post_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_130;
+			$TOPIC_FIELD = $rs -> form_text("content_menu_recent_subheading_post_{$id}", 10, $tp->toHTML($content_pref["content_menu_recent_subheading_post_{$id}"],"","defs"), 30);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_number_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_131;
+			$TOPIC_FIELD = $rs -> form_select_open("content_menu_recent_number_{$id}");
+			for($i=1;$i<16;$i++){
+				$TOPIC_FIELD .= $rs -> form_option($i, ($content_pref["content_menu_recent_number_{$id}"] == $i ? "1" : "0"), $i);
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close();
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_icon_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_132;
+			$TOPIC_FIELD = "
+			".$rs -> form_select_open("content_menu_recent_icon_{$id}")."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_107, ($content_pref["content_menu_recent_icon_{$id}"] == "0" ? "1" : "0"), 0)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_108, ($content_pref["content_menu_recent_icon_{$id}"] == "1" ? "1" : "0"), 1)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_109, ($content_pref["content_menu_recent_icon_{$id}"] == "2" ? "1" : "0"), 2)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_110, ($content_pref["content_menu_recent_icon_{$id}"] == "3" ? "1" : "0"), 3)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_111, ($content_pref["content_menu_recent_icon_{$id}"] == "4" ? "1" : "0"), 4)."
+			".$rs -> form_option(CONTENT_ADMIN_OPT_LAN_113, ($content_pref["content_menu_recent_icon_{$id}"] == "5" ? "1" : "0"), 5)."
+			".$rs -> form_select_close()."
+			";
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_icon_width_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_133;
+			$TOPIC_FIELD = CONTENT_ADMIN_OPT_LAN_134."<br /><br />".$rs -> form_text("content_menu_recent_icon_width_{$id}", 10, $content_pref["content_menu_recent_icon_width_{$id}"], 3)." ".CONTENT_ADMIN_OPT_LAN_61;
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			//content_menu_recent_caption_
+			$TOPIC_TOPIC = CONTENT_ADMIN_OPT_LAN_135;
+			$TOPIC_FIELD = $rs -> form_text("content_menu_recent_caption_{$id}", 15, $tp->toHTML($content_pref["content_menu_recent_caption_{$id}"],"","defs"), 50);
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND);
+
+			$text .= $TOPIC_TABLE_END;
+
+			$text .= "
+			</form>
+			</div>";
+
+			$ns -> tablerender($caption, $text);
+		}
+
+		function pref_submit() {
+			global $id;
+			$text = "
+			<tr>
+			<td colspan='2' style='text-align:center' class='forumheader'>
+				<input class='button' type='submit' name='updateoptions' value='".CONTENT_ADMIN_OPT_LAN_2."' /> <input type='hidden' name='options_type' value='".$id."' />
+			</td>
+			</tr>";
+
+			return $text;
+		}
+
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/handlers/content_preset.php 75/e107_plugins/content/handlers/content_preset.php
--- 6171/e107_plugins/content/handlers/content_preset.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/handlers/content_preset.php	2006-01-16 04:26:35.000000000 -0600
@@ -0,0 +1,280 @@
+<?php
+require_once("../../../class2.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+
+$lan_file = e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content.php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."content/languages/English/lan_content.php");
+$lan_file = e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content_admin.php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."content/languages/English/lan_content_admin.php");
+$months = array(CONTENT_ADMIN_DATE_LAN_0, CONTENT_ADMIN_DATE_LAN_1, CONTENT_ADMIN_DATE_LAN_2, CONTENT_ADMIN_DATE_LAN_3, CONTENT_ADMIN_DATE_LAN_4, CONTENT_ADMIN_DATE_LAN_5, CONTENT_ADMIN_DATE_LAN_6, CONTENT_ADMIN_DATE_LAN_7, CONTENT_ADMIN_DATE_LAN_8, CONTENT_ADMIN_DATE_LAN_9, CONTENT_ADMIN_DATE_LAN_10, CONTENT_ADMIN_DATE_LAN_11);
+
+if(isset($_POST['addpreset'])){
+	if(!$_POST['field']){
+		$err = "<br /><b>".CONTENT_PRESET_LAN_0."</b><br /><br />";
+	}else{
+		$err = "";
+		if($_POST['type'] == "text"){
+			if(!($_POST['text_size'] && $_POST['text_maxsize'] && is_numeric($_POST['text_size']) && is_numeric($_POST['text_maxsize'])) ){
+				$err .= "<br /><b>".CONTENT_PRESET_LAN_1."<br />".CONTENT_PRESET_LAN_3."</b><br />";
+			}else{
+				$value = $_POST['field']."^".$_POST['type']."^".$_POST['text_size']."^".$_POST['text_maxsize'];
+			}
+		}
+		if($_POST['type'] == "area"){
+			if(!($_POST['area_cols'] && $_POST['area_rows'] && is_numeric($_POST['area_cols']) && is_numeric($_POST['area_rows'])) ){
+				$err .= "<br /><b>".CONTENT_PRESET_LAN_1."<br />".CONTENT_PRESET_LAN_4."</b><br />";
+			}else{
+				$value = $_POST['field']."^".$_POST['type']."^".$_POST['area_cols']."^".$_POST['area_rows'];
+			}
+		}
+		if($_POST['type'] == "select"){
+			$options = implode("^", $_POST['options']);
+			if(!$_POST['options'][0] && !$_POST['options'][1]){
+				$err .= "<br /><b>".CONTENT_PRESET_LAN_1."<br />".CONTENT_PRESET_LAN_5."</b><br />";
+			}else{
+				$value = $_POST['field']."^".$_POST['type']."^".$options;
+			}
+		}
+		if($_POST['type'] == "date"){
+			if(!($_POST['date_year_from'] && $_POST['date_year_to'] && is_numeric($_POST['date_year_from']) && is_numeric($_POST['date_year_to'])) ){
+				$err .= "<br /><b>".CONTENT_PRESET_LAN_1."<br />".CONTENT_PRESET_LAN_6."</b><br />";
+			}else{
+				$value = $_POST['field']."^".$_POST['type']."^".$_POST['date_year_from']."^".$_POST['date_year_to'];
+			}
+		}
+		if($_POST['type'] == "checkbox"){
+			if(!$_POST['checkbox_value']){
+				$err .= "<br /><b>".CONTENT_PRESET_LAN_1."<br />".CONTENT_PRESET_LAN_20."</b><br />";
+			}else{
+				$value = $_POST['field']."^".$_POST['type']."^".$_POST['checkbox_value'];
+			}
+		}
+		if($_POST['type'] == "radio"){			
+			if(!($_POST['radio_value'] && $_POST['radio_text'] && $_POST['radio_value']!="" && $_POST['radio_text']!="")){
+				$err .= "<br /><b>".CONTENT_PRESET_LAN_1."<br />".CONTENT_PRESET_LAN_19."</b><br />";
+			}else{
+				if(count($_POST['radio_value']) != count($_POST['radio_text'])){
+					$err .= CONTENT_PRESET_LAN_19;
+				}else{
+					for($i=0;$i<count($_POST['radio_text']);$i++){
+						$radio .= $_POST['radio_text'][$i]."^".$_POST['radio_value'][$i]."^";
+					}
+					$radio = substr($radio,0,-1);
+					$value = $_POST['field']."^".$_POST['type']."^".$radio;
+				}
+			}
+		}
+	}
+	if(!$err){
+		$value = $tp->post_toForm($value);
+
+		$js = "		
+		<script type='text/javascript'>
+
+		var ecopy		= 'upline_new';
+		var epaste		= 'div_content_custom_preset';
+		var type		= window.opener.document.getElementById(ecopy).nodeName; // get the tag name of the source copy.
+		var br			= window.opener.document.createElement('br');
+
+		var field		= window.opener.document.createElement('input');
+		field.type		= 'text';
+		field.size		= '50';
+		field.name		= 'content_custom_preset_key[]';
+		field.value		= '".$value."';
+		field.className	= 'tbox';
+
+		var but			= window.opener.document.createElement('input');
+		but.type		= 'button';
+		but.value		= 'x';
+		but.className	= 'button';
+		but.onclick		= function(){ this.parentNode.parentNode.removeChild(this.parentNode); };
+
+		var destination = window.opener.document.getElementById(epaste);
+		var source      = window.opener.document.getElementById(ecopy).cloneNode(true);
+		var newentry	= window.opener.document.createElement(type);
+
+		newentry.appendChild(source);
+		newentry.value='';
+		newentry.appendChild(br);
+		newentry.appendChild(field);
+		newentry.appendChild(but);
+		newentry.appendChild(br);
+
+		destination.appendChild(newentry);
+
+		window.close();
+		</script>\n
+		";
+	}
+}
+
+
+$text .= "
+<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>\n
+<html>\n
+<head>\n
+<title>".CONTENT_PRESET_LAN_7."</title>\n
+<script type='text/javascript' src='../../../e107_files/e107.js'></script>
+".$js."
+<style type='text/css'>\n
+html,body{
+	text-align:center;
+	font-family: verdana, arial, helvetica, tahoma, sans-serif;
+	font-size: 11px;
+	color: #444;
+	margin-left: auto;
+  	margin-right: auto;	
+  	margin-top:0px;
+	margin-bottom:0px;
+	padding: 0px;
+	background-color:#FFF;
+	height:100%;
+	cursor:default;
+}
+td{
+	padding:5px;
+	font-size:11px;
+	text-align:left;
+}
+.fborder{
+	width:80%;
+	margin:0;
+	padding:0;
+}
+.fcaption{
+	font-size:12px;
+	font-weight:bold;
+	white-space:nowrap;
+}
+.err{
+	font-size:11px;
+	font-weight:bold;
+	color: #FF0000;
+}
+.leftcell{
+	width:10%;
+	white-space:nowrap;
+}
+.button{
+	padding:2px;
+	cursor:pointer;
+}
+.example {
+	border: #999 1px dashed;
+	padding: 5px;
+	margin: 5px;
+	background-color: #f7f7f9;
+}
+</style>
+</head>
+<body onload=self.focus()>";
+
+$qs = explode(".", e_QUERY);
+
+$text .= "
+<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+<table class='fborder' style='width:350px;'>
+".($err ? "<tr><td colspan='2' class='err' style='padding-bottom:10px;'>".$err."</td></tr>" : "")."
+<tr><td colspan='2' class='fcaption' style='padding-bottom:10px;'>".CONTENT_PRESET_LAN_8." : ".$qs[0]."</td></tr>
+<tr><td class='leftcell'>".CONTENT_PRESET_LAN_9."</td><td>".$rs -> form_text("field", 40, $_POST['field'], 50)."</td></tr>";
+
+if($qs[0] == "text"){
+	$text .= "
+	<tr><td class='leftcell'>".CONTENT_PRESET_LAN_10."</td><td>".$rs -> form_text("text_size", 3, $_POST['text_size'], 3)."</td></tr>
+	<tr><td class='leftcell'>".CONTENT_PRESET_LAN_11."</td><td>".$rs -> form_text("text_maxsize", 3, $_POST['text_maxsize'], 3)."</td></tr>
+	";
+	$example = CONTENT_PRESET_LAN_32."<br /><br />".$rs -> form_text("extext", 40, "".CONTENT_PRESET_LAN_9."=".CONTENT_PRESET_LAN_32.", ".CONTENT_PRESET_LAN_10."=40, ".CONTENT_PRESET_LAN_11."=10", 10);
+}
+
+if($qs[0] == "area"){
+	$text .= "
+	<tr><td class='leftcell'>".CONTENT_PRESET_LAN_12."</td><td>".$rs -> form_text("area_cols", 3, $_POST['area_cols'], 3)."</td></tr>
+	<tr><td class='leftcell'>".CONTENT_PRESET_LAN_13."</td><td>".$rs -> form_text("area_rows", 3, $_POST['area_rows'], 3)."</td></tr>
+	";
+	$example = CONTENT_PRESET_LAN_32."<br /><br />".$rs -> form_textarea("exarea", 30, 4, "".CONTENT_PRESET_LAN_9."=".CONTENT_PRESET_LAN_32."\n".CONTENT_PRESET_LAN_12."=30\n".CONTENT_PRESET_LAN_13."=4", $form_js = "", $form_style = "", $form_wrap = "", $form_readonly = "", $form_tooltip = "");
+}
+
+if($qs[0] == "date"){
+	$text .= "
+	<tr><td class='leftcell'>".CONTENT_PRESET_LAN_14."</td><td>".$rs -> form_text("date_year_from", 3, $_POST['date_year_from'], 4)."</td></tr>
+	<tr><td class='leftcell'>".CONTENT_PRESET_LAN_15."</td><td>".$rs -> form_text("date_year_to", 3, $_POST['date_year_to'], 4)."</td></tr>
+	";
+	$example = CONTENT_PRESET_LAN_32." ".CONTENT_PRESET_LAN_14." 1990, ".CONTENT_PRESET_LAN_15." 2000<br /><br />
+		".$rs -> form_select_open("exday", "")."
+		".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_12, "0", "");
+		for($i=1;$i<=31;$i++){
+			$example .= $rs -> form_option($i, ($values[$tmp[0]]['day'] == $i ? "1" : "0"), $i, "");
+		}
+		$example .= $rs -> form_select_close();
+
+		$example .= $rs -> form_select_open("exmonth", "")."
+		".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_13, "0", "");
+		for($i=1;$i<=12;$i++){
+			$example .= $rs -> form_option($months[($i-1)], ($values[$tmp[0]]['month'] == $i ? "1" : "0"), $i, "");
+		}
+		$example .= $rs -> form_select_close();
+
+		$example .= $rs -> form_select_open("exyear", "")."
+		".$rs -> form_option(CONTENT_ADMIN_DATE_LAN_14, "0", "");
+		for($i=1990;$i<=2000;$i++){
+			$example .= $rs -> form_option($i, "0", $i, "");
+		}
+		$example .= $rs -> form_select_close();
+}
+
+if($qs[0] == "select"){
+	$text .= "
+	<tr><td class='leftcell' style='vertical-align:top;'>".CONTENT_PRESET_LAN_23."</td>
+		<td><input class='tbox' type='text' name='options[0]' size='10' maxlength='100' /> (".CONTENT_PRESET_LAN_24.")</td>
+	</tr>
+	<tr><td class='leftcell' style='vertical-align:top;'>".CONTENT_PRESET_LAN_16."</td>
+		<td>
+		<div id='select_container' style='width:40%;white-space:nowrap;'>
+		<span id='selectline' style='white-space:nowrap;'>
+			<input class='tbox' type='text' name='options[]' size='10' maxlength='100' />
+		<input type='button' class='button' value='".CONTENT_PRESET_LAN_17."' onclick=\"duplicateHTML('selectline','select_container');\"  />
+		</span><br />
+		</div>
+	</td></tr>
+	";
+	$example = CONTENT_PRESET_LAN_32." ".CONTENT_PRESET_LAN_23." = ".CONTENT_PRESET_LAN_32.", options=a,b,c<br /><br />
+		".$rs -> form_select_open("exselect", "");
+		$example .= $rs -> form_option(CONTENT_PRESET_LAN_32, "0", "", "");
+		$example .= $rs -> form_option("a", "0", "a", "");
+		$example .= $rs -> form_option("b", "0", "b", "");
+		$example .= $rs -> form_option("c", "0", "c", "");
+		$example .= $rs -> form_select_close();
+}
+if($qs[0] == "checkbox"){
+	$text .= "<tr><td class='leftcell'>".CONTENT_PRESET_LAN_22."</td><td>".$rs -> form_text("checkbox_value", 3, $_POST['checkbox_value'], 50)."</td></tr>";
+	$example = CONTENT_PRESET_LAN_32." ".CONTENT_PRESET_LAN_9." = ".CONTENT_PRESET_LAN_32.", ".CONTENT_PRESET_LAN_22." = 1<br /><br />".CONTENT_PRESET_LAN_32." ".$rs -> form_checkbox("excheckbox", "ex1", $form_checked = 0, $form_tooltip = "", $form_js = "");
+}
+if($qs[0] == "radio"){
+	$text .= "
+	<tr><td class='leftcell'></td>
+		<td>
+		<div id='radio_container' style='width:40%;white-space:nowrap;'>
+		<span id='radioline' style='white-space:nowrap;'>
+			".CONTENT_PRESET_LAN_21." <input class='tbox' type='text' name='radio_text[]' value='".$_POST['radio_text[]']."' size='8' maxlength='100' />
+			".CONTENT_PRESET_LAN_22." <input class='tbox' type='text' name='radio_value[]' value='".$_POST['radio_value[]']."' size='2' maxlength='100' />
+		<input type='button' class='button' value='".CONTENT_PRESET_LAN_17."' onclick=\"duplicateHTML('radioline','radio_container');\"  />
+		</span><br />
+		</div>
+	</td></tr>
+	";
+	$example = CONTENT_PRESET_LAN_32."<br /><br />".$rs -> form_radio("exradio", CONTENT_PRESET_LAN_32." 1", "0", "", "")." ".CONTENT_PRESET_LAN_32." 1 ".$rs -> form_radio("exradio", CONTENT_PRESET_LAN_32." 2", "0", "", "")." ".CONTENT_PRESET_LAN_32." 2";
+}
+
+//process button
+$text .= "
+<tr><td class='leftcell'>&nbsp;</td><td style='text-align:right;'><input type='hidden' name='type' value='".$qs[0]."' /><input type='submit' class='button' name='addpreset' value='".CONTENT_PRESET_LAN_18."' /><br /><br /></td></tr>\n
+<tr><td colspan='2' class='example'>".$example."</td></tr>
+</table>\n
+</form>\n
+</body>\n
+</html>\n";
+
+echo $text;
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/help.php 75/e107_plugins/content/help.php
--- 6171/e107_plugins/content/help.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/help.php	2005-12-14 13:28:43.000000000 -0600
@@ -0,0 +1,108 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+global $plugindir;
+require_once($plugindir."handlers/content_defines.php");
+$lan_file = $plugindir.'languages/'.e_LANGUAGE.'/lan_content_help.php';
+include_once(file_exists($lan_file) ? $lan_file : $plugindir.'languages/English/lan_content_help.php');
+
+
+//$arrhide = array("creation", "submission", "paththeme", "general", "contentmanager", "menu", "recentpages", "catpages", "contentpages", "authorpage", "archivepage", "toppage", "scorepage");
+
+
+if(!e_QUERY){
+	$text = CONTENT_ADMIN_HELP_ITEM_1;
+}else{
+	$qs = explode(".", e_QUERY);
+
+	//##### CONTENT --------------------------------------------------
+		//manage content items
+		if($qs[0] == "content" && is_numeric($qs[1]) ){
+			$text = CONTENT_ADMIN_HELP_ITEM_2;
+
+		//edit content item
+		}elseif($qs[0] == "content" && $qs[1] == "edit" && is_numeric($qs[2]) ){
+			$text = CONTENT_ADMIN_HELP_ITEMEDIT_1;
+
+		//post submitted content item
+		}elseif($qs[0] == "content" && $qs[1] == "sa" && is_numeric($qs[2]) ){
+			$text = CONTENT_ADMIN_HELP_ITEMCREATE_2;
+
+		//create content item
+		}elseif($qs[0] == "content" && $qs[1] == "create" ){
+			//Create New Content (no category selected)
+			if(!isset($qs[2])){
+				$text = CONTENT_ADMIN_HELP_ITEMCREATE_1;
+
+			//Create New Content (category selected)
+			}elseif(is_numeric($qs[2])){
+				$text = CONTENT_ADMIN_HELP_ITEMCREATE_2;
+			}
+
+	//##### ORDER --------------------------------------------------
+		//order : view categories
+		}elseif($qs[0] == "order" && (!isset($qs[1]) || $qs[1] == "inc" || $qs[1] == "dec")){
+			$text = CONTENT_ADMIN_HELP_ORDER_1;
+
+		//order global items of parent='2'
+		}elseif($qs[0] == "order" && is_numeric($qs[1]) && (!isset($qs[2]) || $qs[2] == "inc" || $qs[2] == "dec") ){
+			$text = CONTENT_ADMIN_HELP_ORDER_3;
+
+		//order items with parent=2 or category='5'
+		}elseif($qs[0] == "order" && is_numeric($qs[1]) && is_numeric($qs[2]) && (!isset($qs[3]) || $qs[3] == "inc" || $qs[3] == "dec") ){
+			$text = CONTENT_ADMIN_HELP_ORDER_2;
+
+	//##### SUBMITTED --------------------------------------------------
+		}elseif($qs[0] == "submitted" && !isset($qs[1]) ){
+			$text = CONTENT_ADMIN_HELP_SUBMIT_1;
+
+	//##### OPTION --------------------------------------------------
+		//option: mainpage
+		}elseif($qs[0] == "option" && !isset($qs[1]) ){
+			$text = CONTENT_ADMIN_HELP_OPTION_1;
+
+		//option: with main parent selected, show all options
+		}elseif($qs[0] == "option" && isset($qs[1]) && (is_numeric($qs[1]) || $qs[1] == "default") ){
+			//$text = CONTENT_ADMIN_HELP_OPTION_2;
+			$text .= "
+			<div id='creationhelp'>".CONTENT_ADMIN_HELP_OPTION_DIV_1."</div>
+			<div id='submissionhelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_2."</div>
+			<div id='paththemehelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_3."</div>
+			<div id='generalhelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_4."</div>
+			<div id='contentmanagerhelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_5."</div>
+			<div id='menuhelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_6."</div>
+			<div id='recentpageshelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_7."</div>
+			<div id='catpageshelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_8."</div>
+			<div id='contentpageshelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_9."</div>
+			<div id='authorpagehelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_10."</div>
+			<div id='archivepagehelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_11."</div>
+			<div id='toppagehelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_12."</div>
+			<div id='scorepagehelp' style='display:none;'>".CONTENT_ADMIN_HELP_OPTION_DIV_13."</div>
+			";
+
+	//##### CATEGORY --------------------------------------------------
+		//category content manager : choose category
+		}elseif($qs[0] == "manager" && !isset($qs[1]) ){
+			$text = CONTENT_ADMIN_HELP_MANAGER_1;
+
+		//category content manager : view contentmanager
+		}elseif($qs[0] == "manager" && isset($qs[1]) && is_numeric($qs[1]) ){
+			$text = CONTENT_ADMIN_HELP_MANAGER_2;
+
+		//overview all categories
+		}elseif($qs[0] == "cat" && !isset($qs[1]) ){
+			$text = CONTENT_ADMIN_HELP_CAT_1;
+
+		//create category
+		}elseif($qs[0] == "cat" && $qs[1] == "create" ){
+			$text = CONTENT_ADMIN_HELP_CAT_2;
+
+		//edit category
+		}elseif($qs[0] == "cat" && $qs[1] == "edit" && is_numeric($qs[2]) ){
+			$text = CONTENT_ADMIN_HELP_CAT_3;
+
+		}
+}
+$ns -> tablerender(CONTENT_ADMIN_HELP_1, $text);
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/content/images/cat/16/help.png and 75/e107_plugins/content/images/cat/16/help.png differ
Files 6171/e107_plugins/content/images/cat/16/ledblue.png and 75/e107_plugins/content/images/cat/16/ledblue.png differ
Files 6171/e107_plugins/content/images/cat/16/ledgreen.png and 75/e107_plugins/content/images/cat/16/ledgreen.png differ
Files 6171/e107_plugins/content/images/cat/16/ledlightblue.png and 75/e107_plugins/content/images/cat/16/ledlightblue.png differ
Files 6171/e107_plugins/content/images/cat/16/ledlightgreen.png and 75/e107_plugins/content/images/cat/16/ledlightgreen.png differ
Files 6171/e107_plugins/content/images/cat/16/ledorange.png and 75/e107_plugins/content/images/cat/16/ledorange.png differ
Files 6171/e107_plugins/content/images/cat/16/ledpurple.png and 75/e107_plugins/content/images/cat/16/ledpurple.png differ
Files 6171/e107_plugins/content/images/cat/16/ledred.png and 75/e107_plugins/content/images/cat/16/ledred.png differ
Files 6171/e107_plugins/content/images/cat/16/ledyellow.png and 75/e107_plugins/content/images/cat/16/ledyellow.png differ
Files 6171/e107_plugins/content/images/cat/16/messagebox_info.png and 75/e107_plugins/content/images/cat/16/messagebox_info.png differ
Files 6171/e107_plugins/content/images/cat/48/help.png and 75/e107_plugins/content/images/cat/48/help.png differ
Files 6171/e107_plugins/content/images/cat/48/ledblue.png and 75/e107_plugins/content/images/cat/48/ledblue.png differ
Files 6171/e107_plugins/content/images/cat/48/ledgreen.png and 75/e107_plugins/content/images/cat/48/ledgreen.png differ
Files 6171/e107_plugins/content/images/cat/48/ledlightblue.png and 75/e107_plugins/content/images/cat/48/ledlightblue.png differ
Files 6171/e107_plugins/content/images/cat/48/ledlightgreen.png and 75/e107_plugins/content/images/cat/48/ledlightgreen.png differ
Files 6171/e107_plugins/content/images/cat/48/ledorange.png and 75/e107_plugins/content/images/cat/48/ledorange.png differ
Files 6171/e107_plugins/content/images/cat/48/ledpurple.png and 75/e107_plugins/content/images/cat/48/ledpurple.png differ
Files 6171/e107_plugins/content/images/cat/48/ledred.png and 75/e107_plugins/content/images/cat/48/ledred.png differ
Files 6171/e107_plugins/content/images/cat/48/ledyellow.png and 75/e107_plugins/content/images/cat/48/ledyellow.png differ
Files 6171/e107_plugins/content/images/cat/48/messagebox_info.png and 75/e107_plugins/content/images/cat/48/messagebox_info.png differ
Files 6171/e107_plugins/content/images/content_16.png and 75/e107_plugins/content/images/content_16.png differ
Files 6171/e107_plugins/content/images/content_32.png and 75/e107_plugins/content/images/content_32.png differ
Files 6171/e107_plugins/content/images/error_16.png and 75/e107_plugins/content/images/error_16.png differ
Files 6171/e107_plugins/content/images/file_16.png and 75/e107_plugins/content/images/file_16.png differ
Files 6171/e107_plugins/content/images/icon/blank.gif and 75/e107_plugins/content/images/icon/blank.gif differ
Files 6171/e107_plugins/content/images/manager_16.png and 75/e107_plugins/content/images/manager_16.png differ
Files 6171/e107_plugins/content/images/manager_48.png and 75/e107_plugins/content/images/manager_48.png differ
Files 6171/e107_plugins/content/images/ok_16.png and 75/e107_plugins/content/images/ok_16.png differ
Files 6171/e107_plugins/content/images/personal.png and 75/e107_plugins/content/images/personal.png differ
Files 6171/e107_plugins/content/images/redo.png and 75/e107_plugins/content/images/redo.png differ
Files 6171/e107_plugins/content/images/score_empty.png and 75/e107_plugins/content/images/score_empty.png differ
Files 6171/e107_plugins/content/images/score_end.png and 75/e107_plugins/content/images/score_end.png differ
Files 6171/e107_plugins/content/images/score.png and 75/e107_plugins/content/images/score.png differ
Files 6171/e107_plugins/content/images/view_remove.png and 75/e107_plugins/content/images/view_remove.png differ
Files 6171/e107_plugins/content/images/warning_16.png and 75/e107_plugins/content/images/warning_16.png differ
Files 6171/e107_plugins/content/images/window_new.png and 75/e107_plugins/content/images/window_new.png differ
diff -ruN 6171/e107_plugins/content/languages/English/lan_content_admin.php 75/e107_plugins/content/languages/English/lan_content_admin.php
--- 6171/e107_plugins/content/languages/English/lan_content_admin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/languages/English/lan_content_admin.php	2006-02-13 04:48:25.000000000 -0600
@@ -0,0 +1,656 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/languages/English/lan_content_admin.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2006/02/13 10:48:25 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+
+define("CONTENT_PLUGIN_LAN_1", "Content Management");
+define("CONTENT_PLUGIN_LAN_2", "A Complete Content Management Section.");
+define("CONTENT_PLUGIN_LAN_3", "Configure Content Management");
+define("CONTENT_PLUGIN_LAN_4", "This plugin is now ready to be used.");
+define("CONTENT_PLUGIN_LAN_5", "Content");
+define("CONTENT_PLUGIN_LAN_6", "Content Management Plugin table structure updated");
+
+define("CONTENT_ADMIN_CAT_LAN_0", "create content category");
+define("CONTENT_ADMIN_CAT_LAN_1", "edit content category");
+define("CONTENT_ADMIN_CAT_LAN_2", "heading");
+define("CONTENT_ADMIN_CAT_LAN_3", "subheading");
+define("CONTENT_ADMIN_CAT_LAN_4", "text");
+define("CONTENT_ADMIN_CAT_LAN_5", "icon");
+define("CONTENT_ADMIN_CAT_LAN_6", "submit");
+define("CONTENT_ADMIN_CAT_LAN_7", "update");
+define("CONTENT_ADMIN_CAT_LAN_8", "view icons");
+define("CONTENT_ADMIN_CAT_LAN_9", "no content categories yet");
+define("CONTENT_ADMIN_CAT_LAN_10", "content categories");
+define("CONTENT_ADMIN_CAT_LAN_11", "content category created");
+define("CONTENT_ADMIN_CAT_LAN_12", "content category updated");
+define("CONTENT_ADMIN_CAT_LAN_13", "required field(s) left blank");
+define("CONTENT_ADMIN_CAT_LAN_14", "comments");
+define("CONTENT_ADMIN_CAT_LAN_15", "rating");
+define("CONTENT_ADMIN_CAT_LAN_16", "print email/icons");
+define("CONTENT_ADMIN_CAT_LAN_17", "visibility");
+define("CONTENT_ADMIN_CAT_LAN_18", "author");
+define("CONTENT_ADMIN_CAT_LAN_19", "content category");
+define("CONTENT_ADMIN_CAT_LAN_20", "options");
+define("CONTENT_ADMIN_CAT_LAN_21", "clear form");
+define("CONTENT_ADMIN_CAT_LAN_22", "options updated");
+define("CONTENT_ADMIN_CAT_LAN_23", "content category deleted");
+define("CONTENT_ADMIN_CAT_LAN_24", "id");
+define("CONTENT_ADMIN_CAT_LAN_25", "icon");
+define("CONTENT_ADMIN_CAT_LAN_26", "new main category");
+define("CONTENT_ADMIN_CAT_LAN_27", "category");
+define("CONTENT_ADMIN_CAT_LAN_28", "Assign users from the left window to the Personal Content Manager for this category");
+define("CONTENT_ADMIN_CAT_LAN_29", "Admins - click to move ... ");
+define("CONTENT_ADMIN_CAT_LAN_30", "Personal Content Manager");
+define("CONTENT_ADMIN_CAT_LAN_31", "remove");
+define("CONTENT_ADMIN_CAT_LAN_32", "clear managers");
+define("CONTENT_ADMIN_CAT_LAN_33", "assign personal content managers");
+define("CONTENT_ADMIN_CAT_LAN_34", "admins succesfully assigned to the category");
+define("CONTENT_ADMIN_CAT_LAN_35", "content sub category deleted");
+define("CONTENT_ADMIN_CAT_LAN_36", "category check: there are still subcategories present, the category will NOT be deleted. first remove all subcategories and then try again.");
+define("CONTENT_ADMIN_CAT_LAN_37", "content items check: there are still content items present, the category will NOT be deleted. first remove all content items and then try again.");
+define("CONTENT_ADMIN_CAT_LAN_38", "content items check: no items found");
+define("CONTENT_ADMIN_CAT_LAN_39", "category check: no subcategories found");
+define("CONTENT_ADMIN_CAT_LAN_40", "Below you see a list of the main category and all subcategories if present.<br />");
+
+define("CONTENT_ADMIN_CAT_LAN_41", "The personal manager of content categories allows you to assign certain other admins to a category. With this privilige these admins can manage their own and only their own personal content items in this specified category, without the need to have control over the full content manager plugin. From the normal content page outside of the admin area they will see a personalmanager icon which redirects them to the personal manager page.");
+define("CONTENT_ADMIN_CAT_LAN_42", "to re-edit the same category");
+
+define("CONTENT_ADMIN_CAT_LAN_43", "click here");
+define("CONTENT_ADMIN_CAT_LAN_44", "to add another category in the earlier selected main category");
+define("CONTENT_ADMIN_CAT_LAN_45", "allow comments?");
+define("CONTENT_ADMIN_CAT_LAN_46", "allow rating?");
+define("CONTENT_ADMIN_CAT_LAN_47", "display print/email icons?");
+define("CONTENT_ADMIN_CAT_LAN_48", "choose which users see this item");
+define("CONTENT_ADMIN_CAT_LAN_49", "choose an icon for this category");
+//define("CONTENT_ADMIN_CAT_LAN_50", "content menu created<br /><br />Because you have created a Main Parent Category, a Menu has been generated.<br />The menu file has been created in your /menus folder.<br /><br />In order to see the menu in action, you still need to activate this menu in your <a href='".e_ADMIN."menus.php'>admin menus area</a>.");
+define("CONTENT_ADMIN_CAT_LAN_50", "
+Only if you have created a New Main Parent Category, a menu file has been created.<br />
+This menu file has been created in your /menus folder.<br />
+In order to see the menu in action, you still need to activate the menu in your <a href='".e_ADMIN."menus.php'>admin menus area</a>.<br /><br />
+");
+define("CONTENT_ADMIN_CAT_LAN_51", "error; menu file not created");
+define("CONTENT_ADMIN_CAT_LAN_52", "ALWAYS choose a category first before you fill in other fields!");
+define("CONTENT_ADMIN_CAT_LAN_53", "to manage another category");
+define("CONTENT_ADMIN_CAT_LAN_54", "user");
+define("CONTENT_ADMIN_CAT_LAN_55", "users");
+define("CONTENT_ADMIN_CAT_LAN_56", "item");
+define("CONTENT_ADMIN_CAT_LAN_57", "items");
+define("CONTENT_ADMIN_CAT_LAN_58", "category icon succesfully uploaded<br />notice: you still need to assign the icon to this category in the icon>choose existing icon area !<br />and of course after that you still need to submit the form to create/update this category");
+define("CONTENT_ADMIN_CAT_LAN_59", "category icon not uploaded");
+define("CONTENT_ADMIN_CAT_LAN_60", "assign an icon");
+define("CONTENT_ADMIN_CAT_LAN_61", "upload a new icon");
+define("CONTENT_ADMIN_CAT_LAN_62", "After you have uploaded a new category icon, you can assign this icon in the below 'icon' area<br />If you upload a new icon, this icon will be scaled to 48 pixels, and additionally a small 16 pixels icon will be created as well<br /><br />");
+define("CONTENT_ADMIN_CAT_LAN_63", "upload icon");
+
+
+
+define("CONTENT_ADMIN_ITEM_LAN_0", "required field(s) left blank");
+define("CONTENT_ADMIN_ITEM_LAN_1", "content item created");
+define("CONTENT_ADMIN_ITEM_LAN_2", "content item updated");
+define("CONTENT_ADMIN_ITEM_LAN_3", "content item deleted");
+define("CONTENT_ADMIN_ITEM_LAN_4", "no content items yet");
+define("CONTENT_ADMIN_ITEM_LAN_5", "existing content items");
+define("CONTENT_ADMIN_ITEM_LAN_6", "first letters");
+define("CONTENT_ADMIN_ITEM_LAN_7", "please select a letter above.");
+define("CONTENT_ADMIN_ITEM_LAN_8", "id");
+define("CONTENT_ADMIN_ITEM_LAN_9", "icon");
+define("CONTENT_ADMIN_ITEM_LAN_10", "author");
+define("CONTENT_ADMIN_ITEM_LAN_11", "heading");
+define("CONTENT_ADMIN_ITEM_LAN_12", "options");
+define("CONTENT_ADMIN_ITEM_LAN_13", "choose parent category");
+define("CONTENT_ADMIN_ITEM_LAN_14", "name");
+define("CONTENT_ADMIN_ITEM_LAN_15", "email");
+define("CONTENT_ADMIN_ITEM_LAN_16", "subheading");
+define("CONTENT_ADMIN_ITEM_LAN_17", "summary");
+define("CONTENT_ADMIN_ITEM_LAN_18", "text");
+define("CONTENT_ADMIN_ITEM_LAN_19", "upload icon");
+define("CONTENT_ADMIN_ITEM_LAN_20", "icon");
+define("CONTENT_ADMIN_ITEM_LAN_21", "This option is disabled as file uploading is not enabled on your server");
+define("CONTENT_ADMIN_ITEM_LAN_22", "The");
+define("CONTENT_ADMIN_ITEM_LAN_23", "folder is not writable, you need to CHMOD 777 the folder before uploading");
+define("CONTENT_ADMIN_ITEM_LAN_24", "attachments");
+define("CONTENT_ADMIN_ITEM_LAN_25", "upload new icon");
+define("CONTENT_ADMIN_ITEM_LAN_26", "remove");
+define("CONTENT_ADMIN_ITEM_LAN_27", "present content file");
+define("CONTENT_ADMIN_ITEM_LAN_28", "upload new file");
+define("CONTENT_ADMIN_ITEM_LAN_29", "no file yet");
+define("CONTENT_ADMIN_ITEM_LAN_30", "content file");
+define("CONTENT_ADMIN_ITEM_LAN_31", "images");
+define("CONTENT_ADMIN_ITEM_LAN_32", "present content image");
+define("CONTENT_ADMIN_ITEM_LAN_33", "upload new image");
+define("CONTENT_ADMIN_ITEM_LAN_34", "content image");
+define("CONTENT_ADMIN_ITEM_LAN_35", "set preferences for this content item");
+define("CONTENT_ADMIN_ITEM_LAN_36", "comments");
+define("CONTENT_ADMIN_ITEM_LAN_37", "rating");
+define("CONTENT_ADMIN_ITEM_LAN_38", "print email/icons");
+define("CONTENT_ADMIN_ITEM_LAN_39", "visibility");
+define("CONTENT_ADMIN_ITEM_LAN_40", "score");
+define("CONTENT_ADMIN_ITEM_LAN_41", "select a score ...");
+define("CONTENT_ADMIN_ITEM_LAN_42", "tick to update timestamp to current time");
+define("CONTENT_ADMIN_ITEM_LAN_43", "post user submitted content item");
+define("CONTENT_ADMIN_ITEM_LAN_44", "create content item");
+define("CONTENT_ADMIN_ITEM_LAN_45", "update content item");
+define("CONTENT_ADMIN_ITEM_LAN_46", "preview");
+define("CONTENT_ADMIN_ITEM_LAN_47", "preview again");
+define("CONTENT_ADMIN_ITEM_LAN_48", "main parent");
+define("CONTENT_ADMIN_ITEM_LAN_49", "submitted content items");
+define("CONTENT_ADMIN_ITEM_LAN_50", "no submitted content items");
+define("CONTENT_ADMIN_ITEM_LAN_51", "author details");
+define("CONTENT_ADMIN_ITEM_LAN_52", "submit content item");
+define("CONTENT_ADMIN_ITEM_LAN_53", "meta keywords");
+define("CONTENT_ADMIN_ITEM_LAN_54", "additional data");
+define("CONTENT_ADMIN_ITEM_LAN_55", "Go back to the <a href='".e_SELF."'>main contentmanager page</a> to manage more of your personal content<br />or<br />Go to the <a href='".e_PLUGIN."content/content.php'>content main page</a> to view content items.");
+define("CONTENT_ADMIN_ITEM_LAN_56", "personal content manager");
+define("CONTENT_ADMIN_ITEM_LAN_57", "category");
+define("CONTENT_ADMIN_ITEM_LAN_58", "items");
+define("CONTENT_ADMIN_ITEM_LAN_59", "move");
+define("CONTENT_ADMIN_ITEM_LAN_60", "order");
+define("CONTENT_ADMIN_ITEM_LAN_61", "update order");
+define("CONTENT_ADMIN_ITEM_LAN_62", "order categories");
+define("CONTENT_ADMIN_ITEM_LAN_63", "inc");
+define("CONTENT_ADMIN_ITEM_LAN_64", "dec");
+define("CONTENT_ADMIN_ITEM_LAN_65", "order content items");
+define("CONTENT_ADMIN_ITEM_LAN_66", "Below you see the distinct letters of the content heading for all items in this category.<br />By clicking on one of the letters you will see a list of all items starting with the selected letter. You can also choose the ALL button to display all items in this category.");
+define("CONTENT_ADMIN_ITEM_LAN_67", "Below you see the content items listed for the selected category or narrowed down with a selected letter.<br />You can edit or delete an item by clicking the appropriate buttons on the right.");
+define("CONTENT_ADMIN_ITEM_LAN_68", "Below you have the ability to add custom data for this content item. Each custom data needs to have both a key and a value data present. You can specify the key in the left field and the corresponding value in the right field.<br />(for instance, key='photography' and value='all photos are made by me'.");
+define("CONTENT_ADMIN_ITEM_LAN_69", "Here you can upload icons, attachments and/or images to go with the content item. The allowed filetypes are : ");
+define("CONTENT_ADMIN_ITEM_LAN_70", "Seperate each word with commas, no spaces are allowed !");
+define("CONTENT_ADMIN_ITEM_LAN_71", "leave if item written by you");
+define("CONTENT_ADMIN_ITEM_LAN_72", "define author details");
+define("CONTENT_ADMIN_ITEM_LAN_73", "define a start date for this item (leave if none needed)");
+define("CONTENT_ADMIN_ITEM_LAN_74", "define an end date for this item (leave if none needed)");
+define("CONTENT_ADMIN_ITEM_LAN_75", "assign an icon");
+define("CONTENT_ADMIN_ITEM_LAN_76", "assign attachments");
+define("CONTENT_ADMIN_ITEM_LAN_77", "assign images");
+define("CONTENT_ADMIN_ITEM_LAN_78", "allow comments?");
+define("CONTENT_ADMIN_ITEM_LAN_79", "allow rating?");
+define("CONTENT_ADMIN_ITEM_LAN_80", "display print/email icons?");
+define("CONTENT_ADMIN_ITEM_LAN_81", "choose which users see this item");
+define("CONTENT_ADMIN_ITEM_LAN_82", "define a score");
+define("CONTENT_ADMIN_ITEM_LAN_83", "define meta keywords");
+define("CONTENT_ADMIN_ITEM_LAN_84", "define custom data fields (key + value)");
+define("CONTENT_ADMIN_ITEM_LAN_85", "enabled");
+define("CONTENT_ADMIN_ITEM_LAN_86", "disabled");
+define("CONTENT_ADMIN_ITEM_LAN_87", "choose an icon for this item");
+define("CONTENT_ADMIN_ITEM_LAN_88", "to create an item in the earlier selected main category");
+define("CONTENT_ADMIN_ITEM_LAN_89", "to edit an item in the earlier selected main category");
+define("CONTENT_ADMIN_ITEM_LAN_90", "click here");
+define("CONTENT_ADMIN_ITEM_LAN_91", "to re-edit the same item");
+define("CONTENT_ADMIN_ITEM_LAN_92", "layout");
+define("CONTENT_ADMIN_ITEM_LAN_93", "choose a layout scheme");
+define("CONTENT_ADMIN_ITEM_LAN_94", "select a layout scheme");
+
+define("CONTENT_ADMIN_ITEM_LAN_95", "upload a new icon");
+define("CONTENT_ADMIN_ITEM_LAN_96", "choose an existing icon");
+define("CONTENT_ADMIN_ITEM_LAN_97", "After you have uploaded a new icon, you can assign it in the below 'choose an existing icon' area");
+
+define("CONTENT_ADMIN_ITEM_LAN_98", "upload a new attachment");
+define("CONTENT_ADMIN_ITEM_LAN_99", "choose an existing attachment");
+define("CONTENT_ADMIN_ITEM_LAN_100", "After you have uploaded a new attachment, you can assign it in the below 'choose an existing attachment' area");
+
+define("CONTENT_ADMIN_ITEM_LAN_101", "upload a new image");
+define("CONTENT_ADMIN_ITEM_LAN_102", "choose an existing image");
+define("CONTENT_ADMIN_ITEM_LAN_103", "After you have uploaded a new image, you can assign it in the below 'choose an existing image' area");
+
+define("CONTENT_ADMIN_ITEM_LAN_104", "upload");
+define("CONTENT_ADMIN_ITEM_LAN_105", "view");
+
+define("CONTENT_ADMIN_ITEM_LAN_106", "icon succesfully uploaded<br />notice: you still need to assign the icon to this content item in the 'choose an existing icon' area !<br />and of course after that you still need to submit the form to create/update the content item");
+define("CONTENT_ADMIN_ITEM_LAN_107", "icon not uploaded");
+
+define("CONTENT_ADMIN_ITEM_LAN_108", "attachment succesfully uploaded<br />notice: you still need to assign the attachment to this content item in the 'choose an existing attachment' area !<br />and of course after that you still need to submit the form to create/update the content item");
+define("CONTENT_ADMIN_ITEM_LAN_109", "attachment not uploaded");
+
+define("CONTENT_ADMIN_ITEM_LAN_110", "image succesfully uploaded<br />notice: you still need to assign the image to this content item in the 'choose an existing image' area !<br />and of course after that you still need to submit the form to create/update the content item");
+define("CONTENT_ADMIN_ITEM_LAN_111", "image not uploaded");
+
+define("CONTENT_ADMIN_ITEM_LAN_112", "upload an icon, attachment or image");
+define("CONTENT_ADMIN_ITEM_LAN_113", "choose the type of upload in the select box before you upload the file");
+define("CONTENT_ADMIN_ITEM_LAN_114", "icon");
+define("CONTENT_ADMIN_ITEM_LAN_115", "attachment");
+define("CONTENT_ADMIN_ITEM_LAN_116", "image");
+define("CONTENT_ADMIN_ITEM_LAN_117", "submitted content item posted");
+define("CONTENT_ADMIN_ITEM_LAN_118", "no");
+define("CONTENT_ADMIN_ITEM_LAN_119", "assigned");
+define("CONTENT_ADMIN_ITEM_LAN_120", "default layout");
+
+define("CONTENT_ADMIN_ITEM_LAN_121", "no new icon uploaded yet");
+define("CONTENT_ADMIN_ITEM_LAN_122", "no new attachment uploaded yet");
+define("CONTENT_ADMIN_ITEM_LAN_123", "no new image uploaded yet");
+
+define("CONTENT_ADMIN_ITEM_LAN_124", "to view the item");
+
+
+define("CONTENT_ADMIN_ORDER_LAN_0", "order is increased");
+define("CONTENT_ADMIN_ORDER_LAN_1", "order is decreased");
+define("CONTENT_ADMIN_ORDER_LAN_2", "new order for content items is saved");
+
+
+
+define("CONTENT_ADMIN_MAIN_LAN_0", "existing content categories");
+define("CONTENT_ADMIN_MAIN_LAN_1", "no content categories yet");
+define("CONTENT_ADMIN_MAIN_LAN_2", "main content categories");
+define("CONTENT_ADMIN_MAIN_LAN_3", "content item deleted");
+define("CONTENT_ADMIN_MAIN_LAN_4", "parent text");
+define("CONTENT_ADMIN_MAIN_LAN_5", "parent icon");
+define("CONTENT_ADMIN_MAIN_LAN_6", "");
+define("CONTENT_ADMIN_MAIN_LAN_7", "Welcome to the Content Management System !");
+define("CONTENT_ADMIN_MAIN_LAN_8", "This information is shown because the table of the Content Management Plugin contains no records.");
+define("CONTENT_ADMIN_MAIN_LAN_9", "Please read the following information carefully and choose what you want to do.");
+define("CONTENT_ADMIN_MAIN_LAN_10", "You can manage content items on this page. First decide the category you would like to manage content for. Select a category in the select box to start managing content for that category.");
+define("CONTENT_ADMIN_MAIN_LAN_11", "Since the old content table contains records, you can choose one of the following three options:");
+define("CONTENT_ADMIN_MAIN_LAN_12", "");
+define("CONTENT_ADMIN_MAIN_LAN_13", "You can create new content items on this page. First decide the category you would like to manage content for. Click on the button of the main parents listed below to create new content in that main category.");
+define("CONTENT_ADMIN_MAIN_LAN_14", "You can set the order for content items on this page. Click on the button of the main parents listed below to start ordering content items or categories for the selected main category.");
+define("CONTENT_ADMIN_MAIN_LAN_15", "You can manage categories on this page. Choose the main category from the buttons listed below to show an overview of alle categories and subcategories within that main category.");
+define("CONTENT_ADMIN_MAIN_LAN_16", "You can create new categories on this page. By default the creation form for a new main category is shown. If you would like to create a subcategory for an existing main category, please click on one of the buttons listed below to show the creation form for a subcategory within the selected main category.");
+define("CONTENT_ADMIN_MAIN_LAN_17", "please create a new category on the <a href='".e_SELF."?type.0.cat.create'>Create New Category</a> page");
+
+define("CONTENT_ADMIN_MAIN_LAN_18", "Convert records");
+define("CONTENT_ADMIN_MAIN_LAN_19", "
+The first thing you need to do is create a backup of your existing content table as well as your comments and rate table.<br />
+Use a program to backup your content table, like phpmyadmin.<br />
+After you have created a backup of your old content table, you can start converting the records to the new Content Management Plugin.<br />
+After you have converted your old content, you should no longer see this information, and be able to manage your existing content.<br />
+");
+define("CONTENT_ADMIN_MAIN_LAN_20", "Start with an empty content table");
+define("CONTENT_ADMIN_MAIN_LAN_21", "
+If you no longer need the records from your old content table,<br />
+and just want to start with a fresh new Content Management Plugin table,<br />
+and you do not want to create a default set of categories,<br />
+you can start by creating a new category.<br />
+");
+define("CONTENT_ADMIN_MAIN_LAN_22", "Create a default set of categories");
+define("CONTENT_ADMIN_MAIN_LAN_23", "
+If you want to start with a fresh install, you can first create a default set of content categories.<br />
+With this default set three main parent categories will be created, namely Content, Review and Article.<br />
+");
+define("CONTENT_ADMIN_MAIN_LAN_24", "This is a fresh install / The old content table does not contain records");
+define("CONTENT_ADMIN_MAIN_LAN_25", "
+Since the old existing content table does not contain any records, you can now start managing new content.<br />
+By clicking the next button, you will automatically create a default set of categories, namely Content, Review and Article.<br />
+");
+define("CONTENT_ADMIN_MAIN_LAN_26", "preview");
+define("CONTENT_ADMIN_MAIN_LAN_27", "preview again");
+define("CONTENT_ADMIN_MAIN_LAN_28", "choose category ...");
+define("CONTENT_ADMIN_MAIN_LAN_29", "NEW MAIN CATEGORY");
+
+
+
+define("CONTENT_ADMIN_MENU_LAN_0", "Manage Content");
+define("CONTENT_ADMIN_MENU_LAN_1", "Create Content");
+define("CONTENT_ADMIN_MENU_LAN_2", "Manage Category");
+define("CONTENT_ADMIN_MENU_LAN_3", "Create Category");
+define("CONTENT_ADMIN_MENU_LAN_4", "Submitted Content Items");
+define("CONTENT_ADMIN_MENU_LAN_5", "Category");
+define("CONTENT_ADMIN_MENU_LAN_6", "Options");
+define("CONTENT_ADMIN_MENU_LAN_7", "Admin : Create Item");
+define("CONTENT_ADMIN_MENU_LAN_8", "Submit Item");
+define("CONTENT_ADMIN_MENU_LAN_9", "Path And Theme");
+define("CONTENT_ADMIN_MENU_LAN_10", "General");
+define("CONTENT_ADMIN_MENU_LAN_11", "Content Item Preview");
+define("CONTENT_ADMIN_MENU_LAN_12", "Category pages");
+define("CONTENT_ADMIN_MENU_LAN_13", "Content pages");
+define("CONTENT_ADMIN_MENU_LAN_14", "Menu");
+define("CONTENT_ADMIN_MENU_LAN_15", "Order");
+define("CONTENT_ADMIN_MENU_LAN_16", "Archive Page");
+define("CONTENT_ADMIN_MENU_LAN_17", "Personal Content Manager");
+define("CONTENT_ADMIN_MENU_LAN_18", "Author Page");
+define("CONTENT_ADMIN_MENU_LAN_19", "Content Manager");
+define("CONTENT_ADMIN_MENU_LAN_20", "Top Rated Page");
+define("CONTENT_ADMIN_MENU_LAN_21", "Pages");
+define("CONTENT_ADMIN_MENU_LAN_22", "Top Score Page");
+
+
+
+define("CONTENT_ADMIN_JS_LAN_0", "Are you sure you want to delete this category?");
+define("CONTENT_ADMIN_JS_LAN_1", "Are you sure you want to delete this content?");
+define("CONTENT_ADMIN_JS_LAN_2", "are you sure you want to remove the current image ?");
+define("CONTENT_ADMIN_JS_LAN_3", "are you sure you want to remove the current file ?");
+define("CONTENT_ADMIN_JS_LAN_4", "image");
+define("CONTENT_ADMIN_JS_LAN_5", "file");
+define("CONTENT_ADMIN_JS_LAN_6", "ID");
+define("CONTENT_ADMIN_JS_LAN_7", "are you sure you want to remove the current icon ?");
+define("CONTENT_ADMIN_JS_LAN_8", "icon");
+define("CONTENT_ADMIN_JS_LAN_9", "NOTICE :\\nonly empty categories can be deleted.\\na category is empty if it does NOT contain any subcategories and\\nif it does NOT contain any content items!");
+define("CONTENT_ADMIN_JS_LAN_10", "Are you sure you want to delete this submitted content before posting it?");
+
+
+
+define("CONTENT_ADMIN_SUBMIT_LAN_0", "no content categories allow user submission at this point");
+define("CONTENT_ADMIN_SUBMIT_LAN_1", "content submit types");
+define("CONTENT_ADMIN_SUBMIT_LAN_2", "Thank You, your content item has been submitted.");
+define("CONTENT_ADMIN_SUBMIT_LAN_3", "Thank you, your content item has been submitted and will be reviewed by a site administrator in due course.");
+define("CONTENT_ADMIN_SUBMIT_LAN_4", "required field(s) left blank");
+define("CONTENT_ADMIN_SUBMIT_LAN_5", "Go back to the <a href='".e_SELF."'>main submission page</a> to submit more content<br />or<br />Go to the <a href='".e_PLUGIN."content/content.php'>content main page</a> to view content items.");
+define("CONTENT_ADMIN_SUBMIT_LAN_6", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_7", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_8", "submitted content item deleted");
+define("CONTENT_ADMIN_SUBMIT_LAN_9", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_10", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_11", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_12", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_13", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_14", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_15", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_16", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_17", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_18", "");
+define("CONTENT_ADMIN_SUBMIT_LAN_19", "");
+
+
+
+define("CONTENT_ADMIN_CONVERSION_LAN_0", "content");
+define("CONTENT_ADMIN_CONVERSION_LAN_1", "review");
+define("CONTENT_ADMIN_CONVERSION_LAN_2", "article");
+define("CONTENT_ADMIN_CONVERSION_LAN_3", "category");
+define("CONTENT_ADMIN_CONVERSION_LAN_4", "categories");
+define("CONTENT_ADMIN_CONVERSION_LAN_5", "page");
+define("CONTENT_ADMIN_CONVERSION_LAN_6", "pages");
+define("CONTENT_ADMIN_CONVERSION_LAN_7", "main parent inserted");
+define("CONTENT_ADMIN_CONVERSION_LAN_8", "main parent preferences inserted");
+define("CONTENT_ADMIN_CONVERSION_LAN_9", "no");
+define("CONTENT_ADMIN_CONVERSION_LAN_10", "main parent needed");
+define("CONTENT_ADMIN_CONVERSION_LAN_11", "conversion analysis");
+define("CONTENT_ADMIN_CONVERSION_LAN_12", "total rows to convert");
+define("CONTENT_ADMIN_CONVERSION_LAN_13", "total converted rows");
+define("CONTENT_ADMIN_CONVERSION_LAN_14", "total warnings");
+define("CONTENT_ADMIN_CONVERSION_LAN_15", "total failures");
+define("CONTENT_ADMIN_CONVERSION_LAN_16", "analysis of the old content table");
+define("CONTENT_ADMIN_CONVERSION_LAN_17", "total rows");
+define("CONTENT_ADMIN_CONVERSION_LAN_18", "unknown rows");
+define("CONTENT_ADMIN_CONVERSION_LAN_19", "all rows are familiar");
+define("CONTENT_ADMIN_CONVERSION_LAN_20", "content main parent");
+define("CONTENT_ADMIN_CONVERSION_LAN_21", "review main parent");
+define("CONTENT_ADMIN_CONVERSION_LAN_22", "article main parent");
+define("CONTENT_ADMIN_CONVERSION_LAN_23", "insertion failed");
+define("CONTENT_ADMIN_CONVERSION_LAN_24", "no content pages present");
+define("CONTENT_ADMIN_CONVERSION_LAN_25", "content pages present");
+define("CONTENT_ADMIN_CONVERSION_LAN_26", "inserted");
+define("CONTENT_ADMIN_CONVERSION_LAN_27", "analysis of the conversion");
+define("CONTENT_ADMIN_CONVERSION_LAN_28", "total old rows");
+define("CONTENT_ADMIN_CONVERSION_LAN_29", "total new rows");
+define("CONTENT_ADMIN_CONVERSION_LAN_30", "failed");
+define("CONTENT_ADMIN_CONVERSION_LAN_31", "warnings");
+define("CONTENT_ADMIN_CONVERSION_LAN_32", "old category does not exist: items added to higher category");
+define("CONTENT_ADMIN_CONVERSION_LAN_33", "new category does not exist: items added to higher category");
+define("CONTENT_ADMIN_CONVERSION_LAN_34", "no");
+define("CONTENT_ADMIN_CONVERSION_LAN_35", "category pages present");
+define("CONTENT_ADMIN_CONVERSION_LAN_36", "pages and/or submitted pages present");
+define("CONTENT_ADMIN_CONVERSION_LAN_37", "conversion of categories");
+define("CONTENT_ADMIN_CONVERSION_LAN_38", "valid inserts");
+define("CONTENT_ADMIN_CONVERSION_LAN_39", "failed inserts");
+define("CONTENT_ADMIN_CONVERSION_LAN_40", "warning");
+define("CONTENT_ADMIN_CONVERSION_LAN_41", "warning");
+define("CONTENT_ADMIN_CONVERSION_LAN_42", "conversion results of the old content table to the new content plugin table");
+define("CONTENT_ADMIN_CONVERSION_LAN_43", "press the button to convert the old content table");
+define("CONTENT_ADMIN_CONVERSION_LAN_44", "the new content table already contains data !<br />are you sure you want to convert the old content table to the new content table ?<br /><br />if you still would like to convert the table, the old content data will be added to the already existing new content table, but no garantee can be made to assure that all items will be added to already existing new categories in a correct manner !");
+define("CONTENT_ADMIN_CONVERSION_LAN_45", "insertion failed: main parent not inserted");
+define("CONTENT_ADMIN_CONVERSION_LAN_46", "Start managing your content by going to the <a href='".e_PLUGIN."content/admin_content_config.php'>Content Manager Plugin Frontpage</a> !");
+define("CONTENT_ADMIN_CONVERSION_LAN_47", "conversion completed");
+define("CONTENT_ADMIN_CONVERSION_LAN_48", "click here for details");
+define("CONTENT_ADMIN_CONVERSION_LAN_49", "conversion of pages");
+define("CONTENT_ADMIN_CONVERSION_LAN_50", "conversion of main parents");
+define("CONTENT_ADMIN_CONVERSION_LAN_51", "unknown rows");
+define("CONTENT_ADMIN_CONVERSION_LAN_52", "default set of main parent categories created");
+define("CONTENT_ADMIN_CONVERSION_LAN_53", "a main parent by this name already exists");
+define("CONTENT_ADMIN_CONVERSION_LAN_54", "create a default set of parent categories (content, review and article)");
+define("CONTENT_ADMIN_CONVERSION_LAN_55", "content management plugin : conversion options");
+define("CONTENT_ADMIN_CONVERSION_LAN_56", "click the button to go to the Content Create New Category page.");
+define("CONTENT_ADMIN_CONVERSION_LAN_57", "choose parent");
+define("CONTENT_ADMIN_CONVERSION_LAN_58", "upgrade succesfull<br /><br /><b>Please note:<br />you need to reconfigure the options for each main parent<br />and you need to delete the menus you've created in your content/menus folder, and recreate them by updating the options for the specific main parents you want to use menus for.</b>");
+
+define("CONTENT_ADMIN_CONVERSION_LAN_59", "convert table");
+define("CONTENT_ADMIN_CONVERSION_LAN_60", "create defaults");
+define("CONTENT_ADMIN_CONVERSION_LAN_61", "create new category");
+define("CONTENT_ADMIN_CONVERSION_LAN_62", "Content Management Plugin Version updated to version:");
+define("CONTENT_ADMIN_CONVERSION_LAN_63", "upgrade");
+define("CONTENT_ADMIN_CONVERSION_LAN_64", "");
+define("CONTENT_ADMIN_CONVERSION_LAN_65", "");
+
+
+
+define("CONTENT_ADMIN_OPT_LAN_MENU_1", "Options:");
+define("CONTENT_ADMIN_OPT_LAN_MENU_2", "Pages:");
+define("CONTENT_ADMIN_OPT_LAN_MENU_3", "Admin : Create Item");
+define("CONTENT_ADMIN_OPT_LAN_MENU_4", "Submit Item");
+define("CONTENT_ADMIN_OPT_LAN_MENU_5", "path locations and theme settings");
+define("CONTENT_ADMIN_OPT_LAN_MENU_6", "General");
+define("CONTENT_ADMIN_OPT_LAN_MENU_7", "Content Manager");
+define("CONTENT_ADMIN_OPT_LAN_MENU_8", "Menu Properties");
+define("CONTENT_ADMIN_OPT_LAN_MENU_9", "Content Item Preview");
+define("CONTENT_ADMIN_OPT_LAN_MENU_10", "Category pages");
+define("CONTENT_ADMIN_OPT_LAN_MENU_11", "Content pages");
+define("CONTENT_ADMIN_OPT_LAN_MENU_12", "Author Page");
+define("CONTENT_ADMIN_OPT_LAN_MENU_13", "Archive Page");
+define("CONTENT_ADMIN_OPT_LAN_MENU_14", "Top Rated Page");
+define("CONTENT_ADMIN_OPT_LAN_MENU_15", "Top Score Page");
+define("CONTENT_ADMIN_OPT_LAN_MENU_16", "all categories page (all categories in the main parent)");
+define("CONTENT_ADMIN_OPT_LAN_MENU_17", "view category page (parent item, subcategories and content items in that category");
+define("CONTENT_ADMIN_OPT_LAN_MENU_18", "categories");
+define("CONTENT_ADMIN_OPT_LAN_MENU_19", "recent items list");
+define("CONTENT_ADMIN_OPT_LAN_MENU_20", "links to pages");
+
+
+
+define("CONTENT_ADMIN_OPT_LAN_SECTION_0", "sections");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_1", "choose what will be displayed");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_2", "attachments");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_3", "images");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_4", "comment");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_5", "rating");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_6", "score");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_7", "visibility");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_8", "meta definition");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_9", "layout schemes");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_10", "custom data tags");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_11", "preset data tags");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_12", "subheading");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_13", "summary");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_14", "text (define amount of words)");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_15", "date");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_16", "author : name");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_17", "author : email");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_18", "author : link to author profile");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_19", "author : link to author list");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_20", "email/print/pdf icon");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_21", "parent breadcrumb");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_22", "refer (only if logging enabled)");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_23", "amount of items");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_24", "last item of each author");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_25", "amount of items by each author");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_26", "edit icon for fast editing");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_27", "icon");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_28", "of the category item");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_29", "of the list of subcategories");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_30", "enabled");
+define("CONTENT_ADMIN_OPT_LAN_SECTION_31", "disabled");
+
+
+
+define("CONTENT_PRESET_LAN_0", "error : fieldname not filled in");
+define("CONTENT_PRESET_LAN_1", "error : not all fields are filled in correctly<br />all fields need to be filled in");
+define("CONTENT_PRESET_LAN_2", "");
+define("CONTENT_PRESET_LAN_3", "both size and maxsize need to be numeric values");
+define("CONTENT_PRESET_LAN_4", "both cols and rows need to be numeric values");
+define("CONTENT_PRESET_LAN_5", "you need to provide some options");
+define("CONTENT_PRESET_LAN_6", "both year from and year to need to be numeric values");
+define("CONTENT_PRESET_LAN_7", "Content Preset Field Generator");
+define("CONTENT_PRESET_LAN_8", "create a new preset data tag of type");
+define("CONTENT_PRESET_LAN_9", "fieldname");
+define("CONTENT_PRESET_LAN_10", "size");
+define("CONTENT_PRESET_LAN_11", "maxlength");
+define("CONTENT_PRESET_LAN_12", "cols");
+define("CONTENT_PRESET_LAN_13", "rows");
+define("CONTENT_PRESET_LAN_14", "years from");
+define("CONTENT_PRESET_LAN_15", "years to");
+define("CONTENT_PRESET_LAN_16", "options");
+define("CONTENT_PRESET_LAN_17", "add more");
+define("CONTENT_PRESET_LAN_18", "add preset");
+define("CONTENT_PRESET_LAN_19", "you need to provide an equal amount of text and value fields");
+define("CONTENT_PRESET_LAN_20", "you need to provide a value for the checkbox");
+define("CONTENT_PRESET_LAN_21", "text");
+define("CONTENT_PRESET_LAN_22", "value");
+define("CONTENT_PRESET_LAN_23", "choose text");
+define("CONTENT_PRESET_LAN_24", "the first option with no value");
+define("CONTENT_PRESET_LAN_25", "add field ...");
+define("CONTENT_PRESET_LAN_26", "text");
+define("CONTENT_PRESET_LAN_27", "textarea");
+define("CONTENT_PRESET_LAN_28", "select");
+define("CONTENT_PRESET_LAN_29", "date");
+define("CONTENT_PRESET_LAN_30", "checkbox");
+define("CONTENT_PRESET_LAN_31", "radio");
+define("CONTENT_PRESET_LAN_32", "example:");
+
+
+
+define("CONTENT_ADMIN_OPT_LAN_0", "options");
+define("CONTENT_ADMIN_OPT_LAN_1", "default preferences");
+define("CONTENT_ADMIN_OPT_LAN_2", "update options");
+define("CONTENT_ADMIN_OPT_LAN_3", "number of images that can be uploaded");
+define("CONTENT_ADMIN_OPT_LAN_4", "number of attachments that can be uploaded");
+define("CONTENT_ADMIN_OPT_LAN_5", "number of custom data tags available");
+define("CONTENT_ADMIN_OPT_LAN_6", "preset data tags");
+define("CONTENT_ADMIN_OPT_LAN_7", "define default preset data tags");
+//define("CONTENT_ADMIN_OPT_LAN_8", "Here you can provide additional preset data tags. The fields you provide here are the keys of the key=>value data tags. They will have a input element for the value to be set in the admin creation form. You can choose from the pulldown menu which type of element you want the preset data tag to be. Note: these are not part of the amount of custom data tags you have specified above, and will be used additionally.These Preset Tags are very usefull if you want to have a certain custom tag available standard for each new item. for instance, if you always want to be able to define a value for 'photographer' you can create such a preset tag, which will always be displayed for each new item in this main parent.");
+define("CONTENT_ADMIN_OPT_LAN_9", "allow submit items ?");
+define("CONTENT_ADMIN_OPT_LAN_10", "who can submit items ?");
+define("CONTENT_ADMIN_OPT_LAN_11", "direct posting");
+define("CONTENT_ADMIN_OPT_LAN_12", "if enabled, a submitted item is directly added in the database and will be immediately visible, else a site admin needs to approve the item.");
+define("CONTENT_ADMIN_OPT_LAN_13", "here you can define where your images are or will be stored. use braces ( { } ) for the general e107 related path variables (like ( {e_PLUGIN} or {e_IMAGE} ). for the content category icons two versions are needed, one small and one large set of icons. The TMP paths are needed for upload, you must create these !");
+define("CONTENT_ADMIN_OPT_LAN_15", "path to content cat icons (large)");
+define("CONTENT_ADMIN_OPT_LAN_16", "path to content cat icons (small)");
+define("CONTENT_ADMIN_OPT_LAN_17", "path to content item icons");
+define("CONTENT_ADMIN_OPT_LAN_18", "path to content item images");
+define("CONTENT_ADMIN_OPT_LAN_19", "path to content item attachments
+");
+define("CONTENT_ADMIN_OPT_LAN_20", "define theme for this main category");
+define("CONTENT_ADMIN_OPT_LAN_21", "define default layout scheme");
+define("CONTENT_ADMIN_OPT_LAN_22", "activate logging of refer count");
+define("CONTENT_ADMIN_OPT_LAN_23", "show blank item icon if no icon present");
+define("CONTENT_ADMIN_OPT_LAN_24", "show blank category icon if no icon present");
+define("CONTENT_ADMIN_OPT_LAN_25", "select a layout scheme");
+define("CONTENT_ADMIN_OPT_LAN_26", "show breadcrumb on these pages:");
+define("CONTENT_ADMIN_OPT_LAN_27", "all categories");
+define("CONTENT_ADMIN_OPT_LAN_28", "single category");
+define("CONTENT_ADMIN_OPT_LAN_29", "all authors");
+define("CONTENT_ADMIN_OPT_LAN_30", "single author");
+define("CONTENT_ADMIN_OPT_LAN_31", "recent");
+define("CONTENT_ADMIN_OPT_LAN_32", "content item");
+define("CONTENT_ADMIN_OPT_LAN_33", "top rated");
+define("CONTENT_ADMIN_OPT_LAN_34", "archive");
+define("CONTENT_ADMIN_OPT_LAN_35", "score");
+define("CONTENT_ADMIN_OPT_LAN_36", "breadcrumb seperator character");
+define("CONTENT_ADMIN_OPT_LAN_37", "define how to render the breadcrumb information");
+define("CONTENT_ADMIN_OPT_LAN_38", "tmp");
+define("CONTENT_ADMIN_OPT_LAN_39", "echo");
+define("CONTENT_ADMIN_OPT_LAN_40", "use a seperate menu");
+define("CONTENT_ADMIN_OPT_LAN_41", "combine into one menu");
+define("CONTENT_ADMIN_OPT_LAN_42", "");
+define("CONTENT_ADMIN_OPT_LAN_43", "display navigator on these pages:");
+define("CONTENT_ADMIN_OPT_LAN_44", "display search on these pages:");
+define("CONTENT_ADMIN_OPT_LAN_45", "");
+define("CONTENT_ADMIN_OPT_LAN_46", "display order option on these pages:");
+define("CONTENT_ADMIN_OPT_LAN_47", "");
+define("CONTENT_ADMIN_OPT_LAN_48", "rendertype navigator/search/order");
+define("CONTENT_ADMIN_OPT_LAN_49", "display limited number of items per page");
+define("CONTENT_ADMIN_OPT_LAN_50", "how many items will be displayed");
+define("CONTENT_ADMIN_OPT_LAN_51", "choose a default sort method");
+define("CONTENT_ADMIN_OPT_LAN_52", "max image size");
+define("CONTENT_ADMIN_OPT_LAN_53", "define the size to which uploaded images will be resized to");
+define("CONTENT_ADMIN_OPT_LAN_54", "if the width or height of the uploaded image is greater than the given value, the image will be resized to this value.<br />the popup images will also be displayed with this value.");
+define("CONTENT_ADMIN_OPT_LAN_55", "thumb image size");
+define("CONTENT_ADMIN_OPT_LAN_56", "define the size of the thumb images that will be created with the uploaded image");
+define("CONTENT_ADMIN_OPT_LAN_57", "if the width or height of the uploaded image is greater than the given value, the image will be resized to this value.<br />the images will also be displayed with this value on the content page.");
+define("CONTENT_ADMIN_OPT_LAN_58", "max icon width");
+define("CONTENT_ADMIN_OPT_LAN_59", "define the maximum width of the icon on icon upload");
+define("CONTENT_ADMIN_OPT_LAN_60", "if the uploaded icon is greater than the given value, the icon will be resized to this value.<br />the icon will also be displayed with this value.");
+define("CONTENT_ADMIN_OPT_LAN_61", "px");
+define("CONTENT_ADMIN_OPT_LAN_62", "choose managers from this userclass");
+define("CONTENT_ADMIN_OPT_LAN_63", "The userlist in the admin content manager area will consist of only the users in the defined class. You still need to assign users to each category! This class will just narrow down the list of users to choose from");
+define("CONTENT_ADMIN_OPT_LAN_64", "display email of non-member author");
+define("CONTENT_ADMIN_OPT_LAN_65", "display a letter index");
+define("CONTENT_ADMIN_OPT_LAN_66", "the letterindex is a list of buttons with all the first letters of the content heading fields. you can narrow down the archive list by clicking a certain letter so only content items starting with that letter will be displayed on the screen.");
+define("CONTENT_ADMIN_OPT_LAN_67", "define datestyle for display date");
+define("CONTENT_ADMIN_OPT_LAN_68", "For more information on date formats see the <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>strftime function page at php.net</a>");
+define("CONTENT_ADMIN_OPT_LAN_69", "display icons on all items<br />(print/email/pdf icons)");
+define("CONTENT_ADMIN_OPT_LAN_70", "allow rating on all items");
+define("CONTENT_ADMIN_OPT_LAN_71", "allow comments on all items");
+define("CONTENT_ADMIN_OPT_LAN_72", "");
+define("CONTENT_ADMIN_OPT_LAN_73", "rendertype multipage index");
+define("CONTENT_ADMIN_OPT_LAN_74", "if you have a multipage article, you can either show the article index of these pages as a list of normal hyperlinks, or show them in a selectbox");
+define("CONTENT_ADMIN_OPT_LAN_75", "hyperlinks");
+define("CONTENT_ADMIN_OPT_LAN_76", "selectbox");
+define("CONTENT_ADMIN_OPT_LAN_77", "define amount of characters");
+define("CONTENT_ADMIN_OPT_LAN_78", "define a postfix");
+define("CONTENT_ADMIN_OPT_LAN_79", "leave blank to show full");
+define("CONTENT_ADMIN_OPT_LAN_80", "leave blank to show nothing");
+define("CONTENT_ADMIN_OPT_LAN_81", "define amount of words");
+define("CONTENT_ADMIN_OPT_LAN_82", "text");
+define("CONTENT_ADMIN_OPT_LAN_83", "add link to the postfix");
+define("CONTENT_ADMIN_OPT_LAN_84", "display the parent item");
+define("CONTENT_ADMIN_OPT_LAN_85", "display the parent subcategories");
+define("CONTENT_ADMIN_OPT_LAN_86", "display items of parent subcategories");
+define("CONTENT_ADMIN_OPT_LAN_87", "if enabled all items from the selected category and items from all underlying categories are shown.");
+define("CONTENT_ADMIN_OPT_LAN_88", "define display order of parent and child items");
+define("CONTENT_ADMIN_OPT_LAN_89", "parents first, then items");
+define("CONTENT_ADMIN_OPT_LAN_90", "items first, then parents");
+define("CONTENT_ADMIN_OPT_LAN_91", "rendertype for parent, sub and items");
+define("CONTENT_ADMIN_OPT_LAN_92", "each in a seperate menu");
+define("CONTENT_ADMIN_OPT_LAN_93", "caption");
+define("CONTENT_ADMIN_OPT_LAN_94", "add search box");
+define("CONTENT_ADMIN_OPT_LAN_95", "add sort and order box");
+define("CONTENT_ADMIN_OPT_LAN_96", "show navigator links");
+define("CONTENT_ADMIN_OPT_LAN_97", "if disabled all link options below are disregarded");
+define("CONTENT_ADMIN_OPT_LAN_98", "link : all categories");
+define("CONTENT_ADMIN_OPT_LAN_99", "link : all authors");
+define("CONTENT_ADMIN_OPT_LAN_100", "link : all content items");
+define("CONTENT_ADMIN_OPT_LAN_101", "link : top rated");
+define("CONTENT_ADMIN_OPT_LAN_102", "link : top score");
+define("CONTENT_ADMIN_OPT_LAN_103", "link : recent items");
+define("CONTENT_ADMIN_OPT_LAN_104", "link : submit item");
+define("CONTENT_ADMIN_OPT_LAN_105", "icon : links");
+define("CONTENT_ADMIN_OPT_LAN_106", "none (), bullet (), middot (&middot;), white bullet (), arrow (&raquo;), category_icon()");
+define("CONTENT_ADMIN_OPT_LAN_107", "none");
+define("CONTENT_ADMIN_OPT_LAN_108", "bullet");
+define("CONTENT_ADMIN_OPT_LAN_109", "middot");
+define("CONTENT_ADMIN_OPT_LAN_110", "white bullet");
+define("CONTENT_ADMIN_OPT_LAN_111", "arrow");
+define("CONTENT_ADMIN_OPT_LAN_112", "category icon");
+define("CONTENT_ADMIN_OPT_LAN_113", "content icon");
+define("CONTENT_ADMIN_OPT_LAN_114", "rendertype for links");
+define("CONTENT_ADMIN_OPT_LAN_115", "caption for link list");
+define("CONTENT_ADMIN_OPT_LAN_116", "this caption will only be used if the links are shown as 'normallinks'.");
+define("CONTENT_ADMIN_OPT_LAN_117", "display categories");
+define("CONTENT_ADMIN_OPT_LAN_118", "include main category");
+define("CONTENT_ADMIN_OPT_LAN_119", "if disabled only the subcategories of the main parent are displayed");
+define("CONTENT_ADMIN_OPT_LAN_120", "display number of items in each category");
+define("CONTENT_ADMIN_OPT_LAN_121", "icon: category");
+define("CONTENT_ADMIN_OPT_LAN_122", "icon: category (default)");
+define("CONTENT_ADMIN_OPT_LAN_123", "rendertype of category list");
+define("CONTENT_ADMIN_OPT_LAN_124", "caption category list");
+define("CONTENT_ADMIN_OPT_LAN_125", "display recent item list");
+define("CONTENT_ADMIN_OPT_LAN_126", "display date");
+define("CONTENT_ADMIN_OPT_LAN_127", "display author");
+define("CONTENT_ADMIN_OPT_LAN_128", "display subheading");
+define("CONTENT_ADMIN_OPT_LAN_129", "subheading : define amount of words");
+define("CONTENT_ADMIN_OPT_LAN_130", "subheading : define postfix");
+define("CONTENT_ADMIN_OPT_LAN_131", "how many items will be displayed");
+define("CONTENT_ADMIN_OPT_LAN_132", "icon for recent items");
+define("CONTENT_ADMIN_OPT_LAN_133", "icon : width");
+define("CONTENT_ADMIN_OPT_LAN_134", "if chosen 'content icon', define the width of the icon to use");
+define("CONTENT_ADMIN_OPT_LAN_135", "caption recent item list");
+define("CONTENT_ADMIN_OPT_LAN_136", "");
+define("CONTENT_ADMIN_OPT_LAN_137", "");
+define("CONTENT_ADMIN_OPT_LAN_138", "");
+define("CONTENT_ADMIN_OPT_LAN_139", "");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/languages/English/lan_content_frontpage.php 75/e107_plugins/content/languages/English/lan_content_frontpage.php
--- 6171/e107_plugins/content/languages/English/lan_content_frontpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/languages/English/lan_content_frontpage.php	2005-06-01 17:59:32.000000000 -0500
@@ -0,0 +1,16 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/languages/English/lan_content_frontpage.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/06/01 22:59:32 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("CONT_FP_1", "Content category");
+define("CONT_FP_2", "main page");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/languages/English/lan_content_help.php 75/e107_plugins/content/languages/English/lan_content_help.php
--- 6171/e107_plugins/content/languages/English/lan_content_help.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/languages/English/lan_content_help.php	2005-06-29 18:01:57.000000000 -0500
@@ -0,0 +1,78 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/languages/English/lan_content_help.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2005/06/29 23:01:57 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+define("CONTENT_ADMIN_HELP_1", "Content Management Help Area");
+
+define("CONTENT_ADMIN_HELP_ITEM_1", "<i>if you have not yet added main parent categories, please do so at the <a href='".e_SELF."?cat.create'>Create New Category</a> page.</i><br /><br /><b>category</b><br />select a category from the pulldown menu to manage content for that category.<br /><br />Selecting a main parent from the pulldown menu will show all content items in that main category.<br />Selecting a subcategory will show only those content items in the specified subcategory.<br /><br />You can also use the menu on the right to view all content items for a specified category.");
+
+define("CONTENT_ADMIN_HELP_ITEM_2", "<b>first letters</b><br />if multiple content item starting letters of the content_heading are present, you will see buttons to select only those content items starting with that letter. Selecting the 'all' button will show a list containing all content items in this category.<br /><br /><b>detailed list</b><br />You see a list of all content items with their id, icon, author, heading [subheading] and options.<br /><br /><b>explanation of icons</b><br />".CONTENT_ICON_USER." : link to the author profile<br />".CONTENT_ICON_LINK." : link to the content item<br />".CONTENT_ICON_EDIT." : edit the content item<br />".CONTENT_ICON_DELETE." : delete the content item<br />");
+
+define("CONTENT_ADMIN_HELP_ITEMEDIT_1", "<b>edit form</b><br />you can now edit all information for this content item and submit your changes.<br /><br />If you need to change the category for this content item, please do so first. After you have selectd the correct category, change or add any fields present, before you submit the changes.");
+
+define("CONTENT_ADMIN_HELP_ITEMCREATE_1", "<b>category</b><br />please select a category from the select box to create your content item for.<br />");
+
+define("CONTENT_ADMIN_HELP_ITEMCREATE_2", "<b>creation form</b><br />you can now provide all information for this content item and submit it.<br /><br />Be aware of the fact that diffenent main parent categories can have a different set of preferences; different fields can be available for you to fill in. Therefore you always need to select a category first before you fill in other fields !");
+
+define("CONTENT_ADMIN_HELP_CAT_1", "<i>this page shows all categories and subcategories present.</i><br /><br /><b>detailed list</b><br />You see a list of all subcategories with their id, icon, author, category [subheading] and options.<br /><br /><b>explanation of icons</b><br />".CONTENT_ICON_USER." : link to the author profile<br />".CONTENT_ICON_LINK." : link to the category<br />".CONTENT_ICON_EDIT." : edit the category<br />".CONTENT_ICON_DELETE." : delete the category<br />");
+
+define("CONTENT_ADMIN_HELP_CAT_2", "<i>this page allows you to create a new category</i><br /><br />Always choose a parent category before you fill in the other fields !<br /><br />This must be done, because some unique category preferences need to be loaded in the system.<br /><br />By default the category page is shown to create a new main category.");
+
+define("CONTENT_ADMIN_HELP_CAT_3", "<i>this page shows the category edit form.</i><br /><br /><b>category edit form</b><br />you can now edit all information for this (sub)category and submit your changes.<br /><br />If you want to change the parent location for this category, please do so first. After you have set the correct category edit all other fields.");
+
+define("CONTENT_ADMIN_HELP_ORDER_1", "<i>this page shows all categories and subcategories present.</i><br /><br /><b>detailed list</b><br />you see the category id and the category name. also you see several options to manage the order of the categories.<br /><br /><b>explanation of icons</b><br />".CONTENT_ICON_USER." : link to the author profile<br />".CONTENT_ICON_LINK." : link to the category<br />".CONTENT_ICON_ORDERALL." : manage the global order of content item regardless of category.<br />".CONTENT_ICON_ORDERCAT." : manage the order of content items in the specific category.<br />".CONTENT_ICON_ORDER_UP." : the up button allows you to move a content item one up in order.<br />".CONTENT_ICON_ORDER_DOWN." : the down button allows you to move a content item one down in order.<br /><br /><b>order</b><br />here you can manually set the order of all the categories in this each parent. You need to change the values in the select boxes to the order of your kind and then press the update button below to save the new order.<br />");
+
+define("CONTENT_ADMIN_HELP_ORDER_2", "<i>this page shows all content items from the category you have selected.</i><br /><br /><b>detailed list</b><br />you see the content id, the content author and the content heading. also you see several options to manage the order of the content items.<br /><br /><b>explanation of icons</b><br />".CONTENT_ICON_USER." : link to the author profile<br />".CONTENT_ICON_LINK." : link to the content item<br />".CONTENT_ICON_ORDER_UP." : the up button allows you to move a content item one up in order.<br />".CONTENT_ICON_ORDER_DOWN." : the down button allows you to move a content item one down in order.<br /><br /><b>order</b><br />here you can manually set the order of all the categories in this main parent. You need to change the values in the select boxes to the order of your kind and then press the update button below to save the new order.<br />");
+
+define("CONTENT_ADMIN_HELP_ORDER_3", "<i>this page shows all content items from main parent category you have selected.</i><br /><br /><b>detailed list</b><br />you see the content id, the content author and the content heading. also you see several options to manage the order of the content items.<br /><br /><b>explanation of icons</b><br />".CONTENT_ICON_USER." : link to the author profile<br />".CONTENT_ICON_LINK." : link to the content item<br />".CONTENT_ICON_ORDER_UP." : the up button allow you to move a content item one up in order.<br />".CONTENT_ICON_ORDER_DOWN." : the down button allow you to move a content item one down in order.<br /><br /><b>order</b><br />here you can manually set the order of all the categories in this main parent. You need to change the values in the select boxes to the order of your kind and then press the update button below to save the new order.<br />");
+
+define("CONTENT_ADMIN_HELP_OPTION_1", "On this page you can select a main parent category to set options for, or you can choose to edit the default preferences.<br /><br /><b>explanation of icons</b><br />".CONTENT_ICON_USER." : link to the author profile<br />".CONTENT_ICON_LINK." : link to the category<br />".CONTENT_ICON_OPTIONS." : edit the options<br /><br /><br />
+The default preferences are only used when you create a new main parent. So when you create a new main parent these default preferences will be stored. You can change these to make sure newly created main parents already have a certain set of features present.
+<br /><br />
+Each main parent has its own set of options, which are unique to that specific main parent category");
+
+//define("CONTENT_ADMIN_HELP_OPTION_2", "<i>this page shows the options you can set for this main parent. Each main parent has their own specific set of options, so be sure to set them all correctly.</i><br /><br />");
+//<b>default values</b><br />By default all values are present and already updated in the preferences when you view this page, but change any setting to your own standards.<br /><br />
+define("CONTENT_ADMIN_HELP_MANAGER_1", "On this page you see a list of all categories. You can manage the 'personal content manager' for each category by clicking the icon.<br /><br /><b>explanation of icons</b><br />".CONTENT_ICON_USER." : link to the author profile<br />".CONTENT_ICON_LINK." : link to the category<br />".CONTENT_ICON_CONTENTMANAGER_SMALL." : edit the personal content managers<br />");
+
+define("CONTENT_ADMIN_HELP_MANAGER_2", "<i>on this page you can assign users to the selected category you have clicked</i><br /><br /><b>personal manager</b><br />you can assign users to certain categories. In doing so, these users can manage their personal content items within these categories from outside of the admin page (content_manager.php).<br /><br />Assign users from the left colomn by clicking their name. you will see these names move to the right colomn. After clicking the assign button the users in the right colomn are assigned to this category.");
+
+define("CONTENT_ADMIN_HELP_SUBMIT_1", "<i>On this page you see a list of all content items that were submitted by users.</i><br /><br /><b>detailed list</b><br />You see a list of these content items with their id, icon, main parent, heading [subheading], author and options.<br /><br /><b>options</b><br />you can post or delete a content item using the buttons shown.");
+
+
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_1", "this page allows you to set options for the admin create item page.<br /><br />You can define which sections are available when an admin (or personal content manager) creates a new content item<br /><br /><b>custom data tags</b><br />you can allow a user or admin to add optional fields to the content item by using these custom data tags. These optional fields are blank key=>value pairs. For instance: you could add a key field for 'photographer' and provide the value field with 'all photos by me'. Both these key and value fields are empty textfields which will be present in the create form.<br /><br /><b>preset data tags</b><br />apart from the custom data tags, you can provide preset data tags. The difference is that in preset data tags, the key field already is given and the user only needs to provide the value field for the preset. In the same example as above 'photographer' can be predefined, and the user needs to provide 'all photos by me'. You can choose the element type by selecting one option in the selectbox. In the popup window, you can provide all the information for the preset data tag.<br />");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_2", "The Submit Options have affect on the user submit form for content items.<br /><br />You can define which sections are available for a user when submitting a content item.<br /><br />".CONTENT_ADMIN_OPT_LAN_11.":<br />".CONTENT_ADMIN_OPT_LAN_12."");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_3", "In the Path and Theme Options you can define where images and files are stored.<br /><br />you can define which theme will be used by this main parent. You can create additional themes by copying (and renaming) the whole 'default' directory in your templates directory.<br /><br />You can define a default layout scheme for new content items. You can create new layout schemes by creating a content_content_template_XXX.php file in your 'templates/default' folder. These layouts can be used to give each content item in this main parent a different layout.<br /><br />");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_4", "The General Options are options that are used throughout the content pages of the content management plugin.");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_5", "These options have affect on the Personal Content Manager area on the content management admin area.<br /><br />".CONTENT_ADMIN_OPT_LAN_63."");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_6", "These Options are used in the Menu for this main parent if you have activated the menu.<br /><br />".CONTENT_ADMIN_OPT_LAN_68."<br /><br />".CONTENT_ADMIN_OPT_LAN_118.":<br />".CONTENT_ADMIN_OPT_LAN_119."<br /><br />");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_7", "The Content Item Preview options have affect on the small preview that is given for a content item.<br /><br />This preview is given on several pages, like the recent page, the view items in category page and the view items of author page.<br /><br />".CONTENT_ADMIN_OPT_LAN_68."");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_8", "The Category Pages show information on the content categories in this main parent.<br /><br />There are two distinct areas present:<br /><br />all categories page:<br />this page shows all the categories in this main parent<br /><br />view category page:<br />this page shows the category item, optionally the subcategories in that category and the content items in that category or those categories<br />");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_9", "The Content Page shows the Content Item.<br /><br />you can define which sections to show by checking/unchecking the boxes.<br /><br />you can show the emailaddress of a non-member author.<br /><br />you can override the email/print/pdf icons, the rating system and the comments.<br /><br />".CONTENT_ADMIN_OPT_LAN_74."");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_10", "The Author Page shows a list of all unique authors of the content items in this main parent.<br /><br />you can define which sections to show by checking/unchecking the boxes.<br /><br />You can limit the number of items to show per page.<br />");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_11", "The Archive Page shows all content items in the main parent.<br /><br />you can define which sections to show by checking/unchecking the boxes.<br /><br />you can show the emailaddress of a non-member author.<br /><br />You can limit the number of items to show per page.<br /><br />".CONTENT_ADMIN_OPT_LAN_66."<br /><br />".CONTENT_ADMIN_OPT_LAN_68."");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_12", "The Top Rated Page shows all content items that have been rated by users.<br /><br />You can choose the sections to display by checking the boxes.<br /><br />Also you can define if the emailaddress of a non-member author will be displayed.");
+
+define("CONTENT_ADMIN_HELP_OPTION_DIV_13", "The Top Score Page shows all content items that have been given a score by the author of the content item.<br /><br />You can choose the sections to display by checking the boxes.<br /><br />Also you can define if the emailaddress of a non-member author will be displayed.");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/languages/English/lan_content.php 75/e107_plugins/content/languages/English/lan_content.php
--- 6171/e107_plugins/content/languages/English/lan_content.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/languages/English/lan_content.php	2005-06-29 11:38:23.000000000 -0500
@@ -0,0 +1,199 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/languages/English/lan_content.php,v $
+|     $Revision: 1.66 $
+|     $Date: 2005/06/29 16:38:23 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+
+define("CONTENT_EMAILPRINT_LAN_1", "this content item is from");
+
+define("CONTENT_ICON_LAN_0", "edit");
+define("CONTENT_ICON_LAN_1", "delete");
+define("CONTENT_ICON_LAN_2", "options");
+define("CONTENT_ICON_LAN_3", "user details");
+define("CONTENT_ICON_LAN_4", "download attachment");
+define("CONTENT_ICON_LAN_5", "new");
+define("CONTENT_ICON_LAN_6", "submit content");
+define("CONTENT_ICON_LAN_7", "author list");
+define("CONTENT_ICON_LAN_8", "warning");
+define("CONTENT_ICON_LAN_9", "ok");
+define("CONTENT_ICON_LAN_10", "error");
+define("CONTENT_ICON_LAN_11", "order items in category");
+define("CONTENT_ICON_LAN_12", "order items in main parent");
+define("CONTENT_ICON_LAN_13", "personal admin");
+define("CONTENT_ICON_LAN_14", "personal contentmanager");
+define("CONTENT_ICON_LAN_15", "view");
+
+define("CONTENT_ADMIN_DATE_LAN_0", "January");
+define("CONTENT_ADMIN_DATE_LAN_1", "February");
+define("CONTENT_ADMIN_DATE_LAN_2", "March");
+define("CONTENT_ADMIN_DATE_LAN_3", "April");
+define("CONTENT_ADMIN_DATE_LAN_4", "May");
+define("CONTENT_ADMIN_DATE_LAN_5", "June");
+define("CONTENT_ADMIN_DATE_LAN_6", "July");
+define("CONTENT_ADMIN_DATE_LAN_7", "August");
+define("CONTENT_ADMIN_DATE_LAN_8", "September");
+define("CONTENT_ADMIN_DATE_LAN_9", "October");
+define("CONTENT_ADMIN_DATE_LAN_10", "November");
+define("CONTENT_ADMIN_DATE_LAN_11", "December");
+define("CONTENT_ADMIN_DATE_LAN_12", "day");
+define("CONTENT_ADMIN_DATE_LAN_13", "month");
+define("CONTENT_ADMIN_DATE_LAN_14", "year");
+define("CONTENT_ADMIN_DATE_LAN_15", "start date");
+define("CONTENT_ADMIN_DATE_LAN_16", "end date");
+define("CONTENT_ADMIN_DATE_LAN_17", "You can specify a start date for this content item. If you use a date in the future the content item will be visible from that point onward. If you do not need a specific starting date, you can just leave these fields as they are.");
+define("CONTENT_ADMIN_DATE_LAN_18", "you can specify an end date for this content item. With the end date you can specify until which point in time the content item needs to be visible. If you do not need an end time for this content item, you can just leave the fields as they are.");
+
+define("CONTENT_PAGETITLE_LAN_0", "Content");
+define("CONTENT_PAGETITLE_LAN_1", "Main");
+define("CONTENT_PAGETITLE_LAN_2", "Recent");
+define("CONTENT_PAGETITLE_LAN_3", "Category");
+define("CONTENT_PAGETITLE_LAN_4", "Top Rated");
+define("CONTENT_PAGETITLE_LAN_5", "Author");
+define("CONTENT_PAGETITLE_LAN_6", "Archive");
+define("CONTENT_PAGETITLE_LAN_7", "Submit");
+define("CONTENT_PAGETITLE_LAN_8", "Submit Content Item");
+define("CONTENT_PAGETITLE_LAN_9", "Personal Content Manager");
+define("CONTENT_PAGETITLE_LAN_10", "View Items");
+define("CONTENT_PAGETITLE_LAN_11", "Edit Item");
+define("CONTENT_PAGETITLE_LAN_12", "Create Item");
+define("CONTENT_PAGETITLE_LAN_13", "Categories");
+define("CONTENT_PAGETITLE_LAN_14", "Authorlist");
+define("CONTENT_PAGETITLE_LAN_15", "Top Score");
+
+define("CONTENT_SEARCH_LAN_0", "no content items found with these keywords.");
+
+define("CONTENT_ORDER_LAN_0", "sort by ...");
+define("CONTENT_ORDER_LAN_1", "heading (ASC)");
+define("CONTENT_ORDER_LAN_2", "heading (DESC)");
+define("CONTENT_ORDER_LAN_3", "date (ASC)");
+define("CONTENT_ORDER_LAN_4", "date (DESC)");
+define("CONTENT_ORDER_LAN_5", "refer (ASC)");
+define("CONTENT_ORDER_LAN_6", "refer (DESC)");
+define("CONTENT_ORDER_LAN_7", "parent (ASC)");
+define("CONTENT_ORDER_LAN_8", "parent (DESC)");
+define("CONTENT_ORDER_LAN_9", "order (ASC)");
+define("CONTENT_ORDER_LAN_10", "order (DESC)");
+define("CONTENT_ORDER_LAN_11", "author (ASC)");
+define("CONTENT_ORDER_LAN_12", "author (DESC)");
+
+define("CONTENT_LAN_0", "Content");
+define("CONTENT_LAN_1", "Recent List");
+define("CONTENT_LAN_2", "Category List");
+define("CONTENT_LAN_3", "Category");
+define("CONTENT_LAN_4", "Author List");
+define("CONTENT_LAN_5", "Author");
+define("CONTENT_LAN_6", "all categories");
+define("CONTENT_LAN_7", "all authors");
+define("CONTENT_LAN_8", "top rated items");
+define("CONTENT_LAN_9", "in");
+define("CONTENT_LAN_10", "on");
+define("CONTENT_LAN_11", "by");
+define("CONTENT_LAN_12", "top score items");
+define("CONTENT_LAN_13", "");
+define("CONTENT_LAN_14", "");
+define("CONTENT_LAN_15", "");
+define("CONTENT_LAN_16", "");
+define("CONTENT_LAN_17", "");
+define("CONTENT_LAN_18", "search by keyword");
+define("CONTENT_LAN_19", "search");
+define("CONTENT_LAN_20", "content search results");
+define("CONTENT_LAN_21", "no content types yet.");
+define("CONTENT_LAN_22", "content types");
+define("CONTENT_LAN_23", "Recent Content List");
+define("CONTENT_LAN_24", "breadcrumb");
+define("CONTENT_LAN_25", "Content Categories");
+define("CONTENT_LAN_26", "Content Category");
+define("CONTENT_LAN_27", "subcategories");
+define("CONTENT_LAN_28", "parent subcategories");
+define("CONTENT_LAN_29", "unknown");
+define("CONTENT_LAN_30", "content item");
+define("CONTENT_LAN_31", "content items");
+define("CONTENT_LAN_32", "Content Author List");
+define("CONTENT_LAN_33", "Go To Page");
+define("CONTENT_LAN_34", "content");
+define("CONTENT_LAN_35", "comments");
+define("CONTENT_LAN_36", "moderate comments");
+define("CONTENT_LAN_37", "no content items rated yet");
+define("CONTENT_LAN_38", "Top Rated Content");
+define("CONTENT_LAN_39", "author list");
+define("CONTENT_LAN_40", "author user details");
+define("CONTENT_LAN_41", "attached");
+define("CONTENT_LAN_42", "file");
+define("CONTENT_LAN_43", "files");
+define("CONTENT_LAN_44", "hits:");
+define("CONTENT_LAN_45", "author awarded score:");
+define("CONTENT_LAN_46", "article index");
+define("CONTENT_LAN_47", "author");
+define("CONTENT_LAN_48", "content items");
+define("CONTENT_LAN_49", "last content item");
+define("CONTENT_LAN_50", "date");
+define("CONTENT_LAN_51", "Type List");
+define("CONTENT_LAN_52", "no valid authors found");
+define("CONTENT_LAN_53", "item");
+define("CONTENT_LAN_54", "items");
+define("CONTENT_LAN_55", "last item on");
+define("CONTENT_LAN_56", "show overview of");
+define("CONTENT_LAN_57", "comments:");
+define("CONTENT_LAN_58", "home");
+define("CONTENT_LAN_59", "content");
+define("CONTENT_LAN_60", "recent");
+define("CONTENT_LAN_61", "view recent items");
+define("CONTENT_LAN_62", "view all categories");
+define("CONTENT_LAN_63", "view all authors");
+define("CONTENT_LAN_64", "view top rated items");
+define("CONTENT_LAN_65", "submit content");
+define("CONTENT_LAN_66", "click here to submit content, you can choose the category on the submit page.");
+define("CONTENT_LAN_67", "personal content manager");
+define("CONTENT_LAN_68", "click here to manage your personal content.");
+define("CONTENT_LAN_69", "email the");
+define("CONTENT_LAN_70", "print the");
+define("CONTENT_LAN_71", "content item");
+define("CONTENT_LAN_72", "category item");
+define("CONTENT_LAN_73", "no content items yet");
+define("CONTENT_LAN_74", "");
+define("CONTENT_LAN_75", "submit content item");
+define("CONTENT_LAN_76", "create pdf file of the");
+define("CONTENT_LAN_77", "content search");
+define("CONTENT_LAN_78", "untitled page");
+define("CONTENT_LAN_79", "page");
+define("CONTENT_LAN_80", "recent items : ");
+define("CONTENT_LAN_81", "categories");
+define("CONTENT_LAN_82", "no items yet in");
+define("CONTENT_LAN_83", "item archive");
+define("CONTENT_LAN_84", "Content Archive");
+define("CONTENT_LAN_85", "authorlist");
+define("CONTENT_LAN_86", "view top score items");
+define("CONTENT_LAN_87", "Top Score Content");
+define("CONTENT_LAN_88", "no content items have a score yet");
+define("CONTENT_LAN_89", "select page");
+
+define("CONTENT_MENU_LAN_0", "content Menu :");
+define("CONTENT_MENU_LAN_1", "no content items yet");
+define("CONTENT_MENU_LAN_2", "recent items");
+define("CONTENT_MENU_LAN_3", "categories");
+define("CONTENT_MENU_LAN_4", "content links");
+define("CONTENT_MENU_LAN_5", "");
+define("CONTENT_MENU_LAN_6", "");
+define("CONTENT_MENU_LAN_7", "");
+define("CONTENT_MENU_LAN_8", "");
+define("CONTENT_MENU_LAN_9", "");
+define("CONTENT_MENU_LAN_10", "");
+define("CONTENT_MENU_LAN_11", "");
+define("CONTENT_MENU_LAN_12", "");
+define("CONTENT_MENU_LAN_13", "");
+define("CONTENT_MENU_LAN_14", "");
+define("CONTENT_MENU_LAN_15", "");
+define("CONTENT_MENU_LAN_16", "");
+define("CONTENT_MENU_LAN_17", "");
+define("CONTENT_MENU_LAN_18", "");
+define("CONTENT_MENU_LAN_19", "");
+define("CONTENT_MENU_LAN_20", "");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/languages/English/lan_content_search.php 75/e107_plugins/content/languages/English/lan_content_search.php
--- 6171/e107_plugins/content/languages/English/lan_content_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/languages/English/lan_content_search.php	2005-06-15 10:18:40.000000000 -0500
@@ -0,0 +1,17 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/languages/English/lan_content_search.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/06/15 15:18:40 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("CONT_SCH_LAN_1", "Content");
+define("CONT_SCH_LAN_2", "All Content Categories");
+define("CONT_SCH_LAN_3", "Posted in reply to item");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/plugin.php 75/e107_plugins/content/plugin.php
--- 6171/e107_plugins/content/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/plugin.php	2006-02-13 04:48:25.000000000 -0600
@@ -0,0 +1,115 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        code adapted from original by Lolo Irie (lolo_irie@e107coders.org)
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $PLUGINS_DIRECTORY;
+$lan_file = e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content_admin.php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."content/languages/English/lan_content_admin.php");
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = CONTENT_PLUGIN_LAN_1;
+$eplug_version = "1.21";
+$eplug_author = "Eric Vanderfeesten (lisa)";
+$eplug_logo = "";
+$eplug_url = "http://eindhovenseschool.net";
+$eplug_email = "lisa@eindhovenseschool.net";
+$eplug_description = CONTENT_PLUGIN_LAN_2;
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";        // leave blank if no readme file
+$eplug_latest = TRUE; //Show reported threads in admin (use latest.php)
+$eplug_status = TRUE; //Show post count in admin (use status.php)
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "content";
+
+// Mane of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_content_config.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/content_32.png";
+$eplug_icon_small = $eplug_folder."/images/content_16.png";
+$eplug_caption = CONTENT_PLUGIN_LAN_3;
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array();
+
+// List of comment_type ids used by this plugin. ----------------------------- 
+$eplug_comment_ids = array("pcontent");
+
+// List of bbcode -----------------------------------------------------------------------------------------------
+//$eplug_bb = array('pcontent');
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array(
+	"pcontent"
+);
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+	"CREATE TABLE ".MPREFIX."pcontent (
+	content_id int(10) unsigned NOT NULL auto_increment,
+	content_heading varchar(255) NOT NULL default '',
+	content_subheading varchar(255) NOT NULL default '',
+	content_summary text NOT NULL,
+	content_text longtext NOT NULL,
+	content_author varchar(255) NOT NULL default '',
+	content_icon varchar(255) NOT NULL default '',
+	content_file text NOT NULL,
+	content_image text NOT NULL,
+	content_parent varchar(50) NOT NULL default '',
+	content_comment tinyint(1) unsigned NOT NULL default '0',
+	content_rate tinyint(1) unsigned NOT NULL default '0',
+	content_pe tinyint(1) unsigned NOT NULL default '0',
+	content_refer text NOT NULL,
+	content_datestamp int(10) unsigned NOT NULL default '0',
+	content_enddate int(10) unsigned NOT NULL default '0',
+	content_class varchar(255) NOT NULL default '',
+	content_pref text NOT NULL,
+	content_order varchar(10) NOT NULL default '0',
+	content_score tinyint(3) unsigned NOT NULL default '0',
+	content_meta text NOT NULL,
+	content_layout varchar(255) NOT NULL default '',
+	PRIMARY KEY  (content_id)
+	) TYPE=MyISAM;",
+	"INSERT INTO ".MPREFIX."pcontent VALUES (1, 'content', '', '', '', '1', '', '', '', '0', '0', '0', '0', '', '".time()."', '0', '0', '', '1', '0', '', '')", 
+	"INSERT INTO ".MPREFIX."pcontent VALUES (2, 'article', '', '', '', '1', '', '', '', '0', '0', '0', '0', '', '".time()."', '0', '0', '', '2', '0', '', '')", 
+	"INSERT INTO ".MPREFIX."pcontent VALUES (3, 'review', '', '', '', '1', '', '', '', '0', '0', '0', '0', '', '".time()."', '0', '0', '', '3', '0', '', '')"
+);
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = TRUE;
+$eplug_link_name = CONTENT_PLUGIN_LAN_5;
+$eplug_link_url = $PLUGINS_DIRECTORY.'content/content.php';
+$eplug_link_icon = "";
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = CONTENT_PLUGIN_LAN_4;
+
+// upgrading ... //
+$upgrade_add_prefs = "";
+$upgrade_remove_prefs = "";
+
+$upgrade_alter_tables = array(
+"ALTER TABLE ".MPREFIX."pcontent ADD content_score TINYINT ( 3 ) UNSIGNED NOT NULL DEFAULT '0';",
+"ALTER TABLE ".MPREFIX."pcontent ADD content_meta TEXT NOT NULL;",
+"ALTER TABLE ".MPREFIX."pcontent ADD content_layout VARCHAR ( 255 ) NOT NULL DEFAULT '';",
+);
+$eplug_upgrade_done = CONTENT_PLUGIN_LAN_6;
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/search/search_advanced.php 75/e107_plugins/content/search/search_advanced.php
--- 6171/e107_plugins/content/search/search_advanced.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/search/search_advanced.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,44 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/search/search_advanced.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$advanced['cat']['type'] = 'dropdown';
+$advanced['cat']['text'] = LAN_SEARCH_63.':';
+$advanced['cat']['list'][] = array('id' => 'all', 'title' => LAN_SEARCH_51);
+
+$advanced_caption['id'] = 'cat';
+$advanced_caption['title']['all'] = CONT_SCH_LAN_2;
+
+if ($sql -> db_Select("pcontent", "content_id, content_heading", "LEFT(content_parent,1)='0'")) {
+	while ($row = $sql -> db_Fetch()) {
+		$advanced['cat']['list'][] = array('id' => $row['content_id'], 'title' => $row['content_heading']);
+		$advanced_caption['title'][$row['content_id']] = $row['content_heading'];
+	}
+}
+
+$advanced['date']['type'] = 'date';
+$advanced['date']['text'] = LAN_SEARCH_68.':';
+
+$advanced['match']['type'] = 'dropdown';
+$advanced['match']['text'] = LAN_SEARCH_52.':';
+$advanced['match']['list'][] = array('id' => 0, 'title' => LAN_SEARCH_53);
+$advanced['match']['list'][] = array('id' => 1, 'title' => LAN_SEARCH_54);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/search/search_comments.php 75/e107_plugins/content/search/search_comments.php
--- 6171/e107_plugins/content/search/search_comments.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/search/search_comments.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,21 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$comments_title = 'Content';
+$comments_type_id = 'pcontent';
+$comments_return['content'] = "p.content_id, p.content_heading, p.content_parent";
+$comments_table['content'] = "LEFT JOIN #pcontent AS p ON c.comment_type='pcontent' AND p.content_id = c.comment_item_id";
+function com_search_pcontent($row) {
+	global $con;
+	$datestamp = $con -> convert_date($row['comment_datestamp'], "long");
+	$res['link'] = e_PLUGIN."content/content.php?content.".$row['content_id'];
+	$res['pre_title'] = CONT_SCH_LAN_3.': ';
+	$res['title'] = $row['content_heading'];
+	$res['summary'] = $row['comment_comment'];
+	preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user);
+	$res['detail'] = LAN_SEARCH_7."<a href='user.php?id.".$user[1]."'>".$user[2]."</a>".LAN_SEARCH_8.$datestamp;
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/search/search_parser.php 75/e107_plugins/content/search/search_parser.php
--- 6171/e107_plugins/content/search/search_parser.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/search/search_parser.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,59 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/search/search_parser.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// advanced 
+$advanced_where = "";
+if (isset($_GET['cat']) && is_numeric($_GET['cat'])) {
+	$advanced_where .= " content_parent='".$_GET['cat']."' AND";
+}
+
+if (isset($_GET['time']) && is_numeric($_GET['time'])) {
+	$advanced_where .= " content_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
+}
+
+if (isset($_GET['match']) && $_GET['match']) {
+	$search_fields = array('content_heading');
+} else {
+	$search_fields = array('content_heading', 'content_subheading', 'content_summary', 'content_text');
+}
+
+// basic
+$return_fields = 'content_id, content_heading, content_subheading, content_summary, content_text, content_datestamp, content_parent, content_author';
+$weights = array('1.2', '0.9', '0.6', '0.6');
+$no_results = LAN_198;
+$where = "content_class IN (".USERCLASS_LIST.") AND".$advanced_where;
+$order = array('content_datestamp' => DESC);
+
+$ps = $sch -> parsesearch('pcontent', $return_fields, $search_fields, $weights, 'search_content', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_content($row) {
+	global $con;
+	$res['link'] = e_PLUGIN."content/content.php?content.".$row['content_id'];
+	$res['pre_title'] = "";
+	$res['title'] = $row['content_heading'];
+	$res['summary'] = $row['content_summary'].' '.$row['content_text'];
+	$res['detail'] = LAN_SEARCH_3.$con -> convert_date($row['content_datestamp'], "long");
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/content_manager_template.php 75/e107_plugins/content/templates/content_manager_template.php
--- 6171/e107_plugins/content/templates/content_manager_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/content_manager_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,45 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/content_manager_template.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+// ##### CONTENT CONTENTMANAGER LIST --------------------------------------------------
+if(!isset($CONTENT_CONTENTMANAGER_TABLE_START)){
+	$CONTENT_CONTENTMANAGER_TABLE_START = "
+	<table class='fborder' style='width:98%; text-align:left;' cellpadding='0' cellspacing='0'>
+	<tr>
+		<td class='forumheader3'>".CONTENT_ADMIN_ITEM_LAN_57."</td>
+		<td class='forumheader3'>".CONTENT_ADMIN_ITEM_LAN_12."</td>
+	</tr>\n";
+}
+if(!isset($CONTENT_CONTENTMANAGER_TABLE)){
+	$CONTENT_CONTENTMANAGER_TABLE = "
+	<tr>
+		<td class='forumheader3'>{CONTENT_CONTENTMANAGER_CATEGORY}</td>
+		<td class='forumheader3' style='width:10%;'>{CONTENT_CONTENTMANAGER_ICONEDIT} {CONTENT_CONTENTMANAGER_ICONNEW}</td>
+	</tr>";
+}
+if(!isset($CONTENT_CONTENTMANAGER_TABLE_END)){
+	$CONTENT_CONTENTMANAGER_TABLE_END = "
+	</table>";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/content_submit_type_template.php 75/e107_plugins/content/templates/content_submit_type_template.php
--- 6171/e107_plugins/content/templates/content_submit_type_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/content_submit_type_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,48 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/content_submit_type_template.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_SUBMIT_TYPE_TABLE_ICON']['pre'] = "";
+$sc_style['CONTENT_SUBMIT_TYPE_TABLE_ICON']['post'] = "";
+
+$sc_style['CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING']['pre'] = "";
+$sc_style['CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING']['post'] = "";
+
+// ##### CONTENT SUBMIT TYPE LIST --------------------------------------------------
+if(!isset($CONTENT_SUBMIT_TYPE_TABLE_START)){
+				$CONTENT_SUBMIT_TYPE_TABLE_START = "
+				<table class='fborder' style='width:98%; text-align:left;'>\n";
+}
+if(!isset($CONTENT_SUBMIT_TYPE_TABLE)){
+				$CONTENT_SUBMIT_TYPE_TABLE = "
+				<tr>
+					<td class='forumheader3' style='width:10%; white-space:nowrap;' rowspan='2'>{CONTENT_SUBMIT_TYPE_TABLE_ICON}</td>
+					<td class='forumheader3'>{CONTENT_SUBMIT_TYPE_TABLE_HEADING}</td>
+				</tr>
+				<tr><td class='forumheader3'>{CONTENT_SUBMIT_TYPE_TABLE_SUBHEADING}<br /></td></tr>\n";
+}
+if(!isset($CONTENT_SUBMIT_TYPE_TABLE_END)){
+				$CONTENT_SUBMIT_TYPE_TABLE_END = "
+				</table>";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/content_type_template.php 75/e107_plugins/content/templates/content_type_template.php
--- 6171/e107_plugins/content/templates/content_type_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/content_type_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,72 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/content_type_template.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_TYPE_TABLE_TOTAL']['pre'] = "";
+$sc_style['CONTENT_TYPE_TABLE_TOTAL']['post'] = " ";
+
+$sc_style['CONTENT_TYPE_TABLE_HEADING']['pre'] = "";
+$sc_style['CONTENT_TYPE_TABLE_HEADING']['post'] = "";
+
+$sc_style['CONTENT_TYPE_TABLE_SUBHEADING']['pre'] = "";
+$sc_style['CONTENT_TYPE_TABLE_SUBHEADING']['post'] = "";
+
+// ##### CONTENT TYPE LIST --------------------------------------------------
+if(!isset($CONTENT_TYPE_TABLE_START)){
+	$CONTENT_TYPE_TABLE_START = "
+	<table class='fborder' style='width:98%; text-align:left;'>\n";
+}
+if(!isset($CONTENT_TYPE_TABLE)){
+	$CONTENT_TYPE_TABLE = "
+	<tr>
+		<td class='forumheader3' style='width:5%; white-space:nowrap; padding-bottom:5px;' rowspan='2'>{CONTENT_TYPE_TABLE_ICON}</td>
+		<td class='fcaption'>{CONTENT_TYPE_TABLE_HEADING}</td>
+		<td class='forumheader' style='width:5%; white-space:nowrap; text-align:right;'>{CONTENT_TYPE_TABLE_TOTAL} {CONTENT_TYPE_TABLE_TOTAL_LAN}</td>
+	</tr>
+	<tr><td class='forumheader2' colspan='2'>{CONTENT_TYPE_TABLE_SUBHEADING}<br /></td></tr>\n";
+}
+if(!isset($CONTENT_TYPE_TABLE_SUBMIT)){
+	$CONTENT_TYPE_TABLE_SUBMIT = "
+	<tr>
+		<td class='forumheader3' style='width:5%; white-space:nowrap; padding-bottom:5px;' rowspan='2'>{CONTENT_TYPE_TABLE_SUBMIT_ICON}</td>
+		<td class='fcaption' colspan='2'>{CONTENT_TYPE_TABLE_SUBMIT_HEADING}</td>
+	</tr>
+	<tr><td class='forumheader2' colspan='2'>{CONTENT_TYPE_TABLE_SUBMIT_SUBHEADING}</td></tr>\n";
+}
+if(!isset($CONTENT_TYPE_TABLE_MANAGER)){
+	$CONTENT_TYPE_TABLE_MANAGER = "
+	<tr>
+		<td class='forumheader3' style='width:5%; white-space:nowrap; padding-bottom:5px;' rowspan='2'>{CONTENT_TYPE_TABLE_MANAGER_ICON}</td>
+		<td class='fcaption' colspan='2'>{CONTENT_TYPE_TABLE_MANAGER_HEADING}</td>
+	</tr>
+	<tr><td class='forumheader2' colspan='2'>{CONTENT_TYPE_TABLE_MANAGER_SUBHEADING}</td></tr>\n";
+}
+if(!isset($CONTENT_TYPE_TABLE_LINE)){
+	$CONTENT_TYPE_TABLE_LINE = "";
+}
+if(!isset($CONTENT_TYPE_TABLE_END)){
+	$CONTENT_TYPE_TABLE_END = "
+	</table>";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_archive_template.php 75/e107_plugins/content/templates/default/content_archive_template.php
--- 6171/e107_plugins/content/templates/default/content_archive_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_archive_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,52 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_archive_template.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_ARCHIVE_TABLE_AUTHOR']['pre'] = "<tr><td class='forumheader3' colspan='2' style='white-space:nowrap; text-align:left;'>".CONTENT_LAN_11." ";
+$sc_style['CONTENT_ARCHIVE_TABLE_AUTHOR']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_ARCHIVE_TABLE_LETTERS']['pre'] = "<tr><td class='forumheader3' colspan='2'>";
+$sc_style['CONTENT_ARCHIVE_TABLE_LETTERS']['post'] = "</td></tr>";
+
+// ##### CONTENT ARCHIVE --------------------------------------------------
+if(!isset($CONTENT_ARCHIVE_TABLE_START)){
+	$CONTENT_ARCHIVE_TABLE_START = "
+	<table class='fborder'>
+	{CONTENT_ARCHIVE_TABLE_LETTERS}
+	";
+}
+if(!isset($CONTENT_ARCHIVE_TABLE)){
+	$CONTENT_ARCHIVE_TABLE = "				
+	<tr>
+		<td class='fcaption'>{CONTENT_ARCHIVE_TABLE_HEADING}</td>
+		<td class='fcaption' style='width:5%; white-space:nowrap; text-align:right;'>{CONTENT_ARCHIVE_TABLE_DATE}</td>
+	</tr>
+	{CONTENT_ARCHIVE_TABLE_AUTHOR}
+	\n";
+}
+if(!isset($CONTENT_ARCHIVE_TABLE_END)){
+	$CONTENT_ARCHIVE_TABLE_END = "
+	</table>";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_author_template.php 75/e107_plugins/content/templates/default/content_author_template.php
--- 6171/e107_plugins/content/templates/default/content_author_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_author_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,48 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_author_template.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_AUTHOR_TABLE_LASTITEM']['pre'] = "<tr><td class='forumheader3'>".CONTENT_LAN_55." ";
+$sc_style['CONTENT_AUTHOR_TABLE_LASTITEM']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_AUTHOR_TABLE_TOTAL']['pre'] = "(";
+$sc_style['CONTENT_AUTHOR_TABLE_TOTAL']['post'] = ")";
+
+// ##### CONTENT AUTHOR -------------------------------------------------------
+if(!isset($CONTENT_AUTHOR_TABLE_START)){
+	$CONTENT_AUTHOR_TABLE_START = "
+	<table class='fborder' style='width:98%; text-align:left;'>\n";
+}
+if(!isset($CONTENT_AUTHOR_TABLE)){
+	$CONTENT_AUTHOR_TABLE = "
+	<tr>
+		<td class='fcaption'>{CONTENT_AUTHOR_TABLE_ICON} {CONTENT_AUTHOR_TABLE_NAME} {CONTENT_AUTHOR_TABLE_TOTAL}</td>
+	</tr>
+	{CONTENT_AUTHOR_TABLE_LASTITEM}
+	";
+}
+if(!isset($CONTENT_AUTHOR_TABLE_END)){
+	$CONTENT_AUTHOR_TABLE_END = "
+	</table>\n";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_cat_template.php 75/e107_plugins/content/templates/default/content_cat_template.php
--- 6171/e107_plugins/content/templates/default/content_cat_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_cat_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,151 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_cat_template.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_CAT_TABLE_ICON']['pre'] = "<td class='forumheader3' rowspan='5' style='width:5%; white-space:nowrap; padding-right:5px;'>";
+$sc_style['CONTENT_CAT_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_CAT_TABLE_AUTHORDETAILS']['pre'] = " ";
+$sc_style['CONTENT_CAT_TABLE_AUTHORDETAILS']['post'] = " ";
+
+$sc_style['CONTENT_CAT_TABLE_SUBHEADING']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_CAT_TABLE_SUBHEADING']['post'] = "<br /></td></tr>";
+
+$sc_style['CONTENT_CAT_TABLE_TEXT']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_CAT_TABLE_TEXT']['post'] = "<br /></td></tr>";
+
+$sc_style['CONTENT_CAT_TABLE_RATING']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_CAT_TABLE_RATING']['post'] = "<br /></td></tr>";
+
+$sc_style['CONTENT_CAT_TABLE_AMOUNT']['pre'] = "(";
+$sc_style['CONTENT_CAT_TABLE_AMOUNT']['post'] = ")";
+
+$sc_style['CONTENT_CAT_TABLE_INFO_PRE']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_CAT_TABLE_INFO_PRE']['post'] = "";
+
+$sc_style['CONTENT_CAT_TABLE_INFO_POST']['pre'] = "";
+$sc_style['CONTENT_CAT_TABLE_INFO_POST']['post'] = "</td></tr>";
+
+// ##### CONTENT CAT ----------------------------------------------------------
+if(!isset($CONTENT_CAT_TABLE_START)){
+	$CONTENT_CAT_TABLE_START = "";
+}
+if(!isset($CONTENT_CAT_TABLE)){
+	$CONTENT_CAT_TABLE = "
+	<table class='fborder' style='width:98%; text-align:left; margin-bottom:5px;'>
+	<tr>
+		{CONTENT_CAT_TABLE_ICON}
+		<td class='fcaption' >{CONTENT_CAT_TABLE_HEADING} {CONTENT_CAT_TABLE_AMOUNT}</td>
+	</tr>
+
+	{CONTENT_CAT_TABLE_INFO_PRE}
+		{CONTENT_CAT_TABLE_DATE} {CONTENT_CAT_TABLE_AUTHORDETAILS} {CONTENT_CAT_TABLE_EPICONS} {CONTENT_CAT_TABLE_COMMENT}
+	{CONTENT_CAT_TABLE_INFO_POST}
+
+	{CONTENT_CAT_TABLE_SUBHEADING}
+	{CONTENT_CAT_TABLE_TEXT}
+	{CONTENT_CAT_TABLE_RATING}
+	</table>\n";
+
+}
+if(!isset($CONTENT_CAT_TABLE_END)){
+	$CONTENT_CAT_TABLE_END = "";
+}
+// ##### ----------------------------------------------------------------------
+
+
+
+$sc_style['CONTENT_CAT_LIST_TABLE_ICON']['pre'] = "<td class='forumheader3' style='width:5%; white-space:nowrap; padding-right:5px;' rowspan='5'>";
+$sc_style['CONTENT_CAT_LIST_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_CAT_LIST_TABLE_SUBHEADING']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_CAT_LIST_TABLE_SUBHEADING']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_CAT_LIST_TABLE_AUTHORDETAILS']['pre'] = " / ";
+$sc_style['CONTENT_CAT_LIST_TABLE_AUTHORDETAILS']['post'] = "";
+
+$sc_style['CONTENT_CAT_LIST_TABLE_RATING']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_CAT_LIST_TABLE_RATING']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_CAT_LIST_TABLE_TEXT']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_CAT_LIST_TABLE_TEXT']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_CAT_LIST_TABLE_AMOUNT']['pre'] = "(";
+$sc_style['CONTENT_CAT_LIST_TABLE_AMOUNT']['post'] = ")";
+
+$sc_style['CONTENT_CAT_LIST_TABLE_INFO_PRE']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_CAT_LIST_TABLE_INFO_PRE']['post'] = "";
+
+$sc_style['CONTENT_CAT_LIST_TABLE_INFO_POST']['pre'] = "";
+$sc_style['CONTENT_CAT_LIST_TABLE_INFO_POST']['post'] = "</td></tr>";
+
+// ##### CONTENT CAT_LIST -----------------------------------------------------
+if(!isset($CONTENT_CAT_LIST_TABLE)){
+	$CONTENT_CAT_LIST_TABLE = "
+	<table class='fborder' style='width:98%; text-align:left; margin-bottom:10px;'>
+	<tr>
+		{CONTENT_CAT_LIST_TABLE_ICON}
+		<td class='fcaption'>{CONTENT_CAT_LIST_TABLE_HEADING} {CONTENT_CAT_LIST_TABLE_AMOUNT}</td>
+	</tr>
+	{CONTENT_CAT_LIST_TABLE_SUBHEADING}
+	
+	{CONTENT_CAT_LIST_TABLE_INFO_PRE}
+		{CONTENT_CAT_LIST_TABLE_DATE} {CONTENT_CAT_LIST_TABLE_AUTHORDETAILS} {CONTENT_CAT_LIST_TABLE_EPICONS} {CONTENT_CAT_LIST_TABLE_COMMENT}
+	{CONTENT_CAT_LIST_TABLE_INFO_POST}
+
+	{CONTENT_CAT_LIST_TABLE_RATING}
+	{CONTENT_CAT_LIST_TABLE_TEXT}
+	</table>\n";
+}
+// ##### ----------------------------------------------------------------------
+
+
+
+$sc_style['CONTENT_CAT_LISTSUB_TABLE_ICON']['pre'] = "<td class='forumheader3' style='width:2%; white-space:nowrap; padding-right:5px; ' rowspan='2'>";
+$sc_style['CONTENT_CAT_LISTSUB_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_CAT_LISTSUB_TABLE_SUBHEADING']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_CAT_LISTSUB_TABLE_SUBHEADING']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_CAT_LISTSUB_TABLE_AMOUNT']['pre'] = "(";
+$sc_style['CONTENT_CAT_LISTSUB_TABLE_AMOUNT']['post'] = ")";
+
+// ##### CONTENT CAT_LIST SUB -------------------------------------------------
+if(!isset($CONTENT_CAT_LISTSUB_TABLE_START)){
+	$CONTENT_CAT_LISTSUB_TABLE_START = "";
+}
+if(!isset($CONTENT_CAT_LISTSUB_TABLE)){
+	$CONTENT_CAT_LISTSUB_TABLE = "
+	<table class='fborder' style='width:98%; text-align:left; margin-bottom:5px;'>
+	<tr>
+		{CONTENT_CAT_LISTSUB_TABLE_ICON}
+		<td class='fcaption'>{CONTENT_CAT_LISTSUB_TABLE_HEADING} {CONTENT_CAT_LISTSUB_TABLE_AMOUNT}</td>
+	</tr>
+	{CONTENT_CAT_LISTSUB_TABLE_SUBHEADING}
+	</table>\n";
+}
+if(!isset($CONTENT_CAT_LISTSUB_TABLE_END)){
+	$CONTENT_CAT_LISTSUB_TABLE_END = "<br />";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_content_template_bigtext.php 75/e107_plugins/content/templates/default/content_content_template_bigtext.php
--- 6171/e107_plugins/content/templates/default/content_content_template_bigtext.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_content_template_bigtext.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,122 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_content_template_bigtext.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### CONTENT CONTENT ------------------------------------------------------
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_CONTENT_TABLE_REFER']['pre'] = "<br />".CONTENT_LAN_44." ";
+$sc_style['CONTENT_CONTENT_TABLE_REFER']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_COMMENT']['pre'] = "<br />".CONTENT_LAN_57." ";
+$sc_style['CONTENT_CONTENT_TABLE_COMMENT']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_SCORE']['pre'] = "<br />".CONTENT_LAN_45." ";
+$sc_style['CONTENT_CONTENT_TABLE_SCORE']['post'] = "/100";
+
+$sc_style['CONTENT_CONTENT_TABLE_RATING']['pre'] = "<br />";
+$sc_style['CONTENT_CONTENT_TABLE_RATING']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_AUTHORDETAILS']['pre'] = "<br />".CONTENT_LAN_11." ";
+$sc_style['CONTENT_CONTENT_TABLE_AUTHORDETAILS']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_PAGENAMES']['pre'] = "<br /><div>".CONTENT_LAN_46."<br />";
+$sc_style['CONTENT_CONTENT_TABLE_PAGENAMES']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_CUSTOM_TAGS']['pre'] = "<br /><br />";
+$sc_style['CONTENT_CONTENT_TABLE_CUSTOM_TAGS']['post'] = "<br /><br />";
+
+$sc_style['CONTENT_CONTENT_TABLE_SUMMARY']['pre'] = "<div>";
+$sc_style['CONTENT_CONTENT_TABLE_SUMMARY']['post'] = "<br /><br /></div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_TEXT']['pre'] = "<div>";
+$sc_style['CONTENT_CONTENT_TABLE_TEXT']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_IMAGES']['pre'] = "<div style='float:left; padding-right:10px;'>";
+$sc_style['CONTENT_CONTENT_TABLE_IMAGES']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_SUBHEADING']['pre'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_SUBHEADING']['post'] = "<br />";
+
+$sc_style['CONTENT_CONTENT_TABLE_FILE']['pre'] = "<br />";
+$sc_style['CONTENT_CONTENT_TABLE_FILE']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_DATE']['pre'] = CONTENT_LAN_10." ";
+$sc_style['CONTENT_CONTENT_TABLE_DATE']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_PARENT']['pre'] = "<br />".CONTENT_LAN_9." ";
+$sc_style['CONTENT_CONTENT_TABLE_PARENT']['post'] = "";
+
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['pre'] = "<div style='clear:both;'><div style='float:left;'>";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['post'] = "";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['pre'] = "";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['post'] = "</div></div>";
+
+//$sc_style['CONTENT_CONTENT_TABLE_ICON']['pre'] = "<div style='float:left; padding-right:10px;'>";
+//$sc_style['CONTENT_CONTENT_TABLE_ICON']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_ICON']['pre'] = "<td style='width:10%; white-space:nowrap; vertical-align:top; padding-right:10px;'>";
+$sc_style['CONTENT_CONTENT_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['pre'] = "<table cellpadding='0' cellspacing='0' style='width:100%; margin-bottom:20px;'><tr>";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['post'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['pre'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['post'] = "</tr></table>";
+
+$CONTENT_CONTENT_TABLE = "<table class='fborder' cellpadding='0' cellspacing='0' style='font-size:16px;'><tr><td>
+<div style='clear:both;'>
+
+	{CONTENT_CONTENT_TABLE_INFO_PRE}
+		{CONTENT_CONTENT_TABLE_ICON}
+		<td style='vertical-align:top;'>
+		{CONTENT_CONTENT_TABLE_SUBHEADING}
+		{CONTENT_CONTENT_TABLE_DATE} {CONTENT_CONTENT_TABLE_AUTHORDETAILS} {CONTENT_CONTENT_TABLE_EPICONS} {CONTENT_CONTENT_TABLE_EDITICON} {CONTENT_CONTENT_TABLE_PARENT} {CONTENT_CONTENT_TABLE_COMMENT} {CONTENT_CONTENT_TABLE_SCORE} {CONTENT_CONTENT_TABLE_REFER}
+		{CONTENT_CONTENT_TABLE_RATING}
+		{CONTENT_CONTENT_TABLE_FILE}
+		</td>
+	{CONTENT_CONTENT_TABLE_INFO_POST}
+	<div style='clear:both;'><br /></div>
+	<table cellpadding='0' cellspacing='0' style='width:100%;'><tr><td>
+		{CONTENT_CONTENT_TABLE_IMAGES}
+		{CONTENT_CONTENT_TABLE_SUMMARY}
+		{CONTENT_CONTENT_TABLE_TEXT}
+		{CONTENT_CONTENT_TABLE_CUSTOM_TAGS}
+		{CONTENT_CONTENT_TABLE_PAGENAMES}
+	</td></tr></table>
+</div>
+</td></tr></table>\n";
+
+// ##### ----------------------------------------------------------------------
+
+$CONTENT_CONTENT_TABLE_CUSTOM_START = "<table style='width:100%;margin-left:0;padding-left:0;' cellspacing='0' cellpadding='0' >";
+
+$CONTENT_CONTENT_TABLE_CUSTOM = "
+<tr>
+	<td style='width:25%;white-space:nowrap; vertical-align:top; line-height:150%;'>
+		{CONTENT_CONTENT_TABLE_CUSTOM_KEY}
+	</td>
+	<td style='width:90%; line-height:150%;'>
+		{CONTENT_CONTENT_TABLE_CUSTOM_VALUE}
+	</td>
+</tr>";
+
+$CONTENT_CONTENT_TABLE_CUSTOM_END = "</table>";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_content_template_blackonwhite.php 75/e107_plugins/content/templates/default/content_content_template_blackonwhite.php
--- 6171/e107_plugins/content/templates/default/content_content_template_blackonwhite.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_content_template_blackonwhite.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,122 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_content_template_blackonwhite.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### CONTENT CONTENT ------------------------------------------------------
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_CONTENT_TABLE_REFER']['pre'] = "<br />".CONTENT_LAN_44." ";
+$sc_style['CONTENT_CONTENT_TABLE_REFER']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_COMMENT']['pre'] = "<br />".CONTENT_LAN_57." ";
+$sc_style['CONTENT_CONTENT_TABLE_COMMENT']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_SCORE']['pre'] = "<br />".CONTENT_LAN_45." ";
+$sc_style['CONTENT_CONTENT_TABLE_SCORE']['post'] = "/100";
+
+$sc_style['CONTENT_CONTENT_TABLE_RATING']['pre'] = "<br />";
+$sc_style['CONTENT_CONTENT_TABLE_RATING']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_AUTHORDETAILS']['pre'] = "<br />".CONTENT_LAN_11." ";
+$sc_style['CONTENT_CONTENT_TABLE_AUTHORDETAILS']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_PAGENAMES']['pre'] = "<br /><div>".CONTENT_LAN_46."<br />";
+$sc_style['CONTENT_CONTENT_TABLE_PAGENAMES']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_CUSTOM_TAGS']['pre'] = "<br /><br />";
+$sc_style['CONTENT_CONTENT_TABLE_CUSTOM_TAGS']['post'] = "<br /><br />";
+
+$sc_style['CONTENT_CONTENT_TABLE_SUMMARY']['pre'] = "<div>";
+$sc_style['CONTENT_CONTENT_TABLE_SUMMARY']['post'] = "<br /><br /></div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_TEXT']['pre'] = "<div>";
+$sc_style['CONTENT_CONTENT_TABLE_TEXT']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_IMAGES']['pre'] = "<div style='float:left; padding-right:10px;'>";
+$sc_style['CONTENT_CONTENT_TABLE_IMAGES']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_SUBHEADING']['pre'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_SUBHEADING']['post'] = "<br />";
+
+$sc_style['CONTENT_CONTENT_TABLE_FILE']['pre'] = "<br />";
+$sc_style['CONTENT_CONTENT_TABLE_FILE']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_DATE']['pre'] = CONTENT_LAN_10." ";
+$sc_style['CONTENT_CONTENT_TABLE_DATE']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_PARENT']['pre'] = "<br />".CONTENT_LAN_9." ";
+$sc_style['CONTENT_CONTENT_TABLE_PARENT']['post'] = "";
+
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['pre'] = "<div style='clear:both;'><div style='float:left;'>";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['post'] = "";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['pre'] = "";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['post'] = "</div></div>";
+
+//$sc_style['CONTENT_CONTENT_TABLE_ICON']['pre'] = "<div style='float:left; padding-right:10px;'>";
+//$sc_style['CONTENT_CONTENT_TABLE_ICON']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_ICON']['pre'] = "<td style='width:10%; white-space:nowrap; vertical-align:top; padding-right:10px;'>";
+$sc_style['CONTENT_CONTENT_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['pre'] = "<table cellpadding='0' cellspacing='0' style='width:100%; margin-bottom:20px;'><tr>";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['post'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['pre'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['post'] = "</tr></table>";
+
+$CONTENT_CONTENT_TABLE = "<table class='fborder' cellpadding='0' cellspacing='0' style='background-color:#FFF; color:#000;'><tr><td>
+<div style='clear:both;'>
+
+	{CONTENT_CONTENT_TABLE_INFO_PRE}
+		{CONTENT_CONTENT_TABLE_ICON}
+		<td style='vertical-align:top;'>
+		{CONTENT_CONTENT_TABLE_SUBHEADING}
+		{CONTENT_CONTENT_TABLE_DATE} {CONTENT_CONTENT_TABLE_AUTHORDETAILS} {CONTENT_CONTENT_TABLE_EPICONS} {CONTENT_CONTENT_TABLE_EDITICON} {CONTENT_CONTENT_TABLE_PARENT} {CONTENT_CONTENT_TABLE_COMMENT} {CONTENT_CONTENT_TABLE_SCORE} {CONTENT_CONTENT_TABLE_REFER}
+		{CONTENT_CONTENT_TABLE_RATING}
+		{CONTENT_CONTENT_TABLE_FILE}
+		</td>
+	{CONTENT_CONTENT_TABLE_INFO_POST}
+	<div style='clear:both;'><br /></div>
+	<table cellpadding='0' cellspacing='0' style='width:100%;'><tr><td>
+		{CONTENT_CONTENT_TABLE_IMAGES}
+		{CONTENT_CONTENT_TABLE_SUMMARY}
+		{CONTENT_CONTENT_TABLE_TEXT}
+		{CONTENT_CONTENT_TABLE_CUSTOM_TAGS}
+		{CONTENT_CONTENT_TABLE_PAGENAMES}
+	</td></tr></table>
+</div>
+</td></tr></table>\n";
+
+// ##### ----------------------------------------------------------------------
+
+$CONTENT_CONTENT_TABLE_CUSTOM_START = "<table style='width:100%;margin-left:0;padding-left:0;' cellspacing='0' cellpadding='0' >";
+
+$CONTENT_CONTENT_TABLE_CUSTOM = "
+<tr>
+	<td style='width:25%;white-space:nowrap; vertical-align:top; line-height:150%;'>
+		{CONTENT_CONTENT_TABLE_CUSTOM_KEY}
+	</td>
+	<td style='width:90%; line-height:150%;'>
+		{CONTENT_CONTENT_TABLE_CUSTOM_VALUE}
+	</td>
+</tr>";
+
+$CONTENT_CONTENT_TABLE_CUSTOM_END = "</table>";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_content_template.php 75/e107_plugins/content/templates/default/content_content_template.php
--- 6171/e107_plugins/content/templates/default/content_content_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_content_template.php	2006-01-13 14:03:44.000000000 -0600
@@ -0,0 +1,126 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_content_template.php,v $
+|     $Revision: 1.23 $
+|     $Date: 2006/01/13 20:03:44 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### CONTENT CONTENT ------------------------------------------------------
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_CONTENT_TABLE_REFER']['pre'] = "<br />".CONTENT_LAN_44." ";
+$sc_style['CONTENT_CONTENT_TABLE_REFER']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_COMMENT']['pre'] = "<br />".CONTENT_LAN_57." ";
+$sc_style['CONTENT_CONTENT_TABLE_COMMENT']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_SCORE']['pre'] = "<br />".CONTENT_LAN_45." ";
+$sc_style['CONTENT_CONTENT_TABLE_SCORE']['post'] = "/100";
+
+$sc_style['CONTENT_CONTENT_TABLE_RATING']['pre'] = "<br />";
+$sc_style['CONTENT_CONTENT_TABLE_RATING']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_AUTHORDETAILS']['pre'] = "<br />".CONTENT_LAN_11." ";
+$sc_style['CONTENT_CONTENT_TABLE_AUTHORDETAILS']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_PAGENAMES']['pre'] = "<br /><div>".CONTENT_LAN_46."<br />";
+$sc_style['CONTENT_CONTENT_TABLE_PAGENAMES']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_CUSTOM_TAGS']['pre'] = "<br /><br />";
+$sc_style['CONTENT_CONTENT_TABLE_CUSTOM_TAGS']['post'] = "<br /><br />";
+
+$sc_style['CONTENT_CONTENT_TABLE_SUMMARY']['pre'] = "<div>";
+$sc_style['CONTENT_CONTENT_TABLE_SUMMARY']['post'] = "<br /><br /></div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_TEXT']['pre'] = "<div>";
+$sc_style['CONTENT_CONTENT_TABLE_TEXT']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_IMAGES']['pre'] = "<div style='float:left; padding-right:10px;'>";
+$sc_style['CONTENT_CONTENT_TABLE_IMAGES']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_SUBHEADING']['pre'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_SUBHEADING']['post'] = "<br />";
+
+$sc_style['CONTENT_CONTENT_TABLE_FILE']['pre'] = "<br />";
+$sc_style['CONTENT_CONTENT_TABLE_FILE']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_DATE']['pre'] = CONTENT_LAN_10." ";
+$sc_style['CONTENT_CONTENT_TABLE_DATE']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_PARENT']['pre'] = "<br />".CONTENT_LAN_9." ";
+$sc_style['CONTENT_CONTENT_TABLE_PARENT']['post'] = "";
+
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['pre'] = "<div style='clear:both;'><div style='float:left;'>";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['post'] = "";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['pre'] = "";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['post'] = "</div></div>";
+
+//$sc_style['CONTENT_CONTENT_TABLE_ICON']['pre'] = "<div style='float:left; padding-right:10px;'>";
+//$sc_style['CONTENT_CONTENT_TABLE_ICON']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_ICON']['pre'] = "<td style='width:10%; white-space:nowrap; vertical-align:top; padding-right:10px;'>";
+$sc_style['CONTENT_CONTENT_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['pre'] = "<table cellpadding='0' cellspacing='0' style='width:100%; margin-bottom:10px;'><tr>";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['post'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['pre'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['post'] = "</tr></table><div style='clear:both;'><br /></div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA']['pre'] = "<td style='vertical-align:top;' class='forumheader3'>";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA']['post'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA']['pre'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA']['post'] = "</td>";
+
+
+$CONTENT_CONTENT_TABLE = "<table class='fborder' cellpadding='0' cellspacing='0' style='margin-bottom:20px;'><tr><td>
+<div style='clear:both;'>
+	{CONTENT_CONTENT_TABLE_INFO_PRE}
+		{CONTENT_CONTENT_TABLE_ICON}
+		{CONTENT_CONTENT_TABLE_INFO_PRE_HEADDATA}
+			{CONTENT_CONTENT_TABLE_SUBHEADING}
+			{CONTENT_CONTENT_TABLE_DATE} {CONTENT_CONTENT_TABLE_AUTHORDETAILS} {CONTENT_CONTENT_TABLE_EPICONS} {CONTENT_CONTENT_TABLE_EDITICON} {CONTENT_CONTENT_TABLE_PARENT} {CONTENT_CONTENT_TABLE_COMMENT} {CONTENT_CONTENT_TABLE_SCORE} {CONTENT_CONTENT_TABLE_REFER}
+			{CONTENT_CONTENT_TABLE_RATING}
+			{CONTENT_CONTENT_TABLE_FILE}
+		{CONTENT_CONTENT_TABLE_INFO_POST_HEADDATA}
+	{CONTENT_CONTENT_TABLE_INFO_POST}
+	<table cellpadding='0' cellspacing='0' style='width:100%;'><tr><td class='forumheader3'>
+		{CONTENT_CONTENT_TABLE_IMAGES}
+		{CONTENT_CONTENT_TABLE_SUMMARY}
+		{CONTENT_CONTENT_TABLE_TEXT}
+		{CONTENT_CONTENT_TABLE_CUSTOM_TAGS}
+		{CONTENT_CONTENT_TABLE_PAGENAMES}
+	</td></tr></table>
+</div>
+</td></tr></table>\n";
+
+// ##### ----------------------------------------------------------------------
+
+$CONTENT_CONTENT_TABLE_CUSTOM_START = "<table style='width:100%;margin-left:0;padding-left:0;' cellspacing='0' cellpadding='0' >";
+
+$CONTENT_CONTENT_TABLE_CUSTOM = "
+<tr>
+	<td style='width:25%;white-space:nowrap; vertical-align:top; line-height:150%;'>
+		{CONTENT_CONTENT_TABLE_CUSTOM_KEY}
+	</td>
+	<td style='width:90%; line-height:150%;'>
+		{CONTENT_CONTENT_TABLE_CUSTOM_VALUE}
+	</td>
+</tr>";
+
+$CONTENT_CONTENT_TABLE_CUSTOM_END = "</table>";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_content_template_whiteonblack.php 75/e107_plugins/content/templates/default/content_content_template_whiteonblack.php
--- 6171/e107_plugins/content/templates/default/content_content_template_whiteonblack.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_content_template_whiteonblack.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,122 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_content_template_whiteonblack.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### CONTENT CONTENT ------------------------------------------------------
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_CONTENT_TABLE_REFER']['pre'] = "<br />".CONTENT_LAN_44." ";
+$sc_style['CONTENT_CONTENT_TABLE_REFER']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_COMMENT']['pre'] = "<br />".CONTENT_LAN_57." ";
+$sc_style['CONTENT_CONTENT_TABLE_COMMENT']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_SCORE']['pre'] = "<br />".CONTENT_LAN_45." ";
+$sc_style['CONTENT_CONTENT_TABLE_SCORE']['post'] = "/100";
+
+$sc_style['CONTENT_CONTENT_TABLE_RATING']['pre'] = "<br />";
+$sc_style['CONTENT_CONTENT_TABLE_RATING']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_AUTHORDETAILS']['pre'] = "<br />".CONTENT_LAN_11." ";
+$sc_style['CONTENT_CONTENT_TABLE_AUTHORDETAILS']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_PAGENAMES']['pre'] = "<br /><div>".CONTENT_LAN_46."<br />";
+$sc_style['CONTENT_CONTENT_TABLE_PAGENAMES']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_CUSTOM_TAGS']['pre'] = "<br /><br />";
+$sc_style['CONTENT_CONTENT_TABLE_CUSTOM_TAGS']['post'] = "<br /><br />";
+
+$sc_style['CONTENT_CONTENT_TABLE_SUMMARY']['pre'] = "<div>";
+$sc_style['CONTENT_CONTENT_TABLE_SUMMARY']['post'] = "<br /><br /></div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_TEXT']['pre'] = "<div>";
+$sc_style['CONTENT_CONTENT_TABLE_TEXT']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_IMAGES']['pre'] = "<div style='float:left; padding-right:10px;'>";
+$sc_style['CONTENT_CONTENT_TABLE_IMAGES']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_SUBHEADING']['pre'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_SUBHEADING']['post'] = "<br />";
+
+$sc_style['CONTENT_CONTENT_TABLE_FILE']['pre'] = "<br />";
+$sc_style['CONTENT_CONTENT_TABLE_FILE']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_DATE']['pre'] = CONTENT_LAN_10." ";
+$sc_style['CONTENT_CONTENT_TABLE_DATE']['post'] = "";
+
+$sc_style['CONTENT_CONTENT_TABLE_PARENT']['pre'] = "<br />".CONTENT_LAN_9." ";
+$sc_style['CONTENT_CONTENT_TABLE_PARENT']['post'] = "";
+
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['pre'] = "<div style='clear:both;'><div style='float:left;'>";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['post'] = "";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['pre'] = "";
+//$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['post'] = "</div></div>";
+
+//$sc_style['CONTENT_CONTENT_TABLE_ICON']['pre'] = "<div style='float:left; padding-right:10px;'>";
+//$sc_style['CONTENT_CONTENT_TABLE_ICON']['post'] = "</div>";
+
+$sc_style['CONTENT_CONTENT_TABLE_ICON']['pre'] = "<td style='width:10%; white-space:nowrap; vertical-align:top; padding-right:10px;'>";
+$sc_style['CONTENT_CONTENT_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['pre'] = "<table cellpadding='0' cellspacing='0' style='width:100%; margin-bottom:20px;'><tr>";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_PRE']['post'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['pre'] = "";
+$sc_style['CONTENT_CONTENT_TABLE_INFO_POST']['post'] = "</tr></table>";
+
+$CONTENT_CONTENT_TABLE = "<table class='fborder' cellpadding='0' cellspacing='0' style='width:100%; background-color:#000; color:#FFF;'><tr><td>
+<div style='clear:both;'>
+
+	{CONTENT_CONTENT_TABLE_INFO_PRE}
+		{CONTENT_CONTENT_TABLE_ICON}
+		<td style='vertical-align:top;'>
+		{CONTENT_CONTENT_TABLE_SUBHEADING}
+		{CONTENT_CONTENT_TABLE_DATE} {CONTENT_CONTENT_TABLE_AUTHORDETAILS} {CONTENT_CONTENT_TABLE_EPICONS} {CONTENT_CONTENT_TABLE_EDITICON} {CONTENT_CONTENT_TABLE_PARENT} {CONTENT_CONTENT_TABLE_COMMENT} {CONTENT_CONTENT_TABLE_SCORE} {CONTENT_CONTENT_TABLE_REFER}
+		{CONTENT_CONTENT_TABLE_RATING}
+		{CONTENT_CONTENT_TABLE_FILE}
+		</td>
+	{CONTENT_CONTENT_TABLE_INFO_POST}
+	<div style='clear:both;'><br /></div>
+	<table cellpadding='0' cellspacing='0' style='width:100%;'><tr><td>
+		{CONTENT_CONTENT_TABLE_IMAGES}
+		{CONTENT_CONTENT_TABLE_SUMMARY}
+		{CONTENT_CONTENT_TABLE_TEXT}
+		{CONTENT_CONTENT_TABLE_CUSTOM_TAGS}
+		{CONTENT_CONTENT_TABLE_PAGENAMES}
+	</td></tr></table>
+</div>
+</td></tr></table>\n";
+
+// ##### ----------------------------------------------------------------------
+
+$CONTENT_CONTENT_TABLE_CUSTOM_START = "<table style='width:100%;margin-left:0;padding-left:0;' cellspacing='0' cellpadding='0' >";
+
+$CONTENT_CONTENT_TABLE_CUSTOM = "
+<tr>
+	<td style='width:25%;white-space:nowrap; vertical-align:top; line-height:150%;'>
+		{CONTENT_CONTENT_TABLE_CUSTOM_KEY}
+	</td>
+	<td style='width:90%; line-height:150%;'>
+		{CONTENT_CONTENT_TABLE_CUSTOM_VALUE}
+	</td>
+</tr>";
+
+$CONTENT_CONTENT_TABLE_CUSTOM_END = "</table>";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_recent_template.php 75/e107_plugins/content/templates/default/content_recent_template.php
--- 6171/e107_plugins/content/templates/default/content_recent_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_recent_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,86 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_recent_template.php,v $
+|     $Revision: 1.19 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### CONTENT RECENT LIST --------------------------------------------------
+
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_RECENT_TABLE_ICON']['pre'] = "<td class='forumheader3' rowspan='7' style='vertical-align:top; width:10%; white-space:nowrap; padding-right:10px;'>";
+$sc_style['CONTENT_RECENT_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_RECENT_TABLE_DATE']['pre'] = CONTENT_LAN_10." ";
+$sc_style['CONTENT_RECENT_TABLE_DATE']['post'] = "";
+
+$sc_style['CONTENT_RECENT_TABLE_PARENT']['pre'] = CONTENT_LAN_9." ";
+$sc_style['CONTENT_RECENT_TABLE_PARENT']['post'] = "";
+
+$sc_style['CONTENT_RECENT_TABLE_REFER']['pre'] = " (".CONTENT_LAN_44;
+$sc_style['CONTENT_RECENT_TABLE_REFER']['post'] = ")";
+
+$sc_style['CONTENT_RECENT_TABLE_AUTHORDETAILS']['pre'] = CONTENT_LAN_11." ";
+$sc_style['CONTENT_RECENT_TABLE_AUTHORDETAILS']['post'] = "";
+
+$sc_style['CONTENT_RECENT_TABLE_SUBHEADING']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_RECENT_TABLE_SUBHEADING']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_RECENT_TABLE_SUMMARY']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_RECENT_TABLE_SUMMARY']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_RECENT_TABLE_TEXT']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_RECENT_TABLE_TEXT']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_RECENT_TABLE_RATING']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_RECENT_TABLE_RATING']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_RECENT_TABLE_INFOPRE']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_RECENT_TABLE_INFOPRE']['post'] = "";
+
+$sc_style['CONTENT_RECENT_TABLE_INFOPOST']['pre'] = "";
+$sc_style['CONTENT_RECENT_TABLE_INFOPOST']['post'] = "</td></tr>";
+
+if(!isset($CONTENT_RECENT_TABLE_START)){
+	$CONTENT_RECENT_TABLE_START = "";
+}
+if(!isset($CONTENT_RECENT_TABLE)){
+	$CONTENT_RECENT_TABLE = "
+	<table class='fborder' style='width:98%; text-align:left;margin-bottom:5px;'>
+		<tr>
+			{CONTENT_RECENT_TABLE_ICON}
+			<td class='fcaption'>{CONTENT_RECENT_TABLE_HEADING} {CONTENT_RECENT_TABLE_REFER}</td>
+		</tr>
+		{CONTENT_RECENT_TABLE_SUBHEADING}
+		
+		{CONTENT_RECENT_TABLE_INFOPRE}
+			{CONTENT_RECENT_TABLE_DATE} {CONTENT_RECENT_TABLE_AUTHORDETAILS} {CONTENT_RECENT_TABLE_PARENT} {CONTENT_RECENT_TABLE_EPICONS} {CONTENT_RECENT_TABLE_EDITICON}
+		{CONTENT_RECENT_TABLE_INFOPOST}
+
+		{CONTENT_RECENT_TABLE_SUMMARY}
+		{CONTENT_RECENT_TABLE_TEXT}
+		{CONTENT_RECENT_TABLE_RATING}
+	</table>\n";
+}
+if(!isset($CONTENT_RECENT_TABLE_END)){
+	$CONTENT_RECENT_TABLE_END = "";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_score_template.php 75/e107_plugins/content/templates/default/content_score_template.php
--- 6171/e107_plugins/content/templates/default/content_score_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_score_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,56 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_score_template.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_SCORE_TABLE_ICON']['pre'] = "<td class='forumheader3' rowspan='3' style='width:5%; white-space:nowrap;'>";
+$sc_style['CONTENT_SCORE_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_SCORE_TABLE_HEADING']['pre'] = "";
+$sc_style['CONTENT_SCORE_TABLE_HEADING']['post'] = "";
+
+$sc_style['CONTENT_SCORE_TABLE_AUTHOR']['pre'] = "<tr><td class='forumheader3' colspan='2'>".CONTENT_LAN_11." ";
+$sc_style['CONTENT_SCORE_TABLE_AUTHOR']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_SCORE_TABLE_SCORE']['pre'] = "<td class='fcaption' style='width:20%; white-space:nowrap; text-align:right;'>";
+$sc_style['CONTENT_SCORE_TABLE_SCORE']['post'] = "</td>";
+
+// ##### CONTENT TOP --------------------------------------------------
+if(!isset($CONTENT_SCORE_TABLE_START)){
+	$CONTENT_SCORE_TABLE_START = "";
+}
+if(!isset($CONTENT_SCORE_TABLE)){
+	$CONTENT_SCORE_TABLE = "
+	<table class='fborder' style='width:98%; text-align:left; margin-bottom:5px;'>
+	<tr>
+		{CONTENT_SCORE_TABLE_ICON}
+		<td class='fcaption'>{CONTENT_SCORE_TABLE_HEADING}</td>
+		{CONTENT_SCORE_TABLE_SCORE}
+	</tr>
+	{CONTENT_SCORE_TABLE_AUTHOR}
+	</table>\n";
+}
+if(!isset($CONTENT_SCORE_TABLE_END)){
+	$CONTENT_SCORE_TABLE_END = "";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_searchresult_template.php 75/e107_plugins/content/templates/default/content_searchresult_template.php
--- 6171/e107_plugins/content/templates/default/content_searchresult_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_searchresult_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,67 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_searchresult_template.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_SEARCHRESULT_TABLE_ICON']['pre'] = "<td class='forumheader3'>";
+$sc_style['CONTENT_SEARCHRESULT_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_SEARCHRESULT_TABLE_HEADING']['pre'] = "<tr><td class='fcaption'>";
+$sc_style['CONTENT_SEARCHRESULT_TABLE_HEADING']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_SEARCHRESULT_TABLE_SUBHEADING']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_SEARCHRESULT_TABLE_SUBHEADING']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_SEARCHRESULT_TABLE_DATE']['pre'] = CONTENT_LAN_10." ";
+$sc_style['CONTENT_SEARCHRESULT_TABLE_DATE']['post'] = "";
+
+$sc_style['CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS']['pre'] = CONTENT_LAN_11." ";
+$sc_style['CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS']['post'] = "";
+
+$sc_style['CONTENT_SEARCHRESULT_TABLE_TEXT']['pre'] = "<tr><td class='forumheader3'>";
+$sc_style['CONTENT_SEARCHRESULT_TABLE_TEXT']['post'] = "</td></tr>";
+
+// ##### CONTENT SEARCHRESULT LIST --------------------------------------------------
+if(!isset($CONTENT_SEARCHRESULT_TABLE_START)){
+	$CONTENT_SEARCHRESULT_TABLE_START = "";
+}
+if(!isset($CONTENT_SEARCHRESULT_TABLE)){
+	$CONTENT_SEARCHRESULT_TABLE .= "
+	<table class='fborder' style='width:98%; text-align:left;margin-bottom:5px;'>
+		<tr>
+			{CONTENT_SEARCHRESULT_TABLE_ICON}
+			<td>
+				<table style='width:100%;' cellpadding='0' cellspacing='0'>
+					{CONTENT_SEARCHRESULT_TABLE_HEADING}
+					{CONTENT_SEARCHRESULT_TABLE_SUBHEADING}
+					<tr><td class='forumheader3'>{CONTENT_SEARCHRESULT_TABLE_AUTHORDETAILS} {CONTENT_SEARCHRESULT_TABLE_DATE}</td></tr>
+					{CONTENT_SEARCHRESULT_TABLE_TEXT}
+				</table>
+			</td>
+		</tr>
+	</table>\n";
+}
+if(!isset($CONTENT_SEARCHRESULT_TABLE_END)){
+	$CONTENT_SEARCHRESULT_TABLE_END .= "";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_search_template.php 75/e107_plugins/content/templates/default/content_search_template.php
--- 6171/e107_plugins/content/templates/default/content_search_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_search_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,45 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_search_template.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_SEARCH_TABLE_SELECT']['pre'] = "<td style='width:10%; white-space:nowrap; padding-right:10px;'>";
+$sc_style['CONTENT_SEARCH_TABLE_SELECT']['post'] = "</td>";
+
+$sc_style['CONTENT_SEARCH_TABLE_ORDER']['pre'] = "<td style='width:10%; white-space:nowrap; padding-right:10px;'>";
+$sc_style['CONTENT_SEARCH_TABLE_ORDER']['post'] = "</td>";
+
+$sc_style['CONTENT_SEARCH_TABLE_KEYWORD']['pre'] = "<td>";
+$sc_style['CONTENT_SEARCH_TABLE_KEYWORD']['post'] = "</td>";
+
+// ##### CONTENT SEARCH LIST --------------------------------------------------
+if(!isset($CONTENT_SEARCH_TABLE)){
+	$CONTENT_SEARCH_TABLE = "
+	<table style='width:98%; text-align:left;' border='0'>
+	<tr>
+	{CONTENT_SEARCH_TABLE_SELECT}
+	{CONTENT_SEARCH_TABLE_ORDER}
+	{CONTENT_SEARCH_TABLE_KEYWORD}
+	</tr>
+	</table><br />";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/content/templates/default/content_top_template.php 75/e107_plugins/content/templates/default/content_top_template.php
--- 6171/e107_plugins/content/templates/default/content_top_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/content/templates/default/content_top_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,56 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/content/templates/default/content_top_template.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $content_shortcodes;
+
+$sc_style['CONTENT_TOP_TABLE_ICON']['pre'] = "<td class='forumheader3' rowspan='3' style='width:5%; white-space:nowrap;'>";
+$sc_style['CONTENT_TOP_TABLE_ICON']['post'] = "</td>";
+
+$sc_style['CONTENT_TOP_TABLE_HEADING']['pre'] = "";
+$sc_style['CONTENT_TOP_TABLE_HEADING']['post'] = "";
+
+$sc_style['CONTENT_TOP_TABLE_AUTHOR']['pre'] = "<tr><td class='forumheader3' colspan='2'>".CONTENT_LAN_11." ";
+$sc_style['CONTENT_TOP_TABLE_AUTHOR']['post'] = "</td></tr>";
+
+$sc_style['CONTENT_TOP_TABLE_RATING']['pre'] = "<td class='fcaption' style='width:20%; white-space:nowrap; text-align:right;'>";
+$sc_style['CONTENT_TOP_TABLE_RATING']['post'] = "</td>";
+
+// ##### CONTENT TOP --------------------------------------------------
+if(!isset($CONTENT_TOP_TABLE_START)){
+	$CONTENT_TOP_TABLE_START = "";
+}
+if(!isset($CONTENT_TOP_TABLE)){
+	$CONTENT_TOP_TABLE = "
+	<table class='fborder' style='width:98%; text-align:left; margin-bottom:5px;'>
+	<tr>
+		{CONTENT_TOP_TABLE_ICON}
+		<td class='fcaption'>{CONTENT_TOP_TABLE_HEADING}</td>
+		{CONTENT_TOP_TABLE_RATING}
+	</tr>
+	{CONTENT_TOP_TABLE_AUTHOR}
+	</table>\n";
+}
+if(!isset($CONTENT_TOP_TABLE_END)){
+	$CONTENT_TOP_TABLE_END = "";
+}
+// ##### ----------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/counter_menu/counter_menu.php 75/e107_plugins/counter_menu/counter_menu.php
--- 6171/e107_plugins/counter_menu/counter_menu.php	2004-06-09 08:16:26.000000000 -0500
+++ 75/e107_plugins/counter_menu/counter_menu.php	2005-12-28 14:44:18.000000000 -0600
@@ -1,31 +1,81 @@
-<?php
-$text = "";
-if($pref['log_activate']){
-
-$date = date("Y-m-d");
-$self = substr(strrchr($_SERVER['PHP_SELF'], "/"), 1);
-$sql -> db_Select("stat_counter", "*", "counter_date='$date' AND counter_url='$self' ");
-$row = $sql -> db_Fetch();
-$text = COUNTER_L2.": ".($row['counter_total'] ? $row['counter_total'] : "0")." (unique:".($row['counter_unique'] ? $row['counter_unique'] : "0").")";
-$temp = mysql_query("SELECT sum(counter_total) FROM ".MPREFIX."stat_counter WHERE counter_url='$self' ");
-$temp = mysql_fetch_array($temp);
-$total_page_views = $temp[0];
-$temp = mysql_query("SELECT sum(counter_unique) FROM ".MPREFIX."stat_counter WHERE counter_url='$self' ");
-$temp = mysql_fetch_array($temp);
-$total_unique_views = $temp[0];
-$text .= "<br />".COUNTER_L3.": ".($total_page_views ? $total_page_views : "0")." (unique:".($total_unique_views ? $total_unique_views : "0").")";
-$sql -> db_Select("stat_counter", "*", "counter_url='$self' ORDER BY counter_total DESC");
-$row = $sql -> db_Fetch();
-$text .= "<br />".COUNTER_L4.": ".($row['counter_total'] ? $row['counter_total'] : "0")." (unique:".($row['counter_unique'] ? $row['counter_unique'] : "0").")";
-
-$ns -> tablerender(COUNTER_L1, $text);
-}
-
-if(!$pref['log_activate'] && ADMIN){
-	$text .= "<br /><br /><span class='smalltext'>".COUNTER_L5."</span><br />
-	<a href='".e_ADMIN."log.php'>".COUNTER_L6."</a>";
-	
-	$ns -> tablerender(COUNTER_L1, $text);
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/counter_menu/counter_menu.php,v $
+|     $Revision: 1.15 $
+|     $Date: 2005/12/28 20:44:18 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+$text = "";
+if (isset($pref['statActivate']) && $pref['statActivate'] == true) {
+	$pageName = preg_replace("/(\?.*)|(\_.*)|(\.php)/", "", basename (e_SELF));
+	$logfile = e_PLUGIN."log/logs/logp_".date("z.Y", time()).".php";
+	if(!is_readable($logfile))
+	{
+		if(ADMIN && !$pref['statCountAdmin'])
+		{
+			$text = COUNTER_L1;
+		}
+		$total = 1;
+		$unique = 1;
+		$siteTotal = 1;
+		$siteUnique = 1;
+		$totalever = 1;
+		$uniqueever = 1;
+	} else {
+		$text = "";
+		require($logfile);
+		if($sql -> db_Select("logstats", "*", "log_id='statTotal' OR log_id='statUnique' OR log_id='pageTotal'"))
+		{
+			while($row = $sql -> db_Fetch())
+			{
+				if($row['log_id'] == "statTotal")
+				{
+					$siteTotal += $row['log_data'];
+				}
+				else if($row['log_id'] == "statUnique")
+				{
+					$siteUnique += $row['log_data'];
+				}
+				else
+				{
+					$dbPageInfo = unserialize($row['log_data']);
+					$totalPageEver = ($dbPageInfo[$pageName]['ttlv'] ? $dbPageInfo[$pageName]['ttlv'] : 0);
+					$uniquePageEver = ($dbPageInfo[$pageName]['unqv'] ? $dbPageInfo[$pageName]['unqv'] : 0);
+				}
+			}
+		}
+		$pageName = preg_replace("/(\?.*)|(\_.*)|(\.php)/", "", basename (e_SELF));
+		$total = ($pageInfo[$pageName]['ttl'] ? $pageInfo[$pageName]['ttl'] : 0);
+		$unique = ($pageInfo[$pageName]['unq'] ? $pageInfo[$pageName]['unq'] : 0);
+		$totalever = ($pageInfo[$pageName]['ttlv'] ? $pageInfo[$pageName]['ttlv'] : 0) + $totalPageEver + $total;
+		$uniqueever = ($pageInfo[$pageName]['unqv'] ? $pageInfo[$pageName]['unqv'] : 0) + $uniquePageEver + $unique;
+	}
+	$text .= "<b>".COUNTER_L2."</b><br />".COUNTER_L3.": $total<br />".COUNTER_L5.": $unique<br /><br />
+	<b>".COUNTER_L4."</b><br />".COUNTER_L3.": $totalever<br />".COUNTER_L5.": $uniqueever<br /><br />
+	<b>".COUNTER_L6."</b><br />".COUNTER_L3.": $siteTotal<br />".COUNTER_L5.": $siteUnique";
+	$ns->tablerender(COUNTER_L7, $text, 'counter');
+	unset($dbPageInfo);
+}
+else
+{
+	if(ADMIN)
+	{
+		$text .= "<span class='smalltext'>".COUNTER_L8."</span>";
+		$ns->tablerender(COUNTER_L7, $text, 'counter');
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/counter_menu/languages/English.php 75/e107_plugins/counter_menu/languages/English.php
--- 6171/e107_plugins/counter_menu/languages/English.php	2004-05-07 16:25:00.000000000 -0500
+++ 75/e107_plugins/counter_menu/languages/English.php	2005-06-22 13:07:49.000000000 -0500
@@ -1,22 +1,22 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("COUNTER_L1", "Counter");
-define("COUNTER_L2", "Today");
-define("COUNTER_L3", "Ever");
-define("COUNTER_L4", "Record");
-define("COUNTER_L5", "Stat logging is disabled.");
-define("COUNTER_L6", "Click here to enable.");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/counter_menu/languages/English.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/06/22 18:07:49 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+	
+define("COUNTER_L1", "Admin visits aren't being counted.");
+define("COUNTER_L2", "This page today ...");
+define("COUNTER_L3", "total");
+define("COUNTER_L4", "This page ever ...");
+define("COUNTER_L5", "unique");
+define("COUNTER_L6", "Site ...");
+define("COUNTER_L7", "Counter");
+define("COUNTER_L8", "Admin message: <b>Stat logging is disabled.</b><br />To activate, you need to install the Statistic Logging plugin from your <a href='".e_ADMIN."plugin.php'>plugin manager</a>, then activate it from the <a href='".e_PLUGIN."log/admin_config.php'>configuration screen</a>.");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/custom/Readme.txt 75/e107_plugins/custom/Readme.txt
--- 6171/e107_plugins/custom/Readme.txt	2004-05-09 01:47:38.000000000 -0500
+++ 75/e107_plugins/custom/Readme.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-This directory must be chmoded 777 to use custom menus.
\ No newline at end of file
diff -ruN 6171/e107_plugins/custompages/Readme.txt 75/e107_plugins/custompages/Readme.txt
--- 6171/e107_plugins/custompages/Readme.txt	2004-08-19 06:36:46.000000000 -0500
+++ 75/e107_plugins/custompages/Readme.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1 +0,0 @@
-This directory must be chmoded 777 to use custom pages.
\ No newline at end of file
diff -ruN 6171/e107_plugins/fader_menu/config.php 75/e107_plugins/fader_menu/config.php
--- 6171/e107_plugins/fader_menu/config.php	2004-04-16 03:35:26.000000000 -0500
+++ 75/e107_plugins/fader_menu/config.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,101 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/admin/menu_conf/articles_conf.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-|
-|	Based on code by Edwin van der Wal (evdwal@xs4all.nl), Multilanguage by Juan
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-$lan_file=e_PLUGIN."fader_menu/languages/".e_LANGUAGE.".php";
-if(file_exists($lan_file)){
-	require_once($lan_file);
-} else {
-	require_once(e_PLUGIN."fader_menu/languages/English.php");
-}
-if(!getperms("4")){ header("location:".e_BASE."index.php"); exit ;}
-require_once(e_ADMIN."auth.php");
-
-if(IsSet($_POST['update_menu'])){
-	$aj = new textparse;
-	$_POST['fader_height'] = ($_POST['fader_height'] ? $_POST['fader_height'] : 200);
-	$_POST['fader_delay'] = ($_POST['fader_delay'] ? $_POST['fader_delay'] : 3000);
-	while(list($key, $value) = each($_POST)){
-		if($value != FADER_L15){ 
-			$menu_pref[$key] = str_replace("<br />", "", $aj -> formtpa($value, "admin")); 
-		}
-	}
-
-	$tmp = addslashes(serialize($menu_pref));
-	$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
-	$ns -> tablerender("", "<div style='text-align:center'><b>".FADER_L16."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
-<table style='width:85%' class='fborder' >
-
-<tr>
-<td style='width:30%' class='forumheader3'>".FADER_L6.": </td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='fader_caption' size='50' value='".$menu_pref['fader_caption']."' maxlength='100' />
-</td>
-</tr>
-";
-
-for($a=1; $a<=10; $a++){
-	$var = "fader_message_$a";
-	$text .= "<tr>
-<td style='width:30%' class='forumheader3'>".FADER_L7." ".$a." : </td>
-<td style='width:70%' class='forumheader3'>
-<textarea class='tbox' name='$var' cols='70' rows='4'>".$menu_pref[$var]."</textarea>
-</td>
-</tr>\n\n";
-}
-
-$text .= "
-
-
-<tr>
-<td style='width:30%' class='forumheader3'>".FADER_L8.": </td>
-<td style='width:70%' class='forumheader3'>".
-($menu_pref['fader_colour'] ? "<input name='fader_colour' type='radio' value='0'>".FADER_L9."&nbsp;&nbsp;<input name='fader_colour' type='radio' value='1' checked>".FADER_L10."" : "<input name='fader_colour' type='radio' value='0' checked>".FADER_L9."&nbsp;&nbsp;<input name='fader_colour' type='radio' value='1'>".FADER_L10."")."
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".FADER_L11.": <br /><span class='smalltext'>".FADER_L12.": 200</td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='fader_height' size='10' value='".$menu_pref['fader_height']."' maxlength='3' />
-</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".FADER_L13.": <br /><span class='smalltext'>".FADER_L12.": 3000</td>
-<td style='width:70%' class='forumheader3'>
-<input class='tbox' type='text' name='fader_delay' size='10' value='".$menu_pref['fader_delay']."' maxlength='4' />
-</td>
-</tr>
-
-
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='".FADER_L15."' /></td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender(FADER_L14, $text);
-
-require_once(e_ADMIN."footer.php");
-
-//	<input class='tbox' type='text' name='$var' size='80' value='".$menu_pref[$var]."' maxlength='300' />
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/fader_menu/fader_menu.php 75/e107_plugins/fader_menu/fader_menu.php
--- 6171/e107_plugins/fader_menu/fader_menu.php	2004-05-22 17:18:44.000000000 -0500
+++ 75/e107_plugins/fader_menu/fader_menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,119 +0,0 @@
-<?php
-$fader = "
-
-<script type='text/javascript'>
-
-/*
-Fading Scroller- By DynamicDrive.com
-For full source code, and usage terms, visit http://www.dynamicdrive.com
-This notice MUST stay intact for use
-*/
-
-var delay=".$menu_pref['fader_delay']." //set delay between message change (in miliseconds)
-var fcontent=new Array()
-begintag='' //set opening tag, such as font declarations
-
-";
-
-$aj = new textparse;
-for($a=1; $a<=10; $a++){
-	$var = "fader_message_$a";
-	if($menu_pref[$var]){
-		$var2 = str_replace("\"", "'", $aj -> tpa($menu_pref[$var]));
-		$var2 = str_replace("\r\n", "", $var2);
-		$fader .= "fcontent[".($a-1)."] = \"".$var2."\";\n";
-	}
-}
-
-$fader .= "
-
-closetag=''
-var fwidth='100%' //set scroller width
-var fheight='".$menu_pref['fader_height']."'
-var fadescheme=".$menu_pref['fader_colour']."
-
-";
-
-
-$fader .= <<< TEXT
-var fadelinks=1  //should links inside scroller content also fade like text? 0 for no, 1 for yes.
-
-///No need to edit below this line/////////////////
-
-var hex=(fadescheme==0)? 255 : 0
-var startcolor=(fadescheme==0)? "rgb(255,255,255)" : "rgb(0,0,0)"
-var endcolor=(fadescheme==0)? "rgb(0,0,0)" : "rgb(255,255,255)"
-
-var ie4=document.all&&!document.getElementById
-var ns4=document.layers
-var DOM2=document.getElementById
-var faderdelay=0
-var index=0
-
-if (DOM2)
-faderdelay=2000
-
-//function to change content
-function changecontent(){
-if (index>=fcontent.length)
-index=0
-if (DOM2){
-document.getElementById("fscroller").style.color=startcolor
-document.getElementById("fscroller").innerHTML=begintag+fcontent[index]+closetag
-linksobj=document.getElementById("fscroller").getElementsByTagName("A")
-if (fadelinks)
-linkcolorchange(linksobj)
-colorfade()
-}
-else if (ie4)
-document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag
-else if (ns4){
-document.fscrollerns.document.fscrollerns_sub.document.write(begintag+fcontent[index]+closetag)
-document.fscrollerns.document.fscrollerns_sub.document.close()
-}
-
-index++
-setTimeout("changecontent()",delay+faderdelay)
-}
-
-// colorfade() partially by Marcio Galli for Netscape Communications.  ////////////
-// Modified by Dynamicdrive.com
-
-frame=20;
-
-function linkcolorchange(obj){
-if (obj.length>0){
-for (i=0;i<obj.length;i++)
-obj[i].style.color="rgb("+hex+","+hex+","+hex+")"
-}
-}
-
-function colorfade() {	         	
-// 20 frames fading process
-if(frame>0) {	
-hex=(fadescheme==0)? hex-12 : hex+12 // increase or decrease color value depd on fadescheme
-document.getElementById("fscroller").style.color="rgb("+hex+","+hex+","+hex+")"; // Set color value.
-if (fadelinks)
-linkcolorchange(linksobj)
-frame--;
-setTimeout("colorfade()",20);	
-}
-
-else{
-document.getElementById("fscroller").style.color=endcolor;
-frame=20;
-hex=(fadescheme==0)? 255 : 0
-}   
-}
-
-if (ie4||DOM2)
-document.write('<div id="fscroller" style="width:'+fwidth+';height:'+fheight+';padding:2px"></div>')
-
-</script>
-
-
-<ilayer id="fscrollerns" width=&{fwidth}; height=&{fheight};><layer id="fscrollerns_sub" width=&{fwidth}; height=&{fheight}; left=0 top=0></layer></ilayer>
-
-TEXT;
-
-$ns -> tablerender($menu_pref['fader_caption'], $fader);
\ No newline at end of file
Files 6171/e107_plugins/fader_menu/images/logo.png and 75/e107_plugins/fader_menu/images/logo.png differ
diff -ruN 6171/e107_plugins/fader_menu/languages/English.php 75/e107_plugins/fader_menu/languages/English.php
--- 6171/e107_plugins/fader_menu/languages/English.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/fader_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,36 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-
-define("FADER_L1", "Fading text inside a menu, uses code from DynamicDrive.com");
-define("FADER_L2", "First message");
-define("FADER_L3", "Second message");
-define("FADER_L4", "Leave textboxes blank if you want to :)");
-define("FADER_L5", "To configure please click on the link in the plugins section of the admin front page, then go to the menus screen and activate the menu");
-
-define("FADER_L6", "Caption");
-define("FADER_L7", "Message");
-define("FADER_L8", "Fade Colour");
-define("FADER_L9", "Black to white");
-define("FADER_L10", "White to black");
-define("FADER_L11", "Default layer height in pixels");
-define("FADER_L12", "default");
-define("FADER_L13", "Fade delay in milliseconds");
-define("FADER_L14", "Fader Menu Configuration");
-define("FADER_L15", "Update Menu Settings");
-define("FADER_L16", "Fader menu configuration saved.");
-define("FADER_L17", "Configure Fader");
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/fader_menu/plugin.php 75/e107_plugins/fader_menu/plugin.php
--- 6171/e107_plugins/fader_menu/plugin.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/fader_menu/plugin.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        code adapted from original by Lolo Irie (lolo@touchatou.com)
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-$lan_file = e_PLUGIN."fader_menu/languages/".e_LANGUAGE.".php";
-require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."fader_menu/languages/English.php");
-
-
-// Plugin info -------------------------------------------------------------------------------------------------------
-$eplug_name = "Fader";
-$eplug_version = "1";
-$eplug_author = "jalist";
-$eplug_logo = "button.png";
-$eplug_url = "http://e107.org";
-$eplug_email = "jalist@e107.org";
-$eplug_description = FADER_L1; //"Fading text inside a menu, uses code from DynamicDrive.com";
-$eplug_compatible = "e107v6";
-$eplug_readme = "";        // leave blank if no readme file
-
-// Name of the plugin's folder -------------------------------------------------------------------------------------
-$eplug_folder = "fader_menu";
-
-// Mane of menu item for plugin ----------------------------------------------------------------------------------
-$eplug_menu_name = "fader_menu";
-
-// Name of the admin configuration file --------------------------------------------------------------------------
-$eplug_conffile = "config.php";
-
-// Icon image and caption text ------------------------------------------------------------------------------------
-$eplug_icon = $eplug_folder."/images/logo.png";
-$eplug_caption =  FADER_L17; //"Configure Fader";
-
-// List of preferences -----------------------------------------------------------------------------------------------
-$eplug_prefs = array(
-        "fader_caption" => "Fader",
-                "fader_message_1" => FADER_L2,
-                "fader_message_2" => FADER_L3,
-                "fader_message_3" => FADER_L4,
-                "fader_message_4" => "",
-                "fader_message_5" => "",
-                "fader_message_6" => "",
-                "fader_message_7" => "",
-                "fader_message_8" => "",
-                "fader_message_9" => "",
-                "fader_message_10" => ""
-);
-
-// List of table names -----------------------------------------------------------------------------------------------
-$eplug_table_names = "";
-
-// List of sql requests to create tables -----------------------------------------------------------------------------
-$eplug_tables = "";
-
-
-// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
-$eplug_link = FALSE;
-$eplug_link_name = "";
-$ec_dir = e_PLUGIN."";
-$eplug_link_url = "";
-
-
-// Text to display after plugin successfully installed ------------------------------------------------------------------
-$eplug_done = FADER_L5; // "To configure please click on the link in the plugins section of the admin front page, then go to the menus screen and activate the menu";
-
-
-// upgrading ... //
-
-$upgrade_add_prefs = "";
-
-$upgrade_remove_prefs = "";
-
-$upgrade_alter_tables = "";
-
-$eplug_upgrade_done = "";
-
-
-
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/featurebox/admin_config.php 75/e107_plugins/featurebox/admin_config.php
--- 6171/e107_plugins/featurebox/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/featurebox/admin_config.php	2005-06-14 22:04:40.000000000 -0500
@@ -0,0 +1,204 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/featurebox/admin_config.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/06/15 03:04:40 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if (!getperms("P")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."userclass_class.php");
+require_once(e_HANDLER."file_class.php");
+$fl = new e_file;
+$rejecthumb = array('$.','$..','/','CVS','thumbs.db','*._$',"thumb_", 'index', 'null*');
+$templatelist = $fl->get_files(e_PLUGIN."featurebox/templates/","",$rejecthumb);
+
+if (e_QUERY) {
+	list($action, $id) = explode(".", e_QUERY);
+}
+else
+{
+	$action = FALSE;
+	$id = FALSE;
+}
+
+if(isset($_POST['createFB']))
+{
+	if ($_POST['fb_title'] && $_POST['fb_text']) {
+		$fb_title = $tp -> toDB($_POST['fb_title']);
+		$fb_text = $tp -> toDB($_POST['fb_text']);
+		$fb_mode = $_POST['fb_mode'];
+		$fb_class = $_POST['fb_class'];
+		$fb_rendertype = $_POST['fb_rendertype'];
+		$fb_template = $_POST['fb_template'];
+		$sql->db_Insert("featurebox", "0, '$fb_title', '$fb_text', '$fb_mode', '$fb_class', '$fb_rendertype', '$fb_template'");
+		$message = FBLAN_15;
+	} else {
+		$message = FBLAN_17;
+	}
+}
+
+if(isset($_POST['updateFB']))
+{
+	if ($_POST['fb_title'] && $_POST['fb_text']) {
+		$fb_title = $tp -> toDB($_POST['fb_title']);
+		$fb_text = $tp -> toDB($_POST['fb_text']);
+		$fb_mode = $_POST['fb_mode'];
+		$fb_class = $_POST['fb_class'];
+		$fb_rendertype = $_POST['fb_rendertype'];
+		$fb_template = $_POST['fb_template'];
+		$sql->db_Update("featurebox", "fb_title='$fb_title', fb_text='$fb_text', fb_mode='$fb_mode', fb_class='$fb_class', fb_rendertype='$fb_rendertype', fb_template='$fb_template' WHERE fb_id=".$_POST['fb_id']);
+		$message = FBLAN_16;
+	} else {
+		$message = FBLAN_17;
+	}
+}
+
+if($action == "delete") {
+	$sql->db_Delete("featurebox", "fb_id=$id");
+	$message = FBLAN_18;
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+
+if($headline_total = $sql->db_Select("featurebox "))
+{
+	$nfArray = $sql -> db_getList();
+
+	$text = "<div style='text-align:center'>
+	<table class='fborder' style='".ADMIN_WIDTH.";'>
+	<tr>
+	<td class='forumheader' style='width: 5%; text-align: center;'>ID</td>
+	<td class='forumheader' style='width: 50%;'>".FBLAN_07."</td>
+	<td class='forumheader' style='width: 10%; text-align: center;'>".FBLAN_19."</td>
+	</tr>\n";
+
+	foreach($nfArray as $entry)
+	{
+		$text .= "
+		<tr>
+		<td class='forumheader' style='width: 5%; text-align: center;'>".$entry['fb_id']."</td>
+		<td class='forumheader' style='width: 50%;'>".$entry['fb_title']."</td>
+		<td class='forumheader' style='width: 10%; text-align: center;'>
+		<a href='".e_SELF."?edit.".$entry['fb_id']."'>".FBLAN_20."</a> - <a href='".e_SELF."?delete.".$entry['fb_id']."'>".FBLAN_21."</a>
+		</td>
+		</tr>
+		";
+	}
+
+
+
+	$text .= "</table>\n</div>";
+}
+else
+{
+	$text = FBLAN_05;
+}
+$ns->tablerender(FBLAN_06, $text);
+
+if($action == "edit")
+{
+	if($sql->db_Select("featurebox", "*", "fb_id=$id"))
+	{
+		$row = $sql->db_Fetch();
+		extract($row);
+	}
+}
+else
+{
+	unset($fb_name, $fb_text, $fb_mode, $fb_class);
+}
+
+$text = "<div style='text-align:center'>
+<form method='post' action='".e_SELF."'>\n
+<table style='".ADMIN_WIDTH."' class='fborder'>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".FBLAN_07."</td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input class='tbox' type='text' name='fb_title' style='width: 80%' value='$fb_title' maxlength='200' />
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".FBLAN_08."</td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<textarea class='tbox' name='fb_text' style='width: 90%'  rows='6'>$fb_text</textarea>
+</td>
+</tr>
+	 
+<tr>
+<td style='width:50%' class='forumheader3'>".FBLAN_09."</td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+".r_userclass("fb_class", $fb_class, "public, guests, nobody, member, admin, classes")."
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".FBLAN_12."</td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input type='radio' name='fb_mode' value='0'".(!$fb_mode ? " checked='checked'" : "")." /> ".FBLAN_13."&nbsp;<br />
+<input type='radio' name='fb_mode' value='1'".($fb_mode == 1 ? " checked='checked'" : "")." /> ".FBLAN_14."
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".FBLAN_22."</td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input type='radio' name='fb_rendertype' value='0'".(!$fb_rendertype ? " checked='checked'" : "")." /> ".FBLAN_23."&nbsp;<br />
+<input type='radio' name='fb_rendertype' value='1'".($fb_rendertype == 1 ? " checked='checked'" : "")." /> ".FBLAN_24."
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".FBLAN_25."<br /><span class='smalltext'>".FBLAN_26."</span></td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<select class='tbox' name='fb_template'>
+";
+
+foreach($templatelist as $value)
+{
+	$file = str_replace(".php", "", $value['fname']);
+	$text .= "<option".($file == $fb_template ? " selected='selected'" : "").">$file</option>\n";
+}
+
+$text .= "</select>
+</td>
+</tr>
+
+<tr style='vertical-align:top'>
+<td colspan='2' style='text-align:center' class='forumheader'>
+<input class='button' type='submit' name='".($action == "edit" ? "updateFB" : "createFB")."' value='".($action == "edit" ? FBLAN_11 : FBLAN_10)."' />
+</td>
+</tr>
+	 
+</table>
+".($action == "edit" ? "<input type='hidden' name='fb_id' value='$fb_id' />" : "")."
+</form>
+</div>";
+
+$caption = ($action == "edit" ? FBLAN_11 : FBLAN_10);
+
+$ns->tablerender($caption, $text);
+
+require_once(e_ADMIN."footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/featurebox/featurebox.php 75/e107_plugins/featurebox/featurebox.php
--- 6171/e107_plugins/featurebox/featurebox.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/featurebox/featurebox.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,64 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/featurebox/featurebox.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if($sql -> db_Select("featurebox", "*", "fb_mode=1 AND fb_class IN (".USERCLASS_LIST.") ORDER BY fb_class ASC"))
+{
+	while($row = $sql->db_Fetch())
+	{
+		if($row['fb_class'] > 0 && $row['fb_class'] < 251)
+		{
+			extract($row);
+			continue;
+		}
+		else
+		{
+			$xentry = $row;
+		}
+	}
+	if(!isset($fb_title))
+	{
+		extract($xentry);
+	}
+}
+else if($sql -> db_Select("featurebox", "*", "fb_mode!=1 AND fb_class IN (".USERCLASS_LIST.")"))
+{
+	$nfArray = $sql -> db_getList();
+	$entry = $nfArray[array_rand($nfArray)];
+	extract($entry);
+}
+else
+{
+	return FALSE;
+}
+
+$fbcc = $fb_title;
+$fb_title = $tp -> toHTML($fb_title, TRUE);
+$fb_text = $tp -> toHTML($fb_text, TRUE);
+if(!$fb_rendertype)
+{
+	$ns -> tablerender($fb_title, $fb_text, 'featurebox');
+}
+else 
+{
+	require_once(e_PLUGIN."featurebox/templates/".$fb_template.".php");
+	echo $FB_TEMPLATE;
+}
+?>
\ No newline at end of file
Files 6171/e107_plugins/featurebox/images/featurebox_16.png and 75/e107_plugins/featurebox/images/featurebox_16.png differ
Files 6171/e107_plugins/featurebox/images/featurebox_32.png and 75/e107_plugins/featurebox/images/featurebox_32.png differ
diff -ruN 6171/e107_plugins/featurebox/languages/English.php 75/e107_plugins/featurebox/languages/English.php
--- 6171/e107_plugins/featurebox/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/featurebox/languages/English.php	2005-04-01 05:03:59.000000000 -0600
@@ -0,0 +1,47 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/featurebox/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/04/01 11:03:59 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("FBLAN_01", "Feature Box");
+define("FBLAN_02", "This plugin allows you to display a box above your news items with features / whatever you like in it. The messages can either be revolved randomly or dynamically faded.");
+define("FBLAN_03", "Configure feature box");
+define("FBLAN_04", "Feature Box plugin has been successfully installed. To add messages and configure, return to the main admin page and click on the feature box icon in the plugin section.");
+define("FBLAN_05", "No feature box messages defined yet");
+define("FBLAN_06", "Existing Feature Box Messages");
+define("FBLAN_07", "Title / Caption");
+define("FBLAN_08", "Message text");
+define("FBLAN_09", "Visibility of message");
+define("FBLAN_10", "Create Feature Box Message");
+define("FBLAN_11", "Update Feature Box Message");
+define("FBLAN_12", "Mode");
+define("FBLAN_13", "Randomly revolve messages");
+define("FBLAN_14", "Show this message only");
+define("FBLAN_15", "Message added to database.");
+define("FBLAN_16", "Message updated in database.");
+define("FBLAN_17", "Field(s) left blank");
+define("FBLAN_18", "Feature Box Message deleted");
+define("FBLAN_19", "Options");
+define("FBLAN_20", "Edit");
+define("FBLAN_21", "Delete");
+define("FBLAN_22", "Render type");
+define("FBLAN_23", "In theme box");
+define("FBLAN_24", "Plain");
+define("FBLAN_25", "Template");
+define("FBLAN_26", "you can use a different template for each message, add templates to e107_plugins/featurebox/templates/ folder");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/featurebox/plugin.php 75/e107_plugins/featurebox/plugin.php
--- 6171/e107_plugins/featurebox/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/featurebox/plugin.php	2006-01-22 01:08:15.000000000 -0600
@@ -0,0 +1,94 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/featurebox/plugin.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2006/01/22 07:08:15 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."featurebox/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."featurebox/languages/English.php");
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = FBLAN_01;
+$eplug_version = "1.0";
+$eplug_author = "Steve Dunstan (jalist)";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = FBLAN_02;
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "featurebox";
+
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+
+$eplug_sc = array("");
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/featurebox_32.png";
+$eplug_icon_small = $eplug_folder."/images/featurebox_16.png";
+$eplug_caption = FBLAN_03;
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array("fb_active" => 1);
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array("featurebox");
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."featurebox (
+  fb_id int(10) unsigned NOT NULL auto_increment,
+  fb_title varchar(200) NOT NULL default '',
+  fb_text text NOT NULL,
+  fb_mode tinyint(3) unsigned NOT NULL default '0',
+  fb_class tinyint(3) unsigned NOT NULL default '0',
+  fb_rendertype tinyint(1) unsigned NOT NULL default '0',
+  fb_template varchar(50) NOT NULL default '',
+  PRIMARY KEY  (fb_id)
+) TYPE=MyISAM AUTO_INCREMENT=1 ;");
+
+$eplug_rss['featurebox'] = array(
+	"query" => "SELECT * FROM #featurebox WHERE fb_class = 0",
+	"author" => "",
+	"link" => "",
+	"itemid" => "",
+	"title" => "fb_title",
+	"description" => "fb_text",
+	"categoryid" => "",
+	"categoryname" => "",
+	"categorylink" => "",
+	"datestamp" => "",
+	"enc_url" => "",
+	"enc_leng" => "",
+	"enc_type" => ""
+);
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$eplug_link_url = "";
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = FBLAN_04; // "To activate please go to your menus screen and select the pm_menu into one of your menu areas.";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/featurebox/templates/centered.php 75/e107_plugins/featurebox/templates/centered.php
--- 6171/e107_plugins/featurebox/templates/centered.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/featurebox/templates/centered.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,30 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/featurebox/templates/centered.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$FB_TEMPLATE = "
+<div class='defaulttext' style='text-align: center;'><b>$fb_title</b>
+<hr />
+$fb_text
+</div>
+<br /><br />
+";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/featurebox/templates/default.php 75/e107_plugins/featurebox/templates/default.php
--- 6171/e107_plugins/featurebox/templates/default.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/featurebox/templates/default.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,28 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/featurebox/templates/default.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$FB_TEMPLATE = "
+<div class='defaulttext'><b>$fb_title</b></div>
+<hr />
+$fb_text
+";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/e_emailprint.php 75/e107_plugins/forum/e_emailprint.php
--- 6171/e107_plugins/forum/e_emailprint.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/e_emailprint.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,41 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+function print_item($thread_id)
+{
+	global $tp;
+	$gen = new convert;
+	include_once(e_PLUGIN.'forum/forum_class.php');
+	$forum = new e107forum;
+	$thread_info = $forum->thread_get($thread_id,0,999);
+	$thread_name = $tp -> toHTML($thread_info[0]['thread_name'], TRUE);
+	$text = "<b>".$thread_name."</b><br />
+	".$thread_info[0]['user_name'].", ".$gen->convert_date($thread_info[0]['thread_datestamp'], "forum")."<br /><br />
+	".$tp -> toHTML($thread_info[0]['thread_thread'], TRUE);
+
+
+	$count = 1;
+	
+	unset($thread_info[0], $thread_info['head']);
+	foreach($thread_info as $reply)
+	{
+		$text .= "<br /><br />Re: <b>".$thread_name."</b><br />
+		".$reply['user_name'].", ".$gen->convert_date($reply['thread_datestamp'], "forum")."<br /><br />
+		".$tp -> toHTML($reply['thread_thread'], TRUE);
+	}
+
+
+//	return "<pre>".print_r($thread_info,TRUE)."</pre>";
+	return $text;
+}
+
+function email_item($thread_id)
+{
+	include_once(e_PLUGIN.'forum/forum_class.php');
+	$forum = new e107forum;
+	$thread_info = $forum->thread_get($thread_id,0,999);
+	
+	return "<pre>".print_r($thread_info,TRUE)."</pre>";
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/e_frontpage.php 75/e107_plugins/forum/e_frontpage.php
--- 6171/e107_plugins/forum/e_frontpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/e_frontpage.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,10 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_frontpage.php');
+@include_once(e_PLUGIN.'forum/languages/English/lan_forum_frontpage.php');
+
+$front_page['forum'] = array('page' => $PLUGINS_DIRECTORY.'forum/forum.php', 'title' => FOR_FP_1);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/e_latest.php 75/e107_plugins/forum/e_latest.php
--- 6171/e107_plugins/forum/e_latest.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/e_latest.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+$reported_posts = $sql->db_Count('generic', '(*)', "WHERE gen_type='reported_post' OR gen_type='Reported Forum Post'");
+$text .= "<div style='padding-bottom: 2px;'>
+<img src='".e_PLUGIN."forum/images/forums_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ";
+
+if ($reported_posts) {
+	$text .= "<a href='".e_PLUGIN."forum/forum_admin.php?sr'>Reported forum posts: ".$reported_posts."</a>";
+} else {
+	$text .= 'Reported forum posts: '.$reported_posts;
+}
+
+$text .= '</div>';
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/e_linkgen.php 75/e107_plugins/forum/e_linkgen.php
--- 6171/e107_plugins/forum/e_linkgen.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/e_linkgen.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,37 @@
+<?
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/e_linkgen.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// Usage: sublink_type[x]['title'].
+//  x should be the same as the plugin folder.
+
+include_lan(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_forum_admin.php");
+
+	$sublink_type['forum']['title'] = FORLAN_155; // "News Categories";
+	$sublink_type['forum']['table'] = "forum";
+	$sublink_type['forum']['query'] = "forum_parent !='0' ORDER BY forum_order ASC";
+    $sublink_type['forum']['url'] = $PLUGINS_DIRECTORY."forum/forum_viewforum.php?#";
+	$sublink_type['forum']['fieldid'] = "forum_id";
+	$sublink_type['forum']['fieldname'] = "forum_name";
+	$sublink_type['forum']['fielddiz'] = "forum_description";
+
+
+?>
+
diff -ruN 6171/e107_plugins/forum/e_list.php 75/e107_plugins/forum/e_list.php
--- 6171/e107_plugins/forum/e_list.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/e_list.php	2006-05-17 13:10:23.000000000 -0500
@@ -0,0 +1,152 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|    	Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/e_list.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/05/17 18:10:23 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+	if(!$forum_install = $sql -> db_Select("plugin", "*", "plugin_path = 'forum' AND plugin_installflag = '1' "))
+	{
+		return;
+	}
+
+	$LIST_CAPTION = $arr[0];
+	$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+
+	$bullet = $this -> getBullet($arr[6], $mode);
+
+	if($mode == "new_page" || $mode == "new_menu" )
+	{
+		$lvisit = $this -> getlvisit();
+		$qry = "
+		SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name, t.thread_thread, t.thread_id, t.thread_views as tviews, t.thread_name, tp.thread_parent, t.thread_datestamp, t.thread_user, tp.thread_views, tp.thread_lastpost, tp.thread_lastuser, tp.thread_total_replies 
+		FROM #forum_t AS t 
+		LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id 
+		LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id 
+		LEFT JOIN #user AS u ON t.thread_user = u.user_id 
+		LEFT JOIN #user AS lp ON tp.thread_lastuser = lp.user_id 
+		WHERE f.forum_class REGEXP '".e_CLASS_REGEXP."' 
+		AND t.thread_datestamp > $lvisit 
+		ORDER BY t.thread_datestamp DESC LIMIT 0,".intval($arr[7]);
+	}
+	else
+	{
+		$qry = "
+		SELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name 
+		FROM #forum_t AS t 
+		LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id 
+		LEFT JOIN #user AS u ON t.thread_user = u.user_id 
+		LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id 
+		WHERE t.thread_parent=0 AND f.forum_class REGEXP '".e_CLASS_REGEXP."' 
+		ORDER BY t.thread_lastpost DESC LIMIT 0,".intval($arr[7]);
+		
+	}
+
+	if(!$results = $sql->db_Select_gen($qry))
+	{
+		$LIST_DATA = LIST_FORUM_2;
+	}
+	else
+	{
+		$forumArray = $sql->db_getList();
+		$path = e_PLUGIN."forum/";
+
+		foreach($forumArray as $forumInfo)
+		{
+			extract($forumInfo);
+			
+			//last user
+			$r_id = substr($thread_lastuser, 0, strpos($thread_lastuser, "."));
+			$r_name = substr($thread_lastuser, (strpos($thread_lastuser, ".")+1));
+			if (strstr($thread_lastuser, chr(1))) {
+				$tmp = explode(chr(1), $thread_lastuser);
+				$r_name = $tmp[0];
+			}
+			$thread_lastuser = $r_id;
+
+			//user
+			$u_id = substr($thread_user, 0, strpos($thread_user, "."));
+			$u_name = substr($thread_user, (strpos($thread_user, ".")+1));
+			$thread_user = $u_id;
+
+			if ($thread_anon) {
+				$tmp = explode(chr(1), $thread_anon);
+				$thread_user = $tmp[0];
+				$thread_user_ip = $tmp[1];
+			}
+			
+			$gen = new convert;
+			$r_datestamp = $gen->convert_date($thread_lastpost, "short");
+			if($thread_total_replies)
+			{
+				$LASTPOST = "";
+				if($lp_name)
+				{
+					$LASTPOST = "<a href='".e_BASE."user.php?id.{$thread_lastuser}'>$lp_name</a>";
+				}
+				else
+				{
+					if($thread_lastuser{0} == "0")
+					{
+						$LASTPOST = substr($thread_lastuser, 2);
+					}
+					else
+					{
+						//$LASTPOST = NFPM_L16;
+					}
+				}
+				$LASTPOST .= " ".LIST_FORUM_6." <span class='smalltext'>$r_datestamp</span>";
+			}
+			else
+			{
+				$LASTPOST		= " - ";
+				$LASTPOSTDATE	= "";
+			}
+
+			if($parent_name == "")
+			{
+				$parent_name = $thread_name;
+			}
+			$rowheading	= $this -> parse_heading($parent_name, $mode);
+			if($parent_id)
+			{
+				$lnk = $thread_id.".post";
+			}
+			else
+			{
+				$lnk = $thread_id;
+			}
+			$HEADING	= "<a href='".$path."forum_viewtopic.php?$lnk' title='".$parent_name."'>".$rowheading."</a>";
+			$AUTHOR		= ($arr[3] ? ($thread_anon ? $thread_user : "<a href='".e_BASE."user.php?id.$thread_user'>$user_name</a>") : "");
+			$CATEGORY	= ($arr[4] ? "<a href='".$path."forum_viewforum.php?$forum_id'>$forum_name</a>" : "");
+			$DATE		= ($arr[5] ? $this -> getListDate($thread_datestamp, $mode) : "");
+			$ICON		= $bullet;
+			$VIEWS		= $thread_views;
+			$REPLIES	= $thread_total_replies;
+			if($thread_total_replies)
+			{
+				$INFO		= "[ ".LIST_FORUM_3." ".$VIEWS.", ".LIST_FORUM_4." ".$REPLIES.", ".LIST_FORUM_5." ".$LASTPOST." ]";
+			}
+			else
+			{
+				$INFO		= "[ ".LIST_FORUM_3." ".intval($tviews)." ]";
+			}
+			$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+		}
+	}
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/e_search.php 75/e107_plugins/forum/e_search.php
--- 6171/e107_plugins/forum/e_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/e_search.php	2006-02-18 12:47:35.000000000 -0600
@@ -0,0 +1,17 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+if (file_exists(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_forum_search.php")) {
+	include_once(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_forum_search.php");
+} else {
+	include_once(e_PLUGIN."forum/languages/English/lan_forum_search.php");
+}
+$search_info[] = array(
+	'sfile' => e_PLUGIN.'forum/search/search_parser.php', 
+	'qtype' => FOR_SCH_LAN_1, 
+	'refpage' => 'forum', 
+	'advanced' => e_PLUGIN.'forum/search/search_advanced.php', 
+	'id' => 'forum'
+	);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/e_status.php 75/e107_plugins/forum/e_status.php
--- 6171/e107_plugins/forum/e_status.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/e_status.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,6 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+$forum_posts = $sql -> db_Count("forum_t");
+$text .= "<div style='padding-bottom: 2px;'>".E_16_FORUM." ".ADLAN_113.": ".$forum_posts."</div>";
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_admin.php 75/e107_plugins/forum/forum_admin.php
--- 6171/e107_plugins/forum/forum_admin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_admin.php	2006-04-29 15:34:37.000000000 -0500
@@ -0,0 +1,1492 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_admin.php,v $
+|     $Revision: 1.39 $
+|     $Date: 2006/04/29 20:34:37 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+@include_once e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_admin.php';
+@include_once e_PLUGIN.'forum/languages/English/lan_forum_admin.php';
+
+if (!getperms("P"))
+{
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'forum';
+
+$forum = new forum;
+require_once(e_ADMIN.'auth.php');
+require_once(e_HANDLER."userclass_class.php");
+require_once(e_HANDLER."form_handler.php");
+require_once(e_HANDLER."ren_help.php");
+require_once(e_PLUGIN."forum/forum_class.php");
+$rs = new form;
+$for = new e107forum;
+define("IMAGE_new", "<img src='".img_path('new.png')."' alt='' style='border:0' />");
+define("IMAGE_sub", "<img src='".e_PLUGIN."forum/images/forums_16.png' alt='".FORLAN_145."' title='".FORLAN_145."' style='border:0' />");
+define("IMAGE_nosub", "<img src='".e_PLUGIN."forum/images/sub_forums_16.png' alt='".FORLAN_145."' title='".FORLAN_145."' style='border:0' />");
+
+$deltest = array_flip($_POST);
+if (e_QUERY)
+{
+	$tmp = explode(".", e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	$id = $tmp[2];
+	unset($tmp);
+}
+
+if(isset($_POST['delete']))
+{
+	$tmp = array_pop(array_flip($_POST['delete']));
+	list($delete, $del_id) = explode("_", $tmp);
+}
+
+if(isset($_POST['setMods']))
+{
+	foreach($_POST['mods'] as $fid => $modid)
+	{
+		$sql->db_Update('forum',"forum_moderators = '{$modid}' WHERE forum_id = {$fid}");
+	}
+	$forum->show_message(FORLAN_144);
+}
+
+if(isset($_POST['tools']))
+{
+	$msg = "";
+	if(isset($_POST['forum_all']))
+	{
+		$fList[]='all';
+	}
+	else
+	{
+		foreach(array_keys($_POST['forumlist']) as $k)
+		{
+			$fList[] = $k;
+		}
+	}
+	foreach($fList as $fid)
+	{
+		if(isset($_POST['counts']))
+		{
+			$for->forum_update_counts($fid);
+			$msg .= FORLAN_167.": $fid <br />";
+		}
+		if(isset($_POST['lastpost']))
+		{
+			$with_threads = (isset($_POST['lastpost_nothread'])) ? FALSE : TRUE;
+			$for->update_lastpost('forum', $fid, $with_threads);
+			$msg .= FORLAN_168.": $fid <br />";
+		}
+	}
+	if(isset($_POST['userpostcounts']))
+	{
+		$list = $for->get_user_counts();
+		foreach($list as $uid => $cnt)
+		{
+			$sql->db_Update("user","user_forums = '{$cnt}' WHERE user_id = '{$uid}'");
+		}
+		$msg .= FORLAN_169." <br />";
+	}
+
+	$forum->show_message($msg);
+}
+
+if(isset($_POST['create_sub']))
+{
+	$fid = intval($sub_action);
+	$_name  = $tp->toDB($_POST['subname_new']);
+	$_desc  = $tp->toDB($_POST['subdesc_new']);
+	$_order = intval($_POST['suborder_new']);
+	if($_name != "" && $sql->db_Select('forum', '*', "forum_id = {$fid}"))
+	{
+		$row = $sql->db_Fetch();
+		if($sql->db_Insert("forum", "0, '{$_name}', '{$_desc}', '{$row['forum_parent']}', '{$fid}', '".time()."', '{$row['forum_moderators']}', 0, 0, '', '', '{$row['forum_class']}', '{$_order}', '{$row['forum_postclass']}'"))
+		{
+			$forum->show_message(LAN_CREATED);
+		}
+		else
+		{
+			$forum->show_message(LAN_CREATED_FAILED);
+		}
+	}
+}
+
+if(isset($_POST['update_subs']))
+{
+	$msg = "";
+	foreach(array_keys($_POST['subname']) as $id)
+	{
+		if($_POST['subname'][$id] == "")
+		{
+			if ($sql->db_Delete("forum", "forum_id='$id' "))
+			{
+				$msg .= FORLAN_150." ".$id." ".LAN_DELETED."<br />";
+				$cnt = $sql->db_Delete("forum_t", "thread_forum_id = {$id}");
+				$msg .= $cnt." ".FORLAN_152." ".LAN_DELETED."<br />";
+			}
+		}
+		else
+		{
+			$_name  = $tp->toDB($_POST['subname'][$id]);
+			$_desc  = $tp->toDB($_POST['subdesc'][$id]);
+			$_order = intval($_POST['suborder'][$id]);
+			if($sql->db_Update("forum", "forum_name='{$_name}', forum_description='{$_desc}', forum_order='{$_order}' WHERE forum_id = {$id}"))
+			{
+				$msg .= FORLAN_150." ".$id." ".LAN_UPDATED."<br />";
+			}
+		}
+	}
+	if($msg)
+	{
+		$forum->show_message($msg);
+	}
+}
+
+if(isset($_POST['submit_parent']))
+{
+	$_POST['forum_name'] = $tp->toDB($_POST['forum_name']);
+	$sql->db_Insert("forum", "0, '".$_POST['forum_name']."', '', '0', '0', '".time()."', '', '0', '0', '', '', '".$_POST['forum_class']."', '0', '{$_POST['forum_postclass']}'");
+	$forum->show_message(FORLAN_13);
+}
+
+if(isset($_POST['update_parent']))
+{
+	$_POST['forum_name'] = $tp->toDB($_POST['forum_name']);
+	$sql->db_Update("forum", "forum_name='".$_POST['forum_name']."', forum_class='".$_POST['forum_class']."', forum_postclass='{$_POST['forum_postclass']}'  WHERE forum_id=$id");
+	$forum->show_message(FORLAN_14);
+	$action = "main";
+}
+
+if(isset($_POST['submit_forum']))
+{
+	$mods = $_POST['forum_moderators'];
+	$_POST['forum_name'] = $tp->toDB($_POST['forum_name']);
+	$_POST['forum_description'] = $tp->toDB($_POST['forum_description']);
+	$sql->db_Insert("forum", "0, '".$_POST['forum_name']."', '".$_POST['forum_description']."', '".$_POST['forum_parent']."', '0', '".time()."', '".$mods."', 0, 0, '', '', '".$_POST['forum_class']."', 0, '{$_POST['forum_postclass']}'");
+	$forum->show_message(FORLAN_11);
+}
+
+if(isset($_POST['update_forum']))
+{
+	$mods = $_POST['forum_moderators'];
+	$_POST['forum_name'] = $tp->toDB($_POST['forum_name']);
+	$_POST['forum_description'] = $tp->toDB($_POST['forum_description']);
+	$forum_parent = $row['forum_id'];
+	$sql->db_Update("forum", "forum_name='".$_POST['forum_name']."', forum_description='".$_POST['forum_description']."', forum_parent='".$_POST['forum_parent']."', forum_moderators='".$mods."', forum_class='".$_POST['forum_class']."', forum_postclass='{$_POST['forum_postclass']}' WHERE forum_id=$id");
+	$sql->db_Update("forum", "forum_moderators='".$mods."', forum_class='".$_POST['forum_class']."', forum_postclass='{$_POST['forum_postclass']}' WHERE forum_sub=$id");
+	$forum->show_message(FORLAN_12);
+	$action = "main";
+}
+
+if (isset($_POST['update_order']))
+{
+	extract($_POST);
+	while (list($key, $id) = each($forum_order))
+	{
+		$tmp = explode(".", $id);
+		$sql->db_Update("forum", "forum_order=".$tmp[1]." WHERE forum_id=".$tmp[0]);
+	}
+	$forum->show_message(FORLAN_73);
+}
+
+if (isset($_POST['updateoptions']))
+{
+	$pref['email_notify'] = $_POST['email_notify'];
+	$pref['email_notify_on'] = $_POST['email_notify_on'];
+	$pref['forum_poll'] = $_POST['forum_poll'];
+	$pref['forum_popular'] = $_POST['forum_popular'];
+	$pref['forum_track'] = $_POST['forum_track'];
+	$pref['forum_eprefix'] = $_POST['forum_eprefix'];
+	$pref['forum_enclose'] = $_POST['forum_enclose'];
+	$pref['forum_title'] = $_POST['forum_title'];
+	$pref['forum_postspage'] = $_POST['forum_postspage'];
+	$pref['html_post'] = $_POST['html_post'];
+	$pref['forum_attach'] = $_POST['forum_attach'];
+	$pref['forum_redirect'] = $_POST['forum_redirect'];
+	$pref['forum_user_customtitle'] = $_POST['forum_user_customtitle'];
+	$pref['reported_post_email'] = $_POST['reported_post_email'];
+	$pref['forum_tooltip'] = $_POST['forum_tooltip'];
+	$pref['forum_tiplength'] = $_POST['forum_tiplength'];
+	$pref['forum_hilightsticky'] = $_POST['forum_hilightsticky'];
+	$pref['forum_maxwidth'] = $_POST['forum_maxwidth'];
+	$pref['forum_linkimg'] = $_POST['forum_linkimg'];
+	save_prefs();
+	$forum->show_message(FORLAN_10);
+}
+
+if (isset($_POST['do_prune']))
+{
+	$msg = $for->forum_prune($_POST['prune_type'], $_POST['prune_days'], $_POST['pruneForum']);
+	$forum->show_message($msg);
+	$action = "main";
+}
+
+if (isset($_POST['set_ranks']))
+{
+	extract($_POST);
+	for($a = 0; $a <= 9; $a++)
+	{
+		$r_names .= $tp->toDB($rank_names[$a]).",";
+		$r_thresholds .= $tp->toDB($rank_thresholds[$a]).",";
+		$r_images .= $tp->toDB($rank_images[$a]).",";
+	}
+	$pref['rank_main_admin'] = $_POST['rank_main_admin'];
+	$pref['rank_main_admin_image'] = $_POST['rank_main_admin_image'];
+	$pref['rank_admin'] = $_POST['rank_admin'];
+	$pref['rank_admin_image'] = $_POST['rank_admin_image'];
+	$pref['rank_moderator'] = $_POST['rank_moderator'];
+	$pref['rank_moderator_image'] = $_POST['rank_moderator_image'];
+	$pref['forum_levels'] = $r_names;
+	$pref['forum_thresholds'] = $r_thresholds;
+	$pref['forum_images'] = $r_images;
+	save_prefs();
+	$forum->show_message(FORLAN_95);
+}
+
+if (isset($_POST['frsubmit']))
+{
+	$guestrules = $tp->toDB($_POST['guestrules']);
+	$memberrules = $tp->toDB($_POST['memberrules']);
+	$adminrules = $tp->toDB($_POST['adminrules']);
+	if(!$sql->db_Update("generic", "gen_chardata ='$guestrules', gen_intdata='".$_POST['guest_active']."' WHERE gen_type='forum_rules_guest' "))
+	{
+		$sql -> db_Insert("generic", "0, 'forum_rules_guest', '".time()."', 0, '', '".$_POST['guest_active']."', '$guestrules' ");
+	}
+	if(!$sql->db_Update("generic", "gen_chardata ='$memberrules', gen_intdata='".$_POST['member_active']."' WHERE gen_type='forum_rules_member' "))
+	{
+		$sql -> db_Insert("generic", "0, 'forum_rules_member', '".time()."', 0, '', '".$_POST['member_active']."', '$memberrules' ");
+	}
+	if(!$sql->db_Update("generic", "gen_chardata ='$adminrules', gen_intdata='".$_POST['admin_active']."' WHERE gen_type='forum_rules_admin' "))
+	{
+		$sql -> db_Insert("generic", "0, 'forum_rules_admin', '".time()."', 0, '', '".$_POST['admin_active']."', '$adminrules' ");
+	}
+}
+
+
+if ($delete == 'main') {
+	if ($sql->db_Delete("forum", "forum_id='$del_id' ")) {
+		$forum->show_message(FORLAN_96);
+	}
+}
+
+if ($action == "create")
+{
+	if ($sql->db_Select("forum", "*", "forum_parent='0' "))
+	{
+		$forum->create_forums($sub_action, $id);
+	}
+	else
+	{
+		header("location:".e_ADMIN."forum.php");
+		exit;
+	}
+}
+
+if ($delete == 'cat')
+{
+	if ($sql->db_Delete("forum", "forum_id='$del_id' "))
+	{
+		$sql->db_Delete("forum", "forum_parent='$del_id' ");
+		$forum->show_message(FORLAN_97);
+		$action = "main";
+	}
+}
+
+if($action == "delete")
+{
+	$forum->delete_item(intval($sub_action));
+}
+
+if ($action == "cat") {
+	$forum->create_parents($sub_action, $id);
+}
+
+if ($action == "order") {
+	$forum->show_existing_forums($sub_action, $id, TRUE);
+}
+
+if ($action == "opt")
+{
+	$forum->show_prefs();
+}
+
+if ($action == "mods")
+{
+	$forum->show_mods();
+}
+
+if ($action == "tools")
+{
+	$forum->show_tools();
+}
+
+if ($action == "prune")
+{
+	$forum->show_prune();
+}
+
+if ($action == "rank")
+{
+	$forum->show_levels();
+}
+
+if ($action == "rules")
+{
+	$forum->show_rules();
+}
+
+if($action == 'subs')
+{
+	$forum->show_subs($sub_action);
+}
+
+if ($delete == 'reported')
+{
+	$sql->db_Delete("generic", "gen_id='$del_id' ");
+	$forum->show_message(FORLAN_118);
+}
+
+
+if ($action == "sr")
+{
+	$forum->show_reported($sub_action);
+}
+
+if (!e_QUERY || $action == "main")
+{
+	$forum->show_existing_forums($sub_action, $id);
+}
+
+//$forum->show_options($action);
+require_once(e_ADMIN."footer.php");
+function headerjs()
+{
+	global $tp;
+// These functions need to be removed and replaced with the generic jsconfirm() function.
+	$headerjs = "<script type=\"text/javascript\">
+		function confirm_(mode, forum_id, forum_name) {
+		if (mode == 'sr') {
+		return confirm(\"".$tp->toJS(FORLAN_117)."\");
+		} else if(mode == 'parent') {
+		return confirm(\"".$tp->toJS(FORLAN_81)." [ID: \" + forum_name + \"]\");
+		} else {
+		return confirm(\"".$tp->toJS(FORLAN_82)." [ID: \" + forum_name + \"]\");
+		}
+		}
+		</script>";
+	return $headerjs;
+}
+
+class forum
+{
+
+	function show_options($action)
+	{
+		global $sql;
+		if ($action == "")
+		{
+			$action = "main";
+		}
+		// ##### Display options ---------------------------------------------------------------------------------------------------------
+		$var['main']['text'] = FORLAN_76;
+		$var['main']['link'] = e_SELF;
+		$var['cat']['text'] = FORLAN_83;
+		$var['cat']['link'] = e_SELF."?cat";
+		if ($sql->db_Select("forum", "*", "forum_parent='0' "))
+		{
+			$var['create']['text'] = FORLAN_77;
+			$var['create']['link'] = e_SELF."?create";
+		}
+		$var['order']['text'] = FORLAN_78;
+		$var['order']['link'] = e_SELF."?order";
+		$var['opt']['text'] = FORLAN_79;
+		$var['opt']['link'] = e_SELF."?opt";
+		$var['prune']['text'] = FORLAN_59;
+		$var['prune']['link'] = e_SELF."?prune";
+		$var['rank']['text'] = FORLAN_63;
+		$var['rank']['link'] = e_SELF."?rank";
+		$var['rules']['text'] = FORLAN_123;
+		$var['rules']['link'] = e_SELF."?rules";
+		$var['sr']['text'] = FORLAN_116;
+		$var['sr']['link'] = e_SELF."?sr";
+		$var['mods']['text'] = FORLAN_33;
+		$var['mods']['link'] = e_SELF."?mods";
+		$var['tools']['text'] = FORLAN_153;
+		$var['tools']['link'] = e_SELF."?tools";
+
+		show_admin_menu(FORLAN_7, $action, $var);
+	}
+
+	function delete_item($id)
+	{
+		global $sql;
+		$id = intval($id);
+		$confirm = isset($_POST['confirm']) ? TRUE : FALSE;
+
+		if($sql->db_Select('forum', '*', "forum_id = {$id}"))
+		{
+			$txt = "";
+			$row = $sql->db_Fetch();
+			if($row['forum_parent'] == 0)
+			{
+				$txt .= $this->delete_parent($id, $confirm);
+			}
+			elseif($row['forum_sub'] > 0)
+			{
+				$txt .= $this->delete_sub($id, $confirm);
+			}
+			else
+			{
+				$txt .= $this->delete_forum($id, $confirm);
+			}
+			if($confirm)
+			{
+				$this->show_message($txt);
+			}
+			else
+			{
+				$this->delete_show_confirm($txt);
+			}
+		}
+	}
+
+	function delete_parent($id, $confirm = FALSE)
+	{
+		global $sql;
+		$ret = "";
+		if($sql->db_Select("forum", "forum_id", "forum_parent = {$id} AND forum_sub = 0"))
+		{
+			$fList = $sql->db_getList();
+			foreach($fList as $f)
+			{
+				$ret .= $this->delete_forum($f['forum_id'], $confirm);
+			}
+		}
+		if($confirm)
+		{
+			if($sql->db_Delete("forum", "forum_id = {$id}"))
+			{
+				$ret .= "Forum parent successfully deleted";
+			}
+			else
+			{
+				$ret .= "Forum parent could not be deleted";
+			}
+			return $ret;
+		}
+		return "The forum parent has the following info: <br />".$ret;
+
+	}
+
+	function delete_forum($id, $confirm = FALSE)
+	{
+		global $sql, $tp;
+		$ret = "";
+		if($sql->db_Select("forum", "forum_id", "forum_sub = {$id}"))
+		{
+			$fList = $sql->db_getList();
+			foreach($fList as $f)
+			{
+				$ret .= $this->delete_sub($f['forum_id'], $confirm);
+			}
+		}
+		if($confirm)
+		{
+			$cnt = $sql->db_Delete("forum_t","thread_forum_id = {$id}");
+			$ret .= $cnt." forum {$id} thread(s) deleted <br />";
+			if($sql->db_Delete("forum", "forum_id = {$id}"))
+			{
+				$ret .= "Forum {$id} successfully deleted";
+			}
+			else
+			{
+				$ret .= "Forum {$id} could not be deleted";
+			}
+			return $ret;
+		}
+
+		$sql->db_Select("forum", "*", "forum_id = {$id}");
+		$row = $sql->db_Fetch();
+		return "Forum {$id} [".$tp->toHTML($row['forum_name'])."] has {$row['forum_threads']} threads, {$row['forum_replies']} replies. <br />".$ret;
+	}
+
+	function delete_sub($id, $confirm = FALSE)
+	{
+		global $sql, $tp;
+		if($confirm)
+		{
+			$cnt = $sql->db_Delete("forum_t","thread_forum_id = {$id}");
+			$ret .= $cnt." Sub-forum {$id} thread(s) deleted <br />";
+			if($sql->db_Delete("forum", "forum_id = {$id}"))
+			{
+				$ret .= "Sub-forum {$id} successfully deleted";
+			}
+			else
+			{
+				$ret .= "Sub-forum {$id} could not be deleted";
+			}
+			return $ret;
+		}
+
+		$sql->db_Select("forum", "*", "forum_id = {$id}");
+		$row = $sql->db_Fetch();
+		return "Sub-forum {$id} [".$tp->toHTML($row['forum_name'])."] has {$row['forum_threads']} threads, {$row['forum_replies']} replies. <br />".$ret;
+	}
+
+	function delete_show_confirm($txt)
+	{
+		global $ns;
+		$this->show_message($txt);
+		$txt = "
+		<form method='post' action='".e_SELF."?".e_QUERY."'>
+		<div style='text-align:center'>".FORLAN_180."<br /><br />
+		<input type='submit' class='button' name='confirm' value='".FORLAN_181."' />
+		</div>
+		</form>
+		";
+		$ns->tablerender(FORLAN_181, $txt);
+	}
+
+	function show_subs($id)
+	{
+		global $sql, $tp, $ns;
+		$txt = "
+		<form method='post' action='".e_SELF."?".e_QUERY."'>
+		<table style='width:100%'>
+		<tr>
+			<td class='fcaption'>".FORLAN_151."</td>
+			<td class='fcaption'>".FORLAN_31."</td>
+			<td class='fcaption'>".FORLAN_32."</td>
+			<td class='fcaption'>".FORLAN_37."</td>
+			<td class='fcaption'>".FORLAN_20."</td>
+		</tr>
+		";
+		if($sql->db_Select('forum', 'forum_id, forum_name, forum_description, forum_order', "forum_sub = {$id} ORDER by forum_order ASC"))
+		{
+			$subList = $sql->db_getList();
+			foreach($subList as $sub)
+			{
+				$txt .= "
+				<tr>
+				<td class='forumheader2' style='vertical-align:top'>{$sub['forum_id']}</td>
+				<td class='forumheader2' style='vertical-align:top'><input class='tbox' type='text' name='subname[{$sub['forum_id']}]' value='{$sub['forum_name']}' size='30' maxlength='255' /></td>
+				<td class='forumheader2' style='vertical-align:top'><textarea cols='60' rows='2' class='tbox' name='subdesc[{$sub['forum_id']}]'>{$sub['forum_description']}</textarea></td>
+				<td class='forumheader2' style='vertical-align:top'><input class='tbox' type='text' name='suborder[{$sub['forum_id']}]' value='{$sub['forum_order']}' size='3' maxlength='4' /></td>
+				<td class='forumheader2' style='vertical-align:top; text-align:center'>
+				<a href='".e_SELF."?delete.{$sub['forum_id']}'>".ADMIN_DELETE_ICON."</a>
+				</td>
+				</tr>
+				";
+			}
+			$txt .= "
+			<tr>
+			<td class='forumheader3' colspan='5' style='text-align:center'><input type='submit' class='button' name='update_subs' value='".FORLAN_147."' /></td>
+			</tr>
+			<tr>
+			<td colspan='5' style='text-align:center'>&nbsp;</td>
+			</tr>
+			";
+
+		}
+		else
+		{
+			$txt .= "<tr><td colspan='5' class='forumheader3' style='text-align:center'>".FORLAN_146."</td>";
+		}
+
+		$txt .= "
+		<tr>
+			<td class='fcaption'>".FORLAN_151."</td>
+			<td class='fcaption'>".FORLAN_31."</td>
+			<td class='fcaption'>".FORLAN_32."</td>
+			<td class='fcaption'>".FORLAN_37."</td>
+			<td class='fcaption'>&nbsp;</td>
+		</tr>
+		<tr>
+		<td class='forumheader2' style='vertical-align:top'>&nbsp;</td>
+		<td class='forumheader2'><input class='tbox' type='text' name='subname_new' value='' size='30' maxlength='255' /></td>
+		<td class='forumheader2'><textarea cols='60' rows='2' class='tbox' name='subdesc_new'></textarea></td>
+		<td class='forumheader2'><input class='tbox' type='text' name='suborder_new' value='' size='3' maxlength='4' /></td>
+		<td class='forumheader2'>&nbsp;</td>
+		</tr>
+		<tr>
+		<td class='forumheader3' colspan='5' style='text-align:center'><input type='submit' class='button' name='create_sub' value='".FORLAN_148."' /></td>
+		</tr>
+		</table>
+		</form>
+		";
+		$ns->tablerender(FORLAN_149, $txt);
+	}
+
+	function show_existing_forums($sub_action, $id, $mode = FALSE)
+	{
+		global $sql, $rs, $ns, $sql2, $sql3, $tp, $for;
+
+		$subList = $for->forum_getsubs();
+		if (!is_object($sql2))
+		{
+			$sql2 = new db;
+		}
+		if (!is_object($sql3))
+		{
+			$sql3 = new db;
+		}
+		if (!$mode)
+		{
+			$text = "<div style='padding : 1px; ".ADMIN_WIDTH."; margin-left: auto; margin-right: auto; text-align: center;'>";
+		} else {
+			$text = "<form method='post' action='".e_SELF."?".e_QUERY."'>";
+		}
+		$text .= "
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td colspan='2' style='width:70%; text-align:center' class='fcaption'>".FORLAN_28."</td>
+			<td style='width:30%; text-align:center' class='fcaption'>".FORLAN_80."</td>
+			</tr>";
+
+		if (!$parent_amount = $sql->db_Select("forum", "*", "forum_parent='0' ORDER BY forum_order ASC"))
+		{
+			$text .= "<tr><td class='forumheader3' style='text-align:center' colspan='3'>".FORLAN_29."</td></tr>";
+		}
+		else
+		{
+			$sql2 = new db;
+			$sql3 = new db;
+			while ($row = $sql->db_Fetch())
+			{
+				extract($row);
+				$parent_id = $forum_id;
+				$text .= "
+				<tr>
+					<td colspan='2' class='forumheader'>".$forum_name."
+					<br /><b>".FORLAN_140.":</b> ".r_userclass_name($forum_class)."&nbsp;&nbsp;<b>".FORLAN_141.":</b> ".r_userclass_name($forum_postclass)."
+					</td>";
+
+				$text .= "<td class='forumheader' style='text-align:center'>";
+
+				if ($mode)
+				{
+					$text .= "<select name='forum_order[]' class='tbox'>\n";
+					for($a = 1; $a <= $parent_amount; $a++)
+					{
+						$text .= ($forum_order == $a ? "<option value='$forum_id.$a' selected='selected'>$a</option>\n" : "<option value='$forum_id.$a'>$a</option>\n");
+					}
+					$text .= "</select>";
+				}
+				else
+				{
+					$forum_heading = str_replace("&#39;", "\'", $forum_name);
+					$text .= "
+						<div style='text-align:left; padding-left: 30px'>
+						<a href='".e_SELF."?cat.edit.{$forum_id}'>".ADMIN_EDIT_ICON."</a>
+						<a href='".e_SELF."?delete.{$forum_id}'>".ADMIN_DELETE_ICON."</a>
+						</div>
+						";
+				}
+				$text .= "</td></tr>";
+
+				$forums = $sql2->db_Select("forum", "*", "forum_parent='".$forum_id."' AND forum_sub = 0 ORDER BY forum_order ASC");
+				if (!$forums)
+				{
+					$text .= "<td colspan='4' style='text-align:center' class='forumheader3'>".FORLAN_29."</td>";
+				}
+				else
+				{
+					while ($row = $sql2->db_Fetch())
+					{
+						extract($row);
+
+						$text .= "
+						<tr>
+							<td style='width:5%; text-align:center' class='forumheader3'>".IMAGE_new."</td>\n<td style='width:55%' class='forumheader3'><a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".$forum_name."</a>" ;
+
+						$text .= "
+							<br /><span class='smallblacktext'>".$forum_description."&nbsp;</span>
+							<br /><b>".FORLAN_140.":</b> ".r_userclass_name($forum_class)."&nbsp;&nbsp;<b>".FORLAN_141.":</b> ".r_userclass_name($forum_postclass)."
+
+						</td>
+
+							<td colspan='2' class='forumheader3' style='text-align:center'>";
+
+						if ($mode)
+						{
+							$text .= "<select name='forum_order[]' class='tbox'>\n";
+							for($a = 1; $a <= $forums; $a++)
+							{
+								$text .= ($forum_order == $a ? "<option value='$forum_id.$a' selected='selected'>$a</option>\n" : "<option value='$forum_id.$a'>$a</option>\n");
+							}
+							$text .= "</select>";
+						}
+						else
+						{
+							$forum_heading = str_replace("&#39;", "\'", $forum_name);
+							$sub_img = count($subList[$parent_id][$forum_id]) ? IMAGE_sub : IMAGE_nosub;
+							$text .= "
+									<div style='text-align:left; padding-left: 30px'>
+									<a href='".e_SELF."?create.edit.{$forum_id}'>".ADMIN_EDIT_ICON."</a>
+									<a href='".e_SELF."?delete.{$forum_id}'>".ADMIN_DELETE_ICON."</a>
+									&nbsp;&nbsp;<a href='".e_SELF."?subs.{$forum_id}'>".$sub_img."</a>
+									</div>
+								";
+						}
+						$text .= "</td>\n</tr>";
+					}
+				}
+			}
+		}
+
+		if (!$mode)
+		{
+			$text .= "</table></div>";
+			$ns->tablerender(FORLAN_30, $text);
+		}
+		else
+		{
+			$text .= "<tr>\n<td colspan='4' style='text-align:center' class='forumheader'>\n<input class='button' type='submit' name='update_order' value='".FORLAN_72."' />\n</td>\n</tr>\n</table>\n</form>";
+			$ns->tablerender(FORLAN_37, $text);
+		}
+
+	}
+
+	function create_parents($sub_action, $id)
+	{
+		global $sql, $ns;
+
+		if ($sub_action == "edit" && !$_POST['update_parent'])
+		{
+			if ($sql->db_Select("forum", "*", "forum_id=$id"))
+			{
+				$row = $sql->db_Fetch();
+				 extract($row);
+			}
+		}
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+
+			<tr>
+				<td style='width:40%' class='forumheader3'>".FORLAN_31.":</td>
+				<td style='width:60%' class='forumheader3'>
+					<input class='tbox' type='text' name='forum_name' size='60' value='$forum_name' maxlength='250' />
+				</td>
+			</tr>
+
+			<tr>
+				<td style='width:40%' class='forumheader3'>".FORLAN_23.":<br /><span class='smalltext'>(".FORLAN_24.")</span></td>
+				<td style='width:60%' class='forumheader3'>".r_userclass("forum_class", $forum_class, 'off', 'nobody,public,member,admin,classes')."</td>
+			</tr>
+
+			<tr>
+				<td style='width:40%' class='forumheader3'>".FORLAN_142.":<br /><span class='smalltext'>(".FORLAN_143.")</span></td>
+				<td style='width:60%' class='forumheader3'>".r_userclass("forum_postclass", $forum_postclass, 'off', 'nobody,public,member,admin,classes')."</td>
+			</tr>
+
+			<tr style='vertical-align:top'>
+			<td colspan='2'  style='text-align:center' class='forumheader'>";
+
+		if ($sub_action == "edit")
+		{
+			$text .= "<input class='button' type='submit' name='update_parent' value='".FORLAN_25."' />";
+		}
+		else
+		{
+			$text .= "<input class='button' type='submit' name='submit_parent' value='".FORLAN_26."' />";
+		}
+
+		$text .= "</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+
+		$ns->tablerender(FORLAN_75, $text);
+	}
+
+	function create_forums($sub_action, $id)
+	{
+		global $sql, $ns;
+
+		if ($sub_action == "edit" && !$_POST['update_forum'])
+		{
+			if ($sql->db_Select("forum", "*", "forum_id=$id"))
+			{
+				$row = $sql->db_Fetch();
+				 extract($row);
+			}
+		}
+
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='width:40%' class='forumheader3'>".FORLAN_22.":</td>
+			<td style='width:60%' class='forumheader3'>";
+
+		$sql->db_Select("forum", "*", "forum_parent=0");
+		$text .= "<select name='forum_parent' class='tbox'>\n";
+		while (list($forum_id_, $forum_name_) = $sql->db_Fetch())
+		{
+			extract($row);
+			if ($forum_id_ == $forum_parent)
+			{
+				$text .= "<option value='$forum_id_' selected='selected'>".$forum_name_."</option>\n";
+			}
+			else
+			{
+				$text .= "<option value='$forum_id_'>".$forum_name_."</option>\n";
+			}
+		}
+		$text .= "</select>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:40%' class='forumheader3'>".FORLAN_31.":
+			<div class='smalltext'>".FORLAN_179."</div>
+			</td>
+			<td style='width:60%' class='forumheader3'>
+			<input class='tbox' type='text' name='forum_name' size='60' value='$forum_name' maxlength='250' />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:40%' class='forumheader3'>".FORLAN_32.": </td>
+			<td style='width:60%' class='forumheader3'>
+			<textarea class='tbox' name='forum_description' cols='50' rows='5'>$forum_description</textarea>
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:40%' class='forumheader3'>".FORLAN_33.":<br /><span class='smalltext'>(".FORLAN_34.")</span></td>
+			<td style='width:60%' class='forumheader3'>";
+			$text .= r_userclass("forum_moderators", $forum_moderators, 'off', 'admin,classes');
+
+//		$admin_no = $sql->db_Select("user", "*", "user_admin='1' AND user_perms REGEXP('A.') OR user_perms='0' ");
+//		while ($row = $sql->db_Fetch())
+//		{
+//			extract($row);
+//			$text .= "<input type='checkbox' name='mod[]' value='".$user_name ."'";
+//			if (preg_match('/'.preg_quote($user_name).'/', $forum_moderators))
+//			{
+//				$text .= " checked";
+//			}
+//			$text .= "/> ".$user_name ."<br />";
+//		}
+
+		$text .= "</td>
+			</tr>
+			<tr>
+				<td style='width:40%' class='forumheader3'>".FORLAN_23.":<br /><span class='smalltext'>(".FORLAN_24.")</span></td>
+				<td style='width:60%' class='forumheader3'>".r_userclass("forum_class", $forum_class, 'off', 'nobody,public,member,admin,classes')."</td>
+			</tr>
+
+			<tr>
+				<td style='width:40%' class='forumheader3'>".FORLAN_142.":<br /><span class='smalltext'>(".FORLAN_143.")</span></td>
+				<td style='width:60%' class='forumheader3'>".r_userclass("forum_postclass", $forum_postclass, 'off', 'nobody,public,member,admin,classes')."</td>
+			</tr>
+
+		<tr style='vertical-align:top'>
+			<td colspan='2'  style='text-align:center' class='forumheader'>";
+		if ($sub_action == "edit")
+		{
+			$text .= "<input class='button' type='submit' name='update_forum' value='".FORLAN_35."' />";
+		}
+		else
+		{
+			$text .= "<input class='button' type='submit' name='submit_forum' value='".FORLAN_36."' />";
+		}
+		$text .= "</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+		$ns->tablerender(FORLAN_28, $text);
+	}
+
+	function show_message($message)
+	{
+		global $ns;
+		$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+	}
+
+	function show_tools()
+	{
+		global $sql, $ns, $tp;
+		$txt = "
+		<form method='post' action='".e_SELF."?".e_QUERY."'>
+		<table style='width:".ADMIN_WIDTH."'>
+		<tr style='width:100%'>
+		<td class='fcaption'>".FORLAN_156."</td>
+		</tr>
+		<tr>
+		<td class='forumheader3'>
+		";
+		if($sql->db_Select("forum", "*", "1 ORDER BY forum_order"))
+		{
+			$fList = $sql->db_getList();
+			foreach($fList as $f)
+			{
+				$txt .= "<input type='checkbox' name='forumlist[{$f['forum_id']}]' value='1' /> ".$tp->toHTML($f['forum_name'])."<br />";
+			}
+			$txt .= "<input type='checkbox' name='forum_all' value='1' /> ".FORLAN_157;
+		}
+		$txt .= "
+		</td>
+		</tr>
+		<tr>
+		<td class='fcaption'>".FORLAN_158."</td>
+		</tr>
+		<tr>
+		<td class='forumheader3'>
+			<input type='checkbox' name='lastpost' value='1' /> ".FORLAN_159." <br />&nbsp;&nbsp;&nbsp;&nbsp;
+			<input type='checkbox' name='lastpost_nothread' value='1' checked='checked' /> ".FORLAN_160."
+		</td>
+		</tr>
+		<tr>
+		<td class='fcaption'>".FORLAN_161."</td>
+		</tr>
+		<tr>
+		<td class='forumheader3'>
+			<input type='checkbox' name='counts' value='1' /> ".FORLAN_162."<br />
+		</td>
+		</tr>
+		<tr>
+		<td class='fcaption'>".FORLAN_163."</td>
+		</tr>
+		<tr>
+		<td class='forumheader3'>
+			<input type='checkbox' name='userpostcounts' value='1' /> ".FORLAN_164."<br />
+		</td>
+		</tr>
+		<tr>
+		<td class='forumheader3' style='text-align:center'>
+			<input class='button' type='submit' name='tools' value='".FORLAN_165."' />
+		</td>
+		</tr>
+		</table>
+		</form>
+		";
+		$ns->tablerender(FORLAN_166, $txt);
+	}
+
+	function show_prefs()
+	{
+		global $pref, $ns;
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_44."<br /><span class='smalltext'>".FORLAN_45."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_enclose'] ? "<input type='checkbox' name='forum_enclose' value='1' checked='checked' />" : "<input type='checkbox' name='forum_enclose' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_65."<br /><span class='smalltext'>".FORLAN_46."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_title' size='15' value='".$pref['forum_title']."' maxlength='100' /></td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_47."<br /><span class='smalltext'>".FORLAN_48."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['email_notify'] ? "<input type='checkbox' name='email_notify' value='1' checked='checked' />" : "<input type='checkbox' name='email_notify' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_177."<br /><span class='smalltext'>".FORLAN_178."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['email_notify_on'] ? "<input type='checkbox' name='email_notify_on' value='1' checked='checked' />" : "<input type='checkbox' name='email_notify_on' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_49."<br /><span class='smalltext'>".FORLAN_50."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_poll'] ? "<input type='checkbox' name='forum_poll' value='1' checked='checked' />" : "<input type='checkbox' name='forum_poll' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_70."<br /><span class='smalltext'>".FORLAN_71." <a href='".e_ADMIN."upload.php'>".FORLAN_130."</a> ". FORLAN_131."</span>";
+
+			if(!$pref['image_post'])
+			{
+				$text .= "<br /><b>".FORLAN_139."</b>";
+			}
+
+			$text .= "</td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_attach'] ? "<input type='checkbox' name='forum_attach' value='1' checked='checked' />" : "<input type='checkbox' name='forum_attach' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_134."<br /><span class='smalltext'>".FORLAN_135."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' size='3' maxlength='5' name='forum_maxwidth' value='{$pref['forum_maxwidth']}' /></td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_136."<br /><span class='smalltext'>".FORLAN_137."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_linkimg'] ? "<input type='checkbox' name='forum_linkimg' value='1' checked='checked' />" : "<input type='checkbox' name='forum_linkimg' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_51."<br /><span class='smalltext'>".FORLAN_52."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_track'] ? "<input type='checkbox' name='forum_track' value='1' checked='checked' />" : "<input type='checkbox' name='forum_track' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_112."<br /><span class='smalltext'>".FORLAN_113."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_redirect'] ? "<input type='checkbox' name='forum_redirect' value='1' checked='checked' />" : "<input type='checkbox' name='forum_redirect' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_114."<br /><span class='smalltext'>".FORLAN_115."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_user_customtitle'] ? "<input type='checkbox' name='forum_user_customtitle' value='1' checked='checked' />" : "<input type='checkbox' name='forum_user_customtitle' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_116."<br /><span class='smalltext'>".FORLAN_122."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['reported_post_email'] ? "<input type='checkbox' name='reported_post_email' value='1' checked='checked' />" : "<input type='checkbox' name='reported_post_email' value='1' />")."</td>
+			</tr>
+
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_126."<br /><span class='smalltext'>".FORLAN_127."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_tooltip'] ? "<input type='checkbox' name='forum_tooltip' value='1' checked='checked' />" : "<input type='checkbox' name='forum_tooltip' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_128."<br /><span class='smalltext'>".FORLAN_129."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_tiplength' size='15' value='".$pref['forum_tiplength']."' maxlength='20' /></td>
+			</tr>
+
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_53."<br /><span class='smalltext'>".FORLAN_54."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_eprefix' size='15' value='".$pref['forum_eprefix']."' maxlength='20' /></td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_55."<br /><span class='smalltext'>".FORLAN_56."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_popular' size='3' value='".$pref['forum_popular']."' maxlength='3' /></td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_57."<br /><span class='smalltext'>".FORLAN_58."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_postspage' size='3' value='".$pref['forum_postspage']."' maxlength='3' /></td>
+			</tr>
+
+			<tr>
+			<td style='width:75%' class='forumheader3'>".FORLAN_132."<br /><span class='smalltext'>".FORLAN_133."</span></td>
+			<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_hilightsticky'] ? "<input type='checkbox' name='forum_hilightsticky' value='1' checked='checked' />" : "<input type='checkbox' name='forum_hilightsticky' value='1' />")."</td>
+			</tr>
+
+			<tr>
+			<td colspan='2'  style='text-align:center' class='forumheader'>
+			<input class='button' type='submit' name='updateoptions' value='".FORLAN_61."' />
+			</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+		$ns->tablerender(FORLAN_62, $text);
+	}
+
+	function show_reported ($sub_action, $id)
+	{
+		global $sql, $rs, $ns, $tp;
+		if ($sub_action) {
+			$sql -> db_Select("generic", "*", "gen_id='".$sub_action."'");
+			$row = $sql -> db_Fetch();
+			$sql -> db_Select("user", "*", "user_id='". $row['gen_user_id']."'");
+			$user = $sql -> db_Fetch();
+			$con = new convert;
+			$text = "<div style='text-align: center'>
+			<table class='fborder' style='".ADMIN_WIDTH."'><tr>
+			<td style='width:40%' class='forumheader3'>
+			".FORLAN_171.":
+			</td>
+			<td style='width:60%' class='forumheader3'>
+			<a href='".e_PLUGIN."forum/forum_viewtopic.php?".$row['gen_intdata'].".post' rel='external'>#".$row['gen_intdata']."</a>
+			</td>
+			</tr>
+			<tr>
+			<td style='width:40%' class='forumheader3'>
+			".FORLAN_173.":
+			</td>
+			<td style='width:60%' class='forumheader3'>
+			".$row['gen_ip']."
+			</td>
+			</tr>
+			<tr>
+			<td style='width:40%' class='forumheader3'>
+			".FORLAN_174.":
+			</td>
+			<td style='width:60%' class='forumheader3'>
+			<a href='".e_BASE."user.php?id.".$user['user_id']."'>".$user['user_name']."</a>
+			</td>
+			</tr>
+			<tr>
+			<td style='width:40%' class='forumheader3'>
+			".FORLAN_175.":
+			</td>
+			<td style='width:60%' class='forumheader3'>
+			".$con -> convert_date($row['gen_datestamp'], "long")."
+			</td>
+			</tr>
+			<tr>
+			<td style='width:40%' class='forumheader3'>
+			".FORLAN_176.":
+			</td>
+			<td style='width:60%' class='forumheader3'>
+			".$row['gen_chardata']."
+			</td>
+			</tr>
+			<tr>
+			<td style='text-align:center' class='forumheader' colspan='2'>
+			".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")."
+			".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)."
+			".$rs->form_close()."
+			</td>
+			</tr>\n";
+			$text .= "</table>";
+			$text .= "</div>";
+			$ns -> tablerender(FORLAN_116, $text);
+		} else {
+			$text = "<div style='text-align: center'>";
+			if ($reported_total = $sql->db_Select("generic", "*", "gen_type='reported_post' OR gen_type='Reported Forum Post'"))
+			{
+				$text .= "<table class='fborder' style='".ADMIN_WIDTH."'>
+					<tr>
+					<td style='width:80%' class='fcaption'>".FORLAN_170."</td>
+					<td style='width:20%; text-align:center' class='fcaption'>".FORLAN_80."</td>
+					</tr>";
+				while ($row = $sql->db_Fetch())
+				{
+					$text .= "<tr>
+						<td style='width:80%' class='forumheader3'><a href='".e_SELF."?sr.".$row['gen_id']."'>".FORLAN_171." #".$row['gen_intdata']."</a></td>
+						<td style='width:20%; text-align:center; vertical-align:top; white-space: nowrap' class='forumheader3'>
+						".$rs->form_open("post", e_SELF."?sr", "", "", "", " onsubmit=\"return confirm_('sr',".$row['gen_datestamp'].")\"")."
+						".$rs->form_button("submit", "delete[reported_{$row['gen_id']}]", FORLAN_172)."
+						".$rs->form_close()."
+						</td>
+						</tr>\n";
+				}
+				$text .= "</table>";
+			}
+			else
+			{
+				$text .= "<div style='text-align:center'>".FORLAN_121."</div>";
+			}
+			$text .= "</div>";
+			$ns->tablerender(FORLAN_116, $text);
+		}
+	}
+
+	function show_prune()
+	{
+		global $ns, $sql;
+
+//		$sql -> db_Select("forum", "forum_id, forum_name", "forum_parent!=0 ORDER BY forum_order ASC");
+		$qry = "
+		SELECT f.forum_id, f.forum_name, sp.forum_name AS sub_parent, fp.forum_name AS forum_parent
+		FROM #forum AS f
+		LEFT JOIN #forum AS sp ON sp.forum_id = f.forum_sub
+		LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent
+		WHERE f.forum_parent != 0
+		ORDER BY f.forum_parent ASC, f.forum_sub, f.forum_order ASC
+		";
+		$sql -> db_Select_gen($qry);
+		$forums = $sql -> db_getList();
+
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='text-align:center' class='forumheader3'>".FORLAN_60."</td>
+			</tr>
+			<tr>
+
+			<td style='text-align:center' class='forumheader3'>".FORLAN_87."
+			<input class='tbox' type='text' name='prune_days' size='6' value='' maxlength='3' />
+			</td>
+			</tr>
+
+			<tr>
+			<td style='text-align:center' class='forumheader3'>".FORLAN_2."<br />
+			".FORLAN_89." <input type='radio' name='prune_type' value='".FORLAN_3."' />&nbsp;&nbsp;&nbsp;
+			".FORLAN_90." <input type='radio' name='prune_type' value='".FORLAN_111."' checked='checked' />
+			</td>
+			</tr>
+
+			<tr>
+			<td class='forumheader3'>".FORLAN_138.": <br />";
+
+			foreach($forums as $forum)
+			{
+				$for_name = $forum['forum_parent']." -> ";
+				$for_name .= ($forum['sub_parent'] ? $forum['sub_parent']." -> " : "");
+				$for_name .= $forum['forum_name'];
+				$text .= "<input type='checkbox' name='pruneForum[]' value='".$forum['forum_id']."' /> ".$for_name."<br />";
+			}
+
+
+			$text .= "<tr>
+			<td colspan='2'  style='text-align:center' class='forumheader'>
+			<input class='button' type='submit' name='do_prune' value='".FORLAN_5."' />
+			</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+		$ns->tablerender(FORLAN_59, $text);
+	}
+
+	function show_levels()
+	{
+		global $sql, $pref, $ns, $rs;
+
+		$rank_names = explode(",", $pref['forum_levels']);
+		$rank_thresholds = ($pref['forum_thresholds'] ? explode(",", $pref['forum_thresholds']) : array(20, 100, 250, 410, 580, 760, 950, 1150, 1370, 1600));
+		$rank_images = ($pref['forum_images'] ? explode(",", $pref['forum_images']) : array("lev1.png", "lev2.png", "lev3.png", "lev4.png", "lev5.png", "lev6.png", "lev7.png", "lev8.png", "lev9.png", "lev10.png"));
+
+		$text = "<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+
+			<tr>
+			<td class='fcaption' style='width:40%'>".FORLAN_98."</td>
+			<td class='fcaption' style='width:20%'>".FORLAN_102."<br /></td>
+			<td class='fcaption' style='width:40%'>".FORLAN_104."<br /></td>
+			</tr>
+
+			<tr>
+			<td class='forumheader3' style='width:40%'>&nbsp;</td>
+			<td class='forumheader3' style='width:20%'><span class='smalltext'>".FORLAN_99."</span></td>
+			<td class='forumheader3' style='width:40%'><span class='smalltext'>".FORLAN_100."</span></td>
+			</tr>";
+
+		$text .= "<tr>
+			<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_main_admin' size='30' value='".($pref['rank_main_admin'] ? $pref['rank_main_admin'] : FORLAN_101)."' maxlength='30' /></td>
+			<td class='forumheader3' style='width:40%'>&nbsp;</td>
+			<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_main_admin_image' size='30' value='".($pref['rank_main_admin_image'] ? $pref['rank_main_admin_image'] : "main_admin.png")."' maxlength='30' /></td>
+			</tr>
+
+			<tr>
+			<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_admin' size='30' value='".($pref['rank_admin'] ? $pref['rank_admin'] : FORLAN_103)."' maxlength='30' /></td>
+			<td class='forumheader3' style='width:40%'>&nbsp;</td>
+			<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_admin_image' size='30' value='".($pref['rank_admin_image'] ? $pref['rank_admin_image'] : "admin.png")."' maxlength='30' /></td>
+			</tr>
+
+			<tr>
+			<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_moderator' size='30' value='".($pref['rank_moderator'] ? $pref['rank_moderator'] : FORLAN_105)."' maxlength='30' /></td>
+			<td class='forumheader3' style='width:40%'>&nbsp;</td>
+			<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_moderator_image' size='30' value='".($pref['rank_moderator_image'] ? $pref['rank_moderator_image'] : "moderator.png")."' maxlength='30' /></td>
+			</tr>";
+
+		for($a = 0; $a <= 9; $a++)
+		{
+			$text .= "<tr>
+				<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_names[]' size='30' value='".($rank_names[$a] ? $rank_names[$a] : "")."' maxlength='30' /></td>
+				<td class='forumheader3' style='width:20%; text-align:center'><input class='tbox' type='text' name='rank_thresholds[]' size='10' value='".$rank_thresholds[$a]."' maxlength='5' /></td>
+				<td class='forumheader3' style='width:40%; text-align:center'><input class='tbox' type='text' name='rank_images[]' size='30' value='".($rank_images[$a] ? $rank_images[$a] : "")."' maxlength='30' /></td>
+				</tr>";
+		}
+
+		$text .= "<tr>
+			<td colspan='3'  style='text-align:center' class='forumheader'>
+			<input class='button' type='submit' name='set_ranks' value='".FORLAN_94."' />
+			</td>
+			</tr>
+			</table>\n</form>\n</div>";
+		$ns->tablerender("Ranks", $text);
+	}
+
+	function show_mods()
+	{
+		global $sql, $ns, $for;
+		$forumList = $for->forum_getforums('list');
+		$subList   = $for->forum_getsubs('bysub');
+		$txt = "<form method='post' action='".e_SELF."?".e_QUERY."'><table class='fborder'><tr><td> &nbsp; </td>";
+		foreach($forumList as $f)
+		{
+			$txt .= "
+			<tr>
+				<td class='forumheader'>{$f['forum_name']}</td>
+				<td class='forumheader'>".r_userclass("mods[{$f['forum_id']}]", $f['forum_moderators'], 'off', 'admin,classes')."</td>
+			</tr>
+			";
+			foreach($subList[$f['forum_id']] as $s)
+			{
+				$txt .= "
+				<tr>
+					<td class='forumheader3'>&nbsp;&nbsp;&nbsp;&nbsp;{$s['forum_name']}</td>
+					<td class='forumheader3'>".r_userclass("mods[{$s['forum_id']}]", $s['forum_moderators'], 'off', 'admin,classes')."</td>
+				</tr>
+				";
+			}
+		}
+		$txt .= "
+		<tr>
+		<td colspan='2' class='fcaption' style='text-align:center'>
+			<input class='button' type='submit' name='setMods' value='".WMGLAN_4." ".FORLAN_33."' />
+		</td>
+		</tr>
+
+		</table></form>";
+		$ns->tablerender(FORLAN_33, $txt);
+	}
+
+	function show_rules()
+	{
+		global $sql, $pref, $ns, $tp;
+
+		$sql->db_Select("wmessage");
+		list($null) = $sql->db_Fetch();
+		list($null) = $sql->db_Fetch();
+		list($null) = $sql->db_Fetch();
+		list($id, $guestrules, $wm_active4) = $sql->db_Fetch();
+		list($id, $memberrules, $wm_active5) = $sql->db_Fetch();
+		list($id, $adminrules, $wm_active6) = $sql->db_Fetch();
+
+		if($sql->db_Select('generic','*',"gen_type='forum_rules_guest'"))
+		{
+			$guest_rules = $sql->db_Fetch();
+		}
+		if($sql->db_Select('generic','*',"gen_type='forum_rules_member'"))
+		{
+			$member_rules = $sql->db_Fetch();
+		}
+		if($sql->db_Select('generic','*',"gen_type='forum_rules_admin'"))
+		{
+			$admin_rules = $sql->db_Fetch();
+		}
+
+		$guesttext = $tp->toFORM($guest_rules['gen_chardata']);
+		$membertext = $tp->toFORM($member_rules['gen_chardata']);
+		$admintext = $tp->toFORM($admin_rules['gen_chardata']);
+
+		$text = "
+			<div style='text-align:center'>
+			<form method='post' action='".e_SELF."?rules'  id='wmform'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>";
+
+		$text .= "
+
+			<td style='width:20%' class='forumheader3'>".WMGLAN_1.": <br />
+			".WMGLAN_6.":";
+		if ($guest_rules['gen_intdata'])
+		{
+			$text .= "<input type='checkbox' name='guest_active' value='1'  checked='checked' />";
+		}
+		else
+		{
+			$text .= "<input type='checkbox' name='guest_active' value='1' />";
+		}
+		$text .= "</td>
+			<td style='width:60%' class='forumheader3'>
+			<textarea class='tbox' name='guestrules' cols='70' rows='10'>$guesttext</textarea>
+			<br />
+			<input class='helpbox' type='text' name='helpguest' size='100' />
+			<br />
+			".ren_help(1, "addtext1", "help1")."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".WMGLAN_2.": <br />
+			".WMGLAN_6.":";
+		if ($member_rules['gen_intdata'])
+		{
+			$text .= "<input type='checkbox' name='member_active' value='1'  checked='checked' />";
+		}
+		else
+		{
+			$text .= "<input type='checkbox' name='member_active' value='1' />";
+		}
+		$text .= "</td>
+			<td style='width:60%' class='forumheader3'>
+			<textarea class='tbox' name='memberrules' cols='70' rows='10'>$membertext</textarea>
+			<br />
+			<input class='helpbox' type='text' name='helpmember' size='100' />
+			<br />
+			".ren_help(1, "addtext2", "help2")."
+			</td>
+			</tr>
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".WMGLAN_3.": <br />
+			".WMGLAN_6.": ";
+
+		if ($admin_rules['gen_intdata'])
+		{
+			$text .= "<input type='checkbox' name='admin_active' value='1'  checked='checked' />";
+		}
+		else
+		{
+			$text .= "<input type='checkbox' name='admin_active' value='1' />";
+		}
+
+		$text .= "</td>
+			<td style='width:60%' class='forumheader3'>
+			<textarea class='tbox' name='adminrules' cols='70' rows='10'>$admintext</textarea>
+			<br />
+			<input class='helpbox' type='text' name='helpadmin' size='100' />
+			<br />
+			".ren_help(1, "addtext3", "help3")."
+			</td>
+			</tr>
+
+			<tr style='vertical-align:top'>
+			<td class='forumheader'>&nbsp;</td>
+			<td style='width:60%' class='forumheader'>
+			<input class='button' type='submit' name='frsubmit' value='".WMGLAN_4."' />
+			</td>
+			</tr>
+			</table>
+			</form>
+			</div>";
+
+		$ns->tablerender(WMGLAN_5, $text);
+
+		echo "
+			<script type=\"text/javascript\">
+			function addtext1(sc){
+			document.getElementById('wmform').guestrules.value += sc;
+			}
+			function addtext2(sc){
+			document.getElementById('wmform').memberrules.value += sc;
+			}
+			function addtext3(sc){
+			document.getElementById('wmform').adminrules.value += sc;
+			}
+			function help1(help){
+			document.getElementById('wmform').helpguest.value = help;
+			}
+			function help2(help){
+			document.getElementById('wmform').helpmember.value = help;
+			}
+			function help3(help){
+			document.getElementById('wmform').helpadmin.value = help;
+			}
+			</script>
+			";
+
+	}
+}
+
+function forum_admin_adminmenu()
+{
+	global $forum;
+	global $action;
+	$forum->show_options($action);
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_class.php 75/e107_plugins/forum/forum_class.php
--- 6171/e107_plugins/forum/forum_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_class.php	2006-05-16 12:29:51.000000000 -0500
@@ -0,0 +1,932 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_class.php,v $
+|     $Revision: 1.52 $
+|     $Date: 2006/05/16 17:29:51 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+class e107forum
+{
+
+	function thread_postnum($thread_id)
+	{
+		global $sql;
+		$ret = array();
+		$ret['parent'] = $thread_id;
+		$query = "
+		SELECT ft.thread_id, fp.thread_id as parent
+		FROM #forum_t AS t
+		LEFT JOIN #forum_t AS ft ON ft.thread_parent = t.thread_parent AND ft.thread_id <= ".intval($thread_id)."
+		LEFT JOIN #forum_t as fp ON fp.thread_id = t.thread_parent
+		WHERE t.thread_id = ".intval($thread_id)." AND t.thread_parent != 0
+		ORDER  BY ft.thread_datestamp ASC
+		";
+		if($ret['post_num'] = $sql->db_Select_gen($query))
+		{
+			$row = $sql->db_Fetch();
+			$ret['parent'] = $row['parent'];
+		}
+		return $ret;
+	}
+
+	function update_lastpost($type, $id, $update_threads = FALSE)
+	{
+		global $sql, $tp;
+		$sql2 = new db;
+		if ($type == 'thread')
+		{
+			$id = intval($id);
+			$thread_info = $this->thread_get_lastpost($id);
+			list($uid, $uname) = explode(".", $thread_info['thread_user'], 2);
+			if ($thread_info)
+			{
+				if($thread_user['user_name'] != "")
+				{
+					$thread_lastuser = $uid.".".$thread_info['user_name'];
+				}
+				else
+				{
+					$tmp = explode(chr(1), $thread_info['thread_user']);
+					$thread_lastuser = $tmp[0];
+				}
+				$sql->db_Update('forum_t', "thread_lastpost = ".intval($thread_info['thread_datestamp']).", thread_lastuser = '".$tp -> toDB($thread_lastuser, true)."' WHERE thread_id = ".intval($id));
+			}
+			return $thread_info;
+		}
+		if ($type == 'forum') {
+			if ($id == 'all')
+			{
+				if ($sql->db_Select('forum', 'forum_id', 'forum_parent != 0'))
+				{
+					while ($row = $sql->db_Fetch())
+					{
+						$parentList[] = $row['forum_id'];
+					}
+					foreach($parentList as $id)
+					{
+						//	echo "Updating forum #{$id}<br />";
+						$this->update_lastpost('forum', $id, $update_threads);
+					}
+				}
+			}
+			else
+			{
+				$id = intval($id);
+				$forum_lpinfo = "";
+				if($update_threads == TRUE)
+				{
+					if ($sql2->db_Select('forum_t', 'thread_id', "thread_forum_id = $id AND thread_parent = 0"))
+					{
+						while ($row = $sql2->db_Fetch())
+						{
+							$this->update_lastpost('thread', $row['thread_id']);
+						}
+					}
+				}
+				if ($sql->db_Select("forum_t", "*", "thread_forum_id='$id' ORDER BY thread_datestamp DESC LIMIT 0,1"))
+				{
+					$row = $sql->db_Fetch();
+					$tmp = explode(chr(1), $row['thread_user']);
+					$forum_lp_user = $tmp[0];
+					$last_id = $row['thread_parent'] ? $row['thread_parent'] : $row['thread_id'];
+					$forum_lp_info = $row['thread_datestamp'].".".$last_id;
+					$sql->db_Update('forum', "forum_lastpost_user = '{$forum_lp_user}', forum_lastpost_info = '{$forum_lp_info}' WHERE forum_id={$id}");
+				}
+			}
+		}
+	}
+
+	function forum_markasread($forum_id) {
+		global $sql;
+		if ($forum_id != 'all') {
+			$forum_id = intval($forum_id);
+			$extra = " AND thread_forum_id='$forum_id' ";
+		}
+		$qry = "thread_lastpost > ".USERLV." AND thread_parent = 0 {$extra} ";
+		if ($sql->db_Select('forum_t', 'thread_id', $qry)) {
+			while ($row = $sql->db_Fetch()) {
+				$u_new .= ".".$row['thread_id'].".";
+			}
+			$u_new .= USERVIEWED;
+			$sql->db_Update("user", "user_viewed='$u_new' WHERE user_id='".USERID."' ");
+			header("location:".e_SELF);
+			exit;
+		}
+	}
+
+	function thread_markasread($thread_id)
+	{
+		global $sql;
+		$thread_id = intval($thread_id);
+		$u_new = USERVIEWED.".$thread_id";
+		return $sql->db_Update("user", "user_viewed='$u_new' WHERE user_id='".USERID."' ");
+	}
+
+	function forum_getparents()
+	{
+		global $sql;
+		if ($sql->db_Select('forum', '*', "forum_parent='0' ORDER BY forum_order ASC"))
+		{
+			while ($row = $sql->db_Fetch()) {
+				$ret[] = $row;
+			}
+			return $ret;
+		}
+		return FALSE;
+	}
+
+	function forum_getmods($uclass)
+	{
+		global $sql;
+		if($uclass == e_UC_ADMIN)
+		{
+			$sql->db_Select('user', 'user_id, user_name',"user_admin = 1");
+		}
+		else
+		{
+			$regex = "(^|,)(".str_replace(",", "|", $uclass).")(,|$)";
+			$sql->db_Select("user", "user_id, user_name", "user_class REGEXP '{$regex}'");
+		}
+		while($row = $sql->db_Fetch())
+		{
+			$ret[$row['user_id']] = $row['user_name'];
+		}
+		return $ret;
+	}
+
+	function forum_getforums($type = 'all')
+	{
+		global $sql;
+		$qry = "
+		SELECT f.*, u.user_name FROM #forum AS f
+		LEFT JOIN #user AS u ON FLOOR(f.forum_lastpost_user) = u.user_id
+		WHERE forum_parent != 0 AND forum_sub = 0
+		ORDER BY f.forum_order ASC
+		";
+		if ($sql->db_Select_gen($qry))
+		{
+			while ($row = $sql->db_Fetch())
+			{
+				if($type == 'all')
+				{
+					$ret[$row['forum_parent']][] = $row;
+				}
+				else
+				{
+					$ret[] = $row;
+				}
+			}
+			return $ret;
+		}
+		return FALSE;
+	}
+
+	function forum_getsubs($forum_id = "")
+	{
+		global $sql;
+		$where = ($forum_id != "" && $forum_id != 'bysub' ? "AND forum_sub = ".intval($forum_id) : "");
+		$qry = "
+		SELECT f.*, u.user_name FROM #forum AS f
+		LEFT JOIN #user AS u ON FLOOR(f.forum_lastpost_user) = u.user_id
+		WHERE forum_sub != 0 {$where}
+		ORDER BY f.forum_order ASC
+		";
+		if ($sql->db_Select_gen($qry))
+		{
+			while ($row = $sql->db_Fetch())
+			{
+				if($forum_id == "")
+				{
+					$ret[$row['forum_parent']][$row['forum_sub']][] = $row;
+				}
+				elseif($forum_id == 'bysub')
+				{
+					$ret[$row['forum_sub']][] = $row;
+				}
+				else
+				{
+					$ret[] = $row;
+				}
+			}
+			return $ret;
+		}
+		return FALSE;
+	}
+
+
+	function forum_newflag_list()
+	{
+		global $sql;
+		$viewed = "";
+		if(USERVIEWED)
+		{
+			$viewed = preg_replace("#\.+#", ".", USERVIEWED);
+			$viewed = preg_replace("#^\.#", "", $viewed);
+			$viewed = preg_replace("#\.$#", "", $viewed);
+			$viewed = str_replace(".", ",", $viewed);
+		}
+		if($viewed != "")
+		{
+			$viewed = " AND thread_id NOT IN (".$viewed.")";
+		}
+
+		$_newqry = 	"
+		SELECT DISTINCT ff.forum_sub, ft.thread_forum_id FROM #forum_t AS ft
+		LEFT JOIN #forum AS ff ON ft.thread_forum_id = ff.forum_id
+		WHERE thread_parent = 0 AND thread_lastpost > '".USERLV."' {$viewed}
+		";
+		if($sql->db_Select_gen($_newqry))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				$ret[] = $row['thread_forum_id'];
+				if($row['forum_sub'])
+				{
+					$ret[] = $row['forum_sub'];
+				}
+			}
+			return $ret;
+		}
+		else
+		{
+			return FALSE;
+		}
+	}
+
+	function thread_user($post_info)
+	{
+		if($post_info['user_name'])
+		{
+			return $post_info['user_name'];
+		}
+		else
+		{
+			$tmp = explode(".", $post_info['thread_user'], 2);
+			return $tmp[1];
+		}
+	}
+
+	function untrack($thread_id, $from)
+	{
+		$thread_id = intval($thread_id);
+		global $sql;
+		$tmp = str_replace("-".$thread_id."-", "", USERREALM);
+		return $sql->db_Update("user", "user_realm='$tmp' WHERE user_id='".USERID."' ");
+	}
+
+	function track($thread_id, $from)
+	{
+		$thread_id = intval($thread_id);
+		global $sql;
+		return $sql->db_Update("user", "user_realm='".USERREALM."-".$thread_id."-' WHERE user_id='".USERID."' ");
+	}
+
+	function forum_get($forum_id)
+	{
+		$forum_id = intval($forum_id);
+		$qry = "
+		SELECT f.*, fp.forum_class as parent_class, fp.forum_name as parent_name, fp.forum_id as parent_id, fp.forum_postclass as parent_postclass, sp.forum_name AS sub_parent FROM #forum AS f
+		LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent
+		LEFT JOIN #forum AS sp ON f.forum_sub = sp.forum_id AND f.forum_sub > 0
+		WHERE f.forum_id = {$forum_id}
+		";
+		global $sql;
+		if ($sql->db_Select_gen($qry))
+		{
+			return $sql->db_Fetch();
+		}
+		return FALSE;
+	}
+
+	function forum_get_allowed()
+	{
+		global $sql;
+		$qry = "
+		SELECT f.forum_id, f.forum_name FROM #forum AS f
+		LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent
+		WHERE f.forum_parent != 0
+		AND fp.forum_class IN (".USERCLASS_LIST.")
+		AND f.forum_class IN (".USERCLASS_LIST.")
+		";
+		if ($sql->db_Select_gen($qry))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				$ret[$row['forum_id']] = $row['forum_name'];
+			}
+		
+		}
+		return $ret;
+	}
+	
+	function thread_update($thread_id, $newvals)
+	{
+		global $sql, $tp;
+		foreach($newvals as $var => $val)
+		{
+			$var = $tp -> toDB($var);
+			$val = $tp -> toDB($val);
+			$newvalArray[] = "{$var} = '{$val}'";
+		}
+		$newString = implode(', ', $newvalArray)." WHERE thread_id=".intval($thread_id);
+		return $sql->db_Update('forum_t', $newString);
+	}
+
+	function forum_get_topics($forum_id, $from, $view)
+	{
+		$forum_id = intval($forum_id);
+		global $sql;
+		$qry = "
+		SELECT t.*, u.user_name, lpu.user_name AS lastpost_username from #forum_t as t
+		LEFT JOIN #user AS u ON FLOOR(t.thread_user) = u.user_id
+		LEFT JOIN #user AS lpu ON FLOOR(t.thread_lastuser) = lpu.user_id
+		WHERE t.thread_forum_id = $forum_id AND t.thread_parent = 0
+		ORDER BY
+		t.thread_s DESC,
+		t.thread_lastpost DESC,
+		t.thread_datestamp DESC
+		LIMIT ".intval($from).",".intval($view)."
+		";
+		$ret = array();
+		if ($sql->db_Select_gen($qry))
+		{
+			while ($row = $sql->db_Fetch())
+			{
+				$ret[] = $row;
+			}
+		}
+		return $ret;
+	}
+
+	function thread_get_lastpost($forum_id)
+	{
+		$forum_id = intval($forum_id);
+		global $sql;
+		if ($sql->db_Count('forum_t', '(*)', "WHERE thread_parent = {$forum_id} "))
+		{
+			$where = "WHERE t.thread_parent = $forum_id ";
+		}
+		else
+		{
+			$where = "WHERE t.thread_id = $forum_id ";
+		}
+		$qry = "
+		SELECT t.thread_user, t.thread_datestamp, u.user_name FROM #forum_t AS t
+		LEFT JOIN #user AS u ON FLOOR(t.thread_user) = u.user_id
+		{$where}
+		ORDER BY t.thread_datestamp DESC	LIMIT 0,1
+		";
+		if ($sql->db_Select_gen($qry))
+		{
+			return $sql->db_Fetch();
+		}
+		return FALSE;
+	}
+
+	function forum_get_topic_count($forum_id)
+	{
+		global $sql;
+		return $sql->db_Count("forum_t", "(*)", " WHERE thread_forum_id='".intval($forum_id)."' AND thread_parent='0' ");
+	}
+
+	function thread_getnext($thread_id, $forum_id, $from = 0, $limit = 100)
+	{
+		global $sql;
+		$forum_id = intval($forum_id);
+		global $sql;
+		$ftab = MPREFIX.'forum_t';
+		while (!$found)
+		{
+			$qry = "
+			SELECT t.thread_id from #forum_t AS t
+			WHERE t.thread_forum_id = $forum_id
+			AND t.thread_parent = 0
+			ORDER BY
+			t.thread_s DESC,
+			t.thread_lastpost DESC,
+			t.thread_datestamp DESC
+			LIMIT ".intval($from).",".intval($limit);
+			if ($sql->db_Select_gen($qry))
+			{
+				$i = 0;
+				while ($row = $sql->db_Fetch())
+				{
+					$threadList[$i++] = $row['thread_id'];
+				}
+
+				if (($id = array_search($thread_id, $threadList)) !== FALSE)
+				{
+					if ($id != 99)
+					{
+						return $threadList[$id+1];
+					}
+					else
+					{
+						return $this->thread_getnext($thread_id, $forum_id, $from+99, 2);
+					}
+				}
+			}
+			else
+			{
+				return FALSE;
+			}
+			$from += 100;
+		}
+	}
+
+	function thread_getprev($thread_id, $forum_id, $from = 0, $limit = 100)
+	{
+		global $sql;
+		$forum_id = intval($forum_id);
+		global $sql;
+		$ftab = MPREFIX.'forum_t';
+		while (!$found)
+		{
+			$qry = "
+			SELECT t.thread_id from #forum_t AS t
+			WHERE t.thread_forum_id = $forum_id
+			AND t.thread_parent = 0
+			ORDER BY
+			t.thread_s DESC,
+			t.thread_lastpost DESC,
+			t.thread_datestamp DESC
+			LIMIT ".intval($from).",".intval($limit);
+			if ($sql->db_Select_gen($qry))
+			{
+				$i = 0;
+				while ($row = $sql->db_Fetch())
+				{
+					$threadList[$i++] = $row['thread_id'];
+				}
+
+				if (($id = array_search($thread_id, $threadList)) !== FALSE)
+				{
+					if ($id != 0)
+					{
+						return $threadList[$id-1];
+					}
+					else
+					{
+						if ($from == 0)
+						{
+							return FALSE;
+						}
+						return $this->thread_getprev($thread_id, $forum_id, $from-1, 2);
+					}
+				}
+			}
+			else
+			{
+				return FALSE;
+			}
+			$from += 100;
+		}
+	}
+
+	function thread_get($thread_id, $start = 0, $limit = 10)
+	{
+		$thread_id = intval($thread_id);
+		global $sql;
+		$ftab = MPREFIX.'forum_t';
+		$utab = MPREFIX.'user';
+
+		if ($start === "last")
+		{
+			$tcount = $this->thread_count($thread_id);
+			$start = max(0, $tcount-$limit);
+		}
+		$start = max(0, $start);
+		if ($start != 0)
+		{
+			$array_start = 0;
+		}
+		else
+		{
+			$limit--;
+			$array_start = 1;
+		}
+		$sortdir = "ASC";
+
+		$qry = "
+		SELECT t.*, u.* FROM #forum_t as t
+		LEFT JOIN #user AS u
+		ON FLOOR(t.thread_user) = u.user_id
+		WHERE t.thread_parent = $thread_id
+		ORDER by t.thread_datestamp {$sortdir}
+		LIMIT ".intval($start).",".intval($limit);
+		$ret = array();
+		if ($sql->db_Select_gen($qry))
+		{
+			$i = $array_start;
+			while ($row = $sql->db_Fetch())
+			{
+				$ret[$i] = $row;
+				$i++;
+			}
+		}
+		$qry = "
+		SELECT t.*,u.* from #forum_t AS t
+		LEFT JOIN #user AS u
+		ON FLOOR(t.thread_user) = u.user_id
+		WHERE t.thread_id = $thread_id
+		LIMIT 0,1
+		";
+		if ($sql->db_Select_gen($qry))
+		{
+			$row = $sql->db_Fetch();
+			$ret['head'] = $row;
+			if (!array_key_exists(0, $ret))
+			{
+				$ret[0] = $row;
+			}
+		}
+		return $ret;
+	}
+
+	function thread_count($thread_id)
+	{
+		$thread_id = intval($thread_id);
+		global $sql;
+		return $sql->db_Count('forum_t', '(*)', "WHERE thread_parent = $thread_id")+1;
+	}
+
+	function thread_count_list($thread_list)
+	{
+		global $sql, $tp;
+		$qry = "
+		SELECT t.thread_parent, t.COUNT(*) as thread_replies
+		FROM #forum_t AS t
+		WHERE t.thread_parent
+		IN ".$tp -> toDB($thread_list, true)."
+		GROUP BY t.thread_parent
+		";
+		if ($sql->db_Select_gen($qry))
+		{
+			while ($row = $sql->db_Fetch())
+			{
+				$ret[$row['thread_parent']] = $row['thread_replies'];
+			}
+		}
+		return $ret;
+	}
+
+	function thread_incview($thread_id)
+	{
+		$thread_id = intval($thread_id);
+		global $sql;
+		return $sql->db_Update("forum_t", "thread_views=thread_views+1 WHERE thread_id='$thread_id' ");
+	}
+
+
+	function thread_get_postinfo($thread_id, $head = FALSE)
+	{
+		$thread_id = intval($thread_id);
+		global $sql;
+		$ret = array();
+		$qry = "
+		SELECT t.*, u.user_name, u.user_id, u.user_email from #forum_t AS t
+		LEFT JOIN #user AS u
+		ON FLOOR(t.thread_user) = u.user_id
+		WHERE t.thread_id = $thread_id
+		LIMIT 0,1
+		";
+		if ($sql->db_Select_gen($qry))
+		{
+			$ret[0] = $sql->db_Fetch();
+		}
+		else
+		{
+			return FALSE;
+		}
+		if ($head == FALSE)
+		{
+			return $ret;
+		}
+		$parent_id = $ret[0]['thread_parent'];
+		if ($parent_id == 0)
+		{
+			$ret['head'] = $ret[0];
+		}
+		else
+		{
+			$qry = "
+			SELECT t.*, u.user_name, u.user_id from #forum_t AS t
+			LEFT JOIN #user AS u
+			ON FLOOR(t.thread_user) = u.user_id
+			WHERE t.thread_id = ".intval($parent_id)."
+			LIMIT 0,1
+			";
+			if ($sql->db_Select_gen($qry))
+			{
+				$row = $sql->db_Fetch();
+				$ret['head'] = $row;
+			}
+		}
+		return $ret;
+	}
+
+
+	function _forum_lp_update($lp_type, $lp_user, $lp_info, $lp_forum_id, $lp_forum_sub)
+	{
+		global $sql;
+		$sql->db_Update('forum', "{$lp_type}={$lp_type}+1, forum_lastpost_user='{$lp_user}', forum_lastpost_info = '{$lp_info}' WHERE forum_id='".intval($lp_forum_id)."' ");
+		if($lp_forum_sub)
+		{
+			$sql->db_Update('forum', "forum_lastpost_user = '{$lp_user}', forum_lastpost_info = '{$lp_info}' WHERE forum_id='".intval($lp_forum_sub)."' ");
+		}
+	}
+
+	function thread_insert($thread_name, $thread_thread, $thread_forum_id, $thread_parent, $thread_poster, $thread_active, $thread_s, $forum_sub)
+	{
+		$post_time = time();
+		global $sql, $tp, $pref, $e107;
+		$forum_sub = intval($forum_sub);
+		$ip = $e107->getip();
+		//Check for duplicate post
+		if ($sql->db_Count('forum_t', '(*)', "WHERE thread_thread='$thread_thread' and thread_datestamp > ".($post_time - 180)))
+		{
+			return -1;
+		}
+		
+		$post_user = $thread_poster['post_userid'].".".$thread_poster['post_user_name'];
+		$thread_post_user = $post_user;
+		if($thread_poster['post_userid'] == 0)
+		{
+			$thread_post_user = $post_user.chr(1).$ip;
+		}
+
+		$post_last_user = ($thread_parent ? "" : $post_user);
+		$vals = "'0', '{$thread_name}', '{$thread_thread}', '".intval($thread_forum_id)."', '".intval($post_time)."', '".intval($thread_parent)."', '{$thread_post_user}', '0', '".intval($thread_active)."', '$post_time', '$thread_s', '0', '{$post_last_user}', '0'";
+		$newthread_id = $sql->db_Insert('forum_t', $vals);
+		if(!$newthread_id)
+		{
+			echo "thread creation failed! <br />
+			Values sent were: ".htmlentities($vals)."<br /><br />Please save these values for dev team for troubleshooting.";
+			exit;
+		}
+
+		// Increment user thread count and set user as viewed this thread
+		if (USER)
+		{
+			$new_userviewed = USERVIEWED.".".($thread_parent ? intval($thread_parent) : $newthread_id);
+			$sql->db_Update('user', "user_forums=user_forums+1, user_viewed='{$new_userviewed}' WHERE user_id='".USERID."' ");
+		}
+
+		//If post is a reply
+		if ($thread_parent)
+		{
+			$forum_lp_info = $post_time.".".intval($thread_parent);
+			$gen = new convert;
+			// Update main forum with last post info and increment reply count
+			$this->_forum_lp_update("forum_replies", $post_user, $forum_lp_info, $thread_forum_id, $forum_sub);
+
+			// Update head post with last post info and increment reply count
+			$sql->db_Update('forum_t', "thread_lastpost={$post_time}, thread_lastuser='{$post_user}', thread_total_replies=thread_total_replies+1 WHERE thread_id = ".intval($thread_parent));
+
+			$parent_thread = $this->thread_get_postinfo($thread_parent);
+			global $PLUGINS_DIRECTORY;
+			$thread_name = $tp->toText($parent_thread[0]['thread_name']);
+			$datestamp = $gen->convert_date($post_time, "long");
+			$email_post = $tp->toHTML($thread_thread, TRUE);
+			$mail_link = "<a href='".SITEURL.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$thread_parent.".last'>".SITEURL.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$thread_parent.".last</a>";
+			if(!isset($pref['forum_eprefix']))
+			{
+				$pref['forum_eprefix'] = "[forum]";
+			}
+			//   Send email to orinator of flagged
+			if ($parent_thread[0]['thread_active'] == 99 && $parent_thread[0]['user_id'] != USERID)
+			{
+				$gen = new convert;
+				$email_name = $parent_thread[0]['user_name'];
+				$message = LAN_384.SITENAME.".<br /><br />". LAN_382.$datestamp."<br />". LAN_94.": ".$thread_poster['post_user_name']."<br /><br />". LAN_385.$email_post."<br /><br />". LAN_383."<br /><br />".$mail_link;
+				include_once(e_HANDLER."mail.php");
+				sendemail($parent_thread[0]['user_email'], $pref['forum_eprefix']." '".$thread_name."', ".LAN_381.SITENAME, $message);
+			}
+
+			//   Send email to all users tracking thread
+			if ($sql->db_Select("user", "*", "user_realm REGEXP('-".intval($thread_parent)."-') "))
+			{
+				include_once(e_HANDLER.'mail.php');
+				$message = LAN_385.SITENAME.".<br /><br />". LAN_382.$datestamp."<br />". LAN_94.": ".$thread_poster['post_user_name']."<br /><br />". LAN_385.$email_post."<br /><br />". LAN_383."<br /><br />".$mail_link;
+				while ($row = $sql->db_Fetch())
+				{
+					if ($row['user_email'])
+					{
+						sendemail($row['user_email'], $pref['forum_eprefix']." '".$thread_name."', ".LAN_381.SITENAME, $message);
+					}
+				}
+			}
+		}
+		else
+		{
+			//post is a new thread
+			$forum_lp_info = $post_time.".".$newthread_id;
+			$this->_forum_lp_update("forum_threads", $post_user, $forum_lp_info, $thread_forum_id, $forum_sub);
+		}
+		return $newthread_id;
+	}
+
+	function post_getnew($count = 50, $userviewed = USERVIEWED)
+	{
+		global $sql;
+		$viewed = "";
+		if($userviewed)
+		{
+			$viewed = preg_replace("#\.+#", ".", $userviewed);
+			$viewed = preg_replace("#^\.#", "", $viewed);
+			$viewed = preg_replace("#\.$#", "", $viewed);
+			$viewed = str_replace(".", ",", $viewed);
+		}
+		if($viewed != "")
+		{
+			$viewed = " AND ft.thread_id NOT IN (".$viewed.")";
+		}
+
+		$qry = "
+		SELECT ft.*, fp.thread_name as post_subject, fp.thread_total_replies as replies, u.user_id, u.user_name, f.forum_class
+		FROM #forum_t AS ft
+		LEFT JOIN #forum_t as fp ON fp.thread_id = ft.thread_parent
+		LEFT JOIN #user as u ON u.user_id = FLOOR(ft.thread_user) 
+		LEFT JOIN #forum as f ON f.forum_id = ft.thread_forum_id
+		WHERE ft.thread_datestamp > ".USERLV. "
+		AND f.forum_class IN (".USERCLASS_LIST.")
+		{$viewed}
+		ORDER BY ft.thread_datestamp DESC LIMIT 0, ".intval($count);
+		if($sql->db_Select_gen($qry))
+		{
+			$ret = $sql->db_getList();
+		}
+		return $ret;
+	}
+
+	function forum_prune($type, $days, $forumArray)
+	{
+		global $sql;
+		$prunedate = time() - (intval($days) * 86400);
+		$forumList = implode(",", $forumArray);
+
+		if($type == 'delete')
+		{
+			//Get list of threads to prune
+			if ($sql->db_Select("forum_t", "thread_id", "thread_lastpost < $prunedate AND thread_parent=0 AND thread_s != 1 AND thread_forum_id IN ({$forumList})"))
+			{
+				$threadList = $sql->db_getList();
+				foreach($threadList as $thread)
+				{
+					//Delete all replies
+					$reply_count += $sql->db_Delete("forum_t", "thread_parent='".intval($thread['thread_id'])."'");
+					//Delete thread
+					$thread_count += $sql->db_Delete("forum_t", "thread_id = '".intval($thread['thread_id'])."'");
+					//Delete poll if there is one
+					$sql->db_Delete("poll", "poll_datestamp='".intval($thread['thread_id'])."");
+				}
+				foreach($forumArray as $fid)
+				{
+					$this->update_lastpost('forum', $fid);
+					$this->forum_update_counts($fid);
+				}
+				return FORLAN_8." ( ".$thread_count." ".FORLAN_92.", ".$reply_count." ".FORLAN_93." )";
+			}
+			else
+			{
+				return FORLAN_9;
+			}
+		}
+		else
+		{
+			$pruned = $sql->db_Update("forum_t", "thread_active=0 WHERE thread_lastpost < $prunedate AND thread_parent=0 AND thread_forum_id IN ({$forumList})");
+			return FORLAN_8." ".$pruned." ".FORLAN_91;
+		}
+	}
+
+	function forum_update_counts($forumID)
+	{
+		global $sql;
+		if($forumID == 'all')
+		{
+			$sql->db_Select('forum', 'forum_id', 'forum_parent != 0');
+			$flist = $sql->db_getList();
+			foreach($flist as $f)
+			{
+				$this->forum_update_counts($f['forum_id']);
+			}
+			return;
+		}
+		$forumID = intval($forumID);
+		$threads = $sql->db_Count("forum_t", "(*)", "WHERE thread_forum_id=$forumID AND thread_parent = 0");
+		$replies = $sql->db_Count("forum_t", "(*)", "WHERE thread_forum_id=$forumID AND thread_parent != 0");
+		$sql->db_Update("forum", "forum_threads='$threads', forum_replies='$replies' WHERE forum_id='$forumID'");
+	}
+	
+	function get_user_counts()
+	{
+		global $sql;
+		$qry = "
+		SELECT u.user_id AS uid, count(t.thread_user) AS cnt FROM #forum_t AS t
+		LEFT JOIN #user AS u on FLOOR(t.thread_user) = u.user_id
+		WHERE u.user_id > 0
+		GROUP BY uid
+		";
+
+		if($sql->db_Select_gen($qry))
+		{
+			$ret = array();
+			while($row = $sql->db_Fetch())
+			{
+				$ret[$row['uid']] = $row['cnt'];	
+			}
+			return $ret;
+		}
+		return FALSE;
+	}
+}
+
+
+/**
+* @return string path to and filename of forum icon image
+*
+* @param string $filename  filename of forum image
+* @param string $eMLANG_folder if specified, indicates its a multilanguage image being processed and
+*       gives the subfolder of the image path to the eMLANG_path() function,
+*       default = FALSE
+* @param string $eMLANG_pref  if specified, indicates that $filename may be overridden by the
+*       $pref with $eMLANG_pref as its key if that pref is TRUE, default = FALSE
+*
+* @desc checks for the existence of a forum icon image in the themes forum folder and if it is found
+*  returns the path and filename of that file, otherwise it returns the path and filename of the
+*  default forum icon image in e_IMAGES. The additional $eMLANG args if specfied switch the process
+*  to the sister multi-language function eMLANG_path().
+*
+* @access public
+*/
+function img_path($filename, $eMLANG_folder = FALSE, $eMLANG_pref = FALSE)
+{
+	global $pref;
+	if ($eMLANG_folder)
+	{
+		return eMLANG_path($filename, $eMLANG_folder);
+	}
+	else
+	{
+		if(file_exists(THEME.'forum/'.$filename))
+		{
+			$image = THEME.'forum/'.$filename;
+		}
+		else
+		{
+			if(defined("IMODE"))
+			{
+				$image = e_PLUGIN."forum/images/".IMODE."/".$filename;
+			}
+			else
+			{
+				$image = e_PLUGIN."forum/images/lite/".$filename;
+			}
+		}
+	}
+	return $image;
+}
+
+function eMLANG_path($file_name, $sub_folder)
+{
+	if (file_exists(THEME.$sub_folder."/".e_LANGUAGE."/".$file_name))
+	{
+		return THEME.$sub_folder."/".e_LANGUAGE."/".$file_name;
+	}
+	if (file_exists(THEME.$sub_folder."/".$file_name))
+	{
+		return THEME.$sub_folder."/".$file_name;
+	}
+	if (file_exists(e_IMAGE.$sub_folder."/".e_LANGUAGE."/".$file_name))
+	{
+		return e_IMAGE.$sub_folder."/".e_LANGUAGE."/".$file_name;
+	}
+	return e_PLUGIN.$sub_folder."/images/".$file_name;
+}
+
+if (file_exists(THEME.'forum/forum_icons_template.php'))
+{
+	require_once(THEME.'forum/forum_icons_template.php');
+}
+else if (file_exists(THEME.'forum_icons_template.php'))
+{
+	require_once(THEME.'forum_icons_template.php');
+}
+else
+{
+	require_once(e_PLUGIN.'forum/templates/forum_icons_template.php');
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_conf.php 75/e107_plugins/forum/forum_conf.php
--- 6171/e107_plugins/forum/forum_conf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_conf.php	2006-04-26 06:38:30.000000000 -0500
@@ -0,0 +1,191 @@
+<?php
+/*
++---------------------------------------------------------------+
+| e107 website system
+|
+| Steve Dunstan 2001-2002
+| http://e107.org
+| jalist@e107.org
+|
+| Released under the terms and conditions of the
+| GNU General Public License (http://gnu.org).
+|
+| $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_conf.php,v $
+| $Revision: 1.9 $
+| $Date: 2006/04/26 11:38:30 $
+| $Author: mcfly_e107 $
++---------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+@include_once e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_conf.php';
+@include_once e_PLUGIN.'forum/languages/English/lan_forum_conf.php';
+
+$e_sub_cat = 'forum';
+	
+$qs = explode(".", e_QUERY);
+$action = $qs[0];
+$thread_id = intval($qs[1]);
+
+$qry = "
+SELECT t.*, f.*, fp.forum_id AS forum_parent_id FROM #forum_t as t
+LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id
+LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent
+WHERE t.thread_id = {$thread_id}
+";
+
+if($sql->db_Select_gen($qry))
+{
+	$info=$sql->db_Fetch();
+	if(!check_class($info['forum_moderators']))
+	{
+		header("location:".e_BASE."index.php");
+		exit;
+	}
+}
+else
+{
+	header("location:".e_BASE."index.php");
+	exit;
+}
+
+require_once(HEADERF);
+
+if (isset($_POST['deletepollconfirm'])) {
+	$sql->db_Delete("poll", "poll_id='".intval($thread_parent)."' ");
+	$sql->db_Select("forum_t", "*", "thread_id='".$thread_id."' ");
+	$row = $sql->db_Fetch();
+	 extract($row);
+	$thread_name = str_replace("[poll] ", "", $thread_name);
+	$sql->db_Update("forum_t", "thread_name='$thread_name' WHERE thread_id='$thread_id' ");
+	$message = FORLAN_5;
+	$url = e_PLUGIN."forum/forum_viewtopic.php?".$forum_id.".".$thread_id;
+}
+	
+if (isset($_POST['move']))
+{
+	require_once(e_PLUGIN."forum/forum_class.php");
+	$forum = new e107forum;
+	$new_forum = intval($_POST['forum_move']);
+	$replies = $sql->db_Select("forum_t", "*", "thread_parent='$thread_id' ");
+	$sql->db_Select("forum_t", "thread_name, thread_forum_id", "thread_id ='".$thread_id."' ");
+	$row = $sql->db_Fetch();
+	$old_forum = $row['thread_forum_id'];
+	$new_thread_name = $row['thread_name'];
+
+	if($_POST['rename_thread'] == 'add')
+	{
+		$new_thread_name = "[".FORLAN_27."] ".$new_thread_name;
+	}
+	elseif($_POST['rename_thread'] == 'rename' && trim($_POST['newtitle']) != "")
+	{
+		$new_thread_name = $tp->toDB($_POST['newtitle']);
+	}
+
+	$sql->db_Update("forum_t", "thread_forum_id='$new_forum', thread_name='{$new_thread_name}' WHERE thread_id='$thread_id' ");
+	$sql->db_Update("forum_t", "thread_forum_id='$new_forum' WHERE thread_parent='$thread_id' ");
+	$sql->db_Update("forum", "forum_threads=forum_threads-1, forum_replies=forum_replies-$replies WHERE forum_id='$old_forum' ");
+	$sql->db_Update("forum", "forum_threads=forum_threads+1, forum_replies=forum_replies+$replies WHERE forum_id='$new_forum' ");
+	 
+	// update lastposts
+
+	$forum->update_lastpost('forum', $old_forum, FALSE);
+	$forum->update_lastpost('forum', $new_forum, FALSE);
+	 
+	$message = FORLAN_9;
+	$url = e_PLUGIN."forum/forum_viewforum.php?".$new_forum;
+}
+	
+if (isset($_POST['movecancel']))
+{
+	$message = FORLAN_10;
+	$url = e_PLUGIN."forum/forum_viewforum.php?".$info['forum_id'];
+}
+	
+if ($message)
+{
+	$text = "<div style='text-align:center'>".$message."
+		<br />
+		<a href='$url'>".FORLAN_11."</a>
+		</div>";
+	$ns->tablerender(FORLAN_12, $text);
+	require_once(FOOTERF);
+	exit;
+}
+	
+if ($action == "delete_poll")
+{
+	$text = "<div style='text-align:center'>
+		".FORLAN_13."
+		<br /><br />
+		<form method='post' action='".e_SELF."?".e_QUERY."'>
+		<input class='button' type='submit' name='deletecancel' value='".FORLAN_14."' />
+		<input class='button' type='submit' name='deletepollconfirm' value='".FORLAN_15."' />
+		</form>
+		</div>";
+	$ns->tablerender(FORLAN_16, $text);
+	require_once("footer.php");
+	exit;
+}
+	
+if ($action == "move")
+{
+	$text = "
+		<form method='post' action='".e_SELF."?".e_QUERY."'>
+		<div style='text-align:center'>
+		<table style='".ADMIN_WIDTH."'>
+		<tr>
+		<td style='text-align:right'>".FORLAN_24.": </td>
+		<td style='text-align:left'>
+		<select name='forum_move' class='tbox'>";
+	$qry = "
+	SELECT f.forum_id, f.forum_name, fp.forum_name AS forum_parent, sp.forum_name AS sub_parent
+	FROM #forum AS f
+	LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
+	LEFT JOIN #forum AS sp ON f.forum_sub = sp.forum_id
+	WHERE f.forum_parent != 0
+	AND f.forum_id != ".intval($info['forum_id'])."	
+	AND f.forum_class IN (".USERCLASS_LIST.")
+	AND fp.forum_class IN (".USERCLASS_LIST.")
+	ORDER BY f.forum_parent ASC, f.forum_sub, f.forum_order ASC
+	";
+	$sql->db_Select_gen($qry);
+	$fList = $sql->db_getList();
+
+	foreach($fList as $f)
+	{
+		if($f['forum_sub'] > 0)
+		{
+			$f['forum_name'] = "subforum -> ".$f['forum_name'];
+		}
+		$for_name = $f['forum_parent']." -> ";
+		$for_name .= ($f['sub_parent'] ? $f['sub_parent']." -> " : "");
+		$for_name .= $f['forum_name'];
+
+		$text .= "<option value='{$f['forum_id']}'>".$for_name."</option>";
+	}
+	$text .= "</select>
+		</td>
+		</tr>
+		<tr>
+		<td colspan='2'><br />
+		<b>".FORLAN_32."</b><br />
+		<input type='radio' name='rename_thread' checked='checked' value='none' /> ".FORLAN_28."<br />
+		<input type='radio' name='rename_thread' value='add' /> ".FORLAN_29." [".FORLAN_27."] ".FORLAN_30."<br />
+		<input type='radio' name='rename_thread' value='rename' /> ".FORLAN_31." <input type='text' class='tbox' name='newtitle' size='60' maxlength='250' value='".$tp->toForm($info['thread_name'])."'/>
+		</td>
+		</tr>
+		<tr style='vertical-align: top;'>
+		<td colspan='2'  style='text-align:center'><br />
+		<input class='button' type='submit' name='move' value='".FORLAN_25."' />
+		<input class='button' type='submit' name='movecancel' value='".FORLAN_14."' />
+		</td>
+		</tr>
+		</table>
+		</div>
+		</form><br />";
+	$text = $ns->tablerender($tp->toHTML($info['thread_name']), $tp->toHTML($info['thread_thread']), '', TRUE).$ns->tablerender("", $text, '', true);
+	$ns->tablerender(FORLAN_25, $text);
+	
+}
+require_once(FOOTERF);
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_mod.php 75/e107_plugins/forum/forum_mod.php
--- 6171/e107_plugins/forum/forum_mod.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_mod.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,142 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_mod.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2006/01/05 09:06:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+@include_once e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_admin.php';
+@include_once e_PLUGIN.'forum/languages/English/lan_forum_admin.php';
+	
+function forum_thread_moderate($p)
+{
+	global $sql;
+	foreach($p as $key => $val) {
+		if (preg_match("#(.*?)_(\d+)_x#", $key, $matches))
+		{
+			$act = $matches[1];
+			$id = intval($matches[2]);
+			 
+			switch($act)
+			{
+				case 'lock' :
+				$sql->db_Update("forum_t", "thread_active='0' WHERE thread_id='$id' ");
+				return FORLAN_CLOSE;
+				break;
+				 
+				case 'unlock' :
+				$sql->db_Update("forum_t", "thread_active='1' WHERE thread_id='$id' ");
+				return FORLAN_OPEN;
+				break;
+				 
+				case 'stick' :
+				$sql->db_Update("forum_t", "thread_s='1' WHERE thread_id='$id' ");
+				return FORLAN_STICK;
+				break;
+				 
+				case 'unstick' :
+				$sql->db_Update("forum_t", "thread_s='0' WHERE thread_id='$id' ");
+				return FORLAN_UNSTICK;
+				break;
+				 
+				case 'delete' :
+				return forum_delete_thread($id);
+				break;
+				 
+			}
+		}
+	}
+}
+	
+function forum_delete_thread($thread_id)
+{
+	global $sql;
+	@require_once(e_PLUGIN.'forum/forum_class.php');
+	$f =& new e107forum;
+	$sql->db_Select("forum_t", "*", "thread_id='".intval($thread_id)."' ");
+	$row = $sql->db_Fetch();
+	 
+	if ($row['thread_parent'])
+	{
+		// post is a reply?
+		$sql->db_Delete("forum_t", "thread_id='".intval($thread_id)."' ");
+		// dec forum reply count by 1
+		$sql->db_Update("forum", "forum_replies=forum_replies-1 WHERE forum_id='".$row['thread_forum_id']."'");
+		// dec thread reply count by 1
+		$sql->db_Update("forum_t", "thread_total_replies=thread_total_replies-1 WHERE thread_id='".$row['thread_parent']."'");
+		// dec user forum post count by 1
+		$tmp = explode(".", $row['thread_user']);
+		$uid = intval($tmp[0]);
+		if($uid > 0)
+		{
+			$sql->db_Update("user", "user_forums=user_forums-1 WHERE user_id='".$uid."'");
+		}
+		// update lastpost info
+		$f->update_lastpost('thread', $row['thread_parent']);
+		$f->update_lastpost('forum', $row['thread_forum_id']);
+		return FORLAN_154;
+	}
+	else
+	{
+		// post is thread
+		// delete poll if there is one
+		$sql->db_Delete("poll", "poll_datestamp='".intval($thread_id)."'");
+		//decrement user post counts
+		forum_userpost_count("WHERE thread_id = '".intval($thread_id)."' OR thread_parent = '".intval($thread_id)."'", "dec");
+		// delete replies and grab how many there were
+		$count = $sql->db_Delete("forum_t", "thread_parent='".intval($thread_id)."'");
+		// delete the post itself
+		$sql->db_Delete("forum_t", "thread_id='".intval($thread_id)."'");
+		// update thread/reply counts
+		$sql->db_Update("forum", "forum_threads=forum_threads-1, forum_replies=forum_replies-$count WHERE forum_id='".$row['thread_forum_id']."'");
+		// update lastpost info
+		$f->update_lastpost('forum', $row['thread_forum_id']);
+		return FORLAN_6.($count ? ", ".$count." ".FORLAN_7."." : ".");
+	}
+}
+
+function forum_userpost_count($where = "", $type = "dec")
+{
+	global $sql;
+
+	$qry = "
+	SELECT thread_user, count(thread_user) AS cnt FROM #forum_t 
+	{$where}
+	GROUP BY thread_user
+	";
+
+	if($sql->db_Select_gen($qry))
+	{
+		$uList = $sql->db_getList();
+		foreach($uList as $u)
+		{
+			$tmp = explode(".", $u['thread_user']);
+			$uid = intval($tmp[0]);
+			if($uid > 0)
+			{
+				if("set" == $type)
+				{
+					$sql->db_Update("user", "user_forums={$u['cnt']} WHERE user_id='".$uid."'");
+				}
+				else
+				{
+					$sql->db_Update("user", "user_forums=user_forums-{$u['cnt']} WHERE user_id='".$uid."'");
+				}
+			}
+		}
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum.php 75/e107_plugins/forum/forum.php
--- 6171/e107_plugins/forum/forum.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum.php	2006-01-15 13:07:40.000000000 -0600
@@ -0,0 +1,526 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     �Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum.php,v $
+|     $Revision: 1.38 $
+|     $Date: 2006/01/15 19:07:40 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if(!defined("e107_INIT")) {
+	require_once("../../class2.php");
+}
+
+@include_once e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php';
+@include_once e_PLUGIN.'forum/languages/English/lan_forum.php';
+
+require_once(e_PLUGIN.'forum/forum_class.php');
+$forum = new e107forum;
+
+if (strstr(e_QUERY, "untrack"))
+{
+	$tmp1 = explode(".", e_QUERY);
+	$tmp = str_replace("-".$tmp1[1]."-", "", USERREALM);
+	$sql->db_Update("user", "user_realm='".$tp -> toDB($tmp, true)."' WHERE user_id='".USERID."' ");
+	header("location:".e_SELF."?track");
+	exit;
+}
+
+//Mark all threads as read
+if (e_QUERY == "mark.all.as.read")
+{
+	$forum->forum_markasread('all');
+	header("location:".e_SELF);
+	exit;
+}
+
+//Mark all threads in specific forum as read
+if (strstr(e_QUERY, 'mfar'))
+{
+	$tmp = explode(".", e_QUERY);
+	$forum_id = intval($tmp[1]);
+	$forum->forum_markasread($forum_id);
+	header("location:".e_SELF);
+	exit;
+}
+
+if (e_QUERY == 'rules')
+{
+	include_once(HEADERF);
+	forum_rules('show');
+	include_once(FOOTERF);
+	exit;
+}
+
+$gen = new convert;
+
+$FORUMTITLE = LAN_46;
+$THREADTITLE = LAN_47;
+$REPLYTITLE = LAN_48;
+$LASTPOSTITLE = LAN_49;
+$INFOTITLE = LAN_191;
+$LOGO = IMAGE_e;
+$NEWTHREADTITLE = LAN_424;
+$POSTEDTITLE = LAN_423;
+$NEWIMAGE = IMAGE_new_small;
+$TRACKTITLE = LAN_397;
+
+$rules_text = forum_rules('check');
+$USERINFO = "<a href='".e_BASE."top.php?0.top.forum.10'>".LAN_429."</a> | <a href='".e_BASE."top.php?0.active'>".LAN_430."</a>";
+if(USER)
+{
+	$USERINFO .= " | <a href='".e_BASE."userposts.php?0.forums.".USERID."'>".LAN_431."</a> | <a href='".e_BASE."usersettings.php'>".LAN_432."</a> | <a href='".e_BASE."user.php?id.".USERID."'>".LAN_435."</a>";
+	if($pref['forum_attach'] && (check_class($pref['upload_class']) || getperms('0')))
+	{
+		$USERINFO .= " | <a href='".e_PLUGIN."forum/forum_uploads.php'>".FORLAN_442."</a>";
+	}
+}
+if($rules_text != '')
+{
+	$USERINFO .= " | <a href='".e_PLUGIN."forum/forum.php?rules'>".LAN_433."</a>";
+}
+$total_topics = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' ");
+$total_replies = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' ");
+$total_members = $sql->db_Count("user");
+$newest_member = $sql->db_Select("user", "*", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
+list($nuser_id, $nuser_name) = $sql->db_Fetch();
+if(!defined("e_TRACKING_DISABLED"))
+{
+	$member_users = $sql->db_Select("online", "*", "online_location REGEXP('forum.php') AND online_user_id!='0' ");
+	$guest_users = $sql->db_Select("online", "*", "online_location REGEXP('forum.php') AND online_user_id='0' ");
+	$users = $member_users+$guest_users;
+	$USERLIST = LAN_426;
+	global $listuserson;
+	$c = 0;
+	if(is_array($listuserson))
+	{
+	foreach($listuserson as $uinfo => $pinfo)
+	{
+		list($oid, $oname) = explode(".", $uinfo, 2);
+		$c ++;
+		$USERLIST .= "<a href='".e_BASE."user.php?id.$oid'>$oname</a>".($c == MEMBERS_ONLINE ? "." :", ");
+	}
+	}
+	$USERLIST .= "<br /><a rel='external' href='".e_BASE."online.php'>".LAN_427."</a> ".LAN_436;
+}
+$STATLINK = "<a href='".e_PLUGIN."forum/forum_stats.php'>".LAN_441."</a>\n";
+$ICONKEY = "
+<table style='width:100%'>\n<tr>
+<td style='width:2%'>".IMAGE_new_small."</td>
+<td style='width:10%'><span class='smallblacktext'>".LAN_79."</span></td>
+<td style='width:2%'>".IMAGE_nonew_small."</td>
+<td style='width:10%'><span class='smallblacktext'>".LAN_80."</span></td>
+<td style='width:2%'>".IMAGE_closed_small."</td>
+<td style='width:10%'><span class='smallblacktext'>".LAN_394."</span></td>
+</tr>\n</table>\n";
+
+$SEARCH = "
+<form method='get' action='".e_BASE."search.php'>
+<p>
+<input class='tbox' type='text' name='q' size='20' value='' maxlength='50' />
+<input type='hidden' name='r' value='0' />
+<input type='hidden' name='ref' value='forum' />
+<input class='button' type='submit' name='s' value='".LAN_180."' />
+</p>
+</form>\n";
+
+$PERMS = (USER == TRUE || ANON == TRUE ? LAN_204." - ".LAN_206." - ".LAN_208 : LAN_205." - ".LAN_207." - ".LAN_209);
+
+$INFO = "";
+if (USER == TRUE)
+{
+	$total_new_threads = $sql->db_Count('forum_t', '(*)', "WHERE thread_datestamp>'".USERLV."' ");
+	if (USERVIEWED != "")
+	{
+		$tmp = explode("..", USERVIEWED);
+		$total_read_threads = count($tmp);
+	}
+	else
+	{
+		$total_read_threads = 0;
+	}
+
+	$INFO = LAN_30." ".USERNAME."<br />";
+	$lastvisit_datestamp = $gen->convert_date(USERLV, 'long');
+	$datestamp = $gen->convert_date(time(), "long");
+	if (!$total_new_threads)
+	{
+		$INFO .= LAN_31;
+	}
+	elseif($total_new_threads == 1)
+	{
+		$INFO .= LAN_32;
+	}
+	else
+	{
+		$INFO .= LAN_33." ".$total_new_threads." ".LAN_34." ";
+	}
+	$INFO .= LAN_35;
+	if ($total_new_threads == $total_read_threads && $total_new_threads != 0 && $total_read_threads >= $total_new_threads)
+	{
+		$INFO .= LAN_198;
+		$allread = TRUE;
+	}
+	elseif($total_read_threads != 0)
+	{
+		$INFO .= " (".LAN_196.$total_read_threads.LAN_197.")";
+	}
+
+	$INFO .= "<br />
+	".LAN_36." ".$lastvisit_datestamp."<br />
+	".LAN_37." ".$datestamp;
+}
+else
+{
+	$INFO .= "";
+	if (ANON == TRUE)
+	{
+		$INFO .= LAN_410."<br />".LAN_44." <a href='".e_SIGNUP."'>".LAN_437."</a> ".LAN_438;
+	}
+	elseif(USER == FALSE)
+	{
+		$INFO .= LAN_410."<br />".LAN_45." <a href='".e_SIGNUP."'>".LAN_439."</a> ".LAN_440;
+	}
+}
+
+if (USER && $allread != TRUE && $total_new_threads && $total_new_threads >= $total_read_threads)
+{
+	$INFO .= "<br /><a href='".e_SELF."?mark.all.as.read'>".LAN_199."</a>".(e_QUERY != "new" ? ", <a href='".e_SELF."?new'>".LAN_421."</a>" : "");
+}
+
+if (USER && USERREALM && e_QUERY != "track")
+{
+	$INFO .= "<br /><a href='".e_SELF."?track'>".LAN_393."</a>";
+}
+
+$FORUMINFO = LAN_192.($total_topics+$total_replies)." ".LAN_404." ($total_topics ".($total_topics == 1 ? LAN_411 : LAN_413).", $total_replies ".($total_replies == 1 ? LAN_412 : LAN_414).").".(!defined("e_TRACKING_DISABLED") ? "" : "<br />".$users." ".($users == 1 ? LAN_415 : LAN_416)." (".$member_users." ".($member_users == 1 ? LAN_417 : LAN_419).", ".$guest_users." ".($guest_users == 1 ? LAN_418 : LAN_420).")<br />".LAN_42.$total_members."<br />".LAN_41."<a href='".e_BASE."user.php?id.".$nuser_id."'>".$nuser_name."</a>.\n");
+
+if (!isset($FORUM_MAIN_START))
+{
+	if (file_exists(THEME."forum_template.php"))
+	{
+		include_once(THEME."forum_template.php");
+	}
+}
+include(e_PLUGIN."forum/templates/forum_template.php");
+require_once(HEADERF);
+
+$parent_list = $forum->forum_getparents();
+$forum_list = $forum->forum_getforums();
+$sub_list = $forum->forum_getsubs();
+$newflag_list = $forum->forum_newflag_list();
+
+if (!$parent_list)
+{
+	$ns->tablerender(PAGE_NAME, "<div style='text-align:center'>".LAN_51."</div>", array('forum', '51'));
+	require_once(FOOTERF);
+	exit;
+}
+
+$forum_string = "";
+foreach ($parent_list as $parent) {
+	$status = parse_parent($parent);
+	$PARENTSTATUS = $status[0];
+	if ($status[1]) {
+		$PARENTNAME = $parent['forum_name'];
+		$forum_string .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_PARENT);
+		//		$forums = $forum->forum_getforums($parent['forum_id']);
+		if (!count($forum_list[$parent['forum_id']]))
+		{
+			$text .= "<td colspan='5' style='text-align:center' class='forumheader3'>".LAN_52."</td>";
+		}
+		else
+		{
+			foreach($forum_list[$parent['forum_id']] as $f)
+			{
+				if ($f['forum_class'] == e_UC_ADMIN && ADMIN)
+				{
+					$forum_string .= parse_forum($f, LAN_406);
+				}
+				elseif($f['forum_class'] == e_UC_MEMBER && USER)
+				{
+					$forum_string .= parse_forum($f, LAN_407);
+				}
+				elseif($f['forum_class'] == e_UC_READONLY)
+				{
+					$forum_string .= parse_forum($f, LAN_408);
+				}
+				elseif($f['forum_class'] && check_class($f['forum_class']))
+				{
+					$forum_string .= parse_forum($f, LAN_409);
+				}
+				elseif(!$f['forum_class'])
+				{
+					$forum_string .= parse_forum($f);
+				}
+			}
+			if (isset($FORUM_MAIN_PARENT_END))
+			{
+				$forum_string .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_PARENT_END);
+			}
+		}
+	}
+}
+
+function parse_parent($parent)
+{
+	if(check_class($parent['forum_class']))
+	{
+		$status[0]="";
+		$status[1] = TRUE;
+		if(!check_class($parent['forum_postclass']))
+		{
+			$status[0] = "( ".LAN_405." )";
+		}
+	}
+	else
+	{
+		$status[1] = FALSE;
+	}
+	return $status;
+}
+
+function parse_forum($f, $restricted_string = "")
+{
+	global $FORUM_MAIN_FORUM, $gen, $forum, $tp, $newflag_list, $sub_list;
+
+	if(USER && is_array($newflag_list) && in_array($f['forum_id'], $newflag_list))
+	{
+		$NEWFLAG = "<a href='".e_SELF."?mfar.{$f['forum_id']}'>".IMAGE_new."</a>";
+	}
+	else
+	{
+		$NEWFLAG = IMAGE_nonew;
+	}
+
+	if(substr($f['forum_name'], 0, 1) == "*")
+	{
+		$f['forum_name'] = substr($f['forum_name'], 1);
+	}
+	$f['forum_name'] = $tp -> toHTML($f['forum_name'], TRUE, "no_hook");
+	$f['forum_description'] = $tp -> toHTML($f['forum_description'], TRUE, "no_hook");
+
+	$FORUMNAME = "<a href='".e_PLUGIN."forum/forum_viewforum.php?{$f['forum_id']}'>{$f['forum_name']}</a>";
+	$FORUMDESCRIPTION = $f['forum_description'].($restricted_string ? "<br /><span class='smalltext'><i>$restricted_string</i></span>" : "");
+	$THREADS = $f['forum_threads'];
+	$REPLIES = $f['forum_replies'];
+	$FORUMSUBFORUMS = "";
+
+	if(is_array($sub_list[$f['forum_parent']][$f['forum_id']]))
+	{
+		list($lastpost_datestamp, $lastpost_thread) = explode(".", $f['forum_lastpost_info']);
+		$ret = parse_subs($sub_list[$f['forum_parent']][$f['forum_id']], $lastpost_datestamp);
+		$FORUMSUBFORUMS = "<br /><div class='smalltext'>".FORLAN_444.": {$ret['text']}</div>";
+		$THREADS += $ret['threads'];
+		$REPLIES += $ret['replies'];
+		if(isset($ret['lastpost_info']))
+		{
+			$f['forum_lastpost_info'] = $ret['lastpost_info'];
+			$f['user_name'] = $ret['user_name'];
+		}
+	}
+
+	if ($f['forum_lastpost_user'])
+	{
+		list($lastpost_datestamp, $lastpost_thread) = explode(".", $f['forum_lastpost_info']);
+		$tmp = explode(".", $f['forum_lastpost_user'], 2);
+		if ($f['user_name'])
+		{
+			$lastpost_name = "<a href='".e_BASE."user.php?id.{$tmp[0]}'>{$f['user_name']}</a>";
+		}
+		else
+		{
+			if(!$tmp[1])
+			{
+				$lastpost_name = FORLAN_443;
+			}
+			else
+			{
+				$lastpost_name = $tp->toHTML($tmp[1]);
+			}
+		}
+		$lastpost_datestamp = $gen->convert_date($lastpost_datestamp, 'forum');
+		$LASTPOST = $lastpost_datestamp.'<br />'.$lastpost_name." <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$lastpost_thread}.last'>".IMAGE_post2.'</a>';
+	}
+	else
+	{
+		$LASTPOST = "-";
+	}
+	return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_FORUM));
+}
+
+function parse_subs($subList, $lastpost_datestamp)
+{
+	$ret = array();
+	$ret['text'] = "";
+	foreach($subList as $sub)
+	{
+		$ret['text'] .= 	($ret['text'] ? ", " : "");
+		$ret['text'] .= "<a href='".e_PLUGIN."forum/forum_viewforum.php?{$sub['forum_id']}'>{$sub['forum_name']}</a>";
+		$ret['threads'] += $sub['forum_threads'];
+		$ret['replies'] += $sub['forum_replies'];
+		$tmp = explode(".", $sub['forum_lastpost_info']);
+		if($tmp[0] > $lastpost_datestamp)
+		{
+			$ret['lastpost_info'] = $sub['forum_lastpost_info'];
+			$ret['user_name'] = $sub['user_name'];
+			$lastpost_datestamp = $tmp[0];
+		}
+	}
+	return $ret;
+}
+
+if (e_QUERY == "track")
+{
+	$sql2 = new db;
+	$tmp = explode("-", USERREALM);
+	foreach($tmp as $key => $value)
+	{
+		if ($value)
+		{
+			if($sql->db_Select("forum_t", "thread_id, thread_datestamp, thread_name", "thread_id='".intval($value)."' "))
+			{
+				$row = $sql->db_Fetch();
+				//extract($row);
+				$NEWIMAGE = IMAGE_nonew_small;
+				if ($row['thread_datestamp'] > USERLV && (strpos(USERVIEWED, ".".$row['thread_id'].".") === FALSE))
+				{
+					$NEWIMAGE = IMAGE_new_small;
+				}
+				elseif($sql2->db_SELECT("forum_t", "thread_id", "thread_parent='{$row['thread_id']}' AND thread_datestamp > '".USERLV."' "))
+				{
+					while ($xrow = $sql2->db_Fetch())
+					{
+						if (strpos(USERVIEWED, ".".$xrow['thread_id'].".") === FALSE)
+						{
+							$NEWIMAGE = IMAGE_new_small;
+						}
+					}
+				}
+				$result = preg_split("/\]/", $row['thread_name']);
+				$TRACKPOSTNAME = (($result[1] && $row['thread_name']{0} == "[") ? $result[0]."] <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$row['thread_id']}'>".preg_replace("/\[.*\]/", "", $row['thread_name'])."</a>" : "<a href='".e_PLUGIN."forum/forum_viewtopic.php?{$row['thread_id']}'>".$row['thread_name']."</a>");
+				$UNTRACK = "<a href='".e_SELF."?untrack.".$row['thread_id']."'>".LAN_392."</a>";
+				$forum_trackstring .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_TRACK_MAIN);
+			}
+		}
+	}
+
+	$forum_track_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_TRACK_START);
+	$forum_track_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_TRACK_END);
+
+	if ($pref['forum_enclose'])
+	{
+		$ns->tablerender($pref['forum_title'], $forum_track_start.$forum_trackstring.$forum_track_end, array('forum', 'main1'));
+	}
+	else
+	{
+		echo $forum_track_start.$forum_trackstring.$forum_track_end;
+	}
+}
+
+if (e_QUERY == "new")
+{
+	$newpostList = $forum->post_getnew(10);
+	foreach($newpostList as $post)
+	{
+		list($author_id, $author_info) = explode(".", $post['thread_user'], 2);
+		list($author_name, $tmp) = explode(chr(1), $author_info);
+		$datestamp = $gen->convert_date($post['thread_datestamp'], "forum");
+		if($author_id == 0)
+		{
+			$STARTERTITLE = $author_name."<br />".$datestamp;
+		}
+		else
+		{
+			$STARTERTITLE = "<a href='".e_BASE."user.php?id.$author_id'>$author_name</a><br />".$datestamp;
+		}
+		if($post['post_subject'])
+		{
+			$NEWSPOSTNAME = "<a href='".e_PLUGIN."forum/forum_viewtopic.php?{$post['thread_id']}.post'>".LAN_425.$tp->toHTML($post['post_subject'], TRUE, 'no_make_clickable, no_hook')."</a>";
+		}
+		else
+		{
+			$NEWSPOSTNAME = "<a href='".e_PLUGIN."forum/forum_viewtopic.php?{$post['thread_id']}'>".$tp->toHTML($post['thread_name'], TRUE, 'no_make_clickable, no_hook')."</a>";
+		}
+
+		$forum_newstring .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_MAIN);
+	}
+
+	if (!$newpostList)
+	{
+		$NEWSPOSTNAME = LAN_198;
+		$forum_newstring = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_MAIN);
+	}
+	$forum_new_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_START);
+	$forum_new_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_END);
+
+	if ($pref['forum_enclose'])
+	{
+		$ns->tablerender($pref['forum_title'], $forum_new_start.$forum_newstring.$forum_new_end, array('forum', 'main2'));
+	}
+	else
+	{
+		echo $forum_new_start.$forum_newstring.$forum_new_end;
+	}
+}
+
+$forum_main_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_START);
+$forum_main_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_END);
+if ($pref['forum_enclose'])
+{
+	$ns->tablerender($pref['forum_title'], $forum_main_start.$forum_string.$forum_main_end, array('forum', 'main3'));
+}
+else
+{
+	echo $forum_main_start.$forum_string.$forum_main_end;
+}
+require_once(FOOTERF);
+
+function forum_rules($action = 'check')
+{
+	global $tp, $sql, $ns;
+	if (ADMIN == TRUE)
+	{
+		$type = 'forum_rules_admin';
+	}
+	elseif(USER == TRUE)
+	{
+		$type = 'forum_rules_member';
+	}
+	else
+	{
+		$type = 'forum_rules_guest';
+	}
+	$result = $sql->db_Select('generic', 'gen_chardata', "gen_type = '$type' AND gen_intdata = 1");
+	if ($action == 'check')
+	{
+		if ($result)
+		{
+			return TRUE;
+		}
+		else
+		{
+			return FALSE;
+		}
+	}
+	if ($result)
+	{
+		$row = $sql->db_Fetch();
+		$rules_text = $tp->toHTML($row['gen_chardata'], TRUE);
+	}
+	else
+	{
+		$rules_text = FORLAN_441;
+	}
+	$ns->tablerender(LAN_433, "<div style='text-align:center'>{$rules_text}</div>", array('forum', 'forum_rules'));
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_post.php 75/e107_plugins/forum/forum_post.php
--- 6171/e107_plugins/forum/forum_post.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_post.php	2006-02-20 08:18:17.000000000 -0600
@@ -0,0 +1,645 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_post.php,v $
+|     $Revision: 1.65 $
+|     $Date: 2006/02/20 14:18:17 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+$WYSIWYG = $pref['wysiwyg'];
+$e_wysiwyg = "post";
+$lan_file = e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_post.php';
+include(file_exists($lan_file) ? $lan_file : e_PLUGIN.'forum/languages/English/lan_forum_post.php');
+
+if (IsSet($_POST['fjsubmit'])) {
+	header("location:".e_BASE.$PLUGINS_DIRECTORY."forum/forum_viewforum.php?".$_POST['forumjump']);
+	exit;
+}
+require_once(e_PLUGIN.'forum/forum_class.php');
+$forum = new e107forum;
+
+if (!e_QUERY) {
+	header("Location:".e_PLUGIN."forum/forum.php");
+	exit;
+} else {
+	$tmp = explode(".", e_QUERY);
+	$action = preg_replace('#\W#', '', $tmp[0]);
+	$id = intval($tmp[1]);
+	$from = intval($tmp[2]);
+}
+
+// check if user can post to this forum ...
+if ($action == 'rp')
+{
+	// reply to thread
+	$thread_info = $forum->thread_get($id, 'last', 11);
+	$forum_info = $forum->forum_get($thread_info['head']['thread_forum_id']);
+}
+elseif ($action == 'nt')
+{
+	// New post
+	$forum_info = $forum->forum_get($id);
+}
+elseif ($action == 'quote' || $action == 'edit')
+{
+	$thread_info = $forum->thread_get_postinfo($id, TRUE);
+	$forum_info = $forum->forum_get($thread_info['head']['thread_forum_id']);
+	if($action == 'quote')
+	{
+		$id = $thread_info['head']['thread_id'];
+	}
+}
+
+if (!check_class($forum_info['forum_postclass']) || !check_class($forum_info['parent_postclass'])) {
+	require_once(HEADERF);
+	$ns->tablerender(LAN_20, "<div style='text-align:center'>".LAN_399."</div>");
+	require_once(FOOTERF);
+	exit;
+}
+define("MODERATOR", check_class($forum_info['forum_moderators']));
+//require_once(e_HANDLER.'forum_include.php');
+require_once(e_PLUGIN."forum/forum_post_shortcodes.php");
+require_once(e_PLUGIN."forum/forum_shortcodes.php");
+require_once(e_HANDLER."ren_help.php");
+$gen = new convert;
+$fp = new floodprotect;
+global $tp;
+
+if ($sql->db_Select("tmp", "*", "tmp_ip='$ip' ")) {
+	$row = $sql->db_Fetch();
+	$tmp = explode("^", $row['tmp_info']);
+	$action = $tmp[0];
+	$anonname = $tmp[1];
+	$subject = $tmp[2];
+	$post = $tmp[3];
+	$sql->db_Delete("tmp", "tmp_ip='$ip' ");
+}
+
+//Check to see if user had post rights
+if (!check_class($forum_info['forum_postclass']))
+{
+	require_once(HEADERF);
+	$text .= "<div style='text-align:center'>".LAN_399."</div>";
+	$ns->tablerender(LAN_20, $text);
+	require_once(FOOTERF);
+	exit;
+}
+
+//if thread is not active and not new thread, show warning
+if ($action != "nt" && !$thread_info['head']['thread_active'] && !MODERATOR)
+{
+	require_once(HEADERF);
+	$ns->tablerender(LAN_20, "<div style='text-align:center'>".LAN_397."</div>");
+	require_once(FOOTERF);
+	exit;
+}
+
+$forum_info['forum_name'] = $tp -> toHTML($forum_info['forum_name'], TRUE);
+
+define("e_PAGETITLE", LAN_01." / ".$forum_info['forum_name']." / ".($action == "rp" ? LAN_02.$forum_info['thread_name'] : LAN_03));
+
+// ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+if (is_readable(e_ADMIN.'filetypes.php')) {
+	$a_filetypes = trim(file_get_contents(e_ADMIN.'filetypes.php'));
+	$a_filetypes = explode(',', $a_filetypes);
+	foreach ($a_filetypes as $ftype) {
+		$sa_filetypes[] = '.'.trim(str_replace('.', '', $ftype));
+	}
+	$allowed_filetypes = implode(' | ', $sa_filetypes);
+}
+
+if (isset($_POST['submitpoll']))
+{
+	require_once(e_PLUGIN."poll/poll_class.php");
+	$poll = new poll;
+
+	require_once(HEADERF);
+	if (!$FORUMPOST)
+	{
+		if (file_exists(THEME."forum_posted_template.php"))
+		{
+			require_once(THEME."forum_posted_template.php");
+		}
+		else
+		{
+			require_once(e_PLUGIN."forum/templates/forum_posted_template.php");
+		}
+	}
+	echo $FORUMPOLLPOSTED;
+	require_once(FOOTERF);
+	exit;
+}
+
+if (isset($_POST['fpreview']))
+{
+	process_upload();
+	require_once(HEADERF);
+	if (USER)
+	{
+		$poster = USERNAME;
+	}
+	else
+	{
+		$poster = ($_POST['anonname']) ? $_POST['anonname'] : LAN_311;
+	}
+	$postdate = $gen->convert_date(time(), "forum");
+	$tsubject = $tp->post_toHTML($_POST['subject'], true);
+	$tpost = $tp->post_toHTML($_POST['post'], true);
+
+	if ($_POST['poll_title'] != "" && $pref['forum_poll'])
+	{
+		require_once(e_PLUGIN."poll/poll_class.php");
+		$poll = new poll;
+		$poll->render_poll($_POST, "forum", "notvoted");
+	}
+
+	if (!$FORUM_PREVIEW)
+	{
+		if (file_exists(THEME."forum_preview_template.php"))
+		{
+			require_once(THEME."forum_preview_template.php");
+		}
+		else
+		{
+			require_once(e_PLUGIN."forum/templates/forum_preview_template.php");
+		}
+	}
+
+	$text = $FORUM_PREVIEW;
+
+	if ($poll_text)
+	{
+		$ns->tablerender($_POST['poll_title'], $poll_text);
+	}
+	$ns->tablerender(LAN_323, $text);
+	$anonname = $tp->post_toHTML($_POST['anonname'], FALSE);
+	$post = $tp->post_toHTML($_POST['post'], false);
+	$subject = $tp->post_toHTML($_POST['subject'], false);
+
+	if ($action == "edit")
+	{
+		if ($_POST['subject'])
+		{
+			$action = "nt";
+		}
+		else
+		{
+			$action = "reply";
+		}
+		$eaction = TRUE;
+	}
+	else if($action == "quote")
+	{
+		$action = "reply";
+		$eaction = FALSE;
+	}
+}
+
+if (isset($_POST['newthread']) || isset($_POST['reply']))
+{
+	$poster = array();
+	if ((isset($_POST['newthread']) && trim($_POST['subject']) == "") || trim($_POST['post']) == "")
+	{
+		message_handler("ALERT", 5);
+	}
+	else
+	{
+		if ($fp->flood("forum_t", "thread_datestamp") == FALSE && !ADMIN)
+		{
+			echo "<script type='text/javascript'>document.location.href='".e_BASE."index.php'</script>\n";
+		}
+		if (USER)
+		{
+			$poster['post_userid'] = USERID;
+			$poster['post_user_name'] = USERNAME;
+		}
+		else
+		{
+			$poster = getuser($_POST['anonname']);
+			if ($poster == -1)
+			{
+				require_once(HEADERF);
+				$ns->tablerender(LAN_20, LAN_310);
+				if (isset($_POST['reply']))
+				{
+					$tmpdata = "reply.".$tp -> toDB($_POST['anonname']).".".$tp -> toDB($_POST['subject']).".".$tp -> toDB($_POST['post']);
+				}
+				else
+				{
+					$tmpdata = "newthread^".$tp -> toDB($_POST['anonname'])."^".$tp -> toDB($_POST['subject'])."^".$tp -> toDB($_POST['post']);
+				}
+				$sql->db_Insert("tmp", "'$ip', '".time()."', '$tmpdata' ");
+				loginf();
+				require_once(FOOTERF);
+				exit;
+			}
+		}
+		process_upload();
+
+		$post = $tp->toDB($_POST['post']);
+		$subject = $tp->toDB($_POST['subject']);
+		$email_notify = ($_POST['email_notify'] ? 99 : 1);
+		if ($_POST['poll_title'] != "" && $_POST['poll_option'][0] != "" && $_POST['poll_option'][1] != "")
+		{
+			$subject = "[".LAN_402."] ".$subject;
+		}
+
+		$threadtype = (MODERATOR ? intval($_POST['threadtype']) : 0);
+		if (isset($_POST['reply']))
+		{
+			$parent = $id;
+			$forum_id = $thread_info['head']['thread_forum_id'];
+		}
+		else
+		{
+			$parent = 0;
+			$forum_id = $id;
+		}
+
+		$iid = $forum->thread_insert($subject, $post, $forum_id, $parent, $poster, $email_notify, $threadtype, $forum_info['forum_sub']);
+		if($iid === -1)
+		{
+			require_once(HEADERF);
+			$ns->tablerender("", LAN_FORUM_2);
+			require_once(FOOTERF);
+			exit;
+		}
+		if (isset($_POST['reply'])) {
+			$iid = $parent;
+		}
+
+		if ($_POST['poll_title'] != "" && $_POST['poll_option'][0] != "" && $_POST['poll_option'][1] != "" && isset($_POST['newthread'])) {
+			require_once(e_PLUGIN."poll/poll_class.php");
+			$_POST['iid'] = $iid;
+			$poll = new poll;
+			$poll -> submit_poll(2);
+		}
+
+		if ($pref['forum_redirect'])
+		{
+			redirect(e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last");
+		}
+		else
+		{
+			require_once(HEADERF);
+			if (!$FORUMPOST)
+			{
+				if (file_exists(THEME."forum_posted_template.php"))
+				{
+					require_once(THEME."forum_posted_template.php");
+				}
+				else
+				{
+					require_once(e_PLUGIN."forum/templates/forum_posted_template.php");
+				}
+			}
+
+			echo (isset($_POST['newthread']) ? $FORUMTHREADPOSTED : $FORUMREPLYPOSTED);
+			$e107cache->clear("newforumposts");
+			require_once(FOOTERF);
+			exit;
+		}
+	}
+}
+require_once(HEADERF);
+
+if (isset($_POST['update_thread']))
+{
+	if (!$_POST['subject'] || !$_POST['post'])
+	{
+		$error = "<div style='text-align:center'>".LAN_27."</div>";
+	}
+	else
+	{
+		if (!isAuthor())
+		{
+			$ns->tablerender(LAN_95, "<div style='text-align:center'>".LAN_96."</div>");
+			require_once(FOOTERF);
+			exit;
+		}
+		$newvals['thread_edit_datestamp'] = time();
+		$newvals['thread_thread'] = $_POST['post'];
+		$newvals['thread_name'] = $_POST['subject'];
+		$newvals['thread_active'] = ($_POST['email_notify']) ? '99' : '1';
+		if (isset($_POST['threadtype']) && MODERATOR)
+		{
+			$newvals['thread_s'] = $_POST['threadtype'];
+		}
+		$forum->thread_update($id, $newvals);
+		$e107cache->clear("newforumposts");
+		$url = e_PLUGIN."forum/forum_viewtopic.php?{$thread_info['head']['thread_id']}.0";
+		echo "<script type='text/javascript'>document.location.href='".$url."'</script>\n";
+	}
+}
+
+if (isset($_POST['update_reply']))
+{
+	if (!$_POST['post'])
+	{
+		$error = "<div style='text-align:center'>".LAN_27."</div>";
+	}
+	else
+	{
+		if (!isAuthor())
+		{
+			$ns->tablerender(LAN_95, "<div style='text-align:center'>".LAN_96."</div>");
+			require_once(FOOTERF);
+			exit;
+		}
+		$url = e_PLUGIN."forum/forum_viewtopic.php?{$id}.post";
+		echo "<script type='text/javascript'>document.location.href='".$url."'</script>\n";
+		$newvals['thread_edit_datestamp'] = time();
+		$newvals['thread_thread'] = $_POST['post'];
+		$forum->thread_update($id, $newvals);
+		$e107cache->clear("newforumposts");
+		$url = e_PLUGIN."forum/forum_viewtopic.php?{$id}.post";
+		echo "<script type='text/javascript'>document.location.href='".$url."'</script>\n";
+	}
+}
+
+if ($error)
+{
+	$ns->tablerender(LAN_20, $error);
+}
+
+
+if ($action == 'edit' || $action == 'quote')
+{
+ 	if ($action == "edit")
+	{
+		if (!isAuthor())
+		{
+			$ns->tablerender(LAN_95, "<div style='text-align:center'>".LAN_96."</div>");
+			require_once(FOOTERF);
+			exit;
+		}
+	}
+
+	if(!is_array($thread_info[0]))
+	{
+		 $ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_96."</div>");
+		 require_once(FOOTERF);
+		exit;
+	}
+
+	$thread_info[0]['user_name'] = $forum->thread_user($thread_info[0]);
+	$subject = $thread_info['0']['thread_name'];
+	$post = $tp->toForm($thread_info[0]['thread_thread']);
+	$post = preg_replace("/&lt;span class=&#39;smallblacktext&#39;.*\span\>/", "", $post);
+	
+	if ($action == 'quote') {
+		$post = preg_replace("#\[hide].*?\[/hide]#s", "", $post);
+		$tmp = explode(chr(1), $thread_info[0]['user_name']);
+		$timeStamp = time();
+		$post = "[quote{$timeStamp}={$tmp[0]}]\n".$post."\n[/quote{$timeStamp}]\n";
+		$eaction = FALSE;
+		$action = 'reply';
+	} else {
+		$eaction = TRUE;
+		if ($thread_info['0']['thread_parent']) {
+			$action = "reply";
+		} else {
+			$action = "nt";
+			$sact = "canc";	// added to override the bugtracker query below
+		}
+	}
+}
+
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+//Load forumpost template
+
+if (!$FORUMPOST) {
+	if (is_readable(THEME."forum_post_template.php")) {
+		include_once(THEME."forum_post_template.php");
+	}
+}
+include_once(e_PLUGIN."forum/templates/forum_post_template.php");
+
+/* check post access (bugtracker #1424) */
+
+if($action == "rp" && !$sql -> db_Select("forum_t", "*", "thread_id='$id'"))
+{
+	$ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_399."</div>");
+	 require_once(FOOTERF);
+	exit;
+}
+else if($action == "nt" && !$sact && !$sql -> db_Select("forum", "*", "forum_id='$id'"))
+{
+	 $ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_399."</div>");
+	 require_once(FOOTERF);
+	exit;
+}
+else
+{
+	$fpr = $sql -> db_Fetch();
+	if(!check_class($fpr['forum_postclass']))
+	{
+		$ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_399."</div>");
+		require_once(FOOTERF);
+		exit;
+	}
+}
+
+if($action == 'rp')
+{
+	$FORUMPOST = $FORUMPOST_REPLY;
+}
+$text = $tp->parseTemplate($FORUMPOST, FALSE, $forum_post_shortcodes);
+
+// -------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+if ($pref['forum_enclose'])
+{
+	$ns->tablerender($pref['forum_title'], $text);
+}
+else
+{
+	echo $text;
+}
+
+function isAuthor()
+{
+	global $thread_info;
+	$tmp = explode(".", $thread_info[0]['thread_user'], 2);
+	return ($tmp[0] == USERID || MODERATOR);
+}
+
+function getuser($name)
+{
+	global $tp, $sql, $e107;
+	$ret = array();
+	$ip = $e107->getip();
+	$name = str_replace("'", "", $name);
+	if (!$name)
+	{
+		// anonymous guest
+//		$name = "0.".LAN_311.chr(1).$ip;
+		$ret['post_userid'] = "0";
+		$ret['post_user_name'] = LAN_311;
+		return $ret;
+	}
+	else
+	{
+		if ($sql->db_Select("user", "user_id, user_ip", "user_name='".$tp -> toDB($name)."'"))
+		{
+			$row = $sql->db_Fetch();
+			if ($row['user_ip'] == $ip)
+			{
+				$ret['post_userid'] = $row['user_id'];
+				$ret['post_user_name'] = $name;
+			}
+			else
+			{
+				return -1;
+			}
+		}
+		else
+		{
+//			$name = "0.".substr($tp->toDB($name), 0, 20).chr(1).$ip;
+			$ret['post_userid'] = "0";
+			$ret['post_user_name'] = $tp->toDB($name);
+		}
+	}
+	return $ret;
+}
+
+function loginf() {
+	$text .= "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."?".e_QUERY."'><p>
+		".LAN_16."<br />
+		<input class='tbox' type='text' name='username' size='15' value='' maxlength='20' />\n
+		<br />
+		".LAN_17."
+		<br />
+		<input class='tbox' type='password' name='userpass' size='15' value='' maxlength='20' />\n
+		<br />
+		<input class='button' type='submit' name='userlogin' value='".LAN_10."' />\n
+		<br />
+		<input type='checkbox' name='autologin' value='1' /> ".LAN_11."
+		<br /><br />
+		[ <a href='".e_BASE."signup.php'>".LAN_174."</a> ]<br />[ <a href='fpw.php'>".LAN_212."</a> ]
+		</p>
+		</form>
+		</div>";
+	$ns = new e107table;
+	$ns->tablerender(LAN_175, $text);
+}
+
+function forumjump()
+{
+	global $forum;
+	$jumpList = $forum->forum_get_allowed();
+	$text = "<form method='post' action='".e_SELF."'><p>".LAN_401.": <select name='forumjump' class='tbox'>";
+	foreach($jumpList as $key => $val)
+	{
+		$text .= "\n<option value='".$key."'>".$val."</option>";
+	}
+	$text .= "</select> <input class='button' type='submit' name='fjsubmit' value='".LAN_387."' /></p></form>";
+	return $text;
+}
+
+function redirect($url)
+{
+	echo "<script type='text/javascript'>document.location.href='".$url."'</script>\n";
+}
+
+function process_upload()
+{
+	global $pref, $forum_info, $thread_info;
+	
+	if(isset($thread_info['head']['thread_id']))
+	{
+		$tid = $thread_info['head']['thread_id'];
+	}
+	else
+	{
+		$tid = 0;
+	}
+	
+	if (isset($_FILES['file_userfile']['error']) && $_FILES['file_userfile']['error'] != 4)
+	{
+		require_once(e_HANDLER."upload_handler.php");
+		if ($uploaded = file_upload('/'.e_FILE."public/", "attachment", "FT{$tid}_"))
+		{
+			foreach($uploaded as $upload)
+			{
+				if(strstr($upload['type'], "image"))
+				{
+					if(isset($pref['forum_maxwidth']) && $pref['forum_maxwidth'] > 0)
+					{
+						require_once(e_HANDLER."resize_handler.php");
+						$orig_file = $upload['name'];
+						$p = strrpos($orig_file,'.');
+						$new_file = substr($orig_file, 0 , $p)."_".substr($orig_file, $p);
+						$fpath = e_FILE."public/";
+						if(resize_image($fpath.$orig_file, $fpath.$new_file, $pref['forum_maxwidth']))
+						{
+							if($pref['forum_linkimg'])
+							{
+								$parms = image_getsize($fpath.$new_file);
+								$_POST['post'] .= "[br][link=".$fpath.$orig_file."][img{$parms}]".$fpath.$new_file."[/img][/link][br]";
+								//show resized, link to fullsize
+							}
+							else
+							{
+								@unlink($fpath.$orig_file);
+								//show resized
+								$parms = image_getsize($fpath.$new_file);
+								$_POST['post'] .= "[br][img{$parms}]".$fpath.$new_file."[/img][br]";
+							}
+						}
+						else
+						{
+							//resize failed, show original 
+							$parms = image_getsize(e_FILE."public/".$upload['name']);
+							$_POST['post'] .= "[br][img{$parms}]".e_FILE."public/".$upload['name']."[/img]";
+						}
+					}
+					else
+					{
+						$parms = image_getsize(e_FILE."public/".$upload['name']);
+						//resizing disabled, show original
+						$_POST['post'] .= "[br]<div class='spacer'>[img{$parms}]".e_FILE."public/".$upload['name']."[/img]</div>\n";
+					}
+				}
+				else
+				{
+					//upload was not an image, link to file
+					//echo "<pre>"; print_r($upload); echo "</pre>";
+					$_POST['post'] .= "[br][file=".e_FILE."public/".$upload['name']."]".$upload['name']."[/file]";
+				}
+				
+			}
+		}
+	}
+}
+
+function image_getsize($fname)
+{
+	if($imginfo = getimagesize($fname))
+	{
+		return ":width={$imginfo[0]}&height={$imginfo[1]}";
+	}
+	else
+	{
+		return "";
+	}
+}
+
+
+require_once(FOOTERF);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_post_shortcodes.php 75/e107_plugins/forum/forum_post_shortcodes.php
--- 6171/e107_plugins/forum/forum_post_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_post_shortcodes.php	2006-03-19 21:34:50.000000000 -0600
@@ -0,0 +1,167 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$forum_post_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+	
+/*
+SC_BEGIN LATESTPOSTS
+global $thread_info, $action, $gen, $tp, $forum_shortcodes, $post_info;
+global $LATESTPOSTS_START, $LATESTPOSTS_END, $LATESTPOSTS_POST; 
+$txt = $tp->parseTemplate($LATESTPOSTS_START, TRUE, $forum_shortcodes);
+for($i = count($thread_info)-2; $i>0; $i--)
+{
+	$post_info = $thread_info[$i];
+	$txt .= $tp->parseTemplate($LATESTPOSTS_POST, TRUE, $forum_shortcodes);
+}
+$txt .= $tp->parseTemplate($LATESTPOSTS_END, TRUE, $forum_shortcodes);
+return $txt;
+SC_END
+	
+SC_BEGIN THREADTOPIC
+global $thread_info, $action, $gen, $tp, $post_info, $forum_shortcodes, $THREADTOPIC_REPLY;
+$post_info = $thread_info['head'];
+return $tp->parseTemplate($THREADTOPIC_REPLY, TRUE, $forum_shortcodes);
+SC_END
+
+SC_BEGIN FORMSTART
+return "<form enctype='multipart/form-data' method='post' action='".e_SELF."?".e_QUERY."' id='dataform'>";
+SC_END
+
+SC_BEGIN FORMEND
+return "</form>";
+SC_END
+
+SC_BEGIN FORUMJUMP
+return forumjump();
+SC_END
+
+SC_BEGIN USERBOX
+global $userbox;
+return (USER == FALSE ? $userbox : "");
+SC_END
+
+SC_BEGIN SUBJECTBOX
+global $subjectbox, $action;
+return ($action == "nt" ? $subjectbox : "");
+SC_END
+
+SC_BEGIN POSTTYPE
+global $action;
+return ($action == "nt" ? LAN_63 : LAN_73);
+SC_END
+
+SC_BEGIN POSTBOX
+global $post, $pref;
+$ret = "<textarea class='tbox' name='post' cols='70' rows='10' style='width:95%' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$post</textarea>\n<br />\n";
+if(!$pref['wysiwyg'] || !check_class($pref['post_html']))
+{
+	$ret .= ren_help(2);
+}
+return $ret;
+SC_END
+
+SC_BEGIN BUTTONS
+global $action, $eaction;
+$ret = "<input class='button' type='submit' name='fpreview' value='".LAN_323."' /> ";
+if ($action != "nt")
+{
+	$ret .= ($eaction ? "<input class='button' type='submit' name='update_reply' value='".LAN_78."' />" : "<input class='button' type='submit' name='reply' value='".LAN_74."' />");
+}
+else
+{
+	$ret .= ($eaction ? "<input class='button' type='submit' name='update_thread' value='".LAN_77."' />" : "<input class='button' type='submit' name='newthread' value='".LAN_64."' />");
+}
+return $ret;
+SC_END
+
+SC_BEGIN EMOTES
+global $pref;
+if(!$pref['wysiwyg'] || !check_class($pref['post_html']))
+{
+	require_once(e_HANDLER."emote.php");
+	if($pref['smiley_activate'])
+	{
+		return r_emote();
+	}
+	else
+	{
+		return "";
+	}
+}
+SC_END
+
+SC_BEGIN FILEATTACH
+global $pref, $fileattach, $fileattach_alert;
+
+if ($pref['forum_attach'] && strpos(e_QUERY, "edit") === FALSE && (check_class($pref['upload_class']) || getperms('0')))
+{
+	if (is_writable(e_FILE."public"))
+	{
+		return $fileattach;
+	}
+	else
+	{
+		$FILEATTACH = "";
+		if(ADMIN)
+		{
+			if(!$fileattach_alert)
+			{
+				$fileattach_alert = "<tr><td colspan='2' class='nforumcaption2'>".($pref['image_post'] ? LAN_390 : LAN_416)."</td></tr><tr><td colspan='2' class='forumheader3'>".LAN_FORUM_1."</td></tr>\n";
+			}
+			return $fileattach_alert;
+		}
+	}
+}
+SC_END
+
+SC_BEGIN POSTTHREADAS
+global $action, $thread_info;
+if (MODERATOR && $action == "nt")
+{
+	$thread_s = (isset($_POST['threadtype']) ? $_POST['threadtype'] : $thread_info['head']['thread_s']);
+	return "<br /><span class='defaulttext'>".LAN_400."<input name='threadtype' type='radio' value='0' ".(!$thread_s ? "checked='checked' " : "")." />".LAN_1."&nbsp;<input name='threadtype' type='radio' value='1' ".($thread_s == 1 ? "checked='checked' " : "")." />".LAN_2."&nbsp;<input name='threadtype' type='radio' value='2' ".($thread_s == 2 ? "checked='checked' " : "")." />".LAN_3."</span>";
+}
+return "";
+SC_END
+
+SC_BEGIN BACKLINK
+global $forum_info, $thread_info, $eaction, $action;
+return "<a class='forumlink' href='".e_PLUGIN."forum/forum.php'>".LAN_405."</a>-><a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_info['forum_id']."'>".$forum_info['forum_name']."</a>->".
+($action == "nt" ? ($eaction ? LAN_77 : LAN_60) : ($eaction ? LAN_78 : LAN_406." ".$thread_info['head']['thread_name']));
+SC_END
+
+SC_BEGIN EMAILNOTIFY
+global $pref, $thread_info, $action;
+if ($pref['email_notify'] && $action == "nt")
+{
+	if(isset($_POST['fpreview']))
+	{
+		$chk = ($_POST['email_notify'] ? "checked = 'checked'" : "");
+	}
+	else
+	{ 
+		if(isset($thread_info))
+		{
+			$chk = ($thread_info['head']['thread_active'] == 99 ? "checked='checked'" : "");
+		}
+		else
+		{
+			$chk = ($pref['email_notify_on'] ? "checked='checked'" : "");
+		}
+	}
+	return "<span class='defaulttext'>".LAN_380."</span><input type='checkbox' name='email_notify' value='1' {$chk} />";
+}
+return "";
+SC_END
+
+SC_BEGIN POLL
+global $poll_form, $action, $pref;
+if ($action == "nt" && $pref['forum_poll'] && strpos(e_QUERY, "edit") === FALSE)
+{
+	return $poll_form;
+}
+return "";
+SC_END
+
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_shortcodes.php 75/e107_plugins/forum/forum_shortcodes.php
--- 6171/e107_plugins/forum/forum_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_shortcodes.php	2006-02-20 10:42:33.000000000 -0600
@@ -0,0 +1,252 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$forum_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+/*
+SC_BEGIN TOP
+return "<a href='".e_SELF."?".e_QUERY."#top' onclick=\"window.scrollTo(0,0);\">".LAN_10."</a>";
+SC_END
+	
+SC_BEGIN JOINED
+global $post_info, $gen;
+if ($post_info['user_id']) {
+return LAN_06.': '.$gen->convert_date($post_info['user_join'], 'forum').'<br />';
+}
+SC_END
+	
+SC_BEGIN THREADDATESTAMP
+global $post_info, $gen, $thread_id;
+return "<a id='post_{$post_info['thread_id']}'>".IMAGE_post."</a> ".$gen->convert_date($post_info['thread_datestamp'], "forum");
+SC_END
+	
+SC_BEGIN POST
+global $post_info, $tp, $iphost;
+$ret = "";
+$ret = $tp->toHTML($post_info["thread_thread"], TRUE, "", 'class:'.$post_info["user_class"]);
+if (ADMIN && $iphost) {
+$ret .= "<br />".$iphost;
+}
+return $ret;
+SC_END
+	
+SC_BEGIN PRIVMESSAGE
+global $post_info, $tp;
+return $tp->parseTemplate("{SENDPM={$post_info['user_id']}}");
+SC_END
+	
+SC_BEGIN AVATAR
+global $post_info;
+if ($post_info['user_id']) {
+if ($post_info["user_image"]) {
+require_once(e_HANDLER."avatar_handler.php");
+return "<div class='spacer'><img src='".avatar($post_info['user_image'])."' alt='' /></div><br />";
+} else {
+return "";
+}
+} else {
+return "<span class='smallblacktext'>".LAN_194."</span>";
+}
+SC_END
+	
+SC_BEGIN ANON_IP
+global $post_info;
+//die($post_info['thread_user']);
+$x = explode(chr(1), $post_info['thread_user']);
+if($x[1] && ADMIN)
+{
+	return $x[1];
+}
+SC_END
+
+SC_BEGIN POSTER
+global $post_info, $tp;
+if($post_info['user_name'])
+{
+	return "<a href='".e_BASE."user.php?id.".$post_info['user_id']."'><b>".$post_info['user_name']."</b></a>";
+}
+else
+{
+	$x = explode(chr(1), $post_info['thread_user']);
+	$tmp = explode(".", $x[0], 2);
+	if(!$tmp[1])
+	{
+		return FORLAN_103;
+	}
+	else
+	{
+		return "<b>".$tp->toHTML($tmp[1])."</b>";
+	}
+}
+SC_END
+	
+SC_BEGIN EMAILIMG
+global $post_info, $tp;
+if($post_info['user_id'])
+{
+	return (!$post_info['user_hideemail'] ? $tp->parseTemplate("{EMAILTO={$post_info['user_email']}}") : "");
+}
+return "";
+SC_END
+	
+SC_BEGIN EMAILITEM
+global $post_info, $tp;
+if($post_info['thread_parent'] == 0)
+{
+	return $tp->parseTemplate("{EMAIL_ITEM=".FORLAN_101."^plugin:forum.{$post_info['thread_id']}}");
+}
+SC_END
+
+SC_BEGIN PRINTITEM
+global $post_info, $tp;
+if($post_info['thread_parent'] == 0)
+{
+	return $tp->parseTemplate("{PRINT_ITEM=".FORLAN_102."^plugin:forum.{$post_info['thread_id']}}");
+}
+SC_END
+	
+SC_BEGIN SIGNATURE
+global $post_info, $tp;
+return ($post_info['user_signature'] ? "<br /><hr style='width:15%; text-align:left' /><span class='smalltext'>".$tp->toHTML($post_info['user_signature'],TRUE)."</span>" : "");
+SC_END
+	
+SC_BEGIN PROFILEIMG
+global $post_info, $tp;
+if (USER && $post_info['user_id']) {
+return $tp->parseTemplate("{PROFILE={$post_info['user_id']}}");
+} else {
+return "";
+}
+SC_END
+	
+SC_BEGIN POSTS
+global $post_info;
+if ($post_info['user_id']) {
+return LAN_67.": ".$post_info['user_forums']."<br />";
+}
+SC_END
+	
+SC_BEGIN VISITS
+global $post_info;
+if ($post_info['user_id']) {
+return LAN_09.": ".$post_info['user_visits']."<br />";
+}
+SC_END
+	
+SC_BEGIN EDITIMG
+global $post_info, $thread_info, $thread_id;
+if ($post_info['user_id'] != '0' && $post_info['user_name'] === USERNAME && $thread_info['head']['thread_active']) {
+return "<a href='forum_post.php?edit.".$post_info['thread_id']."'>".IMAGE_edit."</a> ";
+} else {
+return "";
+}
+SC_END
+	
+SC_BEGIN CUSTOMTITLE
+global $post_info, $tp;
+if ($post_info['user_customtitle']) {
+return $tp->toHTML($post_info['user_customtitle'])."<br />";
+}
+SC_END
+	
+SC_BEGIN WEBSITE
+global $post_info, $tp;
+if ($post_info['user_homepage']) {
+return LAN_08.": ".$post_info['user_homeapage']."<br />";
+}
+SC_END
+	
+SC_BEGIN WEBSITEIMG
+global $post_info;
+if ($post_info['user_homepage'] && $post_info['user_homepage'] != "http://") {
+return "<a href='{$post_info['user_homepage']}'>".IMAGE_website."</a>";
+}
+SC_END
+	
+SC_BEGIN QUOTEIMG
+global $thread_info, $post_info, $forum_info;
+if (check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass']) && $thread_info["head"]["thread_active"]) {
+return "<a href='".e_PLUGIN."forum/forum_post.php?quote.{$post_info['thread_id']}'>".IMAGE_quote."</a>";
+}
+SC_END
+	
+SC_BEGIN REPORTIMG
+global $post_info, $from;
+if (USER) {
+return "<a href='".e_PLUGIN."forum/forum_viewtopic.php?{$post_info['thread_id']}.{$from}.report'>".IMAGE_report."</a> ";
+}
+SC_END
+	
+SC_BEGIN RPG
+global $post_info;
+return rpg($post_info['user_join'],$post_info['user_forums']);
+SC_END
+	
+SC_BEGIN MEMBERID
+global $post_info, $ldata, $pref, $forum_info;
+if ($post_info['anon']) {
+return "";
+}
+
+$fmod = ($post_info['user_class'] != "" && check_class($forum_info['forum_moderators'], $post_info['user_class'], TRUE));
+if(!$fmod && $forum_info['forum_moderators'] == e_UC_ADMIN)
+{
+	$fmod = $post_info['user_admin'];
+}
+if (!array_key_exists($post_info['user_id'],$ldata)) {
+	$ldata[$post_info['user_id']] = get_level($post_info['user_id'], $post_info['user_forums'], $post_info['user_comments'], $post_info['user_chats'], $post_info['user_visits'], $post_info['user_join'], $post_info['user_admin'], $post_info['user_perms'], $pref, $fmod);
+}
+return $ldata[$post_info['user_id']][0];
+SC_END
+	
+SC_BEGIN LEVEL
+global $post_info, $ldata, $pref, $forum_info;
+if ($post_info['anon']) {
+return "";
+}
+$fmod = ($post_info['user_class'] != "" && check_class($forum_info['forum_moderators'], $post_info['user_class'], TRUE));
+if(!$fmod && $forum_info['forum_moderators'] == e_UC_ADMIN)
+{
+	$fmod = $post_info['user_admin'];
+}
+if (!array_key_exists($post_info['user_id'],$ldata)) {
+$ldata[$post_info['user_id']] = get_level($post_info['user_id'], $post_info['user_forums'], $post_info['user_comments'], $post_info['user_chats'], $post_info['user_visits'], $post_info['user_join'], $post_info['user_admin'], $post_info['user_perms'], $pref, $fmod);
+}
+if($parm == 'pic')
+{
+return $ldata[$post_info['user_id']]['pic'];
+}
+if($parm == 'name')
+{
+return $ldata[$post_info['user_id']]['name'];
+}
+if($parm == 'special')
+{
+return $ldata[$post_info['user_id']]['special'];
+}
+if($parm == 'userid')
+{
+return $ldata[$post_info['user_id']]['userid'];
+}
+return $ldata[$post_info['user_id']][1];
+SC_END
+	
+SC_BEGIN MODOPTIONS
+if (MODERATOR) {
+return showmodoptions();
+}
+SC_END
+	
+SC_BEGIN LASTEDIT
+global $post_info, $gen;
+if ($post_info['thread_edit_datestamp']) {
+return $gen->convert_date($post_info['thread_edit_datestamp'],'forum');
+}
+SC_END
+
+SC_BEGIN POLL
+global $pollstr;
+return $pollstr;
+SC_END
+
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_sql.php 75/e107_plugins/forum/forum_sql.php
--- 6171/e107_plugins/forum/forum_sql.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_sql.php	2005-05-20 21:03:54.000000000 -0500
@@ -0,0 +1,39 @@
+CREATE TABLE forum (
+	forum_id int(10) unsigned NOT NULL auto_increment,
+	forum_name varchar(250) NOT NULL default '',
+	forum_description text NOT NULL,
+	forum_parent int(10) unsigned NOT NULL default '0',
+	forum_sub int(10) unsigned NOT NULL default '0',
+	forum_datestamp int(10) unsigned NOT NULL default '0',
+	forum_moderators text NOT NULL,
+	forum_threads int(10) unsigned NOT NULL default '0',
+	forum_replies int(10) unsigned NOT NULL default '0',
+	forum_lastpost_user varchar(200) NOT NULL default '',
+	forum_lastpost_info varchar(40) NOT NULL default '',
+	forum_class varchar(100) NOT NULL default '',
+	forum_order int(10) unsigned NOT NULL default '0',
+	forum_postclass tinyint(3) unsigned NOT NULL default '0',
+	PRIMARY KEY  (forum_id)
+	) TYPE=MyISAM AUTO_INCREMENT=1
+
+CREATE TABLE forum_t (
+	thread_id int(10) unsigned NOT NULL auto_increment,
+	thread_name varchar(250) NOT NULL default '',
+	thread_thread text NOT NULL,
+	thread_forum_id int(10) unsigned NOT NULL default '0',
+	thread_datestamp int(10) unsigned NOT NULL default '0',
+	thread_parent int(10) unsigned NOT NULL default '0',
+	thread_user varchar(250) NOT NULL default '',
+	thread_views int(10) unsigned NOT NULL default '0',
+	thread_active tinyint(3) unsigned NOT NULL default '0',
+	thread_lastpost int(10) unsigned NOT NULL default '0',
+	thread_s tinyint(1) unsigned NOT NULL default '0',
+	thread_edit_datestamp int(10) unsigned NOT NULL default '0',
+	thread_lastuser varchar(30) NOT NULL default '',
+	thread_total_replies int(10) unsigned NOT NULL default '0',
+	PRIMARY KEY  (thread_id),
+	KEY thread_parent (thread_parent),
+	KEY thread_datestamp (thread_datestamp),
+	KEY thread_forum_id (thread_forum_id)
+	) TYPE=MyISAM AUTO_INCREMENT=1;
+
diff -ruN 6171/e107_plugins/forum/forum_stats.php 75/e107_plugins/forum/forum_stats.php
--- 6171/e107_plugins/forum/forum_stats.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_stats.php	2005-11-30 21:18:30.000000000 -0600
@@ -0,0 +1,370 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_stats.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/12/01 03:18:30 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once('../../class2.php');
+
+@include_once e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_stats.php';
+@include_once e_PLUGIN.'forum/languages/English/lan_forum_stats.php';
+@require_once(e_PLUGIN.'forum/forum_class.php');
+$gen = new convert;
+
+$barl = (file_exists(THEME."images/barl.png") ? THEME."images/barl.png" : e_PLUGIN."poll/images/barl.png");
+$barr = (file_exists(THEME."images/barr.png") ? THEME."images/barr.png" : e_PLUGIN."poll/images/barr.png");
+$bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_PLUGIN."poll/images/bar.png");
+
+require_once(HEADERF);
+
+$total_posts = $sql -> db_Count("forum_t");
+$total_topics = $sql -> db_Count("forum_t", "(*)", "WHERE thread_parent=0");
+$total_replies = $sql -> db_Count("forum_t", "(*)", "WHERE thread_parent!=0");
+$total_views = $sql->db_Count("SELECT sum(thread_views) FROM ".MPREFIX."forum_t", "generic");
+
+$firstpost = $sql -> db_Select("forum_t", "thread_datestamp", "ORDER BY thread_datestamp ASC LIMIT 0,1", "nowhere");
+$fp = $sql -> db_Fetch();
+
+$open_ds = $fp['thread_datestamp'];
+$open_date = $gen->convert_date($open_ds, "long");
+$open_since = $gen -> computeLapse($open_ds);
+$postsperday = round($total_posts / ((time()-$open_ds) / 86400));
+
+$query = "SHOW TABLE STATUS FROM $mySQLdefaultdb";
+$sql -> db_Select_gen($query);
+$array = $sql -> db_getList();
+foreach($array as $table)
+{
+	if($table['Name'] == MPREFIX."forum_t")
+	{
+		$db_size = parsesize($table['Data_length']);
+		$avg_row_len = parsesize($table['Avg_row_length']);
+		break;
+	}
+}
+
+
+$query = "
+SELECT ft.thread_id, ft.thread_user, ft.thread_name, ft.thread_total_replies, ft.thread_datestamp, f.forum_class, u.user_name FROM #forum_t as ft 
+LEFT JOIN #user AS u ON ft.thread_user = u.user_id 
+LEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id 
+WHERE ft.thread_parent = 0 
+AND ft.thread_active != 0 
+AND f.forum_class IN (".USERCLASS_LIST.") 
+ORDER BY thread_total_replies DESC LIMIT 0,10";
+$sql -> db_Select_gen($query);
+$most_activeArray = $sql -> db_getList();
+
+$query = "
+SELECT ft.*, f.forum_class, user_name FROM #forum_t as ft
+LEFT JOIN #user AS u ON ft.thread_user = u.user_id
+LEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id
+WHERE ft.thread_parent=0
+AND f.forum_class IN (".USERCLASS_LIST.")
+ORDER BY thread_views DESC LIMIT 0,10";
+
+$sql -> db_Select_gen($query);
+$most_viewedArray = $sql -> db_getList();
+
+$sql->db_Select("user", "user_id, user_name, user_forums", "ORDER BY user_forums DESC LIMIT 0, 10", "no_where");
+$posters = $sql -> db_getList();
+$top_posters = array();
+foreach($posters as $poster)
+{
+	$percen = round(($poster['user_forums'] / $total_posts) * 100, 2);
+	$top_posters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['user_forums'], "percentage" => $percen);
+}
+
+$query = "
+SELECT FLOOR(thread_user) as t_user, COUNT(FLOOR(ft.thread_user)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft 
+LEFT JOIN #user AS u ON FLOOR(ft.thread_user) = u.user_id 
+WHERE ft.thread_parent=0
+GROUP BY t_user 
+ORDER BY ucount DESC
+LIMIT 0,10";
+$sql -> db_Select_gen($query);
+$posters = $sql -> db_getList();
+$top_topic_starters = array();
+foreach($posters as $poster)
+{
+	$percen = round(($poster['ucount'] / $total_topics) * 100, 2);
+	$top_topic_starters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen);
+}
+
+$query = "
+SELECT FLOOR(thread_user) as t_user, COUNT(FLOOR(ft.thread_user)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft 
+LEFT JOIN #user AS u ON FLOOR(ft.thread_user) = u.user_id 
+WHERE ft.thread_parent!=0
+GROUP BY t_user
+ORDER BY ucount DESC
+LIMIT 0,10";
+$sql -> db_Select_gen($query);
+$posters = $sql -> db_getList();
+
+$top_repliers = array();
+foreach($posters as $poster)
+{
+	$percen = round(($poster['ucount'] / $total_replies) * 100, 2);
+	$top_repliers[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen);
+}
+
+
+
+$text = "
+<div class='spacer'>
+<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader'>".FSLAN_1."</td>
+</tr>
+
+<tr>
+<td class='forumheader3'>
+	<table style='width: 100%;'>
+	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_2.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>$open_date</td></tr>
+	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_3.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>$open_since</td></tr>
+	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_4.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>$total_posts</td></tr>
+	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_5.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>$total_topics</td></tr>
+	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_6.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>$total_replies</td></tr>
+	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_7.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>$total_views</td></tr>
+	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_24.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>$postsperday</td></tr>
+	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_8.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>$db_size</td></tr>
+	<tr><td style='width: 50%; text-align: right;'><b>".FSLAN_9.":</b>&nbsp;&nbsp;</td><td style='width: 50%;'>$avg_row_len</td></tr>
+
+	</tr>
+	</table>
+</td>
+</tr>
+</table>
+</div>
+
+<div class='spacer'>
+<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader' colspan='5'>".FSLAN_10."</td>
+</tr>
+<tr>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_11."</td>
+<td style='width: 40%;' class='fcaption'>".FSLAN_12."</td>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_13."</td>
+<td style='width: 20%; text-align: center;' class='fcaption'>".FSLAN_14."</td>
+<td style='width: 20%; text-align: center;' class='fcaption'>".FSLAN_15."</td>
+</tr>
+";
+
+$count=1;
+foreach($most_activeArray as $ma)
+{
+	if($ma['user_name'])
+	{
+		$uinfo = "<a href='".e_BASE."user.php?id.{$ma['thread_user']}'>{$ma['user_name']}</a>";
+	}
+	else
+	{
+		$tmp = explode(chr(1), $ma['thread_anon']);
+		$uinfo = $tp->toHTML($tmp[0]);
+	}
+		
+	$text .= "<tr>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
+	<td style='width: 40%;' class='forumheader3'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$ma['thread_id']}'>{$ma['thread_name']}</a></td>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>{$ma['thread_total_replies']}</td>
+	<td style='width: 20%; text-align: center;' class='forumheader3'>{$uinfo}</td>
+	<td style='width: 20%; text-align: center;' class='forumheader3'>".$gen->convert_date($ma['thread_datestamp'], "forum")."</td>
+	</tr>
+	";
+	$count++;
+}
+$text .= "</table>
+</div>
+
+<div class='spacer'>
+<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader' colspan='5'>".FSLAN_16."</td>
+</tr>
+<tr>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_11."</td>
+<td style='width: 40%;' class='fcaption'>".FSLAN_12."</td>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_17."</td>
+<td style='width: 20%; text-align: center;' class='fcaption'>".FSLAN_14."</td>
+<td style='width: 20%; text-align: center;' class='fcaption'>".FSLAN_15."</td>
+</tr>
+";
+
+$count=1;
+foreach($most_viewedArray as $ma)
+{
+	extract($ma);
+	$text .= "<tr>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
+	<td style='width: 40%;' class='forumheader3'><a href='".e_PLUGIN."forum/forum_viewtopic.php?$thread_id'>$thread_name</a></td>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$thread_views</td>
+	<td style='width: 20%; text-align: center;' class='forumheader3'><a href='".e_BASE."user.php?id.$thread_user'>$user_name</a></td>
+	<td style='width: 20%; text-align: center;' class='forumheader3'>".$gen->convert_date($thread_datestamp, "forum")."</td>
+	</tr>
+	";
+	$count++;
+}
+$text .= "</table>
+</div>
+
+<div class='spacer'>
+<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader' colspan='5'>".FSLAN_18."</td>
+</tr>
+<tr>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_11."</td>
+<td style='width: 20%;' class='fcaption'>".FSLAN_19."</td>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_20."</td>
+<td style='width: 10%; text-align: center;' class='fcaption'>%</td>
+<td style='width: 50%; text-align: center;' class='fcaption'>&nbsp;</td>
+</tr>
+";
+
+$count=1;
+foreach($top_posters as $ma)
+{
+	extract($ma);
+	$text .= "<tr>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
+	<td style='width: 20%;' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$user_forums</td>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$percentage%</td>
+	<td style='width: 50%;' class='forumheader3'>
+
+	<div style='background-image: url($barl); width: 5px; height: 14px; float: left;'></div>
+	<div style='background-image: url($bar); width: ".intval($percentage)."%; height: 14px; float: left;'></div>
+	<div style='background-image: url($barr); width: 5px; height: 14px; float: left;'></div>
+
+	</td>
+	</tr>
+	";
+	$count++;
+}
+$text .= "
+</table>
+</div>
+
+<div class='spacer'>
+<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader' colspan='5'>".FSLAN_21."</td>
+</tr>
+<tr>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_11."</td>
+<td style='width: 20%;' class='fcaption'>".FSLAN_19."</td>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_20."</td>
+<td style='width: 10%; text-align: center;' class='fcaption'>%</td>
+<td style='width: 50%; text-align: center;' class='fcaption'>&nbsp;</td>
+</tr>
+";
+
+$count=1;
+foreach($top_topic_starters as $ma)
+{
+	extract($ma);
+	$text .= "<tr>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
+	<td style='width: 20%;' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$user_forums</td>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$percentage%</td>
+	<td style='width: 50%; text-align: center;' class='forumheader3'>
+
+	<div style='background-image: url($barl); width: 5px; height: 14px; float: left;'></div>
+	<div style='background-image: url($bar); width: ".intval($percentage)."%; height: 14px; float: left;'></div>
+	<div style='background-image: url($barr); width: 5px; height: 14px; float: left;'></div>
+	
+	</td>
+	</tr>
+	";
+	$count++;
+}
+$text .= "</table>
+</div>
+
+
+<div class='spacer'>
+<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader' colspan='5'>".FSLAN_22."</td>
+</tr>
+<tr>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_11."</td>
+<td style='width: 20%;' class='fcaption'>".FSLAN_19."</td>
+<td style='width: 10%; text-align: center;' class='fcaption'>".FSLAN_20."</td>
+<td style='width: 10%; text-align: center;' class='fcaption'>%</td>
+<td style='width: 50%; text-align: center;' class='fcaption'>&nbsp;</td>
+</tr>
+";
+
+$count=1;
+foreach($top_repliers as $ma)
+{
+	extract($ma);
+	$text .= "<tr>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
+	<td style='width: 20%;' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$user_forums</td>
+	<td style='width: 10%; text-align: center;' class='forumheader3'>$percentage%</td>
+	<td style='width: 50%; text-align: center;' class='forumheader3'>
+	
+	<div style='background-image: url($barl); width: 5px; height: 14px; float: left;'></div>
+	<div style='background-image: url($bar); width: ".intval($percentage)."%; height: 14px; float: left;'></div>
+	<div style='background-image: url($barr); width: 5px; height: 14px; float: left;'></div>
+	
+	</td>
+	</tr>
+	";
+	$count++;
+}
+$text .= "</table>
+</div>
+";
+
+
+$ns -> tablerender(FSLAN_23, $text);
+
+
+require_once(FOOTERF);
+
+function parsesize($size) {
+	$kb = 1024;
+	$mb = 1024 * $kb;
+	$gb = 1024 * $mb;
+	$tb = 1024 * $gb;
+	if(!$size)
+	{
+		return '0';
+	}
+	if ($size < $kb) {
+		return $size." b";
+	}
+	else if($size < $mb) {
+		return round($size/$kb, 2)." kb";
+	}
+	else if($size < $gb) {
+		return round($size/$mb, 2)." mb";
+	}
+	else if($size < $tb) {
+		return round($size/$gb, 2)." gb";
+	} else {
+		return round($size/$tb, 2)." tb";
+	}
+}
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_test.php 75/e107_plugins/forum/forum_test.php
--- 6171/e107_plugins/forum/forum_test.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_test.php	2005-01-27 13:52:49.000000000 -0600
@@ -0,0 +1,21 @@
+<?php
+require_once('../../class2.php');
+require_once(e_PLUGIN.'forum/forum_class.php');
+	
+$timestart = microtime();
+$forum = new e107forum;
+	
+//for($i=1; $i<=7000; $i++) {
+// $x = $forum->update_lastpost('thread',$i);
+//}
+	
+set_time_limit(240);
+$forum->update_lastpost('forum', 'all');
+//$x = $forum->update_lastpost('forum',16);
+	
+	
+$timeend = microtime();
+$diff = number_format(((substr($timeend, 0, 9)) + (substr($timeend, -10)) - (substr($timestart, 0, 9)) - (substr($timestart, -10))), 4);
+echo "<br />script generation took $diff s";
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_update_check.php 75/e107_plugins/forum/forum_update_check.php
--- 6171/e107_plugins/forum/forum_update_check.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_update_check.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,73 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_update_check.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+$dbupdatep['forum_07'] =  LAN_UPDATE_8." .617 forums ".LAN_UPDATE_9." .7 forums";
+function update_forum_07($type) 
+{
+	global $sql, $mySQLdefaultdb;
+	if($type == 'do')
+	{
+		if(!isset($_POST['updateall']))
+		{	
+			include_once(e_PLUGIN.'forum/forum_update.php');
+		}
+	}
+	else
+	{
+		// FALSE = needed, TRUE = not needed.
+		if($sql->db_Select("plugin", "plugin_version", "plugin_name = 'Forum'"))
+		{
+			$row = $sql->db_Fetch();
+			if($row['plugin_version'] < 1.2)
+			{
+				return FALSE;
+			}
+		}
+		$fields = mysql_list_fields($mySQLdefaultdb, MPREFIX."forum");
+		if(!$fields)
+		{
+			return TRUE;
+		}
+		$columns = mysql_num_fields($fields);
+		for ($i = 0; $i < $columns; $i++)
+		{
+			if ("forum_lastpost_info" == mysql_field_name($fields, $i))
+			{
+				$flist = mysql_list_fields($mySQLdefaultdb, MPREFIX."forum_t");
+				$cols = mysql_num_fields($flist);
+				for ($x = 0; $x < $cols; $x++)
+				{
+					if("thread_anon" == mysql_field_name($flist, $x))
+					{
+						return FALSE; //needed
+					}
+				}
+			}
+			if("forum_sub" == mysql_field_name($fields, $i))
+			{
+				return TRUE; //not needed
+			}
+		}
+		return FALSE; //needed
+	}
+}
+
+?>
+			
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_update.php 75/e107_plugins/forum/forum_update.php
--- 6171/e107_plugins/forum/forum_update.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_update.php	2006-01-09 03:55:14.000000000 -0600
@@ -0,0 +1,173 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_update.php,v $
+|     $Revision: 1.15 $
+|     $Date: 2006/01/09 09:55:14 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+require_once(e_PLUGIN.'forum/forum_class.php');
+global $ns;
+$forum = new e107forum;
+
+$timestart = microtime();
+$ttab = MPREFIX.'forum_t';
+	
+
+if($sql->db_Select("plugin", "plugin_version", "plugin_name = 'Forum'"))
+{
+	$row = $sql->db_Fetch();
+	$forum_version = $row['plugin_version'];
+}
+
+
+$forum_subs = FALSE;
+$fields = mysql_list_fields($mySQLdefaultdb, MPREFIX."forum");
+$columns = mysql_num_fields($fields);
+for ($i = 0; $i < $columns; $i++)
+{
+	if("forum_sub" == mysql_field_name($fields, $i))
+	{
+		$forum_subs = TRUE;
+	}
+}
+
+$text = "";
+if(!$forum_subs)
+{
+	$text .= forum_stage1();
+	$text .= forum_stage2();
+	$text .= forum_stage3();
+	$text .= forum_stage4();
+	$text .= forum_stage5();
+	$text .= forum_stage6();
+}
+
+if($forum_version < 1.2)
+{
+	$text .= mods_to_userclass();
+}
+$text .= set_forum_version();
+
+$timeend = microtime();
+$diff = number_format(((substr($timeend, 0, 9)) + (substr($timeend, -10)) - (substr($timestart, 0, 9)) - (substr($timestart, -10))), 4);
+$text .= "<br />script generation took $diff s";
+
+if ($pref['developer']) {
+	$ns->tablerender('forum upgrade',$text);
+}
+	
+function forum_stage1()
+{
+	global $sql;
+	$ttab = MPREFIX.'forum_t';
+	$sql->db_Select_gen("ALTER TABLE #forum_t ADD thread_edit_datestamp int(10) unsigned NOT NULL default '0'");
+	$sql->db_Select_gen("ALTER TABLE #forum_t ADD thread_lastuser varchar(30) NOT NULL default ''");
+	$sql->db_Select_gen("ALTER TABLE #forum_t ADD thread_total_replies int(10) unsigned NOT NULL default '0'");
+	$sql->db_Select_gen("ALTER TABLE #forum ADD forum_postclass TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL ;");
+	$sql->db_Select_gen("ALTER TABLE #forum ADD `forum_sub` INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL AFTER `forum_parent` ;");
+	return "Updated table structure <br />";
+}
+	
+function forum_stage2()
+{
+	global $sql;
+	$ttab = MPREFIX.'forum_t';
+//	$numrows = $sql->db_Update('forum_t', "thread_anon = SUBSTRING(thread_user,3) WHERE thread_user LIKE '0.%'");
+	$numrows = $sql->db_Update('forum_t', "thread_user = CAT('0.', thread_anon) WHERE thread_user = '0'");
+	return $ret."Updated anonymous post info ... $numrows rows updated<br />";
+}
+	
+function forum_stage3()
+{
+	global $sql;
+	$sql->db_Select_gen("ALTER TABLE #forum_t CHANGE thread_user thread_user varchar(250) NOT NULL default ''");
+	$sql->db_Select_gen("ALTER TABLE #forum_t DROP thread_anon"); 
+	return "Updated thread_user & forum_anon field<br />";
+}
+	
+function forum_stage4()
+{	
+	global $sql, $forum;
+	$sql->db_Select_gen("SELECT thread_parent AS id, COUNT(*) AS amount FROM #forum_t WHERE thread_parent !=0 GROUP BY thread_parent");
+	$threadArray = $sql->db_getList('ALL', FALSE, 0);
+	foreach($threadArray as $threads)
+	{
+		extract($threads);
+		$sql->db_Update("forum_t", "thread_total_replies=$amount WHERE thread_id=$id");
+	}
+
+	$ret = "Updated thread reply info...".count($threadArray). " threads updated.<br />";
+	$forum = new e107forum;
+	$forum->forum_update_counts('all');
+	return $ret."Updated forum thread count info. <br />";
+}
+
+function forum_stage5()
+{
+	global $sql, $forum;
+	$sql->db_Select_gen("ALTER TABLE #forum CHANGE forum_lastpost forum_lastpost_user varchar(200) NOT NULL default ''"); 
+	$sql->db_Select_gen("ALTER TABLE #forum ADD forum_lastpost_info varchar(40) NOT NULL default '' AFTER forum_lastpost_user");
+	set_time_limit(180);
+	$forum->update_lastpost('forum', 'all', TRUE);
+	return "Updated lastpost info <br />";
+}
+
+function forum_stage6()
+{
+	global $sql;
+	global $PLUGINS_DIRECTORY;
+	if(!$sql->db_Count('plugin','(*)',"WHERE plugin_name = 'Forum'"))
+	{
+		$sql->db_Insert('plugin',"0,'Forum','1.1','forum',1");
+		return "Forum entry added to plugin table, set as installed.<br />";
+	}
+	else
+	{
+		$sql->db_Update('plugin',"plugin_installflag = 1 WHERE plugin_name='Forum'");
+	}
+	$sql->db_Update('links',"link_url='{$PLUGINS_DIRECTORY}forum/forum.php' WHERE link_name='Forum'");
+
+}
+	
+function mods_to_userclass()
+{
+	global $sql;
+	require_once(e_HANDLER."userclass_class.php");
+	$_uc = new e_userclass;
+	if($sql->db_Select("forum", "forum_id, forum_moderators","forum_parent != 0"))
+	{
+		$fList = $sql->db_getList();
+		foreach($fList as $row)
+		{
+			if(!is_numeric($row['forum_moderators']))
+			{
+				$newclass = $_uc->class_create($row['forum_moderators'], "FORUM_MODS_");
+				$sql->db_Update("forum", "forum_moderators = '{$newclass}' WHERE forum_id = '{$row['forum_id']}'");
+			}
+		}
+	}
+	return "Forum moderators converted to userclasses <br />";
+}
+
+function set_forum_version()
+{
+	global $sql;
+	$new_version = "1.2";
+	$sql->db_Update('plugin',"plugin_version = '{$new_version}' WHERE plugin_name='Forum'");
+	return "Forum Version updated to version: $new_version <br />";
+}	
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_uploads.php 75/e107_plugins/forum/forum_uploads.php
--- 6171/e107_plugins/forum/forum_uploads.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_uploads.php	2005-02-24 21:35:30.000000000 -0600
@@ -0,0 +1,121 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_uploads.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/02/25 03:35:30 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+
+if(!USER)
+{
+	header("location:".e_BASE.$PLUGINS_DIRECTORY."forum/forum.php");
+	exit;
+}
+$lan_file = e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_uploads.php';
+include(file_exists($lan_file) ? $lan_file : e_PLUGIN.'forum/languages/English/lan_forum_uploads.php');
+
+if(is_array($_POST['delete']))
+{
+	foreach(array_keys($_POST['delete']) as $fname)
+	{
+		$f = explode("_", $fname);
+		if($f[1] == USERID)
+		{
+			$path = e_FILE."public/".$fname;
+			if(unlink($path) == TRUE)
+			{
+				$msg = FRMUP_2.": $path";
+			}
+			else
+			{
+				$msg = FRMUP_3.": $path";
+			}
+		}
+	}
+}
+
+include_once(e_HANDLER."file_class.php");
+include_once(HEADERF);
+if($msg)
+{
+	$ns->tablerender(FRMUP_4, $msg);
+}
+
+$fi = new e_file;
+$mask = ".*_".USERID."_FT.*";
+$fileList = $fi->get_files(e_FILE."public", $mask);
+if($sql->db_Select('forum_t','thread_id, thread_thread, thread_parent', "thread_thread REGEXP '.*_".USERID."_FT.*'"))
+{
+	$threadList = $sql->db_getList();
+}
+
+$filecount = 0;
+if(is_array($fileList))
+{
+	$txt = "
+	<form method='post' action='".e_SELF."'>
+	<table style='width:98%'>
+	<tr>
+		<td class='fcaption'>".FRMUP_5."</td>
+		<td class='fcaption'>".FRMUP_6."</td>
+	</tr>";
+	foreach($fileList as $finfo)
+	{
+		if($finfo['fname'])
+		{
+			$filecount++;
+			$txt .= "<tr><td class='forumheader3'><a href='".e_FILE."public/{$finfo['fname']}'>{$finfo['fname']}</a></td>";
+			$found = FALSE;
+			if(is_array($threadList))
+			{
+				foreach($threadList as $tinfo)
+				{
+					if(strpos($tinfo['thread_thread'], $finfo['fname']) != FALSE)
+					{
+						$found = $tinfo;
+						break;
+					}
+				}
+			}
+			if($found != FALSE)
+			{
+				if($tinfo['thread_parent'])
+				{
+					$txt .= "<td class='forumheader3'>".FRMUP_7.": <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$tinfo['thread_id']}.post'>{$tinfo['thread_parent']}</a></td>";
+				}
+				else
+				{
+					$txt .= "<td class='forumheader3'>".FRMUP_7.": <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$tinfo['thread_id']}'>{$tinfo['thread_id']}</a></td>";
+				}	
+			
+			}
+			else
+			{
+				$txt .= "<td class='forumheader3'>".FRMUP_8." <input class='button' type='submit' name='delete[{$finfo['fname']}]' value='".FRMUP_10."' /></td>";
+			}
+			$txt .= "</tr>";
+		}
+	}
+	$txt .= "</table>";
+}
+if(!$filecount) {
+	$ns->tablerender(FRMUP_1,FRMUP_9);
+	include_once(FOOTERF);
+	exit;
+}
+
+$ns->tablerender(FRMUP_1, $txt);
+include_once(FOOTERF);
+
diff -ruN 6171/e107_plugins/forum/forum_viewforum.php 75/e107_plugins/forum/forum_viewforum.php
--- 6171/e107_plugins/forum/forum_viewforum.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_viewforum.php	2006-05-16 12:29:51.000000000 -0500
@@ -0,0 +1,549 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_viewforum.php,v $
+|     $Revision: 1.54 $
+|     $Date: 2006/05/16 17:29:51 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+$lan_file = e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php';
+include(file_exists($lan_file) ? $lan_file : e_PLUGIN.'forum/languages/English/lan_forum_viewforum.php');
+
+if (isset($_POST['fjsubmit'])) {
+	header("location:".e_PLUGIN."forum/forum_viewforum.php?".$_POST['forumjump']);
+	exit;
+}
+
+if (!e_QUERY)
+{
+	header("Location:".e_PLUGIN."/forum/forum.php");
+	exit;
+}
+else
+{
+	$tmp = explode(".", e_QUERY);
+	$forum_id = intval($tmp[0]);
+	$from = intval($tmp[1]);
+	if (!$from)
+	{
+		$from = 0;
+	}
+}
+$view = 25;
+
+if(is_numeric(e_MENU))
+{
+	$from = (intval(e_MENU)-1)*$view;
+}
+require_once(e_PLUGIN.'forum/forum_class.php');
+$forum = new e107forum;
+
+$STARTERTITLE = LAN_54;
+$THREADTITLE = LAN_53;
+$REPLYTITLE = LAN_55;
+$LASTPOSTITLE = LAN_57;
+$VIEWTITLE = LAN_56;
+
+global $forum_info, $FORUM_CRUMB;
+$forum_info = $forum->forum_get($forum_id);
+
+if (!check_class($forum_info['forum_class']) || !check_class($forum_info['parent_class']) || !$forum_info['forum_parent'])
+{
+	header("Location:".e_PLUGIN."forum/forum.php");
+	exit;
+}
+
+if (!$FORUM_VIEW_START) {
+	if (file_exists(THEME."forum_viewforum_template.php"))
+	{
+		require_once(THEME."forum_viewforum_template.php");
+	}
+	else if (file_exists(THEME."forum_template.php"))
+	{
+		require_once(THEME."forum_template.php");
+	}
+	else
+	{
+		require_once(e_PLUGIN."forum/templates/forum_viewforum_template.php");
+	}
+}
+
+
+$forum_info['forum_name'] = $tp->toHTML($forum_info['forum_name'], TRUE, 'no_hook');
+$forum_info['forum_description'] = $tp->toHTML($forum_info['forum_description'], TRUE, 'no_hook');
+
+define("e_PAGETITLE", LAN_01." / ".$forum_info['forum_name']);
+define("MODERATOR", $forum_info['forum_moderators'] != "" && check_class($forum_info['forum_moderators']));
+$modArray = $forum->forum_getmods($forum_info['forum_moderators']);
+$message = "";
+if (MODERATOR)
+{
+	if ($_POST)
+	{
+		require_once(e_PLUGIN."forum/forum_mod.php");
+		$message = forum_thread_moderate($_POST);
+	}
+}
+
+$member_users = $sql->db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id!='0' ");
+$guest_users = $sql->db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id='0' ");
+$users = $member_users+$guest_users;
+
+require_once(HEADERF);
+$text='';
+if ($message)
+{
+	$ns->tablerender("", $message, array('forum_viewforum', 'msg'));
+}
+
+$topics = $forum->forum_get_topic_count($forum_id);
+
+if ($topics > $view)
+{
+	$pages = ceil($topics/$view);
+}
+else
+{
+	$pages = FALSE;
+}
+
+if ($pages)
+{
+	if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== FALSE || strpos($FORUM_VIEW_END, 'THREADPAGES') !== FALSE)
+	{
+		$parms = "{$topics},{$view},{$from},".e_SELF.'?'.$forum_id.'.[FROM],off';
+		$THREADPAGES = LAN_316." ".$tp->parseTemplate("{NEXTPREV={$parms}}");
+	}
+}
+
+if (check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass']))
+{
+	$NEWTHREADBUTTON = "<a href='".e_PLUGIN."forum/forum_post.php?nt.".$forum_id."'>".IMAGE_newthread."</a>";
+}
+
+if(substr($forum_info['forum_name'], 0, 1) == "*")
+{
+	$forum_info['forum_name'] = substr($forum_info['forum_name'], 1);
+	$container_only = true;
+}
+else
+{
+	$container_only = false;
+}
+
+if(substr($forum_info['sub_parent'], 0, 1) == "*")
+{
+	$forum_info['sub_parent'] = substr($forum_info['sub_parent'], 1);
+}
+
+if(is_array($FORUM_CRUMB))
+{
+	$search 	= array("{SITENAME}", "{SITENAME_HREF}");
+	$replace 	= array(SITENAME, "href='".e_BASE."index.php'");
+	$FORUM_CRUMB['sitename']['value'] = str_replace($search, $replace, $FORUM_CRUMB['sitename']['value']);
+
+	$search 	= array("{FORUMS_TITLE}", "{FORUMS_HREF}");
+	$replace 	= array(LAN_01, "href='".e_PLUGIN."forum/forum.php'");
+	$FORUM_CRUMB['forums']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forums']['value']);
+
+	$search 	= array("{PARENT_TITLE}");
+	$replace 	= array($tp->toHTML($forum_info['parent_name']));
+	$FORUM_CRUMB['parent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['parent']['value']);
+
+	if($forum_info['sub_parent'])
+	{
+		$search 	= array("{SUBPARENT_TITLE}", "{SUBPARENT_HREF}");
+		$replace 	= array($forum_info['sub_parent'], "href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_sub']}'");
+		$FORUM_CRUMB['subparent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['subparent']['value']);
+	}
+	else
+	{
+		$FORUM_CRUMB['subparent']['value'] = "";
+	}
+
+	$search 	= array("{FORUM_TITLE}");
+	$replace 	= array($forum_info['forum_name']);
+	$FORUM_CRUMB['forum']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forum']['value']);
+	$FORUM_CRUMB['fieldlist'] = "sitename,forums,parent,subparent,forum";
+
+	$BREADCRUMB = $tp->parseTemplate("{BREADCRUMB=FORUM_CRUMB}", true);
+
+}
+else
+{
+	$BREADCRUMB = "<a class='forumlink' href='".e_BASE."index.php'>".SITENAME."</a> -> <a class='forumlink' href='".e_PLUGIN."forum/forum.php'>".LAN_01."</a> -> ";
+	if($forum_info['sub_parent'])
+	{
+		$BREADCRUMB .= "<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_sub']}'>{$forum_info['sub_parent']}</a> -> ";
+	}
+	$BREADCRUMB .= $forum_info['forum_name']."</b>";
+}
+
+
+$FORUMTITLE = $forum_info['forum_name'];
+//$MODERATORS = LAN_404.": ".$forum_info['forum_moderators'];
+$MODERATORS = LAN_404.": ".implode(", ", $modArray);
+$BROWSERS = $users." ".($users == 1 ? LAN_405 : LAN_406)." (".$member_users." ".($member_users == 1 ? LAN_407 : LAN_409).", ".$guest_users." ".($guest_users == 1 ? LAN_408 : LAN_410).")";
+
+$ICONKEY = "
+	<table style='width:100%'>
+	<tr>
+	<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_new_small."</td>
+	<td style='width:10%' class='smallblacktext'>".LAN_79."</td>
+	<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_nonew_small."</td>
+	<td style='width:10%' class='smallblacktext'>".LAN_80."</td>
+	<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_sticky_small."</td>
+	<td style='width:10%' class='smallblacktext'>".LAN_202."</td>
+	<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_announce_small."</td>
+	<td style='width:10%' class='smallblacktext'>".LAN_396."</td>
+	</tr>
+	<tr>
+	<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_new_popular_small."</td>
+	<td style='width:2%' class='smallblacktext'>".LAN_79." ".LAN_395."</td>
+	<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_nonew_popular_small."</td>
+	<td style='width:10%' class='smallblacktext'>".LAN_80." ".LAN_395."</td>
+	<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_stickyclosed_small."</td>
+	<td style='width:10%' class='smallblacktext'>".LAN_203."</td>
+	<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_closed_small."</td>
+	<td style='width:10%' class='smallblacktext'>".LAN_81."</td>
+	</tr>
+	</table>";
+
+$SEARCH = "
+	<form method='get' action='".e_BASE."search.php'>
+	<p>
+	<input class='tbox' type='text' name='q' size='20' value='' maxlength='50' />
+	<input type='hidden' name='r' value='0' />
+	<input type='hidden' name='ref' value='forum' />
+	<input class='button' type='submit' name='s' value='".LAN_180."' />
+	</p>
+	</form>";
+
+if(check_class($forum_info['forum_postclass']))
+{
+	$PERMS = LAN_204." - ".LAN_206." - ".LAN_208;
+}
+else
+{
+	$PERMS = LAN_205." - ".LAN_207." - ".LAN_209;
+}
+
+$sticky_threads = 0;
+$stuck = FALSE;
+$reg_threads = 0;
+$unstuck = FALSE;
+
+$thread_list = $forum->forum_get_topics($forum_id, $from, $view);
+$sub_list = $forum->forum_getsubs($forum_id);
+//print_a($sub_list);
+$gen = new convert;
+
+$SUBFORUMS = "";
+if(is_array($sub_list))
+{
+	$newflag_list = $forum->forum_newflag_list();
+	$sub_info = "";
+	foreach($sub_list as $sub)
+	{
+		$sub_info .= parse_sub($sub);
+	}
+	$SUBFORUMS = $FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END;
+}
+
+
+if (count($thread_list) )
+{
+	foreach($thread_list as $thread_info) {
+		$idArray[] = $thread_info['thread_id'];
+	}
+	$inList = '('.implode(',', $idArray).')';
+	foreach($thread_list as $thread_info) {
+		if ($thread_info['thread_s']) {
+			$sticky_threads ++;
+		}
+		if ($sticky_threads > 0 && !$stuck && $pref['forum_hilightsticky'])
+		{
+			if($FORUM_IMPORTANT_ROW)
+			{
+				$forum_view_forum .= $FORUM_IMPORTANT_ROW;
+			}
+			else
+			{
+				$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5'  class='forumheader'><span class='mediumtext'><b>".LAN_411."</b></span></td></tr>";
+			}
+			$stuck = TRUE;
+		}
+		if (!$thread_info['thread_s'])
+		{
+			$reg_threads ++;
+		}
+		if ($reg_threads == "1" && !$unstuck && $stuck)
+		{
+			if($FORUM_NORMAL_ROW)
+			{
+				$forum_view_forum .= $FORUM_NORMAL_ROW;
+			}
+			else
+			{
+				$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5'  class='forumheader'><span class='mediumtext'><b>".LAN_412."</b></span></td></tr>";
+			}
+			$unstuck = TRUE;
+		}
+		$forum_view_forum .= parse_thread($thread_info);
+	}
+}
+else
+{
+	$forum_view_forum .= "<tr><td class='forumheader' colspan='6'>".LAN_58."</td></tr>";
+}
+
+$sql->db_Select("forum", "*", "forum_parent !=0 AND forum_class!='255' ");
+$FORUMJUMP = forumjump();
+$TOPLINK = "<a href='".e_SELF."?".e_QUERY."#top' onclick=\"window.scrollTo(0,0);\">".LAN_02."</a>";
+
+if($container_only)
+{
+	$FORUM_VIEW_START = ($FORUM_VIEW_START_CONTAINER ? $FORUM_VIEW_START_CONTAINER : $FORUM_VIEW_START);
+	$FORUM_VIEW_END = ($FORUM_VIEW_END_CONTAINER ? $FORUM_VIEW_END_CONTAINER : $FORUM_VIEW_END);
+	$forum_view_forum = "";
+}
+
+$forum_view_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_START);
+$forum_view_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_END);
+
+
+if ($pref['forum_enclose'])
+{
+	$ns->tablerender($pref['forum_title'], $forum_view_start.$forum_view_subs.$forum_view_forum.$forum_view_end, array('forum_viewforum', 'main1'));
+}
+else
+{
+	echo $forum_view_start.$forum_view_forum.$forum_view_end;
+}
+
+echo "<script type=\"text/javascript\">
+	function confirm_(thread_id)
+	{
+		return confirm(\"".$tp->toJS(LAN_434)."\");
+	}
+	</script>";
+
+require_once(FOOTERF);
+
+
+function parse_thread($thread_info)
+{
+	global $forum, $tp, $FORUM_VIEW_FORUM, $gen, $pref, $forum_id, $menu_pref;
+	$text = "";
+	$VIEWS = $thread_info['thread_views'];
+	$REPLIES = $thread_info['thread_total_replies'];
+
+
+	if ($REPLIES)
+	{
+		$lastpost_datestamp = $gen->convert_date($thread_info['thread_lastpost'], 'forum');
+		$tmp = explode(".", $thread_info['thread_lastuser'], 2);
+		if($thread_info['lastpost_username'])
+		{
+			$LASTPOST = "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$thread_info['lastpost_username']."</a>";
+		}
+		else
+		{
+			if($tmp[1])
+			{
+				$LASTPOST = $tp->toHTML($tmp[1]);
+			}
+			else
+			{
+				$LASTPOST = FORLAN_19;
+			}
+		}
+		$LASTPOST .= "<br />".$lastpost_datestamp;
+	}
+	else
+	{
+		$REPLIES = LAN_317;
+		$LASTPOST = " - ";
+	}
+
+	$newflag = FALSE;
+	if (USER)
+	{
+		if ($thread_info['thread_lastpost'] > USERLV && !preg_match("#\b".$thread_info['thread_id']."\b#", USERVIEWED))
+		{
+			$newflag = TRUE;
+		}
+	}
+
+	$THREADDATE = $gen->convert_date($thread_info['thread_datestamp'], 'forum');
+	$ICON = ($newflag ? IMAGE_new : IMAGE_nonew);
+	if ($REPLIES >= $pref['forum_popular'] && $REPLIES != "None") {
+		$ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular);
+	}
+
+	$THREADTYPE = '';
+	if ($thread_info['thread_s'] == 1)
+	{
+		$ICON = ($thread_info['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed);
+		$THREADTYPE = '['.LAN_202.']<br />';
+	}
+	elseif($thread_info['thread_s'] == 2)
+	{
+		$ICON = IMAGE_announce;
+		$THREADTYPE = '['.LAN_396.']<br />';
+	}
+	elseif(!$thread_info['thread_active'])
+	{
+		$ICON = IMAGE_closed;
+	}
+
+	$thread_name = strip_tags($tp->toHTML($thread_info['thread_name'], false, 'no_hook'));
+	if (strtoupper($THREADTYPE) == strtoupper(substr($thread_name, 0, strlen($THREADTYPE)))) {
+		$thread_name = substr($thread_name, strlen($THREADTYPE));
+	}
+	if ($pref['forum_tooltip']) {
+		$thread_thread = strip_tags($tp->toHTML($thread_info['thread_thread'], true, 'no_hook'));
+		$tip_length = ($pref['forum_tiplength'] ? $pref['forum_tiplength'] : 400);
+		if (strlen($thread_thread) > $tip_length) {
+			$thread_thread = substr($thread_thread, 0, $tip_length)." ".$menu_pref['newforumposts_postfix'];
+		}
+		$thread_thread = str_replace("'", "&#39;", $thread_thread);
+		$title = "title='".$thread_thread."'";
+	} else {
+		$title = "";
+	}
+	$THREADNAME = "<a {$title} href='".e_PLUGIN."forum/forum_viewtopic.php?{$thread_info['thread_id']}'>{$thread_name}</a>";
+
+	$pages = ceil(($REPLIES+1)/$pref['forum_postspage']);
+	if ($pages > 1)
+	{
+		for($a = 0; $a <= ($pages-1); $a++)
+		{
+			$PAGES .= $PAGES ? " " : "";
+			$PAGES .= "<a href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_info['thread_id'].".".($a * $pref['forum_postspage'])."'>".($a+1)."</a>";
+		}
+		$PAGES = LAN_316." [&nbsp;".$PAGES."&nbsp;]";
+	}
+	else
+	{
+		$PAGES = "";
+	}
+
+	if (MODERATOR)
+	{
+		$thread_id = $thread_info['thread_id'];
+		$ADMIN_ICONS = "
+			<form method='post' action='".e_SELF."?{$forum_id}' id='frmMod_{$forum_id}_{$thread_id}' style='margin:0;'><div>
+			";
+
+		$ADMIN_ICONS .= "<input type='image' ".IMAGE_admin_delete." name='delete_$thread_id' value='thread_action' onclick=\"return confirm_($thread_id)\" /> \n";
+
+		$ADMIN_ICONS .= ($thread_info['thread_s'] == 1) ? "<input type='image' ".IMAGE_admin_unstick." name='unstick_{$thread_id}' value='thread_action' /> " :
+		 "<input type='image' ".IMAGE_admin_stick." name='stick_{$thread_id}' value='thread_action' /> ";
+		$ADMIN_ICONS .= ($thread_info['thread_active']) ? "<input type='image' ".IMAGE_admin_lock." name='lock_{$thread_id}' value='thread_action' /> " :
+		 "<input type='image' ".IMAGE_admin_unlock." name='unlock_{$thread_id}' value='thread_action' /> ";
+		$ADMIN_ICONS .= "<a href='".e_PLUGIN."forum/forum_conf.php?move.".$thread_id."'>".IMAGE_admin_move."</a>";
+		$ADMIN_ICONS .= "
+			</div></form>
+			";
+	}
+
+	$text .= "</td>
+		<td style='vertical-align:top; text-align:center; width:20%' class='forumheader3'>".$THREADDATE."<br />
+		";
+	$tmp = explode(".", $thread_info['thread_user'], 2);
+	if($thread_info['user_name'])
+	{
+		$POSTER = "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$thread_info['user_name']."</a>";
+	}
+	else
+	{
+		if($tmp[1])
+		{
+			$x = explode(chr(1), $tmp[1]);
+			$POSTER = $tp->toHTML($x[0]);
+		}
+		else
+		{
+			$POSTER = FORLAN_19;
+		}
+	}
+
+	if ($thread_info['thread_s'] == 1 && $FORUM_VIEW_FORUM_STICKY)
+	{
+		return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_STICKY));
+	}
+
+	if ($thread_info['thread_s'] == 2 && $FORUM_VIEW_FORUM_ANNOUNCE)
+	{
+		return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_ANNOUNCE));
+	}
+
+	return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM));
+}
+
+function parse_sub($subInfo)
+{
+	global $FORUM_VIEW_SUB, $gen, $tp, $newflag_list;
+	$SUB_FORUMTITLE = "<a href='".e_PLUGIN."forum/forum_viewforum.php?{$subInfo['forum_id']}'>{$subInfo['forum_name']}</a>";
+	$SUB_DESCRIPTION = $tp->toHTML($subInfo['forum_description'], false, 'no_hook');
+	$SUB_THREADS = $subInfo['forum_threads'];
+	$SUB_REPLIES = $subInfo['forum_replies'];
+	if(USER && is_array($newflag_list) && in_array($subInfo['forum_id'], $newflag_list))
+	{
+		$NEWFLAG = "<a href='".e_SELF."?mfar.{$subInfo['forum_id']}'>".IMAGE_new."</a>";
+	}
+	else
+	{
+		$NEWFLAG = IMAGE_nonew;
+	}
+
+	if($subInfo['forum_lastpost_info'])
+	{
+		$tmp = explode(".", $subInfo['forum_lastpost_info']);
+		$lp_thread = "<a href='".e_PLUGIN."forum/forum_viewtopic.php?{$tmp[1]}.last'>".IMAGE_post2."</a>";
+		$lp_date = $gen->convert_date($tmp[0], 'forum');
+		$tmp = explode(".", $subInfo['forum_lastpost_user']);
+		if($subInfo['user_name'])
+		{
+			$lp_name = "<a href='".e_BASE."user.php?{$tmp[0]}'>{$subInfo['user_name']}</a>";
+		}
+		else
+		{
+			$lp_name = $tmp[1];
+		}
+		$SUB_LASTPOST = $lp_date."<br />".$lp_name." ".$lp_thread;
+	}
+	else
+	{
+		$SUB_LASTPOST = "-";
+	}
+	return  (preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_SUB));
+}
+
+function forumjump()
+{
+	global $forum;
+	$jumpList = $forum->forum_get_allowed();
+	$text = "<form method='post' action='".e_SELF."'><p>".LAN_403.": <select name='forumjump' class='tbox'>";
+	foreach($jumpList as $key => $val)
+	{
+		$text .= "\n<option value='".$key."'>".$val."</option>";
+	}
+	$text .= "</select> <input class='button' type='submit' name='fjsubmit' value='".LAN_03."' />&nbsp;&nbsp;&nbsp;&nbsp;<a href='".e_SELF."?".$_SERVER['QUERY_STRING']."#top'>".LAN_02."</a></p></form>";
+	return $text;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/forum_viewtopic.php 75/e107_plugins/forum/forum_viewtopic.php
--- 6171/e107_plugins/forum/forum_viewtopic.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/forum_viewtopic.php	2006-05-16 12:29:51.000000000 -0500
@@ -0,0 +1,594 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/forum_viewtopic.php,v $
+|     $Revision: 1.63 $
+|     $Date: 2006/05/16 17:29:51 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once('../../class2.php');
+
+@include_once e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewtopic.php';
+@include_once e_PLUGIN.'forum/languages/English/lan_forum_viewtopic.php';
+@require_once(e_PLUGIN.'forum/forum_class.php');
+global $FORUM_CRUMB;
+
+if (file_exists(THEME.'forum_design.php'))
+{
+	@include_once(THEME.'forum_design.php');
+}
+
+$forum = new e107forum;
+if (IsSet($_POST['fjsubmit']))
+{
+	header("location:".e_PLUGIN."forum/forum_viewforum.php?".$_POST['forumjump']);
+	exit;
+}
+$highlight_search = FALSE;
+if (isset($_POST['highlight_search']))
+{
+	$highlight_search = TRUE;
+}
+
+if (!e_QUERY)
+{
+	//No paramters given, redirect to forum home
+	header("Location:".e_PLUGIN."forum/forum.php");
+	exit;
+}
+else
+{
+	$tmp = explode(".", e_QUERY);
+	$thread_id = $tmp[0];
+	$from = $tmp[1];
+	$action = $tmp[2];
+	if (!$from)
+	{
+		$from = 0;
+	}
+	if (!$thread_id || !is_numeric($thread_id))
+	{
+		header("Location:".e_PLUGIN."forum/forum.php");
+		exit;
+	}
+}
+
+if($from === 'post')
+{
+	if($thread_id)
+	{
+		$post_num = $forum->thread_postnum($thread_id);
+		$pages = ceil(($post_num['post_num']+1)/$pref['forum_postspage']);
+		$from = ($pages-1) * $pref['forum_postspage'];
+		if($post_num['parent'] != $thread_id)
+		{
+			header("location: ".e_SELF."?{$post_num['parent']}.{$from}#post_{$thread_id}");
+			exit;
+		}
+	}
+	else
+	{
+		header("Location:".e_PLUGIN."forum/forum.php");
+		exit;
+	}
+}
+
+require_once(e_PLUGIN.'forum/forum_shortcodes.php');
+
+
+if ($action == "track" && USER)
+{
+	$forum->track($thread_id);
+	header("location:".e_SELF."?{$thread_id}.{$from}");
+	exit;
+}
+
+if ($action == "untrack" && USER)
+{
+	$forum->untrack($thread_id);
+	header("location:".e_SELF."?{$thread_id}.{$from}");
+	exit;
+}
+
+if ($action == "next")
+{
+	$next = $forum->thread_getnext($thread_id, $from);
+	if ($next)
+	{
+		header("location:".e_SELF."?{$next}");
+		exit;
+	}
+	else
+	{
+		require_once(HEADERF);
+		$ns->tablerender('', LAN_405, array('forum_viewtopic', '405'));
+		require_once(FOOTERF);
+		exit;
+	}
+}
+
+if ($action == "prev") {
+	$prev = $forum->thread_getprev($thread_id, $from);
+	if ($prev) {
+		header("location:".e_SELF."?{$prev}");
+		exit;
+	} else {
+		require_once(HEADERF);
+		$ns->tablerender('', LAN_404, array('forum_viewtopic', '404'));
+		require_once(FOOTERF);
+		exit;
+	}
+
+}
+
+if ($action == "report") {
+	$thread_info = $forum->thread_get_postinfo($thread_id, TRUE);
+
+	if (isset($_POST['report_thread'])) {
+		$report_add = $tp -> toDB($_POST['report_add']);
+		if ($pref['reported_post_email']) {
+			require_once(e_HANDLER."mail.php");
+			$report = LAN_422.SITENAME." : ".(substr(SITEURL, -1) == "/" ? SITEURL : SITEURL."/").$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$thread_id.".post\n".LAN_425.USERNAME."\n".$report_add;
+			$subject = LAN_421." ".SITENAME;
+			sendemail(SITEADMINEMAIL, $subject, $report);
+		}
+		$sql->db_Insert('generic', "0, 'reported_post', ".time().", '".USERID."', '{$thread_info['head']['thread_name']}', ".intval($thread_id).", '{$report_add}'");
+		define("e_PAGETITLE", LAN_01." / ".LAN_428);
+		require_once(HEADERF);
+		$text = LAN_424."<br /><br /><a href='forum_viewtopic.php?".$thread_id.".post'>".LAN_429."</a";
+		$ns->tablerender(LAN_414, $text, array('forum_viewtopic', 'report'));
+	} else {
+		$thread_name = $tp -> toHTML($thread_info['head']['thread_name'], TRUE);
+		define("e_PAGETITLE", LAN_01." / ".LAN_426." ".$thread_name);
+		require_once(HEADERF);
+		$text = "<form action='".e_PLUGIN."forum/forum_viewtopic.php?".e_QUERY."' method='post'> <table style='width:100%'>
+			<tr>
+			<td  style='width:50%' >
+			".LAN_415.": ".$thread_name." <a href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_id.".post'><span class='smalltext'>".LAN_420." </span>
+			</a>
+			</td>
+			<td style='text-align:center;width:50%'>
+			</td>
+			</tr>
+			<tr>
+			<td>".LAN_417."<br />".LAN_418."
+			</td>
+			<td style='text-align:center;'>
+			<textarea cols='40' rows='10' class='tbox' name='report_add'></textarea>
+			</td>
+			</tr>
+			<tr>
+			<td colspan='2' style='text-align:center;'><br />
+			<input class='button' type='submit' name='report_thread' value='".LAN_419."' />
+			</td>
+			</tr>
+			</table>";
+		$ns->tablerender(LAN_414, $text, array('forum_viewtopic', 'report2'));
+	}
+	require_once(FOOTERF);
+	exit;
+}
+$pm_installed = ($pref['pm_title'] ? TRUE : FALSE);
+
+$replies = $forum->thread_count($thread_id)-1;
+if ($from === 'last') {
+	$pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
+	$pages = ceil(($replies+1)/$pref['forum_postspage']);
+	$from = ($pages-1) * $pref['forum_postspage'];
+}
+$gen = new convert;
+$thread_info = $forum->thread_get($thread_id, $from-1, $pref['forum_postspage']);
+if($thread_info['head']['thread_forum_id'] == "")
+{
+	require_once(HEADERF);
+	$ns->tablerender(LAN_01, FORLAN_104, array('forum_viewtopic', '104'));
+	require_once(FOOTERF);
+	exit;
+}
+$forum_info = $forum->forum_get($thread_info['head']['thread_forum_id']);
+
+
+if (!check_class($forum_info['forum_class']) || !check_class($forum_info['parent_class'])) {
+	header("Location:".e_PLUGIN."forum/forum.php");
+	exit;
+}
+
+$forum->thread_incview($thread_id);
+
+define("e_PAGETITLE", LAN_01." / ".$tp->toHTML($forum_info['forum_name'], TRUE, 'no_hook')." / ".$tp->toHTML($thread_info['head']['thread_name'], TRUE));
+//define("MODERATOR", (preg_match("/".preg_quote(ADMINNAME)."/", $forum_info['forum_moderators']) && getperms('A') ? TRUE : FALSE));
+define("MODERATOR", $forum_info['forum_moderators'] != "" && check_class($forum_info['forum_moderators']));
+$modArray = $forum->forum_getmods($forum_info['forum_moderators']);
+
+$message = '';
+if (MODERATOR)
+{
+	if ($_POST)
+	{
+		require_once(e_PLUGIN.'forum/forum_mod.php');
+		$message = forum_thread_moderate($_POST);
+		$thread_info = $forum->thread_get($thread_id, $from-1, $pref['forum_postspage']);
+	}
+}
+
+require_once(HEADERF);
+require_once(e_HANDLER."level_handler.php");
+if ($message)
+{
+	$ns->tablerender("", $message, array('forum_viewtopic', 'msg'));
+}
+
+if (isset($_POST['pollvote']))
+{
+	if ($_POST['votea'])
+	{
+		if($sql -> db_Select("polls", "*", "poll_datestamp=$thread_id"))
+		{
+			$row = $sql -> db_Fetch();
+			extract($row);
+			$votes = explode(chr(1), $poll_votes);
+			if(is_array($_POST['votea']))
+			{
+				/* multiple choice vote */
+				foreach($_POST['votea'] as $vote)
+				{
+					$vote = intval($vote);
+					$votes[($vote-1)] ++;
+				}
+			}
+			else
+			{
+				$_POST['votea'] = intval($_POST['votea']);
+				$votes[($_POST['votea']-1)] ++;
+			}
+
+			$votep = implode(chr(1), $votes);
+
+			$sql->db_Update("polls", "poll_votes = '$votep' WHERE poll_id=".intval($poll_id));
+			$POLLMODE = "voted";
+			js_location(e_SELF.(e_QUERY ? "?".e_QUERY : ''));
+
+		}
+	}
+}
+
+
+if (stristr($thread_info['head']['thread_name'], "[".LAN_430."]"))
+{
+	if(!defined("POLLCLASS"))
+	{
+		require(e_PLUGIN."poll/poll_class.php");
+	}
+	$_qry = "SELECT * FROM #polls WHERE `poll_datestamp` = '{$thread_info['head']['thread_id']}'";
+	$poll = new poll;
+	$pollstr = "<div class='spacer'>".$poll->render_poll($_qry, "forum", "query", TRUE)."</div>";
+}
+//Load forum templates
+
+if (!$FORUMSTART) {
+	if (file_exists(THEME."forum_viewtopic_template.php"))
+	{
+		require_once(THEME."forum_viewtopic_template.php");
+	}
+	else if (file_exists(THEME."forum_template.php"))
+	{
+		require_once(THEME."forum_template.php");
+	}
+	else
+	{
+		require_once(e_PLUGIN."forum/templates/forum_viewtopic_template.php");
+	}
+}
+
+$forum_info['forum_name'] = $tp -> toHTML($forum_info['forum_name'], TRUE);
+
+// get info for main thread -------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+if(is_array($FORUM_CRUMB))
+{
+	$search 	= array("{SITENAME}", "{SITENAME_HREF}");
+	$replace 	= array(SITENAME, "href='".e_BASE."index.php'");
+	$FORUM_CRUMB['sitename']['value'] = str_replace($search, $replace, $FORUM_CRUMB['sitename']['value']);
+
+	$search 	= array("{FORUMS_TITLE}", "{FORUMS_HREF}");
+	$replace 	= array(LAN_01, "href='".e_PLUGIN."forum/forum.php'");
+	$FORUM_CRUMB['forums']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forums']['value']);
+	
+	$search 	= array("{PARENT_TITLE}");
+	$replace 	= array($tp->toHTML($forum_info['parent_name']));
+	$FORUM_CRUMB['parent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['parent']['value']);
+
+	if($forum_info['sub_parent'])
+	{
+		$search 	= array("{SUBPARENT_TITLE}", "{SUBPARENT_HREF}");
+		$replace 	= array($forum_info['sub_parent'], "href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_sub']}'");
+		$FORUM_CRUMB['subparent']['value'] = str_replace($search, $replace, $FORUM_CRUMB['subparent']['value']);
+	}
+	else
+	{
+		$FORUM_CRUMB['subparent']['value'] = "";
+	}
+
+	$search 	= array("{FORUM_TITLE}", "{FORUM_HREF}");
+	$replace 	= array($forum_info['forum_name'],"href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_id']}'");
+	$FORUM_CRUMB['forum']['value'] = str_replace($search, $replace, $FORUM_CRUMB['forum']['value']);
+	$FORUM_CRUMB['fieldlist'] = "sitename,forums,parent,subparent,forum";
+
+	$BREADCRUMB = $tp->parseTemplate("{BREADCRUMB=FORUM_CRUMB}", true);
+
+}
+else
+{
+	$BREADCRUMB = "<a class='forumlink' href='".e_BASE."index.php'>".SITENAME."</a> -> <a class='forumlink' href='".e_PLUGIN."forum/forum.php'>".LAN_01."</a> -> ";
+	if($forum_info['sub_parent'])
+	{
+		$BREADCRUMB .= "<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_sub']}'>{$forum_info['sub_parent']}</a> -> ";
+	}
+	$BREADCRUMB .= "<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?{$forum_info['forum_id']}'>".$tp->toHTML($forum_info['forum_name'], TRUE, 'no_hook')."</a></b>";
+}
+
+$BACKLINK = $BREADCRUMB;
+$THREADNAME = $tp->toHTML($thread_info['head']['thread_name'], TRUE);
+$NEXTPREV = "&lt;&lt; <a href='".e_SELF."?{$thread_id}.{$forum_info['forum_id']}.prev'>".LAN_389."</a>";
+$NEXTPREV .= " | ";
+$NEXTPREV .= "<a href='".e_SELF."?{$thread_id}.{$forum_info['forum_id']}.next'>".LAN_390."</a> &gt;&gt;";
+
+if ($pref['forum_track'] && USER)
+{
+	$TRACK = (strpos(USERREALM, "-".$thread_id."-") !== FALSE ? "<span class='smalltext'><a href='".e_SELF."?".$thread_id.".0."."untrack'>".LAN_392."</a></span>" : "<span class='smalltext'><a href='".e_SELF."?".$thread_id.".0."."track'>".LAN_391."</a></span>");
+}
+
+$MODERATORS = LAN_321.implode(", ", $modArray);
+
+$THREADSTATUS = (!$thread_info['head']['thread_active'] ? LAN_66 : "");
+
+$pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
+$pages = ceil(($replies+1)/$pref['forum_postspage']);
+if ($pages > 1)
+{
+	$parms = ($replies+1).",{$pref['forum_postspage']},{$from},".e_SELF.'?'.$thread_id.'.[FROM],off';
+	$GOTOPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}");
+}
+
+if ((check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass'])) || MODERATOR)
+{
+	if ($thread_info['head']['thread_active'])
+	{
+		$BUTTONS = "<a href='".e_PLUGIN."forum/forum_post.php?rp.".e_QUERY."'>".IMAGE_reply."</a>";
+	}
+	$BUTTONS .= "<a href='".e_PLUGIN."forum/forum_post.php?nt.".$forum_info['forum_id']."'>".IMAGE_newthread."</a>";
+}
+
+$POLL = $pollstr;
+
+$FORUMJUMP = forumjump();
+
+$forstr = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMSTART);
+
+unset($forrep);
+if (!$FORUMREPLYSTYLE) $FORUMREPLYSTYLE = $FORUMTHREADSTYLE;
+$alt = FALSE;
+for($i = 0; $i < count($thread_info)-1; $i++)
+{
+	unset($post_info);
+	$post_info = $thread_info[$i];
+	$loop_uid = intval($post_info['user_id']);
+	if (!$post_info['thread_user'])
+	{
+		// guest
+		$tmp = explode(chr(1), $post_info['thread_anon']);
+		$ip = $tmp[1];
+		$host = $e107->get_host_name($ip);
+		$post_info['iphost'] = "<div class='smalltext' style='text-align:right'>IP: <a href='".e_ADMIN."userinfo.php?$ip'>$ip ( $host )</a></div>";
+		$post_info['anon'] = TRUE;
+	}
+	else
+	{
+		$post_info['anon'] = FALSE;
+	}
+	$e_hide_query = "SELECT thread_id FROM #forum_t WHERE (`thread_parent` = {$thread_id} OR `thread_id` = {$thread_id}) AND FLOOR(thread_user) = ".USERID;
+	$e_hide_hidden = FORLAN_HIDDEN;
+	$e_hide_allowed = USER;
+
+	if($post_info['thread_parent'])
+	{
+		$alt = !$alt;
+		if(isset($FORUMREPLYSTYLE_ALT) && $alt)
+		{
+			$forrep .= $tp->parseTemplate($FORUMREPLYSTYLE_ALT, TRUE, $forum_shortcodes)."\n";
+		}
+		else
+		{
+			$forrep .= $tp->parseTemplate($FORUMREPLYSTYLE, TRUE, $forum_shortcodes)."\n";
+		}
+	}
+	else
+	{
+		$forthr = $tp->parseTemplate($FORUMTHREADSTYLE, TRUE, $forum_shortcodes)."\n";
+	}
+}
+unset($loop_uid);
+
+if (((check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass'])) || MODERATOR) && $thread_info['head']['thread_active'] )
+{
+	if (!$forum_quickreply)
+	{
+		$QUICKREPLY = "<form action='".e_PLUGIN."forum/forum_post.php?rp.".e_QUERY."' method='post'>\n<p>\n".LAN_393.":<br /><textarea cols='60' rows='4' class='tbox' name='post' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea><br /><input type='submit' name='fpreview' value='".LAN_394."' class='button' /> &nbsp;\n<input type='submit' name='reply' value='".LAN_395."' class='button' />\n<input type='hidden' name='thread_id' value='$thread_parent' />\n</p>\n</form>";
+	}
+	else
+	{
+		$QUICKREPLY = $forum_quickreply;
+	}
+}
+
+$forend = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMEND);
+$forumstring = $forstr.$forthr.$forrep.$forend;
+
+
+if ($thread_info['head']['thread_lastpost'] > USERLV && (strpos(USERVIEWED, ".{$thread_info['head']['thread_id']}.") === FALSE)) {
+	$tst = $forum->thread_markasread($thread_info['head']['thread_id']);
+}
+
+if ($pref['forum_enclose']) {
+	$ns->tablerender(LAN_01, $forumstring, array('forum_viewtopic', 'main'));
+} else {
+	echo $forumstring;
+}
+
+
+// end -------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+echo "<script type=\"text/javascript\">
+	function confirm_(mode, forum_id, thread_id, thread) {
+	if (mode == 'thread') {
+	return confirm(\"".$tp->toJS(LAN_409)."\");
+	} else {
+	return confirm(\"".$tp->toJS(LAN_410)." [ ".$tp->toJS(LAN_411)."\" + thread + \" ]\");
+	}
+	}
+	</script>";
+require_once(FOOTERF);
+
+function showmodoptions()
+{
+	global $thread_id;
+	global $thread_info;
+	global $forum_info;
+	global $post_info;
+	$forum_id = $forum_info['forum_id'];
+	if ($post_info['thread_parent'] == FALSE)
+	{
+		$type = 'thread';
+		$ret = "<form method='post' action='".e_PLUGIN."forum/forum_viewforum.php?{$forum_id}' id='frmMod_{$forum_id}_{$post_info['thread_id']}'>";
+	}
+	else
+	{
+		$type = 'reply';
+		$ret = "<form method='post' action='".e_SELF."?".e_QUERY."' id='frmMod_{$forum_id}_{$post_info['thread_id']}'>";
+	}
+
+	$ret .= "
+		<div>
+		<a href='".e_PLUGIN."forum/forum_post.php?edit.{$post_info['thread_id']}.{$from}'>".IMAGE_admin_edit."</a>
+		<input type='image' ".IMAGE_admin_delete." name='delete_{$post_info['thread_id']}' value='thread_action' onclick=\"return confirm_('{$type}', {$forum_id}, {$thread_id}, '{$post_info['user_name']}')\" />
+		";
+	if ($type == 'thread')
+	{
+		$ret .= "<a href='".e_PLUGIN."forum/forum_conf.php?move.{$thread_id}'>".IMAGE_admin_move2."</a>";
+	}
+	$ret .= "
+		</div>
+		</form>";
+	return $ret;
+}
+
+function forumjump()
+{
+
+	global $forum;
+	$jumpList = $forum->forum_get_allowed();
+	$text = "<form method='post' action='".e_SELF."'><p>".LAN_65.": <select name='forumjump' class='tbox'>";
+	foreach($jumpList as $key => $val)
+	{
+		$text .= "\n<option value='".$key."'>".$val."</option>";
+	}
+	$text .= "</select> <input class='button' type='submit' name='fjsubmit' value='".LAN_03."' />&nbsp;&nbsp;&nbsp;&nbsp;<a href='".e_SELF."?".e_QUERY."#top' onclick=\"window.scrollTo(0,0);\">".LAN_10."</a></p></form>";
+	return $text;
+}
+
+function rpg($user_join, $user_forums)
+{
+	global $FORUMTHREADSTYLE;
+	if (strpos($FORUMTHREADSTYLE, '{RPG}') == FALSE)
+	{
+		return '';
+	}
+	// rpg mod by Ikari ( kilokan1@yahoo.it | http://artemanga.altervista.org )
+
+	$lvl_post_mp_cost = 2.5;
+	$lvl_mp_regen_per_day = 4;
+	$lvl_avg_ppd = 5;
+	$lvl_bonus_redux = 5;
+	$lvl_user_days = max(1, round((time() - $user_join ) / 86400 ));
+	$lvl_ppd = $user_forums / $lvl_user_days;
+	if ($user_forums < 1) {
+		$lvl_level = 0;
+	} else {
+		$lvl_level = floor(pow(log10($user_forums ), 3 ) ) + 1;
+	}
+	if ($lvl_level < 1) {
+		$lvl_hp = "0 / 0";
+		$lvl_hp_percent = 0;
+	} else {
+		$lvl_max_hp = floor((pow($lvl_level, (1/4) ) ) * (pow(10, pow($lvl_level+2, (1/3) ) ) ) / (1.5) );
+
+		if ($lvl_ppd >= $lvl_avg_ppd) {
+			$lvl_hp_percent = floor((.5 + (($lvl_ppd - $lvl_avg_ppd) / ($lvl_bonus_redux * 2)) ) * 100);
+		} else {
+			$lvl_hp_percent = floor($lvl_ppd / ($lvl_avg_ppd / 50) );
+		}
+		if ($lvl_hp_percent > 100) {
+			$lvl_max_hp += floor(($lvl_hp_percent - 100) * pi() );
+			$lvl_hp_percent = 100;
+		} else {
+			$lvl_hp_percent = max(0, $lvl_hp_percent);
+		}
+		$lvl_cur_hp = floor($lvl_max_hp * ($lvl_hp_percent / 100) );
+		$lvl_cur_hp = max(0, $lvl_cur_hp);
+		$lvl_cur_hp = min($lvl_max_hp, $lvl_cur_hp);
+		$lvl_hp = $lvl_cur_hp . '/' . $lvl_max_hp;
+	}
+	if ($lvl_level < 1) {
+		$lvl_mp = '0 / 0';
+		$lvl_mp_percent = 0;
+	} else {
+		$lvl_max_mp = floor((pow($lvl_level, (1/4) ) ) * (pow(10, pow($lvl_level+2, (1/3) ) ) ) / (pi()) );
+		$lvl_mp_cost = $user_forums * $lvl_post_mp_cost;
+		$lvl_mp_regen = max(1, $lvl_user_days * $lvl_mp_regen_per_day);
+		$lvl_cur_mp = floor($lvl_max_mp - $lvl_mp_cost + $lvl_mp_regen);
+		$lvl_cur_mp = max(0, $lvl_cur_mp);
+		$lvl_cur_mp = min($lvl_max_mp, $lvl_cur_mp);
+		$lvl_mp = $lvl_cur_mp . '/' . $lvl_max_mp;
+		$lvl_mp_percent = floor($lvl_cur_mp / $lvl_max_mp * 100 );
+	}
+	if ($lvl_level < 1) {
+		$lvl_exp = "0 / 0";
+		$lvl_exp_percent = 100;
+	} else {
+		$lvl_posts_for_next = floor(pow(10, pow($lvl_level, (1/3) ) ) );
+		if ($lvl_level == 1) {
+			$lvl_posts_for_this = max(1, floor(pow (10, (($lvl_level - 1) ) ) ) );
+		} else {
+			$lvl_posts_for_this = max(1, floor(pow (10, pow(($lvl_level - 1), (1/3) ) ) ) );
+		}
+		$lvl_exp = ($user_forums - $lvl_posts_for_this) . "/" . ($lvl_posts_for_next - $lvl_posts_for_this);
+		$lvl_exp_percent = floor((($user_forums - $lvl_posts_for_this) / max(1, ($lvl_posts_for_next - $lvl_posts_for_this ) ) ) * 100);
+	}
+
+	$bar_image = THEME."images/bar.jpg";
+	if(!is_readable($bar_image))
+	{
+		$bar_image = e_PLUGIN."forum/images/".IMODE."/bar.jpg";
+	}
+		
+	$rpg_info .= "<div style='padding:2px; white-space:nowrap'>";
+	$rpg_info .= "<b>Level = ".$lvl_level."</b><br />";
+	$rpg_info .= "HP = ".$lvl_hp."<br /><img src='{$bar_image}' alt='' style='border:#345487 1px solid; height:10px; width:".$lvl_hp_percent."%'><br />";
+	$rpg_info .= "EXP = ".$lvl_exp."<br /><img src='{$bar_image}' alt='' style='border:#345487 1px solid; height:10px; width:".$lvl_exp_percent."%'><br />";
+	$rpg_info .= "MP = ".$lvl_mp."<br /><img src='{$bar_image}' alt='' style='border:#345487 1px solid; height:10px; width:".$lvl_mp_percent."%'><br />";
+	$rpg_info .= "</div>";
+	return $rpg_info;
+}
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/forum/images/dark/admin_block.png and 75/e107_plugins/forum/images/dark/admin_block.png differ
Files 6171/e107_plugins/forum/images/dark/admin_delete.png and 75/e107_plugins/forum/images/dark/admin_delete.png differ
Files 6171/e107_plugins/forum/images/dark/admin_edit.png and 75/e107_plugins/forum/images/dark/admin_edit.png differ
Files 6171/e107_plugins/forum/images/dark/admin_lock.png and 75/e107_plugins/forum/images/dark/admin_lock.png differ
Files 6171/e107_plugins/forum/images/dark/admin_move.png and 75/e107_plugins/forum/images/dark/admin_move.png differ
Files 6171/e107_plugins/forum/images/dark/admin.png and 75/e107_plugins/forum/images/dark/admin.png differ
Files 6171/e107_plugins/forum/images/dark/admin_stick.png and 75/e107_plugins/forum/images/dark/admin_stick.png differ
Files 6171/e107_plugins/forum/images/dark/admin_unlock.png and 75/e107_plugins/forum/images/dark/admin_unlock.png differ
Files 6171/e107_plugins/forum/images/dark/admin_unstick.png and 75/e107_plugins/forum/images/dark/admin_unstick.png differ
Files 6171/e107_plugins/forum/images/dark/aim.png and 75/e107_plugins/forum/images/dark/aim.png differ
Files 6171/e107_plugins/forum/images/dark/announce.png and 75/e107_plugins/forum/images/dark/announce.png differ
Files 6171/e107_plugins/forum/images/dark/announce_small.png and 75/e107_plugins/forum/images/dark/announce_small.png differ
Files 6171/e107_plugins/forum/images/dark/bar.jpg and 75/e107_plugins/forum/images/dark/bar.jpg differ
Files 6171/e107_plugins/forum/images/dark/closed.png and 75/e107_plugins/forum/images/dark/closed.png differ
Files 6171/e107_plugins/forum/images/dark/closed_small.png and 75/e107_plugins/forum/images/dark/closed_small.png differ
Files 6171/e107_plugins/forum/images/dark/delete.png and 75/e107_plugins/forum/images/dark/delete.png differ
Files 6171/e107_plugins/forum/images/dark/edit.png and 75/e107_plugins/forum/images/dark/edit.png differ
Files 6171/e107_plugins/forum/images/dark/email.png and 75/e107_plugins/forum/images/dark/email.png differ
Files 6171/e107_plugins/forum/images/dark/e.png and 75/e107_plugins/forum/images/dark/e.png differ
Files 6171/e107_plugins/forum/images/dark/icq.png and 75/e107_plugins/forum/images/dark/icq.png differ
Files 6171/e107_plugins/forum/images/dark/main_admin.png and 75/e107_plugins/forum/images/dark/main_admin.png differ
Files 6171/e107_plugins/forum/images/dark/moderator.png and 75/e107_plugins/forum/images/dark/moderator.png differ
Files 6171/e107_plugins/forum/images/dark/msn.png and 75/e107_plugins/forum/images/dark/msn.png differ
Files 6171/e107_plugins/forum/images/dark/new.png and 75/e107_plugins/forum/images/dark/new.png differ
Files 6171/e107_plugins/forum/images/dark/new_popular.png and 75/e107_plugins/forum/images/dark/new_popular.png differ
Files 6171/e107_plugins/forum/images/dark/new_popular_small.png and 75/e107_plugins/forum/images/dark/new_popular_small.png differ
Files 6171/e107_plugins/forum/images/dark/new_small.png and 75/e107_plugins/forum/images/dark/new_small.png differ
Files 6171/e107_plugins/forum/images/dark/newthread.png and 75/e107_plugins/forum/images/dark/newthread.png differ
Files 6171/e107_plugins/forum/images/dark/nonew.png and 75/e107_plugins/forum/images/dark/nonew.png differ
Files 6171/e107_plugins/forum/images/dark/nonew_popular.png and 75/e107_plugins/forum/images/dark/nonew_popular.png differ
Files 6171/e107_plugins/forum/images/dark/nonew_popular_small.png and 75/e107_plugins/forum/images/dark/nonew_popular_small.png differ
Files 6171/e107_plugins/forum/images/dark/nonew_small.png and 75/e107_plugins/forum/images/dark/nonew_small.png differ
Files 6171/e107_plugins/forum/images/dark/pm.png and 75/e107_plugins/forum/images/dark/pm.png differ
Files 6171/e107_plugins/forum/images/dark/post2.png and 75/e107_plugins/forum/images/dark/post2.png differ
Files 6171/e107_plugins/forum/images/dark/post.png and 75/e107_plugins/forum/images/dark/post.png differ
Files 6171/e107_plugins/forum/images/dark/profile.png and 75/e107_plugins/forum/images/dark/profile.png differ
Files 6171/e107_plugins/forum/images/dark/quote.png and 75/e107_plugins/forum/images/dark/quote.png differ
Files 6171/e107_plugins/forum/images/dark/reply.png and 75/e107_plugins/forum/images/dark/reply.png differ
Files 6171/e107_plugins/forum/images/dark/report.png and 75/e107_plugins/forum/images/dark/report.png differ
Files 6171/e107_plugins/forum/images/dark/sticky_closed.png and 75/e107_plugins/forum/images/dark/sticky_closed.png differ
Files 6171/e107_plugins/forum/images/dark/sticky_closed_small.png and 75/e107_plugins/forum/images/dark/sticky_closed_small.png differ
Files 6171/e107_plugins/forum/images/dark/sticky.png and 75/e107_plugins/forum/images/dark/sticky.png differ
Files 6171/e107_plugins/forum/images/dark/sticky_small.png and 75/e107_plugins/forum/images/dark/sticky_small.png differ
Files 6171/e107_plugins/forum/images/dark/website.png and 75/e107_plugins/forum/images/dark/website.png differ
Files 6171/e107_plugins/forum/images/fcap2.png and 75/e107_plugins/forum/images/fcap2.png differ
Files 6171/e107_plugins/forum/images/fcap.png and 75/e107_plugins/forum/images/fcap.png differ
Files 6171/e107_plugins/forum/images/finfobar.png and 75/e107_plugins/forum/images/finfobar.png differ
Files 6171/e107_plugins/forum/images/forums_16.png and 75/e107_plugins/forum/images/forums_16.png differ
Files 6171/e107_plugins/forum/images/forums_32.png and 75/e107_plugins/forum/images/forums_32.png differ
Files 6171/e107_plugins/forum/images/lite/admin_block.png and 75/e107_plugins/forum/images/lite/admin_block.png differ
Files 6171/e107_plugins/forum/images/lite/admin_delete.png and 75/e107_plugins/forum/images/lite/admin_delete.png differ
Files 6171/e107_plugins/forum/images/lite/admin_edit.png and 75/e107_plugins/forum/images/lite/admin_edit.png differ
Files 6171/e107_plugins/forum/images/lite/admin_lock.png and 75/e107_plugins/forum/images/lite/admin_lock.png differ
Files 6171/e107_plugins/forum/images/lite/admin_move.png and 75/e107_plugins/forum/images/lite/admin_move.png differ
Files 6171/e107_plugins/forum/images/lite/admin.png and 75/e107_plugins/forum/images/lite/admin.png differ
Files 6171/e107_plugins/forum/images/lite/admin_stick.png and 75/e107_plugins/forum/images/lite/admin_stick.png differ
Files 6171/e107_plugins/forum/images/lite/admin_unlock.png and 75/e107_plugins/forum/images/lite/admin_unlock.png differ
Files 6171/e107_plugins/forum/images/lite/admin_unstick.png and 75/e107_plugins/forum/images/lite/admin_unstick.png differ
Files 6171/e107_plugins/forum/images/lite/aim.png and 75/e107_plugins/forum/images/lite/aim.png differ
Files 6171/e107_plugins/forum/images/lite/announce.png and 75/e107_plugins/forum/images/lite/announce.png differ
Files 6171/e107_plugins/forum/images/lite/announce_small.png and 75/e107_plugins/forum/images/lite/announce_small.png differ
Files 6171/e107_plugins/forum/images/lite/bar.jpg and 75/e107_plugins/forum/images/lite/bar.jpg differ
Files 6171/e107_plugins/forum/images/lite/closed.png and 75/e107_plugins/forum/images/lite/closed.png differ
Files 6171/e107_plugins/forum/images/lite/closed_small.png and 75/e107_plugins/forum/images/lite/closed_small.png differ
Files 6171/e107_plugins/forum/images/lite/delete.png and 75/e107_plugins/forum/images/lite/delete.png differ
Files 6171/e107_plugins/forum/images/lite/edit.png and 75/e107_plugins/forum/images/lite/edit.png differ
Files 6171/e107_plugins/forum/images/lite/email.png and 75/e107_plugins/forum/images/lite/email.png differ
Files 6171/e107_plugins/forum/images/lite/e.png and 75/e107_plugins/forum/images/lite/e.png differ
Files 6171/e107_plugins/forum/images/lite/icq.png and 75/e107_plugins/forum/images/lite/icq.png differ
Files 6171/e107_plugins/forum/images/lite/main_admin.png and 75/e107_plugins/forum/images/lite/main_admin.png differ
Files 6171/e107_plugins/forum/images/lite/moderator.png and 75/e107_plugins/forum/images/lite/moderator.png differ
Files 6171/e107_plugins/forum/images/lite/msn.png and 75/e107_plugins/forum/images/lite/msn.png differ
Files 6171/e107_plugins/forum/images/lite/new.png and 75/e107_plugins/forum/images/lite/new.png differ
Files 6171/e107_plugins/forum/images/lite/new_popular.png and 75/e107_plugins/forum/images/lite/new_popular.png differ
Files 6171/e107_plugins/forum/images/lite/new_popular_small.png and 75/e107_plugins/forum/images/lite/new_popular_small.png differ
Files 6171/e107_plugins/forum/images/lite/new_small.png and 75/e107_plugins/forum/images/lite/new_small.png differ
Files 6171/e107_plugins/forum/images/lite/newthread.png and 75/e107_plugins/forum/images/lite/newthread.png differ
Files 6171/e107_plugins/forum/images/lite/nonew.png and 75/e107_plugins/forum/images/lite/nonew.png differ
Files 6171/e107_plugins/forum/images/lite/nonew_popular.png and 75/e107_plugins/forum/images/lite/nonew_popular.png differ
Files 6171/e107_plugins/forum/images/lite/nonew_popular_small.png and 75/e107_plugins/forum/images/lite/nonew_popular_small.png differ
Files 6171/e107_plugins/forum/images/lite/nonew_small.png and 75/e107_plugins/forum/images/lite/nonew_small.png differ
Files 6171/e107_plugins/forum/images/lite/pm.png and 75/e107_plugins/forum/images/lite/pm.png differ
Files 6171/e107_plugins/forum/images/lite/post2.png and 75/e107_plugins/forum/images/lite/post2.png differ
Files 6171/e107_plugins/forum/images/lite/post.png and 75/e107_plugins/forum/images/lite/post.png differ
Files 6171/e107_plugins/forum/images/lite/profile.png and 75/e107_plugins/forum/images/lite/profile.png differ
Files 6171/e107_plugins/forum/images/lite/quote.png and 75/e107_plugins/forum/images/lite/quote.png differ
Files 6171/e107_plugins/forum/images/lite/reply.png and 75/e107_plugins/forum/images/lite/reply.png differ
Files 6171/e107_plugins/forum/images/lite/report.png and 75/e107_plugins/forum/images/lite/report.png differ
Files 6171/e107_plugins/forum/images/lite/sticky_closed.png and 75/e107_plugins/forum/images/lite/sticky_closed.png differ
Files 6171/e107_plugins/forum/images/lite/sticky_closed_small.png and 75/e107_plugins/forum/images/lite/sticky_closed_small.png differ
Files 6171/e107_plugins/forum/images/lite/sticky.png and 75/e107_plugins/forum/images/lite/sticky.png differ
Files 6171/e107_plugins/forum/images/lite/sticky_small.png and 75/e107_plugins/forum/images/lite/sticky_small.png differ
Files 6171/e107_plugins/forum/images/lite/website.png and 75/e107_plugins/forum/images/lite/website.png differ
Files 6171/e107_plugins/forum/images/sub_forums_16.png and 75/e107_plugins/forum/images/sub_forums_16.png differ
diff -ruN 6171/e107_plugins/forum/index.php 75/e107_plugins/forum/index.php
--- 6171/e107_plugins/forum/index.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/index.php	2005-03-22 17:14:28.000000000 -0600
@@ -0,0 +1,23 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/index.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/03/22 23:14:28 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+header("location: forum.php");
+exit;
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum_admin.php 75/e107_plugins/forum/languages/English/lan_forum_admin.php
--- 6171/e107_plugins/forum/languages/English/lan_forum_admin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum_admin.php	2006-03-18 14:53:53.000000000 -0600
@@ -0,0 +1,206 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum_admin.php,v $
+|     $Revision: 1.19 $
+|     $Date: 2006/03/18 20:53:53 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("FORLAN_1", "You must enter the number of days you wish to prune.");
+define("FORLAN_2", "Please select to either delete pruned posts completely, or make them inactive (not deleted but not visible in forums)");
+define("FORLAN_3", "delete");
+define("FORLAN_4", "Make inactive");
+define("FORLAN_5", "Carry Out Prune");
+define("FORLAN_6", "Cancel");
+define("FORLAN_7", "Forum Options");
+define("FORLAN_8", "Forums pruned.");
+define("FORLAN_9", "Prune not required.");
+define("FORLAN_10", "Options Saved");
+define("FORLAN_11", "Forum created");
+define("FORLAN_12", "Forum updated");
+define("FORLAN_13", "Parent created");
+define("FORLAN_14", "Forum parent updated");
+define("FORLAN_15", "Please tick the confirm box to delete the forum");
+define("FORLAN_16", "Forums");
+define("FORLAN_17", "No parents yet");
+define("FORLAN_18", "Existing Parents");
+define("FORLAN_19", "Edit");
+define("FORLAN_20", "Delete");
+define("FORLAN_21", "tick to confirm");
+define("FORLAN_22", "Parent");
+define("FORLAN_23", "Viewable by");
+define("FORLAN_24", "Indicates who can can view the forum");
+define("FORLAN_25", "Update Parent");
+define("FORLAN_26", "Create Parent");
+define("FORLAN_27", "You need to define at least one forum parent before creating a forum.");
+define("FORLAN_28", "Forums");
+define("FORLAN_29", "No forums yet.");
+define("FORLAN_30", "Existing Forums");
+define("FORLAN_31", "Name");
+define("FORLAN_32", "Description");
+define("FORLAN_33", "Moderators");
+define("FORLAN_34", "Choose userclass for moderators of this forum");
+define("FORLAN_35", "Update Forum");
+define("FORLAN_36", "Create Forum");
+define("FORLAN_37", "Order");
+define("FORLAN_38", "Closed");
+define("FORLAN_39", "Members Only");
+define("FORLAN_40", "Restricted");
+define("FORLAN_41", "move up");
+define("FORLAN_42", "move down");
+define("FORLAN_43", "Preview / Forum Order");
+define("FORLAN_44", "Enclose tables");
+define("FORLAN_45", "Tick this to render the forum within theme table");
+define("FORLAN_46", "Title displayed in caption if enclose tables is ticked");
+define("FORLAN_47", "Enable email nofication");
+define("FORLAN_48", "Tick this to allow your users to have the option of receiving an email when somebody replies to their post");
+define("FORLAN_49", "Enable polls");
+define("FORLAN_50", "Tick this to allow your users to set polls in the forums - the Polls plugin must be installed to use this feature");
+define("FORLAN_51", "Enable tracking");
+define("FORLAN_52", "Tick this to allow your users to track threads and be emailed when the thread is replied to");
+define("FORLAN_53", "Email prefix");
+define("FORLAN_54", "The text you enter will prefix the subject on any emails sent through the forum");
+define("FORLAN_55", "Popular thread threshold");
+define("FORLAN_56", "Number of posts made to a thread before it is marked as popular");
+define("FORLAN_57", "Posts per page");
+define("FORLAN_58", "Number of posts displayed per page");
+define("FORLAN_59", "Prune");
+define("FORLAN_60", "This will delete all threads that have not received a reply in the number of days you enter. <br /><b>Please be careful using this function!</b>");
+define("FORLAN_61", "Update Options");
+define("FORLAN_62", "Forum Options");
+define("FORLAN_63", "Ranks");
+define("FORLAN_64", "Enter your levels here, if left blank generic stars will be used to denote level. Seperate levels with comma. Maximum of 10 levels, lowest first.");
+define("FORLAN_65", "Forum Title");
+
+define("FORLAN_70", "Enable file / image attachments");
+define("FORLAN_71", "Allow users to upload file or image with their forum post,");
+define("FORLAN_72", "Update Order");
+define("FORLAN_73", "Order Updated");
+
+define("FORLAN_75", "Parents");
+define("FORLAN_76", "Forums Front Page");
+define("FORLAN_77", "Create Forums");
+define("FORLAN_78", "Forum Order");
+define("FORLAN_79", "Preferences");
+define("FORLAN_80", "Options");
+define("FORLAN_81", "Are you sure you want to delete this parent? - forums of this parent will also be deleted");
+define("FORLAN_82", "Are you sure you want to delete this forum?");
+define("FORLAN_83", "Create Parents");
+define("FORLAN_84", "Members Only");
+define("FORLAN_85", "Read Only");
+define("FORLAN_86", "Admin Only");
+define("FORLAN_87", "Prune topics with no replies in this many days:");
+
+define("FORLAN_88", "Prune topics with no replies in this many days:");
+
+define("FORLAN_89", "Delete posts completely");
+define("FORLAN_90", "Make posts inactive");
+
+define("FORLAN_91", "post(s) made inactive");
+define("FORLAN_92", "thread(s) deleted");
+define("FORLAN_93", "reply (replies) deleted");
+
+define("FORLAN_94", "Set Ranks");
+define("FORLAN_95", "Ranks saved");
+define("FORLAN_96", "Forum deleted");
+define("FORLAN_97", "Parent deleted");
+
+define("FORLAN_98", "Rank Name");
+define("FORLAN_99", "number of points before level change");
+define("FORLAN_100", "upload images to e107_themes/Your_Theme/forum/");
+define("FORLAN_101", "Main Site Admin");
+define("FORLAN_102", "Threshold");
+define("FORLAN_103", "Site Admin");
+define("FORLAN_104", "Rank Image");
+define("FORLAN_105", "Forum Moderator");
+
+
+define("FORLAN_106", "Prune Type:");
+define("FORLAN_107", "Forum");
+define("FORLAN_108", " deleted");
+define("FORLAN_109", "days:");
+define("FORLAN_110", "Prune");
+define("FORLAN_111", "deactivate");
+
+define("FORLAN_112", "Enable Redirect");
+define("FORLAN_113", "Tick this to make browser redirect to forum page after replying");
+define("FORLAN_114", "User Custom Title");
+define("FORLAN_115", "Tick this to allow users to change their Custom Title");
+define("FORLAN_116", "Reported Posts");
+define("FORLAN_117", "This will delete the record of the reported post. Not the post itself.");
+define("FORLAN_118", "Reported post deleted");
+// define("FORLAN_119", "Clicking links will open forum in a new window.");
+define("FORLAN_120", "Tick this to allow users to change their Custom Title");
+define("FORLAN_121", "No reported posts");
+define("FORLAN_122", "Click here to email admin when someone reports a forum post");
+define("FORLAN_123", "Forum Rules");
+define("WMGLAN_1", "Rules for Guests");
+define("WMGLAN_2", "Rules for Members");
+define("WMGLAN_3", "Rules for Administrators");
+define("WMGLAN_4", "Submit");
+define("WMGLAN_5", "Set Forum Rules");
+define("WMGLAN_6", "Activate?");
+define("FORLAN_126", "Show Tooltips");
+define("FORLAN_127", "Tick here to show a tooltip containing the first post of the thread when mouse hovers over thread name. ");
+define("FORLAN_128", "Length of tooltip");
+define("FORLAN_129", "This will determine the number of characters to display in the tooltip. ");
+define("FORLAN_130", "click here");
+define("FORLAN_131", "to set max file size, allowed types etc");
+define("FORLAN_132", "Emphasize Sticky Threads");
+define("FORLAN_133", "Give extra emphasis to sticky threads (separate thread sections and headers)");
+define("FORLAN_134", "Maximum width of uploaded image");
+define("FORLAN_135", "Leave blank to disable auto resizing of images");
+define("FORLAN_136", "Create link to full size image");
+define("FORLAN_137", "Enabling this will resize larger images and also create a link to the original full size image.  If disabled, original image will be discarded");
+define("FORLAN_138", "Prune these forums");
+define("FORLAN_139", "To use this setting you also need to tick 'Enable image posting' on the <a href='".e_ADMIN."image.php'>images</a> page");
+define("FORLAN_140", "View");
+define("FORLAN_141", "Post");
+define("FORLAN_142", "Post permission");
+define("FORLAN_143", "Indicates who can can post to the forum");
+define("FORLAN_144", "Moderators set");
+define("FORLAN_145", "Configure sub-forums");
+define("FORLAN_146", "No sub-forums yet");
+define("FORLAN_147", "Update sub-forums");
+define("FORLAN_148", "Create sub-forums");
+define("FORLAN_149", "sub-forums");
+define("FORLAN_150", "sub-forum");
+define("FORLAN_151", "ID");
+define("FORLAN_152", "posts");
+define("FORLAN_153", "Tools");
+define("FORLAN_154", "Reply Deleted");
+define("FORLAN_155", "Forum Categories");
+
+define("FORLAN_156", "Select forum(s) to perform action on");
+define("FORLAN_157", "All Forums");
+define("FORLAN_158", "Recalculate forum lastpost info");
+define("FORLAN_159", "Select to recalculate lastpost info");
+define("FORLAN_160", "Select to perform this on forums only, not threads");
+define("FORLAN_161", "Recalculate post / reply counts");
+define("FORLAN_162", "Select to recalculate forum thread/reply counts");
+define("FORLAN_163", "Recalculate user forum posts counts");
+define("FORLAN_164", "Select to recalculate user forum counts");
+define("FORLAN_165", "Execute functions");
+define("FORLAN_166", "Forum Tools");
+define("FORLAN_167", "Counts updated for forum");
+define("FORLAN_168", "Lastpost info updated for forum");
+define("FORLAN_169", "User forum counts updated");
+define("FORLAN_170", "Reports");
+define("FORLAN_171", "Report on forum post");
+define("FORLAN_172", "Delete This Report");
+define("FORLAN_173", "Thread title");
+define("FORLAN_174", "Reported by user");
+define("FORLAN_175", "Report submitted");
+define("FORLAN_176", "Report");
+
+define("FORLAN_177", "email nofication ON by default");
+define("FORLAN_178", "Tick this to allow make the email notification checkbox be on by default");
+
+define("FORLAN_179", "(Adding a * to the beginning of the forum name will make this forum a container for subforums only.  The forum theme must support this option also.)");
+define("FORLAN_180", "Confirm delete operation");
+define("FORLAN_181", "Confirm Delete");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum_conf.php 75/e107_plugins/forum/languages/English/lan_forum_conf.php
--- 6171/e107_plugins/forum/languages/English/lan_forum_conf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum_conf.php	2006-02-06 21:28:40.000000000 -0600
@@ -0,0 +1,44 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum_conf.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/02/07 03:28:40 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("FORLAN_5", "Poll deleted.");
+define("FORLAN_6", "Thread deleted");
+define("FORLAN_7", "replies deleted");
+define("FORLAN_8", "Delete cancelled.");
+define("FORLAN_9", "Thread moved.");
+define("FORLAN_10", "Move cancelled.");
+define("FORLAN_11", "Back To Forums");
+define("FORLAN_12", "Forum Configuration");
+define("FORLAN_13", "Are you absolutely certain you want to delete this poll?<br />Once deleted it <b><u>cannot</u></b> be retreived.");
+define("FORLAN_14", "Cancel");
+define("FORLAN_15", "Confirm Delete Forum Post");
+define("FORLAN_16", "Confirm Delete Poll");
+define("FORLAN_17", "posted by");
+define("FORLAN_18", "Are you absolutely certain you want to delete this forum");
+define("FORLAN_19", "thread and it's related posts?");
+define("FORLAN_20", "the poll will also be deleted");
+define("FORLAN_21", "Once deleted they");
+define("FORLAN_22", "post?<br />Once deleted it");
+define("FORLAN_23", "cannot</u></b> be retreived");
+define("FORLAN_24", "Move thread  to forum");
+define("FORLAN_25", "Move Thread");
+define("FORLAN_26", "Reply deleted");
+	
+define("FORLAN_27", "moved");
+
+define("FORLAN_28", "Do not rename thread title");
+define("FORLAN_29", "Add");
+define("FORLAN_30", "to title");
+define("FORLAN_31", "Rename to:");
+define("FORLAN_32", "Rename thread options:");
+
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum_frontpage.php 75/e107_plugins/forum/languages/English/lan_forum_frontpage.php
--- 6171/e107_plugins/forum/languages/English/lan_forum_frontpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum_frontpage.php	2005-06-01 17:59:32.000000000 -0500
@@ -0,0 +1,15 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum_frontpage.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/06/01 22:59:32 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("FOR_FP_1", "Forum");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum.php 75/e107_plugins/forum/languages/English/lan_forum.php
--- 6171/e107_plugins/forum/languages/English/lan_forum.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum.php	2005-05-22 09:30:21.000000000 -0500
@@ -0,0 +1,114 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/05/22 14:30:21 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+define("e_PAGETITLE", "Forum");
+	
+define("LAN_30", "Welcome");
+define("LAN_31", "There are no new posts ");
+define("LAN_32", "There is 1 new post ");
+define("LAN_33", "There are");
+define("LAN_34", "new posts");
+define("LAN_35", "since your last visit.");
+define("LAN_36", "You last visited at ");
+define("LAN_37", "It is now ");
+define("LAN_38", ", all times are ");
+define("LAN_41", "Newest member: ");
+define("LAN_42", "Registered members: ");
+define("LAN_44", "These forums can be used by non-registered users, but please be aware that your IP Address will be logged if you make a post.<br />To access the full features of this forum  you will need to");
+define("LAN_45", "These forums can only be posted to by registered and logged in members, please click");
+define("LAN_46", "Forum");
+define("LAN_47", "Threads");
+define("LAN_48", "Replies");
+define("LAN_49", "Last Post");
+define("LAN_51", "No forums yet, please check back soon.");
+define("LAN_52", "No forums in this section yet, please check back soon.");
+define("LAN_79", "New posts");
+define("LAN_80", " No new posts");
+define("LAN_81", "Closed thread");
+define("LAN_100", "articles");
+define("LAN_180", "Search");
+define("LAN_191", "Information");
+define("LAN_192", "The users of this forum have made a total of ");
+define("LAN_196", "You have read ");
+define("LAN_197", " of these posts.");
+define("LAN_198", " All new posts have been read.");
+define("LAN_199", "Mark all posts as read");
+define("LAN_204", "You <b>can</b> start new threads");
+define("LAN_205", "You <b>cannot</b> start new threads");
+define("LAN_206", "You <b>can</b> post replies");
+define("LAN_207", "You <b>cannot</b> post replies");
+define("LAN_208", "You <b>can</b> edit your posts");
+define("LAN_209", "You <b>cannot</b> edit your posts");
+define("LAN_392", "stop tracking this thread");
+define("LAN_393", "List tracked threads");
+define("LAN_394", "Closed forum");
+define("LAN_397", "Tracked threads");
+define("LAN_398", "Closed");
+define("LAN_399", "Restricted");
+define("LAN_400", "This forum can only be browsed by registered members");
+define("LAN_401", "Members only");
+	
+define("LAN_402", "This forum is read only");
+	
+define("LAN_403", "No posts yet");
+define("LAN_404", "posts");
+define("LAN_405", "Read Only");
+	
+define("LAN_406", "This forum is restricted to administrators only");
+define("LAN_407", "This forum is restricted to members only");
+define("LAN_408", "This is a read-only forum");
+define("LAN_409", "This is a class restricted forum");
+define("LAN_410", "Welcome guest");
+	
+define("LAN_411", "thread");
+define("LAN_412", "reply");
+define("LAN_413", "threads");
+define("LAN_414", "replies");
+define("LAN_415", "user is browsing the forums at the moment");
+define("LAN_416", "users are browsing the forums at the moment");
+	
+define("LAN_417", "member");
+define("LAN_418", "guest");
+define("LAN_419", "members");
+define("LAN_420", "guests");
+	
+define("LAN_421", "Show new posts");
+define("LAN_422", "New posts since your last visit");
+define("LAN_423", "Posted by");
+define("LAN_424", "New threads");
+define("LAN_425", "Re:");
+	
+//v.616
+define("LAN_426", "Who's Online: ");
+define("LAN_427", "View detailed list.");
+define("LAN_428", "Re:");
+define("LAN_429", "Top Posters");
+define("LAN_430", "Most Active Threads");
+define("LAN_431", "My Posts");
+define("LAN_432", "My Settings");
+define("LAN_433", "Forum Rules");
+define("LAN_434", "Return to forums");
+define("LAN_435", "My Profile");
+define("LAN_436", " (Will open a new window.)");
+	
+define("LAN_437", "register");
+define("LAN_438", "and login.");
+define("LAN_439", "here");
+define("LAN_440", "to go to the registration page.");
+
+define("LAN_441", "View forum statistics");
+	
+define('FORLAN_441', 'No rules defined.');
+define('FORLAN_442', 'My Uploads');
+define('FORLAN_443', '[user deleted]');
+define('FORLAN_444', 'sub-forums');
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum_post.php 75/e107_plugins/forum/languages/English/lan_forum_post.php
--- 6171/e107_plugins/forum/languages/English/lan_forum_post.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum_post.php	2005-05-22 11:05:56.000000000 -0500
@@ -0,0 +1,115 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum_post.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/05/22 16:05:56 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Forum");
+	
+define("LAN_01", "Forums");
+define("LAN_02", "Replying to: ");
+define("LAN_03", "New Thread");
+define("LAN_1", "Normal");
+define("LAN_2", "Sticky");
+define("LAN_3", "Announcement");
+define("LAN_4", "Post Poll");
+define("LAN_5", "Poll Question:");
+define("LAN_6", "Add another option");
+define("LAN_7", "Vote option:");
+define("LAN_8", "Allow votes from all");
+define("LAN_9", "Allow votes from members only");
+define("LAN_10", "Login");
+define("LAN_11", "Remember me");
+define("LAN_16", "Username: ");
+define("LAN_17", "Password: ");
+define("LAN_20", "Error");
+define("LAN_27", "You left required field(s) blank");
+define("LAN_28", "You didn't post anything ..");
+define("LAN_29", "Edited");
+define("LAN_45", "These forums can only be posted to by registered and logged in members, please click");
+define("LAN_60", "Start New Thread");
+define("LAN_61", "Your Name: ");
+define("LAN_62", "Subject: ");
+define("LAN_63", "Post: ");
+define("LAN_64", "Submit new thread");
+define("LAN_73", "Reply: ");
+define("LAN_74", "Reply to  thread");
+define("LAN_77", "Update Thread");
+define("LAN_78", "Update Reply");
+define("LAN_94", "Posted by");
+define("LAN_95", "Unauthorised");
+define("LAN_96", "You are not authorised to edit this forum post.");
+define("LAN_100", "Thread Topic");
+define("LAN_101", "Latest ");
+define("LAN_102", " replies");
+define("LAN_103", "Review complete thread. (Will open a new window.)");
+define("LAN_133", "Thankyou");
+define("LAN_174", "Signup");
+define("LAN_175", "Login");
+define("LAN_212", "Forgot password?");
+define("LAN_310", "Unable to accept post as that username is registered - if it is your username please login to post.");
+define("LAN_311", "Anonymous");
+define("LAN_322", "Posted: ");
+define("LAN_323", "Preview");
+define("LAN_324", "Your message has been successfully posted.");
+define("LAN_325", "Click Here to view your message");
+define("LAN_326", "Click here to return to the forum");
+define("LAN_327", "Review");
+define("LAN_380", "If you wish to be notified by email when a reply is posted to your thread please tick the box ");
+define("LAN_381", "Forum reply from ");
+define("LAN_382", "Post made: ");
+define("LAN_383", "Please click the following link to view the full thread ...");
+define("LAN_384", "Forum reply at ");
+define("LAN_385", "Post: ");
+define("LAN_386", "If you do not wish to add a poll to your thread leave the fields blank ");
+define("LAN_387", "Go");
+define("LAN_388", "Back to top");
+define("LAN_389", "Duplicate post, redirecting ...");
+define("LAN_390", "Attach file / image");
+define("LAN_391", "Options");
+define("LAN_392", "File to attach");
+define("LAN_393", "<b>Please note</b><br />Allowed filetypes:");
+define("LAN_394", "Any other filetypes uploaded will be instantly deleted.");
+define("LAN_395", "Maximum file size");
+define("LAN_396", "bytes");
+define("LAN_397", "This thread is locked.");
+define("LAN_398", "This forum is read only");
+define("LAN_399", "You are not authorized to post to this forum.");
+define("LAN_400", "post thread as");
+define("LAN_401", "Jump");
+	
+define("LAN_402", "poll");
+define("LAN_403", "announcement");
+define("LAN_404", "sticky");
+define("LAN_405", "Forums");
+define("LAN_406", "Re:");
+	
+//v.616
+define("LAN_407", "Redirect");
+define("LAN_408", "If your browser does not support meta redirection please click");
+define("LAN_409", "HERE");
+define("LAN_410", "to be redirected");
+define("LAN_411", "here");
+define("LAN_412", "to go to the registration page.");
+	
+define("LAN_413", "Your poll has been successfully posted.");
+define("LAN_414", "Click Here to view your poll");
+define("LAN_415", "Your reply has been successfully posted.");
+
+define("LAN_416", "Attach file");
+define("LAN_417", "Add another attachment");
+
+define("POLL_506", "Allow multiple choices?");
+define("POLL_507", "yes");
+define("POLL_508", "no");
+
+define("LAN_FORUM_1", "Uploads disabled: ".e_FILE."public directory is not writable");
+define("LAN_FORUM_2", "Duplicate post");
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum_search.php 75/e107_plugins/forum/languages/English/lan_forum_search.php
--- 6171/e107_plugins/forum/languages/English/lan_forum_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum_search.php	2005-06-16 00:25:35.000000000 -0500
@@ -0,0 +1,19 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum_search.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/06/16 05:25:35 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("FOR_SCH_LAN_1", "Forum");
+define("FOR_SCH_LAN_2", "Select forum");
+define("FOR_SCH_LAN_3", "All Forums");
+define("FOR_SCH_LAN_4", "Whole post");
+define("FOR_SCH_LAN_5", "As part of thread");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum_stats.php 75/e107_plugins/forum/languages/English/lan_forum_stats.php
--- 6171/e107_plugins/forum/languages/English/lan_forum_stats.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum_stats.php	2005-03-25 05:38:50.000000000 -0600
@@ -0,0 +1,39 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum_stats.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/03/25 11:38:50 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+define("e_PAGETITLE", "Forum Statistics");
+
+define("FSLAN_1", "General");
+define("FSLAN_2", "Forum opened");
+define("FSLAN_3", "Open for");
+define("FSLAN_4", "Total posts");
+define("FSLAN_5", "Forum topics");
+define("FSLAN_6", "Forum replies");
+define("FSLAN_7", "Forum thread views");
+define("FSLAN_8", "Database size (forum tables only)");
+define("FSLAN_9", "Average row length in forum table");
+define("FSLAN_10", "Most active topics");
+define("FSLAN_11", "Rank");
+define("FSLAN_12", "Topic");
+define("FSLAN_13", "Replies");
+define("FSLAN_14", "Started by");
+define("FSLAN_15", "Date");
+define("FSLAN_16", "Most viewed topics");
+define("FSLAN_17", "Views");
+define("FSLAN_18", "Top posters");
+define("FSLAN_19", "Name");
+define("FSLAN_20", "Posts");
+define("FSLAN_21", "Top topic starters");
+define("FSLAN_22", "Top repliers");
+define("FSLAN_23", "Forum Statistics");
+define("FSLAN_24", "Average posts per day");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum_uploads.php 75/e107_plugins/forum/languages/English/lan_forum_uploads.php
--- 6171/e107_plugins/forum/languages/English/lan_forum_uploads.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum_uploads.php	2005-02-24 14:43:34.000000000 -0600
@@ -0,0 +1,25 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum_uploads.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/02/24 20:43:34 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Forum Uploads");
+
+define('FRMUP_1','Uploaded Files in forum');
+define('FRMUP_2','File deleted');
+define('FRMUP_3','Error: Unable to delete file');
+define('FRMUP_4','File deletion');
+define('FRMUP_5','Filename');
+define('FRMUP_6','Result');
+define('FRMUP_7','Found in thread');
+define('FRMUP_8','NOT FOUND');
+define('FRMUP_9','No uploaded files found');
+define('FRMUP_10','Delete');
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum_viewforum.php 75/e107_plugins/forum/languages/English/lan_forum_viewforum.php
--- 6171/e107_plugins/forum/languages/English/lan_forum_viewforum.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum_viewforum.php	2005-09-05 20:12:01.000000000 -0500
@@ -0,0 +1,94 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum_viewforum.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/09/06 01:12:01 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Forum");
+	
+define("LAN_01", "Forums");
+define("LAN_02", "Back to top");
+define("LAN_03", "Go");
+define("LAN_53", "Thread");
+define("LAN_54", "Starter");
+define("LAN_55", "Replies");
+define("LAN_56", "Views");
+define("LAN_57", "Latest Post");
+define("LAN_58", "There are no topics in this forum yet.");
+define("LAN_59", "You must be a registered member and logged in to post on this forum. Click on signup or login from the login menu.");
+define("LAN_79", "New posts");
+define("LAN_80", " No new posts");
+define("LAN_81", "Closed thread");
+define("LAN_180", "Search");
+define("LAN_199", "Unread post exists");
+define("LAN_202", "Sticky");
+define("LAN_203", "Sticky/Closed");
+define("LAN_204", "You <b>can</b> start new threads");
+define("LAN_205", "You <b>cannot</b> start new threads");
+define("LAN_206", "You <b>can</b> post replies");
+define("LAN_207", "You <b>cannot</b> post replies");
+define("LAN_208", "You <b>can</b> edit your posts");
+define("LAN_209", "You <b>cannot</b> edit your posts");
+define("LAN_316", "Goto page: ");
+define("LAN_317", "None");
+define("LAN_321", "Moderators: ");
+define("LAN_395", "[popular]");
+define("LAN_396", "Announcement");
+	
+define("LAN_397", "This forum is read only");
+	
+define("LAN_398", "Unstick thread");
+define("LAN_399", "Lock thread");
+define("LAN_400", "Unlock thread");
+define("LAN_401", "Stick thread");
+define("LAN_402", "Move thread");
+define("LAN_403", "Jump to forum");
+define("LAN_404", "This forum is moderated by");
+	
+define("LAN_405", "user is browsing this forum at the moment");
+define("LAN_406", "users are browsing this forum at the moment");
+define("LAN_407", "member");
+define("LAN_408", "guest");
+define("LAN_409", "members");
+define("LAN_410", "guests");
+	
+//v.616
+define("LAN_411", "Important Threads");
+define("LAN_412", "Forum Threads");
+define("LAN_431", "Syndicate this forum: rss 0.92");
+define("LAN_432", "Syndicate this forum: rss 2.0");
+define("LAN_433", "Syndicate this forum: RDF");
+
+define("LAN_434", "Are you sure you want to delete this thread and any replies?");
+define("LAN_435", "Delete thread");
+	
+//v.617
+define("FORLAN_CLOSE", "Thread closed.");
+define("FORLAN_OPEN", "Thread reopened.");
+define("FORLAN_STICK", "Thread made sticky.");
+define("FORLAN_UNSTICK", "Thread unstuck.");
+define("FORLAN_6", "Thread deleted");
+define("FORLAN_7", "replies deleted");
+define("FORLAN_8", "here");
+define("FORLAN_9", "to sign up or login from the login menu.");
+	
+define("FORLAN_10", "Begin New Thread");
+define("FORLAN_11", "New Posts");
+define("FORLAN_12", "No New Posts");
+define("FORLAN_13", "New Posts on Popular Thread");
+define("FORLAN_14", "No New Posts on Popular Thread");
+define("FORLAN_15", "Sticky Thread");
+define("FORLAN_16", "Closed Sticky Thread");
+define("FORLAN_17", "Announcement Thread");
+define("FORLAN_18", "Closed Thread");
+define('FORLAN_19', '[user deleted]');
+define('FORLAN_20', 'Sub-forum');
+define('FORLAN_21', 'Threads');
+define('FORLAN_22', 'Last Post');
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_forum_viewtopic.php 75/e107_plugins/forum/languages/English/lan_forum_viewtopic.php
--- 6171/e107_plugins/forum/languages/English/lan_forum_viewtopic.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_forum_viewtopic.php	2006-02-03 13:57:51.000000000 -0600
@@ -0,0 +1,89 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_forum_viewtopic.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2006/02/03 19:57:51 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+define("PAGE_NAME", "Forum");
+	
+define("LAN_01", "Forums");
+define("LAN_02", "Go to page");
+define("LAN_03", "Go");
+define("LAN_04", "Previous");
+define("LAN_05", "Next");
+define("LAN_06", "Joined");
+define("LAN_07", "Location");
+define("LAN_08", "Website");
+define("LAN_09", "Visits to site since registration");
+define("LAN_10", "Back to top");
+define("LAN_65", "Jump");
+define("LAN_66", "This thread is now closed");
+define("LAN_67", "posts");
+define("LAN_194", "Guest");
+define("LAN_195", "Registered Member");
+define("LAN_321", "Moderators: ");
+define("LAN_389", "Previous thread");
+define("LAN_390", "Next thread");
+define("LAN_391", "Track Thread");
+define("LAN_392", "Cancel Thread Tracking");
+define("LAN_393", "Quick Reply");
+define("LAN_394", "Preview");
+define("LAN_395", "Reply To Thread");
+define("LAN_396", "Website");
+define("LAN_397", "Email");
+define("LAN_398", "Profile");
+define("LAN_399", "Private Message");
+define("LAN_400", "Edit");
+define("LAN_401", "Quote");
+	
+define("LAN_402", "Author");
+define("LAN_403", "Post");
+define("LAN_404", "No previous thread");
+define("LAN_405", "No next thread");
+	
+define("LAN_406", "Moderator: Edit");
+define("LAN_435", "Moderator: Delete");
+define("LAN_408", "Moderator: Move");
+define("LAN_409", "Are you sure you want to delete this thread and any replies?");
+define("LAN_410", "Are you sure you want to delete this reply?");
+define("LAN_411", "posted by ");
+	
+//v.616
+define("LAN_412", "Title");
+define("LAN_413", "Report");
+define("LAN_414", "Report this thread to a moderator");
+define("LAN_415", "Thread title");
+define("LAN_416", "Enter your report");
+define("LAN_417", "The admin will be made aware of this thread. You may post a message explaining what you found to be objectionable.");
+define("LAN_418", "<b>Do not</b> use this form to contact the admin for any other reason.");
+define("LAN_419", "Send Report");
+define("LAN_420", "Click to view post");
+define("LAN_421", "Forum thread report from");
+define("LAN_422", "This post has been reported from site ");
+define("LAN_423", "Message could not be sent. ");
+define("LAN_424", "Post has been reported to moderator.<br />Thank You.");
+define("LAN_425", "Message from: ");
+define("LAN_426", "Reporting post in topic: ");
+define("LAN_427", "Error sending mail");
+define("LAN_428", "Post has been reported");
+define("LAN_429", "Click here to return to forum");
+define("LAN_430", "poll");
+define("FORLAN_26", "Reply deleted");
+define("FORLAN_10", "Begin New Thread");
+define("LAN_29", "Edited");
+
+define("LAN_431", "Syndicate this thread: rss 0.92");
+define("LAN_432", "Syndicate this thread: rss 2.0");
+define("LAN_433", "Syndicate this thread: RDF");
+	
+define("FORLAN_101", "Email Thread");
+define("FORLAN_102", "Print View");
+define('FORLAN_103', '[user deleted]');
+define('FORLAN_104', 'Thread not found');
+define("FORLAN_HIDDEN", "HIDDEN - LOGIN AND REPLY TO REVEAL");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/languages/English/lan_newforumposts_menu.php 75/e107_plugins/forum/languages/English/lan_newforumposts_menu.php
--- 6171/e107_plugins/forum/languages/English/lan_newforumposts_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/languages/English/lan_newforumposts_menu.php	2005-11-14 14:43:58.000000000 -0600
@@ -0,0 +1,32 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/languages/English/lan_newforumposts_menu.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/11/14 20:43:58 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+define("NFP_1", "All latest posts are outside of your user class, unable to display.");
+define("NFP_2", "No posts yet");
+define("NFP_3", "New Forum Posts menu configuration saved");
+define("NFP_4", "Caption");
+define("NFP_5", "Number of posts to display?");
+define("NFP_6", "Number of characters to display?");
+define("NFP_7", "Postfix for too long posts?");
+define("NFP_8", "Show original topics in menu?");
+define("NFP_9", "Update menu Settings");
+define("NFP_10", "New Forum Posts Menu Configuration");
+define("NFP_11", "Posted by");
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/newforumposts_menu_config.php 75/e107_plugins/forum/newforumposts_menu_config.php
--- 6171/e107_plugins/forum/newforumposts_menu_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/newforumposts_menu_config.php	2005-09-04 22:23:13.000000000 -0500
@@ -0,0 +1,99 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/newforumposts_menu_config.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/09/05 03:23:13 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+$eplug_admin = TRUE;
+require_once("../../class2.php");
+if (!getperms("1")) {
+	header("location:".e_BASE."index.php");
+	 exit ;
+}
+require_once(e_ADMIN."auth.php");
+	
+$lan_file = e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_newforumposts_menu.php";
+require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."forum/languages/English/lan_newforumposts_menu.php");
+	
+if (isset($_POST['update_menu'])) {
+	while (list($key, $value) = each($_POST)) {
+		if ($value != NFP_9) {
+			$menu_pref[$key] = $value;
+		}
+	}
+	if (!$_POST['newforumposts_title']) {
+		$menu_pref['newforumposts_title'] = 0;
+	}
+	$tmp = addslashes(serialize($menu_pref));
+	$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
+	$ns->tablerender("", "<div style=\"text-align:center\"><b>".NFP_3."</b></div>");
+}
+	
+$text = "<div style='text-align:center'>
+	<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
+	<table style=\"width:85%\" class=\"fborder\">
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".NFP_4.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"newforumposts_caption\" size=\"20\" value=\"".$menu_pref['newforumposts_caption']."\" maxlength=\"100\" />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".NFP_5.":
+	</td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"newforumposts_display\" size=\"20\" value=\"".$menu_pref['newforumposts_display']."\" maxlength=\"2\" />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".NFP_6.": </td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"newforumposts_characters\" size=\"20\" value=\"".$menu_pref['newforumposts_characters']."\" maxlength=\"4\" />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".NFP_7.":
+	</td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input class=\"tbox\" type=\"text\" name=\"newforumposts_postfix\" size=\"30\" value=\"".$menu_pref['newforumposts_postfix']."\" maxlength=\"200\" />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style=\"width:40%\" class='forumheader3'>".NFP_8.":</td>
+	<td style=\"width:60%\" class='forumheader3'>
+	<input type=\"checkbox\" name=\"newforumposts_title\" value=\"1\" ";
+if ($menu_pref['newforumposts_title']) {
+	$text .= " checked ";
+}
+$text .= "
+	</td>
+	</tr>
+	 
+	<tr style=\"vertical-align:top\">
+	<td colspan=\"2\"  style=\"text-align:center\" class='forumheader'>
+	<input class=\"button\" type=\"submit\" name=\"update_menu\" value=\"".NFP_9."\" />
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+$ns->tablerender(NFP_10, $text);
+require_once(e_ADMIN."footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/newforumposts_menu.php 75/e107_plugins/forum/newforumposts_menu.php
--- 6171/e107_plugins/forum/newforumposts_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/newforumposts_menu.php	2006-01-14 21:01:08.000000000 -0600
@@ -0,0 +1,97 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/newforumposts_menu.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/01/15 03:01:08 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $tp;
+$gen = new convert;
+
+if (file_exists(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_newforumposts_menu.php"))
+{
+	include_once(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_newforumposts_menu.php");
+}
+else
+{
+	include_once(e_PLUGIN."forum/languages/English/lan_newforumposts_menu.php");
+}
+$_chars = max($menu_pref['newforumposts_characters'] * 3, 200);
+
+$query2 = "
+SELECT tp.thread_name AS parent_name, t.thread_datestamp , left(t.thread_thread, {$_chars}) as thread_thread, t.thread_name, t.thread_id, t.thread_user, f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class FROM #forum_t AS t 
+LEFT JOIN #user AS u ON t.thread_user = u.user_id 
+LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id 
+LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id 
+LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id 
+WHERE f.forum_class  IN (".USERCLASS_LIST.") 
+AND fp.forum_class IN (".USERCLASS_LIST.") 
+ORDER BY t.thread_datestamp DESC LIMIT 0, ".$menu_pref['newforumposts_display'];
+
+$results = $sql->db_Select_gen($query2);
+
+if(!$results)
+{
+	// no posts yet ..
+	$text = NFP_2;
+}
+else
+{
+	$text = "";
+	$forumArray = $sql->db_getList();
+	foreach($forumArray as $fi)
+	{
+		$datestamp = $gen->convert_date($fi['thread_datestamp'], "short");
+		$topic = ($fi['parent_name'] ? "re: <i>{$fi['parent_name']}</i>" : "<i>{$fi['thread_name']}</i>");
+		$topic = strip_tags($tp->toHTML($topic, TRUE, "emotes_off, no_make_clickable, parse_bb", "", $pref['menu_wordwrap']));
+		$id = $fi['thread_id'];
+
+		if($fi['user_name'])
+		{
+			$poster = $fi['user_name'];
+		}
+		else
+		{
+			$x = explode(chr(1), $fi['thread_user']);
+			$tmp = explode(".", $x[0], 2);
+			if($tmp[1])
+			{
+				$poster = $tmp[1];
+			}
+			else
+			{
+				$poster = "[deleted]";
+			}
+		}
+
+		$fi['thread_thread'] = strip_tags($tp->toHTML($fi['thread_thread'], TRUE, "emotes_off, no_make_clickable, parse_bb", "", $pref['menu_wordwrap']));
+
+		if (strlen($fi['thread_thread']) > $menu_pref['newforumposts_characters'])
+		{
+			$fi['thread_thread'] = substr($fi['thread_thread'], 0, $menu_pref['newforumposts_characters']).$menu_pref['newforumposts_postfix'];
+		}
+
+		if ($menu_pref['newforumposts_title']) {
+			$text .= "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' /> <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$id}.post'>".$topic."</a><br />".$fi['thread_thread']."<br />".NFP_11." ".$poster."<br />".$datestamp."<br/><br />";
+		} else {
+			$text .= "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' /> <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$id}.post'>".NFP_11." ".$poster."</a><br />".$fi['thread_thread']."<br />".$datestamp."<br/><br />";
+		}
+	}
+}
+
+$ns->tablerender($menu_pref['newforumposts_caption'], $text, 'nfp_menu');
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/plugin.php 75/e107_plugins/forum/plugin.php
--- 6171/e107_plugins/forum/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/plugin.php	2006-04-29 15:34:37.000000000 -0500
@@ -0,0 +1,138 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/plugin.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/04/29 20:34:37 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_conf.php');
+@include_once(e_PLUGIN.'forum/languages/English/lan_forum_conf.php');
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = 'Forum';
+$eplug_version = '1.2';
+$eplug_author = 'e107dev';
+$eplug_url = 'http://e107.org';
+$eplug_email = '';
+$eplug_description = 'This plugin is a fully featured Forum system.';
+$eplug_compatible = 'e107v0.7+';
+$eplug_readme = '';
+$eplug_latest = TRUE; //Show reported threads in admin (use latest.php)
+$eplug_status = TRUE; //Show post count in admin (use status.php)
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "forum";
+
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "forum";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "forum_admin.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/forums_32.png";
+$eplug_icon_small = $eplug_folder."/images/forums_16.png";
+$eplug_caption = 'Configure Forum';
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array(
+	"forum_show_topics" => "1",
+	"forum_postfix" => "[more...]",
+	'forum_poll' => '0',
+	'forum_popular' => '10',
+	'forum_track' => '0',
+	'forum_eprefix' => '[forum]',
+	'forum_enclose' => '1',
+	'forum_title' => 'Forums',
+	'forum_postspage' => '10',
+	'forum_hilightsticky' => '1'
+ );
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array(
+"forum",
+	"forum_t" );
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."forum (
+	forum_id int(10) unsigned NOT NULL auto_increment,
+	forum_name varchar(250) NOT NULL default '',
+	forum_description text NOT NULL,
+	forum_parent int(10) unsigned NOT NULL default '0',
+	forum_sub int(10) unsigned NOT NULL default '0',
+	forum_datestamp int(10) unsigned NOT NULL default '0',
+	forum_moderators text NOT NULL,
+	forum_threads int(10) unsigned NOT NULL default '0',
+	forum_replies int(10) unsigned NOT NULL default '0',
+	forum_lastpost_user varchar(200) NOT NULL default '',
+	forum_lastpost_info varchar(40) NOT NULL default '',
+	forum_class varchar(100) NOT NULL default '',
+	forum_order int(10) unsigned NOT NULL default '0',
+	forum_postclass tinyint(3) unsigned NOT NULL default '0',
+	PRIMARY KEY  (forum_id)
+	) TYPE=MyISAM AUTO_INCREMENT=1;",
+	"CREATE TABLE ".MPREFIX."forum_t (
+	thread_id int(10) unsigned NOT NULL auto_increment,
+	thread_name varchar(250) NOT NULL default '',
+	thread_thread text NOT NULL,
+	thread_forum_id int(10) unsigned NOT NULL default '0',
+	thread_datestamp int(10) unsigned NOT NULL default '0',
+	thread_parent int(10) unsigned NOT NULL default '0',
+	thread_user varchar(250) NOT NULL default '',
+	thread_views int(10) unsigned NOT NULL default '0',
+	thread_active tinyint(3) unsigned NOT NULL default '0',
+	thread_lastpost int(10) unsigned NOT NULL default '0',
+	thread_s tinyint(1) unsigned NOT NULL default '0',
+	thread_edit_datestamp int(10) unsigned NOT NULL default '0',
+	thread_lastuser varchar(30) NOT NULL default '',
+	thread_total_replies int(10) unsigned NOT NULL default '0',
+	PRIMARY KEY  (thread_id),
+	KEY thread_parent (thread_parent),
+	KEY thread_datestamp (thread_datestamp),
+	KEY thread_forum_id (thread_forum_id)
+	) TYPE=MyISAM AUTO_INCREMENT=1;");
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = TRUE;
+$eplug_link_name = "Forum";
+$eplug_link_url = e_PLUGIN.'forum/forum.php';
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = 'Your forum is now installed';
+
+$eplug_upgrade_done = 'Forum successfully upgraded, now using version: '.$eplug_version;
+
+$upgrade_alter_tables = array(
+"ALTER TABLE ".MPREFIX."forum ADD forum_postclass TINYINT( 3 ) UNSIGNED DEFAULT '0' NOT NULL ;"
+);
+
+if (!function_exists('forum_uninstall')) {
+	function forum_uninstall() {
+		global $sql;
+		$sql -> db_Update("user", "user_forums='0'");
+	}
+}
+
+if (!function_exists('forum_install')) {
+	function forum_install() {
+		global $sql;
+		$sql -> db_Update("user", "user_forums='0'");
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/search/search_advanced.php 75/e107_plugins/forum/search/search_advanced.php
--- 6171/e107_plugins/forum/search/search_advanced.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/search/search_advanced.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,47 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/search/search_advanced.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$advanced['forum']['type'] = 'dropdown';
+$advanced['forum']['text'] = FOR_SCH_LAN_2.':';
+$advanced['forum']['list'][] = array('id' => 'all', 'title' => FOR_SCH_LAN_3);
+
+$advanced_caption['id'] = 'forum';
+$advanced_caption['title']['all'] = FOR_SCH_LAN_3;
+
+if ($sql -> db_Select_gen("SELECT f.forum_id, f.forum_name FROM #forum AS f LEFT JOIN #forum AS fp ON fp.forum_id = f.forum_parent WHERE f.forum_parent != 0 AND fp.forum_class IN (".USERCLASS_LIST.") AND f.forum_class IN (".USERCLASS_LIST.")")) {
+	while ($row = $sql -> db_Fetch()) {
+		$advanced['forum']['list'][] = array('id' => $row['forum_id'], 'title' => $row['forum_name']);
+		$advanced_caption['title'][$row['forum_id']] = FOR_SCH_LAN_1.' -> '.$row['forum_name'];
+	}
+}
+
+$advanced['date']['type'] = 'date';
+$advanced['date']['text'] = LAN_SEARCH_50.':';
+
+$advanced['author']['type'] = 'author';
+$advanced['author']['text'] = LAN_SEARCH_61.':';
+
+$advanced['match']['type'] = 'dropdown';
+$advanced['match']['text'] = LAN_SEARCH_52.':';
+$advanced['match']['list'][] = array('id' => 0, 'title' => FOR_SCH_LAN_4);
+$advanced['match']['list'][] = array('id' => 1, 'title' => LAN_SEARCH_54);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/search/search_parser.php 75/e107_plugins/forum/search/search_parser.php
--- 6171/e107_plugins/forum/search/search_parser.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/search/search_parser.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,78 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/search/search_parser.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/01/05 09:06:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// advanced 
+$advanced_where = "";
+if (isset($_GET['forum']) && is_numeric($_GET['forum'])) {
+	$advanced_where .= " f.forum_id='".$_GET['forum']."' AND";
+}
+
+if (isset($_GET['time']) && is_numeric($_GET['time'])) {
+	$advanced_where .= " t.thread_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
+}
+
+if (isset($_GET['author']) && $_GET['author'] != '') {
+	$advanced_where .= " (u.user_id = '".$tp -> toDB($_GET['author'])."' OR u.user_name = '".$tp -> toDB($_GET['author'])."') AND";
+}
+
+if (isset($_GET['match']) && $_GET['match']) {
+	$search_fields = array('t.thread_name');
+} else {
+	$search_fields = array('t.thread_name', 't.thread_thread');
+}
+
+// basic
+$return_fields = 'tp.thread_name AS parent_name, t.thread_id, t.thread_name, t.thread_thread, t.thread_forum_id, t.thread_parent, t.thread_datestamp, t.thread_user, u.user_id, u.user_name, f.forum_class, f.forum_id, f.forum_name';
+$weights = array('1.2', '0.6');
+$no_results = LAN_198;
+
+$where = "f.forum_class REGEXP '".e_CLASS_REGEXP."' AND fp.forum_class REGEXP '".e_CLASS_REGEXP."' AND".$advanced_where;
+$order = array('thread_datestamp' => DESC);
+$table = "forum_t AS t LEFT JOIN #user AS u ON FLOOR(t.thread_user) = u.user_id
+		LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id
+		LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
+		LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id";
+
+$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_forum', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_forum($row) {
+	global $con;
+	$datestamp = $con -> convert_date($row['thread_datestamp'], "long");
+	if ($row['thread_parent']) {
+		$title = $row['parent_name'];
+	} else {
+		$title = $row['thread_name'];
+	}
+
+	$link_id = $row['thread_id'];
+
+	$res['link'] = e_PLUGIN."forum/forum_viewtopic.php?".$link_id.".post";
+	$res['pre_title'] = $title ? FOR_SCH_LAN_5.": " : "";
+	$res['title'] = $title ? $title : LAN_SEARCH_9;
+	$res['pre_summary'] = "<div class='smalltext' style='padding: 2px 0px'><a href='".e_PLUGIN."forum/forum.php'>".FOR_SCH_LAN_1."</a> -> <a href='".e_PLUGIN."forum/forum_viewforum.php?".$row['forum_id']."'>".$row['forum_name']."</a></div>";
+	$res['summary'] = $row['thread_thread'];
+	$res['detail'] = LAN_SEARCH_7."<a href='user.php?id.".$row['user_id']."'>".$row['user_name']."</a>".LAN_SEARCH_8.$datestamp;
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/templates/forum_icons_template.php 75/e107_plugins/forum/templates/forum_icons_template.php
--- 6171/e107_plugins/forum/templates/forum_icons_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/templates/forum_icons_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,71 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/templates/forum_icons_template.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php');
+@include_once(e_PLUGIN.'forum/languages/English/lan_forum_viewforum.php');
+
+define("IMAGE_e", "<img src='".img_path('e.png')."' alt='' title='' style='border:0' />");
+define("IMAGE_new", "<img src='".img_path('new.png')."' alt='".LAN_199."' title='".LAN_199."' style='border:0' />");
+define("IMAGE_nonew", "<img src='".img_path('nonew.png')."' alt='' title='' style='border:0' />");
+define("IMAGE_new_small", "<img src='".img_path('new_small.png')."' alt='".FORLAN_11."' title='".FORLAN_11."' style='border:0' />");
+define("IMAGE_nonew_small", "<img src='".img_path('nonew_small.png')."' alt='".FORLAN_12."' title='".FORLAN_12."' style='border:0' />");
+define("IMAGE_new_popular", "<img src='".img_path('new_popular.png')."' alt='".FORLAN_13."' title='".FORLAN_13."' style='border:0' />");
+define("IMAGE_nonew_popular", "<img src='".img_path('nonew_popular.png')."' alt='".FORLAN_14."' title='".FORLAN_14."' style='border:0' />");
+define("IMAGE_new_popular_small", "<img src='".img_path('new_popular_small.png')."' alt='".FORLAN_13."' title='".FORLAN_13."' style='border:0' />");
+define("IMAGE_nonew_popular_small", "<img src='".img_path('nonew_popular_small.png')."' alt='".FORLAN_14."' title='".FORLAN_14."' style='border:0' />");
+define("IMAGE_sticky", "<img src='".img_path('sticky.png')."' alt='".FORLAN_15."' title='".FORLAN_15."' style='border:0' />");
+define("IMAGE_stickyclosed", "<img src='".img_path('sticky_closed.png')."' alt='".FORLAN_16."' title='".FORLAN_16."' style='border:0' />");
+define("IMAGE_sticky_small", "<img src='".img_path('sticky_small.png')."' alt='".FORLAN_16."' title='".FORLAN_16."' style='border:0' />");
+define("IMAGE_stickyclosed_small", "<img src='".img_path('sticky_closed_small.png')."' alt='".FORLAN_16."' title='".FORLAN_16."' style='border:0' />");
+define("IMAGE_announce", "<img src='".img_path('announce.png')."' alt='".FORLAN_17."' title='".FORLAN_17."' style='border:0' />");
+define("IMAGE_announce_small", "<img src='".img_path('announce_small.png')."' alt='".FORLAN_17."' title='".FORLAN_17."' style='border:0' />");
+define("IMAGE_closed_small", "<img src='".img_path('closed_small.png')."' alt='".FORLAN_18."' title='".FORLAN_18."' style='border:0' />");
+define("IMAGE_closed", "<img src='".img_path('closed.png')."' alt='".FORLAN_18."' title='".FORLAN_18."' style='border:0' />");
+define("IMAGE_profile", "<img src='".img_path('profile.png')."' alt='".LAN_398."' title='".LAN_398."' style='border:0' />");
+define("IMAGE_email", "<img src='".img_path('email.png')."' alt='".LAN_397."' title='".LAN_397."' style='border:0' />");
+define("IMAGE_pm", "<img src='".img_path('pm.png')."' alt='".LAN_399."' title='".LAN_399."' style='border:0' />");
+define("IMAGE_website", "<img src='".img_path('website.png')."' alt='".LAN_396."' title='".LAN_396."' style='border:0' />");
+define("IMAGE_edit", "<img src='".img_path('edit.png')."' alt='".LAN_400."' title='".LAN_400."' style='border:0' />");
+define("IMAGE_quote", "<img src='".img_path('quote.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' />");
+define("IMAGE_admin_edit", "<img src='".img_path('admin_edit.png')."' alt='".LAN_406."' title='".LAN_406."' style='border:0; vertical-align: top;' />");
+define("IMAGE_admin_move", "<img src='".img_path('admin_move.png')."' alt='".LAN_402."' title='".LAN_402."' style='border:0; vertical-align: top;' />");
+define("IMAGE_admin_move2", "<img src='".img_path('admin_move.png')."' alt='".LAN_408."' title='".LAN_408."' style='border:0; vertical-align: top;' />");
+define("IMAGE_post", "<img src='".img_path('post.png')."' alt='' title='' style='border:0' />");
+define("IMAGE_post2", "<img src='".img_path('post2.png')."' alt='' title='' style='border:0; vertical-align:bottom' />");
+define("IMAGE_report", "<img src='".img_path('report.png')."' alt='".LAN_413."' title='".LAN_413."' style='border:0' />");
+	
+// Admin <input> Icons
+	
+define("IMAGE_admin_delete", "src='".img_path('admin_delete.png')."' alt='".LAN_435."' title='".LAN_435."' style='border:0' ");
+define("IMAGE_admin_unstick", "src='".img_path('admin_unstick.png')."' alt='".LAN_398."' title='".LAN_398."' style='border:0' ");
+define("IMAGE_admin_stick", "src='".img_path('sticky_small.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' ");
+define("IMAGE_admin_lock", "src='".img_path('admin_lock.png')."' alt='".LAN_399."' title='".LAN_399."' style='border:0' ");
+define("IMAGE_admin_unlock", "src='".img_path('admin_unlock.png')."' alt='".LAN_400."' title='".LAN_400."' style='border:0' ");
+	
+// Multi Language Images
+	
+define("IMAGE_newthread", "<img src='".img_path('newthread.png')."' alt='".FORLAN_10."' title='".FORLAN_10."' style='border:0' />");
+define("IMAGE_reply", "<img src='".img_path('reply.png')."' alt='' title='' style='border:0' />");
+define("IMAGE_rank_moderator_image", "<img src='".img_path('moderator.png', '', 'rank_moderator_image')."' alt='' />");
+define("IMAGE_rank_main_admin_image", "<img src='".img_path('main_admin.png', '', 'rank_main_admin_image')."' alt='' />");
+define("IMAGE_rank_admin_image", "<img src='".img_path('admin.png', '', 'rank_admin_image')."' alt='' />");
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/templates/forum_posted_template.php 75/e107_plugins/forum/templates/forum_posted_template.php
--- 6171/e107_plugins/forum/templates/forum_posted_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/templates/forum_posted_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,57 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$FORUMPOLLPOSTED =
+"<table style='width:95%' class='fborder'>
+<tr>
+<td class='fcaption' colspan='2'>".LAN_133."</td>
+</tr><tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_413."<br />
+<span class='defaulttext'><a class='forumlink' href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_id."'>".LAN_414."</a><br />
+<a class='forumlink' href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>";
+
+$FORUMTHREADPOSTED = "
+<table style='width:95%' class='fborder'>
+<tr>
+<td class='fcaption' colspan='2'>".LAN_133."</td>
+</tr><tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_324."<br />
+".(defined("F_MESSAGE") ? F_MESSAGE."<br />" : "")."
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>";
+
+
+$FORUMREPLYPOSTED = "
+<table style='width:95%' class='fborder'>
+<tr>
+<td class='fcaption' colspan='2'>".LAN_133."</td>
+</tr><tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_415."<br />
+".(defined("F_MESSAGE") ? F_MESSAGE."<br />" : "")."
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/templates/forum_post_template.php 75/e107_plugins/forum/templates/forum_post_template.php
--- 6171/e107_plugins/forum/templates/forum_post_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/templates/forum_post_template.php	2006-04-04 18:19:05.000000000 -0500
@@ -0,0 +1,228 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/templates/forum_post_template.php,v $
+|     $Revision: 1.19 $
+|     $Date: 2006/04/04 23:19:05 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// the user box and subject box are not always displayed, therefore we need to define them /in case/ they are, if not they'll be ignored.
+
+if(!$userbox)
+{
+$userbox = "<tr>
+<td class='forumheader2' style='width:20%'>".LAN_61."</td>
+<td class='forumheader2' style='width:80%'>
+<input class='tbox' type='text' name='anonname' size='71' value='".$anonname."' maxlength='20' style='width:95%' />
+</td>
+</tr>";
+}
+
+if(!$subjectbox)
+{
+$subjectbox = "<tr>
+<td class='forumheader2' style='width:20%'>".LAN_62."</td>
+<td class='forumheader2' style='width:80%'>
+<input class='tbox' type='text' name='subject' size='71' value='".$subject."' maxlength='100' style='width:95%' />
+</td>
+</tr>";
+}
+
+// the poll is optional, be careful when changing the values here, only change if you know what you're doing ...
+if(!$poll_form)
+{
+	if(is_readable(e_PLUGIN."poll/poll_class.php")) {
+		require_once(e_PLUGIN."poll/poll_class.php");
+		$pollo = new poll;
+		$poll_form = $pollo -> renderPollForm("forum");
+	}
+}
+
+// finally, file attach is optional, again only change this if you know what you're doing ...
+if(!$fileattach)
+{
+$fileattach = "
+<tr>
+	<td colspan='2' class='nforumcaption2'>".($pref['image_post'] ? LAN_390 : LAN_416)."</td>
+</tr>
+<tr>
+	<td style='width:20%' class='forumheader3'>".LAN_392."</td>
+	<td style='width:80%' class='forumheader3'>".LAN_393." | ".$allowed_filetypes." |<br />".LAN_394."<br />".LAN_395.": ".($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'].LAN_396 : ini_get('upload_max_filesize'))."
+		<br />
+		<div id='fiupsection'>
+		<span id='fiupopt'>
+			<input class='tbox' name='file_userfile[]' type='file' size='47' />
+		</span>
+		</div>
+		<input class='button' type='button' name='addoption' value='".LAN_417."' onclick=\"duplicateHTML('fiupopt','fiupsection')\" />
+	</td>
+</tr>
+";
+//</td>
+//</tr>
+}
+// If the upload directory is not writable, we need to alert the user about this.
+if(!$fileattach_alert)
+{
+	$fileattach_alert = "
+	<tr>
+		<td colspan='2' class='nforumcaption2'>".($pref['image_post'] ? LAN_390 : LAN_416)."</td>
+	</tr>
+	<tr>
+		<td colspan='2' class='forumheader3'>".LAN_FORUM_1."</td>
+	</tr>\n";
+}
+// ------------
+
+if(!$FORUMPOST)
+{
+$FORUMPOST = "
+<div style='text-align:center'>
+<div class='spacer'>
+{FORMSTART}
+<table style='width:95%' class='fborder'>
+<tr>
+<td colspan='2' class='fcaption'>{BACKLINK}
+</td>
+</tr>
+{USERBOX}
+{SUBJECTBOX}
+<tr>
+<td class='forumheader2' style='width:20%'>{POSTTYPE}</td>
+<td class='forumheader2' style='width:80%'>
+{POSTBOX}<br />{EMOTES}<br />{EMAILNOTIFY}<br />{POSTTHREADAS}
+</td>
+</tr>
+
+{POLL}
+
+{FILEATTACH}
+
+<tr style='vertical-align:top'>
+<td colspan='2' class='forumheader' style='text-align:center'>
+{BUTTONS}
+</td>
+</tr>
+</table>
+{FORMEND}
+
+<table style='width:95%'>
+<tr>
+<td>
+{FORUMJUMP}
+</td>
+</tr>
+</table>
+</div></div>
+";
+}
+
+if(!$FORUMPOST_REPLY)
+{
+$FORUMPOST_REPLY = "
+<div style='text-align:center'>
+<div class='spacer'>
+{FORMSTART}
+<table style='width:95%' class='fborder'>
+<tr>
+<td colspan='2' class='fcaption'>{BACKLINK}
+</td>
+</tr>
+{USERBOX}
+{SUBJECTBOX}
+<tr>
+<td class='forumheader2' style='width:20%'>{POSTTYPE}</td>
+<td class='forumheader2' style='width:80%'>
+{POSTBOX}<br />{EMOTES}<br />{EMAILNOTIFY}<br />{POSTTHREADAS}
+</td>
+</tr>
+
+{POLL}
+
+{FILEATTACH}
+
+<tr style='vertical-align:top'>
+<td colspan='2' class='forumheader' style='text-align:center'>
+{BUTTONS}
+</td>
+</tr>
+</table>
+{FORMEND}
+
+<table style='width:95%'>
+<tr>
+<td>
+{FORUMJUMP}
+</td>
+</tr>
+</table>
+</div></div>
+<div style='text-align:center'>
+{THREADTOPIC}
+{LATESTPOSTS}
+</div>
+";
+}
+
+if(!$LATESTPOSTS_START)
+{
+$LATESTPOSTS_START = "
+<table style='width:100%' class='fborder'>
+<tr>
+<td colspan='2' class='fcaption' style='vertical-align:top'>".
+LAN_101."{LATESTPOSTSCOUNT}".LAN_102."
+</td>
+</tr>";
+}
+
+if(!$LATESTPOSTS_POST)
+{
+$LATESTPOSTS_POST = "
+<tr>
+<td class='forumheader3' style='width:20%;vertical-align:top'><b>{POSTER}</b></td>
+<td class='forumheader3' style='width:80%'>
+	<div class='smallblacktext' style='text-align:right'>".IMAGE_post2." ".LAN_322."{THREADDATESTAMP}</div>
+	{POST}
+</td>
+</tr>
+";
+}
+
+if(!$LATESTPOSTS_END)
+{
+$LATESTPOSTS_END = "
+</table>
+";
+}
+
+if(!$THREADTOPIC_REPLY)
+{
+$THREADTOPIC_REPLY = "
+<table style='width:100%' class='fborder'>
+<tr>
+	<td colspan='2' class='fcaption' style='vertical-align:top'>".LAN_100."</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:20%;vertical-align:top'><b>{POSTER}</b></td>
+	<td class='forumheader3' style='width:80%'>
+		<div class='smallblacktext' style='text-align:right'>".IMAGE_post2." ".LAN_322."{THREADDATESTAMP}</div>{POST}
+	</td>
+</tr>
+</table>
+";
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/templates/forum_preview_template.php 75/e107_plugins/forum/templates/forum_preview_template.php
--- 6171/e107_plugins/forum/templates/forum_preview_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/templates/forum_preview_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,35 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/templates/forum_preview_template.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$FORUM_PREVIEW = "<div style='text-align:center'>
+<table style='width:100%' class='fborder'>
+<tr>
+<td colspan='2' class='fcaption' style='vertical-align:top'>".LAN_323.
+($action != "nt" ? "</td>" : " ( ".LAN_62.$tsubject." )</td>")."
+<tr>
+<td class='forumheader3' style='width:20%' style='vertical-align:top'><b>".$poster."</b></td>
+<td class='forumheader3' style='width:80%'>
+<div class='smallblacktext' style='text-align:right'>".IMAGE_post2." ".LAN_322.$postdate."</div>".$tpost."</td>
+</tr>
+</table>
+</div>";
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/templates/forum_template.php 75/e107_plugins/forum/templates/forum_template.php
--- 6171/e107_plugins/forum/templates/forum_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/templates/forum_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,72 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/templates/forum_template.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+if (!isset($FORUM_MAIN_START))
+{
+	$FORUM_MAIN_START = "<div style='text-align:center'>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td colspan='2' style='width:60%; text-align:center' class='fcaption'>{FORUMTITLE}</td>\n<td style='width:10%; text-align:center' class='fcaption'>{THREADTITLE}</td>\n<td style='width:10%; text-align:center' class='fcaption'>{REPLYTITLE}</td>\n<td style='width:20%; text-align:center' class='fcaption'>{LASTPOSTITLE}</td>\n</tr>";
+}
+if (!isset($FORUM_MAIN_PARENT))
+{
+	$FORUM_MAIN_PARENT = " <tr>\n<td colspan='5' class='forumheader'>{PARENTNAME} {PARENTSTATUS}</td>\n</tr>";
+}
+if (!isset($FORUM_MAIN_FORUM))
+{
+	$FORUM_MAIN_FORUM = "<tr>\n<td style='width:5%; text-align:center' class='forumheader2'>{NEWFLAG}</td>\n<td style='width:55%' class='forumheader2'>{FORUMNAME}<br /><span class='smallblacktext'>{FORUMDESCRIPTION}</span>{FORUMSUBFORUMS}</td>\n<td style='width:10%; text-align:center' class='forumheader3'>{THREADS}</td>\n<td style='width:10%; text-align:center' class='forumheader3'>{REPLIES}</td>\n<td style='width:20%; text-align:center' class='forumheader3'><span class='smallblacktext'>{LASTPOST}</span></td>\n</tr>";
+}
+if (!isset($FORUM_MAIN_END))
+{
+	$FORUM_MAIN_END = "</table></div>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td colspan='2' style='width:60%' class='fcaption'>{INFOTITLE}</td>\n</tr>\n<tr>\n<td rowspan='4' style='width:5%; text-align:center' class='forumheader3'>{LOGO}</td>\n<td style='width:auto' class='forumheader3'>{USERINFO}</td>\n</tr>\n<tr>\n<td style='width:95%' class='forumheader3'>{INFO}</td>\n</tr><tr>\n<td style='width:95%' class='forumheader3'>{FORUMINFO}</td>\n</tr>\n<tr>\n<td style='width:95%' class='forumheader3'>{USERLIST}<br />{STATLINK}</td>\n</tr>\n</table>\n</div>\n<div class='spacer'>\n<table class='fborder' style='width:95%'>\n<tr>\n<td class='forumheader3' style='text-align:center; width:33%'>{ICONKEY}</td>\n<td style='text-align:center; width:33%' class='forumheader3'>{SEARCH}</td>\n<td style='width:33%; text-align:center; vertical-align:middle' class='forumheader3'><span class='smallblacktext'>{PERMS}</span>\n</td>\n</tr>\n</table>\n</div>\n</div>";
+}
+
+if (!isset($FORUM_NEWPOSTS_START))
+{
+	$FORUM_NEWPOSTS_START = "<div style='text-align:center'>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td style='width:3%' class='fcaption'>&nbsp;</td>\n<td style='width:60%' class='fcaption'>{NEWTHREADTITLE}</td>\n<td style='width:27%; text-align:center' class='fcaption'>{POSTEDTITLE}</td>\n</tr>";
+}
+
+if (!isset($FORUM_NEWPOSTS_MAIN))
+{
+	$FORUM_NEWPOSTS_MAIN = "<tr>\n<td style='width:3%' class='forumheader3'>{NEWIMAGE}</td>\n<td style='width:60%' class='forumheader3'>{NEWSPOSTNAME}</td>\n<td style='width:27%; text-align:center' class='forumheader3'>{STARTERTITLE}</td>\n</tr>";
+}
+
+if (!isset($FORUM_NEWPOSTS_END))
+{
+	$FORUM_NEWPOSTS_END = "</table></div></div>";
+}
+
+if (!isset($FORUM_TRACK_START))
+{
+	$FORUM_TRACK_START = "<div style='text-align:center'>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td colspan='3' style='width:60%' class='fcaption'>{TRACKTITLE}</td>\n</tr>\n";
+
+	if (!isset($FORUM_TRACK_MAIN))
+	{
+		$FORUM_TRACK_MAIN = "<tr>
+			<td style='text-align:center; vertical-align:middle; width:6%'  class='forumheader3'>{NEWIMAGE}</td>
+			<td style='vertical-align:middle; text-align:left; width:70%'  class='forumheader3'><span class='mediumtext'>{TRACKPOSTNAME}</span></td>
+			<td style='vertical-align:middle; text-align:center; width:24%'  class='forumheader3'><span class='mediumtext'>{UNTRACK}</td>
+			</tr>";
+	}
+}
+
+if (!isset($FORUM_TRACK_END))
+{
+	$FORUM_TRACK_END = "</table>\n</div>\n</div>";
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/templates/forum_viewforum_template.php 75/e107_plugins/forum/templates/forum_viewforum_template.php
--- 6171/e107_plugins/forum/templates/forum_viewforum_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/templates/forum_viewforum_template.php	2006-05-16 12:29:51.000000000 -0500
@@ -0,0 +1,270 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/templates/forum_viewforum_template.php,v $
+|     $Revision: 1.15 $
+|     $Date: 2006/05/16 17:29:51 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+if (!$FORUM_VIEW_START)
+{
+$FORUM_VIEW_START = "
+
+	<div style='text-align:center'>
+	<div class='spacer'>
+	<table style='width:95%' class='fborder' >
+	<tr>
+	<td class='fcaption'>{BREADCRUMB}</td>
+	</tr>
+	{SUBFORUMS}
+	<tr>
+	<td style='width:80%' class='forumheader'>
+	<span class='mediumtext'>{FORUMTITLE}</span></td>
+	</tr>
+	</table>
+	</div>
+	
+	<table style='width: 95%'>
+	<tr>
+	<td style='width:80%'>
+	<span class='mediumtext'>{THREADPAGES}</span>
+	</td>
+	<td style='width:20%; text-align:right'>
+	{NEWTHREADBUTTON}
+	</td>
+	</tr>
+	</table>
+
+	<div class='spacer'>
+	<table style='width:95%' class='fborder'>
+	<tr>
+	<td style='width:3%' class='fcaption'>&nbsp;</td>
+	<td style='width:47%' class='fcaption'>{THREADTITLE}</td>
+	<td style='width:20%; text-align:center' class='fcaption'>{STARTERTITLE}</td>
+	<td style='width:5%; text-align:center' class='fcaption'>{REPLYTITLE}</td>
+	<td style='width:5%; text-align:center' class='fcaption'>{VIEWTITLE}</td>
+	<td style='width:20%; text-align:center' class='fcaption'>{LASTPOSTITLE}</td>
+	</tr>";
+}
+
+if(!$FORUM_VIEW_START_CONTAINER)
+{
+	$FORUM_VIEW_START_CONTAINER = "
+	<div style='text-align:center'>
+	<div class='spacer'>
+	<table style='width:95%' class='fborder' >
+	<tr>
+	<td class='fcaption'>{BREADCRUMB}</td>
+	</tr>
+	{SUBFORUMS}
+	</table>
+	</div>
+	";
+}	
+
+
+if (!$FORUM_VIEW_FORUM) {
+	$FORUM_VIEW_FORUM = "
+		<tr>
+		<td style='vertical-align:middle; text-align:center; width:3%' class='forumheader3'>{ICON}</td>
+		<td style='vertical-align:middle; text-align:left; width:47%' class='forumheader3'>
+
+		<table style='width:100%'>
+		<tr>
+		<td style='width:90%'><span class='mediumtext'><b>{THREADTYPE}{THREADNAME}</b></span> <span class='smalltext'>{PAGES}</span></td>
+		<td style='width:10%; white-space:nowrap;'>{ADMIN_ICONS}</td>
+		</tr>
+		</table>
+
+		</td>
+
+		<td style='vertical-align:center; text-align:center; width:20%' class='forumheader3'>{POSTER}<br />{THREADDATE}</td>
+		<td style='vertical-align:center; text-align:center; width:5%' class='forumheader3'>{REPLIES}</td>
+		<td style='vertical-align:center; text-align:center; width:5%' class='forumheader3'>{VIEWS}</td>
+		<td style='vertical-align:center; text-align:center; width:20%' class='forumheader3'>{LASTPOST}</td>
+		</tr>";
+}
+
+if (!$FORUM_VIEW_FORUM_STICKY) {
+	$FORUM_VIEW_FORUM_STICKY = "
+		<tr>
+		<td style='vertical-align:middle; text-align:center; width:3%' class='forumheader3'>{ICON}</td>
+		<td style='vertical-align:middle; text-align:left; width:47%' class='forumheader3'>
+
+		<table style='width:100%'>
+		<tr>
+		<td style='width:90%'><span class='mediumtext'><b>{THREADTYPE}{THREADNAME}</b></span> <span class='smalltext'>{PAGES}</span></td>
+		<td style='width:10%; white-space:nowrap;'>{ADMIN_ICONS}</td>
+		</tr>
+		</table>
+
+		</td>
+
+		<td style='vertical-align:center; text-align:center; width:20%' class='forumheader3'>{POSTER}<br />{THREADDATE}</td>
+		<td style='vertical-align:center; text-align:center; width:5%' class='forumheader3'>{REPLIES}</td>
+		<td style='vertical-align:center; text-align:center; width:5%' class='forumheader3'>{VIEWS}</td>
+		<td style='vertical-align:center; text-align:center; width:20%' class='forumheader3'>{LASTPOST}</td>
+		</tr>";
+}
+
+if (!$FORUM_VIEW_FORUM_ANNOUNCE) {
+	$FORUM_VIEW_FORUM_ANNOUNCE = "
+		<tr>
+		<td style='vertical-align:middle; text-align:center; width:3%' class='forumheader3'>{ICON}</td>
+		<td style='vertical-align:middle; text-align:left; width:47%' class='forumheader3'>
+
+		<table style='width:100%'>
+		<tr>
+		<td style='width:90%'><span class='mediumtext'><b>{THREADTYPE}{THREADNAME}</b></span> <span class='smalltext'>{PAGES}</span></td>
+		<td style='width:10%; white-space:nowrap;'>{ADMIN_ICONS}</td>
+		</tr>
+		</table>
+
+		</td>
+
+		<td style='vertical-align:center; text-align:center; width:20%' class='forumheader3'>{POSTER}<br />{THREADDATE}</td>
+		<td style='vertical-align:center; text-align:center; width:5%' class='forumheader3'>{REPLIES}</td>
+		<td style='vertical-align:center; text-align:center; width:5%' class='forumheader3'>{VIEWS}</td>
+		<td style='vertical-align:center; text-align:center; width:20%' class='forumheader3'>{LASTPOST}</td>
+		</tr>";
+}
+
+if (!$FORUM_VIEW_END) {
+	$FORUM_VIEW_END = "
+		</table>
+		</div>
+		
+		<table style='width:95%'>
+		<tr>
+		<td style='width:80%'><span class='mediumtext'>{THREADPAGES}</span>
+		</td>
+		<td style='width:20%; text-align:right'>
+		{NEWTHREADBUTTON}
+		</td>
+		</tr>
+		<tr>
+		<td colspan ='2'>
+		{FORUMJUMP}
+		</td>
+		</tr>
+		</table>
+
+		<div class='spacer'>
+		<table class='fborder' style='width:95%'>
+		<tr>
+		<td style='vertical-align:center; width:50%' class='forumheader3'><span class='smalltext'>{MODERATORS}</span></td>
+		<td style='vertical-align:center; width:50%' class='forumheader3'><span class='smalltext'>{BROWSERS}</span></td>
+		</tr>
+		</table>
+		</div>
+		
+		<div class='spacer'>
+		<table class='fborder' style='width:95%'>
+		<tr>
+		<td style='vertical-align:center; width:50%' class='forumheader3'>{ICONKEY}</td>
+		<td style='vertical-align:center; text-align:center; width:50%' class='forumheader3'><span class='smallblacktext'>{PERMS}</span><br /><br />{SEARCH}
+		</td>
+		</tr>
+		</table>
+		</div>
+		</div>
+		<div class='spacer'>
+		<div style='text-align:center;'>
+		<a href='".e_PLUGIN."rss_menu/rss.php?11.1.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss1.png' alt='".LAN_431."' style='vertical-align: middle; border: 0;' /></a> 
+		<a href='".e_PLUGIN."rss_menu/rss.php?11.2.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss2.png' alt='".LAN_432."' style='vertical-align: middle; border: 0;' /></a> 
+		<a href='".e_PLUGIN."rss_menu/rss.php?11.3.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss3.png' alt='".LAN_433."' style='vertical-align: middle; border: 0;' /></a>
+		</div>
+		<div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div></div>
+";
+}
+
+
+if(!$FORUM_VIEW_END_CONTAINER)
+{
+	$FORUM_VIEW_END_CONTAINER = "
+		<table style='width:95%'>
+		<tr>
+		<td colspan ='2'>
+		{FORUMJUMP}
+		</td>
+		</tr>
+		</table>
+		<div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div></div>
+";
+}	
+
+
+if (!$FORUM_VIEW_SUB_START)
+ {
+	$FORUM_VIEW_SUB_START = "
+	<tr>
+	<td colspan='2'>
+		<br />
+		<div>
+		<table style='width:100%'>
+		<tr>
+			<td class='fcaption' style='width: 5%'>&nbsp;</td>
+			<td class='fcaption' style='width: 45%'>".FORLAN_20."</td>
+			<td class='fcaption' style='width: 10%'>".FORLAN_21."</td>
+			<td class='fcaption' style='width: 10%'>".LAN_55."</td>
+			<td class='fcaption' style='width: 30%'>".FORLAN_22."</td>
+		</tr>
+	";
+}
+
+if (!$FORUM_VIEW_SUB) {
+	$FORUM_VIEW_SUB = "
+	<tr>
+		<td class='forumheader3' style='text-align:center'>{NEWFLAG}</td>
+		<td class='forumheader3' style='text-align:left'><b>{SUB_FORUMTITLE}</b><br />{SUB_DESCRIPTION}</td>
+		<td class='forumheader3' style='text-align:center'>{SUB_THREADS}</td>
+		<td class='forumheader3' style='text-align:center'>{SUB_REPLIES}</td>
+		<td class='forumheader3' style='text-align:center'>{SUB_LASTPOST}</td>
+	</tr>
+	";
+}
+
+if (!$FORUM_VIEW_SUB_END) {
+	$FORUM_VIEW_SUB_END = "
+	</table><br /><br />
+	</div>
+	</td>
+	</tr>
+	";
+}
+
+if (!$FORUM_IMPORTANT_ROW) {
+	$FORUM_IMPORTANT_ROW = "<tr><td class='forumheader'>&nbsp;</td><td colspan='5'  class='forumheader'><span class='mediumtext'><b>".LAN_411."</b></span></td></tr>";
+}
+
+if (!$FORUM_NORMAL_ROW) {
+	$FORUM_NORMAL_ROW = "<tr><td class='forumheader'>&nbsp;</td><td colspan='5'  class='forumheader'><span class='mediumtext'><b>".LAN_412."</b></span></td></tr>";
+}
+
+$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' {SITENAME_HREF}>{SITENAME}</a>";
+$FORUM_CRUMB['sitename']['sep'] = " :: ";
+
+$FORUM_CRUMB['forums']['value'] = "<a class='forumlink' {FORUMS_HREF}>{FORUMS_TITLE}</a>";
+$FORUM_CRUMB['forums']['sep'] = " :: ";
+
+$FORUM_CRUMB['parent']['value'] = "{PARENT_TITLE}";
+$FORUM_CRUMB['parent']['sep'] = " :: ";
+
+$FORUM_CRUMB['subparent']['value'] = "<a class='forumlink' {SUBPARENT_HREF}>{SUBPARENT_TITLE}</a>";
+$FORUM_CRUMB['subparent']['sep'] = " :: ";
+
+$FORUM_CRUMB['forum']['value'] = "{FORUM_TITLE}";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/forum/templates/forum_viewtopic_template.php 75/e107_plugins/forum/templates/forum_viewtopic_template.php
--- 6171/e107_plugins/forum/templates/forum_viewtopic_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/forum/templates/forum_viewtopic_template.php	2006-05-16 12:29:51.000000000 -0500
@@ -0,0 +1,253 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/forum/templates/forum_viewtopic_template.php,v $
+|     $Revision: 1.21 $
+|     $Date: 2006/05/16 17:29:51 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+$sc_style['LASTEDIT']['pre'] = "<br /><br /><span class='smallblacktext'>[ ".LAN_29." ";
+$sc_style['LASTEDIT']['post'] = " ]</span>";
+	
+$sc_style['LEVEL']['pre'] = "<div class='spacer'>";
+$sc_style['LEVEL']['post'] = "</div>";
+
+$sc_style['ANON_IP']['pre'] = "<br /><span class='smalltext'>";
+$sc_style['ANON_IP']['post'] = "</span>";
+
+$FORUMSTART = "<a id='top'></a><div style='text-align:center'>
+	<div class='spacer'>
+	<table style='width:95%' class='fborder'>
+	<tr>
+	<td class='fcaption'>
+	{BACKLINK}
+	</td>
+	<td class='fcaption' style='text-align: right'>
+	<span class='smalltext'>&nbsp;
+	{TRACK}
+	</span>
+	</td>
+	<td class='fcaption' style='text-align: right'>
+	<span class='smalltext'>
+	{NEXTPREV}
+	</span>
+	</td>
+	</tr>
+	<tr>
+	<td class='forumheader' colspan='3'>
+	{THREADNAME}
+	</td>
+	</tr>
+	</table>
+	</div>
+	
+	<table style='width:95%'>
+	<tr>
+	<td style='width:60%; text-align: left'>
+	{GOTOPAGES}
+	</td>
+	<td style='width:40%; text-align:right; white-space: nowrap'>
+	{BUTTONS}
+	</td>
+	</tr>
+	<tr>
+	<td style='width:60%; text-align: left'>
+	<div class='spacer'>
+	{MODERATORS}
+	</div>
+	</td>
+	<td style='width:40%; text-align:right'>
+	{THREADSTATUS}
+	</td>
+	</tr>
+	</table>
+	
+	<div class='spacer'>
+	<table style='width:95%' class='fborder'>
+	<tr>
+	<td style='width:20%; text-align:center' class='fcaption'>
+	".LAN_402."
+	</td>
+	<td style='width:80%; text-align:center' class='fcaption'>
+	".LAN_403."
+	</td>
+	</tr>";
+
+$FORUMTHREADSTYLE = "<tr>
+	<td class='forumheader' style='vertical-align:middle'>
+	{NEWFLAG}
+	{POSTER}
+	{ANON_IP}
+	</td>
+	<td class='forumheader' style='vertical-align:middle'>
+	<table cellspacing='0' cellpadding='0' style='width:100%'>
+	<tr>
+	<td class='smallblacktext'>
+	{THREADDATESTAMP}
+	</td>
+	<td style='text-align:right'>
+	{REPORTIMG}{EDITIMG}{QUOTEIMG}
+	</td>
+	</tr>
+	</table>
+	</td>
+	</tr>
+	<tr>
+	<td class='forumheader3' style='vertical-align:top'>
+	{CUSTOMTITLE}
+	{AVATAR}
+	<span class='smalltext'>
+	{LEVEL=special}
+	{LEVEL=pic}
+	{LEVEL=userid}
+	{JOINED}
+	{EXTENDED=location.text}: {EXTENDED=location.value}<br />
+	{POSTS}
+	</span>
+	</td>
+	<td class='forumheader3' style='vertical-align:top'>{POLL}
+	{POST}
+	{LASTEDIT}
+	{SIGNATURE}
+	</td>
+	</tr>
+	<tr>
+	 <td class='finfobar'>
+	<span class='smallblacktext'>
+	{TOP}
+	</span>
+	</td>
+	<td class='finfobar' style='vertical-align:top'>
+	<table cellspacing='0' cellpadding='0' style='width:100%'>
+	<tr>
+	<td>
+	{PROFILEIMG}
+	 {EMAILIMG}
+	 {WEBSITEIMG}
+	 {PRIVMESSAGE}
+	</td>
+	<td style='text-align:right'>
+	{MODOPTIONS}
+	</td>
+	</tr>
+	</table>
+	</td>
+	</tr>
+	<tr>
+	<td colspan='2'>
+	</td>
+	</tr>";
+
+$FORUMEND = "<tr><td colspan='2' class='forumheader3' style='text-align:center'>{QUICKREPLY}</td></tr></table></div>
+
+	<table style='width:95%'>
+	<tr>
+	<td style='width:80%'><span class='mediumtext'>{GOTOPAGES}</span>
+	</td>
+	<td style='width:20%; text-align: right; white-space: nowrap'>
+	{BUTTONS}
+	</td>
+	</tr>
+	<tr>
+	<td colspan ='2'>
+	{FORUMJUMP}
+	</td>
+	</tr>
+	</table>
+	</div>
+	
+	<div style='text-align:center' class='spacer'>
+	<a href='".e_PLUGIN."rss_menu/rss.php?8.1.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss1.png' alt='".LAN_431."' style='vertical-align: middle; border: 0;' /></a> <a href='".e_PLUGIN."rss_menu/rss.php?8.2.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss2.png' alt='".LAN_432."' style='vertical-align: middle; border: 0;' /></a> <a href='".e_PLUGIN."rss_menu/rss.php?8.3.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss3.png' alt='".LAN_433."' style='vertical-align: middle; border: 0;' /></a></div><div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div>";
+
+$FORUMREPLYSTYLE = "<tr>
+	<td class='forumheader' style='vertical-align:middle'>
+	{NEWFLAG}
+	{POSTER}
+	{ANON_IP}
+	</td>
+	<td class='forumheader' style='vertical-align:middle'>
+	<table cellspacing='0' cellpadding='0' style='width:100%'>
+	<tr>
+	<td class='smallblacktext'>
+	{THREADDATESTAMP}
+	</td>
+	<td style='text-align:right'>
+	{REPORTIMG}{EDITIMG}{QUOTEIMG}
+	</td>
+	</tr>
+	</table>
+	</td>
+	</tr>
+	<tr>
+	<td class='forumheader3' style='vertical-align:top'>
+	{CUSTOMTITLE}
+	{AVATAR}
+	<span class='smalltext'>
+	{LEVEL=special}
+	{LEVEL=pic}
+	{LEVEL=userid}
+	{JOINED}
+	{EXTENDED=location.text}: {EXTENDED=location.value}<br />
+	{POSTS}
+	</span>
+	</td>
+	<td class='forumheader3' style='vertical-align:top'>{POST}
+	{LASTEDIT}
+	{SIGNATURE}
+	</td>
+	</tr>
+	<tr>
+	 <td class='finfobar'>
+	<span class='smallblacktext'>
+	{TOP}
+	</span>
+	</td>
+	<td class='finfobar' style='vertical-align:top'>
+	<table cellspacing='0' cellpadding='0' style='width:100%'>
+	<tr>
+	<td>
+	{PROFILEIMG}
+	 {EMAILIMG}
+	 {WEBSITEIMG}
+	 {PRIVMESSAGE}
+	</td>
+	<td style='text-align:right'>
+	{MODOPTIONS}
+	</td>
+	</tr>
+	</table>
+	</td>
+	</tr>
+	<tr>
+	<td colspan='2'>
+	</td>
+	</tr>";
+
+$FORUM_CRUMB['sitename']['value'] = "<a class='forumlink' {SITENAME_HREF}>{SITENAME}</a>";
+$FORUM_CRUMB['sitename']['sep'] = " :: ";
+
+$FORUM_CRUMB['forums']['value'] = "<a class='forumlink' {FORUMS_HREF}>{FORUMS_TITLE}</a>";
+$FORUM_CRUMB['forums']['sep'] = " :: ";
+
+$FORUM_CRUMB['parent']['value'] = "{PARENT_TITLE}";
+$FORUM_CRUMB['parent']['sep'] = " :: ";
+
+$FORUM_CRUMB['subparent']['value'] = "<a class='forumlink' {SUBPARENT_HREF}>{SUBPARENT_TITLE}</a>";
+$FORUM_CRUMB['subparent']['sep'] = " :: ";
+
+$FORUM_CRUMB['forum']['value'] = "<a class='forumlink' {FORUM_HREF}>{FORUM_TITLE}</a>";
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/gsitemap/admin_config.php 75/e107_plugins/gsitemap/admin_config.php
--- 6171/e107_plugins/gsitemap/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/gsitemap/admin_config.php	2006-04-15 12:43:12.000000000 -0500
@@ -0,0 +1,512 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/gsitemap/admin_config.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/04/15 17:43:12 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if(!getperms("P")){ header("location:".e_BASE."index.php"); }
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."userclass_class.php");
+
+$ec_dir = e_PLUGIN."gsitemap/";
+$lan_file = $ec_dir."languages/gsitemap_".e_LANGUAGE.".php";
+e107_include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."gsitemap/languages/gsitemap_English.php");
+
+$gsm = new gsitemap;
+
+
+
+class gsitemap
+{
+
+	var $message;
+
+/*+----------------------#######################################################################################---------------------+*/
+
+	function gsitemap()
+	{
+		/* constructor */
+
+		if(isset($_POST['edit']))
+		{
+			$this -> editSme();
+		}
+
+		if(isset($_POST['delete']))
+		{
+			$this -> deleteSme();
+		}
+
+		if(isset($_POST['add_link']))
+		{
+			$this -> addLink();
+		}
+
+		if(isset($_POST['import_links']))
+		{
+			$this -> importLink();
+		}
+
+
+		if($this -> message)
+		{
+			echo "<br /><div style='text-align:center'><b>".$this -> message."</b></div><br />";
+		}
+
+
+		if(e_QUERY == "new")
+		{
+			$this -> doForm();
+		}
+		else if(e_QUERY == "import")
+		{
+			$this -> importSme();
+		}
+		else if(e_QUERY == "instructions")
+		{
+			$this -> instructions();
+		}
+		else if(!$_POST['edit'])
+		{
+			$this -> showList();
+		}
+	}
+
+/*+----------------------#######################################################################################---------------------+*/
+
+	function showList()
+	{
+		global $sql,$ns,$tp;
+		$gen = new convert;
+		$count = $sql -> db_Select("gsitemap", "*", "gsitemap_id !=0 ORDER BY gsitemap_id ASC");
+
+		$text = "<div style='text-align:center'>
+
+		";
+
+		if (!$count)
+		{
+			$text .= "
+			<form action='".e_SELF."?import' id='import' method='post'>
+			".GSLAN_39."
+			<input class='button' type='submit' name='import' value='".LAN_YES."' />
+			</form>";
+			$ns -> tablerender("<div style='text-align:center'>".GSLAN_40."</div>", $text);
+			require_once(e_ADMIN."footer.php");
+			exit;
+		}
+		else
+		{
+
+			$text .= "
+
+			<form action='".e_SELF."' id='display' method='post'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+
+			<tr>
+			<td style='width:5%; text-align: center;' class='fcaption'>Id</td>
+			<td style='width:10%' class='fcaption'>".GSLAN_25."</td>
+			<td style='width:40%' class='fcaption'>".GSLAN_26."</td>
+			<td style='width:20%; text-align: center;' class='fcaption'>".GSLAN_27."</td>
+			<td style='width:10%; text-align: center;' class='fcaption'>".GSLAN_28."</td>
+			<td style='width:10%; text-align: center;' class='fcaption'>".GSLAN_9."</td>
+			<td style='width:5%; text-align: center;' class='fcaption'>".LAN_OPTIONS."</td>
+			</tr>
+			";
+
+			$glArray = $sql -> db_getList();
+			foreach($glArray as $row2)
+			{
+
+				$datestamp = $gen->convert_date($row2['GSLAN_astmod'], "short");
+
+				$text .= "<tr>
+				<td class='forumheader3' style='; text-align: center;'>".$row2['gsitemap_id'] ."</td>
+				<td class='forumheader3'>".$row2['gsitemap_name']."</td>
+				<td class='forumheader3'>".str_replace(SITEURL,"",$row2['gsitemap_url'])."</td>
+				<td class='forumheader3' style='; text-align: center;'>".$datestamp."</td>
+				<td class='forumheader3' style='; text-align: center;'>".$row2['gsitemap_freq'] ."</td>
+				<td class='forumheader3' style='; text-align: center;'>".$row2['gsitemap_priority'] ."</td>
+
+				<td style='width:50px;white-space:nowrap' class='forumheader3'>
+				<div>
+				<input type='image' name='edit[{$row2['gsitemap_id']}]' value='edit' src='".e_IMAGE."admin_images/edit_16.png' alt='".LAN_EDIT."' title='".LAN_EDIT."' style='border:0px' />
+				<input type='image' name='delete[{$row2['gsitemap_id']}]' value='del' onclick=\"return jsconfirm('".$tp->toJS(LAN_CONFIRMDEL." [".$row2['gsitemap_name']."]")."') \" src='".e_IMAGE."admin_images/delete_16.png' alt='".LAN_DELETE."' title='".LAN_DELETE."' style='border:0px' />
+				</div>
+				</td>
+				</tr>
+				";
+			}
+		}
+
+		$text .= "</table>\n</form><br /><br /><br /></div>";
+		$ns -> tablerender("<div style='text-align:center'>".GSLAN_24."</div>", $text);
+	}
+
+/*+----------------------#######################################################################################---------------------+*/
+
+	function editSme()
+	{
+		global $sql, $tp;
+		$e_idt = array_keys($_POST['edit']);
+
+		if($sql -> db_Select("gsitemap", "*", "gsitemap_id='".$e_idt[0]."' "))
+		{
+			$foo = $sql -> db_Fetch();
+			$foo['gsitemap_name'] = $tp -> toFORM($foo['gsitemap_name']);
+			$foo['gsitemap_url'] = $tp -> toFORM($foo['gsitemap_url']);
+
+			$this -> doForm($foo);
+		}
+	}
+
+/*+----------------------#######################################################################################---------------------+*/
+
+	function doForm($editArray=FALSE)
+	{
+		global $sql,$ns;
+		$count = $sql -> db_Select("gsitemap", "*", "gsitemap_id !=0 ORDER BY gsitemap_id ASC");
+		$text = "
+		<form action='".e_SELF."' id='form' method='post'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+
+		<tr>
+		<td style='width:25%' class='forumheader3'>".GSLAN_25."
+		<span class='smalltext'>&nbsp;</span></td>
+		<td class='forumheader3'>
+		<input class='tbox' type='text' style='width:90%' name='gsitemap_name' size='40' value='".$editArray['gsitemap_name']."' maxlength='100' />
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:25%' class='forumheader3'>".GSLAN_26."
+		<span class='smalltext'>&nbsp;</span></td>
+		<td class='forumheader3'>
+		<input class='tbox' type='text' style='width:90%' name='gsitemap_url' size='40' value='".$editArray['gsitemap_url']."' maxlength='100' />
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:25%' class='forumheader3'>".GSLAN_27."
+		<span class='smalltext'>&nbsp;</span></td>
+		<td class='forumheader3'>
+		<input class='tbox' type='text'  name='GSLAN_astmod' size='40' value='".$editArray['GSLAN_astmod']."' maxlength='100' />
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:25%' class='forumheader3'>".GSLAN_10."
+		<span class='smalltext'>&nbsp;</span></td>
+		<td class='forumheader3'>
+		<select class='tbox' name='gsitemap_freq' >\n";
+
+		$freq_list = array(GSLAN_11, GSLAN_12, GSLAN_13,GSLAN_14,GSLAN_15,GSLAN_16,GSLAN_17);
+
+		foreach($freq_list as $fq){
+			$sel = ($editArray['gsitemap_freq'] == $fq)? "selected='selected'" : "";
+			$text .= "<option value='$fq' $sel>$fq</option>\n";
+		}
+
+		$text.="</select>
+		</td>
+		</tr>
+
+
+		<tr>
+		<td class='forumheader3'>".GSLAN_9."<br />
+		<span class='smalltext'>&nbsp;</span></td>
+		<td class='forumheader3'>
+		<select class='tbox' name='gsitemap_priority' >\n";
+
+		for ($i=0.1; $i<1.0; $i=$i+0.1) {
+			$sel = ($editArray['gsitemap_priority'] == number_format($i,1))? "selected='selected'" : "";
+			$text .= "<option value='".number_format($i,1)."' $sel>".number_format($i,1)."</option>\n";
+		};
+
+		$text.="</select></td>
+		</tr>
+
+
+		<tr>
+		<td class='forumheader3'>".GSLAN_30."</td>
+		<td class='forumheader3'><select name='gsitemap_order' class='tbox'>";
+
+		for($i=0;$i<$count;$i++){
+			$text .= $meet_order == $i ? "<option value='".$i."' selected='selected'>".$i."</option>" : "<option value='".$i."'>".$i."</option>";
+		}
+		$text .="
+		</select>
+		</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3'>".GSLAN_31."</td>
+		<td class='forumheader3'>";
+		$text .= r_userclass("gsitemap_active", $editArray['gsitemap_active'], "nobody,public,guest,member,admin,classes,language");
+		$text .="
+		</td>
+		</tr>
+
+
+
+		<tr style='vertical-align:top'>
+		<td colspan='2' style='text-align:center' class='forumheader'>";
+		if(is_array($editArray))
+		{
+			$text .= "<input class='button' type='submit' name='add_link' value='".LAN_UPDATE."' />
+			<input type='hidden' name='gsitemap_id' value='".$editArray['gsitemap_id']."' />";
+		}
+		else
+		{
+			$text .= "<input class='button' type='submit' name='add_link' value='".LAN_CREATE."' />";
+		}
+
+		$text .= "</td>
+		</tr>
+		</table>
+		</form>
+		";
+
+		$ns -> tablerender("<div style='text-align:center'>".GSLAN_29."</div>", $text);
+
+
+	}
+
+/*+----------------------#######################################################################################---------------------+*/
+
+	function addLink()
+	{
+		global $sql, $tp;
+		$gsitemap_name = $tp -> toDB($_POST['gsitemap_name']);
+		$gsitemap_url = $tp -> toDB($_POST['gsitemap_url']);
+		if(!strstr($gsitemap_url, "http"))
+		{
+			$gsitemap_url = SITEURL.$gsitemap_url;
+		}
+		if(isset($_POST['gsitemap_id']))
+		{
+			$this -> message = $sql -> db_Update("gsitemap", "gsitemap_name='$gsitemap_name', gsitemap_url='$gsitemap_url', gsitemap_priority='".$_POST['gsitemap_priority']."', GSLAN_astmod='".$_POST['GSLAN_astmod']."', gsitemap_freq= '".$_POST['gsitemap_freq']."', gsitemap_order='".$_POST['gsitemap_order']."', gsitemap_active='".$_POST['gsitemap_active']."' WHERE gsitemap_id='".$_POST['gsitemap_id']."' ") ? LAN_UPDATED : LAN_UPDATED_FAILED;
+		}
+		else
+		{
+			$this -> message = ($sql -> db_Insert("gsitemap", "0, '".$_POST['gsitemap_name']."', '".$_POST['gsitemap_url']."', '".$_POST['GSLAN_astmod']."', '".$_POST['gsitemap_freq']."', '".$_POST['gsitemap_priority']."', '".$_POST['gsitemap_cat']."', '".$_POST['gsitemap_order']."', '".$_POST['gsitemap_img']."', '".$_POST['gsitemap_active']."' ")) ? LAN_CREATED : LAN_CREATED_FAILED;
+		}
+	}
+
+/*+----------------------#######################################################################################---------------------+*/
+
+	function deleteSme()
+	{
+		global $sql;
+		$d_idt = array_keys($_POST['delete']);
+		$this -> message = ($sql -> db_Delete("gsitemap", "gsitemap_id='".$d_idt[0]."'")) ? LAN_DELETED : LAN_DELETED_FAILED;
+	}
+
+/*+----------------------#######################################################################################---------------------+*/
+
+	function importSme()
+	{
+		global $sql, $sql2, $PLUGINS_DIRECTORY, $ns;
+		$importArray = array();
+
+		/* sitelinks ... */
+		$sql -> db_Select("links", "*", "ORDER BY link_order ASC", "no-where");
+		$nfArray = $sql -> db_getList();
+		foreach($nfArray as $row)
+		{
+			if(!$sql -> db_Select("gsitemap", "*", "gsitemap_name='".$row['link_name']."' "))
+			{
+				$importArray[] = array('name' => $row['link_name'], 'url' => SITEURL.$row['link_url'], 'type' => GSLAN_1);
+			}
+		}
+
+		/* custom pages ... */
+		$sql -> db_Select("page", "*", "ORDER BY page_datestamp ASC", "no-where");
+		$nfArray = $sql -> db_getList();
+		foreach($nfArray as $row)
+		{
+			if(!$sql -> db_Select("gsitemap", "*", "gsitemap_name='".$row['page_title']."' "))
+			{
+				$importArray[] = array('name' => $row['page_title'], 'url' => SITEURL."page.php?".$row['page_id'],'type' => "Custom Page");
+			}
+		}
+
+
+
+		/* forums ... */
+		$sql -> db_Select("forum", "*", "forum_parent!='0' ORDER BY forum_order ASC");
+		$nfArray = $sql -> db_getList();
+		foreach($nfArray as $row)
+		{
+			if(!$sql -> db_Select("gsitemap", "*", "gsitemap_name='".$row['forum_name']."' "))
+			{
+				$importArray[] = array('name' => $row['forum_name'], 'url' => SITEURL.$PLUGINS_DIRECTORY."forum/forum_viewforum.php?".$row['forum_id'], 'type' => "Forum");
+			}
+		}
+
+
+		/* content pages ... */
+		$sql -> db_Select("pcontent", "content_id, content_heading", "LEFT(content_parent,1) = '0' ORDER BY content_heading");
+		$nfArray = $sql -> db_getList();
+		foreach($nfArray as $row)
+		{
+			$sql2 -> db_Select("pcontent", "content_id, content_heading", "content_parent = '".$row['content_id']."' AND content_refer != 'sa' ORDER BY content_heading");
+			$nfArray2 = $sql2 -> db_getList();
+			foreach($nfArray2 as $row2)
+			{
+				if(!$sql -> db_Select("gsitemap", "*", "gsitemap_name='".$row2['content_heading']."' "))
+				{
+					$importArray[] = array('name' => $row2['content_heading'], 'url' => SITEURL.$PLUGINS_DIRECTORY."content/content.php?content.".$row2['content_id'], 'type' => $row['content_heading']);
+				}
+			}
+
+		}
+
+
+		/* end */
+
+
+
+		$text = "
+		<form action='".e_SELF."' id='form' method='post'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+
+		<tr>
+		<td colspan='4' style='text-align:center' class='forumheader'><b>".GSLAN_6."</b></td>
+		</tr>
+
+		<tr>
+		<td style='width:5%; text-align: center;' class='forumheader'>".GSLAN_2."</td>
+		<td style='width:15%' class='forumheader'>".GSLAN_3."</td>
+		<td style='width:40%' class='forumheader'>".GSLAN_4."</td>
+		<td style='width:40%' class='forumheader'>".GSLAN_5."</td>
+		</tr>
+		";
+
+		foreach($importArray as $ia)
+		{
+			$text .= "
+			<tr>
+			<td style='width:5%; text-align: center;' class='forumheader3'><input type='checkbox' name='importid[]' value='".$ia['name']."^".$ia['url']."^".$ia['type']."' /></td>
+			<td style='width:15%' class='forumheader3'>".$ia['type']."</td>
+			<td style='width:40%' class='forumheader3'>".$ia['name']."</td>
+			<td style='width:40%' class='forumheader3'><span class='smalltext'>".str_replace(SITEURL,"",$ia['url'])."</span></td>
+			</tr>
+			";
+		}
+
+
+
+
+
+
+		$text .= "
+		<tr>
+		<td colspan='4' style='text-align:center' class='forumheader'>
+		<div> ".GSLAN_8." &nbsp; ".GSLAN_9." :&nbsp;<select class='tbox' name='import_priority' >\n";
+
+		for ($i=0.1; $i<1.0; $i=$i+0.1) {
+			$sel = ($editArray['gsitemap_priority'] == number_format($i,1))? "selected='selected'" : "";
+			$text .= "<option value='".number_format($i,1)."' $sel>".number_format($i,1)."</option>\n";
+		};
+
+		$text.="</select>&nbsp;&nbsp;&nbsp;".GSLAN_10."
+
+
+		<select class='tbox' name='import_freq' >\n";
+
+		$freq_list = array(GSLAN_11, GSLAN_12, GSLAN_13,GSLAN_14,GSLAN_15,GSLAN_16,GSLAN_17);
+
+		foreach($freq_list as $fq){
+			$sel = ($editArray['gsitemap_freq'] == $fq)? "selected='selected'" : "";
+			$text .= "<option value='$fq' $sel>$fq</option>\n";
+		}
+
+		$text.="</select> <br /><br />
+
+
+		</div>
+		<input class='button' type='submit' name='import_links' value='".GSLAN_18."' />
+		</td>
+		</tr>
+		</table>
+		</form>
+		";
+
+		$ns -> tablerender("<div style='text-align:center'>".GSLAN_7."</div>", $text);
+	}
+
+/*+----------------------#######################################################################################---------------------+*/
+
+	function importLink()
+	{
+		global $sql, $tp;
+		foreach($_POST['importid'] as $import)
+		{
+			list($name, $url, $type) = explode("^", $import);
+			$name = $tp -> toDB($name);
+			$url = $tp -> toDB($url);
+			$sql -> db_Insert("gsitemap", "0, '$name', '$url', '".time()."', '".$_POST['import_freq']."', '".$_POST['import_priority']."', '$type', '0', '', '0' ");
+		}
+		$this -> message = count($_POST['importid'])." link(s) imported.";
+	}
+
+/*+----------------------#######################################################################################---------------------+*/
+
+	function instructions()
+	{
+		global $ns, $PLUGINS_DIRECTORY;
+
+		$text = "<b>".GSLAN_33."</b><br /><br />
+		<ul>
+		<li>".GSLAN_34."</li>
+		<li>".GSLAN_35."</li>
+		<li>".GSLAN_36."</li>
+		<li>".GSLAN_37."</li>
+		<li>".GSLAN_38."</li>
+		<ul>
+		";
+
+		$ns -> tablerender("<div style='text-align:center'>".GSLAN_32."</div>", $text);
+
+	}
+
+/*+----------------------#######################################################################################---------------------+*/
+
+}
+
+
+require_once(e_ADMIN."footer.php");
+
+
+function admin_config_adminmenu() {
+	$action = (e_QUERY) ? e_QUERY : "list";
+    $var['list']['text'] = GSLAN_20;
+	$var['list']['link'] = e_SELF;
+	$var['list']['perm'] = "7";
+	$var['instructions']['text'] = GSLAN_21 ;
+	$var['instructions']['link'] = e_SELF."?instructions";
+	$var['instructions']['perm'] = "7";
+    $var['new']['text'] = GSLAN_22 ;
+	$var['new']['link'] = e_SELF."?new";
+	$var['new']['perm'] = "7";
+	$var['import']['text'] = GSLAN_23;
+	$var['import']['link'] = e_SELF."?import";
+	$var['import']['perm'] = "0";
+	show_admin_menu(GSLAN_19, $action, $var);
+}
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/gsitemap/images/icon_16.png and 75/e107_plugins/gsitemap/images/icon_16.png differ
Files 6171/e107_plugins/gsitemap/images/icon.png and 75/e107_plugins/gsitemap/images/icon.png differ
diff -ruN 6171/e107_plugins/gsitemap/languages/gsitemap_English.php 75/e107_plugins/gsitemap/languages/gsitemap_English.php
--- 6171/e107_plugins/gsitemap/languages/gsitemap_English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/gsitemap/languages/gsitemap_English.php	2006-04-15 12:43:12.000000000 -0500
@@ -0,0 +1,61 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/gsitemap/languages/gsitemap_English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2006/04/15 17:43:12 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+define("GSLAN_Name", "Sitemap");
+define("GSLAN_1", "Site Link");
+define("GSLAN_2", "Import?");
+define("GSLAN_3", "Type");
+define("GSLAN_4", "Name");
+define("GSLAN_5", "Url");
+define("GSLAN_6", "Tick links to mark them for import ...");
+define("GSLAN_7", "Import Links");
+define("GSLAN_8", "Import with:");
+define("GSLAN_9", "Priority");
+define("GSLAN_10", "Frequency");
+define("GSLAN_11", "always");
+define("GSLAN_12", "hourly");
+define("GSLAN_13", "daily");
+define("GSLAN_14", "weekly");
+define("GSLAN_15", "monthly");
+define("GSLAN_16", "yearly");
+define("GSLAN_17", "never");
+define("GSLAN_18", "Import ticked links");
+define("GSLAN_19", "Google Sitemap");
+define("GSLAN_20", "Listing");
+define("GSLAN_21", "Instructions");
+define("GSLAN_22", "Create New Entry");
+define("GSLAN_23", "Import");
+define("GSLAN_24", "Google Sitemap Entries");
+define("GSLAN_25", "Name");
+define("GSLAN_26", "URL");
+define("GSLAN_27", "Lastmod");
+define("GSLAN_28", "Freq.");
+define("GSLAN_29", "Google Sitemap Configuration");
+define("GSLAN_30", "Display Order");
+define("GSLAN_31", "Visible to");
+define("GSLAN_32", "How to use Google Sitemaps");
+define("GSLAN_33", "GSiteMap Instructions");
+define("GSLAN_34", "First, create the links you wish to have listed in your sitemap. You can import most of your links by clicking the 'Import' button on the right");
+define("GSLAN_35", "If you've chosen to import your links, click 'Import' and then check the links you wish to import");
+define("GSLAN_36", "You can also enter individual links manually by clicking 'Create New Entry'");
+define("GSLAN_37", "Once you have some entries, go to <a href='https://www.google.com/webmasters/sitemaps/stats'>https://www.google.com/webmasters/sitemaps/stats</a> and enter the following URL -> <b>".SITEURL."gsitemap.php</b> - if this url doesn't look right to you, please make sure your site url is correct in admin -> preferences");
+define("GSLAN_38", "For more information on Google Sitemap protocol, go to <a href='http://www.google.com/webmasters/sitemaps/docs/en/protocol.html'>http://www.google.com/webmasters/sitemaps/docs/en/protocol.html</a>.");
+define("GSLAN_39", "No links in sitemap - import sitelinks?");
+define("GSLAN_40", "Google Sitemap Entries");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/gsitemap/plugin.php 75/e107_plugins/gsitemap/plugin.php
--- 6171/e107_plugins/gsitemap/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/gsitemap/plugin.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,98 @@
+<?php
+/*
++---------------------------------------------------------------+
+|       e107 website system
+|
+|       Steve Dunstan 2001-2002
+|       http://e107.org
+|       jalist@e107.org
+|
+|       Released under the terms and conditions of the
+|       GNU General Public License (http://gnu.org).
+|     	$Source: /cvsroot/e107/e107_0.7/e107_plugins/gsitemap/plugin.php,v $
+|     	$Revision: 1.7 $
+|     	$Date: 2005/12/14 19:28:44 $
+|     	$Author: sweetas $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = "Google Sitemap";
+$eplug_version = "1.0";
+$eplug_author = "cameron / jalist";
+
+$eplug_url = "http://e107coders.org";
+$eplug_email = "cameron@e107coders.org";
+$eplug_description = "Google Sitemap. For more information on the Google Sitemap protocol, go to <a href='http://www.google.com/webmasters/sitemaps/docs/en/protocol.html'>http://www.google.com/webmasters/sitemaps/docs/en/protocol.html</a>";
+$eplug_compatible = "e107 v0.7";
+$eplug_readme = "";        // leave blank if no readme file
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "gsitemap";
+
+// Mane of menu item for plugin ----------------------------------------------------------------------------------
+ $eplug_menu_name = "";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/icon.png";
+$eplug_icon_small = $eplug_folder."/images/icon_16.png";   
+$eplug_logo = $eplug_folder."/images/icon.png";
+
+$eplug_caption =  "Configure Sitemap";
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = "";
+$eplug_module = TRUE;
+$eplug_table_names = array("gsitemap");
+
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array("
+CREATE TABLE ".MPREFIX."gsitemap (
+	gsitemap_id int(11) unsigned NOT NULL auto_increment,
+	gsitemap_name varchar(200) NOT NULL default '',
+	gsitemap_url varchar(200) NOT NULL default '',
+	gsitemap_lastmod varchar(15) NOT NULL default '',
+	gsitemap_freq varchar(10) NOT NULL default '',
+	gsitemap_priority varchar(3) NOT NULL default '',
+	gsitemap_cat varchar(100) NOT NULL default '',
+	gsitemap_order int(3) NOT NULL default '',
+	gsitemap_img varchar(50) NOT NULL default '',
+	gsitemap_active int(3) NOT NULL default '',
+	PRIMARY KEY  (gsitemap_id)
+) TYPE=MyISAM;"
+);
+
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = TRUE;
+$eplug_link_name = "Sitemap";
+$eplug_link_url = "gsitemap.php?show";
+
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = "Installation Successful..";
+
+$eplug_uninstall_done = "You should delete gsitemap.php from your root directory.";
+
+// upgrading ... //
+
+$upgrade_add_prefs = "";
+
+$upgrade_remove_prefs = "";
+
+$upgrade_alter_tables = "";
+
+$eplug_upgrade_done = "";
+
+
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/headlines_menu/headlines_menu.php 75/e107_plugins/headlines_menu/headlines_menu.php
--- 6171/e107_plugins/headlines_menu/headlines_menu.php	2004-05-26 21:46:06.000000000 -0500
+++ 75/e107_plugins/headlines_menu/headlines_menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,189 +0,0 @@
-<?php
-
-$headline_update = 7200;	// (2 hours)
-
-// is script being called as menu item, or standalone page ...
-
-if(strstr(($_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : $_SERVER['SCRIPT_FILENAME']), "headlines_menu.php")){
-	require_once("../../class2.php");
-	require_once(HEADERF);
-
-	include(e_PLUGIN."headlines_menu/languages/".(file_exists(e_PLUGIN."headlines_menu/languages/".e_LANGUAGE.".php") ? e_LANGUAGE.".php" : "English.php"));
-	
-	if($feeds = $sql -> db_Select("headlines", "*", "headline_active='1' ")){
-		$column = ($feeds/2);
-		$rss = new parse_xml;
-		$text = "<div style='text-align:center'>\n<table style='width:95%'>\n<tr>\n";
-		$text .= "<td style='width:50%; vertical-align:top'>";
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			
-			$rss = new parse_xml;
-			$text .= str_replace("e107_themes/", e_THEME, $headline_description);
-
-			$c++;
-
-			if($c >= ($column-1) && !$flag){
-				$text .= "</td>\n<td style='width:50%; vertical-align:top'>\n";
-				$flag = TRUE;
-			}
-		}
-	
-		$gen = new convert; $datestamp = $gen->convert_date(($headline_timestamp ? $headline_timestamp : time()), "long");
-		$text .= "</td></tr>
-		<tr><td colspan='2' class='forumheader3' style='text-align:center'>".NFMENU_162." ".$datestamp."</td></tr>
-		</table></div>";
-		$ns -> tablerender(NFMENU_161, stripslashes($text));
-		require_once(FOOTERF);
-	}
-	
-}
-
-$text = "<br />";
-if($sql -> db_Select("headlines", "*", "headline_active='1' ")){
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		if(!$headline_url){ break; }
-		if($headline_timestamp+$headline_update < time() && !strstr(THEME, "../")){
-			$tmp = parse_url($headline_url);
-			$dead = FALSE;
-			if(ini_get("allow_url_fopen")){
-				if(!$remote = @fopen ($headline_url, "r")){
-					$dead = TRUE;
-					$text .= "<div style='text-align:center'>\n<table style='width:95%' class='forumheader3'>\n<tr>\n<td style='text-align:center' class='forumheader2'>\n<div class='smalltext'><a href='".$headline_url."' rel='external'>[".NFMENU_163." ".$tmp['host']."]</a></div></td></tr></table></div><br />";
-				}
-			} else {
-				if(!$remote = @fsockopen ($tmp['host'], 80 ,$errno, $errstr, 10)){
-					$dead = TRUE;
-					$text .= "<div style='text-align:center'>\n<table style='width:95%' class='forumheader3'>\n<tr>\n<td style='text-align:center' class='forumheader2'>\n<div class='smalltext'><a href='".$headline_url."' rel='external'>[".NFMENU_163." ".$tmp['host']."]</a></div></td></tr></table></div><br />";
-				} else {
-					stream_set_timeout($remote, 10);
-					fputs($remote, "GET ".$headline_url." HTTP/1.0\r\n\r\n");
-				}
-			}
-			unset($data);
-			if (!$dead) {
-				while(!feof($remote)){
-					$data .= fgets ($remote);
-				}
-				fclose ($remote);
-				$data = eregi_replace("^.*\<\?xml", "<?xml", $data);
-				if(strstr($data, "Your Headline Reader Has Been Banned")){
-					$tmp = parse_url($headline_url);
-					$text .= "<div style='text-align:center'>\n<table style='width:95%' class='forumheader3'>\n<tr>\n<td style='text-align:center' class='forumheader2'>\n<div class='smalltext'><a href='".$headline_url."' rel='external'>[".NFMENU_163." ".$tmp['host']."]</a></div></td></tr></table></div><br />";
-				}
-				$rss = new parse_xml;
-				$rss -> parse_xml_($data);
-				$text .= $rss -> cache_results($headline_id);
-			}
-		} else {
-			$text .= str_replace(ereg_replace("\.\.\/", "", THEME), THEME, $headline_data);
-		}
-	}
-
-	$gen = new convert; $datestamp = $gen->convert_date(($headline_timestamp ? $headline_timestamp : time()), "short");
-	$text .= "<div class='smalltext' style='text-align:right'>".NFMENU_162.": ".$datestamp."</div><a href='".e_PLUGIN."headlines_menu/headlines_menu.php'>".NFMENU_166."</a>";
-	$ns -> tablerender(NFMENU_161, stripslashes($text));
-}
-
-class parse_xml {
-
-	var $parser;
-	var $current_tag;
-	var $channel = array();
-	var $rssdata = array();
-	var $channel_flag = FALSE;
-	var $counter1 = 0;
-	var $counter2 = 0;
-	var $counter3 = 0;
-
-	function parse_xml_ ( $rss_source ){
-
-
-		if(!function_exists('xml_parser_create')){
-			return "ERROR";
-		}
-
-		$this->parser = xml_parser_create('');
-		xml_set_object($this->parser, $this);
-		xml_set_element_handler($this->parser, 'startElement', 'endElement');
-		xml_set_character_data_handler( $this->parser, 'characterData' ); 
-		xml_parse( $this->parser, $rss_source );
-		xml_parser_free( $this->parser );
-
-	}
-
-	function startElement ($p, $element, &$attrs) {
-		$this->current_tag = strtolower($element);
-		if($this->current_tag == "item" || $this->current_tag == "images"){
-			$this->channel_flag = TRUE;
-		}
-	}
-
-	function endElement ($p, $element) {
-		$this->current_tag = strtolower($this->current_tag);
-		if($this->current_tag == "description" && $this->channel_flag){
-			$this->counter1 ++;
-		}else if($this->current_tag == "title" && $this->channel_flag){
-			$this->counter2 ++;
-		}else if($this->current_tag == "link" && $this->channel_flag){
-			$this->counter3 ++;
-		}
-		$this->current_tag = "";
-
-	}
-
-	function characterData ($p, $data) {
-		$this->current_tag = strtolower($this->current_tag);
-		if(trim(chop($data))){
-			if(!$this->channel_flag){
-				if(!$this->channel[$this->current_tag]){
-					$this->channel[$this->current_tag] = $data;
-				}
-			}else{
-				if($this->current_tag == "description"){
-					$this->rssdata[$this->current_tag][$this->counter1] .= strip_tags($data, "<br><br />");
-				}else if($this->current_tag == "title"){
-					$this->rssdata[$this->current_tag][$this->counter2] .= strip_tags($data, "<br><br />");
-				}else if($this->current_tag == "link"){
-					$this->rssdata[$this->current_tag][$this->counter3] .= strip_tags($data, "<br><br />");
-				}
-			}
-		}
-	}
-
-
-	function cache_results($headline_id, $description = FALSE){
-		$sql = new db;
-
-		$sql -> db_Select("headlines", "headline_image ", "headline_id=$headline_id");
-		$row = $sql -> db_Fetch(); extract($row);
-
-		$logoimage = ($headline_image ? $headline_image : $this->channel['url']);
-
-		$text = "<div style='text-align:center'>\n<table style='width:95%' class='forumheader3'>\n<tr>\n<td style='text-align:center' class='forumheader2'>\n<a href='".$this->channel['link']."' rel='external'>
-		".($this->channel['url'] || $logoimage ? "<img src='$logoimage' alt='' style='border:0; vertical-align:center' />" : $this->channel['title'])."</a></td></tr>";
-
-		$text2 = $text;
-
-		for($a=0; $a<=9; $a++){
-			if($this->rssdata['link'][$a]){
-				$text2 .= "<tr><td><img src='".THEME."images/bullet2.gif' alt='' style='vertical-align:middle' /> <b><a href='".$this->rssdata['link'][$a]."' rel='external'>".$this->rssdata['title'][$a]."</a></b><br />".($this->rssdata['description'][$a] && !strstr($this->rssdata['description'][$a], "Search") ? "<span class='smalltext'>" .wordwrap(substr($this->rssdata['description'][$a], 0, 300), 30, "\n", 1)." ...</span>" : "")."</td></tr>";
-				
-				$text .= "<tr><td  class='smalltext'><img src='".THEME."images/bullet2.gif' alt='' style='vertical-align:middle' /> <a href='".$this->rssdata['link'][$a]."' rel='external'>".$this->rssdata['title'][$a]."</a></td></tr>";
-			}
-		}
-		$text .= "</table></div><br />\n";
-		$text2 .= "</table></div><br />\n";
-		if(!$description){
-			$sql -> db_Update ("headlines", "headline_data='".addslashes($text)."', headline_timestamp='".time()."', headline_description='".addslashes($text2)."' WHERE headline_id='$headline_id' ");
-
-			return $text;
-		}else{
-			return $text2;
-		}
-	}
-
-}	// end class //
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/headlines_menu/languages/English.php 75/e107_plugins/headlines_menu/languages/English.php
--- 6171/e107_plugins/headlines_menu/languages/English.php	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/headlines_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,24 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("NFMENU_160", "Webmaster: ");
-define("NFMENU_161", "News Headlines");
-define("NFMENU_162", "Last updated");
-
-define("NFMENU_163", "Unable to open ");
-define("NFMENU_164", "Your server does not allow outside URL's to be opened using fopen(), contact your site administrator");
-define("NFMENU_165", "[more]");
-define("NFMENU_166", "Details");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/integrity_check/admin_integrity_check.php 75/e107_plugins/integrity_check/admin_integrity_check.php
--- 6171/e107_plugins/integrity_check/admin_integrity_check.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/integrity_check/admin_integrity_check.php	2006-04-18 03:37:54.000000000 -0500
@@ -0,0 +1,521 @@
+<?php
+/*
++----------------------
+|
+| Integrity-Check-Plugin v0.03
+|
+| Checks for corrupted and missing files
+|
+| HeX0R 2004
+|
+| for the
+|
+| e107 website system
+| Steve Dunstan 2001-2004
+| http://e107.org
+| jalist@e107.org
+|
+| Released under the terms and conditions of the
+| GNU General Public License (http://gnu.org).
+|
+|
++-----------------------
+*/
+	
+//The following is for php < 4.3.0 not knowing file_get_contents
+if (!function_exists('file_get_contents')) {
+	function file_get_contents($filename, $use_include_path = 0) {
+		$file = @fopen($filename, 'rb', $use_include_path);
+		if ($file) {
+			if ($fsize = @filesize($filename)) {
+				$data = fread($file, $fsize);
+			} else {
+				while (!feof($file)) {
+					$data .= fread($file, 1024);
+				}
+			}
+			fclose($file);
+		}
+		return $data;
+	}
+}
+	
+//Count lines of File
+function lines($filename) {
+	if (strpos($filename, ".gz") == strlen($filename)-3) {
+		$p = 1;
+	} else {
+		$p = 0;
+	}
+	$dh = ($p == 0 ? @fopen($filename, "r") : @gzopen($filename, "rb"));
+	$i = 0;
+	$end = ($p == 0 ? feof($dh) : gzeof($dh));
+	while (!$end) {
+		$a = ($p == 0 ? fgets($dh, 4096) : gzgets($dh, 4096));
+		$i++;
+		$end = ($p == 0 ? feof($dh) : gzeof($dh));
+	}
+	$a = ($p == 0 ? fclose($dh) : gzclose($dh));
+	return $i;
+}
+	
+//Load crc-file and check any of its files
+function check_sfv_file($filename, $check = "", $from = 0, $counts = 0) {
+	global $_log, $dirs_1, $dirs_2, $o_path;
+	$_counter = 1;
+	$the_end = 1;
+	if ($_log[4] > 1) {
+		$dh_crc = (file_exists($o_path."log_crc.txt") ? @fopen($o_path."log_crc.txt", "a") : FALSE);
+		$dh_miss = (file_exists($o_path."log_miss.txt") ? @fopen($o_path."log_miss.txt", "a") : FALSE);
+	}
+	if (strpos($filename, ".gz") == strlen($filename)-3) {
+		$p = 1;
+	} else {
+		$p = 0;
+	}
+	$dh = ($p == 0 ? @fopen($filename, "r") : @gzopen($filename, "rb"));
+	$end = ($p == 0 ? feof($dh) : gzeof($dh));
+	while (!$end && $counts >= $_counter) {
+		if ($from == 0) {
+			$line = ($p == 0 ? fgets($dh, 4096) : $line = gzgets($dh, 4096));
+			++$_counter;
+		} else {
+			if ($p == 0) {
+				fseek($dh, $from);
+			} else {
+				gzseek($dh, $from);
+			}
+			$line = ($p == 0 ? fgets($dh, 4096) : gzgets($dh, 4096));
+			++$_counter;
+			$from = 0;
+		}
+		$a = substr($line, 0, strpos($line, "<-:sfv:->"));
+		if ($a) {
+			$b = substr($line, (strpos($line, "<-:sfv:->")+9));
+			$a = str_replace($dirs_2, $dirs_1, $a);
+			if (file_exists(e_BASE.$a)) {
+				if (trim($b) != trim(generate_sfv_checksum(e_BASE.$a))) {
+					if ($_log[4] == 1) {
+						$_log['crc'] .= "<li>".$a."</li>";
+					} else {
+						if (!$dh_crc) {
+							$dh_crc = @fopen($o_path."log_crc.txt", "w");
+						}
+						@fwrite($dh_crc, "<li>".$a."</li>\n");
+					}
+				}
+			} elseif ($a != "install.php" && $a != "upgrade.php" && (strpos($a, "e107_themes/") !== 0 || !$check || strpos($a, "templates/") != 0)) {
+				if ($_log[4] == 1) {
+					$_log['miss'] .= "<li>".$a."</li>";
+				} else {
+					if (!$dh_miss) {
+						$dh_miss = @fopen($o_path."log_miss.txt", "w");
+					}
+					@fwrite($dh_miss, "<li>".$a."</li>\n");
+				}
+			}
+		}
+		$end = ($p == 0 ? feof($dh) : gzeof($dh));
+	}
+	if ($end) {
+		$the_end = 0;
+	}
+	if ($p == 0) {
+		$_log[5] = ftell($dh);
+		fclose($dh);
+	} else {
+		$_log[5] = gztell($dh);
+		gzclose($dh);
+	}
+	if ($_log[4] > 1) {
+		if ($dh_crc) {
+			fclose($dh_crc);
+		}
+		if ($dh_miss) {
+			fclose($dh_miss);
+		}
+	}
+	return $the_end;
+}
+//Generating Checksum for File
+function generate_sfv_checksum($filename) {
+	return strtoupper(dechex(crc32(str_replace(chr(13).chr(10), chr(10) , file_get_contents(str_replace(" ", "%20", $filename))))));
+}
+	
+//Get Files for doing a crc-file
+function hex_getfiles($dir, $root, $m = "") {
+	global $t_array;
+	$dh = opendir($dir);
+	while ($file = readdir($dh)) {
+		if ($file != "." and $file != ".." && $file != "index.html" && $file != "null.txt") {
+			if (is_file($dir.$file)) {
+				if ((is_array($m) && strpos($file, "core_".$m['e107_version']."b".$m['e107_build'].".crc") === 0) || ($m == "" && strpos($file, "core_") !== 0 && (strpos($file, ".crc") === strlen($file)-4 || strpos($file, ".crc.gz") === strlen($file)-7))) {
+					$t_array[] = $dir.$file;
+				}
+			} else {
+				hex_getfiles($dir.$file."/", $root, $m);
+			}
+		}
+	}
+	closedir($dh);
+	return $t_array;
+}
+	
+//Load e107-Files ($s = 1) or e107-File-Tree ($s = 2)
+function hex_getdirs($dir, $root, $s = "1", $path = e_BASE) {
+	global $t_array, $_arr;
+	$dh = opendir($dir);
+	$search = array("../", $path);
+	$replace = array("", "");
+	while ($file = readdir($dh)) {
+		if ($file != "." and $file != ".." && $file != "index.html" && $file != "null.txt" && !in_array($file, $root) && !in_array(str_replace($search, $replace, $dir.$file), $root)) {
+			if (is_file($dir.$file)) {
+				if ($s == "1") {
+					$t_array[] = str_replace($search, $replace, $dir.$file);
+				}
+			} elseif (!in_array($file, $_arr) && !in_array(str_replace($search, $replace, $dir.$file), $_arr)) {
+				if ($s == "2" || $s == "3") {
+					$t_array[] = str_replace($search, $replace, $dir.$file);
+				}
+				if ($s != "3") {
+					hex_getdirs($dir.$file."/", $root, $s);
+				}
+			}
+		}
+	}
+	closedir($dh);
+	return $t_array;
+}
+	
+	
+require_once("../../class2.php");
+	
+//Output-Path
+$o_path = "crc/";
+	
+if (!getperms("P")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+	
+if (e_QUERY) {
+	$query = explode(".", e_QUERY);
+}
+	
+//Language-definitions
+@include_once((file_exists("languages/".e_LANGUAGE.".php") ? "languages/".e_LANGUAGE.".php" : "languages/English.php"));
+	
+if (file_exists($o_path."log.txt")) {
+	$_log = explode(".-.", stripslashes(file_get_contents($o_path."log.txt")));
+	$steps = intval($_log[2] / $_log[4])+1;
+} else {
+	if (file_exists($o_path."log_crc.txt")) {
+		$err_1 = @unlink($o_path."log_crc.txt");
+	}
+	if (file_exists($o_path."log_miss.txt")) {
+		$err_2 = @unlink($o_path."log_miss.txt");
+	}
+	 
+}
+
+require_once(e_ADMIN."auth.php");
+
+function headerjs() {
+	global $o_path, $_log, $steps;
+	if ((file_exists($o_path."log.txt") && $_log[3] > $steps) || ($_POST['steps'] > 1 && file_exists($_POST['input_files']))) {
+		echo "<meta http-equiv=\"refresh\" content=\"5; url='".e_PLUGIN."integrity_check/admin_integrity_check.php?".e_QUERY." '\">\n";
+	}
+}
+
+	
+//check Version you are using
+if (file_exists(e_ADMIN."ver.php")) {
+	include(e_ADMIN."ver.php");
+}
+	
+//Arrays for replacing Directorys (if non-standard)
+$dirs_1 = array($ADMIN_DIRECTORY, $FILES_DIRECTORY, $IMAGES_DIRECTORY, $THEMES_DIRECTORY, $PLUGINS_DIRECTORY, $HANDLERS_DIRECTORY, $LANGUAGES_DIRECTORY, $HELP_DIRECTORY);
+$dirs_2 = array("e107_admin/", "e107_files/", "e107_images/", "e107_themes/", "e107_plugins/", "e107_handlers/", "e107_languages/", "e107_docs/help/");
+	
+//Files / Dirs never coming into core-sfv
+$exclude = array($FILES_DIRECTORY."backend", $FILES_DIRECTORY."downloadimages", $FILES_DIRECTORY."downloads", $FILES_DIRECTORY."downloadthumbs", $FILES_DIRECTORY."images", $FILES_DIRECTORY."misc", $FILES_DIRECTORY."public" , substr($IMAGES_DIRECTORY, 0, strlen($IMAGES_DIRECTORY)-1), $PLUGINS_DIRECTORY."custom", "e107_config.php", "CVS", $PLUGINS_DIRECTORY."integrity_check/crc");
+	
+unset($message);
+	
+//for core-crc-files: merging arrays together
+if (isset($_POST['activate'])) {
+	if (isset($_POST['Arr'])) {
+		$_arr = array_merge($_POST['Arr'], array($_POST['activate']));
+	} else {
+		$_arr = array($_POST['activate']);
+	}
+} else {
+	$_arr = array();
+}
+	
+	
+if (file_exists("do_core_file.php")) {
+	require_once("do_core_file.php");
+	if (!function_exists('docorefile')) {
+		$message = "<div align='center'><b>".Integ_39."</b></div>";
+	}
+}
+	
+	
+//Make a new plugin-crc-file
+if (isset($_POST['doplugfile']) && $_POST['save_plug_name'] != "") {
+	$file_array = hex_getdirs($_POST['plug_activate']."/", array() , "1", e_PLUGIN."/");
+	sort($file_array);
+	unset($t_array);
+	reset($file_array);
+	$data = "";
+	foreach($file_array as $v) {
+		$data .= str_replace($dirs_1, $dirs_2, $v)."<-:sfv:->".generate_sfv_checksum(e_BASE."/".$v)."\n";
+	}
+	if (!isset($_POST['gz_plug'])) {
+		$dh = @fopen($o_path.$_POST['save_plug_name'], "w");
+		if (@fwrite($dh, $data)) {
+			$message = "<div align='center'>".Integ_01."</div>";
+		} else {
+			$message = "<div align='center'>".Integ_02."</div>";
+		}
+		fclose($dh);
+	} else {
+		$dh = @gzopen($o_path.$_POST['save_plug_name'].".gz", "wb");
+		if (@gzwrite($dh, $data)) {
+			$message = "<div align='center'>".Integ_01."</div>";
+		} else {
+			$message = "<div align='center'>".Integ_02."</div>";
+		}
+		gzclose($dh);
+	}
+}
+	
+//Check existing sfv-File START
+if (isset($_POST['docheck']) && $_POST['input_files'] != "") {
+	if (file_exists($_POST['input_files'])) {
+		$_log = array();
+		$_log[2] = lines($_POST['input_files']);
+		$steps = intval($_log[2] / $_POST['steps'])+1;
+		$_log[3] = $_log[2]-$steps;
+		$_log[4] = $_POST['steps'];
+		$the_end = check_sfv_file($_POST['input_files'], $_POST['theme_folders'], 0, $steps);
+		if ($_log[3] > 0) {
+			$text = "<div align='center'>".str_replace("{counts}", $_log[3], Integ_38)."<br />". Integ_36."<br /><a href=\"".e_PLUGIN."integrity_check/admin_integrity_check.php?".e_QUERY." \">".Integ_37."</a>
+				</div>";
+			$ns->tablerender("", "<b>".$text."</b>");
+		}
+		if ($the_end != 0) {
+			$_log[0] = $_POST['input_files'];
+			$_log[1] = $_POST['theme_folders'];
+			$tmp = addslashes($_log[0].".-.".$_log[1].".-.".$_log[2].".-.".$_log[3].".-.".$_log[4].".-.".$_log[5]);
+			$handle = @fopen($o_path."log.txt", "w");
+			@fwrite($handle, $tmp);
+			@fclose($handle);
+			exit;
+		} elseif ($_log['crc'] || $_log['miss']) {
+			$message = "";
+			if ($_log['crc']) {
+				$message .= "<br />
+					<div align='center'><u>".Integ_04."*</u></div><br /><ul>". $_log['crc']."</ul>";
+			}
+			if ($_log['miss']) {
+				$message .= "<br />
+					<div align='center'><u>".Integ_03."</u></div><br /><ul>". $_log['miss']."</ul>";
+			}
+			if ($_log['crc']) {
+				$message .= Integ_29;
+			}
+		} else {
+			$message = "<br />".Integ_15;
+		}
+	} else {
+		$message = Integ_05;
+	}
+}
+if (file_exists($o_path."log.txt")) {
+	$the_end = check_sfv_file($_log[0], $_log[1], $_log[5], $steps);
+	$_log[3] = $_log[3] - $steps;
+	if ($_log[3] > 0) {
+		$text = "<div align='center'>".str_replace("{counts}", $_log[3], Integ_38)."<br />". Integ_36."<br /><a href=\"".e_PLUGIN."integrity_check/admin_integrity_check.php?".e_QUERY." \">".Integ_37."</a>
+			</div>";
+		$ns->tablerender("", "<b>".$text."</b>");
+	}
+	if ($the_end != 0 && $_log[3] > 0) {
+		$tmp = addslashes($_log[0].".-.".$_log[1].".-.".$_log[2].".-.".$_log[3].".-.".$_log[4].".-.".$_log[5]);
+		$handle = @fopen($o_path."log.txt", "w");
+		@fwrite($handle, $tmp);
+		@fclose($handle);
+		exit;
+	} elseif (file_exists($o_path."log_crc.txt") || file_exists($o_path."log_miss.txt")) {
+		$message = "";
+		if (file_exists($o_path."log_crc.txt")) {
+			$message .= "<br />
+				<div align='center'><u>".Integ_04."*</u></div><br /><ul>". file_get_contents($o_path."log_crc.txt")."</ul>";
+		}
+		if (file_exists($o_path."log_miss.txt")) {
+			$message .= "<br />
+				<div align='center'><u>".Integ_03."</u></div><br /><ul>". file_get_contents($o_path."log_miss.txt")."</ul>";
+			@unlink($o_path."log_miss.txt");
+		}
+		if (file_exists($o_path."log_crc.txt")) {
+			$message .= Integ_29;
+			@unlink($o_path."log_crc.txt");
+		}
+		 
+	} else {
+		$message = "<br />".Integ_15;
+	}
+	@unlink($o_path."log.txt");
+}
+	
+//Message-Output
+if (isset($message)) {
+	$ns->tablerender("", "<b>".$message."</b>");
+}
+	
+	
+//Load existing core-sfv-Files matching your Version
+unset($file_array);
+$t_array = array();
+$core_array = hex_getfiles($o_path, $PLUGINS_DIRECTORY, $e107info);
+$t_array = array();
+	
+//Search plugin-crc-files
+if ($file_array = hex_getfiles(e_PLUGIN, $PLUGINS_DIRECTORY)) {
+	sort($file_array);
+}
+unset($t_array);
+	
+	
+//Start output here
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."?".e_QUERY."' name='integrity_check'>
+	<table style='width:95%'>
+
+	<tr>
+	<td class='fcaption' colspan='2'><br /><a href='".e_ADMIN."fileinspector.php'>".Integ_27."</a><br /><br />
+	</td>	 
+	<tr>
+	<td class='fcaption' colspan='2'>".Integ_06."
+	</td>
+	</tr>
+	<tr>
+	<td style='width:60%' class='forumheader3'>";
+if ($core_array[0]) {
+	$text .= "<b><u>".Integ_19.":</u></b><br />";
+	reset($core_array);
+	foreach($core_array as $v) {
+		$text .= "<input type='radio' name='input_files' value='".$v."' >".str_replace(array(e_BASE, e_PLUGIN, $o_path), array("", "", ""), $v)."<br />";
+	}
+} else {
+	$text .= "<b>".Integ_16."</b><br />";
+}
+if ($file_array[0]) {
+	$text .= "<hr><b><u>".Integ_20.":</u></b><br />";
+	reset($file_array);
+	foreach($file_array as $v) {
+		$text .= "<input type='radio' name='input_files' value='".$v."' >".str_replace(array(e_BASE, e_PLUGIN, $PLUGINS_DIRECTORY), array("", "", ""), $v)."<br />";
+	}
+} else {
+	$text .= "<b>".Integ_17."</b><br />";
+}
+if ($core_array[0]) {
+	$text .= "<br /><hr>
+		<input type='checkbox' name='theme_folders' value='on'>".Integ_23."<br />";
+}
+if ($err_1 || $err_2 || !is_writeable($o_path)) {
+	$err_m = Integ_35."<br />";
+	if ($err_1) {
+		$err_m .= Integ_32."<br />";
+	}
+	if ($err_2) {
+		$err_m .= Integ_33."<br />";
+	}
+	if (!is_writeable($o_path)) {
+		$err_m .= Integ_34."<br />";
+	}
+} else {
+	$err_m = "";
+}
+	
+$text .= "<hr>".Integ_30."<br />".($err_m != "" ? $err_m."<br />" : "")."<br />".Integ_31."<select name='steps'>
+	<option value='1' selected='selected'>1</option>\n";
+if (is_writeable($o_path) && !$err_1 && !$err_2) {
+	for($i = 2; $i < 11; $i++) {
+		$text .= "<option value='".$i."'>".$i."</option>\n";
+	}
+}
+	
+$text .= "</select>
+	</td>
+	<td style='width:40%' class='forumheader3'>
+	<input class='button' type='submit' name='docheck' size='20' value='".Integ_08."' />
+	</td>
+	</tr>";
+	
+if (is_writable($o_path)) {
+	 
+	//do_core_file.php only available 4 dev-team sorry guys...
+	if (function_exists('docorefile')) {
+		$text .= docorefile();
+	}
+	$text .= "<tr>
+		<td class='fcaption' colspan='2'>".Integ_18."
+		</td>
+		</tr>
+		<tr>
+		<td style='width:60%' class='forumheader3'>
+		 
+		<select name='plug_activate' class='tbox' onChange=\"document.integrity_check.save_plug_name.value=hex_strReplace(this.options[selectedIndex].value, '".e_PLUGIN."','')+'.crc' \" ><option></option>";
+	unset($t_array);
+	$file_array = hex_getdirs(e_PLUGIN, $exclude, "3");
+	sort($file_array);
+	reset($file_array);
+	foreach($file_array as $v) {
+		if (!in_array($v, $_arr)) {
+			$v = str_replace($PLUGINS_DIRECTORY, "", $v);
+			$text .= "<option value='".e_PLUGIN.$v."'>".$v."</option>";
+		}
+	}
+	$text .= "</select>
+		</td>
+		<td style='width:40%' class='forumheader3' >".Integ_21."
+		</td>
+		</tr>
+		<tr>
+		<td style='width:60%' class='forumheader3'>".Integ_11."&nbsp;
+		<input class='tbox' type='text' name='save_plug_name' size='40' value='' readonly>
+		</td>
+		<td style='width:40%' class='forumheader3'>
+		<input type='checkbox' name='gz_plug' value='.gz' checked />".Integ_22."
+		</td>
+		</tr>
+		<td class='forumheade3' colspan='2'>
+		<div align='center'>
+		<input class='button' type='submit' name='doplugfile' size='20' value='".Integ_12."' />
+		</div>
+		</td>
+		</tr>
+		</td></tr></table></form></div>";
+} else {
+	$text .= "<tr>
+		<td class='forumheader3' colspan='2'>".str_replace("{output}", $o_path, Integ_14)."
+		</td>
+		</tr></table></form></div>";
+}
+$text .= "<br /><br /><br /><a href='".e_SELF."?header'>".Integ_26."</a><br />";
+	
+
+$ns->tablerender(Integ_13, $text);
+	
+require_once(e_ADMIN.'footer.php');
+?>
+
+<script LANGUAGE="JavaScript" type="text/javascript">
+<!--
+function hex_strReplace(a, b, c){
+return a.split(b).join(c);
+}
+// -->
+</script>
\ No newline at end of file
Files 6171/e107_plugins/integrity_check/crc/core_v0.617b20040917.crc.gz and 75/e107_plugins/integrity_check/crc/core_v0.617b20040917.crc.gz differ
Files 6171/e107_plugins/integrity_check/images/integrity_16.png and 75/e107_plugins/integrity_check/images/integrity_16.png differ
Files 6171/e107_plugins/integrity_check/images/integrity_32.png and 75/e107_plugins/integrity_check/images/integrity_32.png differ
diff -ruN 6171/e107_plugins/integrity_check/integrity_check.php 75/e107_plugins/integrity_check/integrity_check.php
--- 6171/e107_plugins/integrity_check/integrity_check.php	2004-05-27 13:19:12.000000000 -0500
+++ 75/e107_plugins/integrity_check/integrity_check.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,544 +0,0 @@
-<?php
-/*
-+----------------------
-|
-|	Integrity-Check-Plugin v0.03
-|
-|	Checks for corrupted and missing files
-|
-|	HeX0R 2004
-|
-|	for the
-|
-|	e107 website system
-|	Steve Dunstan 2001-2004
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-|
-|
-+-----------------------
-*/
-
-//The following is for php < 4.3.0 not knowing file_get_contents
-if (!function_exists('file_get_contents')) {
-	function file_get_contents($filename, $use_include_path = 0) {
-		$file = @fopen($filename, 'rb', $use_include_path);
-		if ($file) {
-			if ($fsize = @filesize($filename)) { $data = fread($file, $fsize); }
-			else {
-				while (!feof($file)) { $data .= fread($file, 1024); }
-			}
-			fclose($file);
-		} 
-		return $data;
-	}
-}
-
-//Count lines of File
-function lines($filename){
-	if (strpos($filename, ".gz") == strlen($filename)-3) { $p = 1; }
-	else { $p = 0; }
-	$dh = ($p==0 ? @fopen($filename, "r") : @gzopen($filename, "rb"));
-	$i = 0;
-	$end = ($p==0 ? feof($dh) : gzeof($dh));
-	while (!$end) {
-		$a = ($p==0 ? fgets($dh, 4096) : gzgets($dh, 4096));
-		$i++;
-		$end = ($p==0 ? feof($dh) : gzeof($dh));
-	}
-	$a = ($p==0 ? fclose($dh) : gzclose($dh));
-	return $i;
-}
-
-//Load crc-file and check any of its files		
-function check_sfv_file($filename, $check="", $from=0, $counts=0){
-	global $_log, $dirs_1, $dirs_2, $o_path;
-	$_counter=1;
-	$the_end=1;
-	if ($_log[4]>1) {
-		$dh_crc= (file_exists($o_path."log_crc.txt") ? @fopen($o_path."log_crc.txt", "a") : FALSE);
-		$dh_miss= (file_exists($o_path."log_miss.txt") ? @fopen($o_path."log_miss.txt", "a") : FALSE);
-	}
-	if (strpos($filename, ".gz") == strlen($filename)-3) { $p = 1; }
-	else { $p = 0; }
-	$dh = ($p == 0 ? @fopen($filename, "r") : @gzopen($filename, "rb"));
-	$end = ($p==0 ? feof($dh) : gzeof($dh));
-	while (!$end && $counts >= $_counter) {
-		if ($from==0){
-   			$line = ($p == 0 ? fgets($dh, 4096) : $line = gzgets($dh, 4096));
-   			++$_counter;
-   		}
-   		else {
-   			if ($p==0) { fseek($dh, $from); }
-   			else { gzseek($dh, $from); }
-   			$line = ($p == 0 ? fgets($dh, 4096) : gzgets($dh, 4096));
-   			++$_counter;
-			$from=0;
-		}
-		$a = substr($line, 0, strpos($line, "<-:sfv:->"));
-   		if ($a) {
-   			$b = substr($line, (strpos($line, "<-:sfv:->")+9));
-   			$a = str_replace($dirs_2, $dirs_1, $a);
-   			if (file_exists(e_BASE.$a)) {
-   				if (trim($b) != trim(generate_sfv_checksum(e_BASE.$a))) {
-   					if ($_log[4] == 1) {
-						$_log['crc']  .= "<li>".$a."</li>";
-					}
-					else {
-						if (!$dh_crc) { $dh_crc = @fopen($o_path."log_crc.txt", "w"); }
-						@fwrite($dh_crc, "<li>".$a."</li>\n");
-					}
-   				}
-   			}
-   			elseif ($a != "install.php" && $a != "upgrade.php" && (strpos($a, "e107_themes/") !== 0 || !$check || strpos($a, "templates/") != 0)) {
-   				if ($_log[4] == 1) {
-					$_log['miss'] .= "<li>".$a."</li>";
-				}
-				else {
-					if (!$dh_miss) { $dh_miss = @fopen($o_path."log_miss.txt", "w"); }
-					@fwrite($dh_miss, "<li>".$a."</li>\n");
-				}
-   			}
-   		}
-   		$end = ($p==0 ? feof($dh) : gzeof($dh));
-   	}
-	if ($end) { $the_end=0; }
-	if ($p == 0) {
-		$_log[5]=ftell($dh);
-		fclose($dh);
-	}
-	else {
-		$_log[5]=gztell($dh);
-		gzclose($dh);
-	}
-	if ($_log[4]>1){
-		if ($dh_crc) { fclose($dh_crc); }
-		if ($dh_miss) { fclose($dh_miss); }
-	}
-   	return $the_end;
-}
-//Generating Checksum for File
-function generate_sfv_checksum($filename) {
-	return strtoupper(dechex(crc32(str_replace(chr(13).chr(10), chr(10) ,file_get_contents(str_replace(" ", "%20", $filename))))));
-}
-
-//Get Files for doing a crc-file
-function hex_getfiles($dir, $root, $m=""){
-	global $t_array;
-	$dh = opendir($dir);
-	while($file = readdir($dh)){
-		if($file != "." and $file != ".." && $file != "index.html" && $file != "null.txt") {
-			if(is_file($dir.$file)){
-				if ((is_array($m) && strpos($file, "core_".$m['e107_version']."b".$m['e107_build'].".crc") === 0) || ($m == "" && strpos($file, "core_") !== 0 && (strpos($file, ".crc") === strlen($file)-4 || strpos($file, ".crc.gz") === strlen($file)-7))){
-					$t_array[] = $dir.$file;
-				}
-			}else{
-				hex_getfiles($dir.$file."/", $root, $m);
-			}
-		}
-	}
-	closedir($dh);
-	return $t_array;
-}
-
-//Load e107-Files ($s = 1) or e107-File-Tree ($s = 2)
-function hex_getdirs($dir, $root, $s="1", $path=e_BASE){
-	global $t_array, $_arr;
-	$dh = opendir($dir);
-	$search = array("../", $path);
-	$replace = array("", "");
-	while($file = readdir($dh)){
-		if($file != "." and $file != ".." && $file != "index.html" && $file != "null.txt" && !in_array($file, $root) && !in_array(str_replace($search, $replace, $dir.$file), $root)){
-			if(is_file($dir.$file)){
-				if ($s == "1") {
-					$t_array[] = str_replace($search, $replace, $dir.$file);
-				}
-			}elseif (!in_array($file, $_arr) && !in_array(str_replace($search, $replace, $dir.$file), $_arr)) {
-				if ($s == "2" || $s == "3") {
-					$t_array[] = str_replace($search, $replace, $dir.$file);
-				}
-				if ($s != "3") {
-					hex_getdirs($dir.$file."/", $root, $s);
-				}
-			}
-		}
-	}
-	closedir($dh);
-	return $t_array;
-}
-
-
-require_once("../../class2.php");
-
-//Output-Path
-$o_path = "crc/";
-
-if (!getperms("P")) { header("location:".e_BASE."index.php"); exit; }
-
-if(e_QUERY){
-	$query = explode(".", e_QUERY);
-}
-
-//Language-definitions
-@include_once((file_exists("languages/".e_LANGUAGE.".php") ? "languages/".e_LANGUAGE.".php" : "languages/English.php"));
-
-if (file_exists($o_path."log.txt")){
-	$_log = explode(".-.", stripslashes(file_get_contents($o_path."log.txt")));
-	$steps=intval($_log[2] / $_log[4])+1;
-}
-else {
-	if (file_exists($o_path."log_crc.txt")) {
-		$err_1 = @unlink($o_path."log_crc.txt");
-	}
-	if (file_exists($o_path."log_miss.txt")) {
-		$err_2 = @unlink($o_path."log_miss.txt");
-	}
-	
-}
-//Load normal Header ?
-if (in_array("header", $query) && ($_log[3] <= $steps || !isset($_log)) && (!isset($_POST['steps']) || $_POST['steps'] == 1)) {
-       require_once(e_ADMIN."auth.php");
-}
-else {
-	$adminfpage = (!$pref['adminstyle'] || $pref['adminstyle'] == "default" ? "admin.php" : $pref['adminstyle'].".php");
-     	//Alternative Header
-     	$text = "<?xml version=\"1.0\" encoding=\"iso-8859-1\" ?>\n
-        <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
-        <html xmlns=\"http://www.w3.org/1999/xhtml\">
-        <head>
-        <title>".$sitename."</title>
-        <link rel=\"stylesheet\" href=\"".THEME."style.css\" />";
-        if(file_exists(e_FILE."e107.css")){ $text .= "\n<link rel='stylesheet' href='".e_FILE."e107.css' />\n"; }
-        if(file_exists(e_FILE."style.css")){ $text .= "\n<link rel='stylesheet' href='".e_FILE."style.css' />\n"; }
-        $text .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=".CHARSET."\" />
-        <meta http-equiv=\"content-style-type\" content=\"text/css\" />\n";
-        if ((file_exists($o_path."log.txt") && $_log[3] > $steps) || ($_POST['steps'] > 1 && file_exists($_POST['input_files']))) {
-		$text .= "<meta http-equiv=\"refresh\" content=\"5;url='".e_PLUGIN."integrity_check\integrity_check.php?".e_QUERY." '\">\n";
-	}
-        $text .="<script type='text/javascript' src='".e_FILE."e107.js'></script>";
-        if(file_exists(THEME."theme.js")){ $text .= "<script type='text/javascript' src='".THEME."theme.js'></script>"; }
-        if(file_exists(e_FILE."user.js")){ $text .= "<script type='text/javascript' src='".e_FILE."user.js'></script>\n"; }
-        $text .= "</head>
-        <body><div style='text-align:center'>
-        <img src='".e_IMAGE."adminlogo.png' alt='Logo' />
-        </div><br />
-        <div>
-        <table style='width:100%' cellspacing='10' cellpadding='10'>
-        <tr>
-        <td style='width:15%; vertical-align: top;'>";
-        echo $text;
-        $text ="<a href='".e_ADMIN.$adminfpage."'>".Integ_24."</a><br /><a href='".e_BASE."index.php'>".Integ_25."</a><br /><br />";
-        $ns -> tablerender("Admin", $text);
-        echo "</td>
-        <td style='width:60%; vertical-align: top;'>";
-}
-
-//check Version you are using
-if(file_exists(e_ADMIN."ver.php")){
-	include_once(e_ADMIN."ver.php");
-}
-
-//Arrays for replacing Directorys (if non-standard)
-$dirs_1 = array($ADMIN_DIRECTORY, $FILES_DIRECTORY, $IMAGES_DIRECTORY, $THEMES_DIRECTORY, $PLUGINS_DIRECTORY, $HANDLERS_DIRECTORY, $LANGUAGES_DIRECTORY, $HELP_DIRECTORY);
-$dirs_2 = array("e107_admin/", "e107_files/", "e107_images/", "e107_themes/", "e107_plugins/", "e107_handlers/", "e107_languages/", "e107_docs/help/");
-
-//Files / Dirs never coming into core-sfv
-$exclude = array($FILES_DIRECTORY."backend", $FILES_DIRECTORY."downloadimages", $FILES_DIRECTORY."downloads", $FILES_DIRECTORY."downloadthumbs", $FILES_DIRECTORY."images", $FILES_DIRECTORY."misc", $FILES_DIRECTORY."public" , substr($IMAGES_DIRECTORY, 0, strlen($IMAGES_DIRECTORY)-1), $PLUGINS_DIRECTORY."custom", "e107_config.php", "CVS", $PLUGINS_DIRECTORY."integrity_check/crc");
-
-unset($message);
-
-//for core-crc-files: merging arrays together
-if (IsSet($_POST['activate'])) {
-	if (IsSet($_POST['Arr'])){
-		$_arr = array_merge($_POST['Arr'], array($_POST['activate']));
-	}
-	else {
-		$_arr = array($_POST['activate']);
-	}
-} else { $_arr = array(); }
-
-
-if (file_exists("do_core_file.php")) {
-	require_once("do_core_file.php");
-	if (!function_exists('docorefile')){ $message = "<div align='center'><b>".Integ_39."</b></div>"; }
-}
-
-
-//Make a new plugin-crc-file
-if (IsSet($_POST['doplugfile']) && $_POST['save_plug_name'] != "") {
-	$file_array = hex_getdirs($_POST['plug_activate']."/", array() , "1", e_PLUGIN."/");
-	sort($file_array);
-	unset($t_array);
-	reset($file_array);
-	$data="";
-	foreach($file_array as $v){
-		$data .= str_replace($dirs_1, $dirs_2, $v)."<-:sfv:->".generate_sfv_checksum(e_BASE."/".$v)."\n";
-	}
-	if (!IsSet($_POST['gz_plug'])){
-		$dh=@fopen($o_path.$_POST['save_plug_name'], "w");
-		if (@fwrite($dh, $data)){
-			$message = "<div align='center'>".Integ_01."</div>";
-		}
-		else {
-			$message = "<div align='center'>".Integ_02."</div>";
-		}
-		fclose($dh);
-	}
-	else {
-		$dh=@gzopen($o_path.$_POST['save_plug_name'].".gz", "wb");
-		if (@gzwrite($dh, $data)){
-			$message = "<div align='center'>".Integ_01."</div>";
-		}
-		else {
-			$message = "<div align='center'>".Integ_02."</div>";
-		}
-		gzclose($dh);
-	}
-}
-
-//Check existing sfv-File START
-if (IsSet($_POST['docheck']) && $_POST['input_files'] != "") {
-	if (file_exists($_POST['input_files'])) {
-		$_log = array();
-		$_log[2]=lines($_POST['input_files']);
-		$steps = intval($_log[2] / $_POST['steps'])+1;
-		$_log[3]=$_log[2]-$steps;
-		$_log[4]=$_POST['steps'];
-		$the_end = check_sfv_file($_POST['input_files'],$_POST['theme_folders'],0,$steps);
-		if ($_log[3] > 0) {
-			$text = "<div align='center'>".str_replace("{counts}", $_log[3], Integ_38)."<br />".
-			Integ_36."<br /><a href=\"".e_PLUGIN."integrity_check/integrity_check.php?".e_QUERY." \">".Integ_37."</a>
-			</div>";
-			$ns -> tablerender("", "<b>".$text."</b>");
-		}
-		if ($the_end != 0) {
-			$_log[0]=$_POST['input_files'];
-			$_log[1]=$_POST['theme_folders'];
-			$tmp = addslashes($_log[0].".-.".$_log[1].".-.".$_log[2].".-.".$_log[3].".-.".$_log[4].".-.".$_log[5]);
-			$handle = @fopen($o_path."log.txt", "w");
-			@fwrite($handle, $tmp);
-			@fclose($handle);
-			exit;
-		}
-		elseif ($_log['crc'] || $_log['miss']) {
-			$message = "";
-			if ($_log['crc']) {
-				$message .= "<br />
-   				<div align='center'><u>".Integ_04."*</u></div><br /><ul>".
-   				$_log['crc']."</ul>";
-   			}
-   			if ($_log['miss']) {
-   				$message .= "<br />
-   				<div align='center'><u>".Integ_03."</u></div><br /><ul>".
-   				$_log['miss']."</ul>";
-   			}
-   			if ($_log['crc']) {
-   				$message .= Integ_29;
-   			}
-   		}
-   		else {
-   			$message = "<br />".Integ_15;
-   		}
-	}
-	else { $message = Integ_05; }
-}
-if (file_exists($o_path."log.txt")) {
-	$the_end = check_sfv_file($_log[0],$_log[1],$_log[5],$steps);
-	$_log[3] = $_log[3] - $steps;
-	if ($_log[3] > 0) {
-		$text = "<div align='center'>".str_replace("{counts}", $_log[3], Integ_38)."<br />".
-		Integ_36."<br /><a href=\"".e_PLUGIN."integrity_check/integrity_check.php?".e_QUERY." \">".Integ_37."</a>
-		</div>";
-		$ns -> tablerender("", "<b>".$text."</b>");
-	}
-	if ($the_end != 0 && $_log[3] > 0) {
-		$tmp = addslashes($_log[0].".-.".$_log[1].".-.".$_log[2].".-.".$_log[3].".-.".$_log[4].".-.".$_log[5]);
-		$handle = @fopen($o_path."log.txt", "w");
-		@fwrite($handle, $tmp);
-		@fclose($handle);
-		exit;
-	}
-	elseif (file_exists($o_path."log_crc.txt") || file_exists($o_path."log_miss.txt")) {
-		$message = "";
-		if (file_exists($o_path."log_crc.txt")) {
-			$message .= "<br />
-   			<div align='center'><u>".Integ_04."*</u></div><br /><ul>".
-   			file_get_contents($o_path."log_crc.txt")."</ul>";
-   		}
-   		if (file_exists($o_path."log_miss.txt")) {
-   			$message .= "<br />
-   			<div align='center'><u>".Integ_03."</u></div><br /><ul>".
-   			file_get_contents($o_path."log_miss.txt")."</ul>";
-   			@unlink($o_path."log_miss.txt");
-   		}
-   		if (file_exists($o_path."log_crc.txt")) {
-   			$message .= Integ_29;
-   			@unlink($o_path."log_crc.txt");
-   		}
-   		
-   	}
-   	else {
-   		$message = "<br />".Integ_15;
-   	}
-   	@unlink($o_path."log.txt");
-}
-
-//Message-Output
-if (IsSet($message)) {
-	$ns -> tablerender("", "<b>".$message."</b>");
-}
-
-
-//Load existing core-sfv-Files matching your Version
-unset($file_array);
-$t_array = array();
-$core_array = hex_getfiles($o_path, $PLUGINS_DIRECTORY, $e107info);
-$t_array = array();
-
-//Search plugin-crc-files
-if($file_array = hex_getfiles(e_PLUGIN, $PLUGINS_DIRECTORY)){
-	sort($file_array);
-}
-unset($t_array);
-
-
-//Start output here
-$text ="<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."' name='integrity_check'>
-<table style='width:95%'>
-
-<tr>
-<td class='fcaption' colspan='2'>".Integ_06."
-</td>
-</tr>
-<tr>
-<td style='width:60%' class='forumheader3'>";
-if ($core_array[0]) {
-	$text .="<b><u>".Integ_19.":</u></b><br />";
-	reset($core_array);
-	foreach($core_array as $v){
-		$text .= "<input type='radio' name='input_files' value='".$v."' >".str_replace(array(e_BASE, e_PLUGIN, $o_path), array("", "", ""), $v)."<br />";
-	}	
-}
-else {
-	$text .= "<b>".Integ_16."</b><br />";
-}
-if ($file_array[0]) {
-	$text .="<hr><b><u>".Integ_20.":</u></b><br />";
-	reset($file_array);
-	foreach($file_array as $v){
-		$text .= "<input type='radio' name='input_files' value='".$v."' >".str_replace(array(e_BASE, e_PLUGIN, $PLUGINS_DIRECTORY), array("", "", ""), $v)."<br />";
-	}
-}
-else {
-	$text .= "<b>".Integ_17."</b><br />";
-}
-if ($core_array[0]) {
-	$text .="<br /><hr>
-	<input type='checkbox' name='theme_folders' value='on'>".Integ_23."<br />";
-}
-if ($err_1 || $err_2 || !is_writeable($o_path)) {
-	$err_m = Integ_35."<br />";
-	if ($err_1) {
-		$err_m .= Integ_32."<br />";
-	}
-	if ($err_2) {
-		$err_m .= Integ_33."<br />";
-	}
-	if (!is_writeable($o_path)) {
-		$err_m .= Integ_34."<br />";
-	}
-}
-else {
-	$err_m = "";
-}
-	
-$text .= "<hr>".Integ_30."<br />".($err_m != "" ? $err_m."<br />" : "")."<br />".Integ_31."<select name='steps'>
-<option value='1' selected='selected'>1</option>\n";
-if (is_writeable($o_path) && !$err_1 && !$err_2) {
-	for($i=2;$i<11;$i++){
-		$text .= "<option value='".$i."'>".$i."</option>\n";
-	}
-}
-
-$text .="</select>
-</td>
-<td style='width:40%' class='forumheader3'>
-<input class='button' type='submit' name='docheck' size='20' value='".Integ_08."' />
-</td>
-</tr>";
-
-if(is_writable($o_path)){
-	
-	//do_core_file.php only available 4 dev-team sorry guys...
-	if (function_exists('docorefile')) { $text .= docorefile(); }
-	$text .="<tr>
-	<td class='fcaption' colspan='2'>".Integ_18."
-	</td>
-	</tr>
-	<tr>
-	<td style='width:60%' class='forumheader3'>
-	
-	<select name='plug_activate' class='tbox' onChange=\"document.integrity_check.save_plug_name.value=hex_strReplace(this.options[selectedIndex].value, '".e_PLUGIN."','')+'.crc' \" ><option></option>";
-	unset($t_array);
-	$file_array = hex_getdirs(e_PLUGIN, $exclude, "3");
-	sort($file_array);
-	reset($file_array);
-	foreach($file_array as $v){
-		if (!in_array($v, $_arr)) {
-			$v = str_replace($PLUGINS_DIRECTORY, "", $v);
-			$text .= "<option value='".e_PLUGIN.$v."'>".$v."</option>";
-		}
-	}
-	$text .= "</select>
-	</td>
-	<td style='width:40%' class='forumheader3' >".Integ_21."
-	</td>
-	</tr>
-	<tr>
-	<td style='width:60%' class='forumheader3'>".Integ_11."&nbsp;
-	<input class='tbox' type='text' name='save_plug_name' size='40' value='' readonly>
-	</td>
-	<td style='width:40%' class='forumheader3'>
-	<input type='checkbox' name='gz_plug' value='.gz' checked />".Integ_22."
-	</td>
-	</tr>
-	<td class='forumheade3' colspan='2'>
-	<div align='center'>
-	<input class='button' type='submit' name='doplugfile' size='20' value='".Integ_12."' />
-	</div>
-	</td>
-	</tr>
-	</td></tr></table></form></div>";
-}
-else {
-	$text .="<tr>
-	<td class='forumheader3' colspan='2'>".str_replace("{output}", $o_path, Integ_14)."
-	</td>
-	</tr></table></form></div>";
-}
-$text .= "<br /><br /><br /><a href='".e_SELF."?header'>".Integ_26."</a><br />";	
-
-//Render this fuck
-$ns -> tablerender(Integ_13, $text);
-
-//Footer
-echo "\n
-</td>
-</tr>
-</table></div>
-</body>
-</html>";
-
-?>
-
-<script LANGUAGE="JavaScript" type="text/javascript">
-<!--
-function hex_strReplace(a, b, c){
-	return a.split(b).join(c);
-}
-// -->
-</script>
diff -ruN 6171/e107_plugins/integrity_check/languages/English.php 75/e107_plugins/integrity_check/languages/English.php
--- 6171/e107_plugins/integrity_check/languages/English.php	2004-05-27 09:22:10.000000000 -0500
+++ 75/e107_plugins/integrity_check/languages/English.php	2006-02-15 09:00:07.000000000 -0600
@@ -1,42 +1,55 @@
-<?php
-
-define("Integ_01", "Saving successful");
-define("Integ_02", "Saving failed");
-define("Integ_03", "Missing Files:");
-define("Integ_04", "CRC-Errors:");
-define("Integ_05", "Not able to open File...");
-define("Integ_06", "Check file-integrity");
-define("Integ_07", "No files available");
-define("Integ_08", "Check integrity");
-define("Integ_09", "Create sfv-file");
-define("Integ_10", "The selected folder will <u>not</u> be saved within the crc-file.");
-define("Integ_11", "Filename:");
-define("Integ_12", "Create sfv file");
-define("Integ_13", "Integrity-checking");
-define("Integ_14", "SFV-Creation not possible, because the folder ".e_PLUGIN."integrity_check/<b>{output}</b> is not writable. Please chmod this folder to 777!");
-define("Integ_15", "All files have been checked and are o.k.!");
-define("Integ_16", "No core-crc-file available");
-define("Integ_17", "No plugin-crc-files available");
-define("Integ_18", "Create Plugin-CRC-File");
-define("Integ_19", "Core-Checksum-Files");
-define("Integ_20", "Plugin-Checksum-Files");
-define("Integ_21", "Select the plugin you want to create a crc-file for.");
-define("Integ_22", "Use gzip");
-define("Integ_23", "Check only themes actually existant on your host");
-define("Integ_24", "Admin Front Page");
-define("Integ_25", "Leave Admin Area");
-define("Integ_26", "Load Site with normal header");
-
-define("Integ_29", "<br /><br /><b>*<u>CRC-ERRORS:</u></b><br />These are checksum errors and there are two possible reasons for this:<br />-You changed something within the mentioned file, so it isn't longer the same as the original.<br />-The mentioned file is corrupt, you should reupload it!");
-define("Integ_30", "For less cpu-usage , you can do the checking in 1 - 10 steps.");
-define("Integ_31", "Steps: ");
-define("Integ_32", "There is a file named <b>log_crc.txt</b> in your crc-folder. Please delete! (Or try refreshing)");
-define("Integ_33", "There is a file named <b>log_miss.txt</b> in your crc-folder. Please delete! (Or try refreshing)");
-define("Integ_34", "Your Crc-folder is not writable!");
-define("Integ_35", "Because of the following reason(s) you are only allowed to select <b>one</b> step:");
-define("Integ_36", "Click here, if you don't want to wait 5 Seconds till the next step:");
-define("Integ_37", "Click me");
-define("Integ_38", "Another <u><i>{counts}</i></u> lines to do...");
-define("Integ_39", "Please delete the file:<br />".e_PLUGIN."integrity_check/<u><i>do_core_file.php</i></u>!<br />It is outdated and never meant for public release...");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/integrity_check/languages/English.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2006/02/15 15:00:07 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+	
+define("Integ_01", "Saving successful");
+define("Integ_02", "Saving failed");
+define("Integ_03", "Missing Files:");
+define("Integ_04", "CRC-Errors:");
+define("Integ_05", "Not able to open File...");
+define("Integ_06", "Check file-integrity");
+define("Integ_07", "No files available");
+define("Integ_08", "Check integrity");
+define("Integ_09", "Create sfv-file");
+define("Integ_10", "The selected folder will <u>not</u> be saved within the crc-file.");
+define("Integ_11", "Filename:");
+define("Integ_12", "Create sfv file");
+define("Integ_13", "Integrity-checking");
+define("Integ_14", "SFV-Creation not possible, because the folder ".e_PLUGIN."integrity_check/<b>{output}</b> is not writable. Please chmod this folder to 777!");
+define("Integ_15", "All files have been checked and are o.k.!");
+define("Integ_16", "No core-crc-file available");
+define("Integ_17", "No plugin-crc-files available");
+define("Integ_18", "Create Plugin-CRC-File");
+define("Integ_19", "Core-Checksum-Files");
+define("Integ_20", "Plugin-Checksum-Files");
+define("Integ_21", "Select the plugin you want to create a crc-file for.");
+define("Integ_22", "Use gzip");
+define("Integ_23", "Only check installed themes");
+define("Integ_24", "Admin Front Page");
+define("Integ_25", "Leave Admin Area");
+define("Integ_26", "Load Site with normal header");
+define("Integ_27", "USE THE FILE INSPECTOR FOR CHECKING CORE FILES");
+	
+// define("Integ_29", "<br /><br /><b>*<u>CRC-ERRORS:</u></b><br />These are checksum errors and there are two possible reasons for this:<br />-You changed something within the mentioned file, so it isn't longer the same as the original.<br />-The mentioned file is corrupt, you should reupload it!");
+// language file should contain NO html. 
+
+define("Integ_30", "For less cpu-usage , you can do the checking in 1 - 10 steps.");
+define("Integ_31", "Steps: ");
+define("Integ_32", "There is a file named <b>log_crc.txt</b> in your crc-folder. Please delete! (Or try refreshing)");
+define("Integ_33", "There is a file named <b>log_miss.txt</b> in your crc-folder. Please delete! (Or try refreshing)");
+define("Integ_34", "Your Crc-folder is not writable!");
+define("Integ_35", "Because of the following reason(s) you are only allowed to select <b>one</b> step:");
+define("Integ_36", "Click here, if you don't want to wait 5 Seconds till the next step:");
+define("Integ_37", "Click me");
+define("Integ_38", "Another <u><i>{counts}</i></u> lines to do...");
+define("Integ_39", "Please delete the file:<br />".e_PLUGIN."integrity_check/<u><i>do_core_file.php</i></u>!<br />It is outdated and never meant for public release...");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/integrity_check/languages/German.php 75/e107_plugins/integrity_check/languages/German.php
--- 6171/e107_plugins/integrity_check/languages/German.php	2004-05-27 09:22:10.000000000 -0500
+++ 75/e107_plugins/integrity_check/languages/German.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,41 +0,0 @@
-<?php
-
-define("Integ_01", "Speichern war erfolgreich");
-define("Integ_02", "Speichern fehlgeschlagen");
-define("Integ_03", "Fehlende Dateien:");
-define("Integ_04", "CRC-Fehler:");
-define("Integ_05", "Konnte nicht ge&ouml;ffnet werden...");
-define("Integ_06", "File-Integrit&auml;t &uuml;berpr&uuml;fen");
-define("Integ_07", "Keine Files vorhanden");
-define("Integ_08", "&Uuml;berpr&uuml;fen");
-define("Integ_09", "Core Sfv-File erstellen");
-define("Integ_10", "Ausgew&auml;hlten Ordner+Unterordner <u>nicht</u> mit einbeziehen.");
-define("Integ_11", "Dateiname:");
-define("Integ_12", "Sfv-File erstellen");
-define("Integ_13", "Integrit&auml;ts-&Uuml;berpr&uuml;fung");
-define("Integ_14", "SFV-Erstellung nicht m&ouml;glich, da der Ordner ".e_PLUGIN."integrity_check/<b>{output}</b> nicht beschreibbar ist. Bitte chmodde diesen Ordner mit 777!");
-define("Integ_15", "Alle Files sind v&ouml;llig in Ordnung!");
-define("Integ_16", "Kein Core-crc-File vorhanden");
-define("Integ_17", "Keine Plugin-crc-Files vorhanden");
-define("Integ_18", "Erstelle CRC-File fr Plugin");
-define("Integ_19", "Core-Checksum-Files");
-define("Integ_20", "Plugin-Checksum-Files");
-define("Integ_21", "W&auml;hle das Plugin aus, f&uuml;r das du ein crc-file erstellen willst.");
-define("Integ_22", "Benutze gzip");
-define("Integ_23", "berprfe nur Themes-Ordner, die auf deinem Host auch existieren");
-define("Integ_24", "Administrator Haupt-Seite");
-define("Integ_25", "Verlasse Admin-Breich");
-define("Integ_26", "Lade Seite mit normalem Kopf");
-
-define("Integ_29", "<br /><br /><b>*<u>CRC-FEHLER:</u></b><br />Dies sind Pr&uuml;fsummen-Fehler. Es gibt folgende Erkl&auml;rungen:<br />-Du hast an einer Datei rumgebastelt, so dass sie nicht mehr in der Originalform ist.<br />-Die genannte Datei ist besch&auml;digt, du solltest sie neu hochladen!");
-define("Integ_30", "Du kannst, um die CPU-Intensit&auml;t zu verringern, das Checken des CRC-Files in bis zu 10 Schritten durchf&uuml;hren lassen.");
-define("Integ_31", "Schritte: ");
-define("Integ_32", "Du hast noch eine Datei namens <b>log_crc.txt</b> in deinem Crc-Ordner. Bitte l&ouml;schen! (Du kannst auch einen Refresh versuchen).");
-define("Integ_33", "Du hast noch eine Datei namens <b>log_miss.txt</b> in deinem Crc-Ordner.  Bitte l&ouml;schen! (Du kannst auch einen Refresh versuchen).");
-define("Integ_34", "Dein Crc-Ordner ist nicht beschreibbar!");
-define("Integ_35", "Aus den folgenden Gr&uuml;nden kannst du nur einen Schritt einstellen:");
-define("Integ_36", "Klicke hier, wenn du es nicht erwarten kannst, zum n&auml;chsten Schritt zu kommen:");
-define("Integ_37", "Klick mich");
-define("Integ_38", "Noch <i><u>{counts}</u></i> Zeilen zu bearbeiten...");
-define("Integ_39", "Bitte l&ouml;sche die Datei:<br />".e_PLUGIN."integrity_check/<u><i>do_core_file.php</i></u>!<br />Sie ist nicht mehr aktuell, und war eh nie f&uuml;r die &Ouml;ffentlichkeit gedacht...");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/integrity_check/plugin.php 75/e107_plugins/integrity_check/plugin.php
--- 6171/e107_plugins/integrity_check/plugin.php	2004-05-27 09:21:56.000000000 -0500
+++ 75/e107_plugins/integrity_check/plugin.php	2005-12-14 13:28:44.000000000 -0600
@@ -1,70 +1,73 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Plugin : Integrity-Checker
-|	Version: 0.01 (first release)
-|	HeX0R 2004
-|	http://h3x0r.ath.cx
-|	hex0r@h3x0r.ath.cx
-
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-// Plugin info -------------------------------------------------------------------------------------------------------
-$eplug_name = "Integrity Check";
-$eplug_version = "0.03";
-$eplug_author = "HeX0R";
-$eplug_logo = "/images/integ.gif";
-$eplug_url = "http://h3x0r.ath.cx";
-$eplug_email = "hex0r@h3x0r.ath.cx";
-$eplug_description = "Integrity Check is a plugin that checks checksums of your files, helping to find corrupted files.";
-$eplug_compatible = "e107v6";
-$eplug_readme = "";
-
-// Name of the plugin's folder -------------------------------------------------------------------------------------
-$eplug_folder = "integrity_check";
-
-// Name of menu item for plugin ----------------------------------------------------------------------------------
-$eplug_menu_name = "";
-
-// Name of the admin configuration file --------------------------------------------------------------------------
-$eplug_conffile = "integrity_check.php";
-
-// Icon image and caption text ------------------------------------------------------------------------------------
-$eplug_icon = $eplug_folder."/images/integ.gif";
-$eplug_caption =  "Check Integrity";
-
-// List of preferences -----------------------------------------------------------------------------------------------
-
-$eplug_prefs = "";
-
-// List of table names -----------------------------------------------------------------------------------------------
-$eplug_table_names = "";
-
-
-// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
-$eplug_link = FALSE;
-$eplug_link_name = "";
-$eplug_link_url = "";
-
-
-// Text to display after plugin successfully installed ------------------------------------------------------------------
-$eplug_done = "Integrity-Check-Plugin successfully installed!";
-
-// upgrading ... //
-
-$upgrade_add_prefs = "";
-
-$upgrade_remove_prefs = "";
-
-$upgrade_alter_tables = "";
-
-$eplug_upgrade_done = "Integrity-Check-Plugin successfully updated!";
-
-?>	
+<?php
+/*
++---------------------------------------------------------------+
+| e107 website system
+| Steve Dunstan 2001-2002
+| http://e107.org
+| jalist@e107.org
+|
+| Plugin : Integrity-Checker
+| Version: 0.01 (first release)
+| HeX0R 2004
+| http://h3x0r.ath.cx
+| hex0r@h3x0r.ath.cx
+
+| Released under the terms and conditions of the
+| GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = "Integrity Check";
+$eplug_version = "0.03";
+$eplug_author = "HeX0R";
+$eplug_url = "http://h3x0r.ath.cx";
+$eplug_email = "hex0r@h3x0r.ath.cx";
+$eplug_description = "This plugin checks the checksums of your files, helping to find corrupted files.";
+$eplug_compatible = "e107v6";
+$eplug_readme = "";
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "integrity_check";
+
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_integrity_check.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/integrity_32.png";
+$eplug_icon_small = $eplug_folder."/images/integrity_16.png";
+$eplug_caption = "Check Integrity";
+
+// List of preferences -----------------------------------------------------------------------------------------------
+
+$eplug_prefs = "";
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = "";
+
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$eplug_link_url = "";
+
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = "Integrity-Check-Plugin successfully installed!";
+
+// upgrading ... //
+
+$upgrade_add_prefs = "";
+
+$upgrade_remove_prefs = "";
+
+$upgrade_alter_tables = "";
+
+$eplug_upgrade_done = "Integrity-Check-Plugin successfully updated!";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/lastseen/languages/English.php 75/e107_plugins/lastseen/languages/English.php
--- 6171/e107_plugins/lastseen/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/lastseen/languages/English.php	2005-06-28 15:13:14.000000000 -0500
@@ -0,0 +1,16 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/lastseen/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/06/28 20:13:14 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("LSP_LAN_1", "Last seen");
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/lastseen/lastseen_menu.php 75/e107_plugins/lastseen/lastseen_menu.php
--- 6171/e107_plugins/lastseen/lastseen_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/lastseen/lastseen_menu.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,46 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/lastseen/lastseen_menu.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if (file_exists(e_PLUGIN."lastseen/languages/".e_LANGUAGE.".php"))
+{
+	include_once(e_PLUGIN."lastseen/languages/".e_LANGUAGE.".php");
+}
+else
+{
+	include_once(e_PLUGIN."lastseen/languages/English.php");
+}
+
+$sql -> db_Select("user", "user_id, user_name, user_currentvisit", "ORDER BY user_currentvisit DESC LIMIT 0,10", "nowhere");
+$userArray = $sql -> db_getList();
+
+$gen = new convert;
+$text = "<ul style='margin-left:15px; margin-top:0px; padding-left:0px;'>";
+foreach($userArray as $user)
+{
+//	extract($user);
+	$seen_ago = $gen -> computeLapse($user['user_currentvisit'], false, false, true, 'short');
+	$lastseen = ($seen_ago ? $seen_ago : "1 ".LANDT_09)." ".LANDT_AGO; 
+$text .= "<li style='list-style-type: square;'><a href='".e_BASE."user.php?id.".$user['user_id']."'>".$user['user_name']."</a><br /> [ ".$lastseen." ]</li>";
+}
+$text .= "</ul>";
+
+$ns->tablerender(LSP_LAN_1, $text, 'lastseen');
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/admin_linkspage_config.php 75/e107_plugins/links_page/admin_linkspage_config.php
--- 6171/e107_plugins/links_page/admin_linkspage_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/admin_linkspage_config.php	2005-07-13 04:51:41.000000000 -0500
@@ -0,0 +1,244 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|    e107 website system
+|
+|    Steve Dunstan 2001-2002
+|    http://e107.org
+|    jalist@e107.org
+|
+|    Released   under the   terms and   conditions of the
+|    GNU    General Public  License (http://gnu.org).
+|
+|    $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/admin_linkspage_config.php,v $
+|    $Revision: 1.5 $
+|    $Date: 2005/07/13 09:51:41 $
+|    $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+if (!getperms("P")) {
+	header("location:".e_BASE."index.php");
+}
+require_once(e_PLUGIN.'links_page/link_defines.php');
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."userclass_class.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+require_once(e_HANDLER."file_class.php");
+$fl = new e_file;
+e107_require_once(e_HANDLER.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+require_once(e_PLUGIN.'links_page/link_class.php');
+$lc = new linkclass();
+
+$lan_file = $plugindir."languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : $plugindir."languages/English.php");
+
+$linkspage_pref = $lc -> getLinksPagePref();
+
+$deltest = array_flip($_POST);
+
+//if (e_QUERY) {
+//	$qs = explode(".", e_QUERY);
+//}
+if(e_QUERY){
+	$qs = explode(".", e_QUERY);
+
+	if(is_numeric($qs[0])){
+		$from = array_shift($qs);
+	}else{
+		$from = "0";
+	}
+}
+if(isset($_POST['delete'])){
+	$tmp = array_pop(array_flip($_POST['delete']));
+	list($delete, $del_id) = explode("_", $tmp);
+}
+if (isset($_POST['create_category'])) {
+	$lc -> dbCategoryCreate($_POST);
+}
+if (isset($_POST['update_category'])) {
+	$lc -> dbCategoryUpdate($_POST);
+}
+if (isset($_POST['updateoptions'])) {
+	$linkspage_pref = $lc -> UpdateLinksPagePref($_POST);
+	$lc -> show_message(LCLAN_ADMIN_6);
+}
+if (isset($_POST['add_link'])) {
+	$lc -> dbLinkCreate();
+}
+//upload link icon
+if(isset($_POST['uploadlinkicon'])){
+	$lc -> uploadLinkIcon($_POST);
+}
+//upload category icon
+if(isset($_POST['uploadcatlinkicon'])){
+	$lc -> uploadCatLinkIcon($_POST);
+}
+//update link order
+if (isset($_POST['update_order'])) {
+	$lc -> dbOrderUpdate($_POST['link_order']);
+}
+//update link category order
+if (isset($_POST['update_category_order'])) {
+	$lc -> dbOrderCatUpdate($_POST['link_category_order']);
+}
+if (isset($_POST['inc'])) {
+	$lc -> dbOrderUpdateInc($_POST['inc']);
+}
+if (isset($_POST['dec'])) {
+	$lc -> dbOrderUpdateDec($_POST['dec']);
+}
+//delete link
+if (isset($delete) && $delete == 'main') {
+	$sql->db_Select("links_page", "link_order", "link_id='".$del_id."'");
+	$row = $sql->db_Fetch();
+	$sql2 = new db;
+	$sql->db_Select("links_page", "link_id", "link_order>'".$row['link_order']."' && link_category='".$id."'");
+	while ($row = $sql->db_Fetch()) {
+		$sql2->db_Update("links_page", "link_order=link_order-1 WHERE link_id='".$row['link_id']."'");
+	}
+	if ($sql->db_Delete("links_page", "link_id='".$del_id."'")) {
+		$lc->show_message(LCLAN_ADMIN_10." #".$del_id." ".LCLAN_ADMIN_11);
+	}
+}
+//delete category
+if (isset($delete) && $delete == 'category') {
+	if ($sql->db_Delete("links_page_cat", "link_category_id='$del_id' ")) {
+		$lc->show_message(LCLAN_ADMIN_12." #".$del_id." ".LCLAN_ADMIN_11);
+		unset($id);
+	}
+}
+//delete submitted link
+if (isset($delete) && $delete == 'sn') {
+	if ($sql->db_Delete("tmp", "tmp_time='$del_id' ")) {
+		$lc->show_message(LCLAN_ADMIN_13);
+	}
+}
+
+
+
+//show link categories (cat edit)
+if (!e_QUERY) {
+	$lc->show_categories("cat");
+}
+
+//show cat edit form
+if (isset($qs[0]) && $qs[0] == 'cat' && isset($qs[1]) && $qs[1] == 'edit' && isset($qs[2]) && is_numeric($qs[2])) {
+	$lc->show_cat_create();
+}
+
+//show cat create form
+if (isset($qs[0]) && $qs[0] == 'cat' && isset($qs[1]) && $qs[1] == 'create' && !isset($qs[2]) ) {
+	$lc->show_cat_create();
+}
+
+if (isset($qs[0]) && $qs[0] == 'link') {
+	//view categories (link select cat)
+	if (!isset($qs[1])){
+		$lc->show_categories("link");
+
+	//view links in cat
+	}elseif (isset($qs[1]) && $qs[1] == 'view' && isset($qs[2]) && (is_numeric($qs[2]) || $qs[2] == "all") ) {
+		$lc->show_links();
+
+	//edit link
+	}elseif (isset($qs[1]) && $qs[1] == 'edit' && isset($qs[2]) && is_numeric($qs[2])) {
+		$lc->show_link_create();
+
+	//create link
+	}elseif (isset($qs[1]) && $qs[1] == 'create' && !isset($qs[2]) ) {
+		$lc->show_link_create();
+
+	//post submitted
+	}elseif (isset($qs[1]) && $qs[1] == 'sn' && isset($qs[2]) && is_numeric($qs[2]) ) {
+		$lc->show_link_create();
+	}
+}
+
+//view submitted links
+if (isset($qs[0]) && $qs[0] == 'sn') {
+	$lc->show_submitted();
+}
+
+//options
+if (isset($qs[0]) && $qs[0] == 'opt') {
+	$lc->show_pref_options();
+}
+
+// ##### Display options --------------------------------------------------------------------------
+function admin_linkspage_config_adminmenu(){
+	global $qs, $sql;
+	if ($qs[0] == "") {
+		$act = "cat";
+	}else{
+		$act = $qs[0];
+		if(isset($qs[1])){
+			if($qs[1] == "create"){
+				$act .= ".create";
+			}
+			if($qs[1] == "edit"){
+				$act .= "";
+			}
+			if($qs[1] == "view"){
+				$act .= "";
+			}
+		}
+	}
+
+	$var['cat']['text'] = LCLAN_ADMINMENU_2;
+	$var['cat']['link'] = e_SELF;
+
+	$var['cat.create']['text'] = LCLAN_ADMINMENU_3;
+	$var['cat.create']['link'] = e_SELF."?cat.create";
+
+	$var['link']['text'] = LCLAN_ADMINMENU_4;
+	$var['link']['link'] = e_SELF."?link";
+
+	$var['link.create']['text'] = LCLAN_ADMINMENU_5;
+	$var['link.create']['link'] = e_SELF."?link.create";
+		
+	if ($tot = $sql->db_Select("tmp", "*", "tmp_ip='submitted_link' ")) {
+		$var['sn']['text'] = LCLAN_ADMINMENU_7." (".$tot.")";
+		$var['sn']['link'] = e_SELF."?sn";
+	}
+		
+	$var['opt']['text'] = LCLAN_ADMINMENU_6;
+	$var['opt']['link'] = e_SELF."?opt";
+		
+	show_admin_menu(LCLAN_ADMINMENU_1, $act, $var);
+		
+	if($qs[0] != "opt"){
+		unset($var);
+		$var=array();
+		if ($sql->db_Select("links_page_cat", "*")) {
+			while ($row = $sql->db_Fetch()) {
+				$var[$row['link_category_id']]['text'] = $row['link_category_name'];
+				$var[$row['link_category_id']]['link'] = e_SELF."?link.view.".$row['link_category_id'];
+			}
+			$active = ($qs[0] == 'link') ? $id : FALSE;
+			show_admin_menu(LCLAN_ADMINMENU_8, $active, $var);
+		}
+	}
+	if(isset($qs[0]) && $qs[0] == "opt"){
+		unset($var);
+		$var=array();
+		$var['optgeneral']['text']	= LCLAN_OPT_MENU_1;
+		$var['optmanager']['text']	= LCLAN_OPT_MENU_2;
+		$var['optcategory']['text']	= LCLAN_OPT_MENU_3;
+		$var['optlinks']['text']	= LCLAN_OPT_MENU_4;
+		$var['optrefer']['text']	= LCLAN_OPT_MENU_5;
+		$var['optrating']['text']	= LCLAN_OPT_MENU_6;
+		$var['optmenu']['text']		= LCLAN_OPT_MENU_7;
+		show_admin_menu(LCLAN_ADMINMENU_6, $qs[0], $var, TRUE);
+	}
+}
+
+require_once(e_ADMIN.'footer.php');
+exit;
+
+// End ---------------------------------------------------------------------------------------------------------
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/links_page/cat_images/linkspage_16.png and 75/e107_plugins/links_page/cat_images/linkspage_16.png differ
diff -ruN 6171/e107_plugins/links_page/e_comment.php 75/e107_plugins/links_page/e_comment.php
--- 6171/e107_plugins/links_page/e_comment.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/e_comment.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,12 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$e_plug_table = "links_page"; //This is set to the table name you have decided to use.
+$reply_location= e_PLUGIN."links_page/links.php?comment.$nid"; //This is set to the location you'd like the user to return to after replying to a comment.
+$db_table = "links_page"; //This is the name of your plugins database table.
+$link_name = "link_name"; //This is the name of the field in your plugin's db table that corresponds to it's name or title.
+$db_id = "link_id"; // This is the name of the field in your plugin's db table that correspond to it's unique id number.
+$plugin_name = "Links"; // A name for your plugin. It will be used in links to comments, in list_new/new.php.
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/e_frontpage.php 75/e107_plugins/links_page/e_frontpage.php
--- 6171/e107_plugins/links_page/e_frontpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/e_frontpage.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,29 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/e_frontpage.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if (file_exists(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php")) {
+	include_once(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php");
+	} else {
+	include_once(e_PLUGIN."links_page/languages/English.php");
+}
+$front_page['links_page'] = array('page' => $PLUGINS_DIRECTORY.'links_page/links.php', 'title' => LCLAN_PLUGIN_LAN_1);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/e_latest.php 75/e107_plugins/links_page/e_latest.php
--- 6171/e107_plugins/links_page/e_latest.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/e_latest.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,6 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+$submitted_links = $sql->db_Select("tmp", "*", "tmp_ip='submitted_link' ");
+$text .= "<div style='padding-bottom: 2px;'><img src='".e_PLUGIN."links_page/images/linkspage_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' />".($submitted_links ? " <a href='".e_PLUGIN."links_page/admin_linkspage_config.php?sn'>".ADLAN_LAT_5.": $submitted_links</a>" : " ".ADLAN_LAT_5.": ".$submitted_links)."</div>";
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/e_list.php 75/e107_plugins/links_page/e_list.php
--- 6171/e107_plugins/links_page/e_list.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/e_list.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,46 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+	if(!$links_install = $sql -> db_Select("plugin", "*", "plugin_path = 'links_page' AND plugin_installflag = '1' ")){
+		return;
+	}
+
+	$LIST_CAPTION = $arr[0];
+	$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+
+	if($mode == "new_page" || $mode == "new_menu" ){
+		$lvisit = $this -> getlvisit();
+		$qry = " l.link_datestamp>".$lvisit." AND ";		
+	}else{
+		$qry = "";
+	}
+
+	$bullet = $this -> getBullet($arr[6], $mode);
+
+	$qry = "
+	SELECT l.*, c.link_category_id, c.link_category_name
+	FROM #links_page AS l
+	LEFT JOIN #links_page_cat AS c ON c.link_category_id = l.link_category
+	WHERE ".$qry." l.link_class REGEXP '".e_CLASS_REGEXP."' AND c.link_category_class REGEXP '".e_CLASS_REGEXP."'
+	ORDER BY l.link_datestamp DESC LIMIT 0,".intval($arr[7])." 
+	";
+
+	if(!$sql -> db_Select_gen($qry)){
+		$LIST_DATA = LIST_LINKS_2;
+	}else{
+		while($row = $sql -> db_Fetch()){
+
+			$rowheading	= $this -> parse_heading($row['link_name'], $mode);
+			$ICON		= $bullet;
+			$HEADING	= "<a href='".$row['link_url']."' target='_blank' title='".$row['link_name']."'>".$rowheading."</a>";
+			$AUTHOR		= "";
+			$CATEGORY	= ($arr[4] ? "<a href='".e_PLUGIN."links_page/links.php?cat.".$row['link_category_id']."'>".$row['link_category_name']."</a>" : "");
+			$DATE		= ($arr[5] ? ($row['link_datestamp'] > 0 ? $this -> getListDate($row['link_datestamp'], $mode) : "") : "");
+			$INFO		= "";
+			$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+
+		}
+	}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/e_notify.php 75/e107_plugins/links_page/e_notify.php
--- 6171/e107_plugins/links_page/e_notify.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/e_notify.php	2006-02-12 13:14:44.000000000 -0600
@@ -0,0 +1,44 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/e_notify.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2006/02/12 19:14:44 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if(defined('ADMIN_PAGE') && ADMIN_PAGE === true)
+{
+	include_lan(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php");
+	$config_category = NT_LAN_LP_1;
+	$config_events = array('linksub' => NT_LAN_LP_2);
+}
+
+
+if (!function_exists('notify_linksub'))
+{
+	function notify_linksub($data)
+	{
+		global $nt, $_lanfile;
+		include_lan(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php");
+		foreach ($data as $key => $value)
+		{
+			$message .= $key.': '.$value.'<br />';
+		}
+		$nt -> send('linksub', NT_LAN_LP_3, $message);
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/e_search.php 75/e107_plugins/links_page/e_search.php
--- 6171/e107_plugins/links_page/e_search.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/e_search.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,11 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+	if (file_exists(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php")) {
+		include_once(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php");
+	} else {
+		include_once(e_PLUGIN."links_page/languages/English.php");
+	}
+$search_info[] = array('sfile' => e_PLUGIN.'links_page/search/search_parser.php', 'qtype' => LCLAN_ADMIN_14, 'refpage' => 'links.php', 'advanced' => e_PLUGIN.'links_page/search/search_advanced.php');
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/e_status.php 75/e107_plugins/links_page/e_status.php
--- 6171/e107_plugins/links_page/e_status.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/e_status.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,12 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+if (file_exists(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php")) {
+	include_once(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php");
+	} else {
+	include_once(e_PLUGIN."links_page/languages/English.php");
+}
+$sql2 = new db;
+$count = $sql2 -> db_Count("links_page", "(*)");
+$text .= "<div style='padding-bottom: 2px;'><img src='".e_PLUGIN."links_page/images/linkspage_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ".LCLAN_ADMIN_14.": ".$count."</div>";
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/help.php 75/e107_plugins/links_page/help.php
--- 6171/e107_plugins/links_page/help.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/help.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,54 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+$lan_file = $plugindir."languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : $plugindir."languages/English.php");
+
+if(!e_QUERY){
+	$text = LAN_ADMIN_HELP_1;
+}else{
+	if(e_QUERY){
+		$qs = explode(".", e_QUERY);
+
+		if(is_numeric($qs[0])){
+			$from = array_shift($qs);
+		}else{
+			$from = "0";
+		}
+	}
+
+	//##### LINK --------------------------------------------------
+		//manage Link items
+		if($qs[0] == "link" && !isset($qs[1]) ){
+			$text = LAN_ADMIN_HELP_3;
+		//edit
+		}elseif($qs[0] == "link" && $qs[1] == "edit" && is_numeric($qs[2]) ){
+			$text = LAN_ADMIN_HELP_9;
+		//view links in cat
+		}elseif($qs[0] == "link" && $qs[1] == "view" && (is_numeric($qs[2]) || $qs[2] == "all") ){
+			$text = LAN_ADMIN_HELP_8;
+		//create
+		}elseif($qs[0] == "link" && $qs[1] == "create" && !isset($qs[2])){
+			$text = LAN_ADMIN_HELP_4;
+		//create/post submitted
+		}elseif($qs[0] == "link" && $qs[1] == "sn" && is_numeric($qs[2])){
+			$text = LAN_ADMIN_HELP_10;
+
+	//##### SUBMITTED --------------------------------------------------
+		}elseif($qs[0] == "sn" && !isset($qs[1]) ){
+			$text = LAN_ADMIN_HELP_5;
+
+	//##### OPTION --------------------------------------------------
+		}elseif($qs[0] == "opt" && !isset($qs[1]) ){
+			$text = LAN_ADMIN_HELP_6;
+
+	//##### CATEGORY --------------------------------------------------
+		}elseif($qs[0] == "cat" && $qs[1] == "create" ){
+			$text = LAN_ADMIN_HELP_2;
+		}elseif($qs[0] == "cat" && $qs[1] == "edit" && is_numeric($qs[2]) ){
+			$text = LAN_ADMIN_HELP_7;
+		}
+}
+$ns -> tablerender(LAN_ADMIN_HELP_0, $text);
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/links_page/images/blank.gif and 75/e107_plugins/links_page/images/blank.gif differ
Files 6171/e107_plugins/links_page/images/generic.png and 75/e107_plugins/links_page/images/generic.png differ
Files 6171/e107_plugins/links_page/images/linkspage_16.png and 75/e107_plugins/links_page/images/linkspage_16.png differ
Files 6171/e107_plugins/links_page/images/linkspage_32.png and 75/e107_plugins/links_page/images/linkspage_32.png differ
diff -ruN 6171/e107_plugins/links_page/languages/English.php 75/e107_plugins/links_page/languages/English.php
--- 6171/e107_plugins/links_page/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/languages/English.php	2006-02-13 02:35:00.000000000 -0600
@@ -0,0 +1,360 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/languages/English.php,v $
+|     $Revision: 1.24 $
+|     $Date: 2006/02/13 08:35:00 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+// if(!defined("PAGE_NAME")){define("PAGE_NAME", "Links");}  <--
+// Lisa, could you please move this out of the language file ?
+
+
+
+define("LCLAN_PLUGIN_LAN_1", "Links Page");
+define("LCLAN_PLUGIN_LAN_2", "Links Page For Displaying External Web Links");
+define("LCLAN_PLUGIN_LAN_3", "Configure Links Page");
+define("LCLAN_PLUGIN_LAN_4", "links");
+define("LCLAN_PLUGIN_LAN_5", "Links page has successfully installed, please configure it from the Links Page link on the admin front page.");
+define("LCLAN_PLUGIN_LAN_6", "Links_page successfully upgraded, now using version");
+
+define("LCLAN_OPT_MENU_1", "general options");
+define("LCLAN_OPT_MENU_2", "personal link managers");
+define("LCLAN_OPT_MENU_3", "category page");
+define("LCLAN_OPT_MENU_4", "links display");
+define("LCLAN_OPT_MENU_5", "refer page");
+define("LCLAN_OPT_MENU_6", "rating page");
+define("LCLAN_OPT_MENU_7", "menu");
+
+define("LCLAN_PAGETITLE_1", "Links");
+define("LCLAN_PAGETITLE_2", "All categories");
+define("LCLAN_PAGETITLE_3", "All Links");
+define("LCLAN_PAGETITLE_4", "category");
+define("LCLAN_PAGETITLE_5", "Top Rated");
+define("LCLAN_PAGETITLE_6", "Top Referrals");
+define("LCLAN_PAGETITLE_7", "Personal Link Manager");
+define("LCLAN_PAGETITLE_8", "Link Comments");
+define("LCLAN_PAGETITLE_9", "Submit Link");
+define("LCLAN_PAGETITLE_10", "");
+
+
+define("LCLAN_OPT_1", "general options");
+define("LCLAN_OPT_2", "Link Page Options");
+define("LCLAN_OPT_3", "enabled");
+define("LCLAN_OPT_4", "disabled");
+define("LCLAN_OPT_5", "px");
+define("LCLAN_OPT_6", "");
+define("LCLAN_OPT_7", "divide categories into individual pages");
+define("LCLAN_OPT_8", "allow links to be submitted");
+define("LCLAN_OPT_9", "who can submit links");
+define("LCLAN_OPT_10", "use multiple pages to show the links");
+define("LCLAN_OPT_11", "number of links per page");
+define("LCLAN_OPT_12", "category page");
+define("LCLAN_OPT_13", "display which sections");
+define("LCLAN_OPT_14", "icon");
+define("LCLAN_OPT_15", "description");
+define("LCLAN_OPT_16", "amount");
+define("LCLAN_OPT_17", "referal");
+define("LCLAN_OPT_18", "url");
+define("LCLAN_OPT_19", "total category info line");
+define("LCLAN_OPT_20", "link to top refer");
+define("LCLAN_OPT_21", "link to top rated");
+define("LCLAN_OPT_22", "show default icon if none is present");
+define("LCLAN_OPT_23", "default sort method");
+define("LCLAN_OPT_24", "default order method");
+define("LCLAN_OPT_25", "default resize value");
+define("LCLAN_OPT_26", "links page");
+define("LCLAN_OPT_27", "allow users to rate links");
+define("LCLAN_OPT_28", "show default icon if none present");
+define("LCLAN_OPT_29", "display sort and order menu");
+define("LCLAN_OPT_30", "ascending");
+define("LCLAN_OPT_31", "descending");
+define("LCLAN_OPT_32", "use override of link open method");
+define("LCLAN_OPT_33", "default resize value");
+define("LCLAN_OPT_34", "name");
+define("LCLAN_OPT_35", "url");
+define("LCLAN_OPT_36", "order");
+define("LCLAN_OPT_37", "refer");
+define("LCLAN_OPT_38", "");
+define("LCLAN_OPT_39", "");
+define("LCLAN_OPT_40", "name");
+define("LCLAN_OPT_41", "id");
+define("LCLAN_OPT_42", "use individual link setting");
+define("LCLAN_OPT_43", "Opens in same window");
+define("LCLAN_OPT_44", "Opens in new window");
+define("LCLAN_OPT_45", "Opens in 600x400 miniwindow");
+define("LCLAN_OPT_46", "who can manage links");
+define("LCLAN_OPT_47", "these users can add/edit their own personal links");
+define("LCLAN_OPT_48", "allow direct posting");
+define("LCLAN_OPT_49", "if enabled links are submitted directly, else a site admin needs to approve them");
+define("LCLAN_OPT_50", "allow direct deleting");
+define("LCLAN_OPT_51", "if enabled the link managers can delete their own links");
+define("LCLAN_OPT_52", "personal link managers");
+define("LCLAN_OPT_53", "date");
+define("LCLAN_OPT_54", "allow personal management on links");
+define("LCLAN_OPT_55", "allow comments on all links");
+define("LCLAN_OPT_56", "minimum refer value");
+define("LCLAN_OPT_57", "only links with a refer count larger then the given value are displayed (0 or empty = all)");
+define("LCLAN_OPT_58", "link to submit link");
+define("LCLAN_OPT_59", "link to personal manager (only if allowed)");
+define("LCLAN_OPT_60", "link to link frontpage");
+define("LCLAN_OPT_61", "link to all categories");
+define("LCLAN_OPT_62", "show these navigator links");
+define("LCLAN_OPT_63", "minimum rating value");
+define("LCLAN_OPT_64", "only links with a rating larger then the given value are displayed (0 or empty = all)");
+define("LCLAN_OPT_65", "show empty categories");
+define("LCLAN_OPT_66", "link to each category");
+define("LCLAN_OPT_67", "link to all links");
+define("LCLAN_OPT_68", "view all links");
+
+define("LCLAN_OPT_69", "rendertype navigator links");
+define("LCLAN_OPT_70", "show category links");
+define("LCLAN_OPT_71", "rendertype category links");
+define("LCLAN_OPT_72", "show recent links");
+define("LCLAN_OPT_73", "display which data");
+define("LCLAN_OPT_74", "how many recent links are displayed");
+define("LCLAN_OPT_75", "hyperlinks");
+define("LCLAN_OPT_76", "selectbox");
+define("LCLAN_OPT_77", "category");
+define("LCLAN_OPT_78", "description");
+define("LCLAN_OPT_79", "caption navigator");
+define("LCLAN_OPT_80", "caption categories");
+define("LCLAN_OPT_81", "caption recent list");
+define("LCLAN_OPT_82", "navigator");
+define("LCLAN_OPT_83", "categories");
+define("LCLAN_OPT_84", "recent list");
+define("LCLAN_OPT_85", "caption menu");
+define("LCLAN_OPT_86", "link menu");
+define("LCLAN_OPT_87", "show amount of links");
+
+define("LCLAN_ADMIN_1", "update");
+define("LCLAN_ADMIN_2", "Link saved to database.");
+define("LCLAN_ADMIN_3", "Link updated in database.");
+define("LCLAN_ADMIN_4", "Link Category Saved");
+define("LCLAN_ADMIN_5", "Link Category Updated");
+define("LCLAN_ADMIN_6", "Options Saved");
+define("LCLAN_ADMIN_7", "link icon was uploaded succefully !");
+define("LCLAN_ADMIN_8", "link icon was not uploaded !");
+define("LCLAN_ADMIN_9", "Order updated");
+define("LCLAN_ADMIN_10", "Link");
+define("LCLAN_ADMIN_11", "deleted");
+define("LCLAN_ADMIN_12", "Link Category");
+define("LCLAN_ADMIN_13", "Submitted link deleted");
+define("LCLAN_ADMIN_14", "Links");
+
+define("LCLAN_SL_1", "Submitted Links");
+define("LCLAN_SL_2", "No submitted links");
+define("LCLAN_SL_3", "Link");
+define("LCLAN_SL_4", "Submitted by");
+define("LCLAN_SL_5", "Options");
+define("LCLAN_SL_6", "Post");
+define("LCLAN_SL_7", "Delete");
+define("LCLAN_SL_8", "Are you sure you want to delete this submitted link?");
+define("LCLAN_SL_9", "After submitting your link it will be reviewed by a site admin and if appropriate it will be added to the main links page.");
+define("LCLAN_SL_10", "Category:");
+define("LCLAN_SL_11", "name");
+define("LCLAN_SL_12", "url");
+define("LCLAN_SL_13", "description");
+define("LCLAN_SL_14", "URL to link button:");
+define("LCLAN_SL_15", "Underlined fields are required.");
+define("LCLAN_SL_16", "Submit Link");
+define("LCLAN_SL_17", "");
+define("LCLAN_SL_18", "");
+
+define("LCLAN_CAT_1", "Image");
+define("LCLAN_CAT_2", "Category");
+define("LCLAN_CAT_3", "Options");
+define("LCLAN_CAT_4", "Move");
+define("LCLAN_CAT_5", "Order");
+define("LCLAN_CAT_6", "Edit");
+define("LCLAN_CAT_7", "Are");
+define("LCLAN_CAT_8", "Are you sure you want to delete this category?");
+define("LCLAN_CAT_9", "View Links");
+define("LCLAN_CAT_10", "Reorder");
+define("LCLAN_CAT_11", "No link categories");
+define("LCLAN_CAT_12", "Existing Link Categories");
+define("LCLAN_CAT_13", "Name:");
+define("LCLAN_CAT_14", "Description:");
+define("LCLAN_CAT_15", "Upload a new icon:");
+define("LCLAN_CAT_16", "Auto-Thumbnail size:");
+define("LCLAN_CAT_17", "This option is disabled as file uploading is not enabled on your server");
+define("LCLAN_CAT_18", "The");
+define("LCLAN_CAT_19", "folder is not writable, you need to CHMOD 777 the folder before uploading");
+define("LCLAN_CAT_20", "px");
+define("LCLAN_CAT_21", "upload");
+define("LCLAN_CAT_22", "Choose an icon:");
+define("LCLAN_CAT_23", "View Images");
+define("LCLAN_CAT_24", "Visible for:");
+define("LCLAN_CAT_25", "tick to update timestamp to current time");
+define("LCLAN_CAT_26", "Update Link Category");
+define("LCLAN_CAT_27", "Clear Form");
+define("LCLAN_CAT_28", "Create Link Category");
+define("LCLAN_CAT_29", "Link Category");
+
+define("LCLAN_ITEM_1", "Submitted by");
+define("LCLAN_ITEM_2", "Category:");
+define("LCLAN_ITEM_3", "no categories yet");
+define("LCLAN_ITEM_4", "Name:");
+define("LCLAN_ITEM_5", "Url:");
+define("LCLAN_ITEM_6", "Description:");
+define("LCLAN_ITEM_7", "Upload an icon:");
+define("LCLAN_ITEM_8", "Auto-Thumbnail size:");
+define("LCLAN_ITEM_9", "This option is disabled as file uploading is not enabled on your server");
+define("LCLAN_ITEM_10", "The");
+define("LCLAN_ITEM_11", "folder is not writable, you need to CHMOD 777 the folder before uploading");
+define("LCLAN_ITEM_12", "px");
+define("LCLAN_ITEM_13", "upload");
+define("LCLAN_ITEM_14", "Choose an icon:");
+define("LCLAN_ITEM_15", "View Images");
+define("LCLAN_ITEM_16", "Open Type:");
+define("LCLAN_ITEM_17", "Opens in same window");
+define("LCLAN_ITEM_18", "Opens in new window");
+define("LCLAN_ITEM_19", "Opens in 600x400 miniwindow");
+define("LCLAN_ITEM_20", "Visible for:");
+define("LCLAN_ITEM_21", "tick to update timestamp to current time");
+define("LCLAN_ITEM_22", "Update Link");
+define("LCLAN_ITEM_23", "Create link");
+define("LCLAN_ITEM_24", "Links");
+define("LCLAN_ITEM_25", "Image");
+define("LCLAN_ITEM_26", "Link Name");
+define("LCLAN_ITEM_27", "Options");
+define("LCLAN_ITEM_28", "Move");
+define("LCLAN_ITEM_29", "Order");
+define("LCLAN_ITEM_30", "Reorder");
+define("LCLAN_ITEM_31", "edit");
+define("LCLAN_ITEM_32", "delete");
+define("LCLAN_ITEM_33", "Are you sure you want to delete this link?");
+define("LCLAN_ITEM_34", "no icon");
+define("LCLAN_ITEM_35", "manage personal links");
+define("LCLAN_ITEM_36", "go");
+define("LCLAN_ITEM_37", "view all links");
+define("LCLAN_ITEM_38", "All Links");
+define("LCLAN_ITEM_39", "");
+
+define("LCLAN_ADMINMENU_1", "Link Options");
+define("LCLAN_ADMINMENU_2", "Manage Link Categories");
+define("LCLAN_ADMINMENU_3", "Create Link Category");
+define("LCLAN_ADMINMENU_4", "Manage Links");
+define("LCLAN_ADMINMENU_5", "Create Link");
+define("LCLAN_ADMINMENU_6", "Options");
+define("LCLAN_ADMINMENU_7", "Submitted Links");
+define("LCLAN_ADMINMENU_8", "Categories");
+
+define("NT_LAN_LP_1", "Links Page Events");
+define("NT_LAN_LP_2", "Link submitted by user");
+define("NT_LAN_LP_3", "Link Submitted");
+
+define("LNK_SCH_LAN_2", "All Links Categories");
+define("LNK_SCH_LAN_3", "All links details");
+
+define("LAN_LINKS_MANAGER_0", "icon");
+define("LAN_LINKS_MANAGER_1", "link");
+define("LAN_LINKS_MANAGER_2", "options");
+define("LAN_LINKS_MANAGER_3", "create new link");
+define("LAN_LINKS_MANAGER_4", "you don't have any links present");
+define("LAN_LINKS_MANAGER_5", "category");
+define("LAN_LINKS_MANAGER_6", "");
+define("LAN_LINKS_MANAGER_7", "");
+define("LAN_LINKS_MANAGER_8", "");
+define("LAN_LINKS_MANAGER_9", "");
+
+define("LAN_LINKS_1", "Total links");
+define("LAN_LINKS_2", "Total links activated");
+define("LAN_LINKS_3", "Anonymous");
+define("LAN_LINKS_4", "heading");
+define("LAN_LINKS_5", "url");
+define("LAN_LINKS_6", "order");
+define("LAN_LINKS_7", "refer");
+define("LAN_LINKS_8", "ascending");
+define("LAN_LINKS_9", "descending");
+define("LAN_LINKS_10", "Top Links : Refer");
+define("LAN_LINKS_11", "Top Links : Rating");
+define("LAN_LINKS_12", "view links by refer");
+define("LAN_LINKS_13", "view links by rating");
+define("LAN_LINKS_14", "view links frontpage");
+define("LAN_LINKS_15", "sort by");
+define("LAN_LINKS_16", "in this category");
+define("LAN_LINKS_17", "link");
+define("LAN_LINKS_18", "links");
+define("LAN_LINKS_19", "categories");
+define("LAN_LINKS_20", "category");
+define("LAN_LINKS_21", "There");
+define("LAN_LINKS_22", "is");
+define("LAN_LINKS_23", "are");
+define("LAN_LINKS_24", "total in");
+define("LAN_LINKS_25", "show all links");
+define("LAN_LINKS_26", "Referrals:");
+define("LAN_LINKS_27", "submit a link");
+define("LAN_LINKS_28", "Thankyou");
+define("LAN_LINKS_29", "Your link has been saved and will be reviewed by a site administrator.");
+define("LAN_LINKS_30", "Link Categories");
+define("LAN_LINKS_31", "submit a link");
+define("LAN_LINKS_32", "Category:");
+define("LAN_LINKS_33", "No Links are rated yet.");
+define("LAN_LINKS_34", "There are currently no links");
+define("LAN_LINKS_35", "personal links manager");
+define("LAN_LINKS_36", "link comments");
+define("LAN_LINKS_37", "comments:");
+define("LAN_LINKS_38", "date");
+define("LAN_LINKS_39", "Links");
+define("LAN_LINKS_40", "Category");
+define("LAN_LINKS_41", "no categories yet");
+define("LAN_LINKS_42", "no links are referred yet");
+define("LAN_LINKS_43", "view all categories");
+define("LAN_LINKS_44", "id");
+define("LAN_LINKS_45", "Link Category");
+define("LAN_LINKS_46", "Link Subcategories");
+define("LAN_LINKS_47", "link navigator...");
+define("LAN_LINKS_48", "");
+define("LAN_LINKS_49", "");
+
+define("LAN_ADMIN_HELP_0", "linkspage help area");
+
+define("LAN_ADMIN_HELP_1", "<i>the manage link categories page shows all categories present.</i><br /><br /><b>detailed list</b><br />You see a list of all categories with their icon, name and description, options, and sorting options.<br /><br /><b>explanation of icons</b><br />
+".LINK_ICON_LINK." : link to the category<br /><br />
+".LINK_ICON_EDIT." : edit the category<br /><br />
+".LINK_ICON_DELETE." : delete the category<br /><br />
+".LINK_ICON_ORDER_UP." : the up button allows you to move the category item one up in order.<br /><br />
+".LINK_ICON_ORDER_DOWN." : the down button allows you to move the category item one down in order.<br />
+<br />
+<b>order</b><br />here you can manually set the order of all the categories. You need to change the values in the select boxes to the order of your kind and press the reorder button below to save the new order.<br />");
+
+define("LAN_ADMIN_HELP_2", "<i>the create link category page allows you to add new categories</i><br /><br />You can upload a new icon, and after uploading assign the icon to the category.");
+define("LAN_ADMIN_HELP_3", "<i>the manage links page first show all categories.</i><br /><br />".LINK_ICON_LINK." : link to the category<br /><br />".LINK_ICON_EDIT." : click the icon to view all links in this category<br />");
+define("LAN_ADMIN_HELP_4", "<i>the create link page allows you to add a new link</i><br /><br />You can upload a new icon, and after uploading assign the icon to the link.<br /><br />the open type allows you to define how the link will be opened when a user clicks on it.");
+define("LAN_ADMIN_HELP_5", "<i>the submitted links page shows all links that are submitted by users</i><br /><br /><b>detailed list</b><br />You see the link url, the name of the user who submitted the link and options.<br /><br /><b>explanation of icons</b><br />
+".LINK_ICON_EDIT." : post the submitted link to the link create form<br /><br />
+".LINK_ICON_DELETE." : delete the submitted link<br />
+");
+define("LAN_ADMIN_HELP_6", "<i>the options page allows you to change the behaviour of the links_page plugin</i><br /><br />
+general options<br />
+these options are generally used thoughout the link pages.<br /><br />
+personal link managers<br />
+the personal link managers are priviliged users who can manage their own personally added links.<br /><br />
+category page<br />
+here you can change options for the category page.<br /><br />
+links page<br />
+These options are used on the link pages.<br /><br />
+refer page<br />
+These options are used on the top refer links page.<br /><br />
+rating page<br />
+These options are used on the top rated links page.<br />
+");
+
+define("LAN_ADMIN_HELP_7", "<i>the edit link category page allows you to edit an existing category</i><br /><br />You can upload a new icon, and after uploading assign the icon to the category.<br />You can update the timestamp of the link by checking the box.");
+
+define("LAN_ADMIN_HELP_8", "<i>this page shows all existing links in the selected category.</i><br /><br /><b>detailed list</b><br />You see a list of the links with their image, name, options, and sorting options.<br /><br /><b>explanation of icons</b><br />
+".LINK_ICON_LINK." : link to the website<br /><br />
+".LINK_ICON_EDIT." : edit the link<br /><br />
+".LINK_ICON_DELETE." : delete the link<br /><br />
+".LINK_ICON_ORDER_UP." : the up button allows you to move the link one up in order.<br /><br />
+".LINK_ICON_ORDER_DOWN." : the down button allows you to move the link one down in order.<br />
+<br />
+<b>order</b><br />here you can manually set the order of all the links. You need to change the values in the select boxes to the order of your kind and press the reorder button below to save the new order.<br />");
+
+define("LAN_ADMIN_HELP_9", "<i>the edit link page allows you to edit an existing link</i><br /><br />You can upload a new icon, and after uploading assign the icon to the link.<br /><br />the open type allows you to define how the link will be opened when a user clicks on it.");
+define("LAN_ADMIN_HELP_10", "<i>the post submitted link page allows you to add a submitted link to the existing links</i><br /><br />A small submitted text is added into the description field.<br /><br />You can upload a new icon, and after uploading assign the icon to the link.<br /><br />the open type allows you to define how the link will be opened when a user clicks on it.");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/link_class.php 75/e107_plugins/links_page/link_class.php
--- 6171/e107_plugins/links_page/link_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/link_class.php	2006-03-09 17:08:58.000000000 -0600
@@ -0,0 +1,1393 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|    e107 website system
+|
+|    Steve Dunstan 2001-2002
+|    http://e107.org
+|    jalist@e107.org
+|
+|    Released   under the   terms and   conditions of the
+|    GNU    General Public  License (http://gnu.org).
+|
+|    $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/link_class.php,v $
+|    $Revision: 1.27 $
+|    $Date: 2006/03/09 23:08:58 $
+|    $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class linkclass {
+
+    function LinkPageDefaultPrefs(){
+
+        $linkspage_pref['link_page_categories'] = "0";
+        $linkspage_pref['link_submit'] = "0";
+        $linkspage_pref['link_submit_class'] = "0";
+        $linkspage_pref['link_submit_directpost'] = "0";
+        $linkspage_pref["link_nextprev"] = "1";
+        $linkspage_pref["link_nextprev_number"] = "20";
+        $linkspage_pref['link_comment'] = "";
+        $linkspage_pref['link_rating'] = "";
+
+        $linkspage_pref['link_navigator_frontpage'] = "1";
+        $linkspage_pref['link_navigator_submit'] = "";
+        $linkspage_pref['link_navigator_manager'] = "";
+        $linkspage_pref['link_navigator_refer'] = "";
+        $linkspage_pref['link_navigator_rated'] = "";
+        $linkspage_pref['link_navigator_allcat'] = "1";
+        $linkspage_pref['link_navigator_links'] = "1";
+        $linkspage_pref['link_navigator_category'] = "1";
+
+        $linkspage_pref['link_cat_icon'] = "1";
+        $linkspage_pref['link_cat_desc'] = "1";
+        $linkspage_pref['link_cat_amount'] = "1";
+        $linkspage_pref['link_cat_total'] = "1";
+        $linkspage_pref['link_cat_empty'] = "1";
+        $linkspage_pref['link_cat_icon_empty'] = "0";
+        $linkspage_pref['link_cat_sortorder'] = "0";
+        $linkspage_pref['link_cat_sort'] = "link_category_name";
+        $linkspage_pref['link_cat_order'] = "ASC";
+        $linkspage_pref['link_cat_resize_value'] = "50";
+
+        $linkspage_pref['link_icon'] = "1";
+        $linkspage_pref['link_referal'] = "1";
+        $linkspage_pref['link_url'] = "0";
+        $linkspage_pref['link_desc'] = "1";
+        $linkspage_pref['link_icon_empty'] = "0";
+        $linkspage_pref['link_sortorder'] = "0";
+        $linkspage_pref['link_sort'] = "order";
+        $linkspage_pref['link_order'] = "ASC";
+        $linkspage_pref['link_open_all'] = "5";         //use individual link open type setting
+        $linkspage_pref['link_resize_value'] = "100";
+
+        $linkspage_pref['link_manager'] = "0";
+        $linkspage_pref['link_manager_class'] = "0";
+        $linkspage_pref['link_directpost'] = "0";
+        $linkspage_pref['link_directdelete'] = "0";
+
+        $linkspage_pref['link_refer_minimum'] = "";
+
+        $linkspage_pref['link_rating_minimum'] = "";
+
+        $linkspage_pref['link_menu_caption'] = LCLAN_OPT_86;
+        $linkspage_pref['link_menu_navigator_frontpage'] = "1";
+        $linkspage_pref['link_menu_navigator_submit'] = "1";
+        $linkspage_pref['link_menu_navigator_manager'] = "1";
+        $linkspage_pref['link_menu_navigator_refer'] = "1";
+        $linkspage_pref['link_menu_navigator_rated'] = "1";
+        $linkspage_pref['link_menu_navigator_links'] = "1";
+        $linkspage_pref['link_menu_navigator_category'] = "1";
+        $linkspage_pref['link_menu_navigator_rendertype'] = "";
+        $linkspage_pref['link_menu_navigator_caption'] = LCLAN_OPT_82;
+        $linkspage_pref['link_menu_category'] = "1";
+        $linkspage_pref['link_menu_category_amount'] = "1";
+        $linkspage_pref['link_menu_category_rendertype'] = "";
+        $linkspage_pref['link_menu_category_caption'] = LCLAN_OPT_83;
+        $linkspage_pref['link_menu_recent'] = "1";
+        $linkspage_pref['link_menu_recent_category'] = "";
+        $linkspage_pref['link_menu_recent_description'] = "";
+        $linkspage_pref["link_menu_recent_number"] = "5";
+        $linkspage_pref['link_menu_recent_caption'] = LCLAN_OPT_84;
+
+        return $linkspage_pref;
+    }
+
+    function getLinksPagePref(){
+        global $sql, $eArrayStorage;
+
+        $num_rows = $sql -> db_Select("core", "*", "e107_name='links_page' ");
+        if ($num_rows == 0) {
+            $linkspage_pref = $this->LinkPageDefaultPrefs();
+            $tmp = $eArrayStorage->WriteArray($linkspage_pref);
+            $sql -> db_Insert("core", "'links_page', '{$tmp}' ");
+            $sql -> db_Select("core", "*", "e107_name='links_page' ");
+        }
+        $row = $sql -> db_Fetch();
+        $linkspage_pref = $eArrayStorage->ReadArray($row['e107_value']);
+
+        return $linkspage_pref;
+    }
+
+    function UpdateLinksPagePref($_POST){
+        global $sql, $eArrayStorage, $tp;
+
+        $num_rows = $sql -> db_Select("core", "*", "e107_name='links_page' ");
+        if ($num_rows == 0) {
+            $sql -> db_Insert("core", "'links_page', '' ");
+        }else{
+            $row = $sql -> db_Fetch();
+
+            //assign new preferences
+            foreach($_POST as $k => $v){
+                if(strpos($k, "link_") === 0){
+                    $linkspage_pref[$k] = $tp->toDB($v);
+                }
+            }
+
+            //create new array of preferences
+            $tmp = $eArrayStorage->WriteArray($linkspage_pref);
+
+            $sql -> db_Update("core", "e107_value = '{$tmp}' WHERE e107_name = 'links_page' ");
+        }
+        return $linkspage_pref;
+    }
+
+    function setPageTitle(){
+        global $sql, $qs, $linkspage_pref;
+
+        //show all categories
+        if(!isset($qs[0]) && $linkspage_pref['link_page_categories']){
+            $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_2;
+        }
+        //show all categories
+        if(isset($qs[0]) && $qs[0] == "cat" && !isset($qs[1]) ){
+            $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_2;
+        }
+        //show all links in all categories
+        if( (!isset($qs[0]) && !$linkspage_pref['link_page_categories']) || (isset($qs[0]) && $qs[0] == "all") ){
+            $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_3;
+        }
+        //show all links in one categories
+        if(isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && is_numeric($qs[1])){
+            $sql -> db_Select("links_page_cat", "link_category_name", "link_category_id='".$qs[1]."' ");
+            $row2 = $sql -> db_Fetch();
+            $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_4." / ".$row2['link_category_name'];
+        }
+        //view top rated
+        if(isset($qs[0]) && $qs[0] == "rated"){
+            $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_5;
+        }
+        //view top refer
+        if(isset($qs[0]) && $qs[0] == "top"){
+            $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_6;
+        }
+        //personal link managers
+        if (isset($qs[0]) && $qs[0] == "manage"){
+            $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_7;
+        }
+        //comments on links
+        if (isset($qs[0]) && $qs[0] == "comment" && isset($qs[1]) && is_numeric($qs[1]) ){
+            $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_8;
+        }
+        //submit link
+        if (isset($qs[0]) && $qs[0] == "submit" && check_class($linkspage_pref['link_submit_class'])) {
+            $page = LCLAN_PAGETITLE_1." / ".LCLAN_PAGETITLE_9;
+        }
+        //define("e_PAGETITLE", strtolower($page));
+        define("e_PAGETITLE", $page);
+    }
+
+    function parse_link_append($open, $id){
+        global $linkspage_pref;
+        if($linkspage_pref['link_open_all'] && $linkspage_pref['link_open_all'] == "5"){
+            $link_open_type = $open;
+        }else{
+            $link_open_type = $linkspage_pref['link_open_all'];
+        }
+        switch ($link_open_type) {
+            case 1:
+            $link_append = "<a href='".e_PLUGIN."links_page/links.php?view.".$id."' rel='external'>";
+            break;
+            case 2:
+            $link_append = "<a href='".e_PLUGIN."links_page/links.php?view.".$id."'>";
+            break;
+            case 3:
+            $link_append = "<a href='".e_PLUGIN."links_page/links.php?view.".$id."'>";
+            break;
+            case 4:
+            $link_append = "<a href=\"javascript:open_window('".e_PLUGIN."links_page/links.php?view.".$id."')\">";
+            break;
+            default:
+            $link_append = "<a href='".e_PLUGIN."links_page/links.php?view.".$id."'>";
+        }
+        return $link_append;
+    }
+
+    function showLinkSort($mode=''){
+        global $rs, $ns, $qs, $linkspage_pref;
+
+        $check = "";
+        if($qs){
+            for($i=0;$i<count($qs);$i++){
+                if($qs[$i] && substr($qs[$i],0,5) == "order"){
+                    $check = $qs[$i];
+                    break;
+                }
+            }
+        }
+        if($check){
+            //string is like : order + a + heading
+            $checks = substr($check,6);
+            $checko = substr($check,5,1);
+        }else{
+            $checks = "";
+            $checko = "";
+        }
+        $baseurl = e_PLUGIN."links_page/links.php";
+        $qry = (isset($qs[0]) && substr($qs[0],0,5) != "order" ? $qs[0] : "").(isset($qs[1]) && substr($qs[1],0,5) != "order" ? ".".$qs[1] : "").(isset($qs[2]) && substr($qs[2],0,5) != "order" ? ".".$qs[2] : "").(isset($qs[3]) && substr($qs[3],0,5) != "order" ? ".".$qs[3] : "");
+
+        $sotext = "
+        ".$rs -> form_open("post", e_SELF, "linkorder", "", "enctype='multipart/form-data'")."
+            ".LAN_LINKS_15." 
+            ".$rs -> form_select_open("link_sort");
+            if($mode == "cat"){
+                $sotext .= "
+                ".$rs -> form_option(LAN_LINKS_4, ($checks == "heading" ? "1" : "0"), "heading", "")."
+                ".$rs -> form_option(LAN_LINKS_44, ($checks == "id" ? "1" : "0"), "id", "")."
+                ".$rs -> form_option(LAN_LINKS_6, ($checks == "order" ? "1" : "0"), "order", "");
+            }else{
+                $sotext .= "
+                ".$rs -> form_option(LAN_LINKS_4, ($checks == "heading" ? "1" : "0"), "heading", "")."
+                ".$rs -> form_option(LAN_LINKS_5, ($checks == "url" ? "1" : "0"), "url", "")."
+                ".$rs -> form_option(LAN_LINKS_6, ($checks == "order" ? "1" : "0"), "order", "")."
+                ".$rs -> form_option(LAN_LINKS_7, ($checks == "refer" ? "1" : "0"), "refer", "")."
+                ".$rs -> form_option(LAN_LINKS_38, ($checks == "date" ? "1" : "0"), "date", "");
+            }
+            $sotext .= "
+            ".$rs -> form_select_close()."
+            ".LAN_LINKS_6." 
+            ".$rs -> form_select_open("link_order")."
+            ".$rs -> form_option(LAN_LINKS_8, ($checko == "a" ? "1" : "0"), $baseurl."?".($qry ? $qry."." : "")."ordera", "")."
+            ".$rs -> form_option(LAN_LINKS_9, ($checko == "d" ? "1" : "0"), $baseurl."?".($qry ? $qry."." : "")."orderd", "")."
+            ".$rs -> form_select_close()."
+            ".$rs -> form_button("button", "submit", LCLAN_ITEM_36, "style='width:25px;' onclick=\"document.location=link_order.options[link_order.selectedIndex].value+link_sort.options[link_sort.selectedIndex].value;\"", "", "")."
+        ".$rs -> form_close();
+
+        return $sotext;
+    }
+
+    function parseOrderCat($orderstring){
+        if(substr($orderstring,6) == "heading"){
+            $orderby        = "link_category_name";
+            $orderby2       = "";
+        }elseif(substr($orderstring,6) == "id"){
+            $orderby        = "link_category_id";
+            $orderby2       = ", link_category_name ASC";
+        }elseif(substr($orderstring,6) == "order"){
+            $orderby        = "link_category_order";
+            $orderby2       = ", link_category_name ASC";
+        }else{
+            $orderstring    = "orderdheading";
+            $orderby        = "link_category_name";
+            $orderby2       = ", link_category_name ASC";
+        }
+        return $orderby." ".(substr($orderstring,5,1) == "a" ? "ASC" : "DESC")." ".$orderby2;
+    }
+
+    function parseOrderLink($orderstring){
+        if(substr($orderstring,6) == "heading"){
+            $orderby        = "link_name";
+            $orderby2       = "";
+        }elseif(substr($orderstring,6) == "url"){
+            $orderby        = "link_url";
+            $orderby2       = ", link_name ASC";
+        }elseif(substr($orderstring,6) == "refer"){
+            $orderby        = "link_refer";
+            $orderby2       = ", link_name ASC";
+        }elseif(substr($orderstring,6) == "date"){
+            $orderby        = "link_datestamp";
+            $orderby2       = ", link_name ASC";
+        }elseif(substr($orderstring,6) == "order"){
+            $orderby        = "link_order";
+            $orderby2       = ", link_name ASC";
+        }else{
+            $orderstring    = "orderaorder";
+            $orderby        = "link_order";
+            $orderby2       = ", link_name ASC";
+        }
+        return $orderby." ".(substr($orderstring,5,1) == "a" ? "ASC" : "DESC")." ".$orderby2;
+    }
+
+    function getOrder($mode=''){
+        global $qs, $linkspage_pref;
+
+        if(isset($qs[0]) && substr($qs[0],0,5) == "order"){
+            $orderstring    = $qs[0];
+        }elseif(isset($qs[1]) && substr($qs[1],0,5) == "order"){
+            $orderstring    = $qs[1];
+        }elseif(isset($qs[2]) && substr($qs[2],0,5) == "order"){
+            $orderstring    = $qs[2];
+        }elseif(isset($qs[3]) && substr($qs[3],0,5) == "order"){
+            $orderstring    = $qs[3];
+        }else{
+            if($mode == "cat"){
+                $orderstring    = "order".($linkspage_pref["link_cat_order"] == "ASC" ? "a" : "d" ).($linkspage_pref["link_cat_sort"] ? $linkspage_pref["link_cat_sort"] : "date" );
+            }else{
+                $orderstringcat = "order".($linkspage_pref["link_cat_order"] == "ASC" ? "a" : "d" ).($linkspage_pref["link_cat_sort"] ? $linkspage_pref["link_cat_sort"] : "date" );
+                
+                $orderstring    = "order".($linkspage_pref["link_order"] == "ASC" ? "a" : "d" ).($linkspage_pref["link_sort"] ? $linkspage_pref["link_sort"] : "date" );
+            }
+        }
+
+        if($mode == "cat"){
+            $str = $this -> parseOrderCat($orderstring);
+        }else{
+            if(isset($orderstringcat)){
+                $str = $this -> parseOrderCat($orderstringcat);
+                $str .= ", ".$this -> parseOrderLink($orderstring);
+            }else{
+                $str = $this -> parseOrderLink($orderstring);
+            }
+        }
+
+        $order = " ORDER BY ".$str;
+        return $order;
+    }
+
+    function show_message($message, $caption='') {
+        global $ns;
+        $ns->tablerender($caption, "<div style='text-align:center'><b>".$message."</b></div>");
+    }
+
+    function uploadLinkIcon($_POST){
+        global $ns, $pref;
+        $pref['upload_storagetype'] = "1";
+        require_once(e_HANDLER."upload_handler.php");
+        $pathicon = e_PLUGIN."links_page/link_images/";
+        $uploaded = file_upload($pathicon);
+
+        $icon = "";
+        if($uploaded) {
+            $icon = $uploaded[0]['name'];
+            if($_POST['link_resize_value']){
+                require_once(e_HANDLER."resize_handler.php");
+                resize_image($pathicon.$icon, $pathicon.$icon, $_POST['link_resize_value'], "nocopy");
+            }
+        }
+        $msg = ($icon ? LCLAN_ADMIN_7 : LCLAN_ADMIN_8);
+        $this -> show_message($msg);
+    }
+
+    function uploadCatLinkIcon($_POST){
+        global $ns, $pref;
+        $pref['upload_storagetype'] = "1";
+        require_once(e_HANDLER."upload_handler.php");
+        $pathicon = e_PLUGIN."links_page/cat_images/";
+        $uploaded = file_upload($pathicon);
+
+        $icon = "";
+        if($uploaded) {
+            $icon = $uploaded[0]['name'];
+            if($_POST['link_cat_resize_value']){
+                require_once(e_HANDLER."resize_handler.php");
+                resize_image($pathicon.$icon, $pathicon.$icon, $_POST['link_cat_resize_value'], "nocopy");
+            }
+        }
+        $msg = ($icon ? LCLAN_ADMIN_7 : LCLAN_ADMIN_8);
+        $this -> show_message($msg);
+    }
+
+    function dbCategoryCreate($_POST) {
+        global $sql, $tp;
+        $link_t = $sql->db_Count("links_page_cat", "(*)");
+        $sql->db_Insert("links_page_cat", " '0', '".$tp -> toDB($_POST['link_category_name'])."', '".$tp -> toDB($_POST['link_category_description'])."', '".$tp -> toDB($_POST['link_category_icon'])."', '".($link_t+1)."', '".$tp -> toDB($_POST['link_category_class'])."', '".time()."' ");
+        $this->show_message(LCLAN_ADMIN_4);
+    }
+    function dbCategoryUpdate($_POST) {
+        global $sql, $tp;
+        $time = ($_POST['update_datestamp'] ? time() : ($_POST['link_category_datestamp'] != "0" ? $_POST['link_category_datestamp'] : time()) );
+        $sql->db_Update("links_page_cat", "link_category_name ='".$tp -> toDB($_POST['link_category_name'])."', link_category_description='".$tp -> toDB($_POST['link_category_description'])."', link_category_icon='".$tp -> toDB($_POST['link_category_icon'])."', link_category_order='".$tp -> toDB($_POST['link_category_order'])."', link_category_class='".$tp -> toDB($_POST['link_category_class'])."', link_category_datestamp='".intval($time)."'   WHERE link_category_id='".intval($_POST['link_category_id'])."'");
+        $this->show_message(LCLAN_ADMIN_5);
+    }
+
+    function dbOrderUpdate($order) {
+        global $sql;
+        foreach ($order as $order_id) {
+            $tmp = explode(".", $order_id);
+        $sql->db_Update("links_page", "link_order=".intval($tmp[1])." WHERE link_id=".intval($tmp[0]));
+        }
+        $this->show_message(LCLAN_ADMIN_9);
+    }
+
+    function dbOrderCatUpdate($order) {
+        global $sql;
+        foreach ($order as $order_id) {
+            $tmp = explode(".", $order_id);
+            $sql->db_Update("links_page_cat", "link_category_order=".intval($tmp[1])." WHERE link_category_id=".intval($tmp[0]));
+        }
+        $this->show_message(LCLAN_ADMIN_9);
+    }
+
+    function dbOrderUpdateInc($inc) {
+        global $sql;
+        $tmp = explode(".", $inc);
+        $linkid = intval($tmp[0]);
+        $link_order = intval($tmp[1]);
+        $location = $tmp[2];
+        if(isset($location)){
+            $location = intval($location);
+            $sql->db_Update("links_page", "link_order=link_order+1 WHERE link_order='".($link_order-1)."' AND link_category='$location'");
+            $sql->db_Update("links_page", "link_order=link_order-1 WHERE link_id='$linkid' AND link_category='$location'");
+        }else{
+            $sql->db_Update("links_page_cat", "link_category_order=link_category_order+1 WHERE link_category_order='".($link_order-1)."' ");
+            $sql->db_Update("links_page_cat", "link_category_order=link_category_order-1 WHERE link_category_id='$linkid' ");
+        }
+    }
+
+    function dbOrderUpdateDec($dec) {
+        global $sql;
+        $tmp = explode(".", $dec);
+        $linkid = intval($tmp[0]);
+        $link_order = intval($tmp[1]);
+        $location = $tmp[2];
+        if(isset($location)){
+            $location = intval($location);
+            $sql->db_Update("links_page", "link_order=link_order-1 WHERE link_order='".($link_order+1)."' AND link_category='$location'");
+            $sql->db_Update("links_page", "link_order=link_order+1 WHERE link_id='$linkid' AND link_category='$location'");
+        }else{
+            $sql->db_Update("links_page_cat", "link_category_order=link_category_order-1 WHERE link_category_order='".($link_order+1)."' ");
+            $sql->db_Update("links_page_cat", "link_category_order=link_category_order+1 WHERE link_category_id='$linkid' ");
+        }
+    }
+
+    function dbLinkCreate($mode='') {
+        global $ns, $tp, $qs, $sql, $e107cache, $e_event, $linkspage_pref;
+
+        $link_name          = $tp->toDB($_POST['link_name']);
+        $link_url           = $tp->toDB($_POST['link_url']);
+        $link_description   = $tp->toDB($_POST['link_description']);
+        $link_button        = $tp->toDB($_POST['link_but']);
+        
+        if (!strstr($link_url, "http")) {
+            $link_url = "http://".$link_url;
+        }
+            
+        if(isset($mode) && $mode == "submit"){
+            if ($_POST['link_name'] && $_POST['link_url'] && $_POST['link_description']) {
+                $username           = (defined('USERNAME')) ? USERNAME : LAN_LINKS_3;
+
+                $submitted_link     = intval($_POST['cat_id'])."^".$link_name."^".$link_url."^".$link_description."^".$link_button."^".$username;
+                $sql->db_Insert("tmp", "'submitted_link', '".time()."', '$submitted_link' ");
+                
+                $edata_ls = array("link_category" => $_POST['cat_id'], "link_name" => $link_name, "link_url" => $link_url, "link_description" => $link_description, "link_button" => $link_button, "username" => $username, "submitted_link" => $submitted_link);
+                $e_event->trigger("linksub", $edata_ls);
+                //header("location:".e_SELF."?s");
+                js_location(e_SELF."?s");
+            } else {
+                message_handler("ALERT", 5);
+            }
+        }else{
+            $link_t = $sql->db_Count("links_page", "(*)", "WHERE link_category='".intval($_POST['cat_id'])."'");
+            $time   = ($_POST['update_datestamp'] ? time() : ($_POST['link_datestamp'] != "0" ? $_POST['link_datestamp'] : time()) );
+
+            if (is_numeric($qs[2]) && $qs[1] != "sn") {
+                if($qs[1] == "manage"){
+                    $link_author = USERID;
+                    //$link_class = ($linkspage_pref['link_directpost'] ? $_POST['link_class'] : "255");
+                    $link_class = $_POST['link_class'];
+                }else{
+                    $link_author = ($_POST['link_author'] ? $tp -> toDB($_POST['link_author']) : USERID);
+                    $link_class = $_POST['link_class'];
+                }
+
+                $sql->db_Update("links_page", "link_name='$link_name', link_url='$link_url', link_description='$link_description', link_button= '$link_button', link_category='".intval($_POST['cat_id'])."', link_open='".intval($_POST['linkopentype'])."', link_class='".intval($link_class)."', link_datestamp='".intval($time)."', link_author='".$link_author."' WHERE link_id='".intval($qs[2])."'");
+                $e107cache->clear("sitelinks");
+                $this->show_message(LCLAN_ADMIN_3);
+            } else {
+
+                $sql->db_Insert("links_page", "0, '$link_name', '$link_url', '$link_description', '$link_button', '".intval($_POST['cat_id'])."', '".($link_t+1)."', '0', '".intval($_POST['linkopentype'])."', '".intval($_POST['link_class'])."', '".time()."', '".USERID."' ");
+                $e107cache->clear("sitelinks");
+                $this->show_message(LCLAN_ADMIN_2);
+            }
+            if (is_numeric($qs[2]) && $qs[1] == "sn") {
+                $sql->db_Delete("tmp", "tmp_time='".intval($qs[2])."' ");
+            }
+        }
+    }
+
+    function show_link_create() {
+        global $sql, $rs, $qs, $ns, $fl, $linkspage_pref;
+
+        $row['link_category']       = "";
+        $row['link_name']           = "";
+        $row['link_url']            = "";
+        $row['link_description']    = "";
+        $row['link_button']         = "";
+        $row['link_open']           = "";
+        $row['link_class']          = "";
+        $link_resize_value          = (isset($linkspage_pref['link_resize_value']) && $linkspage_pref['link_resize_value'] ? $linkspage_pref['link_resize_value'] : "100");
+
+        if (isset($qs[1]) && $qs[1] == 'edit' && !isset($_POST['submit'])) {
+            if ($sql->db_Select("links_page", "*", "link_id='".intval($qs[2])."' ")) {
+                $row = $sql->db_Fetch();
+            }
+        }
+
+        if (isset($qs[1]) && $qs[1] == 'sn') {
+            if ($sql->db_Select("tmp", "*", "tmp_time='".intval($qs[2])."'")) {
+                $row = $sql->db_Fetch();
+                $submitted                  = explode("^", $row['tmp_info']);
+                $row['link_category']       = $submitted[0];
+                $row['link_name']           = $submitted[1];
+                $row['link_url']            = $submitted[2];
+                $row['link_description']    = $submitted[3]."\n[i]".LCLAN_ITEM_1." ".$submitted[5]."[/i]";
+                $row['link_button']         = $submitted[4];
+                
+            }
+        }
+
+        if(isset($_POST['uploadlinkicon'])){
+            $row['link_category']       = $_POST['cat_id'];
+            $row['link_name']           = $_POST['link_name'];
+            $row['link_url']            = $_POST['link_url'];
+            $row['link_description']    = $_POST['link_description'];
+            $row['link_button']         = $_POST['link_but'];
+            $row['link_open']           = $_POST['linkopentype'];
+            $row['link_class']          = $_POST['link_class'];
+            $link_resize_value          = (isset($_POST['link_resize_value']) && $_POST['link_resize_value'] ? $_POST['link_resize_value'] : $link_resize_value);
+        }
+        $width = (e_PAGE == "admin_linkspage_config.php" ? ADMIN_WIDTH : "width:100%;");
+        $text = "
+        <div style='text-align:center'>
+        ".$rs -> form_open("post", e_SELF."?".e_QUERY, "linkform", "", "enctype='multipart/form-data'", "")."
+        <table style='".$width."' class='fborder' cellspacing='0' cellpadding='0'>
+        <tr>
+        <td style='width:30%' class='forumheader3'>".LCLAN_ITEM_2."</td>
+        <td style='width:70%' class='forumheader3'>";
+
+        if (!$link_cats = $sql->db_Select("links_page_cat")) {
+            $text .= LCLAN_ITEM_3."<br />";
+        } else {
+            $text .= $rs -> form_select_open("cat_id", "");
+            while (list($cat_id, $cat_name, $cat_description) = $sql->db_Fetch()) {
+                if ( (isset($row['link_category']) && $row['link_category'] == $cat_id) || (isset($row['linkid']) && $cat_id == $row['linkid'] && $action == "add") ) {
+                    $text .= $rs -> form_option($cat_name, "1", $cat_id, "");
+                } else {
+                    $text .= $rs -> form_option($cat_name, "0", $cat_id, "");
+                }
+            }
+            $text .= $rs -> form_select_close();
+        }
+        $text .= "
+        </td>
+        </tr>
+        <tr>
+        <td style='width:30%' class='forumheader3'>".LCLAN_ITEM_4."</td>
+        <td style='width:70%' class='forumheader3'>
+            ".$rs -> form_text("link_name", 60, $row['link_name'], 100)."
+        </td>
+        </tr>
+        <tr>
+        <td style='width:30%' class='forumheader3'>".LCLAN_ITEM_5."</td>
+        <td style='width:70%' class='forumheader3'>
+            ".$rs -> form_text("link_url", 60, $row['link_url'], 200)."
+        </td>
+        </tr>
+        <tr>
+        <td style='width:30%; vertical-align:top;' class='forumheader3'>".LCLAN_ITEM_6."</td>
+        <td style='width:70%' class='forumheader3'>
+            ".$rs -> form_textarea("link_description", '59', '3', $row['link_description'], "", "", "", "", "")."
+        </td>
+        </tr>
+        <tr>
+        <td style='width:30%; vertical-align:top;' class='forumheader3'>".LCLAN_ITEM_7."</td>
+        <td style='width:70%' class='forumheader3'>";
+            if(!FILE_UPLOADS){
+                $text .= "<b>".LCLAN_ITEM_9."</b>";
+            }else{
+                if(!is_writable(e_PLUGIN."links_page/link_images/")){
+                    $text .= "<b>".LCLAN_ITEM_10." ".e_PLUGIN."links_page/link_images/ ".LCLAN_ITEM_11."</b><br />";
+                }
+                $text .= "
+                <input class='tbox' type='file' name='file_userfile[]'  size='58' /><br />
+                ".LCLAN_ITEM_8." ".$rs -> form_text("link_resize_value", 3, $link_resize_value, 3)."&nbsp;".LCLAN_ITEM_12."
+                ".$rs -> form_button("submit", "uploadlinkicon", LCLAN_ITEM_13, "", "", "");
+            }
+        $text .= "
+        </td>
+        </tr>";
+
+        $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', 'blank*');
+        $iconpath = e_PLUGIN."links_page/link_images/";
+        $iconlist = $fl->get_files($iconpath,"",$rejectlist);
+
+        $text .= "
+        <tr>
+        <td style='width:30%; vertical-align:top;' class='forumheader3'>".LCLAN_ITEM_14."</td>
+        <td style='width:70%; vertical-align:top;' class='forumheader3'>
+        <input class='tbox' type='text' name='link_but' id='link_but' size='60' value='".$row['link_button']."' maxlength='100' />
+            <div id='linkbut' style='display:block; vertical-align:top;'><table style='text-align:left; width:100%;'><tr><td style='width:20%; padding-right:10px;'>";
+            $selectjs   = " onchange=\"document.getElementById('link_but').value=this.options[this.selectedIndex].value; if(this.options[this.selectedIndex].value!=''){document.getElementById('iconview').src='".$iconpath."'+this.options[this.selectedIndex].value; document.getElementById('iconview').style.display='block';}else{document.getElementById('iconview').src='';document.getElementById('iconview').style.display='none';}\"";
+            $text       .= $rs -> form_select_open("link_button", $selectjs);
+            $text       .= $rs -> form_option(LCLAN_ITEM_34, ($row['link_button'] ? "0" : "1"), "");
+            foreach($iconlist as $icon){
+                $text   .= $rs -> form_option($icon['fname'], ($icon['fname'] == $row['link_button'] ? "1" : "0"), $icon['fname'] );
+            }
+            $text .= $rs -> form_select_close();
+            if(isset($row['link_button']) && $row['link_button']){
+                $img = $iconpath.$row['link_button'];
+            }else{
+                $blank_display = 'display: none';
+                $img = e_PLUGIN."links_page/images/blank.gif";
+            }
+            $text .= "</td><td><img id='iconview' src='".$img."' style='width:".$link_resize_value."px; border:0; ".$blank_display."' /><br /><br /></td></tr></table>";
+            $text .= "</div>
+        </td>
+        </tr>";
+
+        //0=same window, 1=_blank, 2=_parent, 3=_top, 4=miniwindow
+        $text .= "
+        <tr>
+        <td style='width:30%; vertical-align:top;' class='forumheader3'>".LCLAN_ITEM_16."</td>
+        <td style='width:70%' class='forumheader3'>
+            ".$rs -> form_select_open("linkopentype")."
+            ".$rs -> form_option(LCLAN_ITEM_17, ($row['link_open'] == "0" ? "1" : "0"), "0", "")."
+            ".$rs -> form_option(LCLAN_ITEM_18, ($row['link_open'] == "1" ? "1" : "0"), "1", "")."
+            ".$rs -> form_option(LCLAN_ITEM_19, ($row['link_open'] == "4" ? "1" : "0"), "4", "")."
+            ".$rs -> form_select_close()."
+        </td>
+        </tr>
+        <tr>
+        <td style='width:30%; vertical-align:top;' class='forumheader3'>".LCLAN_ITEM_20."</td>
+        <td style='width:70%' class='forumheader3'>
+            ".r_userclass("link_class", $row['link_class'], "off", "public,guest,nobody,member,admin,classes")."
+        </td>
+        </tr>
+        <tr style='vertical-align:top'>
+        <td colspan='2' style='text-align:center' class='forumheader'>";
+        if (isset($qs[2]) && $qs[2] && $qs[1] == "edit") {
+            $text .= $rs -> form_hidden("link_datestamp", $row['link_datestamp']);
+            $text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".LCLAN_ITEM_21."<br /><br />";
+            $text .= $rs -> form_button("submit", "add_link", LCLAN_ITEM_22, "", "", "").$rs -> form_hidden("link_id", $row['link_id']);
+        } else {
+            $text .= $rs -> form_button("submit", "add_link", LCLAN_ITEM_23, "", "", "");
+        }
+        $text .= "</td>
+        </tr>
+        </table>
+        ".$rs -> form_close()."
+        </div>";
+
+        $ns->tablerender(LCLAN_ITEM_24, $text);
+    }
+
+    function show_links() {
+        global $sql, $qs, $rs, $ns, $tp, $from;
+        $number = "20";
+
+        if($qs[2] == "all"){
+            $caption = LCLAN_ITEM_38;
+            $qry = " link_id != '' ORDER BY link_category ASC, link_order ASC";
+        }else{
+            if ($sql->db_Select("links_page_cat", "link_category_name", "link_category_id='".intval($qs[2])."' " )) {
+                $row = $sql->db_Fetch();
+                $caption = LCLAN_ITEM_2." ".$row['link_category_name'];
+            }
+            $qry = " link_category=".intval($qs[2])." ORDER BY link_order, link_id ASC";
+        }
+
+        $link_total = $sql->db_Select("links_page", "*", " ".$qry." ");
+        if (!$sql->db_Select("links_page", "*", " ".$qry." LIMIT ".intval($from).",".intval($number)." ")) {
+            js_location(e_SELF."?link");
+        }else{
+            $text = $rs->form_open("post", e_SELF.(e_QUERY ? "?".e_QUERY : ""), "myform_{$row['link_id']}", "", "");
+            $text .= "<div style='text-align:center'>
+            <table class='fborder' style='".ADMIN_WIDTH."'>
+            <tr>
+            <td class='fcaption' style='width:5%'>".LCLAN_ITEM_25."</td>
+            <td class='fcaption' style='width:65%'>".LCLAN_ITEM_26."</td>
+            <td class='fcaption' style='width:10%'>".LCLAN_ITEM_27."</td>
+            <td class='fcaption' style='width:10%'>".LCLAN_ITEM_28."</td>
+            <td class='fcaption' style='width:10%'>".LCLAN_ITEM_29."</td>
+            </tr>";
+            while ($row = $sql->db_Fetch()) {
+                $linkid = $row['link_id'];
+                $img = "";
+                if ($row['link_button']) {
+                    if (strpos($row['link_button'], "http://") !== FALSE) {
+                        $img = "<img style='border:0;' src='".$row['link_button']."' alt='".$LINK_CAT_NAME."' />";
+                    } else {
+                        if(strstr($row['link_button'], "/")){
+                            $img = "<img style='border:0;' src='".e_BASE.$row['link_button']."' alt='".$LINK_CAT_NAME."' />";
+                        }else{
+                            $img = "<img style='border:0' src='".e_PLUGIN."links_page/link_images/".$row['link_button']."' alt='".$LINK_CAT_NAME."' />";
+                        }
+                    }
+                }
+                if($row['link_order'] == "1"){
+                    $up = "&nbsp;&nbsp;&nbsp;";
+                }else{
+                    $up = "<input type='image' src='".LINK_ICON_ORDER_UP_BASE."' value='".$linkid.".".$row['link_order'].".".$row['link_category']."' name='inc' />";
+                }
+                if($row['link_order'] == $link_total){
+                    $down = "&nbsp;&nbsp;&nbsp;";
+                }else{
+                    $down = "<input type='image' src='".LINK_ICON_ORDER_DOWN_BASE."' value='".$linkid.".".$row['link_order'].".".$row['link_category']."' name='dec' />";
+                }
+                $text .= "
+                <tr>
+                <td class='forumheader3' style='width:5%; text-align: center; vertical-align: middle'>".$img."</td>
+                <td style='width:65%' class='forumheader3'>
+                    <a href='".e_PLUGIN."links_page/links.php?".$row['link_id']."' rel='external'>".LINK_ICON_LINK."</a> ".$row['link_name']."
+                </td>
+                <td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
+                    <a href='".e_SELF."?link.edit.".$linkid."' title='".LCLAN_ITEM_31."'>".LINK_ICON_EDIT."</a>
+                    <input type='image' title='delete' name='delete[main_{$linkid}]' alt='".LCLAN_ITEM_32."' src='".LINK_ICON_DELETE_BASE."' onclick=\"return jsconfirm('".$tp->toJS(LCLAN_ITEM_33." [ ".$row['link_name']." ]")."')\" />
+                </td>
+                <td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
+                    ".$up."
+                    ".$down."
+                </td>
+                <td style='width:10%; text-align:center' class='forumheader3'>
+                    <select name='link_order[]' class='tbox'>";
+                    //".$rs -> form_select_open("link_order[]");
+                    for($a = 1; $a <= $link_total; $a++) {
+                        $text .= $rs -> form_option($a, ($row['link_order'] == $a ? "1" : "0"), $linkid.".".$a, "");
+                    }
+                    $text .= $rs -> form_select_close()."
+                </td>
+                </tr>";
+            }
+            $text .= "
+            <tr>
+            <td class='forumheader' colspan='4'>&nbsp;</td>
+            <td class='forumheader' style='width:5%; text-align:center'>
+            ".$rs->form_button("submit", "update_order", LCLAN_ITEM_30)."
+            </td>
+            </tr>
+            </table></div>
+            ".$rs->form_close();
+        }
+        $ns->tablerender($caption, $text);
+
+        require_once(e_HANDLER."np_class.php");
+        $np_querystring = (isset($qs[0]) ? $qs[0] : "").(isset($qs[1]) ? ".".$qs[1] : "").(isset($qs[2]) ? ".".$qs[2] : "");
+        $ix = new nextprev(e_SELF, $from, $number, $link_total, NP_3, ($np_querystring ? $np_querystring : ""));
+    }
+
+    function show_cat_create() {
+        global $qs, $sql, $rs, $ns, $tp, $fl;
+
+        $row['link_category_name']          = "";
+        $row['link_category_description']   = "";
+        $row['link_category_icon']          = "";
+        $link_cat_resize_value              = (isset($linkspage_pref['link_cat_resize_value']) && $linkspage_pref['link_cat_resize_value'] ? $linkspage_pref['link_cat_resize_value'] : "50");
+
+        if(isset($_POST['uploadcatlinkicon'])){
+            $row['link_category_name']          = $_POST['link_category_name'];
+            $row['link_category_description']   = $_POST['link_category_description'];
+            $row['link_category_icon']          = $_POST['link_category_icon'];
+            $link_cat_resize_value              = (isset($_POST['link_cat_resize_value']) && $_POST['link_cat_resize_value'] ? $_POST['link_cat_resize_value'] : $link_cat_resize_value);
+        }
+        if ($qs[1] == "edit") {
+            if ($sql->db_Select("links_page_cat", "*", "link_category_id='".intval($qs[2])."' ")) {
+                $row = $sql->db_Fetch();
+            }
+        }
+        if(isset($_POST['category_clear'])){
+            $row['link_category_name']          = "";
+            $row['link_category_description']   = "";
+            $row['link_category_icon']          = "";
+        }
+        $rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*');
+        $iconlist = $fl->get_files(e_PLUGIN."links_page/cat_images/","",$rejectlist);
+
+        $text = "<div style='text-align:center'>
+        ".$rs->form_open("post", e_SELF.(e_QUERY ? "?".e_QUERY : ""), "linkform", "", "enctype='multipart/form-data'", "")."
+        <table class='fborder' style='".ADMIN_WIDTH."'>
+        <tr>
+        <td class='forumheader3' style='width:30%'>".LCLAN_CAT_13."</td>
+        <td class='forumheader3' style='width:70%'>".$rs->form_text("link_category_name", 50, $row['link_category_name'], 200)."</td>
+        </tr>
+        <tr>
+        <td class='forumheader3' style='width:30%; vertical-align:top;'>".LCLAN_CAT_14."</td>
+        <td class='forumheader3' style='width:70%'>".$rs->form_text("link_category_description", 60, $row['link_category_description'], 200)."</td>
+        </tr>
+        <tr>
+        <td style='width:30%; vertical-align:top;' class='forumheader3'>".LCLAN_CAT_15."</td>
+        <td style='width:70%' class='forumheader3'>";
+            if(!FILE_UPLOADS){
+                $text .= "<b>".LCLAN_CAT_17."</b>";
+            }else{
+                if(!is_writable(e_PLUGIN."links_page/cat_images/")){
+                    $text .= "<b>".LCLAN_CAT_18." ".e_PLUGIN."links_page/cat_images/ ".LCLAN_CAT_19."</b><br />";
+                }
+                $text .= "
+                <input class='tbox' type='file' name='file_userfile[]'  size='58' /><br />
+                ".LCLAN_CAT_16." ".$rs -> form_text("link_cat_resize_value", 3, $link_cat_resize_value, 3)."&nbsp;".LCLAN_CAT_20."
+                ".$rs -> form_button("submit", "uploadcatlinkicon", LCLAN_CAT_21, "", "", "");
+            }
+        $text .= "
+        </td>
+        </tr>
+        <tr>
+        <td style='width:30%; vertical-align:top;' class='forumheader3'>".LCLAN_CAT_22."</td>
+        <td style='width:70%' class='forumheader3'>
+            ".$rs -> form_text("link_category_icon", 60, $row['link_category_icon'], 100)."
+            ".$rs -> form_button("button", '', LCLAN_CAT_23, "onclick=\"expandit('catico')\"")."
+            <div id='catico' style='{head}; display:none'>";
+            foreach($iconlist as $icon){
+                $text .= "<a href=\"javascript:insertext('".$icon['fname']."','link_category_icon','catico')\"><img src='".$icon['path'].$icon['fname']."' style='border:0' alt='' /></a> ";
+            }
+            $text .= "</div>
+        </td>
+        </tr>
+        <tr>
+        <td style='width:30%; vertical-align:top;' class='forumheader3'>".LCLAN_CAT_24."</td>
+        <td style='width:70%' class='forumheader3'>
+            ".r_userclass("link_category_class", $row['link_category_class'], "off", "public,guest,nobody,member,admin,classes")."
+        </td>
+        </tr>
+        <tr><td colspan='2' style='text-align:center' class='forumheader'>";
+        if (is_numeric($qs[2])) {
+            $text .= $rs -> form_hidden("link_category_order", $row['link_category_order']);
+            $text .= $rs -> form_hidden("link_category_datestamp", $row['link_category_datestamp']);
+            $text .= $rs -> form_checkbox("update_datestamp", 1, 0)." ".LCLAN_CAT_25."<br /><br />";
+            $text .= $rs -> form_button("submit", "update_category", LCLAN_CAT_26, "", "", "");
+            $text .= $rs -> form_button("submit", "category_clear", LCLAN_CAT_27). $rs->form_hidden("link_category_id", $qs[2]);
+
+        } else {
+            $text .= $rs -> form_button("submit", "create_category", LCLAN_CAT_28, "", "", "");
+        }
+        $text .= "</td></tr></table>
+        ".$rs->form_close()."
+        </div>";
+
+        $ns->tablerender(LCLAN_CAT_29, $text);
+        unset($row['link_category_name'], $row['link_category_description'], $row['link_category_icon']);
+    }
+
+    function show_categories($mode) {
+        global $sql, $rs, $ns, $tp, $fl;
+
+        if ($category_total = $sql->db_Select("links_page_cat", "*", "ORDER BY link_category_order ASC", "mode=no_where")) {
+            $text = "
+            <div style='text-align: center'>
+            ".$rs->form_open("post", e_SELF.(e_QUERY ? "?".e_QUERY : ""), "", "", "")."
+            <table class='fborder' style='".ADMIN_WIDTH."'>
+            <tr>
+            <td style='width:5%' class='fcaption'>".LCLAN_CAT_1."</td>
+            <td class='fcaption'>".LCLAN_CAT_2."</td>
+            <td style='width:10%' class='fcaption'>".LCLAN_CAT_3."</td>";
+            if($mode == "cat"){
+                $text .= "
+                <td class='fcaption' style='width:10%'>".LCLAN_CAT_4."</td>
+                <td class='fcaption' style='width:10%'>".LCLAN_CAT_5."</td>";
+            }
+            $text .= "
+            </tr>";
+            while ($row = $sql->db_Fetch()) {
+                $linkcatid = $row['link_category_id'];
+                if ($row['link_category_icon']) {
+                    $img = (strstr($row['link_category_icon'], "/") ? "<img src='".e_BASE.$row['link_category_icon']."' alt='' style='vertical-align:middle' />" : "<img src='".e_PLUGIN."links_page/cat_images/".$row['link_category_icon']."' alt='' style='vertical-align:middle' />");
+                } else {
+                    $img = "&nbsp;";
+                }
+                $text .= "
+                <tr>
+                <td style='width:5%; text-align:center' class='forumheader3'>".$img."</td>
+                <td class='forumheader3'>
+                    <a href='".e_PLUGIN."links_page/links.php?cat.".$linkcatid."' rel='external'>".LINK_ICON_LINK."</a>
+                    ".$row['link_category_name']."<br /><span class='smalltext'>".$row['link_category_description']."</span>
+                </td>";
+                if($mode == "cat"){
+                    if($row['link_category_order'] == "1"){
+                        $up = "&nbsp;&nbsp;&nbsp;";
+                    }else{
+                        $up = "<input type='image' src='".LINK_ICON_ORDER_UP_BASE."' value='".$linkcatid.".".$row['link_category_order']."' name='inc' />";
+                    }
+                    if($row['link_category_order'] == $category_total){
+                        $down = "&nbsp;&nbsp;&nbsp;";
+                    }else{
+                        $down = "<input type='image' src='".LINK_ICON_ORDER_DOWN_BASE."' value='".$linkcatid.".".$row['link_category_order']."' name='dec' />";
+                    }
+                    $text .= "
+                    <td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
+                        <a href='".e_SELF."?cat.edit.".$linkcatid."' title='".LCLAN_CAT_6."'>".LINK_ICON_EDIT."</a>
+                        <input type='image' title='delete' name='delete[category_{$linkcatid}]' alt='".LCLAN_CAT_7."' src='".LINK_ICON_DELETE_BASE."' onclick=\"return jsconfirm('".$tp->toJS(LCLAN_CAT_8." [ ".$row['link_category_name']." ]")."')\"/>
+                    </td>
+                    <td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
+                        ".$up."
+                        ".$down."
+                    </td>
+                    <td style='width:10%; text-align:center' class='forumheader3'>
+                        <select name='link_category_order[]' class='tbox'>";
+                        for($a = 1; $a <= $category_total; $a++) {
+                            $text .= $rs -> form_option($a, ($row['link_category_order'] == $a ? "1" : "0"), $linkcatid.".".$a, "");
+                        }
+                        $text .= $rs -> form_select_close()."
+                    </td>";
+                }else{
+                    $text .= "<td style='width:10%; text-align:center; white-space: nowrap' class='forumheader3'>
+                    <a href='".e_SELF."?link.view.".$linkcatid."' title='".LCLAN_CAT_9."'>".LINK_ICON_EDIT."</a></td>";
+                }
+                $text .= "
+                </tr>\n";
+            }
+            if($mode == "cat"){
+                $text .= "
+                <tr>
+                <td class='forumheader' colspan='4'>&nbsp;</td>
+                <td class='forumheader' style='width:5%; text-align:center'>
+                ".$rs->form_button("submit", "update_category_order", LCLAN_CAT_10)."
+                </td>
+                </tr>";
+            }else{
+                $text .= "
+                <tr>
+                <td class='forumheader' colspan='2'>&nbsp;</td>
+                <td class='forumheader' style='width:5%; text-align:center'>".$rs->form_button("button", "viewalllinks", LCLAN_ITEM_37, "onclick=\"document.location='".e_SELF."?link.view.all';\"")."
+                </td>
+                </tr>";
+            }
+            $text .= "
+            </table>
+            ".$rs->form_close()."
+            </div>";
+        } else {
+            $text = "<div style='text-align:center'>".LCLAN_CAT_11."</div>";
+        }
+        $ns->tablerender(LCLAN_CAT_12, $text);
+        unset($row['link_category_name'], $row['link_category_description'], $row['link_category_icon']);
+    }
+
+    function show_submitted() {
+        global $sql, $rs, $qs, $ns, $tp;
+
+        if (!$submitted_total = $sql->db_Select("tmp", "*", "tmp_ip='submitted_link' ")) {
+            $text = "<div style='text-align:center'>".LCLAN_SL_2."</div>";
+        }else{
+            $text = "
+            ".$rs->form_open("post", e_SELF."?sn", "submitted_links")."
+            <table class='fborder' style='".ADMIN_WIDTH."'>
+            <tr>
+            <td style='width:60%' class='fcaption'>".LCLAN_SL_3."</td>
+            <td style='width:30%' class='fcaption'>".LCLAN_SL_4."</td>
+            <td style='width:10%; white-space:nowrap; text-align:center' class='fcaption'>".LCLAN_SL_5."</td>
+            </tr>";
+            while ($row = $sql->db_Fetch()) {
+                $tmp_time = $row['tmp_time'];
+                $submitted = explode("^", $row['tmp_info']);
+                if (!strstr($submitted[2], "http")) {
+                    $submitted[2] = "http://".$submitted[2];
+                }
+                $text .= "<tr>
+                <td style='width:60%' class='forumheader3'><a href='".$submitted[2]."' rel='external'>".$submitted[2]."</a></td>
+                <td style='width:30%' class='forumheader3'>".$submitted[5]."</td>
+                <td style='width:10%; white-space:nowrap; text-align:center; vertical-align:top' class='forumheader3'>
+                    <a href='".e_SELF."?link.sn.".$tmp_time."' title='".LCLAN_SL_6."'>".LINK_ICON_EDIT."</a>
+                    <input type='image' title='delete' name='delete[sn_{$tmp_time}]' alt='".LCLAN_SL_7."' src='".LINK_ICON_DELETE_BASE."' onclick=\"return jsconfirm('".$tp->toJS(LCLAN_SL_8." [ ".$tmp_time." ]")."')\" />
+                </td>
+                </tr>\n";
+            }
+            $text .= "</table>".$rs->form_close();
+        }
+        $ns->tablerender(LCLAN_SL_1, $text);
+    }
+
+    function show_pref_options() {
+        global $linkspage_pref, $ns, $rs, $pref;
+
+        $text = "
+        <script type=\"text/javascript\">
+        <!--
+        var hideid=\"optgeneral\";
+        function showhideit(showid){
+            if (hideid!=showid){
+                show=document.getElementById(showid).style;
+                hide=document.getElementById(hideid).style;
+                show.display=\"\";
+                hide.display=\"none\";
+                
+                //showh=document.getElementById(showid+'help').style;
+                //hideh=document.getElementById(hideid+'help').style;
+                //showh.display=\"\";
+                //hideh.display=\"none\";
+                
+                hideid = showid;
+            }
+        }
+        //-->
+        </script>";
+
+        $TOPIC_ROW = "
+        <tr>
+            <td class='forumheader3' style='width:25%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
+            <td class='forumheader3' style='vertical-align:top;'>{TOPIC_FIELD}</td>
+        </tr>";
+
+        $TOPIC_TITLE_ROW = "<tr><td colspan='2' class='fcaption'>{TOPIC_CAPTION}</td></tr>";
+        $TOPIC_ROW_SPACER = "<tr><td style='height:20px;' colspan='2'></td></tr>";
+        $TOPIC_TABLE_END = $this->pref_submit()."</table></div>";
+
+        $text .= "
+        <div style='text-align:center'>
+        ".$rs -> form_open("post", e_SELF."?".e_QUERY, "optform", "", "", "")."
+
+        <div id='optgeneral' style='text-align:center'>
+        <table style='".ADMIN_WIDTH."' class='fborder'>";
+
+        $TOPIC_CAPTION = LCLAN_OPT_MENU_1;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_7;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_page_categories", "1", ($linkspage_pref['link_page_categories'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_page_categories", "0", ($linkspage_pref['link_page_categories'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_8;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_submit", "1", ($linkspage_pref['link_submit'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_submit", "0", ($linkspage_pref['link_submit'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_9;
+        $TOPIC_FIELD = r_userclass("link_submit_class", $linkspage_pref['link_submit_class']);
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_48;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_submit_directpost", "1", ($linkspage_pref['link_submit_directpost'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_submit_directpost", "0", ($linkspage_pref['link_submit_directpost'] ? "0" : "1"), "", "").LCLAN_OPT_4."<br />".LCLAN_OPT_49;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        //link_nextprev
+        $TOPIC_TOPIC = LCLAN_OPT_10;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_nextprev", "1", ($linkspage_pref["link_nextprev"] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_nextprev", "0", ($linkspage_pref["link_nextprev"] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        //link_nextprev_number
+        $TOPIC_TOPIC = LCLAN_OPT_11;
+        $TOPIC_FIELD = $rs -> form_select_open("link_nextprev_number");
+        for($i=2;$i<52;$i++){
+            $TOPIC_FIELD .= $rs -> form_option($i, ($linkspage_pref["link_nextprev_number"] == $i ? "1" : "0"), $i);
+            $i++;
+        }
+        $TOPIC_FIELD .= $rs -> form_select_close();
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        //link_comment
+        $TOPIC_TOPIC = LCLAN_OPT_55;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_comment", "1", ($linkspage_pref["link_comment"] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_comment", "0", ($linkspage_pref["link_comment"] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_27;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_rating", "1", ($linkspage_pref['link_rating'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_rating", "0", ($linkspage_pref['link_rating'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_62;
+        $TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap; width:20%;'>
+        ".$rs -> form_checkbox("link_navigator_frontpage", 1, ($linkspage_pref['link_navigator_frontpage'] ? "1" : "0"))." ".LCLAN_OPT_60."<br />
+        ".$rs -> form_checkbox("link_navigator_submit", 1, ($linkspage_pref['link_navigator_submit'] ? "1" : "0"))." ".LCLAN_OPT_58."<br />
+        ".$rs -> form_checkbox("link_navigator_manager", 1, ($linkspage_pref['link_navigator_manager'] ? "1" : "0"))." ".LCLAN_OPT_59."<br />
+        ".$rs -> form_checkbox("link_navigator_refer", 1, ($linkspage_pref['link_navigator_refer'] ? "1" : "0"))." ".LCLAN_OPT_20."<br />
+        </td><td style='white-space:nowrap;'>
+        ".$rs -> form_checkbox("link_navigator_rated", 1, ($linkspage_pref['link_navigator_rated'] ? "1" : "0"))." ".LCLAN_OPT_21."<br />
+        ".$rs -> form_checkbox("link_navigator_allcat", 1, ($linkspage_pref['link_navigator_allcat'] ? "1" : "0"))." ".LCLAN_OPT_66."<br />
+        ".$rs -> form_checkbox("link_navigator_links", 1, ($linkspage_pref['link_navigator_links'] ? "1" : "0"))." ".LCLAN_OPT_67."<br />
+        ".$rs -> form_checkbox("link_navigator_category", 1, ($linkspage_pref['link_navigator_category'] ? "1" : "0"))." ".LCLAN_OPT_61."<br />
+        </td></tr></table>";
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $text .= $TOPIC_TABLE_END;
+
+        $text .= "
+        <div id='optmanager' style='display:none; text-align:center'>
+        <table style='".ADMIN_WIDTH."' class='fborder'>";
+
+        $TOPIC_CAPTION = LCLAN_OPT_MENU_2;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_54;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_manager", "1", ($linkspage_pref['link_manager'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_manager", "0", ($linkspage_pref['link_manager'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+        
+        $TOPIC_TOPIC = LCLAN_OPT_46;
+        $TOPIC_FIELD = r_userclass("link_manager_class", $linkspage_pref['link_manager_class'])."<br />".LCLAN_OPT_47;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_48;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_directpost", "1", ($linkspage_pref['link_directpost'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_directpost", "0", ($linkspage_pref['link_directpost'] ? "0" : "1"), "", "").LCLAN_OPT_4."<br />".LCLAN_OPT_49;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_50;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_directdelete", "1", ($linkspage_pref['link_directdelete'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_directdelete", "0", ($linkspage_pref['link_directdelete'] ? "0" : "1"), "", "").LCLAN_OPT_4."<br />".LCLAN_OPT_51;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $text .= $TOPIC_TABLE_END;
+
+        $text .= "
+        <div id='optcategory' style='display:none; text-align:center'>
+        <table style='".ADMIN_WIDTH."' class='fborder'>";
+
+        $TOPIC_CAPTION = LCLAN_OPT_MENU_3;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_13;
+        $TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap; width:20%;'>
+        ".$rs -> form_checkbox("link_cat_icon", 1, ($linkspage_pref['link_cat_icon'] ? "1" : "0"))." ".LCLAN_OPT_14."<br />
+        ".$rs -> form_checkbox("link_cat_desc", 1, ($linkspage_pref['link_cat_desc'] ? "1" : "0"))." ".LCLAN_OPT_15."<br />
+        </td><td style='white-space:nowrap;'>
+        ".$rs -> form_checkbox("link_cat_amount", 1, ($linkspage_pref['link_cat_amount'] ? "1" : "0"))." ".LCLAN_OPT_16."<br />
+        ".$rs -> form_checkbox("link_cat_total", 1, ($linkspage_pref['link_cat_total'] ? "1" : "0"))." ".LCLAN_OPT_19."<br />
+        </td></tr></table>";
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_65;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_cat_empty", "1", ($linkspage_pref['link_cat_empty'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_cat_empty", "0", ($linkspage_pref['link_cat_empty'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_22;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_cat_icon_empty", "1", ($linkspage_pref['link_cat_icon_empty'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_cat_icon_empty", "0", ($linkspage_pref['link_cat_icon_empty'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_29;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_cat_sortorder", "1", ($linkspage_pref['link_cat_sortorder'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_cat_sortorder", "0", ($linkspage_pref['link_cat_sortorder'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_23;
+        $TOPIC_FIELD = "
+        ".$rs -> form_select_open("link_cat_sort")."
+        ".$rs -> form_option(LCLAN_OPT_40, ($linkspage_pref['link_cat_sort'] == "heading" ? "1" : "0"), "heading", "")."
+        ".$rs -> form_option(LCLAN_OPT_41, ($linkspage_pref['link_cat_sort'] == "id" ? "1" : "0"), "id", "")."
+        ".$rs -> form_option(LCLAN_OPT_36, ($linkspage_pref['link_cat_sort'] == "order" ? "1" : "0"), "order", "")."
+        ".$rs -> form_select_close();
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_24;
+        $TOPIC_FIELD = "
+        ".$rs -> form_select_open("link_cat_order")."
+        ".$rs -> form_option(LCLAN_OPT_30, ($linkspage_pref['link_cat_order'] == "ASC" ? "1" : "0"), "ASC", "")."
+        ".$rs -> form_option(LCLAN_OPT_31, ($linkspage_pref['link_cat_order'] == "DESC" ? "1" : "0"), "DESC", "")."
+        ".$rs -> form_select_close();
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_25;
+        $TOPIC_FIELD = $rs -> form_text("link_cat_resize_value", "3", $linkspage_pref['link_cat_resize_value'], "3", "tbox", "", "", "")." ".LCLAN_OPT_5;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $text .= $TOPIC_TABLE_END;
+
+        $text .= "
+        <div id='optlinks' style='display:none; text-align:center'>
+        <table style='".ADMIN_WIDTH."' class='fborder'>";
+
+        $TOPIC_CAPTION = LCLAN_OPT_MENU_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_13;
+        $TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap; width:20%;'>
+        ".$rs -> form_checkbox("link_icon", 1, ($linkspage_pref['link_icon'] ? "1" : "0"))." ".LCLAN_OPT_14."<br />
+        ".$rs -> form_checkbox("link_referal", 1, ($linkspage_pref['link_referal'] ? "1" : "0"))." ".LCLAN_OPT_17."<br />
+        </td><td style='white-space:nowrap;'>
+        ".$rs -> form_checkbox("link_url", 1, ($linkspage_pref['link_url'] ? "1" : "0"))." ".LCLAN_OPT_18."<br />
+        ".$rs -> form_checkbox("link_desc", 1, ($linkspage_pref['link_desc'] ? "1" : "0"))." ".LCLAN_OPT_15."<br />
+        </td></tr></table>";
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_28;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_icon_empty", "1", ($linkspage_pref['link_icon_empty'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_icon_empty", "0", ($linkspage_pref['link_icon_empty'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_29;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_sortorder", "1", ($linkspage_pref['link_sortorder'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_sortorder", "0", ($linkspage_pref['link_sortorder'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_23;
+        $TOPIC_FIELD = "
+        ".$rs -> form_select_open("link_sort")."
+        ".$rs -> form_option(LCLAN_OPT_34, ($linkspage_pref['link_sort'] == "heading" ? "1" : "0"), "heading", "")."
+        ".$rs -> form_option(LCLAN_OPT_35, ($linkspage_pref['link_sort'] == "url" ? "1" : "0"), "url", "")."
+        ".$rs -> form_option(LCLAN_OPT_36, ($linkspage_pref['link_sort'] == "order" ? "1" : "0"), "order", "")."
+        ".$rs -> form_option(LCLAN_OPT_37, ($linkspage_pref['link_sort'] == "refer" ? "1" : "0"), "refer", "")."
+        ".$rs -> form_option(LCLAN_OPT_53, ($linkspage_pref['link_sort'] == "date" ? "1" : "0"), "date", "")."
+        ".$rs -> form_select_close();
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_24;
+        $TOPIC_FIELD = "
+        ".$rs -> form_select_open("link_order")."
+        ".$rs -> form_option(LCLAN_OPT_30, ($linkspage_pref['link_order'] == "ASC" ? "1" : "0"), "ASC", "")."
+        ".$rs -> form_option(LCLAN_OPT_31, ($linkspage_pref['link_order'] == "DESC" ? "1" : "0"), "DESC", "")."
+        ".$rs -> form_select_close();
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        //0=same window, 1=_blank, 2=_parent, 3=_top, 4=miniwindow
+        $TOPIC_TOPIC = LCLAN_OPT_32;
+        $TOPIC_FIELD = "
+        ".$rs -> form_select_open("link_open_all")."
+        ".$rs -> form_option(LCLAN_OPT_42, ($linkspage_pref['link_open_all'] == "5" ? "1" : "0"), "5", "")."
+        ".$rs -> form_option(LCLAN_OPT_43, ($linkspage_pref['link_open_all'] == "0" ? "1" : "0"), "0", "")."
+        ".$rs -> form_option(LCLAN_OPT_44, ($linkspage_pref['link_open_all'] == "1" ? "1" : "0"), "1", "")."
+        ".$rs -> form_option(LCLAN_OPT_45, ($linkspage_pref['link_open_all'] == "4" ? "1" : "0"), "4", "")."
+        ".$rs -> form_select_close();
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_33;
+        $TOPIC_FIELD = $rs -> form_text("link_resize_value", "3", $linkspage_pref['link_resize_value'], "3", "tbox", "", "", "")." ".LCLAN_OPT_5;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $text .= $TOPIC_TABLE_END;
+
+        $text .= "
+        <div id='optrefer' style='display:none; text-align:center'>
+        <table style='".ADMIN_WIDTH."' class='fborder'>";
+
+        $TOPIC_CAPTION = LCLAN_OPT_MENU_5;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_56;
+        $TOPIC_FIELD = $rs -> form_text("link_refer_minimum", "3", $linkspage_pref['link_refer_minimum'], "3", "tbox", "", "", "")." ".LCLAN_OPT_57;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $text .= $TOPIC_TABLE_END;
+
+        $text .= "
+        <div id='optrating' style='display:none; text-align:center'>
+        <table style='".ADMIN_WIDTH."' class='fborder'>";
+
+        $TOPIC_CAPTION = LCLAN_OPT_MENU_6;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_63;
+        $TOPIC_FIELD = "";
+        $TOPIC_FIELD = $rs -> form_text("link_rating_minimum", "3", $linkspage_pref['link_rating_minimum'], "3", "tbox", "", "", "")." ".LCLAN_OPT_64;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $text .= $TOPIC_TABLE_END;
+
+
+
+
+
+
+        $text .= "
+        <div id='optmenu' style='display:none; text-align:center'>
+        <table style='".ADMIN_WIDTH."' class='fborder'>";
+
+        $TOPIC_CAPTION = LCLAN_OPT_MENU_7;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_TITLE_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_85;
+        $TOPIC_FIELD = $rs -> form_text("link_menu_caption", "15", $linkspage_pref['link_menu_caption'], "100", "tbox", "", "", "");
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+
+        $TOPIC_TOPIC = LCLAN_OPT_62;
+        $TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap; width:20%;'>
+        ".$rs -> form_checkbox("link_menu_navigator_frontpage", 1, ($linkspage_pref['link_menu_navigator_frontpage'] ? "1" : "0"))." ".LCLAN_OPT_60."<br />
+        ".$rs -> form_checkbox("link_menu_navigator_submit", 1, ($linkspage_pref['link_menu_navigator_submit'] ? "1" : "0"))." ".LCLAN_OPT_58."<br />
+        ".$rs -> form_checkbox("link_menu_navigator_manager", 1, ($linkspage_pref['link_menu_navigator_manager'] ? "1" : "0"))." ".LCLAN_OPT_59."<br />
+        ".$rs -> form_checkbox("link_menu_navigator_refer", 1, ($linkspage_pref['link_menu_navigator_refer'] ? "1" : "0"))." ".LCLAN_OPT_20."<br />
+        </td><td style='white-space:nowrap;'>
+        ".$rs -> form_checkbox("link_menu_navigator_rated", 1, ($linkspage_pref['link_menu_navigator_rated'] ? "1" : "0"))." ".LCLAN_OPT_21."<br />
+        ".$rs -> form_checkbox("link_menu_navigator_links", 1, ($linkspage_pref['link_menu_navigator_links'] ? "1" : "0"))." ".LCLAN_OPT_67."<br />
+        ".$rs -> form_checkbox("link_menu_navigator_category", 1, ($linkspage_pref['link_menu_navigator_category'] ? "1" : "0"))." ".LCLAN_OPT_61."<br />
+        </td></tr></table>";
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_79;
+        $TOPIC_FIELD = $rs -> form_text("link_menu_navigator_caption", "15", $linkspage_pref['link_menu_navigator_caption'], "100", "tbox", "", "", "");
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+        
+        $TOPIC_TOPIC = LCLAN_OPT_69;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_menu_navigator_rendertype", "1", ($linkspage_pref['link_menu_navigator_rendertype'] ? "1" : "0"), "", "").LCLAN_OPT_76."
+        ".$rs -> form_radio("link_menu_navigator_rendertype", "0", ($linkspage_pref['link_menu_navigator_rendertype'] ? "0" : "1"), "", "").LCLAN_OPT_75;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+
+
+        $TOPIC_TOPIC = LCLAN_OPT_70;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_menu_category", "1", ($linkspage_pref['link_menu_category'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_menu_category", "0", ($linkspage_pref['link_menu_category'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_80;
+        $TOPIC_FIELD = $rs -> form_text("link_menu_category_caption", "15", $linkspage_pref['link_menu_category_caption'], "100", "tbox", "", "", "");
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_87;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_menu_category_amount", "1", ($linkspage_pref['link_menu_category_amount'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_menu_category_amount", "0", ($linkspage_pref['link_menu_category_amount'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_71;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_menu_category_rendertype", "1", ($linkspage_pref['link_menu_category_rendertype'] ? "1" : "0"), "", "").LCLAN_OPT_76."
+        ".$rs -> form_radio("link_menu_category_rendertype", "0", ($linkspage_pref['link_menu_category_rendertype'] ? "0" : "1"), "", "").LCLAN_OPT_75;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+
+
+        $TOPIC_TOPIC = LCLAN_OPT_72;
+        $TOPIC_FIELD = "
+        ".$rs -> form_radio("link_menu_recent", "1", ($linkspage_pref['link_menu_recent'] ? "1" : "0"), "", "").LCLAN_OPT_3."
+        ".$rs -> form_radio("link_menu_recent", "0", ($linkspage_pref['link_menu_recent'] ? "0" : "1"), "", "").LCLAN_OPT_4;
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_73;
+        $TOPIC_FIELD = "<table style='width:100%;' cellpadding='0' cellspacing='0'><tr><td style='white-space:nowrap; width:20%;'>
+        ".$rs -> form_checkbox("link_menu_recent_category", 1, ($linkspage_pref['link_menu_recent_category'] ? "1" : "0"))." ".LCLAN_OPT_77."<br />
+        ".$rs -> form_checkbox("link_menu_recent_description", 1, ($linkspage_pref['link_menu_recent_description'] ? "1" : "0"))." ".LCLAN_OPT_78."<br />
+        </td></tr></table>";
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_81;
+        $TOPIC_FIELD = $rs -> form_text("link_menu_recent_caption", "15", $linkspage_pref['link_menu_recent_caption'], "100", "tbox", "", "", "");
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+        $TOPIC_TOPIC = LCLAN_OPT_74;
+        $TOPIC_FIELD = $rs -> form_select_open("link_menu_recent_number");
+        for($i=1;$i<15;$i++){
+            $TOPIC_FIELD .= $rs -> form_option($i, ($linkspage_pref["link_menu_recent_number"] == $i ? "1" : "0"), $i);
+        }
+        $TOPIC_FIELD .= $rs -> form_select_close();
+        $text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+
+
+        $text .= $TOPIC_TABLE_END;
+
+
+        $text .= "
+        ".$rs->form_close()."
+        </div>";
+        $ns->tablerender(LCLAN_OPT_2, $text);
+    }
+
+    function pref_submit() {
+        global $rs;
+        $text = "
+        <tr>
+        <td colspan='2' style='text-align:center' class='forumheader'>
+        <input class='button' type='submit' name='updateoptions' value='".LCLAN_ADMIN_1."' />
+        </td>
+        </tr>";
+
+        return $text;
+    }
+
+
+
+}
+
+?>
diff -ruN 6171/e107_plugins/links_page/link_defines.php 75/e107_plugins/links_page/link_defines.php
--- 6171/e107_plugins/links_page/link_defines.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/link_defines.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,33 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|    e107 website system
+|
+|    Steve Dunstan 2001-2002
+|    http://e107.org
+|    jalist@e107.org
+|
+|    Released   under the   terms and   conditions of the
+|    GNU    General Public  License (http://gnu.org).
+|
+|    $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/link_defines.php,v $
+|    $Revision: 1.2 $
+|    $Date: 2005/12/14 19:28:44 $
+|    $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$imagedir = e_IMAGE."/admin_images/";
+if (!defined("IMAGE_NEW")){ define("IMAGE_NEW", (file_exists(THEME."generic/new.png") ? THEME."generic/new.png" : e_IMAGE."generic/".IMODE."/new.png")); }
+if (!defined('LINK_ICON_EDIT')) { define("LINK_ICON_EDIT", "<img src='".$imagedir."maintain_16.png' alt='' style='border:0; cursor:pointer;' />"); }
+if (!defined('LINK_ICON_DELETE')) { define("LINK_ICON_DELETE", "<img src='".$imagedir."delete_16.png' alt='' style='border:0; cursor:pointer;' />"); }
+if (!defined('LINK_ICON_DELETE_BASE')) { define("LINK_ICON_DELETE_BASE", $imagedir."delete_16.png"); }
+if (!defined('LINK_ICON_LINK')) { define("LINK_ICON_LINK", "<img src='".$imagedir."leave_16.png' alt='' style='border:0; cursor:pointer;' />"); }
+if (!defined('LINK_ICON_ORDER_UP_BASE')) { define("LINK_ICON_ORDER_UP_BASE", $imagedir."up.png"); }
+if (!defined('LINK_ICON_ORDER_DOWN_BASE')) { define("LINK_ICON_ORDER_DOWN_BASE", $imagedir."down.png"); }
+if (!defined('LINK_ICON_ORDER_UP')) { define("LINK_ICON_ORDER_UP", "<img src='".$imagedir."up.png' alt='' style='border:0; cursor:pointer;' />"); }
+if (!defined('LINK_ICON_ORDER_DOWN')) { define("LINK_ICON_ORDER_DOWN", "<img src='".$imagedir."down.png' alt='' style='border:0; cursor:pointer;' />"); }
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/links_page/link_images/button.png and 75/e107_plugins/links_page/link_images/button.png differ
diff -ruN 6171/e107_plugins/links_page/link_menu.php 75/e107_plugins/links_page/link_menu.php
--- 6171/e107_plugins/links_page/link_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/link_menu.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,166 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+unset($text);
+require_once(e_PLUGIN.'links_page/link_class.php');
+$lc = new linkclass();
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+global $tp;
+
+$lan_file = e_PLUGIN."links_page/languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."links_page/languages/English.php");
+
+$bullet = "<img src='".THEME."images/bullet2.gif' alt='' style='border:0;' />";
+global $linkspage_pref;
+$linkspage_pref = $lc -> getLinksPagePref();
+
+//navigator -------------------------
+$mains = "";
+$text = "";
+$baseurl = e_PLUGIN."links_page/links.php";
+if(isset($linkspage_pref['link_menu_navigator_frontpage']) && $linkspage_pref['link_menu_navigator_frontpage']){
+	if(isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1"){
+		$mains .= $rs -> form_option(LAN_LINKS_14, "0", $baseurl, "");
+	}else{
+		$mains .= $bullet." <a href='".$baseurl."'>".LAN_LINKS_14."</a><br />";
+	}
+}
+if(isset($linkspage_pref['link_menu_navigator_refer']) && $linkspage_pref['link_menu_navigator_refer']){
+	if(isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1"){
+		$mains .= $rs -> form_option(LAN_LINKS_12, "0", $baseurl."?top", "");
+	}else{
+		$mains .= $bullet." <a href='".$baseurl."?top'>".LAN_LINKS_12."</a><br />";
+	}
+}
+if(isset($linkspage_pref['link_menu_navigator_rated']) && $linkspage_pref['link_menu_navigator_rated']){
+	if(isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1"){
+		$mains .= $rs -> form_option(LAN_LINKS_13, "0", $baseurl."?rated", "");
+	}else{
+		$mains .= $bullet." <a href='".$baseurl."?rated'>".LAN_LINKS_13."</a><br />";
+	}
+}
+if(isset($linkspage_pref['link_menu_navigator_category']) && $linkspage_pref['link_menu_navigator_category']){
+	if(isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1"){
+		$mains .= $rs -> form_option(LAN_LINKS_43, "0", $baseurl."?cat", "");
+	}else{
+		$mains .= $bullet." <a href='".$baseurl."?cat'>".LAN_LINKS_43."</a><br />";
+	}
+}
+if(isset($linkspage_pref['link_menu_navigator_links']) && $linkspage_pref['link_menu_navigator_links']){
+	if(isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1"){
+		$mains .= $rs -> form_option(LCLAN_OPT_68, "0", $baseurl."?all", "");
+	}else{
+		$mains .= $bullet." <a href='".$baseurl."?all'>".LCLAN_OPT_68."</a><br />";
+	}
+}
+if(isset($linkspage_pref['link_menu_navigator_submit']) && $linkspage_pref['link_menu_navigator_submit'] && isset($linkspage_pref['link_submit']) && $linkspage_pref['link_submit'] && check_class($linkspage_pref['link_submit_class'])){
+	if(isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1"){
+		$mains .= $rs -> form_option(LAN_LINKS_27, "0", $baseurl."?submit", "");
+	}else{
+		$mains .= $bullet." <a href='".$baseurl."?submit'>".LAN_LINKS_27."</a><br />";
+	}
+}
+if(isset($linkspage_pref['link_menu_navigator_manager']) && $linkspage_pref['link_menu_navigator_manager'] && isset($linkspage_pref['link_manager']) && $linkspage_pref['link_manager'] && check_class($linkspage_pref['link_manager_class'])){
+	if(isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1"){
+		$mains .= $rs -> form_option(LCLAN_ITEM_35, "0", $baseurl."?manage", "");
+	}else{
+		$mains .= $bullet." <a href='".$baseurl."?manage'>".LCLAN_ITEM_35."</a><br />";
+	}
+}
+
+if($mains){
+	$cap = (isset($linkspage_pref['link_menu_navigator_caption']) && $linkspage_pref['link_menu_navigator_caption'] ? $linkspage_pref['link_menu_navigator_caption'] : LCLAN_OPT_82);
+	if(isset($linkspage_pref['link_menu_navigator_rendertype']) && $linkspage_pref['link_menu_navigator_rendertype'] == "1"){
+		$selectjs = "style='width:100%;' onchange=\"if(this.options[this.selectedIndex].value != ''){ return document.location=this.options[this.selectedIndex].value; }\" ";
+		$text .= $rs -> form_select_open("navigator", $selectjs);
+		$text .= $rs -> form_option($cap, "0", "", "");
+		$text .= $mains;
+		$text .= $rs -> form_select_close();
+		$text .= "<br />";
+	}else{
+		$text .= $cap."<br />";
+		$text .= $mains."<br />";
+	}
+	
+}
+
+//categories ------------------------
+if(isset($linkspage_pref['link_menu_category']) && $linkspage_pref['link_menu_category']){
+	$mains = "";
+	$cap = (isset($linkspage_pref['link_menu_category_caption']) && $linkspage_pref['link_menu_category_caption'] ? $linkspage_pref['link_menu_category_caption'] : LCLAN_OPT_83);
+	$sqlc = new db; $sql2 = new db;
+	if ($sqlc->db_Select("links_page_cat", "link_category_id, link_category_name", "link_category_class REGEXP '".e_CLASS_REGEXP."' ORDER BY link_category_name")){
+		while ($rowc = $sqlc->db_Fetch()){
+			if(isset($linkspage_pref['link_menu_category_amount']) && $linkspage_pref['link_menu_category_amount']){
+				$amount = $sql2 -> db_Count("links_page", "(*)", "WHERE link_category = '".$rowc['link_category_id']."' AND link_class REGEXP '".e_CLASS_REGEXP."' ");
+				$amount = "(".$amount.")";
+			}else{
+				$amount = "";
+			}
+			if(isset($linkspage_pref['link_menu_category_rendertype']) && $linkspage_pref['link_menu_category_rendertype'] == "1"){
+				$mains .= $rs -> form_option($rowc['link_category_name']." ".$amount, "0", $baseurl."?cat.".$rowc['link_category_id'], "");
+			}else{
+				$mains .= $bullet." <a href='".$baseurl."?cat.".$rowc['link_category_id']."'>".$rowc['link_category_name']."</a> ".$amount."<br />";
+			}
+		}
+		if(isset($linkspage_pref['link_menu_category_rendertype']) && $linkspage_pref['link_menu_category_rendertype'] == "1"){
+			$selectjs = "style='width:100%;' onchange=\"if(this.options[this.selectedIndex].value != ''){ return document.location=this.options[this.selectedIndex].value; }\" ";
+			$text .= $rs -> form_select_open("category", $selectjs);
+			$text .= $rs -> form_option($cap, "0", "", "");
+			$text .= $mains;
+			$text .= $rs -> form_select_close();
+			$text .= "<br />";
+		}else{
+			$text .= $cap."<br />";
+			$text .= $mains;
+		}
+	}
+}
+
+
+//recent ----------------------------
+
+if(isset($linkspage_pref["link_menu_recent"]) && $linkspage_pref["link_menu_recent"]){
+	$num = (isset($linkspage_pref["link_menu_recent_number"]) && $linkspage_pref["link_menu_recent_number"] ? $linkspage_pref["link_menu_recent_number"] : "5");
+	$qry = "
+	SELECT l.*, c.link_category_id, c.link_category_name
+	FROM #links_page AS l
+	LEFT JOIN #links_page_cat AS c ON c.link_category_id = l.link_category
+	WHERE l.link_class REGEXP '".e_CLASS_REGEXP."' AND c.link_category_class REGEXP '".e_CLASS_REGEXP."'
+	ORDER BY l.link_datestamp DESC LIMIT 0,".intval($num)." 
+	";
+
+	$cap = (isset($linkspage_pref['link_menu_recent_caption']) && $linkspage_pref['link_menu_recent_caption'] ? $linkspage_pref['link_menu_recent_caption'] : LCLAN_OPT_84);
+	if($sql -> db_Select_gen($qry)){
+		$text .= "<br />".$cap."<br />";
+		while($row = $sql -> db_Fetch()){
+			
+			$append = $lc -> parse_link_append($row['link_open'], $row['link_id']);
+
+			$heading = $append.$tp->toHTML($row['link_name'],TRUE,"")."</a>";
+
+			$cat = (isset($linkspage_pref['link_menu_recent_category']) && $linkspage_pref['link_menu_recent_category'] ? "<br /><a href='".e_PLUGIN."links_page/links.php?cat.".$row['link_category_id']."'>".$row['link_category_name']."</a>" : "");
+
+			$desc = (isset($linkspage_pref['link_menu_recent_description']) && $linkspage_pref['link_menu_recent_description'] && $row['link_description'] ? "<br />".$tp->toHTML($row['link_description'],TRUE,"") : "");
+
+			$text .= "
+			<table style='width:100%; text-align:left; border:0;' cellpadding='0' cellspacing='0'>
+				<tr>
+					<td style='width:1%; white-space:nowrap; vertical-align:top; padding-right:5px;'>".$bullet."</td>
+					<td>
+						".$heading."
+						".$cat."
+						".$desc."
+					</td>
+				</tr>
+			</table>";
+		}
+	}
+}
+
+$caption = (isset($linkspage_pref['link_menu_caption']) && $linkspage_pref['link_menu_caption'] ? $linkspage_pref['link_menu_caption'] : LCLAN_OPT_86);
+$ns -> tablerender($caption, $text);
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/link_shortcodes.php 75/e107_plugins/links_page/link_shortcodes.php
--- 6171/e107_plugins/links_page/link_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/link_shortcodes.php	2006-02-13 02:35:00.000000000 -0600
@@ -0,0 +1,426 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$link_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+/*
+
+//SC_BEGIN LINK_NAVIGATOR
+//global $LINK_NAVIGATOR, $linkspage_pref, $qs;
+//$main = "";
+//if(isset($linkspage_pref['link_navigator_frontpage']) && $linkspage_pref['link_navigator_frontpage']){
+//	$main .= "<a href='".e_PLUGIN."links_page/links.php'>".LAN_LINKS_14."</a> >><br />";
+//}
+//if(isset($linkspage_pref['link_navigator_submit']) && $linkspage_pref['link_navigator_submit'] && isset($linkspage_pref['link_submit']) && $linkspage_pref['link_submit'] && check_class($linkspage_pref['link_submit_class'])){
+//	$main .= "<a href='".e_PLUGIN."links_page/links.php?submit'>".LAN_LINKS_27."</a> >><br />";
+//}
+//if(isset($linkspage_pref['link_navigator_manager']) && $linkspage_pref['link_navigator_manager'] && isset($linkspage_pref['link_manager']) && $linkspage_pref['link_manager'] && check_class($linkspage_pref['link_manager_class'])){
+//	$main .= "<a href='".e_PLUGIN."links_page/links.php?manage'>".LCLAN_ITEM_35."</a> >><br />";
+//}
+//if(isset($linkspage_pref['link_navigator_refer']) && $linkspage_pref['link_navigator_refer']){
+//	$main .= "<a href='".e_PLUGIN."links_page/links.php?top'>".LAN_LINKS_12."</a> >><br />";
+//}
+//if(isset($linkspage_pref['link_navigator_rated']) && $linkspage_pref['link_navigator_rated']){
+//	$main .= "<a href='".e_PLUGIN."links_page/links.php?rated'>".LAN_LINKS_13."</a> >><br />";
+//}
+//if(isset($linkspage_pref['link_navigator_category']) && $linkspage_pref['link_navigator_category']){
+//	$main .= "<a href='".e_PLUGIN."links_page/links.php?cat'>".LAN_LINKS_43."</a> >><br />";
+//}
+//return $main;
+//SC_END
+
+SC_BEGIN LINK_NAVIGATOR
+global $LINK_NAVIGATOR, $rs, $linkspage_pref, $qs;
+$mains = "";
+$baseurl = e_PLUGIN."links_page/links.php";
+if(isset($linkspage_pref['link_navigator_frontpage']) && $linkspage_pref['link_navigator_frontpage']){
+	$mains .= $rs -> form_option(LAN_LINKS_14, "0", $baseurl, "");
+}
+if(isset($linkspage_pref['link_navigator_refer']) && $linkspage_pref['link_navigator_refer']){
+	$mains .= $rs -> form_option(LAN_LINKS_12, "0", $baseurl."?top", "");
+}
+if(isset($linkspage_pref['link_navigator_rated']) && $linkspage_pref['link_navigator_rated']){
+	$mains .= $rs -> form_option(LAN_LINKS_13, "0", $baseurl."?rated", "");
+}
+if(isset($linkspage_pref['link_navigator_category']) && $linkspage_pref['link_navigator_category']){
+	$mains .= $rs -> form_option(LAN_LINKS_43, "0", $baseurl."?cat", "");
+}
+if(isset($linkspage_pref['link_navigator_links']) && $linkspage_pref['link_navigator_links']){
+	$mains .= $rs -> form_option(LCLAN_OPT_68, "0", $baseurl."?all", "");
+}
+if(isset($linkspage_pref['link_navigator_submit']) && $linkspage_pref['link_navigator_submit'] && isset($linkspage_pref['link_submit']) && $linkspage_pref['link_submit'] && check_class($linkspage_pref['link_submit_class'])){
+	$mains .= $rs -> form_option(LAN_LINKS_27, "0", $baseurl."?submit", "");
+}
+if(isset($linkspage_pref['link_navigator_manager']) && $linkspage_pref['link_navigator_manager'] && isset($linkspage_pref['link_manager']) && $linkspage_pref['link_manager'] && check_class($linkspage_pref['link_manager_class'])){
+	$mains .= $rs -> form_option(LCLAN_ITEM_35, "0", $baseurl."?manage", "");
+}
+if(isset($linkspage_pref['link_navigator_allcat']) && $linkspage_pref['link_navigator_allcat']){
+	$sqlc = new db;
+	if ($sqlc->db_Select("links_page_cat", "link_category_id, link_category_name", "link_category_class REGEXP '".e_CLASS_REGEXP."' ORDER BY link_category_name")){
+		$mains .= $rs -> form_option("&nbsp;", "0", "", "");
+		$mains .= $rs -> form_option("-- view category --", "0", "", "");
+		while ($rowc = $sqlc->db_Fetch()){
+			$mains .= $rs -> form_option($rowc['link_category_name'], "0", $baseurl."?cat.".$rowc['link_category_id'], "");
+		}
+	}
+}
+
+if($mains){
+	$main = "";
+
+	$selectjs = " onchange=\"if(this.options[this.selectedIndex].value.indexOf('-') && this.options[this.selectedIndex].value != '' && this.options[this.selectedIndex].value != '&nbsp;'){ return document.location=this.options[this.selectedIndex].value; }\" ";
+
+//	$selectjs = " onchange=\"if(this.options[this.selectedIndex].value != '-- view category --' || this.options[this.selectedIndex].value != '&nbsp;'){ return document.location=this.options[this.selectedIndex].value; }\" ";
+	$main .= $rs -> form_select_open("navigator", $selectjs);
+	$main .= $rs -> form_option(LAN_LINKS_47, "0", "", "");
+	$main .= $mains;
+	$main .= $rs -> form_select_close();
+	return $main;
+}
+SC_END
+
+SC_BEGIN LINK_SORTORDER
+global $LINK_SORTORDER;
+return $LINK_SORTORDER;
+SC_END
+
+
+
+SC_BEGIN LINK_NAVIGATOR_TABLE_PRE
+global $LINK_NAVIGATOR_TABLE_PRE;
+if($LINK_NAVIGATOR_TABLE_PRE === TRUE){
+$LINK_NAVIGATOR_TABLE_PRE = " ";
+return $LINK_NAVIGATOR_TABLE_PRE;
+}
+SC_END
+SC_BEGIN LINK_NAVIGATOR_TABLE_POST
+global $LINK_NAVIGATOR_TABLE_POST;
+if($LINK_NAVIGATOR_TABLE_POST === TRUE){
+$LINK_NAVIGATOR_TABLE_POST = " ";
+return $LINK_NAVIGATOR_TABLE_POST;
+}
+SC_END
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+// LINK_TABLE_MANAGER ------------------------------------------------
+SC_BEGIN LINK_MANAGE_ICON
+global $LINK_MANAGE_ICON, $row;
+$LINK_MANAGE_ICON = "";
+return $LINK_MANAGE_ICON;
+SC_END
+
+SC_BEGIN LINK_MANAGE_NAME
+global $LINK_MANAGE_NAME, $row, $tp;
+return $tp->toHTML($row['link_name'], TRUE);
+SC_END
+
+SC_BEGIN LINK_MANAGE_OPTIONS
+global $LINK_MANAGE_OPTIONS, $row, $tp, $linkspage_pref;
+$linkid = $row['link_id'];
+$LINK_MANAGE_OPTIONS = "<a href='".e_SELF."?manage.edit.".$linkid."' title='".LCLAN_ITEM_31."'>".LINK_ICON_EDIT."</a>";
+if (isset($linkspage_pref['link_directdelete']) && $linkspage_pref['link_directdelete']){
+	$LINK_MANAGE_OPTIONS .= " <input type='image' title='delete' name='delete[main_{$linkid}]' alt='".LCLAN_ITEM_32."' src='".LINK_ICON_DELETE_BASE."' onclick=\"return jsconfirm('".$tp->toJS(LCLAN_ITEM_33." [ ".$row['link_name']." ]")."')\" style='vertical-align:top;' />";
+}
+return $LINK_MANAGE_OPTIONS;
+SC_END
+
+SC_BEGIN LINK_MANAGE_CAT
+global $LINK_MANAGE_CAT, $tp, $row;
+return $tp->toHTML($row['link_category_name'], TRUE);
+SC_END
+
+SC_BEGIN LINK_MANAGE_NEWLINK
+global $LINK_MANAGE_NEWLINK;
+return "<a href='".e_SELF."?manage'>".LAN_LINKS_MANAGER_3."</a>";
+SC_END
+
+
+
+
+
+
+
+// LINK_MAIN_TABLE ------------------------------------------------
+SC_BEGIN LINK_MAIN_HEADING
+global $LINK_MAIN_HEADING, $rowl, $tp;
+return (!$rowl['total_links'] ? $rowl['link_category_name'] : "<a href='links.php?cat.".$rowl['link_category_id']."'>".$tp->toHTML($rowl['link_category_name'], TRUE)."</a>");
+SC_END
+
+SC_BEGIN LINK_MAIN_DESC
+global $LINK_MAIN_DESC, $rowl, $linkspage_pref, $tp;
+return (isset($linkspage_pref['link_cat_desc']) && $linkspage_pref['link_cat_desc'] ? $tp->toHTML($rowl['link_category_description'], TRUE) : "");
+SC_END
+
+SC_BEGIN LINK_MAIN_NUMBER
+global $LINK_MAIN_NUMBER, $rowl, $linkspage_pref;
+if(isset($linkspage_pref['link_cat_amount']) && $linkspage_pref['link_cat_amount']){
+$LINK_MAIN_NUMBER = $rowl['total_links']." ".($rowl['total_links'] == 1 ? LAN_LINKS_17 : LAN_LINKS_18)." ".LAN_LINKS_16;
+}else{
+$LINK_MAIN_NUMBER = "";
+}
+return $LINK_MAIN_NUMBER;
+SC_END
+
+SC_BEGIN LINK_MAIN_ICON
+global $LINK_MAIN_ICON, $rowl, $linkspage_pref;
+$LINK_MAIN_ICON = "";
+if(isset($linkspage_pref['link_cat_icon']) && $linkspage_pref['link_cat_icon']){
+	if (isset($rowl['link_category_icon']) && $rowl['link_category_icon']) {
+		if(strstr($rowl['link_category_icon'], "/")){
+			if(file_exists(e_BASE.$rowl['link_category_icon'])){
+			$LINK_MAIN_ICON = "<img src='".e_BASE.$rowl['link_category_icon']."' alt='' style='border:0; vertical-align:middle' />";
+			} else {
+				if(isset($linkspage_pref['link_cat_icon_empty']) && $linkspage_pref['link_cat_icon_empty']){
+				$LINK_MAIN_ICON = "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='border:0; vertical-align:middle;' />";
+				}
+			}
+		}else{
+			if(file_exists(e_PLUGIN."links_page/cat_images/".$rowl['link_category_icon'])){
+			$LINK_MAIN_ICON = "<img src='".e_PLUGIN."links_page/cat_images/".$rowl['link_category_icon']."' alt='' style='border:0; vertical-align:middle' />";
+			} else {
+				if(isset($linkspage_pref['link_cat_icon_empty']) && $linkspage_pref['link_cat_icon_empty']){
+				$LINK_MAIN_ICON = "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='border:0; vertical-align:middle;' />";
+				}
+			}
+		}
+	} else {
+		if(isset($linkspage_pref['link_cat_icon_empty']) && $linkspage_pref['link_cat_icon_empty']){
+		$LINK_MAIN_ICON = "<img src='".THEME."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' style='border:0; vertical-align:middle;' />";
+		}
+	}
+	if($rowl['total_links'] && $LINK_MAIN_ICON){
+	$LINK_MAIN_ICON = "<a href='links.php?cat.".$rowl['link_category_id']."'>".$LINK_MAIN_ICON."</a>";
+	}
+}
+return $LINK_MAIN_ICON;
+SC_END
+
+SC_BEGIN LINK_MAIN_TOTAL
+global $LINK_MAIN_TOTAL, $sql, $category_total, $linkspage_pref, $alllinks;
+if(isset($linkspage_pref['link_cat_total']) && $linkspage_pref['link_cat_total']){
+$LINK_MAIN_TOTAL = LAN_LINKS_21." ".($alllinks == 1 ? LAN_LINKS_22 : LAN_LINKS_23)." ".$alllinks." ".($alllinks == 1 ? LAN_LINKS_17 : LAN_LINKS_18)." ".LAN_LINKS_24." ".$category_total." ".($category_total == 1 ? LAN_LINKS_20 : LAN_LINKS_19);
+}else{
+$LINK_MAIN_TOTAL = "";
+}
+return $LINK_MAIN_TOTAL;
+SC_END
+
+SC_BEGIN LINK_MAIN_SHOWALL
+global $LINK_MAIN_SHOWALL, $linkspage_pref;
+return (isset($linkspage_pref['link_cat_total']) && $linkspage_pref['link_cat_total'] ? "<a href='".e_PLUGIN."links_page/links.php?cat.all'>".LAN_LINKS_25."</a>" : "");
+SC_END
+
+
+
+
+// LINK_TABLE ------------------------------------------------
+SC_BEGIN LINK_BUTTON
+global $LINK_BUTTON, $linkspage_pref, $rowl, $LINK_NAME, $LINK_APPEND;
+$LINK_BUTTON = "";
+if(isset($linkspage_pref['link_icon']) && $linkspage_pref['link_icon']){
+	if ($rowl['link_button']) {
+		if (strpos($rowl['link_button'], "http://") !== FALSE) {
+			$LINK_BUTTON = $LINK_APPEND."\n<img style='border:1px solid #000;' src='".$rowl['link_button']."' alt='' /></a>";
+		} else {
+			if(strstr($rowl['link_button'], "/")){
+				if(file_exists(e_BASE.$rowl['link_button'])){
+					$LINK_BUTTON = $LINK_APPEND."\n<img style='border:1px solid #000;' src='".e_BASE.$rowl['link_button']."' alt='' /></a>";
+				} else {
+					if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
+						$LINK_BUTTON = $LINK_APPEND."\n<img style='border:1px solid #000; width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='' /></a>";
+					}
+				}
+			}else{
+				if(file_exists(e_PLUGIN."links_page/link_images/".$rowl['link_button'])){
+				$LINK_BUTTON = $LINK_APPEND."\n<img style='border:1px solid #000' src='".e_PLUGIN."links_page/link_images/".$rowl['link_button']."' alt='' /></a>";
+				}else{
+					if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
+					$LINK_BUTTON = $LINK_APPEND."\n<img style='border:1px solid #000; width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='' /></a>";
+					}
+				}
+			}
+		}
+	} else {
+		if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
+			$LINK_BUTTON = $LINK_APPEND."\n<img style='border:1px solid #000; width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='' /></a>";
+		}
+	}
+}else{
+	if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
+		$LINK_BUTTON = $LINK_APPEND."\n<img style='border:1px solid #000; width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='' /></a>";
+	}
+}
+return $LINK_BUTTON;
+SC_END
+
+SC_BEGIN LINK_APPEND
+global $LINK_APPEND;
+return $LINK_APPEND;
+SC_END
+
+SC_BEGIN LINK_NAME
+global $LINK_NAME, $rowl;
+return $rowl['link_name'];
+SC_END
+
+SC_BEGIN LINK_URL
+global $LINK_URL, $linkspage_pref, $rowl;
+return (isset($linkspage_pref['link_url']) && $linkspage_pref['link_url'] ? $rowl['link_url'] : "");
+SC_END
+
+SC_BEGIN LINK_REFER
+global $LINK_REFER, $linkspage_pref, $rowl;
+return (isset($linkspage_pref['link_referal']) && $linkspage_pref['link_referal'] ? LAN_LINKS_26." ".$rowl['link_refer'] : "");
+SC_END
+
+SC_BEGIN LINK_COMMENT
+global $LINK_COMMENT, $linkspage_pref, $rowl;
+return (isset($linkspage_pref['link_comment']) && $linkspage_pref['link_comment'] ? "<a href='".e_SELF."?comment.".$rowl['link_id']."'>".LAN_LINKS_37." ".($rowl['link_comment'] ? $rowl['link_comment'] : "0")."</a>" : "");
+SC_END
+
+SC_BEGIN LINK_DESC
+global $LINK_DESC, $linkspage_pref, $tp, $rowl;
+return (isset($linkspage_pref['link_desc']) && $linkspage_pref['link_desc'] ? $tp->toHTML($rowl['link_description'], TRUE) : "");
+SC_END
+
+SC_BEGIN LINK_RATING
+global $LINK_RATING, $LINK_RATED_RATING, $linkspage_pref, $rater, $rowl, $qs;
+$LINK_RATING = "";
+if(isset($linkspage_pref['link_rating']) && $linkspage_pref['link_rating']){
+$LINK_RATING = $rater->composerating("links_page", $rowl['link_id'], $enter=TRUE, $userid=FALSE);
+}
+return $LINK_RATING;
+SC_END
+
+SC_BEGIN LINK_NEW
+global $LINK_NEW, $linkspage_pref, $qs, $rowl;
+$LINK_NEW = "";
+if(USER && $rowl['link_datestamp'] > USERLV){
+$LINK_NEW = "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' />";
+}
+return $LINK_NEW;
+SC_END
+
+
+// LINK_TOP_TABLE ------------------------------------------------
+
+
+
+// LINK_RATED_TABLE ------------------------------------------------
+SC_BEGIN LINK_RATED_RATING
+global $LINK_RATED_RATING, $rowl;
+$tmp = explode(".", $rowl['rate_avg']);
+$one = $tmp[0];
+$two = round($tmp[1],1);
+$rating = $one.".".$two." ";
+for($c=1; $c<= $one; $c++){
+	$rating .= "<img src='".e_IMAGE."rate/box.png' alt='' style='height:8px; vertical-align:middle' />";
+}
+if($one < 10){
+	for($c=9; $c>=$one; $c--){
+		$rating .= "<img src='".e_IMAGE."rate/empty.png' alt='' style='height:8px; vertical-align:middle' />";
+	}
+}
+$rating .= "<img src='".e_IMAGE."rate/boxend.png' alt='' style='height:8px; vertical-align:middle' />";
+return $rating;
+SC_END
+
+SC_BEGIN LINK_RATED_BUTTON
+global $LINK_RATED_BUTTON, $linkspage_pref, $rowl, $LINK_RATED_NAME, $LINK_RATED_APPEND;
+if(isset($linkspage_pref['link_icon']) && $linkspage_pref['link_icon']){
+	if ($rowl['link_button']) {
+		if (strpos($rowl['link_button'], "http://") !== FALSE) {
+			$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0;' src='".$rowl['link_button']."' alt='".$LINK_RATED_NAME."' /></a>";
+		} else {
+			if(strstr($rowl['link_button'], "/")){
+				$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0;' src='".e_BASE.$rowl['link_button']."' alt='".$LINK_RATED_NAME."' /></a>";
+			}else{
+				$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0' src='".e_PLUGIN."links_page/link_images/".$rowl['link_button']."' alt='".$LINK_RATED_NAME."' /></a>";
+			}
+		}
+	} else {
+		if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
+			$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0; width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='".$LINK_RATED_NAME."' /></a>";
+		}else{
+			$LINK_RATED_BUTTON = "";
+		}
+	}
+}else{
+	if(isset($linkspage_pref['link_icon_empty']) && $linkspage_pref['link_icon_empty']){
+		$LINK_RATED_BUTTON = $LINK_RATED_APPEND."\n<img style='border:0; width: 88px; height: 31px;' src='".e_PLUGIN."links_page/images/generic.png' alt='".$LINK_RATED_NAME."' /></a>";
+	}else{
+		$LINK_RATED_BUTTON = "";
+	}	
+}
+return $LINK_RATED_BUTTON;
+SC_END
+
+SC_BEGIN LINK_RATED_APPEND
+global $LINK_RATED_APPEND;
+return $LINK_RATED_APPEND;
+SC_END
+
+SC_BEGIN LINK_RATED_CATEGORY
+global $LINK_RATED_CATEGORY, $rowl, $qs, $tp;
+if(!isset($qs[1])){
+$LINK_RATED_CATEGORY = "<a href='".e_SELF."?cat.".$rowl['link_category_id']."'>".$tp->toHTML($rowl['link_category_name'], TRUE)."</a>";
+}
+return $LINK_RATED_CATEGORY;
+SC_END
+
+SC_BEGIN LINK_RATED_NAME
+global $LINK_RATED_NAME, $rowl;
+return $rowl['link_name'];
+SC_END
+
+SC_BEGIN LINK_RATED_URL
+global $LINK_RATED_URL, $linkspage_pref, $rowl;
+return (isset($linkspage_pref['link_url']) && $linkspage_pref['link_url'] ? $rowl['link_url'] : "");
+SC_END
+
+SC_BEGIN LINK_RATED_REFER
+global $LINK_RATED_REFER, $linkspage_pref, $rowl;
+return (isset($linkspage_pref['link_referal']) && $linkspage_pref['link_referal'] ? LAN_LINKS_26." ".$rowl['link_refer'] : "");
+SC_END
+
+SC_BEGIN LINK_RATED_DESC
+global $LINK_RATED_DESC, $linkspage_pref, $tp, $rowl;
+return (isset($linkspage_pref['link_desc']) && $linkspage_pref['link_desc'] ? $tp->toHTML($rowl['link_description'], TRUE) : "");
+SC_END
+
+
+
+
+
+// LINK_SUBMIT_TABLE ------------------------------------------------
+SC_BEGIN LINK_SUBMIT_CAT
+global $LINK_SUBMIT_CAT;
+return $LINK_SUBMIT_CAT;
+SC_END
+
+SC_BEGIN LINK_SUBMIT_PRETEXT
+global $LINK_SUBMIT_PRETEXT, $linkspage_pref;
+if(isset($linkspage_pref['link_submit_directpost']) && $linkspage_pref['link_submit_directpost']){
+return "";
+}else{
+return LCLAN_SL_9;
+}
+
+SC_END
+
+
+*/
+?>
diff -ruN 6171/e107_plugins/links_page/links_page_sql.php 75/e107_plugins/links_page/links_page_sql.php
--- 6171/e107_plugins/links_page/links_page_sql.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/links_page_sql.php	2005-11-01 13:38:52.000000000 -0600
@@ -0,0 +1,53 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/links_page_sql.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/11/01 19:38:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+header("location:../index.php");
+exit;
+?>
+# Table structure for table `links_page_cat`
+#
+CREATE TABLE links_page_cat (
+  link_category_id int(10) unsigned NOT NULL auto_increment,
+  link_category_name varchar(100) NOT NULL default '',
+  link_category_description varchar(250) NOT NULL default '',
+  link_category_icon varchar(100) NOT NULL default '',
+  link_category_order int(10) unsigned NOT NULL default '0',
+  link_category_class varchar(100) NOT NULL default '0',
+  link_category_datestamp int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (link_category_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
+
+# Table structure for table `links_page`
+#
+CREATE TABLE links_page (
+  link_id int(10) unsigned NOT NULL auto_increment,
+  link_name varchar(100) NOT NULL default '',
+  link_url varchar(200) NOT NULL default '',
+  link_description text NOT NULL,
+  link_button varchar(100) NOT NULL default '',
+  link_category tinyint(3) unsigned NOT NULL default '0',
+  link_order int(10) unsigned NOT NULL default '0',
+  link_refer int(10) unsigned NOT NULL default '0',
+  link_open tinyint(1) unsigned NOT NULL default '0',
+  link_class tinyint(3) unsigned NOT NULL default '0',
+  link_datestamp int(10) unsigned NOT NULL default '0',
+  link_author varchar(255) NOT NULL default '',
+  PRIMARY KEY  (link_id)
+) TYPE=MyISAM;
+# --------------------------------------------------------
diff -ruN 6171/e107_plugins/links_page/links.php 75/e107_plugins/links_page/links.php
--- 6171/e107_plugins/links_page/links.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/links.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,514 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/links.php,v $
+|     $Revision: 1.33 $
+|     $Date: 2006/01/05 09:06:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once('../../class2.php');
+
+require_once(e_HANDLER."rate_class.php");
+$rater = new rater;
+require_once(e_PLUGIN.'links_page/link_shortcodes.php');
+require_once(e_PLUGIN.'links_page/link_defines.php');
+require_once(e_HANDLER."userclass_class.php");
+e107_require_once(e_HANDLER.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+require_once(e_HANDLER."file_class.php");
+$fl = new e_file;
+require_once(e_HANDLER."comment_class.php");
+$cobj = new comment;
+require_once(e_PLUGIN.'links_page/link_class.php');
+$lc = new linkclass();
+global $tp;
+
+$linkspage_pref = $lc -> getLinksPagePref();
+
+$deltest = array_flip($_POST);
+
+if(e_QUERY){
+	$qs = explode(".", e_QUERY);
+
+	if(is_numeric($qs[0])){
+		$from = array_shift($qs);
+	}else{
+		$from = "0";
+	}
+}
+if (file_exists(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php")) {
+	include_once(e_PLUGIN."links_page/languages/".e_LANGUAGE.".php");
+	} else {
+	include_once(e_PLUGIN."links_page/languages/English.php");
+}
+$lc -> setPageTitle();
+
+//submit comment
+if (isset($_POST['commentsubmit'])) {
+	if (!$sql->db_Select("links_page", "link_id", "link_id = '".intval($qs[1])."' ")) {
+		header("location:".e_BASE."index.php");
+		exit;
+	} else {
+		$row = $sql->db_Fetch();
+		if ($row[0] && (ANON === TRUE || USER === TRUE)) {
+
+			$cobj->enter_comment($_POST['author_name'], $_POST['comment'], "links_page", $qs[1], $pid, $_POST['subject']);
+			$e107cache->clear("comment.links_page.{$qs[1]}");
+		}
+	}
+}
+
+//update refer
+if (isset($qs[0]) && $qs[0] == "view" && isset($qs[1]) && is_numeric($qs[1]))
+{
+	if($sql->db_Select("links_page", "*", "link_id='".intval($qs[1])."' AND link_class REGEXP '".e_CLASS_REGEXP."' "))
+	{
+		$row = $sql->db_Fetch();
+		$sql->db_Update("links_page", "link_refer=link_refer+1 WHERE link_id='".intval($qs[1])."' ");
+		//header("location:".$row['link_url']); exit;
+		js_location($row['link_url']);
+	}
+}
+
+require_once(HEADERF);
+
+
+if (is_readable(THEME."links_template.php")) {
+	require_once(THEME."links_template.php");
+	} else {
+	require_once(e_PLUGIN."links_page/links_template.php");
+}
+
+//submit / manage link
+if (isset($_POST['add_link'])) {
+	if($qs[0] == "submit"){
+		if(check_class($linkspage_pref['link_submit_class'])){
+			if(isset($linkspage_pref['link_submit_directpost']) && $linkspage_pref['link_submit_directpost']){
+				$lc -> dbLinkCreate();
+			}else{
+				$lc -> dbLinkCreate("submit");
+			}
+		}else{
+			js_location(e_SELF);
+		}
+	}
+	if($qs[0] == "manage"){
+		if(check_class($linkspage_pref['link_manager_class'])){
+			$lc -> dbLinkCreate();
+		}else{
+			js_location(e_SELF);
+		}
+	}
+}
+//message submitted link
+if(isset($qs[0]) && $qs[0] == "s"){
+	$lc->show_message(LAN_LINKS_29, LAN_LINKS_28);
+}
+$qsorder = FALSE;
+if(isset($qs[0]) && substr($qs[0],0,5) == "order"){
+	$qsorder = TRUE;
+}
+//show all categories
+if((!isset($qs[0]) || $qsorder) && $linkspage_pref['link_page_categories']){
+	displayNavigator('cat');
+	displayCategory();
+}
+//show all categories
+if(isset($qs[0]) && $qs[0] == "cat" && !isset($qs[1]) ){
+	displayNavigator('cat');
+	displayCategory();
+}
+//show all links in all categories
+if( ((!isset($qs[0]) || $qsorder) && !$linkspage_pref['link_page_categories']) || (isset($qs[0]) && $qs[0] == "all") ){
+	displayNavigator('');
+	displayCategoryLinks();
+}
+//show all links in one categories
+if(isset($qs[0]) && $qs[0] == "cat" && isset($qs[1]) && is_numeric($qs[1])){
+	displayNavigator('');
+	displayCategoryLinks($qs[1]);
+}
+//view top rated
+if(isset($qs[0]) && $qs[0] == "rated"){
+	displayNavigator('');
+	displayTopRated();
+}
+//view top refer
+if(isset($qs[0]) && $qs[0] == "top"){
+	displayNavigator('');
+	displayTopRefer();
+}
+//personal link managers
+if (isset($qs[0]) && $qs[0] == "manage"){
+	displayNavigator('');
+	displayPersonalManager();
+}
+//comments on links
+if (isset($qs[0]) && $qs[0] == "comment" && isset($qs[1]) && is_numeric($qs[1]) ){
+	displayNavigator('');
+	displayLinkComment();
+}
+//submit link
+if (isset($qs[0]) && $qs[0] == "submit" && check_class($linkspage_pref['link_submit_class'])) {
+	displayNavigator('');
+	displayLinkSubmit();
+}
+
+
+function displayTopRated(){
+	global $qs, $sql, $lc, $tp, $rowl, $link_shortcodes, $from, $ns, $linkspage_pref;
+	global $LINK_RATED_TABLE_START, $LINK_RATED_TABLE, $LINK_RATED_TABLE_END, $LINK_RATED_RATING, $LINK_RATED_APPEND;
+	
+	$number		= (isset($linkspage_pref["link_nextprev_number"]) && $linkspage_pref["link_nextprev_number"] ? $linkspage_pref["link_nextprev_number"] : "20");
+	$np			= ($linkspage_pref["link_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : "");
+	$catrate	= (isset($qs[1]) && is_numeric($qs[1]) ? " AND l.link_category='".$qs[1]."' " : "");
+	$ratemin	= (isset($linkspage_pref['link_rating_minimum']) && $linkspage_pref['link_rating_minimum'] ? $linkspage_pref['link_rating_minimum'] : "0");
+	$qry = "
+	SELECT l.*, r.*, lc.link_category_id, lc.link_category_name, (r.rate_rating / r.rate_votes) as rate_avg
+	FROM #rate AS r
+	LEFT JOIN #links_page AS l ON l.link_id = r.rate_itemid
+	LEFT JOIN #links_page_cat AS lc ON lc.link_category_id = l.link_category
+	WHERE l.link_class REGEXP '".e_CLASS_REGEXP."' ".$catrate." AND lc.link_category_class REGEXP '".e_CLASS_REGEXP."' AND r.rate_table='links_page'
+	ORDER BY rate_avg DESC
+	";
+	$qry2 = $qry." ".$np;
+
+	if(!is_object($sql)){ $sql = new db; }
+	$linktotalrated = $sql -> db_Select_gen($qry);
+	if (!$ratedlinks = $sql->db_Select_gen($qry2)){
+		$lc -> show_message(LAN_LINKS_33, LAN_LINKS_11);
+	}else{
+		$link_rated_table_string = "";
+		$list = $sql -> db_getList();
+  	    foreach($list as $rowl) {
+			if( ($rowl['rate_avg'] > $ratemin) ){
+			$cat = $rowl['link_category_name'];
+			$LINK_RATED_APPEND			= $lc -> parse_link_append($rowl['link_open'], $rowl['link_id']);
+			$LINK_RATED_RATING			= $tp -> parseTemplate('{LINK_RATED_RATING}', FALSE, $link_shortcodes);
+			$link_rated_table_string	.= $tp -> parseTemplate($LINK_RATED_TABLE, FALSE, $link_shortcodes);
+			}
+		}
+		$link_rated_table_start = $tp -> parseTemplate($LINK_RATED_TABLE_START, FALSE, $link_shortcodes);
+		$link_rated_table_end = $tp -> parseTemplate($LINK_RATED_TABLE_END, FALSE, $link_shortcodes);
+
+		if(isset($qs[1])){
+			$captioncat = " : ".LAN_LINKS_40." : ".$cat;
+		}
+		$caption = LAN_LINKS_11." ".(isset($captioncat) ? $captioncat : "");
+		$text = $link_rated_table_start.$link_rated_table_string.$link_rated_table_end;
+		
+		$ns->tablerender($caption, $text);
+
+		if(isset($linkspage_pref["link_nextprev"]) && $linkspage_pref["link_nextprev"]){
+			require_once(e_HANDLER."np_class.php");
+			$np_querystring = (isset($qs[0]) ? $qs[0] : "").(isset($qs[1]) ? ".".$qs[1] : "").(isset($qs[2]) ? ".".$qs[2] : "").(isset($qs[3]) ? ".".$qs[3] : "").(isset($qs[4]) ? ".".$qs[4] : "");
+			$ix = new nextprev(e_SELF, $from, $number, $linktotalrated, NP_3, ($np_querystring ? $np_querystring : ""));
+		}
+	}
+}
+
+function displayTopRefer(){
+	global $qs, $sql2, $lc, $link_shortcodes, $cobj, $rowl, $from, $tp, $ns, $linkspage_pref;
+	global $LINK_TABLE_START, $LINK_TABLE, $LINK_TABLE_END, $LINK_APPEND;
+
+	$number	= ($linkspage_pref["link_nextprev_number"] ? $linkspage_pref["link_nextprev_number"] : "20");
+	$np		= ($linkspage_pref["link_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : "");
+	$min	= (isset($linkspage_pref['link_refer_minimum']) && $linkspage_pref['link_refer_minimum'] ? " AND l.link_refer > ".$linkspage_pref['link_refer_minimum'] : "");
+
+	$qry = "
+	SELECT l.*, lc.*, COUNT(c.comment_id) AS link_comment
+	FROM #links_page AS l
+	LEFT JOIN #links_page_cat AS lc ON lc.link_category_id = l.link_category
+	LEFT JOIN #comments as c ON c.comment_item_id=l.link_id AND comment_type='links_page'
+	WHERE l.link_class REGEXP '".e_CLASS_REGEXP."' ".$min."
+	GROUP BY l.link_id
+	ORDER BY l.link_refer DESC
+	";
+	$qry2 = $qry." ".$np;
+
+	if(!is_object($sql2)){ $sql2 = new db; }
+	$link_total = $sql2 -> db_Select_gen($qry);
+	if(!$sql2 -> db_Select_gen($qry2)){
+		$lc -> show_message(LAN_LINKS_42, LAN_LINKS_10);
+	}else{
+		$link_top_table_string = "";
+		$list = $sql2 -> db_getList();
+  	    foreach($list as $rowl) {
+			$category				= $rowl['link_category_id'];
+			$LINK_APPEND			= $lc -> parse_link_append($rowl['link_open'], $rowl['link_id']);
+			$link_top_table_string .= $tp -> parseTemplate($LINK_TABLE, FALSE, $link_shortcodes);
+		}
+		$link_top_table_start		= $tp -> parseTemplate($LINK_TABLE_START, FALSE, $link_shortcodes);
+		$link_top_table_end			= $tp -> parseTemplate($LINK_TABLE_END, FALSE, $link_shortcodes);
+
+		$text = $link_top_table_start.$link_top_table_string.$link_top_table_end;
+		$caption = LAN_LINKS_10;
+		$ns->tablerender($caption, $text);
+
+		if(isset($linkspage_pref["link_nextprev"]) && $linkspage_pref["link_nextprev"]){
+			require_once(e_HANDLER."np_class.php");
+			$np_querystring = (isset($qs[0]) ? $qs[0] : "").(isset($qs[1]) ? ".".$qs[1] : "").(isset($qs[2]) ? ".".$qs[2] : "").(isset($qs[3]) ? ".".$qs[3] : "").(isset($qs[4]) ? ".".$qs[4] : "");
+			$ix = new nextprev(e_SELF, $from, $number, $link_total, NP_3, ($np_querystring ? $np_querystring : ""));
+		}
+	}
+}
+
+function displayPersonalManager(){
+	global $qs, $sql, $sql2, $lc, $link_shortcodes, $cobj, $row, $from, $tp, $ns, $linkspage_pref;
+	global $LINK_TABLE_MANAGE_START, $LINK_TABLE_MANAGE, $LINK_TABLE_MANAGE_END;
+
+	if(!(isset($linkspage_pref['link_manager']) && $linkspage_pref['link_manager'])){
+		js_location(e_SELF);
+	}
+	//delete link
+	if(isset($linkspage_pref['link_directdelete']) && $linkspage_pref['link_directdelete']){
+		if(isset($_POST['delete'])){
+			$tmp = array_pop(array_flip($_POST['delete']));
+			list($delete, $del_id) = explode("_", $tmp);
+		}
+		if (isset($delete) && $delete == 'main') {
+			$sql->db_Select("links_page", "link_order", "link_id='".intval($del_id)."'");
+			$row = $sql->db_Fetch();
+			$sql2 = new db;
+			$sql->db_Select("links_page", "link_id", "link_order>'".$row['link_order']."' && link_category='".intval($id)."'");
+			while ($row = $sql->db_Fetch()) {
+				$sql2->db_Update("links_page", "link_order=link_order-1 WHERE link_id='".$row['link_id']."'");
+			}
+			if ($sql->db_Delete("links_page", "link_id='".intval($del_id)."'")) {
+				$lc->show_message(LCLAN_ADMIN_10." #".$del_id." ".LCLAN_ADMIN_11);
+			}
+		}
+	}
+	//upload link icon
+	if(isset($_POST['uploadlinkicon'])){
+		$lc -> uploadLinkIcon($_POST);
+	}
+
+	//show existing links
+	if(!(check_class($linkspage_pref['link_manager_class']))){
+		js_location(e_SELF);
+	}else{
+		$qry = "
+		SELECT l.*, lc.*
+		FROM #links_page AS l
+		LEFT JOIN #links_page_cat AS lc ON lc.link_category_id = l.link_category
+		WHERE l.link_author = '".USERID."'
+		ORDER BY l.link_name
+		";
+		$link_table_manage = "";
+		if(!$manager_total = $sql -> db_Select_gen($qry)){
+			$text = LAN_LINKS_MANAGER_4;
+		}else{
+			$link_table_manage_start	= $tp -> parseTemplate($LINK_TABLE_MANAGE_START, FALSE, $link_shortcodes);
+			while($row = $sql -> db_Fetch()){
+				$link_table_manage .= $tp -> parseTemplate($LINK_TABLE_MANAGE, FALSE, $link_shortcodes);
+			}
+			$link_table_manage_end		= $tp -> parseTemplate($LINK_TABLE_MANAGE_END, FALSE, $link_shortcodes);
+			$text = $link_table_manage_start.$link_table_manage.$link_table_manage_end;
+		}
+		$ns->tablerender(LAN_LINKS_35, $text);
+
+		//show link create
+		$lc->show_link_create();
+	}
+	return;
+}
+
+//comments on links
+function displayLinkComment(){
+	global $qs, $cobj, $tp, $sql, $lc, $rowl, $link_shortcodes, $ns, $linkspage_pref, $LINK_TABLE_START, $LINK_TABLE, $LINK_TABLE_END, $LINK_APPEND;
+	if(!(isset($linkspage_pref["link_comment"]) && $linkspage_pref["link_comment"])){
+		js_location(e_SELF);
+	}else{
+		$qry = "
+		SELECT l.*, lc.*
+		FROM #links_page AS l
+		LEFT JOIN #links_page_cat AS lc ON lc.link_category_id = l.link_category
+		WHERE l.link_id = '".intval($qs[1])."' AND lc.link_category_class REGEXP '".e_CLASS_REGEXP."' AND l.link_class REGEXP '".e_CLASS_REGEXP."' 
+		";
+		$link_comment_table_string = "";
+		if(!$linkcomment = $sql -> db_Select_gen($qry)){
+			js_location(e_SELF);
+		}else{
+			$rowl = $sql->db_Fetch();
+			$LINK_APPEND	= $lc -> parse_link_append($rowl['link_open'], $rowl['link_id']);
+			$subject		= $rowl['link_name'];
+			$text = $tp -> parseTemplate($LINK_TABLE, FALSE, $link_shortcodes);
+			$ns->tablerender(LAN_LINKS_36, $text);
+
+			$cobj->compose_comment("links_page", "comment", $qs[1], $width, $subject, $showrate=FALSE);
+		}
+	}
+	return;
+}
+
+function displayLinkSubmit(){
+	global $qs, $sql, $tp, $rs, $ns, $linkspage_pref, $link_shortcodes, $LINK_SUBMIT_TABLE, $LINK_SUBMIT_CAT;
+	if ($link_cats = $sql->db_Select("links_page_cat", "*", " link_category_class REGEXP '".e_CLASS_REGEXP."' ")) {
+		$LINK_SUBMIT_CAT = $rs -> form_select_open("cat_id");
+		while (list($cat_id, $cat_name, $cat_description) = $sql->db_Fetch()) {
+			$LINK_SUBMIT_CAT .= $rs -> form_option($cat_name, "0", $cat_id);
+		}
+		$LINK_SUBMIT_CAT .= $rs -> form_select_close();
+	}
+	$text = $tp -> parseTemplate($LINK_SUBMIT_TABLE, FALSE, $link_shortcodes);
+
+	$ns->tablerender(LAN_LINKS_31, $text);
+	return;
+}
+
+function displayCategory(){
+	global $sql, $sql2, $ns, $lc, $tp, $qs, $rowl, $link_shortcodes, $linkspage_pref, $total_links, $category_total, $alllinks;
+	global $LINK_MAIN_TABLE_END_ALL, $LINK_MAIN_TABLE, $LINK_MAIN_TABLE_START;
+
+	$order = $lc -> getOrder('cat');
+
+	$qry = "
+	SELECT lc.*
+	FROM #links_page_cat AS lc
+	WHERE lc.link_category_class REGEXP '".e_CLASS_REGEXP."' 
+	".$order."
+	";
+
+	if(!is_object($sql)){ $sql = new db; }
+	if(!is_object($sql2)){ $sql2 = new db; }
+	if (!$category_total = $sql->db_Select_gen($qry)){
+		$lc -> show_message(LAN_LINKS_41, LAN_LINKS_30);
+	}else{
+		$link_main_table_string = "";
+		$list = $sql->db_getList();
+		foreach($list as $rowl) {
+			$rowl['total_links'] = $sql2 -> db_Count("links_page", "(*)", "WHERE link_category = '".$rowl['link_category_id']."' AND link_class REGEXP '".e_CLASS_REGEXP."' ");
+			if((!isset($linkspage_pref['link_cat_empty']) || $linkspage_pref['link_cat_empty'] == 0 && $rowl['total_links'] > "0") || (isset($linkspage_pref['link_cat_empty']) && $linkspage_pref['link_cat_empty'])){
+				$alllinks = $alllinks + $rowl['total_links'];
+				$link_main_table_string .= $tp -> parseTemplate($LINK_MAIN_TABLE, FALSE, $link_shortcodes);
+			}
+		}
+		$link_main_table_start = $tp -> parseTemplate($LINK_MAIN_TABLE_START, FALSE, $link_shortcodes);
+		$link_main_table_end = $tp -> parseTemplate($LINK_MAIN_TABLE_END_ALL, FALSE, $link_shortcodes);
+		$text = $link_main_table_start.$link_main_table_string.$link_main_table_end;
+
+		$caption = LAN_LINKS_30;
+		$ns->tablerender($caption, $text);
+	}
+	return;
+}
+
+function displayNavigator($mode=''){
+	global $sql2, $ns, $lc, $tp, $cobj, $rowl, $qs, $linkspage_pref, $from, $link_shortcodes;
+	global $LINK_NAVIGATOR_TABLE, $LINK_SORTORDER, $LINK_NAVIGATOR, $LINK_NAVIGATOR_TABLE_PRE, $LINK_NAVIGATOR_TABLE_POST;
+
+	if($mode == "cat"){
+		if(isset($linkspage_pref['link_cat_sortorder']) && $linkspage_pref['link_cat_sortorder']){
+			$LINK_SORTORDER = $lc->showLinkSort('cat');
+		}	
+	}else{
+		if(isset($linkspage_pref['link_sortorder']) && $linkspage_pref['link_sortorder']){
+			$LINK_SORTORDER = $lc->showLinkSort();
+		}
+	}
+	$nav	= $tp -> parseTemplate('{LINK_NAVIGATOR}', FALSE, $link_shortcodes);
+	$so		= $tp -> parseTemplate('{LINK_SORTORDER}', FALSE, $link_shortcodes);
+	$LINK_NAVIGATOR_TABLE_PRE = FALSE;
+	$LINK_NAVIGATOR_TABLE_POST = FALSE;
+	if ($nav!="" || $so!="" ) {
+		$LINK_NAVIGATOR_TABLE_PRE = TRUE;
+		$LINK_NAVIGATOR_TABLE_POST = TRUE;
+	}
+	$text = $tp -> parseTemplate($LINK_NAVIGATOR_TABLE, FALSE, $link_shortcodes);
+	echo $text;
+}
+
+function displayCategoryLinks($mode=''){
+	global $sql2, $ns, $lc, $tp, $cobj, $rowl, $qs, $linkspage_pref, $from, $link_shortcodes;
+	global $LINK_TABLE_START, $LINK_TABLE, $LINK_TABLE_END, $LINK_APPEND;
+
+	$order			= $lc -> getOrder();
+	$number			= ($linkspage_pref["link_nextprev_number"] ? $linkspage_pref["link_nextprev_number"] : "20");
+	$nextprevquery	= ($mode && $linkspage_pref["link_nextprev"] ? "LIMIT ".intval($from).",".intval($number) : "");
+	$cat			= ($mode ? " AND l.link_category='".intval($mode)."' " : "");
+	$qry			= "
+	SELECT l.*, lc.*, COUNT(c.comment_id) AS link_comment
+	FROM #links_page AS l
+	LEFT JOIN #links_page_cat AS lc ON lc.link_category_id = l.link_category
+	LEFT JOIN #comments as c ON c.comment_item_id=l.link_id AND comment_type='links_page'
+	WHERE l.link_class REGEXP '".e_CLASS_REGEXP."' AND lc.link_category_class REGEXP '".e_CLASS_REGEXP."' ".$cat." 
+	GROUP BY l.link_id
+	".$order."
+	".$nextprevquery."
+	";
+
+	$link_table_string = "";
+	if(!is_object($sql2)){ $sql2 = new db; }
+	$link_total = $sql2 -> db_Count("links_page as l", "(*)", "WHERE l.link_class REGEXP '".e_CLASS_REGEXP."' ".$cat." ");
+	if (!$sql2->db_Select_gen($qry)){
+		$lc -> show_message(LAN_LINKS_34, LAN_LINKS_39);
+	}else{
+		$list = $sql2 -> db_getList();
+  	    foreach($list as $rowl) {
+			if($mode){
+				$cat_name			= $rowl['link_category_name'];
+				$cat_desc			= $rowl['link_category_description'];
+				$LINK_APPEND		= $lc -> parse_link_append($rowl['link_open'], $rowl['link_id']);
+				$link_table_string .= $tp -> parseTemplate($LINK_TABLE, FALSE, $link_shortcodes);			
+			}else{
+				$arr[$rowl['link_category_id']][] = $rowl;
+			}
+		}
+		if($mode){
+			$link_table_start		= $tp -> parseTemplate($LINK_TABLE_START, FALSE, $link_shortcodes);
+			$link_table_end			= $tp -> parseTemplate($LINK_TABLE_END, FALSE, $link_shortcodes);
+			$text = $link_table_start.$link_table_string.$link_table_end;
+			$caption = LAN_LINKS_32." ".$cat_name." ".($cat_desc ? " <i>[".$cat_desc."]</i>" : "");
+			//number of links
+			$caption .= " (<b title='".(ADMIN ? LAN_LINKS_2 : LAN_LINKS_1)."' >".$link_total."</b>".(ADMIN ? "/<b title='".(ADMIN ? LAN_LINKS_1 : "" )."' >".$link_total."</b>" : "").") ";
+			$ns->tablerender($caption, $text);
+
+			if(is_numeric($mode) && isset($linkspage_pref["link_nextprev"]) && $linkspage_pref["link_nextprev"]){
+				require_once(e_HANDLER."np_class.php");
+				$np_querystring = (isset($qs[0]) ? $qs[0] : "").(isset($qs[1]) ? ".".$qs[1] : "").(isset($qs[2]) ? ".".$qs[2] : "").(isset($qs[3]) ? ".".$qs[3] : "").(isset($qs[4]) ? ".".$qs[4] : "");
+				$ix = new nextprev(e_SELF, $from, $number, $link_total, NP_3, ($np_querystring ? $np_querystring : ""));
+			}
+		}else{
+			foreach($arr as $key => $value){
+				$link_table_string = "";
+				$i=0;
+				for($i=0;$i<count($value);$i++){
+					$rowl				= $value[$i];
+					$cat_name			= $rowl['link_category_name'];
+					$cat_desc			= $rowl['link_category_description'];
+					$LINK_APPEND		= $lc -> parse_link_append($rowl['link_open'], $rowl['link_id']);
+					$link_table_string .= $tp -> parseTemplate($LINK_TABLE, FALSE, $link_shortcodes);
+				}
+				$caption = LAN_LINKS_32." ".$cat_name." ".($cat_desc ? " <i>[".$cat_desc."]</i>" : "");
+				//number of links
+				$caption .= " (<b title='".(ADMIN ? LAN_LINKS_2 : LAN_LINKS_1)."' >".count($value)."</b>".(ADMIN ? "/<b title='".(ADMIN ? LAN_LINKS_1 : "" )."' >".count($value)."</b>" : "").") ";
+
+				$link_table_start		= $tp -> parseTemplate($LINK_TABLE_START, FALSE, $link_shortcodes);
+				$link_table_end			= $tp -> parseTemplate($LINK_TABLE_END, FALSE, $link_shortcodes);
+				$text = $link_table_start.$link_table_string.$link_table_end;
+				$ns->tablerender($caption, $text);
+			}
+		}
+	}
+	return;
+}
+
+require_once(FOOTERF);
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/links_template.php 75/e107_plugins/links_page/links_template.php
--- 6171/e107_plugins/links_page/links_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/links_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,232 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/links_template.php,v $
+|     $Revision: 1.17 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $link_shortcodes;
+
+//general : backlink to link frontpage
+$sc_style['LINK_NAVIGATOR']['pre'] = "<td style='text-align:right;'>";
+$sc_style['LINK_NAVIGATOR']['post'] = "</td>";
+
+//general : order menu
+$sc_style['LINK_SORTORDER']['pre'] = "<td style='text-align:left;'>";
+$sc_style['LINK_SORTORDER']['post'] = "</td>";
+
+$sc_style['LINK_CATMENU']['pre'] = "<td style='text-align:left;'>";
+$sc_style['LINK_CATMENU']['post'] = "</td>";
+
+$sc_style['LINK_NAVIGATOR_TABLE_PRE']['pre'] = "<table cellpadding='0' cellspacing='0' style='width:100%; margin-bottom:20px;'><tr>";
+$sc_style['LINK_NAVIGATOR_TABLE_PRE']['post'] = "";
+$sc_style['LINK_NAVIGATOR_TABLE_POST']['pre'] = "";
+$sc_style['LINK_NAVIGATOR_TABLE_POST']['post'] = "</tr></table>";
+
+$LINK_NAVIGATOR_TABLE = "{LINK_NAVIGATOR_TABLE_PRE}{LINK_SORTORDER}{LINK_NAVIGATOR}{LINK_NAVIGATOR_TABLE_POST}";
+
+
+
+$sc_style['LINK_MANAGE_NEWLINK']['pre'] = "<div style='text-align:right;'>";
+$sc_style['LINK_MANAGE_NEWLINK']['post'] = " >></div>";
+
+$LINK_TABLE_MANAGE_START = "
+	".$rs -> form_open("post", e_SELF."?".e_QUERY, "linkmanagerform", "", "enctype='multipart/form-data'", "")."
+	<table class='fborder' style='width:100%;' cellspacing='0' cellpadding='0'>
+	<tr>
+	<td style='width:15%' class='fcaption'>".LAN_LINKS_MANAGER_5."</td>
+	<td style='width:75%' class='fcaption'>".LAN_LINKS_MANAGER_1."</td>
+	<td style='width:10%' class='fcaption'>".LAN_LINKS_MANAGER_2."</td>
+	</tr>";
+
+$LINK_TABLE_MANAGE = "
+	<tr>
+	<td style='width:15%; padding-bottom:5px;' class='forumheader3'>{LINK_MANAGE_CAT}</td>
+	<td style='width:75%; padding-bottom:5px;' class='forumheader3'>{LINK_MANAGE_ICON} {LINK_MANAGE_NAME}</td>
+	<td style='width:10%; padding-bottom:5px; text-align:center; vertical-align:top;' class='forumheader3'>{LINK_MANAGE_OPTIONS}</td>
+	</tr>";
+
+$LINK_TABLE_MANAGE_END = "</table>".$rs -> form_close()."<br />{LINK_MANAGE_NEWLINK}";
+
+
+
+// MAIN TABLE -------------------------------------------------------------------------------
+$sc_style['LINK_MAIN_ICON']['pre'] = "<td rowspan='2' class='forumheader3' style='width:2%; text-align:left; padding-right:10px;'>";
+$sc_style['LINK_MAIN_ICON']['post'] = "</td>";
+
+$sc_style['LINK_MAIN_HEADING']['pre'] = "";
+$sc_style['LINK_MAIN_HEADING']['post'] = "";
+
+$sc_style['LINK_MAIN_DESC']['pre'] = "<tr><td class='forumheader3' colspan='3'>";
+$sc_style['LINK_MAIN_DESC']['post'] = "</td></tr>";
+
+$sc_style['LINK_MAIN_NUMBER']['pre'] = "<td class='forumheader' style='width:8%; white-space:nowrap;'>";
+$sc_style['LINK_MAIN_NUMBER']['post'] = "</td>";
+
+$sc_style['LINK_MAIN_TOTAL']['pre'] = "";
+$sc_style['LINK_MAIN_TOTAL']['post'] = "<br />";
+
+
+$LINK_MAIN_TABLE_START = "
+	<div style='text-align:center'>";
+
+$LINK_MAIN_TABLE = "
+	<table class='fborder' style='width:100%; margin-bottom:20px;' cellspacing='0' cellpadding='0'>
+	<tr>
+		{LINK_MAIN_ICON}
+		<td class='fcaption'>{LINK_MAIN_HEADING}</td>
+		{LINK_MAIN_NUMBER}
+	</tr>
+	{LINK_MAIN_DESC}
+	</table>";
+
+$LINK_MAIN_TABLE_END = "
+		<div style='text-align:right;'>
+		{LINK_MAIN_TOTAL}
+		</div>
+	</div>";
+
+$LINK_MAIN_TABLE_START_ALL = "
+	<div style='text-align:center'>";
+$LINK_MAIN_TABLE_END_ALL = "
+	</div>";
+
+
+
+
+// LINKS ITEM ----------------------------------------------------------------------------
+
+$sc_style['LINK_BUTTON']['pre'] = "<td rowspan='2' class='forumheader3' style='width:10%; text-align:center'>";
+$sc_style['LINK_BUTTON']['post'] = "</td>";
+
+$sc_style['LINK_URL']['pre'] = "<i>";
+$sc_style['LINK_URL']['post'] = "</i><br />";
+
+$sc_style['LINK_DESC']['post'] = "<br />";
+
+$LINK_TABLE_START = "
+	<div style='text-align:center'>";
+
+$LINK_TABLE = "<div style='text-align:center'>
+	<table class='fborder' style='width:95%; margin-bottom:20px;'>
+	<tr>
+		{LINK_BUTTON}
+		<td class='fcaption' style='width:90%'>
+			{LINK_NEW} {LINK_APPEND} {LINK_NAME} </a>
+		</td>
+		<td class='fcaption' style='white-space:nowrap'>
+		{LINK_COMMENT}&nbsp;{LINK_REFER}
+		</td>
+	</tr>
+	<tr><td colspan='2' class='forumheader3'>
+	{LINK_URL}
+	{LINK_DESC}
+	{LINK_RATING}
+	</td></tr>
+	</table></div>";
+
+$LINK_TABLE_END = "
+	</div>";
+
+
+
+// RATED -----------------------------------------------------------------------------------
+$sc_style['LINK_RATED_BUTTON']['pre'] = "<td rowspan='5' class='forumheader3' style='width:10%; text-align:center; padding-right:5px;'>";
+$sc_style['LINK_RATED_BUTTON']['post'] = "</td>";
+
+$sc_style['LINK_RATED_NAME']['pre'] = "";
+$sc_style['LINK_RATED_NAME']['post'] = "";
+
+$sc_style['LINK_RATED_URL']['pre'] = "<tr><td colspan='2' class='forumheader2' style='line-height:130%;'><i>";
+$sc_style['LINK_RATED_URL']['post'] = "</i></td></tr>";
+
+$sc_style['LINK_RATED_REFER']['pre'] = "<td class='forumheader' style='white-space:nowrap;'>";
+$sc_style['LINK_RATED_REFER']['post'] = "</td>";
+
+$sc_style['LINK_RATED_DESC']['pre'] = "<tr><td colspan='2' class='forumheader3' style='line-height:130%;'>";
+$sc_style['LINK_RATED_DESC']['post'] = "</td></tr>";
+
+$sc_style['LINK_RATED_RATING']['pre'] = "<td colspan='2' class='forumheader' style='line-height:130%; width:25%; white-space:nowrap; text-align:right;'>";
+$sc_style['LINK_RATED_RATING']['post'] = "</td>";
+
+$sc_style['LINK_RATED_CATEGORY']['pre'] = "<tr><td colspan='2' class='forumheader2' style='line-height:130%;'><i>";
+$sc_style['LINK_RATED_CATEGORY']['post'] = "</i></td></tr>";
+
+$LINK_RATED_TABLE_START = "
+	<div style='text-align:center'>
+	";
+
+$LINK_RATED_TABLE = "
+	<table class='fborder' style='width:100%; margin-bottom:20px;' cellspacing='0' cellpadding='0'>
+	<tr>
+		{LINK_RATED_BUTTON}
+		<td class='fcaption' style='width:75%;'>
+			{LINK_RATED_APPEND} {LINK_RATED_NAME} </a>
+		</td>
+		{LINK_RATED_RATING}
+	</tr>
+	{LINK_RATED_URL}
+	{LINK_RATED_CATEGORY}
+	{LINK_RATED_DESC}		
+	</table>";
+
+$LINK_RATED_TABLE_END = "
+	</div>";
+
+
+$sc_style['LINK_SUBMIT_PRETEXT']['pre'] = "<tr><td colspan='2' style='text-align:center' class='forumheader2'>";
+$sc_style['LINK_SUBMIT_PRETEXT']['post'] = "</td></tr>";
+
+// SUBMIT -----------------------------------------------------------------------------------
+$LINK_SUBMIT_TABLE = "
+	<div style='text-align:center'>
+	<form method='post' action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."'>	
+	<table class='fborder' style='width:100%' cellspacing='0' cellpadding='0'>
+	{LINK_SUBMIT_PRETEXT}
+	<tr>
+		<td class='forumheader3' style='width:30%'>".LCLAN_SL_10."</td>
+		<td class='forumheader3' style='width:70%'>{LINK_SUBMIT_CAT}</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:30%'><u>".LCLAN_SL_11."</u></td>
+		<td class='forumheader3' style='width:30%'><input class='tbox' type='text' name='link_name' size='60' value='' maxlength='100' /></td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:30%'><u>".LCLAN_SL_12."</u></td>
+		<td class='forumheader3' style='width:30%'><input class='tbox' type='text' name='link_url' size='60' value='' maxlength='200' /></td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:30%'><u>".LCLAN_SL_13."</u></td>
+		<td class='forumheader3' style='width:30%'><textarea class='tbox' name='link_description' cols='59' rows='3'></textarea></td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:30%'>".LCLAN_SL_14."</td>
+		<td class='forumheader3' style='width:30%'><input class='tbox' type='text' name='link_button' size='60' value='' maxlength='200' /></td>
+	</tr>
+	<tr>
+		<td colspan='2' style='text-align:center' class='forumheader3'><span class='smalltext'>".LCLAN_SL_15."</span></td>
+	</tr>
+	<tr>
+		<td colspan='2' style='text-align:center' class='forumheader'><input class='button' type='submit' name='add_link' value='".LCLAN_SL_16."' /></td>
+	</tr>
+	</table>
+	</form>
+	</div>
+	";
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/plugin.php 75/e107_plugins/links_page/plugin.php
--- 6171/e107_plugins/links_page/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/plugin.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,114 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/plugin.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$lan_file = e_PLUGIN."links_page/languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."links_page/languages/English.php");
+
+$eplug_name = LCLAN_PLUGIN_LAN_1;
+$eplug_version = "1.12";
+$eplug_author = "Eric Vanderfeesten (lisa)";
+$eplug_url = "http://e107.org";
+$eplug_email = "lisa@eindhovenseschool.net";
+$eplug_description = LCLAN_PLUGIN_LAN_2;
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";
+$eplug_latest = TRUE; //Show reported threads in admin (use e_latest.php)
+$eplug_status = TRUE; //Show post count in admin (use e_status.php)
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "links_page";
+
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_linkspage_config.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/linkspage_32.png";
+$eplug_icon_small = $eplug_folder."/images/linkspage_16.png";
+$eplug_caption = LCLAN_PLUGIN_LAN_3;
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array();
+
+// List of comment_type ids used by this plugin. -----------------------------
+$eplug_comment_ids = array("links_page");
+
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array(
+"links_page_cat",
+"links_page" );
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."links_page_cat (
+	link_category_id int(10) unsigned NOT NULL auto_increment,
+	link_category_name varchar(100) NOT NULL default '',
+	link_category_description varchar(250) NOT NULL default '',
+	link_category_icon varchar(100) NOT NULL default '',
+	link_category_order int(10) unsigned NOT NULL default '0',
+	link_category_class varchar(100) NOT NULL default '0',
+	link_category_datestamp int(10) unsigned NOT NULL default '0',
+	PRIMARY KEY  (link_category_id)
+	) TYPE=MyISAM;",
+
+	"CREATE TABLE ".MPREFIX."links_page (
+	link_id int(10) unsigned NOT NULL auto_increment,
+	link_name varchar(100) NOT NULL default '',
+	link_url varchar(200) NOT NULL default '',
+	link_description text NOT NULL,
+	link_button varchar(100) NOT NULL default '',
+	link_category tinyint(3) unsigned NOT NULL default '0',
+	link_order int(10) unsigned NOT NULL default '0',
+	link_refer int(10) unsigned NOT NULL default '0',
+	link_open tinyint(1) unsigned NOT NULL default '0',
+	link_class tinyint(3) unsigned NOT NULL default '0',
+	link_datestamp int(10) unsigned NOT NULL default '0',
+	link_author varchar(255) NOT NULL default '',
+	PRIMARY KEY  (link_id)
+	) TYPE=MyISAM;" );
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = TRUE;
+$eplug_link_name = LCLAN_PAGETITLE_1;
+$eplug_link_url = e_PLUGIN."links_page/links.php";
+
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = LCLAN_PLUGIN_LAN_5;
+$upgrade_add_prefs = "";
+$upgrade_remove_prefs = "";
+
+// upgrading ... //
+$upgrade_alter_tables = array(
+"ALTER TABLE ".MPREFIX."links_page ADD link_datestamp int(10) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."links_page ADD link_author varchar(255) NOT NULL default ''",
+"ALTER TABLE ".MPREFIX."links_page_cat ADD link_category_order int(10) unsigned NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."links_page_cat ADD link_category_class varchar(100) NOT NULL default '0'",
+"ALTER TABLE ".MPREFIX."links_page_cat ADD link_category_datestamp int(10) unsigned NOT NULL default '0'"
+);
+
+$eplug_upgrade_done = LCLAN_PLUGIN_LAN_6.': '.$eplug_version;
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/search/search_advanced.php 75/e107_plugins/links_page/search/search_advanced.php
--- 6171/e107_plugins/links_page/search/search_advanced.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/search/search_advanced.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,41 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/search/search_advanced.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$advanced['cat']['type'] = 'dropdown';
+$advanced['cat']['text'] = LAN_SEARCH_63.':';
+$advanced['cat']['list'][] = array('id' => 'all', 'title' => LAN_SEARCH_51);
+
+$advanced_caption['id'] = 'cat';
+$advanced_caption['title']['all'] = LNK_SCH_LAN_2;
+
+if ($sql -> db_Select("links_page_cat", "link_category_id, link_category_name")) {
+	while ($row = $sql -> db_Fetch()) {
+		$advanced['cat']['list'][] = array('id' => $row['link_category_id'], 'title' => $row['link_category_name']);
+		$advanced_caption['title'][$row['link_category_id']] = LNK_SCH_LAN_1.' -> '.$row['link_category_name'];
+	}
+}
+
+$advanced['match']['type'] = 'dropdown';
+$advanced['match']['text'] = LAN_SEARCH_52.':';
+$advanced['match']['list'][] = array('id' => 0, 'title' => LNK_SCH_LAN_3);
+$advanced['match']['list'][] = array('id' => 1, 'title' => LAN_SEARCH_54);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/search/search_comments.php 75/e107_plugins/links_page/search/search_comments.php
--- 6171/e107_plugins/links_page/search/search_comments.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/search/search_comments.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,21 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$comments_title = 'Links';
+$comments_type_id = 'links_page';
+$comments_return['links_page'] = "l.link_id, l.link_name";
+$comments_table['links_page'] = "LEFT JOIN #links_page AS l ON c.comment_type='links_page' AND l.link_id = c.comment_item_id";
+function com_search_links_page($row) {
+	global $con;
+	$datestamp = $con -> convert_date($row['comment_datestamp'], "long");
+	$res['link'] = e_PLUGIN."links_page/links.php?comment.".$row['link_id'];
+	$res['pre_title'] = 'Posted in reply to link: ';
+	$res['title'] = $row['link_name'];
+	$res['summary'] = $row['comment_comment'];
+	preg_match("/([0-9]+)\.(.*)/", $row['comment_author'], $user);
+	$res['detail'] = LAN_SEARCH_7."<a href='user.php?id.".$user[1]."'>".$user[2]."</a>".LAN_SEARCH_8.$datestamp;
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/links_page/search/search_parser.php 75/e107_plugins/links_page/search/search_parser.php
--- 6171/e107_plugins/links_page/search/search_parser.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/links_page/search/search_parser.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,55 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/links_page/search/search_parser.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// advanced 
+$advanced_where = "";
+if (isset($_GET['cat']) && is_numeric($_GET['cat'])) {
+	$advanced_where .= " l.link_category='".$_GET['cat']."' AND";
+}
+
+if (isset($_GET['match']) && $_GET['match']) {
+	$search_fields = array('l.link_name');
+} else {
+	$search_fields = array('l.link_name', 'l.link_description');
+}
+
+// basic
+$return_fields = 'l.link_id, l.link_name, l.link_description, l.link_url, l.link_category, l.link_class, c.link_category_name';
+$weights = array('1.2', '0.6');
+$no_results = LAN_198;
+$where = "l.link_class IN (".USERCLASS_LIST.") AND".$advanced_where;
+$order = "";
+$table = "links_page AS l LEFT JOIN #links_page_cat AS c ON l.link_category = c.link_category_id";
+
+$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_links', $no_results, $where, $order);
+$text .= $ps['text'];
+$results = $ps['results'];
+
+function search_links($row) {
+	$res['link'] = e_PLUGIN."links_page/links.php?".$row['link_id'];
+	$res['pre_title'] = $row['link_category_name']." | ";
+	$res['title'] = $row['link_name'];
+	$res['summary'] = $row['link_description'];
+	$res['detail'] = "<a href='".e_PLUGIN."links_page/links.php?".$row['link_id']."'>".$row['link_url']."</a>";
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/linkwords/admin_config.php 75/e107_plugins/linkwords/admin_config.php
--- 6171/e107_plugins/linkwords/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/linkwords/admin_config.php	2005-04-06 16:41:31.000000000 -0500
@@ -0,0 +1,186 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/linkwords/admin_config.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/04/06 21:41:31 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if (!getperms("P")) {
+	header("location:".e_BASE."index.php");
+	 exit ;
+}
+require_once(e_ADMIN."auth.php");
+@include_once(e_PLUGIN."linkwords/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."linkwords/languages/English.php");
+
+$deltest = array_flip($_POST);
+
+if(isset($deltest[LWLAN_17]))
+{
+	$delete_id = str_replace("delete_", "", $deltest[LWLAN_17]);
+
+	if ($sql->db_Count("linkwords", "(*)", "WHERE linkword_id = ".$delete_id))
+	{
+		$sql->db_Delete("linkwords", "linkword_id=".$delete_id);
+		$message = LWLAN_19;
+	}
+}
+
+if(e_QUERY)
+{
+	list($action, $id) = explode(".", e_QUERY);
+}
+
+if (isset($_POST['submit_linkword']))
+{
+	if(!$_POST['linkwords_word'] && $_POST['linkwords_url'])
+	{
+		$message = LWLAN_1;
+	}
+	else
+	{
+		$word = $tp -> toDB($_POST['linkword_word']);
+		$link = $tp -> toDB($_POST['linkword_link']);
+		$active = $_POST['linkword_active'];
+		$sql -> db_Insert("linkwords", "0, $active, '$word', '$link' ");
+		$message = LWLAN_2;
+	}
+}
+
+if (isset($_POST['update_linkword']))
+{
+	if(!$_POST['linkwords_word'] && $_POST['linkwords_url'])
+	{
+		$message = LWLAN_1;
+	}
+	else
+	{
+		$id = $_POST['id'];
+		$word = $tp -> toDB($_POST['linkword_word']);
+		$link = $tp -> toDB($_POST['linkword_link']);
+		$active = $_POST['linkword_active'];
+		$sql -> db_Update("linkwords", "linkword_active=$active, linkword_word='$word', linkword_link='$link' WHERE linkword_id=".$id);
+		$message = LWLAN_3;
+	}
+}
+
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+
+
+$text = "<div class='center'>\n";
+if(!$sql -> db_Select("linkwords"))
+{
+	$text .= LWLAN_4;
+}
+else
+{
+	$text = "
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+	<tr>
+	<td class='forumheader' style='width: 20%;'>".LWLAN_5."</td>
+	<td class='forumheader' style='width: 40%;'>".LWLAN_6."</td>
+	<td class='forumheader' style='width: 10%; text-align: center;'>".LWLAN_7."</td>
+	<td class='forumheader' style='width: 30%; text-align: center;'>".LWLAN_8."</td>
+	</tr>\n";
+
+	while($row = $sql -> db_Fetch())
+	{
+		extract($row);
+		$text .= "
+		
+		<form action='".e_SELF."' method='post' id='myform_$linkword_id'  onsubmit=\"return jsconfirm('".LWLAN_18." [ID: $linkword_id ]')\">
+		<tr>
+		<td class='forumheader' style='width: 20%;'>$linkword_word</td>
+		<td class='forumheader' style='width: 40%;'>$linkword_link</td>
+		<td class='forumheader' style='width: 10%; text-align: center;'>".(!$linkword_active ? LWLAN_12 : LWLAN_13)."</td>
+		<td class='forumheader' style='width: 30%; text-align: center;'>
+		<input class='button' type='button' onclick=\"document.location='".e_SELF."?edit.$linkword_id'\" value='Edit' id='edit_$linkword_id' name='edit_linkword_id' />
+		<input class='button' type='submit'  value='Delete' id='delete_$linkword_id' name='delete_$linkword_id' />
+		</td>
+		</tr>
+		</form>\n";
+	}
+	$text .= "</table>";
+}
+
+$text .= "</div>";
+$ns -> tablerender(LWLAN_11, $text);
+
+
+if($action == "edit")
+{
+
+	if($sql -> db_Select("linkwords", "*", "linkword_id=".$id))
+	{
+		$row = $sql -> db_Fetch();
+		extract($row);
+		define("EDIT", TRUE);
+	}
+}
+else
+{
+	unset($linkword_word, $linkword_link, $linkword_active);
+}
+
+
+
+
+
+
+$text = "
+<div class='center'>
+<form method='post' action='".e_SELF."'>
+<table style='".ADMIN_WIDTH."' class='fborder'>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".LWLAN_21."</td>
+<td style='width:50%' class='forumheader3'>
+<input class='tbox' type='text' name='linkword_word' size='40' value='".$linkword_word."' maxlength='100' />
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".LWLAN_6."</td>
+<td style='width:50%' class='forumheader3'>
+<input class='tbox' type='text' name='linkword_link' size='40' value='".$linkword_link."' maxlength='150' />
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".LWLAN_22."</td>
+<td style='width:50%; text-align:right' class='forumheader3'>
+<input type='radio' name='linkword_active' value='0'".(!$linkword_active ? " checked='checked'" : "")." /> ".LWLAN_9."&nbsp;&nbsp;
+<input type='radio' name='linkword_active' value='1'".($linkword_active ? " checked='checked'" : "")." /> ".LWLAN_10."
+</td>
+</tr>
+
+<tr>
+<td colspan='2' style='text-align:center' class='forumheader'>".
+(defined("EDIT") ? "<input class='button' type='submit' name='update_linkword' value='".LWLAN_15."' /><input type='hidden' name='id' value='$id' />" : "<input class='button' type='submit' name='submit_linkword' value='".LWLAN_14."' />")."
+</td>
+</tr>
+</table>
+</form>
+</div>\n";
+
+$ns -> tablerender($caption, $text);
+
+	
+require_once(e_ADMIN."footer.php");
+?>
\ No newline at end of file
Files 6171/e107_plugins/linkwords/images/linkwords_16.png and 75/e107_plugins/linkwords/images/linkwords_16.png differ
Files 6171/e107_plugins/linkwords/images/linkwords_32.png and 75/e107_plugins/linkwords/images/linkwords_32.png differ
diff -ruN 6171/e107_plugins/linkwords/languages/English.php 75/e107_plugins/linkwords/languages/English.php
--- 6171/e107_plugins/linkwords/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/linkwords/languages/English.php	2005-04-06 16:41:49.000000000 -0500
@@ -0,0 +1,31 @@
+<?php
+	
+define("LWLAN_1", "Field(s) left blank.");
+define("LWLAN_2", "Link word saved.");
+define("LWLAN_3", "Link word updated.");
+define("LWLAN_4", "No link words defined yet.");
+define("LWLAN_5", "Word");
+define("LWLAN_6", "Link");
+define("LWLAN_7", "Active?");
+define("LWLAN_8", "Options");
+define("LWLAN_9", "yes");
+define("LWLAN_10", "no");
+define("LWLAN_11", "Existing Linkwords");
+define("LWLAN_12", "Yes");
+define("LWLAN_13", "No");
+define("LWLAN_14", "Submit LinkWord");
+define("LWLAN_15", "Update LinkWord");
+define("LWLAN_16", "Edit");
+define("LWLAN_17", "Delete");
+define("LWLAN_18", "Are you sure you want to delete this linkword?");
+define("LWLAN_19", "Linkword deleted.");
+define("LWLAN_20", "Unable to find that linkword entry.");
+define("LWLAN_21","Word to autolink");
+define("LWLAN_22","Activate?");
+
+define("LWLANINS_1", "Linkwords");
+define("LWLANINS_2", "This plugin will link specified words with a defined link");
+define("LWLANINS_3", "Configure LinkWords");
+define("LWLANINS_4", "To configure please click on the link in the plugins section of the admin front page");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/linkwords/linkwords.php 75/e107_plugins/linkwords/linkwords.php
--- 6171/e107_plugins/linkwords/linkwords.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/linkwords/linkwords.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,59 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/linkwords/linkwords.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class e_linkwords
+{
+	var $linkwords = array();
+	var $linkurls = array();
+
+	function e_linkwords()
+	{
+		/* constructor */
+		$sql = new db;
+		if($sql -> db_Select("linkwords", "*", "linkword_active=0"))
+		{
+			$linkWords = $sql -> db_getList();
+			foreach($linkWords as $words)
+			{
+				$word = $words['linkword_word'];
+				$this -> linkwords[] = $word;
+				$this -> linkurls[] = " <a href='".$words['linkword_link']."' rel='external'>$word</a>";
+				$word2 = substr_replace($word, strtoupper($word[0]), 0, 1);
+				$this -> linkwords[] = $word2;
+				$this -> linkurls[] = " <a href='".$words['linkword_link']."' rel='external'>$word2</a>";
+
+			}
+		}
+	}
+
+	function linkwords($text)
+	{
+		$content = preg_split('#(<.*>)#mis', $text, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
+		$ptext = "";
+		foreach($content as $cont)
+		{
+			$ptext .= (strstr($cont, "<") ? $cont : str_replace($this -> linkwords, $this -> linkurls, $cont));
+		}
+		return $ptext;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/linkwords/linkwords_sql.php 75/e107_plugins/linkwords/linkwords_sql.php
--- 6171/e107_plugins/linkwords/linkwords_sql.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/linkwords/linkwords_sql.php	2005-04-11 13:28:57.000000000 -0500
@@ -0,0 +1,7 @@
+CREATE TABLE linkwords (
+linkword_id INT(10) UNSIGNED NOT NULL auto_increment,
+linkword_active tinyint(1) unsigned NOT NULL default '0',
+linkword_word varchar(100) NOT NULL default '',
+linkword_link varchar(150) NOT NULL default '',
+PRIMARY KEY  (linkword_id)
+) TYPE=MyISAM AUTO_INCREMENT=1;
\ No newline at end of file
diff -ruN 6171/e107_plugins/linkwords/plugin.php 75/e107_plugins/linkwords/plugin.php
--- 6171/e107_plugins/linkwords/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/linkwords/plugin.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,98 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/linkwords/plugin.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."linkwords/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."linkwords/languages/English.php");
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = LWLANINS_1;
+$eplug_version = "1.0";
+$eplug_author = "jalist";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = LWLANINS_2;
+$eplug_compatible = "e107v7+";
+$eplug_readme = "";
+// leave blank if no readme file
+	
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "linkwords";
+	
+// Mane of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "";
+	
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+	
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/linkwords_32.png";
+$eplug_icon_small = $eplug_folder."/images/linkwords_16.png";
+$eplug_caption = LWLANINS_3;
+	
+// List of preferences -----------------------------------------------------------------------------------------------
+
+$eplug_array_pref = array(
+	'tohtml_hook' => 'linkwords'
+	);
+	
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array(
+	"linkwords"
+);
+	
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+	"CREATE TABLE ".MPREFIX."linkwords (
+	linkword_id INT UNSIGNED NOT NULL auto_increment,
+	linkword_active tinyint(1) unsigned NOT NULL default '0',
+	linkword_word varchar(100) NOT NULL default '',
+	linkword_link varchar(150) NOT NULL default '',
+	PRIMARY KEY ( linkword_id )
+	) TYPE=MyISAM AUTO_INCREMENT=1;"
+);
+	
+	
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$ec_dir = e_PLUGIN."";
+$eplug_link_url = "";
+	
+	
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = LWLANINS_4;
+	
+	
+// upgrading ... //
+	
+$upgrade_add_prefs = "";
+	
+$upgrade_remove_prefs = "";
+	
+$upgrade_alter_tables = "";
+	
+$eplug_upgrade_done = "";
+	
+	
+	
+	
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/admin_list_config.php 75/e107_plugins/list_new/admin_list_config.php
--- 6171/e107_plugins/list_new/admin_list_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/admin_list_config.php	2005-09-15 03:16:00.000000000 -0500
@@ -0,0 +1,530 @@
+<?php
+/*
++---------------------------------------------------------------+
+|       e107 website system
+|
+|       Steve Dunstan 2001-2002
+|       http://e107.org
+|       jalist@e107.org
+|
+|       Released under the terms and conditions of the
+|       GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/list_new/admin_list_config.php,v $
+|		$Revision: 1.6 $
+|		$Date: 2005/09/15 08:16:00 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+//include and require several classes
+require_once("../../class2.php");
+if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+require_once(e_HANDLER."file_class.php");
+$fl = new e_file;
+$listplugindir = e_PLUGIN."list_new/";
+require_once($listplugindir."list_class.php");
+$rc = new listclass;
+
+//get language file
+$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
+include(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
+
+//get all sections to use (and reload if new e_list.php files are added)
+$rc -> getSections();
+
+//update preferences in database
+if(isset($_POST['update_menu'])){
+	while(list($key, $value) = each($_POST)){
+		if($value != LIST_ADMIN_2){ $list_pref[$tp->toDB($key)] = $tp->toDB($value); }
+	}
+
+	$tmp = $eArrayStorage->WriteArray($list_pref);
+	$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='list' ");
+
+	$message = LIST_ADMIN_3;
+}
+
+//check preferences from database
+$list_pref	= $rc -> getListPrefs();
+
+
+$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*');
+$iconlist = $fl->get_files($listplugindir."images/", "", $rejectlist);
+
+//render message if set
+if(isset($message)){
+	$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+
+//define some variables
+$stylespacer = "style='border:0; height:20px;'";
+$styletable = "style='width:90%; border:1px solid #444; border-collapse:collapse;' cellpadding='0' cellspacing='0' ";
+
+//template for non expanding row
+$TOPIC_ROW_NOEXPAND = "
+<tr>
+	<td class='forumheader3' style='width:20%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
+	<td class='forumheader3'>{TOPIC_FIELD}</td>
+</tr>
+";
+
+//template for expanding row
+$TOPIC_ROW = "
+<tr>
+	<td class='forumheader3' style='width:20%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
+	<td class='forumheader3'>
+		<a style='cursor: pointer; cursor: hand' onclick='expandit(this);'>{TOPIC_HEADING}</a>
+		<div style='display: none;'>
+			<div class='smalltext'>{TOPIC_HELP}</div><br />
+			{TOPIC_FIELD}
+		</div>
+	</td>
+</tr>
+";
+
+//template for spacer row
+$TOPIC_ROW_SPACER = "<tr><td $stylespacer colspan='2'></td></tr>";
+
+$TOPIC_TABLE_START = "
+<div style='text-align:center;'>
+".$rs -> form_open("post", e_SELF, "menu_conf_form", "", "enctype='multipart/form-data'")."
+<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+//$TOPIC_TABLE_END = "
+//</table>
+//</form>
+//</div>";
+$TOPIC_TABLE_END = pref_submit()."</table></div>";
+
+
+$text = "
+<script type=\"text/javascript\">
+<!--
+var hideid=\"recent_page\";
+function showhideit(showid){
+	if (hideid!=showid){
+		show=document.getElementById(showid).style;
+		hide=document.getElementById(hideid).style;
+		show.display=\"\";
+		hide.display=\"none\";
+		hideid = showid;
+	}
+}
+//-->
+</script>";
+
+$text .= "
+<div style='text-align:center'>
+".$rs -> form_open("post", e_SELF, "menu_conf_form", "", "enctype='multipart/form-data'")."\n";
+
+$text .= parse_menu_options("recent_menu");
+$text .= parse_menu_options("new_menu");
+$text .= parse_page_options("recent_page");
+$text .= parse_page_options("new_page");
+
+$text .= "
+</form>
+</div>";
+
+$ns -> tablerender(LIST_ADMIN_1, $text);
+
+
+function parse_global_options($type){
+	global $rc, $list_pref, $rs, $tp, $sections, $titles, $iconlist, $TOPIC_ROW, $TOPIC_ROW_SPACER, $TOPIC_TABLE_END;
+
+	//show sections
+	$TOPIC_TOPIC = LIST_ADMIN_SECT_1;
+	$TOPIC_HEADING = LIST_ADMIN_SECT_2;
+	$TOPIC_HELP = LIST_ADMIN_SECT_3;
+	$TOPIC_FIELD = "";
+	for($i=0;$i<count($sections);$i++){
+		$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_display", 1, ($list_pref[$sections[$i]."_".$type."_display"]) ? "1" : "0")." ".$titles[$i]."<br />";
+	}
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//open or closed
+	$TOPIC_TOPIC = LIST_ADMIN_SECT_4;
+	$TOPIC_HEADING = LIST_ADMIN_SECT_5;
+	$TOPIC_HELP = LIST_ADMIN_SECT_6;
+	$TOPIC_FIELD = "";
+	for($i=0;$i<count($sections);$i++){
+		$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_open", 1, (isset($list_pref[$sections[$i]."_".$type."_open"]) ? "1" : "0"))." ".$titles[$i]."<br />";
+	}
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//author
+	$TOPIC_TOPIC = LIST_ADMIN_SECT_7;
+	$TOPIC_HEADING = LIST_ADMIN_SECT_8;
+	$TOPIC_HELP = LIST_ADMIN_SECT_9;
+	$TOPIC_FIELD = "";
+	for($i=0;$i<count($sections);$i++){
+		$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_author", 1, (isset($list_pref[$sections[$i]."_".$type."_author"]) ? "1" : "0"))." ".$titles[$i]."<br />";
+	}
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//category
+	$TOPIC_TOPIC = LIST_ADMIN_SECT_10;
+	$TOPIC_HEADING = LIST_ADMIN_SECT_11;
+	$TOPIC_HELP = LIST_ADMIN_SECT_12;
+	$TOPIC_FIELD = "";
+	for($i=0;$i<count($sections);$i++){
+		$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_category", 1, (isset($list_pref[$sections[$i]."_".$type."_category"]) ? "1" : "0"))." ".$titles[$i]."<br />";
+	}
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//date
+	$TOPIC_TOPIC = LIST_ADMIN_SECT_13;
+	$TOPIC_HEADING = LIST_ADMIN_SECT_14;
+	$TOPIC_HELP = LIST_ADMIN_SECT_15;
+	$TOPIC_FIELD = "";
+	for($i=0;$i<count($sections);$i++){
+		$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_date", 1, (isset($list_pref[$sections[$i]."_".$type."_date"]) ? "1" : "0"))." ".$titles[$i]."<br />";
+	}
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//icon
+	$TOPIC_TOPIC = LIST_ADMIN_SECT_22;
+	$TOPIC_HEADING = LIST_ADMIN_SECT_23;
+	$TOPIC_HELP = LIST_ADMIN_SECT_24;
+	$TOPIC_FIELD = "<table $styletable>";
+	for($i=0;$i<count($sections);$i++){
+		$TOPIC_FIELD .= "
+		<tr>
+		<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$titles[$i]."</td>
+		<td class='forumheader3'>
+			".$rs -> form_text($sections[$i]."_".$type."_icon", 15, $list_pref[$sections[$i]."_".$type."_icon"], 100)."
+			<input class='button' type='button' style='cursor:hand' size='30' value='".LIST_ADMIN_12."' onClick=\"expandit('div_".$sections[$i]."_".$type."_icon')\" />
+			<div id='div_".$sections[$i]."_".$type."_icon' style='display:none;'>";
+			foreach($iconlist as $icon){
+				$TOPIC_FIELD .= "<a href=\"javascript:insertext('".$icon['fname']."','".$sections[$i]."_".$type."_icon','div_".$sections[$i]."_".$type."_icon')\"><img src='".$icon['path'].$icon['fname']."' style='border:0' alt='' /></a> ";
+			}
+			$TOPIC_FIELD .= "</div>
+		</td>
+		</tr>";
+	}
+	$TOPIC_FIELD .= "</table>";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//amount
+	$maxitems_amount = "50";
+	$TOPIC_TOPIC = LIST_ADMIN_SECT_16;
+	$TOPIC_HEADING = LIST_ADMIN_SECT_17;
+	$TOPIC_HELP = LIST_ADMIN_SECT_18;
+	$TOPIC_FIELD = "<table $styletable>";
+	for($i=0;$i<count($sections);$i++){
+		$TOPIC_FIELD .= "
+		<tr>
+		<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$titles[$i]."</td>
+		<td class='forumheader3'>
+			".$rs -> form_select_open($sections[$i]."_".$type."_amount");
+			for($a=1; $a<=$maxitems_amount; $a++){
+				$TOPIC_FIELD .= ($list_pref[$sections[$i]."_".$type."_amount"] == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a));
+			}
+			$TOPIC_FIELD .= $rs -> form_select_close()."
+		</td>
+		</tr>";
+	}
+	$TOPIC_FIELD .= "</table>";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//order
+	$max = count($sections);
+	$TOPIC_TOPIC = LIST_ADMIN_SECT_19;
+	$TOPIC_HEADING = LIST_ADMIN_SECT_20;
+	$TOPIC_HELP = LIST_ADMIN_SECT_21;
+	$TOPIC_FIELD = "<table $styletable>";
+	for($i=0;$i<count($sections);$i++){
+		$TOPIC_FIELD .= "
+		<tr>
+		<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$titles[$i]."</td>
+		<td class='forumheader3'>
+		".$rs -> form_select_open($sections[$i]."_".$type."_order");
+		for($a=1; $a<=$max; $a++){
+			$TOPIC_FIELD .= ($list_pref[$sections[$i]."_".$type."_order"] == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a));
+		}
+		$TOPIC_FIELD .= $rs -> form_select_close()."
+		</td>
+		</tr>";
+	}
+	$TOPIC_FIELD .= "</table>";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//caption
+	$TOPIC_TOPIC = LIST_ADMIN_SECT_25;
+	$TOPIC_HEADING = LIST_ADMIN_SECT_26;
+	$TOPIC_HELP = LIST_ADMIN_SECT_27;
+	$TOPIC_FIELD = "<table $styletable>";
+	for($i=0;$i<count($sections);$i++){
+		$TOPIC_FIELD .= "
+		<tr>
+		<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$titles[$i]."</td>
+		<td class='forumheader3'>
+			".$rs -> form_text($sections[$i]."_".$type."_caption", 30, $tp->toHTML($list_pref[$sections[$i]."_".$type."_caption"],"","defs"), "50", "tbox")."
+		</td>
+		</tr>";
+	}
+	$TOPIC_FIELD .= "</table>";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	$text .= $TOPIC_ROW_SPACER;
+
+	return $text;
+}
+
+
+//---------------------------------------------------------------------------------------------------
+function parse_menu_options($type){
+	global $rc, $list_pref, $rs, $tp, $sections, $titles, $iconlist, $TOPIC_ROW, $TOPIC_ROW_SPACER, $TOPIC_TABLE_END;
+
+	$text = "
+	<div id='".$type."' style='display:none; text-align:center'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+	if($type == "new_menu"){
+		$text .= $rc -> parse_headerrow_title(LIST_ADMIN_OPT_5);
+	}else{
+		$text .= $rc -> parse_headerrow_title(LIST_ADMIN_OPT_3);
+	}
+
+	$text .= parse_global_options($type);
+
+	//menu preference : caption
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_2;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_3;
+	$TOPIC_HELP = LIST_ADMIN_LAN_4;
+	$TOPIC_FIELD = $rs -> form_text($type."_caption", "30", $tp->toHTML($list_pref[$type."_caption"],"","defs"), "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//menu preference : icon : use
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_5;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_6;
+	$TOPIC_HELP = LIST_ADMIN_LAN_7;
+	$TOPIC_FIELD = "
+		".$rs -> form_radio($type."_icon_use", "1", ($list_pref[$type."_icon_use"] ? "1" : "0"), "", "").LIST_ADMIN_7."
+		".$rs -> form_radio($type."_icon_use", "0", ($list_pref[$type."_icon_use"] ? "0" : "1"), "", "").LIST_ADMIN_8."
+	";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//menu preference : icon : show default theme bullet
+	$TOPIC_TOPIC = LIST_ADMIN_MENU_2;
+	$TOPIC_HEADING = LIST_ADMIN_MENU_3;
+	$TOPIC_HELP = LIST_ADMIN_MENU_4;
+	$TOPIC_FIELD = "
+		".$rs -> form_radio($type."_icon_default", "1", ($list_pref[$type."_icon_default"] ? "1" : "0"), "", "").LIST_ADMIN_7."
+		".$rs -> form_radio($type."_icon_default", "0", ($list_pref[$type."_icon_default"] ? "0" : "1"), "", "").LIST_ADMIN_8."
+	";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//menu preference : amount chars
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_8;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_9;
+	$TOPIC_HELP = LIST_ADMIN_LAN_10;
+	$TOPIC_FIELD = $rs -> form_text($type."_char_heading", "30", $list_pref[$type."_char_heading"], "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//menu preference : postfix
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_11;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_12;
+	$TOPIC_HELP = LIST_ADMIN_LAN_13;
+	$TOPIC_FIELD = $rs -> form_text($type."_char_postfix", "30", $list_pref[$type."_char_postfix"], "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//menu preference : date
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_14;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_15;
+	$TOPIC_HELP = LIST_ADMIN_LAN_16;
+	$TOPIC_FIELD = $rs -> form_text($type."_datestyle", "30", $list_pref[$type."_datestyle"], "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//menu preference : date today
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_17;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_18;
+	$TOPIC_HELP = LIST_ADMIN_LAN_19;
+	$TOPIC_FIELD = $rs -> form_text($type."_datestyletoday", "30", $list_pref[$type."_datestyletoday"], "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//menu preference : show empty
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_26;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_27;
+	$TOPIC_HELP = LIST_ADMIN_LAN_28;
+	$TOPIC_FIELD = "
+		".$rs -> form_radio($type."_showempty", "1", ($list_pref[$type."_showempty"] ? "1" : "0"), "", "").LIST_ADMIN_7."
+		".$rs -> form_radio($type."_showempty", "0", ($list_pref[$type."_showempty"] ? "0" : "1"), "", "").LIST_ADMIN_8."
+	";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	$text .= $TOPIC_ROW_SPACER;
+	$text .= $TOPIC_TABLE_END;
+
+	return $text;
+}
+//---------------------------------------------------------------------------------------------------
+
+
+//---------------------------------------------------------------------------------------------------
+function parse_page_options($type){
+	global $rc, $list_pref, $rs, $tp, $sections, $TOPIC_ROW, $TOPIC_ROW_SPACER, $TOPIC_TABLE_END;
+
+	if($type == "recent_page"){
+		$display = "display:;";
+	}else{
+		$display = "display:none;";
+	}
+
+	$text = "
+	<div id='".$type."' style='".$display." text-align:center'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+	if($type == "new_page"){
+		$text .= $rc -> parse_headerrow_title(LIST_ADMIN_OPT_4);
+	}else{
+		$text .= $rc -> parse_headerrow_title(LIST_ADMIN_OPT_2);
+	}
+
+	$text .= parse_global_options($type);
+
+	//page preference : caption
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_2;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_3;
+	$TOPIC_HELP = LIST_ADMIN_LAN_4;
+	$TOPIC_FIELD = $rs -> form_text($type."_caption", "30", $tp->toHTML($list_pref[$type."_caption"],"","defs"), "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//page preference : icon : use
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_5;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_6;
+	$TOPIC_HELP = LIST_ADMIN_LAN_7;
+	$TOPIC_FIELD = "
+		".$rs -> form_radio($type."_icon_use", "1", ($list_pref[$type."_icon_use"] ? "1" : "0"), "", "").LIST_ADMIN_7."
+		".$rs -> form_radio($type."_icon_use", "0", ($list_pref[$type."_icon_use"] ? "0" : "1"), "", "").LIST_ADMIN_8."
+	";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//page preference : icon : show default theme bullet
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_29;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_30;
+	$TOPIC_HELP = LIST_ADMIN_LAN_31;
+	$TOPIC_FIELD = "
+		".$rs -> form_radio($type."_icon_default", "1", ($list_pref[$type."_icon_default"] ? "1" : "0"), "", "").LIST_ADMIN_7."
+		".$rs -> form_radio($type."_icon_default", "0", ($list_pref[$type."_icon_default"] ? "0" : "1"), "", "").LIST_ADMIN_8."
+	";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//page preference : amount chars
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_8;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_9;
+	$TOPIC_HELP = LIST_ADMIN_LAN_10;
+	$TOPIC_FIELD = $rs -> form_text($type."_char_heading", "30", $list_pref[$type."_char_heading"], "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//page preference : postfix
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_11;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_12;
+	$TOPIC_HELP = LIST_ADMIN_LAN_13;
+	$TOPIC_FIELD = $rs -> form_text($type."_char_postfix", "30", $list_pref[$type."_char_postfix"], "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//page preference : date
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_14;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_15;
+	$TOPIC_HELP = LIST_ADMIN_LAN_16;
+	$TOPIC_FIELD = $rs -> form_text($type."_datestyle", "30", $list_pref[$type."_datestyle"], "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//page preference : date today
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_17;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_18;
+	$TOPIC_HELP = LIST_ADMIN_LAN_19;
+	$TOPIC_FIELD = $rs -> form_text($type."_datestyletoday", "30", $list_pref[$type."_datestyletoday"], "50", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//page preference : show empty
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_26;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_27;
+	$TOPIC_HELP = LIST_ADMIN_LAN_28;
+	$TOPIC_FIELD = "
+		".$rs -> form_radio($type."_showempty", "1", ($list_pref[$type."_showempty"] ? "1" : "0"), "", "").LIST_ADMIN_7."
+		".$rs -> form_radio($type."_showempty", "0", ($list_pref[$type."_showempty"] ? "0" : "1"), "", "").LIST_ADMIN_8."
+	";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//page preference : colomn
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_20;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_21;
+	$TOPIC_HELP = LIST_ADMIN_LAN_22;
+	$TOPIC_FIELD = $rs -> form_select_open($type."_colomn");
+		for($a=1; $a<=count($sections); $a++){
+			$TOPIC_FIELD .= ($list_pref[$type."_colomn"] == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a));
+		}
+		$TOPIC_FIELD .= $rs -> form_select_close();
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	//page preference : welcome text
+	$TOPIC_TOPIC = LIST_ADMIN_LAN_23;
+	$TOPIC_HEADING = LIST_ADMIN_LAN_24;
+	$TOPIC_HELP = LIST_ADMIN_LAN_25;
+	$TOPIC_FIELD = $rs -> form_textarea($type."_welcometext", "50", "5", $tp->toHTML($list_pref[$type."_welcometext"],"","defs"), "", "tbox");
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+	if($type == "new_page"){
+		//timelapse:show
+		$TOPIC_TOPIC = LIST_ADMIN_LAN_36;
+		$TOPIC_HEADING = LIST_ADMIN_LAN_37;
+		$TOPIC_HELP = LIST_ADMIN_LAN_38;
+		$TOPIC_FIELD = "
+			".$rs -> form_radio($type."_timelapse", "1", ($list_pref[$type."_timelapse"] ? "1" : "0"), "", "").LIST_ADMIN_7."
+			".$rs -> form_radio($type."_timelapse", "0", ($list_pref[$type."_timelapse"] ? "0" : "1"), "", "").LIST_ADMIN_8."
+		";
+		$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+
+		//timelapse day number maximum
+		$TOPIC_TOPIC = LIST_ADMIN_LAN_32;
+		$TOPIC_HEADING = LIST_ADMIN_LAN_33;
+		$TOPIC_HELP = LIST_ADMIN_LAN_34;
+		$TOPIC_FIELD = $rs -> form_text($type."_timelapse_days", "3", $list_pref[$type."_timelapse_days"], "3", "tbox")." ".LIST_ADMIN_LAN_35;
+		$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
+	}
+
+	$text .= $TOPIC_ROW_SPACER;
+	$text .= $TOPIC_TABLE_END;
+
+	return $text;
+}
+//---------------------------------------------------------------------------------------------------
+
+
+
+function pref_submit() {
+	global $rs, $TOPIC_ROW_NOEXPAND;
+
+	$TOPIC_TOPIC = LIST_ADMIN_11;
+	$TOPIC_FIELD = $rs -> form_button("submit", update_menu, LIST_ADMIN_2);
+	return (preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND));
+}
+
+
+// ##### Display options --------------------------------------------------------------------------
+function admin_list_config_adminmenu(){
+
+				$act = "";
+				unset($var);
+				$var=array();
+				//$var['general']['text']			= LIST_ADMIN_OPT_1;
+				$var['recent_page']['text']		= LIST_ADMIN_OPT_2;
+				$var['recent_menu']['text']		= LIST_ADMIN_OPT_3;
+				$var['new_page']['text']		= LIST_ADMIN_OPT_4;
+				$var['new_menu']['text']		= LIST_ADMIN_OPT_5;
+
+				show_admin_menu(LIST_ADMIN_OPT_6, $act, $var, TRUE);
+
+}
+// ##### End --------------------------------------------------------------------------------------
+
+require_once(e_ADMIN."footer.php");
+
+?>
Files 6171/e107_plugins/list_new/icon/list_16.png and 75/e107_plugins/list_new/icon/list_16.png differ
Files 6171/e107_plugins/list_new/icon/list_32.png and 75/e107_plugins/list_new/icon/list_32.png differ
Files 6171/e107_plugins/list_new/images/icon10.gif and 75/e107_plugins/list_new/images/icon10.gif differ
Files 6171/e107_plugins/list_new/images/icon11.gif and 75/e107_plugins/list_new/images/icon11.gif differ
Files 6171/e107_plugins/list_new/images/icon1.gif and 75/e107_plugins/list_new/images/icon1.gif differ
Files 6171/e107_plugins/list_new/images/icon2.gif and 75/e107_plugins/list_new/images/icon2.gif differ
Files 6171/e107_plugins/list_new/images/icon3.gif and 75/e107_plugins/list_new/images/icon3.gif differ
Files 6171/e107_plugins/list_new/images/icon4.gif and 75/e107_plugins/list_new/images/icon4.gif differ
Files 6171/e107_plugins/list_new/images/icon5.gif and 75/e107_plugins/list_new/images/icon5.gif differ
Files 6171/e107_plugins/list_new/images/icon6.gif and 75/e107_plugins/list_new/images/icon6.gif differ
Files 6171/e107_plugins/list_new/images/icon7.gif and 75/e107_plugins/list_new/images/icon7.gif differ
Files 6171/e107_plugins/list_new/images/icon8.gif and 75/e107_plugins/list_new/images/icon8.gif differ
Files 6171/e107_plugins/list_new/images/icon9.gif and 75/e107_plugins/list_new/images/icon9.gif differ
diff -ruN 6171/e107_plugins/list_new/languages/English.php 75/e107_plugins/list_new/languages/English.php
--- 6171/e107_plugins/list_new/languages/English.php	2004-08-12 09:16:08.000000000 -0500
+++ 75/e107_plugins/list_new/languages/English.php	2005-12-30 09:26:25.000000000 -0600
@@ -1,41 +1,202 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-
-define("LIST_1", "News Items");
-define("LIST_2", "Comments");
-define("LIST_3", "New since your last visit ...");
-define("LIST_4", "None");
-define("LIST_5", "Chatbox posts");
-define("LIST_6", "Forum posts");
-define("LIST_7", "New members");
-define("LIST_8", "found");
-define("LIST_9", "news items");
-define("LIST_10", "returned");
-define("LIST_11", "Admin");
-define("LIST_12", "Settings");
-define("LIST_13", "Profile");
-define("LIST_14", "Article");
-define("LIST_15", "Content");
-define("LIST_16", "Review");
-define("LIST_17", "Download");
-define("LIST_18", "FAQ");
-define("LIST_18", "Poll");
-define("LIST_19", "Docs");
-define("LIST_20", "Bugtracker");
-
-define("LIST_21", "Articles");
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/list_new/languages/English.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2005/12/30 15:26:25 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+define("PAGE_NAME", "List New Items");
+
+define("LIST_PLUGIN_1", "List");
+define("LIST_PLUGIN_2", "This plugin allows you to view a list of recent additions in all e107 categories. You can either view the list with data since your last visit, or view a general latest additions list. Besides the page a menu is also present. Every section is configurable in the admin area.");
+define("LIST_PLUGIN_3", "Configure Main Menu");
+define("LIST_PLUGIN_4", "The List_new plugin is now ready to be used.");
+define("LIST_PLUGIN_5", "list");
+define("LIST_PLUGIN_6", "This plugin is not installed.");
+
+define("LIST_ADMIN_1", "recent");
+define("LIST_ADMIN_2", "update settings");
+define("LIST_ADMIN_3", "settings updated");
+define("LIST_ADMIN_4", "section");
+define("LIST_ADMIN_5", "menu");
+define("LIST_ADMIN_6", "page");
+define("LIST_ADMIN_7", "enabled");
+define("LIST_ADMIN_8", "disabled");
+define("LIST_ADMIN_9", "open");
+define("LIST_ADMIN_10", "closed");
+define("LIST_ADMIN_11", "update");
+define("LIST_ADMIN_12", "choose");
+define("LIST_ADMIN_13", "Welcome on the Recent page of ".SITENAME." ! This page shows for the most common sections of this site a list with the most recent additions in these sections.");
+define("LIST_ADMIN_14", "recent additions");
+define("LIST_ADMIN_15", "new since your last visit");
+define("LIST_ADMIN_16", "Welcome on the New page of ".SITENAME." ! This page shows for the most common sections of this site a list with the additions in these sections since your last visit.");
+
+define("LIST_ADMIN_SECT_1", "sections");
+define("LIST_ADMIN_SECT_2", "choose which sections to show");
+define("LIST_ADMIN_SECT_3", "");
+
+define("LIST_ADMIN_SECT_4", "display style");
+define("LIST_ADMIN_SECT_5", "choose which sections are opened by default");
+define("LIST_ADMIN_SECT_6", "");
+
+define("LIST_ADMIN_SECT_7", "author");
+define("LIST_ADMIN_SECT_8", "choose if the author should be displayed");
+define("LIST_ADMIN_SECT_9", "");
+
+define("LIST_ADMIN_SECT_10", "category");
+define("LIST_ADMIN_SECT_11", "choose if the category should be displayed");
+define("LIST_ADMIN_SECT_12", "");
+
+define("LIST_ADMIN_SECT_13", "date");
+define("LIST_ADMIN_SECT_14", "choose if the date should be displayed");
+define("LIST_ADMIN_SECT_15", "");
+
+define("LIST_ADMIN_SECT_16", "amount items");
+define("LIST_ADMIN_SECT_17", "choose how many items should be displayed for each section");
+define("LIST_ADMIN_SECT_18", "");
+
+define("LIST_ADMIN_SECT_19", "order items");
+define("LIST_ADMIN_SECT_20", "choose the order in which sections should be displayed");
+define("LIST_ADMIN_SECT_21", "");
+
+define("LIST_ADMIN_SECT_22", "icon");
+define("LIST_ADMIN_SECT_23", "choose an icon for each section");
+define("LIST_ADMIN_SECT_24", "");
+
+define("LIST_ADMIN_SECT_25", "caption");
+define("LIST_ADMIN_SECT_26", "define a caption for each section");
+define("LIST_ADMIN_SECT_27", "");
+
+define("LIST_ADMIN_OPT_1", "general");
+define("LIST_ADMIN_OPT_2", "recent page");
+define("LIST_ADMIN_OPT_3", "recent menu");
+define("LIST_ADMIN_OPT_4", "new page");
+define("LIST_ADMIN_OPT_5", "new menu");
+define("LIST_ADMIN_OPT_6", "options");
+
+define("LIST_ADMIN_MENU_2", "icon : default");
+define("LIST_ADMIN_MENU_3", "use default theme bullet if no icon is present or if icon:use is disabled");
+define("LIST_ADMIN_MENU_4", "");
+
+define("LIST_ADMIN_LAN_2", "caption");
+define("LIST_ADMIN_LAN_3", "define a caption");
+define("LIST_ADMIN_LAN_4", "");
+
+define("LIST_ADMIN_LAN_5", "icon : use");
+define("LIST_ADMIN_LAN_6", "use icon from each section");
+define("LIST_ADMIN_LAN_7", "");
+
+define("LIST_ADMIN_LAN_8", "characters");
+define("LIST_ADMIN_LAN_9", "choose how many characters of the heading will be shown");
+define("LIST_ADMIN_LAN_10", "leave blank to show full heading");
+
+define("LIST_ADMIN_LAN_11", "postfix");
+define("LIST_ADMIN_LAN_12", "choose a postfix if the heading is larger then the given amount of characters");
+define("LIST_ADMIN_LAN_13", "leave blank to show no postfix");
+
+define("LIST_ADMIN_LAN_14", "date");
+define("LIST_ADMIN_LAN_15", "choose a date style");
+define("LIST_ADMIN_LAN_16", "For more information on date formats see the <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>strftime function page at php.net</a>");
+
+define("LIST_ADMIN_LAN_17", "today date");
+define("LIST_ADMIN_LAN_18", "choose a date style if the date is today");
+define("LIST_ADMIN_LAN_19", "For more information on date formats see the <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>strftime function page at php.net</a>");
+
+define("LIST_ADMIN_LAN_20", "columns");
+define("LIST_ADMIN_LAN_21", "choose an amount of columns");
+define("LIST_ADMIN_LAN_22", "define how many columns you want to use. the number you specify will seperate the page into an equal amount of columns");
+
+define("LIST_ADMIN_LAN_23", "welcome text");
+define("LIST_ADMIN_LAN_24", "define a welcome text that will be rendered at the top of the page");
+define("LIST_ADMIN_LAN_25", "");
+
+define("LIST_ADMIN_LAN_26", "show empty");
+define("LIST_ADMIN_LAN_27", "define if a message needs to be shown when sections have no results ");
+define("LIST_ADMIN_LAN_28", "");
+
+define("LIST_ADMIN_LAN_29", "icon : default");
+define("LIST_ADMIN_LAN_30", "use default theme bullet if no icon is present or if icon:use is disabled");
+define("LIST_ADMIN_LAN_31", "");
+
+define("LIST_ADMIN_LAN_32", "timelapse:days");
+define("LIST_ADMIN_LAN_33", "maximum of days users can look back");
+define("LIST_ADMIN_LAN_34", "");
+define("LIST_ADMIN_LAN_35", "days");
+
+define("LIST_ADMIN_LAN_36", "timelapse");
+define("LIST_ADMIN_LAN_37", "display a select box with number of days to look back?");
+define("LIST_ADMIN_LAN_38", "");
+
+define("LIST_MENU_1", "recent additions");
+define("LIST_MENU_2", "by");
+define("LIST_MENU_3", "on");
+define("LIST_MENU_4", "in");
+define("LIST_MENU_5", "days");
+define("LIST_MENU_6", "view content for how may days?");
+define("LIST_MENU_7", "");
+define("LIST_MENU_8", "");
+define("LIST_MENU_9", "");
+define("LIST_MENU_10", "");
+define("LIST_MENU_11", "");
+define("LIST_MENU_12", "");
+define("LIST_MENU_13", "");
+define("LIST_MENU_14", "");
+define("LIST_MENU_15", "");
+define("LIST_MENU_16", "");
+define("LIST_MENU_17", "");
+define("LIST_MENU_18", "");
+define("LIST_MENU_19", "");
+
+define("LIST_NEWS_1", "news");
+define("LIST_NEWS_2", "no news items");
+
+define("LIST_COMMENT_1", "comments");
+define("LIST_COMMENT_2", "no comments");
+define("LIST_COMMENT_3", "news");
+define("LIST_COMMENT_4", "faq");
+define("LIST_COMMENT_5", "poll");
+define("LIST_COMMENT_6", "docs");
+define("LIST_COMMENT_7", "bugtrack");
+define("LIST_COMMENT_8", "content");
+define("LIST_COMMENT_9", "download");
+define("LIST_COMMENT_10", "ideas");
+
+define("LIST_DOWNLOAD_1", "downloads");
+define("LIST_DOWNLOAD_2", "no downloads");
+
+define("LIST_MEMBER_1", "members");
+define("LIST_MEMBER_2", "no members");
+
+define("LIST_CONTENT_1", "content");
+define("LIST_CONTENT_2", "no content in");
+define("LIST_CONTENT_3", "no valid content category");
+
+define("LIST_CHATBOX_1", "chatbox");
+define("LIST_CHATBOX_2", "no chatbox posts");
+
+define("LIST_CALENDAR_1", "calendar");
+define("LIST_CALENDAR_2", "no calendar events");
+
+define("LIST_LINKS_1", "links");
+define("LIST_LINKS_2", "no links");
+
+define("LIST_FORUM_1", "forum");
+define("LIST_FORUM_2", "no forum posts");
+define("LIST_FORUM_3", "views:");
+define("LIST_FORUM_4", "replies:");
+define("LIST_FORUM_5", "lastpost:");
+define("LIST_FORUM_6", "on:");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/list_class.php 75/e107_plugins/list_new/list_class.php
--- 6171/e107_plugins/list_new/list_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/list_class.php	2006-05-13 23:05:13.000000000 -0500
@@ -0,0 +1,543 @@
+<?php
+/*
++---------------------------------------------------------------+
+|       e107 website system
+|
+|       Steve Dunstan 2001-2002
+|       http://e107.org
+|       jalist@e107.org
+|
+|       Released under the terms and conditions of the
+|       GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/list_new/list_class.php,v $
+|		$Revision: 1.11 $
+|		$Date: 2006/05/14 04:05:13 $
+|		$Author: mcfly_e107 $
++---------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $sql, $rc, $list_pref, $sc_style, $tp, $list_shortcodes, $defaultarray;
+
+global $LIST_PAGE_NEW, $LIST_PAGE_RECENT, $LIST_MENU_NEW, $LIST_MENU_RECENT, $LIST_PAGE_NEW_START, $LIST_PAGE_RECENT_START, $LIST_MENU_NEW_START, $LIST_MENU_RECENT_START, $LIST_PAGE_NEW_END, $LIST_PAGE_RECENT_END, $LIST_MENU_NEW_END, $LIST_MENU_RECENT_END;
+global $LIST_ICON, $LIST_DATE, $LIST_HEADING, $LIST_AUTHOR, $LIST_CATEGORY, $LIST_INFO;
+global $LIST_DISPLAYSTYLE, $LIST_CAPTION, $LIST_STYLE_CAPTION, $LIST_STYLE_BODY;
+
+$listplugindir = e_PLUGIN."list_new/";
+
+//default sections (present in this list plugin)
+$defaultarray = array("news", "comment", "download", "members");
+
+//get language file
+$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
+
+if (file_exists(THEME."list_template.php")) {
+	require_once(THEME."list_template.php");
+} else {
+	require_once($listplugindir."list_template.php");
+}
+
+
+class listclass {
+
+	function getListPrefs()
+	{
+		global $sql,$eArrayStorage;
+
+		//check preferences from database
+		$sql = new db;
+		$num_rows = $sql -> db_Select("core", "*", "e107_name='list' ");
+		$row = $sql -> db_Fetch();
+
+		//insert default preferences
+		if (empty($row['e107_value'])) {
+
+			$this -> getSections();
+			$list_pref = $this -> getDefaultPrefs();
+			$tmp = $eArrayStorage->WriteArray($list_pref);
+
+			$sql -> db_Insert("core", "'list', '$tmp' ");
+			$sql -> db_Select("core", "*", "e107_name='list' ");
+		}
+
+		$list_pref = $eArrayStorage->ReadArray($row['e107_value']);
+		return $list_pref;
+	}
+
+	function prepareSection($mode){
+		global $list_pref;
+
+		$len = strlen($mode) + 9;
+		//get all sections to use
+		foreach ($list_pref as $key => $value) {
+			if(substr($key,-$len) == "_{$mode}_display" && $value == "1"){
+				$sections[] = substr($key,0,-$len);
+			}
+		}
+
+		return $sections;
+	}
+
+	function prepareSectionArray($mode, $sections){
+		global $list_pref;
+
+		//section reference
+		for($i=0;$i<count($sections);$i++){
+			if(isset($list_pref[$sections[$i]."_".$mode."_display"]) && $list_pref[$sections[$i]."_".$mode."_display"] == "1"){
+				$arr[$sections[$i]][0] = (isset($list_pref[$sections[$i]."_".$mode."_caption"]) ? $list_pref[$sections[$i]."_".$mode."_caption"] : "");
+				$arr[$sections[$i]][1] = (isset($list_pref[$sections[$i]."_".$mode."_display"]) ? $list_pref[$sections[$i]."_".$mode."_display"] : "");
+				$arr[$sections[$i]][2] = (isset($list_pref[$sections[$i]."_".$mode."_open"]) ? $list_pref[$sections[$i]."_".$mode."_open"] : "");
+				$arr[$sections[$i]][3] = (isset($list_pref[$sections[$i]."_".$mode."_author"]) ? $list_pref[$sections[$i]."_".$mode."_author"] : "");
+				$arr[$sections[$i]][4] = (isset($list_pref[$sections[$i]."_".$mode."_category"]) ? $list_pref[$sections[$i]."_".$mode."_category"] : "");
+				$arr[$sections[$i]][5] = (isset($list_pref[$sections[$i]."_".$mode."_date"]) ? $list_pref[$sections[$i]."_".$mode."_date"] : "");
+				$arr[$sections[$i]][6] = (isset($list_pref[$sections[$i]."_".$mode."_icon"]) ? $list_pref[$sections[$i]."_".$mode."_icon"] : "");
+				$arr[$sections[$i]][7] = (isset($list_pref[$sections[$i]."_".$mode."_amount"]) ? $list_pref[$sections[$i]."_".$mode."_amount"] : "");
+				$arr[$sections[$i]][8] = (isset($list_pref[$sections[$i]."_".$mode."_order"]) ? $list_pref[$sections[$i]."_".$mode."_order"] : "");
+				$arr[$sections[$i]][9] = $sections[$i];
+			}
+		}
+		//sort array on order values set in preferences
+		usort($arr, create_function('$e,$f','return $e[8]==$f[8]?0:($e[8]>$f[8]?1:-1);'));
+
+		return $arr;
+	}
+
+	function getDefaultSections(){
+		global $sql, $sections, $titles, $defaultarray;
+
+		//default always present sections
+		for($i=0;$i<count($defaultarray);$i++){
+			$sections[] = $defaultarray[$i];
+			$titles[] = $defaultarray[$i];
+		}
+		return;
+	}
+
+	//content needs this to split each main parent into seperate sections
+	function getContentSections($mode)
+	{
+		global $sql, $sections, $titles, $content_types, $content_name;
+
+		if(!$content_install = $sql -> db_Select("plugin", "plugin_id", "plugin_path = 'content' AND plugin_installflag = '1' ")){
+			return;
+		}
+		$datequery = " AND (content_datestamp=0 || content_datestamp < ".time().") AND (content_enddate=0 || content_enddate>".time().") ";
+
+		//get main parent types
+		if($mainparents = $sql -> db_Select("pcontent", "content_id, content_heading", "content_parent = '0' ".$datequery." ORDER BY content_heading"))
+		{
+			while($row = $sql -> db_Fetch())
+			{
+				$content_types[] = "content_".$row['content_id'];
+				$content_name = 'content';
+				if($mode == "add")
+				{
+					$sections[] = "content_".$row['content_id'];
+					$titles[] = $content_name." : ".$row['content_heading'];
+				}
+			}
+		}		
+		$content_types = array_unique($content_types);
+
+		return;
+	}
+
+	function getSections()
+	{
+		global $sql, $sections, $titles;
+
+		$this -> getDefaultSections();
+
+		require_once(e_HANDLER."file_class.php");
+		$fl = new e_file;
+		$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', '.bak');
+		$iconlist = $fl->get_files(e_PLUGIN, "e_list\.php$", "standard", 1);
+		foreach($iconlist as $icon)
+		{
+			$tmp = explode("/", $icon['path']);
+			$tmp = array_reverse($tmp);
+			$icon['fname'] = $tmp[1];
+
+			if($plugin_installed = $sql -> db_Select("plugin", "plugin_id", "plugin_path = '".$icon['fname']."' AND plugin_installflag = '1' "))
+			{
+				if($icon['fname'] == "content")
+				{
+					$this -> getContentSections("add");
+				}
+				else
+				{
+					$sections[] = $icon['fname'];
+					$titles[] = $icon['fname'];
+				}
+			}
+		}
+		return;
+	}
+
+	function getDefaultPrefs()
+	{
+		global $sql, $sections, $titles, $defaultarray, $content_types, $tp;
+
+		//section preferences
+		for($i=0;$i<count($sections);$i++)
+		{
+			if(!in_array($sections[$i], $defaultarray))
+			{
+				if(!in_array($sections[$i], $content_types))
+				{
+					if($plugin_installed = $sql -> db_Select("plugin", "plugin_id", "plugin_path = '".$tp -> toDB($sections[$i], true)."' AND plugin_installflag = '1' "))
+					{
+						$list_pref["$sections[$i]_recent_menu_caption"]	= $sections[$i];
+						$list_pref["$sections[$i]_recent_page_caption"]	= $sections[$i];
+						$list_pref["$sections[$i]_new_menu_caption"]	= $sections[$i];
+						$list_pref["$sections[$i]_new_page_caption"]	= $sections[$i];
+					}
+				}
+				else
+				{
+					$list_pref["$sections[$i]_recent_menu_caption"]	= $titles[$i];
+					$list_pref["$sections[$i]_recent_page_caption"]	= $titles[$i];
+					$list_pref["$sections[$i]_new_menu_caption"]	= $titles[$i];
+					$list_pref["$sections[$i]_new_page_caption"]	= $titles[$i];
+				}
+			}
+			else
+			{
+				$list_pref["$sections[$i]_recent_menu_caption"]	= $sections[$i];
+				$list_pref["$sections[$i]_recent_page_caption"]	= $sections[$i];
+				$list_pref["$sections[$i]_new_menu_caption"]	= $sections[$i];
+				$list_pref["$sections[$i]_new_page_caption"]	= $sections[$i];
+			}
+
+			$list_pref["$sections[$i]_recent_menu_display"]		= "1";
+			$list_pref["$sections[$i]_recent_menu_open"]		= "0";
+			$list_pref["$sections[$i]_recent_menu_author"]		= "0";
+			$list_pref["$sections[$i]_recent_menu_category"]	= "0";
+			$list_pref["$sections[$i]_recent_menu_date"]		= "1";
+			$list_pref["$sections[$i]_recent_menu_amount"]		= "5";
+			$list_pref["$sections[$i]_recent_menu_order"]		= ($i+1);
+			$list_pref["$sections[$i]_recent_menu_icon"]		= "";
+
+			$list_pref["$sections[$i]_recent_page_display"]		= "1";
+			$list_pref["$sections[$i]_recent_page_open"]		= "1";
+			$list_pref["$sections[$i]_recent_page_author"]		= "1";
+			$list_pref["$sections[$i]_recent_page_category"]	= "1";
+			$list_pref["$sections[$i]_recent_page_date"]		= "1";
+			$list_pref["$sections[$i]_recent_page_amount"]		= "10";
+			$list_pref["$sections[$i]_recent_page_order"]		= ($i+1);
+			$list_pref["$sections[$i]_recent_page_icon"]		= "1";
+
+			$list_pref["$sections[$i]_new_menu_display"]		= "1";
+			$list_pref["$sections[$i]_new_menu_open"]			= "0";
+			$list_pref["$sections[$i]_new_menu_author"]			= "0";
+			$list_pref["$sections[$i]_new_menu_category"]		= "0";
+			$list_pref["$sections[$i]_new_menu_date"]			= "1";
+			$list_pref["$sections[$i]_new_menu_amount"]			= "5";
+			$list_pref["$sections[$i]_new_menu_order"]			= ($i+1);
+			$list_pref["$sections[$i]_new_menu_icon"]			= "1";
+
+			$list_pref["$sections[$i]_new_page_display"]		= "1";
+			$list_pref["$sections[$i]_new_page_open"]			= "1";
+			$list_pref["$sections[$i]_new_page_author"]			= "1";
+			$list_pref["$sections[$i]_new_page_category"]		= "1";
+			$list_pref["$sections[$i]_new_page_date"]			= "1";
+			$list_pref["$sections[$i]_new_page_amount"]			= "10";
+			$list_pref["$sections[$i]_new_page_order"]			= ($i+1);
+			$list_pref["$sections[$i]_new_page_icon"]			= "1";
+		}
+		
+		//new menu preferences
+		$list_pref['new_menu_caption']				= LIST_ADMIN_15;
+		$list_pref['new_menu_icon_use']				= "1";
+		$list_pref['new_menu_icon_default']			= "1";
+		$list_pref['new_menu_char_heading']			= "20";
+		$list_pref['new_menu_char_postfix']			= "...";
+		$list_pref['new_menu_datestyle']			= "%d %b";
+		$list_pref['new_menu_datestyletoday']		= "%H:%M";
+		$list_pref['new_menu_showempty']			= "1";
+
+		//new page preferences
+		$list_pref['new_page_caption']				= LIST_ADMIN_15;
+		$list_pref['new_page_icon_use']				= "1";
+		$list_pref['new_page_icon_default']			= "1";
+		$list_pref['new_page_char_heading']			= "";
+		$list_pref['new_page_char_postfix']			= "";
+		$list_pref['new_page_datestyle']			= "%d %b";
+		$list_pref['new_page_datestyletoday']		= "%H:%M";
+		$list_pref['new_page_showempty']			= "1";
+		$list_pref['new_page_colomn']				= "1";
+		$list_pref['new_page_welcometext']			= LIST_ADMIN_16;
+		$list_pref['new_page_timelapse']			= "1";
+		$list_pref['new_page_timelapse_days']		= "30";
+
+		//recent menu preferences
+		$list_pref['recent_menu_caption']			= LIST_ADMIN_14;
+		$list_pref['recent_menu_icon_use']			= "1";
+		$list_pref['recent_menu_icon_default']		= "1";
+		$list_pref['recent_menu_char_heading']		= "20";
+		$list_pref['recent_menu_char_postfix']		= "...";
+		$list_pref['recent_menu_datestyle']			= "%d %b";
+		$list_pref['recent_menu_datestyletoday']	= "%H:%M";
+		$list_pref['recent_menu_showempty']			= "";
+
+		//recent page preferences
+		$list_pref['recent_page_caption']			= LIST_ADMIN_14;
+		$list_pref['recent_page_icon_use']			= "1";
+		$list_pref['recent_page_icon_default']		= "1";
+		$list_pref['recent_page_char_heading']		= "";
+		$list_pref['recent_page_char_postfix']		= "";
+		$list_pref['recent_page_datestyle']			= "%d %b";
+		$list_pref['recent_page_datestyletoday']	= "%H:%M";
+		$list_pref['recent_page_showempty']			= "";
+		$list_pref['recent_page_colomn']			= "1";
+		$list_pref['recent_page_welcometext']		= LIST_ADMIN_13;
+
+		return $list_pref;
+	}
+
+	function show_section_list($arr, $mode, $max="")
+	{
+		global $tp, $listplugindir, $list_shortcodes, $sql, $list_pref, $defaultarray, $content_types, $content_name;
+		global $LIST_ICON, $LIST_DATE, $LIST_HEADING, $LIST_AUTHOR, $LIST_CATEGORY, $LIST_INFO;
+		global $LIST_DISPLAYSTYLE, $LIST_CAPTION, $LIST_STYLE_CAPTION, $LIST_STYLE_BODY;
+		global $LIST_PAGE_NEW, $LIST_PAGE_RECENT, $LIST_MENU_NEW, $LIST_MENU_RECENT, $LIST_PAGE_NEW_START, $LIST_PAGE_RECENT_START, $LIST_MENU_NEW_START, $LIST_MENU_RECENT_START, $LIST_PAGE_NEW_END, $LIST_PAGE_RECENT_END, $LIST_MENU_NEW_END, $LIST_MENU_RECENT_END;
+
+		$menu_installed = $sql -> db_Select("menus", "menu_id", "(menu_name = 'list_new_menu' || menu_name = 'list_recent_menu') AND menu_location != '0' AND menu_class REGEXP '".e_CLASS_REGEXP."' ");
+		$LIST_DATA = "";
+		$LIST_CAPTION = "";
+
+		$this -> getContentSections("");
+
+		//require is needed here instead of require_once, since both the menu and the page could be visible at the same time
+		if(is_array($content_types) && in_array($arr[9], $content_types))
+		{
+			$file = $content_name;
+			if(file_exists(e_PLUGIN.$file."/e_list.php"))
+			{
+				global $contentmode;
+				$contentmode = $arr[9];
+				require(e_PLUGIN.$file."/e_list.php");
+			}
+		}
+		else
+		{
+			$file = $arr[9];
+			if(in_array($file, $defaultarray))
+			{
+				require($listplugindir."section/list_".$file.".php");
+			}
+			else
+			{
+				if(file_exists(e_PLUGIN.$file."/e_list.php"))
+				{
+					require(e_PLUGIN.$file."/e_list.php");
+				}
+			}
+		}
+		$menutext = "";
+		$start = "";
+		$end = "";
+		
+		$LIST_ICON = "";
+		$LIST_DATE = "";
+		$LIST_HEADING = "";
+		$LIST_AUTHOR = "";
+		$LIST_CATEGORY = "";
+		$LIST_INFO = "";
+		//$LIST_CAPTION = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : "");
+		//$LIST_CAPTION = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : "");
+		//echo $list_pref["$arr_{$mode}_caption"];
+
+		if(is_array($LIST_DATA)){			//if it is an array, data exists and data is not empty
+			for($i=0;$i<count($LIST_DATA[$mode]);$i++)
+			{				
+				$LIST_ICON		= $LIST_DATA[$mode][$i][0];
+				$LIST_HEADING	= $LIST_DATA[$mode][$i][1];
+				$LIST_AUTHOR	= $LIST_DATA[$mode][$i][2];
+				$LIST_CATEGORY	= $LIST_DATA[$mode][$i][3];
+				$LIST_DATE		= $LIST_DATA[$mode][$i][4];
+				$LIST_INFO		= $LIST_DATA[$mode][$i][5];
+				
+				if($mode == "recent_menu"){
+					global $sc_style;
+					$LIST_AUTHOR	= ($LIST_AUTHOR ? $sc_style['LIST_AUTHOR']['pre'].$LIST_AUTHOR.$sc_style['LIST_AUTHOR']['post'] : "");					
+					$LIST_CATEGORY	= ($LIST_CATEGORY ? $sc_style['LIST_CATEGORY']['pre'].$LIST_CATEGORY.$sc_style['LIST_CATEGORY']['post'] : "");					
+					$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT);
+				
+				}elseif($mode == "new_menu"){
+					global $sc_style;
+					$LIST_AUTHOR	= ($LIST_AUTHOR ? $sc_style['LIST_AUTHOR']['pre'].$LIST_AUTHOR.$sc_style['LIST_AUTHOR']['post'] : "");					
+					$LIST_CATEGORY	= ($LIST_CATEGORY ? $sc_style['LIST_CATEGORY']['pre'].$LIST_CATEGORY.$sc_style['LIST_CATEGORY']['post'] : "");					
+					$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW);
+				
+				}elseif($mode == "recent_page"){
+					$menutext .= $tp -> parseTemplate($LIST_PAGE_RECENT, FALSE, $list_shortcodes);
+				
+				}elseif($mode == "new_page"){
+					$menutext .= $tp -> parseTemplate($LIST_PAGE_NEW, FALSE, $list_shortcodes);
+				}
+			}
+		}elseif(!is_array($LIST_DATA) && $LIST_DATA != ""){
+			$LIST_HEADING = $LIST_DATA;
+			if($mode == "recent_menu"){
+				if($list_pref[$mode."_showempty"]){
+					$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT);
+				}
+			}elseif($mode == "new_menu"){
+				if($list_pref[$mode."_showempty"]){
+					$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW);
+				}
+			}elseif($mode == "recent_page"){
+				if($list_pref[$mode."_showempty"]){
+					$menutext .= $tp -> parseTemplate($LIST_PAGE_RECENT, FALSE, $list_shortcodes);
+				}
+			}elseif($mode == "new_page"){
+				if($list_pref[$mode."_showempty"]){
+					$menutext .= $tp -> parseTemplate($LIST_PAGE_NEW, FALSE, $list_shortcodes);
+				}
+
+			}
+		}
+
+		if($LIST_DATA != ""){
+			if($mode == "recent_menu"){
+				if($list_pref[$mode."_showempty"] || $menutext){
+					$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT_START);
+					$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT_END);
+				}
+			
+			}elseif($mode == "new_menu"){
+				if($list_pref[$mode."_showempty"] || $menutext){
+					$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW_START);
+					$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW_END);
+				}
+			
+			}elseif($mode == "recent_page"){
+				if($list_pref[$mode."_showempty"] || $menutext){
+					$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_PAGE_RECENT_START);
+					$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_PAGE_RECENT_END);
+				}
+
+			}elseif($mode == "new_page"){
+				if($list_pref[$mode."_showempty"] || $menutext){
+					$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_PAGE_NEW_START);
+					$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_PAGE_NEW_END);
+				}
+			}
+			$text = $start.$menutext.$end;
+		}else{
+			$text = "";
+		}
+		return $text;
+	}
+
+	function getlvisit(){
+		global $qs, $list_pref;
+
+		if(isset($qs[0]) && $qs[0] == "new"){
+			if(isset($list_pref['new_page_timelapse']) && $list_pref['new_page_timelapse']){
+				if(isset($list_pref['new_page_timelapse_days']) && is_numeric($list_pref['new_page_timelapse_days']) && $list_pref['new_page_timelapse_days']){
+					$days = $list_pref['new_page_timelapse_days'];
+				}else{
+					$days = "30";
+				}
+				if(isset($qs[1]) && is_numeric($qs[1]) && $qs[1] <= $days){
+					$lvisit = time()-$qs[1]*86400;
+				}else{
+					$lvisit = USERLV;
+				}
+			}else{
+				$lvisit = USERLV;
+			}
+		}else{
+			$lvisit = USERLV;
+		}
+		return $lvisit;
+	}
+
+	function getBullet($sectionicon, $mode)
+	{
+		global $list_pref, $listplugindir;
+
+		$default_bullet = "";
+
+		if($list_pref[$mode."_icon_default"])
+		{
+			if(file_exists(THEME."images/bullet2.gif"))
+			{
+				$default_bullet = "<img src='".THEME."images/bullet2.gif' alt='' />";
+			}
+		}
+
+		$icon_width = "8";
+		$icon_height = "8";
+		$style_pre = "";
+
+		if($list_pref[$mode."_icon_use"]){
+			if($sectionicon){
+				if(file_exists($listplugindir."images/".$sectionicon)){
+					$bullet = "<img src='".$listplugindir."images/".$sectionicon."' style='width:".$icon_width."px; height:".$icon_height."px; border:0; vertical-align:middle;' alt='' />";
+				}
+			}
+		}
+		$bullet = (isset($bullet) ? $bullet : $default_bullet);
+
+		return $bullet;
+	}
+
+	function parse_heading($heading, $mode){
+		global $list_pref;
+		
+		if($list_pref[$mode."_char_heading"] && strlen($heading) > $list_pref[$mode."_char_heading"]){
+			$heading = substr($heading, 0, $list_pref[$mode."_char_heading"]).$list_pref[$mode."_char_postfix"];
+		}
+		return $heading;
+	}
+
+	function getListDate($datestamp, $mode){
+		global $list_pref;
+		
+		$datestamp += TIMEOFFSET;
+
+		$todayarray = getdate();
+		$current_day = $todayarray['mday'];
+		$current_month = $todayarray['mon'];
+		$current_year = $todayarray['year'];
+
+		$thisday = date("d", $datestamp);
+		$thismonth = date("m", $datestamp);
+		$thisyear = date("Y", $datestamp);
+
+		//check and use the today date style if day is today
+		if($thisyear == $current_year){
+			if($thismonth == $current_month){
+				if($thisday == $current_day){
+					$datepreftoday = $list_pref[$mode."_datestyletoday"];
+					$date = strftime($datepreftoday, $datestamp);
+					return $date;
+				}
+			}
+		}
+
+		//else use default date style
+		$datepref = $list_pref[$mode."_datestyle"];
+		$date = strftime($datepref, $datestamp);
+		return $date;
+	}
+
+
+	//##### FUNCTIONS BENEATH ARE ONLY USED IN THE ADMIN PAGE
+
+	function parse_headerrow_title($title){
+		global $rs, $list_pref;
+
+		$text = "<tr><td colspan='4' class='forumheader'>".$title."</td></tr>";
+
+		return $text;
+	}
+
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/list_new_menu.php 75/e107_plugins/list_new/list_new_menu.php
--- 6171/e107_plugins/list_new/list_new_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/list_new_menu.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,58 @@
+<?php
+/*
++---------------------------------------------------------------+
+|       e107 website system
+|
+|       Steve Dunstan 2001-2002
+|       http://e107.org
+|       jalist@e107.org
+|
+|       Released under the terms and conditions of the
+|       GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/list_new/list_new_menu.php,v $
+|		$Revision: 1.6 $
+|		$Date: 2005/12/14 19:28:44 $
+|		$Author: sweetas $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
+	return;
+}
+
+global $sysprefs, $tp, $eArrayStorage;
+$listplugindir = e_PLUGIN."list_new/";
+unset($text);
+require_once($listplugindir."list_shortcodes.php");
+
+//get language file
+$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
+
+require_once($listplugindir."list_class.php");
+$rc = new listclass;
+
+$list_pref	= $rc -> getListPrefs();
+$mode		= "new_menu";
+$sections	= $rc -> prepareSection($mode);
+$arr		= $rc -> prepareSectionArray($mode, $sections);
+
+//display the sections
+$text = "";
+for($i=0;$i<count($arr);$i++){
+	if($arr[$i][1] == "1"){
+		$sectiontext = $rc -> show_section_list($arr[$i], $mode);
+		if($sectiontext != ""){
+			$text .= $sectiontext;
+		}
+	}
+}
+
+$caption = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : LIST_MENU_1);
+$ns -> tablerender($caption, $text, 'list_new');
+unset($text);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/list.php 75/e107_plugins/list_new/list.php
--- 6171/e107_plugins/list_new/list.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/list.php	2006-02-20 02:52:46.000000000 -0600
@@ -0,0 +1,125 @@
+<?php
+/*
++---------------------------------------------------------------+
+|       e107 website system
+|
+|       Steve Dunstan 2001-2002
+|       http://e107.org
+|       jalist@e107.org
+|
+|       Released under the terms and conditions of the
+|       GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/list_new/list.php,v $
+|		$Revision: 1.10 $
+|		$Date: 2006/02/20 08:52:46 $
+|		$Author: lisa_ $
++---------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+$listplugindir = e_PLUGIN."list_new/";
+//get language file
+$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
+
+if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
+	require_once(HEADERF);
+	$ns -> tablerender("", LIST_PLUGIN_6);
+	require_once(FOOTERF);
+	exit;
+}
+require_once($listplugindir."list_shortcodes.php");
+require_once($listplugindir."list_class.php");
+$rc = new listclass;
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+e107_require_once(e_HANDLER.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+
+unset($text);
+
+require_once(HEADERF);
+
+global $tp;
+
+// check query
+if(e_QUERY){
+	$qs = explode(".", e_QUERY);
+	if($qs[0] == "new"){
+		$mode = $qs[0];
+	}
+}
+if(isset($mode) && $mode == "new"){
+	$mode = "new_page";
+}else{
+	$mode = "recent_page";	//default to 'page'
+}
+
+$list_pref	= $rc -> getListPrefs();
+$sections	= $rc -> prepareSection($mode);
+$arr		= $rc -> prepareSectionArray($mode, $sections);
+
+$text = "";
+$timelapse = 0;
+if(isset($qs[0]) && $qs[0] == "new"){
+	if(isset($list_pref['new_page_timelapse']) && $list_pref['new_page_timelapse']){
+		if(isset($list_pref['new_page_timelapse_days']) && is_numeric($list_pref['new_page_timelapse_days'])){
+			$days = $list_pref['new_page_timelapse_days'];
+		}else{
+			$days = "30";
+		}
+		if(isset($qs[1]) && is_numeric($qs[1]) && $qs[1] <= $days){
+			$timelapse = $qs[1];
+		}
+		$url		= e_PLUGIN."list_new/list.php?new";
+		$selectjs	= "onchange=\"if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }\"";
+
+		$LIST_TIMELAPSE = LIST_MENU_6;
+		$LIST_TIMELAPSE .= $rs -> form_select_open("timelapse", $selectjs).$rs -> form_option(LIST_MENU_5, 0);
+		for($a=1; $a<=$days; $a++){
+			$LIST_TIMELAPSE .= $rs -> form_option($a, ($timelapse == $a ? "1" : "0"), $url.".".$a);
+		}
+		$LIST_TIMELAPSE .= $rs -> form_select_close();
+		$text .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_TIMELAPSE_TABLE);
+	}
+}
+
+
+
+//display the sections
+$LIST_COL_COLS = $list_pref[$mode."_colomn"];
+
+$LIST_COL_CELLWIDTH = round((100/$list_pref[$mode."_colomn"]),0);
+$text .= $LIST_COL_START;
+
+if($list_pref[$mode."_welcometext"]){
+	$LIST_COL_WELCOMETEXT = $tp -> toHTML($list_pref[$mode."_welcometext"]);
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_COL_WELCOME);
+}
+$k=0;
+for($i=0;$i<count($arr);$i++){
+	unset($rowswitch);
+	if($arr[$i][1] == "1"){
+				
+		$sectiontext = $rc -> show_section_list($arr[$i], $mode);
+		if($sectiontext != ""){
+			if( intval($k/$list_pref[$mode."_colomn"]) == $k/$list_pref[$mode."_colomn"] ){
+				$rowswitch = $LIST_COL_ROWSWITCH;
+			}
+			$text .= (isset($rowswitch) ? $rowswitch : "");
+			$text .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_COL_CELL_START);
+			$text .= $sectiontext;
+			$text .= $LIST_COL_CELL_END;
+			$k++;
+		}
+	}
+}
+$text .= $LIST_COL_END;
+
+$caption = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : LIST_MENU_1);
+$ns -> tablerender($caption, $text);
+unset($text);
+
+require_once(FOOTERF);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/list_recent_menu.php 75/e107_plugins/list_new/list_recent_menu.php
--- 6171/e107_plugins/list_new/list_recent_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/list_recent_menu.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,58 @@
+<?php
+/*
++---------------------------------------------------------------+
+|       e107 website system
+|
+|       Steve Dunstan 2001-2002
+|       http://e107.org
+|       jalist@e107.org
+|
+|       Released under the terms and conditions of the
+|       GNU General Public License (http://gnu.org).
+|
+|		$Source: /cvsroot/e107/e107_0.7/e107_plugins/list_new/list_recent_menu.php,v $
+|		$Revision: 1.6 $
+|		$Date: 2005/12/14 19:28:44 $
+|		$Author: sweetas $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
+	return;
+}
+
+global $sysprefs, $tp, $eArrayStorage;
+$listplugindir = e_PLUGIN."list_new/";
+unset($text);
+require_once($listplugindir."list_shortcodes.php");
+
+//get language file
+$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
+
+require_once($listplugindir."list_class.php");
+$rc = new listclass;
+
+$list_pref	= $rc -> getListPrefs();
+$mode		= "recent_menu";
+$sections	= $rc -> prepareSection($mode);
+$arr		= $rc -> prepareSectionArray($mode, $sections);
+
+//display the sections
+$text = "";
+for($i=0;$i<count($arr);$i++){
+	if($arr[$i][1] == "1"){
+		$sectiontext = $rc -> show_section_list($arr[$i], $mode);
+		if($sectiontext != ""){
+			$text .= $sectiontext;
+		}
+	}
+}
+
+$caption = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : LIST_MENU_1);
+$ns -> tablerender($caption, $text, 'list_recent');
+unset($text);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/list_shortcodes.php 75/e107_plugins/list_new/list_shortcodes.php
--- 6171/e107_plugins/list_new/list_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/list_shortcodes.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,38 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+$list_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+/*
+SC_BEGIN LIST_DATE
+global $LIST_DATE;
+return $LIST_DATE;
+SC_END
+
+SC_BEGIN LIST_ICON
+global $LIST_ICON;
+return $LIST_ICON;
+SC_END
+
+SC_BEGIN LIST_HEADING
+global $LIST_HEADING;
+return $LIST_HEADING;
+SC_END
+
+SC_BEGIN LIST_AUTHOR
+global $LIST_AUTHOR;
+return $LIST_AUTHOR;
+SC_END
+
+SC_BEGIN LIST_CATEGORY
+global $LIST_CATEGORY;
+return $LIST_CATEGORY;
+SC_END
+
+SC_BEGIN LIST_INFO
+global $LIST_INFO;
+return $LIST_INFO;
+SC_END
+
+
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/list_template.php 75/e107_plugins/list_new/list_template.php
--- 6171/e107_plugins/list_new/list_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/list_template.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,86 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $list_shortcodes;
+$sc_style['LIST_DATE']['pre'] = "";
+$sc_style['LIST_DATE']['post'] = " ";
+
+$sc_style['LIST_ICON']['pre'] = "";
+$sc_style['LIST_ICON']['post'] = " ";
+
+$sc_style['LIST_HEADING']['pre'] = "";
+$sc_style['LIST_HEADING']['post'] = " ";
+
+$sc_style['LIST_AUTHOR']['pre'] = LIST_MENU_2.": ";
+$sc_style['LIST_AUTHOR']['post'] = " ";
+
+$sc_style['LIST_CATEGORY']['pre'] = LIST_MENU_4.": ";
+$sc_style['LIST_CATEGORY']['post'] = " ";
+
+$sc_style['LIST_INFO']['pre'] = "";
+$sc_style['LIST_INFO']['post'] = " ";
+
+
+//LIST_MENU_NEW TEMPLATE -------------------------------------------------------------------------
+$LIST_MENU_NEW_START = "
+<div class='fcaption' style='cursor:pointer;' onclick='expandit(this);'>{LIST_CAPTION}</div>
+<div class='forumheader' style='margin-bottom:5px; display:{LIST_DISPLAYSTYLE};'>\n";
+$LIST_MENU_NEW = "
+<div>
+{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY}
+</div>";
+$LIST_MENU_NEW_END = "
+</div>\n";
+
+//LIST_MENU_RECENT TEMPLATE -------------------------------------------------------------------------
+$LIST_MENU_RECENT_START = "
+<div class='fcaption' style='cursor:pointer;' onclick='expandit(this);'>{LIST_CAPTION}</div>
+<div class='forumheader' style='margin-bottom:5px; display:{LIST_DISPLAYSTYLE};'>\n";
+$LIST_MENU_RECENT = "
+<div>
+{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY}
+</div>";
+$LIST_MENU_RECENT_END = "
+</div>\n";
+
+
+//PAGE TEMPLATE -------------------------------------------------------------------------
+$LIST_PAGE_RECENT_START = "
+<div class='fcaption' style='cursor:pointer;' onclick='expandit(this);'>{LIST_CAPTION}</div>
+<div class='forumheader' style='margin-bottom:10px; display:{LIST_DISPLAYSTYLE};'>\n";
+$LIST_PAGE_RECENT = "
+<div>
+{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY} {LIST_INFO}
+</div>";
+$LIST_PAGE_RECENT_END = "
+</div>\n";
+
+
+//NEW TEMPLATE -------------------------------------------------------------------------
+$LIST_PAGE_NEW_START = "
+<div class='fcaption' style='cursor:pointer;' onclick='expandit(this);'>{LIST_CAPTION}</div>
+<div class='forumheader' style='margin-bottom:10px; display:{LIST_DISPLAYSTYLE};'>\n";
+$LIST_PAGE_NEW = "
+<div>
+{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY} {LIST_INFO}
+</div>";
+$LIST_PAGE_NEW_END = "
+</div>\n";
+
+
+//MULTI COLOMNS LAYOUT MASTER -----------------------------------------------------------
+$LIST_COL_START = "
+<div style='text-align:center;'>
+<table class='fborder' style='width:100%;' cellspacing='0' cellpadding='0'>
+<tr>";
+$LIST_COL_WELCOME = "<td colspan='{LIST_COL_COLS}' class='forumheader'>{LIST_COL_WELCOMETEXT}<br /><br /></td>";
+$LIST_COL_ROWSWITCH = "</tr><tr>";
+$LIST_COL_CELL_START = "<td style='width:{LIST_COL_CELLWIDTH}%; padding-right:5px; vertical-align:top;'>";
+$LIST_COL_CELL_END = "</td>";
+$LIST_COL_END = "</tr></table></div>";
+
+//TIMELAPSE SELECT -----------------------------------------------------------
+$LIST_TIMELAPSE_TABLE = "<div class='forumheader3' style='margin-bottom:20px;'>{LIST_TIMELAPSE}</div>";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/new.php 75/e107_plugins/list_new/new.php
--- 6171/e107_plugins/list_new/new.php	2005-05-13 06:22:58.000000000 -0500
+++ 75/e107_plugins/list_new/new.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,285 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2003
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-
-if(!USER){
-	header("location:".e_BASE."index.php");
-	exit;
-}
-
-require_once(HEADERF);
-@include(e_PLUGIN."list_new/languages/".e_LANGUAGE.".php");
-@include(e_PLUGIN."list_new/languages/English.php");
-
-$bullet = "<img src='".THEME."images/bullet2.gif' alt='bullet' /> ";
-
-$sql2 = new db;
-$lvisit = USERLV;
-$news_items = $sql -> db_Select("news", "*", "news_datestamp>$lvisit  ORDER BY news_datestamp DESC LIMIT 0,10");
-while($row = $sql -> db_Fetch()){
-	extract($row);
-	if(check_class($news_class)){
-		$str .= "$bullet<a href='".e_BASE."comment.php?comment.news.$news_id'>$news_title</a><br />";
-	}else{
-		$news_items = $news_items - 1;
-	}
-}
-if(!$news_items){
-	$str = LIST_4;
-}
-
-$text = "<div style='text-align:center'>
-<table style='width:95%' class='fborder'>
-<tr>
-<td class='fcaption'>".LIST_1." ($news_items)</td>
-</tr>
-<td class='forumheader3'>".$str."</td>
-</tr>\n";
-
-// Articles/content/reviews
-unset($str);
-$content_items = $sql -> db_Select("content", "*", "content_datestamp>$lvisit AND content_parent!='0' ORDER BY content_datestamp DESC LIMIT 0,10");
-while($row = $sql -> db_Fetch()){
-	extract($row);
-	if(check_class($content_class)){
-	//	find out whether article, review or content page ...
-		switch($content_type){
-			case 0:	//	article
-				$str .= $bullet."[ ".LIST_14." ] : <a href='".e_BASE."content.php?article.$content_id'>$content_heading</a><br />";
-			break;
-			case 1:	//	content page
-				$str .= $bullet."[ ".LIST_15." ] : <a href='".e_BASE."content.php?content.$content_id'>$content_heading</a><br />";
-			break;
-			case 3:	//	review
-				$str .= $bullet."[ ".LIST_16." ] : <a href='".e_BASE."content.php?review.$content_id.'>$content_heading</a><br />";
-			break;
-			}
-	}else{
-		$content_items = $content_items - 1;
-	}
-}
-if(!$content_items){
-	$str = LIST_4;
-}
-
-$text .= "
-<tr>
-<td class='fcaption'>".LIST_21." ($content_items)</td>
-</tr>
-<td class='forumheader3'>".$str."</td>
-</tr>\n";
-
-unset($str);
-$comment_count=0;
-if($comments = $sql -> db_Select("comments", "*", "comment_datestamp>$lvisit ORDER BY comment_datestamp DESC LIMIT 0,10")){
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		switch($comment_type){
-			case 0:	// news
-				$sql2 -> db_Select("news", "*", "news_id=$comment_item_id ");
-				$row = $sql2 -> db_Fetch(); extract($row);
-				if(check_class($news_class)){
-					$news_title=$aj -> tpa($news_title);
-					$str .= $bullet."[ ".LIST_1." ] Re: <a href='".e_BASE."comment.php?comment.news.$comment_item_id'>".$aj -> tpa($news_title,"admin")."</a><br />";
-					$comment_count++;
-				}
-			break;
-
-			case 1:	//	article, review or content page
-				//	find out whether article, review or content page ...
-				$sql2 -> db_Select("content", "content_heading, content_type, content_class", "content_id=$comment_item_id ");
-				$row = $sql2 -> db_Fetch(); 
-				extract($row);
-				if(check_class($content_class)){
-					$comment_count++;
-					switch($content_type){
-						case 0:	//	article
-							$str .= $bullet."[ ".LIST_14." ] Re: <a href='".e_BASE."content.php?article.$comment_item_id'>".$aj -> tpa($content_heading,"admin")."</a><br />";
-						break;
-						case 1:	//	content page
-							$str .= $bullet."[ ".LIST_15." ] Re: <a href='".e_BASE."content.php?content.$comment_item_id'>".$aj -> tpa($content_heading,"admin")."</a><br />";
-						break;
-						case 3:	//	review
-							$str .= $bullet."[ ".LIST_16." ] Re: <a href='".e_BASE."content.php?review.$comment_item_id.'>".$aj -> tpa($content_heading,"admin")."</a><br />";
-						break;
-					}
-				}
-			break;
-
-			case 2: //	downloads
-				$mp = MPREFIX;
-				$qry = "SELECT download_name, {$mp}download_category.download_category_class FROM {$mp}download LEFT JOIN {$mp}download_category ON {$mp}download.download_category={$mp}download_category.download_category_id WHERE {$mp}download.download_id={$comment_item_id}";
-				$sql2 -> db_Select_gen($qry);
-				$row = $sql2 -> db_Fetch(); 
-				extract($row);
-				if(check_class($download_category_class)){
-					$str .= $bullet."[ ".LIST_17." ] Re: <a href='".e_BASE."download.php?view.$comment_item_id'>".$aj -> tpa($download_name,"admin")."</a><br />";
-					$comment_count++;
-				}
-			break;
-
-			case 3: //	faq
-				$sql2 -> db_Select("faq", "faq_question", "faq_id=$comment_item_id ");
-				$row = $sql2 -> db_Fetch(); extract($row);
-				$str .= $bullet."[ ".LIST_18." ] Re: <a href='".e_BASE."faq.php?view.$comment_item_id'>".$aj -> tpa($faq_question,"admin")."</a><br />";
-					$comment_count++;
-			break;
-
-			case 4:	//	poll comment
-				$sql2 -> db_Select("poll", "*", "poll_id=$comment_item_id ");
-				$row = $sql2 -> db_Fetch(); extract($row);
-				$str .= $bullet."[ ".LIST_19." ] Re: <a href='".e_BASE."comment.php?comment.poll.$comment_item_id'>".$aj -> tpa($poll_title,"admin")."</a><br />";
-					$comment_count++;
-			break;
-
-			case 6:	//	bugtracker
-				$sql2 -> db_Select("bugtrack", "bugtrack_summary", "bugtrack_id=$comment_item_id ");
-				$row = $sql2 -> db_Fetch(); extract($row);
-				$str .= $bullet."[ ".LIST_20." ] Re: <a href='".e_PLUGIN."bugtracker/bugtracker.php?show.$comment_item_id'>".$aj -> tpa($bugtrack_summary)."</a><br />";
-					$comment_count++;
-			break;
-
-		}
-			$handle=opendir(e_PLUGIN);
-					while(false !== ($file = readdir($handle))){
-							if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)){
-									$plugin_handle=opendir(e_PLUGIN.$file."/");
-									while(false !== ($file2 = readdir($plugin_handle))){
-											if($file2 == "e_comment.php"){
-													include(e_PLUGIN.$file."/".$file2);
-													if($comment_type == $e_plug_table){
-														$sql2 -> db_Select("".$db_table."", "".$link_name."", "".$db_id."=$comment_item_id ");
-														$row = $sql2 -> db_Fetch(); extract($row);
-														$nid = $comment_item_id;
-														$link = $row[0];
-														$str .= $bullet."[ ".$plugin_name." ] Re: <a href='".$reply_location."'>".$aj -> tpa($link)."</a><br />";
-														$comment_count++;
-														break 2;
-													}
-											}
-									}
-							}
-					}
-	}
-}
-if($comment_count==0){
-	$str = LIST_4;
-}
-
-$text .= "
-<tr>
-<td class='fcaption'>".LIST_2." ({$comment_count})</td>
-</tr>
-<td class='forumheader3'>".$str."</td>
-</tr>\n";
-
-unset($str);
-if($chatbox_posts = $sql -> db_Select("chatbox", "*", "cb_datestamp>$lvisit ORDER BY cb_datestamp DESC LIMIT 0,50")){
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		$cb_id = substr($cb_nick , 0, strpos($cb_nick , "."));
-		$cb_nick = substr($cb_nick , (strpos($cb_nick , ".")+1));
-		$cb_message = str_replace("<br />", "", $aj -> tpa($cb_message));
-		$str .= $bullet."[ <a href='".e_BASE."user.php?id.$cb_id'>$cb_nick</a> ] {$cb_message}<br />";
-	}
-}else{
-	$str = LIST_4;
-}
-
-$text .= "
-<tr>
-<td class='fcaption'>".LIST_5." ($chatbox_posts)</td>
-</tr>
-<td class='forumheader3'>".$str."</td>
-</tr>\n";
-
-unset($str);
-$forum_posts = $sql -> db_Select("forum_t", "*", "thread_datestamp>$lvisit ORDER BY thread_datestamp DESC LIMIT 0,50");
-while($row = $sql -> db_Fetch()){
-	extract($row);
-	$sql2 -> db_Select("forum", "*", "forum_id=$thread_forum_id");
-	$row = $sql2 -> db_Fetch(); extract($row);
-	if(check_class($forum_class)){
-		if($thread_parent){
-			$ttemp = $thread_id;
-			$sql2 -> db_Select("forum_t", "*", "thread_id=$thread_parent ");
-			$row = $sql2 -> db_Fetch(); extract($row);
-			$str .= $bullet."[ <a href='".e_BASE."forum_viewforum.php?$forum_id'>$forum_name</a> ] Re: <a href='".e_BASE."forum_viewtopic.php?$thread_forum_id.$thread_id#$ttemp'>".$aj -> tpa($thread_name)."</a><br />";
-		}else{
-			$str .= $bullet."[ <a href='".e_BASE."forum_viewforum.php?$forum_id'>$forum_name</a> ] <a href='".e_BASE."forum_viewtopic.php?$thread_forum_id.$thread_id'>".$aj -> tpa($thread_name)."</a><br/>";
-		}
-	}else{
-		$forum_posts = $forum_posts - 1;
-	}
-}
-if(!$forum_posts){
-	$str = LIST_4;
-}
-
-$text .= "
-<tr>
-<td class='fcaption'>".LIST_6." ($forum_posts)</td>
-</tr>
-<td class='forumheader3'>".$str."</td>
-</tr>\n";
-
-unset($str);
-if($new_members = $sql -> db_Select("user", "*", "user_join>$lvisit ORDER BY user_join DESC LIMIT 0,30")){
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		$str .= "$bullet<a href='".e_BASE."user.php?id.$user_id'>$user_name</a><br />";
-	}
-}else{
-	$str = LIST_4;
-}
-
-$text .= "
-<tr>
-<td class='fcaption'>".LIST_7." ($new_members)</td>
-</tr>
-<td class='forumheader3'>".$str."</td>
-</tr>\n";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-$text .= "</table>\n</div>";
-$ns -> tablerender(LIST_3, $text);
-
-/*
-			$time = USERLV;
-			$new_news = $sql -> db_Count("news", "(*)", "WHERE news_datestamp>'".$time."' "); if(!$new_news){ $new_news = "no"; }
-			$new_comments = $sql -> db_Count("comments", "(*)", "WHERE comment_datestamp>'".$time."' "); if(!$new_comments){ $new_comments = "no"; }
-			$new_chat = $sql -> db_Count("chatbox", "(*)", "WHERE cb_datestamp>'".$time."' "); if(!$new_chat){ $new_chat = "no"; }
-			$new_forum = $sql -> db_Count("forum_t", "(*)", "WHERE thread_datestamp>'".$time."' "); if(!$new_forum){ $new_forum = "no"; }
-			$new_users = $sql -> db_Count("user", "(*)", "WHERE user_join>'".$time."' "); if(!$new_users){ $new_users = "no"; }
-*/
-
-
-require_once(FOOTERF);
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/plugin.php 75/e107_plugins/list_new/plugin.php
--- 6171/e107_plugins/list_new/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/plugin.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,76 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|        code adapted from original by Lolo Irie (lolo_irie@e107coders.org)
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $PLUGINS_DIRECTORY;
+$lan_file = e_PLUGIN."list_new/languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."list_new/languages/English.php");
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = LIST_PLUGIN_1;
+$eplug_version = "1.0";
+$eplug_author = "Eric Vanderfeesten (lisa)";
+$eplug_logo = "";
+$eplug_url = "http://eindhovenseschool.net";
+$eplug_email = "lisa@eindhovenseschool.net";
+$eplug_description = LIST_PLUGIN_2;
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";        // leave blank if no readme file
+
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "list_new";
+
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = array("list_new_menu.php", "list_recent_menu.php");
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_list_config.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/icon/list_32.png";
+$eplug_icon_small = $eplug_folder."/icon/list_16.png";
+$eplug_caption =  LIST_PLUGIN_3;
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array();
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = "";
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = "";
+
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = TRUE;
+$eplug_link_name = LIST_PLUGIN_5;
+$eplug_link_url = e_PLUGIN."list_new/list.php";
+
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = LIST_PLUGIN_4;
+
+
+// upgrading ... //
+
+$upgrade_add_prefs = "";
+$upgrade_remove_prefs = "";
+$upgrade_alter_tables = "";
+$eplug_upgrade_done = "";
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/section/list_comment.php 75/e107_plugins/list_new/section/list_comment.php
--- 6171/e107_plugins/list_new/section/list_comment.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/section/list_comment.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,142 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+	$LIST_CAPTION = $arr[0];
+	$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+
+	$bullet = $this -> getBullet($arr[6], $mode);
+
+	if($mode == "new_page" || $mode == "new_menu" ){
+		$lvisit = $this -> getlvisit();
+		$qry = "comment_datestamp>".$lvisit;
+	}else{
+		$qry = "comment_id != '0' ";
+	}
+	$qry .= " ORDER BY comment_datestamp DESC LIMIT 0,".intval($arr[7]);
+
+	$sql2 = new db;
+	if(!$sql -> db_Select("comments", "*", $qry )){
+		$LIST_DATA = LIST_COMMENT_2;
+	}else{		
+		while($row = $sql -> db_Fetch()){
+
+			if($arr[3]){
+				$comment_author_id = substr($row['comment_author'] , 0, strpos($row['comment_author'] , "."));
+				$comment_author_name = substr($row['comment_author'] , (strpos($row['comment_author'] , ".")+1));
+				$AUTHOR = (USERID ? "<a href='".e_BASE."user.php?id.".$comment_author_id."'>".$comment_author_name."</a>" : $comment_author_name);
+			}else{
+				$AUTHOR = "";
+			}
+
+			$DATE	= ($arr[5] ? $this -> getListDate($row['comment_datestamp'], $mode) : "");
+			$ICON	= $bullet;
+			$INFO	= "";
+
+			// news
+			if($row['comment_type'] == "0"){	
+					$sql2 -> db_Select("news", "*", "news_id='".$row['comment_item_id']."' AND news_class REGEXP '".e_CLASS_REGEXP."' ");
+					$row2 = $sql2 -> db_Fetch();
+					$rowheading	= $this -> parse_heading($row2['news_title'], $mode);
+					$HEADING	= "<a href='".e_BASE."comment.php?comment.news.".$row['comment_item_id']."' title='".$row2['news_title']."'>".$tp -> toHTML($rowheading, TRUE)."</a>";
+					$CATEGORY	= ($arr[4] ? "<a href='".e_BASE."news.php'>".LIST_COMMENT_3."</a>" : "");
+
+			//	article, review or content page
+			}elseif($row['comment_type'] == "1"){	
+
+			//	downloads
+			}elseif($row['comment_type'] == "2"){	
+					$mp = MPREFIX;
+					$qry = "SELECT download_name, {$mp}download_category.download_category_class, {$mp}download_category.download_category_id, {$mp}download_category.download_category_name FROM {$mp}download LEFT JOIN {$mp}download_category ON {$mp}download.download_category={$mp}download_category.download_category_id WHERE {$mp}download.download_id={$row['comment_item_id']} AND {$mp}download_category.download_category_class REGEXP '".e_CLASS_REGEXP."' ";
+					$sql2->db_Select_gen($qry);
+					$row2 = $sql2->db_Fetch();
+					$rowheading	= $this -> parse_heading($row2['download_name'], $mode);
+					$HEADING	= "<a href='".e_BASE."download.php?view.".$row['comment_item_id']."' title='".$row2['download_name']."'>".$tp -> toHTML($rowheading, TRUE)."</a>";
+					$CATEGORY	= ($arr[4] ? "<a href='".e_BASE."download.php?list.".$row2['download_category_id']."'>".$row2['download_category_name']."</a>" : "");
+
+			//	faq
+			}elseif($row['comment_type'] == "3"){	
+					$sql2 -> db_Select("faq", "faq_question", "faq_id='".$row['comment_item_id']."' ");
+					$row2 = $sql2 -> db_Fetch();
+					$rowheading	= $this -> parse_heading($row2['faq_question'], $mode);
+					$HEADING	= "<a href='".e_PLUGIN."faq/faq.php?view.".$row2['comment_item_id']."' title='".$row2['faq_question']."'>".$tp -> toHTML($rowheading, TRUE)."</a>";
+					$CATEGORY	= ($arr[4] ? "<a href='".e_PLUGIN."faq/faq.php'>".LIST_COMMENT_4."</a>" : "");
+
+			//	poll comment
+			}elseif($row['comment_type'] == "4"){	
+					$sql2 -> db_Select("polls", "*", "poll_id='".$row['comment_item_id']."' ");
+					$row2 = $sql2 -> db_Fetch();
+					$rowheading	= $this -> parse_heading($row2['poll_title'], $mode);
+					$HEADING	= "<a href='".e_BASE."comment.php?comment.poll.".$row['comment_item_id']."' title='".$row2['poll_title']."'>".$tp -> toHTML($rowheading, TRUE)."</a>";
+					$CATEGORY	= ($arr[4] ? LIST_COMMENT_5 : "");
+
+			//	docs
+			}elseif($row['comment_type'] == "5"){	
+					/*
+					$str .= $bullet." <b><a href='http://e107.org/docs/main.php?$comment_item_id'>Doc $comment_item_id</a></b><br />";
+					$str .= ($recent_pref['comments_cat'] ? $style_pre."".LIST_31."<br />" : "").($recent_pref['comments_author'] ? $style_pre."".($comment_author_id == 0 ? $comment_author_name : "<a href='".e_BASE."user.php?id.".$comment_author_name."'>".$comment_author_name."</a>" )."<br />" : "").($recent_pref['comments_date'] ? $style_pre."".$datestamp."<br />" : "");
+					*/
+
+			//	bugtracker
+			}elseif($row['comment_type'] == "6"){	
+					$sql2 -> db_Select("bugtrack2_bugs", "bugtrack2_bugs_summary", "bugtrack2_bugs_id='".$row['comment_item_id']."' ");
+					$row2 = $sql2 -> db_Fetch();
+					$rowheading	= $this -> parse_heading($row2['bugtrack2_bugs_summary'], $mode);
+					$HEADING	= "<a href='".e_PLUGIN."bugtracker2/bugtracker2.php?0.bug.".$row['comment_item_id']."' title='".$row2['bugtrack2_bugs_summary']."'>".$tp -> toHTML($rowheading, TRUE)."</a>";
+					$CATEGORY	= ($arr[4] ? LIST_COMMENT_7 : "");
+
+			//	ideas
+			}elseif($row['comment_type'] == "ideas"){	
+					$sql2 -> db_Select("ideas", "ideas_summary", "ideas_id='".$row['comment_item_id']."' ");
+					$row2 = $sql2 -> db_Fetch();
+					$rowheading	= $this -> parse_heading($row2['ideas_summary'], $mode);
+					$HEADING	= "<a href='".e_PLUGIN."ideas/ideas.php?show.".$row['comment_item_id']."' title='".$row2['ideas_summary']."'>".$tp -> toHTML($rowheading, TRUE)."</a>";
+					$CATEGORY	= ($arr[4] ? LIST_COMMENT_10 : "");
+
+			//	pcontent
+			}elseif($row['comment_type'] == "pcontent"){	
+					$sql2 -> db_Select("pcontent", "content_heading, content_parent, content_class", "content_id='".$row['comment_item_id']."' AND content_class REGEXP '".e_CLASS_REGEXP."' ");
+					$row2 = $sql2 -> db_Fetch();
+					$rowheading = $this -> parse_heading($row2['content_heading'], $mode);
+					$HEADING = "<a href='".e_PLUGIN."content/content.php?content.".$row['comment_item_id']."' title='".$row2['content_heading']."'>".$tp -> toHTML($rowheading, TRUE)."</a>";
+					if($row2['content_parent'] == "0"){
+						$catid = $row['comment_item_id'];
+					}elseif(strpos($row2['content_parent'], ".")){
+						$catid = substr($row2['content_parent'], 2);
+					}else{
+						$catid = $row2['content_parent'];
+					}
+					$CATEGORY = ($arr[4] ? "<a href='".e_PLUGIN."content/content.php?cat.".$catid."'>".LIST_COMMENT_8."</a>" : "");
+
+			}else{
+
+				$handle=opendir(e_PLUGIN);
+				while(false !== ($file = readdir($handle))){
+					if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)){
+						$plugin_handle=opendir(e_PLUGIN.$file."/");
+						while(false !== ($file2 = readdir($plugin_handle))){
+
+							if ($file2 == "e_comment.php") {
+								$nid = $row['comment_item_id'];
+								include(e_PLUGIN.$file."/".$file2);
+								if ($row['comment_type'] == $e_plug_table) {
+
+									$sql2 -> db_Select("".$db_table."", "".$link_name."", "".$db_id." = '".$row['comment_item_id']."' ");
+									$row2 = $sql2 -> db_Fetch();								
+									$rowheading	= $this -> parse_heading($row2[0], $mode);									
+									$HEADING	= "<a href='".$reply_location."' title='".$row2[0]."'>".$tp -> toHTML($rowheading, TRUE)."</a>";
+									$CATEGORY	= ($arr[4] ? $plugin_name : "");
+
+									break 2;
+								}
+							}
+						}
+					}
+				}
+			}
+			$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+		}
+	}
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/section/list_download.php 75/e107_plugins/list_new/section/list_download.php
--- 6171/e107_plugins/list_new/section/list_download.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/section/list_download.php	2006-02-17 17:23:43.000000000 -0600
@@ -0,0 +1,38 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+	$LIST_CAPTION = $arr[0];
+	$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+
+	if($mode == "new_page" || $mode == "new_menu" ){
+		$lvisit = $this -> getlvisit();
+		$qry = " AND download_datestamp>".$lvisit;
+	}else{
+		$qry = " ";
+	}
+
+	$bullet = $this -> getBullet($arr[6], $mode);
+
+	$mp = MPREFIX;
+	$qry = "SELECT download_id, download_name, download_author, download_datestamp, {$mp}download_category.download_category_id, {$mp}download_category.download_category_name, {$mp}download_category.download_category_class FROM {$mp}download LEFT JOIN {$mp}download_category ON {$mp}download.download_category={$mp}download_category.download_category_id WHERE download_category_class REGEXP '".e_CLASS_REGEXP."' AND download_class REGEXP '".e_CLASS_REGEXP."' AND {$mp}download.download_active != '0' ".$qry." ORDER BY download_datestamp DESC LIMIT 0,".intval($arr[7])." ";
+
+	$downloads = $sql -> db_Select_gen($qry);
+	if($downloads == 0) {
+		$LIST_DATA = LIST_DOWNLOAD_2;
+	}else{
+		while($row = $sql -> db_Fetch()){
+
+			$rowheading	= $this -> parse_heading($row['download_name'], $mode);
+			$ICON		= $bullet;
+			$HEADING	= "<a href='".e_BASE."download.php?view.".$row['download_id']."' title='".$row['download_name']."'>".$rowheading."</a>";
+			$AUTHOR		= ($arr[3] ? $row['download_author'] : "");
+			//$AUTHOR	= ($arr[3] ? (USERID ? "<a href='".e_BASE."user.php?id.".$row['download_author_id']."'>".$row['download_author']."</a>" : $row['download_author']) : "");
+			$CATEGORY	= ($arr[4] ? "<a href='".e_BASE."download.php?list.".$row['download_category_id']."'>".$row['download_category_name']."</a>" : "");
+			$DATE		= ($arr[5] ? $this -> getListDate($row['download_datestamp'], $mode) : "");
+			$INFO		= "";
+			$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+		}
+	}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/section/list_members.php 75/e107_plugins/list_new/section/list_members.php
--- 6171/e107_plugins/list_new/section/list_members.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/section/list_members.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,34 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+	$LIST_CAPTION = $arr[0];
+	$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+	
+	if($mode == "new_page" || $mode == "new_menu" ){
+		$lvisit = $this -> getlvisit();
+		$qry = "user_join>".$lvisit." AND user_ban='0' AND ";
+	}else{
+		$qry = " ";
+	}
+	$qry .= " (user_class = '' || user_class REGEXP '".e_CLASS_REGEXP."') ORDER BY user_join DESC LIMIT 0,".intval($arr[7]);
+
+	$bullet = $this -> getBullet($arr[6], $mode);
+
+	if(!$sql -> db_Select("user", "*", $qry)){ 
+		$LIST_DATA = LIST_MEMBER_2;
+	}else{
+		while($row = $sql -> db_Fetch()){
+
+			$rowheading	= $this -> parse_heading($row['user_name'], $mode);
+			$ICON		= $bullet;
+			$HEADING	= (USER ? "<a href='".e_BASE."user.php?id.".$row['user_id']."' title='".$row['user_name']."'>".$rowheading."</a>" : $rowheading);
+			$CATEGORY	= "";
+			$AUTHOR		= "";
+			$DATE		= ($arr[5] ? $this -> getListDate($row['user_join'], $mode) : "");
+			$INFO		= "";
+			$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+		}
+	}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/list_new/section/list_news.php 75/e107_plugins/list_new/section/list_news.php
--- 6171/e107_plugins/list_new/section/list_news.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/list_new/section/list_news.php	2006-02-23 17:18:27.000000000 -0600
@@ -0,0 +1,62 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+	if($mode == "new_page" || $mode == "new_menu" ){
+		$lvisit = $this -> getlvisit();
+		$qry = " news_datestamp>".$lvisit;
+	}else{
+		$qry = " (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ";
+	}
+
+	$bullet = $this -> getBullet($arr[6], $mode);
+	
+	$LIST_CAPTION = $arr[0];
+	$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
+
+	$qry = "
+	SELECT n.*, c.category_id AS news_category_id, c.category_name AS news_category_name, u.user_id AS news_author_id, u.user_name AS news_author_name
+	FROM #news AS n
+	LEFT JOIN #news_category AS c ON c.category_id = n.news_category
+	LEFT JOIN #user AS u ON n.news_author = u.user_id
+	WHERE ".$qry." AND n.news_class REGEXP '".e_CLASS_REGEXP."'
+	ORDER BY n.news_datestamp DESC LIMIT 0,".intval($arr[7])." 
+	";
+
+	if(!$sql -> db_Select_gen($qry)){
+		$LIST_DATA = LIST_NEWS_2;
+	}else{
+		while($row = $sql -> db_Fetch()){
+
+			// Code from Lisa
+			// copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X
+			// instead of the actual hyperlink that may have been added to a newstitle on creation
+			$search = array();
+			$replace = array();
+			$search[0] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
+			$replace[0] = '\\2';
+			$search[1] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
+			$replace[1] = '\\2';
+			$search[2] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
+			$replace[2] = '\\2';
+			$search[3] = "/\<a href=&quot;(.*?)&quot;>(.*?)<\/a>/si";
+			$replace[3] = '\\2';
+			$search[4] = "/\<a href=&#39;(.*?)&#39;>(.*?)<\/a>/si";
+			$replace[4] = '\\2';
+			$search[5] = "/\<a href=&#039;(.*?)&#039;>(.*?)<\/a>/si";
+			$replace[5] = '\\2';
+			$news_title = preg_replace($search, $replace, $row['news_title']);
+			// End of code from Lisa
+
+			$rowheading	= $this -> parse_heading($news_title, $mode);
+			$ICON		= $bullet;
+			$HEADING	= "<a href='".e_BASE."news.php?item.".$row['news_id']."' title='".$rowheading."'>".$rowheading."</a>";
+			$AUTHOR		= ($arr[3] ? ($row['news_author'] == 0 ? $row['news_author'] : ($row['news_author_name'] ? "<a href='".e_BASE."user.php?id.".$row['news_author_id']."'>".$row['news_author_name']."</a>" : "") ) : "");
+			$CATEGORY	= ($arr[4] ? "<a href='".e_BASE."news.php?cat.".$row['news_category_id']."'>".$row['news_category_name']."</a>" : "");
+			$DATE		= ($arr[5] ? $this -> getListDate($row['news_datestamp'], $mode) : "");
+			$INFO		= "";
+			$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
+		}
+	}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/log/admin_config.php 75/e107_plugins/log/admin_config.php
--- 6171/e107_plugins/log/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/admin_config.php	2005-11-10 14:35:17.000000000 -0600
@@ -0,0 +1,336 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/admin_config.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2005/11/10 20:35:17 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if (!getperms("P")) {
+	header("location:../index.php");
+	 exit;
+}
+
+if (isset($_POST['updateStats']))
+{
+	header("location: ".e_PLUGIN."log/admin_updateroutine.php");
+	exit;
+}
+
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."userclass_class.php");
+
+define("LOGPATH", e_PLUGIN."log/");
+	
+@include_once(LOGPATH."languages/admin/".e_LANGUAGE.".php");
+@include_once(LOGPATH."languages/admin/English.php");
+
+if(IsSet($_POST['openRemPageD']))
+{
+	rempage();
+}
+if(IsSet($_POST['remSelP']))
+{
+	rempagego();
+}
+
+
+if(IsSet($_POST['wipeSubmit']))
+{
+	foreach($_POST['wipe'] as $key => $wipe)
+	{
+		switch($key)
+		{
+			case "statWipePage":
+				$sql -> db_Update("logstats", "log_data='' WHERE log_id='pageTotal' ");
+				$sql -> db_Update("logstats", "log_data='' WHERE log_id='statTotal' ");
+				$sql -> db_Update("logstats", "log_data='' WHERE log_id='statUnique' ");
+			break;
+			case "statWipeBrowser":
+				$sql -> db_Update("logstats", "log_data='' WHERE log_id='statBrowser' ");
+			break;
+			case "statWipeOs":
+				$sql -> db_Update("logstats", "log_data='' WHERE log_id='statOs' ");
+			break;
+			case "statWipeScreen":
+				$sql -> db_Update("logstats", "log_data='' WHERE log_id='statScreen' ");
+			break;
+			case "statWipeDomain":
+				$sql -> db_Update("logstats", "log_data='' WHERE log_id='statDomain' ");
+			break;
+			case "statWipeRefer":
+				$sql -> db_Update("logstats", "log_data='' WHERE log_id='statReferer' ");
+			break;
+			case "statWipeQuery":
+				$sql -> db_Update("logstats", "log_data='' WHERE log_id='statQuery' ");
+			break;
+		}
+	}
+	$message = ADSTAT_L25;
+}
+
+
+
+if(!is_writable(LOGPATH."logs")) {
+	$message = "<b>You must set the permissions of the e107_plugins/log/logs folder to 777 (chmod 777)</b>";
+}
+	
+if (isset($_POST['updatesettings'])) {
+	$pref['statActivate'] = $_POST['statActivate'];
+	$pref['statCountAdmin'] = $_POST['statCountAdmin'];
+	$pref['statUserclass'] = $_POST['statUserclass'];
+	$pref['statBrowser'] = $_POST['statBrowser'];
+	$pref['statOs'] = $_POST['statOs'];
+	$pref['statScreen'] = $_POST['statScreen'];
+	$pref['statDomain'] = $_POST['statDomain'];
+	$pref['statRefer'] = $_POST['statRefer'];
+	$pref['statQuery'] = $_POST['statQuery'];
+	$pref['statRecent'] = $_POST['statRecent'];
+	$pref['statDisplayNumber'] = $_POST['statDisplayNumber'];
+	save_prefs();
+	$message = ADSTAT_L17;
+}
+
+	
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+	
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".ADSTAT_L4."</td>
+	<td style='width:50%; text-align: right;' class='forumheader3'>
+	<input type='radio' name='statActivate' value='1'".($pref['statActivate'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
+	<input type='radio' name='statActivate' value='0'".(!$pref['statActivate'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".ADSTAT_L18."</td>
+	<td style='width:50%; text-align: right;' class='forumheader3'>".r_userclass("statUserclass", $pref['statUserclass'],'off','public, member, admin, classes')."</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".ADSTAT_L20."</td>
+	<td style='width:50%; text-align: right;' class='forumheader3'>
+	<input type='radio' name='statCountAdmin' value='1'".($pref['statCountAdmin'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
+	<input type='radio' name='statCountAdmin' value='0'".(!$pref['statCountAdmin'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:50%' class='forumheader3'>".ADSTAT_L21."</td>
+	<td style='width:50%; text-align: right;' class='forumheader3'>
+	<input class='tbox' type='text' name='statDisplayNumber' size='8' value='".$pref['statDisplayNumber']."' maxlength='3' />
+	</td>
+	</tr>
+
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".ADSTAT_L5."</td>
+	<td style='width:50%; text-align: right;' class='forumheader3'>
+	".ADSTAT_L6."&nbsp;&nbsp;
+	<input type='radio' name='statBrowser' value='1'".($pref['statBrowser'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
+	<input type='radio' name='statBrowser' value='0'".(!$pref['statBrowser'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."<br />
+
+	".ADSTAT_L7."&nbsp;&nbsp;
+	<input type='radio' name='statOs' value='1'".($pref['statOs'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
+	<input type='radio' name='statOs' value='0'".(!$pref['statOs'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."<br />
+
+	".ADSTAT_L8."&nbsp;&nbsp;
+	<input type='radio' name='statScreen' value='1'".($pref['statScreen'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
+	<input type='radio' name='statScreen' value='0'".(!$pref['statScreen'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."<br />
+
+	".ADSTAT_L9."&nbsp;&nbsp;
+	<input type='radio' name='statDomain' value='1'".($pref['statDomain'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
+	<input type='radio' name='statDomain' value='0'".(!$pref['statDomain'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."<br />
+
+	".ADSTAT_L10."&nbsp;&nbsp;
+	<input type='radio' name='statRefer' value='1'".($pref['statRefer'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
+	<input type='radio' name='statRefer' value='0'".(!$pref['statRefer'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."<br />
+
+	".ADSTAT_L11."&nbsp;&nbsp;
+	<input type='radio' name='statQuery' value='1'".($pref['statQuery'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
+	<input type='radio' name='statQuery' value='0'".(!$pref['statQuery'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."<br />
+
+	".ADSTAT_L19."&nbsp;&nbsp;
+	<input type='radio' name='statRecent' value='1'".($pref['statRecent'] ? " checked='checked'" : "")." /> ".ADSTAT_ON."&nbsp;&nbsp;
+	<input type='radio' name='statRecent' value='0'".(!$pref['statRecent'] ? " checked='checked'" : "")." /> ".ADSTAT_OFF."<br />
+
+	</td>
+	</tr>
+	
+	<tr>
+	<td style='width:50%' class='forumheader3'>".ADSTAT_L12."<br /><span class='smalltext'>".ADSTAT_L13."</td>
+	<td style='width:50%; text-align: right;' class='forumheader3'>
+	".ADSTAT_L14."<input type='checkbox' name='wipe[statWipePage]' value='1' /><br />
+	".ADSTAT_L6."<input type='checkbox' name='wipe[statWipeBrowser]' value='1' /><br />
+	".ADSTAT_L7." <input type='checkbox' name='wipe[statWipeOs]' value='1' /><br />
+	".ADSTAT_L8." <input type='checkbox' name='wipe[statWipeScreen]' value='1' /><br />
+	".ADSTAT_L9."<input type='checkbox' name='wipe[statWipeDomain]' value='1' /><br />
+	".ADSTAT_L10."<input type='checkbox' name='wipe[statWipeRefer]' value='1' /><br />
+	".ADSTAT_L11."<input type='checkbox' name='wipe[statWipeQuery]' value='1' /><br />
+	<br /><input class='button' type='submit' name='wipeSubmit' value='".ADSTAT_L12."' />
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".ADSTAT_L26."<br /><span class='smalltext'>".ADSTAT_L27."</td>
+	<td style='width:50%; text-align: right;' class='forumheader3'><input class='button' type='submit' name='openRemPageD' value='".ADSTAT_L28."' />
+	</td>
+	</tr>
+	
+	";
+
+	$text .= "
+	
+
+	 
+	<tr>
+	<td colspan='2'  style='text-align:center' class='forumheader'>
+	<input class='button' type='submit' name='updatesettings' value='".ADSTAT_L15."' />
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+	
+$ns->tablerender(ADSTAT_L16, $text);
+require_once(e_ADMIN."footer.php");
+
+
+
+
+function rempage()
+{
+	global $sql, $ns;
+
+	$logfile = e_PLUGIN."log/logs/logp_".date("z.Y", time()).".php";
+	if(is_readable($logfile))
+	{
+		require($logfile);
+	}
+
+	$sql -> db_Select("logstats", "*", "log_id='pageTotal' ");
+	$row = $sql -> db_Fetch();
+	$pageTotal = unserialize($row['log_data']);
+
+	foreach($pageInfo as $url => $tmpcon) {
+		$pageTotal[$url]['url'] = $tmpcon['url'];
+		$pageTotal[$url]['ttlv'] += $tmpcon['ttl'];
+		$pageTotal[$url]['unqv'] += $tmpcon['unq'];
+	}
+
+	$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."'>
+	<table style='".ADMIN_WIDTH."' class='fborder'>
+
+	<tr>
+	<td style='width:30%' class='forumheader'>".ADSTAT_L29."</td>
+	<td style='width:50%' class='forumheader'>URL</td>
+	<td style='width:30%; text-align: center;' class='forumheader'>".ADSTAT_L30." ...</td>
+	</tr>
+	";
+
+	foreach($pageTotal as $key => $page)
+	{
+		$text .= "
+		<tr>
+		<td style='width:30%' class='forumheader3'>$key</td>
+		<td style='width:50%' class='forumheader3'>".$page['url']."</td>
+		<td style='width:30%; text-align: center;' class='forumheader3'><input type='checkbox' name='remcb[]' value='$key' /></td>
+		</tr>
+		";
+	}
+
+	$text .= "
+
+	<tr>
+	<td colspan='3' class='forumheader3' style='text-align: center;'><input class='button' type='submit' name='remSelP' value='".ADSTAT_L31."' />
+	</td>
+	</tr>
+
+	</table>
+	</form>
+	</div>
+	";
+
+	$ns -> tablerender(ADSTAT_L32, $text);
+}
+
+
+function rempagego()
+{
+	global $sql;
+
+	$sql -> db_Select("logstats", "*", "log_id='pageTotal' ");
+	$row = $sql -> db_Fetch();
+	$pageTotal = unserialize($row['log_data']);
+
+	$logfile = e_PLUGIN."log/logs/logp_".date("z.Y", time()).".php";
+	if(is_readable($logfile))
+	{
+		require($logfile);
+	}
+
+	foreach($_POST['remcb'] as $page)
+	{
+		unset($pageInfo[$page]);
+		unset($pageTotal[$page]);
+	}
+
+	$pagetotal = serialize($pageTotal);
+	if(!$sql -> db_Update("logstats", "log_data='$pagetotal' WHERE log_id='pageTotal' "))
+	{
+		$sql -> db_Insert("logstats", "0, 'pageTotal', '$pagetotal' ");
+	}
+	
+	$varStart = chr(36);
+	$quote = chr(34);
+
+	$data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n".
+	$varStart."ipAddresses = ".$quote.$ipAddresses.$quote.";\n".
+	$varStart."siteTotal = ".$quote.$siteTotal.$quote.";\n".
+	$varStart."siteUnique = ".$quote.$siteUnique.$quote.";\n";
+
+	$loop = FALSE;
+	$data .= $varStart."pageInfo = array(\n";
+	foreach($pageInfo as $info)
+	{
+		$page = preg_replace("/(\?.*)|(\_.*)|(\.php)|(\s)|(\')|(\")|(eself)|(&nbsp;)/", "", basename ($info['url']));
+		$page = str_replace("\\", "", $page);
+		$info['url'] = preg_replace("/(\s)|(\')|(\")|(eself)|(&nbsp;)/", "", $info['url']);
+		$info['url'] = str_replace("\\", "", $info['url']);
+		$page = trim($page);
+		if($page && !strstr($page, "cache") && !strstr($page, "file:"))
+		{
+			if($loop){ $data .= ",\n"; }
+			$data .= $quote.$page.$quote." => array('url' => '".$info['url']."', 'ttl' => ".$info['ttl'].", 'unq' => ".$info['unq'].")";
+			$loop = 1;
+		}
+	}
+
+	$data .= "\n);\n\n?".  chr(62);
+
+	if ($handle = fopen($logfile, 'w')) { 
+		fwrite($handle, $data);
+	}
+	fclose($handle);
+
+
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/log/consolidate.php 75/e107_plugins/log/consolidate.php
--- 6171/e107_plugins/log/consolidate.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/consolidate.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,284 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
++----------------------------------------------------------------------------+
+*/
+
+/* first thing to do is check if the log file is out of date ... */
+
+//require_once("../../class2.php");
+
+$pathtologs = e_PLUGIN."log/logs/";
+$date = date("z.Y", time());
+$date2 = date("Y-m-j", (time() -86400));
+$date3 = date("Y-m");
+$day = date("z", time());
+$year = date("Y", time());
+
+$pfileprev = "logp_".($day-1).".".$year.".php";
+$pfile = "logp_".$date.".php";
+$ifileprev = "logi_".($day-1).".".$year.".php";
+$ifile = "logi_".$date.".php";
+
+if(file_exists($pathtologs.$pfile)) {
+	/* log file is up to date, no consolidation required */
+	return;
+}else if(!file_exists($pathtologs.$pfileprev)) {
+	/* no logfile found at all - create - this will only ever happen once ... */
+	createLog("blank");
+	return FALSE;
+}
+
+
+
+/* log file is out of date - consolidation required */
+
+/* get existing stats ... */
+if($sql -> db_Select("logstats", "*", "log_id='statBrowser' OR log_id='statOs' OR log_id='statScreen' OR log_id='statDomain' OR log_id='statTotal' OR log_id='statUnique' OR log_id='statReferer' OR log_id='statQuery'")) {
+	$infoArray = array();
+	while($row = $sql -> db_Fetch())
+	{
+		$$row[1] = unserialize($row[2]);
+		if($row[1] == "statUnique") $statUnique = $row[2];
+		if($row[1] == "statTotal") $statTotal = $row[2];
+	}
+}else{
+	/* this must be the first time a consolidation has happened - this will only ever happen once ... */
+	$sql -> db_Insert("logstats", "0, 'statBrowser', ''");
+	$sql -> db_Insert("logstats", "0, 'statOs', ''");
+	$sql -> db_Insert("logstats", "0, 'statScreen', ''");
+	$sql -> db_Insert("logstats", "0, 'statDomain', ''");
+	$sql -> db_Insert("logstats", "0, 'statReferer', ''");
+	$sql -> db_Insert("logstats", "0, 'statQuery', ''");
+	$sql -> db_Insert("logstats", "0, 'statTotal', '0'");
+	$sql -> db_Insert("logstats", "0, 'statUnique', '0'");
+	$statBrowser =array();
+	$statOs =array();
+	$statScreen =array();
+	$statDomain =array();
+	$statReferer =array();
+	$statQuery =array();
+}
+
+require_once($pathtologs.$pfileprev);
+require_once($pathtologs.$ifileprev);
+
+foreach($browserInfo as $name => $amount) {
+	$statBrowser[$name] += $amount;
+}
+
+foreach($osInfo as $name => $amount) {
+	$statOs[$name] += $amount;
+}
+
+foreach($screenInfo as $name => $amount) {
+	$statScreen[$name] += $amount;
+}
+
+
+foreach($domainInfo as $name => $amount) {
+	if(!is_numeric($name)) {
+		$statDomain[$name] += $amount;
+	}
+}
+
+foreach($refInfo as $name => $info) {
+	$statReferer[$name]['url'] = $info['url'];
+	$statReferer[$name]['ttl'] += $info['ttl'];
+}
+
+
+foreach($searchInfo as $name => $amount) {
+	$statQuery[$name] += $amount;
+}
+
+$browser = serialize($statBrowser);
+$os = serialize($statOs);
+$screen = serialize($statScreen);
+$domain = serialize($statDomain);
+$refer = serialize($statReferer);
+$squery = serialize($statQuery);
+
+$statTotal += $siteTotal;
+$statUnique += $siteUnique;
+
+$sql -> db_Update("logstats", "log_data='$browser' WHERE log_id='statBrowser'");
+$sql -> db_Update("logstats", "log_data='$os' WHERE log_id='statOs'");
+$sql -> db_Update("logstats", "log_data='$screen' WHERE log_id='statScreen'");
+$sql -> db_Update("logstats", "log_data='$domain' WHERE log_id='statDomain'");
+$sql -> db_Update("logstats", "log_data='$refer' WHERE log_id='statReferer'");
+$sql -> db_Update("logstats", "log_data='$squery' WHERE log_id='statQuery'");
+$sql -> db_Update("logstats", "log_data='".intval($statTotal)."' WHERE log_id='statTotal'");
+$sql -> db_Update("logstats", "log_data='".intval($statUnique)."' WHERE log_id='statUnique'");
+
+
+/* get monthly info from db */
+if($sql -> db_Select("logstats", "*", "log_id='$date3' ")) {
+	$tmp = $sql -> db_Fetch();
+	$monthlyInfo = unserialize($tmp['log_data']);
+	unset($tmp);
+	$MonthlyExistsFlag = TRUE;
+}
+
+foreach($pageInfo as $key => $info)
+{
+	$monthlyInfo['TOTAL']['ttlv'] += $info['ttl'];
+	$monthlyInfo['TOTAL']['unqv'] += $info['unq'];
+	$monthlyInfo[$key]['ttlv'] += $info['ttl'];
+	$monthlyInfo[$key]['unqv'] += $info['unq'];
+}
+
+$monthlyinfo = serialize($monthlyInfo);
+
+if($MonthlyExistsFlag) {
+	$sql -> db_Update("logstats", "log_data='$monthlyinfo' WHERE log_id='$date3'");
+} else {
+	$sql->db_Insert("logstats", "0, '$date3', '$monthlyinfo'");
+}
+
+
+/* collate page total information */
+if($sql -> db_Select("logstats", "*", "log_id='pageTotal' "))
+{
+	$tmp = $sql -> db_Fetch();
+	$pageTotal = unserialize($tmp['log_data']);
+	unset($tmp);
+}
+else
+{
+	$pageTotal = array();
+}
+
+foreach($pageInfo as $key => $info)
+{
+	$pageTotal[$key]['url'] = $info['url'];
+	$pageTotal[$key]['ttlv'] += $info['ttl'];
+	$pageTotal[$key]['unqv'] += $info['unq'];
+}
+
+$pagetotal = serialize($pageTotal);
+
+if(!$sql -> db_Update("logstats", "log_data='$pagetotal' WHERE log_id='pageTotal' "))
+{
+	$sql -> db_Insert("logstats", "0, 'pageTotal', '$pagetotal' ");
+}
+
+
+/* now we need to collate the individual page information into an array ... */
+
+$data = "";
+$dailytotal = 0;
+$uniquetotal = 0;
+foreach($pageInfo as $key => $value)
+{
+	$data .= $value['url']."|".$value['ttl']."|".$value['unq'].chr(1);
+	$dailytotal += $value['ttl'];
+	$uniquetotal += $value['unq'];
+}
+
+$data = $dailytotal.chr(1).$uniquetotal.chr(1) . $data;
+$sql -> db_Insert("logstats", "0, '$date2', '".$tp -> toDB($data, true)."'");
+
+	
+/* ok, we're finished with the log file now, we can empty it ... */
+if(!unlink($pathtologs.$pfileprev))
+{
+	$data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n\n\n".chr(47)."* THE INFORMATION IN THIS LOG FILE HAS BEEN CONSOLIDATED INTO THE DATABASE - YOU CAN SAFELY DELETE IT. *". chr(47)."\n\n\n?".  chr(62);
+	if ($handle = fopen($pathtologs.$pfileprev, 'w')) { 
+		fwrite($handle, $data);
+	}
+	fclose($handle);
+}
+if(!unlink($pathtologs.$ifileprev))
+{
+	$data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n\n\n".chr(47)."* THE INFORMATION IN THIS LOG INFO FILE HAS BEEN CONSOLIDATED INTO THE DATABASE - YOU CAN SAFELY DELETE IT. *". chr(47)."\n\n\n?".  chr(62);
+	if ($handle = fopen($pathtologs.$ifileprev, 'w')) { 
+		fwrite($handle, $data);
+	}
+	fclose($handle);
+}
+
+/* and finally, we need to create a new logfiles for today ... */
+createLog();
+/* done! */
+
+
+function createLog($mode="default") {
+	global $pathtologs, $statTotal, $statUnique, $pageArray, $pfile, $ifile;
+	if(!is_writable($pathtologs)) {
+		echo "Log directory is not writable - please CHMOD ".e_PLUGIN."log/logs to 777";
+		return FALSE;
+	}
+
+	$varStart = chr(36);
+	$quote = chr(34);
+
+	$data = chr(60)."?php\n". chr(47)."* e107 website system: Log file: ".date("z:Y", time())." *". chr(47)."\n\n".
+	$varStart."refererData = ".$quote.$quote.";\n".
+	$varStart."ipAddresses = ".$quote.$quote.";\n".
+	$varStart."hosts = ".$quote.$quote.";\n".
+	$varStart."siteTotal = ".$quote."0".$quote.";\n".
+	$varStart."siteUnique = ".$quote."0".$quote.";\n".
+	$varStart."screenInfo = array();\n".
+	$varStart."browserInfo = array();\n".
+	$varStart."osInfo = array();\n".
+	$varStart."pageInfo = array(\n";
+
+	if($mode == "default") {
+		reset($pageArray);
+		$loop = FALSE;
+		foreach($pageArray as $key => $info) {
+			if($loop) {
+				$data .= ",\n";
+			}
+			$data .= $quote.$key.$quote." => array('url' => '".$info['url']."', 'ttl' => 0, 'unq' => 0, 'ttlv' => ".$info['ttlv'].", 'unqv' => ".$info['unqv'].")";
+			$loop = TRUE;
+		}
+	}
+
+	$data .= "\n);\n\n?".  chr(62);
+
+	if(!touch($pathtologs.$pfile)) {
+		return FALSE;
+	}
+
+	if(!touch($pathtologs.$ifile)) {
+		return FALSE;
+	}
+
+	if(!is_writable($pathtologs.$pfile)) {
+		$old = umask(0);
+		chmod($pathtologs.$pfile, 0777);
+		umask($old);
+	//	return FALSE;
+	}
+
+	if(!is_writable($pathtologs.$ifile)) {
+		$old = umask(0);
+		chmod($pathtologs.$ifile, 0777);
+		umask($old);
+	//	return FALSE;
+	}
+
+	if ($handle = fopen($pathtologs.$pfile, 'w')) { 
+		fwrite($handle, $data);
+	}
+	fclose($handle);
+
+	if ($handle = fopen($pathtologs.$ifile, 'w')) { 
+		fwrite($handle, "");
+	}
+	fclose($handle);
+	return;
+}
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/log/images/abrowse.png and 75/e107_plugins/log/images/abrowse.png differ
Files 6171/e107_plugins/log/images/amaya.png and 75/e107_plugins/log/images/amaya.png differ
Files 6171/e107_plugins/log/images/ant.png and 75/e107_plugins/log/images/ant.png differ
Files 6171/e107_plugins/log/images/aol2.png and 75/e107_plugins/log/images/aol2.png differ
Files 6171/e107_plugins/log/images/aol.png and 75/e107_plugins/log/images/aol.png differ
Files 6171/e107_plugins/log/images/avantbrowser.png and 75/e107_plugins/log/images/avantbrowser.png differ
Files 6171/e107_plugins/log/images/avantgo.png and 75/e107_plugins/log/images/avantgo.png differ
Files 6171/e107_plugins/log/images/aweb.png and 75/e107_plugins/log/images/aweb.png differ
Files 6171/e107_plugins/log/images/bar.png and 75/e107_plugins/log/images/bar.png differ
Files 6171/e107_plugins/log/images/beonex.png and 75/e107_plugins/log/images/beonex.png differ
Files 6171/e107_plugins/log/images/beos.png and 75/e107_plugins/log/images/beos.png differ
Files 6171/e107_plugins/log/images/blazer.png and 75/e107_plugins/log/images/blazer.png differ
Files 6171/e107_plugins/log/images/camino.png and 75/e107_plugins/log/images/camino.png differ
Files 6171/e107_plugins/log/images/chimera.png and 75/e107_plugins/log/images/chimera.png differ
Files 6171/e107_plugins/log/images/columbus.png and 75/e107_plugins/log/images/columbus.png differ
Files 6171/e107_plugins/log/images/crazybrowser.png and 75/e107_plugins/log/images/crazybrowser.png differ
Files 6171/e107_plugins/log/images/curl.png and 75/e107_plugins/log/images/curl.png differ
Files 6171/e107_plugins/log/images/deepnet.png and 75/e107_plugins/log/images/deepnet.png differ
Files 6171/e107_plugins/log/images/dillo.png and 75/e107_plugins/log/images/dillo.png differ
Files 6171/e107_plugins/log/images/doris.png and 75/e107_plugins/log/images/doris.png differ
Files 6171/e107_plugins/log/images/epiphany.png and 75/e107_plugins/log/images/epiphany.png differ
Files 6171/e107_plugins/log/images/explorer.png and 75/e107_plugins/log/images/explorer.png differ
Files 6171/e107_plugins/log/images/firebird.png and 75/e107_plugins/log/images/firebird.png differ
Files 6171/e107_plugins/log/images/firefox.png and 75/e107_plugins/log/images/firefox.png differ
Files 6171/e107_plugins/log/images/freebsd.png and 75/e107_plugins/log/images/freebsd.png differ
Files 6171/e107_plugins/log/images/galeon.png and 75/e107_plugins/log/images/galeon.png differ
Files 6171/e107_plugins/log/images/html.png and 75/e107_plugins/log/images/html.png differ
Files 6171/e107_plugins/log/images/ibrowse.png and 75/e107_plugins/log/images/ibrowse.png differ
Files 6171/e107_plugins/log/images/icab.png and 75/e107_plugins/log/images/icab.png differ
Files 6171/e107_plugins/log/images/ice.png and 75/e107_plugins/log/images/ice.png differ
Files 6171/e107_plugins/log/images/isilox.png and 75/e107_plugins/log/images/isilox.png differ
Files 6171/e107_plugins/log/images/k-meleon.png and 75/e107_plugins/log/images/k-meleon.png differ
Files 6171/e107_plugins/log/images/konqueror.png and 75/e107_plugins/log/images/konqueror.png differ
Files 6171/e107_plugins/log/images/links.png and 75/e107_plugins/log/images/links.png differ
Files 6171/e107_plugins/log/images/linux.png and 75/e107_plugins/log/images/linux.png differ
Files 6171/e107_plugins/log/images/logo.png and 75/e107_plugins/log/images/logo.png differ
Files 6171/e107_plugins/log/images/lotus.png and 75/e107_plugins/log/images/lotus.png differ
Files 6171/e107_plugins/log/images/lunascape.png and 75/e107_plugins/log/images/lunascape.png differ
Files 6171/e107_plugins/log/images/lynx.png and 75/e107_plugins/log/images/lynx.png differ
Files 6171/e107_plugins/log/images/mac.png and 75/e107_plugins/log/images/mac.png differ
Files 6171/e107_plugins/log/images/maxthon.png and 75/e107_plugins/log/images/maxthon.png differ
Files 6171/e107_plugins/log/images/mbrowser.png and 75/e107_plugins/log/images/mbrowser.png differ
Files 6171/e107_plugins/log/images/mosaic.png and 75/e107_plugins/log/images/mosaic.png differ
Files 6171/e107_plugins/log/images/mozilla2.png and 75/e107_plugins/log/images/mozilla2.png differ
Files 6171/e107_plugins/log/images/mozilla.png and 75/e107_plugins/log/images/mozilla.png differ
Files 6171/e107_plugins/log/images/multibrowser.png and 75/e107_plugins/log/images/multibrowser.png differ
Files 6171/e107_plugins/log/images/nautilus.png and 75/e107_plugins/log/images/nautilus.png differ
Files 6171/e107_plugins/log/images/netbsd.png and 75/e107_plugins/log/images/netbsd.png differ
Files 6171/e107_plugins/log/images/netcaptor.png and 75/e107_plugins/log/images/netcaptor.png differ
Files 6171/e107_plugins/log/images/netfront.png and 75/e107_plugins/log/images/netfront.png differ
Files 6171/e107_plugins/log/images/netpositive.png and 75/e107_plugins/log/images/netpositive.png differ
Files 6171/e107_plugins/log/images/netscape2.png and 75/e107_plugins/log/images/netscape2.png differ
Files 6171/e107_plugins/log/images/netscape.png and 75/e107_plugins/log/images/netscape.png differ
Files 6171/e107_plugins/log/images/omniweb.png and 75/e107_plugins/log/images/omniweb.png differ
Files 6171/e107_plugins/log/images/openbsd.png and 75/e107_plugins/log/images/openbsd.png differ
Files 6171/e107_plugins/log/images/opera.png and 75/e107_plugins/log/images/opera.png differ
Files 6171/e107_plugins/log/images/oregano.png and 75/e107_plugins/log/images/oregano.png differ
Files 6171/e107_plugins/log/images/phaseout.png and 75/e107_plugins/log/images/phaseout.png differ
Files 6171/e107_plugins/log/images/phoenix.png and 75/e107_plugins/log/images/phoenix.png differ
Files 6171/e107_plugins/log/images/proxomitron.png and 75/e107_plugins/log/images/proxomitron.png differ
Files 6171/e107_plugins/log/images/remove.png and 75/e107_plugins/log/images/remove.png differ
Files 6171/e107_plugins/log/images/robot.png and 75/e107_plugins/log/images/robot.png differ
Files 6171/e107_plugins/log/images/safari.png and 75/e107_plugins/log/images/safari.png differ
Files 6171/e107_plugins/log/images/screen.png and 75/e107_plugins/log/images/screen.png differ
Files 6171/e107_plugins/log/images/shiira.png and 75/e107_plugins/log/images/shiira.png differ
Files 6171/e107_plugins/log/images/sleipnir.png and 75/e107_plugins/log/images/sleipnir.png differ
Files 6171/e107_plugins/log/images/slimbrowser.png and 75/e107_plugins/log/images/slimbrowser.png differ
Files 6171/e107_plugins/log/images/spiders.png and 75/e107_plugins/log/images/spiders.png differ
Files 6171/e107_plugins/log/images/staroffice.png and 75/e107_plugins/log/images/staroffice.png differ
Files 6171/e107_plugins/log/images/stats_16.png and 75/e107_plugins/log/images/stats_16.png differ
Files 6171/e107_plugins/log/images/stats_32.png and 75/e107_plugins/log/images/stats_32.png differ
Files 6171/e107_plugins/log/images/sunos.png and 75/e107_plugins/log/images/sunos.png differ
Files 6171/e107_plugins/log/images/sunrise.png and 75/e107_plugins/log/images/sunrise.png differ
Files 6171/e107_plugins/log/images/unix.png and 75/e107_plugins/log/images/unix.png differ
Files 6171/e107_plugins/log/images/unknown.png and 75/e107_plugins/log/images/unknown.png differ
Files 6171/e107_plugins/log/images/unspecified.png and 75/e107_plugins/log/images/unspecified.png differ
Files 6171/e107_plugins/log/images/voyager.png and 75/e107_plugins/log/images/voyager.png differ
Files 6171/e107_plugins/log/images/w3m.png and 75/e107_plugins/log/images/w3m.png differ
Files 6171/e107_plugins/log/images/web%20indexing%20robot.png and 75/e107_plugins/log/images/web%20indexing%20robot.png differ
Files 6171/e107_plugins/log/images/webtv.png and 75/e107_plugins/log/images/webtv.png differ
Files 6171/e107_plugins/log/images/windows.png and 75/e107_plugins/log/images/windows.png differ
Files 6171/e107_plugins/log/images/xiino.png and 75/e107_plugins/log/images/xiino.png differ
diff -ruN 6171/e107_plugins/log/languages/admin/English.php 75/e107_plugins/log/languages/admin/English.php
--- 6171/e107_plugins/log/languages/admin/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/languages/admin/English.php	2005-06-24 12:36:38.000000000 -0500
@@ -0,0 +1,61 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/languages/admin/English.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/06/24 17:36:38 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+	
+define("ADSTAT_ON", "On");
+define("ADSTAT_OFF", "Off");
+define("ADSTAT_L1", "This plugin will log all visits to your site, and build detailed statistic screens based on the information gathered.");
+define("ADSTAT_L2", "The statistics logger has been successfully installed. To activate, please go to the config screen and click Activate.<br /><b>You must set the permissions of the e107_plugins/log/logs folder to 777 (chmod 777)</b>");
+define("ADSTAT_L3", "Statistic Logging");
+define("ADSTAT_L4", "Activate statistic logging");
+define("ADSTAT_L5", "Statistic types");
+define("ADSTAT_L6", "Browsers");
+define("ADSTAT_L7", "Operating Systems");
+define("ADSTAT_L8", "Screen resolutions / depths");
+define("ADSTAT_L9", "Countries/domains visited from");
+define("ADSTAT_L10", "Referrers");
+define("ADSTAT_L11", "Search queries");
+define("ADSTAT_L12", "Reset stats");
+define("ADSTAT_L13", "this will erase stats - careful!");
+define("ADSTAT_L14", "Page counts");
+define("ADSTAT_L15", "Update Statistic Settings");
+define("ADSTAT_L16", "Site Statistic Settings");
+define("ADSTAT_L17", "Statistic settings updated");
+define("ADSTAT_L18", "Allow access to main statistics page to ...");
+define("ADSTAT_L19", "Recent visitors");
+define("ADSTAT_L20", "Count admin visits");
+define("ADSTAT_L21", "Maximum records to display on stats page");
+define("ADSTAT_L22", "Run update routine");
+define("ADSTAT_L23", "logs from a previous version of e107 have been detected, update them here");
+define("ADSTAT_L24", "Go to update script");
+define("ADSTAT_L25", "Selected stats reset");
+define("ADSTAT_L26", "Remove page entries");
+define("ADSTAT_L27", "if your stats have incorrect pages, you can remove them here");
+define("ADSTAT_L28", "Open page");
+
+
+define("ADSTAT_L29", "Page Name");
+define("ADSTAT_L30", "Check to remove");
+define("ADSTAT_L31", "Remove selected pages");
+define("ADSTAT_L32", "Page Tidy");
+define("ADSTAT_L10", "Referrers");
+define("ADSTAT_L10", "Referrers");
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/log/languages/English.php 75/e107_plugins/log/languages/English.php
--- 6171/e107_plugins/log/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/languages/English.php	2005-06-21 16:02:24.000000000 -0500
@@ -0,0 +1,64 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/languages/English.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/06/21 21:02:24 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("PAGE_NAME", "Statistics");
+	
+define("ADSTAT_L1", "This plugin will log all visits to your site, and build detailed statistic screens based on the information gathered.");
+define("ADSTAT_L2", "The statistics logger has been successfully installed. To convert your existing stats to the new system, please <a href='".e_PLUGIN."log/update_routine.php'>click here to run update routine</a>.");
+define("ADSTAT_L3", "Statistic Logging");
+define("ADSTAT_L4", "You do not have permission to view this page.");
+define("ADSTAT_L5", "The features on this page have been disabled.");
+define("ADSTAT_L6", "Site Statistics");
+define("ADSTAT_L7", "Statistics for this type is not being gathered.");
+define("ADSTAT_L8", "Today's Stats");
+define("ADSTAT_L9", "Alltime Stats");
+define("ADSTAT_L10", "Daily Stats");
+define("ADSTAT_L11", "Monthly Stats");
+define("ADSTAT_L12", "Browser Stats");
+define("ADSTAT_L13", "Operating System Stats");
+define("ADSTAT_L14", "Domain Stats");
+define("ADSTAT_L15", "Screen Resolution / Color Depth Stats");
+define("ADSTAT_L16", "Referral Stats");
+define("ADSTAT_L17", "Search String Stats");
+define("ADSTAT_L18", "Recent Visitors");
+define("ADSTAT_L19", "Page");
+define("ADSTAT_L20", "Visits Today");
+define("ADSTAT_L21", "Total");
+define("ADSTAT_L22", "Unique");
+define("ADSTAT_L23", "Total Visits");
+define("ADSTAT_L24", "Total Unique Visits");
+define("ADSTAT_L25", "No statistics yet.");
+define("ADSTAT_L26", "Browser");
+define("ADSTAT_L27", "Operating System");
+define("ADSTAT_L28", "Countries / Domains");
+define("ADSTAT_L29", "Screen Resolution");
+define("ADSTAT_L30", "Site Referrals");
+define("ADSTAT_L31", "Search Engine Query Strings");
+define("ADSTAT_L32", "Referred from");
+define("ADSTAT_L33", "Visits in last");
+define("ADSTAT_L34", "Visits");
+define("ADSTAT_L35", "Unique visits in last");
+define("ADSTAT_L36", "days by page");
+define("ADSTAT_L37", "Visits by month");
+define("ADSTAT_L38", "Unique visits by month");
+define("ADSTAT_L39", "remove this entry");
+define("ADSTAT_L40", "days");
+define("ADSTAT_L41", "Error");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/log/loginfo.php 75/e107_plugins/log/loginfo.php
--- 6171/e107_plugins/log/loginfo.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/loginfo.php	2006-02-19 10:08:44.000000000 -0600
@@ -0,0 +1,239 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ?Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/loginfo.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/02/19 16:08:44 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('log_INIT')) { exit; }
+
+$logIfile = "logs/logi_{$date}.php";
+require_once($logIfile);
+
+$browser = getBrowser($agent);
+$os = getOs($agent);
+
+if($screenstats && $screenstats != "@") {
+	if(array_key_exists($screenstats, $screenInfo)) {
+		$screenInfo[$screenstats] ++;
+	} else {
+		$screenInfo[$screenstats] = 1;
+	}
+}
+
+if(array_key_exists($browser, $browserInfo)) {
+	$browserInfo[$browser] ++;
+} else {
+	$browserInfo[$browser] = 1;
+}
+
+if(array_key_exists($os, $osInfo)) {
+	$osInfo[$os] ++;
+} else {
+	$osInfo[$os] =1;
+}
+
+/* referer data ... */
+if($ref && !strstr($ref, $_SERVER['HTTP_HOST'])) {
+	if(preg_match("#http://(.*?)($|/)#is", $ref, $match)) {
+		$refdom = $match[0];
+		if(array_key_exists($refdom, $refInfo)) {
+			$refInfo[$refdom]['ttl'] ++;
+		} else {
+			$refInfo[$refdom] = array('url' => $ref, 'ttl' => 1);
+		}
+	}
+}
+
+/* is the referal from Google? If so get search string ... */
+if(preg_match("#q=(.*?)($|&)#is", $oldref, $match)) {
+	$schstr = trim($match[1]);
+	$schstr = htmlentities(urldecode($schstr));
+	if(array_key_exists($schstr, $searchInfo) && $schstr) {
+		$searchInfo[$schstr] ++;
+	} else {
+		$searchInfo[$schstr] = 1;
+	}
+}
+
+if ($tmp = gethostbyaddr(getenv('REMOTE_ADDR'))) {
+	$host = trim(strtolower(substr($tmp, strrpos($tmp, ".")+1)));
+	if(!is_numeric($host) && !strstr($host, "calhost")) {
+		if(array_key_exists($host, $domainInfo)) {
+			$domainInfo[$host] ++;
+		} else {
+			$domainInfo[$host] =1;
+		}
+	}
+}
+
+/* last 20 visitors */
+if(count($visitInfo) >= 20) {
+	$length = 20;
+	$offset = count($visitInfo)-$length;
+	$visitInfo = array_slice($visitInfo, $offset, $length);
+}
+
+$visitInfo[$tmp] = array(
+	'host'    => trim($tmp),
+	'date'    => time(),
+	'os'      => trim($os),
+	'browser' => trim($browser),
+	'screen'  => trim($screenstats),
+	'referer' => substr(trim($ref), 0, 255),
+);
+
+$data = "<?php
+
+/* e107 website system: Log info file: ".date("z:Y", time())." */
+
+";
+$data .= '$domainInfo = '.var_export($domainInfo, true).";\n\n";
+$data .= '$screenInfo = '.var_export($screenInfo, true).";\n\n";
+$data .= '$browserInfo = '.var_export($browserInfo, true).";\n\n";
+$data .= '$osInfo = '.var_export($osInfo, true).";\n\n";
+$data .= '$refInfo = '.var_export($refInfo, true).";\n\n";
+$data .= '$searchInfo = '.var_export($searchInfo, true).";\n\n";
+$data .= '$visitInfo = '.var_export($visitInfo, true).";\n\n";
+$data .= '?>';
+
+if ($handle = fopen($logIfile, 'w')) {
+	fwrite($handle, $data);
+}
+fclose($handle);
+
+function getBrowser($agent) {
+	$browsers = array(
+		"netcaptor"    => array('name' => 'Netcaptor',         'rule' => 'netcaptor[ /]([0-9.]{1,10})'),
+		"explorer"     => array('name' => 'Internet Explorer', 'rule' => '\(compatible; MSIE[ /]([0-9.]{1,10})'),
+		"firefox"      => array('name' => 'Firefox',           'rule' => 'Firefox/([0-9.+]{1,10})'),
+		"opera"        => array('name' => 'Opera',             'rule' => 'opera[ /]([0-9.]{1,10})'),
+		"aol"          => array('name' => 'AOL',               'rule' => 'aol[ /\-]([0-9.]{1,10})'),
+		"aol2"         => array('name' => 'AOL',               'rule' => 'aol[ /\-]?browser'),
+		"netscape"     => array('name' => 'Netscape',          'rule' => 'netscape[0-9]?/([0-9.]{1,10})'),
+		"netscape2"    => array('name' => 'Netscape',          'rule' => '^mozilla/([0-4]\.[0-9.]{1,10})'),
+		"mozilla"      => array('name' => 'Mozilla',           'rule' => '^mozilla/[5-9]\.[0-9.]{1,10}.+rv:([0-9a-z.+]{1,10})'),
+		"mozilla2"     => array('name' => 'Mozilla',           'rule' => '^mozilla/([5-9]\.[0-9a-z.]{1,10})'),
+		"mosaic"       => array('name' => 'Mosaic',            'rule' => 'mosaic[ /]([0-9.]{1,10})'),
+		"k-meleon"     => array('name' => 'K-Meleon',          'rule' => 'K-Meleon[ /]([0-9.]{1,10})'),
+		"konqueror"    => array('name' => 'Konqueror',         'rule' => 'konqueror/([0-9.]{1,10})'),
+		"avantbrowser" => array('name' => 'Avant Browser',     'rule' => 'Avant[ ]?Browser'),
+		"avantgo"      => array('name' => 'AvantGo',           'rule' => 'AvantGo[ /]([0-9.]{1,10})'),
+		"proxomitron"  => array('name' => 'Proxomitron',       'rule' => 'Space[ ]?Bison/[0-9.]{1,10}'),
+		"safari"       => array('name' => 'Safari',            'rule' => 'safari/([0-9.]{1,10})'),
+		"lynx"         => array('name' => 'Lynx',              'rule' => 'lynx/([0-9a-z.]{1,10})'),
+		"links"        => array('name' => 'Links',             'rule' => 'Links[ /]\(([0-9.]{1,10})'),
+		"galeon"       => array('name' => 'Galeon',            'rule' => 'galeon/([0-9.]{1,10})'),
+		"abrowse"      => array('name' => 'ABrowse',           'rule' => 'abrowse/([0-9.]{1,10})'),
+		"amaya"        => array('name' => 'Amaya',             'rule' => 'amaya/([0-9.]{1,10})'),
+		"ant"          => array('name' => 'ANTFresco',         'rule' => 'ANTFresco[ /]([0-9.]{1,10})'),
+		"aweb"         => array('name' => 'Aweb',              'rule' => 'Aweb[/ ]([0-9.]{1,10})'),
+		"beonex"       => array('name' => 'Beonex',            'rule' => 'beonex/([0-9.]{1,10})'),
+		"blazer"       => array('name' => 'Blazer',            'rule' => 'Blazer[/ ]([0-9.]{1,10})'),
+		"camino"       => array('name' => 'Camino',            'rule' => 'camino/([0-9.+]{1,10})'),
+		"chimera"      => array('name' => 'Chimera',           'rule' => 'chimera/([0-9.+]{1,10})'),
+		"columbus"     => array('name' => 'Columbus',          'rule' => 'columbus[ /]([0-9.]{1,10})'),
+		"crazybrowser" => array('name' => 'Crazy Browser',     'rule' => 'Crazy Browser[ /]([0-9.]{1,10})'),
+		"curl"         => array('name' => 'Curl',              'rule' => 'curl[ /]([0-9.]{1,10})'),
+		"deepnet"      => array('name' => 'Deepnet Explorer',  'rule' => 'Deepnet Explorer[/ ]([0-9.]{1,10})'),
+		"dillo"        => array('name' => 'Dillo',             'rule' => 'dillo/([0-9.]{1,10})'),
+		"doris"        => array('name' => 'Doris',             'rule' => 'Doris/([0-9.]{1,10})'),
+		"elinks"       => array('name' => 'ELinks',            'rule' => 'ELinks[ /][(]*([0-9.]{1,10})'),
+		"epiphany"     => array('name' => 'Epiphany',          'rule' => 'Epiphany/([0-9.]{1,10})'),
+		"firebird"     => array('name' => 'Firebird',          'rule' => 'Firebird/([0-9.+]{1,10})'),
+		"ibrowse"      => array('name' => 'IBrowse',           'rule' => 'ibrowse[ /]([0-9.]{1,10})'),
+		"icab"         => array('name' => 'iCab',              'rule' => 'icab[/ ]([0-9.]{1,10})'),
+		"ice"          => array('name' => 'ICEbrowser',        'rule' => 'ICEbrowser/v?([0-9._]{1,10})'),
+		"isilox"       => array('name' => 'iSiloX',            'rule' => 'iSilox/([0-9.]{1,10})'),
+		"lotus"        => array('name' => 'Lotus Notes',       'rule' => 'Lotus[ -]?Notes[ /]([0-9.]{1,10})'),
+		"lunascape"    => array('name' => 'Lunascape',         'rule' => 'Lunascape[ /]([0-9.]{1,10})'),
+		"maxthon"      => array('name' => 'Maxthon',           'rule' => ' Maxthon[);]'),
+		"mbrowser"     => array('name' => 'mBrowser',          'rule' => 'mBrowser[ /]([0-9.]{1,10})'),
+		"multibrowser" => array('name' => 'Multi-Browser',     'rule' => 'Multi-Browser[ /]([0-9.]{1,10})'),
+		"nautilus"     => array('name' => 'Nautilus',          'rule' => '(gnome[ -]?vfs|nautilus)/([0-9.]{1,10})'),
+		"netfront"     => array('name' => 'NetFront',          'rule' => 'NetFront[ /]([0-9.]{1,10})$'),
+		"netpositive"  => array('name' => 'NetPositive',       'rule' => 'netpositive[ /]([0-9.]{1,10})'),
+		"omniweb"      => array('name' => 'OmniWeb',           'rule' => 'omniweb/[ a-z]?([0-9.]{1,10})$'),
+		"oregano"      => array('name' => 'Oregano',           'rule' => 'Oregano[0-9]?[ /]([0-9.]{1,10})$'),
+		"phaseout"     => array('name' => 'PhaseOut',          'rule' => 'www.phaseout.net'),
+		"plink"        => array('name' => 'PLink',             'rule' => 'PLink[ /]([0-9a-z.]{1,10})'),
+		"phoenix"      => array('name' => 'Phoenix',           'rule' => 'Phoenix/([0-9.+]{1,10})'),
+		"proxomitron"  => array('name' => 'Proxomitron',       'rule' => 'Space[ ]?Bison/[0-9.]{1,10}'),
+		"shiira"       => array('name' => 'Shiira',            'rule' => 'Shiira/([0-9.]{1,10})'),
+		"sleipnir"     => array('name' => 'Sleipnir',          'rule' => 'Sleipnir( Version)?[ /]([0-9.]{1,10})'),
+		"slimbrowser"  => array('name' => 'SlimBrowser',       'rule' => 'Slimbrowser'),
+		"staroffice"   => array('name' => 'StarOffice',        'rule' => 'staroffice[ /]([0-9.]{1,10})'),
+		"sunrise"      => array('name' => 'Sunrise',           'rule' => 'SunriseBrowser[ /]([0-9.]{1,10})'),
+		"voyager"      => array('name' => 'Voyager',           'rule' => 'voyager[ /]([0-9.]{1,10})'),
+		"w3m"          => array('name' => 'w3m',               'rule' => 'w3m/([0-9.]{1,10})'),
+		"webtv"        => array('name' => 'Webtv',             'rule' => 'webtv[ /]([0-9.]{1,10})'),
+		"xiino"        => array('name' => 'Xiino',             'rule' => '^Xiino[ /]([0-9a-z.]{1,10})'),
+	);
+	$browser = "";
+	foreach($browsers as $info) {
+		if (preg_match("#".$info['rule']."#i", $agent, $results)) {
+			return ($info['name']." v".$results[1]);
+		}
+	}
+	return ("Unknown");
+}
+
+function getOs($agent) {
+	$os = array(
+		"windows2003" => array('name' => 'Windows 2003', 'rule' => 'wi(n|ndows)[ \-]?(2003|nt[ /]?5\.2)'),
+		"windowsxp"   => array('name' => 'Windows XP',   'rule' => 'Windows XP'),
+		"windowsxp2"  => array('name' => 'Windows XP',   'rule' => 'wi(n|ndows)[ \-]?nt[ /]?5\.1'),
+		"windows2k"   => array('name' => 'Windows 2000', 'rule' => 'wi(n|ndows)[ \-]?(2000|nt[ /]?5\.0)'),
+		"windows95"   => array('name' => 'Windows 95',   'rule' => 'wi(n|ndows)[ \-]?95'),
+		"windowsce"   => array('name' => 'Windows CE',   'rule' => 'wi(n|ndows)[ \-]?ce'),
+		"windowsme"   => array('name' => 'Windows ME',   'rule' => 'win 9x 4\.90'),
+		"windowsme2"  => array('name' => 'Windows ME',   'rule' => 'wi(n|ndows)[ \-]?me'),
+		"windowsnt"   => array('name' => 'Windows NT',   'rule' => 'wi(n|ndows)[ \-]?nt[ /]?([0-4][0-9.]{1,10})'),
+		"windowsnt2"  => array('name' => 'Windows NT',   'rule' => 'wi(n|ndows)[ \-]?nt'),
+		"windows98"   => array('name' => 'Windows 98',   'rule' => 'wi(n|ndows)[ \-]?98'),
+		"windows"     => array('name' => 'Windows',      'rule' => 'wi(n|n32|ndows)'),
+		"linux"       => array('name' => 'Linux',        'rule' => 'mdk for ([0-9.]{1,10})'),
+		"linux2"      => array('name' => 'Linux',        'rule' => 'linux[ /\-]([a-z0-9.]{1,10})'),
+		"linux3"      => array('name' => 'Linux',        'rule' => 'linux'),
+		"macosx"      => array('name' => 'MacOS X',      'rule' => 'Mac[ ]?OS[ ]?X'),
+		"macppc"      => array('name' => 'MacOS PPC',    'rule' => 'Mac(_Power|intosh.+P)PC'),
+		"mac"         => array('name' => 'MacOS',        'rule' => 'mac[^hk]'),
+		"amiga"       => array('name' => 'Amiga',        'rule' => 'Amiga[ ]?OS[ /]([0-9.]{1,10})'),
+		"beos"        => array('name' => 'BeOS',         'rule' => 'beos[ a-z]*([0-9.]{1,10})'),
+		"freebsd"     => array('name' => 'FreeBSD',      'rule' => 'free[ \-]?bsd[ /]([a-z0-9.]{1,10})'),
+		"freebsd2"    => array('name' => 'FreeBSD',      'rule' => 'free[ \-]?bsd'),
+		"irix"        => array('name' => 'Irix',         'rule' => 'irix[0-9]*[ /]([0-9.]{1,10})'),
+		"netbsd"      => array('name' => 'NetBSD',       'rule' => 'net[ \-]?bsd[ /]([a-z0-9.]{1,10})'),
+		"netbsd2"     => array('name' => 'NetBSD',       'rule' => 'net[ \-]?bsd'),
+		"os2"         => array('name' => 'OS/2 Warp',    'rule' => 'warp[ /]?([0-9.]{1,10})'),
+		"os22"        => array('name' => 'OS/2 Warp',    'rule' => 'os[ /]?2'),
+		"openbsd"     => array('name' => 'OpenBSD',      'rule' => 'open[ \-]?bsd[ /]([a-z0-9.]{1,10})'),
+		"openbsd2"    => array('name' => 'OpenBSD',      'rule' => 'open[ \-]?bsd'),
+		"palm"        => array('name' => 'PalmOS',       'rule' => 'Palm[ \-]?(Source|OS)[ /]?([0-9.]{1,10})'),
+		"palm2"       => array('name' => 'PalmOS',       'rule' => 'Palm[ \-]?(Source|OS)')
+	);
+	foreach($os as $key => $info) {
+		if (preg_match("#".$info['rule']."#i", $agent, $results)) {
+			if(strstr($key, "win")) {
+				return ($info['name']);
+			} else {
+				return ($info['name']." ".$results[1]);
+			}
+		}
+	}
+	return ("Unspecified");
+}
+
+?>
diff -ruN 6171/e107_plugins/log/log.php 75/e107_plugins/log/log.php
--- 6171/e107_plugins/log/log.php	2004-06-20 21:56:44.000000000 -0500
+++ 75/e107_plugins/log/log.php	2005-12-14 13:28:44.000000000 -0600
@@ -1,476 +1,122 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/plugins/log2.php
-|
-|	Steve Dunstan 2001-2002
-|	http://jalist.com
-|	stevedunstan@jalist.com
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-$colour = strip_tags($_REQUEST['color']);
-$res = strip_tags($_REQUEST['res']);
-$self = strip_tags($_REQUEST['eself']);
-$ref = strip_tags($_REQUEST['referer']);
-
-$self = substr(strrchr(eregi_replace("\?.*", "", $self), "/"), 1);
-if($self == "/"){ $self = "index.php"; }
-$screenstats = $res." @ ".$colour;
-@include("../../e107_config.php");
-define("MPREFIX", $mySQLprefix);
-if($HANDLERS_DIRECTORY){
-	@require_once("../../{$HANDLERS_DIRECTORY}mysql_class.php");
-} else {
-	@require_once("../../e107_handlers/mysql_class.php");
-}
-$sql = new db;
-$sql -> db_SetErrorReporting(FALSE);
-$sql -> db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
-$sql -> db_Select("core", "*", "e107_name='pref' ");
-$row = $sql -> db_Fetch();
-$tmp = stripslashes($row['e107_value']);
-$pref=unserialize($tmp);
-
-$siteurl = $pref['siteurl'];
-
-if($pref['log_activate']){
-
-	$agent = $_SERVER['HTTP_USER_AGENT'];
-	$browser = getbrowser();
-	$os = getos();
-	$country = getcountry();
-	$ip = getip();
-	$gip = $ip;
-
-	$date = date("Y-m-d");
-
-	if(!$sql -> db_Select("stat_counter", "*", "counter_url='".$self."' AND counter_date='$date' ") && $self){
-		// page not parsed before - create new entry ...
-		$ip .= ".";
-		$sql -> db_Insert("stat_counter", "CURRENT_DATE, '$self', '0', '0', '$ip' ");
-		$yesterday = date("Y-m-d", (time()-86400));
-		$sql -> db_Update("stat_counter", "counter_ip='' WHERE counter_date='$yesterday' ");	// clear ip stats
-	} else {
-		$row = $sql-> db_Fetch();
-		extract($row);
-		$sql -> db_Update("stat_counter", "counter_total=counter_total+1 WHERE counter_url='".$self."' AND counter_date='$date' ");
-	}
-	// update tables
-
-	if(!ereg($ip, $counter_ip) && (!eregi("admin", $self))){
-		// ip is not stored and not an admin page so unique visit - update counters
-
-		$iplist = $counter_ip."-".$ip.".";
-		$sql -> db_Update("stat_counter", "counter_ip='$iplist', counter_unique=counter_unique+1, counter_total=counter_total+1 WHERE counter_url='".$self."' ");
-		if($browser != ""){
-			if(!$sql -> db_Update("stat_info", "info_count=info_count+1 WHERE info_name='$browser' ")){
-				$sql -> db_Insert("stat_info", " '$browser', '1', '1' ");
-			}
-			if($os != ""){
-				if(!$sql -> db_Update("stat_info", "info_count=info_count+1 WHERE info_name='$os' ")){
-					$sql -> db_Insert("stat_info", " '$os', '1', '2' ");
-				}
-			}
-			if($country != ""){
-				if(!$sql -> db_Update("stat_info", "info_count=info_count+1 WHERE info_name='$country' ")){
-					$sql -> db_Insert("stat_info", " '$country', '1', '4' ");
-				}
-			}
-			if($screenstats != ""){
-				if(trim(chop($screenstats)) != "@" && trim(chop($screenstats)) != "\" res \" @ \" colord \""){
-					if(!$sql -> db_Update("stat_info", "info_count=info_count+1 WHERE info_name='$screenstats' ")){
-						$sql -> db_Insert("stat_info", " '$screenstats', '1', '5' ");
-					}
-				}
-			}
-			$referer = $ref;
-			if($referer != "" && $ref != "\" ref \"" && !eregi("blocked", $referer)){
-				$siteurl = parse_url($pref['siteurl']);
-				if(!strstr($referer, $siteurl['host']) && !strstr($referer, "localhost")){
-					if($pref['log_refertype'] == 0){
-						// log domain only
-						$rl = parse_url($referer);
-						$ref =  eregi_replace("www.", "", $rl['host']);
-						if(!$sql -> db_Update("stat_info", "info_count=info_count+1 WHERE info_name='$ref' ")){
-							$sql -> db_Insert("stat_info", " '$ref', '1', '6' ");
-						}
-					} else {
-						// Log whole URL
-						if(!$sql -> db_Update("stat_info", "info_count=info_count+1 WHERE info_name='$referer' ")){
-							$sql -> db_Insert("stat_info", " '$referer', '1', '6' ");
-						}
-					}
-				}
-			}
-			// last unique visitors -------------------------------------------------------------------------------------------------------------------------------------------------------
-			if($sql -> db_Count("stat_last") >= $pref['log_lvcount']){
-				$sql -> db_Select("stat_last", "*",  "ORDER BY stat_last_date ASC", "no_where");
-				$row = $sql -> db_Fetch();
-				$sql -> db_Delete("stat_last", "stat_last_date='".$row['stat_last_date']."' ");
-			}
-
-			$sip = substr($ip, 0, (strlen($ip)-2))."x";
-			if(!$country){
-				$country = "(unknown)";
-			}
-
-			$con = new convert;
-			$datestamp = $con -> convert_date(time(), "long");
-			$laststr = "IP: ".$sip." using ".$browser." under ".$os ." at ".$res." x ".$colour." from ".$country.".";
-
-			if(!$sql -> db_Select("stat_last", "*", "stat_last_info='$laststr' ")){
-				$sql -> db_Insert("stat_last", " '".time()."', '$laststr' ");
-			}
-		}
-	}
-}
-
-// end last visitors -----------------------------------------------------------------------------------------------------------------------------------------------------------
-header("Content-type: text/css");
-echo ".DUMMY {color: green;}";
-// functions -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-function getbrowser(){
-	$agent = $_SERVER['HTTP_USER_AGENT'];
-	if(eregi("Netcaptor", $agent)){
- 	$browser = "Netcaptor";
-} elseif(eregi("(opera) ([0-9]{1,2}.[0-9]{1,3}){0,1}", $agent, $ver) || eregi("(opera/)([0-9]{1,2}.[0-9]{1,3}){0,1}", $agent, $ver)){ $browser = "Opera $ver[2]";
-} elseif(eregi("(konqueror)/([0-9]{1,2}.[0-9]{1,3})", $agent, $ver)){ $browser = "Konqueror $ver[2]";
-} elseif(eregi("(lynx)/([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})", $agent, $ver)){ $browser = "Lynx $ver[2]";
-} elseif(eregi("(msie) ([0-9]{1,2}.[0-9]{1,3})", $agent, $ver)){ $browser = "Internet Explorer $ver[2]";
-} elseif(eregi("Links", $agent)){ $browser = "Lynx";
-} elseif(eregi("(Firefox/)([0-9]{1,2}.[0-9]{1,3}){0,1}", $agent, $ver)){ $browser = "Firefox $ver[2]";
-} elseif(eregi("(Firebird/)([0-9]{1,2}.[0-9]{1,3}){0,1}", $agent, $ver)){ $browser = "Firebird $ver[2]";
-} elseif(eregi("Mozilla/5",$agent)){$browser = "Netscape 5";
-} elseif(eregi("Gecko", $agent)){ $browser = "Mozilla";
-} elseif(eregi("Safari",$agent)){ $browser = "OS-X Safari";
-} elseif(eregi("(netscape6)/(6.[0-9]{1,3})", $agent, $ver)){ $browser = "Netscape $ver[2]";
-} elseif(eregi("(Mozilla)/([0-9]{1,2}.[0-9]{1,3})", $agent, $ver)){ $browser = "Netscape $ver[2]";
-} elseif(eregi("Galeon", $agent)){ $browser = "Galeon";
-} elseif(eregi("(lynx)/([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})", $agent, $ver) ){$browser = "Lynx $ver[2]";
-} elseif(eregi("Avant Browser", $agent)){ $browser = "Avant";
-} elseif(eregi("(omniweb/)([0-9]{1,2}.[0-9]{1,3})", $agent, $ver) ){$browser = "OmniWeb $ver[2]";
-} elseif(eregi("ZyBorg|WebCrawler|Slurp|Googlebot|MuscatFerret|ia_archiver", $agent)){ $browser = "Web indexing robot";
-} elseif(eregi("(webtv/)([0-9]{1,2}.[0-9]{1,3})", $agent, $ver) ){$browser = "WebTV $ver[2]";
-} else {$browser = "Unknown";}
-return $browser;
-}
-
-function getos(){
-	$agent = $_SERVER['HTTP_USER_AGENT'];
-	if(strstr($agent,'Win')){
-		if(strstr($agent,'NT 5.0') || strstr($agent,'NT5.0') || strstr($agent,'Windows 2000')){ $os = "Windows 2000";
-	}else if(strstr($agent,'NT 5.1') || strstr($agent,'NT5.1') || strstr($agent,'Windows XP')){$os = "Windows XP";
-}else if(strstr($agent,'Win98') || strstr($agent,'Windows 98')){$os="Windows 98";
-}else if(strstr($agent,'NT')) {$os='Windows NT';
-}else if(strstr($agent,'Win95') || strstr($agent,'Windows 95')){$os='Windows 95';
-}else if(strstr($agent,'Win 9x')) {$os='Windows 95';
-}else if(strstr($agent,'WinME') || strstr($agent,'Windows ME')){$os='Windows ME';
-}else{$os='Windows (version unspecified)';}
-
-}else if (strstr($agent,'Mac')){$os='Apple Macintosh';
-}else if (strstr($agent,'Linux')){$os='Linux';
-}else if (strstr($agent,'BeOS')){$os='BeOS';
-}else if (strstr($agent,'Unix') || strstr($agent, "HP-ux") || strstr($agent, "X11")){$os='Unix';
-}else if (strstr($agent,'SunOS')){$os='SunOS';
-}else if (strstr($agent,'FreeBSD')){$os='FreeBSD';
-}else if (strstr($agent,'OpenBSD')){$os='OpenBSD';
-}else if (strstr($agent,'IRIX')){$os='IRIX';
-}else if (strstr($agent,'spider') || strstr($agent,'bot') || strstr($agent,'http') || strstr($agent,'Scooter') || strstr($agent,'WebCopier')){$os='Spiders';
-}else{$os='Unspecified';
-}
-return $os;
-}
-
-function getcountry(){
-	if($host = gethostbyaddr(getenv(REMOTE_ADDR))){
-		$dom = strtolower(substr($host, strrpos($host, ".")+1));
-
-		$country["arpa"]="ARPANet";
-		$country["com"]="Commercial Users";
-		$country["edu"]="Education";
-		$country["gov"]="Government";
-		$country["int"]="Oganization established by an International Treaty";
-		$country["mil"]="Military";
-		$country["net"]="Network";
-		$country["org"]="Organization";
-		$country["ad"]="Andorra";
-		$country["ae"]="United Arab Emirates";
-		$country["af"]="Afghanistan";
-		$country["ag"]="Antigua & Barbuda";
-		$country["ai"]="Anguilla";
-		$country["al"]="Albania";
-		$country["am"]="Armenia";
-		$country["an"]="Netherland Antilles";
-		$country["ao"]="Angola";
-		$country["aq"]="Antarctica";
-		$country["ar"]="Argentina";
-		$country["as"]="American Samoa";
-		$country["at"]="Austria";
-		$country["au"]="Australia";
-		$country["aw"]="Aruba";
-		$country["az"]="Azerbaijan";
-		$country["ba"]="Bosnia-Herzegovina";
-		$country["bb"]="Barbados";
-		$country["bd"]="Bangladesh";
-		$country["be"]="Belgium";
-		$country["bf"]="Burkina Faso";
-		$country["bg"]="Bulgaria";
-		$country["bh"]="Bahrain";
-		$country["bi"]="Burundi";
-		$country["bj"]="Benin";
-		$country["bm"]="Bermuda";
-		$country["bn"]="Brunei Darussalam";
-		$country["bo"]="Bolivia";
-		$country["br"]="Brasil";
-		$country["bs"]="Bahamas";
-		$country["bt"]="Bhutan";
-		$country["bv"]="Bouvet Island";
-		$country["bw"]="Botswana";
-		$country["by"]="Belarus";
-		$country["bz"]="Belize";
-		$country["ca"]="Canada";
-		$country["cc"]="Cocos (Keeling) Islands";
-		$country["cf"]="Central African Republic";
-		$country["cg"]="Congo";
-		$country["ch"]="Switzerland";
-		$country["ci"]="Ivory Coast";
-		$country["ck"]="Cook Islands";
-		$country["cl"]="Chile";
-		$country["cm"]="Cameroon";
-		$country["cn"]="China";
-		$country["co"]="Colombia";
-		$country["cr"]="Costa Rica";
-		$country["cs"]="Czechoslovakia";
-		$country["cu"]="Cuba";
-		$country["cv"]="Cape Verde";
-		$country["cx"]="Christmas Island";
-		$country["cy"]="Cyprus";
-		$country["cz"]="Czech Republic";
-		$country["de"]="Germany";
-		$country["dj"]="Djibouti";
-		$country["dk"]="Denmark";
-		$country["dm"]="Dominica";
-		$country["do"]="Dominican Republic";
-		$country["dz"]="Algeria";
-		$country["ec"]="Ecuador";
-		$country["ee"]="Estonia";
-		$country["eg"]="Egypt";
-		$country["eh"]="Western Sahara";
-		$country["er"]="Eritrea";
-		$country["es"]="Spain";
-		$country["et"]="Ethiopia";
-		$country["fi"]="Finland";
-		$country["fj"]="Fiji";
-		$country["fk"]="Falkland Islands (Malvibas)";
-		$country["fm"]="Micronesia";
-		$country["fo"]="Faroe Islands";
-		$country["fr"]="France";
-		$country["fx"]="France (European Territory)";
-		$country["ga"]="Gabon";
-		$country["gb"]="Great Britain";
-		$country["gd"]="Grenada";
-		$country["ge"]="Georgia";
-		$country["gf"]="Guyana (French)";
-		$country["gh"]="Ghana";
-		$country["gi"]="Gibralta";
-		$country["gl"]="Greenland";
-		$country["gm"]="Gambia";
-		$country["gn"]="Guinea";
-		$country["gp"]="Guadeloupe (French)";
-		$country["gq"]="Equatorial Guinea";
-		$country["gr"]="Greece";
-		$country["gs"]="South Georgia & South Sandwich Islands";
-		$country["gt"]="Guatemala";
-		$country["gu"]="Guam (US)";
-		$country["gw"]="Guinea Bissau";
-		$country["gy"]="Guyana";
-		$country["hk"]="Hong Kong";
-		$country["hm"]="Heard & McDonald Islands";
-		$country["hn"]="Honduras";
-		$country["hr"]="Croatia";
-		$country["ht"]="Haiti";
-		$country["hu"]="Hungary";
-		$country["id"]="Indonesia";
-		$country["ie"]="Ireland";
-		$country["il"]="Israel";
-		$country["in"]="India";
-		$country["io"]="British Indian Ocean Territories";
-		$country["iq"]="Iraq";
-		$country["ir"]="Iran";
-		$country["is"]="Iceland";
-		$country["it"]="Italy";
-		$country["jm"]="Jamaica";
-		$country["jo"]="Jordan";
-		$country["jp"]="Japan";
-		$country["ke"]="Kenya";
-		$country["kg"]="Kyrgyz Republic";
-		$country["kh"]="Cambodia";
-		$country["ki"]="Kiribati";
-		$country["km"]="Comoros";
-		$country["kn"]="Saint Kitts Nevis Anguilla";
-		$country["kp"]="Korea (North)";
-		$country["kr"]="Korea (South)";
-		$country["kw"]="Kuwait";
-		$country["ky"]="Cayman Islands";
-		$country["kz"]="Kazachstan";
-		$country["la"]="Laos";
-		$country["lb"]="Lebanon";
-		$country["lc"]="Saint Lucia";
-		$country["li"]="Liechtenstein";
-		$country["lk"]="Sri Lanka";
-		$country["lr"]="Liberia";
-		$country["ls"]="Lesotho";
-		$country["lt"]="Lithuania";
-		$country["lu"]="Luxembourg";
-		$country["lv"]="Latvia";
-		$country["ly"]="Libya";
-		$country["ma"]="Morocco";
-		$country["mc"]="Monaco";
-		$country["md"]="Moldova";
-		$country["mg"]="Madagascar";
-		$country["mh"]="Marshall Islands";
-		$country["mk"]="Macedonia";
-		$country["ml"]="Mali";
-		$country["mm"]="Myanmar";
-		$country["mn"]="Mongolia";
-		$country["mo"]="Macau";
-		$country["mp"]="Northern Mariana Islands";
-		$country["mq"]="Martinique (French)";
-		$country["mr"]="Mauretania";
-		$country["ms"]="Montserrat";
-		$country["mt"]="Malta";
-		$country["mu"]="Mauritius";
-		$country["mv"]="Maldives";
-		$country["mw"]="Malawi";
-		$country["mx"]="Mexico";
-		$country["my"]="Malaysia";
-		$country["mz"]="Mozambique";
-		$country["na"]="Namibia";
-		$country["nc"]="New Caledonia (French)";
-		$country["ne"]="Niger";
-		$country["nf"]="Norfolk Island";
-		$country["ng"]="Nigeria";
-		$country["ni"]="Nicaragua";
-		$country["nl"]="Netherlands";
-		$country["no"]="Norway";
-		$country["np"]="Nepal";
-		$country["nr"]="Nauru";
-		$country["nt"]="Saudiarab. Irak)";
-		$country["nu"]="Niue";
-		$country["nz"]="New Zealand";
-		$country["om"]="Oman";
-		$country["pa"]="Panama";
-		$country["pe"]="Peru";
-		$country["pf"]="Polynesia (French)";
-		$country["pg"]="Papua New Guinea";
-		$country["ph"]="Philippines";
-		$country["pk"]="Pakistan";
-		$country["pl"]="Poland";
-		$country["pm"]="Saint Pierre & Miquelon";
-		$country["pn"]="Pitcairn";
-		$country["pr"]="Puerto Rico (US)";
-		$country["pt"]="Portugal";
-		$country["pw"]="Palau";
-		$country["py"]="Paraguay";
-		$country["qa"]="Qatar";
-		$country["re"]="Reunion (French)";
-		$country["ro"]="Romania";
-		$country["ru"]="Russian Federation";
-		$country["rw"]="Rwanda";
-		$country["sa"]="Saudi Arabia";
-		$country["sb"]="Salomon Islands";
-		$country["sc"]="Seychelles";
-		$country["sd"]="Sudan";
-		$country["se"]="Sweden";
-		$country["sg"]="Singapore";
-		$country["sh"]="Saint Helena";
-		$country["si"]="Slovenia";
-		$country["sj"]="Svalbard & Jan Mayen";
-		$country["sk"]="Slovakia";
-		$country["sl"]="Sierra Leone";
-		$country["sm"]="San Marino";
-		$country["sn"]="Senegal";
-		$country["so"]="Somalia";
-		$country["sr"]="Suriname";
-		$country["st"]="Sao Tome & Principe";
-		$country["su"]="Soviet Union";
-		$country["sv"]="El Salvador";
-		$country["sy"]="Syria";
-		$country["sz"]="Swaziland";
-		$country["tc"]="Turks & Caicos Islands";
-		$country["td"]="Chad";
-		$country["tf"]="French Southern Territories";
-		$country["tg"]="Togo";
-		$country["th"]="Thailand";
-		$country["tj"]="Tadjikistan";
-		$country["tk"]="Tokelau";
-		$country["tm"]="Turkmenistan";
-		$country["tn"]="Tunisia";
-		$country["to"]="Tonga";
-		$country["tp"]="East Timor";
-		$country["tr"]="Turkey";
-		$country["tt"]="Trinidad & Tobago";
-		$country["tv"]="Tuvalu";
-		$country["tw"]="Taiwan";
-		$country["tz"]="Tanzania";
-		$country["ua"]="Ukraine";
-		$country["ug"]="Uganda";
-		$country["uk"]="United Kingdom";
-		$country["um"]="US Minor outlying Islands";
-		$country["us"]="United States";
-		$country["uy"]="Uruguay";
-		$country["uz"]="Uzbekistan";
-		$country["va"]="Vatican City State";
-		$country["vc"]="St Vincent & Grenadines";
-		$country["ve"]="Venezuela";
-		$country["vg"]="Virgin Islands (British)";
-		$country["vi"]="Virgin Islands (US)";
-		$country["vn"]="Vietnam";
-		$country["vu"]="Vanuatu";
-		$country["wf"]="Wallis & Futuna Islands";
-		$country["ws"]="Samoa";
-		$country["ye"]="Yemen";
-		$country["yt"]="Mayotte";
-		$country["yu"]="Yugoslavia";
-		$country["za"]="South Africa";
-		$country["zm"]="Zambia";
-		$country["zr"]="Zaire";
-		$country["zw"]="Zimbabwe";
-		$scountry = $country[$dom];
-	}else{
-	$scountry = "";
-}
-return $scountry;
-}
-
-function getip(){
-	if(getenv('HTTP_X_FORWARDED_FOR')){
-		$ip = $_SERVER['REMOTE_ADDR'];
-		if(preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip3)){
-			$ip2 = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10..*/', '/^224..*/', '/^240..*/');
-			$ip = preg_replace($ip2, $ip, $ip3[1]);
-		}
-	}else{
-	$ip = $_SERVER['REMOTE_ADDR'];
-}
-if($ip == ""){ $ip = "x.x.x.x"; }
-return $ip;
-}
-class convert{
-function convert_date($datestamp, $mode="long"){
-	global $pref;
-	$datestamp += (TIMEOFFSET*3600);
-	if($mode == "long"){
-		return strftime($pref['longdate'], $datestamp);
-	}else if($mode == "short"){
-		return strftime($pref['shortdate'], $datestamp);
-	}else{
-	return strftime($pref['forumdate'], $datestamp);
-}
-}
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|    	Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/log.php,v $
+|     $Revision: 1.24 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("log_INIT", TRUE);
+$colour = strip_tags((isset($_REQUEST['color']) ? $_REQUEST['color'] : ''));
+$res = strip_tags((isset($_REQUEST['res']) ? $_REQUEST['res'] : ''));
+$self = strip_tags((isset($_REQUEST['eself']) ? $_REQUEST['eself'] : ''));
+$ref = addslashes(strip_tags((isset($_REQUEST['referer']) ? $_REQUEST['referer'] : '')));
+$date = date("z.Y", time());
+
+if(strstr($ref, "admin")) {
+	$ref = FALSE;
+}
+
+$screenstats = $res."@".$colour;
+$agent = $_SERVER['HTTP_USER_AGENT'];
+$ip = getip();
+
+$oldref = $ref; // backup for search string being stripped of for referer
+if($ref && !strstr($ref, $_SERVER['HTTP_HOST'])) {
+	if(preg_match("#http://(.*?)($|/)#is", $ref, $match)) {
+		$ref = $match[0];
+	}
+}
+
+$infodata = time().chr(1).$ip.chr(1).$agent.chr(1).$colour.chr(1).$res.chr(1).$self.chr(1).$ref."\n";
+
+$pageDisallow = "cache|file|eself|admin";
+$tagRemove = "(\\\)|(\s)|(\')|(\")|(eself)|(&nbsp;)|(\.php)|(\.html)";
+$tagRemove2 = "(\\\)|(\s)|(\')|(\")|(eself)|(&nbsp;)";
+
+preg_match("#/(.*?)(\?|$)#si", $self, $match);
+$match[1] = isset($match[1]) ? $match[1] : '';
+$pageName = substr($match[1], (strrpos($match[1], "/")+1));
+$PN = $pageName;
+$pageName = preg_replace("/".$tagRemove."/si", "", $pageName);
+if($pageName == "") $pageName = "index";
+if(preg_match("/".$pageDisallow."/i", $pageName)) return;
+
+
+$logPfile = "logs/logp_".$date.".php";
+require_once($logPfile);
+
+$flag = FALSE;
+if(array_key_exists($pageName, $pageInfo)) {
+	$pageInfo[$pageName]['ttl'] ++;
+} else {
+	$url = preg_replace("/".$tagRemove2."/si", "", $self);
+	if(preg_match("/".$pageDisallow."/i", $url)) return;
+	$pageInfo[$pageName] = array('url' => $url, 'ttl' => 1, 'unq' => 1);
+	$flag = TRUE;
+}
+
+if(!strstr($ipAddresses, $ip)) {
+	/* unique visit */
+	if(!$flag) {
+		$pageInfo[$pageName]['unq'] ++;
+	}
+	$siteUnique ++;
+	$ipAddresses .= $ip.".";
+	require_once("loginfo.php");
+}
+
+$siteTotal ++;
+$info_data = var_export($pageInfo, true);
+$date_stamp = date("z:Y", time());
+
+$data = "<?php
+
+/* e107 website system: Log file: {$date_stamp} */
+
+\$ipAddresses = '{$ipAddresses}';
+\$siteTotal = '{$siteTotal}';
+\$siteUnique = '{$siteUnique}';
+
+\$pageInfo = {$info_data};
+
+?>";
+
+if ($handle = fopen($logPfile, 'w')) {
+	fwrite($handle, $data);
+}
+fclose($handle);
+
+function getip($mode=TRUE) {
+	if (getenv('HTTP_X_FORWARDED_FOR')) {
+		$ip = $_SERVER['REMOTE_ADDR'];
+		if (preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip3)) {
+			$ip2 = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10..*/', '/^224..*/', '/^240..*/');
+			$ip = preg_replace($ip2, $ip, $ip3[1]);
+		}
+	} else {
+		$ip = $_SERVER['REMOTE_ADDR'];
+	}
+	if ($ip == "") {
+		$ip = "x.x.x.x";
+	}
+	if($mode) {
+		$ipa = explode(".", $ip);
+		return sprintf('%02x%02x%02x%02x', $ipa[0], $ipa[1], $ipa[2], $ipa[3]);
+	} else {
+		return $ip;
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/log/log_sql.php 75/e107_plugins/log/log_sql.php
--- 6171/e107_plugins/log/log_sql.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/log_sql.php	2005-06-08 22:43:19.000000000 -0500
@@ -0,0 +1,7 @@
+CREATE TABLE logstats (
+  log_uniqueid int(11) NOT NULL auto_increment,
+  log_id varchar(50) NOT NULL default '',
+  log_data longtext NOT NULL,
+  PRIMARY KEY  (log_uniqueid),
+  UNIQUE KEY log_id (log_id)
+) TYPE=MyISAM;
\ No newline at end of file
diff -ruN 6171/e107_plugins/log/log_update_check.php 75/e107_plugins/log/log_update_check.php
--- 6171/e107_plugins/log/log_update_check.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/log_update_check.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,39 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/log_update_check.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+$dbupdatep['log_07'] =  LAN_UPDATE_8." .617 statistics ".LAN_UPDATE_9." .7 statistics";
+function update_log_07($type) {
+	global $sql, $mySQLdefaultdb;
+	if ($type == 'do') {
+			include_once(e_PLUGIN.'log/log_update.php');
+	} else {
+		if ($sql -> db_Query("SHOW COLUMNS FROM ".MPREFIX."stat_info") && $sql -> db_Select("plugin", "*", "plugin_path = 'log' AND plugin_installflag='1'")) {
+			 if ($sql -> db_Count('stat_info','(*)',"WHERE info_type='99'") < 7) {
+				return FALSE;
+			} else {
+				return TRUE;
+			}
+		} else {
+			return TRUE;
+		}
+	}
+}
+
+?>		
\ No newline at end of file
diff -ruN 6171/e107_plugins/log/log_update.php 75/e107_plugins/log/log_update.php
--- 6171/e107_plugins/log/log_update.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/log_update.php	2006-01-12 06:42:36.000000000 -0600
@@ -0,0 +1,330 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/log_update.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2006/01/12 12:42:36 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+set_time_limit(300);
+
+$us = new updateStats;
+
+for ($i = 1; $i <= 7; $i++) {
+	if (!$sql -> db_Select("generic", "*", "gen_type='stat_update' && gen_intdata=".$i)) {
+		if (!$sql -> db_Select("stat_info", "*", "info_type='99' && info_count='".$i."'")) {
+			$func = "stage".$i;
+			$us -> $func();
+			$sql -> db_Insert("stat_info", "'Stats Update Stage ".$i." Complete', '".$i."', '99'");
+		}
+	} else {
+		$sql -> db_Insert("stat_info", "'Stats Update Stage ".$i." Complete', '".$i."', '99'");
+		$sql -> db_Delete("generic", "gen_type='stat_update' && gen_intdata=".$i);
+	}
+}
+
+if (!$sql -> db_Select("logstats", "*", "log_id='statQuery'")) {
+	$sql -> db_Insert("logstats", "0, 'statQuery', ''");
+}
+
+class updateStats {
+
+	function stage1() {
+		global $sql;
+		// Converting stat_counter entries
+	
+		$stattotal = $sql -> db_Select("logstats", "*", "log_id='statTotal' ");
+		$statunique = $sql -> db_Select("logstats", "*", "log_id='statUnique' ");
+	
+		if($sql -> db_Select("logstats", "*", "log_id='pageTotal' "))
+		{
+			$row = $sql -> db_Fetch();
+			$pageTotal = unserialize($row['log_data']);
+		}
+		else
+		{
+			$pageTotal = array();
+		}
+	
+		if(!$sql -> db_Select("stat_counter", "*", "ORDER BY counter_date, counter_url DESC", "nowhere"))
+		{
+			return;
+		}
+	
+		$monthArray = array();
+		$totalArray = array();
+		while($stat = $sql -> db_Fetch())
+		{
+			extract($stat);
+	
+			/* collate pageTotal */
+			$pagename = str_replace(".php", "", $counter_url);
+			$totalArray[$pagename]['ttlv'] += $counter_total;
+			$totalArray[$pagename]['unqv'] += $counter_unique;
+			$stattotal += $counter_total;
+			$statunique += $counter_unique;
+				
+			/* done */
+	
+			/* collate monthly totals */
+			list($year, $month, $day) = explode("-", $counter_date);
+			$monthstore = $year."-".$month;
+			if(strstr($pagename, "forum"))
+			{
+				$pagename = "forum";
+			}
+	
+			$monthArray[$monthstore]['TOTAL']['ttlv'] += $counter_total;
+			$monthArray[$monthstore]['TOTAL']['unqv'] += $counter_unique;
+			$monthArray[$monthstore][$counter_url]['ttlv'] += $counter_total;
+			$monthArray[$monthstore][$counter_url]['unqv'] += $counter_unique;
+
+			$dailyArray[$counter_date][$pagename] = array('url' => $counter_url, 'ttl' => $counter_total, 'unq' => $counter_unique);
+			$dailyTotal[$counter_date]['ttl'] += $counter_total;
+			$dailyTotal[$counter_date]['unq'] += $counter_unique;
+		}
+			
+		if(!$sql -> db_Update("logstats", "log_data='$stattotal' WHERE log_id='statTotal' "))
+		{
+			$sql -> db_Insert("logstats", "0, 'statTotal', '$stattotal' ");
+		}
+		if(!$sql -> db_Update("logstats", "log_data='$statunique' WHERE log_id='statUnique' "))
+		{
+			$sql -> db_Insert("logstats", "0, 'statUnique', '$statunique' ");
+		}
+	
+		$totalarray = serialize($totalArray);
+	
+		if(!$sql -> db_Update("logstats", "log_data='$totalarray' WHERE log_id='pageTotal' "))
+		{
+			$sql -> db_Insert("logstats", "0, 'pageTotal', '$totalarray' ");
+		}
+	
+		foreach($monthArray as $key => $value)
+		{
+			$sql -> db_Insert("logstats", "0, '$key', '".serialize($value)."'");
+		}
+	
+		foreach($dailyArray as $key => $value)
+		{
+			$data = "";
+			foreach($value as $value2)
+			{
+				$data .= $value2['url']."|".$value2['ttl']."|".$value2['unq'].chr(1);
+			}
+			$data = $dailyTotal[$key]['ttl'].chr(1).$dailyTotal[$key]['unq'].chr(1) . $data;
+			$sql -> db_Insert("logstats", "0, '$key', '$data'");
+		}
+	}
+
+/* ----------------------------------------------------------------------------------------------------------------------- */
+
+	function stage2()
+	{
+		// Converting browser entries
+		global $sql;
+
+		if($sql -> db_Select("logstats", "*", "log_id='statBrowser' "))
+		{
+			$row = $sql -> db_Fetch();
+			$browserTotal = unserialize($row['log_data']);
+		}
+		else
+		{
+			$browserTotal = array();
+		}
+
+		if(!$sql -> db_Select("stat_info", "*", "info_type='1'"))
+		{
+			return;
+		}
+	
+		while($stat = $sql -> db_Fetch())
+		{
+			extract($stat);
+			$browserTotal[$info_name] += $info_count;
+		}
+
+		$data = serialize($browserTotal);
+
+		if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statBrowser' "))
+		{
+			$sql -> db_Insert("logstats", "0, 'statBrowser', '$data' ");
+		}
+	}
+
+/* ----------------------------------------------------------------------------------------------------------------------- */
+
+	function stage3()
+	{
+		// Operating system entries
+		global $sql;
+		if($sql -> db_Select("logstats", "*", "log_id='statOs' "))
+		{
+			$row = $sql -> db_Fetch();
+			$osTotal = unserialize($row['log_data']);
+		}
+		else
+		{
+			$osTotal = array();
+		}
+		if(!$sql -> db_Select("stat_info", "*", "info_type='2'"))
+		{
+			return;
+		}
+		while($stat = $sql -> db_Fetch())
+		{
+			extract($stat);
+			$osTotal[$info_name] += $info_count;
+		}
+		$data = serialize($osTotal);
+		if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statOs' "))
+		{
+			$sql -> db_Insert("logstats", "0, 'statOs', '$data' ");
+		}
+	}
+
+/* ----------------------------------------------------------------------------------------------------------------------- */
+
+	function stage4()
+	{
+		// Domain entries to convert 
+		global $sql;
+		if($sql -> db_Select("logstats", "*", "log_id='statDomain' "))
+		{
+			$row = $sql -> db_Fetch();
+			$domTotal = unserialize($row['log_data']);
+		}
+		else
+		{
+			$domTotal = array();
+		}
+		if(!$sql -> db_Select("stat_info", "*", "info_type='4'"))
+		{
+			return;
+		}
+		while($stat = $sql -> db_Fetch())
+		{
+			extract($stat);
+			$domTotal[$info_name] += $info_count;
+		}
+		$data = serialize($domTotal);
+		if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statDomain' "))
+		{
+			$sql -> db_Insert("logstats", "0, 'statDomain', '$data' ");
+		}
+	}
+
+/* ----------------------------------------------------------------------------------------------------------------------- */
+
+	function stage5()
+	{
+		// Screen entries to convert
+		global $sql;
+		if($sql -> db_Select("logstats", "*", "log_id='statScreen' "))
+		{
+			$row = $sql -> db_Fetch();
+			$screenTotal = unserialize($row['log_data']);
+		}
+		else
+		{
+			$screenTotal = array();
+		}
+		if(!$sql -> db_Select("stat_info", "*", "info_type='5'"))
+		{
+			return;
+		}
+		while($stat = $sql -> db_Fetch())
+		{
+			extract($stat);
+			if(!strstr($info_name, "undefined") && !strstr($info_name, "res"))
+			{
+				$info_name = str_replace(" @ ", "@", $info_name);
+				$screenTotal[$info_name] += $info_count;
+			}
+		}
+
+		$data = serialize($screenTotal);
+		if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statScreen' "))
+		{
+			$sql -> db_Insert("logstats", "0, 'statScreen', '$data' ");
+		}
+	}
+
+/* ----------------------------------------------------------------------------------------------------------------------- */
+
+function stage6()
+	{
+		// Converting referrer entries
+		global $sql;
+		if($sql -> db_Select("logstats", "*", "log_id='statReferer' "))
+		{
+			$row = $sql -> db_Fetch();
+			$refTotal = unserialize($row['log_data']);
+		}
+		else
+		{
+			$refTotal = array();
+		}
+		if(!$sql -> db_Select("stat_info", "*", "info_type='6'"))
+		{
+			return;
+		}
+		while($stat = $sql -> db_Fetch())
+		{
+			extract($stat);
+			if(!strstr($info_name, "undefined") && !strstr($info_name, "'"))
+			{
+				$refTotal[$info_name]['url'] = $info_name;
+				$refTotal[$info_name]['ttl'] += $info_count;
+			}
+		}
+		$data = serialize($refTotal);
+
+		if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statReferer' "))
+		{
+			$sql -> db_Insert("logstats", "0, 'statReferer', '$data' ");
+		}
+	}
+	
+	
+	/* ----------------------------------------------------------------------------------------------------------------------- */
+
+	function stage7()
+	{
+		// Correcting referrer entries
+		global $sql;
+		$sql -> db_Select("logstats", "*", "log_id='statReferer'");
+		$row = $sql -> db_Fetch();
+		$refTotal = unserialize($row['log_data']);
+
+		foreach ($refTotal as $key => $ref) {
+			if (!is_array($ref)){
+				unset($refTotal['key']);
+				$refTotal[$key]['url'] = $key;
+				$refTotal[$key]['ttl'] = $ref;
+			}
+		}
+		$data = serialize($refTotal);
+
+		if(!$sql -> db_Update("logstats", "log_data='$data' WHERE log_id='statReferer' "))
+		{
+			$sql -> db_Insert("logstats", "0, 'statReferer', '$data' ");
+		}
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/log/plugin.php 75/e107_plugins/log/plugin.php
--- 6171/e107_plugins/log/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/plugin.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,78 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/plugin.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."log/languages/admin/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."log/languages/admin/English.php");
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = ADSTAT_L3;
+$eplug_version = "2.0";
+$eplug_author = "jalist";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = ADSTAT_L1;
+$eplug_compatible = "e107v0.7";
+$eplug_readme = "";
+// leave blank if no readme file
+	
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "log";
+	
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "";
+	
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+	
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/stats_32.png";
+$eplug_icon_small = $eplug_folder."/images/stats_16.png";
+$eplug_caption = "Configure Statitics Logging";
+	
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefTable = "menu_pref";
+$eplug_prefs = array("statActivate" => 0, "statUserclass" => "", "statClass" => 0, "statBrowser" => 1, "statOs" => 1, "statScreen" => 1, "statDomain" => 1, "statRefer" => 1, "statQuery" => 1, "statRecent" => 1);
+	
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array("logstats");
+	
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."logstats (
+  log_uniqueid int(11) NOT NULL auto_increment,
+  log_id varchar(50) NOT NULL default '',
+  log_data longtext NOT NULL,
+  PRIMARY KEY  (log_uniqueid),
+  UNIQUE KEY log_id (log_id)
+) TYPE=MyISAM ");
+	
+	
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = TRUE;
+$eplug_link_name = "Site Stats";
+$eplug_link_url = e_PLUGIN."log/stats.php?1";
+	
+	
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = ADSTAT_L2;
+	
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/log/stats.php 75/e107_plugins/log/stats.php
--- 6171/e107_plugins/log/stats.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/log/stats.php	2006-02-20 19:19:33.000000000 -0600
@@ -0,0 +1,1212 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     �Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/log/stats.php,v $
+|     $Revision: 1.37 $
+|     $Date: 2006/02/21 01:19:33 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+
+@include_once(e_PLUGIN."log/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."log/languages/English.php");
+
+$stat = new siteStats();
+
+function core_head() {
+	$bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_IMAGE."generic/bar.png");
+	return "<style type='text/css'>
+<!--
+.b { background-image: url(".$bar."); border: 1px solid #999; height: 10px; font: 0px }
+-->
+</style>";
+}
+
+require_once(HEADERF);
+
+if(!check_class($pref['statUserclass'])) {
+	$text = "<div style='text-align: center;'>".ADSTAT_L4."</div>";
+	$ns->tablerender(ADSTAT_L6, $text);
+	require_once(FOOTERF);
+	exit;
+}
+
+if (!$pref['statActivate']) {
+	$text = (ADMIN ? "<div style='text-align:center'>".ADSTAT_L41."</div>" : "<div style='text-align:center'>".ADSTAT_L5."</div>");
+	$ns->tablerender(ADSTAT_L6, $text);
+	require_once(FOOTERF);
+	exit;
+}
+
+if(strstr(e_QUERY, ".")) {
+	list($action, $order) = explode(".", e_QUERY);
+} else {
+	$action = e_QUERY;
+	$order = FALSE;
+}
+
+$action = intval($action);
+$toremove = $order;
+$order = intval($order);
+
+if($stat -> error) {
+	$ns->tablerender(ADSTAT_L6, $stat -> error);
+	require_once(FOOTERF);
+	exit;
+}
+
+$browser_map = array (
+'Netcaptor'         => "netcaptor",
+'Internet Explorer' => "explorer",
+'Firefox'           => "firefox",
+'Opera'             => "opera",
+'AOL'               => "aol",
+'Netscape'          => "netscape",
+'Mozilla'           => "mozilla",
+'Mosaic'            => "mosaic",
+'K-Meleon'          => "k-meleon",
+'Konqueror'         => "konqueror",
+'Avant Browser'     => "avantbrowser",
+'AvantGo'           => "avantgo",
+'Proxomitron'       => "proxomitron",
+'Safari'            => "safari",
+'Lynx'              => "lynx",
+'Links'             => "links",
+'Galeon'            => "galeon",
+'ABrowse'           => "abrowse",
+'Amaya'             => "amaya",
+'ANTFresco'         => "ant",
+'Aweb'              => "aweb",
+'Beonex'            => "beonex",
+'Blazer'            => "blazer",
+'Camino'            => "camino",
+'Chimera'           => "chimera",
+'Columbus'          => "columbus",
+'Crazy Browser'     => "crazybrowser",
+'Curl'              => "curl",
+'Deepnet Explorer'  => "deepnet",
+'Dillo'             => "dillo",
+'Doris'             => "doris",
+'ELinks'            => "elinks",
+'Epiphany'          => "epiphany",
+'Firebird'          => "firebird",
+'IBrowse'           => "ibrowse",
+'iCab'              => "icab",
+'ICEbrowser'        => "ice",
+'iSiloX'            => "isilox",
+'Lotus Notes'       => "lotus",
+'Lunascape'         => "lunascape",
+'Maxthon'           => "maxthon",
+'mBrowser'          => "mbrowser",
+'Multi-Browser'     => "multibrowser",
+'Nautilus'          => "nautilus",
+'NetFront'          => "netfront",
+'NetPositive'       => "netpositive",
+'OmniWeb'           => "omniweb",
+'Oregano'           => "oregano",
+'PhaseOut'          => "phaseout",
+'PLink'             => "plink",
+'Phoenix'           => "phoenix",
+'Proxomitron'       => "proxomitron",
+'Shiira'            => "shiira",
+'Sleipnir'          => "sleipnir",
+'SlimBrowser'       => "slimbrowser",
+'StarOffice'        => "staroffice",
+'Sunrise'           => "sunrise",
+'Voyager'           => "voyager",
+'w3m'               => "w3m",
+'Webtv'             => "webtv",
+'Xiino'             => "xiino",
+);
+
+$country["arpa"] = "ARPANet";
+$country["com"] = "Commercial Users";
+$country["edu"] = "Education";
+$country["gov"] = "Government";
+$country["int"] = "Oganization established by an International Treaty";
+$country["mil"] = "Military";
+$country["net"] = "Network";
+$country["org"] = "Organization";
+$country["ad"] = "Andorra";
+$country["ae"] = "United Arab Emirates";
+$country["af"] = "Afghanistan";
+$country["ag"] = "Antigua & Barbuda";
+$country["ai"] = "Anguilla";
+$country["al"] = "Albania";
+$country["am"] = "Armenia";
+$country["an"] = "Netherland Antilles";
+$country["ao"] = "Angola";
+$country["aq"] = "Antarctica";
+$country["ar"] = "Argentina";
+$country["as"] = "American Samoa";
+$country["at"] = "Austria";
+$country["au"] = "Australia";
+$country["aw"] = "Aruba";
+$country["az"] = "Azerbaijan";
+$country["ba"] = "Bosnia-Herzegovina";
+$country["bb"] = "Barbados";
+$country["bd"] = "Bangladesh";
+$country["be"] = "Belgium";
+$country["bf"] = "Burkina Faso";
+$country["bg"] = "Bulgaria";
+$country["bh"] = "Bahrain";
+$country["bi"] = "Burundi";
+$country["bj"] = "Benin";
+$country["bm"] = "Bermuda";
+$country["bn"] = "Brunei Darussalam";
+$country["bo"] = "Bolivia";
+$country["br"] = "Brasil";
+$country["bs"] = "Bahamas";
+$country["bt"] = "Bhutan";
+$country["bv"] = "Bouvet Island";
+$country["bw"] = "Botswana";
+$country["by"] = "Belarus";
+$country["bz"] = "Belize";
+$country["ca"] = "Canada";
+$country["cc"] = "Cocos (Keeling) Islands";
+$country["cf"] = "Central African Republic";
+$country["cg"] = "Congo";
+$country["ch"] = "Switzerland";
+$country["ci"] = "Ivory Coast";
+$country["ck"] = "Cook Islands";
+$country["cl"] = "Chile";
+$country["cm"] = "Cameroon";
+$country["cn"] = "China";
+$country["co"] = "Colombia";
+$country["cr"] = "Costa Rica";
+$country["cs"] = "Czechoslovakia";
+$country["cu"] = "Cuba";
+$country["cv"] = "Cape Verde";
+$country["cx"] = "Christmas Island";
+$country["cy"] = "Cyprus";
+$country["cz"] = "Czech Republic";
+$country["de"] = "Germany";
+$country["dj"] = "Djibouti";
+$country["dk"] = "Denmark";
+$country["dm"] = "Dominica";
+$country["do"] = "Dominican Republic";
+$country["dz"] = "Algeria";
+$country["ec"] = "Ecuador";
+$country["ee"] = "Estonia";
+$country["eg"] = "Egypt";
+$country["eh"] = "Western Sahara";
+$country["er"] = "Eritrea";
+$country["es"] = "Spain";
+$country["et"] = "Ethiopia";
+$country["fi"] = "Finland";
+$country["fj"] = "Fiji";
+$country["fk"] = "Falkland Islands (Malvibas)";
+$country["fm"] = "Micronesia";
+$country["fo"] = "Faroe Islands";
+$country["fr"] = "France";
+$country["fx"] = "France (European Territory)";
+$country["ga"] = "Gabon";
+$country["gb"] = "Great Britain";
+$country["gd"] = "Grenada";
+$country["ge"] = "Georgia";
+$country["gf"] = "Guyana (French)";
+$country["gh"] = "Ghana";
+$country["gi"] = "Gibralta";
+$country["gl"] = "Greenland";
+$country["gm"] = "Gambia";
+$country["gn"] = "Guinea";
+$country["gp"] = "Guadeloupe (French)";
+$country["gq"] = "Equatorial Guinea";
+$country["gr"] = "Greece";
+$country["gs"] = "South Georgia & South Sandwich Islands";
+$country["gt"] = "Guatemala";
+$country["gu"] = "Guam (US)";
+$country["gw"] = "Guinea Bissau";
+$country["gy"] = "Guyana";
+$country["hk"] = "Hong Kong";
+$country["hm"] = "Heard & McDonald Islands";
+$country["hn"] = "Honduras";
+$country["hr"] = "Croatia";
+$country["ht"] = "Haiti";
+$country["hu"] = "Hungary";
+$country["id"] = "Indonesia";
+$country["ie"] = "Ireland";
+$country["il"] = "Israel";
+$country["in"] = "India";
+$country["io"] = "British Indian Ocean Territories";
+$country["iq"] = "Iraq";
+$country["ir"] = "Iran";
+$country["is"] = "Iceland";
+$country["it"] = "Italy";
+$country["jm"] = "Jamaica";
+$country["jo"] = "Jordan";
+$country["jp"] = "Japan";
+$country["ke"] = "Kenya";
+$country["kg"] = "Kyrgyz Republic";
+$country["kh"] = "Cambodia";
+$country["ki"] = "Kiribati";
+$country["km"] = "Comoros";
+$country["kn"] = "Saint Kitts Nevis Anguilla";
+$country["kp"] = "Korea (North)";
+$country["kr"] = "Korea (South)";
+$country["kw"] = "Kuwait";
+$country["ky"] = "Cayman Islands";
+$country["kz"] = "Kazachstan";
+$country["la"] = "Laos";
+$country["lb"] = "Lebanon";
+$country["lc"] = "Saint Lucia";
+$country["li"] = "Liechtenstein";
+$country["lk"] = "Sri Lanka";
+$country["lr"] = "Liberia";
+$country["ls"] = "Lesotho";
+$country["lt"] = "Lithuania";
+$country["lu"] = "Luxembourg";
+$country["lv"] = "Latvia";
+$country["ly"] = "Libya";
+$country["ma"] = "Morocco";
+$country["mc"] = "Monaco";
+$country["md"] = "Moldova";
+$country["mg"] = "Madagascar";
+$country["mh"] = "Marshall Islands";
+$country["mk"] = "Macedonia";
+$country["ml"] = "Mali";
+$country["mm"] = "Myanmar";
+$country["mn"] = "Mongolia";
+$country["mo"] = "Macau";
+$country["mp"] = "Northern Mariana Islands";
+$country["mq"] = "Martinique (French)";
+$country["mr"] = "Mauretania";
+$country["ms"] = "Montserrat";
+$country["mt"] = "Malta";
+$country["mu"] = "Mauritius";
+$country["mv"] = "Maldives";
+$country["mw"] = "Malawi";
+$country["mx"] = "Mexico";
+$country["my"] = "Malaysia";
+$country["mz"] = "Mozambique";
+$country["na"] = "Namibia";
+$country["nc"] = "New Caledonia (French)";
+$country["ne"] = "Niger";
+$country["nf"] = "Norfolk Island";
+$country["ng"] = "Nigeria";
+$country["ni"] = "Nicaragua";
+$country["nl"] = "Netherlands";
+$country["no"] = "Norway";
+$country["np"] = "Nepal";
+$country["nr"] = "Nauru";
+$country["nt"] = "Saudiarab. Irak)";
+$country["nu"] = "Niue";
+$country["nz"] = "New Zealand";
+$country["om"] = "Oman";
+$country["pa"] = "Panama";
+$country["pe"] = "Peru";
+$country["pf"] = "Polynesia (French)";
+$country["pg"] = "Papua New Guinea";
+$country["ph"] = "Philippines";
+$country["pk"] = "Pakistan";
+$country["pl"] = "Poland";
+$country["pm"] = "Saint Pierre & Miquelon";
+$country["pn"] = "Pitcairn";
+$country["pr"] = "Puerto Rico (US)";
+$country["pt"] = "Portugal";
+$country["pw"] = "Palau";
+$country["py"] = "Paraguay";
+$country["qa"] = "Qatar";
+$country["re"] = "Reunion (French)";
+$country["ro"] = "Romania";
+$country["ru"] = "Russian Federation";
+$country["rw"] = "Rwanda";
+$country["sa"] = "Saudi Arabia";
+$country["sb"] = "Salomon Islands";
+$country["sc"] = "Seychelles";
+$country["sd"] = "Sudan";
+$country["se"] = "Sweden";
+$country["sg"] = "Singapore";
+$country["sh"] = "Saint Helena";
+$country["si"] = "Slovenia";
+$country["sj"] = "Svalbard & Jan Mayen";
+$country["sk"] = "Slovakia";
+$country["sl"] = "Sierra Leone";
+$country["sm"] = "San Marino";
+$country["sn"] = "Senegal";
+$country["so"] = "Somalia";
+$country["sr"] = "Suriname";
+$country["st"] = "Sao Tome & Principe";
+$country["su"] = "Soviet Union";
+$country["sv"] = "El Salvador";
+$country["sy"] = "Syria";
+$country["sz"] = "Swaziland";
+$country["tc"] = "Turks & Caicos Islands";
+$country["td"] = "Chad";
+$country["tf"] = "French Southern Territories";
+$country["tg"] = "Togo";
+$country["th"] = "Thailand";
+$country["tj"] = "Tadjikistan";
+$country["tk"] = "Tokelau";
+$country["tm"] = "Turkmenistan";
+$country["tn"] = "Tunisia";
+$country["to"] = "Tonga";
+$country["tp"] = "East Timor";
+$country["tr"] = "Turkey";
+$country["tt"] = "Trinidad & Tobago";
+$country["tv"] = "Tuvalu";
+$country["tw"] = "Taiwan";
+$country["tz"] = "Tanzania";
+$country["ua"] = "Ukraine";
+$country["ug"] = "Uganda";
+$country["uk"] = "United Kingdom";
+$country["um"] = "US Minor outlying Islands";
+$country["us"] = "United States";
+$country["uy"] = "Uruguay";
+$country["uz"] = "Uzbekistan";
+$country["va"] = "Vatican City State";
+$country["vc"] = "St Vincent & Grenadines";
+$country["ve"] = "Venezuela";
+$country["vg"] = "Virgin Islands (British)";
+$country["vi"] = "Virgin Islands (US)";
+$country["vn"] = "Vietnam";
+$country["vu"] = "Vanuatu";
+$country["wf"] = "Wallis & Futuna Islands";
+$country["ws"] = "Samoa";
+$country["ye"] = "Yemen";
+$country["yt"] = "Mayotte";
+$country["yu"] = "Yugoslavia";
+$country["za"] = "South Africa";
+$country["zm"] = "Zambia";
+$country["zr"] = "Zaire";
+$country["zw"] = "Zimbabwe";
+
+/* stats displayed will depend on the query string. For example, ?1.2.4 will render today's stats, all time stats and browser stats */
+/*
+1: today's stats
+2: all time total and unique
+3: browsers
+4: operating systems
+5: domains
+6: screen resolution/colour depth
+7: referers
+8: search engine strings
+*/
+
+switch($action) {
+	case 1:
+	$text = $stat -> renderTodaysVisits();
+	break;
+	case 2:
+	$text = $stat -> renderAlltimeVisits();
+	break;
+	case 3:
+	if($pref['statBrowser']) {
+		$text = $stat -> renderBrowsers();
+	} else {
+		$text = ADSTAT_L7;
+	}
+	break;
+	case 4:
+	if($pref['statOs']) {
+		$text = $stat -> renderOses();
+	} else {
+		$text = ADSTAT_L7;
+	}
+	break;
+	case 5:
+	if($pref['statDomain']) {
+		$text = $stat -> renderDomains();
+	} else {
+		$text = ADSTAT_L7;
+	}
+	break;
+	case 6:
+	if($pref['statScreen']) {
+		$text = $stat -> renderScreens();
+	} else {
+		$text = ADSTAT_L7;
+	}
+	break;
+	case 7:
+	if($pref['statRefer']) {
+		$text = $stat -> renderRefers();
+	} else {
+		$text = ADSTAT_L7;
+	}
+	break;
+	case 8:
+	if($pref['statQuery']) {
+		$text = $stat -> renderQueries();
+	} else {
+		$text = ADSTAT_L7;
+	}
+	break;
+	case 9:
+	if($pref['statRecent']) {
+		$text = $stat -> recentVisitors();
+	} else {
+		$text = ADSTAT_L7;
+	}
+	break;
+	case 10:
+	$text = $stat -> renderDaily();
+	break;
+	case 11:
+	$text = $stat -> renderMonthly();
+	break;
+	case "rem":
+	$stat -> remove_entry($toremove);
+	break;
+}
+
+
+/* render links */
+$path = e_PLUGIN."log/stats.php";
+$links = "
+<div style='text-align: center;'>".
+(e_QUERY != 1 ? "<a href='$path?1'>".ADSTAT_L8."</a>" : "<b>".ADSTAT_L8."</b>")." | ".
+(e_QUERY != 2 ? "<a href='$path?2'>".ADSTAT_L9."</a>" : "<b>".ADSTAT_L9."</b>")." | ".
+(e_QUERY != 10 ? "<a href='$path?10'>".ADSTAT_L10."</a>" : "<b>".ADSTAT_L10."</b>")." | ".
+(e_QUERY != 11 ? "<a href='$path?11'>".ADSTAT_L11."</a>" : "<b>".ADSTAT_L11."</b>")." | ".
+(e_QUERY != 3 && $pref['statBrowser'] ? "<a href='$path?3'>".ADSTAT_L12."</a> | " : ($pref['statBrowser'] ? "<b>".ADSTAT_L12."</b> | " : "")).
+(e_QUERY != 4 && $pref['statOs'] ? "<a href='$path?4'>".ADSTAT_L13."</a> | " : ($pref['statOs'] ? "<b>".ADSTAT_L13."</b> | " : "")).
+(e_QUERY != 5 && $pref['statDomain'] ? "<a href='$path?5'>".ADSTAT_L14."</a> | " : ($pref['statDomain'] ? "<b>".ADSTAT_L14."</b> | " : "")).
+(e_QUERY != 6 && $pref['statScreen'] ? "<a href='$path?6'>".ADSTAT_L15."</a> | " : ($pref['statScreen'] ? "<b>".ADSTAT_L15."</b> | " : "")).
+(e_QUERY != 7 && $pref['statRefer'] ? "<a href='$path?7'>".ADSTAT_L16."</a> | " : ($pref['statRefer'] ? "<b>".ADSTAT_L16."</b> | " : "")).
+(e_QUERY != 8 && $pref['statQuery'] ? "<a href='$path?8'>".ADSTAT_L17."</a> | " : ($pref['statQuery'] ? "<b>".ADSTAT_L17."</b> | " : "")).
+(e_QUERY != 9 && $pref['statRecent'] ? "<a href='$path?9'>".ADSTAT_L18."</a>" : ($pref['statRecent'] ? "<b>".ADSTAT_L18."</b>" : "")).
+"</div><br /><br />";
+
+
+
+$ns->tablerender(ADSTAT_L6, $links.$text);
+require_once(FOOTERF);
+
+class siteStats {
+
+	var $dbPageInfo;
+	var $fileInfo;
+	var $fileBrowserInfo;
+	var $fileOsInfo;
+	var $fileScreenInfo;
+	var $fileDomainInfo;
+	var $fileReferInfo;
+	var $fileQueryInfo;
+	var $fileRecent;
+	var $error;
+	var $order;
+	var $bar;
+
+	var $filesiteTotal;
+	var $filesiteUnique;
+
+	function siteStats() {
+		/* constructor */
+		global $sql;
+
+		/* get today's logfile ... */
+		$logfile = e_PLUGIN."log/logs/logp_".date("z.Y", time()).".php";
+		if(is_readable($logfile)) {
+			require($logfile);
+		}
+		$logfile = e_PLUGIN."log/logs/logi_".date("z.Y", time()).".php";
+		if(is_readable($logfile)) {
+			require($logfile);
+		}
+
+		$this -> filesiteTotal = $siteTotal;
+		$this -> filesiteUnique = $siteUnique;
+
+		/* set order var */
+		global $order;
+		$this -> order = $order;
+
+		$this -> fileInfo = $pageInfo;
+		$this -> fileBrowserInfo = $browserInfo;
+		$this -> fileOsInfo = $osInfo;
+		$this -> fileScreenInfo = $screenInfo;
+		$this -> fileDomainInfo = $domainInfo;
+		$this -> fileReferInfo = $refInfo;
+		$this -> fileQueryInfo = $searchInfo;
+		$this -> fileRecent = $visitInfo;
+
+		/* get main stat info from database */
+		if($sql -> db_Select("logstats", "*", "log_id='pageTotal'")){
+			$row = $sql -> db_Fetch();
+			$this -> dbPageInfo = unserialize($row[2]);
+		} else {
+			$this -> dbPageInfo = array();
+		}
+
+		/* temp consolidate today's info (if it exists)... */
+		if(is_array($pageInfo)) {
+			foreach($pageInfo as $key => $info) {
+				$key = preg_replace("/\?.*/", "", $key);
+				if(array_key_exists($key, $this -> dbPageInfo)) {
+					$this -> dbPageInfo[$key]['ttlv'] += $info['ttl'];
+					$this -> dbPageInfo[$key]['unqv'] += $info['unq'];
+				} else {
+					$this -> dbPageInfo[$key]['url'] = $info['url'];
+					$this -> dbPageInfo[$key]['ttlv'] = $info['ttl'];
+					$this -> dbPageInfo[$key]['unqv'] = $info['unq'];
+				}
+			}
+		}
+
+		$this -> bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_IMAGE."generic/bar.png");
+
+
+		/* end constructor */
+	}
+
+	function arraySort($array, $column, $order = SORT_DESC){
+		/* sorts multi-dimentional array based on which field is passed */
+		$i=0;
+		foreach($array as $info) {
+			$sortarr[]=$info[$column];
+			$i++;
+		}
+		array_multisort($sortarr, $order, $array, $order);
+		return($array);
+		/* end method */
+	}
+	
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderTodaysVisits() {
+		/* renders information for today only */
+		$totalArray = $this -> arraySort($this -> fileInfo, "ttl");
+
+		foreach($totalArray as $key => $info) {
+			$totalv += $info['ttl'];
+			$totalu += $info['unq'];
+		}
+
+		$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 20%;'>".ADSTAT_L19."</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L20."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
+		foreach($totalArray as $key => $info) {
+			if($info['ttl']){
+				$percentage = round(($info['ttl']/$totalv) * 100, 2);
+				$text .= "<tr>\n<td class='forumheader3' style='width: 20%;'><img src='".e_PLUGIN."log/images/html.png' alt='' style='vertical-align: middle;' /> <a href='".$info['url']."'>".$key."</a>
+				</td>\n<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info['ttl']." [".$info['unq']."]")."</td>\n<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>\n</tr>\n";
+			}
+		}
+		$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21." [".ADSTAT_L22."]</td><td class='forumheader' style='text-align: center;'>$totalv [$totalu]</td><td class='forumheader'></td></tr></table>";
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderAlltimeVisits() {
+		/* renders information for alltime, total and unique */
+
+		global $sql;
+
+		$sql -> db_Select("logstats", "*", "log_id='pageTotal' ");
+		$row = $sql -> db_Fetch();
+		$pageTotal = unserialize($row['log_data']);
+
+		foreach($this -> fileInfo as $url => $tmpcon) {
+			$pageTotal[$url]['url'] = $tmpcon['url'];
+			$pageTotal[$url]['ttlv'] += $tmpcon['ttl'];
+			$pageTotal[$url]['unqv'] += $tmpcon['unq'];
+		}
+
+		$totalArray = $this -> arraySort($pageTotal, "ttlv");
+
+		foreach($totalArray as $key => $info) {
+			$total += $info['ttlv'];
+		}
+		$text .= "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 20%;'>".ADSTAT_L19."</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L23."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
+		foreach($totalArray as $key => $info) {
+			if($info['ttlv']){
+				$percentage = round(($info['ttlv']/$total) * 100, 2);
+				$text .= "<tr>
+				<td class='forumheader3' style='width: 20%;'>
+				".(ADMIN && getperms("P") ? "<a href='".e_SELF."?rem.".$key."'><img src='".e_PLUGIN."log/images/remove.png' alt='".ADSTAT_L39."' title='".ADSTAT_L39."' style='vertical-align: middle; border: 0;' /></a> " : "")."
+				<img src='".e_PLUGIN."log/images/html.png' alt='' style='vertical-align: middle;' /> <a href='".$info['url']."'>".$key."</a>
+				";
+				$text .= "</td>
+				<td class='forumheader3' style='width: 70%;'>".$this->bar($percentage, $info['ttlv'])."</td>
+				<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>
+				</tr>\n";
+			}
+		}
+		$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>$total</td><td class='forumheader'></td></tr>\n</table>";
+
+		$uniqueArray = $this -> arraySort($this -> dbPageInfo, "unqv");
+		foreach($uniqueArray as $key => $info) {
+			$totalv += $info['unqv'];
+		}
+		$text .= "<br /><table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 20%;'>Page</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L24."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
+		foreach($uniqueArray as $key => $info) {
+			if($info['ttlv']){
+				$percentage = round(($info['unqv']/$total) * 100, 2);
+				$text .= "<tr>
+				<td class='forumheader3' style='width: 20%;'><img src='".e_PLUGIN."log/images/html.png' alt='' style='vertical-align: middle;' /> <a href='".$info['url']."'>".$key."</a></td>
+				<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info['unqv'])."</td>
+				<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>
+				</tr>\n";
+			}
+		}
+		$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>$totalv</td><td class='forumheader'></td></tr>\n</table>";
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderBrowsers() {
+		global $sql, $browser_map;
+
+		if($entries = $sql -> db_Select("logstats", "*", "log_id='statBrowser'")) {
+			$row = $sql -> db_Fetch();
+			$statBrowser = unserialize($row['log_data']);
+		}
+
+		/* temp consolidate today's data ... */
+		foreach($this -> fileBrowserInfo as $name => $count) {
+			$statBrowser[$name] += $count;
+		}
+
+		if(!is_array($statBrowser)) {
+			return "<div style='text-align: center;'>".ADSTAT_L25."</div>";
+		}
+
+		if(is_array($statBrowser)) {
+			if($this -> order) {
+				ksort($statBrowser);
+				reset ($statBrowser);
+				$browserArray = $statBrowser;
+			} else {
+				$browserArray = $this -> arraySort($statBrowser, 0);
+			}
+			$total = array_sum($browserArray);
+			$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 20%;'><a title='".($this -> order ? "sort by total" : "sort alphabetically")."'href='".e_SELF."?3".($this -> order ? "" : ".1" )."'>".ADSTAT_L26."</a></td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
+
+			foreach($browserArray as $key => $info) {
+				$image = "";
+				foreach ($browser_map as $name => $file) {
+					if(strstr($key, $name)) {
+						$image = "{$file}.png";
+						break;
+					}
+				}
+				if($image == "") {
+					$image = "unknown.png";
+				}
+				$percentage = round(($info/$total) * 100, 2);
+				$text .= "<tr>
+				<td class='forumheader3' style='width: 20%;'>".($image ? "<img src='".e_PLUGIN."log/images/$image' alt='' style='vertical-align: middle;' /> " : "").$key."</td>".
+				($entries == 1 ? "<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</td>" : "<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</td>")."
+				<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>
+				</tr>\n";
+			}
+			$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>$total</td><td class='forumheader'></td></tr>\n</table>";
+		}
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderOses() {
+		global $sql;
+
+		if($entries = $sql -> db_Select("logstats", "*", "log_id='statOs'")) {
+			$row = $sql -> db_Fetch();
+			$statOs = unserialize($row['log_data']);
+		}
+
+		/* temp consolidate today's data ... */
+		foreach($this -> fileOsInfo as $name => $count) {
+			$statOs[$name] += $count;
+		}
+
+		if(!is_array($statOs)) {
+			return "<div style='text-align: center;'>".ADSTAT_L25.".</div>";
+		}
+
+		if($this -> order) {
+			ksort($statOs);
+			reset ($statOs);
+			$osArray = $statOs;
+		} else {
+			$osArray = $this -> arraySort($statOs, 0);
+		}
+
+		$total = array_sum($osArray);
+		$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 20%;'><a title='".($this -> order ? "sort by total" : "sort alphabetically")."'href='".e_SELF."?4".($this -> order ? "" : ".1" )."'>".ADSTAT_L27."</a></td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
+		foreach($osArray as $key => $info) {
+
+			$image = "";
+			if(strstr($key, "Windows")) {	$image = "windows.png"; }
+			if(strstr($key, "Mac")) {	$image = "mac.png"; }
+			if(strstr($key, "Linux")) {	$image = "linux.png"; }
+			if(strstr($key, "BeOS")) {	$image = "beos.png"; }
+			if(strstr($key, "FreeBSD")) {	$image = "freebsd.png"; }
+			if(strstr($key, "NetBSD")) {	$image = "netbsd.png"; }
+			if(strstr($key, "Unspecified")) {	$image = "unspecified.png"; }
+			if(strstr($key, "OpenBSD")) {	$image = "openbsd.png"; }
+			if(strstr($key, "Unix")) {	$image = "unix.png"; }
+			if(strstr($key, "Spiders")) {	$image = "spiders.png"; }
+
+			$percentage = round(($info/$total) * 100, 2);
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 20%;'>".($image ? "<img src='".e_PLUGIN."log/images/$image' alt='' style='vertical-align: middle;' /> " : "").$key."</td>".
+			($entries == 1 ? "<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</td>" : "<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</td>")."
+			<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>
+			</tr>\n";
+		}
+		$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>$total</td><td class='forumheader'></tr></tr>\n</table>";
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderDomains() {
+		global $sql;
+
+		if($sql -> db_Select("logstats", "*", "log_id='statDomain'")) {
+			$row = $sql -> db_Fetch();
+			$statDom = unserialize($row['log_data']);
+		}
+
+		/* temp consolidate today's data ... */
+		foreach($this -> fileDomainInfo as $name => $count) {
+			$statDom[$name] += $count;
+		}
+
+		if(!count($statDom)) {
+			return "<div style='text-align: center;'>".ADSTAT_L25.".</div>";
+		}
+
+		if($this -> order) {
+			ksort($statDom);
+			reset ($statDom);
+			$domArray = $statDom;
+		} else {
+			$domArray = $this -> arraySort($statDom, 0);
+		}
+
+		$total = array_sum($domArray);
+		$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 20%;'><a title='".($this -> order ? "sort by total" : "sort alphabetically")."'href='".e_SELF."?5".($this -> order ? "" : ".1" )."'>".ADSTAT_L28."</a></td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
+		foreach($domArray as $key => $info) {
+			if($key = $this -> getcountry($key)) {
+				$percentage = round(($info/$total) * 100, 2);
+				$text .= "<tr>
+				<td class='forumheader3' style='width: 20%;'>".$key."</td>
+				<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</td>
+				<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>
+				</tr>\n";
+			}
+		}
+		$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>$total</td><td class='forumheader'></td></tr>\n</table>";
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderScreens() {
+		global $sql;
+
+		if($entries = $sql -> db_Select("logstats", "*", "log_id='statScreen'")) {
+			$row = $sql -> db_Fetch();
+			$statScreen = unserialize($row['log_data']);
+		}
+
+		/* temp consolidate today's data ... */
+		foreach($this -> fileScreenInfo as $name => $count) {
+			$statScreen[$name] += $count;
+		}
+
+		if(!is_array($statScreen)) {
+			return "<div style='text-align: center;'>".ADSTAT_L25."</div>";
+		}
+
+		if($this -> order) {
+			$nsarray = array();
+			foreach($statScreen as $key => $info) {
+				if(preg_match("/(\d+)x/", $key, $match)) {
+					$nsarray[$key] = array('width' => $match[1], 'info' => $info);
+				}
+			}
+			$nsarray = $this -> arraySort($nsarray, 'width', SORT_ASC);
+			reset($nsarray);
+			$screenArray = array();
+			foreach($nsarray as $key => $info) {
+				$screenArray[$key] = $info['info'];
+			}
+
+		} else {
+			$screenArray = $this -> arraySort($statScreen, 0);
+		}
+
+		$total = array_sum($screenArray);
+		$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 20%;'><a title='".($this -> order ? "sort by total" : "sort alphabetically")."'href='".e_SELF."?6".($this -> order ? "" : ".1" )."'>".ADSTAT_L29."</a></td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L21."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
+		foreach($screenArray as $key => $info) {
+			if(strstr($key, "@") && !strstr($key, "undefined") && preg_match("/(\d+)x(\d+)@(\d+)/", $key)) {
+				$percentage = round(($info/$total) * 100, 2);
+				$text .= "<tr>
+				<td class='forumheader3' style='width: 20%;'><img src='".e_PLUGIN."log/images/screen.png' alt='' style='vertical-align: middle;' /> ".$key."</td>".
+				($entries == 1 ? "<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</td>" : "<td class='forumheader3' style='width: 70%;'>".$this -> bar($percentage, $info)."</td>")."
+				<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>
+				</tr>\n";
+			}
+		}
+		$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>$total</td><td class='forumheader'></td></tr>\n</table>";
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderRefers() {
+		global $sql, $pref;
+
+		if($sql -> db_Select("logstats", "*", "log_id='statReferer'")) {
+			$row = $sql -> db_Fetch();
+			$statRefer = unserialize($row['log_data']);
+		}
+
+		/* temp consolidate today's data ... */
+		foreach($this -> fileReferInfo as $name => $count) {
+			$statRefer[$name]['url'] = $count['url'];
+			$statRefer[$name]['ttl'] += $count['ttl'];
+		}
+
+		//echo "<pre>"; print_r($statRefer); echo "</pre>"; exit;
+
+		if(!is_array($statRefer) || !count($statRefer)) {
+			return "<div style='text-align: center;'>".ADSTAT_L25.".</div>";
+		}
+
+		$statArray = $this -> arraySort($statRefer, 'ttl');
+
+		$total = 0;
+		foreach($statArray as $key => $info) {
+			$total += $info['ttl'];
+		}
+
+		$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 40%;'><a title='".($this -> order ? "show cropped url" : "show full url")."'href='".e_SELF."?7".($this -> order ? "" : ".1" )."'>".ADSTAT_L30."</a></td>\n<td class='fcaption' style='width: 50%;' colspan='2'>".ADSTAT_L21."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
+		$count = 0;
+		foreach($statArray as $key => $info) {
+			$percentage = round(($info['ttl']/$total) * 100, 2);
+			if (!$this -> order && strlen($key) > 50) {
+				$key = substr($key, 0, 50)." ...";
+			}
+			$text .= "<tr>
+			<td class='forumheader3'><img src='".e_PLUGIN."log/images/html.png' alt='' style='vertical-align: middle;' /> <a href='".$info['url']."' rel='external'>".$key."</a></td>
+			<td class='forumheader3'>".$this -> bar($percentage, $info['ttl'])."</td>
+			<td class='forumheader3' style='text-align: center;'>".$percentage."%</td>
+			</tr>\n";
+			$count++;
+			if($count == $pref['statDisplayNumber']) {
+				break;
+			}
+		}
+		$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>$total</td><td class='forumheader'></td></tr>\n</table>";
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderQueries() {
+		global $sql;
+
+		if($sql -> db_Select("logstats", "*", "log_id='statQuery'")) {
+			$row = $sql -> db_Fetch();
+			$statQuery = unserialize($row['log_data']);
+		}
+
+		/* temp consolidate today's data ... */
+		foreach($this -> fileQueryInfo as $name => $count) {
+			$statQuery[$name] += $count;
+		}
+
+		if(!is_array($statQuery) || !count($statQuery)) {
+			return "<div style='text-align: center;'>".ADSTAT_L25."</div>";
+		}
+
+		$queryArray = $this -> arraySort($statQuery, 0);
+		$total = array_sum($queryArray);
+		$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 60%;'>".ADSTAT_L31."</td>\n<td class='fcaption' style='width: 30%;' colspan='2'>".ADSTAT_L21."</td>\n<td class='fcaption' style='width: 10%; text-align: center;'>%</td>\n</tr>\n";
+		$count = 1;
+		foreach($queryArray as $key => $info) {
+			$percentage = round(($info/$total) * 100, 2);
+			$key = str_replace("%20", " ", $key);
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 60%;'><img src='".e_PLUGIN."log/images/screen.png' alt='' style='vertical-align: middle;' /> ".$key."</td>
+			<td class='forumheader3' style='width: 30%;'>".$this -> bar($percentage, $info)."</td>
+			<td class='forumheader3' style='width: 10%; text-align: center;'>".$percentage."%</td>
+			</tr>\n";
+			$count ++;
+			if($count == $pref['statDisplayNumber']) {
+				break;
+			}
+		}
+		$text .= "<tr><td class='forumheader' colspan='2'>".ADSTAT_L21."</td><td class='forumheader' style='text-align: center;'>$total</td><td class='forumheader'></td></tr>\n</table>";
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function recentVisitors() {
+		if(!is_array($this -> fileRecent) || !count($this -> fileRecent)) {
+			return "<div style='text-align: center;'>".ADSTAT_L25.".</div>";
+		}
+
+		$gen = new convert;
+		$recentArray = array_reverse($this -> fileRecent, TRUE);
+		$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 30%;'>".ADSTAT_L18."</td>\n<td class='fcaption' style='width: 70%;'>Information</td>\n</tr>\n";
+
+		foreach($recentArray as $key => $info) {
+			if(is_array($info)) {
+				$host      = $info['host'];
+				$datestamp = $info['date'];
+				$os        = $info['os'];
+				$browser   = $info['browser'];
+				$screen    = $info['screen'];
+				$referer   = $info['referer'];
+			} else {
+				list($host, $datestamp, $os, $browser, $screen, $referer) = explode(chr(1), $info);
+			}
+			$datestamp = $gen -> convert_date($datestamp, "long");
+
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 30%;'>$datestamp</td>
+			<td class='forumheader3' style='width: 70%;'>Host: $host<br />".ADSTAT_L26.": $browser<br />".ADSTAT_L27.": $os<br />".ADSTAT_L29.": $screen".($referer ? "<br />".ADSTAT_L32.": <a href='$referer' rel='external'>$referer</a>" : "")."</td>
+			</tr>\n";
+		}
+
+		$text .= "</table>";
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderDaily() {
+		global $sql, $siteTotal, $siteUnique;
+
+		$td = date("Y-m-j", time());
+		$dayarray[$td] = array();
+		$pagearray = array();
+
+		$qry = "
+		SELECT * from #logstats WHERE log_id REGEXP('[[:digit:]]+\-[[:digit:]]+\-[[:digit:]]+')
+		ORDER BY CONCAT(LEFT(log_id,4), SUBSTRING(log_id, 6, 2), LPAD(SUBSTRING(log_id, 9), 2, '0'))
+		DESC LIMIT 0,14
+		";
+
+		if($amount = $sql -> db_Select_gen($qry)) {
+			$array = $sql -> db_getList();
+
+			$ttotal = 0;
+			$utotal = 0;
+
+			foreach($array as $key => $value) {
+				extract($value);
+				if(is_array($log_data)) {
+					$entries[0] = $log_data['host'];
+					$entries[1] = $log_data['date'];
+					$entries[2] = $log_data['os'];
+					$entries[3] = $log_data['browser'];
+					$entries[4] = $log_data['screen'];
+					$entries[5] = $log_data['referer'];
+				} else {
+					$entries = explode(chr(1), $log_data);
+				}
+
+				$dayarray[$log_id]['daytotal'] = $entries[0];
+				$dayarray[$log_id]['dayunique'] = $entries[1];
+
+				unset($entries[0]);
+				unset($entries[1]);
+				
+				foreach($entries as $entry) {
+					if($entry) {
+						list($url, $total, $unique) = explode("|", $entry);
+						if(strstr($url, "/")) {
+							$urlname = preg_replace("/\.php|\?.*/", "", substr($url, (strrpos($url, "/")+1)));
+						} else {
+							$urlname = preg_replace("/\.php|\?.*/", "", $url);
+						}
+						$dayarray[$log_id][$urlname] = array('url' => $url, 'total' => $total, 'unique' => $unique);
+						$pagearray[$urlname]['total'] += $total;
+						$pagearray[$urlname]['unique'] += $unique;
+						$ttotal += $total;
+						$utotal += $unique;
+					}
+				}
+			}
+		}
+
+		foreach($this -> fileInfo as $fkey => $fvalue)
+		{
+			$dayarray[$td][$fkey]['total'] += $fvalue['ttl'];
+			$dayarray[$td][$fkey]['unique'] += $fvalue['unq'];
+			$dayarray[$td]['daytotal'] += $fvalue['ttl'];
+			$dayarray[$td]['dayunique'] += $fvalue['unq'];
+			$pagearray[$fkey]['total'] += $fvalue['ttl'];
+			$pagearray[$fkey]['unique'] += $fvalue['unq'];
+			$ttotal += $fvalue['ttl'];
+			$utotal += $fvalue['unq'];
+		}
+
+		$text = "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 30%;'>".ADSTAT_L33." ".($amount+1)." ".ADSTAT_L40."</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L34."</td>\n</tr>\n";
+
+		foreach($dayarray as $date => $total) {
+
+			list($year, $month, $day) = explode("-", $date);
+			$date = strftime ("%A, %B %d", mktime (0,0,0,$month,$day,$year));
+			$barWidth = round(($total['daytotal']/$ttotal) * 100, 2);
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 30%;'>$date</td>
+			<td class='forumheader3' style='width: 70%;'>".$this -> bar($barWidth, $total['daytotal'])."</td>
+			</tr>\n";
+		}
+
+		$text .= "</table>";
+		$text .= "<br /><table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 30%;'>".ADSTAT_L35." ".($amount+1)." ".ADSTAT_L40."</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L34."</td>\n</tr>\n";
+
+
+		foreach($dayarray as $date => $total) {
+			list($year, $month, $day) = explode("-", $date);
+			$date = strftime ("%A, %B %d", mktime (0,0,0,$month,$day,$year));
+			$barWidth = round(($total['dayunique']/$utotal) * 100, 2);
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 30%;'>$date</td>
+			<td class='forumheader3' style='width: 70%;'>".$this -> bar($barWidth, $total['dayunique'])."</td>
+			</tr>\n";
+		}
+		$text .= "</table>";
+
+		$text .= "<br /><table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 30%;'>".ADSTAT_L33." ".($amount+1)." ".ADSTAT_L36."</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L34."</td>\n</tr>\n";
+
+		$newArray = $this -> arraySort($pagearray, "total");
+		foreach($newArray as $key => $total) {
+			$barWidth = round(($total['total']/$ttotal) * 100, 2);
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 30%;'><img src='".e_PLUGIN."log/images/html.png' alt='' style='vertical-align: middle;' /> $key</td>
+			<td class='forumheader3' style='width: 70%;'>".$this -> bar($barWidth, $total['total'])."</td>
+			</tr>\n";
+
+		}
+		$text .= "</table>";
+		$text .= "<br /><table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 30%;'>".ADSTAT_L35." ".($amount+1)." ".ADSTAT_L36."</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L34."</td>\n</tr>\n";
+		$newArray = $this -> arraySort($pagearray, "unique");
+
+		foreach($newArray as $key => $total) {
+			$barWidth = round(($total['unique']/$utotal) * 100, 2);
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 30%;'><img src='".e_PLUGIN."log/images/html.png' alt='' style='vertical-align: middle;' /> $key</td>
+			<td class='forumheader3' style='width: 70%;'>".$this -> bar($barWidth, $total['unique'])."</td>
+			</tr>\n";
+		}
+		$text .= "</table>";
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function renderMonthly() {
+		global $sql;
+
+		if(!$entries = $sql -> db_Select("logstats", "*", "log_id REGEXP('^[[:digit:]]+\-[[:digit:]]+$') ORDER BY CONCAT(LEFT(log_id,4), RIGHT(log_id,2)) DESC")) {
+			return "No monthly stats yet.";
+		}
+
+		$array = $sql -> db_getList();
+
+		$monthTotal = array();
+		$mtotal = 0;
+		$utotal = 0;
+		foreach($array as $info) {
+			$date = $info['log_id'];
+			$stats = unserialize($info['log_data']);
+
+			foreach($stats as $key => $total) {
+				$monthTotal[$date]['totalv'] += $total['ttlv'];
+				$monthTotal[$date]['uniquev'] += $total['unqv'];
+				$mtotal += $total['ttlv'];
+				$utotal += $total['unqv'];
+			}
+		}
+
+		$tmpArray = $this -> arraySort($monthTotal, "totalv");
+
+		$text .= "<table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 30%;'>".ADSTAT_L37."</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L34."</td>\n</tr>\n";
+
+		foreach($monthTotal as $date => $total) {
+
+			list($year, $month) = explode("-", $date);
+			$date = strftime ("%B %Y", mktime (0,0,0,$month,1,$year));
+			$barWidth = round(($total['totalv']/$mtotal) * 100, 2);
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 30%;'>$date</td>".
+			($entries == 1 ? "<td class='forumheader3' style='width: 70%;'>".$this -> bar($barWidth, $total['totalv'])."</td>" : "<td class='forumheader3' style='width: 70%;'>".$this -> bar($barWidth, $total['totalv'])."</td>")."
+			</tr>\n";
+		}
+		$text .= "</table>";
+
+		$text .= "<br /><table class='fborder' style='width: 100%;'>\n<tr>\n<td class='fcaption' style='width: 30%;'>".ADSTAT_L38."</td>\n<td class='fcaption' style='width: 70%;' colspan='2'>".ADSTAT_L34."</td>\n</tr>\n";
+
+		foreach($monthTotal as $date => $total) {
+			$barWidth = round(($total['uniquev']/$utotal) * 100, 2);
+			list($year, $month) = explode("-", $date);
+			$date = strftime ("%B %Y", mktime (0,0,0,$month,1,$year));
+			$text .= "<tr>
+			<td class='forumheader3' style='width: 30%;'>$date</td>".
+			($entries == 1 ? "<td class='forumheader3' style='width: 70%;'>".$this -> bar($barWidth, $total['uniquev'])."</td>" : "<td class='forumheader3' style='width: 70%;'>".$this -> bar($barWidth, $total['uniquev'])."</td>")."
+			</tr>\n";
+		}
+		$text .= "</table>";
+
+
+		return $text;
+	}
+
+	/* -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+
+	function getWidthRatio ($array, $column) {
+		$tmpArray = $this -> arraySort($array, $column);
+		$data = each($tmpArray);
+		$maxValue = $data[1]['totalv'];
+		echo "<b>maxValue</b> ".$maxValue." <br />";
+		$ratio = 0;
+		while($maxValue > 100) {
+			$maxValue = ($maxValue / 2);
+			$ratio ++;
+		}
+		if(!$ratio)
+		{
+			return 1;
+		}
+		echo "<b>ratio</b> ".$ratio." <br />";
+		return $ratio;
+	}
+
+	function getcountry($dom) {
+		global $country;
+		return $country[$dom];
+	}
+
+	function bar($percen, $val)
+	{
+		return "<div class='b' style='width: ".intval($percen)."%'></div>
+		</td>
+		<td style='width:10%; text-align:center' class='forumheader3'>".$val;
+	}
+
+	function remove_entry($toremove) {
+		global $sql;
+		$sql -> db_Select("logstats", "*", "log_id='pageTotal'");
+		$row = $sql -> db_Fetch();
+		$dbPageInfo = unserialize($row[2]);
+		unset($dbPageInfo[$toremove]);
+		$dbPageDone = serialize($dbPageInfo);
+		$sql -> db_Update("logstats", "log_data='$dbPageDone' WHERE log_id='pageTotal' ");
+		$this -> renderAlltimeVisits();
+	}
+}
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/login_menu/config.php 75/e107_plugins/login_menu/config.php
--- 6171/e107_plugins/login_menu/config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/login_menu/config.php	2005-05-03 21:17:58.000000000 -0500
@@ -0,0 +1,103 @@
+<?php
+	
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/login_menu/config.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/05/04 02:17:58 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+	
+$eplug_admin = TRUE;
+require_once("../../class2.php");
+$lan_file = e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php";
+if (file_exists($lan_file)) {
+	require_once($lan_file);
+} else {
+	require_once(e_PLUGIN."login_menu/languages/English.php");
+}
+if (!getperms("4")) {
+	header("location:".e_BASE."index.php");
+	 exit ;
+}
+require_once(e_ADMIN."auth.php");
+	
+if ($_POST['update_menu']) {
+	unset($menu_pref['login_menu']);
+	$menu_pref['login_menu'] = $_POST['pref'];
+	$tmp = addslashes(serialize($menu_pref));
+	$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
+	$ns->tablerender("", '<div style=\'text-align:center\'><b>'.LOGIN_MENU_L38.'</b></div>');
+}
+	
+$text = '
+	<div style="text-align:center">
+	<form action="'.e_SELF.'?'.e_QUERY.'" method="post">
+	<table style="width:85%" class="fborder" >
+	 
+	<tr>
+	<td style="width:30%" class="forumheader3">'.LOGIN_MENU_L31.'</td>
+	<td style="width:70%" class="forumheader3">
+	<input type="checkbox" name="pref[new_news]" value="1"'.($menu_pref['login_menu']['new_news'] == 1 ? ' checked="checked"' : '').' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style="width:30%" class="forumheader3">'.LOGIN_MENU_L32.'</td>
+	<td style="width:70%" class="forumheader3">
+	<input type="checkbox" name="pref[new_articles]" value="1"'.($menu_pref['login_menu']['new_articles'] == 1 ? ' checked="checked"' : '').' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style="width:30%" class="forumheader3">'.LOGIN_MENU_L33.'</td>
+	<td style="width:70%" class="forumheader3">
+	<input type="checkbox" name="pref[new_chatbox]" value="1"'.($menu_pref['login_menu']['new_chatbox'] == 1 ? ' checked="checked"' : '').' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style="width:30%" class="forumheader3">'.LOGIN_MENU_L34.'</td>
+	<td style="width:70%" class="forumheader3">
+	<input type="checkbox" name="pref[new_comments]" value="1"'.($menu_pref['login_menu']['new_comments'] == 1 ? ' checked="checked"' : '').' />
+	</td>
+	</tr>
+	 
+	 
+	<tr>
+	<td style="width:30%" class="forumheader3">'.LOGIN_MENU_L35.'</td>
+	<td style="width:70%" class="forumheader3">
+	<input type="checkbox" name="pref[new_forum]" value="1"'.($menu_pref['login_menu']['new_forum'] == 1 ? ' checked="checked"' : '').' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style="width:30%" class="forumheader3">'.LOGIN_MENU_L36.'</td>
+	<td style="width:70%" class="forumheader3">
+	<input type="checkbox" name="pref[new_members]" value="1"'.($menu_pref['login_menu']['new_members'] == 1 ? ' checked="checked"' : '').' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td colspan="2" class="forumheader" style="text-align: center;"><input class="button" type="submit" name="update_menu" value="'.LOGIN_MENU_L37.'" /></td>
+	</tr>
+	</table>
+	</form>
+	</div>
+	';
+	
+$ns->tablerender('Login Menu Settings', $text);
+	
+require_once(e_ADMIN."footer.php");
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/login_menu/languages/English.php 75/e107_plugins/login_menu/languages/English.php
--- 6171/e107_plugins/login_menu/languages/English.php	2004-08-12 09:34:18.000000000 -0500
+++ 75/e107_plugins/login_menu/languages/English.php	2006-04-27 01:02:46.000000000 -0500
@@ -1,49 +1,65 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("LOGIN_MENU_L1", "Username: ");
-define("LOGIN_MENU_L2", "Password: ");
-define("LOGIN_MENU_L3", "Signup");
-define("LOGIN_MENU_L4", "Forgot password?");
-define("LOGIN_MENU_L5", "Welcome");
-define("LOGIN_MENU_L6", "Remember me");
-define("LOGIN_MENU_L7", "Unique user id not recognised (possible corrupted cookie).<br />Please <a href=\"".e_BASE."index.php?logout\">click here</a> to destroy cookie.");
-define("LOGIN_MENU_L8", "Logout");
-define("LOGIN_MENU_L9", "Login Error");
-define("LOGIN_MENU_L10", "The maintenance flag is true - this means normal visitors are being redirected to sitedown.php. To reset the flag go to admin/maintenance.");
-define("LOGIN_MENU_L11", "Admin Area");
-define("LOGIN_MENU_L12", "Settings");
-define("LOGIN_MENU_L13", "Profile");
-
-define("LOGIN_MENU_L14", "news item");
-define("LOGIN_MENU_L15", "news items");
-define("LOGIN_MENU_L16", "chatbox post");
-define("LOGIN_MENU_L17", "chatbox posts");
-define("LOGIN_MENU_L18", "comment");
-define("LOGIN_MENU_L19", "comments");
-define("LOGIN_MENU_L20", "forum post");
-define("LOGIN_MENU_L21", "forum posts");
-define("LOGIN_MENU_L22", "new site member");
-define("LOGIN_MENU_L23", "new site members");
-define("LOGIN_MENU_L24", "Click here to see list of new items");
-define("LOGIN_MENU_L25", "Since your last visit there have been");
-define("LOGIN_MENU_L26", "no");
-define("LOGIN_MENU_L27", "and");
- 
-define("LOGIN_MENU_L28", "Login");
-
-define("LOGIN_MENU_L29", "new article");
-define("LOGIN_MENU_L30", "new articles");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/login_menu/languages/English.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2006/04/27 06:02:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+define("LOGIN_MENU_L1", "Username: ");
+define("LOGIN_MENU_L2", "Password: ");
+define("LOGIN_MENU_L3", "Signup");
+define("LOGIN_MENU_L4", "Forgot password?");
+define("LOGIN_MENU_L5", "Welcome");
+define("LOGIN_MENU_L6", "Remember me");
+define("LOGIN_MENU_L7", "Unique user id not recognised (possible corrupted cookie).<br />Please <a href=\"".e_BASE."index.php?logout\">click here</a> to destroy cookie.");
+define("LOGIN_MENU_L8", "Logout");
+define("LOGIN_MENU_L9", "Login Error");
+define("LOGIN_MENU_L10", "The maintenance flag is true - this means normal visitors are being redirected to sitedown.php. To reset the flag go to admin/maintenance.");
+define("LOGIN_MENU_L11", "Admin Area");
+define("LOGIN_MENU_L12", "Settings");
+define("LOGIN_MENU_L13", "Profile");
+define("LOGIN_MENU_L14", "news item");
+define("LOGIN_MENU_L15", "news items");
+define("LOGIN_MENU_L16", "chatbox post");
+define("LOGIN_MENU_L17", "chatbox posts");
+define("LOGIN_MENU_L18", "comment");
+define("LOGIN_MENU_L19", "comments");
+define("LOGIN_MENU_L20", "forum post");
+define("LOGIN_MENU_L21", "forum posts");
+define("LOGIN_MENU_L22", "new site member");
+define("LOGIN_MENU_L23", "new site members");
+define("LOGIN_MENU_L24", "Click here to see list of new items");
+define("LOGIN_MENU_L25", "Since your last visit there have been");
+define("LOGIN_MENU_L26", "no");
+define("LOGIN_MENU_L27", "and");
+define("LOGIN_MENU_L28", "Login");
+	
+define("LOGIN_MENU_L29", "new article");
+define("LOGIN_MENU_L30", "new articles");
+	
+// New config options
+define('LOGIN_MENU_L31', 'Show New News Posts');
+define('LOGIN_MENU_L32', 'Show New Article Posts');
+define('LOGIN_MENU_L33', 'Show New Chatbox Posts');
+define('LOGIN_MENU_L34', 'Show New Comment Posts');
+define('LOGIN_MENU_L35', 'Show New Forum Posts');
+define('LOGIN_MENU_L36', 'Show New Members');
+define('LOGIN_MENU_L37', 'Update Settings');
+define('LOGIN_MENU_L38', 'Settings Updated');
+
+
+define('LOGIN_MENU_L39', 'Leave Admin');
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/login_menu/login_menu.php 75/e107_plugins/login_menu/login_menu.php
--- 6171/e107_plugins/login_menu/login_menu.php	2005-05-13 06:25:22.000000000 -0500
+++ 75/e107_plugins/login_menu/login_menu.php	2006-05-13 23:05:13.000000000 -0500
@@ -1,199 +1,222 @@
 <?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/login_menu/login_menu.php,v $
+|     $Revision: 1.46 $
+|     $Date: 2006/05/14 04:05:13 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if(defined("FPW_ACTIVE"))
+{
+	return;      // prevent failed login attempts when fpw.php is loaded before this menu.
+}
 
-if(CORRUPT_COOKIE === TRUE){
-	$text = "<div style='text-align:center'>".LOGIN_MENU_L7."<br /><br />\n<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."index.php?logout'>".LOGIN_MENU_L8."</a></div>";
-	$ns -> tablerender(LOGIN_MENU_L9, $text);
+global $eMenuActive, $e107, $tp, $use_imagecode, $ADMIN_DIRECTORY;
+require_once(e_PLUGIN."login_menu/login_menu_shortcodes.php");
+$ip = $e107->getip();
+
+$bullet = (defined("BULLET") ? "<img src='".THEME_ABS."images/".BULLET."' alt='' style='vertical-align: middle;' />" : "<img src='".THEME_ABS."images/bullet2.gif' alt='bullet' style='vertical-align: middle;' />");
+
+if (defined('CORRUPT_COOKIE') && CORRUPT_COOKIE == TRUE)
+{
+	$text = "<div style='text-align:center'>".LOGIN_MENU_L7."<br /><br />
+	".$bullet." <a href='".e_BASE."index.php?logout'>".LOGIN_MENU_L8."</a></div>";
+	$ns->tablerender(LOGIN_MENU_L9, $text, 'login');
 }
+$use_imagecode = ($pref['logcode'] && extension_loaded('gd'));
 
-$use_imagecode = ($pref['logcode'] && extension_loaded("gd"));
-if($use_imagecode){
-	require_once(e_HANDLER."secure_img_handler.php");
+if ($use_imagecode)
+{
+	global $sec_img;
+	include_once(e_HANDLER.'secure_img_handler.php');
 	$sec_img = new secure_image;
 }
-
-$sql2 = new db;
-$text = "";
-	if(USER == TRUE || ADMIN == TRUE){
-		if(ADMIN == TRUE){
-			$adminfpage = (!$pref['adminstyle'] || $pref['adminstyle'] == "default" ? "admin.php" : $pref['adminstyle'].".php");
-			$text = ($pref['maintainance_flag']==1 ? "<div style='text-align:center'><strong>".LOGIN_MENU_L10."</strong></div><br />" : "" );
-			$text .= "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_ADMIN.$adminfpage."'>".LOGIN_MENU_L11."</a><br />";
-		}
-		$text .= "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."usersettings.php'>".LOGIN_MENU_L12."</a>\n<br />\n<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."user.php?id.".USERID."'>".LOGIN_MENU_L13."</a>\n<br />\n<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."?logout'>".LOGIN_MENU_L8."</a>";		
-
-		if(!$sql -> db_Select("online", "*", "online_ip='$ip' AND online_user_id='0' ")){
-			$sql -> db_Delete("online", "online_ip='$ip' AND online_user_id='0' ");
-		}
-
-		$new_total = 0;
-		$time = USERLV;
-		$new_news = $sql -> db_Select("news", "*", "news_datestamp>$time  ORDER BY news_datestamp DESC");
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-				if(!check_class($news_class)){
-					$new_news = $new_news - 1;
-				}
+$text = '';
+if (USER == TRUE || ADMIN == TRUE)
+{
+	if (ADMIN == TRUE)
+	{
+		$text = ($pref['maintainance_flag'] == 1 ? '<div style="text-align:center"><strong>'.LOGIN_MENU_L10.'</strong></div><br />' : '' );
+		if (strpos(e_SELF, $ADMIN_DIRECTORY) === FALSE) 
+		{
+			$text .= $bullet.' <a class="login_menu_link" href="'.e_ADMIN_ABS.'admin.php">'.LOGIN_MENU_L11.'</a><br />';
+		}
+		else
+		{
+			$text .= $bullet.' <a class="login_menu_link" href="'.e_BASE.'index.php">'.LOGIN_MENU_L39.'</a><br />';
 		}
-		$new_total = $new_total + $new_news;
-		if(!$new_news){ $new_news = LOGIN_MENU_L26; }	
+			
+	}
+	$text .= $bullet.' <a class="login_menu_link" href="'.e_HTTP.'usersettings.php">'.LOGIN_MENU_L12.'</a>
+	<br />
+	'.$bullet.' <a class="login_menu_link" href="'.e_HTTP.'user.php?id.'.USERID.'">'.LOGIN_MENU_L13.'</a>
+	<br />
+	'.$bullet.' <a class="login_menu_link" href="'.e_HTTP.'index.php?logout">'.LOGIN_MENU_L8.'</a>';
+
+	if (!$sql->db_Select('online', 'online_ip', "`online_ip` = '{$ip}' AND `online_user_id` = '0' "))
+	{
+		$sql->db_Delete('online', "`online_ip` = '{$ip}' AND `online_user_id` = '0' ");
+	}
 
+	$new_total = 0;
+	$time = USERLV;
 
-		$new_articles = 0;
-		$new_articles = $sql -> db_Select("content", "*", "content_datestamp>$time AND content_parent!='0' ORDER BY content_datestamp DESC");
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-				if(!check_class($content_class)){
-					$new_articles = $new_articles - 1;
-				}
-		}
-		$new_total = $new_total + $new_articles;
-		if(!$new_articles){ $new_articles = LOGIN_MENU_L26; }
+		// ------------ News Stats -----------
 
-		$new_comments=0;
-		if($comments = $sql -> db_Select("comments", "*", "comment_datestamp>$time ORDER BY comment_datestamp DESC ")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				switch($comment_type){
-					case 0:	// news
-						$sql2 -> db_Select("news", "*", "news_id=$comment_item_id ");
-						$row = $sql2 -> db_Fetch(); extract($row);
-						if(check_class($news_class)){
-							$new_comments++;
-						}
-					break;
-					case 1:	//	article, review or content page
-						$sql2 -> db_Select("content", "content_heading, content_type, content_class", "content_id=$comment_item_id ");
-						$row = $sql2 -> db_Fetch(); 
-						extract($row);
-						if(check_class($content_class)){
-							$new_comments++;
-						}
-					break;
-					case 2: //	downloads
-						$mp = MPREFIX;
-						$qry = "SELECT download_name, {$mp}download_category.download_category_class FROM {$mp}download LEFT JOIN {$mp}download_category ON {$mp}download.download_category={$mp}download_category.download_category_id WHERE {$mp}download.download_id={$comment_item_id}";
-						$sql2 -> db_Select_gen($qry);
-						$row = $sql2 -> db_Fetch(); 
-						extract($row);
-						if(check_class($download_category_class)){
-							$new_comments++;
-						}
-					break;
-					case 3: //	faq
-						$sql2 -> db_Select("faq", "faq_question", "faq_id=$comment_item_id ");
-						$row = $sql2 -> db_Fetch(); extract($row);
-						$new_comments++;
-					break;
-					case 4:	//	poll comment
-						$sql2 -> db_Select("poll", "*", "poll_id=$comment_item_id ");
-						$row = $sql2 -> db_Fetch(); extract($row);
-						$new_comments++;
-					break;
-					case 6:	//	bugtracker
-						$sql2 -> db_Select("bugtrack", "bugtrack_summary", "bugtrack_id=$comment_item_id ");
-						$row = $sql2 -> db_Fetch(); extract($row);
-						$new_comments++;
-					break;
-				}
+		if (isset($menu_pref['login_menu']) && $menu_pref['login_menu']['new_news'] == true)
+		{
+			$new_news = $sql->db_Count("news", "(*)", "WHERE `news_datestamp` > {$time} AND news_class REGEXP '".e_CLASS_REGEXP."'");
+			$new_total += $new_news;
+			if (!$new_news)
+			{
+				$new_news = LOGIN_MENU_L26;
 			}
+			$NewItems[] = $new_news.' '.($new_news == 1 ? LOGIN_MENU_L14 : LOGIN_MENU_L15);
 		}
-		$handle=opendir(e_PLUGIN);
-			while(false !== ($file = readdir($handle))){
-			if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)){
-				$plugin_handle=opendir(e_PLUGIN.$file."/");
-				while(false !== ($file2 = readdir($plugin_handle))){
-					if($file2 == "e_comment.php"){
-						require_once(e_PLUGIN.$file."/".$file2);
-						if($comment_type == $e_plug_table){
-							$new_comments++;
-							break 2;
+
+		// ------------ Article Stats -----------
+
+		if (isset($menu_pref['login_menu']) && $menu_pref['login_menu']['new_comments'] == true)
+		{
+			$new_comments = 0;
+			$new_comments = $sql->db_Select('comments', '*', '`comment_datestamp` > '.$time);
+
+			$handle = opendir(e_PLUGIN);
+			while (false !== ($file = readdir($handle)))
+			{
+				if ($file != '.' && $file != '..' && is_dir(e_PLUGIN.$file))
+				{
+					$plugin_handle = opendir(e_PLUGIN.$file."/");
+					while (false !== ($file2 = readdir($plugin_handle)))
+					{
+						if ($file2 == 'e_comment.php')
+						{
+							require_once(e_PLUGIN.$file.'/'.$file2);
+							if ($comment_type == $e_plug_table)
+							{
+								$new_comments++;
+								break 2;
+							}
 						}
 					}
 				}
 			}
+			$new_total += $new_comments;
+			if (!$new_comments)
+			{
+				$new_comments = LOGIN_MENU_L26;
+			}
+			$NewItems[] = $new_comments.' '.($new_comments == 1 ? LOGIN_MENU_L18 : LOGIN_MENU_L19);
 		}
-		$new_total = $new_total + $new_comments;
-		if(!$new_comments){ $new_comments = LOGIN_MENU_L26; }
-		$display_chats = TRUE;
-		if($sql -> db_Select("menus", "menu_class", "menu_name='chatbox_menu' AND menu_location!='0'")){
-			list($menus['menu_class']) = $sql -> db_Fetch();
-			if(check_class($menus['menu_class'])){
-				$new_chat = $sql -> db_Count("chatbox", "(*)", "WHERE cb_datestamp>'".$time."' "); $new_total = $new_total + $new_chat;
-			}else{				
+
+		// ------------ Chatbox Stats -----------
+
+		if (isset($menu_pref['login_menu']) && $menu_pref['login_menu']['new_chatbox'] == true) {
+			$display_chats = TRUE;
+
+			if(in_array('chatbox_menu',$eMenuActive)){
+				$new_chat = $sql->db_Count('chatbox', '(*)', 'WHERE `cb_datestamp` > '.$time);
+				$new_total += $new_chat;
+			} else {
 				$display_chats = FALSE;
 			}
-		}else{
-			$display_chats = FALSE; 
-		}
-		if(!$new_chat){ $new_chat = ($display_chats ? LOGIN_MENU_L26 : ""); }
+			if (isset($new_chat) && !$new_chat) {
+				$new_chat = ($display_chats ? LOGIN_MENU_L26 : '');
+			}
+			if ($display_chats == true) {
+				$NewItems[] = $new_chat.' '.($new_chat == 1 ? LOGIN_MENU_L16 : LOGIN_MENU_L17);
 
-		$new_forum = $sql -> db_Select("forum_t", "*", "thread_datestamp>$time ORDER BY thread_datestamp DESC");
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$sql2 -> db_Select("forum", "*", "forum_id=$thread_forum_id");
-			$row = $sql2 -> db_Fetch(); extract($row);
-			if(!check_class($forum_class)){
-				$new_forum = $new_forum - 1;
 			}
 		}
-		$new_total = $new_total + $new_forum;
-		if(!$new_forum){ $new_forum = LOGIN_MENU_L26; }
 
-		$new_users = $sql -> db_Count("user", "(*)", "WHERE user_join>'".$time."' "); $new_total = $new_total + $new_users;
-		if(!$new_users){ $new_users = LOGIN_MENU_L26; }
+		// ------------ Forum Stats -----------
 
-		$text .= "<br /><br />\n<span class='smalltext'>\n".LOGIN_MENU_L25."<br /> 
-		$new_news ".($new_news == 1 ? LOGIN_MENU_L14 : LOGIN_MENU_L15).",<br />";
+		if (isset($menu_pref['login_menu']) && $menu_pref['login_menu']['new_forum'] == true) {
+			$qry = "
+			SELECT  count(*) as count FROM #forum_t  as t
+			LEFT JOIN #forum as f
+			ON t.thread_forum_id = f.forum_id
+			WHERE t.thread_datestamp > {$time} and f.forum_class IN (".USERCLASS_LIST.")
+			";
+			if($sql->db_Select_gen($qry))
+			{
+				$row = $sql->db_Fetch();
+				$new_forum = $row['count'];
+				$new_total += $new_forum;
+			}
+			if (!$new_forum) {
+				$new_forum = LOGIN_MENU_L26;
+			}
+			$NewItems[] = $new_forum.' '.($new_forum == 1 ? LOGIN_MENU_L20 : LOGIN_MENU_L21);
+		}
 
-		$text .= $new_articles ." ".($new_articles == 1 ? LOGIN_MENU_L29 : LOGIN_MENU_L30).",<br />";
+		// ------------ Member Stats -----------
 
-		
-		
-		if($display_chats == TRUE){
-			$text .= $new_chat ." ".($new_chat == 1 ? LOGIN_MENU_L16 : LOGIN_MENU_L17).",<br />";
+		if (isset($menu_pref['login_menu']) && $menu_pref['login_menu']['new_members'] == true) {
+			$new_users = $sql->db_Count('user', '(user_join)', 'WHERE user_join > '.$time);
+			$new_total += $new_users;
+			if (!$new_users) {
+				$new_users = LOGIN_MENU_L26;
+			}
+			$NewItems[] = $new_users.' '.($new_users == 1 ? LOGIN_MENU_L22 : LOGIN_MENU_L23);
 		}
-		$text .= $new_comments ." ".($new_comments == 1 ? LOGIN_MENU_L18 : LOGIN_MENU_L19).",<br />
-		$new_forum ".($new_forum == 1 ? LOGIN_MENU_L20 : LOGIN_MENU_L21).",<br />";
-		$text .= $new_users." ".($new_users == 1 ? LOGIN_MENU_L22 : LOGIN_MENU_L23).".</span>";
-		if($new_total){
-			$text .= "<br /><a href='".e_PLUGIN."list_new/new.php'>".LOGIN_MENU_L24."</a>";
+		if (isset($NewItems) && $NewItems) {
+			$text .= '<br /><br /><span class="smalltext">'.LOGIN_MENU_L25.'<br />'.implode(',<br />', $NewItems).'</span>';
+			if ($new_total) {
+				if ($sql -> db_Select("plugin", "plugin_installflag", "plugin_path='list_new' AND plugin_installflag='1'"))
+				{
+					$text .= '<br /><a href="'.e_PLUGIN.'list_new/list.php?new">'.LOGIN_MENU_L24.'</a>';
+				}
+			}
 		}
-		$caption = (file_exists(THEME."images/login_menu.png") ? "<img src='".THEME."images/login_menu.png' alt='' /> ".LOGIN_MENU_L5." ".USERNAME : LOGIN_MENU_L5." ".USERNAME);
-		$ns -> tablerender($caption, $text);
-	}else{
-		if(LOGINMESSAGE != ""){
-			$text = "<div style='text-align:center'>".LOGINMESSAGE."</div>";
+
+	if (file_exists(THEME.'images/login_menu.png')) {
+		$caption = '<img src="'.THEME_ABS.'images/login_menu.png" alt="" />'.LOGIN_MENU_L5.' '.USERNAME;
+	} else {
+		$caption = LOGIN_MENU_L5.' '.USERNAME;
+	}
+	$ns->tablerender($caption, $text, 'login');
+} else {
+	if (!$LOGIN_MENU_FORM) {
+		if (file_exists(THEME."login_menu_template.php")){
+	   		require_once(THEME."login_menu_template.php");
+		}else{
+			require_once(e_PLUGIN."login_menu/login_menu_template.php");
 		}
-		$text .=  "<div style='text-align:center'>\n<form method='post' action='".e_SELF;
-		if(e_QUERY){
-			$text .= "?".e_QUERY;
+	}
+	if (strpos(e_SELF, $ADMIN_DIRECTORY) === FALSE) 
+	{
+		if (LOGINMESSAGE != '') {
+			$text = '<div style="text-align: center;">'.LOGINMESSAGE.'</div>';
 		}
 
-		$text .= "'><p>\n".LOGIN_MENU_L1."<br />\n
-		<input class='tbox' type='text' name='username' size='15' value='' maxlength='30' />\n
-		<br />\n".LOGIN_MENU_L2."\n<br />\n
-		<input class='tbox' type='password' name='userpass' size='15' value='' maxlength='20' />\n\n<br />\n
-		";
-		if($use_imagecode){
-			$text .= "<input type='hidden' name='rand_num' value='".$sec_img -> random_number."'>";
-			$text .= $sec_img -> r_image();
-			$text .= "<br /><input class='tbox' type='text' name='code_verify' size='15' maxlength='20'><br />";
-		}
-		$text .= "			
-		<input class='button' type='submit' name='userlogin' value='".LOGIN_MENU_L28."' />\n\n
-		<br />\n<input type='checkbox' name='autologin' value='1' /> ".LOGIN_MENU_L6;
+		$text .= '<form method="post" action="'.e_SELF.(e_QUERY ? '?'.e_QUERY : '').'">';
+		$text .= $tp->parseTemplate($LOGIN_MENU_FORM, true, $login_menu_shortcodes);
+		$text .= '</form>';
+	} else {
+		$text = $tp->parseTemplate("<div style='padding-top: 150px'>{LM_FPW_LINK}</div>", true, $login_menu_shortcodes);
+	}
 
-		if($pref['user_reg']){
-			$text .= "<br /><br />";
-			if(!$pref['auth_method'] || $pref['auth_method'] == "e107"){
-				$text .= "[ <a href='".e_BASE.e_SIGNUP."'>".LOGIN_MENU_L3."</a> ]<br />[ <a href='".e_BASE."fpw.php'> ".LOGIN_MENU_L4."</a> ]";
-			}
-		}
-		$text .= "</p>
-		</form>
-		</div>";
-		$caption = (file_exists(THEME."images/login_menu.png") ? "<img src='".THEME."images/login_menu.png' alt='' /> ".LOGIN_MENU_L5 : LOGIN_MENU_L5);
-		$ns -> tablerender($caption, $text);
+
+	if (file_exists(THEME.'images/login_menu.png')) {
+		$caption = '<img src="'.THEME_ABS.'images/login_menu.png" alt="" />'.LOGIN_MENU_L5;
+	} else {
+		$caption = LOGIN_MENU_L5;
 	}
+	$ns->tablerender($caption, $text, 'login');
+}
 
-?>
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/login_menu/login_menu_shortcodes.php 75/e107_plugins/login_menu/login_menu_shortcodes.php
--- 6171/e107_plugins/login_menu/login_menu_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/login_menu/login_menu_shortcodes.php	2006-04-24 14:04:36.000000000 -0500
@@ -0,0 +1,69 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/login_menu/login_menu_shortcodes.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/04/24 19:04:36 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+global $tp;
+$login_menu_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+
+/*
+SC_BEGIN LM_USERNAME_INPUT
+return "<input class='tbox login user' type='text' name='username' size='15' value='' maxlength='30' />\n";
+SC_END
+
+SC_BEGIN LM_PASSWORD_INPUT
+return "<input class='tbox login pass' type='password' name='userpass' size='15' value='' maxlength='20' />\n\n";
+SC_END
+
+SC_BEGIN LM_IMAGECODE
+global $use_imagecode, $sec_img;
+if($use_imagecode)
+{
+	return '<input type="hidden" name="rand_num" value="'.$sec_img->random_number.'" />
+		'.$sec_img->r_image().'
+		<br /><input class="tbox login verify" type="text" name="code_verify" size="15" maxlength="20" /><br />';
+}
+SC_END
+
+SC_BEGIN LM_LOGINBUTTON
+return "<input class='button' type='submit' name='userlogin' value='".LOGIN_MENU_L28."' />";
+SC_END
+
+SC_BEGIN LM_REMEMBERME
+global $pref;
+if($pref['user_tracking'] != "session")
+{
+	return "<br /><input type='checkbox' name='autologin' value='1' checked='checked' />".LOGIN_MENU_L6;
+}
+SC_END
+
+SC_BEGIN LM_SIGNUP_LINK
+global $pref;
+if ($pref['user_reg']) {
+	if (!$pref['auth_method'] || $pref['auth_method'] == 'e107')
+	{
+		return "<a class='login_menu_link' href='".e_SIGNUP."'>".LOGIN_MENU_L3."</a>";
+	}
+}
+SC_END
+
+SC_BEGIN LM_FPW_LINK
+return "<a class='login_menu_link' href='".e_BASE."fpw.php'>".LOGIN_MENU_L4."</a>";
+SC_END
+
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/login_menu/login_menu_template.php 75/e107_plugins/login_menu/login_menu_template.php
--- 6171/e107_plugins/login_menu/login_menu_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/login_menu/login_menu_template.php	2006-01-25 14:17:09.000000000 -0600
@@ -0,0 +1,43 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/login_menu/login_menu_template.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/01/25 20:17:09 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+$sc_style['LM_SIGNUP_LINK']['pre'] = "<br />[ ";
+$sc_style['LM_SIGNUP_LINK']['post'] = " ]";
+if (!isset($LOGIN_MENU_FORM)){
+
+	$LOGIN_MENU_FORM = "
+	<div style='text-align: center'>".
+    LOGIN_MENU_L1."
+	<br />\n
+	{LM_USERNAME_INPUT}
+	<br />".
+	LOGIN_MENU_L2."
+	<br />\n
+    {LM_PASSWORD_INPUT}
+	<br />\n
+  {LM_IMAGECODE}
+	{LM_LOGINBUTTON}
+  {LM_REMEMBERME}
+	<br />
+	{LM_SIGNUP_LINK}
+	<br />
+	[ {LM_FPW_LINK} ]
+	</div>
+	";
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newforumposts_main/admin_config.php 75/e107_plugins/newforumposts_main/admin_config.php
--- 6171/e107_plugins/newforumposts_main/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newforumposts_main/admin_config.php	2005-01-27 13:53:09.000000000 -0600
@@ -0,0 +1,100 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newforumposts_main/admin_config.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/01/27 19:53:09 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+require_once(e_HANDLER."userclass_class.php");
+	
+$lan_file = e_PLUGIN."newforumposts_main/languages/".e_LANGUAGE.".php";
+if (file_exists($lan_file)) {
+	require_once($lan_file);
+} else {
+	require_once(e_PLUGIN."newforumposts_main/languages/English.php");
+}
+if (!getperms("1")) {
+	header("location:".e_BASE."index.php");
+	 exit ;
+}
+require_once(e_ADMIN."auth.php");
+	
+if (isset($_POST['updatesettings'])) {
+	$pref['nfp_display'] = $_POST['nfp_display'];
+	$pref['nfp_caption'] = $_POST['nfp_caption'];
+	$pref['nfp_amount'] = $_POST['nfp_amount'];
+	$pref['nfp_layer'] = $_POST['nfp_layer'];
+	$pref['nfp_posts'] = $_POST['nfp_posts'];
+	$pref['nfp_layer_height'] = ($_POST['nfp_layer_height'] ? $_POST['nfp_layer_height'] : 200);
+	save_prefs();
+	$message = "".NFPM_L14."";
+}
+	
+if ($message) {
+	$ns->tablerender("", "<div style='text-align:center'><b>$message</b></div>");
+}
+	
+	
+	
+$text = "<div style='text-align:center'>
+	<form method='post' action='".e_SELF."?".e_QUERY."' id='menu_conf_form'>
+	<table style='width:85%' class='fborder'>
+	 
+	<tr>
+	<td style='width:40%' class='forumheader3'>".NFPM_L4."</td>
+	<td style='width:60%' class='forumheader3'>
+	<select class='tbox' name='nfp_display'>" .($pref['nfp_display'] == "0" ? "<option value='0' selected='selected'>".NFPM_L5."</option>" : "<option value='0'>".NFPM_L5."</option>")
+.($pref['nfp_display'] == "1" ? "<option value='1' selected='selected'>".NFPM_L6."</option>" : "<option value='1'>".NFPM_L6."</option>")
+.($pref['nfp_display'] == "2" ? "<option value='2' selected='selected'>".NFPM_L7."</option>" : "<option value='2'>".NFPM_L7."</option>")
+."</select>
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:40%' class='forumheader3'>".NFPM_L8.": </td>
+	<td style='width:60%' class='forumheader3'>
+	<input class='tbox' type='text' name='nfp_caption' size='20' value='".$pref['nfp_caption']."' maxlength='100' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td style='width:40%' class='forumheader3'>".NFPM_L9.": </td>
+	<td style='width:60%' class='forumheader3'>
+	<input class='tbox' type='text' name='nfp_amount' size='6' value='".$pref['nfp_amount']."' maxlength='3' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td class='forumheader3' style='width:40%'>".NFPM_L15." </td>
+	<td class='forumheader3' style='width:60%'>". ($pref['nfp_posts'] ? "<input type='checkbox' name='nfp_posts' value='1' checked='checked' />" : "<input type='checkbox' name='nfp_posts' value='1' />")."
+	</td>
+	</tr>
+	 
+	<tr>
+	<td class='forumheader3' style='width:40%'>".NFPM_L10.": </td>
+	<td class='forumheader3' style='width:60%'>". ($pref['nfp_layer'] ? "<input type='checkbox' name='nfp_layer' value='1' checked='checked' />" : "<input type='checkbox' name='nfp_layer' value='1' />")."&nbsp;&nbsp;".NFPM_L11.": <input class='tbox' type='text' name='nfp_layer_height' size='8' value='".$pref['nfp_layer_height']."' maxlength='3' />
+	</td>
+	</tr>
+	 
+	<tr>
+	<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='updatesettings' value='".NFPM_L13."' /></td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+$ns->tablerender(NFPM_L12, $text);
+	
+require_once(e_ADMIN."footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newforumposts_main/config.php 75/e107_plugins/newforumposts_main/config.php
--- 6171/e107_plugins/newforumposts_main/config.php	2004-07-16 12:43:14.000000000 -0500
+++ 75/e107_plugins/newforumposts_main/config.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,98 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /admin/menu_conf/articles_conf.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|        Based on code by Edwin van der Wal (evdwal@xs4all.nl)
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-require_once(e_HANDLER."userclass_class.php");
-
-$lan_file=e_PLUGIN."newforumposts_main/languages/".e_LANGUAGE.".php";
-if(file_exists($lan_file)){
-        require_once($lan_file);
-} else {
-        require_once(e_PLUGIN."newforumposts_main/languages/English.php");
-}
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
-require_once(e_ADMIN."auth.php");
-
-if(IsSet($_POST['updatesettings'])){
-        $pref['nfp_display'] = $_POST['nfp_display'];
-        $pref['nfp_caption'] = $_POST['nfp_caption'];
-        $pref['nfp_amount'] = $_POST['nfp_amount'];
-        $pref['nfp_layer'] = $_POST['nfp_layer'];
-        $pref['nfp_posts'] = $_POST['nfp_posts'];
-        $pref['nfp_layer_height'] = ($_POST['nfp_layer_height'] ? $_POST['nfp_layer_height'] : 200);
-        save_prefs();
-        $message = "".NFPM_L14."";
-}
-
-if($message){
-        $ns -> tablerender("", "<div style='text-align:center'><b>$message</b></div>");
-}
-
-
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."' id='menu_conf_form'>
-<table style='width:85%' class='fborder'>
-
-<tr>
-<td style='width:40%' class='forumheader3'>".NFPM_L4."</td>
-<td style='width:60%' class='forumheader3'>
-<select class='tbox' name='nfp_display'>"
-.($pref['nfp_display'] == "0" ? "<option value='0' selected='selected'>".NFPM_L5."</option>" : "<option value='0'>".NFPM_L5."</option>")
-.($pref['nfp_display'] == "1" ? "<option value='1' selected='selected'>".NFPM_L6."</option>" : "<option value='1'>".NFPM_L6."</option>")
-.($pref['nfp_display'] == "2" ? "<option value='2' selected='selected'>".NFPM_L7."</option>" : "<option value='2'>".NFPM_L7."</option>")
-."</select>
-</td>
-</tr>
-
-<tr>
-<td style='width:40%' class='forumheader3'>".NFPM_L8.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='nfp_caption' size='20' value='".$pref['nfp_caption']."' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td style='width:40%' class='forumheader3'>".NFPM_L9.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='nfp_amount' size='6' value='".$pref['nfp_amount']."' maxlength='3' />
-</td>
-</tr>
-
-<tr>
-<td class='forumheader3' style='width:40%'>".NFPM_L15." </td>
-<td class='forumheader3' style='width:60%'>".
-($pref['nfp_posts'] ? "<input type='checkbox' name='nfp_posts' value='1' checked='checked' />" : "<input type='checkbox' name='nfp_posts' value='1' />")."
-</td>
-</tr>
-
-<tr>
-<td class='forumheader3' style='width:40%'>".NFPM_L10.": </td>
-<td class='forumheader3' style='width:60%'>".
-($pref['nfp_layer'] ? "<input type='checkbox' name='nfp_layer' value='1' checked='checked' />" : "<input type='checkbox' name='nfp_layer' value='1' />")."&nbsp;&nbsp;".NFPM_L11.": <input class='tbox' type='text' name='nfp_layer_height' size='8' value='".$pref['nfp_layer_height']."' maxlength='3' />
-</td>
-</tr>
-
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='updatesettings' value='".NFPM_L13."' /></td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender(NFPM_L12, $text);
-
-require_once(e_ADMIN."footer.php");
-?>
\ No newline at end of file
Files 6171/e107_plugins/newforumposts_main/images/logo.png and 75/e107_plugins/newforumposts_main/images/logo.png differ
Files 6171/e107_plugins/newforumposts_main/images/new_forum_16.png and 75/e107_plugins/newforumposts_main/images/new_forum_16.png differ
Files 6171/e107_plugins/newforumposts_main/images/new_forum_32.png and 75/e107_plugins/newforumposts_main/images/new_forum_32.png differ
diff -ruN 6171/e107_plugins/newforumposts_main/languages/English.php 75/e107_plugins/newforumposts_main/languages/English.php
--- 6171/e107_plugins/newforumposts_main/languages/English.php	2004-04-27 15:50:36.000000000 -0500
+++ 75/e107_plugins/newforumposts_main/languages/English.php	2006-01-13 07:27:21.000000000 -0600
@@ -1,27 +1,29 @@
-<?php
-
-define("LAN_1", "Thread");
-define("LAN_2", "Poster");
-define("LAN_3", "Views");
-define("LAN_4", "Replies");
-define("LAN_5", "Lastpost");
-define("LAN_6", "Threads");
-
-define("NFPM_L1", "This plugin displays a list of new forum posts on your front page");
-define("NFPM_L2", "Latest Forum Posts"); 
-define("NFPM_L3", "To configure please click on the link in the plugins section of the admin front page");
-define("NFPM_L4", "Activate in which area?");
-define("NFPM_L5", "Inactive");
-define("NFPM_L6", "Top of page");
-define("NFPM_L7", "Bottom of page");
-define("NFPM_L8", "Caption");
-define("NFPM_L9", "Number of new posts to display?");
-define("NFPM_L10", "Display inside scrolling layer?");
-define("NFPM_L11", "Layer height");
-define("NFPM_L12", "New Forum Posts Configuration");
-define("NFPM_L13", "Update New Forum Posts Settings");
-define("NFPM_L14", "New Forum Posts settings updated.");
-define("NFPM_L15", "Check to display latest forum posts.<br />Default is latest topics.");
-
-
+<?php
+	
+define("NFPM_LAN_1", "Thread");
+define("NFPM_LAN_2", "Poster");
+define("NFPM_LAN_3", "Views");
+define("NFPM_LAN_4", "Replies");
+define("NFPM_LAN_5", "Lastpost");
+define("NFPM_LAN_6", "Threads");
+define("NFPM_LAN_7", "by");
+	
+define("NFPM_L1", "This plugin displays a list of new forum posts on your front page");
+define("NFPM_L2", "Latest Forum Posts");
+define("NFPM_L3", "To configure please click on the link in the plugins section of the admin front page");
+define("NFPM_L4", "Activate in which area?");
+define("NFPM_L5", "Inactive");
+define("NFPM_L6", "Top of page");
+define("NFPM_L7", "Bottom of page");
+define("NFPM_L8", "Caption");
+define("NFPM_L9", "Number of new posts to display?");
+define("NFPM_L10", "Display inside scrolling layer?");
+define("NFPM_L11", "Layer height");
+define("NFPM_L12", "New Forum Posts Configuration");
+define("NFPM_L13", "Update New Forum Posts Settings");
+define("NFPM_L14", "New Forum Posts settings updated.");
+define("NFPM_L15", "Check to display latest forum posts.<br />Default is latest topics.");
+define('NFPM_L16', '[user deleted]');
+	
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newforumposts_main/newforumposts_main.php 75/e107_plugins/newforumposts_main/newforumposts_main.php
--- 6171/e107_plugins/newforumposts_main/newforumposts_main.php	2004-06-12 14:59:48.000000000 -0500
+++ 75/e107_plugins/newforumposts_main/newforumposts_main.php	2006-03-16 15:01:44.000000000 -0600
@@ -1,94 +1,152 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/article.php
-|
-|	Steve Dunstan 2001-2002
-|	http://jalist.com
-|	stevedunstan@jalist.com
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-require_once(e_HANDLER."userclass_class.php");
-$query = ($pref['nfp_posts'] ? "thread_lastpost" : "thread_datestamp");
-$lan_file=e_PLUGIN."newforumposts_main/languages/".e_LANGUAGE.".php";
-if(file_exists($lan_file)){
-	require_once($lan_file);
-} else {
-	require_once(e_PLUGIN."newforumposts_main/languages/English.php");
-}
-$results = $sql -> db_Select_gen("SELECT * FROM ".MPREFIX."forum_t, ".MPREFIX."forum WHERE ".MPREFIX."forum.forum_id=".MPREFIX."forum_t.thread_forum_id AND ".MPREFIX."forum_t.thread_parent=0 ORDER BY ".MPREFIX."forum_t.$query DESC LIMIT 0, ".$pref['nfp_amount']);
-	$text = "<div style='text-align:center'>\n<table style='width:auto' class='fborder'>\n";
-	if(!is_object($sql2)){
-		$sql2 = new db;
-	}
-	if(!is_object($gen)){
-		$gen = new convert;
-	}
-
-	$text .= "<tr>
-		<td style='width:5%' class='forumheader'>&nbsp;</td>
-		<td style='width:45%' class='forumheader'>".LAN_1."</td>
-		<td style='width:15%; text-align:center' class='forumheader'>".LAN_2."</td>
-		<td style='width:5%; text-align:center' class='forumheader'>".LAN_3."</td>
-		<td style='width:5%; text-align:center' class='forumheader'>".LAN_4."</td>
-		<td style='width:25%; text-align:center' class='forumheader'>".LAN_5."</td>
-		</tr>\n";
-
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		if(check_class($forum_class)){
-			$sql2 -> db_Select("forum_t", "*", "thread_parent='$thread_id' ORDER BY $query DESC");
-			list($null, $null, $null, $null, $r_datestamp, $null, $r_user) = $sql2 -> db_Fetch();
-			$r_id = substr($r_user, 0, strpos($r_user, "."));
-			$r_name = substr($r_user, (strpos($r_user, ".")+1));
-
-			if(strstr($r_name, chr(1))){
-				$tmp = explode(chr(1), $r_name);
-				$r_name = $tmp[0];
-			}
-
-			$r_datestamp = $gen->convert_date($r_datestamp, "forum");
-
-			$post_author_id = substr($thread_user, 0, strpos($thread_user, "."));
-			$post_author_name = substr($thread_user, (strpos($thread_user, ".")+1));
-			if(strstr($post_author_name, chr(1))){ 
-				$tmp = explode(chr(1), $post_author_name); 
-				$post_author_name = $tmp[0];
-			}
-
-			$replies = $sql2 -> db_Select("forum_t", "*", "thread_parent=$thread_id");
-
-			$text .= "<tr>
-			<td style='width:5%; text-align:center' class='forumheader3'><img src='".e_IMAGE."forum/new_small.png' alt='' /></td>
-			<td style='width:45%' class='forumheader3'><b><a href='".e_BASE."forum_viewtopic.php?$forum_id.$thread_id'>$thread_name</a></b> <span class='smalltext'>(<a href='".e_BASE."forum_viewforum.php?$forum_id'>$forum_name</a>)</span></td>
-			<td style='width:15%; text-align:center' class='forumheader3'>".(USER ? "<a href='".e_BASE."user.php?id.$post_author_id'>" : "")."$post_author_name".(USER ? "</a>" :"")."</td>
-			<td style='width:5%; text-align:center' class='forumheader3'>$thread_views</td>
-			<td style='width:5%; text-align:center' class='forumheader3'>$replies</td>
-			<td style='width:25%; text-align:center' class='forumheader3'>".($replies ? "<b>".(USER ? "<a href='".e_BASE."user.php?id.$r_id'>" : "")."$r_name".(USER ? "</a>" : "")."</b><br /><span class='smalltext'>$r_datestamp</span>" : "-")."</td>
-			</tr>\n";
-		}else{
-			$results --;
-		}
-	}
-
-	$total_topics = $sql -> db_Count("forum_t", "(*)", " WHERE thread_parent='0' ");
-	$total_replies = $sql -> db_Count("forum_t", "(*)", " WHERE thread_parent!='0' ");
-	$total_views = $sql -> db_Count("SELECT sum(thread_views) FROM ".MPREFIX."forum_t", "generic");
-
-	$text .= "<tr>\n<td colspan='6' style='text-align:center' class='forumheader2'>
-	<span class='smalltext'>".LAN_6.": <b>$total_topics</b> | ".LAN_4.": <b>$total_replies</b> | ".LAN_3.": <b>$total_views</b></span>
-	</td>\n</tr>\n";
-
-	$text .= "</table>\n</div>";
-
-
-	$text = ($pref['nfp_layer'] ? "<div style='border : 0; padding : 4px; width : auto; height : ".$pref['nfp_layer_height']."px; overflow : auto; '>".$text."</div>" : $text);
-if($results){
-	$ns -> tablerender($pref['nfp_caption'], $text, "nfp");
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newforumposts_main/newforumposts_main.php,v $
+|     $Revision: 1.22 $
+|     $Date: 2006/03/16 21:01:44 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+require_once(e_HANDLER."userclass_class.php");
+$query = ($pref['nfp_posts'] ? "thread_lastpost" : "thread_datestamp");
+$lan_file = e_PLUGIN."newforumposts_main/languages/".e_LANGUAGE.".php";
+$path = e_PLUGIN."forum/";
+include_once((file_exists($lan_file) ? $lan_file : e_PLUGIN."newforumposts_main/languages/English.php"));
+global $sql, $ns;
+// get template ...
+	
+if (file_exists(THEME."newforumpost.php")) {
+	require_once(THEME."newforumpost.php");
+}
+else if(!$NEWFORUMPOSTSTYLE_HEADER) {
+	// no template found - use default ...
+	$NEWFORUMPOSTSTYLE_HEADER = "
+		<!-- newforumposts -->
+		<div style='text-align:center'>\n<table style='width:auto' class='fborder'>
+		<tr>
+		<td style='width:5%' class='forumheader'>&nbsp;</td>
+		<td style='width:45%' class='forumheader'>".NFPM_LAN_1."</td>
+		<td style='width:15%; text-align:center' class='forumheader'>".NFPM_LAN_2."</td>
+		<td style='width:5%; text-align:center' class='forumheader'>".NFPM_LAN_3."</td>
+		<td style='width:5%; text-align:center' class='forumheader'>".NFPM_LAN_4."</td>
+		<td style='width:25%; text-align:center' class='forumheader'>".NFPM_LAN_5."</td>
+		</tr>\n";
+	 
+	$NEWFORUMPOSTSTYLE_MAIN = "
+		<tr>
+		<td style='width:5%; text-align:center' class='forumheader3'>{ICON}</td>
+		<td style='width:45%' class='forumheader3'><b>{THREAD}</b> <span class='smalltext'>({FORUM})</span></td>
+		<td style='width:15%; text-align:center' class='forumheader3'>{POSTER}</td>
+		<td style='width:5%; text-align:center' class='forumheader3'>{VIEWS}</td>
+		<td style='width:5%; text-align:center' class='forumheader3'>{REPLIES}</td>
+		<td style='width:25%; text-align:center' class='forumheader3'>{LASTPOST}<br /><span class='smalltext'>{LASTPOSTDATE}</span></td>
+		</tr>\n";
+	 
+	$NEWFORUMPOSTSTYLE_FOOTER = "<tr>\n<td colspan='6' style='text-align:center' class='forumheader2'>
+		<span class='smalltext'>".NFPM_LAN_6.": <b>{TOTAL_TOPICS}</b> | ".NFPM_LAN_4.": <b>{TOTAL_REPLIES}</b> | ".NFPM_LAN_3.": <b>{TOTAL_VIEWS}</b></span>\n</td>\n</tr>\n</table>\n</div>";
+	 
+}
+
+$results = $sql->db_Select_gen("
+SELECT t.thread_id, t.thread_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class, lp.user_name AS lp_name
+FROM #forum_t AS t
+LEFT JOIN #user AS u ON FLOOR(t.thread_user) = u.user_id
+LEFT JOIN #user AS lp ON FLOOR(t.thread_lastuser) = lp.user_id  
+LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
+LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id 
+WHERE f.forum_id = t.thread_forum_id AND t.thread_parent=0 AND f.forum_class IN (".USERCLASS_LIST.") 
+AND fp.forum_class IN (".USERCLASS_LIST.")
+ORDER BY t.$query DESC LIMIT 0, ".$pref['nfp_amount']);
+
+$forumArray = $sql->db_getList();
+	
+if (!is_object($gen)) {
+	$gen = new convert;
+}
+	
+$ICON = "<img src='".e_PLUGIN."forum/images/".IMODE."/new_small.png' alt='' />";
+$TOTAL_TOPICS = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent='0' ");
+$TOTAL_REPLIES = $sql->db_Count("forum_t", "(*)", " WHERE thread_parent!='0' ");
+$sql->db_Select_gen("SELECT sum(thread_views) FROM ".MPREFIX."forum_t");
+$tmp = $sql->db_Fetch();
+$TOTAL_VIEWS = $tmp[0];
+$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER);
+
+foreach($forumArray as $forumInfo)
+{
+	extract($forumInfo);
+
+	$r_datestamp = $gen->convert_date($thread_lastpost, "forum");
+	if($thread_total_replies)
+	{
+		$tmp = explode(".", $thread_lastuser, 2);
+		if($lp_name)
+		{
+			$LASTPOST = "<a href='".e_BASE."user.php?id.{$tmp[0]}'>$lp_name</a>";
+		}
+		else
+		{
+			if($tmp[1])
+			{
+				$LASTPOST = $tmp[1];
+			}
+			else
+			{
+				$LASTPOST = NFPM_L16;
+			}
+		}
+		$LASTPOSTDATE = "<span class='smalltext'>$r_datestamp</span>";
+	}
+	else
+	{
+		$LASTPOST = " - ";
+		$LASTPOSTDATE = "";
+	}
+		
+	$x = explode(chr(1), $thread_user);
+	$tmp = explode(".", $x[0], 2);
+	if($user_name)
+	{
+		$POSTER = "<a href='".e_BASE."user.php?id.{$tmp[0]}'>$user_name</a>";
+	}
+	else
+	{
+		if($tmp[1])
+		{
+			$POSTER = $tmp[1];
+		}
+		else
+		{
+			$POSTER = NFPM_L16;
+		}
+	}
+
+	$THREAD = "<a href='".$path."forum_viewtopic.php?{$thread_id}.last'>$thread_name</a>";
+	$FORUM = "<a href='".$path."forum_viewforum.php?{$forum_id}'>$forum_name</a>";
+	 
+	$VIEWS = $thread_views;
+	$REPLIES = $thread_total_replies;
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_MAIN);
+	 
+}
+$text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_FOOTER);
+	
+$text = ($pref['nfp_layer'] ? "<div style='border : 0; padding : 4px; width : auto; height : ".$pref['nfp_layer_height']."px; overflow : auto; '>".$text."</div>" : $text);
+
+if ($results)
+{
+	$ns->tablerender($pref['nfp_caption'], $text, "nfp");
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newforumposts_main/plugin.php 75/e107_plugins/newforumposts_main/plugin.php
--- 6171/e107_plugins/newforumposts_main/plugin.php	2004-03-03 12:23:52.000000000 -0600
+++ 75/e107_plugins/newforumposts_main/plugin.php	2005-12-14 13:28:44.000000000 -0600
@@ -1,78 +1,85 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        code adapted from original by Lolo Irie (lolo@touchatou.com)
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-// Plugin info -------------------------------------------------------------------------------------------------------
-$eplug_name = "New Forum Posts";
-$eplug_version = "1";
-$eplug_author = "jalist";
-$eplug_logo = "button.png";
-$eplug_url = "http://e107.org";
-$eplug_email = "jalist@e107.org";
-$eplug_description = "This plugin displays a list of new forum posts on your front page";
-$eplug_compatible = "e107v6";
-$eplug_readme = "";        // leave blank if no readme file
-
-// Name of the plugin's folder -------------------------------------------------------------------------------------
-$eplug_folder = "newforumposts_main";
-
-// Mane of menu item for plugin ----------------------------------------------------------------------------------
-$eplug_menu_name = "newforumposts_main";
-
-// Name of the admin configuration file --------------------------------------------------------------------------
-$eplug_conffile = "config.php";
-
-// Icon image and caption text ------------------------------------------------------------------------------------
-$eplug_icon = $eplug_folder."/images/logo.png";
-$eplug_caption =  "Configure New Forum Posts";
-
-// List of preferences -----------------------------------------------------------------------------------------------
-$eplug_prefs = array(
-        "nfp_display" => 0, 
-		"nfp_caption" => "Latest Forum Posts", 
-		"nfp_amount" => 5, 
-);
-
-// List of table names -----------------------------------------------------------------------------------------------
-$eplug_table_names = "";
-
-// List of sql requests to create tables -----------------------------------------------------------------------------
-$eplug_tables = "";
-
-
-// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
-$eplug_link = FALSE;
-$eplug_link_name = "";
-$ec_dir = e_PLUGIN."";
-$eplug_link_url = "";
-
-
-// Text to display after plugin successfully installed ------------------------------------------------------------------
-$eplug_done = "To configure please click on the link in the plugins section of the admin front page";
-
-
-// upgrading ... //
-
-$upgrade_add_prefs = "";
-
-$upgrade_remove_prefs = "";
-
-$upgrade_alter_tables = "";
-
-$eplug_upgrade_done = "";
-
-
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newforumposts_main/plugin.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = "New Forum Posts";
+$eplug_version = "1";
+$eplug_author = "jalist";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = "This plugin displays a list of new forum posts on your front page";
+$eplug_compatible = "e107v6";
+$eplug_readme = "";
+// leave blank if no readme file
+	
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "newforumposts_main";
+	
+// Mane of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "newforumposts_main";
+	
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+	
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/new_forum_32.png";
+$eplug_icon_small = $eplug_folder."/images/new_forum_16.png";
+$eplug_caption = "Configure New Forum Posts";
+	
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array(
+"nfp_display" => 0,
+	"nfp_caption" => "Latest Forum Posts",
+	"nfp_amount" => 5,
+	);
+	
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = "";
+	
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = "";
+	
+	
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$ec_dir = e_PLUGIN."";
+$eplug_link_url = "";
+	
+	
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = "To configure please click on the link in the plugins section of the admin front page";
+	
+	
+// upgrading ... //
+	
+$upgrade_add_prefs = "";
+	
+$upgrade_remove_prefs = "";
+	
+$upgrade_alter_tables = "";
+	
+$eplug_upgrade_done = "";
+	
+	
+	
+	
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newforumposts_menu/config.php 75/e107_plugins/newforumposts_menu/config.php
--- 6171/e107_plugins/newforumposts_menu/config.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/newforumposts_menu/config.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|        Based on code by Edwin van der Wal (evdwal@xs4all.nl)
-|        $Id: config.php,v 1.2 2004/09/03 18:32:11 e107coders Exp $
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
-require_once(e_ADMIN."auth.php");
-
-$lan_file = e_PLUGIN."newforumposts_menu/languages/".e_LANGUAGE.".php";
-require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."newforumposts_menu/languages/English.php");
-
-
-if(IsSet($_POST['update_menu'])){
-        while(list($key, $value) = each($_POST)){
-                if($value != NFP_9){ $menu_pref[$key] = $value; }
-        }
-        if(!$_POST['newforumposts_title']){ $menu_pref['newforumposts_title'] = 0; }
-        $tmp = addslashes(serialize($menu_pref));
-        $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
-        $ns -> tablerender("", "<div style=\"text-align:center\"><b>".NFP_3."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method=\"post\" action=\"".e_SELF."?".e_QUERY."\" name=\"menu_conf_form\">
-<table style=\"width:85%\" class=\"fborder\">
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".NFP_4.": </td>
-<td style=\"width:60%\" class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"newforumposts_caption\" size=\"20\" value=\"".$menu_pref['newforumposts_caption']."\" maxlength=\"100\" />
-</td>
-</tr>
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".NFP_5.":
-</td>
-<td style=\"width:60%\" class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"newforumposts_display\" size=\"20\" value=\"".$menu_pref['newforumposts_display']."\" maxlength=\"2\" />
-</td>
-</tr>
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".NFP_6.": </td>
-<td style=\"width:60%\" class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"newforumposts_characters\" size=\"20\" value=\"".$menu_pref['newforumposts_characters']."\" maxlength=\"4\" />
-</td>
-</tr>
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".NFP_7.":
-</td>
-<td style=\"width:60%\" class='forumheader3'>
-<input class=\"tbox\" type=\"text\" name=\"newforumposts_postfix\" size=\"30\" value=\"".$menu_pref['newforumposts_postfix']."\" maxlength=\"200\" />
-</td>
-</tr>
-
-<tr>
-<td style=\"width:40%\" class='forumheader3'>".NFP_8.":</td>
-<td style=\"width:60%\" class='forumheader3'>
-<input type=\"checkbox\" name=\"newforumposts_title\" value=\"1\" ";
-if ($menu_pref['newforumposts_title']) {
-        $text .= " checked ";
-}
-$text .= "
-</td>
-</tr>
-
-<tr style=\"vertical-align:top\">
-<td colspan=\"2\"  style=\"text-align:center\" class='forumheader'>
-<input class=\"button\" type=\"submit\" name=\"update_menu\" value=\"".NFP_9."\" />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender(NFP_10, $text);
-require_once(e_ADMIN."footer.php");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newforumposts_menu/languages/English.php 75/e107_plugins/newforumposts_menu/languages/English.php
--- 6171/e107_plugins/newforumposts_menu/languages/English.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/newforumposts_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,35 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/e107_plugins/newforumposts_menu/languages/English.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/03 18:32:12 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-
-define("NFP_1", "All latest posts are outside of your user class, unable to display.");
-define("NFP_2", "No posts yet");
-define("NFP_3", "New Forum Posts menu configuration saved");
-define("NFP_4", "Caption");
-define("NFP_5", "Number of posts to display?");
-define("NFP_6", "Number of characters to display?");
-define("NFP_7", "Postfix for too long posts?");
-define("NFP_8", "Show original topics in menu?");
-define("NFP_9", "Update menu Settings");
-define("NFP_10", "New Forum Posts Menu Configuration");
-
-
-
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newforumposts_menu/newforumposts_menu.php 75/e107_plugins/newforumposts_menu/newforumposts_menu.php
--- 6171/e107_plugins/newforumposts_menu/newforumposts_menu.php	2004-06-12 14:59:50.000000000 -0500
+++ 75/e107_plugins/newforumposts_menu/newforumposts_menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-if(!is_object($aj)){ $aj = new textparse; }
-if($cache = retrieve_cache("newforumposts")){
-	$text = $aj -> formtparev($cache); 
-}else{
-	$gen = new convert;
-	$sql2 = new db;
-	$text = "<span class='smalltext'>";
-	if(!$results = $sql -> db_Select_gen("SELECT * FROM ".MPREFIX."forum_t, ".MPREFIX."forum WHERE ".MPREFIX."forum.forum_id=".MPREFIX."forum_t.thread_forum_id ORDER BY ".MPREFIX."forum_t.thread_datestamp DESC LIMIT 0, ".$menu_pref['newforumposts_display'])){
-		$text = "<span class='mediumtext'>".NFP_2;
-	}else{
-		while($row = $sql-> db_Fetch()){
-			extract($row);
-			if(check_class($forum_class)){
-				$poster = substr($thread_user, (strpos($thread_user, ".")+1));
-				if(strstr($poster, chr(1))){
-					$tmp = explode(chr(1), $poster);
-					$poster = $tmp[0];
-				}
-				$datestamp = $gen->convert_date($thread_datestamp, "short");
-			
-				if($thread_parent){
-
-					if($cachevar[$thread_parent]){
-						$thread_name = $cachevar[$thread_parent];
-					}else{
-						$tmp = $thread_parent;
-						$sql2 -> db_Select("forum_t", "thread_name", "thread_id = $thread_parent");
-						list($thread_name) = $sql2 -> db_Fetch();
-						$cachevar[$thread_parent] = $thread_name;
-					}
-					$topic = "[re: <i>$thread_name</i>]";
-				}else{
-					$tmp = $thread_id;
-					$topic = "[thread: <i>$thread_name</i>]";
-				}
-
-				$thread_thread = $aj -> tpa($thread_thread);
-
-				if($pref['cb_linkreplace']){
-					$thread_thread .= " ";
-					$thread_thread = preg_replace("#\>(.*?)\</a\>[\s]#si", ">".$pref['cb_linkc']."</a> ", $thread_thread);
-					$thread_thread = $aj -> tpa(strip_tags($thread_thread));
-				}
-
-				if(!eregi("<a href|<img|&#", $thread_thread)){
-					$message_array = explode(" ", $thread_thread);
-					for($i=0; $i<=(count($message_array)-1); $i++){
-						if(strlen($message_array[$i]) > 20){
-							$message_array[$i] = preg_replace("/([^\s]{20})/", "$1<br />", $message_array[$i]);
-						}
-					}
-					$thread_thread = implode(" ",$message_array);
-				}
-				if(strlen($thread_thread) > $menu_pref['newforumposts_characters']) {
-					$thread_thread = substr($thread_thread, 0, $menu_pref['newforumposts_characters']).$menu_pref['newforumposts_postfix'];
-				}
-
-				$text .= "<img src='".THEME."images/bullet2.gif' alt='' /> <a href='".e_BASE."forum_viewtopic.php?$thread_forum_id.$tmp'><b>".$poster."</b> on ".$datestamp."</a><br/>";
-				if($menu_pref['newforumposts_title']) {
-					$text .= $topic."<br />";
-				}
-				$text .= $thread_thread."<br /><br />";
-			}else{
-				$results -- ;
-			}
-		}
-	}
-	$text = "</span>".preg_replace("/\<br \/\>$/", "", $text);
-	if($pref['cachestatus']){
-		$cache = $aj -> formtpa($text, "admin");
-		set_cache("newforumposts",$cache);
-	}
-}
-if($results){
-	$ns -> tablerender($menu_pref['newforumposts_caption'], $text);
-}
-?>
diff -ruN 6171/e107_plugins/newsfeed/admin_config.php 75/e107_plugins/newsfeed/admin_config.php
--- 6171/e107_plugins/newsfeed/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/admin_config.php	2006-04-14 09:09:53.000000000 -0500
@@ -0,0 +1,211 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/admin_config.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/04/14 14:09:53 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if (!getperms("E")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+
+require_once(e_ADMIN."auth.php");
+
+if (e_QUERY) {
+	list($action, $id) = explode(".", e_QUERY);
+}
+else
+{
+	$action = FALSE;
+	$id = FALSE;
+}
+
+if(isset($_POST['createFeed']))
+{
+	if ($_POST['newsfeed_url'] && $_POST['newsfeed_name']) {
+		$name = $tp -> toDB($_POST['newsfeed_name']);
+		$description = $tp -> toDB($_POST['newsfeed_description']);
+		$imgfield = $_POST['newsfeed_image']."::".$_POST['newsfeed_showmenu']."::".$_POST['newsfeed_showmain'];
+		$sql->db_Insert("newsfeed", "0, '$name', '".$_POST['newsfeed_url']."', '', '0', '{$description}', '{$imgfield}', ".$_POST['newsfeed_active'].", ".$_POST['newsfeed_updateint']." ");
+		$message = NFLAN_23;
+	} else {
+		$message = NFLAN_24;
+	}
+}
+
+if(isset($_POST['updateFeed']))
+{
+	$name = $tp -> toDB($_POST['newsfeed_name']);
+	$description = $tp -> toDB($_POST['newsfeed_description']);
+	$imgfield = $_POST['newsfeed_image']."::".$_POST['newsfeed_showmenu']."::".$_POST['newsfeed_showmain'];
+	$sql->db_Update("newsfeed", "newsfeed_name='{$name}', newsfeed_url='".$_POST['newsfeed_url']."', newsfeed_timestamp='0', newsfeed_image='{$imgfield}', newsfeed_description='{$description}', newsfeed_active=".$_POST['newsfeed_active'].", newsfeed_updateint=".$_POST['newsfeed_updateint']." WHERE newsfeed_id=".$_POST['newsfeed_id']);
+	$message = NFLAN_25;
+}
+
+if($action == "delete") {
+	$sql->db_Delete("newsfeed", "newsfeed_id=$id");
+	$message = NFLAN_40;
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+
+if($headline_total = $sql->db_Select("newsfeed"))
+{
+	$nfArray = $sql -> db_getList();
+
+	$text = "<div style='text-align:center'>
+	<table class='fborder' style='".ADMIN_WIDTH.";'>
+	<tr>
+	<td class='forumheader' style='width: 5%; text-align: center;'>ID</td>
+	<td class='forumheader' style='width: 50%;'>".NFLAN_30."</td>
+	<td class='forumheader' style='width: 10%; text-align: center;'>".NFLAN_26."</td>
+	<td class='forumheader' style='width: 25%; text-align: center;'>".NFLAN_12."</td>
+	<td class='forumheader' style='width: 10%; text-align: center;'>".NFLAN_27."</td>
+	</tr>\n";
+
+	foreach($nfArray as $newsfeed)
+	{
+		extract($newsfeed);
+		switch ($newsfeed_active)
+		{
+			case 0:
+				$active = NFLAN_13;
+			break;
+			case 1:
+				$active = NFLAN_14;
+			break;
+			case 2:
+				$active = NFLAN_20;
+			break;
+			case 3:
+				$active = NFLAN_21;
+			break;
+		}
+
+		$text .= "<tr><td class='forumheader3' style='width: 5%; text-align: center;'>$newsfeed_id</td>
+		<td class='forumheader3' style='width: 50%;'><a href='$newsfeed_url' rel='external'>$newsfeed_name</a></td>
+		<td class='forumheader3' style='width: 10%; text-align: center;'>".($newsfeed_updateint ? $newsfeed_updateint : "3600")."</td>
+		<td class='forumheader3' style='width: 25%; text-align: center;'>$active</td>
+		<td class='forumheader3' style='width: 10%; text-align: center;'><a href='".e_SELF."?edit.".$newsfeed_id."'>".ADMIN_EDIT_ICON."</a>&nbsp;<a href='".e_SELF."?delete.".$newsfeed_id."'>".ADMIN_DELETE_ICON."</a></td>
+		</tr>\n";
+	}
+
+	$text .= "</table>\n</div>";
+}
+else
+{
+	$text = NFLAN_41;
+}
+$ns->tablerender(NFLAN_07, $text);
+
+if($action == "edit")
+{
+	if($sql->db_Select("newsfeed", "*", "newsfeed_id=$id"))
+	{
+		$row = $sql->db_Fetch();
+		extract($row);
+		list($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode("::", $newsfeed_image);
+	}
+}
+else
+{
+	unset($newsfeed_showmenu, $newsfeed_showmain, $newsfeed_name, $newsfeed_url, $newsfeed_image, $newsfeed_description, $newsfeed_updateint, $newsfeed_active);
+}
+
+$text = "<div style='text-align:center'>
+<form method='post' action='".e_SELF."'>\n
+<table style='".ADMIN_WIDTH."' class='fborder'>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".NFLAN_30."</td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input class='tbox' type='text' name='newsfeed_name' size='80' value='$newsfeed_name' maxlength='200' />
+</td>
+</tr>
+
+
+
+<tr>
+<td style='width:50%' class='forumheader3'>".NFLAN_10."</td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input class='tbox' type='text' name='newsfeed_url' size='80' value='$newsfeed_url' maxlength='200' />
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".NFLAN_11."<br /><span class='smalltext'>".NFLAN_17."</span></td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input class='tbox' type='text' name='newsfeed_image' size='80' value='$newsfeed_image' maxlength='200' />
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".NFLAN_36."<br /><span class='smalltext'>".NFLAN_37."</span></td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input class='tbox' type='text' name='newsfeed_description' size='80' value='$newsfeed_description' maxlength='200' />
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".NFLAN_18."<br /><span class='smalltext'>".NFLAN_19."</span></td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input class='tbox' type='text' name='newsfeed_updateint' size='5' value='".($newsfeed_updateint ? $newsfeed_updateint : "3600")."' maxlength='200' />
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".NFLAN_12."<br /><span class='smalltext'>".NFLAN_22."</span></td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+
+<input type='radio' name='newsfeed_active' value='0'".(!$newsfeed_active ? " checked='checked'" : "")." /> ".NFLAN_13."&nbsp;<br />
+<input type='radio' name='newsfeed_active' value='1'".($newsfeed_active == 1 ? " checked='checked'" : "")." /> ".NFLAN_14."&nbsp;<br />
+<input type='radio' name='newsfeed_active' value='2'".($newsfeed_active == 2 ? " checked='checked'" : "")." /> ".NFLAN_20."&nbsp;<br />
+<input type='radio' name='newsfeed_active' value='3'".($newsfeed_active == 3 ? " checked='checked'" : "")." /> ".NFLAN_21."&nbsp;
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".NFLAN_45."<br /><span class='smalltext'>".NFLAN_47."</span></td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input class='tbox' type='text' name='newsfeed_showmenu' size='5' value='".($newsfeed_showmenu ? $newsfeed_showmenu : "0")."' maxlength='200' />
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".NFLAN_46."<br /><span class='smalltext'>".NFLAN_47."</span></td>
+<td style='width:50%; text-align: left;' class='forumheader3'>
+<input class='tbox' type='text' name='newsfeed_showmain' size='5' value='".($newsfeed_showmain ? $newsfeed_showmain : "0")."' maxlength='200' />
+</td>
+</tr>
+
+<tr style='vertical-align:top'>
+<td colspan='2' style='text-align:center' class='forumheader'>
+<input class='button' type='submit' name='".($action == "edit" ? "updateFeed" : "createFeed")."' value='".($action == "edit" ? NFLAN_16 : NFLAN_15)."' />
+</td>
+</tr>
+
+</table>
+".($action == "edit" ? "<input type='hidden' name='newsfeed_id' value='$newsfeed_id' />" : "")."
+</form>
+</div>";
+
+$ns->tablerender(NFLAN_09, $text);
+
+require_once(e_ADMIN."footer.php");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsfeed/e_frontpage.php 75/e107_plugins/newsfeed/e_frontpage.php
--- 6171/e107_plugins/newsfeed/e_frontpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/e_frontpage.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,17 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN.'newsfeed/languages/'.e_LANGUAGE.'_frontpage.php');
+@include_once(e_PLUGIN.'newsfeed/languages/English_frontpage.php');
+
+$front_page['newsfeed']['title'] = NWSF_FP_1.': '.$row['content_heading'];
+$front_page['newsfeed']['page'][] = array('page' => $PLUGINS_DIRECTORY.'newsfeed/newsfeed.php', 'title' => NWSF_FP_2);
+
+if ($sql -> db_Select("newsfeed", "newsfeed_id, newsfeed_name")) {
+	while ($row = $sql -> db_Fetch()) {
+		$front_page['newsfeed']['page'][] = array('page' => $PLUGINS_DIRECTORY.'newsfeed/newsfeed.php?show.'.$row['newsfeed_id'], 'title' => $row['newsfeed_name']);
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsfeed/help.php 75/e107_plugins/newsfeed/help.php
--- 6171/e107_plugins/newsfeed/help.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/help.php	2005-12-14 13:28:44.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/help.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:44 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."newsfeed/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."newsfeed/languages/English.php");
+$ns->tablerender(NFLAN_43, NFLAN_42);
+?>
\ No newline at end of file
Files 6171/e107_plugins/newsfeed/images/newsfeed_16.png and 75/e107_plugins/newsfeed/images/newsfeed_16.png differ
Files 6171/e107_plugins/newsfeed/images/newsfeed_32.png and 75/e107_plugins/newsfeed/images/newsfeed_32.png differ
diff -ruN 6171/e107_plugins/newsfeed/languages/English_frontpage.php 75/e107_plugins/newsfeed/languages/English_frontpage.php
--- 6171/e107_plugins/newsfeed/languages/English_frontpage.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/languages/English_frontpage.php	2005-06-07 15:56:04.000000000 -0500
@@ -0,0 +1,16 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/languages/English_frontpage.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/06/07 20:56:04 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("NWSF_FP_1", "News Feeds");
+define("NWSF_FP_2", "main page");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsfeed/languages/English.php 75/e107_plugins/newsfeed/languages/English.php
--- 6171/e107_plugins/newsfeed/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/languages/English.php	2006-04-14 09:09:53.000000000 -0500
@@ -0,0 +1,88 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/languages/English.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2006/04/14 14:09:53 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+
+define("NFLAN_01", "Newsfeeds");
+define("NFLAN_02", "This plugin will retrieve rss feeds from other websites and display them according to your preferences");
+define("NFLAN_03", "Configure newsfeeds");
+define("NFLAN_04", "Newsfeeds plugin has been successfully installed. To add newsfeeds and configure, return to the main admin page and click on the newsfeeds icon in the plugin section.");
+define("NFLAN_05", "Edit");
+define("NFLAN_06", "Delete");
+define("NFLAN_07", "Existing Newsfeeds");
+define("NFLAN_08", "Newsfeeds front page");
+define("NFLAN_09", "Create newsfeed");
+define("NFLAN_10", "URL to rss feed");
+define("NFLAN_11", "Path to image");
+define("NFLAN_12", "Activation");
+define("NFLAN_13", "Nowhere (inactive)");
+define("NFLAN_14", "In menu only");
+define("NFLAN_15", "Create Newsfeed");
+define("NFLAN_16", "Update Newsfeed");
+define("NFLAN_17", "enter 'default' in box to use the image defined in the feed, to use your own image enter full path, leave blank for no image.");
+define("NFLAN_18", "Update interval in seconds");
+define("NFLAN_19", "ie, 3600: newsfeed will update every hour");
+define("NFLAN_20", "On newsfeed main page only");
+define("NFLAN_21", "In both menu and newsfeed page");
+define("NFLAN_22", "choose where you want the newsfeed displayed");
+define("NFLAN_23", "Newsfeed added to database.");
+define("NFLAN_24", "Required field(s) left blank.");
+define("NFLAN_25", "Newsfeed updated in database.");
+define("NFLAN_26", "Update Interval");
+define("NFLAN_27", "Options");
+define("NFLAN_28", "URL");
+define("NFLAN_29", "Available newsfeeds");
+define("NFLAN_30", "Feed name");
+define("NFLAN_31", "Back to newsfeed list");
+define("NFLAN_32", "No feed with that identification number can be found.");
+define("NFLAN_33", "Date published: ");
+define("NFLAN_34", "not known");
+define("NFLAN_35", "posted by ");
+define("NFLAN_36", "Description");
+define("NFLAN_37", "short description of feed, enter 'default' to use the description defined in the feed");
+define("NFLAN_38", "Headlines");
+define("NFLAN_39", "Details");
+define("NFLAN_40", "Newsfeed deleted");
+define("NFLAN_41", "No newsfeeds defined yet");
+
+define("NFLAN_42", "<b>&raquo;</b> <u>Feed Name:</u>
+	The identifying name of the feed, can be anything you like.
+	<br /><br />
+	<b>&raquo;</b> <u>URL to rss feed:</u>
+	The address of the rss feed
+	<br /><br />
+	<b>&raquo;</b> <u>Path to image:</u>
+	If the feed has an image defined in it, enter 'default' to use it. To use your own image, enter the full path to it. Leave blank to use no image at all.
+	<br /><br />
+	<b>&raquo;</b> <u>Description:</u>
+	Enter a short description of the feed, or 'default' to use the description defined in the feed (if there is one).
+	<br /><br />
+	<b>&raquo;</b> <u>Update interval in seconds:</u>
+	The amount of seconds that elapse before the feed is updated, for example, 1800: 30 minutes, 3600: an hour.
+	<br /><br />
+	<b>&raquo;</b> <u>Activation:</u>
+	where you want the feed results to be displayed, to see menu feeds you will need to activate the newsfeeds menu on the <a href='".e_ADMIN."menus.php'>menus page</a>.
+	<br /><br />For a good list of available feeds, see <a href='http://www.syndic8.com/' rel='external'>syndic8.com</a> or <a href='http://feedfinder.feedster.com/index.php' rel='external'>feedster.com</a>");
+define("NFLAN_43", "Newsfeed help");
+define("NFLAN_44", "click to view");
+
+define("NFLAN_45", "Number of items to show in menu");
+define("NFLAN_46", "Number of items to show on main page");
+define("NFLAN_47", "0 or blank to show all");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsfeed/newsfeed_functions.php 75/e107_plugins/newsfeed/newsfeed_functions.php
--- 6171/e107_plugins/newsfeed/newsfeed_functions.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/newsfeed_functions.php	2006-04-14 09:09:53.000000000 -0500
@@ -0,0 +1,196 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ?Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/newsfeed_functions.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/04/14 14:09:53 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if(!function_exists("checkUpdate"))
+{
+	function checkUpdate($query = "newsfeed_active=2 OR newsfeed_active=3")
+	{
+		global $sql, $tp;
+		require_once(e_HANDLER."xml_class.php");
+		$xml = new parseXml;
+		require_once(e_HANDLER."magpie_rss.php");
+
+		if ($sql -> db_Select("newsfeed", "*", $tp -> toDB($query, true)))
+		{
+			$feedArray = $sql -> db_getList();
+			foreach($feedArray as $feed)
+			{
+				extract ($feed);
+				if($newsfeed_timestamp + $newsfeed_updateint < time())
+				{
+					if($rawData = $xml -> getRemoteXmlFile($newsfeed_url))
+					{
+						$rss = new MagpieRSS( $rawData );
+						$serializedArray = addslashes(serialize($rss));
+
+						$newsfeed_des = FALSE;
+						if($newsfeed_description == "default")
+						{
+							if($rss -> channel['description'])
+							{
+								$newsfeed_des = $tp -> toDB($rss -> channel['description']);
+							}
+							else if($rss -> channel['tagline'])
+							{
+								$newsfeed_des = $tp -> toDB($rss -> channel['tagline']);
+							}
+						}
+
+						if(!$sql->db_Update('newsfeed', "newsfeed_data='{$serializedArray}', newsfeed_timestamp=".time().($newsfeed_des ? ", newsfeed_description='{$newsfeed_des}'": "")." WHERE newsfeed_id=".intval($newsfeed_id)))
+						{
+							echo "Unable to save raw data in database.<br /><br />".$serializedArray;
+						}
+					}
+					else
+					{
+						echo $xml -> error;
+					}
+				}
+			}
+		}
+	}
+}
+
+if(!function_exists("newsfeed_info"))
+{
+	function newsfeed_info($which, $where = 'main')
+	{
+		global $tp, $sql;
+		if($which == 'all')
+		{
+			$qry = "newsfeed_active=1 OR newsfeed_active=3";
+		}
+		else
+		{
+			$qry = "newsfeed_id = ".intval($which);
+		}
+
+		$text = "";
+		checkUpdate($qry);
+
+		/* get template */
+		if (file_exists(THEME."newsfeed_menu_template.php"))
+		{
+			include(THEME."newsfeed_menu_template.php");
+		}
+		else
+		{
+			include(e_PLUGIN."newsfeed/templates/newsfeed_menu_template.php");
+		}
+
+		if ($feeds = $sql -> db_Select("newsfeed", "*", $qry))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				extract ($row);
+				list($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode("::", $newsfeed_image);				
+				$numtoshow = ($where == 'main' ? $newsfeed_showmain : $newsfeed_showmenu);
+				$numtoshow = (intval($numtoshow) > 0 ? $numtoshow : 999);
+				$rss = unserialize($newsfeed_data);
+				$FEEDNAME = "<a href='".e_SELF."?show.$newsfeed_id'>$newsfeed_name</a>";
+				$FEEDDESCRIPTION = $newsfeed_description;
+				if($newsfeed_image == "default")
+				{
+					if($file = fopen ($rss -> image['url'], "r"))
+					{
+						/* remote image exists - use it! */
+						$FEEDIMAGE = "<a href='".$rss -> image['link']."' rel='external'><img src='".$rss -> image['url']."' alt='".$rss -> image['title']."' style='border: 0; vertical-align: middle;' /></a>";
+					}
+					else
+					{
+						/* remote image doesn't exist - ghah! */
+						$FEEDIMAGE = "";
+					}
+				}
+				else if ($newsfeed_image)
+				{
+					$FEEDIMAGE = "<img src='".$newsfeed_image."' alt='' />";
+				}
+				else
+				{
+					$FEEDIMAGE = "";
+				}
+				$FEEDLANGUAGE = $rss -> channel['language'];
+
+				if($rss -> channel['lastbuilddate'])
+				{
+					$pubbed = $rss -> channel['lastbuilddate'];
+				}
+				else if($rss -> channel['dc']['date'])
+				{
+					$pubbed = $rss -> channel['dc']['date'];
+				}
+				else
+				{
+					$pubbed = NFLAN_34;
+				}
+
+				$FEEDLASTBUILDDATE = NFLAN_33.$pubbed;
+				$FEEDCOPYRIGHT = $tp -> toHTML($rss -> channel['copyright'], TRUE);
+				$FEEDTITLE = "<a href='".$rss -> channel['link']."' rel='external'>".$rss -> channel['title']."</a>";
+				$FEEDLINK = $rss -> channel['link'];
+				if($newsfeed_active == 2 or $newsfeed_active == 3)
+				{
+					$LINKTOMAIN = "<a href='".e_PLUGIN."newsfeed/newsfeed.php?show.$newsfeed_id'>".NFLAN_39."</a>";
+				}
+				else
+				{
+					$LINKTOMAIN = "";
+				}
+
+				$data = "";
+
+				$item_total = array_slice($rss->items, 0, $items);
+
+				$i = 0;
+				while($i < $numtoshow && $item_total[$i])
+				{
+					$item = $item_total[$i];
+					$FEEDITEMLINK = "<a href='".$item['link']."' rel='external'>".$tp -> toHTML($item['title'], TRUE)."</a>\n";
+					$feeditemtext = preg_replace("#\[[a-z0-9=]+\]|\[\/[a-z]+\]|\{[A-Z_]+\}#si", "", $item['description']);
+					$FEEDITEMTEXT = $tp->text_truncate($feeditemtext, $truncate, $truncate_string);
+
+					$FEEDITEMCREATOR = $tp -> toHTML($item['author'], TRUE);
+					$data .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MENU);
+					$i++;
+				}
+
+				$BACKLINK = "<a href='".e_SELF."'>".NFLAN_31."</a>";
+				$text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MENU_START) . $data . preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MENU_END);
+			}
+		}
+
+		if($which == 'all')
+		{
+			$ret['title'] = NFLAN_38;
+		}
+		else
+		{
+			$ret['title'] = $newsfeed_name." ".NFLAN_38;
+		}
+		$ret['text'] = $text;
+
+		return $ret;
+	}
+}
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsfeed/newsfeed_menu.php 75/e107_plugins/newsfeed/newsfeed_menu.php
--- 6171/e107_plugins/newsfeed/newsfeed_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/newsfeed_menu.php	2006-04-14 09:09:53.000000000 -0500
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/newsfeed_menu.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/04/14 14:09:53 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+include_once(e_PLUGIN."newsfeed/newsfeed_functions.php");
+$info = newsfeed_info('all', 'menu');
+if($info['text'])
+{
+	$ns->tablerender($info['title'], $info['text']);
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsfeed/newsfeed.php 75/e107_plugins/newsfeed/newsfeed.php
--- 6171/e107_plugins/newsfeed/newsfeed.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/newsfeed.php	2006-04-14 09:09:53.000000000 -0500
@@ -0,0 +1,168 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/newsfeed.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2006/04/14 14:09:53 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+
+@include_once(e_PLUGIN."newsfeed/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."newsfeed/languages/English.php");
+if(!function_exists("checkUpdate"))
+{
+	require(e_PLUGIN."newsfeed/newsfeed_functions.php");
+}
+require_once(HEADERF);
+
+/* get template */
+if (file_exists(THEME."newsfeed_template.php"))
+{
+	require_once(THEME."newsfeed_template.php");
+}
+else if(!$NEWSFEED_LIST_START)
+{
+	require_once(e_PLUGIN."newsfeed/templates/newsfeed_template.php");
+}
+
+$action = FALSE;
+if(e_QUERY)
+{
+	list($action, $id) = explode(".", e_QUERY);
+	$id = intval($id);
+}
+
+if($action == "show")
+{
+	/* 'show' action - show feed */
+	checkUpdate();
+
+	if ($feeds = $sql -> db_Select("newsfeed", "*", "(newsfeed_active=2 OR newsfeed_active=3) AND newsfeed_id=$id"))
+	{
+		$row = $sql->db_Fetch();
+		extract ($row);
+		list($newsfeed_image, $newsfeed_showmenu, $newsfeed_showmain) = explode("::", $newsfeed_image);				
+		$numtoshow = $newsfeed_showmain;
+		$numtoshow = (intval($numtoshow) > 0 ? $numtoshow : 999);
+
+		$rss = unserialize($newsfeed_data);
+
+		if(!is_object($rss))
+		{
+			$text = "Unable to unserialize rss data - uses non-standard syntax";
+			$ns->tablerender(NFLAN_01, $text);
+			require_once(FOOTERF);
+			exit;
+		}
+
+		$FEEDNAME = "<a href='".e_SELF."?show.$newsfeed_id'>$newsfeed_name</a>";
+		$FEEDDESCRIPTION = $newsfeed_description;
+		if($newsfeed_image == "default")
+		{
+			if($file = fopen ($rss -> image['url'], "r"))
+			{
+				/* remote image exists - use it! */
+				$FEEDIMAGE = "<a href='".$rss -> image['link']."' rel='external'><img src='".$rss -> image['url']."' alt='".$rss -> image['title']."' style='border: 0; vertical-align: middle;' /></a>";
+			}
+			else
+			{
+				/* remote image doesn't exist - ghah! */
+				$FEEDIMAGE = "";
+			}
+
+
+		}else if ($newsfeed_image)
+		{
+			$FEEDIMAGE = "<img src='".$newsfeed_image."' alt='' />";
+		}
+		else
+		{
+			$FEEDIMAGE = "";
+		}
+		$FEEDLANGUAGE = $rss -> channel['language'];
+
+		if($rss -> channel['lastbuilddate'])
+		{
+			$pubbed = $rss -> channel['lastbuilddate'];
+		}
+		else if($rss -> channel['dc']['date'])
+		{
+			$pubbed = $rss -> channel['dc']['date'];
+		}
+		else
+		{
+			$pubbed = NFLAN_34;
+		}
+
+		$FEEDLASTBUILDDATE = NFLAN_33.$pubbed;
+		$FEEDCOPYRIGHT = $tp -> toHTML($rss -> channel['copyright'], TRUE);
+		$FEEDDOCS = $rss -> channel['docs'];
+		$FEEDTITLE = "<a href='".$rss -> channel['link']."' rel='external'>".$rss -> channel['title']."</a>";
+		$FEEDLINK = $rss -> channel['link'];
+
+		$data = "";
+		
+		$i = 0;
+		while($i < $numtoshow && $rss->items[$i])
+		{
+			$item = $rss->items[$i];
+//		foreach ($rss -> items as $item)
+//		{
+	
+			if($NEWSFEED_COLLAPSE)
+			{
+				$FEEDITEMLINK = "<a href='#' onclick='expandit(this)'>".$tp -> toHTML($item['title'], TRUE)."</a>
+				<div style='display:none' >
+				";
+				$FEEDITEMTEXT = preg_replace("/&#091;.*]/", "", $tp -> toHTML($item['description'], TRUE))."
+				<br /><br /><a href='".$item['link']."' rel='external'>".NFLAN_44."</a><br /><br />
+				</div>";
+			}
+			else
+			{
+				$FEEDITEMLINK = "<a href='".$item['link']."' rel='external'>".$tp -> toHTML($item['title'], TRUE)."</a>\n";
+				$feeditemtext = preg_replace("#\[[a-z0-9=]+\]|\[\/[a-z]+\]|\{[A-Z_]+\}#si", "", $item['description']);
+				$FEEDITEMTEXT = $tp -> toHTML($feeditemtext, TRUE)."\n";
+			}
+			$FEEDITEMCREATOR = $tp -> toHTML($item['author'], TRUE);
+			$data .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MAIN);
+			$i++;
+		}
+		$BACKLINK = "<a href='".e_SELF."'>".NFLAN_31."</a>";
+		$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MAIN_START) . $data . preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_MAIN_END);
+		$ns->tablerender(NFLAN_01, $text);
+		require_once(FOOTERF);
+		exit;
+	}
+}
+	
+/* no action - display feed list ... */
+if ($feeds = $sql -> db_Select("newsfeed", "*", "newsfeed_active=2 OR newsfeed_active=3"))
+{
+	$data = "";
+	while ($row = $sql->db_Fetch())
+	{
+		extract($row);
+		$FEEDNAME = "<a href='".e_SELF."?show.$newsfeed_id'>$newsfeed_name</a>";
+		$FEEDDESCRIPTION = ((!$newsfeed_description || $newsfeed_description == "default") ? "&nbsp;" : $newsfeed_description);
+		$FEEDIMAGE = $newsfeed_image;
+		$data .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWSFEED_LIST);
+	}
+}
+
+$text = $NEWSFEED_LIST_START . $data . $NEWSFEED_LIST_END;
+$ns->tablerender(NFLAN_29, $text);
+require_once(FOOTERF);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsfeed/plugin.php 75/e107_plugins/newsfeed/plugin.php
--- 6171/e107_plugins/newsfeed/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/plugin.php	2006-01-22 13:53:06.000000000 -0600
@@ -0,0 +1,81 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/plugin.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2006/01/22 19:53:06 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."newsfeed/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."newsfeed/languages/English.php");
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = NFLAN_01;
+$eplug_version = "2.0";
+$eplug_author = "Steve Dunstan (jalist)";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = NFLAN_02;
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "newsfeed";
+
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "newsfeed_menu";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+
+$eplug_sc = array("");
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/newsfeed_32.png";
+$eplug_icon_small = $eplug_folder."/images/newsfeed_16.png";
+$eplug_caption = NFLAN_03;
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array();
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array("newsfeed");
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."newsfeed (
+  newsfeed_id int(10) unsigned NOT NULL auto_increment,
+  newsfeed_name varchar(150) NOT NULL default '',
+  newsfeed_url varchar(150) NOT NULL default '',
+  newsfeed_data longtext NOT NULL,
+  newsfeed_timestamp int(10) unsigned NOT NULL default '0',
+  newsfeed_description text NOT NULL,
+  newsfeed_image varchar(100) NOT NULL default '',
+  newsfeed_active tinyint(1) unsigned NOT NULL default '0',
+  newsfeed_updateint int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (newsfeed_id)
+) TYPE=MyISAM;");
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = TRUE;
+$eplug_link_name = NFLAN_01;
+$eplug_link_url = e_PLUGIN."newsfeed/newsfeed.php";
+$eplug_link_perms = "Everyone"; // Guest, Member, Admin, Everyone
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = NFLAN_04; // "To activate please go to your menus screen and select the pm_menu into one of your menu areas.";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsfeed/templates/newsfeed_menu_template.php 75/e107_plugins/newsfeed/templates/newsfeed_menu_template.php
--- 6171/e107_plugins/newsfeed/templates/newsfeed_menu_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/templates/newsfeed_menu_template.php	2006-02-08 14:50:47.000000000 -0600
@@ -0,0 +1,38 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ?Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/templates/newsfeed_menu_template.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2006/02/08 20:50:47 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$truncate = 100;
+$truncate_string = " ...[more]";
+$items = 10;
+
+$NEWSFEED_MENU_START = "
+<div style='text-align: center; margin-left: auto; margin-right: auto;'>{FEEDIMAGE}<br /><b>{FEEDTITLE}</b></div>\n<br />\n";
+
+$NEWSFEED_MENU = "
+<b>&raquo;</b>{FEEDITEMLINK}<br /><span class='smalltext'>{FEEDITEMTEXT}</span><br />\n";
+
+
+$NEWSFEED_MENU_END = "
+
+<div style='text-align: right;'><span class='smalltext'>{FEEDLASTBUILDDATE}<br />{LINKTOMAIN}</span></div>\n<hr />";
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsfeed/templates/newsfeed_template.php 75/e107_plugins/newsfeed/templates/newsfeed_template.php
--- 6171/e107_plugins/newsfeed/templates/newsfeed_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsfeed/templates/newsfeed_template.php	2005-12-14 13:28:51.000000000 -0600
@@ -0,0 +1,62 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsfeed/templates/newsfeed_template.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 19:28:51 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$NEWSFEED_LIST_START = "
+<table style='width: 100%;' class='fborder'>\n";
+
+$NEWSFEED_LIST = "
+<tr>
+<td style='width: 30%;' class='forumheader3'>{FEEDNAME}</td>
+<td style='width: 70%;' class='forumheader3'>{FEEDDESCRIPTION}</td>
+</tr>\n";
+
+$NEWSFEED_LIST_END = "
+</table>\n";
+
+$NEWSFEED_MAIN_START = "
+<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader'>{FEEDIMAGE} {FEEDTITLE}</td>
+</tr>
+<tr>
+<td class='forumheader3'>
+<ul>\n";
+
+$NEWSFEED_MAIN = "
+<li><b>{FEEDITEMLINK}</b> <span class='smalltext'>{FEEDITEMCREATOR}</span><br />{FEEDITEMTEXT}<br /><br /></li>\n";
+
+
+$NEWSFEED_MAIN_END = "
+</ul>
+</td>
+</tr>
+
+<tr>
+<td class='forumheader3' style='text-align: right;'><span class='smalltext'>{FEEDCOPYRIGHT} | {FEEDLASTBUILDDATE}</td>
+</tr>
+
+<tr>
+<td class='forumheader3' style='text-align: center;'><span class='smalltext'>{BACKLINK}</td>
+</tr>
+</table>\n";
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsletter/admin_config.php 75/e107_plugins/newsletter/admin_config.php
--- 6171/e107_plugins/newsletter/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsletter/admin_config.php	2006-02-20 09:13:15.000000000 -0600
@@ -0,0 +1,518 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsletter/admin_config.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2006/02/20 15:13:15 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if (!getperms("P")) {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+$e_sub_cat = 'newsletter';
+require_once(e_ADMIN."auth.php");
+
+if (e_QUERY) {
+	list($action, $id) = explode(".", e_QUERY);
+}
+else
+{
+	$action = FALSE;
+	$id = FALSE;
+}
+
+$nl = new newsletter;
+
+
+if(!e_QUERY)
+{
+	$nl -> showExistingNewsletters();
+}
+else
+{
+	$function = $action."Newsletter";
+	$nl -> $function();
+}
+
+class newsletter
+{
+
+	var $message;
+
+
+	function newsletter()
+	{
+		global $ns;
+
+		foreach($_POST as $key => $value)
+		{
+			if(strstr($key, "nlmailnow"))
+			{
+				$this -> releaseIssue($key);
+				break;
+			}
+		}
+
+		if(isset($_POST['delete']))
+		{
+			$this -> deleteNewsletter();
+		}
+
+		if(isset($_POST['createNewsletter']))
+		{
+			$this -> createNewsletter();
+		}
+
+		if(isset($_POST['createIssue']))
+		{
+			$this -> createIssue();
+		}
+
+		if($this -> message)
+		{
+			$ns->tablerender("", "<div style='text-align:center'><b>".$this -> message."</b></div>");
+		}
+	}
+
+
+	function showExistingNewsletters()
+	{
+		global $sql, $ns, $tp;
+
+		if(!$sql -> db_Select("newsletter", "*", "newsletter_parent='0'  ORDER BY newsletter_id DESC"))
+		{
+			$text = NLLAN_05;
+		}
+		else
+		{
+			$text = "<form action='".e_SELF."' id='newsletterform' method='post'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='width:5%; text-align: center;' class='forumheader'>ID</td>
+			<td style='width:65%' class='forumheader'>".NLLAN_06."</td>
+			<td style='width:20%; text-align: center;' class='forumheader'>".NLLAN_07."</td>
+			<td style='width:10%; text-align: center;' class='forumheader'>".NLLAN_08."</td>
+			</tr>
+			";
+
+			$nlArray = $sql -> db_getList();
+			foreach($nlArray as $data)
+			{
+				$text .= "<tr>
+				<td style='width:5%; text-align: center;' class='forumheader3'>".$data['newsletter_id']."</td>
+				<td style='width:65%' class='forumheader3'>".$data['newsletter_title']."</td>
+				<td style='width:20%; text-align: center;' class='forumheader'>".substr_count($data['newsletter_subscribers'], chr(1))."</td>
+				<td style='width:10%; text-align: center;' class='forumheader3'>
+				<a href='".e_SELF."?edit.".$data['newsletter_id']."'>".ADMIN_EDIT_ICON."</a>
+				<input type='image' title='".LAN_DELETE."' name='delete[newsletter_".$data['newsletter_id']."]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(NLLAN_09." [ID: ".$data['newsletter_id']." ]")."') \"/>
+				
+				</td>
+				</tr>
+				";
+			}
+
+			$text .= "</table>
+			</form>
+			</div>
+			";
+		}
+		$ns -> tablerender(NLLAN_10, $text);
+
+
+		if(!$sql -> db_Select("newsletter", "*", "newsletter_parent!='0' ORDER BY newsletter_id DESC"))
+		{
+			$text = NLLAN_11;
+		}
+		else
+		{
+
+			$text = "<form action='".e_SELF."' id='newsletterform2' method='post'>
+			<table style='".ADMIN_WIDTH."' class='fborder'>
+			<tr>
+			<td style='width:5%; text-align: center;' class='forumheader'>ID</td>
+			<td style='width:10%; text-align: center;' class='forumheader'>".NLLAN_12."</td>
+			<td style='width:65%' class='forumheader'>".NLLAN_13."</td>
+			<td style='width:10%; text-align: center;' class='forumheader'>".NLLAN_14."</td>
+			<td style='width:10%; text-align: center;' class='forumheader'>".NLLAN_15."</td>
+			</tr>
+			";
+
+			$nlArray = $sql -> db_getList();
+
+			foreach($nlArray as $data)
+			{
+
+				$text .= "<tr>
+				<td style='width:5%; text-align: center;' class='forumheader3'>".$data['newsletter_id']."</td>
+				<td style='width:10%; text-align: center;' class='forumheader3'>".$data['newsletter_issue']."</td>
+				<td style='width:65%' class='forumheader3'>[ ".$data['newsletter_parent']." ] ".$data['newsletter_title']."</td>
+				<td style='width:10%; text-align: center;' class='forumheader3'>".($data['newsletter_flag'] ? NLLAN_16 : "<input class='button' type='submit' name='nlmailnow_".$data['newsletter_id']."' value='".NLLAN_17."' onclick=\"return jsconfirm('".$tp->toJS(NLLAN_18)."') \" />")."</td>
+				<td style='width:10%; text-align: center;' class='forumheader3'>
+				<a href='".e_SELF."?edit.".$data['newsletter_id']."'>".ADMIN_EDIT_ICON."</a>
+				<input type='image' title='".LAN_DELETE."' name='delete[issue_".$data['newsletter_id']."]' src='".ADMIN_DELETE_ICON_PATH."' onclick=\"return jsconfirm('".$tp->toJS(NLLAN_19." [ID: ".$data['newsletter_id']." ]")."') \"/>
+				
+				</td>
+				</tr>
+				";
+			}
+
+			$text .= "</table>
+			</form>
+			</div>
+			";
+
+		}
+		$ns -> tablerender(NLLAN_20, $text);
+
+	}
+
+
+	function defineNewsletter($edit=FALSE)
+	{
+
+		global $ns, $tp;
+
+		if($edit)
+		{
+			extract($edit);
+			$newsletter_title = $tp -> toFORM($newsletter_title);
+			$newsletter_text = $tp -> toFORM($newsletter_text);
+			$newsletter_footer = $tp -> toFORM($newsletter_footer);
+		}
+
+		$text .= "<div style='text-align:center; margin-left:auto; margin-right: auto;'>
+		<form action='".e_SELF."' id='newsletterform' method='post'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td style='width:30%;' class='forumheader3'>".NLLAN_21."</td>
+		<td style='width:70%' class='forumheader3'><input class='tbox' type='text' name='newsletter_title' size='60' value='$newsletter_title' maxlength='200' /></td>
+		</tr>
+		<tr>
+		<td style='width:30%;' class='forumheader3'>".NLLAN_22."</td>
+		<td style='width:70%' class='forumheader3'><textarea class='tbox' id='data' name='newsletter_text' cols='80' rows='10' style='width:95%'>$newsletter_text</textarea></td>
+		</tr>
+		<tr>
+		<td style='width:30%;' class='forumheader3'>".NLLAN_23."</td>
+		<td style='width:70%' class='forumheader3'><textarea class='tbox' id='data' name='newsletter_header' cols='80' rows='5' style='width:95%'>$newsletter_header</textarea></td>
+		</tr>
+		<tr>
+		<td style='width:30%;' class='forumheader3'>".NLLAN_24."</td>
+		<td style='width:70%' class='forumheader3'><textarea class='tbox' id='data' name='newsletter_footer' cols='80' rows='5' style='width:95%'>$newsletter_footer</textarea></td>
+		</tr>
+		<tr>
+		<td colspan='2' style='text-align:center' class='forumheader'>
+		".
+		($edit ? "<input class='button' type='submit' name='createNewsletter' value='".NLLAN_25."' />\n<input type='hidden' name='editid' value='$newsletter_id' />" : "<input class='button' type='submit' name='createNewsletter' value='".NLLAN_26."' />")."
+		</td>
+		</tr>
+
+		</table>
+		</form>
+		</div>
+		";
+
+		$caption = ($edit ? NLLAN_25 : NLLAN_26);
+
+		$ns -> tablerender($caption, $text);
+
+
+	}
+
+
+	function createNewsletter()
+	{
+		global $sql, $tp;
+
+		$newsletter_title = $tp -> toDB($_POST['newsletter_title']);
+		$newsletter_text = $tp -> toDB($_POST['newsletter_text']);
+		$newsletter_header = $tp -> toDB($_POST['newsletter_header']);
+		$newsletter_footer = $tp -> toDB($_POST['newsletter_footer']);
+
+		if(isset($_POST['editid']))
+		{
+			$sql -> db_Update("newsletter", "newsletter_title='$newsletter_title', newsletter_text='$newsletter_text', newsletter_header='$newsletter_header', newsletter_footer='$newsletter_footer' WHERE newsletter_id='".$_POST['editid']."' ");
+			$this -> message = NLLAN_27;
+		}
+		else
+		{
+			$sql -> db_Insert("newsletter", "0, '".time()."', '$newsletter_title', '$newsletter_text', '$newsletter_header', '$newsletter_footer', '', '0', '0', '0' ");
+			$this -> message = NLLAN_28;
+		}
+	}
+
+
+	function makeNewsletter($edit=FALSE)
+	{
+
+		global $sql, $ns, $tp;
+
+		if($edit)
+		{
+			extract($edit);
+			$newsletter_title = $tp -> toFORM($newsletter_title);
+			$newsletter_text = $tp -> toFORM($newsletter_text);
+		}
+
+		if(!$sql -> db_Select("newsletter", "*", "newsletter_parent='0' "))
+		{
+			$this -> message = NLLAN_29;
+			return;
+		}
+
+		$nlArray = $sql -> db_getList();
+
+		$text .= "<div style='text-align:center; margin-left:auto; margin-right: auto;'>
+		<form action='".e_SELF."' id='newsletterform' method='post'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+
+		<tr>
+		<td style='width:30%;' class='forumheader3'>".NLLAN_30."</td>
+		<td style='width:70%' class='forumheader3'>
+
+		<select name='newsletter_parent' class='tbox'>
+		";
+
+		foreach($nlArray as $nl)
+		{
+			$text .= "<option value='".$nl['newsletter_id']."'>".$nl['newsletter_title']."</option>\n";
+		}
+
+		$text .= "</select>
+
+		<tr>
+		<td style='width:30%;' class='forumheader3'>".NLLAN_31."</td>
+		<td style='width:70%' class='forumheader3'><input class='tbox' type='text' name='newsletter_title' size='60' value='$newsletter_title' maxlength='200' /></td>
+		</tr>
+		<tr>
+		<td style='width:30%;' class='forumheader3'>".NLLAN_32."</td>
+		<td style='width:70%' class='forumheader3'><input class='tbox' type='text' name='newsletter_issue' size='10' value='$newsletter_issue' maxlength='200' /></td>
+		</tr>
+		<tr>
+		<td style='width:30%;' class='forumheader3'>".NLLAN_33."</td>
+		<td style='width:70%' class='forumheader3'><textarea class='tbox' id='data' name='newsletter_text' cols='80' rows='10' style='width:95%'>$newsletter_text</textarea></td>
+		</tr>
+		<tr>
+		<td colspan='2' style='text-align:center' class='forumheader'>
+		".
+		($edit ? "<input class='button' type='submit' name='createIssue' value='".NLLAN_34."' />\n<input type='hidden' name='editid' value='$newsletter_id' />" : "<input class='button' type='submit' name='createIssue' value='".NLLAN_35."' />")."
+		</td>
+		</tr>
+		</table>
+		</form>
+		</div>
+		";
+
+		$caption = ($edit ? NLLAN_36 : NLLAN_37);
+
+		$ns -> tablerender($caption, $text);
+	}
+
+
+	function createIssue()
+	{
+		global $sql, $tp;
+		$newsletter_title = $tp -> toDB($_POST['newsletter_title']);
+		$newsletter_text = $tp -> toDB($_POST['newsletter_text']);
+
+		if(isset($_POST['editid']))
+		{
+			$sql -> db_Update("newsletter", "newsletter_title='$newsletter_title', newsletter_text='$newsletter_text', newsletter_parent='".$_POST['newsletter_parent']."', newsletter_issue='".$_POST['newsletter_issue']."' WHERE newsletter_id='".$_POST['editid']."' ");
+			$this -> message = NLLAN_38;
+		}
+		else
+		{
+			$sql -> db_Insert("newsletter", "0, '".time()."', '$newsletter_title', '$newsletter_text', '', '', '', '".$_POST['newsletter_parent']."', '0', '".$_POST['newsletter_issue']."' ");
+			$this -> message = NLLAN_39;
+		}
+	}
+
+
+	function releaseIssue($issue)
+	{
+
+		global $pref, $sql, $ns, $tp, $THEMES_DIRECTORY;
+
+		$issue = str_replace("nlmailnow_", "", $issue);
+
+		if(!$sql -> db_Select("newsletter", "*", "newsletter_id='$issue' "))
+		{
+			return FALSE;
+		}
+		$newsletterInfo = $sql -> db_Fetch();
+
+		if(!$sql -> db_Select("newsletter", "*", "newsletter_id='".$newsletterInfo['newsletter_parent']."' "))
+		{
+			return FALSE;
+		}
+		$newsletterParentInfo = $sql -> db_Fetch();
+		$memberArray = explode(chr(1), $newsletterParentInfo['newsletter_subscribers']);
+
+		require(e_HANDLER."phpmailer/class.phpmailer.php");
+
+		$mail = new PHPMailer();
+
+		$mail->From = $pref['siteadminemail'];
+		$mail->FromName = $pref['siteadmin'];
+		if ($pref['mailer'] == "smtp")
+		{
+			$mail->Mailer = "smtp";
+			$mail->SMTPKeepAlive = TRUE;
+			$mail->SMTPAuth = TRUE;
+			$mail->Username = $pref['smtp_username'];
+			$mail->Password = $pref['smtp_password'];
+			$mail->Host = $pref['smtp_server'];
+		}
+		else
+		{
+			$mail->Mailer = "mail";
+		}
+
+		$mail->WordWrap = 50;
+		$mail->Charset = CHARSET;
+		$mail->Subject = $newsletterParentInfo['newsletter_title'] . ": ".$newsletterInfo['newsletter_title'];
+		$mail->IsHTML(true);
+
+		// ============================  Render Results and Mailit =========
+
+		$message_subject = stripslashes($tp -> toHTML($mail->Subject));
+		$message_body = stripslashes($tp -> toHTML($mail->Subject, TRUE));
+		$message_body = str_replace("&quot;", '"', $tp -> toHTML($newsletterInfo['newsletter_text'], TRUE));
+		$message_body = str_replace('src="', 'src="'.SITEURL, $message_body);
+
+		$newsletter_header = $tp -> toHTML($newsletterParentInfo['newsletter_header'], TRUE);
+		$newsletter_footer = $tp -> toHTML($newsletterParentInfo['newsletter_footer'], TRUE);
+
+
+		$theme = $THEMES_DIRECTORY.$pref['sitetheme']."/";
+		$mail_style = "<link rel=\"stylesheet\" href=\"".SITEURL.$theme."style.css\" type=\"text/css\" />";
+		$mail_style .= "<div style='width:100%'>";
+		$mail_style .= "<div style='width:90%; padding-top:10px'>";
+		$mail_style .= "<div class='fcaption'><b>$message_subject<br />[ ".NLLAN_12." ".$newsletterInfo['newsletter_issue']." ]</b></div><br /><br />";
+		$mail_style .= "<div class='forumheader3'>";
+		$message_body = $mail_style.$newsletter_header."<hr />".$message_body."<br><br><hr />".$newsletter_footer."<br></div></div>";
+
+		$message_body = str_replace("\n", "<br>", $message_body);
+
+		$mail->Body = $tp->toHTML($message_body, TRUE);
+		$mail->AltBody = strip_tags(str_replace("<br>", "\n", $message_body));
+
+		$sent_counter = 0;
+
+		foreach($memberArray as $memberID)
+		{
+			if($memberID)
+			{
+				if($sql -> db_Select("user", "user_name, user_email", "user_id='$memberID' "))
+				{
+					$row = $sql -> db_Fetch();
+					$mname = $row['user_name'];
+					$memail = $row['user_email'];
+				}
+
+				$mail->AddAddress($memail, $mname);
+
+				echo "<b>Sending</b> ".$mname." ( ".$memail." ) <br />";
+
+				$mail->Send();
+				$sent_counter ++;
+
+				$mail->ClearAddresses();
+				if ($pref['mailer'] == "smtp") {
+					$mail->SmtpClose();
+				}
+			}
+		}
+		$sql -> db_Update("newsletter", "newsletter_flag='1' WHERE newsletter_id='$issue' ");
+		$this -> message = NLLAN_40.$sent_counter.NLLAN_41;
+	}
+
+
+
+	function editNewsletter()
+	{
+		global $id, $sql;
+
+		if($sql -> db_Select("newsletter", "*", "newsletter_id='$id' "))
+		{
+			$foo = $sql -> db_Fetch();
+			if(!$foo['newsletter_parent'])
+			{
+				$this -> defineNewsletter($foo);
+			}
+			else
+			{
+				$this -> makeNewsletter($foo);
+			}
+		}
+	}
+
+
+	function deleteNewsletter()
+	{
+		global $sql;
+		$tmp = each($_POST['delete']);
+		if(strstr($tmp['key'], "newsletter"))
+		{
+			$id = str_replace("newsletter_", "", $tmp['key']);
+			$sql -> db_Delete("newsletter", "newsletter_id='$id' ");
+			$this -> message = NLLAN_42;
+		}
+		else
+		{
+			$id = str_replace("issue_", "", $tmp['key']);
+			$sql -> db_Delete("newsletter", "newsletter_id='$id' ");
+			$this -> message = NLLAN_43;
+		}
+	}
+
+
+
+	function show_options($action)
+	{
+		global $sql;
+		if ($action == "")
+		{
+			$action = "main";
+		}
+		// ##### Display options ---------------------------------------------------------------------------------------------------------
+
+		$var['main']['text'] = NLLAN_44;
+		$var['main']['link'] = e_SELF;
+
+		$var['define']['text'] = NLLAN_45;
+		$var['define']['link'] = e_SELF."?define";
+
+		$var['make']['text'] = NLLAN_46;
+		$var['make']['link'] = e_SELF."?make";
+	
+		show_admin_menu(NLLAN_47, $action, $var);
+	}
+
+}
+
+
+
+require_once(e_ADMIN."footer.php");
+
+
+function admin_config_adminmenu()
+{
+	global $nl;
+	global $action;
+	$nl->show_options($action);
+}
+
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/newsletter/images/nl_16.png and 75/e107_plugins/newsletter/images/nl_16.png differ
Files 6171/e107_plugins/newsletter/images/nl_32.png and 75/e107_plugins/newsletter/images/nl_32.png differ
diff -ruN 6171/e107_plugins/newsletter/languages/English.php 75/e107_plugins/newsletter/languages/English.php
--- 6171/e107_plugins/newsletter/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsletter/languages/English.php	2005-05-25 12:23:35.000000000 -0500
@@ -0,0 +1,86 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsletter/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/05/25 17:23:35 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("NLLAN_MENU_CAPTION", "Newsletter");
+
+define("NLLAN_01", "Newsletter");
+define("NLLAN_02", "Provides a quick and easy way to configure and send newsletters");
+define("NLLAN_03", "Configure Newsletters");
+define("NLLAN_04", "The newsletter plugin has been successfuly installed. To configure, return to your main admin page and click on 'Newsletter' in the plugin section.");
+define("NLLAN_05", "No newsletters defined yet");
+
+define("NLLAN_06", "Name");
+define("NLLAN_07", "Subscribers");
+define("NLLAN_08", "Options");
+define("NLLAN_09", "Are you sure you want to delete this newsletter?");
+define("NLLAN_10", "Existing Newsletters");
+
+define("NLLAN_11", "No newsletter issues yet");
+define("NLLAN_12", "Issue");
+define("NLLAN_13", "[ Parent ID ] Subject/Title");
+define("NLLAN_14", "Mailed?");
+define("NLLAN_15", "Options");
+define("NLLAN_16", "yes");
+define("NLLAN_17", "Not sent out - click to send");
+define("NLLAN_18", "Are you sure you want to mail this issue to subscribers?");
+define("NLLAN_19", "Are you sure you want to delete this newsletter issue?");
+define("NLLAN_20", "Existing Issues");
+define("NLLAN_21", "Title");
+define("NLLAN_22", "Description");
+define("NLLAN_23", "Header");
+define("NLLAN_24", "Footer");
+define("NLLAN_25", "Update Newsletter");
+define("NLLAN_26", "Create Newsletter");
+define("NLLAN_27", "Newsletter updated in database.");
+define("NLLAN_28", "Newsletter defined and saved in database.");
+define("NLLAN_29", "No newsletters defined yet.");
+define("NLLAN_30", "Newsletter");
+define("NLLAN_31", "Subject / Title");
+define("NLLAN_32", "Issue Number");
+define("NLLAN_33", "Text");
+define("NLLAN_34", "Update Mailing");
+define("NLLAN_35", "Create Mailing");
+define("NLLAN_36", "Update Newsletter Issue");
+define("NLLAN_37", "Create Newsletter Issue");
+define("NLLAN_38", "Newsletter updated in database.");
+define("NLLAN_39", "Newsletter issue saved in database - to send out, click the 'Release Issue' button in the Options menu.");
+define("NLLAN_40", "Mailout completed - issue sent to ");
+
+define("NLLAN_41", " subscriber(s).");
+define("NLLAN_42", "Newsletter deleted.");
+define("NLLAN_43", "Newsletter issue deleted.");
+
+define("NLLAN_44", "Newsletter Front Page");
+define("NLLAN_45", "Create Newsletter");
+define("NLLAN_46", "Create mailing");
+define("NLLAN_47", "Newsletter Options");
+
+define("NLLAN_48", "you are subscribed to this newsletter - if you wish to un-subscribe please click the button below.");
+define("NLLAN_49", "Are you sure you want to un-subscribe from this newsletter?");
+define("NLLAN_50", "Click button to subscribe ( your subscription address is");
+define("NLLAN_51", "Unsubscribe");
+define("NLLAN_52", "Subscribe");
+define("NLLAN_53", "Are you sure you want to subscribe to this newsletter?");
+
+
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsletter/newsletter_menu.php 75/e107_plugins/newsletter/newsletter_menu.php
--- 6171/e107_plugins/newsletter/newsletter_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsletter/newsletter_menu.php	2006-01-14 19:47:41.000000000 -0600
@@ -0,0 +1,91 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsletter/newsletter_menu.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2006/01/15 01:47:41 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if(!USER || !$sql -> db_Select("newsletter", "*", "newsletter_parent='0' "))
+{
+	// no newsletters defined yet //
+	return FALSE;
+}
+
+$newsletterArray = $sql -> db_getList();
+$requery = false;
+
+foreach($_POST as $key => $value)
+{
+	if(strstr($key, "nlUnsubscribe_"))
+	{
+		$subid = str_replace("nlUnsubscribe_", "", $key);
+		$newsletterArray[$subid]['newsletter_subscribers'] = str_replace(chr(1).USERID, "", $newsletterArray[$subid]['newsletter_subscribers']);
+		$sql -> db_Update("newsletter", "newsletter_subscribers='".$newsletterArray[$subid]['newsletter_subscribers']."' WHERE newsletter_id='".intval($subid)."' ");
+		$requery = true;
+	}
+	else if(strstr($key, "nlSubscribe_"))
+	{
+		$subid = str_replace("nlSubscribe_", "", $key);
+		$newsletterArray[$subid]['newsletter_subscribers'] .= chr(1).USERID;
+		$sql -> db_Update("newsletter", "newsletter_subscribers='".$newsletterArray[$subid]['newsletter_subscribers']."' WHERE newsletter_id='".intval($subid)."' ");
+		$requery = true;
+	}
+}
+
+global $tp;
+
+if($requery)
+{
+	if($sql -> db_Select("newsletter", "*", "newsletter_parent='0' "))
+	{
+		$newsletterArray = $sql -> db_getList();
+	}
+}	
+
+$text = "";
+foreach($newsletterArray as $nl)
+{
+	$text .= "<div style='text-align: center; margin-left: auto; margin-right: auto;'>
+	<form method='post' action='".e_SELF."'>
+	<b>".
+	$tp -> toHTML($nl['newsletter_title'], TRUE)."</b><br />
+	<span class='smalltext'>".
+	$tp -> toHTML($nl['newsletter_text'], TRUE)."</span><br /><br />
+	";
+
+	if(preg_match("#".chr(1).USERID."(".chr(1)."|$)#si", $nl['newsletter_subscribers']))
+	{
+		$text .= NLLAN_48."<br /><br />
+		<input class='button' type='submit' name='nlUnsubscribe_".$nl['newsletter_id']."' value='".NLLAN_51."' onclick=\"return jsconfirm('".$tp->toJS(NLLAN_49)."') \" />
+		";
+	}
+	else
+	{
+		$text .= NLLAN_50." <b>".USEREMAIL."</b> ) ...<br /><br />
+		<input class='button' type='submit' name='nlSubscribe_".$nl['newsletter_id']."' value='".NLLAN_52."' onclick=\"return jsconfirm('".$tp->toJS(NLLAN_53)."') \" />
+		";
+	}
+	$text .= "</form>
+	</div>
+	<br />
+	";
+}
+
+$ns -> tablerender(NLLAN_MENU_CAPTION, $text);
+
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/newsletter/plugin.php 75/e107_plugins/newsletter/plugin.php
--- 6171/e107_plugins/newsletter/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/newsletter/plugin.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,83 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/newsletter/plugin.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."newsletter/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."newsletter/languages/English.php");
+	
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = NLLAN_01;
+$eplug_version = "1.0";
+$eplug_author = "Steve Dunstan (jalist)";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = NLLAN_02;
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";
+	
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "newsletter";
+	
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "newsletter_menu";
+	
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+	
+$eplug_sc = array("");
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/nl_32.png";
+$eplug_icon_small = $eplug_folder."/images/nl_16.png";
+$eplug_caption = NLLAN_03;
+	
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array();
+	
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array("newsletter");
+	
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+
+"CREATE TABLE ".MPREFIX."newsletter (
+  newsletter_id int(10) unsigned NOT NULL auto_increment,
+  newsletter_datestamp int(10) unsigned NOT NULL,
+  newsletter_title varchar(200) NOT NULL,
+  newsletter_text text NOT NULL,
+  newsletter_header text NOT NULL,
+  newsletter_footer text NOT NULL,
+  newsletter_subscribers text NOT NULL,
+  newsletter_parent int(11) NOT NULL,
+  newsletter_flag tinyint(4) NOT NULL,
+  newsletter_issue varchar(100) NOT NULL,
+  PRIMARY KEY  (newsletter_id)
+  ) TYPE=MyISAM;");
+
+	
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$eplug_link_url = "";
+	
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = NLLAN_04;
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/online_extended_menu/languages/English.php 75/e107_plugins/online_extended_menu/languages/English.php
--- 6171/e107_plugins/online_extended_menu/languages/English.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/online_extended_menu/languages/English.php	2005-10-05 17:44:37.000000000 -0500
@@ -1,25 +1,33 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("ONLINE_EL1", "Guests: ");
-define("ONLINE_EL2", "Members: ");
-define("ONLINE_EL3", "On this page: ");
-define("ONLINE_EL4", "Online");
-define("ONLINE_EL5", "Members");
-define("ONLINE_EL6", "Newest member");
-define("ONLINE_EL7", "viewing");
-
-define("ONLINE_EL8", "most ever online: ");
-define("ONLINE_EL9", "on");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/online_extended_menu/languages/English.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/10/05 22:44:37 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+define("ONLINE_EL1", "Guests: ");
+define("ONLINE_EL2", "Members: ");
+define("ONLINE_EL3", "On this page: ");
+define("ONLINE_EL4", "Online");
+define("ONLINE_EL5", "Members");
+define("ONLINE_EL6", "Newest member");
+define("ONLINE_EL7", "viewing");
+	
+define("ONLINE_EL8", "most ever online: ");
+define("ONLINE_EL9", "on");
+
+define("TRACKING_MESSAGE", "Online user tracking is currently disabled, please enable it <a href='".e_ADMIN."users.php?options'>here</a></span><br />");
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/online_extended_menu/online_extended_menu.php 75/e107_plugins/online_extended_menu/online_extended_menu.php
--- 6171/e107_plugins/online_extended_menu/online_extended_menu.php	2004-08-16 12:09:34.000000000 -0500
+++ 75/e107_plugins/online_extended_menu/online_extended_menu.php	2006-02-06 21:03:51.000000000 -0600
@@ -1,50 +1,87 @@
-<?php
-
-	$text = ONLINE_EL1.GUESTS_ONLINE.", ";
-//	if($pref['user_reg'] == 1){
-		$text .= ONLINE_EL2.MEMBERS_ONLINE." ...<br />";
-//	}
-	if(MEMBERS_ONLINE){
-		global $listuserson, $ADMIN_DIRECTORY;
-		foreach($listuserson as $uinfo => $pinfo){
-			
-	
-			list($oid,$oname) = explode(".",$uinfo,2);
-			$online_location_page = substr(strrchr($pinfo, "/"), 1);
-			if($pinfo == "log.php" || $pinfo == "error.php"){ $online_location_page = "news.php"; $pinfo = "news.php"; }
-			if($online_location_page == "request.php"){ $pinfo = "download.php"; }
-			if(strstr($online_location_page, "forum")){ $pinfo = "forum.php"; $online_location_page = "forum.php"; }
-			if(strstr($online_location_page, "content")){ $pinfo = "content.php"; $online_location_page = "content.php"; }
-			if(strstr($online_location_page, "comment")){ $pinfo = "comment.php"; $online_location_page = "comment.php"; }
-			$text .= "<img src='".e_PLUGIN."online_extended_menu/images/user.png' alt='' style='vertical-align:middle' /> <a href='".e_BASE."user.php?id.$oid'>$oname</a> ".ONLINE_EL7;
-      (!strstr($pinfo,$ADMIN_DIRECTORY) ? $text .= " <a href='{$pinfo}'>$online_location_page</a><br />" : $text .= " $online_location_page<br />");
-	   }
-	}
-	
-	if((MEMBERS_ONLINE + GUESTS_ONLINE) > ($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])){
-		$menu_pref['most_members_online'] = MEMBERS_ONLINE;
-		$menu_pref['most_guests_online'] = GUESTS_ONLINE;
-		$menu_pref['most_online_datestamp'] = time();
-		$tmp = addslashes(serialize($menu_pref));
-		$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
-	}
-
-	if(!is_object($gen)){
-		$gen = new convert;
-	}
-
-	$datestamp = $gen->convert_date($menu_pref['most_online_datestamp'], "short");
-	
-	$text .= "<br />".ONLINE_EL8.": ".($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])."<br />(".strtolower(ONLINE_EL2).$menu_pref['most_members_online'].", ".strtolower(ONLINE_EL1).$menu_pref['most_guests_online'].") ".ONLINE_EL9." ".$datestamp."<br />";
-
-	$total_members = $sql -> db_Count("user");
-
-	if($total_members > 1){
-		$newest_member = $sql -> db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
-		$row = $sql -> db_Fetch(); extract($row);
-		$text .= "<br />".ONLINE_EL5.": ".$total_members."<br />".ONLINE_EL6.": <a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>";
-	}
-
-	$ns -> tablerender(ONLINE_EL4, $text);
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/online_extended_menu/online_extended_menu.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/02/07 03:03:51 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+if(!defined("e_TRACKING_DISABLED") && (isset($pref['track_online']) && $pref['track_online'])) {
+	$text = ONLINE_EL1.GUESTS_ONLINE.", ";
+	$text .= ONLINE_EL2.MEMBERS_ONLINE." ...<br />";
+
+	if (MEMBERS_ONLINE) {
+		global $listuserson, $ADMIN_DIRECTORY;
+		foreach($listuserson as $uinfo => $pinfo) {
+
+
+			list($oid, $oname) = explode(".", $uinfo, 2);
+			$online_location_page = substr(strrchr($pinfo, "/"), 1);
+			if ($pinfo == "log.php" || $pinfo == "error.php") {
+				$online_location_page = "news.php";
+				$pinfo = "news.php";
+			}
+			if ($online_location_page == "request.php") {
+				$pinfo = "download.php";
+			}
+			if (strstr($online_location_page, "forum")) {
+				$pinfo = e_PLUGIN."forum/forum.php";
+				$online_location_page = "forum.php";
+			}
+			if (strstr($online_location_page, "content")) {
+				$pinfo = "content.php";
+				$online_location_page = "content.php";
+			}
+			if (strstr($online_location_page, "comment")) {
+				$pinfo = "comment.php";
+				$online_location_page = "comment.php";
+			}
+			$text .= "<img src='".e_IMAGE."admin_images/users_16.png' alt='' style='vertical-align:middle' /> <a href='".e_BASE."user.php?id.$oid'>$oname</a> ".ONLINE_EL7;
+			(!strstr($pinfo, $ADMIN_DIRECTORY) ? $text .= " <a href='{$pinfo}'>$online_location_page</a><br />" : $text .= " $online_location_page<br />");
+		}
+	}
+
+	if ((MEMBERS_ONLINE + GUESTS_ONLINE) > ($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])) {
+		$menu_pref['most_members_online'] = MEMBERS_ONLINE;
+		$menu_pref['most_guests_online'] = GUESTS_ONLINE;
+		$menu_pref['most_online_datestamp'] = time();
+		$tmp = addslashes(serialize($menu_pref));
+		$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
+	}
+
+	if (!is_object($gen)) {
+		$gen = new convert;
+	}
+
+	$datestamp = $gen->convert_date($menu_pref['most_online_datestamp'], "short");
+
+	$text .= "<br />".ONLINE_EL8." ".($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])."<br />(".ONLINE_EL2.$menu_pref['most_members_online'].", ".ONLINE_EL1.$menu_pref['most_guests_online'].") ".ONLINE_EL9." ".$datestamp."<br />";
+
+	$total_members = $sql->db_Count("user");
+
+	if ($total_members > 1) {
+		$newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
+		$row = $sql->db_Fetch();
+		extract($row);
+		$text .= "<br />".ONLINE_EL5.": ".$total_members."<br />".ONLINE_EL6.": <a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>";
+	}
+} else {
+	$text = TRACKING_MESSAGE;
+}
+
+
+$ns->tablerender(ONLINE_EL4, $text, 'online_extended');
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/online_menu/languages/English.php 75/e107_plugins/online_menu/languages/English.php
--- 6171/e107_plugins/online_menu/languages/English.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/online_menu/languages/English.php	2005-10-13 08:12:13.000000000 -0500
@@ -1,22 +1,27 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("ONLINE_L1", "Guests: ");
-define("ONLINE_L2", "Members: ");
-define("ONLINE_L3", "On this page: ");
-define("ONLINE_L4", "Online");
-define("ONLINE_L5", "Members");
-define("ONLINE_L6", "newest");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/online_menu/languages/English.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/10/13 13:12:13 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+define("ONLINE_L1", "Guests: ");
+define("ONLINE_L2", "Members: ");
+define("ONLINE_L3", "On this page: ");
+define("ONLINE_L4", "Online");
+define("ONLINE_L5", "Members");
+define("ONLINE_L6", "newest");
+define("TRACKING_MESSAGE", "Online user tracking is currently disabled, please enable it <a href='".e_ADMIN."users.php?options'>here</a><br />");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/online_menu/online_menu.php 75/e107_plugins/online_menu/online_menu.php
--- 6171/e107_plugins/online_menu/online_menu.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/online_menu/online_menu.php	2005-12-14 13:28:52.000000000 -0600
@@ -1,18 +1,53 @@
-<?php
-$text = ONLINE_L1.GUESTS_ONLINE."<br />";
-//if($pref['user_reg'] == 1){
-	$text .= ONLINE_L2.MEMBERS_ONLINE.(MEMBERS_ONLINE ? ", ": "").MEMBER_LIST."<br />";
-//}
-$text .= ONLINE_L3.ON_PAGE;
-$caption = (file_exists(THEME."images/online_menu.png") ? "<img src='".THEME."images/online_menu.png' alt='' /> ".ONLINE_L4 : ONLINE_L4);
-
-$total_members = $sql -> db_Count("user");
-
-if($total_members > 1){
-	$newest_member = $sql -> db_Select("user", "user_id, user_name", "ORDER BY user_join DESC LIMIT 0,1", "no_where");
-	$row = $sql -> db_Fetch(); extract($row);
-	$text .= "<br />".ONLINE_L5.": ".$total_members.", ".ONLINE_L6.": <a href='".e_BASE."user.php?id.$user_id'>$user_name</a>";
-}
-
-$ns -> tablerender($caption, $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/online_menu/online_menu.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$caption = (file_exists(THEME."images/online_menu.png") ? "<img src='".THEME."images/online_menu.png' alt='' /> ".ONLINE_L4 : ONLINE_L4);
+
+if(!defined("e_TRACKING_DISABLED") && (isset($pref['track_online']) && $pref['track_online'])) {
+	$text = ONLINE_L1.GUESTS_ONLINE."<br />";
+	//if($pref['user_reg'] == 1){
+	$text .= ONLINE_L2.MEMBERS_ONLINE.(MEMBERS_ONLINE ? ", ": "").MEMBER_LIST."<br />";
+	//}
+	$text .= ONLINE_L3.ON_PAGE;
+	
+	global $e107cache;
+	$members_totals = $e107cache->retrieve("online_menu_totals", 120);
+	if($members_totals == false) {
+		$total_members = $sql->db_Count("user");
+		$newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
+		$row = $sql->db_Fetch();
+		extract($row);
+		$members_totals = "<br />".ONLINE_L5.": ".$total_members.", ".ONLINE_L6.": <a href='".e_HTTP."user.php?id.{$user_id}'>{$user_name}</a>";
+		$e107cache->set("online_menu_totals", $members_totals);
+	}
+	$text .= $members_totals;
+	
+} else {
+	if(ADMIN) {
+		$text = TRACKING_MESSAGE;
+	} else {
+		return;
+	}
+}
+
+$ns->tablerender($caption, $text, 'online');
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/other_news_menu/languages/English.php 75/e107_plugins/other_news_menu/languages/English.php
--- 6171/e107_plugins/other_news_menu/languages/English.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/other_news_menu/languages/English.php	2005-01-27 13:53:12.000000000 -0600
@@ -1,17 +1,15 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("TD_MENU_L1", "Other News");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/other_news_menu/languages/English.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:53:12 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+	
+define("TD_MENU_L1", "Other News");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/other_news_menu/other_news2_menu.php 75/e107_plugins/other_news_menu/other_news2_menu.php
--- 6171/e107_plugins/other_news_menu/other_news2_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/other_news_menu/other_news2_menu.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,121 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/other_news_menu/other_news2_menu.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// require_once("othernews_parser.php");
+require_once(e_HANDLER."news_class.php");
+unset($text);
+global $OTHERNEWS2_STYLE;
+$ix = new news;
+
+if(!$OTHERNEWS2_STYLE){
+	$OTHERNEWS2_STYLE = "
+	<table class='forumheader3' cellpadding='0' cellspacing='0' style='width:100%'>
+	<tr><td class='caption2' colspan='2' style='padding:3px;text-decoration:none;'>
+	{NEWSCATICON}
+	{NEWSCATEGORY}
+	</td></tr>
+	<tr><td  style='padding:3px;vertical-align:top'>
+	{NEWSTITLELINK}
+	<br />
+	{NEWSSUMMARY}
+	</td>
+	<td style='padding:3px'>
+	{NEWSTHUMBNAIL}
+	</td>
+	</tr>
+	</table>
+	";
+}
+
+if(!defined("OTHERNEWS2_LIMIT")){
+	define("OTHERNEWS2_LIMIT",5);
+}
+
+if(!defined("OTHERNEWS2_ITEMLINK")){
+	define("OTHERNEWS2_ITEMLINK","");
+}
+if(!defined("OTHERNEWS2_CATLINK")){
+	define("OTHERNEWS2_CATLINK","");
+}
+if(!defined("OTHERNEWS2_CATICON")){
+	define("OTHERNEWS2_CATICON","border:0px");
+}
+if(!defined("OTHERNEWS2_THUMB")){
+	define("OTHERNEWS2_THUMB","border:0px");
+}
+
+if(!defined("OTHERNEWS2_COLS")){
+	define("OTHERNEWS2_COLS","1");
+}
+
+if(!defined("OTHERNEWS2_CELL")){
+	define("OTHERNEWS2_CELL","padding:0px;vertical-align:top");
+}
+
+if(!defined("OTHERNEWS2_SPACING")){
+	define("OTHERNEWS2_SPACING","0");
+}
+
+$param['itemlink'] = OTHERNEWS2_ITEMLINK;
+$param['thumbnail'] = OTHERNEWS2_THUMB;
+$param['catlink'] = OTHERNEWS2_CATLINK;
+$param['caticon'] = OTHERNEWS2_CATICON;
+
+$style = OTHERNEWS2_CELL;
+$nbr_cols = OTHERNEWS2_COLS;
+
+$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class IN (".USERCLASS_LIST.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type=3  ORDER BY n.news_datestamp DESC LIMIT 0,".OTHERNEWS2_LIMIT;
+
+	if ($sql->db_Select_gen($query)){
+    $text = "<table style='width:100%' cellpadding='0' cellspacing='".OTHERNEWS2_SPACING."'>";
+    $t = 0;
+	$wid = floor(100/$nbr_cols);
+	while ($row = $sql->db_Fetch()) {
+		$text .= ($t % $nbr_cols == 0) ? "<tr>" : "";
+		$text .= "\n<td style='$style ; width:$wid%;'>\n";
+
+
+		$text .= $ix->render_newsitem($row, 'return', '', $OTHERNEWS2_STYLE, $param);
+
+
+    	$text .= "\n</td>\n";
+		if (($t+1) % $nbr_cols == 0) {
+			$text .= "</tr>";
+			$t++;
+		} else {
+			$t++;
+		}
+	}
+
+
+    while ($t % $nbr_cols != 0){
+		$text .= "<td style='width:$wid'>&nbsp;</td>\n";
+		$text .= (($t+1) % nbr_cols == 0) ? "</tr>" : "";
+		$t++;
+	}
+	$text .= "</table>";
+
+	$ns->tablerender(TD_MENU_L1, $text, 'other_news2');
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/other_news_menu/other_news_menu.php 75/e107_plugins/other_news_menu/other_news_menu.php
--- 6171/e107_plugins/other_news_menu/other_news_menu.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/other_news_menu/other_news_menu.php	2005-12-14 13:28:52.000000000 -0600
@@ -1,29 +1,113 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/alt_news.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-unset($text);
-
-
-if($sql -> db_Select("news", "*", "news_render_type=2 ORDER BY news_datestamp DESC LIMIT 0,10")){
-	unset($text);
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		if(check_class($news_class)){
-			$text .= "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."news.php?item.$news_id'>$news_title</a><br />\n";
-		}
-	}
-	$ns -> tablerender(TD_MENU_L1, $text);
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/other_news_menu/other_news_menu.php,v $
+|     $Revision: 1.16 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// require_once("othernews_parser.php");
+require_once(e_HANDLER."news_class.php");
+unset($text);
+global $OTHERNEWS_STYLE;
+$ix = new news;
+
+ if(!$OTHERNEWS_STYLE){
+$OTHERNEWS_STYLE = "
+			<div style='padding:3px;width:100%'>
+			<table style='border-bottom:1px solid black;width:100%' cellpadding='0' cellspacing='0'>
+			<tr>
+			<td style='vertical-align:top;padding:3px;width:20px'>
+			{NEWSCATICON}
+			</td><td style='text-align:left;padding:3px;vertical-align:top'>
+			{NEWSTITLELINK}
+			</td></tr></table>
+			</div>\n";
+ }
+if(!defined("OTHERNEWS_LIMIT")){
+	define("OTHERNEWS_LIMIT",10);
+}
+
+if(!defined("OTHERNEWS_ITEMLINK")){
+	define("OTHERNEWS_ITEMLINK","");
+}
+
+if(!defined("OTHERNEWS_CATLINK")){
+	define("OTHERNEWS_CATLINK","");
+}
+if(!defined("OTHERNEWS_THUMB")){
+	define("OTHERNEWS_THUMB","border:0px");
+}
+if(!defined("OTHERNEWS_CATICON")){
+	define("OTHERNEWS_CATICON","border:0px");
+}
+
+if(!defined("OTHERNEWS_COLS")){
+	define("OTHERNEWS_COLS","1");
+}
+
+if(!defined("OTHERNEWS_CELL")){
+	define("OTHERNEWS_CELL","padding:0px;vertical-align:top");
+}
+
+if(!defined("OTHERNEWS_SPACING")){
+	define("OTHERNEWS_SPACING","0");
+}
+
+$param['itemlink'] = OTHERNEWS_ITEMLINK;
+$param['thumbnail'] = OTHERNEWS_THUMB;
+$param['catlink'] = OTHERNEWS_CATLINK;
+$param['caticon'] = OTHERNEWS_CATICON;
+
+$style = OTHERNEWS_CELL;
+$nbr_cols = OTHERNEWS_COLS;
+
+
+	$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class IN (".USERCLASS_LIST.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type=2  ORDER BY n.news_datestamp DESC LIMIT 0,".OTHERNEWS_LIMIT;
+
+	if ($sql->db_Select_gen($query)){
+    $text = "<table style='width:100%' cellpadding='0' cellspacing='".OTHERNEWS_SPACING."'>";
+    $t = 0;
+	$wid = floor(100/$nbr_cols);
+		while ($row = $sql->db_Fetch()) {
+		$text .= ($t % $nbr_cols == 0) ? "<tr>" : "";
+		$text .= "\n<td style='$style ; width:$wid%;'>\n";
+		$text .= $ix->render_newsitem($row, 'return', '', $OTHERNEWS_STYLE, $param);
+
+    	$text .= "\n</td>\n";
+		if (($t+1) % $nbr_cols == 0) {
+			$text .= "</tr>";
+			$t++;
+		} else {
+			$t++;
+		}
+	}
+
+
+    while ($t % $nbr_cols != 0){
+		$text .= "<td style='width:$wid'>&nbsp;</td>\n";
+		$text .= (($t+1) % nbr_cols == 0) ? "</tr>" : "";
+		$t++;
+
+		}
+	$text .= "</table>";
+
+		$ns->tablerender(TD_MENU_L1, $text, 'other_news');
+	}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pdf/admin_pdf_config.php 75/e107_plugins/pdf/admin_pdf_config.php
--- 6171/e107_plugins/pdf/admin_pdf_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/admin_pdf_config.php	2006-01-16 04:36:59.000000000 -0600
@@ -0,0 +1,188 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|    e107 website system
+|
+|    Steve Dunstan 2001-2002
+|    http://e107.org
+|    jalist@e107.org
+|
+|    Released under the terms and conditions of the
+|    GNU General Public License (http://gnu.org).
+|
+|    $Source: /cvsroot/e107/e107_0.7/e107_plugins/pdf/admin_pdf_config.php,v $
+|    $Revision: 1.2 $
+|    $Date: 2006/01/16 10:36:59 $
+|    $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+require_once("../../class2.php");
+require_once(e_ADMIN."auth.php");
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+e107_require_once(e_HANDLER.'arraystorage_class.php');
+$eArrayStorage = new ArrayData();
+unset($text);
+
+$lan_file = e_PLUGIN."pdf/languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."pdf/languages/English.php");
+
+if(isset($_POST['update_pdf'])){
+	$message = updatePDFPrefs();
+}
+
+function updatePDFPrefs(){
+	global $sql, $eArrayStorage, $tp;
+	while(list($key, $value) = each($_POST)){
+		foreach($_POST as $k => $v){
+			if(strpos($k, "pdf_") === 0){
+				$pdfpref[$k] = $tp->toDB($v);
+			}
+		}
+	}
+	$tmp = $eArrayStorage->WriteArray($pdfpref);
+	$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='pdf' ");
+
+	$message = PDF_LAN_18;
+	return $message;
+}
+
+function getDefaultPDFPrefs(){
+		$pdfpref['pdf_margin_left']				= '25';
+		$pdfpref['pdf_margin_right']			= '15';
+		$pdfpref['pdf_margin_top']				= '15';
+		$pdfpref['pdf_font_family']				= 'arial';
+		$pdfpref['pdf_font_size']				= '8';
+		$pdfpref['pdf_font_size_sitename']		= '14';
+		$pdfpref['pdf_font_size_page_url']		= '8';
+		$pdfpref['pdf_font_size_page_number']	= '8';
+		$pdfpref['pdf_show_logo']				= true;
+		$pdfpref['pdf_show_sitename']			= false;
+		$pdfpref['pdf_show_page_url']			= true;
+		$pdfpref['pdf_show_page_number']		= true;
+		$pdfpref['pdf_error_reporting']			= true;
+		return $pdfpref;
+}
+
+function getPDFPrefs(){
+	global $sql, $eArrayStorage;
+
+	if(!is_object($sql)){ $sql = new db; }
+	$num_rows = $sql -> db_Select("core", "*", "e107_name='pdf' ");
+	if($num_rows == 0){
+		$tmp = getDefaultPDFPrefs();
+		$tmp2 = $eArrayStorage->WriteArray($tmp);
+		$sql -> db_Insert("core", "'pdf', '".$tmp2."' ");
+		$sql -> db_Select("core", "*", "e107_name='pdf' ");
+	}
+	$row = $sql -> db_Fetch();
+	$pdfpref = $eArrayStorage->ReadArray($row['e107_value']);
+	return $pdfpref;
+}
+
+if(isset($message)){
+	$caption = PDF_LAN_1;
+	$ns -> tablerender($caption, $message);
+}
+
+$pdfpref = getPDFPrefs();
+
+if(!is_object($sql)){ $sql = new db; }
+
+$text = "
+<div style='text-align:center'>
+".$rs -> form_open("post", e_SELF, "pdfform", "", "enctype='multipart/form-data'")."
+<table class='fborder' style='".ADMIN_WIDTH."'>
+
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_5."</td>
+	<td class='forumheader3' style='width:70%;'>".$rs -> form_text("pdf_margin_left", 74, $pdfpref['pdf_margin_left'], 250)."</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_6."</td>
+	<td class='forumheader3' style='width:70%;'>".$rs -> form_text("pdf_margin_right", 74, $pdfpref['pdf_margin_right'], 250)."</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_7."</td>
+	<td class='forumheader3' style='width:70%;'>".$rs -> form_text("pdf_margin_top", 74, $pdfpref['pdf_margin_top'], 250)."</td>
+</tr>";
+
+$fontlist=array("arial","times","courier","helvetica","symbol");
+$text .= "
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_8."</td>
+	<td class='forumheader3' style='width:70%;'>
+		".$rs -> form_select_open("pdf_font_family");
+		foreach($fontlist as $font){
+			$text .= $rs -> form_option($font, ($pdfpref['pdf_font_family'] == $font ? "1" : "0"), $font);
+		}
+		$text .= $rs -> form_select_close()."
+	</td>
+</tr>
+
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_9."</td>
+	<td class='forumheader3' style='width:70%;'>".$rs -> form_text("pdf_font_size", 74, $pdfpref['pdf_font_size'], 250)."</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_10."</td>
+	<td class='forumheader3' style='width:70%;'>".$rs -> form_text("pdf_font_size_sitename", 74, $pdfpref['pdf_font_size_sitename'], 250)."</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_11."</td>
+	<td class='forumheader3' style='width:70%;'>".$rs -> form_text("pdf_font_size_page_url", 74, $pdfpref['pdf_font_size_page_url'], 250)."</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_12."</td>
+	<td class='forumheader3' style='width:70%;'>".$rs -> form_text("pdf_font_size_page_number", 74, $pdfpref['pdf_font_size_page_number'], 250)."</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_13."</td>
+	<td class='forumheader3' style='width:70%;'>
+		".$rs -> form_radio("pdf_show_logo", "1", ($pdfpref['pdf_show_logo'] ? "1" : "0"), "", "").PDF_LAN_3."
+		".$rs -> form_radio("pdf_show_logo", "0", ($pdfpref['pdf_show_logo'] ? "0" : "1"), "", "").PDF_LAN_4."
+	</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_14."</td>
+	<td class='forumheader3' style='width:70%;'>
+		".$rs -> form_radio("pdf_show_sitename", "1", ($pdfpref['pdf_show_sitename'] ? "1" : "0"), "", "").PDF_LAN_3."
+		".$rs -> form_radio("pdf_show_sitename", "0", ($pdfpref['pdf_show_sitename'] ? "0" : "1"), "", "").PDF_LAN_4."
+	</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_15."</td>
+	<td class='forumheader3' style='width:70%;'>
+		".$rs -> form_radio("pdf_show_page_url", "1", ($pdfpref['pdf_show_page_url'] ? "1" : "0"), "", "").PDF_LAN_3."
+		".$rs -> form_radio("pdf_show_page_url", "0", ($pdfpref['pdf_show_page_url'] ? "0" : "1"), "", "").PDF_LAN_4."
+	</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_16."</td>
+	<td class='forumheader3' style='width:70%;'>
+		".$rs -> form_radio("pdf_show_page_number", "1", ($pdfpref['pdf_show_page_number'] ? "1" : "0"), "", "").PDF_LAN_3."
+		".$rs -> form_radio("pdf_show_page_number", "0", ($pdfpref['pdf_show_page_number'] ? "0" : "1"), "", "").PDF_LAN_4."
+	</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:30%; white-space:nowrap;'>".PDF_LAN_20."</td>
+	<td class='forumheader3' style='width:70%;'>
+		".$rs -> form_radio("pdf_error_reporting", "1", ($pdfpref['pdf_error_reporting'] ? "1" : "0"), "", "").PDF_LAN_3."
+		".$rs -> form_radio("pdf_error_reporting", "0", ($pdfpref['pdf_error_reporting'] ? "0" : "1"), "", "").PDF_LAN_4."
+	</td>
+</tr>
+
+<tr>
+	<td style='text-align:center' class='forumheader' colspan='2'>".$rs -> form_button("submit", "update_pdf", PDF_LAN_17)."</td>
+</tr>
+
+</table>
+".$rs -> form_close()."
+</div>";
+
+$ns -> tablerender(PDF_LAN_2, $text);
+
+require_once(e_ADMIN."footer.php");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pdf/e107pdf.php 75/e107_plugins/pdf/e107pdf.php
--- 6171/e107_plugins/pdf/e107pdf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/e107pdf.php	2006-04-06 08:50:26.000000000 -0500
@@ -0,0 +1,631 @@
+<?php
+
+//extend fpdf class from package with custom functions
+class e107PDF extends UFPDF{
+	
+	//variables of html parser
+	var $B;
+	var $I;
+	var $U;
+	var $HREF;
+	var $CENTER='';
+	var $ALIGN='';
+	var $IMG;
+	var $SRC;
+	var $WIDTH;
+	var $HEIGHT;
+	var $fontList;
+	var $issetfont;
+	var $issetcolor;
+	var $iminfo=array(0,0);
+	
+	function e107PDF($orientation='P',$unit='mm',$format='A4'){
+		global $pdfpref;
+		//Call parent constructor
+		$this->UFPDF($orientation,$unit,$format);
+		//Initialization
+		$this->B=0;
+		$this->I=0;
+		$this->U=0;
+		$this->BLOCKQUOTE='';
+		$this->HREF='';
+		$this->CENTER='';
+		$this->ALIGN='';
+		$this->IMG='';
+		$this->SRC='';
+		$this->WIDTH='';
+		$this->HEIGHT='';
+		$this->fontlist=array("arial","times","courier","helvetica","symbol");
+
+		$this->issetfont=false;
+		$this->issetcolor=false;
+	}
+
+	//default preferences if none present
+	function getDefaultPDFPrefs(){
+			$pdfpref['pdf_margin_left']				= '25';
+			$pdfpref['pdf_margin_right']			= '15';
+			$pdfpref['pdf_margin_top']				= '15';
+			$pdfpref['pdf_font_family']				= 'arial';
+			$pdfpref['pdf_font_size']				= '8';
+			$pdfpref['pdf_font_size_sitename']		= '14';
+			$pdfpref['pdf_font_size_page_url']		= '8';
+			$pdfpref['pdf_font_size_page_number']	= '8';
+			$pdfpref['pdf_show_logo']				= true;
+			$pdfpref['pdf_show_sitename']			= false;
+			$pdfpref['pdf_show_page_url']			= true;
+			$pdfpref['pdf_show_page_number']		= true;
+			$pdfpref['pdf_error_reporting']			= true;
+			return $pdfpref;
+	}
+	//get preferences from db
+	function getPDFPrefs(){
+		global $sql, $eArrayStorage;
+
+		if(!is_object($eArrayStorage)){
+			e107_require_once(e_HANDLER.'arraystorage_class.php');
+			$eArrayStorage = new ArrayData();
+		}
+
+		if(!is_object($sql)){ $sql = new db; }
+		$num_rows = $sql -> db_Select("core", "*", "e107_name='pdf' ");
+		if($num_rows == 0){
+			$tmp = $this->getDefaultPDFPrefs();
+			$tmp2 = $eArrayStorage->WriteArray($tmp);
+			$sql -> db_Insert("core", "'pdf', '".$tmp2."' ");
+			$sql -> db_Select("core", "*", "e107_name='pdf' ");
+		}
+		$row = $sql -> db_Fetch();
+		$pdfpref = $eArrayStorage->ReadArray($row['e107_value']);
+		return $pdfpref;
+	}
+
+	function toPDF($text){
+		$search = array('&#39;', '&#039;', '&#036;', '&quot;');
+		$replace = array("'", "'", '$', '"');
+		$text = str_replace($search, $replace, $text);
+		return $text;
+	}
+
+	function toPDFTitle($text){
+		$search = array(":", "*", "?", '"', '<', '>', '|');
+		$replace = array('-', '-', '-', '-', '-', '-', '-');
+		$text = str_replace($search, $replace, $text);
+		return $text;
+	}
+
+	/*
+	The makePDF function does all the real parsing and composing
+	input argument $text needs to be an array containing the following:
+	$text = array($text, $creator, $author, $title, $subject, $keywords, $url);
+	*/
+	function makePDF($text){
+		global $tp, $pdfpref;
+
+		//call get preferences
+		$pdfpref = $this->getPDFPrefs();
+
+		//define logo and source pageurl (before the parser!)
+		if(is_readable(THEME."images/logopdf.png")){
+			$logo = THEME."images/logopdf.png";
+		}else{
+			$logo = e_IMAGE."logo.png";
+		}
+		define('PDFLOGO', $logo);					//define logo to add in header
+		define('PDFPAGEURL', $text[6]);				//define page url to add in header
+
+		//parse the data
+		$text[3] = $this->toPDF($text[3]);					//replace some in the title
+		$text[3] = $this->toPDFTitle($text[3]);			//replace some in the title
+		foreach($text as $k=>$v){
+			$text[$k] = $tp->toHTML($v, TRUE);
+		}
+		
+		//set some variables
+		$this->SetMargins($pdfpref['pdf_margin_left'],$pdfpref['pdf_margin_top'],$pdfpref['pdf_margin_right']);
+		//$this->SetAutoPageBreak(true,25);
+
+		//start creating the pdf and adding the data
+		$this->AliasNbPages();						//calculate current page + number of pages
+		$this->AddPage();							//start page
+		$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);				//set font
+		$this->WriteHTML($text[0], true);			//write text
+		$this->SetCreator($text[1]);				//name of creator
+		$this->SetAuthor($text[2]);					//name of author
+		$this->SetTitle($text[3]);					//title
+		$this->SetSubject($text[4]);				//subject
+		$this->SetKeywords($text[5]);				//space/comma seperated
+		$file = $text[3].".pdf";					//name of the file
+		$this->Output($file, 'D');					//Save PDF to file (D = output to download window)
+		return;
+	}
+
+
+	//create a header; this will be added on each page
+	function Header(){
+		global $pdfpref;
+
+		$this->SetY(15);
+		$y0 = $this->GetY();
+		if($pdfpref['pdf_show_logo']){
+			$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);			
+			$this->PutImage(PDFLOGO, '1');
+			$x1 = $this->GetX();
+			$y1 = $this->GetY();
+
+			$image_wh = getimagesize(PDFLOGO);
+			$newx = $x1 + ($image_wh[0]/$this->k);
+			$newy = ($image_wh[1]/$this->k);
+
+			$a=$this->GetStringWidth(SITENAME);
+			$b=$this->GetStringWidth(PDFPAGEURL);
+			if($a>$b){$c=$a;}else{$c=$b;}
+			if($x1+$newx+$c > 210){
+				$this->SetX($this->lMargin);
+				$this->SetY($y1+2);
+			}else{
+				if($pdfpref['pdf_show_sitename']){
+					$m = 5;
+				}
+				if($pdfpref['pdf_show_page_url']){
+					$m += 5;
+				}
+				if($pdfpref['pdf_show_page_number']){
+					$m += 5;
+				}
+				$y = $this->GetY();
+				$this->SetY($y-$m);
+			}
+		}
+		$cellwidth	= 210-$this->lMargin-$this->rMargin;
+		$align		= "R";
+		if($pdfpref['pdf_show_sitename']){
+			$this->SetFont($pdfpref['pdf_font_family'],'B',$pdfpref['pdf_font_size_sitename']);
+			$this->Cell($cellwidth,5,SITENAME,0,1,$align);
+		}
+		if($pdfpref['pdf_show_page_url']){
+			$this->SetFont($pdfpref['pdf_font_family'],'I',$pdfpref['pdf_font_size_page_url']);
+			$this->Cell($cellwidth,5,PDFPAGEURL,0,1,$align,'',PDFPAGEURL);
+		}
+		if($pdfpref['pdf_show_page_number']){
+			$this->SetFont($pdfpref['pdf_font_family'],'I',$pdfpref['pdf_font_size_page_number']);
+			$this->Cell($cellwidth,5,PDF_LAN_19.' '.$this->PageNo().'/{nb}',0,1,$align);
+		}
+		$y = $this->GetY()+2;
+		$this->Line($this->lMargin, $y, 210-$this->rMargin, $y);
+		$this->Ln(10);
+		$this->SetX($this->lMargin);
+		$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);
+	}
+
+	function txtentities($html){
+		$html = str_replace("\r\n", "\\n", $html);
+		$html = str_replace("\r", "", $html);
+		$trans_tbl = get_html_translation_table (HTML_ENTITIES);
+		$trans_tbl = array_flip ($trans_tbl);
+		return strtr ($html, $trans_tbl);
+	}
+
+	//function hex2dec
+	//returns an associative array (keys: R,G,B) from
+	//a hex html code (e.g. #3FE5AA)
+	function hex2dec($couleur = "#000000"){
+		$R = substr($couleur, 1, 2);
+		$rouge = hexdec($R);
+		$V = substr($couleur, 3, 2);
+		$vert = hexdec($V);
+		$B = substr($couleur, 5, 2);
+		$bleu = hexdec($B);
+		$tbl_couleur = array();
+		$tbl_couleur['R']=$rouge;
+		$tbl_couleur['G']=$vert;
+		$tbl_couleur['B']=$bleu;
+		return $tbl_couleur;
+	}
+
+	function WriteHTML($html,$scale){
+
+		$search		= array("\n", "<br />", "<hr />", '&raquo;', '&ordm;', '&middot', '&trade;', '&copy;', '&euro;', '&#091;', '&amp;#091;', '&nbsp;', 'â€˜', 'â€™', ' />', '&#40;', '&#41;', '&#123;', '&#125;', '&#91;', '&#93;');
+		$replace	= array(" ", "<br>", "<hr>", '»', 'º', '·', '™', '©', '', '[', '[', ' ', "'", "'", '>', '(', ')', '{', '}', '[',']' );
+		//replace carriage returns by spaces, and some html variants
+		$html=str_replace($search, $replace, $html);
+		$a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE); //explodes the string
+
+		foreach($a as $i=>$e)
+		{
+			if($i%2==0)
+			{
+				//Text
+				if($this->HREF){
+					$this->PutLink($this->HREF,$e);
+					$this->HREF='';
+				}elseif($this->IMG){
+					//correct url
+					if(is_readable($this->SRC)){
+						$file = $this->SRC;
+						$pos=strrpos($file,'.');
+						$type=substr($file,$pos+1);
+						$type=strtolower($type);
+						//for now only jpg, jpeg and png are supported
+						if($type=='jpg' || $type=='jpeg' || $type=='png'){
+
+							$url = str_replace("../", "", $this->SRC);
+							$imgsearch = array(e_IMAGE, e_THEME, e_PLUGIN, e_FILE, e_HANDLER);
+							//e_BASE and e_ADMIN are not taken into account !
+							foreach($imgsearch as $p){
+								$p = str_replace("../", "", $p);
+								$l = strpos($url, $p);
+								if ($l !== false) {
+									$url = SITEURL.$url;
+								}
+							}
+							$this->Ln(2);
+							$this->PutImage($url,$scale);
+							$this->Ln(2);
+							$this->SetX($this->lMargin);
+						}
+					}
+					$this->IMG='';
+					$this->SRC='';
+					$this->WIDTH='';
+					$this->HEIGHT='';
+
+				}elseif($this->CENTER){
+					$this->Cell(0,5,$e,0,1,'C');
+				}elseif($this->ALIGN == 'center'){
+					$this->Cell(0,5,$e,0,1,'C');
+				}elseif($this->ALIGN == 'right'){
+					$this->Cell(0,5,$e,0,1,'R');
+				}elseif($this->ALIGN == 'left'){
+					$this->Cell(0,5,$e,0,1,'L');
+				}elseif($this->BLOCKQUOTE == 'BLOCKQUOTE'){
+					$this->SetFont('Courier','',11);
+					$this->SetStyle('B',true);
+					$this->SetStyle('I',true);
+					$this->Cell(0,5,$e,1,1,'L');
+					$this->SetStyle('B',false);
+					$this->SetStyle('I',false);
+					if ($this->issetcolor==true) {
+						$this->SetTextColor(0);
+						$this->issetcolor=false;
+					}
+					$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);
+				}else{
+					$this->Write(5,stripslashes($this->txtentities($e)));
+				}
+			}
+			else
+			{
+				//Tag
+				if($e{0}=='/'){
+					$this->CloseTag(strtoupper(substr($e,1)));
+				}else{
+					//Extract attributes
+					$a2=explode(' ',$e);
+					$tag=strtoupper(array_shift($a2));
+					$attr=array();
+					foreach($a2 as $v){
+						if(ereg('^([^=]*)=["\']?([^"\']*)["\']?$',$v,$a3)){
+							$attr[strtoupper($a3[1])]=$a3[2];
+						}
+					}
+					$this->OpenTag($tag,$attr,$scale);
+				}
+			}
+		}
+	}
+
+	function OpenTag($tag,$attr,$scale){
+		$tag = strtoupper($tag);
+		//Opening tag
+
+		switch($tag){
+			case 'STRONG':
+				$this->SetStyle('B',true);
+				break;
+			case 'EM':
+				$this->SetStyle('I',true);
+				break;
+			case 'B':
+			case 'I':
+			case 'U':
+				$this->SetStyle($tag,true);
+				break;
+			case 'A':
+				$this->HREF=$attr['HREF'];
+				break;
+			case 'P':
+				$this->ALIGN=$attr['ALIGN'];
+				break;
+			case 'SPAN':
+				if(isset($attr['STYLE'])){
+					if($attr['STYLE'] == 'text-decoration:underline'){
+						$this->SetStyle('U',true);
+					}
+					if(strstr($attr['STYLE'], 'color:')){
+						$attr['COLOR'] = substr($attr['STYLE'],6);
+						$coul=$this->hex2dec($attr['COLOR']);
+						$this->SetTextColor($coul['R'],$coul['G'],$coul['B']);
+						$this->issetcolor=true;
+					}
+					if(strstr($attr['STYLE'], 'font-size:')){
+						$attr['FONTSIZE'] = intval(substr($attr['STYLE'],10));
+						$this->SetFont('','',$attr['FONTSIZE']);
+						$this->issetfont=true;
+					}
+					break;
+				}
+			case 'DIV':
+				if($attr['STYLE'] == 'text-align:center'){
+					$this->ALIGN='center';
+				}
+				if($attr['STYLE'] == 'text-align:left'){
+					$this->ALIGN='left';
+				}
+				if($attr['STYLE'] == 'text-align:right'){
+					$this->ALIGN='right';
+				}
+				if($attr['CLASS'] == 'indent'){
+					// $this->BLOCKQUOTE='BLOCKQUOTE';
+				}
+				break;
+			case 'IMG':
+				$this->IMG=true;
+				$this->SRC=$attr['SRC'];
+				$this->WIDTH=$attr['WIDTH'];
+				$this->HEIGHT=$attr['HEIGHT'];
+				break;
+			case 'TR':
+				break;
+			case 'TD':
+				break;
+			case 'CODE':
+			case 'BLOCKQUOTE':
+			case 'PRE':
+                $this->Ln(5);
+				$this->SetFont('Courier','',11);
+				$this->issetcolor=true;
+				$this->issetfont=true;
+                $this->SetStyle('B',true);
+                $this->SetStyle('I',true);
+                break;
+			case 'LI':
+                $this->Write(5,'     » ');
+                break;
+			case 'BR':
+				$this->Ln(5);
+				break;
+			case 'HR':
+				if( $attr['WIDTH'] != '' ) $Width = $attr['WIDTH'];
+				else $Width = $this->w - $this->lMargin-$this->rMargin;
+				$this->Ln(2);
+				$x = $this->GetX();
+				$y = $this->GetY();
+				$this->SetLineWidth(0.4);
+				$this->Line($x,$y,$x+$Width,$y);
+				$this->SetLineWidth(0.2);
+				$this->Ln(2);
+				break;
+			case 'FONT':
+				if (isset($attr['COLOR']) && $attr['COLOR']!='') {
+					$coul=$this->hex2dec($attr['COLOR']);
+					$this->SetTextColor($coul['R'],$coul['G'],$coul['B']);
+					$this->issetcolor=true;
+				}
+				if (isset($attr['FACE']) && in_array(strtolower($attr['FACE']), $this->fontlist)) {
+					$this->SetFont(strtolower($attr['FACE']));
+					$this->issetfont=true;
+				}
+				break;
+			case 'H1':
+                $this->Ln(5);
+                $this->SetFontSize(22);
+				$this->issetfont=true;
+                break;
+            case 'H2':
+                $this->Ln(5);
+                $this->SetFontSize(18);
+				$this->issetfont=true;
+                $this->SetStyle('U',true);
+                break;
+            case 'H3':
+                $this->Ln(5);
+                $this->SetFontSize(16);
+				$this->issetfont=true;
+                $this->SetStyle('U',true);
+                break;
+            case 'H4':
+                $this->Ln(5);
+                $this->SetFontSize(14);
+				$this->issetfont=true;
+				$this->SetStyle('B',true);
+                break;
+            
+		}
+	}
+
+	function CloseTag($tag){
+		global $pdfpref;
+
+		if ($this->issetcolor==true) {
+			$this->SetTextColor(0);
+		}
+		if ($this->issetfont==true) {
+			$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);
+			$this->issetfont=false;
+		}
+
+		 $tag = strtoupper($tag);
+		 //Closing tag
+		if($tag=='SPAN'){
+			$tag='U';
+			if ($this->issetcolor==true) {
+				$this->SetTextColor(0);
+			}
+			if ($this->issetfont==true) {
+				$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);
+				$this->issetfont=false;
+			}
+		}
+		if($tag=='DIV'){
+			$tag='DIV';
+			$this->ALIGN='';
+			$this->BLOCKQUOTE='';
+		}
+		if($tag=='STRONG'){
+			$tag='B';
+		}
+		if($tag=='EM'){
+			$tag='I';
+		}
+		if($tag=='B' or $tag=='I' or $tag=='U'){
+			$this->SetStyle($tag,false);
+		}
+		if($tag=='A'){
+			$this->HREF='';
+		}
+		if($tag=='P'){
+			$this->ALIGN='';
+		}
+		if($tag=='IMG'){
+			$this->IMG='';
+			$this->SRC='';
+			$this->WIDTH='';
+			$this->HEIGHT='';
+		}
+		if($tag=='LI'){
+			$this->Ln(5);
+		}
+		if($tag=='TD'){
+			$this->Write(5,'    ');
+		}
+		if($tag=='TR' || $tag=='BLOCKQUOTE' || $tag=='CODE' || $tag=='PRE'){
+			$this->SetStyle('B',false);
+			$this->SetStyle('I',false);
+			$this->Ln(5);
+			if ($this->issetcolor==true) {
+				$this->SetTextColor(0);
+				$this->issetcolor=false;
+			}
+			if ($this->issetfont==true) {
+				$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);
+				$this->issetfont=false;
+			}
+        }
+		if($tag=='FONT'){
+			if ($this->issetcolor==true) {
+				$this->SetTextColor(0);
+				$this->issetcolor=false;
+			}
+			if ($this->issetfont==true) {
+				$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);
+				$this->issetfont=false;
+			}
+		}
+		if ($tag=='H1' || $tag=='H2' || $tag=='H3' || $tag=='H4'){
+			$this->H1='';
+			$this->H2='';
+			$this->H3='';
+			$this->H4='';
+			$this->SetStyle('B',false);
+			$this->SetStyle('U',false);
+			$this->Ln(5);
+			if($this->issetfont==true){
+				$this->SetFont($pdfpref['pdf_font_family'],'',$pdfpref['pdf_font_size']);
+				$this->issetfont=false;
+			}
+        }
+	}
+
+	function SetStyle($tag,$enable){
+		//Modify style and select corresponding font
+		$this->$tag+=($enable ? 1 : -1);
+		$style='';
+		foreach(array('B','I','U') as $s)
+			if($this->$s>0)
+				$style.=$s;
+		$this->SetFont('',$style);
+	}
+
+	function PutLink($URL,$txt){
+		//remove leading 'http://'
+		if(strpos($URL, "http://")!==false){
+			$URL = substr($URL, strpos($URL, "http://")+strlen('http://') );
+		}
+		//Put a hyperlink
+		$this->SetTextColor(0,0,255);
+		$this->SetStyle('U',true);
+		$this->Write(5,$txt,$URL);
+		$this->SetStyle('U',false);
+		$this->SetTextColor(0);
+	}
+
+	function px2mm($px){
+		return $px*25.4/72;
+	}
+
+	//put the image in pdf with scaling...
+	//width and height-options inside the IMG-Tag are ignored,
+	//we get the image info directly from PHP...
+	//$scale is the global scaling factor, passing through from WriteHTML()
+	//(c)2004/03/12 by St@neCold
+	function PutImage($url,$scale)
+	{
+		if($scale<0) $scale=0;
+		//$scale<=0: put NO image inside the pdf!
+		if($scale>0){
+			$xsflag=0;
+			$ysflag=0;
+			$yhflag=0;
+			$xscale=1;
+			$yscale=1;
+			//get image info
+			$oposy=$this->GetY();
+			$iminfo=@getimagesize($url);
+			if($iminfo){
+				$iw=$scale * $this->px2mm($iminfo[0]);
+				$ih=$scale * $this->px2mm($iminfo[1]);
+				$iw = ($iw)?$iw:1;
+				$ih = ($ih)?$ih:1;
+				$nw=$iw;
+				$nh=$ih;
+				//resizing in x-direction
+				$xsflag=0;
+				if($iw>150)	{
+					$xscale=150 / $iw;
+					$yscale=$xscale;
+					$nw=$xscale * $iw;
+					$nh=$xscale * $ih;
+					$xsflag=1;
+				}
+				//now eventually resizing in y-direction
+				$ysflag=0;
+				if(($oposy+$nh)>250){
+					$yscale=(250-$oposy)/$ih;
+					$nw=$yscale * $iw;
+					$nh=$yscale * $ih;
+					$ysflag=1;
+				}
+				//uups, if the scaling factor of resized image is < 0.33
+				//remark: without(!) the global factor $scale!
+				//that's hard -> on the next page please...
+				$yhflag=0;
+				if($yscale<0.33 and ($xsflag==1 or $ysflag==1))	{
+					$nw=$xscale * $iw;
+					$nh=$xscale * $ih;
+					$ysflag==0;
+					$xsflag==1;
+					$yhflag=1;
+				}
+				if($yhflag==1) $this->AddPage();
+				$oposy=$this->GetY();
+				$this->Image($url, $this->GetX(), $this->GetY(), $nw, $nh);
+				$this->SetY($oposy+$nh);
+				//if($yhflag==0 and $ysflag==1) $this->AddPage();
+			}
+		}
+	}
+
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pdf/font/courier.php 75/e107_plugins/pdf/font/courier.php
--- 6171/e107_plugins/pdf/font/courier.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/courier.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,7 @@
+<?php
+for($i=0;$i<=255;$i++)
+	$fpdf_charwidths['courier'][chr($i)]=600;
+$fpdf_charwidths['courierB']=$fpdf_charwidths['courier'];
+$fpdf_charwidths['courierI']=$fpdf_charwidths['courier'];
+$fpdf_charwidths['courierBI']=$fpdf_charwidths['courier'];
+?>
diff -ruN 6171/e107_plugins/pdf/font/helveticabi.php 75/e107_plugins/pdf/font/helveticabi.php
--- 6171/e107_plugins/pdf/font/helveticabi.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/helveticabi.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['helveticaBI']=array(
+	chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+	chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
+	','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
+	'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+	'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
+	'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
+	chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+	chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
+	chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
+?>
diff -ruN 6171/e107_plugins/pdf/font/helveticab.php 75/e107_plugins/pdf/font/helveticab.php
--- 6171/e107_plugins/pdf/font/helveticab.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/helveticab.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['helveticaB']=array(
+	chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+	chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584,
+	','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722,
+	'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+	'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889,
+	'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556,
+	chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+	chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611,
+	chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556);
+?>
diff -ruN 6171/e107_plugins/pdf/font/helveticai.php 75/e107_plugins/pdf/font/helveticai.php
--- 6171/e107_plugins/pdf/font/helveticai.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/helveticai.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['helveticaI']=array(
+	chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+	chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
+	','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
+	'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+	'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
+	'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
+	chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+	chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
+	chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+?>
diff -ruN 6171/e107_plugins/pdf/font/helvetica.php 75/e107_plugins/pdf/font/helvetica.php
--- 6171/e107_plugins/pdf/font/helvetica.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/helvetica.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['helvetica']=array(
+	chr(0)=>278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278,
+	chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584,
+	','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667,
+	'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944,
+	'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833,
+	'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556,
+	chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333,
+	chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556,
+	chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+?>
diff -ruN 6171/e107_plugins/pdf/font/makefont/cp1250.map 75/e107_plugins/pdf/font/makefont/cp1250.map
--- 6171/e107_plugins/pdf/font/makefont/cp1250.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/cp1250.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,251 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!89 U+2030 perthousand
+!8A U+0160 Scaron
+!8B U+2039 guilsinglleft
+!8C U+015A Sacute
+!8D U+0164 Tcaron
+!8E U+017D Zcaron
+!8F U+0179 Zacute
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!99 U+2122 trademark
+!9A U+0161 scaron
+!9B U+203A guilsinglright
+!9C U+015B sacute
+!9D U+0165 tcaron
+!9E U+017E zcaron
+!9F U+017A zacute
+!A0 U+00A0 space
+!A1 U+02C7 caron
+!A2 U+02D8 breve
+!A3 U+0141 Lslash
+!A4 U+00A4 currency
+!A5 U+0104 Aogonek
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+015E Scedilla
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+017B Zdotaccent
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+02DB ogonek
+!B3 U+0142 lslash
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+0105 aogonek
+!BA U+015F scedilla
+!BB U+00BB guillemotright
+!BC U+013D Lcaron
+!BD U+02DD hungarumlaut
+!BE U+013E lcaron
+!BF U+017C zdotaccent
+!C0 U+0154 Racute
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+0102 Abreve
+!C4 U+00C4 Adieresis
+!C5 U+0139 Lacute
+!C6 U+0106 Cacute
+!C7 U+00C7 Ccedilla
+!C8 U+010C Ccaron
+!C9 U+00C9 Eacute
+!CA U+0118 Eogonek
+!CB U+00CB Edieresis
+!CC U+011A Ecaron
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+010E Dcaron
+!D0 U+0110 Dcroat
+!D1 U+0143 Nacute
+!D2 U+0147 Ncaron
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+0150 Ohungarumlaut
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+0158 Rcaron
+!D9 U+016E Uring
+!DA U+00DA Uacute
+!DB U+0170 Uhungarumlaut
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+0162 Tcommaaccent
+!DF U+00DF germandbls
+!E0 U+0155 racute
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+0103 abreve
+!E4 U+00E4 adieresis
+!E5 U+013A lacute
+!E6 U+0107 cacute
+!E7 U+00E7 ccedilla
+!E8 U+010D ccaron
+!E9 U+00E9 eacute
+!EA U+0119 eogonek
+!EB U+00EB edieresis
+!EC U+011B ecaron
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+010F dcaron
+!F0 U+0111 dcroat
+!F1 U+0144 nacute
+!F2 U+0148 ncaron
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+0151 ohungarumlaut
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+0159 rcaron
+!F9 U+016F uring
+!FA U+00FA uacute
+!FB U+0171 uhungarumlaut
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+0163 tcommaaccent
+!FF U+02D9 dotaccent
diff -ruN 6171/e107_plugins/pdf/font/makefont/cp1251.map 75/e107_plugins/pdf/font/makefont/cp1251.map
--- 6171/e107_plugins/pdf/font/makefont/cp1251.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/cp1251.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,255 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0402 afii10051
+!81 U+0403 afii10052
+!82 U+201A quotesinglbase
+!83 U+0453 afii10100
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+20AC Euro
+!89 U+2030 perthousand
+!8A U+0409 afii10058
+!8B U+2039 guilsinglleft
+!8C U+040A afii10059
+!8D U+040C afii10061
+!8E U+040B afii10060
+!8F U+040F afii10145
+!90 U+0452 afii10099
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!99 U+2122 trademark
+!9A U+0459 afii10106
+!9B U+203A guilsinglright
+!9C U+045A afii10107
+!9D U+045C afii10109
+!9E U+045B afii10108
+!9F U+045F afii10193
+!A0 U+00A0 space
+!A1 U+040E afii10062
+!A2 U+045E afii10110
+!A3 U+0408 afii10057
+!A4 U+00A4 currency
+!A5 U+0490 afii10050
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+0401 afii10023
+!A9 U+00A9 copyright
+!AA U+0404 afii10053
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+0407 afii10056
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+0406 afii10055
+!B3 U+0456 afii10103
+!B4 U+0491 afii10098
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+0451 afii10071
+!B9 U+2116 afii61352
+!BA U+0454 afii10101
+!BB U+00BB guillemotright
+!BC U+0458 afii10105
+!BD U+0405 afii10054
+!BE U+0455 afii10102
+!BF U+0457 afii10104
+!C0 U+0410 afii10017
+!C1 U+0411 afii10018
+!C2 U+0412 afii10019
+!C3 U+0413 afii10020
+!C4 U+0414 afii10021
+!C5 U+0415 afii10022
+!C6 U+0416 afii10024
+!C7 U+0417 afii10025
+!C8 U+0418 afii10026
+!C9 U+0419 afii10027
+!CA U+041A afii10028
+!CB U+041B afii10029
+!CC U+041C afii10030
+!CD U+041D afii10031
+!CE U+041E afii10032
+!CF U+041F afii10033
+!D0 U+0420 afii10034
+!D1 U+0421 afii10035
+!D2 U+0422 afii10036
+!D3 U+0423 afii10037
+!D4 U+0424 afii10038
+!D5 U+0425 afii10039
+!D6 U+0426 afii10040
+!D7 U+0427 afii10041
+!D8 U+0428 afii10042
+!D9 U+0429 afii10043
+!DA U+042A afii10044
+!DB U+042B afii10045
+!DC U+042C afii10046
+!DD U+042D afii10047
+!DE U+042E afii10048
+!DF U+042F afii10049
+!E0 U+0430 afii10065
+!E1 U+0431 afii10066
+!E2 U+0432 afii10067
+!E3 U+0433 afii10068
+!E4 U+0434 afii10069
+!E5 U+0435 afii10070
+!E6 U+0436 afii10072
+!E7 U+0437 afii10073
+!E8 U+0438 afii10074
+!E9 U+0439 afii10075
+!EA U+043A afii10076
+!EB U+043B afii10077
+!EC U+043C afii10078
+!ED U+043D afii10079
+!EE U+043E afii10080
+!EF U+043F afii10081
+!F0 U+0440 afii10082
+!F1 U+0441 afii10083
+!F2 U+0442 afii10084
+!F3 U+0443 afii10085
+!F4 U+0444 afii10086
+!F5 U+0445 afii10087
+!F6 U+0446 afii10088
+!F7 U+0447 afii10089
+!F8 U+0448 afii10090
+!F9 U+0449 afii10091
+!FA U+044A afii10092
+!FB U+044B afii10093
+!FC U+044C afii10094
+!FD U+044D afii10095
+!FE U+044E afii10096
+!FF U+044F afii10097
diff -ruN 6171/e107_plugins/pdf/font/makefont/cp1252.map 75/e107_plugins/pdf/font/makefont/cp1252.map
--- 6171/e107_plugins/pdf/font/makefont/cp1252.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/cp1252.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,251 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+02C6 circumflex
+!89 U+2030 perthousand
+!8A U+0160 Scaron
+!8B U+2039 guilsinglleft
+!8C U+0152 OE
+!8E U+017D Zcaron
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!98 U+02DC tilde
+!99 U+2122 trademark
+!9A U+0161 scaron
+!9B U+203A guilsinglright
+!9C U+0153 oe
+!9E U+017E zcaron
+!9F U+0178 Ydieresis
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+00D0 Eth
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+00DE Thorn
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+00F0 eth
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+00FE thorn
+!FF U+00FF ydieresis
diff -ruN 6171/e107_plugins/pdf/font/makefont/cp1253.map 75/e107_plugins/pdf/font/makefont/cp1253.map
--- 6171/e107_plugins/pdf/font/makefont/cp1253.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/cp1253.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,239 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!89 U+2030 perthousand
+!8B U+2039 guilsinglleft
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!99 U+2122 trademark
+!9B U+203A guilsinglright
+!A0 U+00A0 space
+!A1 U+0385 dieresistonos
+!A2 U+0386 Alphatonos
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+2015 afii00208
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+0384 tonos
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+0388 Epsilontonos
+!B9 U+0389 Etatonos
+!BA U+038A Iotatonos
+!BB U+00BB guillemotright
+!BC U+038C Omicrontonos
+!BD U+00BD onehalf
+!BE U+038E Upsilontonos
+!BF U+038F Omegatonos
+!C0 U+0390 iotadieresistonos
+!C1 U+0391 Alpha
+!C2 U+0392 Beta
+!C3 U+0393 Gamma
+!C4 U+0394 Delta
+!C5 U+0395 Epsilon
+!C6 U+0396 Zeta
+!C7 U+0397 Eta
+!C8 U+0398 Theta
+!C9 U+0399 Iota
+!CA U+039A Kappa
+!CB U+039B Lambda
+!CC U+039C Mu
+!CD U+039D Nu
+!CE U+039E Xi
+!CF U+039F Omicron
+!D0 U+03A0 Pi
+!D1 U+03A1 Rho
+!D3 U+03A3 Sigma
+!D4 U+03A4 Tau
+!D5 U+03A5 Upsilon
+!D6 U+03A6 Phi
+!D7 U+03A7 Chi
+!D8 U+03A8 Psi
+!D9 U+03A9 Omega
+!DA U+03AA Iotadieresis
+!DB U+03AB Upsilondieresis
+!DC U+03AC alphatonos
+!DD U+03AD epsilontonos
+!DE U+03AE etatonos
+!DF U+03AF iotatonos
+!E0 U+03B0 upsilondieresistonos
+!E1 U+03B1 alpha
+!E2 U+03B2 beta
+!E3 U+03B3 gamma
+!E4 U+03B4 delta
+!E5 U+03B5 epsilon
+!E6 U+03B6 zeta
+!E7 U+03B7 eta
+!E8 U+03B8 theta
+!E9 U+03B9 iota
+!EA U+03BA kappa
+!EB U+03BB lambda
+!EC U+03BC mu
+!ED U+03BD nu
+!EE U+03BE xi
+!EF U+03BF omicron
+!F0 U+03C0 pi
+!F1 U+03C1 rho
+!F2 U+03C2 sigma1
+!F3 U+03C3 sigma
+!F4 U+03C4 tau
+!F5 U+03C5 upsilon
+!F6 U+03C6 phi
+!F7 U+03C7 chi
+!F8 U+03C8 psi
+!F9 U+03C9 omega
+!FA U+03CA iotadieresis
+!FB U+03CB upsilondieresis
+!FC U+03CC omicrontonos
+!FD U+03CD upsilontonos
+!FE U+03CE omegatonos
diff -ruN 6171/e107_plugins/pdf/font/makefont/cp1254.map 75/e107_plugins/pdf/font/makefont/cp1254.map
--- 6171/e107_plugins/pdf/font/makefont/cp1254.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/cp1254.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,249 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+02C6 circumflex
+!89 U+2030 perthousand
+!8A U+0160 Scaron
+!8B U+2039 guilsinglleft
+!8C U+0152 OE
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!98 U+02DC tilde
+!99 U+2122 trademark
+!9A U+0161 scaron
+!9B U+203A guilsinglright
+!9C U+0153 oe
+!9F U+0178 Ydieresis
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+011E Gbreve
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+0130 Idotaccent
+!DE U+015E Scedilla
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+011F gbreve
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+0131 dotlessi
+!FE U+015F scedilla
+!FF U+00FF ydieresis
diff -ruN 6171/e107_plugins/pdf/font/makefont/cp1255.map 75/e107_plugins/pdf/font/makefont/cp1255.map
--- 6171/e107_plugins/pdf/font/makefont/cp1255.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/cp1255.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,233 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+02C6 circumflex
+!89 U+2030 perthousand
+!8B U+2039 guilsinglleft
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!98 U+02DC tilde
+!99 U+2122 trademark
+!9B U+203A guilsinglright
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+20AA afii57636
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00D7 multiply
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD sfthyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 middot
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00F7 divide
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+05B0 afii57799
+!C1 U+05B1 afii57801
+!C2 U+05B2 afii57800
+!C3 U+05B3 afii57802
+!C4 U+05B4 afii57793
+!C5 U+05B5 afii57794
+!C6 U+05B6 afii57795
+!C7 U+05B7 afii57798
+!C8 U+05B8 afii57797
+!C9 U+05B9 afii57806
+!CB U+05BB afii57796
+!CC U+05BC afii57807
+!CD U+05BD afii57839
+!CE U+05BE afii57645
+!CF U+05BF afii57841
+!D0 U+05C0 afii57842
+!D1 U+05C1 afii57804
+!D2 U+05C2 afii57803
+!D3 U+05C3 afii57658
+!D4 U+05F0 afii57716
+!D5 U+05F1 afii57717
+!D6 U+05F2 afii57718
+!D7 U+05F3 gereshhebrew
+!D8 U+05F4 gershayimhebrew
+!E0 U+05D0 afii57664
+!E1 U+05D1 afii57665
+!E2 U+05D2 afii57666
+!E3 U+05D3 afii57667
+!E4 U+05D4 afii57668
+!E5 U+05D5 afii57669
+!E6 U+05D6 afii57670
+!E7 U+05D7 afii57671
+!E8 U+05D8 afii57672
+!E9 U+05D9 afii57673
+!EA U+05DA afii57674
+!EB U+05DB afii57675
+!EC U+05DC afii57676
+!ED U+05DD afii57677
+!EE U+05DE afii57678
+!EF U+05DF afii57679
+!F0 U+05E0 afii57680
+!F1 U+05E1 afii57681
+!F2 U+05E2 afii57682
+!F3 U+05E3 afii57683
+!F4 U+05E4 afii57684
+!F5 U+05E5 afii57685
+!F6 U+05E6 afii57686
+!F7 U+05E7 afii57687
+!F8 U+05E8 afii57688
+!F9 U+05E9 afii57689
+!FA U+05EA afii57690
+!FD U+200E afii299
+!FE U+200F afii300
diff -ruN 6171/e107_plugins/pdf/font/makefont/cp1257.map 75/e107_plugins/pdf/font/makefont/cp1257.map
--- 6171/e107_plugins/pdf/font/makefont/cp1257.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/cp1257.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,244 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!89 U+2030 perthousand
+!8B U+2039 guilsinglleft
+!8D U+00A8 dieresis
+!8E U+02C7 caron
+!8F U+00B8 cedilla
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!99 U+2122 trademark
+!9B U+203A guilsinglright
+!9D U+00AF macron
+!9E U+02DB ogonek
+!A0 U+00A0 space
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00D8 Oslash
+!A9 U+00A9 copyright
+!AA U+0156 Rcommaaccent
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00C6 AE
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00F8 oslash
+!B9 U+00B9 onesuperior
+!BA U+0157 rcommaaccent
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00E6 ae
+!C0 U+0104 Aogonek
+!C1 U+012E Iogonek
+!C2 U+0100 Amacron
+!C3 U+0106 Cacute
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+0118 Eogonek
+!C7 U+0112 Emacron
+!C8 U+010C Ccaron
+!C9 U+00C9 Eacute
+!CA U+0179 Zacute
+!CB U+0116 Edotaccent
+!CC U+0122 Gcommaaccent
+!CD U+0136 Kcommaaccent
+!CE U+012A Imacron
+!CF U+013B Lcommaaccent
+!D0 U+0160 Scaron
+!D1 U+0143 Nacute
+!D2 U+0145 Ncommaaccent
+!D3 U+00D3 Oacute
+!D4 U+014C Omacron
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+0172 Uogonek
+!D9 U+0141 Lslash
+!DA U+015A Sacute
+!DB U+016A Umacron
+!DC U+00DC Udieresis
+!DD U+017B Zdotaccent
+!DE U+017D Zcaron
+!DF U+00DF germandbls
+!E0 U+0105 aogonek
+!E1 U+012F iogonek
+!E2 U+0101 amacron
+!E3 U+0107 cacute
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+0119 eogonek
+!E7 U+0113 emacron
+!E8 U+010D ccaron
+!E9 U+00E9 eacute
+!EA U+017A zacute
+!EB U+0117 edotaccent
+!EC U+0123 gcommaaccent
+!ED U+0137 kcommaaccent
+!EE U+012B imacron
+!EF U+013C lcommaaccent
+!F0 U+0161 scaron
+!F1 U+0144 nacute
+!F2 U+0146 ncommaaccent
+!F3 U+00F3 oacute
+!F4 U+014D omacron
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+0173 uogonek
+!F9 U+0142 lslash
+!FA U+015B sacute
+!FB U+016B umacron
+!FC U+00FC udieresis
+!FD U+017C zdotaccent
+!FE U+017E zcaron
+!FF U+02D9 dotaccent
diff -ruN 6171/e107_plugins/pdf/font/makefont/cp1258.map 75/e107_plugins/pdf/font/makefont/cp1258.map
--- 6171/e107_plugins/pdf/font/makefont/cp1258.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/cp1258.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,247 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!82 U+201A quotesinglbase
+!83 U+0192 florin
+!84 U+201E quotedblbase
+!85 U+2026 ellipsis
+!86 U+2020 dagger
+!87 U+2021 daggerdbl
+!88 U+02C6 circumflex
+!89 U+2030 perthousand
+!8B U+2039 guilsinglleft
+!8C U+0152 OE
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!98 U+02DC tilde
+!99 U+2122 trademark
+!9B U+203A guilsinglright
+!9C U+0153 oe
+!9F U+0178 Ydieresis
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+0102 Abreve
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+0300 gravecomb
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+0110 Dcroat
+!D1 U+00D1 Ntilde
+!D2 U+0309 hookabovecomb
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+01A0 Ohorn
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+01AF Uhorn
+!DE U+0303 tildecomb
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+0103 abreve
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+0301 acutecomb
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+0111 dcroat
+!F1 U+00F1 ntilde
+!F2 U+0323 dotbelowcomb
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+01A1 ohorn
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+01B0 uhorn
+!FE U+20AB dong
+!FF U+00FF ydieresis
diff -ruN 6171/e107_plugins/pdf/font/makefont/cp874.map 75/e107_plugins/pdf/font/makefont/cp874.map
--- 6171/e107_plugins/pdf/font/makefont/cp874.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/cp874.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,225 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+20AC Euro
+!85 U+2026 ellipsis
+!91 U+2018 quoteleft
+!92 U+2019 quoteright
+!93 U+201C quotedblleft
+!94 U+201D quotedblright
+!95 U+2022 bullet
+!96 U+2013 endash
+!97 U+2014 emdash
+!A0 U+00A0 space
+!A1 U+0E01 kokaithai
+!A2 U+0E02 khokhaithai
+!A3 U+0E03 khokhuatthai
+!A4 U+0E04 khokhwaithai
+!A5 U+0E05 khokhonthai
+!A6 U+0E06 khorakhangthai
+!A7 U+0E07 ngonguthai
+!A8 U+0E08 chochanthai
+!A9 U+0E09 chochingthai
+!AA U+0E0A chochangthai
+!AB U+0E0B sosothai
+!AC U+0E0C chochoethai
+!AD U+0E0D yoyingthai
+!AE U+0E0E dochadathai
+!AF U+0E0F topatakthai
+!B0 U+0E10 thothanthai
+!B1 U+0E11 thonangmonthothai
+!B2 U+0E12 thophuthaothai
+!B3 U+0E13 nonenthai
+!B4 U+0E14 dodekthai
+!B5 U+0E15 totaothai
+!B6 U+0E16 thothungthai
+!B7 U+0E17 thothahanthai
+!B8 U+0E18 thothongthai
+!B9 U+0E19 nonuthai
+!BA U+0E1A bobaimaithai
+!BB U+0E1B poplathai
+!BC U+0E1C phophungthai
+!BD U+0E1D fofathai
+!BE U+0E1E phophanthai
+!BF U+0E1F fofanthai
+!C0 U+0E20 phosamphaothai
+!C1 U+0E21 momathai
+!C2 U+0E22 yoyakthai
+!C3 U+0E23 roruathai
+!C4 U+0E24 ruthai
+!C5 U+0E25 lolingthai
+!C6 U+0E26 luthai
+!C7 U+0E27 wowaenthai
+!C8 U+0E28 sosalathai
+!C9 U+0E29 sorusithai
+!CA U+0E2A sosuathai
+!CB U+0E2B hohipthai
+!CC U+0E2C lochulathai
+!CD U+0E2D oangthai
+!CE U+0E2E honokhukthai
+!CF U+0E2F paiyannoithai
+!D0 U+0E30 saraathai
+!D1 U+0E31 maihanakatthai
+!D2 U+0E32 saraaathai
+!D3 U+0E33 saraamthai
+!D4 U+0E34 saraithai
+!D5 U+0E35 saraiithai
+!D6 U+0E36 sarauethai
+!D7 U+0E37 saraueethai
+!D8 U+0E38 sarauthai
+!D9 U+0E39 sarauuthai
+!DA U+0E3A phinthuthai
+!DF U+0E3F bahtthai
+!E0 U+0E40 saraethai
+!E1 U+0E41 saraaethai
+!E2 U+0E42 saraothai
+!E3 U+0E43 saraaimaimuanthai
+!E4 U+0E44 saraaimaimalaithai
+!E5 U+0E45 lakkhangyaothai
+!E6 U+0E46 maiyamokthai
+!E7 U+0E47 maitaikhuthai
+!E8 U+0E48 maiekthai
+!E9 U+0E49 maithothai
+!EA U+0E4A maitrithai
+!EB U+0E4B maichattawathai
+!EC U+0E4C thanthakhatthai
+!ED U+0E4D nikhahitthai
+!EE U+0E4E yamakkanthai
+!EF U+0E4F fongmanthai
+!F0 U+0E50 zerothai
+!F1 U+0E51 onethai
+!F2 U+0E52 twothai
+!F3 U+0E53 threethai
+!F4 U+0E54 fourthai
+!F5 U+0E55 fivethai
+!F6 U+0E56 sixthai
+!F7 U+0E57 seventhai
+!F8 U+0E58 eightthai
+!F9 U+0E59 ninethai
+!FA U+0E5A angkhankhuthai
+!FB U+0E5B khomutthai
diff -ruN 6171/e107_plugins/pdf/font/makefont/iso-8859-11.map 75/e107_plugins/pdf/font/makefont/iso-8859-11.map
--- 6171/e107_plugins/pdf/font/makefont/iso-8859-11.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/iso-8859-11.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,248 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0E01 kokaithai
+!A2 U+0E02 khokhaithai
+!A3 U+0E03 khokhuatthai
+!A4 U+0E04 khokhwaithai
+!A5 U+0E05 khokhonthai
+!A6 U+0E06 khorakhangthai
+!A7 U+0E07 ngonguthai
+!A8 U+0E08 chochanthai
+!A9 U+0E09 chochingthai
+!AA U+0E0A chochangthai
+!AB U+0E0B sosothai
+!AC U+0E0C chochoethai
+!AD U+0E0D yoyingthai
+!AE U+0E0E dochadathai
+!AF U+0E0F topatakthai
+!B0 U+0E10 thothanthai
+!B1 U+0E11 thonangmonthothai
+!B2 U+0E12 thophuthaothai
+!B3 U+0E13 nonenthai
+!B4 U+0E14 dodekthai
+!B5 U+0E15 totaothai
+!B6 U+0E16 thothungthai
+!B7 U+0E17 thothahanthai
+!B8 U+0E18 thothongthai
+!B9 U+0E19 nonuthai
+!BA U+0E1A bobaimaithai
+!BB U+0E1B poplathai
+!BC U+0E1C phophungthai
+!BD U+0E1D fofathai
+!BE U+0E1E phophanthai
+!BF U+0E1F fofanthai
+!C0 U+0E20 phosamphaothai
+!C1 U+0E21 momathai
+!C2 U+0E22 yoyakthai
+!C3 U+0E23 roruathai
+!C4 U+0E24 ruthai
+!C5 U+0E25 lolingthai
+!C6 U+0E26 luthai
+!C7 U+0E27 wowaenthai
+!C8 U+0E28 sosalathai
+!C9 U+0E29 sorusithai
+!CA U+0E2A sosuathai
+!CB U+0E2B hohipthai
+!CC U+0E2C lochulathai
+!CD U+0E2D oangthai
+!CE U+0E2E honokhukthai
+!CF U+0E2F paiyannoithai
+!D0 U+0E30 saraathai
+!D1 U+0E31 maihanakatthai
+!D2 U+0E32 saraaathai
+!D3 U+0E33 saraamthai
+!D4 U+0E34 saraithai
+!D5 U+0E35 saraiithai
+!D6 U+0E36 sarauethai
+!D7 U+0E37 saraueethai
+!D8 U+0E38 sarauthai
+!D9 U+0E39 sarauuthai
+!DA U+0E3A phinthuthai
+!DF U+0E3F bahtthai
+!E0 U+0E40 saraethai
+!E1 U+0E41 saraaethai
+!E2 U+0E42 saraothai
+!E3 U+0E43 saraaimaimuanthai
+!E4 U+0E44 saraaimaimalaithai
+!E5 U+0E45 lakkhangyaothai
+!E6 U+0E46 maiyamokthai
+!E7 U+0E47 maitaikhuthai
+!E8 U+0E48 maiekthai
+!E9 U+0E49 maithothai
+!EA U+0E4A maitrithai
+!EB U+0E4B maichattawathai
+!EC U+0E4C thanthakhatthai
+!ED U+0E4D nikhahitthai
+!EE U+0E4E yamakkanthai
+!EF U+0E4F fongmanthai
+!F0 U+0E50 zerothai
+!F1 U+0E51 onethai
+!F2 U+0E52 twothai
+!F3 U+0E53 threethai
+!F4 U+0E54 fourthai
+!F5 U+0E55 fivethai
+!F6 U+0E56 sixthai
+!F7 U+0E57 seventhai
+!F8 U+0E58 eightthai
+!F9 U+0E59 ninethai
+!FA U+0E5A angkhankhuthai
+!FB U+0E5B khomutthai
diff -ruN 6171/e107_plugins/pdf/font/makefont/iso-8859-15.map 75/e107_plugins/pdf/font/makefont/iso-8859-15.map
--- 6171/e107_plugins/pdf/font/makefont/iso-8859-15.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/iso-8859-15.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+20AC Euro
+!A5 U+00A5 yen
+!A6 U+0160 Scaron
+!A7 U+00A7 section
+!A8 U+0161 scaron
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+017D Zcaron
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+017E zcaron
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+0152 OE
+!BD U+0153 oe
+!BE U+0178 Ydieresis
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+00D0 Eth
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+00DE Thorn
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+00F0 eth
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+00FE thorn
+!FF U+00FF ydieresis
diff -ruN 6171/e107_plugins/pdf/font/makefont/iso-8859-16.map 75/e107_plugins/pdf/font/makefont/iso-8859-16.map
--- 6171/e107_plugins/pdf/font/makefont/iso-8859-16.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/iso-8859-16.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0104 Aogonek
+!A2 U+0105 aogonek
+!A3 U+0141 Lslash
+!A4 U+20AC Euro
+!A5 U+201E quotedblbase
+!A6 U+0160 Scaron
+!A7 U+00A7 section
+!A8 U+0161 scaron
+!A9 U+00A9 copyright
+!AA U+0218 Scommaaccent
+!AB U+00AB guillemotleft
+!AC U+0179 Zacute
+!AD U+00AD hyphen
+!AE U+017A zacute
+!AF U+017B Zdotaccent
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+010C Ccaron
+!B3 U+0142 lslash
+!B4 U+017D Zcaron
+!B5 U+201D quotedblright
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+017E zcaron
+!B9 U+010D ccaron
+!BA U+0219 scommaaccent
+!BB U+00BB guillemotright
+!BC U+0152 OE
+!BD U+0153 oe
+!BE U+0178 Ydieresis
+!BF U+017C zdotaccent
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+0102 Abreve
+!C4 U+00C4 Adieresis
+!C5 U+0106 Cacute
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+0110 Dcroat
+!D1 U+0143 Nacute
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+0150 Ohungarumlaut
+!D6 U+00D6 Odieresis
+!D7 U+015A Sacute
+!D8 U+0170 Uhungarumlaut
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+0118 Eogonek
+!DE U+021A Tcommaaccent
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+0103 abreve
+!E4 U+00E4 adieresis
+!E5 U+0107 cacute
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+0111 dcroat
+!F1 U+0144 nacute
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+0151 ohungarumlaut
+!F6 U+00F6 odieresis
+!F7 U+015B sacute
+!F8 U+0171 uhungarumlaut
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+0119 eogonek
+!FE U+021B tcommaaccent
+!FF U+00FF ydieresis
diff -ruN 6171/e107_plugins/pdf/font/makefont/iso-8859-1.map 75/e107_plugins/pdf/font/makefont/iso-8859-1.map
--- 6171/e107_plugins/pdf/font/makefont/iso-8859-1.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/iso-8859-1.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+00D0 Eth
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+00DE Thorn
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+00F0 eth
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+00FE thorn
+!FF U+00FF ydieresis
diff -ruN 6171/e107_plugins/pdf/font/makefont/iso-8859-2.map 75/e107_plugins/pdf/font/makefont/iso-8859-2.map
--- 6171/e107_plugins/pdf/font/makefont/iso-8859-2.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/iso-8859-2.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0104 Aogonek
+!A2 U+02D8 breve
+!A3 U+0141 Lslash
+!A4 U+00A4 currency
+!A5 U+013D Lcaron
+!A6 U+015A Sacute
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+0160 Scaron
+!AA U+015E Scedilla
+!AB U+0164 Tcaron
+!AC U+0179 Zacute
+!AD U+00AD hyphen
+!AE U+017D Zcaron
+!AF U+017B Zdotaccent
+!B0 U+00B0 degree
+!B1 U+0105 aogonek
+!B2 U+02DB ogonek
+!B3 U+0142 lslash
+!B4 U+00B4 acute
+!B5 U+013E lcaron
+!B6 U+015B sacute
+!B7 U+02C7 caron
+!B8 U+00B8 cedilla
+!B9 U+0161 scaron
+!BA U+015F scedilla
+!BB U+0165 tcaron
+!BC U+017A zacute
+!BD U+02DD hungarumlaut
+!BE U+017E zcaron
+!BF U+017C zdotaccent
+!C0 U+0154 Racute
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+0102 Abreve
+!C4 U+00C4 Adieresis
+!C5 U+0139 Lacute
+!C6 U+0106 Cacute
+!C7 U+00C7 Ccedilla
+!C8 U+010C Ccaron
+!C9 U+00C9 Eacute
+!CA U+0118 Eogonek
+!CB U+00CB Edieresis
+!CC U+011A Ecaron
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+010E Dcaron
+!D0 U+0110 Dcroat
+!D1 U+0143 Nacute
+!D2 U+0147 Ncaron
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+0150 Ohungarumlaut
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+0158 Rcaron
+!D9 U+016E Uring
+!DA U+00DA Uacute
+!DB U+0170 Uhungarumlaut
+!DC U+00DC Udieresis
+!DD U+00DD Yacute
+!DE U+0162 Tcommaaccent
+!DF U+00DF germandbls
+!E0 U+0155 racute
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+0103 abreve
+!E4 U+00E4 adieresis
+!E5 U+013A lacute
+!E6 U+0107 cacute
+!E7 U+00E7 ccedilla
+!E8 U+010D ccaron
+!E9 U+00E9 eacute
+!EA U+0119 eogonek
+!EB U+00EB edieresis
+!EC U+011B ecaron
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+010F dcaron
+!F0 U+0111 dcroat
+!F1 U+0144 nacute
+!F2 U+0148 ncaron
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+0151 ohungarumlaut
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+0159 rcaron
+!F9 U+016F uring
+!FA U+00FA uacute
+!FB U+0171 uhungarumlaut
+!FC U+00FC udieresis
+!FD U+00FD yacute
+!FE U+0163 tcommaaccent
+!FF U+02D9 dotaccent
diff -ruN 6171/e107_plugins/pdf/font/makefont/iso-8859-4.map 75/e107_plugins/pdf/font/makefont/iso-8859-4.map
--- 6171/e107_plugins/pdf/font/makefont/iso-8859-4.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/iso-8859-4.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0104 Aogonek
+!A2 U+0138 kgreenlandic
+!A3 U+0156 Rcommaaccent
+!A4 U+00A4 currency
+!A5 U+0128 Itilde
+!A6 U+013B Lcommaaccent
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+0160 Scaron
+!AA U+0112 Emacron
+!AB U+0122 Gcommaaccent
+!AC U+0166 Tbar
+!AD U+00AD hyphen
+!AE U+017D Zcaron
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+0105 aogonek
+!B2 U+02DB ogonek
+!B3 U+0157 rcommaaccent
+!B4 U+00B4 acute
+!B5 U+0129 itilde
+!B6 U+013C lcommaaccent
+!B7 U+02C7 caron
+!B8 U+00B8 cedilla
+!B9 U+0161 scaron
+!BA U+0113 emacron
+!BB U+0123 gcommaaccent
+!BC U+0167 tbar
+!BD U+014A Eng
+!BE U+017E zcaron
+!BF U+014B eng
+!C0 U+0100 Amacron
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+012E Iogonek
+!C8 U+010C Ccaron
+!C9 U+00C9 Eacute
+!CA U+0118 Eogonek
+!CB U+00CB Edieresis
+!CC U+0116 Edotaccent
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+012A Imacron
+!D0 U+0110 Dcroat
+!D1 U+0145 Ncommaaccent
+!D2 U+014C Omacron
+!D3 U+0136 Kcommaaccent
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+0172 Uogonek
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+0168 Utilde
+!DE U+016A Umacron
+!DF U+00DF germandbls
+!E0 U+0101 amacron
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+012F iogonek
+!E8 U+010D ccaron
+!E9 U+00E9 eacute
+!EA U+0119 eogonek
+!EB U+00EB edieresis
+!EC U+0117 edotaccent
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+012B imacron
+!F0 U+0111 dcroat
+!F1 U+0146 ncommaaccent
+!F2 U+014D omacron
+!F3 U+0137 kcommaaccent
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+0173 uogonek
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+0169 utilde
+!FE U+016B umacron
+!FF U+02D9 dotaccent
diff -ruN 6171/e107_plugins/pdf/font/makefont/iso-8859-5.map 75/e107_plugins/pdf/font/makefont/iso-8859-5.map
--- 6171/e107_plugins/pdf/font/makefont/iso-8859-5.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/iso-8859-5.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+0401 afii10023
+!A2 U+0402 afii10051
+!A3 U+0403 afii10052
+!A4 U+0404 afii10053
+!A5 U+0405 afii10054
+!A6 U+0406 afii10055
+!A7 U+0407 afii10056
+!A8 U+0408 afii10057
+!A9 U+0409 afii10058
+!AA U+040A afii10059
+!AB U+040B afii10060
+!AC U+040C afii10061
+!AD U+00AD hyphen
+!AE U+040E afii10062
+!AF U+040F afii10145
+!B0 U+0410 afii10017
+!B1 U+0411 afii10018
+!B2 U+0412 afii10019
+!B3 U+0413 afii10020
+!B4 U+0414 afii10021
+!B5 U+0415 afii10022
+!B6 U+0416 afii10024
+!B7 U+0417 afii10025
+!B8 U+0418 afii10026
+!B9 U+0419 afii10027
+!BA U+041A afii10028
+!BB U+041B afii10029
+!BC U+041C afii10030
+!BD U+041D afii10031
+!BE U+041E afii10032
+!BF U+041F afii10033
+!C0 U+0420 afii10034
+!C1 U+0421 afii10035
+!C2 U+0422 afii10036
+!C3 U+0423 afii10037
+!C4 U+0424 afii10038
+!C5 U+0425 afii10039
+!C6 U+0426 afii10040
+!C7 U+0427 afii10041
+!C8 U+0428 afii10042
+!C9 U+0429 afii10043
+!CA U+042A afii10044
+!CB U+042B afii10045
+!CC U+042C afii10046
+!CD U+042D afii10047
+!CE U+042E afii10048
+!CF U+042F afii10049
+!D0 U+0430 afii10065
+!D1 U+0431 afii10066
+!D2 U+0432 afii10067
+!D3 U+0433 afii10068
+!D4 U+0434 afii10069
+!D5 U+0435 afii10070
+!D6 U+0436 afii10072
+!D7 U+0437 afii10073
+!D8 U+0438 afii10074
+!D9 U+0439 afii10075
+!DA U+043A afii10076
+!DB U+043B afii10077
+!DC U+043C afii10078
+!DD U+043D afii10079
+!DE U+043E afii10080
+!DF U+043F afii10081
+!E0 U+0440 afii10082
+!E1 U+0441 afii10083
+!E2 U+0442 afii10084
+!E3 U+0443 afii10085
+!E4 U+0444 afii10086
+!E5 U+0445 afii10087
+!E6 U+0446 afii10088
+!E7 U+0447 afii10089
+!E8 U+0448 afii10090
+!E9 U+0449 afii10091
+!EA U+044A afii10092
+!EB U+044B afii10093
+!EC U+044C afii10094
+!ED U+044D afii10095
+!EE U+044E afii10096
+!EF U+044F afii10097
+!F0 U+2116 afii61352
+!F1 U+0451 afii10071
+!F2 U+0452 afii10099
+!F3 U+0453 afii10100
+!F4 U+0454 afii10101
+!F5 U+0455 afii10102
+!F6 U+0456 afii10103
+!F7 U+0457 afii10104
+!F8 U+0458 afii10105
+!F9 U+0459 afii10106
+!FA U+045A afii10107
+!FB U+045B afii10108
+!FC U+045C afii10109
+!FD U+00A7 section
+!FE U+045E afii10110
+!FF U+045F afii10193
diff -ruN 6171/e107_plugins/pdf/font/makefont/iso-8859-7.map 75/e107_plugins/pdf/font/makefont/iso-8859-7.map
--- 6171/e107_plugins/pdf/font/makefont/iso-8859-7.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/iso-8859-7.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,250 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+2018 quoteleft
+!A2 U+2019 quoteright
+!A3 U+00A3 sterling
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AF U+2015 afii00208
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+0384 tonos
+!B5 U+0385 dieresistonos
+!B6 U+0386 Alphatonos
+!B7 U+00B7 periodcentered
+!B8 U+0388 Epsilontonos
+!B9 U+0389 Etatonos
+!BA U+038A Iotatonos
+!BB U+00BB guillemotright
+!BC U+038C Omicrontonos
+!BD U+00BD onehalf
+!BE U+038E Upsilontonos
+!BF U+038F Omegatonos
+!C0 U+0390 iotadieresistonos
+!C1 U+0391 Alpha
+!C2 U+0392 Beta
+!C3 U+0393 Gamma
+!C4 U+0394 Delta
+!C5 U+0395 Epsilon
+!C6 U+0396 Zeta
+!C7 U+0397 Eta
+!C8 U+0398 Theta
+!C9 U+0399 Iota
+!CA U+039A Kappa
+!CB U+039B Lambda
+!CC U+039C Mu
+!CD U+039D Nu
+!CE U+039E Xi
+!CF U+039F Omicron
+!D0 U+03A0 Pi
+!D1 U+03A1 Rho
+!D3 U+03A3 Sigma
+!D4 U+03A4 Tau
+!D5 U+03A5 Upsilon
+!D6 U+03A6 Phi
+!D7 U+03A7 Chi
+!D8 U+03A8 Psi
+!D9 U+03A9 Omega
+!DA U+03AA Iotadieresis
+!DB U+03AB Upsilondieresis
+!DC U+03AC alphatonos
+!DD U+03AD epsilontonos
+!DE U+03AE etatonos
+!DF U+03AF iotatonos
+!E0 U+03B0 upsilondieresistonos
+!E1 U+03B1 alpha
+!E2 U+03B2 beta
+!E3 U+03B3 gamma
+!E4 U+03B4 delta
+!E5 U+03B5 epsilon
+!E6 U+03B6 zeta
+!E7 U+03B7 eta
+!E8 U+03B8 theta
+!E9 U+03B9 iota
+!EA U+03BA kappa
+!EB U+03BB lambda
+!EC U+03BC mu
+!ED U+03BD nu
+!EE U+03BE xi
+!EF U+03BF omicron
+!F0 U+03C0 pi
+!F1 U+03C1 rho
+!F2 U+03C2 sigma1
+!F3 U+03C3 sigma
+!F4 U+03C4 tau
+!F5 U+03C5 upsilon
+!F6 U+03C6 phi
+!F7 U+03C7 chi
+!F8 U+03C8 psi
+!F9 U+03C9 omega
+!FA U+03CA iotadieresis
+!FB U+03CB upsilondieresis
+!FC U+03CC omicrontonos
+!FD U+03CD upsilontonos
+!FE U+03CE omegatonos
diff -ruN 6171/e107_plugins/pdf/font/makefont/iso-8859-9.map 75/e107_plugins/pdf/font/makefont/iso-8859-9.map
--- 6171/e107_plugins/pdf/font/makefont/iso-8859-9.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/iso-8859-9.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+0080 .notdef
+!81 U+0081 .notdef
+!82 U+0082 .notdef
+!83 U+0083 .notdef
+!84 U+0084 .notdef
+!85 U+0085 .notdef
+!86 U+0086 .notdef
+!87 U+0087 .notdef
+!88 U+0088 .notdef
+!89 U+0089 .notdef
+!8A U+008A .notdef
+!8B U+008B .notdef
+!8C U+008C .notdef
+!8D U+008D .notdef
+!8E U+008E .notdef
+!8F U+008F .notdef
+!90 U+0090 .notdef
+!91 U+0091 .notdef
+!92 U+0092 .notdef
+!93 U+0093 .notdef
+!94 U+0094 .notdef
+!95 U+0095 .notdef
+!96 U+0096 .notdef
+!97 U+0097 .notdef
+!98 U+0098 .notdef
+!99 U+0099 .notdef
+!9A U+009A .notdef
+!9B U+009B .notdef
+!9C U+009C .notdef
+!9D U+009D .notdef
+!9E U+009E .notdef
+!9F U+009F .notdef
+!A0 U+00A0 space
+!A1 U+00A1 exclamdown
+!A2 U+00A2 cent
+!A3 U+00A3 sterling
+!A4 U+00A4 currency
+!A5 U+00A5 yen
+!A6 U+00A6 brokenbar
+!A7 U+00A7 section
+!A8 U+00A8 dieresis
+!A9 U+00A9 copyright
+!AA U+00AA ordfeminine
+!AB U+00AB guillemotleft
+!AC U+00AC logicalnot
+!AD U+00AD hyphen
+!AE U+00AE registered
+!AF U+00AF macron
+!B0 U+00B0 degree
+!B1 U+00B1 plusminus
+!B2 U+00B2 twosuperior
+!B3 U+00B3 threesuperior
+!B4 U+00B4 acute
+!B5 U+00B5 mu
+!B6 U+00B6 paragraph
+!B7 U+00B7 periodcentered
+!B8 U+00B8 cedilla
+!B9 U+00B9 onesuperior
+!BA U+00BA ordmasculine
+!BB U+00BB guillemotright
+!BC U+00BC onequarter
+!BD U+00BD onehalf
+!BE U+00BE threequarters
+!BF U+00BF questiondown
+!C0 U+00C0 Agrave
+!C1 U+00C1 Aacute
+!C2 U+00C2 Acircumflex
+!C3 U+00C3 Atilde
+!C4 U+00C4 Adieresis
+!C5 U+00C5 Aring
+!C6 U+00C6 AE
+!C7 U+00C7 Ccedilla
+!C8 U+00C8 Egrave
+!C9 U+00C9 Eacute
+!CA U+00CA Ecircumflex
+!CB U+00CB Edieresis
+!CC U+00CC Igrave
+!CD U+00CD Iacute
+!CE U+00CE Icircumflex
+!CF U+00CF Idieresis
+!D0 U+011E Gbreve
+!D1 U+00D1 Ntilde
+!D2 U+00D2 Ograve
+!D3 U+00D3 Oacute
+!D4 U+00D4 Ocircumflex
+!D5 U+00D5 Otilde
+!D6 U+00D6 Odieresis
+!D7 U+00D7 multiply
+!D8 U+00D8 Oslash
+!D9 U+00D9 Ugrave
+!DA U+00DA Uacute
+!DB U+00DB Ucircumflex
+!DC U+00DC Udieresis
+!DD U+0130 Idotaccent
+!DE U+015E Scedilla
+!DF U+00DF germandbls
+!E0 U+00E0 agrave
+!E1 U+00E1 aacute
+!E2 U+00E2 acircumflex
+!E3 U+00E3 atilde
+!E4 U+00E4 adieresis
+!E5 U+00E5 aring
+!E6 U+00E6 ae
+!E7 U+00E7 ccedilla
+!E8 U+00E8 egrave
+!E9 U+00E9 eacute
+!EA U+00EA ecircumflex
+!EB U+00EB edieresis
+!EC U+00EC igrave
+!ED U+00ED iacute
+!EE U+00EE icircumflex
+!EF U+00EF idieresis
+!F0 U+011F gbreve
+!F1 U+00F1 ntilde
+!F2 U+00F2 ograve
+!F3 U+00F3 oacute
+!F4 U+00F4 ocircumflex
+!F5 U+00F5 otilde
+!F6 U+00F6 odieresis
+!F7 U+00F7 divide
+!F8 U+00F8 oslash
+!F9 U+00F9 ugrave
+!FA U+00FA uacute
+!FB U+00FB ucircumflex
+!FC U+00FC udieresis
+!FD U+0131 dotlessi
+!FE U+015F scedilla
+!FF U+00FF ydieresis
diff -ruN 6171/e107_plugins/pdf/font/makefont/koi8-r.map 75/e107_plugins/pdf/font/makefont/koi8-r.map
--- 6171/e107_plugins/pdf/font/makefont/koi8-r.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/koi8-r.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+2500 SF100000
+!81 U+2502 SF110000
+!82 U+250C SF010000
+!83 U+2510 SF030000
+!84 U+2514 SF020000
+!85 U+2518 SF040000
+!86 U+251C SF080000
+!87 U+2524 SF090000
+!88 U+252C SF060000
+!89 U+2534 SF070000
+!8A U+253C SF050000
+!8B U+2580 upblock
+!8C U+2584 dnblock
+!8D U+2588 block
+!8E U+258C lfblock
+!8F U+2590 rtblock
+!90 U+2591 ltshade
+!91 U+2592 shade
+!92 U+2593 dkshade
+!93 U+2320 integraltp
+!94 U+25A0 filledbox
+!95 U+2219 periodcentered
+!96 U+221A radical
+!97 U+2248 approxequal
+!98 U+2264 lessequal
+!99 U+2265 greaterequal
+!9A U+00A0 space
+!9B U+2321 integralbt
+!9C U+00B0 degree
+!9D U+00B2 twosuperior
+!9E U+00B7 periodcentered
+!9F U+00F7 divide
+!A0 U+2550 SF430000
+!A1 U+2551 SF240000
+!A2 U+2552 SF510000
+!A3 U+0451 afii10071
+!A4 U+2553 SF520000
+!A5 U+2554 SF390000
+!A6 U+2555 SF220000
+!A7 U+2556 SF210000
+!A8 U+2557 SF250000
+!A9 U+2558 SF500000
+!AA U+2559 SF490000
+!AB U+255A SF380000
+!AC U+255B SF280000
+!AD U+255C SF270000
+!AE U+255D SF260000
+!AF U+255E SF360000
+!B0 U+255F SF370000
+!B1 U+2560 SF420000
+!B2 U+2561 SF190000
+!B3 U+0401 afii10023
+!B4 U+2562 SF200000
+!B5 U+2563 SF230000
+!B6 U+2564 SF470000
+!B7 U+2565 SF480000
+!B8 U+2566 SF410000
+!B9 U+2567 SF450000
+!BA U+2568 SF460000
+!BB U+2569 SF400000
+!BC U+256A SF540000
+!BD U+256B SF530000
+!BE U+256C SF440000
+!BF U+00A9 copyright
+!C0 U+044E afii10096
+!C1 U+0430 afii10065
+!C2 U+0431 afii10066
+!C3 U+0446 afii10088
+!C4 U+0434 afii10069
+!C5 U+0435 afii10070
+!C6 U+0444 afii10086
+!C7 U+0433 afii10068
+!C8 U+0445 afii10087
+!C9 U+0438 afii10074
+!CA U+0439 afii10075
+!CB U+043A afii10076
+!CC U+043B afii10077
+!CD U+043C afii10078
+!CE U+043D afii10079
+!CF U+043E afii10080
+!D0 U+043F afii10081
+!D1 U+044F afii10097
+!D2 U+0440 afii10082
+!D3 U+0441 afii10083
+!D4 U+0442 afii10084
+!D5 U+0443 afii10085
+!D6 U+0436 afii10072
+!D7 U+0432 afii10067
+!D8 U+044C afii10094
+!D9 U+044B afii10093
+!DA U+0437 afii10073
+!DB U+0448 afii10090
+!DC U+044D afii10095
+!DD U+0449 afii10091
+!DE U+0447 afii10089
+!DF U+044A afii10092
+!E0 U+042E afii10048
+!E1 U+0410 afii10017
+!E2 U+0411 afii10018
+!E3 U+0426 afii10040
+!E4 U+0414 afii10021
+!E5 U+0415 afii10022
+!E6 U+0424 afii10038
+!E7 U+0413 afii10020
+!E8 U+0425 afii10039
+!E9 U+0418 afii10026
+!EA U+0419 afii10027
+!EB U+041A afii10028
+!EC U+041B afii10029
+!ED U+041C afii10030
+!EE U+041D afii10031
+!EF U+041E afii10032
+!F0 U+041F afii10033
+!F1 U+042F afii10049
+!F2 U+0420 afii10034
+!F3 U+0421 afii10035
+!F4 U+0422 afii10036
+!F5 U+0423 afii10037
+!F6 U+0416 afii10024
+!F7 U+0412 afii10019
+!F8 U+042C afii10046
+!F9 U+042B afii10045
+!FA U+0417 afii10025
+!FB U+0428 afii10042
+!FC U+042D afii10047
+!FD U+0429 afii10043
+!FE U+0427 afii10041
+!FF U+042A afii10044
diff -ruN 6171/e107_plugins/pdf/font/makefont/koi8-u.map 75/e107_plugins/pdf/font/makefont/koi8-u.map
--- 6171/e107_plugins/pdf/font/makefont/koi8-u.map	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/koi8-u.map	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,256 @@
+!00 U+0000 .notdef
+!01 U+0001 .notdef
+!02 U+0002 .notdef
+!03 U+0003 .notdef
+!04 U+0004 .notdef
+!05 U+0005 .notdef
+!06 U+0006 .notdef
+!07 U+0007 .notdef
+!08 U+0008 .notdef
+!09 U+0009 .notdef
+!0A U+000A .notdef
+!0B U+000B .notdef
+!0C U+000C .notdef
+!0D U+000D .notdef
+!0E U+000E .notdef
+!0F U+000F .notdef
+!10 U+0010 .notdef
+!11 U+0011 .notdef
+!12 U+0012 .notdef
+!13 U+0013 .notdef
+!14 U+0014 .notdef
+!15 U+0015 .notdef
+!16 U+0016 .notdef
+!17 U+0017 .notdef
+!18 U+0018 .notdef
+!19 U+0019 .notdef
+!1A U+001A .notdef
+!1B U+001B .notdef
+!1C U+001C .notdef
+!1D U+001D .notdef
+!1E U+001E .notdef
+!1F U+001F .notdef
+!20 U+0020 space
+!21 U+0021 exclam
+!22 U+0022 quotedbl
+!23 U+0023 numbersign
+!24 U+0024 dollar
+!25 U+0025 percent
+!26 U+0026 ampersand
+!27 U+0027 quotesingle
+!28 U+0028 parenleft
+!29 U+0029 parenright
+!2A U+002A asterisk
+!2B U+002B plus
+!2C U+002C comma
+!2D U+002D hyphen
+!2E U+002E period
+!2F U+002F slash
+!30 U+0030 zero
+!31 U+0031 one
+!32 U+0032 two
+!33 U+0033 three
+!34 U+0034 four
+!35 U+0035 five
+!36 U+0036 six
+!37 U+0037 seven
+!38 U+0038 eight
+!39 U+0039 nine
+!3A U+003A colon
+!3B U+003B semicolon
+!3C U+003C less
+!3D U+003D equal
+!3E U+003E greater
+!3F U+003F question
+!40 U+0040 at
+!41 U+0041 A
+!42 U+0042 B
+!43 U+0043 C
+!44 U+0044 D
+!45 U+0045 E
+!46 U+0046 F
+!47 U+0047 G
+!48 U+0048 H
+!49 U+0049 I
+!4A U+004A J
+!4B U+004B K
+!4C U+004C L
+!4D U+004D M
+!4E U+004E N
+!4F U+004F O
+!50 U+0050 P
+!51 U+0051 Q
+!52 U+0052 R
+!53 U+0053 S
+!54 U+0054 T
+!55 U+0055 U
+!56 U+0056 V
+!57 U+0057 W
+!58 U+0058 X
+!59 U+0059 Y
+!5A U+005A Z
+!5B U+005B bracketleft
+!5C U+005C backslash
+!5D U+005D bracketright
+!5E U+005E asciicircum
+!5F U+005F underscore
+!60 U+0060 grave
+!61 U+0061 a
+!62 U+0062 b
+!63 U+0063 c
+!64 U+0064 d
+!65 U+0065 e
+!66 U+0066 f
+!67 U+0067 g
+!68 U+0068 h
+!69 U+0069 i
+!6A U+006A j
+!6B U+006B k
+!6C U+006C l
+!6D U+006D m
+!6E U+006E n
+!6F U+006F o
+!70 U+0070 p
+!71 U+0071 q
+!72 U+0072 r
+!73 U+0073 s
+!74 U+0074 t
+!75 U+0075 u
+!76 U+0076 v
+!77 U+0077 w
+!78 U+0078 x
+!79 U+0079 y
+!7A U+007A z
+!7B U+007B braceleft
+!7C U+007C bar
+!7D U+007D braceright
+!7E U+007E asciitilde
+!7F U+007F .notdef
+!80 U+2500 SF100000
+!81 U+2502 SF110000
+!82 U+250C SF010000
+!83 U+2510 SF030000
+!84 U+2514 SF020000
+!85 U+2518 SF040000
+!86 U+251C SF080000
+!87 U+2524 SF090000
+!88 U+252C SF060000
+!89 U+2534 SF070000
+!8A U+253C SF050000
+!8B U+2580 upblock
+!8C U+2584 dnblock
+!8D U+2588 block
+!8E U+258C lfblock
+!8F U+2590 rtblock
+!90 U+2591 ltshade
+!91 U+2592 shade
+!92 U+2593 dkshade
+!93 U+2320 integraltp
+!94 U+25A0 filledbox
+!95 U+2022 bullet
+!96 U+221A radical
+!97 U+2248 approxequal
+!98 U+2264 lessequal
+!99 U+2265 greaterequal
+!9A U+00A0 space
+!9B U+2321 integralbt
+!9C U+00B0 degree
+!9D U+00B2 twosuperior
+!9E U+00B7 periodcentered
+!9F U+00F7 divide
+!A0 U+2550 SF430000
+!A1 U+2551 SF240000
+!A2 U+2552 SF510000
+!A3 U+0451 afii10071
+!A4 U+0454 afii10101
+!A5 U+2554 SF390000
+!A6 U+0456 afii10103
+!A7 U+0457 afii10104
+!A8 U+2557 SF250000
+!A9 U+2558 SF500000
+!AA U+2559 SF490000
+!AB U+255A SF380000
+!AC U+255B SF280000
+!AD U+0491 afii10098
+!AE U+255D SF260000
+!AF U+255E SF360000
+!B0 U+255F SF370000
+!B1 U+2560 SF420000
+!B2 U+2561 SF190000
+!B3 U+0401 afii10023
+!B4 U+0404 afii10053
+!B5 U+2563 SF230000
+!B6 U+0406 afii10055
+!B7 U+0407 afii10056
+!B8 U+2566 SF410000
+!B9 U+2567 SF450000
+!BA U+2568 SF460000
+!BB U+2569 SF400000
+!BC U+256A SF540000
+!BD U+0490 afii10050
+!BE U+256C SF440000
+!BF U+00A9 copyright
+!C0 U+044E afii10096
+!C1 U+0430 afii10065
+!C2 U+0431 afii10066
+!C3 U+0446 afii10088
+!C4 U+0434 afii10069
+!C5 U+0435 afii10070
+!C6 U+0444 afii10086
+!C7 U+0433 afii10068
+!C8 U+0445 afii10087
+!C9 U+0438 afii10074
+!CA U+0439 afii10075
+!CB U+043A afii10076
+!CC U+043B afii10077
+!CD U+043C afii10078
+!CE U+043D afii10079
+!CF U+043E afii10080
+!D0 U+043F afii10081
+!D1 U+044F afii10097
+!D2 U+0440 afii10082
+!D3 U+0441 afii10083
+!D4 U+0442 afii10084
+!D5 U+0443 afii10085
+!D6 U+0436 afii10072
+!D7 U+0432 afii10067
+!D8 U+044C afii10094
+!D9 U+044B afii10093
+!DA U+0437 afii10073
+!DB U+0448 afii10090
+!DC U+044D afii10095
+!DD U+0449 afii10091
+!DE U+0447 afii10089
+!DF U+044A afii10092
+!E0 U+042E afii10048
+!E1 U+0410 afii10017
+!E2 U+0411 afii10018
+!E3 U+0426 afii10040
+!E4 U+0414 afii10021
+!E5 U+0415 afii10022
+!E6 U+0424 afii10038
+!E7 U+0413 afii10020
+!E8 U+0425 afii10039
+!E9 U+0418 afii10026
+!EA U+0419 afii10027
+!EB U+041A afii10028
+!EC U+041B afii10029
+!ED U+041C afii10030
+!EE U+041D afii10031
+!EF U+041E afii10032
+!F0 U+041F afii10033
+!F1 U+042F afii10049
+!F2 U+0420 afii10034
+!F3 U+0421 afii10035
+!F4 U+0422 afii10036
+!F5 U+0423 afii10037
+!F6 U+0416 afii10024
+!F7 U+0412 afii10019
+!F8 U+042C afii10046
+!F9 U+042B afii10045
+!FA U+0417 afii10025
+!FB U+0428 afii10042
+!FC U+042D afii10047
+!FD U+0429 afii10043
+!FE U+0427 afii10041
+!FF U+042A afii10044
diff -ruN 6171/e107_plugins/pdf/font/makefont/makefont.php 75/e107_plugins/pdf/font/makefont/makefont.php
--- 6171/e107_plugins/pdf/font/makefont/makefont.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/makefont/makefont.php	2005-08-22 19:44:23.000000000 -0500
@@ -0,0 +1,416 @@
+<?php
+/*******************************************************************************
+* Utility to generate font definition files                                    *
+* Version: 1.13                                                                *
+* Date:    2004-12-31                                                          *
+*******************************************************************************/
+
+function ReadMap($enc)
+{
+	//Read a map file
+	$file=dirname(__FILE__).'/'.strtolower($enc).'.map';
+	$a=file($file);
+	if(empty($a))
+		die('<B>Error:</B> encoding not found: '.$enc);
+	$cc2gn=array();
+	foreach($a as $l)
+	{
+		if($l{0}=='!')
+		{
+			$e=preg_split('/[ \\t]+/',rtrim($l));
+			$cc=hexdec(substr($e[0],1));
+			$gn=$e[2];
+			$cc2gn[$cc]=$gn;
+		}
+	}
+	for($i=0;$i<=255;$i++)
+	{
+		if(!isset($cc2gn[$i]))
+			$cc2gn[$i]='.notdef';
+	}
+	return $cc2gn;
+}
+
+function ReadAFM($file,&$map)
+{
+	//Read a font metric file
+	$a=file($file);
+	if(empty($a))
+		die('File not found');
+	$widths=array();
+	$fm=array();
+	$fix=array('Edot'=>'Edotaccent','edot'=>'edotaccent','Idot'=>'Idotaccent','Zdot'=>'Zdotaccent','zdot'=>'zdotaccent',
+		'Odblacute'=>'Ohungarumlaut','odblacute'=>'ohungarumlaut','Udblacute'=>'Uhungarumlaut','udblacute'=>'uhungarumlaut',
+		'Gcedilla'=>'Gcommaaccent','gcedilla'=>'gcommaaccent','Kcedilla'=>'Kcommaaccent','kcedilla'=>'kcommaaccent',
+		'Lcedilla'=>'Lcommaaccent','lcedilla'=>'lcommaaccent','Ncedilla'=>'Ncommaaccent','ncedilla'=>'ncommaaccent',
+		'Rcedilla'=>'Rcommaaccent','rcedilla'=>'rcommaaccent','Scedilla'=>'Scommaaccent','scedilla'=>'scommaaccent',
+		'Tcedilla'=>'Tcommaaccent','tcedilla'=>'tcommaaccent','Dslash'=>'Dcroat','dslash'=>'dcroat','Dmacron'=>'Dcroat','dmacron'=>'dcroat',
+		'combininggraveaccent'=>'gravecomb','combininghookabove'=>'hookabovecomb','combiningtildeaccent'=>'tildecomb',
+		'combiningacuteaccent'=>'acutecomb','combiningdotbelow'=>'dotbelowcomb','dongsign'=>'dong');
+	foreach($a as $l)
+	{
+		$e=explode(' ',rtrim($l));
+		if(count($e)<2)
+			continue;
+		$code=$e[0];
+		$param=$e[1];
+		if($code=='C')
+		{
+			//Character metrics
+			$cc=(int)$e[1];
+			$w=$e[4];
+			$gn=$e[7];
+			if(substr($gn,-4)=='20AC')
+				$gn='Euro';
+			if(isset($fix[$gn]))
+			{
+				//Fix incorrect glyph name
+				foreach($map as $c=>$n)
+				{
+					if($n==$fix[$gn])
+						$map[$c]=$gn;
+				}
+			}
+			if(empty($map))
+			{
+				//Symbolic font: use built-in encoding
+				$widths[$cc]=$w;
+			}
+			else
+			{
+				$widths[$gn]=$w;
+				if($gn=='X')
+					$fm['CapXHeight']=$e[13];
+			}
+			if($gn=='.notdef')
+				$fm['MissingWidth']=$w;
+		}
+		elseif($code=='FontName')
+			$fm['FontName']=$param;
+		elseif($code=='Weight')
+			$fm['Weight']=$param;
+		elseif($code=='ItalicAngle')
+			$fm['ItalicAngle']=(double)$param;
+		elseif($code=='Ascender')
+			$fm['Ascender']=(int)$param;
+		elseif($code=='Descender')
+			$fm['Descender']=(int)$param;
+		elseif($code=='UnderlineThickness')
+			$fm['UnderlineThickness']=(int)$param;
+		elseif($code=='UnderlinePosition')
+			$fm['UnderlinePosition']=(int)$param;
+		elseif($code=='IsFixedPitch')
+			$fm['IsFixedPitch']=($param=='true');
+		elseif($code=='FontBBox')
+			$fm['FontBBox']=array($e[1],$e[2],$e[3],$e[4]);
+		elseif($code=='CapHeight')
+			$fm['CapHeight']=(int)$param;
+		elseif($code=='StdVW')
+			$fm['StdVW']=(int)$param;
+	}
+	if(!isset($fm['FontName']))
+		die('FontName not found');
+	if(!empty($map))
+	{
+		if(!isset($widths['.notdef']))
+			$widths['.notdef']=600;
+		if(!isset($widths['Delta']) and isset($widths['increment']))
+			$widths['Delta']=$widths['increment'];
+		//Order widths according to map
+		for($i=0;$i<=255;$i++)
+		{
+			if(!isset($widths[$map[$i]]))
+			{
+				echo '<B>Warning:</B> character '.$map[$i].' is missing<BR>';
+				$widths[$i]=$widths['.notdef'];
+			}
+			else
+				$widths[$i]=$widths[$map[$i]];
+		}
+	}
+	$fm['Widths']=$widths;
+	return $fm;
+}
+
+function MakeFontDescriptor($fm,$symbolic)
+{
+	//Ascent
+	$asc=(isset($fm['Ascender']) ? $fm['Ascender'] : 1000);
+	$fd="array('Ascent'=>".$asc;
+	//Descent
+	$desc=(isset($fm['Descender']) ? $fm['Descender'] : -200);
+	$fd.=",'Descent'=>".$desc;
+	//CapHeight
+	if(isset($fm['CapHeight']))
+		$ch=$fm['CapHeight'];
+	elseif(isset($fm['CapXHeight']))
+		$ch=$fm['CapXHeight'];
+	else
+		$ch=$asc;
+	$fd.=",'CapHeight'=>".$ch;
+	//Flags
+	$flags=0;
+	if(isset($fm['IsFixedPitch']) and $fm['IsFixedPitch'])
+		$flags+=1<<0;
+	if($symbolic)
+		$flags+=1<<2;
+	if(!$symbolic)
+		$flags+=1<<5;
+	if(isset($fm['ItalicAngle']) and $fm['ItalicAngle']!=0)
+		$flags+=1<<6;
+	$fd.=",'Flags'=>".$flags;
+	//FontBBox
+	if(isset($fm['FontBBox']))
+		$fbb=$fm['FontBBox'];
+	else
+		$fbb=array(0,$des-100,1000,$asc+100);
+	$fd.=",'FontBBox'=>'[".$fbb[0].' '.$fbb[1].' '.$fbb[2].' '.$fbb[3]."]'";
+	//ItalicAngle
+	$ia=(isset($fm['ItalicAngle']) ? $fm['ItalicAngle'] : 0);
+	$fd.=",'ItalicAngle'=>".$ia;
+	//StemV
+	if(isset($fm['StdVW']))
+		$stemv=$fm['StdVW'];
+	elseif(isset($fm['Weight']) and preg_match('/(bold|black)/i',$fm['Weight']))
+		$stemv=120;
+	else
+		$stemv=70;
+	$fd.=",'StemV'=>".$stemv;
+	//MissingWidth
+	if(isset($fm['MissingWidth']))
+		$fd.=",'MissingWidth'=>".$fm['MissingWidth'];
+	$fd.=')';
+	return $fd;
+}
+
+function MakeWidthArray($fm)
+{
+	//Make character width array
+	$s="array(\n\t";
+	$cw=$fm['Widths'];
+	for($i=0;$i<=255;$i++)
+	{
+		if(chr($i)=="'")
+			$s.="'\\''";
+		elseif(chr($i)=="\\")
+			$s.="'\\\\'";
+		elseif($i>=32 and $i<=126)
+			$s.="'".chr($i)."'";
+		else
+			$s.="chr($i)";
+		$s.='=>'.$fm['Widths'][$i];
+		if($i<255)
+			$s.=',';
+		if(($i+1)%22==0)
+			$s.="\n\t";
+	}
+	$s.=')';
+	return $s;
+}
+
+function MakeFontEncoding($map)
+{
+	//Build differences from reference encoding
+	$ref=ReadMap('cp1252');
+	$s='';
+	$last=0;
+	for($i=32;$i<=255;$i++)
+	{
+		if($map[$i]!=$ref[$i])
+		{
+			if($i!=$last+1)
+				$s.=$i.' ';
+			$last=$i;
+			$s.='/'.$map[$i].' ';
+		}
+	}
+	return rtrim($s);
+}
+
+function SaveToFile($file,$s,$mode='t')
+{
+	$f=fopen($file,'w'.$mode);
+	if(!$f)
+		die('Can\'t write to file '.$file);
+	fwrite($f,$s,strlen($s));
+	fclose($f);
+}
+
+function ReadShort($f)
+{
+	$a=unpack('n1n',fread($f,2));
+	return $a['n'];
+}
+
+function ReadLong($f)
+{
+	$a=unpack('N1N',fread($f,4));
+	return $a['N'];
+}
+
+function CheckTTF($file)
+{
+	//Check if font license allows embedding
+	$f=fopen($file,'rb');
+	if(!$f)
+		die('<B>Error:</B> Can\'t open '.$file);
+	//Extract number of tables
+	fseek($f,4,SEEK_CUR);
+	$nb=ReadShort($f);
+	fseek($f,6,SEEK_CUR);
+	//Seek OS/2 table
+	$found=false;
+	for($i=0;$i<$nb;$i++)
+	{
+		if(fread($f,4)=='OS/2')
+		{
+			$found=true;
+			break;
+		}
+		fseek($f,12,SEEK_CUR);
+	}
+	if(!$found)
+	{
+		fclose($f);
+		return;
+	}
+	fseek($f,4,SEEK_CUR);
+	$offset=ReadLong($f);
+	fseek($f,$offset,SEEK_SET);
+	//Extract fsType flags
+	fseek($f,8,SEEK_CUR);
+	$fsType=ReadShort($f);
+	$rl=($fsType & 0x02)!=0;
+	$pp=($fsType & 0x04)!=0;
+	$e=($fsType & 0x08)!=0;
+	fclose($f);
+	if($rl and !$pp and !$e)
+		echo '<B>Warning:</B> font license does not allow embedding';
+}
+
+/*******************************************************************************
+* $fontfile : chemin du fichier TTF (ou chane vide si pas d'incorporation)    *
+* $afmfile :  chemin du fichier AFM                                            *
+* $enc :      encodage (ou chane vide si la police est symbolique)            *
+* $patch :    patch optionnel pour l'encodage                                  *
+* $type :     type de la police si $fontfile est vide                          *
+*******************************************************************************/
+function MakeFont($fontfile,$afmfile,$enc='cp1252',$patch=array(),$type='TrueType')
+{
+	//Generate a font definition file
+	set_magic_quotes_runtime(0);
+	ini_set('auto_detect_line_endings','1');
+	if($enc)
+	{
+		$map=ReadMap($enc);
+		foreach($patch as $cc=>$gn)
+			$map[$cc]=$gn;
+	}
+	else
+		$map=array();
+	if(!file_exists($afmfile))
+		die('<B>Error:</B> AFM file not found: '.$afmfile);
+	$fm=ReadAFM($afmfile,$map);
+	if($enc)
+		$diff=MakeFontEncoding($map);
+	else
+		$diff='';
+	$fd=MakeFontDescriptor($fm,empty($map));
+	//Find font type
+	if($fontfile)
+	{
+		$ext=strtolower(substr($fontfile,-3));
+		if($ext=='ttf')
+			$type='TrueType';
+		elseif($ext=='pfb')
+			$type='Type1';
+		else
+			die('<B>Error:</B> unrecognized font file extension: '.$ext);
+	}
+	else
+	{
+		if($type!='TrueType' and $type!='Type1')
+			die('<B>Error:</B> incorrect font type: '.$type);
+	}
+	//Start generation
+	$s='<?php'."\n";
+	$s.='$type=\''.$type."';\n";
+	$s.='$name=\''.$fm['FontName']."';\n";
+	$s.='$desc='.$fd.";\n";
+	if(!isset($fm['UnderlinePosition']))
+		$fm['UnderlinePosition']=-100;
+	if(!isset($fm['UnderlineThickness']))
+		$fm['UnderlineThickness']=50;
+	$s.='$up='.$fm['UnderlinePosition'].";\n";
+	$s.='$ut='.$fm['UnderlineThickness'].";\n";
+	$w=MakeWidthArray($fm);
+	$s.='$cw='.$w.";\n";
+	$s.='$enc=\''.$enc."';\n";
+	$s.='$diff=\''.$diff."';\n";
+	$basename=substr(basename($afmfile),0,-4);
+	if($fontfile)
+	{
+		//Embedded font
+		if(!file_exists($fontfile))
+			die('<B>Error:</B> font file not found: '.$fontfile);
+		if($type=='TrueType')
+			CheckTTF($fontfile);
+		$f=fopen($fontfile,'rb');
+		if(!$f)
+			die('<B>Error:</B> Can\'t open '.$fontfile);
+		$file=fread($f,filesize($fontfile));
+		fclose($f);
+		if($type=='Type1')
+		{
+			//Find first two sections and discard third one
+			$header=(ord($file{0})==128);
+			if($header)
+			{
+				//Strip first binary header
+				$file=substr($file,6);
+			}
+			$pos=strpos($file,'eexec');
+			if(!$pos)
+				die('<B>Error:</B> font file does not seem to be valid Type1');
+			$size1=$pos+6;
+			if($header and ord($file{$size1})==128)
+			{
+				//Strip second binary header
+				$file=substr($file,0,$size1).substr($file,$size1+6);
+			}
+			$pos=strpos($file,'00000000');
+			if(!$pos)
+				die('<B>Error:</B> font file does not seem to be valid Type1');
+			$size2=$pos-$size1;
+			$file=substr($file,0,$size1+$size2);
+		}
+		if(function_exists('gzcompress'))
+		{
+			$cmp=$basename.'.z';
+			SaveToFile($cmp,gzcompress($file),'b');
+			$s.='$file=\''.$cmp."';\n";
+			echo 'Font file compressed ('.$cmp.')<BR>';
+		}
+		else
+		{
+			$s.='$file=\''.basename($fontfile)."';\n";
+			echo '<B>Notice:</B> font file could not be compressed (zlib extension not available)<BR>';
+		}
+		if($type=='Type1')
+		{
+			$s.='$size1='.$size1.";\n";
+			$s.='$size2='.$size2.";\n";
+		}
+		else
+			$s.='$originalsize='.filesize($fontfile).";\n";
+	}
+	else
+	{
+		//Not embedded font
+		$s.='$file='."'';\n";
+	}
+	$s.="?>\n";
+	SaveToFile($basename.'.php',$s);
+	echo 'Font definition file generated ('.$basename.'.php'.')<BR>';
+}
+?>
diff -ruN 6171/e107_plugins/pdf/font/symbol.php 75/e107_plugins/pdf/font/symbol.php
--- 6171/e107_plugins/pdf/font/symbol.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/symbol.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['symbol']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549,
+	','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722,
+	'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768,
+	'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576,
+	'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0,
+	chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
+	chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603,
+	chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768,
+	chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042,
+	chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329,
+	chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0);
+?>
diff -ruN 6171/e107_plugins/pdf/font/timesbi.php 75/e107_plugins/pdf/font/timesbi.php
--- 6171/e107_plugins/pdf/font/timesbi.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/timesbi.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['timesBI']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
+	','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667,
+	'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889,
+	'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
+	'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+	chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333,
+	chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667,
+	chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
+	chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444);
+?>
diff -ruN 6171/e107_plugins/pdf/font/timesb.php 75/e107_plugins/pdf/font/timesb.php
--- 6171/e107_plugins/pdf/font/timesb.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/timesb.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['timesB']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570,
+	','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722,
+	'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000,
+	'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833,
+	'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+	chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000,
+	chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333,
+	chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+	chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556,
+	chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500);
+?>
diff -ruN 6171/e107_plugins/pdf/font/timesi.php 75/e107_plugins/pdf/font/timesi.php
--- 6171/e107_plugins/pdf/font/timesi.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/timesi.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['timesI']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675,
+	','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611,
+	'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833,
+	'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722,
+	'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+	chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980,
+	chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333,
+	chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611,
+	chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
+	chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444);
+?>
diff -ruN 6171/e107_plugins/pdf/font/times.php 75/e107_plugins/pdf/font/times.php
--- 6171/e107_plugins/pdf/font/times.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/times.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['times']=array(
+	chr(0)=>250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250,
+	chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564,
+	','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722,
+	'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944,
+	'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778,
+	'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500,
+	chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980,
+	chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333,
+	chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722,
+	chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722,
+	chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500,
+	chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500);
+?>
diff -ruN 6171/e107_plugins/pdf/font/zapfdingbats.php 75/e107_plugins/pdf/font/zapfdingbats.php
--- 6171/e107_plugins/pdf/font/zapfdingbats.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/font/zapfdingbats.php	2005-02-10 08:10:07.000000000 -0600
@@ -0,0 +1,15 @@
+<?php
+$fpdf_charwidths['zapfdingbats']=array(
+	chr(0)=>0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0,
+	chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939,
+	','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692,
+	'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776,
+	'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873,
+	'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317,
+	chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0,
+	chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788,
+	chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788,
+	chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918,
+	chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874,
+	chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0);
+?>
diff -ruN 6171/e107_plugins/pdf/fpdf.css 75/e107_plugins/pdf/fpdf.css
--- 6171/e107_plugins/pdf/fpdf.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/fpdf.css	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,11 @@
+BODY {font-family:times new roman,serif}
+H2 {color:#4000A0}
+P.demo {text-align:center; margin-top:-10px}
+A.demo {text-decoration:none; font-weight:bold; color:#0000CC}
+A.demo:link {text-decoration:none; font-weight:bold; color:#0000CC}
+A.demo:hover {text-decoration:none; font-weight:bold; color:#0000FF}
+A.demo:active {text-decoration:none; font-weight:bold; color:#0000FF}
+.st {font-weight:bold; color:#900000}
+.kw {color:#000080; font-weight:bold}
+.str {color:#CC0000}
+.cmt {color:#008000}
diff -ruN 6171/e107_plugins/pdf/fpdf.php 75/e107_plugins/pdf/fpdf.php
--- 6171/e107_plugins/pdf/fpdf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/fpdf.php	2006-01-13 04:49:03.000000000 -0600
@@ -0,0 +1,1664 @@
+<?php
+/*******************************************************************************
+* Software: FPDF                                                               *
+* Version:  1.53                                                               *
+* Date:     2004-12-31                                                         *
+* Author:   Olivier PLATHEY                                                    *
+* License:  Freeware                                                           *
+*                                                                              *
+* You may use and modify this software as you wish.                            *
+*******************************************************************************/
+
+if(!class_exists('FPDF'))
+{
+define('FPDF_VERSION','1.53');
+
+class FPDF
+{
+//Private properties
+var $page;               //current page number
+var $n;                  //current object number
+var $offsets;            //array of object offsets
+var $buffer;             //buffer holding in-memory PDF
+var $pages;              //array containing pages
+var $state;              //current document state
+var $compress;           //compression flag
+var $DefOrientation;     //default orientation
+var $CurOrientation;     //current orientation
+var $OrientationChanges; //array indicating orientation changes
+var $k;                  //scale factor (number of points in user unit)
+var $fwPt,$fhPt;         //dimensions of page format in points
+var $fw,$fh;             //dimensions of page format in user unit
+var $wPt,$hPt;           //current dimensions of page in points
+var $w,$h;               //current dimensions of page in user unit
+var $lMargin;            //left margin
+var $tMargin;            //top margin
+var $rMargin;            //right margin
+var $bMargin;            //page break margin
+var $cMargin;            //cell margin
+var $x,$y;               //current position in user unit for cell positioning
+var $lasth;              //height of last cell printed
+var $LineWidth;          //line width in user unit
+var $CoreFonts;          //array of standard font names
+var $fonts;              //array of used fonts
+var $FontFiles;          //array of font files
+var $diffs;              //array of encoding differences
+var $images;             //array of used images
+var $PageLinks;          //array of links in pages
+var $links;              //array of internal links
+var $FontFamily;         //current font family
+var $FontStyle;          //current font style
+var $underline;          //underlining flag
+var $CurrentFont;        //current font info
+var $FontSizePt;         //current font size in points
+var $FontSize;           //current font size in user unit
+var $DrawColor;          //commands for drawing color
+var $FillColor;          //commands for filling color
+var $TextColor;          //commands for text color
+var $ColorFlag;          //indicates whether fill and text colors are different
+var $ws;                 //word spacing
+var $AutoPageBreak;      //automatic page breaking
+var $PageBreakTrigger;   //threshold used to trigger page breaks
+var $InFooter;           //flag set when processing footer
+var $ZoomMode;           //zoom display mode
+var $LayoutMode;         //layout display mode
+var $title;              //title
+var $subject;            //subject
+var $author;             //author
+var $keywords;           //keywords
+var $creator;            //creator
+var $AliasNbPages;       //alias for total number of pages
+var $PDFVersion;         //PDF version number
+
+/*******************************************************************************
+*                                                                              *
+*                               Public methods                                 *
+*                                                                              *
+*******************************************************************************/
+function FPDF($orientation='P',$unit='mm',$format='A4')
+{
+	//Some checks
+	$this->_dochecks();
+	//Initialization of properties
+	$this->page=0;
+	$this->n=2;
+	$this->buffer='';
+	$this->pages=array();
+	$this->OrientationChanges=array();
+	$this->state=0;
+	$this->fonts=array();
+	$this->FontFiles=array();
+	$this->diffs=array();
+	$this->images=array();
+	$this->links=array();
+	$this->InFooter=false;
+	$this->lasth=0;
+	$this->FontFamily='';
+	$this->FontStyle='';
+	$this->FontSizePt=12;
+	$this->underline=false;
+	$this->DrawColor='0 G';
+	$this->FillColor='0 g';
+	$this->TextColor='0 g';
+	$this->ColorFlag=false;
+	$this->ws=0;
+	//Standard fonts
+	$this->CoreFonts=array('courier'=>'Courier','courierB'=>'Courier-Bold','courierI'=>'Courier-Oblique','courierBI'=>'Courier-BoldOblique',
+		'helvetica'=>'Helvetica','helveticaB'=>'Helvetica-Bold','helveticaI'=>'Helvetica-Oblique','helveticaBI'=>'Helvetica-BoldOblique',
+		'times'=>'Times-Roman','timesB'=>'Times-Bold','timesI'=>'Times-Italic','timesBI'=>'Times-BoldItalic',
+		'symbol'=>'Symbol','zapfdingbats'=>'ZapfDingbats');
+	//Scale factor
+	if($unit=='pt')
+		$this->k=1;
+	elseif($unit=='mm')
+		$this->k=72/25.4;
+	elseif($unit=='cm')
+		$this->k=72/2.54;
+	elseif($unit=='in')
+		$this->k=72;
+	else
+		$this->Error('Incorrect unit: '.$unit);
+	//Page format
+	if(is_string($format))
+	{
+		$format=strtolower($format);
+		if($format=='a3')
+			$format=array(841.89,1190.55);
+		elseif($format=='a4')
+			$format=array(595.28,841.89);
+		elseif($format=='a5')
+			$format=array(420.94,595.28);
+		elseif($format=='letter')
+			$format=array(612,792);
+		elseif($format=='legal')
+			$format=array(612,1008);
+		else
+			$this->Error('Unknown page format: '.$format);
+		$this->fwPt=$format[0];
+		$this->fhPt=$format[1];
+	}
+	else
+	{
+		$this->fwPt=$format[0]*$this->k;
+		$this->fhPt=$format[1]*$this->k;
+	}
+	$this->fw=$this->fwPt/$this->k;
+	$this->fh=$this->fhPt/$this->k;
+	//Page orientation
+	$orientation=strtolower($orientation);
+	if($orientation=='p' || $orientation=='portrait')
+	{
+		$this->DefOrientation='P';
+		$this->wPt=$this->fwPt;
+		$this->hPt=$this->fhPt;
+	}
+	elseif($orientation=='l' || $orientation=='landscape')
+	{
+		$this->DefOrientation='L';
+		$this->wPt=$this->fhPt;
+		$this->hPt=$this->fwPt;
+	}
+	else
+		$this->Error('Incorrect orientation: '.$orientation);
+	$this->CurOrientation=$this->DefOrientation;
+	$this->w=$this->wPt/$this->k;
+	$this->h=$this->hPt/$this->k;
+	//Page margins (1 cm)
+	$margin=28.35/$this->k;
+	$this->SetMargins($margin,$margin);
+	//Interior cell margin (1 mm)
+	$this->cMargin=$margin/10;
+	//Line width (0.2 mm)
+	$this->LineWidth=.567/$this->k;
+	//Automatic page break
+	$this->SetAutoPageBreak(true,2*$margin);
+	//Full width display mode
+	$this->SetDisplayMode('fullwidth');
+	//Enable compression
+	$this->SetCompression(true);
+	//Set default PDF version number
+	$this->PDFVersion='1.3';
+}
+
+function SetMargins($left,$top,$right=-1)
+{
+	//Set left, top and right margins
+	$this->lMargin=$left;
+	$this->tMargin=$top;
+	if($right==-1)
+		$right=$left;
+	$this->rMargin=$right;
+}
+
+function SetLeftMargin($margin)
+{
+	//Set left margin
+	$this->lMargin=$margin;
+	if($this->page>0 && $this->x<$margin)
+		$this->x=$margin;
+}
+
+function SetTopMargin($margin)
+{
+	//Set top margin
+	$this->tMargin=$margin;
+}
+
+function SetRightMargin($margin)
+{
+	//Set right margin
+	$this->rMargin=$margin;
+}
+
+function SetAutoPageBreak($auto,$margin=0)
+{
+	//Set auto page break mode and triggering margin
+	$this->AutoPageBreak=$auto;
+	$this->bMargin=$margin;
+	$this->PageBreakTrigger=$this->h-$margin;
+}
+
+function SetDisplayMode($zoom,$layout='continuous')
+{
+	//Set display mode in viewer
+	if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))
+		$this->ZoomMode=$zoom;
+	else
+		$this->Error('Incorrect zoom display mode: '.$zoom);
+	if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')
+		$this->LayoutMode=$layout;
+	else
+		$this->Error('Incorrect layout display mode: '.$layout);
+}
+
+function SetCompression($compress)
+{
+	//Set page compression
+	if(function_exists('gzcompress'))
+		$this->compress=$compress;
+	else
+		$this->compress=false;
+}
+
+function SetTitle($title)
+{
+	//Title of document
+	$this->title=$title;
+}
+
+function SetSubject($subject)
+{
+	//Subject of document
+	$this->subject=$subject;
+}
+
+function SetAuthor($author)
+{
+	//Author of document
+	$this->author=$author;
+}
+
+function SetKeywords($keywords)
+{
+	//Keywords of document
+	$this->keywords=$keywords;
+}
+
+function SetCreator($creator)
+{
+	//Creator of document
+	$this->creator=$creator;
+}
+
+function AliasNbPages($alias='{nb}')
+{
+	//Define an alias for total number of pages
+	$this->AliasNbPages=$alias;
+}
+
+function Error($msg)
+{
+	//Fatal error
+	die('<B>FPDF error: </B>'.$msg);
+}
+
+function Open()
+{
+	//Begin document
+	$this->state=1;
+}
+
+function Close()
+{
+	//Terminate document
+	if($this->state==3)
+		return;
+	if($this->page==0)
+		$this->AddPage();
+	//Page footer
+	$this->InFooter=true;
+	$this->Footer();
+	$this->InFooter=false;
+	//Close page
+	$this->_endpage();
+	//Close document
+	$this->_enddoc();
+}
+
+function AddPage($orientation='')
+{
+	//Start a new page
+	if($this->state==0)
+		$this->Open();
+	$family=$this->FontFamily;
+	$style=$this->FontStyle.($this->underline ? 'U' : '');
+	$size=$this->FontSizePt;
+	$lw=$this->LineWidth;
+	$dc=$this->DrawColor;
+	$fc=$this->FillColor;
+	$tc=$this->TextColor;
+	$cf=$this->ColorFlag;
+	if($this->page>0)
+	{
+		//Page footer
+		$this->InFooter=true;
+		$this->Footer();
+		$this->InFooter=false;
+		//Close page
+		$this->_endpage();
+	}
+	//Start new page
+	$this->_beginpage($orientation);
+	//Set line cap style to square
+	$this->_out('2 J');
+	//Set line width
+	$this->LineWidth=$lw;
+	$this->_out(sprintf('%.2f w',$lw*$this->k));
+	//Set font
+	if($family)
+		$this->SetFont($family,$style,$size);
+	//Set colors
+	$this->DrawColor=$dc;
+	if($dc!='0 G')
+		$this->_out($dc);
+	$this->FillColor=$fc;
+	if($fc!='0 g')
+		$this->_out($fc);
+	$this->TextColor=$tc;
+	$this->ColorFlag=$cf;
+	//Page header
+	$this->Header();
+	//Restore line width
+	if($this->LineWidth!=$lw)
+	{
+		$this->LineWidth=$lw;
+		$this->_out(sprintf('%.2f w',$lw*$this->k));
+	}
+	//Restore font
+	if($family)
+		$this->SetFont($family,$style,$size);
+	//Restore colors
+	if($this->DrawColor!=$dc)
+	{
+		$this->DrawColor=$dc;
+		$this->_out($dc);
+	}
+	if($this->FillColor!=$fc)
+	{
+		$this->FillColor=$fc;
+		$this->_out($fc);
+	}
+	$this->TextColor=$tc;
+	$this->ColorFlag=$cf;
+}
+
+function Header()
+{
+	//To be implemented in your own inherited class
+}
+
+function Footer()
+{
+	//To be implemented in your own inherited class
+}
+
+function PageNo()
+{
+	//Get current page number
+	return $this->page;
+}
+
+function SetDrawColor($r,$g=-1,$b=-1)
+{
+	//Set color for all stroking operations
+	if(($r==0 && $g==0 && $b==0) || $g==-1)
+		$this->DrawColor=sprintf('%.3f G',$r/255);
+	else
+		$this->DrawColor=sprintf('%.3f %.3f %.3f RG',$r/255,$g/255,$b/255);
+	if($this->page>0)
+		$this->_out($this->DrawColor);
+}
+
+function SetFillColor($r,$g=-1,$b=-1)
+{
+	//Set color for all filling operations
+	if(($r==0 && $g==0 && $b==0) || $g==-1)
+		$this->FillColor=sprintf('%.3f g',$r/255);
+	else
+		$this->FillColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
+	$this->ColorFlag=($this->FillColor!=$this->TextColor);
+	if($this->page>0)
+		$this->_out($this->FillColor);
+}
+
+function SetTextColor($r,$g=-1,$b=-1)
+{
+	//Set color for text
+	if(($r==0 && $g==0 && $b==0) || $g==-1)
+		$this->TextColor=sprintf('%.3f g',$r/255);
+	else
+		$this->TextColor=sprintf('%.3f %.3f %.3f rg',$r/255,$g/255,$b/255);
+	$this->ColorFlag=($this->FillColor!=$this->TextColor);
+}
+
+function GetStringWidth($s)
+{
+	//Get width of a string in the current font
+	$s=(string)$s;
+	$cw=&$this->CurrentFont['cw'];
+	$w=0;
+	$l=strlen($s);
+	for($i=0;$i<$l;$i++)
+		$w+=$cw[$s{$i}];
+	return $w*$this->FontSize/1000;
+}
+
+function SetLineWidth($width)
+{
+	//Set line width
+	$this->LineWidth=$width;
+	if($this->page>0)
+		$this->_out(sprintf('%.2f w',$width*$this->k));
+}
+
+function Line($x1,$y1,$x2,$y2)
+{
+	//Draw a line
+	$this->_out(sprintf('%.2f %.2f m %.2f %.2f l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
+}
+
+function Rect($x,$y,$w,$h,$style='')
+{
+	//Draw a rectangle
+	if($style=='F')
+		$op='f';
+	elseif($style=='FD' || $style=='DF')
+		$op='B';
+	else
+		$op='S';
+	$this->_out(sprintf('%.2f %.2f %.2f %.2f re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
+}
+
+function AddFont($family,$style='',$file='')
+{
+	//Add a TrueType or Type1 font
+	$family=strtolower($family);
+	if($file=='')
+		$file=str_replace(' ','',$family).strtolower($style).'.php';
+	if($family=='arial')
+		$family='helvetica';
+	$style=strtoupper($style);
+	if($style=='IB')
+		$style='BI';
+	$fontkey=$family.$style;
+	if(isset($this->fonts[$fontkey]))
+		$this->Error('Font already added: '.$family.' '.$style);
+	include($this->_getfontpath().$file);
+	if(!isset($name))
+		$this->Error('Could not include font definition file');
+	$i=count($this->fonts)+1;
+	$this->fonts[$fontkey]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'enc'=>$enc,'file'=>$file);
+	if($diff)
+	{
+		//Search existing encodings
+		$d=0;
+		$nb=count($this->diffs);
+		for($i=1;$i<=$nb;$i++)
+		{
+			if($this->diffs[$i]==$diff)
+			{
+				$d=$i;
+				break;
+			}
+		}
+		if($d==0)
+		{
+			$d=$nb+1;
+			$this->diffs[$d]=$diff;
+		}
+		$this->fonts[$fontkey]['diff']=$d;
+	}
+	if($file)
+	{
+		if($type=='TrueType')
+			$this->FontFiles[$file]=array('length1'=>$originalsize);
+		else
+			$this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2);
+	}
+}
+
+function SetFont($family,$style='',$size=0)
+{
+	//Select a font; size given in points
+	global $fpdf_charwidths;
+
+	$family=strtolower($family);
+	if($family=='')
+		$family=$this->FontFamily;
+	if($family=='arial')
+		$family='helvetica';
+	elseif($family=='symbol' || $family=='zapfdingbats')
+		$style='';
+	$style=strtoupper($style);
+	if(strpos($style,'U')!==false)
+	{
+		$this->underline=true;
+		$style=str_replace('U','',$style);
+	}
+	else
+		$this->underline=false;
+	if($style=='IB')
+		$style='BI';
+	if($size==0)
+		$size=$this->FontSizePt;
+	//Test if font is already selected
+	if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size)
+		return;
+	//Test if used for the first time
+	$fontkey=$family.$style;
+	if(!isset($this->fonts[$fontkey]))
+	{
+		//Check if one of the standard fonts
+		if(isset($this->CoreFonts[$fontkey]))
+		{
+			if(!isset($fpdf_charwidths[$fontkey]))
+			{
+				//Load metric file
+				$file=$family;
+				if($family=='times' || $family=='helvetica')
+					$file.=strtolower($style);
+				include($this->_getfontpath().$file.'.php');
+				if(!isset($fpdf_charwidths[$fontkey]))
+					$this->Error('Could not include font metric file');
+			}
+			$i=count($this->fonts)+1;
+			$this->fonts[$fontkey]=array('i'=>$i,'type'=>'core','name'=>$this->CoreFonts[$fontkey],'up'=>-100,'ut'=>50,'cw'=>$fpdf_charwidths[$fontkey]);
+		}
+		else
+			$this->Error('Undefined font: '.$family.' '.$style);
+	}
+	//Select it
+	$this->FontFamily=$family;
+	$this->FontStyle=$style;
+	$this->FontSizePt=$size;
+	$this->FontSize=$size/$this->k;
+	$this->CurrentFont=&$this->fonts[$fontkey];
+	if($this->page>0)
+		$this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
+}
+
+function SetFontSize($size)
+{
+	//Set font size in points
+	if($this->FontSizePt==$size)
+		return;
+	$this->FontSizePt=$size;
+	$this->FontSize=$size/$this->k;
+	if($this->page>0)
+		$this->_out(sprintf('BT /F%d %.2f Tf ET',$this->CurrentFont['i'],$this->FontSizePt));
+}
+
+function AddLink()
+{
+	//Create a new internal link
+	$n=count($this->links)+1;
+	$this->links[$n]=array(0,0);
+	return $n;
+}
+
+function SetLink($link,$y=0,$page=-1)
+{
+	//Set destination of internal link
+	if($y==-1)
+		$y=$this->y;
+	if($page==-1)
+		$page=$this->page;
+	$this->links[$link]=array($page,$y);
+}
+
+function Link($x,$y,$w,$h,$link)
+{
+	//Put a link on the page
+	$this->PageLinks[$this->page][]=array($x*$this->k,$this->hPt-$y*$this->k,$w*$this->k,$h*$this->k,$link);
+}
+
+function Text($x,$y,$txt)
+{
+	//Output a string
+	$s=sprintf('BT %.2f %.2f Td (%s) Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escape($txt));
+	if($this->underline && $txt!='')
+		$s.=' '.$this->_dounderline($x,$y,$txt);
+	if($this->ColorFlag)
+		$s='q '.$this->TextColor.' '.$s.' Q';
+	$this->_out($s);
+}
+
+function AcceptPageBreak()
+{
+	//Accept automatic page break or not
+	return $this->AutoPageBreak;
+}
+
+function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='')
+{
+	//Output a cell
+	$k=$this->k;
+	if($this->y+$h>$this->PageBreakTrigger && !$this->InFooter && $this->AcceptPageBreak())
+	{
+		//Automatic page break
+		$x=$this->x;
+		$ws=$this->ws;
+		if($ws>0)
+		{
+			$this->ws=0;
+			$this->_out('0 Tw');
+		}
+		$this->AddPage($this->CurOrientation);
+		$this->x=$x+$this->lMargin;
+		if($ws>0)
+		{
+			$this->ws=$ws;
+			$this->_out(sprintf('%.3f Tw',$ws*$k));
+		}
+	}
+	if($w==0)
+		$w=$this->w-$this->rMargin-$this->x;
+	$s='';
+	if($fill==1 || $border==1)
+	{
+		if($fill==1)
+			$op=($border==1) ? 'B' : 'f';
+		else
+			$op='S';
+		$s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
+	}
+	if(is_string($border))
+	{
+		$x=$this->x;
+		$y=$this->y;
+		if(strpos($border,'L')!==false)
+			$s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
+		if(strpos($border,'T')!==false)
+			$s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
+		if(strpos($border,'R')!==false)
+			$s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+		if(strpos($border,'B')!==false)
+			$s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+	}
+	if($txt!=='')
+	{
+		if($align=='R')
+			$dx=$w-$this->cMargin-$this->GetStringWidth($txt);
+		elseif($align=='C')
+			$dx=($w-$this->GetStringWidth($txt))/2;
+		else
+			$dx=$this->cMargin;
+		if($this->ColorFlag)
+			$s.='q '.$this->TextColor.' ';
+			$txt2=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
+			$s.=sprintf('BT %.2f %.2f Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
+		if($this->underline)
+			$s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
+		if($this->ColorFlag)
+			$s.=' Q';
+		if($link)
+			$this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
+	}
+	if($s)
+		$this->_out($s);
+	$this->lasth=$h;
+	if($ln>0)
+	{
+		//Go to next line
+		$this->y+=$h;
+		if($ln==1)
+			$this->x=$this->lMargin;
+	}
+	else
+		$this->x+=$w;
+}
+
+function MultiCell($w,$h,$txt,$border=0,$align='J',$fill=0)
+{
+	//Output text with automatic or explicit line breaks
+	$cw=&$this->CurrentFont['cw'];
+	if($w==0)
+		$w=$this->w-$this->rMargin-$this->x;
+	$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+	$s=str_replace("\r",'',$txt);
+	$nb=strlen($s);
+	if($nb>0 && $s[$nb-1]=="\n")
+		$nb--;
+	$b=0;
+	if($border)
+	{
+		if($border==1)
+		{
+			$border='LTRB';
+			$b='LRT';
+			$b2='LR';
+		}
+		else
+		{
+			$b2='';
+			if(strpos($border,'L')!==false)
+				$b2.='L';
+			if(strpos($border,'R')!==false)
+				$b2.='R';
+			$b=(strpos($border,'T')!==false) ? $b2.'T' : $b2;
+		}
+	}
+	$sep=-1;
+	$i=0;
+	$j=0;
+	$l=0;
+	$ns=0;
+	$nl=1;
+	while($i<$nb)
+	{
+		//Get next character
+		$c=$s{$i};
+		if($c=="\n")
+		{
+			//Explicit line break
+			if($this->ws>0)
+			{
+				$this->ws=0;
+				$this->_out('0 Tw');
+			}
+			$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+			$i++;
+			$sep=-1;
+			$j=$i;
+			$l=0;
+			$ns=0;
+			$nl++;
+			if($border && $nl==2)
+				$b=$b2;
+			continue;
+		}
+		if($c==' ')
+		{
+			$sep=$i;
+			$ls=$l;
+			$ns++;
+		}
+		$l+=$cw[$c];
+		if($l>$wmax)
+		{
+			//Automatic line break
+			if($sep==-1)
+			{
+				if($i==$j)
+					$i++;
+				if($this->ws>0)
+				{
+					$this->ws=0;
+					$this->_out('0 Tw');
+				}
+				$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+			}
+			else
+			{
+				if($align=='J')
+				{
+					$this->ws=($ns>1) ? ($wmax-$ls)/1000*$this->FontSize/($ns-1) : 0;
+					$this->_out(sprintf('%.3f Tw',$this->ws*$this->k));
+				}
+				$this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill);
+				$i=$sep+1;
+			}
+			$sep=-1;
+			$j=$i;
+			$l=0;
+			$ns=0;
+			$nl++;
+			if($border && $nl==2)
+				$b=$b2;
+		}
+		else
+			$i++;
+	}
+	//Last chunk
+	if($this->ws>0)
+	{
+		$this->ws=0;
+		$this->_out('0 Tw');
+	}
+	if($border && strpos($border,'B')!==false)
+		$b.='B';
+	$this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill);
+	$this->x=$this->lMargin;
+}
+
+function Write($h,$txt,$link='')
+{
+	//Output text in flowing mode
+	$cw=&$this->CurrentFont['cw'];
+	$w=$this->w-$this->rMargin-$this->x;
+	$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+	$s=str_replace("\r",'',$txt);
+	$nb=strlen($s);
+	$sep=-1;
+	$i=0;
+	$j=0;
+	$l=0;
+	$nl=1;
+	while($i<$nb)
+	{
+		//Get next character
+		$c=$s{$i};
+		if($c=="\n")
+		{
+			//Explicit line break
+			$this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
+			$i++;
+			$sep=-1;
+			$j=$i;
+			$l=0;
+			if($nl==1)
+			{
+				$this->x=$this->lMargin;
+				$w=$this->w-$this->rMargin-$this->x;
+				$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+			}
+			$nl++;
+			continue;
+		}
+		if($c==' ')
+			$sep=$i;
+		$l+=$cw[$c];
+		if($l>$wmax)
+		{
+			//Automatic line break
+			if($sep==-1)
+			{
+				if($this->x>$this->lMargin)
+				{
+					//Move to next line
+					$this->x=$this->lMargin;
+					$this->y+=$h;
+					$w=$this->w-$this->rMargin-$this->x;
+					$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+					$i++;
+					$nl++;
+					continue;
+				}
+				if($i==$j)
+					$i++;
+				$this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',0,$link);
+			}
+			else
+			{
+				$this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',0,$link);
+				$i=$sep+1;
+			}
+			$sep=-1;
+			$j=$i;
+			$l=0;
+			if($nl==1)
+			{
+				$this->x=$this->lMargin;
+				$w=$this->w-$this->rMargin-$this->x;
+				$wmax=($w-2*$this->cMargin)*1000/$this->FontSize;
+			}
+			$nl++;
+		}
+		else
+			$i++;
+	}
+	//Last chunk
+	if($i!=$j)
+		$this->Cell($l/1000*$this->FontSize,$h,substr($s,$j),0,0,'',0,$link);
+}
+
+function Image($file,$x,$y,$w=0,$h=0,$type='',$link='')
+{
+	//Put an image on the page
+	if(!isset($this->images[$file]))
+	{
+		//First use of image, get info
+		if($type=='')
+		{
+			$pos=strrpos($file,'.');
+			if(!$pos)
+				$this->Error('Image file has no extension and no type was specified: '.$file);
+			$type=substr($file,$pos+1);
+		}
+		$type=strtolower($type);
+		$mqr=get_magic_quotes_runtime();
+		set_magic_quotes_runtime(0);
+		if($type=='jpg' || $type=='jpeg'){
+			$info=$this->_parsejpg($file);
+		}elseif($type=='png'){
+			$info=$this->_parsepng($file);
+		}else{
+			//Allow for additional formats
+			$mtd='_parse'.$type;
+			if(!method_exists($this,$mtd))
+				$this->Error('Unsupported image type: '.$type);
+			$info=$this->$mtd($file);
+		}
+		if($info){
+			set_magic_quotes_runtime($mqr);
+			$info['i']=count($this->images)+1;
+			$this->images[$file]=$info;
+		}
+	}
+	else
+		$info=$this->images[$file];
+		if($info){
+			//Automatic width and height calculation if needed
+			if($w==0 && $h==0)
+			{
+				//Put image at 72 dpi
+				$w=$info['w']/$this->k;
+				$h=$info['h']/$this->k;
+			}
+			if($w==0)
+				$w=$h*$info['w']/$info['h'];
+			if($h==0)
+				$h=$w*$info['h']/$info['w'];
+			$this->_out(sprintf('q %.2f 0 0 %.2f %.2f %.2f cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i']));
+			if($link)
+				$this->Link($x,$y,$w,$h,$link);
+		}
+}
+
+function Ln($h='')
+{
+	//Line feed; default value is last cell height
+	$this->x=$this->lMargin;
+	if(is_string($h))
+		$this->y+=$this->lasth;
+	else
+		$this->y+=$h;
+}
+
+function GetX()
+{
+	//Get x position
+	return $this->x;
+}
+
+function SetX($x)
+{
+	//Set x position
+	if($x>=0)
+		$this->x=$x;
+	else
+		$this->x=$this->w+$x;
+}
+
+function GetY()
+{
+	//Get y position
+	return $this->y;
+}
+
+function SetY($y)
+{
+	//Set y position and reset x
+	$this->x=$this->lMargin;
+	if($y>=0)
+		$this->y=$y;
+	else
+		$this->y=$this->h+$y;
+}
+
+function SetXY($x,$y)
+{
+	//Set x and y positions
+	$this->SetY($y);
+	$this->SetX($x);
+}
+
+function Output($name='',$dest='')
+{
+	//Output PDF to some destination
+	//Finish document if necessary
+	if($this->state<3)
+		$this->Close();
+	//Normalize parameters
+	if(is_bool($dest))
+		$dest=$dest ? 'D' : 'F';
+	$dest=strtoupper($dest);
+	if($dest=='')
+	{
+		if($name=='')
+		{
+			$name='doc.pdf';
+			$dest='I';
+		}
+		else
+			$dest='F';
+	}
+	switch($dest)
+	{
+		case 'I':
+			//Send to standard output
+			if(ob_get_contents())
+				$this->Error('Some data has already been output, can\'t send PDF file');
+			if(php_sapi_name()!='cli')
+			{
+				//We send to a browser
+				//Secure https check
+				if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype'){
+					header('Pragma: public');
+				}
+				header('Content-Type: application/pdf');
+				if(headers_sent())
+					$this->Error('Some data has already been output to browser, can\'t send PDF file');
+				header('Content-Length: '.strlen($this->buffer));
+				header('Content-disposition: inline; filename="'.$name.'"');
+			}
+			echo $this->buffer;
+			break;
+		case 'D':
+			//Download file
+			if(ob_get_contents())
+				$this->Error('Some data has already been output, can\'t send PDF file');
+			//Secure https check
+			if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
+				header('Pragma: public');
+			if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE'))
+				header('Content-Type: application/force-download');
+			else
+				header('Content-Type: application/octet-stream');
+			if(headers_sent())
+				$this->Error('Some data has already been output to browser, can\'t send PDF file');
+			header('Content-Length: '.strlen($this->buffer));
+			header('Content-disposition: attachment; filename="'.$name.'"');
+			echo $this->buffer;
+			break;
+		case 'F':
+			//Save to local file
+			$f=fopen($name,'wb');
+			if(!$f)
+				$this->Error('Unable to create output file: '.$name);
+			fwrite($f,$this->buffer,strlen($this->buffer));
+			fclose($f);
+			break;
+		case 'S':
+			//Return as a string
+			return $this->buffer;
+		default:
+			$this->Error('Incorrect output destination: '.$dest);
+	}
+	return '';
+}
+
+/*******************************************************************************
+*                                                                              *
+*                              Protected methods                               *
+*                                                                              *
+*******************************************************************************/
+function _dochecks()
+{
+	//Check for locale-related bug
+	if(1.1==1)
+		$this->Error('Don\'t alter the locale before including class file');
+	//Check for decimal separator
+	if(sprintf('%.1f',1.0)!='1.0')
+		setlocale(LC_NUMERIC,'C');
+}
+
+function _getfontpath()
+{
+	if(!defined('FPDF_FONTPATH') && is_dir(dirname(__FILE__).'/font'))
+		define('FPDF_FONTPATH',dirname(__FILE__).'/font/');
+	return defined('FPDF_FONTPATH') ? FPDF_FONTPATH : '';
+}
+
+function _putpages()
+{
+	$nb=$this->page;
+	if(!empty($this->AliasNbPages))
+	{
+		//Replace number of pages
+		for($n=1;$n<=$nb;$n++)
+			$this->pages[$n]=str_replace($this->AliasNbPages,$nb,$this->pages[$n]);
+	}
+	if($this->DefOrientation=='P')
+	{
+		$wPt=$this->fwPt;
+		$hPt=$this->fhPt;
+	}
+	else
+	{
+		$wPt=$this->fhPt;
+		$hPt=$this->fwPt;
+	}
+	$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+	for($n=1;$n<=$nb;$n++)
+	{
+		//Page
+		$this->_newobj();
+		$this->_out('<</Type /Page');
+		$this->_out('/Parent 1 0 R');
+		if(isset($this->OrientationChanges[$n]))
+			$this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$hPt,$wPt));
+		$this->_out('/Resources 2 0 R');
+		if(isset($this->PageLinks[$n]))
+		{
+			//Links
+			$annots='/Annots [';
+			foreach($this->PageLinks[$n] as $pl)
+			{
+				$rect=sprintf('%.2f %.2f %.2f %.2f',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
+				$annots.='<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
+				if(is_string($pl[4]))
+					//$annots.='/A <</S /URI /URI '.$this->_textstring($pl[4]).'>>>>';
+					$annots.='/A <</S /URI /URI '.$this->_escapetext($pl[4]).'>>>>';
+				else
+				{
+					$l=$this->links[$pl[4]];
+					$h=isset($this->OrientationChanges[$l[0]]) ? $wPt : $hPt;
+					$annots.=sprintf('/Dest [%d 0 R /XYZ 0 %.2f null]>>',1+2*$l[0],$h-$l[1]*$this->k);
+				}
+			}
+			$this->_out($annots.']');
+		}
+		$this->_out('/Contents '.($this->n+1).' 0 R>>');
+		$this->_out('endobj');
+		//Page content
+		$p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];
+		$this->_newobj();
+		$this->_out('<<'.$filter.'/Length '.strlen($p).'>>');
+		$this->_putstream($p);
+		$this->_out('endobj');
+	}
+	//Pages root
+	$this->offsets[1]=strlen($this->buffer);
+	$this->_out('1 0 obj');
+	$this->_out('<</Type /Pages');
+	$kids='/Kids [';
+	for($i=0;$i<$nb;$i++)
+		$kids.=(3+2*$i).' 0 R ';
+	$this->_out($kids.']');
+	$this->_out('/Count '.$nb);
+	$this->_out(sprintf('/MediaBox [0 0 %.2f %.2f]',$wPt,$hPt));
+	$this->_out('>>');
+	$this->_out('endobj');
+}
+
+function _putfonts()
+{
+	$nf=$this->n;
+	foreach($this->diffs as $diff)
+	{
+		//Encodings
+		$this->_newobj();
+		$this->_out('<</Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.']>>');
+		$this->_out('endobj');
+	}
+	$mqr=get_magic_quotes_runtime();
+	set_magic_quotes_runtime(0);
+	foreach($this->FontFiles as $file=>$info)
+	{
+		//Font file embedding
+		$this->_newobj();
+		$this->FontFiles[$file]['n']=$this->n;
+		$font='';
+		$f=fopen($this->_getfontpath().$file,'rb',1);
+		if(!$f)
+			$this->Error('Font file not found');
+		while(!feof($f))
+			$font.=fread($f,8192);
+		fclose($f);
+		$compressed=(substr($file,-2)=='.z');
+		if(!$compressed && isset($info['length2']))
+		{
+			$header=(ord($font{0})==128);
+			if($header)
+			{
+				//Strip first binary header
+				$font=substr($font,6);
+			}
+			if($header && ord($font{$info['length1']})==128)
+			{
+				//Strip second binary header
+				$font=substr($font,0,$info['length1']).substr($font,$info['length1']+6);
+			}
+		}
+		$this->_out('<</Length '.strlen($font));
+		if($compressed)
+			$this->_out('/Filter /FlateDecode');
+		$this->_out('/Length1 '.$info['length1']);
+		if(isset($info['length2']))
+			$this->_out('/Length2 '.$info['length2'].' /Length3 0');
+		$this->_out('>>');
+		$this->_putstream($font);
+		$this->_out('endobj');
+	}
+	set_magic_quotes_runtime($mqr);
+	foreach($this->fonts as $k=>$font)
+	{
+		//Font objects
+		$this->fonts[$k]['n']=$this->n+1;
+		$type=$font['type'];
+		$name=$font['name'];
+		if($type=='core')
+		{
+			//Standard font
+			$this->_newobj();
+			$this->_out('<</Type /Font');
+			$this->_out('/BaseFont /'.$name);
+			$this->_out('/Subtype /Type1');
+			if($name!='Symbol' && $name!='ZapfDingbats')
+				$this->_out('/Encoding /WinAnsiEncoding');
+			$this->_out('>>');
+			$this->_out('endobj');
+		}
+		elseif($type=='Type1' || $type=='TrueType')
+		{
+			//Additional Type1 or TrueType font
+			$this->_newobj();
+			$this->_out('<</Type /Font');
+			$this->_out('/BaseFont /'.$name);
+			$this->_out('/Subtype /'.$type);
+			$this->_out('/FirstChar 32 /LastChar 255');
+			$this->_out('/Widths '.($this->n+1).' 0 R');
+			$this->_out('/FontDescriptor '.($this->n+2).' 0 R');
+			if($font['enc'])
+			{
+				if(isset($font['diff']))
+					$this->_out('/Encoding '.($nf+$font['diff']).' 0 R');
+				else
+					$this->_out('/Encoding /WinAnsiEncoding');
+			}
+			$this->_out('>>');
+			$this->_out('endobj');
+			//Widths
+			$this->_newobj();
+			$cw=&$font['cw'];
+			$s='[';
+			for($i=32;$i<=255;$i++)
+				$s.=$cw[chr($i)].' ';
+			$this->_out($s.']');
+			$this->_out('endobj');
+			//Descriptor
+			$this->_newobj();
+			$s='<</Type /FontDescriptor /FontName /'.$name;
+			foreach($font['desc'] as $k=>$v)
+				$s.=' /'.$k.' '.$v;
+			$file=$font['file'];
+			if($file)
+				$s.=' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$file]['n'].' 0 R';
+			$this->_out($s.'>>');
+			$this->_out('endobj');
+		}
+		else
+		{
+			//Allow for additional types
+			$mtd='_put'.strtolower($type);
+			if(!method_exists($this,$mtd))
+				$this->Error('Unsupported font type: '.$type);
+			$this->$mtd($font);
+		}
+	}
+}
+
+function _putimages()
+{
+	$filter=($this->compress) ? '/Filter /FlateDecode ' : '';
+	reset($this->images);
+	while(list($file,$info)=each($this->images))
+	{
+		$this->_newobj();
+		$this->images[$file]['n']=$this->n;
+		$this->_out('<</Type /XObject');
+		$this->_out('/Subtype /Image');
+		$this->_out('/Width '.$info['w']);
+		$this->_out('/Height '.$info['h']);
+		if($info['cs']=='Indexed')
+			$this->_out('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]');
+		else
+		{
+			$this->_out('/ColorSpace /'.$info['cs']);
+			if($info['cs']=='DeviceCMYK')
+				$this->_out('/Decode [1 0 1 0 1 0 1 0]');
+		}
+		$this->_out('/BitsPerComponent '.$info['bpc']);
+		if(isset($info['f']))
+			$this->_out('/Filter /'.$info['f']);
+		if(isset($info['parms']))
+			$this->_out($info['parms']);
+		if(isset($info['trns']) && is_array($info['trns']))
+		{
+			$trns='';
+			for($i=0;$i<count($info['trns']);$i++)
+				$trns.=$info['trns'][$i].' '.$info['trns'][$i].' ';
+			$this->_out('/Mask ['.$trns.']');
+		}
+		$this->_out('/Length '.strlen($info['data']).'>>');
+		$this->_putstream($info['data']);
+		unset($this->images[$file]['data']);
+		$this->_out('endobj');
+		//Palette
+		if($info['cs']=='Indexed')
+		{
+			$this->_newobj();
+			$pal=($this->compress) ? gzcompress($info['pal']) : $info['pal'];
+			$this->_out('<<'.$filter.'/Length '.strlen($pal).'>>');
+			$this->_putstream($pal);
+			$this->_out('endobj');
+		}
+	}
+}
+
+function _putxobjectdict()
+{
+	foreach($this->images as $image)
+		$this->_out('/I'.$image['i'].' '.$image['n'].' 0 R');
+}
+
+function _putresourcedict()
+{
+	$this->_out('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]');
+	$this->_out('/Font <<');
+	foreach($this->fonts as $font)
+		$this->_out('/F'.$font['i'].' '.$font['n'].' 0 R');
+	$this->_out('>>');
+	$this->_out('/XObject <<');
+	$this->_putxobjectdict();
+	$this->_out('>>');
+}
+
+function _putresources()
+{
+	$this->_putfonts();
+	$this->_putimages();
+	//Resource dictionary
+	$this->offsets[2]=strlen($this->buffer);
+	$this->_out('2 0 obj');
+	$this->_out('<<');
+	$this->_putresourcedict();
+	$this->_out('>>');
+	$this->_out('endobj');
+}
+
+function _putinfo()
+{
+	$this->_out('/Producer '.$this->_textstring('FPDF '.FPDF_VERSION));
+	if(!empty($this->title))
+		$this->_out('/Title '.$this->_textstring($this->title));
+	if(!empty($this->subject))
+		$this->_out('/Subject '.$this->_textstring($this->subject));
+	if(!empty($this->author))
+		$this->_out('/Author '.$this->_textstring($this->author));
+	if(!empty($this->keywords))
+		$this->_out('/Keywords '.$this->_textstring($this->keywords));
+	if(!empty($this->creator))
+		$this->_out('/Creator '.$this->_textstring($this->creator));
+	$this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis')));
+}
+
+function _putcatalog()
+{
+	$this->_out('/Type /Catalog');
+	$this->_out('/Pages 1 0 R');
+	if($this->ZoomMode=='fullpage')
+		$this->_out('/OpenAction [3 0 R /Fit]');
+	elseif($this->ZoomMode=='fullwidth')
+		$this->_out('/OpenAction [3 0 R /FitH null]');
+	elseif($this->ZoomMode=='real')
+		$this->_out('/OpenAction [3 0 R /XYZ null null 1]');
+	elseif(!is_string($this->ZoomMode))
+		$this->_out('/OpenAction [3 0 R /XYZ null null '.($this->ZoomMode/100).']');
+	if($this->LayoutMode=='single')
+		$this->_out('/PageLayout /SinglePage');
+	elseif($this->LayoutMode=='continuous')
+		$this->_out('/PageLayout /OneColumn');
+	elseif($this->LayoutMode=='two')
+		$this->_out('/PageLayout /TwoColumnLeft');
+}
+
+function _putheader()
+{
+	$this->_out('%PDF-'.$this->PDFVersion);
+}
+
+function _puttrailer()
+{
+	$this->_out('/Size '.($this->n+1));
+	$this->_out('/Root '.$this->n.' 0 R');
+	$this->_out('/Info '.($this->n-1).' 0 R');
+}
+
+function _enddoc()
+{
+	$this->_putheader();
+	$this->_putpages();
+	$this->_putresources();
+	//Info
+	$this->_newobj();
+	$this->_out('<<');
+	$this->_putinfo();
+	$this->_out('>>');
+	$this->_out('endobj');
+	//Catalog
+	$this->_newobj();
+	$this->_out('<<');
+	$this->_putcatalog();
+	$this->_out('>>');
+	$this->_out('endobj');
+	//Cross-ref
+	$o=strlen($this->buffer);
+	$this->_out('xref');
+	$this->_out('0 '.($this->n+1));
+	$this->_out('0000000000 65535 f ');
+	for($i=1;$i<=$this->n;$i++)
+		$this->_out(sprintf('%010d 00000 n ',$this->offsets[$i]));
+	//Trailer
+	$this->_out('trailer');
+	$this->_out('<<');
+	$this->_puttrailer();
+	$this->_out('>>');
+	$this->_out('startxref');
+	$this->_out($o);
+	$this->_out('%%EOF');
+	$this->state=3;
+}
+
+function _beginpage($orientation)
+{
+	$this->page++;
+	$this->pages[$this->page]='';
+	$this->state=2;
+	$this->x=$this->lMargin;
+	$this->y=$this->tMargin;
+	$this->FontFamily='';
+	//Page orientation
+	if(!$orientation)
+		$orientation=$this->DefOrientation;
+	else
+	{
+		$orientation=strtoupper($orientation{0});
+		if($orientation!=$this->DefOrientation)
+			$this->OrientationChanges[$this->page]=true;
+	}
+	if($orientation!=$this->CurOrientation)
+	{
+		//Change orientation
+		if($orientation=='P')
+		{
+			$this->wPt=$this->fwPt;
+			$this->hPt=$this->fhPt;
+			$this->w=$this->fw;
+			$this->h=$this->fh;
+		}
+		else
+		{
+			$this->wPt=$this->fhPt;
+			$this->hPt=$this->fwPt;
+			$this->w=$this->fh;
+			$this->h=$this->fw;
+		}
+		$this->PageBreakTrigger=$this->h-$this->bMargin;
+		$this->CurOrientation=$orientation;
+	}
+}
+
+function _endpage()
+{
+	//End of page contents
+	$this->state=1;
+}
+
+function _newobj()
+{
+	//Begin a new object
+	$this->n++;
+	$this->offsets[$this->n]=strlen($this->buffer);
+	$this->_out($this->n.' 0 obj');
+}
+
+function _dounderline($x,$y,$txt)
+{
+	//Underline text
+	$up=$this->CurrentFont['up'];
+	$ut=$this->CurrentFont['ut'];
+	$w=$this->GetStringWidth($txt)+$this->ws*substr_count($txt,' ');
+	return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
+}
+
+function _parsejpg($file)
+{
+	//Extract info from a JPEG file
+	$a=GetImageSize($file);
+	if(!$a)
+		$this->Error('Missing or incorrect image file: '.$file);
+	if($a[2]!=2)
+		$this->Error('Not a JPEG file: '.$file);
+	if(!isset($a['channels']) || $a['channels']==3)
+		$colspace='DeviceRGB';
+	elseif($a['channels']==4)
+		$colspace='DeviceCMYK';
+	else
+		$colspace='DeviceGray';
+	$bpc=isset($a['bits']) ? $a['bits'] : 8;
+	//Read whole file
+	$f=fopen($file,'rb');
+	$data='';
+	while(!feof($f))
+		$data.=fread($f,4096);
+	fclose($f);
+	return array('w'=>$a[0],'h'=>$a[1],'cs'=>$colspace,'bpc'=>$bpc,'f'=>'DCTDecode','data'=>$data);
+}
+
+function _parsepng($file)
+{
+	//Extract info from a PNG file
+	$f=fopen($file,'rb');
+	if(!$f)
+		$this->Error('Can\'t open image file: '.$file);
+	//Check signature
+	if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
+		$this->Error('Not a PNG file: '.$file);
+	//Read header chunk
+	fread($f,4);
+	if(fread($f,4)!='IHDR')
+		$this->Error('Incorrect PNG file: '.$file);
+	$w=$this->_freadint($f);
+	$h=$this->_freadint($f);
+	$bpc=ord(fread($f,1));
+	if($bpc>8)
+		$this->Error('16-bit depth not supported: '.$file);
+	$ct=ord(fread($f,1));
+	if($ct==0)
+		$colspace='DeviceGray';
+	elseif($ct==2)
+		$colspace='DeviceRGB';
+	elseif($ct==3)
+		$colspace='Indexed';
+	else
+		$colspace = '';
+		//$this->Error('Alpha channel not supported: '.$file);
+	if(ord(fread($f,1))!=0)
+		$this->Error('Unknown compression method: '.$file);
+	if(ord(fread($f,1))!=0)
+		$this->Error('Unknown filter method: '.$file);
+	if(ord(fread($f,1))!=0)
+		$this->Error('Interlacing not supported: '.$file);
+	fread($f,4);
+	$parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';
+	//Scan chunks looking for palette, transparency and image data
+	$pal='';
+	$trns='';
+	$data='';
+	do
+	{
+		$n=$this->_freadint($f);
+		$type=fread($f,4);
+		if($type=='PLTE')
+		{
+			//Read palette
+			$pal=fread($f,$n);
+			fread($f,4);
+		}
+		elseif($type=='tRNS')
+		{
+			//Read transparency info
+			$t=fread($f,$n);
+			if($ct==0)
+				$trns=array(ord(substr($t,1,1)));
+			elseif($ct==2)
+				$trns=array(ord(substr($t,1,1)),ord(substr($t,3,1)),ord(substr($t,5,1)));
+			else
+			{
+				$pos=strpos($t,chr(0));
+				if($pos!==false)
+					$trns=array($pos);
+			}
+			fread($f,4);
+		}
+		elseif($type=='IDAT')
+		{
+			//Read image data block
+			$data.=fread($f,$n);
+			fread($f,4);
+		}
+		elseif($type=='IEND')
+			break;
+		else
+			fread($f,$n+4);
+	}
+	while($n);
+	if($colspace=='Indexed' && empty($pal))
+		$this->Error('Missing palette in '.$file);
+	fclose($f);
+	if($colspace!=''){
+		return array('w'=>$w,'h'=>$h,'cs'=>$colspace,'bpc'=>$bpc,'f'=>'FlateDecode','parms'=>$parms,'pal'=>$pal,'trns'=>$trns,'data'=>$data);
+	}else{
+		return;
+	}
+}
+
+function _freadint($f)
+{
+	//Read a 4-byte integer from file
+	$a=unpack('Ni',fread($f,4));
+	return $a['i'];
+}
+
+function _textstring($s)
+{
+	//Format a text string
+	return '('.$this->_escape($s).')';
+}
+
+function _escape($s)
+{
+	//Add \ before \, ( and )
+	return str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$s)));
+}
+
+function _putstream($s)
+{
+	$this->_out('stream');
+	$this->_out($s);
+	$this->_out('endstream');
+}
+
+function _out($s)
+{
+	//Add a line to the document
+	if($this->state==2)
+		$this->pages[$this->page].=$s."\n";
+	else
+		$this->buffer.=$s."\n";
+}
+//End of class
+}
+
+//Handle special IE contype request
+if(isset($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT']=='contype')
+{
+	Header('Pragma: public');
+	header('Content-Type: application/pdf');
+	exit;
+}
+
+}
+?>
Files 6171/e107_plugins/pdf/images/pdf_16.png and 75/e107_plugins/pdf/images/pdf_16.png differ
Files 6171/e107_plugins/pdf/images/pdf_32.png and 75/e107_plugins/pdf/images/pdf_32.png differ
diff -ruN 6171/e107_plugins/pdf/languages/English.php 75/e107_plugins/pdf/languages/English.php
--- 6171/e107_plugins/pdf/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/languages/English.php	2006-01-16 04:36:59.000000000 -0600
@@ -0,0 +1,39 @@
+<?php
+/*
++ -----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pdf/languages/English.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2006/01/16 10:36:59 $
+|     $Author: lisa_ $
++-----------------------------------------------------------------------------+
+*/
+
+define("PDF_PLUGIN_LAN_1", "PDF");
+define("PDF_PLUGIN_LAN_2", "PDF creation support");
+define("PDF_PLUGIN_LAN_3", "PDF");
+define("PDF_PLUGIN_LAN_4", "This plugin is now ready to be used.");
+
+define("PDF_LAN_1", "PDF");
+define("PDF_LAN_2", "PDF preferences");
+define("PDF_LAN_3", "enabled");
+define("PDF_LAN_4", "disabled");
+define("PDF_LAN_5", "page margin left");
+define("PDF_LAN_6", "page margin right");
+define("PDF_LAN_7", "page margin top");
+define("PDF_LAN_8", "font family");
+define("PDF_LAN_9", "font size default");
+define("PDF_LAN_10", "font size sitename");
+define("PDF_LAN_11", "font size page url");
+define("PDF_LAN_12", "font size page number");
+define("PDF_LAN_13", "show logo on pdf?");
+define("PDF_LAN_14", "show sitename on pdf?");
+define("PDF_LAN_15", "show creator page url on pdf?");
+define("PDF_LAN_16", "show page numbers on pdf?");
+define("PDF_LAN_17", "update");
+define("PDF_LAN_18", "PDF preferences succesfully updated");
+define("PDF_LAN_19", "Page");
+define("PDF_LAN_20", "error reporting");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pdf/pdf.php 75/e107_plugins/pdf/pdf.php
--- 6171/e107_plugins/pdf/pdf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/pdf.php	2006-01-13 04:49:03.000000000 -0600
@@ -0,0 +1,118 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pdf/pdf.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/01/13 10:49:03 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+$qs = explode(".", e_QUERY);
+if ($qs[0] == "") {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+$source = $qs[0];
+$parms = $qs[1];
+
+$lan_file = e_PLUGIN."pdf/languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."pdf/languages/English.php");
+
+define('FPDF_FONTPATH', 'font/');
+require_once(e_PLUGIN."pdf/ufpdf.php");		//require the ufpdf class
+require_once(e_PLUGIN."pdf/e107pdf.php");	//require the e107pdf class
+$pdf = new e107PDF();
+
+if(strpos($source,'plugin:') !== FALSE)
+{
+	$plugin = substr($source,7);
+	if(file_exists(e_PLUGIN.$plugin."/e_emailprint.php"))
+	{
+		include_once(e_PLUGIN.$plugin."/e_emailprint.php");
+		$text = print_item_pdf($parms);
+		$pdf->makePDF($text);
+	}
+	else
+	{
+		echo "file missing.";
+		exit;
+	}
+}
+else
+{
+	
+	if($source == 'news'){
+		$con = new convert;
+		$sql->db_Select("news", "*", "news_id='".intval($parms)."'");
+		$row = $sql->db_Fetch(); 
+		$news_body = $tp->toHTML($row['news_body'], TRUE);
+		$news_extended = $tp->toHTML($row['news_extended'], TRUE);
+		if ($row['news_author'] == 0){
+			$a_name = "e107";
+			$category_name = "e107 welcome message";
+		}else{
+			$sql->db_Select("news_category", "category_id, category_name", "category_id='".intval($row['news_category'])."'");
+			list($category_id, $category_name) = $sql->db_Fetch();
+			$sql->db_Select("user", "user_id, user_name", "user_id='".intval($row['news_author'])."'");
+			list($a_id, $a_name) = $sql->db_Fetch();
+		}
+		$row['news_datestamp'] = $con->convert_date($row['news_datestamp'], "long");
+	
+		$row['news_title'] = $tp -> toHTML($row['news_title'], TRUE, 'parse_sc');
+
+		//remove existing links from news title
+		$search = array();
+		$replace = array();
+		$search[0] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
+		$replace[0] = '\\2';
+		$search[1] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
+		$replace[1] = '\\2';
+		$search[2] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
+		$replace[2] = '\\2';
+		$search[3] = "/\<a href=&quot;(.*?)&quot;>(.*?)<\/a>/si";
+		$replace[3] = '\\2';
+		$search[4] = "/\<a href=&#39;(.*?)&#39;>(.*?)<\/a>/si";
+		$replace[4] = '\\2';
+		$row['news_title'] = preg_replace($search, $replace, $row['news_title']);
+
+		$text = "
+		<b>".$row['news_title']."</b><br />
+		".$row['category_name']."<br />
+		".$a_name.", ".$row['news_datestamp']."<br />
+		<br />
+		".$row['news_body']."<br />
+		";
+
+		if ($row['news_extended'] != ""){ $text .= "<br /><br />".$row['news_extended']; }
+		if ($row['news_source'] != ""){ $text .= "<br /><br />".$row['news_source']; }
+		if ($row['news_url'] != ""){ $text .= "<br />".$row['news_url']; }
+
+		$text		= $text;					//define text
+		$creator	= SITENAME;					//define creator
+		$author		= $a_name;					//define author
+		$title		= $row['news_title'];		//define title
+		$subject	= $category_name;			//define subject
+		$keywords	= "";						//define keywords
+
+		//define url and logo to use in the header of the pdf file
+		$url		= SITEURL."news.php?item.".$row['news_id'];
+
+		//always return an array with the following data:
+		$text = array($text, $creator, $author, $title, $subject, $keywords, $url);
+		$pdf->makePDF($text);
+	
+	}
+
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pdf/pdf.sc 75/e107_plugins/pdf/pdf.sc
--- 6171/e107_plugins/pdf/pdf.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/pdf.sc	2005-02-10 08:10:08.000000000 -0600
@@ -0,0 +1,14 @@
+if (defined("ICONPRINTPDF") && file_exists(THEME."images/".ICONPRINTPDF)) 
+{
+	$icon = THEME."images/".ICONPRINTPDF;
+}
+else
+{
+	$icon = e_PLUGIN."pdf/images/pdf_16.png";
+}
+$parms = explode("^",$parm);
+
+//core		//return "<a href='".e_BASE."pdf.php?{$parms[1]}'><img src='".$icon."' style='border:0' alt='{$parms[0]}' title='{$parms[0]}'/></a>";
+//plugin	//return "<a href='".e_PLUGIN."pdf/pdf.php?{$parms[1]}'><img src='".$icon."' style='border:0' alt='{$parms[0]}' title='{$parms[0]}'/></a>";
+
+return "<a href='".e_PLUGIN."pdf/pdf.php?{$parms[1]}'><img src='".$icon."' style='border:0' alt='{$parms[0]}' title='{$parms[0]}'/></a>";
diff -ruN 6171/e107_plugins/pdf/plugin.php 75/e107_plugins/pdf/plugin.php
--- 6171/e107_plugins/pdf/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/plugin.php	2006-01-11 09:54:58.000000000 -0600
@@ -0,0 +1,73 @@
+<?php
+/*
++---------------------------------------------------------------+
+|        e107 website system
+|
+|        Steve Dunstan 2001-2002
+|        http://e107.org
+|        jalist@e107.org
+|
+|        Released under the terms and conditions of the
+|        GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$lan_file = e_PLUGIN."pdf/languages/".e_LANGUAGE.".php";
+include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."pdf/languages/English.php");
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = PDF_PLUGIN_LAN_1;
+$eplug_version = "1.0";
+$eplug_author = "Eric Vanderfeesten (lisa)";
+$eplug_logo = "";
+$eplug_url = "http://eindhovenseschool.net";
+$eplug_email = "lisa@eindhovenseschool.net";
+$eplug_description = PDF_PLUGIN_LAN_2;
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";        // leave blank if no readme file
+
+$eplug_sc = array('PDF');
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "pdf";
+
+// Mane of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_pdf_config.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/pdf_32.png";
+$eplug_icon_small = $eplug_folder."/images/pdf_16.png";
+$eplug_caption = PDF_PLUGIN_LAN_3;
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = "";
+
+// List of bbcode -----------------------------------------------------------------------------------------------
+//$eplug_bb = array('pcontent');
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = "";
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = "";
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$eplug_link_url = "";
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = PDF_PLUGIN_LAN_4;
+
+// upgrading ... //
+$upgrade_add_prefs = "";
+$upgrade_remove_prefs = "";
+$upgrade_alter_tables = "";
+$eplug_upgrade_done = "";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pdf/ufpdf.php 75/e107_plugins/pdf/ufpdf.php
--- 6171/e107_plugins/pdf/ufpdf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pdf/ufpdf.php	2006-01-11 10:47:37.000000000 -0600
@@ -0,0 +1,492 @@
+<?php
+/*******************************************************************************
+* Software: UFPDF, Unicode Free PDF generator                                  *
+* Version:  0.1                                                                *
+*           based on FPDF 1.52 by Olivier PLATHEY                              *
+* Date:     2004-09-01                                                         *
+* Author:   Steven Wittens <steven@acko.net>                                   *
+* License:  GPL                                                                *
+*                                                                              *
+* UFPDF is a modification of FPDF to support Unicode through UTF-8.            *
+*                                                                              *
+*******************************************************************************/
+
+if(!class_exists('UFPDF'))
+{
+define('UFPDF_VERSION','0.1');
+
+include_once 'fpdf.php';
+
+class UFPDF extends FPDF
+{
+
+/*******************************************************************************
+*                                                                              *
+*                               Public methods                                 *
+*                                                                              *
+*******************************************************************************/
+function UFPDF($orientation='P',$unit='mm',$format='A4')
+{
+	FPDF::FPDF($orientation, $unit, $format);
+}
+
+/*
+function GetStringWidth($s)
+{
+  //Get width of a string in the current font
+  $s = (string)$s;
+  $codepoints=$this->utf8_to_codepoints($s);
+  $cw=&$this->CurrentFont['cw'];
+  $w=0;
+  foreach($codepoints as $cp)
+    $w+=$cw[$cp];
+  return $w*$this->FontSize/1000;
+}
+*/
+function GetStringWidth($s)
+{
+	//Get width of a string in the current font
+	$s=(string)$s;
+	$cw=&$this->CurrentFont['cw'];
+	$w=0;
+	$l=strlen($s);
+	for($i=0;$i<$l;$i++)
+		$w+=$cw[$s{$i}];
+	return $w*$this->FontSize/1000;
+}
+function AddFont($family,$style='',$file='')
+{
+  //Add a TrueType or Type1 font
+  $family=strtolower($family);
+  if($family=='arial')
+    $family='helvetica';
+  $style=strtoupper($style);
+  if($style=='IB')
+    $style='BI';
+  if(isset($this->fonts[$family.$style]))
+    $this->Error('Font already added: '.$family.' '.$style);
+  if($file=='')
+    $file=str_replace(' ','',$family).strtolower($style).'.php';
+  if(defined('FPDF_FONTPATH'))
+    $file=FPDF_FONTPATH.$file;
+  include($file);
+  if(!isset($name))
+    $this->Error('Could not include font definition file');
+  $i=count($this->fonts)+1;
+  $this->fonts[$family.$style]=array('i'=>$i,'type'=>$type,'name'=>$name,'desc'=>$desc,'up'=>$up,'ut'=>$ut,'cw'=>$cw,'file'=>$file,'ctg'=>$ctg);
+  if($file)
+  {
+    if($type=='TrueTypeUnicode')
+      $this->FontFiles[$file]=array('length1'=>$originalsize);
+    else
+      $this->FontFiles[$file]=array('length1'=>$size1,'length2'=>$size2);
+  }
+}
+
+function Text($x,$y,$txt)
+{
+  //Output a string
+  $s=sprintf('BT %.2f %.2f Td %s Tj ET',$x*$this->k,($this->h-$y)*$this->k,$this->_escapetext($txt));
+  if($this->underline and $txt!='')
+    $s.=' '.$this->_dounderline($x,$y,$this->GetStringWidth($txt),$txt);
+  if($this->ColorFlag)
+    $s='q '.$this->TextColor.' '.$s.' Q';
+  $this->_out($s);
+}
+
+function AcceptPageBreak()
+{
+  //Accept automatic page break or not
+  return $this->AutoPageBreak;
+}
+
+function Cell($w,$h=0,$txt='',$border=0,$ln=0,$align='',$fill=0,$link='')
+{
+	//Output a cell
+	$k=$this->k;
+	if($this->y+$h>$this->PageBreakTrigger && !$this->InFooter && $this->AcceptPageBreak())
+	{
+		//Automatic page break
+		$x=$this->x;
+		$ws=$this->ws;
+		if($ws>0)
+		{
+			$this->ws=0;
+			$this->_out('0 Tw');
+		}
+		$this->AddPage($this->CurOrientation);
+		$this->x=$x;
+		if($ws>0)
+		{
+			$this->ws=$ws;
+			$this->_out(sprintf('%.3f Tw',$ws*$k));
+		}
+	}
+	if($w==0)
+		$w=$this->w-$this->rMargin-$this->x;
+	$s='';
+	if($fill==1 || $border==1)
+	{
+		if($fill==1)
+			$op=($border==1) ? 'B' : 'f';
+		else
+			$op='S';
+		$s=sprintf('%.2f %.2f %.2f %.2f re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
+	}
+	if(is_string($border))
+	{
+	$x=$this->x;
+	$y=$this->y;
+	if(is_int(strpos($border,'L')))
+	  $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
+	if(is_int(strpos($border,'T')))
+	  $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
+	if(is_int(strpos($border,'R')))
+	  $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+	if(is_int(strpos($border,'B')))
+	  $s.=sprintf('%.2f %.2f m %.2f %.2f l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
+	}
+	if($txt!='')
+	{
+		$x=$this->x;
+		$y=$this->y;
+		$width = $this->GetStringWidth($txt);
+		if($align=='R')
+		  $dx=$w-$this->cMargin-$width;
+		elseif($align=='C')
+		  $dx=($w-$width)/2;
+		else
+		  $dx=$this->cMargin;
+		if($this->ColorFlag)
+		  $s.='q '.$this->TextColor.' ';
+		  $txtstring=$this->_escapetext($txt);
+		  $s.=sprintf('BT %.2f %.2f Td %s Tj ET',($x+$dx)*$k,($this->h-($y+.5*$h+.3*$this->FontSize))*$k,$txtstring);
+		if($this->underline)
+		  $s.=' '.$this->_dounderline($x+$dx,$y+.5*$h+.3*$this->FontSize,$width,$txt);
+		if($this->ColorFlag)
+		  $s.=' Q';
+		if($link)
+		  $this->Link($x+$dx,$y+.5*$h-.5*$this->FontSize,$width,$this->FontSize,$link);
+	}
+
+	if($s)
+		$this->_out($s);
+	$this->lasth=$h;
+	if($ln>0)
+	{
+		//Go to next line
+		$this->y+=$h;
+		if($ln==1)
+			$this->x=$this->lMargin;
+	}
+	else
+		$this->x+=$w;
+}
+/*******************************************************************************
+*                                                                              *
+*                              Protected methods                               *
+*                                                                              *
+*******************************************************************************/
+
+function _puttruetypeunicode($font) {
+  //Type0 Font
+  $this->_newobj();
+  $this->_out('<</Type /Font');
+  $this->_out('/Subtype /Type0');
+  $this->_out('/BaseFont /'. $font['name'] .'-UCS');
+  $this->_out('/Encoding /Identity-H');
+  $this->_out('/DescendantFonts ['. ($this->n + 1) .' 0 R]');
+  $this->_out('>>');
+  $this->_out('endobj');
+
+  //CIDFont
+  $this->_newobj();
+  $this->_out('<</Type /Font');
+  $this->_out('/Subtype /CIDFontType2');
+  $this->_out('/BaseFont /'. $font['name']);
+  $this->_out('/CIDSystemInfo <</Registry (Adobe) /Ordering (UCS) /Supplement 0>>');
+  $this->_out('/FontDescriptor '. ($this->n + 1) .' 0 R');
+  $c = 0;
+  foreach ($font['cw'] as $i => $w) {
+    $widths .= $i .' ['. $w.'] ';
+  }
+  $this->_out('/W ['. $widths .']');
+  $this->_out('/CIDToGIDMap '. ($this->n + 2) .' 0 R');
+  $this->_out('>>');
+  $this->_out('endobj');
+
+  //Font descriptor
+  $this->_newobj();
+  $this->_out('<</Type /FontDescriptor');
+  $this->_out('/FontName /'.$font['name']);
+  foreach ($font['desc'] as $k => $v) {
+    $s .= ' /'. $k .' '. $v;
+  }
+  if ($font['file']) {
+		$s .= ' /FontFile2 '. $this->FontFiles[$font['file']]['n'] .' 0 R';
+  }
+  $this->_out($s);
+  $this->_out('>>');
+  $this->_out('endobj');
+
+  //Embed CIDToGIDMap
+  $this->_newobj();
+  if(defined('FPDF_FONTPATH'))
+    $file=FPDF_FONTPATH.$font['ctg'];
+  else
+    $file=$font['ctg'];
+  $size=filesize($file);
+  if(!$size)
+    $this->Error('Font file not found');
+  $this->_out('<</Length '.$size);
+	if(substr($file,-2) == '.z')
+    $this->_out('/Filter /FlateDecode');
+  $this->_out('>>');
+  $f = fopen($file,'rb');
+  $this->_putstream(fread($f,$size));
+  fclose($f);
+  $this->_out('endobj');
+}
+
+function _dounderline($x,$y,$width,$txt)
+{
+  //Underline text
+  $up=$this->CurrentFont['up'];
+  $ut=$this->CurrentFont['ut'];
+  $w=$width+$this->ws*substr_count($txt,' ');
+  return sprintf('%.2f %.2f %.2f %.2f re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt);
+}
+
+function _textstring($s)
+{
+  //Convert to UTF-16BE
+  $s = $this->utf8_to_utf16be($s);
+  //Escape necessary characters
+  $trans = array(')' => '\\)', '(' => '\\(', '\\' => '\\\\');
+  return '('.strtr($s, $trans).')';
+}
+
+function _escapetext($s)
+{
+	//Convert to UTF-16BE
+	$s = $this->utf8_to_utf16be($s, false);
+	//Escape necessary characters
+	$trans = array(')' => '\\)', '(' => '\\(', '\\' => '\\\\');
+	return '('.strtr($s, $trans).')';
+	//return strtr($s, $trans);
+}
+
+function _putinfo()
+{
+	$this->_out('/Producer '.$this->_textstring('UFPDF '. UFPDF_VERSION));
+	if(!empty($this->title))
+		$this->_out('/Title '.$this->_textstring($this->title));
+	if(!empty($this->subject))
+		$this->_out('/Subject '.$this->_textstring($this->subject));
+	if(!empty($this->author))
+		$this->_out('/Author '.$this->_textstring($this->author));
+	if(!empty($this->keywords))
+		$this->_out('/Keywords '.$this->_textstring($this->keywords));
+	if(!empty($this->creator))
+		$this->_out('/Creator '.$this->_textstring($this->creator));
+	$this->_out('/CreationDate '.$this->_textstring('D:'.date('YmdHis')));
+}
+
+// UTF-8 to UTF-16BE conversion.
+// Correctly handles all illegal UTF-8 sequences.
+function utf8_to_utf16be(&$txt, $bom = true) {
+  $l = strlen($txt);
+  $out = $bom ? "\xFE\xFF" : '';
+  for ($i = 0; $i < $l; ++$i) {
+    $c = ord($txt{$i});
+    // ASCII
+    if ($c < 0x80) {
+		//$out .= "\x00". $txt{$i};
+		$out .= $txt{$i};
+    }
+    // Lost continuation byte
+    else if ($c < 0xC0) {
+      $out .= "\xFF\xFD";
+      continue;
+    }
+    // Multibyte sequence leading byte
+    else {
+      if ($c < 0xE0) {
+        $s = 2;
+      }
+      else if ($c < 0xF0) {
+        $s = 3;
+      }
+      else if ($c < 0xF8) {
+        $s = 4;
+      }
+      // 5/6 byte sequences not possible for Unicode.
+      else {
+        $out .= "\xFF\xFD";
+        while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; }
+        continue;
+      }
+      
+      $q = array($c);
+      // Fetch rest of sequence
+      while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); }
+      
+      // Check length
+      if (count($q) != $s) {
+        $out .= "\xFF\xFD";        
+        continue;
+      }
+      
+      switch ($s) {
+        case 2:
+          $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80);
+          // Overlong sequence
+          if ($cp < 0x80) {
+            $out .= "\xFF\xFD";        
+          }
+          else {
+            $out .= chr($cp >> 8);
+            $out .= chr($cp & 0xFF);
+          }
+          continue;
+
+        case 3:
+          $cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80);
+          // Overlong sequence
+          if ($cp < 0x800) {
+            $out .= "\xFF\xFD";        
+          }
+          // Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder)
+          else if ($c > 0xD800 && $c < 0xDFFF) {
+            $out .= "\xFF\xFD";
+          }
+          else {
+            $out .= chr($cp >> 8);
+            $out .= chr($cp & 0xFF);
+          }
+          continue;
+
+        case 4:
+          $cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80);
+          // Overlong sequence
+          if ($cp < 0x10000) {
+            $out .= "\xFF\xFD";
+          }
+          // Outside of the Unicode range
+          else if ($cp >= 0x10FFFF) {
+            $out .= "\xFF\xFD";            
+          }
+          else {
+            // Use surrogates
+            $cp -= 0x10000;
+            $s1 = 0xD800 | ($cp >> 10);
+            $s2 = 0xDC00 | ($cp & 0x3FF);
+            
+            $out .= chr($s1 >> 8);
+            $out .= chr($s1 & 0xFF);
+            $out .= chr($s2 >> 8);
+            $out .= chr($s2 & 0xFF);
+          }
+          continue;
+      }
+    }
+  }
+  return $out;
+}
+
+// UTF-8 to codepoint array conversion.
+// Correctly handles all illegal UTF-8 sequences.
+function utf8_to_codepoints(&$txt) {
+  $l = strlen($txt);
+  $out = array();
+  for ($i = 0; $i < $l; ++$i) {
+    $c = ord($txt{$i});
+    // ASCII
+    if ($c < 0x80) {
+      $out[] = ord($txt{$i});
+    }
+    // Lost continuation byte
+    else if ($c < 0xC0) {
+      $out[] = 0xFFFD;
+      continue;
+    }
+    // Multibyte sequence leading byte
+    else {
+      if ($c < 0xE0) {
+        $s = 2;
+      }
+      else if ($c < 0xF0) {
+        $s = 3;
+      }
+      else if ($c < 0xF8) {
+        $s = 4;
+      }
+      // 5/6 byte sequences not possible for Unicode.
+      else {
+        $out[] = 0xFFFD;
+        while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; }
+        continue;
+      }
+      
+      $q = array($c);
+      // Fetch rest of sequence
+      while (ord($txt{$i + 1}) >= 0x80 && ord($txt{$i + 1}) < 0xC0) { ++$i; $q[] = ord($txt{$i}); }
+      
+      // Check length
+      if (count($q) != $s) {
+        $out[] = 0xFFFD;
+        continue;
+      }
+      
+      switch ($s) {
+        case 2:
+          $cp = (($q[0] ^ 0xC0) << 6) | ($q[1] ^ 0x80);
+          // Overlong sequence
+          if ($cp < 0x80) {
+            $out[] = 0xFFFD;
+          }
+          else {
+            $out[] = $cp;
+          }
+          continue;
+
+        case 3:
+          $cp = (($q[0] ^ 0xE0) << 12) | (($q[1] ^ 0x80) << 6) | ($q[2] ^ 0x80);
+          // Overlong sequence
+          if ($cp < 0x800) {
+            $out[] = 0xFFFD;
+          }
+          // Check for UTF-8 encoded surrogates (caused by a bad UTF-8 encoder)
+          else if ($c > 0xD800 && $c < 0xDFFF) {
+            $out[] = 0xFFFD;
+          }
+          else {
+            $out[] = $cp;
+          }
+          continue;
+
+        case 4:
+          $cp = (($q[0] ^ 0xF0) << 18) | (($q[1] ^ 0x80) << 12) | (($q[2] ^ 0x80) << 6) | ($q[3] ^ 0x80);
+          // Overlong sequence
+          if ($cp < 0x10000) {
+            $out[] = 0xFFFD;
+          }
+          // Outside of the Unicode range
+          else if ($cp >= 0x10FFFF) {
+            $out[] = 0xFFFD;
+          }
+          else {
+            $out[] = $cp;
+          }
+          continue;
+      }
+    }
+  }
+  return $out;
+}
+
+//End of class
+}
+
+}
+?>
Files 6171/e107_plugins/pm/images/attach.png and 75/e107_plugins/pm/images/attach.png differ
Files 6171/e107_plugins/pm/images/mail_block.png and 75/e107_plugins/pm/images/mail_block.png differ
Files 6171/e107_plugins/pm/images/mail_delete.png and 75/e107_plugins/pm/images/mail_delete.png differ
Files 6171/e107_plugins/pm/images/mail_get.png and 75/e107_plugins/pm/images/mail_get.png differ
Files 6171/e107_plugins/pm/images/mail_send.png and 75/e107_plugins/pm/images/mail_send.png differ
Files 6171/e107_plugins/pm/images/mail_unblock.png and 75/e107_plugins/pm/images/mail_unblock.png differ
Files 6171/e107_plugins/pm/images/newpm.gif and 75/e107_plugins/pm/images/newpm.gif differ
Files 6171/e107_plugins/pm/images/pm.png and 75/e107_plugins/pm/images/pm.png differ
Files 6171/e107_plugins/pm/images/pvt_message_16.png and 75/e107_plugins/pm/images/pvt_message_16.png differ
Files 6171/e107_plugins/pm/images/pvt_message_32.png and 75/e107_plugins/pm/images/pvt_message_32.png differ
Files 6171/e107_plugins/pm/images/read.png and 75/e107_plugins/pm/images/read.png differ
Files 6171/e107_plugins/pm/images/unread.png and 75/e107_plugins/pm/images/unread.png differ
diff -ruN 6171/e107_plugins/pm/languages/admin/English.php 75/e107_plugins/pm/languages/admin/English.php
--- 6171/e107_plugins/pm/languages/admin/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/languages/admin/English.php	2005-10-01 21:33:37.000000000 -0500
@@ -0,0 +1,60 @@
+<?php
+define('ADLAN_PM', "Private Messenger");
+define('ADLAN_PM_1', "To activate please go to your menus screen and select the private_msg into one of your menu areas. <br /><br />If you need to convert messages from a previous version, please go to the main config page for this plugin and select the 'convert' link.");
+define('ADLAN_PM_2', "Configure Private Messenger");
+define('ADLAN_PM_3', "PM settings not found, default values set");
+define('ADLAN_PM_4', "Options Updated");
+define('ADLAN_PM_5', "Limit for selected userclass already exists");
+define('ADLAN_PM_6', "Limit successfully added");
+define('ADLAN_PM_7', "Limit not added - unknown error");
+define('ADLAN_PM_8', "Limit status updated");
+define('ADLAN_PM_9', " - Limit successfully removed");
+define('ADLAN_PM_10', " - Limit not removed - unknown error");
+define('ADLAN_PM_11', " - Limit successfully updated");
+define('ADLAN_PM_12', "PM Options");
+define('ADLAN_PM_13', "PM Conversion");
+define('ADLAN_PM_14', "PM Limits");
+define('ADLAN_PM_15', "Add PM Limit");
+define('ADLAN_PM_16', "Plugin Title");
+define('ADLAN_PM_17', "Show new PM animation");
+define('ADLAN_PM_18', "Show user dropdown");
+define('ADLAN_PM_19', "READ message timeout");
+define('ADLAN_PM_20', "UNREAD message timeout");
+define('ADLAN_PM_21', "popup notification on new PM");
+define('ADLAN_PM_22', "Popup delay timeout");
+define('ADLAN_PM_23', "Restrict PM use to");
+define('ADLAN_PM_24', "Number of PMs to show per page");
+define('ADLAN_PM_25', "Enable PM email notifications");
+define('ADLAN_PM_26', "Allow user to request read receipt email notifications");
+define('ADLAN_PM_27', "Allow posting of attachments");
+define('ADLAN_PM_28', "Maximum attachment size");
+define('ADLAN_PM_29', "Allow sending to all members");
+define('ADLAN_PM_30', "Allow sending to multiple receipients");
+define('ADLAN_PM_31', "Enable sending to userclass");
+define('ADLAN_PM_32', "Update Settings");
+define('ADLAN_PM_33', "Inactive (no limits)");
+define('ADLAN_PM_34', "PM counts");
+define('ADLAN_PM_35', "PM box sizes");
+define('ADLAN_PM_36', "Userclass");
+define('ADLAN_PM_37', "Count limits");
+define('ADLAN_PM_38', "Size limits (in KB)");
+define('ADLAN_PM_39', "Inbox :");
+define('ADLAN_PM_40', "Outbox :");
+define('ADLAN_PM_41', "There are currently no limits set.");
+define('ADLAN_PM_42', "Update Limits");
+define('ADLAN_PM_43', "Add New Limit");
+define('ADLAN_PM_44', "seconds");
+define('ADLAN_PM_45', "Limit PM By: ");
+define('ADLAN_PM_46', "PM Conversion");
+define('ADLAN_PM_47', "You do not appear to have any old messages from previous vesions, it is safe to uninstall the old plugin");
+define('ADLAN_PM_48', "You have {OLDCOUNT} messages from the older version, please decide what you would like to do with these messages<br /><br />If converting messages, any message successfully converted will be removed from old system.");
+define('ADLAN_PM_49', "Convert to new PM");
+define('ADLAN_PM_50', "Discard old messages");
+define('ADLAN_PM_51', "PM #{PMNUM} not converted");
+define('ADLAN_PM_52', "messages converted");
+define('ADLAN_PM_53', "No records found to convert.");
+
+define('ADLAN_PM_54', "Main settings");
+define('ADLAN_PM_55', "Limits");
+define('ADLAN_PM_56', "Conversion");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/languages/English.php 75/e107_plugins/pm/languages/English.php
--- 6171/e107_plugins/pm/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/languages/English.php	2005-12-09 18:43:27.000000000 -0600
@@ -0,0 +1,79 @@
+<?php
+
+define('LAN_PM', "Private Message");
+define('LAN_PM_1', "Send Private Message");
+define('LAN_PM_2', "To");
+define('LAN_PM_3', "Preview");
+define('LAN_PM_4', "Userclass");
+define('LAN_PM_5', "Subject");
+define('LAN_PM_6', "Message");
+define('LAN_PM_7', "Emotes");
+define('LAN_PM_8', "Attachments");
+define('LAN_PM_9', "Read receipt");
+define('LAN_PM_10', "Send me an email when this PM is read");
+define('LAN_PM_11', "add new upload");
+define('LAN_PM_12', "You are not authorized to use the PM system");
+define('LAN_PM_13', "Your outbox is currently {PERCENT}% full, you are unable to send PMs until you delete some");
+define('LAN_PM_14', "ERROR: Possible duplicate post, PM not sent");
+define('LAN_PM_15', "You are not allowed to send to userclass");
+define('LAN_PM_16', "Must be member of class");
+define('LAN_PM_17', "User not found");
+define('LAN_PM_18', "You are not allowed to send PMs to: ");
+define('LAN_PM_19', "Your outbox is full, you are not allowed to send PMs");
+define('LAN_PM_21', "Adding this PM will exceed your maximum outbox size, PM not posted");
+define('LAN_PM_22', "File upload failed");
+define('LAN_PM_23', "You are not allowed to send attachments");
+define('LAN_PM_24', "Deleting PM");
+define('LAN_PM_25', "Inbox");
+define('LAN_PM_26', "Outbox");
+define('LAN_PM_27', "Unread");
+define('LAN_PM_28', "N/A");
+define('LAN_PM_29', "Message Sent");
+define('LAN_PM_30', "Message Read");
+define('LAN_PM_31', "From");
+define('LAN_PM_32', "Received");
+define('LAN_PM_33', "Sent");
+define('LAN_PM_34', "No Messages");
+define('LAN_PM_35', "Send new message");
+define('LAN_PM_36', "total");
+define('LAN_PM_37', "unread");
+define('LAN_PM_38', "PM Sent to userclass");
+define('LAN_PM_39', "Failed to send PM to");
+define('LAN_PM_40', "PM Sent to user");
+define('LAN_PM_41', "Failed to post PM to your Outbox");
+
+define('LAN_PM_42', "PM deleted from inbox");
+define('LAN_PM_43', "PM deleted from outbox");
+define('LAN_PM_44', "Block removed: {UNAME} is now allowed to send you PMs");
+define('LAN_PM_45', "ERROR: Block not removed, unknown error");
+define('LAN_PM_46', "Block not in place for {UNAME}");
+define('LAN_PM_47', "Block added: {UNAME} is no longer allowed to send you PMs");
+define('LAN_PM_48', "ERROR: Block not added, unknown error");
+define('LAN_PM_49', "ERROR: Block already in place for {UNAME}");
+define('LAN_PM_50', "Block User");
+define('LAN_PM_51', "Unblock User");
+define('LAN_PM_52', "Delete");
+define('LAN_PM_53', "Delete Selected");
+define('LAN_PM_54', "Quote original");
+define('LAN_PM_55', "Send Reply");
+define('LAN_PM_56', "You are not permitted to reply to this message");
+define('LAN_PM_57', "Message not found");
+define('LAN_PM_58', "Re: ");
+define('LAN_PM_59', "Go to page: ");
+define('LAN_PM_60', "You are not permitted to view this message");
+define('LAN_PM_61', "No subject");
+define('LAN_PM_62', "File: [{FILENAME}] exceeds size limit - not attached");
+
+define("LAN_PM_100", "New PM from ");
+define("LAN_PM_101", "You have received a new Private Message from ");
+define("LAN_PM_102", "Message sent from: ");
+define("LAN_PM_103", "Message subject: ");
+define("LAN_PM_104", "Number of attachments: ");
+define("LAN_PM_105", "You can view the PM at: ");
+define("LAN_PM_106", "PM read by ");
+define("LAN_PM_107", "The Private Message you sent to {UNAME} was read on ");
+define("LAN_PM_108", "Message sent on: ");
+define("LAN_PM_109", "New Message(s)");
+define("LAN_PM_110", "ok");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/plugin.php 75/e107_plugins/pm/plugin.php
--- 6171/e107_plugins/pm/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/plugin.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,105 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/plugin.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."pm/languages/admin/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."pm/languages/admin/English.php");
+	
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = ADLAN_PM;
+$eplug_version = "3.0";
+$eplug_author = "McFly";
+$eplug_url = "";
+$eplug_email = "mcfly@e107.org";
+$eplug_description = "This plugin is a fully featured Private Messaging system.";
+$eplug_compatible = "e107v.7+";
+// leave blank if no readme file
+	
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "pm";
+	
+// Mane of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "pm";
+	
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "pm_conf.php";
+	
+$eplug_sc = array('SENDPM');
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/pvt_message_32.png";
+$eplug_icon_small = $eplug_folder."/images/pvt_message_16.png";
+$eplug_caption = ADLAN_PM_2; //"Configure Private Messager";
+	
+// List of preferences -----------------------------------------------------------------------------------------------
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array(
+"private_msg",
+"private_msg_block" 
+);
+	
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."private_msg (
+  pm_id int(10) unsigned NOT NULL auto_increment,
+  pm_from int(10) unsigned NOT NULL default '0',
+  pm_to varchar(250) NOT NULL default '',
+  pm_sent int(10) unsigned NOT NULL default '0',
+  pm_read int(10) unsigned NOT NULL default '0',
+  pm_subject text NOT NULL,
+  pm_text text NOT NULL,
+  pm_sent_del tinyint(1) unsigned NOT NULL default '0',
+  pm_read_del tinyint(1) unsigned NOT NULL default '0',
+  pm_attachments text NOT NULL,
+  pm_option varchar(250) NOT NULL default '',
+  pm_size int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (pm_id)
+) TYPE=MyISAM AUTO_INCREMENT=1 ;",
+"CREATE TABLE ".MPREFIX."private_msg_block (
+  pm_block_id int(10) unsigned NOT NULL auto_increment,
+  pm_block_from int(10) unsigned NOT NULL default '0',
+  pm_block_to int(10) unsigned NOT NULL default '0',
+  pm_block_datestamp int(10) unsigned NOT NULL default '0',
+  pm_block_count int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (pm_block_id)
+) TYPE=MyISAM AUTO_INCREMENT=1 ;"
+);
+	
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$eplug_link_url = "";
+	
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = ADLAN_PM_1;
+
+if(!function_exists("pm_uninstall"))
+{
+	//Remove prefs and menu entry during uninstall
+	function pm_uninstall()
+	{
+		global $sql;
+		$sql->db_Delete("core", "e107_name = 'pm_prefs'");
+		$sql->db_Delete("menus", "menu_name = 'private_msg_menu'");
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm_class.php 75/e107_plugins/pm/pm_class.php
--- 6171/e107_plugins/pm/pm_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_class.php	2006-04-24 09:23:59.000000000 -0500
@@ -0,0 +1,428 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm_class.php,v $
+|     $Revision: 1.15 $
+|     $Date: 2006/04/24 14:23:59 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class private_message
+{
+	function pm_mark_read($pm_id, $pm_info)
+	{
+		$now = time();
+		global $pm_prefs, $sql;
+		if($pm_prefs['read_delete'])
+		{
+			$this->del($pm_id);
+		}
+		else
+		{
+			$sql->db_Select_gen("UPDATE #private_msg SET pm_read = {$now} WHERE pm_id=".intval($pm_id));
+			if(strpos($pm_info['pm_option'], "+rr") !== FALSE)
+			{
+				$this->pm_send_receipt($pm_info);
+			}
+		}
+	}
+
+	function pm_get($pmid)
+	{
+		global $sql;
+		$qry = "
+		SELECT pm.*, ut.user_image AS sent_image, ut.user_name AS sent_name, uf.user_image AS from_image, uf.user_name AS from_name, uf.user_email as from_email, ut.user_email as to_email  FROM #private_msg AS pm
+		LEFT JOIN #user AS ut ON ut.user_id = pm.pm_to
+		LEFT JOIN #user AS uf ON uf.user_id = pm.pm_from
+		WHERE pm.pm_id='".intval($pmid)."'
+		";
+		if ($sql->db_Select_gen($qry))
+		{
+			$row = $sql->db_Fetch();
+			return $row;
+		}
+		return FALSE;
+	}
+
+	function add($vars)
+	{
+		global $pm_prefs, $tp, $sql;
+		$vars['options'] = "";
+		$pmsize = 0;
+		$attachlist = "";
+		$pm_options = "";
+		if(isset($vars['receipt']) && $vars['receipt']) {$pm_options .= "+rr+";	}
+		if(isset($vars['uploaded']))
+		{
+			foreach($vars['uploaded'] as $u)
+			{
+				if(!isset($u['error']))
+				{
+					$pmsize += $u['size'];
+					$a_list[] = $u['name'];
+				}
+			}
+			$attachlist = implode(chr(0), $a_list);
+		}
+		$pmsize += strlen($vars['pm_message']);
+
+		$pm_subject = $tp->toDB($vars['pm_subject']);
+		$pm_message = $tp->toDB($vars['pm_message']);
+		$sendtime = time();
+		if(isset($vars['to_userclass']) || isset($vars['to_array']))
+		{
+			if(isset($vars['to_userclass']))
+			{
+				require_once(e_HANDLER."userclass_class.php");
+				$toclass = r_userclass_name($vars['pm_userclass']);
+				$tolist = $this->get_users_inclass($vars['pm_userclass']);
+				$ret .= LAN_PM_38.": {$vars['to_userclass']}<br />";
+				$class = TRUE;
+			}
+			else
+			{
+				$tolist = $vars['to_array'];
+				$class = FALSE;
+			}
+			foreach($tolist as $u)
+			{
+				set_time_limit(30);
+				if($pmid = $sql->db_Insert("private_msg", "0, '".intval($vars['from_id'])."', '".$tp -> toDB($u['user_id'])."', '".intval($sendtime)."', '0', '{$pm_subject}', '{$pm_message}', '1', '0', '".$tp -> toDB($attachlist)."', '".$tp -> toDB($pm_options)."', '".intval($pmsize)."'"))
+				{
+					if($class == FALSE)
+					{
+						$toclass .= $u['user_name'].", ";
+					}
+					if(check_class($pm_prefs['notify_class'], $u['user_class']))
+					{
+						$vars['to_info'] = $u;
+						$this->pm_send_notify($u['user_id'], $vars, $pmid, count($a_list));
+					}
+				}
+				else
+				{
+					$ret .= LAN_PM_39.": {$u['user_name']} <br />";
+				}
+			}
+			if(!$pmid = $sql->db_Insert("private_msg", "0, '".intval($vars['from_id'])."', '".$tp -> toDB($toclass)."', '".intval($sendtime)."', '1', '{$pm_subject}', '{$pm_message}', '0', '0', '".$tp -> toDB($attachlist)."', '".$tp -> toDB($pm_options)."', '".intval($pmsize)."'"))
+			{
+				$ret .= LAN_PM_41."<br />";
+			}
+			
+		}
+		else
+		{
+			if($pmid = $sql->db_Insert("private_msg", "0, '".intval($vars['from_id'])."', '".$tp -> toDB($vars['to_info']['user_id'])."', '".intval($sendtime)."', '0', '{$pm_subject}', '{$pm_message}', '0', '0', '".$tp -> toDB($attachlist)."', '".$tp -> toDB($pm_options)."', '".intval($pmsize)."'"))
+			{
+				if(check_class($pm_prefs['notify_class'], $vars['to_info']['user_class']))
+				{
+					set_time_limit(30);
+					$this->pm_send_notify($vars['to_info']['user_id'], $vars, $pmid, count($a_list));
+				}
+				$ret .= LAN_PM_40.": {$vars['to_info']['user_name']}<br />";
+			}
+		}
+		return $ret;
+	}
+
+	function del($pmid)
+	{
+		global $sql;
+		$ret = "";
+		$del_pm = FALSE;
+		$newvals = "";
+		if($sql->db_Select("private_msg", "*", "pm_id = ".intval($pmid)." AND (pm_from = ".USERID." OR pm_to = ".USERID.")"))
+		{
+			$row = $sql->db_Fetch();
+			if($row['pm_to'] == USERID)
+			{
+				$newvals = "pm_read_del = 1";
+				$ret .= LAN_PM_42."<br />";
+				if($row['pm_sent_del'] == 1) { $del_pm = TRUE; }
+			}
+			if($row['pm_from'] == USERID)
+			{
+				if($newvals != "") { $del_pm = TRUE; }
+				$newvals = "pm_sent_del = 1";
+				$ret .= LAN_PM_43."<br />";
+				if($row['pm_read_del'] == 1) { $del_pm = TRUE; }
+			}
+
+			if(count($newvals) == 2 || $del_pm == TRUE)
+			{
+				// Delete any attachments and remove PM from db
+				$attachments = explode(chr(0), $row['pm_attachments']);
+				foreach($attachments as $a)
+				{
+					$filename = getcwd()."/attachments/{$a}";
+					unlink($filename);
+				}
+				$sql->db_Delete("private_msg", "pm_id = ".intval($pmid));
+			}
+			else
+			{
+				$sql->db_Update("private_msg", $newvals." WHERE pm_id = ".intval($pmid));
+			}
+			return $ret;
+		}
+	}
+
+	function pm_send_notify($uid, $pminfo, $pmid, $attach_count = 0)
+	{
+		require_once(e_HANDLER."mail.php");
+		global $PLUGINS_DIRECTORY;
+		$subject = LAN_PM_100.SITENAME;
+		$pmlink = SITEURL.$PLUGINS_DIRECTORY."pm/pm.php?show.{$pmid}";
+		$txt = LAN_PM_101.SITENAME."\n\n";
+		$txt .= LAN_PM_102.USERNAME."\n";
+		$txt .= LAN_PM_103.$pminfo['pm_subject']."\n";
+		if($attch_count > 0)
+		{
+			$txt .= LAN_PM_104.$attach_count."\n";
+		}
+		$txt .= LAN_PM_105."\n".$pmlink."\n";
+		sendemail($pminfo['to_info']['user_email'], $subject, $txt, $pminfo['to_info']['user_name']);
+	}
+
+	function pm_send_receipt($pminfo)
+	{
+		require_once(e_HANDLER."mail.php");
+		global $PLUGINS_DIRECTORY;
+		$subject = LAN_PM_106.$pminfo['sent_name'];
+		$pmlink = SITEURL.$PLUGINS_DIRECTORY."pm/pm.php?show.{$pminfo['pm_id']}";
+		$txt = str_replace("{UNAME}", $pminfo['sent_name'], LAN_PM_107).date('l F dS Y h:i:s A')."\n\n";
+		$txt .= LAN_PM_108.date('l F dS Y h:i:s A', $pminfo['pm_sent'])."\n";
+		$txt .= LAN_PM_103.$pminfo['pm_subject']."\n";
+		$txt .= LAN_PM_105."\n".$pmlink."\n";
+		sendemail($pminfo['from_email'], $subject, $txt, $pminfo['from_name']);
+	}
+
+	function block_get($to = USERID)
+	{
+		global $sql, $tp;
+		$ret = array();
+		if($sql->db_Select("private_msg_block", "pm_block_from", "pm_block_to = '".$tp -> toDB($to)."'"))
+		{
+			while($row = $sql->db_Fetch())
+			{
+				$ret[] = $row['pm_block_from'];
+			}
+		}
+		return $ret;
+	}
+
+	function block_add($from, $to = USERID)
+	{
+		global $sql, $tp;
+		if($sql->db_Select("user", "user_name", "user_id = '".intval($from)."'"))
+		{
+			$uinfo = $sql->db_Fetch();
+			if(!$sql->db_Count("private_msg_block", "(*)", "WHERE pm_block_from = '".intval($from)."' AND pm_block_to = '".$tp -> toDB($to)."'"))
+			{
+				if($sql->db_Insert("private_msg_block", "0, '".intval($from)."', '".$tp -> toDB($to)."', '".time()."', '0'"))
+				{
+					return str_replace('{UNAME}', $uinfo['user_name'], LAN_PM_47);
+				}
+				else
+				{
+					return LAN_PM_48;
+				}
+			}
+			else
+			{
+				return str_replace('{UNAME}', $uinfo['user_name'], LAN_PM_49);
+			}
+		}
+		else
+		{
+			return LAN_PM_17;
+		}
+	}
+
+	function block_del($from, $to = USERID)
+	{
+		global $sql;
+		if($sql->db_Select("user", "user_name", "user_id = '".intval($from)."'"))
+		{
+			$uinfo = $sql->db_Fetch();
+			if($sql->db_Select("private_msg_block", "pm_block_id", "pm_block_from = '".intval($from)."' AND pm_block_to = '".intval($to)."'"))
+			{
+				$row = $sql->db_Fetch();
+				if($sql->db_Delete("private_msg_block", "pm_block_id = '".intval($row['pm_block_id'])."'"))
+				{
+					return str_replace("{UNAME}", $uinfo['user_name'], LAN_PM_44);
+				}
+				else
+				{
+					return LAN_PM_45;
+				}
+			}
+			else
+			{
+				return str_replace("{UNAME}", $uinfo['user_name'], LAN_PM_46);
+			}
+		}
+		else
+		{
+			return LAN_PM_17;
+		}
+	}
+
+	function pm_getuid($var)
+	{
+		global $sql, $tp;
+
+		if($sql->db_Select("user", "user_id, user_name, user_class, user_email", "user_name LIKE '".$sql -> escape(trim($var), TRUE)."'"))
+		{
+			$row = $sql->db_Fetch();
+			return $row;
+		}
+		return FALSE;
+	}
+
+	function get_users_inclass($class)
+	{
+		global $sql, $tp;
+		if($class == e_UC_MEMBER)
+		{
+			$qry = "SELECT user_id, user_name, user_email, user_class FROM #user WHERE 1";
+		}
+		elseif($class == e_UC_ADMIN)
+		{
+			$qry = "SELECT user_id, user_name, user_email, user_class FROM #user WHERE user_admin = 1";
+		}
+		elseif($class)
+		{
+			$regex = "(^|,)(".$tp -> toDB($class).")(,|$)";
+			$qry = "SELECT user_id, user_name, user_email, user_class FROM #user WHERE user_class REGEXP '{$regex}'";
+		}
+		if($sql->db_Select_gen($qry))
+		{
+			$ret = $sql->db_getList();
+			return $ret;
+		}
+		return FALSE;
+	}
+
+	function pm_get_inbox($uid = USERID, $from = 0, $limit = 10)
+	{
+		global $sql;
+		$ret = "";
+		if($total_messages = $sql->db_Count("private_msg", "(*)", "WHERE pm_to='{$uid}' AND pm_read_del=0"))
+		{
+			$qry = "
+			SELECT pm.*, u.user_image, u.user_name FROM #private_msg AS pm
+			LEFT JOIN #user AS u ON u.user_id = pm.pm_from
+			WHERE pm.pm_to='{$uid}' AND pm.pm_read_del=0
+			ORDER BY pm.pm_sent DESC
+			LIMIT ".intval($from).", ".intval($limit)."
+			";
+			if($sql->db_Select_gen($qry))
+			{
+				$ret['messages'] = $sql->db_getList();
+				$ret['total_messages'] = $total_messages;
+			}
+			return $ret;
+		}
+	}
+
+	function pm_get_outbox($uid = USERID, $from = 0, $limit = 10)
+	{
+		global $sql;
+		if(intval($limit < 1)) { $limit = 10; }
+		if($total_messages = $sql->db_Count("private_msg", "(*)", "WHERE pm_from='{$uid}' AND pm_sent_del=0"))
+		{
+			$qry = "
+			SELECT pm.*, u.user_image, u.user_name FROM #private_msg AS pm
+			LEFT JOIN #user AS u ON u.user_id = pm.pm_to
+			WHERE pm.pm_from='{$uid}' AND pm.pm_sent_del=0
+			ORDER BY pm.pm_sent DESC
+			LIMIT ".intval($from).", ".intval($limit)."
+			";
+			if($sql->db_Select_gen($qry))
+			{
+				$ret['messages'] = $sql->db_getList();
+				$ret['total_messages'] = $total_messages;
+			}
+		}
+		return $ret;
+	}
+
+	function send_file($pmid, $filenum)
+	{
+		global $pref;
+		$pm_info = $this->pm_get($pmid);
+		$attachments = explode(chr(0), $pm_info['pm_attachments']);
+		if(!isset($attachments[$filenum]))
+		{
+			return FALSE;
+		}
+		$fname = $attachments[$filenum];
+		list($timestamp, $fromid, $rand, $file) = explode("_", $fname, 4);
+		$filename = getcwd()."/attachments/{$fname}";
+
+		if($fromid != $pm_info['pm_from'])
+		{
+			return FALSE;
+		}
+		if(!is_file($filename))
+		{
+			return FALSE;
+		}
+		@set_time_limit(10 * 60);
+		@ini_set("max_execution_time", 10 * 60);
+		while (@ob_end_clean()); // kill all output buffering else it eats server resources
+		if (connection_status() == 0)
+		{
+			if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
+				$file = preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1);
+			}
+			if (isset($_SERVER['HTTP_RANGE']))
+			{
+				$seek = intval(substr($_SERVER['HTTP_RANGE'] , strlen('bytes=')));
+			}
+			$bufsize = 2048;
+			ignore_user_abort(true);
+			$data_len = filesize($filename);
+			if ($seek > ($data_len - 1)) $seek = 0;
+			$res =& fopen($filename, 'rb');
+			if ($seek)
+			{
+				fseek($res , $seek);
+			}
+			$data_len -= $seek;
+			header("Expires: 0");
+			header("Cache-Control: max-age=30" );
+			header("Content-Type: application/force-download");
+			header("Content-Disposition: attachment; filename={$file}");
+			header("Content-Length: {$data_len}");
+			header("Pragma: public");
+			if ($seek)
+			{
+				header("Accept-Ranges: bytes");
+				header("HTTP/1.0 206 Partial Content");
+				header("status: 206 Partial Content");
+				header("Content-Range: bytes {$seek}-".($data_len - 1)."/{$data_len}");
+			}
+			while (!connection_aborted() && $data_len > 0)
+			{
+				echo fread($res , $bufsize);
+				$data_len -= $bufsize;
+			}
+			fclose($res);
+		}
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm_conf.php 75/e107_plugins/pm/pm_conf.php
--- 6171/e107_plugins/pm/pm_conf.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_conf.php	2006-01-09 11:09:01.000000000 -0600
@@ -0,0 +1,364 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm_conf.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2006/01/09 17:09:01 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+$retrieve_prefs[] = 'pm_prefs';
+$eplug_admin = TRUE;
+require_once("../../class2.php");
+require_once(e_PLUGIN."pm/pm_class.php");
+require_once(e_HANDLER."userclass_class.php");
+require_once(e_HANDLER."form_handler.php");
+
+if (!getperms("P"))
+{
+	header("location:".e_BASE."index.php");
+	exit;
+}
+
+$action = e_QUERY;
+
+require_once(e_ADMIN."auth.php");
+
+if($action == "")
+{
+	$action = "main";
+}
+
+$pm_prefs = $sysprefs->getArray("pm_prefs");
+
+//pm_prefs record not found in core table, set to defaults and create record
+if(!is_array($pm_prefs))
+{
+	require_once(e_PLUGIN."pm/pm_default.php");
+	$pm_prefs = pm_set_default_prefs();
+	$sysprefs->setArray('pm_prefs');
+	$message = ADLAN_PM_3;
+}
+
+$lan_file = e_PLUGIN."pm/languages/admin/".e_LANGUAGE.".php";
+include_once(is_readable($lan_file) ? $lan_file : e_PLUGIN."pm/languages/admin/English.php");
+	
+if (isset($_POST['update_prefs'])) 
+{
+	foreach($_POST['option'] as $k => $v)
+	{
+		$pm_prefs[$k] = $v;
+	}
+	$sysprefs->setArray('pm_prefs');
+	$message = ADLAN_PM_4;
+}
+
+if(isset($_POST['addlimit']))
+{
+	if($sql->db_Select('generic','gen_id',"gen_type = 'pm_limit' AND gen_datestamp = {$_POST['newlimit_class']}"))
+	{
+		$message = ADLAN_PM_5;
+	}
+	else
+	{
+		if($sql->db_Insert('generic',"0, 'pm_limit', '{$_POST['newlimit_class']}', '{$_POST['new_inbox_count']}', '{$_POST['new_outbox_count']}', '{$_POST['new_inbox_size']}', '{$_POST['new_outbox_size']}'"))
+		{
+			$message = ADLAN_PM_6;
+		}
+		else
+		{
+			$message = ADLAN_PM_7;
+		}
+	}
+}
+
+if(isset($_POST['updatelimits']))
+{
+	if($pref['pm_limits'] != $_POST['pm_limits'])
+	{
+		$pref['pm_limits'] = $_POST['pm_limits'];
+		save_prefs();
+		$message .= ADLAN_PM_8."<br />";
+	}
+	foreach(array_keys($_POST['inbox_count']) as $id)
+	{
+		if($_POST['inbox_count'][$id] == "" && $_POST['outbox_count'][$id] == "" && $_POST['inbox_size'][$id] == "" && $_POST['outbox_size'][$id] == "")
+		{
+			//All entries empty - Remove record
+			if($sql->db_Delete('generic',"gen_id = {$id}"))
+			{
+				$message .= $id.ADLAN_PM_9."<br />";
+			}
+			else
+			{
+				$message .= $id.ADLAN_PM_10."<br />";
+			}
+		}
+		else
+		{
+			$sql->db_Update('generic',"gen_user_id = '{$_POST['inbox_count'][$id]}', gen_ip = '{$_POST['outbox_count'][$id]}', gen_intdata = '{$_POST['inbox_size'][$id]}', gen_chardata = '{$_POST['outbox_size'][$id]}' WHERE gen_id = {$id}");
+			$message .= $id.ADLAN_PM_11."<br />";
+		}
+	}
+}
+
+if(isset($message))
+{
+	$ns->tablerender("", $message);
+}
+
+
+if($action == "main")
+{
+	$ns->tablerender(ADLAN_PM_12, show_options());
+}
+
+if($action == "limits")
+{
+	$ns->tablerender(ADLAN_PM_14, show_limits());
+	$ns->tablerender(ADLAN_PM_15, add_limit());
+}
+
+require_once(e_ADMIN."footer.php");
+
+function yes_no($fname)
+{
+		global $pm_prefs;
+		$ret = 
+		form::form_radio("option[{$fname}]", "1", ($pm_prefs[$fname] ? "1" : "0"), "", "").LAN_YES." ".
+		form::form_radio("option[{$fname}]", "0", ($pm_prefs[$fname] ? "0" : "1"), "", "").LAN_NO;
+		return $ret;
+}
+
+
+function show_options()
+{
+	global $pm_prefs;
+	$txt = "
+	<form method='post' action='".e_SELF."'>
+	<table class='fborder' style='width:95%'>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_16."</td>
+		<td class='forumheader3' style='width:25%'>".form::form_text('option[title]', 20, $pm_prefs['title'], 50)."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_17."</td>
+		<td class='forumheader3' style='width:25%'>".yes_no('animate')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_18."</td>
+		<td class='forumheader3' style='width:25%'>".yes_no('dropdown')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_19."</td>
+		<td class='forumheader3' style='width:25%'>".form::form_text('option[read_timeout]', 5, $pm_prefs['read_timeout'], 5)."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_20."</td>
+		<td class='forumheader3' style='width:25%'>".form::form_text('option[unread_timeout]', 5, $pm_prefs['unread_timeout'], 5)."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_21."</td>
+		<td class='forumheader3' style='width:25%'>".yes_no('popup')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_22."</td>
+		<td class='forumheader3' style='width:25%'>".form::form_text('option[popup_delay]', 5, $pm_prefs['popup_delay'], 5)." ".ADLAN_PM_44."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_23."</td>
+		<td class='forumheader3' style='width:25%'>".r_userclass('option[pm_class]', $pm_prefs['pm_class'], 'off', 'members, admin, classes')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_24."</td>
+		<td class='forumheader3' style='width:25%'>".form::form_text('option[perpage]', 5, $pm_prefs['perpage'], 5)."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_25."</td>
+		<td class='forumheader3' style='width:25%'>".r_userclass('option[notify_class]', $pm_prefs['notify_class'], 'off', 'nobody, members, admin, classes')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_26."</td>
+		<td class='forumheader3' style='width:25%'>".r_userclass('option[receipt_class]', $pm_prefs['receipt_class'], 'off', 'nobody, members, admin, classes')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_27."</td>
+		<td class='forumheader3' style='width:25%'>".r_userclass('option[attach_class]', $pm_prefs['attach_class'], 'off', 'nobody, members, admin, classes')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_28."</td>
+		<td class='forumheader3' style='width:25%'>".form::form_text('option[attach_size]', 8, $pm_prefs['attach_size'], 8)." kb</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_29."</td>
+		<td class='forumheader3' style='width:25%'>".r_userclass('option[sendall_class]', $pm_prefs['sendall_class'], 'off', 'nobody, members, admin, classes')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_30."</td>
+		<td class='forumheader3' style='width:25%'>".r_userclass('option[multi_class]', $pm_prefs['multi_class'], 'off', 'nobody, members, admin, classes')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader3' style='width:75%'>".ADLAN_PM_31."</td>
+		<td class='forumheader3' style='width:25%'>".yes_no('allow_userclass')."</td>
+	</tr>
+	<tr>
+		<td class='forumheader' colspan='2' style='text-align:center'><input type='submit' class='button' name='update_prefs' value='".ADLAN_PM_32."' /></td>
+	</tr>
+	</table>
+	</form>
+	";
+	return $txt;
+}
+
+function show_limits()
+{
+	global $sql, $pref;
+	if($sql->db_Select('userclass_classes','userclass_id, userclass_name'))
+	{
+		$classList = $sql->db_getList();
+	}
+	if($sql->db_Select("generic", "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as inbox_count, gen_ip as outbox_count, gen_intdata as inbox_size, gen_chardata as outbox_size", "gen_type = 'pm_limit'"))
+	{
+		while($row = $sql->db_Fetch())
+		{
+			$limitList[$row['limit_classnum']] = $row;
+		}
+	}
+	$txt = "
+		<form method='post' action='".e_SELF."?".e_QUERY."'>
+		<table class='fborder' style='width:95%'>
+		<tr>
+			<td colspan='3' class='forumheader3' style='text-align:left'>".ADLAN_PM_45." 
+			<select name='pm_limits' class='tbox'>
+		";
+		$sel = ($pref['pm_limits'] == 0 ? "selected='selected'" : "");
+		$txt .= "<option value='0' {$sel}>".ADLAN_PM_33."</option>\n";
+
+		$sel = ($pref['pm_limits'] == 1 ? "selected='selected'" : "");
+		$txt .= "<option value='1' {$sel}>".ADLAN_PM_34."</option>\n";
+
+		$sel = ($pref['pm_limits'] == 2 ? "selected='selected'" : "");
+		$txt .= "<option value='2' {$sel}>".ADLAN_PM_35."</option>\n";
+
+		$txt .= "</select>\n";
+		
+		$txt .= "
+			</td>
+		</tr>
+		<tr>
+			<td class='fcaption'>".ADLAN_PM_36."</td>
+			<td class='fcaption'>".ADLAN_PM_37."</td>
+			<td class='fcaption'>".ADLAN_PM_38."</td>
+		</tr>
+	";
+
+	if (isset($limitList)) {
+		foreach($limitList as $row)
+		{
+			$txt .= "
+			<tr>
+			<td class='forumheader3'>".r_userclass_name($row['limit_classnum'])."</td>
+			<td class='forumheader3'>
+			".ADLAN_PM_39."<input type='text' class='tbox' size='5' name='inbox_count[{$row['limit_id']}]' value='{$row['inbox_count']}' /> 
+			".ADLAN_PM_40."<input type='text' class='tbox' size='5' name='outbox_count[{$row['limit_id']}]' value='{$row['outbox_count']}' /> 
+			</td>
+			<td class='forumheader3'>
+			".ADLAN_PM_39."<input type='text' class='tbox' size='5' name='inbox_size[{$row['limit_id']}]' value='{$row['inbox_size']}' /> 
+			".ADLAN_PM_39."<input type='text' class='tbox' size='5' name='outbox_size[{$row['limit_id']}]' value='{$row['outbox_size']}' /> 
+			</td>
+			</tr>
+			";
+		}
+	} else {
+		$txt .= "
+		<tr>
+		<td class='forumheader3' colspan='3' style='text-align: center'>".ADLAN_PM_41."</td>
+		</tr>
+		";
+	}
+
+	$txt .= "
+	<tr>
+	<td class='forumheader' colspan='3' style='text-align:center'>
+	<input type='submit' class='button' name='updatelimits' value='".ADLAN_PM_42."' />
+	</td>
+	</tr>
+	";
+
+	$txt .= "</table></form>";
+	return $txt;
+}
+
+function add_limit()
+{
+	global $sql, $pref;
+	if($sql->db_Select('userclass_classes','userclass_id, userclass_name'))
+	{
+		$classList = $sql->db_getList();
+	}
+	if($sql->db_Select("generic", "gen_id as limit_id, gen_datestamp as limit_classnum, gen_user_id as inbox_count, gen_ip as outbox_count, gen_intdata as inbox_size, gen_chardata as outbox_size", "gen_type = 'pm_limit'"))
+	{
+		while($row = $sql->db_Fetch())
+		{
+			$limitList[$row['limit_classnum']] = $row;
+		}
+	}
+	$txt = "
+		<form method='post' action='".e_SELF."?".e_QUERY."'>
+		<table class='fborder' style='width:95%'>
+		<tr>
+			<td class='fcaption'>".ADLAN_PM_36."</td>
+			<td class='fcaption'>".ADLAN_PM_37."</td>
+			<td class='fcaption'>".ADLAN_PM_38."</td>
+		</tr>
+	";
+
+	$txt .= "
+	<tr>
+	<td class='forumheader3'>".r_userclass("newlimit_class", 0, "off", "guest, member, admin, classes, language")."</td>
+	<td class='forumheader3'>
+		".ADLAN_PM_39."<input type='text' class='tbox' size='5' name='new_inbox_count' value='' /> 
+		".ADLAN_PM_40."<input type='text' class='tbox' size='5' name='new_outbox_count' value='' /> 
+	</td>
+	<td class='forumheader3'>
+		".ADLAN_PM_39."<input type='text' class='tbox' size='5' name='new_inbox_size' value='' /> 
+		".ADLAN_PM_40."<input type='text' class='tbox' size='5' name='new_outbox_size' value='' /> 
+	</td>
+	</tr>
+	<tr>
+	<td class='forumheader' colspan='3' style='text-align:center'>
+	<input type='submit' class='button' name='addlimit' value='".ADLAN_PM_43."' />
+	</td>
+	</tr>
+	";
+
+	$txt .= "</table></form>";
+	return $txt;
+}
+
+function show_menu($action)
+{
+	global $sql;
+	if ($action == "") { $action = "main"; }
+	$var['main']['text'] = ADLAN_PM_54;
+	$var['main']['link'] = e_SELF;
+	$var['limits']['text'] = ADLAN_PM_55;
+	$var['limits']['link'] = e_SELF."?limits";
+	show_admin_menu(ADLAN_PM_12, $action, $var);
+}
+
+function pm_conf_adminmenu() {
+	global $action;
+	show_menu($action);
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm_default.php 75/e107_plugins/pm/pm_default.php
--- 6171/e107_plugins/pm/pm_default.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_default.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,25 @@
+<?php
+if (!defined('e107_INIT')) { exit; }
+
+function pm_set_default_prefs()
+{
+	$ret = array(
+		'title' 				=> 'PMLAN_PM',
+		'animate' 			=> '1',
+		'dropdown' 			=> '0',
+		'read_timeout' 	=> '0',
+		'unread_timeout'	=> '0',
+		'popup'				=> '0',
+		'popup_delay'		=> '',
+		'pm_class'			=> e_UC_MEMBER,
+		'notify_class'		=>	e_UC_ADMIN,
+		'receipt_class'	=> e_UC_MEMBER,
+		'attach_class'		=>	e_UC_ADMIN,
+		'attach_size'		=> 500,
+		'sendall_class'	=>	e_UC_ADMIN,
+		'multi_class'		=> e_UC_ADMIN,
+		'allow_userclass'	=> '1'
+	);
+	return $ret;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm_func.php 75/e107_plugins/pm/pm_func.php
--- 6171/e107_plugins/pm/pm_func.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_func.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,97 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm_func.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+function pm_getInfo($which = "inbox")
+{
+	static $pm_info;
+	global $sql, $pref, $pm_prefs;
+	if('clear' == $which)
+	{
+		unset($pm_info['inbox']);
+		unset($pm_info['outbox']);
+	}
+	if('inbox' == $which)
+	{
+		$qry = "SELECT count(pm.pm_id) AS total, SUM(pm.pm_size)/1024 size, SUM(pm.pm_read = 0) as unread FROM #private_msg as pm WHERE pm.pm_to = ".USERID." AND pm.pm_read_del = 0";
+	}
+	else
+	{
+		$qry = "SELECT count(pm.pm_from) AS total, SUM(pm.pm_size)/1024 size, SUM(pm.pm_read = 0) as unread FROM #private_msg as pm WHERE pm.pm_from = ".USERID." AND pm.pm_sent_del = 0";
+	}
+	if(!isset($pm_info[$which]['total']))
+	{
+		$sql->db_Select_gen($qry);
+		$pm_info[$which] = $sql->db_Fetch();
+		if($which == 'inbox' && $pm_prefs['animate'] == 1 || $pm_prefs['popup'] == 1)
+		{
+			if($new = $sql->db_Count("private_msg", "(*)", "WHERE pm_sent > '.USERLV.' AND pm_read = 0 AND pm_to = '".USERID."' AND pm_read_del != 1"))
+			{
+				$pm_info['inbox']['new'] = $new;
+			}
+		}
+	}
+	if(!isset($pm_info[$which]['limit']))
+	{
+		if($pref['pm_limits'] > 0)
+		{
+			if($pref['pm_limits'] == 1)
+			{
+				$qry = "SELECT MAX(gen_user_id) AS inbox_limit, MAX(gen_ip) as outbox_limit FROM #generic WHERE gen_type='pm_limit' AND gen_datestamp IN (".USERCLASS_LIST.")";
+			}
+			else
+			{
+				$qry = "SELECT MAX(gen_intdata) AS inbox_limit, MAX(gen_chardata) as outbox_limit FROM #generic WHERE gen_type='pm_limit' AND gen_datestamp IN (".USERCLASS_LIST.")";
+			}
+			if($sql->db_Select_gen($qry))
+			{
+				$row = $sql->db_Fetch();
+				$pm_info['inbox']['limit'] =  $row['inbox_limit'];
+				$pm_info['outbox']['limit'] =  $row['outbox_limit'];
+			}
+			$pm_info['inbox']['limit_val'] = ($pref['pm_limits'] == 1 ? $pm_info['inbox']['total'] : $pm_info['inbox']['size']);
+			if(!$pm_info['inbox']['limit'] || !$pm_info['inbox']['limit_val'])
+			{
+				$pm_info['inbox']['filled'] = 0;
+			}
+			else
+			{
+				$pm_info['inbox']['filled'] = number_format($pm_info['inbox']['limit_val']/$pm_info['inbox']['limit'] * 100, 2);
+			}
+			$pm_info['outbox']['limit_val'] = ($pref['pm_limits'] == 1 ? $pm_info['outbox']['total'] : $pm_info['outbox']['size']);
+			if(!$pm_info['outbox']['limit'] || !$pm_info['outbox']['limit_val'])
+			{
+				$pm_info['outbox']['filled'] = 0;
+			}
+			else
+			{
+				$pm_info['outbox']['filled'] = number_format($pm_info['outbox']['limit_val']/$pm_info['outbox']['limit'] * 100, 2);
+			}
+		}
+		else
+		{
+			$pm_info['inbox']['limit'] = "";
+			$pm_info['outbox']['limit'] = "";
+			$pm_info['inbox']['filled'] = "";
+			$pm_info['outbox']['filled'] = "";
+		}
+	}
+	return $pm_info;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm_notes.txt 75/e107_plugins/pm/pm_notes.txt
--- 6171/e107_plugins/pm/pm_notes.txt	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_notes.txt	2005-08-31 11:45:44.000000000 -0500
@@ -0,0 +1,17 @@
+pm_id
+pm_from
+pm_to
+pm_sent
+pm_read
+pm_subject
+pm_text
+pm_sent_del
+pm_read_del
+pm_attachments
+pm_options
+
+pm_block_id
+pm_block_from
+pm_block_to
+pm_block_datestamp
+pm_block_count
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm.php 75/e107_plugins/pm/pm.php
--- 6171/e107_plugins/pm/pm.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm.php	2006-03-24 11:55:46.000000000 -0600
@@ -0,0 +1,433 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm.php,v $
+|     $Revision: 1.20 $
+|     $Date: 2006/03/24 17:55:46 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+$retrieve_prefs[] = 'pm_prefs';
+require_once("../../class2.php");
+require_once(e_PLUGIN."pm/pm_class.php");
+require_once(e_PLUGIN."pm/pm_func.php");
+$lan_file = e_PLUGIN."pm/languages/".e_LANGUAGE.".php";
+include_once(is_readable($lan_file) ? $lan_file : e_PLUGIN."pm/languages/English.php");
+
+define("ATTACHMENT_ICON", "<img src='".e_PLUGIN."pm/images/attach.png' alt='' />");
+
+$qs = explode(".", e_QUERY);
+$action = $qs[0];
+if($action == "") { $action = 'inbox'; }
+$pm_prefs = $sysprefs->getArray("pm_prefs");
+
+if(!check_class($pm_prefs['pm_class']))
+{
+	require_once(HEADERF);
+	$ns->tablerender(LAN_PM, LAN_PM_12);
+	require_once(FOOTERF);
+	exit;
+}
+
+$pm =& new private_message;
+$message = "";
+$pm_prefs['perpage'] = intval($pm_prefs['perpage']);
+if($pm_prefs['perpage'] == 0)
+{
+	$pm_prefs['perpage'] = 10;
+}
+//Auto-delete message, if timeout set in admin
+$del_qry = array();
+$read_timeout = intval($pm_prefs['read_timeout']);
+$unread_timeout = intval($pm_prefs['unread_timeout']);
+if($read_timeout > 0)
+{
+	$timeout = time()-($read_timeout * 60);
+	$del_qry[] = "(pm_sent < {$timeout} AND pm_read > 0)";
+}
+if($unread_timeout > 0)
+{
+	$timeout = time()-($unread_timeout * 60);
+	$del_qry[] = "(pm_sent < {$timeout} AND pm_read = 0)";
+}
+if(count($del_qry) > 0)
+{
+	$qry = implode(" OR ", $del_qry);
+	if($sql->db_Select("private_msg", "pm_id", $qry))
+	{
+		$delList = $sql->db_getList();
+		foreach($delList as $p)
+		{
+			$pm->del($p['pm_id']);
+		}
+	}
+}
+
+if("del" == $action || isset($_POST['pm_delete_selected']))
+{
+	if(isset($_POST['pm_delete_selected']))
+	{
+		foreach(array_keys($_POST['selected_pm']) as $id)
+		{
+			$message .= LAN_PM_24.": $id <br />";
+			$message .= $pm->del($id);
+		}
+	}
+	if('del' == $action)
+	{
+		$message = $pm->del(intval($qs[1]));
+	}
+	if($qs[2] != "")
+	{
+		$action = $qs[2];
+	}
+	else
+	{
+		if(substr($_SERVER['HTTP_REFERER'], -5) == "inbox")
+		{
+			$action = "inbox";
+		}
+		if(substr($_SERVER['HTTP_REFERER'], -6) == "outbox")
+		{
+			$action = "outbox";
+		}
+	}
+	unset($qs);
+}
+
+if('block' == $action)
+{
+	$message = $pm->block_add(intval($qs[1]));
+	$action = 'inbox';
+}
+
+if('unblock' == $action)
+{
+	$message = $pm->block_del(intval($qs[1]));
+	$action = 'inbox';
+}
+
+if("get" == $action)
+{
+	$pm->send_file(intval($qs[1]), intval($qs[2]));
+	exit;
+}
+
+require_once(HEADERF);
+
+if(isset($_POST['postpm']))
+{
+	$message = post_pm();
+	$action = 'outbox';
+}
+
+if($message != "")
+{
+	$ns->tablerender("", $message);
+}
+
+if("send" == $action)
+{
+	$ns->tablerender(LAN_PM, show_send(intval($qs[1])));
+}
+
+if("reply" == $action)
+{
+	$pmid = intval($qs[1]);
+	if($pm_info = $pm->pm_get($pmid))
+	{
+		if($pm_info['pm_to'] != USERID)
+		{
+			$ns->tablerender(LAN_PM, LAN_PM_56);
+		}
+		else
+		{
+			$ns->tablerender(LAN_PM, show_send());
+		}
+	}
+	else
+	{
+		$ns->tablerender(LAN_PM, LAN_PM_57);
+	}
+}
+
+if("inbox" == $action)
+{
+	$ns->tablerender(LAN_PM." - ".LAN_PM_25, show_inbox(intval($qs[1])), "PM");
+}
+
+if("outbox" == $action)
+{
+	$ns->tablerender(LAN_PM." - ".LAN_PM_26, show_outbox(intval($qs[1])), "PM");
+}
+
+if("show" == $action)
+{
+	show_pm(intval($qs[1]));
+}
+
+require_once(FOOTERF);
+exit;
+
+function show_send($to_uid)
+{
+	global $tp, $pm_info;
+	$pm_outbox = pm_getInfo('outbox');
+	if($to_uid)
+	{
+		$sql2 =& new db;
+		if($sql2->db_Select('user', 'user_name', "user_id = '".intval($to_uid)."'"))
+		{
+			$row=$sql2->db_Fetch();
+			$pm_info['from_name'] = $row['user_name'];
+		}
+	}
+		
+	if($pm_outbox['outbox']['filled'] >= 100)
+	{
+		return str_replace('{PERCENT}', $pm_outbox['outbox']['filled'], LAN_PM_13);
+	}
+	require_once(e_PLUGIN."pm/pm_shortcodes.php");
+	$tpl_file = THEME."pm_template.php";
+	include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN."pm/pm_template.php");
+	$enc = (check_class($pm_prefs['attach_class']) ? "enctype='multipart/form-data'" : "");
+	$text = "<form {$enc} method='post' action='".e_SELF."' id='dataform' name='frmPMSend'>
+	<input type='hidden' name='numsent' value='{$pm_outbox['outbox']['total']}' />".
+	$tp->parseTemplate($PM_SEND_PM, TRUE, $pm_shortcodes).
+	"</form>";
+	return $text;
+}
+
+function show_inbox($start = 0)
+{
+	global $pm, $tp, $pm_shortcodes, $pm_info, $pm_blocks, $pmlist, $pm_start, $pm_prefs;
+	$pm_start = $start;
+	require_once(e_PLUGIN."pm/pm_shortcodes.php");
+	$tpl_file = THEME."pm_template.php";
+	include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN."pm/pm_template.php");
+	$pm_blocks = $pm->block_get();
+	$pmlist = $pm->pm_get_inbox(USERID, $pm_start, $pm_prefs['perpage']);
+	$txt = "<form method='post' action='".e_SELF."?".e_QUERY."'>";
+	$txt .= $tp->parseTemplate($PM_INBOX_HEADER, true, $pm_shortcodes);
+	if($pmlist['total_messages'])
+	{
+		foreach($pmlist['messages'] as $rec)
+		{
+			if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = "[".LAN_PM_61."]"; }
+			$pm_info = $rec;
+			$txt .= $tp->parseTemplate($PM_INBOX_TABLE, true, $pm_shortcodes);
+		}
+	}
+	else
+	{
+		$txt .= $tp->parseTemplate($PM_INBOX_EMPTY, true, $pm_shortcodes);
+	}
+	$txt .= $tp->parseTemplate($PM_INBOX_FOOTER, true, $pm_shortcodes);
+	$txt .= "</form>";
+	return $txt;
+}
+
+function show_outbox($start = 0)
+{
+	global $pm, $tp, $pm_shortcodes, $pm_info, $pm_start, $pm_prefs, $pmlist;
+	$pm_start = $start;
+	require_once(e_PLUGIN."pm/pm_shortcodes.php");
+	$tpl_file = THEME."pm_template.php";
+	include(is_readable($tpl_file) ? $tpl_file : e_PLUGIN."pm/pm_template.php");
+	$pmlist = $pm->pm_get_outbox(USERID, $pm_start, $pm_prefs['perpage']);
+	$txt = "<form method='post' action='".e_SELF."?".e_QUERY."'>";
+	$txt .= $tp->parseTemplate($PM_OUTBOX_HEADER, true, $pm_shortcodes);
+	if($pmlist['total_messages'])
+	{
+		foreach($pmlist['messages'] as $rec)
+		{
+			if(trim($rec['pm_subject']) == '') { $rec['pm_subject'] = "[".LAN_PM_61."]"; }
+			$pm_info = $rec;
+			$txt .= $tp->parseTemplate($PM_OUTBOX_TABLE, true, $pm_shortcodes);
+		}
+	}
+	else
+	{
+		$txt .= $tp->parseTemplate($PM_OUTBOX_EMPTY, true, $pm_shortcodes);
+	}
+	$txt .= $tp->parseTemplate($PM_OUTBOX_FOOTER, true, $pm_shortcodes);
+	$txt .= "</form>";
+	return $txt;
+}
+
+function show_pm($pmid)
+{
+	global $pm, $tp, $pm_shortcodes, $pm_info, $ns;
+	require_once(e_PLUGIN."pm/pm_shortcodes.php");
+	$tpl_file = THEME."pm_template.php";
+	include_once(is_readable($tpl_file) ? $tpl_file : e_PLUGIN."pm/pm_template.php");
+	$pm_info = $pm->pm_get($pmid);
+	if($pm_info['pm_to'] != USERID && $pm_info['pm_from'] != USERID)
+	{
+		$ns->tablerender(LAN_PM, LAN_PM_60);
+		require_once(FOOTERF);
+		exit;
+	}
+	if($pm_info['pm_read'] == 0 && $pm_info['pm_to'] == USERID)
+	{
+		$now = time();
+		$pm_info['pm_read'] = $now;
+		$pm->pm_mark_read($pmid, $pm_info);
+	}
+	$txt .= $tp->parseTemplate($PM_SHOW, true, $pm_shortcodes);
+	$ns -> tablerender(LAN_PM, $txt);
+	if($pm_info['pm_from'] == USERID) {
+		$ns->tablerender(LAN_PM." - ".LAN_PM_26, show_outbox(intval($qs[1])), "PM");
+	} 
+	else
+	{
+		$ns->tablerender(LAN_PM." - ".LAN_PM_25, show_inbox(intval($qs[1])), "PM");
+	}
+}
+
+function post_pm()
+{
+	global $pm_prefs, $pm, $pref, $sql, $tp;
+	if(!check_class($pm_prefs['pm_class']))
+	{
+		return LAN_PM_12;
+	}
+
+	$pm_info = pm_getInfo('outbox');
+	if($pm_info['outbox']['total'] != $_POST['numsent'])
+	{
+		return LAN_PM_14;
+	}
+
+	if(isset($_POST['user']))
+	{
+		$_POST['pm_to'] = $_POST['user'];
+	}
+	if(isset($_POST['pm_to']))
+	{
+		$msg = "";
+		if(isset($_POST['to_userclass']) && $_POST['to_userclass'])
+		{
+			if(!$pm_prefs['allow_userclass'])
+			{
+				return LAN_PM_15;
+			}
+			elseif(!check_class($_POST['pm_userclass']) && !ADMIN)
+			{
+				return LAN_PM_16;
+			}
+		}
+		else
+		{
+			$to_array = explode("\n", trim($_POST['pm_to']));
+			foreach($to_array as $k => $v)
+			{
+				$to_array[$k] = trim($v);
+			}
+			$to_array = array_unique($to_array);
+			if(count($to_array) == 1)
+			{
+				$_POST['pm_to'] = $to_array[0];
+			}
+			if(check_class($pm_prefs['multi_class']) && count($to_array) > 1)
+			{
+				foreach($to_array as $to)
+				{
+					if($to_info = $pm->pm_getuid($to))
+					{
+ 						if(!$sql->db_Update("private_msg_block","pm_block_count=pm_block_count+1 WHERE pm_block_from = '".USERID."' AND pm_block_to = '".$tp -> toDB($to)."'"))
+ 						{
+ 							$_POST['to_array'][] = $to_info;
+ 						}
+					}
+				}
+			}
+			else
+			{
+				if($to_info = $pm->pm_getuid($_POST['pm_to']))
+				{
+					$_POST['to_info'] = $to_info;
+				}
+				else
+				{
+					return LAN_PM_17;
+				}
+
+				if($sql->db_Update("private_msg_block","pm_block_count=pm_block_count+1 WHERE pm_block_from = '".USERID."' AND pm_block_to = '{$to_info['user_id']}'"))
+				{
+					return LAN_PM_18.$to_info['user_name'];
+				}
+			}
+		}
+
+		if(isset($_POST['receipt']))
+		{
+			if(!check_class($pm_prefs['receipt_class']))
+			{
+				unset($_POST['receipt']);
+			}
+		}
+		$totalsize = strlen($_POST['pm_message']);
+		$maxsize = intval($pm_prefs['attach_size']) * 1024;
+		foreach(array_keys($_FILES['file_userfile']['size']) as $fid)
+		{
+			if($maxsize > 0 && $_FILES['file_userfile']['size'][$fid] > $maxsize)
+			{
+				$msg .= str_replace("{FILENAME}", $_FILES['file_userfile']['name'][$fid], LAN_PM_62)."<br />";
+				$_FILES['file_userfile']['size'][$fid] = 0;
+			}
+			$totalsize += $_FILES['file_userfile']['size'][$fid];
+		}
+
+		if(intval($pref['pm_limit']) > 0)
+		{
+			if($pref['pm_limit'] == '1')
+			{
+				if($pm_info['outbox']['total'] == $pm_info['outbox']['limit'])
+				{
+					return LAN_PM_19;
+				}
+			}
+			else
+			{
+				if($pm_info['outbox']['size'] + $totalsize > $pm_info['outbox']['limit'])
+				{
+					return LAN_PM_21;
+				}
+			}
+		}
+
+		if($_FILES['file_userfile']['name'][0])
+		{
+			if(check_class($pm_prefs['attach_class']))
+			{
+				require_once(e_HANDLER."upload_handler.php");
+				$randnum = rand(1000, 9999);			
+				$_POST['uploaded'] = file_upload(e_PLUGIN."pm/attachments", "attachment", $randnum."_");
+				if($_POST['uploaded'] == FALSE)
+				{
+					unset($_POST['uploaded']);
+					$msg .= LAN_PM_22."<br />";
+				}
+			}
+			else
+			{
+				$msg .= LAN_PM_23."<br />";
+				unset($_POST['uploaded']);
+			}
+		}
+		$_POST['from_id'] = USERID;
+		return $msg.$pm->add($_POST);
+	}
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm_shortcodes.php 75/e107_plugins/pm/pm_shortcodes.php
--- 6171/e107_plugins/pm/pm_shortcodes.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_shortcodes.php	2006-03-05 00:04:02.000000000 -0600
@@ -0,0 +1,371 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm_shortcodes.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2006/03/05 06:04:02 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+include_once(e_HANDLER.'shortcode_handler.php');
+include_once(e_PLUGIN.'pm/pm_func.php');
+$pm_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
+
+/*
+SC_BEGIN FORM_TOUSER
+global $pm_prefs, $pm_info;
+if($pm_info['from_name'])
+{
+	return "<input type='hidden' name='pm_to' value='{$pm_info['from_name']}' />{$pm_info['from_name']}";
+}
+require_once(e_HANDLER."user_select_class.php");
+$us = new user_select;
+$type = ($pm_prefs['dropdown'] == TRUE ? 'list' : 'popup');
+if(check_class($pm_prefs['multi_class']))
+{
+	$ret = $us->select_form($type, 'textarea.pm_to');
+}
+else
+{
+	$ret = $us->select_form($type, 'pm_to');
+}
+return $ret;
+SC_END
+
+SC_BEGIN FORM_TOCLASS
+global $pm_prefs, $pm_info;
+if($pm_info['from_name'])
+{
+	return "";
+}
+if($pm_prefs['allow_userclass'])
+{
+	$ret = "<input type='checkbox' name='to_userclass' value='1' />".LAN_PM_4." ";
+	require_once(e_HANDLER."userclass_class.php");
+	$args = (ADMIN ? "admin, classes" : "matchclass");
+	if(check_class($pm_prefs['sendall_class']))
+	{
+		$args = "member, ".$args;
+	}
+	$ret .= r_userclass("pm_userclass", "", "off", $args);
+}
+return $ret;
+SC_END
+
+SC_BEGIN FORM_SUBJECT
+global $pm_info;
+$value = "";
+if($pm_info['pm_subject'])
+{
+	$value = $pm_info['pm_subject'];
+	if(substr($value, 0, strlen(LAN_PM_58)) != LAN_PM_58)
+	{
+		$value = LAN_PM_58.$value;
+	}
+}
+return "<input class='tbox' type='text' name='pm_subject' value='{$value}' size='63' maxlength='255' />";
+SC_END
+
+SC_BEGIN FORM_MESSAGE
+global $pm_info;
+$value = "";
+if($pm_info['pm_text'])
+{
+	if(isset($_POST['quote']))
+	{
+		$t = time();
+		$value = "[quote{$t}={$pm_info['from_name']}]\n{$pm_info['pm_text']}\n[/quote{$t}]\n\n";
+	}
+}
+return "<textarea class='tbox' name='pm_message' cols='60' rows='10' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>{$value}</textarea>";
+SC_END
+
+SC_BEGIN EMOTES
+require_once(e_HANDLER."emote.php");
+return r_emote();
+SC_END
+
+SC_BEGIN PM_POST_BUTTON
+return "<input class='button' type='submit' name='postpm' value='".LAN_PM_1."' />";
+SC_END
+
+SC_BEGIN PM_PREVIEW_BUTTON
+return "<input class='button' type='submit' name='postpm' value='".LAN_PM_3."' />";
+SC_END
+
+SC_BEGIN ATTACHMENT
+global $pm_prefs;
+if (check_class($pm_prefs['attach_class']))
+{
+	$ret = "
+	<div id='up_container' >
+	<span id='upline' style='white-space:nowrap'>
+	<input class='tbox' type='file' name='file_userfile[]' size='40' />
+	</span>
+	</div>
+	<input type='button' class='button' value='".LAN_PM_11."' onclick=\"duplicateHTML('upline','up_container');\"  />
+	";
+	return $ret;
+}
+return "";
+SC_END
+
+SC_BEGIN PM_ATTACHMENT_ICON
+global $pm_info;
+if($pm_info['pm_attachments'] != "")
+{
+	return ATTACHMENT_ICON;
+}
+SC_END
+
+SC_BEGIN PM_ATTACHMENTS
+global $pm_info;
+if($pm_info['pm_attachments'] != "")
+{
+	$attachments = explode(chr(0), $pm_info['pm_attachments']);
+	$i = 0;
+	foreach($attachments as $a)
+	{
+		list($timestamp, $fromid, $rand, $filename) = explode("_", $a, 4);
+		$ret .= "<a href='".e_SELF."?get.{$pm_info['pm_id']}.{$i}'>{$filename}</a><br />";
+		$i++;
+	}
+	$ret = substr($ret, 0, -3);
+	return $ret;
+}
+SC_END
+
+SC_BEGIN RECEIPT
+global $pm_prefs;
+if (check_class($pm_prefs['receipt_class']))
+{
+	return "<input type='checkbox' name='receipt' value='1' />".LAN_PM_10;
+}
+return "";
+SC_END
+
+SC_BEGIN INBOX_TOTAL
+$pm_inbox = pm_getInfo('inbox');
+return $pm_inbox['inbox']['total'];
+SC_END
+
+SC_BEGIN INBOX_UNREAD
+$pm_inbox = pm_getInfo('inbox');
+return intval($pm_inbox['inbox']['unread']);
+SC_END
+
+SC_BEGIN INBOX_FILLED
+$pm_inbox = pm_getInfo('inbox');
+return $pm_inbox['inbox']['filled'];
+SC_END
+
+SC_BEGIN OUTBOX_TOTAL
+$pm_outbox = pm_getInfo('outbox');
+return $pm_outbox['outbox']['total'];
+SC_END
+
+SC_BEGIN OUTBOX_UNREAD
+$pm_outbox = pm_getInfo('outbox');
+return intval($pm_outbox['outbox']['unread']);
+SC_END
+
+SC_BEGIN OUTBOX_FILLED
+$pm_outbox = pm_getInfo('outbox');
+return $pm_outbox['outbox']['filled'];
+SC_END
+
+SC_BEGIN PM_DATE
+global $pm_info;
+require_once(e_HANDLER."date_handler.php");
+if("lapse" != $parm)
+{
+	return convert::convert_date($pm_info['pm_sent'], $parm);
+}
+else
+{
+	return convert::computeLapse($pm_info['pm_sent']);
+}
+SC_END
+
+SC_BEGIN PM_READ
+global $pm_info;
+if($pm_info['pm_read'] == 0)
+{
+	return LAN_PM_27;
+}
+if($pm_info['pm_read'] == 1)
+{
+	return LAN_PM_28;
+}
+require_once(e_HANDLER."date_handler.php");
+if("lapse" != $parm)
+{
+	return convert::convert_date($pm_info['pm_read'], $parm);
+}
+else
+{
+	return convert::computeLapse($pm_info['pm_read']);
+}
+SC_END
+
+
+SC_BEGIN PM_FROM_TO
+global $pm_info, $tp;
+if($pm_info['pm_from'] == USERID)
+{
+	$ret = LAN_PM_2.": <br />";
+	$pm_info['user_name'] = $pm_info['sent_name'];
+	$ret .= $tp->parseTemplate("{PM_TO=link}");
+}
+else
+{
+	$ret = LAN_PM_31.": <br />";
+	$pm_info['user_name'] = $pm_info['from_name'];
+	$ret .= $tp->parseTemplate("{PM_FROM=link}");
+}
+return $ret;
+SC_END
+
+SC_BEGIN PM_SUBJECT
+global $pm_info, $tp;
+$ret = $tp->toHTML($pm_info['pm_subject'], true, 'no_make_clickable');
+if('link' == $parm)
+{
+	$ret = "<a href='".e_PLUGIN_ABS."pm/pm.php?show.{$pm_info['pm_id']}'>".$ret."</a>";
+}
+return $ret;
+SC_END
+
+SC_BEGIN PM_FROM
+global $pm_info;
+if("link" == $parm)
+{
+	return "<a href='".e_BASE."user.php?id.{$pm_info['pm_from']}'>{$pm_info['user_name']}</a>";
+}
+else
+{
+	return $pm_info['user_name'];
+}
+SC_END
+
+SC_BEGIN PM_SELECT
+global $pm_info;
+return "<input type='checkbox' name='selected_pm[{$pm_info['pm_id']}]' value='1' />";
+SC_END
+
+SC_BEGIN PM_READ_ICON
+global $pm_info;
+if($pm_info['pm_read'] > 0 )
+{
+	return PM_READ_ICON;
+}
+else
+{
+	return PM_UNREAD_ICON;
+}
+SC_END
+
+SC_BEGIN PM_AVATAR
+global $pm_info, $tp;
+return $tp->parseTemplate("{USER_AVATAR={$pm_info['user_image']}}");
+SC_END
+
+SC_BEGIN PM_BLOCK_USER
+global $pm_info, $pm_blocks;
+if(in_array($pm_info['pm_from'], $pm_blocks))
+{
+	return "<a href='".e_PLUGIN_ABS."pm/pm.php?unblock.{$pm_info['pm_from']}'><img src='".e_PLUGIN_ABS."pm/images/mail_unblock.png' title='".LAN_PM_51."' alt='".LAN_PM_51."' style='width: 16px; height: 16px; border: 0px' /></a>";
+}
+else
+{
+	return "<a href='".e_PLUGIN_ABS."pm/pm.php?block.{$pm_info['pm_from']}'><img src='".e_PLUGIN_ABS."pm/images/mail_block.png' title='".LAN_PM_50."' alt='".LAN_PM_50."' style='width: 16px; height: 16px; border: 0px' /></a>";
+}
+SC_END
+
+SC_BEGIN PM_DELETE
+global $pm_info;
+$extra = $parm != "" ? ".{$parm}" : "";
+return "<a href='".e_PLUGIN_ABS."pm/pm.php?del.{$pm_info['pm_id']}{$extra}'><img src='".e_PLUGIN_ABS."pm/images/mail_delete.png' title='".LAN_PM_52."' alt='".LAN_PM_52."' style='width: 16px; height: 16px; border: 0px' /></a>";
+SC_END
+
+SC_BEGIN DELETE_SELECTED
+global $pm_info;
+return "<input type='submit' name='pm_delete_selected' class='button' value='".LAN_PM_53."' />";
+SC_END
+
+SC_BEGIN PM_TO
+global $pm_info;
+if(is_numeric($pm_info['pm_to']))
+{
+	if("link" == $parm)
+	{
+		return "<a href='".e_BASE."user.php?id.{$pm_info['pm_to']}'>{$pm_info['user_name']}</a>";
+	}
+	else
+	{
+		return $pm_info['user_name'];
+	}
+}
+else
+{
+	return "class: ".$pm_info['pm_to'];
+}
+SC_END
+
+SC_BEGIN PM_MESSAGE
+global $pm_info, $tp;
+return $tp->toHTML($pm_info['pm_text'], true);
+SC_END
+
+SC_BEGIN PM_REPLY
+global $pm_info;
+if($pm_info['pm_to'] == USERID)
+{
+	$ret = "
+	<form method='post' action='".e_SELF."?reply.{$pm_info['pm_id']}'>
+	<input type='checkbox' name='quote' /> ".LAN_PM_54." &nbsp;&nbsp;&nbsp<input class='button' type='submit' name='reply' value='".LAN_PM_55."' />
+	</form>
+	";
+	return $ret;
+}
+SC_END
+
+SC_BEGIN SEND_PM_LINK
+$pm_outbox = pm_getInfo('outbox');
+if($pm_outbox['outbox']['filled'] < 100)
+{
+	return "<a href='".e_PLUGIN_ABS."pm/pm.php?send'>".PM_SEND_LINK."</a>";
+}
+return "";
+SC_END
+
+SC_BEGIN NEWPM_ANIMATE
+global $pm_prefs, $pm_inbox;
+if($pm_prefs['animate'])
+{
+	$pm_inbox = pm_getInfo('inbox');
+	if($pm_inbox['inbox']['new'] > 0)
+	{
+		return NEWPM_ANIMATION;
+	}
+}
+return "";
+SC_END
+
+SC_BEGIN PM_NEXTPREV
+global $pmlist, $tp, $pm_start, $pm_prefs, $pmlist;
+return $tp->parseTemplate("{NEXTPREV={$pmlist['total_messages']},{$pm_prefs['perpage']},{$pm_start},".e_SELF."?{$parm}.[FROM]}");
+SC_END
+
+*/
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm_sql.php 75/e107_plugins/pm/pm_sql.php
--- 6171/e107_plugins/pm/pm_sql.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_sql.php	2006-02-26 11:21:45.000000000 -0600
@@ -0,0 +1,24 @@
+CREATE TABLE private_msg (
+  pm_id int(10) unsigned NOT NULL auto_increment,
+  pm_from int(10) unsigned NOT NULL default '0',
+  pm_to varchar(250) NOT NULL default '',
+  pm_sent int(10) unsigned NOT NULL default '0',
+  pm_read int(10) unsigned NOT NULL default '0',
+  pm_subject text NOT NULL,
+  pm_text text NOT NULL,
+  pm_sent_del tinyint(1) unsigned NOT NULL default '0',
+  pm_read_del tinyint(1) unsigned NOT NULL default '0',
+  pm_attachments text NOT NULL,
+  pm_option varchar(250) NOT NULL default '',
+  pm_size int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (pm_id)
+) TYPE=MyISAM AUTO_INCREMENT=1 ;
+
+CREATE TABLE private_msg_block (
+  pm_block_id int(10) unsigned NOT NULL auto_increment,
+  pm_block_from int(10) unsigned NOT NULL default '0',
+  pm_block_to int(10) unsigned NOT NULL default '0',
+  pm_block_datestamp int(10) unsigned NOT NULL default '0',
+  pm_block_count int(10) unsigned NOT NULL default '0',
+  PRIMARY KEY  (pm_block_id)
+) TYPE=MyISAM AUTO_INCREMENT=1 ;
diff -ruN 6171/e107_plugins/pm/pm_template.php 75/e107_plugins/pm/pm_template.php
--- 6171/e107_plugins/pm/pm_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,194 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm_template.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style;
+
+define("PM_READ_ICON", "<img src='".e_PLUGIN."/pm/images/read.png' style='height:16;width:16;border:0' />");
+define("PM_UNREAD_ICON", "<img src='".e_PLUGIN."/pm/images/unread.png' style='height:16;width:16;border:0' />");
+
+$sc_style['PM_ATTACHMENT_ICON']['pre'] = " ";
+
+$sc_style['PM_ATTACHMENTS']['pre'] = "<br /><div style='vertical-align:bottom; text-align:left;'>";
+$sc_style['PM_ATTACHMENTS']['post'] = "</div>";
+
+$sc_style['PM_NEXTPREV']['pre'] = "<tr><td class='forumheader' colspan='6' style='text-align:left'> ".LAN_PM_59;
+$sc_style['PM_NEXTPREV']['post'] = "</td></tr>";
+
+$sc_style['EMOTES']['pre'] = "
+<tr>
+	<td class='forumheader3'>".LAN_PM_7.": </td>
+	<td class='forumheader3'>
+";
+$sc_style['EMOTES']['post'] = "</td></tr>";
+
+$sc_style['ATTACHMENT']['pre'] = "
+<tr>
+	<td class='forumheader3'>".LAN_PM_8.": </td>
+	<td class='forumheader3'>
+";
+$sc_style['ATTACHMENT']['post'] = "</td></tr>";
+
+$sc_style['RECEIPT']['pre'] = "
+<tr>
+	<td class='forumheader3'>".LAN_PM_9.": </td>
+	<td class='forumheader3'>
+";
+$sc_style['RECEIPT']['post'] = "</td></tr>";
+
+$sc_style['PM_REPLY']['pre'] = "<tr>
+	<td class='forumheader' style='text-align:center' colspan='2'>
+";
+	
+$sc_style['PM_REPLY']['post'] = "</td>
+	</tr>
+";
+
+$PM_SEND_PM = "<div style='text-align: center'>
+<table style='width:95%' class='fborder'>
+<tr>
+	<td colspan='2' class='fcaption'>".LAN_PM_1.": </td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width: 30%'>".LAN_PM_2.": </td>
+	<td class='forumheader3' style='width: 70%; text-align:left'>{FORM_TOUSER}<br />{FORM_TOCLASS}</td>
+</tr>
+<tr>
+	<td class='forumheader3'>".LAN_PM_5.": </td>
+	<td class='forumheader3'>{FORM_SUBJECT}</td>
+</tr>
+<tr>
+	<td class='forumheader3'>".LAN_PM_6.": </td>
+	<td class='forumheader3'>{FORM_MESSAGE}</td>
+</tr>
+{EMOTES}
+{ATTACHMENT}
+{RECEIPT}
+<tr>
+	<td class='forumheader' colspan='2' style='text-align:center;'>{PM_POST_BUTTON}</td>
+</tr>
+</table>
+</div>
+";
+
+$PM_INBOX_HEADER = "
+<table class='fborder' style='width:95%'>
+<tr>
+	<td class='fcaption' style='width:1%'>&nbsp;</td>
+	<td class='fcaption' style='width:1%'>&nbsp;</td>
+	<td class='fcaption' style='width:38%'>".LAN_PM_5."</td>
+	<td class='fcaption' style='width:22%'>".LAN_PM_31."</td>
+	<td class='fcaption' style='width:30%'>".LAN_PM_32."</td>
+	<td class='fcaption' style='width:8%'>&nbsp;</td>
+</tr>
+";
+
+$PM_INBOX_TABLE = "
+<tr>
+	<td class='forumheader3'>{PM_SELECT}</td>
+	<td class='forumheader3'>{PM_READ_ICON}</td>
+	<td class='forumheader3'>{PM_SUBJECT=link}{PM_ATTACHMENT_ICON}</td>
+	<td class='forumheader3'>{PM_FROM=link}</td>
+	<td class='forumheader3'>{PM_DATE}</td>
+	<td class='forumheader3' style='text-align: center; white-space: nowrap'>{PM_DELETE=inbox}&nbsp;{PM_BLOCK_USER}</td>
+</tr>
+";
+
+$PM_INBOX_EMPTY = "
+<tr>
+	<td colspan='6' class='forumheader'>".LAN_PM_34."</td>
+</tr>
+";
+
+$PM_INBOX_FOOTER = "
+<tr>
+	<td class='forumheader' colspan='6' style='text-align:center'>
+	{DELETE_SELECTED}
+	</td>
+</tr>
+{PM_NEXTPREV=inbox}
+</table>
+";
+
+$PM_OUTBOX_HEADER = "
+<table class='fborder' style='width:95%'>
+<tr>
+	<td class='fcaption' style='width:1%'>&nbsp;</td>
+	<td class='fcaption' style='width:1%'>&nbsp;</td>
+	<td class='fcaption' style='width:38%'>".LAN_PM_5."</td>
+	<td class='fcaption' style='width:22%'>".LAN_PM_2."</td>
+	<td class='fcaption' style='width:30%'>".LAN_PM_33."</td>
+	<td class='fcaption' style='width:8%'>&nbsp;</td>
+</tr>
+";
+
+$PM_OUTBOX_TABLE = "
+<tr>
+	<td class='forumheader3'>{PM_SELECT}</td>
+	<td class='forumheader3'>{PM_READ_ICON}</td>
+	<td class='forumheader3'>{PM_SUBJECT=link}{PM_ATTACHMENT_ICON}</td>
+		<td class='forumheader3'>{PM_TO=link}</td>
+	<td class='forumheader3'>{PM_DATE}</td>
+	<td class='forumheader3' style='text-align: center'>{PM_DELETE=outbox}</td>
+</tr>
+";
+
+$PM_OUTBOX_EMPTY = "
+<tr>
+	<td colspan='6' class='forumheader'>".LAN_PM_34."</td>
+</tr>
+";
+
+$PM_OUTBOX_FOOTER = "
+<tr>
+	<td class='forumheader' colspan='6' style='text-align:center'>
+	{DELETE_SELECTED}
+	</td>
+</tr>
+{PM_NEXTPREV=outbox}
+</table>
+";
+
+$PM_SHOW =
+"<div style='text-align: center'>
+<table class='fborder' style='width:95%'>
+<tr>
+	<td class='fcaption' colspan='2'>{PM_SUBJECT}</td>
+</tr>
+<tr>
+	<td class='forumheader3' style='width:20%;vertical-align:top'>
+		{PM_FROM_TO}
+		<br />
+		<br />
+		<span class='smalltext'>".LAN_PM_29.":<br />{PM_DATE}</span>
+		<br />
+		<br />
+		<span class='smalltext'>".LAN_PM_30.":<br />{PM_READ}</span>
+		<br />
+		<br />
+		{PM_DELETE}
+	</td>
+	<td class='forumheader3' style='width:80%;vertical-align:top'>{PM_MESSAGE}<br /><br />{PM_ATTACHMENTS}</td>
+</tr>
+{PM_REPLY}
+</table>
+</div>
+";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm_update_check.php 75/e107_plugins/pm/pm_update_check.php
--- 6171/e107_plugins/pm/pm_update_check.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_update_check.php	2006-01-09 11:02:16.000000000 -0600
@@ -0,0 +1,39 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm_update_check.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2006/01/09 17:02:16 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+$dbupdatep['pm_07'] =  LAN_UPDATE_8." .617 private messenger ".LAN_UPDATE_9." .7 private messenger";
+function update_pm_07($type) {
+	global $sql, $mySQLdefaultdb;
+	if ($type == 'do') {
+			include_once(e_PLUGIN.'pm/pm_update.php');
+	} else {
+		if ($sql -> db_Select("plugin", "*", "plugin_path = 'pm_menu' AND plugin_installflag='1'")) {
+			 if ($sql -> db_Count('pm_messages', '(*)')) {
+				return FALSE;
+			} else {
+				return TRUE;
+			}
+		} else {
+			return TRUE;
+		}
+	}
+}
+
+?>		
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/pm_update.php 75/e107_plugins/pm/pm_update.php
--- 6171/e107_plugins/pm/pm_update.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/pm_update.php	2006-02-23 09:37:19.000000000 -0600
@@ -0,0 +1,113 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/pm_update.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2006/02/23 15:37:19 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+set_time_limit(300);
+
+@include_once(e_PLUGIN."pm/languages/admin/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."pm/languages/admin/English.php");
+
+$sql->db_Update("plugin", "plugin_name=".ADLAN_PM." WHERE plugin_path='pm'");
+
+require_once(e_HANDLER.'plugin_class.php');
+$plugin = new e107plugin;
+
+$sql -> db_Select_gen("
+CREATE TABLE ".MPREFIX."private_msg (
+pm_id int(10) unsigned NOT NULL auto_increment,
+pm_from int(10) unsigned NOT NULL default '0',
+pm_to varchar(250) NOT NULL default '',
+pm_sent int(10) unsigned NOT NULL default '0',
+pm_read int(10) unsigned NOT NULL default '0',
+pm_subject text NOT NULL,
+pm_text text NOT NULL,
+pm_sent_del tinyint(1) unsigned NOT NULL default '0',
+pm_read_del tinyint(1) unsigned NOT NULL default '0',
+pm_attachments text NOT NULL,
+pm_option varchar(250) NOT NULL default '',
+pm_size int(10) unsigned NOT NULL default '0',
+PRIMARY KEY  (pm_id)
+) TYPE=MyISAM AUTO_INCREMENT=1 ;");
+			
+$sql -> db_Select_gen("
+CREATE TABLE ".MPREFIX."private_msg_block (
+pm_block_id int(10) unsigned NOT NULL auto_increment,
+pm_block_from int(10) unsigned NOT NULL default '0',
+pm_block_to int(10) unsigned NOT NULL default '0',
+pm_block_datestamp int(10) unsigned NOT NULL default '0',
+pm_block_count int(10) unsigned NOT NULL default '0',
+PRIMARY KEY  (pm_block_id)
+) TYPE=MyISAM AUTO_INCREMENT=1 ;");
+
+$plugin -> manage_plugin_prefs('add', 'plug_sc', 'pm', 'SENDPM');
+
+pm_convert();
+
+function pm_convert()
+{
+	global $sql, $uinfo;
+	$sql2 =& new db;
+	$count = 0;
+	if($sql->db_Select("pm_messages","*"))
+	{
+		while($row = $sql->db_Fetch())
+		{
+			$from = pm_convert_uid($row['pm_from_user']);
+			$to = pm_convert_uid($row['pm_to_user']);
+			$size = strlen($row['pm_message']);
+			if($sql2->db_Insert("private_msg", "0, '".intval($from)."', '{$to}', '".intval($row['pm_sent_datestamp'])."', '".intval($row['pm_rcv_datestamp'])."', '{$row['pm_subject']}', '{$row['pm_message']}', '0', '0', '', '', '".intval($size)."'"))
+			{
+				//Insertion of new PM successful, delete old
+				$sql2->db_Delete("pm_messages", "pm_id='{$row['pm_id']}'");
+				$count++;
+			}
+		}
+	}
+}
+
+function pm_convert_uid($name)
+{
+	global $uinfo, $tp;
+	$sqlu =& new db;
+	$name = trim($name);
+	if(!array_key_exists($uinfo[$name]))
+	{
+		if($sqlu->db_Select("user", "user_id", "user_name LIKE '".$tp -> todb($name, TRUE)."'"))
+		{
+			$row = $sqlu->db_Fetch();
+			$uinfo[$name] = $row['user_id'];
+		}
+		else
+		{
+			if($sqlu->db_Select("user", "user_id", "user_loginname LIKE '".$tp -> todb($name, TRUE)."'"))
+			{
+				$row = $sqlu->db_Fetch();
+				$uinfo[$name] = $row['user_id'];
+			}
+			else
+			{
+				return FALSE;
+			}
+		}
+	}
+	return $uinfo[$name];
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/private_msg_menu.php 75/e107_plugins/pm/private_msg_menu.php
--- 6171/e107_plugins/pm/private_msg_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/private_msg_menu.php	2006-01-22 09:38:08.000000000 -0600
@@ -0,0 +1,113 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/pm/private_msg_menu.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2006/01/22 15:38:08 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $sysprefs, $pref, $pm_prefs;
+if(!isset($pm_prefs['perpage']))
+{
+	$pm_prefs = $sysprefs->getArray("pm_prefs");
+}
+require_once(e_PLUGIN."pm/pm_func.php");
+pm_getInfo('clear');
+
+define("PM_INBOX_ICON", "<img src='".e_PLUGIN."pm/images/mail_get.png' style='height:16;width:16;border:0' alt='".LAN_PM_25."' title='".LAN_PM_25."' />");
+define("PM_OUTBOX_ICON", "<img src='".e_PLUGIN."pm/images/mail_send.png' style='height:16;width:16;border:0' alt='".LAN_PM_26."' title='".LAN_PM_26."' />");
+define("PM_SEND_LINK", LAN_PM_35);
+define("NEWPM_ANIMATION", "<img src='".e_PLUGIN."pm/images/newpm.gif' alt='' style='border:0' />");
+
+$sc_style['SEND_PM_LINK']['pre'] = "<br /><br />[ ";
+$sc_style['SEND_PM_LINK']['post'] = " ]";
+
+$sc_style['INBOX_FILLED']['pre'] = "[";
+$sc_style['INBOX_FILLED']['post'] = "%]";
+
+$sc_style['OUTBOX_FILLED']['pre'] = "[";
+$sc_style['OUTBOX_FILLED']['post'] = "%]";
+
+$sc_style['NEWPM_ANIMATE']['pre'] = "<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>";
+$sc_style['NEWPM_ANIMATE']['post'] = "</a>";
+
+
+if(!defined($pm_menu_template))
+{
+	$pm_menu_template = "
+	<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>".PM_INBOX_ICON."</a>
+	<a href='".e_PLUGIN_ABS."pm/pm.php?inbox'>".LAN_PM_25."</a>
+	{NEWPM_ANIMATE}
+	<br />
+	{INBOX_TOTAL} ".LAN_PM_36.", {INBOX_UNREAD} ".LAN_PM_37." {INBOX_FILLED}
+	<br />
+	<a href='".e_PLUGIN_ABS."pm/pm.php?outbox'>".PM_OUTBOX_ICON."</a>
+	<a href='".e_PLUGIN_ABS."pm/pm.php?outbox'>".LAN_PM_26."</a><br />
+	{OUTBOX_TOTAL} ".LAN_PM_36.", {OUTBOX_UNREAD} ".LAN_PM_37." {OUTBOX_FILLED}
+	{SEND_PM_LINK}
+	";
+}
+
+if(check_class($pm_prefs['pm_class']))
+{
+	global $tp, $pm_inbox;
+	$pm_inbox = pm_getInfo('inbox');
+	require_once(e_PLUGIN."pm/pm_shortcodes.php");
+	$txt = $tp->parseTemplate($pm_menu_template, TRUE, $pm_shortcodes);
+	if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, "pm.php") === FALSE && $_COOKIE["pm-alert"] != "ON")
+	{
+		$txt .= pm_show_popup();
+	}
+	$ns->tablerender(LAN_PM, $txt, 'pm');
+}
+
+function pm_show_popup()
+{
+	global $pm_inbox, $pm_prefs;
+	$alertdelay = intval($pm_prefs['popup_delay']);
+	if($alertdelay == 0) { $alertdalay = 60; }
+	setcookie("pm-alert", "ON", time()+$alertdelay);
+	$popuptext = "
+	<html>
+		<head>
+			<title>".$pm_inbox['inbox']['new']." ".LAN_PM_109."</title>
+			<link rel=stylesheet href=" . THEME . "style.css>
+		</head>
+		<body style=\'padding-left:2px;padding-right:2px;padding:2px;padding-bottom:2px;margin:0px;text-align:center\' marginheight=0 marginleft=0 topmargin=0 leftmargin=0>
+		<table style=\'width:100%;text-align:center;height:99%;padding-bottom:2px\' class=\'bodytable\'>
+			<tr>
+				<td width=100% >
+					<center><b>--- ".LAN_PM." ---</b><br />".$pm_inbox['inbox']['new']." ".LAN_PM_109."<br />".$pm_inbox['inbox']['unread']." ".LAN_PM_37."<br /><br />
+					<form>
+						<input class=\'button\' type=\'submit\' onclick=\'self.close();\' value = \'".LAN_PM_110."\' />
+					</form>
+					</center>
+				</td>
+			</tr>
+		</table>
+		</body>
+	</html> ";
+	$popuptext = str_replace("\n", "", $popuptext);
+	$popuptext = str_replace("\t", "", $popuptext);
+	$text .= "
+	<script type='text/javascript'>
+	winl=(screen.width-200)/2;
+	wint = (screen.height-100)/2;
+	winProp = 'width=200,height=100,left='+winl+',top='+wint+',scrollbars=no';
+	window.open('javascript:document.write(\"".$popuptext."\");', \"pm_popup\", winProp);
+	</script >";
+	return $text;
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm/sendpm.sc 75/e107_plugins/pm/sendpm.sc
--- 6171/e107_plugins/pm/sendpm.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/pm/sendpm.sc	2005-10-11 09:53:29.000000000 -0500
@@ -0,0 +1,20 @@
+@include_once(e_PLUGIN."pm/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."pm/languages/English.php");
+global $sysprefs, $pm_prefs;
+$pm_prefs = $sysprefs->getArray("pm_prefs");
+if(check_class($pm_prefs['pm_class']))
+{
+	if(file_exists(THEME."forum/pm.png"))
+	{
+		$img = "<img src='".THEME."forum/pm.png' alt='".LAN_PM."' title='".LAN_PM."' style='border:0' />";
+	}
+	else
+	{
+		$img = "<img src='".e_PLUGIN."pm/images/pm.png' alt='".LAN_PM."' title='".LAN_PM."' style='border:0' />";
+	}
+	return  "<a href='".e_PLUGIN."pm/pm.php?send.{$parm}'>{$img}</a>";
+}
+else
+{
+	return "";
+}
diff -ruN 6171/e107_plugins/pm_menu/help.php 75/e107_plugins/pm_menu/help.php
--- 6171/e107_plugins/pm_menu/help.php	2004-05-10 04:17:52.000000000 -0500
+++ 75/e107_plugins/pm_menu/help.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,15 +0,0 @@
-<?php
-$text = "
-<b>&raquo;</b> <u>Plugin Title:</u>
-Sets title displayed in the menu caption.  Set it to PMLAN_PM to use the language file.
-<br /><br />
-<b>&raquo;</b> <u>Restrict PM to:</u>
-Allows you to restrict the use of the PM system.
-<br />As userclasses are added to the system, this list will auto-populate.  The 'Everyone' and 
-'Members only' options have the same functionality.
-<br /><br />
-<b>&raquo;</b> <u>Send email notifications:</u>
-If set to yes, it will email the recipient of a PM that a PM has been delivered.
-";
-$ns -> tablerender("PM Help", $text);
-?>
\ No newline at end of file
Files 6171/e107_plugins/pm_menu/images/icon_pm.png and 75/e107_plugins/pm_menu/images/icon_pm.png differ
Files 6171/e107_plugins/pm_menu/images/newpm.gif and 75/e107_plugins/pm_menu/images/newpm.gif differ
Files 6171/e107_plugins/pm_menu/images/new.png and 75/e107_plugins/pm_menu/images/new.png differ
Files 6171/e107_plugins/pm_menu/images/nonew.png and 75/e107_plugins/pm_menu/images/nonew.png differ
diff -ruN 6171/e107_plugins/pm_menu/languages/admin/Dutch.php 75/e107_plugins/pm_menu/languages/admin/Dutch.php
--- 6171/e107_plugins/pm_menu/languages/admin/Dutch.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/admin/Dutch.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,40 +0,0 @@
-<?php
-define(PM_ADLAN_1,"PB Instel opties");
-define(PM_ADLAN_2,"PB Beheer functies");
-define(PM_ADLAN_3,"Wijzigen PB instelligen");
-define(PM_ADLAN_4,"Selecteer gebruiker");
-define(PM_ADLAN_5,"ALLE berichten verwijderd");
-define(PM_ADLAN_6,"Berichten aan/van");
-define(PM_ADLAN_7,"verwijderd");
-define(PM_ADLAN_8,"Berichten ouder dan ");
-define(PM_ADLAN_9,"dagen ");
-define(PM_ADLAN_10,"Hiermee worden ALLE berichten ouder dan ");
-define(PM_ADLAN_11,"Bevestig verwijderen");
-define(PM_ADLAN_12,"Annuleren");
-define(PM_ADLAN_13,"geef eerst een waarde op.");
-define(PM_ADLAN_14,"Verwijder berichten");
-define(PM_ADLAN_15,"Hiermee worden ALLE berichten verwijderd van of aan gebruiker: ");
-define(PM_ADLAN_16,"Selecteer eerst een gebruiker.");
-define(PM_ADLAN_17,"Verwijder berichten vaan / aan gebruiker");
-define(PM_ADLAN_18,"Hiermee worden ALLE persoonlijke berichten verwijderd, gelezen of niet!");
-define(PM_ADLAN_19,"Verwijder ALLE berichten");
-define(PM_ADLAN_20,"PM instellingen aangepast");
-define(PM_ADLAN_21,"Plugin titel");
-define(PM_ADLAN_22,"Toon nieuwe PM animatie");
-define(PM_ADLAN_23,"Toon gebruiker overzicht");
-define(PM_ADLAN_24,"Automatisch verwijderen gelezen berichten");
-define(PM_ADLAN_25,"LEES bericht vervalperiode");
-define(PM_ADLAN_26,"ONGELEZEN bericht vervalperiode");
-define(PM_ADLAN_27,"Popup melding bij nieuw PB");
-define(PM_ADLAN_28,"Popup vertragingstijd");
-define(PM_ADLAN_29,"Beperk PB tot");
-define(PM_ADLAN_30,"Alle geregistreerde leden");
-define(PM_ADLAN_31,"Gebuikersklasse");
-define(PM_ADLAN_32,"Verwijder berichten ouder dan");
-define(PM_ADLAN_33,"Ja");
-define(PM_ADLAN_34,"Nee");
-define(PM_ADLAN_35,"Verstuur e-mail melding");
-define(PM_ADLAN_36,"Aankruisen om bewerking te bevestigen");
-define(PM_ADLAN_37,"berichten in het systeem");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/admin/English.php 75/e107_plugins/pm_menu/languages/admin/English.php
--- 6171/e107_plugins/pm_menu/languages/admin/English.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/admin/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,52 +0,0 @@
-<?php
-
-define(PMLAN_PM,"Private Message");
-define(PM_ADLAN_PM,"Private Messaging");
-define(PM_ADLAN_1,"PM Config Options");
-define(PM_ADLAN_2,"PM Admin Functions");
-define(PM_ADLAN_3,"Update PM Settings");
-define(PM_ADLAN_4,"Select User");
-define(PM_ADLAN_5,"ALL Messages Deleted");
-define(PM_ADLAN_6,"Messages to/from");
-define(PM_ADLAN_7,"deleted");
-define(PM_ADLAN_8,"Messages older than ");
-define(PM_ADLAN_9,"days old");
-define(PM_ADLAN_10,"This will delete ALL messages more than ");
-define(PM_ADLAN_11,"Confirm Delete");
-define(PM_ADLAN_12,"Cancel");
-define(PM_ADLAN_13,"You must enter a value.");
-define(PM_ADLAN_14,"Delete messages");
-define(PM_ADLAN_15,"This will delete ALL messages either to or from the user: ");
-define(PM_ADLAN_16,"You must select a user first.");
-define(PM_ADLAN_17,"Delete messages from / to user");
-define(PM_ADLAN_18,"This will delete ALL messages from the PM system, whether they are read or not.");
-define(PM_ADLAN_19,"Delete ALL messages");
-define(PM_ADLAN_20,"PM settings updated");
-define(PM_ADLAN_21,"Plugin title");
-define(PM_ADLAN_22,"Show New PM Animation");
-define(PM_ADLAN_23,"Show user dropdown list");
-define(PM_ADLAN_24,"Auto delete read messages");
-define(PM_ADLAN_25,"READ message timeout");
-define(PM_ADLAN_26,"UNREAD message timeout");
-define(PM_ADLAN_27,"Popup notification on new PM");
-define(PM_ADLAN_28,"Popup delay time");
-define(PM_ADLAN_29,"Restrict PM to");
-define(PM_ADLAN_30,"All registered users");
-define(PM_ADLAN_31,"Userclass");
-define(PM_ADLAN_32,"Delete messages more than");
-define(PM_ADLAN_33,"Yes");
-define(PM_ADLAN_34,"No");
-define(PM_ADLAN_35,"Send email notifications");
-define(PM_ADLAN_36,"Please check tick to confirm operation");
-define(PM_ADLAN_37,"messages in system");
-define(PM_ADLAN_38,"Find username");
-define(PM_ADLAN_39,"days");
-define(PM_ADLAN_40,"disable");
-define(PM_ADLAN_41,"seconds");
-define(PM_ADLAN_42,"This plugin is a fully featured Private Messaging system.");
-define(PM_ADLAN_43,"Configure Private Messenger");
-define(PM_ADLAN_44,"To activate please go to your menus screen and select the pm_menu into one of your menu areas.");
-define(PM_ADLAN_45,"PM has been successfully upgraded to version");
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/admin/French.php 75/e107_plugins/pm_menu/languages/admin/French.php
--- 6171/e107_plugins/pm_menu/languages/admin/French.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/admin/French.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,42 +0,0 @@
-<?php
-
-define(PMLAN_PM,"Messagerie");
-define(PM_ADLAN_PM,"Messagerie Prive (*PM)");
-define(PM_ADLAN_1,"Options de Configuration PM");
-define(PM_ADLAN_2,"Fonctions Admin PM");
-define(PM_ADLAN_3,"Mettre  jour les Paramtres PM");
-define(PM_ADLAN_4,"Choisir l'Utilisateur");
-define(PM_ADLAN_5,"TOUS les Messages Supprims");
-define(PM_ADLAN_6,"Messages de/vers");
-define(PM_ADLAN_7,"supprim");
-define(PM_ADLAN_8,"Messages plus anciens que ");
-define(PM_ADLAN_9,"jours");
-define(PM_ADLAN_10,"Ceci Supprimera TOUS les messages plus anciens que ");
-define(PM_ADLAN_11,"Confirmer la Suppression");
-define(PM_ADLAN_12,"Annuler");
-define(PM_ADLAN_13,"Vous devez entrer une valeur.");
-define(PM_ADLAN_14,"Supprimer les messages");
-define(PM_ADLAN_15,"Ceci Supprimera TOUS les messages soit de soit vers l'utilisateur : ");
-define(PM_ADLAN_16,"Vous devez d'abord slectionner un utilisateur.");
-define(PM_ADLAN_17,"Ceci Supprimera TOUS les messages vers / de l'utilisateur : ");
-define(PM_ADLAN_18,"Ceci Supprimera TOUS les messages vers le systme PM, qu'ils soient lus ou pas.");
-define(PM_ADLAN_19,"Supprimer TOUS les messages");
-define(PM_ADLAN_20,"paramtres PM mis  jour");
-define(PM_ADLAN_21,"Titre Plugin");
-define(PM_ADLAN_22,"Montrer l'Animation PM 'New'");
-define(PM_ADLAN_23,"Afficher les utilisateurs en liste droulante");
-define(PM_ADLAN_24,"Effacer les messages lus automatiquement");
-define(PM_ADLAN_25,"Conserver les messages LUS pendant");
-define(PM_ADLAN_26,"Conserver les messages NON LUS pendant");
-define(PM_ADLAN_27,"Notification par Popup lors d'un nouveau PM");
-define(PM_ADLAN_28,"Temps d'atente pour le Popup");
-define(PM_ADLAN_29,"Restreindre PM ");
-define(PM_ADLAN_30,"Tous les membres");
-define(PM_ADLAN_31,"Classe Utilisateur");
-define(PM_ADLAN_32,"Supprimer les messages plus ancien que");
-define(PM_ADLAN_33,"Oui");
-define(PM_ADLAN_34,"Non");
-define(PM_ADLAN_35,"Notifier par email");
-define(PM_ADLAN_36,"SVP cocher la case pour confirmer l'operation");
-define(PM_ADLAN_37,"messages dans le systme");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/admin/Hebrew.php 75/e107_plugins/pm_menu/languages/admin/Hebrew.php
--- 6171/e107_plugins/pm_menu/languages/admin/Hebrew.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/admin/Hebrew.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,42 +0,0 @@
-<?php
-
-define(PMLAN_PM," ");
-define(PM_ADLAN_PM," ");
-define(PM_ADLAN_1,"   ");
-define(PM_ADLAN_2,"   ");
-define(PM_ADLAN_3,"   ");
-define(PM_ADLAN_4," ");
-define(PM_ADLAN_5,"  ");
-define(PM_ADLAN_6," /");
-define(PM_ADLAN_7,"");
-define(PM_ADLAN_8,"   ");
-define(PM_ADLAN_9,"  ");
-define(PM_ADLAN_10,"       ");
-define(PM_ADLAN_11," ");
-define(PM_ADLAN_12,"");
-define(PM_ADLAN_13,".   ");
-define(PM_ADLAN_14," ");
-define(PM_ADLAN_15,"      : ");
-define(PM_ADLAN_16,".    ");
-define(PM_ADLAN_17,"   / ");
-define(PM_ADLAN_18,".            ");
-define(PM_ADLAN_19,"   ");
-define(PM_ADLAN_20,"   ");
-define(PM_ADLAN_21," ");
-define(PM_ADLAN_22,"   ");
-define(PM_ADLAN_23,"  ");
-define(PM_ADLAN_24,"   ");
-define(PM_ADLAN_25,"  ");
-define(PM_ADLAN_26,"   ");
-define(PM_ADLAN_27,"      ");
-define(PM_ADLAN_28,"     ");
-define(PM_ADLAN_29,"   ");
-define(PM_ADLAN_30,"  ");
-define(PM_ADLAN_31," ");
-define(PM_ADLAN_32,"   ");
-define(PM_ADLAN_33,"");
-define(PM_ADLAN_34,"");
-define(PM_ADLAN_35,"   ");
-define(PM_ADLAN_36,"    ");
-define(PM_ADLAN_37," ");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/admin/Hungarian.php 75/e107_plugins/pm_menu/languages/admin/Hungarian.php
--- 6171/e107_plugins/pm_menu/languages/admin/Hungarian.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/admin/Hungarian.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,42 +0,0 @@
-<?php
-
-define(PMLAN_PM,"Privt zenet");
-define(PM_ADLAN_PM,"Privt zenet");
-define(PM_ADLAN_1,"P belltsok");
-define(PM_ADLAN_2,"P Admin opcik");
-define(PM_ADLAN_3,"Belltsok frisstse");
-define(PM_ADLAN_4,"Felhasznl kivlasztsa");
-define(PM_ADLAN_5,"ssz. zenet trlve");
-define(PM_ADLAN_6,"zenetek: cmzett/felad");
-define(PM_ADLAN_7,"trlve");
-define(PM_ADLAN_8,"zenetek rgebbiek, mint ");
-define(PM_ADLAN_9,"nap");
-define(PM_ADLAN_10,"sszes zenet trlse, mely rgebbi mint: ");
-define(PM_ADLAN_11,"Megersts");
-define(PM_ADLAN_12,"Mgse");
-define(PM_ADLAN_13,"Meg kell adnod egy rtket.");
-define(PM_ADLAN_14,"zenetek trlse");
-define(PM_ADLAN_15,"A felhasznl ltal rt/fogadott zenetek trlse: ");
-define(PM_ADLAN_16,"Elszr vlassz ki egy felhasznlt.");
-define(PM_ADLAN_17,"A felhasznl ltal rt/fogadott zenetek trlse.");
-define(PM_ADLAN_18,"Az sszes zenet trlse, fggetlenl attl, hogy olvasottak-e, vagy sem.");
-define(PM_ADLAN_19,"sszes zenet trlse");
-define(PM_ADLAN_20,"P belltsok frisstve");
-define(PM_ADLAN_21,"Plugin cm");
-define(PM_ADLAN_22,"j P esetn animci");
-define(PM_ADLAN_23,"Legrdthet cmlista");
-define(PM_ADLAN_24,"Olvasott zenetek automatikus trlse");
-define(PM_ADLAN_25,"Olvasott zenetek idtllpse");
-define(PM_ADLAN_26,"Olvasatlan zenetek idtllpse");
-define(PM_ADLAN_27,"Pop-up rtests j P rkezsekor");
-define(PM_ADLAN_28,"Pop-up ksleltetsi id");
-define(PM_ADLAN_29,"P korltozsa:");
-define(PM_ADLAN_30,"sszes regisztrlt tag");
-define(PM_ADLAN_31,"Osztly");
-define(PM_ADLAN_32,"Adott felhasznl zeneteinek trlse");
-define(PM_ADLAN_33,"Igen");
-define(PM_ADLAN_34,"Nem");
-define(PM_ADLAN_35,"Email rtests");
-define(PM_ADLAN_36,"Megersts");
-define(PM_ADLAN_37,"zenet a rendszerben");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/admin/Lithuanian.php 75/e107_plugins/pm_menu/languages/admin/Lithuanian.php
--- 6171/e107_plugins/pm_menu/languages/admin/Lithuanian.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/admin/Lithuanian.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,42 +0,0 @@
-<?php
-
-define(PMLAN_PM,"Asmeniniai Praneimai");
-define(PM_ADLAN_PM,"Asmeniniai Praneimai");
-define(PM_ADLAN_1,"AP derinimas");
-define(PM_ADLAN_2,"AP admin. funkcijos");
-define(PM_ADLAN_3,"Atnaujinti AP derinim");
-define(PM_ADLAN_4,"Pasirinkti vartotoj");
-define(PM_ADLAN_5,"alinti visus praneimus");
-define(PM_ADLAN_6,"Praneimas nuo");
-define(PM_ADLAN_7,"paalinta");
-define(PM_ADLAN_8,"Praneima senesnis nei ");
-define(PM_ADLAN_9,"dien");
-define(PM_ADLAN_10,"Js alinate visus praneimus, senesnius nei ");
-define(PM_ADLAN_11,"Patvirtinti");
-define(PM_ADLAN_12,"Ataukti");
-define(PM_ADLAN_13,"Btinai veskite reikm.");
-define(PM_ADLAN_14,"alinti praneim");
-define(PM_ADLAN_15,"Js alinate visus praneimus, gautus i vartotojo: ");
-define(PM_ADLAN_16,"Pirmiau pasirinkite vartotoj.");
-define(PM_ADLAN_17,"Paalinti visus vartotojo praneimus");
-define(PM_ADLAN_18,"Bus paalinti visi AP, perskaityti ir ne.");
-define(PM_ADLAN_19,"alinti visus praneimus");
-define(PM_ADLAN_20,"AP pakeitimai atnaujinti");
-define(PM_ADLAN_21,"skiepio pavadinimas");
-define(PM_ADLAN_22,"Rodyti nauj AP su animacija");
-define(PM_ADLAN_23,"Rodyti vartotojui iplaukiant sra");
-define(PM_ADLAN_24,"Automatikai alinti perskaitytus praneimus");
-define(PM_ADLAN_25,"Timeout perskaitytus praneimus");
-define(PM_ADLAN_26,"Taimout neperskaitytus praneimus");
-define(PM_ADLAN_27,"Praneti apie nauj AP iokaniu langu");
-define(PM_ADLAN_28,"Udelsti iokant lang");
-define(PM_ADLAN_29,"Riboti AP (kam)");
-define(PM_ADLAN_30,"Visi registruoti vartotojai");
-define(PM_ADLAN_31,"Vartotojo klas");
-define(PM_ADLAN_32,"alinti praneimus, senesnius nei");
-define(PM_ADLAN_33,"Taip");
-define(PM_ADLAN_34,"Ne");
-define(PM_ADLAN_35,"sisti perspjim el. patu");
-define(PM_ADLAN_36,"paymkite, kad baigte operacij");
-define(PM_ADLAN_37,"praneimas(i/) sistemoje");
-?>
diff -ruN 6171/e107_plugins/pm_menu/languages/admin/Swedish.php 75/e107_plugins/pm_menu/languages/admin/Swedish.php
--- 6171/e107_plugins/pm_menu/languages/admin/Swedish.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/admin/Swedish.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,42 +0,0 @@
-<?php
-
-define(PMLAN_PM,"Privata Meddelande");
-define(PM_ADLAN_PM,"Private Messaging");
-define(PM_ADLAN_1,"PM Konfiguration");
-define(PM_ADLAN_2,"PM Admin Funktioner");
-define(PM_ADLAN_3,"Uppdatera PM-konfigurationen");
-define(PM_ADLAN_4,"Vlj anvndare");
-define(PM_ADLAN_5,"Samtliga meddelande raderade");
-define(PM_ADLAN_6,"Meddelande till/frn");
-define(PM_ADLAN_7,"raderat");
-define(PM_ADLAN_8,"Meddelande ldre n ");
-define(PM_ADLAN_9,"dagar gamla");
-define(PM_ADLAN_10,"Detta kommer att redera samtliga meddelanden mer n ");
-define(PM_ADLAN_11,"Bekrfta borttagning");
-define(PM_ADLAN_12,"Avbryt");
-define(PM_ADLAN_13,"Du mste fylla i ett vrde.");
-define(PM_ADLAN_14,"radera meddeland");
-define(PM_ADLAN_15,"Detta kommer att redera samtliga meddelanden antingen till eller frn anvndaren: ");
-define(PM_ADLAN_16,"Du mste vlja en anvndare frst.");
-define(PM_ADLAN_17,"Radera meddelandet till/frn anvndare");
-define(PM_ADLAN_18,"Detta kommer att redera samtliga meddelanden frn hela PM-systemet, oavsett om de r olsta eller inte.");
-define(PM_ADLAN_19,"Radera samtliga meddelanden");
-define(PM_ADLAN_20,"PM-instllningar uppdaterade");
-define(PM_ADLAN_21,"Plugin-namn");
-define(PM_ADLAN_22,"Visa animation fr \"Nytt PM\"");
-define(PM_ADLAN_23,"Visa dropdown-menyn fr anvndarlistan");
-define(PM_ADLAN_24,"Radera lsta meddelande automatiskt");
-define(PM_ADLAN_25,"Timeout p LS meddelande");
-define(PM_ADLAN_26,"Timeout p OLSTA meddelande");
-define(PM_ADLAN_27,"Notifiering via en popup vid nytt meddelande");
-define(PM_ADLAN_28,"Frdrjjning p popup");
-define(PM_ADLAN_29,"Begrnsa PM till");
-define(PM_ADLAN_30,"Alla registrerade anvndare");
-define(PM_ADLAN_31,"Anvndarklass");
-define(PM_ADLAN_32,"Radera meddelande mer n");
-define(PM_ADLAN_33,"Ja");
-define(PM_ADLAN_34,"Nej");
-define(PM_ADLAN_35,"Skicka notifikation via epost");
-define(PM_ADLAN_36,"Klicka i kryssrutan fr att bekrfta tgrden");
-define(PM_ADLAN_37,"meddelande i systemet");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/Danish.php 75/e107_plugins/pm_menu/languages/Danish.php
--- 6171/e107_plugins/pm_menu/languages/Danish.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/Danish.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,56 +0,0 @@
-<?php
-define(PMLAN_PM,"Privat Besked");
-define(PMLAN_0, "Beskede(er) siden sidst");
-define(PMLAN_1, "modtaget besked(er)");
-define(PMLAN_2, "sendt beskede(er)");
-define(PMLAN_3, "bruger blokeret");
-define(PMLAN_4, "brugerer blokeret");
-define(PMLAN_5, "Send Ny PB");
-define(PMLAN_6, "vis");
-define(PMLAN_7, "Ikke tilladt");
-define(PMLAN_8, "Du skal vre registreret/logget ind for at kunne bruge privat besked system.");
-define(PMLAN_9, "Post Privat Besked");
-define(PMLAN_10, "Besked sendte fejl");
-define(PMLAN_11, "Send Besked");
-define(PMLAN_12, "BRUGER");
-define(PMLAN_13, "Findes ikke");
-define(PMLAN_14, "Besked slettet");
-define(PMLAN_15, "Besked sendt med succes til");
-define(PMLAN_16, "Det er i jeblikket ikke tillat dig at sende PB ");
-define(PMLAN_17, "Den bruger har blokeret beskeder fra dig.");
-define(PMLAN_18, "Du har startet PB blokering fra ");
-define(PMLAN_19, " er nu tilladt at sende dig PBer.");
-define(PMLAN_20, "Det er dig ikke tilladt at fjerne denne blokering!");
-define(PMLAN_21, "Blokering er allrede sat af ");
-define(PMLAN_22, "Det var startet den: ");
-define(PMLAN_23, " beskder som er blevet klokeret indtil nu.");
-define(PMLAN_24, "Aktiv blokering er ikke fundet.");
-define(PMLAN_25, "Aktuel PB blokering");
-define(PMLAN_26, "Svar p privat Besked");
-define(PMLAN_27, "Besked");
-define(PMLAN_28, "Send Privat Besked");
-define(PMLAN_29, "Emne:");
-define(PMLAN_30, "Besked:");
-define(PMLAN_31, "Til:");
-define(PMLAN_32, "Udtryk:");
-define(PMLAN_33, "Vlg modtager");
-define(PMLAN_34, "Dato sendt");
-define(PMLAN_35, "Fra");
-define(PMLAN_36, "Aktuel blokerings indstillinger");
-define(PMLAN_37, "Det er ikke tilladt at du lser denne besked");
-define(PMLAN_38, "Bloker bruger");
-define(PMLAN_39, "AF Bloker bruger");
-define(PMLAN_40, "Slet");
-define(PMLAN_41, "Opret Svar");
-define(PMLAN_42, "Citer Orginal");
-define(PMLAN_43, "Besked Sendt:");
-define(PMLAN_44, "Besked Lst:");
-define(PMLAN_45, "Ulste besked(er)");
-define(PMLAN_46, "Bruger:");
-define(PMLAN_47, "Brugerklasse:");
-define(PMLAN_48, "Alle Bruger");
-define(PMLAN_49, "Ikke Lst");
-define(PMLAN_50, "Du har modtaget en ny Besked");
-define(PMLAN_51, "Site");
-define(PMLAN_52, "Afmrk venligst, for bekrftelse af din handling");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/Dutch.php 75/e107_plugins/pm_menu/languages/Dutch.php
--- 6171/e107_plugins/pm_menu/languages/Dutch.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/Dutch.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,56 +0,0 @@
-<?php
-define(PMLAN_PM,"Persoonlijk Bericht");
-define(PMLAN_0, "Bericht(en) sedert laatste bezoek");
-define(PMLAN_1, "ontvangen bericht(en)");
-define(PMLAN_2, "verzonden bericht(en)");
-define(PMLAN_3, "gebruiker geblokkeerd");
-define(PMLAN_4, "gebruikers geblokkeerd");
-define(PMLAN_5, "Zend Nieuw PB");
-define(PMLAN_6, "bekijk");
-define(PMLAN_7, "Niet toegestaan");
-define(PMLAN_8, "Je moet een geregistreerde en ingelogde gebruiker zijn om het Persoonlijke Berichten systeem te kunnen gebruiken.");
-define(PMLAN_9, "Verstuur Persoonlijk Bericht");
-define(PMLAN_10, "Berichten verstuurfout");
-define(PMLAN_11, "Verstuur Bericht");
-define(PMLAN_12, "Gebruiker");
-define(PMLAN_13, "bestaat niet");
-define(PMLAN_14, "Bericht verwijderd");
-define(PMLAN_15, "Bericht succesvol verzonden aan");
-define(PMLAN_16, "Je mag nu geen PB versturen aan ");
-define(PMLAN_17, "Deze gebruiker heeft berichten van jou geblokkeerd.");
-define(PMLAN_18, "Je hebt succesvol de PB's geblokkeerd van ");
-define(PMLAN_19, " mag je nu PB's sturen.");
-define(PMLAN_20, "Je mag deze blokkade niet verwijderen!");
-define(PMLAN_21, "Blokkade bestaat al vanaf ");
-define(PMLAN_22, "Is gestart op: ");
-define(PMLAN_23, " berichten zijn al geblokkeerd.");
-define(PMLAN_24, "Actieve blokkade niet gevonden.");
-define(PMLAN_25, "Huidige PB blokkades");
-define(PMLAN_26, "Beantwoord het Persoonlijke Bericht");
-define(PMLAN_27, "Bericht");
-define(PMLAN_28, "Verstuur Persoonlijke Bericht");
-define(PMLAN_29, "Onderwerp:");
-define(PMLAN_30, "Boodschap:");
-define(PMLAN_31, "Aan:");
-define(PMLAN_32, "Emoticons:");
-define(PMLAN_33, "Kies ontvanger");
-define(PMLAN_34, "Datum verzonden");
-define(PMLAN_35, "Van");
-define(PMLAN_36, "Huidige blokkade instellingen");
-define(PMLAN_37, "Je mag dit bericht niet bekijken");
-define(PMLAN_38, "Blokkeer gebruiker");
-define(PMLAN_39, "De-blokkeer gebruiker");
-define(PMLAN_40, "Verwijder");
-define(PMLAN_41, "Stuur antwoord");
-define(PMLAN_42, "Aanhalen origineel");
-define(PMLAN_43, "Bericht Verzonden:");
-define(PMLAN_44, "Bericht gelezen:");
-define(PMLAN_45, "Ongelezen Bericht(en)");
-define(PMLAN_46, "Gebruiker:");
-define(PMLAN_47, "Gebruikersklasse:");
-define(PMLAN_48, "Alle gebruikers");
-define(PMLAN_49, "Ongelezen");
-define(PMLAN_50, "Je hebt een nieuw Persoonlijk Bericht ontvangen");
-define(PMLAN_51, "Site");
-define(PMLAN_52, "Aankruisen om bewerking te bevestigen");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/English.php 75/e107_plugins/pm_menu/languages/English.php
--- 6171/e107_plugins/pm_menu/languages/English.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,67 +0,0 @@
-<?php
-define(PMLAN_PM,"Private Message");
-define(PMLAN_0, "New Message(s)");
-define(PMLAN_1, "received message(s)");
-define(PMLAN_2, "sent message(s)");
-define(PMLAN_3, "user blocked");
-define(PMLAN_4, "users blocked");
-define(PMLAN_5, "Send New Private Message");
-define(PMLAN_6, "view");
-define(PMLAN_7, "Not Allowed");
-define(PMLAN_8, "You must be a registered/logged-in user to use the Private Message system.");
-define(PMLAN_9, "Post Private Message");
-define(PMLAN_10, "Message send Error");
-define(PMLAN_11, "Send Message");
-define(PMLAN_12, "USER");
-define(PMLAN_13, "does not exist");
-define(PMLAN_14, "Message deleted");
-define(PMLAN_15, "Message successfully sent to");
-define(PMLAN_16, "You are currently not allowed to send Private Messages ");
-define(PMLAN_17, "That user has blocked messages from you.");
-define(PMLAN_18, "You have successfully started PM Blocking from ");
-define(PMLAN_19, " is now allowed to send you PMs.");
-define(PMLAN_20, "You are not allowed to remove that blockage!");
-define(PMLAN_21, "Blocking already exists from ");
-define(PMLAN_22, "It was started on: ");
-define(PMLAN_23, " messages have been blocked so far.");
-define(PMLAN_24, "Active block not found.");
-define(PMLAN_25, "Current PM blocks");
-define(PMLAN_26, "Reply to Private Message");
-define(PMLAN_27, "Message");
-define(PMLAN_28, "Send Private Message");
-define(PMLAN_29, "Subject:");
-define(PMLAN_30, "Message:");
-define(PMLAN_31, "To");
-define(PMLAN_32, "Emotes:");
-define(PMLAN_33, "Choose recipient");
-define(PMLAN_34, "Date Sent");
-define(PMLAN_35, "From");
-define(PMLAN_36, "Current block settings");
-define(PMLAN_37, "You are not allowed to view this message");
-define(PMLAN_38, "Block user");
-define(PMLAN_39, "UN-Block user");
-define(PMLAN_40, "Delete");
-define(PMLAN_41, "Post Reply");
-define(PMLAN_42, "Quote Original");
-define(PMLAN_43, "Message Sent:");
-define(PMLAN_44, "Message Read:");
-define(PMLAN_45, "Unread Message(s)");
-define(PMLAN_46, "User:");
-define(PMLAN_47, "Userclass:");
-define(PMLAN_48, "All Users");
-define(PMLAN_49, "Not read");
-define(PMLAN_50, "You have received a new Private Message");
-define(PMLAN_51, "Site");
-define(PMLAN_52,"Please check tick to confirm operation");
-define(PMLAN_53,"Find username");
-define(PMLAN_54,"Select User");
-define(PMLAN_55,"User(s) found");
-define(PMLAN_56,"Close window");
-define(PMLAN_57,"No subject");
-define(PMLAN_58,"Delete Selected");
-define(PMLAN_59,"Blocked User");
-define(PMLAN_60,"Date Blocked");
-define(PMLAN_61,"messages blocked");
-define(PMLAN_62,"Blocked");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/French.php 75/e107_plugins/pm_menu/languages/French.php
--- 6171/e107_plugins/pm_menu/languages/French.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/French.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,60 +0,0 @@
-<?php
-
-// translation by Lolo Irie, http://www.touchatou.com
-
-define(PMLAN_PM,"Messagerie");
-define(PMLAN_0, "Nouveau(x) Message(s)");
-define(PMLAN_1, "message(s) reus(s)");
-define(PMLAN_2, "message(s) envoy(s)");
-define(PMLAN_3, "utilisateur bloqu");
-define(PMLAN_4, "utilisateurs bloqus");
-define(PMLAN_5, "Envoyer un nouveau message");
-define(PMLAN_6, "Voir");
-define(PMLAN_7, "Pas autoris");
-define(PMLAN_8, "Vous devez tre enregistr/connect pour utiliser le systme de messagerie.");
-define(PMLAN_9, "Envoyer un message");
-define(PMLAN_10, "Erreur !!!");
-define(PMLAN_11, "Poster Message");
-define(PMLAN_12, "UTILISATEUR");
-define(PMLAN_13, "n'existe pas");
-define(PMLAN_14, "Message effac");
-define(PMLAN_15, "Message envoy avec succs  ");
-define(PMLAN_16, "Vous n'tes pas autoris actuellement  utiliser la messagerie ");
-define(PMLAN_17, "Cet utilisateur a bloqu vos messages.");
-define(PMLAN_18, "Vous avez bien bloqu les messages de ");
-define(PMLAN_19, " n'est pas autoris  vous envoyer des messages.");
-define(PMLAN_20, "Vous n'tes pas autoris  supprimer ce filtre!");
-define(PMLAN_21, "Filtre dj existant ");
-define(PMLAN_22, "Message commenc le : ");
-define(PMLAN_23, " messages ont t bloqus.");
-define(PMLAN_24, "Filtre actif non trouv.");
-define(PMLAN_25, "Messages actuellement bloqus");
-define(PMLAN_26, "Rpondre au message priv");
-define(PMLAN_27, "Message");
-define(PMLAN_28, "Envoyer message");
-define(PMLAN_29, "Sujet:");
-define(PMLAN_30, "Message:");
-define(PMLAN_31, "A");
-define(PMLAN_32, "Emotes:");
-define(PMLAN_33, "Choisissez le destinataire");
-define(PMLAN_34, "Date d'envoi");
-define(PMLAN_35, "De");
-define(PMLAN_36, "Configuration des filtres");
-define(PMLAN_37, "Vous n'tes pas autoris  voir ce message");
-define(PMLAN_38, "Filtrer les messages");
-define(PMLAN_39, "Supprimer un filtre");
-define(PMLAN_40, "Effacer");
-define(PMLAN_41, "Rpondre");
-define(PMLAN_42, "Message original");
-define(PMLAN_43, "Message envoy:");
-define(PMLAN_44, "Message lu:");
-define(PMLAN_45, "Message(s) non lu(s)");
-define(PMLAN_46, "Utilisateur:");
-define(PMLAN_47, "Classe Utilisateur:");
-define(PMLAN_48, "Tous les Utilisateurs");
-define(PMLAN_49, "Non lu");
-define(PMLAN_50, "Vous avez reu un nouveau PM");
-define(PMLAN_51, "Site");
-define(PMLAN_52,"SVP cochez  la case pour confirmer l'operation");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/German.php 75/e107_plugins/pm_menu/languages/German.php
--- 6171/e107_plugins/pm_menu/languages/German.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/German.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,57 +0,0 @@
-<?php
-define(PMLAN_PM,"Private Nachrichten");
-define(PMLAN_0, "neue nachricht(en)");
-define(PMLAN_1, "empfangene nachricht(en)");
-define(PMLAN_2, "gesendete nachrich(en)");
-define(PMLAN_3, "benutzer gesperrt");
-define(PMLAN_4, "benutzer gesperrt");
-define(PMLAN_5, "sende neue nachricht");
-define(PMLAN_6, "zeige");
-define(PMLAN_7, "nicht erlaubt");
-define(PMLAN_8, "Sie mssen eingeloggt sein um diese Funktion zu benutzen.");
-define(PMLAN_9, "Sende Private Nachricht");
-define(PMLAN_10, "Fehler beim Senden");
-define(PMLAN_11, "Send Nachricht");
-define(PMLAN_12, "Benutzer");
-define(PMLAN_13, "existiert nicht");
-define(PMLAN_14, "Nachricht gelscht");
-define(PMLAN_15, "Nachricht erfolgreich gesendet an");
-define(PMLAN_16, "Sie haben zur Zeit keine Erlaubnis ");
-define(PMLAN_17, "Die Benutzer hat Nachrichten von ihnen gesperrt.");
-define(PMLAN_18, "Sie haben diesen Benutzer gesperrt: ");
-define(PMLAN_19, " hat keine Berechtigung ihnen Nachrichten zu senden.");
-define(PMLAN_20, "Sie haben keine Berechtigung die Sperre zu entfernen!");
-define(PMLAN_21, "Es existiert schon eine Sperre von ");
-define(PMLAN_22, "Sperre existiert seit: ");
-define(PMLAN_23, " Nachrichten wurden abgelehnt.");
-define(PMLAN_24, "Aktive Speere nicht gefunden.");
-define(PMLAN_25, "Aktuelle Nachrichten Sperren");
-define(PMLAN_26, "Auf Nachricht antworten");
-define(PMLAN_27, "Nachricht");
-define(PMLAN_28, "Sende Private Nachricht");
-define(PMLAN_29, "Betreff:");
-define(PMLAN_30, "Nachricht:");
-define(PMLAN_31, "An");
-define(PMLAN_32, "Emoticons:");
-define(PMLAN_33, "Empfnger whlen");
-define(PMLAN_34, "gesendet am");
-define(PMLAN_35, "Von");
-define(PMLAN_36, "Aktuelle Sperren");
-define(PMLAN_37, "Sie haben keine Berechtigung diese Nachricht anzuzeigen");
-define(PMLAN_38, "Benutzer sperren");
-define(PMLAN_39, "Benutzer entsperren");
-define(PMLAN_40, "Lschen");
-define(PMLAN_41, "Antworten");
-define(PMLAN_42, "Zitat");
-define(PMLAN_43, "gesendet am:");
-define(PMLAN_44, "gelesen am:");
-define(PMLAN_45, "ungelesene nachricht(en)");
-define(PMLAN_46, "Benutzer");
-define(PMLAN_47, "Benutzergruppe");
-define(PMLAN_48, "Alle Benutzer");
-define(PMLAN_49, "ungelesen");
-define(PMLAN_50, "Du hast eine neue Nachricht");
-define(PMLAN_51, "Site");
-define(PMLAN_52, "Zum besttigen bitte markieren");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/Hebrew.php 75/e107_plugins/pm_menu/languages/Hebrew.php
--- 6171/e107_plugins/pm_menu/languages/Hebrew.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/Hebrew.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,57 +0,0 @@
-<?php
-define(PMLAN_PM," ");
-define(PMLAN_0, "(() (");
-define(PMLAN_1, "(() (");
-define(PMLAN_2, "( (");
-define(PMLAN_3, " ");
-define(PMLAN_4, " ");
-define(PMLAN_5, "  ");
-define(PMLAN_6, "");
-define(PMLAN_7, "");
-define(PMLAN_8, "   /    .");
-define(PMLAN_9, "  ");
-define(PMLAN_10, "  ");
-define(PMLAN_11, " ");
-define(PMLAN_12, "");
-define(PMLAN_13, " ");
-define(PMLAN_14, " ");
-define(PMLAN_15, "    ");
-define(PMLAN_16, "      ");
-define(PMLAN_17, ".    ");
-define(PMLAN_18, "      ");
-define(PMLAN_19, " .     ");
-define(PMLAN_20, "!    ");
-define(PMLAN_21, "    ");
-define(PMLAN_22, " : ");
-define(PMLAN_23, " .    ");
-define(PMLAN_24, ".   ");
-define(PMLAN_25, "  ");
-define(PMLAN_26, "  ");
-define(PMLAN_27, "");
-define(PMLAN_28, "  ");
-define(PMLAN_29, ":");
-define(PMLAN_30, ":");
-define(PMLAN_31, "");
-define(PMLAN_32, ":");
-define(PMLAN_33, " ");
-define(PMLAN_34, " ");
-define(PMLAN_35, "");
-define(PMLAN_36, "  ");
-define(PMLAN_37, "      ");
-define(PMLAN_38, " ");
-define(PMLAN_39, "  ");
-define(PMLAN_40, "");
-define(PMLAN_41, " ");
-define(PMLAN_42, "' ");
-define(PMLAN_43, " :");
-define(PMLAN_44, " :");
-define(PMLAN_45, "()  ");
-define(PMLAN_46, ":");
-define(PMLAN_47, " :");
-define(PMLAN_48, " ");
-define(PMLAN_49, " ");
-define(PMLAN_50, "    ");
-define(PMLAN_51, "");
-define(PMLAN_52,"    ");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/Hungarian.php 75/e107_plugins/pm_menu/languages/Hungarian.php
--- 6171/e107_plugins/pm_menu/languages/Hungarian.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/Hungarian.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,57 +0,0 @@
-<?php
-define(PMLAN_PM,"Privt zenet");
-define(PMLAN_0, "j zenet");
-define(PMLAN_1, "fogadott zenet");
-define(PMLAN_2, "elkldtt zenet");
-define(PMLAN_3, "blokkolt felhasznl");
-define(PMLAN_4, "blokkolt felhasznl");
-define(PMLAN_5, "P kldse");
-define(PMLAN_6, "Megtekint");
-define(PMLAN_7, "Nincs engedlyezve");
-define(PMLAN_8, "A Privt zenet kldshez regisztrlj/jelentkezz be.");
-define(PMLAN_9, "P kldse");
-define(PMLAN_10, "zenetkldsi hiba");
-define(PMLAN_11, "Mehet");
-define(PMLAN_12, "Felhasznl");
-define(PMLAN_13, "nem ltezik");
-define(PMLAN_14, "zenet trlve");
-define(PMLAN_15, "zenet sikeresen elkldve a kvetkez felhasznlnak");
-define(PMLAN_16, "Jelenlenleg nem kldhetsz zenetet ");
-define(PMLAN_17, "A cmzett blokkolja az zeneteidet.");
-define(PMLAN_18, "Privt zenetek blokkolsa ezen feladtl: ");
-define(PMLAN_19, " jra kldhet szmodra P-t.");
-define(PMLAN_20, "Nincs jogosultsgpd a blokkols feloldsra!");
-define(PMLAN_21, "Blokkols mr bekapcsolva: ");
-define(PMLAN_22, "Kezdete: ");
-define(PMLAN_23, " blokkolt zenet.");
-define(PMLAN_24, "Nincs bekapcsolt blokkols.");
-define(PMLAN_25, "Jelenlegi P blokklsok");
-define(PMLAN_26, "Vlasz");
-define(PMLAN_27, "zenet");
-define(PMLAN_28, "P kldse");
-define(PMLAN_29, "Trgy:");
-define(PMLAN_30, "zenet:");
-define(PMLAN_31, "Cmzett");
-define(PMLAN_32, "Emotikonok:");
-define(PMLAN_33, "Cmzett kivlasztsa");
-define(PMLAN_34, "Klds dtuma");
-define(PMLAN_35, "Felad");
-define(PMLAN_36, "Blokkolsi belltsok");
-define(PMLAN_37, "Nincs jogosultsgod ezen zenet megtekintsre");
-define(PMLAN_38, "Felhasznl blokkolsa");
-define(PMLAN_39, "Blokkols megszntetse");
-define(PMLAN_40, "Trls");
-define(PMLAN_41, "Vlasz");
-define(PMLAN_42, "Idzs");
-define(PMLAN_43, "Elkldve:");
-define(PMLAN_44, "Olvasva:");
-define(PMLAN_45, "Olcasatlan zenetek");
-define(PMLAN_46, "Felhasznl:");
-define(PMLAN_47, "Osztly:");
-define(PMLAN_48, "ssz. felhasznl");
-define(PMLAN_49, "Nem olvasott");
-define(PMLAN_50, "j P rkezett");
-define(PMLAN_51, "Oldal");
-define(PMLAN_52,"Megersts");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/Icelandic.php 75/e107_plugins/pm_menu/languages/Icelandic.php
--- 6171/e107_plugins/pm_menu/languages/Icelandic.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/Icelandic.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,41 +0,0 @@
-<?php
-define(PMLAN_PM,"Persnuleg Skilabo");
-define(PMLAN_0, "Skilabo san sast");
-define(PMLAN_1, "fengin skilabo");
-define(PMLAN_2, "send skilabo");
-define(PMLAN_3, "notandi tilokaur");
-define(PMLAN_4, "notendur tilokair");
-define(PMLAN_5, "Senda N PS");
-define(PMLAN_6, "skoa");
-define(PMLAN_7, "Ekki Leyft");
-define(PMLAN_8, " arft a vera skrur/innritaur notandi til a nota Persnulega Skilaboakerfi.");
-define(PMLAN_9, "Senda Persnuleg Skilabo");
-define(PMLAN_10, "Villa  sendingu");
-define(PMLAN_11, "Senda Skilabo");
-define(PMLAN_12, "NOTANDI");
-define(PMLAN_13, "er ekki til");
-define(PMLAN_14, "Skilaboum eytt");
-define(PMLAN_15, "Skilabo voru send til");
-define(PMLAN_16, " augnablikinu er r ekki leyft a senda PS ");
-define(PMLAN_17, "S notandi hefur tiloka skilabo fr r.");
-define(PMLAN_18, " hefur hr me tiloka PS fr ");
-define(PMLAN_19, " er n leyft a senda r PS.");
-define(PMLAN_20, "r er ekki heimilt a fjarlgja  tilokun!");
-define(PMLAN_21, "tilokun er egar til staar fr ");
-define(PMLAN_22, "tilokunin byrjai: ");
-define(PMLAN_23, " skilabo hafa veri tiloku hinga til.");
-define(PMLAN_24, "Virk tilokun fannst ekki.");
-define(PMLAN_25, "PS tilokanir  gangi");
-define(PMLAN_26, "Svara Persnulegum Skilaboum");
-define(PMLAN_27, "Skilabo");
-define(PMLAN_28, "Senda Persnuleg Skilabo");
-define(PMLAN_29, "Efni:");
-define(PMLAN_30, "Skilabo:");
-define(PMLAN_31, "Til:");
-define(PMLAN_32, "Svipbrigi:");
-define(PMLAN_33, "Velja mttakanda");
-define(PMLAN_34, "Dags. Sendingar");
-define(PMLAN_35, "Fr");
-define(PMLAN_36, "tilokunarstillingar  gangi");
-define(PMLAN_37, "r er ekki heimilt a skoa essi skilabo");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/Italian.php 75/e107_plugins/pm_menu/languages/Italian.php
--- 6171/e107_plugins/pm_menu/languages/Italian.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/Italian.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,49 +0,0 @@
-<?php
-define(PMLAN_PM,"Messaggi Privati");
-define(PMLAN_0, "Messaggi dalla tua ultima visita");
-define(PMLAN_1, "Messaggi ricevuti");
-define(PMLAN_2, "Messaggi inviati");
-define(PMLAN_3, "Utente bloccato");
-define(PMLAN_4, "Utenti bloccati");
-define(PMLAN_5, "Invia nuovo MP");
-define(PMLAN_6, "Vedi");
-define(PMLAN_7, "Non abilitato");
-define(PMLAN_8, "Devi essere registrato/loggarti come utente per usare i messaggi privati.");
-define(PMLAN_9, "Posta messaggio privato");
-define(PMLAN_10, "Errore invio messaggio");
-define(PMLAN_11, "Invia messaggio");
-define(PMLAN_12, "Utente");
-define(PMLAN_13, "Non esiste");
-define(PMLAN_14, "Messaggio cancellato");
-define(PMLAN_15, "Messaggio inviato a ");
-define(PMLAN_16, "Non sei al momento abilitato ai MP");
-define(PMLAN_17, "Questo utente ha bloccato il messaggio per te.");
-define(PMLAN_18, "Stai bloccando i MP da parte di ");
-define(PMLAN_19, " non e' abilitato a mandarti MP.");
-define(PMLAN_20, "Non sei abilitato a rimuovere quel blocco!");
-define(PMLAN_21, "Blocco gia' esistente verso ");
-define(PMLAN_22, "E' stato cominciato il: ");
-define(PMLAN_23, " messaggi bloccati fin'ora'.");
-define(PMLAN_24, "Blocco attivo non trovato.");
-define(PMLAN_25, "MP bloccati corentemente");
-define(PMLAN_26, "Rispondi al messaggio privato");
-define(PMLAN_27, "Messaggi");
-define(PMLAN_28, "Manda messaggio privato");
-define(PMLAN_29, "Soggetto:");
-define(PMLAN_30, "Messaggio:");
-define(PMLAN_31, "A:");
-define(PMLAN_32, "Emotes:");
-define(PMLAN_33, "Scegli l'utente");
-define(PMLAN_34, "Data di invio");
-define(PMLAN_35, "Da");
-define(PMLAN_36, "Settaggi di blocco correnti");
-define(PMLAN_37, "Non sei abilitato a visualizzare questo messaggio");
-define(PMLAN_38, "Utente Bloccato");
-define(PMLAN_39, "Utente Sbloccato");
-define(PMLAN_40, "Cancella");
-define(PMLAN_41, "Posta Risposta");
-define(PMLAN_42, "Quota Originale");
-define(PMLAN_43, "Messaggio Inviato:");
-define(PMLAN_44, "Messaggio Letto:");
-define(PMLAN_45, "Messaggi non letto(i)");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/Lithuanian.php 75/e107_plugins/pm_menu/languages/Lithuanian.php
--- 6171/e107_plugins/pm_menu/languages/Lithuanian.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/Lithuanian.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,57 +0,0 @@
-<?php
-define(PMLAN_PM,"Asmeniniai praneimai");
-define(PMLAN_0, "Naujas praneims(ai)");
-define(PMLAN_1, "Gauti praneimai");
-define(PMLAN_2, "Isisti praneimai");
-define(PMLAN_3, "vartotojas blokuotas");
-define(PMLAN_4, "Vartotojai blokuoti");
-define(PMLAN_5, "Isisti nauj AP");
-define(PMLAN_6, "rodyti");
-define(PMLAN_7, "Neleista");
-define(PMLAN_8, "Nordami isisti praneim Js turite usiregistruoti sistemoje.");
-define(PMLAN_9, "Isisti asmenin praneim");
-define(PMLAN_10, "vyko klaida siuniant praneim");
-define(PMLAN_11, "Sisti praneim");
-define(PMLAN_12, "Vartotojas");
-define(PMLAN_13, "neegzistuoja");
-define(PMLAN_14, "Praneimas paalintas");
-define(PMLAN_15, "Praneimas skmingai isistas");
-define(PMLAN_16, "Js negalite sisti asmenini praneim");
-define(PMLAN_17, "is vartotojas blokuoja Js siuniamus praneimus.");
-define(PMLAN_18, "Js blokavote asmenin praneim nuo");
-define(PMLAN_19, " dabar jau galite sisti asmeninius praneimus.");
-define(PMLAN_20, "Js negalite paalinti draudimo!");
-define(PMLAN_21, "Draudimas jau udtas ");
-define(PMLAN_22, "Pradta buvo: ");
-define(PMLAN_23, " praneimai laikinai draudiami.");
-define(PMLAN_24, "Aktyvus blokas nerastas.");
-define(PMLAN_25, "AP srautas udraustas");
-define(PMLAN_26, "Atsakyti  Asmenin Praneim");
-define(PMLAN_27, "Praneimas");
-define(PMLAN_28, "Sisti Asmenin Praneim");
-define(PMLAN_29, "Tema:");
-define(PMLAN_30, "Praneimas:");
-define(PMLAN_31, "Kam");
-define(PMLAN_32, "Veidukai:");
-define(PMLAN_33, "Pasirinkite gavj");
-define(PMLAN_34, "Isiuntimo data");
-define(PMLAN_35, "Nuo");
-define(PMLAN_36, "Esami derinimo parametrai");
-define(PMLAN_37, "Js neturite teisi perirti io praneimo");
-define(PMLAN_38, "Udrausti vartotoj");
-define(PMLAN_39, "Iblokuotas vartotojas");
-define(PMLAN_40, "alinti");
-define(PMLAN_41, "Atsakyti");
-define(PMLAN_42, "Cituoti");
-define(PMLAN_43, "Praneimas isistas:");
-define(PMLAN_44, "Praneimas perskaitytas:");
-define(PMLAN_45, "Neperskaityta praneim");
-define(PMLAN_46, "Vartotojui:");
-define(PMLAN_47, "Vartotoj klasei:");
-define(PMLAN_48, "Visi vartotojai");
-define(PMLAN_49, "Neperskaityta");
-define(PMLAN_50, "Gavote nauj AP");
-define(PMLAN_51, "Tinklapis");
-define(PMLAN_52,"Patikrinkite nordami baigti veiksm");
-
-?>
diff -ruN 6171/e107_plugins/pm_menu/languages/Swedish.php 75/e107_plugins/pm_menu/languages/Swedish.php
--- 6171/e107_plugins/pm_menu/languages/Swedish.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/Swedish.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,57 +0,0 @@
-<?php
-define(PMLAN_PM,"Privata meddelanden");
-define(PMLAN_0, "Nya meddelanden");
-define(PMLAN_1, "mottagna meddelanden");
-define(PMLAN_2, "skickade meddelanden");
-define(PMLAN_3, "anvndaren blockerad");
-define(PMLAN_4, "anvndare blockerade");
-define(PMLAN_5, "Skicka nytt PM");
-define(PMLAN_6, "visa");
-define(PMLAN_7, "Ej tilltet");
-define(PMLAN_8, "Du mste vara registrerad och inloggad fr att kunna skicka Privata Meddelande.");
-define(PMLAN_9, "Posta Privat Meddelande");
-define(PMLAN_10, "Fel vid sndning av meddelande");
-define(PMLAN_11, "Skicka meddelande");
-define(PMLAN_12, "Anvndare");
-define(PMLAN_13, "existerar inte");
-define(PMLAN_14, "Meddelandet raderat");
-define(PMLAN_15, "Meddelandet skickat till");
-define(PMLAN_16, "Du har fr nrvarande inte tilltelse att skicka meddelande. ");
-define(PMLAN_17, "Den anvndaren har blockerat meddelanden frn dig.");
-define(PMLAN_18, "Du har startat en blockering av ");
-define(PMLAN_19, " har nu tilltelse att skicka PM till dig.");
-define(PMLAN_20, "Du har inte tilltelse att ta bort blockeringen!");
-define(PMLAN_21, "Blcokering existerar redan av ");
-define(PMLAN_22, "Den startades: ");
-define(PMLAN_23, " meddelanden har blockerats hittills..");
-define(PMLAN_24, "Inga aktiva blockeringar hittades.");
-define(PMLAN_25, "Nuvarande PM-blockeringar");
-define(PMLAN_26, "Svara p Privat Meddelande");
-define(PMLAN_27, "Meddelande");
-define(PMLAN_28, "Skicka Privat Meddelande");
-define(PMLAN_29, "rende:");
-define(PMLAN_30, "Meddelande:");
-define(PMLAN_31, "Till");
-define(PMLAN_32, "Emotes:");
-define(PMLAN_33, "Vlj mottagare");
-define(PMLAN_34, "Datum skickat");
-define(PMLAN_35, "Frn");
-define(PMLAN_36, "Nuvarande instllningar av blockeringar");
-define(PMLAN_37, "Du har inte tilltelse att lsa detta meddelande");
-define(PMLAN_38, "Blockera anvndaren");
-define(PMLAN_39, "Ta bort blockeringen frn anvndaren");
-define(PMLAN_40, "Radera");
-define(PMLAN_41, "Posta svar");
-define(PMLAN_42, "Citera orginal");
-define(PMLAN_43, "Meddelande skickat:");
-define(PMLAN_44, "Meddelandet lst:");
-define(PMLAN_45, "Olsta meddelanden");
-define(PMLAN_46, "Anvndare:");
-define(PMLAN_47, "Anvndargrupp:");
-define(PMLAN_48, "Alla anvndare");
-define(PMLAN_49, "Olst");
-define(PMLAN_50, "Du har ftt ett nytt PM!");
-define(PMLAN_51, "Site");
-define(PMLAN_52,"Klicka i kryssrutan fr att bekrfta");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/languages/Turkish.php 75/e107_plugins/pm_menu/languages/Turkish.php
--- 6171/e107_plugins/pm_menu/languages/Turkish.php	2004-05-10 04:18:18.000000000 -0500
+++ 75/e107_plugins/pm_menu/languages/Turkish.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,50 +0,0 @@
-<?php
-define(PMLAN_PM,"zel leti(ler)");
-define(PMLAN_0, "Okunmam leti");
-define(PMLAN_1, "Alnan ileti");
-define(PMLAN_2, "Gnderilen ileti");
-define(PMLAN_3, "Kullanc Blokland");
-define(PMLAN_4, "Bloklanan Kullanclar");
-define(PMLAN_5, "Yeni zel leti Gnder");
-define(PMLAN_6, "Grntle");
-define(PMLAN_7, "zin Verilmedi");
-define(PMLAN_8, "zel mesaj gnderebilmek iin kaytl kullanc olmanz gerekmektedir");
-define(PMLAN_9, "zel ileti gnder");
-define(PMLAN_10, "leti gnderme Hatas");
-define(PMLAN_11, "letiyi Gnder");
-define(PMLAN_12, "KULLANICI");
-define(PMLAN_13, "yok");
-define(PMLAN_14, "leti silindi");
-define(PMLAN_15, "leti gnderilen kii:");
-define(PMLAN_16, "zel ileti gnderme izniniz yok ");
-define(PMLAN_17, "Bu kullanc zel iletilerinizi bloklad.");
-define(PMLAN_18, "zel ileti bloklama talebiniz kabul edildi (Kime:) ");
-define(PMLAN_19, " zel ileti gndermenize izin vermiyor.");
-define(PMLAN_20, "Bu bloklamay kaldramazsnz!");
-define(PMLAN_21, "Bloklama zaten mevcut! Kimden: ");
-define(PMLAN_22, "Balad: ");
-define(PMLAN_23, " letiler blokland.");
-define(PMLAN_24, "Aktif blok bulunamad.");
-define(PMLAN_25, "Geerli zel ileti Bloklar");
-define(PMLAN_26, "zel iletiyi yantla");
-define(PMLAN_27, "leti");
-define(PMLAN_28, "zel ileti gnder");
-define(PMLAN_29, "Konu:");
-define(PMLAN_30, "letiniz:");
-define(PMLAN_31, "Kime");
-define(PMLAN_32, "Yzler:");
-define(PMLAN_33, "Alcy se");
-define(PMLAN_34, "Gnderme Tarihi");
-define(PMLAN_35, "Kimden:");
-define(PMLAN_36, "Varsaylan Blok ayaralar");
-define(PMLAN_37, "Bu iletiyi grmeye yetkiniz yok");
-define(PMLAN_38, "Kullancy blokla");
-define(PMLAN_39, "Kullancy Blokla");
-define(PMLAN_40, "Sil");
-define(PMLAN_41, "Yantla");
-define(PMLAN_42, "zgn Alnt");
-define(PMLAN_43, "leti Gnder:");
-define(PMLAN_44, "leti Oku:");
-define(PMLAN_45, "Okunmam leti(ler):");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/parse/parse_sendpm.php 75/e107_plugins/pm_menu/parse/parse_sendpm.php
--- 6171/e107_plugins/pm_menu/parse/parse_sendpm.php	2004-05-14 17:37:54.000000000 -0500
+++ 75/e107_plugins/pm_menu/parse/parse_sendpm.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,14 +0,0 @@
-<?php
-function parse_sendpm($match,$referrer){
-	global $pref;
-	$m = explode(".",$match[1]);
-	@include_once(e_PLUGIN."pm_menu/languages/".e_LANGUAGE.".php");
-	@include_once(e_PLUGIN."pm_menu/languages/English.php");
-	if(check_class($pref['pm_userclass'])){
-		$img=(file_exists(THEME."forum/pm.png")) ? "<img src='".THEME."forum/pm.png' alt='".PMLAN_PM."' title='".PMLAN_PM."' style='border:0' />" : "<img src='".e_IMAGE."forum/pm.png' alt='".PMLAN_PM."' title='".PMLAN_PM."' style='border:0' />";
-		return  "<a href='".e_PLUGIN."pm_menu/pm.php?send.{$m[2]}'>{$img}</a>";
-	} else {
-		return "";
-	}
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/parser.php 75/e107_plugins/pm_menu/parser.php
--- 6171/e107_plugins/pm_menu/parser.php	2004-05-12 21:01:40.000000000 -0500
+++ 75/e107_plugins/pm_menu/parser.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,12 +0,0 @@
-<?php
-function pm_menu_parse($match,$referrer){
-	global $pref;
-	@include_once(e_PLUGIN."pm_menu/languages/".e_LANGUAGE.".php");
-	@include_once(e_PLUGIN."pm_menu/languages/English.php");
-	
-	if('SENDPM' == $match[1] AND (check_class($pref['pm_userclass']) || $referrer=='admin')){
-		$img=(file_exists(THEME."forum/pm.png")) ? "<img src='".THEME."forum/pm.png' alt='".PMLAN_PM."' title='".PMLAN_PM."' style='border:0' />" : "<img src='".e_IMAGE."forum/pm.png' alt='".PMLAN_PM."' title='".PMLAN_PM."' style='border:0' />";
-		return  "<a href='".e_PLUGIN."pm_menu/pm.php?send.{$match[2]}'>{$img}</a>";
-	}
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/plugin.php 75/e107_plugins/pm_menu/plugin.php
--- 6171/e107_plugins/pm_menu/plugin.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/pm_menu/plugin.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-        http://e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-@include_once(e_PLUGIN."pm_menu/languages/admin/".e_LANGUAGE.".php");
-@include_once(e_PLUGIN."pm_menu/languages/admin/English.php");
-
-// Plugin info -------------------------------------------------------------------------------------------------------
-$eplug_name = PMLAN_PM;
-$eplug_version = "2.07";
-$eplug_author = "McFly";
-$eplug_logo = "/images/icon_pm.png";
-$eplug_url = "http://mcfly.gotdns.org";
-$eplug_email = "mcfly@e107.org";
-$eplug_description = PM_ADLAN_42; //"This plugin is a fully featured Private Messaging system.";
-$eplug_compatible = "e107v6+";
-$eplug_readme = "pm_readme.txt";        // leave blank if no readme file
-
-// Name of the plugin's folder -------------------------------------------------------------------------------------
-$eplug_folder = "pm_menu";
-
-// Mane of menu item for plugin ----------------------------------------------------------------------------------
-$eplug_menu_name = "pm_menu";
-
-// Name of the admin configuration file --------------------------------------------------------------------------
-$eplug_conffile = "pm_conf.php";
-
-// Icon image and caption text ------------------------------------------------------------------------------------
-$eplug_icon = $eplug_folder."/images/icon_pm.png";
-$eplug_caption =  PM_ADLAN_43; //"Configure Private Messager";
-
-// List of preferences -----------------------------------------------------------------------------------------------
-$eplug_prefs = array(
-        "pm_title" => "PMLAN_PM",
-        "pm_show_animated" => "1",
-        "pm_user_dropdown" => "1",
-        "pm_read_timeout" => "30",
-        "pm_unread_timeout" => "60",
-        "pm_delete_read" => "0",
-        "pm_popup" => "0",
-        "pm_popdelay" => "30",
-        "pm_userclass" => e_UC_MEMBER,
-        "pm_sendemail" => "0"
-);
-
-// List of table names -----------------------------------------------------------------------------------------------
-$eplug_table_names = array(
-        "pm_messages",
-        "pm_blocks"
-);
-
-// List of sql requests to create tables -----------------------------------------------------------------------------
-$eplug_tables = array(
-"CREATE TABLE ".MPREFIX."pm_messages (
-  pm_id int(10) unsigned NOT NULL auto_increment,
-  pm_from_user varchar(100) NOT NULL default '',
-  pm_to_user varchar(100) NOT NULL default '',
-  pm_sent_datestamp int(10) unsigned NOT NULL default '0',
-  pm_rcv_datestamp int(10) unsigned NOT NULL default '0',
-  pm_subject text NOT NULL,
-  pm_message text NOT NULL,
-  PRIMARY KEY  (pm_id)
-) TYPE=MyISAM AUTO_INCREMENT=1",
-"CREATE TABLE ".MPREFIX."pm_blocks (
-  block_id int(10) unsigned NOT NULL auto_increment,
-  block_from varchar(100) NOT NULL default '',
-  block_to varchar(100) NOT NULL default '',
-  block_datestamp int(10) unsigned NOT NULL default '0',
-  block_count int(10) NOT NULL default '0',
-  PRIMARY KEY  (block_id)
-) TYPE=MyISAM AUTO_INCREMENT=1;");
-
-// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
-$eplug_link = FALSE;
-$eplug_link_name = "";
-$eplug_link_url = "";
-
-// Text to display after plugin successfully installed ------------------------------------------------------------------
-$eplug_done = PM_ADLAN_44; // "To activate please go to your menus screen and select the pm_menu into one of your menu areas.";
-
-$eplug_upgrade_done = PM_ADLAN_45." ".$eplug_version;
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/pm_class.php 75/e107_plugins/pm_menu/pm_class.php
--- 6171/e107_plugins/pm_menu/pm_class.php	2005-05-12 23:11:35.000000000 -0500
+++ 75/e107_plugins/pm_menu/pm_class.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,666 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /pm_class.php
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-class pm {
-
-        function pm_check($pmid,$type){
-        /*
-        # Check to see if user is sender,receiver,or either
-        # Paremeter #1        - integer $pmid, ID of PM
-        # Paremeter #2        - string $type, 'from', 'to', 'either'
-        # Return -        boolean, TRUE on success, FALSE on failure
-        */
-                global $sql;
-                if($type != ""){
-                        $from = "pm_from_user = '".USERNAME."' ";
-                        $to = "pm_to_user = '".USERNAME."' ";
-                        if($type == "from"){$qry = $from;}
-                        if($type == "to"){$qry = $to;}
-                        if($type == "either"){$qry = $from." OR ".$to;}
-                        if($sql -> db_Select("pm_messages","*",$qry)){
-                                return TRUE;
-                        }
-                }
-                return FALSE;
-        }
-
-        function delete_pm($pmid) {
-        /*
-        # Delete PM
-        # Paremeter #1        - integer $pmid, ID of PM to delete
-        # Return -        boolean, TRUE on success, FALSE on failure
-        */
-                global $sql;
-                if(!$this -> pm_check($pmid,"to")){return FALSE;}
-                return ($sql -> db_Delete("pm_messages", "pm_id='".$pmid."' "));
-        }
-
-        function Delete_Expired() {
-        /*
-        # Delete expired messages
-        # Paremeters - NONE
-        # Return -        string, "$read_deleted,$unread_deleted"
-        */
-                global $pref;
-                global $ns;
-                $oneday=86400;
-                $time=time();
-                $pm_sql=new db;
-                $text="test<br />";
-                if($pref['pm_read_timeout']>0){
-                        $msg_read_timeout=$time-($oneday*$pref['pm_read_timeout']);
-                        $pm_sql -> db_Select("pm_messages", "pm_id", "pm_rcv_datestamp > 0 AND pm_sent_datestamp < '".$msg_read_timeout."' ");
-                        while(list($pm_msg_id) = $pm_sql-> db_Fetch()){
-                                if($this->delete_pm($pm_msg_id)){$read_deleted++;}
-                        }
-                }
-
-                if($pref['pm_unread_timeout']>0){
-                        $msg_unread_timeout=$time-($oneday*$pref['pm_unread_timeout']);
-                        $pm_sql -> db_Select("pm_messages", "pm_id", "pm_rcv_datestamp = 0 AND pm_sent_datestamp < '".$msg_unread_timeout."' ");
-                        while(list($pm_msg_id) = $pm_sql-> db_Fetch()){
-                                if($this->delete_pm($pm_msg_id)){$unread_deleted++;}
-                        }
-                }
-                return $read_deleted.",".$unread_deleted;
-        }
-
-        function UserclassDropdownList(){
-        /*
-        # Create dropdown list of userclasses
-        # Paremeters - NONE
-        # Return -        string, drowdown list as form element 'option'
-        */
-                global $pref;
-                $ret="<option SELECTED value=''>".PMLAN_33."\n";
-                if(ADMINPERMS=="0" && $pref['pm_userclass'] == e_UC_MEMBER){
-                        $ret.="<option value='ALL'>".PMLAN_48."\n";
-                }
-                if($pref['pm_userclass'] == e_UC_MEMBER){
-                        $pm_sql=new db;
-                        $pm_sql -> db_Select("userclass_classes", "userclass_id,userclass_name","ORDER BY userclass_name","nowhere");
-                        while(list($ucid,$ucname) = $pm_sql-> db_Fetch()){
-                                if(check_class($ucname) || ADMINPERMS=="0"){
-                                        $ret.="<option value='".$ucid.":".$ucname."'>".$ucname."\n";
-                                }
-                        }
-                } else {
-                        $pm_sql=new db;
-                        $pm_sql -> db_Select("userclass_classes", "userclass_id,userclass_name","userclass_id='{$pref['pm_userclass']}' ORDER BY userclass_name");
-                        while(list($ucid,$ucname) = $pm_sql-> db_Fetch()){
-                                $ret.="<option value='".$ucid.":".$ucname."'>".$ucname."\n";
-                        }
-                }
-                return $ret;
-        }
-
-        function UserDropdownList(){
-        /*
-        # Create dropdown list of users
-        # Paremeters - NONE
-        # Return -        string, drowdown list as form element 'option'
-        */
-                global $pref;
-                $qry.=" ORDER BY user_name";
-                $ret="<option SELECTED value=''>".PMLAN_33."\n";
-                $pm_sql=new db;
-                $pm_sql -> db_Select("user", "user_name,user_class",$qry,"nowhere");
-                while(list($uname,$uclass) = $pm_sql-> db_Fetch()){
-                        if($pref['pm_userclass'] == e_UC_MEMBER || check_class($pref['pm_userclass'],$uclass)){
-                                $ret.="<option value='".$uname."'>".$uname."\n";
-                        }
-                }
-                return $ret;
-        }
-
-        function MarkMsgRead($msgid) {
-        /*
-        # Mark PM as read
-        # Paremeter #1 - integer $msgid, ID of PM to mark as read
-        # Return -        integer, timestamp of msg read
-        */
-                $readtime=time();
-                $pm_sql=new db;
-                $pm_sql -> db_Update("pm_messages", "pm_rcv_datestamp='".$readtime."' WHERE pm_id='".$msgid."' AND pm_rcv_datestamp='0'");
-                return $readtime;
-        }
-
-        function read_summary($start=0,$np_query) {
-        /*
-        # Show summary of received messages
-        # Paremeter #1 - integer $start, begining record number
-        # Return -        String, entire summary table
-        */
-                define("FTHEME", (file_exists(THEME."forum/newthread.png") ? THEME."forum/" : e_IMAGE."forum/"));
-
-                global $ns;
-                $max_per_page = 10;
-                $ret="";
-                $obj=new convert;
-                $pm_sql=new db;
-                $rcv_total = $pm_sql -> db_Select("pm_messages", "*", "pm_to_user = '".USERNAME."' ORDER BY pm_sent_datestamp ");
-                if($rcv_total > $max_per_page){
-                        require_once(e_HANDLER."np_class.php");
-                        $np = new nextprev;
-                }
-                $count = $pm_sql -> db_Select("pm_messages", "*", "pm_to_user = '".USERNAME."' ORDER BY pm_sent_datestamp DESC LIMIT {$start},{$max_per_page}");
-//                echo $rcv_total;
-                $ret .= "<form name='delpm' method='post'>";
-                $ret .= "<table style='width:97%; text-align:center' class='fborder'>";
-                $ret.="<tr>";
-                $ret.="<td style='width:1%; text-align:center' class='fcaption'>&nbsp;</td>";
-                $ret.="<td style='width:9%; text-align:center' class='fcaption'>&nbsp;</td>";
-                $ret.="<td colspan='2' style='width:45%; text-align:center' class='fcaption'>".PMLAN_PM."</td>";
-                $ret.="<td style='width:20%; text-align:center' class='fcaption'>".PMLAN_34."</td>";
-                $ret.="<td style='width:10%; text-align:center' class='fcaption'>".PMLAN_35."</td>";
-                $ret.="<td style='width:25%; text-align:center' class='fcaption'>&nbsp;</td>";
-                $ret.="</tr>";
-
-                while(list($pm_msg_id, $pm_from_user, $pm_to_user, $pm_send_datestamp,$pm_rcv_datestamp,$pm_subject,$pm_message) = $pm_sql-> db_Fetch()){
-                        $ret.="<tr>";
-                        $ret .= "<td style='width:1%;' class='forumheader3'><input style='tbox' type='checkbox' name='delid[{$pm_msg_id}]'></td>";
-                        $ret.="<td style='width:9%; text-align:left' class='forumheader3'>";
-                        $ret.=$this->avatarget($pm_from_user);
-                        $ret.="</td>";
-                        $new_img = ($pm_rcv_datestamp > 0) ? "nonew.png" : "new.png";
-                        $ret.="<td style='width:5%; text-align:center' class='forumheader3'><img src='".FTHEME."{$new_img}' alt='' style='float:left' /></td>";
-                        $ret.="<td style='width:40%; text-align:left' class='forumheader3'><a href='".e_SELF."?view.".$pm_msg_id."'>".$pm_subject."</a></td>";
-                        $ret.="<td style='width:20%; text-align:center' class='forumheader3'>".$obj->convert_date($pm_send_datestamp,"short")."</td>";
-                        $ret.="<td style='width:10%; text-align:center' class='forumheader3'>".$this->userlink($pm_from_user)."</td>";
-                        $row=$this->is_blocked($pm_from_user,USERNAME);
-                        if(!$row){
-                                $ret.="<td style='width:25%; text-align:left' class='forumheader3'>[<a href='".e_SELF."?block.".$pm_from_user."'>".str_replace(" ","&nbsp;",PMLAN_38)."</a>]";
-                        } else {
-                                $ret.="<td style='width:25%; text-align:left' class='forumheader3'> ".PMLAN_62."&nbsp;";
-                        }
-                        $ret.=" [<a href='".e_SELF."?del.".$pm_msg_id."'>".PMLAN_40."</a>]</td>";
-                        $ret.="</tr>\n";
-                }
-                if($count){
-                        $ret .= "<tr><td colspan='7' style='text-align:left;'><input class='tbox' type='submit' name='delsel' value='".PMLAN_58."'></td></tr>";
-                }
-                $ret.="</table></form>\n";
-                if($rcv_total > $max_per_page){
-                        ob_end_flush();
-                        ob_start();
-                        $np -> nextprev(e_SELF,$start,$max_per_page,$rcv_total,"",$np_query);
-                        $ret .= ob_get_contents();
-                        ob_end_clean();
-                }
-                return $ret;
-        }
-
-        function view_pm($msgnum) {
-        /*
-        # Display PM contents
-        # Paremeter #1         - integer $msgnum, ID of PM message
-        # Return -        String, message contents or 0 if was not marked as read
-        */
-                $ret="";
-                $obj=new convert;
-                $aj = new textparse;
-                global $pref;
-                $delete_on_read=$pref['pm_delete_read'];
-                $pm_sql=new db;
-                $pm_sql -> db_Select("pm_messages", "*", "pm_id = '{$msgnum}' ");
-                list($pm_msg_id, $pm_from_user, $pm_to_user, $pm_send_datestamp,$pm_rcv_datestamp,$pm_subject,$pm_message) = $pm_sql-> db_Fetch();
-                ///check if correct 'to' user
-                if($pm_to_user != USERNAME && $pm_from_user != USERNAME){
-                        pm_show_message(PMLAN_37);
-                        return "FAIL";
-                }
-                //  Mark Message as Read
-                if(!$pm_rcv_datestamp && $pm_to_user == USERNAME){
-                        $this->MarkMsgRead($msgnum);
-                        return "MARK";
-                }
-                if($delete_on_read && $pm_to_user == USERNAME){
-                        $this->delete_pm($msgnum);
-                }
-                $ret.="<table style='width:97%; text-align:center' class='fborder'><tr><td>\n";
-                $ret.="<table style='width:100%' class='fborder'>\n";
-                $ret.="<tr>\n";
-                $ret.="<td colspan='2' style='width:100%; text-align:center;' class='fcaption'>".$aj->tpa($pm_subject)."</td>\n";
-                $ret.="</tr><tr>\n";
-                $ret.= "<td style='width:20%; vertical-align:top;' class='forumheader3'>";
-                if($pm_to_user == USERNAME){
-                        $ret .= "<div class='mediumtext'>".PMLAN_35.":<br /><b>".$this->UserLink($pm_from_user)."</b>";
-                } else {
-                        $ret .= "<div class='mediumtext'>".PMLAN_31.":<br /><b>".$this->UserLink($pm_to_user)."</b>";
-                }
-
-                $ret .= "<br /><br /></div><div class='smallblacktext'>".PMLAN_43."<br />".$obj->convert_date($pm_send_datestamp,"long")."<br /><br /></div>\n";
-                $ret.="<div class='smallblacktext'>".PMLAN_44."<br />";
-                $ret .= ($pm_rcv_datestamp) ? $obj->convert_date($pm_rcv_datestamp,"long") : PMLAN_49;
-                $ret .= "<br />";
-                if(!$delete_on_read && $pm_to_user == USERNAME){
-                        $ret.="<br />[<a href='".$PHP_SELF."?del.".$pm_msg_id."'>".PMLAN_40."</a>]";
-                }
-                $ret.="<br /></div></td>\n";
-                $view_message=$pm_message;
-                $view_message=$aj->tpa($view_message);
-                $view_message = str_replace("\\r\\n","<br />", $view_message);
-                $ret.="<td style='width:80%; vertical-align:top' class='forumtable2'>".$view_message."</td>\n";
-                $ret.="</tr></table>\n";
-                if($pm_to_user == USERNAME){
-                        $ret.="<table style='width:100%'>\n";
-                        $ret.="<tr><td style='text-align:center;'>
-                        <form action='".e_SELF."' method='post'>
-                        <input class='button' type='submit' name='reply' value='".PMLAN_41."'>
-                        <input type='hidden' name='msgid' value='".$pm_msg_id."'>
-                        <input type='hidden' name='uname' value='".$pm_from_user."'>
-                        <input type='hidden' name='sub' value='".stripslashes($pm_subject)."'>
-                        <input type='hidden' name='quoted' value='".stripslashes($pm_message)."'>
-                        <input class='tbox' type='checkbox' name='quote'><span class='smallblacktext'> ".PMLAN_42."</span>
-                        </form></td></tr></table>";
-                }
-                $ret.="</td></tr></table>\n";
-                return $ret;
-        }
-
-        function sent_summary() {
-        /*
-        # Show summary of sent messages
-        # Paremeters          - NONE
-        # Return -        String, entire summary table
-        */
-                $ret="";
-                $obj=new convert;
-                $pm_sql=new db;
-                $pm_sql -> db_Select("pm_messages", "*", "pm_from_user = '".USERNAME."' ORDER BY pm_sent_datestamp DESC");
-
-                $ret.="<table style='width:97%; text-align:center' class='fborder'>";
-                $ret.="<tr>";
-                $ret.="<td colspan='2' style='text-align:center' class='fcaption'>".PMLAN_PM."</td>";
-                $ret.="<td style='text-align:center' class='fcaption'>".PMLAN_43."</td>";
-                $ret.="<td style='text-align:center' class='fcaption'>".PMLAN_31."</td>";
-                $ret.="<td style='text-align:center' class='fcaption'>".PMLAN_44."</td></tr>";
-                while(list($pm_msg_id, $pm_from_user, $pm_to_user, $pm_send_datestamp,$pm_rcv_datestamp,$pm_subject,$pm_message) = $pm_sql-> db_Fetch()){
-                        $ret.="<tr>";
-                        if($pm_rcv_datestamp > 0){
-                                $ret.="<td style='width:5%; text-align:center' class='forumheader3'><img src='images/nonew.png' alt='' /></td>";
-                        } else {
-                                $ret.="<td style='width:5%; text-align:center' class='forumheader3'><img src='images/new.png' alt='' /></td>";
-                        }
-                        $ret.="<td style='width:40%; text-align:left' class='forumheader3'><a href='".e_SELF."?view.".$pm_msg_id."'>".$pm_subject."</a></td>";
-                        $ret.="<td style='width:20%; text-align:center' class='forumheader3'>".$obj->convert_date($pm_send_datestamp,"short")."</td>";
-                        $ret.="<td style='width:10%; text-align:center' class='forumheader3'>".$this->userlink($pm_to_user)."</td>";
-                        if($pm_rcv_datestamp>0){
-                                $ret.="<td style='width:25%; text-align:center' class='forumheader3'>".$obj->convert_date($pm_rcv_datestamp,"short")."</td>";
-                        } else {
-                                $ret.="<td style='width:25%; text-align:center' class='forumheader3'>".PMLAN_49."</td>";
-                        }
-                        $ret.="</tr>\n";
-                }
-                $ret.="</table>\n";
-                return $ret;
-        }
-
-        function send_message($uid="",$reply_msg="",$pm_subject="",$pm_message="") {
-        /*
-        # Show send message form
-        # Paremeter #1         - string $uid, ID of user to send message to
-        # Paremeter #2         - string $reply_msg, msg if replying
-        # Paremeter #3         - string $pm_subject, subject of PM
-        # Paremeter #4         - string $pm_message, PM Message body
-        # Return -        String, entire form
-        */
-                require_once(e_HANDLER."emote.php");
-                require_once(e_HANDLER."ren_help.php");
-                $pm_sql=new db;
-                $ret="";
-                global $pref;
-
-                $ret.="
-                <table style'width:100%' class='fborder'>
-                <tr><td colspan='2' style='width:60%' class='fcaption'>".PMLAN_28."</td></tr>
-                ";
-                global $user_dropdown;
-                if($reply_msg){
-                        $pm_from_user=$_POST['uname'];
-                        $pm_subject=$_POST['sub'];
-                        $pm_message=$_POST['quoted'];
-                        if(MAGIC_QUOTES_GPC){ $pm_message = stripslashes($pm_message); }
-                        if(substr($pm_subject,0,3) != "RE:"){
-                                $pm_subject="RE:".$pm_subject;
-                        }
-                        if(!$_POST['quote']){
-                                $pm_message="";
-                        } else {
-                                $pm_message="[quote=".$pm_from_user."]".$pm_message."[/quote]\n\n";
-                        }
-                }
-                $ret.="<form method='post' id='pm' action='".e_SELF."'>\n";
-                $ret.="<input type='hidden' name='from' value='".USERNAME."'>\n";
-                if($pm_from_user){
-                        $ret.="<input type='hidden' name='to' value='".$pm_from_user."'>\n";
-                }
-                $ret.="<tr><td class='forumheader3'>".PMLAN_31.":</td>";
-                $ret.="<td class='forumheader3'>";
-                if($pm_from_user){
-                        $ret.="<b>".$pm_from_user."</b>\n";
-                } else {
-                        if($user_dropdown){
-                                if($uid){
-                                        $ret.="<input type='hidden' name='to' value='".$this->real_name($uid)."'>\n";
-                                        $ret.="<b>".$this->real_name($uid)."</b>\n";
-                                } else {
-                                        $ret.="<input type='radio' name='sendtype' value='user' checked> ".PMLAN_46."&nbsp; <select class='tbox' name='to' size='1'>".$this->UserDropdownList()."</select>";
-                                        if(($pref['pm_userclass'] < e_UC_NOBODY && USERCLASS) || ADMINPERMS=="0"){
-                                                $ret.="<br /><input type='radio' name='sendtype' value='userclass'> ".PMLAN_47."&nbsp; <select class='tbox' name='class' size='1'>".$this->UserclassDropdownList()."</select>";
-                                        }
-                                }
-                        } else {
-                                if($uid){
-                                        $ret.="<input type='hidden' name='to' value='".$this->real_name($uid)."'>\n";
-                                        $ret.="<b>".$this->real_name($uid)."</b>\n";
-                                } else {
-                                        $ret .= "<input class='tbox' type='text' name='to' maxlength='30'>";
-                                        $ret .= "&nbsp;&nbsp;&nbsp;<a class='button' href='".e_PLUGIN."pm_menu/pm_finduser.php' onclick=\"window.open('".e_PLUGIN."pm_menu/pm_finduser.php','pmsearch', 'toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=350,height=350,left=100,top=100'); return false;\">".PMLAN_53."... </a>";
-                                        if(($pref['pm_userclass'] < e_UC_NOBODY && USERCLASS) || ADMINPERMS=="0"){
-                                                $ret.="<br /><input type='radio' name='sendtype' value='userclass'> ".PMLAN_47."&nbsp; <select class='tbox' name='class' size='1'>".$this->UserclassDropdownList()."</select>";
-                                        }
-                                }
-                        }
-                }
-                $ret.="</td></tr>\n";
-                $ret.="<tr><td class='forumheader3'>".PMLAN_29."</td><td class='forumheader3'><input class='tbox' type='text' name='subject' value='".$pm_subject."'></td></tr>\n";
-                $ret.="<tr><td class='forumheader3'>".PMLAN_30."</td><td class='forumheader3'><textarea id='pm_text' name='pm_text' rows='10' cols='50' class='tbox' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$pm_message."</textarea>
-                <br />
-        <input class='helpbox' type='text' id='helpb' name='helpb' size='100' />
-                        <br />
-                ".ren_help(1, "addtextpm", "helppm")."
-                </td></tr>";
-
-                if($pref['smiley_activate']==1){
-                        $ret.="
-                        <tr><td class='forumheader3'>
-                        <div style='text-align:center'>".PMLAN_32."<br /></td><td class='forumheader3'>";
-                        $ret.=r_emote();
-                        $ret.="
-                        </td></div>
-                        </tr>\n
-                        ";
-                }
-                $ret.="<tr><td class='forumheader' colspan='2' style='text-align:center;'><input class='button' type='submit' name='postpm' value='".PMLAN_9."'></td></tr>\n";
-                $ret.="</form>";
-                $ret.="</table>";
-                return $ret;
-        }
-
-        function pm_send_email($user_from,$user_to,$to_email,$subject){
-                global $PLUGINS_DIRECTORY;
-        /*
-        # Send email to user announcing new PM
-        # Paremeter #1         - String $user_to, username
-        # Paremeter #2         - String $user_from, username
-        # Paremeter #3         - String $to_email, email address
-        # Paremeter #4         - String $subject, PM subject
-        # Return -        NONE
-        */
-                $read_link=SITEURL;
-                if(substr(SITEURL,-1,1) != "/"){$read_link .= "/";}
-                $read_link .= $PLUGINS_DIRECTORY."pm_menu/pm.php?read\n\n";
-
-                if($to_email){
-                        require_once(e_HANDLER."mail.php");
-                        $msg=$user_to.",\n\n".PMLAN_50." ".PMLAN_35.": ".$user_from."\n\n";
-                        $msg.=PMLAN_29." ".$subject."\n\n";
-                        $msg.=PMLAN_51.": ".SITENAME."\n\n";
-//                        $msg.=SITEURL.$PLUGINS_DIRECTORY."pm_menu/pm.php?read\n\n";
-                        $msg.=$read_link;
-                        return sendemail($to_email, PMLAN_50, $msg);
-                }
-                return 0;
-        }
-
-        function pm_post_message_user($pm_touser,$pm_text,$pm_subject,$pm_fromuser=USERNAME){
-        /*
-        # Post PM message to database
-        # Paremeter #1         - String $pm_touser, username to send PM to
-        # Paremeter #2         - String $pm_text, text of PM
-        # Paremeter #3         - String $pm_subject, subject of PM
-        # Paremeter #4         - String $pm_fromuser, username of PM sender
-        # Return -        int, 0 if success, 1 if PM blocked, 2 if user not found.
-        */
-                global $ns;
-                global $pref;
-                $tt = new textparse;
-                $pm_subject = htmlentities($pm_subject);
-                $pm_text = htmlentities($pm_text);
-                $pm_sql=new db;
-                $pm_sql -> db_Select("user", "*", "user_name LIKE '".$pm_touser."' ");
-                if($userdata = $pm_sql-> db_Fetch()) {
-                        extract($userdata);
-                        $real_userid=$user_name;
-                        $row=$this->is_blocked($pm_fromuser,$real_userid);
-                        if(is_array($row)){
-                                extract($row);
-                                $block_count++;
-                                $pm_sql -> db_Update("pm_blocks", "block_count='".$block_count."' WHERE block_id='".$block_id."' ");
-                                return 1;
-                        }
-                        ini_set("max_execution_time",30);
-                        $aj = new textparse;
-                        if($pm_subject == ""){$pm_subject=PMLAN_57;}
-                        $pm_text=$tt -> formtpa($pm_text);
-                        $pm_subject = $tt -> formtpa($pm_subject);
-
-                        $vars="0,'{$pm_fromuser}','{$real_userid}','".time()."',0,'{$pm_subject}','{$pm_text}'";
-                        $pm_sql -> db_Insert("pm_messages", $vars);
-                        if($pref['pm_sendemail']){
-                                $this->pm_send_email($pm_fromuser,$real_userid,$user_email,$pm_subject);
-                        }
-                        return 0;
-                } else {
-                        return 2;
-                }
-        }
-
-        function users_in_userclass($userclass){
-        /*
-        # Get all users in a userclass
-        # Paremeter         - string $userclass, userclass
-        # Return -        array
-        */
-                $pm_sql=new db;
-                $ret=array();
-                $pm_sql -> db_Select("user", "user_name,user_class");
-                while(list($uname,$uclass) = $pm_sql-> db_Fetch()){
-                        if(check_class($userclass,$uclass)){
-                                $ret[]=$uname;
-                        }
-                }
-                return $ret;
-        }
-
-
-        function post_pm(){
-        /*
-        # Post PM to individual user or userclass
-        # Paremeters        - NONE
-        # Return -        String success,blocked,notfound
-        */
-
-                if($_POST['sendtype']=="userclass"){
-                        list($ucnum,$ucname)=explode(":",$_POST['class']);
-                        if($ucnum=="ALL"){
-                                if(ADMINPERMS != "0"){
-                                        return "0,0,0";
-                                }
-                                $pm_sql=new db;
-                                $pm_sql -> db_Select("user", "user_name");
-                                while(list($uname) = $pm_sql-> db_Fetch()){
-                                        $res=$this->pm_post_message_user($uname,$_POST['pm_text'],$_POST['subject']);
-                                        if($res==0){$success++;}
-                                        if($res==1){$blocked++;}
-                                        if($res==2){$notfound++;}
-                                }
-                        } else {
-                                if(!check_class($ucnum)){
-                                        return "0,0,0";
-                                }
-                                $userlist=$this->users_in_userclass($ucnum);
-                                foreach($userlist as $uname){
-                                        $res=$this->pm_post_message_user($uname,$_POST['pm_text'],$_POST['subject']);
-                                        if($res==0){$success++;}
-                                        if($res==1){$blocked++;}
-                                        if($res==2){$notfound++;}
-                                }
-                        }
-                } else {
-                        $res=$this->pm_post_message_user($_POST['to'],$_POST['pm_text'],$_POST['subject']);
-                        if($res==0){$success++;}
-                        if($res==1){$blocked++;}
-                        if($res==2){$notfound++;}
-                }
-                return $success.",".$blocked.",".$notfound;
-        }
-
-        function view_block() {
-        /*
-        # Show current PM blocking info
-        # Paremeter         - NONE - uses constant USERNAME
-        # Return -        String showing all blocking info
-        */
-                $ret="";
-                $obj=new convert;
-                $pm_sql=new db;
-                $pm_sql -> db_Select("pm_blocks", "*", "block_to = '".USERNAME."' ");
-                $ret.="<table style='width:100%' class='fborder'>";
-                $ret.="<tr>";
-                $ret.="<td style='width:25%; text-align:center' class='fcaption'>".PMLAN_59."</td>";
-                $ret.="<td style='width:30%; text-align:center' class='fcaption'>".PMLAN_60."</td>";
-                $ret.="<td style='width:20%; text-align:center' class='fcaption'>".PMLAN_61."</td>";
-                $ret.="<td style='width:25%; text-align:center' class='fcaption'>&nbsp; &nbsp;</td>";
-                while(list($block_id, $block_from, $block_to, $block_timestamp,$block_count) = $pm_sql-> db_Fetch()){
-                        $ret.="<tr>";
-                        $ret.="<td style='text-align:left' class='forumheader3'>".$block_from."</td>";
-                        $ret.="<td style='text-align:left' class='forumheader3'>".$obj->convert_date($block_timestamp,"short")."</td>";
-                        $ret.="<td style='text-align:left' class='forumheader3'>".$block_count."</td>";
-                        $ret.="<td style='text-align:left' class='forumheader3'>[<a href='".$PHP_SELF."?unblock.".$block_from."'>".PMLAN_39."</a>]</td>";
-                        $ret.="</tr>\n";
-                }
-                $ret.="</table>\n";
-                return $ret;
-        }
-
-        function UserLink($username){
-        /*
-        # Get link to user info
-        # Paremeter         - String $username, username
-        # Return -        String link to user.php with username if valid user, otherwise return username
-        */
-                $pm_sql=new db;
-                $pm_sql -> db_Select("user", "user_id","user_name='".$username."' ");
-                list($_uid) = $pm_sql-> db_Fetch();
-                if($_uid){
-                        return "<a href='".e_BASE."user.php?id.".$_uid."'>".$username."</a>";
-                } else {
-                        return $username;
-                }
-        }
-
-        function real_name($_id) {
-        /*
-        # Get name as stored in database
-        # Paremeter         - String $_id, userid
-        # Return -        String username
-        */
-                $pm_sql = new db;
-                $pm_sql -> db_Select("user","user_name","user_id='".$_id."' ");
-                if(list($uname)=$pm_sql->db_Fetch()){return $uname;}
-        }
-
-        function avatarget($username){
-        /*
-        # Get path to user avatar image
-        # Paremeter         - String $username, username
-        # Return -        path to avatar image if exists, &nbsp; if no avatar
-        */
-                require_once(e_HANDLER."avatar_handler.php");
-                $pm_sql=new db;
-                $pm_sql -> db_Select("user", "user_image", "user_name='".$username."' ");
-                if(list($user_image)= $pm_sql -> db_Fetch()){
-                        if(ltrim(rtrim($user_image))==""){
-                                return "&nbsp;";
-                        } else {
-                                return "<img src='".avatar($user_image)."' alt='' />";
-                        }
-                } else {
-                        return "&nbsp;";
-                }
-        }
-
-        function is_blocked($from,$to) {
-        /*
-        # Test for existing PM blocking
-        # Paremeter #1                - String $from, username
-        # Parameter #2                - String $to, username
-        # Return -        array if exists, NULL if not exists
-        */
-                $pm_sql=new db;
-                $pm_sql -> db_Select("pm_blocks","*","block_to = '".$to."' AND block_from = '".$from."' ");
-                if($row=$pm_sql->db_Fetch()){
-                        return $row;
-                } else {
-                        return "";
-                }
-        }
-
-
-        function unblock_user($from,$to){
-        /*
-        # Remove PM blocking
-        # Paremeter #1                - String $from, username
-        # Parameter #2                - String $to, username
-        # Return -        1 on success, 0 on failure
-        */
-                global $sql;
-                if($row=$this->is_blocked($from,$to)){
-                        extract($row);
-                        $sql -> db_Delete("pm_blocks", "block_id='".$block_id."' ");
-                        return 1;
-                } else {
-                        return 0;
-                }
-        }
-
-        function block_user($from,$to){
-        /*
-        # Add PM blocking
-        # Paremeter #1                - String $from, username
-        # Parameter #2                - String $to, username
-        # Return -        boolean, TRUE on success, FALSE on failure
-        */
-                global $sql;
-                $obj=new convert;
-                $row=$this->is_blocked($from,$to);
-                if(is_array($row)){
-                        return FALSE;
-                } else {
-                        $vars="0,'".$from."','".USERNAME."',".time().",0";
-                        $sql -> db_Insert("pm_blocks", $vars);
-                        return TRUE;
-                }
-        }
-}
-function headerjs(){
-$script_txt= "        <script type=\"text/javascript\">
-function addtextpm(sc){
-        document.getElementById('pm_text').value += sc;
-}
-function helppm(help){
-        document.getElementById('helpb').value = help;
-}
-</script>\n";
-return $script_txt;
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/pm_conf.php 75/e107_plugins/pm_menu/pm_conf.php
--- 6171/e107_plugins/pm_menu/pm_conf.php	2004-05-10 04:17:52.000000000 -0500
+++ 75/e107_plugins/pm_menu/pm_conf.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,268 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/pm_conf.php
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).	
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-require_once("pm_inc.php");
-require_once(e_ADMIN."auth.php");
-require_once(e_HANDLER."userclass_class.php");
-
-@include_once(e_PM."languages/admin/".e_LANGUAGE.".php");
-@include_once(e_PM."languages/admin/English.php");
-
-
-function Create_yes_no_dropdown($Selname,$SelectedVal){
-	$ret_text="<select class='tbox' name='".$Selname."'>\n";
-	$sqlotd=new db;
-	$sel="";
-	if($SelectedVal == "1"){
-		$sel=" SELECTED";
-	}
-	$ret_text.="<option value='1'".$sel.">".PM_ADLAN_33."\n";
-	$sel="";
-	if($SelectedVal == "0"){
-		$sel=" SELECTED";
-	}
-	$ret_text.="<option value='0'".$sel.">".PM_ADLAN_34."\n";
-	$ret_text.="</select>\n";
-	return $ret_text;
-}
-
-if(!getperms("P")){ header("location:../index.php"); exit;}
-
-function pm_UpdateParm($parmname){
-	global $pref;
-	$pref[$parmname]=$_POST[$parmname];
-}
-
-if(IsSet($_POST['updatesettings'])){
-	
-	if($_POST['pm_userclass']==e_UC_PUBLIC){$_POST['pm_userclass']=e_UC_MEMBER;}
-	pm_UpdateParm("pm_title");
-	pm_UpdateParm("pm_show_animated");
-	pm_UpdateParm("pm_user_dropdown");
-	pm_UpdateParm("pm_read_timeout");
-	pm_UpdateParm("pm_unread_timeout");
-	pm_UpdateParm("pm_delete_read");
-	pm_UpdateParm("pm_popup");
-	pm_UpdateParm("pm_popdelay");
-	pm_UpdateParm("pm_userclass");
-	pm_UpdateParm("pm_sendemail");
-	save_prefs();
-	header("location:pm_conf.php?u");
-	exit;
-}
-
-function pm_del_messages($msg,$where=""){
-   global $sql;
-   global $ns;
-   global $mySQLprefix;
-   $sql->db_Delete("pm_messages",$where);
-   if(!$where){
-   	$sql->db_Select_gen("ALTER TABLE ".$mySQLprefix."pm_messages AUTO_INCREMENT = 1");
-   }
-	$ns->tablerender("",$msg);
-}
-
-function pm_userdropdown(){
-	$ret="<option SELECTED value=''>".PM_ADLAN_4."\n";
-	$pm_sql=new db;
-	$pm_sql -> db_Select("user", "user_name");
-	while(list($uname) = $pm_sql-> db_Fetch()){
-	        $ret.="<option value='".$uname."'>".$uname."\n";
-	}
-	return $ret;
-}
-
-
-if($_POST['cancel']){
-        header("location:".e_SELF);
-        exit;
-}
-
-if($_POST['confirmdelall']){
-        pm_del_messages(PM_ADLAN_5);
-}
-
-if($_POST['confirmdeluser']){
-        $msg=PM_ADLAN_6." '".$_POST['to']."' ".PM_ADLAN_7.".";
-        $where="pm_to_user='".$_POST['to']."' OR pm_from_user='".$_POST['to']."' ";
-        pm_del_messages($msg,$where);
-}
-
-if($_POST['confirmdeldays']){
-        $oneday=86400;
-        $msg=PM_ADLAN_8.$_POST['numdays']." ".PM_ADLAN_9." ".PM_ADLAN_7.".";
-        $dstamp=mktime(0,0,0)-($_POST['numdays']*$oneday);
-        $where="pm_sent_datestamp < '".$dstamp."' ";
-        pm_del_messages($msg,$where);
-}
-
-if($_POST['deldays']){
-	if($_POST['numdays']){
-		$text=PM_ADLAN_10.$_POST['numdays']." ".PM_ADLAN_9.".<br /><br />";
-		$text.="<div style='text-align:center'>
-	<form method='POST' action='".e_SELF."'>
-	<input class='button' type='submit' name='confirmdeldays' value='".PM_ADLAN_11."'>
-	<input class='button' type='submit' name='cancel' value='".PM_ADLAN_12."'>
-	<input type='hidden' name='numdays' value='".$_POST['numdays']."'>
-	</form></div>
-	";
-	} else {
-		$ns->tablerender("",PM_ADLAN_13);
-		require_once(e_ADMIN."footer.php");
-		exit;
-	}
-	$ns->tablerender(PM_ADLAN_14,$text);
-	require_once(e_ADMIN."footer.php");
-	exit;
-}
-
-if($_POST['deluser']){
-        if($_POST['to']){
-                $text=PM_ADLAN_15.$_POST['to']."<br /><br />";
-                $text.="<div style='text-align:center'>
-        <form method='POST' action='".e_SELF."'>
-        <input class='button' type='submit' name='confirmdeluser' value='".PM_ADLAN_11."'>
-        <input class='button' type='submit' name='cancel' value='".PM_ADLAN_12."'>
-        <input type='hidden' name='to' value='".$_POST['to']."'>
-        </form></div>
-        ";
-        } else {
-                $ns->tablerender("",PM_ADLAN_16);
-                require_once(e_ADMIN."footer.php");
-                exit;
-        }
-        $ns->tablerender(PM_ADLAN_17,$text);
-        require_once(e_ADMIN."footer.php");
-        exit;
-}
-
-if($_POST['delall']){
-	$text=PM_ADLAN_18."
-	<br /><br /><div style='text-align:center'>
-	<form method='POST' action='".e_SELF."'>
-	<input class='button' type='submit' name='confirmdelall' value='".PM_ADLAN_11."'>
-	<input class='button' type='submit' name='cancel' value='".PM_ADLAN_12."'>
-	</form></div>
-	";
-	$ns->tablerender(PM_ADLAN_19,$text);
-	require_once(e_ADMIN."footer.php");
-	exit;
-}
-
-if(e_QUERY == "u"){
-	$ns -> tablerender("", "<div style='text-align:center'><b>".PM_ADLAN_20."</b></div>");
-}
-
-$pm_title = $pref['pm_title'];
-$pm_show_animated = $pref['pm_show_animated'];
-$pm_user_dropdown = $pref['pm_user_dropdown'];
-$pm_read_timeout = $pref['pm_read_timeout'];
-$pm_unread_timeout = $pref['pm_unread_timeout'];
-$pm_delete_read = $pref['pm_delete_read'];
-$pm_popup = $pref['pm_popup'];
-$pm_popdelay = $pref['pm_popdelay'];
-$pm_userclass = $pref['pm_userclass'];
-$pm_sendemail = $pref['pm_sendemail'];
-
-$text = "
-
-<form method='post' action='".e_SELF."'>
-<table style='width:95%'>
-<tr>
-<td>".PM_ADLAN_21.": </td>
-<td><input  size='26' class='tbox' type='text' name='pm_title' value='".$pm_title."'>
-</tr>";
-
-$dropdown=Create_yes_no_dropdown("pm_show_animated",$pm_show_animated);
-$text.= "<tr>
-<td>".PM_ADLAN_22."? </td>
-<td>".$dropdown."</td>
-</tr>";
-
-$dropdown=Create_yes_no_dropdown("pm_user_dropdown",$pm_user_dropdown);
-$text.= "
-<tr>
-<td>".PM_ADLAN_23."? </td>
-<td>".$dropdown."</td>
-</tr>";
-
-$dropdown=Create_yes_no_dropdown("pm_delete_read",$pm_delete_read);
-$text.= "
-<tr>
-<td>".PM_ADLAN_24."? </td>
-<td>".$dropdown."</td>
-</tr>";
-
-$text.="<tr>
-<td>".PM_ADLAN_25.": </td>
-<td><input  size='5' class='tbox' type='text' name='pm_read_timeout' value='".$pm_read_timeout."'> ".PM_ADLAN_39."  (0=".PM_ADLAN_40.")
-</tr>";
-
-$text.="<tr>
-<td>".PM_ADLAN_26.": </td>
-<td><input  size='5' class='tbox' type='text' name='pm_unread_timeout' value='".$pm_unread_timeout."'> ".PM_ADLAN_39." (0=".PM_ADLAN_40.")
-</tr>";
-
-$dropdown=Create_yes_no_dropdown("pm_popup",$pm_popup);
-$text.="<tr>
-<td>".PM_ADLAN_27."? </td>
-<td>".$dropdown."</td>
-</tr>";
-
-$text.="<tr>
-<td>".PM_ADLAN_28.": </td>
-<td><input  size='5' class='tbox' type='text' name='pm_popdelay' value='".$pm_popdelay."'> ".PM_ADLAN_41."
-</tr>";
-
-$text.="<tr>
-<td>".PM_ADLAN_29.": </td>
-<td>".r_userclass("pm_userclass",$pm_userclass)."</td>
-</tr>";
-
-$dropdown=Create_yes_no_dropdown("pm_sendemail",$pm_sendemail);
-$text.="<tr>
-<td>".PM_ADLAN_35."? </td>
-<td>".$dropdown."</td>
-</tr>";
-
-
-$text.="<tr>
-<tr style='vertical-align:top'>
-<td colspan='2'  style='text-align:center'><br />
-<input class='button' type='submit' name='updatesettings' value='".PM_ADLAN_3."' />
-</td>
-</tr>
-</table>
-</form>";
-
-$ns -> tablerender("<div style='text-align:center'>".PM_ADLAN_1."</div>", $text);
-
-$msg_count=$sql -> db_Select("pm_messages");
-
-$text="
-<form method='POST' name ='pm' action='".e_SELF."'>
-<input class='button' type='submit' name='delall' value='".PM_ADLAN_19."'> (".$msg_count." ".PM_ADLAN_37.")
-<br /><br />
-<input class='button' type='submit' name='deldays' value='".PM_ADLAN_32." ...'>
-&nbsp;&nbsp;<input class='tbox' type='text' name='numdays' size='2'>&nbsp;&nbsp;".PM_ADLAN_9."
-<br /><br />
-
-<input class='button' type='submit' name='deluser' value='".PM_ADLAN_14."'>
-<input class='tbox' type='text' name='to' maxlength='30'>
-<a class='button' href='".e_PLUGIN."pm_menu/pm_finduser.php' onclick=\"window.open('".e_PLUGIN."pm_menu/pm_finduser.php','pmsearch', 'toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=350,height=350,left=100,top=100'); return false;\">".PM_ADLAN_38."... </a>
-
-
-</form>
-";
-
-$ns -> tablerender("<div style='text-align:center'>".PM_ADLAN_2."</div>", $text);
-require_once(e_ADMIN."footer.php");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/pm_finduser.php 75/e107_plugins/pm_menu/pm_finduser.php
--- 6171/e107_plugins/pm_menu/pm_finduser.php	2004-05-10 04:17:52.000000000 -0500
+++ 75/e107_plugins/pm_menu/pm_finduser.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,81 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/pm_finduser.php
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).	
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-@include_once(e_PLUGIN."pm_menu/languages/".e_LANGUAGE.".php");
-
-echo "
-<link rel=stylesheet href='".THEME."style.css'>
-<script language='JavaScript' type='text/javascript'>
-<!--
-function SelectUser()
-{
-   var d = window.document.results.usersel.value;
-   parent.opener.document.pm.to.value = d;
-	this.close();
-}
-//-->
-</script>
-";
-
-
-function findusers($s){
-	global $sql;
-	if($sql -> db_Select("user","*","user_name LIKE '%{$s}%' ")){
-		while($row = $sql -> db_Fetch()){
-			$ret[] = $row['user_name'];
-		}
-	} else {
-		$ret[]="No matches found";
-	}
-	return $ret;
-}
-function close_window(){
-	this.close;
-}
-$text = "
-<form action=".e_SELF." method='POST'>
-<table style='width:100%'>
-<tr>
-	<td class='forumheader3'><input type='text' name='srch' class='tbox' value='".$_POST['srch']."'>
-	<input class='button' type='submit' name='dosrch' class='tbox' value='Search'></td>
-</tr>
-</table>
-</form>
-";
-
-if($_POST['dosrch']){
-	$userlist=findusers($_POST['srch']);
-	$text .= "
-<form name='results' action=".e_SELF." method='POST'>
-<table style='width:100%'>
-<tr><td class='fcaption'>".count($userlist)." ".PMLAN_55."</td></tr>
-<tr>
-	<td class='forumheader2'>
-	<select name='usersel' width='60' ondblclick='SelectUser()'>
-	";
-	foreach($userlist as $u){
-		$text .= "<option value='{$u}'>{$u}";
-	}
-	$text .= "
-	</select>
-		<input type='button' class='button' value='".PMLAN_54."' onClick='SelectUser()'>
-	</td>
-	
-</tr>
-</table>
-</form>
-";	
-}
-
-$text .= "<div style='text-align:center'><br /><a class='button' href='javascript:window.close()'>".PMLAN_56."</a></div>";
-$ns -> tablerender(PMLAN_53,$text);
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/pm_inc.php 75/e107_plugins/pm_menu/pm_inc.php
--- 6171/e107_plugins/pm_menu/pm_inc.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/pm_menu/pm_inc.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,81 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system                                    |
-|        /pm_inc.php                                            |
-|                                                               |
-|                                                               |
-|        Released under the terms and conditions of the         |
-|        GNU General Public License (http://gnu.org).           |
-+---------------------------------------------------------------+
-*/
-define("e_PM",e_PLUGIN."pm_menu/");
-@include_once(e_PLUGIN."pm_menu/languages/".e_LANGUAGE.".php");
-@include_once(e_PLUGIN."pm_menu/languages/English.php");
-
-function pm_show_icon($to_id,$pm_icon=""){
-        global $pref;
-        if(!$pref['pm_title']){return "";}
-        if(!$pm_icon){$pm_icon=e_IMAGE."forum/pm.png";}
-        $sql = new db;
-        if(check_class($pref['pm_userclass'],USERCLASS)){
-                if($sql -> db_Select("user","user_class","user_id={$to_id}")){
-                        $row = $sql -> db_Fetch();
-                        if(check_class($pref['pm_userclass'],$row['user_class'])){
-                                return "<a href='".e_PLUGIN."pm_menu/pm.php?send.{$to_id}'><img src='".$pm_icon."' title='".PMLAN_PM."' alt='' style='border:0' /></a>";
-                        }
-                }
-        }
-        return "";
-}
-
-function pm_get_stats($user=USERNAME,$time=USERLV){
-        $sql = new db;
-        $ret['new']=$sql -> db_Count("pm_messages", "(*)", "WHERE pm_to_user = '{$user}' AND pm_sent_datestamp > {$time}  ");
-        $ret['received'] = $sql -> db_Count("pm_messages", "(*)", "WHERE pm_to_user = '{$user}' ");
-        $ret['unread_rcv_pm'] = $sql -> db_Count("pm_messages", "(*)", "WHERE pm_to_user = '{$user}' AND pm_rcv_datestamp = 0");
-        $ret['sent_pm'] = $sql -> db_Count("pm_messages", "(*)", "WHERE pm_from_user = '{$user}' ");
-        $ret['unread_send_pm'] = $sql -> db_Count("pm_messages", "(*)", "WHERE pm_from_user = '{$user}' AND pm_rcv_datestamp = 0");
-        $ret['blocks'] = $sql -> db_Count("pm_blocks", "(*)", "WHERE block_to = '{$user}' ");
-        return $ret;
-}
-
-function pm_show_stats($no_show_br=0){
-        global $ns;
-        global $pref;
-        $pmstats=pm_get_stats();
-        if(USER == TRUE || ADMIN == TRUE){
-                $pm_sql=new db;
-                $time = USERLV;
-                $text = (!$no_show_br) ? "<br /><br />" : "";
-                if($pmstats['unread_rcv_pm']>0){
-                        if($pref['pm_show_animated']){
-                                $newpm_image = (file_exists(THEME."images/newpm.gif") ? THEME."images/newpm.gif" : e_PM."images/newpm.gif");
-                                $text.="<a href='".e_PM."pm.php?read'><img src='".$newpm_image."' style='border:0' alt='' /></a><br />";
-                        }
-                        if($pref['pm_popup'] && !preg_match("/pm\.php/",e_SELF) && $_COOKIE["pm-alert"] !="ON"){
-                                $alertdelay = $pref['pm_popdelay'];
-                                setcookie("pm-alert", "ON", time()+$alertdelay);
-                                $popuptext="<html><head ><title>".$pmstats['new']." ".PMLAN_0."</title><link rel=stylesheet href=" . THEME . "style.css></head><body style=padding-left:2px;padding-right:2px;padding:2px;padding-bottom:2px;margin:0px;align;center marginheight=0 marginleft=0 topmargin=0 leftmargin=0><table width=100% align=center style=width:100%;height:99%padding-bottom:2px class=bodytable height=99% ><tr><td width=100% ><center><b>--- ".PMLAN_PM." ---</b><br />".$pmstats['new']." ".PMLAN_0."<br />".$pmstats['unread_rcv_pm']." ".PMLAN_45."<br><br /><form><input class=button type=submit onclick=\\\\\"self.close()\\\\\" value=\\\\\"ok\\\\\"></form></center></td></tr></table></body></html>";
-                                $text.="
-<script type='text/javascript'>
-winl=(screen.width-200)/2;
-wint=(screen.height-100)/2;
-winProp = 'width=200,height=100,left='+winl+',top='+wint+',scrollbars=no';
-window.open('javascript:document.write(\"".$popuptext."\");',\"pm_popup\",winProp);
-</script>";
-                        }
-                }
-                if($pmstats['new']){$text.=$pmstats['new']." ".PMLAN_0."<br />\n";}
-                $text .= ($pmstats['received'] > 0) ? "<a class='smalltext' href='".e_PM."pm.php?read'>{$pmstats['received']} ".PMLAN_1."</a> ({$pmstats['unread_rcv_pm']})<br />" : $pmstats['received']." ".PMLAN_1."<br />";
-                $blocks = $pmstats['blocks'];
-                $text .= ($pmstats['sent_pm']>0) ? "<a class='smalltext' href='".e_PM."pm.php?sent'>{$pmstats['sent_pm']} ".PMLAN_2."</a> ({$pmstats['unread_send_pm']})<br />" : $pmstats['sent_pm']." ".PMLAN_2."<br />";
-                $text .= ($pmstats['blocks'] == 1) ? $pmstats['blocks']." ".PMLAN_3 : $pmstats['blocks']." ".PMLAN_4;
-                if($pmstats['blocks']>0){$text.=" - <a class='smalltext' href='".e_PM."pm.php?vb'>".PMLAN_6."</a>";}
-                $text.="<br />\n";
-                $text.="[<a href='".e_PM."pm.php?send'>".PMLAN_5."</a>]";
-                $text.="<br />\n";
-                return "<span class='smalltext'>".$text."</span>";
-        }
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/pm_menu.php 75/e107_plugins/pm_menu/pm_menu.php
--- 6171/e107_plugins/pm_menu/pm_menu.php	2004-05-10 04:17:52.000000000 -0500
+++ 75/e107_plugins/pm_menu/pm_menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,7 +0,0 @@
-<?php
-if((USER && check_class($pref['pm_userclass'])) || ADMINPERMS=="0"){
-	require_once(e_PLUGIN."pm_menu/pm_inc.php");
-	$caption = ($pref['pm_title'] == "PMLAN_PM") ? PMLAN_PM : $pref['pm_title'];
-	$ns->tablerender($caption,pm_show_stats(1));
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/pm.php 75/e107_plugins/pm_menu/pm.php
--- 6171/e107_plugins/pm_menu/pm.php	2004-05-10 04:17:52.000000000 -0500
+++ 75/e107_plugins/pm_menu/pm.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,286 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system                                    |
-|        /pm.php                                                |
-|                                                               |
-|                                                               |
-|        Released under the terms and conditions of the         |
-|        GNU General Public License (http://gnu.org).           |
-+---------------------------------------------------------------+
-*/
-require_once("../../class2.php");
-require_once(e_PLUGIN."pm_menu/pm_inc.php");
-require_once(e_PM."pm_class.php");
-
-$PMREAD="
-{PMREADSUMMARY}
-{PMSENDFORM}
-";
-
-$PMSENT="
-{PMSENTSUMMARY}
-{PMSENDFORM}
-";
-
-$PMSEND="
-{PMSENDFORM}
-{PMREADSUMMARY}
-";
-
-$PMREPLY="
-{PMREPLY}
-{PMREADSUMMARY}
-";
-
-
-$user_dropdown=$pref['pm_user_dropdown'];
-global $pref;
-
-if($pref['pm_userclass'] && !check_class($pref['pm_userclass'])){$notallowed=1;}
-if(ADMINPERMS==0){$notallowed=0;}
-if(USER == FALSE){$notallowed=1;}
-
-if($notallowed){
-	require_once(HEADERF);
-	$ns->tablerender(PMLAN_7,PMLAN_8);
-	require_once(FOOTERF);
-	exit;
-}
-
-////////////////  BEGIN MAIN CODE /////////////////////////
-$pm=new pm;
-$pm->Delete_Expired();
-$text="";
-
-list($qstr,$msg)=explode(",",e_QUERY);
-define("PM_QUERY",$qstr);
-
-
-if($_POST['delsel']){
-	foreach(array_keys($_POST['delid']) as $i){
-		$pm -> delete_pm($i);
-	}
-}
-
-if(preg_match("#read#",PM_QUERY) || PM_QUERY=="" && !$_POST['reply'] && !$_POST['postpm']){
-	$parms=explode(".",PM_QUERY);
-	$readstart = (is_numeric($parms[0])) ? $parms[0] : 0;
-	$np_query="read";
-	require_once(HEADERF);
-	if($msg){
-		pm_show_message($msg);
-	}
-	pm_parseformat($PMREAD);
-}
-
-if(eregi(PMLAN_9,$_POST['postpm'])){
-	list($success,$failed,$notfound)=explode(",",$pm->post_pm());
-	if($_POST['sendtype'] == "userclass"){
-		list($cnum,$cname)=explode(":",$_POST['class']);
-		if($_POST['class'] == "ALL"){$cname=PMLAN_48;}
-		header("location:pm.php?,ms.".preg_replace("# #","_",$cname)); exit;
-	} else {
-		if($notfound){
-			require_once(HEADERF);
-			$ns->tablerender(PMLAN_10,PMLAN_12.": ".$_POST['to']." ".PMLAN_13." .");
-			$ns->tablerender(PMLAN_11,$pm->send_message("","",$_POST['subject'],$_POST['pm_text']));
-		} elseif($failed){
-			header("location:pm.php?send,mb.".$_POST['to']); exit;
-		} else {
-			header("location:pm.php?read,ms.".$_POST['to']); exit;
-		}
-	}
-}
-
-if(preg_match("/^del\./",PM_QUERY)){
-	$tmp=explode(".",PM_QUERY);
-	if($pm->delete_pm($tmp[1])){
-		header("location:pm.php?read,md"); exit;
-	} else {
-		header("location:pm.php?read"); exit;
-	}
-}
-
-if(preg_match("/view\./",PM_QUERY)){
-	$tmp=explode(".",PM_QUERY);
-	$msg_id=$tmp[1];
-	$readstart=0;
-	$np_query=PM_QUERY;
-	if($tmp[1] == "view"){
-		$msg_id=$tmp[2];
-		$np_query=$tmp[1].".".$tmp[2];
-		$readstart=$tmp[0];
-	}
-
-   $msgtext=$pm->view_pm($msg_id);
-   if($msgtext){
-   	switch($msgtext){
-   		case("MARK"):
-				header("location:pm.php?".e_QUERY); exit;
-				break;
-   		case("FAIL"):
-				require_once(HEADERF);
-   			break;
-   		default:
-				require_once(HEADERF);
-				$ns->tablerender(PMLAN_27,$msgtext);
-				$ns->tablerender(PMLAN_1,$pm->read_summary($readstart,$np_query));
-				break;
-		}
-   } else {
-		header("location:pm.php"); exit;
-   }
-}
-
-if($msg){
-	require_once(HEADERF);
-	pm_show_message($msg);
-}
-
-require_once(HEADERF);
-
-if($_POST['reply'] || preg_match("/reply\./",PM_QUERY)){
-	$tmp=explode(".",PM_QUERY);
-	$readstart=0;
-	$np_query="read";
-	if($tmp[1] == "reply"){
-		$readstart=$tmp[0];
-	}
-	pm_parseformat($PMREPLY);
-}
-
-if(PM_QUERY == "sent"){
-	pm_parseformat($PMSENT);
-}
-
-if(preg_match("/send/",PM_QUERY)){
-	pm_parseformat($PMSEND);
-}
-
-
-if(PM_QUERY == "vb"){
-	$text.=$pm->view_block();
-	$ns->tablerender(PMLAN_25,$text);
-}
-
-
-if(preg_match("/^block\./",PM_QUERY)){
-	$tmp=explode(".",PM_QUERY);
-	if($pm->block_user($tmp[1],USERNAME)){
-		header("location:pm.php?read,b.".$tmp[1]); exit;
-	} else {
-		header("location:pm.php?read,bp.".$tmp[1]); exit;
-	}
-}
-
-if(preg_match("/^unblock\./",PM_QUERY)){
-	$tmp=explode(".",PM_QUERY);
-	if($pm->is_blocked($tmp[1],USERNAME)){
-		if($pm->unblock_user($tmp[1],USERNAME)){
-			header("location:pm.php?vb,ub.".$tmp[1]); exit;
-		} else {
-			header("location:pm.php?vb".$tmp[1]); exit;
-		}
-	} else {
-			header("location:pm.php?vb,ubnf.".$tmp[1]); exit;
-	}
-}
-
-require_once(FOOTERF);
-
-function pm_show_send(){
-	global $ns,$pm,$pref;
-	if(check_class($pref['pm_userclass'])){
-		$temp=explode(".",PM_QUERY);
-		$ns->tablerender(PMLAN_PM,$pm->send_message($temp[1]));
-	} else {
-		$ns->tablerender(PMLAN_PM,PMLAN_16);
-	}
-}	
-
-function pm_show_message($message){
-
-/*
-# Show a mesage
-# Paremeter #1	- string $message, Message to display
-# Return -	None
-*/
-	global $ns;
-	$obj=new convert;
-	$m=explode(".",$message);
-	switch ($m[0]) {
-		case "md":
-			$mtext.=PMLAN_14.".";
-			break;
-		case "b":
-			$mtext=PMLAN_18.$m[1];
-			break;
-		case "bp":
-			$row=$this->is_blocked($m[1],USERNAME);
-			if(is_array($row)){
-				extract($row);
-				$mtext=PMLAN_21.$m[1];
-				$mtext.="<br />".PMLAN_22.$obj->convert_date($block_datestamp,"long");
-				$mtext.="<br /><br />".$block_count.PMLAN_23;
-			}
-			break;
-		case "ub":
-			$mtext=$m[1].PMLAN_19;
-			break;
-		case "ubnf":
-			$mtext=PMLAN_24;
-			break;
-		case "ms":
-			$mtext.=PMLAN_15.": ";
-			$mtext.=" ".preg_replace("#_#"," ",$m[1]);
-			break;
-		case "mb":
-			$mtext.=PMLAN_16.": ";
-			$mtext.=" ".$m[1];
-			$mtext.="<br />".PMLAN_17;
-			break;
-		default:
-			$mtext=$message;
-	}
-	$ns->tablerender("","<div style='text-align:center'><b>".$mtext."</b></div>");
-}
-
-function pm_parseformat($format){
-	$lines=explode("\n",$format);
-	foreach($lines as $line){
-		$line=ltrim(rtrim($line));
-		if($line=="{PMREADSUMMARY}"){
-			pm_readsummary();
-		}
-		if($line=="{PMSENTSUMMARY}"){
-			pm_sentsummary();
-		}
-		if($line=="{PMSENDFORM}"){
-			pm_show_send();
-		}
-		if($line=="{PMREPLY}"){
-			pm_reply();
-		}
-	}
-}
-
-function pm_readsummary(){
-	global $ns,$pm, $readstart,$np_query;
-	$text="";
-	$text.=$pm->read_summary($readstart,$np_query);
-	$ns->tablerender(PMLAN_1,$text);
-}
-
-function pm_reply(){
-	global $ns,$pm;
-	$text=$pm->send_message("",$_POST['msgid']);
-	$ns->tablerender(PMLAN_26,$text);
-}
-
-function pm_sentsummary(){
-	global $ns,$pm;
-	$ns->tablerender(PMLAN_2,$pm->sent_summary());
-}
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/pm_readme.txt 75/e107_plugins/pm_menu/pm_readme.txt
--- 6171/e107_plugins/pm_menu/pm_readme.txt	2004-05-10 04:17:52.000000000 -0500
+++ 75/e107_plugins/pm_menu/pm_readme.txt	1969-12-31 18:00:00.000000000 -0600
@@ -1,240 +0,0 @@
- /* /* 
-|  Copyright (C) 2003 Thom Michelbrink
-|
-|  Author:  Thom Michelbrink     mcfly@e107.org
-|
-|  This program is free software which I release under the GNU General Public
-|  License. You may redistribute and/or modify this program under the terms
-|  of that license as published by the Free Software Foundation; either
-|  version 2 of the License, or (at your option) any later version.
-|
-|  This program is distributed in the hope that it will be useful,
-|  but WITHOUT ANY WARRANTY; without even the implied warranty of
-|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-|  GNU General Public License for more details.  Version 2 is in the
-|  COPYRIGHT file in the top level directory of this distribution.
-| 
-|  To get a copy of the GNU General Puplic License, write to the Free Software
-|  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-Purpose:
-
-  This is a plugin for the E107 CMS system (e107.org).
-  This plugin will enable Private Messaging funtionality on your site.
-    
-Requirements:
-
-  This plugin requires e107 Verion 0.600+
-
-############## INSTALLATION ####################### 
-
-1) Upload all files to your e107_plugins directory on your server, retaining directory structure.
-2) Go to the admin section of the website, go the to plugin manager and install the PM.
-3) Go to the admin / plugins section and configure the PM settings.
-4) Functionality should now be turned on.  You must be a registered user on the site to use it.
-
-There are two ways for you to display the PM stats. You can either have them in their own menu or have them appear in the user login menu.  Here are the instructions for both:
-
-Own menu:  Go to the admin / menus section and add the PM menu to desired menu area.
-
-User Login menu:  Open up the file e107_plugins/login_menu/login_menu.php and add lines:
-
-require_once(e_PLUGIN."pm_menu/pm_inc.php");
-$text.=pm_show_stats();
-
-above the line that reads : 
-
-$ns -> tablerender($caption, $text);
-
-This should be at approximately line #40
-
-#####################################################################
-
-How to include the PM icon anywhere?  This can be done with a few lines of code.  At the beginning of the file you want the icon to appear, add the line:
-
-@include_once(e_PLUGIN."pm_menu/pm_inc.php");
-
-This will load the function necessary to do display it.
-At the pint where you would like the icon to appear add this:
-
-$pm_icon = (defined("e_PM") ? pm_show_icon($to_user_id) : "");
-echo $pm_icon;
-
-This fuction will ensure that the sending and receiving user have the necessary right to use the PM system.
-
-
-
-Files included with this release
----------------------------------
-all files in the pm_menu directory tree
-
-
-Files from previous releases that are no longer needed
-------------------------------------------------------
-files\languages\pmlan_*.php
-plugins\pm.php
-pm_readme.txt 										
-pm_install.php										- PM installation file
-pm.php 												- Main PM file
-pm_inc.php											- Used to show the PM menu items
-classes\pm_class.php								- Defines PM class and related functions
-admin\pm_conf.php									- Admin configuration functions
-menus\pm_menu.php									- This calls the pm_inc.php files to show the items
-languages\plugins\pm\pmlan_*.php				- All language files.
-admin\languages\plugins\pm\pm_lan_*.php	- All Admin languages files
-
-
-=========================================================
-Version history:
-
-12/4/2002 - Initial beta release 
- 
-12/5/2002 - Next beta
-	+ Ability to add stats to login_menu
-	+ Added 'quote' message on reply option
-	+ Fixed path problems with site is not at root level
-	+ Fixed subject problem
-	+ Added admin config options
-	+ Added delete_on_read option
-	+ Added auto-expiring option
-
-12/8/2002 - 
-	+ Moved configuration to the pm_prefs table, instead of the main prefs table.
-	
-12/12/2002
-	+ Moved configuration back to the main pref table (jalist request).
-	+ Added emoticon support
-	+ Added html support
-	+ Improved the internal messaging functionality
-	+ Added ability to specify who to pm in URL.  (Thanks to Chris McLeod for the idea)
-	To use this feature you need to know the users user_id.  Then you can make a link to
-	www.yoursite.com/pm.php?send.$user_id
-	+ Cleaned up code / fixed some other probs.
-
-2/15/2003
-	+ Updated plugin to work with e107 5.4
-	+ If user not logged in, menu will not show up.
-	+ Moved Delete_Expired function to allow for inactive pm systems to delete older 
-	messages easier.
-	+ Moved emotes from right column to bottom row.
-	+ Added multilanguage support.
-	
-2/18/2003
-	+ More changes to allow PM to work with subdirs.
-	+ Added Dutch language file (thanks koot).
-
-2/19/2003
-	+ Fixed security hole (?view.xx was allowed by anyone) (found be kaputer)
-	+ Added German language file (also by kaputer).
-
-2/27/2003
-	+ Added popup window notification.
-	+ Fixed new pm image problem if using subdirs (thanks Cameron)
-	+ There were non-translated phrases previously, I think I have all of 'em now.
-		
-3/3/2003
-	+ Added Islandic language file (thanks MaxAlien)
-	+ Moved the languages file to files/languages (as requested by Lolo Irie)
-	+ Added French language file (thanks Lolo Irie)
-
-3/4/2003
-	+ Completed 'PM Admin Functions'
-	+ Tweaked pop-up window behavior.
-	+ Added Italian language file (thanks NotZen)
-	+ Added upgraded Dutch language file (thanks again koot)
-	+ Added upgraded German language file (thanks again kaputer)
-
-3/7/2003 ( v1.4) ( adapted by Cameron )
-	+ Popup Delay feature added 
-	+ selected theme used for popup  	
-		
-5/7/2003 ( v1.5 ) (mod by Cameron and McFly)
-	+ Added the avatar image to the inbox. 
-
-5/31/2003 ( v1.6b ) 
-	+ Converted to 'class' functionality, streamlined code.
-	+ Added ability to restrict PM use to a specific userclass
-	+ Added ability to send PMs to all members of any userclass the sender is a member of (if not restricted to a single userclass)
-	 (original idea by kaputer a LONG time ago...glad I finally got it in there)
-	+ 'new pm graphic' is now a link (idea by Kent Humphrey)
-	+ 'x new messages' link only displayed if > 1 (idea also by Kent Humphrey)
-	+ 'new pm graphic' (newpm.gif) can now be themed.  Just include it in your theme/xxx/images directory.
-	+ Moved the language files into the language\plugins\pm directory.
-	+ Added multi-language admin functionality
-	+ Added uninstall functionality
-	+ Now using the emote class included in the e107 core classes.
-	+ Added code to support USERLAN
-	+ Massive code cleanup (looks better to me anyway)
-	+ Added config option to send notification email to PM recipients.
-	+ Fixed broken avatar image bug
-	+ Fixed message read time bug (e107coders bug #12)
-
-6/9/2003 ( v1.6 ) 
-	+ Fixed admin language file not found error, when site is installed in subdir
-	+ Added new Dutch language file (thanks Koot)
-
-6/12/2003 ( v1.61 ) 
-	+ Added Dutch admin language file
-	+ Added Danish language file
-	+ Fixed PM sending bug, allowing anyone to send PMs even if restricted (e107coders bug #23)
-
-6/13/2003 ( v1.62 ) 
-	+ When deleting all PMs through admin, it now resets the pm_id counter to 1 (just in case). Suggested by Lumina.
-
-6/27/2003 ( v2.0b2 ) 
-	+ Converted PM to work with e107 v0.6
-	+ Block messages now alerts sender that message was blocked.
-	+ Added multilanguage ability to menu caption.  If you set the caption to PMLAN_PM in the admin section, it will then assign it to that value from the language file.
-	+ Added some templating functionality.
-	+ Added help.php
-	
-7/24/2003 ( v2.0b3 ) 
-	+ Completed code necessary to integrate with 0.600 and the new plugin manager.
-
-7/27/2003 ( v2.0b4 ) 
-	+ Small bugfixes and appearance changes
-
-8/6/2003 ( v2.0b5 ) 
-	+ Added pm_show_icon() function to display PM icon in any menu / file.  See instructions how do do this above.
-	+ Fixed sending to userclass.
-	+ Fixed link to user.php
-	+ Fixed email url if SITEURL was missing a trailing /.
-	+ Now uses themed new.png and nonew.png from theme/forum directory (if exists).
-
-8/12/2003 ( v2.0 ) 
-	+ Updated this readme with correct instruction on how to add the PM menu into the login_menu
-	+ Fixed double send form when replying.
-	
-8/23/2003 ( v2.01 ) 
-	+ Added Swedish, Hungarian, and Hebrew languages, thanks all!
-	+ Fixed a small bug when replying to a PM with quote marks.
-
-8/23/2003 ( v2.02 ) 
-	+ Fixed some small code errors, and a nice security hole (Thanks Barre)
-
-12/14/2003 ( v2.03 ) 
-	+ When able to send to userclass, classes are now alphabetized.
-	+ You can now view your sent PMs, deleting is still receiver only.
-	+ Find user function now in send pm screen.  You MUST turn OFF the 'show user dropdown list' for this to work.  This will make large member sites load MUCH faster.  Also added this function to the admin screen (delete messages)
-	+ Fixed some hardcoded english
-	+ Cleaned up some functions
-	+ Added Lithuanian language files.
-	
-1/31/2004 ( v2.04 ) 
-	+ Added a timeout function when sending PMs, will prevent script timing out when sending a LOT of PMs at once (to userclass).
-	+ Fixed problem with the pm send being shown above pm reply (which also fixed a js error).
-	+ Added page select to pm read view.  Will now only show 10 received PMs at a time.
-	+ Fixed a pm_showmessge() error from appearing, if you are not the send/receiver of the pm.
-	+ Removed the version number from being shown on the pm screens, was put there before the plugin manager existed, time to get rid of it :)
-
-2/13/2004 ( v2.05 ) 
-	+ Fixed the bug that made you click on unread PMs twice to read them.
-	+ Added the checkbox next to the PMs, so you can delete multiple.
-	+ Added userclass sending when the dropdown for users is off (which should be default now).
-
-x/xx/xxxx ( v2.06 ) 
-	+ Removed some debug code, causing errors when deleting PMs
-	+ Added a few more phrases to the language files that were still hardcoded english
-	+ Added a pm_get_stats() function to the pm_inc.php file, making it easier for others to get those values.
-	+ Still cleaning up code ...lots more to do.
\ No newline at end of file
diff -ruN 6171/e107_plugins/pm_menu/pm_sql.php 75/e107_plugins/pm_menu/pm_sql.php
--- 6171/e107_plugins/pm_menu/pm_sql.php	2004-05-10 04:17:52.000000000 -0500
+++ 75/e107_plugins/pm_menu/pm_sql.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,19 +0,0 @@
-CREATE TABLE pm_messages (
-  pm_id int(10) unsigned NOT NULL auto_increment,
-  pm_from_user varchar(100) NOT NULL default '',
-  pm_to_user varchar(100) NOT NULL default '',
-  pm_sent_datestamp int(10) unsigned NOT NULL default '0',
-  pm_rcv_datestamp int(10) unsigned NOT NULL default '0',
-  pm_subject text NOT NULL,
-  pm_message text NOT NULL,
-  PRIMARY KEY  (pm_id)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
-
-CREATE TABLE pm_blocks (
-  block_id int(10) unsigned NOT NULL auto_increment,
-  block_from varchar(100) NOT NULL default '',
-  block_to varchar(100) NOT NULL default '',
-  block_datestamp int(10) unsigned NOT NULL default '0',
-  block_count int(10) NOT NULL default '0',
-  PRIMARY KEY  (block_id)
-) TYPE=MyISAM AUTO_INCREMENT=1 ;
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll/admin_config.php 75/e107_plugins/poll/admin_config.php
--- 6171/e107_plugins/poll/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/poll/admin_config.php	2005-12-18 12:12:46.000000000 -0600
@@ -0,0 +1,172 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/admin_config.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2005/12/18 18:12:46 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if (!is_object($tp)) $tp = new e_parse;
+if (!getperms("U")) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$e_sub_cat = 'poll';
+
+require_once(e_ADMIN."auth.php");
+require_once(e_PLUGIN."poll/poll_class.php");
+require_once(e_HANDLER."form_handler.php");
+require_once(e_HANDLER."userclass_class.php");
+
+if(isset($_POST)) {
+	$_POST = strip_if_magic($_POST);
+}
+
+$rs = new form;
+$poll = new poll;
+
+if (isset($_POST['reset']))
+{
+	unset($poll_id, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['multipleChoice'], $_POST['showResults'], $_POST['startday'], $_POST['startmonth'], $_POST['startyear'], $_POST['endday'], $_POST['endmonth'], $_POST['endyear']);
+	define("RESET", TRUE);
+} else if (e_QUERY)
+{
+	list($action, $id) = explode(".", e_QUERY);
+	define("POLLACTION", $action);
+	define("POLLID", $id);
+}
+else
+{
+	define("POLLACTION", FALSE);
+	define("POLLID", FALSE);
+}
+
+if ($action == "delete") {
+	$message = $poll->delete_poll($id);
+	unset($poll_id, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate']);
+}
+
+if (isset($_POST['submit']))
+{
+
+	if($_POST['poll_title'])
+	{
+		$message = $poll -> submit_poll();
+		unset($_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], $_POST['poll_comment']);
+	}
+	else
+	{
+		$message = "Field(s) left blank";
+	}
+}
+
+if (POLLACTION == "edit" && !$_POST['preview'] && !$_POST['submit'])
+{
+
+	if ($sql->db_Select("polls", "*", "poll_id=".POLLID)) {
+		$row = $sql->db_Fetch();
+		extract($row);
+
+		$tmpArray = explode(chr(1), $poll_options);
+
+		foreach($tmpArray as $option)
+		{
+			$_POST['poll_option'][] = $option;
+		}
+
+		$_POST['activate'] = $poll_active;
+		$_POST['option_count'] = count($_POST['poll_option']);
+		$_POST['poll_title'] = $poll_title;
+		$_POST['poll_comment'] = $poll_comment;
+
+		if ($poll_start_datestamp)
+		{
+			$tmp = getdate($poll_start_datestamp);
+			$_POST['startmonth'] = $tmp['mon'];
+			$_POST['startday'] = $tmp['mday'];
+			$_POST['startyear'] = $tmp['year'];
+		}
+		if ($poll_end_datestamp)
+		{
+			$tmp = getdate($poll_end_datestamp);
+			$_POST['endmonth'] = $tmp['mon'];
+			$_POST['endday'] = $tmp['mday'];
+			$_POST['endyear'] = $tmp['year'];
+		}
+
+		$_POST['multipleChoice'] = $poll_allow_multiple;
+		$_POST['showResults'] = $poll_result_type;
+		$_POST['pollUserclass'] = $poll_vote_userclass;
+		$_POST['storageMethod'] = $poll_storage_method;
+	}
+}
+
+if (isset($_POST['preview']))
+{
+	$poll->render_poll($_POST, "preview");
+}
+
+if (isset($message))
+{
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+
+$text = "<div style='text-align:center'><div style='padding : 1px; ".ADMIN_WIDTH."; height : 200px; overflow : auto; margin-left: auto; margin-right: auto;'>
+	<form action='".e_SELF."' method='post' id='del_poll'>";
+
+if ($poll_total = $sql->db_Select("polls", "*", "poll_type=1")) {
+	$text .= "<table class='fborder' style='width:99%'>
+		<tr>
+		<td style='width:5%' class='fcaption'>ID
+		<input type='hidden' name='del_poll_confirm' id='del_poll_confirm' value='1' />
+		</td>
+		<td style='width:75%' class='fcaption'>".POLLAN_3."</td>
+		<td style='width:20%' class='fcaption'>".POLLAN_4."</td>
+		</tr>";
+	while ($row = $sql->db_Fetch()) {
+		extract($row);
+		$text .= "<tr>
+			<td style='width:5%' class='forumheader3'>$poll_id</td>
+			<td style='width:75%' class='forumheader3'>".$tp -> toHTML($poll_title, TRUE,"emotes_off defs")."</td>
+			<td style='width:20%; text-align:center' class='forumheader3'><div>". $rs->form_button("button", "main_edit_{$poll_id}", POLLAN_5, "onclick=\"document.location='".e_SELF."?edit.$poll_id'\""). $rs->form_button("submit", "main_delete_{$poll_id}", POLLAN_6, "onclick=\"confirm_($poll_id)\"")."
+			</div></td>
+			</tr>";
+	}
+	$text .= "</table>";
+} else {
+	$text .= "<div style='text-align:center'>".POLLAN_7."</div>";
+}
+$text .= "</form></div></div>";
+$ns->tablerender(POLLAN_1, $text);
+
+$poll_total = $sql->db_Select("polls");
+
+$text = $poll -> renderPollForm();
+
+$ns->tablerender(POLLAN_2, $text);
+require_once(e_ADMIN."footer.php");
+function headerjs() {
+	global $tp;
+	$headerjs = "<script type=\"text/javascript\">
+		function confirm_(poll_id){
+		var x=confirm(\"Delete this poll? [ID: \" + poll_id + \"]\");
+		if (x){
+		document.getElementById('del_poll').action='".e_SELF."?delete.' + poll_id;
+		document.getElementById('del_poll').submit();
+		}
+		}
+		</script>";
+	return $headerjs;
+}
+?>
\ No newline at end of file
Files 6171/e107_plugins/poll/images/barl.png and 75/e107_plugins/poll/images/barl.png differ
Files 6171/e107_plugins/poll/images/bar.png and 75/e107_plugins/poll/images/bar.png differ
Files 6171/e107_plugins/poll/images/barr.png and 75/e107_plugins/poll/images/barr.png differ
Files 6171/e107_plugins/poll/images/polls_16.png and 75/e107_plugins/poll/images/polls_16.png differ
Files 6171/e107_plugins/poll/images/polls_32.png and 75/e107_plugins/poll/images/polls_32.png differ
diff -ruN 6171/e107_plugins/poll/languages/English.php 75/e107_plugins/poll/languages/English.php
--- 6171/e107_plugins/poll/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/poll/languages/English.php	2005-10-05 04:51:26.000000000 -0500
@@ -0,0 +1,76 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/languages/English.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/10/05 09:51:26 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("POLL_ADLAN01", "Poll");
+define("POLL_ADLAN02", "The poll plugin allows you to define polls in either a menu or forum post.");
+define("POLL_ADLAN03", "Configure polls");
+define("POLL_ADLAN04", "The poll plugin has been successfully installed. To add polls, click on the Polls icon in the plugin section of your admin front page, and remeber to activate the menu item from your menus page.");
+
+define("POLLAN_MENU_CAPTION", "Poll");
+
+define("POLLAN_1", "Existing polls");
+define("POLLAN_2", "Create / edit polls");
+define("POLLAN_3", "Poll question");
+define("POLLAN_4", "Options");
+define("POLLAN_5", "Edit");
+define("POLLAN_6", "Delete");
+define("POLLAN_7", "No polls yet.");
+define("POLLAN_8", "Add another option");
+define("POLLAN_9", "Allow multiple choices?");
+define("POLLAN_10", "yes");
+define("POLLAN_11", "no");
+define("POLLAN_12", "Show results");
+define("POLLAN_13", "after voting");
+define("POLLAN_14", "by clicking view results link - comments must be turned on to use this option");
+define("POLLAN_15", "Allow to vote on this poll");
+define("POLLAN_16", "Vote storage method");
+define("POLLAN_17", "cookie");
+define("POLLAN_18", "IP address");
+define("POLLAN_19", "UserID (only members can vote)");
+define("POLLAN_20", "Allow comments to be posted to this poll?");
+define("POLLAN_21", "Preview again");
+define("POLLAN_22", "Update Poll");
+define("POLLAN_23", "Create Poll");
+define("POLLAN_24", "Preview");
+define("POLLAN_25", "Clear form");
+define("POLLAN_26", "votes");
+define("POLLAN_27", "comments");
+define("POLLAN_28", "Previous polls");
+define("POLLAN_29", "posted by");
+define("POLLAN_30", "Submit");
+define("POLLAN_31", "votes");
+define("POLLAN_32", "Click here to see results");
+define("POLLAN_33", "No previous polls yet.");
+define("POLLAN_34", "Title");
+define("POLLAN_35", "Posted by");
+define("POLLAN_36", "Active");
+define("POLLAN_37", "active from");
+define("POLLAN_38", "to");
+define("POLLAN_39", "Thankyou for voting!");
+define("POLLAN_40", "Click here to see results");
+
+define("POLLAN_41", "This poll is restricted to members only");
+define("POLLAN_42", "This poll is restricted to administrators only");
+define("POLLAN_43", "You do not have the permission to vote in this poll");
+
+define("POLLAN_44", "Delete this poll?");
+
+define("POLLAN_45", "Poll successfully updated");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll/oldpolls.php 75/e107_plugins/poll/oldpolls.php
--- 6171/e107_plugins/poll/oldpolls.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/poll/oldpolls.php	2006-01-05 03:06:46.000000000 -0600
@@ -0,0 +1,146 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/oldpolls.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/01/05 09:06:46 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+require_once(HEADERF);
+require_once(e_HANDLER."comment_class.php");
+$cobj = new comment;
+$gen = new convert;
+
+@include(e_PLUGIN."poll/languages/".e_LANGUAGE.".php");
+@include(e_PLUGIN."poll/languages/English.php");
+
+
+if(e_QUERY)
+{
+	$query = "SELECT p.*, u.user_name FROM #polls AS p 
+	LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id
+	WHERE p.poll_type=1 AND p.poll_id=".intval(e_QUERY);
+
+	if($sql->db_Select_gen($query))
+	{
+
+		$row = $sql -> db_Fetch();
+		extract($row);
+
+		$optionArray = explode(chr(1), $poll_options);
+		$optionArray = array_slice($optionArray, 0, -1);      
+		$voteArray = explode(chr(1), $poll_votes);
+		$voteArray = array_slice($voteArray, 0, -1);
+
+		$voteTotal = array_sum($voteArray);
+		$percentage = array();
+		foreach($voteArray as $votes)
+		{
+			$percentage[] = round(($votes/$voteTotal) * 100, 2);
+		}
+
+		$start_datestamp = $gen->convert_date($poll_datestamp, "long");
+		$end_datestamp = $gen->convert_date($poll_end_datestamp, "long");
+
+		$text = "<table style='width:100%'>
+		<tr>
+		<td colspan='2' class='mediumtext' style='text-align:center'>
+		<b>".$tp -> toHTML($poll_title)."</b>
+		<div class='smalltext'>".POLLAN_35." <a href='".e_BASE."user.php?id.$user_id'>".$user_name."</a>.<br /> ".POLLAN_37." ".$start_datestamp." ".POLLAN_38." ".$end_datestamp.".<br />".POLLAN_26.": $voteTotal</div>
+		<br />
+		 
+		</td>
+		</tr>";
+
+		$count = 0;
+
+		$barl = (file_exists(THEME."images/barl.png") ? THEME."images/barl.png" : e_PLUGIN."poll/images/barl.png");
+		$barr = (file_exists(THEME."images/barr.png") ? THEME."images/barr.png" : e_PLUGIN."poll/images/barr.png");
+		$bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_PLUGIN."poll/images/bar.png");
+
+		foreach($optionArray as $option)
+		{
+			$text .= "<tr>
+			<td style='width:40%; text-align: right' class='mediumtext'><b>".$tp -> toHTML($option)."</b>&nbsp;&nbsp;</td>
+			<td class='smalltext'>
+			
+		 
+			<div style='background-image: url($barl); width: 5px; height: 14px; float: left;'></div><div style='background-image: url($bar); width: ".(floor($percentage[$count]) != 100 ? floor($percentage[$count]) : 95)."%; height: 14px; float: left;'></div><div style='background-image: url($barr); width: 5px; height: 14px; float: left;'></div>".$percentage[$count]."% [Votes: ".$voteArray[$count]."]</div>
+			</td>
+			</tr>\n";
+			$count++;
+
+		}
+	
+		if($comment_total = $sql -> db_Select("comments", "*", "comment_item_id=".intval($poll_id)." AND comment_type=4 ORDER BY comment_datestamp"))
+		{
+			$text .= "<tr><td colspan='2'><br /><br />";
+			while ($row = $sql->db_Fetch()) {
+				$text .= $cobj->render_comment($row);
+			}
+			$text .= "</td></tr>";
+		}
+	 
+		$text .= "</table>";
+		$ns->tablerender(POLL_ADLAN01." #".$poll_id, $text);
+	}
+}
+
+$query = "SELECT p.*, u.user_name FROM #polls AS p 
+LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id
+WHERE p.poll_type=1 
+ORDER BY p.poll_datestamp DESC";
+
+if(!$sql->db_Select_gen($query))
+{
+	$ns->tablerender(POLLAN_28, "<div style='text-align:center'>".POLLAN_33."</div>");
+	require_once(FOOTERF);
+	exit;
+}
+
+$array = $sql -> db_getList();
+$oldpollArray = array_slice($array, 1);
+
+if(!count($oldpollArray))
+{
+	$ns->tablerender(POLLAN_28, "<div style='text-align:center'>".POLLAN_33."</div>");
+	require_once(FOOTERF);
+	exit;
+}
+
+$text = "<table class='fborder' style='width: 95%;'>
+<tr>
+<td class='fcaption' style='width: 55%;'>".POLLAN_34."</td>
+<td class='fcaption' style='width: 15%;'>".POLLAN_35."</td>
+<td class='fcaption' style='width: 30%;'>".POLLAN_36."</td>
+</tr>\n";
+
+foreach($oldpollArray as $oldpoll)
+{
+	extract($oldpoll);
+	$from = $gen->convert_date($poll_datestamp, "short");
+	$to = $gen->convert_date($poll_end_datestamp, "short");
+
+	$text .= "<tr>
+	<td class='forumheader3' style='width: 55%;'><a href='".e_SELF."?$poll_id'>$poll_title</a></td>
+	<td class='forumheader3' style='width: 15%;'><a href='".e_BASE."user.php?id.$poll_admin_id'>$user_name</a></td>
+	<td class='forumheader3' style='width: 30%;'>$from to $to</td>
+	</tr>\n";
+}
+	
+$text .= "</table>";
+$ns->tablerender(POLLAN_28, $text);
+require_once(FOOTERF);
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll/plugin.php 75/e107_plugins/poll/plugin.php
--- 6171/e107_plugins/poll/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/poll/plugin.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,89 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/plugin.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."poll/languages/English.php");
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = POLL_ADLAN01;
+$eplug_version = "2.0";
+$eplug_author = "Steve Dunstan (jalist)";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = POLL_ADLAN02;
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "poll";
+
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "poll_menu";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+
+$eplug_sc = array("");
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/polls_32.png";
+$eplug_icon_small = $eplug_folder."/images/polls_16.png";
+$eplug_caption = POLL_ADLAN03;
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array();
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array("polls");
+
+// List of comment_type ids used by this plugin. -----------------------------
+$eplug_comment_ids = array(4);
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."polls (
+  poll_id int(10) unsigned NOT NULL auto_increment,
+  poll_datestamp int(10) unsigned NOT NULL default '0',
+  poll_start_datestamp int(10) unsigned NOT NULL default '0',
+  poll_end_datestamp int(10) unsigned NOT NULL default '0',
+  poll_admin_id int(10) unsigned NOT NULL default '0',
+  poll_title varchar(250) NOT NULL default '',
+  poll_options text NOT NULL,
+  poll_votes text NOT NULL,
+  poll_ip text NOT NULL,
+  poll_type tinyint(1) unsigned NOT NULL default '0',
+  poll_comment tinyint(1) unsigned NOT NULL default '1',
+  poll_allow_multiple tinyint(1) unsigned NOT NULL default '0',
+  poll_result_type tinyint(2) unsigned NOT NULL default '0',
+  poll_vote_userclass tinyint(3) unsigned NOT NULL default '0',
+  poll_storage_method tinyint(1) unsigned NOT NULL default '0',
+  PRIMARY KEY  (poll_id)
+) TYPE=MyISAM;");
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$eplug_link_url = "";
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = POLL_ADLAN04;
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll/poll_class.php 75/e107_plugins/poll/poll_class.php
--- 6171/e107_plugins/poll/poll_class.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/poll/poll_class.php	2006-05-17 10:37:36.000000000 -0500
@@ -0,0 +1,577 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/poll_class.php,v $
+|     $Revision: 1.43 $
+|     $Date: 2006/05/17 15:37:36 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."poll/languages/English.php");
+define("POLLCLASS", TRUE);
+class poll
+{
+
+	var $pollRow;
+	var $pollmode;
+	
+	function delete_poll($existing)
+	{
+		global $sql;
+		if ($sql -> db_Delete("polls", " poll_id='".intval($existing)."' "))
+		{
+			if(function_exists("admin_purge_related"))
+			{
+				admin_purge_related("poll", $existing);
+			}
+			return "Poll deleted.";
+		}
+	}
+
+	function submit_poll($mode=1)
+	{
+
+		/*
+		$mode = 1 :: poll is main poll
+		$mode = 2 :: poll is forum poll
+		*/
+
+		global $tp, $sql;
+		extract($_POST);
+
+		$poll_title = $tp->toDB($poll_title);
+		$active_start = (!$_POST['startmonth'] || !$_POST['startday'] || !$_POST['startyear'] ? 0 : mktime (0, 0, 0, $_POST['startmonth'], $_POST['startday'], $_POST['startyear']));
+		$active_end = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear']));
+		$poll_options = "";
+
+		foreach($poll_option as $key => $value)
+		{
+			$poll_options .= $tp->toDB($poll_option[$key]).chr(1);
+		}
+
+		if(POLLACTION == "edit")
+		{
+			$sql -> db_Update("polls", "poll_title='$poll_title', poll_options='$poll_options', poll_type=$mode, poll_comment='".$tp -> toDB($poll_comment)."', poll_allow_multiple=".intval($multipleChoice).", poll_result_type=".intval($showResults).", poll_vote_userclass=".intval($pollUserclass).", poll_storage_method=".intval($storageMethod)." WHERE poll_id=".intval(POLLID));
+
+			/* update poll results - bugtracker #1124 .... */
+			$sql -> db_Select("polls", "poll_votes", "poll_id='".intval(POLLID)."' ");
+			$foo = $sql -> db_Fetch();
+			$voteA = explode(chr(1), $foo['poll_votes']);
+
+			$opt = count($poll_option) - count($voteA);
+
+			if($opt)
+			{
+				for($a=0; $a<=$opt; $a++)
+				{
+					$foo['poll_votes'] .= "0".chr(1);
+				}
+				$sql -> db_Update("polls", "poll_votes='".$foo['poll_votes']."' WHERE poll_id='".intval(POLLID)."' ");
+			}
+	
+			$message = POLLAN_45;
+		} else {
+
+			$votes = "";
+			for($a=1; $a<=count($_POST['poll_option']); $a++)
+			{
+				$votes .= "0".chr(1);
+			}
+
+			if($mode == 1)
+			{
+				/* deactivate other polls */
+				if($sql -> db_Select("polls", "*", "poll_type=1 AND poll_vote_userclass!=255"))
+				{
+					$deacArray = $sql -> db_getList();
+					foreach($deacArray as $deacpoll)
+					{
+						$sql -> db_Update("polls", "poll_end_datestamp='".time()."', poll_vote_userclass='255' WHERE poll_id=".$deacpoll['poll_id']);
+					}
+				}
+				$sql -> db_Insert("polls", "'0', ".time().", ".intval($active_start).", ".intval($active_end).", ".ADMINID.", '$poll_title', '$poll_options', '$votes', '', '1', '".$tp -> toDB($poll_comment)."', '".intval($multipleChoice)."', '".intval($showResults)."', '".intval($pollUserclass)."', '".intval($storageMethod)."'");
+			}
+			else
+			{
+				$sql -> db_Insert("polls", "'0', ".intval($_POST['iid']).", '0', '0', ".USERID.", '$poll_title', '$poll_options', '$votes', '', '2', '0', '".intval($multipleChoice)."', '0', '0', '0'");
+			}
+		}
+		return $message;
+	}
+
+
+	function get_poll($query)
+	{
+		global $sql, $e107;
+		if ($sql->db_Select_gen($query))
+		{
+			$pollArray = $sql -> db_Fetch();
+		
+			if (!check_class($pollArray['poll_vote_userclass']))
+			{
+				$POLLMODE = "disallowed";
+			}
+			else
+			{
+		
+				switch($pollArray['poll_storage_method'])
+				{
+					case 0:
+						$userid = "";
+						$cookiename = "poll_".$pollArray['poll_id'];
+						if(isset($_COOKIE[$cookiename]))
+						{
+							$POLLMODE = "voted";
+						}
+						else
+						{
+							$POLLMODE = "notvoted";
+						}
+					break;
+		
+					case 1:
+						$userid = $e107->getip();
+						$voted_ids = explode("^", substr($pollArray['poll_ip'], 0, -1));
+						if (in_array($userid, $voted_ids))
+						{
+							$POLLMODE = "voted";
+						}
+						else
+						{
+							$POLLMODE = "notvoted";
+						}
+					break;
+		
+					case 2:
+						if(!USER)
+						{
+							$POLLMODE = "disallowed";
+						}
+						else
+						{
+							$userid = USERID;
+							$voted_ids = explode("^", substr($pollArray['poll_ip'], 0, -1));
+							if (in_array($userid, $voted_ids))
+							{
+								$POLLMODE = "voted";
+							}
+							else
+							{
+								$POLLMODE = "notvoted";
+							}
+						}
+					break;
+				}
+			}		
+		}
+		if(isset($_POST['pollvote']) && $POLLMODE == "notvoted")
+		{
+				if ($_POST['votea'])
+				{
+//					$sql -> db_Select("polls", "*", "poll_vote_userclass!=255 AND poll_type=1 ORDER BY poll_datestamp DESC LIMIT 0,1");
+					$row = $pollArray;
+					extract($row);
+					$votes = explode(chr(1), $poll_votes);
+					if(is_array($_POST['votea']))
+					{
+						/* multiple choice vote */
+						foreach($_POST['votea'] as $vote)
+						{
+							$vote = intval($vote);
+							$votes[($vote-1)] ++;
+						}
+					}
+					else
+					{
+						$votes[($_POST['votea']-1)] ++;
+					}
+					$optionArray = explode(chr(1), $pollArray['poll_options']);
+					$optionArray = array_slice($optionArray, 0, -1);
+					foreach($optionArray as $k=>$v)
+					{
+						if(!$votes[$k])
+						{
+							$votes[$k] = 0;
+						}
+					}
+					$votep = implode(chr(1), $votes);
+					$pollArray['poll_votes'] = $votep;
+	
+					$sql->db_Update("polls", "poll_votes = '$votep', poll_ip='".$poll_ip.$userid."^' WHERE poll_id=".$poll_id);
+					echo "
+				<script type='text/javascript'>
+				<!--
+				setcook({$poll_id});
+				//-->
+				</script>
+				";					
+					$POLLMODE = "voted";
+	
+			}
+		}
+		$this->pollRow = $pollArray;
+		$this->pollmode = $POLLMODE;
+	}
+			
+
+	function render_poll($pollArray = "", $type = "menu", $POLLMODE = "", $returnMethod=FALSE)
+	{
+		global $POLLSTYLE, $sql, $tp, $ns;
+		if($POLLMODE == "query")
+		{
+			$this->get_poll($pollArray);
+			$pollArray = $this->pollRow;
+			$POLLMODE = $this->pollmode;
+		}
+
+		$barl = (file_exists(THEME."images/barl.png") ? THEME."images/barl.png" : e_PLUGIN."poll/images/barl.png");
+		$barr = (file_exists(THEME."images/barr.png") ? THEME."images/barr.png" : e_PLUGIN."poll/images/barr.png");
+		$bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_PLUGIN."poll/images/bar.png");
+
+		if($type == "preview")
+		{
+			/* load lan file */
+			@include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php");
+			@include_once(e_PLUGIN."poll/languages/English.php");
+			$optionArray = $pollArray['poll_option'];
+			$voteArray = array();
+			$voteArray = array_pad($voteArray, count($optionArray), 0);
+			$pollArray['poll_allow_multiple'] = $pollArray['multipleChoice'];
+		}
+		else if($type == "forum")
+		{
+			@include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php");
+			@include_once(e_PLUGIN."poll/languages/English.php");
+			$pollArray['poll_allow_multiple'] = $pollArray['multipleChoice'];
+			if(isset($_POST['fpreview']))
+			{
+				$optionArray = $pollArray['poll_option'];
+			}
+			else
+			{
+				$optionArray = explode(chr(1), $pollArray['poll_options']);
+				$optionArray = array_slice($optionArray, 0, -1);
+			}
+			$voteArray = explode(chr(1), $pollArray['poll_votes']);
+//			$voteArray = array_slice($voteArray, 0, -1);
+		}
+		else
+		{
+			$optionArray = explode(chr(1), $pollArray['poll_options']);
+			$optionArray = array_slice($optionArray, 0, -1);
+			$voteArray = explode(chr(1), $pollArray['poll_votes']);
+//			$voteArray = array_slice($voteArray, 0, -1);
+		}
+
+		$voteTotal = array_sum($voteArray);
+
+		$percentage = array();
+
+
+		if(count($voteArray))
+		{
+			foreach($voteArray as $votes){
+				$percentage[] = round(($votes/$voteTotal) * 100, 2);
+			}
+		}
+		/* get template */
+		if (file_exists(THEME."poll_template.php"))
+		{
+			require(THEME."poll_template.php");
+		}
+		else if(!isset($POLL_NOTVOTED_START))
+		{
+		   	require(e_PLUGIN."poll/templates/poll_template.php");
+		}
+
+		if ($type == "preview")
+		{
+			$POLLMODE = "notvoted";
+		}
+		else if($type == "forum") {
+			$preview = TRUE;
+		}
+
+		$comment_total = $sql->db_Select("comments", "*", "comment_item_id='".intval($pollArray['poll_id'])."' AND comment_type=4");
+
+		$QUESTION = $tp -> toHTML($pollArray['poll_title'], TRUE,"emotes_off defs");
+		$VOTE_TOTAL = POLLAN_26.": ".$voteTotal;
+		$COMMENTS = ($pollArray['poll_comment'] ? " <a href='".e_BASE."comment.php?comment.poll.".$pollArray['poll_id']."'>".POLLAN_27.": ".$comment_total."</a>" : "");
+		$OLDPOLLS = ($type == "menu" ? "<a href='".e_PLUGIN."poll/oldpolls.php'>".POLLAN_28."</a>" : "");
+		$AUTHOR = POLLAN_29." ".($type == "preview" || $type == "forum" ? USERNAME : "<a href='".e_BASE."user.php?id.".$pollArray['poll_admin_id']."'>".$pollArray['user_name']."</a>");
+
+		switch ($POLLMODE)
+		{
+			case "notvoted":
+				$text = "<form method='post' action='".e_SELF.(e_QUERY ? "?".e_QUERY : "")."'>\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_START : $POLL_NOTVOTED_START));
+				$count = 1;
+				$alt = 0; // alternate style.
+				foreach($optionArray as $option) {
+				//	$MODE = ($mode) ? $mode : "";		/* debug */
+					$OPTIONBUTTON = ($pollArray['poll_allow_multiple'] ? "<input type='checkbox' name='votea[]' value='$count' />" : "<input type='radio' name='votea' value='$count' />");
+					$OPTION = $tp->toHTML($option, TRUE);
+					if($POLL_NOTVOTED_LOOP_ALT && $type != "forum"){ // alternating style
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($alt == 0 ? $POLL_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP_ALT));
+						$alt = ($alt ==0) ? 1 : 0;
+					}else{
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_LOOP : $POLL_NOTVOTED_LOOP));
+					}
+					$count ++;
+				}
+				$SUBMITBUTTON = "<input class='button' type='submit' name='pollvote' value='".POLLAN_30."' />";
+				if(('preview' == $type || $preview == TRUE) && strpos(e_SELF, "viewtopic") === FALSE)
+				{
+					$SUBMITBUTTON = "[".POLLAN_30."]";
+				}
+
+				$text .= "\n".preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_NOTVOTED_END : $POLL_NOTVOTED_END))."\n</form>";
+			break;
+
+			case "voted":
+
+				if($pollArray['poll_result_type'] && !strstr(e_SELF, "comment.php"))
+				{
+					$text = "<div style='text-align: center;'><br /><br />".POLLAN_39."<br /><br /><a href='".e_BASE."comment.php?comment.poll.".$pollArray['poll_id']."'>".POLLAN_40."</a></div><br /><br />";
+
+				}
+				else
+				{
+
+
+					$text = preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_START : $POLL_VOTED_START));
+					$count = 0;
+					foreach($optionArray as $option)
+					{
+						$OPTION = $tp->toHTML($option, TRUE);
+
+						$BAR = ($percentage[$count] ? "<div style='width: 100%'><div style='background-image: url($barl); width: 5px; height: 14px; float: left;'></div><div style='background-image: url($bar); width: ".(floor($percentage[$count]) != 100 ? floor($percentage[$count]) : 90)."%; height: 14px; float: left;'></div><div style='background-image: url($barr); width: 5px; height: 14px; float: left;'></div></div>" : "");
+
+						$PERCENTAGE = $percentage[$count]."%";
+						$VOTES = POLLAN_31.": ".$voteArray[$count];
+						$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_LOOP : $POLL_VOTED_LOOP));
+						$count ++;
+					}
+				}
+				$text .= preg_replace("/\{(.*?)\}/e", '$\1', ($type == "forum" ? $POLL_FORUM_VOTED_END : $POLL_VOTED_END));
+
+			break;
+
+			case "disallowed":
+				$text = preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_START);
+				foreach($optionArray as $option)
+				{
+					$MODE = $mode;		/* debug */
+					$OPTION = $tp->toHTML($option, TRUE);
+					$text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_LOOP);
+					$count ++;
+				}
+				if($pollArray['poll_vote_userclass'] == 253)
+				{
+					$DISALLOWMESSAGE = POLLAN_41;
+				}
+				else if($pollArray['poll_vote_userclass'] == 254)
+				{
+					$DISALLOWMESSAGE = POLLAN_42;
+				}
+				else
+				{
+					$DISALLOWMESSAGE = POLLAN_43;
+				}
+				$text .= preg_replace("/\{(.*?)\}/e", '$\1', $POLL_DISALLOWED_END);
+			break;
+		}
+
+		if(!defined("POLLRENDERED")) define("POLLRENDERED", TRUE);
+		$caption = (file_exists(THEME."images/poll_menu.png") ? "<img src='".THEME."images/poll_menu.png' alt='' /> ".POLLAN_MENU_CAPTION : POLLAN_MENU_CAPTION);
+		if($type == "preview")
+		{
+			$caption = POLLAN_23;
+			$text = "<div style='text-align:center; margin-left: auto; margin-right: auto;'>\n<table style='width:350px' class='fborder'>\n<tr>\n<td>\n$text\n</td></tr></table></div>";
+		}
+		else if($type == "forum")
+		{
+			$caption = LAN_4;
+		}
+
+
+
+		if($returnMethod)
+		{
+			return $text;
+		}
+		else
+		{
+			$ns->tablerender($caption, $text, 'poll');
+		}
+	}
+
+
+	function renderPollForm($mode="admin")
+	{
+		/*
+		$mode = "admin" :: called from admin_config.php
+		$mode = "forum" :: called from forum_post.php
+		*/
+		global $tp;
+		if($mode == "forum")
+		{
+			$text = "<tr>
+			<td colspan='2' class='nforumcaption2'>".LAN_4."</td>
+			</tr>
+			<tr>
+			<td colspan='2' class='forumheader3'>
+			<span class='smalltext'>".LAN_386."</span>
+			</td>
+			</tr>
+			<tr><td style='width:20%' class='forumheader3'><div class='normaltext'>".LAN_5."</div></td><td style='width:80%'class='forumheader3'><input class='tbox' type='text' name='poll_title' size='70' value='".$tp->post_toForm($_POST['poll_title'])."' maxlength='200' /></td></tr>";
+
+			$option_count = (count($_POST['poll_option']) ? count($_POST['poll_option']) : 1);
+			$text .= "<tr>
+			<td style='width:20%' class='forumheader3'>".LAN_391."</td>
+			<td style='width:80%' class='forumheader3'>
+			<div id='pollsection'>";
+
+			for($count = 1; $count <= $option_count; $count++) {
+				if($count != 1 && $_POST['poll_option'][($count-1)] ==""){
+					break;
+				}
+				$opt = ($count==1) ? "id='pollopt'" : "";
+				$text .="<span $opt><input  class='tbox' type='text' name='poll_option[]' size='40' value=\"".$_POST['poll_option'][($count-1)]."\" maxlength='200' />";
+				$text .= "</span><br />";
+			}
+
+			$text .="</div><input class='button' type='button' name='addoption' value='".LAN_6."' onclick=\"duplicateHTML('pollopt','pollsection')\" /><br />
+			</td></tr>
+
+
+			<tr>
+			<td style='width:20%' class='forumheader3'>".POLL_506."</td>
+			<td style='width:80%' class='forumheader3'>
+			<input type='radio' name='multipleChoice' value='1'".($_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLL_507."&nbsp;&nbsp;
+			<input type='radio' name='multipleChoice' value='0'".(!$_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLL_508."
+			</td>
+			</tr>";
+
+
+			return $text;
+		}
+
+		$formgo = e_SELF.(e_QUERY && !defined("RESET") && strpos(e_QUERY, 'delete') === FALSE ? "?".e_QUERY : "");
+
+		$text = "<div style='text-align:center'>
+		<form method='post' action='$formgo'>
+		<table style='".ADMIN_WIDTH."' class='fborder'>
+		<tr>
+		<td style='width:30%' class='forumheader3'><div class='normaltext'>".POLLAN_3.":</div></td>
+		<td style='width:70%'class='forumheader3'>
+		<input class='tbox' type='text' name='poll_title' size='70' value='".$tp -> post_toForm($_POST['poll_title'])."' maxlength='200' />";
+
+		$option_count = (count($_POST['poll_option']) ? count($_POST['poll_option']) : 1);
+
+		$text .= "<tr>
+		<td style='width:30%;vertical-align:top' class='forumheader3'>".LAN_OPTIONS." :</td>
+		<td style='width:70%' class='forumheader3'>
+		<div id='pollsection'>";
+
+		for($count = 1; $count <= $option_count; $count++) {
+			if($count != 1 && $_POST['poll_option'][($count-1)] ==""){
+				break;
+			}
+			$opt = ($count==1) ? "id='pollopt'" : "";
+			$text .="<span $opt><input  class='tbox' type='text' name='poll_option[]' size='40' value=\"".$tp -> post_toForm($_POST['poll_option'][($count-1)])."\" maxlength='200' />";
+			$text .= "</span><br />";
+		}
+
+		$text .="</div><input class='button' type='button' name='addoption' value='".POLLAN_8."' onclick=\"duplicateHTML('pollopt','pollsection')\" /><br />
+		</td></tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".POLLAN_9."</td>
+		<td style='width:70%' class='forumheader3'>
+		<input type='radio' name='multipleChoice' value='1'".($_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLLAN_10."&nbsp;&nbsp;
+		<input type='radio' name='multipleChoice' value='0'".(!$_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".POLLAN_11."
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".POLLAN_12."</td>
+		<td style='width:70%' class='forumheader3'>
+		<input type='radio' name='showResults' value='0'".(!$_POST['showResults'] ? " checked='checked'" : "")." /> ".POLLAN_13."<br />
+		<input type='radio' name='showResults' value='1'".($_POST['showResults'] ? " checked='checked'" : "")." /> ".POLLAN_14."
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".POLLAN_15."</td>
+		<td class='forumheader3'>".r_userclass("pollUserclass", $_POST['pollUserclass'], "admin")."</td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'>".POLLAN_16."</td>
+		<td class='forumheader3'>
+		<input type='radio' name='storageMethod' value='0'".(!$_POST['storageMethod'] ? " checked='checked'" : "")." /> ".POLLAN_17."<br />
+		<input type='radio' name='storageMethod' value='1'".($_POST['storageMethod'] == 1 ? " checked='checked'" : "")." /> ".POLLAN_18."<br />
+		<input type='radio' name='storageMethod' value='2'".($_POST['storageMethod'] ==2 ? " checked='checked'" : "")." /> ".POLLAN_19."
+		</tr>
+
+
+
+
+		<tr>
+		<td class='forumheader3'>".POLLAN_20.": </td><td class='forumheader3'>
+		<input type='radio' name='poll_comment' value='1'".($_POST['poll_comment'] ? " checked='checked'" : "")." /> ".POLLAN_10."
+		<input type='radio' name='poll_comment' value='0'".(!$_POST['poll_comment'] ? " checked='checked'" : "")." /> ".POLLAN_11."
+		</td>
+		</tr>
+		<tr style='vertical-align:top'>
+		<td colspan='2'  style='text-align:center' class='forumheader'>";
+
+		if (isset($_POST['preview'])) {
+			$text .= "<input class='button' type='submit' name='preview' value='".POLLAN_21."' /> ";
+			if (POLLACTION == "edit") {
+				$text .= "<input class='button' type='submit' name='submit' value='".POLLAN_22."' /> ";
+			} else {
+				$text .= "<input class='button' type='submit' name='submit' value='".POLLAN_23."' /> ";
+			}
+		} else {
+			$text .= "<input class='button' type='submit' name='preview' value='".POLLAN_24."' /> ";
+		}
+		if (POLLID) {
+			$text .= "<input class='button' type='submit' name='reset' value='".POLLAN_25."' /> ";
+		}
+
+		$text .= "</td></tr></table>
+		</form>
+		</div>";
+
+		return $text;
+	}
+}
+
+echo '<script type="text/javascript">
+<!--
+function setcook(pollid){
+	var name = "poll_"+pollid;
+	var date = new Date();
+	var value = pollid;
+	date.setTime(date.getTime()+(365*24*60*60*1000));
+	var expires = "; expires="+date.toGMTString();
+	document.cookie = name+"="+value+expires+"; path=/";
+}
+//-->
+</script>
+';
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll/poll_menu.php 75/e107_plugins/poll/poll_menu.php
--- 6171/e107_plugins/poll/poll_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/poll/poll_menu.php	2006-02-18 08:02:17.000000000 -0600
@@ -0,0 +1,52 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/poll_menu.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2006/02/18 14:02:17 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $e107;
+
+if(defined("POLLRENDERED"))
+{
+//	return;
+}
+if(!defined("POLLCLASS"))
+{
+	require(e_PLUGIN."poll/poll_class.php");
+}
+if(!isset($poll) || !is_object($poll))
+{
+	$poll = new poll;
+}
+
+if(!defined("POLL_1"))
+{
+	/* if menu is being called from comments, lan files have to be included manually ... */
+	@include_once(e_PLUGIN."poll/languages/".e_LANGUAGE.".php");
+	@include_once(e_PLUGIN."poll/languages/English.php");
+}
+
+$query = "SELECT p.*, u.user_name FROM #polls AS p 
+LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id
+WHERE p.poll_vote_userclass!=255 AND p.poll_type=1
+ORDER BY p.poll_datestamp DESC LIMIT 0,1
+";
+
+$poll->render_poll($query, "menu", "query");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll/poll_sql.php 75/e107_plugins/poll/poll_sql.php
--- 6171/e107_plugins/poll/poll_sql.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/poll/poll_sql.php	2005-03-29 11:57:36.000000000 -0600
@@ -0,0 +1,18 @@
+CREATE TABLE polls (
+  poll_id int(10) unsigned NOT NULL auto_increment,
+  poll_datestamp int(10) unsigned NOT NULL default '0',
+  poll_start_datestamp int(10) unsigned NOT NULL default '0',
+  poll_end_datestamp int(10) unsigned NOT NULL default '0',
+  poll_admin_id int(10) unsigned NOT NULL default '0',
+  poll_title varchar(250) NOT NULL default '',
+  poll_options text NOT NULL,
+  poll_votes text NOT NULL,
+  poll_ip text NOT NULL,
+  poll_type tinyint(1) unsigned NOT NULL default '0',
+  poll_comment tinyint(1) unsigned NOT NULL default '1',
+  poll_allow_multiple tinyint(1) unsigned NOT NULL default '0',
+  poll_result_type tinyint(2) unsigned NOT NULL default '0',
+  poll_vote_userclass tinyint(3) unsigned NOT NULL default '0',
+  poll_storage_method tinyint(1) unsigned NOT NULL default '0',
+  PRIMARY KEY  (poll_id)
+) TYPE=MyISAM;
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll/search/search_comments.php 75/e107_plugins/poll/search/search_comments.php
--- 6171/e107_plugins/poll/search/search_comments.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/poll/search/search_comments.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,21 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$comments_title = 'Poll';
+$comments_type_id = 4;
+$comments_return['poll'] = "po.poll_id, po.poll_title";
+$comments_table['poll'] = "LEFT JOIN #polls AS po ON c.comment_type=4 AND po.poll_id = c.comment_item_id";
+function com_search_4($row) {
+	global $con;
+	$nick = preg_replace("/[0-9]+\./", "", $row['comment_author']);
+	$datestamp = $con -> convert_date($row['comment_datestamp'], "long");
+	$res['link'] = e_PLUGIN."poll/oldpolls.php?".$row['poll_id'];
+	$res['pre_title'] = 'Posted in reply to poll: ';
+	$res['title'] = $row['poll_title'];
+	$res['summary'] = $row['comment_comment'];
+	$res['detail'] = LAN_SEARCH_7.$nick.LAN_SEARCH_8.$datestamp;
+	return $res;
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll/templates/poll_template.php 75/e107_plugins/poll/templates/poll_template.php
--- 6171/e107_plugins/poll/templates/poll_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/poll/templates/poll_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,186 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/poll/templates/poll_template.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
+|
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/* ################################# */
+/*		template for polls when user HASN'T voted ...			*/
+
+
+$POLL_NOTVOTED_START = "
+<div style='text-align:center'>
+<p>
+<br />
+<b><i>{QUESTION}</i></b>
+</p>
+<hr />
+</div>
+<p>
+<br />
+";
+
+$POLL_NOTVOTED_LOOP = "
+{OPTIONBUTTON}<b>{OPTION}</b>
+<br /><br />";
+
+$POLL_NOTVOTED_END = "
+</p>
+<div style='text-align:center' class='smalltext'>
+<p>
+{SUBMITBUTTON}
+<br /><br />
+{AUTHOR}
+<br />
+{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</p>
+</div>";
+
+
+/* ################################# */
+/*		template for polls when user HAS voted ...			*/
+
+$POLL_VOTED_START = "
+<div style='text-align:center'>
+<br />
+<b><i>{QUESTION}</i></b>
+<hr />
+</div>
+<br />
+";
+
+$POLL_VOTED_LOOP = "
+<b>{OPTION}</b>
+<br /><div class='spacer'>{BAR}</div><br />
+<span class='smalltext'>{VOTES} | {PERCENTAGE}</span>
+<br /><br />
+";
+
+$POLL_VOTED_END = "
+<div style='text-align:center' class='smalltext'>
+{AUTHOR}
+<br />
+{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</div>
+";
+
+
+/* ################################# */
+/*		template for polls when user CANNOT vote ...		*/
+
+
+$POLL_DISALLOWED_START = "
+<div style='text-align:center'>
+<br />
+<b><i>{QUESTION}</i></b>
+<hr />
+</div>
+<br />
+";
+
+$POLL_DISALLOWED_LOOP = "
+<b>{OPTION}</b>
+<br /><br />
+";
+
+$POLL_DISALLOWED_END = "
+<div style='text-align:center' class='smalltext'>
+{DISALLOWMESSAGE}<br /><br />
+{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</div>
+";
+
+
+/* ################################# */
+/*		template for forum polls when user HASN'T voted*/
+
+$POLL_FORUM_NOTVOTED_START = "
+<div style='text-align:center; margin-left: auto; margin-right: auto;'>
+<table class='fborder' style='width: 350px;'>
+<tr>
+<td class='forumheader' style='width: 100%; text-align: center;'>
+<b><i>{QUESTION}</i></b>
+</td>
+</tr>
+<tr>
+<td class='forumheader3' style='width: 100%;'>";
+
+$POLL_FORUM_NOTVOTED_LOOP = "
+{OPTIONBUTTON}<b>{OPTION}</b>
+<br /><br />";
+
+$POLL_FORUM_NOTVOTED_END = "
+</td>
+</tr>
+
+<tr>
+<td class='forumheader' style='width: 100%;'>
+<div style='text-align:center' class='smalltext'>
+{SUBMITBUTTON}
+</div>
+</td>
+</tr>
+</table>
+</div>";
+
+
+/* ################################# */
+/*		template for forum polls when user HAS voted		*/
+
+$POLL_FORUM_VOTED_START = "
+<div style='text-align:center; margin-left: auto; margin-right: auto;'>
+<table class='fborder' style='width: 350px;'>
+<tr>
+<td class='forumheader' style='width: 100%; text-align: center;'>
+<b><i>{QUESTION}</i></b>
+</td>
+</tr>
+<tr>
+<td class='forumheader3' style='width: 100%;'>
+";
+
+$POLL_FORUM_VOTED_LOOP = "
+<b>{OPTION}</b>
+<br />{BAR}<br />
+<span class='smalltext'>{VOTES} | {PERCENTAGE}</span>
+<br /><br />
+";
+
+$POLL_FORUM_VOTED_END = "
+</td>
+</tr>
+
+<tr>
+<td class='forumheader' style='width: 100%;'>
+<div style='text-align:center' class='smalltext'>
+{VOTE_TOTAL}
+</div>
+</td>
+</tr>
+</table>
+</div>
+";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll_menu/languages/English.php 75/e107_plugins/poll_menu/languages/English.php
--- 6171/e107_plugins/poll_menu/languages/English.php	2004-03-23 21:59:30.000000000 -0600
+++ 75/e107_plugins/poll_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,38 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("POLL_1", "Votes: ");
-define("POLL_2", "Comments");
-define("POLL_3", "Old Surveys");
-define("POLL_4", "Submit Vote");
-define("POLL_5", "Poll");
-
-
-define("POLL_6", "No votes");
-define("POLL_7", "1 vote");
-define("POLL_8", " votes");
-define("POLL_9", "moderator");
-define("POLL_10", "delete poll only");
-
-define("POLL_11", "Poll updated in database.");
-define("POLL_12", "Posted by: ");
-
-define("POLL_163", "Submit Vote");
-define("POLL_164", "Votes: ");
-define("POLL_165", "Old Surveys");
-define("POLL_184", "Poll");
-
-define("POLL_500", "Comments");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/poll_menu/poll_menu.php 75/e107_plugins/poll_menu/poll_menu.php
--- 6171/e107_plugins/poll_menu/poll_menu.php	2004-09-02 21:49:08.000000000 -0500
+++ 75/e107_plugins/poll_menu/poll_menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,46 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/plugins/poll.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-require_once(e_HANDLER."poll_class.php");
-
-if($sql -> db_Select("poll", "*", "poll_active='1' OR poll_active='2' ")){
-	list($poll_id, $poll_datestamp, $poll_end_datestamp, $poll_admin_id, $poll_title, $poll_option[0], $poll_option[1], $poll_option[2], $poll_option[3], $poll_option[4], $poll_option[5], $poll_option[6], $poll_option[7], $poll_option[8], $poll_option[9], $votes[0], $votes[1], $votes[2], $votes[3], $votes[4], $votes[5], $votes[6], $votes[7], $votes[8], $votes[9], $poll_ip, $poll_active, $poll_comment) = $sql-> db_Fetch();
-
-	$user_id = ($poll_active == 1 ? getip() : USERID);
-	$voted_ids = explode("^",substr($poll_ip,0,-1));
-	if(in_array($user_id,$voted_ids)){
-		$mode = "voted";
-	}else if($poll_active == 2 && !USER){
-		$mode = "disallowed";
-	}else{
-		$mode = "notvoted";
-	}
-
-	If(IsSet($_POST['vote'])){
-		if(!strpos($poll_ip, $user_id)){
-			if($_POST['votea']){
-				$num = "poll_votes_".$_POST['votea'];
-				$sql -> db_Update("poll", "$num=$num+1, poll_ip='".$poll_ip.$user_id."^' WHERE poll_id='".$_POST['pollid']."' ");
-				$mode = "voted";
-				$sql -> db_Select("poll", "*", "poll_active='1' OR poll_active='2' ");
-				list($poll_id, $poll_datestamp, $poll_end_datestamp, $poll_admin_id, $poll_title, $poll_option[0], $poll_option[1], $poll_option[2], $poll_option[3], $poll_option[4], $poll_option[5], $poll_option[6], $poll_option[7], $poll_option[8], $poll_option[9], $votes[0], $votes[1], $votes[2], $votes[3], $votes[4], $votes[5], $votes[6], $votes[7], $votes[8], $votes[9], $poll_ip, $poll_active, $poll_comment) = $sql-> db_Fetch();
-			}
-		}
-	}
-
-	$poll = new poll;
-	$poll -> render_poll($poll_id, $poll_title, $poll_option, $votes, $mode, "menu", $poll_comment);
-}
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/powered_by_menu/languages/English.php 75/e107_plugins/powered_by_menu/languages/English.php
--- 6171/e107_plugins/powered_by_menu/languages/English.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/powered_by_menu/languages/English.php	2005-01-27 13:53:15.000000000 -0600
@@ -1,17 +1,15 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("POWEREDBY_L1", "Powered By");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/powered_by_menu/languages/English.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:53:15 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+	
+define("POWEREDBY_L1", "Powered By");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/powered_by_menu/powered_by_menu.php 75/e107_plugins/powered_by_menu/powered_by_menu.php
--- 6171/e107_plugins/powered_by_menu/powered_by_menu.php	2004-05-09 20:40:58.000000000 -0500
+++ 75/e107_plugins/powered_by_menu/powered_by_menu.php	2006-01-22 14:44:41.000000000 -0600
@@ -1,11 +1,34 @@
-<?php
-$text = "
-<div style='text-align:center'>
-<a href='http://e107.org' rel='external'><img src='".e_IMAGE."button.png' alt='e107' style='border:0' /></a>
-<br />
-<a href='http://php.net' rel='external'><img src='".e_IMAGE."generic/php-small-trans-light.gif' alt='PHP' style='border:0' /></a>
-<br />
-<a href='http://mysql.com' rel='external'><img src='".e_IMAGE."generic/poweredbymysql-88.png' alt='mySQL' style='border:0' /></a>
-</div>";
-$ns -> tablerender(POWEREDBY_L1,  $text);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     �Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/powered_by_menu/powered_by_menu.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2006/01/22 20:44:41 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+$text = "
+<div style='text-align: center'>
+<div class='spacer'>
+<a href='http://e107.org' rel='external'><img src='".e_IMAGE_ABS."button.png' alt='e107' style='border: 0px; width: 88px; height: 31px' /></a>
+</div>
+<div class='spacer'>
+<a href='http://php.net' rel='external'><img src='".e_IMAGE_ABS."generic/php-small-trans-light.gif' alt='PHP' style='border: 0px; width: 88px; height: 31px' /></a>
+</div>
+<div class='spacer'>
+<a href='http://mysql.com' rel='external'><img src='".e_IMAGE_ABS."generic/poweredbymysql-88.png' alt='MySQL' style='border: 0px; width: 88px; height: 31px' /></a>
+</div>
+</div>";
+$ns -> tablerender(POWEREDBY_L1,  $text, 'powered_by');
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/review_menu/config.php 75/e107_plugins/review_menu/config.php
--- 6171/e107_plugins/review_menu/config.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/review_menu/config.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,97 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002  ( jalist@e107.org  )
-|     http://e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/e107_plugins/review_menu/config.php,v $
-|     $Revision: 1.3 $
-|     $Date: 2004/09/03 18:32:12 $
-|     $Author: e107coders $
-|
-|     Based on code by Edwin van der Wal (evdwal@xs4all.nl)
-+----------------------------------------------------------------------------+
-*/
-
-
-require_once("../../class2.php");
-if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
-require_once(e_ADMIN."auth.php");
-
-$lan_file = e_PLUGIN."review_menu/languages/".e_LANGUAGE.".php";
-require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."review_menu/languages/English.php");
-
-
-if(IsSet($_POST['update_menu'])){
-        while(list($key, $value) = each($_POST)){
-                if($key=="reviews_parents"){$value="1"; $found=1;}
-                if($key=="reviews_submitlink"){$value="1"; $found1=1;}
-                if($value != LAN_RVW_1){
-                        $menu_pref[$key] = $value;
-                }
-        }
-        if(!$found){unset($menu_pref['reviews_parents']);}
-        if(!$found1){unset($menu_pref['reviews_submitlink']);}
-        $tmp = addslashes(serialize($menu_pref));
-        $sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
-        $ns -> tablerender("", "<div style='text-align:center'><b>".LAN_RVW_2."</b></div>");
-}
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
-<table style='width:85%' class='fborder' >
-
-<tr>
-<td style='width:40%' class='forumheader3'>".LAN_RVW_3.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='reviews_caption' size='20' value='".$menu_pref['reviews_caption']."' maxlength='100' />
-</td>
-</tr>
-
-
-<tr>
-<td style='width:40%' class='forumheader3'>".LAN_RVW_4.": </td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='reviews_display' size='6' value='".$menu_pref['reviews_display']."' maxlength='3' />
-</td>
-</tr>
-
-<tr>
-<td style='width:40%' class='forumheader3'>".LAN_RVW_5."</td>
-<td style='width:60%' class='forumheader3'>
-<input type='checkbox' name='reviews_parents' value='".$menu_pref['reviews_parents']."' ".($menu_pref['reviews_parents'] ? "checked" : "")." />
-</td>
-</tr>
-
-<tr>
-<td style='width:40%' class='forumheader3'>".LAN_RVW_6.":
-</td>
-<td style='width:60%' class='forumheader3'>
-<input class='tbox' type='text' name='reviews_mainlink' size='30' value='".$menu_pref['reviews_mainlink']."' maxlength='200' />
-</td>
-</tr>
-
-<tr>
-<td style='width:40%' class='forumheader3'>".LAN_RVW_7."</td>
-<td style='width:60%' class='forumheader3'>
-<input type='checkbox' name='reviews_submitlink' value='".$menu_pref['reviews_submitlink']."' ".($menu_pref['reviews_submitlink'] ? "checked" : "")." />
-</td>
-</tr>
-
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='".LAN_RVW_1."' /></td>
-</tr>
-</table>
-</form>
-</div>";
-$ns -> tablerender(LAN_RVW_8, $text);
-
-require_once(e_ADMIN."footer.php");
-?>
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/review_menu/languages/English.php 75/e107_plugins/review_menu/languages/English.php
--- 6171/e107_plugins/review_menu/languages/English.php	2004-09-03 13:32:12.000000000 -0500
+++ 75/e107_plugins/review_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,29 +0,0 @@
-<?php
-/*
- + ----------------------------------------------------------------------------+
- |     e107 website system
- |
- |     Steve Dunstan 2001-2002
- |     http://e107.org
- |     jalist@e107.org
- |
- |     Released under the terms and conditions of the
- |     GNU General Public License (http://gnu.org).
- |
- |     $Source: /cvsroot/e107/e107/e107_plugins/review_menu/languages/English.php,v $
- |     $Revision: 1.3 $
- |     $Date: 2004/09/03 18:32:12 $
- |     $Author: e107coders $
- +----------------------------------------------------------------------------+
-*/
-
-define("LAN_190", "Submit Review");
-define("LAN_RVW_1", "Update Menu Settings");
-define("LAN_RVW_2", "Reviews menu configuration saved");
-define("LAN_RVW_3", "Caption");
-define("LAN_RVW_4", "Number of reviews to display");
-define("LAN_RVW_5", "Show review categories in menu?");
-define("LAN_RVW_6", "Title for review list page");
-define("LAN_RVW_7", "Show link to submit review?");
-define("LAN_RVW_8", "Reviews Menu Configuration");
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/review_menu/review_menu.php 75/e107_plugins/review_menu/review_menu.php
--- 6171/e107_plugins/review_menu/review_menu.php	2004-05-12 16:19:32.000000000 -0500
+++ 75/e107_plugins/review_menu/review_menu.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,90 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/reviews_menu.php
-|
-|	Edwin van der Wal 2003
-|	http://e107.org
-|	evdwal@xs4all.nl
-|	Based on the articles_menu.php
-|
-|	Released under the terms and conditions of the	
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-if($cache = retrieve_cache("review_menu")){
-	$aj = new textparse;
-	$cache = str_replace("e107_themes/", e_THEME, $cache);
-	$cache = str_replace("<a href=&#39;", "<a href=&#39;".e_BASE, $cache);
-	echo $aj -> formtparev($cache);
-}else{
-
-	ob_start();
-
-	$text = ($menu_pref['reviews_mainlink'] ? "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."content.php?review'> ".$menu_pref['reviews_mainlink']."</a><br/>" : "");
-
-	$sql2=new db;
-
-	if($menu_pref['reviews_parents']){
-		$text.="<br />";
-		if($i = $sql -> db_Select("content", "*", "content_type='3' AND content_parent='0' ")){
-			$text .= "<img src='".THEME."images/bullet2.gif' alt='' /> <a href='".e_BASE."content.php?review.cat.0'>Uncategorized</a> (".$i.")<br />";
-		}
-		unset($i);
-		if($sql -> db_Select("content", "*", "content_type='10' ORDER BY content_heading ASC")){
-			while($row = $sql -> db_Fetch()){
-				extract($row);
-				if(check_class($content_class)){
-				$i = $sql2 -> db_Select("content", "content_class", "content_type='3' AND content_parent='".$content_id."' ");
-					if($i){
-						while($row2 = $sql2 -> db_Fetch()){
-							extract($row2);
-							if(!check_class($content_class)){
-								$i = $i - 1;
-							}
-						}
-						if($i){
-							$text .= "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."content.php?review.cat.".$content_id."'>".$content_heading."</a> (".$i.")<br />";
-						}
-					}
-				}
-			}
-		}
-		$text.="<br />";
-	}
-
-	if($sql -> db_Select("content", "*", "content_type='3' ORDER BY content_datestamp DESC limit 0, ".$menu_pref['reviews_display'])){
-		while($row = $sql-> db_Fetch()){
-			extract($row);
-			if(check_class($content_class)){
-				$ok=0;
-				if($content_parent==0){
-					$ok=1;
-				} else {
-					if($sql2 -> db_Select("content","content_class","content_id = '{$content_parent}'")){
-						$row2 = $sql2 -> db_Fetch();
-						if(check_class($row2['content_class'])){
-							$ok=1;
-						}
-					}
-				}
-				if($ok){
-					$text .= "<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."content.php?review.".$content_id."'>".$content_heading."</a><br />";
-				}
-			}
-		}
-	if($menu_pref['reviews_submitlink'] && check_class($pref['review_submit_class'])){
-		$text .= "<br /><img src='".THEME."images/bullet2.gif' alt='bullet' /> <a href='".e_BASE."subcontent.php?review'> ".LAN_190."</a>";
-	}
-		$caption = (file_exists(THEME."images/review_menu.png") ? "<img src='".THEME."images/review_menu.png' alt='' style='vertical-align:middle' /> ".$menu_pref['reviews_caption'] : $menu_pref['reviews_caption']);
-		$ns -> tablerender($caption, $text);
-	}
-	if($pref['cachestatus']){
-		$aj = new textparse;
-		$cache = $aj -> formtpa(ob_get_contents(), "admin");
-		set_cache("review_menu", $cache);
-	}
-}
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/rss_menu/admin_prefs.php 75/e107_plugins/rss_menu/admin_prefs.php
--- 6171/e107_plugins/rss_menu/admin_prefs.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/rss_menu/admin_prefs.php	2006-01-08 18:04:36.000000000 -0600
@@ -0,0 +1,93 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/rss_menu/admin_prefs.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2006/01/09 00:04:36 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+
+require_once("../../class2.php");
+if(!getperms("P")){ header("location:".e_BASE."index.php"); }
+$lan_file = e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php";
+require_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."rss_menu/languages/English.php");
+
+require_once(e_ADMIN."auth.php");
+
+if(IsSet($_POST['updatesettings'])){
+	$pref['rss_feeds'] = implode(",",$_POST['feeds']);
+	$pref['rss_newscats'] = $_POST['rss_newscats'];
+	$pref['rss_dlcats'] = $_POST['rss_dlcats'];
+	save_prefs();
+	$message = LAN_SAVED;
+}
+
+if(isset($message)){
+	$ns -> tablerender("", "<div style='text-align:center'><b>$message</b></div>");
+}
+
+$text = "<div style='text-align:center'>
+<form method='post' action='".e_SELF."'>
+<table class='fborder' style='width:94%' class='fborder'>
+<tr><td class='fcaption'>".BACKEND_MENU_L2."</td><td class='fcaption'>Enable</td></tr>";
+
+	$feedlist[1] = "News";
+	$feedlist[12] = "Downloads";
+	$feedlist[6] = "Forum Threads";
+	$feedlist[7] = "Forum Posts";
+    if($sql -> db_Select("plugin","plugin_rss","plugin_rss != '' ")){
+		while($row = $sql -> db_Fetch()){
+			$tmp = explode(",",$row['plugin_rss']);
+			foreach($tmp as $key){
+				$feedlist[$key] = ucfirst($key);
+			}
+		}
+    }
+	$preset = explode(",",$pref['rss_feeds']);
+
+	foreach($feedlist as $key=>$name){
+		$text .= "<tr><td class='forumheader3'><a rel='external' title='view $name feed' href='".e_PLUGIN."rss_menu/rss.php?$key.2'>$name</a></td>";
+		$text .= "<td class='forumheader3'>";
+		$selected = in_array($key,$preset) ? "checked='checked'" : "";
+		$text .= "<input type='checkbox'  name='feeds[]' value='$key' $selected />";
+
+	$text .="</td></tr>";
+	}
+
+	$text .= "<tr><td class='forumheader3'>".RSS_LAN01."</td>";
+	$text .= "<td class='forumheader3'>";
+	$sel = ($pref['rss_newscats'] == 1) ? " checked='checked' " : "";
+	$text .= "<input type='checkbox' $sel  name='rss_newscats' value='1' />
+				</td></tr>";
+
+	$text .= "<tr><td class='forumheader3'>".RSS_LAN02."</td>";
+	$text .= "<td class='forumheader3'>";
+	$sel = ($pref['rss_dlcats'] == 1) ? " checked='checked' " : "";
+	$text .= "<input type='checkbox' $sel name='rss_dlcats' value='1' />
+				</td></tr>";
+
+	$text .="<tr style='vertical-align:top'>
+	<td colspan='2'  style='text-align:center' class='forumheader'>
+	<input class='button' type='submit' name='updatesettings' value='".LAN_SAVE."' />
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+
+$ns -> tablerender(BACKEND_MENU_L2, $text);
+
+require_once(e_ADMIN."footer.php");
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/rss_menu/images/rss_16.png and 75/e107_plugins/rss_menu/images/rss_16.png differ
Files 6171/e107_plugins/rss_menu/images/rss1.png and 75/e107_plugins/rss_menu/images/rss1.png differ
Files 6171/e107_plugins/rss_menu/images/rss2.png and 75/e107_plugins/rss_menu/images/rss2.png differ
Files 6171/e107_plugins/rss_menu/images/rss_32.png and 75/e107_plugins/rss_menu/images/rss_32.png differ
Files 6171/e107_plugins/rss_menu/images/rss3.png and 75/e107_plugins/rss_menu/images/rss3.png differ
diff -ruN 6171/e107_plugins/rss_menu/languages/English.php 75/e107_plugins/rss_menu/languages/English.php
--- 6171/e107_plugins/rss_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/rss_menu/languages/English.php	2005-10-13 13:55:26.000000000 -0500
@@ -0,0 +1,38 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/rss_menu/languages/English.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/10/13 18:55:26 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+define("BACKEND_MENU_L1", " can be syndicated by using these rss feeds.");
+define("BACKEND_MENU_L2", "RSS Feeds");
+
+define("BACKEND_MENU_L3", "Our news");
+define("BACKEND_MENU_L4", "Our comments");
+define("BACKEND_MENU_L5", "Our forum threads");
+define("BACKEND_MENU_L6", "Our forum posts");
+
+define("BACKEND_MENU_L7", "Our chatbox posts");
+define("BACKEND_MENU_L8", "Our bugtracker reports");
+define("BACKEND_MENU_L9", "Our downloads");
+
+define("RSS_LAN01", "Enable seperate feeds for each news category?");
+define("RSS_LAN02", "Enable seperate feeds for each download category?");
+
+define("RSS_NEWS","News");
+define("RSS_COM","Comments"); 
+define("RSS_ART","Articles");
+define("RSS_REV", "Reviews");
+define("RSS_FT","Forum Threads");
+define("RSS_FP","Forum Posts");
+define("RSS_FSP","Forum Specific Post");
+define("RSS_BUG","Bugtracker");
+define("RSS_FOR","Forum");
+define("RSS_DL","Downloads");
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/rss_menu/plugin.php 75/e107_plugins/rss_menu/plugin.php
--- 6171/e107_plugins/rss_menu/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/rss_menu/plugin.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,81 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/rss_menu/plugin.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = "RSS";
+$eplug_version = "1.0";
+$eplug_author = "e107";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = "RSS Feeds";
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";
+$eplug_status = TRUE;
+
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "rss_menu";
+
+// Name of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "rss_menu";
+
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_prefs.php";
+
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/rss_32.png";
+$eplug_icon_small = $eplug_folder."/images/rss_16.png";
+$eplug_caption = "Configure RSS Feeds";
+
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array(
+	'rss_feeds' => '1'
+);
+
+
+
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = "";
+
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = "";
+
+$eplug_rss = "";
+
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = '';
+$eplug_link_url = '';
+
+
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = "RSS has successfully installed. ";
+
+
+// upgrading ... //
+
+$upgrade_add_prefs = "";
+
+$upgrade_remove_prefs = "";
+
+$upgrade_alter_tables = "";
+
+$eplug_upgrade_done = "";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/rss_menu/rss_menu.php 75/e107_plugins/rss_menu/rss_menu.php
--- 6171/e107_plugins/rss_menu/rss_menu.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/rss_menu/rss_menu.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,77 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/rss_menu/rss_menu.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $FILES_DIRECTORY,$pref;
+$path = e_PLUGIN."rss_menu/";
+
+$des = "";
+
+if(strstr(e_SELF, "comment.php")) {
+	$type = 5;
+	$des = BACKEND_MENU_L4;
+}
+if(strstr(e_SELF, "/forum")) {
+	$type = 6;
+	$des = BACKEND_MENU_L5;
+}
+if(strstr(e_SELF, "forum_viewtopic")) {
+	$type = 7;
+	$des = BACKEND_MENU_L6;
+}
+if(strstr(e_SELF, "chat.php")) {
+	$type = 9;
+	$des = BACKEND_MENU_L7;
+}
+
+if(strstr(e_SELF, "/bugtracker")) {
+	$type = 10;
+	$des = BACKEND_MENU_L8;
+}
+
+if(strstr(e_SELF, "download.php")) {
+	$type = 12;
+	$des = BACKEND_MENU_L9;
+}
+
+if(!$des) {
+	$type = 1;
+	$des = BACKEND_MENU_L3;
+}
+
+if(e_PAGE == "news.php" && $pref['rss_newscats'])
+{
+	$qry = explode(".",e_QUERY);
+	if($qry[0] == "cat" || $qry[0] == "list")
+	{
+		$topic = intval($qry[1]);
+	}
+}
+
+$text = "<div style='text-align:center' class='smalltext'>
+".$des.BACKEND_MENU_L1."<br />
+<div class='spacer'><a href='".$path."rss.php?$type.1.$topic'><img src='".$path."images/rss1.png' alt='rss1.0' style='border:0' /></a></div>
+<div class='spacer'><a href='".$path."rss.php?$type.2.$topic'><img src='".$path."images/rss2.png' alt='rss2.0' style='border:0' /></a></div>
+<div class='spacer'><a href='".$path."rss.php?$type.3.$topic'><img src='".$path."images/rss3.png' alt='rdf' style='border:0' /></a><br /></div>
+</div>";
+
+$caption = (file_exists(THEME."images/backend_menu.png") ? "<img src='".THEME_ABS."images/backend_menu.png' alt='' style='vertical-align:middle' /> ".BACKEND_MENU_L2 : BACKEND_MENU_L2);
+
+$ns->tablerender($caption, $text, 'backend');
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/rss_menu/rss_meta.php 75/e107_plugins/rss_menu/rss_meta.php
--- 6171/e107_plugins/rss_menu/rss_meta.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/rss_menu/rss_meta.php	2006-01-25 14:17:09.000000000 -0600
@@ -0,0 +1,50 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/rss_menu/rss_meta.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2006/01/25 20:17:09 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+	$rss = explode(",",$pref['rss_feeds']);
+	$feedlist[1] = "News";
+	$feedlist[12] = "Downloads";
+	$feedlist[6] = "Forum Threads";
+	$feedlist[7] = "Forum Posts";
+
+foreach($rss as $rss_id){
+	if(!is_numeric($rss_id)){
+    	$feedlist[$rss_id] = ucfirst($rss_id);
+	}
+	echo "<link rel='alternate' type='application/rss+xml' title='".htmlspecialchars(SITENAME, ENT_QUOTES, CHARSET)." ".$feedlist[$rss_id] ."' href='".SITEURLBASE.e_PLUGIN_ABS."rss_menu/rss.php?{$rss_id}.2' />\n";
+}
+
+if($pref['rss_newscats']){
+    $sql -> db_Select("news_category");
+        while($row = $sql-> db_Fetch()){
+		echo "<link rel='alternate' type='application/rss+xml' title='".htmlspecialchars(SITENAME, ENT_QUOTES, CHARSET)." News - ".htmlspecialchars(SITENAME, ENT_QUOTES, CHARSET)."' href='".SITEURLBASE.e_PLUGIN_ABS."rss_menu/rss.php?1.2.{$row['category_id']}' />\n";
+        }
+}
+
+if($pref['rss_dlcats']){
+	$class_list = "0,251,252,253";
+    $sql -> db_Select("download_category","*","download_category_class IN (".$class_list.") ORDER BY download_category_name");
+        while($row = $sql-> db_Fetch()){
+		echo "<link rel='alternate' type='application/rss+xml' title='".htmlspecialchars(SITENAME, ENT_QUOTES, CHARSET)." Downloads - ".htmlspecialchars(SITENAME, ENT_QUOTES, CHARSET)."' href='".SITEURLBASE.e_PLUGIN_ABS."rss_menu/rss.php?12.2.{$row['download_category_id']}' />\n";
+        }
+}
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/rss_menu/rss.php 75/e107_plugins/rss_menu/rss.php
--- 6171/e107_plugins/rss_menu/rss.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/rss_menu/rss.php	2006-04-05 07:19:18.000000000 -0500
@@ -0,0 +1,617 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/rss_menu/rss.php,v $
+|     $Revision: 1.47 $
+|     $Date: 2006/04/05 12:19:18 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+/*
+Query string: content_type.rss_type.[topic id]
+1: news
+5: comments
+12: downloads (option: specify category)
+
+The following should be using $eplug_rss in their plugin.php file (see chatbox)
+----------------------------------------------------------------
+2: articles
+3: reviews
+4: content pages
+6: forum threads
+7: forum posts
+8: forum specific post (specify id)
+10: bugtracker
+11: forum
+*/
+
+require_once("../../class2.php");
+
+if (!is_object($tp->e_bb)) {
+	require_once(e_HANDLER.'bbcode_handler.php');
+	$tp->e_bb = new e_bbcode;
+}
+
+if (is_readable(e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php")) {
+	include_once(e_PLUGIN."rss_menu/languages/".e_LANGUAGE.".php");
+} else {
+	include_once(e_PLUGIN."rss_menu/languages/English.php");
+}
+
+$namearray[1] = RSS_NEWS;
+$namearray[2] = RSS_ART;
+$namearray[3] = RSS_REV;
+$namearray[5] = RSS_COM;
+$namearray[6] = RSS_FT;
+$namearray[7] = RSS_FP;
+$namearray[8] = RSS_FSP;
+$namearray[10] = RSS_BUG;
+$namearray[11] = RSS_FOR;
+$namearray[12] = RSS_DL;
+
+list($content_type, $rss_type, $topic_id) = explode(".", e_QUERY);
+if (intval($rss_type) == false) {
+	echo "No type specified";
+	exit;
+}
+
+if($rss = new rssCreate($content_type, $rss_type, $topic_id))
+{
+	$rss_title = (is_numeric($content_type) && $namearray[$content_type]) ? $namearray[$content_type] : ucfirst($content_type);
+	$rss->buildRss ($rss_title);
+}
+
+class rssCreate {
+
+	var $contentType;
+	var $rssType;
+	var $path;
+	var $rssItems;
+	var $rssQuery;
+	var $topicid;
+	var $offset;
+	var $rssNamespace;
+	var $rssCustomChannel;
+
+	function rssCreate($content_type, $rss_type, $topic_id) {
+		// constructor
+		$sql_rs = new db;
+		global $tp, $sql, $e107, $PLUGINS_DIRECTORY, $pref;
+		$this -> path = e_PLUGIN."rss_menu/";
+		$this -> rssType = $rss_type;
+		$this -> topicid = $topic_id;
+		$this -> offset = $pref['time_offset'] * 3600;
+
+		switch ($content_type) {
+			case 1:
+				$topic = (is_numeric($topic_id))? " AND news_category = ".intval($topic_id) : "";
+				$this -> contentType = "news";
+				$this -> rssQuery = "
+				SELECT n.*, u.user_id, u.user_name, u.user_email, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+				LEFT JOIN #user AS u ON n.news_author = u.user_id
+				LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+				WHERE n.news_class IN (".USERCLASS_LIST.") AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type!=2 $topic ORDER BY news_datestamp DESC LIMIT 0,9";
+				$sql->db_Select_gen($this -> rssQuery);
+
+				$tmp = $sql->db_getList();
+
+				$this -> rssItems = array();
+				$loop=0;
+				foreach($tmp as $value) {
+
+					$this -> rssItems[$loop]['title'] = $value['news_title'];
+					$this -> rssItems[$loop]['link'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."news.php?item.".$value['news_id'].".".$value['news_category'];
+                    if($value['news_summary']){
+                        	$this -> rssItems[$loop]['description'] = $value['news_summary'];
+					}else{
+						$this -> rssItems[$loop]['description'] = $value['news_body'];
+                    }
+					$this -> rssItems[$loop]['author'] = $value['user_name'];
+                    $this -> rssItems[$loop]['author_email'] = $value['user_email'];
+					$this -> rssItems[$loop]['category'] = "<category domain='".SITEURL."news.php?cat.".$value['news_category']."'>".$value['category_name']."</category>";
+
+					if($value['news_allow_comments']){
+						$this -> rssItems[$loop]['comment'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$news_id;
+                    }
+					$this -> rssItems[$loop]['pubdate'] = $value['news_datestamp'];
+
+					$loop++;
+				}
+
+				break;
+			case 2:
+				$this -> contentType = "articles";
+				break;
+			case 3:
+				$this -> contentType = "reviews";
+				break;
+			case 4:
+				$this -> contentType = "content";
+				break;
+			case 5:
+				$this -> contentType = "comments";
+				$this -> rssQuery = "SELECT * FROM #comments ORDER BY comment_datestamp DESC LIMIT 0,9";
+				$sql->db_Select_gen($this -> rssQuery);
+
+				$tmp = $sql->db_getList();
+
+				$this -> rssItems = array();
+				$loop=0;
+				foreach($tmp as $value) {
+					$this -> rssItems[$loop]['title'] = $value['comment_subject'];
+
+					switch ($value['comment_type']) {
+						case 0:
+							$this -> rssItems[$loop]['link'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.news.".$value['comment_item_id'];
+							break;
+						case 4:
+							$this -> rssItems[$loop]['link'] = "http://".$_SERVER['HTTP_HOST'].e_HTTP."comment.php?comment.poll.".$value['comment_item_id'];
+							break;
+					}
+
+					$this -> rssItems[$loop]['description'] = $value['comment_comment'];
+					$this -> rssItems[$loop]['author'] = substr($value['comment_author'], (strpos($value['comment_author'], ".")+1));
+					$loop++;
+				}
+
+				break;
+			case 6:
+				$this -> contentType = "forum threads";
+				$this -> rssQuery =
+				"SELECT t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, u.user_name, u.user_email FROM #forum_t AS t
+				LEFT JOIN #user AS u ON FLOOR(t.thread_user) = u.user_id
+				LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
+				WHERE f.forum_class IN (0, 251, 252) AND t.thread_parent=0
+				ORDER BY t.thread_datestamp DESC LIMIT 0, 9
+				";
+				$sql->db_Select_gen($this -> rssQuery);
+				$tmp = $sql->db_getList();
+
+				$this -> rssItems = array();
+				$loop=0;
+				foreach($tmp as $value) {
+
+					if($value['user_name']) {
+						$this -> rssItems[$loop]['author'] = $value['user_name'];
+                       	$this -> rssItems[$loop]['author_email'] = $value['user_email'];  // must include an email address to be valid.
+				} else {
+						$tmp=explode(".", $value['thread_user'], 2);
+						list($this -> rssItems[$loop]['author'], $ip) = explode(chr(1), $tmp[1]);
+					}
+
+					$this -> rssItems[$loop]['title'] = $value['thread_name'];
+					$this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_id'];
+
+					$this -> rssItems[$loop]['description'] = $value['thread_thread'];
+
+					$loop++;
+				}
+				break;
+
+			case 7:
+				$this -> contentType = "forum posts";
+				$this -> rssQuery = "SELECT tp.thread_name AS parent_name, t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, u.user_email FROM #forum_t AS t
+				LEFT JOIN #user AS u ON FLOOR(t.thread_user) = u.user_id
+				LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id
+				LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
+				WHERE f.forum_class  IN (0, 251, 252)
+				ORDER BY t.thread_datestamp DESC LIMIT 0, 9";
+				$sql->db_Select_gen($this -> rssQuery);
+				$tmp = $sql->db_getList();
+				$this -> rssItems = array();
+				$loop=0;
+				foreach($tmp as $value) {
+
+					if($value['user_name']) {
+						$this -> rssItems[$loop]['author'] = $value['user_name'];
+						$this -> rssItems[$loop]['author_email'] = $value['user_email'];  // must include an email address to be valid.
+					} else {
+						$tmp=explode(".", $value['thread_user'], 2);
+						list($this -> rssItems[$loop]['author'], $ip) = explode(chr(1), $tmp[1]);
+					}
+
+					if($value['parent_name']) {
+						$this -> rssItems[$loop]['title'] = "Re: ".$value['parent_name'];
+						$this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_parent'];
+					} else {
+						$this -> rssItems[$loop]['title'] = $value['thread_name'];
+						$this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_id'];
+					}
+
+					$this -> rssItems[$loop]['description'] = $value['thread_thread'];
+
+					$loop++;
+				}
+				break;
+
+			case 8:
+				if(!$this -> topicid) {
+					return FALSE;
+				}
+				$this -> contentType = "forum topic / replies";
+
+				/* get thread ...  */
+				$this -> rssQuery = "SELECT t.thread_name, t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, f.forum_id, f.forum_name, f.forum_class, u.user_name
+				FROM #forum_t AS t
+				LEFT JOIN #user AS u ON FLOOR(t.thread_user) = u.user_id
+				LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
+				WHERE f.forum_class  IN (0, 251, 255) AND t.thread_id=".intval($this -> topicid);
+				$sql->db_Select_gen($this -> rssQuery);
+				$topic = $sql->db_Fetch();
+
+				/* get replies ...  */
+				$this -> rssQuery = "SELECT t.thread_name, t.thread_thread, t.thread_id, t.thread_name, t.thread_datestamp, t.thread_parent, t.thread_user, t.thread_views, t.thread_lastpost, f.forum_id, f.forum_name, f.forum_class, u.user_name, u.user_email
+				FROM #forum_t AS t
+				LEFT JOIN #user AS u ON FLOOR(t.thread_user) = u.user_id
+				LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
+				WHERE f.forum_class  IN (0, 251, 255) AND t.thread_parent=".intval($this -> topicid);
+				$sql->db_Select_gen($this -> rssQuery);
+				$replies = $sql->db_getList();
+
+				$this -> rssItems = array();
+				$loop = 0;
+
+				if($value['user_name']) {
+					$this -> rssItems[$loop]['author'] = $value['user_name'] . " ( ".$e107->base_path."user.php?id.".intval($value['thread_user'])." )";
+				} else {
+					$tmp=explode(".", $value['thread_user'], 2);
+					list($this -> rssItems[$loop]['author'], $ip) = explode(chr(1), $tmp[1]);
+				}
+
+				$this -> rssItems[$loop]['title'] = $topic['thread_name'];
+				$this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$topic['thread_id'];
+				$this -> rssItems[$loop]['description'] = $topic['thread_thread'];
+				$loop ++;
+				foreach($replies as $value) {
+					if($value['user_name']) {
+						$this -> rssItems[$loop]['author'] = $value['user_name'];
+						$this -> rssItems[$loop]['author_email'] = $value['user_email'];  // must include an email address to be valid.
+					} else {
+						$tmp=explode(".", $value['thread_user'], 2);
+						list($this -> rssItems[$loop]['author'], $ip) = explode(chr(1), $tmp[1]);
+					}
+					$this -> rssItems[$loop]['title'] = "Re: ".$topic['thread_name'];
+					$this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$this -> topicid;
+					$this -> rssItems[$loop]['description'] = $value['thread_thread'];
+					$loop++;
+				}
+			break;
+
+
+			case 10:
+				$this -> contentType = "bugtracker reports";
+				$sql->db_Select("bugtrack2_bugs", "*", "bugtrack2_bugs_status=0 ORDER BY bugtrack2_bugs_datestamp");
+				$tmp = $sql->db_getList();
+				$this -> rssItems = array();
+				$loop=0;
+				foreach($tmp as $value) {
+					$nick = preg_replace("/[0-9]+\./", "", $value['bugtrack2_bugs_poster']);
+					$this -> rssItems[$loop]['author'] = $nick;
+					$this -> rssItems[$loop]['title'] = $value['bugtrack2_bugs_summary'];
+					$this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."bugtracker2/bugtracker2.php?0.bug.".$value['bugtrack2_bugs_id'];
+					$this -> rssItems[$loop]['description'] = $value['bugtrack2_bugs_description'];
+					$loop++;
+				}
+			break;
+
+			case 11:
+				$this -> rssQuery = "
+				SELECT f.forum_id, f.forum_name, f.forum_class, tp.thread_name AS parent_name, t.*, u.user_name, u.user_email from #forum_t as t
+				LEFT JOIN #user AS u ON FLOOR(t.thread_user) = u.user_id
+				LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id
+				LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
+				WHERE t.thread_forum_id = ".intval($this->topicid)."
+				AND f.forum_class IN (0, 251, 255)
+				ORDER BY
+				t.thread_datestamp DESC
+				LIMIT 0, 9
+				";
+				$sql->db_Select_gen($this -> rssQuery);
+				$tmp = $sql->db_getList();
+				$this -> contentType = "forum: ".$tmp[1]['forum_name'];
+				$this -> rssItems = array();
+				$loop=0;
+				foreach($tmp as $value) {
+					if($value['user_name']) {
+						$this -> rssItems[$loop]['author'] = $value['user_name'];
+						$this -> rssItems[$loop]['author_email'] = $value['user_email'];
+					} else {
+						$tmp=explode(".", $value['thread_user'], 2);
+						list($this -> rssItems[$loop]['author'], $ip) = explode(chr(1), $tmp[1]);
+					}
+
+					if($value['parent_name']) {
+						$this -> rssItems[$loop]['title'] = "Re: ".$value['parent_name'];
+						$this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_id'].".post";
+					} else {
+						$this -> rssItems[$loop]['title'] = $value['thread_name'];
+						$this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?".$value['thread_id'];
+					}
+					$this -> rssItems[$loop]['description'] = $value['thread_thread'];
+					$loop++;
+				}
+			break;
+
+			case 12:
+				$topic = ($topic_id) ? "download_category='".intval($topic_id)."' AND " : "";
+				$this -> contentType = "downloads";
+				$class_list = "0,251,252,253";
+				$sql->db_Select("download", "*", "{$topic} download_active > 0 AND download_class IN (".$class_list.") ORDER BY download_datestamp DESC LIMIT 0,29");
+				$tmp = $sql->db_getList();
+				$this -> rssItems = array();
+				$loop=0;
+				foreach($tmp as $value) {
+					if($value['download_author']){
+				   		$nick = preg_replace("/[0-9]+\./", "", $value['download_author']);
+						$this -> rssItems[$loop]['author'] = $nick;
+					}
+					$this -> rssItems[$loop]['author_email'] = $value['download_author_email'];
+					$this -> rssItems[$loop]['title'] = $value['download_name'];
+					$this -> rssItems[$loop]['link'] = $e107->base_path."download.php?view.".$value['download_id'];
+					$this -> rssItems[$loop]['description'] = ($rss_type == 3 ? $value['download_description'] : $value['download_description']);
+					$this -> rssItems[$loop]['enc_url'] = $e107->base_path."request.php?".$value['download_id'];
+					$this -> rssItems[$loop]['enc_leng'] = $value['download_filesize'];
+					$this -> rssItems[$loop]['enc_type'] = $this->getmime($value['download_url']);
+					$this -> rssItems[$loop]['pubdate'] = $value['download_datestamp'];
+				$loop++;
+				}
+			break;
+		}
+
+	// Get Plugin RSS feeds.
+	if($sql_rs->db_Select("plugin","*","plugin_rss REGEXP('".$tp -> toDB($content_type, true)."')")){
+		$row2 = $sql_rs -> db_Fetch();
+		require_once(e_PLUGIN.$row2['plugin_path']."/plugin.php");
+		foreach($eplug_rss as $key=>$rs){
+			extract($rs);  // id, author, link, linkid, title, description, query, category, datestamp, enc_url, enc_length, enc_type
+	// dear McFly, I remember why I used extract() now..  to avoid this: $row[($something['whatever'])]
+				if($sql -> db_Select_gen($query)){
+					$this -> contentType = $content_type;
+					$this -> rssNamespace = $namespace;
+					$this -> rssCustomChannel = $custom_channel;
+					$this -> rssItems = array();
+					$tmp = $sql->db_getList();
+					$loop=0;
+					foreach($tmp as $row) {
+
+						$this -> rssItems[$loop]['author'] = $row[$author];
+						$this -> rssItems[$loop]['author_email'] = $row[$author_email];
+						$this -> rssItems[$loop]['title'] = $row[$title];
+						$item = ($itemid) ? $row[$itemid] : "";
+						$link2 = str_replace("#",$item,$link);
+						if($link2){
+							if(eregi("http",$link2)){
+                                $this -> rssItems[$loop]['link'] = $link2;
+							}else{
+                            	$this -> rssItems[$loop]['link'] = $e107->base_path.$PLUGINS_DIRECTORY.$link2;
+							}
+                                            }
+						$this -> rssItems[$loop]['description'] = $row[$description];
+
+						if($enc_url){ $this -> rssItems[$loop]['enc_url'] = $e107->base_path.$PLUGINS_DIRECTORY.$enc_url.$row[$item_id]; }
+               			if($enc_leng){ $this -> rssItems[$loop]['enc_leng'] = $row[$enc_leng]; }
+						if($row[$enc_type]){
+							$this -> rssItems[$loop]['enc_type'] = $this->getmime($row[$enc_type]);
+						}elseif($enc_type){
+							$this -> rssItems[$loop]['enc_type'] = $enc_type;
+						}
+
+						$catid = ($categoryid) ? $row[$categoryid] : "";
+						$catlink = ($categorylink) ? str_replace("#",$catid,$categorylink) : "";
+						if($categoryname && $catlink){
+							$this -> rssItems[$loop]['category_name'] = $row[$categoryname];
+							$this -> rssItems[$loop]['category_link'] = $e107->base_path.$catlink;
+						}
+						if($datestamp){
+							$this -> rssItems[$loop]['pubdate'] = $row[$datestamp];
+						}
+						$loop++;
+					}
+				}
+			}
+		}
+}
+
+	function striptags($text)
+	{
+   		return $text;
+	}
+
+	function buildRss($rss_title) {
+		global $sql, $pref, $tp;
+		header('Content-type: application/xml', TRUE);
+
+		$rss_title = $tp->toRss($pref['sitename']." : ".$rss_title);
+        $rss_namespace = ($this->rssNamespace) ? "xmlns:".$this->rssNamespace : "";
+        $rss_custom_channel = ($this->rssCustomChannel) ? $this->rssCustomChannel : "";
+		$time = time();
+		switch ($this -> rssType) {
+			case 1:		// Rss 1.0
+				echo "<?xml version=\"1.0\" encoding=\"".CHARSET."\" ?>
+						<!-- generator=\"e107\" -->
+						<!-- content type=\"".$this -> contentType."\" -->
+						<rss version=\"0.92\">
+						<channel>
+						<title>".$tp->toRss($rss_title)."</title>
+						<link>".$pref['siteurl']."</link>
+						<description>".$tp->toRss($pref['sitedescription'])."</description>
+						<lastBuildDate>".$itemdate = date("r", ($time + $this -> offset))."</lastBuildDate>
+						<docs>http://backend.userland.com/rss092</docs>\n";
+
+					foreach($this -> rssItems as $value) {
+						echo "
+							<item>
+							<title>".$tp->toRss($value['title'])."</title>
+							<description>".$tp->toRss(substr($value['description'],0,150))."</description>
+							<author>".$value['author']."&lt;".$this->nospam($value['author_email'])."&gt;</author>
+							<link>".$value['link']."</link>
+							</item>";
+					}
+					echo "
+						</channel>
+						</rss>";
+					break;
+
+				case 2: // rss 2.0
+			$sitebutton = (strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON);
+			echo "<?xml version=\"1.0\" encoding=\"".CHARSET."\"?>
+				<!-- generator=\"e107\" -->
+				<!-- content type=\"".$this -> contentType."\" -->
+
+				<!-- test=\"".SITEDISCLAIMER."\" -->
+
+				<rss {$rss_namespace} version=\"2.0\">
+				<channel>
+				<title>".$tp->toRss($rss_title)."</title>
+				<link>".$pref['siteurl']."</link>
+				<description>".$tp->toRss($pref['sitedescription'])."</description>\n";
+
+			echo $tp->toRss($rss_custom_channel,TRUE)."\n";
+
+			echo "<language>en-gb</language>
+				<copyright>".preg_replace("#\<br \/\>|\n|\r#si", "", SITEDISCLAIMER)."</copyright>
+				<managingEditor>".$pref['siteadmin']." - ".$pref['siteadminemail']."</managingEditor>
+				<webMaster>".$pref['siteadminemail']."</webMaster>
+				<pubDate>".date("r",($time + $this -> offset))."</pubDate>
+				<lastBuildDate>".date("r",($time + $this -> offset))."</lastBuildDate>
+				<docs>http://backend.userland.com/rss</docs>
+				<generator>e107 (http://e107.org)</generator>
+				<ttl>60</ttl>
+				<image>
+				<title>".$tp->toRss($rss_title)."</title>
+				<url>".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : SITEURL.str_replace("../", "", e_IMAGE).SITEBUTTON)."</url>
+				<link>".$pref['siteurl']."</link>
+				<width>88</width>
+				<height>31</height>
+				<description>".$tp->toRss($pref['sitedescription'])."</description>
+				</image>
+				<textInput>
+				<title>Search</title>
+				<description>Search ".$tp->toRss($pref['sitename'])."</description>
+				<name>query</name>
+				<link>".SITEURL.(substr(SITEURL, -1) == "/" ? "" : "/")."search.php</link>
+				</textInput>";
+			foreach($this -> rssItems as $value) {
+				echo "
+					<item>
+					<title>".$tp->toRss($value['title'])."</title>\n";
+
+				if($value['link']){
+                	echo "<link>".$value['link']."</link>\n";
+				}
+
+				echo "<description>".$tp->toRss($value['description'])."</description>\n";
+
+				if($value['category_name'] && $value['category_link']){
+                	echo "<category domain='".$value['category_link']."'>".$tp -> toRss($value['category_name'])."</category>\n";
+				}
+
+				if($value['comment']){
+					echo "<comments>".$tp->toRss($value['comment'])."</comments>\n";
+				}
+
+				if($value['author']){
+					echo "<author>".$value['author']."&lt;".$this->nospam($value['author_email'])."&gt;</author>\n";
+				}
+
+				// enclosure support for podcasting etc.
+		   		if($value['enc_url'] && $value['enc_leng'] && $value['enc_type']){
+					echo "<enclosure url=\"".$value['enc_url']."\" length=\"".$value['enc_leng']."\" type=\"".$value['enc_type']."\"   />\n";
+		   	 	}
+
+				echo "<pubDate>".date("r", ($value['pubdate'] + $this -> offset))."</pubDate>\n";
+
+				if($value['link']){
+					echo "<guid isPermaLink=\"true\">".$value['link']."</guid>\n";
+				}
+
+				echo "</item>";
+			}
+			echo "
+				</channel>
+				</rss>";
+			break;
+
+			case 3: // rdf
+			echo "<?xml version=\"1.0\" encoding=\"".CHARSET."\" ?>
+				<!-- generator=\"e107\" -->
+				<!-- content type=\"".$this -> contentType."\" -->
+				<rdf:RDF xmlns=\"http://purl.org/rss/1.0/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\" xmlns:admin=\"http://webns.net/mvcb/\" xmlns:content=\"http://purl.org/rss/1.0/modules/content/\">
+				<channel rdf:about=\"".$pref['siteurl']."\">
+				<title>".$tp->toRss($rss_title)."</title>
+				<link>".$pref['siteurl']."</link>
+				<description>".$tp->toRss($pref['sitedescription'])."</description>
+				<dc:language>en</dc:language>
+				<dc:date>".$this->get_iso_8601_date($time + $this -> offset). "</dc:date>
+				<dc:creator>".$pref['siteadminemail']."</dc:creator>
+				<admin:generatorAgent rdf:resource=\"http://e107.org\" />
+				<admin:errorReportsTo rdf:resource=\"mailto:".$pref['siteadminemail']."\" />
+				<sy:updatePeriod>hourly</sy:updatePeriod>
+				<sy:updateFrequency>1</sy:updateFrequency>
+				<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
+				<items>
+				<rdf:Seq>";
+
+			foreach($this -> rssItems as $value) {
+				echo "
+					<rdf:li rdf:resource=\"".$value['link']."\" />";
+			}
+
+			echo "
+				</rdf:Seq>
+				</items>
+				</channel>";
+
+			reset($this -> rssItems);
+			foreach($this -> rssItems as $value) {
+				echo "
+					<item rdf:about=\"".$value['link']."\">
+					<title>".$tp->toRss($value['title'])."</title>
+					<link>".$value['link']."</link>
+					<dc:date>".$this->get_iso_8601_date($time + $this -> offset)."</dc:date>
+					<dc:creator>".$value['author']."</dc:creator>
+					<dc:subject>".$tp->toRss($value['category_name'])."</dc:subject>
+					<description>".$tp->toRss($value['description'])."</description>
+					</item>";
+			}
+			echo "
+				</rdf:RDF>";
+			break;
+		}
+	}
+
+
+	function getmime($file){
+		$ext = strtolower(str_replace(".","",strrchr(basename($file), ".")));
+		$mime["mp3"] = "audio/mpeg";
+		return $mime[$ext];
+	}
+
+
+    function get_iso_8601_date($int_date) {
+   //$int_date: current date in UNIX timestamp
+   		$date_mod = date('Y-m-d\TH:i:s', $int_date);
+   		$pre_timezone = date('O', $int_date);
+   		$time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);
+   		$date_mod .= $time_zone;
+   		return $date_mod;
+	}
+
+	function nospam($text){
+		$tmp = explode("@",$text);
+		return ($tmp[0] != "") ? $tmp[0]."@nospam.com" : "noauthor@nospam.com";
+	}
+
+}
+
+?>
\ No newline at end of file
Files 6171/e107_plugins/search_menu/images/search_32.png and 75/e107_plugins/search_menu/images/search_32.png differ
Files 6171/e107_plugins/search_menu/images/search.png and 75/e107_plugins/search_menu/images/search.png differ
diff -ruN 6171/e107_plugins/search_menu/languages/English.php 75/e107_plugins/search_menu/languages/English.php
--- 6171/e107_plugins/search_menu/languages/English.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/search_menu/languages/English.php	2005-01-27 13:53:17.000000000 -0600
@@ -1,5 +1,14 @@
-<?php
-
-define("LAN_180", "Search");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system - Language File.
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/search_menu/languages/English.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:53:17 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+define("LAN_180", "Search");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/search_menu/search_menu.php 75/e107_plugins/search_menu/search_menu.php
--- 6171/e107_plugins/search_menu/search_menu.php	2004-05-06 01:24:44.000000000 -0500
+++ 75/e107_plugins/search_menu/search_menu.php	2006-04-23 04:34:26.000000000 -0500
@@ -1,24 +1,78 @@
-<?php
-@include(e_PLUGIN."search_menu/languages/".e_LANGUAGE.".php");
-if(strstr(e_PAGE, "news.php")){ $page = 0;}
-elseif(strstr(e_PAGE, "comment.php")){ $page = 1;}
-elseif(strstr(e_PAGE, "content.php") && strstr(e_QUERY, "content")){ $page = 2;}
-elseif(strstr(e_PAGE, "content.php") && strstr(e_QUERY, "review")){ $page = 3;}
-elseif(strstr(e_PAGE, "content.php") && strstr(e_QUERY, "content")){ $page = 4;}
-elseif(strstr(e_PAGE, "chat.php")){ $page = 5;}
-elseif(strstr(e_PAGE, "links.php")){ $page = 6;}
-elseif(strstr(e_PAGE, "forum")){ $page = 7;}
-elseif(strstr(e_PAGE, "user.php") || strstr(e_PAGE, "usersettings.php")){ $page = 8;}
-elseif(strstr(e_PAGE, "download.php")){ $page = 9;}
-else{ $page = 99;
-}
-
-$text = "<form method='post' action='".e_BASE."search.php'>
-<p>
-<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />
-<input type='hidden' name='searchtype' value='$page' />
-<input class='button' type='submit' name='searchsubmit' value='".LAN_180."' />
-</p>
-</form>";
-if($searchflat){ echo $text; }else{ $ns -> tablerender(LAN_180." ".SITENAME, "<div style='text-align:center'>".$text."</div>"); }
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/search_menu/search_menu.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2006/04/23 09:34:26 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+@include(e_PLUGIN."search_menu/languages/".e_LANGUAGE.".php");
+if (strstr(e_PAGE, "news.php")) {
+	 $page = 0;
+} elseif(strstr(e_PAGE, "comment.php")) {
+	 $page = 1;
+} elseif(strstr(e_PAGE, "content.php") && strstr(e_QUERY, "content")) {
+	 $page = 2;
+} elseif(strstr(e_PAGE, "content.php") && strstr(e_QUERY, "review")) {
+	 $page = 3;
+} elseif(strstr(e_PAGE, "content.php") && strstr(e_QUERY, "content")) {
+	 $page = 4;
+} elseif(strstr(e_PAGE, "chat.php")) {
+	 $page = 5;
+} elseif(strstr(e_PAGE, "links.php")) {
+	 $page = 6;
+} elseif(strstr(e_PAGE, "forum")) {
+	 $page = 7;
+} elseif(strstr(e_PAGE, "user.php") || strstr(e_PAGE, "usersettings.php")) {
+	 $page = 8;
+} elseif(strstr(e_PAGE, "download.php")) {
+	 $page = 9;
+} else {
+	 $page = 99;
+}
+
+if (isset($custom_query[1]) && $custom_query[1] != '') {
+	$image_file = ($custom_query[1] != 'default') ? $custom_query[1] : e_PLUGIN_ABS.'search_menu/images/search.png';
+	$width = (isset($custom_query[2]) && $custom_query[2]) ? $custom_query[2] : '16';
+	$height = (isset($custom_query[3]) && $custom_query[3]) ? $custom_query[3] : '16';
+		$search_button = "<input type='image' src='".$image_file."' value='".LAN_180."' style='width: ".$width."px; height: ".$height."px; border: 0px; vertical-align: middle' name='s' />";
+} else {
+	$search_button = "<input class='button search' type='submit' name='s' value='".LAN_180."' />";
+}
+
+if (isset($custom_query[5]) && $custom_query[5]) {
+	$value_text = "value='".$custom_query[5]."' onclick=\"this.value=''\"";
+} else {
+	$value_text = "value=''";
+}
+
+$text = "<form method='get' action='".e_HTTP."search.php'>
+	<div>
+	<input class='tbox search' type='text' name='q' size='20' ".$value_text." maxlength='50' />
+	<input type='hidden' name='r' value='0' />";
+	
+	if (isset($custom_query[4]) && $custom_query[4] != '') {
+		$text .= "<input type='hidden' name='ref' value='".$custom_query[4]."' />";
+	}
+	
+	$text .= $search_button."
+	</div>
+	</form>";
+if (isset($searchflat) && $searchflat) {
+	echo $text;
+} else {
+	$ns->tablerender(LAN_180." ".SITENAME, "<div style='text-align:center'>".$text."</div>", 'search');
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/sitebutton_menu/languages/English.php 75/e107_plugins/sitebutton_menu/languages/English.php
--- 6171/e107_plugins/sitebutton_menu/languages/English.php	2004-09-03 13:32:14.000000000 -0500
+++ 75/e107_plugins/sitebutton_menu/languages/English.php	2005-01-27 13:53:17.000000000 -0600
@@ -1,22 +1,22 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/e107_plugins/sitebutton_menu/languages/English.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/03 18:32:13 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-
-define("SITEBUTTON_MENU_L1", "Link to us");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/sitebutton_menu/languages/English.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/01/27 19:53:17 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+	
+define("SITEBUTTON_MENU_L1", "Link to us");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/sitebutton_menu/sitebutton_menu.php 75/e107_plugins/sitebutton_menu/sitebutton_menu.php
--- 6171/e107_plugins/sitebutton_menu/sitebutton_menu.php	2004-09-03 13:32:14.000000000 -0500
+++ 75/e107_plugins/sitebutton_menu/sitebutton_menu.php	2005-12-14 13:28:52.000000000 -0600
@@ -1,3 +1,22 @@
-<?php
-$ns -> tablerender(SITEBUTTON_MENU_L1,  "<div style='text-align:center'>\n<a href='".SITEURL."'><img style='border:0' src='".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : e_IMAGE.SITEBUTTON)."' alt='".SITEBUTTON_MENU_L1."' /></a>\n</div>");
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/sitebutton_menu/sitebutton_menu.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+$ns->tablerender(SITEBUTTON_MENU_L1, "<div style='text-align:center'>\n<a href='".SITEURL."'><img src='".(strstr(SITEBUTTON, "http:") ? SITEBUTTON : e_IMAGE.SITEBUTTON)."' alt='".SITEBUTTON_MENU_L1."' style='border: 0px; width: 88px; height: 31px' /></a>\n</div>", 'sitebutton');
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/trackback/admin_config.php 75/e107_plugins/trackback/admin_config.php
--- 6171/e107_plugins/trackback/admin_config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/trackback/admin_config.php	2005-06-19 03:37:54.000000000 -0500
@@ -0,0 +1,77 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/trackback/admin_config.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/06/19 08:37:54 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+if (!getperms("P")) {
+	header("location:".e_BASE."index.php");
+	 exit ;
+}
+
+@include_once(e_PLUGIN."trackback/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."trackback/languages/English.php");
+	
+require_once(e_ADMIN."auth.php");
+	
+if (isset($_POST['updatesettings'])) {
+	$pref['trackbackEnabled'] = $_POST['trackbackEnabled'];
+	$pref['trackbackString'] = $tp->toDB($_POST['trackbackString']);
+	save_prefs();
+	$message = TRACKBACK_L4;
+}
+
+	
+if (isset($message)) {
+	$ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
+}
+	
+
+$text = "
+<div style='text-align:center'>
+<form method='post' action='".e_SELF."'>
+<table style='".ADMIN_WIDTH."' class='fborder'>
+<tr>
+<td style='width:50%' class='forumheader3'>".TRACKBACK_L7."</td>
+<td style='width:50%; text-align:right' class='forumheader3'>
+<input type='radio' name='trackbackEnabled' value='1'".($pref['trackbackEnabled'] ? " checked='checked'" : "")." /> ".TRACKBACK_L5."&nbsp;&nbsp;
+<input type='radio' name='trackbackEnabled' value='0'".(!$pref['trackbackEnabled'] ? " checked='checked'" : "")." /> ".TRACKBACK_L6."
+</td>
+</tr>
+
+<tr>
+<td style='width:50%' class='forumheader3'>".TRACKBACK_L8."</td>
+<td style='width:50%; text-align:right' class='forumheader3'>
+<input  size='50' class='tbox' type='text' name='trackbackString' value='".$pref['trackbackString']."'>
+</td>
+</tr>
+
+<td colspan='2' style='text-align:center' class='forumheader'>
+<input class='button' type='submit' name='updatesettings' value='".TRACKBACK_L9."' />
+</td>
+</tr>
+
+</table>
+</form>
+</div>
+";
+
+
+
+$ns->tablerender(TRACKBACK_L10, $text);
+	
+require_once(e_ADMIN."footer.php");
+?>
\ No newline at end of file
Files 6171/e107_plugins/trackback/images/trackback_16.png and 75/e107_plugins/trackback/images/trackback_16.png differ
Files 6171/e107_plugins/trackback/images/trackback_32.png and 75/e107_plugins/trackback/images/trackback_32.png differ
diff -ruN 6171/e107_plugins/trackback/languages/English.php 75/e107_plugins/trackback/languages/English.php
--- 6171/e107_plugins/trackback/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/trackback/languages/English.php	2005-02-22 12:20:52.000000000 -0600
@@ -0,0 +1,37 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/trackback/languages/English.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/02/22 18:20:52 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+	
+define("TRACKBACK_L1", "Configure Trackback");
+define("TRACKBACK_L2", "This plugin enables you to use trackback in your news posts.");
+define("TRACKBACK_L3", "Trackback is now installed and enabled.");
+define("TRACKBACK_L4", "Trackback settings saved.");
+define("TRACKBACK_L5", "On");
+define("TRACKBACK_L6", "Off");
+define("TRACKBACK_L7", "Activate trackback");
+define("TRACKBACK_L8", "Trackback URL text");
+define("TRACKBACK_L9", "Save Settings");
+define("TRACKBACK_L10", "Trackback Settings");
+define("TRACKBACK_L11", "Trackback address for this post:");
+
+define("TRACKBACK_L12", "No trackbacks for this item");
+define("TRACKBACK_L13", "Moderate trackbacks");
+define("TRACKBACK_L14", "Delete");
+define("TRACKBACK_L15", "Trackbacks deleted.");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/trackback/modtrackback.php 75/e107_plugins/trackback/modtrackback.php
--- 6171/e107_plugins/trackback/modtrackback.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/trackback/modtrackback.php	2005-02-22 12:20:53.000000000 -0600
@@ -0,0 +1,73 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/trackback/modtrackback.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/02/22 18:20:53 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+
+
+
+if (!getperms("P") || !$pref['trackbackEnabled'])
+{
+	header("location:".e_BASE."index.php");
+	exit;
+}
+require_once(e_ADMIN."auth.php");
+$id = intval(e_QUERY);
+
+if (IsSet($_POST['moderate'])) {
+	extract($_POST);
+
+	if (is_array($trackback_delete)) {
+		while (list ($key, $cid) = each ($trackback_delete)) {
+			$sql->db_Delete("trackback", "trackback_id='$cid' ");
+		}
+	}
+	$ns->tablerender("", "<div style='text-align:center'><b>".TRACKBACK_L15."</b></div>");
+}
+	
+$text = "<div style='text-align:center'>
+<form method='post' action='".e_SELF."?".e_QUERY."'>
+<table style='".ADMIN_WIDTH."' class='fborder'>";
+
+
+if (!$sql->db_Select("trackback", "*", "trackback_pid=$id"))
+{
+	$text .= "<tr><td class='forumheader3' style='text-align:center'>".TRACKBACK_L12.".</td></tr></table></form></div>";
+} 
+else
+{
+	$tbArray = $sql -> db_getList();
+	foreach($tbArray as $trackback)
+	{
+		extract($trackback);
+		$text .= "<tr>
+		<td class='forumheader3' style='width: 30%;'><a href='$trackback_url' rel='external'>$trackback_title</a></td>
+		<td class='forumheader3' style='width: 40%;'>$trackback_excerpt</td>
+		<td class='forumheader3' style='width: 20%;'>$trackback_blogname</td>
+		<td class='forumheader3' style='width: 10%;'><input type='checkbox' name='trackback_delete[]' value='$trackback_id' /> ".TRACKBACK_L14."</td>
+		</tr>\n";
+	}
+	$text .= "<tr><td colspan='5' class='forumheader' style='text-align:center'><input class='button' type='submit' name='moderate' value='".TRACKBACK_L13."' /></td></tr></table></form></div>";
+	
+		 
+}
+	
+$ns->tablerender(TRACKBACK_L13, $text);
+	
+require_once(e_ADMIN."footer.php");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/trackback/plugin.php 75/e107_plugins/trackback/plugin.php
--- 6171/e107_plugins/trackback/plugin.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/trackback/plugin.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,82 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/trackback/plugin.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN."trackback/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."trackback/languages/English.php");
+
+// Plugin info -------------------------------------------------------------------------------------------------------
+$eplug_name = "Trackback";
+$eplug_version = "1.0";
+$eplug_author = "jalist";
+$eplug_url = "http://e107.org";
+$eplug_email = "jalist@e107.org";
+$eplug_description = TRACKBACK_L2;
+$eplug_compatible = "e107v0.7+";
+$eplug_readme = "";
+// leave blank if no readme file
+	
+// Name of the plugin's folder -------------------------------------------------------------------------------------
+$eplug_folder = "trackback";
+	
+// Mane of menu item for plugin ----------------------------------------------------------------------------------
+$eplug_menu_name = "";
+	
+// Name of the admin configuration file --------------------------------------------------------------------------
+$eplug_conffile = "admin_config.php";
+	
+// Icon image and caption text ------------------------------------------------------------------------------------
+$eplug_icon = $eplug_folder."/images/trackback_32.png";
+$eplug_icon_small = $eplug_folder."/images/trackback_16.png";
+$eplug_caption = TRACKBACK_L1;
+	
+// List of preferences -----------------------------------------------------------------------------------------------
+$eplug_prefs = array(
+"trackbackEnabled" => 0, 
+"trackbackString" => "<span class='smalltext'><b>".TRACKBACK_L11."</b></span>"
+);
+	
+// List of table names -----------------------------------------------------------------------------------------------
+$eplug_table_names = array(
+"trackback");
+	
+// List of sql requests to create tables -----------------------------------------------------------------------------
+$eplug_tables = array(
+"CREATE TABLE ".MPREFIX."trackback (
+  trackback_id int(10) unsigned NOT NULL auto_increment,
+  trackback_pid int(10) unsigned NOT NULL default '0',
+  trackback_title varchar(200) NOT NULL default '',
+  trackback_excerpt varchar(250) NOT NULL default '',
+  trackback_url varchar(150) NOT NULL default '',
+  trackback_blogname varchar(150) NOT NULL default '',
+  PRIMARY KEY  (trackback_id)
+) TYPE=MyISAM;");
+	
+// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
+$eplug_link = FALSE;
+$eplug_link_name = "";
+$ec_dir = "";
+$eplug_link_url = "";
+	
+	
+// Text to display after plugin successfully installed ------------------------------------------------------------------
+$eplug_done = TRACKBACK_L3;
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/trackback/trackbackClass.php 75/e107_plugins/trackback/trackbackClass.php
--- 6171/e107_plugins/trackback/trackbackClass.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/trackback/trackbackClass.php	2006-04-05 07:19:18.000000000 -0500
@@ -0,0 +1,177 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/trackback/trackbackClass.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2006/04/05 12:19:18 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+class trackbackClass
+{
+
+	function sendTrackback ($permLink, $pingUrl, $title, $excerpt)
+	{
+		global $e107;
+
+		$title = urlencode(stripslashes($title));
+		$excerpt = urlencode(stripslashes($excerpt));
+		$blog_name = urlencode(stripslashes(SITENAME));
+		$permLink = urlencode(stripslashes($e107->base_path.$permLink));
+		$query_string = "title=".$title."&url=".$permLink."&blog_name=".$blog_name."&excerpt=".$excerpt;
+
+		if (strstr($pingUrl, '?'))
+		{
+			$pingUrl .= "&".$query_string;
+			$fp = fopen($pingUrl, 'r');
+			$response = fread($fp, 4096);
+			fclose($fp);
+		}
+		else
+		{
+			
+			$trackback_url = parse_url($pingUrl);
+
+			if ((isset($trackback_url["query"])) && ($trackback_url["query"] != ""))
+			{
+				$trackback_url["query"] = "?" . $trackback_url["query"];
+			}
+			else
+			{
+				$trackback_url["query"] = "";
+			}
+
+			if ((isset($trackback_url["port"]) && !is_numeric($trackback_url["port"])) || (!isset($trackback_url["port"])))
+			{
+				$trackback_url["port"] = 80;
+			}
+
+			$header  = 'POST ' . $trackback_url['path'] . $trackback_url['query'] . " HTTP/1.0\r\n";
+			$header .= 'Host: '.$trackback_url['host']."\r\n";
+			$header .= 'Content-Type: application/x-www-form-urlencoded'."\r\n";
+			$header .= 'Content-Length: '.strlen($query_string)."\r\n";
+			$header .= "\r\n";
+			$header .= $query_string;
+
+			$socket = fsockopen($trackback_url["host"], $trackback_url["port"]); 
+
+			if (!is_resource($socket)) {
+				return "$trackbackClass -> sendTrackback: Unable to connect to $pingUrl.";
+			}
+
+			fputs($socket, $header); 
+       
+			$response = "";
+			while (!feof($socket)) {
+				$response .= fgets($socket, 4096);
+			}
+			fclose($socket);
+
+		}
+
+		if(strstr($response, "<error>0</error>"))
+		{
+			return FALSE;
+		}
+		else
+		{
+			if(preg_match("#\<message\>(.*?)\<\/message\>#", $response, $match))
+			{
+				return $match[0];
+			}
+			else
+			{
+				return "No error returned.";
+			}
+		}
+
+    }
+
+	function respondTrackback ()
+	{
+		global $sql, $pref, $tp;
+		$errorMessage = "";
+		if(!$pref['trackbackEnabled'])
+		{
+			$errorMessage = "This site does not allow trackbacks.";
+		}
+
+		$pid = (isset($_GET['pid']) ? intval($_GET['pid']) : intval($_POST['pid']));
+		$permLink = (isset($_GET['url']) ? $_GET['url'] : $_POST['url']);
+		$permLink = $tp -> toDB($permLink);
+		$blog_name = (isset($_GET['blog_name']) ? $_GET['blog_name'] : $_POST['blog_name']);
+		$blog_name = $tp -> toDB($blog_name);
+		$title = (isset($_GET['title']) ? $_GET['title'] : $_POST['title']);
+		$title = $tp -> toDB($title);
+		$excerpt = (isset($_GET['excerpt']) ? $_GET['excerpt'] : $_POST['excerpt']);
+		$excerpt = $tp -> toDB($excerpt);
+
+		/* debug	 */
+		/*
+		$debug_str = "Query string: ".e_TBQS."\n";
+		$debug_str .= "GET INFO: \n";
+		foreach($_GET as $key => $get)
+		{
+			$debug_str .= "$key => $get\n";
+		}
+		$debug_str .= "POST INFO: \n";
+		foreach($_POST as $key => $get)
+		{
+			$debug_str .= "$key => $get\n";
+		}
+		$sql -> db_Insert("debug", "0, '".time()."', '$debug_str' ");
+		*/
+		/* end debug */
+
+
+		if(!$pid)
+		{
+			$errorMessage = "No permanent ID sent.";
+		}
+
+		if(!isset($pid) || !is_numeric($pid))
+		{
+			$errorMessage = "No known item with that pid (pid sent as ".$pid.").";
+		}
+
+		$excerpt = ($excerpt ? strip_tags($excerpt) : "I found your news item interesting, I've added a trackback to it on my website :)");
+		$title = ($title ? $title : "Trackbacking your news item ...");
+		$blog_name = ($blog_name ? $blog_name : "Anonymous site");
+
+		if(!$errorMessage)
+		{
+			if(!$sql -> db_Insert("trackback", "0, $pid, '$title', '$excerpt', '$permLink', '$blog_name' "))
+			{
+				$errorMessage = "Unable to enter your trackback information into the database -> 0, $pid, '$title', '$excerpt', '$permLink', '$blog_name'";
+			}
+		}
+
+		if($errorMessage)
+		{
+			echo '<?xml version="1.0" encoding="iso-8859-1"?'.">\n";
+			echo "<response>\n";
+			echo "<error>1</error>\n";
+			echo "<message>".$errorMessage."</message>\n";
+			echo "</response>";
+		}
+		else
+		{
+			echo '<?xml version="1.0" encoding="iso-8859-1"?'.">\n";
+			echo "<response>\n";
+			echo "<error>0</error>\n";
+			echo "</response>";
+		}
+	}
+}
\ No newline at end of file
diff -ruN 6171/e107_plugins/trackback/trackback.php 75/e107_plugins/trackback/trackback.php
--- 6171/e107_plugins/trackback/trackback.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/trackback/trackback.php	2005-02-15 16:46:22.000000000 -0600
@@ -0,0 +1,24 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/trackback/trackback.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/02/15 22:46:22 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+require_once("../../class2.php");
+header('Content-Type: text/xml');
+include(e_PLUGIN."trackback/trackbackClass.php");
+$trackback = trackbackClass :: respondTrackback();
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/tree_menu/config.php 75/e107_plugins/tree_menu/config.php
--- 6171/e107_plugins/tree_menu/config.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/tree_menu/config.php	2005-10-06 22:29:47.000000000 -0500
@@ -0,0 +1,80 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/tree_menu/config.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/10/07 03:29:47 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+$eplug_admin = TRUE;
+require_once("../../class2.php");
+@include_once(e_PLUGIN."tree_menu/languages/".e_LANGUAGE.".php");
+@include_once(e_PLUGIN."tree_menu/languages/English.php");
+
+if (!getperms("4")) {
+	header("location:".e_BASE."index.php");
+	exit ;
+}
+require_once(e_ADMIN."auth.php");
+	
+if (isset($_POST['update_menu'])) {
+	foreach($_POST as $key => $value) {
+		if ($value != TREE_L2) {
+			$menu_pref[$key] = $value;
+		}
+	}
+	 
+	$tmp = addslashes(serialize($menu_pref));
+	$sql->db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
+	$ns->tablerender("", "<div style='text-align:center'><b>".TREE_L3."</b></div>");
+}
+	
+$text = "
+	<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
+	<table style='".ADMIN_WIDTH."' class='fborder' >
+	 
+	<tr>
+	<td style='width: 50%;' class='forumheader3'>".TREE_L6."</td>
+	<td style='width: 50%;' class='forumheader3'><input class='tbox' type='text' name='tm_class1' size='40' value='".$menu_pref['tm_class1']."' maxlength='20' /></td>
+	</tr>
+
+	<tr>
+	<td style='width: 50%;' class='forumheader3'>".TREE_L7."</td>
+	<td style='width: 50%;' class='forumheader3'><input class='tbox' type='text' name='tm_class2' size='40' value='".$menu_pref['tm_class2']."' maxlength='20' /></td>
+	</tr>
+
+	<tr>
+	<td style='width: 50%;' class='forumheader3'>".TREE_L8."</td>
+	<td style='width: 50%;' class='forumheader3'><input class='tbox' type='text' name='tm_class3' size='40' value='".$menu_pref['tm_class3']."' maxlength='20' /></td>
+	</tr>
+
+	<tr>
+	<td style='width:50%' class='forumheader3'>".TREE_L9."</td>
+	<td style='width:50%; text-align:right' class='forumheader3'>
+	<input type='radio' name='tm_spacer' value='1'".($menu_pref['tm_spacer'] ? " checked='checked'" : "")." /> ".TREE_L4."&nbsp;&nbsp;
+	<input type='radio' name='tm_spacer' value='0'".(!$menu_pref['tm_spacer'] ? " checked='checked'" : "")." /> ".TREE_L5."
+	</td>
+	</tr>
+
+	
+	<tr>
+	<td colspan='2' class='forumheader' style='text-align:center'><input class='button' type='submit' name='update_menu' value='".TREE_L2."' /></td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+$ns->tablerender(TREE_L1, $text);
+	
+require_once(e_ADMIN."footer.php");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/tree_menu/languages/English.php 75/e107_plugins/tree_menu/languages/English.php
--- 6171/e107_plugins/tree_menu/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_plugins/tree_menu/languages/English.php	2005-10-06 21:54:20.000000000 -0500
@@ -0,0 +1,30 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/tree_menu/languages/English.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/10/07 02:54:20 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("TREE_L1", "Configure Tree Menu");
+define("TREE_L2", "Update Tree Menu Settings");
+define("TREE_L3", "Tree Menu configuration saved.");
+define("TREE_L4", "On");
+define("TREE_L5", "Off");
+define("TREE_L6", "CSS class to use for non-openable links");
+define("TREE_L7", "CSS class to use for openable links");
+define("TREE_L8", "CSS class to use for opened links");
+define("TREE_L9", "Use spacer class between main links");
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/tree_menu/tree_menu.php 75/e107_plugins/tree_menu/tree_menu.php
--- 6171/e107_plugins/tree_menu/tree_menu.php	2005-05-12 23:20:33.000000000 -0500
+++ 75/e107_plugins/tree_menu/tree_menu.php	2005-12-14 13:35:26.000000000 -0600
@@ -1,127 +1,172 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /tree_menu.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-/* Modification to keep menu status during navigation on the site
-- Call the language file (only used for title !!! Maybe this title can be included in the default language file)
-- Add a HTML id to the span tags (menus) : span_$link_name
-- Add a javascript function to write a cookie when menu is opened (updatecook)
-- Add a javascript function if menu is closed or no subitem (clearcook)
-- Add event onclick for div without subitem, and modify the existing events for items WITH subitems
-- Add a PHP function to read cookie (if existing) when page is loaded and restore menu status (writing or not window.onload js function)
-*/
-
-include(e_LANGUAGEDIR.e_LAN."/lan_sitelinks.php");
-
-// Many thanks to Lolo Irie for fixing the javascript that drives this menu item
-unset($text);
-($_COOKIE["treemenustatus"]?$treemenustatus = $_COOKIE["treemenustatus"]:$treemenustatus="0");
-$sql2 = new db;
-$sql -> db_Select("links", "*", "link_category='1' AND link_name NOT REGEXP('submenu') ORDER BY link_order");
-while($row = $sql -> db_Fetch()){
-        extract($row);
-        $link_name=strip_tags($link_name);
-        $textadd1 = ""; $textadd2 = "";
-		if($sql2 -> db_Select("links", "*", "link_name REGEXP('submenu.".$link_name."') ORDER BY link_order")){
-				if(check_class($link_class))
-				{
-                        $mlink_name = $link_name;
-                        $textadd1 .= "
-                        <div class='spacer'>
-                        <div class='button' style='width:100%; cursor: pointer; cursor: hand' onclick='expandit(\"span_".$link_name."\");updatecook(\"".$link_name."\");' >";
-						($link_button!="" ? $textadd1b = "<img src='".e_IMAGE."link_icons/".$link_button."' alt='' style='vertical-align:middle;' />" : $textadd1b = "&raquo;" );
-						$textadd2 .= " <a href='javascript: void(0);'  style='text-decoration:none'>".$link_name."</a></div>
-                        <span style=\"display:none\" id=\"span_".$link_name."\">";
-                        $sublink_exist = 0;
-						while($row = $sql2 -> db_Fetch()){
-                                extract($row);
-                                if(check_class($link_class))
-                                {
-                                        $link_name2 = str_replace("submenu.".$mlink_name.".", "", $link_name);
-                                        $textadd2 .= ($link_button!="" ? "<img src='".e_IMAGE."link_icons/".$link_button."' alt='' style='vertical-align:middle' />  " : "&middot; " ).setlink($link_name2, $link_url, $link_open)."\n<br />";
-                                	$sublink_exist = 1;
-								}
-								unset($link_button);
-                        }
-                        if($sublink_exist==0){$textadd1b = "&middot;";}
-						$text .= $textadd1.$textadd1b.$textadd2."</span></div>\n";
-                }
-          }else{
-                if(check_class($link_class))
-                {
-                        $text .= "<div class='spacer'><div class='button' style='width:100%; cursor: pointer; cursor: hand' onclick=\"clearcook();\">".($link_button!="" ? "<img src='".e_IMAGE."link_icons/".$link_button."' alt='' style='vertical-align:middle' />  " : "&middot; " ).
-                        setlink($link_name, $link_url, $link_open)."
-                        </div></div>";
-                }
-        }
-}
-
-$text .= "
-<script type='text/javascript'>
-<!--
-function updatecook(itemmenu){
-        cookitem='span_'+itemmenu;
-        if(document.getElementById(cookitem).style.display!='none'){
-                var expireDate = new Date;
-                expireDate.setMinutes(expireDate.getMinutes()+10);
-                document.cookie = \"treemenustatus=\" + itemmenu + \"; expires=\" + expireDate.toGMTString();
-        }
-        else{
-                clearcook();
-        }
-}\n
-
-function clearcook(){
-        var expireDate = new Date;
-        expireDate.setMinutes(expireDate.getMinutes()+10);
-        document.cookie = \"treemenustatus=\" + \"0\" + \"; expires=\" + expireDate.toGMTString();
-}\n
-//-->\n
-";
-
-(($treemenustatus!="0" && isset($treemenustatus))?$text .= "window.onload=document.getElementById('span_".$treemenustatus."').style.display=''":"");
-
-$text .= "</script>
-";
-$ns -> tablerender(LAN_183, $text);
-
-
-function setlink($link_name, $link_url, $link_open){
-                switch ($link_open){
-                        case 1:
-                                $link_append = "rel='external'";
-                        break;
-                        case 2:
-                                $link_append = "";
-                        break;
-                        case 3:
-                                $link_append = "";
-                        break;
-                        default:
-                                unset($link_append);
-                }
-                if(!strstr($link_url, "http:")){ $link_url = e_BASE.$link_url; }
-                if($link_open == 4){
-                        $link =  "<a style='text-decoration:none' href=\"javascript:open_window('".$link_url."')\">".$link_name."</a>\n";
-                }else{
-                        $link =  "<a style='text-decoration:none' href=\"".$link_url."\" ".$link_append.">".$link_name."</a>\n";
-                }
-        return $link;
-}
-
-
-
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|     /tree_menu.php
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/tree_menu/tree_menu.php,v $
+|     $Revision: 1.23 $
+|     $Date: 2005/12/14 19:35:26 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+/* Modification to keep menu status during navigation on the site
+- Call the language file (only used for title !!! Maybe this title can be included in the default language file)
+- Add a HTML id to the span tags (menus) : span_$link_name
+- Add a javascript function to write a cookie when menu is opened (updatecook)
+- Add a javascript function if menu is closed or no subitem (clearcook)
+- Add event onclick for div without subitem, and modify the existing events for items WITH subitems
+- Add a PHP function to read cookie (if existing) when page is loaded and restore menu status (writing or not window.onload js function)
+*/
+	
+/* changes by jalist
+26/01/2005
++ complete rewrite
++ now uses single db query, links and sublinks are built into array
+*/
+	
+include(e_LANGUAGEDIR.e_LANGUAGE."/lan_sitelinks.php");
+	
+// Many thanks to Lolo Irie for fixing the javascript that drives this menu item
+unset($text);
+	
+$sql->db_Select("links", "*", "ORDER BY link_order ASC", "nowhere"); // get main category links
+$linkArray = $sql->db_getList();
+	
+// all main links now held in array, we now need to loop through them and assign the sublinks to the correct parent links ...
+	
+$mainLinkArray = array();
+foreach($linkArray as $links) {
+	extract ($links);
+	if (check_class($link_class)) {
+		if (!strstr($link_name, "submenu")) {
+			// main link - add to main array ...
+			$mainLinkArray[$link_name]['id'] = $link_id;
+			$mainLinkArray[$link_name]['name'] = strip_tags($link_name);
+			$mainLinkArray[$link_name]['url'] = $link_url;
+			$mainLinkArray[$link_name]['description'] = $link_description;
+			$mainLinkArray[$link_name]['image'] = $link_button;
+			$mainLinkArray[$link_name]['openMethod'] = $link_open;
+			$mainLinkArray[$link_name]['class'] = $link_class;
+		} else {
+			// submenu - add to parent's array entry ...
+			list($null, $parent_name, $submenu_name) = explode(".", $link_name);
+			// get parent name ...
+			$mainLinkArray[$parent_name]['sublink'][$link_id]['parent_name'] = $parent_name;
+			$mainLinkArray[$parent_name]['sublink'][$link_id]['id'] = $link_id;
+			$mainLinkArray[$parent_name]['sublink'][$link_id]['name'] = strip_tags($submenu_name);
+			$mainLinkArray[$parent_name]['sublink'][$link_id]['url'] = $link_url;
+			$mainLinkArray[$parent_name]['sublink'][$link_id]['description'] = $link_description;
+			$mainLinkArray[$parent_name]['sublink'][$link_id]['image'] = $link_button;
+			$mainLinkArray[$parent_name]['sublink'][$link_id]['openMethod'] = $link_open;
+			$mainLinkArray[$parent_name]['sublink'][$link_id]['class'] = $link_class;
+		}
+	}
+}
+	
+// ok, now all mainlinks and sublinks are held in the array, now we have to loop through and build the text to send to screen ...
+
+$text = "";
+foreach($mainLinkArray as $links) {
+	extract ($links);
+	if (array_key_exists("sublink", $links) && $links['name'] != "") {
+		// sublinks found ...
+		$url = "javascript:void(0);";
+		$spanName = str_replace(" ", "_", $name);
+		$image = ($image ? "<img src='".e_IMAGE."icons/".$image."' alt='' style='vertical-align:middle;' />" : "&raquo;");
+		$plink = "<div".($menu_pref['tm_class2'] ? " class='{$menu_pref['tm_class2']}'" : "")." style='width:100%; cursor: pointer;' onclick='expandit(\"span_".$spanName."\");updatecook(\"".$spanName."\");'>".$image.setLink($name, $url, $openMethod, $description)."</div>\n";
+		$text .= ($menu_pref['tm_spacer'] ? "<div class='spacer'>".$plink."</div>\n" : $plink);
+	} else {
+		// no sublinks found ...
+		if($links['name'])
+		{
+			$linkName = $url;
+			$spanName = "";
+			$image = ($image ? "<img src='".e_IMAGE."icons/".$image."' alt='' style='vertical-align:middle;' />" : "&middot;");
+			$plink = "<div".($menu_pref['tm_class1'] ? " class='{$menu_pref['tm_class1']}'" : "")." style='width:100%; cursor: pointer;'>".$image.setLink($name, $url, $openMethod, $description)."</div>";
+			$text .= ($menu_pref['tm_spacer'] ? "<div class='spacer'>".$plink."</div>\n" : $plink);
+		}
+	}
+	 
+	$c = 0;
+	if (array_key_exists("sublink", $links) && $links['name'] != "" ) {
+		$text .= "<span style=\"display:none\" id=\"span_".$spanName."\">\n";
+		foreach($sublink as $link) {
+			extract($link);
+			$image = ($image ? "<img src='".e_IMAGE."icons/".$image."' alt='' style='vertical-align:middle' />  " : "&middot; ");
+			$spanName = str_replace(" ", "_", $parent_name);
+			 
+			$plink = $image.setLink($name, $url, $openMethod, $description)."<br />\n";
+			$text .=($menu_pref['tm_class3'] ? "<span".($menu_pref['tm_class3'] ? " class='{$menu_pref['tm_class3']}'" : "").">".$plink."</span>" : $plink);
+		}
+		$text .= "</span>\n";
+	}
+	 
+}
+	
+function setlink($link_name, $link_url, $link_open, $link_description) {
+	switch ($link_open) {
+		case 1:
+		$link_append = "rel='external'";
+		break;
+		case 2:
+		$link_append = "";
+		break;
+		case 3:
+		$link_append = "";
+		break;
+		default:
+		$link_append = '';
+	}
+	if (!strstr($link_url, "http:") && !strstr($link_url, "void") && strpos($link_url, "mailto:") !== 0) {
+		$link_url = e_BASE.$link_url;
+	}
+	if ($link_open == 4) {
+		$link = "<a style='text-decoration:none' title='".$link_description."' href=\"javascript:open_window('".$link_url."')\">".$link_name."</a>\n";
+	} else {
+		$link = "<a style='text-decoration:none' title='".$link_description."' href=\"".$link_url."\" ".$link_append.">".$link_name."</a>\n";
+	}
+	return $link;
+}
+	
+(isset($_COOKIE["treemenustatus"]) && $_COOKIE["treemenustatus"]) ? $treemenustatus = $_COOKIE["treemenustatus"] : $treemenustatus = "0";
+$text .= "
+	<script type='text/javascript'>
+	<!--
+	function updatecook(itemmenu){
+	cookitem='span_'+itemmenu;
+	if (document.getElementById(cookitem).style.display!='none'){
+	var expireDate = new Date;
+	expireDate.setMinutes(expireDate.getMinutes()+10);
+	document.cookie = \"treemenustatus=\" + itemmenu + \"; expires=\" + expireDate.toGMTString()+\";path=/\";
+	}
+	else{
+	clearcook();
+	}
+	}\n
+	 
+	function clearcook(){
+	var expireDate = new Date;
+	expireDate.setMinutes(expireDate.getMinutes()+10);
+	document.cookie = \"treemenustatus=\" + \"0\" + \"; expires=\" + expireDate.toGMTString();
+	}\n
+	//-->\n
+	";
+	
+(($treemenustatus != "0" && isset($treemenustatus))?$text .= "window.onload=document.getElementById('span_".$treemenustatus."').style.display=''":"");
+	
+$text .= "</script>
+	";
+$ns->tablerender(LAN_183, $text, 'tree_menu');
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/userlanguage_menu/languages/English.php 75/e107_plugins/userlanguage_menu/languages/English.php
--- 6171/e107_plugins/userlanguage_menu/languages/English.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/userlanguage_menu/languages/English.php	2005-07-11 08:07:22.000000000 -0500
@@ -1,18 +1,23 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-define("UTHEME_MENU_L1", "Set Language");
-define("UTHEME_MENU_L2", "Select Interface Language");
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/userlanguage_menu/languages/English.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/07/11 13:07:22 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+	
+define("UTHEME_MENU_L1", "Set Language");
+define("UTHEME_MENU_L2", "Select Language");
+define("UTHEME_MENU_L3", "tables");
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/userlanguage_menu/userlanguage_menu.php 75/e107_plugins/userlanguage_menu/userlanguage_menu.php
--- 6171/e107_plugins/userlanguage_menu/userlanguage_menu.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/userlanguage_menu/userlanguage_menu.php	2005-12-14 13:28:52.000000000 -0600
@@ -1,48 +1,47 @@
-<?php
-if(USER == TRUE){
-
-
-$handle=opendir(e_LANGUAGEDIR);
-while ($file = readdir($handle)){
-	if($file != "." && $file != ".." && $file != "/"){
-		$lanlist[] = $file;
-	}
-}
-closedir($handle);
-
-$defaultlan = $pref['sitelanguage'];
-$count = 0;
-
-$totalct = $sql -> db_Select("user", "user_prefs", "user_prefs REGEXP('sitelanguage') ");
-
-while ($row = $sql -> db_Fetch()){
-	$up = unserialize($row['user_prefs']);
-	$lancount[$up['sitelanguage']]++;
-}
-
-$defaultusers = $sql -> db_Count("user") - $totalct;
-$lancount[$defaultlan] += $defaultusers;
-
-$text = "
-<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<select name='sitelanguage' class='tbox'>";
-$counter = 0;
-
-while($lanlist[$counter]){
-	$text .= "<option value='".$lanlist[$counter]."' ";
-	if(($lanlist[$counter] == USERLAN) || (USERLAN == FALSE && $lanlist[$counter] == $defaultlan)){
-		$text .= "selected";
-	}
-	$text .= ">".($lanlist[$counter] == $defaultlan ? "[ ".$lanlist[$counter]." ]" : $lanlist[$counter])." (users: ".($lancount[$lanlist[$counter]] ? $lancount[$lanlist[$counter]] : "0").")</option>\n";
-	$counter++;
-}
-$text .= "</select>
-<br /><br />
-<input class='button' type='submit' name='setlanguage' value='".UTHEME_MENU_L1."' />
-</form>
-</div>";
-
-$ns -> tablerender(UTHEME_MENU_L2, $text);
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/userlanguage_menu/userlanguage_menu.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+require_once(e_HANDLER."file_class.php");
+	$fl = new e_file;
+	$lanlist = $fl->get_dirs(e_LANGUAGEDIR);
+	sort($lanlist);
+
+	$action = (e_QUERY && !$_GET['elan']) ? e_SELF."?".e_QUERY : e_SELF;
+	$text = "<form method='post' action='".$action."'>
+		<div style='text-align:center'>
+		<select name='sitelanguage' class='tbox' >";
+	foreach($lanlist as $langval)
+	{
+		$selected ="";
+		if($langval == USERLAN || ($langval == $pref['sitelanguage'] && USERLAN == ""))
+		{
+			$selected = "selected='selected'";
+		}
+		$text .= "<option value='".$langval."' $selected>".$langval."</option>\n ";
+	}
+
+	$text .= "</select>";
+	$text .= "<br /><br /><input class='button' type='submit' name='setlanguage' value='".UTHEME_MENU_L1."' />";
+	$text .= "</div></form>	";
+
+$ns->tablerender(UTHEME_MENU_L2, $text, 'user_lan');
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/usertheme_menu/languages/English.php 75/e107_plugins/usertheme_menu/languages/English.php
--- 6171/e107_plugins/usertheme_menu/languages/English.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/usertheme_menu/languages/English.php	2005-01-27 13:53:19.000000000 -0600
@@ -1,6 +1,6 @@
-<?php
-
-define("LAN_350", "Set Theme");
-define("LAN_351", "Select Theme");
-
+<?php
+	
+define("LAN_350", "Set Theme");
+define("LAN_351", "Select Theme");
+	
 ?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/usertheme_menu/languages/French.php 75/e107_plugins/usertheme_menu/languages/French.php
--- 6171/e107_plugins/usertheme_menu/languages/French.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/usertheme_menu/languages/French.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,6 +0,0 @@
-<?
-// French - user-theme. 
-define(LAN_350, "Choix Th&egrave;me");
-define(LAN_351, "S&eacute;lection Th&egrave;me");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/usertheme_menu/languages/usertheme_English.php 75/e107_plugins/usertheme_menu/languages/usertheme_English.php
--- 6171/e107_plugins/usertheme_menu/languages/usertheme_English.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/usertheme_menu/languages/usertheme_English.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,6 +0,0 @@
-<?
-
-define("LAN_350", "Set Theme");
-define("LAN_351", "Select Theme");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/usertheme_menu/languages/usertheme_French.php 75/e107_plugins/usertheme_menu/languages/usertheme_French.php
--- 6171/e107_plugins/usertheme_menu/languages/usertheme_French.php	2004-03-03 12:23:54.000000000 -0600
+++ 75/e107_plugins/usertheme_menu/languages/usertheme_French.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,6 +0,0 @@
-<?
-// French - user-theme. 
-define(LAN_350, "Choix Th&egrave;me");
-define(LAN_351, "S&eacute;lection Th&egrave;me");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_plugins/usertheme_menu/usertheme_menu.php 75/e107_plugins/usertheme_menu/usertheme_menu.php
--- 6171/e107_plugins/usertheme_menu/usertheme_menu.php	2004-06-03 19:59:22.000000000 -0500
+++ 75/e107_plugins/usertheme_menu/usertheme_menu.php	2005-12-14 13:28:52.000000000 -0600
@@ -1,52 +1,69 @@
-<?php
-
-if(USER == TRUE){
-
-$handle=opendir(e_THEME);
-while ($file = readdir($handle)){
-	if($file != "." && $file != ".." && $file != "templates" && $file != "" && $file != "CVS"){
-		if(is_readable(e_THEME.$file."/theme.php") && is_readable(e_THEME.$file."/style.css")){
-			$themelist[] = $file;
-			$themecount[$file] = 0;
-		}
-	}
-}
-closedir($handle);
-
-
-$defaulttheme = $pref['sitetheme'];
-$count = 0;
-
-$totalct = $sql -> db_Select("user", "user_prefs", "user_prefs REGEXP('sitetheme') ");
-
-while ($row = $sql -> db_Fetch()){
-        $up = unserialize($row['user_prefs']);
-        $themecount[$up['sitetheme']]++;
-}
-
-$defaultusers = $sql -> db_Count("user") - $totalct;
-$themecount[$defaulttheme] += $defaultusers;
-
-$text = "
-<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>
-<select name='sitetheme' class='tbox'>";
-$counter = 0;
-
-while($themelist[$counter]){
-        $text .= "<option value='".$themelist[$counter]."' ";
-        if(($themelist[$counter] == USERTHEME) || (USERTHEME == FALSE && $themelist[$counter] == $defaulttheme)){
-                $text .= "selected";
-        }
-        $text .= ">".($themelist[$counter] == $defaulttheme ? "[ ".$themelist[$counter]." ]" : $themelist[$counter])." (users: ".$themecount[$themelist[$counter]].")</option>\n";
-        $counter++;
-}
-$text .= "</select>
-<br /><br />
-<input class='button' type='submit' name='settheme' value='".LAN_350."' />
-</form>
-</div>";
-
-$ns -> tablerender(LAN_351, $text);
-}
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_plugins/usertheme_menu/usertheme_menu.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+if (USER == TRUE) {
+	 
+	$handle = opendir(e_THEME);
+	while ($file = readdir($handle)) {
+		if ($file != "." && $file != ".." && $file != "templates" && $file != "" && $file != "CVS") {
+			if (is_readable(e_THEME.$file."/theme.php") && is_readable(e_THEME.$file."/style.css")) {
+				$themelist[] = $file;
+				$themecount[$file] = 0;
+			}
+		}
+	}
+	closedir($handle);
+	 
+	 
+	$defaulttheme = $pref['sitetheme'];
+	$count = 0;
+	 
+	$totalct = $sql->db_Select("user", "user_prefs", "user_prefs REGEXP('sitetheme') ");
+	 
+	while ($row = $sql->db_Fetch()) {
+		$up = unserialize($row['user_prefs']);
+		if (isset($themecount[$up['sitetheme']])) { $themecount[$up['sitetheme']]++; }
+	}
+	 
+	$defaultusers = $sql->db_Count("user") - $totalct;
+	$themecount[$defaulttheme] += $defaultusers;
+	 
+	$text = "<form method='post' action='".e_SELF."'>
+		<div style='text-align:center'>
+		<select name='sitetheme' class='tbox' style='width: 95%;'>";
+	$counter = 0;
+	 
+	while (isset($themelist[$counter]) && $themelist[$counter]) {
+		$text .= "<option value='".$themelist[$counter]."' ";
+		if (($themelist[$counter] == USERTHEME) || (USERTHEME == FALSE && $themelist[$counter] == $defaulttheme)) {
+			$text .= "selected='selected'";
+		}
+		$text .= ">".($themelist[$counter] == $defaulttheme ? "[ ".$themelist[$counter]." ]" : $themelist[$counter])." (users: ".$themecount[$themelist[$counter]].")</option>\n";
+		$counter++;
+	}
+	$text .= "</select>
+		<br /><br />
+		<input class='button' type='submit' name='settheme' value='".LAN_350."' />
+		</div></form>";
+	 
+	$ns->tablerender(LAN_351, $text, 'usertheme');
+}
 ?>
\ No newline at end of file
Files 6171/e107_themes/clan/forum/fcap.png and 75/e107_themes/clan/forum/fcap.png differ
Files 6171/e107_themes/clan/forum/finfobar.png and 75/e107_themes/clan/forum/finfobar.png differ
Files 6171/e107_themes/clan/images/bar2edge.gif and 75/e107_themes/clan/images/bar2edge.gif differ
Files 6171/e107_themes/clan/images/bar2.gif and 75/e107_themes/clan/images/bar2.gif differ
Files 6171/e107_themes/clan/images/bar.jpg and 75/e107_themes/clan/images/bar.jpg differ
Files 6171/e107_themes/clan/images/bullet1.gif and 75/e107_themes/clan/images/bullet1.gif differ
Files 6171/e107_themes/clan/images/bullet2.gif and 75/e107_themes/clan/images/bullet2.gif differ
Files 6171/e107_themes/clan/images/cap2.png and 75/e107_themes/clan/images/cap2.png differ
Files 6171/e107_themes/clan/images/cap.png and 75/e107_themes/clan/images/cap.png differ
Files 6171/e107_themes/clan/images/header.png and 75/e107_themes/clan/images/header.png differ
Files 6171/e107_themes/clan/images/logo.png and 75/e107_themes/clan/images/logo.png differ
Files 6171/e107_themes/clan/images/menubg.png and 75/e107_themes/clan/images/menubg.png differ
Files 6171/e107_themes/clan/images/topbar.png and 75/e107_themes/clan/images/topbar.png differ
diff -ruN 6171/e107_themes/clan/style.css 75/e107_themes/clan/style.css
--- 6171/e107_themes/clan/style.css	2004-05-06 14:24:24.000000000 -0500
+++ 75/e107_themes/clan/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,238 +0,0 @@
-body {
-	color: #5D6E75;
-	font: 12px tahoma, verdana, arial, sans-serif;
-	background-color: #123134;
-	margin:0px;
-	text-align:left
-}
-a {
-	color: #6F8087; 
-	font-style: italic; 
-	font-family: verdana, arial, sans-serif; 
-	text-decoration: none;
-}
-a:hover {
-	color: #CD942C;
-	text-decoration: none;
-}
-.indent{
-	padding: 3px 3px 3px 3px;
-	margin: 5px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #000060;
-	border: 1px dotted;
-}
-.smalltext {
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-	font-size: 9px;
-	color:#5d6e75;
-}
-.smallblacktext {
-	font: 10px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#6F8087;
-}
-.defaulttext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-
-td {
-    font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#5D6E75;
-	padding: 0px, 0px, 0px, 0px;
-	text-align:left;
-}
-
-.mediumtext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#6F8087;
-}
-.captiontext {
-	font: 18px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#fff;
-}
-.tbox{
-	background-color: #666666;
-	border: #000 1px solid;
-	color: #32393C;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-.button{
-	background-color: #666666;
-	border: #000 1px solid;
-	color: #32393C;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-}
-
-.np{
-	background-color: #666666;
-	border: #000 1px solid;
-	color: #000000;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	padding: 2px;
-}
-
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding-bottom : 2px;
-	padding-left : 0px;
-	padding-right : 0px;
-	padding-top : 2px;
-}
-hr {
-	border-top: #3D3B3B 1px solid;
-	border-bottom: #666 1px solid;
-	height: 2px;
-	width: 92%;
-	text-align:center;
-}
-.border {
-	border: #3E3F3E 1px solid;
-}
-.caption {
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	border: #3E3F3E 1px solid;
-	background-color: #1E201E;
-	color: #CD942C;
-	font: 13px tahoma, arial, verdana, helvetica, sans-serif;
-	background-image : url(images/cap.png);
-}
-
-.caption2 {
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	border: #3E3F3E 1px solid;
-	background-color: #eaeef2;
-	color: #768A92;
-	font: 13px tahoma, arial, verdana, helvetica, sans-serif;
-	background-image : url(images/cap2.png);
-}
-
-.bodytable {
-	background-color: transparent;
-	padding: 8px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #5D6E75;
-
-}
-
-.bodytable2 {
-	background-color: transparent;
-	border: #fff 1px solid;
-	padding: 8px;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #404040;
-}
-
-p {
-	margin-top: 0px
-}
-.nextprev{
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	border: #3E3F3E 1px solid;
-	background-color: #eaeef2;
-	color: #768A92;
-	font: 13px tahoma, arial, verdana, helvetica, sans-serif;
-	background-image : url(images/cap2.png);
-	text-align: right;
-}
-
-.fborder {
-	border-bottom: #000000 1px solid;
-	border-left: #000000 1px solid;
-	border-right: #000000 1px solid;
-	border-top: #000000 1px solid;
-	background-color: #000;
-}
-.forumheader{
-	background-color: #092022;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#CD942C;
-	padding: 4px;
-}
-
-.forumheader2{
-	background-color: #092022;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#CD942C;
-	padding: 4px;
-}
-
-.forumheader3{
-	background-color: #092022;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	color:#CD942C;
-	padding: 4px;
-}
-
-.fcaption {
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 4px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(forum/fcap.png);
-	font-size: 12px;
-	color:#eee;
-}
-
-.topbar {
-	background-image : url(images/topbar.png);
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-}
-
-.helpbox {
-	border-bottom: transparent;
-	border-left: transparent;
-	border-right: transparent;
-	border-top: transparent;
-	background-color: transparent;
-	color:#CD942C;
-	font-family: tahoma, verdana, arial, helvetica, sans-serif;
-	font-size: 9px;
-}
-
-.menubg{
-	background-image : url(images/menubg.png);
-	background-repeat: repeat-y;
-}
-
-.menuend{
-	background-image : url(images/menuend.png);
-}
-
-.news{
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-}
-
-.forumlink{
-	color: #eee;
-	text-decoration: underline;
-}
-.searchhighlight{text-decoration: underline;color:#6FAAAE;font-weight:bold;}
\ No newline at end of file
diff -ruN 6171/e107_themes/clan/theme.php 75/e107_themes/clan/theme.php
--- 6171/e107_themes/clan/theme.php	2004-07-12 08:30:44.000000000 -0500
+++ 75/e107_themes/clan/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,249 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "clan1";
-$themeversion = "2.0";
-$themeauthor = "jalist";
-$themedate = "28/06/2003";
-$themeinfo = "";
-
-define("THEME_DISCLAIMER", "<br /><i>clan</i> theme by jalist");
-
-// [layout]
-
-$layout = "_default";
-
-$HEADER = "
-<div style='text-align:center'>
-<table style='width:848px' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='text-align:left; background-color: #123134; '>
-<img src='".THEME."images/logo.png' alt='bullet' />
-</td>
-<td style='text-align:right; background-color: #123134; '>
-{BANNER}
-</td>
-</tr>
-</table>
-<table style='width:848px' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='width:50%; text-align:left;' class='caption2'>
-{SITETAG}
-</td>
-<td style='width:50%; text-align:right;' class='caption2'>
-{CUSTOM=search}
-</td>
-</tr></table><br />
-<table style='width:848px; ' cellspacing='0' cellpadding='0'>
-<tr> <td style='width:174px; vertical-align: top;' class='menubg'>
-{SETSTYLE=leftmenu}
-{SITELINKS=menu}
-{MENU=1}
-</td><td style='500px; vertical-align: top;'>";
-
-$FOOTER = 
-"</td><td style='width:174px; vertical-align: top;' class='menubg'>
-{MENU=2}
-</td></tr>
-<tr>
-<td style='width:174px; vertical-align: top;' class='menuend'><img src='images/blank.gif' width='174' height='5' alt='' style='display: block;'/></td>
-<td style='500px; vertical-align: top;'></td>
-<td style='width:174px; vertical-align: top;' class='menuend'><img src='images/blank.gif' width='174' height='5' alt='' style='display: block;'/></td>
-</tr>
-</table>
-<table style='width:848px'>
-<tr>
-<td style='width:33%; vertical-align:top'>
-{MENU=3}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=4}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=5}
-</td>
-</tr>
-<tr>
-<td colspan='3' style='text-align:center'>
-{SITEDISCLAIMER}
-</td>
-</tr>
-</table></div>";
-
-$CUSTOMHEADER = "
-<div style='text-align:center'>
-<table style='width:848px' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='text-align:left; background-color: #123134; '>
-<img src='".THEME."images/logo.png' alt='bullet' />
-</td>
-<td style='text-align:right; background-color: #123134; '>
-{BANNER}
-</td>
-</tr>
-</table>
-<table style='width:848px' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='width:50%; text-align:left;' class='caption2'>
-{SITETAG}
-</td>
-<td style='width:50%; text-align:right;' class='caption2'>
-{CUSTOM=search}
-</td>
-</tr></table><br />
-<table style='width:848px; ' cellspacing='0' cellpadding='0'>
-<tr><td style='text-align:center'>";
-
-$CUSTOMFOOTER = "
-<td>
-</tr>
-</table>
-<table style='width:848px'>
-<tr>
-<td style='width:33%; vertical-align:top'>
-{MENU=3}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=4}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=5}
-</td>
-</tr>
-<tr>
-<td colspan='3' style='text-align:center'>
-{SITEDISCLAIMER}
-</td>
-</tr>
-</table></div>";
-
-$CUSTOMPAGES = "forum.php forum_viewforum.php forum_viewtopic.php forum_post.php";
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-<div style='text-align:center'>
-<table style='width:80%'>
-<tr>
-<td style='text-align:center'>
-{NEWSICON}
-</td></tr>
-<tr><td style='text-align:justify'>
-<b><i>{NEWSTITLE}</i></b> ...
-{NEWSBODY}
-<br />
-<div style='text-align:right' class='smalltext'>
-by  
-{NEWSAUTHOR}
-on
-{NEWSDATE}. 
-{NEWSCOMMENTS}
-{EXTENDED}
-</div>
-</td></tr></table>
-</div>
-<br /><br />";
-
-define("ICONSTYLE", "border:0");
-define("COMMENTLINK", "Comments: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-define("EXTENDEDSTRING", "Read more ...");
-
-
-// [linkstyle]
-
-define(PRELINK, "");
-define(POSTLINK, "");
-define(LINKSTART, "<img src='".THEME."images/bullet2.gif' alt='bullet' /> ");
-define(LINKEND, "<br />");
-//define(LINKDISPLAY, 2);			// 1 - along top, 2 - in left or right column
-define(LINKALIGN, "left");
-
-
-//	[tablestyle]
-function tablestyle($caption, $text, $mode=""){
-	if($mode == "default"){
-		if($caption != ""){
-			echo "<div class='border'><div class='caption'>".$caption."</div></div>\n";
-			if($text != ""){
-				echo "\n<div class='bodytable'>".$text."</div>\n";
-			}
-		}else{
-			echo "<div class='border'><div class='bodytable'>".$text."</div></div><br />\n";
-		}
-	}else{
-		if($caption != ""){
-			echo "<div class='border'><div class='caption2'>".$caption."</div></div>";
-			if($text != ""){
-				echo "<div class='bodytable2'>".$text."</div><br />\n";
-			}
-		}else{
-			echo "<div class='bodytable2'>".$text."</div><br />\n";
-		}
-	}
-}
-
-// [commentstyle]
-
-$COMMENTSTYLE = "
-<div style='text-align:center'>
-<table style='width:100%'>
-<tr>
-<td colspan='2' class='forumheader3'>
-{SUBJECT}
-<b>
-{USERNAME}
-</b>
- | 
- {TIMEDATE}
-</td>
-</tr>
-<tr>
-<td style='width:30%; vertical-align:top'>
-<div class='spacer'>
-{AVATAR}
-</div>
-<span class='smalltext'>
-{LEVEL}
-{COMMENTS}
-<br />
-{JOINED}
-<br />
-{REPLY}
-</span>
-</td>
-<td style='width:70%; vertical-align:top'>
-{COMMENT}
-</td>
-</tr>
-</table>
-</div>
-<br />";
-
-//	[chatboxstyle]
-
-$CHATBOXSTYLE = "
-<span class='smalltext'><img src='".THEME."images/bullet2.gif' alt='bullet' /> <b>
-{USERNAME}
-</b><br />
-{TIMEDATE}
-</span><br />
-<div class='mediumtext'>
-{MESSAGE}
-</div>
-";
-
-?>
\ No newline at end of file
Files 6171/e107_themes/comfort/forum/fcap2.png and 75/e107_themes/comfort/forum/fcap2.png differ
Files 6171/e107_themes/comfort/forum/fcap.png and 75/e107_themes/comfort/forum/fcap.png differ
Files 6171/e107_themes/comfort/forum/finfobar.png and 75/e107_themes/comfort/forum/finfobar.png differ
Files 6171/e107_themes/comfort/images/bar2edge.gif and 75/e107_themes/comfort/images/bar2edge.gif differ
Files 6171/e107_themes/comfort/images/bar2.gif and 75/e107_themes/comfort/images/bar2.gif differ
Files 6171/e107_themes/comfort/images/bar.jpg and 75/e107_themes/comfort/images/bar.jpg differ
Files 6171/e107_themes/comfort/images/bg.gif and 75/e107_themes/comfort/images/bg.gif differ
Files 6171/e107_themes/comfort/images/bullet1.gif and 75/e107_themes/comfort/images/bullet1.gif differ
Files 6171/e107_themes/comfort/images/bullet2.gif and 75/e107_themes/comfort/images/bullet2.gif differ
diff -ruN 6171/e107_themes/comfort/style.css 75/e107_themes/comfort/style.css
--- 6171/e107_themes/comfort/style.css	2004-08-17 03:41:04.000000000 -0500
+++ 75/e107_themes/comfort/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,296 +0,0 @@
-
-a {
-	color: #000040;
-	text-decoration: underline;
-}
-a:hover {
-	color: #ff0000;
-	text-decoration: underline;
-}
-
-body {
-	margin-left: 100px;
-	margin-right: 100px;
-	background-color: #999999;
-	scrollbar-face-color: #354463;
-	scrollbar-highlight-color: #758393; 
-	scrollbar-3dlight-color: #9DA8B3; 
-	scrollbar-darkshadow-color: #101842; 
-	scrollbar-shadow-color: #253d47; 
-	scrollbar-arrow-color: #deb500;
-	scrollbar-track-color: #b5b5b5; 
-	font-family: verdana, arial, "ms sans serif", sans-serif;  
-	font-size: 11px;  
-	color: #101842;
-}
-.indent{
-	padding-bottom: 3px;
-	padding-left: 10px;
-	padding-right: 10px;
-	padding-top: 3px;
-	font-family: verdana, tahoma, arial, sans-serif;
-	color: #000040;
-	font-size: 11px;
-}
-
-.smalltext {
-    font: normal 10px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#000;
-}
-
-.smallwhitetext {
-    font: normal 10px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#fff;
-}
-
-.smallblacktext {
-	font: normal 10px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#000;
-}
-
-td {
-	font-family: verdana, arial, "ms sans serif", sans-serif;  
-	font-size: 11px;  
-	color: #101842;
-	font-style: normal;
-	text-align:left;
-}
-	
-td.alpha {
-	background-color: #253047; 
-	vertical-align: top; 
-	width: 3;
-}
-
-td.beta {
-	vertical-align: top;
-	background-color: #CCCCCC;
-}
-
-.mediumtext {
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	font-style: normal;
-	color:#000;
-}
-.captiontext {
-    background: none;
-	letter-spacing: 0.4em; 
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 18px;
-	color:#000;
-}
-
-.captiontextorange {
-    background: none;
-	letter-spacing: 0.4em; 
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 18px;
-	color:#DEB500;
-}
-
-.normalorange {
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	color:#DEB500;
-}
-
-.tbox{
-	background-color: #ececec;
-	border-bottom: #5e5d63 1px solid;
-	border-left: #5e5d63 1px solid;
-	border-right: #5e5d63 1px solid;
-	border-top: #5e5d63 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-}
-.button{
-	background-color: #ececec;
-	border-bottom: #000 1px solid;
-	border-left: #fff 1px solid;
-	border-right: #000 1px solid;
-	border-top: #fff 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 9px;
-	text-align:center;
-}
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding-bottom : 2px;
-	padding-left : 0px;
-	padding-right : 2px;
-	padding-top : 2px;
-}
-hr {
-	border-top: #666 1px solid;
-	border-bottom: #eee 1px solid;
-	height: 2px;
-	width: 92%;
-	text-align:center;
-}
-.border {
-	border: #000 1px solid;
-}
-
-.border2 {
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-}
-.caption {
-	padding-bottom: 1px;
-	padding-left: 2px;
-	padding-right: 2px;
-	padding-top: 1px;
-	background-color: #758393;
-	color: #000;
-	font-family: verdana, helvetica, sans-serif;
-	font-size: 11px;
-}
-.caption2 {
-	padding-bottom: 1px;
-	padding-left: 2px;
-	padding-right: 2px;
-	padding-top: 1px;
-	background-color: #101842;
-	color: #fff;
-	font-family: verdana, helvetica, sans-serif;
-	font-size: 11px;
-}
-
-.bodytable2 {
-	background-color: #9DA8B3;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color:#101842;
-}
-
-.bodytable3 {
-	background-color: #9DA8B3;
-	padding: 0px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color:#101842;
-}
-
-.bodytable {
-	background-color: #B5B5B5;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color:#101842;
-}
-
-p {
-	margin-top: 0px
-}
-
-
-.fborder, .fbdefault{
-	border: #000000 1px solid;
-	background-color: #ccc;
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	background-image : url(forum/fcap2.png);
-	border: #5D6D7B 1px solid;
-}
-
-.forumheader2, .f2default{
-	background-color: #9DA8B3;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #5D6D7B 1px solid;
-}
-
-.forumheader3, .f3default{
-	background-color: #9DA8B3;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #5D6D7B 1px solid;
-}
-
-.fcaption, .fcdefault {
-	border: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(forum/fcap.png);
-	color:#fff;
-}
-
-.fcaption2{
-	border: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(forum/fcap.png);
-	color:#fff;
-}
-
-
-.finfobar{
-	background-color: #CCC8C8;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-	background-image : url(forum/finfobar.png);
-}
-
-.mainwindow{
-	border: 1px solid #000;
-	background-color: #101842;
-}
-
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
-
-.nextprev{
-	background-color: #B5B5B5;
-	border: 1px solid #758393;
-	color: #101842;
-	font: normal 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	padding : 2px, 2px, 2px, 2px;
-}
-
-.helpbox {
-	border: transparent;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
-
-.linktext {
-	font: normal 12px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-.searchhighlight{text-decoration: underline;color:#FFFFFF;font-weight:bold;background-color:#758393;}
\ No newline at end of file
diff -ruN 6171/e107_themes/comfort/theme.php 75/e107_themes/comfort/theme.php
--- 6171/e107_themes/comfort/theme.php	2004-08-17 03:41:06.000000000 -0500
+++ 75/e107_themes/comfort/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,155 +0,0 @@
-<?php
-/*
-+--------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-| $Id: theme.php,v 1.3 2004/08/17 08:41:05 loloirie Exp $
-+---------------------------------------------------------------+
-*/
-
-// [theme]	#############
-
-$themename = "comfort";
-$themeversion = "1.0";
-$themeauthor = "jalist";
-$themedate = "27/04/2003";
-$themeinfo = "compatible with e107 v5+";
-
-define("THEME_DISCLAIMER", "<br />comfort theme by jalist, designed By <a class=\"forumlink\" href=\"http://www28.brinkster.com/nix1\">Point Click Kill Industries</a> for <a class=\"forumlink\" href=\"http://www.oswd.org/\">OSWD.org</a>");
-
-// [layout]	#############
-$layout = "_default";
-$HEADER = 
-"
-<div style=\"text-align:center\" id=\"top\">
-<table style=\"width:100%\" cellspacing=\"1\" cellpadding=\"3\" class=\"mainwindow\"><tr><td colspan=\"3\" style=\"text-align:left\">
-<span class=\"captiontextorange\"> &gt; </span>
-<span class=\"captiontext\">
-{SITENAME}
-</span>
-<span class=\"captiontextorange\"> :.</span>
-</td>
-</tr>
-<tr style=\"background-color:#354463\">
-<td colspan=\"3\" style=\"text-align:left\" class=\"normalorange\"> <b>".
-strftime("%A, %d %B, %Y .:. %H:%M:%S %Z", time())."
-</b>
-</td></tr>
-<tr>
-<td class='alpha'>&nbsp;</td>
-<td class='beta'> 
-<table width='100%' border='0' cellspacing='2' cellpadding='3'>
-<tr>
-<td style='width:30%; vertical-align:top'>
-{SITELINKS=menu}
-{SETSTYLE=menu1}
-{MENU=1}
-</td>
-<td style='width:70%; vertical-align: top;'>
-";
-
-$sql -> db_Select("links", "*", "link_category='1' ORDER BY link_order ASC");
-while($row = $sql -> db_Fetch()){
-	extract($row);
-	$links .= " .:. <a class='forumlink' href='".e_BASE."$link_url'>$link_name</a>";
-}
-
-$FOOTER = 
-"
-</td>
-</tr>
-</table>
-</td>
-<td class='alpha'>&nbsp;</td>
-</tr>
-<tr style='background-color:#354463'>
-<td colspan='3' style='text-align:center' class='mediumtext'><a class='forumlink' href='#top'>^TOP</a> 
-$links
-</td>
-</tr>
-<tr style='background-color:#101842'>
-<td colspan='3' style='text-align:right' class='smallwhitetext'>
-{SITEDISCLAIMER}
-</td>
-</tr>
-</table>
-</div>
-";
-
-//	[newsstyle]
-
-
-$NEWSSTYLE = "
-<table style='width:100%' cellpadding='0' cellspacing='0'>
-<tr class='caption'>
-<td style='width:50%'>
-<b>
-{NEWSTITLE}
-</b>
-</td>
-<td style='width:50%; text-align:right' class='smallblacktext'>Posted {NEWSDATE}</td>
-</tr>
-<tr class='bodytable'>
-<td colspan='2' style='text-align:left'>
-{NEWSBODY}
-{EXTENDED}
-<div style='text-align:right'>
-{EMAILICON}
-{PRINTICON}
-{ADMINOPTIONS}
-</div>
-{NEWSCOMMENTS}
-</td>
-</tr>
-</table>
-<br />";
-
-define("ICONSTYLE", "float: left; border:0");
-define("COMMENTLINK", "Read/Post Comment: ");
-define("COMMENTOFFSTRING", "");
-
-define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
-define("EXTENDEDSTRING", "Read the rest ...");
-define("POST_EXTENDEDSTRING", " ]<br />");
-
-define("PRE_SOURCESTRING", "<br />");
-define("SOURCESTRING", "Source: ");
-define("POST_SOURCESTRING", "<br />");
-
-define("PRE_URLSTRING", "<br />");
-define("URLSTRING", "Link: ");
-define("POST_URLSTRING", "<br />");
-
-
-
-
-// [linkstyle]
-
-
-define("PRELINK", "\n\n<table cellpadding='2' cellspacing='1' style='background-color:#000000; width:100%'><tr><td class='caption2'>:: Navigation : </td></tr>\n");
-define("POSTLINK", "\n\n</table><br />\n\n");
-define("LINKSTART", "\n<tr style='background-color:#758393'> <td onmouseover=\"this.style.backgroundColor='#9DA8B3';\" onmouseout=\"this.style.backgroundColor='#758393'\"> <span class='linktext'>\n");
-define("LINKEND", "</span></td></tr>");
-define("LINKDISPLAY", 1);			// 1 - along top, 2 - in left or right column
-define("LINKALIGN", "left");
-define("LINKCLASS", "forumlink");
-
-
-
-//	[tablestyle]	#############
-
-function tablestyle($caption, $text, $mode=""){
-
-	if($mode = "menu"){
-		echo "<div class='border'><div class='caption'>$caption</div></div><div class='border2'><div class='bodytable2'>$text</div></div><br />";
-	}else{
-		echo "<div class='caption'>$caption</div><div class='bodytable'>$text</div><br />";
-	}
-}
-?>
\ No newline at end of file
Files 6171/e107_themes/crahan/images/bullet2.gif and 75/e107_themes/crahan/images/bullet2.gif differ
Files 6171/e107_themes/crahan/images/logo1.png and 75/e107_themes/crahan/images/logo1.png differ
Files 6171/e107_themes/crahan/images/logo2.png and 75/e107_themes/crahan/images/logo2.png differ
Files 6171/e107_themes/crahan/images/logo3.png and 75/e107_themes/crahan/images/logo3.png differ
Files 6171/e107_themes/crahan/images/logo4.png and 75/e107_themes/crahan/images/logo4.png differ
diff -ruN 6171/e107_themes/crahan/languages/English.php 75/e107_themes/crahan/languages/English.php
--- 6171/e107_themes/crahan/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/crahan/languages/English.php	2005-03-21 05:49:22.000000000 -0600
@@ -0,0 +1,28 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/crahan/languages/English.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/03/21 11:49:22 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "'CraHan' by <a href='http://e107.org' rel='external'>jalist</a>, based on the theme by CraHan at his homepage <a href='http://n00.be' rel='external'>n00.be</a>");
+define("LAN_THEME_2", "Comments are turned off for this item");
+define("LAN_THEME_3", "comment(s): ");
+define("LAN_THEME_4", "Read the rest ...");
+define("LAN_THEME_5", "Trackbacks: ");
+define("LAN_THEME_6", "Comment by");
+
+
+?>
Files 6171/e107_themes/crahan/preview.jpg and 75/e107_themes/crahan/preview.jpg differ
diff -ruN 6171/e107_themes/crahan/style.css 75/e107_themes/crahan/style.css
--- 6171/e107_themes/crahan/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/crahan/style.css	2006-04-12 13:33:50.000000000 -0500
@@ -0,0 +1,487 @@
+
+/* info: default stylesheet file for 'CraHan' theme */
+
+body {
+	background: #ccc;
+	color: #000;
+	font-family: verdana, arial, "lucida grande", sans-serif;
+	text-align: center;
+}
+
+#wrapper {
+	margin: 10px auto;
+	width: 700px;
+}
+
+#menu {
+	float: right;
+	width: 181px;
+	text-align: right;
+}
+
+.content {
+	border: #444 2px solid;
+	padding: 15px;
+	font-size: 11px;
+	background: #fff;
+	color: #000;
+	text-align: left;
+}
+
+.fixfuckedie {
+	width: 100%
+}
+
+#main {
+	width: 504px;
+	text-align: left;
+}
+
+#sitebanner {
+	border: #444 2px solid;
+	padding: 0px;
+	font-size: 11px;
+	background: #fff;
+	margin-bottom: 6px;
+	color: #000;
+	text-align: left;
+}
+#sitebanner img {
+	display: block;
+	border-bottom: #444 1px solid;
+}
+
+#navbar {
+	padding-right: 15px;
+	padding-left: 15px;
+	font-size: 11px;
+	padding-bottom: 7px;
+	padding-top: 7px;
+}
+
+#navbar a {
+	color: #000;
+	text-decoration: none;
+}
+#navbar a:active {
+	text-decoration: none;
+}
+#navbar a:visited {
+	text-decoration: none;
+}
+#navbar a:hover {
+	color: #000; text-decoration:
+	underline;
+}
+ul, ol {
+	margin-top: 0;
+	margin-bottom: 0;
+}
+
+#logo1 {
+	position: relative;
+	height: 90px;
+	width: 500px;
+	background-image: url('images/logo1.png');
+	background-repeat: no-repeat;
+}
+
+#logo2 {
+	position: relative;
+	height: 90px;
+	width: 500px;
+	background-image: url('images/logo2.png');
+	background-repeat: no-repeat;
+}
+
+#logo3 {
+	position: relative;
+	height: 90px;
+	width: 500px;
+	background-image: url('images/logo3.png');
+	background-repeat: no-repeat;
+}
+
+#logo4 {
+	position: relative;
+	height: 90px;
+	width: 500px;
+	background-image: url('images/logo4.png');
+	background-repeat: no-repeat;
+}
+
+.header {
+	padding-right: 0px;
+	padding-left: 0px;
+	font-weight: bold;
+	font-size: 11px;
+	padding-bottom: 3px;
+	margin: 0px 0px 10px;
+	color: #444;
+	padding-top: 0px;
+	border-bottom: #444 1px dashed;
+}
+
+
+h3 {
+	color: #444;
+	font-weight: bold;
+	margin-bottom: 2px;
+}
+
+.left {
+	float: left;
+	text-align: left;
+}
+.right {
+	text-align: right;
+	font-weight: normal;
+}
+
+.newssmalltext {
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+img {
+	vertical-align: middle;
+}
+
+
+
+
+
+hr {
+	border: 1px dotted #bbb;
+	height: 1px;
+	width: 92%;
+	text-align:center;
+}
+
+.smalltext {
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.bodytable {
+	padding: 2px;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #444;
+}
+
+.button {	
+	border: #000 1px solid;
+	color: #000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	background-image : url(images/button.png);
+}
+
+.button a {
+	color: #000;
+}
+.button a:hover {
+	color: #0085b0;
+}
+
+
+a {
+	color: #416eab;
+	text-decoration: none;
+}
+a:active {
+	text-decoration: none;
+}
+a:visited {
+	text-decoration: none;
+}
+a:hover {
+	color: #416eab;
+	text-decoration: underline;
+}
+
+.smallblacktext {
+    background: none;
+	font: 10px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#000;
+}
+.indent{
+	padding: 10px 10px 10px 10px;
+	margin: 5px;
+	font: 9px verdana, tahoma, arial, sans-serif;
+	color: #838387;
+	border: 1px solid #d6d6d6;
+}
+.defaulttext {
+    background: none;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+
+td {
+	font: 11px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#5d6e75;
+	padding: 0px;
+	text-align:left;
+}
+
+blockquote {
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	color:#7e96ac;
+	border: 1px solid #d6d6d6;
+}
+.mediumtext {
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+
+.tbox{
+	background-color: #F4F7FA;
+	border: #5e5d63 1px solid;
+	color: #000000;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.tbox.chatbox {
+	width: 80%;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.nextprev{
+	background-color: #eaeef2;
+	border: #000 1px solid;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	padding : 2px;
+	text-align: right;
+}
+
+form {
+	margin: 2px 0px 0px 0px;
+}
+.spacer {
+	padding: 2px 0 2px 0;
+}
+
+.cspacer {
+	padding: 6px 0 6px 0;
+	margin-left: auto;
+	margin-right: auto;
+	text-align: center;
+}
+
+.border {
+	border: #999 1px solid;
+	background-color: #F0F1F1;
+	padding: 2px;
+}
+
+
+p {
+	margin-top: 0px
+}
+
+.fborder {
+	border: #c1c1c1 1px solid;
+}
+.forumheader{
+	background-color: #f3f3f7;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	background-image : url('../e107_images/forum/fcap2.png');
+	border: 1px solid #ececf2;
+}
+
+.forumheader2{
+	background-color: #EFEFEF;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+}
+
+.forumheader3{
+	background-color: #f3f3f7;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #ececf2 1px solid;
+}
+
+.forumborder{
+	border: #000080 1px solid;
+}
+
+.fcaption {
+	border: #f0f2f4 1px solid;
+	padding: 2px 0 2px 0;
+	background-color: #f9fafb;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#616060;
+}
+
+.finfobar{
+	background-color: #CCC8C8;
+	color:#000;
+	padding: 4px;
+	border: 1px solid #C3BDBD;
+	background-image : url('../e107_images/forum/finfobar.png');font-style:normal; font-variant:normal; font-weight:normal; font-size:11px; font-family:verdana, tahoma, arial, helvetica, sans-serif
+}
+
+.helpbox {
+	color:#000;
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	border: 0px none red;
+	background-color: transparent;
+}
+
+.nforumholder {
+	border: 1px solid #345487;
+	padding: 0px;
+	background-color: #fff;
+}
+
+.nforumcaption {
+	background-image: url(images/nforumcaption.png);
+	padding: 8px 4px 8px 4px;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #fff;
+}
+
+.nforumcaption2 {
+	background-image: url(images/nforumcaption2.png);
+	padding: 8px 0px 8px 4px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+	font-weight: bold;
+}
+
+.nforumcaption3 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #EEF2F7;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #D1DCEB;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreplycaption {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E2EDF2;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #EDF4F7;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #CFE0EB;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+.nforumdisclaimer {
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.nforumview1 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #DFE6EF;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview3 {
+	padding: 4px;
+	background-color: #BCD0ED;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #263448;
+}
+
+.nforumview4 {
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #3A4F6C;
+}
+
+a.forumlink{
+	color: #fff;
+	text-decoration: none;
+}
+
+a.forumlink:hover {
+	color: #bbb;
+	text-decoration: underline;
+}
+
+.treeclass1 {
+	background-color: #F4F7FA;
+	border: #5e5d63 1px solid;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	padding: 2px -2px 2px 2px;
+}
+
+.treeclass2 {
+	background-color: #F4F7FA;
+	border: #000 1px solid;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	padding: 2px -2px 2px 2px;
+}
+
+.treeclass3 {
+	background-color: #F4F7FA;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	padding: 1px;
+	width: 100%;
+}
+
+
+#marqueecontainer{
+	position: relative;
+	height: 200px;
+	overflow: hidden;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/crahan/theme.php 75/e107_themes/crahan/theme.php
--- 6171/e107_themes/crahan/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/crahan/theme.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,134 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/crahan/theme.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+@include_once(e_THEME."crahan/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."crahan/languages/English.php");
+
+// [theme]
+$themename = "CraHan";
+$themeversion = "1.0";
+$themeauthor = "Steve Dunstan [jalist]";
+$themeemail = "jalist@e107.org";
+$themewebsite = "http://e107.org";
+$themedate = "29/01/2005";
+$themeinfo = "Based on the theme by CraHan at his homepage <a href='http://n00.be' rel='external'>n00.be</a>, design used with permission.";
+define("STANDARDS_MODE", TRUE);
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+define("IMODE", "lite");
+define("THEME_DISCLAIMER", "<br /><i>".LAN_THEME_1."</i>");
+
+$logo = "logo".rand(1, 4);
+
+// [layout]
+
+$layout = "_default";
+
+$HEADER = "
+<div id='wrapper'>
+<div id='menu'>
+<div class='content'>
+<div class='fixfuckedie'>
+{MENU=1}
+</div>
+</div>
+</div>
+<div id='main'>
+<div id='sitebanner'>
+<div id='{$logo}'><div class='smalltext' style='text-align: right; vertical-align: bottom;'>{SITENAME}&nbsp;</div></div>
+<div id='navbar'>
+{SITELINKS}
+</div>
+</div>
+<div class='content'>
+<div class='fixfuckedie'>
+";
+
+$FOOTER = "
+</div>
+</div>
+<br />
+<br />
+<div class='smalltext' style='text-align: center;'>{SITEDISCLAIMER}</div>
+</div>
+</div>
+";
+
+$NEWSSTYLE = "
+<div class='header'>
+<div class='left'>{STICKY_ICON} {NEWSTITLE}</div>
+<div class='right'>{NEWSDATE}</div>
+</div>
+<div class='bodytable' style='text-align:left'>
+{NEWSBODY}
+{EXTENDED}
+</div>
+<br />
+<div class='newssmalltext'>[ {NEWSAUTHOR} :: {NEWSCOMMENTS}{TRACKBACK} ]</div>
+<br />
+<br />";
+
+define("ICONSTYLE", "float: left; border:0");
+define("COMMENTLINK", LAN_THEME_3);
+define("COMMENTOFFSTRING", LAN_THEME_2);
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", LAN_THEME_4);
+define("POST_EXTENDEDSTRING", " ]<br />");
+define("TRACKBACKSTRING", LAN_THEME_5);
+define("TRACKBACKBEFORESTRING", " :: ");
+
+
+// [linkstyle]
+
+define('PRELINK', "");
+define('POSTLINK', " ::");
+define('LINKSTART', ":: ");
+define('LINKSTART_HILITE', ":: ");
+define('LINKEND', "");
+define('LINKDISPLAY', 1);
+define('LINKALIGN', "left");
+
+
+//	[tablestyle]
+
+function tablestyle($caption, $text, $mode)
+{
+	echo "<div class='header'>{$caption}</div>\n{$text}\n<br /><br />\n";
+}
+
+$COMMENTSTYLE = "
+<div style='padding-left: 25px;'>{COMMENT} {COMMENTEDIT}<br /><br />
+<div class='newssmalltext'>[ ".LAN_THEME_6." {USERNAME} :: {TIMEDATE} ]</div>
+</div>
+<br /><br />
+";
+
+
+$CHATBOXSTYLE = "
+<img src='".e_IMAGE_ABS."admin_images/chatbox_16.png' alt='' style='vertical-align: middle;' />
+<b>{USERNAME}</b>
+<div class='smalltext'>
+{MESSAGE}
+</div>
+<br />";
+
+?>
\ No newline at end of file
Files 6171/e107_themes/e107/images/bar2edge.gif and 75/e107_themes/e107/images/bar2edge.gif differ
Files 6171/e107_themes/e107/images/bar2.gif and 75/e107_themes/e107/images/bar2.gif differ
Files 6171/e107_themes/e107/images/bar.jpg and 75/e107_themes/e107/images/bar.jpg differ
Files 6171/e107_themes/e107/images/bullet1.gif and 75/e107_themes/e107/images/bullet1.gif differ
Files 6171/e107_themes/e107/images/bullet2.gif and 75/e107_themes/e107/images/bullet2.gif differ
Files 6171/e107_themes/e107/images/button.png and 75/e107_themes/e107/images/button.png differ
Files 6171/e107_themes/e107/images/cap.png and 75/e107_themes/e107/images/cap.png differ
Files 6171/e107_themes/e107/images/header.png and 75/e107_themes/e107/images/header.png differ
Files 6171/e107_themes/e107/images/installlogo.png and 75/e107_themes/e107/images/installlogo.png differ
Files 6171/e107_themes/e107/images/logo.png and 75/e107_themes/e107/images/logo.png differ
diff -ruN 6171/e107_themes/e107/style.css 75/e107_themes/e107/style.css
--- 6171/e107_themes/e107/style.css	2004-03-03 12:23:56.000000000 -0600
+++ 75/e107_themes/e107/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,197 +0,0 @@
-body {
-	color: #000;
-	font: 12px tahoma, verdana, arial, sans-serif;
-	background-color: #fff;
-	margin:0px;
-	text-align:left
-}
-a {
-	color: #716d6d; 
-	font-style: italic; 
-	font: verdana, arial, sans-serif; 
-	text-decoration: none;
-}
-a:hover {
-	color: #2a3236;
-	text-decoration: none;
-}
-.indent{
-	padding: 3px;
-	margin: 5px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #000060;
-	background-color: #EAEEF2;
-	border: 1px dotted;
-}
-.smalltext {
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#5d6e75;
-}
-.smallblacktext {
-	font: 10px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#000;
-}
-.defaulttext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-td {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#5d6e75;
-	padding: 0px;
-	text-align:left;
-}
-.mediumtext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-.captiontext {
-	font: 18px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-.tbox{
-	background-color: #eaeef2;
-	border: #5e5d63 1px solid;
-	color: #000000;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-.button{
-	border: 1px solid #5E5D63;
-	color: #000000;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	background-image : url(images/button.png);
-}
-
-.nextprev{
-	background-color: #eaeef2;
-	border: #000 1px solid;
-	color: #000;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	padding: 2px;
-	background-image : url(images/button.png);
-}
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding: 2px 0px 2px 0px;
-}
-hr {
-	border-top: #666 1px solid;
-	border-bottom: #eee 1px solid;
-	height: 2px;
-	width: 92%;
-	text-align:center;
-}
-.border {
-	border: #938d8d 1px solid;
-}
-.caption {
-	padding: 0px 4px 0px 4px;
-	border-bottom: #ccc 1px solid;
-	border-left: #fff 1px solid;
-	border-right: #ccc 1px solid;
-	border-top: #fff 1px solid;
-	background-color: #e2e2e2;
-	color: #000;
-	font: 13px tahoma, arial, verdana, helvetica, sans-serif;
-}
-.caption2 {
-	padding: 0px 4px 0px 4px;
-	border-bottom: #9cb3c8 1px solid;
-	border-left: #fff 1px solid;
-	border-right: #9cb3c8 1px solid;
-	border-top: #fff 1px solid;
-	background-color: #eaeef2;
-	color: #000;
-	font: 13px tahoma, arial, verdana, helvetica, sans-serif;
-}
-.bodytable {
-	padding: 8px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-.bodytable2 {
-	border: #fff 1px solid;
-	padding: 8px;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #404040;
-}
-p {
-	margin-top: 0px
-}
-.fborder {
-	border: #000000 1px solid;
-	background-color: #fff;
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	background-image : url(../../e107_images/forum/fcap2.png);
-	border: #C3BDBD 1px solid;
-}
-.forumheader2{
-	background-color: #EFEFEF;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader3{
-	background-color: #E3E1E1;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.fcaption {
-	border: #000 1px solid;
-	padding: 2px 0px 2px 8px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(../../e107_images/forum/fcap.png);
-	color:#fff;
-}
-
-.helpbox {
-	border: 0px none red;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
-
-.installb{
-	background-color: #ececec;
-	padding: 2px 0px 2px 8px;
-	text-align:center;
-}
-
-.installh{
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #363C3E;
-}
-
-.installe{
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #C00000;
-}
-
-.finfobar{
-	background-color: #CCC8C8;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-	background-image : url(../../e107_images/forum/finfobar.png);
-}
-
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
\ No newline at end of file
diff -ruN 6171/e107_themes/e107/theme.php 75/e107_themes/e107/theme.php
--- 6171/e107_themes/e107/theme.php	2004-04-25 23:37:38.000000000 -0500
+++ 75/e107_themes/e107/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,268 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	e107 theme file
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "e107";
-$themeversion = "5.0";
-$themeauthor = "jalist";
-$themedate = "26/08/02";
-$themeinfo = "compatible with e107 v5+";
-
-// [layout]
-
-$layout = "_default";
-$admin_logo = "1";
-
-$HEADER = "
-<div style='text-align:center'>
-<table style='width:100%' cellspacing='3'><tr><td colspan='3' style='text-align:left'>
-{LOGO}
-<br />
-{SITETAG}
-</td></tr><tr> <td style='width:15%; vertical-align: top;'>
-{SETSTYLE=leftmenu}
-{SITELINKS=menu}
-{MENU=1}
-</td><td style='width:70%; vertical-align: top;'>
-";
-
-$NEWSHEADER = "
-<div style='text-align:center'>
-<table style='width:100%' cellspacing='3'><tr><td colspan='3' style='text-align:left'>
-{LOGO}
-<br />
-{SITETAG}
-</td></tr><tr> <td style='width:15%; vertical-align: top;'>
-{SETSTYLE=leftmenu}
-{SITELINKS=menu}
-{MENU=1}
-</td><td style='width:70%; vertical-align: top;'>
-<div style='text-align:center'>
-<table style='width:95%'>
-<tr>
-<td style='width:50%; vertical-align:top'>
-{NEWS_CATEGORY=1}
-</td>
-<td style='width:50%; vertical-align:top'>
-{NEWS_CATEGORY=2}
-</td>
-</tr>
-<tr>
-<td colspan='2'>
-<hr />
-<table style='width:100%'>
-<tr>
-<td style='width:33%; vertical-align:top'>
-{MENU=6}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=7}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=8}
-</td>
-</tr>
-</table>
-<hr />
-</td>
-</tr>
-
-<tr>
-<td style='width:50%; vertical-align:top'>
-{NEWS_CATEGORY=3}
-</td>
-<td style='width:50%; vertical-align:top'>
-{NEWS_CATEGORY=4}
-</td>
-</tr>
-
-
-</table>
-</div>
-";
-
-
-
-$FOOTER = <<<EOT
-</td><td style='width:15%; vertical-align:top'>
-{MENU=2}
-</td></tr>
-<tr>
-<td colspan='3' style='text-align:center'>
-{SITEDISCLAIMER}
-</td>
-</tr>
-</table>
-<table style='width:60%'>
-<tr>
-<td style='width:33%; vertical-align:top'>
-{MENU=3}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=4}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=5}
-</td>
-</tr>
-</table></div>
-EOT;
-
-
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-<div class='border'>
-	<div class='caption'>
-		{NEWSTITLE}
-	</div>
-</div>
-<div class='bodytable'>
-{NEWSICON}
-	<div style='text-align:justify'>
-		{NEWSBODY}
-		<br />
-	</div>
-	<div style='text-align:center'>
-		<hr />Category: 
-		{NEWSCATEGORY}
-		Posted by: 
-		{NEWSAUTHOR}
-		on
-		{NEWSDATE}
-		<br />
-		{NEWSCOMMENTS}
-		{EMAILICON}
-		{PRINTICON}
-		{ADMINOPTIONS}
-		{EXTENDED}
-	</div>
-</div>";
-
-
-$NEWSLISTSTYLE = "
-{NEWSICON}
-<b>
-{NEWSTITLE}
-</b>
-<div class='smalltext'>
-{NEWSAUTHOR}
-on
-{NEWSDATE}
-{NEWSCOMMENTS}
-</div>
-<hr />
-";
-
-
-
-
-define("ICONSTYLE", "float: left; border:0");
-define("COMMENTLINK", "Comments: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-define("EXTENDEDSTRING", "Read more ...");
-
-
-// [linkstyle]
-
-define(PRELINK, "");
-define(POSTLINK, "");
-//define(LINKSTART, "<img src='".THEME."images/bullet2.gif' alt='bullet' /> ");
-define(LINKSTART, " ");
-define(LINKEND, "<br />");
-//define(LINKDISPLAY, 2);			// 1 - along top, 2 - in left or right column
-define(LINKALIGN, "left");
-
-
-//	[tablestyle]
-function tablestyle($caption, $text, $mode=""){
-//	echo "Style: ".$style.", Mode: ".$mode;
-	if($mode == "mode2"){
-		if($caption != ""){
-			echo "<div class='border'><div class='caption'>".$caption."</div></div>\n";
-			if($text != ""){
-				echo "\n<div class='bodytable'>".$text."</div>\n";
-			}
-		}else{
-			echo "<div class='border'><div class='bodytable'>".$text."</div></div><br />\n";
-		}
-	}else{
-		if($caption != ""){
-			echo "<div class='border'><div class='caption2'>".$caption."</div></div>";
-			if($text != ""){
-				echo "<div class='bodytable2'>".$text."</div><br />\n";
-			}
-		}else{
-			echo "<div class='bodytable2'>".$text."</div><br />\n";
-		}
-	}
-}
-
-// [commentstyle]
-
-
-$COMMENTSTYLE = "
-<div style='text-align:center'>
-<table style='width:100%'>
-<tr>
-<td colspan='2' class='forumheader3'>
-{SUBJECT}
-<b>
-{USERNAME}
-</b>
- | 
- {TIMEDATE}
-</td>
-</tr>
-<tr>
-<td style='width:30%; vertical-align:top'>
-<div class='spacer'>
-{AVATAR}
-</div>
-<span class='smalltext'>
-{LEVEL}
-{COMMENTS}
-<br />
-{JOINED}
-<br />
-{REPLY}
-</span>
-</td>
-<td style='width:70%; vertical-align:top'>
-{COMMENT}
-</td>
-</tr>
-</table>
-</div>
-<br />";
-
-
-//	[chatboxstyle]
-
-$CHATBOXSTYLE = "
-<div class='indent'>
-<span class='smalltext'>...: <b>
-{USERNAME}
-</b> :...<br />
-{TIMEDATE}
-</span><br />
-<div class='mediumtext' style='text-align:right'>
-{MESSAGE}
-</div>
-</div>";
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_themes/e107v4a/forum_design.php 75/e107_themes/e107v4a/forum_design.php
--- 6171/e107_themes/e107v4a/forum_design.php	2004-08-08 10:15:20.000000000 -0500
+++ 75/e107_themes/e107v4a/forum_design.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,198 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /forum_design file
-|
-|        e107 Core Team 2004
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-$FORUMSTART = "
-<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
-<tr>
-<td  colspan='2' class='nforumcaption'>{BACKLINK}</td>
-</tr>
-<tr>
-<td class='nforumcaption2' colspan='2'>
-<table cellspacing='0' cellpadding='0' style='width:100%'>
-<tr>
-<td>{NEXTPREV}</td>
-<td style='text-align:right'>&nbsp;{TRACK}&nbsp;</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<br />
-
-<table style='width:100%'>
-<tr>
-<td style='width:80%'><div class='mediumtext'><img src='".e_IMAGE."forum/e.png' alt='' style='vertical-align:middle' /> <b>{THREADNAME}</b></div><br />{GOTOPAGES}</td>
-<td style='width:20%; vertical-align:bottom;'>{BUTTONS}</td>
-</tr>
-</table>
-
-
-<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
-<tr>
-<td style='width:20%; text-align:center' class='nforumcaption2'>\n".LAN_402."\n</td>\n<td style='width:80%; text-align:center' class='nforumcaption2'>\n".LAN_403."\n</td>
-</tr>
-</table>";
-
-$FORUMTHREADSTYLE = "
-<div class='spacer'>
-<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
-<tr>
-<td class='nforumcaption3' style='vertical-align:middle; width:20%;'>\n{NEWFLAG}\n{POSTER}\n</td>
-<td class='nforumcaption3' style='vertical-align:middle; width:80%;'>
-<table cellspacing='0' cellpadding='0' style='width:100%'>
-<tr>
-<td class='smallblacktext'>\n{THREADDATESTAMP}\n</td>
-<td style='text-align:right'>\n{REPORTIMG}{EDITIMG}{QUOTEIMG}\n</td>
-</tr>
-</table>
-</td>
-</tr>
-<tr>
-<td class='nforumthread' style='vertical-align:top'>\n{AVATAR}\n<span class='smalltext'>\n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{LOCATION}\n{POSTS}\n</span>\n</td>
-<td class='nforumthread' style='vertical-align:top'>\n{POST}\n{SIGNATURE}\n</td>
-</tr>
-<tr>
-<td class='nforumthread2'>\n<span class='smallblacktext'>\n{TOP}\n</span>\n</td>
-<td class='nforumthread2' style='vertical-align:top'>
-<table cellspacing='0' cellpadding='0' style='width:100%'>
-<tr>
-<td>\n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n</td>
-<td style='text-align:right'>\n{MODOPTIONS}\n</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-</div>";
-
-$FORUMEND = "
-<div class='spacer'>
-<div class='forumheader'>
-{GOTOPAGES}
-</div>
-<br />
-<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
-<tr>
-<td style='width:50%; text-align:left; vertical-align:top' class='nforumthread'><b>{MODERATORS}</b><br />{FORUMJUMP}</td>
-<td style='width:50%; text-align:right; vertical-align:top' class='nforumthread'>{BUTTONS}</td>
-</tr>
-</table>
-</div>
-<div class='spacer'>
-<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
-<tr>
-<td style='text-align:center' class='nforumthread2'>
-{QUICKREPLY}
-</td>
-</tr>
-</table>
-<div class='nforumdisclaimer' style='text-align:center'>Forum theme loosely based on <a href='http://www.invisionpower.com/'>Invision Power Board</a></div>
-</div>";
-
-
-$FORUM_MAIN_START = "<div style='text-align:center'>";
-
-$FORUM_MAIN_PARENT = "<div class='spacer'>\n<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>\n<tr>\n<td colspan='5' class='nforumcaption'>{PARENTNAME} {PARENTSTATUS}</td>\n</tr>
-<tr>\n<td colspan='2' style='width:60%; text-align:center' class='nforumcaption2'>{FORUMTITLE}</td>\n<td style='width:10%; text-align:center' class='nforumcaption2'>{THREADTITLE}</td>\n<td style='width:10%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>\n<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>\n</tr>\n";
-
-$FORUM_MAIN_PARENT_END = "</table></div>";
-
-$FORUM_MAIN_FORUM = "<tr>\n<td style='width:5%; text-align:center' class='nforumcaption3'>{NEWFLAG}</td>\n<td style='width:55%' class='nforumcaption3'>{FORUMNAME}<br /><span class='smallblacktext'>{FORUMDESCRIPTION}</span></td>\n<td style='width:10%; text-align:center' class='nforumthread'>{THREADS}</td>\n<td style='width:10%; text-align:center' class='nforumthread'>{REPLIES}</td>\n<td style='width:20%; text-align:center' class='nforumthread'><span class='smallblacktext'>{LASTPOST}</span></td>\n</tr>";
-
-$FORUM_MAIN_END = "<div class='spacer'>\n<table style='width:100%' class='fborder'>\n<tr>\n<td colspan='2' style='width:60%' class='nforumcaption2'>{INFOTITLE}</td>\n</tr>\n<tr>\n<td rowspan='4' style='width:5%; text-align:center' class='forumheader3'>{LOGO}</td>\n<td style='width:100%' class='forumheader3'>{USERINFO}</td>\n</tr>\n<tr>\n<td style='width:auto' class='forumheader3'>{INFO}</td>\n</tr>\n<tr>\n<td style='width:100%' class='forumheader3'>{FORUMINFO}</td>\n</tr>\n<tr>\n<td style='width:100%' class='forumheader3'>{USERLIST}</td>\n</tr>\n</table>\n</div>\n<div class='spacer'>\n<table class='fborder' style='width:100%'>\n<tr>\n<td class='forumheader3' style='text-align:center; width:33%'>{ICONKEY}</td>\n<td style='text-align:center; width:33%' class='forumheader3'>{SEARCH}</td>\n<td style='width:33%; text-align:center; vertical-align:middle' class='forumheader3'><span class='smallblacktext'>{PERMS}</span>\n</td>\n</tr>\n</table>\n</div>\n<div class='nforumdisclaimer' style='text-align:center'>Forum theme loosely based on <a href='http://www.invisionpower.com/'>Invision Power Board</a></div></div>";
-
-
-
-$FORUM_VIEW_START = "
-<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
-<tr>
-<td  colspan='2' class='nforumcaption'>{BREADCRUMB}</td>
-</tr>
-</table>
-
-<table style='width:100%'><tr>
-<td style='width:80%'><div class='mediumtext'><img src='".e_IMAGE."forum/e.png' style='vertical-align:middle' alt='' /> <b>{FORUMTITLE} Forum</b></div>{THREADPAGES}</td>
-<td style='width:20%; text-align:right; vertical-align:bottom;'>
-{NEWTHREADBUTTON}
-</td>
-</tr>
-</table>
-
-<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
-<tr>
-<td style='width:3%' class='nforumcaption2'>&nbsp;</td>
-<td style='width:47%' class='nforumcaption2'>{THREADTITLE}</td>
-<td style='width:20%; text-align:center' class='nforumcaption2'>{STARTERTITLE}</td>
-<td style='width:5%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>
-<td style='width:5%; text-align:center' class='nforumcaption2'>{VIEWTITLE}</td>
-<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>
-</tr>";
-
-
-
-$FORUM_VIEW_FORUM = "
-<tr>
-<td style='vertical-align:middle; text-align:center; width:3%' class='nforumview1'>{ICON}</td>
-<td style='vertical-align:middle; text-align:left; width:47%'  class='nforumview1'>
-
-<table style='width:100%'>
-<tr>
-<td style='width:90%'><span class='mediumtext'><b>{THREADNAME}</b></span> <span class='smalltext'>{PAGES}</span></td>
-<td style='width:10%; white-space:nowrap;'>{ADMIN_ICONS}</td>
-</tr>
-</table>
-</td>
-
-<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'><b>{POSTER}</b><br />{THREADDATE}</span></td>
-<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{REPLIES}</span></td>
-<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{VIEWS}</span></td>
-<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'>{LASTPOST}</span></td>
-</tr>";
-
-
-$FORUM_VIEW_END = "
-</table>
-<table style='width:100%'>
-<tr>
-<td style='width:80%'><span class='mediumtext'>{THREADPAGES}</span>
-{FORUMJUMP}
-</td>
-<td style='width:20%; text-align:right'>
-{NEWTHREADBUTTON}
-</td>
-</tr>
-</table>
-
-
-<div class='spacer'>
-<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
-<tr>
-<td style='vertical-align:center; width:50%' class='nforumview3'><span class='smalltext'>{MODERATORS}</span></td>
-<td style='text-align:right; vertical-align:center; width:50%' class='nforumview3'><span class='smalltext'>{BROWSERS}</span></td>
-</tr>
-
-<tr>
-<td style='vertical-align:center; width:50%' class='nforumview4'>{ICONKEY}</td>
-<td style='vertical-align:center; text-align:center; width:50%' class='nforumview4'>{PERMS}<br /><br />{SEARCH}
-</td>
-</tr>
-</table>
-</div>
-
-<div class='nforumdisclaimer' style='text-align:center'>Forum theme loosely based on <a href='http://www.invisionpower.com/'>Invision Power Board</a></div>";
-
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_themes/e107v4a/forum_template.php 75/e107_themes/e107v4a/forum_template.php
--- 6171/e107_themes/e107v4a/forum_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/e107v4a/forum_template.php	2006-01-15 13:08:25.000000000 -0600
@@ -0,0 +1,290 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/e107v4a/forum_template.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2006/01/15 19:08:25 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$sc_style['ANON_IP']['pre'] = "<br /><span class='smalltext'>";
+$sc_style['ANON_IP']['post'] = "</span>";
+
+$FORUMSTART = "
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td  colspan='2' class='nforumcaption'>{BACKLINK}</td>
+</tr>
+<tr>
+<td class='nforumcaption2' colspan='2'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td>{NEXTPREV}</td>
+<td style='text-align:right'>&nbsp;{TRACK}&nbsp;</td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+<br />
+
+<table style='width:100%'>
+<tr>
+<td style='width:60%'><div class='mediumtext'><img src='".e_PLUGIN."forum/images/lite/e.png' alt='' style='vertical-align:middle' /> <b>{THREADNAME}</b></div><br />{GOTOPAGES}</td>
+<td style='width:40%; text-align: right; vertical-align:bottom;'>{BUTTONS}</td>
+</tr>
+</table>
+
+
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='width:20%; text-align:center' class='nforumcaption2'>\n".LAN_402."\n</td>\n<td style='width:80%; text-align:center' class='nforumcaption2'>\n".LAN_403."\n</td>
+</tr>
+</table>";
+
+$FORUMTHREADSTYLE = "
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td class='nforumcaption3' style='vertical-align:middle; width:20%;'>\n{NEWFLAG}\n{POSTER}\n{ANON_IP}</td>
+<td class='nforumcaption3' style='vertical-align:middle; width:80%;'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td class='smallblacktext'>\n{THREADDATESTAMP}\n</td>
+<td style='text-align:right'>\n{EMAILITEM} {PRINTITEM} {REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n</td>
+</tr>
+</table>
+</td>
+</tr>
+<tr>
+<td class='nforumthread' style='vertical-align:top'>\n{AVATAR}\n<span class='smalltext'>\n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{EXTENDED=location.text}: {EXTENDED=location.value}<br />\n{POSTS}\n</span>\n</td>
+<td class='nforumthread' style='vertical-align:top'>{POLL}\n{POST}\n{SIGNATURE}\n</td>
+</tr>
+<tr>
+<td class='nforumthread2'>\n<span class='smallblacktext'>\n{TOP}\n</span>\n</td>
+<td class='nforumthread2' style='vertical-align:top'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td>\n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n</td>
+<td style='text-align:right'>\n{MODOPTIONS}\n</td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+</div>";
+
+$FORUMREPLYSTYLE = "
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td class='nforumcaption3' style='vertical-align:middle; width:20%;'>\n{NEWFLAG}\n{POSTER}\n{ANON_IP}</td>
+<td class='nforumcaption3' style='vertical-align:middle; width:80%;'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td class='smallblacktext'>\n{THREADDATESTAMP}\n</td>
+<td style='text-align:right'>\n{EMAILITEM} {PRINTITEM} {REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n</td>
+</tr>
+</table>
+</td>
+</tr>
+<tr>
+<td class='nforumthread' style='vertical-align:top'>\n{AVATAR}\n<span class='smalltext'>\n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{EXTENDED=location.text}: {EXTENDED=location.value}<br />\n{POSTS}\n</span>\n</td>
+<td class='nforumthread' style='vertical-align:top'>\n{POST}\n{SIGNATURE}\n</td>
+</tr>
+<tr>
+<td class='nforumthread2'>\n<span class='smallblacktext'>\n{TOP}\n</span>\n</td>
+<td class='nforumthread2' style='vertical-align:top'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td>\n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n</td>
+<td style='text-align:right'>\n{MODOPTIONS}\n</td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+</div>";
+
+$FORUMEND = "
+<div class='spacer'>
+<div class='forumheader'>
+{GOTOPAGES}
+</div>
+<br />
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='width:50%; text-align:left; vertical-align:top' class='nforumthread'><b>{MODERATORS}</b><br />{FORUMJUMP}</td>
+<td style='width:50%; text-align:right; vertical-align:top' class='nforumthread'>{BUTTONS}</td>
+</tr>
+</table>
+</div>
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='text-align:center' class='nforumthread2'>
+{QUICKREPLY}
+</td>
+</tr>
+</table>
+<div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div>
+</div>";
+
+
+$FORUM_MAIN_START = "<div style='text-align:center'>";
+
+$FORUM_MAIN_PARENT = "<div class='spacer'>\n<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>\n<tr>\n<td colspan='5' class='nforumcaption'>{PARENTNAME} {PARENTSTATUS}</td>\n</tr>
+<tr>\n<td colspan='2' style='width:60%; text-align:center' class='nforumcaption2'>{FORUMTITLE}</td>\n<td style='width:10%; text-align:center' class='nforumcaption2'>{THREADTITLE}</td>\n<td style='width:10%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>\n<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>\n</tr>\n";
+
+$FORUM_MAIN_PARENT_END = "</table></div>";
+
+$FORUM_MAIN_FORUM = "<tr>\n<td style='width:5%; text-align:center' class='nforumcaption3'>{NEWFLAG}</td>\n<td style='width:55%' class='nforumcaption3'>{FORUMNAME}<br /><span class='smallblacktext'>{FORUMDESCRIPTION}</span>{FORUMSUBFORUMS}</td>\n<td style='width:10%; text-align:center' class='nforumthread'>{THREADS}</td>\n<td style='width:10%; text-align:center' class='nforumthread'>{REPLIES}</td>\n<td style='width:20%; text-align:center' class='nforumthread'><span class='smallblacktext'>{LASTPOST}</span></td>\n</tr>";
+
+$FORUM_MAIN_END = "<div class='spacer'>\n<table style='width:100%' class='fborder'>\n<tr>\n<td colspan='2' style='width:60%' class='nforumcaption2'>{INFOTITLE}</td>\n</tr>\n<tr>\n<td rowspan='4' style='width:5%; text-align:center' class='forumheader3'>{LOGO}</td>\n<td style='width:100%' class='forumheader3'>{USERINFO}</td>\n</tr>\n<tr>\n<td style='width:auto' class='forumheader3'>{INFO}</td>\n</tr>\n<tr>\n<td style='width:100%' class='forumheader3'>{FORUMINFO}</td>\n</tr>\n<tr>\n<td style='width:100%' class='forumheader3'>{USERLIST}</td>\n</tr>\n</table>\n</div>\n<div class='spacer'>\n<table class='fborder' style='width:100%'>\n<tr>\n<td class='forumheader3' style='text-align:center; width:33%'>{ICONKEY}</td>\n<td style='text-align:center; width:33%' class='forumheader3'>{SEARCH}</td>\n<td style='width:33%; text-align:center; vertical-align:middle' class='forumheader3'><span class='smallblacktext'>{PERMS}</span>\n</td>\n</tr>\n</table>\n</div>\n<div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div></div>";
+
+
+
+$FORUM_VIEW_START = "
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td  colspan='2' class='nforumcaption'>{BREADCRUMB}</td>
+</tr>
+{SUBFORUMS}
+</table>
+
+<table style='width:100%'><tr>
+<td style='width:80%'><div class='mediumtext'><img src='".e_PLUGIN."forum/images/lite/e.png' style='vertical-align:middle' alt='' /> <b>{FORUMTITLE} Forum</b></div>{THREADPAGES}</td>
+<td style='width:20%; text-align:right; vertical-align:bottom;'>
+{NEWTHREADBUTTON}
+</td>
+</tr>
+</table>
+
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='width:3%' class='nforumcaption2'>&nbsp;</td>
+<td style='width:47%' class='nforumcaption2'>{THREADTITLE}</td>
+<td style='width:20%; text-align:center' class='nforumcaption2'>{STARTERTITLE}</td>
+<td style='width:5%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>
+<td style='width:5%; text-align:center' class='nforumcaption2'>{VIEWTITLE}</td>
+<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>
+</tr>";
+
+
+$FORUM_VIEW_START_CONTAINER = "
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td  colspan='2' class='nforumcaption'>{BREADCRUMB}</td>
+</tr>
+{SUBFORUMS}
+</table>
+";
+
+
+$FORUM_VIEW_FORUM = "
+<tr>
+<td style='vertical-align:middle; text-align:center; width:3%' class='nforumview1'>{ICON}</td>
+<td style='vertical-align:middle; text-align:left; width:47%'  class='nforumview1'>
+
+<table style='width:100%'>
+<tr>
+<td style='width:90%'><span class='mediumtext'><b>{THREADNAME}</b></span> <span class='smalltext'>{PAGES}</span></td>
+<td style='width:10%; white-space:nowrap;'>{ADMIN_ICONS}</td>
+</tr>
+</table>
+</td>
+
+<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'><b>{POSTER}</b><br />{THREADDATE}</span></td>
+<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{REPLIES}</span></td>
+<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{VIEWS}</span></td>
+<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'>{LASTPOST}</span></td>
+</tr>";
+
+
+$FORUM_VIEW_END = "
+</table>
+<table style='width:100%'>
+<tr>
+<td style='width:80%'><span class='mediumtext'>{THREADPAGES}</span>
+{FORUMJUMP}
+</td>
+<td style='width:20%; text-align:right'>
+{NEWTHREADBUTTON}
+</td>
+</tr>
+</table>
+
+
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='vertical-align:center; width:50%' class='nforumview3'><span class='smalltext'>{MODERATORS}</span></td>
+<td style='text-align:right; vertical-align:center; width:50%' class='nforumview3'><span class='smalltext'>{BROWSERS}</span></td>
+</tr>
+
+<tr>
+<td style='vertical-align:center; width:50%' class='nforumview4'>{ICONKEY}</td>
+<td style='vertical-align:center; text-align:center; width:50%' class='nforumview4'>{PERMS}<br /><br />{SEARCH}
+</td>
+</tr>
+</table>
+</div>
+
+<div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div>";
+
+
+
+$FORUM_VIEW_END_CONTAINER = "
+<table style='width:100%'>
+<tr>
+<td style='width:100%; text-align:left'>
+<br />{FORUMJUMP}
+</td>
+</tr>
+</table>
+<br /><div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div>
+";
+
+
+
+$FORUM_VIEW_SUB_START = "
+<tr>
+<td colspan='2'>
+<table style='width:100%'  cellpadding='0' cellspacing='0'>
+<tr>
+<td class='nforumcaption2' style='width: 50%'>".FORLAN_20."</td>
+<td class='nforumcaption2' style='width: 10%; text-align: center;'>".FORLAN_21."</td>
+<td class='nforumcaption2' style='width: 10%; text-align: center;'>".LAN_55."</td>
+<td class='nforumcaption2' style='width: 30%; text-align: center;'>".FORLAN_22."</td>
+</tr>
+";
+
+$FORUM_VIEW_SUB = "
+<tr>
+<td class='nforumview2' style='text-align:left'><b>{SUB_FORUMTITLE}</b><br />{SUB_DESCRIPTION}</td>
+<td class='nforumview2' style='text-align:center'>{SUB_THREADS}</td>
+<td class='nforumview2' style='text-align:center'>{SUB_REPLIES}</td>
+<td class='nforumview2' style='text-align:center'>{SUB_LASTPOST}</td>
+</tr>
+";
+
+$FORUM_VIEW_SUB_END = "
+</table>
+</td>
+</tr>
+";
+
+
+?>
\ No newline at end of file
Files 6171/e107_themes/e107v4a/images/bar2edge.gif and 75/e107_themes/e107v4a/images/bar2edge.gif differ
Files 6171/e107_themes/e107v4a/images/bar2.gif and 75/e107_themes/e107v4a/images/bar2.gif differ
Files 6171/e107_themes/e107v4a/images/barl.png and 75/e107_themes/e107v4a/images/barl.png differ
Files 6171/e107_themes/e107v4a/images/bar.png and 75/e107_themes/e107v4a/images/bar.png differ
Files 6171/e107_themes/e107v4a/images/barr.png and 75/e107_themes/e107v4a/images/barr.png differ
Files 6171/e107_themes/e107v4a/images/bottomleft.png and 75/e107_themes/e107v4a/images/bottomleft.png differ
Files 6171/e107_themes/e107v4a/images/bottom.png and 75/e107_themes/e107v4a/images/bottom.png differ
Files 6171/e107_themes/e107v4a/images/bottomright.png and 75/e107_themes/e107v4a/images/bottomright.png differ
Files 6171/e107_themes/e107v4a/images/bullet3.png and 75/e107_themes/e107v4a/images/bullet3.png differ
Files 6171/e107_themes/e107v4a/images/button2.png and 75/e107_themes/e107v4a/images/button2.png differ
Files 6171/e107_themes/e107v4a/images/button3.png and 75/e107_themes/e107v4a/images/button3.png differ
Files 6171/e107_themes/e107v4a/images/cap1.png and 75/e107_themes/e107v4a/images/cap1.png differ
Files 6171/e107_themes/e107v4a/images/capleft.png and 75/e107_themes/e107v4a/images/capleft.png differ
Files 6171/e107_themes/e107v4a/images/caplight.png and 75/e107_themes/e107v4a/images/caplight.png differ
Files 6171/e107_themes/e107v4a/images/capright.png and 75/e107_themes/e107v4a/images/capright.png differ
Files 6171/e107_themes/e107v4a/images/captransition.png and 75/e107_themes/e107v4a/images/captransition.png differ
Files 6171/e107_themes/e107v4a/images/fcap2.png and 75/e107_themes/e107v4a/images/fcap2.png differ
Files 6171/e107_themes/e107v4a/images/header.png and 75/e107_themes/e107v4a/images/header.png differ
Files 6171/e107_themes/e107v4a/images/left.png and 75/e107_themes/e107v4a/images/left.png differ
Files 6171/e107_themes/e107v4a/images/logo.png and 75/e107_themes/e107v4a/images/logo.png differ
Files 6171/e107_themes/e107v4a/images/nforumcaption2.png and 75/e107_themes/e107v4a/images/nforumcaption2.png differ
Files 6171/e107_themes/e107v4a/images/nforumcaption.png and 75/e107_themes/e107v4a/images/nforumcaption.png differ
Files 6171/e107_themes/e107v4a/images/right.png and 75/e107_themes/e107v4a/images/right.png differ
Files 6171/e107_themes/e107v4a/images/search.png and 75/e107_themes/e107v4a/images/search.png differ
Files 6171/e107_themes/e107v4a/images/temp.png and 75/e107_themes/e107v4a/images/temp.png differ
Files 6171/e107_themes/e107v4a/images/topleft.png and 75/e107_themes/e107v4a/images/topleft.png differ
Files 6171/e107_themes/e107v4a/images/top.png and 75/e107_themes/e107v4a/images/top.png differ
Files 6171/e107_themes/e107v4a/images/topright.png and 75/e107_themes/e107v4a/images/topright.png differ
diff -ruN 6171/e107_themes/e107v4a/languages/English.php 75/e107_themes/e107v4a/languages/English.php
--- 6171/e107_themes/e107v4a/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/e107v4a/languages/English.php	2005-03-21 04:50:01.000000000 -0600
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/e107v4a/languages/English.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/03/21 10:50:01 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "Read/Post Comment: ");
+define("LAN_THEME_2", "Comments are turned off for this item");
+define("LAN_THEME_3", "Read the rest...");
+define("LAN_THEME_4", "Posted by");
+define("LAN_THEME_5", "on");
+define("LAN_THEME_6", "e107.v4 theme by <a href='http://e107.org' rel='external'>jalist</a>");
+
+?>
diff -ruN 6171/e107_themes/e107v4a/newsfeed_template.php 75/e107_themes/e107v4a/newsfeed_template.php
--- 6171/e107_themes/e107v4a/newsfeed_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/e107v4a/newsfeed_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,64 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/e107v4a/newsfeed_template.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$NEWSFEED_COLLAPSE = TRUE;
+
+$NEWSFEED_LIST_START = "
+<table style='width: 100%;' class='fborder'>\n";
+
+$NEWSFEED_LIST = "
+<tr>
+<td style='width: 30%;' class='forumheader3'>{FEEDNAME}</td>
+<td style='width: 70%;' class='forumheader3'>{FEEDDESCRIPTION}</td>
+</tr>\n";
+
+$NEWSFEED_LIST_END = "
+</table>\n";
+
+$NEWSFEED_MAIN_START = "
+<table style='width: 100%;' class='fborder'>
+<tr>
+<td class='forumheader2'>{FEEDIMAGE} {FEEDTITLE}</td>
+</tr>
+<tr>
+<td class='forumheader3'>
+<ul>\n";
+
+$NEWSFEED_MAIN = "
+<li>{FEEDITEMLINK} <span class='smalltext'>{FEEDITEMCREATOR}</span><br /><span class='mediumtext'>{FEEDITEMTEXT}</span></li>\n";
+
+
+$NEWSFEED_MAIN_END = "
+</ul>
+</td>
+</tr>
+
+<tr>
+<td class='forumheader3' style='text-align: right;'><span class='smalltext'>{FEEDCOPYRIGHT} | {FEEDLASTBUILDDATE}</td>
+</tr>
+
+<tr>
+<td class='forumheader3' style='text-align: center;'><span class='smalltext'>{BACKLINK}</td>
+</tr>
+</table>\n";
+
+
+?>
\ No newline at end of file
Files 6171/e107_themes/e107v4a/preview.jpg and 75/e107_themes/e107v4a/preview.jpg differ
diff -ruN 6171/e107_themes/e107v4a/style.css 75/e107_themes/e107v4a/style.css
--- 6171/e107_themes/e107v4a/style.css	2004-03-03 12:23:56.000000000 -0600
+++ 75/e107_themes/e107v4a/style.css	2005-03-21 04:50:44.000000000 -0600
@@ -1,345 +1,373 @@
-body {
-	color: #000;
-	font: 12px tahoma, verdana, arial, sans-serif;
-	background-color: #E7E7E7;
-	margin:0px; text-align:left;
-}
-a {
-	color: #716d6d;
-	text-decoration: underline;
-}
-a:hover {
-	color: #2a3236;
-	text-decoration: underline;
-}
-.smalltext {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#5d6e75;
-}
-.smallblacktext {
-	font: normal 11px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#000;
-}
-.indent{
-	padding: 3px 3px 3px 3px;
-	margin: 5px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #000060;
-	border: 1px solid;
-	background-color: #E3E2D7;
-	border-bottom: #FFFFFF 1px solid;
-	border-left: #000 1px solid;
-	border-right: #FFFFFF 1px solid;
-	border-top: #000 1px solid;
-}
-.defaulttext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-td {
-	font:10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 0px;
-	text-align:left;
-}
-
-blockquote {
-	font: italic 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#7e96ac;
-}
-.mediumtext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-.captiontext {
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-.tbox{
-	background-color: #eaeef2;
-	border: #5e5d63 1px solid;
-	color: #000000;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-.nextprev{
-	background-color: #eaeef2;
-	border: 1px solid #696C6C;
-	color: #000;
-	font: normal 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	padding : 2px, 2px, 2px, 2px;
-	background-image : url(images/button.png);
-}
-.button{
-	background-color: #eaeef2;
-	border: #000 1px solid;
-	color: #000000;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	background-image : url(images/button.png);
-}
-.np{
-	background-color: #eaeef2;
-	border: #000 1px solid;
-	color: #000000;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	padding : 2px;
-}
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding: 2px 0px 2px 0px;
-}
-hr {
-	border-top: #666 1px solid;
-	border-bottom: #eee 1px solid;
-	height: 2px;
-	width: 92%;
-	text-align:center;
-}
-.border {
-	border: #000 1px solid;
-}
-.border2 {
-	border: #D5D5D5 1px solid;
-}
-
-.border3 {
-	border: #000 1px solid;
-}
-.helpbox {
-	border: transparent;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
-.caption {
-	padding: 0px 4px 0px 4px;
-	border-bottom: #363A44 1px solid;
-	border-left: #8A96B3 1px solid;
-	border-right: #363A44 1px solid;
-	border-top: #8A96B3 1px solid;
-	background-color: #E1DFDF;
-	color: #000;
-	font: 13px tahoma, arial, verdana, helvetica, sans-serif;
-	background-image : url(images/cap1.png);
-}
-.caption2 {
-	padding: 0px 4px 0px 4px;
-	color: #243B3B;
-	font: 15px tahoma, arial, verdana, helvetica, sans-serif;
-	text-align:center;
-}
-.caption3 {
-	padding: 0px 4px 0px 4px;
-	border-bottom: #C7C3C3 1px solid;
-	border-left: #fff 1px solid;
-	border-right: transparent;
-	border-top: #fff 1px solid;
-	background-color: #D5D5D5;
-	color: #000;
-	font: 13px tahoma, arial, verdana, helvetica, sans-serif;
-}
-.bodytable {
-	padding: 8px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-.bodytable2 {
-	border: #D5D5D5 1px solid;
-	padding: 8px;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #404040;
-}
-.bodytable3 {
-	padding: 8px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-p {
-	margin-top: 0px;
-	margin-bottom: 0px
-}
-.fborder {
-	border: #000000 1px solid;
-	background-color: #fff;
-	
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	background-image : url(images/cap1.png);
-	border: #C3BDBD 1px solid;
-}
-.forumheader2{
-	background-color: #E4EAF2;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-.forumheader3{
-	background-color: #DFE6EF;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-.forumborder{
-	border: #000080 1px solid;
-}
-.fcaption {
-	border: #000 1px solid;
-	padding: 2px 0px 2px 8px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(images/fcap.png);
-	color:#fff;
-}
-.captiontopleft{ width: 24px; background-image: url(images/topleft.png); }
-.captiontopmiddle{ width: 100%; background-repeat: repeat-x; background-image: url(images/top.png); }
-.captiontopright{ width: 11px; background-image: url(images/topright.png); }
-.captionleft{ width: 24px; background-image: url(images/capleft.png); }
-.captionbar{ background-repeat: repeat-x; padding-right:10px; font-size: 10px; color: #fff; font-family: verdana, tahoma, arial, sans-serif; background-image: url(images/capdark.png);}
-.captionend{ width: 12px; background-image: url(images/captransition.png); }
-.captionmain{ width: 100%; background-repeat: repeat-x; background-image: url(images/caplight.png); }
-.captionright{ width: 11px; background-image: url(images/capright.png); }
-.bodyleft{ width: 3px; background-repeat: repeat-y; background-image: url(images/left.png); }
-.bodymain{ width: 100%; background: #DAE7F3; padding: 4px 5px 5px 4px; font-size: 10px; color: #000; font-family: verdana, tahoma, arial, sans-serif; vertical-align:top; }
-.bodyright{ width: 3px; background-repeat: repeat-y; background-image: url(images/right.png); }
-.bottomleft{ width: 10px; background-image: url(images/bottomleft.png); }
-.bottommain{ width: 100%; background-repeat: repeat-x; background-image: url(images/bottom.png);}
-.bottomright{ width: 10px; background-image: url(images/bottomright.png); }
-.finfobar{
-	background-color: #DBE5F5;
-	font: 15px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-	background-image : url(forum/finfobar.png);
-}
-
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
-
-.topborder {
-	border-bottom: #000 1px solid;
-}
-
-.bottomborder {
-	border-top: #000 1px solid;
-	border-bottom: #000 1px solid;
-}
-.alttd{
-	background-color: #C8DDEE;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-.code{
-	border: #9F9F9F 1px solid;
-	padding: 8px;
-	background-color: #EEECEC;
-	font: 12px courier, arial, verdana, tahoma, helvetica, sans-serif;
-	color:#000040;
-}
-
-.nforumholder {
-	border: 1px solid #345487;
-	padding: 0px;
-	background-color: #fff;
-}
-
-.nforumcaption {
-	background-image: url(images/nforumcaption.png);
-	padding: 8px 4px 8px 4px;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #fff;
-}
-
-.nforumcaption2 {
-	background-image: url(images/nforumcaption2.png);
-	padding: 8px 0px 8px 4px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-	font-weight: bold;
-}
-
-.nforumcaption3 {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #E4EAF2;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumthread {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #EEF2F7;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumthread2 {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #D1DCEB;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumreplycaption {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #E2EDF2;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumreply {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #EDF4F7;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumreply2 {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #CFE0EB;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-.nforumdisclaimer {
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#5d6e75;
-}
-
-.nforumview1 {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #E4EAF2;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumview2 {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #DFE6EF;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumview3 {
-	padding: 4px;
-	background-color: #BCD0ED;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #263448;
-}
-
-.nforumview4 {
-	padding: 4px;
-	background-color: #E4EAF2;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #3A4F6C;
+body {
+	color: #000;
+	font: 12px tahoma, verdana, arial, sans-serif;
+	background-color: #E7E7E7;
+	margin:0px;
+	text-align:left;
+	padding: 0px;
+}
+a {
+	color: #716d6d;
+	text-decoration: underline;
+}
+a:hover {
+	color: #2a3236;
+	text-decoration: underline;
+}
+
+#header {
+	background-image : url(images/header.png);
+	background-repeat: repeat-x;
+	border-bottom: #000 1px solid;
+	height: 80px;
+}
+
+ul, ol {
+	margin-top: 0;
+	margin-bottom: 0;
+}
+
+.fcaption a {
+	color: #ffffcc;
+	text-decoration: underline;
+}
+.fcaption a:hover {
+	color: #cccc99;
+	text-decoration: underline;
+}
+.smalltext {
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+.smallblacktext {
+	font: normal 7pt verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+.indent{
+	padding: 3px;
+	margin: 5px;
+	font: 9px verdana, tahoma, arial, sans-serif;
+	color: #000060;
+	border: 1px solid;
+	background-color: #E3E2D7;
+	border-bottom: #FFFFFF 1px solid;
+	border-left: #000 1px solid;
+	border-right: #FFFFFF 1px solid;
+	border-top: #000 1px solid;
+}
+.defaulttext {
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+td {
+	font:10px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 0px;
+	text-align:left;
+}
+
+blockquote {
+	font: italic 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#7e96ac;
+}
+.mediumtext {
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+.captiontext {
+	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+.tbox{
+	background-color: #eaeef2;
+	border: #5e5d63 1px solid;
+	color: #000000;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+.tbox.chatbox {
+	width: 80%;
+	margin-left: auto;
+	margin-right: auto;
+}
+.nextprev{
+	background-color: #eaeef2;
+	border: 1px solid #696C6C;
+	color: #000;
+	font: normal 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	padding : 2px;
+	background-image : url(images/button.png);
+}
+.button{
+	background-color: #eaeef2;
+	border: #000 1px solid;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	background-image : url(images/button.png);
+}
+.np{
+	background-color: #eaeef2;
+	border: #000 1px solid;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	padding : 2px;
+}
+form {
+	margin: 2px 0px 0px 0px;
+}
+.spacer{
+	padding: 2px 0px 2px 0px;
+}
+hr {
+	border-top: #666 1px solid;
+	border-bottom: #eee 1px solid;
+	height: 2px;
+	width: 92%;
+	text-align:center;
+}
+.border {
+	border: #000 1px solid;
+}
+.border2 {
+	border: #D5D5D5 1px solid;
+}
+
+.border3 {
+	border: #000 1px solid;
+}
+.helpbox {
+	border: 0px;
+	background-color: transparent;
+	color:#000;
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+}
+.caption {
+	padding: 0px 4px 0px 4px;
+	border-bottom: #363A44 1px solid;
+	border-left: #8A96B3 1px solid;
+	border-right: #363A44 1px solid;
+	border-top: #8A96B3 1px solid;
+	background-color: #E1DFDF;
+	color: #000;
+	font: 13px tahoma, arial, verdana, helvetica, sans-serif;
+	background-image : url(images/cap1.png);
+}
+.caption2 {
+	padding: 0px 4px 0px 4px;
+	color: #243B3B;
+	font: 15px tahoma, arial, verdana, helvetica, sans-serif;
+	text-align:center;
+}
+.caption3 {
+	padding: 0px 4px 0px 4px;
+	border-bottom: #C7C3C3 1px solid;
+	border-left: #fff 1px solid;
+	border-right: transparent;
+	border-top: #fff 1px solid;
+	background-color: #D5D5D5;
+	color: #000;
+	font: 13px tahoma, arial, verdana, helvetica, sans-serif;
+}
+.bodytable {
+	padding: 8px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+.bodytable2 {
+	border: #D5D5D5 1px solid;
+	padding: 8px;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #404040;
+}
+.bodytable3 {
+	padding: 8px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+p {
+	margin-top: 0px;
+	margin-bottom: 0px
+}
+.fborder {
+	border: #000000 1px solid;
+	background-color: #fff;
+	
+}
+.forumheader{
+	background-color: #EBEFF2;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	background-image : url(images/cap1.png);
+	border: #C3BDBD 1px solid;
+}
+.forumheader2{
+	background-color: #E4EAF2;
+	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+}
+.forumheader3{
+	background-color: #DFE6EF;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+}
+.forumborder{
+	border: #000080 1px solid;
+}
+.fcaption {
+	border: #000 1px solid;
+	padding: 2px 0px 2px 8px;
+	background-color: #C9C7C7;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	background-image : url(images/fcap.png);
+	color:#fff;
+}
+.captiontopleft{ width: 24px; background-image: url(images/topleft.png); }
+.captiontopmiddle{ width: 100%; background-repeat: repeat-x; background-image: url(images/top.png); }
+.captiontopright{ width: 11px; background-image: url(images/topright.png); }
+.captionleft{ width: 24px; background-image: url(images/capleft.png); }
+.captionbar{ background-repeat: repeat-x; padding-right:10px; font-size: 10px; color: #fff; font-family: verdana, tahoma, arial, sans-serif; background-image: url(images/capdark.png);}
+.captionend{ width: 12px; background-image: url(images/captransition.png); }
+.captionmain{ width: 100%; background-repeat: repeat-x; background-image: url(images/caplight.png); }
+.captionright{ width: 11px; background-image: url(images/capright.png); }
+.bodyleft{ width: 3px; background-repeat: repeat-y; background-image: url(images/left.png); }
+.bodymain{ width: 100%; background: #DAE7F3; padding: 4px 5px 5px 4px; font-size: 10px; color: #000; font-family: verdana, tahoma, arial, sans-serif; vertical-align:top; }
+.bodyright{ width: 3px; background-repeat: repeat-y; background-image: url(images/right.png); }
+.bottomleft{ width: 10px; background-image: url(images/bottomleft.png); }
+.bottommain{ width: 100%; background-repeat: repeat-x; background-image: url(images/bottom.png);}
+.bottomright{ width: 10px; background-image: url(images/bottomright.png); }
+.finfobar{
+	background-color: #DBE5F5;
+	font: 15px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+	background-image : url(forum/finfobar.png);
+}
+
+a.forumlink{
+	color: #fff;
+	text-decoration: underline;
+}
+
+.topborder {
+	border-bottom: #000 1px solid;
+}
+
+.bottomborder {
+	border-top: #000 1px solid;
+	border-bottom: #000 1px solid;
+}
+.alttd{
+	background-color: #C8DDEE;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+.code{
+	border: #9F9F9F 1px solid;
+	padding: 8px;
+	background-color: #EEECEC;
+	font: 12px courier, arial, verdana, tahoma, helvetica, sans-serif;
+	color:#000040;
+}
+
+.nforumholder {
+	border: 1px solid #345487;
+	padding: 0px;
+	background-color: #fff;
+}
+
+.nforumcaption {
+	background-image: url(images/nforumcaption.png);
+	padding: 8px 4px 8px 4px;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #fff;
+}
+
+.nforumcaption2 {
+	background-image: url(images/nforumcaption2.png);
+	padding: 8px 0px 8px 4px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+	font-weight: bold;
+}
+
+.nforumcaption3 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #EEF2F7;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #D1DCEB;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreplycaption {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E2EDF2;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #EDF4F7;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #CFE0EB;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+.nforumdisclaimer {
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.nforumview1 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #DFE6EF;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview3 {
+	padding: 4px;
+	background-color: #BCD0ED;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #263448;
+}
+
+.nforumview4 {
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #3A4F6C;
 }
\ No newline at end of file
diff -ruN 6171/e107_themes/e107v4a/theme.php 75/e107_themes/e107v4a/theme.php
--- 6171/e107_themes/e107v4a/theme.php	2004-05-03 23:10:48.000000000 -0500
+++ 75/e107_themes/e107v4a/theme.php	2006-05-05 17:44:39.000000000 -0500
@@ -1,274 +1,282 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107.v4 theme file 
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "e107.v4";
-$themeversion = "1.0";
-$themeauthor = "jalist";
-$themedate = "11/06/2003";
-$themeinfo = "";
-
-define("THEME_DISCLAIMER", "<br /><i>e107.v4 theme by jalist</i>");
-
-
-// [layout]
-
-$layout = "_default";
-$logo = THEME."images/bullet3.gif";
-
-
-
-
-
-$HEADER .= 
-"
-<table style='width:100%; background-color:#E4E0E0' cellspacing='3' class='topborder'>
-<tr>
-<td style='text-align:left; vertical-align:bottom'>
-{CUSTOM=clock}
-</td>
-<td style='text-align:right'>
-{CUSTOM=search}
-</td>
-</tr>
-</table>
-<table style='width:100%; background-color:white' cellspacing='3' class='topborder'>
-<tr>
-<td colspan='2' style='text-align:left'>
-{LOGO}
-</td>
-<td style='text-align:right'>
-{BANNER}
-</td>
-</tr>
-</table>
-<table style='width:100%' cellspacing='3'>
-<tr>
-<td style='width:20%; vertical-align: top;'>
-{SITELINKS=menu}
-{MENU=1}
-</td><td style='width:60%; vertical-align: top;'>";
-
-$FOOTER = 
-"</td><td style='width:20%; vertical-align:top'>
-{MENU=2}
-</td></tr>
-<tr>
-<td colspan='3' style='text-align:center' class='smalltext'>
-
-{SITEDISCLAIMER}
-</td>
-</tr>
-</table>
-<div style='text-align:center'>
-<table style='width:100%'>
-<tr>
-<td style='width:30%; vertical-align:top'>
-&nbsp;
-{MENU=3}
-</td>
-<td style='width:40%; vertical-align:top'>
-{MENU=4}
-</td>
-<td style='width:30%; vertical-align:top'>
-&nbsp;
-{MENU=5}
-</td>
-</tr>
-</table>
-</div>";
-
-
-
-function rand_tag(){
-	$tags = file(e_BASE."files/taglines.txt");
-	return stripslashes(htmlspecialchars($tags[rand(0, count($tags))]));
-}
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-<div class='spacer'>
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='captiontopleft'><img src='".THEME."images/blank.gif' width='24' height='3' alt='' style='display: block;' /></td>
-<td class='captiontopmiddle'><img src='".THEME."images/blank.gif' width='1' height='3' alt='' style='display: block;' /></td>
-<td class='captiontopright'><img src='".THEME."images/blank.gif' width='11' height='3' alt='' style='display: block;' /></td>
-</tr>
-</table>
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='captionleft'><img src='".THEME."images/blank.gif' width='24' height='18' alt='' style='display: block;' /></td>
-<td class='captionbar' style='white-space:nowrap'>
-{NEWSTITLE}
-</td>
-<td class='captionend'><img src='".THEME."images/blank.gif' width='12' height='18' alt='' style='display: block;' /></td>
-<td class='captionmain'><img src='".THEME."images/blank.gif' width='1' height='18' alt='' style='display: block;' /></td>
-<td class='captionright'><img src='".THEME."images/blank.gif' width='11' height='18' alt='' style='display: block;' /></td>
-</tr>
-</table>
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='bodyleft'><img src='".THEME."images/blank.gif' width='3' height='1' alt='' style='display: block;' /></td>
-<td class='bodymain'>
-{NEWSBODY}
-{EXTENDED}
-<div class='alttd' style='text-align:right'>
-Posted by {NEWSAUTHOR} on {NEWSDATE}
- | 
-{NEWSCOMMENTS}
- | 
-{EMAILICON}
-{PRINTICON}
-</div>
-</td>
-<td class='bodyright'><img src='".THEME."images/blank.gif' width='3' height='1' alt='' style='display: block;' /></td>
-</tr>
-</table>
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='bottomleft'><img src='".THEME."images/blank.gif' width='10' height='9' alt='' style='display: block;' /></td>
-<td class='bottommain'><img src='".THEME."images/blank.gif' width='1' height='9' alt='' style='display: block;' /></td>
-<td class='bottomright'><img src='".THEME."images/blank.gif' width='10' height='9' alt='' style='display: block;' /></td>
-</tr>
-</table>
-</div>";
-
-
-
-define("ICONSTYLE", "float: left; border:0");
-define("COMMENTLINK", "Read/Post Comment: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
-define("EXTENDEDSTRING", "Read the rest ...");
-define("POST_EXTENDEDSTRING", " ]<br />");
-//define("ICONMAIL", "iconmail.png"); // Usable since e107v615
-//define("ICONPRINT", "iconprint.png"); // Usable since e107v615
-
-
-
-// [linkstyle]
-
-define(PRELINK, "");
-define(POSTLINK, "");
-define(LINKSTART, "<img src='".THEME."images/bullet2.gif' alt='bullet' /> ");
-define(LINKEND, "<br />");
-define(LINKDISPLAY, 2);
-define(LINKALIGN, "left");
-
-
-//	[tablestyle]
-
-function tablestyle($caption, $text){
-	global $style;
-//	echo "Mode: ".$style;
-
-	echo "<div class='spacer'>
-
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='captiontopleft'><img src='".THEME."images/blank.gif' width='24' height='3' alt='' style='display: block;' /></td>
-<td class='captiontopmiddle'><img src='".THEME."images/blank.gif' width='1' height='3' alt='' style='display: block;' /></td>
-<td class='captiontopright'><img src='".THEME."images/blank.gif' width='11' height='3' alt='' style='display: block;' /></td>
-</tr>
-</table>
-
-
-
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='captionleft'><img src='".THEME."images/blank.gif' width='24' height='18' alt='' style='display: block;' /></td>
-<td class='captionbar' style='white-space:nowrap'>".$caption."</td>
-<td class='captionend'><img src='".THEME."images/blank.gif' width='12' height='18' alt='' style='display: block;' /></td>
-<td class='captionmain'><img src='".THEME."images/blank.gif' width='1' height='18' alt='' style='display: block;' /></td>
-<td class='captionright'><img src='".THEME."images/blank.gif' width='11' height='18' alt='' style='display: block;' /></td>
-</tr>
-</table>
-
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='bodyleft'><img src='".THEME."images/blank.gif' width='3' height='1' alt='' style='display: block;' /></td>
-<td class='bodymain'>".$text."</td>
-<td class='bodyright'><img src='".THEME."images/blank.gif' width='3' height='1' alt='' style='display: block;' /></td>
-</tr>
-</table>
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='bottomleft'><img src='".THEME."images/blank.gif' width='10' height='9' alt='' style='display: block;' /></td>
-<td class='bottommain'><img src='".THEME."images/blank.gif' width='1' height='9' alt='' style='display: block;' /></td>
-<td class='bottomright'><img src='".THEME."images/blank.gif' width='10' height='9' alt='' style='display: block;' /></td>
-</tr>
-</table>
-
-</div>";
-
-}
-
-
-$POLLSTYLE = <<< EOF
-<b>Poll:</b> {QUESTION}
-<br /><br />
-{OPTIONS=<span class='alttd'>OPTION</span><br />BAR<br /><span class='smalltext'>PERCENTAGE VOTES</span><br />\n}
-<div style='text-align:center' class='smalltext'>{VOTE_TOTAL} {COMMENTS}
-<br />
-{OLDPOLLS}
-</div>
-EOF;
-
-define(CB_STYLE, $CHATBOXSTYLE);
-
-
-$COMMENTSTYLE = "
-<div style='text-align:center'>
-<table style='width:100%'>
-<tr>
-<td colspan='2' class='alttd'>
-{SUBJECT}
-<b>
-{USERNAME}
-</b>
- | 
- {TIMEDATE}
-</td>
-</tr>
-<tr>
-<td style='width:30%; vertical-align:top'>
-<div class='spacer'>
-{AVATAR}
-</div>
-<span class='smalltext'>
-{LEVEL}
-{COMMENTS}
-<br />
-{JOINED}
-<br />
-{REPLY}
-</span>
-</td>
-<td style='width:70%; vertical-align:top'>
-{COMMENT}
-</td>
-</tr>
-</table>
-</div>
-<br />";
-
-// Forum design
-if(strstr(e_SELF,"forum.php")||strstr(e_SELF,"forum_post.php")||strstr(e_SELF,"forum_viewforum.php")||strstr(e_SELF,"forum_viewtopic.php")){
-	@require_once("forum_design.php");
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/e107v4a/theme.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2006/05/05 22:44:39 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+@include_once(e_THEME."e107v4a/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."e107v4a/languages/English.php");
+
+
+// [theme]
+
+$themename = "e107.v4";
+$themeversion = "2.0";
+$themeauthor = "Steve Dunstan [jalist]";
+$themeemail = "jalist@e107.org";
+$themewebsite = "http://e107.org";
+$themedate = "11/06/2003";
+$themeinfo = "";
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+define("IMODE", "lite");
+define("THEME_DISCLAIMER", "<br /><i>".LAN_THEME_6."</i>");
+
+// [layout]
+
+$layout = "_default";
+$logo = THEME_ABS."images/bullet3.gif";
+
+$HEADER .=
+"
+<table style='width:100%; background-color:#E4E0E0' cellspacing='3' class='topborder'>
+<tr>
+<td style='text-align:left; vertical-align:bottom'>
+{CUSTOM=clock}
+</td>
+<td style='text-align:right'>
+{CUSTOM=search+".THEME_ABS."images/search.png+18+19}
+</td>
+</tr>
+</table>
+<table style='width:100%;' cellspacing='3' id='header'>
+<tr>
+<td colspan='2' style='text-align:left; vertical-align: middle;'>
+<img src='".THEME_ABS."images/logo.png' alt='' /> [ {SITENAME} ]
+</td>
+<td style='text-align:right'>
+{BANNER}
+</td>
+</tr>
+</table>
+<table style='width:100%' cellspacing='3'>
+<tr>
+<td style='width:20%;'></td>
+<td style='width:60%;'><img src='".THEME_ABS."images/blank.gif' width='1' height='1' alt='' /></td>
+<td style='width:20%;'></td>
+</tr>
+<tr>
+<td style='width:20%; vertical-align: top;'>
+{SITELINKS=menu}
+{MENU=1}
+</td><td style='width:60%; vertical-align: top;'>";
+
+$FOOTER =
+"</td><td style='width:20%; vertical-align:top'>
+{MENU=2}
+</td></tr>
+<tr>
+<td colspan='3' style='text-align:center' class='smalltext'>
+
+{SITEDISCLAIMER}
+<br />
+{THEMEDISCLAIMER}
+</td>
+</tr>
+</table>
+<div style='text-align:center'>
+<table style='width:100%'>
+<tr>
+<td style='width:30%; vertical-align:top'>
+&nbsp;
+{MENU=3}
+</td>
+<td style='width:40%; vertical-align:top'>
+{MENU=4}
+</td>
+<td style='width:30%; vertical-align:top'>
+&nbsp;
+{MENU=5}
+</td>
+</tr>
+</table>
+</div>";
+
+
+
+function rand_tag(){
+        $tags = file(e_BASE."files/taglines.txt");
+        return stripslashes(htmlspecialchars($tags[rand(0, count($tags))]));
+}
+
+//        [newsstyle]
+
+$NEWSSTYLE = "
+<div class='spacer'>
+<table cellpadding='0' cellspacing='0'>
+<tr>
+<td class='captiontopleft'><img src='".THEME_ABS."images/blank.gif' width='24' height='3' alt='' style='display: block;' /></td>
+<td class='captiontopmiddle'><img src='".THEME_ABS."images/blank.gif' width='1' height='3' alt='' style='display: block;' /></td>
+<td class='captiontopright'><img src='".THEME_ABS."images/blank.gif' width='11' height='3' alt='' style='display: block;' /></td>
+</tr>
+</table>
+<table cellpadding='0' cellspacing='0'>
+<tr>
+<td class='captionleft'><img src='".THEME_ABS."images/blank.gif' width='24' height='18' alt='' style='display: block;' /></td>
+<td class='captionbar' style='white-space:nowrap'>
+{STICKY_ICON}{NEWSTITLE}
+</td>
+<td class='captionend'><img src='".THEME_ABS."images/blank.gif' width='12' height='18' alt='' style='display: block;' /></td>
+<td class='captionmain'><img src='".THEME_ABS."images/blank.gif' width='1' height='18' alt='' style='display: block;' /></td>
+<td class='captionright'><img src='".THEME_ABS."images/blank.gif' width='11' height='18' alt='' style='display: block;' /></td>
+</tr>
+</table>
+<table cellpadding='0' cellspacing='0'>
+<tr>
+<td class='bodyleft'><img src='".THEME_ABS."images/blank.gif' width='3' height='1' alt='' style='display: block;' /></td>
+<td class='bodymain'>
+{NEWSBODY}
+{EXTENDED}
+<div class='alttd' style='text-align:right'>
+".LAN_THEME_4." {NEWSAUTHOR} ".LAN_THEME_5." {NEWSDATE}
+ |
+{NEWSCOMMENTS}
+ |
+{EMAILICON}
+{PRINTICON}
+{PDFICON}
+</div>
+</td>
+<td class='bodyright'><img src='".THEME_ABS."images/blank.gif' width='3' height='1' alt='' style='display: block;' /></td>
+</tr>
+</table>
+<table cellpadding='0' cellspacing='0'>
+<tr>
+<td class='bottomleft'><img src='".THEME_ABS."images/blank.gif' width='10' height='9' alt='' style='display: block;' /></td>
+<td class='bottommain'><img src='".THEME_ABS."images/blank.gif' width='1' height='9' alt='' style='display: block;' /></td>
+<td class='bottomright'><img src='".THEME_ABS."images/blank.gif' width='10' height='9' alt='' style='display: block;' /></td>
+</tr>
+</table>
+</div>";
+
+
+
+define("ICONSTYLE", "float: left; border:0");
+define("COMMENTLINK", LAN_THEME_1);
+define("COMMENTOFFSTRING", LAN_THEME_2);
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", LAN_THEME_3);
+define("POST_EXTENDEDSTRING", " ]<br />");
+
+
+
+// [linkstyle]
+
+define(PRELINK, "");
+define(POSTLINK, "");
+define(LINKSTART, "<span><img src='".THEME_ABS."images/bullet2.gif' alt='bullet' /> ");
+define(LINKSTART_HILITE, "<span style='font-weight:bold'><img src='".THEME_ABS."images/bullet3.png' alt='bullet' /> ");
+define(LINKEND, "</span><br />");
+define(LINKDISPLAY, 2);
+define(LINKALIGN, "left");
+
+
+//        [tablestyle]
+
+function tablestyle($caption, $text){
+        global $style;
+
+
+        echo "
+<div class='spacer'>
+<table cellpadding='0' cellspacing='0'>
+<tr>
+<td class='captiontopleft'><img src='".THEME_ABS."images/blank.gif' width='24' height='3' alt='' style='display: block;' /></td>
+<td class='captiontopmiddle'><img src='".THEME_ABS."images/blank.gif' width='1' height='3' alt='' style='display: block;' /></td>
+<td class='captiontopright'><img src='".THEME_ABS."images/blank.gif' width='11' height='3' alt='' style='display: block;' /></td>
+</tr>
+</table>
+<table cellpadding='0' cellspacing='0'>
+<tr>
+<td class='captionleft'><img src='".THEME_ABS."images/blank.gif' width='24' height='18' alt='' style='display: block;' /></td>
+<td class='captionbar' style='white-space:nowrap'>".$caption."</td>
+<td class='captionend'><img src='".THEME_ABS."images/blank.gif' width='12' height='18' alt='' style='display: block;' /></td>
+<td class='captionmain'><img src='".THEME_ABS."images/blank.gif' width='1' height='18' alt='' style='display: block;' /></td>
+<td class='captionright'><img src='".THEME_ABS."images/blank.gif' width='11' height='18' alt='' style='display: block;' /></td>
+</tr>
+</table>
+<table cellpadding='0' cellspacing='0'>
+<tr>
+<td class='bodyleft'><img src='".THEME_ABS."images/blank.gif' width='3' height='1' alt='' style='display: block;' /></td>
+<td class='bodymain'>".$text."</td>
+<td class='bodyright'><img src='".THEME_ABS."images/blank.gif' width='3' height='1' alt='' style='display: block;' /></td>
+</tr>
+</table>
+<table cellpadding='0' cellspacing='0'>
+<tr>
+<td class='bottomleft'><img src='".THEME_ABS."images/blank.gif' width='10' height='9' alt='' style='display: block;' /></td>
+<td class='bottommain'><img src='".THEME_ABS."images/blank.gif' width='1' height='9' alt='' style='display: block;' /></td>
+<td class='bottomright'><img src='".THEME_ABS."images/blank.gif' width='10' height='9' alt='' style='display: block;' /></td>
+</tr>
+</table>
+</div>
+";
+
+}
+
+
+$POLLSTYLE = <<< EOF
+<b>Poll:</b> {QUESTION}
+<br /><br />
+{OPTIONS=<span class='alttd'>OPTION</span><br />BAR<br /><span class='smalltext'>PERCENTAGE VOTES</span><br />\n}
+<div style='text-align:center' class='smalltext'>{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</div>
+EOF;
+
+
+$COMMENTSTYLE = "
+<div style='text-align:center'>
+<table style='width:100%'>
+<tr>
+<td colspan='2' class='alttd'>
+{SUBJECT}
+<b>
+{USERNAME}
+</b>
+ |
+ {TIMEDATE}
+</td>
+</tr>
+<tr>
+<td style='width:30%; vertical-align:top'>
+<div class='spacer'>
+{AVATAR}
+</div>
+<span class='smalltext'>
+{LEVEL}
+{COMMENTS}
+<br />
+{JOINED}
+<br />
+{REPLY}
+</span>
+</td>
+<td style='width:70%; vertical-align:top'>
+{COMMENT} {COMMENTEDIT}
+</td>
+</tr>
+</table>
+</div>
+<br />";
+
+
+
 ?>
\ No newline at end of file
Files 6171/e107_themes/fiblack3d/images/bar2edge.gif and 75/e107_themes/fiblack3d/images/bar2edge.gif differ
Files 6171/e107_themes/fiblack3d/images/bar2.gif and 75/e107_themes/fiblack3d/images/bar2.gif differ
Files 6171/e107_themes/fiblack3d/images/bar.jpg and 75/e107_themes/fiblack3d/images/bar.jpg differ
Files 6171/e107_themes/fiblack3d/images/blank.gif and 75/e107_themes/fiblack3d/images/blank.gif differ
Files 6171/e107_themes/fiblack3d/images/bottomleft.png and 75/e107_themes/fiblack3d/images/bottomleft.png differ
Files 6171/e107_themes/fiblack3d/images/bottommiddle.png and 75/e107_themes/fiblack3d/images/bottommiddle.png differ
Files 6171/e107_themes/fiblack3d/images/bottomright.png and 75/e107_themes/fiblack3d/images/bottomright.png differ
Files 6171/e107_themes/fiblack3d/images/bullet1.gif and 75/e107_themes/fiblack3d/images/bullet1.gif differ
Files 6171/e107_themes/fiblack3d/images/bullet2.gif and 75/e107_themes/fiblack3d/images/bullet2.gif differ
Files 6171/e107_themes/fiblack3d/images/bullet3.gif and 75/e107_themes/fiblack3d/images/bullet3.gif differ
Files 6171/e107_themes/fiblack3d/images/button.png and 75/e107_themes/fiblack3d/images/button.png differ
Files 6171/e107_themes/fiblack3d/images/cap1.gif and 75/e107_themes/fiblack3d/images/cap1.gif differ
Files 6171/e107_themes/fiblack3d/images/cap.png and 75/e107_themes/fiblack3d/images/cap.png differ
Files 6171/e107_themes/fiblack3d/images/fcap2.png and 75/e107_themes/fiblack3d/images/fcap2.png differ
Files 6171/e107_themes/fiblack3d/images/fcap.png and 75/e107_themes/fiblack3d/images/fcap.png differ
Files 6171/e107_themes/fiblack3d/images/g_head.gif and 75/e107_themes/fiblack3d/images/g_head.gif differ
Files 6171/e107_themes/fiblack3d/images/header.png and 75/e107_themes/fiblack3d/images/header.png differ
Files 6171/e107_themes/fiblack3d/images/left.png and 75/e107_themes/fiblack3d/images/left.png differ
Files 6171/e107_themes/fiblack3d/images/logo2.png and 75/e107_themes/fiblack3d/images/logo2.png differ
Files 6171/e107_themes/fiblack3d/images/logo.jpg and 75/e107_themes/fiblack3d/images/logo.jpg differ
Files 6171/e107_themes/fiblack3d/images/nforumcaption2.png and 75/e107_themes/fiblack3d/images/nforumcaption2.png differ
Files 6171/e107_themes/fiblack3d/images/nforumcaption.png and 75/e107_themes/fiblack3d/images/nforumcaption.png differ
Files 6171/e107_themes/fiblack3d/images/right.png and 75/e107_themes/fiblack3d/images/right.png differ
Files 6171/e107_themes/fiblack3d/images/sb_template.png and 75/e107_themes/fiblack3d/images/sb_template.png differ
Files 6171/e107_themes/fiblack3d/images/tbbg.png and 75/e107_themes/fiblack3d/images/tbbg.png differ
Files 6171/e107_themes/fiblack3d/images/topleft.png and 75/e107_themes/fiblack3d/images/topleft.png differ
Files 6171/e107_themes/fiblack3d/images/topmiddle.png and 75/e107_themes/fiblack3d/images/topmiddle.png differ
Files 6171/e107_themes/fiblack3d/images/topright.png and 75/e107_themes/fiblack3d/images/topright.png differ
Files 6171/e107_themes/fiblack3d/images/y_head.gif and 75/e107_themes/fiblack3d/images/y_head.gif differ
diff -ruN 6171/e107_themes/fiblack3d/style.css 75/e107_themes/fiblack3d/style.css
--- 6171/e107_themes/fiblack3d/style.css	2004-05-06 14:24:24.000000000 -0500
+++ 75/e107_themes/fiblack3d/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,277 +0,0 @@
-body {
-	font: 11px verdana, tahoma, arial, sans-serif;
-	background-color: #2E2E2E;
-	margin:10px;
-	text-align:left;
-	scrollbar-face-color: #1f1f1f;
-	scrollbar-highlight-color: #1f1f1f; 
-	scrollbar-shadow-color: #000000; 
-	scrollbar-3dlight-color: #6a6a6a; 
-	scrollbar-arrow-color: #fc9b00; 
-	scrollbar-track-color: #2e2e2e; 
-	scrollbar-darkshadow-color: #000000;
-}
-a {
-	color: #D0A700;
-	text-decoration: none;
-}
-a:hover {
-	color: #767676;
-	text-decoration: none;
-}
-.indent{
-	padding: 2px;
-	margin: 5px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #aaa;
-	border: 1px solid;
-	background-color: #565656;
-	border-bottom: #808080 1px solid;
-	border-left: #151515 1px solid;
-	border-right: #808080 1px solid;
-	border-top: #151515 1px solid;
-}
-.smalltext {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#ccc;
-	letter-spacing: -1px;
-}
-.smallblacktext {
-	font: normal 10px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#828282;
-}
-.defaulttext {
-	font: normal 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#ccc;
-}
-
-td {
-	font: normal 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#ccc;
-	padding: 0px, 0px, 0px, 0px;
-	text-align:left;
-}
-
-.mediumtext {
-	font: normal 12px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#aaa;
-}
-.captiontext {
-	font: bold 16px  Arial, Helvetica, Geneva, sans-serif;
-	color:#D0A700;
-}
-.tbox{
-	border-left-color: #545454;
-	border-bottom-color: #545454;
-	font: 11px verdana,arial,helvetica,sans-serif;
-	color: #e7e7e7;
-	border-top-color: #545454;
-	background-color: #303030;
-	border-right-color: #545454;
-	text-indent:2px;
-}
-.button{
-	background: #303030;
-	font: 11px verdana,arial,helvetica,sans-serif;
-	color: #e7e7e7;
-	border-left-color: #545454;
-	border-bottom-color: #545454;
-	border-top-color: #545454;
-	border-right-color: #545454;
-	text-align:center;
-}
-
-.nextprev{
-	background-color: #303030;
-	border: 1px solid #545454;
-	color: #000;
-	font: normal 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	padding : 2px;
-}
-
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding-bottom : 8px;
-	padding-left : 0px;
-	padding-right : 0px;
-	padding-top : 0px;
-}
-hr {
-	border-bottom: #C6D6D6 1px solid;
-	border-top: #006699 1px solid;
-	height: 2px;
-	width: 100%;
-	text-align:center;
-	vertical-align:bottom;
-}
-.border {
-	border: #000 1px solid;
-	background-color: transparent;
-}
-.caption {
-	padding-bottom: 2px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 2px;
-	border-bottom: #000 1px solid;
-	border-left: #707070 1px solid;
-	border-right: #000 1px solid;
-	border-top: #707070 1px solid;
-	background-color: #272727;
-	color: #FF9900;
-	font: 11px tahoma, arial, verdana, helvetica, sans-serif;
-}
-
-.bodytable {
-	background-color: #303030;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font: normal 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #ccc;
-	border-left: 1px solid #707070;
-	border-top: 1px solid #707070;
-	border-bottom: 1px solid #000;
-}
-
-.infobar{
-	padding-bottom: 4px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 2px;
-	border-bottom: #ccc 1px solid;
-	border-left: #fff 1px solid;
-	border-right: #ccc 1px solid;
-	border-top: #fff 1px solid;
-	background-color: #e2e2e2;
-	color: #000;
-	font: 10px tahoma, arial, verdana, helvetica, sans-serif;
-	background-image : url(images/cap1.gif);
-}
-
-
-.maintable {
-	background-color: #fff;
-	border: #98AAB1 2px solid;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font: normal 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #404040;
-}
-
-p {
-	margin-top: 0px
-}
-
-.fborder, .fbdefault{
-	border: #707070 1px solid;
-	background-image: url(images/tbbg.png);
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#ccc;
-	padding: 4px;
-	background-image : url(images/fcap2.png);
-	border: #636363 1px solid;
-}
-
-.forumheader2, .f2default{
-	background-color: #535353;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#aaa;
-	padding: 4px;
-	border: #343434 1px solid;
-}
-
-.forumheader3, .f3default{
-	background-color: #464646;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#aaa;
-	padding: 4px;
-	border: #343434 1px solid;
-}
-
-.fcaption, .fcdefault {
-	border: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(images/fcap.png);
-	color:#fff;
-}
-
-.fcaption2{
-	border: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(images/fcap.png);
-	color:#fff;
-}
-
-.finfobar{
-	background-color: #535353;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #343434 1px solid;
-}
-
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
-
-.helpbox {
-	border: 0px none red;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
-
-
-.captiontopleft{ width: 214px; background-image: url(images/topleft.png); }
-.captiontopmiddle{ width: 100%; background-repeat: repeat-x; background-image: url(images/topmiddle.png); }
-.captiontopright{ width: 15px; background-image: url(images/topright.png); }
-.captionbottomleft{ width: 14px; background-image: url(images/bottomleft.png); }
-.captionbottommiddle{ width: 100%; background-repeat: repeat-x; background-image: url(images/bottommiddle.png);}
-.captionbottomright{ width: 15px; background-image: url(images/bottomright.png); }
-
-.captionleft{ width: 14px; background-repeat: repeat-y; background-image: url(images/left.png); }
-.captionmain{ width: 100%; background-image: url(images/tbbg.png); padding: 4px 5px 5px 4px; font-size: 10px; color: #000; font-family: verdana, tahoma, arial, sans-serif; vertical-align:top; }
-.captionright{ width: 15px; background-repeat: repeat-y; background-image: url(images/right.png); }
-
-.topbar {
-	border-right: #000000 1px solid; border-top: #707070 1px solid; font-size: 10px; background: #1d1c19; border-left: #707070 1px solid; color: #dd6900; border-bottom: #000000 1px solid; white-space: nowrap; height: 23px
-}
-
-.newsspacer {
-	background-color: #464646;
-	border-top: 1px solid #707070;
-	border-left: 1px solid #707070;
-	border-bottom: 1px solid #000;
-	border-right: 1px solid #000;
-	height: 6px;
-}
-
-.clock {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	letter-spacing: -1px;
-	color: #DD6900;
-}
-
-
-.searchhighlight{text-decoration: underline;color:#D0A700;font-weight:bold;}
\ No newline at end of file
diff -ruN 6171/e107_themes/fiblack3d/theme.php 75/e107_themes/fiblack3d/theme.php
--- 6171/e107_themes/fiblack3d/theme.php	2004-08-08 13:16:42.000000000 -0500
+++ 75/e107_themes/fiblack3d/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,252 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "fiblack3d";
-$themeversion = "1.0";
-$themeauthor = "jalist";
-$themedate = "26/08/02";
-$themeinfo = "Based on fiblack3d by xtreme, http://6ig.com";
-
-define("THEME_DISCLAIMER", "<br />fiblack3d theme by jalist ported from original theme by xtreme, <a href='http://6ig.com'>6ig.com</a>, released with permission.");
-
-// [layout]
-$layout = "_default";
-
-$HEADER = 
-"<div class='centre'>
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='captiontopleft'><img src='".THEME."images/blank.gif' width='14' height='23' alt='' style='display: block;' /></td>
-<td class='captiontopmiddle'><img src='".THEME."images/blank.gif' width='1' height='23' alt='' style='display: block;' /></td>
-<td class='captiontopright'><img src='".THEME."images/blank.gif' width='15' height='23' alt='' style='display: block;' /></td>
-</tr>
-
-<tr>
-<td class='captionleft'><img src='".THEME."images/blank.gif' width='14' height='1' alt='' style='display: block;' /></td>
-<td class='captionmain'><img src='".THEME."images/logo2.png' alt='' style='width:100%' /></td>
-<td class='captionright'><img src='".THEME."images/blank.gif' width='15' height='1' alt='' style='display: block;' /></td>
-</tr>
-
-<tr>
-<td class='captionbottomleft'><img src='".THEME."images/blank.gif' width='14' height='26' alt='' style='display: block;' /></td>
-<td class='captionbottommiddle'><img src='".THEME."images/blank.gif' width='1' height='26' alt='' style='display: block;' /></td>
-<td class='captionbottomright'><img src='".THEME."images/blank.gif' width='15' height='26' alt='' style='display: block;' /></td>
-</tr>
-</table>
-
-<table class='topbar' style='width:100%' cellpadding='2' cellspacing='0'>
-<tr>
-<td class='clock' style='width:25%; text-align:left'>&nbsp;
-{SITETAG}
-</td>
-<td style='width:50%; text-align:center'>
-
-{SITELINKS=flat}
-</td>
-<td class='clock' style='width:25%; text-align:right; vertical-align:middle'>
-{CUSTOM=clock}
-&nbsp;
-</td>
-</tr>
-</table>
-
-
-<table cellpadding='0' cellspacing='0'>
-<tr>
-<td class='captiontopleft'><img src='".THEME."images/blank.gif' width='14' height='23' alt='' style='display: block;' /></td>
-<td class='captiontopmiddle'><img src='".THEME."images/blank.gif' width='1' height='23' alt='' style='display: block;' /></td>
-<td class='captiontopright'><img src='".THEME."images/blank.gif' width='15' height='23' alt='' style='display: block;' /></td>
-</tr>
-
-<tr>
-<td class='captionleft'><img src='".THEME."images/blank.gif' width='14' height='1' alt='' style='display: block;' /></td>
-<td class='captionmain'>
-
-<table style='width:100%' cellspacing='8'>
-<tr>
-<td style='width:15%; vertical-align: top'>
-{MENU=1}
-</td>
-<td style='width:70%; vertical-align: top'>";
-
-
-$FOOTER = 
-"<div style='text-align:center' class='smalltext'>
-{SITEDISCLAIMER}
-</div>
-</td>
-<td style='width:15%; vertical-align:top'>
-{MENU=2}
-</td>
-</tr>
-</table>
-
-
-
-</td>
-<td class='captionright'><img src='".THEME."images/blank.gif' width='15' height='1' alt='' style='display: block;' /></td>
-</tr>
-
-<tr>
-<td class='captionbottomleft'><img src='".THEME."images/blank.gif' width='14' height='26' alt='' style='display: block;' /></td>
-<td class='captionbottommiddle'><img src='".THEME."images/blank.gif' width='1' height='26' alt='' style='display: block;' /></td>
-<td class='captionbottomright'><img src='".THEME."images/blank.gif' width='15' height='26' alt='' style='display: block;' /></td>
-</tr>
-</table></div>
-
-
-
-";
-
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-<table style='width:100%' cellpadding='0' cellspacing='0'>
-<tr>
-<td class='caption'>
-
-<table style='width:100%'>
-<tr>
-<td class='captiontext' style='width:80%; text-align:left'>
-{NEWSTITLE}
-</td>
-<td style='width:20%; text-align:right'>
-{EMAILICON}
- | 
-{PRINTICON}
-</td>
-</tr>
-</table>
-
-</td>
-</tr>
-
-<tr>
-<td class='bodytable'>
-{NEWSBODY}
-{EXTENDED}
-</td>
-
-
-
-</tr>
-<tr>
-<td class='newsspacer'><img src='".THEME."images/blank.gif' alt='' /></td>
-</tr>
-<tr>
-<td class='caption'>
-<div style='text-align:center' class='smalltext'>
-Posted by:
-{NEWSAUTHOR}
-on
-{NEWSDATE}
- | 
-{NEWSCOMMENTS}
-</div>
-</td>
-</tr>
-</table>
-
-
-<br />";
-
-define("ICONSTYLE", "float: left; border:0");
-define("COMMENTLINK", "comments: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-
-define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
-define("EXTENDEDSTRING", "Read the rest ...");
-define("POST_EXTENDEDSTRING", " ]<br />");
-
-
-// [linkstyle]
-
-define(PRELINK, "<img src='".THEME."images/bullet3.gif' alt='' />&nbsp;");
-define(POSTLINK, "");
-define(LINKSTART, "");
-define(LINKEND, "<img src='".THEME."images/bullet3.gif' alt='' />&nbsp;");
-define(LINKALIGN, "center");
-
-
-//	[tablestyle]
-function tablestyle($caption, $text, $mode=""){
-	echo "<div class='spacer'>";
-	if($caption != ""){
-		echo "<div class='border'><div class='caption'><b>".$caption."</b></div>\n";
-		if($text != ""){
-			echo "\n<div class='bodytable'>".$text."</div>\n";
-		}
-		echo "</div>";
-	}else{
-		echo "<div class='border'><div class='bodytable'>".$text."</div></div><br />\n";
-	}
-	echo "</div>";
-}
-
-// [commentstyle]
-
-$COMMENTSTYLE = "
-<div style='text-align:center'>
-<table style='width:100%'>
-<tr>
-<td colspan='2' class='forumheader3'>
-{SUBJECT}
-<b>
-{USERNAME}
-</b>
- | 
- {TIMEDATE}
-</td>
-</tr>
-<tr>
-<td style='width:30%; vertical-align:top'>
-<div class='spacer'>
-{AVATAR}
-</div>
-<span class='smalltext'>
-{LEVEL}
-{COMMENTS}
-<br />
-{JOINED}
-<br />
-{REPLY}
-</span>
-</td>
-<td style='width:70%; vertical-align:top'>
-{COMMENT}
-</td>
-</tr>
-</table>
-</div>
-<br />";
-
-//	[chatboxstyle]
-
-$CHATBOXSTYLE = "
-<span class='defaulttext'><b>{USERNAME}</b></span>
-<span class='smalltext'>on {TIMEDATE}</span><br />
-<div class='defaulttext' style='text-align:left'>
-{MESSAGE}
-</div>
-<br />
-";
-
-
-
-
-
-?>
\ No newline at end of file
Files 6171/e107_themes/human_condition/images/bg.png and 75/e107_themes/human_condition/images/bg.png differ
Files 6171/e107_themes/human_condition/images/bullet2.gif and 75/e107_themes/human_condition/images/bullet2.gif differ
Files 6171/e107_themes/human_condition/images/bullet2.png and 75/e107_themes/human_condition/images/bullet2.png differ
Files 6171/e107_themes/human_condition/images/bullet.png and 75/e107_themes/human_condition/images/bullet.png differ
Files 6171/e107_themes/human_condition/images/comment.png and 75/e107_themes/human_condition/images/comment.png differ
Files 6171/e107_themes/human_condition/images/footer.png and 75/e107_themes/human_condition/images/footer.png differ
Files 6171/e107_themes/human_condition/images/header.png and 75/e107_themes/human_condition/images/header.png differ
Files 6171/e107_themes/human_condition/images/titlebar.png and 75/e107_themes/human_condition/images/titlebar.png differ
diff -ruN 6171/e107_themes/human_condition/languages/English.php 75/e107_themes/human_condition/languages/English.php
--- 6171/e107_themes/human_condition/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/human_condition/languages/English.php	2005-03-21 05:13:49.000000000 -0600
@@ -0,0 +1,28 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/human_condition/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/03/21 11:13:49 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "'Human Condition' by <a href='http://e107.org' rel='external'>jalist</a>, based on the Wordpress theme, <a href='http://wordpress.org'>http://wordpress.org</a>.");
+define("LAN_THEME_2", "Comments are turned off for this item");
+define("LAN_THEME_3", "comment(s): ");
+define("LAN_THEME_4", "Read the rest ...");
+define("LAN_THEME_5", "Trackbacks: ");
+define("LAN_THEME_6", "Comment by");
+
+
+?>
diff -ruN 6171/e107_themes/human_condition/newforumpost.php 75/e107_themes/human_condition/newforumpost.php
--- 6171/e107_themes/human_condition/newforumpost.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/human_condition/newforumpost.php	2006-01-13 07:27:22.000000000 -0600
@@ -0,0 +1,30 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/human_condition/newforumpost.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2006/01/13 13:27:22 $
+|     $Author: lisa_ $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$NEWFORUMPOSTSTYLE_HEADER = "
+<!-- newforumposts -->\n<ul type='square'>\n";
+
+$NEWFORUMPOSTSTYLE_MAIN = "<li><span class='smalltext'>{THREAD} ".NFPM_LAN_7." {POSTER} [ ".NFPM_LAN_3.": {VIEWS}, ".NFPM_LAN_4.": {REPLIES}, ".NFPM_LAN_5.": {LASTPOST} ]\n</span>\n</li>\n";
+
+$NEWFORUMPOSTSTYLE_FOOTER = "<br /><br />\n</ul><span class='smalltext'>".NFPM_LAN_6.": <b>{TOTAL_TOPICS}</b> | ".NFPM_LAN_4.": <b>{TOTAL_REPLIES}</b> | ".NFPM_LAN_3.": <b>{TOTAL_VIEWS}</b></span>";
+
+
+?>
\ No newline at end of file
Files 6171/e107_themes/human_condition/preview.jpg and 75/e107_themes/human_condition/preview.jpg differ
diff -ruN 6171/e107_themes/human_condition/style.css 75/e107_themes/human_condition/style.css
--- 6171/e107_themes/human_condition/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/human_condition/style.css	2005-03-21 05:13:48.000000000 -0600
@@ -0,0 +1,418 @@
+body, html {
+	margin: 0 auto;
+	background: #E4F2FF url(images/bg.png) repeat-y center;
+	width: 767px;
+	font-family: Lucida Grande, Lucida Sans Unicode, Lucida, Helvetica, Verdana, Arial, Sans-serif;
+	text-align: center;
+}
+
+a:link {
+	color: #3F729E;
+	text-decoration: none;
+	page-break-after: always;
+}
+
+a:visited {
+	color: #093860;
+	text-decoration: none;
+}
+
+a:hover, a:active {
+	color: #093860;
+}
+
+#rap { 
+  	margin-left: auto;
+  	margin-right: auto;
+  	width: 749px; 
+} 
+	
+#header {
+	background: url(images/header.png) repeat-x;
+	height: 80px;
+	width: 747px;
+	margin: 0 auto;
+	text-align: left;
+}
+	
+#header a {
+	text-decoration: none;
+	font-size: 18pt;
+	position: relative;
+	top: 45px;
+	left: 10px;
+	font-family: verdana, arial, helvetica, geneva, sans-serif;
+}
+	
+#header a:visited {
+	color: #3F729E;
+}
+	
+#header a:hover {
+	color: #093860;
+}
+
+.wrapper { 
+	width: 100%;
+	margin-left: auto;
+  	margin-right: auto;
+}
+
+#menu {
+	width: 170px;
+	margin-left: 575px; 
+	text-align: left;
+	margin-top: 7px;
+	margin-bottom: 20px;
+}
+
+#menu a {
+	text-decoration: none;
+	font-family: verdana, arial, helvetica, geneva, sans-serif;
+}
+	
+#menu a:visited {
+	color: #3F729E;
+}
+	
+#menu a:hover {
+	color: #093860;
+}
+
+#menu input, textarea {
+	font-family: verdana, arial, helvetica, geneva, sans-serif;
+	font-size: .9em;
+	font-weight: normal;
+}
+
+ul, ol {
+	margin-top: 0;
+	margin-bottom: 0;
+}
+
+.tbox.chatbox {
+	width: 80%;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.menubox {
+	color: #242424;
+	font-family: Lucida Grande, Lucida Sans Unicode, Lucida, Helvetica, Verdana, Arial, Sans-serif;
+	font-size: 8pt;
+	margin-top: 15px;
+	padding: 5px;
+	border: 1px solid #D7D7D7; 
+	background: #EAEAEA;
+	width: 150px;
+/*	margin-left: 20px;*/
+}
+
+.post {
+	width: 540px;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	float: left;
+	padding: 10px;
+	text-align: left;
+}
+
+.textstyle1 {
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #888;
+}
+
+.textstyle2 {
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+
+.textstyle4 {
+	font-size: 13px;
+	margin: 5px 0 0 0;
+}
+	
+.textstyle4 a:link {
+	color: #000;
+}
+	
+.textstyle4 a:visited {
+	color: #000;
+	text-decoration: none;
+}
+
+.textstyle4 a:hover, a:active {
+	color: #093860;
+}
+
+.post .textstyle3 {
+	font-size: 10px;
+	border-left: 1px solid #ddd;
+	padding-left: 5px;
+	text-align: justify;
+	}
+	
+.textstyle3 a:hover {
+	background: #EFF8FF;
+}
+
+.postinfo {
+	font-size: 9px;
+	width: 541px;
+	background: #eee;
+	padding: 2px 0 2px 2px;
+}
+
+.postinfo a:link {
+	color: #606060;
+}
+
+.postinfo a:hover {
+	color: #093860;
+}
+
+
+#titlebar2{
+	width: 500px;
+	font-size: .7em;
+}
+
+#sitedisclaimer {
+	clear: both;
+	width: 747px;
+	margin: 0 auto;
+	font-size: .6em;
+	line-height: 2.4em;
+	text-align: center;
+}
+
+.date {
+	width: 543px;
+	font-size: .8em;
+	background: url(images/titlebar.png) no-repeat;
+	height: 23px;
+	margin: 0;
+	padding-top: 4px;
+	padding-left: 5px;
+	color: #0E2E4A;
+}
+
+.smalltext {
+    background: none;
+	font-family: tahoma, verdana, arial, helvetica, sans-serif;
+	font-size: 9px;
+	font-style: normal;
+	color:#5d6e75;
+}
+.smallblacktext {
+    background: none;
+	font-family: tahoma, verdana, arial, helvetica, sans-serif;
+	font-size: 10px;
+	font-style: normal;
+	color:#000;
+}
+.indent{
+	padding: 10px 10px 10px 10px;
+	margin: 5px;
+	font: 9px verdana, tahoma, arial, sans-serif;
+	color: #000060;
+	border: 1px solid #cfcdcd;
+	background-color: #efefef;
+}
+.defaulttext {
+    background: none;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 10px;
+	font-style: normal;
+	color:#000;
+}
+
+td {
+    background: none;
+	font-family: tahoma, verdana, arial, helvetica, sans-serif;
+	font-size: 11px;
+	font-style: normal;
+	color:#5d6e75;
+	padding-bottom: 0px;
+	padding-left: 0px;
+	padding-right: 0px;
+	padding-top: 0px;
+	text-align:left;
+}
+
+blockquote {
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-style: italic;
+	color:#7e96ac;
+}
+.mediumtext {
+    background: none;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 11px;
+	font-style: normal;
+	color:#000;
+}
+.captiontext {
+    background: none;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 18px;
+	color:#000080;
+}
+.tbox{
+	background-color: #F4F7FA;
+	border-bottom: #5e5d63 1px solid;
+	border-left: #5e5d63 1px solid;
+	border-right: #5e5d63 1px solid;
+	border-top: #5e5d63 1px solid;
+	color: #000000;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 10px;
+}
+.button{
+	color: #fff;
+	font-family: tahoma, verdana, arial, helvetica, sans-serif;
+	font-size: 10px;
+	text-align:center;
+	background-color: #4F5974;
+	border-bottom: #333A4B 1px solid;
+	border-left: #7180A6 1px solid;
+	border-right: #333A4B 1px solid;
+	border-top: #7180A6 1px solid;
+	letter-spacing: 0.1em;
+	cursor:pointer 
+}
+
+.button a{
+	color: #FFF;
+	}
+.button a:hover{
+	color: #CFCFDF;
+	text-decoration: none;
+}
+
+.nextprev{
+	width: 535px;
+	font-size: .8em;
+	background: url(images/titlebar.png) no-repeat;
+	height: 23px;
+	margin: 0;
+	padding-top: 6px;
+	padding-left: 5px;
+	color: #0E2E4A;
+	padding-right: 10px;
+}
+
+form {
+	margin: 2px 0px 0px 0px;
+}
+.spacer{
+	padding-bottom : 2px;
+	padding-left : 0px;
+	padding-right : 0px;
+	padding-top : 2px;
+}
+hr {
+	border-top: #666 1px solid;
+	border-bottom: #eee 1px solid;
+	height: 2px;
+	width: 92%;
+	text-align:center;
+	border-style: dotted;
+}
+.border {
+	border: #999 1px solid;
+	background-color: #F0F1F1;
+	padding: 2px;
+}
+
+.bodytable {
+	padding: 2px;
+	background-color: transparent;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 10px;
+	font-style: normal;
+	color: #000;
+}
+
+p {
+	margin-top: 0px
+}
+
+.fborder {
+	border: 1px solid #c3bdbd;
+	background-color: #fff;
+	
+}
+.forumheader{
+	background-color: #EBEFF2;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 11px;
+	color:#000;
+	padding: 4px;
+	background-image : url('../e107_images/forum/fcap2.png');
+	border: 1px solid #C3BDBD;
+}
+
+.forumheader2{
+	background-color: #EFEFEF;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 14px;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+}
+
+.forumheader3{
+	background-color: #eaeaea;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 11px;
+	color:#000;
+	padding: 4px;
+	border: #c3bdbd 1px solid;
+}
+
+.forumborder{
+	border-bottom: #000080 1px solid;
+	border-left: #000080 1px solid;
+	border-right: #000080 1px solid;
+	border-top: #000080 1px solid;
+	background-color: transparent;
+}
+
+.fcaption {
+	border: #c3bdbd 1px solid;
+	padding-bottom: 2px;
+	padding-left: 8px;
+	padding-right: 0px;
+	padding-top: 2px;
+	background-color: #dcdada;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 12px;
+	color:#616060;
+}
+
+.topbar {
+	background-image : url('images/topbar.png');
+}
+.leftbar {
+	background-image : url('images/leftbar.png');
+}
+
+.finfobar{
+	background-color: #CCC8C8;
+	color:#000;
+	padding: 4px;
+	border: 1px solid #C3BDBD;
+	background-image : url('../e107_images/forum/finfobar.png');font-style:normal; font-variant:normal; font-weight:normal; font-size:11px; font-family:verdana, tahoma, arial, helvetica, sans-serif
+}
+
+a.forumlink{
+	color: #616060;
+	text-decoration: underline;
+}
+
+.helpbox {
+	border: 0px none red;
+	background-color: transparent;
+	color:#000;
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/human_condition/theme.php 75/e107_themes/human_condition/theme.php
--- 6171/e107_themes/human_condition/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/human_condition/theme.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,188 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/human_condition/theme.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+@include_once(e_THEME."human_condition/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."human_condition/languages/English.php");
+
+// [theme]
+$themename = "human condition";
+$themeversion = "1.0";
+$themeauthor = "Steve Dunstan [jalist]";
+$themeemail = "jalist@e107.org";
+$themewebsite = "http://e107.org";
+$themedate = "19/01/2005";
+$themeinfo = "based on the Wordpress theme, <a href='http://wordpress.org'>http://wordpress.org</a>";
+define("STANDARDS_MODE", TRUE);
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+define("IMODE", "lite");
+define("THEME_DISCLAIMER", "<br /><br /><i>".LAN_THEME_1."</i>");
+
+// [layout]
+
+$layout = "_default";
+
+$HEADER = "
+<div id='rap'>
+<h1 id='header'><a href='#' title='e107 v0.7'>".$pref['sitename']."</a></h1>
+<div class='post'>
+{SETSTYLE=post}
+";
+
+
+$FOOTER = "
+{SETSTYLE=default}
+</div>
+<div id='menu'>
+{SITELINKS}
+{MENU=1}
+<br /><hr /><span class='smalltext'>{SITEDISCLAIMER}<br />{THEME_DISCLAIMER}</span>
+</div>
+</div>
+
+";
+
+define("TP_commenticon", "<img src='".THEME_ABS."images/comment.png' alt='' style='vertical-align:middle;' />");
+
+$NEWSSTYLE = "
+<div class='textstyle4'>{STICKY_ICON}<b>{NEWSTITLE}</b></div>
+<div class='postinfo'>{NEWSCATEGORY}: {NEWSAUTHOR} @ {NEWSDATE}</div>
+<div class='textstyle3'>{NEWSBODY}</div>
+<div class='postinfo'>".TP_commenticon." {NEWSCOMMENTS}{TRACKBACK}</div>\n<br />\n";
+define("TRACKBACKSTRING", LAN_THEME_5);
+define("TRACKBACKBEFORESTRING", " | ");
+
+
+define("DATEHEADERCLASS", "button");
+//	define("DATEHEADERCLASS", "nextprev");	// uncomment this line for a different style of news date header
+
+define("ICONSTYLE", "float: left; border:0");
+define("COMMENTLINK", LAN_THEME_3);
+define("COMMENTOFFSTRING", LAN_THEME_2);
+
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", LAN_THEME_4);
+define("POST_EXTENDEDSTRING", " ]<br />");
+
+
+// [linkstyle]
+
+define(PRELINK, "");
+define(POSTLINK, "");
+define(LINKSTART, "<span><img src='".THEME_ABS."images/bullet2.gif' alt='bullet' /> ");
+define(LINKSTART_HILITE, "<span style='font-weight:bold'><img src='".THEME_ABS."images/bullet2.png' alt='bullet' /> ");
+define(LINKEND, "</span><br />");
+define(LINKDISPLAY, 2);                        // 1 - along top, 2 - in left or right column
+define(LINKALIGN, "left");
+
+
+//        [tablestyle]
+
+function tablestyle($caption, $text, $mode="")
+{
+	global $style;
+
+	if($style == "post")
+	{
+
+		if(!$caption)
+		{
+			echo "<div class='spacer'>$text</div>\n";
+		}
+		else if(!$text)
+		{
+			echo "<div class='spacer'><div class='date'>$caption</div></div>\n";
+		}
+		else
+		{
+			echo "<div class='spacer'><div class='date'>$caption</div>\n$text\n</div>\n";
+		}
+	}
+	else
+	{
+		if(!$caption)
+		{
+			echo "<div class='spacer'>$text</div>\n";
+		}
+
+		else if(!$text)
+		{
+			echo "<div class='spacer'>$caption</div>\n";
+		}
+		else
+		{
+			echo "<div class='spacer'><div class='menubox'><b>$caption</b><br />$text</div></div>";
+		}
+	}
+}
+
+$COMMENTSTYLE = "
+<table style='width:100%'>
+<tr>
+<td colspan='2' class='forumheader3'>
+{SUBJECT}
+<b>
+{USERNAME}
+</b>
+|
+{TIMEDATE}
+</td>
+</tr>
+<tr>
+<td style='width:30%; vertical-align:top'>
+<div class='spacer'>
+{AVATAR}
+</div>
+<span class='smalltext'>
+{COMMENTS}
+<br />
+{JOINED}
+</span>
+<br/>
+{REPLY}
+</td>
+<td style='width:70%; vertical-align:top'>
+{COMMENT} {COMMENTEDIT}
+</td>
+</tr>
+</table>
+<br />";
+
+$POLLSTYLE = <<< EOF
+<b>Poll:</b> {QUESTION}
+<br /><br />
+{OPTIONS=<div class='alttd8'>OPTION</div>BAR<br /><span class='smalltext'>PERCENTAGE VOTES</span><br />\n}
+<br /><div style='text-align:center' class='smalltext'>{AUTHOR}<br />{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</div>
+EOF;
+
+$CHATBOXSTYLE = "
+<img src='".THEME_ABS."images/bullet2.gif' alt='bullet' />
+<b>{USERNAME}</b><br />{TIMEDATE}
+<div class='smalltext'>
+{MESSAGE}
+</div>
+<br />";
+
+?>
\ No newline at end of file
Files 6171/e107_themes/interfectus/images/background.jpg and 75/e107_themes/interfectus/images/background.jpg differ
Files 6171/e107_themes/interfectus/images/barl.png and 75/e107_themes/interfectus/images/barl.png differ
Files 6171/e107_themes/interfectus/images/bar.png and 75/e107_themes/interfectus/images/bar.png differ
Files 6171/e107_themes/interfectus/images/barr.png and 75/e107_themes/interfectus/images/barr.png differ
Files 6171/e107_themes/interfectus/images/blank.gif and 75/e107_themes/interfectus/images/blank.gif differ
Files 6171/e107_themes/interfectus/images/bottomcol.png and 75/e107_themes/interfectus/images/bottomcol.png differ
Files 6171/e107_themes/interfectus/images/bottomleftcol.png and 75/e107_themes/interfectus/images/bottomleftcol.png differ
Files 6171/e107_themes/interfectus/images/bottomrightcol.png and 75/e107_themes/interfectus/images/bottomrightcol.png differ
Files 6171/e107_themes/interfectus/images/bullet1.gif and 75/e107_themes/interfectus/images/bullet1.gif differ
Files 6171/e107_themes/interfectus/images/bullet2.gif and 75/e107_themes/interfectus/images/bullet2.gif differ
Files 6171/e107_themes/interfectus/images/button.png and 75/e107_themes/interfectus/images/button.png differ
Files 6171/e107_themes/interfectus/images/cap1.png and 75/e107_themes/interfectus/images/cap1.png differ
Files 6171/e107_themes/interfectus/images/caption.png and 75/e107_themes/interfectus/images/caption.png differ
Files 6171/e107_themes/interfectus/images/fcap2.png and 75/e107_themes/interfectus/images/fcap2.png differ
Files 6171/e107_themes/interfectus/images/fcap.png and 75/e107_themes/interfectus/images/fcap.png differ
Files 6171/e107_themes/interfectus/images/footer.png and 75/e107_themes/interfectus/images/footer.png differ
Files 6171/e107_themes/interfectus/images/header.png and 75/e107_themes/interfectus/images/header.png differ
Files 6171/e107_themes/interfectus/images/leftcol.png and 75/e107_themes/interfectus/images/leftcol.png differ
Files 6171/e107_themes/interfectus/images/link1.png and 75/e107_themes/interfectus/images/link1.png differ
Files 6171/e107_themes/interfectus/images/link2.png and 75/e107_themes/interfectus/images/link2.png differ
Files 6171/e107_themes/interfectus/images/menubottom2.png and 75/e107_themes/interfectus/images/menubottom2.png differ
Files 6171/e107_themes/interfectus/images/menubottom.png and 75/e107_themes/interfectus/images/menubottom.png differ
Files 6171/e107_themes/interfectus/images/menutop2.png and 75/e107_themes/interfectus/images/menutop2.png differ
Files 6171/e107_themes/interfectus/images/menutop.png and 75/e107_themes/interfectus/images/menutop.png differ
Files 6171/e107_themes/interfectus/images/pagefooter.png and 75/e107_themes/interfectus/images/pagefooter.png differ
Files 6171/e107_themes/interfectus/images/pageheader.png and 75/e107_themes/interfectus/images/pageheader.png differ
Files 6171/e107_themes/interfectus/images/rightcol.png and 75/e107_themes/interfectus/images/rightcol.png differ
Files 6171/e107_themes/interfectus/images/search.png and 75/e107_themes/interfectus/images/search.png differ
Files 6171/e107_themes/interfectus/images/topleftcol.png and 75/e107_themes/interfectus/images/topleftcol.png differ
Files 6171/e107_themes/interfectus/images/toprightcol.png and 75/e107_themes/interfectus/images/toprightcol.png differ
diff -ruN 6171/e107_themes/interfectus/languages/English.php 75/e107_themes/interfectus/languages/English.php
--- 6171/e107_themes/interfectus/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/interfectus/languages/English.php	2005-03-21 05:27:11.000000000 -0600
@@ -0,0 +1,26 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/interfectus/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/03/21 11:27:11 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "'interfectus' by <a href='http://e107.org' rel='external'>jalist</a>");
+define("LAN_THEME_2", "Read/Post Comment: ");
+define("LAN_THEME_3", "Comments are turned off for this item");
+define("LAN_THEME_4", "Read the rest ...");
+define("LAN_THEME_5", "Trackbacks: ");
+
+?>
Files 6171/e107_themes/interfectus/preview.jpg and 75/e107_themes/interfectus/preview.jpg differ
diff -ruN 6171/e107_themes/interfectus/style.css 75/e107_themes/interfectus/style.css
--- 6171/e107_themes/interfectus/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/interfectus/style.css	2005-03-21 05:26:42.000000000 -0600
@@ -0,0 +1,428 @@
+
+
+body {
+	background-image: url(images/background.jpg); color: #ffffff; background-color: #333333; text-align: left; font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; color: #555; margin: 12px 0 0 0;
+}
+
+.maintable {
+	width: 759px;
+	margin-left: auto;
+	margin-right: auto;
+	text-align: center;
+}
+
+#logo {
+	background-image: url(images/header.png);
+	width: 759px;
+	height: 108px;
+}
+
+#sitename {
+	margin-left: 24px;
+	margin-top: 50px;
+	text-align: left;
+	font: 10pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #ffb432;
+}
+
+#infoleft {
+	width: 365px;
+	text-align: left;
+	background-color: #000;
+}
+
+#inforight {
+	width: 366px;
+	text-align: right;
+	background-color: #000;
+}
+
+.padder {
+	padding: 0 4px 0 4px;
+}
+
+.spacer{
+	padding: 2px 0px 2px 0px;
+}
+
+ul, ol {
+	margin-top: 0;
+	margin-bottom: 0;
+}
+
+
+
+
+
+
+
+#collefttop {
+	background-image: url(images/topleftcol.png);
+	width: 14px;
+	height: 34px;
+}
+
+#colrighttop {
+	background-image: url(images/toprightcol.png);
+	width: 14px;
+	height: 34px;
+}
+
+#colleft {
+	background-image: url(images/leftcol.png);
+	width: 14px;
+	height: 100%;
+	background-repeat: repeat-y;
+}
+
+#colright {
+	background-image: url(images/rightcol.png);
+	width: 14px;
+	height: 100%;
+	background-repeat: repeat-y;
+}
+
+.button {
+	border: 1px solid #000;
+	color: #000;
+	font: 7pt verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	background-image : url(images/button.png);
+}
+
+.cbdate {
+	color: #686868;
+}
+
+#colbotleft {
+	background-image: url(images/bottomleftcol.png);
+	width: 14px;
+	height: 14px;
+}
+
+#colbot {
+	background-image: url(images/bottomcol.png);
+	height: 14px;
+	width: 100%;
+	background-repeat: repeat-x;
+}
+
+#colbotright {
+	background-image: url(images/bottomrightcol.png);
+	width: 14px;
+	height: 14px;
+}
+
+
+
+#contentarea {
+	background-color: #000;
+	width: 599px;
+	font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #ffb432;
+	vertical-align:top;
+}
+
+#fullcontentarea {
+	background-color: #000;
+	width: 759px;
+	font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #ffb432;
+	vertical-align:top;
+}
+
+#menuarea {
+	background-color: #000;
+	width: 160px;
+	font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #ffb432;
+	vertical-align:top;
+	text-align: left;
+}
+
+.tablewrapper {
+	width: 100%;
+}
+
+.searchbar {
+	background-color: #000;
+	margin-left: auto;
+	margin-right: auto;
+	text-align: center;
+}
+
+
+/* menu definitions */
+
+.menutable{
+	width: 160px;
+}
+
+.menuwrapper {
+	width: 160px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.menutop {
+	background-image: url(images/menutop.png);
+	width: 100%;
+	background-repeat: repeat-x;
+	height: 5px;
+}
+
+.menubody {
+	background-color: #3e3e3e;
+	width: 100%;
+	font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #bbb;
+	vertical-align:top;
+	text-align: left;
+}
+
+.menubottom {
+	background-image: url(images/menubottom.png);
+	width: 100%;
+	background-repeat: repeat-x;
+	height: 12px;
+}
+
+.menutop2 {
+	background-image: url(images/menutop2.png);
+	width: 100%;
+	background-repeat: repeat-x;
+	height: 5px;
+}
+
+.menubody2 {
+	background-color: #3e3e3e;
+	width: 100%;
+	font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #ffb432;
+	padding: 4px 5px 5px 4px;
+	vertical-align:top;
+	text-align: left;
+}
+
+.menubottom2 {
+	background-image: url(images/menubottom2.png);
+	width: 100%;
+	background-repeat: repeat-x;
+	height: 12px;
+}
+
+/* end menu layout */
+
+img {
+	vertical-align: middle;
+}
+
+.smalltext {
+	font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+}
+
+.pageheader {
+	background-image: url(images/pageheader.png);
+	width: 100%;
+	background-repeat: repeat-x;
+	height: 25px;
+}
+
+.pagebody {
+	background-color: #333;
+	width: 100%;
+	font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #ddd;
+	padding: 4px 5px 5px 4px;
+	vertical-align:top;
+	text-align: left;
+}
+
+.pagefooter {
+	background-image: url(images/pagefooter.png);
+	width: 100%;
+	background-repeat: repeat-x;
+	height: 14px;
+}
+
+
+a {
+	color: #999; 
+	text-decoration: none;
+}
+a:hover {
+	color: #ddd;
+	text-decoration: underline;
+}
+
+a.link2:link {
+	color: #999; 
+	text-decoration: none;
+}
+
+a.link2:hover {
+	color: #ffb432;
+	text-decoration: none;
+}
+
+
+/* captions */
+
+.caption {
+	background-image: url(images/cap1.png);
+	width: 100%;
+	background-repeat: repeat-x;
+	height: 16px;
+	font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	font-weight: bold;
+	color: #fff;
+}
+
+.captionpadder {
+	 padding: 2px 0 0 4px;
+}
+
+.captiontext {
+	font: 9pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #ffb432;
+}
+
+
+.testborder {
+	border: 1px solid red;
+}
+
+.link1 {
+	background-image: url(images/link1.png);
+	background-repeat: no-repeat;
+	width: 159%;
+	height: 21px;
+	font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #fff;
+	padding-left: 4px;
+}
+
+.link2 {
+	background-image: url(images/link2.png);
+	background-repeat: no-repeat;
+	width: 159%;
+	height: 21px;
+	font: 7pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #fff;
+	padding-left: 4px;
+}
+
+.linktext {
+	padding-top: 6px;
+}
+
+
+form {
+	margin: 2px 0px 0px 0px;
+}
+
+p {
+	margin: 0px;
+}
+
+
+
+
+
+
+.tbox {
+	background-color: #000;
+	border: 1px solid #3e3e3e;
+	font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; color: #777;
+}
+
+.tbox.search {
+	background-color: #000;
+	border: 1px solid #3e3e3e;
+	font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+	color: #ccc;
+}
+
+.tbox.chatbox {
+	width: 80%;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.helpbox {
+	color:#aaa;
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	border: 0px none red;
+	background-color: transparent;
+}
+
+
+/* forum */
+
+.fborder {
+	border: #1d1d1d 1px solid;
+}
+.forumheader{
+	background-color: #333;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#ffa939;
+	padding: 4px;
+	
+	border: 1px solid #1d1d1d;
+	text-align: left;
+}
+
+.forumheader2{
+	background-color: #333;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#9f9f9f;
+	padding: 4px;
+	border: #2a2a2a 1px solid;
+	text-align: left;
+}
+
+.forumheader3{
+	background-color: #333;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#9f9f9f;
+	padding: 4px;
+	border: #2a2a2a 1px solid;
+	text-align: left;
+}
+
+.forumborder{
+	border: #000080 1px solid;
+}
+
+.fcaption {
+	background-image : url(images/fcap.png);
+	border: 1px solid #1d1d1d;
+	padding: 2px 0 2px 0;
+	background-color: #f9fafb;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#ffa939;
+	text-align: left;
+}
+
+.finfobar{
+	background-color: #393939;
+	color:#000;
+	padding: 4px;
+	border: 1px solid #2a2a2a;
+	font-size: 7pt; font-family:verdana, tahoma, arial, helvetica, sans-serif;
+	text-align: left;
+}
+
+.smallblacktext {
+	font: 10px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#b47716;
+}
+
+td {
+	text-align: left;
+}
+
+.nextprev {
+	font: 7pt tahoma, verdana, arial, helvetica, sans-serif;
+	color:#b47716;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/interfectus/theme.php 75/e107_themes/interfectus/theme.php
--- 6171/e107_themes/interfectus/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/interfectus/theme.php	2005-12-29 20:18:44.000000000 -0600
@@ -0,0 +1,296 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/interfectus/theme.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2005/12/30 02:18:44 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+@include_once(e_THEME."interfectus/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."interfectus/languages/English.php");
+
+// [theme]
+$themename = "interfectus";
+$themeversion = "1.0";
+$themeauthor = "Steve Dunstan [jalist]";
+$themeemail = "jalist@e107.org";
+$themewebsite = "http://e107.org";
+$themedate = "16/03/2005";
+$themeinfo = "Dark theme suitable for gaming / clan sites.";
+define("STANDARDS_MODE", TRUE);
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+
+define("THEME_DISCLAIMER", "<br /><i>".LAN_THEME_1."</i>");
+define("IMODE", "dark");
+
+// [layout]
+
+$layout = "_default";
+
+$HEADER = "
+<table class='maintable' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='logo'><div id='sitename'>[ <a href='".e_HTTP."index.php'>{SITENAME}</a> ]</div></td>
+</tr>
+</table>
+<table class='maintable' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='collefttop'></td>
+<td id='infoleft'>
+<div class='padder'>
+{CUSTOM=search+".THEME_ABS."images/search.png}
+</div>
+</td>
+<td id='inforight'>
+<div class='padder'>
+{CUSTOM=clock}
+</div>
+</td>
+<td id='colrighttop'></td>
+</tr>
+</table>
+<table class='maintable' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='colleft'></td>
+<td>
+<table class='tablewrapper' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='contentarea'>
+<div class='padder'>
+<table class='tablewrapper' cellpadding='0' cellspacing='0'>
+<tr><td class='pageheader'></td></tr>
+<tr><td class='pagebody'>
+{SETSTYLE=main}
+
+";
+
+$FOOTER = "
+</td></tr>
+<tr><td class='pagefooter'></td></tr>
+</table>
+</div>
+</td>
+<td id='menuarea'>
+<table class='menutable' cellpadding='0' cellspacing='0'>
+<tr>
+<td class='menutop'></td>
+</tr>
+<tr>
+<td class='menubody'>
+<div class='menuwrapper'>
+{SETSTYLE=menu1}
+{SITELINKS}
+{MENU=1}
+</div>
+</td>
+</tr>
+<tr>
+<td class='menubottom'></td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+</td>
+<td id='colright'></td>
+</tr>
+</table>
+<table class='maintable' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='colbotleft'><img src='".THEME_ABS."images/blank.gif' width='14' height='14' alt='' style='display: block;' /></td>
+<td id='colbot'></td>
+<td id='colbotright'><img src='".THEME_ABS."images/blank.gif' width='14' height='14' alt='' style='display: block;' /></td>
+</tr>
+</table>
+
+<div class='smalltext' style='text-align: center;'>{SITEDISCLAIMER}<br />{THEMEDISCLAIMER}</div>
+
+";
+
+
+/*
+<table class='menutable' cellpadding='0' cellspacing='0'>
+<tr>
+<td class='menutop2'></td>
+</tr>
+<tr>
+<td class='menubody2'>
+<div class='menuwrapper'>
+{PLUGIN=other_news_menu/other_news2_menu}
+</div>
+</td>
+</tr>
+<tr>
+<td class='menubottom2'></td>
+</tr>
+</table>
+*/
+
+
+$CUSTOMHEADER = "
+<table class='maintable' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='logo'><div id='sitename'>[ <a href='".e_HTTP."index.php'>{SITENAME}</a> ]</div></td>
+</tr>
+</table>
+<table class='maintable' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='collefttop'></td>
+<td id='infoleft'>
+<div class='padder'>
+{CUSTOM=search+".THEME_ABS."images/search.png}
+</div>
+</td>
+<td id='inforight'>
+<div class='padder'>
+{CUSTOM=clock}
+</div>
+</td>
+<td id='colrighttop'></td>
+</tr>
+</table>
+<table class='maintable' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='colleft'></td>
+<td>
+<table class='tablewrapper' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='fullcontentarea'>
+<div class='padder'>
+<table class='tablewrapper' cellpadding='0' cellspacing='0'>
+<tr><td class='pageheader'></td></tr>
+<tr><td class='pagebody'>
+{SETSTYLE=main}
+
+";
+
+$CUSTOMFOOTER = "
+
+</td></tr>
+<tr><td class='pagefooter'></td></tr>
+</table>
+</div>
+</td>
+</tr>
+</table>
+</td>
+<td id='colright'></td>
+</tr>
+</table>
+<table class='maintable' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='colbotleft'><img src='".THEME_ABS."images/blank.gif' width='14' height='14' alt='' style='display: block;' /></td>
+<td id='colbot'></td>
+<td id='colbotright'><img src='".THEME_ABS."images/blank.gif' width='14' height='14' alt='' style='display: block;' /></td>
+</tr>
+</table>
+
+";
+
+
+$CUSTOMPAGES = "forum.php forum_post.php forum_viewforum.php forum_viewtopic.php user.php submitnews.php download.php links.php stats.php usersettings.php signup.php";
+
+
+
+
+$NEWSSTYLE = "
+<div class='captiontext'>{NEWSTITLE}</div>
+{NEWSBODY}
+{EXTENDED}
+<div style='text-align:right' class='smalltext'>
+{NEWSAUTHOR}
+on
+{NEWSDATE}
+<br />
+{NEWSCOMMENTS}{TRACKBACK}
+</div>
+<br />";
+
+define("ICONSTYLE", "");
+define("COMMENTLINK", LAN_THEME_2);
+define("COMMENTOFFSTRING", LAN_THEME_3);
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", LAN_THEME_4);
+define("POST_EXTENDEDSTRING", " ]<br />");
+define("TRACKBACKSTRING", LAN_THEME_5);
+define("TRACKBACKBEFORESTRING", " | ");
+
+
+// [linkstyle]
+
+define('PRELINK', "");
+define('POSTLINK', "");
+define('LINKSTART', "<div class='link1' onmouseover=\"this.className='link2';\" onmouseout=\"this.className='link1';\"><div class='linktext'><img src='".THEME_ABS."images/bullet1.gif' alt='' />&nbsp;&nbsp;");
+define("LINKSTART_HILITE", "<div class='link2' onmouseover=\"this.className='link1';\" onmouseout=\"this.className='link2';\"><div class='linktext'><img src='".THEME_ABS."images/bullet1.gif' alt='' />&nbsp;&nbsp;");
+define('LINKEND', "</div></div>");
+define('LINKDISPLAY', 1);
+define('LINKALIGN', "left");
+
+
+
+
+//	[tablestyle]
+
+function tablestyle($caption, $text)
+{
+	global $style;
+
+	if($style == "menu1")
+	{
+		echo "<div class='caption'><div class='captionpadder'>$caption</div></div><br /><div class='padder'>$text</div><br />";
+	}
+	else if($style == "menu2")
+	{
+		echo "<table class='menutable' cellpadding='0' cellspacing='0'>
+<tr><td class='menutop2'></td></tr>
+<tr><td class='menubody2'><div class='menuwrapper'>$caption<br /><br />$text</div></td></tr>
+<tr><td class='menubottom2'></td></tr>
+</table>";
+	}
+	else
+	{
+		echo "<div class='captiontext'>$caption</div>$text<br />";
+	}
+}
+
+$COMMENTSTYLE = "<br /><br />
+<div class='captiontext'><img src='".THEME_ABS."images/bullet1.gif' alt='' style='vertical-align: middle;' /> {USERNAME} | {TIMEDATE}</div>
+{COMMENT} {COMMENTEDIT}<br />
+<span class='smalltext'>{REPLY}{IPADDRESS}</span>
+";
+
+
+
+$CHATBOXSTYLE = "
+<div class='link2'><div class='linktext'><img src='".THEME_ABS."images/bullet1.gif' alt='' style='vertical-align: middle;' /> {USERNAME} | <span class='cbdate'>{TIMEDATE}</span></div></div>
+<div class='smalltext'>
+{MESSAGE}
+</div>
+<br />";
+
+
+
+
+
+
+
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/jayya/admin_template.php 75/e107_themes/jayya/admin_template.php
--- 6171/e107_themes/jayya/admin_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/jayya/admin_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,166 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/jayya/admin_template.php,v $
+|     $Revision: 1.18 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [prerenders]
+
+$style = "leftmenu";
+$prehelp = $tp -> parseTemplate('{ADMIN_HELP}');
+
+$style = "rightmenu";
+$pre_admin_menu = $tp -> parseTemplate('{ADMIN_MENU=pre}');
+$preright = $tp -> parseTemplate('{ADMIN_STATUS=request}');
+$preright .= $tp -> parseTemplate('{ADMIN_LATEST=request}');
+$preright .= $tp -> parseTemplate('{ADMIN_PRESET}');
+$preright .= $tp -> parseTemplate('{ADMIN_LOG=request}');
+$style = "default";
+
+// [layout]
+
+$ADMIN_HEADER = "<table class='top_section'>
+<tr>
+<td class='top_section_left' style='padding-left: 5px; padding-right: 5px'>
+{ADMIN_LOGO}
+</td>
+<td class='top_section_mid' style='width: 100%'>
+<div style='margin-bottom: 3px;'>
+{ADMIN_LOGGED}
+{ADMIN_SEL_LAN}
+{ADMIN_USERLAN}
+</div>
+{SITELINKS=flat}
+</td>
+
+<td class='top_section_right' style='padding: 0px 18px 0px 18px; width: 68px'>
+<div style='height: 32px;'>
+{ADMIN_ICON}
+</div>
+</td>
+</tr>
+</table>";
+
+if (ADMIN) {
+	$ADMIN_HEADER .= "{ADMIN_ALT_NAV}";
+} else {
+	if (file_exists(THEME.'admin_nav.js')) {
+		$ADMIN_HEADER .= "<script type='text/javascript' src='".THEME."admin_nav.js'></script>";
+	} else {
+		$ADMIN_HEADER .= "<script type='text/javascript' src='".e_FILE."admin_nav.js'></script>";
+	}
+
+	$ADMIN_HEADER .= "<div style='width: 100%'><table style='width:100%; border-collapse: collapse; border-spacing: 0px;'>
+	<tr><td>
+	<div class='menuBar' style='width:100%;'>
+	&nbsp;
+	</div>
+	</td>
+	</tr>
+	</table></div>";
+}
+
+$ADMIN_HEADER .= "<table class='main_section'>
+<tr>
+<td class='left_menu'>
+<table style='width:100%; border-collapse: collapse; border-spacing: 0px;'>
+<tr>
+<td>
+{SETSTYLE=leftmenu}
+{ADMIN_LANG}
+{ADMIN_PWORD}
+{ADMIN_MSG}
+{ADMIN_PLUGINS}";
+
+if (!ADMIN) {
+	$style='leftmenu';
+	$ADMIN_HEADER .= $ns -> tablerender('Welcome', '', '', TRUE);
+	$style='default';
+}
+
+if ($prehelp!='') {
+	$ADMIN_HEADER .= $prehelp;
+} else {
+	$ADMIN_HEADER .= "{ADMIN_SITEINFO}";
+}
+
+$ADMIN_HEADER .= "<br />
+</td></tr></table>
+</td>
+<td class='default_menu'>
+{SETSTYLE=default}
+";
+
+$ADMIN_FOOTER = "<br />
+</td>";
+
+if ($pre_admin_menu || $preright) {
+	$ADMIN_FOOTER .= "<td class='right_menu'>
+	<table style='width:100%; border-collapse: collapse; border-spacing: 0px;'>
+	<tr>
+	<td>
+	{SETSTYLE=rightmenu}
+	{ADMIN_MENU}
+	".$preright."
+	<br />
+	</td></tr></table>
+	</td>";
+}
+
+$ADMIN_FOOTER .= "</tr>
+</table>
+<div style='text-align:center'>
+<br />
+{SITEDISCLAIMER}
+<br /><br />
+{ADMIN_CREDITS}
+<br />
+</div>
+";
+
+
+// [admin button style]
+
+$BUTTONS_START = "<table class='fborder' style='width: 100%'>";
+
+$BUTTON = "<tr><td class='link_button'><div class='emenuBar link_button'>
+<div class='menuButton link_button' onmouseover=\"eover(this, 'menuButton_over link_button')\" onmouseout=\"eover(this, 'menuButton link_button')\" {ONCLICK} 
+style='width: 98% !important; width: 100%; padding: 0px 0px 0px 2px; border-right: 0px'>
+<img src='".E_16_NAV_ARROW."' style='width: 16px; height: 16px; vertical-align: middle' alt='' />&nbsp;{LINK_TEXT}</div></div></td></tr>";
+
+$BUTTON_OVER = "<tr><td class='link_button'><div class='emenuBar link_button'>
+<div class='menuButton link_button' onmouseover=\"eover(this, 'menuButton_over link_button')\" onmouseout=\"eover(this, 'menuButton link_button')\" {ONCLICK} 
+style='width: 98% !important; width: 100%; padding: 0px 0px 0px 2px; border-right: 0px'>
+<img src='".E_16_NAV_ARROW_OVER."' style='width: 16px; height: 16px; vertical-align: middle' alt='' />&nbsp;{LINK_TEXT}</div></div></td></tr>";
+
+$BUTTONS_END = "</table>";
+
+$SUB_BUTTONS_START = "<table class='fborder' style='width:100%;'>
+<tr><td style='border-bottom: 1px solid #000'><div class='emenuBar'>
+<div class='menuButton' onmouseover=\"eover(this, 'menuButton_over')\" onmouseout=\"eover(this, 'menuButton')\" onclick=\"expandit('{SUB_HEAD_ID}');\" 
+style='width: 98% !important; width: 100%; padding: 0px 0px 0px 2px; border-right: 0px'>
+<img src='".E_16_NAV_ARROW."' style='width: 16px; height: 16px; vertical-align: middle' alt='' />&nbsp;{SUB_HEAD}</div></div></td></tr>
+<tr id='{SUB_HEAD_ID}' style='display: none' ><td class='forumheader3' style='text-align:left;'>";
+
+$SUB_BUTTON = "<a style='text-decoration:none;' href='{LINK_URL}'>{LINK_TEXT}</a><br />";
+
+$SUB_BUTTON_OVER = "<b> &laquo; <a style='text-decoration:none;' href='{LINK_URL}'>{LINK_TEXT}</a> &raquo; </b><br />";
+
+$SUB_BUTTONS_END = "</td></tr></table>";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/jayya/canvas.css 75/e107_themes/jayya/canvas.css
--- 6171/e107_themes/jayya/canvas.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/jayya/canvas.css	2005-06-16 03:04:19.000000000 -0500
@@ -0,0 +1,302 @@
+/* info: alternative stylesheet */
+
+/* Core Classes */
+body {
+	background-color: #e1e4e8;
+}
+
+body, td {
+	margin: 0px;
+	padding: 0px;
+	text-align: left;
+	color: #000;
+}
+
+body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext,
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar {
+	font: normal 11px verdana, tahoma, arial, sans-serif;
+	color: #000;
+}
+
+.fcaption {
+	font: bold 11px verdana, tahoma, arial, sans-serif;
+	color: #566782;
+}
+
+.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox {
+	font: normal 10px verdana, tahoma, arial, sans-serif;
+	color: #000;
+}
+
+a {
+	color: #1A4487;
+}
+
+a:hover {
+	color: #003300;
+}
+
+img {	
+	border: 0px;
+}
+
+form {
+	margin: 0px;
+}
+
+.tbox {
+	border: #9E9E9E 1px solid;
+	background-color: #fff;
+}
+
+.indent {
+	border: #999 1px dashed;
+	padding: 5px;
+	margin: 5px;
+	background-color: #f7f7f9;
+}
+
+.button, .button:hover {
+	border: 1px solid #9E9E9E;
+}
+
+.button {
+	background-image : url(images/button.png);
+}
+
+.button:hover {
+	background-image : url(images/buttonover.png);
+}
+
+.nextprev {
+	border: 0px;
+	text-align: center;
+	padding: 2px;
+	background-color: #f7f7f9;
+}
+
+.spacer{
+	padding: 5px 0px;
+}
+
+.fborder, .border{
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar {
+	padding: 5px;
+	background-color: #fff;
+	border: 1px solid #B5B5B5;
+}
+
+.forumheader, .forumheader4, .finfobar {
+	background-color: #fbfbfd;
+}
+
+.forumheader5 {
+	cursor: pointer;
+}
+
+.fcaption, .forumheader5 {
+	background-color: #f7f7f9;
+}
+
+table {
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.searchhighlight {
+	text-decoration: underline;
+	color: #ff0000;
+	font-weight: bold;
+}
+
+ul {
+	margin-top: 0px;
+	margin-bottom: 0px;
+}
+
+/* Theme Specific Classes */
+
+.top_section, .main_section {
+	width: 100%;
+	background-color: #fff;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.top_section_left {
+	vertical-align: middle;
+}
+
+.top_section_mid {
+	vertical-align: bottom;
+	text-align: right;
+	padding: 5px;
+	background-image: url(images/top_mid_back.jpg);
+	background-repeat: no-repeat;
+	background-color: #E9EAF2;
+}
+
+.top_section_right {
+	vertical-align: middle;
+	text-align: center;
+	background-image: url(images/top_right_back.jpg);
+	background-repeat: no-repeat;
+	background-position: center;
+	background-color: #f3f3f7;
+}
+
+.menus_container {
+	width: 170px;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.default_menu {
+	vertical-align: top;
+}
+
+.left_menu, .right_menu {
+	width: 170px;
+	vertical-align: top;
+	background-color: #F5F5F7;
+}
+
+.main_caption, .left_caption, .right_caption {
+	font: bold 12px verdana, tahoma, arial, sans-serif;
+	color: #566782;
+	white-space: nowrap;
+	padding: 5px 7px 3px 7px;
+}
+
+.cont {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	width: 100%;
+}
+
+.menu_content {
+	padding: 5px 7px;
+	background-color: #fff;
+}
+
+.menu_content.non_default {
+	background-color: transparent;
+}
+
+.news_info {
+	width: *;
+	background-color: #f7f7f9;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+/* Nav Menu Classes */
+
+div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem {
+	font: normal 11px arial, verdana, tahoma, sans-serif;
+	color: #000;
+}
+
+div.menuBar {
+	background-color: #F7F9FA;
+	background-image: url(images/s_nav.png);
+	background-repeat: repeat-x;
+	border-top: 1px solid #fff;
+	padding: 4px 0px;
+	text-align: left;
+}
+
+div.emenuBar {
+	background-color: #F7F9FA;
+	border-top: 1px solid #fff;
+	text-align: left;
+}
+
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over {
+	background-color: transparent;
+	border: 1px solid;
+	border-color: transparent !important;
+	border-color: #fff #F8FAFB #F0F2F3 #F8FAFB;
+	cursor: default;
+	left: 0px;
+	margin: 0px;
+	padding: 2px 4px 2px 22px;
+	position: relative;
+	text-decoration: none;
+	top: 0px;
+	z-index: 100;
+}
+
+div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over {
+	background-color: transparent;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff !important;
+}
+
+div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover {
+	background-color: #fff;
+	border-color: #a5a5a5 #fff #fff #a5a5a5 !important;
+	left: 1px;
+	top: 1px;
+}
+
+div.menu {
+	background-color: #FCFDFF;
+	border: 1px solid;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff;
+	left: 0px;
+	padding: 1px;
+	position: absolute;
+	top: 0px;
+	visibility: hidden;
+	z-index: 101;
+}
+
+div.menu a.menuItem {
+	cursor: default;
+	display: block;
+	padding: 2px 11px 2px 0px;
+	text-decoration: none;
+	white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+	background-color: #F2F4FF;
+}
+
+div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer {
+	padding: 0px 2px;
+}
+
+div.menu a.menuItem span.menuItemText {
+	padding: 0px 0px 0px 3px;
+}
+
+div.menu a.menuItem span.menuItemArrow {
+	margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+	border-top: 1px solid #a5a5a5;
+	border-bottom: 1px solid #fff;
+	margin: 4px 2px;
+}
+
+a.menuItem.header {
+	border-bottom: 1px solid #b3b3b3;
+}
+
+/* button style */
+
+.emenuBar.link_button, .menuButton.link_button {
+	background-color: transparent;
+	border: 0px;
+}
+
+.menuButton_over.link_button {
+	background-color: #fff;
+	border: 0px;
+}
\ No newline at end of file
Files 6171/e107_themes/jayya/forum/admin_delete.png and 75/e107_themes/jayya/forum/admin_delete.png differ
Files 6171/e107_themes/jayya/forum/admin_edit.png and 75/e107_themes/jayya/forum/admin_edit.png differ
Files 6171/e107_themes/jayya/forum/admin_lock.png and 75/e107_themes/jayya/forum/admin_lock.png differ
Files 6171/e107_themes/jayya/forum/admin_move.png and 75/e107_themes/jayya/forum/admin_move.png differ
Files 6171/e107_themes/jayya/forum/admin.png and 75/e107_themes/jayya/forum/admin.png differ
Files 6171/e107_themes/jayya/forum/admin_stick.png and 75/e107_themes/jayya/forum/admin_stick.png differ
Files 6171/e107_themes/jayya/forum/admin_unlock.png and 75/e107_themes/jayya/forum/admin_unlock.png differ
Files 6171/e107_themes/jayya/forum/admin_unstick.png and 75/e107_themes/jayya/forum/admin_unstick.png differ
Files 6171/e107_themes/jayya/forum/announce.png and 75/e107_themes/jayya/forum/announce.png differ
Files 6171/e107_themes/jayya/forum/closed_small.png and 75/e107_themes/jayya/forum/closed_small.png differ
Files 6171/e107_themes/jayya/forum/delete.png and 75/e107_themes/jayya/forum/delete.png differ
Files 6171/e107_themes/jayya/forum/edit.png and 75/e107_themes/jayya/forum/edit.png differ
Files 6171/e107_themes/jayya/forum/email.png and 75/e107_themes/jayya/forum/email.png differ
Files 6171/e107_themes/jayya/forum/e.png and 75/e107_themes/jayya/forum/e.png differ
Files 6171/e107_themes/jayya/forum/fcap2orig.png and 75/e107_themes/jayya/forum/fcap2orig.png differ
Files 6171/e107_themes/jayya/forum/fcap2.png and 75/e107_themes/jayya/forum/fcap2.png differ
Files 6171/e107_themes/jayya/forum/fcap.png and 75/e107_themes/jayya/forum/fcap.png differ
Files 6171/e107_themes/jayya/forum/finfobar.png and 75/e107_themes/jayya/forum/finfobar.png differ
diff -ruN 6171/e107_themes/jayya/forum/forum_icons_template.php 75/e107_themes/jayya/forum/forum_icons_template.php
--- 6171/e107_themes/jayya/forum/forum_icons_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/jayya/forum/forum_icons_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,71 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/jayya/forum/forum_icons_template.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+	
+if (!defined('e107_INIT')) { exit; }
+
+@include_once(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php');
+@include_once(e_PLUGIN.'forum/languages/English/lan_forum_viewforum.php');
+
+define("IMAGE_e", "<img src='".img_path('e.png')."' alt='' title='' style='border:0' />");
+define("IMAGE_new", "<img src='".img_path('new.png')."' alt='".LAN_199."' title='".LAN_199."' style='border:0' />");
+define("IMAGE_nonew", "<img src='".img_path('nonew.png')."' alt='' title='' style='border:0' />");
+define("IMAGE_new_small", "<img src='".img_path('new_small.png')."' alt='".FORLAN_11."' title='".FORLAN_11."' style='border:0' />");
+define("IMAGE_nonew_small", "<img src='".img_path('nonew_small.png')."' alt='".FORLAN_12."' title='".FORLAN_12."' style='border:0' />");
+define("IMAGE_new_popular", "<img src='".img_path('new_popular.gif')."' alt='".FORLAN_13."' title='".FORLAN_13."' style='border:0' />");
+define("IMAGE_nonew_popular", "<img src='".img_path('nonew_popular.gif')."' alt='".FORLAN_14."' title='".FORLAN_14."' style='border:0' />");
+define("IMAGE_new_popular_small", "<img src='".img_path('new_popular.gif')."' alt='".FORLAN_13."' title='".FORLAN_13."' style='border:0' />");
+define("IMAGE_nonew_popular_small", "<img src='".img_path('nonew_popular.gif')."' alt='".FORLAN_14."' title='".FORLAN_14."' style='border:0' />");
+define("IMAGE_sticky", "<img src='".img_path('sticky.png')."' alt='".FORLAN_15."' title='".FORLAN_15."' style='border:0' />");
+define("IMAGE_stickyclosed", "<img src='".img_path('sticky_closed.png')."' alt='".FORLAN_16."' title='".FORLAN_16."' style='border:0' />");
+define("IMAGE_sticky_small", "<img src='".img_path('sticky.png')."' alt='".FORLAN_16."' title='".FORLAN_16."' style='border:0' />");
+define("IMAGE_stickyclosed_small", "<img src='".img_path('stickyclosed.png')."' alt='".FORLAN_16."' title='".FORLAN_16."' style='border:0' />");
+define("IMAGE_announce", "<img src='".img_path('announce.png')."' alt='".FORLAN_17."' title='".FORLAN_17."' style='border:0' />");
+define("IMAGE_announce_small", "<img src='".img_path('announce.png')."' alt='".FORLAN_17."' title='".FORLAN_17."' style='border:0' />");
+define("IMAGE_closed_small", "<img src='".img_path('closed_small.png')."' alt='".FORLAN_18."' title='".FORLAN_18."' style='border:0' />");
+define("IMAGE_closed", "<img src='".img_path('closed.png')."' alt='".FORLAN_18."' title='".FORLAN_18."' style='border:0' />");
+define("IMAGE_profile", "<img src='".img_path('profile.png')."' alt='".LAN_398."' title='".LAN_398."' style='border:0' />");
+define("IMAGE_email", "<img src='".img_path('email.png')."' alt='".LAN_397."' title='".LAN_397."' style='border:0' />");
+define("IMAGE_pm", "<img src='".img_path('pm.png')."' alt='".LAN_399."' title='".LAN_399."' style='border:0' />");
+define("IMAGE_website", "<img src='".img_path('website.png')."' alt='".LAN_396."' title='".LAN_396."' style='border:0' />");
+define("IMAGE_edit", "<img src='".img_path('edit.png')."' alt='".LAN_400."' title='".LAN_400."' style='border:0' />");
+define("IMAGE_quote", "<img src='".img_path('quote.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' />");
+define("IMAGE_admin_edit", "<img src='".img_path('admin_edit.png')."' alt='".LAN_406."' title='".LAN_406."' style='border:0; vertical-align: top;' />");
+define("IMAGE_admin_move", "<img src='".img_path('admin_move.png')."' alt='".LAN_402."' title='".LAN_402."' style='border:0; vertical-align: top;' />");
+define("IMAGE_admin_move2", "<img src='".img_path('admin_move.png')."' alt='".LAN_408."' title='".LAN_408."' style='border:0; vertical-align: top;' />");
+define("IMAGE_post", "<img src='".img_path('post.png')."' alt='' title='' style='border:0' />");
+define("IMAGE_post2", "<img src='".img_path('post2.png')."' alt='' title='' style='border:0; vertical-align:bottom' />");
+define("IMAGE_report", "<img src='".img_path('report.png')."' alt='".LAN_413."' title='".LAN_413."' style='border:0' />");
+	
+// Admin <input> Icons
+	
+define("IMAGE_admin_delete", "src='".img_path('admin_delete.png')."' alt='".LAN_435."' title='".LAN_435."' style='border:0' ");
+define("IMAGE_admin_unstick", "src='".img_path('admin_unstick.png')."' alt='".LAN_398."' title='".LAN_398."' style='border:0' ");
+define("IMAGE_admin_stick", "src='".img_path('admin_stick.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' ");
+define("IMAGE_admin_lock", "src='".img_path('admin_lock.png')."' alt='".LAN_399."' title='".LAN_399."' style='border:0' ");
+define("IMAGE_admin_unlock", "src='".img_path('admin_unlock.png')."' alt='".LAN_400."' title='".LAN_400."' style='border:0' ");
+	
+// Multi Language Images
+	
+define("IMAGE_newthread", "<img src='".img_path('newthread.png')."' alt='".FORLAN_10."' title='".FORLAN_10."' style='border:0' />");
+define("IMAGE_reply", "<img src='".img_path('reply.png')."' alt='' title='' style='border:0' />");
+define("IMAGE_rank_moderator_image", "<img src='".img_path('moderator.png', '', 'rank_moderator_image')."' alt='' />");
+define("IMAGE_rank_main_admin_image", "<img src='".img_path('main_admin.png', '', 'rank_main_admin_image')."' alt='' />");
+define("IMAGE_rank_admin_image", "<img src='".img_path('admin.png', '', 'rank_admin_image')."' alt='' />");
+	
+?>
\ No newline at end of file
Files 6171/e107_themes/jayya/forum/main_admin.png and 75/e107_themes/jayya/forum/main_admin.png differ
Files 6171/e107_themes/jayya/forum/moderator.png and 75/e107_themes/jayya/forum/moderator.png differ
Files 6171/e107_themes/jayya/forum/new.png and 75/e107_themes/jayya/forum/new.png differ
Files 6171/e107_themes/jayya/forum/new_popular.gif and 75/e107_themes/jayya/forum/new_popular.gif differ
Files 6171/e107_themes/jayya/forum/new_small.png and 75/e107_themes/jayya/forum/new_small.png differ
Files 6171/e107_themes/jayya/forum/newthread.png and 75/e107_themes/jayya/forum/newthread.png differ
Files 6171/e107_themes/jayya/forum/nonew.png and 75/e107_themes/jayya/forum/nonew.png differ
Files 6171/e107_themes/jayya/forum/nonew_popular.gif and 75/e107_themes/jayya/forum/nonew_popular.gif differ
Files 6171/e107_themes/jayya/forum/nonew_small.png and 75/e107_themes/jayya/forum/nonew_small.png differ
Files 6171/e107_themes/jayya/forum/post.png and 75/e107_themes/jayya/forum/post.png differ
Files 6171/e107_themes/jayya/forum/profile.png and 75/e107_themes/jayya/forum/profile.png differ
Files 6171/e107_themes/jayya/forum/quote.png and 75/e107_themes/jayya/forum/quote.png differ
Files 6171/e107_themes/jayya/forum/reply.png and 75/e107_themes/jayya/forum/reply.png differ
Files 6171/e107_themes/jayya/forum/report.png and 75/e107_themes/jayya/forum/report.png differ
Files 6171/e107_themes/jayya/forum/stickyclosed.png and 75/e107_themes/jayya/forum/stickyclosed.png differ
Files 6171/e107_themes/jayya/forum/sticky.png and 75/e107_themes/jayya/forum/sticky.png differ
Files 6171/e107_themes/jayya/forum/website.png and 75/e107_themes/jayya/forum/website.png differ
Files 6171/e107_themes/jayya/images/arrow.png and 75/e107_themes/jayya/images/arrow.png differ
Files 6171/e107_themes/jayya/images/bar.jpg and 75/e107_themes/jayya/images/bar.jpg differ
Files 6171/e107_themes/jayya/images/blank.gif and 75/e107_themes/jayya/images/blank.gif differ
Files 6171/e107_themes/jayya/images/bullet2.gif and 75/e107_themes/jayya/images/bullet2.gif differ
Files 6171/e107_themes/jayya/images/buttonover.png and 75/e107_themes/jayya/images/buttonover.png differ
Files 6171/e107_themes/jayya/images/button.png and 75/e107_themes/jayya/images/button.png differ
Files 6171/e107_themes/jayya/images/comments_16.png and 75/e107_themes/jayya/images/comments_16.png differ
Files 6171/e107_themes/jayya/images/computer.jpg and 75/e107_themes/jayya/images/computer.jpg differ
Files 6171/e107_themes/jayya/images/computer_pepper.jpg and 75/e107_themes/jayya/images/computer_pepper.jpg differ
Files 6171/e107_themes/jayya/images/email_16.png and 75/e107_themes/jayya/images/email_16.png differ
Files 6171/e107_themes/jayya/images/on.png and 75/e107_themes/jayya/images/on.png differ
Files 6171/e107_themes/jayya/images/polls.png and 75/e107_themes/jayya/images/polls.png differ
Files 6171/e107_themes/jayya/images/postedby_16.png and 75/e107_themes/jayya/images/postedby_16.png differ
Files 6171/e107_themes/jayya/images/print_16.png and 75/e107_themes/jayya/images/print_16.png differ
Files 6171/e107_themes/jayya/images/s_body_.png and 75/e107_themes/jayya/images/s_body_.png differ
Files 6171/e107_themes/jayya/images/s_body.png and 75/e107_themes/jayya/images/s_body.png differ
Files 6171/e107_themes/jayya/images/screen.png and 75/e107_themes/jayya/images/screen.png differ
Files 6171/e107_themes/jayya/images/s_left_bevel_.png and 75/e107_themes/jayya/images/s_left_bevel_.png differ
Files 6171/e107_themes/jayya/images/s_left_bevel.png and 75/e107_themes/jayya/images/s_left_bevel.png differ
Files 6171/e107_themes/jayya/images/s_left_cap_.png and 75/e107_themes/jayya/images/s_left_cap_.png differ
Files 6171/e107_themes/jayya/images/s_left_cap.png and 75/e107_themes/jayya/images/s_left_cap.png differ
Files 6171/e107_themes/jayya/images/s_main_cap_.png and 75/e107_themes/jayya/images/s_main_cap_.png differ
Files 6171/e107_themes/jayya/images/s_main_cap.png and 75/e107_themes/jayya/images/s_main_cap.png differ
Files 6171/e107_themes/jayya/images/s_nav_.png and 75/e107_themes/jayya/images/s_nav_.png differ
Files 6171/e107_themes/jayya/images/s_nav.png and 75/e107_themes/jayya/images/s_nav.png differ
Files 6171/e107_themes/jayya/images/top_mid_back.jpg and 75/e107_themes/jayya/images/top_mid_back.jpg differ
Files 6171/e107_themes/jayya/images/top_mid_back_pepper.jpg and 75/e107_themes/jayya/images/top_mid_back_pepper.jpg differ
Files 6171/e107_themes/jayya/images/top_right_back.jpg and 75/e107_themes/jayya/images/top_right_back.jpg differ
Files 6171/e107_themes/jayya/images/top_right_back_pepper.png and 75/e107_themes/jayya/images/top_right_back_pepper.png differ
diff -ruN 6171/e107_themes/jayya/languages/English.php 75/e107_themes/jayya/languages/English.php
--- 6171/e107_themes/jayya/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/jayya/languages/English.php	2005-06-23 12:46:30.000000000 -0500
@@ -0,0 +1,28 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/jayya/languages/English.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/06/23 17:46:30 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "Comments are turned off for this item");
+define("LAN_THEME_2", "Read/Post Comment: ");
+define("LAN_THEME_3", "Read the rest...");
+define("LAN_THEME_4", "Trackbacks: ");
+define("LAN_THEME_5", "Posted by");
+define("LAN_THEME_6", "on");
+
+
+?>
diff -ruN 6171/e107_themes/jayya/nav_menu.css 75/e107_themes/jayya/nav_menu.css
--- 6171/e107_themes/jayya/nav_menu.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/jayya/nav_menu.css	2005-04-14 14:26:08.000000000 -0500
@@ -0,0 +1,110 @@
+div.menuBar,
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over, 
+div.menu,
+div.menu a.menuItem {
+  font-family: arial, sans-serif;
+  font-size: 11px;
+  font-style: normal;
+  font-weight: normal;
+  color: #000000;
+}
+
+div.menuBar {
+  background-color: #F7F9FA;
+  background-image: url(images/s_nav.png);
+  background-repeat: repeat-x;
+  border-top: 1px solid #ffffff;
+  border-bottom: 0px solid #000;
+  padding: 4px 0px 4px 0px;
+  text-align: left;
+}
+
+div.emenuBar {
+  background-color: #F7F9FA;
+  border-top: 1px solid #ffffff;
+  border-bottom: 0px solid #000;
+  text-align: left;
+}
+
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over {
+  background-color: transparent;
+  border: 1px solid #F7F9FA;
+  color: #000000;
+  cursor: default;
+  left: 0px;
+  margin: 0px;
+  padding: 2px 4px 2px 22px;
+  position: relative;
+  text-decoration: none;
+  top: 0px;
+  z-index: 100;
+}
+
+div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over {
+  background-color: transparent;
+  border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff;
+  color: #000000;
+}
+
+div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, 
+div.menuBar a.menuButtonActive:hover {
+  background-color: #ffffff;
+  border-color: #a5a5a5 #ffffff #ffffff #a5a5a5;
+  color: #000;
+  left: 1px;
+  top: 1px;
+}
+
+div.menu {
+  background-color: #FCFDFF;
+  border: 1px solid;
+  border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff;
+  left: 0px;
+  padding: 1px 1px 1px 1px;
+  position: absolute;
+  top: 0px;
+  visibility: hidden;
+  z-index: 101;
+}
+
+div.menu a.menuItem {
+  color: #000000;
+  cursor: default;
+  display: block;
+  padding: 2px 11px 2px 0px;
+  text-decoration: none;
+  white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+  background-color: #F0F6FF;
+  color: #000000;
+}
+
+div.menu a.menuItem span.menuItemBuffer {
+  padding: 0px 2px 0px 2px;
+  color: #ffffff;
+}
+
+div.menu a.menuItem:hover span.menuItemBuffer {
+  padding: 0px 2px 0px 2px;
+  color: #000000;
+}
+
+div.menu a.menuItem span.menuItemText {
+	padding: 0px 0px 0px 3px;
+}
+
+div.menu a.menuItem span.menuItemArrow {
+  margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+  border-top: 1px solid #a5a5a5;
+  border-bottom: 1px solid #ffffff;
+  margin: 4px 2px;
+}
+
+a.menuItem.header {
+  border-bottom: 1px solid #b3b3b3;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/jayya/pepper.css 75/e107_themes/jayya/pepper.css
--- 6171/e107_themes/jayya/pepper.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/jayya/pepper.css	2005-06-16 03:04:19.000000000 -0500
@@ -0,0 +1,321 @@
+/* info: alternative stylesheet */
+
+/* Core Classes */
+body {
+	background-color: #fdfdfd;
+}
+
+body, td {
+	margin: 0px;
+	padding: 0px;
+	text-align: left;
+	color: #000;
+}
+
+body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext,
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar {
+	font: normal 11px arial, verdana, tahoma, sans-serif;
+	color: #000;
+}
+
+.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox {
+	font: normal 10px arial, verdana, tahoma, sans-serif;
+	color: #000;
+}
+
+a {
+	color: #cc3300;
+}
+
+a:hover {
+	color: #003300;
+}
+
+img {	
+	border: 0px;
+}
+
+form {
+	margin: 0px;
+}
+
+.tbox {
+	border: #A5ACB2 1px solid;
+	background-color: #fff;
+}
+
+.indent {
+	border: #999 1px dashed;
+	padding: 5px;
+	margin: 5px;
+	background-color: #fcf9f9;
+}
+
+.button, .button:hover {
+	border: 1px solid #000;
+}
+
+.button {
+	background-image : url(images/button.png);
+}
+
+.button:hover {
+	background-image : url(images/buttonover.png);
+}
+
+.nextprev {
+	border: 0px;
+	text-align: center;
+	padding: 2px;
+	background-color: #f9f7f7;
+}
+
+.spacer{
+	padding: 5px 0px;
+}
+
+.fborder, .border{
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar {
+	padding: 4px;
+	background-color: #fff;
+	border: 1px solid #000;
+}
+
+.forumheader, .forumheader4, .finfobar {
+	background-color: #fdfbfb;
+}
+
+.forumheader5 {
+	cursor: pointer;
+}
+
+.fcaption, .forumheader5 {
+	background-color: #f9f7f7;
+}
+
+table {
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.searchhighlight {
+	text-decoration: underline;
+	color: #ff0000;
+	font-weight: bold;
+}
+
+ul {
+	margin-top: 0px;
+	margin-bottom: 0px;
+}
+
+/* Theme Specific Classes */
+
+.top_section, .main_section {
+	width: 100%;
+	background-color: #fff;
+	border-bottom: 1px solid #000;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.top_section_left {
+	vertical-align: middle;
+}
+
+.top_section_mid {
+	vertical-align: bottom;
+	text-align: right;
+	padding: 3px 5px 3px 0px;
+	border-left: 1px solid #000;
+	background-image: url(images/top_mid_back_pepper.jpg);
+	background-repeat: no-repeat;
+	background-color: #F3EDED;
+}
+
+.top_section_right {
+	vertical-align: middle;
+	text-align: center;
+	border-left: 1px solid #000;
+	background-image: url(images/top_right_back_pepper.png);
+	background-repeat: no-repeat;
+	background-position: center;
+	background-color: #F3EDED;
+}
+
+.menus_container {
+	width: 170px;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.default_menu {
+	vertical-align: top;
+}
+
+.left_menu, .right_menu {
+	width: 170px;
+	vertical-align: top;
+	background-color: #F9f7f7;
+}
+
+.left_menu {
+	border-right: 1px solid #000;
+}
+
+.right_menu {
+	border-left: 1px solid #000;
+}
+
+.cap_border {
+	border-top: 1px solid #000;
+	border-bottom: 1px solid #fff;
+}
+
+.cap_border.button_menu {
+	border-bottom: 0px;
+	text-align: left;
+}
+
+.main_caption, .left_caption, .right_caption {
+	white-space: nowrap;
+	padding: 3px 5px;
+	border-top: #e9efff 1px solid;
+	border-bottom: 1px solid #000;
+	background-repeat: no-repeat;
+	background-position: left;
+	color: #fff;
+}
+
+.main_caption {
+	background-color: #587D82;
+}
+
+.left_caption, .right_caption {
+	background-color: #173E4F;
+}
+
+.cont {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	width: 100%;
+}
+
+.menu_content {
+	padding: 5px;
+	background-color: #fff;
+}
+
+.menu_content.non_default {
+	background-color: transparent;
+}
+
+.menu_content.buttons {
+	padding: 0px;
+}
+
+.news_info {
+	width: *;
+	background-color: #F3F0F0;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+td.link_button {
+	border-bottom: 1px solid #000;
+}
+
+/* Nav Menu Classes */
+
+div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem {
+	font: normal 11px arial, verdana, tahoma, sans-serif;
+	color: #000;
+}
+
+div.menuBar {
+	background-color: #FFF8D9;
+	border-top: 1px solid #fff;
+	padding: 4px 0px;
+	text-align: left;
+}
+
+div.emenuBar {
+	background-color: #FFF8D9;
+	border-top: 1px solid #fff;
+	text-align: left;
+}
+
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over {
+	background-color: transparent;
+	border: 1px solid #FFF8D9;
+	cursor: default;
+	left: 0px;
+	margin: 0px;
+	padding: 2px 4px 2px 22px;
+	position: relative;
+	text-decoration: none;
+	top: 0px;
+	z-index: 100;
+}
+
+div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over {
+	background-color: transparent;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff;
+}
+
+div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover {
+	background-color: #ffffef;
+	border-color: #a5a5a5 #fff #fff #a5a5a5;
+	left: 1px;
+	top: 1px;
+}
+
+div.menu {
+	background-color: #FFF8D9;
+	border: 1px solid;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff;
+	left: 0px;
+	padding: 1px;
+	position: absolute;
+	top: 0px;
+	visibility: hidden;
+	z-index: 101;
+}
+
+div.menu a.menuItem {
+	cursor: default;
+	display: block;
+	padding: 2px 11px 2px 0px;
+	text-decoration: none;
+	white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+	background-color: #ffffef;
+}
+
+div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer {
+	padding: 0px 2px;
+}
+
+div.menu a.menuItem span.menuItemText {
+	padding: 0px 0px 0px 3px;
+}
+
+div.menu a.menuItem span.menuItemArrow {
+	margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+	border-top: 1px solid #a5a5a5;
+	border-bottom: 1px solid #fff;
+	margin: 4px 2px;
+}
+
+a.menuItem.header {
+	border-bottom: 1px solid #b3b3b3;
+}
\ No newline at end of file
Files 6171/e107_themes/jayya/preview.jpg and 75/e107_themes/jayya/preview.jpg differ
diff -ruN 6171/e107_themes/jayya/style.css 75/e107_themes/jayya/style.css
--- 6171/e107_themes/jayya/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/jayya/style.css	2006-04-12 16:13:53.000000000 -0500
@@ -0,0 +1,344 @@
+/* Core Classes */
+body {
+	background-color: #e1e4e8;
+}
+
+body, td {
+	margin: 0px;
+	padding: 0px;
+	text-align: left;
+	color: #000;
+}
+
+body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext,
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar {
+	font: normal 10px verdana, tahoma, arial, sans-serif;
+	color: #000;
+}
+
+.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox {
+	font: normal 9px verdana, tahoma, arial, sans-serif;
+	color: #000;
+}
+
+a {
+	color: #1A4487;
+}
+
+a.visit:visited {
+	color: #444;
+}
+
+a:hover, a.visit:hover {
+	color: #000000;
+}
+
+img {	
+	border: 0px;
+}
+
+form {
+	margin: 0px;
+}
+
+.tbox {
+	border: #A5ACB2 1px solid;
+	background-color: #fff;
+}
+
+.indent {
+	border: #999 1px dashed;
+	padding: 5px;
+	margin: 5px;
+	background-color: #f7f7f9;
+}
+
+.button, .button:hover {
+	border: 1px solid #A5ACB2;
+}
+
+.button {
+	background-image : url(images/button.png);
+}
+
+.button:hover {
+	background-image : url(images/buttonover.png);
+}
+
+.nextprev {
+	border: 0px;
+	text-align: center;
+	padding: 2px;
+	background-color: #f7f7f9;
+}
+
+.spacer{
+	padding: 5px 0px;
+}
+
+.fborder, .border{
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar {
+	padding: 4px;
+	background-color: #fff;
+	border: 1px solid #878787;
+}
+
+.forumheader, .forumheader4, .finfobar {
+	background-color: #fbfbfd;
+}
+
+.forumheader5 {
+	cursor: pointer;
+}
+
+.fcaption, .forumheader5 {
+	background-color: #f7f7f9;
+}
+
+table {
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.searchhighlight {
+	text-decoration: underline;
+	color: #ff0000;
+	font-weight: bold;
+}
+
+ul {
+	margin-top: 0px;
+	margin-bottom: 0px;
+}
+
+.helpbox {
+	border: 0px;
+}
+
+/* Theme Specific Classes */
+
+.top_section, .main_section {
+	width: 100%;
+	background-color: #fff;
+	border-bottom: 1px solid #878787;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.top_section_left {
+	vertical-align: middle;
+}
+
+.top_section_mid {
+	vertical-align: bottom;
+	text-align: right;
+	padding: 3px 5px 3px 0px;
+	border-left: 1px solid #878787;
+	background-image: url(images/top_mid_back.jpg);
+	background-repeat: no-repeat;
+	background-color: #E9EAF2;
+}
+
+.top_section_right {
+	vertical-align: middle;
+	text-align: center;
+	border-left: 1px solid #878787;
+	background-image: url(images/top_right_back.jpg);
+	background-repeat: no-repeat;
+	background-position: center;
+	background-color: #f3f3f7;
+}
+
+.menus_container {
+	width: 170px;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.default_menu {
+	vertical-align: top;
+}
+
+.left_menu, .right_menu {
+	width: 170px;
+	vertical-align: top;
+	background-image: url(images/s_body.png);
+	background-repeat: repeat-y;
+	background-color: #f0f1f2;
+}
+
+.left_menu {
+	border-right: 1px solid #878787;
+}
+
+.right_menu {
+	border-left: 1px solid #878787;
+}
+
+.cap_border {
+	border-top: 1px solid #878787;
+	border-bottom: 1px solid #fff;
+}
+
+.cap_border.button_menu {
+	border-bottom: 0px;
+	text-align: left;
+}
+
+.main_caption, .left_caption, .right_caption {
+	white-space: nowrap;
+	padding: 3px 5px;
+	border-top: #e9efff 1px solid;
+	border-bottom: 1px solid #878787;
+	background-repeat: no-repeat;
+	background-position: left;
+}
+
+.main_caption {
+	background-image: url(images/s_main_cap.png);
+	background-color: #e1e4e8;
+}
+
+.left_caption, .right_caption {
+	background-image: url(images/s_left_cap.png);
+	background-color: #d2d5d9;
+}
+
+.bevel {
+	background-image: url(images/s_left_bevel.png);
+	background-repeat: no-repeat;
+	background-position: right;
+}
+
+.cont {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	width: 100%;
+}
+
+.menu_content {
+	padding: 5px;
+	background-color: #fff;
+}
+
+.menu_content.non_default {
+	background-color: transparent;
+}
+
+.menu_content.buttons {
+	padding: 0px;
+}
+
+.news_info {
+	width: *;
+	background-color: #f7f7f9;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+td.link_button {
+	border-bottom: 1px solid #000;
+}
+
+b {
+	color: #232930;
+}
+
+/* Nav Menu Classes */
+
+div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem {
+	font: normal 11px arial, verdana, tahoma, sans-serif;
+	color: #000;
+}
+
+div.menuBar {
+	background-color: #F7F9FA;
+	background-image: url(images/s_nav.png);
+	background-repeat: repeat-x;
+	border-top: 1px solid #fff;
+	padding: 4px 0px;
+	text-align: left;
+}
+
+div.emenuBar {
+	background-color: #F7F9FA;
+	border-top: 1px solid #fff;
+	text-align: left;
+}
+
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over {
+	background-color: transparent;
+	border: 1px solid;
+	border-color: transparent !important;
+	border-color: #fff #F8FAFB #F0F2F3 #F8FAFB;
+	cursor: default;
+	left: 0px;
+	margin: 0px;
+	padding: 2px 4px 2px 22px;
+	position: relative;
+	text-decoration: none;
+	top: 0px;
+	z-index: 100;
+}
+
+div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over {
+	background-color: transparent;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff !important;
+}
+
+div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover {
+	background-color: #fff;
+	border-color: #a5a5a5 #fff #fff #a5a5a5 !important;
+	left: 1px;
+	top: 1px;
+}
+
+div.menu {
+	background-color: #FCFDFF;
+	border: 1px solid;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff;
+	left: 0px;
+	padding: 1px;
+	position: absolute;
+	top: 0px;
+	visibility: hidden;
+	z-index: 101;
+}
+
+div.menu a.menuItem {
+	cursor: default;
+	display: block;
+	padding: 2px 11px 2px 0px;
+	text-decoration: none;
+	white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+	background-color: #F2F4FF;
+}
+
+div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer {
+	padding: 0px 2px;
+}
+
+div.menu a.menuItem span.menuItemText {
+	padding: 0px 0px 0px 3px;
+}
+
+div.menu a.menuItem span.menuItemArrow {
+	margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+	border-top: 1px solid #a5a5a5;
+	border-bottom: 1px solid #fff;
+	margin: 4px 2px;
+}
+
+a.menuItem.header {
+	border-bottom: 1px solid #b3b3b3;
+}
diff -ruN 6171/e107_themes/jayya/theme.php 75/e107_themes/jayya/theme.php
--- 6171/e107_themes/jayya/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/jayya/theme.php	2006-04-26 08:41:54.000000000 -0500
@@ -0,0 +1,264 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/jayya/theme.php,v $
+|     $Revision: 1.53 $
+|     $Date: 2006/04/26 13:41:54 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+// Protect the file from direct access
+if (!defined('e107_INIT')) { exit; }
+
+
+// Get language definition files for this theme
+@include_once(e_THEME."jayya/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."jayya/languages/English.php");
+
+
+// [theme]
+
+$themename = "Jayya";
+$themeversion = "1.0";
+$themeauthor = "";
+$themedate = "";
+$themeinfo = "";
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+define("THEME_DISCLAIMER", "");
+define("IMODE", "lite");
+
+// [dont render core style sheet link]
+
+$no_core_css = TRUE;
+
+
+// [layout]
+
+$layout = "_default";
+
+$HEADER = "<table class='top_section'>
+<tr>
+<td class='top_section_left' style='width: 190px; padding-left: 5px; padding-right: 5px'>
+{LOGO}
+</td>
+<td class='top_section_mid'>
+{BANNER}
+</td>
+
+<td class='top_section_right' style='padding: 0px; white-space: nowrap; width: 170px'>
+{CUSTOM=search+default}
+</td>
+</tr>
+</table>
+
+<div>
+{SITELINKS_ALT=".THEME_ABS."images/arrow.png+noclick}
+</div>
+
+<table class='main_section'>
+<tr style='display: none'>
+<td style='width: 170px'></td>
+<td style='width: *'></td>
+<td style='width: 170px'></td>
+</tr>
+
+<tr>
+<td class='left_menu'>
+<table class='menus_container'><tr><td>
+{SETSTYLE=leftmenu}
+{MENU=1}
+</td></tr></table>
+</td>
+<td class='default_menu'>
+{SETSTYLE=default}
+{WMESSAGE}
+";
+
+$FOOTER = "<br />
+</td>
+
+<td class='right_menu'>
+<table class='menus_container'><tr><td>
+{SETSTYLE=rightmenu}
+{MENU=2}
+</td></tr></table>
+</td>
+</tr>
+</table>
+<div style='text-align:center'>
+<br />
+{SITEDISCLAIMER}
+<br /><br />
+</div>
+";
+
+
+// [linkstyle]
+
+define('PRELINK', '');
+define('POSTLINK', '');
+define('LINKSTART', '');
+define('LINKEND', '');
+define('LINKDISPLAY', 1);
+define('LINKALIGN', 'left');
+
+
+// [newsstyle]
+
+$sc_style['NEWSIMAGE']['pre'] = "<td style='padding-right: 7px; vertical-align: top'>";
+$sc_style['NEWSIMAGE']['post'] = "</td>";
+
+$NEWSSTYLE = "<div class='cap_border'><div class='main_caption'><div class='bevel'>
+{STICKY_ICON}{NEWSTITLE}
+</div></div></div>
+<div class='menu_content'>
+<table style='width: 100%'>
+<tr>
+{NEWSIMAGE}
+<td style='width: 100%; vertical-align: top'>
+{NEWSBODY}
+{EXTENDED}
+<br />
+</td>
+</tr>
+</table>
+</div>
+<div class='menu_content'>
+<table class='news_info'>
+<tr>
+<td style='text-align: center; padding: 3px; padding-bottom: 0px; white-space: nowrap'>
+{NEWSICON}
+</td>
+<td style='width: 100%; padding: 0px; padding-bottom: 0px; padding-left: 2px'>
+".LAN_THEME_5." 
+{NEWSAUTHOR}
+ ".LAN_THEME_6." 
+{NEWSDATE}
+</td><td style='text-align: center; padding: 3px; padding-bottom: 0px; white-space: nowrap'>
+<img src='".THEME_ABS."images/comments_16.png' style='width: 16px; height: 16px' alt='' />
+</td>
+<td style='padding: 0px; padding-left: 2px; white-space: nowrap'>
+{NEWSCOMMENTS}
+</td><td style='padding: 0px; white-space: nowrap'>
+{TRACKBACK}
+</td><td style='text-align: center; padding: 3px; padding-bottom: 0px; padding-left: 7px; white-space: nowrap'>
+{EMAILICON}
+{PRINTICON}
+{PDFICON}
+{ADMINOPTIONS}
+</td></tr></table>
+<br /></div>";
+
+define('ICONMAIL', 'email_16.png');
+define('ICONPRINT', 'print_16.png');
+define('ICONSTYLE', 'border: 0px');
+define('COMMENTLINK', LAN_THEME_2);
+define('COMMENTOFFSTRING', LAN_THEME_1);
+define('PRE_EXTENDEDSTRING', '<br /><br />[ ');
+define('EXTENDEDSTRING', LAN_THEME_3);
+define('POST_EXTENDEDSTRING', ' ]<br />');
+define('TRACKBACKSTRING', LAN_THEME_4);
+define('TRACKBACKBEFORESTRING', '&nbsp;|&nbsp;');
+
+
+//	[tablestyle]
+
+function tablestyle($caption, $text, $mode){
+	global $style;
+	$caption = $caption ? $caption : '&nbsp;';
+	if ((isset($mode['style']) && $mode['style'] == 'button_menu') || (isset($mode) && ($mode == 'menus_config'))) {
+		$menu = ' buttons';
+		$bodybreak = '';
+		$but_border = ' button_menu';
+	} else {
+		$menu = '';
+		$bodybreak = '<br />';
+		$but_border = '';
+	}
+	
+	$menu .= ($style && $style != 'default') ? ' non_default' : '';
+	
+	echo "<div class='cap_border".$but_border."'>";
+	if ($style == 'leftmenu') {
+		echo "<div class='left_caption'><div class='bevel'>".$caption."</div></div>";
+	}  else if ($style == 'rightmenu') {
+		echo "<div class='right_caption'><div class='bevel'>".$caption."</div></div>";
+	} else {
+		echo "<div class='main_caption'><div class='bevel'>".$caption."</div></div>";
+	}
+	echo "</div>";
+	if ($text != "") {
+		echo "<table class='cont'><tr><td class='menu_content ".$menu."'>".$text.$bodybreak."</td></tr></table>";
+	}
+}
+
+
+// chatbox post style
+$CHATBOXSTYLE = "
+<img src='".e_IMAGE."admin_images/chatbox_16.png' alt='' style='width: 16px; height: 16px; vertical-align: bottom' />
+<b>{USERNAME}</b><br />{TIMEDATE}<br />{MESSAGE}<br /><br />";
+
+
+// comment post style
+$sc_style['REPLY']['pre'] = "<tr><td class='forumheader'>";
+$sc_style['REPLY']['post'] = "";
+
+$sc_style['SUBJECT']['pre'] = "<td class='forumheader'>";
+$sc_style['SUBJECT']['post'] = "</td></tr>";
+
+$sc_style['COMMENTEDIT']['pre'] = "<tr><td class='forumheader' colspan='2' style='text-align: right'>";
+$sc_style['COMMENTEDIT']['post'] = "</td></tr>";
+
+$sc_style['JOINED']['post'] = "<br />";
+
+$sc_style['LOCATION']['post'] = "<br />";
+
+$sc_style['RATING']['post'] = "<br /><br />";
+
+$sc_style['RATING']['post'] = "<br />";
+
+$COMMENTSTYLE = "<div class='spacer' style='text-align:center'><table class='fborder' style='width: 95%'>
+<tr>
+<td class='fcaption' colspan='2'>".LAN_THEME_5." {USERNAME} ".LAN_THEME_6." {TIMEDATE}
+</td>
+</tr>
+{REPLY}{SUBJECT}
+<tr>
+<td style='width: 20%; vertical-align: top' class='forumheader3'>
+<div style='text-align: center'>
+{AVATAR}
+</div>
+{LEVEL}<span class='smalltext'>{JOINED}{COMMENTS}{LOCATION}{IPADDRESS}</span>
+</td>
+<td style='width: 80%; vertical-align: top' class='forumheader3'>
+{COMMENT}
+{RATING}
+{SIGNATURE} 
+</td>
+</tr>
+{COMMENTEDIT}
+</table>
+</div>";
+
+
+// poll style
+$POLLSTYLE = "<img src='".THEME_ABS."images/polls.png' style='width: 10px; height: 14px; vertical-align: bottom' /> {QUESTION}
+<br /><br />
+{OPTIONS=<img src='".THEME_ABS."images/bullet2.gif' style='width: 10px; height: 10px' /> OPTION<br />BAR<br /><span class='smalltext'>PERCENTAGE VOTES</span><br /><br />}
+<div style='text-align:center' class='smalltext'>{AUTHOR}<br />{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</div>";
+
+?>
diff -ruN 6171/e107_themes/khatru/download_template.php 75/e107_themes/khatru/download_template.php
--- 6171/e107_themes/khatru/download_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/download_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,239 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/khatru/download_template.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+/* set style of download image and thumbnail */
+define("DL_IMAGESTYLE","border:0px");
+
+// ##### CAT TABLE --------------------------------------------------------------------------------
+
+$DOWNLOAD_CAT_TABLE_START = "";
+
+$DOWNLOAD_CAT_PARENT_TABLE .= "
+<br /><br />
+<table style='width: 100%;'>
+<tr>
+<td class='forumheader3' style='width: 5%;'>{DOWNLOAD_CAT_MAIN_ICON}</td>
+<td class='forumheader3' style='width: 95%;'><h2>{DOWNLOAD_CAT_MAIN_NAME}</h2></td>
+</tr>
+</table>
+<br /><br />
+
+<table style='width: 100%;'>
+<tr>
+<td colspan='2' class='forumheader' style='width: 70%;'>Category</td>
+<td class='forumheader' style='width: 20%; text-align: center;'>Files</td>
+</tr>
+";
+
+$DOWNLOAD_CAT_CHILD_TABLE .= "
+<tr>
+<td class='forumheader3' style='width: 5%;'>{DOWNLOAD_CAT_SUB_ICON}</td>
+<td class='forumheader3' style='width: 75%;'>{DOWNLOAD_CAT_SUB_NAME_LINKED}</td>
+<td class='forumheader3' style='width: 20%; text-align: center; vertical-align: middle;'>{DOWNLOAD_CAT_SUB_COUNT} ({DOWNLOAD_CAT_SUB_SIZE})<br /><span class='smalltext'>".LAN_dl_6." {DOWNLOAD_CAT_SUB_DOWNLOADED}</span></td>
+</tr>
+";
+
+$DOWNLOAD_CAT_TABLE_END = "
+<tr><td class='forumheader3' colspan='5' style='text-align:right;'>{DOWNLOAD_CAT_SEARCH}</td></tr>
+</table>
+</div>\n";
+
+// ##### ------------------------------------------------------------------------------------------
+
+
+
+// ##### LIST TABLE -------------------------------------------------------------------------------
+
+
+$DOWNLOAD_LIST_TABLE_START = "
+
+<br /><br />
+<table style='width: 100%;'>
+<tr>
+<td class='forumheader3' style='width: 5%;'>{DOWNLOAD_CATEGORY_ICON}</td>
+<td class='forumheader3' style='width: 95%;'><h2>{DOWNLOAD_CATEGORY}</h2></td>
+</tr>
+</table>
+<br /><br />
+
+<div style='text-align:center; margin-left: auto; margin-right: auto;'>
+<form method='post' action='".e_SELF."?".e_QUERY."'>
+<table style='width:100%'>
+<tr>
+<td colspan='7' style='text-align:center'>
+<span class='defaulttext'>".LAN_dl_37."</span>
+<select name='view' class='tbox'>".
+($view == 5 ? "<option selected='selected'>5</option>" : "<option>5</option>").
+($view == 10 ? "<option selected='selected'>10</option>" : "<option>10</option>").
+($view == 15 ? "<option selected='selected'>15</option>" : "<option>15</option>").
+($view == 20 ? "<option selected='selected'>20</option>" : "<option>20</option>").
+($view == 50 ? "<option selected='selected'>50</option>" : "<option>50</option>")."
+</select>
+&nbsp;
+<span class='defaulttext'>".LAN_dl_38."</span>
+<select name='order' class='tbox'>".
+($order == "download_datestamp" ? "<option value='download_datestamp' selected='selected'>".LAN_dl_22."</option>" : "<option value='download_datestamp'>".LAN_dl_22."</option>").
+($order == "download_requested" ? "<option value='download_requested' selected='selected'>".LAN_dl_18."</option>" : "<option value='download_requested'>".LAN_dl_18."</option>").
+($order == "download_name" ? "<option value='download_name' selected='selected'>".LAN_dl_23."</option>" : "<option value='download_name'>".LAN_dl_23."</option>").
+($order == "download_author" ? "<option value='download_author' selected='selected'>".LAN_dl_24."</option>" : "<option value='download_author'>".LAN_dl_24."</option>")."
+</select>
+&nbsp;
+<span class='defaulttext'>".LAN_dl_39."</span>
+<select name='sort' class='tbox'>".
+($sort == "ASC" ? "<option value='ASC' selected='selected'>".LAN_dl_25."</option>" : "<option value='ASC'>".LAN_dl_25."</option>").
+($sort == "DESC" ? "<option value='DESC' selected='selected'>".LAN_dl_26."</option>" : "<option value='DESC'>".LAN_dl_26."</option>")."
+</select>
+&nbsp;
+<input class='button' type='submit' name='goorder' value='".LAN_dl_27."' />
+</td>
+</tr>
+<tr class='fcaption'>
+<td style='width:35%; text-align:center' class='smalltext'>".LAN_dl_28."</td>
+<td style='width:15%; text-align:center' class='smalltext'>".LAN_dl_22."</td>
+<td style='width:20%; text-align:center' class='smalltext'>".LAN_dl_24."</td>
+<td style='width:10%; text-align:center' class='smalltext'>".LAN_dl_21."</td>
+<td style='width:5%; text-align:center' class='smalltext'>".LAN_dl_29."</td>
+<td style='width:10%; text-align:center' class='smalltext'>".LAN_dl_12."</td>
+<td style='width:5%; text-align:center' class='smalltext'>".LAN_dl_8."</td>
+</tr>";
+
+
+$DOWNLOAD_LIST_TABLE .= "
+<tr>
+<td class='forumheader3' style='text-align:left;'>{DOWNLOAD_LIST_NEWICON} {DOWNLOAD_LIST_NAME}</td>
+<td class='smalltext' style='text-align:center;'>{DOWNLOAD_LIST_DATESTAMP}</td>
+<td class='smalltext' style='text-align:center;'>{DOWNLOAD_LIST_AUTHOR}</td>
+<td class='smalltext' style='text-align:center;'>{DOWNLOAD_LIST_FILESIZE}</td>
+<td class='smalltext' style='text-align:center;'>{DOWNLOAD_LIST_REQUESTED}</td>
+<td class='smalltext' style='text-align:center;'>{DOWNLOAD_LIST_RATING}</td>
+<td class='smalltext' style='text-align:center;'>{DOWNLOAD_LIST_LINK} {DOWNLOAD_LIST_ICON}</td>
+</tr>
+";
+
+$DOWNLOAD_LIST_TABLE_END = "
+<tr><td class='smalltext' colspan='7' style='text-align:right;'>{DOWNLOAD_LIST_TOTAL_AMOUNT} {DOWNLOAD_LIST_TOTAL_FILES}</td></tr>
+</table>
+</form>
+</div>
+";
+
+// ##### ------------------------------------------------------------------------------------------
+
+
+// ##### VIEW TABLE -------------------------------------------------------------------------------
+
+$DOWNLOAD_VIEW_TABLE_START = "
+<div style='text-align:center'>
+<table class='fborder' style='width:100%'>
+";
+
+$DOWNLOAD_VIEW_TABLE .= "
+<tr>
+<td colspan='2' class='fcaption' style='text-align:left;'>
+{DOWNLOAD_VIEW_NAME}
+</td>
+</tr>
+
+<tr>
+<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOR_LAN}</td>
+<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOR}</td>
+</tr>
+
+<tr>
+<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOREMAIL_LAN}</td>
+<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOREMAIL}</td>
+</tr>
+
+<tr>
+<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHORWEBSITE_LAN}</td>
+<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHORWEBSITE}</td>
+</tr>
+
+<tr>
+<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_DESCRIPTION_LAN}</td>
+<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_DESCRIPTION}</td>
+</tr>
+
+<tr>
+<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_IMAGE_LAN}</td>
+<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_IMAGE}</td>
+</tr>
+
+<tr>
+<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_FILESIZE_LAN}</td>
+<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_FILESIZE}</td>
+</tr>
+
+<tr>
+<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_REQUESTED_LAN}</td>
+<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_REQUESTED}</td>
+</tr>
+
+<tr>
+<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_LINK_LAN}</td>
+<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_LINK}</td>
+</tr>
+
+<tr>
+<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_RATING_LAN}</td>
+<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_RATING}</td>
+</tr>
+";
+
+$DOWNLOAD_VIEW_TABLE_END = "
+</table>
+</div>
+";
+
+// ##### ------------------------------------------------------------------------------------------
+
+// ##### MIRROR LIST -------------------------------------------------------------------------------
+
+
+$DOWNLOAD_MIRROR_START = "
+<div style='text-align:center'>
+<table class='fborder' style='width:100%'>
+<tr>
+<td class='fcaption' colspan='4'>{DOWNLOAD_MIRROR_REQUEST}</td>
+</tr>
+<tr>
+<td class='forumheader' style='width: 30%; text-align: center;'>{DOWNLOAD_MIRROR_HOST_LAN}</td>
+<td class='forumheader' style='width: 40%;'>{DOWNLOAD_MIRROR_DESCRIPTION_LAN}</td>
+<td class='forumheader' style='width: 20%; text-align: center;'>{DOWNLOAD_MIRROR_LOCATION_LAN}</td>
+<td class='forumheader' style='width: 10%; text-align: center;'>{DOWNLOAD_MIRROR_GET_LAN}</td>
+</tr>
+";
+
+$DOWNLOAD_MIRROR = "
+<tr>
+<td class='forumheader3' style='width: 30%; text-align: center;'>{DOWNLOAD_MIRROR_IMAGE}<br /><br /><div class='smalltext'>{DOWNLOAD_MIRROR_REQUESTS}<br />{DOWNLOAD_TOTAL_MIRROR_REQUESTS}</div></td>
+<td class='forumheader3' style='width: 40%'><div class='smalltext'>{DOWNLOAD_MIRROR_DESCRIPTION}</div></td>
+<td class='forumheader3' style='width: 20%;; text-align: center;'>{DOWNLOAD_MIRROR_LOCATION}</td>
+<td class='forumheader3' style='width: 10%; text-align: center;'><div class='smalltext'>{DOWNLOAD_MIRROR_LINK} {DOWNLOAD_MIRROR_FILESIZE}</div></td>
+</tr>
+";
+
+$DOWNLOAD_MIRROR_END = "
+</table>
+</div>
+";
+
+// ##### ------------------------------------------------------------------------------------------
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/khatru/forum_posted_template.php 75/e107_themes/khatru/forum_posted_template.php
--- 6171/e107_themes/khatru/forum_posted_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/forum_posted_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,58 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/khatru/forum_posted_template.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$FORUMPOLLPOSTED =
+BOXOPEN.LAN_133.BOXMAIN."
+<table style='width:100%' class='fborder'>
+<tr>
+<td style='text-align:right; vertical-align:center; width:20%'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%'>
+<br /><b>".LAN_413."</b><br />
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_id."'>".LAN_414."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>".BOXCLOSE;
+
+$FORUMTHREADPOSTED = 
+BOXOPEN.LAN_133.BOXMAIN."
+<table style='width:100%' class='fborder'>
+<tr>
+<td style='text-align:right; vertical-align:center; width:20%'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%'>
+<br /><b>".LAN_324."</b><br />
+".(defined("F_MESSAGE") ? F_MESSAGE."<br />" : "")."
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>".BOXCLOSE;
+
+
+$FORUMREPLYPOSTED = 
+BOXOPEN.LAN_133.BOXMAIN."
+<table style='width:100%' class='fborder'>
+<tr>
+<td style='text-align:right; vertical-align:center; width:20%'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%'>
+<br /><b>".LAN_415."</b><br />
+".(defined("F_MESSAGE") ? F_MESSAGE."<br />" : "")."
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>".BOXCLOSE;
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/khatru/forum_post_template.php 75/e107_themes/khatru/forum_post_template.php
--- 6171/e107_themes/khatru/forum_post_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/forum_post_template.php	2005-12-21 11:03:51.000000000 -0600
@@ -0,0 +1,114 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/khatru/forum_post_template.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/21 17:03:51 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// the user box and subject box are not always displayed, therefore we need to define them /in case/ they are, if not they'll be ignored.
+
+$userbox = "<tr>
+<td class='forumheader2' style='width:20%'>".LAN_61."</td>
+<td class='forumheader2' style='width:80%'>
+<input class='tbox' type='text' name='anonname' size='71' value='".$anonname."' maxlength='20' />
+</td>
+</tr>";
+
+$subjectbox = "<tr>
+<td class='forumheader2' style='width:20%'>".LAN_62."</td>
+<td class='forumheader2' style='width:80%'>
+<input class='tbox' type='text' name='subject' size='71' value='".$subject."' maxlength='100' />
+</td>
+</tr>";
+
+// the poll is optional, be careful when changing the values here, only change if you know what you're doing ...
+
+require_once(e_PLUGIN."poll/poll_class.php");
+$pollo = new poll;
+$poll = $pollo -> renderPollForm("forum");
+
+// finally, file attach is optional, again only change this if you know what you're doing ...
+
+$fileattach = "<tr><td colspan='2' class='nforumcaption2'>".($pref['image_post'] ? LAN_390 : LAN_416)."</td></tr>
+<tr><td style='width:20%' class='forumheader3'>".LAN_392."</td>
+<td style='width:80%' class='forumheader3'>".LAN_393." | ".$allowed_filetypes." |<br />".LAN_394."<br />".LAN_395.": ".($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'].LAN_396 : ini_get('upload_max_filesize'))."
+<br />
+
+<div id='fiupsection'>
+<span id='fiupopt'><input class='tbox' name='file_userfile[]' type='file' size='47'></span>
+</div>
+<input class='button' type='button' name='addoption' value='".LAN_417."' onclick=\"duplicateHTML('fiupopt','fiupsection')\" />
+</td>
+</tr>
+</td>
+</tr>";
+
+
+// ------------
+
+
+$FORUMPOST = "
+{FORMSTART}
+".BOXOPEN."{BACKLINK}".BOXMAIN."
+
+<div style='text-align:center'>
+<table style='width:100%' class='fborder'>
+{USERBOX}
+{SUBJECTBOX}
+<tr>
+<td class='forumheader2' style='width:20%; vertical-align:top;'>{POSTTYPE}</td>
+<td style='width:80%'>
+{POSTBOX}<br />{EMOTES}<br />{EMAILNOTIFY}<br />{POSTTHREADAS}
+</td>
+</tr>
+{POLL}
+{FILEATTACH}
+<tr style='vertical-align:top'>
+<td colspan='2' class='nforumcaption2' style='text-align:center'>
+{BUTTONS}
+</table>
+{FORMEND}
+</div>
+{FORUMJUMP}".BOXCLOSE;
+
+
+$FORUMTHREADPOSTED = 
+BOXOPEN.LAN_133.BOXMAIN."
+<table style='width:100%'>
+<tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_324."<br />
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_id."'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>".BOXCLOSE;
+
+
+$FORUMREPLYPOSTED = 
+BOXOPEN.LAN_133.BOXMAIN."
+<table style='width:100%'>
+<tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_324."<br />
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>".BOXCLOSE;
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/khatru/forum_preview_template.php 75/e107_themes/khatru/forum_preview_template.php
--- 6171/e107_themes/khatru/forum_preview_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/forum_preview_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,31 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/khatru/forum_preview_template.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$FORUM_PREVIEW = 
+($action != "nt" ? "" : " ( ".LAN_62.$tsubject." )")."
+<table style='width:100%'>
+<td style='width:20%' style='vertical-align:top'><b>".$poster."</b></td>
+<td style='width:80%'>
+<div class='smallblacktext' style='text-align:right'>".IMAGE_post2." ".LAN_322.$postdate."</div><br />".$tpost."</td>
+</tr>
+</table>";
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/khatru/forum_template.php 75/e107_themes/khatru/forum_template.php
--- 6171/e107_themes/khatru/forum_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/forum_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,74 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/khatru/forum_template.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+$FORUM_MAIN_START = "";
+
+$FORUM_MAIN_PARENT = 
+BOXOPEN."<b>{PARENTNAME} {PARENTSTATUS}</b>".BOXMAIN."
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td colspan='2' style='width:60%; text-align:center' class='nforumcaption2'>{FORUMTITLE}</td>
+<td style='width:10%; text-align:center' class='nforumcaption2'>{THREADTITLE}</td>
+<td style='width:10%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>
+<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>
+</tr>
+";
+
+
+$FORUM_MAIN_PARENT_END = "
+</table>".BOXCLOSE;
+
+$FORUM_MAIN_FORUM = "<tr>\n<td style='width:5%; text-align:center' class='nforumcaption3'>{NEWFLAG}</td>\n<td style='width:55%' class='nforumcaption3'>{FORUMNAME}<br /><span class='smallblacktext'>{FORUMDESCRIPTION}</span>{FORUMSUBFORUMS}</td>\n<td style='width:10%; text-align:center' class='nforumthread'>{THREADS}</td>\n<td style='width:10%; text-align:center' class='nforumthread'>{REPLIES}</td>\n<td style='width:20%; text-align:center' class='nforumthread'><span class='smallblacktext'>{LASTPOST}</span></td>\n</tr>";
+
+
+$FORUM_MAIN_END = 
+BOXOPEN."<b>{INFOTITLE}</b>".BOXMAIN."
+
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>\n<tr>\n<td rowspan='4' style='width:5%; text-align:center' class='nforumthread'>{LOGO}</td>\n<td style='width:auto' class='nforumthread'>{USERINFO}</td>\n</tr>\n<tr>\n<td style='width:95%' class='nforumthread'>{INFO}</td>\n</tr><tr>\n<td style='width:95%' class='nforumthread'>{FORUMINFO}</td>\n</tr>\n<tr>\n<td style='width:95%' class='nforumthread'>{USERLIST}<br />{STATLINK}</td>\n</tr>\n</table>\n</div>\n<div class='spacer'>\n<table class='nforumholder' style='width:98%' cellpadding='0' cellspacing='0'>\n<tr>\n<td class='nforumthread' style='text-align:center; width:33%'>{ICONKEY}</td>\n<td style='text-align:center; width:33%' class='nforumthread'>{SEARCH}</td>\n<td style='width:33%; text-align:center; vertical-align:middle' class='nforumthread'><span class='smallblacktext'>{PERMS}</span>\n</td>\n</tr>\n</table><div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div>".BOXCLOSE;
+
+
+$FORUM_NEWPOSTS_START = "<div style='text-align:center'>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td style='width:3%' class='fcaption'>&nbsp;</td>\n<td style='width:60%' class='fcaption'>{NEWTHREADTITLE}</td>\n<td style='width:27%; text-align:center' class='fcaption'>{POSTEDTITLE}</td>\n</tr>";
+
+
+
+$FORUM_NEWPOSTS_MAIN .= "<tr>\n<td style='width:3%' class='forumheader3'>{NEWIMAGE}</td>\n<td style='width:60%' class='forumheader3'>{NEWSPOSTNAME}</td>\n<td style='width:27%; text-align:center' class='forumheader3'>{STARTERTITLE}</td>\n</tr>";
+ 
+
+
+$FORUM_NEWPOSTS_END .= "</table></div></div>";
+ 
+
+
+$FORUM_TRACK_START = "<div style='text-align:center'>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td colspan='3' style='width:60%' class='fcaption'>{TRACKTITLE}</td>\n</tr>\n";
+
+
+$FORUM_TRACK_MAIN = "<tr>
+<td style='text-align:center; vertical-align:middle; width:6%'  class='forumheader3'>{NEWIMAGE}</td>
+<td style='vertical-align:middle; text-align:left; width:70%'  class='forumheader3'><span class='mediumtext'>{TRACKPOSTNAME}</span></td>
+<td style='vertical-align:middle; text-align:center; width:24%'  class='forumheader3'><span class='mediumtext'>{UNTRACK}</td>
+</tr>";
+                
+
+
+$FORUM_TRACK_END = "</table>\n</div>\n</div>";
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/khatru/forum_viewforum_template.php 75/e107_themes/khatru/forum_viewforum_template.php
--- 6171/e107_themes/khatru/forum_viewforum_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/forum_viewforum_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,136 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/khatru/forum_viewforum_template.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$icon = (file_exists(THEME."forum/e.png") ? THEME."forum/e.png" : e_PLUGIN."forum/images/lite/e.png");
+
+
+
+
+ $FORUM_VIEW_START = 
+BOXOPEN."{BREADCRUMB}".BOXMAIN."
+
+<table style='width:100%'>
+<tr>
+<td style='width:80%'><div class='newheadline'><img src='".$icon."' style='vertical-align:middle' /> <b>{FORUMTITLE} Forum</b></div>{THREADPAGES}</td>
+<td style='width:20%; text-align:right; vertical-align:bottom;'>
+{NEWTHREADBUTTON}
+</td>
+</tr>
+</table>
+
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='width:3%' class='nforumcaption2'>&nbsp;</td>
+<td style='width:47%' class='nforumcaption2'>{THREADTITLE}</td>
+<td style='width:20%; text-align:center' class='nforumcaption2'>{STARTERTITLE}</td>
+<td style='width:5%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>
+<td style='width:5%; text-align:center' class='nforumcaption2'>{VIEWTITLE}</td>
+<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>
+</tr>
+
+
+";
+
+
+
+$FORUM_VIEW_FORUM = "
+<tr>
+<td style='vertical-align:middle; text-align:center; width:3%' class='nforumview1'>{ICON}</td>
+<td style='vertical-align:middle; text-align:left; width:47%'  class='nforumview1'>
+
+<table style='width:100%'>
+<tr>
+<td style='width:90%'><span class='mediumtext'><b>{THREADNAME}</b></span> <span class='smalltext'>{PAGES}</span></td>
+<td style='width:10%; white-space:nowrap;'>{ADMIN_ICONS}</td>
+</tr>
+</table>
+</td>
+
+<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'><b>{POSTER}</b><br />{THREADDATE}</span></td>
+<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{REPLIES}</span></td>
+<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{VIEWS}</span></td>
+<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'>{LASTPOST}</span></td>
+</tr>";
+
+ $FORUM_VIEW_END = "
+</table>
+<table style='width:100%'>
+<tr>
+<td style='width:80%'><span class='mediumtext'>{THREADPAGES}</span>
+{FORUMJUMP}
+</td>
+<td style='width:20%; text-align:right'>
+{NEWTHREADBUTTON}
+</td>
+</tr>
+</table>
+".
+BOXCLOSE.BOXOPEN2."
+
+<table style='width:100%' cellpadding=0 cellspacing=0>
+<tr>
+<td style='vertical-align:center; width:50%'><span class='smalltext'>{MODERATORS}</span></td>
+<td style='text-align:right; vertical-align:center; width:50%'><span class='smalltext'>{BROWSERS}</span></td>
+</tr>
+<tr>
+<td style='vertical-align:center; width:50%'>{ICONKEY}</td>
+<td style='vertical-align:center; text-align:center; width:50%'>{PERMS}<br /><br />{SEARCH}
+</td>
+</tr>
+</table>
+
+
+<div style='text-align:center;'>
+<a href='".e_PLUGIN."rss_menu/rss.php?11.1.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss1.png' alt='".LAN_431."' style='vertical-align: middle; border: 0;' /></a> 
+<a href='".e_PLUGIN."rss_menu/rss.php?11.2.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss2.png' alt='".LAN_432."' style='vertical-align: middle; border: 0;' /></a> 
+<a href='".e_PLUGIN."rss_menu/rss.php?11.3.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss3.png' alt='".LAN_433."' style='vertical-align: middle; border: 0;' /></a>
+</div>
+<div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b>".BOXCLOSE2."</div>";
+
+
+$FORUM_VIEW_SUB_START = "
+<tr>
+<td colspan='2'>
+<table style='width:100%'  cellpadding='0' cellspacing='0'>
+<tr>
+<td class='nforumcaption2' style='width: 50%'>".FORLAN_20."</td>
+<td class='nforumcaption2' style='width: 10%; text-align: center;'>".FORLAN_21."</td>
+<td class='nforumcaption2' style='width: 10%; text-align: center;'>".LAN_55."</td>
+<td class='nforumcaption2' style='width: 30%; text-align: center;'>".FORLAN_22."</td>
+</tr>
+";
+
+$FORUM_VIEW_SUB = "
+<tr>
+<td class='nforumview2' style='text-align:left'><b>{SUB_FORUMTITLE}</b><br />{SUB_DESCRIPTION}</td>
+<td class='nforumview2' style='text-align:center'>{SUB_THREADS}</td>
+<td class='nforumview2' style='text-align:center'>{SUB_REPLIES}</td>
+<td class='nforumview2' style='text-align:center'>{SUB_LASTPOST}</td>
+</tr>
+";
+
+$FORUM_VIEW_SUB_END = "
+</table>
+</td>
+</tr>
+";
+
+ ?>
\ No newline at end of file
diff -ruN 6171/e107_themes/khatru/forum_viewtopic_template.php 75/e107_themes/khatru/forum_viewtopic_template.php
--- 6171/e107_themes/khatru/forum_viewtopic_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/forum_viewtopic_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,151 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/khatru/forum_viewtopic_template.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$icon = (file_exists(THEME."forum/e.png") ? THEME."forum/e.png" : e_PLUGIN."forum/images/lite/e.png");
+
+
+$FORUMSTART =
+BOXOPEN."{BACKLINK}".BOXMAIN."
+
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td class='smalltext'>{NEXTPREV}</td>
+<td style='text-align:right'>&nbsp;{TRACK}&nbsp;</td>
+</tr>
+</table>
+
+<table style='width:100%'>
+<tr>
+<td style='width:60%; vertical-align:middle;'><div class='newheadline'><img src='".$icon."' style='vertical-align:middle' alt=''/> <b>{THREADNAME}</b></div><br />{GOTOPAGES}</td>
+<td style='width:40%; vertical-align:middle; text-align:right;'>{BUTTONS}</td>
+</tr>
+</table>
+
+
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='width:20%; text-align:center' class='nforumcaption2'>\n".LAN_402."\n</td>\n<td style='width:80%; text-align:center' class='nforumcaption2'>\n".LAN_403."\n</td>
+</tr>
+</table>
+
+
+";
+
+$FORUMEND = "
+
+<div class='spacer'>
+{GOTOPAGES}
+</div>
+<table style='width:100%' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='width:50%; text-align:left; vertical-align:top'><b>{MODERATORS}</b><br />{FORUMJUMP}</td>
+<td style='width:50%; text-align:right; vertical-align:top'>{BUTTONS}</td>
+</tr>
+</table>
+</div>
+<div class='spacer'>
+
+<div style='text-align:center'>{QUICKREPLY}</div>
+
+
+<div style='text-align:center;'>
+<a href='".e_PLUGIN."rss_menu/rss.php?8.1.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss1.png' alt='".LAN_431."' style='vertical-align: middle; border: 0;' /></a> 
+<a href='".e_PLUGIN."rss_menu/rss.php?8.2.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss2.png' alt='".LAN_432."' style='vertical-align: middle; border: 0;' /></a> 
+<a href='".e_PLUGIN."rss_menu/rss.php?8.3.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss3.png' alt='".LAN_433."' style='vertical-align: middle; border: 0;' /></a>
+</div>
+
+<div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div>
+".BOXCLOSE;
+
+
+
+
+
+
+
+
+
+$FORUMTHREADSTYLE = "
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td class='nforumreplycaption' style='vertical-align:middle; width:20%;'>\n{NEWFLAG}\n{POSTER}\n</td>
+<td class='nforumreplycaption' style='vertical-align:middle; width:80%;'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td class='smallblacktext'>\n{THREADDATESTAMP}\n</td>
+<td style='text-align:right'>\n{REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n</td>
+</tr>
+</table>
+</td>
+</tr>	
+<tr>
+<td class='nforumreply2' style='vertical-align:top'>\n{AVATAR}\n<span class='smalltext'>\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n</span>\n</td>
+<td class='nforumreply2' style='vertical-align:top'>{POLL}\n{POST}\n{SIGNATURE}\n</td>
+</tr>		
+<tr>
+<td class='nforumreplycaption'>\n<span class='smallblacktext'>\n{TOP}\n</span>\n</td>
+<td class='nforumreplycaption' style='vertical-align:top'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td>\n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n</td>
+<td style='text-align:right'>\n{MODOPTIONS}\n</td>
+</tr>
+</table>
+</td>
+</tr>	
+</table>
+</div>";
+
+
+$FORUMREPLYSTYLE = "
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td class='nforumreplycaption' style='vertical-align:middle; width:20%;'>\n{NEWFLAG}\n{POSTER}\n</td>
+<td class='nforumreplycaption' style='vertical-align:middle; width:80%;'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td class='smallblacktext'>\n{THREADDATESTAMP}\n</td>
+<td style='text-align:right'>\n{REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n</td>
+</tr>
+</table>
+</td>
+</tr>	
+<tr>
+<td class='nforumreply2' style='vertical-align:top'>\n{AVATAR}\n<span class='smalltext'>\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n</span>\n</td>
+<td class='nforumreply2' style='vertical-align:top'>{POST}\n{SIGNATURE}</td>
+</tr>		
+<tr>
+<td class='nforumreplycaption'>\n<span class='smallblacktext'>\n{TOP}\n</span>\n</td>
+<td class='nforumreplycaption' style='vertical-align:top'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td>\n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n</td>
+<td style='text-align:right'>\n{MODOPTIONS}\n</td>
+</tr>
+</table>
+</td>
+</tr>		
+</table>
+</div>";
+
+?>
\ No newline at end of file
Files 6171/e107_themes/khatru/images/background.png and 75/e107_themes/khatru/images/background.png differ
Files 6171/e107_themes/khatru/images/blank.gif and 75/e107_themes/khatru/images/blank.gif differ
Files 6171/e107_themes/khatru/images/bottomleft.png and 75/e107_themes/khatru/images/bottomleft.png differ
Files 6171/e107_themes/khatru/images/bottom.png and 75/e107_themes/khatru/images/bottom.png differ
Files 6171/e107_themes/khatru/images/bottomright.png and 75/e107_themes/khatru/images/bottomright.png differ
Files 6171/e107_themes/khatru/images/bullet2.gif and 75/e107_themes/khatru/images/bullet2.gif differ
Files 6171/e107_themes/khatru/images/bullet.png and 75/e107_themes/khatru/images/bullet.png differ
Files 6171/e107_themes/khatru/images/button.png and 75/e107_themes/khatru/images/button.png differ
Files 6171/e107_themes/khatru/images/icon.png and 75/e107_themes/khatru/images/icon.png differ
Files 6171/e107_themes/khatru/images/left.png and 75/e107_themes/khatru/images/left.png differ
Files 6171/e107_themes/khatru/images/logo1.png and 75/e107_themes/khatru/images/logo1.png differ
Files 6171/e107_themes/khatru/images/logo2.png and 75/e107_themes/khatru/images/logo2.png differ
Files 6171/e107_themes/khatru/images/logo3.png and 75/e107_themes/khatru/images/logo3.png differ
Files 6171/e107_themes/khatru/images/menubg2.png and 75/e107_themes/khatru/images/menubg2.png differ
Files 6171/e107_themes/khatru/images/menubg.png and 75/e107_themes/khatru/images/menubg.png differ
Files 6171/e107_themes/khatru/images/nforumcaption2.png and 75/e107_themes/khatru/images/nforumcaption2.png differ
Files 6171/e107_themes/khatru/images/nforumcaption.png and 75/e107_themes/khatru/images/nforumcaption.png differ
Files 6171/e107_themes/khatru/images/right.png and 75/e107_themes/khatru/images/right.png differ
Files 6171/e107_themes/khatru/images/top2.png and 75/e107_themes/khatru/images/top2.png differ
Files 6171/e107_themes/khatru/images/topleft2.png and 75/e107_themes/khatru/images/topleft2.png differ
Files 6171/e107_themes/khatru/images/topleft.png and 75/e107_themes/khatru/images/topleft.png differ
Files 6171/e107_themes/khatru/images/top.png and 75/e107_themes/khatru/images/top.png differ
Files 6171/e107_themes/khatru/images/topright2.png and 75/e107_themes/khatru/images/topright2.png differ
Files 6171/e107_themes/khatru/images/topright.png and 75/e107_themes/khatru/images/topright.png differ
diff -ruN 6171/e107_themes/khatru/languages/English.php 75/e107_themes/khatru/languages/English.php
--- 6171/e107_themes/khatru/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/languages/English.php	2005-09-13 02:25:04.000000000 -0500
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/khatru/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/09/13 07:25:04 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "'khatru' by <a href='http://e107.org' rel='external'>jalist</a>");
+define("LAN_THEME_2", "Comments are turned off for this item");
+define("LAN_THEME_3", "comment: ");
+define("LAN_THEME_4", "Read the rest ...");
+define("LAN_THEME_5", "Trackbacks: ");
+
+
+?>
diff -ruN 6171/e107_themes/khatru/newforumpost.php 75/e107_themes/khatru/newforumpost.php
--- 6171/e107_themes/khatru/newforumpost.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/newforumpost.php	2006-01-13 07:27:22.000000000 -0600
@@ -0,0 +1,13 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$NEWFORUMPOSTSTYLE_HEADER = "
+<!-- newforumposts -->\n<ul>\n";
+
+$NEWFORUMPOSTSTYLE_MAIN = "<li><span class='smalltext'>{THREAD} by {POSTER} [ views: {VIEWS}, replies: {REPLIES}, lastpost: {LASTPOST} ]\n</span>\n</li>\n";
+
+$NEWFORUMPOSTSTYLE_FOOTER = "</ul>\n<br /><br />\n<span class='smalltext'>".NFPM_LAN_6.": <b>{TOTAL_TOPICS}</b> | ".NFPM_LAN_4.": <b>{TOTAL_REPLIES}</b> | ".NFPM_LAN_3.": <b>{TOTAL_VIEWS}</b></span>";
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/khatru/news_template.php 75/e107_themes/khatru/news_template.php
--- 6171/e107_themes/khatru/news_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/news_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,31 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$NEWSCOLUMNS = 2;
+
+$NEWSCLAYOUT = "
+<table style='width: 100%;'>
+<tr>
+<td style='width: 48%; vertical-align: top;'>{ITEMS1}</td>
+<td style='width: 4%;'></td>
+<td style='width: 48%; vertical-align: top;'>{ITEMS2}</td>
+</tr>
+</table>
+";
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/khatru/poll_template.php 75/e107_themes/khatru/poll_template.php
--- 6171/e107_themes/khatru/poll_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/poll_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,157 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$POLL_NOTVOTED_START = "
+<div style='text-align:center'>
+<p>
+{QUESTION}
+</p>
+</div>
+<p>
+<br />
+";
+
+$POLL_NOTVOTED_LOOP = "
+{OPTIONBUTTON}{OPTION}
+<br /><br />";
+
+$POLL_NOTVOTED_END = "
+</p>
+<div style='text-align:center' class='smalltext'>
+<p>
+{SUBMITBUTTON}
+<br /><br />
+{AUTHOR}
+<br />
+{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</p>
+</div>";
+
+/* ################################# */
+/*		template for polls when user HAS voted ...			*/
+
+$POLL_VOTED_START = "
+<div style='text-align:center'>
+{QUESTION}
+</div>
+<br />
+";
+
+$POLL_VOTED_LOOP = "
+<b>{OPTION}</b>
+<br /><div class='spacer'>{BAR}</div><br />
+<span class='smalltext'>{VOTES} | {PERCENTAGE}</span>
+<br /><br />
+";
+
+$POLL_VOTED_END = "
+<div style='text-align:center' class='smalltext'>
+{AUTHOR}
+<br />
+{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</div>
+";
+
+
+/* ################################# */
+/*		template for polls when user CANNOT vote ...		*/
+
+
+$POLL_DISALLOWED_START = "
+<div style='text-align:center'>
+{QUESTION}
+</div>
+<br />
+";
+
+$POLL_DISALLOWED_LOOP = "
+<b>{OPTION}</b>
+<br /><br />
+";
+
+$POLL_DISALLOWED_END = "
+<div style='text-align:center' class='smalltext'>
+{DISALLOWMESSAGE}<br /><br />
+{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</div>
+";
+
+
+/* ################################# */
+/*		template for forum polls when user HASN'T voted*/
+
+$POLL_FORUM_NOTVOTED_START = "
+<div style='text-align:center; margin-left: auto; margin-right: auto;'>
+<table class='fborder' style='width: 350px;'>
+<tr>
+<td class='forumheader' style='width: 100%; text-align: center;'>
+<div id='pollquestion'>{QUESTION}</div>
+</td>
+</tr>
+<tr>
+<td class='forumheader3' style='width: 100%;'>";
+
+$POLL_FORUM_NOTVOTED_LOOP = "
+{OPTIONBUTTON}<b>{OPTION}</b>
+<br /><br />";
+
+$POLL_FORUM_NOTVOTED_END = "
+</td>
+</tr>
+
+<tr>
+<td class='forumheader' style='width: 100%;'>
+<div style='text-align:center' class='smalltext'>
+{SUBMITBUTTON}
+</div>
+</td>
+</tr>
+</table>
+</div>";
+
+
+/* ################################# */
+/*		template for forum polls when user HAS voted		*/
+
+$POLL_FORUM_VOTED_START = "
+<div style='text-align:center; margin-left: auto; margin-right: auto;'>
+<table class='fborder' style='width: 350px;'>
+<tr>
+<td class='forumheader' style='width: 100%; text-align: center;'>
+<div id='pollquestion'>{QUESTION}</div>
+</td>
+</tr>
+<tr>
+<td class='forumheader3' style='width: 100%;'>
+";
+
+$POLL_FORUM_VOTED_LOOP = "
+<b>{OPTION}</b>
+<br />{BAR}<br />
+<span class='smalltext'>{VOTES} | {PERCENTAGE}</span>
+<br /><br />
+";
+
+$POLL_FORUM_VOTED_END = "
+</td>
+</tr>
+
+<tr>
+<td class='forumheader' style='width: 100%;'>
+<div style='text-align:center' class='smalltext'>
+{VOTE_TOTAL}
+</div>
+</td>
+</tr>
+</table>
+</div>
+";
+
+?>
\ No newline at end of file
Files 6171/e107_themes/khatru/preview.png and 75/e107_themes/khatru/preview.png differ
diff -ruN 6171/e107_themes/khatru/style.css 75/e107_themes/khatru/style.css
--- 6171/e107_themes/khatru/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/style.css	2006-01-14 19:15:01.000000000 -0600
@@ -0,0 +1,476 @@
+
+body {
+	background: #ffffff url(images/background.png) no-repeat; text-align: left; margin: 12px;
+	font: 7pt Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	margin: 5px;
+	padding: 5px;
+}
+
+/* Header / logo ... */
+#header {
+	height: 124px;
+	width: 100%;
+	background: url(images/logo2.png) repeat-x;
+	float: left;
+}
+
+#logo1 {
+	position: absolute;
+	left:10px;
+	top:10px;
+	width: 192px;
+	height: 124px;
+	background: url(images/logo1.png) no-repeat;
+}
+
+#headerr {
+	position: absolute;
+	right:10px;
+	top:10px;
+	height: 124px;
+	width: 8px;
+	background-repeat: no-repeat;
+	background: url(images/logo3.png) no-repeat;
+}
+
+#banner {
+	position: absolute;
+	right:26px;
+	top:40px;
+}
+
+/* end */
+
+/* main layout ... */
+
+#mainbox {
+	width: 100%;
+	margin: 0; padding: 0;
+}
+
+
+#leftcontent {
+	position: absolute;
+	top: 136px;
+	left: 10px;
+	width: 18%;
+	margin:0; padding:0;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+#rightcontent {
+	position: absolute;
+	top: 136px;
+	right: 10px;
+	width: 18%;
+	margin:0; padding:0;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+
+}
+
+#centercontent {
+	font: 9px Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	margin-left: 20%;
+	width: 60%;
+}
+
+#footer {
+	text-align: center;
+	
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.clear {
+	clear: both;
+}
+
+
+
+
+
+
+
+.dcaption {
+    width: 100%;
+}
+
+.dcaption .left { background: url('images/topleft.png') no-repeat; float: left; height: 26px; width: 9px; margin-right: -3px; }
+.dcaption .right { background: url('images/topright.png') no-repeat; float: right; height: 26px; width: 9px; margin-left: -3px; }
+.dcaption .center {background-image: url('images/top.png'); color: #111; font: 10px Verdana, Tahoma, Arial, Helvetica, sans-serif; height: 26px; line-height: 26px; }
+
+.dbody {
+    width: 100%;
+}
+
+.dbody .leftwrapper {
+	margin:0; padding:0;
+	background: url("images/left.png") left repeat-y;
+}
+.dbody .rightwrapper {
+	margin:0; padding:0;
+	background: url("images/right.png") right repeat-y;
+}
+.dbody .leftcontent {
+	float:left;
+	width:9px;
+	margin:0; padding:0;
+}
+.dbody .rightcontent {
+	float:right;
+	width:9px;
+	margin:0; padding:0;
+}
+.dbody .dcenter {
+    background: #EEE url('images/menubg.png');
+	margin: 0 5px;
+}
+.dbody .dinner {
+	color: #222;
+    font: 9px Verdana, Tahoma, Arial, Helvetica, sans-serif;
+	padding: 4px;
+}
+
+.dbottom .left { background: url('images/bottomleft.png') no-repeat; float: left; height: 8px; width: 9px;  font-size: 1px; margin-right: -3px;}
+.dbottom .right { background: url('images/bottomright.png') no-repeat; float: right; height: 8px; width: 9px;  font-size: 1px; margin-left: -3px;}
+.dbottom .center {background-image: url('images/bottom.png');height: 8px;  font-size: 1px; }
+
+.dntop {
+	border-bottom: 1px solid #a9a9a9;
+	width: 99%;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+/* end */
+
+
+
+.tbox.chatbox {
+	width: 80%;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+
+a {
+	color: #00006e; 
+	font-family: verdana, arial, sans-serif; 
+	text-decoration: none;
+}
+a:hover {
+	color: #ec5800;
+	font-family: verdana, arial, sans-serif; 
+	text-decoration: underline;
+}
+
+
+.smalltext {
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+form {
+	display: inline;
+}
+.spacer {
+	padding: 2px 0 2px 0;
+}
+
+#wm {
+	voice-family: "\"}\"";
+	voice-family: inherit;
+	background: #f3eded url(images/wblogo.png) bottom right no-repeat;
+	border: 1px solid #ede3e3;
+	padding: 10px 150px 10px 10px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.button {	
+	border: #b7b5b5 1px solid;
+	color: #000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	background-image : url(images/button.png);
+}
+
+h1 {
+  font-size: 1.4em;
+  font-weight: bold;
+  margin-top: 0em;
+  margin-bottom: 0em;
+  color: #ec5800;
+}
+
+h2 {
+  font-size: 1.2em;
+  font-weight: bold;
+  margin-top: 0em;
+  margin-bottom: 0em;
+  color: #ec5800;
+}
+
+.newstext {
+	font-size: 8pt;
+	line-height: 120%;
+	color: black;
+	text-align: left;
+	font: 7pt verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.newheadline {
+	font-size: 13px;
+	color: #ec5800;
+}
+
+.newsinfo {
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.newsinfo a {
+	background: transparent;
+	color: #5d6e75; 
+}
+
+.newsinfo a:hover {
+	color: #ec5800;
+	text-decoration: underline;
+}
+
+
+
+
+
+#pollquestion {
+	font: 8pt Verdana, Tahoma, Arial, Helvetica, sans-serif;
+}
+
+.helpbox {
+	color:#000;
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	border: 0px none red;
+	background-color: transparent;
+}
+
+.nforumholder {
+	border: 1px solid #345487;
+	padding: 0px;
+	background: transparent;
+}
+
+.nforumcaption {
+	background-image: url(images/nforumcaption.png);
+	padding: 8px 4px 8px 4px;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #fff;
+}
+
+.nforumcaption2 {
+	background-image: url(images/nforumcaption2.png);
+	padding: 8px 0px 8px 4px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+
+.nforumcaption3 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-repeat: repeat-x repeat-y; background-image: url(images/menubg.png);
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-repeat: repeat-x repeat-y; background-image: url(images/menubg2.png);
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #D1DCEB;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreplycaption {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-repeat: repeat-x repeat-y; background-image: url(images/menubg2.png);
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-repeat: repeat-x repeat-y; background-image: url(images/menubg2.png);
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-repeat: repeat-x repeat-y; background-image: url(images/menubg.png);
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+.nforumdisclaimer {
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.nforumview1 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-repeat: repeat-x repeat-y; background-image: url(images/menubg.png);
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-repeat: repeat-x repeat-y; background-image: url(images/menubg.png);
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview3 {
+	padding: 4px;
+	background-color: #BCD0ED;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #263448;
+}
+
+.nforumview4 {
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #3A4F6C;
+}
+
+a.forumlink{
+	color: #4943c1;
+	text-decoration: none;
+}
+
+a.forumlink:hover {
+	color: #bbb;
+	text-decoration: underline;
+}
+
+td {
+	text-align: left;
+}
+
+.smallblacktext {
+	font: 10px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#000;
+	line-height: 120%;
+}
+
+.tbox{
+	background-color: #fff;
+	border: #b7b5b5 1px solid;
+	color: #000000;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.forumheader{
+	background: transparent;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	background-image: url(images/nforumcaption2.png);
+}
+
+.forumheader2{
+	background: transparent;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+}
+
+.forumheader3{
+	background: transparent;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+}
+
+.forumborder{
+	border: #000080 1px solid;
+}
+
+.chatb {
+	font-size: 12px;
+}
+
+.chatb a {
+	background: transparent;
+	color: #ec5800; 
+}
+
+.chatb a:hover {
+	color: #616060;
+	font-family: verdana, arial, sans-serif; 
+	text-decoration: underline;
+}
+
+p {
+	margin-top: 0px
+}
+
+.indent{
+	padding: 10px 10px 10px 10px;
+	margin: 5px;
+	font: 9px verdana, tahoma, arial, sans-serif;
+	color: #838387;
+	border: 1px solid #d6d6d6;
+}
+
+.nextprev{
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	padding : 2px;
+	text-align: right;
+}
+
+ul {
+	padding-left: 12px;
+}
+
+.commentinfo {
+	background-image: url(images/nforumcaption2.png);
+	padding: 8px 0px 8px 4px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+
+.commentinfo a {
+	background: transparent;
+	color: #ec5800; 
+}
+
+.commentinfo a:hover {
+	color: #616060;
+	font-family: verdana, arial, sans-serif; 
+	text-decoration: underline;
+}
+
+.mediumtext {
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+
+.fcaption {
+	background-image: url(images/nforumcaption2.png);
+	padding: 8px 0px 8px 4px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+
+hr {
+	border-top: #666 1px solid;
+	border-bottom: #fff 1px solid;
+	height: 2px;
+	width: 99%;
+	text-align:center;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/khatru/theme.php 75/e107_themes/khatru/theme.php
--- 6171/e107_themes/khatru/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/khatru/theme.php	2006-01-14 19:15:01.000000000 -0600
@@ -0,0 +1,237 @@
+<?php
+/*
++---------------------------------------------------------------+
+|	e107 website system
+|
+|	�Steve Dunstan 2001-2005
+|	http://e107.org
+|	jalist@e107.org
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+@include_once(THEME."languages/".e_LANGUAGE.".php");
+@include_once(THEME."languages/English.php");
+
+// [theme]
+$themename = "khatru";
+$themeversion = "1.0";
+$themeauthor = "Steve Dunstan [jalist]";
+$themeemail = "jalist@e107.org";
+$themewebsite = "http://e107.org";
+$themedate = "28/05/2005";
+$themeinfo = "";
+define("STANDARDS_MODE", TRUE);
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+define("IMODE", "lite");
+define("THEME_DISCLAIMER", "<br /><i>".LAN_THEME_1."</i>");
+
+// [layout]
+
+$layout = "_default";
+
+
+define("BOXOPEN", "
+<div class='spacer'>
+<div class='dcaption'>
+<div class='left'></div>
+<div class='right'></div>
+<div class='center'>");
+
+define("BOXMAIN", "
+</div>
+</div>
+<div class='dbody'>
+<div class='leftwrapper'>
+<div class='rightwrapper'>
+<div class='leftcontent'></div>
+<div class='rightcontent'></div>
+<div class='dcenter'><div class='dinner'>
+");
+
+define("BOXCLOSE", "
+</div></div>
+</div>
+</div>
+</div>
+<div class='dbottom'>
+<div class='left'></div>
+<div class='right'></div>
+<div class='center'></div>
+</div>
+</div>");
+
+define("BOXOPEN2", "
+<div class='spacer'>
+<div class='dntop'></div>
+<div class='dbody'>
+<div class='leftwrapper'>
+<div class='rightwrapper'>
+<div class='leftcontent'></div>
+<div class='rightcontent'></div>
+<div class='dcenter'><div class='dinner'>
+");
+
+define("BOXCLOSE2", "
+</div></div>
+</div>
+</div>
+</div>
+<div class='dbottom'>
+<div class='left'></div>
+<div class='right'></div>
+<div class='center'></div>
+</div>
+</div>
+");
+
+
+
+$HEADER = "
+<div id='header'>
+<div id='logo1'>&nbsp;</div>
+<div id='headerr'>&nbsp;</div>
+<div id='banner'>
+{BANNER}
+</div>
+</div>
+
+
+<div id='mainbox'>
+	<div class='clear'>
+		<div id='leftcontent'>
+			{SITELINKS}
+			{MENU=1}
+		</div>
+		<div id='rightcontent'>
+			{MENU=2}
+		</div>
+		<div id='centercontent'>
+";
+
+
+$FOOTER = "
+		</div>
+	</div>
+	<div id='footer'>
+		{SITEDISCLAIMER}<br />{THEMEDISCLAIMER}
+		<br />
+		<a href='http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=86'><img alt='e107 recommends Firefox' title='e107 recommends Firefox' src=' http://sfx-images.mozilla.org/affiliates/Buttons/125x50/takebacktheweb_125x50.png' style='border: 0;' /></a>
+	</div>
+</div>
+";
+
+
+
+function tablestyle($caption, $text)
+{
+	echo "
+<div class='dcaption'>
+<div class='left'></div>
+<div class='right'></div>
+<div class='center'>$caption</div>
+</div>
+<div class='dbody'>
+<div class='leftwrapper'>
+<div class='rightwrapper'>
+<div class='leftcontent'></div>
+<div class='rightcontent'></div>
+<div class='dcenter'><div class='dinner'>$text</div></div>
+</div>
+</div>
+</div>
+<div class='dbottom'>
+<div class='left'></div>
+<div class='right'></div>
+<div class='center'></div>
+</div>
+";
+}
+
+// [linkstyle]
+
+define('PRELINK', "");
+define('POSTLINK', "");
+define('LINKSTART', "");
+define("LINKSTART_HILITE", "");
+define('LINKEND', "<br />");
+define('LINKDISPLAY', 2);
+define('LINKALIGN', "left");
+define("BULLET", "bullet.png");
+define("bullet", "bullet.png");
+
+$NEWSSTYLE = "
+<div class='newheadline'>
+{NEWSTITLE}
+</div>
+<div class='newsinfo'>
+{NEWSAUTHOR}
+, 
+{NEWSDATE}
+ // 
+{NEWSCOMMENTS}{TRACKBACK}
+</div>
+<br />
+<div class='newstext'>
+{NEWSBODY}
+{EXTENDED}
+</div>
+<br /><br />";
+define("ICONSTYLE", "float: left; border:0");
+define("COMMENTLINK", LAN_THEME_3);
+define("COMMENTOFFSTRING", LAN_THEME_2);
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", LAN_THEME_4);
+define("POST_EXTENDEDSTRING", " ]<br />");
+define("TRACKBACKSTRING", LAN_THEME_5);
+define("TRACKBACKBEFORESTRING", ", ");
+
+$CHATBOXSTYLE = "
+<br />
+<img src='".THEME."images/bullet.png' alt=''  />
+<span class='chatb'>{USERNAME}</span>
+<div class='smalltext'>
+{TIMEDATE}<br />
+</div>
+{MESSAGE}
+<br /><br />";
+
+$COMMENTSTYLE = "
+<table style='width:100%'>
+<tr>
+<td colspan='2' class='commentinfo'>
+{SUBJECT}
+<b>
+{USERNAME}
+</b>
+ |
+{TIMEDATE}
+</td>
+</tr>
+<tr>
+<td style='width:30%; vertical-align:top'>
+<div class='spacer'>
+{AVATAR}
+</div>
+<span class='smalltext'>
+{COMMENTS}
+<br />
+{JOINED}
+</span>
+<br/>
+{REPLY}
+</td>
+<td style='width:70%; vertical-align:top'>
+{COMMENT}
+<div style='text-align: right;' class='smallext'>{IPADDRESS}</div>
+</td>
+</tr>
+</table>
+<br />";
+
+?>
\ No newline at end of file
Files 6171/e107_themes/kubrick/images/01_linkbg1.gif and 75/e107_themes/kubrick/images/01_linkbg1.gif differ
Files 6171/e107_themes/kubrick/images/01_linkbg2.gif and 75/e107_themes/kubrick/images/01_linkbg2.gif differ
Files 6171/e107_themes/kubrick/images/bar.jpg and 75/e107_themes/kubrick/images/bar.jpg differ
Files 6171/e107_themes/kubrick/images/bullet2.gif and 75/e107_themes/kubrick/images/bullet2.gif differ
Files 6171/e107_themes/kubrick/images/kubrickbgcolor.jpg and 75/e107_themes/kubrick/images/kubrickbgcolor.jpg differ
Files 6171/e107_themes/kubrick/images/kubrickbg.jpg and 75/e107_themes/kubrick/images/kubrickbg.jpg differ
Files 6171/e107_themes/kubrick/images/kubrickbgwide.jpg and 75/e107_themes/kubrick/images/kubrickbgwide.jpg differ
Files 6171/e107_themes/kubrick/images/kubrickfooter.jpg and 75/e107_themes/kubrick/images/kubrickfooter.jpg differ
Files 6171/e107_themes/kubrick/images/kubrickheader.jpg and 75/e107_themes/kubrick/images/kubrickheader.jpg differ
Files 6171/e107_themes/kubrick/images/tileage.jpg and 75/e107_themes/kubrick/images/tileage.jpg differ
diff -ruN 6171/e107_themes/kubrick/languages/English.php 75/e107_themes/kubrick/languages/English.php
--- 6171/e107_themes/kubrick/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/kubrick/languages/English.php	2005-08-29 11:22:56.000000000 -0500
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/kubrick/languages/English.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/08/29 16:22:56 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "'kubrick' by <a href='http://e107.org' title='e107.org' rel='external'>jalist</a> &amp; <a href='http://e107themes.org' title='e107themes.org' rel='external'>Que</a>, Based on original theme by Michael Heilemann (<a href='http://binarybonsai.com/kubrick/' title='http://binarybonsai.com/kubrick/' rel='external'>http://binarybonsai.com/kubrick/</a>. ).");
+define("LAN_THEME_2", "Comments are turned off for this item");
+define("LAN_THEME_3", "comment: ");
+define("LAN_THEME_4", "Read the rest ...");
+define("LAN_THEME_5", "Trackbacks: ");
+
+
+?>
Files 6171/e107_themes/kubrick/preview.jpg and 75/e107_themes/kubrick/preview.jpg differ
diff -ruN 6171/e107_themes/kubrick/style.css 75/e107_themes/kubrick/style.css
--- 6171/e107_themes/kubrick/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/kubrick/style.css	2006-01-26 20:30:59.000000000 -0600
@@ -0,0 +1,459 @@
+/*   
+	Kubrick v1.2.5  for  e107
+	http://binarybonsai.com/kubrick/
+	This theme was designed and built by Michael Heilemann,
+	whose blog you will find at http://binarybonsai.com/
+	The CSS, XHTML and design is released under GPL:
+	http://www.opensource.org/licenses/gpl-license.php
+	Maintainer: William Moffett [Que~]
+*/
+
+/* BEGIN TYPOGRAPHY & COLORS */
+body {
+	margin: 0;
+	padding: 0; 
+	font-size: 62.5%; /* Resets 1em to 10px */
+	font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
+	color: #333;
+	text-align: center;
+	background:#d5d6d7 url("images/kubrickbgcolor.jpg");
+}
+
+a {
+	color: #06c;
+	text-decoration: none;
+}
+
+a:hover {
+	color: #147;
+	text-decoration: none;
+}
+
+h1 {
+	font-size: 4em;
+}
+
+h2 {
+	font-size: 1.6em;
+	color: #333;
+}
+
+h3 {
+	font-size: 1.3em;
+}
+
+h1, h2, h3 {
+	font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
+	font-weight: bold;
+}
+
+td {
+    background: none;
+	font-family: tahoma, verdana, arial, helvetica, sans-serif;
+	font-size: 10px;
+	font-style: normal;
+	color:#5d6e75;
+	padding: 0px;
+	text-align:left;
+}
+
+acronym, abbr, span.caps {
+	cursor: help;
+	}
+
+acronym, abbr {
+	border-bottom: 1px dashed #999;
+	}
+
+blockquote {
+	margin: 15px 30px 0 10px;
+	padding-left: 20px;
+	border-left: 5px solid #ddd;
+	}
+
+blockquote cite {
+	margin: 5px 0 0;
+	display: block;
+	}
+
+hr {
+	display: none;
+	}
+
+a img {
+	border: none;
+	}
+
+.hidden{
+	display:none;
+}
+
+/* BEGIN LAYOUT */
+
+#page {
+	margin: 20px auto;
+	padding: 0;
+	width: 760px;
+	border: 1px solid #959596;
+	text-align: left;
+	background:white url("images/kubrickbg.jpg") repeat-y top; border: none;
+}
+
+#page2 {
+	margin: 20px auto;
+	padding: 0;
+	width: 760px;
+	border: 1px solid #959596;
+	text-align: left;
+	background:white url("images/kubrickbgwide.jpg") repeat-y top; border: none;
+}
+
+#header {
+	position:relative;
+	padding: 0;
+	margin: 0 auto;
+	height: 200px;
+	width: 100%;
+	background: #73a0c5 url("images/kubrickheader.jpg") no-repeat bottom center; 
+}
+
+#header h1{
+	position:absolute;
+	top:50px;
+	left:0px;
+	width: 100%;
+	padding: 0;
+	margin: 0 auto;
+	font-size: 4em;
+	text-align: center;
+}
+
+#header h1 a, #header h1 a:hover{
+	color:white;
+}
+
+#header h2 {
+	position:absolute;
+	top:100px;
+	left:0px;
+	width: 100%;
+	padding: 0;
+	margin: 0 auto;
+	font-size: 1.2em;
+	text-align: center;
+	color: #ffffff;
+}
+
+/* UL NAVIGATION ADDED BY QUE~ */
+
+#navigation{
+	font-size: 11px;
+	width: 694px;
+	height: 22px; 
+	position: absolute;
+	top: 178px;
+	left: 13px;
+	list-style: none;
+}
+
+#navigation li{
+	background: none;
+ 	display: inline;
+}
+
+/* END UL NAVIGATION */
+
+#content {
+	margin-top:22px;
+	font-size: 1.2em
+}
+
+#sidebar{
+
+}
+
+#sidebar {
+	margin:22px 0px 0px 545px;
+	padding: 20px 0 10px 0;
+	width: 190px;
+	font: 1em 'Lucida Grande', Verdana, Arial, Sans-Serif;
+}
+
+.narrowcolumn {
+	float: left;
+	padding: 0 0 20px 45px;
+	margin: 0px 0 0;
+	width: 450px;
+}
+
+.widecolumn {
+	padding: 10px 0 10px 0;
+	margin: 5px 0 0 5px;
+	width: 700px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.narrowcolumn .entry, .widecolumn .entry {
+	line-height: 1.4em;
+}
+
+.widecolumn {
+	line-height: 1.6em;
+}
+
+#footer {
+	padding: 0;
+	margin: 0 auto;
+	width: 760px;
+	clear: both;
+	background:transparent url("images/kubrickfooter.jpg") bottom left no-repeat;
+}
+
+#footer p {
+	margin: 0;
+	padding: 10px 0;
+	text-align: center;
+}
+
+/* END LAYOUT  */
+
+
+/* BEGIN E107 CORE CLASSES MAINTAINER QUE~ */
+
+.button{
+	font-family: tahoma, verdana, arial, helvetica, sans-serif;
+	font-size: 10px;
+	text-align:center;
+}
+
+.tbox.chatbox {
+	width: 80%;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.spacer {
+	padding: 2px 0 2px 0;
+}
+
+
+.indent{
+	padding:4px;
+	border: 1px solid #06c;
+}
+
+.smalltext {
+	font: 1em 'Lucida Grande', Verdana, Arial, Sans-Serif;
+}
+
+.mediumtext {
+	font: 12px 'Lucida Grande', Verdana, Arial, Sans-Serif;
+}
+
+.tbox{
+	background-color: #F4F7FA;
+	border: #5e5d63 1px solid;
+	color: #000000;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.helpbox {
+	border: 0px;
+	background-color: transparent;
+	color:#000;
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+}
+
+.fborder {
+	border: #ededed 1px solid;
+	background-color: #fff;
+	
+}
+
+.forumheader{
+	background-color: #EBEFF2;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 11px;
+	color:#000;
+	padding: 4px;
+	border: 1px solid #ededed;
+}
+
+.forumheader2{
+	background-color: #fff;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 10px;
+	color:#000;
+	padding: 4px;
+	border: #ededed 1px solid;
+}
+
+.forumheader3{
+	background-color: #fff;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #ededed 1px solid;
+
+}
+
+.forumborder{
+	border:  #000080 1px solid;
+	background-color: transparent;
+}
+
+.fcaption {
+	height:35px;
+	border: #ededed 1px solid;
+	padding: 2px 0 2px 8px;
+	background-color: #68ADE5;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#fff;
+	font-weight:bold;
+	background-image: url("images/tileage.jpg");
+
+}
+.fcaption a{
+	padding-right:4px;
+	color:#fff;
+
+}
+
+/* "Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you.
+	It won't be a stylish marriage, I can't afford a carriage.
+	But you'll look sweet upon the seat of a bicycle built for two." */
+
+
+/* START NAVIGATION */
+
+/* THIS PART IS FOR THE NAVIGATION LINKS */
+.nav1 a:link, .nav1 a:visited, .nav2 a:link, .nav2 a:visited, .nav3 a:link, .nav3 a:visited, .nav4 a:link, .nav4 a:visited, .nav5 a:link, .nav5 a:visited, .nav6 a:link, .nav6 a:visited, .nav7 a:link, .nav7 a:visited, .nav8 a:link, .nav8 a:visited{
+	color: #4E4E4E;
+	width: 80px;
+	height: 20px;
+	line-height: 20px;
+	background: url(images/01_linkbg2.gif) top repeat-y;
+	padding: 0;
+	text-align:center;
+}
+
+.nav1_onpage a:link, .nav1_onpage a:visited, .nav2_onpage a:link, .nav2_onpage a:visited, .nav3_onpage a:link, .nav3_onpage a:visited, .nav4_onpage a:link, .nav4_onpage a:visited, .nav5_onpage a:link, .nav5_onpage a:visited, .nav6_onpage a:link, .nav6_onpage a:visited, .nav7_onpage a:link, .nav7_onpage a:visited, .nav8_onpage a:link, .nav8_onpage a:visited{
+	color: #4E4E4E;
+	width: 80px;
+	height: 20px;
+	line-height: 20px;
+	background: url(images/01_linkbg2.gif) top repeat-y;
+	padding: 0;
+	text-align:center;
+}
+
+.nav1 a:link, .nav1 a:visited, .nav1_onpage a:link, .nav1_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 14px;
+}
+
+.nav2 a:link, .nav2 a:visited, .nav2_onpage a:link, .nav2_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 96px;
+}
+.nav3 a:link, .nav3 a:visited, .nav3_onpage a:link, .nav3_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 178px;
+}
+
+.nav4 a:link, .nav4 a:visited, .nav4_onpage a:link, .nav4_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 260px;
+}
+
+.nav5 a:link, .nav5 a:visited, .nav5_onpage a:link, .nav5_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 342px;
+}
+
+.nav6 a:link, .nav6 a:visited, .nav6_onpage a:link, .nav6_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 424px;
+}
+
+.nav7 a:link, .nav7 a:visited, .nav7_onpage a:link, .nav7_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 506px;
+}
+
+.nav8 a:link, .nav8 a:visited, .nav8_onpage a:link, .nav8_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 588px;
+}
+
+/* HOVER EFFECTS */
+
+.nav1 a:hover, .nav1 a:active,
+.nav2 a:hover, .nav2 a:active,
+.nav3 a:hover, .nav3 a:active,
+.nav4 a:hover, .nav4 a:active,
+.nav5 a:hover, .nav5 a:active,
+.nav6 a:hover, .nav6 a:active,
+.nav7 a:hover, .nav7 a:active,
+.nav8 a:hover, .nav8 a:active{
+	background: url(images/01_linkbg1.gif) top repeat-y;
+	margin: 1px 0 0 0;
+}
+
+/* USE A DIFFERENT COLOR WHEN USER IS ON THAT PAGE */
+
+.nav1_onpage a:link, .nav1_onpage a:visited,
+.nav2_onpage a:link, .nav2_onpage a:visited,
+.nav3_onpage a:link, .nav3_onpage a:visited,
+.nav4_onpage a:link, .nav4_onpage a:visited,
+.nav5_onpage a:link, .nav5_onpage a:visited,
+.nav6_onpage a:link, .nav6_onpage a:visited,
+.nav7_onpage a:link, .nav7_onpage a:visited,
+.nav8_onpage a:link, .nav8_onpage a:visited{
+	background: url(images/01_linkbg1.gif) top repeat-y;
+}
+
+/* END NAVIGATION */
+
+/* NICETITLE ADDED BY QUE~*/
+
+.nicetitle {
+	font-weight: bold;
+	color: #3C3C3C;
+	text-align: left;
+	position: absolute;
+	left: 0;
+	top: 0;
+	width: 35em;
+	z-index: 20;
+	max-width: 60%;
+}
+.nicetitle-content{
+	overflow: hidden;
+	background: white;
+	border: 1px solid #333;
+	padding: 7px;
+	opacity: 0.9;
+}
+.nicetitle p{
+	margin: 0;
+	line-height: 120%;
+}
+.nicetitle p.destination {
+	font-weight: normal;
+	font-size: 10px;
+	color: #5E7743;
+}
+div.nicetitle p span.accesskey {
+	color: #FF7200;
+}
+
diff -ruN 6171/e107_themes/kubrick/theme.js 75/e107_themes/kubrick/theme.js
--- 6171/e107_themes/kubrick/theme.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/kubrick/theme.js	2006-01-26 20:30:12.000000000 -0600
@@ -0,0 +1,348 @@
+// from http://www.kryogenix.org
+// by Scott Andrew - http://scottandrew.com
+// add an eventlistener to browsers that can do it somehow.
+function addEvent(obj, evType, fn)
+	{
+	if (obj.addEventListener)
+		{
+		obj.addEventListener(evType, fn, false);
+		return true;
+		}
+	else if (obj.attachEvent)
+		{
+		var r = obj.attachEvent('on'+evType, fn);
+		return r;
+		}
+	else
+		{
+		return false;
+		}
+	}
+
+
+// Force IE not to show alternate text as tooltip
+function noAltTooltip()
+	{
+	images = document.getElementsByTagName('img');
+	for (var i = 0; i < images.length; i++)
+		{
+		var title = images[i].getAttribute('title');
+		var alt = images[i].getAttribute('alt');
+		if ((document.all) && (alt) && (!title))
+			{
+			images[i].setAttribute('title', '');
+			}
+		}
+	}
+
+// Nice Titles
+
+// original code by Stuart Langridge 2003-11
+// with additions to the code by other good people
+// http://www.kryogenix.org/code/browser/nicetitle/
+// thank you, sir
+
+// modified by Peter Janes 2003-03-25
+// http://peterjanes.ca/blog/archives/2003/03/25/nicetitles-for-ins-and-del
+// added in ins and del tags
+
+// modified by Dunstan Orchard 2003-11-18
+// http://1976design.com/blog/
+// added in accesskey information
+// tried ever-so-hard, but couldn't work out how to do what Ethan did
+
+// final genius touch by by Ethan Marcotte 2003-11-18
+// http://www.sidesh0w.com/
+// worked out how to delay showing the popups to make them more like the browser's own
+
+// set the namespace
+var XHTMLNS = 'http://www.w3.org/1999/xhtml';
+var CURRENT_NICE_TITLE;
+
+// browser sniff
+var browser = new Browser();
+
+// determine browser and version.
+function Browser()
+	{
+	var ua, s, i;
+
+	this.isIE = false;
+	this.isNS = false;
+	this.version = null;
+
+	ua = navigator.userAgent;
+
+	s = 'MSIE';
+	if ((i = ua.indexOf(s)) >= 0)
+		{
+		this.isIE = true;
+		this.version = parseFloat(ua.substr(i + s.length));
+		return;
+		}
+
+	s = 'Netscape6/';
+	if ((i = ua.indexOf(s)) >= 0)
+		{
+		this.isNS = true;
+		this.version = parseFloat(ua.substr(i + s.length));
+		return;
+		}
+
+	// treat any other 'Gecko' browser as NS 6.1.
+	s = 'Gecko';
+	if ((i = ua.indexOf(s)) >= 0)
+		{
+		this.isNS = true;
+		this.version = 6.1;
+		return;
+		}
+	}
+
+// 2003-11-19 sidesh0w
+// set delay vars to emulate normal hover delay
+var delay;
+var interval = 0.60;
+
+// this function runs on window load
+// it runs through all the links on the page as starts listening for actions
+function makeNiceTitles()
+	{
+	if (!document.createElement || !document.getElementsByTagName) return;
+	if (!document.createElementNS)
+		{
+		document.createElementNS = function(ns, elt)
+			{
+			return document.createElement(elt);
+			}
+		}
+
+	// do regular links
+	if (!document.links)
+		{
+		document.links = document.getElementsByTagName('a');
+		}
+	for (var ti=0; ti<document.links.length; ti++)
+		{
+		var lnk = document.links[ti];
+		// * I added specific class names here..
+		if (lnk.title)
+			{
+			lnk.setAttribute('nicetitle', lnk.title);
+			lnk.removeAttribute('title');
+			addEvent(lnk, 'mouseover', showDelay);
+			addEvent(lnk, 'mouseout', hideNiceTitle);
+			addEvent(lnk, 'focus', showDelay);
+			addEvent(lnk, 'blur', hideNiceTitle);
+			}
+		}
+
+	// 2003-03-25 Peter Janes
+	// do ins and del tags
+	var tags = new Array(2);
+	tags[0] = document.getElementsByTagName('ins');
+	tags[1] = document.getElementsByTagName('del');
+	for (var tt=0; tt<tags.length; tt++)
+		{
+		if (tags[tt])
+			{
+			for (var ti=0; ti<tags[tt].length; ti++)
+				{
+				var tag = tags[tt][ti];
+				if (tag.dateTime)
+					{
+					var strDate = tag.dateTime;
+					// HTML/ISO8601 date: yyyy-mm-ddThh:mm:ssTZD (Z, -hh:mm, +hh:mm)
+					var month = strDate.substring(5,7);
+					var day = strDate.substring(8,10);
+					if (month[0] == '0')
+						{
+						month = month[1];
+						}
+					if (day[0] == '0')
+						{
+						day = day[1];
+						}
+					var dtIns = new Date(strDate.substring(0,4), month-1, day, strDate.substring(11,13), strDate.substring(14,16), strDate.substring(17,19));
+					tag.setAttribute('nicetitle', (tt == 0 ? 'Added' : 'Deleted') + ' on ' + dtIns.toString());
+					addEvent(tag, 'mouseover', showDelay);
+					addEvent(tag, 'mouseout', hideNiceTitle);
+					addEvent(tag, 'focus', showDelay);
+					addEvent(tag, 'blur', hideNiceTitle);
+					}
+				}
+			}
+		}
+	}
+
+function findPosition(oLink)
+	{
+	if (oLink.offsetParent)
+		{
+		for (var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent)
+			{
+			posX += oLink.offsetLeft;
+			posY += oLink.offsetTop;
+			}
+		return [posX, posY];
+		}
+	else
+		{
+		return [oLink.x, oLink.y];
+		}
+	}
+
+function getParent(el, pTagName)
+	{
+	if (el == null)
+		{
+		return null;
+		}
+	// gecko bug, supposed to be uppercase
+	else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())
+		{
+		return el;
+		}
+	else
+		{
+		return getParent(el.parentNode, pTagName);
+		}
+	}
+
+// 2003-11-19 sidesh0w
+// trailerpark wrapper function
+function showDelay(e)
+	{
+    if (window.event && window.event.srcElement)
+		{
+        lnk = window.event.srcElement
+		}
+	else if (e && e.target)
+		{
+        lnk = e.target
+		}
+    if (!lnk) return;
+
+	// lnk is a textnode or an elementnode that's not ins/del
+    if (lnk.nodeType == 3 || (lnk.nodeType == 1 && lnk.tagName.toLowerCase() != 'ins' && lnk.tagName.toLowerCase() != 'del'))
+		{
+		// ascend parents until we hit a link
+		lnk = getParent(lnk, 'a');
+		}
+
+	delay = setTimeout("showNiceTitle(lnk)", interval * 1000);
+	}
+
+// build and show the nice titles
+function showNiceTitle(link)
+	{
+    if (CURRENT_NICE_TITLE) hideNiceTitle(CURRENT_NICE_TITLE);
+    if (!document.getElementsByTagName) return;
+
+    nicetitle = lnk.getAttribute('nicetitle');
+
+    var d = document.createElementNS(XHTMLNS, 'div');
+    d.className = 'nicetitle';
+    var dc = document.createElementNS(XHTMLNS, 'div');
+    dc.className = 'nicetitle-content';
+    d.appendChild(dc);
+    tnt = document.createTextNode(nicetitle);
+    pat = document.createElementNS(XHTMLNS, 'p');
+    pat.className = 'titletext';
+    pat.appendChild(tnt);
+
+	// 2003-11-18 Dunstan Orchard
+	// added in accesskey info
+	if (lnk.accessKey)
+		{
+        axs = document.createTextNode(' [' + lnk.accessKey + ']');
+		axsk = document.createElementNS(XHTMLNS, 'span');
+        axsk.className = 'accesskey';
+        axsk.appendChild(axs);
+		pat.appendChild(axsk);
+		}
+    dc.appendChild(pat);
+
+    if (lnk.href)
+		{
+        tnd = document.createTextNode(lnk.href);
+        pad = document.createElementNS(XHTMLNS, 'p');
+        pad.className = 'destination';
+        pad.appendChild(tnd);
+        dc.appendChild(pad);
+		}
+
+    STD_WIDTH = 300;
+
+	if (lnk.href)
+		{
+        h = lnk.href.length;
+		}
+	else
+		{
+		h = nicetitle.length;
+		}
+
+    if (nicetitle.length)
+		{
+		t = nicetitle.length;
+		}
+
+    h_pixels = h*6;
+	t_pixels = t*10;
+
+    if (h_pixels > STD_WIDTH)
+		{
+        w = h_pixels;
+		}
+	else if ((STD_WIDTH>t_pixels) && (t_pixels>h_pixels))
+		{
+        w = t_pixels;
+		}
+	else if ((STD_WIDTH>t_pixels) && (h_pixels>t_pixels))
+		{
+        w = h_pixels;
+		}
+	else
+		{
+        w = STD_WIDTH;
+		}
+
+    d.style.width = w + 'px';
+
+    mpos = findPosition(lnk);
+    mx = mpos[0];
+    my = mpos[1];
+
+    d.style.left = (mx+15) + 'px';
+    d.style.top = (my+35) + 'px';
+
+    if (window.innerWidth && ((mx+w) > window.innerWidth))
+		{
+        d.style.left = (window.innerWidth - w - 25) + 'px';
+		}
+    if (document.body.scrollWidth && ((mx+w) > document.body.scrollWidth))
+		{
+        d.style.left = (document.body.scrollWidth - w - 25) + 'px';
+		}
+
+    document.getElementsByTagName('body')[0].appendChild(d);
+
+    CURRENT_NICE_TITLE = d;
+	}
+
+function hideNiceTitle(e)
+	{
+	// 2003-11-19 sidesh0w
+	// clearTimeout
+	if (delay) clearTimeout(delay);
+	if (!document.getElementsByTagName) return;
+	if (CURRENT_NICE_TITLE)
+		{
+		document.getElementsByTagName('body')[0].removeChild(CURRENT_NICE_TITLE);
+		CURRENT_NICE_TITLE = null;
+		}
+	}
+addEvent(window, "load", noAltTooltip);
+addEvent(window, "load", makeNiceTitles);
+
diff -ruN 6171/e107_themes/kubrick/theme.php 75/e107_themes/kubrick/theme.php
--- 6171/e107_themes/kubrick/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/kubrick/theme.php	2006-01-26 20:30:59.000000000 -0600
@@ -0,0 +1,150 @@
+<?php
+/*
++---------------------------------------------------------------+
+|	e107 website system
+|
+|	Steve Dunstan 2001-2005
+|	http://e107.org
+|	jalist@e107.org
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).
+|
+|   $Revision: 1.20 $
+|   $Date: 2006/01/27 02:30:59 $
+|   $Author: qnome $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+
+@include_once(e_THEME."kubrick/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."kubrick/languages/English.php");
+
+// [theme]
+$themename = "kubrick";
+$themeversion = "1.0";
+$themeauthor = "Steve Dunstan [jalist] &amp; William Moffett [Que]";
+$themeemail = "jalist@e107.org";
+$themewebsite = "http://e107.org";
+$themedate = "29/01/2005";
+$themeinfo = "Based on 'kubrick' by Michael Heilemann (http://binarybonsai.com/kubrick/).<br />This theme is intended for minimilist blog sites.";
+define("STANDARDS_MODE", TRUE);
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+define("IMODE", "lite");
+define("THEME_DISCLAIMER", "<br /><i>".LAN_THEME_1."</i>");
+
+if(!defined("e_THEME")){ exit; }
+$page=substr(strrchr($_SERVER['PHP_SELF'], "/"), 1);
+define("e_PAGE", $page);
+
+$register_sc[]= "UL";  // register shortcode ul.sc for inclusion.
+
+// [layout]
+
+$layout = "_default";
+
+$HEADER = "<div id='page'>
+<div id='header'>
+<h1><a href='".SITEURL."' title='{SITENAME}'>{SITENAME}</a></h1>
+<h2>{SITETAG}</h2>
+{UL}
+</div>
+<div id='content' class='narrowcolumn'>";
+
+$FOOTER = "
+</div>
+<div id='sidebar'>
+{MENU=1}
+{MENU=2}
+</div>
+<hr />
+<div id='footer'>
+<p>
+{SITEDISCLAIMER}<br />{THEMEDISCLAIMER}
+</p>
+</div>
+</div>
+";
+
+$CUSTOMHEADER = "<div id='page2'>
+<div id='header'>
+<h1><a href='".SITEURL."' title='{SITENAME}'>{SITENAME}</a></h1>
+<h2>{SITETAG}</h2>
+{UL}
+</div>
+<div id='content' class='widecolumn'>";
+
+
+$CUSTOMFOOTER = "
+</div>
+<hr />
+<div id='footer'>
+<p>
+{SITEDISCLAIMER}<br />{THEMEDISCLAIMER}
+</p>
+</div>
+</div>
+";
+
+$CUSTOMPAGES = "forum.php forum_post.php forum_viewforum.php forum_viewtopic.php user.php submitnews.php download.php links.php stats.php usersettings.php signup.php";
+
+$NEWSSTYLE = "
+<h2>{NEWSTITLE}</h2>
+<small>on {NEWSDATE} | by {NEWSAUTHOR}</small>
+<div class='entry' style='text-align:left'>
+{NEWSBODY}
+{EXTENDED}
+</div>
+<div style='text-align:right' class='smalltext'>
+{NEWSCOMMENTS}{TRACKBACK}
+</div>
+<br />";
+define("ICONSTYLE", "float: left; border:0");
+define("COMMENTLINK", LAN_THEME_3);
+define("COMMENTOFFSTRING", LAN_THEME_2);
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", LAN_THEME_4);
+define("POST_EXTENDEDSTRING", " ]<br />");
+define("TRACKBACKSTRING", LAN_THEME_5);
+define("TRACKBACKBEFORESTRING", " | ");
+
+
+// [linkstyle]
+
+define('PRELINK', "");
+define('POSTLINK', "");
+define('LINKSTART', "");
+define('LINKEND', "");
+define('LINKDISPLAY', 1);
+define('LINKALIGN', "left");
+define('LINKCLASS', "");
+
+//	[tablestyle]
+
+function tablestyle($caption, $text, $mode)
+{
+	echo "<h3>$caption</h3>\n<div>$text</div><br />\n";
+}
+
+$COMMENTSTYLE = "
+<table style='width: 450px;'>
+<tr>
+<td style='width: 30%; vertical-align: top;'><span class='mediumtext'>{USERNAME}</span><br /><span class='smalltext'>{TIMEDATE}</span><br />{AVATAR}{REPLY}</td>
+<td style='width: 70%; vertical-align: top;'><span class='mediumtext'>{COMMENT} {COMMENTEDIT}</span></td>
+</tr>
+</table>";
+
+
+$CHATBOXSTYLE = "
+<img src='".e_IMAGE."admin_images/chatbox_16.png' alt='' style='vertical-align: middle;' />
+<b>{USERNAME}</b>
+<div class='smalltext'>
+{MESSAGE}
+</div>
+<br />";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/kubrick/ul.sc 75/e107_themes/kubrick/ul.sc
--- 6171/e107_themes/kubrick/ul.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/kubrick/ul.sc	2006-01-17 22:16:13.000000000 -0600
@@ -0,0 +1,33 @@
+global $sql, $page, $link_class;
+$sql -> db_Select('links', '*', "link_category = 1 and link_name NOT REGEXP('submenu') and link_name NOT REGEXP('child') and link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC");
+$ulmenu = "<ul id='navigation'>";
+$r="1";
+while($row = $sql -> db_Fetch()){
+	if(!$link_class || check_class($link_class) || ($link_class==254 && USER)){
+		if($r <= "8"){
+			extract($row);
+			$ltest = (e_QUERY ? e_PAGE."?".e_QUERY : e_PAGE);
+			$rtest=substr(strrchr($link_url, "/"), 1);
+			if(!preg_match("#(http:|mailto:|ftp:)#",$link_url)){ $link_url = e_BASE.$link_url; }
+			if($ltest == $link_url || $rtest == e_PAGE){ $ulclass = '_onpage'; } else { $ulclass = ''; }
+			switch ($link_open) { 
+				case 1:
+					$link_append = " onclick=\"window.open('$link_url'); return false;\"";
+					break; 
+				case 2:
+				   $link_append = " target=\"_parent\"";
+					break;
+				case 3:
+				   $link_append = " target=\"_top\"";
+					break;
+				default:
+				   unset($link_append);
+			}
+			$ulmenu .= "<li class='nav".$r."$ulclass'><a".($link_description ? " title = '$link_description' " : "")." href='".$link_url."'".$link_append.">".($r !="0" ? "".LINKSTART."" : "" )."$link_name</a></li>";
+		}
+		$r++;
+	}
+}
+$ulmenu .= "</ul>";
+return $ulmenu;
+
diff -ruN 6171/e107_themes/lamb/alt_style.css 75/e107_themes/lamb/alt_style.css
--- 6171/e107_themes/lamb/alt_style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/alt_style.css	2005-04-03 04:09:55.000000000 -0500
@@ -0,0 +1,491 @@
+
+/* info: this alternative stylesheet uses pure css for layout, no tables, but cross browser issues mean it isn't as stable as the layout that uses tables. To use you have to rename alt_theme.php to theme.php */
+
+.intwrapper {
+	width: 100%;
+}
+
+#mainleft {
+	margin:0; padding:0;
+	background: #fff url("images/left.png") top left repeat-y;
+}
+#mainright {
+	margin:0; padding:0;
+	background:url("images/right.png") top right repeat-y;
+}
+#leftcontent {
+	float:left;
+	width:180px;
+	margin:0; padding:0;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+#rightcontent {
+	float:right;
+	width:180px;
+	margin:0; padding:0;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.menuwrapper {
+	width: 98%;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+#centercontent {
+	margin:0 180px;
+	background:#fff;
+}
+.columnwrap {
+	margin:0; padding:0.5em 1em;
+}
+.cleaner {
+	clear:both;
+	height:1px;
+	font-size:1px;
+	border:none;
+	margin:0; padding:0;
+	background:transparent;
+}
+
+#header {
+	height: 80px;
+	width: 100%;
+	background-repeat: repeat-x;
+	background-image: url(images/logobg.png);
+	border-bottom: 1px solid black;
+}
+
+#logo {
+	position: absolute;
+	left:0px;
+	top:0px;
+	height: 80px;
+	width: 216px;
+	background-image: url(images/logo.png);
+	background-repeat: no-repeat;
+}
+
+#quote {
+	position: absolute;
+	left:6px;
+	top:60px;
+	color: #176f8f;
+}
+
+#banner {
+	position: absolute;
+	right:6px;
+	top:10px;
+}
+
+#wm {
+	voice-family: "\"}\"";
+	voice-family: inherit;
+	background: #f3eded url(images/wblogo.png) bottom right no-repeat;
+	border: 1px solid #ede3e3;
+	padding: 10px 150px 10px 10px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+#bqtop {
+  width: 252px;
+  padding-top: 7px;
+  background: url(images/boxtop.png) top left no-repeat;
+  margin-bottom: 15px;
+}
+
+#lbqtop {
+  width: 450px;
+  padding-top: 7px;
+  background: url(images/lboxtop.png) top left no-repeat;
+  margin-bottom: 15px;
+}
+
+#bqbottom {
+  background: url(images/boxbottom.png) bottom left no-repeat;
+  padding-bottom: 7px;
+  width: 100%;
+}
+
+#lbqbottom {
+  background: url(images/lboxbottom.png) bottom left no-repeat;
+  padding-bottom: 7px;
+  width: 100%;
+}
+
+#bglefright {
+  padding: 11px 14px 12px 15px;
+  border-left: 1px solid #DADADA;
+  border-right: 1px solid #DADADA;
+}
+
+#centre {
+	margin-left: auto;
+	margin-right: auto;
+	text-align: center;
+}
+
+#bqcontent { 
+  margin-left: 4px; 
+}
+
+#bqtext {
+  font-size: 10px; 
+  color: #666;
+}
+
+ul{
+	list-style: square;
+}
+
+
+#footer {
+	border-top: 1px solid #000;
+	width: 100%;
+}
+
+h1 {
+  font-size: 1.4em;
+  font-weight: bold;
+  margin-top: 0em;
+  margin-bottom: 0em;
+  color: #ec5800;
+}
+
+h2 {
+	font: 12px arial, verdana, tahoma, helvetica, sans-serif;
+	color: #bbb;
+	text-transform: uppercase;
+	font-weight: bold;
+	margin-top: 2px;
+	margin-bottom: 0px;
+}
+
+h3 {
+	font: 12px tahoma, verdana, helvetica, arial, sans-serif;
+	color: #000;
+	font-weight: bold;
+	margin-top: 2px;
+	margin-bottom: 0px;
+}
+
+h4 {
+	font: 12px tahoma, verdana, helvetica, arial, sans-serif;
+	color: #000;
+	font-weight: bold;
+	margin-top: 2px;
+	margin-bottom: 0px;
+	background-color: #eae6e6;
+	padding: 2px;
+}
+
+img {
+	vertical-align: middle;
+}
+
+.dlmain {
+	font: 20px tahoma, verdana, helvetica, arial, sans-serif;
+	color: #000;
+}
+
+.dlcat {
+	font: 14px tahoma, verdana, helvetica, arial, sans-serif;
+	color: #000;
+	font-weight: bold;
+	margin-top: 2px;
+	margin-bottom: 0px;
+	padding: 2px;
+}
+
+
+
+
+hr {
+	border: 1px dotted #bbb;
+	height: 1px;
+	width: 92%;
+	text-align:center;
+}
+
+.smalltext {
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.bodytable {
+	padding: 2px;
+	font: 0.8em verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+
+.button {	
+	border: #000 1px solid;
+	color: #000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	background-image : url(images/button.png);
+}
+
+.button a {
+	color: #000;
+}
+.button a:hover {
+	color: #0085b0;
+}
+
+body {
+	font-size: 12px;
+	color: #000;
+	font-family: tahoma, verdana, arial, sans-serif;
+	background-color: #fff;
+	margin:0px;
+	text-align:left
+}
+a {
+	color: #0085b0; 
+	font-family: verdana, arial, sans-serif; 
+	text-decoration: underline;
+}
+a:hover {
+	color: #616060;
+	font-family: verdana, arial, sans-serif; 
+	text-decoration: underline;
+}
+
+.smallblacktext {
+    background: none;
+	font: 10px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#000;
+}
+.indent{
+	padding: 10px 10px 10px 10px;
+	margin: 5px;
+	font: 9px verdana, tahoma, arial, sans-serif;
+	color: #838387;
+	border: 1px solid #d6d6d6;
+}
+.defaulttext {
+    background: none;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+
+td {
+	font: 11px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#5d6e75;
+	padding: 0px;
+	text-align:left;
+}
+
+blockquote {
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	color:#7e96ac;
+	border: 1px solid #d6d6d6;
+}
+.mediumtext {
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+
+.tbox{
+	background-color: #F4F7FA;
+	border: #5e5d63 1px solid;
+	color: #000000;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nextprev{
+	background-color: #eaeef2;
+	border: #000 1px solid;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	padding : 2px;
+	text-align: right;
+}
+
+form {
+	margin: 2px 0px 0px 0px;
+}
+.spacer {
+	padding: 2px 0 2px 0;
+}
+
+.cspacer {
+	padding: 6px 0 6px 0;
+	margin-left: auto;
+	margin-right: auto;
+	text-align: center;
+}
+
+.border {
+	border: #999 1px solid;
+	background-color: #F0F1F1;
+	padding: 2px;
+}
+
+
+p {
+	margin-top: 0px
+}
+
+.fborder {
+	border: #c1c1c1 1px solid;
+}
+.forumheader{
+	background-color: #f3f3f7;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	background-image : url('../e107_images/forum/fcap2.png');
+	border: 1px solid #ececf2;
+}
+
+.forumheader2{
+	background-color: #EFEFEF;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+}
+
+.forumheader3{
+	background-color: #f3f3f7;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #ececf2 1px solid;
+}
+
+.forumborder{
+	border: #000080 1px solid;
+}
+
+.fcaption {
+	border: #f0f2f4 1px solid;
+	padding: 2px 0 2px 0;
+	background-color: #f9fafb;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#616060;
+}
+
+.finfobar{
+	background-color: #CCC8C8;
+	color:#000;
+	padding: 4px;
+	border: 1px solid #C3BDBD;
+	background-image : url('../e107_images/forum/finfobar.png');font-style:normal; font-variant:normal; font-weight:normal; font-size:11px; font-family:verdana, tahoma, arial, helvetica, sans-serif
+}
+
+.helpbox {
+	color:#000;
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	border: 0px none red;
+	background-color: transparent;
+}
+
+.nforumholder {
+	border: 1px solid #345487;
+	padding: 0px;
+	background-color: #fff;
+}
+
+.nforumcaption {
+	background-image: url(images/nforumcaption.png);
+	padding: 8px 4px 8px 4px;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #fff;
+}
+
+.nforumcaption2 {
+	background-image: url(images/nforumcaption2.png);
+	padding: 8px 0px 8px 4px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+	font-weight: bold;
+}
+
+.nforumcaption3 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #EEF2F7;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #D1DCEB;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreplycaption {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E2EDF2;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #EDF4F7;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #CFE0EB;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+.nforumdisclaimer {
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.nforumview1 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #DFE6EF;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview3 {
+	padding: 4px;
+	background-color: #BCD0ED;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #263448;
+}
+
+.nforumview4 {
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #3A4F6C;
+}
+
+a.forumlink{
+	color: #fff;
+	text-decoration: none;
+}
+
+a.forumlink:hover {
+	color: #bbb;
+	text-decoration: underline;
+}
diff -ruN 6171/e107_themes/lamb/alt_theme.php 75/e107_themes/lamb/alt_theme.php
--- 6171/e107_themes/lamb/alt_theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/alt_theme.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,163 @@
+<?php
+/*
++---------------------------------------------------------------+
+|	e107 website system
+|
+|	Steve Dunstan 2001-2005
+|	http://e107.org
+|	jalist@e107.org
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [theme]
+$themename = "lamb";
+$themeversion = "1.0";
+$themeauthor = "Steve Dunstan [jalist]";
+$themedate = "29/01/2005";
+$themeinfo = "";
+define("STANDARDS_MODE", TRUE);
+
+// [layout]
+
+$layout = "_default";
+
+$HEADER = "<div id='header'>
+<div id='logo'>&nbsp;</div>
+</div>
+<div id='banner'>
+{BANNER}
+</div>
+<div id='mainleft'>
+<div id='mainright'>
+<div id='leftcontent'>
+<div class='columnwrap'>
+{SITELINKS}
+{MENU=1}
+</div>
+</div>
+<div id='rightcontent'>
+<div class='columnwrap'>
+{MENU=2}
+</div>
+</div>
+<div id='centercontent'>
+<div class='menuwrapper'>
+<div class='columnwrap'>
+";
+
+$FOOTER = "
+</div>
+</div>
+<div class='cleaner'>&nbsp;</div>
+</div>
+</div>
+</div>
+<div id='footer'>
+<div class='columnwrap'>
+<div style='text-align: center;' class='smalltext'>
+{SITEDISCLAIMER}
+<br />
+<img src='".e_IMAGE."generic/php-small-trans-light.gif' alt='' /> <img src='".e_IMAGE."button.png' alt='' /> 
+<img src='".e_IMAGE."generic/poweredbymysql-88.png' alt=''  /> &nbsp;&nbsp;&nbsp;&nbsp;
+<a href='http://validator.w3.org/check?uri=referer' rel='external'><img src='".e_IMAGE."generic/valid-xhtml11.png' alt='' style='border: 0;' /></a> 
+<a href='http://jigsaw.w3.org/css-validator/check/referer' rel='external'><img src='".e_IMAGE."generic/vcss.png' alt='' style='border: 0;' /></a>
+</div>
+</div>
+</div>
+";
+
+$NEWSSTYLE = "
+<h3>
+{STICKY_ICON}
+{NEWSTITLE}
+</h3>
+<div class='bodytable' style='text-align:left'>
+{NEWSBODY}
+{EXTENDED}
+</div>
+<div style='text-align:right' class='smalltext'>
+{NEWSAUTHOR}
+on
+{NEWSDATE}
+<br />
+<img src='".e_IMAGE."admin_images/userclass_16.png' alt='' style='vertical-align: middle;' />
+{NEWSCOMMENTS}{TRACKBACK}
+<br />
+ | <a href='".e_BASE."submitnews.php'>Submit a news item</a>
+</div>
+<br />";
+define("ICONSTYLE", "float: left; border:0");
+define("COMMENTLINK", "Read/Post Comment: ");
+define("COMMENTOFFSTRING", "Comments are turned off for this item");
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", "Read the rest ...");
+define("POST_EXTENDEDSTRING", " ]<br />");
+define("TRACKBACKSTRING", "Trackbacks: ");
+define("TRACKBACKBEFORESTRING", " | ");
+
+
+// [linkstyle]
+
+define('PRELINK', "");
+define('POSTLINK', "");
+define('LINKSTART', "<img src='".THEME."images/bullet2.gif' alt='' /> ");
+define("LINKSTART_HILITE", "<img src='".THEME."images/bluearrow_greybg.png' alt='' /> ");
+define('LINKEND', "<br />");
+define('LINKDISPLAY', 2);
+define('LINKALIGN', "left");
+
+
+//	[tablestyle]
+
+function tablestyle($caption, $text, $mode)
+{
+	echo "<h4><img src='".THEME."images/bluearrow_greybg.png' alt='' />  $caption</h4>\n<br />\n$text\n<br /><br />\n";
+}
+
+$COMMENTSTYLE = "
+<table style='width: 100%;'>
+<tr>
+<td style='width: 30%; text-align: right;'>{USERNAME} @ <span class='smalltext'>{TIMEDATE}</span><br />{AVATAR}<span class='smalltext'>{REPLY}</span></td>
+<td style='width: 70%;'>
+<div id='lbqtop'>
+<div id='pgFrontUserInner'>
+<div id='lbqbottom'>
+<div id='bglefright'>
+<div id='bqcontent'>
+<div id='bqtext'>
+{COMMENT} {COMMENTEDIT}
+</div>
+</div>
+</div>
+</div>
+</div>
+</div>
+</td>
+</tr>
+</table>
+";
+
+$POLLSTYLE = <<< EOF
+<b>Poll:</b> {QUESTION}
+<br /><br />
+{OPTIONS=OPTION<br />BAR<br /><span class='smalltext'>PERCENTAGE VOTES</span><br />\n}
+<br /><div style='text-align:center' class='smalltext'>{AUTHOR}<br />{VOTE_TOTAL} {COMMENTS}
+<br />
+{OLDPOLLS}
+</div>
+EOF;
+
+$CHATBOXSTYLE = "
+<img src='".e_IMAGE."admin_images/chatbox_16.png' alt='' style='vertical-align: middle;' />
+<b>{USERNAME}</b>
+<div class='smalltext'>
+{MESSAGE}
+</div>
+<br />";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/lamb/chat_template.php 75/e107_themes/lamb/chat_template.php
--- 6171/e107_themes/lamb/chat_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/chat_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,18 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### CHAT TABLE -----------------------------------------------------------------------------
+if(!$CHAT_TABLE_START){
+		$CHAT_TABLE_START = "";
+}
+if(!$CHAT_TABLE){
+		$CHAT_TABLE = "<div class='spacer'>\n<div class='indent'>\n<span class='defaulttext'><img src='".THEME."images/bullet2.gif' alt='bullet' /> \n<b>{CHAT_TABLE_NICK}</b></span>\n<span class='smalltext'>".LAN_13." {CHAT_TABLE_DATESTAMP}</span><br />\n<div class='spacer'>{CHAT_TABLE_MESSAGE}</div>\n</div>\n</div>\n";
+}
+if(!$CHAT_TABLE_END){
+		$CHAT_TABLE_END = "";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/lamb/download_template.php 75/e107_themes/lamb/download_template.php
--- 6171/e107_themes/lamb/download_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/download_template.php	2006-02-01 23:37:32.000000000 -0600
@@ -0,0 +1,208 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/lamb/download_template.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2006/02/02 05:37:32 $
+|     $Author: qnome $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// ##### CAT TABLE --------------------------------------------------------------------------------
+$DOWNLOAD_CAT_TABLE_RENDERPLAIN = TRUE;
+
+$DOWNLOAD_CAT_TABLE_START = "
+<img src='".e_THEME."lamb/images/download.png' alt='' style='vertical-align: middle;' /> <span class='dlmain'>".LAN_dl_18."</span>\n
+<br /><br />
+";
+
+
+
+$DOWNLOAD_CAT_PARENT_TABLE .= "
+<h4>{DOWNLOAD_CAT_MAIN_ICON} {DOWNLOAD_CAT_MAIN_NAME}</h4>
+";
+
+
+$DOWNLOAD_CAT_CHILD_TABLE .= "
+{DOWNLOAD_CAT_SUB_ICON}
+{DOWNLOAD_CAT_SUB_NEW_ICON} {DOWNLOAD_CAT_SUB_NAME} 
+<span class='smalltext'>
+{DOWNLOAD_CAT_SUB_DESCRIPTION}
+</span>
+";
+
+$DOWNLOAD_CAT_CHILD_TABLE .= "
+<br /><span class='defaulttext'>
+{DOWNLOAD_CAT_SUBSUB_NAME}
+</span>
+<span class='smalltext'>
+{DOWNLOAD_CAT_SUBSUB_DESCRIPTION}
+</span><br />
+{DOWNLOAD_CAT_SUBSUB}
+<br />
+";
+
+$DOWNLOAD_CAT_SUBSUB_TABLE .= "
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{DOWNLOAD_CAT_SUBSUB_NEW_ICON} {DOWNLOAD_CAT_SUBSUB_NAME}
+";
+
+$DOWNLOAD_CAT_TABLE_END = "
+<br /><br /><br /><br />
+{DOWNLOAD_CAT_SEARCH}
+";
+
+// ##### ------------------------------------------------------------------------------------------
+
+// ##### LIST TABLE -------------------------------------------------------------------------------
+$DOWNLOAD_LIST_TABLE_RENDERPLAIN = TRUE;
+if(!$DOWNLOAD_LIST_TABLE_START){
+
+                $DOWNLOAD_LIST_TABLE_START = "
+<img src='".e_THEME."lamb/images/download.png' alt='' style='vertical-align: middle;' /> <span class='dlmain'>".LAN_dl_18.": {DOWNLOAD_CATEGORY}</span><br /><br />{DOWNLOAD_CATEGORY_DESCRIPTION}<br /><br />
+
+<form method='post' action='".e_SELF."?".e_QUERY."'>
+<p>
+<span class='defaulttext'>".LAN_dl_38."
+<select name='order' class='tbox'>".
+($order == "download_datestamp" ? "<option value='download_datestamp' selected='selected'>".LAN_dl_22."</option>" : "<option value='download_datestamp'>".LAN_dl_22."</option>").
+($order == "download_requested" ? "<option value='download_requested' selected='selected'>".LAN_dl_18."</option>" : "<option value='download_requested'>".LAN_dl_18."</option>").
+($order == "download_name" ? "<option value='download_name' selected='selected'>".LAN_dl_23."</option>" : "<option value='download_name'>".LAN_dl_23."</option>").
+($order == "download_author" ? "<option value='download_author' selected='selected'>".LAN_dl_24."</option>" : "<option value='download_author'>".LAN_dl_24."</option>")."
+</select>&nbsp;&nbsp;&nbsp;
+
+".LAN_dl_37."
+<select name='view' class='tbox'>".
+($view == 5 ? "<option selected='selected'>5</option>" : "<option>5</option>").
+($view == 10 ? "<option selected='selected'>10</option>" : "<option>10</option>").
+($view == 15 ? "<option selected='selected'>15</option>" : "<option>15</option>").
+($view == 20 ? "<option selected='selected'>20</option>" : "<option>20</option>").
+($view == 50 ? "<option selected='selected'>50</option>" : "<option>50</option>")."
+</select>
+&nbsp;
+                        
+&nbsp;
+".LAN_dl_39."
+<select name='sort' class='tbox'>".
+($sort == "ASC" ? "<option value='ASC' selected='selected'>".LAN_dl_25."</option>" : "<option value='ASC'>".LAN_dl_25."</option>").
+($sort == "DESC" ? "<option value='DESC' selected='selected'>".LAN_dl_26."</option>" : "<option value='DESC'>".LAN_dl_26."</option>")."
+</select>
+&nbsp;
+<input class='button' type='submit' name='goorder' value='".LAN_dl_27."' />
+</span>
+
+
+<br /><br />
+</p>
+<table style='width:100%'>\n
+
+<tr>
+<td style='width:35%; text-align:left; font-weight: bold;'>".LAN_dl_28."</td>
+<td style='width:20%; text-align:center; font-weight: bold;'>".LAN_dl_24."</td>
+<td style='width:10%; text-align:center; font-weight: bold;'>".LAN_dl_21."</td>
+<td style='width:5%; text-align:center; font-weight: bold;'>".LAN_dl_29."</td>
+<td style='width:10%; text-align:center; font-weight: bold;'>".LAN_dl_12."</td>
+<td style='width:5%; text-align:center; font-weight: bold;'>".LAN_dl_8."</td>
+</tr>";
+
+}
+
+if(!$DOWNLOAD_LIST_TABLE){
+                $DOWNLOAD_LIST_TABLE .= "
+<tr>
+<td style='text-align:left;'>{DOWNLOAD_LIST_NEWICON} {DOWNLOAD_LIST_NAME}</td>
+<td style='text-align:center;'>{DOWNLOAD_LIST_AUTHOR}</td>
+<td style='text-align:center;'>{DOWNLOAD_LIST_FILESIZE}</td>
+<td style='text-align:center;'>{DOWNLOAD_LIST_REQUESTED}</td>
+<td style='text-align:center;'>{DOWNLOAD_LIST_RATING}</td>
+<td style='text-align:center;'>{DOWNLOAD_LIST_LINK} {DOWNLOAD_LIST_ICON}</td>
+</tr>\n";
+}
+
+if(!$DOWNLOAD_LIST_TABLE_END){
+                $DOWNLOAD_LIST_TABLE_END = "</table>\n</form><br /><br />
+<div class='smalltext' style='text-align:right;'>{DOWNLOAD_LIST_TOTAL_AMOUNT} {DOWNLOAD_LIST_TOTAL_FILES}</div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+// ##### VIEW TABLE -------------------------------------------------------------------------------
+$DOWNLOAD_VIEW_TABLE_RENDERPLAIN = TRUE;
+if(!$DOWNLOAD_VIEW_TABLE_START){
+                $DOWNLOAD_VIEW_TABLE_START = "
+
+<img src='".e_THEME."lamb/images/download.png' alt='' style='vertical-align: middle;' /> <span class='dlmain'>".LAN_dl_18.": {DOWNLOAD_CATEGORY}</span><br /><br /><br />\n";
+}
+
+if(!$DOWNLOAD_VIEW_TABLE){
+                $DOWNLOAD_VIEW_TABLE .= "
+<div class='dlcat'>{DOWNLOAD_VIEW_NAME_LINKED}</div>
+{DOWNLOAD_VIEW_AUTHOR_LAN}: {DOWNLOAD_VIEW_AUTHOR} ( {DOWNLOAD_VIEW_AUTHOREMAIL} ) ( {DOWNLOAD_VIEW_AUTHORWEBSITE} )<br /><br />
+{DOWNLOAD_VIEW_DESCRIPTION}<br /><br />
+
+ ";    
+       
+
+              
+                $DOWNLOAD_VIEW_TABLE .= "
+        <br /><span class='mediumtext'>{DOWNLOAD_VIEW_IMAGE}</span> <br /> | ";
+           
+
+        $DOWNLOAD_VIEW_TABLE .= "
+                <span class='mediumtext'>{DOWNLOAD_VIEW_FILESIZE_LAN}: {DOWNLOAD_VIEW_FILESIZE} | {DOWNLOAD_VIEW_REQUESTED_LAN}: {DOWNLOAD_VIEW_REQUESTED} | {DOWNLOAD_REPORT_LINK} 
+				<br />{DOWNLOAD_VIEW_RATING}</span><br /><br />
+";
+}
+
+if(!$DOWNLOAD_VIEW_TABLE_END){
+                $DOWNLOAD_VIEW_TABLE_END = "\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+if(!$DOWNLOAD_MIRROR_START)
+{
+	$DOWNLOAD_MIRROR_START = "
+	<div style='text-align:center'>
+	<table class='fborder' style='width:100%'>
+	<tr>
+	<td class='fcaption' colspan='4'>{DOWNLOAD_MIRROR_REQUEST}</td>
+	</tr>
+	<tr>
+	<td class='forumheader' style='width: 30%; text-align: center;'>{DOWNLOAD_MIRROR_HOST_LAN}</td>
+	<td class='forumheader' style='width: 40%;'>{DOWNLOAD_MIRROR_DESCRIPTION_LAN}</td>
+	<td class='forumheader' style='width: 20%; text-align: center;'>{DOWNLOAD_MIRROR_LOCATION_LAN}</td>
+	<td class='forumheader' style='width: 10%; text-align: center;'>{DOWNLOAD_MIRROR_GET_LAN}</td>
+	</tr>
+	";
+}
+
+if(!$DOWNLOAD_MIRROR)
+{
+	$DOWNLOAD_MIRROR = "
+	<tr>
+	<td class='forumheader3' style='width: 30%; text-align: center;'>{DOWNLOAD_MIRROR_IMAGE}<br /><br /><div class='smalltext'>{DOWNLOAD_MIRROR_REQUESTS}<br />{DOWNLOAD_TOTAL_MIRROR_REQUESTS}</div></td>
+	<td class='forumheader3' style='width: 40%'><div class='smalltext'>{DOWNLOAD_MIRROR_DESCRIPTION}</div></td>
+	<td class='forumheader3' style='width: 20%;; text-align: center;'>{DOWNLOAD_MIRROR_LOCATION}</td>
+	<td class='forumheader3' style='width: 10%; text-align: center;'><div class='smalltext'>{DOWNLOAD_MIRROR_LINK} {DOWNLOAD_MIRROR_FILESIZE}</div></td>
+	</tr>
+	";
+}
+
+if(!$DOWNLOAD_MIRROR_END)
+{
+	$DOWNLOAD_MIRROR_END = "
+	</table>
+	</div>
+	";
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/lamb/forum_posted_template.php 75/e107_themes/lamb/forum_posted_template.php
--- 6171/e107_themes/lamb/forum_posted_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/forum_posted_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,61 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/lamb/forum_posted_template.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$FORUMPOLLPOSTED =
+"<table style='width:100%' class='fborder'>
+<tr>
+<td class='nforumcaption2' colspan='2'>".LAN_133."</td>
+</tr><tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_413."<br />
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_id."'>".LAN_414."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>";
+
+$FORUMTHREADPOSTED = "
+<table style='width:100%' class='fborder'>
+<tr>
+<td class='nforumcaption2' colspan='2'>".LAN_133."</td>
+</tr><tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_324."<br />
+".(defined("F_MESSAGE") ? F_MESSAGE."<br />" : "")."
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>";
+
+
+$FORUMREPLYPOSTED = "
+<table style='width:100%' class='fborder'>
+<tr>
+<td class='nforumcaption2' colspan='2'>".LAN_133."</td>
+</tr><tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_415."<br />
+".(defined("F_MESSAGE") ? F_MESSAGE."<br />" : "")."
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/lamb/forum_post_template.php 75/e107_themes/lamb/forum_post_template.php
--- 6171/e107_themes/lamb/forum_post_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/forum_post_template.php	2005-12-21 11:03:51.000000000 -0600
@@ -0,0 +1,120 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/lamb/forum_post_template.php,v $
+|     $Revision: 1.9 $
+|     $Date: 2005/12/21 17:03:51 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// the user box and subject box are not always displayed, therefore we need to define them /in case/ they are, if not they'll be ignored.
+
+$userbox = "<tr>
+<td class='forumheader2' style='width:20%'>".LAN_61."</td>
+<td class='forumheader2' style='width:80%'>
+<input class='tbox' type='text' name='anonname' size='71' value='".$anonname."' maxlength='20' />
+</td>
+</tr>";
+
+$subjectbox = "<tr>
+<td class='forumheader2' style='width:20%'>".LAN_62."</td>
+<td class='forumheader2' style='width:80%'>
+<input class='tbox' type='text' name='subject' size='71' value='".$subject."' maxlength='100' />
+</td>
+</tr>";
+
+// the poll is optional, be careful when changing the values here, only change if you know what you're doing ...
+
+require_once(e_PLUGIN."poll/poll_class.php");
+$pollo = new poll;
+$poll = $pollo -> renderPollForm("forum");
+
+// finally, file attach is optional, again only change this if you know what you're doing ...
+
+$fileattach = "<tr><td colspan='2' class='nforumcaption2'>".($pref['image_post'] ? LAN_390 : LAN_416)."</td></tr>
+<tr><td style='width:20%' class='forumheader3'>".LAN_392."</td>
+<td style='width:80%' class='forumheader3'>".LAN_393." | ".$allowed_filetypes." |<br />".LAN_394."<br />".LAN_395.": ".($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'].LAN_396 : ini_get('upload_max_filesize'))."
+<br />
+
+<div id='fiupsection'>
+<span id='fiupopt'><input class='tbox' name='file_userfile[]' type='file' size='47'></span>
+</div>
+<input class='button' type='button' name='addoption' value='".LAN_417."' onclick=\"duplicateHTML('fiupopt','fiupsection')\" />
+</td>
+</tr>
+</td>
+</tr>";
+
+
+// ------------
+
+$FORUMPOST = "
+<div style='text-align:center'>
+{FORMSTART}
+<table style='width:100%' class='fborder'>
+<tr>
+<td colspan='2' class='nforumcaption'>{BACKLINK}
+</td>
+</tr>
+{USERBOX}
+{SUBJECTBOX}
+<tr>
+<td class='forumheader2' style='width:20%'>{POSTTYPE}</td>
+<td class='forumheader2' style='width:80%'>
+{POSTBOX}<br />{EMOTES}<br />{EMAILNOTIFY}<br />{POSTTHREADAS}
+</td>
+</tr>
+
+{POLL}
+
+{FILEATTACH}
+
+<tr style='vertical-align:top'>
+<td colspan='2' class='forumheader' style='text-align:center'>
+{BUTTONS}
+</table>
+{FORMEND}
+</div>
+{FORUMJUMP}
+";
+
+$FORUMTHREADPOSTED = "
+<table style='width:100%' class='fborder'>
+<tr>
+<td class='nforumcaption2' colspan='2'>".LAN_133."</td>
+</tr><tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_324."<br />
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_id."'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>";
+
+
+$FORUMREPLYPOSTED = "
+<table style='width:100%' class='fborder'>
+<tr>
+<td class='fcaption' colspan='2'>".LAN_133."</td>
+</tr><tr>
+<td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'>".IMAGE_e."&nbsp;</td>
+<td style='vertical-align:center; width:80%' class='forumheader2'>
+<br />".LAN_324."<br />
+<span class='defaulttext'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$iid}.last'>".LAN_325."</a><br />
+<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
+</td></tr></table>";
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/lamb/forum_preview_template.php 75/e107_themes/lamb/forum_preview_template.php
--- 6171/e107_themes/lamb/forum_preview_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/forum_preview_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,35 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/lamb/forum_preview_template.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$FORUM_PREVIEW = "<div style='text-align:center'>
+<table style='width:100%' class='fborder'>
+<tr>
+<td colspan='2' class='nforumcaption2' style='vertical-align:top'>".LAN_323.
+($action != "nt" ? "</td>" : " ( ".LAN_62.$tsubject." )</td>")."
+<tr>
+<td class='nforumreply' style='width:20%' style='vertical-align:top'><b>".$poster."</b></td>
+<td class='nforumreply' style='width:80%'>
+<div class='smallblacktext' style='text-align:right'>".IMAGE_post2." ".LAN_322.$postdate."</div>".$tpost."</td>
+</tr>
+</table>
+</div>";
+	
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/lamb/forum_template.php 75/e107_themes/lamb/forum_template.php
--- 6171/e107_themes/lamb/forum_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/forum_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,61 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/lamb/forum_template.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+$FORUM_MAIN_START = "<div style='text-align:center'>";
+
+$FORUM_MAIN_PARENT = "<div class='spacer'>\n<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>\n<tr>\n<td colspan='5' class='nforumcaption'>{PARENTNAME} {PARENTSTATUS}</td>\n</tr>
+<tr>\n<td colspan='2' style='width:60%; text-align:center' class='nforumcaption2'>{FORUMTITLE}</td>\n<td style='width:10%; text-align:center' class='nforumcaption2'>{THREADTITLE}</td>\n<td style='width:10%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>\n<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>\n</tr>\n";
+
+//$FORUM_MAIN_PARENT_END = "</table></div>";
+
+$FORUM_MAIN_FORUM = "<tr>\n<td style='width:5%; text-align:center' class='nforumcaption3'>{NEWFLAG}</td>\n<td style='width:55%' class='nforumcaption3'>{FORUMNAME}<br /><span class='smallblacktext'>{FORUMDESCRIPTION}</span>{FORUMSUBFORUMS}</td>\n<td style='width:10%; text-align:center' class='nforumthread'>{THREADS}</td>\n<td style='width:10%; text-align:center' class='nforumthread'>{REPLIES}</td>\n<td style='width:20%; text-align:center' class='nforumthread'><span class='smallblacktext'>{LASTPOST}</span></td>\n</tr>";
+
+$FORUM_MAIN_END = "</table></div>\n<div class='spacer'>\n<table style='width:100%' class='nforumholder' cellspacing='1'>\n<tr>\n<td colspan='2' style='width:60%' class='nforumcaption2'>{INFOTITLE}</td>\n</tr>\n<tr>\n<td rowspan='4' style='width:5%; text-align:center' class='nforumthread'>{LOGO}</td>\n<td style='width:auto' class='nforumthread'>{USERINFO}</td>\n</tr>\n<tr>\n<td style='width:95%' class='nforumthread'>{INFO}</td>\n</tr><tr>\n<td style='width:95%' class='nforumthread'>{FORUMINFO}</td>\n</tr>\n<tr>\n<td style='width:95%' class='nforumthread'>{USERLIST}<br />{STATLINK}</td>\n</tr>\n</table>\n</div>\n<div class='spacer'>\n<table class='fborder' style='width:100%'>\n<tr>\n<td class='nforumthread' style='text-align:center; width:33%'>{ICONKEY}</td>\n<td style='text-align:center; width:33%' class='nforumthread'>{SEARCH}</td>\n<td style='width:33%; text-align:center; vertical-align:middle' class='nforumthread'><span class='smallblacktext'>{PERMS}</span>\n</td>\n</tr>\n</table>\n</div>\n</div>";
+
+ if(!$FORUM_NEWPOSTS_START){
+         $FORUM_NEWPOSTS_START = "<div style='text-align:center'>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td style='width:3%' class='fcaption'>&nbsp;</td>\n<td style='width:60%' class='fcaption'>{NEWTHREADTITLE}</td>\n<td style='width:27%; text-align:center' class='fcaption'>{POSTEDTITLE}</td>\n</tr>";
+ }
+
+ if(!$FORUM_NEWPOSTS_MAIN){
+         $FORUM_NEWPOSTS_MAIN .= "<tr>\n<td style='width:3%' class='forumheader3'>{NEWIMAGE}</td>\n<td style='width:60%' class='forumheader3'>{NEWSPOSTNAME}</td>\n<td style='width:27%; text-align:center' class='forumheader3'>{STARTERTITLE}</td>\n</tr>";
+ }
+
+ if(!$FORUM_NEWPOSTS_END){
+         $FORUM_NEWPOSTS_END .= "</table></div></div>";
+ }
+
+ if(!$FORUM_TRACK_START){
+         $FORUM_TRACK_START = "<div style='text-align:center'>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td colspan='3' style='width:60%' class='fcaption'>{TRACKTITLE}</td>\n</tr>\n";
+
+ if(!$FORUM_TRACK_MAIN){
+         $FORUM_TRACK_MAIN = "<tr>
+         <td style='text-align:center; vertical-align:middle; width:6%'  class='forumheader3'>{NEWIMAGE}</td>
+                         <td style='vertical-align:middle; text-align:left; width:70%'  class='forumheader3'><span class='mediumtext'>{TRACKPOSTNAME}</span></td>
+                         <td style='vertical-align:middle; text-align:center; width:24%'  class='forumheader3'><span class='mediumtext'>{UNTRACK}</td>
+                         </tr>";
+                 }
+         }
+
+ if(!$FORUM_TRACK_END){
+         $FORUM_TRACK_END = "</table>\n</div>\n</div>";
+ }
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/lamb/forum_viewforum_template.php 75/e107_themes/lamb/forum_viewforum_template.php
--- 6171/e107_themes/lamb/forum_viewforum_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/forum_viewforum_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,134 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/lamb/forum_viewforum_template.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$icon = (file_exists(THEME."forum/e.png") ? THEME."forum/e.png" : e_PLUGIN."forum/images/lite/e.png");
+
+ $FORUM_VIEW_START = "
+<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
+<tr>
+<td  colspan='2' class='nforumcaption'>{BREADCRUMB}</td>
+</tr>
+{SUBFORUMS}
+<tr>
+</table>
+<table style='width:100%'>
+<td style='width:80%'><div class='mediumtext'><img src='".$icon."' style='vertical-align:middle' /> <b>{FORUMTITLE} Forum</b></div>{THREADPAGES}</td>
+<td style='width:20%; text-align:right; vertical-align:bottom;'>
+{NEWTHREADBUTTON}
+</td>
+</tr>
+</table>
+
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='width:3%' class='nforumcaption2'>&nbsp;</td>
+<td style='width:47%' class='nforumcaption2'>{THREADTITLE}</td>
+<td style='width:20%; text-align:center' class='nforumcaption2'>{STARTERTITLE}</td>
+<td style='width:5%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>
+<td style='width:5%; text-align:center' class='nforumcaption2'>{VIEWTITLE}</td>
+<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>
+</tr>";
+
+
+$FORUM_VIEW_FORUM = "
+<tr>
+<td style='vertical-align:middle; text-align:center; width:3%' class='nforumview1'>{ICON}</td>
+<td style='vertical-align:middle; text-align:left; width:47%'  class='nforumview1'>
+
+<table style='width:100%'>
+<tr>
+<td style='width:90%'><span class='mediumtext'><b>{THREADNAME}</b></span> <span class='smalltext'>{PAGES}</span></td>
+<td style='width:10%; white-space:nowrap;'>{ADMIN_ICONS}</td>
+</tr>
+</table>
+</td>
+
+<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'><b>{POSTER}</b><br />{THREADDATE}</span></td>
+<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{REPLIES}</span></td>
+<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{VIEWS}</span></td>
+<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'>{LASTPOST}</span></td>
+</tr>";
+
+ $FORUM_VIEW_END = "
+</table>
+<table style='width:100%'>
+<tr>
+<td style='width:80%'><span class='mediumtext'>{THREADPAGES}</span>
+{FORUMJUMP}
+</td>
+<td style='width:20%; text-align:right'>
+{NEWTHREADBUTTON}
+</td>
+</tr>
+</table>
+
+
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
+<tr>
+<td style='vertical-align:center; width:50%' class='nforumview3'><span class='smalltext'>{MODERATORS}</span></td>
+<td style='text-align:right; vertical-align:center; width:50%' class='nforumview3'><span class='smalltext'>{BROWSERS}</span></td>
+</tr>
+
+<tr>
+<td style='vertical-align:center; width:50%' class='nforumview4'>{ICONKEY}</td>
+<td style='vertical-align:center; text-align:center; width:50%' class='nforumview4'>{PERMS}<br /><br />{SEARCH}
+</td>
+</tr>
+</table>
+</div>
+</div>
+<div style='text-align:center;'>
+<a href='".e_PLUGIN."rss_menu/rss.php?11.1.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss1.png' alt='".LAN_431."' style='vertical-align: middle; border: 0;' /></a> 
+<a href='".e_PLUGIN."rss_menu/rss.php?11.2.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss2.png' alt='".LAN_432."' style='vertical-align: middle; border: 0;' /></a> 
+<a href='".e_PLUGIN."rss_menu/rss.php?11.3.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss3.png' alt='".LAN_433."' style='vertical-align: middle; border: 0;' /></a>
+</div>
+<div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div>";
+
+
+$FORUM_VIEW_SUB_START = "
+<tr>
+<td colspan='2'>
+<table style='width:100%'  cellpadding='0' cellspacing='0'>
+<tr>
+<td class='nforumcaption2' style='width: 50%'>".FORLAN_20."</td>
+<td class='nforumcaption2' style='width: 10%; text-align: center;'>".FORLAN_21."</td>
+<td class='nforumcaption2' style='width: 10%; text-align: center;'>".LAN_55."</td>
+<td class='nforumcaption2' style='width: 30%; text-align: center;'>".FORLAN_22."</td>
+</tr>
+";
+
+$FORUM_VIEW_SUB = "
+<tr>
+<td class='nforumview2' style='text-align:left'><b>{SUB_FORUMTITLE}</b><br />{SUB_DESCRIPTION}</td>
+<td class='nforumview2' style='text-align:center'>{SUB_THREADS}</td>
+<td class='nforumview2' style='text-align:center'>{SUB_REPLIES}</td>
+<td class='nforumview2' style='text-align:center'>{SUB_LASTPOST}</td>
+</tr>
+";
+
+$FORUM_VIEW_SUB_END = "
+</table>
+</td>
+</tr>
+";
+
+ ?>
\ No newline at end of file
diff -ruN 6171/e107_themes/lamb/forum_viewtopic_template.php 75/e107_themes/lamb/forum_viewtopic_template.php
--- 6171/e107_themes/lamb/forum_viewtopic_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/forum_viewtopic_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,144 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/lamb/forum_viewtopic_template.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2005/12/14 19:28:52 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$icon = (file_exists(THEME."forum/e.png") ? THEME."forum/e.png" : e_PLUGIN."forum/images/lite/e.png");
+
+$FORUMSTART = "
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>	
+<td  colspan='2' class='nforumcaption'>{BACKLINK}</td>
+</tr>
+<tr>
+<td class='nforumcaption2' colspan='2'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td class='smalltext'>{NEXTPREV}</td>
+<td style='text-align:right'>&nbsp;{TRACK}&nbsp;</td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+<br />
+
+<table style='width:100%'>
+<tr>
+<td style='width:60%'><div class='mediumtext'><img src='".$icon."' style='vertical-align:middle' alt=''/> <b>{THREADNAME}</b></div><br />{GOTOPAGES}</td>
+<td style='width:40%; vertical-align:bottom; text-align:right;'>{BUTTONS}</td>
+</tr>
+</table>
+
+
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='width:20%; text-align:center' class='nforumcaption2'>\n".LAN_402."\n</td>\n<td style='width:80%; text-align:center' class='nforumcaption2'>\n".LAN_403."\n</td>
+</tr>
+</table>";
+       $FORUMTHREADSTYLE = "
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td class='nforumcaption3' style='vertical-align:middle; width:20%;'>\n{NEWFLAG}\n{POSTER}\n</td>
+<td class='nforumcaption3' style='vertical-align:middle; width:80%;'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td class='smallblacktext'>\n{THREADDATESTAMP}\n</td>
+<td style='text-align:right'>\n{REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n</td>
+</tr>
+</table>
+</td>
+</tr>	
+<tr>
+<td class='nforumthread' style='vertical-align:top'>\n{AVATAR}\n<span class='smalltext'>\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n</span>\n</td>
+<td class='nforumthread' style='vertical-align:top'>{POLL}\n{POST}\n{SIGNATURE}\n</td>
+</tr>		
+<tr>
+<td class='nforumthread2'>\n<span class='smallblacktext'>\n{TOP}\n</span>\n</td>
+<td class='nforumthread2' style='vertical-align:top'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td>\n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n</td>
+<td style='text-align:right'>\n{MODOPTIONS}\n</td>
+</tr>
+</table>
+</td>
+</tr>	
+</table>
+</div>";
+        $FORUMEND = "
+<div class='spacer'>
+{GOTOPAGES}
+</div>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='width:50%; text-align:left; vertical-align:top' class='nforumthread'><b>{MODERATORS}</b><br />{FORUMJUMP}</td>
+<td style='width:50%; text-align:right; vertical-align:top' class='nforumthread'>{BUTTONS}</td>
+</tr>
+</table>
+</div>
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td style='text-align:center' class='nforumthread2'>{QUICKREPLY}</td>
+</tr>
+</table>
+
+<div style='text-align:center;'>
+<a href='".e_PLUGIN."rss_menu/rss.php?8.1.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss1.png' alt='".LAN_431."' style='vertical-align: middle; border: 0;' /></a> 
+<a href='".e_PLUGIN."rss_menu/rss.php?8.2.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss2.png' alt='".LAN_432."' style='vertical-align: middle; border: 0;' /></a> 
+<a href='".e_PLUGIN."rss_menu/rss.php?8.3.".e_QUERY."'><img src='".e_PLUGIN."rss_menu/images/rss3.png' alt='".LAN_433."' style='vertical-align: middle; border: 0;' /></a>
+</div>
+
+<div class='nforumdisclaimer' style='text-align:center'>Powered by <b>e107 Forum System</b></div>
+</div>";
+       $FORUMREPLYSTYLE = "
+<div class='spacer'>
+<table style='width:100%' class='nforumholder' cellpadding='0' cellspacing='0'>
+<tr>
+<td class='nforumreplycaption' style='vertical-align:middle; width:20%;'>\n{NEWFLAG}\n{POSTER}\n</td>
+<td class='nforumreplycaption' style='vertical-align:middle; width:80%;'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td class='smallblacktext'>\n{THREADDATESTAMP}\n</td>
+<td style='text-align:right'>\n{REPORTIMG}\n{EDITIMG}\n{QUOTEIMG}\n</td>
+</tr>
+</table>
+</td>
+</tr>	
+<tr>
+<td class='nforumreply' style='vertical-align:top'>\n{AVATAR}\n<span class='smalltext'>\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{POSTS}\n</span>\n</td>
+<td class='nforumreply' style='vertical-align:top'>{POST}\n{SIGNATURE}</td>
+</tr>		
+<tr>
+<td class='nforumreply2'>\n<span class='smallblacktext'>\n{TOP}\n</span>\n</td>
+<td class='nforumreply2' style='vertical-align:top'>
+<table cellspacing='0' cellpadding='0' style='width:100%'>
+<tr>
+<td>\n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n</td>
+<td style='text-align:right'>\n{MODOPTIONS}\n</td>
+</tr>
+</table>
+</td>
+</tr>		
+</table>
+</div>";
+
+?>
\ No newline at end of file
Files 6171/e107_themes/lamb/images/bar.jpg and 75/e107_themes/lamb/images/bar.jpg differ
Files 6171/e107_themes/lamb/images/bg.png and 75/e107_themes/lamb/images/bg.png differ
Files 6171/e107_themes/lamb/images/bluearrow_greybg.png and 75/e107_themes/lamb/images/bluearrow_greybg.png differ
Files 6171/e107_themes/lamb/images/bluearrow.png and 75/e107_themes/lamb/images/bluearrow.png differ
Files 6171/e107_themes/lamb/images/boxbottom.png and 75/e107_themes/lamb/images/boxbottom.png differ
Files 6171/e107_themes/lamb/images/boxtop.png and 75/e107_themes/lamb/images/boxtop.png differ
Files 6171/e107_themes/lamb/images/bullet2.gif and 75/e107_themes/lamb/images/bullet2.gif differ
Files 6171/e107_themes/lamb/images/button.png and 75/e107_themes/lamb/images/button.png differ
Files 6171/e107_themes/lamb/images/comment.png and 75/e107_themes/lamb/images/comment.png differ
Files 6171/e107_themes/lamb/images/download.png and 75/e107_themes/lamb/images/download.png differ
Files 6171/e107_themes/lamb/images/email.png and 75/e107_themes/lamb/images/email.png differ
Files 6171/e107_themes/lamb/images/greyarrow.png and 75/e107_themes/lamb/images/greyarrow.png differ
Files 6171/e107_themes/lamb/images/lboxbottom.png and 75/e107_themes/lamb/images/lboxbottom.png differ
Files 6171/e107_themes/lamb/images/lboxtop.png and 75/e107_themes/lamb/images/lboxtop.png differ
Files 6171/e107_themes/lamb/images/left.png and 75/e107_themes/lamb/images/left.png differ
Files 6171/e107_themes/lamb/images/link.png and 75/e107_themes/lamb/images/link.png differ
Files 6171/e107_themes/lamb/images/logobg.png and 75/e107_themes/lamb/images/logobg.png differ
Files 6171/e107_themes/lamb/images/logo.png and 75/e107_themes/lamb/images/logo.png differ
Files 6171/e107_themes/lamb/images/logo_template.png and 75/e107_themes/lamb/images/logo_template.png differ
Files 6171/e107_themes/lamb/images/nforumcaption2.png and 75/e107_themes/lamb/images/nforumcaption2.png differ
Files 6171/e107_themes/lamb/images/nforumcaption.png and 75/e107_themes/lamb/images/nforumcaption.png differ
Files 6171/e107_themes/lamb/images/right.png and 75/e107_themes/lamb/images/right.png differ
diff -ruN 6171/e107_themes/lamb/languages/English.php 75/e107_themes/lamb/languages/English.php
--- 6171/e107_themes/lamb/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/languages/English.php	2005-09-12 18:50:17.000000000 -0500
@@ -0,0 +1,27 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/lamb/languages/English.php,v $
+|     $Revision: 1.3 $
+|     $Date: 2005/09/12 23:50:17 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "'lamb' by <a href='http://e107.org' rel='external'>jalist</a>");
+define("LAN_THEME_2", "Comments are turned off for this item");
+define("LAN_THEME_3", "comment: ");
+define("LAN_THEME_4", "Read the rest ...");
+define("LAN_THEME_5", "Trackbacks: ");
+
+
+?>
diff -ruN 6171/e107_themes/lamb/newforumpost.php 75/e107_themes/lamb/newforumpost.php
--- 6171/e107_themes/lamb/newforumpost.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/newforumpost.php	2006-01-13 07:27:22.000000000 -0600
@@ -0,0 +1,13 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$NEWFORUMPOSTSTYLE_HEADER = "
+<!-- newforumposts -->\n<ul>\n";
+
+$NEWFORUMPOSTSTYLE_MAIN = "<li><span class='smalltext'>{THREAD} ".NFPM_LAN_7." {POSTER} [ ".NFPM_LAN_3.": {VIEWS}, ".NFPM_LAN_4.": {REPLIES}, ".NFPM_LAN_5.": {LASTPOST} ]\n</span>\n</li>\n";
+
+$NEWFORUMPOSTSTYLE_FOOTER = "</ul>\n<br /><br />\n<span class='smalltext'>".NFPM_LAN_6.": <b>{TOTAL_TOPICS}</b> | ".NFPM_LAN_4.": <b>{TOTAL_REPLIES}</b> | ".NFPM_LAN_3.": <b>{TOTAL_VIEWS}</b></span>";
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/lamb/news_template.php 75/e107_themes/lamb/news_template.php
--- 6171/e107_themes/lamb/news_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/news_template.php	2005-12-14 13:28:52.000000000 -0600
@@ -0,0 +1,31 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$NEWSCOLUMNS = 2;
+
+$NEWSCLAYOUT = "
+<table style='width: 100%;'>
+<tr>
+<td style='width: 48%; vertical-align: top;'>{ITEMS1}</td>
+<td style='width: 4%;'></td>
+<td style='width: 48%; vertical-align: top;'>{ITEMS2}</td>
+</tr>
+</table>
+";
+
+
+?>
\ No newline at end of file
Files 6171/e107_themes/lamb/preview.jpg and 75/e107_themes/lamb/preview.jpg differ
diff -ruN 6171/e107_themes/lamb/style.css 75/e107_themes/lamb/style.css
--- 6171/e107_themes/lamb/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/style.css	2006-04-18 02:38:02.000000000 -0500
@@ -0,0 +1,509 @@
+
+#mainleft {
+	margin:0; padding:0;
+	background: #fff url("images/left.png") top left repeat-y;
+}
+#mainright {
+	margin:0; padding:0;
+	background:url("images/right.png") top right repeat-y;
+}
+#leftcontent {
+	width:180px;
+	margin:0; padding:0;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	background: #f6f4f4;
+	vertical-align: top;
+	border-right: 1px solid #000;
+}
+#rightcontent {
+	width:180px;
+	margin:0; padding:0;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	background: #f6f4f4;
+	vertical-align: top;
+	border-left: 1px solid #000;
+}
+
+#centercontent {
+	vertical-align: top;
+}
+
+.menuwrapper {
+	width: 180px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.intwrapper {
+	overflow: scroll;
+}
+
+.columnwrap {
+	margin:0; padding:0.5em 1em;
+}
+
+
+#header {
+	height: 80px;
+	width: 100%;
+	background-repeat: repeat-x;
+	background-image: url(images/logobg.png);
+	border-bottom: 1px solid black;
+}
+
+#quote {
+	position: absolute;
+	left:6px;
+	top:60px;
+	color: #176f8f;
+}
+
+#banner {
+	position: absolute;
+	right:6px;
+	top:10px;
+}
+
+#wm {
+	voice-family: "\"}\"";
+	voice-family: inherit;
+	background: #f3eded url(images/wblogo.png) bottom right no-repeat;
+	border: 1px solid #ede3e3;
+	padding: 10px 150px 10px 10px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+#bqtop {
+  width: 252px;
+  padding-top: 7px;
+  background: url(images/boxtop.png) top left no-repeat;
+  margin-bottom: 15px;
+}
+
+#lbqtop {
+  width: 450px;
+  padding-top: 7px;
+  background: url(images/lboxtop.png) top left no-repeat;
+  margin-bottom: 15px;
+}
+
+#bqbottom {
+  background: url(images/boxbottom.png) bottom left no-repeat;
+  padding-bottom: 7px;
+  width: 100%;
+}
+
+#lbqbottom {
+  background: url(images/lboxbottom.png) bottom left no-repeat;
+  padding-bottom: 7px;
+  width: 100%;
+}
+
+#bglefright {
+  padding: 11px 14px 12px 15px;
+  border-left: 1px solid #DADADA;
+  border-right: 1px solid #DADADA;
+}
+
+#centre {
+	margin-left: auto;
+	margin-right: auto;
+	text-align: center;
+}
+
+#bqcontent { 
+  margin-left: 4px; 
+}
+
+#bqtext {
+  font-size: 10px; 
+  color: #666;
+}
+
+ul{
+	list-style: square;
+}
+
+
+#footer {
+	border-top: 1px solid #000;
+	width: 100%;
+}
+
+h1 {
+  font-size: 1.4em;
+  font-weight: bold;
+  margin-top: 0em;
+  margin-bottom: 0em;
+  color: #ec5800;
+}
+
+h2 {
+	font: 12px arial, verdana, tahoma, helvetica, sans-serif;
+	color: #bbb;
+	text-transform: uppercase;
+	font-weight: bold;
+	margin-top: 2px;
+	margin-bottom: 0px;
+}
+
+h3 {
+	font: 12px tahoma, verdana, helvetica, arial, sans-serif;
+	color: #000;
+	font-weight: bold;
+	margin-top: 2px;
+	margin-bottom: 0px;
+}
+
+h4 {
+	font: 12px tahoma, verdana, helvetica, arial, sans-serif;
+	color: #000;
+	font-weight: bold;
+	margin-top: 2px;
+	margin-bottom: 0px;
+	background-color: #eae6e6;
+	padding: 2px;
+}
+
+img {
+	vertical-align: middle;
+}
+
+.dlmain {
+	font: 20px tahoma, verdana, helvetica, arial, sans-serif;
+	color: #000;
+}
+
+.dlcat {
+	font: 14px tahoma, verdana, helvetica, arial, sans-serif;
+	color: #000;
+	font-weight: bold;
+	margin-top: 2px;
+	margin-bottom: 0px;
+	padding: 2px;
+}
+
+
+
+
+hr {
+	border: 1px dotted #bbb;
+	height: 1px;
+	width: 92%;
+	text-align:center;
+}
+
+.smalltext {
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.bodytable {
+	padding: 2px;
+	font: 0.8em verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+}
+
+.button {	
+	border: #000 1px solid;
+	color: #000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	background-image : url(images/button.png);
+}
+
+.button a {
+	color: #000;
+}
+.button a:hover {
+	color: #0085b0;
+}
+
+body {
+	font-size: 12px;
+	color: #000;
+	font-family: tahoma, verdana, arial, sans-serif;
+	background-color: #fff;
+	margin:0px;
+	padding:0px;
+	text-align:left
+}
+a {
+	color: #0085b0; 
+	font-family: verdana, arial, sans-serif; 
+	text-decoration: underline;
+}
+a:hover {
+	color: #616060;
+	font-family: verdana, arial, sans-serif; 
+	text-decoration: underline;
+}
+
+.smallblacktext {
+    background: none;
+	font: 10px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#000;
+}
+.indent{
+	padding: 10px 10px 10px 10px;
+	margin: 5px;
+	font: 9px verdana, tahoma, arial, sans-serif;
+	color: #838387;
+	border: 1px solid #d6d6d6;
+}
+.defaulttext {
+    background: none;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+
+td {
+	font: 11px tahoma, verdana, arial, helvetica, sans-serif;
+	color:#5d6e75;
+	padding: 0px;
+	text-align:left;
+}
+
+blockquote {
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	color:#7e96ac;
+	border: 1px solid #d6d6d6;
+}
+.mediumtext {
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+}
+
+.tbox{
+	background-color: #F4F7FA;
+	border: #5e5d63 1px solid;
+	color: #000000;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.tbox.chatbox{
+	background-color: #F4F7FA;
+	border: #5e5d63 1px solid;
+	color: #000000;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	width: 90%;
+}
+
+.nextprev{
+	background-color: #eaeef2;
+	border: #000 1px solid;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	padding : 2px;
+	text-align: right;
+}
+
+form {
+	margin: 2px 0px 0px 0px;
+}
+.spacer {
+	padding: 2px 0 2px 0;
+}
+
+.cspacer {
+	padding: 6px 0 6px 0;
+	margin-left: auto;
+	margin-right: auto;
+	text-align: center;
+}
+
+.border {
+	border: #999 1px solid;
+	background-color: #F0F1F1;
+	padding: 2px;
+}
+
+
+p {
+	margin-top: 0px
+}
+
+.fborder {
+	border: #c1c1c1 1px solid;
+}
+.forumheader{
+	background-color: #f3f3f7;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	background-image : url('../e107_images/forum/fcap2.png');
+	border: 1px solid #ececf2;
+}
+
+.forumheader2{
+	background-color: #EFEFEF;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+}
+
+.forumheader3{
+	background-color: #f3f3f7;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #ececf2 1px solid;
+}
+
+.forumborder{
+	border: #000080 1px solid;
+}
+
+.fcaption {
+	border: #f0f2f4 1px solid;
+	padding: 2px 0 2px 0;
+	background-color: #f9fafb;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#616060;
+}
+
+.finfobar{
+	background-color: #CCC8C8;
+	color:#000;
+	padding: 4px;
+	border: 1px solid #C3BDBD;
+	background-image : url('../e107_images/forum/finfobar.png');font-style:normal; font-variant:normal; font-weight:normal; font-size:11px; font-family:verdana, tahoma, arial, helvetica, sans-serif
+}
+
+.helpbox {
+	color:#000;
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	border: 0px none red;
+	background-color: transparent;
+}
+
+.nforumholder {
+	border: 1px solid #345487;
+	padding: 0px;
+	background-color: #fff;
+}
+
+.nforumcaption {
+	background-image: url(images/nforumcaption.png);
+	padding: 8px 4px 8px 4px;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #fff;
+}
+
+.nforumcaption2 {
+	background-image: url(images/nforumcaption2.png);
+	padding: 8px 0px 8px 4px;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #000;
+	font-weight: bold;
+}
+
+.nforumcaption3 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #EEF2F7;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumthread2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #D1DCEB;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreplycaption {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E2EDF2;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #EDF4F7;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumreply2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #CFE0EB;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+.nforumdisclaimer {
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#5d6e75;
+}
+
+.nforumview1 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview2 {
+	border: 1px solid #fff;
+	padding: 4px;
+	background-color: #DFE6EF;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.nforumview3 {
+	padding: 4px;
+	background-color: #BCD0ED;
+	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #263448;
+}
+
+.nforumview4 {
+	padding: 4px;
+	background-color: #E4EAF2;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	color: #3A4F6C;
+}
+
+a.forumlink{
+	color: #fff;
+	text-decoration: none;
+}
+
+a.forumlink:hover {
+	color: #bbb;
+	text-decoration: underline;
+}
+
+.treeclass1 {
+	background-color: #F4F7FA;
+	border: #5e5d63 1px solid;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	padding: 2px -2px 2px 2px;
+}
+
+.treeclass2 {
+	background-color: #F4F7FA;
+	border: #000 1px solid;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	padding: 2px -2px 2px 2px;
+}
+
+.treeclass3 {
+	background-color: #F4F7FA;
+	color: #000000;
+	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
+	padding: 1px;
+	width: 100%;
+}
diff -ruN 6171/e107_themes/lamb/theme.php 75/e107_themes/lamb/theme.php
--- 6171/e107_themes/lamb/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/lamb/theme.php	2006-04-18 02:38:02.000000000 -0500
@@ -0,0 +1,168 @@
+<?php
+/*
++---------------------------------------------------------------+
+|	e107 website system
+|
+|	Steve Dunstan 2001-2005
+|	http://e107.org
+|	jalist@e107.org
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+@include_once(e_THEME."lamb/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."lamb/languages/English.php");
+
+// [theme]
+$themename = "lamb";
+$themeversion = "1.0";
+$themeauthor = "Steve Dunstan [jalist]";
+$themeemail = "jalist@e107.org";
+$themewebsite = "http://e107.org";
+$themedate = "29/01/2005";
+$themeinfo = "";
+define("STANDARDS_MODE", TRUE);
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+define("IMODE", "lite");
+define("THEME_DISCLAIMER", "<br /><i>".LAN_THEME_1."</i>");
+
+// [layout]
+
+$layout = "_default";
+
+$HEADER = "<div id='header'>
+<img src='".THEME."images/logo.png' style='width: 168px; height: 80px; display: block' alt='' />
+</div>
+<div id='banner'>
+{BANNER}
+</div>
+<table style='width: 100%;' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='leftcontent'>
+<div class='menuwrapper'>
+<div class='columnwrap'>
+{SITELINKS}
+{MENU=1}
+</div>
+</div>
+</td>
+<td id='centercontent'>
+<div class='columnwrap'>
+";
+
+$FOOTER = "
+</div>
+</td>
+<td id='rightcontent'>
+<div class='menuwrapper'>
+<div class='columnwrap'>
+{MENU=2}
+</div>
+</div>
+</td>
+</tr>
+</table>
+<div id='footer'>
+<div class='columnwrap'>
+<div style='text-align: center;' class='smalltext'>
+{SITEDISCLAIMER}<br />{THEMEDISCLAIMER}
+<br />
+<img src='".e_IMAGE_ABS."generic/php-small-trans-light.gif' alt='' /> <img src='".e_IMAGE_ABS."button.png' alt='' /> 
+<img src='".e_IMAGE_ABS."generic/poweredbymysql-88.png' alt=''  /> &nbsp;&nbsp;&nbsp;&nbsp;
+<a href='http://validator.w3.org/check?uri=referer' rel='external'><img src='".e_IMAGE_ABS."generic/valid-xhtml11.png' alt='' style='border: 0;' /></a> 
+<a href='http://jigsaw.w3.org/css-validator/check/referer' rel='external'><img src='".e_IMAGE_ABS."generic/vcss.png' alt='' style='border: 0;' /></a>
+<br />
+<a href='http://www.spreadfirefox.com/?q=affiliates&amp;id=0&amp;t=86'><img alt='e107 recommends Mozilla Firefox' title='e107 recommends Mozilla Firefox' src='http://sfx-images.mozilla.org/affiliates/Buttons/125x50/takebacktheweb_125x50.png' style='border: 0;' /></a>
+</div>		
+</div>
+</div>
+";
+
+$NEWSSTYLE = "
+<h3>
+{STICKY_ICON}
+{NEWSICON}&nbsp;
+{NEWSTITLE}
+</h3>
+<div class='bodytable' style='text-align:left'>
+{NEWSBODY}
+{EXTENDED}
+</div>
+<div style='text-align:right' class='smalltext'>
+{NEWSAUTHOR}
+on
+{NEWSDATE}
+<br />
+<img src='".e_IMAGE."admin_images/userclass_16.png' alt='' style='vertical-align: middle;' />
+{NEWSCOMMENTS}{TRACKBACK}
+</div>
+<br />";
+define("ICONSTYLE", "float: left; border:0");
+define("COMMENTLINK", LAN_THEME_3);
+define("COMMENTOFFSTRING", LAN_THEME_2);
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", LAN_THEME_4);
+define("POST_EXTENDEDSTRING", " ]<br />");
+define("TRACKBACKSTRING", LAN_THEME_5);
+define("TRACKBACKBEFORESTRING", " | ");
+
+
+// [linkstyle]
+
+define('PRELINK', "");
+define('POSTLINK', "");
+define('LINKSTART', "<img src='".THEME_ABS."images/bullet2.gif' alt='' /> ");
+define("LINKSTART_HILITE", "<img src='".THEME_ABS."images/bluearrow_greybg.png' alt='' /> ");
+define('LINKEND', "<br />");
+define('LINKDISPLAY', 2);
+define('LINKALIGN', "left");
+
+
+//	[tablestyle]
+
+function tablestyle($caption, $text, $mode)
+{
+	echo "<h4><img src='".THEME_ABS."images/bluearrow_greybg.png' alt='' width='6' height='9' /> {$caption}</h4>\n<br />
+	{$text}
+	<br /><br />\n";	
+}
+
+$COMMENTSTYLE = "
+<table style='width: 100%;'>
+<tr>
+<td style='width: 30%; text-align: right;'>{USERNAME} @ <span class='smalltext'>{TIMEDATE}</span><br />{AVATAR}<span class='smalltext'>{REPLY}</span></td>
+<td style='width: 70%;'>
+<div id='lbqtop'>
+<div id='pgFrontUserInner'>
+<div id='lbqbottom'>
+<div id='bglefright'>
+<div id='bqcontent'>
+<div id='bqtext'>
+{COMMENT} {COMMENTEDIT}
+<div style='text-align: right;' class='smallext'>{IPADDRESS}</div>
+</div>
+</div>
+</div>
+</div>
+</div>
+</div>
+</td>
+</tr>
+</table>
+";
+
+$CHATBOXSTYLE = "
+<img src='".e_IMAGE_ABS."admin_images/chatbox_16.png' alt='' style='vertical-align: middle;' />
+<b>{USERNAME}</b>
+<div class='smalltext'>
+{MESSAGE}
+</div>
+<br />";
+
+?>
\ No newline at end of file
Files 6171/e107_themes/leaf/bluehigh.ttf and 75/e107_themes/leaf/bluehigh.ttf differ
diff -ruN 6171/e107_themes/leaf/fontstyles/large.css 75/e107_themes/leaf/fontstyles/large.css
--- 6171/e107_themes/leaf/fontstyles/large.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/leaf/fontstyles/large.css	2005-07-27 01:19:46.000000000 -0500
@@ -0,0 +1,11 @@
+/*THIS IS THE STYLESHEET FOR LARGE SIZED TEXT SIZE*/
+/*Increase font sizes +2px from original CSS*/
+body, h4, .formfield, .formbutton{
+	font-size: 13px;
+}
+h3{
+	font-size: 16px;
+}
+#credits, .c_commentinfo{
+	font-size: 12px;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/leaf/fontstyles/medium.css 75/e107_themes/leaf/fontstyles/medium.css
--- 6171/e107_themes/leaf/fontstyles/medium.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/leaf/fontstyles/medium.css	2005-07-27 01:19:46.000000000 -0500
@@ -0,0 +1,11 @@
+/*THIS IS THE STYLESHEET FOR MEDIUM SIZED TEXT SIZE*/
+/*Increase font sizes +1px from original CSS*/
+body, h4, .formfield, .formbutton{
+	font-size: 12px;
+}
+h3{
+	font-size: 15px;
+}
+#credits, .c_commentinfo{
+	font-size: 11px;
+}
\ No newline at end of file
Files 6171/e107_themes/leaf/images/01_bg.gif and 75/e107_themes/leaf/images/01_bg.gif differ
Files 6171/e107_themes/leaf/images/01_bodybg.jpg and 75/e107_themes/leaf/images/01_bodybg.jpg differ
Files 6171/e107_themes/leaf/images/01_font1.gif and 75/e107_themes/leaf/images/01_font1.gif differ
Files 6171/e107_themes/leaf/images/01_font2.gif and 75/e107_themes/leaf/images/01_font2.gif differ
Files 6171/e107_themes/leaf/images/01_font3.gif and 75/e107_themes/leaf/images/01_font3.gif differ
Files 6171/e107_themes/leaf/images/01_footer.jpg and 75/e107_themes/leaf/images/01_footer.jpg differ
Files 6171/e107_themes/leaf/images/01_hdot.gif and 75/e107_themes/leaf/images/01_hdot.gif differ
Files 6171/e107_themes/leaf/images/01_header01.jpg and 75/e107_themes/leaf/images/01_header01.jpg differ
Files 6171/e107_themes/leaf/images/01_header02.jpg and 75/e107_themes/leaf/images/01_header02.jpg differ
Files 6171/e107_themes/leaf/images/01_header03.jpg and 75/e107_themes/leaf/images/01_header03.jpg differ
Files 6171/e107_themes/leaf/images/01_header04.jpg and 75/e107_themes/leaf/images/01_header04.jpg differ
Files 6171/e107_themes/leaf/images/01_item1.gif and 75/e107_themes/leaf/images/01_item1.gif differ
Files 6171/e107_themes/leaf/images/01_item2.gif and 75/e107_themes/leaf/images/01_item2.gif differ
Files 6171/e107_themes/leaf/images/01_item3.gif and 75/e107_themes/leaf/images/01_item3.gif differ
Files 6171/e107_themes/leaf/images/01_linkbg1.gif and 75/e107_themes/leaf/images/01_linkbg1.gif differ
Files 6171/e107_themes/leaf/images/01_linkbg2.gif and 75/e107_themes/leaf/images/01_linkbg2.gif differ
Files 6171/e107_themes/leaf/images/01_logo.gif and 75/e107_themes/leaf/images/01_logo.gif differ
Files 6171/e107_themes/leaf/images/01_m_comment.gif and 75/e107_themes/leaf/images/01_m_comment.gif differ
Files 6171/e107_themes/leaf/images/01_m_default.gif and 75/e107_themes/leaf/images/01_m_default.gif differ
Files 6171/e107_themes/leaf/images/01_m_news.gif and 75/e107_themes/leaf/images/01_m_news.gif differ
Files 6171/e107_themes/leaf/images/01_mountaintop2.gif and 75/e107_themes/leaf/images/01_mountaintop2.gif differ
Files 6171/e107_themes/leaf/images/01_quote.gif and 75/e107_themes/leaf/images/01_quote.gif differ
Files 6171/e107_themes/leaf/images/01_s_about.gif and 75/e107_themes/leaf/images/01_s_about.gif differ
Files 6171/e107_themes/leaf/images/01_s_categories.gif and 75/e107_themes/leaf/images/01_s_categories.gif differ
Files 6171/e107_themes/leaf/images/01_s_chatbox.gif and 75/e107_themes/leaf/images/01_s_chatbox.gif differ
Files 6171/e107_themes/leaf/images/01_s_default.gif and 75/e107_themes/leaf/images/01_s_default.gif differ
Files 6171/e107_themes/leaf/images/01_s_latestcomment.gif and 75/e107_themes/leaf/images/01_s_latestcomment.gif differ
Files 6171/e107_themes/leaf/images/01_s_links.gif and 75/e107_themes/leaf/images/01_s_links.gif differ
Files 6171/e107_themes/leaf/images/01_s_login.gif and 75/e107_themes/leaf/images/01_s_login.gif differ
Files 6171/e107_themes/leaf/images/01_s_online.gif and 75/e107_themes/leaf/images/01_s_online.gif differ
Files 6171/e107_themes/leaf/images/01_s_search.gif and 75/e107_themes/leaf/images/01_s_search.gif differ
Files 6171/e107_themes/leaf/images/bullet2.gif and 75/e107_themes/leaf/images/bullet2.gif differ
diff -ruN 6171/e107_themes/leaf/languages/English.php 75/e107_themes/leaf/languages/English.php
--- 6171/e107_themes/leaf/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/leaf/languages/English.php	2005-07-27 01:19:47.000000000 -0500
@@ -0,0 +1,28 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/leaf/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/07/27 06:19:47 $
+|     $Author: qnome $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "Comment(s) ");
+define("LAN_THEME_2", "Comments are turned off for this item");
+define("LAN_THEME_3", "comment(s) ");
+define("LAN_THEME_4", "Read the rest ...");
+define("LAN_THEME_5", "Trackbacks: ");
+define("LAN_THEME_6", "Comment by");
+
+
+?>
diff -ruN 6171/e107_themes/leaf/links.sc 75/e107_themes/leaf/links.sc
--- 6171/e107_themes/leaf/links.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/leaf/links.sc	2005-10-16 03:07:01.000000000 -0500
@@ -0,0 +1,16 @@
+
+$links ="<div class='sidebarbody'>
+<h3>Links</h3>
+<div class='sidebarin'>
+<ul>
+<li><a href='http://www.e107.org' title='e107 CMS official website'>e107 CMS official site</a></li>
+<li><a href='http://e107coders.org' title='e107 CMS coders site'>e107 CMS coders site</a></li>
+<li><a href='http://e107styles.org' title='e107 CMS styles site'>Get more e107 styles!</a></li>
+<li><a href='http://e107themes.com' title='e107 Style Enlightenment'>e107 Style Enlightenment</a></li>
+<li><a href='http://www.stanch.net' title='The orig designer of this skin'>Orig Designer of this skin</a></li>
+<li><a href='http://e107.net' title='William Moffett aka Que~'>Current Designer's site</a></li>
+</ul>
+</div>
+</div>";
+
+return $links;
Files 6171/e107_themes/leaf/preview.png and 75/e107_themes/leaf/preview.png differ
diff -ruN 6171/e107_themes/leaf/style.css 75/e107_themes/leaf/style.css
--- 6171/e107_themes/leaf/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/leaf/style.css	2005-10-16 03:06:15.000000000 -0500
@@ -0,0 +1,739 @@
+/*This is the LEAF skin, made by Ivan for Nucleus CMS*/
+/*I am not a pro in CSS - If you are one and if you think it can be done better, by all means go ahead and adjust to your needs*/
+/*I've tried my best to comment on most of the styles*/
+
+/*BASIC STUFF*/
+a:link, a:visited{
+	color: #23598C;
+	text-decoration: none;
+}
+a:hover, a:active{
+	color: black;
+}
+
+img{
+	border: none;
+}
+
+td{
+	text-align:left;
+}
+
+/*This is used for hidden stuff, stuff that you don't want people to see with CSS enabled*/
+/*Try disabling CSS and you'll see some messages that you don't see with CSS enabled*/
+.hidden{
+	display: none;
+}
+
+/*Use this to centerize any image/text*/
+.centerize{
+	text-align: center;
+}
+
+/* MAIN STRUCTURE */
+/*Don't edit if you know what's good for you*/
+body{
+	color: #4C4C4C;
+	font-size: 11px;
+	font-family: Trebuchet MS, "Lucida Sans Unicode", Arial, Lucida Sans, Tahoma, Sans-Serif;
+	background: #123454 url(images/01_bg.gif) top repeat-x;
+	padding: 20px 0 20px 0;
+	text-align: center;
+}
+#wrapper{
+	width: 700px;
+	margin: auto;
+	background: white url(images/01_bodybg.jpg) repeat-y;
+	text-align: left;
+}
+
+/*The header image*/
+#header{
+	position: relative;
+	width: 700px;
+	height: 151px;
+	margin: auto;
+	background: url(images/01_header01.jpg) no-repeat;
+}
+
+/*The container - edit "230" to your desired width for the sidebar (lines 55, 58, 62)*/
+#container{
+	/* width: 100%; */
+	float: left;
+	margin-right: -230px; 
+	width: 670px;
+}
+#content{
+	margin-right: 230px;
+	padding: 25px 0;
+}
+#sidebar{
+	width: 230px;
+	float: right;
+	padding: 25px 0;
+	text-align: left;
+}
+#footer{
+	width: 700px;
+	margin: auto;
+	padding: 20px 0 0 0;
+	background: url(images/01_footer.jpg) top no-repeat;
+}
+
+/* The container - custom page layout. resize adjustments for full screen */
+#container_full{
+	/* width: 100%; */
+	float: left;
+	margin-right: 0px; 
+	/* -230 */
+	width: 700px;
+}
+#content_full{
+	/* margin-right: 230px; */
+	padding: 25px 0;
+}
+#sidebar_full{
+	width: 230px;
+	float: right;
+	padding: 25px 0;
+	text-align: left;
+	display:none;
+}
+
+/*Credits part is where the copyrights/xhtml/css validation stuff will be*/
+#credits{
+	font-size: 10px;
+	text-align: center;
+	color: #F7F7F7;
+}
+#credits a:link, #credits a:visited{
+	color: #CFE6FD;
+}
+#credits a:hover, #credits a:active{
+	color: white;
+}
+/*Ignore this*/
+.clearing{
+	height: 0;
+	clear: both;
+}
+.smalltext{
+	color:#fff;
+}
+#wrapper .smalltext{
+	color:#000;
+}
+
+/*THE MAIN TITLE - YOUR BLOG NAME ON TOP OF THE HEADER*/
+#header h1{
+	position: absolute;
+	top: 16px;
+	left: 24px;
+	height:35px;
+	font-size: 20px;
+	line-height: 20px;
+	margin: 0;
+	text-indent: 35px;
+	background: url(images/01_logo.gif) bottom left no-repeat;
+
+
+
+}
+
+/*THE NAVIGATION - More detailed stuff in NAVIGATION LINKS section*/
+#navigation{
+	font-size: 11px;
+	width: 694px;
+	height: 22px;
+	position: absolute;
+	top: 129px;
+	left: 3px;
+	list-style: none;
+}
+#navigation ul{
+	list-style: none;
+	padding: 0;
+	margin: 0;
+}
+#navigation li{
+	background: none;
+ 	display: inline;
+}
+
+/*  THE DEFAULT HEADERS (h2: Main titles, h3: Blog and Sidebar titles, h4: Comment names/userlinks)*/
+h2{
+	color: #3E565F;
+	margin: 0 0 3px 0;
+	font-size: 16px;
+	height: 23px;
+	margin: 0 0 5px 0;
+}
+h3{
+	color: #3E565F;
+	margin: 0 0 8px 0;
+	font-size: 14px;
+}
+h4{
+	font-size: 11px;
+}
+
+/*Sub structure - To create the margins of the body (where text will be placed)*/
+.contentdiv{
+	margin: 0 15px 0 22px;
+}
+.sidebardiv{
+	margin: 0 22px 0 15px;
+}
+
+
+/* THE STYLING OF THE BODY OF CONTENTS AND SIDEBAR */
+.contentbody{
+	margin: 0;
+	padding: 0 0 0 0;
+	text-align: justify;
+}
+.sidebarbody{
+	margin: 0 0 20px 0;
+	padding: 0;
+}
+
+/* THIS PART IS THE SIDEBAR'S INDIVIDUAL DIVS */
+/* Note that it doesn't have any styling, but it's here in case you want to add some styles */
+.sidebarin{
+	padding: 0;
+	margin: 0;
+}
+
+/*MAIN TITLES*/
+h2{
+	height: 23px;
+	text-indent: 20px;
+	margin: 0 0 5px 0;
+	background: url(images/01_m_default.gif) no-repeat;
+}
+
+/*You can remove all parts here if you do not wish to use images as your main titles*/
+h2.news{
+	text-indent: -9999px;
+	background: url(images/01_m_news.gif) no-repeat;
+}
+h2.comment{
+	text-indent: -9999px;
+	background: url(images/01_m_comment.gif) no-repeat;
+}
+
+/* THIS PART IS TO STYLE THE BACKGROUND IMAGES (THE QUOTE ON THE LEFT) */
+/* You can create different image on your on, but only if you know what you're doing should you edit this part */
+/*
+.divweblog .contentbody, .divarchives .contentbody, .divarchivelist .contentbody, .diverror .contentbody, .divmemberinfo .contentbody,
+.divsendmessage .contentbody, .divcommentitem .contentbody, .divsearch .contentbody{
+	background: url(images/01_quote.gif) 0 3px no-repeat;
+}
+*/
+
+/* comments page is special */
+.divcomment{ 
+	margin: 0;
+	/* padding: 0 0 30px 43px;
+	text-align: justify;
+	background: url(images/01_quote.gif) 0 3px no-repeat; */
+}
+
+/* content pages */
+.divcontent .contentbody{
+	margin: 0;
+	/* padding: 0 0 30px 43px;
+	text-align: justify;
+	background: url(images/01_quote.gif) 0 3px no-repeat; */
+}
+.divcontent_manager .contentbody{
+	margin: 0;
+	text-align: justify;
+	/* padding: 0 0 30px 43px;
+	text-align: justify;
+	background: url(images/01_quote.gif) 0 3px no-repeat; */
+}
+
+/* special e107 page */
+.divcvs .contentbody{
+	margin: 0;
+	text-align: justify;
+	/* padding: 0 0 30px 43px;
+	text-align: justify;
+	 background: url(images/01_cvs.gif) 0 3px no-repeat; */
+}
+
+/* downloads */
+.divdownload .contentbody{
+	margin: 0;
+	text-align: justify;
+	/* padding: 0 0 30px 43px;
+	text-align: justify;
+	 background: url(images/01_download.gif) 0 3px no-repeat; */
+}
+
+/* forums */
+.divforum .contentbody{
+	margin: 0;
+	/* padding: 0 0 10px 10px; */
+	text-align: justify;
+	/* background: url(images/01_forum.gif) 0 3px no-repeat; */
+}
+.divforum_viewforum .contentbody{
+	margin: 0;
+	/* padding: 0 0 10px 10px; */
+	text-align: justify;
+	/* background: url(images/01_forum.gif) 0 3px no-repeat; */
+}
+
+.divforum_viewtopic .contentbody{
+	margin: 0;
+	/* padding: 0 0 10px 10px; */
+	text-align: justify;
+	/* background: url(images/01_forum.gif) 0 3px no-repeat; */
+}
+
+/* links */
+.divlinks .contentbody{
+	margin: 0;
+	text-align: justify;
+	/* padding: 0 0 30px 43px;
+	text-align: justify;
+	background: url(images/01_quote.gif) 0 3px no-repeat; */
+}
+
+.divnews .contentbody{
+	margin: 0;
+	padding: 0 0 30px 43px;
+	text-align: justify;
+	background: url(images/01_quote.gif) 0 3px no-repeat;
+}
+
+.divsubmitnews .contentbody{
+	margin: 0;
+	text-align: justify;
+	/* padding: 0 0 30px 43px;
+	text-align: justify;
+	background: url(images/01_quote.gif) 0 3px no-repeat; */
+}
+/* user pages */
+.divuser .contentbody{
+	margin: 0;
+	padding: 0;
+	text-align: justify;
+	/* padding: 0 0 30px 43px;
+	text-align: justify;
+	background: url(images/01_quote.gif) 0 3px no-repeat; */
+}
+.divusersettings .contentbody{
+	margin: 0;
+	text-align: justify;
+	/* padding: 0 0 30px 43px;
+	text-align: justify;
+	background: url(images/01_quote.gif) 0 3px no-repeat; */
+}
+
+
+
+/* Add comment form's background */
+.divaddcomment .contentbody{
+	/* background: url(images/01_quote3.gif) 0 3px no-repeat; */
+}
+
+/*MORE DETAILED STUFF - Item details of your blog items */
+.itemdetails{
+	text-align: right;
+	padding: 5px 0 0 0;
+	background: url(images/01_hdot.gif) top repeat-x;
+}
+
+/* used in the newsstyle */ 
+/* Posted by */
+.item1{
+	padding: 0 0 0 13px;
+	margin: 0 0 0 12px;
+	background: url(images/01_item1.gif) 0 1px no-repeat;
+}
+/* Category */
+.item2{
+	padding: 0 0 0 13px;
+	margin: 0 0 0 12px;
+	background: url(images/01_item2.gif) 0 3px no-repeat;
+}
+/* Comments */
+.item3{
+	padding: 0 0 0 15px;
+	margin: 0 0 0 12px;
+	background: url(images/01_item3.gif) 0 3px no-repeat;
+}
+.item4{
+	padding: 0 0 0 15px;
+	margin: 0 0 0 12px;
+}
+.item5{
+	padding: 0 0 0 15px;
+	margin: 0 0 0 12px;
+}
+/*FORM STYLING*/
+form{
+	margin: 0;
+	text-align: center;
+}
+form p{
+	padding: 1em;
+	text-align: left;
+}
+/*Styling for all form fields*/
+
+/*Form fields on focus effect (when user click on that input field)*/
+.formfield:focus{
+	border: 1px solid black;
+}
+/*Form's buttons*/
+.formbutton{
+	font-size: 11px;
+	font-family: Trebuchet MS, "Lucida Sans Unicode", Arial, Lucida Sans, Tahoma, Sans-Serif;
+	margin: 1px 0 0 0;
+	padding: 1px 10px;
+	color: #494949;
+	background: white;
+	border-top: 1px solid #D4D2CF;
+	border-left: 1px solid #D4D2CF;
+	border-bottom: 1px solid #868686;
+	border-right: 1px solid #868686;
+}
+/* Don't show textarea scrollbar on IE */
+textarea{
+	overflow: hidden;
+}
+
+
+/* STYLING OF MENU TITLES */
+
+h3{   /* default styleing for menu items, do not remove */
+	height: 23px;
+	text-indent: 17px;
+	margin: 0 0 2px 0;
+	background: url(images/01_m_default.gif) no-repeat; 
+}
+
+h3.news{ /* remove background image from h3 in news posts */
+	background: none;
+}
+
+
+/* You can remove all parts here if you do not wish to use images as your side titles */
+
+h3.about {
+	height: 23px;
+	text-indent: -9999px;
+	margin: 0 0 2px 0;
+	background: url(images/01_s_about.gif) no-repeat;
+}
+
+h3.login{
+	height: 23px;
+	text-indent: -9999px;
+	margin: 0 0 2px 0;
+	background: url(images/01_s_login.gif) no-repeat;
+}
+
+h3.categories {
+	height: 23px;
+	text-indent: -9999px;
+	margin: 0 0 2px 0;
+	background: url(images/01_s_categories.gif) no-repeat;
+}
+h3.search{
+	height: 23px;
+	text-indent: -9999px;
+	margin: 0 0 2px 0;
+	background: url(images/01_s_search.gif) no-repeat;
+}
+
+h3.links{
+	height: 23px;
+	text-indent: -9999px;
+	margin: 0 0 2px 0;
+	background: url(images/01_s_links.gif) no-repeat;
+}
+
+h3.online {
+	height: 23px;
+	text-indent: -9999px;
+	margin: 0 0 2px 0;
+	background: url(images/01_s_online.gif) no-repeat;
+}
+
+h3.chatbox {
+	height: 23px;
+	text-indent: -9999px;
+	margin: 0 0 2px 0;
+	background: url(images/01_s_chatbox.gif) no-repeat;
+}
+
+.compliance{
+
+}
+
+
+
+
+/* Sidbar menu content styles */
+
+.defaultform{
+	width: 174px;
+	background: #E2EDF0 url(images/01_mountaintop2.gif) top no-repeat; 
+	padding:4px;
+}
+
+/*THE LIST STYLES*/
+ul{
+	list-style: none;
+	padding: 0;
+	margin: 0;
+}
+li{
+	padding: 0 0 0 9px;
+	margin: 0 0 2px 0;
+	background: url(images/01_arrow.gif) 0 6px no-repeat;
+}
+
+/*THE SEARCH HIGHLIGHT*/
+.highlight{
+	font-weight: bold;
+	text-decoration: underline;
+}
+
+/* NAVIGATION LINKS */
+.nav1 a:link, .nav1 a:visited, .nav2 a:link, .nav2 a:visited, .nav3 a:link, .nav3 a:visited, .nav4 a:link, .nav4 a:visited, .nav5 a:link, .nav5 a:visited, .nav6 a:link, .nav6 a:visited, .nav7 a:link, .nav7 a:visited, .nav8 a:link, .nav8 a:visited{
+	color: #4E4E4E;
+	width: 80px;
+	height: 20px;
+	line-height: 20px;
+	background: url(images/01_linkbg2.gif) top repeat-y;
+	padding: 0;
+}
+.nav1_onpage a:link, .nav1_onpage a:visited, .nav2_onpage a:link, .nav2_onpage a:visited, .nav3_onpage a:link, .nav3_onpage a:visited, .nav4_onpage a:link, .nav4_onpage a:visited, .nav5_onpage a:link, .nav5_onpage a:visited, .nav6_onpage a:link, .nav6_onpage a:visited, .nav7_onpage a:link, .nav7_onpage a:visited, .nav8_onpage a:link, .nav8_onpage a:visited{
+	color: #4E4E4E;
+	width: 80px;
+	height: 20px;
+	line-height: 20px;
+	background: url(images/01_linkbg2.gif) top repeat-y;
+	padding: 0;
+}
+.nav1 a:link, .nav1 a:visited, .nav1_onpage a:link, .nav1_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 14px;
+}
+.nav2 a:link, .nav2 a:visited, .nav2_onpage a:link, .nav2_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 96px;
+}
+.nav3 a:link, .nav3 a:visited, .nav3_onpage a:link, .nav3_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 178px;
+}
+.nav4 a:link, .nav4 a:visited, .nav4_onpage a:link, .nav4_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 260px;
+}
+.nav5 a:link, .nav5 a:visited, .nav5_onpage a:link, .nav5_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 342px;
+}
+.nav6 a:link, .nav6 a:visited, .nav6_onpage a:link, .nav6_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 424px;
+}
+.nav7 a:link, .nav7 a:visited, .nav7_onpage a:link, .nav7_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 506px;
+}
+.nav8 a:link, .nav8 a:visited, .nav8_onpage a:link, .nav8_onpage a:visited{
+	position: absolute;
+	top: 2px;
+	left: 588px;
+}
+
+/*HOVER EFFECTS*/
+.nav1 a:hover, .nav1 a:active,
+.nav2 a:hover, .nav2 a:active,
+.nav3 a:hover, .nav3 a:active,
+.nav4 a:hover, .nav4 a:active,
+.nav5 a:hover, .nav5 a:active,
+.nav6 a:hover, .nav6 a:active,
+.nav7 a:hover, .nav7 a:active,
+.nav8 a:hover, .nav8 a:active{
+	background: url(images/01_linkbg1.gif) top repeat-y;
+	margin: 1px 0 0 0;
+}
+
+/*USE A DIFFERENT COLOR WHEN USER IS ON THAT PAGE*/
+
+.nav1_onpage a:link, .nav1_onpage a:visited,
+.nav2_onpage a:link, .nav2_onpage a:visited,
+.nav3_onpage a:link, .nav3_onpage a:visited,
+.nav4_onpage a:link, .nav4_onpage a:visited,
+.nav5_onpage a:link, .nav5_onpage a:visited,
+.nav6_onpage a:link, .nav6_onpage a:visited,
+.nav7_onpage a:link, .nav7_onpage a:visited,
+.nav8_onpage a:link, .nav8_onpage a:visited{
+	background: url(images/01_linkbg1.gif) top repeat-y;
+}
+
+/*THE FOLLOWING PART IS FOR THE FONT CONTROL*/
+#fontcontrol{
+	background: none;
+	width: 66px;
+	height: 18px;
+	position: absolute;
+	top: 18px;
+	left: 615px;
+}
+#fontcontrol ul{
+	background: none;
+	list-style: none;
+	padding: 0;
+	margin: 0;
+}
+#fontcontrol li{
+	background: none;
+}
+#fontcontrol i{
+	display: block;
+	visibility: hidden;
+}
+.font1 a:link, .font1 a:visited{
+	width: 18px;
+	height: 18px;
+	position: absolute;
+	top: 0;
+	left: 0;
+	background: url(images/01_font1.gif) no-repeat;
+}
+.font2 a:link, .font2 a:visited{
+	width: 18px;
+	height: 18px;
+	position: absolute;
+	top: 0;
+	left: 22px;
+	background: url(images/01_font2.gif) no-repeat;
+}
+.font3 a:link, .font3 a:visited{
+	width: 18px;
+	height: 18px;
+	position: absolute;
+	top: 0;
+	left: 44px;
+	background: url(images/01_font3.gif) no-repeat;
+}
+.font1 a:hover, .font1 a:active{
+	background-position: 0 -18px;
+}
+.font2 a:hover, .font2 a:active{
+	background-position: 0 -18px;
+}
+.font3 a:hover, .font3 a:active{
+	background-position: 0 -18px;
+}
+/*END NAVIGATION LINKS*/
+
+/*Nice Titles*/
+.nicetitle {
+	font-weight: bold;
+	color: #3C3C3C;
+	text-align: left;
+	position: absolute;
+	left: 0;
+	top: 0;
+	width: 25em;
+	z-index: 20;
+	max-width: 50%;
+}
+.nicetitle-content{
+	overflow: hidden;
+	background: white;
+	border: 1px solid #333;
+	padding: 5px;
+	opacity: 0.9;
+}
+.nicetitle p{
+	margin: 0;
+	line-height: 120%;
+}
+.nicetitle p.destination {
+	font-weight: normal;
+	font-size: 10px;
+	color: #5E7743;
+}
+div.nicetitle p span.accesskey {
+	color: #FF7200;
+}
+
+/* e107 core style */
+.tbox, .helpbox{
+	/* width: 80%; */
+	font-size: 11px;
+	font-family: Trebuchet MS, "Lucida Sans Unicode", Arial, Lucida Sans, Tahoma, Sans-Serif;
+	margin: 0 0 2px 0;
+	color: #494949;
+	border-top: 1px solid #868686;
+	border-left: 1px solid #868686;
+	border-bottom: 1px solid #D4D2CF;
+	border-right: 1px solid #D4D2CF;
+}
+.button{
+	font-size: 11px;
+	font-family: Trebuchet MS, "Lucida Sans Unicode", Arial, Lucida Sans, Tahoma, Sans-Serif;
+	margin: 1px 0 0 0;
+	padding: 1px 10px;
+	color: #494949;
+	background: white;
+	border-top: 1px solid #D4D2CF;
+	border-left: 1px solid #D4D2CF;
+	border-bottom: 1px solid #868686;
+	border-right: 1px solid #868686;
+}
+#commentform .tbox, #commentform .helpbox{
+	/* width: 400px; 
+	background-color:#000; */
+}
+
+
+.fborder, .border{
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar {
+	padding: 4px;
+	background-color: #fff;
+	border: 1px solid #D4DCDE;
+}
+
+.forumheader, .forumheader4, .finfobar {
+	background-color: #E2EDF0;
+}
+
+.forumheader5 {
+	cursor: pointer;
+}
+
+.fcaption, .forumheader5 {
+	background-color: #fff;
+}
+
+table {
+	margin-left: auto;
+	margin-right: auto;
+}
+
+
diff -ruN 6171/e107_themes/leaf/theme.js 75/e107_themes/leaf/theme.js
--- 6171/e107_themes/leaf/theme.js	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/leaf/theme.js	2005-07-27 01:19:46.000000000 -0500
@@ -0,0 +1,524 @@
+function setActiveStyleSheet(title) {
+  var i, a, main;
+  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
+    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
+      a.disabled = true;
+      if(a.getAttribute("title") == title) a.disabled = false;
+    }
+  }
+}
+
+function getActiveStyleSheet() {
+  var i, a;
+  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
+    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
+  }
+  return null;
+}
+
+function getPreferredStyleSheet() {
+  var i, a;
+  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
+    if(a.getAttribute("rel").indexOf("style") != -1
+       && a.getAttribute("rel").indexOf("alt") == -1
+       && a.getAttribute("title")
+       ) return a.getAttribute("title");
+  }
+  return null;
+}
+
+function createCookie(name,value,days) {
+  if (days) {
+    var date = new Date();
+    date.setTime(date.getTime()+(days*24*60*60*1000));
+    var expires = "; expires="+date.toGMTString();
+  }
+  else expires = "";
+  document.cookie = name+"="+value+expires+"; path=/";
+}
+
+function readCookie(name) {
+  var nameEQ = name + "=";
+  var ca = document.cookie.split(';');
+  for(var i=0;i < ca.length;i++) {
+    var c = ca[i];
+    while (c.charAt(0)==' ') c = c.substring(1,c.length);
+    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
+  }
+  return null;
+}
+
+window.onload = function(e) {
+  var cookie = readCookie("style");
+  var title = cookie ? cookie : getPreferredStyleSheet();
+  setActiveStyleSheet(title);
+}
+
+window.onunload = function(e) {
+  var title = getActiveStyleSheet();
+  createCookie("style", title, 365);
+}
+
+var cookie = readCookie("style");
+var title = cookie ? cookie : getPreferredStyleSheet();
+setActiveStyleSheet(title);
+
+
+
+// from http://www.kryogenix.org
+// by Scott Andrew - http://scottandrew.com
+// add an eventlistener to browsers that can do it somehow.
+function addEvent(obj, evType, fn)
+	{
+	if (obj.addEventListener)
+		{
+		obj.addEventListener(evType, fn, false);
+		return true;
+		}
+	else if (obj.attachEvent)
+		{
+		var r = obj.attachEvent('on'+evType, fn);
+		return r;
+		}
+	else
+		{
+		return false;
+		}
+	}
+
+function floatImages()
+	{
+	// adapted from http://www.dithered.com/javascript/browser_detect/
+	//**************************************************************//
+	// sniff user agent
+	var userAgent = navigator.userAgent.toLowerCase();
+
+	// if Mozilla 1.4 then quit
+	if ((userAgent.indexOf('gecko') != -1) && (userAgent.indexOf('gecko/') + 14 == userAgent.length) && (parseFloat(userAgent.substring(userAgent.indexOf('rv:') + 3)) == '1.4')) return;
+
+	// if Opera then quit
+	if (document.all && window.Event) return;
+	//**************************************************************//
+
+	// check this browser can cope with what we want to do
+	if (!document.getElementById) return;
+	var blogDiv = document.getElementById('blog');
+	if (!blogDiv) return;
+	if (!blogDiv.offsetWidth) return;
+
+	blogDiv.className = (blogDiv.offsetWidth >= 500) ? "float-images" : "block-images";
+	}
+
+// Blockquote citations
+
+// Simon Willison's work:
+// http://simon.incutio.com/archive/2002/12/20/#blockquoteCitations
+
+// Also Dunstan Orchard's work:
+// http://1976design.com/blog/archive/2003/11/10/updates/
+function blockquoteCite()
+	{
+	if (!document.createElementNS)
+		{
+		document.createElementNS = function(ns, elt)
+			{
+			return document.createElement(elt);
+			}
+		}
+	quotes = document.getElementsByTagName('blockquote');
+	for (i = 0; i < quotes.length; i++)
+		{
+		var cite = quotes[i].getAttribute('cite');
+		// value of cite attribute should only contain URI, not any other
+		if ((cite) && (cite != ''))
+			{
+			newlink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
+			newlink.setAttribute('href', cite);
+			newlink.className = 'cite-link';
+			newlink.appendChild(document.createTextNode(cite));
+			newdiv = document.createElementNS('http://www.w3.org/1999/xhtml', 'cite');
+			newdiv.className = 'blockquote-cite';
+			newdiv.appendChild(document.createTextNode('Source: '));
+			newdiv.appendChild(newlink);
+			quotes[i].appendChild(newdiv);
+			quotes[i].removeAttribute('cite');
+			}
+		}
+	}
+
+// Ins and Del tags citations
+function insdelCite()
+	{
+	if (!document.createElementNS)
+		{
+		document.createElementNS = function(ns, elt)
+			{
+			return document.createElement(elt);
+			}
+		}
+	var insdel = new Array(2);
+	insdel[0] = document.getElementsByTagName('ins');
+	insdel[1] = document.getElementsByTagName('del');
+	for (var i=0; i<insdel.length; i++)
+		{
+		if (insdel[i])
+			{
+			for (var id=0; id<insdel[i].length; id++)
+				{
+				var isdl = insdel[i][id].getAttribute('cite');
+				if ((isdl) && (isdl != ""))
+					{
+					idlink = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
+					idlink.setAttribute('href', isdl);
+					idlink.className = 'cite-link ' + (i == 0 ? 'ins-cite' : 'del-cite');
+					idlink.setAttribute('title','citation of ' + (i == 0 ? 'added' : 'deleted') + ' text');
+					idlink.appendChild(document.createTextNode('#'));
+					insdel[i][id].appendChild(idlink);
+					insdel[i][id].removeAttribute('cite');
+					}
+				}
+			}
+		}
+	}
+
+// Force IE not to show alternate text as tooltip
+function noAltTooltip()
+	{
+	images = document.getElementsByTagName('img');
+	for (var i = 0; i < images.length; i++)
+		{
+		var title = images[i].getAttribute('title');
+		var alt = images[i].getAttribute('alt');
+		if ((document.all) && (alt) && (!title))
+			{
+			images[i].setAttribute('title', '');
+			}
+		}
+	}
+
+// Nice Titles
+
+// original code by Stuart Langridge 2003-11
+// with additions to the code by other good people
+// http://www.kryogenix.org/code/browser/nicetitle/
+// thank you, sir
+
+// modified by Peter Janes 2003-03-25
+// http://peterjanes.ca/blog/archives/2003/03/25/nicetitles-for-ins-and-del
+// added in ins and del tags
+
+// modified by Dunstan Orchard 2003-11-18
+// http://1976design.com/blog/
+// added in accesskey information
+// tried ever-so-hard, but couldn't work out how to do what Ethan did
+
+// final genius touch by by Ethan Marcotte 2003-11-18
+// http://www.sidesh0w.com/
+// worked out how to delay showing the popups to make them more like the browser's own
+
+// set the namespace
+var XHTMLNS = 'http://www.w3.org/1999/xhtml';
+var CURRENT_NICE_TITLE;
+
+// browser sniff
+var browser = new Browser();
+
+// determine browser and version.
+function Browser()
+	{
+	var ua, s, i;
+
+	this.isIE = false;
+	this.isNS = false;
+	this.version = null;
+
+	ua = navigator.userAgent;
+
+	s = 'MSIE';
+	if ((i = ua.indexOf(s)) >= 0)
+		{
+		this.isIE = true;
+		this.version = parseFloat(ua.substr(i + s.length));
+		return;
+		}
+
+	s = 'Netscape6/';
+	if ((i = ua.indexOf(s)) >= 0)
+		{
+		this.isNS = true;
+		this.version = parseFloat(ua.substr(i + s.length));
+		return;
+		}
+
+	// treat any other 'Gecko' browser as NS 6.1.
+	s = 'Gecko';
+	if ((i = ua.indexOf(s)) >= 0)
+		{
+		this.isNS = true;
+		this.version = 6.1;
+		return;
+		}
+	}
+
+// 2003-11-19 sidesh0w
+// set delay vars to emulate normal hover delay
+var delay;
+var interval = 0.60;
+
+// this function runs on window load
+// it runs through all the links on the page as starts listening for actions
+function makeNiceTitles()
+	{
+	if (!document.createElement || !document.getElementsByTagName) return;
+	if (!document.createElementNS)
+		{
+		document.createElementNS = function(ns, elt)
+			{
+			return document.createElement(elt);
+			}
+		}
+
+	// do regular links
+	if (!document.links)
+		{
+		document.links = document.getElementsByTagName('a');
+		}
+	for (var ti=0; ti<document.links.length; ti++)
+		{
+		var lnk = document.links[ti];
+		// * I added specific class names here..
+		if (lnk.title)
+			{
+			lnk.setAttribute('nicetitle', lnk.title);
+			lnk.removeAttribute('title');
+			addEvent(lnk, 'mouseover', showDelay);
+			addEvent(lnk, 'mouseout', hideNiceTitle);
+			addEvent(lnk, 'focus', showDelay);
+			addEvent(lnk, 'blur', hideNiceTitle);
+			}
+		}
+
+	// 2003-03-25 Peter Janes
+	// do ins and del tags
+	var tags = new Array(2);
+	tags[0] = document.getElementsByTagName('ins');
+	tags[1] = document.getElementsByTagName('del');
+	for (var tt=0; tt<tags.length; tt++)
+		{
+		if (tags[tt])
+			{
+			for (var ti=0; ti<tags[tt].length; ti++)
+				{
+				var tag = tags[tt][ti];
+				if (tag.dateTime)
+					{
+					var strDate = tag.dateTime;
+					// HTML/ISO8601 date: yyyy-mm-ddThh:mm:ssTZD (Z, -hh:mm, +hh:mm)
+					var month = strDate.substring(5,7);
+					var day = strDate.substring(8,10);
+					if (month[0] == '0')
+						{
+						month = month[1];
+						}
+					if (day[0] == '0')
+						{
+						day = day[1];
+						}
+					var dtIns = new Date(strDate.substring(0,4), month-1, day, strDate.substring(11,13), strDate.substring(14,16), strDate.substring(17,19));
+					tag.setAttribute('nicetitle', (tt == 0 ? 'Added' : 'Deleted') + ' on ' + dtIns.toString());
+					addEvent(tag, 'mouseover', showDelay);
+					addEvent(tag, 'mouseout', hideNiceTitle);
+					addEvent(tag, 'focus', showDelay);
+					addEvent(tag, 'blur', hideNiceTitle);
+					}
+				}
+			}
+		}
+	}
+
+function findPosition(oLink)
+	{
+	if (oLink.offsetParent)
+		{
+		for (var posX = 0, posY = 0; oLink.offsetParent; oLink = oLink.offsetParent)
+			{
+			posX += oLink.offsetLeft;
+			posY += oLink.offsetTop;
+			}
+		return [posX, posY];
+		}
+	else
+		{
+		return [oLink.x, oLink.y];
+		}
+	}
+
+function getParent(el, pTagName)
+	{
+	if (el == null)
+		{
+		return null;
+		}
+	// gecko bug, supposed to be uppercase
+	else if (el.nodeType == 1 && el.tagName.toLowerCase() == pTagName.toLowerCase())
+		{
+		return el;
+		}
+	else
+		{
+		return getParent(el.parentNode, pTagName);
+		}
+	}
+
+// 2003-11-19 sidesh0w
+// trailerpark wrapper function
+function showDelay(e)
+	{
+    if (window.event && window.event.srcElement)
+		{
+        lnk = window.event.srcElement
+		}
+	else if (e && e.target)
+		{
+        lnk = e.target
+		}
+    if (!lnk) return;
+
+	// lnk is a textnode or an elementnode that's not ins/del
+    if (lnk.nodeType == 3 || (lnk.nodeType == 1 && lnk.tagName.toLowerCase() != 'ins' && lnk.tagName.toLowerCase() != 'del'))
+		{
+		// ascend parents until we hit a link
+		lnk = getParent(lnk, 'a');
+		}
+
+	delay = setTimeout("showNiceTitle(lnk)", interval * 1000);
+	}
+
+// build and show the nice titles
+function showNiceTitle(link)
+	{
+    if (CURRENT_NICE_TITLE) hideNiceTitle(CURRENT_NICE_TITLE);
+    if (!document.getElementsByTagName) return;
+
+    nicetitle = lnk.getAttribute('nicetitle');
+
+    var d = document.createElementNS(XHTMLNS, 'div');
+    d.className = 'nicetitle';
+    var dc = document.createElementNS(XHTMLNS, 'div');
+    dc.className = 'nicetitle-content';
+    d.appendChild(dc);
+    tnt = document.createTextNode(nicetitle);
+    pat = document.createElementNS(XHTMLNS, 'p');
+    pat.className = 'titletext';
+    pat.appendChild(tnt);
+
+	// 2003-11-18 Dunstan Orchard
+	// added in accesskey info
+	if (lnk.accessKey)
+		{
+        axs = document.createTextNode(' [' + lnk.accessKey + ']');
+		axsk = document.createElementNS(XHTMLNS, 'span');
+        axsk.className = 'accesskey';
+        axsk.appendChild(axs);
+		pat.appendChild(axsk);
+		}
+    dc.appendChild(pat);
+
+    if (lnk.href)
+		{
+        tnd = document.createTextNode(lnk.href);
+        pad = document.createElementNS(XHTMLNS, 'p');
+        pad.className = 'destination';
+        pad.appendChild(tnd);
+        dc.appendChild(pad);
+		}
+
+    STD_WIDTH = 300;
+
+	if (lnk.href)
+		{
+        h = lnk.href.length;
+		}
+	else
+		{
+		h = nicetitle.length;
+		}
+
+    if (nicetitle.length)
+		{
+		t = nicetitle.length;
+		}
+
+    h_pixels = h*6;
+	t_pixels = t*10;
+
+    if (h_pixels > STD_WIDTH)
+		{
+        w = h_pixels;
+		}
+	else if ((STD_WIDTH>t_pixels) && (t_pixels>h_pixels))
+		{
+        w = t_pixels;
+		}
+	else if ((STD_WIDTH>t_pixels) && (h_pixels>t_pixels))
+		{
+        w = h_pixels;
+		}
+	else
+		{
+        w = STD_WIDTH;
+		}
+
+    d.style.width = w + 'px';
+
+    mpos = findPosition(lnk);
+    mx = mpos[0];
+    my = mpos[1];
+
+    d.style.left = (mx+15) + 'px';
+    d.style.top = (my+35) + 'px';
+
+    if (window.innerWidth && ((mx+w) > window.innerWidth))
+		{
+        d.style.left = (window.innerWidth - w - 25) + 'px';
+		}
+    if (document.body.scrollWidth && ((mx+w) > document.body.scrollWidth))
+		{
+        d.style.left = (document.body.scrollWidth - w - 25) + 'px';
+		}
+
+    document.getElementsByTagName('body')[0].appendChild(d);
+
+    CURRENT_NICE_TITLE = d;
+	}
+
+function hideNiceTitle(e)
+	{
+	// 2003-11-19 sidesh0w
+	// clearTimeout
+	if (delay) clearTimeout(delay);
+	if (!document.getElementsByTagName) return;
+	if (CURRENT_NICE_TITLE)
+		{
+		document.getElementsByTagName('body')[0].removeChild(CURRENT_NICE_TITLE);
+		CURRENT_NICE_TITLE = null;
+		}
+	}
+
+addEvent(window, "load", floatImages);
+addEvent(window, "resize", floatImages);
+addEvent(window, "load", blockquoteCite);
+addEvent(window, "load", insdelCite);
+addEvent(window, "load", noAltTooltip);
+addEvent(window, "load", makeNiceTitles);
+
+// I'm very poor in JavaScript. Please correct me if I'm wrong.
+
+
+
+
+
+
+
+
+
diff -ruN 6171/e107_themes/leaf/theme.php 75/e107_themes/leaf/theme.php
--- 6171/e107_themes/leaf/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/leaf/theme.php	2006-01-12 03:52:21.000000000 -0600
@@ -0,0 +1,259 @@
+<?php
+/*
++---------------------------------------------------------------+
+|	e107 website system
+|
+|	Steve Dunstan 2001-2005
+|	http://e107.org
+|	jalist@e107.org
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/leaf/theme.php,v $
+|     $Revision: 1.15 $
+|     $Date: 2006/01/12 09:52:21 $
+|     $Author: lisa_ $
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+include_lan(e_THEME."leaf/languages/".e_LANGUAGE.".php");
+
+// [theme]
+$themename = "Leaf";
+$themeversion = "1.0";
+$themeauthor = "William Moffett [que]";
+$themeemail = "que@e107.net";
+$themewebsite = "http://e107themes.com";
+$themedate = "04/23/05";
+$themeinfo = "'Leaf' by <a href='http://e107themes.com' rel='external'>Que</a>, based on the nucleus cms theme by Ivan Fong aka <a href='http://www.stanch.net/'>Stanch</a>.";
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+$no_core_css = TRUE;
+$admin_logo = "1";
+$logo = rand(1, 4);
+
+// [layout]
+$layout = "_default";
+
+// [theme settings]
+define("STANDARDS_MODE", TRUE);
+define("IMODE", "lite");
+define("THEME_DISCLAIMER", "<br /><i>".$themeinfo."</i>");
+
+// [page defines used for css controll on per page basis]
+define("e_PAGE", substr(strrchr($_SERVER['PHP_SELF'], "/"), 1));
+define("e_PAGECLASS", str_replace(substr(strrchr(e_PAGE, "."), 0), "", e_PAGE));
+
+// [navigation]
+$register_sc[] = 'UL';
+
+// [credit links]
+$register_sc[] = 'LINKS';
+
+// [colorstyle] Used for sidbar menus and forum header background color custimization.
+$colorstyle ="E2EDF0";
+
+
+// [header function]
+function theme_head() {
+	global $logo, $colorstyle;
+	return "<link rel='alternate stylesheet' type='text/css' href='".THEME."style.css' title='Small' />
+	<link rel='alternate stylesheet' type='text/css' href='".THEME."fontstyles/medium.css' title='Medium' />
+	<link rel='alternate stylesheet' type='text/css' href='".THEME."fontstyles/large.css' title='Large' />
+	<style type='text/css'>
+	#header{
+		position: relative;
+		width: 700px;
+		height: 151px;
+		margin: auto;
+		background: url(".THEME."images/01_header0".$logo.".jpg) no-repeat;
+	}
+	/* Sidbar menu content styles */
+	.loginform, .searchform, .chatboxform, .onlineform{
+		background-color: #".$colorstyle.";
+	}
+	.defaultform{
+		background-color: #".$colorstyle.";
+	}
+	.forumheader, .forumheader4, .finfobar {
+		background-color: #".$colorstyle.";
+	}
+	</style>";
+}
+
+
+$HEADER = "
+<div id='header'><!--Start Header-->
+  <h1><a href='".SITEURL."' title='{SITENAME} home page' accesskey='0'>{SITENAME}</a></h1>
+  <div id='navigation'>
+    <h3 class='hidden'>Navigation</h3>
+    {UL}
+  </div>
+  <div id='fontcontrol'>
+    <h3 class='hidden'>Adjust font size:</h3>
+    <ul>
+      <li class='font1'><a href='#' onclick=\"setActiveStyleSheet('Small'); return false;\" title='Small' accesskey='S'><i>Small</i></a></li>
+      <li class='font2'><a href='#' onclick=\"setActiveStyleSheet('Medium'); return false;\" title='Medium' accesskey='M'><i>Medium</i></a></li>
+      <li class='font3'><a href='#' onclick=\"setActiveStyleSheet('Large'); return false;\" title='Large' accesskey='L'><i>Large</i></a></li>
+    </ul>
+  </div>
+</div><!-- Close Header-->
+<div id='wrapper'><!--Start Wrapper-->
+<div id='container'><!--Start Container-->
+  <div id='content'><!--Start Content-->
+    <div class='contentdiv'><!--Start Contentdiv-->
+        <div class='div".e_PAGECLASS."'>
+        <!--Database Generated Content-->
+	".(e_PAGECLASS == "news" ? "<h2>".PAGE_NAME."</h2>" : "")."";
+
+
+$FOOTER = "<!--End Database Generated Content-->
+      </div><!--Close Div pageclass-->
+    </div><!--Close Contentdiv-->
+  </div><!--Close Content-->
+</div><!--Close Container-->
+
+<div id='sidebar'>
+  <div class='sidebardiv'>
+{SETSTYLE=sidebar}
+<!-- Menu1 -->
+{MENU=1}
+<!-- End Menu1 -->
+<!-- Menu2 -->
+{MENU=2}
+<!-- End Menu2 -->
+{SETSTYLE}
+{LINKS}
+  </div><!-- Close sidebardiv -->
+</div><!-- Close sidebar_full -->
+<div class='clearing'>&nbsp;</div>
+</div><!--Close Wrapper-->
+<div id='footer'>
+<div id='credits'>{SITEDISCLAIMER}<br />{THEME_DISCLAIMER}</div>
+<!--End notes/Credits-->
+</div>
+<!--Close the tags like a good code monkey ;)-->";
+
+$CUSTOMHEADER = "
+<div id='header'><!--Start Header-->
+ <h1><a href='".SITEURL."' title='{SITENAME} : home page' accesskey='0'>{SITENAME}</a></h1>
+  <div id='navigation'>
+    <h3 class='hidden'>Navigation</h3>
+    {UL}
+  </div>
+  <div id='fontcontrol'>
+    <h3 class='hidden'>Adjust font size:</h3>
+    <ul>
+      <li class='font1'><a href='#' onclick=\"setActiveStyleSheet('Small'); return false;\" title='Small' accesskey='S'><i>Small</i></a></li>
+      <li class='font2'><a href='#' onclick=\"setActiveStyleSheet('Medium'); return false;\" title='Medium' accesskey='M'><i>Medium</i></a></li>
+      <li class='font3'><a href='#' onclick=\"setActiveStyleSheet('Large'); return false;\" title='Large' accesskey='L'><i>Large</i></a></li>
+    </ul>
+  </div>
+</div><!-- Close Header-->
+<div id='wrapper'><!--Start Wrapper-->
+<div id='container_full'><!--Start Container-->
+  <div id='content_full'><!--Start Content-->
+    <div class='contentdiv'><!--Start Contentdiv-->
+        <div class='div".e_PAGECLASS."'><!--Start Div pageclass-->
+        <!--Database Generated Content-->";
+
+
+$CUSTOMFOOTER = "<!--End Database Generated Content-->
+      </div><!--Close Div pageclass-->
+    </div><!--Close Contentdiv-->
+  </div><!--Close Content-->
+</div><!--Close Container-->
+<div class='clearing'>&nbsp;</div>
+</div><!--Close Wrapper-->
+<div id='footer'>
+<div id='credits'>{SITEDISCLAIMER}<br />{THEME_DISCLAIMER}</div>
+<!--End notes/Credits-->
+</div>
+<!--Close the tags like a good code monkey ;)-->";
+
+$CUSTOMPAGES = "content_manager.php signup.php fpw.php forum.php forum_viewforum.php forum_viewtopic.php theme.php usersettings.php submitnews.php";
+
+// [newsstyle]
+function news_style($news) {
+
+	$mydate  = strftime("%d/%m :", $news['news_datestamp']);
+	$NEWSSTYLE = "<!-- news item --><div class='contentbody'>
+	        <h3 class='news'>$mydate&nbsp; {NEWSTITLE}</h3>
+	{NEWSICON}&nbsp;{STICKY_ICON}&nbsp;
+	{NEWSBODY}
+	{EXTENDED}
+	        <br /><br />
+	        <div class='itemdetails'>
+	          <span class='item1'>{NEWSAUTHOR}</span>&nbsp;
+	          <span class='item2'>{NEWSCATEGORY}</span>&nbsp;
+	          <span class='item3'>{NEWSCOMMENTS}</span>
+	          <span class='item4'>{EMAILICON}</span>
+	          <span class='item5'>{PRINTICON}</span>
+	          <span class='item5'>{PDFICON}</span>
+	        </div>
+	        </div><!-- end news item -->";
+	return $NEWSSTYLE;
+}
+
+// [newsliststyle]
+$NEWSLISTSTYLE = "";
+
+define("ICONSTYLE", "border:0");
+define("COMMENTLINK", LAN_THEME_1);
+define("COMMENTOFFSTRING", LAN_THEME_2);
+define("EXTENDEDSTRING", LAN_THEME_3);
+
+// [linkstyle]
+define(PRELINK, "");
+define(POSTLINK, "");
+define(LINKSTART, "");
+define(LINKEND, "");
+define(LINKDISPLAY, "");  // 1 - along top, 2 - in left or right column
+
+// [tablestyle]
+function tablestyle($caption, $text, $mode=""){
+	global $style;
+	if(ADMIN){
+        	// echo "Style: ".$style.", Mode: ".$mode;
+	}
+	if($style == "sidebar"){  // sidebar styles
+
+		echo "<div class='sidebarbody'>";
+
+		if($mode){
+		        if($caption != ""){
+		                echo "<h3 class='".$mode."'>".$caption."</h3>";
+		                if($text != ""){
+		                        echo "<div class='sidebarin'><div class='defaultform'>".$text."</div></div>\n";
+		                }
+		        }else{
+		                echo "<div class='sidebarin'><div class='defaultform'>".$text."</div></div>\n";
+		        }
+		}else{
+			if($caption != ""){
+		                echo "<h3>".$caption."</h3>";
+		                if($text != ""){
+		                	echo "<div class='sidebarin'><div class='defaultform'>".$text."</div></div>\n";
+		                }
+		        }else{
+		                echo "<div class='sidebarin'><div class='defaultform'>".$text." </div></div>\n";
+		        }
+		}
+		echo "</div>\n";
+	}else{
+		echo "<h2>".$caption."</h2>
+		<div class='contentbody'>".$text."</div>";
+ 	}
+}
+
+// [commentstyle]
+$COMMENTSTYLE = "";
+
+// [chatboxstyle]
+$CHATBOXSTYLE = "";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/leaf/ul.sc 75/e107_themes/leaf/ul.sc
--- 6171/e107_themes/leaf/ul.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/leaf/ul.sc	2006-01-25 01:33:59.000000000 -0600
@@ -0,0 +1,34 @@
+global $sql, $link_class, $page;
+
+$sql -> db_Select('links', '*', "link_category = 1 and link_name NOT REGEXP('submenu') and link_name NOT REGEXP('child') and link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC");
+$ulmenu = PRELINK."<ul>";
+$r="1";
+while($row = $sql -> db_Fetch()){
+	if(!$link_class || check_class($link_class) || ($link_class==254 && USER)){
+		if($r <= "8"){
+			extract($row);
+			if(!preg_match("#(http:|mailto:|ftp:|https:)#",$link_url)){
+				$link_url = e_HTTP.$link_url;
+			}
+			if(strpos($link_url, e_PAGE) !== FALSE){ $ulclass = '_onpage'; } else { $ulclass = ''; }
+			switch ($link_open) {
+				case 1:
+					$link_append = " onclick=\"window.open('$link_url'); return false;\"";
+					break;
+				case 2:
+				   $link_append = " target=\"_parent\"";
+					break;
+				case 3:
+				   $link_append = " target=\"_top\"";
+					break;
+				default:
+				unset($link_append);
+			}
+ 			$lname = (defined(trim($link_name))) ? constant(trim($link_name)) : $link_name;
+			$ulmenu .= "<li class='nav".$r."$ulclass'><a class='$ulclass' ".($link_description ? " title = '$link_description' " : "title = 'add a text description to this link' ")." href='".$link_url."' accesskey='".$r."' ".$link_append.">".LINKSTART."$lname".LINKEND."</a></li>";
+		}
+		$r++;
+	}
+}
+$ulmenu .= "</ul>\n".POSTLINK;
+return $ulmenu;
\ No newline at end of file
Files 6171/e107_themes/newsroom/images/bar.jpg and 75/e107_themes/newsroom/images/bar.jpg differ
Files 6171/e107_themes/newsroom/images/bullet2.gif and 75/e107_themes/newsroom/images/bullet2.gif differ
Files 6171/e107_themes/newsroom/images/logo_bg.png and 75/e107_themes/newsroom/images/logo_bg.png differ
Files 6171/e107_themes/newsroom/images/logo_text.png and 75/e107_themes/newsroom/images/logo_text.png differ
Files 6171/e107_themes/newsroom/preview.jpg and 75/e107_themes/newsroom/preview.jpg differ
diff -ruN 6171/e107_themes/newsroom/style.css 75/e107_themes/newsroom/style.css
--- 6171/e107_themes/newsroom/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/newsroom/style.css	2006-04-26 02:02:04.000000000 -0500
@@ -0,0 +1,355 @@
+body {
+	color: #000;
+	background-color: #FFFFFF;
+	margin:0px;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 10px;
+	font-style: normal;
+}
+
+.header_setup {
+	margin-left:0px;
+	margin-right:auto;
+	padding-left:3px;
+	padding-right:3px;
+	width:770px;
+	background-color:#6A6A6A;
+	border:1px solid black
+}
+
+.newscat{
+
+
+}
+
+.newscat_table {
+   	width:100%;
+	margin-bottom:3px
+}
+
+.newscat_link {
+	text-align:left;
+	font-size:12px;
+	color:#fff
+}
+
+.othernews2 {
+	padding:3px;
+	background-color:#6A6A6A
+}
+
+td {
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 10px;
+	font-style: normal;
+}
+
+a:link {
+ color: #333333;
+ font-weight: bold;
+ text-decoration: none;
+ }
+
+a:visited {
+ color: #333333;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+a:hover {
+ color: #333333;
+ font-weight: bold;
+ text-decoration: underline;
+}
+
+
+a.forumlink{
+	color: #fff;
+	text-decoration: underline;
+}
+
+a.forumlink:visited{
+	color: #fff;
+	text-decoration: underline;
+}
+
+#clock {
+ font-family: arial, "ms sans serif", sans-serif;
+}
+
+.newsroom {
+	background-color: #333333;
+	color: #fff;
+	cursor: pointer;
+}
+.newsroom A:link, .newsroom A:visited {
+	color: #fff;
+}
+.newsroom A:link, TR .newsroom A:visited {
+	text-decoration: none;
+}
+
+.newsroomHilite {
+	background-color: #c00;
+	color: #fff;
+	cursor: pointer;
+}
+.newsroomHilite A:link, .newsroomHilite A:visited {
+	color: #fff;
+}
+.newsroomHilite A:link, .newsroomHilite A:visited {
+	text-decoration: none;
+}
+
+
+
+.leftcap {
+	background-color: #ddd;
+	background-image : url(images/fheader.png);
+	color: #000;
+	border-bottom:1px solid black;
+	border-top:1px solid white;
+	padding:3px
+}
+
+
+
+
+.newsroomRow  {
+	vertical-align: middle;
+	border: 1px solid;
+	border-color: #666666 #003 #003;
+}
+
+.dent {
+	background-color: #464545;
+	border-right: none;
+}
+
+
+
+.newsroomHiliteRow  {
+	vertical-align: middle;
+	border: 1px solid;
+	border-color: #f66 #600 #600;
+}
+
+.denthi {
+	background-color: #f66;
+	border-right: none;
+}
+
+
+
+
+h3 {
+ font-family: verdana, arial, "ms sans serif", sans-serif;
+ font-size: 16px;
+ margin: 10px;
+ line-height: 18px;
+ padding-left: 5px;
+ color: #e9ffe9;
+ }
+
+
+
+.smalltext {
+    background: none;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 10px;
+	font-style: normal;
+	color:#000;
+	text-align: right;
+}
+.smallblacktext {
+    background: none;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 10px;
+	font-style: normal;
+	color:#000;
+}
+.defaulttext {
+    background: none;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 12px;
+	font-style: normal;
+	color:#000;
+}
+.defaultwhitetext {
+    background: none;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 12px;
+	font-style: normal;
+	color:#ffffff;
+}
+.defaultblacktext {
+    background: none;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 12px;
+	font-style: normal;
+	color:#000;
+}
+.mediumtext {
+    background: none;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 11px;
+	font-style: normal;
+	color:#000;
+}
+.captiontext {
+    background: none;
+	letter-spacing: 0.4em;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 18px;
+	color:#5a6f5a;
+}
+.tbox{
+	background-color: #666666;
+	border: #666666 1px inset;
+	color: #ffffff;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 10px;
+}
+.button{
+	background-color: #333333;
+	border: #666666 1px outset;
+	color: #ffffff;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 9px;
+	text-align:center;
+}
+form {
+	margin: 0px 0px 0px 0px;
+}
+.spacer{
+	padding-bottom : 2px;
+	padding-left : 0px;
+	padding-right : 2px;
+	padding-top : 2px;
+}
+hr {
+	border-top: #666 1px solid;
+	border-bottom: #eee 1px solid;
+	height: 2px;
+	width: 92%;
+	text-align:center;
+}
+.border {
+	border-bottom: #000000 1px solid;
+	border-left: #000000 1px solid;
+	border-right: #000000 1px solid;
+	border-top: #000000 1px solid;
+}
+.caption {
+	border-bottom: #000000 1px solid;
+	letter-spacing: 0.2em;
+	padding-bottom: 2px;
+	padding-left: 2px;
+	padding-right: 2px;
+	padding-top: 2px;
+	background-color: #333333;
+	color: white;
+	text-align:left;
+	text-transform:uppercase;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 11px;
+}
+
+.caption2 {
+	border-bottom: #000000 1px solid;
+	letter-spacing: 0.2em;
+	padding-bottom: 2px;
+	padding-left: 2px;
+	padding-right: 2px;
+	padding-top: 2px;
+	background-color: #333333;
+	color: #ffffff;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 10px;
+}
+
+.bodytable {
+	width:100%;
+	background-color: #ffffff;
+	border-bottom: #cccccc 1px solid;
+	border-left: #cccccc 1px solid;
+	border-right: #cccccc 1px solid;
+	border-top: #cccccc 1px solid;
+	font-family: verdana, arial, "ms sans serif", sans-serif;
+	font-size: 12px;
+	font-style: normal;
+	color:#000;
+
+}
+
+.nextprev {
+	background-color: #E3E1E1;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 11px;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+	text-align:right;
+}
+
+.fborder {
+	border-bottom: #000000 1px solid;
+	border-left: #000000 1px solid;
+	border-right: #000000 1px solid;
+	border-top: #000000 1px solid;
+	background-color: #fff;
+}
+
+.forumheader{
+	background-color: #EBEFF2;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 14px;
+	color:#000;
+	padding: 4px;
+	background-image : url(images/fheader.png);
+	border: #C3BDBD 1px solid;
+}
+
+.forumheader2{
+	background-color: #EFEFEF;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 14px;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+}
+
+.forumheader3{
+	background-color: #E3E1E1;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 11px;
+	color:#000;
+	padding: 4px;
+	border: #C3BDBD 1px solid;
+}
+
+
+
+.fcaption {
+	text-align:left;
+	border: #000 1px solid;
+	padding-bottom: 2px;
+	padding-left: 8px;
+	padding-right: 0px;
+	padding-top: 2px;
+	background-color: #C9C7C7;
+	font-family: verdana, tahoma, arial, helvetica, sans-serif;
+	font-size: 12px;
+	color:#fff;
+}
+
+
+.helpbox {
+	border-bottom: #fff 1px solid;
+	border-left: #fff 1px solid;
+	border-right: #fff 1px solid;
+	border-top: #fff 1px solid;
+	color:#000;
+	font-family: tahoma, verdana, arial, helvetica, sans-serif;
+	font-size: 9px;
+}
diff -ruN 6171/e107_themes/newsroom/theme.php 75/e107_themes/newsroom/theme.php
--- 6171/e107_themes/newsroom/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/newsroom/theme.php	2006-04-26 02:02:04.000000000 -0500
@@ -0,0 +1,479 @@
+<?php
+
+
+
+if (!defined('e107_INIT')) { exit; }
+
+$themename = "newsroom";
+$themeversion = "1.01";
+$themeauthor = "CaMer0n";
+$themedate = "25th April 2006";
+$themeinfo = "This theme displays some of the news features of 0.7<br />For best results, create news items with a 'news-image' of 65x50 pixels.<br />To place these items in the top right area, choose 'othernews2' for the rendertype of the news item.<br />'othernews' may be used for the simple bullet listing below it.<br />This theme may be used freely under the GPL license providing the 'e107 newsroom' image is replaced.";
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+define("THEME_DISCLAIMER", "<br /><i>NewsRoom theme v1.01 by CaMer0n</i>");
+define("IMODE", "dark");
+
+// [layout]
+
+$layout = "_default";
+
+$HEADER = "
+<div style='text-align:left'>
+<div class='header_setup'>
+<div style='width:770px;padding:0px;'>
+<table cellpadding='0' cellspacing='0' style=\"background-image: url('".THEME_ABS."images/logo_bg.png');margin-bottom:0px;padding:0px;width:100%;\">
+	<tr>
+		<td style='padding-left:5px;'>
+			<img src=\"".THEME_ABS."images/logo_text.png\" style='display:block' alt=\"newsroom\"  />
+		</td>
+		<td style='text-align:right;padding-right:4px'>
+
+			<br />
+			{SEARCH=news}
+		</td>
+	</tr>
+</table>
+</div>
+<div style='padding-right:3px;text-align:right;color:silver;display:block;width:770px;background-color:#000000;height:16px;border-bottom:3px solid #c00'>
+{CUSTOM=clock}
+</div>
+
+<div style='padding-top:0px;text-align:left;margin-left:0px;margin-right:auto'>
+
+
+<table style='margin-top:6px;margin-left:0px;width:770px;' cellpadding=\"0\" cellspacing=\"0\">
+<tr>
+	<td style='text-align:left;vertical-align:top;width:145px' rowspan='2'>
+		<div style='margin-bottom:6px'>
+		{SITELINKS=flat}
+		</div>
+		{SETSTYLE=leftmenu}
+		{PLUGIN=login_menu}
+		{MENU=1}
+		{SETSTYLE=default}
+	</td>
+
+	<td style='vertical-align:top;padding-left:6px;padding-right:6px'>
+
+";
+$CUSTOMHEADER = $HEADER."<div>";
+$HEADER .= "<div style='width:440px'> ";
+$CUSTOMPAGES = "user.php usersettings.php forum_viewforum.php forum.php forum_viewtopic.php forum_post.php";
+
+$FOOTER = "
+		<div style='margin-top:6px'>
+		{NEWS_CATEGORIES}
+		</div>
+		</div>
+
+	</td>
+	<td style='width:170px;vertical-align:top;'>
+		{SETSTYLE=othernews}
+		{PLUGIN=other_news_menu/other_news2_menu}
+		{SETSTYLE=rightmenu}
+		{MENU=2}
+	</td>
+</tr>";
+
+$FOOTERBASE = "
+
+<tr>
+	<td colspan='2' style='vertical-align:top'>
+		<table cellpadding='0' cellspacing='6' style='width:100%'>
+		<tr>
+			<td style='vertical-align:top;width:33%'>
+				<!-- Powered by Menu Start -->
+				{SETSTYLE=bottom}
+				{PLUGIN=powered_by_menu}
+				<!-- Powered by Menu Stop -->
+			</td>
+			<td style=\"vertical-align:top;width:33%\">
+				<!-- Compliance Menu Start -->
+				{PLUGIN=compliance_menu}
+				<!-- Compliance Menu Stop -->
+			</td>
+			<td style='vertical-align:top;width:33%'>
+				<!-- Compliance Menu Start -->
+				{PLUGIN=sitebutton_menu}
+				<!-- Compliance Menu Stop -->
+			</td>
+		</tr>
+		</table>
+	</td>
+</tr>
+</table>
+
+
+
+
+
+
+<!-- FOOTER -->
+
+<table style='margin-top:4px;border:0px' width=\"770\" cellpadding=\"0\" cellspacing=\"0\">\n
+<tr>
+<td style='width:770px;border-top:1px solid #999999'>
+
+<div style='padding:5px;background-color:#333333;border-top:1px solid white'>
+<table style='width:100%;' border=\"0\" cellpadding=\"3\" cellspacing=\"0\">
+	<tr>
+	<td>&nbsp;
+	<a href='".e_HTTP."' style='color:silver;'>".SITENAME."</a>
+	</td>
+	<td style='text-align:center'>
+	{CUSTOM=language}
+	</td>
+	<td>
+	<a href='http://www.e107.org' rel='external' style='color:silver;'>e107.org</a>
+	</td>
+	<td>
+	<a href='http://www.e107coders.org' rel='external' style=\"color:silver;\">e107coders.org</a></td>
+	<td>
+	<a href='http://www.e107themes.org' rel='external' style=\"color:silver;\">e107themes.org</a></td>
+	<td>
+	<a href='http://www.e107styles.org'  style=\"color:silver;\">e107styles.org</a>
+	</td>
+
+	</tr>
+</table>
+</div>
+
+<div style=\"border-top:2px solid white;background-image: url('".THEME_ABS."images/logo_bg.png');text-align:center\">
+<table style='width:100%;'><tr>
+<td style='vertical-align:top;padding:10px;width:50%;border-right:1px dotted silver'>
+{SITEDISCLAIMER}
+</td>
+<td style='vertical-align:top;padding:10px;width:50%'>
+{SITETAG}
+</td>
+</tr>
+</table>
+</div>
+
+
+
+</td></tr></table>
+</div></div></div>\n";
+// this part just saves us duplicating the html in the footer section.
+$CUSTOMFOOTER = "</div></td>
+</tr>".$FOOTERBASE;
+
+$FOOTER .= $FOOTERBASE;
+
+
+$NEWSSTYLE = "
+	<div class='bodytable' style='width:100%'>
+	<table cellpadding='0' cellspacing='0' border='0' style='width:100%'>
+	 <tr>
+	 <td class='captionnews' style=\"padding-left:3px;font-weight:bold;font-size:22px;width:100%;\" >
+	{NEWSTITLE}
+	 </td>
+	 </tr>
+	</table>
+	<table style='width:100%'>
+	<tr>
+	<td style='text-align:justify;padding:3px'>
+	{NEWSBODY}
+	{EXTENDED}
+	<br />
+	</td>
+
+	</tr>
+	</table>
+	<table style='width:100%;border:0px' cellpadding='0' cellspacing='0' >
+	<tr>
+	<td style='padding:3px'>Posted on
+	{NEWSDATE}
+	 |
+	{EMAILICON}
+	{PRINTICON}
+	{PDFICON}
+	{ADMINOPTIONS}
+
+	</td>
+	</tr>
+	</table><br /></div>
+
+";
+
+// the style of the items in news.php?cat and news.php?all
+$NEWSLISTSTYLE = "<table cellpadding='0' cellspacing='0' style='margin-bottom:3px;border-bottom:1px solid black;width:100%'>
+
+	<tr><td style='padding:3px;vertical-align:top;width:65px'>
+		{NEWSTHUMBNAIL}
+	</td>
+	<td style='padding:3px;text-align:left;vertical-align:top'>
+	{NEWSTITLELINK}
+	<br />
+	{NEWSSUMMARY}
+	</td>
+	</tr>
+	</table>";
+
+
+// You can customize the news-category bullet listing here.
+
+$NEWSCAT = "\n\n\n\n<!-- News Category -->\n\n\n\n
+	<div style='padding:2px;padding-bottom:12px'>
+	<div class='leftcap' style='vertical-align:center'>
+	{NEWSCATICON}
+	&nbsp;<span style='vertical-align:top;margin-top:3px'>
+	{NEWSCATEGORY}
+	</span>
+	</div>
+	<div style='width:100%;text-align:left;padding-top:2px'>
+	{NEWSCAT_ITEM}
+	</div>
+	</div>
+";
+
+/*
+$NEWSCAT_ITEM = "
+        <div style='width:100%;height:14px;display:block'>
+        <table style='width:100%'>
+        <tr><td style='width:2px;vertical-align:middle'>&#8226;&nbsp;
+        {NEWSCATICON}
+        </td>
+        <td style='text-align:left;height:10px'>{NEWSTITLELINK} </td></tr></table></div>
+";*/
+
+
+
+
+$OTHERNEWS_STYLE = "<div style='text-align:left;margin-bottom:3px'>
+	<table style='width:100%'><tr><td style='color:black;text-align:left;width:10px;vertical-align:top'>
+&#8226;</td><td style='text-align:left;vertical-align:top'>
+	<div style='font-size:11px;'><b>{NEWSTITLELINK}</b></div></td></tr></table>
+	</div>";
+
+
+$OTHERNEWS2_STYLE = "
+	<table cellpadding='0' cellspacing='0' style='border-bottom:1px solid black;width:100%;'>
+	<tr><td class='caption2' colspan='2' style='padding:3px;text-decoration:none'>
+	{NEWSCATEGORY}
+	</td></tr>
+	<tr><td class='othernews2' style='vertical-align:top;'>
+	{NEWSTITLELINK}
+	<br />
+	{NEWSSUMMARY}
+	</td>
+	<td class='othernews2' style='text-align:right;vertical-align:top'>
+	{NEWSTHUMBNAIL}
+	</td>
+	</tr>
+	</table>
+";
+
+// [News]
+define("ICONSTYLE", "float: left; border:0");
+define("COMMENTLINK", "Comments");
+define("COMMENTOFFSTRING", "Comments Off");
+define("PRE_EXTENDEDSTRING", "<span style='font-size:13px'> ");
+define("EXTENDEDSTRING", "<br /><br /><b>FULL STORY</b>");
+define("POST_EXTENDEDSTRING", "</span><br />");
+define("ICONMAIL", "iconmail.png"); // Usable since e107v615
+define("ICONPRINT", "iconprint.png"); // Usable since e107v615
+
+// [News List by Category]
+define("NEWSLIST_ITEMLINK","font-weight:bold");
+define("NEWSLIST_THUMB","border:1px dotted black");
+define("NEWSLIST_CATICON","border:1px solid white");
+
+// [news categories]
+define("NEWSCAT_CATLINK","font-weight:bold;font-size:12px;text-decoration:none;color:black");
+define("NEWSCAT_ITEMLINK","font-size:12px;color:#fff");
+define("NEWSCAT_STYLE","width:100%;margin-bottom:3px");
+define("NEWSCAT_AMOUNT",3);
+define("NEWSCAT_COLS",2);
+define("NEWSCAT_THUMB","border:1px solid black");
+// define("NEWSCAT_CATICON","border:1px solid red");
+
+// [other news]
+define("OTHERNEWS_CATLINK","text-decoration:none;");
+define("OTHERNEWS_ITEMLINK","color:black;font-weight:bold;text-decoration:underline");
+define("OTHERNEWS_LIMIT",3);
+
+// [other news 2]
+define("OTHERNEWS2_CATLINK","color:white;text-decoration:none;");
+define("OTHERNEWS2_ITEMLINK","color:#cccccc;text-transform:uppercase;font-weight:bold;text-decoration:none;");
+define("OTHERNEWS2_LIMIT",4);
+
+// [linkstyle]
+
+function linkstyle($linkstyle){
+
+	$style['prelink'] = "<div style='width:145px'>";
+	$style['postlink'] = "</div>";
+	$style['linkstart'] = "<span class='dent' style='float:left'>&nbsp;</span><div class='newsroomRow'><div class='newsroom' onmouseover=\"this.style.backgroundColor='#6998CC';window.status='hithere'\" onmouseout=\"this.style.backgroundColor='#333333'\">";
+	$style['linkstart_hilite'] = "<span class='denthi' style='float:left'>&nbsp;</span><div class='newsroomHiliteRow'><div class='newsroomHilite' onmouseover=\"this.style.backgroundColor='#666666'\" onmouseout=\"this.style.backgroundColor='#c00'\">";
+	$style['linkend'] = "</div></div>";
+	$style['linkdisplay'] = 1;
+	$style['linkalign'] = "left";
+	$style['linkclass'] = "";
+
+    return $style;
+}
+
+
+function tablestyle($caption, $text){
+	global $style;
+
+switch ($style) {
+	case "leftmenu":
+	echo "<div style='width:145px'>
+	<table style='width:100%' cellpadding='0' cellspacing='0'>
+	<tr>
+	<td>
+	<div class='leftcap'>
+	{$caption}
+	</div>
+	<div class=\"forumheader3\" >{$text}</div>
+	</td></tr></table></div>";
+	break;
+
+	case "rightmenu":
+	echo "
+	<div class='spacer' style='border-top:2px solid #CC0000' >
+	<table style='width:100%;margin-left:0px' cellpadding='0' cellspacing='0'>
+	<tr>
+	<td class='caption'>".$caption."</td>
+	</tr>
+	</table>
+
+	<table style='width:100%;margin-left:0px' cellpadding='0' cellspacing='0'>
+	<tr>
+	<td class='forumheader3' >".$text."</td>
+	</tr>
+	</table>
+	</div>";
+	break;
+
+	case "highlight":
+	echo "<div class='spacer'><div style='background-color:#D0DBE8;border:1px solid silver'>
+	<div class='captionbar' style='text-align:left;text-transform:uppercase;white-space:nowrap'>".$caption."</div>
+	<div style='padding:4px'>".$text."</div>
+	</div></div>";
+	break;
+
+	case "othernews":
+	echo "<div style='text-align:left;margin-left:0px'>
+	<div style='padding:0px;text-align:left;margin-left:0px'>".$text."</div>
+	</div>";
+	break;
+
+	case "bottom":
+	echo "<div style='padding:3px;border-top:1px solid #CCCCCC;border-bottom:1px solid #CCCCCC'>
+	<b style=\"font-size:12px;color: #c00;\">{$caption}</b>
+	</div><div style='padding:3px;text-align:center'>{$text}</div>";
+	break;
+
+	default:
+	echo "<div style='width:100%;vertical-align:top'>
+	<table style='width:100%' cellpadding='0' cellspacing='0'>
+	<tr >
+	<td>
+	<div class=\"caption2\" style='color:white;padding:3px'>
+	$caption
+	</div>
+	<div class=\"forumheader3\" style='padding:6px'>{$text}</div>
+	</td></tr></table></div>";
+
+	break;
+ }
+}
+
+
+// for testing the news parser.
+
+/*$NEWSSTYLE = "
+NEWSTITLE =
+{NEWSTITLE}
+<br />
+<br />
+
+NEWSBODY =
+{NEWSBODY}
+<br />
+<br />
+<br /><br />
+NEWSICON = {NEWSICON}
+<br />
+<br />
+<br />
+<br />
+NEWSHEADER =
+{NEWSHEADER}
+<br />
+<br />
+NEWSCATEGORY =
+{NEWSCATEGORY}
+<br />
+<br />
+NEWSAUTHOR =
+{NEWSAUTHOR}
+<br />
+<br />
+
+NEWSDATE =
+{NEWSDATE}
+<br />
+<br />
+NEWSCOMMENTS =
+{NEWSCOMMENTS}
+<br />
+<br />
+EMAILICON =
+{EMAILICON}
+<br />
+<br />
+PRINTICON =
+{PRINTICON}
+<br />
+<br />
+NEWSID =
+{NEWSID}
+<br />
+<br />
+ADMINOPTIONS =
+{ADMINOPTIONS}
+<br />
+<br />
+EXTENDED =
+{EXTENDED}
+<br />
+<br />
+CAPTIONCLASS =
+{CAPTIONCLASS}
+<br />
+<br />
+ADMINCAPTION =
+{ADMINCAPTION}
+<br />
+<br />
+ADMINBODY =
+{ADMINBODY}
+<br />
+<br />
+NEWSSUMMARY =
+{NEWSSUMMARY}
+<br />
+<br />
+NEWSTHUMBNAIL =
+{NEWSTHUMBNAIL}
+<br />
+<br />
+STICKYICON =
+{STICKY_ICON}
+<br />
+<br />
+NEWSTITLELINK =
+{NEWSTITLELINK}
+<br />
+<br />
+
+
+";
+*/
+
+?>
\ No newline at end of file
Files 6171/e107_themes/nordranious/forum/fcap2.png and 75/e107_themes/nordranious/forum/fcap2.png differ
Files 6171/e107_themes/nordranious/forum/fcap.png and 75/e107_themes/nordranious/forum/fcap.png differ
Files 6171/e107_themes/nordranious/forum/finfobar.png and 75/e107_themes/nordranious/forum/finfobar.png differ
Files 6171/e107_themes/nordranious/images/bar2edge.gif and 75/e107_themes/nordranious/images/bar2edge.gif differ
Files 6171/e107_themes/nordranious/images/bar2.gif and 75/e107_themes/nordranious/images/bar2.gif differ
Files 6171/e107_themes/nordranious/images/bar.jpg and 75/e107_themes/nordranious/images/bar.jpg differ
Files 6171/e107_themes/nordranious/images/bar.png and 75/e107_themes/nordranious/images/bar.png differ
Files 6171/e107_themes/nordranious/images/blank.gif and 75/e107_themes/nordranious/images/blank.gif differ
Files 6171/e107_themes/nordranious/images/bullet1.gif and 75/e107_themes/nordranious/images/bullet1.gif differ
Files 6171/e107_themes/nordranious/images/bullet2.gif and 75/e107_themes/nordranious/images/bullet2.gif differ
Files 6171/e107_themes/nordranious/images/bullet3.gif and 75/e107_themes/nordranious/images/bullet3.gif differ
Files 6171/e107_themes/nordranious/images/button.png and 75/e107_themes/nordranious/images/button.png differ
Files 6171/e107_themes/nordranious/images/cap.png and 75/e107_themes/nordranious/images/cap.png differ
Files 6171/e107_themes/nordranious/images/corner.png and 75/e107_themes/nordranious/images/corner.png differ
Files 6171/e107_themes/nordranious/images/left.png and 75/e107_themes/nordranious/images/left.png differ
Files 6171/e107_themes/nordranious/images/side.png and 75/e107_themes/nordranious/images/side.png differ
Files 6171/e107_themes/nordranious/images/top.png and 75/e107_themes/nordranious/images/top.png differ
diff -ruN 6171/e107_themes/nordranious/style.css 75/e107_themes/nordranious/style.css
--- 6171/e107_themes/nordranious/style.css	2004-05-06 14:24:26.000000000 -0500
+++ 75/e107_themes/nordranious/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,346 +0,0 @@
-body {
-	font-size: 12px;
-	color: #000;
-	font-family: tahoma, verdana, arial, sans-serif;
-	background-color: #fff;
-	margin:0px; text-align:left;
-}
-a {
-	color: #716d6d;
-	text-decoration: underline;
-}
-a:hover {
-	color: #2a3236;
-	text-decoration: underline;
-}
-
-.smalltext {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#5d6e75;
-
-}
-.smallblacktext {
-	font: normal 11px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#000;
-}
-
-.indent{
-	padding: 3px 3px 3px 3px;
-	margin: 5px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #000060;
-	border: 1px solid;
-	background-color: #CAC8D4;
-	border-bottom: #FFFFFF 1px solid;
-	border-left: #000 1px solid;
-	border-right: #FFFFFF 1px solid;
-	border-top: #000 1px solid;
-}
-
-.defaulttext {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color:#000;
-}
-
-td {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color:#5d6e75;
-	padding-bottom: 0px;
-	padding-left: 0px;
-	padding-right: 0px;
-	padding-top: 0px;
-	text-align:left;
-}
-
-blockquote {
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-style: italic;
-	color:#7e96ac;
-}
-.mediumtext {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color:#000;
-}
-.captiontext {
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 18px;
-	color:#000;
-}
-.tbox{
-	background-color: #eaeef2;
-	border-bottom: #5e5d63 1px solid;
-	border-left: #5e5d63 1px solid;
-	border-right: #5e5d63 1px solid;
-	border-top: #5e5d63 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-}
-.nextprev{
-	background-color: #eaeef2;
-	border: 1px solid #696C6C;
-	color: #000;
-	font: normal 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:right;
-	padding : 2px, 2px, 2px, 2px;
-	background-image : url(images/button.png);
-}
-.button{
-	background-color: #eaeef2;
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 9px;
-	text-align:center;
-	background-image : url(images/button.png);
-}
-
-.np{
-	background-color: #eaeef2;
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 9px;
-	text-align:center;
-	padding-bottom : 2px;
-	padding-left : 2px;
-	padding-right : 2px;
-	padding-top : 2px;
-}
-
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding-bottom : 2px;
-	padding-left : 0px;
-	padding-right : 0px;
-	padding-top : 2px;
-}
-hr {
-	border-top: #666 1px solid;
-	border-bottom: #eee 1px solid;
-	height: 2px;
-	width: 92%;
-	text-align:center;
-}
-.border {
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	background-color: transparent;
-}
-
-.border2 {
-	border-bottom: #D5D5D5 1px solid;
-	border-left: #D5D5D5 1px solid;
-	border-right: #D5D5D5 1px solid;
-	border-top: #D5D5D5 1px solid;
-	background-color: transparent;
-}
-
-.border3 {
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	background-color: transparent;
-}
-.helpbox {
-	border: transparent;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
-
-.caption {
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	border-bottom: #363A44 1px solid;
-	border-left: #8A96B3 1px solid;
-	border-right: #363A44 1px solid;
-	border-top: #8A96B3 1px solid;
-	background-color: #E1DFDF;
-	color: #E1DFDF;
-	font-family: tahoma, arial, verdana, helvetica, sans-serif;
-	font-size: 13px;
-	background-image : url(images/cap.png);
-}
-
-.caption2 {
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	background-color: transparent;
-	color: #243B3B;
-	font-family: tahoma, arial, verdana, helvetica, sans-serif;
-	font-size: 15px;
-	text-align:center;
-}
-.caption3 {
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	border-bottom: #C7C3C3 1px solid;
-	border-left: #fff 1px solid;
-	border-right: transparent;
-	border-top: #fff 1px solid;
-	background-color: #D5D5D5;
-	color: #000;
-	font-family: tahoma, arial, verdana, helvetica, sans-serif;
-	font-size: 13px;
-}
-
-.bodytable {
-	background-color: transparent;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color: #000;
-}
-
-.bodytable2 {
-	background-color: transparent;
-	border-bottom: #D5D5D5 1px solid;
-	border-left: #D5D5D5 1px solid;
-	border-right: #D5D5D5 1px solid;
-	border-top: #D5D5D5 1px solid;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color: #404040;
-}
-
-.bodytable3 {
-	background-color: transparent;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color: #000;
-}
-
-p {
-	margin-top: 0px;
-	margin-bottom: 0px
-}
-
-.fborder {
-	border-bottom: #000000 1px solid;
-	border-left: #000000 1px solid;
-	border-right: #000000 1px solid;
-	border-top: #000000 1px solid;
-	background-color: #fff;
-	
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#000;
-	padding: 4px;
-	background-image : url(forum/fcap2.png);
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader2{
-	background-color: #EFEFEF;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader3{
-	background-color: #E3E1E1;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.forumborder{
-	border-bottom: #000080 1px solid;
-	border-left: #000080 1px solid;
-	border-right: #000080 1px solid;
-	border-top: #000080 1px solid;
-	background-color: transparent;
-}
-
-.fcaption {
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(forum/fcap.png);
-	font-size: 12px;
-	color:#fff;
-}
-
-.topbar {
-	background-image : url(images/topbar.png);
-}
-.leftbar {
-	background-image : url(images/leftbar.png);
-}
-
-
-.bar1{padding: 0px; margin: 0px; background-image: url(images/corner.png); width: 37px;}
-.bar2{padding: 0px; margin: 0px; width: *; background: #DBDBDB; background-repeat: repeat-x; background-image: url(images/top.png);}
-.bar3{padding: 0px; margin: 0px; background: #DBDBDB; background-repeat: repeat-y; background-image: url(images/side.png); width: 37px;}
-
-.finfobar{
-	background-color: #CCC8C8;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-	background-image : url(forum/finfobar.png);
-}
-
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
-
-
-.searchhighlight{text-decoration: underline;color:#FFFFFF;font-weight:bold;background-color:#758393;}
\ No newline at end of file
diff -ruN 6171/e107_themes/nordranious/theme.php 75/e107_themes/nordranious/theme.php
--- 6171/e107_themes/nordranious/theme.php	2004-03-03 12:24:36.000000000 -0600
+++ 75/e107_themes/nordranious/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,153 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "nordranious";
-$themeversion = "1.0";
-$themeauthor = "jalist";
-$themedate = "26/08/02";
-$themeinfo = "compatible with e107 v5+<br />Made as an example of using different styles for left/right/center columns";
-
-define("THEME_DISCLAIMER", "<br /><i>nordranious theme by jalist (e107 default)</i>");
-
-
-// [layout]
-
-$layout = "_default";
-
-$HEADER = "
-<div style='text-align:center'>
-<table cellpadding='0' cellspacing='0' border='0' style='width: 100%; background-color: #D5D5D5;'>
-<tr>
-<td colspan='4' style='background-color: #D5D5D5; padding: 3px; text-align:left;'>
-<table style='width:100%'><tr><td style='vertical-align:top; width:2%'><img src='".THEME."images/bullet3.gif' alt='' style='vertical-align:absmiddle' /></td>
-<td style='vertical-align:top'><span class='captiontext'>
-{SITENAME}
-</span><br />
-{SITETAG}
-</td>
-<td style='text-align:right; vertical-align:bottom'>
-{CUSTOM=search}
-{SITELINKS=flat}
-</td>
-</tr></table>
-</td>
-</tr>
-<tr>
-<td style='padding: 0px; margin: 0px; width: 150px;'></td>
-<td class='bar1 '><img src='".e_IMAGE."generic/blank.gif' width='37' height='37' alt='' style='display: block;' /></td>
-<td class='bar2'><img src='".e_IMAGE."generic/blank.gif' width='2' height='37' alt='' style='display: block;' /></td>
-<td class='bar2'><img src='".e_IMAGE."/generic/blank.gif' width='2' height='37' alt='' style='display: block;' /></td>
-</tr>
-<tr>
-<td style='padding: 0px; margin: 0px; width: 150px; vertical-align:top'><hr />
-{SETSTYLE=leftmenu}
-{MENU=1}
-<br />
-</td>
-<td class='bar3'><img src='images/blank.gif' width='37' height='2' alt='' style='display: block;' /></td>
-<td style='padding: 4px; margin: 0px; width: *; background-color: #EEF4F4; vertical-align:top;'>
-{SETSTYLE=default}
-";
-
-$FOOTER = "
-<br />
-<div style='text-align:center'>
-{SITEDISCLAIMER}
-</div>
-</td>
-<td style='width:150px; vertical-align:top; background-color:#EEF4F4'>
-{SETSTYLE=rightmenu}
-{MENU=2}
-</td>
-</tr>
-</table>
-</div>";
-
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-<div class='caption'>
-{NEWSTITLE}
-</div>
-<div class='bodytable' style='text-align:left'>
-{NEWSICON}
-{NEWSBODY}
-{EXTENDED}
-</div>
-<div style='text-align:right'>
-{EMAILICON}
-{PRINTICON}
-{ADMINOPTIONS}
-<br />
-Posted by 
-{NEWSAUTHOR}
-on
-{NEWSDATE}
-&nbsp;::&nbsp;
-{NEWSCOMMENTS}
-</div>
-<br />";
-
-define("ICONSTYLE", "float: left; border:0");
-define("COMMENTLINK", "Read/Post Comment: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-
-define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
-define("EXTENDEDSTRING", "Read the rest ...");
-define("POST_EXTENDEDSTRING", " ]<br />");
-
-
-// [linkstyle]
-
-define(PRELINK, "| ");
-define(POSTLINK, "");
-define(LINKSTART, "");
-define(LINKEND, " | ");
-define(LINKDISPLAY, 1);
-define(LINKALIGN, "right");
-
-
-//	[tablestyle]
-
-function tablestyle($caption, $text){
-	global $style;
-//	echo "Mode: ".$style;
-	if($style == "leftmenu"){
-		if($caption != ""){
-			echo "<div class='border2'><div class='caption2'>".$caption."</div></div>";
-			if($text != ""){
-				echo "\n<div class='bodytable2'>".$text."</div>";
-			}
-		}else{
-			echo "<div class='border2'><div class='bodytable2'>".$text."</div></div><br />";
-		}
-	}else if($style == "default"){
-		if($caption != ""){
-			echo "<div class='border'><div class='caption'>".$caption."</div></div><div class='bodytable'>".$text."</div><br />";
-		}else{
-			echo "<div class='bodytable'>".$text."</div><br />";
-		}
-	}else{
-		if($caption != ""){
-			echo "<div class='border3'><div class='caption3'>".$caption."</div></div><div class='bodytable3'>".$text."</div><br />";
-		}else{
-			echo "<div class='bodytable3'>".$text."</div><br />";
-		}
-	}
-}
-
-?>
\ No newline at end of file
Files 6171/e107_themes/phpbb/forum/fcap2.png and 75/e107_themes/phpbb/forum/fcap2.png differ
Files 6171/e107_themes/phpbb/forum/fcap.png and 75/e107_themes/phpbb/forum/fcap.png differ
Files 6171/e107_themes/phpbb/forum/finfobar.png and 75/e107_themes/phpbb/forum/finfobar.png differ
Files 6171/e107_themes/phpbb/images/bar2edge.gif and 75/e107_themes/phpbb/images/bar2edge.gif differ
Files 6171/e107_themes/phpbb/images/bar2.gif and 75/e107_themes/phpbb/images/bar2.gif differ
Files 6171/e107_themes/phpbb/images/bar.jpg and 75/e107_themes/phpbb/images/bar.jpg differ
Files 6171/e107_themes/phpbb/images/bullet1.gif and 75/e107_themes/phpbb/images/bullet1.gif differ
Files 6171/e107_themes/phpbb/images/bullet2.gif and 75/e107_themes/phpbb/images/bullet2.gif differ
Files 6171/e107_themes/phpbb/images/bullet3.gif and 75/e107_themes/phpbb/images/bullet3.gif differ
Files 6171/e107_themes/phpbb/images/button.png and 75/e107_themes/phpbb/images/button.png differ
Files 6171/e107_themes/phpbb/images/cap1.gif and 75/e107_themes/phpbb/images/cap1.gif differ
Files 6171/e107_themes/phpbb/images/cap.png and 75/e107_themes/phpbb/images/cap.png differ
Files 6171/e107_themes/phpbb/images/header.png and 75/e107_themes/phpbb/images/header.png differ
Files 6171/e107_themes/phpbb/images/sb_template.png and 75/e107_themes/phpbb/images/sb_template.png differ
diff -ruN 6171/e107_themes/phpbb/style.css 75/e107_themes/phpbb/style.css
--- 6171/e107_themes/phpbb/style.css	2004-03-03 12:24:36.000000000 -0600
+++ 75/e107_themes/phpbb/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,230 +0,0 @@
-body {
-	font: 11px verdana, tahoma, arial, sans-serif;
-	background-color: #E5E5E5;
-	margin:10px;
-	text-align:left;
-}
-a {
-	color: #006699;
-	text-decoration: underline;
-}
-a:hover {
-	color: #DD6900;
-	text-decoration: underline;
-}
-.indent{
-	padding: 3px 3px 3px 3px;
-	margin: 5px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #000060;
-	border: 1px solid;
-	background-color: #CCD5D9;
-	border-bottom: #FFFFFF 1px solid;
-	border-left: #000 1px solid;
-	border-right: #FFFFFF 1px solid;
-	border-top: #000 1px solid;
-}
-.smalltext {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#444;
-	letter-spacing: -1px;
-}
-.smallblacktext {
-	font: normal 12px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#000;
-}
-.defaulttext {
-	font: normal 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-
-td {
-	font: normal 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 0px, 0px, 0px, 0px;
-	text-align:left;
-}
-
-.mediumtext {
-	font: normal 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-.captiontext {
-	font: bold 22px "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif;
-	color:#000;
-	line-height : 120%;
-}
-.tbox{
-	background-color: #fff;
-	border: #5e5d63 1px solid;
-	color: #000;
-	font: normal 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-.button{
-	border: 1px solid #5E5D63;
-	color: #000;
-	font: normal 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	background-image : url(images/button.png);
-}
-
-.nextprev{
-	background-color: #eaeef2;
-	border: 1px solid #069;
-	color: #000;
-	font: normal 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-	padding : 2px, 2px, 2px, 2px;
-	background-image : url(images/button.png);
-}
-
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding-bottom : 2px;
-	padding-left : 0px;
-	padding-right : 0px;
-	padding-top : 2px;
-}
-hr {
-	border-bottom: #C6D6D6 1px solid;
-	border-top: #006699 1px solid;
-	height: 2px;
-	width: 100%;
-	text-align:center;
-	vertical-align:bottom;
-}
-.border {
-	border: #006699 2px solid;
-	background-color: transparent;
-}
-.caption {
-	padding-bottom: 8px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 7px;
-	border-bottom: #ccc 1px solid;
-	border-left: #fff 1px solid;
-	border-right: #ccc 1px solid;
-	border-top: #fff 1px solid;
-	background-color: #e2e2e2;
-	color: #000;
-	font: 11px tahoma, arial, verdana, helvetica, sans-serif;
-	background-image : url(images/cap1.gif);
-}
-
-.bodytable {
-	background-color: #EFEFEF;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font: normal 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-
-.infobar{
-	padding-bottom: 4px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 2px;
-	border-bottom: #ccc 1px solid;
-	border-left: #fff 1px solid;
-	border-right: #ccc 1px solid;
-	border-top: #fff 1px solid;
-	background-color: #e2e2e2;
-	color: #000;
-	font: 10px tahoma, arial, verdana, helvetica, sans-serif;
-	background-image : url(images/cap1.gif);
-}
-
-
-.maintable {
-	background-color: #fff;
-	border: #98AAB1 2px solid;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font: normal 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #404040;
-}
-
-p {
-	margin-top: 0px
-}
-
-.fborder, .fbdefault{
-	border: #000000 1px solid;
-	background-color: #fff;
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	background-image : url(forum/fcap2.png);
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader2, .f2default{
-	background-color: #EFEFEF;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader3, .f3default{
-	background-color: #E3E1E1;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.fcaption, .fcdefault {
-	border: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(forum/fcap.png);
-	color:#fff;
-}
-
-.fcaption2{
-	border: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(forum/fcap.png);
-	color:#fff;
-}
-
-.finfobar{
-	background-color: #CCC8C8;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-	background-image : url(forum/finfobar.png);
-}
-
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
-
-.helpbox {
-	border: 0px none red;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
diff -ruN 6171/e107_themes/phpbb/theme.php 75/e107_themes/phpbb/theme.php
--- 6171/e107_themes/phpbb/theme.php	2004-04-25 23:37:38.000000000 -0500
+++ 75/e107_themes/phpbb/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,237 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "phpBB";
-$themeversion = "5.0";
-$themeauthor = "jalist";
-$themedate = "26/08/02";
-$themeinfo = "";
-
-define("THEME_DISCLAIMER", "<br />phpBB theme by jalist based on phpBB forum system, <a href='http://phpbb.com'>phpBB.com</a>");
-
-// [layout]
-$layout = "_default";
-
-$HEADER = 
-"<div class='centre'>
-<table style='width:100%' class='maintable' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='width:30%'>
-{LOGO}
-</td>
-<td style='width:10%;'>&nbsp;</td>
-<td style='width:50%; text-align:center'>
-<span class='captiontext'>
-{SITETAG}
-</span>
-<br /><br />
-{SITELINKS=flat}
-</td>
-<td style='width:10%;'>&nbsp;</td>
-</tr>
-<tr>
-<td colspan='4' >
-<table style='width:100%' cellspacing='0' cellpadding='0'><tr>
-<td style='width:25%; vertical-align: top;padding:10px'>
-{MENU=1}
-</td><td style='width:50%; vertical-align: top;padding-top:10px'>";
-
-
-$FOOTER = 
-"</td><td style='width:25%; vertical-align:top;padding:10px'>
-{MENU=2}
-</td></tr>
-<tr>
-<td colspan='3' style='text-align:center' class='smalltext'>
-{SITEDISCLAIMER}
-</td>
-</tr>
-</table>
-<table style='width:60%'>
-<tr>
-<td style='width:33%; vertical-align:top'>
-{MENU=3}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=4}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=5}
-</td>
-</tr>
-</table>
-</td></tr></table></div>";
-
-$CUSTOMHEADER = "
-<div style='text-align:center'>
-<table style='width:100%' class='maintable' cellspacing='10'>
-<tr>
-<td style='width:30%'>
-{LOGO}
-</td>
-<td style='width:10%;'>&nbsp;</td>
-<td style='width:50%; text-align:center'>
-<span class='captiontext'>
-{SITETAG}
-</span>
-<br /><br />
-{SITELINKS=flat}
-</td>
-<td style='width:10%;'>&nbsp;</td>
-</tr>
-<tr>
-<td colspan='4' >
-<table style='width:100%' ><tr>
-<td>";
-
-$CUSTOMFOOTER = "
-</td></tr>
-<tr>
-<td colspan='3' style='text-align:center' class='smalltext'>
-{SITEDISCLAIMER}
-</td>
-</tr>
-</table>
-<table style='width:60%'>
-<tr>
-<td style='width:33%; vertical-align:top'>
-{MENU=3}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=4}
-</td>
-<td style='width:33%; vertical-align:top'>
-{MENU=5}
-</td>
-</tr>
-</table>
-</td></tr></table></div>";
-
-
-
-$CUSTOMPAGES = "forum.php forum_post.php forum_viewforum.php forum_viewtopic.php e107_test/test.php";
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-<div class='border'>
-<div class='caption'>
-<b>
-{NEWSTITLE}
-</b>
-</div>
-<div class='bodytable'>
-<div style='text-align:left'>
-{NEWSBODY}
-{EXTENDED}
-<div style='text-align:right'>
-{EMAILICON}
-{PRINTICON}
-{ADMINOPTIONS}
-</div>
-</div>
-</div>
-<div class='infobar'>
-Posted by 
-{NEWSAUTHOR}
-on
-{NEWSDATE}
-&nbsp;::&nbsp;
-{NEWSCOMMENTS}
-</div>
-</div>
-<br />";
-
-define("ICONSTYLE", "float: left; border:0");
-define("COMMENTLINK", "Read/Post Comment: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-
-define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
-define("EXTENDEDSTRING", "Read the rest ...");
-define("POST_EXTENDEDSTRING", " ]<br />");
-
-
-// [linkstyle]
-
-define(PRELINK, "");
-define(POSTLINK, "");
-define(LINKSTART, "<img src='".THEME."images/bullet3.gif' alt='bullet' style='vertical-align:middle' /> ");
-define(LINKEND, "&nbsp;&nbsp;");
-define(LINKALIGN, "center");
-
-
-//	[tablestyle]
-function tablestyle($caption, $text, $mode=""){
-	if($caption != ""){
-		echo "<div class='border'><div class='caption'><b>".$caption."</b></div>\n";
-		if($text != ""){
-			echo "\n<div class='bodytable'>".$text."</div>\n";
-		}
-		echo "</div>";
-	}else{
-		echo "<div class='border'><div class='bodytable'>".$text."</div></div><br />\n";
-	}
-	echo "<br />";
-}
-
-// [commentstyle]
-
-$COMMENTSTYLE = "
-<table style='width:100%'>
-<tr>
-<td colspan='2' class='forumheader3'>
-{SUBJECT}
-<b>
-{USERNAME}
-</b>
-|
-<span class='smalltext'>
-{TIMEDATE}
-</span>
-</td>
-</tr>
-<tr>
-<td style='width:30%; vertical-align:top'>
-{LEVEL}
-{AVATAR}
-<span class='smalltext'>
-{COMMENTS}
-{JOINED}
-{LOCATION}
-</span>
-</td>
-<td style='width:70%; vertical-align:top'>
-{COMMENT}
-<br /><i><span class='smalltext'>
-{SIGNATURE}
-</span></i>
-</td>
-</tr>
-</table>
-<br />";
-
-//	[chatboxstyle]
-
-$CHATBOXSTYLE = "
-<span class='defaulttext'><b>{USERNAME}</b></span>
-<span class='smalltext'>on {TIMEDATE}</span><br />
-<div class='defaulttext' style='text-align:left'>
-{MESSAGE}
-</div>
-<br />
-";
-
-?>
\ No newline at end of file
Files 6171/e107_themes/ranyart/images/bar2edge.gif and 75/e107_themes/ranyart/images/bar2edge.gif differ
Files 6171/e107_themes/ranyart/images/bar2.gif and 75/e107_themes/ranyart/images/bar2.gif differ
Files 6171/e107_themes/ranyart/images/bar.jpg and 75/e107_themes/ranyart/images/bar.jpg differ
Files 6171/e107_themes/ranyart/images/bullet1.gif and 75/e107_themes/ranyart/images/bullet1.gif differ
Files 6171/e107_themes/ranyart/images/bullet2.gif and 75/e107_themes/ranyart/images/bullet2.gif differ
Files 6171/e107_themes/ranyart/images/button.png and 75/e107_themes/ranyart/images/button.png differ
Files 6171/e107_themes/ranyart/images/cap.png and 75/e107_themes/ranyart/images/cap.png differ
Files 6171/e107_themes/ranyart/images/clock.png and 75/e107_themes/ranyart/images/clock.png differ
Files 6171/e107_themes/ranyart/images/header.png and 75/e107_themes/ranyart/images/header.png differ
Files 6171/e107_themes/ranyart/images/logo.png and 75/e107_themes/ranyart/images/logo.png differ
Files 6171/e107_themes/ranyart/images/monitor.png and 75/e107_themes/ranyart/images/monitor.png differ
diff -ruN 6171/e107_themes/ranyart/style.css 75/e107_themes/ranyart/style.css
--- 6171/e107_themes/ranyart/style.css	2004-09-01 04:06:54.000000000 -0500
+++ 75/e107_themes/ranyart/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,356 +0,0 @@
-body {
-	font-size: 12px;
-	color: #000;
-	font-family: tahoma, verdana, arial, sans-serif;
-	background-color: #fff;
-	margin:0px;
-	text-align:left
-}
-a {
-	color: #616060; 
-	font-family: verdana, arial, sans-serif; 
-	text-decoration: none;
-}
-a:hover {
-	color: #616060;
-	font-family: verdana, arial, sans-serif; 
-	text-decoration: underline;
-}
-.smalltext {
-    background: none;
-	font-family: tahoma, verdana, arial, helvetica, sans-serif;
-	font-size: 9px;
-	font-style: normal;
-	color:#5d6e75;
-}
-.smallblacktext {
-    background: none;
-	font-family: tahoma, verdana, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color:#000;
-}
-.indent{
-	padding: 10px 10px 10px 10px;
-	margin: 5px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #000060;
-	border: 1px solid;
-	background-color: #CCC8C8;
-	border-bottom: #FFFFFF 1px solid;
-	border-left: #000 1px solid;
-	border-right: #FFFFFF 1px solid;
-	border-top: #000 1px solid;
-}
-.defaulttext {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color:#000;
-}
-
-td {
-    background: none;
-	font-family: tahoma, verdana, arial, helvetica, sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color:#5d6e75;
-	padding-bottom: 0px;
-	padding-left: 0px;
-	padding-right: 0px;
-	padding-top: 0px;
-	text-align:left;
-}
-
-blockquote {
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-style: italic;
-	color:#7e96ac;
-}
-.mediumtext {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color:#000;
-}
-.captiontext {
-    background: none;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 18px;
-	color:#000080;
-}
-.tbox{
-	background-color: #F4F7FA;
-	border-bottom: #5e5d63 1px solid;
-	border-left: #5e5d63 1px solid;
-	border-right: #5e5d63 1px solid;
-	border-top: #5e5d63 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-}
-.button{
-	color: #fff;
-	font-family: tahoma, verdana, arial, helvetica, sans-serif;
-	font-size: 10px;
-	text-align:center;
-	background-color: #4F5974;
-	border-bottom: #333A4B 1px solid;
-	border-left: #7180A6 1px solid;
-	border-right: #333A4B 1px solid;
-	border-top: #7180A6 1px solid;
-	letter-spacing: 0.1em;
-	cursor:pointer 
-}
-
-.button a{
-	color: #FFF;
-	}
-.button a:hover{
-	color: #CFCFDF;
-	text-decoration: none;
-	}
-
-.np{
-	background-color: #eaeef2;
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 9px;
-	text-align:center;
-	padding-bottom : 2px;
-	padding-left : 2px;
-	padding-right : 2px;
-	padding-top : 2px;
-}
-
-.nextprev{
-	background-color: #eaeef2;
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	color: #000000;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 9px;
-	text-align:center;
-	padding-bottom : 2px;
-	padding-left : 2px;
-	padding-right : 2px;
-	padding-top : 2px;
-	text-align: right;
-}
-
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding-bottom : 2px;
-	padding-left : 0px;
-	padding-right : 0px;
-	padding-top : 2px;
-}
-hr {
-	border-top: #666 1px solid;
-	border-bottom: #eee 1px solid;
-	height: 2px;
-	width: 92%;
-	text-align:center;
-}
-.border {
-	border: #999 1px solid;
-	background-color: #F0F1F1;
-	padding: 2px;
-}
-
-.border2 {
-	border: #999 1px solid;
-	background-color: #F0F1F1;
-	padding: 2px;
-}
-
-.border3 {
-	border-bottom: #C3D2B4 1px solid;
-	border-left: #fff 1px solid;
-	border-right: #C3D2B4 1px solid;
-	border-top: #fff 1px solid;
-	background-color: transparent;
-}
-
-
-.caption {
-	padding-bottom: 2px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 2px;
-	background-color: #B3BAC5;
-	color: #616060;
-}
-
-.caption2 {
-	padding-bottom: 2px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 2px;
-	background-color: #C9C9C9;
-	color: #616060;
-	font-family: tahoma, verdana, arial, helvetica, sans-serif;
-}
-
-.caption3 {
-	padding-bottom: 0px;
-	padding-left: 4px;
-	padding-right: 4px;
-	padding-top: 0px;
-	border-bottom: #fff 1px solid;
-	border-left: #fff 1px solid;
-	border-right: #fff 1px solid;
-	border-top: #fff 1px solid;
-	background-color: #EEF2EA;
-	color: #000;
-	font-family: tahoma, arial, verdana, helvetica, sans-serif;
-	font-size: 13px;
-}
-
-.bodytable {
-	padding: 2px;
-	background-color: transparent;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color: #000;
-}
-
-.bodytable2 {
-	padding: 4px;
-	background-color: transparent;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-
-.bodytable3 {
-	background-color: transparent;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color: #000;
-}
-
-p {
-	margin-top: 0px
-}
-
-.fborder {
-	border-bottom: #000000 1px solid;
-	border-left: #000000 1px solid;
-	border-right: #000000 1px solid;
-	border-top: #000000 1px solid;
-	background-color: #fff;
-	
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#000;
-	padding: 4px;
-	background-image : url('../e107_images/forum/fcap2.png');
-	border: 1px solid #C3BDBD;
-}
-
-.forumheader2{
-	background-color: #EFEFEF;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader3{
-	background-color: #E3E1E1;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.forumborder{
-	border-bottom: #000080 1px solid;
-	border-left: #000080 1px solid;
-	border-right: #000080 1px solid;
-	border-top: #000080 1px solid;
-	background-color: transparent;
-}
-
-.fcaption {
-	border: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #B3BAC5;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 12px;
-	color:#616060;
-}
-
-.topbar {
-	background-image : url('images/topbar.png');
-}
-.leftbar {
-	background-image : url('images/leftbar.png');
-}
-
-.finfobar{
-	background-color: #CCC8C8;
-	color:#000;
-	padding: 4px;
-	border: 1px solid #C3BDBD;
-	background-image : url('../e107_images/forum/finfobar.png');font-style:normal; font-variant:normal; font-weight:normal; font-size:11px; font-family:verdana, tahoma, arial, helvetica, sans-serif
-}
-
-a.forumlink{
-	color: #616060;
-	text-decoration: underline;
-}
-
-.helpbox {
-	border: 0px none red;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
-
-.alttd9{
-	background-color: #E4E6E6;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-
-.alttd8{
-	background-color: #E4E6E6;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-.thinblackline {
-	background-color: #000;
-	height:1px
-	}
-.thinwhiteline {
-	background-color: #FFF;
-	height:1px
-	}
-.thingreyline {
-	background-color: #B3BAC5;
-	}
\ No newline at end of file
diff -ruN 6171/e107_themes/ranyart/theme.php 75/e107_themes/ranyart/theme.php
--- 6171/e107_themes/ranyart/theme.php	2004-07-12 08:32:08.000000000 -0500
+++ 75/e107_themes/ranyart/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,291 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-$themename = "ranyart";
-$themeversion = "1";
-$themeauthor = "jalist";
-$themedate = "14/09/2003";
-$themeinfo = "To use sectioning with this theme uncomment the relevant code from theme.php.";
-define("STANDARDS_MODE", TRUE);
-// [layout]
-
-$layout = "_default";
-
-$HEADER = "
-<table style='width:100%' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='background-color:#fff'>
-<table style='width:100%'>
-<tr>
-<td style='width:50%; text-align:left'>
-{LOGO}
-</td>
-<td style='width:50%; text-align:right'>
-{BANNER=campaign_one}
-</td>
-</tr>
-</table>
-</td></tr>
-<tr><td class='thinblackline'></td></tr>
-<tr><td class='thinwhiteline'></td></tr>
-<tr><td class='thingreyline'>
-<table style='width:100%'>
-<tr>
-<td style='width:50%; text-align:left'>
-{CUSTOM=login}
-</td>
-<td style='width:50%; text-align:right'>
-{CUSTOM=search}
-</td>
-</tr>
-</table>
-</td></tr>
-<tr>
-<td class='thinblackline'></td>
-</tr>
-</table>
-<table >
-<tr> 
-<td style='padding:10px;width:15%; vertical-align: top;'>
-{SETSTYLE=menu1}
-{SITELINKS=menu}
-{MENU=1}
-<br />
-</td>
-{SETSTYLE=default}
-<td style='padding-top:10px;width:70%; vertical-align: top'>";
-
-/*
-
-// uncomment to use sectioning and listing
-
-$NEWSHEADER = "
-<div style='text-align:center'>
-<table style='width:100%' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='background-color:#fff'>
-<table style='width:100%'>
-<tr>
-<td style='width:50%; text-align:left'>
-{LOGO}
-</td>
-<td style='width:50%; text-align:right'>
-{BANNER=campaign_one}
-</td>
-</tr>
-</table>
-</td></tr>
-<tr><td style='background-color:#000'></td></tr>
-<tr><td style='background-color:#fff'></td></tr>
-<tr><td style='background-color:#B3BAC5'>
-<table style='width:100%'>
-<tr>
-<td style='width:50%; text-align:left'>
-{CUSTOM=login}
-</td>
-<td style='width:50%; text-align:right'>
-{CUSTOM=search}
-</td>
-</tr>
-</table>
-</td></tr>
-<tr>
-<td style='background-color:#000'></td>
-</tr>
-</table>
-<table style='width:100%' cellspacing='10' cellpadding='10'>
-<tr> 
-<td style='width:15%; vertical-align: top;'>
-{SETSTYLE=menu1}
-{SITELINKS=menu}
-{MENU=1}
-<br />
-</td>
-{SETSTYLE=default}
-<td style='width:70%; vertical-align: top'>
-<table style='width:100%'>
-<tr>
-<td style='width:50%; vertical-align:top'>
-{NEWS_CATEGORY=1}
-</td>
-<td style='width:50%; vertical-align:top'>
-{NEWS_CATEGORY=2}
-</td>
-</tr>
-</table>";
-
-$NEWSLISTSTYLE = "
-{NEWSICON}
-<b>
-{NEWSTITLE}
-</b>
-<div class='smalltext'>
-{NEWSAUTHOR}
-on
-{NEWSDATE}
-{NEWSCOMMENTS}
-</div>
-<hr />
-";
-*/
-
-$FOOTER = "
-<br />
-</td>
-<td style='padding:10px;width:15%; vertical-align:top'>
-{SETSTYLE=menu1}
-{MENU=2}
-</td>
-</tr>
-</table>
-<table style='width:100%' cellspacing='0' cellpadding='0'>
-<tr>
-<td class='thinblackline'></td>
-</tr>
-<tr>
-<td class='thinwhiteline'></td>
-</tr>
-<tr>
-<td class='thingreyline' style='text-align:center'>
-{SITEDISCLAIMER}
-<br />
-<img src='".e_IMAGE."generic/php-small-trans-light.gif' alt='' /> <img src='".e_IMAGE."button.png' alt='' /> <img src='".e_IMAGE."generic/poweredbymysql-88.png' alt='' />
-</td>
-</tr>
-<tr>
-<td class='thinblackline'></td>
-</tr>
-</table>
-";
-
-$NEWSSTYLE = "
-<div class='border2'>
-<div class='caption2'>
-{NEWSTITLE}
-</div>
-<div class='bodytable2' style='text-align:left'>
-{NEWSICON}
-{NEWSBODY}
-{EXTENDED}
-</div>
-<div style='text-align:right' class='alttd9'>
-{NEWSAUTHOR}
-on
-{NEWSDATE}
-<br />
-{NEWSCOMMENTS}
-</div>
-</div>
-<br />";
-define("ICONSTYLE", "float: left; border:0");
-define("COMMENTLINK", "Read/Post Comment: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-
-define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
-define("EXTENDEDSTRING", "Read the rest ...");
-define("POST_EXTENDEDSTRING", " ]<br />");
-
-
-// [linkstyle]
-
-define(PRELINK, "");
-define(POSTLINK, "");
-define(LINKSTART, "<img src='".THEME."images/bullet2.gif' alt='bullet' /> ");
-define(LINKEND, "<br />");
-define(LINKDISPLAY, 2);			// 1 - along top, 2 - in left or right column
-define(LINKALIGN, "left");
-
-
-//	[tablestyle]
-
-function tablestyle($caption, $text){
-	global $style;
-	if($style == "menu1" || !$style){
-		if($caption != ""){
-			echo "<div class='border'><div class='caption'>".$caption."</div>";
-			if($text != ""){
-				echo "\n<div class='bodytable'>".$text."</div></div><br />";
-			}
-		}else{
-			echo "<div class='border2'><div class='bodytable2'>".$text."</div></div><br />";
-		}
-	}else if($style == "default"){
-		if($caption != ""){
-			echo "<div class='border2'><div class='caption2'>".$caption."</div><div class='bodytable2'>".$text."</div></div><br />";
-		}else{
-			echo "<div class='bodytable'>".$text."</div><br />";
-		}
-	}else{
-		if($caption != ""){
-			echo "<div class='border3'><div class='caption3'>".$caption."</div></div><div class='bodytable3'>".$text."</div><br />";
-		}else{
-			echo "<div class='bodytable3'>".$text."</div><br />";
-		}
-	}
-}
-
-$COMMENTSTYLE = "
-<table style='width:100%'>
-<tr>
-<td colspan='2' class='forumheader3'>
-{SUBJECT}
-<b>
-{USERNAME}
-</b>
-|
-{TIMEDATE}
-</td>
-</tr>
-<tr>
-<td style='width:30%; vertical-align:top'>
-<div class='spacer'>
-{AVATAR}
-</div>
-<span class='smalltext'>
-{COMMENTS}
-<br />
-{JOINED}
-</span>
-<br/>
-{REPLY}
-</td>
-<td style='width:70%; vertical-align:top'>
-{COMMENT}
-</td>
-</tr>
-</table>
-<br />";
-
-$POLLSTYLE = <<< EOF
-<b>Poll:</b> {QUESTION}
-<br /><br />
-{OPTIONS=<div class='alttd8'>OPTION</div>BAR<br /><span class='smalltext'>PERCENTAGE VOTES</span><br />\n}
-<br /><div style='text-align:center' class='smalltext'>{AUTHOR}<br />{VOTE_TOTAL} {COMMENTS}
-<br />
-{OLDPOLLS}
-</div>
-EOF;
-
-$CHATBOXSTYLE = "
-<div class='alttd9'>
-<img src='".THEME."images/bullet2.gif' alt='bullet' />
-<b>{USERNAME}</b><br />{TIMEDATE}
-</div>
-<div class='smalltext'>
-{MESSAGE}
-</div>
-<br />";
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_themes/reline/admin_style.css 75/e107_themes/reline/admin_style.css
--- 6171/e107_themes/reline/admin_style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/reline/admin_style.css	2006-04-29 01:00:37.000000000 -0500
@@ -0,0 +1,517 @@
+/* Core Classes */
+/*----------------------------------------------------------------------------*/
+
+body {
+	background-color: #fff;
+}
+
+body, td {
+	margin: 0px;
+	padding: 0px;
+	text-align: left;
+	color: #000;
+}
+
+body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext,
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar {
+	font: normal 11px  arial, verdana, tahoma, sans-serif;
+}
+
+.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox {
+	font: normal 10px  arial, verdana, tahoma, arial, sans-serif;
+}
+
+a {
+	color: #1A4487;
+}
+
+a:hover {
+	color: #000;
+}
+
+img {	
+	border: 0px;
+}
+
+form {
+	margin: 0px;
+}
+
+table {
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.tbox {
+	border: #777 1px solid;
+}
+
+.indent {
+	border: #999 1px dashed;
+	padding: 5px;
+	margin: 5px;
+	background-color: #f7f7f9;
+}
+
+.button {
+	border: 1px solid #A5ACB2;
+	background-image : url(images/button.png);
+}
+
+.button:hover {
+	background-image : url(images/buttonover.png);
+}
+
+.nextprev {
+	border: 0px;
+	text-align: center;
+	padding: 2px;
+	background-color: #f7f7f9;
+}
+
+.spacer{
+	padding: 5px 0px;
+}
+
+.fborder, .border{
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar {
+	padding: 5px;
+	background-color: #fff;
+	border-bottom: 1px solid #bbb;
+}
+
+.forumheader, .forumheader4, .finfobar {
+	background-color: #fbfbfd;
+}
+
+.forumheader5 {
+	cursor: pointer;
+}
+
+.fcaption, .forumheader5 {
+	background-color: #f7f7f7;
+}
+
+.searchhighlight {
+	text-decoration: underline;
+	color: #ff0000;
+	font-weight: bold;
+}
+
+.helpbox {
+	border: 0px;
+}
+
+.news_image {
+	float: right;
+	padding: 0px 0px 7px 7px;
+}
+
+.logo {
+	 display: block;
+}
+ 
+
+/* Theme Specific Classes */
+/*----------------------------------------------------------------------------*/
+
+.container {
+	width: 100%;
+	border-collapse: collapse;
+	border-spacing: 0px;
+	border-bottom: 1px solid #126CA3;
+}
+
+.top_section {
+	background-image: url(images/header.jpg);
+	background-repeat: no-repeat;
+	background-position: top left;
+}
+
+.left_section {
+	vertical-align: top;
+	width: 160px;
+	border-right: 1px solid #126CA3;
+	background-color: #CCDCF9;
+}
+
+.top_bar {
+	background-color: #126CA3;
+	text-align: right;
+	padding-right: 5px;
+	width: 100%;
+	height: 23px;
+}
+
+.main_container {
+	vertical-align: top;
+}
+
+.top_inner_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	margin-bottom: 10px;
+	width: 100%;
+}
+
+.bottom_inner_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	margin-bottom: 12px;
+	width: 100%;
+}
+
+.right_section {
+	border-left: 1px solid #126CA3;
+	text-align: center;
+	vertical-align: top;
+	width: 160px;
+}
+
+.main_nav {
+	vertical-align: top;
+}
+
+.main_section {
+	vertical-align: top;
+	padding: 10px;
+}
+
+.main_caption, .menu_caption {
+	font-weight: bold;
+	color: #0B4366;
+	margin-bottom: 7px;
+}
+
+.main_caption {
+	font-size: 13px;
+}
+
+.tablerender {
+	margin-bottom: 12px;
+}
+
+.top_left_menu_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	width: 100%;
+}
+
+.top_left_menu {
+	background-color: #126CA3;
+	font-weight: bold;
+	padding: 12px 7px;
+	color: #fff;
+}
+
+.top_left_menu a {
+	color: #fff;
+}
+
+.top_left_menu a:hover {
+	color: #ddd;
+}
+
+.top_left_menu_caption {
+	font-size: 12px;
+	padding-bottom: 10px;
+}
+
+.bottom_left_menu_area {
+	vertical-align: top;
+	padding-bottom: 10px;
+}
+
+.menu_caption {
+	border-bottom: 1px solid #222;
+	font-size: 12px;
+}
+
+.menu_container {
+	width: 160px;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.menu_inner_container {
+	padding: 10px 7px;
+}
+
+.disclaimer {
+	text-align: center;
+	width: 100%;
+	padding: 12px 0px;
+}
+
+
+.menuButton_menu {
+	margin: 0px;
+	padding: 2px 4px 2px 4px;
+	text-decoration: none;
+	cursor: pointer;
+}
+
+.menuButton_menu_over {
+	margin: 0px;
+	padding: 2px 4px 2px 4px;
+	text-decoration: none;
+	background-color: #efefef;
+	cursor: pointer;
+}
+
+
+/* Theme Specific Classes: News Style */
+
+.news_info_top {
+	padding: 2px;
+}
+
+.news_info_bottom {
+	width: 100%;
+	background-color: #f7f7f9;
+	border-collapse: collapse;
+	border-spacing: 0px;
+	margin-bottom: 12px;
+}
+
+.news_info_bottom_left {
+	padding: 2px;
+}
+
+.news_info_bottom_middle {
+	padding: 2px;
+	width: 100%;
+}
+
+.news_info_bottom_right {
+	padding: 2px;
+	white-space: nowrap
+}
+
+.news_comments_icon {
+	width: 16px;
+	height: 16px;
+	vertical-align: middle;
+}
+
+
+/* Theme Specific Classes: Cube Logo Graphic */
+
+.cube_container {
+	position: relative;
+	left: 0;
+	top: 0;
+}
+
+.cube_image {
+	position: absolute;
+	top: -76px;
+	left: -49px;
+	width: 96px;
+	height: 108px;
+	display: block;
+}
+
+
+/* Theme Specific Classes: Advanced Content Management Graphic */
+
+.advanced_image {
+	width: 145px;
+	height: 90px;
+	display: block;
+	margin-left: 14px;
+}
+
+
+/* Theme Specific Classes: Paperclipped Notes Menu */
+
+.paperclip_container {
+	text-align: center;
+	width: 160px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.paperclip_inner_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	width: 130px;
+	height: 175px;
+}
+
+.paperclip_caption {
+	padding: 6px 0px;
+	text-align: right;
+}
+
+.paperclip {
+	font-weight: bold;
+	font-size: 12px;
+	padding: 34px 20px 0px 20px;
+	text-align: left;
+	background-image: url(images/paperclip.png);
+	background-repeat: no-repeat;
+	background-position: top center;
+	margin-bottom: 5px;
+	vertical-align: top;
+}
+
+
+/* Theme Specific Classes: Post It Note Menu */
+
+.post_it_container {
+	text-align: center;
+	margin-bottom: 9px;
+	margin-top: 7px;
+	width: 160px;
+	margin-left: auto;
+	margin-right: auto;
+	font-weight: bold;
+	font-size: 12px;
+}
+
+.post_it_top {
+	background-image: url(images/post_it_top.png);
+	background-repeat: no-repeat;
+	background-position: top center;
+}
+
+.post_it_back {
+	text-align: left;
+	background-image: url(images/post_it_middle.png);
+	background-repeat: repeat-y;
+	background-position: center;
+	width: 120px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.post_it_bottom {
+	background-image: url(images/post_it_bottom.png);
+	background-repeat: no-repeat;
+	background-position: bottom center;
+	padding: 12px 7px;
+}
+
+.post_it_caption {
+	padding-bottom: 5px;
+}
+
+
+/* Theme Specific Classes: Admin Area Header */
+
+.admin_header {
+	width: 100%;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.admin_header_right {
+	text-align: right;
+	padding: 0px 12px;
+}
+
+
+/* Brainjar Nav Menu Classes {SITELINS_ALT} */
+/*
+If you do not use {SITELINS_ALT} and switch to the standard {SITELINKS} instead, 
+all of the below can be deleted.
+*/
+/*----------------------------------------------------------------------------*/
+
+div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem {
+	font: normal 11px arial, verdana, tahoma, sans-serif;
+	color: #000;
+}
+
+div.menuBar {
+	background-color: #F7F9FA;
+	background-image: url(images/s_nav.png);
+	background-repeat: repeat-x;
+	border-top: 1px solid #fff;
+	padding: 4px 0px 4px 47px;
+	text-align: left;
+}
+
+div.emenuBar {
+	background-color: #F7F9FA;
+	border-top: 1px solid #fff;
+	text-align: left;
+}
+
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over {
+	background-color: transparent;
+	border: 1px solid;
+	border-color: transparent !important;
+	border-color: #fff #F8FAFB #F0F2F3 #F8FAFB;
+	cursor: default;
+	left: 0px;
+	margin: 0px;
+	padding: 2px 4px 2px 22px;
+	position: relative;
+	text-decoration: none;
+	top: 0px;
+	z-index: 100;
+}
+
+div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over {
+	background-color: transparent;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff !important;
+}
+
+div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover {
+	background-color: #fff;
+	border-color: #a5a5a5 #fff #fff #a5a5a5 !important;
+	left: 1px;
+	top: 1px;
+}
+
+div.menu {
+	background-color: #FCFDFF;
+	border: 1px solid;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff;
+	left: 0px;
+	padding: 1px;
+	position: absolute;
+	top: 0px;
+	visibility: hidden;
+	z-index: 101;
+}
+
+div.menu a.menuItem {
+	cursor: default;
+	display: block;
+	padding: 2px 11px 2px 0px;
+	text-decoration: none;
+	white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+	background-color: #F2F4FF;
+}
+
+div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer {
+	padding: 0px 2px;
+}
+
+div.menu a.menuItem span.menuItemText {
+	padding: 0px 0px 0px 3px;
+}
+
+div.menu a.menuItem span.menuItemArrow {
+	margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+	border-top: 1px solid #a5a5a5;
+	border-bottom: 1px solid #fff;
+	margin: 4px 2px;
+}
+
+a.menuItem.header {
+	border-bottom: 1px solid #b3b3b3;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/reline/admin_template.php 75/e107_themes/reline/admin_template.php
--- 6171/e107_themes/reline/admin_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/reline/admin_template.php	2006-04-29 01:00:37.000000000 -0500
@@ -0,0 +1,178 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/reline/admin_template.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2006/04/29 06:00:37 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [prerenders]
+
+$style = "bottom_left_menu";
+$prehelp = $tp -> parseTemplate('{ADMIN_HELP}');
+
+$style = "right_menu";
+$pre_admin_menu = $tp -> parseTemplate('{ADMIN_MENU=pre}');
+$preright = $tp -> parseTemplate('{ADMIN_STATUS=request}');
+$preright .= $tp -> parseTemplate('{ADMIN_LATEST=request}');
+$preright .= $tp -> parseTemplate('{ADMIN_PRESET}');
+$preright .= $tp -> parseTemplate('{ADMIN_LOG=request}');
+$style = "default";
+
+// [layout]
+
+$ADMIN_HEADER = "<table class='container'>
+<tr>
+<td>
+<img class='advanced_image' src='".e_IMAGE."advanced.png' alt='' />
+</td>
+
+<td class='top_section'>
+
+<table class='admin_header'>
+<tr>
+<td class='admin_header_left'>
+{ADMIN_LOGO}
+</td>
+
+<td class='admin_header_right'>
+{ADMIN_ICON}
+<br />
+{ADMIN_SEL_LAN}
+{ADMIN_USERLAN}
+</td>
+</tr>
+</table>
+
+</td>
+</tr>
+
+<tr>
+<td class='left_section'>
+
+<table class='top_left_menu_container'><tr><td>
+{SETSTYLE=top_left_menu}
+{PLUGIN=login_menu}
+</td></tr>
+
+<tr><td class='bottom_left_menu_area'>
+{SETSTYLE=bottom_left_menu}
+{ADMIN_LANG}
+{ADMIN_PWORD}
+{ADMIN_MSG}
+{ADMIN_PLUGINS}";
+
+if ($prehelp!='') {
+	$ADMIN_HEADER .= $prehelp;
+} else {
+	$ADMIN_HEADER .= "{ADMIN_SITEINFO}";
+}
+
+$ADMIN_HEADER .= "</td></tr></table>
+
+</td>
+
+<td class='main_container' colspan='2'>
+
+<table class='top_inner_container'>
+<tr>
+<td class='top_bar'>
+{SEARCH}
+</td>
+</tr>
+
+<tr>
+<td class='main_nav'>
+
+<div class='cube_container'>
+<img class='cube_image' src='".THEME_ABS."images/cube.png' alt='' />
+</div>";
+
+if (ADMIN) {
+	$ADMIN_HEADER .= "{ADMIN_ALT_NAV=exit=off}";
+} else {
+	$ADMIN_HEADER .= "<br />";
+}
+
+$ADMIN_HEADER .= "</td>
+</tr>
+</table>
+
+{SETSTYLE=default}
+
+<table class='bottom_inner_container'>
+<tr>
+<td class='main_section'>";
+
+
+
+
+$ADMIN_FOOTER = "</td>";
+
+if ($pre_admin_menu || $preright) {
+	$ADMIN_FOOTER .= "<td class='right_section'>
+	{SETSTYLE=right_menu}
+	{ADMIN_MENU}
+	".$preright."
+	</td>";
+}
+
+$ADMIN_FOOTER .= "</tr>
+</table>
+
+</td>
+</tr>
+</table>
+
+<div class='disclaimer'>
+{SITELINKS=flat}
+<br />
+{SITEDISCLAIMER}
+<br /><br />
+{ADMIN_CREDITS}
+</div>";
+
+
+// [admin button style]
+
+$BUTTONS_START = "<table class='fborder' style='width: 100%'>";
+
+$BUTTON = "<tr><td><div>
+<div class='menuButton_menu' onmouseover=\"eover(this, 'menuButton_menu_over')\" onmouseout=\"eover(this, 'menuButton_menu')\" {ONCLICK} 
+style='width: 98% !important; width: 100%; padding: 0px 0px 0px 2px; border-right: 0px'>
+<img src='".E_16_NAV_ARROW."' style='width: 16px; height: 16px; vertical-align: middle' alt='' />&nbsp;{LINK_TEXT}</div></div></td></tr>";
+
+$BUTTON_OVER = "<tr><td><div>
+<div class='menuButton_menu' onmouseover=\"eover(this, 'menuButton_menu_over')\" onmouseout=\"eover(this, 'menuButton_menu')\" {ONCLICK} 
+style='width: 98% !important; width: 100%; padding: 0px 0px 0px 2px; border-right: 0px'>
+<img src='".E_16_NAV_ARROW_OVER."' style='width: 16px; height: 16px; vertical-align: middle' alt='' />&nbsp;{LINK_TEXT}</div></div></td></tr>";
+
+$BUTTONS_END = "</table>";
+
+$SUB_BUTTONS_START = "<table class='fborder' style='width:100%;'>
+<tr><td><div>
+<div class='menuButton_menu' onmouseover=\"eover(this, 'menuButton_over')\" onmouseout=\"eover(this, 'menuButton')\" onclick=\"expandit('{SUB_HEAD_ID}');\" 
+style='width: 98% !important; width: 100%; padding: 0px 0px 0px 2px; border-right: 0px'>
+<img src='".E_16_NAV_ARROW."' style='width: 16px; height: 16px; vertical-align: middle' alt='' />&nbsp;{SUB_HEAD}</div></div></td></tr>
+<tr id='{SUB_HEAD_ID}' style='display: none' ><td class='forumheader3' style='text-align:left;'>";
+
+$SUB_BUTTON = "<a style='text-decoration:none;' href='{LINK_URL}'>{LINK_TEXT}</a><br />";
+
+$SUB_BUTTON_OVER = "<b> &laquo; <a style='text-decoration:none;' href='{LINK_URL}'>{LINK_TEXT}</a> &raquo; </b><br />";
+
+$SUB_BUTTONS_END = "</td></tr></table>";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/reline/cube.sc 75/e107_themes/reline/cube.sc
--- 6171/e107_themes/reline/cube.sc	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/reline/cube.sc	2006-04-26 08:06:17.000000000 -0500
@@ -0,0 +1,13 @@
+parse_str($parm);
+$top = isset($top) ? $top : '-76px';
+$left = isset($left) ? $left : '-49px';
+
+return "<div style='position: relative; left: 0; top: 0'>
+<img src='".THEME_ABS."images/cube.png' style='position: absolute; top: ".$top."; left: ".$left."; width: 96px; height: 108px; display: block' alt='' />
+</div>";
+
+// {CUBE=top=-76px&left=-49px}
+// Register custom theme shortcodes
+
+// $register_sc[] = 'CUBE'; // use as {CUBE} in your templates (e107_themes/your_theme/cube.sc)
+
diff -ruN 6171/e107_themes/reline/full_width.css 75/e107_themes/reline/full_width.css
--- 6171/e107_themes/reline/full_width.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/reline/full_width.css	2006-04-29 01:29:37.000000000 -0500
@@ -0,0 +1,490 @@
+/* Non-Admin Area Stylesheet */
+/* info: Reline in full screen mode */
+
+/* Core Classes */
+/*----------------------------------------------------------------------------*/
+
+body {
+	background-color: #fff;
+}
+
+body, td {
+	margin: 0px;
+	padding: 0px;
+	text-align: left;
+	color: #000;
+}
+
+body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext,
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar {
+	font: normal 11px  arial, verdana, tahoma, sans-serif;
+}
+
+.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox {
+	font: normal 10px  arial, verdana, tahoma, arial, sans-serif;
+}
+
+a {
+	color: #1A4487;
+}
+
+a:hover {
+	color: #000;
+}
+
+img {	
+	border: 0px;
+}
+
+form {
+	margin: 0px;
+}
+
+table {
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.tbox {
+	border: #777 1px solid;
+}
+
+.indent {
+	border: #999 1px dashed;
+	padding: 5px;
+	margin: 5px;
+	background-color: #f7f7f9;
+}
+
+.button {
+	border: 1px solid #A5ACB2;
+	background-image : url(images/button.png);
+}
+
+.button:hover {
+	background-image : url(images/buttonover.png);
+}
+
+.nextprev {
+	border: 0px;
+	text-align: center;
+	padding: 2px;
+	background-color: #f7f7f9;
+}
+
+.spacer{
+	padding: 5px 0px;
+}
+
+.fborder, .border{
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar {
+	padding: 5px;
+	background-color: #fff;
+	border-bottom: 1px solid #bbb;
+}
+
+.forumheader, .forumheader4, .finfobar {
+	background-color: #fbfbfd;
+}
+
+.forumheader5 {
+	cursor: pointer;
+}
+
+.fcaption, .forumheader5 {
+	background-color: #f7f7f7;
+}
+
+.searchhighlight {
+	text-decoration: underline;
+	color: #ff0000;
+	font-weight: bold;
+}
+
+.helpbox {
+	border: 0px;
+}
+
+.news_image {
+	float: right;
+	padding: 0px 0px 7px 7px;
+}
+
+.logo {
+	 display: block;
+}
+ 
+
+/* Theme Specific Classes */
+/*----------------------------------------------------------------------------*/
+
+.container {
+	width: 100%;
+	border-collapse: collapse;
+	border-spacing: 0px;
+	border-bottom: 1px solid #126CA3;
+}
+
+.top_section {
+	background-image: url(images/header.jpg);
+	background-repeat: no-repeat;
+	background-position: top left;
+}
+
+.left_section {
+	vertical-align: top;
+	width: 160px;
+	border-right: 1px solid #126CA3;
+	background-color: #CCDCF9;
+}
+
+.top_bar {
+	background-color: #126CA3;
+	text-align: right;
+	padding-right: 5px;
+	width: 100%;
+	height: 23px;
+}
+
+.main_container {
+	vertical-align: top;
+}
+
+.top_inner_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	margin-bottom: 10px;
+	width: 100%;
+}
+
+.bottom_inner_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	margin-bottom: 12px;
+	width: 100%;
+}
+
+.right_section {
+	border-left: 1px solid #126CA3;
+	text-align: center;
+	vertical-align: top;
+	width: 160px;
+}
+
+.main_nav {
+	padding-right: 5px;
+	vertical-align: top;
+}
+
+.main_section {
+	vertical-align: top;
+	padding: 10px;
+}
+
+.main_caption, .menu_caption {
+	font-weight: bold;
+	color: #0B4366;
+	margin-bottom: 7px;
+}
+
+.main_caption {
+	font-size: 13px;
+}
+
+.tablerender {
+	margin-bottom: 12px;
+}
+
+.top_left_menu_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	width: 100%;
+}
+
+.top_left_menu {
+	background-color: #126CA3;
+	font-weight: bold;
+	padding: 12px 7px;
+	color: #fff;
+}
+
+.top_left_menu a {
+	color: #fff;
+}
+
+.top_left_menu a:hover {
+	color: #ddd;
+}
+
+.top_left_menu_caption {
+	font-size: 12px;
+	padding-bottom: 10px;
+}
+
+.bottom_left_menu_area {
+	vertical-align: top;
+	padding-bottom: 10px;
+}
+
+.menu_caption {
+	border-bottom: 1px solid #222;
+	font-size: 12px;
+}
+
+.menu_container {
+	width: 160px;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.menu_inner_container {
+	padding: 10px 7px;
+}
+
+.disclaimer {
+	text-align: center;
+	width: 100%;
+	padding: 12px 0px;
+}
+
+
+/* Theme Specific Classes: News Style */
+
+.news_info_top {
+	padding: 2px;
+}
+
+.news_info_bottom {
+	width: 100%;
+	background-color: #f7f7f9;
+	border-collapse: collapse;
+	border-spacing: 0px;
+	margin-bottom: 12px;
+}
+
+.news_info_bottom_left {
+	padding: 2px;
+}
+
+.news_info_bottom_middle {
+	padding: 2px;
+	width: 100%;
+}
+
+.news_info_bottom_right {
+	padding: 2px;
+	white-space: nowrap
+}
+
+.news_comments_icon {
+	width: 16px;
+	height: 16px;
+	vertical-align: middle;
+}
+
+
+/* Theme Specific Classes: Cube Logo Graphic */
+
+.cube_container {
+	position: relative;
+	left: 0;
+	top: 0;
+}
+
+.cube_image {
+	position: absolute;
+	top: -76px;
+	left: -49px;
+	width: 96px;
+	height: 108px;
+	display: block;
+}
+
+
+/* Theme Specific Classes: Advanced Content Management Graphic */
+
+.advanced_image {
+	width: 145px;
+	height: 90px;
+	display: block;
+	margin-left: 14px;
+}
+
+
+/* Theme Specific Classes: Paperclipped Notes Menu */
+
+.paperclip_container {
+	text-align: center;
+	width: 160px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.paperclip_inner_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	width: 130px;
+	height: 175px;
+}
+
+.paperclip_caption {
+	padding: 6px 0px;
+	text-align: right;
+}
+
+.paperclip {
+	font-weight: bold;
+	font-size: 12px;
+	padding: 34px 20px 0px 20px;
+	text-align: left;
+	background-image: url(images/paperclip.png);
+	background-repeat: no-repeat;
+	background-position: top center;
+	margin-bottom: 5px;
+	vertical-align: top;
+}
+
+
+/* Theme Specific Classes: Post It Note Menu */
+
+.post_it_container {
+	text-align: center;
+	margin-bottom: 9px;
+	margin-top: 7px;
+	width: 160px;
+	margin-left: auto;
+	margin-right: auto;
+	font-weight: bold;
+	font-size: 12px;
+}
+
+.post_it_top {
+	background-image: url(images/post_it_top.png);
+	background-repeat: no-repeat;
+	background-position: top center;
+}
+
+.post_it_back {
+	text-align: left;
+	background-image: url(images/post_it_middle.png);
+	background-repeat: repeat-y;
+	background-position: center;
+	width: 120px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.post_it_bottom {
+	background-image: url(images/post_it_bottom.png);
+	background-repeat: no-repeat;
+	background-position: bottom center;
+	padding: 12px 7px;
+}
+
+.post_it_caption {
+	padding-bottom: 5px;
+}
+
+
+/* Brainjar Nav Menu Classes {SITELINS_ALT} */
+/*
+If you do not use {SITELINS_ALT} and switch to the standard {SITELINKS} instead, 
+all of the below can be deleted.
+*/
+/*----------------------------------------------------------------------------*/
+
+div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem {
+	font: bold 12px arial, verdana, arial, tahoma, sans-serif;
+	color: #126CA3;
+	text-align: left;
+}
+
+div.menuBar {
+	background-color: #fff;
+	border-top: 1px solid #fff;
+	padding: 4px 0px;
+	text-align: right;
+}
+
+div.emenuBar {
+	background-color: #F7F9FA;
+	border-top: 1px solid #fff;
+	text-align: left;
+}
+
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over {
+	background-color: transparent;
+	border: 1px solid;
+	border-color: transparent !important;
+	border-color: #fff #fff #fff #fff;
+	left: 0px;
+	margin: 0px;
+	padding: 2px 6px 2px 6px;
+	position: relative;
+	text-decoration: none;
+	top: 0px;
+	z-index: 100;
+}
+
+div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over {
+	background-color: #126CA3;
+	border-color: #fff #fff #fff #fff !important;
+	color: #fff;
+}
+
+div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover {
+	background-color: #126CA3;
+	border-color: #fff #fff #fff #fff !important;
+	left: 1px;
+	top: 1px;
+	color: #fff;
+}
+
+div.menu {
+	background-color: #FCFDFF;
+	border: 1px solid;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff;
+	left: 0px;
+	padding: 1px;
+	position: absolute;
+	top: 0px;
+	visibility: hidden;
+	z-index: 101;
+}
+
+div.menu a.menuItem {
+	display: block;
+	padding: 2px 11px 2px 0px;
+	text-decoration: none;
+	white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+	background-color: #F2F4FF;
+}
+
+div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer {
+	padding: 0px 2px;
+}
+
+div.menu a.menuItem span.menuItemText {
+	padding: 0px 0px 0px 3px;
+}
+
+div.menu a.menuItem span.menuItemArrow {
+	margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+	border-top: 1px solid #a5a5a5;
+	border-bottom: 1px solid #fff;
+	margin: 4px 2px;
+}
+
+a.menuItem.header {
+	border-bottom: 1px solid #b3b3b3;
+}
\ No newline at end of file
Files 6171/e107_themes/reline/images/arrow.png and 75/e107_themes/reline/images/arrow.png differ
Files 6171/e107_themes/reline/images/bar.jpg and 75/e107_themes/reline/images/bar.jpg differ
Files 6171/e107_themes/reline/images/blank.gif and 75/e107_themes/reline/images/blank.gif differ
Files 6171/e107_themes/reline/images/bullet2.gif and 75/e107_themes/reline/images/bullet2.gif differ
Files 6171/e107_themes/reline/images/buttonover.png and 75/e107_themes/reline/images/buttonover.png differ
Files 6171/e107_themes/reline/images/button.png and 75/e107_themes/reline/images/button.png differ
Files 6171/e107_themes/reline/images/comments_16.png and 75/e107_themes/reline/images/comments_16.png differ
Files 6171/e107_themes/reline/images/cube.png and 75/e107_themes/reline/images/cube.png differ
Files 6171/e107_themes/reline/images/e_adminlogo.png and 75/e107_themes/reline/images/e_adminlogo.png differ
Files 6171/e107_themes/reline/images/e_logo.png and 75/e107_themes/reline/images/e_logo.png differ
Files 6171/e107_themes/reline/images/email_16.png and 75/e107_themes/reline/images/email_16.png differ
Files 6171/e107_themes/reline/images/header.jpg and 75/e107_themes/reline/images/header.jpg differ
Files 6171/e107_themes/reline/images/header.png and 75/e107_themes/reline/images/header.png differ
Files 6171/e107_themes/reline/images/loggedin.png and 75/e107_themes/reline/images/loggedin.png differ
Files 6171/e107_themes/reline/images/logo.png and 75/e107_themes/reline/images/logo.png differ
Files 6171/e107_themes/reline/images/paperclip.png and 75/e107_themes/reline/images/paperclip.png differ
Files 6171/e107_themes/reline/images/polls.png and 75/e107_themes/reline/images/polls.png differ
Files 6171/e107_themes/reline/images/postedby_16.png and 75/e107_themes/reline/images/postedby_16.png differ
Files 6171/e107_themes/reline/images/post_it_bottom.png and 75/e107_themes/reline/images/post_it_bottom.png differ
Files 6171/e107_themes/reline/images/post_it_middle.png and 75/e107_themes/reline/images/post_it_middle.png differ
Files 6171/e107_themes/reline/images/post_it_top.png and 75/e107_themes/reline/images/post_it_top.png differ
Files 6171/e107_themes/reline/images/print_16.png and 75/e107_themes/reline/images/print_16.png differ
Files 6171/e107_themes/reline/images/search.png and 75/e107_themes/reline/images/search.png differ
Files 6171/e107_themes/reline/images/s_nav.png and 75/e107_themes/reline/images/s_nav.png differ
diff -ruN 6171/e107_themes/reline/languages/English.php 75/e107_themes/reline/languages/English.php
--- 6171/e107_themes/reline/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/reline/languages/English.php	2006-04-24 14:02:07.000000000 -0500
@@ -0,0 +1,29 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/reline/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2006/04/24 19:02:07 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "Comments are turned off for this item");
+define("LAN_THEME_2", "Read/Post Comment: ");
+define("LAN_THEME_3", "Read the rest...");
+define("LAN_THEME_4", "Trackbacks: ");
+define("LAN_THEME_5", "Posted by");
+define("LAN_THEME_6", "on");
+define("LAN_THEME_7", "Search...");
+
+
+?>
Files 6171/e107_themes/reline/preview.jpg and 75/e107_themes/reline/preview.jpg differ
diff -ruN 6171/e107_themes/reline/style.css 75/e107_themes/reline/style.css
--- 6171/e107_themes/reline/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/reline/style.css	2006-04-29 03:18:14.000000000 -0500
@@ -0,0 +1,489 @@
+/* Core Classes */
+/*----------------------------------------------------------------------------*/
+
+body {
+	background-color: #fff;
+}
+
+body, td {
+	margin: 0px;
+	padding: 0px;
+	text-align: left;
+	color: #000;
+}
+
+body, td, .indent, .defaulttext, .caption, .captiontext, .bodytable, .mediumtext,
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .forumheader5, .fcaption, .finfobar {
+	font: normal 11px  arial, verdana, tahoma, sans-serif;
+}
+
+.smalltext, .smallblacktext, .tbox, .button, .button:hover, .nextprev, .helpbox {
+	font: normal 10px  arial, verdana, tahoma, arial, sans-serif;
+}
+
+a {
+	color: #1A4487;
+}
+
+a:hover {
+	color: #000;
+}
+
+img {	
+	border: 0px;
+}
+
+form {
+	margin: 0px;
+}
+
+table {
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.tbox {
+	border: #777 1px solid;
+}
+
+.indent {
+	border: #999 1px dashed;
+	padding: 5px;
+	margin: 5px;
+	background-color: #f7f7f9;
+}
+
+.button {
+	border: 1px solid #A5ACB2;
+	background-image : url(images/button.png);
+}
+
+.button:hover {
+	background-image : url(images/buttonover.png);
+}
+
+.nextprev {
+	border: 0px;
+	text-align: center;
+	padding: 2px;
+	background-color: #f7f7f9;
+}
+
+.spacer{
+	padding: 5px 0px;
+}
+
+.fborder, .border{
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.forumheader, .forumheader2, .forumheader3, .forumheader4, .fcaption, .finfobar {
+	padding: 5px;
+	background-color: #fff;
+	border-bottom: 1px solid #bbb;
+}
+
+.forumheader, .forumheader4, .finfobar {
+	background-color: #fbfbfd;
+}
+
+.forumheader5 {
+	cursor: pointer;
+}
+
+.fcaption, .forumheader5 {
+	background-color: #f7f7f7;
+}
+
+.searchhighlight {
+	text-decoration: underline;
+	color: #ff0000;
+	font-weight: bold;
+}
+
+.helpbox {
+	border: 0px;
+}
+
+.news_image {
+	float: right;
+	padding: 0px 0px 7px 7px;
+}
+
+.logo {
+	 display: block;
+}
+ 
+
+/* Theme Specific Classes */
+/*----------------------------------------------------------------------------*/
+
+.container {
+	width: 755px;
+	border-collapse: collapse;
+	border-spacing: 0px;
+	border-right: 1px solid #126CA3;
+	border-bottom: 1px solid #126CA3;
+	margin-left: 0px;
+}
+
+.top_section {
+	background-image: url(images/header.jpg);
+	background-repeat: no-repeat;
+	background-position: top left;
+}
+
+.left_section {
+	vertical-align: top;
+	width: 160px;
+	border-right: 1px solid #126CA3;
+	background-color: #CCDCF9;
+}
+
+.top_bar {
+	background-color: #126CA3;
+	text-align: right;
+	padding-right: 5px;
+	width: 100%;
+	height: 23px;
+}
+
+.main_container {
+	vertical-align: top;
+}
+
+.top_inner_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	margin-bottom: 10px;
+	width: 100%;
+}
+
+.bottom_inner_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	margin-bottom: 12px;
+	width: 100%;
+}
+
+.right_section {
+	border-left: 1px solid #126CA3;
+	text-align: center;
+	vertical-align: top;
+	width: 160px;
+}
+
+.main_nav {
+	padding-right: 5px;
+	vertical-align: top;
+}
+
+.main_section {
+	vertical-align: top;
+	padding: 10px;
+}
+
+.main_caption, .menu_caption {
+	font-weight: bold;
+	color: #0B4366;
+	margin-bottom: 7px;
+}
+
+.main_caption {
+	font-size: 13px;
+}
+
+.tablerender {
+	margin-bottom: 12px;
+}
+
+.top_left_menu_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	width: 100%;
+}
+
+.top_left_menu {
+	background-color: #126CA3;
+	font-weight: bold;
+	padding: 12px 7px;
+	color: #fff;
+}
+
+.top_left_menu a {
+	color: #fff;
+}
+
+.top_left_menu a:hover {
+	color: #ddd;
+}
+
+.top_left_menu_caption {
+	font-size: 12px;
+	padding-bottom: 10px;
+}
+
+.bottom_left_menu_area {
+	vertical-align: top;
+	padding-bottom: 10px;
+}
+
+.menu_caption {
+	border-bottom: 1px solid #222;
+	font-size: 12px;
+}
+
+.menu_container {
+	width: 160px;
+	border-collapse: collapse;
+	border-spacing: 0px;
+}
+
+.menu_inner_container {
+	padding: 10px 7px;
+}
+
+.disclaimer {
+	text-align: center;
+	width: 755px;
+	padding: 12px 0px;
+}
+
+
+/* Theme Specific Classes: News Style */
+
+.news_info_top {
+	padding: 2px;
+}
+
+.news_info_bottom {
+	width: 100%;
+	background-color: #f7f7f9;
+	border-collapse: collapse;
+	border-spacing: 0px;
+	margin-bottom: 12px;
+}
+
+.news_info_bottom_left {
+	padding: 2px;
+}
+
+.news_info_bottom_middle {
+	padding: 2px;
+	width: 100%;
+}
+
+.news_info_bottom_right {
+	padding: 2px;
+	white-space: nowrap
+}
+
+.news_comments_icon {
+	width: 16px;
+	height: 16px;
+	vertical-align: middle;
+}
+
+
+/* Theme Specific Classes: Cube Logo Graphic */
+
+.cube_container {
+	position: relative;
+	left: 0;
+	top: 0;
+}
+
+.cube_image {
+	position: absolute;
+	top: -76px;
+	left: -49px;
+	width: 96px;
+	height: 108px;
+	display: block;
+}
+
+
+/* Theme Specific Classes: Advanced Content Management Graphic */
+
+.advanced_image {
+	width: 145px;
+	height: 90px;
+	display: block;
+	margin-left: 14px;
+}
+
+
+/* Theme Specific Classes: Paperclipped Notes Menu */
+
+.paperclip_container {
+	text-align: center;
+	width: 160px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.paperclip_inner_container {
+	border-collapse: collapse;
+	border-spacing: 0px;
+	width: 130px;
+	height: 175px;
+}
+
+.paperclip_caption {
+	padding: 6px 0px;
+	text-align: right;
+}
+
+.paperclip {
+	font-weight: bold;
+	font-size: 12px;
+	padding: 34px 20px 0px 20px;
+	text-align: left;
+	background-image: url(images/paperclip.png);
+	background-repeat: no-repeat;
+	background-position: top center;
+	margin-bottom: 5px;
+	vertical-align: top;
+}
+
+
+/* Theme Specific Classes: Post It Note Menu */
+
+.post_it_container {
+	text-align: center;
+	margin-bottom: 9px;
+	margin-top: 7px;
+	width: 160px;
+	margin-left: auto;
+	margin-right: auto;
+	font-weight: bold;
+	font-size: 12px;
+}
+
+.post_it_top {
+	background-image: url(images/post_it_top.png);
+	background-repeat: no-repeat;
+	background-position: top center;
+}
+
+.post_it_back {
+	text-align: left;
+	background-image: url(images/post_it_middle.png);
+	background-repeat: repeat-y;
+	background-position: center;
+	width: 120px;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.post_it_bottom {
+	background-image: url(images/post_it_bottom.png);
+	background-repeat: no-repeat;
+	background-position: bottom center;
+	padding: 12px 7px;
+}
+
+.post_it_caption {
+	padding-bottom: 5px;
+}
+
+
+/* Brainjar Nav Menu Classes {SITELINS_ALT} */
+/*
+If you do not use {SITELINS_ALT} and switch to the standard {SITELINKS} instead, 
+all of the below can be deleted.
+*/
+/*----------------------------------------------------------------------------*/
+
+div.menuBar, div.menuBar a.menuButton, div.menuButton, div.menuButton_over, div.menu, div.menu a.menuItem {
+	font: bold 12px arial, verdana, arial, tahoma, sans-serif;
+	color: #126CA3;
+	text-align: left;
+}
+
+div.menuBar {
+	background-color: #fff;
+	border-top: 1px solid #fff;
+	padding: 4px 0px;
+	text-align: right;
+}
+
+div.emenuBar {
+	background-color: #F7F9FA;
+	border-top: 1px solid #fff;
+	text-align: left;
+}
+
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over {
+	background-color: transparent;
+	border: 1px solid;
+	border-color: transparent !important;
+	border-color: #fff #fff #fff #fff;
+	left: 0px;
+	margin: 0px;
+	padding: 2px 6px 2px 6px;
+	position: relative;
+	text-decoration: none;
+	top: 0px;
+	z-index: 100;
+}
+
+div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over {
+	background-color: #126CA3;
+	border-color: #fff #fff #fff #fff !important;
+	color: #fff;
+}
+
+div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, div.menuBar a.menuButtonActive:hover {
+	background-color: #126CA3;
+	border-color: #fff #fff #fff #fff !important;
+	left: 1px;
+	top: 1px;
+	color: #fff;
+}
+
+div.menu {
+	background-color: #FCFDFF;
+	border: 1px solid;
+	border-color: #fff #a5a5a5 #a5a5a5 #fff;
+	left: 0px;
+	padding: 1px;
+	position: absolute;
+	top: 0px;
+	visibility: hidden;
+	z-index: 101;
+}
+
+div.menu a.menuItem {
+	display: block;
+	padding: 2px 11px 2px 0px;
+	text-decoration: none;
+	white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+	background-color: #F2F4FF;
+}
+
+div.menu a.menuItem span.menuItemBuffer, div.menu a.menuItem:hover span.menuItemBuffer {
+	padding: 0px 2px;
+}
+
+div.menu a.menuItem span.menuItemText {
+	padding: 0px 0px 0px 3px;
+}
+
+div.menu a.menuItem span.menuItemArrow {
+	margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+	border-top: 1px solid #a5a5a5;
+	border-bottom: 1px solid #fff;
+	margin: 4px 2px;
+}
+
+a.menuItem.header {
+	border-bottom: 1px solid #b3b3b3;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/reline/theme.php 75/e107_themes/reline/theme.php
--- 6171/e107_themes/reline/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/reline/theme.php	2006-04-29 01:00:37.000000000 -0500
@@ -0,0 +1,364 @@
+<?php
+/*
++----------------------------------------------------------------------------+
+|	e107 website system
+|
+|	Steve Dunstan 2001-2002
+|	http://e107.org
+|	jalist@e107.org
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).
+|
+|	$Source: /cvsroot/e107/e107_0.7/e107_themes/reline/theme.php,v $
+|	$Revision: 1.16 $
+|	$Date: 2006/04/29 06:00:37 $
+|	$Author: sweetas $
+|
++----------------------------------------------------------------------------+
+|	Photo Credits
+|
+|	mosaic glass by 
+|	-> by massimo bassi [maXb] ( http://www.robamia.com )
+|
+|	funky_box 1
+|	-> by Andrzej Pobiedzinski [Sarej] ( http://www.imagecreators.olsztyn.pl )
+|
+|	Lime Light | Orange Splash
+|	-> by Martin R.W [matchstick] ( http://www.match-stick.co.uk )
+|
+|	Hands 4: holding a poster | Paper clipped | Post-It | Bubbles 3
+|	-> by Davide Guglielmo [brokenarts] ( http://www.broken-arts.com )
+|
++----------------------------------------------------------------------------+
+*/
+
+
+// Protect the file from direct access
+if (!defined('e107_INIT')) { exit; }
+
+
+// Get language definition files for this theme
+@include_once(e_THEME."reline/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."reline/languages/English.php");
+
+
+// Set theme info
+$themename = "Reline";
+$themeversion = "1.0";
+$themeauthor = "SweetAs";
+$themedate = "24/04/06";
+$themeinfo = "";
+$xhtmlcompliant = TRUE;	// If set to TRUE will display an XHTML compliant logo in theme manager
+$csscompliant = TRUE;	// If set to TRUE will display a CSS compliant logo in theme manager
+
+
+// Define which icon set to use.
+// There are two possible values here 'dark' and 'lite'.
+// If your theme has a light background then use 'lite' and vice versa for dark themes.
+// Because IE does not yet support Alpha transparency with PNG24 images, all of e107's 
+// icons have been saved with both a light and dark matte background (to prevent jagged 
+// edges that you see when no matte is present).
+// The IMODE is specifying which of the icon sets to use.
+// IE7 will support Alpha transparent PNG's at which point we will create a third set
+// of icons (using alpha transparency instead of a matte) and IMODE will gradually be 
+// filtered out as this new set will work with all background colours.
+// Uncomment the line below to define IMODE (remove the // ). Default is 'lite'.
+
+// define("IMODE", "lite");
+
+
+// Theme disclaimer is displayed in your site disclaimer appended to the site disclaimer text.
+// Uncomment the line below to set a theme disclaimer (remove the // ).
+
+// define("THEME_DISCLAIMER", "Example theme disclaimer text."); 
+
+
+// Dont render core style sheet link.
+// the contents of e107_files/e107.css have been copied to this themes style.css.
+// By setting $no_core_css to TRUE below we can prevent the <link> tag 
+// that would normally be generated in the <head> of the page from being outputted.
+// This saves us a call by the browser to a stylesheet that we no longer need.
+
+$no_core_css = TRUE;
+
+
+// Output into <head> section.
+// Anything echoed from within the theme_head() function gets outputted into the <head> of your page.
+// Please note that you have other choices for <head> based javascript. You can create a theme.js file 
+// in your themes folder and a link will automatically be generated to it in the <head> of your page.
+// If you have javascript that is independant of the theme rather than use theme.js or the theme_head()
+// function below, its advisable to instead create a new file e107_files/user.js, placing your script 
+// into this, and as with theme.js, a link will automatically be generated to this file.
+// Uncomment the following three lines to use.
+
+//function theme_head() {
+//	echo "<script></script>";
+//}
+
+
+// Header and footer templates for the body of your site.
+// These are the header and footer that wraps the content of a page.
+// Note that these are the templates for *inbetween* the <body> and </body> tags. 
+// The rest of the output (eg. the <head> section of the page) are covered by 
+// the header and footer template files in e107_themes/templates.
+// These are called header_default.php and footer_default.php.
+// If you wish to use your own versions of these files uncomment the line below (remove the // ) 
+// and edit it so that the text string represents the postfix of the new set of files.
+// eg. using the example text e107 will include these files: 
+// e107_themes/templates/header_your_version.php and e107_themes/templates/footer_your_version.php 
+// instead of the default:
+// e107_themes/templates/header_default.php and e107_themes/templates/footer_default.php 
+// Please note however that using non default core header and footer templates is not recommended 
+// and that the flexibility of these files enables you to add and edit content to them without editing 
+// the files directly. Documentation for this can be found on e107.org.
+
+// $layout = '_your_version'; // uncomment this line (remove the // ) to use alternative template files.
+
+
+// Main header
+$HEADER = "<table class='container'>
+<tr>
+<td>
+<img class='advanced_image' src='".e_IMAGE."advanced.png' alt='' />
+</td>
+
+<td class='top_section'>
+{LOGO}
+</td>
+</tr>
+
+<tr>
+<td class='left_section'>
+
+<table class='top_left_menu_container'><tr><td>
+{SETSTYLE=top_left_menu}
+{MENU=1}
+</td></tr>
+
+<tr><td class='bottom_left_menu_area'>
+{SETSTYLE=bottom_left_menu}
+{MENU=2}
+</td></tr></table>
+
+</td>
+
+<td class='main_container'>
+
+<table class='top_inner_container'>
+<tr>
+<td class='top_bar'>
+{SEARCH}
+</td>
+</tr>
+
+<tr>
+<td class='main_nav'>
+
+<div class='cube_container'>
+<img class='cube_image' src='".THEME_ABS."images/cube.png' alt='' />
+</div>
+
+{SITELINKS_ALT=no_icons+noclick}
+</td>
+</tr>
+</table>
+
+{SETSTYLE=default}
+
+<table class='bottom_inner_container'>
+<tr>
+<td class='main_section'>
+{WMESSAGE}
+";
+
+
+// Main footer
+$FOOTER = "</td>
+
+<td class='right_section'>
+{SETSTYLE=paperclip}
+{MENU=3}
+{SETSTYLE=right_menu}
+{MENU=4}
+{SETSTYLE=post_it}
+{MENU=5}
+</td>
+</tr>
+</table>
+
+</td>
+</tr>
+</table>
+
+<div class='disclaimer'>
+{SITEDISCLAIMER}
+</div>";
+
+// Custom footer for pages with no right menu area. Uncomment the $CUSTOMPAGES line below the 
+// footer to activate and use.
+
+$CUSTOMFOOTER['No_Right_Menu_Area'] = "</td>
+</tr>
+</table>
+
+</td>
+</tr>
+</table>
+
+<div class='disclaimer'>
+{SITEDISCLAIMER}
+</div>";
+
+
+ // Uncomment the below line (remove the // ) and enter in the filenames (or part of) for 
+ // those pages you wish to use the custom page layout defined above (seperate with spaces).
+
+ // $CUSTOMPAGES['No_Right_Menu_Area'] = "forum.php forum_post.php forum_viewtopic.php";
+
+
+// Define attributes associated with site links.
+
+define('PRELINK', ''); // Prefixed to all links as a group
+define('POSTLINK', ''); // Postfixed to all links as a group
+define('LINKSTART', ''); // Prefixed to each indivdual link
+define('LINKEND', ''); // Postfixed to each indivdual link
+define('LINKDISPLAY', 1);
+define('LINKALIGN', 'left');
+
+
+// News style
+
+$NEWSSTYLE = "<div class='tablerender'><div class='main_caption'>{STICKY_ICON}{NEWSTITLE}</div>{NEWSIMAGE}{NEWSBODY}{EXTENDED}</div>
+
+<div class='news_info_top'>
+<img class='news_comments_icon' src='".THEME_ABS."images/comments_16.png' alt='' />&nbsp;
+{NEWSCOMMENTS}{TRACKBACK}
+</div>
+
+<table class='news_info_bottom'>
+<tr>
+<td class='news_info_bottom_left'>
+{NEWSICON}
+</td>
+
+<td class='news_info_bottom_middle'>
+".LAN_THEME_5." {NEWSAUTHOR} ".LAN_THEME_6." {NEWSDATE}
+</td>
+
+<td class='news_info_bottom_right'>
+{EMAILICON}{PRINTICON}{PDFICON}{ADMINOPTIONS}
+</td>
+</tr>
+</table>";
+
+
+// Define attributes associated with news style.
+
+define('ICONMAIL', 'email_16.png');
+define('ICONPRINT', 'print_16.png');
+define('ICONSTYLE', 'border: 0px');
+define('COMMENTOFFSTRING', LAN_THEME_1);
+define('COMMENTLINK', LAN_THEME_2);
+define('PRE_EXTENDEDSTRING', '<br /><br />[ ');
+define('EXTENDEDSTRING', LAN_THEME_3);
+define('POST_EXTENDEDSTRING', ' ]<br />');
+define('TRACKBACKSTRING', LAN_THEME_4);
+define('TRACKBACKBEFORESTRING', '&nbsp;&nbsp;|&nbsp;&nbsp;');
+
+
+// Table style
+
+function tablestyle($caption, $text, $mode){
+	global $style;
+	
+	if ($style == 'top_left_menu') 
+	{
+		echo "<div class='top_left_menu'>";
+		if (USER && $mode == 'login') 
+		{
+			echo "<img src='".THEME_ABS."images/loggedin.png' style='width: 32px; height: 32px; display: block' alt='' /><br />";
+		}
+		echo "<div class='top_left_menu_caption'>".$caption."</div>".$text."</div>";
+	} 
+	else if ($style == 'paperclip') 
+	{
+		echo "<div class='paperclip_container'>
+		<table class='paperclip_inner_container'><tr><td class='paperclip'>";
+		if ($caption) 
+		{
+			echo "<div class='paperclip_caption'>".$caption."</div>";
+		}
+		echo $text."</td></tr></table></div>";
+	} 
+	else if ($style == 'post_it') 
+	{
+		echo "<div class='post_it_container'><div class='post_it_back'><div class='post_it_top'><div class='post_it_bottom'>
+		<div class='post_it_caption'>".$caption."</div>".$text."</div></div></div></div>";
+	} 
+	else if ($style == 'bottom_left_menu' || $style == 'right_menu') 
+	{
+		echo "<table class='menu_container'><tr><td class='menu_inner_container'>
+		<div class='menu_caption'>".$caption."</div>".$text."</td></tr></table>";
+	}  
+	else 
+	{
+		echo "<div class='tablerender'><div class='main_caption'>".$caption."</div>".$text."</div>";
+	}
+	
+}
+
+
+// Comment post style
+$sc_style['REPLY']['pre'] = "<tr><td class='forumheader'>";
+$sc_style['REPLY']['post'] = "";
+
+$sc_style['SUBJECT']['pre'] = "<td class='forumheader'>";
+$sc_style['SUBJECT']['post'] = "</td></tr>";
+
+$sc_style['COMMENTEDIT']['pre'] = "<tr><td class='forumheader' colspan='2' style='text-align: right'>";
+$sc_style['COMMENTEDIT']['post'] = "</td></tr>";
+
+$sc_style['JOINED']['post'] = "<br />";
+
+$sc_style['LOCATION']['post'] = "<br />";
+
+$sc_style['RATING']['post'] = "<br /><br />";
+
+$sc_style['RATING']['post'] = "<br />";
+
+$COMMENTSTYLE = "<div class='spacer' style='text-align:center'><table class='fborder' style='width: 95%'>
+<tr>
+<td class='fcaption' colspan='2'>".LAN_THEME_5." {USERNAME} ".LAN_THEME_6." {TIMEDATE}
+</td>
+</tr>
+{REPLY}{SUBJECT}
+<tr>
+<td style='width: 20%; vertical-align: top' class='forumheader3'>
+<div style='text-align: center'>
+{AVATAR}
+</div>
+{LEVEL}<span class='smalltext'>{JOINED}{COMMENTS}{LOCATION}{IPADDRESS}</span>
+</td>
+<td style='width: 80%; vertical-align: top' class='forumheader3'>
+{COMMENT}
+{RATING}
+{SIGNATURE} 
+</td>
+</tr>
+{COMMENTEDIT}
+</table>
+</div>";
+
+
+// Search shortcode style
+$SEARCH_SHORTCODE = "<input class='tbox search' type='text' name='q' size='20' value='' maxlength='50' />
+<input type='image' name='s' src='".THEME_ABS."images/search.png'  value='' style='width: 16px; height: 16px; border: 0px; vertical-align: middle'  />";
+
+
+// Chatbox post style
+$CHATBOXSTYLE = "<br /><img src='".e_IMAGE."admin_images/chatbox_16.png' alt='' style='width: 16px; height: 16px; vertical-align: bottom' />
+<b>{USERNAME}</b><br />{TIMEDATE}<br />{MESSAGE}<br />";
+
+
+?>
\ No newline at end of file
Files 6171/e107_themes/sebes/images/arrow.png and 75/e107_themes/sebes/images/arrow.png differ
Files 6171/e107_themes/sebes/images/button.png and 75/e107_themes/sebes/images/button.png differ
Files 6171/e107_themes/sebes/images/fcaption.png and 75/e107_themes/sebes/images/fcaption.png differ
Files 6171/e107_themes/sebes/images/forumheader.png and 75/e107_themes/sebes/images/forumheader.png differ
Files 6171/e107_themes/sebes/images/header.png and 75/e107_themes/sebes/images/header.png differ
Files 6171/e107_themes/sebes/images/logo1.png and 75/e107_themes/sebes/images/logo1.png differ
Files 6171/e107_themes/sebes/images/logo1_template.png and 75/e107_themes/sebes/images/logo1_template.png differ
Files 6171/e107_themes/sebes/images/logo2.png and 75/e107_themes/sebes/images/logo2.png differ
Files 6171/e107_themes/sebes/images/logo2_template.png and 75/e107_themes/sebes/images/logo2_template.png differ
Files 6171/e107_themes/sebes/images/marrow.png and 75/e107_themes/sebes/images/marrow.png differ
Files 6171/e107_themes/sebes/images/oarrow.png and 75/e107_themes/sebes/images/oarrow.png differ
Files 6171/e107_themes/sebes/images/search.png and 75/e107_themes/sebes/images/search.png differ
Files 6171/e107_themes/sebes/images/selarrow.png and 75/e107_themes/sebes/images/selarrow.png differ
diff -ruN 6171/e107_themes/sebes/languages/English.php 75/e107_themes/sebes/languages/English.php
--- 6171/e107_themes/sebes/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/sebes/languages/English.php	2005-03-21 06:11:00.000000000 -0600
@@ -0,0 +1,26 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/sebes/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/03/21 12:11:00 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "'sebes' by <a href='http://e107.org' rel='external'>jalist</a>");
+define("LAN_THEME_2", "Read/Post Comment: ");
+define("LAN_THEME_3", "Comments are turned off for this item");
+define("LAN_THEME_4", "Read the rest ...");
+define("LAN_THEME_5", "Trackbacks: ");
+
+?>
Files 6171/e107_themes/sebes/preview.jpg and 75/e107_themes/sebes/preview.jpg differ
diff -ruN 6171/e107_themes/sebes/style.css 75/e107_themes/sebes/style.css
--- 6171/e107_themes/sebes/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/sebes/style.css	2005-05-25 20:29:42.000000000 -0500
@@ -0,0 +1,270 @@
+body {
+	color: #000;
+	font: 11px verdana, tahoma, arial, sans-serif;
+	background-color: #D1CFCF;
+}
+a {
+	color: #035479; 
+	text-decoration: none;
+}
+a:hover {
+	color: #DC6504;
+	text-decoration: none;
+}
+
+.mainbox {
+	border: 1px solid #879397;
+	background-color: #fff;
+	color: #000;
+}
+
+#banner {
+	position: absolute;
+	right:20px;
+	top:40px;
+}
+
+#logo1 {
+	background-image: url(images/logo1.png);
+	width: 215px;
+	height: 104px;
+}
+
+#logo2 {
+	background-image: url(images/logo2.png);
+	width: 215px;
+	height: 24px;
+}
+
+#heading {
+	background-image: url(images/header.png);
+	width: 100%;
+	height: 104px;
+	background-repeat: repeat-x;
+
+}
+
+.smalltext {
+	color: #000;
+	font: 10px verdana, tahoma, arial, sans-serif;
+}
+
+.headertext {
+	color: #DC6504;
+	font: 16px verdana, tahoma, arial, sans-serif;
+	font-weight: bold;
+}
+
+.indent {
+	border: 1px solid #D1CFCF;
+	background-color: #efefef;
+	color: #727272;
+	font: 7pt verdana, tahoma, arial, sans-serif;
+	padding: 10px;
+}
+
+.docinnerbox {
+	padding: 10px;
+	text-align: left;
+}
+
+#doclinkcolumn {
+	width: 214px;
+	background-color: #f0f0f0;
+	vertical-align: top;
+}
+
+#docmaincolumn {
+	background-color: #fff;
+	border-left: 1px solid #000;
+	vertical-align: top;
+}
+
+#searchbox {
+	text-align: right;
+	padding-right: 6px;
+}
+
+form {
+	margin: 2px 0px 0px 0px;
+}
+
+p {
+	margin: 0px;
+}
+
+#info {
+	background-image: url(images/info.png);
+	background-repeat: repeat-x;
+	height: 20px;
+	width: 100%;
+}
+
+ol, ul{
+	margin-top: 0;
+	margin-bottom: 0;
+}
+
+.captiontext, h1 {
+	color: #DC6504;
+	font: 14px verdana, tahoma, arial, sans-serif;
+	margin: 0;
+}
+
+.caption {
+	color: #DC6504;
+	font: 12px verdana, tahoma, arial, sans-serif;
+	margin: 0;
+}
+
+hr {
+	border-top: #666 1px solid;
+	height: 1px;
+	width: 100%;
+	text-align:center;
+}
+
+.helpbox {
+	color:#000;
+	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
+	border: 0px none red;
+	background-color: transparent;
+}
+
+#commentform {
+	text-align: left;
+}
+
+#commentformbutton {
+	text-align: left;
+}
+
+.button {
+	border: 1px solid #000;
+	color: #000;
+	font: 7pt verdana, tahoma, arial, helvetica, sans-serif;
+	text-align:center;
+	background-image : url(images/button.png);
+}
+
+.tbox {
+	background-color: #ddd;
+	border: 1px solid #bbb;
+	font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif; color: #777;
+}
+
+.code_highlight {
+	width: 100%;
+	background-color: #efefef;
+	border: 1px solid #e0e0e0;
+}
+
+.comment {
+	background-color: #f3f1f1;
+	width: 100%;
+	border: 1px solid #e0e0e0;
+}
+
+.lowlight {
+	width: 100%;
+	background-color: #e5e5e5;
+	font-weight: bold;
+}
+
+.compad {
+	padding: 4px;
+}
+
+.spacer {
+	padding: 2px 0 2px 0;
+}
+
+.center {
+	text-align: center;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+.tbox.chatbox {
+	width: 88%;
+	margin-left: auto;
+	margin-right: auto;
+}
+
+
+
+.fborder {
+	border: #486386 1px solid;
+}
+.forumheader, .nforumcaption{
+	background-color: #f3f3f7;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	background-image : url(images/forumheader.png);
+	border-top: 1px solid #becde0;
+	border-bottom: 1px solid #e2e9f1;
+	border-left: 0;
+	border-right: 0;
+	height: 20px;
+}
+
+.finfobar{
+	background-color: #CCC8C8;
+	color:#000;
+	padding: 4px;
+	border: 1px solid #C3BDBD;
+	text-align: left;
+	background-image : url(images/forumheader.png);
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+}
+
+.forumheader2{
+	background-color: #f4f6fb;
+	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #f4f6fb 1px solid;
+}
+
+.forumheader3{
+	background-color: #f1f4fd;
+	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
+	color:#000;
+	padding: 4px;
+	border: #f1f4fd 1px solid;
+}
+
+.forumheader3_alt{
+	background-color: #f0f0f0;
+}
+
+.forumborder{
+	border: #000080 1px solid;
+}
+
+.fcaption {
+	border-bottom: 1px solid #becde0;
+	border-top: 1px solid #e2e9f1;
+	border-left: 0;
+	border-right: 0;
+	background-image : url(images/fcaption.png);
+	padding: 2px 0 2px 4px;
+	background-color: #f9fafb;
+	font: 9pt verdana, tahoma, arial, helvetica, sans-serif;
+	color:#616060;
+	height: 25px;
+}
+
+.smallblacktext, .defaulttext {
+	font: 8pt tahoma, verdana, arial, helvetica, sans-serif;
+	color:#32475f;
+}
+
+td {
+	text-align: left;
+}
+
+img {
+	vertical-align: middle;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/sebes/theme.php 75/e107_themes/sebes/theme.php
--- 6171/e107_themes/sebes/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/sebes/theme.php	2005-12-14 13:28:53.000000000 -0600
@@ -0,0 +1,151 @@
+<?php
+/*
++---------------------------------------------------------------+
+|	e107 website system
+|
+|	Steve Dunstan 2001-2002
+|	http://e107.org
+|	jalist@e107.org
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+@include_once(e_THEME."sebes/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."sebes/languages/English.php");
+
+// [theme]
+$themename = "sebes";
+$themeversion = "1.1";
+$themeauthor = "Steve Dunstan [jalist]";
+$themeemail = "jalist@e107.org";
+$themewebsite = "http://e107.org";
+$themedate = "18/03/2005";
+$themeinfo = "";
+define("STANDARDS_MODE", TRUE);
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+define("IMODE", "lite");
+define("THEME_DISCLAIMER", "<br /><i>".LAN_THEME_1."</i>");
+
+// [layout]
+
+$layout = "_default";
+$register_sc[]='USER_CONTRIBUTIONS';
+$HEADER = "
+<div class='mainbox'>
+<div id='banner'>
+{BANNER}
+</div>
+<table style='width: 100%;' cellpadding='0' cellspacing='0'>
+<tr>
+<td><div id='logo1'></div></td>
+<td id='heading'></td>
+</tr>
+<tr>
+<td id='logo2'>&nbsp;</td>
+<td id='searchbox'>
+{CUSTOM=search+".THEME_ABS."images/search.png+19+18}
+</td>
+</tr>
+</table>
+<table style='width: 100%;' cellpadding='0' cellspacing='0'>
+<tr>
+<td id='doclinkcolumn'>
+<div class='docinnerbox'>
+{SETSTYLE=menu}
+<div class='center'>[ <a href='".e_HTTP."index.php'>{SITENAME}</a> ]</div><br /><br />
+{SITELINKS}
+{MENU=1}
+</div>
+</td>
+<td id='docmaincolumn'>
+<div class='docinnerbox'>
+{SETSTYLE=main}
+";
+
+
+$FOOTER = "
+</div>
+</td>
+</tr>
+</table>
+</div>
+
+<div class='smalltext' style='text-align: center;'>{SITEDISCLAIMER}<br />{THEMEDISCLAIMER}</div>
+
+";
+
+
+define('PRELINK', "");
+define('POSTLINK', "");
+define('LINKSTART', "<img src='".THEME_ABS."images/arrow.png' alt='' /> ");
+define("LINKSTART_HILITE", "<img src='".THEME_ABS."images/selarrow.png' alt='' /> ");
+define('LINKEND', "<br />");
+define('LINKDISPLAY', 2);
+define('LINKALIGN', "left");
+
+
+define("BULLET", "arrow.png");
+
+/*	[newsstyle]	*/
+
+$NEWSSTYLE = "
+<div class='captiontext'><img src='".THEME_ABS."images/marrow.png' alt='' /> {NEWSTITLE}</div>
+<div class='smalltext'>{NEWSAUTHOR} on {NEWSDATE} | {NEWSCOMMENTS}{TRACKBACK}
+</div>
+{NEWSBODY}
+{EXTENDED}
+<br /><br />";
+
+define("ICONSTYLE", "");
+define("COMMENTLINK", LAN_THEME_2);
+define("COMMENTOFFSTRING", LAN_THEME_3);
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", LAN_THEME_4);
+define("POST_EXTENDEDSTRING", " ]<br />");
+define("TRACKBACKSTRING", LAN_THEME_5);
+define("TRACKBACKBEFORESTRING", " | ");
+
+
+//	[tablestyle]
+
+function tablestyle($caption, $text, $mode)
+{
+	global $style;
+	if($style == "menu")
+	{
+		echo "<div class='spacer'><div class='caption'><img src='".THEME_ABS."images/oarrow.png' alt='' /> {$caption}</div><div class='text'>{$text}</div></div><br />\n";
+	}
+	else
+	{
+		if($caption)
+		{
+			echo "<div class='spacer'><div class='caption'><img src='".THEME_ABS."images/marrow.png' alt='' /> {$caption}</div><br /></div>{$text}\n";
+		}
+		else
+		{
+			echo $text."\n";
+		}
+	}
+}
+
+$COMMENTSTYLE = "
+<div class='comment'>
+<div class='lowlight'><div class='compad'>{USERNAME} {TIMEDATE}</div></div>
+<div class='compad'>{COMMENT} {COMMENTEDIT}</div>
+</div>
+";
+
+
+$CHATBOXSTYLE = "
+<div class='link2'><div class='linktext'><hr /><img src='".THEME_ABS."images/arrow.png' alt='' style='vertical-align: middle;' /> {USERNAME} | <span class='cbdate'>{TIMEDATE}</span></div></div>
+<div class='smalltext'>
+{MESSAGE}
+</div>";
+
+
+?>
\ No newline at end of file
Files 6171/e107_themes/smacks/images/bg.gif and 75/e107_themes/smacks/images/bg.gif differ
Files 6171/e107_themes/smacks/images/bg.png and 75/e107_themes/smacks/images/bg.png differ
Files 6171/e107_themes/smacks/images/body.png and 75/e107_themes/smacks/images/body.png differ
Files 6171/e107_themes/smacks/images/bottomleft.png and 75/e107_themes/smacks/images/bottomleft.png differ
Files 6171/e107_themes/smacks/images/bottom.png and 75/e107_themes/smacks/images/bottom.png differ
Files 6171/e107_themes/smacks/images/bottomright.png and 75/e107_themes/smacks/images/bottomright.png differ
Files 6171/e107_themes/smacks/images/bullet1.gif and 75/e107_themes/smacks/images/bullet1.gif differ
Files 6171/e107_themes/smacks/images/bullet2.gif and 75/e107_themes/smacks/images/bullet2.gif differ
Files 6171/e107_themes/smacks/images/caption.png and 75/e107_themes/smacks/images/caption.png differ
Files 6171/e107_themes/smacks/images/left.png and 75/e107_themes/smacks/images/left.png differ
Files 6171/e107_themes/smacks/images/logo.png and 75/e107_themes/smacks/images/logo.png differ
Files 6171/e107_themes/smacks/images/right.png and 75/e107_themes/smacks/images/right.png differ
Files 6171/e107_themes/smacks/images/tablebg.png and 75/e107_themes/smacks/images/tablebg.png differ
Files 6171/e107_themes/smacks/images/topbar.png and 75/e107_themes/smacks/images/topbar.png differ
Files 6171/e107_themes/smacks/images/topleft.png and 75/e107_themes/smacks/images/topleft.png differ
Files 6171/e107_themes/smacks/images/top.png and 75/e107_themes/smacks/images/top.png differ
Files 6171/e107_themes/smacks/images/topright.png and 75/e107_themes/smacks/images/topright.png differ
diff -ruN 6171/e107_themes/smacks/style.css 75/e107_themes/smacks/style.css
--- 6171/e107_themes/smacks/style.css	2004-03-30 19:55:18.000000000 -0600
+++ 75/e107_themes/smacks/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,203 +0,0 @@
-a {
-	color: #3c3c3c; 
-	font-style: italic; 
-	font-family: verdana, arial, sans-serif; 
-	text-decoration: underline
-}
-a:hover {
-	color: #657e85;
-	text-decoration: none
-}
-body {
-	color: #646666;
-	font-family: 12px tahoma, verdana, arial, sans-serif;
-	background-color: #fff;
-	margin:30px;
-	background-image : url(images/bg.png);
-}
-.indent{
-	padding: 3px 10px 3px 10px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #646666;
-}
-.smalltext {
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#838a8b;
-}
-.smallblacktext {
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-	color:#646666;
-}
-.defaulttext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#646666;
-}
-td {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#646666;
-	padding: 0px;
-	text-align:left;
-}
-.mediumtext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#646666;
-}
-.captiontext {
-	font: bold 18px arial, helvetica, sans-serif;
-	color:#000;
-}
-.tbox{
-	background-color: #ececec;
-	border: #5e5d63 1px solid;
-	color: #000000;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-.button{
-	background-color: #ececec;
-	border: #000 1px solid;
-	color: #000000;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-}
-.nextprev{
-	background-color: #ffffff;
-	border: #d1d6d6 1px solid;
-	color: #000000;
-	font-: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:right;
-	padding : 2px;
-}
-form {
-	margin: 2px 0px 0px 0px;
-	color: #000;
-}
-.spacer{
-	padding: 2px 0px 2px 0px;
-}
-hr {
-	border-top: #98A9B8 1px solid;
-	border-bottom: #000060 1px solid;
-	height: 2px;
-	width: 92%;
-	text-align:left;
-}
-.border {
-	border: #98A9B8 1px solid;
-}
-.border2{
-	border: #98A9B8 1px solid;
-	background-image : url(images/body.png);
-}
-.caption {
-	padding: 4px;
-	background-color: #fff;
-	color: #000060;
-	font: 12px tahoma, arial, verdana, helvetica, sans-serif;
-	background-image : url(images/caption.png);
-}
-
-.topbar{
-	border: #000060 1px solid;
-	background-image : url(images/topbar.png);
-}
-
-.caption2 {
-	padding: 4px;
-	background-color: #fff;
-	color: #000060;
-	font: 12px tahoma, arial, verdana, helvetica, sans-serif;
-	background-color: #FFFBF7;
-}
-
-.bodytable {
-	padding: 8px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000060;
-}
-
-.bodytable2 {
-	padding: 8px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000060;
-	background-color: #FFFBF7;
-}
-p {
-	margin-top: 0px
-}
-.fborder {
-	border: #000000 1px solid;
-	background-color: #fff;
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	background-image : url(../../e107_images/forum/fcap2.png);
-}
-.forumheader2{
-	background-color: #EFEFEF;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-}
-.forumheader3{
-	background-color: #EFEFEF;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-}
-.forumtable1{
-	background-color: #fff;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-
-.forumtable2 {
-	background-color: #E3E1E1;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	padding: 4px 2px 2px 4px;
-	color:#000;
-}
-
-.forumtable3 {
-	background-color: #EFEFED;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	padding: 4px 2px 2px 4px;
-	color:#000;
-}
-
-.fcaption {
-	border: #000 1px solid;
-	padding: 2px 0px 2px 8px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(../../e107_images/forum/fcap.png);
-	color:#fff;
-}
-.indent{
-	padding: 3px 3px 3px 3px;
-	margin: 5px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #000060;
-	border: 1px solid;
-	background-color: #CCD5D9;
-	border-bottom: #FFFFFF 1px solid;
-	border-left: #000 1px solid;
-	border-right: #FFFFFF 1px solid;
-	border-top: #000 1px solid;
-}
-.maintable{ width: 60%; }
-.sidetable{ width: 20%; }
-
-.topcr{ width: 100%; background-repeat: repeat-x; background-image: url(images/top.png); }
-.toplf{ width: 15px; background-image: url(images/topleft.png); }
-.toprt{ width: 15px; background-image: url(images/topright.png); }
-
-.bodylt{ width: 15px; background-repeat: repeat-y; background-image: url(images/left.png); }
-.bodycr{ width: 100%; background: transparent; padding: 4px 5px 5px 4px; font-size: 10px; color: #000; font-family: verdana, tahoma, arial, sans-serif; background-image: url(images/tablebg.png);}
-.bodyrt{ width: 15px; background-repeat: repeat-y; background-image: url(images/right.png); }
-
-.bottomlt{ width: 15px; background-image: url(images/bottomleft.png); }
-.bottomcr{ width: 100%; background-repeat: repeat-x; background-image: url(images/bottom.png);}
-.bottomrt{ width: 15px; background-image: url(images/bottomright.png); }
\ No newline at end of file
diff -ruN 6171/e107_themes/smacks/theme.php 75/e107_themes/smacks/theme.php
--- 6171/e107_themes/smacks/theme.php	2004-03-03 12:24:38.000000000 -0600
+++ 75/e107_themes/smacks/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,180 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "smacks";
-$themeversion = "3.0";
-$themeauthor = "jalist";
-$themedate = "23/06/2003";
-$themeinfo = "";
-
-// [layout]
-
-$layout = "_default";
-
-$logo = "e107_themes/smacks/images/logo.png";
-
-$HEADER = opentable()."
-<div style='text-align:center'>
-<table style='width:100%' cellspacing='10' cellpadding='0'>
-<tr>
-<td style='width: 80%; vertical-align:top'>
-<table style='width:100%' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='width: 10%; vertical-align:top'>
-<img src='".e_BASE.$logo."' alt='' />
-<br />
-{SITETAG}
-</td>
-<td style='width: 1%; vertical-align:top'></td>
-<td class='topbar' style='width: 90%; vertical-align:top'>
-<table style='width:100%' cellspacing='5' cellpadding='0'>
-<tr>
-<td style='width: 33%; vertical-align:top'>
-{MENU=2}
-</td>
-<td style='width: 34%; vertical-align:top'>
-{MENU=3}
-</td>
-<td style='width: 33%; vertical-align:top'>
-{MENU=4}
-</td></tr></table>
-</td>
-</tr>
-</table>
-<br />
-{SETSTYLE=default}
-";
-
-
-$FOOTER = "
-</td><td style='width:20%; vertical-align:top'>
-
-{SETSTYLE=rightmenu}
-{SITELINKS}
-{MENU=1}
-</td>
-</tr>
-</table>
-</div>".
-closetable()."
-<div style='text-align:center'>
-{SITEDISCLAIMER}
-<br />
-<img src='".e_IMAGE."generic/php-small-trans-light.gif' alt='' /> <img src='".e_IMAGE."button.png' alt='' /> <img src='".e_IMAGE."generic/poweredbymysql-88.png' alt='' />
-</div>";
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-<div class='border'>
-<div class='caption'>
-{NEWSTITLE}
-
-<span class='smalltext'>posted by 
-{NEWSAUTHOR}
- on 
-{NEWSDATE}
-{NEWSCOMMENTS}
-{EMAILICON}
-{PRINTICON}
-{ADMINOPTIONS}
-</span>
-</div>
-</div>
-<div class='bodytable' style='text-align:left'>
-{NEWSICON}
-{NEWSBODY}
-{EXTENDED}
-</div>
-<div style='text-align:right'>
-
-
-</div>
-<br />";
-
-define("ICONSTYLE", "float: left; border:0");
-define("COMMENTLINK", "Read/Post Comment: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-
-define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
-define("EXTENDEDSTRING", "Read the rest ...");
-define("POST_EXTENDEDSTRING", " ]<br />");
-
-
-
-//	[tablestyle]
-
-function tablestyle($caption, $text, $mode=""){
-	global $style;
-	if($style == "default"){
-		if($caption != ""){
-			echo "<div class='border'><div class='caption'>".$caption."</div></div>\n";
-			if($text != ""){
-				echo "\n<div class='bodytable'>".$text."</div>\n";
-			}
-		}else{
-			echo "<div class='border'><div class='bodytable'>".$text."</div></div><br />\n";
-		}
-
-	}else if($style == "customtable"){
-		echo "<img src='".THEME."/images/bullet2.gif'>&nbsp;<b><span class='captiontext'>".$caption."</span></b><hr />".$text;
-	}else{
-		if($caption != ""){
-			echo "<div class='border'><div class='caption2'>".$caption."</div><div class='bodytable2'>".$text."</div></div><br />\n";
-		}else{
-			echo "<div class='bodytable2'>".$text."</div><br />\n";
-		}
-	}
-}
-
-//	[table]
-
-function opentable(){
-return "<div class='spacer'>
-<table style='width:90%' cellpadding='0' cellspacing='0' border='0' >
-<tr>
-<td class='toplf'><img src='".e_IMAGE."generic\blank.gif' width='15' height='15' alt='' style='display: block;'/></td>
-<td class='topcr'><img src='".e_IMAGE."generic\blank.gif' width='1' height='15' alt='' style='display: block;'/></td>
-<td class='toprt'><img src='".e_IMAGE."generic\blank.gif' width='15' height='15' alt='' style='display: block;'/></td>
-</tr>
-<tr>
-<td class='bodylt'><img src='".e_IMAGE."generic\blank.gif' width='15' height='1' alt='' style='display: block;'/></td>
-<td class='bodycr'>";
-}
-
-function closetable(){
-return "</td>
-<td class='bodyrt'><img src='".e_IMAGE."generic\blank.gif' width='15' height='1' alt='' style='display: block;'/></td>
-</tr>
-<tr>
-<td class='bottomlt'><img src='".e_IMAGE."generic\blank.gif' width='15' height='15' alt='' style='display: block;'/></td>
-<td class='bottomcr'><img src='".e_IMAGE."generic\blank.gif' width='1' height='15' alt='' style='display: block;'/></td>
-<td class='bottomrt'><img src='".e_IMAGE."generic\blank.gif' width='15' height='15' alt='' style='display: block;'/></td>
-</tr>
-</table>
-</div>";
-}
-
-// [linkstyle]
-
-define(PRELINK, "");
-define(POSTLINK, "");
-define(LINKSTART, "<img src='".THEME."images/bullet2.gif' alt='bullet' /> ");
-define(LINKEND, "<br />");
-define(LINKDISPLAY, 2);
-define(LINKALIGN, "left");
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_themes/soar/forum_design.php 75/e107_themes/soar/forum_design.php
--- 6171/e107_themes/soar/forum_design.php	2004-05-06 01:32:36.000000000 -0500
+++ 75/e107_themes/soar/forum_design.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,196 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/forum_design file 
-|
-|	e107 Core Team 2004
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-$FORUMSTART = "
-<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
-<tr>	
-<td  colspan='2' class='nforumcaption'>{BACKLINK}</td>
-</tr>
-<tr>
-<td class='nforumcaption2' colspan='2'>
-<table cellspacing='0' cellpadding='0' style='width:100%'>
-<tr>
-<td class='smalltext'>{NEXTPREV}</td>
-<td style='text-align:right'>&nbsp;{TRACK}&nbsp;</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<br />
-
-<table style='width:100%'>
-<tr>
-<td style='width:80%'><div class='mediumtext'><img src='".e_IMAGE."forum/e.png' style='vertical-align:middle' /> <b>{THREADNAME}</b></div><br />{GOTOPAGES}</td>
-<td style='width:20%; vertical-align:bottom;'>{BUTTONS}</td>
-</tr>
-</table>
-
-
-<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
-<tr>
-<td style='width:20%; text-align:center' class='nforumcaption2'>\n".LAN_402."\n</td>\n<td style='width:80%; text-align:center' class='nforumcaption2'>\n".LAN_403."\n</td>
-</tr>
-</table>";
-
-$FORUMTHREADSTYLE = "
-<div class='spacer'>
-<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
-<tr>
-<td class='nforumcaption3' style='vertical-align:middle; width:20%;'>\n{NEWFLAG}\n{POSTER}\n</td>
-<td class='nforumcaption3' style='vertical-align:middle; width:80%;'>
-<table cellspacing='0' cellpadding='0' style='width:100%'>
-<tr>
-<td class='smallblacktext'>\n{THREADDATESTAMP}\n</td>
-<td style='text-align:right'>\n{REPORTIMG}{EDITIMG}{QUOTEIMG}\n</td>
-</tr>
-</table>
-</td>
-</tr>	
-<tr>
-<td class='nforumthread' style='vertical-align:top'>\n{AVATAR}\n<span class='smalltext'>\n{CUSTOMTITLE}\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{LOCATION}\n{POSTS}\n</span>\n</td>
-<td class='nforumthread' style='vertical-align:top'>\n{POST}\n{SIGNATURE}\n</td>
-</tr>		
-<tr>
-<td class='nforumthread2'>\n<span class='smallblacktext'>\n{TOP}\n</span>\n</td>
-<td class='nforumthread2' style='vertical-align:top'>
-<table cellspacing='0' cellpadding='0' style='width:100%'>
-<tr>
-<td>\n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n</td>
-<td style='text-align:right'>\n{MODOPTIONS}\n</td>
-</tr>
-</table>
-</td>
-</tr>	
-</table>
-</div>";
-
-$FORUMEND = "
-<div class='spacer'>
-<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
-<tr>
-<td style='width:50%; text-align:left; vertical-align:top' class='nforumthread'><b>{MODERATORS}</b><br />{FORUMJUMP}</td>
-<td style='width:50%; text-align:right; vertical-align:top' class='nforumthread'>{BUTTONS}</td>
-</tr>
-</table>
-</div>
-{GOTOPAGES}
-<div class='spacer'>
-<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
-<tr>
-<td style='text-align:center' class='nforumthread2'>{QUICKREPLY}</td>
-</tr>
-</table>
-<div class='nforumdisclaimer' style='text-align:center'>Forum theme loosely based on <a href='http://www.invisionpower.com/'>Invision Power Board</a></div>
-</div>";
-
-
-$FORUM_MAIN_START = "<div style='text-align:center'>";
-
-$FORUM_MAIN_PARENT = "<div class='spacer'>\n<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>\n<tr>\n<td colspan='5' class='nforumcaption'>{PARENTNAME} {PARENTSTATUS}</td>\n</tr>
-<tr>\n<td colspan='2' style='width:60%; text-align:center' class='nforumcaption2'>{FORUMTITLE}</td>\n<td style='width:10%; text-align:center' class='nforumcaption2'>{THREADTITLE}</td>\n<td style='width:10%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>\n<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>\n</tr>\n";
-
-$FORUM_MAIN_PARENT_END = "</table></div>";
-
-$FORUM_MAIN_FORUM = "<tr>\n<td style='width:5%; text-align:center' class='nforumcaption3'>{NEWFLAG}</td>\n<td style='width:55%' class='nforumcaption3'>{FORUMNAME}<br /><span class='smallblacktext'>{FORUMDESCRIPTION}</span></td>\n<td style='width:10%; text-align:center' class='nforumthread'>{THREADS}</td>\n<td style='width:10%; text-align:center' class='nforumthread'>{REPLIES}</td>\n<td style='width:20%; text-align:center' class='nforumthread'><span class='smallblacktext'>{LASTPOST}</span></td>\n</tr>";
-
-$FORUM_MAIN_END = "<div class='spacer'>\n<table style='width:100%' class='fborder'>\n<tr>\n<td colspan='2' style='width:60%' class='nforumcaption2'>{INFOTITLE}</td>\n</tr>\n<tr>\n<td rowspan='3' style='width:5%; text-align:center' class='forumheader3'>{LOGO}</td>\n<td style='width:auto' class='forumheader3'>{INFO}</td>\n</tr>\n<tr>\n<td style='width:100%' class='forumheader3'>{FORUMINFO}</td>\n</tr>\n\n<tr>\n<td style='width:100%' class='forumheader3'>{USERLIST}</td>\n</tr>\n</table>\n</div>\n<div class='spacer'>\n<table class='fborder' style='width:100%'>\n<tr>\n<td class='forumheader3' style='text-align:center; width:33%'>{ICONKEY}</td>\n<td style='text-align:center; width:33%' class='forumheader3'>{SEARCH}</td>\n<td style='width:33%; text-align:center; vertical-align:middle' class='forumheader3'><span class='smallblacktext'>{PERMS}</span>\n</td>\n</tr>\n</table>\n</div>\n<div class='nforumdisclaimer' style='text-align:center'>Forum theme loosely based on <a href='http://www.invisionpower.com/'>Invision Power Board</a></div>";
-
-
-
-
-
-
-$FORUM_VIEW_START = "
-<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
-<tr>
-<td  colspan='2' class='nforumcaption'>{BREADCRUMB}</td>
-</tr>
-<tr>
-</table>
-<table style='width:100%'>
-<td style='width:80%'><div class='mediumtext'><img src='".e_IMAGE."forum/e.png' style='vertical-align:middle' /> <b>{FORUMTITLE} Forum</b></div>{THREADPAGES}</td>
-<td style='width:20%; text-align:right; vertical-align:bottom;'>
-{NEWTHREADBUTTON}
-</td>
-</tr>
-</table>
-
-<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
-<tr>
-<td style='width:3%' class='nforumcaption2'>&nbsp;</td>
-<td style='width:47%' class='nforumcaption2'>{THREADTITLE}</td>
-<td style='width:20%; text-align:center' class='nforumcaption2'>{STARTERTITLE}</td>
-<td style='width:5%; text-align:center' class='nforumcaption2'>{REPLYTITLE}</td>
-<td style='width:5%; text-align:center' class='nforumcaption2'>{VIEWTITLE}</td>
-<td style='width:20%; text-align:center' class='nforumcaption2'>{LASTPOSTITLE}</td>
-</tr>";
-
-
-
-$FORUM_VIEW_FORUM = "
-<tr>
-<td style='vertical-align:middle; text-align:center; width:3%' class='nforumview1'>{ICON}</td>
-<td style='vertical-align:middle; text-align:left; width:47%'  class='nforumview1'>
-
-<table style='width:100%'>
-<tr>
-<td style='width:90%'><span class='mediumtext'><b>{THREADNAME}</b></span> <span class='smalltext'>{PAGES}</span></td>
-<td style='width:10%; white-space:nowrap;'>{ADMIN_ICONS}</td>
-</tr>
-</table>
-</td>
-
-<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'><b>{POSTER}</b><br />{THREADDATE}</span></td>
-<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{REPLIES}</span></td>
-<td style='vertical-align:center; text-align:center; width:5%' class='nforumview2'><span class='smalltext'>{VIEWS}</span></td>
-<td style='vertical-align:top; text-align:center; width:20%' class='nforumview2'><span class='smalltext'>{LASTPOST}</span></td>
-</tr>";
-
-
-$FORUM_VIEW_END = "
-</table>
-<table style='width:100%'>
-<tr>
-<td style='width:80%'><span class='mediumtext'>{THREADPAGES}</span>
-{FORUMJUMP}
-</td>
-<td style='width:20%; text-align:right'>
-{NEWTHREADBUTTON}
-</td>
-</tr>
-</table>
-
-
-<div class='spacer'>
-<table style='width:100%' class='nforumholder' cellpadding=0 cellspacing=0>
-<tr>
-<td style='vertical-align:center; width:50%' class='nforumview3'><span class='smalltext'>{MODERATORS}</span></td>
-<td style='text-align:right; vertical-align:center; width:50%' class='nforumview3'><span class='smalltext'>{BROWSERS}</span></td>
-</tr>
-
-<tr>
-<td style='vertical-align:center; width:50%' class='nforumview4'>{ICONKEY}</td>
-<td style='vertical-align:center; text-align:center; width:50%' class='nforumview4'>{PERMS}<br /><br />{SEARCH}
-</td>
-</tr>
-</table>
-</div>
-</div>
-<div class='nforumdisclaimer' style='text-align:center'>Forum theme loosely based on <a href='http://www.invisionpower.com/'>Invision Power Board</a></div>";
-
-
-
-?>
\ No newline at end of file
Files 6171/e107_themes/soar/images/bar2edge.gif and 75/e107_themes/soar/images/bar2edge.gif differ
Files 6171/e107_themes/soar/images/bar2.gif and 75/e107_themes/soar/images/bar2.gif differ
Files 6171/e107_themes/soar/images/bar.jpg and 75/e107_themes/soar/images/bar.jpg differ
Files 6171/e107_themes/soar/images/bg.gif and 75/e107_themes/soar/images/bg.gif differ
Files 6171/e107_themes/soar/images/blank.gif and 75/e107_themes/soar/images/blank.gif differ
Files 6171/e107_themes/soar/images/bullet1.gif and 75/e107_themes/soar/images/bullet1.gif differ
Files 6171/e107_themes/soar/images/bullet2.gif and 75/e107_themes/soar/images/bullet2.gif differ
Files 6171/e107_themes/soar/images/cap1.png and 75/e107_themes/soar/images/cap1.png differ
Files 6171/e107_themes/soar/images/caption2.png and 75/e107_themes/soar/images/caption2.png differ
Files 6171/e107_themes/soar/images/caption3.png and 75/e107_themes/soar/images/caption3.png differ
Files 6171/e107_themes/soar/images/caption.png and 75/e107_themes/soar/images/caption.png differ
Files 6171/e107_themes/soar/images/fcap2.png and 75/e107_themes/soar/images/fcap2.png differ
Files 6171/e107_themes/soar/images/fcap.png and 75/e107_themes/soar/images/fcap.png differ
Files 6171/e107_themes/soar/images/hr.png and 75/e107_themes/soar/images/hr.png differ
Files 6171/e107_themes/soar/images/logo.jpg and 75/e107_themes/soar/images/logo.jpg differ
Files 6171/e107_themes/soar/images/nforumcaption2.png and 75/e107_themes/soar/images/nforumcaption2.png differ
Files 6171/e107_themes/soar/images/nforumcaption.png and 75/e107_themes/soar/images/nforumcaption.png differ
Files 6171/e107_themes/soar/images/shadow_left.png and 75/e107_themes/soar/images/shadow_left.png differ
Files 6171/e107_themes/soar/images/shadow_middle.png and 75/e107_themes/soar/images/shadow_middle.png differ
Files 6171/e107_themes/soar/images/shadow_right.png and 75/e107_themes/soar/images/shadow_right.png differ
diff -ruN 6171/e107_themes/soar/style.css 75/e107_themes/soar/style.css
--- 6171/e107_themes/soar/style.css	2004-03-30 19:55:18.000000000 -0600
+++ 75/e107_themes/soar/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,332 +0,0 @@
-a {
-	color: #eee; 
-	font: verdana, arial, sans-serif;
-	text-decoration: underline;
-}
-a:hover {
-	color: #ff0000;
-	text-decoration: underline;
-}
-body {
-	font: 12px tahoma, verdana, arial, sans-serif;
-	background-color: #182030;
-	scrollbar-3dlight-color:#FFD700; 
-	scrollbar-arrow-color:#FFFF00;
-	scrollbar-base-color:#FF6347;
-	scrollbar-darkshadow-color:#FFA500;
-	scrollbar-face-color:#7688AE;
-	scrollbar-highlight-color:#000;
-	scrollbar-shadow-color:#000
-}
-.indent{
-	margin: 5px;
-	padding: 10px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #000;
-	border-top: 1px solid #000;
-	border-left: 1px solid #000;
-	border-bottom: 1px solid #eee;
-	border-right: 1px solid #eee;
-	background-color: #6DA9F2;
-}
-.smalltext {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	letter-spacing: -1px;
-}
-td {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#222;
-	padding: 0px;
-	text-align:left;
-}
-.mediumtext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-}
-.captiontext {
-	letter-spacing: -1px;
-	font: 16px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#fff;
-	font-weight: bold;
-	padding:8px;	
-}
-
-.tbox{
-	border-left-color: #545454;
-	border-bottom-color: #545454;
-	font: 11px verdana,arial,helvetica,sans-serif;
-	color: #e7e7e7;
-	border-top-color: #545454;
-	background-color: #303030;
-	border-right-color: #545454;
-	text-indent:2px;
-}
-.button{
-	background: #303030;
-	font: 10px verdana,arial,helvetica,sans-serif;
-	color: #e7e7e7;
-	border-left-color: #545454;
-	border-bottom-color: #545454;
-	border-top-color: #545454;
-	border-right-color: #545454;
-	text-align:center;
-}
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding: 4px 0px 2px 4px;
-}
-hr {
-	border-top: #8CB6CE 1px solid;
-	border-bottom: #8CB6CE 1px solid;
-	height: 1px;
-	width: 100%;
-	padding:0px;
-	margin:-5px;
-}
-.border {
-	border: #000 1px solid;
-}
-.caption {
-	letter-spacing: -1px;
-	background-color: #7688AE;
-	font: 12px verdana, helvetica, sans-serif;
-	color: #000;
-	background-image : url(images/caption.png);
-	height:31px;
-	padding-left:4px;
-	padding-top:1px;
-}
-
-.caption2 {
-	letter-spacing: -1px;
-	background-color: #7688AE;
-	font: 11px verdana, helvetica, sans-serif;
-	color: #000;
-	background-image : url(images/caption3.png);
-	height:22px;
-	padding-left:4px;
-	padding-top:4px;
-	font-weight: bold;
-}
-
-.bodytable {
-	background-color: #016D9E;
-	padding-left:12px;
-	padding-right:12px;
-	padding-bottom:10px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#fff;
-}
-
-.bodytable2 {
-	background-color: #016D9E;
-	padding: 4px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#fff;
-}
-
-p {
-	margin-top: 0px
-}
-.nextprev {
-	letter-spacing: -1px;
-	background-color: #7688AE;
-	font: 12px verdana, helvetica, sans-serif;
-	color: #000;
-	background-image : url(images/caption.png);
-	padding:3px;
-	text-align:right;
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	background-image : url(images/cap1.png);
-	border: #000 1px solid;
-}
-.forumheader2{
-	background-color: #6B8EBD;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #45699B 1px solid;
-}
-.forumheader3{
-	background-color: #8A99AA;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #384350 1px solid;
-}
-.forumborder{
-	border: #000080 1px solid;
-}
-.fcaption {
-	border: #000 1px solid;
-	padding: 2px 0px 2px 8px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(images/fcap.png);
-	color:#fff;
-}
-.finfobar{
-	background-color: #324460;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #000 1px solid;
-//	background-image : url(../e107_images/forum/finfobar.png);
-}
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
-.helpbox {
-	border: transparent;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
-
-.box {
-	background-color: #075A81;
-	border-top: #0892D2 1px solid;
-	border-right: #033045 1px solid;
-	border-bottom: #033045 1px solid;
-	border-left: #0892D2 1px solid;
-	padding: 2px;
-}
-
-.box2 {
-	background-color: #687A93;
-	border-top: #BDC6D5 1px solid;
-	border-right: #313942 1px solid;
-	border-bottom: #313942 1px solid;
-	border-left: #BDC6D5 1px solid;
-	padding: 4px;
-}
-
-.linkbox {
-	background-color: #213142;
-	border: #000;
-	color: #CA9338;
-	text-align:center;
-	padding: 4px;
-}
-
-.shadow_left {
-	width: 7px;
-	background-image : url(images/shadow_left.png);
-}
-
-.shadow_right {
-	width: 7px;
-	background-image : url(images/shadow_right.png);
-}
-
-.shadow_middle {
-	width: 100%;
-	background-image : url(images/shadow_middle.png);
-	background-repeat: repeat-x;
-}
-
-.nforumholder {
-	border: 1px solid #345487;
-	padding: 0px;
-	background-color: #fff;
-}
-
-.nforumcaption {
-	background-image: url(images/nforumcaption.png);
-	padding: 8px 4px 8px 4px;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #fff;
-}
-
-.nforumcaption2 {
-	background-image: url(images/nforumcaption2.png);
-	padding: 8px 0px 8px 4px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-	font-weight: bold;
-}
-
-.nforumcaption3 {
-	border: 1px solid #45699B;
-	padding: 4px;
-	background-color: #6B8EBD;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumthread {
-	border: 1px solid #315175;
-	padding: 4px;
-	background-color: #7C9FC6;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumthread2 {
-	border: 1px solid #245388;
-	padding: 4px;
-	background-color: #3780D3;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumreplycaption {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #E2EDF2;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumreply {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #EDF4F7;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-
-.nforumreply2 {
-	border: 1px solid #fff;
-	padding: 4px;
-	background-color: #CFE0EB;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-}
-.nforumdisclaimer {
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#5d6e75;
-}
-
-.nforumview1 {
-	border: 1px solid #6188B3;
-	padding: 4px;
-	background-color: #9AB2CE;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-
-.nforumview2 {
-	border: 1px solid #617489;
-	padding: 4px;
-	background-color: #94A3B4;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #000;
-}
-
-.nforumview3 {
-	padding: 4px;
-	background-color: #BCD0ED;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #263448;
-}
-
-.nforumview4 {
-	padding: 4px;
-	background-color: #E4EAF2;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	color: #3A4F6C;
-}
\ No newline at end of file
diff -ruN 6171/e107_themes/soar/theme.js 75/e107_themes/soar/theme.js
--- 6171/e107_themes/soar/theme.js	2004-03-03 12:24:38.000000000 -0600
+++ 75/e107_themes/soar/theme.js	1969-12-31 18:00:00.000000000 -0600
@@ -1,126 +0,0 @@
-var fadeTo = "ff0000";
-var fiBy = 6;
-var foBy = 6;
-var speed = 20;
-var ignoreClass = "ignore";
-var opera, ie, dom, x = 0, oc, fader, ocs = new Array();
-
-if (navigator.userAgent.indexOf("Opera") != -1) opera = true
-else if (document.all && !opera) ie = true
-else if (!document.all && document.getElementById) dom = true;
-
-function convertRGB(z)
-	{
-		var newfcS = "", splitter = "";
-		splitter = z.split(",");
-		splitter[0] = parseInt(splitter[0].substring(4, splitter[0].length));
-		splitter[1] = parseInt(splitter[1]);
-		splitter[2] = parseInt(splitter[2].substring(0, splitter[2].length-1));
-		for (var q = 0; q < 3; q++)
-			{
-				splitter[q] = splitter[q].toString(16);
-				if (splitter[q].length == 1) splitter[q] = "0" + splitter[q];
-				newfcS += splitter[q];
-			}
-		return newfcS;
-	}
-
-function currentColour(index)
-	{
-		var temp, cc;
-		if (opera) cc = document.links[index].style.color
-		else if (ie) cc = document.links[index].currentStyle.color
-		else if (dom) cc = document.defaultView.getComputedStyle(document.links[index], '').getPropertyValue("color");
-		if (cc.length == 4 && cc.substring(0, 1) == "#")
-			{
-				temp = "";
-				for (var a = 0; a < 3; a++)
-					temp += cc.substring(a+1, a+2) + cc.substring(a+1, a+2);
-				cc = temp;
-			}
-		else if (cc.indexOf("rgb") != -1) cc = convertRGB(cc)
-		else if (cc.length == 7) cc = cc.substring(1, 7)
-		else cc = fadeTo;
-		return cc;
-	}
-
-
-function convert2Dec(hex)
-	{	
-		var rgb = new Array();
-		for (var u = 0; u < 3; u++)
-			rgb[u] = parseInt(hex.substring(u*2, u*2+2), 16);
-		return rgb;
-	}
-
-function newRGB(f, n, d)
-	{
-		var change;
-		if (d == 1) change = fiBy
-		else change = foBy;
-		for (var g = 0; g < 3; g++)
-			{
-				if (n[g] > f[g] && n[g] - change >= 0) n[g] -= change;
-				if (n[g] < f[g] && n[g] + change <= 255) n[g] += change;
-			}
-		return n;
-	}
-
-function fade(index, d)
-	{
-		var fc, nc, temp = new Array(), finished = false;
-		nc = convert2Dec(currentColour(index));
-		if (d == 1) fc = convert2Dec(fadeTo)
-		else fc = convert2Dec(ocs[x]);
-		temp = convert2Dec(currentColour(index));
-		nc = newRGB(fc, nc, d);
-		if ((nc[0] == temp[0]) && (nc[1] == temp[1]) && (nc[2] == temp[2]))
-			finished = true;
-		if (!finished) document.links[x].style.color = "rgb(" + nc[0] + "," + nc[1] + "," + nc[2] + ")"
-		else clearInterval(fader);
-	}
-
-function findLink(over)
-	{
-		if (document.layers) return;
-		if (fader)
-			{
-				clearInterval(fader);
-				document.links[x].style.color = "#" + ocs[x];
-			}
-		if (over && !this.id) this.id = over;
-		x = 0;
-		while (!(this.id == document.links[x].id) && (x < document.links.length))
-			x++;
-		if (this.id == document.links[x].id)
-			{
-				oc = currentColour(x);
-				fader = setInterval("fade(" + x  + ", 1)", speed);
-			}
-	}
-
-function clearFade()
-	{
-		if (document.layers) return;
-		if (fader) clearInterval(fader);
-		fader = setInterval("fade(" + x + ", 0)", speed);
-	}
-
-function init()
-	{
-		for (var i = 0; i < document.links.length; i++)
-			{
-				ocs[i] = currentColour(i);
-				var currentOver = document.links[i].onmouseover;
-				var currentOut = document.links[i].onmouseout;
-				var ignoreIt = document.links[i].className == ignoreClass;
-				if (!ignoreIt) document.links[i].id = "link" + i;
-				if (!currentOver && !currentOut && !ignoreIt)
-					{
-						document.links[i].onmouseover = findLink;
-						document.links[i].onmouseout = clearFade;
-					}
-			}		
-}
-
-if (opera || ie || dom) window.onload = init;
\ No newline at end of file
diff -ruN 6171/e107_themes/soar/theme.php 75/e107_themes/soar/theme.php
--- 6171/e107_themes/soar/theme.php	2004-07-12 08:33:04.000000000 -0500
+++ 75/e107_themes/soar/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,197 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107.v4 theme file 
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "soar";
-$themeversion = "1.0";
-$themeauthor = "jalist";
-$themedate = "18/01/2004";
-$themeinfo = "To alter the height of the layer on the news page, edit line 70 of theme.php (height: 500px)";
-
-define("THEME_DISCLAIMER", "<br /><i>'soar'</i> theme by jalist");
-
-// [layout]
-$layout = "_default";
-
-$HEADER = 
-"<div style='text-align:center'>
-<table style='width:751px' cellspacing='0' cellpadding='0'>
-<tr>
-<td><img src='".THEME."images/logo.jpg' alt='' /></td>
-</tr>
-</table>
-<table style='width:750px' cellspacing='0' cellpadding='0'>
-<tr>
-<td class='box' style='width:750px;'>
-<table style='width:100%' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='50%'>
-{CUSTOM=clock}
-</td>
-<td style='50%; text-align:right'>
-{CUSTOM=search}
-</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<table style='width:751px; background-color:#A5A5A9' cellspacing='10' cellpadding='0'>
-<tr>
-<td colspan='2'>
-{SITELINKS=flat}
-</td>
-</tr>
-<tr>
-<td style='width:201px; vertical-align: top;'>
-{SETSTYLE=leftmenu}
-{MENU=1}
-</td>
-{SETSTYLE=default}
-<td style='width:550px; vertical-align: top;'>
-";
-
-$FOOTER = "
-</td>
-</tr>
-<tr>
-<td class='box2' colspan='3' style='text-align:center'>
-<div class='linkbox'>
-{SITEDISCLAIMER}
-</div>
-</td>
-</tr>
-</table>
-</div>
-";
-
-
-$CUSTOMHEADER = 
-"<div style='text-align:center'>
-<table style='width:751px' cellspacing='0' cellpadding='0'>
-<tr>
-<td><img src='".THEME."images/logo.jpg' alt='' /></div></td>
-</tr>
-</table>
-<table style='width:751px' cellspacing='0' cellpadding='0'>
-<tr>
-<td class='box' style='width:750px;'>
-<table style='width:100%' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='50%'>
-{CUSTOM=clock}
-</td>
-<td style='50%; text-align:right'>
-{CUSTOM=search}
-</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<table style='width:751px; background-color:#A5A5A9' cellspacing='10' cellpadding='0'>
-<tr>
-<td>
-{SITELINKS=flat}
-</td>
-</tr>
-<tr>
-{SETSTYLE=default}
-<td style='width:751px; vertical-align: top;'>
-";
-
-
-
-
-
-$CUSTOMPAGES = "forum.php forum_post.php forum_viewforum.php forum_viewtopic.php stats.php user.php links.php subcontent.php submitnews.php download.php search.php chat.php comment.php usersettings.php fpw.php";
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-
-<table class='border' style='width:100%' cellpadding='0' cellspacing='0'>
-<tr>
-<td colspan='3' class='caption'>
-{NEWSTITLE}
-</td>
-</tr>
-
-<tr>
-<td class='shadow_left'><img src='".THEME."images/blank.gif' width='7' height='21' alt='' style='display: block;' /></td>
-<td class='shadow_middle'></td>
-<td class='shadow_right'><img src='".THEME."images/blank.gif' width='7' height='21' alt='' style='display: block;' /></td>
-</tr>
-
-<tr>
-<td colspan='3' class='bodytable'>
-{NEWSICON}
-{NEWSBODY}
-{EXTENDED}
-<br />
-<br />
-<div class='mediumtext' style='text-align:right'>
-<b>
-{NEWSAUTHOR}
-</b>
-<br />
-{NEWSDATE}
-<br />
-{NEWSCOMMENTS}
-<br />
-{EMAILICON}
-{PRINTICON}
-</div></td>
-</tr>
-</table>
-<br />
-";
-
-define("ICONSTYLE", "border:0; vertical-align:middle");
-define("COMMENTLINK", "Read/Post Comment: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-
-define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
-define("EXTENDEDSTRING", "Read the rest ...");
-define("POST_EXTENDEDSTRING", " ]<br />");
-
-
-// [linkstyle]
-
-define(PRELINK, "<div class='linkbox'>| ");
-define(POSTLINK, "</div>");
-define(LINKSTART, "");
-//define(LINKEND, "<br /><img style='margin-top: 2px; margin-bottom: 2px;' width='190' height='1' src='".THEME."images/hr.png'><br />");
-define(LINKEND, " | ");
-define(LINKALIGN, "center");
-
-//	[tablestyle]
-
-function tablestyle($caption, $text){
-	global $style;
-	if($style == "leftmenu"){
-		echo"<table class='border' style='width:100%' cellpadding='0' cellspacing='0'><tr><td class='caption2' style='whitespace:nowrap'>$caption</td></tr><tr><td class='bodytable2'>$text</td></tr></table><br />";
-	}else{
-		echo "<table class='border' style='width:100%' cellpadding='0' cellspacing='0'>\n<tr>\n<td colspan='3' class='caption'>$caption</td>\n</tr><tr>\n<td class='shadow_left'><img src='".THEME."images/blank.gif' width='7' height='21' alt='' style='display: block;' /></td>\n<td class='shadow_middle'></td>\n<td class='shadow_right'><img src='".THEME."images/blank.gif' width='7' height='21' alt='' style='display: block;' /></td>\n</tr>\n<tr>\n<td colspan='3' class='bodytable'>\n$text\n</td>\n</tr>\n</table>";	
-	}
-}
-
-// Forum design
-if(strstr(e_SELF,"forum.php")||strstr(e_SELF,"forum_post.php")||strstr(e_SELF,"forum_viewforum.php")||strstr(e_SELF,"forum_viewtopic.php")){
-	@require_once("forum_design.php");
-}
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/admin_template.php 75/e107_themes/templates/admin_template.php
--- 6171/e107_themes/templates/admin_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/admin_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -0,0 +1,57 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/admin_template.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2005/12/14 19:28:53 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$ADMIN_HEADER = "<div style='text-align:center'>
+{ADMIN_LOGO}
+<br />
+{ADMIN_LOGGED}
+{ADMIN_SEL_LAN}
+{ADMIN_USERLAN}
+</div>
+<table style='width:100%' cellspacing='10' cellpadding='10'>
+<tr>
+<td style='width:17%; vertical-align: top;'>
+{ADMIN_NAV}
+{ADMIN_LANG}
+{ADMIN_PWORD}
+{ADMIN_STATUS=request}
+{ADMIN_LATEST=request}
+{ADMIN_LOG=request}
+{ADMIN_HELP}
+{ADMIN_MSG}
+{ADMIN_PLUGINS}
+</td>
+<td style='width:62%; vertical-align: top;'>
+";
+
+$ADMIN_FOOTER = "</td>
+<td style='width:17%; vertical-align:top'>
+{ADMIN_MENU}
+{ADMIN_PRESET}
+{ADMIN_SITEINFO}
+{ADMIN_DOCS}
+</td>
+</tr>
+</table>
+{ADMIN_CREDITS}
+";
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/banner_template.php 75/e107_themes/templates/banner_template.php
--- 6171/e107_themes/templates/banner_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/banner_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -0,0 +1,83 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### LOGIN TABLE -------------------------------------------------------------------------------
+if(!$BANNER_LOGIN_TABLE){
+		$BANNER_LOGIN_TABLE = "
+		<div style='align:center'>\n
+		<form method='post' action='".e_SELF."'>\n
+		<table style='width:40%'>
+		<tr>
+			<td style='width:15%' class='defaulttext'>".LAN_16."</td>
+			<td>{BANNER_LOGIN_TABLE_LOGIN}\n</td>
+		</tr>
+		<tr>
+			<td style='width:15%' class='defaulttext'>".LAN_17."</td>
+			<td>{BANNER_LOGIN_TABLE_PASSW}\n</td>
+		</tr>
+		<tr>
+			<td style='width:15%'></td>
+			<td>{BANNER_LOGIN_TABLE_SUBMIT}</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+
+}
+// ##### ------------------------------------------------------------------------------------------
+
+// ##### BANNER TABLE -----------------------------------------------------------------------------
+if(!$BANNER_TABLE_START){
+		$BANNER_TABLE_START = "
+		<table class='fborder' style='width:98%; border:1px solid #000' border='1'>
+		<tr><td colspan='7' style='text-align:center' class='fcaption'>".LAN_21."</td></tr>
+		<tr>
+			<td class='forumheader' style='text-align:center'>".LAN_22."</td>
+			<td class='forumheader' style='text-align:center'>".LAN_23."</td>
+			<td class='forumheader' style='text-align:center'>".LAN_24."</td>
+			<td class='forumheader' style='text-align:center'>".LAN_25."</td>
+			<td class='forumheader' style='text-align:center'>".LAN_26."</td>
+			<td class='forumheader' style='text-align:center'>".LAN_27."</td>
+			<td class='forumheader' style='text-align:center'>".LAN_28."</td>
+		</tr>";
+}
+if(!$BANNER_TABLE){
+		$BANNER_TABLE = "
+		<tr>
+			<td class='forumheader3' style='text-align:center'>{BANNER_TABLE_CLIENTNAME}</td>
+			<td class='forumheader3' style='text-align:center'>{BANNER_TABLE_BANNER_ID}</td>
+			<td class='forumheader3' style='text-align:center'>{BANNER_TABLE_BANNER_CLICKS}</td>
+			<td class='forumheader3' style='text-align:center'>{BANNER_TABLE_CLICKPERCENTAGE}</td>
+			<td class='forumheader3' style='text-align:center'>{BANNER_TABLE_BANNER_IMPRESSIONS}</td>
+			<td class='forumheader3' style='text-align:center'>{BANNER_TABLE_IMPRESSIONS_PURCHASED}</td>
+			<td class='forumheader3' style='text-align:center'>{BANNER_TABLE_IMPRESSIONS_LEFT}</td>
+		</tr>
+		<tr>
+			<td class='forumheader3' style='text-align:center'>&nbsp;</td>
+			<td colspan='2' class='forumheader3' style='text-align:center'>{BANNER_TABLE_ACTIVE}</td>
+			<td colspan='4' class='forumheader3' style='text-align:center'>{BANNER_TABLE_STARTDATE} {BANNER_TABLE_ENDDATE}</td>";
+
+			if($BANNER_TABLE_IP){
+				$BANNER_TABLE .= "
+				</tr>
+				<tr>
+					<td class='forumheader3'>".LAN_35.": {BANNER_TABLE_IP_LAN}</td>
+					<td colspan='6' class='forumheader3'>{BANNER_TABLE_IP}</td>";
+			}
+
+		$BANNER_TABLE .= "
+		</tr>
+		<tr><td colspan='7'>&nbsp;</td></tr>";
+}
+if(!$BANNER_TABLE_END){
+		$BANNER_TABLE_END = "
+		</table>";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/comment_template.php 75/e107_themes/templates/comment_template.php
--- 6171/e107_themes/templates/comment_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/comment_template.php	2006-01-12 20:58:23.000000000 -0600
@@ -0,0 +1,89 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/comment_template.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2006/01/13 02:58:23 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $sc_style, $comment_shortcodes;
+global $pref, $comrow, $row2, $tp, $NEWIMAGE, $USERNAME, $RATING;
+
+$sc_style['SUBJECT']['pre'] = "<b>";
+$sc_style['SUBJECT']['post'] = "</b>";
+
+$sc_style['USERNAME']['pre'] = "<b>";
+$sc_style['USERNAME']['post'] = "</b>";
+
+$sc_style['TIMEDATE']['pre'] = "";
+$sc_style['TIMEDATE']['post'] = "";
+
+$sc_style['REPLY']['pre'] = "";
+$sc_style['REPLY']['post'] = "";
+
+$sc_style['AVATAR']['pre'] = "<div class='spacer'>";
+$sc_style['AVATAR']['post'] = "</div>";
+
+$sc_style['COMMENTS']['pre'] = "";
+$sc_style['COMMENTS']['post'] = "<br />";
+
+$sc_style['JOINED']['pre'] = "";
+$sc_style['JOINED']['post'] = "<br />";
+
+$sc_style['COMMENT']['pre'] = "";
+$sc_style['COMMENT']['post'] = "<br />";
+
+$sc_style['RATING']['pre'] = "";
+$sc_style['RATING']['post'] = "<br />";
+
+$sc_style['IPADDRESS']['pre'] = "";
+$sc_style['IPADDRESS']['post'] = "<br />";
+
+$sc_style['LEVEL']['pre'] = "";
+$sc_style['LEVEL']['post'] = "<br />";
+
+$sc_style['LOCATION']['pre'] = "";
+$sc_style['LOCATION']['post'] = "<br />";
+
+$sc_style['SIGNATURE']['pre'] = "";
+$sc_style['SIGNATURE']['post'] = "<br />";
+
+
+$COMMENTSTYLE = "
+<table class='fborder' style='width:100%;'>
+<tr>
+	<td colspan='2' class='forumheader'>
+		{SUBJECT} {USERNAME} {TIMEDATE} {REPLY} {COMMENTEDIT}
+	</td>
+</tr>
+<tr>
+	<td style='width:30%; vertical-align:top;'>
+		{AVATAR}<span class='smalltext'>{COMMENTS}{JOINED}</span>
+	</td>
+	<td style='width:70%; vertical-align:top;'>
+		{COMMENT}
+		{RATING}
+		{IPADDRESS}
+		{LEVEL}
+		{LOCATION}
+		{SIGNATURE}
+	</td>
+</tr>
+</table>
+<br />";
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/contact_template.php 75/e107_themes/templates/contact_template.php
--- 6171/e107_themes/templates/contact_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/contact_template.php	2006-05-01 18:58:47.000000000 -0500
@@ -0,0 +1,54 @@
+<?php
+// $Id: contact_template.php,v 1.3 2006/05/01 23:58:47 mcfly_e107 Exp $
+
+if (!defined('e107_INIT')) { exit; }
+
+if(!$CONTACT_INFO){
+  $CONTACT_INFO = "
+	<table style='width:97%' cellpadding='1' cellspacing='7'>
+	<tr>
+		<td>{SITECONTACTINFO}
+		<br />
+		</td>
+	</tr>
+	</table>";
+}
+
+// This must be defined outside $CONTACT_FORM so it can be turned off depending on the $pref
+if(!$CONTACT_EMAIL_COPY)
+{
+	$CONTACT_EMAIL_COPY = "
+	<tr><td>
+	<input type='checkbox' name='email_copy'  value='1'  />
+	".LANCONTACT_07."
+	</td></tr>
+	";
+}	
+
+if(!$CONTACT_FORM){
+  $CONTACT_FORM = "
+	<form action='".e_SELF."' method='post' id='contactForm' >
+	<table style='width:97%' cellpadding='1' cellspacing='7'>
+	<tr><td>".LANCONTACT_03."<br />
+	<input type='text' name='author_name' size='30' class='tbox' value='' />
+	</td></tr>
+	<tr><td>".LANCONTACT_04."<br />
+	<input type='text' name='email_send' size='30' class='tbox' value='".USEREMAIL."' />
+	</td></tr>
+	<tr><td>
+	".LANCONTACT_05."<br />
+	<input type='text' name='subject' size='30' class='tbox' value='' />
+	</td></tr>{$CONTACT_EMAIL_COPY}
+	<tr><td>
+    ".LANCONTACT_06."<br />
+	<textarea cols='50' rows='10' name='body' class='tbox'></textarea>
+	</td></tr>
+	<tr><td>
+	<input type='submit' name='send-contactus' value=\"".LANCONTACT_08."\" class='button' />
+	</td></tr>
+	</table>
+	</form>";
+}
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/content_template.php 75/e107_themes/templates/content_template.php
--- 6171/e107_themes/templates/content_template.php	2004-07-12 09:13:28.000000000 -0500
+++ 75/e107_themes/templates/content_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -1,177 +1,195 @@
-<?php
-
-// ##### CATEGORY TABLE ---------------------------------------------------------------------------
-if(!$CONTENT_CATEGORY_TABLE_START){
-		$CONTENT_CATEGORY_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' style='width:95%'>\n";
-}
-if(!$CONTENT_CATEGORY_TABLE){   
-		$CONTENT_CATEGORY_TABLE .= "
-		<tr>
-		<td class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center' rowspan='2'>
-			{CONTENT_CATEGORY_ICON}
-		</td>
-		<td class='forumheader' style='width:90%'>
-			{CONTENT_CATEGORY_HEADING}
-		</td>
-		</tr>
-		<tr>
-		<td class='forumheader3'>
-			{CONTENT_CATEGORY_SUBHEADING}
-			<span class='smalltext'>(
-				{CONTENT_CATEGORY_NUMBER}
-			)</span>
-		</td>
-		</tr>\n";
-}
-if(!$CONTENT_CATEGORY_TABLE_END){
-		$CONTENT_CATEGORY_TABLE_END = "
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
-// ##### RECENT LIST ------------------------------------------------------------------------------
-if(!$CONTENT_RECENT_TABLE_START){
-		$CONTENT_RECENT_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' style='width:95%'>\n";
-}
-if(!$CONTENT_RECENT_TABLE){   
-		$CONTENT_RECENT_TABLE .= "
-		<tr>
-		<td rowspan='2' class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center'>
-			{CONTENT_RECENT_ICON}
-		</td>
-		<td class='forumheader' style='width:90%'>
-			{CONTENT_RECENT_HEADING}
-		</td>
-		</tr>
-		<tr>
-		<td class='forumheader3' style='line-height:130%;'>
-			{CONTENT_RECENT_SUBHEADING}
-			{CONTENT_RECENT_SUMMARY}
-			{CONTENT_RECENT_AUTHOR}, {CONTENT_RECENT_DATE}<br />
-			{CONTENT_RECENT_RATING}
-		</td>
-		</tr>\n";
-}
-if(!$CONTENT_RECENT_TABLE_END){
-		$CONTENT_RECENT_TABLE_END = "
-		<tr>
-			<td colspan='2'>
-			<div style='text-align:right'><a href='".e_SELF."?article'><< ".LAN_37."</a></div>
-			</td>
-		</tr>		
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
-// ##### ARCHIVE ----------------------------------------------------------------------------------
-if(!$CONTENT_ARCHIVE_TABLE_START){
-		$CONTENT_ARCHIVE_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' style='width:95%'>\n";
-}
-if(!$CONTENT_ARCHIVE_TABLE){
-		$CONTENT_ARCHIVE_TABLE = "
-		<tr>
-			<td class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center'>
-				{CONTENT_ARCHIVE_ICON}
-			</td>
-			<td class='forumheader' style='width:90%'>
-				{CONTENT_ARCHIVE_HEADING}
-				({CONTENT_ARCHIVE_DATESTAMP})
-			</td>
-		</tr>
-		";
-}
-if(!$CONTENT_ARCHIVE_TABLE_END){
-		$CONTENT_ARCHIVE_TABLE_END = "
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
-// ##### ARTICLE ----------------------------------------------------------------------------------
-if(!$CONTENT_ARTICLE_TABLE_START){
-		$CONTENT_ARTICLE_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' style='width:95%' border='0'>\n";
-}
-if(!$CONTENT_ARTICLE_TABLE){
-		$CONTENT_ARTICLE_TABLE = "
-		<tr>
-			<td rowspan='3' style='width:5%; white-space:nowrap;'>
-				{CONTENT_ARTICLE_CAT_ICON}
-			</td>
-			<td>
-				{CONTENT_ARTICLE_HEADING}
-			</td>
-		</tr>
-		<tr>
-			<td>
-				{CONTENT_ARTICLE_SUBHEADING}
-			</td>
-		</tr>
-		<tr>
-			<td>
-				{CONTENT_ARTICLE_AUTHOR} {CONTENT_ARTICLE_DATESTAMP}<br /><br />
-			</td>
-		</tr>
-		<tr>
-			<td colspan='2'>
-				{CONTENT_ARTICLE_CONTENT}<br />
-				{CONTENT_ARTICLE_PAGES}<br />
-			</td>
-		</tr>
-		<tr>
-			<td colspan='2' style='text-align:right'>
-				{CONTENT_ARTICLE_EMAILPRINT}
-			</td>
-		</tr>
-		<tr>
-			<td colspan='2' style='text-align:right'>
-				{CONTENT_ARTICLE_LINK_CAT}<br />
-				{CONTENT_ARTICLE_LINK_MAIN}
-			</td>
-		</tr>
-		";
-}
-if(!$CONTENT_ARTICLE_TABLE_END){
-		$CONTENT_ARTICLE_TABLE_END = "
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
-// ##### ARTICLE RATING ---------------------------------------------------------------------------
-if(!$CONTENT_ARTICLE_RATING_TABLE_START){
-		$CONTENT_ARTICLE_RATING_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' style='width:95%'>\n";
-}
-if(!$CONTENT_ARTICLE_RATING_TABLE){
-		$CONTENT_ARTICLE_RATING_TABLE = "
-		<tr>
-			<td>
-				{CONTENT_ARTICLE_RATING}
-			</td>
-		</tr>
-		";
-}
-if(!$CONTENT_ARTICLE_RATING_TABLE_END){
-		$CONTENT_ARTICLE_RATING_TABLE_END = "
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/content_template.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:53 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// ##### CATEGORY TABLE ---------------------------------------------------------------------------
+if(!$CONTENT_CATEGORY_TABLE_START){
+                $CONTENT_CATEGORY_TABLE_START = "
+                <div style='text-align:center'>
+                <table class='fborder' style='width:95%'>\n";
+}
+if(!$CONTENT_CATEGORY_TABLE){
+                $CONTENT_CATEGORY_TABLE .= "
+                <tr>
+                <td class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center' rowspan='2'>
+                        {CONTENT_CATEGORY_ICON}
+                </td>
+                <td class='forumheader' style='width:90%'>
+                        {CONTENT_CATEGORY_HEADING}
+                </td>
+                </tr>
+                <tr>
+                <td class='forumheader3'>
+                        {CONTENT_CATEGORY_SUBHEADING}
+                        <span class='smalltext'>(
+                                {CONTENT_CATEGORY_NUMBER}
+                        )</span>
+                </td>
+                </tr>\n";
+}
+if(!$CONTENT_CATEGORY_TABLE_END){
+                $CONTENT_CATEGORY_TABLE_END = "
+                </table>
+                </div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+// ##### RECENT LIST ------------------------------------------------------------------------------
+if(!$CONTENT_RECENT_TABLE_START){
+                $CONTENT_RECENT_TABLE_START = "
+                <div style='text-align:center'>
+                <table class='fborder' style='width:95%'>\n";
+}
+if(!$CONTENT_RECENT_TABLE){
+                $CONTENT_RECENT_TABLE .= "
+                <tr>
+                <td rowspan='2' class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center'>
+                        {CONTENT_RECENT_ICON}
+                </td>
+                <td class='forumheader' style='width:90%'>
+                        {CONTENT_RECENT_HEADING}
+                </td>
+                </tr>
+                <tr>
+                <td class='forumheader3' style='line-height:130%;'>
+                        {CONTENT_RECENT_SUBHEADING}
+                        {CONTENT_RECENT_SUMMARY}
+                        {CONTENT_RECENT_AUTHOR}, {CONTENT_RECENT_DATE}<br />
+                        {CONTENT_RECENT_RATING}
+                </td>
+                </tr>\n";
+}
+if(!$CONTENT_RECENT_TABLE_END){
+                $CONTENT_RECENT_TABLE_END = "
+                <tr>
+                        <td colspan='2'>
+                        <div style='text-align:right'><a href='".e_SELF."?article'><< ".LAN_37."</a></div>
+                        </td>
+                </tr>
+                </table>
+                </div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+// ##### ARCHIVE ----------------------------------------------------------------------------------
+if(!$CONTENT_ARCHIVE_TABLE_START){
+                $CONTENT_ARCHIVE_TABLE_START = "
+                <div style='text-align:center'>
+                <table class='fborder' style='width:95%'>\n";
+}
+if(!$CONTENT_ARCHIVE_TABLE){
+                $CONTENT_ARCHIVE_TABLE = "
+                <tr>
+                        <td class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center'>
+                                {CONTENT_ARCHIVE_ICON}
+                        </td>
+                        <td class='forumheader' style='width:90%'>
+                                {CONTENT_ARCHIVE_HEADING}
+                                ({CONTENT_ARCHIVE_DATESTAMP})
+                        </td>
+                </tr>
+                ";
+}
+if(!$CONTENT_ARCHIVE_TABLE_END){
+                $CONTENT_ARCHIVE_TABLE_END = "
+                </table>
+                </div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+// ##### ARTICLE ----------------------------------------------------------------------------------
+if(!$CONTENT_ARTICLE_TABLE_START){
+                $CONTENT_ARTICLE_TABLE_START = "
+                <div style='text-align:center'>
+                <table class='fborder' style='width:95%' border='0'>\n";
+}
+if(!$CONTENT_ARTICLE_TABLE){
+                $CONTENT_ARTICLE_TABLE = "
+                <tr>
+                        <td rowspan='3' style='width:5%; white-space:nowrap;'>
+                                {CONTENT_ARTICLE_CAT_ICON}
+                        </td>
+                        <td>
+                                {CONTENT_ARTICLE_HEADING}
+                        </td>
+                </tr>
+                <tr>
+                        <td>
+                                {CONTENT_ARTICLE_SUBHEADING}
+                        </td>
+                </tr>
+                <tr>
+                        <td>
+                                {CONTENT_ARTICLE_AUTHOR} {CONTENT_ARTICLE_DATESTAMP}<br /><br />
+                        </td>
+                </tr>
+                <tr>
+                        <td colspan='2'>
+                                {CONTENT_ARTICLE_CONTENT}<br />
+                                {CONTENT_ARTICLE_PAGES}<br />
+                        </td>
+                </tr>
+                <tr>
+                        <td colspan='2' style='text-align:right'>
+                                {CONTENT_ARTICLE_EMAILPRINT}
+                        </td>
+                </tr>
+                <tr>
+                        <td colspan='2' style='text-align:right'>
+                                {CONTENT_ARTICLE_LINK_CAT}<br />
+                                {CONTENT_ARTICLE_LINK_MAIN}
+                        </td>
+                </tr>
+                ";
+}
+if(!$CONTENT_ARTICLE_TABLE_END){
+                $CONTENT_ARTICLE_TABLE_END = "
+                </table>
+                </div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+// ##### ARTICLE RATING ---------------------------------------------------------------------------
+if(!$CONTENT_ARTICLE_RATING_TABLE_START){
+                $CONTENT_ARTICLE_RATING_TABLE_START = "
+                <div style='text-align:center'>
+                <table class='fborder' style='width:95%'>\n";
+}
+if(!$CONTENT_ARTICLE_RATING_TABLE){
+                $CONTENT_ARTICLE_RATING_TABLE = "
+                <tr>
+                        <td>
+                                {CONTENT_ARTICLE_RATING}
+                        </td>
+                </tr>
+                ";
+}
+if(!$CONTENT_ARTICLE_RATING_TABLE_END){
+                $CONTENT_ARTICLE_RATING_TABLE_END = "
+                </table>
+                </div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/download_template.php 75/e107_themes/templates/download_template.php
--- 6171/e107_themes/templates/download_template.php	2004-08-04 08:45:08.000000000 -0500
+++ 75/e107_themes/templates/download_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -1,228 +1,328 @@
-<?php
-
-// ##### CAT TABLE --------------------------------------------------------------------------------
-if(!$DOWNLOAD_CAT_TABLE_START){
-		$DOWNLOAD_CAT_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' style='width:95%'>\n
-		<tr>
-		<td style='width:3%; text-align:center' class='fcaption'>&nbsp;</td>
-		<td style='width:60%; text-align:center' class='fcaption'>".LAN_dl_19."</td>
-		<td style='width:10%; text-align:center' class='fcaption'>".LAN_dl_20."</td>
-		<td style='width:17%; text-align:center' class='fcaption'>".LAN_dl_21."</td>
-		<td style='width:10%; text-align:center' class='fcaption'>".LAN_dl_18."</td>
-		</tr>";
-}
-if(!$DOWNLOAD_CAT_PARENT_TABLE){   
-
-		$DOWNLOAD_CAT_PARENT_TABLE .= "
-		<tr>
-		<td colspan='5' class='forumheader3' style='text-align:left; font-weight:bold;'>
-			{DOWNLOAD_CAT_MAIN_ICON} {DOWNLOAD_CAT_MAIN_NAME}
-		</td>
-		</tr>";
-}
-
-if(!$DOWNLOAD_CAT_CHILD_TABLE){   
-
-		$DOWNLOAD_CAT_CHILD_TABLE .= "
-		<tr>
-		<td class='forumheader3'>
-			{DOWNLOAD_CAT_SUB_ICON}
-		</td>
-		<td class='forumheader3'>
-			{DOWNLOAD_CAT_SUB_NEW_ICON} {DOWNLOAD_CAT_SUB_NAME}<br />
-			<span class='smalltext'>
-			{DOWNLOAD_CAT_SUB_DESCRIPTION}
-			</span>";
-
-			if($DOWNLOAD_CAT_SUBSUB_NAME){
-				$DOWNLOAD_CAT_CHILD_TABLE .= "
-				<br /><span class='defaulttext'>
-				{DOWNLOAD_CAT_SUBSUB_LAN}
-				{DOWNLOAD_CAT_SUBSUB_NAME}
-				</span>";
-			}
-
-		$DOWNLOAD_CAT_CHILD_TABLE .= "
-		</td>
-		<td class='forumheader3' style='text-align:center;'>
-			{DOWNLOAD_CAT_SUB_COUNT}
-		</td>
-		<td class='forumheader3' style='text-align:center;'>
-			{DOWNLOAD_CAT_SUB_SIZE}
-		</td>
-		<td class='forumheader3' style='text-align:center;'>
-			{DOWNLOAD_CAT_SUB_DOWNLOADED}
-		</td>
-		</tr>";
-
-}
-if(!$DOWNLOAD_CAT_TABLE_END){
-		$DOWNLOAD_CAT_TABLE_END = "
-		<tr><td class='forumheader3' colspan='5' style='text-align:right;'>{DOWNLOAD_CAT_NEWDOWNLOAD_TEXT}</td></tr>
-		<tr><td class='forumheader3' colspan='5' style='text-align:right;'>{DOWNLOAD_CAT_SEARCH}</td></tr>
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
-
-// ##### LIST TABLE -------------------------------------------------------------------------------
-if(!$DOWNLOAD_LIST_TABLE_START){
-
-		$DOWNLOAD_LIST_TABLE_START = "
-		<div style='text-align:center'>
-		<form method='post' action='".e_SELF."?".e_QUERY."'>
-		<table class='fborder' style='width:95%'>\n
-		<tr>
-        <td colspan='7' style='text-align:center' class='forumheader'>
-			<span class='defaulttext'>".LAN_dl_37."</span>
-			<select name='view' class='tbox'>".
-			($view == 5 ? "<option selected='selected'>5</option>" : "<option>5</option>").
-			($view == 10 ? "<option selected='selected'>10</option>" : "<option>10</option>").
-			($view == 15 ? "<option selected='selected'>15</option>" : "<option>15</option>").
-			($view == 20 ? "<option selected='selected'>20</option>" : "<option>20</option>").
-			($view == 50 ? "<option selected='selected'>50</option>" : "<option>50</option>")."
-			</select>
-			&nbsp;
-			<span class='defaulttext'>".LAN_dl_38."</span>
-			<select name='order' class='tbox'>".
-			($order == "download_datestamp" ? "<option value='download_datestamp' selected='selected'>".LAN_dl_22."</option>" : "<option value='download_datestamp'>".LAN_dl_22."</option>").
-			($order == "download_requested" ? "<option value='download_requested' selected='selected'>".LAN_dl_18."</option>" : "<option value='download_requested'>".LAN_dl_18."</option>").
-			($order == "download_name" ? "<option value='download_name' selected='selected'>".LAN_dl_23."</option>" : "<option value='download_name'>".LAN_dl_23."</option>").
-			($order == "download_author" ? "<option value='download_author' selected='selected'>".LAN_dl_24."</option>" : "<option value='download_author'>".LAN_dl_24."</option>")."
-			</select>
-			&nbsp;
-			<span class='defaulttext'>".LAN_dl_39."</span>
-			<select name='sort' class='tbox'>".
-			($sort == "ASC" ? "<option value='ASC' selected='selected'>".LAN_dl_25."</option>" : "<option value='ASC'>".LAN_dl_25."</option>").
-			($sort == "DESC" ? "<option value='DESC' selected='selected'>".LAN_dl_26."</option>" : "<option value='DESC'>".LAN_dl_26."</option>")."
-			</select>
-			&nbsp;
-			<input class='button' type='submit' name='goorder' value='".LAN_dl_27."' />
-        </td>
-		</tr>
-        <tr>
-        <td style='width:35%; text-align:center' class='fcaption'>".LAN_dl_28."</td>
-        <td style='width:15%; text-align:center' class='fcaption'>".LAN_dl_22."</td>
-        <td style='width:20%; text-align:center' class='fcaption'>".LAN_dl_24."</td>
-        <td style='width:10%; text-align:center' class='fcaption'>".LAN_dl_21."</td>
-        <td style='width:5%; text-align:center' class='fcaption'>".LAN_dl_29."</td>
-        <td style='width:10%; text-align:center' class='fcaption'>".LAN_dl_12."</td>
-        <td style='width:5%; text-align:center' class='fcaption'>".LAN_dl_8."</td>
-        </tr>";
-		
-}
-
-if(!$DOWNLOAD_LIST_TABLE){   
-		$DOWNLOAD_LIST_TABLE .= "
-		<tr>
-		<td class='forumheader3' style='text-align:left;'>
-			{DOWNLOAD_LIST_NEWICON} {DOWNLOAD_LIST_NAME}
-		</td>
-		<td class='forumheader3' style='text-align:center;'>
-			{DOWNLOAD_LIST_DATESTAMP}
-		</td>
-		<td class='forumheader3' style='text-align:center;'>
-			{DOWNLOAD_LIST_AUTHOR}
-		</td>
-		<td class='forumheader3' style='text-align:center;'>
-			{DOWNLOAD_LIST_FILESIZE}
-		</td>
-		<td class='forumheader3' style='text-align:center;'>
-			{DOWNLOAD_LIST_REQUESTED}
-		</td>
-		<td class='forumheader3' style='text-align:center;'>
-			{DOWNLOAD_LIST_RATING}
-		</td>
-		<td class='forumheader3' style='text-align:center;'>
-			{DOWNLOAD_LIST_LINK} {DOWNLOAD_LIST_ICON}
-		</td>
-		</tr>";
-}
-
-if(!$DOWNLOAD_LIST_TABLE_END){
-		$DOWNLOAD_LIST_TABLE_END = "
-		<tr><td class='forumheader3' colspan='7' style='text-align:right;'>{DOWNLOAD_LIST_TOTAL_AMOUNT} {DOWNLOAD_LIST_TOTAL_FILES}</td></tr>
-		</table>
-		</form>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
-// ##### VIEW TABLE -------------------------------------------------------------------------------
-if(!$DOWNLOAD_VIEW_TABLE_START){
-		$DOWNLOAD_VIEW_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' style='width:95%'>\n";		
-}
-
-if(!$DOWNLOAD_VIEW_TABLE){   
-		$DOWNLOAD_VIEW_TABLE .= "
-		<tr>
-		<td colspan='2' class='fcaption' style='text-align:left;'>
-			{DOWNLOAD_VIEW_NAME}
-		</td>
-		</tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOR_LAN}</td>
-        <td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOR}</td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOREMAIL_LAN}</td>
-        <td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOREMAIL}</td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHORWEBSITE_LAN}</td>
-        <td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHORWEBSITE}</td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_DESCRIPTION_LAN}</td>
-        <td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_DESCRIPTION}</td>
-        </tr>";
-
-		if($DOWNLOAD_VIEW_IMAGE){
-		$DOWNLOAD_VIEW_TABLE .= "
-        <tr>
-        <td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_IMAGE_LAN}</td>
-        <td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_IMAGE}</td>
-        </tr>";
-		}
-
-        $DOWNLOAD_VIEW_TABLE .= "
-		<tr>
-        <td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_FILESIZE_LAN}</td>
-        <td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_FILESIZE}</td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_REQUESTED_LAN}</td>
-        <td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_REQUESTED}</td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_LINK_LAN}</td>
-        <td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_LINK}</td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_RATING_LAN}</td>
-        <td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_RATING}</td>
-        </tr>";
-}
-
-if(!$DOWNLOAD_VIEW_TABLE_END){
-		$DOWNLOAD_VIEW_TABLE_END = "
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/download_template.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2005/12/14 19:28:53 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+/* set style of download image and thumbnail */
+define("DL_IMAGESTYLE","border:0px");
+
+// ##### CAT TABLE --------------------------------------------------------------------------------
+if(!$DOWNLOAD_CAT_TABLE_START){
+                $DOWNLOAD_CAT_TABLE_START = "
+                <div style='text-align:center'>
+                <table class='fborder' style='width:95%'>\n
+                <tr>
+                <td style='width:3%; text-align:center' class='fcaption'>&nbsp;</td>
+                <td style='width:60%; text-align:center' class='fcaption'>".LAN_dl_19."</td>
+                <td style='width:10%; text-align:center' class='fcaption'>".LAN_dl_20."</td>
+                <td style='width:17%; text-align:center' class='fcaption'>".LAN_dl_21."</td>
+                <td style='width:10%; text-align:center' class='fcaption'>".LAN_dl_18."</td>
+                </tr>";
+}
+if(!$DOWNLOAD_CAT_PARENT_TABLE){
+
+                $DOWNLOAD_CAT_PARENT_TABLE .= "
+                <tr>
+                <td colspan='5' class='forumheader' style='text-align:left; font-weight:bold;'>
+                        {DOWNLOAD_CAT_MAIN_ICON} {DOWNLOAD_CAT_MAIN_NAME}
+                </td>
+                </tr>";
+}
+
+if(!$DOWNLOAD_CAT_CHILD_TABLE){
+
+                $DOWNLOAD_CAT_CHILD_TABLE .= "
+                <tr>
+                <td class='forumheader3'>
+                        {DOWNLOAD_CAT_SUB_ICON}
+                </td>
+                <td class='forumheader3'>
+                        {DOWNLOAD_CAT_SUB_NEW_ICON} {DOWNLOAD_CAT_SUB_NAME}<br />
+                        <span class='smalltext'>
+                        {DOWNLOAD_CAT_SUB_DESCRIPTION}
+                        </span>
+                </td>
+                <td class='forumheader3' style='text-align:center;'>
+                        {DOWNLOAD_CAT_SUB_COUNT}
+                </td>
+                <td class='forumheader3' style='text-align:center;'>
+                        {DOWNLOAD_CAT_SUB_SIZE}
+                </td>
+                <td class='forumheader3' style='text-align:center;'>
+                        {DOWNLOAD_CAT_SUB_DOWNLOADED}
+                </td>
+                </tr>
+                {DOWNLOAD_CAT_SUBSUB}
+                ";
+
+}
+
+if(!$DOWNLOAD_CAT_SUBSUB_TABLE)
+{
+
+	$DOWNLOAD_CAT_SUBSUB_TABLE .= "
+	<tr>
+	<td class='forumheader3'>
+		&nbsp;
+		</td>
+		<td class='forumheader3' style='width:100%'>
+			<table>
+			<tr>
+				<td class='forumheader3' style='border:0'>".
+				LAN_dl_42."
+				</td>
+				<td class='forumheader3' style='border:0'>
+				{DOWNLOAD_CAT_SUBSUB_ICON}
+				</td>
+				<td class='forumheader3' style='border:0; width: 100%'>
+					{DOWNLOAD_CAT_SUBSUB_NEW_ICON} {DOWNLOAD_CAT_SUBSUB_NAME}<br />
+					<span class='smalltext'>
+					{DOWNLOAD_CAT_SUBSUB_DESCRIPTION}
+					</span>
+				</td>
+			</tr>
+			</table>
+		</td>
+
+	<td class='forumheader3' style='text-align:center;'>
+		{DOWNLOAD_CAT_SUBSUB_COUNT}
+	</td>
+	<td class='forumheader3' style='text-align:center;'>
+		{DOWNLOAD_CAT_SUBSUB_SIZE}
+	</td>
+	<td class='forumheader3' style='text-align:center;'>
+		{DOWNLOAD_CAT_SUBSUB_DOWNLOADED}
+	</td>
+	</tr>";
+}
+
+if(!$DOWNLOAD_CAT_TABLE_END){
+                $DOWNLOAD_CAT_TABLE_END = "
+                <tr><td class='forumheader3' colspan='5' style='text-align:right;'>{DOWNLOAD_CAT_NEWDOWNLOAD_TEXT}</td></tr>
+                <tr><td class='forumheader3' colspan='5' style='text-align:right;'>{DOWNLOAD_CAT_SEARCH}</td></tr>
+                </table>
+                </div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+
+// ##### LIST TABLE -------------------------------------------------------------------------------
+if(!$DOWNLOAD_LIST_TABLE_START){
+
+                $DOWNLOAD_LIST_TABLE_START = "
+                <div style='text-align:center'>
+                <form method='post' action='".e_SELF."?".e_QUERY."'>
+                <table class='fborder' style='width:95%'>\n
+                <tr>
+        <td colspan='7' style='text-align:center' class='forumheader'>
+                        <span class='defaulttext'>".LAN_dl_37."</span>
+                        <select name='view' class='tbox'>".
+                        ($view == 5 ? "<option selected='selected'>5</option>" : "<option>5</option>").
+                        ($view == 10 ? "<option selected='selected'>10</option>" : "<option>10</option>").
+                        ($view == 15 ? "<option selected='selected'>15</option>" : "<option>15</option>").
+                        ($view == 20 ? "<option selected='selected'>20</option>" : "<option>20</option>").
+                        ($view == 50 ? "<option selected='selected'>50</option>" : "<option>50</option>")."
+                        </select>
+                        &nbsp;
+                        <span class='defaulttext'>".LAN_dl_38."</span>
+                        <select name='order' class='tbox'>".
+                        ($order == "download_datestamp" ? "<option value='download_datestamp' selected='selected'>".LAN_dl_22."</option>" : "<option value='download_datestamp'>".LAN_dl_22."</option>").
+                        ($order == "download_requested" ? "<option value='download_requested' selected='selected'>".LAN_dl_18."</option>" : "<option value='download_requested'>".LAN_dl_18."</option>").
+                        ($order == "download_name" ? "<option value='download_name' selected='selected'>".LAN_dl_23."</option>" : "<option value='download_name'>".LAN_dl_23."</option>").
+                        ($order == "download_author" ? "<option value='download_author' selected='selected'>".LAN_dl_24."</option>" : "<option value='download_author'>".LAN_dl_24."</option>")."
+                        </select>
+                        &nbsp;
+                        <span class='defaulttext'>".LAN_dl_39."</span>
+                        <select name='sort' class='tbox'>".
+                        ($sort == "ASC" ? "<option value='ASC' selected='selected'>".LAN_dl_25."</option>" : "<option value='ASC'>".LAN_dl_25."</option>").
+                        ($sort == "DESC" ? "<option value='DESC' selected='selected'>".LAN_dl_26."</option>" : "<option value='DESC'>".LAN_dl_26."</option>")."
+                        </select>
+                        &nbsp;
+                        <input class='button' type='submit' name='goorder' value='".LAN_dl_27."' />
+        </td>
+                </tr>
+        <tr>
+        <td style='width:35%; text-align:center' class='fcaption'>".LAN_dl_28."</td>
+        <td style='width:15%; text-align:center' class='fcaption'>".LAN_dl_22."</td>
+        <td style='width:20%; text-align:center' class='fcaption'>".LAN_dl_24."</td>
+        <td style='width:10%; text-align:center' class='fcaption'>".LAN_dl_21."</td>
+        <td style='width:5%; text-align:center' class='fcaption'>".LAN_dl_29."</td>
+        <td style='width:10%; text-align:center' class='fcaption'>".LAN_dl_12."</td>
+        <td style='width:5%; text-align:center' class='fcaption'>".LAN_dl_8."</td>
+        </tr>";
+
+}
+
+if(!$DOWNLOAD_LIST_TABLE){
+		$DOWNLOAD_LIST_TABLE .= "
+		<tr>
+		<td class='forumheader3' style='text-align:left;'>
+		{DOWNLOAD_LIST_NEWICON} {DOWNLOAD_LIST_NAME}
+		</td>
+		<td class='forumheader3' style='text-align:center;'>
+		{DOWNLOAD_LIST_DATESTAMP}
+		</td>
+		<td class='forumheader3' style='text-align:center;'>
+		{DOWNLOAD_LIST_AUTHOR}
+		</td>
+		<td class='forumheader3' style='text-align:center;'>
+		{DOWNLOAD_LIST_FILESIZE}
+		</td>
+		<td class='forumheader3' style='text-align:center;'>
+		{DOWNLOAD_LIST_REQUESTED}
+		</td>
+		<td class='forumheader3' style='text-align:center;'>
+		{DOWNLOAD_LIST_RATING}
+		</td>
+		<td class='forumheader3' style='text-align:center;'>
+		{DOWNLOAD_LIST_LINK} {DOWNLOAD_LIST_ICON}
+		</td>
+		</tr>";
+}
+
+if(!$DOWNLOAD_LIST_TABLE_END){
+		$DOWNLOAD_LIST_TABLE_END = "
+		<tr><td class='forumheader3' colspan='7' style='text-align:right;'>{DOWNLOAD_LIST_TOTAL_AMOUNT} {DOWNLOAD_LIST_TOTAL_FILES}</td></tr>
+		</table>
+		</form>
+		</div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+// ##### VIEW TABLE -------------------------------------------------------------------------------
+if(!$DOWNLOAD_VIEW_TABLE_START){
+		$DOWNLOAD_VIEW_TABLE_START = "
+		<div style='text-align:center'>
+		<table class='fborder' style='width:95%'>\n";
+}
+
+if(!$DOWNLOAD_VIEW_TABLE){
+		$DOWNLOAD_VIEW_TABLE .= "
+		<tr>
+		<td colspan='2' class='fcaption' style='text-align:left;'>
+
+		{DOWNLOAD_VIEW_NAME}
+		</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOR_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOR}</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOREMAIL_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHOREMAIL}</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHORWEBSITE_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_AUTHORWEBSITE}</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_DESCRIPTION_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_DESCRIPTION}</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_IMAGE_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_IMAGE}</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_FILESIZE_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_FILESIZE}</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_DATE_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_DATE_LONG}</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_REQUESTED_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_REQUESTED}</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_LINK_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_LINK}</td>
+		</tr>
+
+		<tr>
+		<td style='width:20%' class='forumheader3'>{DOWNLOAD_VIEW_RATING_LAN}</td>
+		<td style='width:80%' class='forumheader3'>{DOWNLOAD_VIEW_RATING}</td>
+		</tr>
+		
+		<tr>
+		<td style='width:20%' class='forumheader3' colspan='2'>{DOWNLOAD_REPORT_LINK}</td>
+		</tr>";
+}
+
+if(!$DOWNLOAD_VIEW_TABLE_END){
+		$DOWNLOAD_VIEW_TABLE_END = "
+		</table>
+		<div style='text-align:right; width: 95%; margin-left: auto; margin-right: auto'>{DOWNLOAD_ADMIN_EDIT}</div> 
+		</div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+// ##### MIRROR LIST -------------------------------------------------------------------------------
+
+if(!$DOWNLOAD_MIRROR_START)
+{
+	$DOWNLOAD_MIRROR_START = "
+	<div style='text-align:center'>
+	<table class='fborder' style='width:100%'>
+	<tr>
+	<td class='fcaption' colspan='4'>{DOWNLOAD_MIRROR_REQUEST}</td>
+	</tr>
+	<tr>
+	<td class='forumheader' style='width: 30%; text-align: center;'>{DOWNLOAD_MIRROR_HOST_LAN}</td>
+	<td class='forumheader' style='width: 40%;'>{DOWNLOAD_MIRROR_DESCRIPTION_LAN}</td>
+	<td class='forumheader' style='width: 20%; text-align: center;'>{DOWNLOAD_MIRROR_LOCATION_LAN}</td>
+	<td class='forumheader' style='width: 10%; text-align: center;'>{DOWNLOAD_MIRROR_GET_LAN}</td>
+	</tr>
+	";
+}
+
+if(!$DOWNLOAD_MIRROR)
+{
+	$DOWNLOAD_MIRROR = "
+	<tr>
+	<td class='forumheader3' style='width: 30%; text-align: center;'>{DOWNLOAD_MIRROR_IMAGE}<br /><br /><div class='smalltext'>{DOWNLOAD_MIRROR_REQUESTS}<br />{DOWNLOAD_TOTAL_MIRROR_REQUESTS}</div></td>
+	<td class='forumheader3' style='width: 40%'><div class='smalltext'>{DOWNLOAD_MIRROR_DESCRIPTION}</div></td>
+	<td class='forumheader3' style='width: 20%;; text-align: center;'>{DOWNLOAD_MIRROR_LOCATION}</td>
+	<td class='forumheader3' style='width: 10%; text-align: center;'><div class='smalltext'>{DOWNLOAD_MIRROR_LINK} {DOWNLOAD_MIRROR_FILESIZE}</div></td>
+	</tr>
+	";
+}
+
+if(!$DOWNLOAD_MIRROR_END)
+{
+	$DOWNLOAD_MIRROR_END = "
+	</table>
+	</div>
+	";
+}
+
+// ##### ------------------------------------------------------------------------------------------
 ?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/email_template.php 75/e107_themes/templates/email_template.php
--- 6171/e107_themes/templates/email_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/email_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -0,0 +1,60 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/email_template.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/12/14 19:28:53 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $pref;
+$SIGNUPEMAIL_SUBJECT = LAN_404." {SITENAME}";
+$SIGNUPEMAIL_USETHEME = 1; // Use CSS STYLE from THEME: 0 = Off, 1 = external, 2 = embedded
+$SIGNUPEMAIL_LINKSTYLE = ""; // css to use on links eg. color:red;
+$SIGNUPEMAIL_IMAGES =  e_IMAGE.$pref['sitebutton']; // comma separated paths to image to embed. referenced below with {IMAGE1} (IMAGE2} etc.
+$SIGNUPEMAIL_CC = "";  // comma separated email addresses to put in CC of the signup email.
+$SIGNUPEMAIL_BCC = "";   // comma separated email addresses to put in BCC of the signup email.
+$SIGNUPEMAIL_ATTACHMENTS = ""; // files-path array of attachments. eg. array(e_FILE."myfile.zip",e_FILE."myotherfile.zip"); 
+$SIGNUPEMAIL_BACKGROUNDIMAGE = "";// relative path to a background image eg. e_IMAGE."mybackground.jpg";
+
+
+
+$SIGNUPEMAIL_TEMPLATE = "
+<div style='padding:10px'>
+<div style='text-align:left; width:90%'>
+".LAN_EMAIL_01." {USERNAME},<br />
+<br />".
+LAN_403." {SITENAME}<br />
+".LAN_SIGNUP_21." ...<br />
+<br />
+{ACTIVATION_LINK}<br />
+<br />
+".LAN_SIGNUP_18."...<br />
+<br />
+".LAN_LOGINNAME.": <b> {LOGINNAME} </b><br />
+".LAN_PASSWORD.": <b> {PASSWORD} </b><br />
+<br />
+".LAN_EMAIL_04."<br />
+".LAN_EMAIL_05."<br />
+<br />
+".LAN_EMAIL_06."<br />
+<br />
+{SITENAME}<br />
+{SITEURL}
+<br /><br />
+{IMAGE1}
+</div>
+</div>
+";
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/footer_default.php 75/e107_themes/templates/footer_default.php
--- 6171/e107_themes/templates/footer_default.php	2004-07-30 20:14:50.000000000 -0500
+++ 75/e107_themes/templates/footer_default.php	2006-02-18 18:08:26.000000000 -0600
@@ -1,47 +1,187 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/themes/templates/templateh.php
-|
-|	Steve Dunstan 2001-2002
-|	http://jalist.com
-|	stevedunstan@jalist.com
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-if(!is_object($sql)){
-	// reinstigate db connection if another connection from third-party script closed it ...
-	global $sql, $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $CUSTOMFOOTER, $FOOTER;
-	$sql = new db;
-	$sql -> db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
-}
-
-unset($fh);
-if($e107_popup!=1){
-	$custompage = explode(" ", $CUSTOMPAGES);
-	if($CUSTOMFOOTER){
-		while(list($key, $kpage) = each($custompage)){
-			if(strstr(e_SELF, $kpage)){
-				$fh = TRUE;
-				break;
-			}
-		}
-	}
-	parseheader(($fh ? $CUSTOMFOOTER : $FOOTER));
-	
-	$timing_stop = explode(' ', microtime());
-	$rendertime = number_format((($timing_stop[0]+$timing_stop[1])-($timing_start[0]+$timing_start[1])), 4);
-	if($pref['displayrendertime']){ $rinfo .= "Render time: ".$rendertime." second(s). "; }
-	if($pref['displaysql']){ $rinfo .= "DB queries: ".$dbq.". "; }
-	if($pref['displaycacheinfo']){ $rinfo .= $cachestring."."; }
-	echo ($rinfo ? "<div style='text-align:center' class='smalltext'>$rinfo</div>" : "");
-}
-echo "</body>
-</html>";
-
-$sql -> db_Close();
-ob_end_flush();
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ???Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/footer_default.php,v $
+|     $Revision: 1.38 $
+|     $Date: 2006/02/19 00:08:26 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+global $eTraffic, $error_handler, $db_time, $sql, $sql2, $mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb, $CUSTOMFOOTER, $FOOTER, $e107;
+
+if(!is_object($sql)){
+	// reinstigate db connection if another connection from third-party script closed it ...
+	$sql = new db;
+	$sql -> db_Connect($mySQLserver, $mySQLuser, $mySQLpassword, $mySQLdefaultdb);
+}
+if (!is_object($eTraffic)) {
+	$eTraffic = new e107_traffic;
+	$eTraffic->Bump('Lost Traffic Counters');
+}
+
+unset($fh);
+if($e107_popup!=1){
+	parseheader(($ph ? $cust_footer : $FOOTER));
+	$eTimingStop = microtime();
+	global $eTimingStart;
+	$rendertime = number_format($eTraffic->TimeDelta( $eTimingStart, $eTimingStop ), 4);
+	$db_time    = number_format($db_time,4);
+	$rinfo = '';
+
+	if($pref['displayrendertime']){ $rinfo .= "Render time: {$rendertime} second(s); {$db_time} of that for queries. "; }
+	if($pref['displaysql']){ $rinfo .= "DB queries: ".$sql -> db_QueryCount().". "; }
+	if(isset($pref['display_memory_usage']) && $pref['display_memory_usage']){ $rinfo .= "Memory Usage: ".$e107->get_memory_usage(); }
+	if(isset($pref['displaycacheinfo']) && $pref['displaycacheinfo']){ $rinfo .= $cachestring."."; }
+	echo ($rinfo ? "\n<div style='text-align:center' class='smalltext'>{$rinfo}</div>\n" : "");
+	if ((ADMIN || $pref['developer']) && E107_DEBUG_LEVEL) {
+		global $db_debug,$ns;
+		echo "\n<!-- DEBUG -->\n";
+		if (!isset($ns)) {
+			echo "Why did ns go away?<br/>";
+			$ns = new e107table;
+		}
+
+		$tmp = $eTraffic->Display();
+		if (strlen($tmp)) {
+			$ns->tablerender('Traffic Counters', $tmp);
+		}
+		$tmp = $db_debug->Show_Performance();
+		if (strlen($tmp)) {
+			$ns->tablerender('Time Analysis', $tmp);
+		}
+		$tmp = $db_debug->Show_SQL_Details();
+		if (strlen($tmp)) {
+			$ns->tablerender('SQL Analysis', $tmp);
+		}
+		$tmp = $db_debug->Show_SC_BB();
+		if (strlen($tmp)) {
+			$ns->tablerender('Shortcodes / BBCode',$tmp);
+		}
+		$tmp = $db_debug->Show_PATH();
+		if (strlen($tmp)) {
+			$ns->tablerender('Paths', $tmp);
+		}
+		$tmp = $db_debug->Show_DEPRECIATED();
+		if (strlen($tmp)) {
+			$ns->tablerender('Paths', $tmp);
+		}
+	}
+}
+
+$sql -> db_Close();
+$sql2 -> db_Close();
+
+/*
+changes by jalist 24/01/2005:
+show sql queries
+usage: add ?showsql to query string, must be admin
+*/
+
+if(is_array($queryinfo) && ADMIN)
+{
+	$c=1;
+	$mySQLInfo = $sql->mySQLinfo;
+	echo "<table class='fborder' style='width: 100%;'>
+	<tr>
+	<td class='fcaption' style='width: 5%;'>ID</td><td class='fcaption' style='width: 95%;'>SQL Queries</td>\n</tr>\n";
+	foreach ($queryinfo as $infovalue)
+	{
+		echo "<tr>\n<td class='forumheader3' style='width: 5%;'>{$c}</td><td class='forumheader3' style='width: 95%;'>{$infovalue}</td>\n</tr>\n";
+		$c++;
+	}
+	echo "</table>";
+}
+
+//
+// Just before we quit: dump quick timer if there is any
+// Works any time we get this far. Not calibrated, but it is quick and simple to use.
+// To use: eQTimeOn(); eQTimeOff();
+//
+$tmp = eQTimeElapsed();
+if (strlen($tmp)) {
+	global $ns;
+	$ns->tablerender('Quick Admin Timer',"Results: {$tmp} microseconds");
+}
+
+// Provide a way to sync user and server time -- see e107.js and class2.php
+// This should be done as late as possible in page processing.
+$_serverTime=time();
+$lastSet = isset($_COOKIE['e107_tdSetTime']) ? $_COOKIE['e107_tdSetTime'] : 0;
+if (abs($_serverTime - $lastSet) > 120) {
+	/* update time delay every couple of minutes.
+	* Benefit: account for user time corrections and changes in internet delays
+	* Drawback: each update may cause all server times to display a bit different
+	*/
+	echo "<script type='text/javascript'>\n";
+	echo "SyncWithServerTime('{$_serverTime}');
+       </script>\n";
+}
+
+global $start_ob_level;
+if (ob_get_level() != $start_ob_level && $pref['developer']) {
+	$oblev = ob_get_level();
+	$obdbg = "<div style='text-align:center' class='smalltext'>Software defect detected; ob_*() level {$oblev} at end.</div>";
+	echo $obdbg;
+}
+
+if((ADMIN == true || $pref['developer']) && $error_handler->debug == true) {
+	echo "
+	<br /><br />
+	<div>
+		<h3>PHP Errors:</h3><br />
+		".$error_handler->return_errors()."
+	</div>
+	";
+}
+
+if (function_exists('theme_foot')) {
+	echo theme_foot();
+}
+
+if(isset($footer_js) && is_array($footer_js))
+{
+	$footer_js = array_unique($footer_js);
+	foreach($footer_js as $fname)
+	{
+		echo "<script type='text/javascript' src='{$fname}'></script>\n";
+		$js_included[] = $fname;
+	}
+}
+echo "</body></html>";
+
+$page = ob_get_clean();
+
+$etag = md5($page);
+header("Cache-Control: must-revalidate");
+header("ETag: {$etag}");
+
+$pref['compression_level'] == 6;
+if(strstr($_SERVER["HTTP_ACCEPT_ENCODING"], "gzip") || strstr($_SERVER['HTTP_USER_AGENT'], "Mozilla")) {
+	$browser_support = true;
+}
+if(ini_get("zlib.output_compression") == false && function_exists("gzencode")) {
+	$server_support = true;
+}
+if($pref['compress_output'] == true && $server_support == true && $browser_support == true) {
+	$level = intval($pref['compression_level']);
+	$page = gzencode($page, $level);
+	header("Content-Encoding: gzip", true);
+	header("Content-Length: ".strlen($page), true);
+	echo $page;
+} else {
+	header("Content-Length: ".strlen($page), true);
+	echo $page;
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/forum_template.php 75/e107_themes/templates/forum_template.php
--- 6171/e107_themes/templates/forum_template.php	2004-08-06 22:27:00.000000000 -0500
+++ 75/e107_themes/templates/forum_template.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,45 +0,0 @@
-<?php
-
-if(!$FORUM_MAIN_START){
-	$FORUM_MAIN_START = "<div style='text-align:center'>\n<table style='width:95%' class='fborder' border='1'>\n<tr>\n<td colspan='2' style='width:60%; text-align:center' class='fcaption'>{FORUMTITLE}</td>\n<td style='width:10%; text-align:center' class='fcaption'>{THREADTITLE}</td>\n<td style='width:10%; text-align:center' class='fcaption'>{REPLYTITLE}</td>\n<td style='width:20%; text-align:center' class='fcaption'>{LASTPOSTITLE}</td>\n</tr>";
-}
-if(!$FORUM_MAIN_PARENT){   
-         $FORUM_MAIN_PARENT = " <tr>\n<td colspan='5' class='forumheader'>{PARENTNAME} {PARENTSTATUS}</td>\n</tr>";   
- }   
- if(!$FORUM_MAIN_FORUM){   
-         $FORUM_MAIN_FORUM = "<tr>\n<td style='width:5%; text-align:center' class='forumheader2'>{NEWFLAG}</td>\n<td style='width:55%' class='forumheader2'>{FORUMNAME}<br /><span class='smallblacktext'>{FORUMDESCRIPTION}</span></td>\n<td style='width:10%; text-align:center' class='forumheader3'>{THREADS}</td>\n<td style='width:10%; text-align:center' class='forumheader3'>{REPLIES}</td>\n<td style='width:20%; text-align:center' class='forumheader3'><span class='smallblacktext'>{LASTPOST}</span></td>\n</tr>";   
- }   
- if(!$FORUM_MAIN_END){   
-         $FORUM_MAIN_END = "</table>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td colspan='2' style='width:60%' class='fcaption'>{INFOTITLE}</td>\n</tr>\n<tr>\n<td rowspan='4' style='width:5%; text-align:center' class='forumheader3'>{LOGO}</td>\n<td style='width:auto' class='forumheader3'>{USERINFO}</td>\n</tr>\n<tr>\n<td style='width:95%' class='forumheader3'>{INFO}</td>\n</tr><tr>\n<td style='width:95%' class='forumheader3'>{FORUMINFO}</td>\n</tr>\n<tr>\n<td style='width:95%' class='forumheader3'>{USERLIST}</td>\n</tr>\n</table>\n</div>\n<div class='spacer'>\n<table class='fborder' style='width:95%'>\n<tr>\n<td class='forumheader3' style='text-align:center; width:33%'>{ICONKEY}</td>\n<td style='text-align:center; width:33%' class='forumheader3'>{SEARCH}</td>\n<td style='width:33%; text-align:center; vertical-align:middle' class='forumheader3'><span class='smallblacktext'>{PERMS}</span>\n</td>\n</tr>\n</table>\n</div>\n</div>";   
- }   
-    
- if(!$FORUM_NEWPOSTS_START){   
-         $FORUM_NEWPOSTS_START = "<div style='text-align:center'>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td style='width:3%' class='fcaption'>&nbsp;</td>\n<td style='width:60%' class='fcaption'>{NEWTHREADTITLE}</td>\n<td style='width:27%; text-align:center' class='fcaption'>{POSTEDTITLE}</td>\n</tr>";   
- }   
-    
- if(!$FORUM_NEWPOSTS_MAIN){   
-         $FORUM_NEWPOSTS_MAIN .= "<tr>\n<td style='width:3%' class='forumheader3'>{NEWIMAGE}</td>\n<td style='width:60%' class='forumheader3'>{NEWSPOSTNAME}</td>\n<td style='width:27%; text-align:center' class='forumheader3'>{STARTERTITLE}</td>\n</tr>";   
- }   
-    
- if(!$FORUM_NEWPOSTS_END){   
-         $FORUM_NEWPOSTS_END .= "</table></div></div>";   
- }   
-    
- if(!$FORUM_TRACK_START){   
-         $FORUM_TRACK_START = "<div style='text-align:center'>\n<div class='spacer'>\n<table style='width:95%' class='fborder'>\n<tr>\n<td colspan='3' style='width:60%' class='fcaption'>{TRACKTITLE}</td>\n</tr>\n";   
-    
- if(!$FORUM_TRACK_MAIN){   
-         $FORUM_TRACK_MAIN = "<tr>   
-         <td style='text-align:center; vertical-align:middle; width:6%'  class='forumheader3'>{NEWIMAGE}</td>   
-                         <td style='vertical-align:middle; text-align:left; width:70%'  class='forumheader3'><span class='mediumtext'>{TRACKPOSTNAME}</span></td>   
-                         <td style='vertical-align:middle; text-align:center; width:24%'  class='forumheader3'><span class='mediumtext'>{UNTRACK}</td>   
-                         </tr>";   
-                 }   
-         }   
-    
- if(!$FORUM_TRACK_END){   
-         $FORUM_TRACK_END = "</table>\n</div>\n</div>";   
- } 
-
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/forum_viewforum_template.php 75/e107_themes/templates/forum_viewforum_template.php
--- 6171/e107_themes/templates/forum_viewforum_template.php	2004-09-02 22:21:56.000000000 -0500
+++ 75/e107_themes/templates/forum_viewforum_template.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,87 +0,0 @@
-<?php
-
- $FORUM_VIEW_START = " 
- <div class='spacer'>   
- <div style='text-align:center'>   
- <table style='width:95%; ' class='fborder'>   
- <tr>   
- <td  colspan='2' class='fcaption'>{BREADCRUMB}</td>   
- </tr>   
- <tr>   
- <td style='width:80%; vertical-align:middle'>&nbsp;<span class='mediumtext'>{FORUMTITLE}</span><br />{THREADPAGES}</td>   
- <td style='width:20%; text-align:right'>   
- {NEWTHREADBUTTON}   
- </td></tr><tr>   
- <td colspan='2'>   
-    
- <table style='width:100%' class='fborder'>   
- <tr>   
- <td style='width:3%' class='fcaption'>&nbsp;</td>   
- <td style='width:47%' class='fcaption'>{THREADTITLE}</td>   
- <td style='width:20%; text-align:center' class='fcaption'>{STARTERTITLE}</td>   
- <td style='width:5%; text-align:center' class='fcaption'>{REPLYTITLE}</td>   
- <td style='width:5%; text-align:center' class='fcaption'>{VIEWTITLE}</td>   
- <td style='width:20%; text-align:center' class='fcaption'>{LASTPOSTITLE}</td>   
- </tr>";   
- 
-    
- if(!$FORUM_VIEW_FORUM){   
-         $FORUM_VIEW_FORUM = "   
- <tr>   
- <td style='vertical-align:middle; text-align:center; width:3%' class='forumheader3'>{ICON}</td>   
- <td style='vertical-align:middle; text-align:left; width:47%'  class='forumheader3'>   
-    
- <table style='width:100%'>   
- <tr>   
- <td style='width:90%'><span class='mediumtext'><b>{THREADNAME}</b></span> <span class='smalltext'>{PAGES}</span></td>   
- <td style='width:10%; white-space:nowrap;'>{ADMIN_ICONS}</td>   
- </tr>   
- </table>   
-    
- </td>   
-    
- <td style='vertical-align:top; text-align:center; width:20%' class='forumheader3'>{POSTER}<br />{THREADDATE}</td>   
- <td style='vertical-align:center; text-align:center; width:5%' class='forumheader3'>{REPLIES}</td>   
- <td style='vertical-align:center; text-align:center; width:5%' class='forumheader3'>{VIEWS}</td>   
- <td style='vertical-align:top; text-align:center; width:20%' class='forumheader3'>{LASTPOST}</td>   
- </tr>";   
- }   
-    
- if(!$FORUM_VIEW_END){   
-         $FORUM_VIEW_END = "   
- </table>   
- <table style='width:100%'>   
- <tr>   
- <td style='width:80%'><span class='mediumtext'>{THREADPAGES}</span>   
- {FORUMJUMP}   
- </td>   
- <td style='width:20%; text-align:right'>   
- {NEWTHREADBUTTON}   
- </td>   
- </tr>   
- </table>   
- </td>   
- </tr>   
- </table>   
- <div class='spacer'>   
- <table class='fborder' style='width:95%'>   
- <tr>   
- <td style='vertical-align:center; width:50%' class='forumheader3'><span class='smalltext'>{MODERATORS}</span></td>   
- <td style='vertical-align:center; width:50%' class='forumheader3'><span class='smalltext'>{BROWSERS}</span></td>   
- </tr>   
- </table>   
- </div>   
- <div class='spacer'>   
- <table class='fborder' style='width:95%'>   
- <tr>   
- <td style='vertical-align:center; width:50%' class='forumheader3'>{ICONKEY}</td>   
- <td style='vertical-align:center; text-align:center; width:50%' class='forumheader3'><span class='smallblacktext'>{PERMS}</span><br /><br />{SEARCH}   
- </td>   
- </tr>   
- </table>   
- </div>   
- </div>
- </div>"; 
- }
-
- ?>
diff -ruN 6171/e107_themes/templates/forum_viewtopic_template.php 75/e107_themes/templates/forum_viewtopic_template.php
--- 6171/e107_themes/templates/forum_viewtopic_template.php	2004-05-02 01:46:02.000000000 -0500
+++ 75/e107_themes/templates/forum_viewtopic_template.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,7 +0,0 @@
-<?php
-		 $FORUMSTART = "<div style='text-align:center'>\n<table style='width:98%' class='fborder'>\n<tr>\n<td  colspan='2' class='fcaption'>\n{BACKLINK}\n</td>\n</tr>\n<tr>\n<td class='forumheader' colspan='2'>\n<table cellspacing='0' cellpadding='0' style='width:100%'>\n<tr>\n<td class='smalltext'>\n{NEXTPREV}\n</td>\n<td style='text-align:right'>&nbsp;\n{TRACK}\n</td>\n</tr>\n</table>\n</td>\n</tr>\n<tr>\n<td style='width:80%; vertical-align:bottom'><br /><div class='captiontext'>&nbsp;{THREADNAME}</div><br />\n{MODERATORS}\n<div class='mediumtext'>\n{GOTOPAGES}\n</div>\n</td>\n<td style='width:20%; text-align:right'>\n{BUTTONS}\n</td>\n</tr>\n<tr>\n<td colspan='2' style='text-align:center'>\n{THREADSTATUS}\n<table style='width:100%' class='fborder'>\n<tr>\n<td style='width:20%; text-align:center' class='fcaption'>\n".LAN_402."\n</td>\n<td style='width:80%; text-align:center' class='fcaption'>\n".LAN_403."\n</td>\n</tr>\n";          
-         $FORUMTHREADSTYLE = "<tr>\n<td class='forumheader' style='vertical-align:middle'>\n{NEWFLAG}\n{POSTER}\n</td>\n<td class='forumheader' style='vertical-align:middle'>\n<table cellspacing='0' cellpadding='0' style='width:100%'>\n<tr>\n<td class='smallblacktext'>\n{THREADDATESTAMP}\n</td>\n<td style='text-align:right'>\n{REPORTIMG}{EDITIMG}{QUOTEIMG}\n</td>\n</tr>\n</table>\n</td>\n</tr>\n<tr>\n<td class='forumheader3' style='vertical-align:top'>\n{CUSTOMTITLE}\n{AVATAR}\n<span class='smalltext'>\n{LEVEL}\n{MEMBERID}\n{JOINED}\n{LOCATION}\n{POSTS}\n</span>\n</td>\n<td class='forumheader3' style='vertical-align:top'>\n{POST}\n{SIGNATURE}\n</td>\n</tr>\n<tr>\n <td class='finfobar'>\n<span class='smallblacktext'>\n{TOP}\n</span>\n</td>\n<td class='finfobar' style='vertical-align:top'>\n<table cellspacing='0' cellpadding='0' style='width:100%'>\n<tr>\n<td>\n{PROFILEIMG}\n {EMAILIMG}\n {WEBSITEIMG}\n {PRIVMESSAGE}\n</td>\n<td style='text-align:right'>\n{MODOPTIONS}\n</td>\n</tr>\n</table>\n</td>\n</tr>\n<tr>\n<td colspan='2'>\n</td>\n</tr>\n";   
-         $FORUMEND = "<tr><td colspan='2' class='forumheader3' style='text-align:center'>{QUICKREPLY}</td></tr></table>\n</td>\n</tr>\n<tr>\n<td style='width:80%; vertical-align:top'>\n<div class='mediumtext'>\n{GOTOPAGES}\n</div>\n{FORUMJUMP}\n</td>\n<td style='width:20%; text-align:right'>\n{BUTTONS}\n</td>\n</tr>\n</table>\n</div>";   
-         $FORUMREPLYSTYLE = ""; 
-
-?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/fpw_template.php 75/e107_themes/templates/fpw_template.php
--- 6171/e107_themes/templates/fpw_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/fpw_template.php	2006-03-26 23:01:53.000000000 -0600
@@ -0,0 +1,68 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### FPW TABLE -----------------------------------------------------------------------------
+if(!$FPW_TABLE){
+		$FPW_TABLE = "
+		<div style='text-align:center'>
+		<form method='post' action='".e_SELF."'>
+		<table style='width:70%' class='fborder'>
+
+		<tr>
+		<td class='fcaption' colspan='2'>".LAN_05."</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3' style='width:70%'>".LAN_FPW1.":</td>
+		<td class='forumheader3' style='width:30%;text-align:center'>
+		<input class='tbox' type='text' name='username' size='40' value='' maxlength='100' />
+		</td>
+		</tr>
+
+		<tr>
+		<td class='forumheader3' style='width:70%'>".LAN_112.":</td>
+		<td class='forumheader3' style='width:30%; text-align:center'>
+		<input class='tbox' type='text' name='email' size='40' value='' maxlength='100' />
+		</td>
+		</tr>";
+
+		if($FPW_TABLE_SECIMG_SECIMG){
+				$FPW_TABLE .= "
+				<tr>
+					<td class='forumheader3' style='width:25%'>{FPW_TABLE_SECIMG_LAN}</td>
+					<td class='forumheader3' style='width:75%;text-align:left'>{FPW_TABLE_SECIMG_HIDDEN} {FPW_TABLE_SECIMG_SECIMG}<br />
+					{FPW_TABLE_SECIMG_TEXTBOC}<br />
+					</td>
+				</tr>";
+		}
+
+		$FPW_TABLE .="
+		<tr style='vertical-align:top'>
+		<td class='forumheader' colspan='2' style='text-align:center'>
+		<input class='button' type='submit' name='pwsubmit' value='".LAN_156."' />
+		</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+// ##### FPW HEADER TABLE -------------------------------------------------------------------------
+if(!$FPW_TABLE_HEADER){
+		$FPW_TABLE_HEADER = "
+		<div style='width:100%;text-align:center;margin-left:auto;margin-right:auto'>
+			<div style='width:70%;margin-left:auto;margin-right:auto;text-align:center;'><br />
+			".(file_exists(THEME."images/login_logo.png") ? "<img src='".THEME."images/login_logo.png' alt='' />\n" : "<img src='".e_IMAGE."logo.png' alt='' />\n")."
+			<br />";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+// ##### FPW FOOTER TABLE -------------------------------------------------------------------------
+if(!$FPW_TABLE_FOOTER){
+		$FPW_TABLE_FOOTER = "</div></div>";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/header_default.php 75/e107_themes/templates/header_default.php
--- 6171/e107_themes/templates/header_default.php	2004-08-28 21:40:06.000000000 -0500
+++ 75/e107_themes/templates/header_default.php	2006-05-16 13:42:15.000000000 -0500
@@ -1,292 +1,287 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /e107_themes/templates/header_default.php
-|
-|        Steve Dunstan 2001-2004
-|        http://jalist.com
-|        stevedunstan@jalist.com
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|   $Id: header_default.php,v 1.37 2004/08/29 02:40:05 mcfly_e107 Exp $
-+---------------------------------------------------------------+
-*/
-if(!function_exists("parseheader")){
-	function parseheader($LAYOUT){
-		$tmp = explode("\n", $LAYOUT);
-		for($c=0; $c < count($tmp); $c++){
-			if(preg_match("/{.+?}/", $tmp[$c])){
-				$str = checklayout($tmp[$c]);
-			}else{
-			echo $tmp[$c];
-		}
-	}
-}
-}
-if(!function_exists("checklayout")){
-	function checklayout($str){
-		$sql = new db;
-		global $pref, $style, $userthemes, $udirs, $userclass, $dbq, $menu_pref, $dbq;
-		if(strstr($str, "LOGO")){
-			if(function_exists("theme_logo")){
-				call_user_func("theme_logo");
-			} else {
-				echo "<img src='".e_IMAGE."logo.png' alt='Logo' />\n";
-			}
-		}else if(strstr($str, "SITENAME")){
-			echo SITENAME."\n";
-		}else if(strstr($str, "SITETAG")){
-			echo SITETAG."\n";
-		}else if(strstr($str, "SITELINKS")){
-			if(!$sql -> db_Select("menus", "*", "(menu_name='edynamic_menu' OR menu_name REGEXP('tree_menu')) AND menu_location!=0")){
-				$linktype = substr($str,(strpos($str, "=")+1), 4);
-				define("LINKDISPLAY", ($linktype == "menu" ? 2 : 1));
-				if(function_exists("theme_sitelinks")){
-					call_user_func("theme_sitelinks");
-				} else {
-					require_once(e_HANDLER."sitelinks_class.php");
-					sitelinks();
-				}
-			}
-		}else if(strstr($str, "MENU")){
-			$sql = new db;
-			$ns = new e107table;
-			$menu = trim(chop(preg_replace("/\{MENU=(.*?)\}/si", "\\1", $str)));
-			$sql9 = new db;
-			$sql9 -> db_Select("menus", "menu_name,menu_class,menu_pages","menu_location='$menu' ORDER BY menu_order");
-			while($row = $sql9-> db_Fetch()){
-				extract($row);
-				$show_menu = TRUE;
-				if($menu_pages)
-				{
-					list($listtype,$listpages) = explode("-",$menu_pages);
-					$pagelist = explode("|",$listpages);
-					$check_url = e_SELF."?".e_QUERY;
-					if($listtype == '1') //show menu
-					{
-						$show_menu = FALSE;
-						foreach($pagelist as $p)
-						{
-							if(strpos($check_url,$p) !== FALSE)
-							{
-								$show_menu = TRUE;
-							}
-						}
-					}
-					if($listtype == '2') //hide menu
-					{
-						$show_menu = TRUE;
-						foreach($pagelist as $p)
-						{
-							if(strpos($check_url,$p) !== FALSE)
-							{
-								$show_menu = FALSE;
-							}
-						}
-					}
-				}
-
-				if(check_class($menu_class) && $show_menu){
-					if(strstr($menu_name, "custom_")){
-						require_once(e_PLUGIN."custom/".str_replace("custom_", "", $menu_name).".php");
-					} else {
-						@include(e_PLUGIN.$menu_name."/languages/".e_LANGUAGE.".php");
-						@include(e_PLUGIN.$menu_name."/languages/English.php");
-						require_once(e_PLUGIN.$menu_name."/".$menu_name.".php");
-					}
-				}
-
-			}
-		}else if(strstr($str, "SETSTYLE")){
-			$tmp = explode("=", $str);
-			$style = trim(chop(preg_replace("/\{SETSTYLE=(.*?)\}/si", "\\1", $str)));
-		}else if(strstr($str, "SITEDISCLAIMER")){
-			echo SITEDISCLAIMER.(defined("THEME_DISCLAIMER") && $pref['displaythemeinfo'] ? THEME_DISCLAIMER : "");
-		}else if(strstr($str, "CUSTOM")){
-			$custom = trim(chop(preg_replace("/\{CUSTOM=(.*?)\}/si", "\\1", $str)));
-			if($custom == "login" || $custom == "login noprofile"){
-				@include(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php");
-				@include(e_PLUGIN."login_menu/languages/English.php");
-
-				if(USER == TRUE){
-					echo "<span class='mediumtext'>".LOGIN_MENU_L5." ".USERNAME."&nbsp;&nbsp;&nbsp;.:. ";
-					if(ADMIN == TRUE){
-						echo "<a href='".e_ADMIN.(!$pref['adminstyle'] || $pref['adminstyle'] == "default" ? "admin.php" : $pref['adminstyle'].".php")."'>".LOGIN_MENU_L11."</a> .:. ";
-					}
-					echo ($custom != "login noprofile") ? "<a href='".e_BASE."user.php?id.".USERID."'>".LOGIN_MENU_L13."</a>\n.:. ":"";
-					echo "<a href='" . e_BASE . "usersettings.php'>".LOGIN_MENU_L12."</a> .:. <a href='".e_BASE."?logout'>".LOGIN_MENU_L8."</a> .:.</span>";
-				}else{
-				echo  "<form method='post' action='".e_SELF."'>\n<p>\n".LOGIN_MENU_L1."<input class='tbox' type='text' name='username' size='15' value='$username' maxlength='20' />&nbsp;&nbsp;\n".LOGIN_MENU_L2."<input class='tbox' type='password' name='userpass' size='15' value='' maxlength='20' />&nbsp;&nbsp;\n<input type='checkbox' name='autologin' value='1' />".LOGIN_MENU_L6."&nbsp;&nbsp;\n<input class='button' type='submit' name='userlogin' value='Login' />";
-				if($pref['user_reg']){
-					echo "&nbsp;&nbsp;<a href='".e_SIGNUP."'>".LOGIN_MENU_L3."</a>";
-				}
-				echo "</p>\n</form>";
-			}
-
-		}else if($custom == "search" && (USER || $pref['search_restrict']!=1)){
-			$searchflat = TRUE;
-			include(e_PLUGIN."search_menu/search_menu.php");
-		}else if($custom == "quote"){
-			if(!file_exists(e_BASE."quote.txt")){
-				$quote = "Quote file not found ($qotd_file)";
-			}else{
-			$quotes = file(e_BASE."quote.txt");
-			$quote = stripslashes(htmlspecialchars($quotes[rand(0, count($quotes))]));
-		}
-		echo $quote;
-	}else if($custom == "clock"){
-		$clock_flat = TRUE;
-		require_once(e_PLUGIN."clock_menu/clock_menu.php");
-	}else if($custom == "welcomemessage"){
-		$aj = new textparse;
-		$sql -> db_Select("wmessage");
-		list($wm_guest, $guestmessage, $wm_active1) = $sql-> db_Fetch();
-		list($wm_member, $membermessage, $wm_active2) = $sql-> db_Fetch();
-		list($wm_admin, $adminmessage, $wm_active3) = $sql-> db_Fetch();
-		if(ADMIN == TRUE && $wm_active3){
-			echo $aj -> tpa($adminmessage, "on","admin");
-		}else if(USER == TRUE && $wm_active2 && !ADMIN){
-			echo $aj -> tpa($membermessage, "on","admin");
-		}else if(USER == FALSE && $wm_active1 && !ADMIN){
-			echo $aj -> tpa($guestmessage, "on","admin");
-		}
-		define("WMFLAG", TRUE);
-	}
-
-}else if(strstr($str, "BANNER")){
-	$campaign = trim(chop(preg_replace("/\{BANNER=(.*?)\}/si", "\\1", $str)));
-	mt_srand ((double) microtime() * 1000000);
-	$seed = mt_rand(1,2000000000);
-	if($campaign != "{BANNER}"){
-		$query = "banner_active=1 AND (banner_startdate=0 OR banner_startdate<=".time().") AND (banner_enddate=0 OR banner_enddate>".time().") AND (banner_impurchased=0 OR banner_impressions<=banner_impurchased) AND banner_campaign='$campaign' ORDER BY RAND($seed)";
-	}else{
-	$query = "banner_active=1 AND (banner_startdate=0 OR banner_startdate<=".time().") AND (banner_enddate=0 OR banner_enddate>".time().") AND (banner_impurchased=0 OR banner_impressions<=banner_impurchased) ORDER BY RAND($seed)";
-}
-$sql = new db;
-if($sql -> db_Select("banner", "*", $query)){
-	$row = $sql -> db_Fetch(); extract($row);
-
-	$fileext1 = substr(strrchr($banner_image, "."), 1);
-	$fileext2 = substr(strrchr($banner_image, "."), 0);
-	if ($fileext1 == swf) {
-		echo "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"468\" height=\"60\">\n<param name=\"movie\" value=\"".e_IMAGE."banners/".$banner_image."\">\n<param name=\"quality\" value=\"high\"><param name=\"SCALE\" value=\"noborder\">\n<embed src=\"".e_IMAGE."banners/".$banner_image."\" width=\"468\" height=\"60\" scale=\"noborder\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"></embed></object>";
-	}else if($fileext1 == "php" || $fileext1 == "html" || $fileext1 == "js"){
-		include(e_IMAGE."banners/".$banner_image);
-	}else{
-	echo "<a href='".e_BASE."banner.php?".$banner_id."' rel='external'><img src='".e_IMAGE."banners/".$banner_image."' alt='".$banner_clickurl."' style='border:0' /></a>";
-}
-$sql -> db_Update("banner", "banner_impressions=banner_impressions+1 WHERE banner_id='$banner_id' ");
-}
-}else if(strstr($str, "NEWS_CATEGORY")){
-	$news_category = trim(chop(preg_replace("/\{NEWS_CATEGORY=(.*?)\}/si", "\\1", $str)));
-	require_once(e_PLUGIN."alt_news/alt_news.php");
-	alt_news($news_category);
-}
-
-}
-}
-
-$aj = new textparse;
-echo (defined("STANDARDS_MODE") ? "" : "<?xml version='1.0' encoding='iso-8859-1' ?>")."<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
-<html xmlns=\"http://www.w3.org/1999/xhtml\">
-<head>
-<title>".SITENAME.(defined("e_PAGETITLE") ? ": ".e_PAGETITLE : (defined("PAGE_NAME") ? ": ".PAGE_NAME : ""))."</title>
-<link rel=\"stylesheet\" href=\"".e_FILE."e107.css\" type=\"text/css\" />
-<link rel=\"stylesheet\" href=\"".THEME."style.css\" type=\"text/css\" />";
-if(file_exists(e_BASE."favicon.ico")){echo "\n<link rel=\"shortcut icon\" href=\"favicon.ico\" />"; }
-if(file_exists(e_FILE."style.css")){ echo "\n<link rel='stylesheet' href='".e_FILE."style.css' type=\"text/css\" />\n"; }
-if($eplug_css){ echo "\n<link rel='stylesheet' href='{$eplug_css}' type='text/css' />\n"; }
-echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=".CHARSET."\" />
-<meta http-equiv=\"content-style-type\" content=\"text/css\" />
-".($pref['meta_tag'] ? $aj -> formtparev($pref['meta_tag'])."\n" : "");
-
-echo "<script type='text/javascript' src='".e_FILE."e107.js'></script>";
-if(file_exists(THEME."theme.js")){echo "<script type='text/javascript' src='".THEME."theme.js'></script>\n";}
-if(file_exists(e_FILE."user.js")){echo "<script type='text/javascript' src='".e_FILE."user.js'></script>\n";}
-if($eplug_js){ echo "<script type='text/javascript' src='{$eplug_js}'></script>\n"; }
-if($htmlarea_js){ echo $htmlarea_js; }
-if(function_exists("headerjs")){echo headerjs();  }
-
-echo "<script type=\"text/javascript\">
-<!--\n";
-if($pref['log_activate']){
-echo "
-document.write( '<link rel=\"stylesheet\" type=\"text/css\" href=\"".e_PLUGIN."log/log.php?referer=' + ref + '&color=' + colord + '&eself=' + eself + '&res=' + res + '\">' );";
-}
-//echo "var ejs_listpics = new Array();";
-
-$fader_onload = ($sql -> db_Select("menus", "*", "menu_name='fader_menu' AND menu_location!='0' ") ? "changecontent();" : "");
-$links_onload = "externalLinks();";
-$body_onload =($fader_onload != "" || $links_onload != "" ? " onload='".$links_onload." ".$fader_onload."'" : "");
-$ejs_listpics = "";
-$handle=opendir(THEME."images");
-while ($file = readdir($handle)){
-if(strstr($file,".") && $file != "." && $file != ".."){
-$ejs_listpics .= $file.",";
-}
-}
-$ejs_listpics = substr($ejs_listpics, 0, -1);
-
-closedir($handle);
-echo "\n
-
-ejs_preload('".THEME."images/','".$ejs_listpics."');\n
-// -->\n
-</script>
-</head>
-<body".$body_onload.">";
-//echo "XX - ".$e107_popup;
-// require $e107_popup =1; to use it as header for popup without menus
-if($e107_popup != 1){
-
-	if($pref['no_rightclick']){
-		echo "<script language=\"javascript\">
-		<!--
-		var message=\"Not Allowed\";
-		function click(e) {
-		if (document.all) {
-		if (event.button==2||event.button==3) {
-		alert(message);
-		return false;
-		}
-		}
-		if (document.layers) {
-		if (e.which == 3) {
-		alert(message);
-		return false;
-		}
-		}
-		}
-		if (document.layers) {
-		document.captureevents(event.mousedown);
-		}
-		document.onmousedown=click;
-		// -->
-		</script>\n";
-	}
-
-
-	$custompage = explode(" ", $CUSTOMPAGES);
-
-	if(e_PAGE == "news.php" && $NEWSHEADER){
-		parseheader($NEWSHEADER);
-	}else{
-	while(list($key, $kpage) = each($custompage)){
-		if(strstr(e_SELF, $kpage)){
-			$ph = TRUE;
-			break;
-		}
-	}
-	parseheader(($ph ? $CUSTOMHEADER : $HEADER));
-}
-
-unset($text);
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-}
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     �Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/header_default.php,v $
+|     $Revision: 1.82 $
+|     $Date: 2006/05/16 18:42:15 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// send the charset to the browser - overides spurious server settings with the lan pack settings.
+header("Content-type: text/html; charset=".CHARSET, true);
+
+if (!function_exists("parseheader")) {
+	function parseheader($LAYOUT){
+		global $tp;
+		$tmp = explode("\n", $LAYOUT);
+		for ($c=0; $c < count($tmp); $c++) {
+			if (preg_match("/{.+?}/", $tmp[$c])) {
+				echo $tp -> parseTemplate($tmp[$c]);
+			} else {
+				echo $tmp[$c];
+			}
+		}
+	}
+}
+$sql->db_Mark_Time('(Header Top)');
+
+echo (defined("STANDARDS_MODE") ? "" : "<?xml version='1.0' encoding='".CHARSET."' "."?".">")."<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
+<html xmlns='http://www.w3.org/1999/xhtml'".(defined("TEXTDIRECTION") ? " dir='".TEXTDIRECTION."'" : "").(defined("CORE_LC") ? " xml:lang=\"".CORE_LC."\"" : "").">
+<head>
+<title>".SITENAME.(defined("e_PAGETITLE") ? ": ".e_PAGETITLE : (defined("PAGE_NAME") ? ": ".PAGE_NAME : ""))."</title>\n";
+
+// Multi-Language meta-tags with merge and override option.
+
+echo "<meta http-equiv='content-type' content='text/html; charset=".CHARSET."' />
+<meta http-equiv='content-style-type' content='text/css' />\n";
+echo (defined("CORE_LC")) ? "<meta http-equiv='content-language' content='".CORE_LC."' />\n" : "";
+$diz_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_description'][e_LANGUAGE]) ? $pref['meta_description'][e_LANGUAGE]." " : "";
+$key_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_keywords'][e_LANGUAGE]) ? $pref['meta_keywords'][e_LANGUAGE]."," : "";
+echo (defined("META_DESCRIPTION")) ? "<meta name=\"description\" content=\"".$diz_merge.META_DESCRIPTION."\" />\n" : "";
+echo (defined("META_KEYWORDS")) ? "<meta name=\"keywords\" content=\"".$key_merge.META_KEYWORDS."\" />\n" : "";
+
+if (isset($pref['meta_description'][e_LANGUAGE])) {
+	echo ($pref['meta_description'][e_LANGUAGE] && !defined("META_DESCRIPTION") ) ? "<meta name=\"description\" content=\"".$pref['meta_description'][e_LANGUAGE]."\" />\n" : "";
+}
+if (isset($pref['meta_keywords'][e_LANGUAGE])) {
+	echo ($pref['meta_keywords'][e_LANGUAGE] && !defined("META_KEYWORDS") ) ? "<meta name=\"keywords\" content=\"".$pref['meta_keywords'][e_LANGUAGE]."\" />\n" : "";
+}
+echo ($pref['meta_copyright'][e_LANGUAGE]) ? "<meta name=\"copyright\" content=\"".$pref['meta_copyright'][e_LANGUAGE]."\" />\n" : "";
+echo ($pref['meta_tag'][e_LANGUAGE]) ? str_replace("&lt;", "<", $tp -> toHTML($pref['meta_tag'][e_LANGUAGE], FALSE, "nobreak, no_hook, no_make_clickable"))."\n" : "";
+unset($key_merge,$diz_merge);
+
+if(isset($pref['rss_feeds']) && $pref['rss_feeds'] && file_exists(e_PLUGIN."rss_menu/rss_meta.php")){
+	require_once(e_PLUGIN."rss_menu/rss_meta.php");
+}
+
+if(isset($pref['trackbackEnabled'])){
+	echo "<link rel='pingback' href='".SITEURLBASE.e_PLUGIN_ABS."trackback/xmlrpc.php' />\n";
+}
+if((isset($pref['enable_png_image_fix']) && $pref['enable_png_image_fix'] == true) || (isset($sleight) && $sleight == true)) {
+	echo "<script type='text/javascript' src='".e_FILE_ABS."sleight_js.php'></script>\n";
+}
+
+if(function_exists('core_head')){ echo core_head(); }
+
+if (isset($eplug_css) && $eplug_css) { echo "\n<link rel='stylesheet' href='{$eplug_css}' type='text/css' />\n"; }
+if (isset($eplug_js) && $eplug_js) { echo "<script type='text/javascript' src='{$eplug_js}'></script>\n"; }
+
+if(defined("PREVIEWTHEME")) {
+	echo "<link rel='stylesheet' href='".PREVIEWTHEME."style.css' type='text/css' />\n";
+} else {
+	$css_default = "all";
+	if (isset($theme_css_php) && $theme_css_php) {
+		echo "<link rel='stylesheet' href='".THEME_ABS."theme-css.php' type='text/css' />\n";
+	} else {
+		if(isset($pref['themecss']) && $pref['themecss'] && file_exists(THEME.$pref['themecss']))
+		{
+			// Support for print and handheld media.
+			if(file_exists(THEME."style_mobile.css")){
+            	echo "<link rel='stylesheet' href='".THEME_ABS."style_mobile.css' type='text/css' media='handheld' />\n";
+				$css_default = "screen";
+			}
+			if(file_exists(THEME."style_print.css")){
+            	echo "<link rel='stylesheet' href='".THEME_ABS."style_print.css' type='text/css' media='print' />\n";
+                $css_default = "screen";
+			}
+			echo "<link rel='stylesheet' href='".THEME_ABS."{$pref['themecss']}' type='text/css' media='{$css_default}' />\n";
+
+
+		}
+		else
+		{
+			// Support for print and handheld media.
+			if(file_exists(THEME."style_mobile.css")){
+            	echo "<link rel='stylesheet' href='".THEME_ABS."style_mobile.css' type='text/css' media='handheld' />\n";
+                $css_default = "screen";
+			}
+			if(file_exists(THEME."style_print.css")){
+            	echo "<link rel='stylesheet' href='".THEME_ABS."style_print.css' type='text/css' media='print' />\n";
+                $css_default = "screen";
+			}
+			echo "<link rel='stylesheet' href='".THEME_ABS."style.css' type='text/css' media='{$css_default}' />\n";
+		}
+		if (!isset($no_core_css) || !$no_core_css) {
+			echo "<link rel='stylesheet' href='".e_FILE_ABS."e107.css' type='text/css' />\n";
+		}
+	}
+}
+
+if(function_exists('theme_head')){
+	echo theme_head();
+}
+
+// ---------- Favicon ---------
+if (file_exists(THEME."favicon.ico")) {
+	echo "<link rel='icon' href='".THEME_ABS."favicon.ico' type='image/x-icon' />\n<link rel='shortcut icon' href='".THEME_ABS."favicon.ico' type='image/xicon' />\n";
+}elseif (file_exists(e_BASE."favicon.ico")) {
+	echo "<link rel='icon' href='".SITEURL."favicon.ico' type='image/x-icon' />\n<link rel='shortcut icon' href='".SITEURL."favicon.ico' type='image/xicon' />\n";
+}
+
+
+
+if (isset($theme_js_php) && $theme_js_php) {
+	echo "<link rel='stylesheet' href='".THEME_ABS."theme-js.php' type='text/css />";
+} else {
+	echo "<script type='text/javascript' src='".e_FILE_ABS."e107.js'></script>\n";
+	if (file_exists(THEME.'theme.js')) { echo "<script type='text/javascript' src='".THEME_ABS."theme.js'></script>\n"; }
+	if (filesize(e_FILE.'user.js')) { echo "<script type='text/javascript' src='".e_FILE_ABS."user.js'></script>\n"; }
+}
+if (isset($WYSIWYG) && $WYSIWYG == TRUE && check_class($pref['post_html']) && isset($e_wysiwyg) && $e_wysiwyg != "") {
+	require_once(e_HANDLER."tiny_mce/wysiwyg.php");
+	define("e_WYSIWYG",TRUE);
+	echo wysiwyg($e_wysiwyg);
+}else{
+	define("e_WYSIWYG",FALSE);
+}
+if (function_exists('headerjs')){echo headerjs();  }
+
+if (isset($pref['statActivate']) && $pref['statActivate']) {
+	if(!$pref['statCountAdmin'] && ADMIN) {
+		/* don't count admin visits */
+	} else {
+		require_once(e_PLUGIN."log/consolidate.php");
+		$script_text = "document.write( '<link rel=\"stylesheet\" type=\"text/css\" href=\"".e_PLUGIN_ABS."log/log.php?referer=' + ref + '&color=' + colord + '&eself=' + eself + '&res=' + res + '\">' );\n";
+	}
+}
+
+if ($pref['image_preload']) {
+	$ejs_listpics = '';
+	$handle=opendir(THEME.'images');
+	while ($file = readdir($handle)) {
+		if (!strstr($file, "._") && strstr($file,".") && $file != "." && $file != ".." && $file != "Thumbs.db" && $file != ".DS_Store") {
+			$ejs_listpics .= $file.",";
+		}
+	}
+
+	$ejs_listpics = substr($ejs_listpics, 0, -1);
+	closedir($handle);
+
+	$script_text .= "ejs_preload('".THEME_ABS."images/','".$ejs_listpics."');\n";
+}
+if (isset($script_text) && $script_text) {
+	echo "<script type='text/javascript'>\n";
+	echo "<!--\n";
+	echo $script_text;
+	echo "// -->\n";
+	echo "</script>\n";
+}
+
+$fader_onload='';
+if(in_array('fader_menu', $eMenuActive))
+{
+	$fader_onload = 'changecontent(); ';
+}
+
+$links_onload = 'externalLinks();';
+$body_onload = ($fader_onload != '' || $links_onload != '') ? " onload='".$fader_onload.$links_onload."'" : "";
+
+echo "</head>
+<body".$body_onload.">\n";
+//echo "XX - ".$e107_popup;
+// require $e107_popup =1; to use it as header for popup without menus
+if(!isset($e107_popup))
+{
+	$e107_popup = 0;
+}
+if ($e107_popup != 1) {
+	if (isset($pref['no_rightclick']) && $pref['no_rightclick']) {
+		echo "<script language='javascript'>\n";
+		echo "<!--\n";
+		echo "var message=\"Not Allowed\";\n";
+		echo "function click(e) {\n";
+		echo "	if (document.all) {\n";
+		echo "		if (event.button==2||event.button==3) {\n";
+		echo "			alert(message);\n";
+		echo "			return false;\n";
+		echo "		}\n";
+		echo "	}\n";
+		echo "	if (document.layers) {\n";
+		echo "		if (e.which == 3) {\n";
+		echo "			alert(message);\n";
+		echo "			return false;\n";
+		echo "		}\n";
+		echo "	}\n";
+		echo "}\n";
+		echo "if (document.layers) {\n";
+		echo "	document.captureevents(event.mousedown);\n";
+		echo "}\n";
+		echo "document.onmousedown=click;\n";
+		echo "// -->\n";
+		echo "</script>\n";
+	}
+
+	if(isset($CUSTOMPAGES))
+	{
+		if (is_array($CUSTOMPAGES))
+		{
+			foreach ($CUSTOMPAGES as $cust_key => $cust_value)
+			{
+				$custompage[$cust_key] = explode(' ', $cust_value);
+			}
+		}
+		else
+		{
+			$custompage['no_array'] = explode(' ', $CUSTOMPAGES);
+		}
+	}
+	else
+	{
+		$custompage['no_array'] = array();
+	}
+
+	$ph = FALSE;
+	if (e_PAGE == 'news.php' && isset($NEWSHEADER)) {
+		parseheader($NEWSHEADER);
+	} else {
+		foreach ($custompage as $key_extract => $cust_extract) {
+			foreach ($cust_extract as $key => $kpage) {
+				if ($kpage && strstr(e_SELF, $kpage) || strstr(e_SELF."?".e_QUERY,$kpage)) {
+					$ph = TRUE;
+					if ($key_extract=='no_array') {
+						$cust_header = $CUSTOMHEADER ? $CUSTOMHEADER : $HEADER;
+						$cust_footer = $CUSTOMFOOTER ? $CUSTOMFOOTER : $FOOTER;
+					} else {
+						$cust_header = $CUSTOMHEADER[$key_extract] ? $CUSTOMHEADER[$key_extract] : $HEADER;
+						$cust_footer = $CUSTOMFOOTER[$key_extract] ? $CUSTOMFOOTER[$key_extract] : $FOOTER;
+					}
+					break;
+				}
+			}
+		}
+		parseheader(($ph ? $cust_header : $HEADER));
+	}
+	$sql->db_Mark_Time("Main Page Body");
+
+
+	if(ADMIN){
+		if(file_exists(e_BASE.'install.php')){ echo "<div class='installe' style='text-align:center'><br /><b>*** ".CORE_LAN4." ***</b><br />".CORE_LAN5."</div><br /><br />"; }
+	}
+
+
+// Display Welcome Message when old method activated.
+
+	echo $tp->parseTemplate("{WMESSAGE=header}");
+
+
+
+	if(defined("PREVIEWTHEME")) {
+		themeHandler :: showPreview();
+	}
+
+
+	unset($text);
+}
 ?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/links_template.php 75/e107_themes/templates/links_template.php
--- 6171/e107_themes/templates/links_template.php	2004-07-12 10:41:32.000000000 -0500
+++ 75/e107_themes/templates/links_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -1,141 +1,159 @@
-<?php
-
-// ##### MAIN TABLE -------------------------------------------------------------------------------
-if(!$LINK_MAIN_TABLE_START){
-		$LINK_MAIN_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' style='width:95%'>\n";
-}
-if(!$LINK_MAIN_TABLE){   
-		$LINK_MAIN_TABLE .= "
-		<tr>
-		<td class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center' rowspan='2'>
-			{LINK_MAIN_ICON}
-		</td>
-		<td class='forumheader' style='width:90%'>
-			{LINK_MAIN_HEADING}
-		</td>
-		</tr>
-		<tr>
-		<td class='forumheader3'>
-			{LINK_MAIN_DESC}
-			<span class='smalltext'>(
-				{LINK_MAIN_NUMBER}
-			)</span>
-		</td>
-		</tr>\n";
-
-}
-if(!$LINK_MAIN_TABLE_END){
-		$LINK_MAIN_TABLE_END = "
-		<tr><td class='forumheader3' colspan='2' style='text-align:right;'>{LINK_MAIN_TOTAL}</td></tr>
-		<tr><td class='forumheader3' colspan='2' style='text-align:right;'>{LINK_MAIN_SHOWALL}</td></tr>
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
-// ##### CATEGORY LIST ----------------------------------------------------------------------------
-if(!$LINK_CAT_TABLE_START){
-		$LINK_CAT_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' cellspacing='0' cellpadding='0' style='width:95%'><tr><td>\n";
-}
-if(!$LINK_CAT_TABLE){   
-		$LINK_CAT_TABLE .= "
-		<table class='fborder' style='width:100%'>
-		<tr>
-		<td rowspan='2' class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center'>
-			{LINK_CAT_BUTTON}
-		</td>
-		<td class='forumheader' style='width:90%'>
-			{LINK_CAT_APPEND}{LINK_CAT_NAME}</a> <i>{LINK_CAT_URL}</i>
-		</td>
-		<td class='forumheader' style='white-space:nowrap;'>
-			{LINK_CAT_REFER}
-		</td>
-		</tr>
-		<tr>
-		<td colspan='2' class='forumheader3' style='line-height:130%;'>
-			{LINK_CAT_DESC}<br />
-		</td>
-		</tr>
-		</table>\n";
-
-}
-if(!$LINK_CAT_TABLE_END){
-		$LINK_CAT_TABLE_END = "
-		</td>
-		</tr>
-		<tr>
-			<td class='forumheader3' colspan='2' style='text-align:right;'>
-				{LINK_CAT_SUBMIT}
-			</td>
-		</tr>		
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-// ##### SUBMIT -----------------------------------------------------------------------------------
-if(!$LINK_SUBMIT_TABLE_START){
-	$LINK_SUBMIT_TABLE_START = "
-	<div style='text-align:center'>
-	<form method='post' action='".e_SELF."'>
-	<table class='fborder' cellspacing='0' cellpadding='0' style='width:95%'>";
-}
-if(!$LINK_SUBMIT_TABLE){   
-		$LINK_SUBMIT_TABLE .= "
-		<tr>
-			<td colspan='2' style='text-align:center' class='forumheader2'>".LAN_93."</td>
-		</tr>
-		<tr>
-			<td class='forumheader3' style='width:30%'>".LAN_86."</td>
-			<td class='forumheader3' style='width:70%'>
-				{LINK_SUBMIT_CAT}
-			</td>
-		</tr>
-		<tr>
-			<td class='forumheader3' style='width:30%'><u>".LAN_94."</u></td>
-			<td class='forumheader3' style='width:30%'>
-				<input class='tbox' type='text' name='link_name' size='60' value='' maxlength='100' />
-			</td>
-		</tr>
-		<tr>
-			<td class='forumheader3' style='width:30%'><u>".LAN_95."</u></td>
-			<td class='forumheader3' style='width:30%'>
-				<input class='tbox' type='text' name='link_url' size='60' value='' maxlength='200' />
-			</td>
-		</tr>
-		<tr>
-			<td class='forumheader3' style='width:30%'><u>".LAN_96."</u></td>
-			<td class='forumheader3' style='width:30%'>
-				<textarea class='tbox' name='link_description' cols='59' rows='3'></textarea>
-			</td>
-		</tr>
-		<tr>
-			<td class='forumheader3' style='width:30%'>".LAN_97."</td>
-			<td class='forumheader3' style='width:30%'>
-				<input class='tbox' type='text' name='link_button' size='60' value='' maxlength='200' />
-			</td>
-		</tr>
-		<tr>
-			<td colspan='2' style='text-align:center' class='forumheader3'><span class='smalltext'>".LAN_106."</span></td>
-		</tr>
-		<tr>
-			<td colspan='2' style='text-align:center' class='forumheader'>
-				<input class='button' type='submit' name='add_link' value='".LAN_98."' />
-			</td>
-		</tr>
-		";
-
-}
-if(!$LINK_SUBMIT_TABLE_END){
-	$LINK_SUBMIT_TABLE_END = "
-	</table></form></div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/links_template.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:53 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// ##### MAIN TABLE -------------------------------------------------------------------------------
+if(!$LINK_MAIN_TABLE_START){
+                $LINK_MAIN_TABLE_START = "
+                <div style='text-align:center'>
+                <table class='fborder' style='width:95%'>\n";
+}
+if(!$LINK_MAIN_TABLE){
+                $LINK_MAIN_TABLE .= "
+                <tr>
+                <td class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center' rowspan='2'>
+                        {LINK_MAIN_ICON}
+                </td>
+                <td class='forumheader' style='width:90%'>
+                        {LINK_MAIN_HEADING}
+                </td>
+                </tr>
+                <tr>
+                <td class='forumheader3'>
+                        {LINK_MAIN_DESC}
+                        <span class='smalltext'>(
+                                {LINK_MAIN_NUMBER}
+                        )</span>
+                </td>
+                </tr>\n";
+
+}
+if(!$LINK_MAIN_TABLE_END){
+                $LINK_MAIN_TABLE_END = "
+                <tr><td class='forumheader3' colspan='2' style='text-align:right;'>{LINK_MAIN_TOTAL}</td></tr>
+                <tr><td class='forumheader3' colspan='2' style='text-align:right;'>{LINK_MAIN_SHOWALL}</td></tr>
+                </table>
+                </div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+// ##### CATEGORY LIST ----------------------------------------------------------------------------
+if(!$LINK_CAT_TABLE_START){
+                $LINK_CAT_TABLE_START = "
+                <div style='text-align:center'>
+                <table class='fborder' cellspacing='0' cellpadding='0' style='width:95%'><tr><td>\n";
+}
+if(!$LINK_CAT_TABLE){
+                $LINK_CAT_TABLE .= "
+                <table class='fborder' style='width:100%'>
+                <tr>
+                <td rowspan='2' class='forumheader3' style='background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center'>
+                        {LINK_CAT_BUTTON}
+                </td>
+                <td class='forumheader' style='width:90%'>
+                        {LINK_CAT_APPEND}{LINK_CAT_NAME}</a> <i>{LINK_CAT_URL}</i>
+                </td>
+                <td class='forumheader' style='white-space:nowrap;'>
+                        {LINK_CAT_REFER}
+                </td>
+                </tr>
+                <tr>
+                <td colspan='2' class='forumheader3' style='line-height:130%;'>
+                        {LINK_CAT_DESC}<br />
+                </td>
+                </tr>
+                </table>\n";
+
+}
+if(!$LINK_CAT_TABLE_END){
+                $LINK_CAT_TABLE_END = "
+                </td>
+                </tr>
+                <tr>
+                        <td class='forumheader3' colspan='2' style='text-align:right;'>
+                                {LINK_CAT_SUBMIT}
+                        </td>
+                </tr>
+                </table>
+                </div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+// ##### SUBMIT -----------------------------------------------------------------------------------
+if(!$LINK_SUBMIT_TABLE_START){
+        $LINK_SUBMIT_TABLE_START = "
+        <div style='text-align:center'>
+        <form method='post' action='".e_SELF."'>
+        <table class='fborder' cellspacing='0' cellpadding='0' style='width:95%'>";
+}
+if(!$LINK_SUBMIT_TABLE){
+                $LINK_SUBMIT_TABLE .= "
+                <tr>
+                        <td colspan='2' style='text-align:center' class='forumheader2'>".LAN_93."</td>
+                </tr>
+                <tr>
+                        <td class='forumheader3' style='width:30%'>".LAN_86."</td>
+                        <td class='forumheader3' style='width:70%'>
+                                {LINK_SUBMIT_CAT}
+                        </td>
+                </tr>
+                <tr>
+                        <td class='forumheader3' style='width:30%'><u>".LAN_94."</u></td>
+                        <td class='forumheader3' style='width:30%'>
+                                <input class='tbox' type='text' name='link_name' size='60' value='' maxlength='100' />
+                        </td>
+                </tr>
+                <tr>
+                        <td class='forumheader3' style='width:30%'><u>".LAN_95."</u></td>
+                        <td class='forumheader3' style='width:30%'>
+                                <input class='tbox' type='text' name='link_url' size='60' value='' maxlength='200' />
+                        </td>
+                </tr>
+                <tr>
+                        <td class='forumheader3' style='width:30%'><u>".LAN_96."</u></td>
+                        <td class='forumheader3' style='width:30%'>
+                                <textarea class='tbox' name='link_description' cols='59' rows='3'></textarea>
+                        </td>
+                </tr>
+                <tr>
+                        <td class='forumheader3' style='width:30%'>".LAN_97."</td>
+                        <td class='forumheader3' style='width:30%'>
+                                <input class='tbox' type='text' name='link_button' size='60' value='' maxlength='200' />
+                        </td>
+                </tr>
+                <tr>
+                        <td colspan='2' style='text-align:center' class='forumheader3'><span class='smalltext'>".LAN_106."</span></td>
+                </tr>
+                <tr>
+                        <td colspan='2' style='text-align:center' class='forumheader'>
+                                <input class='button' type='submit' name='add_link' value='".LAN_98."' />
+                        </td>
+                </tr>
+                ";
+
+}
+if(!$LINK_SUBMIT_TABLE_END){
+        $LINK_SUBMIT_TABLE_END = "
+        </table></form></div>\n";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/login_template.php 75/e107_themes/templates/login_template.php
--- 6171/e107_themes/templates/login_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/login_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -0,0 +1,46 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### LOGIN HEADER TABLE -----------------------------------------------------------------------
+if(!$LOGIN_TABLE_HEADER){
+	$LOGIN_TABLE_HEADER .= "
+	<div style='width:100%;text-align:center; margin-left: auto;margin-right: auto'>
+		<div style='text-align:center;width:70%;margin-left: auto;margin-right: auto'>
+			".(file_exists(THEME."images/login_logo.png") ? "<img src='".THEME."images/login_logo.png' alt='' />\n" : "<img src='".e_IMAGE."logo.png' alt='' />\n" );
+}
+
+// ##### LOGIN TABLE -----------------------------------------------------------------------------
+if(!$LOGIN_TABLE){
+		$LOGIN_TABLE = "";
+		if($LOGIN_TABLE_LOGINMESSAGE != ""){
+				$LOGIN_TABLE .= "<div style='text-align:center'>{LOGIN_TABLE_LOGINMESSAGE}</div>";
+		}
+		$LOGIN_TABLE .= "
+		<div style='text-align:center'>
+		".$rs -> form_open("post", e_SELF)."<table class='fborder' style='width:60%' >\n<tr>\n<td class='forumheader' style='text-align:center;' colspan='3'>".LAN_LOGIN_4."</td>\n</tr>\n<tr>\n<td class='forumheader3' width='40%'>".LAN_LOGIN_1."</td>\n<td class='forumheader3' width='40%'>{LOGIN_TABLE_USERNAME}</td>\n<td class='forumheader3' width='20%' rowspan='".($LOGIN_TABLE_SECIMG_SECIMG ? 3 : 2)."' style='vertical-align: middle; margin-left: auto; margin-right: auto; text-align: center;'><img src='".e_IMAGE."generic/".IMODE."/password.png' alt='' /></td>\n</tr>\n<tr>\n<td class='forumheader3'>".LAN_LOGIN_2."</td>\n<td class='forumheader3'>{LOGIN_TABLE_PASSWORD}</td>\n</tr>\n";
+	if($LOGIN_TABLE_SECIMG_SECIMG){
+		$LOGIN_TABLE .= "<tr><td class='forumheader3'>{LOGIN_TABLE_SECIMG_LAN}</td>\n<td class='forumheader3'>{LOGIN_TABLE_SECIMG_HIDDEN} {LOGIN_TABLE_SECIMG_SECIMG} {LOGIN_TABLE_SECIMG_TEXTBOC}</td>\n</tr>\n";
+	}
+
+	$LOGIN_TABLE .= "<tr>\n<td class='forumheader2' style='text-align:center;' colspan='3'>{LOGIN_TABLE_AUTOLOGIN}<span class='smalltext'>{LOGIN_TABLE_AUTOLOGIN_LAN}</span><br />{LOGIN_TABLE_SUBMIT}</td>\n</tr>\n</table>".
+	$rs -> form_close()."\n</div>";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+// ##### LOGIN TABLE FOOTER -----------------------------------------------------------------------
+if(!$LOGIN_TABLE_FOOTER){
+			$LOGIN_TABLE_FOOTER = "
+			<div style='width:70%;margin-right:auto;margin-left:auto'>
+				<div style='text-align:center'><br />
+					{LOGIN_TABLE_FOOTER_USERREG}
+					&nbsp;&nbsp;&nbsp;<a href='fpw.php'>".LAN_LOGIN_12."</a>
+				</div>
+			</div>
+		</div>
+	</div>";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/membersonly_template.php 75/e107_themes/templates/membersonly_template.php
--- 6171/e107_themes/templates/membersonly_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/membersonly_template.php	2006-01-06 12:11:26.000000000 -0600
@@ -0,0 +1,43 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/membersonly_template.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2006/01/06 18:11:26 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+$MEMBERSONLY_BEGIN = "<div style='width:75%;margin-right:auto;margin-left:auto'><br /><br />";
+
+$MEMBERSONLY_CAPTION = "<div style='text-align:center'>".LAN_MEMBERS_0."</div>";
+
+$MEMBERSONLY_TABLE = "
+<div style='text-align:center'>
+<table class='fborder' style='width:75%;margin-right:auto;margin-left:auto'>
+<tr>
+	<td class='forumheader3' style='text-align:center'><br />".LAN_MEMBERS_1." ".LAN_MEMBERS_2;
+			if ($pref['user_reg'])
+			{
+				$MEMBERSONLY_TABLE .= " ".LAN_MEMBERS_3." ";
+			}
+			$MEMBERSONLY_TABLE .= "<br /><br /><a href='".e_BASE."index.php'>".LAN_MEMBERS_4."</a>
+	</td>
+</tr>
+</table>
+</div>
+";
+
+$MEMBERSONLY_END = "<div>";
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/online_template.php 75/e107_themes/templates/online_template.php
--- 6171/e107_themes/templates/online_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/online_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -0,0 +1,38 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### ONLINE TABLE -----------------------------------------------------------------------------
+if(!$ONLINE_TABLE_START){
+		$ONLINE_TABLE_START = "
+		<div style='text-align:center'>
+		<table class='fborder' style='width:96%'>
+		<tr>
+			<td class='forumheader' style='width:3%'>&nbsp;</td>
+			<td class='forumheader' style='width:43%'>".ONLINE_EL10."</td>
+			<td class='forumheader' style='width:50%'>".ONLINE_EL11."</td>
+		</tr>";
+}
+if(!$ONLINE_TABLE){
+		$ONLINE_TABLE = "
+		<tr>
+			<td class='forumheader3' style='width:3%;text-align:center'>{ONLINE_TABLE_ICON}</td>
+			<td class='forumheader3' style='width:45%'>{ONLINE_TABLE_USERNAME}</td>
+			<td class='forumheader3' style='width:50%'>{ONLINE_TABLE_LOCATION}<br /></td>
+		</tr>";
+}
+if(!$ONLINE_TABLE_END){
+		$ONLINE_TABLE_END = "
+		</table>
+		</div>
+		<br />
+		".ONLINE_EL1.GUESTS_ONLINE.", 
+		".ONLINE_EL2.MEMBERS_ONLINE." ...<br />
+		<br />{ONLINE_TABLE_MOST_EVER_ONLINE}
+		<br />({ONLINE_TABLE_MOST_MEMBERS_ONLINE}, {ONLINE_TABLE_MOST_GUESTS_ONLINE}) ".ONLINE_EL9." {ONLINE_TABLE_DATESTAMP}<br />
+		{ONLINE_TABLE_MEMBERS_TOTAL}{ONLINE_TABLE_MEMBERS_NEWEST}";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/search_template.php 75/e107_themes/templates/search_template.php
--- 6171/e107_themes/templates/search_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/search_template.php	2006-04-21 20:22:40.000000000 -0500
@@ -0,0 +1,111 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+/*
+if (!defined('SEARCH_SHORTCODE_REF')) {
+	define('SEARCH_SHORTCODE_REF',"");
+}
+*/
+
+
+if (!isset($SEARCH_SHORTCODE)) {
+
+	$SEARCH_SHORTCODE = "<input class='tbox search' type='text' name='q' size='20' value='' maxlength='50' />
+	<input class='button search' type='submit' name='s' value=\"".LAN_180."\" />";
+
+	/*  // Image Version Example
+	$SEARCH_SHORTCODE = "<input class='tbox search' type='text' name='q' size='20' value='Default Value' maxlength='50' onclick=\"this.value=''\" />
+	<input type='image' name='s' src='".e_PLUGIN_ABS."search_menu/images/search.png'  value='".LAN_180."' style='width: 16px; height: 16px; border: 0px; vertical-align: middle'  />";
+    */
+}
+
+
+
+
+if (!isset($SEARCH_TOP_TABLE)) {
+	$SEARCH_TOP_TABLE = "<div style='text-align: center'>
+	<form id='searchform' name='searchform' method='get' action='".e_SELF."'>
+	<table style='width: 95%' class='fborder'><tr>
+	<td class='forumheader3' style='width: 40%'>".LAN_199."</td>
+	<td class='forumheader3' style='width: 60%; white-space: nowrap'>
+	{SEARCH_MAIN_SEARCHFIELD}&nbsp;{SEARCH_MAIN_SUBMIT}&nbsp;{ENHANCED_ICON}
+	</td>
+	</tr>";
+}
+
+if (!isset($SEARCH_ENHANCED)) {
+	$SEARCH_ENHANCED = "<tr id='{ENHANCED_DISPLAY_ID}' {ENHANCED_DISPLAY}>
+	<td class='forumheader3' style='width: 40%; white-space: nowrap'>{ENHANCED_TEXT}</td>
+	<td class='forumheader3' style='width: 60%; white-space: nowrap'>
+	{ENHANCED_FIELD}
+	</td>
+	</tr>";
+}
+
+if (!isset($SEARCH_CATS)) {
+	$SEARCH_CATS = "<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_SEARCH_19."<br />
+	{SEARCH_MAIN_CHECKALL} {SEARCH_MAIN_UNCHECKALL}
+	</td>
+	<td style='width:70%' class='forumheader3'>
+	{SEARCH_MAIN_CHECKBOXES}{SEARCH_DROPDOWN}&nbsp;{SEARCH_ADVANCED}
+	<br />
+	</td>
+	</tr>";
+}
+
+if (!isset($SEARCH_TYPE)) {
+	$SEARCH_TYPE = "<tr id='advanced_type' {SEARCH_TYPE_DISPLAY}>
+	<td style='width:30%' class='forumheader3'>".LAN_SEARCH_75.":</td>
+	<td style='width:70%' class='forumheader3'>
+	{SEARCH_TYPE_SEL}
+	<br />
+	</td>
+	</tr>";
+}
+
+if (!isset($SEARCH_ADV)) {
+	$SEARCH_ADV = "<tr>
+	<td class='forumheader3'>
+	{SEARCH_ADV_A}
+	</td>
+	<td class='forumheader3'>
+	{SEARCH_ADV_B}
+	</td>
+	</tr>";
+}
+
+if (!isset($SEARCH_ADV_COMBO)) {
+	$SEARCH_ADV_COMBO = "<tr>
+	<td class='forumheader3' colspan='2'>
+	{SEARCH_ADV_TEXT}
+	</td>
+	</tr>";
+}
+
+if (!isset($SEARCH_TABLE_MSG)) {
+	$SEARCH_TABLE_MSG = "<tr>
+	<td class='forumheader3' style='text-align: center' colspan='2'>
+	{SEARCH_MESSAGE}
+	</td>
+	</tr>";
+}
+
+if (!isset($SEARCH_BOT_TABLE)) {
+	$SEARCH_BOT_TABLE = "<tr style='display: none !important; display: visible'>
+	<td style='display: none' colspan='2'></td>
+	</tr></table>
+	</form>
+	</div>";
+}
+
+if (!isset($PRE_CHECKBOXES)) {
+	$PRE_CHECKBOXES = "<span style='white-space: nowrap; padding-bottom: 7px; padding-top: 7px'>";	/* string thats printed before each category checkbox */
+}
+
+if (!isset($POST_CHECKBOXES)) {
+	$POST_CHECKBOXES = "</span>";	/* string thats printed after each category checkbox */
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/signup_template.php 75/e107_themes/templates/signup_template.php
--- 6171/e107_themes/templates/signup_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/signup_template.php	2006-04-26 02:08:10.000000000 -0500
@@ -0,0 +1,312 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/signup_template.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2006/04/26 07:08:10 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+define("REQUIRED_FIELD_MARKER", "<span style='text-align:right;font-size:15px; color:red'> *</span>");
+
+$sc_style['SIGNUP_DISPLAYNAME']['pre'] = "
+<tr>
+<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_7."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_8."</span></td>
+<td class='forumheader3' style='width:70%'>
+";
+$sc_style['SIGNUP_DISPLAYNAME']['post'] = "
+</td>
+</tr>
+";
+
+$sc_style['SIGNUP_REALNAME']['pre'] = "
+<tr>
+<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_308."".req($pref['signup_option_realname'])."</td>
+<td class='forumheader3' style='width:70%' >
+";
+$sc_style['SIGNUP_REALNAME']['post'] = "
+</td>
+</tr>
+";
+
+
+if(!defined($USERCLASS_SUBSCRIBE_START))
+{
+$USERCLASS_SUBSCRIBE_START = "
+<tr>
+<td class='forumheader3' style='width:30%;vertical-align:top'>".LAN_USET_5." ".req($pref['signup_option_class'])."
+<br /><span class='smalltext'>".LAN_USET_6."</span></td>
+<td class='forumheader3' style='width:70%'>
+<table style='width:100%'>
+";
+}
+
+if(!defined($USERCLASS_SUBSCRIBE_ROW))
+{
+$USERCLASS_SUBSCRIBE_ROW = "
+<tr>
+	<td class='defaulttext' style='width:10%;vertical-align:top'>
+		<input type='checkbox' name='class[]' value='{USERCLASS_ID}'  />
+	</td>
+	<td class='defaulttext' style='text-align:left;margin-left:0px;width:90%padding-top:3px;vertical-align:top'>{USERCLASS_NAME}<br />
+		<span class='smalltext'>{USERCLASS_DESCRIPTION}</span>
+	</td>
+</tr>
+";
+}
+
+if(!defined($USERCLASS_SUBSCRIBE_END))
+{
+$USERCLASS_SUBSCRIBE_END = "
+</table>
+</td>
+</tr>
+";
+}
+
+
+
+if(!defined($SIGNUP_PASSWORD_LEN))
+{
+$SIGNUP_PASSWORD_LEN = "<span class='smalltext'> (".LAN_SIGNUP_1." {$pref['signup_pass_len']} ".LAN_SIGNUP_2.")</span>";
+}
+
+
+if(!defined($SIGNUP_EXTENDED_USER_FIELDS))
+{
+	$SIGNUP_EXTENDED_USER_FIELDS	= "
+<tr>
+	<td style='width:40%' class='forumheader3'>
+		{EXTENDED_USER_FIELD_TEXT}
+		{EXTENDED_USER_FIELD_REQUIRED}
+	</td>
+	<td style='width:60%' class='forumheader3'>
+		{EXTENDED_USER_FIELD_EDIT}
+	</td>
+</tr>
+";
+}
+
+if(!defined($EXTENDED_USER_FIELD_REQUIRED))
+{
+	$EXTENDED_USER_FIELD_REQUIRED	= "<span style='text-align:right;font-size:15px; color:red'> *</span>";
+}
+
+$SIGNUP_SIGNATURE_START = "
+<tr>
+	<td class='forumheader3' style='width:30%;white-space:nowrap;vertical-align:top' >".LAN_120." ".req($pref['signup_option_signature'])."</td>
+	<td class='forumheader3' style='width:70%' >
+	<textarea class='tbox' style='width:99%' name='signature' cols='10' rows='4' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>";
+
+$SIGNUP_SIGNATURE_END = "
+</textarea><br />
+	<div style='width:99%'>{REN_HELP}</div>
+	</td></tr>
+";
+
+
+$sc_style['SIGNUP_IMAGES']['pre'] = "
+<tr>
+<td class='forumheader3' style='width:30%; vertical-align:top;white-space:nowrap' >".LAN_121.req($pref['signup_option_image'])."<br /><span class='smalltext'>(".LAN_SIGNUP_33.")</span></td>
+<td class='forumheader3' style='width:70%;vertical-align:top' >
+";
+$sc_style['SIGNUP_IMAGES']['post'] = "
+</td>
+</tr>
+";
+
+$sc_style['SIGNUP_TIMEZONE']['pre'] = "
+<tr>
+<td class='forumheader3' style='width:30%' >".LAN_122.req($pref['signup_option_timezone'])."</td>
+<td class='forumheader3' style='width:70%;white-space:nowrap'>
+";
+$sc_style['SIGNUP_TIMEZONE']['post'] = "
+</td>
+</tr>
+";
+
+
+$sc_style['SIGNUP_IMAGECODE']['pre'] = "
+<tr>
+	<td class='forumheader3' style='width:30%'>".LAN_410.req(2)."</td>
+	<td class='forumheader3' style='width:70%'>
+";
+$sc_style['SIGNUP_IMAGECODE']['post'] = "
+</td>
+</tr>
+";
+
+
+if(!defined($COPPA_TEMPLATE))
+{
+$COPPA_TEMPLATE = LAN_109 . "
+<a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".LAN_SIGNUP_14."</a>. ".LAN_SIGNUP_15." <a href='mailto:".SITEADMINEMAIL."'>".LAN_SIGNUP_14."</a> ".LAN_SIGNUP_16."
+<br />
+<br />
+<div style='text-align:center'><b>".LAN_SIGNUP_17."</b>
+{SIGNUP_COPPA_FORM}
+</div>
+";
+}
+
+if(!defined($COPPA_FAIL))
+{
+$COPPA_FAIL = "<div style='text-align:center'>".LAN_SIGNUP_9."</div>";
+}
+
+if(!defined($SIGNUP_TEXT))
+{
+$SIGNUP_TEXT =
+LAN_309." <b>".LAN_SIGNUP_29."</b><br />".LAN_SIGNUP_30."<br />
+";
+}
+
+if(!defined($SIGNUP_XUP_FORM))
+{
+$SIGNUP_XUP_FORM = "
+	<div style='padding:10px;text-align:center'>
+	<input class='button' type ='button' style='cursor:hand' size='30' value='".LAN_SIGNUP_35."' onclick=\"expandit('xup','default')\" />
+	</div>
+
+	<div id='xup' style='display:none' >
+	<table style='width: 100%;'>
+	<tr>
+	<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_31."
+	</td>
+	<td class='forumheader3' style='width:70%'>
+	<input class='tbox' type='text' name='xupexist' size='50' value='' maxlength='100' />
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_9."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_10."</span></td>
+	<td class='forumheader3' style='width:70%'>
+	{SIGNUP_XUP_LOGINNAME}
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_17."<span style='font-size:15px; color:red'> *</span></td>
+	<td class='forumheader3' style='width:70%'>
+	{SIGNUP_XUP_PASSWORD1}
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_111."<span style='font-size:15px; color:red'> *</span></td>
+	<td class='forumheader3' style='width:70%'>
+	{SIGNUP_XUP_PASSWORD2}
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader3' colspan='2'  style='text-align:center'>
+	<span class='smalltext'><a href='http://e107.org/generate_xup.php' rel='external'>".LAN_SIGNUP_32."</a></span>
+	</td>
+	</tr>
+
+	<tr>
+	<td class='forumheader' colspan='2'  style='text-align:center'>
+	<input class='button' type='submit' name='register' value='".LAN_123."' />
+	</td>
+	</tr>
+
+	</table>
+	</div>
+";
+}
+
+if(!defined($SIGNUP_BEGIN))
+{
+$SIGNUP_BEGIN = "
+{SIGNUP_FORM_OPEN}
+<div style='text-align:center;width:100%'>
+{SIGNUP_SIGNUP_TEXT}
+<br />
+".LAN_400."<br /><br /></div>";
+}
+
+if(!defined($SIGNUP_BODY))
+{
+$SIGNUP_BODY = "
+{SIGNUP_XUP}
+<div id='default'>
+<table class='fborder' style='width:99%'>
+{SIGNUP_DISPLAYNAME}
+<tr>
+<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_9."<span style='font-size:15px; color:red'> *</span><br /><span class='smalltext'>".LAN_10."</span></td>
+<td class='forumheader3' style='width:70%'>
+{SIGNUP_LOGINNAME}
+</td>
+</tr>
+{SIGNUP_REALNAME}
+<tr>
+<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_17."<span style='font-size:15px; color:red'> *</span></td>
+<td class='forumheader3' style='width:70%'>
+{SIGNUP_PASSWORD1}
+{SIGNUP_PASSWORD_LEN}
+</td>
+</tr>
+<tr>
+<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_111."<span style='font-size:15px; color:red'> *</span></td>
+<td class='forumheader3' style='width:70%'>
+{SIGNUP_PASSWORD2}
+</td>
+</tr>
+
+<tr>
+<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_112."<span style='font-size:15px; color:red'> *</span></td>
+<td class='forumheader3' style='width:70%'>
+{SIGNUP_EMAIL}
+</td>
+</tr>
+
+<tr>
+<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_SIGNUP_39."<span style='font-size:15px; color:red'> *</span></td>
+<td class='forumheader3' style='width:70%'>
+{SIGNUP_EMAIL_CONFIRM}
+</td>
+</tr>
+
+<tr>
+<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_113."</td>
+<td class='forumheader3' style='width:70%'>
+{SIGNUP_HIDE_EMAIL}
+</td>
+</tr>
+{SIGNUP_USERCLASS_SUBSCRIBE}
+{SIGNUP_EXTENDED_USER_FIELDS}
+{SIGNUP_SIGNATURE}
+{SIGNUP_IMAGES}
+{SIGNUP_TIMEZONE}
+{SIGNUP_IMAGECODE}
+<tr style='vertical-align:top'>
+<td class='forumheader' colspan='2'  style='text-align:center'>
+<input class='button' type='submit' name='register' value='".LAN_123."' />
+<br />
+</td>
+</tr>
+</table>
+</div>
+{SIGNUP_FORM_CLOSE}
+";
+}
+
+if(!defined($SIGNUP_END))
+{
+$SIGNUP_END = "
+";
+}
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/sitedown_template.php 75/e107_themes/templates/sitedown_template.php
--- 6171/e107_themes/templates/sitedown_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/sitedown_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -0,0 +1,40 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/sitedown_template.php,v $
+|     $Revision: 1.2 $
+|     $Date: 2005/12/14 19:28:53 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// ##### SITEDOWN TABLE -----------------------------------------------------------------
+if(!$SITEDOWN_TABLE){
+	$SITEDOWN_TABLE = "
+	<html>
+	<head>
+		<title>{SITEDOWN_TABLE_PAGENAME}</title>
+	</head>
+	<body>
+		<font style='font-size: 14px; color: black; font-family: Tahoma, Verdana, Arial, Helvetica; text-decoration: none'>
+		<div style='text-align:center'><img src='".e_IMAGE."logo.png' alt='Logo' /></div>
+		<hr />
+		<br />
+		<div style='text-align:center'>{SITEDOWN_TABLE_MAINTAINANCETEXT}</div>
+	</body>
+	</html>";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/trackback_template.php 75/e107_themes/templates/trackback_template.php
--- 6171/e107_themes/templates/trackback_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/trackback_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -0,0 +1,12 @@
+<?php
+
+if (!defined('e107_INIT')) { exit; }
+
+$TRACKBACK = "
+<div class='fcaption'>{TITLE}</div>
+{EXCERPT}<br />From: {BLOGNAME}<br /><br />
+";
+
+$TRACKBACK_RENDER_METHOD = TRUE;			/* TRUE=tablerender, FALSE=echo */
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/userposts_template.php 75/e107_themes/templates/userposts_template.php
--- 6171/e107_themes/templates/userposts_template.php	2004-08-04 08:45:08.000000000 -0500
+++ 75/e107_themes/templates/userposts_template.php	2005-12-14 13:28:53.000000000 -0600
@@ -1,85 +1,86 @@
-<?php
-
-// ##### USERPOSTS_COMMENTS TABLE -----------------------------------------------------------------
-if(!$USERPOSTS_COMMENTS_TABLE_START){
-		$USERPOSTS_COMMENTS_TABLE_START = "
-		<div style='text-align:center'>
-		<table class='fborder' style='width:95%'>\n";
-}
-if(!$USERPOSTS_COMMENTS_TABLE){   
-		$USERPOSTS_COMMENTS_TABLE = "
-		<tr>
-			<td class='forumheader3' style='vertical-align:middle; background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center'>
-				{USERPOSTS_COMMENTS_ICON}
-			</td>
-			<td class='forumheader3' style='padding:0; line-height:130%; vertical-align:top;'>
-				<table class='fborder' style='vertical-align:top; height:98%; width:100%; line-height:130%;' cellspacing='0' cellpadding='0'>
-					<tr>
-						<td class='forumheader' style='line-height:130%; font-size:12px;'>
-							{USERPOSTS_COMMENTS_HREF_PRE}<b>{USERPOSTS_COMMENTS_HEADING}</b></a> <span class='smalltext'>({USERPOSTS_COMMENTS_DATESTAMP}) ({USERPOSTS_COMMENTS_TYPE})</span>
-						</td>
-					</tr>
-					<tr>
-						<td class='forumheader3' style='line-height:130%;'>
-							{USERPOSTS_COMMENTS_COMMENT}&nbsp;
-						</td>
-					</tr>
-			</table>
-			</td>
-		</tr>
-		";
-}
-if(!$USERPOSTS_COMMENTS_TABLE_END){
-		$USERPOSTS_COMMENTS_TABLE_END = "
-		</table>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-// ##### USERPOSTS FORUM TABLE --------------------------------------------------------------------
-if(!$USERPOSTS_FORUM_TABLE_START){
-		$USERPOSTS_FORUM_TABLE_START = "
-		<div style='text-align:center'>
-		<form method='post' action='".e_SELF."?".e_QUERY."'>
-		<table class='fborder' style='width:95%'>\n";
-}
-if(!$USERPOSTS_FORUM_TABLE){   
-		$USERPOSTS_FORUM_TABLE .= "
-		<tr>
-			<td class='forumheader3' style='vertical-align:middle; background-color:transparent; border:#517DB1 1px solid; width:10%; text-align:center'>
-				{USERPOSTS_FORUM_ICON}
-			</td>
-			<td class='forumheader3' style='padding:0; line-height:130%; vertical-align:top;'>
-				<table class='fborder' style='vertical-align:top; height:98%; width:100%; line-height:130%;' cellspacing='0' cellpadding='0'>
-					<tr>
-						<td class='forumheader' style='line-height:130%; font-size:12px;'>
-							{USERPOSTS_FORUM_TOPIC_HREF_PRE}<b>{USERPOSTS_FORUM_TOPIC_PRE} {USERPOSTS_FORUM_TOPIC}</b></a>
-							<span class='smalltext'>({USERPOSTS_FORUM_NAME_HREF_PRE}<b>{USERPOSTS_FORUM_NAME}</b></a>)</span>
-							<span class='smalltext'>({USERPOSTS_FORUM_DATESTAMP})</span>
-						</td>
-					</tr>
-					<tr>
-						<td class='forumheader3' style='line-height:130%;'>
-							{USERPOSTS_FORUM_THREAD}
-						</td>
-					</tr>
-			</table>
-			</td>
-		</tr>
-		\n";
-}
-if(!$USERPOSTS_FORUM_TABLE_END){
-		$USERPOSTS_FORUM_TABLE_END = "
-		<tr>
-			<td class='forumheader' colspan='2' style='text-align:right;'>
-				{USERPOSTS_FORUM_SEARCH}
-			</td>
-		</tr>
-		</table>
-		</form>
-		</div>\n";
-}
-// ##### ------------------------------------------------------------------------------------------
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/userposts_template.php,v $
+|     $Revision: 1.4 $
+|     $Date: 2005/12/14 19:28:53 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+if (!defined('e107_INIT')) { exit; }
+
+// ##### USERPOSTS_COMMENTS TABLE -----------------------------------------------------------------
+if(!$USERPOSTS_COMMENTS_TABLE_START){
+	$USERPOSTS_COMMENTS_TABLE_START = "
+	<div style='text-align:center'>
+	<table class='fborder' style='width:95%'>\n";
+}
+if(!$USERPOSTS_COMMENTS_TABLE){
+	$USERPOSTS_COMMENTS_TABLE = "
+	<tr>
+	<td class='fcaption'>
+	{USERPOSTS_COMMENTS_HREF_PRE}<b>{USERPOSTS_COMMENTS_HEADING}</b></a> 
+	<span class='smalltext'>{USERPOSTS_COMMENTS_DATESTAMP} ({USERPOSTS_COMMENTS_TYPE})</span>
+	</td>
+	</tr>
+	<tr>
+	<td class='forumheader3'>
+	{USERPOSTS_COMMENTS_COMMENT}&nbsp;
+	</td>
+	</tr>
+	";
+}
+if(!$USERPOSTS_COMMENTS_TABLE_END){
+	 $USERPOSTS_COMMENTS_TABLE_END = "
+	</table>
+	</div>";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+// ##### USERPOSTS FORUM TABLE --------------------------------------------------------------------
+if(!$USERPOSTS_FORUM_TABLE_START){
+	$USERPOSTS_FORUM_TABLE_START = "
+	<div style='text-align:center'>
+	<form method='post' action='".e_SELF."?".e_QUERY."'>
+	<table class='fborder' style='width:95%'>";
+}
+if(!$USERPOSTS_FORUM_TABLE){
+	$USERPOSTS_FORUM_TABLE .= "
+	<tr>
+	<td class='fcaption'>
+	{USERPOSTS_FORUM_TOPIC_HREF_PRE}<b>{USERPOSTS_FORUM_TOPIC_PRE} {USERPOSTS_FORUM_TOPIC}</b></a>
+	<span class='smalltext'>({USERPOSTS_FORUM_NAME_HREF_PRE}<b>{USERPOSTS_FORUM_NAME}</b></a>)</span>
+	<span class='smalltext'>{USERPOSTS_FORUM_DATESTAMP}</span>
+	</td>
+	</tr>
+	<tr>
+	<td class='forumheader3'>
+	{USERPOSTS_FORUM_THREAD}
+	</td>
+	</tr>
+	";
+}
+if(!$USERPOSTS_FORUM_TABLE_END){
+	$USERPOSTS_FORUM_TABLE_END = "
+	<tr>
+	<td class='forumheader' style='text-align:right'>
+	{USERPOSTS_FORUM_SEARCH}
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+}
+// ##### ------------------------------------------------------------------------------------------
+
+
 ?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/usersettings_template.php 75/e107_themes/templates/usersettings_template.php
--- 6171/e107_themes/templates/usersettings_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/usersettings_template.php	2006-02-20 12:34:14.000000000 -0600
@@ -0,0 +1,198 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/usersettings_template.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2006/02/20 18:34:14 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $usersettings_shortcodes, $pref;
+
+
+$sc_style['CUSTOMTITLE']['pre'] = "
+<tr>
+<td style='width:40%' class='forumheader3'>".LAN_CUSTOMTITLE.":</td>
+<td style='width:60%' class='forumheader2'>
+";
+$sc_style['CUSTOMTITLE']['post'] = "</td></tr>";
+
+$sc_style['PASSWORD_LEN']['pre'] = "<br /><span class='smalltext'>  (".LAN_SIGNUP_1." ";
+$sc_style['PASSWORD_LEN']['post'] = " ".LAN_SIGNUP_2.")</span>";
+
+$sc_style['USERCLASSES']['pre'] = "<tr>
+<td style='width:40%;vertical-align:top' class='forumheader3'>".LAN_USET_5.":".req($pref['signup_option_class'])."
+<br /><span class='smalltext'>".LAN_USET_6."</span>
+</td>
+<td style='width:60%' class='forumheader2'>";
+$sc_style['USERCLASSES']['post'] = "</td></tr>";
+
+$sc_style['AVATAR_UPLOAD']['pre'] = "<tr>
+<td style='width:40%; vertical-align:top' class='forumheader3'>".LAN_415."<br /></td>
+<td style='width:60%' class='forumheader2'>
+";
+$sc_style['AVATAR_UPLOAD']['post'] = "</td></tr>";
+
+$sc_style['PHOTO_UPLOAD']['pre'] = "
+<tr>
+<td colspan='2' class='forumheader'>".LAN_425."</td>
+</tr>
+
+<tr>
+<td style='width:40%; vertical-align:top' class='forumheader3'>".LAN_414."<br /><span class='smalltext'>".LAN_426."</span></td>
+<td style='width:60%' class='forumheader2'>
+";
+$sc_style['PHOTO_UPLOAD']['post'] = "</td></tr>";
+
+
+$sc_style['XUP']['pre'] = "
+<tr>
+<td colspan='2' class='forumheader'>".LAN_435."</td>
+</tr>
+<tr>
+<td style='width:20%; vertical-align:top' class='forumheader3'>".LAN_433."<br /><span class='smalltext'><a href='http://e107.org/generate_xup.php' rel='external'>".LAN_434."</a></span></td>
+<td style='width:80%' class='forumheader2'>
+";
+$sc_style['XUP']['post'] = "</td></tr>";
+
+$USER_EXTENDED_CAT = "<tr><td colspan='2' class='forumheader'>{CATNAME}</td></tr>";
+$USEREXTENDED_FIELD = "
+<tr>
+<td style='width:40%' class='forumheader3'>
+{FIELDNAME}
+</td>
+<td style='width:60%' class='forumheader3'>
+{FIELDVAL} {HIDEFIELD}
+</td>
+</tr> 
+";
+$REQUIRED_FIELD = "{FIELDNAME}<span style='text-align:right;font-size:15px; color:red'> *</span>";
+
+$USERSETTINGS_EDIT = "
+<div style='text-align:center'>
+	<table style='width:auto' class='fborder'>
+
+	<tr>
+	<td colspan='2' class='forumheader'>".LAN_418."</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".LAN_7."<br /><span class='smalltext'>".LAN_8."</span></td>
+	<td style='width:60%' class='forumheader2'>
+	{USERNAME}
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".LAN_9."<br /><span class='smalltext'>".LAN_10."</span></td>
+	<td style='width:60%' class='forumheader2'>
+	{LOGINNAME}
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".LAN_308.req($pref['signup_option_realname'])."</td>
+	<td style='width:60%' class='forumheader2'>
+	{REALNAME}
+	</td>
+	</tr>
+
+	{CUSTOMTITLE}
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".LAN_152."<br /><span class='smalltext'>".LAN_401."</span></td>
+	<td style='width:60%' class='forumheader2'>
+	{PASSWORD1}
+	{PASSWORD_LEN}
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".LAN_153."<br /><span class='smalltext'>".LAN_401."</span></td>
+	<td style='width:60%' class='forumheader2'>
+	{PASSWORD2}
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".LAN_112."</td>
+	<td style='width:60%' class='forumheader2'>
+	{EMAIL}
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".LAN_113."<br /><span class='smalltext'>".LAN_114."</span></td>
+	<td style='width:60%' class='forumheader2'><span class='defaulttext'>
+	{HIDEEMAIL=radio}
+	</span>
+	</td>
+	</tr>
+
+	{USERCLASSES}
+	{USEREXTENDED_ALL}
+
+	<tr><td colspan='2' class='forumheader'>".LAN_USET_8."</td></tr>
+	<tr>
+	<td style='width:40%;vertical-align:top' class='forumheader3'>".LAN_120.req($pref['signup_option_signature'])."</td>
+	<td style='width:60%' class='forumheader2'>
+	{SIGNATURE=cols=58&rows=4}
+	<br />
+	{SIGNATURE_HELP}
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%' class='forumheader3'>".LAN_122.req($pref['signup_option_timezone'])."</td>
+	<td style='width:60%' class='forumheader2'>
+	{TIMEZONE}
+	</td>
+	</tr>
+
+	<tr>
+	<td colspan='2' class='forumheader'>".LAN_420."</td>
+	</tr>
+
+	<tr>
+	<td colspan='2' class='forumheader3' style='text-align:center'>".LAN_404.($pref['im_width'] || $pref['im_height'] ? "<br />".($pref['im_width'] ? MAX_AVWIDTH.$pref['im_width']." pixels. " : "").($pref['im_height'] ? MAX_AVHEIGHT.$pref['im_height']." pixels." : "") : "")."</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%; vertical-align:top' class='forumheader3'>".LAN_422.req($pref['signup_option_image'])."<br /><span class='smalltext'>".LAN_423."</span></td>
+	<td style='width:60%' class='forumheader2'>
+	{AVATAR_REMOTE}
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:40%; vertical-align:top' class='forumheader3'>".LAN_421."<br /><span class='smalltext'>".LAN_424."</span></td>
+	<td style='width:60%' class='forumheader2'>
+	{AVATAR_CHOOSE}
+	</td>
+	</tr>
+	
+	{AVATAR_UPLOAD}
+	{PHOTO_UPLOAD}
+	{XUP}
+
+	<tr style='vertical-align:top'>
+	<td colspan='2' style='text-align:center' class='forumheader'><input class='button' type='submit' name='updatesettings' value='".LAN_154."' /></td>
+	</tr>
+	</table>
+	</div>
+	";
+	
+
+?>
\ No newline at end of file
diff -ruN 6171/e107_themes/templates/user_template.php 75/e107_themes/templates/user_template.php
--- 6171/e107_themes/templates/user_template.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/templates/user_template.php	2006-05-18 10:20:55.000000000 -0500
@@ -0,0 +1,178 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/templates/user_template.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2006/05/18 15:20:55 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+global $user_shortcodes, $pref;
+//Set this to TRUE if you would like any extended user field that is empty to NOT be shown on the profile page
+define("HIDE_EMPTY_FIELDS", FALSE);
+
+$EXTENDED_CATEGORY_START = "<tr><td colspan='2' class='forumheader' style='text-align:left'>{EXTENDED_NAME}</td></tr>";
+
+$EXTENDED_CATEGORY_TABLE = "
+	<tr>
+		<td style='width:40%' class='forumheader3'>
+			{EXTENDED_ICON}&nbsp;
+			{EXTENDED_NAME}
+		</td>
+		<td style='width:60%' class='forumheader3'>{EXTENDED_VALUE}</td>
+	</tr>
+	";
+	
+$EXTENDED_END = "";
+//		$datestamp = $gen->convert_date($user_join, "forum");
+
+$USER_SHORT_TEMPLATE = "
+<tr>
+	<td class='forumheader3' style='width:2%'>{USER_ICON_LINK}</td>
+	<td class='forumheader' style='width:20%'>{USER_ID}: {USER_NAME_LINK}</td>
+	<td class='forumheader3' style='width:20%'>{USER_EMAIL}</td>
+	<td class='forumheader3' style='width:20%'>{USER_JOIN}</td>
+</tr>
+";
+
+$sc_style['USER_SIGNATURE']['pre'] = "<tr><td colspan='2' class='forumheader3' style='text-align:left'>";
+$sc_style['USER_SIGNATURE']['post'] = "</td></tr>";
+
+$sc_style['USER_COMMENTS_LINK']['pre'] = "<tr><td colspan='2' class='forumheader3' style='text-align:left'>";
+$sc_style['USER_COMMENTS_LINK']['post'] = "</td></tr>";
+
+$sc_style['USER_FORUM_LINK']['pre'] = "<tr><td colspan='2' class='forumheader3' style='text-align:left'>";
+$sc_style['USER_FORUM_LINK']['post'] = "</td></tr>";
+
+$sc_style['USER_UPDATE_LINK']['pre'] = "<tr><td colspan='2' class='forumheader3' style='text-align:center'>";
+$sc_style['USER_UPDATE_LINK']['post'] = "</td></tr>";
+
+$sc_style['USER_RATING']['pre'] = "<tr><td colspan='2' style='width:100%' class='forumheader3'><span style='float:left'>".LAN_406."</span></span><span style='float:right;'>";
+$sc_style['USER_RATING']['post'] = "</span></td></tr>";
+
+$sc_style['USER_LOGINNAME']['pre'] = " : ";
+
+if(isset($pref['photo_upload']) && $pref['photo_upload'])
+{
+	$user_picture =  "{USER_PICTURE}";
+	$colspan = " colspan='2'";
+	$main_colspan = "";
+}
+else
+{
+	$user_picture =  "";
+	$colspan = "";
+	$main_colspan = " colspan = '2' ";
+}	
+
+$sc_style['USER_SENDPM']['pre'] = "<tr><td colspan='2' style='width:100%' class='forumheader3'><span style='float:left'>";
+$sc_style['USER_SENDPM']['post'] = "</span><span style='float:right;'>".LAN_425."</span></td></tr>";
+
+if($tp->parseTemplate("{USER_SENDPM}", FALSE, $user_shortcodes))
+{
+	$sendpm = "{USER_SENDPM}";
+}
+else
+{
+	$sendpm = "";
+}
+
+$span = " rowspan='".($sendpm ? "5" : "4")."' ";
+$sc_style['USER_PICTURE']['pre']="<td {$span} class='forumheader3' style='width:20%; vertical-align:middle; text-align:center'>";
+$sc_style['USER_PICTURE']['post']="</td>";
+
+$USER_FULL_TEMPLATE = "
+<div style='text-align:center'>
+<table style='width:95%' class='fborder'>
+<tr>
+	<td colspan='2' class='fcaption' style='text-align:center'>".LAN_142." {USER_ID} : {USER_NAME}{USER_LOGINNAME}</td>
+</tr>
+<tr>
+	$user_picture
+	<td {$main_colspan} class='forumheader3' style='width:100%'>
+		<span style='float:left'>{USER_REALNAME_ICON} ".LAN_308."</span>
+		<span style='float:right; text-align:right'>{USER_REALNAME}</span>
+	</td>
+</tr>
+
+<tr>
+	<td  {$main_colspan} style='width:100%' class='forumheader3'>
+		<span style='float:left'>{USER_EMAIL_ICON} ".LAN_112."</span>
+		<span style='float:right; text-align:right'>{USER_EMAIL_LINK}</span>
+	</td>
+</tr>
+
+<tr>
+	<td  {$main_colspan} style='width:100%' class='forumheader3'>
+		<span style='float:left'>".LAN_406.":</span>
+		<span style='float:right; text-align:right'>{USER_LEVEL}</span>
+	</td>
+</tr>
+
+<tr>
+	<td  {$main_colspan} style='width:100%' class='forumheader3'>
+		<span style='float:left'>".LAN_404.":&nbsp;&nbsp;</span>
+		<span style='float:right; text-align:right'>{USER_LASTVISIT}<br />{USER_LASTVISIT_LAPSE}</span>
+	</td>
+</tr>
+{$sendpm}
+{USER_RATING}
+{USER_SIGNATURE}
+{USER_EXTENDED_ALL}
+<tr>
+	<td colspan='2' class='forumheader'>".LAN_403."</td>
+</tr>
+
+<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_145."</td>
+	<td style='width:70%' class='forumheader3'>{USER_JOIN}<br />{USER_DAYSREGGED}</td>
+</tr>
+
+<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_147."</td>
+	<td style='width:70%' class='forumheader3'>{USER_CHATPOSTS} ( {USER_CHATPER}% )</td>
+</tr>
+
+<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_148."</td>
+	<td style='width:70%' class='forumheader3'>{USER_COMMENTPOSTS} ( {USER_COMMENTPER}% )</td>
+</tr>
+{USER_COMMENTS_LINK}
+
+<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_149."</td>
+	<td style='width:70%' class='forumheader3'>{USER_FORUMPOSTS} ( {USER_FORUMPER}% )</td>
+</tr>
+{USER_FORUM_LINK}
+<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_146."</td>
+	<td style='width:70%' class='forumheader3'>{USER_VISITS}</td>
+</tr>
+{USER_UPDATE_LINK}
+<tr>
+	<td colspan='2' class='forumheader3' style='text-align:center'>
+		<table style='width:95%'>
+			<tr>
+				<td style='width:50%'>{USER_JUMP_LINK=prev}</td>
+				<td style='width:50%; text-align:right'>{USER_JUMP_LINK=next}</td>
+			</tr>
+		</table>
+	</td>
+</tr>
+</table></div>
+{PROFILE_COMMENTS}
+{PROFILE_COMMENT_FORM}
+";
+?>
\ No newline at end of file
Files 6171/e107_themes/vekna_blue/images/bg.gif and 75/e107_themes/vekna_blue/images/bg.gif differ
Files 6171/e107_themes/vekna_blue/images/blank.gif and 75/e107_themes/vekna_blue/images/blank.gif differ
Files 6171/e107_themes/vekna_blue/images/bullet2.gif and 75/e107_themes/vekna_blue/images/bullet2.gif differ
Files 6171/e107_themes/vekna_blue/images/button.png and 75/e107_themes/vekna_blue/images/button.png differ
Files 6171/e107_themes/vekna_blue/images/cap.gif and 75/e107_themes/vekna_blue/images/cap.gif differ
Files 6171/e107_themes/vekna_blue/images/capleft.gif and 75/e107_themes/vekna_blue/images/capleft.gif differ
Files 6171/e107_themes/vekna_blue/images/caption.png and 75/e107_themes/vekna_blue/images/caption.png differ
Files 6171/e107_themes/vekna_blue/images/fcap.png and 75/e107_themes/vekna_blue/images/fcap.png differ
Files 6171/e107_themes/vekna_blue/images/line_bg.gif and 75/e107_themes/vekna_blue/images/line_bg.gif differ
Files 6171/e107_themes/vekna_blue/images/logo4.jpg and 75/e107_themes/vekna_blue/images/logo4.jpg differ
Files 6171/e107_themes/vekna_blue/images/menu1.gif and 75/e107_themes/vekna_blue/images/menu1.gif differ
Files 6171/e107_themes/vekna_blue/images/menubottom.png and 75/e107_themes/vekna_blue/images/menubottom.png differ
Files 6171/e107_themes/vekna_blue/images/menu.png and 75/e107_themes/vekna_blue/images/menu.png differ
diff -ruN 6171/e107_themes/vekna_blue/languages/English.php 75/e107_themes/vekna_blue/languages/English.php
--- 6171/e107_themes/vekna_blue/languages/English.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/vekna_blue/languages/English.php	2005-03-21 06:26:46.000000000 -0600
@@ -0,0 +1,26 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/e107_themes/vekna_blue/languages/English.php,v $
+|     $Revision: 1.1 $
+|     $Date: 2005/03/21 12:26:46 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+
+define("LAN_THEME_1", "'vekna blue' by <a href='http://e107.org' rel='external'>jalist</a>, based on, and with permission from Arach's site, <a href='http://e107.vekna.com' rel='external'>http://e107.vekna.com</a>");
+define("LAN_THEME_2", "Read/Post Comment: ");
+define("LAN_THEME_3", "Comments are turned off for this item");
+define("LAN_THEME_4", "Read the rest ...");
+define("LAN_THEME_5", "Trackbacks: ");
+
+?>
diff -ruN 6171/e107_themes/vekna_blue/nav_menu.css 75/e107_themes/vekna_blue/nav_menu.css
--- 6171/e107_themes/vekna_blue/nav_menu.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/vekna_blue/nav_menu.css	2005-03-10 06:10:51.000000000 -0600
@@ -0,0 +1,110 @@
+div.menuBar,
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over, 
+div.menu,
+div.menu a.menuItem {
+  font: 8pt Tahoma, Verdana, Arial, Helvetica, sans-serif;
+  font-style: normal;
+  font-weight: normal;
+  color: #000000;
+}
+
+div.menuBar {
+  background: url(images/menu1.gif) #fff;
+  padding: 4px 0px 4px 0px;
+  text-align: left;
+  border: 1px solid #a2a2a2;
+}
+
+div.emenuBar {
+  background-color: #d8d8d8;
+  border-top: 1px solid #ffffff;
+  border-bottom: 0px solid #000;
+  text-align: left;
+}
+
+div.menuBar a.menuButton, div.menuButton, div.menuButton_over {
+  background-color: transparent;
+  border: 1px solid #eeedee;
+  color: #000000;
+  cursor: default;
+  left: 0px;
+  margin: 0px;
+  padding: 2px 4px 2px 4px;
+  /* 
+  if using a link icon replace line above with this one
+  padding: 2px 4px 2px 22px;
+  */
+  position: relative;
+  text-decoration: none;
+  top: 0px;
+  z-index: 100;
+}
+
+div.menuBar a.menuButton:hover, div.menuButton:hover, div.menuButton_over {
+  background-color: transparent;
+  border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff;
+  color: #000000;
+}
+
+div.menuBar a.menuButtonActive, div.menuButtonActive, div.menuButtonActive:hover, 
+div.menuBar a.menuButtonActive:hover {
+  background-color: #d5d5d5;
+  border-color: #a5a5a5 #ffffff #ffffff #a5a5a5;
+  color: #000;
+  left: 1px;
+  top: 1px;
+}
+
+div.menu {
+  background-color: #eee;
+  border: 1px solid;
+  border-color: #ffffff #a5a5a5 #a5a5a5 #ffffff;
+  left: 0px;
+  padding: 1px 1px 1px 1px;
+  position: absolute;
+  top: 0px;
+  visibility: hidden;
+  z-index: 101;
+}
+
+div.menu a.menuItem {
+  color: #000000;
+  cursor: default;
+  display: block;
+  padding: 2px 11px 2px 0px;
+  text-decoration: none;
+  white-space: nowrap;
+}
+
+div.menu a.menuItem:hover, div.menu a.menuItemHighlight {
+  background-color: #d5d5d5;
+  color: #000000;
+}
+
+div.menu a.menuItem span.menuItemBuffer {
+  padding: 0px 2px 0px 2px;
+  color: #ffffff;
+}
+
+div.menu a.menuItem:hover span.menuItemBuffer {
+  padding: 0px 2px 0px 2px;
+  color: #000000;
+}
+
+div.menu a.menuItem span.menuItemText {
+	padding: 0px 0px 0px 3px;
+}
+
+div.menu a.menuItem span.menuItemArrow {
+  margin-right: -.75em;
+}
+
+div.menu div.menuItemSep {
+  border-top: 1px solid #a5a5a5;
+  border-bottom: 1px solid #ffffff;
+  margin: 4px 2px;
+}
+
+a.menuItem.header {
+  border-bottom: 1px solid #b3b3b3;
+}
\ No newline at end of file
Files 6171/e107_themes/vekna_blue/preview.jpg and 75/e107_themes/vekna_blue/preview.jpg differ
diff -ruN 6171/e107_themes/vekna_blue/style.css 75/e107_themes/vekna_blue/style.css
--- 6171/e107_themes/vekna_blue/style.css	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/vekna_blue/style.css	2005-03-24 04:45:31.000000000 -0600
@@ -0,0 +1,288 @@
+body {
+	background: url(images/bg.gif) #e5e5e5 fixed no-repeat left bottom; margin: 10px; text-align: left
+}
+body {
+	font: 10px verdana, arial, sans-serif
+}
+
+#logo {
+	background-image: url(images/logo4.jpg);
+	border: 1px solid #999;
+	padding: 1px;
+	margin: 0px;
+	width: 800px;
+	height: 80px;
+}
+
+.caption {
+	background-image: url(images/caption.png);
+	width: 200px;
+	height: 34px;
+}
+
+.menubody {
+	background-image: url(images/menu.png);
+	width: 200px;
+	background-repeat: repeat-y;
+}
+
+.menubottom {
+	background-image: url(images/menubottom.png);
+	width: 200px;
+	height: 7px;
+	background-repeat: no-repeat;
+}
+
+.captionpadder {
+	padding-top: 2px;
+	padding-left: 4px;
+}
+
+.menupadder {
+	padding: 8px;
+	width: 178px;
+}
+
+
+td {
+	font: 10px verdana, arial, sans-serif
+}
+a {
+	color: #5173b7; text-decoration: underline
+}
+a:hover {
+	color: black; text-decoration: underline
+}
+.indent {
+	border-right: #ffffff 1px solid; padding-right: 3px; border-top: #000 1px solid; padding-left: 3px; padding-bottom: 3px; margin: 5px; border-left: #000 1px solid; color: #000060; padding-top: 3px; border-bottom: #ffffff 1px solid; background-color: #ebebeb
+}
+.smalltext {
+	font-size: 9px; color: #444; letter-spacing: -1px
+}
+.smallblacktext {
+	font-weight: normal; font-size: 9px; color: #000; line-height: normal; font-style: normal; font-variant: normal
+}
+.defaulttext {
+	color: #000
+}
+.mediumtext {
+	font-size: 11px; color: #000
+}
+.captiontext {
+	font: bold 14px/120% verdana, arial, helvetica, sans-serif; color: #000
+}
+.tbox {
+	border-right: #559 1px solid; border-top: #559 1px solid; font-size: 10px; min-height: 15px; border-left: #559 1px solid; color: #005; border-bottom: #559 1px solid; font-family: verdana, arial, helvetica, sans-serif; background-color: #e4e9f6
+}
+.tbox.chatbox {
+	width: 80%;
+	margin-left: auto;
+	margin-right: auto;
+}
+.button {
+	border-right: #5e5d63 1px solid; border-top: #5e5d63 1px solid; font-size: 10px; background-image: url(images/button.png); border-left: #5e5d63 1px solid; color: #000; border-bottom: #5e5d63 1px solid; text-align: center
+}
+.button:hover {
+	background-image: url(images/button_hover2.png); color: #fff
+}
+.nextprev {
+	border-right: #77a 1px solid; padding-right: 1px; border-top: #77a 1px solid; padding-left: 1px; font-size: 9px; background-image: url(images/button.png); padding-bottom: 1px; border-left: #77a 1px solid; color: #000; padding-top: 1px; border-bottom: #77a 1px solid; background-color: #fcfcfc; text-align: center
+}
+.nextprev:hover {
+	background-image: url(images/button_hover.png)
+}
+form {
+	margin: 2px 0px 0px
+}
+.spacer {
+	padding: 0 0 3px 0;
+}
+hr {
+	border-top: #006699 1px solid; vertical-align: bottom; width: 100%; border-bottom: #c6d6d6 1px solid; height: 2px; text-align: center
+}
+.border {
+	border-right: #91a7d4 2px solid; border-top: #91a7d4 2px solid; border-left: #91a7d4 2px solid; border-bottom: #91a7d4 2px solid; background-color: transparent
+}
+
+.infobar {
+	border-right: #ccc 1px solid; padding-right: 4px; border-top: #fff 1px solid; padding-left: 4px; font-size: 10px; background-image: url(images/cap1.gif); padding-bottom: 4px; border-left: #fff 1px solid; color: #000; padding-top: 2px; border-bottom: #ccc 1px solid; background-color: #e2e2e2
+}
+p {
+	margin-top: 0px
+}
+.fborder {
+	padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px
+}
+.fbdefault {
+	border-right: #bbb 1px solid; border-top: #bbb 1px solid; margin: 0px; border-left: #bbb 1px solid; border-bottom: #bbb 1px solid; background-color: #fff; text-align: left
+}
+.forumheader {
+	border-right: #ccc 1px solid; padding-right: 4px; border-top: #888 1px solid; padding-left: 4px; font-weight: bolder; font-size: 12px; padding-bottom: 4px; border-left: #888 1px solid; color: #009; padding-top: 4px; border-bottom: #ccc 1px solid; background-color: #91a7d4; text-align: left
+}
+.forumheader2 {
+	border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; font-size: 12px; padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #efefef; text-align: left
+}
+.f2default {
+	border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; font-size: 12px; padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #efefef; text-align: left
+}
+.forumheader3 {
+	border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; font-size: 11px; padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #fafafa; text-align: left
+}
+.f3default {
+	border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; font-size: 11px; padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #fafafa; text-align: left
+}
+.fcaption {
+	border-right: #557 1px solid; padding-right: 3px; border-top: #557 1px solid; padding-left: 3px; font-weight: bold; font-size: 11px; background-image: url(images/fcap.png); padding-bottom: 3px; border-left: #557 1px solid; color: #333; padding-top: 3px; border-bottom: #557 1px solid; background-color: #dfdfdf; text-align: left
+}
+.fcdefault {
+	border-right: #557 1px solid; padding-right: 3px; border-top: #557 1px solid; padding-left: 3px; font-weight: bold; font-size: 11px; background-image: url(images/fcap.png); padding-bottom: 3px; border-left: #557 1px solid; color: #333; padding-top: 3px; border-bottom: #557 1px solid; background-color: #dfdfdf; text-align: left
+}
+.fcaption2 {
+	border-right: #559 1px solid; padding-right: 0px; border-top: #559 1px solid; padding-left: 8px; font-weight: bold; background-image: url(images/fcap.png); padding-bottom: 2px; border-left: #559 1px solid; color: #559; padding-top: 2px; border-bottom: #559 1px solid; background-color: #e6e6e6
+}
+.fcdefault {
+	background: #cccccc; color: #fff
+}
+.finfobar {
+	border-right: #c3bdbd 1px solid; padding-right: 4px; border-top: #c3bdbd 1px solid; padding-left: 4px; background-image: url(forum/finfobar.png); padding-bottom: 4px; border-left: #c3bdbd 1px solid; color: #000; padding-top: 4px; border-bottom: #c3bdbd 1px solid; background-color: #ccc8c8
+}
+a.forumlink {
+	color: #333; text-decoration: none
+}
+a.forumlink:hover {
+	color: #000
+}
+.helpbox {
+	border-right: red 0px; border-top: red 0px; font: 9px tahoma, verdana, arial, helvetica, sans-serif; border-left: red 0px; color: #000; border-bottom: red 0px; background-color: transparent
+}
+#wrapptable {
+	border-right: #ccc 4px solid; border-top: #ccc 4px solid; background: #fff; font: 12px verdana, arial, sans-serif; border-left: #ccc 4px solid; border-bottom: #ccc 4px solid
+}
+.borderx {
+	border-right: #ccc 1px solid; padding-right: 1px; border-top: #ccc 1px solid; padding-left: 1px; margin-bottom: 0.3em; padding-bottom: 1px; border-left: #ccc 1px solid; padding-top: 1px; border-bottom: #ccc 1px solid
+}
+.bordery {
+	border-right: #ccc 1px solid; padding-right: 1px; border-top: #ccc 1px solid; padding-left: 1px; padding-bottom: 1px; border-left: #ccc 1px solid; padding-top: 1px; border-bottom: #ccc 1px solid
+}
+#line {
+	background: url(images/line_bg.gif) repeat-x left top
+}
+.borderx#line {
+	background: url(images/line_bg.gif) repeat-x left top
+}
+.line2 {
+	border-right: #ccc 1px solid; padding-right: 3px; border-top: #ccc 1px solid; padding-left: 3px; font-weight: bolder; background: url(images/line_bg.gif) repeat-x; padding-bottom: 3px; border-left: #ccc 1px solid; color: #559; padding-top: 3px; border-bottom: #ccc 1px solid
+}
+.incontent {
+	padding-right: 1em; padding-left: 1em; padding-bottom: 0.5em; padding-top: 0.5em
+}
+a.clean {
+	font-weight: bold; color: #777; text-decoration: none
+}
+a.clean:hover {
+	color: #000; text-decoration: none
+}
+.fl_left {
+	float: left; margin: 2em 0.3em 0.3em; width: 285px
+}
+h6 {
+	border-right: #999999 3px double; padding-right: 1em; border-top: #999999 3px double; padding-left: 1em; font-weight: bolder; font-size: 11px; background: #96aad6; padding-bottom: 0.3em; margin: 0px 50px 0px 0px; border-left: #999999 3px double; color: #fff; padding-top: 0.3em; border-bottom: medium none; text-align: left
+}
+h5 {
+	border-right: #999999 1px solid; padding-right: 1em; border-top: #999999 1px solid; padding-left: 1em; background: #dadade; padding-bottom: 0.3em; margin: 0px 1px; border-left: #999999 1px solid; color: black; padding-top: 0.3em; border-bottom: #999999 1px solid
+}
+h4 {
+	clear: both; font-weight: bolder; font-size: 10px; margin: 0.3em 0px 0.5em; color: #559;
+}
+h4 img {
+	padding-right: 0px; padding-left: 0px; float: right; padding-bottom: 0px; padding-top: 0px; position: relative; top: -20px
+}
+lefticons {
+	padding-right: 0px; padding-left: 0px; float: right; padding-bottom: 0px; margin: 0px; padding-top: 0px; position: relative; top: 2px
+}
+.box_red {
+	border-right: #aaa 1px solid; padding-right: 0.3em; border-top: #aaa 1px solid; padding-left: 0.3em; background: url(images/box_bgshade_lbl.gif) repeat-x 50% bottom; padding-bottom: 0.3em; margin: 0px; border-left: #aaa 1px solid; color: #559; padding-top: 0.3em; border-bottom: #aaa 1px solid
+}
+.box_red ul {
+	padding-right: 0px; padding-left: 0px; list-style-position: inside; list-style-image: url(images/bullet2.gif); padding-bottom: 0px; margin: 0px 0.5em 0.8em; padding-top: 0px
+}
+.box_red ul li {
+	line-height: 17px
+}
+.box_red ul li a {
+	color: black; text-decoration: none
+}
+.box_red ul li a:hover {
+	color: #869ecf
+}
+#menu {
+	clear: both; border-right: #777 1px solid; border-top: #777 1px solid; font-size: 9px; background: url(images/menu1.gif) #fff; border-left: medium none; border-bottom: #777 1px solid; height: 20px
+}
+#menu ul {
+	padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; list-style-type: none
+}
+ul.nobullets {
+	padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; list-style-type: none
+}
+.jsmenu ul {
+	padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; list-style-type: none
+}
+#menu li {
+	padding-right: 0px; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; width: 9%; padding-top: 0px; height: 20px
+}
+#menu a {
+	display: block; background: url(images/menu1.gif) #eee; border-left: #7e7e7e 1px solid; width: 100%; color: #000; line-height: 20px; height: 20px; text-align: center; text-decoration: none
+}
+#menu a span {
+	display: block; border-left: #fff 1px solid; width: 100%; height: 20px
+}
+#menu a:hover {
+	background-position: 100% -36px; cursor: pointer; background-color: #ddd
+}
+#menu a.selected {
+	background-position: 100% -36px; cursor: pointer; background-color: #ddd
+}
+.hide {
+	display: none
+}
+#sub span {
+	display: none
+}
+li#home {
+	width: 11%
+}
+li#news {
+	width: 11%
+}
+li#forum {
+	width: 11%
+}
+li#admin span {
+	border-right: #7e7e7e 1px solid
+}
+li#empty {
+	border-left: #7e7e7e 1px solid
+}
+li#admin {
+	background-color: red
+}
+.jsmenu {
+	border-right: #555 1px solid; padding-right: 1px; border-top: #555 1px solid; display: none; padding-left: 1px; padding-bottom: 1px; border-left: #555 1px solid; padding-top: 1px; border-bottom: #555 1px solid; position: absolute; top: 30px; background-color: #fff
+}
+.jsmenu li {
+	font-size: 10px; margin: 0px; border-bottom: #fff 1px solid; font-family: verdana,sans-serif
+}
+.jsmenu li.separator {
+	padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; line-height: 1px; padding-top: 0px; height: 1px; background-color: #fff
+}
+.jsmenu li a {
+	border-right: #aaa 1px solid; padding-right: 2px; border-top: #aaa 1px solid; display: block; padding-left: 6px; padding-bottom: 2px; border-left: #aaa 1px solid; color: #000; padding-top: 1px; border-bottom: #aaa 1px solid; text-decoration: none
+}
+.jsmenu a:hover {
+	background: #afafaf
+}
+
+ul, ol {
+	margin-top: 0;
+	margin-bottom: 0;
+}
\ No newline at end of file
diff -ruN 6171/e107_themes/vekna_blue/theme.php 75/e107_themes/vekna_blue/theme.php
--- 6171/e107_themes/vekna_blue/theme.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/e107_themes/vekna_blue/theme.php	2005-12-14 13:28:53.000000000 -0600
@@ -0,0 +1,188 @@
+<?php
+/*
++---------------------------------------------------------------+
+|	e107 website system
+|
+|	Steve Dunstan 2001-2005
+|	http://e107.org
+|	jalist@e107.org
+|
+|	Released under the terms and conditions of the
+|	GNU General Public License (http://gnu.org).
++---------------------------------------------------------------+
+*/
+
+if (!defined('e107_INIT')) { exit; }
+
+// [multilanguage]
+@include_once(e_THEME."vekna_blue/languages/".e_LANGUAGE.".php");
+@include_once(e_THEME."vekna_blue/languages/English.php");
+
+// [theme]
+$themename = "vekna blue";
+$themeversion = "1.0";
+$themeauthor = "Steve Dunstan [jalist]";
+$themeemail = "jalist@e107.org";
+$themewebsite = "http://e107.org";
+$themedate = "09/03/2005";
+$themeinfo = "Based on, and with permission from Arach's site, http://e107.vekna.com";
+define("STANDARDS_MODE", TRUE);
+define("IMODE", "lite");
+$xhtmlcompliant = TRUE;
+$csscompliant = TRUE;
+
+define("THEME_DISCLAIMER", "<br /><i>".LAN_THEME_1."</i>");
+
+function theme_head() {
+	return "<link rel='stylesheet' href='".THEME_ABS."nav_menu.css' />\n";
+}
+
+// [layout]
+
+$layout = "_default";
+
+/*
+to use an icon image next to links, add the following line ...
+{SITELINKS_ALT=".e_IMAGE."blah.png}
+instead of
+{SITELINKS_ALT=no_icons}
+then make change to nav_menu.css (documented in that file)
+*/
+
+$HEADER = "
+<table id='wrapptable' cellspacing='2' cellpadding='2' style='width: 800'> 
+<tr>
+<td colspan='2'>
+<div>{SITELINKS_ALT=no_icons}</div>
+</td>
+</tr>
+<tr>
+<td colspan='2'>
+<div id='logo'>
+&nbsp;... {SITENAME}
+</div>
+</td>
+</tr>
+<tr>
+<td style='width: 600px; vertical-align: top;'>
+{SETSTYLE=main}
+";
+
+$FOOTER = "
+</td>
+<td style='width:200px; vertical-align: top;'>
+{SETSTYLE=menu}
+{MENU=1}
+</td>
+</tr>
+<tr>
+<td class='infobar' colspan='2' style='text-align: center;'>{SITEDISCLAIMER}<br />{THEMEDISCLAIMER}</td>
+</tr>
+</table>
+";
+
+$CUSTOMHEADER = "
+<table id='wrapptable' cellspacing='2' cellpadding='2' style='width: 800'> 
+<tr>
+<td colspan='2'>
+<div>{SITELINKS_ALT=no_icons}</div>
+</td>
+</tr>
+<tr>
+<td colspan='2'>
+<div id='logo'>
+&nbsp;... {SITENAME}
+</div>
+</td>
+</tr>
+<tr>
+<td style='width: 800px; vertical-align: top;'>
+{SETSTYLE=main}
+";
+
+$CUSTOMFOOTER = "
+</td>
+</tr>
+<tr>
+<td class='infobar' colspan='2' style='text-align: center;'>{SITEDISCLAIMER}<br />{THEMEDISCLAIMER}</td>
+</tr>
+</table>
+";
+
+$CUSTOMPAGES = "forum.php forum_post.php forum_viewforum.php forum_viewtopic.php user.php submitnews.php download.php links.php comment.php stats.php usersettings.php documentation";
+
+$NEWSSTYLE = "
+<div class='spacer'>
+<div class='borderx'><div class='line2'>{NEWSTITLE}</div>
+<div class='incontent'>{NEWSBODY}{EXTENDED}</div>
+<div class='infobar'>{NEWSAUTHOR} on {NEWSDATE} | {NEWSCOMMENTS}{TRACKBACK}</div>
+</div>
+</div>
+";
+
+define("ICONSTYLE", "");
+define("COMMENTLINK", LAN_THEME_2);
+define("COMMENTOFFSTRING", LAN_THEME_3);
+define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
+define("EXTENDEDSTRING", LAN_THEME_4);
+define("POST_EXTENDEDSTRING", " ]<br />");
+define("TRACKBACKSTRING", LAN_THEME_5);
+define("TRACKBACKBEFORESTRING", " | ");
+
+
+// [linkstyle]
+
+
+
+
+define('PRELINK', "<ul>");
+define('POSTLINK', "</ul>");
+define('LINKSTART', "<li>");
+define("LINKSTART_HILITE", "");
+define('LINKEND', "</li>");
+define('LINKDISPLAY', 1);
+define('LINKALIGN', "left");
+
+
+//	[tablestyle]
+
+function tablestyle($caption, $text, $mode)
+{
+	global $style;
+	if($style == "menu")
+	{
+		echo "<div class='spacer'><div class='caption'><div class='captionpadder'><h4>{$caption}</h4></div></div><div class='menubody'><div class='menupadder'>{$text}</div></div><div class='menubottom'></div></div>";	
+	}
+	else
+	{
+		if($caption)
+		{
+			echo "<div class='spacer'>\n<div class='borderx'><div class='line2'>{$caption}</div>\n<div class='incontent'>{$text}</div>\n</div>\n";
+		}
+		else
+		{
+			echo "<div class='spacer'>\n<div class='borderx'>\n<div class='incontent'>{$text}</div>\n</div>\n";
+		}
+	}
+}
+
+$COMMENTSTYLE = "
+<table style='width: 100%;' cellspacing='10'>
+<tr>
+<td style='width: 30%; text-align: right; vertical-align: top;'><span class='mediumtext'><b>{USERNAME}</b></span><br /><span class='smalltext'>{TIMEDATE}</span><br />{AVATAR}<span class='smalltext'>{REPLY}</span></td>
+<td style='width: 70%;'>
+{COMMENT} {COMMENTEDIT}
+</td>
+</tr>
+</table>
+";
+
+$CHATBOXSTYLE = "
+<img src='".THEME_ABS."images/bullet2.gif' alt='' style='vertical-align: middle;' />
+<b>{USERNAME}</b>
+<div class='smalltext'>
+{MESSAGE}
+</div>
+<br />";
+
+?>
\ No newline at end of file
Files 6171/e107_themes/wan/images/bar2edge.gif and 75/e107_themes/wan/images/bar2edge.gif differ
Files 6171/e107_themes/wan/images/bar2.gif and 75/e107_themes/wan/images/bar2.gif differ
Files 6171/e107_themes/wan/images/bar.jpg and 75/e107_themes/wan/images/bar.jpg differ
Files 6171/e107_themes/wan/images/bullet1.gif and 75/e107_themes/wan/images/bullet1.gif differ
Files 6171/e107_themes/wan/images/bullet2.gif and 75/e107_themes/wan/images/bullet2.gif differ
Files 6171/e107_themes/wan/images/cap.png and 75/e107_themes/wan/images/cap.png differ
Files 6171/e107_themes/wan/images/desktop.gif and 75/e107_themes/wan/images/desktop.gif differ
Files 6171/e107_themes/wan/images/header.png and 75/e107_themes/wan/images/header.png differ
Files 6171/e107_themes/wan/images/iconmail.png and 75/e107_themes/wan/images/iconmail.png differ
Files 6171/e107_themes/wan/images/iconprint.png and 75/e107_themes/wan/images/iconprint.png differ
diff -ruN 6171/e107_themes/wan/style.css 75/e107_themes/wan/style.css
--- 6171/e107_themes/wan/style.css	2004-08-15 07:21:24.000000000 -0500
+++ 75/e107_themes/wan/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,397 +0,0 @@
-a:link {
- color: #333333;
- font-weight: bold; 
- text-decoration: none;
- }
-a:visited {
- color: #333333;
- font-weight: bold;
- text-decoration: none;
- }
-a:hover {
- color: #333333;
- font-weight: bold; 
- text-decoration: underline;
-}
-body {
-	font-size: 12px;
-	color: #000;
-	background-color: #6a6a6a;
-	margin:0px;
-}
-p { 
- margin-top: 0px;
- }
-h3 { 
- font-family: verdana, arial, "ms sans serif", sans-serif;
- font-size: 16px; 
- margin: 10px;
- line-height: 18px;
- padding-left: 5px;
- color: #e9ffe9;
- }
-.header { 
- font-family: verdana, arial, "ms sans serif", sans-serif;
- font-size: 13px; 
- font-weight: bold;
- margin: 10px;
- line-height: 13px;
- color: #333333;
- }
-.small
- { 
- font-family: verdana, arial, "ms sans serif", sans-serif; 
- font-size: 10px; 
- font-weight: normal;
- line-height: 14px;
- color: #e9ffe9;
- }
-.small a,.small a:visited
-{
- color: #e9ffe9;
- font-weight: bold;
-} 
-.smalldark
- { 
- font-family: verdana, arial, "ms sans serif", sans-serif; 
- font-size: 10px; 
- font-weight: normal;
- line-height: 14px;
- color: #333333;
- }
-.smalldark a,.smalldark a:visited
- {
- color: #333333;
- font-weight: bold;
- }
-.basic
- { 
- max-width: 100%;
- font-family: verdana, arial, "ms sans serif", sans-serif; 
- font-size: 10px; 
- line-height: 10px;
- padding-left: 2px;
- color: #5a6f5a;
- vertical-align: top;
- }
-.basic a,.basic a:visited
- {
- color: #46644c;
- }
-input, textarea, select {
- background-color: #cccccc;
- border-style: solid;
- border-width: 1px;
- font-family: verdana, arial, sans-serif;
- font-size: 10px;
- color: #333333;
- padding: 0px;
-}
-.smalltext {
-    background: none;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color:#000;
-	text-align: right;
-}
-.smallblacktext {
-    background: none;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 10px;
-	font-style: normal;
-	color:#000;
-}
-.defaulttext {
-    background: none;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 12px;
-	font-style: normal;
-	color:#000;
-}
-.defaultwhitetext {
-    background: none;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 12px;
-	font-style: normal;
-	color:#ffffff;
-}
-.defaultblacktext {
-    background: none;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 12px;
-	font-style: normal;
-	color:#000;
-}
-.mediumtext {
-    background: none;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 11px;
-	font-style: normal;
-	color:#000;
-}
-.captiontext {
-    background: none;
-	letter-spacing: 0.4em; 
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 18px;
-	color:#5a6f5a;
-}
-.tbox{
-	background-color: #cccccc;
-	border-bottom: #333333 1px solid;
-	border-left: #333333 1px solid;
-	border-right: #333333 1px solid;
-	border-top: #333333 1px solid;
-	color: #333333;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 10px;
-}
-.button{
-	background-color: #cccccc;
-	border-bottom: #333333 1px solid;
-	border-left: #333333 1px solid;
-	border-right: #333333 1px solid;
-	border-top: #333333 1px solid;
-	color: #333333;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 9px;
-	text-align:center;
-}
-form {
-	margin: 0px 0px 0px 0px;
-}
-.spacer{
-	padding-bottom : 2px;
-	padding-left : 0px;
-	padding-right : 2px;
-	padding-top : 2px;
-}
-hr {
-	border-top: #666 1px solid;
-	border-bottom: #eee 1px solid;
-	height: 2px;
-	width: 92%;
-	text-align:center;
-}
-.border {
-	border-bottom: #000000 1px solid;
-	border-left: #000000 1px solid;
-	border-right: #000000 1px solid;
-	border-top: #000000 1px solid;
-}
-.caption {
-	border-bottom: #000000 1px solid; 
-	letter-spacing: 0.2em; 
-	padding-bottom: 2px;
-	padding-left: 2px;
-	padding-right: 2px;
-	padding-top: 2px;
-	background-color: #333333;
-	color: #ffffff;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 11px;
-}
-.bodytable {
-	background-color: #cccccc;
-	border-bottom: #cccccc 1px solid;
-	border-left: #cccccc 1px solid;
-	border-right: #cccccc 1px solid;
-	border-top: #cccccc 1px solid;
-	padding-bottom: 8px;
-	padding-left: 8px;
-	padding-right: 8px;
-	padding-top: 8px;
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 12px;
-	font-style: normal;
-	color:#000;
-}
-
-.nextprev {
-	background-color: #E3E1E1;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-	text-align:right;
-}
-.fborder {
-	border-bottom: #000000 1px solid;
-	border-left: #000000 1px solid;
-	border-right: #000000 1px solid;
-	border-top: #000000 1px solid;
-	background-color: #fff;
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#000;
-	padding: 4px;
-	background-image : url(forum/fcap2.png);
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader2{
-	background-color: #EFEFEF;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 14px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.forumheader3{
-	background-color: #E3E1E1;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	font-size: 11px;
-	color:#000;
-	padding: 4px;
-	border: #C3BDBD 1px solid;
-}
-
-.fcaption {
-	border-bottom: #000 1px solid;
-	border-left: #000 1px solid;
-	border-right: #000 1px solid;
-	border-top: #000 1px solid;
-	padding-bottom: 2px;
-	padding-left: 8px;
-	padding-right: 0px;
-	padding-top: 2px;
-	background-color: #C9C7C7;
-	font-family: verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(forum/fcap.png);
-	font-size: 12px;
-	color:#fff;
-}
-
-.helpbox {
-	border-bottom: #fff 1px solid;
-	border-left: #fff 1px solid;
-	border-right: #fff 1px solid;
-	border-top: #fff 1px solid;
-	background-color: transparent;
-	color:#000;
-	font-family: tahoma, verdana, arial, helvetica, sans-serif;
-	font-size: 9px;
-}
-
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
-
-table.bclr1 {
-	background-color: #ffffff;
-	width: 98%;
-	border: 0px;
-}
-
-table.bclr1a {
-	background-color: #ffffff;
-	width: 100%;
-	border: 0px;
-}
-
-table.bclr2 {
-	background-color: #5A6F5A;
-	border: 0px;
-}
-
-table.bclr2a {
-	background-color: #5A6F5A;
-	border: 0px;
-	width: 100%;
-}
-
-table.bclr3 {
-	background-color: #7F907F;
-	border: 0px;
-	width: 100%;
-}
-
-table.bclr4 {
-	background-color: #7C8AA4;
-	border: 0px;
-	width: 100%;
-}
-
-table.bclr5 {
-	background-color: #CCCCCC;
-	border: 0px;
-	width: 100%;
-}
-
-table.mw1 {
-	max-width: 100%;
-	border: 0px;
-}
-
-table.base {
-	border: 0px;
-	width: 100%;
-}
-
-td {
-	font-family: verdana, arial, "ms sans serif", sans-serif;
-	font-size: 10px;
-	font-style: normal;
-}
-
-td.tclr1 {
-	background-color: #5A6F5A;
-	text-align: left;
-}
-
-
-td.tclr2 {
-	background-color: #5A6F5A;
-	font-family: verdana, arial, "ms sans serif", sans-serif; 
-	font-size: 10px; 
-	font-weight: normal;
-	line-height: 14px;
-	color: #e9ffe9;
-	text-align: right;
- }
-
-td.bclr2a {
-	max-width: 100%;
-	background-color: #5A6F5A;
-	font-family: verdana, arial, "ms sans serif", sans-serif; 
-	font-size: 10px; 
-	font-weight: normal;
-	line-height: 14px;
-	color: #e9ffe9;
-	text-align: right;
- }
-
-td.tclr3 {
-	background-color: #7f907f;
-	font-family: verdana, arial, "ms sans serif", sans-serif; 
-	font-size: 10px; 
-	font-weight: normal;
-	line-height: 14px;
-	color: #e9ffe9;
-	text-align: center;
-}
-
-td.tclr3a {
-	background-color: #7f907f;
-	font-family: verdana, arial, "ms sans serif", sans-serif; 
-	font-size: 10px; 
-	font-weight: normal;
-	line-height: 14px;
-	color: #e9ffe9;
-}
-
-td.tclr4 {
-	background-color: #9FAC9F;
-	font-family: verdana, arial, "ms sans serif", sans-serif; 
-	font-size: 10px; 
-	line-height: 10px;
-	padding-left: 2px;
-	color: #5a6f5a;
-}
\ No newline at end of file
diff -ruN 6171/e107_themes/wan/theme.php 75/e107_themes/wan/theme.php
--- 6171/e107_themes/wan/theme.php	2004-08-15 07:21:24.000000000 -0500
+++ 75/e107_themes/wan/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,184 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	wanker theme file
-|
-|	Ricky Rivera 2002
-|	http://lsof.host.sk
-|	Ricky12369@host.sk
-|
-|	Based off "wanker" from Open Source Web Design
-|	http://www.oswd.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "wanker";
-$themeversion = "2.0";
-$themeauthor = "Ricky";
-$themedate = "30/07/02";
-$themeinfo = "based on 'wanker' by deadbeat, compatible with e107 v5+";
-
-// [layout]
-
-$layout = "_default";
-
-$HEADER = "
-
-<div>
-<table cellspacing='0' cellpadding='2' class='bclr1'><tr><td>
-<table cellspacing='0' cellpadding='1' class='bclr2a'><tr><td>
-<table cellspacing='0' cellpadding='1' class='bclr3'><tr><td>
-<table cellspacing='1' cellpadding='0' class='mw1'>
-<tr>
-<td style='text-align: center'>
-<table cellspacing='0' cellpadding='1' class='bclr4'>
-		
-<tr><td class='tclr1'><h3>".SITENAME." // ".SITETAG."</h3></td></tr>
-<tr><td class='tclr2'><b>:..: :'': :.: :: :::. ::''&nbsp;&nbsp;</b></td></tr>
-</table>
-</td>
-</tr>
-<tr>
-<td style='text-align: right'>
-<table cellspacing='1' cellpadding='4' class='bclr2'>
-<tr>
-{SITELINKS=flat}
-</tr>
-</table>	
-</td>
-</tr>
-<tr>
-<td>
-<table cellspacing='1' cellpadding='2' class='bclr2a'>
-<tr><td>
-<table cellspacing='0' cellpadding='0' class='bclr5'>
-<tr>
-<td style='width:20%; vertical-align: top;'>
-{MENU=1}
-</td>
-<td style='width:60%; vertical-align: top;'>";
-
-$FOOTER = "
-
-<div style='text-align:center'>
-{SITEDISCLAIMER}
-</div>
-</td>
-<td style='width:20%; vertical-align:top'>
-{MENU=2}
-</td>		
-</tr></table>
-</td></tr>
-<tr>
-<td class='bclr2a'>.: 
-{CUSTOM=quote}
-</td>
-</tr>	
-</table>
-</td>
-</tr>
-<tr>
-<td class='smalltext'>design: <a href='http://www.oswd.org/userinfo.phtml?user=deadbeat' rel='external'>wanker</a> by <a href='mailto:jeff@hype52.com' rel='external'>deadbeat</a> // based on <a href='http://www.oswd.org/userinfo.phtml?user=whompy' rel='external'>libra</a> by <a href='http://www.oswd.org/userinfo.phtml?user=whompy' rel='external'>whompy</a> // <a href='http://www.oswd.org' rel='external'>open source web design</a></td>
-</tr>
-</table>
-</td></tr>
-</table>
-</td></tr></table>							
-</td></tr></table>
-</div>
-";
-
-//	[tablestyle]
-
-function tablestyle($caption, $text){
-	if($caption != ""){
-		echo"
-<table cellpadding='0' cellspacing='2' class='base'>
-	<tr>
-		<td class='basic'>
-		<table cellspacing='0' cellpadding='1' class='bclr2a'><tr><td>
-		<table cellspacing='0' cellpadding='2' class='bclr1a'><tr><td>
-			<table cellspacing='2' cellpadding='2' class='bclr3'>
-				<tr><td class='tclr3a'><b>".$caption." .:</b></td></tr>
-				<tr><td class='tclr4'>".$text."</td></tr>
-			</table>
-		</td></tr></table>							
-		</td></tr></table>
-	</td></tr>
-</table>";
-	}else{
-		echo "
-<table cellpadding='2' cellspacing='5' style='border: 0px'>
-	<tr>
-		<td class='basic'>
-		<table cellspacing='0' cellpadding='1' class='bclr2a'><tr><td>
-		<table cellspacing='0' cellpadding='2' class='bclr1a'><tr><td>
-			<table cellspacing='2' cellpadding='2' class='bclr3'>
-				<tr><td class='tclr4'>".$text."</td></tr>
-			</table>
-		</td></tr></table>							
-		</td></tr></table>
-	</td></tr>
-</table>";
-	}
-}
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-<table cellpadding='0' cellspacing='2' class='base'>
-<tr>
-<td class='basic'>
-<table cellspacing='0' cellpadding='1' class='bclr2a'><tr><td>
-<table cellspacing='0' cellpadding='2' class='bclr1a'><tr><td>
-<table cellspacing='2' cellpadding='2' class='bclr3'>
-<tr><td class='tclr3'><b>
-{NEWSTITLE}
- .:</b></td></tr>
-<tr><td class='tclr4'>
-{NEWSICON}
-{NEWSBODY}
-<br />
-<div style='text-align:right'>
-{NEWSAUTHOR}
- | 
-{NEWSDATE}
- | 
-{NEWSCOMMENTS}
-{EMAILICON}
-{PRINTICON}
-{ADMINOPTIONS}
-{EXTENDED}
-</div>
-</td></tr>
-</table>
-</td></tr></table>							
-</td></tr></table>
-</td></tr>
-</table>";
-
-
-define("ICONSTYLE", "float: left; border:0");
-define("COMMENTLINK", "Comments: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-define("EXTENDEDSTRING", "Read more ...");
-define("SOURCESTRING", "Source: ");
-define("URLSTRING", "Link: ");
-define("ICONMAIL", "iconmail.png");
-define("ICONPRINT", "iconprint.png");
-
-// [linkstyle]
-
-define(PRELINK, "");
-define(POSTLINK, "");
-define(LINKSTART, "<td class='bclr3'>/");
-define(LINKEND, "</td>");
-define(LINKALIGN, "right");
-
-?>
\ No newline at end of file
Files 6171/e107_themes/xog/images/bar2edge.gif and 75/e107_themes/xog/images/bar2edge.gif differ
Files 6171/e107_themes/xog/images/bar2.gif and 75/e107_themes/xog/images/bar2.gif differ
Files 6171/e107_themes/xog/images/bar.jpg and 75/e107_themes/xog/images/bar.jpg differ
Files 6171/e107_themes/xog/images/bg.gif and 75/e107_themes/xog/images/bg.gif differ
Files 6171/e107_themes/xog/images/bullet1.gif and 75/e107_themes/xog/images/bullet1.gif differ
Files 6171/e107_themes/xog/images/bullet2.gif and 75/e107_themes/xog/images/bullet2.gif differ
Files 6171/e107_themes/xog/images/hr.png and 75/e107_themes/xog/images/hr.png differ
Files 6171/e107_themes/xog/images/logo.png and 75/e107_themes/xog/images/logo.png differ
diff -ruN 6171/e107_themes/xog/style.css 75/e107_themes/xog/style.css
--- 6171/e107_themes/xog/style.css	2004-03-30 19:55:18.000000000 -0600
+++ 75/e107_themes/xog/style.css	1969-12-31 18:00:00.000000000 -0600
@@ -1,193 +0,0 @@
-a {
-	color: #fff; 
-	font: verdana, arial, sans-serif;
-	text-decoration: none;
-}
-a:hover {
-	color: #FFC805;
-	text-decoration: none
-}
-body {
-	font: 12px tahoma, verdana, arial, sans-serif;
-	background-color: #1D3255;
-	padding:0px;
-	margin:0px;
-	scrollbar-3dlight-color:#FFD700; 
-	scrollbar-arrow-color:#FFFF00;
-	scrollbar-base-color:#FF6347;
-	scrollbar-darkshadow-color:#FFA500;
-	scrollbar-face-color:#7688AE;
-	scrollbar-highlight-color:#000;
-	scrollbar-shadow-color:#000
-}
-.indent{
-	padding: 3px 10px 3px 10px;
-	font: 11px verdana, tahoma, arial, sans-serif;
-	color: #aaa;
-	border: 1px solid #545454;
-}
-.smalltext {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#52B0D5;
-	letter-spacing: -1px;
-}
-td {
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#DFDD49;
-	padding: 0px;
-	text-align:left;
-}
-.mediumtext {
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#52B0D5;
-}
-.captiontext {
-	letter-spacing: -1px;
-	font: 16px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#C3C160;
-	font-weight: bold;
-	padding:8px;	
-}
-.bodytext {
-	color: #fff;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-
-}
-.tbox{
-	background-color: #213142;
-	border: #000 1px solid;
-	color: #C3C160;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-}
-.button{
-	background-color: #A5ADC6;
-	border-bottom: #6B7B9C 1px solid;
-	border-left: #D6D6E7 1px solid;
-	border-right: #6B7B9C 1px solid;
-	border-top: #D6D6E7 1px solid;
-	color: #000000;
-	font: 9px verdana, tahoma, arial, helvetica, sans-serif;
-	text-align:center;
-}
-form {
-	margin: 2px 0px 0px 0px;
-}
-.spacer{
-	padding: 4px 0px 2px 4px;
-}
-hr {
-	border-top: #8CB6CE 1px solid;
-	border-bottom: #8CB6CE 1px solid;
-	height: 1px;
-	width: 100%;
-	padding:0px;
-	margin:-5px;
-}
-.border {
-	border: #000 1px solid;
-}
-.caption {
-	letter-spacing: -1px;
-	background-color: #7688AE;
-	border-top: #BDC6D5 1px solid;
-	border-right: #313942 1px solid;
-	border-bottom: #313942 1px solid;
-	border-left: #BDC6D5 1px solid;
-	font: 14px verdana, helvetica, sans-serif;
-	color: #000;
-}
-.bodytable {
-	background-color: #1D3257;
-	padding: 2px;
-	font: 10px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#C3C160;
-}
-p {
-	margin-top: 0px
-}
-.nextprev{
-	background-color: #EBEFF2;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#C3C160;
-	padding: 4px;
-	background-image : url(../../e107_images/forum/fcap.png);
-	border: #000 1px solid;
-}
-.fborder {
-	border: #000000 1px solid;
-	background-color: #1D3257;
-}
-.forumheader{
-	background-color: #EBEFF2;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#C3C160;
-	padding: 4px;
-	background-image : url(../../e107_images/forum/fcap.png);
-	border: #000 1px solid;
-}
-.forumheader2{
-	background-color: #324460;
-	font: 14px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#C3C160;
-	padding: 4px;
-	border: #1C2738 1px solid;
-}
-.forumheader3{
-	background-color: #2A4572;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#2E9AC2;
-	padding: 4px;
-	border: #1B4077 1px solid;
-}
-.fcaption {
-	border: #000 1px solid;
-	padding: 2px 0px 2px 8px;
-	background-color: #C9C7C7;
-	font: 12px verdana, tahoma, arial, helvetica, sans-serif;
-	background-image : url(../../e107_images/forum/fcap.png);
-	color:#fff;
-}
-.finfobar{
-	background-color: #324460;
-	font: 11px verdana, tahoma, arial, helvetica, sans-serif;
-	color:#000;
-	padding: 4px;
-	border: #000 1px solid;
-//	background-image : url(../e107_images/forum/finfobar.png);
-}
-a.forumlink{
-	color: #fff;
-	text-decoration: underline;
-}
-.helpbox {
-	border: transparent;
-	background-color: transparent;
-	color:#000;
-	font: 9px tahoma, verdana, arial, helvetica, sans-serif;
-}
-
-.box {
-	background-color: #7688AE;
-	border-top: #BDC6D5 1px solid;
-	border-right: #313942 1px solid;
-	border-bottom: #313942 1px solid;
-	border-left: #BDC6D5 1px solid;
-	padding: 2px;
-}
-
-.box2 {
-	background-color: #687A93;
-	border-top: #BDC6D5 1px solid;
-	border-right: #313942 1px solid;
-	border-bottom: #313942 1px solid;
-	border-left: #BDC6D5 1px solid;
-	padding: 4px;
-}
-
-.linkbox {
-	background-color: #213142;
-	border: #000;
-	color: #C3C160;
-	text-align:center;
-	padding: 4px;
-}
\ No newline at end of file
diff -ruN 6171/e107_themes/xog/theme.php 75/e107_themes/xog/theme.php
--- 6171/e107_themes/xog/theme.php	2004-07-12 08:33:46.000000000 -0500
+++ 75/e107_themes/xog/theme.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,139 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/e107.v4 theme file 
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-// [theme]
-
-$themename = "xog";
-$themeversion = "1.0";
-$themeauthor = "jalist";
-$themedate = "18/01/2004";
-$themeinfo = "To alter the height of the layer on the news page, edit line 70 of theme.php (height: 500px)";
-
-define("THEME_DISCLAIMER", "<br /><i>'xog' theme by jalist</i>");
-
-// [layout]
-$layout = "_default";
-
-$HEADER = 
-"<div style='text-align:left'>
-<table style='width:850px' cellspacing='0' cellpadding='0'>
-<tr>
-<td class='box2' style='width:150px; vertical-align: middle; text-align:center'>
-<div class='spacer'><img src='".e_IMAGE."button.png' alt='' /></div>
-</td>
-<td class='box2' style='width:700px; vertical-align: middle; text-align:center;'>
-{BANNER}
-</td>
-</tr>
-</table>
-<table style='width:850px' cellspacing='0' cellpadding='0'>
-<tr>
-<td class='box' style='width:850px;'>
-<table style='width:100%' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='20%'>
-{CUSTOM=search}
-</td>
-<td style='80%'>
-{MENU=3}
-Menu area 3
-</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<table style='width:850px' cellspacing='0' cellpadding='0'>
-<tr>
-<td class='box2' style='width:850px;'>
-{SITELINKS=flat}
-</td>
-</tr>
-</table>
-<table style='width:850px' cellspacing='0' cellpadding='0'>
-<tr>
-<td style='width:200px; vertical-align: top;'>
-{SETSTYLE=leftmenu}
-{MENU=1}
-</td>
-<td style='width:650px; vertical-align: top;'>".(e_PAGE == "news.php" ? "<div style='border: 0; padding : 4px; width : auto; height: 500px; overflow: auto;'>" : "");
-
-$FOOTER = (e_PAGE == "news.php" ? "</div>" : "")."
-</td></tr>
-<tr>
-<td class='box2' colspan='3' style='text-align:center'>
-<div class='linkbox'>
-{SITEDISCLAIMER}
-</div>
-</td>
-</tr>
-</table>
-</div>
-";
-
-//	[newsstyle]
-
-$NEWSSTYLE = "
-<div class='captiontext'>
-{NEWSICON}
-{NEWSTITLE}
-</div>
-<div class='bodytext' style='text-align:left'>
-{NEWSBODY}
-{EXTENDED}
-<br />
-<br />
-</div>
-<div class='mediumtext' style='text-align:right'>
-<b>
-{NEWSAUTHOR}
-</b>
-<br />
-{NEWSDATE}
-<br />
-{NEWSCOMMENTS}
-<br />
-{EMAILICON}
-{PRINTICON}
-</div>
-<br />
-<img style='margin-top: 2px; margin-bottom: 2px;' width='610' alt='' height='1' src='".THEME."images/hr.png'/><br />";
-
-define("ICONSTYLE", "border:0; vertical-align:middle");
-define("COMMENTLINK", "Read/Post Comment: ");
-define("COMMENTOFFSTRING", "Comments are turned off for this item");
-
-define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
-define("EXTENDEDSTRING", "Read the rest ...");
-define("POST_EXTENDEDSTRING", " ]<br />");
-
-
-// [linkstyle]
-
-define(PRELINK, "<div class='linkbox'>| ");
-define(POSTLINK, "</div>");
-define(LINKSTART, "");
-//define(LINKEND, "<br /><img style='margin-top: 2px; margin-bottom: 2px;' width='190' height='1' alt='' src='".THEME."images/hr.png'/><br />");
-define(LINKEND, " | ");
-define(LINKDISPLAY, 1);
-define(LINKALIGN, "left");
-
-//	[tablestyle]
-
-function tablestyle($caption, $text){
-	echo"<table style='width:100%'><tr><td style='whitespace:nowrap'><div class='border'><div class='caption'>$caption</div></div>
-	<div class='bodytable'>$text</div></td></tr></table><br />";
-}
-?>
\ No newline at end of file
Files 6171/e107_v0617_1.zip and 75/e107_v0617_1.zip differ
diff -ruN 6171/email.php 75/email.php
--- 6171/email.php	2005-05-12 23:25:29.000000000 -0500
+++ 75/email.php	2006-05-19 08:11:52.000000000 -0500
@@ -1,108 +1,217 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/email.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-require_once(HEADERF);
-
-$qs = explode(".", e_QUERY);
-if($qs[0] == ""){ header("location:".e_BASE."index.php"); exit;}
-$table = $qs[0];
-$id = $qs[1];
-$type = ($table == "news" ? "news item" : "article");
-
-$comments = textparse::tpj($_POST['comment'],TRUE);
-$author = textparse::tpj($_POST['author_name'],TRUE);
-$email_send = check_email($_POST['email_send']);
-if(IsSet($_POST['emailsubmit'])){
-	if(!$email_send){
-		 $error .= LAN_106;
-	 }
-	 if($comments == ""){
-		 $message = LAN_188." ".SITENAME." (".SITEURL.")";
-		if(USER == TRUE){
-			$message .= "\n\n".LAN_email_1." ".USERNAME;
-		}else{
-			$message .= "\n\n".LAN_email_1." ".$author;
-		}
-	 }
-	$ip = getip();
-	$message .= "\n\n".LAN_email_2." ".$ip."\n\n";
-
-	if($table == "news"){
-		$sql -> db_Select("news", "*", "news_id='$id' ");
-		list($news_id, $news_title, $news_body, $news_extended, $news_datestamp, $news_author, $news_source, $news_url, $news_category, $news_allow_comments) = $sql-> db_Fetch();
-		$message .= $comments."\n\n".$news_title."\n".$news_body."\n".$news_extended."\n\n".SITEURL.e_BASE."comment.php?comment.news.".$id;
-	}else{
-		$row = $sql -> db_Fetch(); 
-		extract($row);
-		$message .= $comments."\n\n".SITEURL.e_BASE."content.php?article.".$id."\n\n".$content_heading."\n".$content_subheading."\n".$content_content."\n\n";
-	}
-	if($error == ""){
-		require_once(e_HANDLER."mail.php");
-		if(sendemail($email_send, LAN_email_3.SITENAME, $message)){
-			$text = "<div style='text-align:center'>".LAN_10." ".$email_send."</div>";
-		}else{
-			$text = "<div class='center'>".LAN_9."</div>";
-		}
-		$ns -> tablerender(LAN_11, $text);
-	}else{
-		$ns -> tablerender(LAN_12, "<div style='text-align:center'>".$error."</div>");
-	}
-}
-
-$text = "<form method='post' action='".e_SELF."?$table.$id'>\n
-<table class='defaulttable'>";
-
-if(USER != TRUE){
-	$text .= "<tr>
-<td style='width:20%'>".LAN_7."</td>
-<td style='width:80%'>
-<input class='tbox' type='text' name='author_name' size='60' value='$author' maxlength='100' />
-</td>
-</tr>";
-}
-$text .= "<tr> 
-<td style='width:20%'>".LAN_8."</td>
-<td style='width:80%'>
-<textarea class='tbox' name='comment' cols='70' rows='4'>".($type == "news" ? LAN_188 : LAN_189)." ".SITENAME." (".SITEURL.")";
-if(USER == TRUE){
-	$text .= "\n\n".LAN_email_1." ".USERNAME;
-}
-
-$text .= "</textarea>
-</td>
-</tr>
-
-<tr>
-<td style='width:20%'>".LAN_187."</td>
-<td style='width:80%'>
-<input class='tbox' type='text' name='email_send' size='60' value='$email_send' maxlength='100' />
-</td>
-</tr>
-
-<tr style='vertical-align:top'> 
-<td style='width:20%'></td>
-<td style='width:80%'>
-<input class='button' type='submit' name='emailsubmit' value='".($type == "news" ? LAN_186 : LAN_185)."' />
-</td>
-</tr>
-</table>
-</form>";
-
-$ns -> tablerender(($type == "news" ? LAN_6 : LAN_5), $text);
-
-
-
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/email.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2006/05/19 13:11:52 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+require_once(HEADERF);
+
+$use_imagecode = FALSE;
+$imgtypes = array("jpeg", "png", "gif");
+foreach($imgtypes as $t)
+{
+	if(function_exists("imagecreatefrom".$t))
+	{
+		$use_imagecode = TRUE;
+	}
+}
+
+if ($use_imagecode)
+{
+	require_once(e_HANDLER."secure_img_handler.php");
+	$sec_img = new secure_image;
+}
+
+$qs = explode(".", e_QUERY, 2);
+if ($qs[0] == "")
+{
+	header("location:".e_BASE."index.php");
+	exit;
+}
+$source = $qs[0];
+$parms = $qs[1];
+
+$emailurl = ($source == "referer") ? $_SERVER['HTTP_REFERER'] : SITEURL;
+
+$comments = $tp->post_toHTML($_POST['comment'], TRUE, 'retain_nl');
+$author = $tp->post_toHTML($_POST['author_name']);
+$email_send = check_email($_POST['email_send']);
+
+if (isset($_POST['emailsubmit']))
+{
+	if (!$email_send)
+	{
+		$error .= LAN_106;
+	}
+
+	if($use_imagecode)
+	{
+		if(!isset($_POST['code_verify']) || !isset($_POST['rand_num']))
+		{
+			header("location:".e_BASE."index.php");
+			exit;
+		}
+		if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify']))
+		{
+			header("location:".e_BASE."index.php");
+			exit;
+		}
+	}
+
+	if ($comments == "")
+	{
+		$message = LAN_188." ".SITENAME." (".SITEURL.")";
+		if (USER == TRUE)
+		{
+			$message .= "\n\n".LAN_email_1." ".USERNAME;
+		}
+		else
+		{
+			$message .= "\n\n".LAN_email_1." ".$author;
+		}
+	}
+	else
+	{
+		$message .= $comments;
+	}
+	$ip = $e107->getip();
+	$message .= "\n\n".LAN_email_2." ".$ip."\n\n";
+
+	if(strpos($source,'plugin:') !== FALSE)
+	{
+		$plugin = substr($source,7);
+		$text = "";
+		if(file_exists(e_PLUGIN.$plugin."/e_emailprint.php"))
+		{
+			include_once(e_PLUGIN.$plugin."/e_emailprint.php");
+			$text = email_item($parms);
+			$emailurl = SITEURL;
+		}
+		if($text == "")
+		{
+			header("location:".e_BASE."index.php");
+			exit;
+		}
+		$message .= $text;
+	}
+	elseif($source == "referer")
+	{
+		if(!isset($_POST['referer']) || $_POST['referer'] == '')
+		{
+			header("location:".e_BASE."index.php");
+			exit;
+		}
+		$message .= $_POST['referer'];
+		$emailurl = $_POST['referer'];
+	}
+	else
+	{
+		$emailurl = SITEURL;
+		$message = "";
+		if($sql->db_Select("news", "*", "news_id='".intval($parms)."'"))
+		{
+			
+			list($news_id, $news_title, $news_body, $news_extended, $news_datestamp, $news_author, $news_source, $news_url, $news_category, $news_allow_comments) = $sql->db_Fetch();
+			$message .= $tp->toHTML($news_title, TRUE)."\n".$tp->toHTML($news_body, TRUE)."\n".$tp->toHTML($news_extended, TRUE)."\n\n".SITEURL.e_BASE."comment.php?comment.news.".$parms;
+			$message = strip_tags($message);
+		}
+		
+		if($message == "")
+		{
+			header("location:".e_BASE."index.php");
+			exit;
+		}
+	}
+
+	if ($error == "")
+	{
+		require_once(e_HANDLER."mail.php");
+		if (sendemail($email_send, LAN_email_3.SITENAME, $message))
+		{
+			$text = "<div style='text-align:center'>".LAN_10." ".$email_send."</div>";
+		}
+		else
+		{
+			$text = "<div style='text-align:center'>".LAN_9."</div>";
+		}
+		$ns->tablerender(LAN_11, $text);
+	}
+	else
+	{
+		$ns->tablerender(LAN_12, "<div style='text-align:center'>".$error."</div>");
+	}
+}
+
+$text = "<form method='post' action='".e_SELF."?".e_QUERY."'>\n
+	<table>";
+
+if (USER != TRUE)
+{
+	$text .= "<tr>
+		<td style='width:25%'>".LAN_7."</td>
+		<td style='width:75%'>
+		<input class='tbox' type='text' name='author_name' size='60' style='width:95%' value='$author' maxlength='100' />
+		</td>
+		</tr>";
+}
+
+$text .= "
+<tr>
+	<td style='width:25%'>".LAN_8."</td>
+	<td style='width:75%'>
+	<textarea class='tbox' name='comment' cols='70' rows='4' style='width:95%'>".LAN_email_6." ".SITENAME." (".$emailurl.")
+";
+
+if (USER == TRUE)
+{
+	$text .= "\n\n".LAN_email_1." ".USERNAME;
+}
+
+$text .= "</textarea>
+	</td>
+	</tr>
+
+	<tr>
+	<td style='width:25%'>".LAN_187."</td>
+	<td style='width:75%'>
+	<input class='tbox' type='text' name='email_send' size='60' value='$email_send' style='width:95%' maxlength='100' />
+	</td>
+	</tr>
+	";
+	
+	if($use_imagecode)
+	{
+		$text .= "<tr><td>".LAN_email_8."</td><td>";
+		$text .= $sec_img->r_image();
+		$text .= " <input class='tbox' type='text' name='code_verify' size='15' maxlength='20'>
+			<input type='hidden' name='rand_num' value='".$sec_img->random_number."'></td></tr>";
+	}
+	
+$text .= "
+	<tr style='vertical-align:top'>
+	<td style='width:25%'></td>
+	<td style='width:75%'>
+	<input class='button' type='submit' name='emailsubmit' value='".LAN_email_4."' />
+	<input type='hidden' name='referer' value='".$_SERVER['HTTP_REFERER']."' />
+</td>
+	</tr>
+	</table>
+	</form>";
+
+$ns->tablerender(LAN_email_5, $text);
+
+require_once(FOOTERF);
 ?>
\ No newline at end of file
diff -ruN 6171/error.php 75/error.php
--- 6171/error.php	2004-09-09 21:58:10.000000000 -0500
+++ 75/error.php	2005-12-15 06:28:54.000000000 -0600
@@ -1,48 +1,72 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/error.php,v $
-|     $Revision: 1.4 $
-|     $Date: 2004/09/10 02:58:10 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-
-
-
-require_once("class2.php");
-require_once(HEADERF);
-
-switch(e_QUERY){
-        case 401:
-                $text = "<div class='installe'>".LAN_1."</div><br /><div class='installh'>".LAN_2."</div><br /><div class='smalltext'>".LAN_3."</div>
-                <br /><div class='installh'>".LAN_2."<a href='index.php'>".LAN_20."</a></div>";
-        break;
-        case 403:
-                $text = "<div class='installe'>".LAN_4."</div><br /><div class='installh'>".LAN_5."</div><br /><div class='smalltext'>".LAN_6."</div>
-                <br /><div class='installh'>".LAN_2."<a href='index.php'>".LAN_20."</a></div>";
-        break;
-        case 404:
-                $text = "<div class='installe'>".LAN_7."</div><br /><div class='installh'>".LAN_8."</div><br /><div class='smalltext'>".LAN_9."</div>
-                <br /><div class='installh'>".LAN_2."<a href='index.php'>".LAN_20."</a></div>";
-        break;
-        case 500:
-                $text = "<div class='installe'>".LAN_10."</div><br /><div class='installh'>".LAN_11."</div><br /><div class='smalltext'>".LAN_12."</div>
-                <br /><div class='installh'>".LAN_2."<a href='index.php'>".LAN_20."</a></div>";
-        break;
-        default:
-                $text = "<div class='installe'>".LAN_13." (".$_SERVER['QUERY_STRING'].")</div><br /><div class='installh'>".LAN_14."</div><br /><div class='smalltext'>".LAN_15."</div>
-                <br /><div class='installh'>".LAN_2."<a href='index.php'>".LAN_20."</a></div>";
-}
-$ns -> tablerender(PAGE_NAME." ".e_QUERY, $text);
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/error.php,v $
+|     $Revision: 1.11 $
+|     $Date: 2005/12/15 12:28:54 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+
+if(!e_QUERY || (e_QUERY != 401 && e_QUERY != 403 && e_QUERY != 404 && e_QUERY != 500))
+{
+	echo "<script type='text/javascript'>document.location.href='index.php'</script>\n";
+	header("location: ".e_HTTP."index.php");
+	exit;
+}
+
+require_once(HEADERF);
+
+$errFrom = $_SERVER['HTTP_REFERER'];
+$errTo = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
+
+switch(e_QUERY) {
+	case 401:
+	header("HTTP/1.1 401 Unauthorized");
+	$text = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='Error Icon'> ".LAN_1."</div><br /><div class='installh'>".LAN_2."</div><br /><div class='smalltext'>".LAN_3."</div>
+		<br /><div class='installh'>".LAN_2."<a href='index.php'>".LAN_20."</a></div>";
+	break;
+	case 403:
+	header("HTTP/1.1 403 Forbidden");
+	$text = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='Error Icon'> ".LAN_4."</div><br /><div class='installh'>".LAN_5."</div><br /><div class='smalltext'>".LAN_6."</div>
+		<br /><div class='installh'>".LAN_2."<a href='index.php'>".LAN_20."</a></div>";
+	break;
+	default:
+
+
+	case 404:
+	header("HTTP/1.1 404 Not Found");
+	$text = "<h3><img src='".e_IMAGE_ABS."icons/icon3.png' alt='Error Icon'> ".LAN_7."</h3><br />".LAN_ERROR_01."<br /><br />".LAN_ERROR_03."<b>{$errTo}</b>".LAN_ERROR_04."<br /><br />";
+
+	if (strlen($errFrom)) $text .= LAN_9." ( <a href='{$errFrom}' rel='external'>{$errFrom}</a> ) -- ".LAN_19."<br />";
+
+	$base_path = e_HTTP;
+
+	$text .= "<br /><a href='{$base_path}index.php'>".LAN_20."</a><br />";
+	$text .= "<a href='{$base_path}search.php'>".LAN_ERROR_02."</a></p>";
+
+	break;
+
+
+	case 500:
+	header("HTTP/1.1 500 Internal Server Error");
+	$text = "<div class='installe'><img src='".e_IMAGE_ABS."icons/icon3.png' alt='Error Icon'> ".LAN_10."</div><br /><div class='installh'>".LAN_11."</div><br /><div class='smalltext'>".LAN_12."</div>
+		<br /><div class='installh'>".LAN_2."<a href='index.php'>".LAN_20."</a></div>";
+	break;
+	$text = "<div class='installe'>".LAN_13." (".$_SERVER['QUERY_STRING'].")</div><br /><div class='installh'>".LAN_14."</div><br /><div class='smalltext'>".LAN_15."</div>
+		<br /><div class='installh'>".LAN_2."<a href='index.php'>".LAN_20."</a></div>";
+}
+
+$ns->tablerender(PAGE_NAME, $text);
+require_once(FOOTERF);
 ?>
\ No newline at end of file
Files 6171/favicon.ico and 75/favicon.ico differ
diff -ruN 6171/forum.php 75/forum.php
--- 6171/forum.php	2004-09-06 04:55:18.000000000 -0500
+++ 75/forum.php	2005-06-02 15:07:58.000000000 -0500
@@ -1,419 +1,5 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/forum.php,v $
-|     $Revision: 1.11 $
-|     $Date: 2004/09/06 09:55:18 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-if(strstr(e_QUERY, "untrack")){
-        $tmp1 = explode(".", e_QUERY);
-        $tmp = str_replace("-".$tmp1[1]."-", "", USERREALM);
-        $sql -> db_Update("user", "user_realm='$tmp' WHERE user_id='".USERID."' ");
-        header("location:".e_SELF."?track");
-        exit;
-}
-
-if(e_QUERY == "mark.all.as.read"){
-        $sql -> db_Select("forum_t", "thread_id", "thread_datestamp > '".USERLV."' ");
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                $u_new .= ".".$thread_id.".";
-        }
-        $u_new .= USERVIEWED;
-        $sql -> db_Update("user", "user_viewed='$u_new' WHERE user_id='".USERID."' ");
-        header("location:".e_SELF);
-        exit;
-}
-
-if(strstr(e_QUERY, "mfar")){
-        $tmp = explode(".", e_QUERY);
-        $forum_id = $tmp[1];
-        $sql -> db_Select("forum_t", "thread_id", "thread_forum_id='$forum_id' AND thread_datestamp > '".USERLV."' ");
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                $u_new .= ".".$thread_id.".";
-        }
-        $u_new .= USERVIEWED;
-        $sql -> db_Update("user", "user_viewed='$u_new' WHERE user_id='".USERID."' ");
-        header("location:".e_SELF);
-        exit;
-}
-
-if(e_QUERY == "rules"){
-        $aj = new textparse;
-        require_once(HEADERF);
-        $sql -> db_Select("wmessage");
-                list($null) = $sql-> db_Fetch();
-                list($null) = $sql-> db_Fetch();
-                list($null) = $sql-> db_Fetch();
-        list($wm_guest, $guestrules, $wm_active1) = $sql-> db_Fetch();
-        list($wm_member, $memberrules, $wm_active2) = $sql-> db_Fetch();
-        list($wm_admin, $adminrules, $wm_active3) = $sql-> db_Fetch();
-        if(ADMIN == TRUE && $wm_active3){
-                $adminrules = $aj -> tpa($adminrules, "on","admin");
-                                $adminrules .= "<br /><br /><a href='forum.php'>".LAN_434."</a>";
-                $ns -> tablerender(LAN_433, "<div style='text-align:center'><b>Administrators</b><br />".$adminrules."</div>", "wm");
-        }else if(USER == TRUE && $wm_active2 && !ADMIN){
-                $memberrules = $aj -> tpa($memberrules, "on","admin");
-                                $memberrules .= "<br /><br /><a href='forum.php'>".LAN_434."</a>";
-                $ns -> tablerender(LAN_433, "<div style='text-align:center'>".$memberrules."</div>", "wm");
-        }else if(USER == FALSE && $wm_active1 && !ADMIN){
-                $guestrules = $aj -> tpa($guestrules, "on","admin");
-                                $guestrules .= "<br /><br /><a href='forum.php'>".LAN_434."</a>";
-                $ns -> tablerender(LAN_433, "<div style='text-align:center'>".$guestrules."</div>", "wm");
-        }
-                require_once(FOOTERF);
-                exit;
-}
-
-define("IMAGE_e", (file_exists(THEME."forum/e.png") ? "<img src='".THEME."forum/e.png' alt='' />" : "<img src='".e_IMAGE."forum/e.png' alt='' />"));
-define("IMAGE_nonew_small", (file_exists(THEME."forum/nonew_small.png") ? "<img src='".THEME."forum/nonew_small.png' alt='' />" : "<img src='".e_IMAGE."forum/nonew_small.png' alt='' />"));
-define("IMAGE_new_small", (file_exists(THEME."forum/new_small.png") ? "<img src='".THEME."forum/new_small.png' alt='' />" : "<img src='".e_IMAGE."forum/new_small.png' alt='' />"));
-define("IMAGE_closed_small", (file_exists(THEME."forum/closed_small.png") ? "<img src='".THEME."forum/closed_small.png' alt='' />" : "<img src='".e_IMAGE."forum/closed_small.png' alt='' />"));
-define("IMAGE_new", (file_exists(THEME."forum/new.png") ? "<img src='".THEME."forum/new.png' alt='".LAN_199."' style='border:0' />" : "<img src='".e_IMAGE."forum/new.png' alt='".LAN_199."' style='border:0' />"));
-define("IMAGE_nonew", (file_exists(THEME."forum/nonew.png") ? "<img src='".THEME."forum/nonew.png' alt='' />" : "<img src='".e_IMAGE."forum/nonew.png' alt='' />"));
-define("IMAGE_post", (file_exists(THEME."forum/post2.png") ? "<img src='".THEME."forum/post2.png' alt='' style='border:0; vertical-align:bottom' />" : "<img src='".e_IMAGE."forum/post2.png' alt='' style='border:0; vertical-align:bottom' />"));
-
-$gen = new convert;
-
-$FORUMTITLE = LAN_46;
-$THREADTITLE = LAN_47;
-$REPLYTITLE = LAN_48;
-$LASTPOSTITLE = LAN_49;
-$INFOTITLE = LAN_191;
-$LOGO = IMAGE_e;
-$NEWTHREADTITLE = LAN_424;
-$POSTEDTITLE = LAN_423;
-$NEWIMAGE = IMAGE_new_small;
-$TRACKTITLE = LAN_397;
-$sql -> db_Select("wmessage");
-list($null) = $sql-> db_Fetch();
-list($null) = $sql-> db_Fetch();
-list($null) = $sql-> db_Fetch();
-list($wm_guest, $guestrules, $wm_active1) = $sql-> db_Fetch();
-list($wm_member, $memberrules, $wm_active2) = $sql-> db_Fetch();
-list($wm_admin, $adminrules, $wm_active3) = $sql-> db_Fetch();
-$show_rules = FALSE;
-if(ADMIN == TRUE && $wm_active3){
-        $show_rules = TRUE;
-}else if(USER == TRUE && $wm_active2 && !ADMIN){
-        $show_rules = TRUE;
-}else if(USER == FALSE && $wm_active1 && !ADMIN){
-        $show_rules = TRUE;
-}
-$USERINFO = "<a href='top.php?0.top.forum.10'>".LAN_429."</a> | <a href='top.php?0.active'>".LAN_430."</a>".(USER ? " | <a href='userposts.php?0.forums.".USERID."'>".LAN_431."</a> | <a href='usersettings.php'>".LAN_432."</a> | <a href='user.php?id.".USERID."'>".LAN_435."</a>" : "").($show_rules == TRUE ? " | <a href='forum.php?rules'>".LAN_433."</a>" : "");
-
-$total_topics = $sql -> db_Count("forum_t", "(*)", " WHERE thread_parent='0' ");
-$total_replies = $sql -> db_Count("forum_t", "(*)", " WHERE thread_parent!='0' ");
-$total_members = $sql -> db_Count("user");
-$newest_member = $sql -> db_Select("user", "*", "ORDER BY user_join DESC LIMIT 0,1", $mode="no_where");
-list($nuser_id, $nuser_name)  = $sql -> db_Fetch();
-$member_users = $sql -> db_Select("online", "*", "online_location REGEXP('forum.php') AND online_user_id!='0' ");
-$guest_users = $sql -> db_Select("online", "*", "online_location REGEXP('forum.php') AND online_user_id='0' ");
-$users = $member_users+$guest_users;
-$USERLIST = LAN_426;
-global $listuserson;
-$c = 0;
-foreach($listuserson as $uinfo => $pinfo){
-        list($oid,$oname) = explode(".",$uinfo,2);
-        $c ++;
-        $USERLIST .= "<a href='".e_BASE."user.php?id.$oid'>$oname</a>".($c == MEMBERS_ONLINE ? "." :", ");
-}
-$USERLIST .= "<br /><a rel='external' href='online.php'>".LAN_427."</a> ".LAN_436."";
-$ICONKEY = "
-<table style='width:100%'>\n<tr>
-<td style='width:2%'>".IMAGE_new_small."</td>
-<td style='width:10%'><span class='smallblacktext'>".LAN_79."</span></td>
-<td style='width:2%'>".IMAGE_nonew_small."</td>
-<td style='width:10%'><span class='smallblacktext'>".LAN_80."</span></td>
-<td style='width:2%'>".IMAGE_closed_small."</td>
-<td style='width:10%'><span class='smallblacktext'>".LAN_394."</span></td>
-</tr>\n</table>\n";
-
-$SEARCH = "
-<form method='post' action='search.php'>
-<p>
-<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />
-<input class='button' type='submit' name='searchsubmit' value='".LAN_180."' />
-<input type='hidden' name='searchtype' value='7' />
-</p>
-</form>\n";
-
-$PERMS =
-  (USER == TRUE || ANON == TRUE ? LAN_204." - ".LAN_206." - ".LAN_208 : LAN_205." - ".LAN_207." - ".LAN_209);
-
-if(USER == TRUE){
-        $total_new_threads = $sql -> db_Count("forum_t", "(*)", "WHERE thread_datestamp>'".USERLV."' ");
-        if(USERVIEWED != ""){
-                $tmp = explode("..", USERVIEWED);
-                $total_read_threads = count($tmp);
-        }else{
-                $total_read_threads = 0;
-        }
-
-        $INFO =
-        LAN_30." ".USERNAME."<br />";
-        $sql -> db_Select("user", "*",  "user_name='".USERNAME."' ");
-        $row = $sql -> db_Fetch();
-        extract($row);
-        $lastvisit_datestamp = $gen->convert_date($user_lastvisit, "long");
-        $datestamp = $gen->convert_date(time(), "long");
-        if(!$total_new_threads){
-                $INFO .= LAN_31;
-        }else if($total_new_threads == 1){
-                $INFO .= LAN_32;
-        }else{
-                $INFO .= LAN_33." ".$total_new_threads." ".LAN_34." ";
-        }
-        $INFO .= LAN_35;
-        if($total_new_threads == $total_read_threads && $total_new_threads !=0 && $total_read_threads >= $total_new_threads){
-                $INFO .= LAN_198;
-                $allread = TRUE;
-        }else if($total_read_threads != 0){
-                $INFO .= " (".LAN_196.$total_read_threads.LAN_197.")";
-        }
-
-        $INFO .= "<br />
-        ".LAN_36." ".$lastvisit_datestamp."<br />
-        ".LAN_37." ".$datestamp.LAN_38.$pref['timezone'];
-}else{
-        $INFO .= "";
-        if(ANON == TRUE){
-                $INFO .= LAN_410."<br />".LAN_44." <a href='".e_SIGNUP."'>".LAN_437."</a> ".LAN_438;
-        }else if(USER == FALSE){
-                $INFO .= LAN_410."<br />".LAN_45." <a href='".e_SIGNUP."'>".LAN_439."</a> ".LAN_440;
-        }
-}
-
-if(USER && $allread != TRUE && $total_new_threads && $total_new_threads >= $total_read_threads){
-        $INFO .= "<br /><a href='".e_SELF."?mark.all.as.read'>".LAN_199."</a>".(e_QUERY != "new" ? ", <a href='".e_SELF."?new'>".LAN_421."</a>" : "");
-}
-
-if(USERREALM && USER && e_QUERY != "track"){
-        $INFO .= "<br /><a href='".e_SELF."?track'>".LAN_393."</a>";
-}
-
-$FORUMINFO .= LAN_192.($total_topics+$total_replies)." ".LAN_404." ($total_topics ".($total_topics == 1 ? LAN_411 : LAN_413).", $total_replies ".($total_replies == 1 ? LAN_412 : LAN_414).").<br />".$users." ".($users == 1 ? LAN_415 : LAN_416)." (".$member_users." ".($member_users==1 ? LAN_417 : LAN_419).", ".$guest_users." ".($guest_users == 1 ? LAN_418 : LAN_420).")<br />".LAN_42.$total_members."<br />".LAN_41."<a href='".e_BASE."user.php?id.".$nuser_id."'>".$nuser_name."</a>.\n";
-
-if(!$FORUM_MAIN_START)
-{
-        if(file_exists(THEME."forum_template.php"))
-        {
-                include_once(THEME."forum_template.php");
-        }
-}
-include(e_BASE.$THEMES_DIRECTORY."templates/forum_template.php");
-
-require_once(HEADERF);
-$sql2 = new db;
-
-if(!$sql -> db_Select("forum", "*", "forum_parent='0' ORDER BY forum_order ASC")){
-        $ns -> tablerender(PAGE_NAME, "<div style='text-align:center'>".LAN_51."</div>");
-        require_once(FOOTERF);
-        exit;
-}
-
-while($row = $sql-> db_Fetch()){
-        $status = parse_parent($row);
-        extract($row);
-        $PARENTSTATUS = $status[0];
-        if($status[1]){
-                $PARENTNAME = $forum_name;
-                $forum_string .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_PARENT);
-                $forums = $sql2 -> db_Select("forum", "*", "forum_parent='".$forum_id."' ORDER BY forum_order ASC ");
-                if(!$forums && $status[1]){
-                        $text .= "<td colspan='5' style='text-align:center' class='forumheader3'>".LAN_52."</td>";
-                }else if($status[1]){
-                        while($row = $sql2-> db_Fetch()){
-                                extract($row);
-                                if($forum_class == e_UC_ADMIN && ADMIN){
-                                        $forum_string .= parse_forum($row, LAN_406);
-                                }else if($forum_class == e_UC_MEMBER && USER){
-                                        $forum_string .= parse_forum($row, LAN_407);
-                                }else if($forum_class == e_UC_READONLY){
-                                        $forum_string .= parse_forum($row, LAN_408);
-                                }else if($forum_class && check_class($forum_class)){
-                                        $forum_string .= parse_forum($row, LAN_409);
-                                }else if(!$forum_class){
-                                        $forum_string .= parse_forum($row);
-                                }
-                        }
-                        if($FORUM_MAIN_PARENT_END){
-                                $forum_string .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_PARENT_END);
-                        }
-                }
-        }
-}
-
-function parse_parent($row){
-        extract($row);
-        if($forum_class == e_UC_NOBODY){
-                $status[0] = "{ ".LAN_398." )";
-                $status[1] = FALSE;
-        }else if($forum_class == e_UC_MEMBER && !USER){
-                $status[1] = FALSE;
-        }else if($forum_class == e_UC_MEMBER && USER){
-                $status[0] = "( ".LAN_401." )";
-                $status[1] = TRUE;
-        }else if($forum_class == e_UC_READONLY){
-                $status[0] = "( ".LAN_405." )";
-                $status[1] = TRUE;
-        }else if($forum_class){
-                if(check_class($forum_class)){
-                        $status[0] = "( ".LAN_399." )";
-                        $status[1] = TRUE;
-                }else{
-                        $status[1] = FALSE;
-                }
-        }else{
-                $status[0] = "";
-                $status[1] = TRUE;
-        }
-        return ($status);
-}
-
-function parse_forum($row, $restricted_string=""){
-        global $FORUM_MAIN_FORUM, $gen;
-        extract($row);
-        $sql = new db;
-        if(USER){
-                if($sql -> db_Select("forum_t", "*", "thread_forum_id='$forum_id' AND thread_datestamp > '".USERLV."' ")){
-                        while(list($nthread_id) = $sql -> db_Fetch()){
-                                if(!ereg("\.".$nthread_id."\.", USERVIEWED)){ $newflag = TRUE; }
-                        }
-                }
-        }
-        $NEWFLAG = ($newflag ? "<a href='".e_SELF."?mfar.$forum_id'>".IMAGE_new."</a></td>" : IMAGE_nonew);
-        $FORUMNAME = "<a href='".e_BASE."forum_viewforum.php?$forum_id'>$forum_name</a>";
-        $FORUMDESCRIPTION = $forum_description.($restricted_string ? "<br /><span class='smalltext'><i>$restricted_string</i></span>" : "");;
-        $THREADS = $forum_threads;
-        $REPLIES = $forum_replies;
-        if($forum_lastpost){
-                $sql -> db_Select("forum_t", "*", "thread_forum_id='$forum_id' ORDER BY thread_datestamp DESC LIMIT 0,1");
-                $row = $sql -> db_Fetch();
-                extract($row);
-                $lastpost_author_id = substr($forum_lastpost, 0, strpos($forum_lastpost, "."));
-                $lastpost_author_name = substr($forum_lastpost, (strpos($forum_lastpost, ".")+1));
-                if(strstr($lastpost_author_name, chr(1))){
-                        $tmp = explode(chr(1), $lastpost_author_name);
-                        $lastpost_author_name = $tmp[0];
-                }
-                $lastpost_datestamp = substr($lastpost_author_name, (strrpos($lastpost_author_name, ".")+1));
-                $lastpost_author_name = str_replace(".".$lastpost_datestamp, "", $lastpost_author_name);
-                $lastpost_datestamp = $gen->convert_date($lastpost_datestamp, "forum");
-                $LASTPOST = $lastpost_datestamp."<br />".($lastpost_author_id ? "<a href='".e_BASE."user.php?id.$lastpost_author_id'>$lastpost_author_name</a> " : $lastpost_author_name).
-                ($thread_parent ?  " <a href='".e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_parent."'>".IMAGE_post."</a>" : " <a href='".e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_id."'>".IMAGE_post."</a>");
-        }else{
-                $LASTPOST = "-";
-        }
-        return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_FORUM));
-}
-
-
-if(e_QUERY == "track"){
-        $tmp = explode("-", USERREALM);
-        foreach($tmp as $key => $value){
-                if($value){
-                        $sql -> db_Select("forum_t", "*", "thread_id='".$value."' ");
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $NEWIMAGE = IMAGE_nonew_small;
-                        if($thread_datestamp > USERLV && (!ereg("\.".$thread_id."\.", USERVIEWED))){
-                                $NEWIMAGE = IMAGE_new_small;
-                        }else if($sql2 -> db_SELECT("forum_t", "*", "thread_parent='$thread_id' AND thread_datestamp > '".USERLV."' ")){
-                                while(list($nthread_id) = $sql2 -> db_Fetch()){
-                                        if(!ereg("\.".$nthread_id."\.", USERVIEWED)){
-                                                $NEWIMAGE = IMAGE_new_small;
-                                        }
-                                }
-                        }
-                        $sql -> db_Select("forum_t", "*",  "thread_id='".$tmp[$key]."' ORDER BY thread_s DESC, thread_lastpost DESC, thread_datestamp DESC");
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $result = preg_split("/\]/", $thread_name);
-                        $TRACKPOSTNAME = ($result[1] ? $result[0]."] <a href='".e_BASE."forum_viewtopic.php?".$thread_forum_id.".".$thread_id."'>".ereg_replace("\[.*\]", "", $thread_name)."</a>" : "<a href='".e_BASE."forum_viewtopic.php?".$thread_forum_id.".".$thread_id."'>".$thread_name."</a>");
-                        $UNTRACK = "<a href='".e_SELF."?untrack.".$thread_id."'>".LAN_392."</a>";
-                        $forum_trackstring .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_TRACK_MAIN);
-                }
-        }
-
-        $forum_track_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_TRACK_START);
-        $forum_track_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_TRACK_END);
-
-        if($pref['forum_enclose']){ $ns -> tablerender($pref['forum_title'], $forum_track_start.$forum_trackstring.$forum_track_end); }else{ echo $forum_track_start.$forum_trackstring.$forum_track_end; }
-}
-
-if(e_QUERY == "new"){
-        $sql3 = new db;
-        if($forum_posts = $sql -> db_Select("forum_t", "*", "thread_datestamp>".USERLV." ORDER BY thread_datestamp DESC LIMIT 0,50")){
-                while($row = $sql -> db_Fetch()){
-                        extract($row);
-                        $sql2 -> db_Select("forum", "*", "forum_id=$thread_forum_id");
-                        $row = $sql2 -> db_Fetch(); extract($row);
-
-                        if(check_class($forum_class)){
-                                if(!ereg("\.".$thread_id."\.", USERVIEWED)){
-                                        $np = TRUE;
-                                        $author_id = substr($thread_user , 0, strpos($thread_user , "."));
-                                        $author_name = substr($thread_user , (strpos($thread_user , ".")+1));
-                                        if(strstr($author_name, chr(1))){
-                                                $tmp = explode(chr(1), $author_name);
-                                                $author_name = $tmp[0];
-                                        }
-                                        $datestamp = $gen->convert_date($thread_datestamp, "forum");
-                                        $STARTERTITLE = "<a href='".e_BASE."user.php?id.$author_id'>$author_name</a><br />".$datestamp;
-                                        $iid = $thread_id;
-
-                                        if($thread_parent){
-                                                $ttemp = $thread_id;
-                                                $sql2 -> db_Select("forum_t", "*", "thread_id=$thread_parent ");
-                                                $row = $sql2 -> db_Fetch(); extract($row);
-                                                $replies = $sql3 -> db_Count("forum_t", "(*)", "WHERE thread_parent='".$thread_id."'");
-                                                $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
-                                                $pages = ((ceil($replies/$pref['forum_postspage']) -1) * $pref['forum_postspage']);
-                                                $NEWSPOSTNAME = "<a href='".e_BASE."forum_viewtopic.php?$thread_forum_id.$thread_id".($pages ? ".$pages" : "")."#".$iid."'>".LAN_425.$thread_name."</a>";
-                                        }else{
-                                                $NEWSPOSTNAME = "<a href='".e_BASE."forum_viewtopic.php?$thread_forum_id.$thread_id'>$thread_name</a>";
-                                        }
-                                        $forum_newstring .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_MAIN);
-                                }
-                        }
-                }
-                if(!$np){
-                        $NEWSPOSTNAME = LAN_198;
-                        $forum_newstring = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_MAIN);
-                }
-
-
-
-                $forum_new_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_START);
-                $forum_new_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_NEWPOSTS_END);
-
-                if($pref['forum_enclose']){ $ns -> tablerender($pref['forum_title'], $forum_new_start.$forum_newstring.$forum_new_end); }else{ echo $forum_new_start.$forum_newstring.$forum_new_end; }
-        }
-}
-
-
-
-$forum_main_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_START);
-$forum_main_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_MAIN_END);
-if($pref['forum_enclose']){ $ns -> tablerender($pref['forum_title'], $forum_main_start.$forum_string.$forum_main_end); }else{ echo $forum_main_start.$forum_string.$forum_main_end; }
-require_once(FOOTERF);
-
-?>
-
-
-
-
-
+<?php
+require_once("class2.php");
+header("Location:".SITEURL.$PLUGINS_DIRECTORY."forum/forum.php");
+exit;
+?>
\ No newline at end of file
diff -ruN 6171/forum_post.php 75/forum_post.php
--- 6171/forum_post.php	2004-09-14 07:37:42.000000000 -0500
+++ 75/forum_post.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,767 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/forum_post.php,v $
-|     $Revision: 1.24 $
-|     $Date: 2004/09/14 12:37:42 $
-|     $Author: mcfly_e107 $
-+----------------------------------------------------------------------------+
-*/
-
-require_once("class2.php");
-if(IsSet($_POST['fjsubmit'])){
-        header("location:".e_BASE."forum_viewforum.php?".$_POST['forumjump']);
-        exit;
-}
-require_once(e_HANDLER."ren_help.php");
-require_once(e_HANDLER."mail.php");
-$gen = new convert;
-$aj = new textparse();
-$fp = new floodprotect;
-
-if(!e_QUERY){
-        header("Location:".e_BASE."forum.php");
-        exit;
-}else{
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0]; $forum_id = $tmp[1]; $thread_id = $tmp[2];
-}
-
-// check if user can post to this forum ...
-
-if($sql -> db_Select("forum", "*", "forum_id=$forum_id")){
-        $row = $sql -> db_Fetch(); extract($row);
-        if(!check_class($forum_class)){
-                $ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_399."</div>");
-                require_once(FOOTERF);
-                exit;
-        }
-}
-
-//        end
-
-$ip = getip();
-if($sql -> db_Select("tmp", "*",  "tmp_ip='$ip' ")){
-        $row = $sql -> db_Fetch();
-        $tmp = explode("^", $row['tmp_info']);
-        $action = $tmp[0];
-        $anonname = $tmp[1];
-        $subject = $tmp[2];
-        $post = $tmp[3];
-        $sql -> db_Delete("tmp", "tmp_ip='$ip' ");
-}
-
-if(ANON == FALSE && USER == FALSE){
-        $text .= "<div style='text-align:center'>".LAN_45." <a href='".e_SIGNUP."'>".LAN_411."</a> ".LAN_412."</div>";
-        $ns -> tablerender(LAN_20, $text);
-        require_once(FOOTERF);
-        exit;
-}
-
-$sql -> db_Select("forum", "*", "forum_id='".$forum_id."' ");
-$row = $sql-> db_Fetch(); extract($row);
-$fname = $row['forum_name'];
-if($forum_class == e_UC_READONLY && !ADMIN){
-        $text .= "<div style='text-align:center'>".LAN_398."</div>";
-        $ns -> tablerender(LAN_20, $text);
-        require_once(FOOTERF);
-        exit;
-}
-
-
-if($thread_id){
-        $sql -> db_Select("forum_t", "*", "thread_id='".$thread_id."' ");
-        $row = $sql-> db_Fetch(); extract($row);
-}
-
-if($action != "nt" && !$thread_active){
-        $ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_397."</div>");
-        require_once(FOOTERF);
-        exit;
-}
-if($action == "cp"){
-        define("e_PAGETITLE", LAN_01." / ".$fname." / ".$row['thread_name']);
-}else{
-        define("e_PAGETITLE", LAN_01." / ".$fname." / ".($action == "rp" ? LAN_02.$row['thread_name'] : LAN_03));
-}
-require_once(HEADERF);
-// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if(IsSet($_POST['addoption']) && $_POST['option_count'] < 10){
-        $_POST['option_count']++;
-        $anonname = $aj -> formtpa($_POST['anonname']);
-        $subject = $aj -> formtpa($_POST['subject']);
-        $post = $aj -> formtpa($_POST['post']);
-}
-
-if(IsSet($_POST['submitpoll'])){
-        require_once(e_HANDLER."poll_class.php");
-        $poll = new poll;
-        $poll -> submit_poll(0, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], 0, $forum_id, "forum");
-
-        require_once(HEADERF);
-        echo "<table style='width:100%' class='fborder'>
-        <tr>
-        <td class='fcaption' colspan='2'>".LAN_133."</td>
-        </tr><tr>
-        <td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'><img src='".e_IMAGE."forum/e.png' alt='' />&nbsp;</td>
-        <td style='vertical-align:center; width:80%' class='forumheader2'>
-        <br />".LAN_384."<br />
-
-        <span class='defaulttext'><a class='forumlink' href='".e_BASE."forum_viewtopic.php?".$thread_forum_id.".".$thread_id."'>".LAN_325."</a><br />
-        <a class='forumlink' href='".e_BASE."forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
-        </td></tr></table>";
-        require_once(FOOTERF);
-        exit;
-}
-
-
-if(IsSet($_POST['fpreview'])){
-        if(USER ? $poster = USERNAME : $poster = ($_POST['anonname'] ? $_POST['anonname'] : LAN_311));
-        $postdate = $gen->convert_date(time(), "forum");
-
-        if(!$pref['html_post']){
-                $tsubject = str_replace("<", "&lt;", $tsubject);str_replace(">", "&gt;", $tsubject);
-                $tpost = str_replace("<", "&lt;", $tpost);str_replace(">", "&gt;", $tpost);
-        }
-
-        $tsubject = $aj -> tpa($_POST['subject']);
-        $tpost = $aj -> tpa($_POST['post']);
-
-        if($_POST['poll_title'] != ""){
-                require_once(e_HANDLER."poll_class.php");
-                $poll = new poll;
-                $poll -> render_poll($_POST['existing'], $_POST['poll_title'], $_POST['poll_option'], array($votes), "preview", "forum");
-                $count=0;
-                while($_POST['poll_option'][$count]){
-                        $_POST['poll_option'][$count] = $aj -> formtpa($_POST['poll_option'][$count]);
-                        $count++;
-                }
-                $_POST['poll_title'] = $aj -> formtpa($_POST['poll_title']);
-        }
-
-        $text = "<div style='text-align:center'>
-        <table style='width:95%' class='fborder'>
-        <tr>
-        <td colspan='2' class='fcaption' style='vertical-align:top'>".LAN_323;
-        $text .= ($action != "nt" ? "</td>" : " ( ".LAN_62.$tsubject." )</td>");
-        $text .= "<tr>
-        <td class='forumheader3' style='width:20%' style='vertical-align:top'><b>".$poster."</b></td>
-        <td class='forumheader3' style='width:80%'>
-        <div class='smallblacktext' style='text-align:right'><img src='".e_IMAGE."forum/post.png' alt='' /> ".LAN_322.$postdate."</div>".$tpost."</td>
-        </tr>
-        </table>
-        </div>";
-
-        $ns -> tablerender(LAN_323, $text);
-
-
-        $anonname = ($_POST['anonname'] ? $aj -> formtpa($_POST['anonname'], "public") : LAN_311);
-        $post = (ADMIN ? $aj -> formtpa($_POST['post']) : $aj -> formtpa($_POST['post'], "public"));
-        $subject = (ADMIN ? $aj -> formtpa($_POST['subject']) : $aj -> formtpa($_POST['subject'], "public"));
-
-        if($action == "edit"){
-                if($_POST['subject'] ? $action = "nt" : $action = "reply");
-                $eaction = TRUE;
-        }else if($action == "quote"){
-                $action = "reply";
-                $eaction = FALSE;
-        }
-}
-
-if(IsSet($_POST['newthread'])){
-
-        if(trim(chop($_POST['subject'])) == "" || trim(chop($_POST['post'])) == ""){
-                message_handler("ALERT", 5);
-        }else{
-                if($fp -> flood("forum_t", "thread_datestamp") == FALSE){
-                        header("location: ".e_BASE."index.php");
-                        exit;
-                }
-
-                if(USER){
-                        $user = USERID.".".USERNAME;
-                }else{
-                        if(!$user = getuser($_POST['anonname'])){
-                                require_once(HEADERF);
-                                $ns -> tablerender(LAN_20, LAN_310);
-                                $ip = getip();
-                                $sql -> db_Delete("tmp", "tmp_ip='$ip' ");
-                                $tmpdata = "newthread^".$_POST['anonname']."^".$_POST['subject']."^".$_POST['post'];
-                                $sql -> db_Insert("tmp", "'$ip', '".time()."', '$tmpdata' ");
-                                loginf();
-                                require_once(FOOTERF);
-                                exit;
-                        }
-                }
-
-                if($file_userfile['error'] != 4){
-                        require_once(e_HANDLER."upload_handler.php");
-                        if($uploaded = file_upload(e_FILE."public/", "attachment")){
-                                $_POST['post'] .= "\n\n".(strstr($uploaded[0]['type'], "image") ? "[img]".e_FILE."public/".$uploaded[0]['name']."[/img] \n<span class='smalltext'>[ ".$uploaded[0]['name']." ]</span>" : "[file=".e_FILE."public/".$uploaded[0]['name']."]".$uploaded[0]['name']."[/file]");
-                        }
-                }
-
-                $post = (ADMIN ? $aj -> formtpa($_POST['post']) : $aj -> formtpa($_POST['post'], "public"));
-                $subject = (ADMIN ? $aj -> formtpa($_POST['subject']) : $aj -> formtpa($_POST['subject'], "public"));
-
-                if($sql -> db_Select("forum_t", "*", "thread_thread='$post'")){
-                        $ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_389."</div>");
-                        require_once(FOOTERF);
-                        exit;
-                }
-
-                $email_notify = ($_POST['email_notify'] ? 99 : 1);
-                if(strstr($user, chr(1))){
-                        $tmp = explode(chr(1), $user);
-                        $lastpost = $tmp[0].".".time();
-                }else{
-                        $lastpost = $user.".".time();
-                }
-
-                if($_POST['poll_title'] != "" && $_POST['poll_option'][0] != "" && $_POST['poll_option'][1] != ""){
-                        $subject = "[".LAN_402."] ".$subject;
-                }
-
-                if($_POST['threadtype'] == 2){
-                        $subject = "[".LAN_403."] ".$subject;
-                }else if($_POST['threadtype'] == 1){
-                        $subject = "[".LAN_404."] ".$subject;
-                }
-
-                $iid = $sql -> db_Insert("forum_t", "0, '".$subject."', '".$post."', '$forum_id', '".time()."', '0', '$user', 0, $email_notify, '".time()."', '".$_POST['threadtype']."' ");
-                $sql -> db_Update("forum", "forum_threads=forum_threads+1, forum_lastpost='$lastpost' WHERE forum_id='$forum_id' ");
-                $sql -> db_Update("user", "user_forums=user_forums+1, user_viewed='".USERVIEWED.".{$iid}.' WHERE user_id='".USERID."' ");
-
-                $sql -> db_Select("forum_t", "*", "thread_thread='$post' ");
-                $row = $sql -> db_Fetch(); extract($row);
-
-                if($_POST['poll_title'] != "" && $_POST['poll_option'][0] != "" && $_POST['poll_option'][1] != ""){
-                        require_once(e_HANDLER."poll_class.php");
-                        $poll = new poll;
-                        $poll -> submit_poll(0, $_POST['poll_title'], $_POST['poll_option'], $_POST['activate'], 0, $thread_id, "forum");
-                }
-                                if($pref['forum_redirect']){
-                                        redirect("".e_BASE."forum_viewtopic.php?".$thread_forum_id.".".$thread_id.".".$pages."#$iid");
-                                }else{
-
-                                        require_once(HEADERF);
-                                        echo "<table style='width:100%' class='fborder'>
-                                        <tr>
-                                        <td class='fcaption' colspan='2'>".LAN_133."</td>
-                                        </tr><tr>
-                                        <td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'><img src='".e_IMAGE."forum/e.png' alt='' />&nbsp;</td>
-                                        <td style='vertical-align:center; width:80%' class='forumheader2'>
-                                        <br />".LAN_324."<br />
-                                        <span class='defaulttext'><a href='".e_BASE."forum_viewtopic.php?".$thread_forum_id.".".$thread_id."#$iid'>".LAN_325."</a><br />
-                                        <a href='".e_BASE."forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
-                                        </td></tr></table>";
-                                        clear_cache("newforumposts");
-                                        require_once(FOOTERF);
-                                        exit;
-                                }
-        }
-}
-
-if(IsSet($_POST['reply'])){
-        if(!$_POST['post']){
-                message_handler("ALERT", 5);
-        }else{
-                if($fp -> flood("forum_t", "thread_datestamp") == FALSE){
-                        header("location: ".e_BASE."index.php");
-                        exit;
-                }
-
-                if(USER){
-                        $user = USERID.".".USERNAME;
-                }else{
-                        if(!$user = getuser($_POST['anonname'])){
-                                require_once(HEADERF);
-                                $ns -> tablerender(LAN_20, LAN_310);
-                                $tmpdata = "reply.".$_POST['anonname'].".".$_POST['subject'].".".$_POST['post'];
-                                $sql -> db_Insert("tmp", "'$ip', '".time()."', '$tmpdata' ");
-                                loginf();
-                                require_once(FOOTERF);
-                                exit;
-                        }
-                }
-
-                if($file_userfile['error'] != 4){
-                        require_once(e_HANDLER."upload_handler.php");
-                        if($uploaded = file_upload(e_FILE."public/", "attachment")){
-                                $_POST['post'] .= "\n\n".(strstr($uploaded[0]['type'], "image") ? "[img]".e_FILE."public/".$uploaded[0]['name']."[/img] \n<span class='smalltext'>[ ".$uploaded[0]['name']." ]</span>" : "[file=".e_FILE."public/".$uploaded[0]['name']."]".$uploaded[0]['name']."[/file]");
-                        }
-                }
-
-                $post = (ADMIN ? $aj -> formtpa($_POST['post']) : $aj -> formtpa($_POST['post'], "public"));
-                $subject = (ADMIN ? $aj -> formtpa($_POST['subject']) : $aj -> formtpa($_POST['subject'], "public"));
-
-                if($sql -> db_Select("forum_t", "*", "thread_thread='$post' AND thread_id='$thread_id' ")){
-                        $ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_389."</div>");
-                        require_once(FOOTERF);
-                        exit;
-                }
-
-                if(strstr($user, chr(1))){
-                        $tmp = explode(chr(1), $user);
-                        $lastpost = $tmp[0].".".time();
-                }else{
-                        $lastpost = $user.".".time();
-                }
-
-                $sql -> db_Select("forum_t", "*", "thread_id='$thread_id' ");
-                $row = $sql-> db_Fetch(); extract($row);
-                if($thread_parent){
-                        $thread_id = $thread_parent;
-                }
-
-                $iid = $sql -> db_Insert("forum_t", "0, '', '".$post."', '$forum_id', '".time()."', '".$thread_id."', '$user', 0, 1, '".time()."', 0 ");
-                $sql -> db_Update("forum_t",  "thread_lastpost='".time()."' WHERE thread_id='$thread_id' ");
-                $sql -> db_Update("forum", "forum_replies=forum_replies+1, forum_lastpost='$lastpost' WHERE forum_id='$forum_id' ");
-                $sql -> db_Update("user", "user_forums=user_forums+1,user_viewed='".USERVIEWED.$iid.".' WHERE user_id='".USERID."' ");
-
-                if($thread_active == 99){
-                        $datestamp = $gen->convert_date(time(), "long");
-                        $email_name = substr($thread_user, (strpos($thread_user, ".")+1));
-                        $sql -> db_Select("user", "*", "user_name='$email_name' ");
-                        $row = $sql -> db_Fetch(); extract($row);
-                        $poster = ereg_replace("^[0-9]+\.", "", $user);
-                        $message = LAN_384.SITENAME.".\n\n".LAN_382.$gen->convert_date(time(), "long")."\n".LAN_94.": ".$poster."\n\n".LAN_385.stripslashes($_POST['post'])."\n\n".LAN_383."\n\n".SITEURL."forum_viewtopic.php?".$forum_id.".".$thread_id;
-                        sendemail($user_email, $pref['forum_eprefix']." '".$thread_name."', ".LAN_381.SITENAME, $message);
-                }
-                if($sql -> db_Select("user", "*", "user_realm REGEXP('-".$thread_id."-') ")){
-                        while($row = $sql -> db_Fetch()){
-                                extract($row);
-                                $poster = ereg_replace("^[0-9]+\.", "", $user);
-                                $message = LAN_385.SITENAME.".\n\n".LAN_382.$gen->convert_date(time(), "long")."\n".LAN_94.": ".$poster."\n\n".LAN_385.stripslashes($_POST['post'])."\n\n".LAN_383."\n\n".SITEURL."forum_viewtopic.php?".$forum_id.".".$thread_id;
-                                sendemail($user_email, $pref['forum_eprefix']." '".$thread_name."', ".LAN_381.SITENAME, $message);
-                        }
-
-                }
-
-
-                $replies = $sql -> db_Count("forum_t", "(*)", "WHERE thread_parent='".$thread_id."'");
-                $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
-                $pages = ((ceil($replies/$pref['forum_postspage']) -1) * $pref['forum_postspage']);
-                                if($pref['forum_redirect']){
-                                        redirect("".e_BASE."forum_viewtopic.php?".$thread_forum_id.".".$thread_id.".".$pages."#$iid");
-                                }else{
-
-                                        require_once(HEADERF);
-                                        $text = "<table style='width:96%' class='fborder'>
-                                        <tr>
-                                        <td class='fcaption' colspan='2'>".LAN_133."</td>
-                                        </tr><tr>
-                                        <td style='text-align:right; vertical-align:center; width:20%' class='forumheader2'><img src='".e_IMAGE."forum/e.png' alt='' />&nbsp;</td>
-                                        <td style='vertical-align:center; width:80%' class='forumheader2'>
-                                        <br />".LAN_324."<br />
-
-                                        <span class='defaulttext'><a href='".e_BASE."forum_viewtopic.php?".$thread_forum_id.".".$thread_id.".".$pages."#$iid'>".LAN_325."</a><br />
-                                        <a href='".e_BASE."forum_viewforum.php?".$forum_id."'>".LAN_326."</a></span><br /><br />
-                                        </td></tr></table>";
-                                        if($pref['forum_enclose']){ $ns -> tablerender($pref['forum_title'], $text); }else{ echo $text; }
-                                        clear_cache("newforumposts");
-                                        require_once(FOOTERF);
-                                        exit;
-                                }
-        }
-}
-
-if(IsSet($_POST['update_thread'])){
-
-        if(!$_POST['subject'] || !$_POST['post']){
-                $error = "<div style='text-align:center'>".LAN_27."</div>";
-        }else{
-                if(!isAuthor($thread_id)){
-                        $ns -> tablerender(LAN_95, "<div style='text-align:center'>".LAN_96."</div>");
-                        require_once(FOOTERF);
-                        exit;
-                }
-                $post = $aj -> formtpa($_POST['post']."\n<span class='smallblacktext'>[ ".LAN_29." ".$datestamp." ]</span>", "public");
-                $subject = $aj -> formtpa($_POST['subject'], "public");
-
-                $datestamp = $gen->convert_date(time(), "forum");
-                $sql -> db_Update("forum_t", "thread_name='".$subject."', thread_thread='".$post."', thread_s='".$_POST['threadtype']."' WHERE thread_id='$thread_id' ");
-                clear_cache("newforumposts");
-                header("location:".e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_id);
-                exit;
-        }
-}
-
-if(IsSet($_POST['update_reply'])){
-
-        if(!$_POST['post']){
-                $error = "<div style='text-align:center'>".LAN_27."</div>";
-        }else{
-                if(!isAuthor($thread_id)){
-                        $ns -> tablerender(LAN_95, "<div style='text-align:center'>".LAN_96."</div>");
-                        require_once(FOOTERF);
-                        exit;
-                }
-                $datestamp = $gen->convert_date(time(), "forum");
-                $post = $aj -> formtpa($_POST['post']."\n<span class='smallblacktext'>[ ".LAN_29." ".$datestamp." ]</span>", "public");
-
-                $sql -> db_Update("forum_t", "thread_thread='".$post."' WHERE thread_id=".$thread_id);
-                clear_cache("newforumposts");
-
-                $sql -> db_Select("forum_t", "*", "thread_id=$thread_id");
-                $row = $sql -> db_Fetch(); extract($row);
-
-                $replies = $sql -> db_Count("forum_t", "(*)", "WHERE thread_parent='".$thread_parent."'");
-
-                $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
-                $pages = ((ceil($replies/$pref['forum_postspage']) -1) * $pref['forum_postspage']);
-
-                header("location:".e_BASE."forum_viewtopic.php?".$forum_id.".".$_POST['thread_id'].($pages ? ".$pages" : ""));
-                exit;
-        }
-}
-
-if($error){        $ns -> tablerender(LAN_20, $error); }
-
-if($action == "edit" || $action == "quote"){
-        $sql -> db_Select("forum", "*", "forum_id='".$forum_id."' ");
-        $row = $sql-> db_Fetch(); extract($row);
-        $sql -> db_Select("forum_t", "*", "thread_id='".$thread_id."' ");
-        $row = $sql-> db_Fetch("no_strip"); extract($row);
-
-        $post_author_id = substr($thread_user, 0, strpos($thread_user, "."));
-        if($action == "edit"){
-                if($post_author_id != USERID && !ADMIN){
-                        $ns -> tablerender(LAN_95, "<div style='text-align:center'>".LAN_96."</div>");
-                        require_once(FOOTERF);
-                        exit;
-                }
-        }
-
-        //&lt;span class=&#39;smallblacktext&#39;>[ Edited Mon Jan 05 2004, 12:28PM ]&lt;/span>
-
-        $subject = $thread_name;
-        $post = $aj -> editparse($thread_thread);
-        $post = ereg_replace("&lt;span class=&#39;smallblacktext&#39;.*\span\>", "", $post);
-        if($action == "quote"){
-                $post_author_name = substr($thread_user, (strpos($thread_user, ".")+1));
-                if(strstr($post_author_name, chr(1))){
-                                                $tmp = explode(chr(1), $post_author_name);
-                                                $post_author_name = $tmp[0];
-                                        }
-                $post = "[quote=$post_author_name]".$post."[/quote]\n";
-                $eaction = FALSE;
-                $action = "reply";
-        }else{
-                $eaction = TRUE;
-                if($thread_parent ? $action = "reply" : $action = "nt");
-        }
-}
-
-
-// -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-
-if($action != "cp"){
-$text = "<div style='text-align:center'>
-<form enctype='multipart/form-data' method='post' action='".e_SELF."?".e_QUERY."' name='dataform'>
-<table style='width:95%' class='fborder'>
-<tr><td colspan='2' class='fcaption'><a class='forumlink' href='".e_BASE."forum.php'>".LAN_405."</a> -> <a class='forumlink' href='".e_HTTP."forum_viewforum.php?".$forum_id."'>".$forum_name."</a> -> ";
-
-if($action == "nt"){
-        $text .= ($eaction ? LAN_77 : LAN_60);
-}else{
-        $text .= ($eaction ? LAN_78 : LAN_406." ".$thread_name);
-}
-
-$text .= "</td></tr>";
-
-if(ANON == TRUE  && USER == FALSE){
-        $text .= "<tr>
-<td class='forumheader2' style='width:20%'>".LAN_61."</td>
-<td class='forumheader2' style='width:80%'>
-<input class='tbox' type='text' name='anonname' size='71' value='".$anonname."' maxlength='20' />
-</td>
-</tr>";
-}
-
-if($action == "nt"){
-        $text .= "<tr>
-<td class='forumheader2' style='width:20%'>".LAN_62."</td>
-<td class='forumheader2' style='width:80%'>
-<input class='tbox' type='text' name='subject' size='71' value='".$subject."' maxlength='100' />
-</td>
-</tr>";
-}
-
-$text .= "<tr>
-<td class='forumheader2' style='width:20%'>";
-$text .= ($action == "nt" ? LAN_63 : LAN_73);
-
-$text .= "</td>
-<td class='forumheader2' style='width:80%'>
-<textarea class='tbox' name='post' cols='70' rows='10' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$aj -> formtparev($post)."</textarea>
-<br />\n".ren_help(2);
-
-$text .= "<br />";
-require_once(e_HANDLER."emote.php");
-$text .= r_emote();
-
-if($pref['email_notify'] && $action == "nt"){
-        $text .= "
-        <span class='defaulttext'>".LAN_380."</span>".
-        ($_POST['email_notify'] ? "<input type='checkbox' name='email_notify' value='1' checked>" : "<input type='checkbox' name='email_notify' value='1'>");
-
-}
-
-if(ADMIN && getperms("5") && $action == "nt"){
-
-        $text .= "<br />
-        <span class='defaulttext'>
-        ".LAN_400."
-        <input name='threadtype' type='radio' value='0'".(!$_POST['threadtype'] ? "checked" : "").">".LAN_1."
-        &nbsp;
-        <input name='threadtype' type='radio' value='1'".($_POST['threadtype'] == 1 ? "checked" : "").">".LAN_2."
-        &nbsp;
-        <input name='threadtype' type='radio' value='2'".($_POST['threadtype'] == 2 ? "checked" : "").">".LAN_3."
-        </span>";
-}
-
-
-
-if($action == "nt" && $pref['forum_poll'] && !eregi("edit", e_QUERY)){
-        $text .= "</td>
-        </tr>
-        <tr>
-        <td colspan='2' class='fcaption'>".LAN_4."</td>
-
-        </tr>
-        <tr>
-
-        <td colspan='2' class='forumheader3'>
-        <span class='smalltext'>".LAN_386."
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'><div class='normaltext'>".LAN_5."</div></td>
-        <td style='width:80%'class='forumheader3'>
-        <input class='tbox' type='text' name='poll_title' size='70' value=\"".$aj -> tpa($_POST['poll_title'])."\" maxlength='200' />";
-
-        $option_count = ($_POST['option_count'] ? $_POST['option_count'] : 1);
-        $text .= "<input type='hidden' name='option_count' value='$option_count'>";
-
-        for($count=1; $count<=$option_count; $count++){
-                $var = "poll_option_".$count;
-                $option = stripslashes($$var);
-                $text .= "<tr>
-        <td style='width:20%' class='forumheader3'>".LAN_391." ".$count.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='poll_option[]' size='60' value=\"".$aj -> tpa($_POST['poll_option'][($count-1)])."\" maxlength='200' />";
-                if($option_count == $count){
-                        $text .= " <input class='button' type='submit' name='addoption' value='".LAN_6."' /> ";
-                }
-                $text .= "</td></tr>";
-        }
-
-
-        $text .= "<tr>
-        <td style='width:20%' class='forumheader3'>".LAN_7."</td>
-        <td class='forumheader3'>";
-        $text .= ($_POST['activate'] == 9 ? "<input name='activate' type='radio' value='9' checked>".LAN_8."<br />" : "<input name='activate' type='radio' value='9'>".LAN_8."<br />");
-        $text .= ($_POST['activate'] == 10 ? "<input name='activate' type='radio' value='10' checked>".LAN_9."<br />" : "<input name='activate' type='radio' value='10'>".LAN_9."<br />");
-
-        $text .= "</td>
-        </tr>";
-}
-
-
-if($pref['forum_attach'] && !eregi("edit", e_QUERY) && FILE_UPLOADS && check_class($pref['upload_class'])){
-        $text .= "<tr>
-        <td colspan='2' class='fcaption'>".LAN_390."</td>
-        </tr>
-        <tr>
-        <td style='width:20%' class='forumheader3'>".LAN_392."</td>
-        <td style='width:80%' class='forumheader3'>
-
-        ".LAN_393." | ".str_replace("\n", " | ", $pref['upload_allowedfiletype'])." |<br />".LAN_394."<br />".LAN_395.": ".($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'].LAN_396 : ini_get('upload_max_filesize'))."<br />
-
-
-        <input class='tbox' name='file_userfile[]' type='file' size='47'>
-        </td>
-        </tr>
-
-        ";
-}
-
-
-
-
-
-$text .= "<tr style='vertical-align:top'>
-
-<td colspan='2' class='forumheader' style='text-align:center'>
-<input class='button' type='submit' name='fpreview' value='".LAN_323."' /> ";
-
-if($action != "nt"){
-                $text .= ($eaction ? "<input class='button' type='submit' name='update_reply' value='".LAN_78."' />" : "<input class='button' type='submit' name='reply' value='".LAN_74."' />");
-}else{
-        $text .= ($eaction ? "<input class='button' type='submit' name='update_thread' value='".LAN_77."' />" : "<input class='button' type='submit' name='newthread' value='".LAN_64."' />");
-}
-$text .= "</td>
-</tr>
-<input type='hidden' name='thread_id' value='$thread_parent'>
-</table>
-</form>
-</div>";
-
-
-$text .= "<table style='width:95%'>
-<tr>
-<td style='width:50%'>";
-$text .= forumjump();
-$text .= "</td></tr></table><br />";
-
-}
-
-if($action == "rp" || $action == "cp"){
-                $id = $thread_id;
-        $sql -> db_Select("forum_t", "*", "thread_id = '$thread_id' ");
-        $row = $sql-> db_Fetch("no_strip"); extract($row);
-        $post_author_name = substr($thread_user, (strpos($thread_user, ".")+1));
-        $tmp = explode(chr(1), $post_author_name);
-        $post_author_name = $tmp[0];
-        $thread_datestamp  = $gen->convert_date($thread_datestamp , "forum");
-        $thread_name = $aj -> tpa($thread_name, $mode="off");
-        $thread_thread = $aj -> tpa($thread_thread, $mode="off");
-                $replies = $sql -> db_Count("forum_t" ,"(*)", "WHERE thread_parent='$id'");
-                $replies_t = ($replies >= 10 ? "10" : $replies);
-        $text .= "<div style='text-align:center'>".($action == "rp" ? "<div style='border:0;padding-right:2px;width:auto;height:400px;overflow:auto;'>": "")."
-        <table style='width:97%' class='fborder'>
-        <tr>
-        <td colspan='2' class='fcaption' style='vertical-align:top'>".($action == "rp" ? LAN_100."</td></tr>" : $thread_name."</td></tr>");
-        $text .= "<tr>
-        <td class='forumheader3' style='width:20%' style='vertical-align:top'><b>".$post_author_name."</b></td>
-        <td class='forumheader3' style='width:80%'>
-        <div class='smallblacktext' style='text-align:right'><img src='".e_IMAGE."forum/post.png' alt='' /> ".LAN_322.$thread_datestamp."</div>".$thread_thread."</td>
-        </tr>".($action == "rp"  && $replies ? "
-        </table>
-                <br />
-        <table style='width:97%' class='fborder'>
-                <tr><td colspan='2' class='fcaption' style='vertical-align:top'>".LAN_101.$replies_t.LAN_102."</td></tr>" : "");
-                $query = ($action == "cp" ? "thread_parent=$id ORDER by thread_datestamp" : "thread_parent=$id ORDER by thread_datestamp DESC LIMIT 0,10 ");
-                if($replies){
-                        $sql -> db_Select("forum_t", "*", $query);
-                        while($row = $sql-> db_Fetch("no_strip")){ extract($row);
-                        $post_author_name = substr($thread_user, (strpos($thread_user, ".")+1));
-                        if(strstr($post_author_name, chr(1))){
-                                $tmp = explode(chr(1), $post_author_name);
-                                $post_author_name = $tmp[0];
-                        }
-                        $thread_datestamp  = $gen->convert_date($thread_datestamp , "forum");
-                        $thread_name = $aj -> tpa($thread_name, $mode="off");
-                        $thread_thread = $aj -> tpa($thread_thread, $mode="off");
-                        $text .= "<tr>
-                        <td class='forumheader3' style='width:20%' style='vertical-align:top'><b>".$post_author_name."</b></td>
-                        <td class='forumheader3' style='width:80%'>
-                        <div class='smallblacktext' style='text-align:right'><img src='".e_IMAGE."forum/post.png' alt='' /> ".LAN_322.$thread_datestamp."</div>".$thread_thread."</td>
-                        </tr>";
-                        }
-                }
-        $text .= ($action == "rp" && $replies > 10 ? "<tr>
-                <td class='forumheader3'  colspan='2'><a href='javascript:open_window(\"forum_post.php?cp.".$forum_id.".".$id."\",\"full\")'>".LAN_103."</a></td>
-                        </tr>" : "")."
-                </table>
-        </div>".($action == "rp" ? "</div>" : "");
-}
-
-if($pref['forum_enclose']){ $ns -> tablerender($pref['forum_title'], $text); }else{ echo $text; }
-
-function isAuthor($thread){
-        global $sql;
-        $sql -> db_Select("forum_t", "thread_user", "thread_id='".$thread."' ");
-        $row = $sql-> db_Fetch("no_strip");
-        $post_author_id = substr($row[0], 0, strpos($row[0], "."));
-        return ($post_author_id == USERID || ADMIN === TRUE);
-}
-
-function getuser($name){
-        global $sql, $aj;
-        $ip = getip();
-        if(USER){
-                $name = USERID.".".USERNAME;
-                $sql -> db_Update("user", "user_chats=user_chats+1, user_lastpost='".time()."' WHERE user_id='".USERID."' ");
-        }else if(!$name){
-                // anonymous guest
-                $name = "0.".LAN_311.chr(1).$ip;
-        }else{
-                //$sql = new db;
-                if($sql -> db_Select("user", "*", "user_name='$name' ")){
-                        $ip = getip();
-                        if($sql -> db_Select("user", "*", "user_name='$name' AND user_ip='$ip' ")){
-                                list($cuser_id, $cuser_name) = $sql-> db_Fetch();
-                                $name = $cuser_id.".".$cuser_name;
-                        }else{
-                                return FALSE;
-                        }
-                }else{
-                        $name = "0.".substr($aj -> formtpa($_POST['anonname'], "public"), 0, 20).chr(1).$ip;
-                }
-        }
-        return $name;
-}
-function loginf(){
-        $text .=  "<div style='text-align:center'>
-<form method='post' action='".e_SELF."?".e_QUERY."'><p>
-".LAN_16."<br />
-<input class='tbox' type='text' name='username' size='15' value='' maxlength='20' />\n
-<br />
-".LAN_17."
-<br />
-<input class='tbox' type='password' name='userpass' size='15' value='' maxlength='20' />\n
-<br />
-<input class='button' type='submit' name='userlogin' value='".LAN_10."' />\n
-<br />
-<input type='checkbox' name='autologin' value='1' /> ".LAN_11."
-<br /><br />
-[ <a href='".e_BASE."signup.php'>".LAN_174."</a> ]<br />[ <a href='fpw.php'>".LAN_212."</a> ]
-</p>
-</form>
-</div>";
-$ns = new e107table;
-$ns -> tablerender(LAN_175, $text);
-}
-function forumjump(){
-        global $sql;
-        $sql -> db_Select("forum", "*", "forum_parent !=0 AND forum_class!='255' ");
-        $text .= "<form method='post' action='".e_SELF."'><p>".LAN_401.": <select name='forumjump' class='tbox'>";
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                if(($forum_class && check_class($forum_class)) || ($forum_class == 254 && USER) || !$forum_class){
-                        $text .= "\n<option value='".$forum_id."'>".$forum_name."</option>";
-                }
-        }
-        $text .= "</select> <input class='button' type='submit' name='fjsubmit' value='".LAN_387."' /></p></form>";
-        return $text;
-}
-function redirect($url)
-{
-        global $ns;
-        if (@preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')))
-        {
-                header('Refresh: 0; URL=' .$url);
-                $text = "<div style='text-align:center'>".LAN_408."<a href='".$url."'> ".LAN_409." </a>".LAN_410."</div>";
-                $ns -> tablerender(LAN_407, $text);
-                require_once(FOOTERF);
-                exit;
-        }
-
-        header('Location: ' . $url);
-        exit;
-}require_once(FOOTERF);
-?>
\ No newline at end of file
diff -ruN 6171/forum_viewforum.php 75/forum_viewforum.php
--- 6171/forum_viewforum.php	2004-09-08 07:02:50.000000000 -0500
+++ 75/forum_viewforum.php	2005-06-02 15:07:58.000000000 -0500
@@ -1,347 +1,12 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/forum_viewforum.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-require_once("class2.php");
-if(IsSet($_POST['fjsubmit'])){
-	header("location:".e_BASE."forum_viewforum.php?".$_POST['forumjump']);
-	exit;
-}
-if(!e_QUERY){
-	header("Location:".e_BASE."forum.php");
-	exit;
-}else{
-	$tmp = explode(".", e_QUERY);
-	$forum_id = $tmp[0]; $from = $tmp[1];
-	if(!$from){ $from = 0; }
-}
-
-$image = (file_exists(THEME."forum/newthread.png")) ? THEME."forum/newthread.png" : e_IMAGE."forum/newthread.png";
-define("IMAGE_newthread", "<img src='{$image}' alt='".FORLAN_10."' title='".FORLAN_10."' style='border:0' />");
-$image = (file_exists(THEME."forum/new_small.png")) ? THEME."forum/new_small.png" : e_IMAGE."forum/new_small.png";
-define("IMAGE_new_small", "<img src='{$image}' alt='".FORLAN_11."' title='".FORLAN_11."' style='border:0' />");
-$image = (file_exists(THEME."forum/nonew_small.png")) ? THEME."forum/nonew_small.png" : e_IMAGE."forum/nonew_small.png";
-define("IMAGE_nonew_small", "<img src='{$image}' alt='".FORLAN_12."' title='".FORLAN_12."' style='border:0' />");
-$image = (file_exists(THEME."forum/new_popular.pgif")) ? THEME."forum/new_popular.gif" : e_IMAGE."forum/new_popular.gif";
-define("IMAGE_new_popular", "<img src='{$image}' alt='".FORLAN_13."' title='".FORLAN_13."' style='border:0' />");
-$image = (file_exists(THEME."forum/nonew_popular.gif")) ? THEME."forum/nonew_popular.gif" : e_IMAGE."forum/nonew_popular.gif";
-define("IMAGE_nonew_popular", "<img src='{$image}' alt='".FORLAN_14."' title='".FORLAN_14."' style='border:0' />");
-$image = (file_exists(THEME."forum/sticky.png")) ? THEME."forum/sticky.png" : e_IMAGE."forum/sticky.png";
-define("IMAGE_sticky", "<img src='{$image}' alt='".FORLAN_15."' title='".FORLAN_15."' style='border:0' />");
-$image = (file_exists(THEME."forum/stickyclosed.png")) ? THEME."forum/stickyclosed.png" : e_IMAGE."forum/stickyclosed.png";
-define("IMAGE_stickyclosed", "<img src='{$image}' alt='".FORLAN_16."' title='".FORLAN_16."' style='border:0' />");
-$image = (file_exists(THEME."forum/announce.png")) ? THEME."forum/announce.png" : e_IMAGE."forum/announce.png";
-define("IMAGE_announce", "<img src='{$image}' alt='".FORLAN_17."' title='".FORLAN_17."' style='border:0' />");
-$image = (file_exists(THEME."forum/closed_small.png")) ? THEME."forum/closed_small.png" : e_IMAGE."forum/closed_small.png";
-define("IMAGE_closed_small", "<img src='{$image}' alt='".FORLAN_18."' title='".FORLAN_18."' style='border:0' />");
-$image = (file_exists(THEME."forum/admin_move.png")) ? THEME."forum/admin_move.png" : e_IMAGE."forum/admin_move.png";
-define("IMAGE_admin_move", "<img src='{$image}' alt='".LAN_402."' title='".LAN_402."' style='border:0' />");
-
-define("IMAGE_admin_unstick", ((file_exists(THEME."forum/admin_unstick.png") ? "src='".THEME."forum/admin_unstick.png' " : "src='".e_IMAGE."forum/admin_unstick.png' ")."alt='".LAN_398."' title='".LAN_398."' style='border:0' "));
-define("IMAGE_admin_stick", ((file_exists(THEME."forum/admin_stick.png")     ? "src='".THEME."forum/admin_stick.png' "   : "src='".e_IMAGE."forum/admin_stick.png' ")."alt='".LAN_401."' title='".LAN_401."' style='border:0' "));
-define("IMAGE_admin_lock", ((file_exists(THEME."forum/admin_lock.png")     ? "src='".THEME."forum/admin_lock.png' "      : "src='".e_IMAGE."forum/admin_lock.png' ")."alt='".LAN_399."' title='".LAN_399."' style='border:0' "));
-define("IMAGE_admin_unlock", ((file_exists(THEME."forum/admin_unlock.png") ? "src='".THEME."forum/admin_unlock.png' "    : "src='".e_IMAGE."forum/admin_unlock.png' ")."alt='".LAN_400."' title='".LAN_400."' style='border:0' "));
-
-
-$STARTERTITLE = LAN_54;
-$THREADTITLE = LAN_53;
-$REPLYTITLE = LAN_55;
-$LASTPOSTITLE = LAN_57;
-$VIEWTITLE = LAN_56;
-
-if(!$FORUM_VIEW_START)
-{
-	if(file_exists(THEME."forum_viewforum_template.php"))
-	{
-    require_once(THEME."forum_viewforum_template.php");
-  }
-  else
-  {
-    require_once(e_BASE.$THEMES_DIRECTORY."templates/forum_viewforum_template.php");
-  }
-}
-
-$sql -> db_Select("forum", "*", "forum_id='".$forum_id."' ");
-$row = $sql-> db_Fetch(); extract($row);
-define("e_PAGETITLE", LAN_01." / ".$row['forum_name']);
-
-if($forum_class && !check_class($forum_class) || !$forum_parent){ header("Location:".e_BASE."forum.php"); exit;}
-
-define("MODERATOR", (preg_match("/".preg_quote(ADMINNAME)."/", $forum_moderators) && getperms("A") ? TRUE : FALSE));
-
-$message="";
-if(MODERATOR)
-{
-	if($_POST)
-	{
-		require_once(e_HANDLER."forum_mod.php");
-		$message = forum_thread_moderate($_POST);
-	}
-}
-
-$member_users = $sql -> db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id!='0' ");
-$guest_users = $sql -> db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id='0' ");
-$users = $member_users+$guest_users;
-
-require_once(HEADERF);
-if($message)
-{
-	$ns -> tablerender("",$message);
-}
-
-$view=25;
-$topics = $sql -> db_Count("forum_t", "(*)", " WHERE thread_forum_id='".$forum_id."' AND thread_parent='0' ");
-if($topics > $view){
-	$a = $topics/$view;
-	$r = explode(".", $a);
-	if($r[1] != 0 ? $pages = ($r[0]+1) : $pages = $r[0]);
-}else{
-	$pages = FALSE;
-}
-
-$sql -> db_Select("forum", "*", "forum_id='".$forum_parent."' ");
-$row_par = $sql-> db_Fetch();
-$parent_title = $row_par['forum_name'];
-
-if($pages){
-
-	$THREADPAGES = LAN_316.": ";
-	if($pages > 10){
-		$current = ($from/$view)+1;
-		for($c=0; $c<=2; $c++){
-			$THREADPAGES .= ($view*$c == $from ? "<span style='text-decoration: underline;'>".($c+1)."</span> " : "<a href='".e_SELF."?".$forum_id.".".($view*$c)."'>".($c+1)."</a> ");
-		}
-		if($current >=3 && $current <= 5){
-			for($c=3; $c<=$current; $c++){
-				$THREADPAGES .= ($view*$c == $from ? "<span style='text-decoration: underline;'>".($c+1)."</span> " : "<a href='".e_SELF."?".$forum_id.".".($view*$c)."'>".($c+1)."</a> ");
-			}
-		}else if($current >= 6){
-			$text .= " ... ";
-			for($c=($current-2); $c<=$current; $c++){
-				$THREADPAGES .= ($view*$c == $from ? "<span style='text-decoration: underline;'>".($c+1)."</span> " : "<a href='".e_SELF."?".$forum_id.".".($view*$c)."'>".($c+1)."</a> ");
-			}
-		}
-		$text .= " ... ";
-		$tmp = $pages-3;
-		for($c=$tmp; $c<=($pages-1); $c++){
-			$THREADPAGES .= ($view*$c == $from ? "<span style='text-decoration: underline;'>".($c+1)."</span> " : "<a href='".e_SELF."?".$forum_id.".".($view*$c)."'>".($c+1)."</a> ");
-		}
-	}else{
-		for($c=0; $c < $pages; $c++){
-			if($view*$c == $from ? $THREADPAGES .= "<b>".($c+1)."</b> " : $THREADPAGES .= "<a href='".e_SELF."?".$forum_id.".".($view*$c)."'>".($c+1)."</a> ");
-		}
-	}
-	$THREADPAGES .= "<br />";
-}
-
-if((ANON || USER) && ($forum_class != e_UC_READONLY || MODERATOR)){
-	$NEWTHREADBUTTON = "<a href='".e_BASE."forum_post.php?nt.".$forum_id."'>".IMAGE_newthread."</a>";
-}
-
-$BREADCRUMB = "<a class='forumlink' href='index.php'>".SITENAME."</a> >> <a class='forumlink' href='forum.php'>".LAN_01."</a> >> <b>".$forum_name."</b>";
-$FORUMTITLE = $forum_name;
-$MODERATORS = LAN_404.": ".$forum_moderators;
-$BROWSERS = $users." ".($users == 1 ? LAN_405 : LAN_406)." (".$member_users." ".($member_users==1 ? LAN_407 : LAN_409).", ".$guest_users." ".($guest_users == 1 ? LAN_408 : LAN_410).")";
-
-
-$ICONKEY = "
-<table style='width:100%'>
-<tr>
-<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_new_small."</td>
-<td style='width:10%' class='smallblacktext'>".LAN_79."</td>
-<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_nonew_small."</td>
-<td style='width:10%' class='smallblacktext'>".LAN_80."</td>
-<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_sticky."</td>
-<td style='width:10%' class='smallblacktext'>".LAN_202."</td>
-<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_announce."</td>
-<td style='width:10%' class='smallblacktext'>".LAN_396."</td>
-</tr>
-<tr>
-<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_new_popular."</td>
-<td style='width:2%' class='smallblacktext'>".LAN_79." ".LAN_395."</td>
-<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_nonew_popular."</td>
-<td style='width:10%' class='smallblacktext'>".LAN_80." ".LAN_395."</td>
-<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_stickyclosed."</td>
-<td style='width:10%' class='smallblacktext'>".LAN_203."</td>
-<td style='vertical-align:center; text-align:center; width:2%'>".IMAGE_closed_small."</td>
-<td style='width:10%' class='smallblacktext'>".LAN_81."</td>
-</tr>
-</table>";
-
-$SEARCH = "
-<form method='post' action='search.php'>
-<p>
-<input class='tbox' type='text' name='searchquery' size='20' value='' maxlength='50' />
-<input class='button' type='submit' name='searchsubmit' value='".LAN_180."' />
-<input type='hidden' name='searchtype' value='7' />
-</p>
-</form>";
-
-$PERMS = 
-(USER == TRUE || ANON == TRUE ? LAN_204." - ".LAN_206." - ".LAN_208 : LAN_205." - ".LAN_207." - ".LAN_209);
-
-$sticky_threads = 0;$stuck = FALSE;
-$reg_threads = 0;$unstuck = FALSE;
-if($sql -> db_Select("forum_t", "*",  "thread_forum_id='".$forum_id."' AND thread_parent='0' ORDER BY thread_s DESC, thread_lastpost DESC, thread_datestamp DESC LIMIT $from, $view")){
-	$sql2 = new db; $sql3 = new db; $gen = new convert;
-	while($row= $sql -> db_Fetch()){
-		if($row['thread_s']){
-			$sticky_threads ++;
-		}
-		if($sticky_threads == "1" && !$stuck){
-			$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5'  class='forumheader'><span class='mediumtext'><b>".LAN_411."</b></span></td></tr>";
-			$stuck = TRUE;
-		}
-		if(!$row['thread_s']){
-			$reg_threads ++;
-		}
-		if($reg_threads == "1" && !$unstuck && $stuck){
-			$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5'  class='forumheader'><span class='mediumtext'><b>".LAN_412."</b></span></td></tr>";
-			$unstuck = TRUE;
-		}
-		$forum_view_forum .= parse_thread($row);
-	}
-}else{
-	$forum_view_forum = "<tr><td colspan='6' style='text-align:center' class='forumheader2'><br /><span class='mediumtext'><b>".LAN_58."</b></span><br /><br /></td></tr>";
-}
-
-$sql -> db_Select("forum", "*", "forum_parent !=0 AND forum_class!='255' ");
-$FORUMJUMP = "<form method='post' action='".e_SELF."'><p>".LAN_403.": <select name='forumjump' class='tbox'>";
-while($row = $sql -> db_Fetch()){
-	extract($row);
-	if(check_class($forum_class)){
-		$FORUMJUMP .= "\n<option value='".$forum_id."'>".$forum_name."</option>";
-	}
-}
-$FORUMJUMP .= "</select> <input class='button' type='submit' name='fjsubmit' value='".LAN_03."' /></p></form>";
-$TOPLINK = "<a href='".e_SELF."?".$_SERVER['QUERY_STRING']."#top'>".LAN_02."</a>";
-
-$forum_view_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_START);
-$forum_view_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_END);
-if($pref['forum_enclose']){ $ns -> tablerender($pref['forum_title'], $forum_view_start.$forum_view_forum.$forum_view_end); }else{ echo $forum_view_start.$forum_view_forum.$forum_view_end; }
-require_once(FOOTERF);
-
-
-function parse_thread($row){
-	global $sql2, $sql3, $FORUM_VIEW_FORUM, $gen, $aj, $pref, $forum_id, $menu_pref;
-	extract($row);
-	$VIEWS = $thread_views;
-	$REPLIES = $sql2 -> db_Count("forum_t", "(*)", " WHERE thread_parent='$thread_id' ");
-	if($REPLIES){
-		$sql2 -> db_Select("forum_t", "*", "thread_parent='$thread_id' ORDER BY thread_datestamp DESC");
-		list($null, $null, $null, $null, $r_datestamp, $null, $r_user) = $sql2 -> db_Fetch();
-		$r_id = substr($r_user, 0, strpos($r_user, "."));
-		$r_name = substr($r_user, (strpos($r_user, ".")+1));
-
-		if(strstr($r_name, chr(1))){ $tmp = explode(chr(1), $r_name); $r_name = $tmp[0]; }
-
-		$r_datestamp = $gen->convert_date($r_datestamp, "forum");
-		if(!$r_id ? $LASTPOST = $r_name."<br />".$r_datestamp : $LASTPOST = "<a href='".e_BASE."user.php?id.".$r_id."'>".$r_name."</a><br />".$r_datestamp);
-
-	}else{
-		$REPLIES = LAN_317;
-		$LASTPOST = " - ";
-	}
-
-	$post_author_id = substr($thread_user, 0, strpos($thread_user, "."));
-	$post_author_name = substr($thread_user, (strpos($thread_user, ".")+1));
-	if(strstr($post_author_name, chr(1))){ $tmp = explode(chr(1), $post_author_name); $post_author_name = $tmp[0]; }
-	
-
-	$newflag = FALSE;
-	if(USER){
-		if($thread_datestamp > USERLV && (!ereg("\.".$thread_id."\.", USERVIEWED))){
-			$newflag = TRUE;
-		}else if($sql3 -> db_SELECT("forum_t", "*", "thread_parent='$thread_id' AND thread_datestamp > '".USERLV."' ")){
-			while(list($nthread_id) = $sql3 -> db_Fetch()){
-				if(!ereg("\.".$nthread_id."\.", USERVIEWED)){
-					$newflag = TRUE;
-				}
-			}
-		}
-	}
-
-	$THREADDATE = $gen->convert_date($thread_datestamp, "forum");
-	$ICON = ($newflag ? IMAGE_new_small : IMAGE_nonew_small);
-	if($REPLIES >= $pref['forum_popular'] && $REPLIES != "None"){
-		$ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular);
-	}
-
-	if($thread_s == 1){
-		$ICON = ($thread_active ? IMAGE_sticky : IMAGE_stickyclosed);
-	}else if($thread_s == 2){
-		$ICON = IMAGE_announce;
-	}else if(!$thread_active){
-		$ICON = IMAGE_closed_small;
-	}
-
-	$thread_name = strip_tags($aj -> tpa($thread_name));
-	$result = preg_split("/\]/", $thread_name);
-	if($pref['forum_tooltip']){
-		$thread_thread = strip_tags($aj -> tpa($thread_thread));
-		$tip_length = ($pref['forum_tiplength'] ? $pref['forum_tiplength'] : 400);
-		if(strlen($thread_thread) > $tip_length) {
-			$thread_thread = substr($thread_thread, 0, $tip_length)." ".$menu_pref['newforumposts_postfix'];
-		}
-		$thread_thread = str_replace("'", "&#39;", $thread_thread);
-		$title = "title='".$thread_thread."'";
-	}else{
-		$title = "";
-	}
-	$THREADNAME = ($result[1] ? $result[0]."] <a  ".$title." href='".e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_id."'>".ereg_replace("\[.*\]", "", $thread_name)."</a>" : "<a ".$title." href='".e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_id."'>".$thread_name."</a>");
-
-	$pages = ceil($REPLIES/$pref['forum_postspage']);
-	if($pages>1){
-		$PAGES = LAN_316." [ ";
-		for($a=0; $a<=($pages-1); $a++){
-			$PAGES .= "-<a href='".e_BASE."forum_viewtopic.php?".$forum_id.".".$thread_id.".".($a*$pref['forum_postspage'])."'>".($a+1)."</a>";
-		}
-		$PAGES .= " ]";
-	}
-
-	if(MODERATOR)
-	{
-		$ADMIN_ICONS = "
-		<form method='post' action='".e_SELF."?{$forum_id}' id='frmMod_{$forum_id}_{$thread_id}'><div>
-		";
-		$ADMIN_ICONS .= ($thread_s == 1) ? "<input type='image' ".IMAGE_admin_unstick." name='unstick_{$thread_id}' value='thread_action' /> " : "<input type='image' ".IMAGE_admin_stick." name='stick_{$thread_id}' value='thread_action' /> ";
-		$ADMIN_ICONS .= ($thread_active) ? "<input type='image' ".IMAGE_admin_lock." name='lock_{$thread_id}' value='thread_action' /> " : "<input type='image' ".IMAGE_admin_unlock." name='unlock_{$thread_id}' value='thread_action' /> ";
-		$ADMIN_ICONS .= "<a href='".e_ADMIN."forum_conf.php?move.".$forum_id.".".$thread_id."'>".IMAGE_admin_move."</a>";
-		$ADMIN_ICONS .= "
-		</div></form>
-		";
-	}
-			
-	$text .= "</td>
-	<td style='vertical-align:top; text-align:center; width:20%' class='forumheader3'>".$THREADDATE."<br />";
-	$POSTER = (!$post_author_id ? $post_author_name :  "<a href='".e_BASE."user.php?id.".$post_author_id."'>".$post_author_name."</a>");
-	return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM));
-}
-
-
-function forumjump(){
-	global $sql;
-	$sql -> db_Select("forum", "*", "forum_parent !=0 AND forum_class!='255' ");
-	$FORUMJUMP = "<form method='post' action='".e_SELF."'><p>".LAN_403.": <select name='forumjump' class='tbox'>";
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		if(check_class($forum_class)){
-			$FORUMJUMP .= "\n<option value='".$forum_id."'>".$forum_name."</option>";
-		}
-	}
-	$FORUMJUMP .= "</select> <input class='button' type='submit' name='fjsubmit' value='".LAN_03."' />&nbsp;&nbsp;&nbsp;&nbsp;<a href='".e_SELF."?".$_SERVER['QUERY_STRING']."#top'>".LAN_02."</a></p></form>";
-	return ($FORUMJUMP);
-}
-
+<?php
+require_once("class2.php");
+$tmp = explode(".", e_QUERY);
+$forum_id = intval($tmp[0]);
+if($forum_id)
+{
+	header("Location:".SITEURL.$PLUGINS_DIRECTORY."forum/forum_viewforum.php?{$forum_id}");
+	exit;
+}
+header("Location:".SITEURL."index.php");
+exit;
 ?>
\ No newline at end of file
diff -ruN 6171/forum_viewtopic.php 75/forum_viewtopic.php
--- 6171/forum_viewtopic.php	2004-09-01 08:27:06.000000000 -0500
+++ 75/forum_viewtopic.php	2005-06-02 15:07:58.000000000 -0500
@@ -1,556 +1,12 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/forum_viewtopic.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-require_once("class2.php");
-
-require_once(e_HANDLER."textparse/basic.php");
-$etp = new e107_basicparse;
-
-if(IsSet($_POST['fjsubmit'])){
-	header("location:".e_BASE."forum_viewforum.php?".$_POST['forumjump']);
-	exit;
-}
-$highlight_search = FALSE;
-if(IsSet($_POST['highlight_search'])){
-	$highlight_search = TRUE;
-}
-define("IMAGE_reply", (file_exists(THEME."forum/reply.png") ? "<img src='".THEME."forum/reply.png' alt='' style='border:0' />" : "<img src='".e_IMAGE."forum/reply.png' alt='' style='border:0' />"));
-define("IMAGE_newthread", (file_exists(THEME."forum/newthread.png") ? "<img src='".THEME."forum/newthread.png' alt='' style='border:0' />" : "<img src='".e_IMAGE."forum/newthread.png' alt='' style='border:0' />"));
-//define("IMAGE_profile", (file_exists(THEME."forum/profile.png") ? "<img src='".THEME."forum/profile.png' alt='".LAN_398."' style='border:0' />" : "<img src='".e_IMAGE."forum/profile.png' alt='".LAN_398."' style='border:0' />"));
-define("IMAGE_rank_moderator_image", ($pref['rank_moderator_image'] && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "<img src='".THEME."forum/".$pref['rank_moderator_image']."' alt='' />" : "<img src='".e_IMAGE."forum/moderator.png' alt='' />"));
-define("IMAGE_rank_main_admin_image", ($pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "<img src='".THEME."forum/".$pref['rank_main_admin_image']."' alt='' />" : "<img src='".e_IMAGE."forum/main_admin.png' alt='' />"));
-define("IMAGE_rank_admin_image", ($pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "<img src='".THEME."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_IMAGE."forum/admin.png' alt='' />"));
-define("IMAGE_pm", (file_exists(THEME."forum/pm.png") ? "<img src='".THEME."forum/pm.png' alt='".LAN_399."' style='border:0' />" : "<img src='".e_IMAGE."forum/pm.png' alt='".LAN_399."' style='border:0' />"));
-define("IMAGE_website", (file_exists(THEME."forum/website.png") ? "<img src='".THEME."forum/website.png' alt='".LAN_396."' style='border:0' />" : "<img src='".e_IMAGE."forum/website.png' alt='".LAN_396."' style='border:0' />"));
-define("IMAGE_edit", (file_exists(THEME."forum/edit.png") ? "<img src='".THEME."forum/edit.png' alt='".LAN_400."' style='border:0' />" : "<img src='".e_IMAGE."forum/edit.png' alt='".LAN_400."' style='border:0' />"));
-define("IMAGE_quote", (file_exists(THEME."forum/quote.png") ? "<img src='".THEME."forum/quote.png' alt='".LAN_401."' style='border:0' />" : "<img src='".e_IMAGE."forum/quote.png' alt='".LAN_401."' style='border:0' />"));
-define("IMAGE_admin_edit", (file_exists(THEME."forum/admin_edit.png") ? "<img src='".THEME."forum/admin_edit.png' alt='".LAN_406."' style='border:0' />" : "<img src='".e_IMAGE."forum/admin_edit.png' alt='".LAN_406."' style='border:0' />"));
-define("IMAGE_admin_move", (file_exists(THEME."forum/admin_move.png") ? "<img src='".THEME."forum/admin_move.png' alt='".LAN_408."' style='border:0' />" : "<img src='".e_IMAGE."forum/admin_move.png' alt='".LAN_408."' style='border:0' />"));
-define("IMAGE_new", (file_exists(THEME."forum/new.png") ? "<img src='".THEME."forum/new.png' alt='' style='float:left' />" : "<img src='".e_IMAGE."forum/new.png' alt='' style='float:left' />"));
-define("IMAGE_post", (file_exists(THEME."forum/post.png") ? "<img src='".THEME."forum/post.png' alt='' style='border:0' />" : "<img src='".e_IMAGE."forum/post.png' alt='' style='border:0' />"));
-define("IMAGE_report", (file_exists(THEME."forum/report.png") ? "<img src='".THEME."forum/report.png' alt='".LAN_413."' style='border:0' />" : "<img src='".e_IMAGE."forum/report.png' alt='".LAN_413."' style='border:0' />"));
-
-define("IMAGE_admin_delete", (file_exists(THEME."forum/admin_delete.png") ? "src='".THEME."forum/admin_delete.png' alt='".LAN_407."' title='".LAN_407."' style='border:0' " : " src='".e_IMAGE."forum/admin_delete.png' alt='".LAN_407."' title='".LAN_407."' style='border:0' "));
-
-
-if(!e_QUERY){
-	header("Location:".e_BASE."forum.php");
-	exit;
-}else{
-	$tmp = explode(".", e_QUERY);
-	$forum_id = $tmp[0]; $thread_id = $tmp[1]; $from = $tmp[2]; $action = $tmp[3];
-	if(!$from){ $from = 0; }
-	if(!$thread_id || !is_numeric($thread_id)){
-		header("Location:".e_BASE."forum.php");
-		exit;
-	}
-}
-$sql -> db_Select("forum_t", "*", "thread_id='".$thread_id."'  LIMIT 1 ");
-	$row = $sql-> db_Fetch(); extract($row);
-	if($thread_forum_id != $forum_id){
-		header("Location:".e_BASE."forum.php");
-		exit;
-	}
-
-if($action == "track" && USER){
-	$sql -> db_Update("user", "user_realm='".USERREALM."-".$thread_id."-' WHERE user_id='".USERID."' ");
-	header("location:".e_SELF."?".$forum_id.".".$thread_id);
-	exit;
-}
-
-if($action == "untrack" && USER){
-	$tmp = ereg_replace("-".$thread_id."-", "", USERREALM);
-	$sql -> db_Update("user", "user_realm='$tmp' WHERE user_id='".USERID."' ");
-	header("location:".e_SELF."?".$forum_id.".".$thread_id);
-	exit;
-}
-if($action == "report"){
-	$aj = new textparse();
-	if(IsSet($_POST['report_thread'])){	
-		$user = $_POST['user'];$report_thread_id = $_POST['report_thread_id'];$report_thread_name = $_POST['report_thread_name'];
-		if($pref['reported_post_email']){
-			require_once(e_HANDLER."mail.php");
-			$report_add = $aj -> tpa($_POST['report_add']);
-			$report = LAN_422.SITENAME." : ".(substr(SITEURL, -1) == "/" ? SITEURL : SITEURL."/")."forum_viewtopic.php?".$forum_id.".".$report_thread_id."#".$thread_id."\n".LAN_425.$user."\n".$report_add;
-			$subject = LAN_421." ".SITENAME;
-			sendemail(SITEADMINEMAIL, $subject, $report);
-		}
-		$reported_post = $forum_id."^".$report_thread_id."^".$thread_id."^".$report_thread_name."^".$user;
-		$sql -> db_Insert("tmp", "'reported_post', '".time()."', '$reported_post' ");
-        define("e_PAGETITLE", LAN_01." / ".LAN_428);
-		require_once(HEADERF);	
-		$text = LAN_424."<br /><a href='forum_viewtopic.php?".$forum_id.".".$report_thread_id."#".$thread_id."'>".LAN_429."</a";
-		$ns -> tablerender(LAN_414, $text);
-	}else{
-		$number = $thread_id;
-		$sql -> db_Select("forum_t", "*", "thread_id='".$thread_id."' ");
-		$row = $sql -> db_Fetch();
-		if($row['thread_parent']){
-			$sql2 = new db;
-			$sql2 -> db_Select("forum_t", "*", "thread_id = $thread_parent");
-			list($thread_id, $thread_name) = $sql2 -> db_Fetch();
-		}else{
-			$thread_name = $row['thread_name'];
-		}
-		$report_thread_id = $thread_id;
-		define("e_PAGETITLE", LAN_01." / ".LAN_426." ".$thread_name);
-		require_once(HEADERF);	
-		$user = (USER ? USERNAME : LAN_194);
-		$text = "<form action='".e_BASE."forum_viewtopic.php?".e_QUERY."' method='post'> <table style='width:100%'>
-		<tr>
-		<td  style='width:50%' >
-		".LAN_415.": ".$thread_name." <a href='forum_viewtopic.php?".$forum_id.".".$thread_id."#".$number."'><span class='smalltext'>".LAN_420." </span>
-		</a>
-		</td>
-		<td style='text-align:center;width:50%'>
-		</td>
-		</tr>
-		<tr>
-		<td>".LAN_417."<br />".LAN_418."
-		</td>
-		<td style='text-align:center;'>
-		<textarea cols='40' rows='10' class='tbox' name='report_add'></textarea>
-		</td>
-		</tr>
-		<tr>
-		<td colspan='2' style='text-align:center;'><br />
-		<input type ='hidden' name='user' value='$user' />
-		<input type ='hidden' name='report_thread_id' value='$report_thread_id' />
-		<input type ='hidden' name='report_thread_name' value='$thread_name' />
-		<input class='button' type='submit' name='report_thread' value='".LAN_419."' />
-		</td>
-		</tr>
-		</table>";
-		$ns -> tablerender(LAN_414, $text);
-	}
-
-	require_once(FOOTERF);
-	exit;
-}
-$pm_installed = ($pref['pm_title'] ? TRUE : FALSE);
-
-$gen = new convert;
-$aj = new textparse();
-
-$sql -> db_Update("forum_t", "thread_views=thread_views+1 WHERE thread_id='$thread_id' ");
-
-$sql -> db_Select("forum", "*", "forum_id='".$forum_id."' ");
-$row = $sql-> db_Fetch(); extract($row);
-$fname = $row['forum_name'];
-
-if(($forum_class && !check_class($forum_class)) || ($forum_class == 254 && !USER)){ header("Location:".e_BASE."forum.php"); exit;}
-
-$sql -> db_Select("forum_t", "*", "thread_id='".$thread_id."' ORDER BY thread_datestamp DESC ");
-$row = $sql-> db_Fetch("no_strip"); extract($row);
-define("e_PAGETITLE", LAN_01." / ".$fname." / ".$row['thread_name']);
-
-define("MODERATOR", (preg_match("/".preg_quote(ADMINNAME)."/", $forum_moderators) && getperms("A") ? TRUE : FALSE));
-$message="";
-if(MODERATOR)
-{
-	if($_POST)
-	{
-		require_once(e_HANDLER."forum_mod.php");
-		$message = forum_thread_moderate($_POST);
-	}
-}
-
-require_once(HEADERF);
-require_once(e_HANDLER."level_handler.php");
-if($message)
-{
-	$ns -> tablerender("",$message);
-}
-
-If(IsSet($_POST['pollvote'])){
-	$sql -> db_Select("poll", "poll_active, poll_ip", "poll_id='".$_POST['pollid']."' ");
-	$row = $sql -> db_Fetch(); extract($row);
-	$user_id = ($poll_active == 9 ? getip() : USERID);
-	if(!preg_match("/".$user_id."\^/", $poll_ip)){
-		if($_POST['votea']){
-			$num = "poll_votes_".$_POST['votea'];
-			$sql -> db_Update("poll", "$num=$num+1, poll_ip='".$poll_ip.$user_id."^' WHERE poll_id='".$_POST['pollid']."' ");
-		}
-	}
-}
-
-if(eregi("\[".LAN_430."\]", $thread_name)){
-	if($sql -> db_Select("poll", "*", "poll_datestamp='$thread_id' ")){
-		list($poll_id, $poll_datestamp, $poll_end_datestamp, $poll_admin_id, $poll_title, $poll_option[0], $poll_option[1], $poll_option[2], $poll_option[3], $poll_option[4], $poll_option[5], $poll_option[6], $poll_option[7], $poll_option[8], $poll_option[9], $votes[0], $votes[1], $votes[2], $votes[3], $votes[4], $votes[5], $votes[6], $votes[7], $votes[8], $votes[9], $poll_ip, $poll_active) = $sql-> db_Fetch();
-
-		$user_id = ($poll_active == 9 ? getip() : USERID);
-		if(preg_match("/".$user_id."\^/", $poll_ip)){
-			$mode = "voted";
-		}else if($poll_active == 2 && !USER){
-			$mode = "disallowed";
-		}else{
-			$mode = "notvoted";
-		}
-		require_once(e_HANDLER."poll_class.php");
-		$poll = new poll;
-		$pollstr = "<div class='spacer'>".$poll -> render_poll($poll_id, $poll_title, $poll_option, $votes, $mode, "forum")."</div>";
-	}
-}
-
-
-
-
-$sql -> db_Select("forum_t", "thread_id",  "thread_forum_id='".$forum_id."' AND thread_parent='0' ORDER BY thread_s ASC, thread_lastpost ASC, thread_datestamp ASC");
-$c = 0;
-while($row = $sql -> db_Fetch()){
-	$array[$c] = $row['thread_id'];
-	if($row['thread_id'] == $thread_id){
-		$prevthread = $array[$c-1];
-		$row = $sql -> db_Fetch();
-		$nextthread = $row['thread_id'];
-		break;
-	}
-	$c++;
-}
-
-if(!$FORUMSTART){
-	if(file_exists(THEME."forum_viewtopic_template.php")){
-    require_once(THEME."forum_viewtopic_template.php");
-  }
-	else{
-    require_once(e_BASE.$THEMES_DIRECTORY."templates/forum_viewtopic_template.php");
-  }
-}
-
-// get info for main thread -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-$thread_name = $aj -> tpa($thread_name);
-
-$BREADCRUMB = "<a class='forumlink' href='".e_BASE."index.php'>".SITENAME."</a> -> <a class='forumlink' href='forum.php'>".LAN_01."</a> -> <a class='forumlink' href='forum_viewforum.php?".$forum_id."'>".$forum_name."</a> -> ".$thread_name;
-
-$BACKLINK = "<a class='forumlink' href='".e_BASE."index.php'>".SITENAME."</a> -> <a class='forumlink' href='forum.php'>".LAN_01."</a> -> <a class='forumlink' href='forum_viewforum.php?".$forum_id."'>".$forum_name."</a>";
-
-$THREADNAME = $thread_name;
-
-$NEXTPREV = ($prevthread ? "&lt;&lt; <a href='".e_SELF."?".$forum_id.".".$prevthread."'>".LAN_389."</a> " : LAN_404." ")."|".($nextthread ? " <a href='".e_SELF."?".$forum_id.".".$nextthread."'>".LAN_390."</a> &gt;&gt;" : " ".LAN_405." ");
-
-if($pref['forum_track'] && USER){
-	$TRACK = (preg_match("/-".$thread_id."-/", USERREALM) ? "<span class='smalltext'><a href='".e_SELF."?".$forum_id.".".$thread_id.".0."."untrack'>".LAN_392."</a></span>" : "<span class='smalltext'><a href='".e_SELF."?".$forum_id.".".$thread_id.".0."."track'>".LAN_391."</a></span>");
-}
-
-$MODERATORS = LAN_321.$forum_moderators;
-$THREADSTATUS = (!$thread_active ? LAN_66 : "");
-
-$replies = $sql -> db_Count("forum_t", "(*)", "WHERE thread_parent='".$thread_id."'");
-$pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
-$pages = ceil($replies/$pref['forum_postspage']);
-if($pages>1){
-	$currentpage = ($from/$pref['forum_postspage'])+1;
-	$prevpage = $from - $pref['forum_postspage'];
-	$nextpage = $from + $pref['forum_postspage'];
-	$GOTOPAGES = LAN_02." ".($currentpage > 1 ? " <a href='forum_viewtopic.php?".$forum_id.".".$thread_id.".".$prevpage."'>".LAN_04."</a> " : "");
-	for($a=0; $a<=($pages-1); $a++){
-		$GOTOPAGES .= (($a+1) == $currentpage ? "-".($a+1) : "-<a href='forum_viewtopic.php?".$forum_id.".".$thread_id.".".($a*$pref['forum_postspage'])."'>".($a+1)."</a>");
-	}
-	$GOTOPAGES .= ($nextpage < $replies ? " <a href='forum_viewtopic.php?".$forum_id.".".$thread_id.".".$nextpage."'>".LAN_05."</a> " : "");
-}
-
-if((ANON || USER) && ($forum_class != e_UC_READONLY || MODERATOR)){
-	if($thread_active){
-		$BUTTONS = "<a href='forum_post.php?rp.".e_QUERY."'>".IMAGE_reply."</a>";
-	}
-	$BUTTONS .= "<a href='forum_post.php?nt.".$forum_id."'>".IMAGE_newthread."</a>";
-}
-
-$post_author_id = substr($thread_user, 0, strpos($thread_user, "."));
-$post_author_name = substr($thread_user, (strpos($thread_user, ".")+1));
-if(strstr($post_author_name, chr(1))){
-	$tmp = explode(chr(1), $post_author_name);
-	$post_author_name = $tmp[0];
-	$ip = $tmp[1];
-	$host = gethostbyaddr($ip);
-	$iphost = "<div class='smalltext' style='text-align:right'>IP: <a href='".e_ADMIN."userinfo.php?$ip'>$ip ( $host )</a></div>";
-}
-
-if(!$post_author_id || !$sql -> db_Select("user", "*", "user_id='".$post_author_id."' ")){	// guest
-	$POSTER = "<b>".$post_author_name."</b>";
-	$AVATAR = "<br /><span class='smallblacktext'>".LAN_194."</span>";
-}else{	// regged member - get member info
-	unset($iphost);
-	$row = $sql -> db_Fetch(); extract($row);
-	$POSTER = "<a href='user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>";
-	if($user_image){
-		require_once(e_HANDLER."avatar_handler.php");
-		$AVATAR = "<div class='spacer'><img src='".avatar($user_image)."' alt='' /></div><br />";
-	}else{
-		unset($AVATAR);
-	}
-	
-	$JOINED = ($user_perms == "0" ? "" : LAN_06." ".$gen->convert_date($user_join, "forum")."<br />");
-	$LOCATION = ($user_location ? LAN_07.": ".$user_location."<br />" : "");
-	$CUSTOMTITLE = ($user_customtitle ? $aj -> tpa($user_customtitle)."<br />" : "");
-	$WEBSITE = ($user_homepage ? LAN_08.": ".$user_homepage."<br />" : "");
-	$POSTS = LAN_67." ".$user_forums."<br />";
-	$VISITS = LAN_09.": ".$user_visits;
-
-	$ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
-	$MEMBERID = $ldata[0];
-	$LEVEL = $ldata[1];
-
-	$SIGNATURE = ($user_signature ? "<br /><hr style='width:15%; text-align:left'><span class='smalltext'>".$aj -> tpa($user_signature) : "");
-	
-	$PROFILEIMG = (USER ? e107_parse("{CODE=CORE.profile.{$user_id}}","admin") : "");
-	$EMAILIMG = (!$user_hideemail ? e107_parse("{CODE=CORE.emailto.{$user_email}}","admin") : "");
-
-	$PRIVMESSAGE = e107_parse("{CODE=pm_menu.sendpm.{$post_author_id}}");
-
-	$WEBSITEIMG = ($user_homepage && $user_homepage != "http://" ? "<a href='$user_homepage'>".IMAGE_website."</a>" : "");
-	$RPG = rpg($user_join, $user_forums);
-	
-}
-
-$EDITIMG = ($post_author_id != "0" && $post_author_name == USERNAME && $thread_active ? "<a href='forum_post.php?edit.".$forum_id.".".$thread_id."'>".IMAGE_edit."</a> " : "");
-if($thread_active){
-	$QUOTEIMG = "<a href='forum_post.php?quote.".$forum_id.".".$thread_id."'>".IMAGE_quote."</a>";
-}else{
-	$T_ACTIVE = TRUE;
-}
-$REPORTIMG = (USER ? "<a href='forum_viewtopic.php?".$forum_id.".".$thread_id.".".$from.".report'>".IMAGE_report."</a> " : "");
-if(MODERATOR){
-	$MODOPTIONS = "
-		<form method='post' action='".e_HTTP."forum_viewforum.php?{$forum_id}' id='frmMod_{$forum_id}_{$thread_id}'>
-		<div>
-		<a href='forum_post.php?edit.".$forum_id.".".$thread_id."'>".IMAGE_admin_edit."</a>
-		<input type='image' ".IMAGE_admin_delete." name='delete_{$thread_id}' value='thread_action' onclick=\"return confirm_('thread', $forum_id, $thread_id, '')\" />
-		<a href='".e_ADMIN."forum_conf.php?move.".$forum_id.".".$thread_id."'>".IMAGE_admin_move."</a>
-		</div>
-		</form>";
-}
-//	$MODOPTIONS .= "<a style='cursor:pointer; cursor:hand' onclick=\"confirm_('thread', $forum_id, $thread_id, '')\"'>".IMAGE_admin_delete."</a>\n";
-
-unset($newflag);
-if(USER){
-	if($thread_datestamp > USERLV && (!ereg("\.".$thread_id."\.", USERVIEWED))){
-		$NEWFLAG = IMAGE_new." ";
-		$u_new = ".".$thread_id.".";
-	}
-}
-
-$THREADDATESTAMP = "<a id='$thread_id'>".IMAGE_post."</a> ".$gen->convert_date($thread_datestamp, "forum");
-$POST = $aj -> tpa($thread_thread, "forum", "off", $highlight_search,$post_author_id);
-if(ADMIN && $iphost){ $POST .= "<br />".$iphost; }
-$TOP = "<a href='".e_SELF."?".e_QUERY."#top'>".LAN_10."</a>";
-$FORUMJUMP = forumjump();
-
-$forstr = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMSTART);
-$forthr = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMTHREADSTYLE);
-
-// end thread parse -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-// begine reply parse -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-unset($forrep);
-if(!$FORUMREPLYSTYLE) $FORUMREPLYSTYLE = $FORUMTHREADSTYLE;
-
-if($sql -> db_Select("forum_t", "*", "thread_parent='".$thread_id."' ORDER BY thread_datestamp ASC LIMIT ".$from.", ".$pref['forum_postspage'])){
-	$sql2 = new db;
-	while($row = $sql-> db_Fetch()){
-		extract($row);
-		$post_author_id = substr($thread_user, 0, strpos($thread_user, "."));
-		$post_author_name = substr($thread_user, (strpos($thread_user, ".")+1));
-		if(strstr($post_author_name, chr(1))){
-			$tmp = explode(chr(1), $post_author_name);
-			$post_author_name = $tmp[0];
-			$ip = $tmp[1];
-			$host = gethostbyaddr($ip);
-			$iphost = "<div class='smalltext' style='text-align:right'>IP: <a href='".e_ADMIN."userinfo.php?$ip'>$ip ( $host )</a></div>";
-		}
-		//$post_author_count = $sql -> db_Count("forum_t", "(*)", " WHERE thread_user='$thread_user' OR thread_user='$post_author_name' ");
-
-		if(!$post_author_id || !$sql2 -> db_Select("user", "*", "user_id='".$post_author_id."' ")){	// guest
-			$POSTER = "<b>".$post_author_name."</b>";
-			$AVATAR = "<br /><span class='smallblacktext'>".LAN_194."</span>";
-			unset($JOINED, $LOCATION, $CUSTOMTITLE, $WEBSITE, $POSTS, $VISITS, $MEMBERID, $SIGNATURE, $RPG, $LEVEL, $PRIVMESSAGE, $PROFILEIMG, $EMAILIMG, $WEBSITEIMG);
-		}else{	// regged member - get member info
-			unset($iphost);
-			
-			$row = $sql2 -> db_Fetch(); extract($row);
-			$POSTER =  "<a href='user.php?id.".$post_author_id."'><b>".$post_author_name."</b></a>";
-			if($user_image){
-				require_once(e_HANDLER."avatar_handler.php");
-				$AVATAR = "<div class='spacer'><img src='".avatar($user_image)."' alt='' /></div><br />";
-			}else{
-				unset($AVATAR);
-			}
-			
-			$JOINED = ($user_perms == "0" ? "" : LAN_06.": ".$gen->convert_date($user_join, "forum")."<br />");
-			$LOCATION = ($user_location ? LAN_07.": ".$user_location."<br />" : "");
-			$CUSTOMTITLE = ($user_customtitle ? $aj -> tpa($user_customtitle)."<br />" : "");
-			$WEBSITE = ($user_homepage ? LAN_08.": ".$user_homepage."<br />" : "");
-			$POSTS = LAN_67." ".$user_forums."<br />";
-			$VISITS = LAN_09.": ".$user_visits;
-			
-			$ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
-			$MEMBERID = $ldata[0];
-			$LEVEL = $ldata[1];
-
-			$SIGNATURE = ($user_signature ? "<br /><hr style='width:15%; text-align:left'><span class='smalltext'>".$aj -> tpa($user_signature) : "");
-			$PROFILEIMG = (USER ? e107_parse("{CODE=CORE.profile.{$user_id}}","admin") : "");
-			$EMAILIMG = (!$user_hideemail ? e107_parse("{CODE=CORE.emailto.{$user_email}}","admin") : "");
-
-			$PRIVMESSAGE = e107_parse("{CODE=pm_menu.sendpm.{$post_author_id}}");
-
-			$WEBSITEIMG = ($user_homepage && $user_homepage != "http://" ? "<a href='$user_homepage'>".IMAGE_website."</a>" : "");
-			$RPG = rpg($user_join, $user_forums);
-			
-		}
-		$EDITIMG = ($post_author_id != "0" && $post_author_name == USERNAME && $thread_active ? "<a href='forum_post.php?edit.".$forum_id.".".$thread_id."'>".IMAGE_edit."</a> " : "");
-		if(!$T_ACTIVE){
-			$QUOTEIMG = "<a href='forum_post.php?quote.".$forum_id.".".$thread_id."'>".IMAGE_quote."</a>";
-		}
-		$REPORTIMG = (USER ? "<a href='forum_viewtopic.php?".$forum_id.".".$thread_id.".".$from.".report'>".IMAGE_report."</a> " : "");
-		if(MODERATOR){
-
-	$MODOPTIONS = "
-		<form method='post' action='".e_HTTP."forum_viewtopic.php?{$forum_id}.{$thread_parent}' id='frmMod_{$forum_id}_{$thread_id}'>
-		<div>
-		<a href='forum_post.php?edit.".$forum_id.".".$thread_id."'>".IMAGE_admin_edit."</a>
-		<input type='image' ".IMAGE_admin_delete." name='delete_{$thread_id}' value='thread_action' onclick=\"return confirm_('reply', $forum_id, $thread_id, '{$post_author_name}')\" />
-		<a href='".e_ADMIN."forum_conf.php?move.".$forum_id.".".$thread_id."'>".IMAGE_admin_move."</a>
-		</div>
-		</form>";
-}
-
-		unset($newflag);
-		if(USER){
-			if($thread_datestamp > USERLV && (!ereg("\.".$thread_id."\.", USERVIEWED))){
-				$NEWFLAG = IMAGE_new." ";
-				$u_new .= ".".$thread_id.".";
-			}
-		}
-
-		$THREADDATESTAMP = "<a id='$thread_id'>".IMAGE_post."</a> ".$gen->convert_date($thread_datestamp, "forum");
-		$POST = $aj -> tpa($thread_thread, "forum", "off", $highlight_search,$post_author_id);
-		if(ADMIN && $iphost){ $POST .= "<br />".$iphost; }
-
-		$forrep .= preg_replace("/\{(.*?)\}/e", '$\1', $FORUMREPLYSTYLE);
-	}
-}
-
-if((ANON || USER) && ($forum_class != e_UC_READONLY || MODERATOR) && !$T_ACTIVE ){
-	$QUICKREPLY = "<form action='".e_BASE."forum_post.php?rp.".e_QUERY."' method='post'>\n<p>\n".LAN_393.":<br /><textarea cols='60' rows='4' class='tbox' name='post'></textarea><br /><input type='submit' name='fpreview' value='".LAN_394."' class='button' /> &nbsp;\n<input type='submit' name='reply' value='".LAN_395."' class='button' />\n<input type='hidden' name='thread_id' value='$thread_parent' />\n</p>\n</form>";
-}
-
-$forend = preg_replace("/\{(.*?)\}/e", '$\1', $FORUMEND);
-$forumstring = (!$from ? $pollstr.$forstr.$forthr.$forrep.$forend : $pollstr.$forstr.$forrep.$forend);
-if($pref['forum_enclose']){ $ns -> tablerender(LAN_01, $forumstring); }else{ echo $forumstring; }
-
-$u_new = USERVIEWED . $u_new;
-if($u_new != ""){ $sql -> db_Update("user", "user_viewed='$u_new' WHERE user_id='".USERID."' "); }
-
-// end -------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-function forumjump(){
-	global $sql;
-	$sql -> db_Select("forum", "*", "forum_parent !=0 AND forum_class!='255' ");
-	$text .= "<form method='post' action='".e_SELF."'><p>".LAN_65.": <select name='forumjump' class='tbox'>";
-	while($row = $sql -> db_Fetch()){
-		extract($row);
-		if(($forum_class && check_class($forum_class)) || ($forum_class == 254 && USER) || !$forum_class){
-			$text .= "\n<option value='".$forum_id."'>".$forum_name."</option>";
-		}
-	}
-	$text .= "</select> <input class='button' type='submit' name='fjsubmit' value='".LAN_03."' />&nbsp;&nbsp;&nbsp;&nbsp;<a href='".e_SELF."?".$_SERVER['QUERY_STRING']."#top'>".LAN_10."</a></p></form>";
-	return $text;
-}
-
-function rpg($user_join, $user_forums){
-	// rpg mod by Ikari ( kilokan1@yahoo.it | http://artemanga.altervista.org )
-
-	$lvl_post_mp_cost = 2.5;
-	$lvl_mp_regen_per_day = 4;
-	$lvl_avg_ppd = 5;
-	$lvl_bonus_redux = 5;
-	$lvl_user_days = max(1, round( ( time() - $user_join ) / 86400 ));
-	$lvl_ppd = $user_forums / $lvl_user_days;
-	if($user_forums < 1){
-		$lvl_level = 0;
-	}else{
-		$lvl_level = floor( pow( log10( $user_forums ), 3 ) ) + 1;
-	}
-	if($lvl_level < 1){
-		$lvl_hp = "0 / 0";
-		$lvl_hp_percent = 0;
-	}else{
-		$lvl_max_hp = floor( (pow( $lvl_level, (1/4) ) ) * (pow( 10, pow( $lvl_level+2, (1/3) ) ) ) / (1.5) );
-					
-		if($lvl_ppd >= $lvl_avg_ppd){
-			$lvl_hp_percent = floor( (.5 + (($lvl_ppd - $lvl_avg_ppd) / ($lvl_bonus_redux * 2)) ) * 100);
-		}else{
-			$lvl_hp_percent = floor( $lvl_ppd / ($lvl_avg_ppd / 50) );
-		}
-		if($lvl_hp_percent > 100){
-			$lvl_max_hp += floor( ($lvl_hp_percent - 100) * pi() );
-			$lvl_hp_percent = 100;
-		}else{
-			$lvl_hp_percent = max(0, $lvl_hp_percent);
-		}
-		$lvl_cur_hp = floor($lvl_max_hp * ($lvl_hp_percent / 100) );
-		$lvl_cur_hp = max(0, $lvl_cur_hp);
-		$lvl_cur_hp = min($lvl_max_hp, $lvl_cur_hp);
-		$lvl_hp = $lvl_cur_hp . '/' . $lvl_max_hp;
-	}
-	if($lvl_level < 1){
-		$lvl_mp = '0 / 0';
-		$lvl_mp_percent = 0;
-	}else{
-		$lvl_max_mp = floor( (pow( $lvl_level, (1/4) ) ) * (pow( 10, pow( $lvl_level+2, (1/3) ) ) ) / (pi()) );
-		$lvl_mp_cost = $user_forums * $lvl_post_mp_cost;
-		$lvl_mp_regen = max(1, $lvl_user_days * $lvl_mp_regen_per_day);
-		$lvl_cur_mp = floor($lvl_max_mp - $lvl_mp_cost + $lvl_mp_regen);
-		$lvl_cur_mp = max(0, $lvl_cur_mp);
-		$lvl_cur_mp = min($lvl_max_mp, $lvl_cur_mp);
-		$lvl_mp = $lvl_cur_mp . '/' . $lvl_max_mp;
-		$lvl_mp_percent = floor($lvl_cur_mp / $lvl_max_mp * 100 );
-	}
-	if($lvl_level < 1){
-		$lvl_exp = "0 / 0";
-		$lvl_exp_percent = 100;
-	}else{
-		$lvl_posts_for_next = floor( pow( 10, pow( $lvl_level, (1/3) ) ) );
-		if ($lvl_level == 1){ 
-			$lvl_posts_for_this = max(1, floor(pow (10, ( ($lvl_level - 1) ) ) ) ); 
-		}else{ 
-			$lvl_posts_for_this = max(1, floor(pow (10, pow( ($lvl_level - 1), (1/3) ) ) ) ); 
-		}
-		$lvl_exp = ($user_forums - $lvl_posts_for_this) . "/" . ($lvl_posts_for_next - $lvl_posts_for_this);
-		$lvl_exp_percent = floor( ( ($user_forums - $lvl_posts_for_this) / max( 1, ($lvl_posts_for_next - $lvl_posts_for_this ) ) ) * 100);
-	}
-	$rpg_info .= "<div style='padding:2px;'>";
-	$rpg_info .= "<b>Level = ".$lvl_level."</b><br />";
-	$rpg_info .= "HP = ".$lvl_hp."<br /><img src='".THEME."images/bar.jpg' height='10' alt='' style='border:#345487 1px solid; width:".$lvl_hp_percent."'><br />";
-	$rpg_info .= "EXP = ".$lvl_exp."<br /><img src='".THEME."images/bar.jpg' height='10' alt='' style='border:#345487 1px solid; width:".$lvl_exp_percent."'><br />";
-	$rpg_info .= "MP = ".$lvl_mp."<br /><img src='".THEME."images/bar.jpg' height='10' alt='' style='border:#345487 1px solid; width:".$lvl_mp_percent."'><br />";
-	$rpg_info .= "</div>";
-	return $rpg_info;
-}
-
-echo "<script type=\"text/javascript\">
-function confirm_(mode, forum_id, thread_id, thread){
-	if(mode == 'thread'){
-		return confirm(\"".$etp->unentity(LAN_409)."\");
-	}else{
-		return confirm(\"".$etp->unentity(LAN_410)." [ ".$etp->unentity(LAN_411)."\" + thread + \" ]\");
-	}
-}
-</script>";
-
-require_once(FOOTERF);
-
-?>
\ No newline at end of file
+<?php
+require_once("class2.php");
+$tmp = explode(".", e_QUERY);
+$thread_id = intval($tmp[1]);
+if($thread_id)
+{
+	header("Location:".SITEURL.$PLUGINS_DIRECTORY."forum/forum_viewtopic.php?{$thread_id}");
+	exit;
+}
+header("Location:".SITEURL."index.php");
+exit;
+?>
diff -ruN 6171/fpw.php 75/fpw.php
--- 6171/fpw.php	2004-09-09 04:31:42.000000000 -0500
+++ 75/fpw.php	2006-03-13 15:53:47.000000000 -0600
@@ -1,165 +1,164 @@
-<?php
-
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /fpw.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-$use_imagecode = ($pref['logcode'] && extension_loaded("gd"));
-if($use_imagecode){
-        require_once(e_HANDLER."secure_img_handler.php");
-        $sec_img = new secure_image;
-}
-if($pref['membersonly_enabled']){
-        $HEADER = "<div style='width:100%;text-align:center;margin-left:auto;margin-right:auto'><div style='width:70%;margin-left:auto;margin-right:auto;text-align:center;'><br />";
-        if(file_exists(THEME."images/login_logo.png")){
-        $HEADER .= "<img src='".THEME."images/login_logo.png' alt='' />\n";
-        } else{
-        $HEADER .= "<img src='".e_IMAGE."logo.png' alt='' />\n";
-        }
-        $HEADER .= "<br />";
-        $FOOTER = "</div></div>";
-}
-
-require_once(HEADERF);
-
-function fpw_error($txt){
-        global $ns;
-        $ns -> tablerender(LAN_03,"<div class='forumheader3' style='text-align:center'>".$txt."</div>");
-        require_once(FOOTERF);
-        exit;
-}
-
-if(e_QUERY){
-        $tmp=explode(".",e_QUERY);
-        $tmpinfo=preg_replace("#[\W_]#","",$tmp[0]);
-        if($sql -> db_Select("tmp","*","tmp_info LIKE '%.{$tmpinfo}' ")){
-                $row = $sql -> db_Fetch();
-                extract($row);
-                $sql -> db_Delete("tmp","tmp_info LIKE '%.{$tmpinfo}' ");
-                $newpw="";
-                $pwlen = rand(8, 12);
-                for($a=0; $a<=$pwlen;$a++){
-                        $newpw .= chr(rand(97, 122));
-                }
-                $mdnewpw = md5($newpw);
-
-                list($username,$md5) = explode(".",$tmp_info);
-                $sql -> db_Update("user", "user_password='$mdnewpw', user_viewed='' WHERE user_name='$username' ");
-                cookie($pref['cookie_name'], "", (time()-2592000));
-                $_SESSION[$pref['cookie_name']] = "";
-
-                $txt = LAN_FPW8." {$username} ".LAN_FPW9." {$newpw}<br /><br />".LAN_FPW10." <a href='".e_BASE."index.php'>".LAN_FPW11."</a> ".LAN_FPW12;
-                fpw_error($txt);
-
-        } else {
-                fpw_error(LAN_FPW7);
-        }
-}
-
-if(IsSet($_POST['pwsubmit'])){
-        require_once(e_HANDLER."mail.php");
-        $email = $_POST['email'];
-
-        if($pref['logcode'] && extension_loaded("gd")){
-                if(!$sec_img -> verify_code($_POST['rand_num'],$_POST['code_verify'])){
-                        fpw_error(LAN_FPW3);
-                }
-        }
-
-        if($sql -> db_Select("user", "*", "user_email='{$_POST['email']}' AND user_name='{$_POST['username']}' ")){
-                $row = $sql -> db_Fetch(); extract($row);
-
-                if($user_admin == 1 && $user_perms == "0"){
-                        sendemail($pref['siteadminemail'], LAN_06, LAN_07."".getip()." ".LAN_08);
-                        echo "<script type='text/javascript'>document.location.href='index.php'</script>\n";
-                        die();
-                }
-
-                if($sql -> db_Select("tmp","*","tmp_ip = 'pwreset' AND tmp_info LIKE '{$user_name}.%'")){
-                        fpw_error(LAN_FPW4);
-                        exit;
-                }
-
-                mt_srand ((double)microtime()*1000000);
-                $maxran = 1000000;
-                $rand_num = mt_rand(0, $maxran);
-                $datekey = date("r");
-                $rcode = md5($_SERVER[HTTP_USER_AGENT] . serialize($pref). $rand_num . $datekey);
-
-                $link = SITEURL."fpw.php?{$rcode}";
-                $message = LAN_FPW5." ".SITENAME." ".LAN_FPW14." : ".getip().".\n\n".LAN_FPW15."\n\n".LAN_FPW16."\n\n".LAN_FPW17."\n\n{$link}";
-              //  $message = LAN_FPW5."\n\n{$link}";
-
-                $deltime = time()+86400*2;  //Set timestamp two days ahead so it doesn't get auto-deleted
-                $sql -> db_Insert("tmp","'pwreset',{$deltime},'{$user_name}.{$rcode}'");
-
-                if(sendemail($_POST['email'], "".LAN_09."".SITENAME, $message)){
-                        $text = "<div style='text-align:center'>".LAN_FPW6."</div>";
-                }else{
-                        $text = "<div style='text-align:center'>".LAN_02."</div>";
-                }
-
-                $ns -> tablerender(LAN_03, $text);
-                require_once(FOOTERF);
-                exit;
-        }else{
-                $text = LAN_213;
-                $ns -> tablerender(LAN_214, "<div style='text-align:center'>".$text."</div>");
-        }
-}
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."'>\n
-<table style='width:85%' class='fborder'>
-
-<tr>
-<td class='forumheader3' colspan='2' style='text-align:center'>".LAN_05."</td>
-</tr>
-
-<tr>
-<td class='forumheader3' style='width:25%'>".LAN_FPW1."</td>
-<td class='forumheader3' style='width:75%;text-align:center'>
-<input class='tbox' type='text' name='username' size='60' value='' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td class='forumheader3' style='width:25%'>".LAN_112."</td>
-<td class='forumheader3' style='width:75%; text-align:center'>
-<input class='tbox' type='text' name='email' size='60' value='' maxlength='100' />
-</td>
-</tr>";
-
-if($use_imagecode){
-        $text .= "
-        <tr>
-        <td class='forumheader3' style='width:25%'>".LAN_FPW2."</td>
-        <td class='forumheader3' style='width:75%;text-align:left'>
-        <input type='hidden' name='rand_num' value='".$sec_img -> random_number."'>";
-        $text .= $sec_img -> r_image();
-        $text .= "<br /><input class='tbox' type='text' name='code_verify' size='15' maxlength='20'><br />";
-        $text .= "</td></tr>";
-}
-
-$text .="
-<tr style='vertical-align:top'>
-<td class='forumheader' colspan='2'  style='text-align:center'>
-<input class='button' type='submit' name='pwsubmit' value='".LAN_156."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender(LAN_03, $text);
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/fpw.php,v $
+|     $Revision: 1.17 $
+|     $Date: 2006/03/13 21:53:47 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+
+if(USER){
+	header("location:".e_BASE."index.php");
+	exit;
+}
+
+
+$use_imagecode = ($pref['fpwcode'] && extension_loaded("gd"));
+if ($use_imagecode) {
+	require_once(e_HANDLER."secure_img_handler.php");
+	$sec_img = new secure_image;
+}
+
+
+
+if ($pref['membersonly_enabled']) {
+	if (!$FPW_TABLE_HEADER) {
+		if (file_exists(THEME."fpw_template.php")) {
+			require_once(THEME."fpw_template.php");
+		} else {
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/fpw_template.php");
+		}
+	}
+	$HEADER = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE_HEADER);
+	$FOOTER = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE_FOOTER);
+}
+
+require_once(HEADERF);
+
+function fpw_error($txt) {
+	global $ns;
+	$ns->tablerender(LAN_03, "<div style='text-align:center'>".$txt."</div>");
+	require_once(FOOTERF);
+	exit;
+}
+
+if (e_QUERY) {
+	define("FPW_ACTIVE","TRUE");    
+	$tmp = explode(".", e_QUERY);
+	$tmpinfo = preg_replace("#[\W_]#", "", $tp -> toDB($tmp[0], true));
+	if ($sql->db_Select("tmp", "*", "tmp_info LIKE '%.{$tmpinfo}' ")) {
+		$row = $sql->db_Fetch();
+		extract($row);
+		$sql->db_Delete("tmp", "tmp_info LIKE '%.{$tmpinfo}' ");
+		$newpw = "";
+		$pwlen = rand(8, 12);
+		for($a = 0; $a <= $pwlen; $a++) {
+			$newpw .= chr(rand(97, 122));
+		}
+		$mdnewpw = md5($newpw);
+
+		list($username, $md5) = explode(".", $tmp_info);
+		$sql->db_Update("user", "user_password='$mdnewpw', user_viewed='' WHERE user_name='".$tp -> toDB($username, true)."' ");
+		cookie($pref['cookie_name'], "", (time()-2592000));
+		$_SESSION[$pref['cookie_name']] = "";
+
+		$txt = LAN_FPW8." {$username} ".LAN_FPW9." {$newpw}<br /><br />".LAN_FPW10." <a href='".e_BASE."index.php'>".LAN_FPW11."</a> ".LAN_FPW12;
+		fpw_error($txt);
+
+	} else {
+		fpw_error(LAN_FPW7);
+	}
+}
+
+if (isset($_POST['pwsubmit'])) {
+	require_once(e_HANDLER."mail.php");
+	$email = $_POST['email'];
+
+	if ($pref['fpwcode'] && extension_loaded("gd")) {
+		if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify'])) {
+			fpw_error(LAN_FPW3);
+		}
+	}
+
+	$clean_email = check_email($tp -> toDB($_POST['email']));
+	$clean_username = $tp -> toDB($_POST['username']);
+	$query = "user_email='{$clean_email}' ";
+	// Allow admins to remove 'username' from fpw_template.php if they wish.
+	$query .= (isset($_POST['username'])) ? " AND user_loginname='{$clean_username}'" : "";
+
+	if ($sql->db_Select("user", "*", $query)) {
+		$row = $sql->db_Fetch();
+		 extract($row);
+
+		if ($user_admin == 1 && $user_perms == "0") {
+			sendemail($pref['siteadminemail'], LAN_06, LAN_07."".$e107->getip()." ".LAN_08);
+			echo "<script type='text/javascript'>document.location.href='index.php'</script>\n";
+			die();
+		}
+
+		if ($sql->db_Select("tmp", "*", "tmp_ip = 'pwreset' AND tmp_info LIKE '{$user_name}.%'")) {
+			fpw_error(LAN_FPW4);
+			exit;
+		}
+
+		mt_srand ((double)microtime() * 1000000);
+		$maxran = 1000000;
+		$rand_num = mt_rand(0, $maxran);
+		$datekey = date("r");
+		$rcode = md5($_SERVER['HTTP_USER_AGENT'] . serialize($pref). $rand_num . $datekey);
+
+		$link = SITEURL."fpw.php?{$rcode}";
+		$message = LAN_FPW5." ".SITENAME." ".LAN_FPW14." : ".$e107->getip().".\n\n".LAN_FPW15."\n\n".LAN_FPW16."\n\n".LAN_FPW17."\n\n{$link}";
+		//  $message = LAN_FPW5."\n\n{$link}";
+
+		$deltime = time()+86400 * 2;
+		//Set timestamp two days ahead so it doesn't get auto-deleted
+		$sql->db_Insert("tmp", "'pwreset',{$deltime},'{$user_name}.{$rcode}'");
+
+		if (sendemail($_POST['email'], "".LAN_09."".SITENAME, $message)) {
+			$text = "<div style='text-align:center'>".LAN_FPW6."</div>";
+		} else {
+			$text = "<div style='text-align:center'>".LAN_02."</div>";
+		}
+
+		$ns->tablerender(LAN_03, $text);
+		require_once(FOOTERF);
+		exit;
+	} else {
+		$text = LAN_213;
+		$ns->tablerender(LAN_214, "<div style='text-align:center'>".$text."</div>");
+	}
+}
+
+
+if ($use_imagecode) {
+	$FPW_TABLE_SECIMG_LAN = LAN_FPW2;
+	$FPW_TABLE_SECIMG_HIDDEN = "<input type='hidden' name='rand_num' value='".$sec_img->random_number."'>";
+	$FPW_TABLE_SECIMG_SECIMG = $sec_img->r_image();
+	$FPW_TABLE_SECIMG_TEXTBOC = "<input class='tbox' type='text' name='code_verify' size='15' maxlength='20'>";
+}
+
+if (!$FPW_TABLE) {
+	if (file_exists(THEME."fpw_template.php")) {
+		require_once(THEME."fpw_template.php");
+	} else {
+		require_once(e_BASE.$THEMES_DIRECTORY."templates/fpw_template.php");
+	}
+}
+$text = preg_replace("/\{(.*?)\}/e", '$\1', $FPW_TABLE);
+
+$ns->tablerender(LAN_03, $text);
+require_once(FOOTERF);
+
 ?>
\ No newline at end of file
diff -ruN 6171/gsitemap.php 75/gsitemap.php
--- 6171/gsitemap.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/gsitemap.php	2006-04-15 12:44:17.000000000 -0500
@@ -0,0 +1,86 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/gsitemap.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2006/04/15 17:44:17 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+
+if (file_exists(e_PLUGIN."gsitemap/languages/gsitemap_".e_LANGUAGE.".php"))
+{
+	include_once(e_PLUGIN."gsitemap/languages/gsitemap_".e_LANGUAGE.".php");
+}
+else
+{
+	include_once(e_PLUGIN."gsitemap/languages/gsitemap_English.php");
+}
+
+
+if(e_QUERY == "show")
+{
+	require_once(HEADERF);
+
+	$sql -> db_Select("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ");
+	$nfArray = $sql -> db_getList();
+	$text = "<ul>";
+
+	foreach($nfArray as $nfa)
+	{
+		$text .= "<li>".$tp->toHTML($nfa['gsitemap_cat'],"","defs").": <a href='".$nfa['gsitemap_url']."'>".$tp->toHTML($nfa['gsitemap_name'],"","defs")."</a><br />\n";
+	}
+	$text .= "</ul>";
+
+	$ns -> tablerender(SITENAME." : ".GSLAN_Name."", $text);
+
+	require_once(FOOTERF);
+	exit;
+}
+
+
+$xml = "<?xml version='1.0' encoding='UTF-8'?>
+<urlset xmlns='http://www.google.com/schemas/sitemap/0.84'
+xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'	xsi:schemaLocation='http://www.google.com/schemas/sitemap/0.84
+http://www.google.com/schemas/sitemap/0.84/sitemap.xsd'>";
+
+$sql -> db_Select("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ");
+$smArray = $sql -> db_getList();
+foreach($smArray as $sm)
+{
+	$xml .= "
+	<url>
+		<loc>".$tp->toRSS($sm['gsitemap_url'],TRUE)."</loc>
+		<lastmod>".get_iso_8601_date($sm['gsitemap_lastmod'])."</lastmod>
+    		<changefreq>".$sm['gsitemap_freq']."</changefreq>
+    		<priority>".$sm['gsitemap_priority']."</priority>
+	</url>";
+}
+
+$xml .= "
+</urlset>";
+
+echo $xml;
+
+/* ungu at terong dot com */
+function get_iso_8601_date($int_date)
+{
+   $date_mod = date('Y-m-d\TH:i:s', $int_date);
+   $pre_timezone = date('O', $int_date);
+   $time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2);
+   $date_mod .= $time_zone;
+   return $date_mod;
+}
+
+
+?>
\ No newline at end of file
diff -ruN 6171/index.php 75/index.php
--- 6171/index.php	2004-08-13 20:48:48.000000000 -0500
+++ 75/index.php	2006-04-22 14:30:47.000000000 -0500
@@ -1,39 +1,94 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/index.php,v $
-|     $Revision: 1.5 $
-|     $Date: 2004/08/14 01:48:48 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-
-require_once("class2.php");
-if($pref['membersonly_enabled'] && !USER){
-   header("location: ".e_BASE.e_LOGIN);
-        exit;
-}
-
-if(!$pref['frontpage'] || $pref['frontpage_type'] == "splash"){
-        header("location: ".e_BASE."news.php");
-        exit;
-}else if(is_numeric($pref['frontpage'])){
-        header("location: ".e_BASE."content.php?article.".$pref['frontpage'].".255");
-        exit;
-}else if(eregi("http", $pref['frontpage'])){
-        header("location: ".e_BASE.$pref['frontpage']);
-        exit;
-}else{
-        header("location: ".e_BASE.$pref['frontpage'].".php");
-        exit;
-}
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/index.php,v $
+|     $Revision: 1.21 $
+|     $Date: 2006/04/22 19:30:47 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+require_once('class2.php');
+
+if (file_exists('index_include.php')) {
+	include('index_include.php');
+}
+
+if (!is_array($pref['frontpage']) && $pref['frontpage'] != 'Array') {
+	if (!$pref['frontpage'] || $pref['frontpage'] == 'Array.php') {
+		$up_pref = 'news.php';
+	} else if ($pref['frontpage'] == 'links') {
+		$up_pref = $PLUGINS_DIRECTORY.'links_page/links.php';
+	} else if ($pref['frontpage'] == 'forum') {
+		$up_pref = $PLUGINS_DIRECTORY.'forum/forum.php';
+	} else if (is_numeric($pref['frontpage'])) {
+		$up_pref = $PLUGINS_DIRECTORY.'content/content.php?content.'.$pref['frontpage'];
+	} else if (substr($pref['frontpage'], -1) != '/' && strpos($pref['frontpage'], '.') === FALSE) {
+		$up_pref = $pref['frontpage'].'.php';
+	} else {
+		$up_pref = $pref['frontpage'];
+	}
+	unset($pref['frontpage']);
+	$pref['frontpage']['all'] = $up_pref;
+	save_prefs();
+}
+
+$query = (e_QUERY && e_QUERY != '' ? '?'.e_QUERY : '');
+
+if ($pref['membersonly_enabled'] && !USER) {
+	header('location: '.e_LOGIN);
+	exit;
+} else if (isset($pref['frontpage']['all']) && $pref['frontpage']['all']) {
+	$location = ((strpos($pref['frontpage']['all'], 'http') === FALSE) ? e_BASE : '').$pref['frontpage']['all'].$query;
+} else if (ADMIN) {
+	$location =  ((strpos($pref['frontpage']['254'], 'http') === FALSE) ? e_BASE : '').$pref['frontpage']['254'].$query;
+} else if (USER) {
+	require_once(e_HANDLER.'userclass_class.php');
+	$class_list = get_userclass_list();
+	foreach ($class_list as $fp_class) {
+		$inclass = false;
+		if (!$inclass && check_class($fp_class['userclass_id'])) {
+			$location = ((strpos($pref['frontpage'][$fp_class['userclass_id']], 'http') === FALSE) ? e_BASE : '').$pref['frontpage'][$fp_class['userclass_id']].$query;
+			$inclass = true;
+		}
+	}
+	$location = $location ? $location : ((strpos($pref['frontpage']['253'], 'http') === FALSE) ? e_BASE : '').$pref['frontpage']['253'].$query;
+} else {
+	$location = ((strpos($pref['frontpage']['252'], 'http') === FALSE) ? e_BASE : '').$pref['frontpage']['252'].$query;
+}
+
+// handle redirect and include front page methods
+if(isset($pref['frontpage_method']) && $pref['frontpage_method'] == "include") {
+	if($location == "news.php") {
+		require_once("news.php");
+	} elseif ($location == PLUGINS_DIRECTORY."forum/forum.php") {
+		require_once($PLUGINS_DIRECTORY."forum/forum.php");
+	} elseif (preg_match('/^page\.php\?([0-9]*)$/', $location)) {
+		$e_QUERY = preg_match('/^page\.php\?([0-9]*)$/', $location);
+		require_once("page.php");
+	} else {
+		header("Location: {$location}");
+		exit();
+	}
+} else {
+	if($location == "index.php"){
+    	require_once(HEADERF);
+		require_once(FOOTERF);
+	}else{
+		header("Location: {$location}");
+	}
+
+	exit();
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/links.php 75/links.php
--- 6171/links.php	2004-08-31 07:29:02.000000000 -0500
+++ 75/links.php	2005-06-04 20:19:34.000000000 -0500
@@ -1,244 +1,5 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /links.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-require_once(HEADERF);
-
-if(IsSet($_POST['add_link']) && check_class($pref['link_submit_class'])){
-        if($_POST['link_name'] && $_POST['link_url'] && $_POST['link_description']){
-                $link_name = $aj -> formtpa($_POST['link_name'], "public");
-                $link_url = $aj -> formtpa($_POST['link_url'], "public");
-                $link_description = $aj -> formtpa($_POST['link_description'], "public");
-                $link_button = $aj -> formtpa($_POST['link_button'], "public");
-                $username = (defined('USERNAME')) ? USERNAME : LAN_LINKS_3;
-                $submitted_link = $_POST['cat_name']."^".$link_name."^".$link_url."^".$link_description."^".$link_button."^".$username;
-                $sql -> db_Insert("tmp", "'submitted_link', '".time()."', '$submitted_link' ");
-                $ns -> tablerender(LAN_99, "<div style='text-align:center'>".LAN_100."</div>");
-        }else{
-                message_handler("ALERT", 5);
-        }
-}
-
-if(e_QUERY == "submit" && check_class($pref['link_submit_class'])){
-
-        if(!$LINK_SUBMIT_TABLE){
-            if(file_exists(THEME."links_template.php")){
-              require_once(THEME."links_template.php");
-            }
-          	else{
-              require_once(e_BASE.$THEMES_DIRECTORY."templates/links_template.php");
-            }
-        }
-
-        $link_submit_table_string .= parse_link_submit_table();
-
-        $link_submit_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $LINK_SUBMIT_TABLE_START);
-        $link_submit_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $LINK_SUBMIT_TABLE_END);
-        $text .= $link_submit_table_start.$link_submit_table_string.$link_submit_table_end;
-
-        $ns -> tablerender(LAN_92, $text);
-        require_once(FOOTERF);
-        exit;
-}
-
-
-if(e_QUERY == "" && $pref['linkpage_categories'] == 1){
-
-        if(!$LINK_MAIN_TABLE){
-           if(file_exists(THEME."links_template.php")){
-              require_once(THEME."links_template.php");
-            }
-          	else{
-              require_once(e_BASE.$THEMES_DIRECTORY."templates/links_template.php");
-            }
-        }
-
-        $caption = LAN_61;
-        $sql = new db; $sql2 = new db;
-        $category_total = $sql -> db_Select("link_category", "*", "link_category_id != '1' ");
-        $total_links = $sql2 -> db_Count("links", "(*)", "WHERE link_category!=1");
-
-        while($row = $sql-> db_Fetch()){
-        extract($row);
-
-                $link_main_table_string .= parse_link_main_table($row);
-
-        }
-        $link_main_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $LINK_MAIN_TABLE_START);
-
-        $LINK_MAIN_TOTAL = LAN_102." ".($total_links == 1 ? LAN_103 : LAN_104)." ".$total_links." ".($total_links == 1 ? LAN_65 : LAN_66)." ".LAN_105." ".$category_total." ".($category_total == 1 ? LAN_63 : LAN_62);
-        $LINK_MAIN_SHOWALL = "<a href='".e_BASE."links.php?cat.all'>".LAN_67."</a>";
-
-        $link_main_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $LINK_MAIN_TABLE_END);
-
-        $text .= $link_main_table_start.$link_main_table_string.$link_main_table_end;
-
-        $ns -> tablerender($caption, $text);
-
-}else{
-
-        $id = e_QUERY;
-        $qs=explode(".",e_QUERY);
-        if($qs[0] == "cat"){
-                $category = $qs[1];
-                unset($id);
-        } elseif($qs[1] == "cat"){
-                $category = $qs[2];
-                $id=$qs[0];
-        }
-
-        if(isset($id)){
-                $id = $qs[0];
-                if($id){
-                        $sql -> db_Update("links", "link_refer=link_refer+1 WHERE link_id='$id' ");
-                        $sql -> db_Select("links", "*", "link_id='$id AND link_class!=255' ");
-                        $row = $sql -> db_Fetch(); extract($row);
-                                header("location:".$link_url);
-
-                }
-                $sql -> db_Select("link_category", "*", "link_category_id != '1' ");
-        }
-        if($category){
-                if($category == "all"){
-                        $sql -> db_Select("link_category", "*", "link_category_id != '1' ");
-                }else{
-                        $sql -> db_Select("link_category", "*", "link_category_id='$category'");
-                }
-        }
-
-        if(!$LINK_CAT_TABLE){
-           if(file_exists(THEME."links_template.php")){
-              require_once(THEME."links_template.php");
-            }
-          	else{
-              require_once(e_BASE.$THEMES_DIRECTORY."templates/links_template.php");
-            }
-        }
-
-        $sql2 = new db;
-        while(list($link_category_id, $link_category_name, $link_category_description) = $sql-> db_Fetch()){
-                if($link_total = $sql2 -> db_Select("links", "*", "link_category ='$link_category_id' ORDER BY link_order ")){
-                        unset($text, $link_cat_table_string);
-                        $link_activ = 0;
-                        while($row = $sql2-> db_Fetch()){
-                                extract($row);
-                                if(!$link_class || check_class($link_class)){
-                                        $link_activ++;
-
-                                        // Caption
-                                        $caption = LAN_86." ".$link_category_name;
-                                        if($link_category_description != ""){
-                                                $caption .= " <i>[".$link_category_description."]</i>";
-                                        }
-                                        // Number of links displayed
-                                        $caption .= " (<b title='".(ADMIN ? LAN_Links_2 : LAN_Links_1)."' >".$link_activ."</b>".(ADMIN ? "/<b title='".(ADMIN ? LAN_Links_1 : "" )."' >".$link_total."</b>" : "").") ";
-
-                                        $link_cat_table_string .= parse_link_cat_table($row);
-
-                                }
-                        }
-                        if($pref['link_submit'] && check_class($pref['link_submit_class'])){
-                                $LINK_CAT_SUBMIT = "<a href='".e_SELF."?submit'>".LAN_101."</a>";
-                        }
-
-                        if($link_activ > 0){
-                                $link_cat_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $LINK_CAT_TABLE_START);
-                                $link_cat_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $LINK_CAT_TABLE_END);
-                                $text .= $link_cat_table_start.$link_cat_table_string.$link_cat_table_end;
-                                $ns -> tablerender($caption, $text);
-                        }
-                        $link_activ = 0;
-                }
-        }
-}
-
-require_once(FOOTERF);
-
-
-
-function parse_link_main_table($row){
-                global $LINK_MAIN_TABLE, $sql;
-                extract($row);
-
-                $sql2 = new db;
-                $total_links_cat = $sql2 -> db_Count("links", "(*)", " WHERE link_category=$link_category_id ");
-                $LINK_MAIN_ICON = ($link_category_icon ? "<img src='".e_IMAGE."link_icons/$link_category_icon' alt='' style='vertical-align:middle;' />" : "<img src='".THEME."images/bullet2.gif' alt='' style='vertical-align:middle;' />");
-                $LINK_MAIN_HEADING = (!$total_links_cat ? $link_category_name : "<a href='links.php?cat.".$link_category_id."'>".$link_category_name."</a>");
-                $LINK_MAIN_DESC = $link_category_description;
-                $LINK_MAIN_NUMBER = $total_links_cat." ".($total_links_cat == 1 ? LAN_65 : LAN_66)." ".LAN_64;
-
-                return(preg_replace("/\{(.*?)\}/e", '$\1', $LINK_MAIN_TABLE));
-}
-
-function parse_link_submit_table(){
-                global $LINK_SUBMIT_TABLE;
-
-                $sql = new db;
-                if($link_cats = $sql -> db_Select("link_category")){
-                        $LINK_SUBMIT_CAT = "<select name='cat_name' class='tbox'>";
-                                while(list($cat_id, $cat_name, $cat_description) = $sql-> db_Fetch()){
-                                        if($cat_name != "Main"){
-                                                $LINK_SUBMIT_CAT .= "<option value='$cat_id'>".$cat_name."</option>\n";
-                                        }
-                                }
-                        $LINK_SUBMIT_CAT .= "</select>";
-                }
-
-                return(preg_replace("/\{(.*?)\}/e", '$\1', $LINK_SUBMIT_TABLE));
-}
-
-function parse_link_cat_table($row){
-                global $LINK_CAT_TABLE, $sql, $pref, $aj, $category;
-                extract($row);
-
-                // Body
-                if(isset($category)){
-                        $link_append = "<a href='".e_SELF."?".$link_id.".cat.{$category}'>";
-                } else {
-
-                        switch ($link_open) {
-                        case 1:
-                                $link_append = "<a href='".e_SELF."?".$link_id."' rel='external'>";
-                        break;
-                        case 2:
-                                $link_append = "<a href='".e_SELF."?".$link_id."'>";
-                        break;
-                        case 3:
-                                $link_append = "<a href='".e_SELF."?".$link_id."'>";
-                        break;
-                        case 4:
-                                $link_append = "<a href=\"javascript:open_window('".e_SELF."?".$link_id."')\">";
-                        break;
-                        default:
-                                $link_append = "<a href='".e_SELF."?".$link_id."'>";
-                        }
-
-                }
-
-                if($link_button){
-                        $LINK_CAT_BUTTON = (strstr($link_button, "/") ? $link_append."\n<img style='border:0;' src='".$link_button."' alt='".$link_name."' /></a>" : $link_append."\n<img style='border:0' src='".e_IMAGE."link_icons/".$link_button."' alt='".$link_name."' /></a>");
-                }else{
-                        $LINK_CAT_BUTTON = $link_append."\n<img style='border:0;' src='".e_IMAGE."generic/blankbutton.png' alt='".$link_name."' /></a>";
-                }
-                $LINK_CAT_APPEND = $link_append;
-                $LINK_CAT_NAME = $link_name;
-                $LINK_CAT_URL = $link_url;
-                $LINK_CAT_DESC = $aj -> tpa($link_description);
-                $LINK_CAT_REFER = LAN_88." ".$link_refer;
-
-                return(preg_replace("/\{(.*?)\}/e", '$\1', $LINK_CAT_TABLE));
-
-}
+<?php
+require_once('class2.php');
+header('Location:'.SITEURL.$PLUGINS_DIRECTORY.'links_page/links.php'.(e_QUERY ? '?'.e_QUERY : ''));
+exit;
 ?>
\ No newline at end of file
diff -ruN 6171/login.php 75/login.php
--- 6171/login.php	2004-05-08 16:35:22.000000000 -0500
+++ 75/login.php	2005-04-27 16:54:09.000000000 -0500
@@ -1,99 +1,75 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /customlogin.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-
-require_once("class2.php");
-$HEADER = "<div>&nbsp;</div>";
-require_once(HEADERF);
-$use_imagecode = ($pref['logcode'] && extension_loaded("gd"));
-if($use_imagecode){
-        require_once(e_HANDLER."secure_img_handler.php");
-        $sec_img = new secure_image;
-}
-
-
-if(!USER){
-
-        echo "<div style='width:100%;text-align:center; margin-left: auto;margin-right: auto'><div style='text-align:center;width:70%;margin-left: auto;margin-right: auto'>";
-        if(file_exists(THEME."images/login_logo.png")){
-                echo "<img src='".THEME."images/login_logo.png' alt='' />\n";
-        } else{
-        echo "<img src='".e_IMAGE."logo.png' alt='' />\n";
-}
-require_once(e_HANDLER."form_handler.php");
-$rs = new form;
-$text = "";
-if(LOGINMESSAGE != ""){
-        $text = "<div style='text-align:center'>".LOGINMESSAGE."</div>";
-}
-$text .= "
-<div style='text-align:center'>".
-$rs -> form_open("post", e_SELF)."
-<table class='fborder' style='width:30%'>
-<tr>
-<td class='forumheader' colspan='2' style='text-align:center;width:30%'>
- <strong>".LAN_LOGIN_4."</strong>
-</td>
-        </tr>
-<tr>
-<td class='forumheader3' style='width:30%'>
-".LAN_LOGIN_1."
-</td>
-<td class='forumheader3' style='width:70%; text-align:right'>".
-$rs -> form_text("username", 40, "", 100)."
-</td>
-</tr><tr>
-<td class='forumheader3' style='width:30%'>
-".LAN_LOGIN_2."
-</td>
-<td class='forumheader3' style='width:70%; text-align:right'>".
-$rs -> form_password("userpass", 40, "", 100)."
-</td>
-</tr>";
-
-                if($use_imagecode){
-                        $text .= "<tr><td class='forumheader3'>".LAN_LOGIN_7."</td><td class='forumheader3'><input type='hidden' name='rand_num' value='".$sec_img -> random_number."'>";
-                        $text .= $sec_img -> r_image();
-                        $text .= "<br /><input class='tbox' type='text' name='code_verify' size='15' maxlength='20'><br /></td></tr>";
-                }
-
-$text .= "<tr>
-<td class='forumheader2' colspan='2' style='text-align:center'>".
-$rs -> form_checkbox("autologin", "1")."<span class='smalltext'>".LAN_LOGIN_8."</span><br />".
-$rs -> form_button("submit", "userlogin", "Log In", "", "Click to login")."
-</td>
-</tr></table>".
-$rs -> form_close()."
-</div>";
-
-$login_message = "".LAN_LOGIN_3." | ".SITENAME."";
-$ns -> tablerender($login_message, $text);
-echo "<div style='width:70%;margin-right:auto;margin-left:auto'><div style='text-align:center'><br />";
-
-if($pref['user_reg']){
-        echo "<a href='".e_SIGNUP."'>Signup</a>";
-}
-echo "&nbsp;&nbsp;&nbsp;<a href='fpw.php'>Forgot Password</a></div></div>";
-
-}else{
-header("location:".e_BASE."index.php");
-exit;
-}
-
-echo "</div></div></body>
-</html>";
-
-$sql -> db_Close();
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/login.php,v $
+|     $Revision: 1.7 $
+|     $Date: 2005/04/27 21:54:09 $
+|     $Author: stevedunstan $
++----------------------------------------------------------------------------+
+*/
+	
+require_once("class2.php");
+$HEADER = "<div>&nbsp;</div>";
+require_once(HEADERF);
+$use_imagecode = ($pref['logcode'] && extension_loaded("gd"));
+if ($use_imagecode) {
+	require_once(e_HANDLER."secure_img_handler.php");
+	$sec_img = new secure_image;
+}
+	
+if (!USER) {
+	require_once(e_HANDLER."form_handler.php");
+	$rs = new form;
+	$text = "";
+	 
+	$LOGIN_TABLE_LOGINMESSAGE = LOGINMESSAGE;
+	$LOGIN_TABLE_USERNAME = $rs->form_text("username", 40, "", 100);
+	$LOGIN_TABLE_PASSWORD = $rs->form_password("userpass", 40, "", 100);
+	if ($use_imagecode) {
+		$LOGIN_TABLE_SECIMG_LAN = LAN_LOGIN_13;
+		$LOGIN_TABLE_SECIMG_HIDDEN = "<input type='hidden' name='rand_num' value='".$sec_img->random_number."'>";
+		$LOGIN_TABLE_SECIMG_SECIMG = $sec_img->r_image();
+		$LOGIN_TABLE_SECIMG_TEXTBOC = "<input class='tbox' type='text' name='code_verify' size='15' maxlength='20'>";
+	}
+	$LOGIN_TABLE_AUTOLOGIN = $rs->form_checkbox("autologin", "1");
+	$LOGIN_TABLE_AUTOLOGIN_LAN = LAN_LOGIN_8;
+	$LOGIN_TABLE_SUBMIT = $rs->form_button("submit", "userlogin", LAN_LOGIN_9, "", LAN_LOGIN_10);
+	 
+	if (!$LOGIN_TABLE) {
+		if (file_exists(THEME."login_template.php")) {
+			require_once(THEME."login_template.php");
+		} else {
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/login_template.php");
+		}
+	}
+	$text = preg_replace("/\{(.*?)\}/e", '$\1', $LOGIN_TABLE);
+	 
+	echo preg_replace("/\{(.*?)\}/e", '$\1', $LOGIN_TABLE_HEADER);
+	 
+	$login_message = LAN_LOGIN_3." | ".SITENAME;
+	$ns->tablerender($login_message, $text);
+	 
+	if ($pref['user_reg']) {
+		$LOGIN_TABLE_FOOTER_USERREG = "<a href='".e_SIGNUP."'>".LAN_LOGIN_11."</a>";
+	}
+	echo preg_replace("/\{(.*?)\}/e", '$\1', $LOGIN_TABLE_FOOTER);
+	 
+} else {
+	echo "<script type='text/javascript'>document.location.href='".e_BASE."index.php'</script>\n";
+	exit;
+}
+
+echo "</body></html>";
+	
+$sql->db_Close();
+	
 ?>
\ No newline at end of file
diff -ruN 6171/membersonly.php 75/membersonly.php
--- 6171/membersonly.php	2004-08-27 12:31:44.000000000 -0500
+++ 75/membersonly.php	2006-01-06 12:11:26.000000000 -0600
@@ -1,49 +1,41 @@
-<?php
-        require_once("class2.php");
-
-
-echo "<?xml version='1.0' encoding='iso-8859-1' ?>\n";
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<title><?php echo SITENAME." - ".PAGE_NAME; ?></title>
-<link rel="stylesheet" href="<?php echo THEME; ?>style.css" />
-<!-- <link rel="stylesheet" href="<?php echo e_BASE."e107_files/"; ?>e107.css" />-->
-<?php
-echo "\n<link rel='stylesheet' href='".THEME."style.css' />\n";
-?>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<meta http-equiv="content-style-type" content="text/css" />
-<?php
-echo $pref['meta_tag'][1]."\n";
-?>
-
-<script type="text/javascript" src="e107_files/e107.js"></script>
-<?php
-if(file_exists(THEME."theme.js")){echo "<script type='text/javascript' src='".THEME."theme.js'></script>";}
-if(file_exists(e_BASE."e107_files/user.js")){echo "<script type='text/javascript' src='".e_BASE."e107_files/user.js'></script>\n";}
-?>
-
-<?php
-
-print "</head>
-<body>
-<div><br /></div>\n";
-
-        $text = "<div style='text-align:center'><table class='fborder' style='width:75%;margin-right:auto;margin-left:auto'>
-        <tr><td class='forumheader3' style='text-align:center'><br />".LAN_MEMBERS_1."
-        ".LAN_MEMBERS_2." <a href='".e_SIGNUP."'>".
-        LAN_MEMBERS_3."</a><br /><br /></td></tr>
-        <tr><td class='forumheader' style='text-align:center;margin-right:auto;margin-left:auto'><a href='".e_BASE."index.php'>".LAN_MEMBERS_4."</a></td></tr>
-        </table></div>";
-
-        echo "<div style='text-align:center'>";
-        echo"<div style='width:65%;margin-left:auto;margin-right:auto;text-align:center'>";
-
-        $ns -> tablerender(LAN_MEMBERS_0,$text);
-       echo "</div></div>";
-
-?>
-</body>
-</html>
\ No newline at end of file
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     ©Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/membersonly.php,v $
+|     $Revision: 1.5 $
+|     $Date: 2006/01/06 18:11:26 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+
+include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_membersonly.php");
+
+if(is_readable(THEME."membersonly_template.php"))
+{
+	require_once(THEME."membersonly_template.php");
+}
+else
+{
+	require_once(e_THEME."templates/membersonly_template.php");
+}
+
+$HEADER=""; 
+$FOOTER=""; 
+
+include_once(HEADERF);
+
+echo $MEMBERSONLY_BEGIN;
+$ns->tablerender($MEMBERSONLY_CAPTION, $MEMBERSONLY_TABLE); 
+echo $MEMBERSONLY_END;
+
+?>
diff -ruN 6171/news.php 75/news.php
--- 6171/news.php	2005-05-13 06:18:09.000000000 -0500
+++ 75/news.php	2006-05-17 06:57:35.000000000 -0500
@@ -10,343 +10,521 @@
 |     Released under the terms and conditions of the
 |     GNU General Public License (http://gnu.org).
 |
-|     $Source: /cvsroot/e107/e107/news.php,v $
-|     $Revision: 1.17 $
-|     $Date: 2004/09/09 10:03:10 $
-|     $Author: e107coders $
+|     $Source: /cvsroot/e107/e107_0.7/news.php,v $
+|     $Revision: 1.98 $
+|     $Date: 2006/05/17 11:57:35 $
+|     $Author: mcfly_e107 $
 +----------------------------------------------------------------------------+
 */
 require_once("class2.php");
 require_once(e_HANDLER."news_class.php");
-require_once(HEADERF);
+require_once(e_HANDLER."comment_class.php");
+$cobj = new comment;
+
+if (isset($NEWSHEADER)) {
+	require_once(HEADERF);
+	require_once(FOOTERF);
+	exit;
+}
+$cacheString = 'news.php_'.e_QUERY;
+$action = '';
+if (!defined("ITEMVIEW")){
+	if ($pref['newsposts']==""){
+		define("ITEMVIEW", 15);
+	} else {
+		define("ITEMVIEW", $pref['newsposts']);
+	}
+}
+
+if (e_QUERY) {
+	$tmp = explode(".", e_QUERY);
+	$action = $tmp[0];
+	$sub_action = $tmp[1];
+	$id = $tmp[2];
+}
 
-if($NEWSHEADER){
-        require_once(FOOTERF);
-        exit;
+$from = (!is_numeric($action) || !e_QUERY ? 0 : ($action ? $action : e_QUERY));
+if (isset($tmp[1]) && $tmp[1] == 'list') {
+	$action = 'list';
+	$from = intval($tmp[0]);
+	$sub_action = intval($tmp[2]);
+}
+if ($action == 'all' || $action == 'cat') {
+	$from = intval($tmp[2]);
+	$sub_action = intval($tmp[1]);
 }
 
-if(Empty($pref['newsposts']) ? define("ITEMVIEW", 15) : define("ITEMVIEW", $pref['newsposts']));
-if(ADMIN && file_exists("install.php"))
+$ix = new news;
+if ($action == 'cat' || $action == 'all'){
+
+	// --> Cache
+	if($tmp = checkCache($cacheString)){
+		require_once(HEADERF);
+		renderCache($tmp, TRUE);
+	}
+	// <-- Cache
+
+	$qs = explode(".", e_QUERY);
+
+	$category = intval($qs[1]);
+	if ($action == 'cat' && $category != 0)	{
+		$gen = new convert;
+		$sql->db_Select("news_category", "*", "category_id='$category'");
+		$row = $sql->db_Fetch();
+		extract($row);  // still required for the table-render.  :(
+	}
+	if ($action == 'all'){
+		if(!defined("NEWSALL_LIMIT")){ define("NEWSALL_LIMIT",10); }
+		// show archive of all news items using list-style template.
+		$news_total = $sql->db_Count("news", "(*)", "WHERE news_class REGEXP '".e_CLASS_REGEXP."'");
+		$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().")  ORDER BY n.news_datestamp DESC LIMIT ".intval($from).",".NEWSALL_LIMIT;
+		$category_name = "All";
+	}
+	elseif ($action == 'cat'){
+		// show archive of all news items in a particular category using list-style template.
+		$news_total = $sql->db_Count("news", "(*)", "WHERE news_class REGEXP '".e_CLASS_REGEXP."' AND news_start < ".time()." AND (news_end=0 || news_end>".time().") AND news_category=".intval($sub_action));
+		if(!defined("NEWSLIST_LIMIT")){ define("NEWSLIST_LIMIT",10); }
+		$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_category=".intval($sub_action)." ORDER BY n.news_datestamp DESC LIMIT ".intval($from).",".NEWSLIST_LIMIT;
+	}
+
+	if($category_name){
+		define("e_PAGETITLE", $category_name);
+	}
+
+	require_once(HEADERF);
+
+	if(!$NEWSLISTSTYLE){
+		$NEWSLISTSTYLE = "
+		<div style='padding:3px;width:100%'>
+		<table style='border-bottom:1px solid black;width:100%' cellpadding='0' cellspacing='0'>
+		<tr>
+		<td style='vertical-align:top;padding:3px;width:20px'>
+		{NEWSCATICON}
+		</td><td style='text-align:left;padding:3px'>
+		{NEWSTITLELINK}
+		<br />
+		{NEWSSUMMARY}
+		<span class='smalltext'>
+		{NEWSDATE}
+		{NEWSCOMMENTS}
+		</span>
+		</td><td style='width:55px'>
+		{NEWSTHUMBNAIL}
+		</td></tr></table>
+		</div>\n";
+
+	}
+	$param['itemlink'] = (defined("NEWSLIST_ITEMLINK")) ? NEWSLIST_ITEMLINK : "";
+	$param['thumbnail'] =(defined("NEWSLIST_THUMB")) ? NEWSLIST_THUMB : "border:0px";
+	$param['catlink']  = (defined("NEWSLIST_CATLINK")) ? NEWSLIST_CATLINK : "";
+	$param['caticon'] =  (defined("NEWSLIST_CATICON")) ? NEWSLIST_CATICON : ICONSTYLE;
+	$sql->db_Select_gen($query);
+	$newsList = $sql->db_getList();
+	foreach($newsList as $row)
+	{
+		$text .= $ix->render_newsitem($row, 'return', '', $NEWSLISTSTYLE, $param);
+	}
+
+	$amount = ($action == "all") ? NEWSALL_LIMIT : NEWSLIST_LIMIT;
+
+	$icon = ($row['category_icon']) ? "<img src='".e_IMAGE."icons/".$row['category_icon']."' alt='' />" : "";
+	$parms = $news_total.",".$amount.",".$from.",".e_SELF.'?'.$action.".".$sub_action.".[FROM]";
+	$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>";
+
+    if(!$NEWSLISTTITLE){
+		$NEWSLISTTITLE = LAN_82." '{$category_name}'";
+	}
+
+	ob_start();
+	$ns->tablerender($NEWSLISTTITLE, $text);
+	$cache_data = ob_get_flush();
+	setNewsCache($cacheString, $cache_data);
+	require_once(FOOTERF);
+	exit;
+}
+
+if ($action == "extend") {
+
+	// --> Cache
+	if($tmp = checkCache($cacheString)){
+		require_once(HEADERF);
+		renderCache($tmp, TRUE);
+	}
+	// <-- Cache
+
+	$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_id=".intval($sub_action);
+	$sql->db_Select_gen($query);
+	$news = $sql->db_Fetch();
+
+	if($news['news_title']){
+		define("e_PAGETITLE",$news['news_title']);
+	}
+
+	require_once(HEADERF);
+	ob_start();
+	$ix->render_newsitem($news, "extend");
+	$cache_data = ob_get_contents();
+	ob_end_flush();
+	setNewsCache($cacheString, $cache_data);
+	require_once(FOOTERF);
+	exit;
+}
+
+if (empty($order)){
+	$order = "news_datestamp";
+}
+$order = $tp -> toDB($order, true);
+
+$interval = 10;
+if ($action == "list"){
+	$sub_action = intval($sub_action);
+	$news_total = $sql->db_Count("news", "(*)", "WHERE news_category=$sub_action AND news_class REGEXP '".e_CLASS_REGEXP."' AND news_render_type!=2");
+	$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type!=2 AND n.news_category={$sub_action} ORDER BY ".$order." DESC LIMIT ".intval($from).",".ITEMVIEW;
+}
+elseif($action == "item")
+{
+	$sub_action = intval($sub_action);
+	$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_id={$sub_action}";
+}
+elseif(strstr(e_QUERY, "month"))
+{
+	$tmp = explode(".", e_QUERY);
+	$item = $tp -> toDB($tmp[1]);
+	$year = substr($item, 0, 4);
+	$month = substr($item, 4);
+	$startdate = mktime(0, 0, 0, $month, 1, $year);
+	$lastday = date("t", $startdate);
+	$enddate = mktime(23, 59, 59, $month, $lastday, $year);
+	$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type<2 AND n.news_datestamp > $startdate AND n.news_datestamp < $enddate ORDER BY ".$order." DESC LIMIT ".intval($from).",".ITEMVIEW;
+}
+elseif(strstr(e_QUERY, "day"))
 {
-	echo "<div class='installe' style='text-align:center'><b>*** ".LAN_NEWS_3." ***</b><br />".LAN_NEWS_4."</div><br /><br />"; 
+	$tmp = explode(".", e_QUERY);
+	$item = $tp -> toDB($tmp[1]);
+	$year = substr($item, 0, 4);
+	$month = substr($item, 4, 2);
+	$day = substr($item, 6, 2);
+	$startdate = mktime(0, 0, 0, $month, $day, $year);
+	$lastday = date("t", $startdate);
+	$enddate = mktime(23, 59, 59, $month, $day, $year);
+	$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class REGEXP '".e_CLASS_REGEXP."' AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().") AND n.news_render_type<2 AND n.news_datestamp > $startdate AND n.news_datestamp < $enddate ORDER BY ".$order." DESC LIMIT ".intval($from).",".ITEMVIEW;
 }
+else
+{
+	$news_total = $sql->db_Count("news", "(*)", "WHERE news_class REGEXP '".e_CLASS_REGEXP."' AND news_start < ".time()." AND (news_end=0 || news_end>".time().") AND news_render_type<2" );
+
+	if(!isset($pref['newsposts_archive']))
+	{
+		$pref['newsposts_archive'] = 0;
+	}
+	$interval = $pref['newsposts']-$pref['newsposts_archive'];
+
+	// Get number of news item to show
+	if(isset($pref['trackbackEnabled']) && $pref['trackbackEnabled']) {
+		$query = "SELECT COUNT(tb.trackback_pid) AS tb_count, n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon, COUNT(*) AS tbcount FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		LEFT JOIN #trackback AS tb ON tb.trackback_pid  = n.news_id
+		WHERE n.news_class REGEXP '".e_CLASS_REGEXP."'
+		AND n.news_start < ".time()."
+		AND (n.news_end=0 || n.news_end>".time().")
+		AND n.news_render_type<2
+		GROUP by n.news_id
+		ORDER BY news_sticky DESC, ".$order." DESC LIMIT ".intval($from).",".$pref['newsposts'];
+	}
+	else
+	{
+		$query = "SELECT n.*, u.user_id, u.user_name, u.user_customtitle, nc.category_name, nc.category_icon FROM #news AS n
+		LEFT JOIN #user AS u ON n.news_author = u.user_id
+		LEFT JOIN #news_category AS nc ON n.news_category = nc.category_id
+		WHERE n.news_class REGEXP '".e_CLASS_REGEXP."'
+		AND n.news_start < ".time()."
+		AND (n.news_end=0 || n.news_end>".time().")
+		AND n.news_render_type<2
+		ORDER BY n.news_sticky DESC, ".$order." DESC LIMIT ".intval($from).",".$pref['newsposts'];
+	}
+	// #### END ---------------------------------------------------------------------------------------------------
+}
+
+if($tmp_cache = checkCache($cacheString))
+{
+	require_once(HEADERF);
 
-if(!is_object($aj)){ $aj = new textparse; }
+	if(!$action)
+	{
+		if (isset($pref['fb_active']))
+		{
+			require_once(e_PLUGIN."featurebox/featurebox.php");
+		}
+		if (isset($pref['nfp_display']) && $pref['nfp_display'] == 1)
+		{
+			require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
+		}
 
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
+	}
+	renderCache($tmp_cache, TRUE);
 }
 
-$from = (!is_numeric($action) || !e_QUERY ? 0 : ($action ? $action : e_QUERY));
-if($tmp[1]=='list'){
-        $action='list';
-        $from=intval($tmp[0]);
-        $sub_action=intval($tmp[2]);
+
+if (!$sql->db_Select_gen($query)) {
+	require_once(HEADERF);
+	echo "<br /><br /><div style='text-align:center'><b>".(strstr(e_QUERY, "month") ? LAN_462 : LAN_83)."</b></div><br /><br />";
+	require_once(FOOTERF);
+	exit;
+} else {
+	$newsAr = $sql -> db_getList();
 }
 
-$ix = new news;
-if($action == "cat"){
-        $qs = explode(".", e_QUERY);
-        $category = $qs[1];
-        if($category != 0){
-                $gen = new convert;
-                $sql2 = new db;
-                $sql -> db_Select("news_category", "*", "category_id='$category'");
-                list($category_id, $category_name, $category_icon) = $sql-> db_Fetch();
-                $category_name = $aj -> tpa($category_name);
-                $category_icon = e_IMAGE."newsicons/".$category_icon;
-
-                                $count = $sql -> db_SELECT("news", "*",  "news_category='$category' AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ORDER BY news_datestamp DESC");
-                while($row = $sql-> db_Fetch()){
-                        extract($row);
-                                                if(check_class($news_class)){
-                        $news_title = $aj -> tpa($news_title);
-                                                        if($news_title == ""){ $news_title = "Untitled"; }
-                                                        $datestamp = $gen->convert_date($news_datestamp, "short");
-                                                        $comment_total = $sql2 -> db_Count("comments", "(*)",  "WHERE comment_item_id='$news_id' AND comment_type='0' ");
-                                                        $text .= "
-                                                        <img src='".THEME."images/bullet2.gif' alt='bullet' /> <b>
-                                                        <a href='news.php?item.".$news_id."'>".$news_title."</a></b>
-                                                        <br />&nbsp;&nbsp;
-                                                        <span class='smalltext'>
-                                                        ".$datestamp.", ".LAN_99.": ".
-                                                        ($news_allow_comments ? COMMENTOFFSTRING : $comment_total)."
-                                                        </span>
-                                                        <br />\n";
-                                                }else{
-                                                        $count --;
-                                                }
-
-                }
-                $text = "<img src='$category_icon' alt='' /><br />".
-                LAN_307.$count."
-                <br /><br />".$text;
-                $ns -> tablerender(LAN_82." '".$category_name."'", $text);
-                require_once(FOOTERF);
-                exit;
-        }
-}
-
-if($action == "extend"){
-        $extend_id = substr(e_QUERY, (strpos(e_QUERY, ".")+1));
-        $sql -> db_Select("news", "*", "news_id='$extend_id' AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().")");
-        list($news['news_id'], $news['news_title'], $news['data'], $news['news_extended'], $news['news_datestamp'], $news['admin_id'], $news_category, $news['news_allow_comments'],  $news['news_start'], $news['news_end'], $news['news_class']) = $sql -> db_Fetch();
-        if(!check_class($news['news_class'])){ header("location:".e_BASE."news.php"); }
-        $sql -> db_Select("news_category", "*",  "category_id='$news_category' ");
-        list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql-> db_Fetch();
-        $news['comment_total'] = $sql -> db_Count("comments", "(*)",  "WHERE comment_item_id='".$news['news_id']."' AND comment_type='0' ");
-        $sql -> db_Select("user", "user_name", "user_id='".$news['admin_id']."' ");
-        list($news['admin_name']) = $sql -> db_Fetch();
-        $ix -> render_newsitem($news);
-        require_once(FOOTERF);
-        exit;
-}
-
-if($pref['nfp_display'] == 1){
-        require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
-}
-
-if(Empty($order)){ $order = "news_datestamp"; }
-
-// ---> wmessage
-if(!defined("WMFLAG")){
-        $sql -> db_Select("wmessage");
-        list($wm_guest, $guestmessage, $wm_active1) = $sql-> db_Fetch();
-        list($wm_member, $membermessage, $wm_active2) = $sql-> db_Fetch();
-        list($wm_admin, $adminmessage, $wm_active3) = $sql-> db_Fetch();
-        if(ADMIN == TRUE && $wm_active3){
-                $adminmessage = $aj -> tpa($adminmessage, "on","admin");
-                $ns -> tablerender("", "<div style='text-align:center'><b>Administrators</b><br />".$adminmessage."</div>", "wm");
-        }else if(USER == TRUE && $wm_active2 && !ADMIN){
-                $membermessage = $aj -> tpa($membermessage, "on","admin");
-                $ns -> tablerender("", "<div style='text-align:center'>".$membermessage."</div>", "wm");
-        }else if(USER == FALSE && $wm_active1 && !ADMIN){
-                $guestmessage = $aj -> tpa($guestmessage, "on","admin");
-                $ns -> tablerender("", "<div style='text-align:center'>".$guestmessage."</div>", "wm");
-        }
-}
-// ---> wmessage end
-
-if($action == "list"){
-                $sub_action=intval($sub_action);
-        $news_total = $sql -> db_Count("news", "(*)", "WHERE news_category=$sub_action");
-        $query = "news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_render_type!=2 AND news_category=$sub_action ORDER BY ".$order." DESC LIMIT $from,".ITEMVIEW;
-}else if($action == "item"){
-                $sub_action=intval($sub_action);
-        $news_total = $sql -> db_Count("news", "(*)", "WHERE news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_render_type!=2" );
-        $query = "news_id=$sub_action AND news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().")";
-}else if(strstr(e_QUERY, "month")){
-        $tmp = explode(".", e_QUERY);
-        $item = $tmp[1];
-        $year = substr($item, 0, 4);
-        $month = substr($item, 4);
-        $startdate = mktime(0,0,0,$month,1,$year);
-        $lastday = date("t", $startdate);
-        $enddate = mktime(23,59,59,$month,$lastday,$year);
-        $query = "news_datestamp > $startdate AND news_datestamp < $enddate AND news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ORDER BY ".$order." DESC";;
-}else if(strstr(e_QUERY, "day")){
-        $tmp = explode(".", e_QUERY);
-        $item = $tmp[1];
-        $year = substr($item, 0, 4);
-        $month = substr($item, 4, 2);
-        $day = substr($item, 6, 2);
-        $startdate = mktime(0,0,0,$month,$day,$year);
-        $lastday = date("t", $startdate);
-        $enddate = mktime(23,59,59,$month,$day,$year);
-        $query = "news_datestamp > $startdate AND news_datestamp < $enddate AND news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ORDER BY ".$order." DESC";
-}else{
-        $news_total = $sql -> db_Count("news", "(*)", "WHERE news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_render_type!=2" );
-
-                // #### changed for news archive ------------------------------------------------------------------------------
-                $interval = $pref['newsposts']-$pref['newsposts_archive'];
-                $from2 = $interval+$from;
-                $ITEMVIEW2 = ITEMVIEW-$interval;
-                $ITEMVIEW1 = $interval;
-
-
-                // normal newsitems
-        $query = "news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_render_type!=2 ORDER BY ".$order." DESC LIMIT $from,".$ITEMVIEW1;
-
-                // news archive
-                $query2 = "news_class<255 AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_render_type!=2 ORDER BY ".$order." DESC LIMIT $from2,".$ITEMVIEW2;
-                // #### END ---------------------------------------------------------------------------------------------------
-}
-
-if($sql -> db_Select("news", "*", "news_class<255 AND news_class!='' AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") AND news_class!='' ORDER BY ".$order." DESC LIMIT $from,".ITEMVIEW)){
-        $disablecache = TRUE;
-}
-
-if(!$disablecache && !e_QUERY){
-        if($cache_data = retrieve_cache("news.php")){
-                echo $aj -> formtparev($cache_data);
-                $cachestring = "Cache system activated (content originally served ".strftime("%A %d %B %Y - %H:%M:%S", $cache_datestamp).").";
-                require_once(e_HANDLER."np_class.php");
-                $ix = new nextprev("news.php", $from, ITEMVIEW, $news_total, LAN_84);
-                if($pref['nfp_display'] == 2){
-                        require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
-                }
-                require_once(FOOTERF);
-                exit;
-        }
-}
-
-// #### normal newsitems, rendered via render_newsitem(), the $query is changed above (no other changes made) ---------
-ob_start();
-if(!$sql -> db_Select("news", "*", $query)){
-        echo "<br /><br /><div style='text-align:center'><b>".(strstr(e_QUERY, "month") ? LAN_462 : LAN_83)."</b></div><br /><br />";
-}else{
-        $sql2 = new db;
-        while(list($news['news_id'], $news['news_title'], $news['data'], $news['news_extended'], $news['news_datestamp'], $news['admin_id'], $news_category, $news['news_allow_comments'],  $news['news_start'], $news['news_end'], $news['news_class'], $news['news_rendertype']) = $sql -> db_Fetch()){
-
-                if(check_class($news['news_class'])){
-                        if($news['admin_id'] == 1 && $pref['siteadmin']){
-                                $news['admin_name'] = $pref['siteadmin'];
-                        }else if(!$news['admin_name'] = getcachedvars($news['admin_id'])){
-                                $sql2 -> db_Select("user", "user_name", "user_id='".$news['admin_id']."' ");
-                                list($news['admin_name']) = $sql2 -> db_Fetch();
-                                cachevars($news['admin_id'], $news['admin_name']);
-                        }
-                        $sql2 -> db_Select("news_category", "*",  "category_id='$news_category' ");
-                        list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2-> db_Fetch();
-                        $news['comment_total'] = $sql2 -> db_Count("comments", "(*)",  "WHERE comment_item_id='".$news['news_id']."' AND comment_type='0' ");
-                        if($action == "item"){ unset($news['news_rendertype']); }
-                        $ix -> render_newsitem($news);
-                }
-                // To hide messages for restricted news and only display valid news, comment the following else statement
-                else{
-                    if($pref['subnews_hide_news']==1){
-                      if($news['admin_id'] == 1 && $pref['siteadmin']){
-                              $news['admin_name'] = $pref['siteadmin'];
-                      }else if(!$news['admin_name'] = getcachedvars($news['admin_id'])){
-                              $sql2 -> db_Select("user", "user_name", "user_id='".$news['admin_id']."' ");
-                              list($news['admin_name']) = $sql2 -> db_Fetch();
-                              cachevars($news['admin_id'], $news['admin_name']);
-                      }
-                      $sql2 -> db_Select("news_category", "*",  "category_id='$news_category' ");
-                      list($news['category_id'], $news['category_name'], $news['category_icon']) = $sql2-> db_Fetch();
-                      $ix -> render_newsitem($news,"","userclass");
-                    }
-                }
-        }
+
+$p_title = ($action == "item") ? $newsAr[1]['news_title'] : $newsAr[1]['category_name'];
+if($action != "" && !is_numeric($action))
+{
+	define("e_PAGETITLE", $p_title);
 }
-// ##### --------------------------------------------------------------------------------------------------------------
 
-// #### new: news archive ---------------------------------------------------------------------------------------------
-if($action != "item" && $action != 'list'){ // do not show the newsarchive on the news.php?item.X page (but only on the news mainpage)
-        $sql2b = new db;
-        if(!$sql2b -> db_Select("news", "*", $query2)){
-
-        }else{
-                while(list($news2['news_id'], $news2['news_title'], $news2['data'], $news2['news_extended'], $news2['news_datestamp'], $news2['admin_id'], $news2_category, $news2['news_allow_comments'],  $news2['news_start'], $news2['news_end'], $news2['news_class'], $news2['news_rendertype']) = $sql2b -> db_Fetch()){
-
-                                if(check_class($news2['news_class'])){
-                                        if($action == "item"){ unset($news2['news_rendertype']); }
-
-                                        // Code from Lisa
-                                        // copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X
-                                        // instead of the actual hyperlink that may have been added to a newstitle on creation
-                                        $search = array();
-                                        $replace = array();
-                                        $search[0] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
-                                        $replace[0] = '\\2';
-                                        $search[1] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
-                                        $replace[1] = '\\2';
-                                        $search[2] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
-                                        $replace[2] = '\\2';
-                                        $search[3] = "/\<a href=&quot;(.*?)&quot;>(.*?)<\/a>/si";
-                                        $replace[3] = '\\2';
-                                        $search[4] = "/\<a href=&#39;(.*?)&#39;>(.*?)<\/a>/si";
-                                        $replace[4] = '\\2';
-                                        $news2['news_title'] = preg_replace($search, $replace, $news2['news_title']);
-                                        // End of code from Lisa
-
-                                        $gen = new convert;
-                                        $news2['news_datestamp'] = $gen->convert_date($news2['news_datestamp'], "short");
-                                        if(!is_object($sql2)){$sql2 = new db;}
-                                        $sql2 -> db_Select("news_category", "*",  "category_id='$news2_category' ");
-                                        list($news2['category_id'], $news2['category_name'], $news2['category_icon']) = $sql2-> db_Fetch();
-                                        $news2['comment_total'] = $sql2 -> db_Count("comments", "(*)",  "WHERE comment_item_id='".$news2['news_id']."' AND comment_type='0' ");
-
-                                        $textnewsarchive .= "
-                                        <div>
-                                        <table style='width:98%;'>
-                                                <tr>
-                                                        <td>
-                                                                <div><img src='".THEME."images/bullet2.gif' border='0' style='border:0;' alt='' /> <b><a href='news.php?item.".$news2['news_id']."'>".$news2['news_title']."</a></b> <span class='smalltext' ><i>(".$news2['news_datestamp'].") (".$news2['category_name'].")</i></span></div>
-                                                        </td>
-                                                </tr>
-                                        </table>
-                                        </div>";
-                                }
-                }
-                $ns -> tablerender($pref['newsposts_archive_title'], $textnewsarchive);
-        }
+require_once(HEADERF);
+if(!$action)
+{
+	if (isset($pref['fb_active'])){   // --->feature box
+		require_once(e_PLUGIN."featurebox/featurebox.php");
+	}
+
+	if (isset($pref['nfp_display']) && $pref['nfp_display'] == 1){
+		require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
+	}
 }
-// #### END -----------------------------------------------------------------------------------------------------------
 
 
-require_once(e_HANDLER."np_class.php");
-if($action != "item"){ $ix = new nextprev("news.php", $from, ITEMVIEW, $news_total, LAN_84, ($action == "list" ? $action.".".$sub_action : "")); }
+/*
+changes by jalist 03/02/2005:
+news page templating
 
-if($pref['nfp_display'] == 2){
-        require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
+*/
+if($pref['news_unstemplate'] && file_exists(THEME."news_template.php")) {
+	// theme specific template required ...
+	require_once(THEME."news_template.php");
+
+	if($ALTERNATECLASS1){
+		return TRUE;
+	}
+
+	$newscolumns = (isset($NEWSCOLUMNS) ? $NEWSCOLUMNS : 1);
+	$newspercolumn = (isset($NEWSITEMSPERCOLUMN) ? $NEWSITEMSPERCOLUMN : 10);
+	$newsdata = array();
+	$loop = 1;
+	foreach($newsAr as $news) {
+
+		if(is_array($ALTERNATECLASSES)) {
+			$newsdata[$loop] .= "<div class='{$ALTERNATECLASSES[0]}'>".$ix->render_newsitem($news, "return")."</div>";
+			$ALTERNATECLASSES = array_reverse($ALTERNATECLASSES);
+		} else {
+			$newsdata[$loop] .= $ix->render_newsitem($news, "return");
+		}
+		$loop ++;
+		if($loop > $newscolumns) {
+			$loop = 1;
+		}
+	}
+	$loop = 1;
+	foreach($newsdata as $data) {
+		$var = "ITEMS{$loop}";
+		$$var = $data;
+		$loop ++;
+	}
+	$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWSCLAYOUT);
+
+	require_once(HEADERF);
+	echo $text;
+	setNewsCache($cacheString, $text);
+
+} else {
+	/*
+	changes by jalist 22/01/2005:
+	added ability to add a new date header to news posts, turn on and off from news->prefs
+	*/
+
+	ob_start();
+
+	$newpostday = 0;
+	$thispostday = 0;
+	$pref['newsHeaderDate'] = 1;
+	$gen = new convert();
+
+	if (!defined("DATEHEADERCLASS")) {
+		define("DATEHEADERCLASS", "nextprev");
+		// if not defined in the theme, default class nextprev will be used for new date header
+	}
+
+	// #### normal newsitems, rendered via render_newsitem(), the $query is changed above (no other changes made) ---------
+
+	$i= 1;
+	while(isset($newsAr[$i]) && $i <= $interval) {
+		$news = $newsAr[$i];
+		//        render new date header if pref selected ...
+		$thispostday = strftime("%j", $news['news_datestamp']);
+		if ($newpostday != $thispostday && (isset($pref['news_newdateheader']) && $pref['news_newdateheader'])) {
+			echo "<div class='".DATEHEADERCLASS."'>".strftime("%A %d %B %Y", $news['news_datestamp'])."</div>";
+		}
+		$newpostday = $thispostday;
+		$news['category_id'] = $news['news_category'];
+		if ($action == "item") {
+			unset($news['news_render_type']);
+		}
+
+		$ix->render_newsitem($news);
+		$i++;
+	}
+
+	$cache_data = ob_get_clean();
+	require_once(HEADERF);
+	echo $cache_data;
+	setNewsCache($cacheString, $cache_data);
 }
 
+// ##### --------------------------------------------------------------------------------------------------------------
 
-// ==CNN Style Categories. ============================================================
- $nbr_cols = $pref['nbr_cols'];
- $nbr_lst = 5;
- $line_clr = "black";
-
-  if($pref['news_cats']=='1'){
-        $sql2 = new db;
-        $sql2 -> db_Select("news_category","*",  "category_id!='' ORDER BY category_name ASC");
-        $text3 .="<table border='0' style='width:96%' align='center' cellpadding='3' cellspacing='3'><tr>\n";
-                $t = 0;
-                while($row3 = $sql2-> db_Fetch()){
-                extract($row3);
-                $category_name = $aj -> tpa($category_name);
-                $category_icon = e_IMAGE."newsicons/".$category_icon;
-                $wid = floor(100/$nbr_cols);
-                $text3 .= "<td style='vertical-align:top; width:$wid%;'>\n";
-                $text3 .= "<div style='border-bottom:1px inset $line_clr; font-weight:bold;padding-bottom:1px;margin-bottom:5px'><img src='$category_icon' alt='' />&nbsp;<a href='news.php?cat.".$category_id."' style='text-decoration:none' >$category_name</a></div>";
-              //  $text3 .= "</td>";
-
-                                $count = $sql -> db_SELECT("news", "*",  "news_category='$category_id' AND (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().")  ORDER BY news_datestamp DESC LIMIT 0,$nbr_lst");
-                while($row = $sql-> db_Fetch()){
-                        extract($row);
-                        $text3 .="<div style='width:100%'><table style='width:100%' cellpadding='0' cellspacing='0' border='0'>\n";
-                                                        if(check_class($news_class)){
-                                                        $news_title = $aj -> tpa($news_title);
-                                                        if($news_title == ""){ $news_title = "Untitled"; }
-                                          //      $datestamp = $gen->convert_date($news_datestamp, "short");
-                                                        $text3 .= "<tr><td style='width:2px;vertical-align:top'></td>\n";
-                                                        $text3 .= "<td style='text-align:left;vertical-align:top;padding-left:2px'><a href='news.php?extend.".$news_id."'>".$news_title."</a></td></tr>\n";
-                                                        }
-                                                        $text3 .="</table></div>\n";
-                                }
-
-                       $text3 .="</td>";
-                       if($t == ($nbr_cols-1)){$text3 .="</tr><tr><td colspan='$nbr_cols' style='height:15px'></td></tr><tr>";
-                       $t =0;}else{
-                       $t++;
-                       }
-            }
-            $text3 .="</tr></table>";
-            $ns -> tablerender("News Categories", $text3);
-  }
-
-if(!$disablecache && !e_QUERY){
-        $cache = $aj -> formtpa(ob_get_contents(), "admin");
-        set_cache("news.php", $cache);
-}else{
-        clear_cache("news.php");
+// #### new: news archive ---------------------------------------------------------------------------------------------
+if ($action != "item" && $action != 'list' && $pref['newsposts_archive']) {
+	// do not show the newsarchive on the news.php?item.X page (but only on the news mainpage)
+	require_once(e_FILE.'shortcode/batch/news_archives.php');
+
+	$i = $interval + 1;
+	while(isset($newsAr[$i]))
+	{
+		$news2 = $newsAr[$i];
+		// Code from Lisa
+		// copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X
+		// instead of the actual hyperlink that may have been added to a newstitle on creation
+		$search = array();
+		$replace = array();
+		$search[0] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
+		$replace[0] = '\\2';
+		$search[1] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
+		$replace[1] = '\\2';
+		$search[2] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
+		$replace[2] = '\\2';
+		$search[3] = "/\<a href=&quot;(.*?)&quot;>(.*?)<\/a>/si";
+		$replace[3] = '\\2';
+		$search[4] = "/\<a href=&#39;(.*?)&#39;>(.*?)<\/a>/si";
+		$replace[4] = '\\2';
+		$news2['news_title'] = preg_replace($search, $replace, $news2['news_title']);
+		// End of code from Lisa
+
+		$gen = new convert;
+		$news2['news_datestamp'] = $gen->convert_date($news2['news_datestamp'], "short");
+
+
+		if(!$NEWSARCHIVE){
+			$NEWSARCHIVE ="<div>
+					<table style='width:98%;'>
+					<tr>
+					<td>
+					<div>{ARCHIVE_BULLET} <b>{ARCHIVE_LINK}</b> <span class='smalltext'><i>{ARCHIVE_AUTHOR} @ ({ARCHIVE_DATESTAMP}) ({ARCHIVE_CATEGORY})</i></span></div>
+					</td>
+					</tr>
+					</table>
+					</div>";
+
+		}
+		$textnewsarchive .= $tp->parseTemplate($NEWSARCHIVE, FALSE, $news_archive_shortcodes);
+		$i++;
+	}
+	$ns->tablerender($pref['newsposts_archive_title'], $textnewsarchive, 'news_archive');
+}
+// #### END -----------------------------------------------------------------------------------------------------------
+
+if ($action != "item") {
+	if (is_numeric($action)){
+		$action = "";
+	}
+	$parms = $news_total.",".ITEMVIEW.",".$from.",".e_SELF.'?'."[FROM].".$action.(isset($sub_action) ? ".".$sub_action : "");
+	$nextprev = $tp->parseTemplate("{NEXTPREV={$parms}}");
+	echo ($nextprev ? "<div class='nextprev'>".$nextprev."</div>" : "");
+}
+
+if(is_dir("remotefile")) {
+	require_once(e_HANDLER."file_class.php");
+	$file = new e_file;
+	$reject = array('$.','$..','/','CVS','thumbs.db','*._$', 'index', 'null*', 'Readme.txt');
+	$crem = $file -> get_files(e_BASE."remotefile", "", $reject);
+	if(count($crem)) {
+		foreach($crem as $loadrem) {
+			if(strstr($loadrem['fname'], "load_")) {
+				require_once(e_BASE."remotefile/".$loadrem['fname']);
+			}
+		}
+	}
+}
+
+if (isset($pref['nfp_display']) && $pref['nfp_display'] == 2) {
+	require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
 }
-// =========================================================================
 
+render_newscats();
 
 require_once(FOOTERF);
+
+
+// =========================================================================
+function setNewsCache($cache_tag, $cache_data) {
+	global $e107cache;
+	$e107cache->set($cache_tag, $cache_data);
+	$e107cache->set($cache_tag."_title", e_PAGETITLE);
+}
+
+function checkCache($cacheString){
+	global $pref,$e107cache;
+	$cache_data = $e107cache->retrieve($cacheString);
+	$cache_title = $e107cache->retrieve($cacheString."_title");
+	$etitle = ($cache_title != "e_PAGETITLE") ? $cache_title : "";
+	if($etitle){
+		define(e_PAGETITLE,$etitle);
+	}
+	if ($cache_data) {
+		return $cache_data;
+	} else {
+		return false;
+	}
+}
+
+function renderCache($cache, $nfp = FALSE){
+	global $pref,$tp,$sql;
+	echo $cache;
+	if ($nfp && $pref['nfp_display'] == 2) {
+		require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
+	}
+	render_newscats();
+	require_once(FOOTERF);
+	exit;
+}
+
+function render_newscats(){  // --  CNN Style Categories. ----
+	global $pref,$ns,$tp;
+	if (isset($pref['news_cats']) && $pref['news_cats'] == '1') {
+		$text3 = $tp->toHTML("{NEWS_CATEGORIES}", TRUE, 'parse_sc,nobreak');
+		$ns->tablerender(LAN_NEWS_23, $text3, 'news_cat');
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/oldpolls.php 75/oldpolls.php
--- 6171/oldpolls.php	2004-04-10 21:56:34.000000000 -0500
+++ 75/oldpolls.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,121 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/oldpolls.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-require_once(HEADERF);
-require_once(e_HANDLER."comment_class.php");
-$sql2 = new db; $cobj = new comment;
-$from = (!e_QUERY ? $from = 0 : $from = e_QUERY);
-
-$poll_total = $sql -> db_Count("poll", "(*)", "WHERE poll_active=0 AND poll_end_datestamp !=0");
-
-$p_query = e_PAGE.(e_QUERY ? "?".e_QUERY : "");
-
-if($cache = retrieve_cache($p_query)){
-	echo $cache;
-	require_once(e_HANDLER."np_class.php");
-	$ix = new nextprev("oldpolls.php", $from, 10, $poll_total, LAN_96);
-	require_once(FOOTERF);
-	exit;
-}
-
-ob_start();
-
-if(!$poll_total){
-	$ns -> tablerender(LAN_92, "<div style='text-align:center'>".LAN_93."</div>");
-	require_once(FOOTERF);
-	exit;
-}
-
-$sql -> db_Select("poll", "*", "poll_active='0' ORDER BY poll_datestamp DESC LIMIT $from, 10");
-
-$sql2 = new db;
-while(list($poll_id, $poll_datestamp, $poll_end_datestamp, $poll_admin_id, $poll_title, $poll[1], $poll[2], $poll[3], $poll[4], $poll[5], $poll[6], $poll[7], $poll[8], $poll[9], $poll[10], $votes[1], $votes[2], $votes[3], $votes[4], $votes[5], $votes[6], $votes[7], $votes[8], $votes[9], $votes[10], $poll_ip, $poll_active) = $sql-> db_Fetch()){
-	
-	$p_total = array_sum($votes);
-	if ($p_total > 0){
-			
-		for($counter=1; $counter<=10; $counter++){
-			$percen[$counter] = round(($votes[$counter]/$p_total)*100,2);
-		}
-	}
-
-	$obj = new convert;
-	$datestamp = $obj -> convert_date($poll_datestamp, "long");
-	$end_datestamp = $obj -> convert_date($poll_end_datestamp, "long");
-
-	$sql2 -> db_Select("user", "*",  "user_id='$poll_admin_id' ");
-	$row = $sql2 -> db_Fetch();
-	extract($row);
-
-	$text = "<table style='width:95%'>
-	<tr>
-	<td colspan='2' class='mediumtext' style='text-align:center'>
-	<b>".stripslashes($poll_title)."</b>
-	<div class='smalltext'>".LAN_94." <a href='".e_BASE."user.php?id.$user_id'>".$user_name."</a>. ".LAN_99.$datestamp.LAN_100.$end_datestamp.". ".LAN_95." $p_total</div>
-	<br />
-
-	</td>
-	</tr>";
-	$c = 1;
-	while($poll[$c]){
-		$text .= "<tr> 
-		<td style='width:40% 'class='mediumtext'>
-		<b>".stripslashes($poll[$c])."</b>
-		</td>
-		<td class='smalltext'>
-		<img src='".THEME."/images/bar.jpg' height='12' width='";
-					
-		if(($percen[$c]*3) > 180){
-			$perc = 180;
-		}else{
-			$perc = ($percen[$c]*3);
-		}			
-		
-		$text .= $perc."' border='1'> ".$percen[$c]."% [Votes: ".$votes[$c]."]</div>
-		</td>
-		</tr>";
-		$c++;
-
-	}
-
-	$field = $poll_id;
-	$comtype = 4;
-	$comment_total = $sql2 -> db_Select("comments", "*",  "comment_item_id='$field' AND comment_type='$comtype' ORDER BY comment_datestamp");
-	if($comment_total){
-		$text .= "<tr><td colspan='2'>
-		<input class='button' type ='button' style=''width: 35px'; cursor:hand' size='30' value='".LAN_97." ($comment_total)' onClick='expandit(this)'>
-		<div style='display:none' style=&{head};'>";
-		while($row = $sql2 -> db_Fetch()){
-			$text .= $cobj -> render_comment($row);
-		}
-		$text .= "</div></td></tr>";
-	}
-
-	$text .= "</table>";
-	$ns -> tablerender(LAN_98." #".$poll_id, $text);
-}
-
-if($pref['cachestatus']){
-	set_cache($p_query,ob_get_contents());
-}
-
-
-require_once(e_HANDLER."np_class.php");
-$ix = new nextprev("oldpolls.php", $from, 10, $poll_total, LAN_96);
-
-
-
-require_once(FOOTERF);
-?>
\ No newline at end of file
diff -ruN 6171/online.php 75/online.php
--- 6171/online.php	2004-05-27 01:46:54.000000000 -0500
+++ 75/online.php	2005-12-24 16:53:38.000000000 -0600
@@ -1,198 +1,282 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /online.php
-|
-|        e107 dev team 2004
-|        http://e107.org
-|
-|                 Some code from exonline menu by :
-|             Patrick Weaver
-|                 http://painswitch.com/
-|                 patrick@painswitch.com
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-require_once(HEADERF);
-$text = "<div style='text-align:center'><table class='fborder' style='width:96%'><tr>
-<td class='forumheader' style='width:3%'>&nbsp;</td>
-<td class='forumheader' style='width:43%'>".ONLINE_EL10."</td>
-<td class='forumheader' style='width:50%'>".ONLINE_EL11."</td>
-</tr>";
-global $listuserson;
-foreach($listuserson as $uinfo => $pinfo){	
-	$class_check = TRUE;
-	list($oid,$oname) = explode(".",$uinfo,2);
-	$sql2 = new db;
-	$sql2 -> db_Select("user", "user_id", "user_admin > '0' ");
-	$row_2 = $sql2 -> db_Fetch();
-	$online_location = $pinfo;
-	$online_location_page = substr(strrchr($online_location, "/"), 1);
-	if(!strstr($online_location, "forum_") || !strstr($online_location, "content.php") || !strstr($online_location, "comment.php")){ $online_location_page = eregi_replace(".php", "", substr(strrchr($online_location, "/"), 1)); }
-	if($online_location_page == "log" || $online_location_page == "error"){ $online_location = "news.php"; $online_location_page = NEWS;  }
-	if($online_location_page == "request"){ $online_location = "download.php"; }
-	if($online_location_page == "article"){$online_location_page = ARTICLEPAGE;}
-	if($online_location_page == "chat"){$online_location_page = CHAT;}
-	//if($online_location_page == "comment"){$online_location_page = COMMENT;}
-	if($online_location_page == "content"){$online_location_page = CONTENT;}
-	if($online_location_page == "download"){$online_location_page = DOWNLOAD;}
-	if($online_location_page == "email"){$online_location_page = EMAIL;}
-	if($online_location_page == "forum"){$online_location_page = FORUM;}
-	if($online_location_page == "links"){$online_location_page = LINKS;}
-	if($online_location_page == "news"){$online_location_page = NEWS;}
-	if($online_location_page == "oldpolls"){$online_location_page = OLDPOLLS;}
-	if($online_location_page == "print"){$online_location_page = PRINTPAGE;}
-	if($online_location_page == "login"){$online_location_page = LOGIN;}
-	if($online_location_page == "search"){$online_location_page = SEARCH;}
-	if($online_location_page == "stats"){$online_location_page = STATS;}
-	if($online_location_page == "submitnews"){$online_location_page = SUBMITNEWS;}
-	if($online_location_page == "upload"){$online_location_page = UPLOAD;}
-	if($online_location_page == "user"){$online_location_page = USERPAGE;}
-	if($online_location_page == "usersettings"){$online_location_page = USERSETTINGS;}
-	if($online_location_page == "new"){$online_location_page = LISTNEW;}
-	if($online_location_page == "online"){$online_location_page = ONLINE;}
-	if($online_location_page == "userposts"){$online_location_page = USERPOSTS;}
-	if($online_location_page == "subcontent"){$online_location_page = SUBCONTENT;}
-	if($online_location_page == "top"){$online_location_page = TOP;}
-	//commonly used plugin pages
-	if($online_location_page == "bugtracker"){$online_location_page = BUGTRACKER;}
-	if($online_location_page == "event"){$online_location_page = EVENT;}
-	if($online_location_page == "calendar"){$online_location_page = CALENDAR;}
-	if($online_location_page == "faq"){$online_location_page = FAQ;}
-	if($online_location_page == "pm"){$online_location_page = PM;}
-	if($online_location_page == "survey"){$online_location_page = SURVEY;}
-	if(strstr($online_location, "content.php")){
-		$tmp = explode(".", substr(strrchr($online_location, "php."), 2));
-		if($tmp[0] == "article"){
-			$sql -> db_Select("content", "content_heading, content_class", "content_id='".$tmp[1]."'");
-			list($content['content_heading'], $content['content_class']) = $sql -> db_Fetch();
-			$online_location_page = ARTICLE.": ".$content['content_heading'];
-			$online_location = str_replace("php.", "php?", $online_location);
-			if(!check_class($content['content_class'])){
-				$class_check = FALSE;
-				$online_location_page = ARTICLE.": \"".CLASSRESTRICTED."\"";
-			}
-		}elseif($tmp[0] == "review"){
-			$sql -> db_Select("content", "content_heading, content_class", "content_id='".$tmp[1]."'");
-			list($content['content_heading'], $content['content_class']) = $sql -> db_Fetch();
-			$online_location_page = REVIEW.": ".$content['content_heading'];
-			$online_location = str_replace("php.", "php?", $online_location);
-			if(!check_class($content['content_class'])){
-				$class_check = FALSE;
-				$online_location_page = REVIEW.": \"".CLASSRESTRICTED."\"";
-			}
-		}elseif($tmp[0] == "content"){
-			$sql -> db_Select("content", "content_heading, content_class", "content_id='".$tmp[1]."'");
-			list($content['content_heading'], $content['content_class']) = $sql -> db_Fetch();
-			$online_location_page = CONTENT.": ".$content['content_heading'];
-			$online_location = str_replace("php.", "php?", $online_location);
-			if(!check_class($content['content_class'])){
-				$class_check = FALSE;
-				$online_location_page = CONTENT.": \"".CLASSRESTRICTED."\"";
-			}
-		}
-	}
-	if(strstr($online_location, "comment.php")){
-		$tmp = explode(".php.", $online_location);
-		$tmp = explode(".", $tmp[1]);
-		if($tmp[1] == "news"){
-			$id = ($tmp[0] == "reply" ? $tmp[3] : $tmp[2]);
-			$sql -> db_Select("news", "news_title, news_class", "news_id='".$id."'");
-			list($news['news_title'], $news['news_class']) = $sql -> db_Fetch();
-			$online_location_page = ($tmp[0] == "reply" ? COMMENT.": ".ONLINE_EL12." > ".$news['news_title'] : COMMENT.": ".$news['news_title']);
-			$online_location = "comment.php?comment.news.$id";
-			if(!check_class($news['news_class'])){
-				$class_check = FALSE;
-				$online_location_page = COMMENT.": \"".CLASSRESTRICTED."\"";
-			}
-		}elseif($tmp[1] == "poll"){
-			$id = ($tmp[0] == "reply" ? $tmp[3] : $tmp[2]);
-			$sql -> db_Select("poll", "poll_title", "poll_id='".$id."'");
-			list($poll['poll_title']) = $sql -> db_Fetch();
-			$online_location_page = POLLCOMMENT.": ".$poll['poll_title'];
-			$online_location = "comment.php?comment.poll.$id";
-		}else{
-			$online_location_page = COMMENT;
-			$class_check = FALSE;
-		}
-	}
-	if(strstr($online_location, "forum")){
-		$tmp = explode(".", substr(strrchr($online_location, "php."), 2));
-        if(strstr($online_location, "_viewtopic")){
-			if($tmp[2]){
-				$pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
-                $t_page = $tmp[2]/$pref['forum_postspage'] +1;
-            }else{
-				$t_page = 1;
-            }
-				$sql -> db_Select("forum_t", "thread_name", "thread_id='$tmp[1]' AND thread_parent='0'");
-				list($forum_t['thread_name']) = $sql -> db_Fetch();
-				$sql -> db_Select("forum", "forum_name, forum_class", "forum_id='".$tmp[0]."'");
-				list($forum['forum_name'], $forum['forum_class']) = $sql -> db_Fetch();
-				$online_location_page = ONLINE_EL13." .:. ".$forum['forum_name']." -> ".ONLINE_EL14." .:. ".$forum_t['thread_name']." -> ".ONLINE_EL15.": ".$t_page;
-				$online_location = str_replace("php.", "php?", $online_location);
-				if(!check_class($forum['forum_class'])){
-					$class_check = FALSE;
-					$online_location_page = ONLINE_EL13.": \"".CLASSRESTRICTED."\"";
-				}
-		}elseif(strstr($online_location, "_viewforum")){
-				$sql -> db_Select("forum", "forum_name, forum_class", "forum_id='".$tmp[0]."' ");
-				list($forum['forum_name'], $forum['forum_class']) = $sql -> db_Fetch();
-				$online_location_page = ONLINE_EL13." .:. ".$forum['forum_name'];
-				$online_location = str_replace("php.", "php?", $online_location);
-				if(!check_class($forum['forum_class'])){
-					$class_check = FALSE;
-					$online_location_page = ONLINE_EL13.": \"".CLASSRESTRICTED."\"";
-				}
-		}elseif(strstr($online_location, "_post")){
-				$sql -> db_Select("forum_t", "thread_name, thread_forum_id", "thread_forum_id='$tmp[0]' AND thread_parent='0'");
-				list($forum_t['thread_name'],$forum_t['thread_forum_id']) = $sql -> db_Fetch();
-				$sql -> db_Select("forum", "forum_name", "forum_id='".$forum_t['thread_forum_id']."'");
-				list($forum['forum_name']) = $sql -> db_Fetch();
-				$online_location_page = ONLINE_EL12.": ".ONLINE_EL13." .:. ".$forum['forum_name']." -> ".ONLINE_EL14." .:. ".$forum_t['thread_name'];
-				$online_location = "forum_viewtopic.php?$tmp[0].$tmp[1]";
-			}
-		}
-		if(strstr($online_location, "admin")){
-			$class_check = FALSE;
-			$online_location_page = ADMINAREA;
-		}
-		$pm_installed = ($pref['pm_title'] ? TRUE : FALSE);
-		$icon = ($pm_installed && $oid != USERID ? e107_parse("{CODE=pm_menu.sendpm.{$oid}}") : "<img src='".e_PLUGIN."online_extended_menu/images/user.png' alt='' style='vertical-align:middle' />");
-		$text .= "<tr><td class='forumheader3' style='width:3%;text-align:center'>".$icon."
-		</td>
-		<td class='forumheader3' style='width:45%'><a href='".e_BASE."user.php?id.$oid'>$oname</a></td>
-		<td class='forumheader3' style='width:50%'>".($class_check ? "<a href='$online_location'>$online_location_page</a>" : $online_location_page)."<br /></td></tr>";
-}
-$text .= "</table></div><br />";
-$text .= ONLINE_EL1.GUESTS_ONLINE.", ";
-$text .= ONLINE_EL2.MEMBERS_ONLINE." ...<br />";
-if((MEMBERS_ONLINE + GUESTS_ONLINE) > ($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])){
-	$menu_pref['most_members_online'] = MEMBERS_ONLINE;
-	$menu_pref['most_guests_online'] = GUESTS_ONLINE;
-	$menu_pref['most_online_datestamp'] = time();
-	$tmp = addslashes(serialize($menu_pref));
-	$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='menu_pref' ");
-}
-
-if(!is_object($gen)){$gen = new convert;}
-
-        $datestamp = $gen->convert_date($menu_pref['most_online_datestamp'], "short");
-
-        $text .= "<br />".ONLINE_EL8.": ".($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])."<br />(".strtolower(ONLINE_EL2).$menu_pref['most_members_online'].", ".strtolower(ONLINE_EL1).$menu_pref['most_guests_online'].") ".ONLINE_EL9." ".$datestamp."<br />";
-
-        $total_members = $sql -> db_Count("user");
-
-        if($total_members > 1){
-                $newest_member = $sql -> db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
-                $row = $sql -> db_Fetch(); extract($row);
-                $text .= "<br />".ONLINE_EL5.": ".$total_members."<br />".ONLINE_EL6.": <a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>";
-        }
-
-        $ns -> tablerender(ONLINE_EL4, $text);
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/online.php,v $
+|     $Revision: 1.13 $
+|     $Date: 2005/12/24 22:53:38 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+require_once(HEADERF);
+
+global $listuserson;
+
+foreach($listuserson as $uinfo => $pinfo) {
+	$class_check = TRUE;
+	list($oid, $oname) = explode(".", $uinfo, 2);
+	$sql2 = new db;
+	$sql2->db_Select("user", "user_id", "user_admin > '0' ");
+	$row_2 = $sql2->db_Fetch();
+	$online_location = $pinfo;
+	$online_location_page = substr(strrchr($online_location, "/"), 1);
+	if (!strstr($online_location, "forum_") || !strstr($online_location, "content.php") || !strstr($online_location, "comment.php")) {
+		$online_location_page = str_replace(".php", "", substr(strrchr($online_location, "/"), 1));
+	}
+	if ($online_location_page == "log" || $online_location_page == "error") {
+		$online_location = "news.php";
+		$online_location_page = NEWS;
+	}
+	if ($online_location_page == "request") {
+		$online_location = "download.php";
+	}
+	if ($online_location_page == "article") {
+		$online_location_page = ARTICLEPAGE;
+	}
+	if ($online_location_page == "chat") {
+		$online_location_page = CHAT;
+	}
+	//if($online_location_page == "comment"){$online_location_page = COMMENT;}
+	if ($online_location_page == "content") {
+		$online_location_page = CONTENT;
+	}
+	if ($online_location_page == "download") {
+		$online_location_page = DOWNLOAD;
+	}
+	if ($online_location_page == "email") {
+		$online_location_page = EMAIL;
+	}
+	if ($online_location_page == "forum") {
+		$online_location_page = FORUM;
+	}
+	if ($online_location_page == "links") {
+		$online_location_page = LINKS;
+	}
+	if ($online_location_page == "news") {
+		$online_location_page = NEWS;
+	}
+	if ($online_location_page == "oldpolls") {
+		$online_location_page = OLDPOLLS;
+	}
+	if ($online_location_page == "print") {
+		$online_location_page = PRINTPAGE;
+	}
+	if ($online_location_page == "login") {
+		$online_location_page = LOGIN;
+	}
+	if ($online_location_page == "search") {
+		$online_location_page = SEARCH;
+	}
+	if ($online_location_page == "stats") {
+		$online_location_page = STATS;
+	}
+	if ($online_location_page == "submitnews") {
+		$online_location_page = SUBMITNEWS;
+	}
+	if ($online_location_page == "upload") {
+		$online_location_page = UPLOAD;
+	}
+	if ($online_location_page == "user") {
+		$online_location_page = USERPAGE;
+	}
+	if ($online_location_page == "usersettings") {
+		$online_location_page = USERSETTINGS;
+	}
+	if ($online_location_page == "new") {
+		$online_location_page = LISTNEW;
+	}
+	if ($online_location_page == "online") {
+		$online_location_page = ONLINE;
+	}
+	if ($online_location_page == "userposts") {
+		$online_location_page = USERPOSTS;
+	}
+	if ($online_location_page == "subcontent") {
+		$online_location_page = SUBCONTENT;
+	}
+	if ($online_location_page == "top") {
+		$online_location_page = TOP;
+	}
+	//commonly used plugin pages
+	if ($online_location_page == "bugtracker") {
+		$online_location_page = BUGTRACKER;
+	}
+	if ($online_location_page == "event") {
+		$online_location_page = EVENT;
+	}
+	if ($online_location_page == "calendar") {
+		$online_location_page = CALENDAR;
+	}
+	if ($online_location_page == "faq") {
+		$online_location_page = FAQ;
+	}
+	if ($online_location_page == "pm") {
+		$online_location_page = PM;
+	}
+	if ($online_location_page == "survey") {
+		$online_location_page = SURVEY;
+	}
+	if (strstr($online_location, "content.php")) {
+		$tmp = explode(".", substr(strrchr($online_location, "php."), 2));
+		if ($tmp[0] == "article") {
+			$sql->db_Select("content", "content_heading, content_class", "content_id='".intval($tmp[1])."'");
+			list($content['content_heading'], $content['content_class']) = $sql->db_Fetch();
+			$online_location_page = ARTICLE.": ".$content['content_heading'];
+			$online_location = str_replace("php.", "php?", $online_location);
+			if (!check_class($content['content_class'])) {
+				$class_check = FALSE;
+				$online_location_page = ARTICLE.": \"".CLASSRESTRICTED."\"";
+			}
+		} elseif($tmp[0] == "review") {
+			$sql->db_Select("content", "content_heading, content_class", "content_id='".intval($tmp[1])."'");
+			list($content['content_heading'], $content['content_class']) = $sql->db_Fetch();
+			$online_location_page = REVIEW.": ".$content['content_heading'];
+			$online_location = str_replace("php.", "php?", $online_location);
+			if (!check_class($content['content_class'])) {
+				$class_check = FALSE;
+				$online_location_page = REVIEW.": \"".CLASSRESTRICTED."\"";
+			}
+		} elseif($tmp[0] == "content") {
+			$sql->db_Select("content", "content_heading, content_class", "content_id='".intval($tmp[1])."'");
+			list($content['content_heading'], $content['content_class']) = $sql->db_Fetch();
+			$online_location_page = CONTENT.": ".$content['content_heading'];
+			$online_location = str_replace("php.", "php?", $online_location);
+			if (!check_class($content['content_class'])) {
+				$class_check = FALSE;
+				$online_location_page = CONTENT.": \"".CLASSRESTRICTED."\"";
+			}
+		}
+	}
+	if (strstr($online_location, "comment.php")) {
+		$tmp = explode(".php.", $online_location);
+		$tmp = explode(".", $tmp[1]);
+		if ($tmp[1] == "news") {
+			$id = ($tmp[0] == "reply" ? $tmp[3] : $tmp[2]);
+			$sql->db_Select("news", "news_title, news_class", "news_id='".intval($id)."'");
+			list($news['news_title'], $news['news_class']) = $sql->db_Fetch();
+			$online_location_page = ($tmp[0] == "reply" ? COMMENT.": ".ONLINE_EL12." > ".$news['news_title'] : COMMENT.": ".$news['news_title']);
+			$online_location = "comment.php?comment.news.$id";
+			if (!check_class($news['news_class'])) {
+				$class_check = FALSE;
+				$online_location_page = COMMENT.": \"".CLASSRESTRICTED."\"";
+			}
+		} elseif($tmp[1] == "poll") {
+			$id = ($tmp[0] == "reply" ? $tmp[3] : $tmp[2]);
+			$sql->db_Select("poll", "poll_title", "poll_id='".intval($id)."'");
+			list($poll['poll_title']) = $sql->db_Fetch();
+			$online_location_page = POLLCOMMENT.": ".$poll['poll_title'];
+			$online_location = "comment.php?comment.poll.$id";
+		} else {
+			$online_location_page = COMMENT;
+			$class_check = FALSE;
+		}
+	}
+	if (strstr($online_location, "forum")) {
+		$tmp = explode(".", substr(strrchr($online_location, "php."), 2));
+		if (strstr($online_location, "_viewtopic")) {
+			if ($tmp[2]) {
+				$pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
+				$t_page = $tmp[2]/$pref['forum_postspage'] +1;
+			} else {
+				$t_page = 1;
+			}
+			$qry = "
+			SELECT t.thread_name, f.forum_name, f.forum_class from #forum_t AS t
+			LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
+			WHERE t.thread_id = '".intval($tmp[0])."'
+			";
+			$sql->db_Select_gen($qry);
+			$forum = $sql->db_Fetch();
+			$online_location_page = ONLINE_EL13." .:. ".$forum['forum_name']."->".ONLINE_EL14." .:. ".$forum['thread_name']."->".ONLINE_EL15.": ".$t_page;
+			$online_location = str_replace("php.", "php?", $online_location);
+			if (!check_class($forum['forum_class'])) {
+				$class_check = FALSE;
+				$online_location_page = ONLINE_EL13.": \"".CLASSRESTRICTED."\"";
+			}
+		} elseif(strstr($online_location, "_viewforum")) {
+			$sql->db_Select("forum", "forum_name, forum_class", "forum_id='".intval($tmp[0])."' ");
+			list($forum['forum_name'], $forum['forum_class']) = $sql->db_Fetch();
+			$online_location_page = ONLINE_EL13." .:. ".$forum['forum_name'];
+			$online_location = str_replace("php.", "php?", $online_location);
+			if (!check_class($forum['forum_class'])) {
+				$class_check = FALSE;
+				$online_location_page = ONLINE_EL13.": \"".CLASSRESTRICTED."\"";
+			}
+		} elseif(strstr($online_location, "_post")) {
+			$sql->db_Select("forum_t", "thread_name, thread_forum_id", "thread_forum_id='".intval($tmp[0])."' AND thread_parent='0'");
+			list($forum_t['thread_name'], $forum_t['thread_forum_id']) = $sql->db_Fetch();
+			$sql->db_Select("forum", "forum_name", "forum_id='".$forum_t['thread_forum_id']."'");
+			list($forum['forum_name']) = $sql->db_Fetch();
+			$online_location_page = ONLINE_EL12.": ".ONLINE_EL13." .:. ".$forum['forum_name']."->".ONLINE_EL14." .:. ".$forum_t['thread_name'];
+			$online_location = e_PLUGIN."forum/forum_viewtopic.php?$tmp[0].$tmp[1]";
+		}
+	}
+	if (strstr($online_location, "admin")) {
+		$class_check = FALSE;
+		$online_location_page = ADMINAREA;
+	}
+	$pm_installed = ($pref['pm_title'] ? TRUE : FALSE);
+	$ONLINE_TABLE_ICON = ($pm_installed && $oid != USERID ? $tp->parseTemplate("{pm_menu.sendpm={$oid}}") : "<img src='".e_PLUGIN."online_extended_menu/images/user.png' alt='' style='vertical-align:middle' />");
+	 
+	$ONLINE_TABLE_USERNAME = "<a href='".e_BASE."user.php?id.$oid'>$oname</a>";
+	$ONLINE_TABLE_LOCATION = ($class_check ? "<a href='$online_location'>$online_location_page</a>" : $online_location_page);
+	 
+	if (!$ONLINE_TABLE) {
+		if (file_exists(THEME."online_template.php")) {
+			require_once(THEME."online_template.php");
+		} else {
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/online_template.php");
+		}
+	}
+	$textstring .= preg_replace("/\{(.*?)\}/e", '$\1', $ONLINE_TABLE);
+}
+	
+$ONLINE_TABLE_MEMBERS_ONLINE = ONLINE_EL1.GUESTS_ONLINE;
+$ONLINE_TABLE_GUESTS_ONLINE = ONLINE_EL2.MEMBERS_ONLINE;
+if ((MEMBERS_ONLINE + GUESTS_ONLINE) > ($menu_pref['most_members_online'] + $menu_pref['most_guests_online'])) {
+	global $sysprefs;
+	$menu_pref['most_members_online'] = MEMBERS_ONLINE;
+	$menu_pref['most_guests_online'] = GUESTS_ONLINE;
+	$menu_pref['most_online_datestamp'] = time();
+	$sysprefs->setArray('menu_pref');
+}
+	
+if (!is_object($gen)) {
+	$gen = new convert;
+}
+	
+$datestamp = $gen->convert_date($menu_pref['most_online_datestamp'], "short");
+	
+$ONLINE_TABLE_MOST_EVER_ONLINE = ONLINE_EL8.($menu_pref['most_members_online'] + $menu_pref['most_guests_online']);
+$ONLINE_TABLE_MOST_MEMBERS_ONLINE = strtolower(ONLINE_EL2).$menu_pref['most_members_online'];
+$ONLINE_TABLE_MOST_GUESTS_ONLINE = strtolower(ONLINE_EL1).$menu_pref['most_guests_online'];
+$ONLINE_TABLE_DATESTAMP = $datestamp;
+	
+$total_members = $sql->db_Count("user");
+	
+if ($total_members > 1) {
+	$newest_member = $sql->db_Select("user", "user_id, user_name", "user_ban='0' ORDER BY user_join DESC LIMIT 0,1");
+	$row = $sql->db_Fetch();
+	 extract($row);
+	 
+	$ONLINE_TABLE_MEMBERS_TOTAL = "<br />".ONLINE_EL5.": ".$total_members;
+	$ONLINE_TABLE_MEMBERS_NEWEST = "<br />".ONLINE_EL6.": ".(USER ? "<a href='".e_BASE."user.php?id.".$user_id."'>".$user_name."</a>" : $user_name);
+}
+	
+$textstart = preg_replace("/\{(.*?)\}/e", '$\1', $ONLINE_TABLE_START);
+$textend = preg_replace("/\{(.*?)\}/e", '$\1', $ONLINE_TABLE_END);
+$text = $textstart.$textstring.$textend;
+	
+$ns->tablerender(ONLINE_EL4, $text);
+	
+require_once(FOOTERF);
 ?>
\ No newline at end of file
diff -ruN 6171/page.php 75/page.php
--- 6171/page.php	1969-12-31 18:00:00.000000000 -0600
+++ 75/page.php	2006-05-16 10:55:05.000000000 -0500
@@ -0,0 +1,389 @@
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/page.php,v $
+|     $Revision: 1.27 $
+|     $Date: 2006/05/16 15:55:05 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+$page = new pageClass();
+if(isset($_POST['enterpw']))
+{
+	$page -> setPageCookie();
+}
+
+if(!e_QUERY)
+{
+	require_once(HEADERF);
+	$tmp = $page -> listPages();
+	if(is_array($tmp))
+	{
+		$ns -> tablerender($tmp['title'], $tmp['text']);
+		require_once(FOOTERF);
+		exit;
+	}
+}
+else
+{
+
+	$cacheString = 'page_'.$page->pageID;
+	$cachePageTitle = 'page-t_'.$page->pageID;
+
+    if($cacheData = $e107cache->retrieve($cacheString)){
+
+        list($pagetitle,$comment_flag) = explode("^",$e107cache->retrieve($cachePageTitle));
+		define("e_PAGETITLE", $pagetitle);
+		require_once(HEADERF);
+       	echo $cacheData;
+
+	}else{
+
+		$tmp = $page -> showPage();
+		define("e_PAGETITLE", $tmp['title']);
+		require_once(HEADERF);
+		ob_start();
+		$ns -> tablerender($tmp['title'], $tmp['text']);
+    	$cache_data = ob_get_flush();
+		$e107cache->set($cacheString, $cache_data);
+    	$e107cache->set($cachePageTitle, $tmp['title']."^".$tmp['comment_flag']);
+        $comment_flag = $tmp['comment_flag'];
+	}
+
+	if($com = $page -> pageComment($comment_flag)){
+		echo $com['comment'].$com['comment_form'];
+	}
+}
+
+require_once(FOOTERF);
+
+/* EOF */
+
+class pageClass
+{
+
+	var $bullet;																/* bullet image */
+	var $pageText;														/* main text of selected page, not parsed */
+	var $multipageFlag;												/* flag - true if multiple page page, false if not */
+	var $pageTitles;														/* array containing page titles */
+	var $pageID;															/* id number of page to be displayed */
+	var $pageSelected;												/* selected page of multiple page page */
+	var $pageToRender;												/* parsed page to be sent to screen */
+	var $debug;															/* temp debug flag */
+	var $title;																/* title of page, it if has one (as defined in [newpage=title] tag */
+
+
+	function pageClass($debug=FALSE)
+	{
+		/* constructor */
+
+		$tmp = explode(".", e_QUERY);
+		$this -> pageID = intval($tmp[0]);
+		$this -> pageSelected = (isset($tmp[1]) ? intval($tmp[1]) : 0);
+		$this -> bullet = (defined("BULLET") ? "<img src='".THEME."images/".BULLET."' alt='' style='vertical-align: middle;' />" : "<img src='".THEME."images/bullet2.gif' alt='bullet' style='vertical-align: middle;' />");
+		$this -> debug = $debug;
+
+		if($this -> debug)
+		{
+			$this -> debug = "<b>PageID</b> ".$this -> pageID." <br />";
+			$this -> debug .= "<b>pageSelected</b> ".$this -> pageSelected." <br />";
+		}
+	}
+
+	function listPages()
+	{
+		global $pref, $sql, $ns;
+
+		if(!$pref['listPages'])
+		{
+			message_handler("MESSAGE", LAN_PAGE_1);
+		}
+		else
+		{
+			if(!$sql -> db_Select("page", "*", "page_theme='' AND page_class IN (".USERCLASS_LIST.") "))
+			{
+				$text = LAN_PAGE_2;
+			}
+			else
+			{
+				$pageArray = $sql -> db_getList();
+				foreach($pageArray as $page)
+				{
+					extract($page);
+					$text .= $this -> bullet." <a href='".e_BASE."page.php?".$page_id."'>".$page_title."</a><br />";
+				}
+				$ns -> tablerender(LAN_PAGE_11, $text);
+			}
+		}
+	}
+
+
+	function showPage()
+	{
+		global $sql, $ns;
+		$query = "SELECT p.*, u.user_id, u.user_name FROM #page AS p
+		LEFT JOIN #user AS u ON p.page_author = u.user_id
+		WHERE p.page_id='".intval($this -> pageID)."' AND p.page_class IN (".USERCLASS_LIST.") ";
+
+		if(!$sql -> db_Select_gen($query) && !$_GET['elan'])
+		{
+			require_once(HEADERF);
+			message_handler("MESSAGE", LAN_PAGE_3);
+			require_once(FOOTERF); 
+			exit;
+		}
+
+		extract($sql -> db_Fetch());
+
+		$this -> pageText = $page_text;
+
+		$this -> pageCheckPerms($page_class, $page_password);
+
+		if($this -> debug)
+		{
+			echo "<b>pageText</b> ".$this -> pageText." <br />";
+		}
+
+		$this -> parsePage();
+
+		$gen = new convert;
+
+		if($page_author)
+		{
+			$text = "<div class='smalltext' style='text-align:right'>".$user_name.", ".$gen->convert_date($page_datestamp, "long")."</div><br />";
+		}
+
+		if($this -> title)
+		{
+			$text .= "<b>".$this -> title."</b><br /><br />";
+		}
+
+		$text .= $this -> pageToRender;
+		$text .= $this -> pageIndex();
+		$text .= $this -> pageRating($page_rating_flag);
+
+		$ret['title'] = $page_title;
+		$ret['text'] = $text;
+        $ret['comment_flag'] = $page_comment_flag;
+
+	 	return $ret;
+	}
+
+	function parsePage()
+	{
+		global $tp;
+		if(preg_match_all("/\[newpage.*?\]/si", $this -> pageText, $pt))
+		{
+			$pages = preg_split("/\[newpage.*?\]/si", $this -> pageText, -1, PREG_SPLIT_NO_EMPTY);
+			$this -> multipageFlag = TRUE;
+		}
+		else
+		{
+			$this -> pageToRender = $tp -> toHTML($this -> pageText, TRUE, 'parse_sc, constants');
+			return;
+		}
+
+		foreach($pt[0] as $title)
+		{
+			$this -> pageTitles[] = $title;
+		}
+
+
+		if(!trim($pages[0]))
+		{
+			$count = 0;
+			foreach($pages as $page)
+			{
+				$pages[$count] = $pages[($count+1)];
+				$count++;
+			}
+			unset($pages[(count($pages)-1)]);
+		}
+
+		$pageCount = count($pages);
+		$titleCount = count($this -> pageTitles);
+		/* if the vars above don't match, page 1 has no [newpage] tag, so we need to create one ... */
+
+		if($pageCount != $titleCount)
+		{
+			array_unshift($this -> pageTitles, "[newpage]");
+		}
+
+		/* ok, titles now match pages, rename the titles if needed ... */
+
+		$count =0;
+		foreach($this -> pageTitles as $title)
+		{
+			$titlep = preg_replace("/\[newpage=(.*?)\]/", "\\1", $title);
+			$this -> pageTitles[$count] = ($titlep == "[newpage]" ? "Page ".($count+1)."&nbsp;" : $tp -> toHTML($titlep, TRUE, 'parse_sc, constants'));
+			$count++;
+		}
+
+		$this -> pageToRender = $tp -> toHTML($pages[$this -> pageSelected], TRUE, 'parse_sc, constants');
+		$this -> title = (substr($this -> pageTitles[$this -> pageSelected], -1) == ";" ? "" : $this -> pageTitles[$this -> pageSelected]);
+
+		if($this -> debug)
+		{
+			echo "<b>multipageFlag</b> ".$this -> multipageFlag." <br />";
+			if($this -> multipageFlag)
+			{
+				echo "<pre>"; print_r($pages); echo "</pre>";
+				echo "<b>pageCount</b> ".$pageCount." <br />";
+				echo "<b>titleCount</b> ".$titleCount." <br />";
+				echo "<pre>"; print_r($this -> pageTitles); echo "</pre>";
+			}
+		}
+	}
+
+	function pageIndex()
+	{
+		$itext = "<br /><br />";
+		$count = 0;
+		foreach($this -> pageTitles as $title)
+		{
+			$itext .= $this -> bullet." ".($count == $this -> pageSelected ? $title : "<a href='".e_SELF."?".$this -> pageID.".".$count."'>".$title."</a>")."<br />\n";
+			$count++;
+		}
+		return $itext;
+	}
+
+	function pageRating($page_rating_flag)
+	{
+		if($page_rating_flag)
+		{
+			require_once(e_HANDLER."rate_class.php");
+			$rater = new rater;
+			$rate_text = "<br /><table style='width:100%'><tr><td style='width:50%'>";
+
+			if ($ratearray = $rater->getrating("page", $this -> pageID))
+			{
+				if ($ratearray[2] == "")
+				{
+					$ratearray[2] = 0;
+				}
+				$rate_text .= "<img src='".e_IMAGE."rate/box/box".$ratearray[1].".png' alt='' style='vertical-align:middle;' />\n";
+				$rate_text .= "&nbsp;".$ratearray[1].".".$ratearray[2]." - ".$ratearray[0]."&nbsp;";
+				$rate_text .= ($ratearray[0] == 1 ? "vote" : "votes");
+			}
+			else
+			{
+				$rating .= LAN_PAGE_dl_13;
+			}
+			$rate_text .= "</td><td style='width:50%; text-align:right'>";
+
+			if (!$rater->checkrated("page", $this -> pageID) && USER) {
+				$rate_text .= $rater->rateselect("&nbsp;&nbsp;&nbsp;&nbsp; <b>".LAN_PAGE_4."</b>", "page", $this -> pageID);
+			}
+			else if(!USER) {
+				$rate_text .= "&nbsp;";
+			} else {
+				$rate_text .= LAN_PAGE_5;
+			}
+			$rate_text .= "</td></tr></table>";
+		}
+		return $rate_text;
+	}
+
+	function pageComment($page_comment_flag)
+	{
+		global $sql, $ns, $e107cache, $tp, $comment_shortcodes,$cacheString;
+
+		if($page_comment_flag)
+		{
+			require_once(e_HANDLER."comment_class.php");
+			$cobj = new comment;
+
+			if (isset($_POST['commentsubmit']))
+			{
+				$cobj->enter_comment($_POST['author_name'], $_POST['comment'], "page", $this -> pageID, $pid, $_POST['subject']);
+						$e107cache->clear("comment.page.".$this -> pageID);
+                        $e107cache->clear($cacheString);
+					}
+
+			return $cobj->compose_comment("page", "comment", $this -> pageID, $width="", $subject="", $showrate=FALSE, $return=TRUE);
+		}
+	}
+
+	function pageCheckPerms($page_class, $page_password)
+	{
+		global $ns, $HEADER, $FOOTER, $sql;
+
+		if (!check_class($page_class))
+		{
+			message_handler("MESSAGE", LAN_PAGE_6);
+			require_once(FOOTERF); exit;
+		}
+
+		if (!$page_password)
+		{
+			return TRUE;
+		}
+
+		if($_POST['submit_page_pw'])
+		{
+			if($_POST['page_pw'] == $page_password)
+			{
+				$this -> setPageCookie();
+			}
+			}
+			else
+			{
+			$cookiename = "e107page_".$this -> pageID;
+
+			if($_COOKIE[$cookiename] == md5($page_password.USERID))
+			{
+				return TRUE;
+			}
+		}
+
+		if ($_POST['submit_page_pw'])
+		{
+			message_handler("MESSAGE", LAN_PAGE_7);
+		}
+
+			$text = "
+			<div style='text-align:center; margin-left:auto; margin-right: auto;'>
+			<form method='post' action='".e_SELF."?".e_QUERY."' id='pwform'>
+			<table style='width:100%;' class='fborder'>
+			<tr>
+			<td class='forumheader' colspan='3' style='text-align:center; white-space:nowrap'>".LAN_PAGE_8."</td>
+			</tr>
+			<tr>
+			<td class='forumheader3' style='width:20%;'>".LAN_PAGE_9.":</td>
+			<td class='forumheader3' style='width: 60%;'><input type='password' id='page_pw' name='page_pw' style='width: 90%;'/></td>
+			<td class='forumheader3' style='width:20%; vertical-align:middle; margin-left:auto; margin-right:auto; text-align:center;'><img src='".e_IMAGE."generic/".IMODE."/password.png' alt='' /></td>
+			</tr>
+			<tr>
+			<td class='forumheader' colspan='3' style='text-align:center;'><input class='button' type='submit' name='submit_page_pw' value='".LAN_PAGE_10."' /></td>
+			</tr>
+			</table>
+			</form>
+			</div>
+			";
+
+			$ns->tablerender("&nbsp;", $text);
+		require_once(FOOTERF); exit;
+	}
+
+	function setPageCookie()
+	{
+		global $pref;
+		$pref['pageCookieExpire'] = max($pref['pageCookieExpire'], 120);
+		$hash = md5($_POST['page_pw'].USERID);
+		cookie("e107page_".e_QUERY, $hash, (time() + $pref['pageCookieExpire']));
+		header("location:".e_SELF."?".e_QUERY);
+		exit;
+	}
+}
+
+?>
\ No newline at end of file
diff -ruN 6171/print.php 75/print.php
--- 6171/print.php	2004-06-05 20:11:04.000000000 -0500
+++ 75/print.php	2005-09-05 20:52:25.000000000 -0500
@@ -1,123 +1,97 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/template.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the	
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-$qs = explode(".", e_QUERY);
-if($qs[0] == ""){ header("location:".e_BASE."index.php"); exit;}
-$table = $qs[0];
-$id = $qs[1];
-$con = new convert;
-$aj = new textparse;
-
-
-$print_info[] = array( 'table' => 'news',  'handler' => '
-	$sql -> db_Select("news", "*", "news_id=\"$id\" ");
-	$row = $sql -> db_Fetch(); extract($row);
-	$news_body = $aj -> tpa($news_body);
-	$news_extended = $aj -> tpa($news_extended);
-	if($news_author == 0){
-		$a_name = "e107";
-		$category_name = "e107 welcome message";
-	}else{
-		$sql -> db_Select("news_category", "*", "category_id=\"$news_category\" ");
-		list($category_id, $category_name) = $sql-> db_Fetch();
-		$sql -> db_Select("user", "*", "user_id=\"$news_author\" ");
-		list($a_id, $a_name) = $sql-> db_Fetch();
-	}
-	$news_datestamp = $con -> convert_date($news_datestamp, "long");
-
-	$text = "<font style=\"font-size: 11px; color: black; font-family: tahoma, verdana, arial, helvetica; text-decoration: none\">
-	<b>".LAN_135.": ".$news_title."</b>
-	<br />
-	(".LAN_86." ".$category_name.")
-	<br />
-	".LAN_94." ".$a_name."<br />
-	".$news_datestamp."
-	<br /><br />".
-	$news_body;
-	if($news_extended != ""){ $text .= "<br /><br />".$news_extended; }
-	if($news_source != ""){ $text .= "<br /><br />".$news_source; }
-	if($news_url != ""){ $text .= "<br />".$news_url; }
-
-	$text .= "<br /><br /><hr />".
-	LAN_303.SITENAME."
-	<br />
-	( http://".$_SERVER[HTTP_HOST].e_HTTP."comment.php?comment.news.comment.".$news_id." )
-	</font>";
-');
-
-$print_info[] = array( 'table' => 'content', 'handler' => '
-	$sql -> db_Select("content", "*", "content_id=\"$id\" ");
-	$row = $sql -> db_Fetch();
-	extract($row);
-	$content_heading = $aj -> tpa($content_heading);
-	$content_subheading = $aj -> tpa($content_subheading);
-	$content_content = ereg_replace("\{EMAILPRINT\}|\[newpage\]", "", $aj -> tpa($content_content));
-	if(is_numeric($content_author)) {
-		$sql -> db_Select("user", "*", "user_id=\"$content_author\" ");
-		list($a_id, $a_name) = $sql-> db_Fetch();
-	} else {
-		$tmp = explode("^",$content_author);
-		$a_name = $tmp[0];
-		$user_email = $tmp[1];
-	}
-	$content_datestamp = $con -> convert_date($content_datestamp, "long");
-	$text = "<font style=\"FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Tahoma, Verdana, Arial, Helvetica; TEXT-DECORATION: none\">
-	<b>".LAN_304.$content_heading."</b>
-	<br />
-	".LAN_305.$content_subheading."
-	<br />
-	".LAN_87.$a_name."<br />
-	".$content_datestamp."
-	<br /><br />".
-	$content_content."
-	<br /><br /><hr />
-	".LAN_306.SITENAME."
-	<br />
-	( http://".$_SERVER[HTTP_HOST].e_HTTP."article.php?article.".$content_id." )
-	</font>";
-');
-
-
-//load the others from plugins
-$handle=opendir(e_PLUGIN);
-while(false !== ($file = readdir($handle))){
-	if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)){
-		$plugin_handle=opendir(e_PLUGIN.$file."/");
-		while(false !== ($file2 = readdir($plugin_handle))){
-			if($file2 == "e_print.php"){
-				require_once(e_PLUGIN.$file."/".$file2);
-			}
-		}
-	}
-}
-
-//eval the handler
-foreach($print_info as $key => $si){
-	if($print_info[$key]['table'] == $table){
-		eval($print_info[$key]['handler']);
-	}
-}
-echo "<div style=\"text-align:center\">
-	<img src=\"".e_IMAGE."logo.png\" alt=\"Logo\" />
-	</div>
-	<hr />
-	<br />";
-
-echo $text;
-
-echo "<br /><br /><div style='text-align:center'><form><input type='button' value='".LAN_307."' onClick='window.print()'></form></div>";
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/print.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/09/06 01:52:25 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+$qs = explode(".", e_QUERY);
+if ($qs[0] == "") {
+	header("location:".e_BASE."index.php");
+	 exit;
+}
+$source = $qs[0];
+$parms = intval($qs[1]);
+unset($qs);
+
+if(strpos($source,'plugin:') !== FALSE)
+{
+	$plugin = substr($source,7);
+	if(file_exists(e_PLUGIN.$plugin."/e_emailprint.php"))
+	{
+		include_once(e_PLUGIN.$plugin."/e_emailprint.php");
+		$text = print_item($parms);
+	}
+	else
+	{
+		echo "file missing.";
+		exit;
+	}
+}
+else
+{
+	$con = new convert;
+	$sql->db_Select("news", "*", "news_id='{$parms}'");
+	$row = $sql->db_Fetch(); 
+	extract($row);
+	$news_body = $tp->toHTML($news_body, TRUE);
+	$news_extended = $tp->toHTML($news_extended, TRUE);
+	if ($news_author == 0)
+	{
+		$a_name = "e107";
+		$category_name = "e107 welcome message";
+	}
+	else
+	{
+		$sql->db_Select("news_category", "category_id, category_name", "category_id='{$news_category}'");
+		list($category_id, $category_name) = $sql->db_Fetch();
+		$sql->db_Select("user", "user_id, user_name", "user_id='{$news_author}'");
+		list($a_id, $a_name) = $sql->db_Fetch();
+	}
+	$news_datestamp = $con->convert_date($news_datestamp, "long");
+	$text = "<font style=\"font-size: 11px; color: black; font-family: tahoma, verdana, arial, helvetica; text-decoration: none\">
+	<b>".LAN_135.": ".$news_title."</b>
+	<br />
+	(".LAN_86." ".$category_name.")
+	<br />
+	".LAN_94." ".$a_name."<br />
+	".$news_datestamp."
+	<br /><br />".
+	$news_body;
+
+	if ($news_extended != ""){ $text .= "<br /><br />".$news_extended; }
+	if ($news_source != ""){ $text .= "<br /><br />".$news_source; }
+	if ($news_url != ""){ $text .= "<br />".$news_url; }
+	 
+	$text .= "<br /><br /><hr />".
+	LAN_303.SITENAME."
+	<br />
+	( http://".$_SERVER[HTTP_HOST].e_HTTP."comment.php?comment.news.".$news_id." )
+	</font>";
+}
+
+echo "
+	<div style=\"text-align:center\">
+	";
+	echo $tp->parseTemplate("{LOGO}", TRUE);
+	echo "
+	</div>
+	<hr />
+	<br />
+	";
+echo $text;
+echo "<br /><br /><div style='text-align:center'><form><input type='button' value='".LAN_307."' onClick='window.print()'></form></div>";
+	
 ?>
\ No newline at end of file
diff -ruN 6171/rate.php 75/rate.php
--- 6171/rate.php	2004-03-24 23:14:52.000000000 -0600
+++ 75/rate.php	2005-12-24 16:53:38.000000000 -0600
@@ -1,41 +1,60 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/rate.php
-|
-|	Steve Dunstan 2001-2002
-|	http://jalist.com
-|	stevedunstan@jalist.com
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).	
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-$qs = explode("^", e_QUERY);
-
-if(!$qs[0] || USER == FALSE || $qs[3]>10 || $qs[3]<1){
-	header("location:".e_BASE."index.php");
-	exit;
-}
-
-$table = $qs[0];
-$itemid = $qs[1];
-$returnurl = $qs[2];
-$rate = $qs[3];
-
-if($sql -> db_Select("rate", "*", "rate_table='$table' AND rate_itemid='$itemid' ")){
-	$row = $sql -> db_Fetch();
-	extract($row);
-	$rate_voters .= USERID.".";
-	$sql -> db_Update("rate", "rate_votes=rate_votes+1, rate_rating=rate_rating+'$rate', rate_voters='$rate_voters' WHERE rate_itemid='$itemid' ");
-}else{
-	$sql -> db_Insert("rate", " 0, '$table', '$itemid', '$rate', '1', '.".USERID.".' ");
-}
-
-header("location:".$returnurl);
-exit;
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/rate.php,v $
+|     $Revision: 1.8 $
+|     $Date: 2005/12/24 22:53:38 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+
+// DIRTY - needs input validation, streaky
+
+require_once("class2.php");
+
+$qs = explode("^", e_QUERY);
+
+if (!$qs[0] || USER == FALSE || $qs[3] > 10 || $qs[3] < 1 || strpos($qs[2], '://') !== false)
+{
+	header("location:".e_BASE."index.php");
+	exit;
+}
+	
+$table = $tp -> toDB($qs[0]);
+$itemid = intval($qs[1]);
+$returnurl = $tp -> toDB($qs[2]);
+$rate = intval($qs[3]);
+	
+if ($sql -> db_Select("rate", "*", "rate_table='{$table}' AND rate_itemid='{$itemid}'"))
+{
+	$row = $sql -> db_Fetch();
+	if(strpos($row['rate_voters'], ".".USERID.".") === FALSE)
+	{
+		$rate_voters = $row['rate_voters'].".".USERID.".";
+		$new_rating = $row['rate_rating']+$rate;
+		$sql -> db_Update("rate", "rate_votes=rate_votes+1, rate_rating='{$new_rating}', rate_voters='{$rate_voters}' WHERE rate_itemid='{$itemid}' ");
+	}
+	else
+	{
+		header("location:".e_BASE."index.php");
+		exit;
+	}
+}
+else
+{
+	$sql->db_Insert("rate", " 0, '{$table}', '{$itemid}', '{$rate}', '1', '.".USERID.".' ");
+}
+
+header("location:".$returnurl);
+exit;
+	
 ?>
\ No newline at end of file
diff -ruN 6171/request.php 75/request.php
--- 6171/request.php	2005-05-12 22:27:23.000000000 -0500
+++ 75/request.php	2006-04-05 07:19:17.000000000 -0500
@@ -1,202 +1,407 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /request.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-if(!e_QUERY || strpos(e_QUERY, "..") !== FALSE)
-{
-	header("location: ".e_BASE."index.php");
-	exit;
-}
-
-if(!is_numeric(e_QUERY))
-{
-	$fname = str_replace("../", "", e_QUERY);
-	if($sql -> db_Select("download", "*", "download_url='".e_QUERY."'", TRUE))
-	{
-		$row = $sql -> db_Fetch(); 
-		$type = "file";
-		$id = $row['download_id'];
-	}
-	else if(file_exists($DOWNLOADS_DIRECTORY.$fname))
-	{
-		send_file($DOWNLOADS_DIRECTORY.$fname);
-		exit;
-	}
-	else if(strstr(e_QUERY, "http") || strstr(e_QUERY, "ftp"))
-	{
-		header("location:".e_QUERY);
-		exit;
-	}
-}
-
-$tmp = explode(".", e_QUERY);
-if(!$tmp[1])
-{
-	$id = $tmp[0];
-	$type = "file";
-}
-else
-{
-	$table = $tmp[0];
-	$id = $tmp[1];
-	$type = "image";
-}
-
-if(preg_match("#.*\.[a-z,A-Z]{3,4}#",e_QUERY))
-{
-	$fname = str_replace("../", "", e_QUERY);
-	if(file_exists($DOWNLOADS_DIRECTORY.$fname))
-	{
-		send_file($DOWNLOADS_DIRECTORY.$fname);
-		exit;
-	}
-	return;
-}
-
-
-if($type == "file"){
-	if($sql -> db_Select("download", "*", "download_id= '$id' ")){
-		$row = $sql -> db_Fetch(); extract($row);
-		$sql -> db_Select("download_category", "*", "download_category_id=$download_category");
-		$row = $sql -> db_Fetch(); extract($row);
-		if(check_class($download_category_class)){
-			$sql -> db_Update ("download", "download_requested=download_requested+1 WHERE download_id='$id' ");
-			if(preg_match("/Binary\s(.*?)\/.*/", $download_url, $result)){
-				$bid = $result[1];
-				$result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id='$bid' ");
-				$binary_data = @mysql_result($result, 0, "binary_data");
-				$binary_filetype = @mysql_result($result, 0, "binary_filetype");
-				$binary_name = @mysql_result($result, 0, "binary_name");
-				header("Content-type: ".$binary_filetype);
-				header("Content-length: ".$download_filesize);
-				header("Content-Disposition: attachment; filename=".$binary_name);
-				header("Content-Description: PHP Generated Data");
-				echo $binary_data;
-				exit;
-			}
-			if(strstr($download_url, "http") || strstr($download_url, "ftp")){
-				header("location:".$download_url);
-				exit;
-			} else {
-				if(file_exists($DOWNLOADS_DIRECTORY.$download_url)){
-					send_file($DOWNLOADS_DIRECTORY.$download_url);
-					exit;
-				} else if(file_exists(e_FILE."public/".$download_url)){
-					send_file(e_FILE."public/".$download_url);
-					exit;
-				}
-			}
-		} else {
-			echo "<br /><br /><div style='text-align:center; font: 12px Verdana, Tahoma'>You do not have the correct permissions to download this file.</div>";
-			exit;
-		}
-	}
-}
-
-$sql -> db_Select($table, "*", $table."_id= '$id' ");
-$row = $sql -> db_Fetch();
-extract($row);
-
-$image = ($table == "upload" ? $upload_ss : $download_image);
-
-if(preg_match("/Binary\s(.*?)\/.*/", $image, $result)){
-        $bid = $result[1];
-        $result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id='$bid' ");
-        $binary_data = @mysql_result($result, 0, "binary_data");
-    $binary_filetype = @mysql_result($result, 0, "binary_filetype");
-        $binary_name = @mysql_result($result, 0, "binary_name");
-        header("Content-type: ".$binary_filetype);
-        header("Content-Disposition: inline; filename=\"$binary_name\"");
-        echo $binary_data;
-        exit;
-
-}
-
-$image = ($table == "upload" ? $upload_ss : $download_image);
-
-if(eregi("http", $image)){
-
-        header("location:".$image);
-        exit;
-}else{
-        if($table == "download"){
-                require_once(HEADERF);
-                if(file_exists(e_FILE."download/".$image)){
-                        $disp = "<div style='text-align:center'><img src='".e_FILE."download/".$image."' alt='' /></div>";
-                }else if(file_exists(e_FILE."downloadimages/".$image)){
-                        $disp = "<div style='text-align:center'><img src='".e_FILE."downloadimages/".$image."' alt='' /></div>";
-                }else{
-                        $disp = "<div style='text-align:center'><img src='".e_FILE."public/".$image."' alt='' /></div>";
-                }
-                $disp .= "<br /><div style='text-align:center'><a href='javascript:history.back(1)'>Back</a></div>";
-                $ns -> tablerender($image, $disp);
-
-                require_once(FOOTERF);
-        }else{
-                if(is_file(e_FILE."public/".$image)){
-                    echo "<img src='".e_FILE."public/".$image."' alt='' />";
-                }elseif(is_file(e_FILE."downloadimages/".$image)){
-                    echo "<img src='".e_FILE."downloadimages/".$image."' alt='' />";
-                }else{
-                echo "Not Found";
-                }
-                exit;
-        }
-}
-
-// File retrieval function. by Cam.
-
-function send_file($file){
-	global $pref;
-
-	if(!$pref['download_php']){
-		header("location:".SITEURL.$file);
-		exit;
-	}
-
-	@set_time_limit(10*60);
-	@ini_set("max_execution_time",10*60);
-	while (@ob_end_clean()); // kill all output buffering else it eats server resources
-	$fullpath = $file;
-	$file = basename($file);
-    if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")){
-        $file = preg_replace('/\./', '%2e', $file,substr_count($file, '.') - 1);
-    }
-
-
-    if(is_file($fullpath) && connection_status()==0){
-        header("Cache-control: private");
-        header('Pragma: no-cache');
-        header("Content-Type: application/force-download");
-        header("Content-Disposition:attachment; filename=\"".trim(htmlentities($file))."\"");
-        header("Content-Description: ".trim(htmlentities($file)));
-        header("Content-length:".(string)(filesize($fullpath)));
-        header("Expires: ".gmdate("D, d M Y H:i:s", mktime(date("H")+2, date("i"), date("s"), date("m"), date("d"), date("Y")))." GMT");
-        header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
-
-
-        if ($file = fopen($fullpath, 'rb')) {
-            while(!feof($file) and (connection_status()==0)) {
-            	print(fread($file, 1024*8));
-            	flush();
-            }
-            fclose($file);
-        }
-
-    }else{
-        header("location: ".e_BASE."index.php");
-        exit;
-    }
-}
+<?php
+
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/request.php,v $
+|     $Revision: 1.36 $
+|     $Date: 2006/04/05 12:19:17 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once("class2.php");
+
+if (!e_QUERY || isset($_POST['userlogin'])) {
+	header("location: {$e107->base_path}");
+	exit();
+}
+
+$id = FALSE;
+if (!is_numeric(e_QUERY)) {
+	if ($sql->db_Select("download", "download_id", "download_url='".$tp -> toDB(e_QUERY)."'")) {
+		$row = $sql->db_Fetch();
+		$type = "file";
+		$id = $row['download_id'];
+	} else if(strstr(e_QUERY, "http://") || strstr(e_QUERY, "ftp://" || strstr(e_QUERY, "https://"))) {
+		header("location: ".e_QUERY);
+		exit();
+	} else if(file_exists($DOWNLOADS_DIRECTORY.e_QUERY)) {
+		send_file($DOWNLOADS_DIRECTORY.e_QUERY);
+		exit();
+	}
+}
+
+if(strstr(e_QUERY, "mirror")) {
+	list($action, $download_id, $mirror_id) = explode(".", e_QUERY);
+	$download_id = intval($download_id);
+	$mirror_id = intval($mirror_id);
+	$qry = "SELECT d.*, dc.download_category_class FROM #download as d LEFT JOIN #download_category AS dc ON dc.download_category_id = d.download_id WHERE d.download_id = {$download_id}";
+	if ($sql->db_Select_gen($qry)) {
+		$row = $sql->db_Fetch();
+		extract($row);
+		if (check_class($download_category_class) && check_class($download_class)) {
+			if($pref['download_limits'] && $download_active == 1) {
+				check_download_limits();
+			}
+			$mirrorList = explode(chr(1), $download_mirror);
+			$mstr = "";
+			foreach($mirrorList as $mirror) {
+				if($mirror) {
+					$tmp = explode(",", $mirror);
+					$mid = intval($tmp[0]);
+					$address = $tmp[1];
+					$requests = $tmp[2];
+					if($tmp[0] == $mirror_id) {
+						$gaddress = $address;
+						$requests ++;
+					}
+					$mstr .= $mid.",".$address.",".$requests.chr(1);
+				}
+			}
+			$sql->db_Update("download", "download_requested = download_requested + 1, download_mirror = '{$mstr}' WHERE download_id = '".intval($download_id)."'");
+			$sql->db_Update("download_mirror", "mirror_count = mirror_count + 1 WHERE mirror_id = '".intval($mirror_id)."'");
+			header("Location: {$gaddress}");
+			exit();
+		}
+	}
+}
+
+$tmp = explode(".", e_QUERY);
+if (!$tmp[1] || strstr(e_QUERY, "pub_")) {
+	$id = intval($tmp[0]);
+	$type = "file";
+} else {
+	$table = preg_replace("#\W#", "", $tp -> toDB($tmp[0], true));
+	$id = intval($tmp[1]);
+	$type = "image";
+}
+
+if (preg_match("#.*\.[a-z,A-Z]{3,4}#", e_QUERY)) {
+	if(strstr(e_QUERY, "pub_"))
+	{
+		$bid = str_replace("pub_", "", e_QUERY);
+		if (file_exists(e_FILE."public/".$bid))
+		{
+			send_file(e_FILE."public/".$bid);
+			exit();
+		}
+	}
+	if (file_exists($DOWNLOADS_DIRECTORY.e_QUERY)) {
+		send_file($DOWNLOADS_DIRECTORY.e_QUERY);
+		exit();
+	}
+	require_once(HEADERF);
+	$ns->tablerender(LAN_dl_61, "<div style='text-align:center'>".LAN_dl_65."\n<br /><br />\n<a href='javascript:history.back(1)'>".LAN_dl_64."</a></div>");
+	require_once(FOOTERF);
+	exit();
+}
+
+if ($type == "file")
+{
+	$qry = "SELECT d.*, dc.download_category_class FROM #download as d LEFT JOIN #download_category AS dc ON dc.download_category_id = d.download_id WHERE d.download_id = {$id}";
+	if ($sql->db_Select_gen($qry)) {
+		$row = $sql->db_Fetch();
+		if (check_class($row['download_category_class']) && check_class($row['download_class'])) {
+			if($pref['download_limits'] && $row['download_active'] == 1) {
+				check_download_limits();
+			}
+			extract($row);
+			if($download_mirror) {
+				$array = explode(chr(1), $download_mirror);
+				$c = (count($array)-1);
+				for ($i=1; $i < $c; $i++) {
+					$d = mt_rand(0, $i);
+					$tmp = $array[$i];
+					$array[$i] = $array[$d];
+					$array[$d] = $tmp;
+				}
+				$tmp = explode(",", $array[0]);
+				$mirror_id = $tmp[0];
+				$mstr = "";
+				foreach($array as $mirror) {
+					if($mirror) {
+						$tmp = explode(",", $mirror);
+						$mid = $tmp[0];
+						$address = $tmp[1];
+						$requests = $tmp[2];
+						if($tmp[0] == $mirror_id) {
+							$gaddress = $address;
+							$requests ++;
+						}
+						$mstr .= "{$mid}, {$address}, {$requests}".chr(1);
+					}
+				}
+				$sql -> db_Update("download", "download_requested = download_requested + 1, download_mirror = '{$mstr}' WHERE download_id = '".intval($download_id)."'");
+				$sql -> db_Update("download_mirror", "mirror_count = mirror_count + 1 WHERE mirror_id = '".intval($mirror_id)."'");
+
+				header("Location: ".$gaddress);
+				exit();
+			}
+
+			// increment download count
+			$sql->db_Update("download", "download_requested = download_requested + 1 WHERE download_id = '{$id}'");
+			$user_id = USER ? USERID : 0;
+			$ip = $e107->getip();
+			$request_data = "'0', '{$user_id}', '{$ip}', '{$id}', '".time()."'";
+			//add request info to db
+			$sql->db_Insert("download_requests", $request_data, FALSE);
+			if (preg_match("/Binary\s(.*?)\/.*/", $download_url, $result)) {
+				$bid = $result[1];
+				$result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '{$bid}'");
+				$binary_data = @mysql_result($result, 0, "binary_data");
+				$binary_filetype = @mysql_result($result, 0, "binary_filetype");
+				$binary_name = @mysql_result($result, 0, "binary_name");
+				header("Content-type: {$binary_filetype}");
+				header("Content-length: {$download_filesize}");
+				header("Content-Disposition: attachment; filename={$binary_name}");
+				header("Content-Description: PHP Generated Data");
+				echo $binary_data;
+				exit();
+			}
+			if (strstr($download_url, "http://") || strstr($download_url, "ftp://" || strstr($download_url, "https://"))) {
+				header("Location: {$download_url}");
+				exit();
+			} else {
+				if (file_exists($DOWNLOADS_DIRECTORY.$download_url)) {
+					send_file($DOWNLOADS_DIRECTORY.$download_url);
+					exit();
+				} else if(file_exists(e_FILE."public/{$download_url}")) {
+					send_file(e_FILE."public/{$download_url}");
+					exit();
+				}
+			}
+		} else {
+			// Download Access Denied.
+			if((!strpos($pref['download_denied'],".php") &&
+			!strpos($pref['download_denied'],".htm") &&
+			!strpos($pref['download_denied'],".html") &&
+			!strpos($pref['download_denied'],".shtml") ||
+			(strpos($pref['download_denied'],"signup.php") && USER == TRUE)
+			)){
+				require_once(HEADERF);
+				$denied_message = ($pref['download_denied'] && !strpos($pref['download_denied'],"signup.php")) ? $tp->toHTML($pref['download_denied'],"","defs") : LAN_dl_63;
+				$ns -> tablerender(LAN_dl_61, $denied_message);
+				require_once(FOOTERF);
+				exit();
+			}else{
+				header("Location: ".trim($pref['download_denied']));
+			}
+		}
+	}
+	else if(strstr(e_QUERY, "pub_"))
+	{
+		/* check to see if public upload and not in download table ... */
+		$bid = str_replace("pub_", "", e_QUERY);
+		if($result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '$bid' "))
+		{
+			$binary_data = @mysql_result($result, 0, "binary_data");
+			$binary_filetype = @mysql_result($result, 0, "binary_filetype");
+			$binary_name = @mysql_result($result, 0, "binary_name");
+			header("Content-type: {$binary_filetype}");
+			header("Content-length: {$download_filesize}");
+			header("Content-Disposition: attachment; filename={$binary_name}");
+			header("Content-Description: PHP Generated Data");
+			echo $binary_data;
+			exit();
+		}
+	}
+
+	require_once(HEADERF);
+	$ns -> tablerender(LAN_dl_61, "<div style='text-align:center'>".LAN_dl_65."<br /><br /><a href='javascript:history.back(1)'>".LAN_dl_64."</a></div>");
+	require_once(FOOTERF);
+	exit();
+}
+
+$sql->db_Select($table, "*", "{$table}_id = '{$id}'");
+$row = $sql->db_Fetch();
+extract($row);
+$image = ($table == "upload" ? $upload_ss : $download_image);
+if (preg_match("/Binary\s(.*?)\/.*/", $image, $result)) {
+	$bid = $result[1];
+	$result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '{$bid}'");
+	$binary_data = @mysql_result($result, 0, "binary_data");
+	$binary_filetype = @mysql_result($result, 0, "binary_filetype");
+	$binary_name = @mysql_result($result, 0, "binary_name");
+	header("Content-type: {$binary_filetype}");
+	header("Content-Disposition: inline; filename={$binary_name}");
+	echo $binary_data;
+	exit();
+}
+
+$image = ($table == "upload" ? $upload_ss : $download_image);
+
+if (strpos($image, "http") !== FALSE) {
+	header("Location: {$image}");
+	exit();
+} else {
+	if ($table == "download") {
+		require_once(HEADERF);
+		if (file_exists(e_FILE."download/{$image}")) {
+			$disp = "<div style='text-align:center'><img src='".e_FILE."download/{$image}' alt='' /></div>";
+		}
+		else if(file_exists(e_FILE."downloadimages/{$image}")) {
+			$disp = "<div style='text-align:center'><img src='".e_FILE."downloadimages/{$image}' alt='' /></div>";
+		} else {
+			$disp = "<div style='text-align:center'><img src='".e_FILE."public/{$image}' alt='' /></div>";
+		}
+		$disp .= "<br /><div style='text-align:center'><a href='javascript:history.back(1)'>".LAN_dl_64."</a></div>";
+		$ns->tablerender($image, $disp);
+
+		require_once(FOOTERF);
+	} else {
+		if (is_file(e_FILE."public/{$image}")) {
+			echo "<img src='".e_FILE."public/{$image}' alt='' />";
+		} elseif(is_file(e_FILE."downloadimages/{$image}")) {
+			echo "<img src='".e_FILE."downloadimages/{$image}' alt='' />";
+		} else {
+			require_once(HEADERF);
+			$ns -> tablerender(LAN_dl_61, "<div style='text-align:center'>".LAN_dl_65."<br /><br /><a href='javascript:history.back(1)'>".LAN_dl_64."</a></div>");
+			require_once(FOOTERF);
+			exit;
+		}
+		exit();
+	}
+}
+
+// File retrieval function. by Cam.
+function send_file($file) {
+	global $pref, $DOWNLOADS_DIRECTORY,$FILES_DIRECTORY, $e107;
+	if (!$pref['download_php'])
+	{
+		header("Location: ".SITEURL.$file);
+		exit();
+	}
+	@set_time_limit(10 * 60);
+	@ini_set("max_execution_time", 10 * 60);
+	while (@ob_end_clean()); // kill all output buffering else it eats server resources
+	$filename = $file;
+	$file = basename($file);
+	$path = realpath($filename);
+	$path_downloads = realpath($DOWNLOADS_DIRECTORY);
+	$path_public = realpath($FILES_DIRECTORY."public/");
+	if(!strstr($path, $path_downloads) && !strstr($path,$path_public)) {
+        if(E107_DEBUG_LEVEL > 0 && ADMIN){
+			echo "Failed to Download <b>".$file."</b><br />";
+			echo "The file-path <b>".$path."<b> didn't match with either <b>$path_downloads</b> or <b>$path_public</b><br />";
+			exit();
+        }else{
+			header("location: {$e107->base_path}");
+			exit();
+		}
+	} else {
+		if (is_file($filename) && is_readable($filename) && connection_status() == 0) {
+			if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE"))
+			{
+				$file = preg_replace('/\./', '%2e', $file, substr_count($file, '.') - 1);
+			}
+			if (isset($_SERVER['HTTP_RANGE']))
+			{
+				$seek = intval(substr($_SERVER['HTTP_RANGE'] , strlen('bytes=')));
+			}
+			$bufsize = 2048;
+			ignore_user_abort(true);
+			$data_len = filesize($filename);
+			if ($seek > ($data_len - 1)) { $seek = 0; }
+			if ($filename == null) { $filename = basename($this->data); }
+			$res =& fopen($filename, 'rb');
+			if ($seek)
+			{
+				fseek($res , $seek);
+			}
+			$data_len -= $seek;
+			header("Expires: 0");
+			header("Cache-Control: max-age=30" );
+			header("Content-Type: application/force-download");
+			header("Content-Disposition: attachment; filename=\"{$file}\"");
+			header("Content-Length: {$data_len}");
+			header("Pragma: public");
+			if ($seek)
+			{
+				header("Accept-Ranges: bytes");
+				header("HTTP/1.0 206 Partial Content");
+				header("status: 206 Partial Content");
+				header("Content-Range: bytes {$seek}-".($data_len - 1)."/{$data_len}");
+			}
+			while (!connection_aborted() && $data_len > 0)
+			{
+				echo fread($res , $bufsize);
+				$data_len -= $bufsize;
+			}
+			fclose($res);
+		} else {
+
+            if(E107_DEBUG_LEVEL > 0 && ADMIN){
+              	echo "file failed =".$file."<br />";
+				echo "path =".$path."<br />";
+                exit();
+			}else{
+			  	header("location: ".e_BASE."index.php");
+				exit();
+			}
+		}
+	}
+}
+function check_download_limits() {
+	global $pref, $sql, $ns, $HEADER, $e107, $tp;
+	// Check download count limits
+	$qry = "SELECT gen_intdata, gen_chardata, (gen_intdata/gen_chardata) as count_perday FROM #generic WHERE gen_type = 'download_limit' AND gen_datestamp IN (".USERCLASS_LIST.") AND (gen_chardata >= 0 AND gen_intdata >= 0) ORDER BY count_perday DESC";
+	if($sql->db_Select_gen($qry)) {
+		$limits = $sql->db_Fetch();
+		$cutoff = time() - (86400 * $limits['gen_chardata']);
+		if(USER) {
+			$where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_userid = ".USERID;
+		} else {
+			$ip = $e107->getip();
+			$where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_ip = '{$ip}'";
+		}
+		$qry = "SELECT COUNT(d.download_id) as count FROM #download_requests as dr LEFT JOIN #download as d ON dr.download_request_download_id = d.download_id AND d.download_active = 1 WHERE {$where} GROUP by dr.download_request_userid";
+		if($sql->db_Select_gen($qry)) {
+			$row=$sql->db_Fetch();
+			if($row['count'] >= $limits['gen_intdata']) {
+				// Exceeded download count limit
+				@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_download.php");
+				@include_once(e_LANGUAGEDIR."English/lan_download.php");
+				require_once(HEADERF);
+				$ns->tablerender(LAN_dl_61, LAN_dl_62);
+				require(FOOTERF);
+				exit();
+			}
+		}
+	}
+	// Check download bandwidth limits
+	$qry = "SELECT gen_user_id, gen_ip, (gen_user_id/gen_ip) as bw_perday FROM #generic WHERE gen_type='download_limit' AND gen_datestamp IN (".USERCLASS_LIST.") AND (gen_user_id >= 0 AND gen_ip >= 0) ORDER BY bw_perday DESC";
+	if($sql->db_Select_gen($qry)) {
+		$limit = $sql->db_Fetch();
+		$cutoff = time() - (86400*$limit['gen_ip']);
+		if(USER) {
+			$where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_userid = ".USERID;
+		} else {
+			$ip = $e107->getip();
+			$where = "dr.download_request_datestamp > {$cutoff} AND dr.download_request_ip = '{$ip}'";
+		}
+		$qry = "SELECT SUM(d.download_filesize) as total_bw FROM #download_requests as dr LEFT JOIN #download as d ON dr.download_request_download_id = d.download_id AND d.download_active = 1 WHERE {$where} GROUP by dr.download_request_userid";
+		if($sql->db_Select_gen($qry)) {
+			$row=$sql->db_Fetch();
+			if($row['total_bw'] / 1024 > $limit['gen_user_id']) {
+				//Exceed bandwith limit
+				@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_download.php");
+				@include_once(e_LANGUAGEDIR."English/lan_download.php");
+				require(HEADERF);
+				$ns->tablerender(LAN_dl_61, LAN_dl_62);
+				require(FOOTERF);
+				exit();
+			}
+		}
+	}
+}
+
 ?>
\ No newline at end of file
diff -ruN 6171/robots.txt 75/robots.txt
--- 6171/robots.txt	2004-03-03 12:24:38.000000000 -0600
+++ 75/robots.txt	2006-02-15 04:44:25.000000000 -0600
@@ -1,10 +1,6 @@
-User-agent: *
-Disallow: /e107_admin/
-Disallow: /e107_plugins/
-Disallow: /e107_languages/
-Disallow: /e107_images/
-Disallow: /e107_themes/
-Disallow: /e107_files/
-Disallow: /e107_docs/
-Disallow: /e107_handlers/
-Disallow: /e107_install/
\ No newline at end of file
+User-agent: *
+Disallow: /e107_admin/
+Disallow: /e107_install/
+Disallow: /e107_handlers/
+Disallow: /e107_files/cache/
+Disallow: /e107_files/public/avatars/
diff -ruN 6171/search.php 75/search.php
--- 6171/search.php	2005-05-12 22:50:22.000000000 -0500
+++ 75/search.php	2006-04-21 20:22:40.000000000 -0500
@@ -1,198 +1,541 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        search.php V53b2
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-// Restrict access to members
-if(!USER && $pref['search_restrict']==1){
-        require_once(HEADERF);
-        $ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_416."</div>");
-        require_once(FOOTERF);
-        exit;
-}
-
-$_POST['searchquery'] = trim(chop($_POST['searchquery']));
-if(IsSet($_POST['searchquery']) && $_POST['searchtype'][0] == "98"){ header("location:http://www.google.com/search?q=".stripslashes(str_replace(" ", "+", $_POST['searchquery']))); exit; }
-require_once(HEADERF);
-
-if($_POST['searchquery'] && strlen($_POST['searchquery']) < 3){
-        $ns -> tablerender(LAN_180, LAN_201);
-        unset($_POST['searchquery']);
-}
-
-$search_info=array();
-
-//load all core search routines
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_news.php', 'qtype' => LAN_98,'refpage' => 'news.php');
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_comment.php','qtype' => LAN_99,'refpage' => 'comment.php');
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_article.php', 'qtype' => LAN_100);
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_review.php', 'qtype' => LAN_190);
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_content.php', 'qtype' => LAN_191);
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_chatbox.php', 'qtype' => LAN_101,'refpage' => 'chatbox.php');
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_links.php', 'qtype' => LAN_102, 'refpage' => 'links.php');
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_forum.php', 'qtype' => LAN_103, 'refpage' => 'forum.php');
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_user.php', 'qtype' => LAN_140, 'refpage' => 'user.php');
-$search_info[]=array( 'sfile' => e_HANDLER.'search/search_download.php', 'qtype' => LAN_197, 'refpage' => 'download.php');
-
-//load all plugin search routines
-$handle=opendir(e_PLUGIN);
-while(false !== ($file = readdir($handle))){
-        if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)){
-                $plugin_handle=opendir(e_PLUGIN.$file."/");
-                while(false !== ($file2 = readdir($plugin_handle))){
-                        if($file2 == "e_search.php"){
-                                require_once(e_PLUGIN.$file."/".$file2);
-                        }
-                }
-        }
-}
-
-//$search_info[99]=array( 'sfile' => '','qtype' => LAN_192);
-
-$con=new convert;
-if(!$refpage = substr($_SERVER['HTTP_REFERER'], (strrpos($_SERVER['HTTP_REFERER'], "/")+1))){ $refpage = "index.php"; }
-
-if(isset($_POST['searchquery']) && $_POST['searchquery'] != "")
-{
-$query = $_POST['searchquery'];
-}
-
-if($_POST['searchtype']){
-        $searchtype = $_POST['searchtype'];
-}else{
-        foreach($search_info as $key=>$si){
-                if($si['refpage']){
-                        if(eregi($si['refpage'], $refpage)){ $searchtype = $key;}
-                }
-        }
-        if(eregi("article.php", $refpage)){
-                preg_match("/\?(.*?)\./", $refpage, $result);
-                $sql -> db_Select("content", "*", "content_id='".$result[1]."'");
-                $row = $sql -> db_Fetch(); extract($row);
-                if($content_type == 0){ $searchtype = 3; }
-                if($content_type == 3){ $searchtype = 4; }
-                if($content_type == 1){ $searchtype = 5; }
-        }
-//        if(!$searchtype){ $searchtype = 1; }
-        if($_POST['searchtype']==0 && !$searchtype || $refpage == "news.php"){ $searchtype = 0; }
-}
-if($_POST['searchtype'] == "99"){
-        unset($_POST['searchtype']);
-        foreach($search_info as $key => $si){
-                $_POST['searchtype'][] = $key;
-        }
-}
-$text = "<div ><form name='searchform' method='post' action='".e_SELF."'>
-<table style='width:95%' class='fborder'>
-<tr>
-<td colspan='2' class='forumheader'>
-".LAN_180."
-</td>
-</tr>
-<tr>
-<td class='forumheader2' style='width:20%'>
-".LAN_199." </td>
-<td class='forumheader3' style='width:80%'>
-<input class='tbox' type='text' name='searchquery' size='40' value='$query' maxlength='50' />
-<span class='smalltext'>".LAN_417."</span>
-</td>
-</tr>
-<tr>
-<td style='width:20%' class='forumheader2'>
-&nbsp;".LAN_200."
-</td>
-<td style='width:80%' class='forumheader3'>";
-
-foreach($search_info as $key => $si){
-        //($_POST['searchtype'][$key]==$key ) ? $sel=" checked" : $sel="";
-        $text.="<span style='white-space:nowrap; padding-bottom:7px;padding-top:7px'><input onclick=\"getElementById('google').checked = false\"   type='checkbox' name='searchtype[]' value='{$key}' />{$si['qtype']}</span>\n";
-}
-
-$text .= "
-<input id='google' type='checkbox' name='searchtype[]'  onclick='uncheckAll(this)' value='98' />Google
-<br /><br /> 
-<input class='button' type='button' name='CheckAll' value='".LAN_SEARCH_1."'
-onclick='checkAll(this);' />
-<input class='button' type='button' name='UnCheckAll' value='".LAN_SEARCH_2."'
-onclick='uncheckAll(this);' />
-<br />
-</td>
-</tr>
-<tr>
-<td colspan='2' class='forumheader' style='text-align:center'>
-
-<input class='button' type='submit' name='searchsubmit' value='".LAN_180."' />
-</td>
-</tr>
-</table>
-</form></div>";
-
-$ns -> tablerender(PAGE_NAME." ".SITENAME, $text);
-
-// only search when a query is filled.
-if($_POST['searchquery'])
-{
-	echo "<div style='border:0;padding-right:2px;width:auto;height:400px;overflow:auto;'>";
-	unset($text);
-	$key = $_POST['searchtype'];
-	for($a=0; $a<=(count($key)-1); $a++)
-	{
-		unset($text);
-		if(file_exists($search_info[$key[$a]]['sfile']))
-		{
-			@require_once($search_info[$key[$a]]['sfile']);
-			$ns -> tablerender(LAN_195." ".$search_info[$key[$a]]['qtype']." : ".LAN_196.": ".$results, $text);
-		}
-	}
-	echo "</div>";
-}
-
-function parsesearch($text, $match){
-        $text = strip_tags($text);
-        $temp = stristr($text,$match);
-        $pos = strlen($text)-strlen($temp);
-        if($pos < 70){
-                $text = "...".substr($text, 0, 100)."...";
-        }else{
-                $text = "...".substr($text, ($pos-70), 140)."...";
-        }
-        $text = eregi_replace($match, "<span class='searchhighlight'>$match</span>", $text);
-        return($text);
-}
-
-function headerjs(){
-$script = "<script type='text/javascript'>
-function checkAll(allbox)
-{
-for (var i = 0; i < document.searchform[\"searchtype[]\"].length-1; i++)
-        document.searchform[\"searchtype[]\"][i].checked = true ;
-}
-
-function uncheckAll(allbox)
-{
-for (var i = 0; i < document.searchform[\"searchtype[]\"].length-1; i++)
-        document.searchform[\"searchtype[]\"][i].checked = false ;
-}
-
-function uncheckG(allbox)
-{
-i = document.searchform[\"searchtype[]\"].length;
-        document.searchform[\"searchtype[]\"][i].checked = false ;
-}
-</script>\n";
-  return $script;
-}
-
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/search.php,v $
+|     $Revision: 1.53 $
+|     $Date: 2006/04/22 01:22:40 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+
+require_once('class2.php');
+
+if (!check_class($pref['search_restrict'])) {
+	require_once(HEADERF);
+	$ns -> tablerender(LAN_SEARCH_20, "<div style='text-align: center'>".LAN_SEARCH_21."</div>");
+	require_once(FOOTERF);
+	exit;
+}
+
+if($_GET['t'] == '0'){$_GET['t'] = 'news';}
+if($_GET['t'] == 1){$_GET['t'] = 'comments';}
+if($_GET['t'] == 2){$_GET['t'] = 'users';}
+if($_GET['t'] == 3){$_GET['t'] = 'downloads';}
+if($_GET['t'] == 4){$_GET['t'] = 'pages';}
+
+$search_prefs = $sysprefs -> getArray('search_prefs');
+
+// load search routines
+$search_info = array();
+$auto_order = 1000;
+function search_info($id, $type, $plug_require, $info='') {
+	global $tp, $search_prefs, $auto_order;
+	if (check_class($search_prefs[$type.'_handlers'][$id]['class'])) {
+		if ($plug_require) {
+			require_once($plug_require);
+			$ret = $search_info[0];
+		} else {
+			$ret = $info;
+		}
+		$ret['chars'] = $search_prefs[$type.'_handlers'][$id]['chars'];
+		$ret['results'] = $search_prefs[$type.'_handlers'][$id]['results'];
+		$ret['pre_title'] = $search_prefs[$type.'_handlers'][$id]['pre_title'];
+		$ret['pre_title_alt'] = $tp -> toHtml($search_prefs[$type.'_handlers'][$id]['pre_title_alt']);
+		$ret['order'] = (isset($search_prefs[$type.'_handlers'][$id]['order']) && $search_prefs[$type.'_handlers'][$id]['order']) ? $search_prefs[$type.'_handlers'][$id]['order'] : $auto_order;
+		$auto_order++;
+		return $ret;
+	} else {
+		return false;
+	}
+}
+
+//core search routines
+
+if ($search_info['news'] = search_info('news', 'core', false, array('sfile' => e_HANDLER.'search/search_news.php', 'qtype' => LAN_98, 'refpage' => 'news.php', 'advanced' => e_HANDLER.'search/advanced_news.php', 'id' => 'news'))) {
+   //	$search_id++;
+} else {
+	unset($search_info['news']);
+}
+
+if ($search_info['comments'] = search_info('comments', 'core', false, array('sfile' => e_HANDLER.'search/search_comment.php', 'qtype' => LAN_99, 'refpage' => 'comment.php', 'advanced' => e_HANDLER.'search/advanced_comment.php', 'id' => 'comment'))) {
+   //	$search_id++;
+} else {
+	unset($search_info['comments']);
+}
+
+if ($search_info['users'] = search_info('users', 'core', false, array('sfile' => e_HANDLER.'search/search_user.php', 'qtype' => LAN_140, 'refpage' => 'user.php', 'advanced' => e_HANDLER.'search/advanced_user.php', 'id' => 'user'))) {
+	//	$search_id++;
+} else {
+	unset($search_info['users']);
+}
+
+if ($search_info['downloads'] = search_info('downloads', 'core', false, array('sfile' => e_HANDLER.'search/search_download.php', 'qtype' => LAN_197, 'refpage' => 'download.php', 'advanced' => e_HANDLER.'search/advanced_download.php', 'id' => 'download'))) {
+	//	$search_id++;
+} else {
+	unset($search_info['downloads']);
+}
+
+if ($search_info['pages'] = search_info('pages', 'core', false, array('sfile' => e_HANDLER.'search/search_pages.php', 'qtype' => LAN_418, 'refpage' => 'page.php', 'advanced' => e_HANDLER.'search/advanced_pages.php', 'id' => 'pages'))) {
+   //	$search_id++;
+} else {
+	unset($search_info['pages']);
+}
+
+//plugin search routines    // plugin folder is used as the search key. ie. $_GET['t'] = 'chatbox';
+foreach ($search_prefs['plug_handlers'] as $plug_dir => $active) {
+	if (is_readable(e_PLUGIN.$plug_dir."/e_search.php")) {
+		if ($search_info[$plug_dir] = search_info($plug_dir, 'plug', e_PLUGIN.$plug_dir."/e_search.php")) {
+		  //	$search_id++;
+		} else {
+			unset($search_info[$plug_dir]);
+		}
+	}
+}
+
+
+// order search routines
+function array_sort($array, $column, $order = SORT_DESC) {
+	$i = 0;
+	foreach($array as $info) {
+		$sortarr[] = $info[$column];
+		$i++;
+	}
+ 	array_multisort($sortarr, $order, $array, $order);
+	return($array);
+}
+
+ $search_info = array_sort($search_info, 'order', SORT_ASC);
+
+// validate search query
+$perform_search = true;
+
+function magic_search($data) {
+	foreach ($data as $key => $value) {
+		if (is_array($value)) {
+			$data[$key] = magic_search($value);
+		} else {
+			$data[$key] = stripslashes($value);
+		}
+	}
+	return $data;
+}
+
+if (!e_QUERY) {
+	$enhanced = true;
+}
+
+if (isset($_GET['q']) || isset($_GET['in']) || isset($_GET['ex']) || isset($_GET['ep']) || isset($_GET['beg'])) {
+	if (MAGIC_QUOTES_GPC == true) {
+		$_GET = magic_search($_GET);
+	}
+	$full_query = $_GET['q'];
+	if ($_GET['in']) {
+		$en_in = explode(' ', $_GET['in']);
+		foreach ($en_in as $en_in_key) {
+			$full_query .= " +".$en_in_key;
+		}
+		$enhanced = true;
+	}
+	if ($_GET['ex']) {
+		$en_ex = explode(' ', $_GET['ex']);
+		foreach ($en_ex as $en_ex_key) {
+			$full_query .= " -".$en_ex_key;
+		}
+		$enhanced = true;
+	}
+	if ($_GET['ep']) {
+		$full_query .= " \"".$_GET['ep']."\"";
+		$enhanced = true;
+	}
+	if ($_GET['be']) {
+		$en_be = explode(' ', $_GET['be']);
+		foreach ($en_be as $en_be_key) {
+			$full_query .= " ".$en_be_key."*";
+		}
+		$enhanced = true;
+	}
+
+	if (isset($_GET['r']) && !is_numeric($_GET['r'])) {
+		$perform_search = false;
+		$SEARCH_MESSAGE = LAN_201;
+		$result_flag = 0;
+	} else if (strlen($full_query) == 0) {
+		$perform_search = false;
+		$SEARCH_MESSAGE = LAN_201;
+	} else if (strlen($full_query) < 3) {
+		$perform_search = false;
+		$SEARCH_MESSAGE = LAN_417;
+	} else if ($search_prefs['time_restrict']) {
+		$time = time() - $search_prefs['time_secs'];
+		$query_check = $tp -> toDB($full_query);
+		$ip = getip();
+		if ($sql -> db_Select("tmp", "tmp_ip, tmp_time, tmp_info", "tmp_info LIKE 'type_search%' AND tmp_ip='".$ip."'")) {
+			$row = $sql -> db_Fetch();
+			if (($row['tmp_time'] > $time) && ($row['tmp_info'] != 'type_search '.$query_check)) {
+				$perform_search = false;
+				$SEARCH_MESSAGE = LAN_SEARCH_17.$search_prefs['time_secs'].LAN_SEARCH_18;
+			} else {
+				$sql -> db_Update("tmp", "tmp_time='".time()."', tmp_info='type_search ".$query_check."' WHERE tmp_info LIKE 'type_search%' AND tmp_ip='".$ip."'");
+			}
+		} else {
+			$sql -> db_Insert("tmp", "'".$ip."', '".time()."', 'type_search ".$query_check."'");
+		}
+	}
+	if ($perform_search) {
+		$result_flag = $_GET['r'];
+	}
+	$query = trim($full_query);
+}
+
+// forward user if searching in google
+$search_count = count($search_info);
+$google_id = $search_count + 1;
+if ($search_prefs['selector'] == 1) {
+	if ($perform_search && isset($_GET['t'][$google_id]) && $_GET['t'][$google_id]) {
+		header("location:http://www.google.com/search?q=".stripslashes(str_replace(" ", "+", $query)));
+		exit;
+	}
+} else {
+	if ($perform_search && isset($_GET['t']) && $_GET['t'] == $google_id) {
+		header("location:http://www.google.com/search?q=".stripslashes(str_replace(" ", "+", $query)));
+		exit;
+	}
+}
+
+// determine areas being searched
+if (!$search_prefs['user_select'] && $_GET['r'] < 1) {
+	foreach($search_info as $key => $value) {
+		$searchtype[$key] = true;
+	}
+} else {
+	if (isset($_GET['t'])) {
+		if (is_array($_GET['t'])) {
+			$searchtype = $_GET['t'];
+		} else {
+			$searchtype[$_GET['t']] = true;
+		}
+	} else {
+		if (isset($_GET['ref'])) {
+			foreach($search_info as $key => $value) {
+				if ($value['id'] == $_GET['ref']) {
+					$searchtype[$key] = true;
+					$_GET['t'] = $key;
+				}
+			}
+		} else if (e_QUERY) {
+			if (isset($_SERVER['HTTP_REFERER'])) {
+				if (!$refpage = substr($_SERVER['HTTP_REFERER'], (strrpos($_SERVER['HTTP_REFERER'], "/")+1))) {
+					$refpage = "index.php";
+				}
+			} else {
+				$refpage = "";
+			}
+
+			foreach($search_info as $key => $value) {
+				if ($value['refpage']) {
+					if (strpos($refpage, $value['refpage']) !== FALSE) {
+						$searchtype[$key] = true;
+						$_GET['t'] = $key;
+					}
+				}
+			}
+		}
+
+		if (!isset($searchtype) && isset($query)) {
+			if ($search_prefs['multisearch']) {
+				$searchtype['all'] = true;
+			} else {
+				$searchtype[0] = true;
+			}
+		}
+	}
+}
+
+// standard search config
+if ($search_prefs['selector'] == 2) {
+	$SEARCH_DROPDOWN = "<select name='t' id='t' class='tbox' onchange=\"ab()\">";
+	if ($search_prefs['multisearch']) {
+		$SEARCH_DROPDOWN .= "<option value='all'>".LAN_SEARCH_22."</option>";
+	}
+} else {
+	$SEARCH_MAIN_CHECKBOXES = '';
+}
+
+foreach($search_info as $key => $value) {
+	if ($search_prefs['selector'] == 2) {
+		$sel = (isset($searchtype[$key]) && $searchtype[$key]) ? " selected='selected'" : "";
+	} else {
+		$sel = (isset($searchtype[$key]) && $searchtype[$key]) ? " checked='checked'" : "";
+	}
+	$google_js = check_class($search_prefs['google']) ? "onclick=\"uncheckG();\" " : "";
+	if ($search_prefs['selector'] == 2) {
+		$SEARCH_DROPDOWN .= "<option value='".$key."' ".$sel.">".$value['qtype']."</option>";
+	} else if ($search_prefs['selector'] == 1) {
+		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input ".$google_js." type='checkbox' name='t[".$key."]' ".$sel." />".$value['qtype'].$POST_CHECKBOXES;
+	} else {
+		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input type='radio' name='t' value='".$key."' ".$sel." />".$value['qtype'].$POST_CHECKBOXES;
+	}
+}
+
+if (check_class($search_prefs['google'])) {
+	if ($search_prefs['selector'] == 2) {
+		$SEARCH_DROPDOWN .= "<option value='".$google_id."'>Google</option>";
+	} else if ($search_prefs['selector'] == 1) {
+		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input id='google' type='checkbox' name='t[".$google_id."]' onclick='uncheckAll(this)' />Google".$POST_CHECKBOXES;
+	} else {
+		$SEARCH_MAIN_CHECKBOXES .= $PRE_CHECKBOXES."<input id='google' type='radio' name='t' value='".$google_id."' />Google".$POST_CHECKBOXES;
+	}
+}
+
+if ($search_prefs['selector'] == 2) {
+	$SEARCH_DROPDOWN .= "</select>";
+}
+
+$value = isset($_GET['q']) ? $tp -> post_toForm($_GET['q']) : "";
+$SEARCH_MAIN_SEARCHFIELD = "<input class='tbox m_search' type='text' id='q' name='q' size='35' value='".$value."' maxlength='50' />";
+if ($search_prefs['selector'] == 1) {
+	$SEARCH_MAIN_CHECKALL = "<input class='button' type='button' name='CheckAll' value='".LAN_SEARCH_1."' onclick='checkAll(this);' />";
+	$SEARCH_MAIN_UNCHECKALL = "<input class='button' type='button' name='UnCheckAll' value='".LAN_SEARCH_2."' onclick='uncheckAll(this); uncheckG();' />";
+}
+
+$SEARCH_MAIN_SUBMIT = "<input type='hidden' name='r' value='0' /><input class='button' type='submit' name='s' value='".LAN_180."' />";
+
+$ENHANCED_ICON = "<img src='".e_IMAGE."generic/".IMODE."/search_enhanced.png' style='width: 16px; height: 16px; vertical-align: top'
+alt='".LAN_SEARCH_23."' title='".LAN_SEARCH_23."' onclick=\"expandit('en_in'); expandit('en_ex'); expandit('en_ep'); expandit('en_be')\"/>";
+
+$enhanced_types['in'] = LAN_SEARCH_24.':';
+$enhanced_types['ex'] = LAN_SEARCH_25.':';
+$enhanced_types['ep'] = LAN_SEARCH_26.':';
+$enhanced_types['be'] = LAN_SEARCH_27.':';
+
+$ENHANCED_DISPLAY = $enhanced ? "" : "style='display: none'";
+
+// advanced search config
+if (!$_GET['adv'] || $_GET['t'] == 'all') {
+	foreach ($_GET as $gk => $gv) {
+		if ($gk != 't' && $gk != 'q' && $gk != 'r' && $gk != 'in' && $gk != 'ex' && $gk != 'ep' && $gk != 'be' && $gk != 'adv') {
+			unset($_GET[$gk]);
+		}
+	}
+}
+
+$SEARCH_TYPE_SEL = "<input type='radio' name='adv' value='0' ".($_GET['adv'] ? "" : "checked='checked'")." /> ".LAN_SEARCH_29."&nbsp;
+<input type='radio' name='adv' value='1' ".($_GET['adv'] ? "checked='checked'" : "" )." /> ".LAN_SEARCH_30;
+
+foreach ($search_info as $key => $value) {
+	if (!isset($search_info[$key]['advanced'])) {
+		$js_adv .= " && abid != ".$key;
+	}
+}
+
+if (isset($search_info[$_GET['t']]['advanced'])) {
+	$SEARCH_TYPE_DISPLAY = "";
+} else {
+	$SEARCH_TYPE_DISPLAY = "style='display: none'";
+}
+
+if (check_class($search_prefs['google'])) {
+	$js_adv .= " && abid != ".$google_id;
+}
+
+if ($perform_search) {
+	$con = new convert;
+	e107_require(e_HANDLER.'search_class.php');
+	$sch = new e_search;
+
+	// omitted words message
+	$stop_count = count($sch -> stop_keys);
+	if ($stop_count) {
+		if ($stop_count > 1) {
+			$SEARCH_MESSAGE = LAN_SEARCH_32.": ";
+		} else {
+			$SEARCH_MESSAGE = LAN_SEARCH_33.": ";
+		}
+		$i = 1;
+		foreach ($sch -> stop_keys as $stop_key) {
+			$SEARCH_MESSAGE .= $stop_key;
+			if ($i != $stop_count) {
+				$SEARCH_MESSAGE .= ', ';
+			}
+			$i++;
+		}
+	}
+}
+
+require_once(HEADERF);
+
+// render search config
+
+if (!isset($SEARCH_TOP_TABLE)) {
+	if (file_exists(THEME."search_template.php")) {
+		require(THEME."search_template.php");
+	} else {
+		require(e_BASE.$THEMES_DIRECTORY."templates/search_template.php");
+	}
+}
+
+$text = preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_TOP_TABLE);
+foreach ($enhanced_types as $en_id => $ENHANCED_TEXT) {
+	$ENHANCED_DISPLAY_ID = "en_".$en_id;
+	$ENHANCED_FIELD = "<input class='tbox' type='text' id='".$en_id."' name='".$en_id."' size='35' value='".$_GET[$en_id]."' maxlength='50' />";
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_ENHANCED);
+}
+if ($search_prefs['user_select']) {
+	$text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_CATS);
+}
+
+$text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_TYPE);
+
+if ($_GET['adv']) {
+	if (isset($search_info[$_GET['t']]['advanced'])) {
+		@require_once($search_info[$_GET['t']]['advanced']);
+		foreach ($advanced as $adv_key => $adv_value) {
+			if ($adv_value['type'] == 'single') {
+				$SEARCH_ADV_TEXT = $adv_value['text'];
+				$text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_ADV_COMBO);
+			} else {
+				if ($adv_value['type'] == 'dropdown') {
+					$SEARCH_ADV_A = $adv_value['text'];
+					$SEARCH_ADV_B = "<select name='".$adv_key."' class='tbox'>";
+					foreach ($adv_value['list'] as $list_item) {
+						$SEARCH_ADV_B .= "<option value='".$list_item['id']."' ".($_GET[$adv_key] == $list_item['id'] ? "selected='selected'" : "").">".$list_item['title']."</option>";
+					}
+					$SEARCH_ADV_B .= "</select>";
+				} else if ($adv_value['type'] == 'date') {
+					$SEARCH_ADV_A = $adv_value['text'];
+					$SEARCH_ADV_B = "<select id='on' name='on' class='tbox'>
+					<option value='new' ".($_GET['on'] == 'new' ? "selected='selected'" : "").">".LAN_SEARCH_34."</option>
+					<option value='old' ".($_GET['on'] == 'old' ? "selected='selected'" : "").">".LAN_SEARCH_35."</option>
+					</select>&nbsp;<select id='time' name='time' class='tbox'>";
+					$time = array(LAN_SEARCH_36 => 'any', LAN_SEARCH_37 => 86400, LAN_SEARCH_38 => 172800, LAN_SEARCH_39 => 259200, LAN_SEARCH_40 => 604800, LAN_SEARCH_41 => 1209600, LAN_SEARCH_42 => 1814400, LAN_SEARCH_43 => 2628000, LAN_SEARCH_44 => 5256000, LAN_SEARCH_45 => 7884000, LAN_SEARCH_46 => 15768000, LAN_SEARCH_47 => 31536000, LAN_SEARCH_48 => 63072000, LAN_SEARCH_49 => 94608000);
+					foreach ($time as $time_title => $time_secs) {
+						$SEARCH_ADV_B .= "<option value='".$time_secs."' ".($_GET['time'] == $time_secs ? "selected='selected'" : "").">".$time_title."</option>";
+					}
+					$SEARCH_ADV_B .= "</select>";
+				} else if ($adv_value['type'] == 'author') {
+					require_once(e_HANDLER.'user_select_class.php');
+					$us = new user_select;
+					$SEARCH_ADV_A = $adv_value['text'];
+					$SEARCH_ADV_B = $us -> select_form('popup', $adv_key, $_GET[$adv_key]);
+				} else if ($adv_value['type'] == 'dual') {
+					$SEARCH_ADV_A = $adv_value['adv_a'];
+					$SEARCH_ADV_B = $adv_value['adv_b'];
+				}
+				$text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_ADV);
+			}
+		}
+	} else {
+		$_GET['adv'] = 0;
+	}
+}
+
+$text .= $SEARCH_MESSAGE ? preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_TABLE_MSG) : "";
+$text .= preg_replace("/\{(.*?)\}/e", '$\1', $SEARCH_BOT_TABLE);
+
+$ns -> tablerender(PAGE_NAME." ".SITENAME, $text);
+
+// parse search
+if ($perform_search) {
+	foreach ($search_info as $key => $a) {
+		if (isset($searchtype[$key]) || isset($searchtype['all'])) {
+			unset($text);
+			if (file_exists($search_info[$key]['sfile'])) {
+				$pre_title = ($search_info[$key]['pre_title'] == 2) ? $search_info[$key]['pre_title_alt'] : $search_info[$key]['pre_title'];
+				$search_chars = $search_info[$key]['chars'];
+				$search_res = $search_info[$key]['results'];
+				@require_once($search_info[$key]['sfile']);
+				$parms = $results.",".$search_res.",".$_GET['r'].",".e_SELF."?q=".$_GET['q']."&t=".$key."&r=[FROM]";
+				$core_parms = array('r' => '', 'q' => '', 't' => '', 's' => '');
+				foreach ($_GET as $pparm_key => $pparm_value) {
+					if (!isset($core_parms[$pparm_key])) {
+						$parms .= "&".$pparm_key."=".$_GET[$pparm_key];
+					}
+				}
+				if ($results > $search_res) {
+					$nextprev = ($results > $search_res) ? $tp -> parseTemplate("{NEXTPREV={$parms}}") : "";
+					$text .= "<div class='nextprev' style='text-align: center'>".$nextprev."</div>";
+				}
+				if ($results > 0) {
+					$res_from = $_GET['r'] + 1;
+					$res_to = ($_GET['r'] + $search_res) > $results ? $results : ($_GET['r'] + $search_res);
+					$res_display = $res_from." - ".$res_to." ".LAN_SEARCH_12." ".$results;
+				} else {
+					$res_display = "";
+				}
+				$ns->tablerender(LAN_SEARCH_11." ".$res_display." ".LAN_SEARCH_13." ".(isset($_GET[$advanced_caption['id']]) ? $advanced_caption['title'][$_GET[$advanced_caption['id']]] : $search_info[$key]['qtype']), $text);
+			}
+		}
+	}
+}
+
+// old 6xx search parser for reverse compatability
+function parsesearch($text, $match) {
+	$text = strip_tags($text);
+	$temp = stristr($text, $match);
+	$pos = strlen($text) - strlen($temp);
+	$matchedText = substr($text,$pos,strlen($match));
+	if ($pos < 70) {
+		$text = "...".substr($text, 0, 100)."...";
+	} else {
+		$text = "...".substr($text, ($pos-50), $pos+30)."...";
+	}
+	$text = preg_replace("/".$match."/i", "<span class='searchhighlight'>".$matchedText."</span>", $text);
+	return($text);
+}
+
+function headerjs() {
+	global $search_count, $google_id, $search_prefs, $js_adv;
+	if ($search_prefs['selector'] == 1) {
+		$script = "<script type='text/javascript'>
+		<!--
+		function checkAll(allbox) {
+			for (var i = 0; i < ".$search_count."; i++)
+			document.getElementById('searchform')[\"t[\" + i + \"]\"].checked = true ;
+			uncheckG();
+		}
+
+		function uncheckAll(allbox) {
+			for (var i = 0; i < ".$search_count."; i++)
+			document.getElementById('searchform')[\"t[\" + i + \"]\"].checked = false ;
+		}\n";
+
+		if (check_class($search_prefs['google'])) {
+		$script .= "
+		function uncheckG() {
+			document.getElementById('searchform')[\"t[".$google_id."]\"].checked = false ;
+		}\n";
+		}
+
+		$script .= "// -->
+		</script>";
+
+	}
+
+	$script .= "<script type='text/javascript'>
+	<!--
+	function ab() {
+		abid = document.getElementById('t').value;
+		if (abid != 'all'".$js_adv.") {
+			document.getElementById('advanced_type').style.display = '';
+		} else {
+			document.getElementById('advanced_type').style.display = 'none';
+		}
+	}
+	//-->
+	</script>";
+
+	return $script;
+}
+
+require_once(FOOTERF);
+
 ?>
\ No newline at end of file
diff -ruN 6171/signup.php 75/signup.php
--- 6171/signup.php	2005-05-12 23:22:34.000000000 -0500
+++ 75/signup.php	2006-05-15 20:31:12.000000000 -0500
@@ -1,600 +1,836 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/signup.php,v $
-|     $Revision: 1.29 $
-|     $Date: 2004/09/06 11:09:43 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-require_once("class2.php");
-@include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_usersettings.php");
-@include_once(e_LANGUAGEDIR."English/lan_usersettings.php");
-$use_imagecode = ($pref['signcode'] && extension_loaded("gd"));
-
-if($pref['membersonly_enabled']){
-        $HEADER = "<div style='text-align:center; width:100%;margin-left:auto;margin-right:auto;text-align:center'><div style='width:70%;text-align:center;margin-left:auto;margin-right:auto'><br />";
-        if(file_exists(THEME."images/login_logo.png")){
-        $HEADER .= "<img src='".THEME."images/login_logo.png' alt='' />\n";
-        } else{
-        $HEADER .= "<img src='".e_IMAGE."logo.png' alt='' />\n";
-        }
-        $HEADER .= "<br />";
-        $FOOTER = "</div></div>";
-}
-
-if($use_imagecode){
-        require_once(e_HANDLER."secure_img_handler.php");
-        $sec_img = new secure_image;
-}
-
-if($pref['user_reg'] == 0){header("location:".e_BASE."index.php"); exit; }
-
-if(USER){header("location:".e_BASE."index.php"); exit; }
-
-if(e_QUERY){
-        $qs = explode(".", e_QUERY);
-        if($qs[0] == "activate"){
-                if($sql -> db_Select("user", "*", "user_sess='".$qs[2]."' ")){
-                        if($row = $sql -> db_Fetch()){
-                                $sql -> db_Update("user", "user_ban='0', user_sess='' WHERE user_sess='".$qs[2]."' ");
-                                require_once(HEADERF);
-                                $text = LAN_401." <a href='index.php'>".LAN_SIGNUP_22."</a> ".LAN_SIGNUP_23."<br />".LAN_SIGNUP_24." ".SITENAME;
-                                $ns -> tablerender(LAN_402, $text);
-                                require_once(FOOTERF);
-                                exit;
-                        }
-                }else{
-                header("location: ".e_BASE."index.php");
-                exit;
-        }
-}
-}
-
-$signupval = explode(".",$pref['signup_options']);
-$signup_title = array(LAN_308,LAN_144,LAN_115,LAN_116,LAN_117,LAN_118,LAN_119,LAN_120,LAN_121,LAN_122);
-$signup_name = array("realname","website","icq","aim","msn","birth_year","location","signature","image","timezone");
-
-
-if(IsSet($_POST['register'])){
-                extract($_POST);
-        require_once(e_HANDLER."message_handler.php");
-
-
-//        if(strlen($_POST['email']) > 100){exit;}
-        if($use_imagecode){
-                if(!$sec_img -> verify_code($_POST['rand_num'],$_POST['code_verify'])){
-                        message_handler("P_ALERT", LAN_SIGNUP_3);
-                        $error = TRUE;
-                }
-        }
-
-        if(strstr($_POST['name'], "#") || strstr($_POST['name'], "=")){
-                message_handler("P_ALERT", LAN_409);
-                $error = TRUE;
-        }
-
-        $_POST['name'] = trim(chop(ereg_replace("&nbsp;|\#|\=", "", $_POST['name'])));
-        if($_POST['name'] == "Anonymous"){
-                message_handler("P_ALERT", LAN_103);
-                $error = TRUE;
-                $name = "";
-        }
-
-        if(strlen($_POST['name']) > 30){ exit; }
-
-        if($sql -> db_Select("user", "*", "user_name='".$_POST['name']."' ")){
-                message_handler("P_ALERT", LAN_104);
-                $error = TRUE;
-                $name = "";
-        }
-
-
-        if($_POST['password1'] != $_POST['password2']){
-                message_handler("P_ALERT", LAN_105);
-                $error = TRUE;
-                $password1 = "";
-                $password2 = "";
-        }
-
-        if(strlen($_POST['password1']) < $pref['signup_pass_len']){
-                message_handler("P_ALERT", LAN_SIGNUP_4.$pref['signup_pass_len'].LAN_SIGNUP_5);
-                $error = TRUE;
-                $password1 = "";
-                $password2 = "";
-        }
-
-        if($_POST['name'] == "" || $_POST['password1'] =="" || $_POST['password2'] = ""){
-                message_handler("P_ALERT", LAN_185);
-                $error = TRUE;
-        }
-
-        // ========== Verify Custom Signup options if selected ========================
-
-        for ($i=0; $i<count($signup_title); $i++) {
-                $postvalue = $signup_name[$i];
-                if($signupval[$i]==2 && $_POST[$postvalue] == ""){
-                        message_handler("P_ALERT", LAN_SIGNUP_6.$signup_title[$i].LAN_SIGNUP_7);
-                        $error = TRUE;
-                }
-        };
-
-        if($sql -> db_Select("user", "user_email", "user_email='".$_POST['email']."' ")){
-                message_handler("P_ALERT", LAN_408);
-                $error = TRUE;
-        }
-
-                if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-                        $row = $sql -> db_Fetch();
-                        $user_entended = unserialize($row[0]);
-                        $c=0;
-                        $user_pref = unserialize($user_prefs);
-                        while(list($key, $u_entended) = each($user_entended)){
-                                if($u_entended){
-                                        if($pref['signup_ext'.$key] ==2 && $_POST["ue_{$key}"] == ""){
-                                                $ut = explode("|",$u_entended);
-                                                $u_name = ($ut[0] != "") ? trim($ut[0]) : trim($u_entended);
-                                                $error_ext = LAN_SIGNUP_6.$u_name.LAN_SIGNUP_7;
-                                                message_handler("P_ALERT", $error_ext);
-                                                $error = TRUE;
-                                        }
-
-                                }
-                        }
-                }
-
-
-        // ========== End of verification.. ====================================================
-
-        if(!preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]{1,50}@([-0-9A-Z]+\.){1,50}([0-9A-Z]){2,4}$/i', $_POST['email'])){
-                message_handler("P_ALERT", LAN_106);
-                $error = TRUE;
-        }
-        if (preg_match('#^www\.#si', $_POST['website'])) {
-                $_POST['website'] = "http://$homepage";
-        }else if (!preg_match('#^[a-z0-9]+://#si', $_POST['website'])){
-                $_POST['website'] = "";
-        }
-        if(!$error){
-                $fp = new floodprotect;
-                if($fp -> flood("user", "user_join") == FALSE){
-                        header("location:".e_BASE."index.php");
-                        exit;
-                }
-
-                if($sql -> db_Select("user", "*", "user_email='".$_POST['email']."' AND user_ban='1' ")){
-                        exit;
-                }
-
-                $wc = "*".substr($_POST['email'], strpos($_POST['email'], "@"));
-                if($sql -> db_Select("banlist", "*", "banlist_ip='".$_POST['email']."' OR banlist_ip='$wc'")){
-                        exit;
-                }
-
-
-                $username = strip_tags($_POST['name']);
-                $time=time();
-                $ip = getip();
-                $birthday = $_POST['birth_year']."/".$_POST['birth_month']."/".$_POST['birth_day'];
-
-                if($pref['user_reg_veri']){
-                              $u_key = md5(uniqid(rand(),1));
-                        $nid = $sql -> db_Insert("user", "0, \"".$username."\", '', \"".md5($_POST['password1'])."\", '$u_key', \"".$_POST['email']."\",         \"".$_POST['website']."\", \"".$_POST['icq']."\", \"".$_POST['aim']."\", \"".$_POST['msn']."\", \"".$_POST['location']."\", \"".$birthday."\", \"".$_POST['signature']."\", \"".$_POST['image']."\", \"".$_POST['timezone']."\", \"".$_POST['hideemail']."\", \"".$time."\", '0', \"".$time."\", '0', '0', '0', '0', '".$ip."', '2', '0', '', '', '', '0', \"".$_POST['realname']."\", '', '', '', '' ");
-                        $sql -> db_Select("user", "*", "user_name='".$_POST['name']."' AND user_join='".$time."' ");
-                        $row = $sql -> db_Fetch();
-                        $id = $row['user_id'];
-
-                                                                // ================== save extended fields as serialized data.
-
-                                                                if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-                                                                        $aj = new textparse;
-                                                                        $row = $sql -> db_Fetch();
-                                                                        $user_entended = unserialize($row[0]);
-                                                                        while(list($key, $u_entended) = each($user_entended)){
-                                                                                $val = $aj -> formtpa($_POST["ue_{$key}"], "public");
-                                                                                $user_pref["ue_{$key}"] = $val;
-                                                                        }
-                                                                        $tmp = addslashes(serialize($user_pref));
-                                                                        $sql -> db_Update("user", "user_prefs='$tmp' WHERE user_id='".$nid."' ");
-                                                                }
-                                                                // ==========================================================
-                        define("RETURNADDRESS", (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$id.".".$u_key : SITEURL."/signup.php?activate.".$id.".".$u_key));
-                        $pass_show = ($pref['user_reg_secureveri'])? "*******" : $_POST['password1'];
-                        $message = LAN_403." ".SITENAME."\n".LAN_SIGNUP_18."\n\n".LAN_SIGNUP_19." ".$_POST['name']."\n".LAN_SIGNUP_20." ".$pass_show."\n\n".LAN_SIGNUP_21."\n\n";
-                        $message .= RETURNADDRESS.LAN_407." ".SITENAME."\n".SITEURL;
-
-                        require_once(e_HANDLER."mail.php");
-                        if(file_exists(THEME."emails.php")){
-                            require_once(THEME."emails.php");
-                            $message = ($SIGNUPEMAIL)? $SIGNUPEMAIL:$message;
-                        }
-                        sendemail($_POST['email'], LAN_404." ".SITENAME, $message);
-
-
-
-                        require_once(HEADERF);
-                        $text = LAN_405;
-                        $ns -> tablerender("<div style='text-align:center'>".LAN_406."</div>", $text);
-                        require_once(FOOTERF);
-                        exit;
-                }else{
-                require_once(HEADERF);
-                $nid = $sql -> db_Insert("user", "0, '".$username."', '', '".md5($_POST['password1'])."', '$u_key', '".$_POST['email']."',         '".$_POST['website']."', '".$_POST['icq']."', '".$_POST['aim']."', '".$_POST['msn']."', '".$_POST['location']."', '".$birthday."', '".$_POST['signature']."', '".$_POST['image']."', '".$_POST['timezone']."', '".$_POST['hideemail']."', '".$time."', '0', '".$time."', '0', '0', '0', '0', '".$ip."', '0', '0', '', '', '', '0', '".$_POST['realname']."', '', '', '', '' ");
-                                        // ================== save extended fields as serialized data.
-
-                                        if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-                                                $aj = new textparse;
-                                                $row = $sql -> db_Fetch();
-                                                $user_entended = unserialize($row[0]);
-                                                while(list($key, $u_entended) = each($user_entended)){
-                                                        $val = $aj -> formtpa($_POST["ue_{$key}"], "public");
-                                                        $user_pref["ue_{$key}"] = $val;
-                                                }
-                                                $tmp = addslashes(serialize($user_pref));
-                                                $sql -> db_Update("user", "user_prefs='$tmp' WHERE user_id='".$nid."' ");
-                                        }
-                                        // ==========================================================
-                $ns -> tablerender("<div style='text-align:center'>".LAN_SIGNUP_8."</div>", LAN_107."&nbsp;".SITENAME.", ".LAN_SIGNUP_12."<br /><br />".LAN_SIGNUP_13);
-                require_once(FOOTERF);
-                exit;
-        }
-}
-
-}
-require_once(HEADERF);
-
-$qs = ($error ? "stage" : e_QUERY);
-
-if($pref['use_coppa'] == 1 && !ereg("stage", $qs)){
-        $cert_text = LAN_109 . " <a href='http://www.cdt.org/legislation/105th/privacy/coppa.html'>".LAN_SIGNUP_14."</a>. ".LAN_SIGNUP_15." <a href=\"mailto:".SITEADMINEMAIL."\">".LAN_SIGNUP_14."</a> ".LAN_SIGNUP_16."<br /><br /><div style=\"text-align:center\"><b>".LAN_SIGNUP_17."\n";
-        if(eregi("stage", LAN_109)){
-                $text .= $cert_text."</b></div>\n";
-        }else{
-                $text .= $cert_text."</b>\n<form method='post' action='signup.php?stage1' >\n
-        <div><br />
-        <input type='radio' name='coppa' value='0' checked='checked' /> ".LAN_200."
-        <input type='radio' name='coppa' value='1' /> ".LAN_201."<br />
-        <br />
-        <input class='button' type='submit' name='newver' value='".LAN_399."' />
-        </div></form>
-        </div>";
-        }
-
-        $ns -> tablerender("<div style='text-align:center'>".LAN_110."</div>", $text);
-        require_once(FOOTERF);
-        exit;
-}
-
-if(!$website){
-        $website = "http://";
-}
-
-if(!eregi("stage", LAN_109)){
-        if(IsSet($_POST['newver'])){
-                if(!$_POST['coppa']){
-                        $ns -> tablerender("<div style='text-align:center'>".LAN_202."</div>", "<div style='text-align:center'>".LAN_SIGNUP_9."</div>");
-                        require_once(FOOTERF);
-                        exit;
-                }
-        }
-}
-$text .= "<div style='text-align:center'>";
-if($pref['user_reg_veri']){
-        $text .= LAN_309."<br /><br />";
-}
-
-$text .= LAN_400;
-require_once(e_HANDLER."form_handler.php");
-$rs = new form;
-$text .= $rs -> form_open("post", e_SELF, "signupform")."
-<table class='fborder' style='width:70%'>
-<tr>
-<td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_7."<span style='font-size:15px; color:red'> *</span></td>
-<td class='forumheader3' style='width:70%'>
-".$rs -> form_text("name", 40, $name, 30)."
-</td>
-</tr>";
-
- if($signupval[0]){
-$text .="
-<tr>
-<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_308."".req($signupval[0])."</td>
-<td class='forumheader3' style='width:70%' >
-".$rs -> form_text("realname", 40, $realname, 100)."
-</td>
-</tr>";
-}
-
-$text .="
-<tr>
-<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_17."<span style='font-size:15px; color:red'> *</span></td>
-<td class='forumheader3' style='width:70%'>
-".$rs -> form_password("password1", 40, $password1, 20)."
-";
-if($pref['signup_pass_len']){
-$text .= "<br /><span class='smalltext'>  (".LAN_SIGNUP_1." {$pref['signup_pass_len']} ".LAN_SIGNUP_2.")</span>";
-}
-$text .="
-</td>
-</tr>
-<tr>
-<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_111."<span style='font-size:15px; color:red'> *</span></td>
-<td class='forumheader3' style='width:70%'>
-".$rs -> form_password("password2", 40, $password2, 20)."
-</td>
-</tr>
-<tr>
-<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_112."<span style='font-size:15px; color:red'> *</span></td>
-<td class='forumheader3' style='width:70%'>
-".$rs -> form_text("email", 40, $email, 100)."
-</td>
-</tr>
-<tr>
-<td class='forumheader3' style='width:30%;white-space:nowrap'>".LAN_113."</td>
-<td class='forumheader3' style='width:70%'>".
-$rs ->form_radio("hideemail", 1)." ".LAN_SIGNUP_10."&nbsp;&nbsp;".$rs ->form_radio("hideemail", 0, 1)." ".LAN_200."
-</td>
-</tr>";
-
-
-
-if($signupval[1]){
-        $text.="
-        <tr>
-        <td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_144.req($signupval[1])."</td>
-        <td class='forumheader3' style='width:70%' >
-        ".$rs -> form_text("website", 60, $website, 150)."
-        </td>
-        </tr>";
-}
-
-
-if($signupval[2]){
-        $text.="
-        <tr>
-        <td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_115.req($signupval[2])."</td>
-        <td class='forumheader3' style='width:70%' >
-        ".$rs -> form_text("icq", 20, $icq, 10)."
-        </td>
-        </tr>";
-}
-
-if($signupval[3]){
-        $text.="
-        <tr>
-        <td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_116.req($signupval[3])."</td>
-        <td class='forumheader3' style='width:70%; ' >
-        <input class='tbox' type='text' name='aim' size='30' value='$aim' maxlength='100' />
-        </td>
-        </tr>";
-}
-
-
-if($signupval[4]){
-        $text.="
-        <tr>
-        <td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_117.req($signupval[4])."</td>
-        <td class='forumheader3' style='width:70%;'>
-        <input class='tbox' type='text' name='msn' size='30' value='$msn' maxlength='100' />
-        </td>
-        </tr>";
-}
-
-
-if($signupval[5]){
-        $text.="
-        <tr>
-        <td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_118.req($signupval[5])."</td>
-        <td class='forumheader3' style='width:70%;white-space:nowrap' >".
-
-        $rs -> form_select_open("birth_day").
-        $rs -> form_option("", 0);
-        $today = getdate();
-        $year = $today['year'];
-        for($a=1; $a<=31; $a++){
-                $text .= ($birth_day == $a ? $rs -> form_option($a, 1) : $rs -> form_option($a, 0));
-        }
-        $text .= $rs -> form_select_close().
-        $rs -> form_select_open("birth_month").
-        $rs -> form_option("", 0);
-        for($a=1; $a<=12; $a++){
-                $text .= ($birth_month == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a));
-        }
-        $text .= $rs -> form_select_close().
-        $rs -> form_select_open("birth_year").
-        $rs -> form_option("", 0);
-        for($a=1950; $a<=$year; $a++){
-                $text .= ($birth_year == $a ? $rs -> form_option($a, 1) : $rs -> form_option($a, 0));
-        }
-
-        $text .= "</td></tr>";
-}
-
-
-
-if($signupval[6]){
-        $text.="
-        <tr>
-        <td class='forumheader3' style='width:30%;white-space:nowrap' >".LAN_119." ".req($signupval[6])."</td>
-        <td class='forumheader3' style='width:70%' >
-        <input class='tbox' type='text' name='location' size='60' value='$location' maxlength='200' />
-        </td>
-        </tr>";
-}
-
-
-
-if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-        $row = $sql -> db_Fetch();
-        $user_entended = unserialize($row[0]);
-        $c=0;
-        $user_pref = unserialize($user_prefs);
-        require_once(e_HANDLER."user_extended.php");
-        while(list($key, $u_entended) = each($user_entended)){
-                if($u_entended){
-                        $signup_ext = "signup_ext".$key;
-                        if($pref[$signup_ext]){
-                                $text .= user_extended_edit($key,$u_entended,"forumheader3","left");
-                                $c++;
-                        }
-                }
-        }
-}
-
-if($signupval[7]){
-        require_once(e_HANDLER."ren_help.php");
-        $text .= "<tr>
-        <td class='forumheader3' style='width:30%;white-space:nowrap;vertical-align:top' >".LAN_120." ".req($signupval[7])."</td>
-        <td class='forumheader3' style='width:70%' >
-        <textarea class='tbox' name='signature' cols='70' rows='4' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$signature</textarea>
-        <input class='helpbox' type='text' name='helpb' size='90' />
-        ".ren_help("addtext");
-}
-
-
-
-if($signupval[8]){
-        $text.="
-        <tr>
-        <td class='forumheader3' style='width:30%; vertical-align:top;white-space:nowrap' >".LAN_121.req($signupval[8])."<br /><span class='smalltext'>(".LAN_402.")</span></td>
-        <td class='forumheader3' style='width:70%' >
-        <input class='tbox' type='text' name='image' size='60' value='$image' maxlength='100' />
-
-        <input class='button' type ='button' style=''width: 35px'; cursor:hand' size='30' value='Show' onClick='expandit(this)'>
-        <div style='display:none' style=&{head};>";
-        $avatarlist[0] = "";
-        $handle=opendir(e_IMAGE."avatars/");
-        while ($file = readdir($handle)){
-                if($file != "." && $file != ".." && $file != "CVS" && $file != "index.html"){
-                        $avatarlist[] = $file;
-                }
-        }
-closedir($handle);
-
-for($c=1; $c<=(count($avatarlist)-1); $c++){
-        $text .= "<a href='javascript:addtext3(\"$avatarlist[$c]\")'><img src='".e_IMAGE."avatars/".$avatarlist[$c]."' style='border:0' alt='' /></a> ";
-}
-
-$text .= "<br />
-</div>";
-
-if($pref['avatar_upload'] && FILE_UPLOADS){
-        $text .= "<br /><span class='smalltext'>Upload your avatar</span> <input class='tbox' name='file_userfile[]' type='file' size='47'>
-        <br /><div class='smalltext'>".LAN_404."</div>";
-}
-
-if($pref['photo_upload'] && FILE_UPLOADS){
-        $text .= "<br /><span class='smalltext'>Upload your photograph</span> <input class='tbox' name='file_userfile[]' type='file' size='47'>
-        <br /><div class='smalltext'>".LAN_404."</div>";
-}
-
-
-$text .= "</td>
-</tr>";
-}
-
-if($signupval[9]){
-        $text.="
-        <tr>
-        <td class='forumheader3' style='width:30%' >".LAN_122.req($signupval[9])."</td>
-        <td class='forumheader3' style='width:70%;white-space:nowrap'>
-        <select name='timezone' class='tbox'>\n";
-
-        timezone();
-        $count = 0;
-        while($timezone[$count]){
-                if($timezone[$count] == $user_timezone){
-                        $text .= "<option value='".$timezone[$count]."' selected>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
-                }else{
-                $text .= "<option value='".$timezone[$count]."'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
-        }
-        $count++;
-}
-
-$text .= "</select>
-</td>
-</tr>";
-}
-
-if($use_imagecode){
-        $text .= " <tr>
-        <td class='forumheader3' style='width:30%'>".LAN_410."</td>
-        <td class='forumheader3' style='width:70%'>".
-        $rs ->form_hidden("rand_num", $sec_img -> random_number).
-        $sec_img -> r_image()."<br />".$rs -> form_text("code_verify", 20, "", 20)."
-        </td>
-        </tr>";
-}
-
-$text.="
-<tr style='vertical-align:top'>
-<td class='forumheader' colspan='2'  style='text-align:center'>
-<input class='button' type='submit' name='register' value='".LAN_123."' />
-<br />
-</td>
-</tr>
-</table>
-</form>
-</div>
-";
-
-$ns -> tablerender(LAN_123, $text);
-
-require_once(FOOTERF);
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-function timezone(){
-        /*
-        # Render style table
-        # - parameters                none
-        # - return                    timezone arrays
-        # - scope                     public
-        */
-        global $timezone, $timearea;
-        $timezone = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "GMT", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13");
-        $timearea = array("International DateLine West", "Samoa", "Hawaii", "Alaska", "Pacific Time (US and Canada)", "Mountain Time (US and Canada)", "Central Time (US and Canada), Central America", "Eastern Time (US and Canada)", "Atlantic Time (Canada)", "Greenland, Brasilia, Buenos Aires, Georgetown", "Mid-Atlantic", "Azores", "GMT - UK, Ireland, Lisbon", "West Central Africa, Western Europe", "Greece, Egypt, parts of Africa", "Russia, Baghdad, Kuwait, Nairobi", "Abu Dhabi, Kabul", "Islamabad, Karachi", "Astana, Dhaka", "Bangkok, Rangoon", "Hong Kong, Singapore, Perth, Beijing", "Tokyo, Seoul", "Brisbane, Canberra, Sydney, Melbourne", "Soloman Islands", "New Zealand", "Nuku'alofa");
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-function req($field){
-        global $pref;
-        if($field ==2){
-                $ret = "<span style='text-align:right;font-size:15px; color:red'> *</span>";
-        } else {
-                $ret = "";
-        }
-        return $ret;
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-function headerjs(){
-$script_txt = "<script type=\"text/javascript\">
-function addtext3(sc){
-        document.getElementById('signupform').image.value = sc;
-}
-
-function addsig(sc){
-        document.getElementById('signupform').signature.value += sc;
-
-}
-function help(help){
-        document.getElementById('signupform').helpb.value = help;
-
-
-}
-</script>\n";
- return $script_txt;
-}
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/signup.php,v $
+|     $Revision: 1.89 $
+|     $Date: 2006/05/16 01:31:12 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once("class2.php");
+include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_usersettings.php");
+include_once(e_HANDLER."user_extended_class.php");
+$usere = new e107_user_extended;
+require_once(e_HANDLER."calendar/calendar_class.php");
+$cal = new DHTML_Calendar(true);
+
+$fname = "signup_template.php";
+if(is_readable(THEME."templates/".$fname))
+{
+	include_once(THEME."templates/".$fname);
+}
+elseif(is_readable(THEME.$fname))
+{
+	include_once(THEME.$fname);
+}
+if(is_readable(e_THEME."templates/{$fname}"))
+{
+	include_once(e_THEME."templates/{$fname}");
+}
+
+
+
+include_once(e_FILE."shortcode/batch/signup_shortcodes.php");
+
+$signup_imagecode = ($pref['signcode'] && extension_loaded("gd"));
+
+// Resend Activation Email ------------------------------------------->
+if(e_QUERY == "resend" && !USER)
+{
+	require_once(HEADERF);
+	$clean_email = check_email($tp -> toDB($_POST['resend_email']));
+
+	if($_POST['submit_resend'])
+	{
+		if($sql->db_Select("user", "*", "user_email = \"".$tp->toDB($clean_email)."\" AND user_ban=0"))
+		{
+			$ns -> tablerender("Activation not necessary","Your account is already activated.<br />");
+			require_once(FOOTERF);
+			exit;
+		}
+
+		if($sql->db_Select("user", "*", "user_email = \"".$tp->toDB($clean_email)."\" AND user_ban=2 AND user_sess !='' LIMIT 1"))
+		$row = $sql -> db_Fetch();
+
+		$_POST['password1'] = "xxxxxxxx";
+		$_POST['loginname'] = $row['user_loginname'];
+		$_POST['name'] = $row['user_name'];
+		$nid = $row['user_id'];
+		$u_key = $row['user_sess'];
+
+		$eml = render_email();
+        $mailheader_e107id = $nid;
+		require_once(e_HANDLER."mail.php");
+		if(!sendemail($row['user_email'], $eml['subject'], $eml['message'], $row['user_name'], "", "", $eml['attachments'], $eml['cc'], $eml['bcc'], $returnpath, $returnreceipt,$eml['inline-images']))
+		{
+			$ns -> tablerender("Error","There was a problem, the registration mail was not sent, please contact the website administrator.");
+			require_once(FOOTERF);
+			exit;
+		}
+		else
+		{
+			$ns -> tablerender("Email Sent","Activation email sent to: ".$row['user_email']." - Please check your inbox.<br /><br />");
+			require_once(FOOTERF);
+			exit;
+		}
+
+	}
+	else
+	{
+		$text = "<div style='text-align:center'>
+		<form method='post' action='".e_SELF."?resend' name='resend_form'>
+		<table style='width:99%' class='fborder'>
+		<tr>
+		<td class='forumheader3'>
+		If you have already registered but did not receive an email to activate your account, please enter the email address you used during registration below. A new activation email will be resent to you at that address.
+		</td>
+		</tr>
+		<tr><td class='forumheader3'>".LAN_112."
+		<input type='text' name='resend_email' class='tbox' style='width:80%' value='' />
+		</td>
+		</tr>
+		";
+
+		$text .="<tr style='vertical-align:top'>
+		<td colspan='2' style='text-align:center' class='forumheader'>";
+		$text .= "<input class='button' type='submit' name='submit_resend' value='Send Activation Email' />";
+		$text .= "</td>
+		</tr>
+		</table>
+		</form>
+		</div>";
+
+		$ns -> tablerender("Resend Activation Email", $text);
+		require_once(FOOTERF);
+		exit;
+	}
+
+
+}
+
+// ------------------------------------------------------------------
+
+if(!$_POST)   // Notice Removal.
+{
+
+	$error = "";
+	$text = " ";
+	$password1 = "";
+	$password2 = "";
+	$email = "";
+	$name = "";
+	$loginname = "";
+	$realname = "";
+	$user_timezone = "";
+	$image = "";
+	$avatar_upload = "";
+	$photo_upload = "";
+	$_POST['ue'] = "";
+	$signature = "";
+}
+
+if(ADMIN && (e_QUERY == "preview" || e_QUERY == "test"  || e_QUERY == "preview.aftersignup"))
+{
+	if(e_QUERY == "preview.aftersignup")
+	{
+		require_once(HEADERF);
+		if(trim($pref['signup_text_after']))
+		{
+			$text = $tp->toHTML($pref['signup_text_after'], TRUE, 'parse_sc,defs')."<br />";
+		}
+		else
+		{
+			if ($pref['user_reg_veri'] == 2)
+			{
+				$text = LAN_SIGNUP_37;
+			}
+			else
+			{
+				$text = LAN_405;
+			}
+		}
+		$ns->tablerender(LAN_406, $text);
+		require_once(FOOTERF);
+		exit;
+	}
+
+	$eml = render_email(TRUE);
+	echo $eml['preview'];
+
+	if(e_QUERY == "test")
+	{
+		require_once(e_HANDLER."mail.php");
+		$message = $eml['message'];
+		$subj = $eml['subject'];
+		$inline = $eml['inline-images'];
+		$Cc = $eml['cc'];
+		$Bcc = $eml['bcc'];
+		$attachments = $eml['attachments'];
+
+		if(!sendemail(USEREMAIL, $subj, $message, USERNAME, "", "", $attachments, $Cc, $Bcc, $returnpath, $returnreceipt,$inline))
+		{
+			//	if(!sendemail(USEREMAIL, $subj, $message, USERNAME)) {
+			echo "<br /><br /><br /><br >&nbsp;&nbsp;>> There was a problem, the registration mail was not sent, please contact the website administrator.";
+		}
+		else
+		{
+			echo "<br /><br />&nbsp;&nbsp;>> Email Sent to: ".USEREMAIL." - Check your inbox!";
+		}
+	}
+	exit;
+}
+
+if ($pref['membersonly_enabled'])
+{
+	$HEADER = "<div style='text-align:center; width:100%;margin-left:auto;margin-right:auto;text-align:center'><div style='width:70%;text-align:center;margin-left:auto;margin-right:auto'><br />";
+	if (file_exists(THEME."images/login_logo.png"))
+	{
+		$HEADER .= "<img src='".THEME."images/login_logo.png' alt='' />\n";
+	}
+	else
+	{
+		$HEADER .= "<img src='".e_IMAGE."logo.png' alt='' />\n";
+	}
+	$HEADER .= "<br />";
+	$FOOTER = "</div></div>";
+}
+
+if($signup_imagecode)
+{
+	require_once(e_HANDLER."secure_img_handler.php");
+	$sec_img = new secure_image;
+}
+
+if($pref['user_reg'] == 0)
+{
+	header("location: ".e_HTTP."index.php");
+	exit;
+}
+
+if(USER)
+{
+	header("location: ".e_HTTP."index.php");
+	exit;
+}
+
+if (e_QUERY)
+{
+	$qs = explode(".", e_QUERY);
+	if ($qs[0] == "activate" && count($qs) == 3 && $qs[2])
+	{
+		$e107cache->clear("online_menu_totals");
+		if ($sql->db_Select("user", "*", "user_sess='".$tp -> toDB($qs[2], true)."' "))
+		{
+			if ($row = $sql->db_Fetch())
+			{
+				$sql->db_Update("user", "user_ban='0', user_sess='' WHERE user_sess='".$tp -> toDB($qs[2], true)."' ");
+				$e_event->trigger("userveri", $row);
+				require_once(HEADERF);
+				$text = LAN_401." <a href='index.php'>".LAN_SIGNUP_22."</a> ".LAN_SIGNUP_23."<br />".LAN_SIGNUP_24." ".SITENAME;
+				$ns->tablerender(LAN_402, $text);
+				require_once(FOOTERF);
+				exit;
+			}
+		}
+		else
+		{
+			header("location: ".e_BASE."index.php");
+			exit;
+		}
+	}
+}
+
+if (isset($_POST['register']))
+{
+	$e107cache->clear("online_menu_totals");
+	$error_message = "";
+	require_once(e_HANDLER."message_handler.php");
+	if ($signup_imagecode && !isset($_POST['xupexist']))
+	{
+		if (!$sec_img->verify_code($_POST['rand_num'], $_POST['code_verify']))
+		{
+			$error_message .= LAN_SIGNUP_3."\\n";
+			$error = TRUE;
+		}
+	}
+
+	if($_POST['xupexist'])
+	{
+		require_once(e_HANDLER."xml_class.php");
+		$xml = new parseXml;
+		if(!$rawData = $xml -> getRemoteXmlFile($_POST['xupexist']))
+		{
+			echo "Error: Unable to open remote XUP file";
+		}
+		preg_match_all("#\<meta name=\"(.*?)\" content=\"(.*?)\" \/\>#si", $rawData, $match);
+		$count = 0;
+		foreach($match[1] as $value)
+		{
+			$xup[$value] = $match[2][$count];
+			$count++;
+		}
+
+		$_POST['name'] = $xup['NICKNAME'];
+		$_POST['email'] = $xup['EMAIL'];
+		$_POST['signature'] = $xup['SIG'];
+		$_POST['hideemail'] = $xup['EMAILHIDE'];
+		$_POST['timezone'] = $xup['TZ'];
+		$_POST['realname'] = $xup['FN'];
+		$_POST['image'] = $xup['AV'];
+
+		$_POST['ue']['user_homepage'] = $xup['URL'];
+		$_POST['ue']['user_icq'] = $xup['ICQ'];
+		$_POST['ue']['user_aim'] = $xup['AIM'];
+		$_POST['ue']['user_msn'] = $xup['MSN'];
+		$_POST['ue']['user_yahoo'] = $xup['YAHOO'];
+		$_POST['ue']['user_location'] = $xup['GEO'];
+		$_POST['ue']['user_birthday'] = $xup['BDAY'];
+
+		unset($xup);
+	}
+	if($_POST['loginnamexup']) $_POST['loginname'] = $_POST['loginnamexup'];
+	if($_POST['password1xup']) $_POST['password1'] = $_POST['password1xup'];
+	if($_POST['password2xup']) $_POST['password2'] = $_POST['password2xup'];
+
+	if (strstr($_POST['loginname'], "#") || strstr($_POST['loginname'], "=") || strstr($_POST['loginname'], "\\") || strstr($_POST['loginname'], "'") || strstr($_POST['loginname'], '"'))
+	{
+		$error_message .= LAN_409."\\n";
+		$error = TRUE;
+	}
+
+	$_POST['loginname'] = trim(preg_replace("/&nbsp;|\#|\=/", "", $_POST['loginname']));
+	if ($_POST['loginname'] == "Anonymous")
+	{
+		$error_message .= LAN_103."\\n";
+		$error = TRUE;
+		$name = "";
+	}
+
+	// Check for disallowed names.
+	if(isset($pref['signup_disallow_text']))
+	{
+		$tmp = explode(",", $pref['signup_disallow_text']);
+		foreach($tmp as $disallow)
+		{
+			if( strstr($_POST['name'], $disallow) || strstr($_POST['loginname'], $disallow) ){
+				$error_message .= LAN_103."\\n";
+				$error = TRUE;
+				$name = "";
+			}
+		}
+	}
+
+	// Check if form maxlength has been bypassed
+	if ( strlen($_POST['name']) > 30 || strlen($_POST['loginname']) > 30)
+	{
+		exit;
+	}
+
+	// Display Name exists.
+	if ($sql->db_Select("user", "*", "user_name='".$tp -> toDB($_POST['name'])."'"))
+	{
+		$error_message .= LAN_411."\\n";
+		$error = TRUE;
+		$name = "";
+	}
+	// Login Name exists
+	if ($sql->db_Select("user", "*", "user_loginname='".$tp -> toDB($_POST['loginname'])."' "))
+	{
+		$error_message .= LAN_104."\\n";
+		$error = TRUE;
+		$name = "";
+	}
+
+	// check for multiple signups from the same IP address.
+	if($ipcount = $sql->db_Select("user", "*", "user_ip='".$e107->getip()."' and user_ban !='2' "))
+	{
+		if($ipcount >= $pref['signup_maxip'] && trim($pref['signup_maxip']) != "")
+		{
+			$error_message .= LAN_202."\\n";
+			$error = TRUE;
+		}
+	}
+
+	// Check password fields are matching.
+	if ($_POST['password1'] != $_POST['password2'])
+	{
+		$error_message .= LAN_105."\\n";
+		$error = TRUE;
+		$password1 = "";
+		$password2 = "";
+	}
+
+	// Email address confirmation.
+	if ($_POST['email'] != $_POST['email_confirm'])
+	{
+		$error_message .= LAN_SIGNUP_38."\\n";
+		$error = TRUE;
+		$email = "";
+		$email_confirm = "";
+	}
+
+	// Password length check.
+	if (strlen($_POST['password1']) < $pref['signup_pass_len'])
+	{
+		$error_message .= LAN_SIGNUP_4.$pref['signup_pass_len'].LAN_SIGNUP_5."\\n";
+		$error = TRUE;
+		$password1 = "";
+		$password2 = "";
+	}
+
+	// Use LoginName for DisplayName if restricted
+	if (!check_class($pref['displayname_class']))
+	{
+		$_POST['name'] = $_POST['loginname'];
+	}
+
+	// Check for emtpy fields
+	if ($_POST['name'] == "" || $_POST['loginname'] == "" || $_POST['password1'] == "" || $_POST['password2'] = "")
+	{
+		$error_message .= LAN_185."\\n";
+		$error = TRUE;
+	}
+
+	// ========== Verify Custom Signup options if selected ========================
+
+	$signup_option_title = array(LAN_308, LAN_120, LAN_121, LAN_122, LAN_SIGNUP_28);
+	$signup_option_names = array("realname", "signature", "image", "timezone", "class");
+
+	foreach($signup_option_names as $key => $value)
+	{
+		if ($pref['signup_option_'.$value] == 2 && !$_POST[$value])
+		{
+			$error_message .= LAN_SIGNUP_6.$signup_option_title[$key].LAN_SIGNUP_7."\\n";
+			$error = TRUE;
+		}
+	}
+
+	// Check for Duplicate Email address.
+	if ($sql->db_Select("user", "user_email, user_ban, user_sess", "user_email='".$tp -> toDB($_POST['email'])."' "))
+	{
+        $chk = $sql -> db_Fetch();
+		if($chk['user_ban']== 2 && $chk['user_sess']){
+		// duplicate because unactivated
+			$error = TRUE;
+        	header("Location: ".e_BASE."signup.php?resend");
+			exit;
+		}else{
+			$error_message .= LAN_408."\\n";
+			$error = TRUE;
+		}
+	}
+
+	// Extended Field validation
+	$extList = $usere->user_extended_get_fieldList();
+
+	foreach($extList as $ext)
+	{
+		if(isset($_POST['ue']['user_'.$ext['user_extended_struct_name']]))
+		{
+			$newval = $_POST['ue']['user_'.$ext['user_extended_struct_name']];
+			if($ext['user_extended_struct_required'] == 1 && trim($newval) == "" )
+			{
+				$_ftext = (defined($ext['user_extended_struct_text']) ? constant($ext['user_extended_struct_text']) : $ext['user_extended_struct_text']);
+				$error_message .= LAN_SIGNUP_6.$_ftext.LAN_SIGNUP_7."\\n";
+				$error = TRUE;
+			}
+		}
+	}
+
+	// Email syntax validation.
+	if (!check_email($_POST['email']))
+	{
+		message_handler("P_ALERT", LAN_106);
+		$error_message .= LAN_106."\\n";
+		$error = TRUE;
+	}
+
+	// Check Email against banlist.
+	$wc = $tp -> toDB("*".trim(substr($_POST['email'], strpos($_POST['email'], "@"))));
+	if ($sql->db_Select("banlist", "*", "banlist_ip='".$tp -> toDB($_POST['email'])."' OR banlist_ip='{$wc}'"))
+	{
+		$brow = $sql -> db_Fetch();
+		$error = TRUE;
+		if($brow['banlist_reason'])
+		{
+			$repl = array("\n","\r","<br />");
+			$error_message = str_replace($repl,"\\n",$tp->toHTML($brow['banlist_reason'],"","nobreak defs"))."\\n";
+			$email = "";
+		}
+		else
+		{
+			exit;
+		}
+	}
+
+	// Check email address on remote server (if enabled).
+	if ($pref['signup_remote_emailcheck'] && $error != TRUE)
+	{
+		require_once(e_HANDLER."mail_validation_class.php");
+		list($adminuser,$adminhost) = split ("@", SITEADMINEMAIL);
+		$validator = new email_validation_class;
+		$validator->localuser= $adminuser;
+		$validator->localhost= $adminhost;
+		$validator->timeout=3;
+		//	$validator->debug=1;
+		//	$validator->html_debug=1;
+		if($validator->ValidateEmailBox($_POST['email']) != 1)
+		{
+			$error_message .= LAN_106."\\n";
+			$error = TRUE;
+			$email = "";
+			$email_confirm = "";
+		}
+
+	}
+
+	if($error_message)
+	{
+		message_handler("P_ALERT", $error_message);
+	}
+
+	// ========== End of verification.. ====================================================
+
+	if (!$error)
+	{
+		$fp = new floodprotect;
+		if ($fp->flood("user", "user_join") == FALSE)
+		{
+			header("location:".e_BASE."index.php");
+			exit;
+		}
+
+		if ($sql->db_Select("user", "*", "user_email='".$tp -> toDB($_POST['email'])."' AND user_ban='1'")) {
+			exit;
+		}
+
+		$username = $tp -> toDB(strip_tags($_POST['name']));
+		$loginname = $tp -> toDB(strip_tags($_POST['loginname']));
+		$time = time();
+		$ip = $e107->getip();
+
+		$ue_fields = "";
+		foreach($_POST['ue'] as $key => $val)
+		{
+			$key = $tp->toDB($key);
+			$val = $tp->toDB($val);
+			$ue_fields .= ($ue_fields) ? ", " : "";
+			$ue_fields .= $key."='".$val."'";
+		}
+
+		$u_key = md5(uniqid(rand(), 1));
+		$nid = $sql->db_Insert("user", "0, '{$username}', '{$loginname}', '', '".md5($_POST['password1'])."', '{$u_key}', '".$tp -> toDB($_POST['email'])."', '".$tp -> toDB($_POST['signature'])."', '".$tp -> toDB($_POST['image'])."', '".$tp -> toDB($_POST['timezone'])."', '".$tp -> toDB($_POST['hideemail'])."', '".$time."', '0', '".$time."', '0', '0', '0', '0', '".$ip."', '2', '0', '', '', '0', '0', '".$tp -> toDB($_POST['realname'])."', '', '', '', '0', '".$tp -> toDB($_POST['xupexist'])."' ");
+		if(!$nid)
+		{
+			require_once(HEADERF);
+			$ns->tablerender("", LAN_SIGNUP_36);
+			require_once(FOOTERF);
+		}
+
+		if ($pref['user_reg_veri'])
+		{
+			// ==== Update Userclass =======>
+
+			if ($_POST['class'])
+			{
+				unset($insert_class);
+				sort($_POST['class']);
+				$insert_class = implode(",",$_POST['class']);
+				$sql->db_Update("user", "user_class='".$tp -> toDB($insert_class)."' WHERE user_id='".$nid."' ");
+			}
+
+			// ========= save extended fields into db table. =====
+
+			if($ue_fields)
+			{
+				$sql->db_Select_gen("INSERT INTO #user_extended (user_extended_id) values ('{$nid}')");
+				$sql->db_Update("user_extended", $ue_fields." WHERE user_extended_id = '{$nid}'");
+			}
+
+			// ========== Send Email =========>
+
+			if ($pref['user_reg_veri'] != 2)
+			{
+                $eml = render_email();
+				$mailheader_e107id = $eml['userid'];
+				require_once(e_HANDLER."mail.php");
+
+
+				if(!sendemail($_POST['email'], $eml['subject'], $eml['message'], "", "", "", $eml['attachments'], $eml['cc'], $eml['bcc'], "", "", $eml['inline-images']))
+				{
+					$error_message = "There was a problem, the registration mail was not sent, please contact the website administrator.";
+				}
+			}
+
+			$edata_su = array("username" => $username, "email" => $_POST['email'], "signature" => $_POST['signature'], "image" => $_POST['image'], "timezone" => $_POST['timezone'], "hideemail" => $_POST['hideemail'], "ip" => $ip, "realname" => $_POST['realname'], "xup" => $_POST['xupexist']);
+			$e_event->trigger("usersup", $edata_su);
+
+			require_once(HEADERF);
+			if($pref['signup_text_after'])
+			{
+				$text = $tp->toHTML($pref['signup_text_after'], TRUE, 'parse_sc,defs')."<br />";
+			}
+			else
+			{
+				if ($pref['user_reg_veri'] == 2)
+				{
+					$text = LAN_SIGNUP_37;
+				}
+				else
+				{
+					$text = LAN_405;
+				}
+			}
+			if(isset($error_message))
+			{
+				$text .= "<br /><b>".$error_message."</b><br />";
+			}
+			$ns->tablerender(LAN_406, $text);
+			require_once(FOOTERF);
+			exit;
+		}
+		else
+		{
+			require_once(HEADERF);
+
+			if(!$sql -> db_Select("user", "user_id", "user_name='{$username}' AND user_password='".md5($_POST['password1'])."'"))
+			{
+				$ns->tablerender("", LAN_SIGNUP_36);
+				require_once(FOOTERF);
+				exit;
+			}
+			$sql->db_Update("user", "user_ban = '0' WHERE user_id = '{$nid}'");
+
+			// ==== Update Userclass =======
+			if ($_POST['class'])
+			{
+				unset($insert_class);
+				sort($_POST['class']);
+				$insert_class = implode(",",$_POST['class']);
+				$sql->db_Update("user", "user_class='".$tp -> toDB($insert_class)."' WHERE user_id='".$nid."' ");
+			}
+			// ======== save extended fields to DB table.
+
+			if($ue_fields)
+			{
+				$sql->db_Select_gen("INSERT INTO #user_extended (user_extended_id) values ('{$nid}')");
+				$sql->db_Update("user_extended", $ue_fields." WHERE user_extended_id = '{$nid}'");
+			}
+
+			// ==========================================================
+
+			$edata_su = array("username" => $username, "email" => $_POST['email'], "signature" => $_POST['signature'], "image" => $_POST['image'], "timezone" => $_POST['timezone'], "hideemail" => $_POST['hideemail'], "ip" => $ip, "realname" => $_POST['realname'], "xup" => $_POST['xupexist']);
+			$e_event->trigger("usersup", $edata_su);
+
+			if($pref['signup_text_after'])
+			{
+				$text = $tp->toHTML($pref['signup_text_after'], TRUE, 'parse_sc,defs')."<br />";
+			}
+			else
+			{
+				$text = LAN_107."&nbsp;".SITENAME.", ".LAN_SIGNUP_12."<br /><br />".LAN_SIGNUP_13;
+			}
+			$ns->tablerender(LAN_SIGNUP_8,$text);
+			require_once(FOOTERF);
+			exit;
+		}
+	}
+
+}
+require_once(HEADERF);
+
+$qs = ($error ? "stage" : e_QUERY);
+if ($pref['use_coppa'] == 1 && strpos($qs, "stage") === FALSE)
+{
+	$text = $tp->parseTemplate($COPPA_TEMPLATE, TRUE, $signup_shortcodes);
+	$ns->tablerender(LAN_110, $text);
+	require_once(FOOTERF);
+	exit;
+}
+
+if (!$website)
+{
+	$website = "http://";
+}
+
+if (strpos(LAN_109, "stage") === FALSE)
+{
+	if (isset($_POST['newver']))
+	{
+		if (!$_POST['coppa'])
+		{
+			$text = $tp->parseTemplate($COPPA_FAIL);
+			$ns->tablerender(LAN_110, $text);
+			require_once(FOOTERF);
+			exit;
+		}
+	}
+}
+
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+
+
+$text = $tp->parseTemplate($SIGNUP_BEGIN.$SIGNUP_BODY.$SIGNUP_END, TRUE, $signup_shortcodes);
+$ns->tablerender(LAN_123, $text);
+require_once(FOOTERF);
+exit;
+
+// Default Signup Form ----->
+
+$ns->tablerender(LAN_123, $text);
+
+require_once(FOOTERF);
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+
+function req($field)
+{
+	return ($field == 2 ? REQUIRED_FIELD_MARKER : "");
+}
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+
+function headerjs()
+{
+	$script_txt = "
+	<script type=\"text/javascript\">
+	function addtext3(sc){
+		document.getElementById('signupform').image.value = sc;
+	}
+
+	function addsig(sc){
+		document.getElementById('signupform').signature.value += sc;
+	}
+	function help(help){
+		document.getElementById('signupform').helpb.value = help;
+	}
+	</script>\n";
+
+	global $cal;
+	$script_txt .= $cal->load_files();
+	return $script_txt;
+}
+
+
+function render_email($preview = FALSE)
+{
+	// 1 = Body
+	// 2 = Subject
+
+	global $pref,$nid,$u_key,$_POST,$SIGNUPEMAIL_LINKSTYLE,$SIGNUPEMAIL_SUBJECT,$SIGNUPEMAIL_TEMPLATE;
+
+	if($preview == TRUE)
+	{
+		$_POST['password1'] = "test-password";
+		$_POST['loginname'] = "test-loginname";
+		$_POST['name'] = "test-username";
+		$_POST['website'] = "www.test-site.com";
+		$nid = 0;
+		$u_key = "1234567890ABCDEFGHIJKLMNOP";
+	}
+
+	define("RETURNADDRESS", (substr(SITEURL, -1) == "/" ? SITEURL."signup.php?activate.".$nid.".".$u_key : SITEURL."/signup.php?activate.".$nid.".".$u_key));
+	$pass_show = ($pref['user_reg_secureveri'])? "*******" : $_POST['password1'];
+
+	if (file_exists(THEME."email_template.php"))
+	{
+		require_once(THEME."email_template.php");
+	}
+	else
+	{
+		require_once(e_THEME."templates/email_template.php");
+	}
+
+	$inline_images = explode(",",$SIGNUPEMAIL_IMAGES);
+	if($SIGNUPEMAIL_BACKGROUNDIMAGE)
+	{
+		$inline_images[] = $SIGNUPEMAIL_BACKGROUNDIMAGE;
+	}
+
+	$ret['userid'] = $nid;
+	$ret['cc'] = $SIGNUPEMAIL_CC;
+	$ret['bcc'] = $SIGNUPEMAIL_BCC;
+	$ret['attachments'] = $SIGNUPEMAIL_ATTACHMENTS;
+	$ret['inline-images'] = implode(",",$inline_images);
+
+	$style = ($SIGNUPEMAIL_LINKSTYLE) ? "style='$SIGNUPEMAIL_LINKSTYLE'" : "";
+
+	$search[0] = "{LOGINNAME}";
+	$replace[0] = $_POST['loginname'];
+
+	$search[1] = "{PASSWORD}";
+	$replace[1] = $pass_show;
+
+	$search[2] = "{ACTIVATION_LINK}";
+	$replace[2] = "<a href='".RETURNADDRESS."' $style>".RETURNADDRESS."</a>";
+
+	$search[3] = "{SITENAME}";
+	$replace[3] = SITENAME;
+
+	$search[4] = "{SITEURL}";
+	$replace[4] = "<a href='".SITEURL."' $style>".SITEURL."</a>";
+
+	$search[5] = "{USERNAME}";
+	$replace[5] = $_POST['name'];
+
+	$search[6] = "{USERURL}";
+	$replace[6] = ($_POST['website']) ? $_POST['website'] : "";
+
+	$cnt=1;
+
+	foreach($inline_images as $img)
+	{
+		if(is_readable($inline_images[$cnt-1]))
+		{
+			$cid_search[] = "{IMAGE".$cnt."}";
+			$cid_replace[] = "<img alt=\"".SITENAME."\" src='cid:".md5($inline_images[$cnt-1])."' />\n";
+			$path_search[] = "{IMAGE".$cnt."}";
+			$path_replace[] = "<img alt=\"".SITENAME."\" src=\"".$inline_images[$cnt-1]."\" />\n";
+		}
+		$cnt++;
+	}
+
+	$subject = str_replace($search,$replace,$SIGNUPEMAIL_SUBJECT);
+	$ret['subject'] =  $subject;
+
+	$HEAD = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n";
+	$HEAD .= "<html xmlns='http://www.w3.org/1999/xhtml' >\n";
+	$HEAD .= "<head><meta http-equiv='content-type' content='text/html; charset=utf-8' />\n";
+	$HEAD .= ($SIGNUPEMAIL_USETHEME == 1) ? "<link rel=\"stylesheet\" href=\"".SITEURL.THEME."style.css\" type=\"text/css\" />\n" : "";
+    $HEAD .= ($preview) ? "<title>Signup Preview</title>\n" : "";
+	if($SIGNUPEMAIL_USETHEME == 2)
+	{
+		$CSS = file_get_contents(THEME."style.css");
+		$HEAD .= "<style>\n".$CSS."\n</style>";
+	}
+
+	$HEAD .= "</head>\n";
+	if($SIGNUPEMAIL_BACKGROUNDIMAGE)
+	{
+		$HEAD .= "<body background=\"cid:".md5($SIGNUPEMAIL_BACKGROUNDIMAGE)."\" >\n";
+	}
+	else
+	{
+		$HEAD .= "<body>\n";
+	}
+	$FOOT = "\n</body>\n</html>\n";
+
+	$SIGNUPEMAIL_TEMPLATE = $HEAD.$SIGNUPEMAIL_TEMPLATE.$FOOT;
+	$message = str_replace($search,$replace,$SIGNUPEMAIL_TEMPLATE);
+
+	$ret['message'] = str_replace($cid_search,$cid_replace,$message);
+	$ret['preview'] = str_replace($path_search,$path_replace,$message);
+
+	return $ret;
+}
 ?>
\ No newline at end of file
diff -ruN 6171/sitedown.php 75/sitedown.php
--- 6171/sitedown.php	2004-09-09 21:58:10.000000000 -0500
+++ 75/sitedown.php	2005-06-11 17:24:48.000000000 -0500
@@ -1,35 +1,45 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/sitedown.php,v $
-|     $Revision: 1.6 $
-|     $Date: 2004/09/10 02:58:10 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-require_once("class2.php");
-$tp = new textparse;
-$text = "<font style='font-size: 14px; color: black; font-family: Tahoma, Verdana, Arial, Helvetica; text-decoration: none'>
-<div style='text-align:center'>
-<img src='".e_IMAGE."logo.png' alt='Logo' />
-</div>
-<hr />
-<br />
-
-<div style='text-align:center'>".($pref['maintainance_text'] ? $tp -> tpa($pref['maintainance_text'],"","admin") : "<b>- ".SITENAME." ".LAN_00." -</b><br /><br />".LAN_01 )."</div>";
-echo "<html><head><title>".PAGE_NAME."</title></head><body>";
-
-echo $text;
-
-echo "</body></html>";
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/sitedown.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/06/11 22:24:48 $
+|     $Author: streaky $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+
+global $pref;
+global $tp;
+
+e107_include_once(e_LANGUAGEDIR.e_LANGUAGE."/lan_sitedown.php");
+e107_include_once(e_LANGUAGEDIR."English/lan_sitedown.php");
+
+if($pref['maintainance_text']) {
+	$SITEDOWN_TABLE_MAINTAINANCETEXT = $tp->toHTML($pref['maintainance_text'], TRUE, 'parse_sc', 'admin');
+} else {
+	$SITEDOWN_TABLE_MAINTAINANCETEXT = "<b>- ".SITENAME." ".LAN_00." -</b><br /><br />".LAN_01 ;
+}
+
+$SITEDOWN_TABLE_PAGENAME = PAGE_NAME;
+	
+if (!$SITEDOWN_TABLE) {
+	if (file_exists(THEME."sitedown_template.php")) {
+		require_once(THEME."sitedown_template.php");
+	} else {
+		require_once(e_THEME."templates/sitedown_template.php");
+	}
+}
+
+echo preg_replace("/\{(.*?)\}/e", '$\1', $SITEDOWN_TABLE);
+	
 ?>
\ No newline at end of file
diff -ruN 6171/sitemap.php 75/sitemap.php
--- 6171/sitemap.php	2004-09-09 04:31:42.000000000 -0500
+++ 75/sitemap.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,127 +0,0 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/sitemap.php,v $
-|     $Revision: 1.2 $
-|     $Date: 2004/09/09 09:31:42 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-
-///////////////////
-// If you need to add some links, do NOT edit this file
-// BUT Edit e107_handlers/sitemap/sitemap_custom.php"
-///////////////////
-require_once("class2.php");
-require_once(HEADERF);
-$sql2 = new db;
-
-if(file_exists(THEME."images/extand_ico.png")){
-        define("SM_ICO_EXP","<img onclick=\"if(this.src.indexOf('".THEME."images/extand_ico.png')!=-1){this.src='".THEME."images/extand2_ico.png'}else{this.src='".THEME."images/extand_ico.png'}\" class='icoexp' src='".THEME."images/extand_ico.png' style='border: 0px; width: 11px; height: 11px;' />");
-        define("SM_ICO_URL",THEME."images/extand_ico.png");
-}else{
-        define("SM_ICO_EXP","<img onclick=\"if(this.src.indexOf('".e_IMAGE."generic/extand_ico.png')!=-1){this.src='".e_IMAGE."generic/extand2_ico.png'}else{this.src='".e_IMAGE."generic/extand_ico.png'}\" class='icoexp' src='".e_IMAGE."generic/extand_ico.png' style='border: 0px; width: 11px; height: 11px;' />");
-        define("SM_ICO_URL",e_IMAGE."generic/extand_ico.png");
-}
-if(file_exists(THEME."images/extand2_ico.png")){
-        define("SM_ICO_URL2",THEME."images/extand2_ico.png");
-}else{
-        define("SM_ICO_URL2",e_IMAGE."generic/extand2_ico.png");
-}
-
-
-$caption = LANSM_1. " ".SITENAME." <b>".SITEURL."</b>";
-$text = "\n\n
-<script type='text/javascript' src='".e_HANDLER."javascript/sitemap.php' ></script>
-\n\n";
-
-
-
-// Help
-$text .= "<p>\n<a href=\"javascript:void(0);\" onclick=\"ejs_func_todo=ejs_expandall('cats',ejs_func_todo,'subcats');ejs_func_todo2=ejs_expandpics('icoexp',ejs_func_todo2,'".SM_ICO_URL."','".SM_ICO_URL2."');\" > ".LANSM_7."</a> ".LANSM_31." <img src='".e_IMAGE."generic/extand_ico.png' style='border: 0px; width: 11px; height: 11px;' /> ".LANSM_41."</p>\n";
-
-
-$text .= "<br /><br />\n
-<p><b>".PAGE_NAME."</b></p>\n
-<br /><br />\n\n";
-
-// "Home" pages
-$text .= "<p class='caption2' style='text-align: left;' >\n
-<img src='".THEME."images/bullet2.gif' alt='bullet' /> <a class=\"sitemap2\" href=\"".SITEURL."\" >".LANSM_2."</a> <b class='smalltext' >".LANSM_3."</b>\n
-</p><br />\n";
-
-// News
-if($sql -> db_Select("news","news_id")){
-        require_once(e_HANDLER."sitemap/sitemap_news.php");
-        $text .= sm_news();
-}
-
-// Links
-if($sql -> db_Select("links","link_id","link_category!='1'")){
-        require_once(e_HANDLER."sitemap/sitemap_links.php");
-        $text .= sm_links();
-}
-
-// Forums
-if($sql -> db_Select("forum","forum_id")){
-        require_once(e_HANDLER."sitemap/sitemap_forums.php");
-        $text .= sm_forums();
-}
-
-// Downloads
-if($sql -> db_Select("download_category","download_category_id")){
-        require_once(e_HANDLER."sitemap/sitemap_downloads.php");
-        $text .= sm_downloads();
-}
-
-// Articles
-if($sql -> db_Select("content","content_id","content_type='6' OR (content_type='0' AND content_parent='0')")){
-        require_once(e_HANDLER."sitemap/sitemap_articles.php");
-        $text .= sm_articles();
-}
-
-// Reviews
-if($sql -> db_Select("content","content_id","content_type='10' OR (content_type='3' AND content_parent='0')")){
-        require_once(e_HANDLER."sitemap/sitemap_reviews.php");
-        $text .= sm_reviews();
-}
-
-// Content
-if($sql -> db_Select("content","content_id","content_type='1'")){
-        require_once(e_HANDLER."sitemap/sitemap_content.php");
-        $text .= sm_content();
-}
-
-// Members
-require_once(e_HANDLER."sitemap/sitemap_members.php");
-$text .= sm_members();
-
-// Stats
-require_once(e_HANDLER."sitemap/sitemap_stats.php");
-$text .= sm_stats();
-
-// Plugins
-require_once(e_HANDLER."sitemap/sitemap_plugin.php");
-$text .= sm_plugins();
-
-// Other pages
-require_once(e_HANDLER."sitemap/sitemap_custom.php");
-$text .= sm_custom();
-
-
-// Display Sitemap
-$ns -> tablerender($caption, $text);
-
-
-
-require_once(FOOTERF);
-?>
\ No newline at end of file
diff -ruN 6171/stats.php 75/stats.php
--- 6171/stats.php	2004-08-14 21:44:34.000000000 -0500
+++ 75/stats.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,217 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/stats.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-|
-| $Source: /cvsroot/e107/e107/stats.php,v $
-| $Revision: 1.4 $
-| $Date: 2004/08/15 02:44:34 $
-| $Author: mcfly_e107 $ 
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-require_once(HEADERF);
-
-if(!$pref['log_activate']){
-	if(ADMIN){
-		$text = "<div style='text-align:center'>".LAN_371."</div>";
-	}else{
-		$text = "<div style='text-align:center'>".LAN_372."</div>";
-	}
-	$ns -> tablerender(LAN_132, $text);
-	require_once(FOOTERF);
-	exit;
-}
-
-$header = "colspan='2' class='forumheader3'";
-$leftcolumn = "style='width:25%' class='forumheader3'";
-$rightcolumn = "style='width:75%; text-align:right' class='forumheader3'";
-
-$text = "<div style='text-align:center'>\n<table style='width:95%' class='fborder'>\n";
-
-if($sql -> db_Select("stat_counter", "*", "ORDER BY counter_date", "no-where")){
-	$row = $sql -> db_Fetch();
-	$tmp = explode("-", $row['counter_date']);
-	$tmp2 = getdate(mktime(0, 0, 0, $tmp[1], $tmp[2], $tmp[0]));
-	$logstart = $tmp[2]." ".$tmp2['month']." ".$tmp[0];
-	$logdays = intval(abs(((((strtotime ($logstart) - time())/60)/60)/24)));
-}else{
-	$logstart = LAN_373;
-	$logdays = 0;
-}
-
-//$date_secs = strtotime ($logstart); echo $date_secs;
-//$timediff = (strtotime ($logstart) - time());
-
-
-$text .= "<tr>\n<td $leftcolumn>".LAN_374."</td>\n<td $rightcolumn><b>".$logstart."</b> ($logdays ".LAN_418.")</td>\n</tr>\n";
-$action = e_QUERY;
-
-$total_unique_views = $sql -> db_Count("SELECT sum(counter_unique) FROM ".MPREFIX."stat_counter", "generic");
-$total_page_views = $sql -> db_Count("SELECT sum(counter_total) FROM ".MPREFIX."stat_counter", "generic");
-
-$daily_average = @round(($total_page_views/$logdays), 0);
-$weekly_average = @round(($total_page_views/($logdays/7)), 0);
-$monthly_average = @round(($total_page_views/($logdays/30)), 0);
-
-$text .= "<tr>\n<td $leftcolumn>".LAN_124."</td>\n<td $rightcolumn><b>".($total_unique_views ? $total_unique_views : "&nbsp;")."</b></td>\n</tr>\n<tr>\n<td $leftcolumn>".LAN_125."</td>\n<td $rightcolumn><b>".($total_page_views? $total_page_views : "&nbsp;")."</b></td>\n</tr>\n
-
-<tr>
-<td $leftcolumn>".LAN_419.":</td>
-<td $rightcolumn>".($daily_average ? $daily_average : LAN_422)."</td>
-</tr>
-
-<tr>
-<td $leftcolumn>".LAN_420.":</td>
-<td $rightcolumn>".($weekly_average ? $weekly_average : LAN_422)."</td>
-</tr>
-
-<tr>
-<td $leftcolumn>".LAN_421.":</td>
-<td $rightcolumn>".($monthly_average ? $monthly_average : LAN_422)."</td>
-</tr>
-
-
-</table>\n<br />
-";
-
-$sql -> db_Select_gen("SELECT counter_url, sum(counter_unique) FROM ".MPREFIX."stat_counter GROUP BY counter_url");
-$text .= ($action == 1 ? parse_data($row, 0, $total_unique_views, 1, LAN_126) : parse_data($row, 10, $total_unique_views, 1, LAN_126));
-
-$sql -> db_Select_gen("SELECT counter_url, sum(counter_total) FROM ".MPREFIX."stat_counter GROUP BY counter_url");
-$text .= ($action == 2 ? parse_data($row, 0, $total_page_views, 2, LAN_127) : parse_data($row, 10, $total_page_views, 2, LAN_127));
-
-$con = new convert;
-$tmp = str_replace("10", $pref['log_lvcount'], LAN_376);
-$text .= "<table style='width:95%' class='fborder'>
-<tr>
-<td class='forumheader3'><b>$tmp</b></td>
-</tr>";
-
-$sql -> db_Select("stat_last", "*", "ORDER BY stat_last_date DESC LIMIT 0,".$pref['log_lvcount'], "no_where");
-
-while($row = $sql-> db_Fetch()){
-	extract($row);
-	$datestamp = $con -> convert_date($stat_last_date, "short");
-	$text .= "<tr>\n<td class='forumheader3'><span class='smalltext'>".$datestamp.": ".$stat_last_info."</span></td>\n</tr>";
-}
-$text .= "\n</table>\n<br />";
-
-$total_browsers = $sql -> db_Count("SELECT sum(info_count) FROM ".MPREFIX."stat_info WHERE info_type='1'", "generic");
-$sql -> db_Select_gen("SELECT info_name, SUM(info_count) FROM ".MPREFIX."stat_info WHERE info_type='1' GROUP BY info_name");
-$text .= ($action == 3 ? parse_data($row, 0, $total_browsers, 3, LAN_128) : parse_data($row, 10, $total_browsers, 3, LAN_128));
-
-$total_os = $sql -> db_Count("SELECT sum(info_count) FROM ".MPREFIX."stat_info WHERE info_type='2'", "generic");
-$sql -> db_Select_gen("SELECT info_name, SUM(info_count) AS Total FROM ".MPREFIX."stat_info WHERE info_type='2' GROUP BY info_name");
-$text .= ($action == 4 ? parse_data($row, 0, $total_os, 4, LAN_129) : parse_data($row, 10, $total_os, 4, LAN_129));
-
-$total_country = $sql -> db_Count("SELECT sum(info_count) FROM ".MPREFIX."stat_info WHERE info_type='4'", "generic");
-$sql -> db_Select_gen("SELECT info_name, SUM(info_count) AS Total FROM ".MPREFIX."stat_info WHERE info_type='4' GROUP BY info_name");
-$text .= ($action == 5 ? parse_data($row, 0, $total_os, 5, LAN_130) : parse_data($row, 10, $total_os, 5, LAN_130));
-
-$total_refer = $sql -> db_Count("SELECT sum(info_count) FROM ".MPREFIX."stat_info WHERE info_type='6'", "generic");
-$sql -> db_Select_gen("SELECT info_name, SUM(info_count) AS Total FROM ".MPREFIX."stat_info WHERE info_type='6' GROUP BY info_name");
-$text .= ($action == 6 ? parse_data($row, 0, $total_refer, 6, LAN_131) : parse_data($row, 10, $total_refer, 6, LAN_131));
-
-$total_res = $sql -> db_Count("SELECT sum(info_count) FROM ".MPREFIX."stat_info WHERE info_type='5'", "generic");
-$sql -> db_Select_gen("SELECT info_name, SUM(info_count) AS Total FROM ".MPREFIX."stat_info WHERE info_type='5' GROUP BY info_name");
-$text .= ($action == 7 ? parse_data($row, 0, $total_res, 7, LAN_379) : parse_data($row, 10, $total_res, 7, LAN_379));
-
-$text .= "</div>";
-
-$ns -> tablerender(LAN_132, $text);
-require_once(FOOTERF);
-
-function parse_data($row, $amount, $total, $action_n, $lan){
-	global $sql, $action;
-
-	$str .= "<table style='width:95%' class='fborder'>\n<tr>\n<td colspan='4' class='forumheader3'><b>$lan</b> ".
-	($action == $action_n ? LAN_377 : LAN_378.(($action_n == 6 && ADMIN) || $action_n != 6 ? " ( <a href='".e_SELF."?$action_n'>".LAN_375."</a> )" : ""))."</td>\n</tr>";
-
-
-	while($row = $sql -> db_Fetch()){
-		$data[$c][0] = $row[1];
-		$data[$c][1] = $row[0];
-		$data[$c][2] = @round(($data[$c][0]/$total)*100,2);
-		$c++;
-	}
-	if($c){
-		rsort($data);
-	}
-	$c=0;
-	if(!$amount && $amount != 6){
-		while($data[$c][0]){
-			if($action_n == 3 || $action_n == 4){
-				$imagepath = e_IMAGE."log/";
-				if(eregi("windows", $data[$c][1])){ $image = $imagepath."windows.png";
-				}else if(eregi("netscape", $data[$c][1])){ $image = $imagepath."netscape.png";
-				}else if(eregi("konqueror", $data[$c][1])){ $image = $imagepath."konqueror.png";
-				}else if(eregi("opera", $data[$c][1])){ $image = $imagepath."opera.png";
-				}else if(eregi("links", $data[$c][1]) || eregi("lynx",$data[$c][1])){ $image = $imagepath."lynx.png";
-				}else if(eregi("mac", $data[$c][1])){ $image = $imagepath."mac.png";
-				}else if(eregi("explorer", $data[$c][1])){ $image = $imagepath."explorer.png";
-				}else if(eregi("firebird", $data[$c][1])){ $image = $imagepath."firebird.png";
-				}else if(eregi("firefox", $data[$c][1])){ $image = $imagepath."firefox.png";
-				}else if(file_exists($imagepath.strtolower($data[$c][1])).".png"){ $image = $imagepath.strtolower($data[$c][1]).".png";}else{unset($image);}
-			}
-
-			$tmp = explode(".", $data[$c][2]); $width = $tmp[0];
-			if(eregi("http://", $data[$c][1])){
-				$data[$c][1] = "<a href='".$data[$c][1]."'>".$data[$c][1]."</a>";
-			}
-			$str .= "<tr>\n<td style='width:25%' class='forumheader3'>";
-			
-			if($image){
-				$str .= "<img src='$image' alt='' /> ";
-			}
-			$str .= $data[$c][1]."</td>\n<td style='width:55%' class='forumheader3'>\n<img src='".THEME."images/bar2edge.gif' width='1' height='8' alt='' /><img src='".THEME."images/bar2.gif' style='width:".$width."%' height='8' alt='' /><img src='".THEME."images/bar2edge.gif' width='1' height='8' alt='' />\n</td>\n<td style='width:10%; text-align:center' class='forumheader3'>".$data[$c][0]."</td>\n<td style='width:10%; text-align:center' class='forumheader3'>".$data[$c][2]."%</td>\n</tr>\n";
-			$c++;
-		}
-	}else{
-		for($r=0; $r<=9; $r++){
-			if($data[$c][0]){
-				if($action_n == 3 || $action_n == 4){
-					$imagepath = e_IMAGE."log/";
-					if(eregi("windows", $data[$c][1])){ $image = $imagepath."windows.png";
-					}else if(eregi("netscape", $data[$c][1])){ $image = $imagepath."netscape.png";
-					}else if(eregi("konqueror", $data[$c][1])){ $image = $imagepath."konqueror.png";
-					}else if(eregi("opera", $data[$c][1])){ $image = $imagepath."opera.png";
-					}else if((eregi("links", $data[$c][1]) || eregi("lynx",$data[$c][1])) && !eregi("php", $data[$c][1])){ $image = $imagepath."lynx.png";
-					}else if(eregi("mac", $data[$c][1])){ $image = $imagepath."mac.png";
-					}else if(eregi("explorer", $data[$c][1])){ $image = $imagepath."explorer.png";
-					}else if(eregi("firebird", $data[$c][1])){ $image = $imagepath."firebird.png";
-					}else if(eregi("firefox", $data[$c][1])){ $image = $imagepath."firefox.png";
-					}else if(file_exists($imagepath.strtolower($data[$c][1])).".png"){ $image = $imagepath.strtolower($data[$c][1]).".png";}else{unset($image);}
-				}
-
-
-				$tmp = explode(".", $data[$c][2]); $width = $tmp[0];
-				if(eregi("http://", $data[$c][1])){
-					$data[$c][1] = "<a href='".$data[$c][1]."' rel='external'>".$data[$c][1]."</a>";
-				}
-				$str .= "<tr>\n<td style='width:25%' class='forumheader3'>";
-				
-				if($image){
-					$str .= "<img src='$image' alt='' /> ";
-				}
-				
-				$str .= $data[$c][1]."</td>\n<td style='width:55%; white-space:nowrap;' class='forumheader3'>\n<img src='".THEME."images/bar2edge.gif' width='1' height='8' alt='' /><img src='".THEME."images/bar2.gif' style='width:".$width."%' height='8' alt='' /><img src='".THEME."images/bar2edge.gif' width='1' height='8' alt='' />\n</td>\n<td style='width:10%; text-align:center' class='forumheader3'>".$data[$c][0]."</td>\n<td style='width:10%; text-align:center' class='forumheader3'>".$data[$c][2]."%</td>\n</tr>\n";
-				$c++;
-			}
-		}
-	}
-
-	
-
-	$str .= "</table><br />";
-	return $str;
-}
-?>
\ No newline at end of file
diff -ruN 6171/subcontent.php 75/subcontent.php
--- 6171/subcontent.php	2004-09-07 07:10:04.000000000 -0500
+++ 75/subcontent.php	2005-12-21 15:55:20.000000000 -0600
@@ -1,331 +1,28 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /subcontent.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-$aj = new textparse;
-require_once(e_HANDLER."form_handler.php");
-require_once(e_HANDLER."userclass_class.php");
-$rs = new form;
-
-if(e_QUERY){
-        $tmp = explode(".", e_QUERY);
-        $action = $tmp[0];
-        $sub_action = $tmp[1];
-        $id = $tmp[2];
-        unset($tmp);
-}
-if($action == "article"){
-        define("e_PAGETITLE", ARLAN_15.(IsSet($_POST['preview']) ? " / ".ARLAN_28 : ""));
-}elseif($action == "review"){
-        define("e_PAGETITLE", ARLAN_89);
-}
-
-require_once(HEADERF);
-if(IsSet($_POST['preview'])){
-        $obj = new convert;
-        $datestamp = $obj->convert_date(time(), "long");
-
-        $content_heading = $aj -> formtpa($_POST['content_heading']);
-        $content_subheading = $aj -> formtpa($_POST['content_subheading']);
-        $content_summary = $aj -> formtpa($_POST['content_summary']);
-        $data = $aj -> formtpa($_POST['data']);
-
-		if(USER === TRUE)
-		{
-			$content_author = USERNAME;
-		}
-		else
-		{
-			if(!$_POST['content_author'] || $_POST['content_author'] == ARLAN_84)
-			{
-				$content_author = "<b>".ARLAN_92."<b>";
-			}
-			else
-			{
-				$content_author = $_POST['content_author'];
-				$content_author_email = $_POST['content_author_email'];
-			}
-		}
-			
-        $text = "<i>by $content_author</i><br /><span class='smalltext'>".$datestamp."</span><br /><br />Subheading: ".$aj -> tpa($content_subheading)."<br />".ARLAN_19.": ".$aj -> tpa($content_summary)."<br /><br />".$aj -> tpa($data);
-        $ns -> tablerender($aj -> tpa($content_heading), $text);
-        echo "<br /><br />";
-
-        $content_parent = $_POST['category'];
-        if($content_author == "<b>".ARLAN_92."<b>"){ $content_author = ""; }
-}
-
-if(IsSet($_POST['create_article'])){
-        if(USER){
-                $_POST['content_author'] = USERNAME;
-                $_POST['content_author_email'] = USEREMAIL;
-        }
-        if($_POST['data'] && $_POST['content_author'] && $_POST['content_heading']){
-                $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-                $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-                $content_content = $aj -> formtpa($_POST['data'], "admin");
-                $content_author = (!$_POST['content_author'] || $_POST['content_author'] == ARLAN_84 ? ADMINID : $_POST['content_author']."^".$_POST['content_author_email']);
-                if($content_author == "ADMINID"){
-                        $message = ARLAN_90;
-                }else{
-                        $sql -> db_Insert("content", "0, '$content_heading', '$content_subheading', '$content_content', '".$_POST['category']."', '".time()."', '$content_author', '".$_POST['content_comment']."', '".$_POST['content_summary']."', '15' ,'0' ,0 , 0");
-                        unset($content_heading, $content_subheading, $data, $content_summary, $content_author);
-                        $message = ARLAN_0;
-                }
-        }else{
-                $message = ARLAN_1;
-        }
-}
-
-if(IsSet($_POST['create_review'])){
-        if(USER){
-                $_POST['content_author'] = USERNAME;
-                $_POST['content_author_email'] = USEREMAIL;
-        }
-        if($_POST['data'] && $_POST['content_author'] && $_POST['content_heading']){
-                $content_subheading = $aj -> formtpa($_POST['content_subheading'], "admin");
-                $content_heading = $aj -> formtpa($_POST['content_heading'], "admin");
-                $content_content = $aj -> formtpa($_POST['data'], "admin");
-                $content_author = (!$_POST['content_author'] || $_POST['content_author'] == ARLAN_84 ? ADMINID : $_POST['content_author']."^".$_POST['content_author_email']);
-                if($content_author == "ADMINID"){
-                        $message = ARLAN_90;
-                }else{
-                         $sql -> db_Insert("content", "0, '".$content_heading."', '".$content_subheading."', '$content_content', '".$_POST['category']."', '".time()."', '".$content_author."', '".$_POST['content_comment']."', '".$_POST['content_summary']."', '16', ".$_POST['content_rating'].", 0, 0");
-                        unset($content_heading, $content_subheading, $data, $content_summary);
-                        $message = ARLAN_2;
-                }
-        }else{
-                $message = ARLAN_1;
-        }
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
-        require_once(FOOTERF);
-        exit;
-}
-
-if($action == "article"){
-
-        if (!($pref['article_submit'])){
-                $articlesubmit = ARLAN_95;
-        }
-
-        if (!check_class($pref['article_submit_class'])){
-                $articlesubmit = ARLAN_97;
-        }
-
-        if(IsSet($articlesubmit)){
-                $ns -> tablerender("", "<div style='text-align:center'><b>".$articlesubmit."</b></div>");
-                require_once(FOOTERF);
-                exit;
-        }
-        $text = "<div style='text-align:center'>
-        ".$rs -> form_open("post", e_SELF."?".e_QUERY."", "dataform")."
-        <table style='width:95%' class='fborder'>
-
-        <tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'>".ARLAN_74.":</td>
-        <td style='width:80%' class='forumheader3'>";
-
-        $sql -> db_Select("content", "*", "content_type=6 ");
-        $text .= $rs->form_select_open("category");
-        $text .= (!$content_parent ? $rs -> form_option("- ".ARLAN_75." -", 1, -1) : $rs -> form_option("- ".ARLAN_75." -", 0, -1));
-        while(list($category_id, $category_name) = $sql-> db_Fetch()){
-                $text .= ($category_id == $content_parent ? $rs -> form_option($category_name, 1, $category_id) : $rs -> form_option($category_name, 0, $category_id));
-        }
-        $text .= $rs -> form_select_close()."
-        </td>
-        </tr>";
-
-        if(!USER){
-
-        $text .= "<tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'>".ARLAN_82.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_author' size='60' value='".($content_author ? $content_author : ARLAN_84)."' maxlength='100' ".($content_author ? "" : "onFocus=\"document.dataform.content_author.value='';\"")." /><br />
-        <input class='tbox' type='text' name='content_author_email' size='60' value='".($content_author_email ? $content_author_email : ARLAN_85)."' maxlength='100' ".($content_author_email ? "" : "onFocus=\"document.dataform.content_author_email.value='';\"")." /><br />
-        </td>
-        </tr>";
-        }
-
-        $text .= "<tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'>".ARLAN_17.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_heading' size='60' value='$content_heading' maxlength='100' />
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_18.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_subheading' size='60' value='$content_subheading' maxlength='100' />
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_19.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <textarea class='tbox' name='content_summary' cols='90' rows='5'>$content_summary</textarea>
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_20.": </td>
-        <td style='width:80%' class='forumheader3'>
-        <textarea class='tbox' name='data' cols='90' rows='30'>$data</textarea>
-        <br />
-        <input class='helpbox' type='text' name='helpb' size='100' />
-        <br />";
-
-        require_once(e_HANDLER."ren_help.php");
-        $text .= ren_help(1, "addtext2", "help")."
-        </td>
-        </tr>
-
-        <tr style='vertical-align:top'>
-        <td colspan='2'  style='text-align:center' class='forumheader'>".
-        (!$_POST['preview'] ? "<input class='button' type='submit' name='preview' value='".ARLAN_28."' />" : "<input class='button' type='submit' name='preview' value='".ARLAN_91."' />")." ".
-        ($sub_action == "edit" || $_POST['editp']? "<input class='button' type='submit' name='update_article' value='".ADLAN_81." ".ARLAN_20."' />\n<input type='hidden' name='content_id' value='$id'>" : "<input class='button' type='submit' name='create_article' value='".ARLAN_27."' />")."
-        </td>
-        </tr>
-        </table>
-        </form>
-        </div>";
-
-        $ns -> tablerender("<div style='text-align:center'>".ARLAN_15."</div>", $text);
-}
-// ##### End ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
-if($action == "review"){
-
-        if (!($pref['review_submit'])){
-                $reviewsubmit = ARLAN_96;
-        }
-
-        if (!check_class($pref['review_submit_class'])){
-                $reviewsubmit = ARLAN_98;
-        }
-
-        if(IsSet($reviewsubmit)){
-                $ns -> tablerender("", "<div style='text-align:center'><b>".$reviewsubmit."</b></div>");
-                require_once(FOOTERF);
-                exit;
-        }
-        $text = "<div style='text-align:center'>
-        ".$rs -> form_open("post", e_SELF."?create", "dataform")."
-
-        <table style='width:95%' class='fborder'>
-        <tr>
-
-        <td style='width:20%; vertical-align:top' class='forumheader3'><span style='text-decoration: underline;'>".ARLAN_74."</span>:</td>
-        <td style='width:80%' class='forumheader3'>";
-
-        $sql -> db_Select("content", "*", "content_type=10 ");
-        $text .= $rs->form_select_open("category");
-        $text .= (!$category ? $rs -> form_option("- ".ARLAN_75." -", 1, -1) : $rs -> form_option("- ".ARLAN_75." -", 0, -1));
-        while(list($category_id, $category_name) = $sql-> db_Fetch()){
-                $text .= ($category_id == $category ? $rs -> form_option($category_name, 1, $category_id) : $rs -> form_option($category_name, 0, $category_id));
-        }
-        $text .= $rs -> form_select_close()."
-        </td>
-        </tr>";
-
-        if(!USER){
-
-        $text .= "<tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'>".ARLAN_82.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_author' size='60' value='".($content_author ? $content_author : ARLAN_84)."' maxlength='100' ".($content_author ? "" : "onFocus=\"document.dataform.content_author.value='';\"")." /><br />
-        <input class='tbox' type='text' name='content_author_email' size='60' value='".($content_author_email ? $content_author_email : ARLAN_85)."' maxlength='100' ".($content_author_email ? "" : "onFocus=\"document.dataform.content_author_email.value='';\"")." /><br />
-        </td>
-        </tr>";
-        }
-
-        $text .= "<tr>
-        <td style='width:20%; vertical-align:top' class='forumheader3'><span style='text-decoration: underline;'>".ARLAN_17."</span>:</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_heading' size='60' value='$content_heading' maxlength='100' />
-
-        </td>
-        </tr>
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_18.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <input class='tbox' type='text' name='content_subheading' size='60' value='$content_subheading' maxlength='200' />
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_19.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <textarea class='tbox' name='content_summary' cols='70' rows='5'>$content_summary</textarea>
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'><span style='text-decoration: underline;'>".ARLAN_86."</span>: </td>
-        <td style='width:80%' class='forumheader3'>
-        <textarea class='tbox' name='data' cols='70' rows='30'>$data</textarea>
-        <br />
-        <input class='helpbox' type='text' name='helpb' size='100' />
-        <br />";
-        require_once(e_HANDLER."ren_help.php");
-        $text .= ren_help(1, "addtext2", "help")."
-        </td>
-        </tr>
-
-        <tr>
-        <td style='width:20%' class='forumheader3'>".ARLAN_87.":</td>
-        <td style='width:80%' class='forumheader3'>
-        <select name='content_rating' class='tbox'>
-        <option value='0'>".ARLAN_88." ...</option>";
-        for($a=1; $a<=100; $a++){
-                $text .= ($content_rating == $a ? "<option value='$a' selected>$a</option>" : "<option value='$a'>$a</option>");
-        }
-        $text .= "</select>
-        </td>
-        </tr>
-
-
-        <tr style='vertical-align:top'>
-        <td colspan='2' style='text-align:center' class='forumheader'>
-        <input class='button' type='submit' name='create_review' value='".ARLAN_89."' />
-
-        </td>
-        </tr>
-        </table>
-        </form>
-        </div>";
-
-        $ns -> tablerender("<div style='text-align:center'>".ARLAN_89."</div>", $text);
-
-}
-require_once(FOOTERF);
-
-function headerjs(){
-$script_txt= "<script type=\"text/javascript\">
-function addtext2(sc){
-        document.getElementById('dataform').data.value += sc;
-}
-function help(help){
-        document.getElementById('dataform').helpb.value = help;
-}
-</script>\n";
-return $script_txt;
-}
-
-?>
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/subcontent.php,v $
+|     $Revision: 1.6 $
+|     $Date: 2005/12/21 21:55:20 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+
+//redirection to new content management plugin if it is installed
+if ($sql -> db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){ 
+	header("location:".e_PLUGIN."content/content_submit.php");
+} else {
+	header("location:".e_BASE."index.php");
+}
+	
+?>
\ No newline at end of file
diff -ruN 6171/submitnews.php 75/submitnews.php
--- 6171/submitnews.php	2004-08-12 10:54:52.000000000 -0500
+++ 75/submitnews.php	2005-12-24 16:53:38.000000000 -0600
@@ -1,197 +1,218 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /submitnews.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|   $Id: submitnews.php,v 1.13 2004/08/12 15:54:52 e107coders Exp $
-+---------------------------------------------------------------+
-*/
-
-
-require_once("class2.php");
-if($pref['subnews_htmlarea']){
-        require_once(e_HANDLER."htmlarea/htmlarea.inc.php");
-        $htmlarea_js = htmlarea("item");
-}
-require_once(HEADERF);
-
-if(!isset($pref['subnews_class'])){
-        $pref['subnews_class']="0";
-}
-if(!check_class($pref['subnews_class'])){
-        $ns -> tablerender(NWSLAN_12,NWSLAN_11);
-        require_once(FOOTERF);
-        exit;
-}
-
-$author_name=textparse::tpj($_POST['author_name'],TRUE);
-$author_email=check_email($_POST['author_email']);
-
-
-
-if(IsSet($_POST['submit'])){
-
-        if($_POST['itemtitle'] == ""){
-        $message .= SUBNEWSLAN_1;
-        $error = TRUE;
-        }
-
-        if($_POST['item'] == ""){
-        $message .= SUBNEWSLAN_2;
-        $error = TRUE;
-        }
-
-                $user = (USER ? USERNAME : $author_name);
-                $email = (USER ? USEREMAIL : $author_email);
-
-                if($user && $email){
-
-                        $ip = getip();
-                        $fp = new floodprotect;
-                        if($fp -> flood("submitnews", "submitnews_datestamp") == FALSE){
-                                header("location:".e_BASE."index.php");
-                                exit;
-                        }
-                        $aj = new textparse;
-
-                        $itemtitle = $aj -> formtpa($_POST['itemtitle'], "public");
-                        $item = $aj -> formtpa($_POST['item'], "public");
-                        $item = str_replace("src=&quot;e107_images","src=&quot;".SITEURL."e107_images",$item);
-
-
-// Process File Upload    =================================================
-if($_FILES['file_userfile']){
-        require_once(e_HANDLER."upload_handler.php");
-        $uploaded = file_upload(e_IMAGE."newspost_images/");
-        $file = $uploaded[0]['name'];
-        $filetype = $uploaded[0]['type'];
-        $filesize = $uploaded[0]['size'];
-        $fileext = substr(strrchr($file, "."), 1);
-
-        if(!$pref['upload_maxfilesize']){
-            $pref['upload_maxfilesize'] = ini_get('upload_max_filesize')*1048576;
-        }
-
-        if($uploaded && $fileext != "jpg" && $fileext != "gif" && $fileext != "png"){
-            $message = SUBNEWSLAN_3;
-            $error = TRUE;
-        }
-
-        if($filesize > $pref['upload_maxfilesize']){
-            $message = SUBNEWSLAN_4;
-            $error = TRUE;
-        }
-
-        if(!$error){
-         //   $numberoffiles = count($uploaded);
-            $today = getdate();
-            $newname = USERID."_".$today[0]."_".str_replace(" ","_",substr($_POST['itemtitle'],0,6)).".".$fileext;
-            if($file && $pref['subnews_resize']){
-                require_once(e_HANDLER."resize_handler.php");
-                $rezwidth = $pref['subnews_resize'];
-                if(!resize_image(e_IMAGE."newspost_images/".$file,e_IMAGE."newspost_images/". $newname,$rezwidth)){
-                    rename(e_IMAGE."newspost_images/".$file,e_IMAGE."newspost_images/". $newname);
-                }
-            }elseif($file){
-                rename(e_IMAGE."newspost_images/".$file,e_IMAGE."newspost_images/". $newname);
-            }
-
-       }
-
-}
-
-  // ==========================================================
-               if($error == FALSE){
-                if(!file_exists(e_IMAGE."newspost_images/". $newname)){$newname = ""; }
-                $sql -> db_Insert("submitnews", "0, '$user', '$email', '$itemtitle', '".intval($_POST['cat_id'])."','$item', '".time()."', '$ip', '0', '$newname' ");
-                $ns -> tablerender(LAN_133, "<div style='text-align:center'>".LAN_134."</div>");
-                require_once(FOOTERF);
-                exit;
-                }else{
-                require_once(e_HANDLER."message_handler.php");
-                message_handler("P_ALERT",$message);
-                }
-        }
-}
-// ==============================================================
-
-
-
-
-
-
-
-
-$text = "<div style='text-align:center'>
-<form method='post' action='".e_SELF."' enctype='multipart/form-data' >\n
-<table style='width:95%' class='fborder'>";
-if(!USER){
-        $text .= "<tr>\n<td style='width:20%' class='forumheader3'>".LAN_7."</td>\n<td style='width:80%' class='forumheader3'>\n<input class='tbox' type='text' name='author_name' size='60' value='$author_name' maxlength='100' />\n</td>\n</tr>\n<tr>\n<td style='width:20%' class='forumheader3'>".LAN_112."</td>\n<td style='width:80%' class='forumheader3'>\n<input class='tbox' type='text' name='author_email' size='60' value='$author_email' maxlength='100' />\n</td>\n</tr>";
-}
-
-$text .= " <tr>
-                <td style='width:20%' class='forumheader3'>".NWSLAN_6.": </td>
-                <td style='width:80%' class='forumheader3'>";
-
-                if(!$sql -> db_Select("news_category")){
-                        $text .= NWSLAN_10;
-                }else{
-
-                        $text .= "
-                        <select name='cat_id' class='tbox'>";
-
-                        while(list($cat_id, $cat_name, $cat_icon) = $sql-> db_Fetch()){
-                                $text .= ($_POST['cat_id'] == $cat_id ? "<option value='$cat_id' selected>".$cat_name."</option>" : "<option value='$cat_id'>".$cat_name."</option>");
-                        }
-                        $text .= "</select>";
-                }
-                $text .= "</td>
-                </tr><tr>
-<td style='width:20%' class='forumheader3'>".LAN_62."</td>
-<td style='width:80%' class='forumheader3'>
-<input class='tbox' type='text' name='itemtitle' size='60' value='$itemtitle' maxlength='200' style='width:90%' />
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_135."</td>
-<td style='width:80%' class='forumheader3'>
-<textarea class='tbox' id='item' name='item' cols='70' rows='10'></textarea>
-</td>
-</tr>\n";
-
-if($pref['subnews_attach']){
-    $text .="
-    <tr>
-    <td style='width:20%' class='forumheader3'>".SUBNEWSLAN_5."<br /><span class='smalltext'>".SUBNEWSLAN_6."</span></td>
-    <td style='width:80%' class='forumheader3'>
-    <input class='tbox' type='file' name='file_userfile[]' style='width:90%' />
-    </td>
-    </tr>\n";
-}
-
-$text .="
-
-
-
-<tr>
-<td colspan='2' style='text-align:center' class='forumheader'>
-<input class='button' type='submit' name='submit' value='".LAN_136."' />
-</td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender(LAN_136, $text);
-
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/submitnews.php,v $
+|     $Revision: 1.14 $
+|     $Date: 2005/12/24 22:53:38 $
+|     $Author: sweetas $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+require_once(HEADERF);
+
+if (!isset($pref['subnews_class']))
+{
+    $pref['subnews_class'] = "0";
+} 
+if (!check_class($pref['subnews_class']))
+{
+    $ns->tablerender(NWSLAN_12, NWSLAN_11);
+    require_once(FOOTERF);
+    exit;
+} 
+
+$author_name = $tp->toDB($_POST['author_name']);
+$author_email = $tp->toDB(check_email($_POST['author_email']));
+
+if (isset($_POST['submit']))
+{
+    $user = (USER ? USERNAME : $author_name);
+    $email = (USER ? USEREMAIL : $author_email);
+
+    if ($user && $email)
+    {
+        $ip = $e107->getip();
+        $fp = new floodprotect;
+        if ($fp->flood("submitnews", "submitnews_datestamp") == false)
+        {
+            header("location:" . e_BASE . "index.php");
+            exit;
+        } 
+        $itemtitle = $tp->toDB($_POST['itemtitle']);
+        $item = $tp->toDB($_POST['item']);
+        $item = str_replace("src=&quot;e107_images", "src=&quot;" . SITEURL . "e107_images", $item); 
+        // Process File Upload    =================================================
+        if ($_FILES['file_userfile'] && $pref['subnews_attach'] && $pref['upload_enabled'] && check_class($pref['upload_class']) && FILE_UPLOADS)
+        {
+            require_once(e_HANDLER . "upload_handler.php");
+            $uploaded = file_upload(e_IMAGE . "newspost_images/");
+            $file = $uploaded[0]['name'];
+            $filetype = $uploaded[0]['type'];
+            $filesize = $uploaded[0]['size'];
+            $fileext = substr(strrchr($file, "."), 1);
+
+            if (!$pref['upload_maxfilesize'])
+            {
+                $pref['upload_maxfilesize'] = ini_get('upload_max_filesize') * 1048576;
+            } 
+
+            if ($uploaded && $fileext != "jpg" && $fileext != "gif" && $fileext != "png")
+            {
+                $message = SUBNEWSLAN_3;
+                $error = true;
+            } 
+
+            if ($filesize > $pref['upload_maxfilesize'])
+            {
+                $message = SUBNEWSLAN_4;
+                $error = true;
+            } 
+
+            if (!$error)
+            { 
+                // $numberoffiles = count($uploaded);
+                $today = getdate();
+                $newname = USERID . "_" . $today[0] . "_" . str_replace(" ", "_", substr($itemtitle, 0, 6)) . "." . $fileext;
+                if ($file && $pref['subnews_resize'])
+                {
+                    require_once(e_HANDLER . "resize_handler.php");
+                    $rezwidth = $pref['subnews_resize'];
+                    if (!resize_image(e_IMAGE . "newspost_images/" . $file, e_IMAGE . "newspost_images/" . $newname, $rezwidth))
+                    {
+                        rename(e_IMAGE . "newspost_images/" . $file, e_IMAGE . "newspost_images/" . $newname);
+                    } 
+                } elseif ($file)
+                {
+                    rename(e_IMAGE . "newspost_images/" . $file, e_IMAGE . "newspost_images/" . $newname);
+                } 
+            } 
+        } 
+
+        if ($error == false)
+        {
+            if (!file_exists(e_IMAGE . "newspost_images/" . $newname))
+            {
+                $newname = "";
+            } 
+            $sql->db_Insert("submitnews", "0, '$user', '$email', '$itemtitle', '".intval($_POST['cat_id'])."','$item', '" . time() . "', '$ip', '0', '$newname' ");
+            $edata_sn = array("user" => $user, "email" => $email, "itemtitle" => $itemtitle, "catid" => intval($_POST['cat_id']), "item" => $item, "ip" => $ip, "newname" => $newname);
+            $e_event->trigger("subnews", $edata_sn);
+            $ns->tablerender(LAN_133, "<div style='text-align:center'>" . LAN_134 . "</div>");
+            require_once(FOOTERF);
+            exit;
+        } 
+        else
+        {
+            require_once(e_HANDLER . "message_handler.php");
+            message_handler("P_ALERT", $message);
+        } 
+    } 
+} 
+
+$text = "<div style='text-align:center'>
+	<form id='dataform' method='post' action='" . e_SELF . "' enctype='multipart/form-data' onsubmit='return frmVerify()'>\n
+	<table style='width:95%' class='fborder'>";
+if (!USER)
+{
+    $text .= "<tr>\n<td style='width:20%' class='forumheader3'>" . LAN_7 . "</td>\n<td style='width:80%' class='forumheader3'>\n<input class='tbox' type='text' name='author_name' size='60' value='$author_name' maxlength='100' />\n</td>\n</tr>\n<tr>\n<td style='width:20%' class='forumheader3'>" . LAN_112 . "</td>\n<td style='width:80%' class='forumheader3'>\n<input class='tbox' type='text' name='author_email' size='60' value='$author_email' maxlength='100' />\n</td>\n</tr>";
+} 
+$news_aj = new textparse();
+// Added by Barry
+if (!empty($pref['news_subheader']))
+{
+    $text .= " <tr>
+	<td colspan='2' class='forumheader3'>" . $news_aj->tpa($pref['news_subheader']) . "</td>
+	</tr>";
+} 
+// end barry
+$text .= " <tr>
+	<td style='width:20%' class='forumheader3'>" . NWSLAN_6 . ": </td>
+	<td style='width:80%' class='forumheader3'>";
+if (!$sql->db_Select("news_category"))
+{
+    $text .= NWSLAN_10;
+} 
+else
+{
+    $text .= "
+		<select name='cat_id' class='tbox'>";
+    while (list($cat_id, $cat_name, $cat_icon) = $sql->db_Fetch())
+    {
+        $text .= ($_POST['cat_id'] == $cat_id ? "<option value='$cat_id' selected>" . $cat_name . "</option>" : "<option value='$cat_id'>" . $cat_name . "</option>");
+    } 
+    $text .= "</select>";
+} 
+$text .= "</td>
+	</tr><tr>
+	<td style='width:20%' class='forumheader3'>" . LAN_62 . "</td>
+	<td style='width:80%' class='forumheader3'>
+	<input class='tbox' type='text' id='itemtitle' name='itemtitle' size='60' value='$itemtitle' maxlength='200' style='width:90%' />
+	</td>
+	</tr>";
+if ($pref['subnews_htmlarea'])
+{
+    require_once(e_HANDLER . "tiny_mce/wysiwyg.php");
+    echo wysiwyg("item");
+} 
+
+$insertjs = (!$pref['subnews_htmlarea'])?"rows='15' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'" : "rows='25' style='width:100%' ";
+$text .= "
+	 
+	<tr>
+	<td style='width:20%' class='forumheader3'>" . LAN_135 . "</td>
+	<td style='width:80%' class='forumheader3'>
+	<textarea class='tbox' id='item' name='item'  cols='80'  style='width:95%' $insertjs></textarea>
+	</td>
+	</tr>\n";
+if ($pref['subnews_attach'] && $pref['upload_enabled'] && check_class($pref['upload_class']) && FILE_UPLOADS)
+{
+    $text .= "
+		<tr>
+		<td style='width:20%' class='forumheader3'>" . SUBNEWSLAN_5 . "<br /><span class='smalltext'>" . SUBNEWSLAN_6 . "</span></td>
+		<td style='width:80%' class='forumheader3'>
+		<input class='tbox' type='file' name='file_userfile[]' style='width:90%' />
+		</td>
+		</tr>\n";
+} 
+
+$text .= "
+	<tr>
+	<td colspan='2' style='text-align:center' class='forumheader'>
+	<input class='button' type='submit' name='submit' value='" . LAN_136 . "' />
+	</td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+$ns->tablerender(LAN_136, $text);
+require_once(FOOTERF);
+function headerjs()
+{
+    $script = "<script type=\"text/javascript\">
+		function frmVerify()
+		{
+			if(document.getElementById('itemtitle').value == \"\")
+			{
+				alert('" . SUBNEWSLAN_1 . "');
+				return false;
+			}
+			if(document.getElementById('item').value == \"\")
+			{
+				alert('" . SUBNEWSLAN_2 . "');
+				return false;
+			}
+		}
+		</script>";
+    return $script;
+} 
+
 ?>
\ No newline at end of file
diff -ruN 6171/top.php 75/top.php
--- 6171/top.php	2005-05-12 22:45:17.000000000 -0500
+++ 75/top.php	2006-02-24 07:54:22.000000000 -0600
@@ -1,196 +1,200 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/top.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-if(!e_QUERY){
-	$action = "top";
-	$subaction = "all";
-	$from = 0;
-	$view = 10;
-}else{
-	$tmp = explode(".", e_QUERY);
-	$from = intval($tmp[0]);
-	$action = $tmp[1];
-	$subaction = $tmp[2];
-	$view = ($tmp[3] ? intval($tmp[3]) : 10);
-}
-if($action == "top"){
-	define("e_PAGETITLE", ": ".LAN_8);
-}elseif($action == "active"){
-	define("e_PAGETITLE", ": ".LAN_7);
-}
-
-require_once(HEADERF);
-if($action == "active"){
-	require_once(e_HANDLER."userclass_class.php");
-	
-	if($sql -> db_Select_gen("SELECT * FROM ".MPREFIX."forum_t, ".MPREFIX."forum WHERE ".MPREFIX."forum.forum_id=".MPREFIX."forum_t.thread_forum_id AND ".MPREFIX."forum_t.thread_parent=0 ORDER BY ".MPREFIX."forum_t.thread_views DESC LIMIT ".$from.", ".$view."")){
-		$text = "<div style='text-align:center'>\n<table style='width:auto' class='fborder'>\n";
-		if(!is_object($sql2)){
-			$sql2 = new db;
-		}
-		if(!is_object($gen)){
-			$gen = new convert;
-		}
-
-		$text .= "<tr>
-			<td style='width:5%' class='forumheader'>&nbsp;</td>
-			<td style='width:45%' class='forumheader'>".LAN_1."</td>
-			<td style='width:15%; text-align:center' class='forumheader'>".LAN_2."</td>
-			<td style='width:5%; text-align:center' class='forumheader'>".LAN_3."</td>
-			<td style='width:5%; text-align:center' class='forumheader'>".LAN_4."</td>
-			<td style='width:25%; text-align:center' class='forumheader'>".LAN_5."</td>
-			</tr>\n";
-
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			if(check_class($forum_class)){
-				$sql2 -> db_Select("forum_t", "*", "thread_parent='$thread_id' ORDER BY thread_views DESC");
-				list($null, $null, $null, $null, $r_datestamp, $null, $r_user) = $sql2 -> db_Fetch();
-				$r_id = substr($r_user, 0, strpos($r_user, "."));
-				$r_name = substr($r_user, (strpos($r_user, ".")+1));
-
-				if(strstr($r_name, chr(1))){
-					$tmp = explode(chr(1), $r_name);
-					$r_name = $tmp[0];
-				}
-
-				$r_datestamp = $gen->convert_date($r_datestamp, "forum");
-
-				$post_author_id = substr($thread_user, 0, strpos($thread_user, "."));
-				$post_author_name = substr($thread_user, (strpos($thread_user, ".")+1));
-				if(strstr($post_author_name, chr(1))){ 
-					$tmp = explode(chr(1), $post_author_name); 
-					$post_author_name = $tmp[0];
-				}
-				$post_author_name = ($post_author_id != 0 ? "<a href='".e_BASE."user.php?id.$post_author_id'>$post_author_name</a>" : $post_author_name);
-				$replies = $sql2 -> db_Select("forum_t", "*", "thread_parent=$thread_id");
-
-				$text .= "<tr>
-				<td style='width:5%; text-align:center' class='forumheader3'><img src='".e_IMAGE."forum/new_small.png' alt='' /></td>
-				<td style='width:45%' class='forumheader3'><b><a href='".e_BASE."forum_viewtopic.php?$forum_id.$thread_id'>$thread_name</a></b> <span class='smalltext'>(<a href='".e_BASE."forum_viewforum.php?$forum_id'>$forum_name</a>)</span></td>
-				<td style='width:15%; text-align:center' class='forumheader3'>$post_author_name</td>
-				<td style='width:5%; text-align:center' class='forumheader3'>$thread_views</td>
-				<td style='width:5%; text-align:center' class='forumheader3'>$replies</td>
-				<td style='width:25%; text-align:center' class='forumheader3'>".($replies ? "<b><a href='".e_BASE."user.php?id.$r_id'>$r_name</a></b><br /><span class='smalltext'>$r_datestamp</span>" : "-")."</td>
-				</tr>\n";
-			}
-		}
-
-		$text .= "</table>\n</div>";
-
-
-		//$text = ($pref['nfp_layer'] ? "<div style='border : 0; padding : 4px; width : auto; height : ".$pref['nfp_layer_height']."px; overflow : auto; '>".$text."</div>" : $text);
-
-		$ns -> tablerender(LAN_7, $text, "nfp");
-		require_once(e_HANDLER."np_class.php");
-		$ftotal = $sql -> db_Select("forum_t", "*", "thread_parent='0'");
-		$ix = new nextprev("top.php", $from, $view, $ftotal, "", "active.forum.".$view.""); 
-	}
-}
-if($action  == "top"){
-	require_once(e_HANDLER."level_handler.php");
-	define("IMAGE_rank_main_admin_image", ($pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "<img src='".THEME."forum/".$pref['rank_main_admin_image']."' alt='' />" : "<img src='".e_IMAGE."forum/main_admin.png' alt='' />"));
-	define("IMAGE_rank_admin_image", ($pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "<img src='".THEME."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_IMAGE."forum/admin.png' alt='' />"));
-	define("IMAGE_rank_moderator_image", ($pref['rank_moderator_image'] && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "<img src='".THEME."forum/".$pref['rank_moderator_image']."' alt='' />" : "<img src='".e_IMAGE."forum/moderator.png' alt='' />"));
-
-	if($subaction == "forum" || $subaction == "all"){
-		$top_forum_posters = $sql -> db_Select("user", "*", "ORDER BY user_forums DESC LIMIT ".$from.", ".$view."", "no_where");
-		$text = "
-		<div style='text-align:center'>
-		<table style='width:95%' class='fborder'>
-		<tr>
-		<td style='width:10%; text-align:center' class='forumheader3'>&nbsp;</td>
-		<td style='width:50%' class='forumheader3'>".TOP_LAN_1."</td>
-		<td style='width:10%; text-align:center' class='forumheader3'>".TOP_LAN_2."</td>
-		<td style='width:30%; text-align:center' class='forumheader3'>".TOP_LAN_6."</td>
-		</tr>\n";
-		$counter=1 + $from;
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
-			$text .= "<tr>
-			<td style='width:10%; text-align:center' class='forumheader3'>$counter</td>
-			<td style='width:50%' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
-			<td style='width:10%; text-align:center' class='forumheader3'>$user_forums</td>
-			<td style='width:30%; text-align:center' class='forumheader3'>".(strstr($ldata[0], "LAN") ? $ldata[1] : $ldata[0])."</td>
-			</tr>";
-			$counter++;
-		}
-		$text .= "</table>\n</div>";
-		$ns -> tablerender(TOP_LAN_0, $text);
-		if($subaction == "forum"){
-			require_once(e_HANDLER."np_class.php");
-			$ftotal = $sql -> db_Count("user", "(*)", "no_where");
-			$ix = new nextprev("top.php", $from, $view, $ftotal, "Forum Posts", "top.forum.".$view.""); 
-		}
-	}
-
-
-	if($subaction == "comment" || $subaction == "all"){
-		$top_forum_posters = $sql -> db_Select("user", "*", "ORDER BY user_comments DESC LIMIT 0, 10", "no_where");
-		$text = "
-		<div style='text-align:center'>
-		<table style='width:95%' class='fborder'>
-		<tr>
-		<td style='width:10%; text-align:center' class='forumheader3'>&nbsp;</td>
-		<td style='width:50%' class='forumheader3'>".TOP_LAN_1."</td>
-		<td style='width:10%; text-align:center' class='forumheader3'>".TOP_LAN_4."</td>
-		<td style='width:30%; text-align:center' class='forumheader3'>".TOP_LAN_6."</td>
-		</tr>\n";
-		$counter=1;
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
-			$text .= "<tr>
-			<td style='width:10%; text-align:center' class='forumheader3'>$counter</td>
-			<td style='width:50%' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
-			<td style='width:10%; text-align:center' class='forumheader3'>$user_comments</td>
-			<td style='width:30%; text-align:center' class='forumheader3'>".(strstr($ldata[0], "LAN") ? $ldata[1] : $ldata[0])."</td>
-			</tr>";
-			$counter++;
-		}
-		$text .= "</table>\n</div>";
-		$ns -> tablerender(TOP_LAN_3, $text);
-	}
-
-	if($subaction == "chat" || $subaction == "all"){
-		$top_forum_posters = $sql -> db_Select("user", "*", "ORDER BY user_chats DESC LIMIT 0, 10", "no_where");
-		$text = "
-		<div style='text-align:center'>
-		<table style='width:95%' class='fborder'>
-		<tr>
-		<td style='width:10%; text-align:center' class='forumheader3'>&nbsp;</td>
-		<td style='width:20%' class='forumheader3'>".TOP_LAN_1."</td>
-		<td style='width:10%; text-align:center' class='forumheader3'>".TOP_LAN_2."</td>
-		<td style='width:30%; text-align:center' class='forumheader3'>".TOP_LAN_6."</td>
-		</tr>\n";
-		$counter=1;
-		while($row = $sql -> db_Fetch()){
-			extract($row);
-			$ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
-			$text .= "<tr>
-			<td style='width:10%; text-align:center' class='forumheader3'>$counter</td>
-			<td style='width:50%' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
-			<td style='width:10%; text-align:center' class='forumheader3'>$user_chats</td>
-			<td style='width:30%; text-align:center' class='forumheader3'>".(strstr($ldata[0], "LAN") ? $ldata[1] : $ldata[0])."</td>
-			</tr>";
-			$counter++;
-		}
-		$text .= "</table>\n</div>";
-		$ns -> tablerender(TOP_LAN_5, $text);
-	}
-}
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/top.php,v $
+|     $Revision: 1.10 $
+|     $Date: 2006/02/24 13:54:22 $
+|     $Author: whoisrich $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+if (!e_QUERY) {
+	$action = "top";
+	$subaction = "all";
+	$from = 0;
+	$view = 10;
+} else {
+	$tmp = explode(".", e_QUERY);
+	$from = intval($tmp[0]);
+	$action = $tmp[1];
+	$subaction = $tmp[2];
+	$view = ($tmp[3] ? intval($tmp[3]) : 10);
+}
+if ($action == "top") {
+	define("e_PAGETITLE", ": ".LAN_8);
+} elseif($action == "active") {
+	define("e_PAGETITLE", ": ".LAN_7);
+}
+	
+	
+require_once(HEADERF);
+if ($action == "active") {
+	require_once(e_HANDLER."userclass_class.php");
+	 
+	$query = "SELECT t.*, f.forum_name, u.user_name from #forum_t as t
+			LEFT JOIN #forum AS f ON t.thread_forum_id = f.forum_id 
+			LEFT JOIN #user AS u ON t.thread_user = u.user_id
+			WHERE  t.thread_parent = 0
+			ORDER BY t.thread_views DESC 
+			LIMIT {$from}, {$view}";
+
+	if ($sql->db_Select_gen($query)) {
+		$text = "<div style='text-align:center'>\n<table style='width:auto' class='fborder'>\n";
+		if (!is_object($gen)) {
+			$gen = new convert;
+		}
+		 
+		$text .= "<tr>
+			<td style='width:5%' class='forumheader'>&nbsp;</td>
+			<td style='width:45%' class='forumheader'>".LAN_1."</td>
+			<td style='width:15%; text-align:center' class='forumheader'>".LAN_2."</td>
+			<td style='width:5%; text-align:center' class='forumheader'>".LAN_3."</td>
+			<td style='width:5%; text-align:center' class='forumheader'>".LAN_4."</td>
+			<td style='width:25%; text-align:center' class='forumheader'>".LAN_5."</td>
+			</tr>\n";
+		 
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			if (check_class($forum_class)) {
+
+				if($user_name)
+				{
+					$POSTER = "<a href='".e_HTTP."user.php?id.{$thread_user}'>{$user_name}</a>";
+				} else {
+					list($anonposter, $ipaddress) = explode(chr(1), $thread_anon);
+					$POSTER = $anonposter;
+				}
+
+				$LINKTOTHREAD = e_PLUGIN_ABS."forum/forum_viewtopic.php?".$thread_id;
+				$LINKTOFORUM = e_PLUGIN_ABS."forum/forum_viewforum.php?".$thread_forum_id;
+				$lastpost_datestamp = $gen->convert_date($thread_lastpost, "forum");
+				list($lastpost_id, $lastpost_name) = explode('.', $thread_lastuser, 2);
+				if (!$lastpost_id) {
+					$LASTPOST = $lastpost_name.'<br />'.$lastpost_datestamp;
+				} else {
+					$LASTPOST = "<a href='".e_HTTP."user.php?id.".$lastpost_id."'>".$lastpost_name."</a><br />".$lastpost_datestamp;
+				}
+
+				$text .= "<tr>
+					<td style='width:5%; text-align:center' class='forumheader3'><img src='".e_PLUGIN_ABS."forum/images/".IMODE."/new_small.png' alt='' /></td>
+					<td style='width:45%' class='forumheader3'><b><a href='{$LINKTOTHREAD}'>{$thread_name}</a></b> <span class='smalltext'>(<a href='{$LINKTOFORUM}'>{$forum_name}</a>)</span></td>
+					<td style='width:15%; text-align:center' class='forumheader3'>{$POSTER}</td>
+					<td style='width:5%; text-align:center' class='forumheader3'>{$thread_views}</td>
+					<td style='width:5%; text-align:center' class='forumheader3'>{$thread_total_replies}</td>
+					<td style='width:25%; text-align:center' class='forumheader3'>{$LASTPOST}</td>
+					</tr>\n";
+			}
+		}
+		 
+		$text .= "</table>\n</div>";
+		 
+		$ns->tablerender(LAN_7, $text, "nfp");
+		require_once(e_HANDLER."np_class.php");
+		$ftotal = $sql->db_Select("forum_t", "*", "thread_parent='0'");
+		$ix = new nextprev("top.php", $from, $view, $ftotal, "", "active.forum.".$view."");
+	}
+}
+if ($action == "top") {
+	require_once(e_HANDLER."level_handler.php");
+	define("IMAGE_rank_main_admin_image", ($pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_main_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/main_admin.png' alt='' />"));
+	define("IMAGE_rank_admin_image", ($pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/admin.png' alt='' />"));
+	define("IMAGE_rank_moderator_image", ($pref['rank_moderator_image'] && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_moderator_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/moderator.png' alt='' />"));
+	 
+	if ($subaction == "forum" || $subaction == "all") {
+		$top_forum_posters = $sql->db_Select("user", "*", "`user_forums` > 0 ORDER BY user_forums DESC LIMIT ".$from.", ".$view."");
+		$text = "
+			<div style='text-align:center'>
+			<table style='width:95%' class='fborder'>
+			<tr>
+			<td style='width:10%; text-align:center' class='forumheader3'>&nbsp;</td>
+			<td style='width:50%' class='forumheader3'>".TOP_LAN_1."</td>
+			<td style='width:10%; text-align:center' class='forumheader3'>".TOP_LAN_2."</td>
+			<td style='width:30%; text-align:center' class='forumheader3'>".TOP_LAN_6."</td>
+			</tr>\n";
+		$counter = 1 + $from;
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			$ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
+			$text .= "<tr>
+				<td style='width:10%; text-align:center' class='forumheader3'>{$counter}</td>
+				<td style='width:50%' class='forumheader3'><a href='".e_HTTP."user.php?id.{$user_id}'>{$user_name}</a></td>
+				<td style='width:10%; text-align:center' class='forumheader3'>{$user_forums}</td>
+				<td style='width:30%; text-align:center' class='forumheader3'>".(strstr($ldata[0], "LAN") ? $ldata[1] : $ldata[0])."</td>
+				</tr>";
+			$counter++;
+		}
+		$text .= "</table>\n</div>";
+		$ns->tablerender(TOP_LAN_0, $text);
+		if ($subaction == "forum") {
+			require_once(e_HANDLER."np_class.php");
+			$ftotal = $sql->db_Count("user", "(*)", "WHERE `user_forums` > 0");
+			$ix = new nextprev("top.php", $from, $view, $ftotal, "Forum Posts", "top.forum.".$view."");
+		}
+	}
+	 
+	 
+	if ($subaction == "comment" || $subaction == "all") {
+		$top_forum_posters = $sql->db_Select("user", "*", "`user_comments` > 0 ORDER BY user_comments DESC LIMIT 0, 10");
+		$text = "
+			<div style='text-align:center'>
+			<table style='width:95%' class='fborder'>
+			<tr>
+			<td style='width:10%; text-align:center' class='forumheader3'>&nbsp;</td>
+			<td style='width:50%' class='forumheader3'>".TOP_LAN_1."</td>
+			<td style='width:10%; text-align:center' class='forumheader3'>".TOP_LAN_4."</td>
+			<td style='width:30%; text-align:center' class='forumheader3'>".TOP_LAN_6."</td>
+			</tr>\n";
+		$counter = 1;
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			$ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
+			$text .= "<tr>
+				<td style='width:10%; text-align:center' class='forumheader3'>{$counter}</td>
+				<td style='width:50%' class='forumheader3'><a href='".e_HTTP."user.php?id.{$user_id}'>{$user_name}</a></td>
+				<td style='width:10%; text-align:center' class='forumheader3'>{$user_comments}</td>
+				<td style='width:30%; text-align:center' class='forumheader3'>".(strstr($ldata[0], "LAN") ? $ldata[1] : $ldata[0])."</td>
+				</tr>";
+			$counter++;
+		}
+		$text .= "</table>\n</div>";
+		$ns->tablerender(TOP_LAN_3, $text);
+	}
+	 
+	if ($subaction == "chat" || $subaction == "all") {
+		$top_forum_posters = $sql->db_Select("user", "*", "`user_chats` > 0 ORDER BY user_chats DESC LIMIT 0, 10");
+		$text = "
+			<div style='text-align:center'>
+			<table style='width:95%' class='fborder'>
+			<tr>
+			<td style='width:10%; text-align:center' class='forumheader3'>&nbsp;</td>
+			<td style='width:20%' class='forumheader3'>".TOP_LAN_1."</td>
+			<td style='width:10%; text-align:center' class='forumheader3'>".TOP_LAN_2."</td>
+			<td style='width:30%; text-align:center' class='forumheader3'>".TOP_LAN_6."</td>
+			</tr>\n";
+		$counter = 1;
+		while ($row = $sql->db_Fetch()) {
+			extract($row);
+			$ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
+			$text .= "<tr>
+				<td style='width:10%; text-align:center' class='forumheader3'>{$counter}</td>
+				<td style='width:50%' class='forumheader3'><a href='".e_HTTP."user.php?id.{$user_id}'>{$user_name}</a></td>
+				<td style='width:10%; text-align:center' class='forumheader3'>{$user_chats}</td>
+				<td style='width:30%; text-align:center' class='forumheader3'>".(strstr($ldata[0], "LAN") ? $ldata[1] : $ldata[0])."</td>
+				</tr>";
+			$counter++;
+		}
+		$text .= "</table>\n</div>";
+		$ns->tablerender(TOP_LAN_5, $text);
+	}
+}
+require_once(FOOTERF);
 ?>
\ No newline at end of file
diff -ruN 6171/upgrade.php 75/upgrade.php
--- 6171/upgrade.php	2004-03-03 12:24:38.000000000 -0600
+++ 75/upgrade.php	1969-12-31 18:00:00.000000000 -0600
@@ -1,42 +0,0 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/banner.php
-|
-|	Steve Dunstan 2001-2002
-|	http://e107.org
-|	jalist@e107.org
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-require_once(HEADERF);
-
-
-$pref['cookie_name'] = "e107cookie";
-save_prefs();
-
-$sql -> db_Select("core", "*", "e107_name='e107' ");
-$row = $sql -> db_Fetch();
-$tmp = stripslashes($row['e107_value']);
-$e107=unserialize($tmp);
-if(!is_array($e107)){
-	$e107=unserialize($row['e107_value']);
-}
-
-$e107['e107_version'] = "0.601";
-$e107['e107_build'] = "0";
-$e107['e107_datestamp'] = time();
-
-$tmp = addslashes(serialize($e107));
-$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='e107' ");
-
-$text = "<div style='text-align:center'>Upgrade complete, now running v0.601.</div>";
-$ns -> tablerender("Upgrade", $text);
-
-
-require_once(FOOTERF);
-?>
\ No newline at end of file
diff -ruN 6171/upload.php 75/upload.php
--- 6171/upload.php	2004-09-09 21:58:10.000000000 -0500
+++ 75/upload.php	2006-01-10 13:22:30.000000000 -0600
@@ -1,172 +1,176 @@
-<?php
-/*
-+ ----------------------------------------------------------------------------+
-|     e107 website system
-|
-|     Steve Dunstan 2001-2002
-|     http://e107.org
-|     jalist@e107.org
-|
-|     Released under the terms and conditions of the
-|     GNU General Public License (http://gnu.org).
-|
-|     $Source: /cvsroot/e107/e107/upload.php,v $
-|     $Revision: 1.5 $
-|     $Date: 2004/09/10 02:58:10 $
-|     $Author: e107coders $
-+----------------------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-if(!$pref['upload_enabled'] || $pref['upload_class'] == 255){
-        header("location: ".e_BASE."index.php");
-        exit;
-}
-
-require_once(HEADERF);
-
-if($pref['upload_class'] == 254 && !USER){
-        $text = "<div style='text-align:center'>".LAN_402."</div>";
-        $ns -> tablerender(LAN_20, $text);
-        require_once(FOOTERF);
-        exit;
-}else if(!check_class($pref['upload_class']) && $pref['upload_class']){
-        $text = "<div style='text-align:center'>".LAN_403."</div>";
-        $ns -> tablerender(LAN_20, $text);
-        require_once(FOOTERF);
-        exit;
-}
-
-if(IsSet($_POST['upload'])){
-        if(($_POST['file_email'] || USER==TRUE) && $_POST['file_name'] && $_POST['file_description']){
-
-                require_once(e_HANDLER."upload_handler.php");
-                $uploaded = file_upload(e_FILE."public/");
-
-                $file = $uploaded[0]['name'];
-                $filetype = $uploaded[0]['type'];
-                $filesize = $uploaded[0]['size'];
-                $image = $uploaded[1]['name'];
-                $imagetype = $uploaded[1]['type'];
-
-                if(!$pref['upload_maxfilesize']){
-                        $pref['upload_maxfilesize'] = ini_get('upload_max_filesize')*1048576;
-                }
-
-
-                if($filesize > $pref['upload_maxfilesize']){
-                        $message = LAN_405;
-                }else{
-                        if(is_array($uploaded)){
-                                $poster = (USER ? USERID.".".USERNAME : "0".$_POST['file_poster']);
-                                $_POST['file_email'] = ($_POST['file_email'] ? $_POST['file_email'] : USEREMAIL);
-                                $_POST['file_description'] = $aj -> formtpa($_POST['file_description'], "public");
-                                $sql -> db_Insert("upload", "0, '$poster', '".$_POST['file_email']."', '".$_POST['file_website']."', '".time()."', '".$_POST['file_name']."', '".$_POST['file_version']."', '".$file."', '".$image."', '".$_POST['file_description']."', '".$_POST['file_demo']."', '".$filesize."', 0, '".$_POST['download_category']."'");
-                                $message .= "<br />".LAN_404;
-                        }
-                }
-
-        }else{
-                require_once(e_HANDLER."message_handler.php");
-                message_handler("ALERT", 5);
-        }
-}
-
-if(IsSet($message)){
-        $ns -> tablerender("", "<div style=\"text-align:center\"><b>".$message."</b></div>");
-        require_once(FOOTERF);
-        exit;
-}
-
-$text = "<div style='text-align:center'>
-<form enctype='multipart/form-data' method='post' action='".e_SELF."'>
-<table style='width:70%' class='fborder'>
-<tr>
-<td style='width:20%' class='forumheader3'>".DOWLAN_11.":</td>
-<td style='width:80%' class='forumheader3'>";
-
-        $sql -> db_Select("download_category", "*", "download_category_parent !=0");
-        $text .= "<select name='download_category' class='tbox'>\n";
-        while($row = $sql -> db_Fetch()){
-                extract($row);
-                if($download_category_id == $download_category){
-                        $text .= "<option value='$download_category_id' selected>".$download_category_name."</option>\n";
-                                }else{
-            $text .= "<option value='$download_category_id'>".$download_category_name."</option>\n";
-        }
-        }
-    $text .= "</select>
-    </td>
-    </tr>
-
-    <tr>
-    <td style='text-align:center' colspan='2' class='forumheader3'>";
-
-    $text .= "<b>".LAN_406."</b><br />".LAN_419.":";
-
-    $text .= " ".str_replace("\n", " | ", $pref['upload_allowedfiletype'])."<br />".LAN_407."<br />
-    ".LAN_418.($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'] : ini_get('upload_max_filesize'))."<br />";
-
-    $text .= "<span style='text-decoration:underline'>".LAN_408."</span> ".LAN_420."</td>
-    </tr>";
-
-if(!USER){
-        $text .= "<tr>
-<td style='width:30%' class='forumheader3'>".LAN_61."</td>
-<td style='width:70%' class='forumheader3'><input class='tbox' name='file_poster' type='text' size='50' maxlength='100' /></td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'><span style='text-decoration:underline'>".LAN_112."</span></td>
-<td style='width:70%' class='forumheader3'><input class='tbox' name='file_email' type='text' size='50' maxlength='100' value='".USEREMAIL."' /></td>
-</tr>";
-}
-
-$text .= "
-<tr>
-<td style='width:30%' class='forumheader3'><span style='text-decoration:underline'>".LAN_409."</span></td>
-<td style='width:70%' class='forumheader3'><input class='tbox' name='file_name' type='text' size='50' maxlength='100' /></td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_410."</td>
-<td style='width:70%' class='forumheader3'><input class='tbox' name='file_version' type='text' size='10' maxlength='10' /></td>
-</tr>
-
-
-<tr>
-<td style='width:30%' class='forumheader3'><span style='text-decoration:underline'>".LAN_411."</span></td>
-<td style='width:70%' class='forumheader3'><input class='tbox' name='file_userfile[]' type='file' size='47' /></td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_412."</td>
-<td style='width:70%' class='forumheader3'><input class='tbox' name='file_userfile[]' type='file' size='47' /></td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'><span style='text-decoration:underline'>".LAN_413."</span></td>
-<td style='width:70%' class='forumheader3'><textarea class='tbox' name='file_description' cols='59' rows='6'></textarea></td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_144."</td>
-<td style='width:70%' class='forumheader3'><input class='tbox' name='file_website' type='text' size='50' maxlength='100 value=".(defined(USERURL) ? USERURL : "")."' /></td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_414."<br /><span class='smalltext'>".LAN_415."</span></td>
-<td style='width:70%' class='forumheader3'><input class='tbox' name='file_demo' type='text' size='50' maxlength='100' /></td>
-</tr>
-
-<tr>
-<td style='text-align:center' colspan='2' class='forumheader'><input class='button' type='submit' name='upload' value='".LAN_416."' /></td>
-</tr>
-</table>
-</form>
-</div>";
-
-$ns -> tablerender(LAN_417, $text);
-
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/upload.php,v $
+|     $Revision: 1.12 $
+|     $Date: 2006/01/10 19:22:30 $
+|     $Author: e107coders $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+
+if (!$pref['upload_enabled'] || $pref['upload_class'] == 255) {
+	header("location: ".e_BASE."index.php");
+	exit;
+}
+
+require_once(HEADERF);
+
+if (!check_class($pref['upload_class'])) {
+	$text = "<div style='text-align:center'>".LAN_403."</div>";
+	$ns->tablerender(LAN_20, $text);
+	require_once(FOOTERF);
+	exit;
+}
+
+if (isset($_POST['upload'])) {
+	if (($_POST['file_email'] || USER == TRUE) && $_POST['file_name'] && $_POST['file_description']) {
+
+		require_once(e_HANDLER."upload_handler.php");
+		$uploaded = file_upload(e_FILE."public/", "unique");
+
+		$file = $uploaded[0]['name'];
+		$filetype = $uploaded[0]['type'];
+		$filesize = $uploaded[0]['size'];
+		$image = $uploaded[1]['name'];
+		$imagetype = $uploaded[1]['type'];
+
+		if (!$pref['upload_maxfilesize']) {
+			$pref['upload_maxfilesize'] = ini_get('upload_max_filesize') * 1048576;
+		}
+
+
+		if ($filesize > $pref['upload_maxfilesize']) {
+			$message = LAN_405;
+		} else {
+			if (is_array($uploaded)) {
+				$poster = (USER ? USERID.".".USERNAME : "0".$_POST['file_poster']);
+				$_POST['file_email'] = ($_POST['file_email'] ? $_POST['file_email'] : USEREMAIL);
+				$_POST['file_description'] = $tp->toDB($_POST['file_description']);
+				$sql->db_Insert("upload", "0, '".$tp -> toDB($poster)."', '".$tp -> toDB(check_email($_POST['file_email']))."', '".$tp -> toDB($_POST['file_website'])."', '".time()."', '".$tp -> toDB($_POST['file_name'])."', '".$tp -> toDB($_POST['file_version'])."', '".$file."', '".$image."', '".$tp -> toDB($_POST['file_description'])."', '".$tp -> toDB($_POST['file_demo'])."', '".$filesize."', 0, '".$tp -> toDB($_POST['download_category'])."'");
+				$message .= "<br />".LAN_404;
+			}
+		}
+
+	} else {
+		require_once(e_HANDLER."message_handler.php");
+		message_handler("ALERT", 5);
+	}
+}
+
+if (isset($message)) {
+	$ns->tablerender("", "<div style=\"text-align:center\"><b>".$message."</b></div>");
+	require_once(FOOTERF);
+	exit;
+}
+
+$text = "<div style='text-align:center'>
+	<form enctype='multipart/form-data' method='post' action='".e_SELF."'>
+	<table style='width:97%' class='fborder'>
+	<tr>
+	<td style='width:20%' class='forumheader3'>".DOWLAN_11.":</td>
+	<td style='width:80%' class='forumheader3'>";
+
+$sql->db_Select("download_category", "*", "download_category_parent !=0");
+$text .= "<select name='download_category' class='tbox'>\n";
+while ($row = $sql->db_Fetch()) {
+	extract($row);
+	if ($download_category_id == $download_category) {
+		$text .= "<option value='$download_category_id' selected>".$tp->toHTML($download_category_name)."</option>\n";
+	} else {
+		$text .= "<option value='$download_category_id'>".$tp->toHTML($download_category_name)."</option>\n";
+	}
+}
+$text .= "</select>
+	</td>
+	</tr>
+
+	<tr>
+	<td style='text-align:center' colspan='2' class='forumheader3'>";
+
+$text .= "<b>".LAN_406."</b><br />".LAN_419.":";
+
+if (is_readable(e_ADMIN.'filetypes.php')) {
+	$a_filetypes = trim(file_get_contents(e_ADMIN.'filetypes.php'));
+	$a_filetypes = explode(',', $a_filetypes);
+	foreach ($a_filetypes as $ftype) {
+		$sa_filetypes[] = '.'.trim(str_replace('.', '', $ftype));
+	}
+	$allowed_filetypes = implode(' | ', $sa_filetypes);
+}
+
+$text .= " ".$allowed_filetypes."<br />".LAN_407."<br />
+	".LAN_418.($pref['upload_maxfilesize'] ? $pref['upload_maxfilesize'] : ini_get('upload_max_filesize'))."<br />";
+
+$text .= "<span style='text-decoration:underline'>".LAN_408."</span> ".LAN_420."</td>
+	</tr>";
+
+if (!USER) {
+	$text .= "<tr>
+		<td style='width:30%' class='forumheader3'>".LAN_61."</td>
+		<td style='width:70%' class='forumheader3'><input class='tbox' style='width:90%' name='file_poster' type='text' size='50' maxlength='100' /></td>
+		</tr>
+
+		<tr>
+		<td style='width:30%' class='forumheader3'><span style='text-decoration:underline'>".LAN_112."</span></td>
+		<td style='width:70%' class='forumheader3'><input class='tbox' style='width:90%' name='file_email' type='text' size='50' maxlength='100' value='".USEREMAIL."' /></td>
+		</tr>";
+}
+
+$text .= "
+	<tr>
+	<td style='width:30%' class='forumheader3'><span style='text-decoration:underline'>".LAN_409."</span></td>
+	<td style='width:70%' class='forumheader3'><input class='tbox' style='width:90%'  name='file_name' type='text' size='50' maxlength='100' /></td>
+	</tr>
+
+	<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_410."</td>
+	<td style='width:70%' class='forumheader3'><input class='tbox' style='width:90%' name='file_version' type='text' size='10' maxlength='10' /></td>
+	</tr>
+
+
+	<tr>
+	<td style='width:30%' class='forumheader3'><span style='text-decoration:underline'>".LAN_411."</span></td>
+	<td style='width:70%' class='forumheader3'><input class='tbox' style='width:90%'  name='file_userfile[]' type='file' size='47' /></td>
+	</tr>
+
+	<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_412."</td>
+	<td style='width:70%' class='forumheader3'><input class='tbox' style='width:90%' name='file_userfile[]' type='file' size='47' /></td>
+	</tr>
+
+	<tr>
+	<td style='width:30%' class='forumheader3'><span style='text-decoration:underline'>".LAN_413."</span></td>
+	<td style='width:70%' class='forumheader3'><textarea class='tbox' style='width:90%' name='file_description' cols='59' rows='6'></textarea></td>
+	</tr>
+
+	<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_144."</td>
+	<td style='width:70%' class='forumheader3'><input class='tbox' style='width:90%' name='file_website' type='text' size='50' maxlength='100' value='".(defined(USERURL) ? USERURL : "")."' /></td>
+	</tr>
+
+	<tr>
+	<td style='width:30%' class='forumheader3'>".LAN_414."<br /><span class='smalltext'>".LAN_415."</span></td>
+	<td style='width:70%' class='forumheader3'><input class='tbox' style='width:90%' name='file_demo' type='text' size='50' maxlength='100' /></td>
+	</tr>
+
+	<tr>
+	<td style='text-align:center' colspan='2' class='forumheader'><input class='button' type='submit' name='upload' value='".LAN_416."' /></td>
+	</tr>
+	</table>
+	</form>
+	</div>";
+
+$ns->tablerender(LAN_417, $text);
+
+require_once(FOOTERF);
 ?>
\ No newline at end of file
diff -ruN 6171/user.php 75/user.php
--- 6171/user.php	2004-09-07 07:30:56.000000000 -0500
+++ 75/user.php	2006-05-18 20:57:10.000000000 -0500
@@ -1,405 +1,223 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /user.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-|
-|   $Source: /cvsroot/e107/e107/user.php,v $
-|   $Revision: 1.15 $
-|   $Date: 2004/09/07 12:30:55 $
-|   $Author: mcfly_e107 $
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-
-if(strstr(e_QUERY, "delp")){
-	$tmp = explode(".", e_QUERY);
-	if(USERID == $tmp[1] || (ADMIN && getperms("4"))){
-		$sql -> db_Select("user", "user_sess", "user_id='". USERID."'");
-		$row = $sql -> db_Fetch(); extract($row);
-		@unlink(e_FILE."public/avatars/".$user_sess);
-		$sql -> db_Update("user", "user_sess='' WHERE user_id=".$tmp[1]);
-		header("location:".e_SELF."?id.".$tmp[1]);
-		exit;
-	}
-}
-
-require_once(HEADERF);
-
-if(!USER){
-	$ns -> tablerender(LAN_20, "<div style='text-align:center'>".LAN_416."</div>");
-	require_once(FOOTERF);
-	exit;
-}
-
-if(IsSet($_POST['records'])){
-	$records = $_POST['records'];
-	$order = $_POST['order'];
-	$from = 0;
-}else if(!e_QUERY){
-	$records = 20;
-	$from = 0;
-	$order="DESC";
-}else{
-$qs = explode(".", e_QUERY);
-if($qs[0] == "id"){
-	$id = $qs[1];
-}else{
-$qs = explode(".", e_QUERY);
-$from = $qs[0];
-$records = $qs[1];
-$order = $qs[2];
-}
-}
-if($records >30){ $records = 30; }
-
-
-if(IsSet($id)){
-
-	if($id == 0){
-		$text = "<div style='text-align:center'>".LAN_137." ".SITENAME."</div>";
-		$ns -> tablerender("<div style='text-align:center'>".LAN_20."</div>", $text);
-		require_once(FOOTERF);
-		exit;
-	}
-
-	if(!$sql -> db_Select("user", "*", "user_id='".$id."' ")){
-		$text = "<div style='text-align:center'>".LAN_400."</div>";
-		$ns -> tablerender("<div style='text-align:center'>".LAN_20."</div>", $text);
-		require_once(FOOTERF);
-		exit;
-	}
-
-	$text = renderuser($sql -> db_Fetch());
-	$ns -> tablerender("<div style='text-align:center'>".LAN_402."</div>", $text);
-	require_once(FOOTERF);
-	exit;
-}
-
-$users_total = $sql -> db_Count("user");
-$text = "<div style='text-align:center'>
-".LAN_138." ".$users_total."<br /><br />
-<form method='post' action='".e_SELF."'>
-<p>
-".LAN_419.": ";
-
-if($records == 10){
-	$text .= "<select name='records' class='tbox'>
-	<option value='10' selected='selected'>10</option>
-	<option value='20'>20</option>
-	<option value='30'>30</option>
-	</select>  ";
-}else if($records == 20){
-	$text .= "<select name='records' class='tbox'>
-	<option value='10'>10</option>
-	<option value='20' selected='selected'>20</option>
-	<option value='30'>30</option>
-	</select>  ";
-}else{
-$text .= "<select name='records' class='tbox'>
-<option value='10'>10</option>
-<option value='20'>20</option>
-<option value='30' selected='selected'>30</option>
-</select>  ";
-}
-$text .= LAN_139;
-
-if($order == "ASC"){
-	$text .= "<select name='order' class='tbox'>
-	<option value='DESC'>".LAN_420."</option>
-	<option value='ASC' selected='selected'>".LAN_421."</option>
-	</select>";
-}else{
-$text .= "<select name='order' class='tbox'>
-<option value='DESC' selected='selected'>".LAN_420."</option>
-<option value='ASC'>".LAN_421."</option>
-</select>";
-}
-
-$text .= " <input class='button' type='submit' name='submit' value='".LAN_422."' />
-<input type='hidden' name='from' value='$from' />
-</p>
-</form>\n\n<br /><br />";
-
-
-
-if(!$sql -> db_Select("user", "*",  "ORDER BY user_id $order LIMIT $from,$records", $mode="no_where")){
-	echo "<div style='text-align:center'><b>".LAN_141."</b></div>";
-}else{
-$sql2 = new db;
-if($sql2 -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-	$row = $sql2 -> db_Fetch();
-	$user_entended = unserialize($row[0]);
-}
-
-$text .= "
-<table style='width:95%' class='fborder'>
-<tr>
-<td class='fcaption' style='width:2%'>&nbsp;</td>
-<td class='fcaption' style='width:20%'>".LAN_142."</td>
-<td class='fcaption' style='width:20%'>".LAN_112."</td>
-<td class='fcaption' style='width:20%'>".LAN_145."</td>
-</tr>";
-
-while($row = $sql -> db_Fetch()){
-	$text .= renderuser($row, $user_entended, "short");
-}
-
-$text .= "</table>\n</div>";
-
-}
-
-$ns -> tablerender("<div style='text-align:center'>".LAN_140."</div>", $text);
-
-require_once(e_HANDLER."np_class.php");
-$ix = new nextprev("user.php", $from, $records, $users_total, LAN_138, $records.".".$order);
-
-function renderuser($row, $user_entended, $mode="verbose"){
-
-	global $sql, $id, $pref;
-	extract($row);
-	$aj = new textparse;
-	$gen = new convert;
-	$pm_installed = ($pref['pm_title'] ? TRUE : FALSE);
-	if($mode != "verbose"){
-		$datestamp = $gen->convert_date($user_join, "short");
-		return "
-		<tr>
-		<td class='forumheader3' style='width:2%'><a href='".e_SELF."?id.$user_id'><img src='".e_IMAGE."generic/user.png' alt='' style='border:0' /></a></td>
-		<td class='forumheader' style='width:20%'>".$user_id.": <a href='".e_SELF."?id.$user_id'>".$user_name."</a></td>
-		<td class='forumheader3' style='width:20%'>".($user_hideemail && !ADMIN ? "<i>".LAN_143."</i>" : "<a href='mailto:".$user_email."'>".$user_email."</a>")."</td>
-		<td class='forumheader3' style='width:20%'>$datestamp</td>
-		</tr>";
-	}else{
-	$user_data = $user_id.".".$user_name;
-	$chatposts = $sql -> db_Count("chatbox");
-	$commentposts = $sql -> db_Count("comments");
-	$forumposts = $sql -> db_Count("forum_t");
-	$actual_forums = $sql -> db_Count("forum_t", "(*)", "WHERE thread_user='$user_data'");
-	$actual_chats = $sql -> db_Count("chatbox", "(*)", "WHERE cb_nick='$user_data'");
-	$actual_comments = $sql -> db_Count("comments", "(*)", "WHERE comment_author='$user_data'");
-	$chatper = round(($actual_chats/$chatposts)*100,2);
-	$commentper = round(($actual_comments/$commentposts)*100,2);
-	$forumper = round(($actual_forums/$forumposts)*100,2);
-	require_once(e_HANDLER."level_handler.php");
-
-	$ldata = get_level($user_id, $user_forums, $user_comments, $user_chats, $user_visits, $user_join, $user_admin, $user_perms, $pref);
-
-	if(strstr($ldata[0], "IMAGE_rank_main_admin_image")){
-		$level = LAN_417;
-	}else if(strstr($ldata[0], "IMAGE")){
-		$level = LAN_418;
-	}else{
-	$level = $ldata[1];
-}
-
-$datestamp = $gen->convert_date($user_join, "long");
-$lastvisit = ($user_currentvisit ? $gen->convert_date($user_currentvisit, "long") : "<i>".LAN_401."</i>");
-$daysregged = max(1, round((time() - $user_join)/86400))." ".LAN_405;
-$str = "
-<div style='text-align:center'>
-<table style='width:95%' class='fborder'>
-<tr><td colspan='2' class='fcaption' style='text-align:center'>".LAN_142." ".$user_id.": ".$user_name."</td></tr>
-<tr><td rowspan='".($pm_installed && $id != USERID ? 10 : 9)."' class='forumheader3' style='width:20%; vertical-align:middle; text-align:center'>";
-
-if($user_sess && file_exists(e_FILE."public/avatars/".$user_sess)){
-	$str .= "<img src='".e_FILE."public/avatars/".$user_sess."' alt='' />";
-
-	if(ADMIN && getperms("4")){
-		$str .= "<br /><span class='smalltext'>".$user_sess."</span>";
-	}
-
-	if(USERID == $user_id || (ADMIN && getperms("4"))){
-		$str .= "<br /><br /><span class='smalltext'>[ <a href='".e_SELF."?delp.$user_id'>".LAN_413."</a> ]</span>";
-	}
-
-}else{
-$str .= LAN_408;
-}
-
-
-$str .= "</td></tr>
-
-<tr>
-<td style='width:80%' class='forumheader3'>
-<table style='width:100%'><tr><td style='width:30%'><img src='".e_IMAGE."generic/rname.png' alt='' style='vertical-align:middle' /> ".LAN_308."</td><td style='width:70%; text-align:right'>".($user_login ? $user_login : "<i>".LAN_401."</i>")."</td></tr></table>
-</td></tr>
-
-<tr>
-<td style='width:80%' class='forumheader3'>
-<table style='width:100%'><tr><td style='width:30%'><img src='".e_IMAGE."generic/email.png' alt='' style='vertical-align:middle' /> ".LAN_112."</td><td style='width:70%; text-align:right'>".($user_hideemail && !ADMIN ? "<i>".LAN_143."</i>" : $user_email)."</td></tr></table>
-</td></tr>
-
-<tr>
-<td style='width:80%' class='forumheader3'>
-<table style='width:100%'><tr><td style='width:30%'> <img src='".e_IMAGE."generic/icq.png' alt=''  style='vertical-align:middle' /> ".LAN_115."</td><td style='width:70%; text-align:right'>".($user_icq ? $user_icq : "<i>".LAN_401."</i>")."</td></tr></table>
-</td></tr>
-
-<tr>
-<td style='width:80%' class='forumheader3'>
-<table style='width:100%'><tr><td style='width:30%'> <img src='".e_IMAGE."generic/aim.png' alt=''  style='vertical-align:middle' /> ".LAN_116."</td><td style='width:70%; text-align:right'>".($user_aim ? $aj -> tpa($user_aim) : "<i>".LAN_401."</i>")."</td></tr></table>
-</td></tr>
-
-<tr>
-<td style='width:80%' class='forumheader3'>
-<table style='width:100%'><tr><td style='width:30%'> <img src='".e_IMAGE."generic/msn.png' alt=''  style='vertical-align:middle' /> ".LAN_117."</td><td style='width:70%; text-align:right'>".($user_msn ? $aj -> tpa($user_msn) : "<i>".LAN_401."</i>")."</td></tr></table>
-</td></tr>
-
-<tr>
-<td style='width:80%' class='forumheader3'>
-<table style='width:100%'><tr><td style='width:30%'> <img src='".e_IMAGE."generic/hme.png' alt=''  style='vertical-align:middle' /> ".LAN_144."</td><td style='width:70%; text-align:right'>".($user_homepage ? "<a href='".$user_homepage."' rel='external'>$user_homepage</a>" : "<i>".LAN_401."</i>")."</td></tr></table>
-</td></tr>
-
-<tr>
-<td style='width:80%' class='forumheader3'>
-<table style='width:100%'><tr><td style='width:30%'> <img src='".e_IMAGE."generic/location.png' alt=''  style='vertical-align:middle' /> ".LAN_119."</td><td style='width:70%; text-align:right'>".($user_location ? $aj -> tpa($user_location) : "<i>".LAN_401."</i>")."</td></tr></table>
-</td></tr>";
-
-if($user_birthday != "" && $user_birthday != "0000-00-00" && ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $user_birthday, $regs)){
-	$user_birthday = "$regs[3].$regs[2].$regs[1]";
-}else{
-$user_birthday = "<i>".LAN_401."</i>";
-}
-
-$str .= "<tr><td style='width:80%' class='forumheader3'>
-<table style='width:100%'><tr><td style='width:30%'> <img src='".e_IMAGE."generic/bday.png' alt=''  style='vertical-align:middle' /> ".LAN_118."</td><td style='width:70%; text-align:right'>$user_birthday</td></tr></table>
-</td></tr>";
-
-if($pm_installed && $id != USERID){
-	$str .= "
-	<tr>
-	<td style='width:80%' class='forumheader3' colspan='2'>
-	<table style='width:100%'><tr><td style='width:30%'> ".e107_parse("{CODE=pm_menu.sendpm.{$id}}")." ".LAN_425."</td></tr></table>
-	</td></tr>";
-}
-
-$str .= ($user_signature ? "<tr><td colspan='2' class='forumheader3' style='text-align:center'><i>".$aj -> tpa($user_signature)."</i></td></tr>" : "");
-
-
-
-//        extended fields ...
-
-if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-
-	// added by cam
-	require_once(e_HANDLER."user_extended.php");
-
-	$row = $sql -> db_Fetch();
-	$user_entended = unserialize($row[0]);
-
-	$str .= "<tr><td colspan='2' class='forumheader'>".LAN_410."</td></tr>";
-
-	$user_prefs = unserialize($user_prefs);
-
-	while(list($key, $u_entended) = each($user_entended)){
-		$ut = explode("|", $u_entended);
-		if(!$ut[5] || check_class($ut[5])==TRUE){
-			$str .= "<tr><td style='width:40%' class='forumheader3'>".user_extended_name($u_entended)."</td>
-			<td style='width:60%' class='forumheader3'>".($user_prefs["ue_{$key}"] ? $user_prefs["ue_{$key}"] : "<i>".LAN_401."</i>")."</td></tr>";
-		}
-	}
-}
-
-
-
-
-//        end extended fields
-
-$str .= "<tr><td colspan='2' class='forumheader'>".LAN_403."</td></tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_145."</td>
-<td style='width:70%' class='forumheader3'>$datestamp ( $daysregged )</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_147."</td>
-<td style='width:70%' class='forumheader3'>$user_chats ( ".$chatper."% )</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_148."</td>
-<td style='width:70%' class='forumheader3'>$user_comments ( ".$commentper."% )</td>
-</tr>";
-
-if($user_comments){
-	$str .= "
-	<tr>
-	<td colspan='2' class='forumheader3'><a href='".e_BASE."userposts.php?0.comments.".$user_id."'>".LAN_423."</a></td>
-	</tr>";
-}
-$str .= "
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_149."</td>
-<td style='width:70%' class='forumheader3'>$user_forums ( ".$forumper."% )</td>
-</tr>";
-
-if($user_forums){
-	$str .= "
-	<tr>
-	<td colspan='2' class='forumheader3'><a href='".e_BASE."userposts.php?0.forums.".$user_id."'>".LAN_424."</a></td>
-	</tr>";
-}
-$str .= "
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_146."</td>
-<td style='width:70%' class='forumheader3'>$user_visits</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_404."</td>
-<td style='width:70%' class='forumheader3'>$lastvisit</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_406."</td>
-<td style='width:70%' class='forumheader3'>$level</td>
-</tr>";
-
-if(USERID == $user_id){
-	$str .= "<tr><td colspan='2' class='forumheader3' style='text-align:center'><a href='".e_BASE."usersettings.php'>".LAN_411."</a></td></tr>";
-}else if(ADMIN && getperms("4") && !$user_admin){
-	$str .= "<tr><td colspan='2' class='forumheader3' style='text-align:center'><a href='".e_BASE."usersettings.php?".$user_id."'>".LAN_412."</a></td></tr>";
-}
-
-$sql -> db_Select("user", "user_id, user_name",  "ORDER BY user_id ASC", "no-where");
-$c = 0;
-while($row = $sql -> db_Fetch()){
-	$array[$c]['id'] = $row['user_id'];
-	$array[$c]['name'] = $row['user_name'];
-	if($row['user_id'] == $id){
-		$prevuser['id'] = $array[$c-1]['id'];
-		$prevuser['name'] = $array[$c-1]['name'];
-		$row = $sql -> db_Fetch();
-		$nextuser['id'] = $row['user_id'];
-		$nextuser['name'] = $row['user_name'];
-		break;
-	}
-	$c++;
-}
-
-$str .= "<tr><td colspan='2' class='forumheader3' style='text-align:center'>
-<table style='width:95%'>
-<tr>
-<td style='width:50%'>".($prevuser['id'] ? "&lt;&lt; ".LAN_414." [ <a href='".e_SELF."?id.".$prevuser['id']."'>".$prevuser['name']."</a> ]" : "&nbsp;")."</td>
-<td style='width:50%; text-align:right'>".($nextuser['id'] ? "[ <a href='".e_SELF."?id.".$nextuser['id']."'>".$nextuser['name']."</a> ] ".LAN_415." &gt;&gt;" : "&nbsp;")."</td>
-</tr>
-</table>
-</td>
-</tr>";
-$str .= "</table></div>";
-return $str;
-}
-}
-
-require_once(FOOTERF);
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/user.php,v $
+|     $Revision: 1.32 $
+|     $Date: 2006/05/19 01:57:10 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+require_once(e_FILE."shortcode/batch/user_shortcodes.php");
+
+if (isset($_POST['delp'])) {
+	$tmp = explode(".", e_QUERY);
+	if (USERID == $tmp[1] || (ADMIN && getperms("4"))) {
+		$sql->db_Select("user", "user_sess", "user_id='". USERID."'");
+		@unlink(e_FILE."public/avatars/".$row['user_sess']);
+		$sql->db_Update("user", "user_sess='' WHERE user_id=".intval($tmp[1]));
+		header("location:".e_SELF."?id.".$tmp[1]);
+		exit;
+	}
+}
+
+if (file_exists(THEME."user_template.php"))
+{
+	require_once(THEME."user_template.php");
+}
+else
+{
+	require_once(e_BASE.$THEMES_DIRECTORY."templates/user_template.php");
+}
+
+require_once(HEADERF);
+
+if (!USER) {
+	$ns->tablerender(LAN_20, "<div style='text-align:center'>".LAN_416."</div>");
+	require_once(FOOTERF);
+	exit;
+}
+
+if (isset($_POST['records'])) {
+	$records = intval($_POST['records']);
+	$order = ($_POST['order'] == 'ASC' ? 'ASC' : 'DESC');
+	$from = 0;
+}
+else if(!e_QUERY) {
+	$records = 20;
+	$from = 0;
+	$order = "DESC";
+} else {
+	$qs = explode(".", e_QUERY);
+	if ($qs[0] == "id") {
+		$id = $qs[1];
+	} else {
+		$qs = explode(".", e_QUERY);
+		$from = intval($qs[0]);
+		$records = intval($qs[1]);
+		$order = ($qs[2] == 'ASC' ? 'ASC' : 'DESC');
+	}
+}
+if ($records > 30) {
+	$records = 30;
+}
+
+if (isset($id))
+{
+	if ($id == 0) {
+		$text = "<div style='text-align:center'>".LAN_137." ".SITENAME."</div>";
+		$ns->tablerender(LAN_20, $text);
+		require_once(FOOTERF);
+		exit;
+	}
+
+	$ret = $e_event->trigger("showuser", $id);
+	if ($ret!='') {
+		$text = "<div style='text-align:center'>".$ret."</div>";
+		$ns->tablerender(LAN_20, $text);
+		require_once(FOOTERF);
+		exit;
+	}
+
+	if (isset($_POST['commentsubmit']) && $pref['profile_comments'])
+	{
+		require_once(e_HANDLER."comment_class.php");
+		$cobj = new comment;
+		$cobj->enter_comment($_POST['author_name'], $_POST['comment'], 'profile', $id, $pid, $_POST['subject']);
+	}
+
+	if($pref['profile_comments'])
+	{
+		include_once(e_HANDLER."comment_class.php");
+	}
+
+	if($text = renderuser($id))
+	{
+		$ns->tablerender(LAN_402, $text);
+	}
+	else
+	{
+		$text = "<div style='text-align:center'>".LAN_400."</div>";
+		$ns->tablerender(LAN_20, $text);
+	}
+	unset($text);
+	require_once(FOOTERF);
+	exit;
+}
+
+$users_total = $sql->db_Count("user","(*)", "WHERE user_ban = 0");
+$text = "<div style='text-align:center'>
+".LAN_138." ".$users_total."<br /><br />
+<form method='post' action='".e_SELF."'>
+<p>
+".LAN_419.": ";
+
+if ($records == 10) {
+	$text .= "<select name='records' class='tbox'>
+	<option value='10' selected='selected'>10</option>
+	<option value='20'>20</option>
+	<option value='30'>30</option>
+	</select>  ";
+}
+else if($records == 20) {
+	$text .= "<select name='records' class='tbox'>
+	<option value='10'>10</option>
+	<option value='20' selected='selected'>20</option>
+	<option value='30'>30</option>
+	</select>  ";
+} else {
+	$text .= "<select name='records' class='tbox'>
+	<option value='10'>10</option>
+	<option value='20'>20</option>
+	<option value='30' selected='selected'>30</option>
+	</select>  ";
+}
+$text .= LAN_139;
+
+if ($order == "ASC") {
+	$text .= "<select name='order' class='tbox'>
+	<option value='DESC'>".LAN_420."</option>
+	<option value='ASC' selected='selected'>".LAN_421."</option>
+	</select>";
+} else {
+	$text .= "<select name='order' class='tbox'>
+	<option value='DESC' selected='selected'>".LAN_420."</option>
+	<option value='ASC'>".LAN_421."</option>
+	</select>";
+}
+
+$text .= " <input class='button' type='submit' name='submit' value='".LAN_422."' />
+<input type='hidden' name='from' value='$from' />
+</p>
+</form>\n\n<br /><br />";
+
+
+
+if (!$sql->db_Select("user", "*", "user_ban = 0 ORDER BY user_id $order LIMIT $from,$records")) {
+	echo "<div style='text-align:center'><b>".LAN_141."</b></div>";
+} else {
+	$userList = $sql->db_getList();
+	$text .= "
+	<table style='width:95%' class='fborder'>
+	<tr>
+	<td class='fcaption' style='width:2%'>&nbsp;</td>
+	<td class='fcaption' style='width:20%'>".LAN_142."</td>
+	<td class='fcaption' style='width:20%'>".LAN_112."</td>
+	<td class='fcaption' style='width:20%'>".LAN_145."</td>
+	</tr>";
+
+	foreach ($userList as $row)
+	{
+		$text .= renderuser($row, "short");
+	}
+	$text .= "</table>\n</div>";
+}
+
+$ns->tablerender(LAN_140, $text);
+
+ 	$parms = $users_total.",".$records.",".$from.",".e_SELF.'?[FROM].'.$records.".".$order;
+	echo "<div class='nextprev'>&nbsp;".$tp->parseTemplate("{NEXTPREV={$parms}}")."</div>";
+
+
+
+
+function renderuser($uid, $mode = "verbose")
+{
+	global $sql, $pref, $tp, $sc_style, $user_shortcodes;
+	global $EXTENDED_START, $EXTENDED_TABLE, $EXTENDED_END, $USER_SHORT_TEMPLATE, $USER_FULL_TEMPLATE;
+	global $user;
+
+	if(is_array($uid))
+	{
+		$user = $uid;
+	}
+	else
+	{
+		if(!$user = get_user_data($uid))
+		{
+			return FALSE;
+		}
+	}
+
+	if($mode == 'verbose')
+	{
+		return $tp->parseTemplate($USER_FULL_TEMPLATE, FALSE, $user_shortcodes);
+	}
+	else
+	{
+		return $tp->parseTemplate($USER_SHORT_TEMPLATE, FALSE, $user_shortcodes);
+	}
+}
+
+require_once(FOOTERF);
+
 ?>
\ No newline at end of file
diff -ruN 6171/userposts.php 75/userposts.php
--- 6171/userposts.php	2005-05-12 23:13:25.000000000 -0500
+++ 75/userposts.php	2006-05-14 19:54:00.000000000 -0500
@@ -1,308 +1,364 @@
-<?php
-/*
-+---------------------------------------------------------------+
-|	e107 website system
-|	/userposts.php
-|
-|	chavo 2004
-|	http://e107.org
-|	chavo@2sdw.com
-|
-|	Released under the terms and conditions of the
-|	GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-require_once("class2.php");
-require_once(HEADERF);
-
-if(!USER){ header("location:".e_BASE."index.php"); exit; }
-if(!is_object($aj)){ $aj = new textparse; }
-
-$_POST['f_query'] = trim(chop($_POST['f_query']));
-if(e_QUERY){
-	$tmp = explode(".", e_QUERY);
-	$from = $tmp[0];
-	$action = $tmp[1];
-	$id = $tmp[2];
-}else{ header("location:".e_BASE."index.php"); exit; }
-
-
-
-$sql -> db_Select("user", "user_name",  "user_id=".$id."");
-$row = $sql -> db_Fetch(); extract($row);
-$user_id = $id.".".$user_name."";
-
-if($action == "comments"){
-
-	if(!$USERPOSTS_COMMENTS_TABLE){
-		if(file_exists(THEME."userposts_template.php")){
-      require_once(THEME."userposts_template.php");
-    }
-  	else{
-      require_once(e_BASE.$THEMES_DIRECTORY."templates/userposts_template.php");
-    }
-	}
-	
-	$ccaption = UP_LAN_1.$user_name;
-	$sql -> db_Select("user", "user_comments", "user_id=".$id."");
-	list($user_comments) = $sql -> db_Fetch();
-	$ctotal = $user_comments;
-	$sql2 = new db;
-	if(!$sql -> db_Select("comments", "*", "comment_author = '".$user_id."' ORDER BY comment_datestamp DESC LIMIT ".$from.", 10 ")){	
-		$ctext = "<span class='mediumtext'>".UP_LAN_7."</span>";
-	}else{
-		while($row = $sql -> db_Fetch()){
-		extract($row);
-			$userposts_comments_table_string .= parse_userposts_comments_table($row);
-		}
-	}
-	$userposts_comments_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_COMMENTS_TABLE_START);
-	$userposts_comments_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_COMMENTS_TABLE_END);
-
-	$ctext .= $userposts_comments_table_start."".$userposts_comments_table_string."".$userposts_comments_table_end;
-	
-	$ns -> tablerender($ccaption, $ctext);
-
-	require_once(e_HANDLER."np_class.php");
-	$ix = new nextprev("userposts.php", $from, 10, $ctotal, "Comments", "comments.".$id.""); 
-}
-
-
-
-if($action == "forums" || isset($_POST['fsearch'])){
-
-	if(!$USERPOSTS_FORUM_TABLE){
-		if(file_exists(THEME."userposts_template.php")){
-      require_once(THEME."userposts_template.php");
-    }
-  	else{
-      require_once(e_BASE.$THEMES_DIRECTORY."templates/userposts_template.php");
-    }
-	}
-
-	if(isset($_POST['f_query']) && $_POST['f_query'] != ""){
-		extract($_POST);
-		$fcaption = UP_LAN_11.$user_name;
-		$f_query = $_POST['f_query'];
-		$db_query = "SELECT * FROM ".MPREFIX."forum_t, ".MPREFIX."forum WHERE ".MPREFIX."forum.forum_id=".MPREFIX."forum_t.thread_forum_id AND ".MPREFIX."forum_t.thread_user='".$user_id."' AND (".MPREFIX."forum_t.thread_name REGEXP('".$f_query."') OR ".MPREFIX."forum_t.thread_thread REGEXP('".$f_query."')) ORDER BY ".MPREFIX."forum_t.thread_datestamp DESC ";
-	}else{
-		if(!is_object($sql2)){
-			$sql2 = new db;
-		}
-		$ftotal = 0;
-		$sql2 -> db_Select_gen("SELECT * FROM ".MPREFIX."forum_t, ".MPREFIX."forum WHERE ".MPREFIX."forum.forum_id=".MPREFIX."forum_t.thread_forum_id AND ".MPREFIX."forum_t.thread_user='".$user_id."'" );
-		while($row = $sql2 -> db_Fetch()){
-			extract($row);
-			if(check_class($forum_class)){
-				$ftotal ++;
-				$limit_ids[] = $thread_id;
-			}
-		}
-		$limit_ids = implode(",", $limit_ids);
-		$fcaption = UP_LAN_0.$user_name;
-		$db_query = "SELECT * FROM ".MPREFIX."forum_t, ".MPREFIX."forum WHERE ".MPREFIX."forum.forum_id=".MPREFIX."forum_t.thread_forum_id AND ".MPREFIX."forum_t.thread_user='".$user_id."' AND ".MPREFIX."forum_t.thread_id IN ($limit_ids) ORDER BY ".MPREFIX."forum_t.thread_datestamp DESC LIMIT ".$from.", 10";
-	}
-
-	$sql = new db;
-	if(!$sql -> db_Select_gen("".$db_query."")){
-		$ftext .= "<span class='mediumtext'>".UP_LAN_8."</span>";
-	}else{
-
-		if(!is_object($gen)){
-			$gen = new convert;
-		}
-		while($row = $sql-> db_Fetch()){
-		extract($row);
-			if(check_class($forum_class)){
-				$userposts_forum_table_string .= parse_userposts_forum_table($row);
-			}
-		}
-		$userposts_forum_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_FORUM_TABLE_START);
-
-		$USERPOSTS_FORUM_SEARCH = "<input class='tbox' type='text' name='f_query' size='20' value='' maxlength='50' /> <input class='button' type='submit' name='fsearch' value='".UP_LAN_12."' />";
-
-		$userposts_forum_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_FORUM_TABLE_END);
-
-		$ftext .= $userposts_forum_table_start."".$userposts_forum_table_string."".$userposts_forum_table_end;
-	}
-	$ns -> tablerender($fcaption, $ftext);
-
-	require_once(e_HANDLER."np_class.php");
-	$ix = new nextprev("userposts.php", $from, 10, $ftotal, "Forum Posts", "forums.".$id.""); 
-}
-	
-require_once(FOOTERF);
-
-
-
-
-function parse_userposts_comments_table($row){
-			global $USERPOSTS_COMMENTS_TABLE, $pref, $gen, $aj, $menu_pref;
-			extract($row);
-
-			$poster = substr($comment_author, (strpos($comment_author, ".")+1));
-			$gen = new convert;
-			$datestamp = $gen->convert_date($comment_datestamp, "short");
-
-			$comment_comment = $aj -> tpa($comment_comment);
-
-			if($pref['cb_linkreplace']){
-				$comment_comment .= " ";
-				$comment_comment = preg_replace("#\>(.*?)\</a\>[\s]#si", ">".$pref['cb_linkc']."</a> ", $comment_comment);
-				$comment_comment = $aj -> tpa(strip_tags($comment_comment));
-			}
-	
-			if(!eregi("<a href|<img|&#", $thread_thread)){
-				$message_array = explode(" ", $comment_comment);
-				for($i=0; $i<=(count($message_array)-1); $i++){
-					if(strlen($message_array[$i]) > 20){
-						$message_array[$i] = preg_replace("/([^\s]{20})/", "$1<br />", $message_array[$i]);
-					}
-				}
-				$comment_comment = implode(" ", $message_array);
-			}
-			/*
-			if(strlen($comment_comment) > $menu_pref['comment_characters']){
-				$comment_comment = substr($comment_comment, 0, $menu_pref['comment_characters']).$menu_pref['comment_postfix'];
-			}
-			*/
-			$sql2 = new db;
-			if($comment_type == "0"){
-				$sql2 -> db_Select("news", "news_title, news_class", "news_id = '".$comment_item_id."' ");
-				$row = $sql2 -> db_Fetch(); extract($row);
-				if(!$news_class){
-
-					$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/bullet2.gif' alt='' />";
-					$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_9." ".$datestamp;
-					$USERPOSTS_COMMENTS_HEADING = $news_title;
-					$USERPOSTS_COMMENTS_COMMENT = $comment_comment;
-					$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."comment.php?comment.news.$comment_item_id'>";
-					$USERPOSTS_COMMENTS_TYPE = "news";
-				}
-			}
-			if($comment_type == "1"){
-				$sql2 -> db_Select("content", "*", "content_id=$comment_item_id");
-				$row = $sql2 -> db_Fetch(); extract($row);
-
-				if(check_class($content_class)){
-					if($content_type == 0){
-						$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/bullet2.gif' alt='' />";
-						$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_9." ".$datestamp;
-						$USERPOSTS_COMMENTS_HEADING = $content_heading;
-						$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."content.php?article.$comment_item_id'>";
-						$USERPOSTS_COMMENTS_TYPE = "article";
-					}else if($content_type == 3){
-						$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/bullet2.gif' alt='' />";
-						$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_9." ".$datestamp;
-						$USERPOSTS_COMMENTS_HEADING = $content_heading;
-						$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."content.php?review.$comment_item_id'>";
-						$USERPOSTS_COMMENTS_TYPE = "review";
-					}else if($content_type == 1){
-						$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/bullet2.gif' alt='' />";
-						$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_9." ".$datestamp;
-						$USERPOSTS_COMMENTS_HEADING = $content_heading;
-						$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."content.php?content.$comment_item_id'>";
-						$USERPOSTS_COMMENTS_TYPE = "content";
-					}
-					$USERPOSTS_COMMENTS_COMMENT = ($comment_blocked ? CM_L2 : $comment_comment);
-				}
-			}
-			if($comment_type == "2"){
-				$sql2 -> db_Select("download", "*", "download_id=$comment_item_id");
-				$row = $sql2 -> db_Fetch(); extract($row);
-
-					$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/bullet2.gif' alt='' />";
-					$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_9." ".$datestamp;
-					$USERPOSTS_COMMENTS_HEADING = $download_name;
-					$USERPOSTS_COMMENTS_COMMENT = $comment_comment;
-					$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."download.php?view.".$comment_item_id."'>";
-					$USERPOSTS_COMMENTS_TYPE = "download";
-			}
-			if($comment_type == "4"){
-				$sql2 -> db_Select("poll", "*", "poll_id=$comment_item_id");
-				$row = $sql2 -> db_Fetch(); extract($row);
-
-					$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/bullet2.gif' alt='' />";
-					$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_9." ".$datestamp;
-					$USERPOSTS_COMMENTS_HEADING = $poll_title;
-					$USERPOSTS_COMMENTS_COMMENT = $comment_comment;
-					$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."comment.php?comment.poll.".$comment_item_id."'>";
-					$USERPOSTS_COMMENTS_TYPE = "poll";
-			}
-
-			// added a check for not numeric comment_types (=custom comments for your own plugins)
-			if(!is_numeric($comment_type)){
-				unset($handle, $heading, $href);
-				$handle=opendir(e_PLUGIN);
-				while(false !== ($file = readdir($handle))){
-					if($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)){
-						$plugin_handle=opendir(e_PLUGIN.$file."/");
-						while(false !== ($file2 = readdir($plugin_handle))){
-							if($file2 == "e_comment.php"){
-								require_once(e_PLUGIN.$file."/".$file2);
-								if($comment_type == $e_plug_table){
-									$plugin_redir = $reply_location;
-									list($url, $querystring) = explode("?", $plugin_redir);
-									$USERPOSTS_COMMENTS_HEADING = $comment_subject;
-									$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".$url."?".$comment_item_id."'>";
-								}else{
-									$USERPOSTS_COMMENTS_HEADING = $comment_subject;
-									$USERPOSTS_COMMENTS_HREF_PRE = "";
-								}
-							}
-						}
-					}
-				}
-				
-				$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/bullet2.gif' alt='' />";
-				$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_9." ".$datestamp;
-				$USERPOSTS_COMMENTS_COMMENT = $comment_comment;
-				$USERPOSTS_COMMENTS_TYPE = $comment_type;
-			}
-			// end
-
-			return(preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_COMMENTS_TABLE));
-}
-
-
-function parse_userposts_forum_table($row){
-			global $USERPOSTS_FORUM_TABLE, $gen, $aj;
-			extract($row);
-
-			$gen = new convert;
-			$sql2 = new db;
-
-			$poster = substr($thread_user, (strpos($thread_user, ".")+1));
-			$datestamp = $gen->convert_date($thread_datestamp, "short");			
-
-			if($thread_parent){
-				
-				if($cachevar[$thread_parent]){
-					$thread_name = $cachevar[$thread_parent];
-				}else{
-					$tmp = $thread_parent;
-					$sql2 -> db_Select("forum_t", "thread_name", "thread_id = '".$thread_parent."' ");
-					list($thread_name) = $sql2 -> db_Fetch();
-					$cachevar[$thread_parent] = $thread_name;
-				}
-				$USERPOSTS_FORUM_TOPIC_PRE = "Re: ";
-			}else{
-				$tmp = $thread_id;
-				$USERPOSTS_FORUM_TOPIC_PRE = "Thread: ";
-			}
-
-			$thread_thread = $aj -> tpa($thread_thread);
-
-			$USERPOSTS_FORUM_ICON = "<img src='".e_IMAGE."forum/new_small.png' alt='' />";
-			$USERPOSTS_FORUM_TOPIC_HREF_PRE = "<a href='".e_BASE."forum_viewtopic.php?".$thread_forum_id.".".$tmp."'>";
-			$USERPOSTS_FORUM_TOPIC = $thread_name;
-			$USERPOSTS_FORUM_NAME_HREF_PRE = "<a href='".e_BASE."forum_viewforum.php?".$forum_id."'>";
-			$USERPOSTS_FORUM_NAME = $forum_name;
-			$USERPOSTS_FORUM_THREAD = $thread_thread;
-			$USERPOSTS_FORUM_DATESTAMP = UP_LAN_11." ".$datestamp;
-
-			return(preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_FORUM_TABLE));
-}
-
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/userposts.php,v $
+|     $Revision: 1.21 $
+|     $Date: 2006/05/15 00:54:00 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+require_once("class2.php");
+require_once(HEADERF);
+	
+if (!USER) {
+	header("location:".e_BASE."index.php");
+	exit;
+}
+	
+$_POST['f_query'] = trim($_POST['f_query']);
+
+if (e_QUERY)
+{
+	list($from, $action, $id) = explode(".", e_QUERY);
+	$id = intval($id);
+	$from = intval($from);
+}
+else
+{
+	header("location:".e_BASE."index.php");
+	exit;
+}
+
+if(!defined("BULLET"))
+{
+	 define("BULLET", "bullet2.gif");
+}
+
+if ($action == "comments") {
+	if(is_numeric($id))
+	{
+		$sql->db_Select("user", "user_name", "user_id=".$id);
+		$row = $sql->db_Fetch();
+		extract($row);
+		$user_id = $id.".".$user_name."";
+	}
+	else
+	{
+		$user_name = UP_LAN_16.$id;
+	}
+
+	if (!$USERPOSTS_COMMENTS_TABLE) {
+		if (file_exists(THEME."userposts_template.php")) {
+			require_once(THEME."userposts_template.php");
+		} else {
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/userposts_template.php");
+		}
+	}
+	 
+	
+	$sql2 = new db;
+	if(is_numeric($id))
+	{
+		$ccaption = UP_LAN_1.$user_name;
+		$sql->db_Select("user", "user_comments", "user_id=".$id."");
+		list($user_comments) = $sql->db_Fetch();
+		$ctotal = $user_comments;
+		$blah = $sql->db_Select("comments", "*", "comment_author = '".$user_id."' ORDER BY comment_datestamp DESC LIMIT ".$from.", 10 ");
+	}
+	else
+	{
+		require_once(e_HANDLER."encrypt_handler.php");
+		$dip = decode_ip($id);
+		$ccaption = UP_LAN_1.$dip;
+		$blah = $sql->db_Select("comments", "*", "comment_ip = '".$id."' ORDER BY comment_datestamp DESC LIMIT ".$from.", 10 ");
+	}
+	
+	if (!$blah) {
+		$ctext = "<span class='mediumtext'>".UP_LAN_7."</span>";
+	} else {
+		$render = $sql -> db_getList(); 
+		foreach ($render as $row)
+		{
+			extract($row);
+			if($comment_comment)
+			{
+				$userposts_comments_table_string .= parse_userposts_comments_table($row);
+			}
+		}
+	}
+	$userposts_comments_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_COMMENTS_TABLE_START);
+	$userposts_comments_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_COMMENTS_TABLE_END);
+	 
+	$ctext .= $userposts_comments_table_start."".$userposts_comments_table_string."".$userposts_comments_table_end;
+	 
+	$ns->tablerender($ccaption, $ctext);
+	 
+	require_once(e_HANDLER."np_class.php");
+	$ix = new nextprev("userposts.php", $from, 10, $ctotal, UP_LAN_13, "comments.".$id."");
+}
+	
+	
+	
+if ($action == "forums" || isset($_POST['fsearch'])) {
+	 
+	if(is_numeric($id))
+	{
+		$user_id = intval($id);
+		$sql->db_Select("user", "user_name", "user_id=".$id."");
+		$row = $sql->db_Fetch();
+		$fcaption = UP_LAN_0." ".$row['user_name'];
+	}
+	else
+	{
+		$user_name = 0;
+	}
+
+	if (!$USERPOSTS_FORUM_TABLE) {
+		if (file_exists(THEME."userposts_template.php")) {
+			require_once(THEME."userposts_template.php");
+		} else {
+			require_once(e_BASE.$THEMES_DIRECTORY."templates/userposts_template.php");
+		}
+	}
+
+	$s_info = "";
+	if (isset($_POST['f_query']) && $_POST['f_query'] != "")
+	{
+		$f_query = $tp -> toDB($_POST['f_query']);
+		$s_info = "AND (ft.thread_name REGEXP('".$f_query."') OR ft.thread_thread REGEXP('".$f_query."'))";
+		$fcaption = UP_LAN_12." ".$row['user_name'];
+	}
+	$qry = "
+	SELECT f.*, ft.* FROM #forum_t AS ft
+	LEFT JOIN #forum AS f ON ft.thread_forum_id = f.forum_id
+	LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
+	WHERE ft.thread_user LIKE '{$user_id}.%'
+	AND f.forum_class IN (".USERCLASS_LIST.")
+	AND fp.forum_class IN (".USERCLASS_LIST.") 
+	{$s_info}
+	ORDER BY ft.thread_datestamp DESC LIMIT {$from}, 10
+	";	
+
+	$total_qry = "
+	SELECT COUNT(*) AS count FROM #forum_t AS ft
+	LEFT JOIN #forum AS f ON ft.thread_forum_id = f.forum_id
+	LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
+	WHERE ft.thread_user LIKE '{$user_id}.%'
+	AND f.forum_class IN (".USERCLASS_LIST.")
+	AND fp.forum_class IN (".USERCLASS_LIST.") 
+	{$s_info}
+	";	
+
+	$ftotal = 0;
+	if($sql->db_Select_gen($total_qry))
+	{
+		$row = $sql->db_Fetch();
+		$ftotal = $row['count'];
+	}
+
+	if (!$sql->db_Select_gen($qry))
+	{
+		$ftext .= "<span class='mediumtext'>".UP_LAN_8."</span>";
+	}
+	else
+	{
+		if (!is_object($gen))
+		{
+			$gen = new convert;
+		}
+		$render = $sql -> db_getList(); 
+		foreach ($render as $row)
+		{
+			$userposts_forum_table_string .= parse_userposts_forum_table($row);
+		}
+		$userposts_forum_table_start = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_FORUM_TABLE_START);
+		$USERPOSTS_FORUM_SEARCH = "<input class='tbox' type='text' name='f_query' size='20' value='' maxlength='50' /> <input class='button' type='submit' name='fsearch' value='".UP_LAN_12."' />";
+		$userposts_forum_table_end = preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_FORUM_TABLE_END);
+		$ftext .= $userposts_forum_table_start."".$userposts_forum_table_string."".$userposts_forum_table_end;
+	}
+	$ns->tablerender($fcaption, $ftext);
+	 
+	require_once(e_HANDLER."np_class.php");
+	$ix = new nextprev("userposts.php", $from, 10, $ftotal, UP_LAN_14, "forums.".$id."");
+}
+	
+require_once(FOOTERF);
+	
+	
+	
+	
+function parse_userposts_comments_table($row) {
+	global $USERPOSTS_COMMENTS_TABLE, $pref, $gen, $tp, $menu_pref, $id;
+	extract($row);
+	 
+	$poster = substr($comment_author, (strpos($comment_author, ".")+1));
+	$gen = new convert;
+	$datestamp = $gen->convert_date($comment_datestamp, "short");
+	$DATESTAMP = $datestamp;
+	 
+	$comment_comment = $tp->toHTML($comment_comment, TRUE, "", $id);
+	
+	$sql2 = new db;
+	if ($comment_type == "0") {
+		$sql2->db_Select("news", "news_title, news_class", "news_id = '".intval($comment_item_id)."' ");
+		$row = $sql2->db_Fetch();
+		if (!$row['news_class']) {
+			 
+			$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/".BULLET."' alt='' />";
+			$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_11." ".$datestamp;
+			$USERPOSTS_COMMENTS_HEADING = $row['news_title'];
+			$USERPOSTS_COMMENTS_COMMENT = $comment_comment;
+			$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."comment.php?comment.news.$comment_item_id'>";
+			$USERPOSTS_COMMENTS_TYPE = "news";
+		}
+	}
+	if ($comment_type == "1") {
+		$sql2->db_Select("content", "content_heading, content_class, content_type", "content_id=".intval($comment_item_id));
+		$row = $sql2->db_Fetch();
+		 
+		if (check_class($row['content_class'])) {
+			if ($row['content_type'] == 0) {
+				$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/".BULLET."' alt='' />";
+				$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_11." ".$datestamp;
+				$USERPOSTS_COMMENTS_HEADING = $row['content_heading'];
+				$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."content.php?article.$comment_item_id'>";
+				$USERPOSTS_COMMENTS_TYPE = "article";
+			}
+			else if($row['content_type'] == 3) {
+				$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/".BULLET."' alt='' />";
+				$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_11." ".$datestamp;
+				$USERPOSTS_COMMENTS_HEADING = $row['content_heading'];
+				$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."content.php?review.$comment_item_id'>";
+				$USERPOSTS_COMMENTS_TYPE = "review";
+			}
+			else if($row['content_type'] == 1) {
+				$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/".BULLET."' alt='' />";
+				$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_11." ".$datestamp;
+				$USERPOSTS_COMMENTS_HEADING = $row['content_heading'];
+				$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."content.php?content.$comment_item_id'>";
+				$USERPOSTS_COMMENTS_TYPE = "content";
+			}
+			$USERPOSTS_COMMENTS_COMMENT = ($comment_blocked ? CM_L2 : $comment_comment);
+		}
+	}
+	if ($comment_type == "2") {
+		$sql2->db_Select("download", "download_name", "download_id=".intval($comment_item_id));
+		$row = $sql2->db_Fetch();
+		 
+		$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/".BULLET."' alt='' />";
+		$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_11." ".$datestamp;
+		$USERPOSTS_COMMENTS_HEADING = $row['download_name'];
+		$USERPOSTS_COMMENTS_COMMENT = $comment_comment;
+		$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."download.php?view.".$comment_item_id."'>";
+		$USERPOSTS_COMMENTS_TYPE = "download";
+	}
+	if ($comment_type == "4") {
+		$sql2->db_Select("poll", "poll_title", "poll_id=".intval($comment_item_id));
+		$row = $sql2->db_Fetch();
+		 
+		$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/".BULLET."' alt='' />";
+		$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_11." ".$datestamp;
+		$USERPOSTS_COMMENTS_HEADING = $row['poll_title'];
+		$USERPOSTS_COMMENTS_COMMENT = $comment_comment;
+		$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_BASE."comment.php?comment.poll.".$comment_item_id."'>";
+		$USERPOSTS_COMMENTS_TYPE = "poll";
+	}
+
+	if ($comment_type == "5") {
+		$sql2->db_Select("documentation", "doc_title", "doc_id=".intval($comment_item_id));
+		$row = $sql2->db_Fetch();
+		 
+		$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/".BULLET."' alt='' />";
+		$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_11." ".$datestamp;
+		$USERPOSTS_COMMENTS_HEADING = $row['doc_title'];
+		$USERPOSTS_COMMENTS_COMMENT = $comment_comment;
+		$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".e_PLUGIN."documentation/documentation.php?".$comment_item_id."'>";
+		$USERPOSTS_COMMENTS_TYPE = "documentation";
+	}
+	 
+	// added a check for not numeric comment_types (=custom comments for your own plugins)
+	if (!is_numeric($comment_type)) {
+		unset($handle, $heading, $href);
+		$handle = opendir(e_PLUGIN);
+		while (false !== ($file = readdir($handle))) {
+			if ($file != "." && $file != ".." && is_dir(e_PLUGIN.$file)) {
+				$plugin_handle = opendir(e_PLUGIN.$file."/");
+				while (false !== ($file2 = readdir($plugin_handle))) {
+					if ($file2 == "e_comment.php") {
+						require_once(e_PLUGIN.$file."/".$file2);
+						if ($comment_type == $e_plug_table) {
+							$plugin_redir = $reply_location;
+							list($url, $querystring) = explode("?", $plugin_redir);
+							$USERPOSTS_COMMENTS_HEADING = $comment_subject;
+							$USERPOSTS_COMMENTS_HREF_PRE = "<a href='".$url."?".$comment_item_id."'>";
+						} else {
+							$USERPOSTS_COMMENTS_HEADING = $comment_subject;
+							$USERPOSTS_COMMENTS_HREF_PRE = "";
+						}
+					}
+				}
+			}
+		}
+		 
+		$USERPOSTS_COMMENTS_ICON = "<img src='".THEME."images/".BULLET."' alt='' />";
+		$USERPOSTS_COMMENTS_DATESTAMP = UP_LAN_11." ".$datestamp;
+		$USERPOSTS_COMMENTS_COMMENT = $comment_comment;
+		$USERPOSTS_COMMENTS_TYPE = $comment_type;
+	}
+	// end
+	 
+	return(preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_COMMENTS_TABLE));
+}
+	
+	
+function parse_userposts_forum_table($row) {
+	global $USERPOSTS_FORUM_TABLE, $gen, $tp, $id;
+	extract($row);
+	 
+	$gen = new convert;
+	$sql2 = new db;
+	 
+	$poster = substr($thread_user, (strpos($thread_user, ".")+1));
+	$datestamp = $gen->convert_date($thread_datestamp, "short");
+	$DATESTAMP = $datestamp;
+	 
+	if ($thread_parent) {
+		 
+		if ($cachevar[$thread_parent]) {
+			$thread_name = $cachevar[$thread_parent];
+		} else {
+			$tmp = $thread_parent;
+			$sql2->db_Select("forum_t", "thread_name", "thread_id = '".intval($thread_parent)."' ");
+			list($thread_name) = $sql2->db_Fetch();
+			$cachevar[$thread_parent] = $thread_name;
+		}
+		$USERPOSTS_FORUM_TOPIC_PRE = UP_LAN_15.": ";
+	} else {
+		$tmp = $thread_id;
+		$USERPOSTS_FORUM_TOPIC_PRE = UP_LAN_2.": ";
+	}
+	 
+	$thread_thread = $tp->toHTML($thread_thread, TRUE, "", $id);
+	 
+	$USERPOSTS_FORUM_ICON = "<img src='".e_PLUGIN."forum/images/".IMODE."/new_small.png' alt='' />";
+	$USERPOSTS_FORUM_TOPIC_HREF_PRE = "<a href='".e_PLUGIN."forum/forum_viewtopic.php?".$tmp."'>";
+	$USERPOSTS_FORUM_TOPIC = $thread_name;
+	$USERPOSTS_FORUM_NAME_HREF_PRE = "<a href='".e_PLUGIN."forum/forum_viewforum.php?".$forum_id."'>";
+	$USERPOSTS_FORUM_NAME = $forum_name;
+	$USERPOSTS_FORUM_THREAD = $thread_thread;
+	$USERPOSTS_FORUM_DATESTAMP = UP_LAN_11." ".$datestamp;
+	 
+	return(preg_replace("/\{(.*?)\}/e", '$\1', $USERPOSTS_FORUM_TABLE));
+}
+	
+	
 ?>
\ No newline at end of file
diff -ruN 6171/usersettings.php 75/usersettings.php
--- 6171/usersettings.php	2004-08-28 13:09:36.000000000 -0500
+++ 75/usersettings.php	2006-05-18 10:12:58.000000000 -0500
@@ -1,580 +1,450 @@
-<?php
-
-/*
-+---------------------------------------------------------------+
-|        e107 website system
-|        /usersettings.php
-|
-|        Steve Dunstan 2001-2002
-|        http://e107.org
-|        jalist@e107.org
-|
-|        Released under the terms and conditions of the
-|        GNU General Public License (http://gnu.org).
-+---------------------------------------------------------------+
-*/
-
-
-require_once("class2.php");
-
-if(IsSet($_POST['sub_news'])){
-        header("location:".e_BASE."submitnews.php");
-        exit;
-}
-
-if(IsSet($_POST['sub_link'])){
-        header("location:".e_BASE."links.php?submit");
-        exit;
-}
-
-if(IsSet($_POST['sub_download'])){
-        header("location:".e_BASE."upload.php");
-        exit;
-}
-
-if(IsSet($_POST['sub_article'])){
-        header("location:".e_BASE."subcontent.php?article");
-        exit;
-}
-
-if(IsSet($_POST['sub_review'])){
-        header("location:".e_BASE."subcontent.php?review");
-        exit;
-}
-if(!USER && !ADMIN){ header("location:".e_BASE."index.php"); exit; }
-require_once(e_HANDLER."ren_help.php");
-
-if(e_QUERY && !ADMIN){
-        header("location:".e_BASE."usersettings.php");
-        exit;
-}
-$aj = new textparse;
-$_uid = e_QUERY;
-
-require_once(HEADERF);
-
-if(IsSet($_POST['updatesettings'])){
-	
-        // check prefs for required fields =================================.
-    $signupval = explode(".",$pref['signup_options']);
-    $signup_title = array(LAN_308,LAN_144,LAN_115,LAN_116,LAN_117,LAN_118,LAN_119,LAN_120,LAN_121,LAN_122);
-    $signup_name = array("realname","website","icq","aim","msn","birth_year","location","signature","image","user_timezone");
-
-        if($_POST['image'] && $size = getimagesize($_POST['image'])){
-                $avwidth = $size[0];
-                $avheight = $size[1];
-                $avmsg="";
-
-                $pref['im_width'] = ($pref['im_width']) ? $pref['im_width'] : 120;
-                $pref['im_height'] = ($pref['im_height']) ? $pref['im_height'] : 100;
-                if($avwidth > $pref['im_width']){
-                        $avmsg .= LAN_USET_1."<br />".LAN_USET_2.": {$pref['im_width']}<br /><br />";
-                }
-                if($avheight > $pref['im_height']){
-                        $avmsg .= LAN_USET_3."<br />".LAN_USET_4.": {$pref['im_height']}";
-                }
-                if($avmsg){
-                        $_POST['image']="";
-                        $ns -> tablerender(" ",$avmsg);
-                }
-        }
-
-        for ($i=0; $i<count($signup_title); $i++) {
-                $postvalue = $signup_name[$i];
-                if($signupval[$i]==2 && $_POST[$postvalue] == ""){
-                    $error .= LAN_SIGNUP_6."<b>".$signup_title[$i]."</b>".LAN_SIGNUP_7."<br />";
-                }
-        };
-
-
-        if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-                $row = $sql -> db_Fetch();
-                $user_entended = unserialize($row[0]);
-                $c=0;
-                while(list($key, $u_entended) = each($user_entended)){
-                    if($u_entended){
-
-                        if($_POST[str_replace(" ", "_", $u_entended)] === "" && $pref['signup_ext'.$key] == 2){
-                        $ut = explode("|",$u_entended);
-                        $u_name = ($ut[0] != "") ? trim($ut[0]) : trim($u_entended);
-                        $error_ext = LAN_SIGNUP_6."<b>".$u_name."</b>".LAN_SIGNUP_7;
-                        $error .= $error_ext."<br />";
-                        }
-
-                    }
-                }
-        }
-
-        // ====================================================================
-
-        if($_POST['password1'] != $_POST['password2']){
-                $error .= LAN_105."<br />";
-        }
-
-        if(strlen($_POST['password1']) < $pref['signup_pass_len'] && $_POST['password1'] !=""){
-
-                $error .= LAN_SIGNUP_4.$pref['signup_pass_len'].LAN_SIGNUP_5;
-                $password1 = "";
-                $password2 = "";
-        }
-
-        if($_POST['password1'] =="" || $_POST['password2'] == ""){
-                $password = $_POST['_pw'];
-        }else{
-                $password = md5($_POST['password1']);
-        }
-
-         if(!preg_match('/^[-!#$%&\'*+\\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i', $_POST['email'])){
-                 $error .= LAN_106;
-         }
-
-
-        if($sql -> db_Select("user", "user_email", "user_email='".$_POST['email']." AND user_id!=".USERID."' ")){
-                message_handler("P_ALERT", LAN_408);
-                $error = TRUE;
-        }
-
-
-		if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-			$row = $sql -> db_Fetch();
-			$user_entended = unserialize($row[0]);
-			$c=0;
-			while(list($key, $u_entended) = each($user_entended)){
-				if($u_entended){
-					if($pref['signup_ext'.$key] ==2 && $_POST["ue_{$key}"] == ""){
-						$ut = explode("|",$u_entended);
-						$u_name = ($ut[0] != "") ? trim($ut[0]) : trim($u_entended);
-						$error_ext = LAN_SIGNUP_6.$u_name.LAN_SIGNUP_7;
-						message_handler("P_ALERT", $error_ext);
-						$error = TRUE;
-					}
-		
-				}
-			}
-		}
-		
-         if (preg_match('#^www\.#si', $_POST['website'])) {
-                $_POST['website'] = "http://$homepage";
-        }else if (!preg_match('#^[a-z0-9]+://#si', $_POST['website'])){
-                $_POST['website'] = "";
-    }
-
-	if($_POST['icq'] && !is_numeric($_POST['icq'])){
-		$error = LAN_ICQNUMBER;
-		$_POST['icq'] = "";
-	}
-
-        $birthday = $_POST['birth_year']."/".$_POST['birth_month']."/".$_POST['birth_day'];
-        if($file_userfile['error'] != 4){
-                require_once(e_HANDLER."upload_handler.php");
-                require_once(e_HANDLER."resize_handler.php");
-                if($uploaded = file_upload(e_FILE."public/avatars/", "avatar")){
-                        if($uploaded[0]['name'] && $pref['avatar_upload']){
-                                // avatar uploaded
-                                $_POST['image'] = "-upload-".$uploaded[0]['name'];
-                                if(!resize_image(e_FILE."public/avatars/".$uploaded[0]['name'], e_FILE."public/avatars/".$uploaded[0]['name'], "avatar")){
-									unset($message);
-									$error = RESIZE_NOT_SUPPORTED;
-									@unlink(e_FILE."public/avatars/".$uploaded[0]['name']);
-								}
-                        }else{
-                                // photograph uploaded
-                                $user_sess = ($pref['avatar_upload'] ? $uploaded[1]['name'] : $uploaded[0]['name']);
-                                resize_image(e_FILE."public/avatars/".$user_sess, e_FILE."public/avatars/".$user_sess, 180);
-
-                        }
-                }
-        }
-        if(!$user_sess){ $user_sess = $_POST['_user_sess']; }
-        if(!$error){
-                if($_uid && ADMIN){ $inp = $_uid; $remflag = TRUE; }else{ $inp = USERID; }
-                $_POST['signature'] = $aj -> formtpa($_POST['signature'], "public");
-                $_POST['location'] = $aj -> formtpa($_POST['location'], "public");
-                $_POST['website'] = $aj -> formtpa($_POST['website'], "public");
-                $_POST['msn'] = $aj -> formtpa($_POST['msn'], "public");
-                $_POST['aim'] = $aj -> formtpa($_POST['aim'], "public");
-                $_POST['realname'] = $aj -> formtpa($_POST['realname'], "public");
-                $_POST['customtitle'] = $aj -> formtpa($_POST['customtitle'], "public");
-                $sql -> db_Update("user", "user_password='$password', user_sess='$user_sess', user_email='".$_POST['email']."', user_homepage='".$_POST['website']."', user_icq='".$_POST['icq']."', user_aim='".$_POST['aim']."', user_msn='".$_POST['msn']."', user_location='".$_POST['location']."', user_birthday='".$birthday."', user_signature='".$_POST['signature']."', user_image='".$_POST['image']."', user_timezone='".$_POST['user_timezone']."', user_hideemail='".$_POST['hideemail']."', user_login='".$_POST['realname']."', user_customtitle='".$_POST['customtitle']."' WHERE user_id='".$inp."' ");
-
-                if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-                        $row = $sql -> db_Fetch();
-                        $user_entended = unserialize($row[0]);
-                        while(list($key, $u_entended) = each($user_entended)){
-                        	if($_POST["ue_{$key}"]){
-                                $val = $aj -> formtpa($_POST["ue_{$key}"], "public");
-                                $user_pref["ue_{$key}"] = $val;
-                        	} else {
-                        		unset($user_pref["ue_{$key}"]);
-                        	}
-                        }
-                        save_prefs("user", $inp);
-                }
-
-                if($remflag){
-                        header("location:".e_ADMIN."users.php?main.$inp");
-                        exit;
-                }
-
-                $text = "<div style='text-align:center'>".LAN_150."</div>";
-                $ns -> tablerender(LAN_151, $text);
-        }
-}
-
-if($error){
-        $ns -> tablerender("<div style='text-align:center'>".LAN_20."</div>", $error);
-}
-
-if($_uid){
-        $sql -> db_Select("user", "*", "user_id='".$_uid."' ");
-}else{
-        $sql -> db_Select("user", "*", "user_id='".USERID."' ");
-}
-list($user_id, $name, $user_customtitle, $user_password, $user_sess, $email, $website, $icq, $aim, $msn, $location, $birthday, $signature, $image, $user_timezone, $hideemail, $user_join, $user_lastvisit, $user_currentvisit, $user_lastpost, $user_chats, $user_comments, $user_forums, $user_ip, $user_ban, $user_prefs, $user_new, $user_viewed, $user_visits, $user_admin, $user_login) = $sql -> db_Fetch();
-
-$signature = $aj -> editparse($signature);
-$tmp = explode("-", $birthday);
-$user_customtitle = ($_POST['customtitle'])? $_POST['customtitle']:$user_customtitle;
-$birth_day = ($_POST['birth_day'])? $_POST['birth_day']:$tmp[2];
-$birth_month = ($_POST['birth_month'])? $_POST['birth_month']:$tmp[1];
-$birth_year = ($_POST['birth_year'])? $_POST['birth_year']:$tmp[0];
-$user_login = ($_POST['realname'])? $_POST['realname']:$user_login;
-$location = ($_POST['location'])? $_POST['location']:$location;
-$icq = ($_POST['icq'])? $_POST['icq']:$icq;
-$msn = ($_POST['msn'])? $_POST['msn']:$msn;
-$aim = ($_POST['aim'])? $_POST['aim']:$aim;
-$website = ($_POST['website'])? $_POST['website']:$website;
-$signature = ($_POST['signature'])? $_POST['signature']:$signature;
-$user_timezone = ($_POST['user_timezone'])? $_POST['user_timezone']:$user_timezone;
-
-require_once(e_HANDLER."form_handler.php");
-$rs = new form;
-
-$text = (e_QUERY ? $rs -> form_open("post", e_SELF."?".$user_id, "dataform", "", " enctype='multipart/form-data'") : $rs -> form_open("post", e_SELF, "dataform", "", " enctype='multipart/form-data'"));
-
-$text .= "<div style='text-align:center'>
-<table style='width:auto' class='fborder'>
-
-<tr>
-<td colspan='2' class='forumheader'>".LAN_418."</td>
-</tr>
-
-
-<tr>
-<td style='width:40%' class='forumheader3'>".LAN_7."</td>
-<td style='width:60%' class='forumheader2'>".
-$rs -> form_text("name", 20, $name, 100, "tbox", TRUE)
-."</td>
-</tr>
-
-<tr>
-<td style='width:30%' class='forumheader3'>".LAN_308."</td>
-<td style='width:70%' class='forumheader2'>
-".$rs -> form_text("realname", 40, $user_login, 100)."
-</td>
-</tr>";
-if($pref['forum_user_customtitle'] || ADMIN){
-        $text .= "
-        <tr>
-        <td style='width:30%' class='forumheader3'>".LAN_CUSTOMTITLE."</td>
-        <td style='width:70%' class='forumheader2'>
-        ".$rs -> form_text("customtitle", 40, $user_customtitle, 100)."
-        </td>
-        </tr>";
-}
-
-$text .= "
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_152."<br /><span class='smalltext'>".LAN_401."</span></td>
-<td style='width:80%' class='forumheader2'>
-".$rs -> form_password("password1", 40, "", 20);
-if($pref['signup_pass_len']){
-$text .= "<br /><span class='smalltext'>  (".LAN_SIGNUP_1." {$pref['signup_pass_len']} ".LAN_SIGNUP_2.")</span>";
-}
-$text .="
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_153."<br /><span class='smalltext'>".LAN_401."</span></td>
-<td style='width:80%' class='forumheader2'>
-".$rs -> form_password("password2", 40, "", 20)."
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_112."</td>
-<td style='width:80%' class='forumheader2'>
-".$rs -> form_text("email", 40, $email, 100)."
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_113."<br /><span class='smalltext'>".LAN_114."</span></td>
-<td style='width:80%' class='forumheader2'><span class='defaulttext'>".
-($hideemail ? $rs ->form_radio("hideemail", 1, 1)." ".LAN_416."&nbsp;&nbsp;".$rs ->form_radio("hideemail", 0)." ".LAN_417 : $rs ->form_radio("hideemail", 1)." ".LAN_416."&nbsp;&nbsp;".$rs ->form_radio("hideemail", 0, 1)." ".LAN_417)."</span>
-<br />
-</td>
-</tr>
-
-<tr>
-<td colspan='2' class='forumheader'>".LAN_419."</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_144."</td>
-<td style='width:80%' class='forumheader2'>
-".$rs -> form_text("website", 60, $website, 150)."
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_115."</td>
-<td style='width:80%' class='forumheader2'>
-".$rs -> form_text("icq", 20, $icq, 10)."
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_116."</td>
-<td style='width:80%' class='forumheader2'>
-<input class='tbox' type='text' name='aim' size='30' value='$aim' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_117."</td>
-<td style='width:80%' class='forumheader2'>
-<input class='tbox' type='text' name='msn' size='30' value='$msn' maxlength='100' />
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_118."</td>
-<td style='width:80%' class='forumheader2'>
-
-".$rs -> form_select_open("birth_day").
-$rs -> form_option("", 0);
-$today = getdate();
-$year = $today['year'];
-for($a=1; $a<=31; $a++){
-        $text .= ($birth_day == $a ? $rs -> form_option($a, 1) : $rs -> form_option($a, 0));
-}
-$text .= $rs -> form_select_close().
-$rs -> form_select_open("birth_month").
-$rs -> form_option("", 0);
-for($a=1; $a<=12; $a++){
-        $text .= ($birth_month == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a));
-}
-$text .= $rs -> form_select_close().
-$rs -> form_select_open("birth_year").
-$rs -> form_option("", 0);
-for($a=1900; $a<=$year; $a++){
-        $text .= ($birth_year == $a ? $rs -> form_option($a, 1) : $rs -> form_option($a, 0));
-}
-
-$text .= $rs -> form_select_close()."</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_119."</td>
-<td style='width:80%' class='forumheader2'>
-<input class='tbox' type='text' name='location' size='60' value='$location' maxlength='200' />
-</td>
-</tr>";
-
-if($sql -> db_Select("core", " e107_value", " e107_name='user_entended'")){
-        $row = $sql -> db_Fetch();
-        $user_entended = unserialize($row[0]);
-        $c=0;
-
-        $user_pref = unserialize($user_prefs);
-
-        while(list($key, $u_entended) = each($user_entended)){
-                if($u_entended){
-                require_once(e_HANDLER."user_extended.php");
-                $text .= user_extended_edit($key,$u_entended,"forumheader3","left");
-                }
-        }
-}
-
-$text .= "<tr>
-<td style='width:20%;vertical-align:top' class='forumheader3'>".LAN_120."</td>
-<td style='width:80%' class='forumheader2'>
-<textarea class='tbox' name='signature' cols='58' rows='4' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$signature</textarea>
-<br />
-<input class='helpbox' type='text' name='helpb' size='90' />
-<br />
-".ren_help()."
-</td>
-</tr>
-
-<tr>
-<td style='width:20%' class='forumheader3'>".LAN_122."</td>
-<td style='width:80%' class='forumheader2'>
-<select name='user_timezone' class='tbox'>\n";
-timezone();
-$count = 0;
-while($timezone[$count]){
-        if($timezone[$count] == $user_timezone){
-                $text .= "<option value='".$timezone[$count]."' selected='selected'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
-        }else{
-                $text .= "<option value='".$timezone[$count]."'>(GMT".$timezone[$count].") ".$timearea[$count]."</option>\n";
-        }
-        $count++;
-}
-
-$text .= "</select>
-</td>
-</tr>
-
-<tr>
-<td colspan='2' class='forumheader'>".LAN_420."</td>
-</tr>
-
-<tr>
-<td colspan='2' class='forumheader3' style='text-align:center'>".LAN_404.($pref['im_width'] || $pref['im_height'] ? "<br />".($pref['im_width'] ? MAX_AVWIDTH.$pref['im_width']." pixels. " : "").($pref['im_height'] ? MAX_AVHEIGHT.$pref['im_height']." pixels." : "") : "")."</td>
-</tr>
-
-
-<tr>
-<td style='width:20%; vertical-align:top' class='forumheader3'>".LAN_422."<br /><span class='smalltext'>".LAN_423."</span></td>
-<td style='width:80%' class='forumheader2'>
-<input class='tbox' type='text' name='image' size='60' value='$image' maxlength='100' />
-</td>
-</tr>
-
-
-
-<tr>
-<td style='width:20%; vertical-align:top' class='forumheader3'>".LAN_421."<br /><span class='smalltext'>".LAN_424."</span></td>
-<td style='width:80%' class='forumheader2'>
-<input class='button' type ='button' style=' cursor:hand' size='30' value='".LAN_403."' onclick='expandit(this)' />
-<div style='display:none' >";
-$avatarlist[0] = "";
-$handle=opendir(e_IMAGE."avatars/");
-while ($file = readdir($handle)){
-        if($file != "." && $file != ".." && $file != "index.html" && $file != "CVS"){
-                $avatarlist[] = $file;
-        }
-}
-closedir($handle);
-
-for($c=1; $c<=(count($avatarlist)-1); $c++){
-        $text .= "<a href='javascript:addtext_us(\"$avatarlist[$c]\")'><img src='".e_IMAGE."avatars/".$avatarlist[$c]."' style='border:0' alt='' /></a> ";
-}
-
-$text .= "<br />
-</div>
-</td>
-</tr>";
-
-if($pref['avatar_upload'] && FILE_UPLOADS){
-
-        $text .= "<tr>
-<td style='width:20%; vertical-align:top' class='forumheader3'>".LAN_415."<br /></td>
-<td style='width:80%' class='forumheader2'>
-<input class='tbox' name='file_userfile[]' type='file' size='47' />
-</td>
-</tr>";
-}
-
-if($pref['photo_upload'] && FILE_UPLOADS){
-        $text .= "<tr>
-<td colspan='2' class='forumheader'>".LAN_425."</td>
-</tr>
-
-<tr>
-<td style='width:20%; vertical-align:top' class='forumheader3'>".LAN_414."<br /><span class='smalltext'>".LAN_426."</span></td>
-<td style='width:80%' class='forumheader2'>
-<input class='tbox' name='file_userfile[]' type='file' size='47' />
-</td>
-</tr>";
-}
-
-
-if(!e_QUERY){
-        $text .= "
-
-
-<tr>
-<td colspan='2' class='forumheader'>".LAN_427."</td>
-</tr>
-<tr>
-<td colspan='2' class='forumheader3' style='text-align:center'>
-
-<input class='button' type='submit' name='sub_news' value='".LAN_428."' />&nbsp;&nbsp;";
-if($pref['link_submit'] && check_class($pref['link_submit_class'])){
-        $text .= "<input class='button' type='submit' name='sub_link' value='".LAN_429."' />&nbsp;&nbsp;";
-}
-if($pref['upload_enabled'] && (!$pref['upload_class'] || check_class($pref['upload_class']))){
-        $text .= "<input class='button' type='submit' name='sub_download' value='".LAN_430."' />&nbsp;&nbsp;";
-}
-
-if($pref['article_submit'] && check_class($pref['article_submit_class'])){
-        $text .= "<input class='button' type='submit' name='sub_article' value='".LAN_431."' />&nbsp;&nbsp;";
-}
-if($pref['review_submit'] && check_class($pref['review_submit_class'])){
-        $text .= "<input class='button' type='submit' name='sub_review' value='".LAN_432."' />&nbsp;&nbsp;";
-}
-
-$text .= "</td>
-</tr>";
-}
-$text .= "
-
-
-
-<tr style='vertical-align:top'>
-<td colspan='2' style='text-align:center' class='forumheader'><input class='button' type='submit' name='updatesettings' value='".LAN_154."' /></td>
-</tr>
-</table>
-</div><div>
-<input type='hidden' name='_uid' value='$_uid' />
-<input type='hidden' name='_pw' value='$user_password' />
-<input type='hidden' name='_user_sess' value='$user_sess' /></div>
-</form>
-";
-
-$ns -> tablerender(LAN_155, $text);
-require_once(FOOTERF);
-
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-function timezone(){
-        /*
-        # Render style table
-        # - parameters                none
-        # - return                                timezone arrays
-        # - scope                                        public
-        */
-        global $timezone, $timearea;
-        $timezone = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "GMT", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12", "+13");
-        $timearea = array("International DateLine West", "Samoa", "Hawaii", "Alaska", "Pacific Time (US and Canada)", "Mountain Time (US and Canada)", "Central Time (US and Canada), Central America", "Eastern Time (US and Canada)", "Atlantic Time (Canada)", "Greenland, Brasilia, Buenos Aires, Georgetown", "Mid-Atlantic", "Azores", "GMT - UK, Ireland, Lisbon", "West Central Africa, Western Europe", "Greece, Egypt, parts of Africa", "Russia, Baghdad, Kuwait, Nairobi", "Abu Dhabi, Kabul", "Islamabad, Karachi", "Astana, Dhaka", "Bangkok, Rangoon", "Hong Kong, Singapore, Perth, Beijing", "Tokyo, Seoul", "Brisbane, Canberra, Sydney, Melbourne", "Soloman Islands", "New Zealand", "Nuku'alofa");
-}
-
-
-function req($field){
-        global $pref;
-        if($field ==2){
-                $ret = "<span style='text-align:right;font-size:15px; color:red'> *</span>";
-        } else {
-                $ret = "";
-        }
-        return $ret;
-}
-//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
-
-function headerjs(){
-$script = "<script type=\"text/javascript\">
-function addtext_us(sc){
-        document.getElementById('dataform').image.value = sc;
-}
-
-</script>\n";
-return $script;
-
-}
-
+<?php
+/*
++ ----------------------------------------------------------------------------+
+|     e107 website system
+|
+|     Steve Dunstan 2001-2002
+|     http://e107.org
+|     jalist@e107.org
+|
+|     Released under the terms and conditions of the
+|     GNU General Public License (http://gnu.org).
+|
+|     $Source: /cvsroot/e107/e107_0.7/usersettings.php,v $
+|     $Revision: 1.69 $
+|     $Date: 2006/05/18 15:12:58 $
+|     $Author: mcfly_e107 $
++----------------------------------------------------------------------------+
+*/
+
+require_once("class2.php");
+require_once(e_HANDLER."ren_help.php");
+require_once(e_HANDLER."user_extended_class.php");
+$ue = new e107_user_extended;
+
+if (isset($_POST['sub_news']))
+{
+    header("location:".e_BASE."submitnews.php");
+    exit;
+}
+
+if (isset($_POST['sub_link'])) {
+    header("location:".e_PLUGIN."links_page/links.php?submit");
+    exit;
+}
+
+if (isset($_POST['sub_download'])) {
+    header("location:".e_BASE."upload.php");
+    exit;
+}
+
+if (isset($_POST['sub_article'])) {
+    header("location:".e_BASE."subcontent.php?article");
+    exit;
+}
+
+if (isset($_POST['sub_review'])) {
+    header("location:".e_BASE."subcontent.php?review");
+    exit;
+}
+
+if (!USER) {
+    header("location:".e_BASE."index.php");
+    exit;
+}
+
+if (!ADMIN && e_QUERY && e_QUERY != "update") {
+    header("location:".e_BASE."usersettings.php");
+    exit;
+}
+
+require_once(e_HANDLER."ren_help.php");
+
+if(is_readable(THEME."usersettings_template.php"))
+{
+	include_once(THEME."usersettings_template.php");
+}
+else
+{
+	include_once(e_THEME."templates/usersettings_template.php");
+}	
+include_once(e_FILE."shortcode/batch/usersettings_shortcodes.php");
+
+require_once(e_HANDLER."calendar/calendar_class.php");
+$cal = new DHTML_Calendar(true);
+$_uid = is_numeric(e_QUERY) ? intval(e_QUERY) : "";
+
+require_once(HEADERF);
+
+// Save Form Data  --------------------------------------->
+
+if (isset($_POST['updatesettings']))
+{
+	if ($_uid && ADMIN)
+	{
+		$inp = $_uid;
+		$remflag = TRUE;
+	}
+	else
+	{
+		$inp = USERID;
+	}
+
+	$_POST['image'] = str_replace(array('\'', '"', '(', ')'), '', $_POST['image']);   // these are invalid anyways, so why allow them? (XSS Fix)
+	// check prefs for required fields =================================.
+
+	if ($_POST['image'] && $size = getimagesize($_POST['image'])) {
+		$avwidth = $size[0];
+		$avheight = $size[1];
+		$avmsg = "";
+
+		$pref['im_width'] = ($pref['im_width']) ? $pref['im_width'] : 120;
+		$pref['im_height'] = ($pref['im_height']) ? $pref['im_height'] : 100;
+		if ($avwidth > $pref['im_width']) {
+			$avmsg .= LAN_USET_1."<br />".LAN_USET_2.": {$pref['im_width']}<br /><br />";
+		}
+		if ($avheight > $pref['im_height']) {
+			$avmsg .= LAN_USET_3."<br />".LAN_USET_4.": {$pref['im_height']}";
+		}
+		if ($avmsg) {
+			$_POST['image'] = "";
+			$messsage = $avmsg;
+		}
+	}
+
+	$signup_option_title = array(LAN_308, LAN_120, LAN_121, LAN_122, LAN_USET_6);
+	$signup_option_names = array("realname", "signature", "image", "timezone", "class");
+
+	foreach($signup_option_names as $key => $value)
+	{
+		if ($pref['signup_option_'.$value] == 2 && !$_POST[$value] && !$_uid)
+		{
+			$error .= LAN_SIGNUP_6.$signup_option_title[$key].LAN_SIGNUP_7."\\n";
+		}
+    }
+
+
+	if($sql->db_Select('user_extended_struct'))	{
+		while($row = $sql->db_Fetch()) {
+			$extList["user_".$row['user_extended_struct_name']] = $row;
+		}
+	}
+
+	$ue_fields = "";
+	foreach($_POST['ue'] as $key => $val)
+	{
+		$err = false;
+		$parms = explode("^,^", $extList[$key]['user_extended_struct_parms']);
+		$regex = $tp->toText($parms[1]);
+		$regexfail = $tp->toText($parms[2]);
+		if(defined($regexfail)) {$regexfail = constant($regexfail);}
+		if($val == '' && $extList[$key]['user_extended_struct_required'] == 1 && !$_uid)
+		{
+			$error .= LAN_SIGNUP_6.substr($key,5)." ".LAN_SIGNUP_7."\\n";
+			$err = TRUE;
+		}
+		if($regex != "" && $val != "")
+		{
+			if(!preg_match($regex, $val))
+			{
+				$error .= $regexfail."\\n";
+				$err = TRUE;
+			}
+		}
+		if(!$err)
+		{
+			$val = $tp->toDB($val);
+			$ue_fields .= ($ue_fields) ? ", " : "";
+			$ue_fields .= $key."='".$val."'";
+		}
+	}
+	if($ue_fields)
+	{
+		$hidden_fields = implode("^", array_keys($_POST['hide']));
+		if($hidden_fields != "")
+		{
+			$hidden_fields = "^".$hidden_fields."^";
+		}
+		$ue_fields .= ", user_hidden_fields = '".$hidden_fields."'";
+	}
+
+	// ====================================================================
+
+	$pwreset = "";
+	if ($_POST['password1'] != $_POST['password2']) {
+		$error .= LAN_105."\\n";
+	}
+	else
+	{
+		if($_POST['password1'] != "")
+		{
+			$pwreset = ", user_password = '".md5($_POST['password1'])."' ";
+		}
+	}
+
+	if(isset($pref['signup_disallow_text']))
+	{
+		$tmp = explode(",", $pref['signup_disallow_text']);
+		foreach($tmp as $disallow){
+			if(strstr($_POST['username'], $disallow)){
+				$error .= LAN_USET_11."\\n";
+			}
+		}
+	}
+
+	if (strlen($_POST['password1']) < $pref['signup_pass_len'] && $_POST['password1'] != "") {
+		$error .= LAN_SIGNUP_4.$pref['signup_pass_len'].LAN_SIGNUP_5."\\n";
+		$password1 = "";
+		$password2 = "";
+	}
+
+	if (!check_email($_POST['email'])) 
+	{
+	  	$error .= LAN_106."\\n";
+	}
+
+	if ($sql->db_Select("user", "user_name, user_email", "user_email='".$tp -> toDB($_POST['email'])."' AND user_id !=".USERID."' ")) {
+	  	$error .= LAN_408."\\n";
+	}
+
+//	$username = strip_tags($_POST['username']);
+	$loginname = strip_tags($_POST['loginname']);
+	
+	if (!$loginname)
+	{
+		$sql->db_Select("user", "user_loginname", "user_id='".intval($inp)."'");
+		$row = $sql -> db_Fetch();
+		$loginname = $row['user_loginname'];
+	}
+	
+	$user_sess = "";
+	if ($file_userfile['error'] != 4)
+	{
+		require_once(e_HANDLER."upload_handler.php");
+		require_once(e_HANDLER."resize_handler.php");
+		
+		if ($uploaded = file_upload(e_FILE."public/avatars/", "avatar"))
+		{
+			if ($uploaded[0]['name'] && $pref['avatar_upload'])
+			{
+				// avatar uploaded
+				$_POST['image'] = "-upload-".$uploaded[0]['name'];
+				if (!resize_image(e_FILE."public/avatars/".$uploaded[0]['name'], e_FILE."public/avatars/".$uploaded[0]['name'], "avatar"))
+				{
+					unset($message);
+					$error .= RESIZE_NOT_SUPPORTED."\\n";
+					@unlink(e_FILE."public/avatars/".$uploaded[0]['name']);
+				}
+			}
+			if ($uploaded[1]['name'] || (!$pref['avatar_upload'] && $uploaded[0]['name']))
+			{
+				// photograph uploaded
+				$user_sess = ($pref['avatar_upload'] ? $uploaded[1]['name'] : $uploaded[0]['name']);
+				resize_image(e_FILE."public/avatars/".$user_sess, e_FILE."public/avatars/".$user_sess, 180);
+			}
+		}
+	}
+
+	if ($user_sess != "")
+	{
+		$sesschange = ", user_sess = '".$tp->toDB($user_sess)."' ";
+	}
+
+	if (!$error)
+	{
+		if (isset($_POST['username']) && check_class($pref['displayname_class']))
+		{
+			$username = strip_tags($_POST['username']);
+			$username = $tp->toDB(substr($username, 0, $pref['displayname_maxlength']));
+			$new_username = "user_name = '{$username}'";
+		}
+
+		$_POST['signature'] = $tp->toDB($_POST['signature']);
+		$_POST['realname'] = $tp->toDB($_POST['realname']);
+
+		$new_customtitle = "";
+
+		if(isset($_POST['customtitle']) && ($pref['forum_user_customtitle'] || ADMIN))
+		{
+			$new_customtitle = ", user_customtitle = '".$tp->toDB($_POST['customtitle'])."' ";
+		}
+		unset($_POST['password1']);
+		unset($_POST['password2']);
+
+		$ret = $e_event->trigger("preuserset", $_POST);
+		if(trim($_POST['user_xup']) != "")
+		{
+			if($sql->db_Select('user', 'user_xup', "user_id = '".intval($inp)."'"))
+			{
+				$row = $sql->db_Fetch();
+				$update_xup = ($row['user_xup'] != $_POST['user_xup']) ? TRUE : FALSE;
+			}
+		}
+
+		if ($ret == '')
+		{
+			$sql->db_Update("user", "{$new_username} {$pwreset} ".$sesschange.", user_email='".$tp -> toDB($_POST['email'])."', user_signature='".$_POST['signature']."', user_image='".$tp -> toDB($_POST['image'])."', user_timezone='".$tp -> toDB($_POST['timezone'])."', user_hideemail='".$tp -> toDB($_POST['hideemail'])."', user_login='".$_POST['realname']."' {$new_customtitle}, user_xup='".$tp -> toDB($_POST['user_xup'])."' WHERE user_id='".intval($inp)."' ");
+			// If user has changed display name, update the record in the online table
+			if(isset($username) && ($username != USERNAME) && !$_uid)
+			{
+				$sql->db_Update("online", "online_user_id = '".USERID.".".$username."' WHERE online_user_id = '".USERID.".".USERNAME."'");
+			}
+
+			if(ADMIN && getperms("4"))
+			{
+				$sql -> db_Update("user", "user_loginname='".$tp -> toDB($loginname)."' WHERE user_id='".intval($inp)."' ");
+			}
+
+			if($ue_fields)
+			{
+				$sql->db_Select_gen("INSERT INTO #user_extended (user_extended_id, user_hidden_fields) values ('".intval($inp)."', '')");
+				$sql->db_Update("user_extended", $ue_fields." WHERE user_extended_id = '".intval($inp)."'");
+			}
+
+			// Update Userclass =======
+			if (!$_uid && $sql->db_Select("userclass_classes", "*", "userclass_editclass IN (".USERCLASS_LIST.")"))
+			{
+				$ucList = $sql->db_getList();
+				if ($sql->db_Select("user", "user_class", "user_id = '".intval($inp)."'"))
+				{
+					$row = $sql->db_Fetch();
+					$cur_classes = explode(",", $row['user_class']);
+					$newclist = array_flip($cur_classes);
+					foreach($ucList as $c)
+					{
+						$cid = $c['userclass_id'];
+						if(!in_array($cid, $_POST['class']))
+						{
+							unset($newclist[$cid]);
+						}
+						else
+						{
+							$newclist[$cid] = 1;
+						}
+					}
+					$newclist = array_keys($newclist);
+					$nid = implode(',', array_diff($newclist, array('')));
+					$sql->db_Update("user", "user_class='".$nid."' WHERE user_id='".intval($inp)."'");
+				}
+			}
+			
+			if($update_xup == TRUE)
+			{
+				require_once(e_HANDLER."login.php");
+				userlogin::update_xup($inp, $_POST['user_xup']);
+			}
+
+			$e_event->trigger("postuserset", $_POST);
+
+			// =======================
+
+			if(e_QUERY == "update") {
+            	header("Location: index.php");
+			}
+			$message = "<div style='text-align:center'>".LAN_150."</div>";
+			$caption = LAN_151;
+		} else {
+			$message = "<div style='text-align:center'>".$ret."</div>";
+			$caption = LAN_151;
+		}
+		unset($_POST);
+	}
+}
+// -------------------
+
+if(isset($message))
+{
+	$ns->tablerender($caption, $message);
+}
+
+// ---------------------
+if ($error)
+{
+	require_once(e_HANDLER."message_handler.php");
+	message_handler("P_ALERT", $error);
+	$adref = $_POST['adminreturn'];
+}
+
+$uuid = ($_uid) ? $_uid : USERID;
+
+$qry = "
+SELECT u.*, ue.* FROM #user AS u
+LEFT JOIN #user_extended AS ue ON ue.user_extended_id = u.user_id
+WHERE u.user_id='".intval($uuid)."'
+";
+
+$sql->db_Select_gen($qry);
+$curVal=$sql->db_Fetch();
+$tmp = ($curVal['user_class'] != "" ? explode(",", $curVal['user_class']) : "");
+$tmp[] = e_UC_MEMBER;
+$tmp[] = e_UC_READONLY;
+$tmp[] = e_UC_PUBLIC;
+if($curVal['user_admin'] == 1)
+{
+	$tmp[] = e_UC_ADMIN;
+}	
+$curVal['userclass_list'] = implode(",", $tmp);
+
+if($_POST)
+{     // Fix for all the values being lost when an error occurred.
+	foreach($_POST as $key => $val)
+	{
+		$curVal["user_".$key] = $val;
+	}
+	foreach($_POST['ue'] as $key => $val)
+	{
+		$curVal[$key] = $val;
+	}
+}
+
+require_once(e_HANDLER."form_handler.php");
+$rs = new form;
+
+$text = (e_QUERY ? $rs->form_open("post", e_SELF."?".e_QUERY, "dataform", "", " enctype='multipart/form-data'") : $rs->form_open("post", e_SELF, "dataform", "", " enctype='multipart/form-data'"));
+
+if(e_QUERY == "update")
+{
+	$text .= "<div class='fborder' style='text-align:center'><br />".str_replace("*","<span style='color:red'>*</span>",LAN_USET_9)."<br />".LAN_USET_10."<br /><br /></div>";
+}
+
+$text .= $tp->parseTemplate($USERSETTINGS_EDIT, FALSE, $usersettings_shortcodes);
+$text .= "<div>";
+
+$text .= "
+	<input type='hidden' name='_uid' value='$_uid' />
+	</div>
+	</form>
+	";
+
+$ns->tablerender(LAN_155, $text);
+require_once(FOOTERF);
+
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+
+function req($field) {
+	global $pref;
+	if ($field == 2)
+	{
+		$ret = "<span style='text-align:right;font-size:15px; color:red'> *</span>";
+	}
+	else
+	{
+		$ret = "";
+	}
+	return $ret;
+}
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
+
+function headerjs() {
+	global $cal;
+	$script = "<script type=\"text/javascript\">
+		function addtext_us(sc){
+		document.getElementById('dataform').image.value = sc;
+		}
+
+		</script>\n";
+
+	$script .= $cal->load_files();
+	return $script;
+}
 ?>
\ No newline at end of file
